aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_niu.c
diff options
context:
space:
mode:
authorAmit S. Kale <amitkale@netxen.com>2006-12-04 12:23:25 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-04 18:36:03 -0500
commited25ffa16434724f5ed825aa48734c7f3aefa203 (patch)
tree71cff36d0b2f43adf20e67ac6cc3ba3020f94ff2 /drivers/net/netxen/netxen_nic_niu.c
parent80922fbcb6f00127e91580e7565bb665947ac5d3 (diff)
[PATCH] NetXen: multiport firmware support, ioctl interface
NetXen: 1G/10G Ethernet driver updates - Multiport and newer firmware support - ioctl interface for user level tools - Cast error fix for multiport Signed-off-by: Amit S. Kale <amitkale@netxen.com> netxen_nic.h | 281 +++++++++++++++++++++++++------- netxen_nic_ethtool.c | 12 - netxen_nic_hw.c | 429 +++++++++++++++++++++++++++++++++++++++++--------- netxen_nic_init.c | 301 ++++++++++++++++++++++++++++++----- netxen_nic_ioctl.h | 2 netxen_nic_isr.c | 3 netxen_nic_main.c | 260 ++++++++++++++++++------------ netxen_nic_niu.c | 22 +- netxen_nic_phan_reg.h | 228 ++++++++++++++++---------- 9 files changed, 1161 insertions(+), 377 deletions(-) Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_niu.c')
-rw-r--r--drivers/net/netxen/netxen_nic_niu.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c
index ff74f1e413d4..4987dc765d99 100644
--- a/drivers/net/netxen/netxen_nic_niu.c
+++ b/drivers/net/netxen/netxen_nic_niu.c
@@ -40,13 +40,15 @@
40 40
41static long phy_lock_timeout = 100000000; 41static long phy_lock_timeout = 100000000;
42 42
43static inline int phy_lock(void) 43static inline int phy_lock(struct netxen_adapter *adapter)
44{ 44{
45 int i; 45 int i;
46 int done = 0, timeout = 0; 46 int done = 0, timeout = 0;
47 47
48 while (!done) { 48 while (!done) {
49 done = readl((void __iomem *)NETXEN_PCIE_REG(PCIE_SEM3_LOCK)); 49 done =
50 readl(pci_base_offset
51 (adapter, NETXEN_PCIE_REG(PCIE_SEM3_LOCK)));
50 if (done == 1) 52 if (done == 1)
51 break; 53 break;
52 if (timeout >= phy_lock_timeout) { 54 if (timeout >= phy_lock_timeout) {
@@ -61,13 +63,15 @@ static inline int phy_lock(void)
61 } 63 }
62 } 64 }
63 65
64 writel(NETXEN_PHY_LOCK_ID, (void __iomem *)PHY_LOCK_DRIVER); 66 writel(PHY_LOCK_DRIVER,
67 NETXEN_CRB_NORMALIZE(adapter, NETXEN_PHY_LOCK_ID));
65 return 0; 68 return 0;
66} 69}
67 70
68static inline int phy_unlock(void) 71static inline int phy_unlock(struct netxen_adapter *adapter)
69{ 72{
70 readl((void __iomem *)NETXEN_PCIE_REG(PCIE_SEM3_UNLOCK)); 73 readl(pci_base_offset(adapter, NETXEN_PCIE_REG(PCIE_SEM3_UNLOCK)));
74
71 return 0; 75 return 0;
72} 76}
73 77
@@ -95,7 +99,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
95 __le32 status; 99 __le32 status;
96 __le32 mac_cfg0; 100 __le32 mac_cfg0;
97 101
98 if (phy_lock() != 0) { 102 if (phy_lock(adapter) != 0) {
99 return -1; 103 return -1;
100 } 104 }
101 105
@@ -162,7 +166,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
162 NETXEN_NIU_GB_MAC_CONFIG_0(0), 166 NETXEN_NIU_GB_MAC_CONFIG_0(0),
163 &mac_cfg0, 4)) 167 &mac_cfg0, 4))
164 return -EIO; 168 return -EIO;
165 phy_unlock(); 169 phy_unlock(adapter);
166 return result; 170 return result;
167} 171}
168 172
@@ -612,7 +616,7 @@ int netxen_niu_macaddr_set(struct netxen_port *port,
612 __le32 temp = 0; 616 __le32 temp = 0;
613 struct netxen_adapter *adapter = port->adapter; 617 struct netxen_adapter *adapter = port->adapter;
614 int phy = port->portnum; 618 int phy = port->portnum;
615 unsigned char mac_addr[MAX_ADDR_LEN]; 619 unsigned char mac_addr[6];
616 int i; 620 int i;
617 621
618 for (i = 0; i < 10; i++) { 622 for (i = 0; i < 10; i++) {
@@ -631,7 +635,7 @@ int netxen_niu_macaddr_set(struct netxen_port *port,
631 635
632 netxen_niu_macaddr_get(adapter, phy, 636 netxen_niu_macaddr_get(adapter, phy,
633 (netxen_ethernet_macaddr_t *) mac_addr); 637 (netxen_ethernet_macaddr_t *) mac_addr);
634 if (memcmp(mac_addr, addr, MAX_ADDR_LEN == 0)) 638 if (memcmp(mac_addr, addr, 6) == 0)
635 break; 639 break;
636 } 640 }
637 641