aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_iocb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_iocb.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 4c1ba6263eb3..d78d5896fc33 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -328,6 +328,7 @@ qla2x00_start_scsi(srb_t *sp)
328 struct qla_hw_data *ha; 328 struct qla_hw_data *ha;
329 struct req_que *req; 329 struct req_que *req;
330 struct rsp_que *rsp; 330 struct rsp_que *rsp;
331 char tag[2];
331 332
332 /* Setup device pointers. */ 333 /* Setup device pointers. */
333 ret = 0; 334 ret = 0;
@@ -406,7 +407,22 @@ qla2x00_start_scsi(srb_t *sp)
406 cmd_pkt->lun = cpu_to_le16(sp->cmd->device->lun); 407 cmd_pkt->lun = cpu_to_le16(sp->cmd->device->lun);
407 408
408 /* Update tagged queuing modifier */ 409 /* Update tagged queuing modifier */
409 cmd_pkt->control_flags = __constant_cpu_to_le16(CF_SIMPLE_TAG); 410 if (scsi_populate_tag_msg(cmd, tag)) {
411 switch (tag[0]) {
412 case HEAD_OF_QUEUE_TAG:
413 cmd_pkt->control_flags =
414 __constant_cpu_to_le16(CF_HEAD_TAG);
415 break;
416 case ORDERED_QUEUE_TAG:
417 cmd_pkt->control_flags =
418 __constant_cpu_to_le16(CF_ORDERED_TAG);
419 break;
420 default:
421 cmd_pkt->control_flags =
422 __constant_cpu_to_le16(CF_SIMPLE_TAG);
423 break;
424 }
425 }
410 426
411 /* Load SCSI command packet. */ 427 /* Load SCSI command packet. */
412 memcpy(cmd_pkt->scsi_cdb, cmd->cmnd, cmd->cmd_len); 428 memcpy(cmd_pkt->scsi_cdb, cmd->cmnd, cmd->cmd_len);
@@ -971,6 +987,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
971 uint16_t fcp_cmnd_len; 987 uint16_t fcp_cmnd_len;
972 struct fcp_cmnd *fcp_cmnd; 988 struct fcp_cmnd *fcp_cmnd;
973 dma_addr_t crc_ctx_dma; 989 dma_addr_t crc_ctx_dma;
990 char tag[2];
974 991
975 cmd = sp->cmd; 992 cmd = sp->cmd;
976 993
@@ -1068,9 +1085,27 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt,
1068 LSD(crc_ctx_dma + CRC_CONTEXT_FCPCMND_OFF)); 1085 LSD(crc_ctx_dma + CRC_CONTEXT_FCPCMND_OFF));
1069 cmd_pkt->fcp_cmnd_dseg_address[1] = cpu_to_le32( 1086 cmd_pkt->fcp_cmnd_dseg_address[1] = cpu_to_le32(
1070 MSD(crc_ctx_dma + CRC_CONTEXT_FCPCMND_OFF)); 1087 MSD(crc_ctx_dma + CRC_CONTEXT_FCPCMND_OFF));
1071 fcp_cmnd->task_attribute = 0;
1072 fcp_cmnd->task_management = 0; 1088 fcp_cmnd->task_management = 0;
1073 1089
1090 /*
1091 * Update tagged queuing modifier if using command tag queuing
1092 */
1093 if (scsi_populate_tag_msg(cmd, tag)) {
1094 switch (tag[0]) {
1095 case HEAD_OF_QUEUE_TAG:
1096 fcp_cmnd->task_attribute = TSK_HEAD_OF_QUEUE;
1097 break;
1098 case ORDERED_QUEUE_TAG:
1099 fcp_cmnd->task_attribute = TSK_ORDERED;
1100 break;
1101 default:
1102 fcp_cmnd->task_attribute = 0;
1103 break;
1104 }
1105 } else {
1106 fcp_cmnd->task_attribute = 0;
1107 }
1108
1074 cmd_pkt->fcp_rsp_dseg_len = 0; /* Let response come in status iocb */ 1109 cmd_pkt->fcp_rsp_dseg_len = 0; /* Let response come in status iocb */
1075 1110
1076 DEBUG18(printk(KERN_INFO "%s(%ld): Total SG(s) Entries %d, Data" 1111 DEBUG18(printk(KERN_INFO "%s(%ld): Total SG(s) Entries %d, Data"
@@ -1177,6 +1212,7 @@ qla24xx_start_scsi(srb_t *sp)
1177 struct scsi_cmnd *cmd = sp->cmd; 1212 struct scsi_cmnd *cmd = sp->cmd;
1178 struct scsi_qla_host *vha = sp->fcport->vha; 1213 struct scsi_qla_host *vha = sp->fcport->vha;
1179 struct qla_hw_data *ha = vha->hw; 1214 struct qla_hw_data *ha = vha->hw;
1215 char tag[2];
1180 1216
1181 /* Setup device pointers. */ 1217 /* Setup device pointers. */
1182 ret = 0; 1218 ret = 0;
@@ -1260,6 +1296,18 @@ qla24xx_start_scsi(srb_t *sp)
1260 int_to_scsilun(sp->cmd->device->lun, &cmd_pkt->lun); 1296 int_to_scsilun(sp->cmd->device->lun, &cmd_pkt->lun);
1261 host_to_fcp_swap((uint8_t *)&cmd_pkt->lun, sizeof(cmd_pkt->lun)); 1297 host_to_fcp_swap((uint8_t *)&cmd_pkt->lun, sizeof(cmd_pkt->lun));
1262 1298
1299 /* Update tagged queuing modifier -- default is TSK_SIMPLE (0). */
1300 if (scsi_populate_tag_msg(cmd, tag)) {
1301 switch (tag[0]) {
1302 case HEAD_OF_QUEUE_TAG:
1303 cmd_pkt->task = TSK_HEAD_OF_QUEUE;
1304 break;
1305 case ORDERED_QUEUE_TAG:
1306 cmd_pkt->task = TSK_ORDERED;
1307 break;
1308 }
1309 }
1310
1263 /* Load SCSI command packet. */ 1311 /* Load SCSI command packet. */
1264 memcpy(cmd_pkt->fcp_cdb, cmd->cmnd, cmd->cmd_len); 1312 memcpy(cmd_pkt->fcp_cdb, cmd->cmnd, cmd->cmd_len);
1265 host_to_fcp_swap(cmd_pkt->fcp_cdb, sizeof(cmd_pkt->fcp_cdb)); 1313 host_to_fcp_swap(cmd_pkt->fcp_cdb, sizeof(cmd_pkt->fcp_cdb));