diff options
author | Arun Easi <arun.easi@qlogic.com> | 2010-05-04 18:01:30 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-05-16 18:21:59 -0400 |
commit | bad750028917a7b804623701d0674e46c6012c18 (patch) | |
tree | f8c4032b480e3c93b906e313eb6d371565b4b66d /drivers/scsi/qla2xxx/qla_def.h | |
parent | 3822263eb1e74821ad1ae886ddd2184ae9395ff7 (diff) |
[SCSI] qla2xxx: T10 DIF support added.
Signed-off-by: Duane Grigsby <duane.grigsby@qlogic.com>
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_def.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 84 |
1 files changed, 82 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 0d2cecbb8f47..4559f5c6c1ae 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -189,6 +189,16 @@ | |||
189 | struct req_que; | 189 | struct req_que; |
190 | 190 | ||
191 | /* | 191 | /* |
192 | * (sd.h is not exported, hence local inclusion) | ||
193 | * Data Integrity Field tuple. | ||
194 | */ | ||
195 | struct sd_dif_tuple { | ||
196 | __be16 guard_tag; /* Checksum */ | ||
197 | __be16 app_tag; /* Opaque storage */ | ||
198 | __be32 ref_tag; /* Target LBA or indirect LBA */ | ||
199 | }; | ||
200 | |||
201 | /* | ||
192 | * SCSI Request Block | 202 | * SCSI Request Block |
193 | */ | 203 | */ |
194 | typedef struct srb { | 204 | typedef struct srb { |
@@ -208,8 +218,14 @@ typedef struct srb { | |||
208 | /* | 218 | /* |
209 | * SRB flag definitions | 219 | * SRB flag definitions |
210 | */ | 220 | */ |
211 | #define SRB_DMA_VALID BIT_0 /* Command sent to ISP */ | 221 | #define SRB_DMA_VALID BIT_0 /* Command sent to ISP */ |
212 | #define SRB_FCP_CMND_DMA_VALID BIT_12 /* FCP command in IOCB */ | 222 | #define SRB_FCP_CMND_DMA_VALID BIT_12 /* DIF: DSD List valid */ |
223 | #define SRB_CRC_CTX_DMA_VALID BIT_2 /* DIF: context DMA valid */ | ||
224 | #define SRB_CRC_PROT_DMA_VALID BIT_4 /* DIF: prot DMA valid */ | ||
225 | #define SRB_CRC_CTX_DSD_VALID BIT_5 /* DIF: dsd_list valid */ | ||
226 | |||
227 | /* To identify if a srb is of T10-CRC type. @sp => srb_t pointer */ | ||
228 | #define IS_PROT_IO(sp) (sp->flags & SRB_CRC_CTX_DSD_VALID) | ||
213 | 229 | ||
214 | /* | 230 | /* |
215 | * SRB extensions. | 231 | * SRB extensions. |
@@ -1330,6 +1346,66 @@ typedef struct { | |||
1330 | uint32_t dseg_4_length; /* Data segment 4 length. */ | 1346 | uint32_t dseg_4_length; /* Data segment 4 length. */ |
1331 | } cont_a64_entry_t; | 1347 | } cont_a64_entry_t; |
1332 | 1348 | ||
1349 | #define PO_MODE_DIF_INSERT 0 | ||
1350 | #define PO_MODE_DIF_REMOVE BIT_0 | ||
1351 | #define PO_MODE_DIF_PASS BIT_1 | ||
1352 | #define PO_MODE_DIF_REPLACE (BIT_0 + BIT_1) | ||
1353 | #define PO_ENABLE_DIF_BUNDLING BIT_8 | ||
1354 | #define PO_ENABLE_INCR_GUARD_SEED BIT_3 | ||
1355 | #define PO_DISABLE_INCR_REF_TAG BIT_5 | ||
1356 | #define PO_DISABLE_GUARD_CHECK BIT_4 | ||
1357 | /* | ||
1358 | * ISP queue - 64-Bit addressing, continuation crc entry structure definition. | ||
1359 | */ | ||
1360 | struct crc_context { | ||
1361 | uint32_t handle; /* System handle. */ | ||
1362 | uint32_t ref_tag; | ||
1363 | uint16_t app_tag; | ||
1364 | uint8_t ref_tag_mask[4]; /* Validation/Replacement Mask*/ | ||
1365 | uint8_t app_tag_mask[2]; /* Validation/Replacement Mask*/ | ||
1366 | uint16_t guard_seed; /* Initial Guard Seed */ | ||
1367 | uint16_t prot_opts; /* Requested Data Protection Mode */ | ||
1368 | uint16_t blk_size; /* Data size in bytes */ | ||
1369 | uint16_t runt_blk_guard; /* Guard value for runt block (tape | ||
1370 | * only) */ | ||
1371 | uint32_t byte_count; /* Total byte count/ total data | ||
1372 | * transfer count */ | ||
1373 | union { | ||
1374 | struct { | ||
1375 | uint32_t reserved_1; | ||
1376 | uint16_t reserved_2; | ||
1377 | uint16_t reserved_3; | ||
1378 | uint32_t reserved_4; | ||
1379 | uint32_t data_address[2]; | ||
1380 | uint32_t data_length; | ||
1381 | uint32_t reserved_5[2]; | ||
1382 | uint32_t reserved_6; | ||
1383 | } nobundling; | ||
1384 | struct { | ||
1385 | uint32_t dif_byte_count; /* Total DIF byte | ||
1386 | * count */ | ||
1387 | uint16_t reserved_1; | ||
1388 | uint16_t dseg_count; /* Data segment count */ | ||
1389 | uint32_t reserved_2; | ||
1390 | uint32_t data_address[2]; | ||
1391 | uint32_t data_length; | ||
1392 | uint32_t dif_address[2]; | ||
1393 | uint32_t dif_length; /* Data segment 0 | ||
1394 | * length */ | ||
1395 | } bundling; | ||
1396 | } u; | ||
1397 | |||
1398 | struct fcp_cmnd fcp_cmnd; | ||
1399 | dma_addr_t crc_ctx_dma; | ||
1400 | /* List of DMA context transfers */ | ||
1401 | struct list_head dsd_list; | ||
1402 | |||
1403 | /* This structure should not exceed 512 bytes */ | ||
1404 | }; | ||
1405 | |||
1406 | #define CRC_CONTEXT_LEN_FW (offsetof(struct crc_context, fcp_cmnd.lun)) | ||
1407 | #define CRC_CONTEXT_FCPCMND_OFF (offsetof(struct crc_context, fcp_cmnd.lun)) | ||
1408 | |||
1333 | /* | 1409 | /* |
1334 | * ISP queue - status entry structure definition. | 1410 | * ISP queue - status entry structure definition. |
1335 | */ | 1411 | */ |
@@ -1390,6 +1466,7 @@ typedef struct { | |||
1390 | #define CS_ABORTED 0x5 /* System aborted command. */ | 1466 | #define CS_ABORTED 0x5 /* System aborted command. */ |
1391 | #define CS_TIMEOUT 0x6 /* Timeout error. */ | 1467 | #define CS_TIMEOUT 0x6 /* Timeout error. */ |
1392 | #define CS_DATA_OVERRUN 0x7 /* Data overrun. */ | 1468 | #define CS_DATA_OVERRUN 0x7 /* Data overrun. */ |
1469 | #define CS_DIF_ERROR 0xC /* DIF error detected */ | ||
1393 | 1470 | ||
1394 | #define CS_DATA_UNDERRUN 0x15 /* Data Underrun. */ | 1471 | #define CS_DATA_UNDERRUN 0x15 /* Data Underrun. */ |
1395 | #define CS_QUEUE_FULL 0x1C /* Queue Full. */ | 1472 | #define CS_QUEUE_FULL 0x1C /* Queue Full. */ |
@@ -2732,6 +2809,7 @@ typedef struct scsi_qla_host { | |||
2732 | 2809 | ||
2733 | uint32_t management_server_logged_in :1; | 2810 | uint32_t management_server_logged_in :1; |
2734 | uint32_t process_response_queue :1; | 2811 | uint32_t process_response_queue :1; |
2812 | uint32_t difdix_supported:1; | ||
2735 | } flags; | 2813 | } flags; |
2736 | 2814 | ||
2737 | atomic_t loop_state; | 2815 | atomic_t loop_state; |
@@ -2883,6 +2961,8 @@ typedef struct scsi_qla_host { | |||
2883 | #define OPTROM_BURST_SIZE 0x1000 | 2961 | #define OPTROM_BURST_SIZE 0x1000 |
2884 | #define OPTROM_BURST_DWORDS (OPTROM_BURST_SIZE / 4) | 2962 | #define OPTROM_BURST_DWORDS (OPTROM_BURST_SIZE / 4) |
2885 | 2963 | ||
2964 | #define QLA_DSDS_PER_IOCB 37 | ||
2965 | |||
2886 | #include "qla_gbl.h" | 2966 | #include "qla_gbl.h" |
2887 | #include "qla_dbg.h" | 2967 | #include "qla_dbg.h" |
2888 | #include "qla_inline.h" | 2968 | #include "qla_inline.h" |