aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cnic.h
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2009-10-10 09:46:58 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-12 02:30:16 -0400
commite251306556d30c9c678feca60204acaaa0784cbd (patch)
treec096958b132085d77a744bfb7facb7755846df64 /drivers/net/cnic.h
parent86b53606ebec06b16be81c30fabdf8decc2be6b2 (diff)
cnic: Add bnx2x data structures.
Add hardware and software structures for bnx2x devices. Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cnic.h')
-rw-r--r--drivers/net/cnic.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/net/cnic.h b/drivers/net/cnic.h
index a94b302bb464..241d09acc0d4 100644
--- a/drivers/net/cnic.h
+++ b/drivers/net/cnic.h
@@ -227,6 +227,7 @@ struct cnic_local {
227 void *status_blk; 227 void *status_blk;
228 struct status_block_msix *bnx2_status_blk; 228 struct status_block_msix *bnx2_status_blk;
229 struct host_status_block *bnx2x_status_blk; 229 struct host_status_block *bnx2x_status_blk;
230 struct host_def_status_block *bnx2x_def_status_blk;
230 231
231 u32 status_blk_num; 232 u32 status_blk_num;
232 u32 int_num; 233 u32 int_num;
@@ -258,6 +259,7 @@ struct cnic_local {
258 struct cnic_ctx *ctx_arr; 259 struct cnic_ctx *ctx_arr;
259 int ctx_blks; 260 int ctx_blks;
260 int ctx_blk_size; 261 int ctx_blk_size;
262 unsigned long ctx_align;
261 int cids_per_blk; 263 int cids_per_blk;
262 264
263 u32 chip_id; 265 u32 chip_id;
@@ -290,11 +292,73 @@ struct bnx2x_bd_chain_next {
290 u8 reserved[8]; 292 u8 reserved[8];
291}; 293};
292 294
295#define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T (1)
296
293#define ISCSI_RAMROD_CMD_ID_UPDATE_CONN (ISCSI_KCQE_OPCODE_UPDATE_CONN) 297#define ISCSI_RAMROD_CMD_ID_UPDATE_CONN (ISCSI_KCQE_OPCODE_UPDATE_CONN)
294#define ISCSI_RAMROD_CMD_ID_INIT (ISCSI_KCQE_OPCODE_INIT) 298#define ISCSI_RAMROD_CMD_ID_INIT (ISCSI_KCQE_OPCODE_INIT)
295 299
296#define CDU_REGION_NUMBER_XCM_AG 2 300#define CDU_REGION_NUMBER_XCM_AG 2
297#define CDU_REGION_NUMBER_UCM_AG 4 301#define CDU_REGION_NUMBER_UCM_AG 4
298 302
303#define CDU_VALID_DATA(_cid, _region, _type) \
304 (((_cid) << 8) | (((_region)&0xf)<<4) | (((_type)&0xf)))
305
306#define CDU_CRC8(_cid, _region, _type) \
307 (calc_crc8(CDU_VALID_DATA(_cid, _region, _type), 0xff))
308
309#define CDU_RSRVD_VALUE_TYPE_A(_cid, _region, _type) \
310 (0x80 | ((CDU_CRC8(_cid, _region, _type)) & 0x7f))
311
312#define BNX2X_CONTEXT_MEM_SIZE 1024
313#define BNX2X_FCOE_CID 16
314
315/* iSCSI client IDs are 17, 19, 21, 23 */
316#define BNX2X_ISCSI_BASE_CL_ID 17
317#define BNX2X_ISCSI_CL_ID(vn) (BNX2X_ISCSI_BASE_CL_ID + ((vn) << 1))
318
319#define BNX2X_ISCSI_L2_CID 17
320#define BNX2X_ISCSI_START_CID 18
321#define BNX2X_ISCSI_NUM_CONNECTIONS 128
322#define BNX2X_ISCSI_TASK_CONTEXT_SIZE 128
323#define BNX2X_ISCSI_MAX_PENDING_R2TS 4
324#define BNX2X_ISCSI_R2TQE_SIZE 8
325#define BNX2X_ISCSI_HQ_BD_SIZE 64
326#define BNX2X_ISCSI_CONN_BUF_SIZE 64
327#define BNX2X_ISCSI_GLB_BUF_SIZE 64
328#define BNX2X_ISCSI_PBL_NOT_CACHED 0xff
329#define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED 0xff
330#define BNX2X_HW_CID(x, func) ((x) | (((func) % PORT_MAX) << 23) | \
331 (((func) >> 1) << 17))
332#define BNX2X_SW_CID(x) (x & 0x1ffff)
333#define BNX2X_CHIP_NUM_57711 0x164f
334#define BNX2X_CHIP_NUM_57711E 0x1650
335#define BNX2X_CHIP_NUM(x) (x >> 16)
336#define BNX2X_CHIP_IS_57711(x) \
337 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57711)
338#define BNX2X_CHIP_IS_57711E(x) \
339 (BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57711E)
340#define BNX2X_CHIP_IS_E1H(x) \
341 (BNX2X_CHIP_IS_57711(x) || BNX2X_CHIP_IS_57711E(x))
342#define IS_E1H_OFFSET BNX2X_CHIP_IS_E1H(cp->chip_id)
343
344#define BNX2X_RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd))
345#define BNX2X_MAX_RX_DESC_CNT (BNX2X_RX_DESC_CNT - 2)
346#define BNX2X_RCQ_DESC_CNT (BCM_PAGE_SIZE / sizeof(union eth_rx_cqe))
347#define BNX2X_MAX_RCQ_DESC_CNT (BNX2X_RCQ_DESC_CNT - 1)
348
349#define BNX2X_DEF_SB_ID 16
350
351#define BNX2X_ISCSI_RX_SB_INDEX_NUM \
352 ((HC_INDEX_DEF_U_ETH_ISCSI_RX_CQ_CONS << \
353 USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER_SHIFT) & \
354 USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER)
355
356#define BNX2X_SHMEM_ADDR(base, field) (base + \
357 offsetof(struct shmem_region, field))
358
359#define CNIC_PORT(cp) ((cp)->func % PORT_MAX)
360#define CNIC_FUNC(cp) ((cp)->func)
361#define CNIC_E1HVN(cp) ((cp)->func >> 1)
362
299#endif 363#endif
300 364