diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2008-07-21 22:44:06 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-22 17:52:04 -0400 |
commit | 48bfd1e0fc66b27254ec742b014e689ef218e76c (patch) | |
tree | fd380b835dc12a5500ff5972981ee9ae767639b4 /drivers/net/netxen/netxen_nic_main.c | |
parent | a97342f9790f14ac20bd5f8b16ed661411fa2e3e (diff) |
netxen: add netxen_nic_ctx.c
Contains rx and tx ring context management and certain
firmware commands for netxen firmware v4.0.0+.
This patch gathers all HW context management code into
netxen_nic_ctx.c.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 2d0963f4d194..03d796d19ad9 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -151,22 +151,17 @@ static uint32_t msi_tgt_status[8] = { | |||
151 | ISR_INT_TARGET_STATUS_F6, ISR_INT_TARGET_STATUS_F7 | 151 | ISR_INT_TARGET_STATUS_F6, ISR_INT_TARGET_STATUS_F7 |
152 | }; | 152 | }; |
153 | 153 | ||
154 | static uint32_t sw_int_mask[4] = { | ||
155 | CRB_SW_INT_MASK_0, CRB_SW_INT_MASK_1, | ||
156 | CRB_SW_INT_MASK_2, CRB_SW_INT_MASK_3 | ||
157 | }; | ||
158 | |||
159 | static struct netxen_legacy_intr_set legacy_intr[] = NX_LEGACY_INTR_CONFIG; | 154 | static struct netxen_legacy_intr_set legacy_intr[] = NX_LEGACY_INTR_CONFIG; |
160 | 155 | ||
161 | static void netxen_nic_disable_int(struct netxen_adapter *adapter) | 156 | static void netxen_nic_disable_int(struct netxen_adapter *adapter) |
162 | { | 157 | { |
163 | u32 mask = 0x7ff; | 158 | u32 mask = 0x7ff; |
164 | int retries = 32; | 159 | int retries = 32; |
165 | int port = adapter->portnum; | ||
166 | int pci_fn = adapter->ahw.pci_func; | 160 | int pci_fn = adapter->ahw.pci_func; |
167 | 161 | ||
168 | if (adapter->msi_mode != MSI_MODE_MULTIFUNC) | 162 | if (adapter->msi_mode != MSI_MODE_MULTIFUNC) |
169 | adapter->pci_write_normalize(adapter, sw_int_mask[port], 0); | 163 | adapter->pci_write_normalize(adapter, |
164 | adapter->crb_intr_mask, 0); | ||
170 | 165 | ||
171 | if (adapter->intr_scheme != -1 && | 166 | if (adapter->intr_scheme != -1 && |
172 | adapter->intr_scheme != INTR_SCHEME_PERPORT) | 167 | adapter->intr_scheme != INTR_SCHEME_PERPORT) |
@@ -198,7 +193,6 @@ static void netxen_nic_disable_int(struct netxen_adapter *adapter) | |||
198 | static void netxen_nic_enable_int(struct netxen_adapter *adapter) | 193 | static void netxen_nic_enable_int(struct netxen_adapter *adapter) |
199 | { | 194 | { |
200 | u32 mask; | 195 | u32 mask; |
201 | int port = adapter->portnum; | ||
202 | 196 | ||
203 | DPRINTK(1, INFO, "Entered ISR Enable \n"); | 197 | DPRINTK(1, INFO, "Entered ISR Enable \n"); |
204 | 198 | ||
@@ -219,7 +213,7 @@ static void netxen_nic_enable_int(struct netxen_adapter *adapter) | |||
219 | adapter->pci_write_immediate(adapter, ISR_INT_MASK, mask); | 213 | adapter->pci_write_immediate(adapter, ISR_INT_MASK, mask); |
220 | } | 214 | } |
221 | 215 | ||
222 | adapter->pci_write_normalize(adapter, sw_int_mask[port], 0x1); | 216 | adapter->pci_write_normalize(adapter, adapter->crb_intr_mask, 0x1); |
223 | 217 | ||
224 | if (!NETXEN_IS_MSI_FAMILY(adapter)) { | 218 | if (!NETXEN_IS_MSI_FAMILY(adapter)) { |
225 | mask = 0xbff; | 219 | mask = 0xbff; |
@@ -710,10 +704,13 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
710 | adapter->status &= ~NETXEN_NETDEV_STATUS; | 704 | adapter->status &= ~NETXEN_NETDEV_STATUS; |
711 | adapter->rx_csum = 1; | 705 | adapter->rx_csum = 1; |
712 | adapter->mc_enabled = 0; | 706 | adapter->mc_enabled = 0; |
713 | if (NX_IS_REVISION_P3(revision_id)) | 707 | if (NX_IS_REVISION_P3(revision_id)) { |
714 | adapter->max_mc_count = 38; | 708 | adapter->max_mc_count = 38; |
715 | else | 709 | adapter->max_rds_rings = 2; |
710 | } else { | ||
716 | adapter->max_mc_count = 16; | 711 | adapter->max_mc_count = 16; |
712 | adapter->max_rds_rings = 3; | ||
713 | } | ||
717 | 714 | ||
718 | netdev->open = netxen_nic_open; | 715 | netdev->open = netxen_nic_open; |
719 | netdev->stop = netxen_nic_close; | 716 | netdev->stop = netxen_nic_close; |
@@ -1081,7 +1078,7 @@ static int netxen_nic_open(struct net_device *netdev) | |||
1081 | netxen_nic_update_cmd_consumer(adapter, 0); | 1078 | netxen_nic_update_cmd_consumer(adapter, 0); |
1082 | 1079 | ||
1083 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { | 1080 | for (ctx = 0; ctx < MAX_RCV_CTX; ++ctx) { |
1084 | for (ring = 0; ring < NUM_RCV_DESC_RINGS; ring++) | 1081 | for (ring = 0; ring < adapter->max_rds_rings; ring++) |
1085 | netxen_post_rx_buffers(adapter, ctx, ring); | 1082 | netxen_post_rx_buffers(adapter, ctx, ring); |
1086 | } | 1083 | } |
1087 | if (NETXEN_IS_MSI_FAMILY(adapter)) | 1084 | if (NETXEN_IS_MSI_FAMILY(adapter)) |