diff options
Diffstat (limited to 'drivers/net/e1000/e1000_ethtool.c')
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 175 |
1 files changed, 68 insertions, 107 deletions
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index a3f6a9c72ec8..4bcfa374f4d6 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c | |||
@@ -112,8 +112,8 @@ static const char e1000_gstrings_test[][ETH_GSTRING_LEN] = { | |||
112 | }; | 112 | }; |
113 | #define E1000_TEST_LEN ARRAY_SIZE(e1000_gstrings_test) | 113 | #define E1000_TEST_LEN ARRAY_SIZE(e1000_gstrings_test) |
114 | 114 | ||
115 | static int | 115 | static int e1000_get_settings(struct net_device *netdev, |
116 | e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | 116 | struct ethtool_cmd *ecmd) |
117 | { | 117 | { |
118 | struct e1000_adapter *adapter = netdev_priv(netdev); | 118 | struct e1000_adapter *adapter = netdev_priv(netdev); |
119 | struct e1000_hw *hw = &adapter->hw; | 119 | struct e1000_hw *hw = &adapter->hw; |
@@ -185,8 +185,8 @@ e1000_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
185 | return 0; | 185 | return 0; |
186 | } | 186 | } |
187 | 187 | ||
188 | static int | 188 | static int e1000_set_settings(struct net_device *netdev, |
189 | e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | 189 | struct ethtool_cmd *ecmd) |
190 | { | 190 | { |
191 | struct e1000_adapter *adapter = netdev_priv(netdev); | 191 | struct e1000_adapter *adapter = netdev_priv(netdev); |
192 | struct e1000_hw *hw = &adapter->hw; | 192 | struct e1000_hw *hw = &adapter->hw; |
@@ -231,9 +231,8 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) | |||
231 | return 0; | 231 | return 0; |
232 | } | 232 | } |
233 | 233 | ||
234 | static void | 234 | static void e1000_get_pauseparam(struct net_device *netdev, |
235 | e1000_get_pauseparam(struct net_device *netdev, | 235 | struct ethtool_pauseparam *pause) |
236 | struct ethtool_pauseparam *pause) | ||
237 | { | 236 | { |
238 | struct e1000_adapter *adapter = netdev_priv(netdev); | 237 | struct e1000_adapter *adapter = netdev_priv(netdev); |
239 | struct e1000_hw *hw = &adapter->hw; | 238 | struct e1000_hw *hw = &adapter->hw; |
@@ -251,9 +250,8 @@ e1000_get_pauseparam(struct net_device *netdev, | |||
251 | } | 250 | } |
252 | } | 251 | } |
253 | 252 | ||
254 | static int | 253 | static int e1000_set_pauseparam(struct net_device *netdev, |
255 | e1000_set_pauseparam(struct net_device *netdev, | 254 | struct ethtool_pauseparam *pause) |
256 | struct ethtool_pauseparam *pause) | ||
257 | { | 255 | { |
258 | struct e1000_adapter *adapter = netdev_priv(netdev); | 256 | struct e1000_adapter *adapter = netdev_priv(netdev); |
259 | struct e1000_hw *hw = &adapter->hw; | 257 | struct e1000_hw *hw = &adapter->hw; |
@@ -289,15 +287,13 @@ e1000_set_pauseparam(struct net_device *netdev, | |||
289 | return retval; | 287 | return retval; |
290 | } | 288 | } |
291 | 289 | ||
292 | static u32 | 290 | static u32 e1000_get_rx_csum(struct net_device *netdev) |
293 | e1000_get_rx_csum(struct net_device *netdev) | ||
294 | { | 291 | { |
295 | struct e1000_adapter *adapter = netdev_priv(netdev); | 292 | struct e1000_adapter *adapter = netdev_priv(netdev); |
296 | return adapter->rx_csum; | 293 | return adapter->rx_csum; |
297 | } | 294 | } |
298 | 295 | ||
299 | static int | 296 | static int e1000_set_rx_csum(struct net_device *netdev, u32 data) |
300 | e1000_set_rx_csum(struct net_device *netdev, u32 data) | ||
301 | { | 297 | { |
302 | struct e1000_adapter *adapter = netdev_priv(netdev); | 298 | struct e1000_adapter *adapter = netdev_priv(netdev); |
303 | adapter->rx_csum = data; | 299 | adapter->rx_csum = data; |
@@ -309,14 +305,12 @@ e1000_set_rx_csum(struct net_device *netdev, u32 data) | |||
309 | return 0; | 305 | return 0; |
310 | } | 306 | } |
311 | 307 | ||
312 | static u32 | 308 | static u32 e1000_get_tx_csum(struct net_device *netdev) |
313 | e1000_get_tx_csum(struct net_device *netdev) | ||
314 | { | 309 | { |
315 | return (netdev->features & NETIF_F_HW_CSUM) != 0; | 310 | return (netdev->features & NETIF_F_HW_CSUM) != 0; |
316 | } | 311 | } |
317 | 312 | ||
318 | static int | 313 | static int e1000_set_tx_csum(struct net_device *netdev, u32 data) |
319 | e1000_set_tx_csum(struct net_device *netdev, u32 data) | ||
320 | { | 314 | { |
321 | struct e1000_adapter *adapter = netdev_priv(netdev); | 315 | struct e1000_adapter *adapter = netdev_priv(netdev); |
322 | 316 | ||
@@ -334,8 +328,7 @@ e1000_set_tx_csum(struct net_device *netdev, u32 data) | |||
334 | return 0; | 328 | return 0; |
335 | } | 329 | } |
336 | 330 | ||
337 | static int | 331 | static int e1000_set_tso(struct net_device *netdev, u32 data) |
338 | e1000_set_tso(struct net_device *netdev, u32 data) | ||
339 | { | 332 | { |
340 | struct e1000_adapter *adapter = netdev_priv(netdev); | 333 | struct e1000_adapter *adapter = netdev_priv(netdev); |
341 | if ((adapter->hw.mac_type < e1000_82544) || | 334 | if ((adapter->hw.mac_type < e1000_82544) || |
@@ -357,30 +350,26 @@ e1000_set_tso(struct net_device *netdev, u32 data) | |||
357 | return 0; | 350 | return 0; |
358 | } | 351 | } |
359 | 352 | ||
360 | static u32 | 353 | static u32 e1000_get_msglevel(struct net_device *netdev) |
361 | e1000_get_msglevel(struct net_device *netdev) | ||
362 | { | 354 | { |
363 | struct e1000_adapter *adapter = netdev_priv(netdev); | 355 | struct e1000_adapter *adapter = netdev_priv(netdev); |
364 | return adapter->msg_enable; | 356 | return adapter->msg_enable; |
365 | } | 357 | } |
366 | 358 | ||
367 | static void | 359 | static void e1000_set_msglevel(struct net_device *netdev, u32 data) |
368 | e1000_set_msglevel(struct net_device *netdev, u32 data) | ||
369 | { | 360 | { |
370 | struct e1000_adapter *adapter = netdev_priv(netdev); | 361 | struct e1000_adapter *adapter = netdev_priv(netdev); |
371 | adapter->msg_enable = data; | 362 | adapter->msg_enable = data; |
372 | } | 363 | } |
373 | 364 | ||
374 | static int | 365 | static int e1000_get_regs_len(struct net_device *netdev) |
375 | e1000_get_regs_len(struct net_device *netdev) | ||
376 | { | 366 | { |
377 | #define E1000_REGS_LEN 32 | 367 | #define E1000_REGS_LEN 32 |
378 | return E1000_REGS_LEN * sizeof(u32); | 368 | return E1000_REGS_LEN * sizeof(u32); |
379 | } | 369 | } |
380 | 370 | ||
381 | static void | 371 | static void e1000_get_regs(struct net_device *netdev, struct ethtool_regs *regs, |
382 | e1000_get_regs(struct net_device *netdev, | 372 | void *p) |
383 | struct ethtool_regs *regs, void *p) | ||
384 | { | 373 | { |
385 | struct e1000_adapter *adapter = netdev_priv(netdev); | 374 | struct e1000_adapter *adapter = netdev_priv(netdev); |
386 | struct e1000_hw *hw = &adapter->hw; | 375 | struct e1000_hw *hw = &adapter->hw; |
@@ -468,16 +457,14 @@ e1000_get_regs(struct net_device *netdev, | |||
468 | } | 457 | } |
469 | } | 458 | } |
470 | 459 | ||
471 | static int | 460 | static int e1000_get_eeprom_len(struct net_device *netdev) |
472 | e1000_get_eeprom_len(struct net_device *netdev) | ||
473 | { | 461 | { |
474 | struct e1000_adapter *adapter = netdev_priv(netdev); | 462 | struct e1000_adapter *adapter = netdev_priv(netdev); |
475 | return adapter->hw.eeprom.word_size * 2; | 463 | return adapter->hw.eeprom.word_size * 2; |
476 | } | 464 | } |
477 | 465 | ||
478 | static int | 466 | static int e1000_get_eeprom(struct net_device *netdev, |
479 | e1000_get_eeprom(struct net_device *netdev, | 467 | struct ethtool_eeprom *eeprom, u8 *bytes) |
480 | struct ethtool_eeprom *eeprom, u8 *bytes) | ||
481 | { | 468 | { |
482 | struct e1000_adapter *adapter = netdev_priv(netdev); | 469 | struct e1000_adapter *adapter = netdev_priv(netdev); |
483 | struct e1000_hw *hw = &adapter->hw; | 470 | struct e1000_hw *hw = &adapter->hw; |
@@ -521,9 +508,8 @@ e1000_get_eeprom(struct net_device *netdev, | |||
521 | return ret_val; | 508 | return ret_val; |
522 | } | 509 | } |
523 | 510 | ||
524 | static int | 511 | static int e1000_set_eeprom(struct net_device *netdev, |
525 | e1000_set_eeprom(struct net_device *netdev, | 512 | struct ethtool_eeprom *eeprom, u8 *bytes) |
526 | struct ethtool_eeprom *eeprom, u8 *bytes) | ||
527 | { | 513 | { |
528 | struct e1000_adapter *adapter = netdev_priv(netdev); | 514 | struct e1000_adapter *adapter = netdev_priv(netdev); |
529 | struct e1000_hw *hw = &adapter->hw; | 515 | struct e1000_hw *hw = &adapter->hw; |
@@ -584,9 +570,8 @@ e1000_set_eeprom(struct net_device *netdev, | |||
584 | return ret_val; | 570 | return ret_val; |
585 | } | 571 | } |
586 | 572 | ||
587 | static void | 573 | static void e1000_get_drvinfo(struct net_device *netdev, |
588 | e1000_get_drvinfo(struct net_device *netdev, | 574 | struct ethtool_drvinfo *drvinfo) |
589 | struct ethtool_drvinfo *drvinfo) | ||
590 | { | 575 | { |
591 | struct e1000_adapter *adapter = netdev_priv(netdev); | 576 | struct e1000_adapter *adapter = netdev_priv(netdev); |
592 | char firmware_version[32]; | 577 | char firmware_version[32]; |
@@ -619,9 +604,8 @@ e1000_get_drvinfo(struct net_device *netdev, | |||
619 | drvinfo->eedump_len = e1000_get_eeprom_len(netdev); | 604 | drvinfo->eedump_len = e1000_get_eeprom_len(netdev); |
620 | } | 605 | } |
621 | 606 | ||
622 | static void | 607 | static void e1000_get_ringparam(struct net_device *netdev, |
623 | e1000_get_ringparam(struct net_device *netdev, | 608 | struct ethtool_ringparam *ring) |
624 | struct ethtool_ringparam *ring) | ||
625 | { | 609 | { |
626 | struct e1000_adapter *adapter = netdev_priv(netdev); | 610 | struct e1000_adapter *adapter = netdev_priv(netdev); |
627 | e1000_mac_type mac_type = adapter->hw.mac_type; | 611 | e1000_mac_type mac_type = adapter->hw.mac_type; |
@@ -640,9 +624,8 @@ e1000_get_ringparam(struct net_device *netdev, | |||
640 | ring->rx_jumbo_pending = 0; | 624 | ring->rx_jumbo_pending = 0; |
641 | } | 625 | } |
642 | 626 | ||
643 | static int | 627 | static int e1000_set_ringparam(struct net_device *netdev, |
644 | e1000_set_ringparam(struct net_device *netdev, | 628 | struct ethtool_ringparam *ring) |
645 | struct ethtool_ringparam *ring) | ||
646 | { | 629 | { |
647 | struct e1000_adapter *adapter = netdev_priv(netdev); | 630 | struct e1000_adapter *adapter = netdev_priv(netdev); |
648 | e1000_mac_type mac_type = adapter->hw.mac_type; | 631 | e1000_mac_type mac_type = adapter->hw.mac_type; |
@@ -728,8 +711,8 @@ err_setup: | |||
728 | return err; | 711 | return err; |
729 | } | 712 | } |
730 | 713 | ||
731 | static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data, | 714 | static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data, int reg, |
732 | int reg, u32 mask, u32 write) | 715 | u32 mask, u32 write) |
733 | { | 716 | { |
734 | static const u32 test[] = | 717 | static const u32 test[] = |
735 | {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF}; | 718 | {0x5A5A5A5A, 0xA5A5A5A5, 0x00000000, 0xFFFFFFFF}; |
@@ -751,8 +734,8 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data, | |||
751 | return false; | 734 | return false; |
752 | } | 735 | } |
753 | 736 | ||
754 | static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, | 737 | static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, int reg, |
755 | int reg, u32 mask, u32 write) | 738 | u32 mask, u32 write) |
756 | { | 739 | { |
757 | u8 __iomem *address = adapter->hw.hw_addr + reg; | 740 | u8 __iomem *address = adapter->hw.hw_addr + reg; |
758 | u32 read; | 741 | u32 read; |
@@ -787,8 +770,7 @@ static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, | |||
787 | return 1; \ | 770 | return 1; \ |
788 | } while (0) | 771 | } while (0) |
789 | 772 | ||
790 | static int | 773 | static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) |
791 | e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | ||
792 | { | 774 | { |
793 | u32 value, before, after; | 775 | u32 value, before, after; |
794 | u32 i, toggle; | 776 | u32 i, toggle; |
@@ -883,8 +865,7 @@ e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
883 | return 0; | 865 | return 0; |
884 | } | 866 | } |
885 | 867 | ||
886 | static int | 868 | static int e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data) |
887 | e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data) | ||
888 | { | 869 | { |
889 | u16 temp; | 870 | u16 temp; |
890 | u16 checksum = 0; | 871 | u16 checksum = 0; |
@@ -907,8 +888,7 @@ e1000_eeprom_test(struct e1000_adapter *adapter, u64 *data) | |||
907 | return *data; | 888 | return *data; |
908 | } | 889 | } |
909 | 890 | ||
910 | static irqreturn_t | 891 | static irqreturn_t e1000_test_intr(int irq, void *data) |
911 | e1000_test_intr(int irq, void *data) | ||
912 | { | 892 | { |
913 | struct net_device *netdev = (struct net_device *) data; | 893 | struct net_device *netdev = (struct net_device *) data; |
914 | struct e1000_adapter *adapter = netdev_priv(netdev); | 894 | struct e1000_adapter *adapter = netdev_priv(netdev); |
@@ -918,8 +898,7 @@ e1000_test_intr(int irq, void *data) | |||
918 | return IRQ_HANDLED; | 898 | return IRQ_HANDLED; |
919 | } | 899 | } |
920 | 900 | ||
921 | static int | 901 | static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) |
922 | e1000_intr_test(struct e1000_adapter *adapter, u64 *data) | ||
923 | { | 902 | { |
924 | struct net_device *netdev = adapter->netdev; | 903 | struct net_device *netdev = adapter->netdev; |
925 | u32 mask, i = 0; | 904 | u32 mask, i = 0; |
@@ -1017,8 +996,7 @@ e1000_intr_test(struct e1000_adapter *adapter, u64 *data) | |||
1017 | return *data; | 996 | return *data; |
1018 | } | 997 | } |
1019 | 998 | ||
1020 | static void | 999 | static void e1000_free_desc_rings(struct e1000_adapter *adapter) |
1021 | e1000_free_desc_rings(struct e1000_adapter *adapter) | ||
1022 | { | 1000 | { |
1023 | struct e1000_tx_ring *txdr = &adapter->test_tx_ring; | 1001 | struct e1000_tx_ring *txdr = &adapter->test_tx_ring; |
1024 | struct e1000_rx_ring *rxdr = &adapter->test_rx_ring; | 1002 | struct e1000_rx_ring *rxdr = &adapter->test_rx_ring; |
@@ -1064,8 +1042,7 @@ e1000_free_desc_rings(struct e1000_adapter *adapter) | |||
1064 | return; | 1042 | return; |
1065 | } | 1043 | } |
1066 | 1044 | ||
1067 | static int | 1045 | static int e1000_setup_desc_rings(struct e1000_adapter *adapter) |
1068 | e1000_setup_desc_rings(struct e1000_adapter *adapter) | ||
1069 | { | 1046 | { |
1070 | struct e1000_tx_ring *txdr = &adapter->test_tx_ring; | 1047 | struct e1000_tx_ring *txdr = &adapter->test_tx_ring; |
1071 | struct e1000_rx_ring *rxdr = &adapter->test_rx_ring; | 1048 | struct e1000_rx_ring *rxdr = &adapter->test_rx_ring; |
@@ -1189,8 +1166,7 @@ err_nomem: | |||
1189 | return ret_val; | 1166 | return ret_val; |
1190 | } | 1167 | } |
1191 | 1168 | ||
1192 | static void | 1169 | static void e1000_phy_disable_receiver(struct e1000_adapter *adapter) |
1193 | e1000_phy_disable_receiver(struct e1000_adapter *adapter) | ||
1194 | { | 1170 | { |
1195 | /* Write out to PHY registers 29 and 30 to disable the Receiver. */ | 1171 | /* Write out to PHY registers 29 and 30 to disable the Receiver. */ |
1196 | e1000_write_phy_reg(&adapter->hw, 29, 0x001F); | 1172 | e1000_write_phy_reg(&adapter->hw, 29, 0x001F); |
@@ -1199,8 +1175,7 @@ e1000_phy_disable_receiver(struct e1000_adapter *adapter) | |||
1199 | e1000_write_phy_reg(&adapter->hw, 30, 0x8FF0); | 1175 | e1000_write_phy_reg(&adapter->hw, 30, 0x8FF0); |
1200 | } | 1176 | } |
1201 | 1177 | ||
1202 | static void | 1178 | static void e1000_phy_reset_clk_and_crs(struct e1000_adapter *adapter) |
1203 | e1000_phy_reset_clk_and_crs(struct e1000_adapter *adapter) | ||
1204 | { | 1179 | { |
1205 | u16 phy_reg; | 1180 | u16 phy_reg; |
1206 | 1181 | ||
@@ -1223,8 +1198,7 @@ e1000_phy_reset_clk_and_crs(struct e1000_adapter *adapter) | |||
1223 | M88E1000_PHY_SPEC_CTRL, phy_reg); | 1198 | M88E1000_PHY_SPEC_CTRL, phy_reg); |
1224 | } | 1199 | } |
1225 | 1200 | ||
1226 | static int | 1201 | static int e1000_nonintegrated_phy_loopback(struct e1000_adapter *adapter) |
1227 | e1000_nonintegrated_phy_loopback(struct e1000_adapter *adapter) | ||
1228 | { | 1202 | { |
1229 | u32 ctrl_reg; | 1203 | u32 ctrl_reg; |
1230 | u16 phy_reg; | 1204 | u16 phy_reg; |
@@ -1290,8 +1264,7 @@ e1000_nonintegrated_phy_loopback(struct e1000_adapter *adapter) | |||
1290 | return 0; | 1264 | return 0; |
1291 | } | 1265 | } |
1292 | 1266 | ||
1293 | static int | 1267 | static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter) |
1294 | e1000_integrated_phy_loopback(struct e1000_adapter *adapter) | ||
1295 | { | 1268 | { |
1296 | u32 ctrl_reg = 0; | 1269 | u32 ctrl_reg = 0; |
1297 | u32 stat_reg = 0; | 1270 | u32 stat_reg = 0; |
@@ -1360,8 +1333,7 @@ e1000_integrated_phy_loopback(struct e1000_adapter *adapter) | |||
1360 | return 0; | 1333 | return 0; |
1361 | } | 1334 | } |
1362 | 1335 | ||
1363 | static int | 1336 | static int e1000_set_phy_loopback(struct e1000_adapter *adapter) |
1364 | e1000_set_phy_loopback(struct e1000_adapter *adapter) | ||
1365 | { | 1337 | { |
1366 | u16 phy_reg = 0; | 1338 | u16 phy_reg = 0; |
1367 | u16 count = 0; | 1339 | u16 count = 0; |
@@ -1412,8 +1384,7 @@ e1000_set_phy_loopback(struct e1000_adapter *adapter) | |||
1412 | return 8; | 1384 | return 8; |
1413 | } | 1385 | } |
1414 | 1386 | ||
1415 | static int | 1387 | static int e1000_setup_loopback_test(struct e1000_adapter *adapter) |
1416 | e1000_setup_loopback_test(struct e1000_adapter *adapter) | ||
1417 | { | 1388 | { |
1418 | struct e1000_hw *hw = &adapter->hw; | 1389 | struct e1000_hw *hw = &adapter->hw; |
1419 | u32 rctl; | 1390 | u32 rctl; |
@@ -1447,8 +1418,7 @@ e1000_setup_loopback_test(struct e1000_adapter *adapter) | |||
1447 | return 7; | 1418 | return 7; |
1448 | } | 1419 | } |
1449 | 1420 | ||
1450 | static void | 1421 | static void e1000_loopback_cleanup(struct e1000_adapter *adapter) |
1451 | e1000_loopback_cleanup(struct e1000_adapter *adapter) | ||
1452 | { | 1422 | { |
1453 | struct e1000_hw *hw = &adapter->hw; | 1423 | struct e1000_hw *hw = &adapter->hw; |
1454 | u32 rctl; | 1424 | u32 rctl; |
@@ -1489,8 +1459,8 @@ e1000_loopback_cleanup(struct e1000_adapter *adapter) | |||
1489 | } | 1459 | } |
1490 | } | 1460 | } |
1491 | 1461 | ||
1492 | static void | 1462 | static void e1000_create_lbtest_frame(struct sk_buff *skb, |
1493 | e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size) | 1463 | unsigned int frame_size) |
1494 | { | 1464 | { |
1495 | memset(skb->data, 0xFF, frame_size); | 1465 | memset(skb->data, 0xFF, frame_size); |
1496 | frame_size &= ~1; | 1466 | frame_size &= ~1; |
@@ -1499,8 +1469,8 @@ e1000_create_lbtest_frame(struct sk_buff *skb, unsigned int frame_size) | |||
1499 | memset(&skb->data[frame_size / 2 + 12], 0xAF, 1); | 1469 | memset(&skb->data[frame_size / 2 + 12], 0xAF, 1); |
1500 | } | 1470 | } |
1501 | 1471 | ||
1502 | static int | 1472 | static int e1000_check_lbtest_frame(struct sk_buff *skb, |
1503 | e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size) | 1473 | unsigned int frame_size) |
1504 | { | 1474 | { |
1505 | frame_size &= ~1; | 1475 | frame_size &= ~1; |
1506 | if (*(skb->data + 3) == 0xFF) { | 1476 | if (*(skb->data + 3) == 0xFF) { |
@@ -1512,8 +1482,7 @@ e1000_check_lbtest_frame(struct sk_buff *skb, unsigned int frame_size) | |||
1512 | return 13; | 1482 | return 13; |
1513 | } | 1483 | } |
1514 | 1484 | ||
1515 | static int | 1485 | static int e1000_run_loopback_test(struct e1000_adapter *adapter) |
1516 | e1000_run_loopback_test(struct e1000_adapter *adapter) | ||
1517 | { | 1486 | { |
1518 | struct e1000_tx_ring *txdr = &adapter->test_tx_ring; | 1487 | struct e1000_tx_ring *txdr = &adapter->test_tx_ring; |
1519 | struct e1000_rx_ring *rxdr = &adapter->test_rx_ring; | 1488 | struct e1000_rx_ring *rxdr = &adapter->test_rx_ring; |
@@ -1577,8 +1546,7 @@ e1000_run_loopback_test(struct e1000_adapter *adapter) | |||
1577 | return ret_val; | 1546 | return ret_val; |
1578 | } | 1547 | } |
1579 | 1548 | ||
1580 | static int | 1549 | static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data) |
1581 | e1000_loopback_test(struct e1000_adapter *adapter, u64 *data) | ||
1582 | { | 1550 | { |
1583 | /* PHY loopback cannot be performed if SoL/IDER | 1551 | /* PHY loopback cannot be performed if SoL/IDER |
1584 | * sessions are active */ | 1552 | * sessions are active */ |
@@ -1602,8 +1570,7 @@ out: | |||
1602 | return *data; | 1570 | return *data; |
1603 | } | 1571 | } |
1604 | 1572 | ||
1605 | static int | 1573 | static int e1000_link_test(struct e1000_adapter *adapter, u64 *data) |
1606 | e1000_link_test(struct e1000_adapter *adapter, u64 *data) | ||
1607 | { | 1574 | { |
1608 | *data = 0; | 1575 | *data = 0; |
1609 | if (adapter->hw.media_type == e1000_media_type_internal_serdes) { | 1576 | if (adapter->hw.media_type == e1000_media_type_internal_serdes) { |
@@ -1632,8 +1599,7 @@ e1000_link_test(struct e1000_adapter *adapter, u64 *data) | |||
1632 | return *data; | 1599 | return *data; |
1633 | } | 1600 | } |
1634 | 1601 | ||
1635 | static int | 1602 | static int e1000_get_sset_count(struct net_device *netdev, int sset) |
1636 | e1000_get_sset_count(struct net_device *netdev, int sset) | ||
1637 | { | 1603 | { |
1638 | switch (sset) { | 1604 | switch (sset) { |
1639 | case ETH_SS_TEST: | 1605 | case ETH_SS_TEST: |
@@ -1645,9 +1611,8 @@ e1000_get_sset_count(struct net_device *netdev, int sset) | |||
1645 | } | 1611 | } |
1646 | } | 1612 | } |
1647 | 1613 | ||
1648 | static void | 1614 | static void e1000_diag_test(struct net_device *netdev, |
1649 | e1000_diag_test(struct net_device *netdev, | 1615 | struct ethtool_test *eth_test, u64 *data) |
1650 | struct ethtool_test *eth_test, u64 *data) | ||
1651 | { | 1616 | { |
1652 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1617 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1653 | bool if_running = netif_running(netdev); | 1618 | bool if_running = netif_running(netdev); |
@@ -1717,7 +1682,8 @@ e1000_diag_test(struct net_device *netdev, | |||
1717 | msleep_interruptible(4 * 1000); | 1682 | msleep_interruptible(4 * 1000); |
1718 | } | 1683 | } |
1719 | 1684 | ||
1720 | static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol) | 1685 | static int e1000_wol_exclusion(struct e1000_adapter *adapter, |
1686 | struct ethtool_wolinfo *wol) | ||
1721 | { | 1687 | { |
1722 | struct e1000_hw *hw = &adapter->hw; | 1688 | struct e1000_hw *hw = &adapter->hw; |
1723 | int retval = 1; /* fail by default */ | 1689 | int retval = 1; /* fail by default */ |
@@ -1778,8 +1744,8 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol | |||
1778 | return retval; | 1744 | return retval; |
1779 | } | 1745 | } |
1780 | 1746 | ||
1781 | static void | 1747 | static void e1000_get_wol(struct net_device *netdev, |
1782 | e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | 1748 | struct ethtool_wolinfo *wol) |
1783 | { | 1749 | { |
1784 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1750 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1785 | 1751 | ||
@@ -1818,8 +1784,7 @@ e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
1818 | return; | 1784 | return; |
1819 | } | 1785 | } |
1820 | 1786 | ||
1821 | static int | 1787 | static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) |
1822 | e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | ||
1823 | { | 1788 | { |
1824 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1789 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1825 | struct e1000_hw *hw = &adapter->hw; | 1790 | struct e1000_hw *hw = &adapter->hw; |
@@ -1863,8 +1828,7 @@ e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
1863 | /* bit defines for adapter->led_status */ | 1828 | /* bit defines for adapter->led_status */ |
1864 | #define E1000_LED_ON 0 | 1829 | #define E1000_LED_ON 0 |
1865 | 1830 | ||
1866 | static void | 1831 | static void e1000_led_blink_callback(unsigned long data) |
1867 | e1000_led_blink_callback(unsigned long data) | ||
1868 | { | 1832 | { |
1869 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; | 1833 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; |
1870 | 1834 | ||
@@ -1876,8 +1840,7 @@ e1000_led_blink_callback(unsigned long data) | |||
1876 | mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL); | 1840 | mod_timer(&adapter->blink_timer, jiffies + E1000_ID_INTERVAL); |
1877 | } | 1841 | } |
1878 | 1842 | ||
1879 | static int | 1843 | static int e1000_phys_id(struct net_device *netdev, u32 data) |
1880 | e1000_phys_id(struct net_device *netdev, u32 data) | ||
1881 | { | 1844 | { |
1882 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1845 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1883 | 1846 | ||
@@ -1916,8 +1879,7 @@ e1000_phys_id(struct net_device *netdev, u32 data) | |||
1916 | return 0; | 1879 | return 0; |
1917 | } | 1880 | } |
1918 | 1881 | ||
1919 | static int | 1882 | static int e1000_nway_reset(struct net_device *netdev) |
1920 | e1000_nway_reset(struct net_device *netdev) | ||
1921 | { | 1883 | { |
1922 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1884 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1923 | if (netif_running(netdev)) | 1885 | if (netif_running(netdev)) |
@@ -1925,9 +1887,8 @@ e1000_nway_reset(struct net_device *netdev) | |||
1925 | return 0; | 1887 | return 0; |
1926 | } | 1888 | } |
1927 | 1889 | ||
1928 | static void | 1890 | static void e1000_get_ethtool_stats(struct net_device *netdev, |
1929 | e1000_get_ethtool_stats(struct net_device *netdev, | 1891 | struct ethtool_stats *stats, u64 *data) |
1930 | struct ethtool_stats *stats, u64 *data) | ||
1931 | { | 1892 | { |
1932 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1893 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1933 | int i; | 1894 | int i; |
@@ -1941,8 +1902,8 @@ e1000_get_ethtool_stats(struct net_device *netdev, | |||
1941 | /* BUG_ON(i != E1000_STATS_LEN); */ | 1902 | /* BUG_ON(i != E1000_STATS_LEN); */ |
1942 | } | 1903 | } |
1943 | 1904 | ||
1944 | static void | 1905 | static void e1000_get_strings(struct net_device *netdev, u32 stringset, |
1945 | e1000_get_strings(struct net_device *netdev, u32 stringset, u8 *data) | 1906 | u8 *data) |
1946 | { | 1907 | { |
1947 | u8 *p = data; | 1908 | u8 *p = data; |
1948 | int i; | 1909 | int i; |