23 #include <linux/netdevice.h>
24 #include <linux/ethtool.h>
25 #include <linux/slab.h>
29 static int atl1c_get_settings(
struct net_device *netdev,
53 ethtool_cmd_speed_set(ecmd, adapter->
link_speed);
59 ethtool_cmd_speed_set(ecmd, -1);
67 static int atl1c_set_settings(
struct net_device *netdev,
85 "1000M half is invalid\n");
108 "ethtool speed/duplex setting failed\n");
129 static int atl1c_get_regs_len(
struct net_device *netdev)
134 static void atl1c_get_regs(
struct net_device *netdev,
184 static int atl1c_get_eeprom(
struct net_device *netdev,
190 int first_dword, last_dword;
194 if (eeprom->
len == 0)
201 (adapter->
pdev->device << 16);
203 first_dword = eeprom->
offset >> 2;
204 last_dword = (eeprom->
offset + eeprom->
len - 1) >> 2;
208 if (eeprom_buff ==
NULL)
211 for (i = first_dword; i < last_dword; i++) {
226 static void atl1c_get_drvinfo(
struct net_device *netdev,
239 drvinfo->
eedump_len = atl1c_get_eeprom_len(netdev);
242 static void atl1c_get_wol(
struct net_device *netdev,
282 static int atl1c_nway_reset(
struct net_device *netdev)
285 if (netif_running(netdev))
290 static const struct ethtool_ops atl1c_ethtool_ops = {
291 .get_settings = atl1c_get_settings,
292 .set_settings = atl1c_set_settings,
293 .get_drvinfo = atl1c_get_drvinfo,
294 .get_regs_len = atl1c_get_regs_len,
295 .get_regs = atl1c_get_regs,
296 .get_wol = atl1c_get_wol,
297 .set_wol = atl1c_set_wol,
298 .get_msglevel = atl1c_get_msglevel,
299 .set_msglevel = atl1c_set_msglevel,
300 .nway_reset = atl1c_nway_reset,
302 .get_eeprom_len = atl1c_get_eeprom_len,
303 .get_eeprom = atl1c_get_eeprom,