diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-09-14 01:34:23 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-10-02 10:48:38 -0400 |
commit | 77e63ed44305e89c0564f8292f9cd5764d4fddfb (patch) | |
tree | 66aab9af95be1daadf6e648b008f9c1d77cf1ac0 /drivers/scsi/mpt2sas/mpt2sas_base.h | |
parent | 595bb0bd62edb28a965993d90e0fa1285560ce53 (diff) |
[SCSI] mpt2sas: Target Reset will be issued from Interrupt context.
(1) Added three new functions to handle sending target resest and OP_REMOVE
from interrupt time, they are _scsih_tm_tr_send, _scsih_tm_tr_complete, and
_scsih_sas_control_complete. This code will create a link list of pending
target resets if there is no more available request in the hipriority
request queue. The list is stored in ioc->delayed_tr_list.
(2) All callback handler return type is changed from void to u8.
Now _base_interrupt will check for return type of callback handlers to
take decision of message frame is already freed or not.
In genral,
Return 1 meaning mf should be freed from _base_interrupt
0 means the mf is freed from function.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.h')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.h | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h index 91132626f4c5..7f94be90ad12 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.h +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h | |||
@@ -307,6 +307,7 @@ struct _sas_device { | |||
307 | u16 slot; | 307 | u16 slot; |
308 | u8 hidden_raid_component; | 308 | u8 hidden_raid_component; |
309 | u8 responding; | 309 | u8 responding; |
310 | u16 state; | ||
310 | }; | 311 | }; |
311 | 312 | ||
312 | /** | 313 | /** |
@@ -443,6 +444,17 @@ struct request_tracker { | |||
443 | struct list_head tracker_list; | 444 | struct list_head tracker_list; |
444 | }; | 445 | }; |
445 | 446 | ||
447 | /** | ||
448 | * struct _tr_list - target reset list | ||
449 | * @handle: device handle | ||
450 | * @state: state machine | ||
451 | */ | ||
452 | struct _tr_list { | ||
453 | struct list_head list; | ||
454 | u16 handle; | ||
455 | u16 state; | ||
456 | }; | ||
457 | |||
446 | typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); | 458 | typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); |
447 | 459 | ||
448 | /** | 460 | /** |
@@ -617,6 +629,8 @@ struct MPT2SAS_ADAPTER { | |||
617 | u8 ctl_cb_idx; | 629 | u8 ctl_cb_idx; |
618 | u8 base_cb_idx; | 630 | u8 base_cb_idx; |
619 | u8 config_cb_idx; | 631 | u8 config_cb_idx; |
632 | u8 tm_tr_cb_idx; | ||
633 | u8 tm_sas_control_cb_idx; | ||
620 | struct _internal_cmd base_cmds; | 634 | struct _internal_cmd base_cmds; |
621 | struct _internal_cmd transport_cmds; | 635 | struct _internal_cmd transport_cmds; |
622 | struct _internal_cmd tm_cmds; | 636 | struct _internal_cmd tm_cmds; |
@@ -727,6 +741,8 @@ struct MPT2SAS_ADAPTER { | |||
727 | struct dma_pool *reply_post_free_dma_pool; | 741 | struct dma_pool *reply_post_free_dma_pool; |
728 | u32 reply_post_host_index; | 742 | u32 reply_post_host_index; |
729 | 743 | ||
744 | struct list_head delayed_tr_list; | ||
745 | |||
730 | /* diag buffer support */ | 746 | /* diag buffer support */ |
731 | u8 *diag_buffer[MPI2_DIAG_BUF_TYPE_COUNT]; | 747 | u8 *diag_buffer[MPI2_DIAG_BUF_TYPE_COUNT]; |
732 | u32 diag_buffer_sz[MPI2_DIAG_BUF_TYPE_COUNT]; | 748 | u32 diag_buffer_sz[MPI2_DIAG_BUF_TYPE_COUNT]; |
@@ -738,8 +754,8 @@ struct MPT2SAS_ADAPTER { | |||
738 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; | 754 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; |
739 | }; | 755 | }; |
740 | 756 | ||
741 | typedef void (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, | 757 | typedef u8 (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
742 | u8 msix_index, u32 reply); | 758 | u32 reply); |
743 | 759 | ||
744 | 760 | ||
745 | /* base shared API */ | 761 | /* base shared API */ |
@@ -757,7 +773,8 @@ int mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
757 | void *mpt2sas_base_get_msg_frame(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 773 | void *mpt2sas_base_get_msg_frame(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
758 | void *mpt2sas_base_get_sense_buffer(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 774 | void *mpt2sas_base_get_sense_buffer(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
759 | void mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr); | 775 | void mpt2sas_base_build_zero_len_sge(struct MPT2SAS_ADAPTER *ioc, void *paddr); |
760 | dma_addr_t mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 776 | dma_addr_t mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, |
777 | u16 smid); | ||
761 | 778 | ||
762 | /* hi-priority queue */ | 779 | /* hi-priority queue */ |
763 | u16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); | 780 | u16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); |
@@ -776,7 +793,7 @@ void mpt2sas_base_initialize_callback_handler(void); | |||
776 | u8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func); | 793 | u8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func); |
777 | void mpt2sas_base_release_callback_handler(u8 cb_idx); | 794 | void mpt2sas_base_release_callback_handler(u8 cb_idx); |
778 | 795 | ||
779 | void mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, | 796 | u8 mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
780 | u32 reply); | 797 | u32 reply); |
781 | void *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr); | 798 | void *mpt2sas_base_get_reply_virt_addr(struct MPT2SAS_ADAPTER *ioc, u32 phys_addr); |
782 | 799 | ||
@@ -791,6 +808,8 @@ int mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc, | |||
791 | void mpt2sas_base_validate_event_type(struct MPT2SAS_ADAPTER *ioc, u32 *event_type); | 808 | void mpt2sas_base_validate_event_type(struct MPT2SAS_ADAPTER *ioc, u32 *event_type); |
792 | 809 | ||
793 | /* scsih shared API */ | 810 | /* scsih shared API */ |
811 | u8 mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, | ||
812 | u32 reply); | ||
794 | void mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint lun, | 813 | void mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint lun, |
795 | u8 type, u16 smid_task, ulong timeout); | 814 | u8 type, u16 smid_task, ulong timeout); |
796 | void mpt2sas_scsih_set_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); | 815 | void mpt2sas_scsih_set_tm_flag(struct MPT2SAS_ADAPTER *ioc, u16 handle); |
@@ -802,12 +821,10 @@ struct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAP | |||
802 | struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address( | 821 | struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address( |
803 | struct MPT2SAS_ADAPTER *ioc, u64 sas_address); | 822 | struct MPT2SAS_ADAPTER *ioc, u64 sas_address); |
804 | 823 | ||
805 | void mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, | ||
806 | u32 reply); | ||
807 | void mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); | 824 | void mpt2sas_scsih_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); |
808 | 825 | ||
809 | /* config shared API */ | 826 | /* config shared API */ |
810 | void mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, | 827 | u8 mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
811 | u32 reply); | 828 | u32 reply); |
812 | int mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys); | 829 | int mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys); |
813 | int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, | 830 | int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, |
@@ -861,17 +878,17 @@ extern struct device_attribute *mpt2sas_host_attrs[]; | |||
861 | extern struct device_attribute *mpt2sas_dev_attrs[]; | 878 | extern struct device_attribute *mpt2sas_dev_attrs[]; |
862 | void mpt2sas_ctl_init(void); | 879 | void mpt2sas_ctl_init(void); |
863 | void mpt2sas_ctl_exit(void); | 880 | void mpt2sas_ctl_exit(void); |
864 | void mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, | 881 | u8 mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
865 | u32 reply); | 882 | u32 reply); |
866 | void mpt2sas_ctl_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); | 883 | void mpt2sas_ctl_reset_handler(struct MPT2SAS_ADAPTER *ioc, int reset_phase); |
867 | void mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, | 884 | u8 mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, |
868 | u32 reply); | 885 | u32 reply); |
869 | void mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, | 886 | void mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, |
870 | Mpi2EventNotificationReply_t *mpi_reply); | 887 | Mpi2EventNotificationReply_t *mpi_reply); |
871 | 888 | ||
872 | /* transport shared API */ | 889 | /* transport shared API */ |
873 | void mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, | 890 | u8 mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
874 | u8 msix_index, u32 reply); | 891 | u32 reply); |
875 | struct _sas_port *mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc, | 892 | struct _sas_port *mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc, |
876 | u16 handle, u16 parent_handle); | 893 | u16 handle, u16 parent_handle); |
877 | void mpt2sas_transport_port_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address, | 894 | void mpt2sas_transport_port_remove(struct MPT2SAS_ADAPTER *ioc, u64 sas_address, |
@@ -885,6 +902,8 @@ void mpt2sas_transport_update_links(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
885 | extern struct sas_function_template mpt2sas_transport_functions; | 902 | extern struct sas_function_template mpt2sas_transport_functions; |
886 | extern struct scsi_transport_template *mpt2sas_transport_template; | 903 | extern struct scsi_transport_template *mpt2sas_transport_template; |
887 | extern int scsi_internal_device_block(struct scsi_device *sdev); | 904 | extern int scsi_internal_device_block(struct scsi_device *sdev); |
905 | extern u8 mpt2sas_stm_zero_smid_handler(struct MPT2SAS_ADAPTER *ioc, | ||
906 | u8 msix_index, u32 reply); | ||
888 | extern int scsi_internal_device_unblock(struct scsi_device *sdev); | 907 | extern int scsi_internal_device_unblock(struct scsi_device *sdev); |
889 | 908 | ||
890 | #endif /* MPT2SAS_BASE_H_INCLUDED */ | 909 | #endif /* MPT2SAS_BASE_H_INCLUDED */ |