diff options
author | James Smart <james.smart@emulex.com> | 2011-05-24 11:41:34 -0400 |
---|---|---|
committer | James Bottomley <jbottomley@parallels.com> | 2011-05-26 23:49:36 -0400 |
commit | c0c1151276aae83dffbe3f2837a3b1d893894115 (patch) | |
tree | 60942e578180d31b37c4ae989c6bd98657362792 /drivers/scsi/lpfc | |
parent | 0558056c1ecd177f2621fc2a0484d565270f7ae1 (diff) |
[SCSI] lpfc 8.3.24: Extended hardware support and support dump images
Extended hardware support and support dump images:
- Make the size to be MAILBOX_SYSFS_MAX (4096) so that it allows the maximum
sysfs binary access interface possible.
- Add ids and model names for new hardware
- Add capability of inducing SLI4 firmware dump obj file
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 64 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw.h | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 19 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 18 |
4 files changed, 98 insertions, 7 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 8dcbf8fff673..44816be4d724 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -755,6 +755,61 @@ lpfc_issue_reset(struct device *dev, struct device_attribute *attr, | |||
755 | } | 755 | } |
756 | 756 | ||
757 | /** | 757 | /** |
758 | * lpfc_sli4_fw_dump_request - Request firmware to perform a firmware dump | ||
759 | * @phba: lpfc_hba pointer. | ||
760 | * | ||
761 | * Description: | ||
762 | * Request SLI4 interface type-2 device to perform a dump of firmware dump | ||
763 | * object into it's /dbg directory of the flash file system. | ||
764 | * | ||
765 | * Returns: | ||
766 | * zero for success | ||
767 | **/ | ||
768 | static ssize_t | ||
769 | lpfc_sli4_fw_dump_request(struct lpfc_hba *phba) | ||
770 | { | ||
771 | struct completion online_compl; | ||
772 | uint32_t reg_val; | ||
773 | int status = 0; | ||
774 | int rc; | ||
775 | |||
776 | if (!phba->cfg_enable_hba_reset) | ||
777 | return -EIO; | ||
778 | |||
779 | status = lpfc_do_offline(phba, LPFC_EVT_OFFLINE); | ||
780 | |||
781 | if (status != 0) | ||
782 | return status; | ||
783 | |||
784 | /* wait for the device to be quiesced before firmware reset */ | ||
785 | msleep(100); | ||
786 | |||
787 | reg_val = readl(phba->sli4_hba.conf_regs_memmap_p + | ||
788 | LPFC_CTL_PDEV_CTL_OFFSET); | ||
789 | reg_val |= LPFC_FW_DUMP_REQUEST; | ||
790 | writel(reg_val, phba->sli4_hba.conf_regs_memmap_p + | ||
791 | LPFC_CTL_PDEV_CTL_OFFSET); | ||
792 | /* flush */ | ||
793 | readl(phba->sli4_hba.conf_regs_memmap_p + LPFC_CTL_PDEV_CTL_OFFSET); | ||
794 | |||
795 | /* delay driver action following IF_TYPE_2 reset */ | ||
796 | msleep(100); | ||
797 | |||
798 | init_completion(&online_compl); | ||
799 | rc = lpfc_workq_post_event(phba, &status, &online_compl, | ||
800 | LPFC_EVT_ONLINE); | ||
801 | if (rc == 0) | ||
802 | return -ENOMEM; | ||
803 | |||
804 | wait_for_completion(&online_compl); | ||
805 | |||
806 | if (status != 0) | ||
807 | return -EIO; | ||
808 | |||
809 | return 0; | ||
810 | } | ||
811 | |||
812 | /** | ||
758 | * lpfc_nport_evt_cnt_show - Return the number of nport events | 813 | * lpfc_nport_evt_cnt_show - Return the number of nport events |
759 | * @dev: class device that is converted into a Scsi_host. | 814 | * @dev: class device that is converted into a Scsi_host. |
760 | * @attr: device attribute, not used. | 815 | * @attr: device attribute, not used. |
@@ -848,6 +903,13 @@ lpfc_board_mode_store(struct device *dev, struct device_attribute *attr, | |||
848 | return -EINVAL; | 903 | return -EINVAL; |
849 | else | 904 | else |
850 | status = lpfc_do_offline(phba, LPFC_EVT_KILL); | 905 | status = lpfc_do_offline(phba, LPFC_EVT_KILL); |
906 | else if (strncmp(buf, "dump", sizeof("dump") - 1) == 0) | ||
907 | if ((phba->sli_rev < LPFC_SLI_REV4) || | ||
908 | (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) != | ||
909 | LPFC_SLI_INTF_IF_TYPE_2)) | ||
910 | return -EPERM; | ||
911 | else | ||
912 | status = lpfc_sli4_fw_dump_request(phba); | ||
851 | else | 913 | else |
852 | return -EINVAL; | 914 | return -EINVAL; |
853 | 915 | ||
@@ -3961,7 +4023,7 @@ static struct bin_attribute sysfs_mbox_attr = { | |||
3961 | .name = "mbox", | 4023 | .name = "mbox", |
3962 | .mode = S_IRUSR | S_IWUSR, | 4024 | .mode = S_IRUSR | S_IWUSR, |
3963 | }, | 4025 | }, |
3964 | .size = MAILBOX_CMD_SIZE, | 4026 | .size = MAILBOX_SYSFS_MAX, |
3965 | .read = sysfs_mbox_read, | 4027 | .read = sysfs_mbox_read, |
3966 | .write = sysfs_mbox_write, | 4028 | .write = sysfs_mbox_write, |
3967 | }; | 4029 | }; |
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 86b6f7e6686a..6aa53aca23e9 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h | |||
@@ -1199,7 +1199,9 @@ typedef struct { | |||
1199 | #define PCI_DEVICE_ID_BALIUS 0xe131 | 1199 | #define PCI_DEVICE_ID_BALIUS 0xe131 |
1200 | #define PCI_DEVICE_ID_PROTEUS_PF 0xe180 | 1200 | #define PCI_DEVICE_ID_PROTEUS_PF 0xe180 |
1201 | #define PCI_DEVICE_ID_LANCER_FC 0xe200 | 1201 | #define PCI_DEVICE_ID_LANCER_FC 0xe200 |
1202 | #define PCI_DEVICE_ID_LANCER_FC_VF 0xe208 | ||
1202 | #define PCI_DEVICE_ID_LANCER_FCOE 0xe260 | 1203 | #define PCI_DEVICE_ID_LANCER_FCOE 0xe260 |
1204 | #define PCI_DEVICE_ID_LANCER_FCOE_VF 0xe268 | ||
1203 | #define PCI_DEVICE_ID_SAT_SMB 0xf011 | 1205 | #define PCI_DEVICE_ID_SAT_SMB 0xf011 |
1204 | #define PCI_DEVICE_ID_SAT_MID 0xf015 | 1206 | #define PCI_DEVICE_ID_SAT_MID 0xf015 |
1205 | #define PCI_DEVICE_ID_RFLY 0xf095 | 1207 | #define PCI_DEVICE_ID_RFLY 0xf095 |
@@ -3021,7 +3023,7 @@ typedef struct { | |||
3021 | #define MAILBOX_EXT_SIZE (MAILBOX_EXT_WSIZE * sizeof(uint32_t)) | 3023 | #define MAILBOX_EXT_SIZE (MAILBOX_EXT_WSIZE * sizeof(uint32_t)) |
3022 | #define MAILBOX_HBA_EXT_OFFSET 0x100 | 3024 | #define MAILBOX_HBA_EXT_OFFSET 0x100 |
3023 | /* max mbox xmit size is a page size for sysfs IO operations */ | 3025 | /* max mbox xmit size is a page size for sysfs IO operations */ |
3024 | #define MAILBOX_MAX_XMIT_SIZE PAGE_SIZE | 3026 | #define MAILBOX_SYSFS_MAX 4096 |
3025 | 3027 | ||
3026 | typedef union { | 3028 | typedef union { |
3027 | uint32_t varWords[MAILBOX_CMD_WSIZE - 1]; /* first word is type/ | 3029 | uint32_t varWords[MAILBOX_CMD_WSIZE - 1]; /* first word is type/ |
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 2e75f3df04fd..ca7c1dd61938 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -170,6 +170,25 @@ struct lpfc_sli_intf { | |||
170 | #define LPFC_PCI_FUNC3 3 | 170 | #define LPFC_PCI_FUNC3 3 |
171 | #define LPFC_PCI_FUNC4 4 | 171 | #define LPFC_PCI_FUNC4 4 |
172 | 172 | ||
173 | /* SLI4 interface type-2 control register offsets */ | ||
174 | #define LPFC_CTL_PORT_SEM_OFFSET 0x400 | ||
175 | #define LPFC_CTL_PORT_STA_OFFSET 0x404 | ||
176 | #define LPFC_CTL_PORT_CTL_OFFSET 0x408 | ||
177 | #define LPFC_CTL_PORT_ER1_OFFSET 0x40C | ||
178 | #define LPFC_CTL_PORT_ER2_OFFSET 0x410 | ||
179 | #define LPFC_CTL_PDEV_CTL_OFFSET 0x414 | ||
180 | |||
181 | /* Some SLI4 interface type-2 PDEV_CTL register bits */ | ||
182 | #define LPFC_CTL_PDEV_CTL_DRST 0x00000001 | ||
183 | #define LPFC_CTL_PDEV_CTL_FRST 0x00000002 | ||
184 | #define LPFC_CTL_PDEV_CTL_DD 0x00000004 | ||
185 | #define LPFC_CTL_PDEV_CTL_LC 0x00000008 | ||
186 | #define LPFC_CTL_PDEV_CTL_FRL_ALL 0x00 | ||
187 | #define LPFC_CTL_PDEV_CTL_FRL_FC_FCOE 0x10 | ||
188 | #define LPFC_CTL_PDEV_CTL_FRL_NIC 0x20 | ||
189 | |||
190 | #define LPFC_FW_DUMP_REQUEST (LPFC_CTL_PDEV_CTL_DD | LPFC_CTL_PDEV_CTL_FRST) | ||
191 | |||
173 | /* Active interrupt test count */ | 192 | /* Active interrupt test count */ |
174 | #define LPFC_ACT_INTR_CNT 4 | 193 | #define LPFC_ACT_INTR_CNT 4 |
175 | 194 | ||
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index f297f9d027dc..16b4da4530b1 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1784,7 +1784,9 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
1784 | && descp && descp[0] != '\0') | 1784 | && descp && descp[0] != '\0') |
1785 | return; | 1785 | return; |
1786 | 1786 | ||
1787 | if (phba->lmt & LMT_10Gb) | 1787 | if (phba->lmt & LMT_16Gb) |
1788 | max_speed = 16; | ||
1789 | else if (phba->lmt & LMT_10Gb) | ||
1788 | max_speed = 10; | 1790 | max_speed = 10; |
1789 | else if (phba->lmt & LMT_8Gb) | 1791 | else if (phba->lmt & LMT_8Gb) |
1790 | max_speed = 8; | 1792 | max_speed = 8; |
@@ -1951,12 +1953,13 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
1951 | "Fibre Channel Adapter"}; | 1953 | "Fibre Channel Adapter"}; |
1952 | break; | 1954 | break; |
1953 | case PCI_DEVICE_ID_LANCER_FC: | 1955 | case PCI_DEVICE_ID_LANCER_FC: |
1954 | oneConnect = 1; | 1956 | case PCI_DEVICE_ID_LANCER_FC_VF: |
1955 | m = (typeof(m)){"Undefined", "PCIe", "Fibre Channel Adapter"}; | 1957 | m = (typeof(m)){"LPe16000", "PCIe", "Fibre Channel Adapter"}; |
1956 | break; | 1958 | break; |
1957 | case PCI_DEVICE_ID_LANCER_FCOE: | 1959 | case PCI_DEVICE_ID_LANCER_FCOE: |
1960 | case PCI_DEVICE_ID_LANCER_FCOE_VF: | ||
1958 | oneConnect = 1; | 1961 | oneConnect = 1; |
1959 | m = (typeof(m)){"Undefined", "PCIe", "FCoE"}; | 1962 | m = (typeof(m)){"OCe50100", "PCIe", "FCoE"}; |
1960 | break; | 1963 | break; |
1961 | default: | 1964 | default: |
1962 | m = (typeof(m)){"Unknown", "", ""}; | 1965 | m = (typeof(m)){"Unknown", "", ""}; |
@@ -1965,7 +1968,8 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
1965 | 1968 | ||
1966 | if (mdp && mdp[0] == '\0') | 1969 | if (mdp && mdp[0] == '\0') |
1967 | snprintf(mdp, 79,"%s", m.name); | 1970 | snprintf(mdp, 79,"%s", m.name); |
1968 | /* oneConnect hba requires special processing, they are all initiators | 1971 | /* |
1972 | * oneConnect hba requires special processing, they are all initiators | ||
1969 | * and we put the port number on the end | 1973 | * and we put the port number on the end |
1970 | */ | 1974 | */ |
1971 | if (descp && descp[0] == '\0') { | 1975 | if (descp && descp[0] == '\0') { |
@@ -9580,6 +9584,10 @@ static struct pci_device_id lpfc_id_table[] = { | |||
9580 | PCI_ANY_ID, PCI_ANY_ID, }, | 9584 | PCI_ANY_ID, PCI_ANY_ID, }, |
9581 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FCOE, | 9585 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FCOE, |
9582 | PCI_ANY_ID, PCI_ANY_ID, }, | 9586 | PCI_ANY_ID, PCI_ANY_ID, }, |
9587 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FC_VF, | ||
9588 | PCI_ANY_ID, PCI_ANY_ID, }, | ||
9589 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_LANCER_FCOE_VF, | ||
9590 | PCI_ANY_ID, PCI_ANY_ID, }, | ||
9583 | { 0 } | 9591 | { 0 } |
9584 | }; | 9592 | }; |
9585 | 9593 | ||