[U-Boot-Users] guide/document on writing network drivers
Ben Warren
bwarren at qstreams.com
Mon Jul 16 16:02:33 CEST 2007
Hi Mike,
On Sun, 2007-07-15 at 17:10 -0400, Mike Frysinger wrote:
> is there a document somewhere covering the API for the ethernet layer ? some
> drivers i look at implement the eth_* functions (like drivers/smc9111.c)
> while others hook into the generic net/ layer but requires adding a call to
> the init function in net/eth.c ...
> -mike
The second method you describe is preferred because it allows multiple,
different ethernet controllers to exist on a board. Each device is
registered into a list, which can then be traversed when trying to
access a network. The drivers end up looking more like Linux ones,
which is something we should aspire towards. As you've pointed out,
though, this method requires you to explicitly add an initialize() call
to net/eth.c, which is clumsy to say the least.
I haven't had a chance yet to look at what the smart guys are doing in
v2. In my mind this design is a serious candidate for refactoring...
cheers,
Ben
More information about the U-Boot
mailing list