Skip to content

Commit

Permalink
[SCSI] qla2xxx: Correct FCAL login retry logic for ISP24xx.
Browse files Browse the repository at this point in the history
ISP24XX FW does not support Mbx 0x74 ie Login Local Port.
Added the equivalent code for ISP24XX ie to relogin in non
fabric case for ISP24XX use login iocb.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
andrew.vasquez@qlogic.com authored and James Bottomley committed Mar 12, 2006
1 parent 4a59f71 commit 9a52a57
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
5 changes: 3 additions & 2 deletions drivers/scsi/qla2xxx/qla_gbl.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern int qla2x00_loop_resync(scsi_qla_host_t *);

extern int qla2x00_find_new_loop_id(scsi_qla_host_t *, fc_port_t *);
extern int qla2x00_fabric_login(scsi_qla_host_t *, fc_port_t *, uint16_t *);
extern int qla2x00_local_device_login(scsi_qla_host_t *, uint16_t);
extern int qla2x00_local_device_login(scsi_qla_host_t *, fc_port_t *);

extern void qla2x00_restart_queues(scsi_qla_host_t *, uint8_t);

Expand Down Expand Up @@ -166,7 +166,8 @@ qla24xx_login_fabric(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t,
uint16_t *, uint8_t);

extern int
qla2x00_login_local_device(scsi_qla_host_t *, uint16_t, uint16_t *, uint8_t);
qla2x00_login_local_device(scsi_qla_host_t *, fc_port_t *, uint16_t *,
uint8_t);

extern int
qla2x00_fabric_logout(scsi_qla_host_t *, uint16_t, uint8_t, uint8_t, uint8_t);
Expand Down
4 changes: 2 additions & 2 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -2888,13 +2888,13 @@ qla2x00_fabric_login(scsi_qla_host_t *ha, fc_port_t *fcport,
* 3 - Fatal error
*/
int
qla2x00_local_device_login(scsi_qla_host_t *ha, uint16_t loop_id)
qla2x00_local_device_login(scsi_qla_host_t *ha, fc_port_t *fcport)
{
int rval;
uint16_t mb[MAILBOX_REGISTER_COUNT];

memset(mb, 0, sizeof(mb));
rval = qla2x00_login_local_device(ha, loop_id, mb, BIT_0);
rval = qla2x00_login_local_device(ha, fcport, mb, BIT_0);
if (rval == QLA_SUCCESS) {
/* Interrogate mailbox registers for any errors */
if (mb[0] == MBS_COMMAND_ERROR)
Expand Down
11 changes: 8 additions & 3 deletions drivers/scsi/qla2xxx/qla_mbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1631,20 +1631,25 @@ qla2x00_login_fabric(scsi_qla_host_t *ha, uint16_t loop_id, uint8_t domain,
*
*/
int
qla2x00_login_local_device(scsi_qla_host_t *ha, uint16_t loop_id,
qla2x00_login_local_device(scsi_qla_host_t *ha, fc_port_t *fcport,
uint16_t *mb_ret, uint8_t opt)
{
int rval;
mbx_cmd_t mc;
mbx_cmd_t *mcp = &mc;

if (IS_QLA24XX(ha) || IS_QLA54XX(ha))
return qla24xx_login_fabric(ha, fcport->loop_id,
fcport->d_id.b.domain, fcport->d_id.b.area,
fcport->d_id.b.al_pa, mb_ret, opt);

DEBUG3(printk("%s(%ld): entered.\n", __func__, ha->host_no);)

mcp->mb[0] = MBC_LOGIN_LOOP_PORT;
if (HAS_EXTENDED_IDS(ha))
mcp->mb[1] = loop_id;
mcp->mb[1] = fcport->loop_id;
else
mcp->mb[1] = loop_id << 8;
mcp->mb[1] = fcport->loop_id << 8;
mcp->mb[2] = opt;
mcp->out_mb = MBX_2|MBX_1|MBX_0;
mcp->in_mb = MBX_7|MBX_6|MBX_1|MBX_0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -2295,7 +2295,7 @@ qla2x00_do_dpc(void *data)
} else
status =
qla2x00_local_device_login(
ha, fcport->loop_id);
ha, fcport);

if (status == QLA_SUCCESS) {
fcport->old_loop_id = fcport->loop_id;
Expand Down

0 comments on commit 9a52a57

Please sign in to comment.