X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=doc%2FREADME.drivers.eth;h=1a9a23b51b92443e076da9468831ed3352f2b0cf;hb=HEAD;hp=42af442ea17dfe31f40848e93f50eede8b154740;hpb=3f54dc48c0579b934eba5cfaeb19fb6c8ddcb9ec;p=u-boot diff --git a/doc/README.drivers.eth b/doc/README.drivers.eth index 42af442ea1..1a9a23b51b 100644 --- a/doc/README.drivers.eth +++ b/doc/README.drivers.eth @@ -1,3 +1,9 @@ +!!! WARNING !!! + +This guide describes to the old way of doing things. No new Ethernet drivers +should be implemented this way. All new drivers should be written against the +U-Boot core driver model. See doc/driver-model/README.txt + ----------------------- Ethernet Driver Guide ----------------------- @@ -135,11 +141,11 @@ 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. -For each packet you receive, you should call the NetReceive() function on it +For each packet you receive, you should call the net_process_received_packet() 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 +already in the .bss (net_rx_packets), so there should be no need to allocate your +own. This doesn't mean you must use the net_rx_packets array however; you're +free to call the net_process_received_packet() function with any buffer you wish. So the pseudo code here would look something like: int ape_recv(struct eth_device *dev) { @@ -147,9 +153,9 @@ int ape_recv(struct eth_device *dev) ... while (packets_are_available()) { ... - length = ape_get_packet(&NetRxPackets[i]); + length = ape_get_packet(&net_rx_packets[i]); ... - NetReceive(&NetRxPackets[i], length); + net_process_received_packet(&net_rx_packets[i], length); ... if (++i >= PKTBUFSRX) i = 0;