diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2015-04-03 20:09:46 -0500 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:18 -0600 |
commit | 63c9729a1306ee3fed54923f53b20ce769884a81 (patch) | |
tree | 3aaf0e23d5620892ed37593aca29d7a77fbf6699 /net | |
parent | 5bc48308960b8d28d9d7653efbb91c1be390c916 (diff) | |
download | u-boot-63c9729a1306ee3fed54923f53b20ce769884a81.tar.gz u-boot-63c9729a1306ee3fed54923f53b20ce769884a81.tar.bz2 u-boot-63c9729a1306ee3fed54923f53b20ce769884a81.zip |
dm: eth: Provide a way for drivers to manage packet buffers
Some drivers need a chance to manage their receive buffers after the
packet has been handled by the network stack. Add an operation that
will allow the driver to be called in that case.
Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Tested-on: pcduino3
Diffstat (limited to 'net')
-rw-r--r-- | net/eth.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -344,7 +344,9 @@ int eth_rx(void) ret = eth_get_ops(current)->recv(current, &packet); if (ret > 0) net_process_received_packet(packet, ret); - else + if (ret >= 0 && eth_get_ops(current)->free_pkt) + eth_get_ops(current)->free_pkt(current, packet, ret); + if (ret <= 0) break; } if (ret == -EAGAIN) |