X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2FREADME.drivers.eth;h=d0c3571165bcbc63fd54721345066542a35e25e9;hb=859500a2be94bfa77a845b9c8a4c499587035fd5;hp=e06d3ad44ba1cfd2128a778de7daa800b325fbea;hpb=99dbd4efd6d5ecc37d7e8f28b20d9be8c83055c7;p=u-boot diff --git a/doc/README.drivers.eth b/doc/README.drivers.eth index e06d3ad44b..d0c3571165 100644 --- a/doc/README.drivers.eth +++ b/doc/README.drivers.eth @@ -88,7 +88,7 @@ The return value for this function should be as follows: < 0 - failure (hardware failure, not probe failure) >=0 - number of interfaces detected -You might notice that many drivers seem to use xxx_initialize() rather than +You might notice that many drivers seem to use xxx_initialize() rather than xxx_register(). This is the old naming convention and should be avoided as it causes confusion with the driver-specific init function. @@ -122,10 +122,12 @@ function can be called multiple times in a row. The recv function should process packets as long as the hardware has them readily available before returning. i.e. you should drain the hardware fifo. -The common code sets up packet buffers for you already (NetRxPackets), so there -is no need to allocate your own. For each packet you receive, you should call -the NetReceive() function on it with the packet length. So the pseudo code -here would look something like: +For each packet you receive, you should call the NetReceive() function on it +along with the packet length. The common code sets up packet buffers for you +already in the .bss (NetRxPackets), so there should be no need to allocate your +own. This doesn't mean you must use the NetRxPackets array however; you're +free to call the NetReceive() function with any buffer you wish. So the pseudo +code here would look something like: int ape_recv(struct eth_device *dev) { int length, i = 0; @@ -145,7 +147,8 @@ int ape_recv(struct eth_device *dev) } The halt function should turn off / disable the hardware and place it back in -its reset state. +its reset state. It can be called at any time (before any call to the related +init function), so make sure it can handle this sort of thing. So the call graph at this stage would look something like: some net operation (ping / tftp / whatever...)