提交 b83908ce 编写于 作者: E Eddie Wai 提交者: James Bottomley

[SCSI] bnx2i: removed the individual PCI DEVICE ID checking

Removed the individual PCI DEVICE ID checking inside bnx2i.  The device
type can easily be read from the corresponding cnic->flags.  This will
free bnx2i from having to get updated for every new device ID that gets
added.
Signed-off-by: NEddie Wai <eddie.wai@broadcom.com>
Acked-by: NMichael Chan <mchan@broadcom.com>
Reviewed-by: NMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 9a07da9f
...@@ -800,7 +800,7 @@ extern struct device_attribute *bnx2i_dev_attributes[]; ...@@ -800,7 +800,7 @@ extern struct device_attribute *bnx2i_dev_attributes[];
/* /*
* Function Prototypes * Function Prototypes
*/ */
extern void bnx2i_identify_device(struct bnx2i_hba *hba); extern void bnx2i_identify_device(struct bnx2i_hba *hba, struct cnic_dev *dev);
extern void bnx2i_ulp_init(struct cnic_dev *dev); extern void bnx2i_ulp_init(struct cnic_dev *dev);
extern void bnx2i_ulp_exit(struct cnic_dev *dev); extern void bnx2i_ulp_exit(struct cnic_dev *dev);
......
...@@ -79,42 +79,33 @@ static struct notifier_block bnx2i_cpu_notifier = { ...@@ -79,42 +79,33 @@ static struct notifier_block bnx2i_cpu_notifier = {
/** /**
* bnx2i_identify_device - identifies NetXtreme II device type * bnx2i_identify_device - identifies NetXtreme II device type
* @hba: Adapter structure pointer * @hba: Adapter structure pointer
* @cnic: Corresponding cnic device
* *
* This function identifies the NX2 device type and sets appropriate * This function identifies the NX2 device type and sets appropriate
* queue mailbox register access method, 5709 requires driver to * queue mailbox register access method, 5709 requires driver to
* access MBOX regs using *bin* mode * access MBOX regs using *bin* mode
*/ */
void bnx2i_identify_device(struct bnx2i_hba *hba) void bnx2i_identify_device(struct bnx2i_hba *hba, struct cnic_dev *dev)
{ {
hba->cnic_dev_type = 0; hba->cnic_dev_type = 0;
if ((hba->pci_did == PCI_DEVICE_ID_NX2_5706) || if (test_bit(CNIC_F_BNX2_CLASS, &dev->flags)) {
(hba->pci_did == PCI_DEVICE_ID_NX2_5706S)) if (hba->pci_did == PCI_DEVICE_ID_NX2_5706 ||
set_bit(BNX2I_NX2_DEV_5706, &hba->cnic_dev_type); hba->pci_did == PCI_DEVICE_ID_NX2_5706S) {
else if ((hba->pci_did == PCI_DEVICE_ID_NX2_5708) || set_bit(BNX2I_NX2_DEV_5706, &hba->cnic_dev_type);
(hba->pci_did == PCI_DEVICE_ID_NX2_5708S)) } else if (hba->pci_did == PCI_DEVICE_ID_NX2_5708 ||
set_bit(BNX2I_NX2_DEV_5708, &hba->cnic_dev_type); hba->pci_did == PCI_DEVICE_ID_NX2_5708S) {
else if ((hba->pci_did == PCI_DEVICE_ID_NX2_5709) || set_bit(BNX2I_NX2_DEV_5708, &hba->cnic_dev_type);
(hba->pci_did == PCI_DEVICE_ID_NX2_5709S)) { } else if (hba->pci_did == PCI_DEVICE_ID_NX2_5709 ||
set_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type); hba->pci_did == PCI_DEVICE_ID_NX2_5709S) {
hba->mail_queue_access = BNX2I_MQ_BIN_MODE; set_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type);
} else if (hba->pci_did == PCI_DEVICE_ID_NX2_57710 || hba->mail_queue_access = BNX2I_MQ_BIN_MODE;
hba->pci_did == PCI_DEVICE_ID_NX2_57711 || }
hba->pci_did == PCI_DEVICE_ID_NX2_57711E || } else if (test_bit(CNIC_F_BNX2X_CLASS, &dev->flags)) {
hba->pci_did == PCI_DEVICE_ID_NX2_57712 ||
hba->pci_did == PCI_DEVICE_ID_NX2_57712E ||
hba->pci_did == PCI_DEVICE_ID_NX2_57800 ||
hba->pci_did == PCI_DEVICE_ID_NX2_57800_MF ||
hba->pci_did == PCI_DEVICE_ID_NX2_57800_VF ||
hba->pci_did == PCI_DEVICE_ID_NX2_57810 ||
hba->pci_did == PCI_DEVICE_ID_NX2_57810_MF ||
hba->pci_did == PCI_DEVICE_ID_NX2_57810_VF ||
hba->pci_did == PCI_DEVICE_ID_NX2_57840 ||
hba->pci_did == PCI_DEVICE_ID_NX2_57840_MF ||
hba->pci_did == PCI_DEVICE_ID_NX2_57840_VF)
set_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type); set_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type);
else } else {
printk(KERN_ALERT "bnx2i: unknown device, 0x%x\n", printk(KERN_ALERT "bnx2i: unknown device, 0x%x\n",
hba->pci_did); hba->pci_did);
}
} }
......
...@@ -808,7 +808,7 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic) ...@@ -808,7 +808,7 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic)
hba->pci_func = PCI_FUNC(hba->pcidev->devfn); hba->pci_func = PCI_FUNC(hba->pcidev->devfn);
hba->pci_devno = PCI_SLOT(hba->pcidev->devfn); hba->pci_devno = PCI_SLOT(hba->pcidev->devfn);
bnx2i_identify_device(hba); bnx2i_identify_device(hba, cnic);
bnx2i_setup_host_queue_size(hba, shost); bnx2i_setup_host_queue_size(hba, shost);
hba->reg_base = pci_resource_start(hba->pcidev, 0); hba->reg_base = pci_resource_start(hba->pcidev, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册