diff options
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.h')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.h | 126 |
1 files changed, 116 insertions, 10 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h index 0b15a8bdebfc..dcc289c25459 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.h +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h | |||
@@ -69,11 +69,11 @@ | |||
69 | #define MPT2SAS_DRIVER_NAME "mpt2sas" | 69 | #define MPT2SAS_DRIVER_NAME "mpt2sas" |
70 | #define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>" | 70 | #define MPT2SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>" |
71 | #define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver" | 71 | #define MPT2SAS_DESCRIPTION "LSI MPT Fusion SAS 2.0 Device Driver" |
72 | #define MPT2SAS_DRIVER_VERSION "06.100.00.00" | 72 | #define MPT2SAS_DRIVER_VERSION "08.100.00.02" |
73 | #define MPT2SAS_MAJOR_VERSION 06 | 73 | #define MPT2SAS_MAJOR_VERSION 08 |
74 | #define MPT2SAS_MINOR_VERSION 100 | 74 | #define MPT2SAS_MINOR_VERSION 100 |
75 | #define MPT2SAS_BUILD_VERSION 00 | 75 | #define MPT2SAS_BUILD_VERSION 00 |
76 | #define MPT2SAS_RELEASE_VERSION 00 | 76 | #define MPT2SAS_RELEASE_VERSION 02 |
77 | 77 | ||
78 | /* | 78 | /* |
79 | * Set MPT2SAS_SG_DEPTH value based on user input. | 79 | * Set MPT2SAS_SG_DEPTH value based on user input. |
@@ -101,7 +101,8 @@ | |||
101 | #define MPT_NAME_LENGTH 32 /* generic length of strings */ | 101 | #define MPT_NAME_LENGTH 32 /* generic length of strings */ |
102 | #define MPT_STRING_LENGTH 64 | 102 | #define MPT_STRING_LENGTH 64 |
103 | 103 | ||
104 | #define MPT_MAX_CALLBACKS 16 | 104 | #define MPT_MAX_CALLBACKS 16 |
105 | |||
105 | 106 | ||
106 | #define CAN_SLEEP 1 | 107 | #define CAN_SLEEP 1 |
107 | #define NO_SLEEP 0 | 108 | #define NO_SLEEP 0 |
@@ -154,6 +155,50 @@ | |||
154 | #define MPT2SAS_DELL_6GBPS_SAS_SSDID 0x1F22 | 155 | #define MPT2SAS_DELL_6GBPS_SAS_SSDID 0x1F22 |
155 | 156 | ||
156 | /* | 157 | /* |
158 | * Intel HBA branding | ||
159 | */ | ||
160 | #define MPT2SAS_INTEL_RMS2LL080_BRANDING \ | ||
161 | "Intel Integrated RAID Module RMS2LL080" | ||
162 | #define MPT2SAS_INTEL_RMS2LL040_BRANDING \ | ||
163 | "Intel Integrated RAID Module RMS2LL040" | ||
164 | |||
165 | /* | ||
166 | * Intel HBA SSDIDs | ||
167 | */ | ||
168 | #define MPT2SAS_INTEL_RMS2LL080_SSDID 0x350E | ||
169 | #define MPT2SAS_INTEL_RMS2LL040_SSDID 0x350F | ||
170 | |||
171 | |||
172 | /* | ||
173 | * HP HBA branding | ||
174 | */ | ||
175 | #define MPT2SAS_HP_3PAR_SSVID 0x1590 | ||
176 | #define MPT2SAS_HP_2_4_INTERNAL_BRANDING "HP H220 Host Bus Adapter" | ||
177 | #define MPT2SAS_HP_2_4_EXTERNAL_BRANDING "HP H221 Host Bus Adapter" | ||
178 | #define MPT2SAS_HP_1_4_INTERNAL_1_4_EXTERNAL_BRANDING "HP H222 Host Bus Adapter" | ||
179 | #define MPT2SAS_HP_EMBEDDED_2_4_INTERNAL_BRANDING "HP H220i Host Bus Adapter" | ||
180 | #define MPT2SAS_HP_DAUGHTER_2_4_INTERNAL_BRANDING "HP H210i Host Bus Adapter" | ||
181 | |||
182 | /* | ||
183 | * HO HBA SSDIDs | ||
184 | */ | ||
185 | #define MPT2SAS_HP_2_4_INTERNAL_SSDID 0x0041 | ||
186 | #define MPT2SAS_HP_2_4_EXTERNAL_SSDID 0x0042 | ||
187 | #define MPT2SAS_HP_1_4_INTERNAL_1_4_EXTERNAL_SSDID 0x0043 | ||
188 | #define MPT2SAS_HP_EMBEDDED_2_4_INTERNAL_SSDID 0x0044 | ||
189 | #define MPT2SAS_HP_DAUGHTER_2_4_INTERNAL_SSDID 0x0046 | ||
190 | |||
191 | /* | ||
192 | * WarpDrive Specific Log codes | ||
193 | */ | ||
194 | |||
195 | #define MPT2_WARPDRIVE_LOGENTRY (0x8002) | ||
196 | #define MPT2_WARPDRIVE_LC_SSDT (0x41) | ||
197 | #define MPT2_WARPDRIVE_LC_SSDLW (0x43) | ||
198 | #define MPT2_WARPDRIVE_LC_SSDLF (0x44) | ||
199 | #define MPT2_WARPDRIVE_LC_BRMF (0x4D) | ||
200 | |||
201 | /* | ||
157 | * per target private data | 202 | * per target private data |
158 | */ | 203 | */ |
159 | #define MPT_TARGET_FLAGS_RAID_COMPONENT 0x01 | 204 | #define MPT_TARGET_FLAGS_RAID_COMPONENT 0x01 |
@@ -164,6 +209,7 @@ | |||
164 | * struct MPT2SAS_TARGET - starget private hostdata | 209 | * struct MPT2SAS_TARGET - starget private hostdata |
165 | * @starget: starget object | 210 | * @starget: starget object |
166 | * @sas_address: target sas address | 211 | * @sas_address: target sas address |
212 | * @raid_device: raid_device pointer to access volume data | ||
167 | * @handle: device handle | 213 | * @handle: device handle |
168 | * @num_luns: number luns | 214 | * @num_luns: number luns |
169 | * @flags: MPT_TARGET_FLAGS_XXX flags | 215 | * @flags: MPT_TARGET_FLAGS_XXX flags |
@@ -173,6 +219,7 @@ | |||
173 | struct MPT2SAS_TARGET { | 219 | struct MPT2SAS_TARGET { |
174 | struct scsi_target *starget; | 220 | struct scsi_target *starget; |
175 | u64 sas_address; | 221 | u64 sas_address; |
222 | struct _raid_device *raid_device; | ||
176 | u16 handle; | 223 | u16 handle; |
177 | int num_luns; | 224 | int num_luns; |
178 | u32 flags; | 225 | u32 flags; |
@@ -180,6 +227,7 @@ struct MPT2SAS_TARGET { | |||
180 | u8 tm_busy; | 227 | u8 tm_busy; |
181 | }; | 228 | }; |
182 | 229 | ||
230 | |||
183 | /* | 231 | /* |
184 | * per device private data | 232 | * per device private data |
185 | */ | 233 | */ |
@@ -227,6 +275,12 @@ typedef struct _MPI2_CONFIG_PAGE_MAN_10 { | |||
227 | MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_10, | 275 | MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_10, |
228 | Mpi2ManufacturingPage10_t, MPI2_POINTER pMpi2ManufacturingPage10_t; | 276 | Mpi2ManufacturingPage10_t, MPI2_POINTER pMpi2ManufacturingPage10_t; |
229 | 277 | ||
278 | #define MFG_PAGE10_HIDE_SSDS_MASK (0x00000003) | ||
279 | #define MFG_PAGE10_HIDE_ALL_DISKS (0x00) | ||
280 | #define MFG_PAGE10_EXPOSE_ALL_DISKS (0x01) | ||
281 | #define MFG_PAGE10_HIDE_IF_VOL_PRESENT (0x02) | ||
282 | |||
283 | |||
230 | struct MPT2SAS_DEVICE { | 284 | struct MPT2SAS_DEVICE { |
231 | struct MPT2SAS_TARGET *sas_target; | 285 | struct MPT2SAS_TARGET *sas_target; |
232 | unsigned int lun; | 286 | unsigned int lun; |
@@ -306,6 +360,7 @@ struct _sas_device { | |||
306 | * @sdev: scsi device struct (volumes are single lun) | 360 | * @sdev: scsi device struct (volumes are single lun) |
307 | * @wwid: unique identifier for the volume | 361 | * @wwid: unique identifier for the volume |
308 | * @handle: device handle | 362 | * @handle: device handle |
363 | * @block_size: Block size of the volume | ||
309 | * @id: target id | 364 | * @id: target id |
310 | * @channel: target channel | 365 | * @channel: target channel |
311 | * @volume_type: the raid level | 366 | * @volume_type: the raid level |
@@ -313,20 +368,33 @@ struct _sas_device { | |||
313 | * @num_pds: number of hidden raid components | 368 | * @num_pds: number of hidden raid components |
314 | * @responding: used in _scsih_raid_device_mark_responding | 369 | * @responding: used in _scsih_raid_device_mark_responding |
315 | * @percent_complete: resync percent complete | 370 | * @percent_complete: resync percent complete |
371 | * @direct_io_enabled: Whether direct io to PDs are allowed or not | ||
372 | * @stripe_exponent: X where 2powX is the stripe sz in blocks | ||
373 | * @max_lba: Maximum number of LBA in the volume | ||
374 | * @stripe_sz: Stripe Size of the volume | ||
375 | * @device_info: Device info of the volume member disk | ||
376 | * @pd_handle: Array of handles of the physical drives for direct I/O in le16 | ||
316 | */ | 377 | */ |
378 | #define MPT_MAX_WARPDRIVE_PDS 8 | ||
317 | struct _raid_device { | 379 | struct _raid_device { |
318 | struct list_head list; | 380 | struct list_head list; |
319 | struct scsi_target *starget; | 381 | struct scsi_target *starget; |
320 | struct scsi_device *sdev; | 382 | struct scsi_device *sdev; |
321 | u64 wwid; | 383 | u64 wwid; |
322 | u16 handle; | 384 | u16 handle; |
385 | u16 block_sz; | ||
323 | int id; | 386 | int id; |
324 | int channel; | 387 | int channel; |
325 | u8 volume_type; | 388 | u8 volume_type; |
326 | u32 device_info; | ||
327 | u8 num_pds; | 389 | u8 num_pds; |
328 | u8 responding; | 390 | u8 responding; |
329 | u8 percent_complete; | 391 | u8 percent_complete; |
392 | u8 direct_io_enabled; | ||
393 | u8 stripe_exponent; | ||
394 | u64 max_lba; | ||
395 | u32 stripe_sz; | ||
396 | u32 device_info; | ||
397 | u16 pd_handle[MPT_MAX_WARPDRIVE_PDS]; | ||
330 | }; | 398 | }; |
331 | 399 | ||
332 | /** | 400 | /** |
@@ -419,17 +487,44 @@ enum reset_type { | |||
419 | }; | 487 | }; |
420 | 488 | ||
421 | /** | 489 | /** |
422 | * struct request_tracker - firmware request tracker | 490 | * struct chain_tracker - firmware chain tracker |
491 | * @chain_buffer: chain buffer | ||
492 | * @chain_buffer_dma: physical address | ||
493 | * @tracker_list: list of free request (ioc->free_chain_list) | ||
494 | */ | ||
495 | struct chain_tracker { | ||
496 | void *chain_buffer; | ||
497 | dma_addr_t chain_buffer_dma; | ||
498 | struct list_head tracker_list; | ||
499 | }; | ||
500 | |||
501 | /** | ||
502 | * struct scsiio_tracker - scsi mf request tracker | ||
423 | * @smid: system message id | 503 | * @smid: system message id |
424 | * @scmd: scsi request pointer | 504 | * @scmd: scsi request pointer |
425 | * @cb_idx: callback index | 505 | * @cb_idx: callback index |
506 | * @direct_io: To indicate whether I/O is direct (WARPDRIVE) | ||
426 | * @chain_list: list of chains associated to this IO | 507 | * @chain_list: list of chains associated to this IO |
427 | * @tracker_list: list of free request (ioc->free_list) | 508 | * @tracker_list: list of free request (ioc->free_list) |
428 | */ | 509 | */ |
429 | struct request_tracker { | 510 | struct scsiio_tracker { |
430 | u16 smid; | 511 | u16 smid; |
431 | struct scsi_cmnd *scmd; | 512 | struct scsi_cmnd *scmd; |
432 | u8 cb_idx; | 513 | u8 cb_idx; |
514 | u8 direct_io; | ||
515 | struct list_head chain_list; | ||
516 | struct list_head tracker_list; | ||
517 | }; | ||
518 | |||
519 | /** | ||
520 | * struct request_tracker - firmware request tracker | ||
521 | * @smid: system message id | ||
522 | * @cb_idx: callback index | ||
523 | * @tracker_list: list of free request (ioc->free_list) | ||
524 | */ | ||
525 | struct request_tracker { | ||
526 | u16 smid; | ||
527 | u8 cb_idx; | ||
433 | struct list_head tracker_list; | 528 | struct list_head tracker_list; |
434 | }; | 529 | }; |
435 | 530 | ||
@@ -696,7 +791,7 @@ struct MPT2SAS_ADAPTER { | |||
696 | u8 *request; | 791 | u8 *request; |
697 | dma_addr_t request_dma; | 792 | dma_addr_t request_dma; |
698 | u32 request_dma_sz; | 793 | u32 request_dma_sz; |
699 | struct request_tracker *scsi_lookup; | 794 | struct scsiio_tracker *scsi_lookup; |
700 | ulong scsi_lookup_pages; | 795 | ulong scsi_lookup_pages; |
701 | spinlock_t scsi_lookup_lock; | 796 | spinlock_t scsi_lookup_lock; |
702 | struct list_head free_list; | 797 | struct list_head free_list; |
@@ -704,8 +799,10 @@ struct MPT2SAS_ADAPTER { | |||
704 | wait_queue_head_t reset_wq; | 799 | wait_queue_head_t reset_wq; |
705 | 800 | ||
706 | /* chain */ | 801 | /* chain */ |
707 | u8 *chain; | 802 | struct chain_tracker *chain_lookup; |
708 | dma_addr_t chain_dma; | 803 | struct list_head free_chain_list; |
804 | struct dma_pool *chain_dma_pool; | ||
805 | ulong chain_pages; | ||
709 | u16 max_sges_in_main_message; | 806 | u16 max_sges_in_main_message; |
710 | u16 max_sges_in_chain_message; | 807 | u16 max_sges_in_chain_message; |
711 | u16 chains_needed_per_io; | 808 | u16 chains_needed_per_io; |
@@ -737,6 +834,8 @@ struct MPT2SAS_ADAPTER { | |||
737 | u16 reply_sz; | 834 | u16 reply_sz; |
738 | u8 *reply; | 835 | u8 *reply; |
739 | dma_addr_t reply_dma; | 836 | dma_addr_t reply_dma; |
837 | u32 reply_dma_max_address; | ||
838 | u32 reply_dma_min_address; | ||
740 | struct dma_pool *reply_dma_pool; | 839 | struct dma_pool *reply_dma_pool; |
741 | 840 | ||
742 | /* reply free queue */ | 841 | /* reply free queue */ |
@@ -767,6 +866,11 @@ struct MPT2SAS_ADAPTER { | |||
767 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; | 866 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; |
768 | u32 ring_buffer_offset; | 867 | u32 ring_buffer_offset; |
769 | u32 ring_buffer_sz; | 868 | u32 ring_buffer_sz; |
869 | u8 is_warpdrive; | ||
870 | u8 hide_ir_msg; | ||
871 | u8 mfg_pg10_hide_flag; | ||
872 | u8 hide_drives; | ||
873 | |||
770 | }; | 874 | }; |
771 | 875 | ||
772 | typedef u8 (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, | 876 | typedef u8 (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
@@ -832,6 +936,8 @@ int mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
832 | ulong timeout, struct scsi_cmnd *scmd); | 936 | ulong timeout, struct scsi_cmnd *scmd); |
833 | void mpt2sas_scsih_set_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); | 937 | void mpt2sas_scsih_set_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); |
834 | void mpt2sas_scsih_clear_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); | 938 | void mpt2sas_scsih_clear_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); |
939 | void mpt2sas_expander_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address); | ||
940 | void mpt2sas_device_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address); | ||
835 | struct _sas_node *mpt2sas_scsih_expander_find_by_handle(struct MPT2SAS_ADAPTER *ioc, | 941 | struct _sas_node *mpt2sas_scsih_expander_find_by_handle(struct MPT2SAS_ADAPTER *ioc, |
836 | u16 handle); | 942 | u16 handle); |
837 | struct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAPTER | 943 | struct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAPTER |