aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas/mpt2sas_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.h')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.h72
1 files changed, 58 insertions, 14 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 8d5be2120c63..3c3babc7d260 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -69,8 +69,8 @@
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 "09.100.00.00" 72#define MPT2SAS_DRIVER_VERSION "10.100.00.00"
73#define MPT2SAS_MAJOR_VERSION 09 73#define MPT2SAS_MAJOR_VERSION 10
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 00
@@ -544,6 +544,28 @@ struct _tr_list {
544 544
545typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); 545typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr);
546 546
547/**
548 * struct adapter_reply_queue - the reply queue struct
549 * @ioc: per adapter object
550 * @msix_index: msix index into vector table
551 * @vector: irq vector
552 * @reply_post_host_index: head index in the pool where FW completes IO
553 * @reply_post_free: reply post base virt address
554 * @name: the name registered to request_irq()
555 * @busy: isr is actively processing replies on another cpu
556 * @list: this list
557*/
558struct adapter_reply_queue {
559 struct MPT2SAS_ADAPTER *ioc;
560 u8 msix_index;
561 unsigned int vector;
562 u32 reply_post_host_index;
563 Mpi2ReplyDescriptorsUnion_t *reply_post_free;
564 char name[MPT_NAME_LENGTH];
565 atomic_t busy;
566 struct list_head list;
567};
568
547/* IOC Facts and Port Facts converted from little endian to cpu */ 569/* IOC Facts and Port Facts converted from little endian to cpu */
548union mpi2_version_union { 570union mpi2_version_union {
549 MPI2_VERSION_STRUCT Struct; 571 MPI2_VERSION_STRUCT Struct;
@@ -606,7 +628,7 @@ enum mutex_type {
606 * @list: ioc_list 628 * @list: ioc_list
607 * @shost: shost object 629 * @shost: shost object
608 * @id: unique adapter id 630 * @id: unique adapter id
609 * @pci_irq: irq number 631 * @cpu_count: number online cpus
610 * @name: generic ioc string 632 * @name: generic ioc string
611 * @tmp_string: tmp string used for logging 633 * @tmp_string: tmp string used for logging
612 * @pdev: pci pdev object 634 * @pdev: pci pdev object
@@ -633,11 +655,16 @@ enum mutex_type {
633 * @ignore_loginfos: ignore loginfos during task management 655 * @ignore_loginfos: ignore loginfos during task management
634 * @remove_host: flag for when driver unloads, to avoid sending dev resets 656 * @remove_host: flag for when driver unloads, to avoid sending dev resets
635 * @pci_error_recovery: flag to prevent ioc access until slot reset completes 657 * @pci_error_recovery: flag to prevent ioc access until slot reset completes
636 * @wait_for_port_enable_to_complete: 658 * @wait_for_discovery_to_complete: flag set at driver load time when
659 * waiting on reporting devices
660 * @is_driver_loading: flag set at driver load time
661 * @port_enable_failed: flag set when port enable has failed
662 * @start_scan: flag set from scan_start callback, cleared from _mpt2sas_fw_work
663 * @start_scan_failed: means port enable failed, return's the ioc_status
637 * @msix_enable: flag indicating msix is enabled 664 * @msix_enable: flag indicating msix is enabled
638 * @msix_vector_count: number msix vectors 665 * @msix_vector_count: number msix vectors
639 * @msix_table: virt address to the msix table 666 * @cpu_msix_table: table for mapping cpus to msix index
640 * @msix_table_backup: backup msix table 667 * @cpu_msix_table_sz: table size
641 * @scsi_io_cb_idx: shost generated commands 668 * @scsi_io_cb_idx: shost generated commands
642 * @tm_cb_idx: task management commands 669 * @tm_cb_idx: task management commands
643 * @scsih_cb_idx: scsih internal commands 670 * @scsih_cb_idx: scsih internal commands
@@ -728,7 +755,8 @@ enum mutex_type {
728 * @reply_post_queue_depth: reply post queue depth 755 * @reply_post_queue_depth: reply post queue depth
729 * @reply_post_free: pool for reply post (64bit descriptor) 756 * @reply_post_free: pool for reply post (64bit descriptor)
730 * @reply_post_free_dma: 757 * @reply_post_free_dma:
731 * @reply_post_free_dma_pool: 758 * @reply_queue_count: number of reply queue's
759 * @reply_queue_list: link list contaning the reply queue info
732 * @reply_post_host_index: head index in the pool where FW completes IO 760 * @reply_post_host_index: head index in the pool where FW completes IO
733 * @delayed_tr_list: target reset link list 761 * @delayed_tr_list: target reset link list
734 * @delayed_tr_volume_list: volume target reset link list 762 * @delayed_tr_volume_list: volume target reset link list
@@ -737,7 +765,7 @@ struct MPT2SAS_ADAPTER {
737 struct list_head list; 765 struct list_head list;
738 struct Scsi_Host *shost; 766 struct Scsi_Host *shost;
739 u8 id; 767 u8 id;
740 u32 pci_irq; 768 int cpu_count;
741 char name[MPT_NAME_LENGTH]; 769 char name[MPT_NAME_LENGTH];
742 char tmp_string[MPT_STRING_LENGTH]; 770 char tmp_string[MPT_STRING_LENGTH];
743 struct pci_dev *pdev; 771 struct pci_dev *pdev;
@@ -767,20 +795,26 @@ struct MPT2SAS_ADAPTER {
767 u8 shost_recovery; 795 u8 shost_recovery;
768 796
769 struct mutex reset_in_progress_mutex; 797 struct mutex reset_in_progress_mutex;
770 struct completion shost_recovery_done;
771 spinlock_t ioc_reset_in_progress_lock; 798 spinlock_t ioc_reset_in_progress_lock;
772 u8 ioc_link_reset_in_progress; 799 u8 ioc_link_reset_in_progress;
773 int ioc_reset_in_progress_status; 800 u8 ioc_reset_in_progress_status;
774 801
775 u8 ignore_loginfos; 802 u8 ignore_loginfos;
776 u8 remove_host; 803 u8 remove_host;
777 u8 pci_error_recovery; 804 u8 pci_error_recovery;
778 u8 wait_for_port_enable_to_complete; 805 u8 wait_for_discovery_to_complete;
806 struct completion port_enable_done;
807 u8 is_driver_loading;
808 u8 port_enable_failed;
809
810 u8 start_scan;
811 u16 start_scan_failed;
779 812
780 u8 msix_enable; 813 u8 msix_enable;
781 u16 msix_vector_count; 814 u16 msix_vector_count;
782 u32 *msix_table; 815 u8 *cpu_msix_table;
783 u32 *msix_table_backup; 816 resource_size_t **reply_post_host_index;
817 u16 cpu_msix_table_sz;
784 u32 ioc_reset_count; 818 u32 ioc_reset_count;
785 819
786 /* internal commands, callback index */ 820 /* internal commands, callback index */
@@ -790,11 +824,13 @@ struct MPT2SAS_ADAPTER {
790 u8 scsih_cb_idx; 824 u8 scsih_cb_idx;
791 u8 ctl_cb_idx; 825 u8 ctl_cb_idx;
792 u8 base_cb_idx; 826 u8 base_cb_idx;
827 u8 port_enable_cb_idx;
793 u8 config_cb_idx; 828 u8 config_cb_idx;
794 u8 tm_tr_cb_idx; 829 u8 tm_tr_cb_idx;
795 u8 tm_tr_volume_cb_idx; 830 u8 tm_tr_volume_cb_idx;
796 u8 tm_sas_control_cb_idx; 831 u8 tm_sas_control_cb_idx;
797 struct _internal_cmd base_cmds; 832 struct _internal_cmd base_cmds;
833 struct _internal_cmd port_enable_cmds;
798 struct _internal_cmd transport_cmds; 834 struct _internal_cmd transport_cmds;
799 struct _internal_cmd scsih_cmds; 835 struct _internal_cmd scsih_cmds;
800 struct _internal_cmd tm_cmds; 836 struct _internal_cmd tm_cmds;
@@ -911,7 +947,8 @@ struct MPT2SAS_ADAPTER {
911 Mpi2ReplyDescriptorsUnion_t *reply_post_free; 947 Mpi2ReplyDescriptorsUnion_t *reply_post_free;
912 dma_addr_t reply_post_free_dma; 948 dma_addr_t reply_post_free_dma;
913 struct dma_pool *reply_post_free_dma_pool; 949 struct dma_pool *reply_post_free_dma_pool;
914 u32 reply_post_host_index; 950 u8 reply_queue_count;
951 struct list_head reply_queue_list;
915 952
916 struct list_head delayed_tr_list; 953 struct list_head delayed_tr_list;
917 struct list_head delayed_tr_volume_list; 954 struct list_head delayed_tr_volume_list;
@@ -955,6 +992,7 @@ void *mpt2sas_base_get_sense_buffer(struct MPT2SAS_ADAPTER *ioc, u16 smid);
955void mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr); 992void mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr);
956__le32 mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, 993__le32 mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc,
957 u16 smid); 994 u16 smid);
995void mpt2sas_base_flush_reply_queues(struct MPT2SAS_ADAPTER *ioc);
958 996
959/* hi-priority queue */ 997/* hi-priority queue */
960u16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); 998u16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx);
@@ -975,6 +1013,8 @@ void mpt2sas_base_release_callback_handler(u8 cb_idx);
975 1013
976u8 mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, 1014u8 mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index,
977 u32 reply); 1015 u32 reply);
1016u8 mpt2sas_port_enable_done(struct MPT2SAS_ADAPTER *ioc, u16 smid,
1017 u8 msix_index, u32 reply);
978void *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr); 1018void *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr);
979 1019
980u32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked); 1020u32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked);
@@ -989,6 +1029,8 @@ void mpt2sas_base_validate_event_type(struct MPT2SAS_ADAPTER *ioc, u32 *event_ty
989 1029
990void mpt2sas_halt_firmware(struct MPT2SAS_ADAPTER *ioc); 1030void mpt2sas_halt_firmware(struct MPT2SAS_ADAPTER *ioc);
991 1031
1032int mpt2sas_port_enable(struct MPT2SAS_ADAPTER *ioc);
1033
992/* scsih shared API */ 1034/* scsih shared API */
993u8 mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, 1035u8 mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index,
994 u32 reply); 1036 u32 reply);
@@ -1006,6 +1048,8 @@ struct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAP
1006struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address( 1048struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address(
1007 struct MPT2SAS_ADAPTER *ioc, u64 sas_address); 1049 struct MPT2SAS_ADAPTER *ioc, u64 sas_address);
1008 1050
1051void mpt2sas_port_enable_complete(struct MPT2SAS_ADAPTER *ioc);
1052
1009void mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); 1053void mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase);
1010 1054
1011/* config shared API */ 1055/* config shared API */