diff options
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.h')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.h | 106 |
1 files changed, 86 insertions, 20 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h index 2faab1e690e9..0cf6bc236e4d 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.h +++ b/drivers/scsi/mpt2sas/mpt2sas_base.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * for access to MPT (Message Passing Technology) firmware. | 3 | * for access to MPT (Message Passing Technology) firmware. |
4 | * | 4 | * |
5 | * This code is based on drivers/scsi/mpt2sas/mpt2_base.h | 5 | * This code is based on drivers/scsi/mpt2sas/mpt2_base.h |
6 | * Copyright (C) 2007-2008 LSI Corporation | 6 | * Copyright (C) 2007-2009 LSI Corporation |
7 | * (mailto:DL-MPTFusionLinux@lsi.com) | 7 | * (mailto:DL-MPTFusionLinux@lsi.com) |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or | 9 | * This program is free software; you can redistribute it and/or |
@@ -69,10 +69,10 @@ | |||
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 "01.100.06.00" | 72 | #define MPT2SAS_DRIVER_VERSION "02.100.03.00" |
73 | #define MPT2SAS_MAJOR_VERSION 01 | 73 | #define MPT2SAS_MAJOR_VERSION 02 |
74 | #define MPT2SAS_MINOR_VERSION 100 | 74 | #define MPT2SAS_MINOR_VERSION 100 |
75 | #define MPT2SAS_BUILD_VERSION 06 | 75 | #define MPT2SAS_BUILD_VERSION 03 |
76 | #define MPT2SAS_RELEASE_VERSION 00 | 76 | #define MPT2SAS_RELEASE_VERSION 00 |
77 | 77 | ||
78 | /* | 78 | /* |
@@ -264,6 +264,13 @@ struct _internal_cmd { | |||
264 | * SAS Topology Structures | 264 | * SAS Topology Structures |
265 | */ | 265 | */ |
266 | 266 | ||
267 | #define MPTSAS_STATE_TR_SEND 0x0001 | ||
268 | #define MPTSAS_STATE_TR_COMPLETE 0x0002 | ||
269 | #define MPTSAS_STATE_CNTRL_SEND 0x0004 | ||
270 | #define MPTSAS_STATE_CNTRL_COMPLETE 0x0008 | ||
271 | |||
272 | #define MPT2SAS_REQ_SAS_CNTRL 0x0010 | ||
273 | |||
267 | /** | 274 | /** |
268 | * struct _sas_device - attached device information | 275 | * struct _sas_device - attached device information |
269 | * @list: sas device list | 276 | * @list: sas device list |
@@ -300,6 +307,7 @@ struct _sas_device { | |||
300 | u16 slot; | 307 | u16 slot; |
301 | u8 hidden_raid_component; | 308 | u8 hidden_raid_component; |
302 | u8 responding; | 309 | u8 responding; |
310 | u16 state; | ||
303 | }; | 311 | }; |
304 | 312 | ||
305 | /** | 313 | /** |
@@ -436,6 +444,17 @@ struct request_tracker { | |||
436 | struct list_head tracker_list; | 444 | struct list_head tracker_list; |
437 | }; | 445 | }; |
438 | 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 | |||
439 | 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); |
440 | 459 | ||
441 | /** | 460 | /** |
@@ -510,8 +529,9 @@ typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); | |||
510 | * @config_page_sz: config page size | 529 | * @config_page_sz: config page size |
511 | * @config_page: reserve memory for config page payload | 530 | * @config_page: reserve memory for config page payload |
512 | * @config_page_dma: | 531 | * @config_page_dma: |
532 | * @hba_queue_depth: hba request queue depth | ||
513 | * @sge_size: sg element size for either 32/64 bit | 533 | * @sge_size: sg element size for either 32/64 bit |
514 | * @request_depth: hba request queue depth | 534 | * @scsiio_depth: SCSI_IO queue depth |
515 | * @request_sz: per request frame size | 535 | * @request_sz: per request frame size |
516 | * @request: pool of request frames | 536 | * @request: pool of request frames |
517 | * @request_dma: | 537 | * @request_dma: |
@@ -528,6 +548,18 @@ typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr); | |||
528 | * @chains_needed_per_io: max chains per io | 548 | * @chains_needed_per_io: max chains per io |
529 | * @chain_offset_value_for_main_message: location 1st sg in main | 549 | * @chain_offset_value_for_main_message: location 1st sg in main |
530 | * @chain_depth: total chains allocated | 550 | * @chain_depth: total chains allocated |
551 | * @hi_priority_smid: | ||
552 | * @hi_priority: | ||
553 | * @hi_priority_dma: | ||
554 | * @hi_priority_depth: | ||
555 | * @hpr_lookup: | ||
556 | * @hpr_free_list: | ||
557 | * @internal_smid: | ||
558 | * @internal: | ||
559 | * @internal_dma: | ||
560 | * @internal_depth: | ||
561 | * @internal_lookup: | ||
562 | * @internal_free_list: | ||
531 | * @sense: pool of sense | 563 | * @sense: pool of sense |
532 | * @sense_dma: | 564 | * @sense_dma: |
533 | * @sense_dma_pool: | 565 | * @sense_dma_pool: |
@@ -597,6 +629,8 @@ struct MPT2SAS_ADAPTER { | |||
597 | u8 ctl_cb_idx; | 629 | u8 ctl_cb_idx; |
598 | u8 base_cb_idx; | 630 | u8 base_cb_idx; |
599 | u8 config_cb_idx; | 631 | u8 config_cb_idx; |
632 | u8 tm_tr_cb_idx; | ||
633 | u8 tm_sas_control_cb_idx; | ||
600 | struct _internal_cmd base_cmds; | 634 | struct _internal_cmd base_cmds; |
601 | struct _internal_cmd transport_cmds; | 635 | struct _internal_cmd transport_cmds; |
602 | struct _internal_cmd tm_cmds; | 636 | struct _internal_cmd tm_cmds; |
@@ -643,9 +677,10 @@ struct MPT2SAS_ADAPTER { | |||
643 | void *config_page; | 677 | void *config_page; |
644 | dma_addr_t config_page_dma; | 678 | dma_addr_t config_page_dma; |
645 | 679 | ||
646 | /* request */ | 680 | /* scsiio request */ |
681 | u16 hba_queue_depth; | ||
647 | u16 sge_size; | 682 | u16 sge_size; |
648 | u16 request_depth; | 683 | u16 scsiio_depth; |
649 | u16 request_sz; | 684 | u16 request_sz; |
650 | u8 *request; | 685 | u8 *request; |
651 | dma_addr_t request_dma; | 686 | dma_addr_t request_dma; |
@@ -665,6 +700,22 @@ struct MPT2SAS_ADAPTER { | |||
665 | u16 chain_offset_value_for_main_message; | 700 | u16 chain_offset_value_for_main_message; |
666 | u16 chain_depth; | 701 | u16 chain_depth; |
667 | 702 | ||
703 | /* hi-priority queue */ | ||
704 | u16 hi_priority_smid; | ||
705 | u8 *hi_priority; | ||
706 | dma_addr_t hi_priority_dma; | ||
707 | u16 hi_priority_depth; | ||
708 | struct request_tracker *hpr_lookup; | ||
709 | struct list_head hpr_free_list; | ||
710 | |||
711 | /* internal queue */ | ||
712 | u16 internal_smid; | ||
713 | u8 *internal; | ||
714 | dma_addr_t internal_dma; | ||
715 | u16 internal_depth; | ||
716 | struct request_tracker *internal_lookup; | ||
717 | struct list_head internal_free_list; | ||
718 | |||
668 | /* sense */ | 719 | /* sense */ |
669 | u8 *sense; | 720 | u8 *sense; |
670 | dma_addr_t sense_dma; | 721 | dma_addr_t sense_dma; |
@@ -690,6 +741,8 @@ struct MPT2SAS_ADAPTER { | |||
690 | struct dma_pool *reply_post_free_dma_pool; | 741 | struct dma_pool *reply_post_free_dma_pool; |
691 | u32 reply_post_host_index; | 742 | u32 reply_post_host_index; |
692 | 743 | ||
744 | struct list_head delayed_tr_list; | ||
745 | |||
693 | /* diag buffer support */ | 746 | /* diag buffer support */ |
694 | u8 *diag_buffer[MPI2_DIAG_BUF_TYPE_COUNT]; | 747 | u8 *diag_buffer[MPI2_DIAG_BUF_TYPE_COUNT]; |
695 | u32 diag_buffer_sz[MPI2_DIAG_BUF_TYPE_COUNT]; | 748 | u32 diag_buffer_sz[MPI2_DIAG_BUF_TYPE_COUNT]; |
@@ -701,7 +754,7 @@ struct MPT2SAS_ADAPTER { | |||
701 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; | 754 | u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT]; |
702 | }; | 755 | }; |
703 | 756 | ||
704 | typedef void (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, | 757 | typedef u8 (*MPT_CALLBACK)(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
705 | u32 reply); | 758 | u32 reply); |
706 | 759 | ||
707 | 760 | ||
@@ -720,22 +773,28 @@ int mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag, | |||
720 | 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); |
721 | 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); |
722 | 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); |
723 | dma_addr_t mpt2sas_base_get_msg_frame_dma(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 776 | dma_addr_t mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, |
724 | dma_addr_t mpt2sas_base_get_sense_buffer_dma(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 777 | u16 smid); |
778 | |||
779 | /* hi-priority queue */ | ||
780 | u16 mpt2sas_base_get_smid_hpr(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); | ||
781 | u16 mpt2sas_base_get_smid_scsiio(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx, | ||
782 | struct scsi_cmnd *scmd); | ||
725 | 783 | ||
726 | u16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); | 784 | u16 mpt2sas_base_get_smid(struct MPT2SAS_ADAPTER *ioc, u8 cb_idx); |
727 | void mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid); | 785 | void mpt2sas_base_free_smid(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
728 | void mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id, | 786 | void mpt2sas_base_put_smid_scsi_io(struct MPT2SAS_ADAPTER *ioc, u16 smid, |
729 | u16 handle); | 787 | u16 handle); |
730 | void mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id); | 788 | void mpt2sas_base_put_smid_hi_priority(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
731 | void mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid, | 789 | void mpt2sas_base_put_smid_target_assist(struct MPT2SAS_ADAPTER *ioc, u16 smid, |
732 | u8 vf_id, u16 io_index); | 790 | u16 io_index); |
733 | void mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 vf_id); | 791 | void mpt2sas_base_put_smid_default(struct MPT2SAS_ADAPTER *ioc, u16 smid); |
734 | void mpt2sas_base_initialize_callback_handler(void); | 792 | void mpt2sas_base_initialize_callback_handler(void); |
735 | u8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func); | 793 | u8 mpt2sas_base_register_callback_handler(MPT_CALLBACK cb_func); |
736 | void mpt2sas_base_release_callback_handler(u8 cb_idx); | 794 | void mpt2sas_base_release_callback_handler(u8 cb_idx); |
737 | 795 | ||
738 | void mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply); | 796 | u8 mpt2sas_base_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
797 | u32 reply); | ||
739 | 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); |
740 | 799 | ||
741 | u32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked); | 800 | u32 mpt2sas_base_get_iocstate(struct MPT2SAS_ADAPTER *ioc, int cooked); |
@@ -749,6 +808,8 @@ int mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc, | |||
749 | 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); |
750 | 809 | ||
751 | /* scsih shared API */ | 810 | /* scsih shared API */ |
811 | u8 mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, | ||
812 | u32 reply); | ||
752 | 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, |
753 | u8 type, u16 smid_task, ulong timeout); | 814 | u8 type, u16 smid_task, ulong timeout); |
754 | 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); |
@@ -760,11 +821,11 @@ struct _sas_node *mpt2sas_scsih_expander_find_by_sas_address(struct MPT2SAS_ADAP | |||
760 | struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address( | 821 | struct _sas_device *mpt2sas_scsih_sas_device_find_by_sas_address( |
761 | struct MPT2SAS_ADAPTER *ioc, u64 sas_address); | 822 | struct MPT2SAS_ADAPTER *ioc, u64 sas_address); |
762 | 823 | ||
763 | void mpt2sas_scsih_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, u32 reply); | ||
764 | 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); |
765 | 825 | ||
766 | /* config shared API */ | 826 | /* config shared API */ |
767 | void mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply); | 827 | u8 mpt2sas_config_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
828 | u32 reply); | ||
768 | 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); |
769 | int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, | 830 | int mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, |
770 | Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page); | 831 | Mpi2ConfigReply_t *mpi_reply, Mpi2ManufacturingPage0_t *config_page); |
@@ -817,14 +878,17 @@ extern struct device_attribute *mpt2sas_host_attrs[]; | |||
817 | extern struct device_attribute *mpt2sas_dev_attrs[]; | 878 | extern struct device_attribute *mpt2sas_dev_attrs[]; |
818 | void mpt2sas_ctl_init(void); | 879 | void mpt2sas_ctl_init(void); |
819 | void mpt2sas_ctl_exit(void); | 880 | void mpt2sas_ctl_exit(void); |
820 | void mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply); | 881 | u8 mpt2sas_ctl_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
882 | u32 reply); | ||
821 | 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); |
822 | void mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID, u32 reply); | 884 | u8 mpt2sas_ctl_event_callback(struct MPT2SAS_ADAPTER *ioc, u8 msix_index, |
885 | u32 reply); | ||
823 | void mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, | 886 | void mpt2sas_ctl_add_to_event_log(struct MPT2SAS_ADAPTER *ioc, |
824 | Mpi2EventNotificationReply_t *mpi_reply); | 887 | Mpi2EventNotificationReply_t *mpi_reply); |
825 | 888 | ||
826 | /* transport shared API */ | 889 | /* transport shared API */ |
827 | void mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 VF_ID, u32 reply); | 890 | u8 mpt2sas_transport_done(struct MPT2SAS_ADAPTER *ioc, u16 smid, u8 msix_index, |
891 | u32 reply); | ||
828 | struct _sas_port *mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc, | 892 | struct _sas_port *mpt2sas_transport_port_add(struct MPT2SAS_ADAPTER *ioc, |
829 | u16 handle, u16 parent_handle); | 893 | u16 handle, u16 parent_handle); |
830 | 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, |
@@ -838,6 +902,8 @@ void mpt2sas_transport_update_links(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
838 | extern struct sas_function_template mpt2sas_transport_functions; | 902 | extern struct sas_function_template mpt2sas_transport_functions; |
839 | extern struct scsi_transport_template *mpt2sas_transport_template; | 903 | extern struct scsi_transport_template *mpt2sas_transport_template; |
840 | 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); | ||
841 | extern int scsi_internal_device_unblock(struct scsi_device *sdev); | 907 | extern int scsi_internal_device_unblock(struct scsi_device *sdev); |
842 | 908 | ||
843 | #endif /* MPT2SAS_BASE_H_INCLUDED */ | 909 | #endif /* MPT2SAS_BASE_H_INCLUDED */ |