aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/netxen/netxen_nic_ctx.c
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit@netxen.com>2009-09-05 17:43:10 +0000
committerDavid S. Miller <davem@davemloft.net>2009-09-07 01:53:13 -0700
commit195c5f9829407857cba86f083caec6302b1fd8e1 (patch)
treed208ca059eaa3f6dd0dd4fb23226f84584a341e4 /drivers/net/netxen/netxen_nic_ctx.c
parentd0725e4d3ccf603c4fcf3589850cb464c927d42a (diff)
netxen: pre calculate register addresses
For registers accessed in fast path (interrupt / softirq) avoid expensive I/O address translation. These registers are directly mapped in PCI bar 0 and do not require any window checks. Signed-off-by: Amit Kumar Salecha <amit@netxen.com> Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_ctx.c')
-rw-r--r--drivers/net/netxen/netxen_nic_ctx.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/net/netxen/netxen_nic_ctx.c b/drivers/net/netxen/netxen_nic_ctx.c
index 8ab5773e47d..33f82db0129 100644
--- a/drivers/net/netxen/netxen_nic_ctx.c
+++ b/drivers/net/netxen/netxen_nic_ctx.c
@@ -229,7 +229,8 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
rds_ring = &recv_ctx->rds_rings[i];
reg = le32_to_cpu(prsp_rds[i].host_producer_crb);
- rds_ring->crb_rcv_producer = NETXEN_NIC_REG(reg - 0x200);
+ rds_ring->crb_rcv_producer = netxen_get_ioaddr(adapter,
+ NETXEN_NIC_REG(reg - 0x200));
}
prsp_sds = ((nx_cardrsp_sds_ring_t *)
@@ -239,10 +240,12 @@ nx_fw_cmd_create_rx_ctx(struct netxen_adapter *adapter)
sds_ring = &recv_ctx->sds_rings[i];
reg = le32_to_cpu(prsp_sds[i].host_consumer_crb);
- sds_ring->crb_sts_consumer = NETXEN_NIC_REG(reg - 0x200);
+ sds_ring->crb_sts_consumer = netxen_get_ioaddr(adapter,
+ NETXEN_NIC_REG(reg - 0x200));
reg = le32_to_cpu(prsp_sds[i].interrupt_crb);
- sds_ring->crb_intr_mask = NETXEN_NIC_REG(reg - 0x200);
+ sds_ring->crb_intr_mask = netxen_get_ioaddr(adapter,
+ NETXEN_NIC_REG(reg - 0x200));
}
recv_ctx->state = le32_to_cpu(prsp->host_ctx_state);
@@ -342,7 +345,8 @@ nx_fw_cmd_create_tx_ctx(struct netxen_adapter *adapter)
if (err == NX_RCODE_SUCCESS) {
temp = le32_to_cpu(prsp->cds_ring.host_producer_crb);
- tx_ring->crb_cmd_producer = NETXEN_NIC_REG(temp - 0x200);
+ tx_ring->crb_cmd_producer = netxen_get_ioaddr(adapter,
+ NETXEN_NIC_REG(temp - 0x200));
#if 0
adapter->tx_state =
le32_to_cpu(prsp->host_ctx_state);
@@ -651,7 +655,8 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
if (NX_IS_REVISION_P2(adapter->ahw.revision_id))
rds_ring->crb_rcv_producer =
- recv_crb_registers[port].crb_rcv_producer[ring];
+ netxen_get_ioaddr(adapter,
+ recv_crb_registers[port].crb_rcv_producer[ring]);
}
for (ring = 0; ring < adapter->max_sds_rings; ring++) {
@@ -670,10 +675,12 @@ int netxen_alloc_hw_resources(struct netxen_adapter *adapter)
sds_ring->desc_head = (struct status_desc *)addr;
sds_ring->crb_sts_consumer =
- recv_crb_registers[port].crb_sts_consumer[ring];
+ netxen_get_ioaddr(adapter,
+ recv_crb_registers[port].crb_sts_consumer[ring]);
sds_ring->crb_intr_mask =
- recv_crb_registers[port].sw_int_mask[ring];
+ netxen_get_ioaddr(adapter,
+ recv_crb_registers[port].sw_int_mask[ring]);
}