aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2i
diff options
context:
space:
mode:
authorEddie Wai <eddie.wai@broadcom.com>2012-06-29 19:37:35 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-08 04:52:03 -0400
commita77171806515fb5e2288219ddb47af1f0b1328e7 (patch)
tree5418dbacedd6c89ef6652d756b94957499c101ea /drivers/scsi/bnx2i
parent6ef1b512f4e6f936d89aa20be3d97a7ec7c290ac (diff)
[SCSI] bnx2i: Removed the reference to the netdev->base_addr
The netdev->base_addr parameter has been deprecated in the L2 bnx2 driver. This is used by bnx2i for the BARn iomapping. This patch will directly reference the pci_resource_start instead of using the deprecated netdev->base_addr. This patch is actually a critical bug fix as the 1G bnx2 driver no longer supports the netdev->base_addr in the current kernel of the scsi tree. This means that Broadcom's 1G Linux iSCSI offload solution would not work at all without this patch. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bnx2i')
-rw-r--r--drivers/scsi/bnx2i/bnx2i.h1
-rw-r--r--drivers/scsi/bnx2i/bnx2i_hwi.c3
-rw-r--r--drivers/scsi/bnx2i/bnx2i_iscsi.c10
3 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h
index 0c53c28dc3d3..7e77cf620291 100644
--- a/drivers/scsi/bnx2i/bnx2i.h
+++ b/drivers/scsi/bnx2i/bnx2i.h
@@ -350,6 +350,7 @@ struct bnx2i_hba {
350 struct pci_dev *pcidev; 350 struct pci_dev *pcidev;
351 struct net_device *netdev; 351 struct net_device *netdev;
352 void __iomem *regview; 352 void __iomem *regview;
353 resource_size_t reg_base;
353 354
354 u32 age; 355 u32 age;
355 unsigned long cnic_dev_type; 356 unsigned long cnic_dev_type;
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index ece47e502282..86a12b48e477 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -2724,7 +2724,6 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep)
2724 goto arm_cq; 2724 goto arm_cq;
2725 } 2725 }
2726 2726
2727 reg_base = ep->hba->netdev->base_addr;
2728 if ((test_bit(BNX2I_NX2_DEV_5709, &ep->hba->cnic_dev_type)) && 2727 if ((test_bit(BNX2I_NX2_DEV_5709, &ep->hba->cnic_dev_type)) &&
2729 (ep->hba->mail_queue_access == BNX2I_MQ_BIN_MODE)) { 2728 (ep->hba->mail_queue_access == BNX2I_MQ_BIN_MODE)) {
2730 config2 = REG_RD(ep->hba, BNX2_MQ_CONFIG2); 2729 config2 = REG_RD(ep->hba, BNX2_MQ_CONFIG2);
@@ -2740,7 +2739,7 @@ int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep)
2740 /* 5709 device in normal node and 5706/5708 devices */ 2739 /* 5709 device in normal node and 5706/5708 devices */
2741 reg_off = CTX_OFFSET + (MB_KERNEL_CTX_SIZE * cid_num); 2740 reg_off = CTX_OFFSET + (MB_KERNEL_CTX_SIZE * cid_num);
2742 2741
2743 ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 2742 ep->qp.ctx_base = ioremap_nocache(ep->hba->reg_base + reg_off,
2744 MB_KERNEL_CTX_SIZE); 2743 MB_KERNEL_CTX_SIZE);
2745 if (!ep->qp.ctx_base) 2744 if (!ep->qp.ctx_base)
2746 return -ENOMEM; 2745 return -ENOMEM;
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index f8d516b53161..621538b8b544 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -811,13 +811,13 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic)
811 bnx2i_identify_device(hba); 811 bnx2i_identify_device(hba);
812 bnx2i_setup_host_queue_size(hba, shost); 812 bnx2i_setup_host_queue_size(hba, shost);
813 813
814 hba->reg_base = pci_resource_start(hba->pcidev, 0);
814 if (test_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type)) { 815 if (test_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type)) {
815 hba->regview = ioremap_nocache(hba->netdev->base_addr, 816 hba->regview = pci_iomap(hba->pcidev, 0, BNX2_MQ_CONFIG2);
816 BNX2_MQ_CONFIG2);
817 if (!hba->regview) 817 if (!hba->regview)
818 goto ioreg_map_err; 818 goto ioreg_map_err;
819 } else if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type)) { 819 } else if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type)) {
820 hba->regview = ioremap_nocache(hba->netdev->base_addr, 4096); 820 hba->regview = pci_iomap(hba->pcidev, 0, 4096);
821 if (!hba->regview) 821 if (!hba->regview)
822 goto ioreg_map_err; 822 goto ioreg_map_err;
823 } 823 }
@@ -884,7 +884,7 @@ cid_que_err:
884 bnx2i_free_mp_bdt(hba); 884 bnx2i_free_mp_bdt(hba);
885mp_bdt_mem_err: 885mp_bdt_mem_err:
886 if (hba->regview) { 886 if (hba->regview) {
887 iounmap(hba->regview); 887 pci_iounmap(hba->pcidev, hba->regview);
888 hba->regview = NULL; 888 hba->regview = NULL;
889 } 889 }
890ioreg_map_err: 890ioreg_map_err:
@@ -910,7 +910,7 @@ void bnx2i_free_hba(struct bnx2i_hba *hba)
910 pci_dev_put(hba->pcidev); 910 pci_dev_put(hba->pcidev);
911 911
912 if (hba->regview) { 912 if (hba->regview) {
913 iounmap(hba->regview); 913 pci_iounmap(hba->pcidev, hba->regview);
914 hba->regview = NULL; 914 hba->regview = NULL;
915 } 915 }
916 bnx2i_free_mp_bdt(hba); 916 bnx2i_free_mp_bdt(hba);