Hi, Having to write a driver for an ethernet device, I noticed that there are 2 memcpy()s in most of the drivers, one when sending and one when receiving. This usually happens from and to the sg_list passed from the hardware independent ethernet driver. Now, is this really necessary? For my case, I have one ring of buffers for each send and receive. I would like to craft the driver as such to point the buffers to the buffer in sg_list, but I can set up the rings only when the device is stopped. This excludes ad-hoc setting when receiving/sending. My idea was to create the sg_list-s (one for send and one for receive) so they can be available to the init function from the NETDEVTAB_ENTRY macro. In this way, a driver will need to take care of the pointers to/from the sg_list-s. Any comments/advices on this ?
Best regards, Edgar PS: reference files: /ecos/packages/devs/eth/powerpc/fec/current/src/if_fec.c (specific ethernet implementation, has 2 memcpy in fec_eth_send and fec_eth_recv) /ecos/packages/io/eth/current/src/net/eth_drv.c (hw independent ethernet driver, sg_list appears on eth_drv_send and eth_drv_recv) -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
