aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_hw.h
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2007-06-17 20:56:37 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-06-17 23:06:27 -0400
commited957684294618602b48f1950b0c9bbcb036583f (patch)
tree4e88dbb2e55013f973ad94099e2963dd507ea719 /drivers/scsi/lpfc/lpfc_hw.h
parent2e0fef85e098f6794956b8b80b111179fbb4cbb7 (diff)
[SCSI] lpfc: NPIV: add SLI-3 interface
NPIV support is only available via new adapter interface extensions, termed SLI-3. This interface changes some of the basic behaviors such as command and response ring element sizes and data structures, as well as a change in buffer posting. Note: the new firmware extensions are found only on our mid-range and enterprise 4Gig adapters - so NPIV support is available only on these newer adapters. The latest firmware can be downloaded from the Emulex support page. 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.h397
1 files changed, 368 insertions, 29 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index c4be6dc00c4c..430416805e85 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -59,6 +59,11 @@
59#define SLI2_IOCB_CMD_R3XTRA_ENTRIES 24 59#define SLI2_IOCB_CMD_R3XTRA_ENTRIES 24
60#define SLI2_IOCB_RSP_R3XTRA_ENTRIES 32 60#define SLI2_IOCB_RSP_R3XTRA_ENTRIES 32
61 61
62#define SLI2_IOCB_CMD_SIZE 32
63#define SLI2_IOCB_RSP_SIZE 32
64#define SLI3_IOCB_CMD_SIZE 128
65#define SLI3_IOCB_RSP_SIZE 64
66
62/* Common Transport structures and definitions */ 67/* Common Transport structures and definitions */
63 68
64union CtRevisionId { 69union CtRevisionId {
@@ -1255,6 +1260,7 @@ typedef struct { /* FireFly BIU registers */
1255#define MBX_CONFIG_FARP 0x25 1260#define MBX_CONFIG_FARP 0x25
1256#define MBX_BEACON 0x2A 1261#define MBX_BEACON 0x2A
1257 1262
1263#define MBX_CONFIG_HBQ 0x7C
1258#define MBX_LOAD_AREA 0x81 1264#define MBX_LOAD_AREA 0x81
1259#define MBX_RUN_BIU_DIAG64 0x84 1265#define MBX_RUN_BIU_DIAG64 0x84
1260#define MBX_CONFIG_PORT 0x88 1266#define MBX_CONFIG_PORT 0x88
@@ -1334,6 +1340,10 @@ typedef struct { /* FireFly BIU registers */
1334#define CMD_FCP_TRECEIVE64_CX 0xA1 1340#define CMD_FCP_TRECEIVE64_CX 0xA1
1335#define CMD_FCP_TRSP64_CX 0xA3 1341#define CMD_FCP_TRSP64_CX 0xA3
1336 1342
1343#define CMD_IOCB_RCV_SEQ64_CX 0xB5
1344#define CMD_IOCB_RCV_ELS64_CX 0xB7
1345#define CMD_IOCB_RCV_CONT64_CX 0xBB
1346
1337#define CMD_GEN_REQUEST64_CR 0xC2 1347#define CMD_GEN_REQUEST64_CR 0xC2
1338#define CMD_GEN_REQUEST64_CX 0xC3 1348#define CMD_GEN_REQUEST64_CX 0xC3
1339 1349
@@ -1560,6 +1570,7 @@ typedef struct {
1560#define FLAGS_TOPOLOGY_MODE_PT_PT 0x02 /* Attempt pt-pt only */ 1570#define FLAGS_TOPOLOGY_MODE_PT_PT 0x02 /* Attempt pt-pt only */
1561#define FLAGS_TOPOLOGY_MODE_LOOP 0x04 /* Attempt loop only */ 1571#define FLAGS_TOPOLOGY_MODE_LOOP 0x04 /* Attempt loop only */
1562#define FLAGS_TOPOLOGY_MODE_PT_LOOP 0x06 /* Attempt pt-pt then loop */ 1572#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 */
1563#define FLAGS_LIRP_LILP 0x80 /* LIRP / LILP is disabled */ 1574#define FLAGS_LIRP_LILP 0x80 /* LIRP / LILP is disabled */
1564 1575
1565#define FLAGS_TOPOLOGY_FAILOVER 0x0400 /* Bit 10 */ 1576#define FLAGS_TOPOLOGY_FAILOVER 0x0400 /* Bit 10 */
@@ -1817,6 +1828,13 @@ typedef struct {
1817 structure */ 1828 structure */
1818 struct ulp_bde64 sp64; 1829 struct ulp_bde64 sp64;
1819 } un; 1830 } un;
1831#ifdef __BIG_ENDIAN_BITFIELD
1832 uint16_t rsvd3;
1833 uint16_t vpi;
1834#else /* __LITTLE_ENDIAN_BITFIELD */
1835 uint16_t vpi;
1836 uint16_t rsvd3;
1837#endif
1820} READ_SPARM_VAR; 1838} READ_SPARM_VAR;
1821 1839
1822/* Structure for MB Command READ_STATUS (14) */ 1840/* Structure for MB Command READ_STATUS (14) */
@@ -1917,11 +1935,17 @@ typedef struct {
1917#ifdef __BIG_ENDIAN_BITFIELD 1935#ifdef __BIG_ENDIAN_BITFIELD
1918 uint32_t cv:1; 1936 uint32_t cv:1;
1919 uint32_t rr:1; 1937 uint32_t rr:1;
1920 uint32_t rsvd1:29; 1938 uint32_t rsvd2:2;
1939 uint32_t v3req:1;
1940 uint32_t v3rsp:1;
1941 uint32_t rsvd1:25;
1921 uint32_t rv:1; 1942 uint32_t rv:1;
1922#else /* __LITTLE_ENDIAN_BITFIELD */ 1943#else /* __LITTLE_ENDIAN_BITFIELD */
1923 uint32_t rv:1; 1944 uint32_t rv:1;
1924 uint32_t rsvd1:29; 1945 uint32_t rsvd1:25;
1946 uint32_t v3rsp:1;
1947 uint32_t v3req:1;
1948 uint32_t rsvd2:2;
1925 uint32_t rr:1; 1949 uint32_t rr:1;
1926 uint32_t cv:1; 1950 uint32_t cv:1;
1927#endif 1951#endif
@@ -1971,8 +1995,8 @@ typedef struct {
1971 uint8_t sli1FwName[16]; 1995 uint8_t sli1FwName[16];
1972 uint32_t sli2FwRev; 1996 uint32_t sli2FwRev;
1973 uint8_t sli2FwName[16]; 1997 uint8_t sli2FwName[16];
1974 uint32_t rsvd2; 1998 uint32_t sli3Feat;
1975 uint32_t RandomData[7]; 1999 uint32_t RandomData[6];
1976} READ_REV_VAR; 2000} READ_REV_VAR;
1977 2001
1978/* Structure for MB Command READ_LINK_STAT (18) */ 2002/* Structure for MB Command READ_LINK_STAT (18) */
@@ -2012,6 +2036,14 @@ typedef struct {
2012 struct ulp_bde64 sp64; 2036 struct ulp_bde64 sp64;
2013 } un; 2037 } un;
2014 2038
2039#ifdef __BIG_ENDIAN_BITFIELD
2040 uint16_t rsvd6;
2041 uint16_t vpi;
2042#else /* __LITTLE_ENDIAN_BITFIELD */
2043 uint16_t vpi;
2044 uint16_t rsvd6;
2045#endif
2046
2015} REG_LOGIN_VAR; 2047} REG_LOGIN_VAR;
2016 2048
2017/* Word 30 contents for REG_LOGIN */ 2049/* Word 30 contents for REG_LOGIN */
@@ -2036,9 +2068,21 @@ typedef struct {
2036#ifdef __BIG_ENDIAN_BITFIELD 2068#ifdef __BIG_ENDIAN_BITFIELD
2037 uint16_t rsvd1; 2069 uint16_t rsvd1;
2038 uint16_t rpi; 2070 uint16_t rpi;
2071 uint32_t rsvd2;
2072 uint32_t rsvd3;
2073 uint32_t rsvd4;
2074 uint32_t rsvd5;
2075 uint16_t rsvd6;
2076 uint16_t vpi;
2039#else /* __LITTLE_ENDIAN_BITFIELD */ 2077#else /* __LITTLE_ENDIAN_BITFIELD */
2040 uint16_t rpi; 2078 uint16_t rpi;
2041 uint16_t rsvd1; 2079 uint16_t rsvd1;
2080 uint32_t rsvd2;
2081 uint32_t rsvd3;
2082 uint32_t rsvd4;
2083 uint32_t rsvd5;
2084 uint16_t vpi;
2085 uint16_t rsvd6;
2042#endif 2086#endif
2043} UNREG_LOGIN_VAR; 2087} UNREG_LOGIN_VAR;
2044 2088
@@ -2046,6 +2090,17 @@ typedef struct {
2046 2090
2047typedef struct { 2091typedef struct {
2048 uint32_t did; 2092 uint32_t did;
2093 uint32_t rsvd2;
2094 uint32_t rsvd3;
2095 uint32_t rsvd4;
2096 uint32_t rsvd5;
2097#ifdef __BIG_ENDIAN_BITFIELD
2098 uint16_t rsvd6;
2099 uint16_t vpi;
2100#else
2101 uint16_t vpi;
2102 uint16_t rsvd6;
2103#endif
2049} UNREG_D_ID_VAR; 2104} UNREG_D_ID_VAR;
2050 2105
2051/* Structure for MB Command READ_LA (21) */ 2106/* Structure for MB Command READ_LA (21) */
@@ -2177,13 +2232,240 @@ typedef struct {
2177#define DMP_RSP_OFFSET 0x14 /* word 5 contains first word of rsp */ 2232#define DMP_RSP_OFFSET 0x14 /* word 5 contains first word of rsp */
2178#define DMP_RSP_SIZE 0x6C /* maximum of 27 words of rsp data */ 2233#define DMP_RSP_SIZE 0x6C /* maximum of 27 words of rsp data */
2179 2234
2235struct hbq_mask {
2236#ifdef __BIG_ENDIAN_BITFIELD
2237 uint8_t tmatch;
2238 uint8_t tmask;
2239 uint8_t rctlmatch;
2240 uint8_t rctlmask;
2241#else /* __LITTLE_ENDIAN */
2242 uint8_t rctlmask;
2243 uint8_t rctlmatch;
2244 uint8_t tmask;
2245 uint8_t tmatch;
2246#endif
2247};
2248
2249
2250/* Structure for MB Command CONFIG_HBQ (7c) */
2251
2252struct config_hbq_var {
2253#ifdef __BIG_ENDIAN_BITFIELD
2254 uint32_t rsvd1 :7;
2255 uint32_t recvNotify :1; /* Receive Notification */
2256 uint32_t numMask :8; /* # Mask Entries */
2257 uint32_t profile :8; /* Selection Profile */
2258 uint32_t rsvd2 :8;
2259#else /* __LITTLE_ENDIAN */
2260 uint32_t rsvd2 :8;
2261 uint32_t profile :8; /* Selection Profile */
2262 uint32_t numMask :8; /* # Mask Entries */
2263 uint32_t recvNotify :1; /* Receive Notification */
2264 uint32_t rsvd1 :7;
2265#endif
2266
2267#ifdef __BIG_ENDIAN_BITFIELD
2268 uint32_t hbqId :16;
2269 uint32_t rsvd3 :12;
2270 uint32_t ringMask :4;
2271#else /* __LITTLE_ENDIAN */
2272 uint32_t ringMask :4;
2273 uint32_t rsvd3 :12;
2274 uint32_t hbqId :16;
2275#endif
2276
2277#ifdef __BIG_ENDIAN_BITFIELD
2278 uint32_t entry_count :16;
2279 uint32_t rsvd4 :8;
2280 uint32_t headerLen :8;
2281#else /* __LITTLE_ENDIAN */
2282 uint32_t headerLen :8;
2283 uint32_t rsvd4 :8;
2284 uint32_t entry_count :16;
2285#endif
2286
2287 uint32_t hbqaddrLow;
2288 uint32_t hbqaddrHigh;
2289
2290#ifdef __BIG_ENDIAN_BITFIELD
2291 uint32_t rsvd5 :31;
2292 uint32_t logEntry :1;
2293#else /* __LITTLE_ENDIAN */
2294 uint32_t logEntry :1;
2295 uint32_t rsvd5 :31;
2296#endif
2297
2298 uint32_t rsvd6; /* w7 */
2299 uint32_t rsvd7; /* w8 */
2300 uint32_t rsvd8; /* w9 */
2301
2302 struct hbq_mask hbqMasks[6];
2303
2304
2305 union {
2306 uint32_t allprofiles[12];
2307
2308 struct {
2309 #ifdef __BIG_ENDIAN_BITFIELD
2310 uint32_t seqlenoff :16;
2311 uint32_t maxlen :16;
2312 #else /* __LITTLE_ENDIAN */
2313 uint32_t maxlen :16;
2314 uint32_t seqlenoff :16;
2315 #endif
2316 #ifdef __BIG_ENDIAN_BITFIELD
2317 uint32_t rsvd1 :28;
2318 uint32_t seqlenbcnt :4;
2319 #else /* __LITTLE_ENDIAN */
2320 uint32_t seqlenbcnt :4;
2321 uint32_t rsvd1 :28;
2322 #endif
2323 uint32_t rsvd[10];
2324 } profile2;
2325
2326 struct {
2327 #ifdef __BIG_ENDIAN_BITFIELD
2328 uint32_t seqlenoff :16;
2329 uint32_t maxlen :16;
2330 #else /* __LITTLE_ENDIAN */
2331 uint32_t maxlen :16;
2332 uint32_t seqlenoff :16;
2333 #endif
2334 #ifdef __BIG_ENDIAN_BITFIELD
2335 uint32_t cmdcodeoff :28;
2336 uint32_t rsvd1 :12;
2337 uint32_t seqlenbcnt :4;
2338 #else /* __LITTLE_ENDIAN */
2339 uint32_t seqlenbcnt :4;
2340 uint32_t rsvd1 :12;
2341 uint32_t cmdcodeoff :28;
2342 #endif
2343 uint32_t cmdmatch[8];
2344
2345 uint32_t rsvd[2];
2346 } profile3;
2347
2348 struct {
2349 #ifdef __BIG_ENDIAN_BITFIELD
2350 uint32_t seqlenoff :16;
2351 uint32_t maxlen :16;
2352 #else /* __LITTLE_ENDIAN */
2353 uint32_t maxlen :16;
2354 uint32_t seqlenoff :16;
2355 #endif
2356 #ifdef __BIG_ENDIAN_BITFIELD
2357 uint32_t cmdcodeoff :28;
2358 uint32_t rsvd1 :12;
2359 uint32_t seqlenbcnt :4;
2360 #else /* __LITTLE_ENDIAN */
2361 uint32_t seqlenbcnt :4;
2362 uint32_t rsvd1 :12;
2363 uint32_t cmdcodeoff :28;
2364 #endif
2365 uint32_t cmdmatch[8];
2366
2367 uint32_t rsvd[2];
2368 } profile5;
2369
2370 } profiles;
2371
2372};
2373
2374
2180 2375
2181/* Structure for MB Command CONFIG_PORT (0x88) */ 2376/* Structure for MB Command CONFIG_PORT (0x88) */
2182typedef struct { 2377typedef struct {
2183 uint32_t pcbLen; 2378#ifdef __BIG_ENDIAN_BITFIELD
2379 uint32_t cBE : 1;
2380 uint32_t cET : 1;
2381 uint32_t cHpcb : 1;
2382 uint32_t cMA : 1;
2383 uint32_t sli_mode : 4;
2384 uint32_t pcbLen : 24; /* bit 23:0 of memory based port
2385 * config block */
2386#else /* __LITTLE_ENDIAN */
2387 uint32_t pcbLen : 24; /* bit 23:0 of memory based port
2388 * config block */
2389 uint32_t sli_mode : 4;
2390 uint32_t cMA : 1;
2391 uint32_t cHpcb : 1;
2392 uint32_t cET : 1;
2393 uint32_t cBE : 1;
2394#endif
2395
2184 uint32_t pcbLow; /* bit 31:0 of memory based port config block */ 2396 uint32_t pcbLow; /* bit 31:0 of memory based port config block */
2185 uint32_t pcbHigh; /* bit 63:32 of memory based port config block */ 2397 uint32_t pcbHigh; /* bit 63:32 of memory based port config block */
2186 uint32_t hbainit[5]; 2398 uint32_t hbainit[6];
2399
2400#ifdef __BIG_ENDIAN_BITFIELD
2401 uint32_t rsvd : 24; /* Reserved */
2402 uint32_t cmv : 1; /* Configure Max VPIs */
2403 uint32_t ccrp : 1; /* Config Command Ring Polling */
2404 uint32_t csah : 1; /* Configure Synchronous Abort Handling */
2405 uint32_t chbs : 1; /* Cofigure Host Backing store */
2406 uint32_t cinb : 1; /* Enable Interrupt Notification Block */
2407 uint32_t cerbm : 1; /* Configure Enhanced Receive Buf Mgmt */
2408 uint32_t cmx : 1; /* Configure Max XRIs */
2409 uint32_t cmr : 1; /* Configure Max RPIs */
2410#else /* __LITTLE_ENDIAN */
2411 uint32_t cmr : 1; /* Configure Max RPIs */
2412 uint32_t cmx : 1; /* Configure Max XRIs */
2413 uint32_t cerbm : 1; /* Configure Enhanced Receive Buf Mgmt */
2414 uint32_t cinb : 1; /* Enable Interrupt Notification Block */
2415 uint32_t chbs : 1; /* Cofigure Host Backing store */
2416 uint32_t csah : 1; /* Configure Synchronous Abort Handling */
2417 uint32_t ccrp : 1; /* Config Command Ring Polling */
2418 uint32_t cmv : 1; /* Configure Max VPIs */
2419 uint32_t rsvd : 24; /* Reserved */
2420#endif
2421#ifdef __BIG_ENDIAN_BITFIELD
2422 uint32_t rsvd2 : 24; /* Reserved */
2423 uint32_t gmv : 1; /* Grant Max VPIs */
2424 uint32_t gcrp : 1; /* Grant Command Ring Polling */
2425 uint32_t gsah : 1; /* Grant Synchronous Abort Handling */
2426 uint32_t ghbs : 1; /* Grant Host Backing Store */
2427 uint32_t ginb : 1; /* Grant Interrupt Notification Block */
2428 uint32_t gerbm : 1; /* Grant ERBM Request */
2429 uint32_t gmx : 1; /* Grant Max XRIs */
2430 uint32_t gmr : 1; /* Grant Max RPIs */
2431#else /* __LITTLE_ENDIAN */
2432 uint32_t gmr : 1; /* Grant Max RPIs */
2433 uint32_t gmx : 1; /* Grant Max XRIs */
2434 uint32_t gerbm : 1; /* Grant ERBM Request */
2435 uint32_t ginb : 1; /* Grant Interrupt Notification Block */
2436 uint32_t ghbs : 1; /* Grant Host Backing Store */
2437 uint32_t gsah : 1; /* Grant Synchronous Abort Handling */
2438 uint32_t gcrp : 1; /* Grant Command Ring Polling */
2439 uint32_t gmv : 1; /* Grant Max VPIs */
2440 uint32_t rsvd2 : 24; /* Reserved */
2441#endif
2442
2443#ifdef __BIG_ENDIAN_BITFIELD
2444 uint32_t max_rpi : 16; /* Max RPIs Port should configure */
2445 uint32_t max_xri : 16; /* Max XRIs Port should configure */
2446#else /* __LITTLE_ENDIAN */
2447 uint32_t max_xri : 16; /* Max XRIs Port should configure */
2448 uint32_t max_rpi : 16; /* Max RPIs Port should configure */
2449#endif
2450
2451#ifdef __BIG_ENDIAN_BITFIELD
2452 uint32_t max_hbq : 16; /* Max HBQs Host expect to configure */
2453 uint32_t rsvd3 : 16; /* Max HBQs Host expect to configure */
2454#else /* __LITTLE_ENDIAN */
2455 uint32_t rsvd3 : 16; /* Max HBQs Host expect to configure */
2456 uint32_t max_hbq : 16; /* Max HBQs Host expect to configure */
2457#endif
2458
2459 uint32_t rsvd4; /* Reserved */
2460
2461#ifdef __BIG_ENDIAN_BITFIELD
2462 uint32_t rsvd5 : 16; /* Reserved */
2463 uint32_t max_vpi : 16; /* Max number of virt N-Ports */
2464#else /* __LITTLE_ENDIAN */
2465 uint32_t max_vpi : 16; /* Max number of virt N-Ports */
2466 uint32_t rsvd5 : 16; /* Reserved */
2467#endif
2468
2187} CONFIG_PORT_VAR; 2469} CONFIG_PORT_VAR;
2188 2470
2189/* SLI-2 Port Control Block */ 2471/* SLI-2 Port Control Block */
@@ -2261,33 +2543,38 @@ typedef struct {
2261#define MAILBOX_CMD_SIZE (MAILBOX_CMD_WSIZE * sizeof(uint32_t)) 2543#define MAILBOX_CMD_SIZE (MAILBOX_CMD_WSIZE * sizeof(uint32_t))
2262 2544
2263typedef union { 2545typedef union {
2264 uint32_t varWords[MAILBOX_CMD_WSIZE - 1]; 2546 uint32_t varWords[MAILBOX_CMD_WSIZE - 1]; /* first word is type/
2265 LOAD_SM_VAR varLdSM; /* cmd = 1 (LOAD_SM) */ 2547 * feature/max ring number
2266 READ_NV_VAR varRDnvp; /* cmd = 2 (READ_NVPARMS) */ 2548 */
2267 WRITE_NV_VAR varWTnvp; /* cmd = 3 (WRITE_NVPARMS) */ 2549 LOAD_SM_VAR varLdSM; /* cmd = 1 (LOAD_SM) */
2550 READ_NV_VAR varRDnvp; /* cmd = 2 (READ_NVPARMS) */
2551 WRITE_NV_VAR varWTnvp; /* cmd = 3 (WRITE_NVPARMS) */
2268 BIU_DIAG_VAR varBIUdiag; /* cmd = 4 (RUN_BIU_DIAG) */ 2552 BIU_DIAG_VAR varBIUdiag; /* cmd = 4 (RUN_BIU_DIAG) */
2269 INIT_LINK_VAR varInitLnk; /* cmd = 5 (INIT_LINK) */ 2553 INIT_LINK_VAR varInitLnk; /* cmd = 5 (INIT_LINK) */
2270 DOWN_LINK_VAR varDwnLnk; /* cmd = 6 (DOWN_LINK) */ 2554 DOWN_LINK_VAR varDwnLnk; /* cmd = 6 (DOWN_LINK) */
2271 CONFIG_LINK varCfgLnk; /* cmd = 7 (CONFIG_LINK) */ 2555 CONFIG_LINK varCfgLnk; /* cmd = 7 (CONFIG_LINK) */
2272 PART_SLIM_VAR varSlim; /* cmd = 8 (PART_SLIM) */ 2556 PART_SLIM_VAR varSlim; /* cmd = 8 (PART_SLIM) */
2273 CONFIG_RING_VAR varCfgRing; /* cmd = 9 (CONFIG_RING) */ 2557 CONFIG_RING_VAR varCfgRing; /* cmd = 9 (CONFIG_RING) */
2274 RESET_RING_VAR varRstRing; /* cmd = 10 (RESET_RING) */ 2558 RESET_RING_VAR varRstRing; /* cmd = 10 (RESET_RING) */
2275 READ_CONFIG_VAR varRdConfig; /* cmd = 11 (READ_CONFIG) */ 2559 READ_CONFIG_VAR varRdConfig; /* cmd = 11 (READ_CONFIG) */
2276 READ_RCONF_VAR varRdRConfig; /* cmd = 12 (READ_RCONFIG) */ 2560 READ_RCONF_VAR varRdRConfig; /* cmd = 12 (READ_RCONFIG) */
2277 READ_SPARM_VAR varRdSparm; /* cmd = 13 (READ_SPARM(64)) */ 2561 READ_SPARM_VAR varRdSparm; /* cmd = 13 (READ_SPARM(64)) */
2278 READ_STATUS_VAR varRdStatus; /* cmd = 14 (READ_STATUS) */ 2562 READ_STATUS_VAR varRdStatus; /* cmd = 14 (READ_STATUS) */
2279 READ_RPI_VAR varRdRPI; /* cmd = 15 (READ_RPI(64)) */ 2563 READ_RPI_VAR varRdRPI; /* cmd = 15 (READ_RPI(64)) */
2280 READ_XRI_VAR varRdXRI; /* cmd = 16 (READ_XRI) */ 2564 READ_XRI_VAR varRdXRI; /* cmd = 16 (READ_XRI) */
2281 READ_REV_VAR varRdRev; /* cmd = 17 (READ_REV) */ 2565 READ_REV_VAR varRdRev; /* cmd = 17 (READ_REV) */
2282 READ_LNK_VAR varRdLnk; /* cmd = 18 (READ_LNK_STAT) */ 2566 READ_LNK_VAR varRdLnk; /* cmd = 18 (READ_LNK_STAT) */
2283 REG_LOGIN_VAR varRegLogin; /* cmd = 19 (REG_LOGIN(64)) */ 2567 REG_LOGIN_VAR varRegLogin; /* cmd = 19 (REG_LOGIN(64)) */
2284 UNREG_LOGIN_VAR varUnregLogin; /* cmd = 20 (UNREG_LOGIN) */ 2568 UNREG_LOGIN_VAR varUnregLogin; /* cmd = 20 (UNREG_LOGIN) */
2285 READ_LA_VAR varReadLA; /* cmd = 21 (READ_LA(64)) */ 2569 READ_LA_VAR varReadLA; /* cmd = 21 (READ_LA(64)) */
2286 CLEAR_LA_VAR varClearLA; /* cmd = 22 (CLEAR_LA) */ 2570 CLEAR_LA_VAR varClearLA; /* cmd = 22 (CLEAR_LA) */
2287 DUMP_VAR varDmp; /* Warm Start DUMP mbx cmd */ 2571 DUMP_VAR varDmp; /* Warm Start DUMP mbx cmd */
2288 UNREG_D_ID_VAR varUnregDID; /* cmd = 0x23 (UNREG_D_ID) */ 2572 UNREG_D_ID_VAR varUnregDID; /* cmd = 0x23 (UNREG_D_ID) */
2289 CONFIG_FARP_VAR varCfgFarp; /* cmd = 0x25 (CONFIG_FARP) NEW_FEATURE */ 2573 CONFIG_FARP_VAR varCfgFarp; /* cmd = 0x25 (CONFIG_FARP)
2290 CONFIG_PORT_VAR varCfgPort; /* cmd = 0x88 (CONFIG_PORT) */ 2574 * NEW_FEATURE
2575 */
2576 struct config_hbq_var varCfgHbq;/* cmd = 0x7c (CONFIG_HBQ) */
2577 CONFIG_PORT_VAR varCfgPort; /* cmd = 0x88 (CONFIG_PORT) */
2291} MAILVARIANTS; 2578} MAILVARIANTS;
2292 2579
2293/* 2580/*
@@ -2304,16 +2591,30 @@ struct lpfc_pgp {
2304 __le32 rspPutInx; 2591 __le32 rspPutInx;
2305}; 2592};
2306 2593
2307typedef struct _SLI2_DESC { 2594struct sli2_desc {
2308 struct lpfc_hgp host[MAX_RINGS];
2309 uint32_t unused1[16]; 2595 uint32_t unused1[16];
2596 struct lpfc_hgp host[MAX_RINGS];
2597 struct lpfc_pgp port[MAX_RINGS];
2598};
2599
2600struct sli3_desc {
2601 struct lpfc_hgp host[MAX_RINGS];
2602 uint32_t reserved[8];
2603 uint32_t hbq_put[16];
2604};
2605
2606struct sli3_pgp {
2310 struct lpfc_pgp port[MAX_RINGS]; 2607 struct lpfc_pgp port[MAX_RINGS];
2311} SLI2_DESC; 2608 uint32_t hbq_get[16];
2609};
2312 2610
2313typedef union { 2611typedef union {
2314 SLI2_DESC s2; 2612 struct sli2_desc s2;
2613 struct sli3_desc s3;
2614 struct sli3_pgp s3_pgp;
2315} SLI_VAR; 2615} SLI_VAR;
2316 2616
2617
2317typedef struct { 2618typedef struct {
2318#ifdef __BIG_ENDIAN_BITFIELD 2619#ifdef __BIG_ENDIAN_BITFIELD
2319 uint16_t mbxStatus; 2620 uint16_t mbxStatus;
@@ -2617,6 +2918,23 @@ typedef struct {
2617 uint32_t fcpt_Length; /* transfer ready for IWRITE */ 2918 uint32_t fcpt_Length; /* transfer ready for IWRITE */
2618} FCPT_FIELDS64; 2919} FCPT_FIELDS64;
2619 2920
2921/* IOCB Command template for CMD_IOCB_RCV_ELS64_CX (0xB7)
2922 or CMD_IOCB_RCV_SEQ64_CX (0xB5) */
2923
2924struct rcv_sli3 {
2925 uint32_t word8Rsvd;
2926#ifdef __BIG_ENDIAN_BITFIELD
2927 uint16_t vpi;
2928 uint16_t word9Rsvd;
2929#else /* __LITTLE_ENDIAN */
2930 uint16_t word9Rsvd;
2931 uint16_t vpi;
2932#endif
2933 uint32_t word10Rsvd;
2934 uint32_t acc_len; /* accumulated length */
2935 struct ulp_bde64 bde2;
2936};
2937
2620typedef struct _IOCB { /* IOCB structure */ 2938typedef struct _IOCB { /* IOCB structure */
2621 union { 2939 union {
2622 GENERIC_RSP grsp; /* Generic response */ 2940 GENERIC_RSP grsp; /* Generic response */
@@ -2631,8 +2949,8 @@ typedef struct _IOCB { /* IOCB structure */
2631 2949
2632 /* SLI-2 structures */ 2950 /* SLI-2 structures */
2633 2951
2634 struct ulp_bde64 cont64[2]; /* up to 2 64 bit continuation 2952 struct ulp_bde64 cont64[2]; /* up to 2 64 bit continuation
2635 bde_64s */ 2953 * bde_64s */
2636 ELS_REQUEST64 elsreq64; /* ELS_REQUEST template */ 2954 ELS_REQUEST64 elsreq64; /* ELS_REQUEST template */
2637 GEN_REQUEST64 genreq64; /* GEN_REQUEST template */ 2955 GEN_REQUEST64 genreq64; /* GEN_REQUEST template */
2638 RCV_ELS_REQ64 rcvels64; /* RCV_ELS_REQ template */ 2956 RCV_ELS_REQ64 rcvels64; /* RCV_ELS_REQ template */
@@ -2693,7 +3011,16 @@ typedef struct _IOCB { /* IOCB structure */
2693 uint32_t ulpXS:1; 3011 uint32_t ulpXS:1;
2694 uint32_t ulpTimeout:8; 3012 uint32_t ulpTimeout:8;
2695#endif 3013#endif
3014 union {
3015 struct rcv_sli3 rcvsli3; /* words 8 - 15 */
3016 uint32_t sli3Words[24]; /* 96 extra bytes for SLI-3 */
3017 } unsli3;
3018
3019#define ulpCt_h ulpXS
3020#define ulpCt_l ulpFCP2Rcvy
2696 3021
3022#define IOCB_FCP 1 /* IOCB is used for FCP ELS cmds-ulpRsvByte */
3023#define IOCB_IP 2 /* IOCB is used for IP ELS cmds */
2697#define PARM_UNUSED 0 /* PU field (Word 4) not used */ 3024#define PARM_UNUSED 0 /* PU field (Word 4) not used */
2698#define PARM_REL_OFF 1 /* PU field (Word 4) = R. O. */ 3025#define PARM_REL_OFF 1 /* PU field (Word 4) = R. O. */
2699#define PARM_READ_CHECK 2 /* PU field (Word 4) = Data Transfer Length */ 3026#define PARM_READ_CHECK 2 /* PU field (Word 4) = Data Transfer Length */
@@ -2724,21 +3051,33 @@ typedef struct _IOCB { /* IOCB structure */
2724 3051
2725} IOCB_t; 3052} IOCB_t;
2726 3053
3054/* Structure used for a single HBQ entry */
3055struct lpfc_hbq_entry {
3056 struct ulp_bde64 bde;
3057 uint32_t buffer_tag;
3058};
3059
2727 3060
2728#define SLI1_SLIM_SIZE (4 * 1024) 3061#define SLI1_SLIM_SIZE (4 * 1024)
2729 3062
2730/* Up to 498 IOCBs will fit into 16k 3063/* Up to 498 IOCBs will fit into 16k
2731 * 256 (MAILBOX_t) + 140 (PCB_t) + ( 32 (IOCB_t) * 498 ) = < 16384 3064 * 256 (MAILBOX_t) + 140 (PCB_t) + ( 32 (IOCB_t) * 498 ) = < 16384
2732 */ 3065 */
2733#define SLI2_SLIM_SIZE (16 * 1024) 3066#define SLI2_SLIM_SIZE (64 * 1024)
2734 3067
2735/* Maximum IOCBs that will fit in SLI2 slim */ 3068/* Maximum IOCBs that will fit in SLI2 slim */
2736#define MAX_SLI2_IOCB 498 3069#define MAX_SLI2_IOCB 498
3070#define MAX_SLIM_IOCB_SIZE (SLI2_SLIM_SIZE - \
3071 (sizeof(MAILBOX_t) + sizeof(PCB_t)))
3072
3073/* HBQ entries are 4 words each = 4k */
3074#define LPFC_TOTAL_HBQ_SIZE (sizeof(struct lpfc_hbq_entry) * \
3075 lpfc_sli_hbq_count())
2737 3076
2738struct lpfc_sli2_slim { 3077struct lpfc_sli2_slim {
2739 MAILBOX_t mbx; 3078 MAILBOX_t mbx;
2740 PCB_t pcb; 3079 PCB_t pcb;
2741 IOCB_t IOCBs[MAX_SLI2_IOCB]; 3080 IOCB_t IOCBs[MAX_SLIM_IOCB_SIZE];
2742}; 3081};
2743 3082
2744/* 3083/*