Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2003 - 2006 NetXen, Inc. |
| 3 | * All rights reserved. |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 4 | * |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 9 | * |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 14 | * |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
| 18 | * MA 02111-1307, USA. |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 19 | * |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 20 | * The full GNU General Public License is included in this distribution |
| 21 | * in the file called LICENSE. |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 22 | * |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 23 | * Contact Information: |
| 24 | * info@netxen.com |
| 25 | * NetXen, |
| 26 | * 3965 Freedom Circle, Fourth floor, |
| 27 | * Santa Clara, CA 95054 |
| 28 | * |
| 29 | * |
| 30 | * ethtool support for netxen nic |
| 31 | * |
| 32 | */ |
| 33 | |
| 34 | #include <linux/types.h> |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 35 | #include <linux/delay.h> |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 36 | #include <asm/uaccess.h> |
| 37 | #include <linux/pci.h> |
| 38 | #include <asm/io.h> |
| 39 | #include <linux/netdevice.h> |
| 40 | #include <linux/ethtool.h> |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 41 | |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 42 | #include "netxen_nic.h" |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 43 | #include "netxen_nic_hw.h" |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 44 | #include "netxen_nic_phan_reg.h" |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 45 | |
| 46 | struct netxen_nic_stats { |
| 47 | char stat_string[ETH_GSTRING_LEN]; |
| 48 | int sizeof_stat; |
| 49 | int stat_offset; |
| 50 | }; |
| 51 | |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 52 | #define NETXEN_NIC_STAT(m) sizeof(((struct netxen_adapter *)0)->m), \ |
| 53 | offsetof(struct netxen_adapter, m) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 54 | |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 55 | #define NETXEN_NIC_PORT_WINDOW 0x10000 |
| 56 | #define NETXEN_NIC_INVALID_DATA 0xDEADBEEF |
| 57 | |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 58 | static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = { |
| 59 | {"rcvd_bad_skb", NETXEN_NIC_STAT(stats.rcvdbadskb)}, |
| 60 | {"xmit_called", NETXEN_NIC_STAT(stats.xmitcalled)}, |
| 61 | {"xmited_frames", NETXEN_NIC_STAT(stats.xmitedframes)}, |
| 62 | {"xmit_finished", NETXEN_NIC_STAT(stats.xmitfinished)}, |
| 63 | {"bad_skb_len", NETXEN_NIC_STAT(stats.badskblen)}, |
| 64 | {"no_cmd_desc", NETXEN_NIC_STAT(stats.nocmddescriptor)}, |
| 65 | {"polled", NETXEN_NIC_STAT(stats.polled)}, |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 66 | {"tx_dropped", NETXEN_NIC_STAT(stats.txdropped)}, |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 67 | {"csummed", NETXEN_NIC_STAT(stats.csummed)}, |
| 68 | {"no_rcv", NETXEN_NIC_STAT(stats.no_rcv)}, |
| 69 | {"rx_bytes", NETXEN_NIC_STAT(stats.rxbytes)}, |
| 70 | {"tx_bytes", NETXEN_NIC_STAT(stats.txbytes)}, |
| 71 | }; |
| 72 | |
Stephen Hemminger | 92104e9 | 2006-12-15 07:57:08 -0800 | [diff] [blame] | 73 | #define NETXEN_NIC_STATS_LEN ARRAY_SIZE(netxen_nic_gstrings_stats) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 74 | |
| 75 | static const char netxen_nic_gstrings_test[][ETH_GSTRING_LEN] = { |
Linsys Contractor Mithlesh Thukral | 0c25cfe | 2007-02-28 05:14:07 -0800 | [diff] [blame] | 76 | "Register_Test_on_offline", |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 77 | "Link_Test_on_offline" |
| 78 | }; |
| 79 | |
Alejandro Martinez Ruiz | 4c3616c | 2007-10-18 10:00:15 +0200 | [diff] [blame] | 80 | #define NETXEN_NIC_TEST_LEN ARRAY_SIZE(netxen_nic_gstrings_test) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 81 | |
| 82 | #define NETXEN_NIC_REGS_COUNT 42 |
| 83 | #define NETXEN_NIC_REGS_LEN (NETXEN_NIC_REGS_COUNT * sizeof(__le32)) |
| 84 | #define NETXEN_MAX_EEPROM_LEN 1024 |
| 85 | |
| 86 | static int netxen_nic_get_eeprom_len(struct net_device *dev) |
| 87 | { |
Mithlesh Thukral | 0d04761 | 2007-06-07 04:36:36 -0700 | [diff] [blame] | 88 | return NETXEN_FLASH_TOTAL_SIZE; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | static void |
| 92 | netxen_nic_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo) |
| 93 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 94 | struct netxen_adapter *adapter = netdev_priv(dev); |
Dhananjay Phadke | 3ce06a3 | 2008-07-21 19:44:03 -0700 | [diff] [blame] | 95 | unsigned long flags; |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 96 | u32 fw_major = 0; |
| 97 | u32 fw_minor = 0; |
| 98 | u32 fw_build = 0; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 99 | |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 100 | strncpy(drvinfo->driver, netxen_nic_driver_name, 32); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 101 | strncpy(drvinfo->version, NETXEN_NIC_LINUX_VERSIONID, 32); |
Dhananjay Phadke | 3ce06a3 | 2008-07-21 19:44:03 -0700 | [diff] [blame] | 102 | write_lock_irqsave(&adapter->adapter_lock, flags); |
| 103 | fw_major = adapter->pci_read_normalize(adapter, |
| 104 | NETXEN_FW_VERSION_MAJOR); |
| 105 | fw_minor = adapter->pci_read_normalize(adapter, |
| 106 | NETXEN_FW_VERSION_MINOR); |
| 107 | fw_build = adapter->pci_read_normalize(adapter, |
| 108 | NETXEN_FW_VERSION_SUB); |
| 109 | write_unlock_irqrestore(&adapter->adapter_lock, flags); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 110 | sprintf(drvinfo->fw_version, "%d.%d.%d", fw_major, fw_minor, fw_build); |
| 111 | |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 112 | strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 113 | drvinfo->regdump_len = NETXEN_NIC_REGS_LEN; |
| 114 | drvinfo->eedump_len = netxen_nic_get_eeprom_len(dev); |
| 115 | } |
| 116 | |
| 117 | static int |
| 118 | netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) |
| 119 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 120 | struct netxen_adapter *adapter = netdev_priv(dev); |
Amit S. Kale | 71bd787 | 2006-12-01 05:36:22 -0800 | [diff] [blame] | 121 | struct netxen_board_info *boardinfo = &adapter->ahw.boardcfg; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 122 | |
| 123 | /* read which mode */ |
| 124 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
| 125 | ecmd->supported = (SUPPORTED_10baseT_Half | |
| 126 | SUPPORTED_10baseT_Full | |
| 127 | SUPPORTED_100baseT_Half | |
| 128 | SUPPORTED_100baseT_Full | |
| 129 | SUPPORTED_1000baseT_Half | |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 130 | SUPPORTED_1000baseT_Full); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 131 | |
| 132 | ecmd->advertising = (ADVERTISED_100baseT_Half | |
| 133 | ADVERTISED_100baseT_Full | |
| 134 | ADVERTISED_1000baseT_Half | |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 135 | ADVERTISED_1000baseT_Full); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 136 | |
| 137 | ecmd->port = PORT_TP; |
| 138 | |
Dhananjay Phadke | c7860a2 | 2009-01-14 20:48:32 -0800 | [diff] [blame] | 139 | ecmd->speed = adapter->link_speed; |
| 140 | ecmd->duplex = adapter->link_duplex; |
| 141 | ecmd->autoneg = adapter->link_autoneg; |
Dhananjay Phadke | 24a7a45 | 2008-08-01 03:14:55 -0700 | [diff] [blame] | 142 | |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 143 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { |
Dhananjay Phadke | 24a7a45 | 2008-08-01 03:14:55 -0700 | [diff] [blame] | 144 | u32 val; |
| 145 | |
| 146 | adapter->hw_read_wx(adapter, NETXEN_PORT_MODE_ADDR, &val, 4); |
| 147 | if (val == NETXEN_PORT_MODE_802_3_AP) { |
| 148 | ecmd->supported = SUPPORTED_1000baseT_Full; |
| 149 | ecmd->advertising = ADVERTISED_1000baseT_Full; |
| 150 | } else { |
| 151 | ecmd->supported = SUPPORTED_10000baseT_Full; |
| 152 | ecmd->advertising = ADVERTISED_10000baseT_Full; |
| 153 | } |
| 154 | |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 155 | ecmd->port = PORT_TP; |
| 156 | |
Dhananjay Phadke | 24a7a45 | 2008-08-01 03:14:55 -0700 | [diff] [blame] | 157 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { |
| 158 | u16 pcifn = adapter->ahw.pci_func; |
| 159 | |
| 160 | adapter->hw_read_wx(adapter, |
| 161 | P3_LINK_SPEED_REG(pcifn), &val, 4); |
| 162 | ecmd->speed = P3_LINK_SPEED_MHZ * |
| 163 | P3_LINK_SPEED_VAL(pcifn, val); |
| 164 | } else |
| 165 | ecmd->speed = SPEED_10000; |
| 166 | |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 167 | ecmd->duplex = DUPLEX_FULL; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 168 | ecmd->autoneg = AUTONEG_DISABLE; |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 169 | } else |
| 170 | return -EIO; |
| 171 | |
Dhananjay Phadke | c7860a2 | 2009-01-14 20:48:32 -0800 | [diff] [blame] | 172 | ecmd->phy_address = adapter->physical_port; |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 173 | ecmd->transceiver = XCVR_EXTERNAL; |
| 174 | |
| 175 | switch ((netxen_brdtype_t) boardinfo->board_type) { |
| 176 | case NETXEN_BRDTYPE_P2_SB35_4G: |
| 177 | case NETXEN_BRDTYPE_P2_SB31_2G: |
Dhananjay Phadke | e4c93c8 | 2008-07-21 19:44:02 -0700 | [diff] [blame] | 178 | case NETXEN_BRDTYPE_P3_REF_QG: |
| 179 | case NETXEN_BRDTYPE_P3_4_GB: |
| 180 | case NETXEN_BRDTYPE_P3_4_GB_MM: |
Dhananjay Phadke | e4c93c8 | 2008-07-21 19:44:02 -0700 | [diff] [blame] | 181 | |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 182 | ecmd->supported |= SUPPORTED_Autoneg; |
| 183 | ecmd->advertising |= ADVERTISED_Autoneg; |
| 184 | case NETXEN_BRDTYPE_P2_SB31_10G_CX4: |
Dhananjay Phadke | e4c93c8 | 2008-07-21 19:44:02 -0700 | [diff] [blame] | 185 | case NETXEN_BRDTYPE_P3_10G_CX4: |
| 186 | case NETXEN_BRDTYPE_P3_10G_CX4_LP: |
Dhananjay Phadke | c7860a2 | 2009-01-14 20:48:32 -0800 | [diff] [blame] | 187 | case NETXEN_BRDTYPE_P3_10000_BASE_T: |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 188 | ecmd->supported |= SUPPORTED_TP; |
| 189 | ecmd->advertising |= ADVERTISED_TP; |
| 190 | ecmd->port = PORT_TP; |
| 191 | ecmd->autoneg = (boardinfo->board_type == |
| 192 | NETXEN_BRDTYPE_P2_SB31_10G_CX4) ? |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 193 | (AUTONEG_DISABLE) : (adapter->link_autoneg); |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 194 | break; |
| 195 | case NETXEN_BRDTYPE_P2_SB31_10G_HMEZ: |
| 196 | case NETXEN_BRDTYPE_P2_SB31_10G_IMEZ: |
Dhananjay Phadke | e4c93c8 | 2008-07-21 19:44:02 -0700 | [diff] [blame] | 197 | case NETXEN_BRDTYPE_P3_IMEZ: |
| 198 | case NETXEN_BRDTYPE_P3_XG_LOM: |
| 199 | case NETXEN_BRDTYPE_P3_HMEZ: |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 200 | ecmd->supported |= SUPPORTED_MII; |
| 201 | ecmd->advertising |= ADVERTISED_MII; |
| 202 | ecmd->port = PORT_FIBRE; |
| 203 | ecmd->autoneg = AUTONEG_DISABLE; |
| 204 | break; |
Dhananjay Phadke | e4c93c8 | 2008-07-21 19:44:02 -0700 | [diff] [blame] | 205 | case NETXEN_BRDTYPE_P3_10G_SFP_PLUS: |
Dhananjay Phadke | a70f939 | 2008-08-01 03:14:56 -0700 | [diff] [blame] | 206 | case NETXEN_BRDTYPE_P3_10G_SFP_CT: |
| 207 | case NETXEN_BRDTYPE_P3_10G_SFP_QT: |
Dhananjay Phadke | c7860a2 | 2009-01-14 20:48:32 -0800 | [diff] [blame] | 208 | ecmd->advertising |= ADVERTISED_TP; |
| 209 | ecmd->supported |= SUPPORTED_TP; |
| 210 | case NETXEN_BRDTYPE_P2_SB31_10G: |
Dhananjay Phadke | e4c93c8 | 2008-07-21 19:44:02 -0700 | [diff] [blame] | 211 | case NETXEN_BRDTYPE_P3_10G_XFP: |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 212 | ecmd->supported |= SUPPORTED_FIBRE; |
| 213 | ecmd->advertising |= ADVERTISED_FIBRE; |
| 214 | ecmd->port = PORT_FIBRE; |
| 215 | ecmd->autoneg = AUTONEG_DISABLE; |
| 216 | break; |
Dhananjay Phadke | c7860a2 | 2009-01-14 20:48:32 -0800 | [diff] [blame] | 217 | case NETXEN_BRDTYPE_P3_10G_TP: |
| 218 | if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { |
| 219 | ecmd->autoneg = AUTONEG_DISABLE; |
| 220 | ecmd->supported |= (SUPPORTED_FIBRE | SUPPORTED_TP); |
| 221 | ecmd->advertising |= |
| 222 | (ADVERTISED_FIBRE | ADVERTISED_TP); |
| 223 | ecmd->port = PORT_FIBRE; |
| 224 | } else { |
| 225 | ecmd->autoneg = AUTONEG_ENABLE; |
| 226 | ecmd->supported |= (SUPPORTED_TP |SUPPORTED_Autoneg); |
| 227 | ecmd->advertising |= |
| 228 | (ADVERTISED_TP | ADVERTISED_Autoneg); |
| 229 | ecmd->port = PORT_TP; |
| 230 | } |
| 231 | break; |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 232 | default: |
Amit S. Kale | 71bd787 | 2006-12-01 05:36:22 -0800 | [diff] [blame] | 233 | printk(KERN_ERR "netxen-nic: Unsupported board model %d\n", |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 234 | (netxen_brdtype_t) boardinfo->board_type); |
| 235 | return -EIO; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 236 | } |
| 237 | |
Amit S. Kale | cb8011a | 2006-11-29 09:00:10 -0800 | [diff] [blame] | 238 | return 0; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 239 | } |
| 240 | |
| 241 | static int |
| 242 | netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) |
| 243 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 244 | struct netxen_adapter *adapter = netdev_priv(dev); |
Al Viro | a608ab9 | 2007-01-02 10:39:10 +0000 | [diff] [blame] | 245 | __u32 status; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 246 | |
| 247 | /* read which mode */ |
| 248 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
| 249 | /* autonegotiation */ |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 250 | if (adapter->phy_write |
Mithlesh Thukral | 13ba9c7 | 2007-04-20 07:53:05 -0700 | [diff] [blame] | 251 | && adapter->phy_write(adapter, |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 252 | NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, |
Al Viro | a608ab9 | 2007-01-02 10:39:10 +0000 | [diff] [blame] | 253 | ecmd->autoneg) != 0) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 254 | return -EIO; |
| 255 | else |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 256 | adapter->link_autoneg = ecmd->autoneg; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 257 | |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 258 | if (adapter->phy_read |
Mithlesh Thukral | 13ba9c7 | 2007-04-20 07:53:05 -0700 | [diff] [blame] | 259 | && adapter->phy_read(adapter, |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 260 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
| 261 | &status) != 0) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 262 | return -EIO; |
| 263 | |
| 264 | /* speed */ |
| 265 | switch (ecmd->speed) { |
| 266 | case SPEED_10: |
| 267 | netxen_set_phy_speed(status, 0); |
| 268 | break; |
| 269 | case SPEED_100: |
| 270 | netxen_set_phy_speed(status, 1); |
| 271 | break; |
| 272 | case SPEED_1000: |
| 273 | netxen_set_phy_speed(status, 2); |
| 274 | break; |
| 275 | } |
| 276 | /* set duplex mode */ |
| 277 | if (ecmd->duplex == DUPLEX_HALF) |
| 278 | netxen_clear_phy_duplex(status); |
| 279 | if (ecmd->duplex == DUPLEX_FULL) |
| 280 | netxen_set_phy_duplex(status); |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 281 | if (adapter->phy_write |
Mithlesh Thukral | 13ba9c7 | 2007-04-20 07:53:05 -0700 | [diff] [blame] | 282 | && adapter->phy_write(adapter, |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 283 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
| 284 | *((int *)&status)) != 0) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 285 | return -EIO; |
| 286 | else { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 287 | adapter->link_speed = ecmd->speed; |
| 288 | adapter->link_duplex = ecmd->duplex; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 289 | } |
| 290 | } else |
| 291 | return -EOPNOTSUPP; |
| 292 | |
Stephen Hemminger | 1abd266 | 2008-11-21 17:32:15 -0800 | [diff] [blame] | 293 | if (!netif_running(dev)) |
| 294 | return 0; |
| 295 | |
| 296 | dev->netdev_ops->ndo_stop(dev); |
| 297 | return dev->netdev_ops->ndo_open(dev); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | static int netxen_nic_get_regs_len(struct net_device *dev) |
| 301 | { |
| 302 | return NETXEN_NIC_REGS_LEN; |
| 303 | } |
| 304 | |
| 305 | struct netxen_niu_regs { |
Al Viro | a608ab9 | 2007-01-02 10:39:10 +0000 | [diff] [blame] | 306 | __u32 reg[NETXEN_NIC_REGS_COUNT]; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 307 | }; |
| 308 | |
| 309 | static struct netxen_niu_regs niu_registers[] = { |
| 310 | { |
| 311 | /* GB Mode */ |
| 312 | { |
| 313 | NETXEN_NIU_GB_SERDES_RESET, |
| 314 | NETXEN_NIU_GB0_MII_MODE, |
| 315 | NETXEN_NIU_GB1_MII_MODE, |
| 316 | NETXEN_NIU_GB2_MII_MODE, |
| 317 | NETXEN_NIU_GB3_MII_MODE, |
| 318 | NETXEN_NIU_GB0_GMII_MODE, |
| 319 | NETXEN_NIU_GB1_GMII_MODE, |
| 320 | NETXEN_NIU_GB2_GMII_MODE, |
| 321 | NETXEN_NIU_GB3_GMII_MODE, |
| 322 | NETXEN_NIU_REMOTE_LOOPBACK, |
| 323 | NETXEN_NIU_GB0_HALF_DUPLEX, |
| 324 | NETXEN_NIU_GB1_HALF_DUPLEX, |
| 325 | NETXEN_NIU_RESET_SYS_FIFOS, |
| 326 | NETXEN_NIU_GB_CRC_DROP, |
| 327 | NETXEN_NIU_GB_DROP_WRONGADDR, |
| 328 | NETXEN_NIU_TEST_MUX_CTL, |
| 329 | |
| 330 | NETXEN_NIU_GB_MAC_CONFIG_0(0), |
| 331 | NETXEN_NIU_GB_MAC_CONFIG_1(0), |
| 332 | NETXEN_NIU_GB_HALF_DUPLEX_CTRL(0), |
| 333 | NETXEN_NIU_GB_MAX_FRAME_SIZE(0), |
| 334 | NETXEN_NIU_GB_TEST_REG(0), |
| 335 | NETXEN_NIU_GB_MII_MGMT_CONFIG(0), |
| 336 | NETXEN_NIU_GB_MII_MGMT_COMMAND(0), |
| 337 | NETXEN_NIU_GB_MII_MGMT_ADDR(0), |
| 338 | NETXEN_NIU_GB_MII_MGMT_CTRL(0), |
| 339 | NETXEN_NIU_GB_MII_MGMT_STATUS(0), |
| 340 | NETXEN_NIU_GB_MII_MGMT_INDICATE(0), |
| 341 | NETXEN_NIU_GB_INTERFACE_CTRL(0), |
| 342 | NETXEN_NIU_GB_INTERFACE_STATUS(0), |
| 343 | NETXEN_NIU_GB_STATION_ADDR_0(0), |
| 344 | NETXEN_NIU_GB_STATION_ADDR_1(0), |
| 345 | -1, |
| 346 | } |
| 347 | }, |
| 348 | { |
| 349 | /* XG Mode */ |
| 350 | { |
| 351 | NETXEN_NIU_XG_SINGLE_TERM, |
| 352 | NETXEN_NIU_XG_DRIVE_HI, |
| 353 | NETXEN_NIU_XG_DRIVE_LO, |
| 354 | NETXEN_NIU_XG_DTX, |
| 355 | NETXEN_NIU_XG_DEQ, |
| 356 | NETXEN_NIU_XG_WORD_ALIGN, |
| 357 | NETXEN_NIU_XG_RESET, |
| 358 | NETXEN_NIU_XG_POWER_DOWN, |
| 359 | NETXEN_NIU_XG_RESET_PLL, |
| 360 | NETXEN_NIU_XG_SERDES_LOOPBACK, |
| 361 | NETXEN_NIU_XG_DO_BYTE_ALIGN, |
| 362 | NETXEN_NIU_XG_TX_ENABLE, |
| 363 | NETXEN_NIU_XG_RX_ENABLE, |
| 364 | NETXEN_NIU_XG_STATUS, |
| 365 | NETXEN_NIU_XG_PAUSE_THRESHOLD, |
| 366 | NETXEN_NIU_XGE_CONFIG_0, |
| 367 | NETXEN_NIU_XGE_CONFIG_1, |
| 368 | NETXEN_NIU_XGE_IPG, |
| 369 | NETXEN_NIU_XGE_STATION_ADDR_0_HI, |
| 370 | NETXEN_NIU_XGE_STATION_ADDR_0_1, |
| 371 | NETXEN_NIU_XGE_STATION_ADDR_1_LO, |
| 372 | NETXEN_NIU_XGE_STATUS, |
| 373 | NETXEN_NIU_XGE_MAX_FRAME_SIZE, |
| 374 | NETXEN_NIU_XGE_PAUSE_FRAME_VALUE, |
| 375 | NETXEN_NIU_XGE_TX_BYTE_CNT, |
| 376 | NETXEN_NIU_XGE_TX_FRAME_CNT, |
| 377 | NETXEN_NIU_XGE_RX_BYTE_CNT, |
| 378 | NETXEN_NIU_XGE_RX_FRAME_CNT, |
| 379 | NETXEN_NIU_XGE_AGGR_ERROR_CNT, |
| 380 | NETXEN_NIU_XGE_MULTICAST_FRAME_CNT, |
| 381 | NETXEN_NIU_XGE_UNICAST_FRAME_CNT, |
| 382 | NETXEN_NIU_XGE_CRC_ERROR_CNT, |
| 383 | NETXEN_NIU_XGE_OVERSIZE_FRAME_ERR, |
| 384 | NETXEN_NIU_XGE_UNDERSIZE_FRAME_ERR, |
| 385 | NETXEN_NIU_XGE_LOCAL_ERROR_CNT, |
| 386 | NETXEN_NIU_XGE_REMOTE_ERROR_CNT, |
| 387 | NETXEN_NIU_XGE_CONTROL_CHAR_CNT, |
| 388 | NETXEN_NIU_XGE_PAUSE_FRAME_CNT, |
| 389 | -1, |
| 390 | } |
| 391 | } |
| 392 | }; |
| 393 | |
| 394 | static void |
| 395 | netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p) |
| 396 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 397 | struct netxen_adapter *adapter = netdev_priv(dev); |
Al Viro | a608ab9 | 2007-01-02 10:39:10 +0000 | [diff] [blame] | 398 | __u32 mode, *regs_buff = p; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 399 | int i, window; |
| 400 | |
| 401 | memset(p, 0, NETXEN_NIC_REGS_LEN); |
| 402 | regs->version = (1 << 24) | (adapter->ahw.revision_id << 16) | |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 403 | (adapter->pdev)->device; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 404 | /* which mode */ |
Dhananjay Phadke | 3ce06a3 | 2008-07-21 19:44:03 -0700 | [diff] [blame] | 405 | adapter->hw_read_wx(adapter, NETXEN_NIU_MODE, ®s_buff[0], 4); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 406 | mode = regs_buff[0]; |
| 407 | |
| 408 | /* Common registers to all the modes */ |
Dhananjay Phadke | 3ce06a3 | 2008-07-21 19:44:03 -0700 | [diff] [blame] | 409 | adapter->hw_read_wx(adapter, |
| 410 | NETXEN_NIU_STRAP_VALUE_SAVE_HIGHER, ®s_buff[2], 4); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 411 | /* GB/XGB Mode */ |
| 412 | mode = (mode / 2) - 1; |
| 413 | window = 0; |
| 414 | if (mode <= 1) { |
| 415 | for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) { |
| 416 | /* GB: port specific registers */ |
| 417 | if (mode == 0 && i >= 19) |
Dhananjay Phadke | 3276fba | 2008-06-15 22:59:44 -0700 | [diff] [blame] | 418 | window = adapter->physical_port * |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 419 | NETXEN_NIC_PORT_WINDOW; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 420 | |
Dhananjay Phadke | 3ce06a3 | 2008-07-21 19:44:03 -0700 | [diff] [blame] | 421 | adapter->hw_read_wx(adapter, |
| 422 | niu_registers[mode].reg[i - 3] + window, |
| 423 | ®s_buff[i], 4); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 424 | } |
| 425 | |
| 426 | } |
| 427 | } |
| 428 | |
Amit S. Kale | e45d9ab | 2007-02-09 05:49:08 -0800 | [diff] [blame] | 429 | static u32 netxen_nic_test_link(struct net_device *dev) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 430 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 431 | struct netxen_adapter *adapter = netdev_priv(dev); |
Al Viro | a608ab9 | 2007-01-02 10:39:10 +0000 | [diff] [blame] | 432 | __u32 status; |
Linsys Contractor Mithlesh Thukral | 0c25cfe | 2007-02-28 05:14:07 -0800 | [diff] [blame] | 433 | int val; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 434 | |
| 435 | /* read which mode */ |
| 436 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 437 | if (adapter->phy_read |
Mithlesh Thukral | 13ba9c7 | 2007-04-20 07:53:05 -0700 | [diff] [blame] | 438 | && adapter->phy_read(adapter, |
Amit S. Kale | 80922fb | 2006-12-04 09:18:00 -0800 | [diff] [blame] | 439 | NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, |
| 440 | &status) != 0) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 441 | return -EIO; |
Linsys Contractor Mithlesh Thukral | 0c25cfe | 2007-02-28 05:14:07 -0800 | [diff] [blame] | 442 | else { |
| 443 | val = netxen_get_phy_link(status); |
| 444 | return !val; |
| 445 | } |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 446 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { |
Dhananjay Phadke | 3ce06a3 | 2008-07-21 19:44:03 -0700 | [diff] [blame] | 447 | val = adapter->pci_read_normalize(adapter, CRB_XG_STATE); |
Linsys Contractor Mithlesh Thukral | 0c25cfe | 2007-02-28 05:14:07 -0800 | [diff] [blame] | 448 | return (val == XG_LINK_UP) ? 0 : 1; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 449 | } |
| 450 | return -EIO; |
| 451 | } |
| 452 | |
| 453 | static int |
| 454 | netxen_nic_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, |
| 455 | u8 * bytes) |
| 456 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 457 | struct netxen_adapter *adapter = netdev_priv(dev); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 458 | int offset; |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 459 | int ret; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 460 | |
| 461 | if (eeprom->len == 0) |
| 462 | return -EINVAL; |
| 463 | |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 464 | eeprom->magic = (adapter->pdev)->vendor | |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 465 | ((adapter->pdev)->device << 16); |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 466 | offset = eeprom->offset; |
| 467 | |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 468 | ret = netxen_rom_fast_read_words(adapter, offset, bytes, |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 469 | eeprom->len); |
| 470 | if (ret < 0) |
| 471 | return ret; |
| 472 | |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 473 | return 0; |
| 474 | } |
| 475 | |
Dhananjay Phadke | 7830b22 | 2008-07-21 19:44:00 -0700 | [diff] [blame] | 476 | #if 0 |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 477 | static int |
| 478 | netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, |
| 479 | u8 * bytes) |
| 480 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 481 | struct netxen_adapter *adapter = netdev_priv(dev); |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 482 | int offset = eeprom->offset; |
| 483 | static int flash_start; |
| 484 | static int ready_to_flash; |
| 485 | int ret; |
| 486 | |
| 487 | if (flash_start == 0) { |
Amit S. Kale | e45d9ab | 2007-02-09 05:49:08 -0800 | [diff] [blame] | 488 | netxen_halt_pegs(adapter); |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 489 | ret = netxen_flash_unlock(adapter); |
| 490 | if (ret < 0) { |
| 491 | printk(KERN_ERR "%s: Flash unlock failed.\n", |
| 492 | netxen_nic_driver_name); |
| 493 | return ret; |
| 494 | } |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 495 | printk(KERN_INFO "%s: flash unlocked. \n", |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 496 | netxen_nic_driver_name); |
| 497 | ret = netxen_flash_erase_secondary(adapter); |
| 498 | if (ret != FLASH_SUCCESS) { |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 499 | printk(KERN_ERR "%s: Flash erase failed.\n", |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 500 | netxen_nic_driver_name); |
| 501 | return ret; |
| 502 | } |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 503 | printk(KERN_INFO "%s: secondary flash erased successfully.\n", |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 504 | netxen_nic_driver_name); |
| 505 | flash_start = 1; |
| 506 | return 0; |
| 507 | } |
| 508 | |
Mithlesh Thukral | 0d04761 | 2007-06-07 04:36:36 -0700 | [diff] [blame] | 509 | if (offset == NETXEN_BOOTLD_START) { |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 510 | ret = netxen_flash_erase_primary(adapter); |
| 511 | if (ret != FLASH_SUCCESS) { |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 512 | printk(KERN_ERR "%s: Flash erase failed.\n", |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 513 | netxen_nic_driver_name); |
| 514 | return ret; |
| 515 | } |
| 516 | |
Mithlesh Thukral | 0d04761 | 2007-06-07 04:36:36 -0700 | [diff] [blame] | 517 | ret = netxen_rom_se(adapter, NETXEN_USER_START); |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 518 | if (ret != FLASH_SUCCESS) |
| 519 | return ret; |
Mithlesh Thukral | 0d04761 | 2007-06-07 04:36:36 -0700 | [diff] [blame] | 520 | ret = netxen_rom_se(adapter, NETXEN_FIXED_START); |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 521 | if (ret != FLASH_SUCCESS) |
| 522 | return ret; |
| 523 | |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 524 | printk(KERN_INFO "%s: primary flash erased successfully\n", |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 525 | netxen_nic_driver_name); |
| 526 | |
| 527 | ret = netxen_backup_crbinit(adapter); |
| 528 | if (ret != FLASH_SUCCESS) { |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 529 | printk(KERN_ERR "%s: CRBinit backup failed.\n", |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 530 | netxen_nic_driver_name); |
| 531 | return ret; |
| 532 | } |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 533 | printk(KERN_INFO "%s: CRBinit backup done.\n", |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 534 | netxen_nic_driver_name); |
| 535 | ready_to_flash = 1; |
| 536 | } |
| 537 | |
| 538 | if (!ready_to_flash) { |
| 539 | printk(KERN_ERR "%s: Invalid write sequence, returning...\n", |
| 540 | netxen_nic_driver_name); |
| 541 | return -EINVAL; |
| 542 | } |
| 543 | |
| 544 | return netxen_rom_fast_write_words(adapter, offset, bytes, eeprom->len); |
| 545 | } |
Dhananjay Phadke | 7830b22 | 2008-07-21 19:44:00 -0700 | [diff] [blame] | 546 | #endif /* 0 */ |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 547 | |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 548 | static void |
| 549 | netxen_nic_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) |
| 550 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 551 | struct netxen_adapter *adapter = netdev_priv(dev); |
Amit S. Kale | ed25ffa | 2006-12-04 09:23:25 -0800 | [diff] [blame] | 552 | int i; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 553 | |
| 554 | ring->rx_pending = 0; |
Amit S. Kale | ed25ffa | 2006-12-04 09:23:25 -0800 | [diff] [blame] | 555 | ring->rx_jumbo_pending = 0; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 556 | for (i = 0; i < MAX_RCV_CTX; ++i) { |
Amit S. Kale | ed25ffa | 2006-12-04 09:23:25 -0800 | [diff] [blame] | 557 | ring->rx_pending += adapter->recv_ctx[i]. |
Dhananjay Phadke | 48bfd1e | 2008-07-21 19:44:06 -0700 | [diff] [blame] | 558 | rds_rings[RCV_DESC_NORMAL_CTXID].max_rx_desc_count; |
Amit S. Kale | ed25ffa | 2006-12-04 09:23:25 -0800 | [diff] [blame] | 559 | ring->rx_jumbo_pending += adapter->recv_ctx[i]. |
Dhananjay Phadke | 48bfd1e | 2008-07-21 19:44:06 -0700 | [diff] [blame] | 560 | rds_rings[RCV_DESC_JUMBO_CTXID].max_rx_desc_count; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 561 | } |
Dhananjay Phadke | 200eef2 | 2007-09-03 10:33:35 +0530 | [diff] [blame] | 562 | ring->tx_pending = adapter->max_tx_desc_count; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 563 | |
Dhananjay Phadke | 200eef2 | 2007-09-03 10:33:35 +0530 | [diff] [blame] | 564 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS; |
| 565 | ring->tx_max_pending = MAX_CMD_DESCRIPTORS_HOST; |
| 566 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 567 | ring->rx_mini_max_pending = 0; |
| 568 | ring->rx_mini_pending = 0; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 569 | } |
| 570 | |
| 571 | static void |
| 572 | netxen_nic_get_pauseparam(struct net_device *dev, |
| 573 | struct ethtool_pauseparam *pause) |
| 574 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 575 | struct netxen_adapter *adapter = netdev_priv(dev); |
Al Viro | a608ab9 | 2007-01-02 10:39:10 +0000 | [diff] [blame] | 576 | __u32 val; |
Dhananjay Phadke | 3276fba | 2008-06-15 22:59:44 -0700 | [diff] [blame] | 577 | int port = adapter->physical_port; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 578 | |
| 579 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 580 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
| 581 | return; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 582 | /* get flow control settings */ |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 583 | netxen_nic_read_w0(adapter,NETXEN_NIU_GB_MAC_CONFIG_0(port), |
| 584 | &val); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 585 | pause->rx_pause = netxen_gb_get_rx_flowctl(val); |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 586 | netxen_nic_read_w0(adapter, NETXEN_NIU_GB_PAUSE_CTL, &val); |
| 587 | switch (port) { |
| 588 | case 0: |
| 589 | pause->tx_pause = !(netxen_gb_get_gb0_mask(val)); |
| 590 | break; |
| 591 | case 1: |
| 592 | pause->tx_pause = !(netxen_gb_get_gb1_mask(val)); |
| 593 | break; |
| 594 | case 2: |
| 595 | pause->tx_pause = !(netxen_gb_get_gb2_mask(val)); |
| 596 | break; |
| 597 | case 3: |
| 598 | default: |
| 599 | pause->tx_pause = !(netxen_gb_get_gb3_mask(val)); |
| 600 | break; |
| 601 | } |
| 602 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { |
| 603 | if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS)) |
| 604 | return; |
| 605 | pause->rx_pause = 1; |
| 606 | netxen_nic_read_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, &val); |
| 607 | if (port == 0) |
| 608 | pause->tx_pause = !(netxen_xg_get_xg0_mask(val)); |
| 609 | else |
| 610 | pause->tx_pause = !(netxen_xg_get_xg1_mask(val)); |
| 611 | } else { |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 612 | printk(KERN_ERR"%s: Unknown board type: %x\n", |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 613 | netxen_nic_driver_name, adapter->ahw.board_type); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 614 | } |
| 615 | } |
| 616 | |
| 617 | static int |
| 618 | netxen_nic_set_pauseparam(struct net_device *dev, |
| 619 | struct ethtool_pauseparam *pause) |
| 620 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 621 | struct netxen_adapter *adapter = netdev_priv(dev); |
Al Viro | a608ab9 | 2007-01-02 10:39:10 +0000 | [diff] [blame] | 622 | __u32 val; |
Dhananjay Phadke | 3276fba | 2008-06-15 22:59:44 -0700 | [diff] [blame] | 623 | int port = adapter->physical_port; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 624 | /* read mode */ |
| 625 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 626 | if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) |
| 627 | return -EIO; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 628 | /* set flow control */ |
| 629 | netxen_nic_read_w0(adapter, |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 630 | NETXEN_NIU_GB_MAC_CONFIG_0(port), &val); |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 631 | |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 632 | if (pause->rx_pause) |
| 633 | netxen_gb_rx_flowctl(val); |
| 634 | else |
| 635 | netxen_gb_unset_rx_flowctl(val); |
| 636 | |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 637 | netxen_nic_write_w0(adapter, NETXEN_NIU_GB_MAC_CONFIG_0(port), |
| 638 | val); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 639 | /* set autoneg */ |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 640 | netxen_nic_read_w0(adapter, NETXEN_NIU_GB_PAUSE_CTL, &val); |
| 641 | switch (port) { |
| 642 | case 0: |
| 643 | if (pause->tx_pause) |
| 644 | netxen_gb_unset_gb0_mask(val); |
| 645 | else |
| 646 | netxen_gb_set_gb0_mask(val); |
| 647 | break; |
| 648 | case 1: |
| 649 | if (pause->tx_pause) |
| 650 | netxen_gb_unset_gb1_mask(val); |
| 651 | else |
| 652 | netxen_gb_set_gb1_mask(val); |
| 653 | break; |
| 654 | case 2: |
| 655 | if (pause->tx_pause) |
| 656 | netxen_gb_unset_gb2_mask(val); |
| 657 | else |
| 658 | netxen_gb_set_gb2_mask(val); |
| 659 | break; |
| 660 | case 3: |
| 661 | default: |
| 662 | if (pause->tx_pause) |
| 663 | netxen_gb_unset_gb3_mask(val); |
| 664 | else |
| 665 | netxen_gb_set_gb3_mask(val); |
| 666 | break; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 667 | } |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 668 | netxen_nic_write_w0(adapter, NETXEN_NIU_GB_PAUSE_CTL, val); |
| 669 | } else if (adapter->ahw.board_type == NETXEN_NIC_XGBE) { |
| 670 | if ((port < 0) || (port > NETXEN_NIU_MAX_XG_PORTS)) |
| 671 | return -EIO; |
| 672 | netxen_nic_read_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, &val); |
| 673 | if (port == 0) { |
| 674 | if (pause->tx_pause) |
| 675 | netxen_xg_unset_xg0_mask(val); |
| 676 | else |
| 677 | netxen_xg_set_xg0_mask(val); |
| 678 | } else { |
| 679 | if (pause->tx_pause) |
| 680 | netxen_xg_unset_xg1_mask(val); |
| 681 | else |
| 682 | netxen_xg_set_xg1_mask(val); |
| 683 | } |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 684 | netxen_nic_write_w0(adapter, NETXEN_NIU_XG_PAUSE_CTL, val); |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 685 | } else { |
| 686 | printk(KERN_ERR "%s: Unknown board type: %x\n", |
Jeff Garzik | 4790654 | 2007-11-23 21:23:36 -0500 | [diff] [blame] | 687 | netxen_nic_driver_name, |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 688 | adapter->ahw.board_type); |
| 689 | } |
| 690 | return 0; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 691 | } |
| 692 | |
| 693 | static int netxen_nic_reg_test(struct net_device *dev) |
| 694 | { |
Linsys Contractor Mithlesh Thukral | 0c25cfe | 2007-02-28 05:14:07 -0800 | [diff] [blame] | 695 | struct netxen_adapter *adapter = netdev_priv(dev); |
| 696 | u32 data_read, data_written; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 697 | |
Linsys Contractor Mithlesh Thukral | 0c25cfe | 2007-02-28 05:14:07 -0800 | [diff] [blame] | 698 | netxen_nic_read_w0(adapter, NETXEN_PCIX_PH_REG(0), &data_read); |
| 699 | if ((data_read & 0xffff) != PHAN_VENDOR_ID) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 700 | return 1; |
Linsys Contractor Mithlesh Thukral | 0c25cfe | 2007-02-28 05:14:07 -0800 | [diff] [blame] | 701 | |
| 702 | data_written = (u32)0xa5a5a5a5; |
| 703 | |
| 704 | netxen_nic_reg_write(adapter, CRB_SCRATCHPAD_TEST, data_written); |
Dhananjay Phadke | 3ce06a3 | 2008-07-21 19:44:03 -0700 | [diff] [blame] | 705 | data_read = adapter->pci_read_normalize(adapter, CRB_SCRATCHPAD_TEST); |
Linsys Contractor Mithlesh Thukral | 0c25cfe | 2007-02-28 05:14:07 -0800 | [diff] [blame] | 706 | if (data_written != data_read) |
| 707 | return 1; |
| 708 | |
| 709 | return 0; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 710 | } |
| 711 | |
Jeff Garzik | b9f2c04 | 2007-10-03 18:07:32 -0700 | [diff] [blame] | 712 | static int netxen_get_sset_count(struct net_device *dev, int sset) |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 713 | { |
Jeff Garzik | b9f2c04 | 2007-10-03 18:07:32 -0700 | [diff] [blame] | 714 | switch (sset) { |
| 715 | case ETH_SS_TEST: |
| 716 | return NETXEN_NIC_TEST_LEN; |
| 717 | case ETH_SS_STATS: |
| 718 | return NETXEN_NIC_STATS_LEN; |
| 719 | default: |
| 720 | return -EOPNOTSUPP; |
| 721 | } |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | static void |
| 725 | netxen_nic_diag_test(struct net_device *dev, struct ethtool_test *eth_test, |
| 726 | u64 * data) |
| 727 | { |
Mithlesh Thukral | 6c80b18 | 2007-04-20 07:55:26 -0700 | [diff] [blame] | 728 | memset(data, 0, sizeof(uint64_t) * NETXEN_NIC_TEST_LEN); |
| 729 | if ((data[0] = netxen_nic_reg_test(dev))) |
| 730 | eth_test->flags |= ETH_TEST_FL_FAILED; |
| 731 | /* link test */ |
| 732 | if ((data[1] = (u64) netxen_nic_test_link(dev))) |
| 733 | eth_test->flags |= ETH_TEST_FL_FAILED; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 734 | } |
| 735 | |
| 736 | static void |
| 737 | netxen_nic_get_strings(struct net_device *dev, u32 stringset, u8 * data) |
| 738 | { |
| 739 | int index; |
| 740 | |
| 741 | switch (stringset) { |
| 742 | case ETH_SS_TEST: |
| 743 | memcpy(data, *netxen_nic_gstrings_test, |
| 744 | NETXEN_NIC_TEST_LEN * ETH_GSTRING_LEN); |
| 745 | break; |
| 746 | case ETH_SS_STATS: |
| 747 | for (index = 0; index < NETXEN_NIC_STATS_LEN; index++) { |
| 748 | memcpy(data + index * ETH_GSTRING_LEN, |
| 749 | netxen_nic_gstrings_stats[index].stat_string, |
| 750 | ETH_GSTRING_LEN); |
| 751 | } |
| 752 | break; |
| 753 | } |
| 754 | } |
| 755 | |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 756 | static void |
| 757 | netxen_nic_get_ethtool_stats(struct net_device *dev, |
| 758 | struct ethtool_stats *stats, u64 * data) |
| 759 | { |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 760 | struct netxen_adapter *adapter = netdev_priv(dev); |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 761 | int index; |
| 762 | |
| 763 | for (index = 0; index < NETXEN_NIC_STATS_LEN; index++) { |
| 764 | char *p = |
Mithlesh Thukral | 3176ff3 | 2007-04-20 07:52:37 -0700 | [diff] [blame] | 765 | (char *)adapter + |
| 766 | netxen_nic_gstrings_stats[index].stat_offset; |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 767 | data[index] = |
| 768 | (netxen_nic_gstrings_stats[index].sizeof_stat == |
| 769 | sizeof(u64)) ? *(u64 *) p : *(u32 *) p; |
| 770 | } |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 771 | } |
| 772 | |
Dhananjay Phadke | 200eef2 | 2007-09-03 10:33:35 +0530 | [diff] [blame] | 773 | static u32 netxen_nic_get_rx_csum(struct net_device *dev) |
| 774 | { |
| 775 | struct netxen_adapter *adapter = netdev_priv(dev); |
| 776 | return adapter->rx_csum; |
| 777 | } |
| 778 | |
| 779 | static int netxen_nic_set_rx_csum(struct net_device *dev, u32 data) |
| 780 | { |
| 781 | struct netxen_adapter *adapter = netdev_priv(dev); |
| 782 | adapter->rx_csum = !!data; |
| 783 | return 0; |
| 784 | } |
| 785 | |
Dhananjay Phadke | cd1f816 | 2008-07-21 19:44:09 -0700 | [diff] [blame] | 786 | static u32 netxen_nic_get_tso(struct net_device *dev) |
| 787 | { |
| 788 | struct netxen_adapter *adapter = netdev_priv(dev); |
| 789 | |
| 790 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) |
| 791 | return (dev->features & (NETIF_F_TSO | NETIF_F_TSO6)) != 0; |
| 792 | |
| 793 | return (dev->features & NETIF_F_TSO) != 0; |
| 794 | } |
| 795 | |
| 796 | static int netxen_nic_set_tso(struct net_device *dev, u32 data) |
| 797 | { |
| 798 | if (data) { |
| 799 | struct netxen_adapter *adapter = netdev_priv(dev); |
| 800 | |
| 801 | dev->features |= NETIF_F_TSO; |
| 802 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) |
| 803 | dev->features |= NETIF_F_TSO6; |
| 804 | } else |
| 805 | dev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6); |
| 806 | |
| 807 | return 0; |
| 808 | } |
| 809 | |
| 810 | /* |
| 811 | * Set the coalescing parameters. Currently only normal is supported. |
| 812 | * If rx_coalesce_usecs == 0 or rx_max_coalesced_frames == 0 then set the |
| 813 | * firmware coalescing to default. |
| 814 | */ |
| 815 | static int netxen_set_intr_coalesce(struct net_device *netdev, |
| 816 | struct ethtool_coalesce *ethcoal) |
| 817 | { |
| 818 | struct netxen_adapter *adapter = netdev_priv(netdev); |
| 819 | |
| 820 | if (!NX_IS_REVISION_P3(adapter->ahw.revision_id)) |
| 821 | return -EINVAL; |
| 822 | |
| 823 | if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) |
| 824 | return -EINVAL; |
| 825 | |
| 826 | /* |
| 827 | * Return Error if unsupported values or |
| 828 | * unsupported parameters are set. |
| 829 | */ |
| 830 | if (ethcoal->rx_coalesce_usecs > 0xffff || |
| 831 | ethcoal->rx_max_coalesced_frames > 0xffff || |
| 832 | ethcoal->tx_coalesce_usecs > 0xffff || |
| 833 | ethcoal->tx_max_coalesced_frames > 0xffff || |
| 834 | ethcoal->rx_coalesce_usecs_irq || |
| 835 | ethcoal->rx_max_coalesced_frames_irq || |
| 836 | ethcoal->tx_coalesce_usecs_irq || |
| 837 | ethcoal->tx_max_coalesced_frames_irq || |
| 838 | ethcoal->stats_block_coalesce_usecs || |
| 839 | ethcoal->use_adaptive_rx_coalesce || |
| 840 | ethcoal->use_adaptive_tx_coalesce || |
| 841 | ethcoal->pkt_rate_low || |
| 842 | ethcoal->rx_coalesce_usecs_low || |
| 843 | ethcoal->rx_max_coalesced_frames_low || |
| 844 | ethcoal->tx_coalesce_usecs_low || |
| 845 | ethcoal->tx_max_coalesced_frames_low || |
| 846 | ethcoal->pkt_rate_high || |
| 847 | ethcoal->rx_coalesce_usecs_high || |
| 848 | ethcoal->rx_max_coalesced_frames_high || |
| 849 | ethcoal->tx_coalesce_usecs_high || |
| 850 | ethcoal->tx_max_coalesced_frames_high) |
| 851 | return -EINVAL; |
| 852 | |
| 853 | if (!ethcoal->rx_coalesce_usecs || |
| 854 | !ethcoal->rx_max_coalesced_frames) { |
| 855 | adapter->coal.flags = NETXEN_NIC_INTR_DEFAULT; |
| 856 | adapter->coal.normal.data.rx_time_us = |
| 857 | NETXEN_DEFAULT_INTR_COALESCE_RX_TIME_US; |
| 858 | adapter->coal.normal.data.rx_packets = |
| 859 | NETXEN_DEFAULT_INTR_COALESCE_RX_PACKETS; |
| 860 | } else { |
| 861 | adapter->coal.flags = 0; |
| 862 | adapter->coal.normal.data.rx_time_us = |
| 863 | ethcoal->rx_coalesce_usecs; |
| 864 | adapter->coal.normal.data.rx_packets = |
| 865 | ethcoal->rx_max_coalesced_frames; |
| 866 | } |
| 867 | adapter->coal.normal.data.tx_time_us = ethcoal->tx_coalesce_usecs; |
| 868 | adapter->coal.normal.data.tx_packets = |
| 869 | ethcoal->tx_max_coalesced_frames; |
| 870 | |
| 871 | netxen_config_intr_coalesce(adapter); |
| 872 | |
| 873 | return 0; |
| 874 | } |
| 875 | |
| 876 | static int netxen_get_intr_coalesce(struct net_device *netdev, |
| 877 | struct ethtool_coalesce *ethcoal) |
| 878 | { |
| 879 | struct netxen_adapter *adapter = netdev_priv(netdev); |
| 880 | |
| 881 | if (!NX_IS_REVISION_P3(adapter->ahw.revision_id)) |
| 882 | return -EINVAL; |
| 883 | |
| 884 | if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) |
| 885 | return -EINVAL; |
| 886 | |
| 887 | ethcoal->rx_coalesce_usecs = adapter->coal.normal.data.rx_time_us; |
| 888 | ethcoal->tx_coalesce_usecs = adapter->coal.normal.data.tx_time_us; |
| 889 | ethcoal->rx_max_coalesced_frames = |
| 890 | adapter->coal.normal.data.rx_packets; |
| 891 | ethcoal->tx_max_coalesced_frames = |
| 892 | adapter->coal.normal.data.tx_packets; |
| 893 | |
| 894 | return 0; |
| 895 | } |
| 896 | |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 897 | struct ethtool_ops netxen_nic_ethtool_ops = { |
| 898 | .get_settings = netxen_nic_get_settings, |
| 899 | .set_settings = netxen_nic_set_settings, |
| 900 | .get_drvinfo = netxen_nic_get_drvinfo, |
| 901 | .get_regs_len = netxen_nic_get_regs_len, |
| 902 | .get_regs = netxen_nic_get_regs, |
Amit S. Kale | e45d9ab | 2007-02-09 05:49:08 -0800 | [diff] [blame] | 903 | .get_link = ethtool_op_get_link, |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 904 | .get_eeprom_len = netxen_nic_get_eeprom_len, |
| 905 | .get_eeprom = netxen_nic_get_eeprom, |
Dhananjay Phadke | 7830b22 | 2008-07-21 19:44:00 -0700 | [diff] [blame] | 906 | #if 0 |
Amit S. Kale | 27d2ab5 | 2007-02-05 07:40:49 -0800 | [diff] [blame] | 907 | .set_eeprom = netxen_nic_set_eeprom, |
Dhananjay Phadke | 7830b22 | 2008-07-21 19:44:00 -0700 | [diff] [blame] | 908 | #endif |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 909 | .get_ringparam = netxen_nic_get_ringparam, |
| 910 | .get_pauseparam = netxen_nic_get_pauseparam, |
| 911 | .set_pauseparam = netxen_nic_set_pauseparam, |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 912 | .set_tx_csum = ethtool_op_set_tx_csum, |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 913 | .set_sg = ethtool_op_set_sg, |
Dhananjay Phadke | cd1f816 | 2008-07-21 19:44:09 -0700 | [diff] [blame] | 914 | .get_tso = netxen_nic_get_tso, |
| 915 | .set_tso = netxen_nic_set_tso, |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 916 | .self_test = netxen_nic_diag_test, |
| 917 | .get_strings = netxen_nic_get_strings, |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 918 | .get_ethtool_stats = netxen_nic_get_ethtool_stats, |
Jeff Garzik | b9f2c04 | 2007-10-03 18:07:32 -0700 | [diff] [blame] | 919 | .get_sset_count = netxen_get_sset_count, |
Dhananjay Phadke | 200eef2 | 2007-09-03 10:33:35 +0530 | [diff] [blame] | 920 | .get_rx_csum = netxen_nic_get_rx_csum, |
| 921 | .set_rx_csum = netxen_nic_set_rx_csum, |
Dhananjay Phadke | cd1f816 | 2008-07-21 19:44:09 -0700 | [diff] [blame] | 922 | .get_coalesce = netxen_get_intr_coalesce, |
| 923 | .set_coalesce = netxen_set_intr_coalesce, |
Amit S. Kale | 3d396eb | 2006-10-21 15:33:03 -0400 | [diff] [blame] | 924 | }; |