[U-Boot] [PATCH 10/18] dm: eth: Avoid blocking on packet reception

Simon Glass sjg at chromium.org
Thu Jul 23 22:18:36 CEST 2015


On 6 July 2015 at 16:47, Simon Glass <sjg at chromium.org> wrote:
> 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 at chromium.org>
> ---
>
>  drivers/net/designware.c  |  2 +-
>  drivers/net/sandbox-raw.c |  2 +-
>  drivers/net/sandbox.c     |  2 +-
>  drivers/net/sunxi_emac.c  |  2 +-
>  include/net.h             | 10 +++++++++-
>  net/eth.c                 |  5 ++++-
>  6 files changed, 17 insertions(+), 6 deletions(-)

Applied to u-boot-dm.


More information about the U-Boot mailing list