" protection.\n"));
scsi_host_set_prot(vha->host,
SHOST_DIF_TYPE1_PROTECTION
+ | SHOST_DIF_TYPE2_PROTECTION
| SHOST_DIF_TYPE3_PROTECTION
| SHOST_DIX_TYPE1_PROTECTION
+ | SHOST_DIX_TYPE2_PROTECTION
| SHOST_DIX_TYPE3_PROTECTION);
scsi_host_set_guard(vha->host, SHOST_DIX_GUARD_CRC);
} else
* match LBA in CDB + N
*/
case SCSI_PROT_DIF_TYPE2:
+ if (!ql2xenablehba_err_chk)
+ break;
+
+ if (scsi_prot_sg_count(cmd)) {
+ spt = page_address(sg_page(scsi_prot_sglist(cmd))) +
+ scsi_prot_sglist(cmd)[0].offset;
+ pkt->app_tag = swab32(spt->app_tag);
+ pkt->app_tag_mask[0] = 0xff;
+ pkt->app_tag_mask[1] = 0xff;
+ }
+
+ pkt->ref_tag = cpu_to_le32((uint32_t)
+ (0xffffffff & scsi_get_lba(cmd)));
+
+ /* enable ALL bytes of the ref tag */
+ pkt->ref_tag_mask[0] = 0xff;
+ pkt->ref_tag_mask[1] = 0xff;
+ pkt->ref_tag_mask[2] = 0xff;
+ pkt->ref_tag_mask[3] = 0xff;
break;
/* For Type 3 protection: 16 bit GUARD only */
total_bytes = data_bytes;
dif_bytes = 0;
blk_size = cmd->device->sector_size;
- if (scsi_get_prot_type(cmd) == SCSI_PROT_DIF_TYPE1) {
+ if (scsi_get_prot_op(cmd) != SCSI_PROT_NORMAL) {
dif_bytes = (data_bytes / blk_size) * 8;
total_bytes += dif_bytes;
}
vha->host_no, dif_bytes, dif_bytes, total_bytes, total_bytes,
crc_ctx_pkt->blk_size, crc_ctx_pkt->blk_size));
+ if (!data_bytes || cmd->sc_data_direction == DMA_NONE) {
+ DEBUG18(printk(KERN_INFO "%s: Zero data bytes or DMA-NONE %d\n",
+ __func__, data_bytes));
+ cmd_pkt->byte_count = __constant_cpu_to_le32(0);
+ return QLA_SUCCESS;
+ }
/* Walks data segments */
cmd_pkt->control_flags |=
#define QDSS_GOT_Q_SPACE BIT_0
- /* Only process protection in this routine */
- if (scsi_get_prot_op(cmd) == SCSI_PROT_NORMAL)
- return qla24xx_start_scsi(sp);
+ /* Only process protection or >16 cdb in this routine */
+ if (scsi_get_prot_op(cmd) == SCSI_PROT_NORMAL) {
+ if (cmd->cmd_len <= 16)
+ return qla24xx_start_scsi(sp);
+ }
/* Setup device pointers. */
host->this_id = 255;
host->cmd_per_lun = 3;
host->unique_id = host->host_no;
- host->max_cmd_len = MAX_CMDSZ;
+ if ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && ql2xenabledif)
+ host->max_cmd_len = 32;
+ else
+ host->max_cmd_len = MAX_CMDSZ;
host->max_channel = MAX_BUSES - 1;
host->max_lun = MAX_LUNS;
host->transportt = qla2xxx_transport_template;
" protection.\n"));
scsi_host_set_prot(host,
SHOST_DIF_TYPE1_PROTECTION
+ | SHOST_DIF_TYPE2_PROTECTION
| SHOST_DIF_TYPE3_PROTECTION
| SHOST_DIX_TYPE1_PROTECTION
+ | SHOST_DIX_TYPE2_PROTECTION
| SHOST_DIX_TYPE3_PROTECTION);
scsi_host_set_guard(host, SHOST_DIX_GUARD_CRC);
} else