Commit 62a276f8 authored by Bjorn Helgaas's avatar Bjorn Helgaas

[SCSI] qla2xxx: Use standard PCIe Capability Link register field names

Use the standard #defines for PCIe Link Capability register fields
rather than bare numbers.  This also uses the new PCI Express Capability
accessor rather than reading the capability directly.
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Acked-by: default avatarGiridhar Malavali <giridhar.malavali@qlogic.com>
parent a895c28a
...@@ -494,18 +494,14 @@ qla24xx_pci_info_str(struct scsi_qla_host *vha, char *str) ...@@ -494,18 +494,14 @@ qla24xx_pci_info_str(struct scsi_qla_host *vha, char *str)
static char *pci_bus_modes[] = { "33", "66", "100", "133", }; static char *pci_bus_modes[] = { "33", "66", "100", "133", };
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
uint32_t pci_bus; uint32_t pci_bus;
int pcie_reg;
pcie_reg = pci_pcie_cap(ha->pdev); if (pci_is_pcie(ha->pdev)) {
if (pcie_reg) {
char lwstr[6]; char lwstr[6];
uint16_t pcie_lstat, lspeed, lwidth; uint32_t lstat, lspeed, lwidth;
pcie_reg += PCI_EXP_LNKCAP; pcie_capability_read_dword(ha->pdev, PCI_EXP_LNKCAP, &lstat);
pci_read_config_word(ha->pdev, pcie_reg, &pcie_lstat); lspeed = lstat & PCI_EXP_LNKCAP_SLS;
lspeed = pcie_lstat & (BIT_0 | BIT_1 | BIT_2 | BIT_3); lwidth = (lstat & PCI_EXP_LNKCAP_MLW) >> 4;
lwidth = (pcie_lstat &
(BIT_4 | BIT_5 | BIT_6 | BIT_7 | BIT_8 | BIT_9)) >> 4;
strcpy(str, "PCIe ("); strcpy(str, "PCIe (");
switch (lspeed) { switch (lspeed) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment