diff options
Diffstat (limited to 'drivers/scsi/be2iscsi/be_main.h')
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.h | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index 53c9b70ac7ac..25e6b208b771 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h | |||
@@ -21,11 +21,9 @@ | |||
21 | #ifndef _BEISCSI_MAIN_ | 21 | #ifndef _BEISCSI_MAIN_ |
22 | #define _BEISCSI_MAIN_ | 22 | #define _BEISCSI_MAIN_ |
23 | 23 | ||
24 | |||
25 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
26 | #include <linux/pci.h> | 25 | #include <linux/pci.h> |
27 | #include <linux/in.h> | 26 | #include <linux/in.h> |
28 | #include <linux/blk-iopoll.h> | ||
29 | #include <scsi/scsi.h> | 27 | #include <scsi/scsi.h> |
30 | #include <scsi/scsi_cmnd.h> | 28 | #include <scsi/scsi_cmnd.h> |
31 | #include <scsi/scsi_device.h> | 29 | #include <scsi/scsi_device.h> |
@@ -35,12 +33,8 @@ | |||
35 | #include <scsi/scsi_transport_iscsi.h> | 33 | #include <scsi/scsi_transport_iscsi.h> |
36 | 34 | ||
37 | #include "be.h" | 35 | #include "be.h" |
38 | |||
39 | |||
40 | |||
41 | #define DRV_NAME "be2iscsi" | 36 | #define DRV_NAME "be2iscsi" |
42 | #define BUILD_STR "2.0.527.0" | 37 | #define BUILD_STR "2.0.527.0" |
43 | |||
44 | #define BE_NAME "ServerEngines BladeEngine2" \ | 38 | #define BE_NAME "ServerEngines BladeEngine2" \ |
45 | "Linux iSCSI Driver version" BUILD_STR | 39 | "Linux iSCSI Driver version" BUILD_STR |
46 | #define DRV_DESC BE_NAME " " "Driver" | 40 | #define DRV_DESC BE_NAME " " "Driver" |
@@ -49,6 +43,8 @@ | |||
49 | #define BE_DEVICE_ID1 0x212 | 43 | #define BE_DEVICE_ID1 0x212 |
50 | #define OC_DEVICE_ID1 0x702 | 44 | #define OC_DEVICE_ID1 0x702 |
51 | #define OC_DEVICE_ID2 0x703 | 45 | #define OC_DEVICE_ID2 0x703 |
46 | #define OC_DEVICE_ID3 0x712 | ||
47 | #define OC_DEVICE_ID4 0x222 | ||
52 | 48 | ||
53 | #define BE2_MAX_SESSIONS 64 | 49 | #define BE2_MAX_SESSIONS 64 |
54 | #define BE2_CMDS_PER_CXN 128 | 50 | #define BE2_CMDS_PER_CXN 128 |
@@ -63,6 +59,7 @@ | |||
63 | #define BE2_IO_DEPTH \ | 59 | #define BE2_IO_DEPTH \ |
64 | (BE2_MAX_ICDS / 2 - (BE2_LOGOUTS + BE2_TMFS + BE2_NOPOUT_REQ)) | 60 | (BE2_MAX_ICDS / 2 - (BE2_LOGOUTS + BE2_TMFS + BE2_NOPOUT_REQ)) |
65 | 61 | ||
62 | #define MAX_CPUS 31 | ||
66 | #define BEISCSI_SGLIST_ELEMENTS BE2_SGE | 63 | #define BEISCSI_SGLIST_ELEMENTS BE2_SGE |
67 | 64 | ||
68 | #define BEISCSI_MAX_CMNDS 1024 /* Max IO's per Ctrlr sht->can_queue */ | 65 | #define BEISCSI_MAX_CMNDS 1024 /* Max IO's per Ctrlr sht->can_queue */ |
@@ -79,7 +76,7 @@ | |||
79 | #define BE_SENSE_INFO_SIZE 258 | 76 | #define BE_SENSE_INFO_SIZE 258 |
80 | #define BE_ISCSI_PDU_HEADER_SIZE 64 | 77 | #define BE_ISCSI_PDU_HEADER_SIZE 64 |
81 | #define BE_MIN_MEM_SIZE 16384 | 78 | #define BE_MIN_MEM_SIZE 16384 |
82 | 79 | #define MAX_CMD_SZ 65536 | |
83 | #define IIOC_SCSI_DATA 0x05 /* Write Operation */ | 80 | #define IIOC_SCSI_DATA 0x05 /* Write Operation */ |
84 | 81 | ||
85 | #define DBG_LVL 0x00000001 | 82 | #define DBG_LVL 0x00000001 |
@@ -100,6 +97,8 @@ do { \ | |||
100 | } \ | 97 | } \ |
101 | } while (0); | 98 | } while (0); |
102 | 99 | ||
100 | #define BE_ADAPTER_UP 0x00000000 | ||
101 | #define BE_ADAPTER_LINK_DOWN 0x00000001 | ||
103 | /** | 102 | /** |
104 | * hardware needs the async PDU buffers to be posted in multiples of 8 | 103 | * hardware needs the async PDU buffers to be posted in multiples of 8 |
105 | * So have atleast 8 of them by default | 104 | * So have atleast 8 of them by default |
@@ -160,21 +159,19 @@ do { \ | |||
160 | 159 | ||
161 | enum be_mem_enum { | 160 | enum be_mem_enum { |
162 | HWI_MEM_ADDN_CONTEXT, | 161 | HWI_MEM_ADDN_CONTEXT, |
163 | HWI_MEM_CQ, | ||
164 | HWI_MEM_EQ, | ||
165 | HWI_MEM_WRB, | 162 | HWI_MEM_WRB, |
166 | HWI_MEM_WRBH, | 163 | HWI_MEM_WRBH, |
167 | HWI_MEM_SGLH, /* 5 */ | 164 | HWI_MEM_SGLH, |
168 | HWI_MEM_SGE, | 165 | HWI_MEM_SGE, |
169 | HWI_MEM_ASYNC_HEADER_BUF, | 166 | HWI_MEM_ASYNC_HEADER_BUF, /* 5 */ |
170 | HWI_MEM_ASYNC_DATA_BUF, | 167 | HWI_MEM_ASYNC_DATA_BUF, |
171 | HWI_MEM_ASYNC_HEADER_RING, | 168 | HWI_MEM_ASYNC_HEADER_RING, |
172 | HWI_MEM_ASYNC_DATA_RING, /* 10 */ | 169 | HWI_MEM_ASYNC_DATA_RING, |
173 | HWI_MEM_ASYNC_HEADER_HANDLE, | 170 | HWI_MEM_ASYNC_HEADER_HANDLE, |
174 | HWI_MEM_ASYNC_DATA_HANDLE, | 171 | HWI_MEM_ASYNC_DATA_HANDLE, /* 10 */ |
175 | HWI_MEM_ASYNC_PDU_CONTEXT, | 172 | HWI_MEM_ASYNC_PDU_CONTEXT, |
176 | ISCSI_MEM_GLOBAL_HEADER, | 173 | ISCSI_MEM_GLOBAL_HEADER, |
177 | SE_MEM_MAX /* 15 */ | 174 | SE_MEM_MAX |
178 | }; | 175 | }; |
179 | 176 | ||
180 | struct be_bus_address32 { | 177 | struct be_bus_address32 { |
@@ -212,6 +209,9 @@ struct be_mem_descriptor { | |||
212 | 209 | ||
213 | struct sgl_handle { | 210 | struct sgl_handle { |
214 | unsigned int sgl_index; | 211 | unsigned int sgl_index; |
212 | unsigned int type; | ||
213 | unsigned int cid; | ||
214 | struct iscsi_task *task; | ||
215 | struct iscsi_sge *pfrag; | 215 | struct iscsi_sge *pfrag; |
216 | }; | 216 | }; |
217 | 217 | ||
@@ -274,13 +274,17 @@ struct beiscsi_hba { | |||
274 | struct pci_dev *pcidev; | 274 | struct pci_dev *pcidev; |
275 | unsigned int state; | 275 | unsigned int state; |
276 | unsigned short asic_revision; | 276 | unsigned short asic_revision; |
277 | struct blk_iopoll iopoll; | 277 | unsigned int num_cpus; |
278 | unsigned int nxt_cqid; | ||
279 | struct msix_entry msix_entries[MAX_CPUS + 1]; | ||
280 | bool msix_enabled; | ||
278 | struct be_mem_descriptor *init_mem; | 281 | struct be_mem_descriptor *init_mem; |
279 | 282 | ||
280 | unsigned short io_sgl_alloc_index; | 283 | unsigned short io_sgl_alloc_index; |
281 | unsigned short io_sgl_free_index; | 284 | unsigned short io_sgl_free_index; |
282 | unsigned short io_sgl_hndl_avbl; | 285 | unsigned short io_sgl_hndl_avbl; |
283 | struct sgl_handle **io_sgl_hndl_base; | 286 | struct sgl_handle **io_sgl_hndl_base; |
287 | struct sgl_handle **sgl_hndl_array; | ||
284 | 288 | ||
285 | unsigned short eh_sgl_alloc_index; | 289 | unsigned short eh_sgl_alloc_index; |
286 | unsigned short eh_sgl_free_index; | 290 | unsigned short eh_sgl_free_index; |
@@ -315,6 +319,7 @@ struct beiscsi_hba { | |||
315 | unsigned short cid_alloc; | 319 | unsigned short cid_alloc; |
316 | unsigned short cid_free; | 320 | unsigned short cid_free; |
317 | unsigned short avlbl_cids; | 321 | unsigned short avlbl_cids; |
322 | unsigned short iscsi_features; | ||
318 | spinlock_t cid_lock; | 323 | spinlock_t cid_lock; |
319 | } fw_config; | 324 | } fw_config; |
320 | 325 | ||
@@ -343,6 +348,7 @@ struct beiscsi_conn { | |||
343 | unsigned short login_in_progress; | 348 | unsigned short login_in_progress; |
344 | struct sgl_handle *plogin_sgl_handle; | 349 | struct sgl_handle *plogin_sgl_handle; |
345 | struct beiscsi_session *beiscsi_sess; | 350 | struct beiscsi_session *beiscsi_sess; |
351 | struct iscsi_task *task; | ||
346 | }; | 352 | }; |
347 | 353 | ||
348 | /* This structure is used by the chip */ | 354 | /* This structure is used by the chip */ |
@@ -390,7 +396,7 @@ struct beiscsi_io_task { | |||
390 | unsigned int flags; | 396 | unsigned int flags; |
391 | unsigned short cid; | 397 | unsigned short cid; |
392 | unsigned short header_len; | 398 | unsigned short header_len; |
393 | 399 | itt_t libiscsi_itt; | |
394 | struct be_cmd_bhs *cmd_bhs; | 400 | struct be_cmd_bhs *cmd_bhs; |
395 | struct be_bus_address bhs_pa; | 401 | struct be_bus_address bhs_pa; |
396 | unsigned short bhs_len; | 402 | unsigned short bhs_len; |
@@ -599,7 +605,6 @@ struct amap_cq_db { | |||
599 | 605 | ||
600 | void beiscsi_process_eq(struct beiscsi_hba *phba); | 606 | void beiscsi_process_eq(struct beiscsi_hba *phba); |
601 | 607 | ||
602 | |||
603 | struct iscsi_wrb { | 608 | struct iscsi_wrb { |
604 | u32 dw[16]; | 609 | u32 dw[16]; |
605 | } __packed; | 610 | } __packed; |
@@ -820,10 +825,12 @@ struct wrb_handle { | |||
820 | }; | 825 | }; |
821 | 826 | ||
822 | struct hwi_context_memory { | 827 | struct hwi_context_memory { |
823 | struct be_eq_obj be_eq; | 828 | /* Adaptive interrupt coalescing (AIC) info */ |
824 | struct be_queue_info be_cq; | 829 | u16 min_eqd; /* in usecs */ |
825 | struct be_queue_info be_mcc_cq; | 830 | u16 max_eqd; /* in usecs */ |
826 | struct be_queue_info be_mcc; | 831 | u16 cur_eqd; /* in usecs */ |
832 | struct be_eq_obj be_eq[MAX_CPUS]; | ||
833 | struct be_queue_info be_cq[MAX_CPUS]; | ||
827 | 834 | ||
828 | struct be_queue_info be_def_hdrq; | 835 | struct be_queue_info be_def_hdrq; |
829 | struct be_queue_info be_def_dataq; | 836 | struct be_queue_info be_def_dataq; |