Commit db3ea781 authored by Sathya Perla's avatar Sathya Perla Committed by David S. Miller

be2net: get rid of memory mapped pci-cfg space address

Get rid of adapter->pcicfg and its use. Use pci_config_read/write_dword()
instead.
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 857c9905
...@@ -298,7 +298,6 @@ struct be_adapter { ...@@ -298,7 +298,6 @@ struct be_adapter {
u8 __iomem *csr; u8 __iomem *csr;
u8 __iomem *db; /* Door Bell */ u8 __iomem *db; /* Door Bell */
u8 __iomem *pcicfg; /* PCI config space */
struct mutex mbox_lock; /* For serializing mbox cmds to BE card */ struct mutex mbox_lock; /* For serializing mbox cmds to BE card */
struct be_dma_mem mbox_mem; struct be_dma_mem mbox_mem;
......
...@@ -141,13 +141,15 @@ static int be_queue_alloc(struct be_adapter *adapter, struct be_queue_info *q, ...@@ -141,13 +141,15 @@ static int be_queue_alloc(struct be_adapter *adapter, struct be_queue_info *q,
static void be_intr_set(struct be_adapter *adapter, bool enable) static void be_intr_set(struct be_adapter *adapter, bool enable)
{ {
u8 __iomem *addr = adapter->pcicfg + PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET; u32 reg, enabled;
u32 reg = ioread32(addr);
u32 enabled = reg & MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
if (adapter->eeh_err) if (adapter->eeh_err)
return; return;
pci_read_config_dword(adapter->pdev, PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET,
&reg);
enabled = reg & MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
if (!enabled && enable) if (!enabled && enable)
reg |= MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK; reg |= MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
else if (enabled && !enable) else if (enabled && !enable)
...@@ -155,7 +157,8 @@ static void be_intr_set(struct be_adapter *adapter, bool enable) ...@@ -155,7 +157,8 @@ static void be_intr_set(struct be_adapter *adapter, bool enable)
else else
return; return;
iowrite32(reg, addr); pci_write_config_dword(adapter->pdev,
PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET, reg);
} }
static void be_rxq_notify(struct be_adapter *adapter, u16 qid, u16 posted) static void be_rxq_notify(struct be_adapter *adapter, u16 qid, u16 posted)
...@@ -2951,14 +2954,12 @@ static void be_unmap_pci_bars(struct be_adapter *adapter) ...@@ -2951,14 +2954,12 @@ static void be_unmap_pci_bars(struct be_adapter *adapter)
iounmap(adapter->csr); iounmap(adapter->csr);
if (adapter->db) if (adapter->db)
iounmap(adapter->db); iounmap(adapter->db);
if (adapter->pcicfg && be_physfn(adapter))
iounmap(adapter->pcicfg);
} }
static int be_map_pci_bars(struct be_adapter *adapter) static int be_map_pci_bars(struct be_adapter *adapter)
{ {
u8 __iomem *addr; u8 __iomem *addr;
int pcicfg_reg, db_reg; int db_reg;
if (lancer_chip(adapter)) { if (lancer_chip(adapter)) {
addr = ioremap_nocache(pci_resource_start(adapter->pdev, 0), addr = ioremap_nocache(pci_resource_start(adapter->pdev, 0),
...@@ -2978,10 +2979,8 @@ static int be_map_pci_bars(struct be_adapter *adapter) ...@@ -2978,10 +2979,8 @@ static int be_map_pci_bars(struct be_adapter *adapter)
} }
if (adapter->generation == BE_GEN2) { if (adapter->generation == BE_GEN2) {
pcicfg_reg = 1;
db_reg = 4; db_reg = 4;
} else { } else {
pcicfg_reg = 0;
if (be_physfn(adapter)) if (be_physfn(adapter))
db_reg = 4; db_reg = 4;
else else
...@@ -2993,16 +2992,6 @@ static int be_map_pci_bars(struct be_adapter *adapter) ...@@ -2993,16 +2992,6 @@ static int be_map_pci_bars(struct be_adapter *adapter)
goto pci_map_err; goto pci_map_err;
adapter->db = addr; adapter->db = addr;
if (be_physfn(adapter)) {
addr = ioremap_nocache(
pci_resource_start(adapter->pdev, pcicfg_reg),
pci_resource_len(adapter->pdev, pcicfg_reg));
if (addr == NULL)
goto pci_map_err;
adapter->pcicfg = addr;
} else
adapter->pcicfg = adapter->db + SRIOV_VF_PCICFG_OFFSET;
return 0; return 0;
pci_map_err: pci_map_err:
be_unmap_pci_bars(adapter); be_unmap_pci_bars(adapter);
......
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