Go to the documentation of this file.
15 #define HC_INDEX_ISCSI_EQ_CONS 6
17 #define HC_INDEX_FCOE_EQ_CONS 3
19 #define HC_SP_INDEX_ETH_ISCSI_CQ_CONS 5
20 #define HC_SP_INDEX_ETH_ISCSI_RX_CQ_CONS 1
22 #define KWQ_PAGE_CNT 4
23 #define KCQ_PAGE_CNT 16
31 #define L5_KRNLQ_FLAGS 0x00000000
32 #define L5_KRNLQ_SIZE 0x00000000
33 #define L5_KRNLQ_TYPE 0x00000000
34 #define KRNLQ_FLAGS_PG_SZ (0xf<<0)
35 #define KRNLQ_FLAGS_PG_SZ_256 (0<<0)
36 #define KRNLQ_FLAGS_PG_SZ_512 (1<<0)
37 #define KRNLQ_FLAGS_PG_SZ_1K (2<<0)
38 #define KRNLQ_FLAGS_PG_SZ_2K (3<<0)
39 #define KRNLQ_FLAGS_PG_SZ_4K (4<<0)
40 #define KRNLQ_FLAGS_PG_SZ_8K (5<<0)
41 #define KRNLQ_FLAGS_PG_SZ_16K (6<<0)
42 #define KRNLQ_FLAGS_PG_SZ_32K (7<<0)
43 #define KRNLQ_FLAGS_PG_SZ_64K (8<<0)
44 #define KRNLQ_FLAGS_PG_SZ_128K (9<<0)
45 #define KRNLQ_FLAGS_PG_SZ_256K (10<<0)
46 #define KRNLQ_FLAGS_PG_SZ_512K (11<<0)
47 #define KRNLQ_FLAGS_PG_SZ_1M (12<<0)
48 #define KRNLQ_FLAGS_PG_SZ_2M (13<<0)
49 #define KRNLQ_FLAGS_QE_SELF_SEQ (1<<15)
50 #define KRNLQ_SIZE_TYPE_SIZE ((((0x28 + 0x1f) & ~0x1f) / 0x20) << 16)
51 #define KRNLQ_TYPE_TYPE (0xf<<28)
52 #define KRNLQ_TYPE_TYPE_EMPTY (0<<28)
53 #define KRNLQ_TYPE_TYPE_KRNLQ (6<<28)
55 #define L5_KRNLQ_HOST_QIDX 0x00000004
56 #define L5_KRNLQ_HOST_FW_QIDX 0x00000008
57 #define L5_KRNLQ_NX_QE_SELF_SEQ 0x0000000c
58 #define L5_KRNLQ_QE_SELF_SEQ_MAX 0x0000000c
59 #define L5_KRNLQ_NX_QE_HADDR_HI 0x00000010
60 #define L5_KRNLQ_NX_QE_HADDR_LO 0x00000014
61 #define L5_KRNLQ_PGTBL_PGIDX 0x00000018
62 #define L5_KRNLQ_NX_PG_QIDX 0x00000018
63 #define L5_KRNLQ_PGTBL_NPAGES 0x0000001c
64 #define L5_KRNLQ_QIDX_INCR 0x0000001c
65 #define L5_KRNLQ_PGTBL_HADDR_HI 0x00000020
66 #define L5_KRNLQ_PGTBL_HADDR_LO 0x00000024
68 #define BNX2_PG_CTX_MAP 0x1a0034
69 #define BNX2_ISCSI_CTX_MAP 0x1a0074
71 #define MAX_COMPLETED_KCQE 64
73 #define MAX_CNIC_L5_CONTEXT 256
75 #define MAX_CM_SK_TBL_SZ MAX_CNIC_L5_CONTEXT
77 #define MAX_ISCSI_TBL_SZ 256
79 #define CNIC_LOCAL_PORT_MIN 60000
80 #define CNIC_LOCAL_PORT_MAX 61024
81 #define CNIC_LOCAL_PORT_RANGE (CNIC_LOCAL_PORT_MAX - CNIC_LOCAL_PORT_MIN)
83 #define KWQE_CNT (BCM_PAGE_SIZE / sizeof(struct kwqe))
84 #define KCQE_CNT (BCM_PAGE_SIZE / sizeof(struct kcqe))
85 #define MAX_KWQE_CNT (KWQE_CNT - 1)
86 #define MAX_KCQE_CNT (KCQE_CNT - 1)
88 #define MAX_KWQ_IDX ((KWQ_PAGE_CNT * KWQE_CNT) - 1)
89 #define MAX_KCQ_IDX ((KCQ_PAGE_CNT * KCQE_CNT) - 1)
91 #define KWQ_PG(x) (((x) & ~MAX_KWQE_CNT) >> (BCM_PAGE_BITS - 5))
92 #define KWQ_IDX(x) ((x) & MAX_KWQE_CNT)
94 #define KCQ_PG(x) (((x) & ~MAX_KCQE_CNT) >> (BCM_PAGE_BITS - 5))
95 #define KCQ_IDX(x) ((x) & MAX_KCQE_CNT)
97 #define BNX2X_NEXT_KCQE(x) (((x) & (MAX_KCQE_CNT - 1)) == \
98 (MAX_KCQE_CNT - 1)) ? \
101 #define BNX2X_KWQ_DATA_PG(cp, x) ((x) / (cp)->kwq_16_data_pp)
102 #define BNX2X_KWQ_DATA_IDX(cp, x) ((x) % (cp)->kwq_16_data_pp)
103 #define BNX2X_KWQ_DATA(cp, x) \
104 &(cp)->kwq_16_data[BNX2X_KWQ_DATA_PG(cp, x)][BNX2X_KWQ_DATA_IDX(cp, x)]
106 #define DEF_IPID_START 0x8000
108 #define DEF_KA_TIMEOUT 10000
109 #define DEF_KA_INTERVAL 300000
110 #define DEF_KA_MAX_PROBE_COUNT 3
113 #define DEF_SND_SEQ_SCALE 0
114 #define DEF_RCV_BUF 0xffff
115 #define DEF_SND_BUF 0xffff
117 #define DEF_MAX_RT_TIME 500
118 #define DEF_MAX_DA_COUNT 2
119 #define DEF_SWS_TIMER 1000
120 #define DEF_MAX_CWND 0xffff
128 #define BNX2_MAX_CID 0x2000
147 #define CNIC_KWQ16_DATA_SIZE 128
167 #define CTX_FL_OFFLD_START 0
168 #define CTX_FL_DELETE_WAIT 1
169 #define CTX_FL_CID_ERROR 2
220 #define ULP_F_START 1
221 #define ULP_F_CALL_PENDING 2
225 #define CNIC_LCL_FL_KWQ_INIT 0x0
226 #define CNIC_LCL_FL_L2_WAIT 0x1
227 #define CNIC_LCL_FL_RINGS_INITED 0x2
228 #define CNIC_LCL_FL_STOP_ISCSI 0x4
245 #define IRO (((struct cnic_local *) dev->cnic_priv)->iro_arr)
319 #define CHIP_4_PORT_MODE 0
320 #define CHIP_2_PORT_MODE 1
321 #define CHIP_PORT_MODE_NONE 2
347 #define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T (1)
349 #define ISCSI_RAMROD_CMD_ID_UPDATE_CONN (ISCSI_KCQE_OPCODE_UPDATE_CONN)
350 #define ISCSI_RAMROD_CMD_ID_INIT (ISCSI_KCQE_OPCODE_INIT)
352 #define CDU_REGION_NUMBER_XCM_AG 2
353 #define CDU_REGION_NUMBER_UCM_AG 4
355 #define CDU_VALID_DATA(_cid, _region, _type) \
356 (((_cid) << 8) | (((_region)&0xf)<<4) | (((_type)&0xf)))
358 #define CDU_CRC8(_cid, _region, _type) \
359 (calc_crc8(CDU_VALID_DATA(_cid, _region, _type), 0xff))
361 #define CDU_RSRVD_VALUE_TYPE_A(_cid, _region, _type) \
362 (0x80 | ((CDU_CRC8(_cid, _region, _type)) & 0x7f))
364 #define BNX2X_CONTEXT_MEM_SIZE 1024
365 #define BNX2X_FCOE_CID 16
367 #define BNX2X_ISCSI_START_CID 18
368 #define BNX2X_ISCSI_NUM_CONNECTIONS 128
369 #define BNX2X_ISCSI_TASK_CONTEXT_SIZE 128
370 #define BNX2X_ISCSI_MAX_PENDING_R2TS 4
371 #define BNX2X_ISCSI_R2TQE_SIZE 8
372 #define BNX2X_ISCSI_HQ_BD_SIZE 64
373 #define BNX2X_ISCSI_GLB_BUF_SIZE 64
374 #define BNX2X_ISCSI_PBL_NOT_CACHED 0xff
375 #define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED 0xff
377 #define BNX2X_FCOE_NUM_CONNECTIONS 1024
379 #define BNX2X_FCOE_L5_CID_BASE MAX_ISCSI_TBL_SZ
381 #define BNX2X_CHIP_NUM_57710 0x164e
382 #define BNX2X_CHIP_NUM_57711 0x164f
383 #define BNX2X_CHIP_NUM_57711E 0x1650
384 #define BNX2X_CHIP_NUM_57712 0x1662
385 #define BNX2X_CHIP_NUM_57712E 0x1663
386 #define BNX2X_CHIP_NUM_57713 0x1651
387 #define BNX2X_CHIP_NUM_57713E 0x1652
388 #define BNX2X_CHIP_NUM_57800 0x168a
389 #define BNX2X_CHIP_NUM_57810 0x168e
390 #define BNX2X_CHIP_NUM_57840 0x168d
392 #define BNX2X_CHIP_NUM(x) (x >> 16)
393 #define BNX2X_CHIP_IS_57710(x) \
394 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57710)
395 #define BNX2X_CHIP_IS_57711(x) \
396 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57711)
397 #define BNX2X_CHIP_IS_57711E(x) \
398 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57711E)
399 #define BNX2X_CHIP_IS_E1H(x) \
400 (BNX2X_CHIP_IS_57711(x) || BNX2X_CHIP_IS_57711E(x))
401 #define BNX2X_CHIP_IS_57712(x) \
402 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57712)
403 #define BNX2X_CHIP_IS_57712E(x) \
404 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57712E)
405 #define BNX2X_CHIP_IS_57713(x) \
406 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57713)
407 #define BNX2X_CHIP_IS_57713E(x) \
408 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57713E)
409 #define BNX2X_CHIP_IS_57800(x) \
410 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57800)
411 #define BNX2X_CHIP_IS_57810(x) \
412 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57810)
413 #define BNX2X_CHIP_IS_57840(x) \
414 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57840)
415 #define BNX2X_CHIP_IS_E2(x) \
416 (BNX2X_CHIP_IS_57712(x) || BNX2X_CHIP_IS_57712E(x) || \
417 BNX2X_CHIP_IS_57713(x) || BNX2X_CHIP_IS_57713E(x))
418 #define BNX2X_CHIP_IS_E3(x) \
419 (BNX2X_CHIP_IS_57800(x) || BNX2X_CHIP_IS_57810(x) || \
420 BNX2X_CHIP_IS_57840(x))
421 #define BNX2X_CHIP_IS_E2_PLUS(x) (BNX2X_CHIP_IS_E2(x) || BNX2X_CHIP_IS_E3(x))
423 #define IS_E1H_OFFSET BNX2X_CHIP_IS_E1H(cp->chip_id)
425 #define BNX2X_RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd))
426 #define BNX2X_MAX_RX_DESC_CNT (BNX2X_RX_DESC_CNT - 2)
427 #define BNX2X_RCQ_DESC_CNT (BCM_PAGE_SIZE / sizeof(union eth_rx_cqe))
428 #define BNX2X_MAX_RCQ_DESC_CNT (BNX2X_RCQ_DESC_CNT - 1)
430 #define BNX2X_NEXT_RCQE(x) (((x) & BNX2X_MAX_RCQ_DESC_CNT) == \
431 (BNX2X_MAX_RCQ_DESC_CNT - 1)) ? \
432 ((x) + 2) : ((x) + 1)
434 #define BNX2X_DEF_SB_ID HC_SP_SB_ID
436 #define BNX2X_SHMEM_MF_BLK_OFFSET 0x7e4
438 #define BNX2X_SHMEM_ADDR(base, field) (base + \
439 offsetof(struct shmem_region, field))
441 #define BNX2X_SHMEM2_ADDR(base, field) (base + \
442 offsetof(struct shmem2_region, field))
444 #define BNX2X_SHMEM2_HAS(base, field) \
446 (CNIC_RD(dev, BNX2X_SHMEM2_ADDR(base, size)) > \
447 offsetof(struct shmem2_region, field)))
449 #define BNX2X_MF_CFG_ADDR(base, field) \
450 ((base) + offsetof(struct mf_cfg, field))
452 #ifndef ETH_MAX_RX_CLIENTS_E2
453 #define ETH_MAX_RX_CLIENTS_E2 ETH_MAX_RX_CLIENTS_E1H
456 #define CNIC_PORT(cp) ((cp)->pfid & 1)
457 #define CNIC_FUNC(cp) ((cp)->func)
458 #define CNIC_PATH(cp) (!BNX2X_CHIP_IS_E2_PLUS(cp->chip_id) ? \
459 0 : (CNIC_FUNC(cp) & 1))
460 #define CNIC_E1HVN(cp) ((cp)->pfid >> 1)
462 #define BNX2X_HW_CID(cp, x) ((CNIC_PORT(cp) << 23) | \
463 (CNIC_E1HVN(cp) << 17) | (x))
465 #define BNX2X_SW_CID(x) (x & 0x1ffff)
467 #define BNX2X_CL_QZONE_ID(cp, cli) \
468 (BNX2X_CHIP_IS_E2_PLUS(cp->chip_id) ? cli : \
469 cli + (CNIC_PORT(cp) * ETH_MAX_RX_CLIENTS_E1H))
471 #ifndef MAX_STAT_COUNTER_ID
472 #define MAX_STAT_COUNTER_ID \
473 (BNX2X_CHIP_IS_E1H((cp)->chip_id) ? MAX_STAT_COUNTER_ID_E1H : \
474 ((BNX2X_CHIP_IS_E2_PLUS((cp)->chip_id)) ? MAX_STAT_COUNTER_ID_E2 :\
475 MAX_STAT_COUNTER_ID_E1))
478 #define CNIC_SUPPORTS_FCOE(cp) \
479 (BNX2X_CHIP_IS_E2_PLUS((cp)->chip_id) && \
480 !((cp)->ethdev->drv_state & CNIC_DRV_STATE_NO_FCOE))
482 #define CNIC_RAMROD_TMO (HZ / 4)