]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
dm: eth: Avoid blocking on packet reception
authorSimon Glass <sjg@chromium.org>
Mon, 6 Jul 2015 22:47:49 +0000 (16:47 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 9 Sep 2015 11:48:58 +0000 (13:48 +0200)
commit8b0998bba4a9b84ba0566696dfbee57a6104075f
tree941d8ec67aeb47b95bb4ae83bc8b3d6accdba127
parent2e0837c4aa25142014568ad0d3938c2b16e36054
dm: eth: Avoid blocking on packet reception

Some devices can take a long time to work out whether they have a new packet
or now. For example the ASIX USB Ethernet dongle can take 5 seconds to do
this, since it waits until it gets a new packet on the wire before allowing
the USB bulk read packet to be submitted.

At present with driver mode the Ethernet receive code reads 32 packets. This
can take a very long time if we must wait for all 32 packets. The old code
(before driver model) worked by reading a single set of packets from the USB
device, then processing all the packets with in. It would be nice to use
the same behaviour with driver model.

Add a flag to the receive method which indicates that the driver should try
to find a packet if available, by consulting the hardware. When the flag is
not set, it should just return any packet data it has already received. If
there is none, it should return -EAGAIN so that the loop will terminate.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/net/designware.c
drivers/net/sandbox-raw.c
drivers/net/sandbox.c
drivers/net/sunxi_emac.c
include/net.h
net/eth.c