diff options
author | dhananjay.phadke@gmail.com <dhananjay.phadke@gmail.com> | 2007-07-01 14:56:00 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-02 08:24:52 -0400 |
commit | 2d1a3bbdf21d05e16703c8d608628ae4676eb3ac (patch) | |
tree | 64df196fd0cd4dcc17f614ab65a25637f1ce5531 /drivers/net/netxen/netxen_nic_main.c | |
parent | 644caeefb3bbf539e74b7098648ff0bfc9e52bb3 (diff) |
RESEND [PATCH 2/3] NetXen: Support per PCI-function interrupt mask registers
This patch updates the various access routines to access different
control and status settings present in different register locations.
This will fix problems related to working of different ports in
multi Port card.
Signed-off by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off by: Milan Bag <mbag@netxen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 663bc47c1f63..dba8e6b29ff3 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -308,7 +308,13 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
308 | 308 | ||
309 | adapter->netdev = netdev; | 309 | adapter->netdev = netdev; |
310 | adapter->pdev = pdev; | 310 | adapter->pdev = pdev; |
311 | |||
312 | /* this will be read from FW later */ | ||
313 | adapter->intr_scheme = -1; | ||
314 | |||
315 | /* This will be reset for mezz cards */ | ||
311 | adapter->portnum = pci_func_id; | 316 | adapter->portnum = pci_func_id; |
317 | adapter->status &= ~NETXEN_NETDEV_STATUS; | ||
312 | 318 | ||
313 | netdev->open = netxen_nic_open; | 319 | netdev->open = netxen_nic_open; |
314 | netdev->stop = netxen_nic_close; | 320 | netdev->stop = netxen_nic_close; |
@@ -1100,28 +1106,26 @@ static int | |||
1100 | netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev) | 1106 | netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev) |
1101 | { | 1107 | { |
1102 | u32 ret = 0; | 1108 | u32 ret = 0; |
1109 | u32 our_int = 0; | ||
1103 | 1110 | ||
1104 | DPRINTK(INFO, "Entered handle ISR\n"); | 1111 | DPRINTK(INFO, "Entered handle ISR\n"); |
1105 | adapter->stats.ints++; | 1112 | adapter->stats.ints++; |
1106 | 1113 | ||
1107 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | 1114 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { |
1108 | int count = 0; | ||
1109 | u32 mask; | ||
1110 | u32 our_int = 0; | ||
1111 | our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); | 1115 | our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); |
1112 | /* not our interrupt */ | 1116 | /* not our interrupt */ |
1113 | if ((our_int & (0x80 << adapter->portnum)) == 0) | 1117 | if ((our_int & (0x80 << adapter->portnum)) == 0) |
1114 | return ret; | 1118 | return ret; |
1115 | netxen_nic_disable_int(adapter); | 1119 | } |
1116 | /* Window = 0 or 1 */ | ||
1117 | do { | ||
1118 | writel(0xffffffff, PCI_OFFSET_SECOND_RANGE(adapter, | ||
1119 | ISR_INT_TARGET_STATUS)); | ||
1120 | mask = readl(pci_base_offset(adapter, ISR_INT_VECTOR)); | ||
1121 | } while (((mask & 0x80) != 0) && (++count < 32)); | ||
1122 | if ((mask & 0x80) != 0) | ||
1123 | printk("Could not disable interrupt completely\n"); | ||
1124 | 1120 | ||
1121 | netxen_nic_disable_int(adapter); | ||
1122 | |||
1123 | if (adapter->intr_scheme == INTR_SCHEME_PERPORT) { | ||
1124 | /* claim interrupt */ | ||
1125 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | ||
1126 | writel(our_int & ~((u32)(0x80 << adapter->portnum)), | ||
1127 | NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR)); | ||
1128 | } | ||
1125 | } | 1129 | } |
1126 | 1130 | ||
1127 | if (netxen_nic_rx_has_work(adapter) || netxen_nic_tx_has_work(adapter)) { | 1131 | if (netxen_nic_rx_has_work(adapter) || netxen_nic_tx_has_work(adapter)) { |
@@ -1133,7 +1137,7 @@ netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev) | |||
1133 | } else { | 1137 | } else { |
1134 | static unsigned int intcount = 0; | 1138 | static unsigned int intcount = 0; |
1135 | if ((++intcount & 0xfff) == 0xfff) | 1139 | if ((++intcount & 0xfff) == 0xfff) |
1136 | printk(KERN_ERR | 1140 | DPRINTK(KERN_ERR |
1137 | "%s: %s interrupt %d while in poll\n", | 1141 | "%s: %s interrupt %d while in poll\n", |
1138 | netxen_nic_driver_name, netdev->name, | 1142 | netxen_nic_driver_name, netdev->name, |
1139 | intcount); | 1143 | intcount); |