diff options
author | Michael Brown <mcb30@ipxe.org> | 2010-09-22 00:20:31 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2010-09-22 16:43:37 +0100 |
commit | adbe63860ad3b42539e4f6e5e14051e04ebe8447 (patch) | |
tree | bfb5b3eb6a38c37debb3bd484644d5d1b6ab3da4 /src/net/aoe.c | |
parent | d052efb2546d05572f553946a16ccca42313b25a (diff) | |
download | ipxe-adbe63860ad3b42539e4f6e5e14051e04ebe8447.tar.gz |
[aoe] Fail immediately when network device is closed
Avoid a tedious timeout delay when attempting to issue a command over
a network device that has been closed.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/aoe.c')
-rw-r--r-- | src/net/aoe.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/net/aoe.c b/src/net/aoe.c index fec8d33f0..b959a00a1 100644 --- a/src/net/aoe.c +++ b/src/net/aoe.c @@ -647,8 +647,16 @@ static struct aoe_command * aoecmd_create ( struct aoe_device *aoedev, static int aoedev_ata_command ( struct aoe_device *aoedev, struct interface *parent, struct ata_cmd *command ) { + struct net_device *netdev = aoedev->netdev; struct aoe_command *aoecmd; + /* Fail immediately if net device is closed */ + if ( ! netdev_is_open ( netdev ) ) { + DBGC ( aoedev, "AoE %s cannot issue command while net device " + "is closed\n", aoedev_name ( aoedev ) ); + return -EWOULDBLOCK; + } + /* Create command */ aoecmd = aoecmd_create ( aoedev, &aoecmd_ata ); if ( ! aoecmd ) |