mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 13:16:34 +00:00
qla2x00t-32gbit: Report invalid mailbox status codes
It is easy to mix up the QLA_* and the MBS_* status codes. Complain loudly if that happens. [ commit 724361921f65a40ae5b80641dc1e92c0ff314d89 upstream ] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8551 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1008,6 +1008,11 @@ struct mbx_cmd_32 {
|
||||
#define MBS_LINK_DOWN_ERROR 0x400B
|
||||
#define MBS_DIAG_ECHO_TEST_ERROR 0x400C
|
||||
|
||||
static inline bool qla2xxx_is_valid_mbs(unsigned int mbs)
|
||||
{
|
||||
return MBS_COMMAND_COMPLETE <= mbs && mbs <= MBS_DIAG_ECHO_TEST_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* ISP mailbox asynchronous event status codes
|
||||
*/
|
||||
|
||||
@@ -478,6 +478,9 @@ void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea)
|
||||
fcport->fw_login_state, ea->rc, fcport->login_gen, ea->sp->gen2,
|
||||
fcport->rscn_gen, ea->sp->gen1, fcport->loop_id);
|
||||
|
||||
WARN_ONCE(!qla2xxx_is_valid_mbs(ea->data[0]), "mbs: %#x\n",
|
||||
ea->data[0]);
|
||||
|
||||
if (ea->data[0] != MBS_COMMAND_COMPLETE) {
|
||||
ql_dbg(ql_dbg_disc, vha, 0x2066,
|
||||
"%s %s: adisc fail: post delete\n",
|
||||
@@ -1894,6 +1897,9 @@ qla24xx_async_abort_command(srb_t *sp)
|
||||
static void
|
||||
qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
|
||||
{
|
||||
WARN_ONCE(!qla2xxx_is_valid_mbs(ea->data[0]), "mbs: %#x\n",
|
||||
ea->data[0]);
|
||||
|
||||
switch (ea->data[0]) {
|
||||
case MBS_COMMAND_COMPLETE:
|
||||
ql_dbg(ql_dbg_disc, vha, 0x2118, "%s %d %s post gpdb\n",
|
||||
@@ -1978,6 +1984,9 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
|
||||
return;
|
||||
}
|
||||
|
||||
WARN_ONCE(!qla2xxx_is_valid_mbs(ea->data[0]), "mbs: %#x\n",
|
||||
ea->data[0]);
|
||||
|
||||
switch (ea->data[0]) {
|
||||
case MBS_COMMAND_COMPLETE:
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user