[fcp] Use EINVAL for URI parsing errors and EPROTO for protocol errors
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
66e7619099
commit
f5115f96f7
|
@ -512,7 +512,7 @@ static int fcpcmd_recv_xfer_rdy ( struct fcp_command *fcpcmd,
|
||||||
DBGC ( fcpdev, "FCP %p xchg %04x received invalid transfer "
|
DBGC ( fcpdev, "FCP %p xchg %04x received invalid transfer "
|
||||||
"ready IU:\n", fcpdev, fcpcmd->xchg_id );
|
"ready IU:\n", fcpdev, fcpcmd->xchg_id );
|
||||||
DBGC_HDA ( fcpdev, 0, iobuf->data, iob_len ( iobuf ) );
|
DBGC_HDA ( fcpdev, 0, iobuf->data, iob_len ( iobuf ) );
|
||||||
rc = -EINVAL;
|
rc = -EPROTO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if ( ntohl ( xfer_rdy->offset ) != fcpcmd->offset ) {
|
if ( ntohl ( xfer_rdy->offset ) != fcpcmd->offset ) {
|
||||||
|
@ -521,7 +521,7 @@ static int fcpcmd_recv_xfer_rdy ( struct fcp_command *fcpcmd,
|
||||||
"delivery (expected %zd, requested %d)\n",
|
"delivery (expected %zd, requested %d)\n",
|
||||||
fcpdev, fcpcmd->xchg_id, fcpcmd->offset,
|
fcpdev, fcpcmd->xchg_id, fcpcmd->offset,
|
||||||
ntohl ( xfer_rdy->offset ) );
|
ntohl ( xfer_rdy->offset ) );
|
||||||
rc = -EINVAL;
|
rc = -EPROTO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
DBGC2 ( fcpdev, "FCP %p xchg %04x XFER_RDY [%08x,%08x)\n",
|
DBGC2 ( fcpdev, "FCP %p xchg %04x XFER_RDY [%08x,%08x)\n",
|
||||||
|
@ -564,7 +564,7 @@ static int fcpcmd_recv_rsp ( struct fcp_command *fcpcmd,
|
||||||
DBGC ( fcpdev, "FCP %p xchg %04x received invalid response "
|
DBGC ( fcpdev, "FCP %p xchg %04x received invalid response "
|
||||||
"IU:\n", fcpdev, fcpcmd->xchg_id );
|
"IU:\n", fcpdev, fcpcmd->xchg_id );
|
||||||
DBGC_HDA ( fcpdev, 0, iobuf->data, iob_len ( iobuf ) );
|
DBGC_HDA ( fcpdev, 0, iobuf->data, iob_len ( iobuf ) );
|
||||||
rc = -EINVAL;
|
rc = -EPROTO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
DBGC2 ( fcpdev, "FCP %p xchg %04x RSP stat %02x resid %08x flags %02x"
|
DBGC2 ( fcpdev, "FCP %p xchg %04x RSP stat %02x resid %08x flags %02x"
|
||||||
|
@ -645,7 +645,7 @@ static int fcpcmd_recv_unknown ( struct fcp_command *fcpcmd,
|
||||||
fcpdev, fcpcmd->xchg_id );
|
fcpdev, fcpcmd->xchg_id );
|
||||||
DBGC_HDA ( fcpdev, 0, iobuf->data, iob_len ( iobuf ) );
|
DBGC_HDA ( fcpdev, 0, iobuf->data, iob_len ( iobuf ) );
|
||||||
free_iob ( iobuf );
|
free_iob ( iobuf );
|
||||||
return -EINVAL;
|
return -EPROTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Reference in New Issue