23 #include <linux/netdevice.h>
24 #include <linux/ethtool.h>
25 #include <linux/slab.h>
29 static int atl1e_get_settings(
struct net_device *netdev,
54 ethtool_cmd_speed_set(ecmd, adapter->
link_speed);
60 ethtool_cmd_speed_set(ecmd, -1);
68 static int atl1e_set_settings(
struct net_device *netdev,
125 if (netif_running(adapter->
netdev)) {
144 static int atl1e_get_regs_len(
struct net_device *netdev)
149 static void atl1e_get_regs(
struct net_device *netdev,
193 regs_buff[73] = (
u32)phy_data;
195 regs_buff[74] = (
u32)phy_data;
198 static int atl1e_get_eeprom_len(
struct net_device *netdev)
208 static int atl1e_get_eeprom(
struct net_device *netdev,
214 int first_dword, last_dword;
218 if (eeprom->
len == 0)
226 first_dword = eeprom->
offset >> 2;
227 last_dword = (eeprom->
offset + eeprom->
len - 1) >> 2;
231 if (eeprom_buff ==
NULL)
234 for (i = first_dword; i < last_dword; i++) {
248 static int atl1e_set_eeprom(
struct net_device *netdev,
255 int first_dword, last_dword;
259 if (eeprom->
len == 0)
265 first_dword = eeprom->
offset >> 2;
266 last_dword = (eeprom->
offset + eeprom->
len - 1) >> 2;
268 if (eeprom_buff ==
NULL)
282 if (((eeprom->
offset + eeprom->
len) & 3)) {
287 &(eeprom_buff[last_dword - first_dword]))) {
296 for (i = 0; i < last_dword - first_dword + 1; i++) {
308 static void atl1e_get_drvinfo(
struct net_device *netdev,
322 drvinfo->
eedump_len = atl1e_get_eeprom_len(netdev);
325 static void atl1e_get_wol(
struct net_device *netdev,
365 static int atl1e_nway_reset(
struct net_device *netdev)
368 if (netif_running(netdev))
373 static const struct ethtool_ops atl1e_ethtool_ops = {
374 .get_settings = atl1e_get_settings,
375 .set_settings = atl1e_set_settings,
376 .get_drvinfo = atl1e_get_drvinfo,
377 .get_regs_len = atl1e_get_regs_len,
378 .get_regs = atl1e_get_regs,
379 .get_wol = atl1e_get_wol,
380 .set_wol = atl1e_set_wol,
381 .get_msglevel = atl1e_get_msglevel,
382 .nway_reset = atl1e_nway_reset,
384 .get_eeprom_len = atl1e_get_eeprom_len,
385 .get_eeprom = atl1e_get_eeprom,
386 .set_eeprom = atl1e_set_eeprom,