Go to the documentation of this file.
20 #ifndef _BEISCSI_MAIN_
21 #define _BEISCSI_MAIN_
23 #include <linux/kernel.h>
24 #include <linux/pci.h>
25 #include <linux/if_ether.h>
27 #include <linux/ctype.h>
28 #include <linux/module.h>
29 #include <scsi/scsi.h>
38 #define DRV_NAME "be2iscsi"
39 #define BUILD_STR "4.4.58.0"
40 #define BE_NAME "Emulex OneConnect" \
41 "Open-iSCSI Driver version" BUILD_STR
42 #define DRV_DESC BE_NAME " " "Driver"
44 #define BE_VENDOR_ID 0x19A2
46 #define BE_DEVICE_ID1 0x212
47 #define OC_DEVICE_ID1 0x702
48 #define OC_DEVICE_ID2 0x703
51 #define BE_DEVICE_ID2 0x222
52 #define OC_DEVICE_ID3 0x712
54 #define BE2_IO_DEPTH 1024
55 #define BE2_MAX_SESSIONS 256
56 #define BE2_CMDS_PER_CXN 128
58 #define BE2_NOPOUT_REQ 16
60 #define BE2_DEFPDU_HDR_SZ 64
61 #define BE2_DEFPDU_DATA_SZ 8192
64 #define BEISCSI_SGLIST_ELEMENTS 30
66 #define BEISCSI_CMD_PER_LUN 128
67 #define BEISCSI_MAX_SECTORS 2048
69 #define BEISCSI_MAX_CMD_LEN 16
70 #define BEISCSI_NUM_MAX_LUN 256
71 #define BEISCSI_NUM_DEVICES_SUPPORTED 0x01
72 #define BEISCSI_MAX_FRAGS_INIT 192
73 #define BE_NUM_MSIX_ENTRIES 1
75 #define MPU_EP_CONTROL 0
76 #define MPU_EP_SEMAPHORE 0xac
77 #define BE2_SOFT_RESET 0x5c
78 #define BE2_PCI_ONLINE0 0xb0
79 #define BE2_PCI_ONLINE1 0xb4
80 #define BE2_SET_RESET 0x80
81 #define BE2_MPU_IRAM_ONLINE 0x00000080
83 #define BE_SENSE_INFO_SIZE 258
84 #define BE_ISCSI_PDU_HEADER_SIZE 64
85 #define BE_MIN_MEM_SIZE 16384
86 #define MAX_CMD_SZ 65536
87 #define IIOC_SCSI_DATA 0x05
89 #define INVALID_SESS_HANDLE 0xFFFFFFFF
91 #define BE_ADAPTER_UP 0x00000000
92 #define BE_ADAPTER_LINK_DOWN 0x00000001
98 #define HWI_GET_ASYNC_PDU_CTX(phwi) (phwi->phwi_ctxt->pasync_ctx)
101 #define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc
109 #define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK (1 << 29)
112 #define CEV_ISR0_OFFSET 0xC18
113 #define CEV_ISR_SIZE 4
120 #define DB_TXULP0_OFFSET 0x40
121 #define DB_RXULP0_OFFSET 0xA0
123 #define DB_EQ_OFFSET DB_CQ_OFFSET
124 #define DB_EQ_RING_ID_MASK 0x1FF
126 #define DB_EQ_CLR_SHIFT (9)
128 #define DB_EQ_EVNT_SHIFT (10)
130 #define DB_EQ_NUM_POPPED_SHIFT (16)
132 #define DB_EQ_REARM_SHIFT (29)
135 #define DB_CQ_OFFSET 0x120
136 #define DB_CQ_RING_ID_MASK 0x3FF
138 #define DB_CQ_NUM_POPPED_SHIFT (16)
140 #define DB_CQ_REARM_SHIFT (29)
142 #define GET_HWI_CONTROLLER_WS(pc) (pc->phwi_ctrlr)
143 #define HWI_GET_DEF_BUFQ_ID(pc) (((struct hwi_controller *)\
144 (GET_HWI_CONTROLLER_WS(pc)))->default_pdu_data.id)
145 #define HWI_GET_DEF_HDRQ_ID(pc) (((struct hwi_controller *)\
146 (GET_HWI_CONTROLLER_WS(pc)))->default_pdu_hdr.id)
148 #define PAGES_REQUIRED(x) \
149 ((x < PAGE_SIZE) ? 1 : ((x + PAGE_SIZE - 1) / PAGE_SIZE))
151 #define BEISCSI_MSI_NAME 20
455 #define OFFLD_PARAMS_ERL 0x00000003
456 #define OFFLD_PARAMS_DDE 0x00000004
457 #define OFFLD_PARAMS_HDE 0x00000008
458 #define OFFLD_PARAMS_IR2T 0x00000010
459 #define OFFLD_PARAMS_IMD 0x00000020
547 #define PDUCQE_CODE_MASK 0x0000003F
548 #define PDUCQE_DPL_MASK 0xFFFF0000
549 #define PDUCQE_INDEX_MASK 0x0000FFFF
572 #define CQE_VALID_MASK 0x80000000
573 #define CQE_CODE_MASK 0x0000003F
574 #define CQE_CID_MASK 0x0000FFC0
576 #define EQE_VALID_MASK 0x00000001
577 #define EQE_MAJORCODE_MASK 0x0000000E
578 #define EQE_RESID_MASK 0xFFFF0000
619 #define WRB_TYPE_MASK 0xF0000000
698 #define PDUBASE_OPCODE_MASK 0x0000003F
699 #define PDUBASE_DATALENHI_MASK 0x0000FF00
700 #define PDUBASE_DATALENLO_MASK 0xFFFF0000
852 #define BEISCSI_LOG_INIT 0x0001
853 #define BEISCSI_LOG_MBOX 0x0002
854 #define BEISCSI_LOG_MISC 0x0004
855 #define BEISCSI_LOG_EH 0x0008
856 #define BEISCSI_LOG_IO 0x0010
857 #define BEISCSI_LOG_CONFIG 0x0020
859 #define beiscsi_log(phba, level, mask, fmt, arg...) \
861 uint32_t log_value = phba->attr_log_enable; \
862 if (((mask) & log_value) || (level[1] <= '3')) \
863 shost_printk(level, phba->shost, \
864 fmt, __LINE__, ##arg); \