Commit 719396b4 authored by Jamie Wellnitz's avatar Jamie Wellnitz Committed by James Bottomley

[PATCH] lpfc 8.1.3: PCI hrd_type should be obtained with pci_read_config_byte() macro

PCI hrd_type should be obtained with pci_read_config_byte() macro

Driver keys off of this field to report the proper adapter type.
The pci subsystem explicitly clears the multiport bit in the copy of
the field given the driver. Thus, to properly name the card, obtain it
from config space.
Signed-off-by: default avatarJamie Wellnitz <Jamie.Wellnitz@emulex.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 74b72a59
...@@ -796,9 +796,9 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) ...@@ -796,9 +796,9 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp)
lpfc_vpd_t *vp; lpfc_vpd_t *vp;
uint16_t dev_id = phba->pcidev->device; uint16_t dev_id = phba->pcidev->device;
uint16_t dev_subid = phba->pcidev->subsystem_device; uint16_t dev_subid = phba->pcidev->subsystem_device;
uint8_t hdrtype = phba->pcidev->hdr_type; uint8_t hdrtype;
int max_speed; int max_speed;
char * ports = (hdrtype == 0x80) ? "2-port " : ""; char * ports;
struct { struct {
char * name; char * name;
int max_speed; int max_speed;
...@@ -806,6 +806,8 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) ...@@ -806,6 +806,8 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp)
char * bus; char * bus;
} m; } m;
pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype);
ports = (hdrtype == 0x80) ? "2-port " : "";
if (mdp && mdp[0] != '\0' if (mdp && mdp[0] != '\0'
&& descp && descp[0] != '\0') && descp && descp[0] != '\0')
return; return;
......
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