guide/document on writing network drivers
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20070715/d9421d6a/attachment.pgp
Hi Mike,
Quoted 5 lines · Mike Frysinger
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 genericnet/layer but requires adding a call to the init function innet/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