Go to the documentation of this file.
27 #define BFI_MEM_DMA_SEG_SZ (131072)
30 #define BFI_MEM_DMA_NSEGS(_num_reqs, _req_sz) \
31 ((u16)(((((_num_reqs) * (_req_sz)) + BFI_MEM_DMA_SEG_SZ - 1) & \
32 ~(BFI_MEM_DMA_SEG_SZ - 1)) / BFI_MEM_DMA_SEG_SZ))
35 #define BFI_MEM_NREQS_SEG(_rqsz) (BFI_MEM_DMA_SEG_SZ / (_rqsz))
38 #define BFI_MEM_SEG_FROM_TAG(_tag, _rqsz) ((_tag) / BFI_MEM_NREQS_SEG(_rqsz))
41 #define BFI_MEM_SEG_REQ_OFFSET(_tag, _sz) \
42 ((_tag) - (BFI_MEM_SEG_FROM_TAG(_tag, _sz) * BFI_MEM_NREQS_SEG(_sz)))
47 #define BFI_FLASH_CHUNK_SZ 256
48 #define BFI_FLASH_CHUNK_SZ_WORDS (BFI_FLASH_CHUNK_SZ/sizeof(u32))
65 #define bfi_fn_lpu(__fn, __lpu) ((__fn) << 1 | (__lpu))
66 #define bfi_mhdr_2_fn(_mh) ((_mh)->mtag.h2i.fn_lpu >> 1)
68 #define bfi_h2i_set(_mh, _mc, _op, _fn_lpu) do { \
69 (_mh).msg_class = (_mc); \
70 (_mh).msg_id = (_op); \
71 (_mh).mtag.h2i.fn_lpu = (_fn_lpu); \
74 #define bfi_i2h_set(_mh, _mc, _op, _i2htok) do { \
75 (_mh).msg_class = (_mc); \
76 (_mh).msg_id = (_op); \
77 (_mh).mtag.i2htok = (_i2htok); \
83 #define BFI_I2H_OPCODE_BASE 128
84 #define BFA_I2HM(_x) ((_x) + BFI_I2H_OPCODE_BASE)
94 #define BFI_SGE_INLINE 1
95 #define BFI_SGE_INLINE_MAX (BFI_SGE_INLINE + 1)
145 #define BFI_SGPG_DATA_SGES 7
146 #define BFI_SGPG_SGES_MAX (BFI_SGPG_DATA_SGES + 1)
147 #define BFI_SGPG_RSVD_WD_LEN 8
154 #define BFI_IO_MAX (2000)
155 #define BFI_IOIM_SNSLEN (256)
156 #define BFI_IOIM_SNSBUF_SEGS \
157 BFI_MEM_DMA_NSEGS(BFI_IO_MAX, BFI_IOIM_SNSLEN)
162 #define BFI_LMSG_SZ 128
163 #define BFI_LMSG_PL_WSZ \
164 ((BFI_LMSG_SZ - sizeof(struct bfi_mhdr_s)) / 4)
174 #define BFI_MBMSG_SZ 7
217 #define BFI_IOC_MAX_CQS 4
218 #define BFI_IOC_MAX_CQS_ASIC 8
219 #define BFI_IOC_MSGLEN_MAX 32
309 #define BFI_IOC_SMEM_PG0_CB (0x40)
310 #define BFI_IOC_SMEM_PG0_CT (0x180)
315 #define BFI_IOC_FWSTATS_OFF (0x6B40)
316 #define BFI_IOC_FWSTATS_SZ (4096)
321 #define BFI_IOC_TRC_OFF (0x4b00)
322 #define BFI_IOC_TRC_ENTS 256
324 #define BFI_IOC_FW_SIGNATURE (0xbfadbfad)
325 #define BFI_IOC_MD5SUM_SZ 4
338 #define BFI_FWBOOT_DEVMODE_OFF 4
339 #define BFI_FWBOOT_TYPE_OFF 8
340 #define BFI_FWBOOT_ENV_OFF 12
341 #define BFI_FWBOOT_DEVMODE(__asic_gen, __asic_mode, __p0_mode, __p1_mode) \
342 (((u32)(__asic_gen)) << 24 | \
343 ((u32)(__asic_mode)) << 16 | \
344 ((u32)(__p0_mode)) << 8 | \
347 #define BFI_FWBOOT_TYPE_NORMAL 0
348 #define BFI_FWBOOT_TYPE_MEMTEST 2
349 #define BFI_FWBOOT_ENV_OS 0
377 #define BFI_IOC_ENDIAN_SIG 0x12345678
392 #define BFI_ADAPTER_GETP(__prop, __adap_prop) \
393 (((__adap_prop) & BFI_ADAPTER_ ## __prop ## _MK) >> \
394 BFI_ADAPTER_ ## __prop ## _SH)
395 #define BFI_ADAPTER_SETP(__prop, __val) \
396 ((__val) << BFI_ADAPTER_ ## __prop ## _SH)
397 #define BFI_ADAPTER_IS_PROTO(__adap_type) \
398 ((__adap_type) & BFI_ADAPTER_PROTO)
399 #define BFI_ADAPTER_IS_TTV(__adap_type) \
400 ((__adap_type) & BFI_ADAPTER_TTV)
401 #define BFI_ADAPTER_IS_UNSUPP(__adap_type) \
402 ((__adap_type) & BFI_ADAPTER_UNSUPP)
403 #define BFI_ADAPTER_IS_SPECIAL(__adap_type) \
404 ((__adap_type) & (BFI_ADAPTER_TTV | BFI_ADAPTER_PROTO | \
416 #define bfi_ioc_enable_req_t struct bfi_ioc_ctrl_req_s;
417 #define bfi_ioc_disable_req_t struct bfi_ioc_ctrl_req_s;
429 #define bfi_ioc_enable_reply_t struct bfi_ioc_ctrl_reply_s;
430 #define bfi_ioc_disable_reply_t struct bfi_ioc_ctrl_reply_s;
432 #define BFI_IOC_MSGSZ 8
460 #define BFI_PBC_MAX_BLUNS 8
461 #define BFI_PBC_MAX_VPORTS 16
462 #define BFI_PBC_PORT_DISABLED 2
502 #define BFI_MSGQ_FULL(_q) (((_q->pi + 1) % _q->q_depth) == _q->ci)
503 #define BFI_MSGQ_EMPTY(_q) (_q->pi == _q->ci)
504 #define BFI_MSGQ_UPDATE_CI(_q) (_q->ci = (_q->ci + 1) % _q->q_depth)
505 #define BFI_MSGQ_UPDATE_PI(_q) (_q->pi = (_q->pi + 1) % _q->q_depth)
508 #define BFI_MSGQ_FREE_CNT(_q) ((_q->ci - _q->pi - 1) & (_q->q_depth - 1))
532 #define bfi_msgq_mhdr_set(_mh, _mc, _mid, _tok, _enet_id) do { \
533 (_mh).msg_class = (_mc); \
534 (_mh).msg_id = (_mid); \
535 (_mh).msg_token = (_tok); \
536 (_mh).enet_id = (_enet_id); \
543 #define BFI_MSGQ_CMD_ENTRY_SIZE (64)
544 #define BFI_MSGQ_RSP_ENTRY_SIZE (64)
545 #define BFI_MSGQ_MSG_SIZE_MAX (2048)
978 #define BFI_DIAG_MAX_SGES 2
979 #define BFI_DIAG_DMA_BUF_SZ (2 * 1024)
980 #define BFI_BOOT_MEMTEST_RES_ADDR 0x900
981 #define BFI_BOOT_MEMTEST_RES_SIG 0xA0A1A2A3
1026 #define bfi_diag_ts_rsp_t struct bfi_diag_ts_req_s
1059 #define bfi_diag_qtest_rsp_t struct bfi_diag_qtest_req_s
1076 #define bfi_diag_dport_rsp_t struct bfi_diag_dport_req_s