aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netxen/netxen_nic_ethtool.c
diff options
context:
space:
mode:
authorAmit S. Kale <amitkale@netxen.com>2006-11-29 12:00:10 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:16:36 -0500
commitcb8011ad53e0855ef088e0e5a4bcb98fa90c70b6 (patch)
tree2ea32fc89dab2257b359a0577ae06c6565cc99d1 /drivers/net/netxen/netxen_nic_ethtool.c
parentedf901638144525a140c68be01be1b22e6041a6d (diff)
[PATCH] NetXen: temp monitoring, newer firmware support, mm footprint reduction
NetXen: 1G/10G Ethernet Driver updates - Temparature monitoring and device control - Memory footprint reduction - Driver changes to support newer version of firmware Signed-off-by: Amit S. Kale <amitkale@netxen.com> netxen_nic.h | 165 ++++++++++++++++++++++++++++++++-- netxen_nic_ethtool.c | 89 ++++++++++++------ netxen_nic_hdr.h | 71 +++++++++++++- netxen_nic_hw.c | 206 +++++++++++++++++++++++++++++-------------- netxen_nic_hw.h | 8 + netxen_nic_init.c | 239 +++++++++++++++++++++++++++++++++++++++++--------- netxen_nic_ioctl.h | 12 +- netxen_nic_isr.c | 54 +++++------ netxen_nic_main.c | 121 +++++++++++++++++-------- netxen_nic_niu.c | 172 +++++++++++++++++++++++++++-------- netxen_nic_phan_reg.h | 24 ++++- 11 files changed, 891 insertions(+), 270 deletions(-) Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_ethtool.c')
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c89
1 files changed, 58 insertions, 31 deletions
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index caf6cc15b241..f3fc35cf8af7 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -53,6 +53,9 @@ struct netxen_nic_stats {
53#define NETXEN_NIC_STAT(m) sizeof(((struct netxen_port *)0)->m), \ 53#define NETXEN_NIC_STAT(m) sizeof(((struct netxen_port *)0)->m), \
54 offsetof(struct netxen_port, m) 54 offsetof(struct netxen_port, m)
55 55
56#define NETXEN_NIC_PORT_WINDOW 0x10000
57#define NETXEN_NIC_INVALID_DATA 0xDEADBEEF
58
56static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = { 59static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = {
57 {"rcvd_bad_skb", NETXEN_NIC_STAT(stats.rcvdbadskb)}, 60 {"rcvd_bad_skb", NETXEN_NIC_STAT(stats.rcvdbadskb)},
58 {"xmit_called", NETXEN_NIC_STAT(stats.xmitcalled)}, 61 {"xmit_called", NETXEN_NIC_STAT(stats.xmitcalled)},
@@ -111,9 +114,9 @@ netxen_nic_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo)
111{ 114{
112 struct netxen_port *port = netdev_priv(dev); 115 struct netxen_port *port = netdev_priv(dev);
113 struct netxen_adapter *adapter = port->adapter; 116 struct netxen_adapter *adapter = port->adapter;
114 uint32_t fw_major = 0; 117 u32 fw_major = 0;
115 uint32_t fw_minor = 0; 118 u32 fw_minor = 0;
116 uint32_t fw_build = 0; 119 u32 fw_build = 0;
117 120
118 strncpy(drvinfo->driver, "netxen_nic", 32); 121 strncpy(drvinfo->driver, "netxen_nic", 32);
119 strncpy(drvinfo->version, NETXEN_NIC_LINUX_VERSIONID, 32); 122 strncpy(drvinfo->version, NETXEN_NIC_LINUX_VERSIONID, 32);
@@ -136,6 +139,8 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
136{ 139{
137 struct netxen_port *port = netdev_priv(dev); 140 struct netxen_port *port = netdev_priv(dev);
138 struct netxen_adapter *adapter = port->adapter; 141 struct netxen_adapter *adapter = port->adapter;
142 struct netxen_board_info *boardinfo;
143 boardinfo = &adapter->ahw.boardcfg;
139 144
140 /* read which mode */ 145 /* read which mode */
141 if (adapter->ahw.board_type == NETXEN_NIC_GBE) { 146 if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
@@ -144,16 +149,12 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
144 SUPPORTED_100baseT_Half | 149 SUPPORTED_100baseT_Half |
145 SUPPORTED_100baseT_Full | 150 SUPPORTED_100baseT_Full |
146 SUPPORTED_1000baseT_Half | 151 SUPPORTED_1000baseT_Half |
147 SUPPORTED_1000baseT_Full | 152 SUPPORTED_1000baseT_Full);
148 SUPPORTED_TP |
149 SUPPORTED_MII | SUPPORTED_Autoneg);
150 153
151 ecmd->advertising = (ADVERTISED_100baseT_Half | 154 ecmd->advertising = (ADVERTISED_100baseT_Half |
152 ADVERTISED_100baseT_Full | 155 ADVERTISED_100baseT_Full |
153 ADVERTISED_1000baseT_Half | 156 ADVERTISED_1000baseT_Half |
154 ADVERTISED_1000baseT_Full | 157 ADVERTISED_1000baseT_Full);
155 ADVERTISED_TP |
156 ADVERTISED_MII | ADVERTISED_Autoneg);
157 158
158 ecmd->port = PORT_TP; 159 ecmd->port = PORT_TP;
159 160
@@ -162,16 +163,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
162 ecmd->duplex = port->link_duplex; 163 ecmd->duplex = port->link_duplex;
163 } else 164 } else
164 return -EIO; /* link absent */ 165 return -EIO; /* link absent */
165 166 } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) {
166 ecmd->phy_address = port->portnum;
167 ecmd->transceiver = XCVR_EXTERNAL;
168
169 /* get autoneg settings */
170 ecmd->autoneg = port->link_autoneg;
171 return 0;
172 }
173
174 if (adapter->ahw.board_type == NETXEN_NIC_XGBE) {
175 ecmd->supported = (SUPPORTED_TP | 167 ecmd->supported = (SUPPORTED_TP |
176 SUPPORTED_1000baseT_Full | 168 SUPPORTED_1000baseT_Full |
177 SUPPORTED_10000baseT_Full); 169 SUPPORTED_10000baseT_Full);
@@ -182,13 +174,47 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
182 174
183 ecmd->speed = SPEED_10000; 175 ecmd->speed = SPEED_10000;
184 ecmd->duplex = DUPLEX_FULL; 176 ecmd->duplex = DUPLEX_FULL;
185 ecmd->phy_address = port->portnum;
186 ecmd->transceiver = XCVR_EXTERNAL;
187 ecmd->autoneg = AUTONEG_DISABLE; 177 ecmd->autoneg = AUTONEG_DISABLE;
188 return 0; 178 } else
179 return -EIO;
180
181 ecmd->phy_address = port->portnum;
182 ecmd->transceiver = XCVR_EXTERNAL;
183
184 switch ((netxen_brdtype_t) boardinfo->board_type) {
185 case NETXEN_BRDTYPE_P2_SB35_4G:
186 case NETXEN_BRDTYPE_P2_SB31_2G:
187 ecmd->supported |= SUPPORTED_Autoneg;
188 ecmd->advertising |= ADVERTISED_Autoneg;
189 case NETXEN_BRDTYPE_P2_SB31_10G_CX4:
190 ecmd->supported |= SUPPORTED_TP;
191 ecmd->advertising |= ADVERTISED_TP;
192 ecmd->port = PORT_TP;
193 ecmd->autoneg = (boardinfo->board_type ==
194 NETXEN_BRDTYPE_P2_SB31_10G_CX4) ?
195 (AUTONEG_DISABLE) : (port->link_autoneg);
196 break;
197 case NETXEN_BRDTYPE_P2_SB31_10G_HMEZ:
198 case NETXEN_BRDTYPE_P2_SB31_10G_IMEZ:
199 ecmd->supported |= SUPPORTED_MII;
200 ecmd->advertising |= ADVERTISED_MII;
201 ecmd->port = PORT_FIBRE;
202 ecmd->autoneg = AUTONEG_DISABLE;
203 break;
204 case NETXEN_BRDTYPE_P2_SB31_10G:
205 ecmd->supported |= SUPPORTED_FIBRE;
206 ecmd->advertising |= ADVERTISED_FIBRE;
207 ecmd->port = PORT_FIBRE;
208 ecmd->autoneg = AUTONEG_DISABLE;
209 break;
210 default:
211 printk("ERROR: Unsupported board model %d\n",
212 (netxen_brdtype_t) boardinfo->board_type);
213 return -EIO;
214
189 } 215 }
190 216
191 return -EIO; 217 return 0;
192} 218}
193 219
194static int 220static int
@@ -371,7 +397,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
371 for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) { 397 for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) {
372 /* GB: port specific registers */ 398 /* GB: port specific registers */
373 if (mode == 0 && i >= 19) 399 if (mode == 0 && i >= 19)
374 window = port->portnum * 0x10000; 400 window = port->portnum * NETXEN_NIC_PORT_WINDOW;
375 401
376 NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode]. 402 NETXEN_NIC_LOCKED_READ_REG(niu_registers[mode].
377 reg[i - 3] + window, 403 reg[i - 3] + window,
@@ -385,7 +411,8 @@ static void
385netxen_nic_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) 411netxen_nic_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
386{ 412{
387 wol->supported = WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | WAKE_MAGIC; 413 wol->supported = WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | WAKE_MAGIC;
388 wol->wolopts = 0; /* options can be added depending upon the mode */ 414 /* options can be added depending upon the mode */
415 wol->wolopts = 0;
389} 416}
390 417
391static u32 netxen_nic_get_link(struct net_device *dev) 418static u32 netxen_nic_get_link(struct net_device *dev)
@@ -531,9 +558,9 @@ static int netxen_nic_reg_test(struct net_device *dev)
531 558
532 save = data_read; 559 save = data_read;
533 if (data_read) 560 if (data_read)
534 data_written = data_read & 0xDEADBEEF; 561 data_written = data_read & NETXEN_NIC_INVALID_DATA;
535 else 562 else
536 data_written = 0xDEADBEEF; 563 data_written = NETXEN_NIC_INVALID_DATA;
537 netxen_nic_write_w0(adapter, 564 netxen_nic_write_w0(adapter,
538 NETXEN_NIU_GB_MII_MGMT_STATUS(port-> 565 NETXEN_NIU_GB_MII_MGMT_STATUS(port->
539 portnum), 566 portnum),
@@ -559,9 +586,9 @@ static int netxen_nic_reg_test(struct net_device *dev)
559 586
560 save = data_read; 587 save = data_read;
561 if (data_read) 588 if (data_read)
562 data_written = data_read & 0xDEADBEEF; 589 data_written = data_read & NETXEN_NIC_INVALID_DATA;
563 else 590 else
564 data_written = 0xDEADBEEF; 591 data_written = NETXEN_NIC_INVALID_DATA;
565 netxen_nic_write_w0(adapter, 592 netxen_nic_write_w0(adapter,
566 NETXEN_NIU_GB_MII_MGMT_INDICATE(port-> 593 NETXEN_NIU_GB_MII_MGMT_INDICATE(port->
567 portnum), 594 portnum),
@@ -587,9 +614,9 @@ static int netxen_nic_reg_test(struct net_device *dev)
587 614
588 save = data_read; 615 save = data_read;
589 if (data_read) 616 if (data_read)
590 data_written = data_read & 0xDEADBEEF; 617 data_written = data_read & NETXEN_NIC_INVALID_DATA;
591 else 618 else
592 data_written = 0xDEADBEEF; 619 data_written = NETXEN_NIC_INVALID_DATA;
593 netxen_nic_write_w0(adapter, 620 netxen_nic_write_w0(adapter,
594 NETXEN_NIU_GB_INTERFACE_STATUS(port-> 621 NETXEN_NIU_GB_INTERFACE_STATUS(port->
595 portnum), 622 portnum),