mirror of https://github.com/ipxe/ipxe.git
[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>pull/1/head
parent
d052efb254
commit
adbe63860a
|
@ -647,8 +647,16 @@ static struct aoe_command * aoecmd_create ( struct aoe_device *aoedev,
|
||||||
static int aoedev_ata_command ( struct aoe_device *aoedev,
|
static int aoedev_ata_command ( struct aoe_device *aoedev,
|
||||||
struct interface *parent,
|
struct interface *parent,
|
||||||
struct ata_cmd *command ) {
|
struct ata_cmd *command ) {
|
||||||
|
struct net_device *netdev = aoedev->netdev;
|
||||||
struct aoe_command *aoecmd;
|
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 */
|
/* Create command */
|
||||||
aoecmd = aoecmd_create ( aoedev, &aoecmd_ata );
|
aoecmd = aoecmd_create ( aoedev, &aoecmd_ata );
|
||||||
if ( ! aoecmd )
|
if ( ! aoecmd )
|
||||||
|
|
Loading…
Reference in New Issue