aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_iocb.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2010-05-04 18:01:26 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-05-16 18:21:47 -0400
commit5ff1d58410ffb160b388d622ef0c6a0411a05559 (patch)
treea8d95de2c47bf3b0beaae6730b61b3d84c2bde56 /drivers/scsi/qla2xxx/qla_iocb.c
parent99b0bec7bbf3350d1a920a7138fa62c456a8ecf1 (diff)
[SCSI] qla2xxx: Limit mailbox command contention for ADISC requests.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index d792ae32ed69..8112e41065f2 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -1054,6 +1054,36 @@ qla2x00_logout_iocb(srb_t *sp, struct mbx_entry *mbx)
1054} 1054}
1055 1055
1056static void 1056static void
1057qla24xx_adisc_iocb(srb_t *sp, struct logio_entry_24xx *logio)
1058{
1059 logio->entry_type = LOGINOUT_PORT_IOCB_TYPE;
1060 logio->control_flags = cpu_to_le16(LCF_COMMAND_ADISC);
1061 logio->nport_handle = cpu_to_le16(sp->fcport->loop_id);
1062 logio->vp_index = sp->fcport->vp_idx;
1063}
1064
1065static void
1066qla2x00_adisc_iocb(srb_t *sp, struct mbx_entry *mbx)
1067{
1068 struct qla_hw_data *ha = sp->fcport->vha->hw;
1069
1070 mbx->entry_type = MBX_IOCB_TYPE;
1071 SET_TARGET_ID(ha, mbx->loop_id, sp->fcport->loop_id);
1072 mbx->mb0 = cpu_to_le16(MBC_GET_PORT_DATABASE);
1073 if (HAS_EXTENDED_IDS(ha)) {
1074 mbx->mb1 = cpu_to_le16(sp->fcport->loop_id);
1075 mbx->mb10 = cpu_to_le16(BIT_0);
1076 } else {
1077 mbx->mb1 = cpu_to_le16((sp->fcport->loop_id << 8) | BIT_0);
1078 }
1079 mbx->mb2 = cpu_to_le16(MSW(ha->async_pd_dma));
1080 mbx->mb3 = cpu_to_le16(LSW(ha->async_pd_dma));
1081 mbx->mb6 = cpu_to_le16(MSW(MSD(ha->async_pd_dma)));
1082 mbx->mb7 = cpu_to_le16(LSW(MSD(ha->async_pd_dma)));
1083 mbx->mb9 = cpu_to_le16(sp->fcport->vp_idx);
1084}
1085
1086static void
1057qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb) 1087qla24xx_els_iocb(srb_t *sp, struct els_entry_24xx *els_iocb)
1058{ 1088{
1059 struct fc_bsg_job *bsg_job = ((struct srb_bsg*)sp->ctx)->bsg_job; 1089 struct fc_bsg_job *bsg_job = ((struct srb_bsg*)sp->ctx)->bsg_job;
@@ -1185,12 +1215,12 @@ qla2x00_start_sp(srb_t *sp)
1185 switch (ctx->type) { 1215 switch (ctx->type) {
1186 case SRB_LOGIN_CMD: 1216 case SRB_LOGIN_CMD:
1187 IS_FWI2_CAPABLE(ha) ? 1217 IS_FWI2_CAPABLE(ha) ?
1188 qla24xx_login_iocb(sp, pkt): 1218 qla24xx_login_iocb(sp, pkt) :
1189 qla2x00_login_iocb(sp, pkt); 1219 qla2x00_login_iocb(sp, pkt);
1190 break; 1220 break;
1191 case SRB_LOGOUT_CMD: 1221 case SRB_LOGOUT_CMD:
1192 IS_FWI2_CAPABLE(ha) ? 1222 IS_FWI2_CAPABLE(ha) ?
1193 qla24xx_logout_iocb(sp, pkt): 1223 qla24xx_logout_iocb(sp, pkt) :
1194 qla2x00_logout_iocb(sp, pkt); 1224 qla2x00_logout_iocb(sp, pkt);
1195 break; 1225 break;
1196 case SRB_ELS_CMD_RPT: 1226 case SRB_ELS_CMD_RPT:
@@ -1200,6 +1230,11 @@ qla2x00_start_sp(srb_t *sp)
1200 case SRB_CT_CMD: 1230 case SRB_CT_CMD:
1201 qla24xx_ct_iocb(sp, pkt); 1231 qla24xx_ct_iocb(sp, pkt);
1202 break; 1232 break;
1233 case SRB_ADISC_CMD:
1234 IS_FWI2_CAPABLE(ha) ?
1235 qla24xx_adisc_iocb(sp, pkt) :
1236 qla2x00_adisc_iocb(sp, pkt);
1237 break;
1203 default: 1238 default:
1204 break; 1239 break;
1205 } 1240 }