diff options
author | James Smart <James.Smart@Emulex.Com> | 2007-06-17 20:56:38 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-06-17 23:27:39 -0400 |
commit | 92d7f7b0cde3ad2260e7462b40867b57efd49851 (patch) | |
tree | fadb1d8f1a817c2f85937b5e9c3b830bdecb5555 /drivers/scsi/lpfc/lpfc_hw.h | |
parent | ed957684294618602b48f1950b0c9bbcb036583f (diff) |
[SCSI] lpfc: NPIV: add NPIV support on top of SLI-3
NPIV support is added to the driver. It utilizes the interfaces of
the fc transport for the creation and deletion of vports. Within the
driver, a new Scsi_Host is created for each NPIV instance, and is
paired with a new instance of a FC port. This allows N FC Port
elements to share a single Adapter.
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hw.h')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw.h | 125 |
1 files changed, 96 insertions, 29 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 430416805e85..7fab93d34367 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h | |||
@@ -64,6 +64,7 @@ | |||
64 | #define SLI3_IOCB_CMD_SIZE 128 | 64 | #define SLI3_IOCB_CMD_SIZE 128 |
65 | #define SLI3_IOCB_RSP_SIZE 64 | 65 | #define SLI3_IOCB_RSP_SIZE 64 |
66 | 66 | ||
67 | |||
67 | /* Common Transport structures and definitions */ | 68 | /* Common Transport structures and definitions */ |
68 | 69 | ||
69 | union CtRevisionId { | 70 | union CtRevisionId { |
@@ -84,6 +85,9 @@ union CtCommandResponse { | |||
84 | uint32_t word; | 85 | uint32_t word; |
85 | }; | 86 | }; |
86 | 87 | ||
88 | #define FC4_FEATURE_INIT 0x2 | ||
89 | #define FC4_FEATURE_TARGET 0x1 | ||
90 | |||
87 | struct lpfc_sli_ct_request { | 91 | struct lpfc_sli_ct_request { |
88 | /* Structure is in Big Endian format */ | 92 | /* Structure is in Big Endian format */ |
89 | union CtRevisionId RevisionId; | 93 | union CtRevisionId RevisionId; |
@@ -126,20 +130,6 @@ struct lpfc_sli_ct_request { | |||
126 | 130 | ||
127 | uint32_t rsvd[7]; | 131 | uint32_t rsvd[7]; |
128 | } rft; | 132 | } rft; |
129 | struct rff { | ||
130 | uint32_t PortId; | ||
131 | uint8_t reserved[2]; | ||
132 | #ifdef __BIG_ENDIAN_BITFIELD | ||
133 | uint8_t feature_res:6; | ||
134 | uint8_t feature_init:1; | ||
135 | uint8_t feature_tgt:1; | ||
136 | #else /* __LITTLE_ENDIAN_BITFIELD */ | ||
137 | uint8_t feature_tgt:1; | ||
138 | uint8_t feature_init:1; | ||
139 | uint8_t feature_res:6; | ||
140 | #endif | ||
141 | uint8_t type_code; /* type=8 for FCP */ | ||
142 | } rff; | ||
143 | struct rnn { | 133 | struct rnn { |
144 | uint32_t PortId; /* For RNN_ID requests */ | 134 | uint32_t PortId; /* For RNN_ID requests */ |
145 | uint8_t wwnn[8]; | 135 | uint8_t wwnn[8]; |
@@ -149,15 +139,42 @@ struct lpfc_sli_ct_request { | |||
149 | uint8_t len; | 139 | uint8_t len; |
150 | uint8_t symbname[255]; | 140 | uint8_t symbname[255]; |
151 | } rsnn; | 141 | } rsnn; |
142 | struct rspn { /* For RSPN_ID requests */ | ||
143 | uint32_t PortId; | ||
144 | uint8_t len; | ||
145 | uint8_t symbname[255]; | ||
146 | } rspn; | ||
147 | struct gff { | ||
148 | uint32_t PortId; | ||
149 | } gff; | ||
150 | struct gff_acc { | ||
151 | uint8_t fbits[128]; | ||
152 | } gff_acc; | ||
153 | #define FCP_TYPE_FEATURE_OFFSET 4 | ||
154 | struct rff { | ||
155 | uint32_t PortId; | ||
156 | uint8_t reserved[2]; | ||
157 | uint8_t fbits; | ||
158 | uint8_t type_code; /* type=8 for FCP */ | ||
159 | } rff; | ||
152 | } un; | 160 | } un; |
153 | }; | 161 | }; |
154 | 162 | ||
155 | #define SLI_CT_REVISION 1 | 163 | #define SLI_CT_REVISION 1 |
156 | #define GID_REQUEST_SZ (sizeof(struct lpfc_sli_ct_request) - 260) | 164 | #define GID_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ |
157 | #define RFT_REQUEST_SZ (sizeof(struct lpfc_sli_ct_request) - 228) | 165 | sizeof(struct gid)) |
158 | #define RFF_REQUEST_SZ (sizeof(struct lpfc_sli_ct_request) - 235) | 166 | #define GFF_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ |
159 | #define RNN_REQUEST_SZ (sizeof(struct lpfc_sli_ct_request) - 252) | 167 | sizeof(struct gff)) |
160 | #define RSNN_REQUEST_SZ (sizeof(struct lpfc_sli_ct_request)) | 168 | #define RFT_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ |
169 | sizeof(struct rft)) | ||
170 | #define RFF_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ | ||
171 | sizeof(struct rff)) | ||
172 | #define RNN_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ | ||
173 | sizeof(struct rnn)) | ||
174 | #define RSNN_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ | ||
175 | sizeof(struct rsnn)) | ||
176 | #define RSPN_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ | ||
177 | sizeof(struct rspn)) | ||
161 | 178 | ||
162 | /* | 179 | /* |
163 | * FsType Definitions | 180 | * FsType Definitions |
@@ -232,6 +249,7 @@ struct lpfc_sli_ct_request { | |||
232 | #define SLI_CTNS_GFT_ID 0x0117 | 249 | #define SLI_CTNS_GFT_ID 0x0117 |
233 | #define SLI_CTNS_GSPN_ID 0x0118 | 250 | #define SLI_CTNS_GSPN_ID 0x0118 |
234 | #define SLI_CTNS_GPT_ID 0x011A | 251 | #define SLI_CTNS_GPT_ID 0x011A |
252 | #define SLI_CTNS_GFF_ID 0x011F | ||
235 | #define SLI_CTNS_GID_PN 0x0121 | 253 | #define SLI_CTNS_GID_PN 0x0121 |
236 | #define SLI_CTNS_GID_NN 0x0131 | 254 | #define SLI_CTNS_GID_NN 0x0131 |
237 | #define SLI_CTNS_GIP_NN 0x0135 | 255 | #define SLI_CTNS_GIP_NN 0x0135 |
@@ -245,9 +263,9 @@ struct lpfc_sli_ct_request { | |||
245 | #define SLI_CTNS_RNN_ID 0x0213 | 263 | #define SLI_CTNS_RNN_ID 0x0213 |
246 | #define SLI_CTNS_RCS_ID 0x0214 | 264 | #define SLI_CTNS_RCS_ID 0x0214 |
247 | #define SLI_CTNS_RFT_ID 0x0217 | 265 | #define SLI_CTNS_RFT_ID 0x0217 |
248 | #define SLI_CTNS_RFF_ID 0x021F | ||
249 | #define SLI_CTNS_RSPN_ID 0x0218 | 266 | #define SLI_CTNS_RSPN_ID 0x0218 |
250 | #define SLI_CTNS_RPT_ID 0x021A | 267 | #define SLI_CTNS_RPT_ID 0x021A |
268 | #define SLI_CTNS_RFF_ID 0x021F | ||
251 | #define SLI_CTNS_RIP_NN 0x0235 | 269 | #define SLI_CTNS_RIP_NN 0x0235 |
252 | #define SLI_CTNS_RIPA_NN 0x0236 | 270 | #define SLI_CTNS_RIPA_NN 0x0236 |
253 | #define SLI_CTNS_RSNN_NN 0x0239 | 271 | #define SLI_CTNS_RSNN_NN 0x0239 |
@@ -316,8 +334,9 @@ struct csp { | |||
316 | uint8_t bbCreditlsb; /* FC Word 0, byte 3 */ | 334 | uint8_t bbCreditlsb; /* FC Word 0, byte 3 */ |
317 | 335 | ||
318 | #ifdef __BIG_ENDIAN_BITFIELD | 336 | #ifdef __BIG_ENDIAN_BITFIELD |
319 | uint16_t increasingOffset:1; /* FC Word 1, bit 31 */ | 337 | uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */ |
320 | uint16_t response_multiple_Nport:1; /* FC Word 1, bit 29 */ | 338 | uint16_t randomOffset:1; /* FC Word 1, bit 30 */ |
339 | uint16_t response_multiple_NPort:1; /* FC Word 1, bit 29 */ | ||
321 | uint16_t fPort:1; /* FC Word 1, bit 28 */ | 340 | uint16_t fPort:1; /* FC Word 1, bit 28 */ |
322 | uint16_t altBbCredit:1; /* FC Word 1, bit 27 */ | 341 | uint16_t altBbCredit:1; /* FC Word 1, bit 27 */ |
323 | uint16_t edtovResolution:1; /* FC Word 1, bit 26 */ | 342 | uint16_t edtovResolution:1; /* FC Word 1, bit 26 */ |
@@ -336,9 +355,9 @@ struct csp { | |||
336 | uint16_t edtovResolution:1; /* FC Word 1, bit 26 */ | 355 | uint16_t edtovResolution:1; /* FC Word 1, bit 26 */ |
337 | uint16_t altBbCredit:1; /* FC Word 1, bit 27 */ | 356 | uint16_t altBbCredit:1; /* FC Word 1, bit 27 */ |
338 | uint16_t fPort:1; /* FC Word 1, bit 28 */ | 357 | uint16_t fPort:1; /* FC Word 1, bit 28 */ |
339 | uint16_t word1Reserved2:1; /* FC Word 1, bit 29 */ | 358 | uint16_t response_multiple_NPort:1; /* FC Word 1, bit 29 */ |
340 | uint16_t randomOffset:1; /* FC Word 1, bit 30 */ | 359 | uint16_t randomOffset:1; /* FC Word 1, bit 30 */ |
341 | uint16_t increasingOffset:1; /* FC Word 1, bit 31 */ | 360 | uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */ |
342 | 361 | ||
343 | uint16_t payloadlength:1; /* FC Word 1, bit 16 */ | 362 | uint16_t payloadlength:1; /* FC Word 1, bit 16 */ |
344 | uint16_t contIncSeqCnt:1; /* FC Word 1, bit 17 */ | 363 | uint16_t contIncSeqCnt:1; /* FC Word 1, bit 17 */ |
@@ -1268,6 +1287,10 @@ typedef struct { /* FireFly BIU registers */ | |||
1268 | #define MBX_READ_RPI64 0x8F | 1287 | #define MBX_READ_RPI64 0x8F |
1269 | #define MBX_REG_LOGIN64 0x93 | 1288 | #define MBX_REG_LOGIN64 0x93 |
1270 | #define MBX_READ_LA64 0x95 | 1289 | #define MBX_READ_LA64 0x95 |
1290 | #define MBX_REG_VPI 0x96 | ||
1291 | #define MBX_UNREG_VPI 0x97 | ||
1292 | #define MBX_REG_VNPID 0x96 | ||
1293 | #define MBX_UNREG_VNPID 0x97 | ||
1271 | 1294 | ||
1272 | #define MBX_FLASH_WR_ULA 0x98 | 1295 | #define MBX_FLASH_WR_ULA 0x98 |
1273 | #define MBX_SET_DEBUG 0x99 | 1296 | #define MBX_SET_DEBUG 0x99 |
@@ -1570,7 +1593,7 @@ typedef struct { | |||
1570 | #define FLAGS_TOPOLOGY_MODE_PT_PT 0x02 /* Attempt pt-pt only */ | 1593 | #define FLAGS_TOPOLOGY_MODE_PT_PT 0x02 /* Attempt pt-pt only */ |
1571 | #define FLAGS_TOPOLOGY_MODE_LOOP 0x04 /* Attempt loop only */ | 1594 | #define FLAGS_TOPOLOGY_MODE_LOOP 0x04 /* Attempt loop only */ |
1572 | #define FLAGS_TOPOLOGY_MODE_PT_LOOP 0x06 /* Attempt pt-pt then loop */ | 1595 | #define FLAGS_TOPOLOGY_MODE_PT_LOOP 0x06 /* Attempt pt-pt then loop */ |
1573 | #define FLAGS_UNREG_LOGIN_ALL 0x08 /* UNREG_LOGIN all on link down */ | 1596 | #define FLAGS_UNREG_LOGIN_ALL 0x08 /* UNREG_LOGIN all on link down */ |
1574 | #define FLAGS_LIRP_LILP 0x80 /* LIRP / LILP is disabled */ | 1597 | #define FLAGS_LIRP_LILP 0x80 /* LIRP / LILP is disabled */ |
1575 | 1598 | ||
1576 | #define FLAGS_TOPOLOGY_FAILOVER 0x0400 /* Bit 10 */ | 1599 | #define FLAGS_TOPOLOGY_FAILOVER 0x0400 /* Bit 10 */ |
@@ -2086,6 +2109,45 @@ typedef struct { | |||
2086 | #endif | 2109 | #endif |
2087 | } UNREG_LOGIN_VAR; | 2110 | } UNREG_LOGIN_VAR; |
2088 | 2111 | ||
2112 | /* Structure for MB Command REG_VPI (0x96) */ | ||
2113 | typedef struct { | ||
2114 | #ifdef __BIG_ENDIAN_BITFIELD | ||
2115 | uint32_t rsvd1; | ||
2116 | uint32_t rsvd2:8; | ||
2117 | uint32_t sid:24; | ||
2118 | uint32_t rsvd3; | ||
2119 | uint32_t rsvd4; | ||
2120 | uint32_t rsvd5; | ||
2121 | uint16_t rsvd6; | ||
2122 | uint16_t vpi; | ||
2123 | #else /* __LITTLE_ENDIAN */ | ||
2124 | uint32_t rsvd1; | ||
2125 | uint32_t sid:24; | ||
2126 | uint32_t rsvd2:8; | ||
2127 | uint32_t rsvd3; | ||
2128 | uint32_t rsvd4; | ||
2129 | uint32_t rsvd5; | ||
2130 | uint16_t vpi; | ||
2131 | uint16_t rsvd6; | ||
2132 | #endif | ||
2133 | } REG_VPI_VAR; | ||
2134 | |||
2135 | /* Structure for MB Command UNREG_VPI (0x97) */ | ||
2136 | typedef struct { | ||
2137 | uint32_t rsvd1; | ||
2138 | uint32_t rsvd2; | ||
2139 | uint32_t rsvd3; | ||
2140 | uint32_t rsvd4; | ||
2141 | uint32_t rsvd5; | ||
2142 | #ifdef __BIG_ENDIAN_BITFIELD | ||
2143 | uint16_t rsvd6; | ||
2144 | uint16_t vpi; | ||
2145 | #else /* __LITTLE_ENDIAN */ | ||
2146 | uint16_t vpi; | ||
2147 | uint16_t rsvd6; | ||
2148 | #endif | ||
2149 | } UNREG_VPI_VAR; | ||
2150 | |||
2089 | /* Structure for MB Command UNREG_D_ID (0x23) */ | 2151 | /* Structure for MB Command UNREG_D_ID (0x23) */ |
2090 | 2152 | ||
2091 | typedef struct { | 2153 | typedef struct { |
@@ -2549,8 +2611,8 @@ typedef union { | |||
2549 | LOAD_SM_VAR varLdSM; /* cmd = 1 (LOAD_SM) */ | 2611 | LOAD_SM_VAR varLdSM; /* cmd = 1 (LOAD_SM) */ |
2550 | READ_NV_VAR varRDnvp; /* cmd = 2 (READ_NVPARMS) */ | 2612 | READ_NV_VAR varRDnvp; /* cmd = 2 (READ_NVPARMS) */ |
2551 | WRITE_NV_VAR varWTnvp; /* cmd = 3 (WRITE_NVPARMS) */ | 2613 | WRITE_NV_VAR varWTnvp; /* cmd = 3 (WRITE_NVPARMS) */ |
2552 | BIU_DIAG_VAR varBIUdiag; /* cmd = 4 (RUN_BIU_DIAG) */ | 2614 | BIU_DIAG_VAR varBIUdiag; /* cmd = 4 (RUN_BIU_DIAG) */ |
2553 | INIT_LINK_VAR varInitLnk; /* cmd = 5 (INIT_LINK) */ | 2615 | INIT_LINK_VAR varInitLnk; /* cmd = 5 (INIT_LINK) */ |
2554 | DOWN_LINK_VAR varDwnLnk; /* cmd = 6 (DOWN_LINK) */ | 2616 | DOWN_LINK_VAR varDwnLnk; /* cmd = 6 (DOWN_LINK) */ |
2555 | CONFIG_LINK varCfgLnk; /* cmd = 7 (CONFIG_LINK) */ | 2617 | CONFIG_LINK varCfgLnk; /* cmd = 7 (CONFIG_LINK) */ |
2556 | PART_SLIM_VAR varSlim; /* cmd = 8 (PART_SLIM) */ | 2618 | PART_SLIM_VAR varSlim; /* cmd = 8 (PART_SLIM) */ |
@@ -2575,6 +2637,8 @@ typedef union { | |||
2575 | */ | 2637 | */ |
2576 | struct config_hbq_var varCfgHbq;/* cmd = 0x7c (CONFIG_HBQ) */ | 2638 | struct config_hbq_var varCfgHbq;/* cmd = 0x7c (CONFIG_HBQ) */ |
2577 | CONFIG_PORT_VAR varCfgPort; /* cmd = 0x88 (CONFIG_PORT) */ | 2639 | CONFIG_PORT_VAR varCfgPort; /* cmd = 0x88 (CONFIG_PORT) */ |
2640 | REG_VPI_VAR varRegVpi; /* cmd = 0x96 (REG_VPI) */ | ||
2641 | UNREG_VPI_VAR varUnregVpi; /* cmd = 0x97 (UNREG_VPI) */ | ||
2578 | } MAILVARIANTS; | 2642 | } MAILVARIANTS; |
2579 | 2643 | ||
2580 | /* | 2644 | /* |
@@ -2614,7 +2678,6 @@ typedef union { | |||
2614 | struct sli3_pgp s3_pgp; | 2678 | struct sli3_pgp s3_pgp; |
2615 | } SLI_VAR; | 2679 | } SLI_VAR; |
2616 | 2680 | ||
2617 | |||
2618 | typedef struct { | 2681 | typedef struct { |
2619 | #ifdef __BIG_ENDIAN_BITFIELD | 2682 | #ifdef __BIG_ENDIAN_BITFIELD |
2620 | uint16_t mbxStatus; | 2683 | uint16_t mbxStatus; |
@@ -2935,6 +2998,8 @@ struct rcv_sli3 { | |||
2935 | struct ulp_bde64 bde2; | 2998 | struct ulp_bde64 bde2; |
2936 | }; | 2999 | }; |
2937 | 3000 | ||
3001 | |||
3002 | |||
2938 | typedef struct _IOCB { /* IOCB structure */ | 3003 | typedef struct _IOCB { /* IOCB structure */ |
2939 | union { | 3004 | union { |
2940 | GENERIC_RSP grsp; /* Generic response */ | 3005 | GENERIC_RSP grsp; /* Generic response */ |
@@ -3011,6 +3076,7 @@ typedef struct _IOCB { /* IOCB structure */ | |||
3011 | uint32_t ulpXS:1; | 3076 | uint32_t ulpXS:1; |
3012 | uint32_t ulpTimeout:8; | 3077 | uint32_t ulpTimeout:8; |
3013 | #endif | 3078 | #endif |
3079 | |||
3014 | union { | 3080 | union { |
3015 | struct rcv_sli3 rcvsli3; /* words 8 - 15 */ | 3081 | struct rcv_sli3 rcvsli3; /* words 8 - 15 */ |
3016 | uint32_t sli3Words[24]; /* 96 extra bytes for SLI-3 */ | 3082 | uint32_t sli3Words[24]; /* 96 extra bytes for SLI-3 */ |
@@ -3024,6 +3090,7 @@ typedef struct _IOCB { /* IOCB structure */ | |||
3024 | #define PARM_UNUSED 0 /* PU field (Word 4) not used */ | 3090 | #define PARM_UNUSED 0 /* PU field (Word 4) not used */ |
3025 | #define PARM_REL_OFF 1 /* PU field (Word 4) = R. O. */ | 3091 | #define PARM_REL_OFF 1 /* PU field (Word 4) = R. O. */ |
3026 | #define PARM_READ_CHECK 2 /* PU field (Word 4) = Data Transfer Length */ | 3092 | #define PARM_READ_CHECK 2 /* PU field (Word 4) = Data Transfer Length */ |
3093 | #define PARM_NPIV_DID 3 | ||
3027 | #define CLASS1 0 /* Class 1 */ | 3094 | #define CLASS1 0 /* Class 1 */ |
3028 | #define CLASS2 1 /* Class 2 */ | 3095 | #define CLASS2 1 /* Class 2 */ |
3029 | #define CLASS3 2 /* Class 3 */ | 3096 | #define CLASS3 2 /* Class 3 */ |
@@ -3044,7 +3111,7 @@ typedef struct _IOCB { /* IOCB structure */ | |||
3044 | #define IOSTAT_RSVD2 0xC | 3111 | #define IOSTAT_RSVD2 0xC |
3045 | #define IOSTAT_RSVD3 0xD | 3112 | #define IOSTAT_RSVD3 0xD |
3046 | #define IOSTAT_RSVD4 0xE | 3113 | #define IOSTAT_RSVD4 0xE |
3047 | #define IOSTAT_RSVD5 0xF | 3114 | #define IOSTAT_NEED_BUFFER 0xF |
3048 | #define IOSTAT_DRIVER_REJECT 0x10 /* ulpStatus - Driver defined */ | 3115 | #define IOSTAT_DRIVER_REJECT 0x10 /* ulpStatus - Driver defined */ |
3049 | #define IOSTAT_DEFAULT 0xF /* Same as rsvd5 for now */ | 3116 | #define IOSTAT_DEFAULT 0xF /* Same as rsvd5 for now */ |
3050 | #define IOSTAT_CNT 0x11 | 3117 | #define IOSTAT_CNT 0x11 |