diff options
author | James Smart <James.Smart@Emulex.Com> | 2009-05-22 14:51:39 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 12:21:29 -0400 |
commit | da0436e915a5c17ee79e72c1bf978a4ebb1cbf4d (patch) | |
tree | 7784646b7627117fa7849a901c85294fae905505 /drivers/scsi/lpfc/lpfc_attr.c | |
parent | 3772a99175f5378b5001e8da364341a8b8226a4a (diff) |
[SCSI] lpfc 8.3.2 : Addition of SLI4 Interface - Base Support
Adds new hardware and interface definitions.
Adds new interface routines - utilizing the reorganized layout of the
driver. Adds SLI-4 specific functions for attachment, initialization,
teardown, etc.
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 83 |
1 files changed, 67 insertions, 16 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index c14f0cbdb125..82016fc672b1 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -30,8 +30,10 @@ | |||
30 | #include <scsi/scsi_tcq.h> | 30 | #include <scsi/scsi_tcq.h> |
31 | #include <scsi/scsi_transport_fc.h> | 31 | #include <scsi/scsi_transport_fc.h> |
32 | 32 | ||
33 | #include "lpfc_hw4.h" | ||
33 | #include "lpfc_hw.h" | 34 | #include "lpfc_hw.h" |
34 | #include "lpfc_sli.h" | 35 | #include "lpfc_sli.h" |
36 | #include "lpfc_sli4.h" | ||
35 | #include "lpfc_nl.h" | 37 | #include "lpfc_nl.h" |
36 | #include "lpfc_disc.h" | 38 | #include "lpfc_disc.h" |
37 | #include "lpfc_scsi.h" | 39 | #include "lpfc_scsi.h" |
@@ -828,18 +830,37 @@ lpfc_get_hba_info(struct lpfc_hba *phba, | |||
828 | return 0; | 830 | return 0; |
829 | } | 831 | } |
830 | 832 | ||
831 | if (mrpi) | 833 | if (phba->sli_rev == LPFC_SLI_REV4) { |
832 | *mrpi = pmb->un.varRdConfig.max_rpi; | 834 | rd_config = &pmboxq->u.mqe.un.rd_config; |
833 | if (arpi) | 835 | if (mrpi) |
834 | *arpi = pmb->un.varRdConfig.avail_rpi; | 836 | *mrpi = bf_get(lpfc_mbx_rd_conf_rpi_count, rd_config); |
835 | if (mxri) | 837 | if (arpi) |
836 | *mxri = pmb->un.varRdConfig.max_xri; | 838 | *arpi = bf_get(lpfc_mbx_rd_conf_rpi_count, rd_config) - |
837 | if (axri) | 839 | phba->sli4_hba.max_cfg_param.rpi_used; |
838 | *axri = pmb->un.varRdConfig.avail_xri; | 840 | if (mxri) |
839 | if (mvpi) | 841 | *mxri = bf_get(lpfc_mbx_rd_conf_xri_count, rd_config); |
840 | *mvpi = pmb->un.varRdConfig.max_vpi; | 842 | if (axri) |
841 | if (avpi) | 843 | *axri = bf_get(lpfc_mbx_rd_conf_xri_count, rd_config) - |
842 | *avpi = pmb->un.varRdConfig.avail_vpi; | 844 | phba->sli4_hba.max_cfg_param.xri_used; |
845 | if (mvpi) | ||
846 | *mvpi = bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config); | ||
847 | if (avpi) | ||
848 | *avpi = bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config) - | ||
849 | phba->sli4_hba.max_cfg_param.vpi_used; | ||
850 | } else { | ||
851 | if (mrpi) | ||
852 | *mrpi = pmb->un.varRdConfig.max_rpi; | ||
853 | if (arpi) | ||
854 | *arpi = pmb->un.varRdConfig.avail_rpi; | ||
855 | if (mxri) | ||
856 | *mxri = pmb->un.varRdConfig.max_xri; | ||
857 | if (axri) | ||
858 | *axri = pmb->un.varRdConfig.avail_xri; | ||
859 | if (mvpi) | ||
860 | *mvpi = pmb->un.varRdConfig.max_vpi; | ||
861 | if (avpi) | ||
862 | *avpi = pmb->un.varRdConfig.avail_vpi; | ||
863 | } | ||
843 | 864 | ||
844 | mempool_free(pmboxq, phba->mbox_mem_pool); | 865 | mempool_free(pmboxq, phba->mbox_mem_pool); |
845 | return 1; | 866 | return 1; |
@@ -2844,15 +2865,39 @@ LPFC_ATTR_RW(poll_tmo, 10, 1, 255, | |||
2844 | /* | 2865 | /* |
2845 | # lpfc_use_msi: Use MSI (Message Signaled Interrupts) in systems that | 2866 | # lpfc_use_msi: Use MSI (Message Signaled Interrupts) in systems that |
2846 | # support this feature | 2867 | # support this feature |
2847 | # 0 = MSI disabled | 2868 | # 0 = MSI disabled (default) |
2848 | # 1 = MSI enabled | 2869 | # 1 = MSI enabled |
2849 | # 2 = MSI-X enabled (default) | 2870 | # 2 = MSI-X enabled |
2850 | # Value range is [0,2]. Default value is 2. | 2871 | # Value range is [0,2]. Default value is 0. |
2851 | */ | 2872 | */ |
2852 | LPFC_ATTR_R(use_msi, 2, 0, 2, "Use Message Signaled Interrupts (1) or " | 2873 | LPFC_ATTR_R(use_msi, 0, 0, 2, "Use Message Signaled Interrupts (1) or " |
2853 | "MSI-X (2), if possible"); | 2874 | "MSI-X (2), if possible"); |
2854 | 2875 | ||
2855 | /* | 2876 | /* |
2877 | # lpfc_fcp_imax: Set the maximum number of fast-path FCP interrupts per second | ||
2878 | # | ||
2879 | # Value range is [636,651042]. Default value is 10000. | ||
2880 | */ | ||
2881 | LPFC_ATTR_R(fcp_imax, LPFC_FP_DEF_IMAX, LPFC_MIM_IMAX, LPFC_DMULT_CONST, | ||
2882 | "Set the maximum number of fast-path FCP interrupts per second"); | ||
2883 | |||
2884 | /* | ||
2885 | # lpfc_fcp_wq_count: Set the number of fast-path FCP work queues | ||
2886 | # | ||
2887 | # Value range is [1,31]. Default value is 4. | ||
2888 | */ | ||
2889 | LPFC_ATTR_R(fcp_wq_count, LPFC_FP_WQN_DEF, LPFC_FP_WQN_MIN, LPFC_FP_WQN_MAX, | ||
2890 | "Set the number of fast-path FCP work queues, if possible"); | ||
2891 | |||
2892 | /* | ||
2893 | # lpfc_fcp_eq_count: Set the number of fast-path FCP event queues | ||
2894 | # | ||
2895 | # Value range is [1,7]. Default value is 1. | ||
2896 | */ | ||
2897 | LPFC_ATTR_R(fcp_eq_count, LPFC_FP_EQN_DEF, LPFC_FP_EQN_MIN, LPFC_FP_EQN_MAX, | ||
2898 | "Set the number of fast-path FCP event queues, if possible"); | ||
2899 | |||
2900 | /* | ||
2856 | # lpfc_enable_hba_reset: Allow or prevent HBA resets to the hardware. | 2901 | # lpfc_enable_hba_reset: Allow or prevent HBA resets to the hardware. |
2857 | # 0 = HBA resets disabled | 2902 | # 0 = HBA resets disabled |
2858 | # 1 = HBA resets enabled (default) | 2903 | # 1 = HBA resets enabled (default) |
@@ -2969,6 +3014,9 @@ struct device_attribute *lpfc_hba_attrs[] = { | |||
2969 | &dev_attr_lpfc_poll, | 3014 | &dev_attr_lpfc_poll, |
2970 | &dev_attr_lpfc_poll_tmo, | 3015 | &dev_attr_lpfc_poll_tmo, |
2971 | &dev_attr_lpfc_use_msi, | 3016 | &dev_attr_lpfc_use_msi, |
3017 | &dev_attr_lpfc_fcp_imax, | ||
3018 | &dev_attr_lpfc_fcp_wq_count, | ||
3019 | &dev_attr_lpfc_fcp_eq_count, | ||
2972 | &dev_attr_lpfc_enable_bg, | 3020 | &dev_attr_lpfc_enable_bg, |
2973 | &dev_attr_lpfc_soft_wwnn, | 3021 | &dev_attr_lpfc_soft_wwnn, |
2974 | &dev_attr_lpfc_soft_wwpn, | 3022 | &dev_attr_lpfc_soft_wwpn, |
@@ -4105,6 +4153,9 @@ lpfc_get_cfgparam(struct lpfc_hba *phba) | |||
4105 | lpfc_poll_tmo_init(phba, lpfc_poll_tmo); | 4153 | lpfc_poll_tmo_init(phba, lpfc_poll_tmo); |
4106 | lpfc_enable_npiv_init(phba, lpfc_enable_npiv); | 4154 | lpfc_enable_npiv_init(phba, lpfc_enable_npiv); |
4107 | lpfc_use_msi_init(phba, lpfc_use_msi); | 4155 | lpfc_use_msi_init(phba, lpfc_use_msi); |
4156 | lpfc_fcp_imax_init(phba, lpfc_fcp_imax); | ||
4157 | lpfc_fcp_wq_count_init(phba, lpfc_fcp_wq_count); | ||
4158 | lpfc_fcp_eq_count_init(phba, lpfc_fcp_eq_count); | ||
4108 | lpfc_enable_hba_reset_init(phba, lpfc_enable_hba_reset); | 4159 | lpfc_enable_hba_reset_init(phba, lpfc_enable_hba_reset); |
4109 | lpfc_enable_hba_heartbeat_init(phba, lpfc_enable_hba_heartbeat); | 4160 | lpfc_enable_hba_heartbeat_init(phba, lpfc_enable_hba_heartbeat); |
4110 | lpfc_enable_bg_init(phba, lpfc_enable_bg); | 4161 | lpfc_enable_bg_init(phba, lpfc_enable_bg); |