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 ?