diff options
author | Joe Perches <joe@perches.com> | 2008-07-11 18:17:02 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-22 19:34:33 -0400 |
commit | 6479884509e6cd30c6708fbf05fafc0d1fc85f7a (patch) | |
tree | 261e980073b9984611d950f7e9f043141b52612e /drivers | |
parent | cdc18a670923d01a762d66be582bfe763772d441 (diff) |
e1000: neaten function declarations
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 175 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 558 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 307 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_param.c | 16 |
4 files changed, 385 insertions, 671 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; |
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 9a4b6cbddf2c..d6c272ae437f 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -42,48 +42,65 @@ static void e1000_release_software_semaphore(struct e1000_hw *hw); | |||
42 | 42 | ||
43 | static u8 e1000_arc_subsystem_valid(struct e1000_hw *hw); | 43 | static u8 e1000_arc_subsystem_valid(struct e1000_hw *hw); |
44 | static s32 e1000_check_downshift(struct e1000_hw *hw); | 44 | static s32 e1000_check_downshift(struct e1000_hw *hw); |
45 | static s32 e1000_check_polarity(struct e1000_hw *hw, e1000_rev_polarity *polarity); | 45 | static s32 e1000_check_polarity(struct e1000_hw *hw, |
46 | e1000_rev_polarity *polarity); | ||
46 | static void e1000_clear_hw_cntrs(struct e1000_hw *hw); | 47 | static void e1000_clear_hw_cntrs(struct e1000_hw *hw); |
47 | static void e1000_clear_vfta(struct e1000_hw *hw); | 48 | static void e1000_clear_vfta(struct e1000_hw *hw); |
48 | static s32 e1000_commit_shadow_ram(struct e1000_hw *hw); | 49 | static s32 e1000_commit_shadow_ram(struct e1000_hw *hw); |
49 | static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, | 50 | static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, |
50 | bool link_up); | 51 | bool link_up); |
51 | static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw); | 52 | static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw); |
52 | static s32 e1000_detect_gig_phy(struct e1000_hw *hw); | 53 | static s32 e1000_detect_gig_phy(struct e1000_hw *hw); |
53 | static s32 e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank); | 54 | static s32 e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank); |
54 | static s32 e1000_get_auto_rd_done(struct e1000_hw *hw); | 55 | static s32 e1000_get_auto_rd_done(struct e1000_hw *hw); |
55 | static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length, u16 *max_length); | 56 | static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length, |
57 | u16 *max_length); | ||
56 | static s32 e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw); | 58 | static s32 e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw); |
57 | static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw); | 59 | static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw); |
58 | static s32 e1000_get_software_flag(struct e1000_hw *hw); | 60 | static s32 e1000_get_software_flag(struct e1000_hw *hw); |
59 | static s32 e1000_ich8_cycle_init(struct e1000_hw *hw); | 61 | static s32 e1000_ich8_cycle_init(struct e1000_hw *hw); |
60 | static s32 e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout); | 62 | static s32 e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout); |
61 | static s32 e1000_id_led_init(struct e1000_hw *hw); | 63 | static s32 e1000_id_led_init(struct e1000_hw *hw); |
62 | static s32 e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, u32 cnf_base_addr, u32 cnf_size); | 64 | static s32 e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, |
65 | u32 cnf_base_addr, | ||
66 | u32 cnf_size); | ||
63 | static s32 e1000_init_lcd_from_nvm(struct e1000_hw *hw); | 67 | static s32 e1000_init_lcd_from_nvm(struct e1000_hw *hw); |
64 | static void e1000_init_rx_addrs(struct e1000_hw *hw); | 68 | static void e1000_init_rx_addrs(struct e1000_hw *hw); |
65 | static void e1000_initialize_hardware_bits(struct e1000_hw *hw); | 69 | static void e1000_initialize_hardware_bits(struct e1000_hw *hw); |
66 | static bool e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw); | 70 | static bool e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw); |
67 | static s32 e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw); | 71 | static s32 e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw); |
68 | static s32 e1000_mng_enable_host_if(struct e1000_hw *hw); | 72 | static s32 e1000_mng_enable_host_if(struct e1000_hw *hw); |
69 | static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, u16 length, u16 offset, u8 *sum); | 73 | static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, u16 length, |
70 | static s32 e1000_mng_write_cmd_header(struct e1000_hw* hw, struct e1000_host_mng_command_header* hdr); | 74 | u16 offset, u8 *sum); |
75 | static s32 e1000_mng_write_cmd_header(struct e1000_hw* hw, | ||
76 | struct e1000_host_mng_command_header | ||
77 | *hdr); | ||
71 | static s32 e1000_mng_write_commit(struct e1000_hw *hw); | 78 | static s32 e1000_mng_write_commit(struct e1000_hw *hw); |
72 | static s32 e1000_phy_ife_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); | 79 | static s32 e1000_phy_ife_get_info(struct e1000_hw *hw, |
73 | static s32 e1000_phy_igp_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); | 80 | struct e1000_phy_info *phy_info); |
74 | static s32 e1000_read_eeprom_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | 81 | static s32 e1000_phy_igp_get_info(struct e1000_hw *hw, |
75 | static s32 e1000_write_eeprom_eewr(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | 82 | struct e1000_phy_info *phy_info); |
83 | static s32 e1000_read_eeprom_eerd(struct e1000_hw *hw, u16 offset, u16 words, | ||
84 | u16 *data); | ||
85 | static s32 e1000_write_eeprom_eewr(struct e1000_hw *hw, u16 offset, u16 words, | ||
86 | u16 *data); | ||
76 | static s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd); | 87 | static s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd); |
77 | static s32 e1000_phy_m88_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); | 88 | static s32 e1000_phy_m88_get_info(struct e1000_hw *hw, |
89 | struct e1000_phy_info *phy_info); | ||
78 | static void e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw); | 90 | static void e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw); |
79 | static s32 e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8 *data); | 91 | static s32 e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8 *data); |
80 | static s32 e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte); | 92 | static s32 e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, |
93 | u8 byte); | ||
81 | static s32 e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte); | 94 | static s32 e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte); |
82 | static s32 e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data); | 95 | static s32 e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data); |
83 | static s32 e1000_read_ich8_data(struct e1000_hw *hw, u32 index, u32 size, u16 *data); | 96 | static s32 e1000_read_ich8_data(struct e1000_hw *hw, u32 index, u32 size, |
84 | static s32 e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, u16 data); | 97 | u16 *data); |
85 | static s32 e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | 98 | static s32 e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, |
86 | static s32 e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | 99 | u16 data); |
100 | static s32 e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | ||
101 | u16 *data); | ||
102 | static s32 e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | ||
103 | u16 *data); | ||
87 | static void e1000_release_software_flag(struct e1000_hw *hw); | 104 | static void e1000_release_software_flag(struct e1000_hw *hw); |
88 | static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active); | 105 | static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active); |
89 | static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active); | 106 | static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active); |
@@ -101,23 +118,21 @@ static s32 e1000_config_mac_to_phy(struct e1000_hw *hw); | |||
101 | static void e1000_raise_mdi_clk(struct e1000_hw *hw, u32 *ctrl); | 118 | static void e1000_raise_mdi_clk(struct e1000_hw *hw, u32 *ctrl); |
102 | static void e1000_lower_mdi_clk(struct e1000_hw *hw, u32 *ctrl); | 119 | static void e1000_lower_mdi_clk(struct e1000_hw *hw, u32 *ctrl); |
103 | static void e1000_shift_out_mdi_bits(struct e1000_hw *hw, u32 data, | 120 | static void e1000_shift_out_mdi_bits(struct e1000_hw *hw, u32 data, |
104 | u16 count); | 121 | u16 count); |
105 | static u16 e1000_shift_in_mdi_bits(struct e1000_hw *hw); | 122 | static u16 e1000_shift_in_mdi_bits(struct e1000_hw *hw); |
106 | static s32 e1000_phy_reset_dsp(struct e1000_hw *hw); | 123 | static s32 e1000_phy_reset_dsp(struct e1000_hw *hw); |
107 | static s32 e1000_write_eeprom_spi(struct e1000_hw *hw, u16 offset, | 124 | static s32 e1000_write_eeprom_spi(struct e1000_hw *hw, u16 offset, |
108 | u16 words, u16 *data); | 125 | u16 words, u16 *data); |
109 | static s32 e1000_write_eeprom_microwire(struct e1000_hw *hw, | 126 | static s32 e1000_write_eeprom_microwire(struct e1000_hw *hw, u16 offset, |
110 | u16 offset, u16 words, | 127 | u16 words, u16 *data); |
111 | u16 *data); | ||
112 | static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw); | 128 | static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw); |
113 | static void e1000_raise_ee_clk(struct e1000_hw *hw, u32 *eecd); | 129 | static void e1000_raise_ee_clk(struct e1000_hw *hw, u32 *eecd); |
114 | static void e1000_lower_ee_clk(struct e1000_hw *hw, u32 *eecd); | 130 | static void e1000_lower_ee_clk(struct e1000_hw *hw, u32 *eecd); |
115 | static void e1000_shift_out_ee_bits(struct e1000_hw *hw, u16 data, | 131 | static void e1000_shift_out_ee_bits(struct e1000_hw *hw, u16 data, u16 count); |
116 | u16 count); | ||
117 | static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | 132 | static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, |
118 | u16 phy_data); | 133 | u16 phy_data); |
119 | static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw,u32 reg_addr, | 134 | static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw,u32 reg_addr, |
120 | u16 *phy_data); | 135 | u16 *phy_data); |
121 | static u16 e1000_shift_in_ee_bits(struct e1000_hw *hw, u16 count); | 136 | static u16 e1000_shift_in_ee_bits(struct e1000_hw *hw, u16 count); |
122 | static s32 e1000_acquire_eeprom(struct e1000_hw *hw); | 137 | static s32 e1000_acquire_eeprom(struct e1000_hw *hw); |
123 | static void e1000_release_eeprom(struct e1000_hw *hw); | 138 | static void e1000_release_eeprom(struct e1000_hw *hw); |
@@ -127,8 +142,7 @@ static s32 e1000_polarity_reversal_workaround(struct e1000_hw *hw); | |||
127 | static s32 e1000_set_phy_mode(struct e1000_hw *hw); | 142 | static s32 e1000_set_phy_mode(struct e1000_hw *hw); |
128 | static s32 e1000_host_if_read_cookie(struct e1000_hw *hw, u8 *buffer); | 143 | static s32 e1000_host_if_read_cookie(struct e1000_hw *hw, u8 *buffer); |
129 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length); | 144 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length); |
130 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, | 145 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex); |
131 | u16 duplex); | ||
132 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw); | 146 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw); |
133 | 147 | ||
134 | /* IGP cable length table */ | 148 | /* IGP cable length table */ |
@@ -159,8 +173,7 @@ u16 e1000_igp_2_cable_length_table[IGP02E1000_AGC_LENGTH_TABLE_SIZE] = | |||
159 | * | 173 | * |
160 | * hw - Struct containing variables accessed by shared code | 174 | * hw - Struct containing variables accessed by shared code |
161 | *****************************************************************************/ | 175 | *****************************************************************************/ |
162 | static s32 | 176 | static s32 e1000_set_phy_type(struct e1000_hw *hw) |
163 | e1000_set_phy_type(struct e1000_hw *hw) | ||
164 | { | 177 | { |
165 | DEBUGFUNC("e1000_set_phy_type"); | 178 | DEBUGFUNC("e1000_set_phy_type"); |
166 | 179 | ||
@@ -210,8 +223,7 @@ e1000_set_phy_type(struct e1000_hw *hw) | |||
210 | * | 223 | * |
211 | * hw - Struct containing variables accessed by shared code | 224 | * hw - Struct containing variables accessed by shared code |
212 | *****************************************************************************/ | 225 | *****************************************************************************/ |
213 | static void | 226 | static void e1000_phy_init_script(struct e1000_hw *hw) |
214 | e1000_phy_init_script(struct e1000_hw *hw) | ||
215 | { | 227 | { |
216 | u32 ret_val; | 228 | u32 ret_val; |
217 | u16 phy_saved_data; | 229 | u16 phy_saved_data; |
@@ -306,8 +318,7 @@ e1000_phy_init_script(struct e1000_hw *hw) | |||
306 | * | 318 | * |
307 | * hw - Struct containing variables accessed by shared code | 319 | * hw - Struct containing variables accessed by shared code |
308 | *****************************************************************************/ | 320 | *****************************************************************************/ |
309 | s32 | 321 | s32 e1000_set_mac_type(struct e1000_hw *hw) |
310 | e1000_set_mac_type(struct e1000_hw *hw) | ||
311 | { | 322 | { |
312 | DEBUGFUNC("e1000_set_mac_type"); | 323 | DEBUGFUNC("e1000_set_mac_type"); |
313 | 324 | ||
@@ -474,8 +485,7 @@ e1000_set_mac_type(struct e1000_hw *hw) | |||
474 | * | 485 | * |
475 | * hw - Struct containing variables accessed by shared code | 486 | * hw - Struct containing variables accessed by shared code |
476 | * **************************************************************************/ | 487 | * **************************************************************************/ |
477 | void | 488 | void e1000_set_media_type(struct e1000_hw *hw) |
478 | e1000_set_media_type(struct e1000_hw *hw) | ||
479 | { | 489 | { |
480 | u32 status; | 490 | u32 status; |
481 | 491 | ||
@@ -528,8 +538,7 @@ e1000_set_media_type(struct e1000_hw *hw) | |||
528 | * | 538 | * |
529 | * hw - Struct containing variables accessed by shared code | 539 | * hw - Struct containing variables accessed by shared code |
530 | *****************************************************************************/ | 540 | *****************************************************************************/ |
531 | s32 | 541 | s32 e1000_reset_hw(struct e1000_hw *hw) |
532 | e1000_reset_hw(struct e1000_hw *hw) | ||
533 | { | 542 | { |
534 | u32 ctrl; | 543 | u32 ctrl; |
535 | u32 ctrl_ext; | 544 | u32 ctrl_ext; |
@@ -747,8 +756,7 @@ e1000_reset_hw(struct e1000_hw *hw) | |||
747 | * This function contains hardware limitation workarounds for PCI-E adapters | 756 | * This function contains hardware limitation workarounds for PCI-E adapters |
748 | * | 757 | * |
749 | *****************************************************************************/ | 758 | *****************************************************************************/ |
750 | static void | 759 | static void e1000_initialize_hardware_bits(struct e1000_hw *hw) |
751 | e1000_initialize_hardware_bits(struct e1000_hw *hw) | ||
752 | { | 760 | { |
753 | if ((hw->mac_type >= e1000_82571) && (!hw->initialize_hw_bits_disable)) { | 761 | if ((hw->mac_type >= e1000_82571) && (!hw->initialize_hw_bits_disable)) { |
754 | /* Settings common to all PCI-express silicon */ | 762 | /* Settings common to all PCI-express silicon */ |
@@ -866,8 +874,7 @@ e1000_initialize_hardware_bits(struct e1000_hw *hw) | |||
866 | * configuration and flow control settings. Clears all on-chip counters. Leaves | 874 | * configuration and flow control settings. Clears all on-chip counters. Leaves |
867 | * the transmit and receive units disabled and uninitialized. | 875 | * the transmit and receive units disabled and uninitialized. |
868 | *****************************************************************************/ | 876 | *****************************************************************************/ |
869 | s32 | 877 | s32 e1000_init_hw(struct e1000_hw *hw) |
870 | e1000_init_hw(struct e1000_hw *hw) | ||
871 | { | 878 | { |
872 | u32 ctrl; | 879 | u32 ctrl; |
873 | u32 i; | 880 | u32 i; |
@@ -1054,8 +1061,7 @@ e1000_init_hw(struct e1000_hw *hw) | |||
1054 | * | 1061 | * |
1055 | * hw - Struct containing variables accessed by shared code. | 1062 | * hw - Struct containing variables accessed by shared code. |
1056 | *****************************************************************************/ | 1063 | *****************************************************************************/ |
1057 | static s32 | 1064 | static s32 e1000_adjust_serdes_amplitude(struct e1000_hw *hw) |
1058 | e1000_adjust_serdes_amplitude(struct e1000_hw *hw) | ||
1059 | { | 1065 | { |
1060 | u16 eeprom_data; | 1066 | u16 eeprom_data; |
1061 | s32 ret_val; | 1067 | s32 ret_val; |
@@ -1100,8 +1106,7 @@ e1000_adjust_serdes_amplitude(struct e1000_hw *hw) | |||
1100 | * established. Assumes the hardware has previously been reset and the | 1106 | * established. Assumes the hardware has previously been reset and the |
1101 | * transmitter and receiver are not enabled. | 1107 | * transmitter and receiver are not enabled. |
1102 | *****************************************************************************/ | 1108 | *****************************************************************************/ |
1103 | s32 | 1109 | s32 e1000_setup_link(struct e1000_hw *hw) |
1104 | e1000_setup_link(struct e1000_hw *hw) | ||
1105 | { | 1110 | { |
1106 | u32 ctrl_ext; | 1111 | u32 ctrl_ext; |
1107 | s32 ret_val; | 1112 | s32 ret_val; |
@@ -1233,8 +1238,7 @@ e1000_setup_link(struct e1000_hw *hw) | |||
1233 | * link. Assumes the hardware has been previously reset and the transmitter | 1238 | * link. Assumes the hardware has been previously reset and the transmitter |
1234 | * and receiver are not enabled. | 1239 | * and receiver are not enabled. |
1235 | *****************************************************************************/ | 1240 | *****************************************************************************/ |
1236 | static s32 | 1241 | static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw) |
1237 | e1000_setup_fiber_serdes_link(struct e1000_hw *hw) | ||
1238 | { | 1242 | { |
1239 | u32 ctrl; | 1243 | u32 ctrl; |
1240 | u32 status; | 1244 | u32 status; |
@@ -1380,8 +1384,7 @@ e1000_setup_fiber_serdes_link(struct e1000_hw *hw) | |||
1380 | * | 1384 | * |
1381 | * hw - Struct containing variables accessed by shared code | 1385 | * hw - Struct containing variables accessed by shared code |
1382 | ******************************************************************************/ | 1386 | ******************************************************************************/ |
1383 | static s32 | 1387 | static s32 e1000_copper_link_preconfig(struct e1000_hw *hw) |
1384 | e1000_copper_link_preconfig(struct e1000_hw *hw) | ||
1385 | { | 1388 | { |
1386 | u32 ctrl; | 1389 | u32 ctrl; |
1387 | s32 ret_val; | 1390 | s32 ret_val; |
@@ -1440,8 +1443,7 @@ e1000_copper_link_preconfig(struct e1000_hw *hw) | |||
1440 | * | 1443 | * |
1441 | * hw - Struct containing variables accessed by shared code | 1444 | * hw - Struct containing variables accessed by shared code |
1442 | *********************************************************************/ | 1445 | *********************************************************************/ |
1443 | static s32 | 1446 | static s32 e1000_copper_link_igp_setup(struct e1000_hw *hw) |
1444 | e1000_copper_link_igp_setup(struct e1000_hw *hw) | ||
1445 | { | 1447 | { |
1446 | u32 led_ctrl; | 1448 | u32 led_ctrl; |
1447 | s32 ret_val; | 1449 | s32 ret_val; |
@@ -1587,8 +1589,7 @@ e1000_copper_link_igp_setup(struct e1000_hw *hw) | |||
1587 | * | 1589 | * |
1588 | * hw - Struct containing variables accessed by shared code | 1590 | * hw - Struct containing variables accessed by shared code |
1589 | *********************************************************************/ | 1591 | *********************************************************************/ |
1590 | static s32 | 1592 | static s32 e1000_copper_link_ggp_setup(struct e1000_hw *hw) |
1591 | e1000_copper_link_ggp_setup(struct e1000_hw *hw) | ||
1592 | { | 1593 | { |
1593 | s32 ret_val; | 1594 | s32 ret_val; |
1594 | u16 phy_data; | 1595 | u16 phy_data; |
@@ -1735,8 +1736,7 @@ e1000_copper_link_ggp_setup(struct e1000_hw *hw) | |||
1735 | * | 1736 | * |
1736 | * hw - Struct containing variables accessed by shared code | 1737 | * hw - Struct containing variables accessed by shared code |
1737 | *********************************************************************/ | 1738 | *********************************************************************/ |
1738 | static s32 | 1739 | static s32 e1000_copper_link_mgp_setup(struct e1000_hw *hw) |
1739 | e1000_copper_link_mgp_setup(struct e1000_hw *hw) | ||
1740 | { | 1740 | { |
1741 | s32 ret_val; | 1741 | s32 ret_val; |
1742 | u16 phy_data; | 1742 | u16 phy_data; |
@@ -1839,8 +1839,7 @@ e1000_copper_link_mgp_setup(struct e1000_hw *hw) | |||
1839 | * | 1839 | * |
1840 | * hw - Struct containing variables accessed by shared code | 1840 | * hw - Struct containing variables accessed by shared code |
1841 | *********************************************************************/ | 1841 | *********************************************************************/ |
1842 | static s32 | 1842 | static s32 e1000_copper_link_autoneg(struct e1000_hw *hw) |
1843 | e1000_copper_link_autoneg(struct e1000_hw *hw) | ||
1844 | { | 1843 | { |
1845 | s32 ret_val; | 1844 | s32 ret_val; |
1846 | u16 phy_data; | 1845 | u16 phy_data; |
@@ -1910,8 +1909,7 @@ e1000_copper_link_autoneg(struct e1000_hw *hw) | |||
1910 | * | 1909 | * |
1911 | * hw - Struct containing variables accessed by shared code | 1910 | * hw - Struct containing variables accessed by shared code |
1912 | ******************************************************************************/ | 1911 | ******************************************************************************/ |
1913 | static s32 | 1912 | static s32 e1000_copper_link_postconfig(struct e1000_hw *hw) |
1914 | e1000_copper_link_postconfig(struct e1000_hw *hw) | ||
1915 | { | 1913 | { |
1916 | s32 ret_val; | 1914 | s32 ret_val; |
1917 | DEBUGFUNC("e1000_copper_link_postconfig"); | 1915 | DEBUGFUNC("e1000_copper_link_postconfig"); |
@@ -1948,8 +1946,7 @@ e1000_copper_link_postconfig(struct e1000_hw *hw) | |||
1948 | * | 1946 | * |
1949 | * hw - Struct containing variables accessed by shared code | 1947 | * hw - Struct containing variables accessed by shared code |
1950 | ******************************************************************************/ | 1948 | ******************************************************************************/ |
1951 | static s32 | 1949 | static s32 e1000_setup_copper_link(struct e1000_hw *hw) |
1952 | e1000_setup_copper_link(struct e1000_hw *hw) | ||
1953 | { | 1950 | { |
1954 | s32 ret_val; | 1951 | s32 ret_val; |
1955 | u16 i; | 1952 | u16 i; |
@@ -2062,8 +2059,7 @@ e1000_setup_copper_link(struct e1000_hw *hw) | |||
2062 | * | 2059 | * |
2063 | * hw - Struct containing variables accessed by shared code | 2060 | * hw - Struct containing variables accessed by shared code |
2064 | ******************************************************************************/ | 2061 | ******************************************************************************/ |
2065 | static s32 | 2062 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex) |
2066 | e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex) | ||
2067 | { | 2063 | { |
2068 | s32 ret_val = E1000_SUCCESS; | 2064 | s32 ret_val = E1000_SUCCESS; |
2069 | u32 tipg; | 2065 | u32 tipg; |
@@ -2098,8 +2094,7 @@ e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex) | |||
2098 | return ret_val; | 2094 | return ret_val; |
2099 | } | 2095 | } |
2100 | 2096 | ||
2101 | static s32 | 2097 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw) |
2102 | e1000_configure_kmrn_for_1000(struct e1000_hw *hw) | ||
2103 | { | 2098 | { |
2104 | s32 ret_val = E1000_SUCCESS; | 2099 | s32 ret_val = E1000_SUCCESS; |
2105 | u16 reg_data; | 2100 | u16 reg_data; |
@@ -2135,8 +2130,7 @@ e1000_configure_kmrn_for_1000(struct e1000_hw *hw) | |||
2135 | * | 2130 | * |
2136 | * hw - Struct containing variables accessed by shared code | 2131 | * hw - Struct containing variables accessed by shared code |
2137 | ******************************************************************************/ | 2132 | ******************************************************************************/ |
2138 | s32 | 2133 | s32 e1000_phy_setup_autoneg(struct e1000_hw *hw) |
2139 | e1000_phy_setup_autoneg(struct e1000_hw *hw) | ||
2140 | { | 2134 | { |
2141 | s32 ret_val; | 2135 | s32 ret_val; |
2142 | u16 mii_autoneg_adv_reg; | 2136 | u16 mii_autoneg_adv_reg; |
@@ -2284,8 +2278,7 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw) | |||
2284 | * | 2278 | * |
2285 | * hw - Struct containing variables accessed by shared code | 2279 | * hw - Struct containing variables accessed by shared code |
2286 | ******************************************************************************/ | 2280 | ******************************************************************************/ |
2287 | static s32 | 2281 | static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw) |
2288 | e1000_phy_force_speed_duplex(struct e1000_hw *hw) | ||
2289 | { | 2282 | { |
2290 | u32 ctrl; | 2283 | u32 ctrl; |
2291 | s32 ret_val; | 2284 | s32 ret_val; |
@@ -2535,8 +2528,7 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) | |||
2535 | * Link should have been established previously. Reads the speed and duplex | 2528 | * Link should have been established previously. Reads the speed and duplex |
2536 | * information from the Device Status register. | 2529 | * information from the Device Status register. |
2537 | ******************************************************************************/ | 2530 | ******************************************************************************/ |
2538 | void | 2531 | void e1000_config_collision_dist(struct e1000_hw *hw) |
2539 | e1000_config_collision_dist(struct e1000_hw *hw) | ||
2540 | { | 2532 | { |
2541 | u32 tctl, coll_dist; | 2533 | u32 tctl, coll_dist; |
2542 | 2534 | ||
@@ -2565,8 +2557,7 @@ e1000_config_collision_dist(struct e1000_hw *hw) | |||
2565 | * The contents of the PHY register containing the needed information need to | 2557 | * The contents of the PHY register containing the needed information need to |
2566 | * be passed in. | 2558 | * be passed in. |
2567 | ******************************************************************************/ | 2559 | ******************************************************************************/ |
2568 | static s32 | 2560 | static s32 e1000_config_mac_to_phy(struct e1000_hw *hw) |
2569 | e1000_config_mac_to_phy(struct e1000_hw *hw) | ||
2570 | { | 2561 | { |
2571 | u32 ctrl; | 2562 | u32 ctrl; |
2572 | s32 ret_val; | 2563 | s32 ret_val; |
@@ -2624,8 +2615,7 @@ e1000_config_mac_to_phy(struct e1000_hw *hw) | |||
2624 | * by the PHY rather than the MAC. Software must also configure these | 2615 | * by the PHY rather than the MAC. Software must also configure these |
2625 | * bits when link is forced on a fiber connection. | 2616 | * bits when link is forced on a fiber connection. |
2626 | *****************************************************************************/ | 2617 | *****************************************************************************/ |
2627 | s32 | 2618 | s32 e1000_force_mac_fc(struct e1000_hw *hw) |
2628 | e1000_force_mac_fc(struct e1000_hw *hw) | ||
2629 | { | 2619 | { |
2630 | u32 ctrl; | 2620 | u32 ctrl; |
2631 | 2621 | ||
@@ -2691,8 +2681,7 @@ e1000_force_mac_fc(struct e1000_hw *hw) | |||
2691 | * based on the flow control negotiated by the PHY. In TBI mode, the TFCE | 2681 | * based on the flow control negotiated by the PHY. In TBI mode, the TFCE |
2692 | * and RFCE bits will be automaticaly set to the negotiated flow control mode. | 2682 | * and RFCE bits will be automaticaly set to the negotiated flow control mode. |
2693 | *****************************************************************************/ | 2683 | *****************************************************************************/ |
2694 | static s32 | 2684 | static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw) |
2695 | e1000_config_fc_after_link_up(struct e1000_hw *hw) | ||
2696 | { | 2685 | { |
2697 | s32 ret_val; | 2686 | s32 ret_val; |
2698 | u16 mii_status_reg; | 2687 | u16 mii_status_reg; |
@@ -2896,8 +2885,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) | |||
2896 | * | 2885 | * |
2897 | * Called by any function that needs to check the link status of the adapter. | 2886 | * Called by any function that needs to check the link status of the adapter. |
2898 | *****************************************************************************/ | 2887 | *****************************************************************************/ |
2899 | s32 | 2888 | s32 e1000_check_for_link(struct e1000_hw *hw) |
2900 | e1000_check_for_link(struct e1000_hw *hw) | ||
2901 | { | 2889 | { |
2902 | u32 rxcw = 0; | 2890 | u32 rxcw = 0; |
2903 | u32 ctrl; | 2891 | u32 ctrl; |
@@ -3132,10 +3120,7 @@ e1000_check_for_link(struct e1000_hw *hw) | |||
3132 | * speed - Speed of the connection | 3120 | * speed - Speed of the connection |
3133 | * duplex - Duplex setting of the connection | 3121 | * duplex - Duplex setting of the connection |
3134 | *****************************************************************************/ | 3122 | *****************************************************************************/ |
3135 | s32 | 3123 | s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex) |
3136 | e1000_get_speed_and_duplex(struct e1000_hw *hw, | ||
3137 | u16 *speed, | ||
3138 | u16 *duplex) | ||
3139 | { | 3124 | { |
3140 | u32 status; | 3125 | u32 status; |
3141 | s32 ret_val; | 3126 | s32 ret_val; |
@@ -3214,8 +3199,7 @@ e1000_get_speed_and_duplex(struct e1000_hw *hw, | |||
3214 | * | 3199 | * |
3215 | * hw - Struct containing variables accessed by shared code | 3200 | * hw - Struct containing variables accessed by shared code |
3216 | ******************************************************************************/ | 3201 | ******************************************************************************/ |
3217 | static s32 | 3202 | static s32 e1000_wait_autoneg(struct e1000_hw *hw) |
3218 | e1000_wait_autoneg(struct e1000_hw *hw) | ||
3219 | { | 3203 | { |
3220 | s32 ret_val; | 3204 | s32 ret_val; |
3221 | u16 i; | 3205 | u16 i; |
@@ -3249,9 +3233,7 @@ e1000_wait_autoneg(struct e1000_hw *hw) | |||
3249 | * hw - Struct containing variables accessed by shared code | 3233 | * hw - Struct containing variables accessed by shared code |
3250 | * ctrl - Device control register's current value | 3234 | * ctrl - Device control register's current value |
3251 | ******************************************************************************/ | 3235 | ******************************************************************************/ |
3252 | static void | 3236 | static void e1000_raise_mdi_clk(struct e1000_hw *hw, u32 *ctrl) |
3253 | e1000_raise_mdi_clk(struct e1000_hw *hw, | ||
3254 | u32 *ctrl) | ||
3255 | { | 3237 | { |
3256 | /* Raise the clock input to the Management Data Clock (by setting the MDC | 3238 | /* Raise the clock input to the Management Data Clock (by setting the MDC |
3257 | * bit), and then delay 10 microseconds. | 3239 | * bit), and then delay 10 microseconds. |
@@ -3267,9 +3249,7 @@ e1000_raise_mdi_clk(struct e1000_hw *hw, | |||
3267 | * hw - Struct containing variables accessed by shared code | 3249 | * hw - Struct containing variables accessed by shared code |
3268 | * ctrl - Device control register's current value | 3250 | * ctrl - Device control register's current value |
3269 | ******************************************************************************/ | 3251 | ******************************************************************************/ |
3270 | static void | 3252 | static void e1000_lower_mdi_clk(struct e1000_hw *hw, u32 *ctrl) |
3271 | e1000_lower_mdi_clk(struct e1000_hw *hw, | ||
3272 | u32 *ctrl) | ||
3273 | { | 3253 | { |
3274 | /* Lower the clock input to the Management Data Clock (by clearing the MDC | 3254 | /* Lower the clock input to the Management Data Clock (by clearing the MDC |
3275 | * bit), and then delay 10 microseconds. | 3255 | * bit), and then delay 10 microseconds. |
@@ -3288,10 +3268,7 @@ e1000_lower_mdi_clk(struct e1000_hw *hw, | |||
3288 | * | 3268 | * |
3289 | * Bits are shifted out in MSB to LSB order. | 3269 | * Bits are shifted out in MSB to LSB order. |
3290 | ******************************************************************************/ | 3270 | ******************************************************************************/ |
3291 | static void | 3271 | static void e1000_shift_out_mdi_bits(struct e1000_hw *hw, u32 data, u16 count) |
3292 | e1000_shift_out_mdi_bits(struct e1000_hw *hw, | ||
3293 | u32 data, | ||
3294 | u16 count) | ||
3295 | { | 3272 | { |
3296 | u32 ctrl; | 3273 | u32 ctrl; |
3297 | u32 mask; | 3274 | u32 mask; |
@@ -3338,8 +3315,7 @@ e1000_shift_out_mdi_bits(struct e1000_hw *hw, | |||
3338 | * | 3315 | * |
3339 | * Bits are shifted in in MSB to LSB order. | 3316 | * Bits are shifted in in MSB to LSB order. |
3340 | ******************************************************************************/ | 3317 | ******************************************************************************/ |
3341 | static u16 | 3318 | static u16 e1000_shift_in_mdi_bits(struct e1000_hw *hw) |
3342 | e1000_shift_in_mdi_bits(struct e1000_hw *hw) | ||
3343 | { | 3319 | { |
3344 | u32 ctrl; | 3320 | u32 ctrl; |
3345 | u16 data = 0; | 3321 | u16 data = 0; |
@@ -3384,8 +3360,7 @@ e1000_shift_in_mdi_bits(struct e1000_hw *hw) | |||
3384 | return data; | 3360 | return data; |
3385 | } | 3361 | } |
3386 | 3362 | ||
3387 | static s32 | 3363 | static s32 e1000_swfw_sync_acquire(struct e1000_hw *hw, u16 mask) |
3388 | e1000_swfw_sync_acquire(struct e1000_hw *hw, u16 mask) | ||
3389 | { | 3364 | { |
3390 | u32 swfw_sync = 0; | 3365 | u32 swfw_sync = 0; |
3391 | u32 swmask = mask; | 3366 | u32 swmask = mask; |
@@ -3428,8 +3403,7 @@ e1000_swfw_sync_acquire(struct e1000_hw *hw, u16 mask) | |||
3428 | return E1000_SUCCESS; | 3403 | return E1000_SUCCESS; |
3429 | } | 3404 | } |
3430 | 3405 | ||
3431 | static void | 3406 | static void e1000_swfw_sync_release(struct e1000_hw *hw, u16 mask) |
3432 | e1000_swfw_sync_release(struct e1000_hw *hw, u16 mask) | ||
3433 | { | 3407 | { |
3434 | u32 swfw_sync; | 3408 | u32 swfw_sync; |
3435 | u32 swmask = mask; | 3409 | u32 swmask = mask; |
@@ -3464,10 +3438,7 @@ e1000_swfw_sync_release(struct e1000_hw *hw, u16 mask) | |||
3464 | * hw - Struct containing variables accessed by shared code | 3438 | * hw - Struct containing variables accessed by shared code |
3465 | * reg_addr - address of the PHY register to read | 3439 | * reg_addr - address of the PHY register to read |
3466 | ******************************************************************************/ | 3440 | ******************************************************************************/ |
3467 | s32 | 3441 | s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 *phy_data) |
3468 | e1000_read_phy_reg(struct e1000_hw *hw, | ||
3469 | u32 reg_addr, | ||
3470 | u16 *phy_data) | ||
3471 | { | 3442 | { |
3472 | u32 ret_val; | 3443 | u32 ret_val; |
3473 | u16 swfw; | 3444 | u16 swfw; |
@@ -3523,9 +3494,8 @@ e1000_read_phy_reg(struct e1000_hw *hw, | |||
3523 | return ret_val; | 3494 | return ret_val; |
3524 | } | 3495 | } |
3525 | 3496 | ||
3526 | static s32 | 3497 | static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, |
3527 | e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | 3498 | u16 *phy_data) |
3528 | u16 *phy_data) | ||
3529 | { | 3499 | { |
3530 | u32 i; | 3500 | u32 i; |
3531 | u32 mdic = 0; | 3501 | u32 mdic = 0; |
@@ -3603,9 +3573,7 @@ e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | |||
3603 | * reg_addr - address of the PHY register to write | 3573 | * reg_addr - address of the PHY register to write |
3604 | * data - data to write to the PHY | 3574 | * data - data to write to the PHY |
3605 | ******************************************************************************/ | 3575 | ******************************************************************************/ |
3606 | s32 | 3576 | s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 phy_data) |
3607 | e1000_write_phy_reg(struct e1000_hw *hw, u32 reg_addr, | ||
3608 | u16 phy_data) | ||
3609 | { | 3577 | { |
3610 | u32 ret_val; | 3578 | u32 ret_val; |
3611 | u16 swfw; | 3579 | u16 swfw; |
@@ -3661,9 +3629,8 @@ e1000_write_phy_reg(struct e1000_hw *hw, u32 reg_addr, | |||
3661 | return ret_val; | 3629 | return ret_val; |
3662 | } | 3630 | } |
3663 | 3631 | ||
3664 | static s32 | 3632 | static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, |
3665 | e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | 3633 | u16 phy_data) |
3666 | u16 phy_data) | ||
3667 | { | 3634 | { |
3668 | u32 i; | 3635 | u32 i; |
3669 | u32 mdic = 0; | 3636 | u32 mdic = 0; |
@@ -3723,10 +3690,7 @@ e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | |||
3723 | return E1000_SUCCESS; | 3690 | return E1000_SUCCESS; |
3724 | } | 3691 | } |
3725 | 3692 | ||
3726 | static s32 | 3693 | static s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 reg_addr, u16 *data) |
3727 | e1000_read_kmrn_reg(struct e1000_hw *hw, | ||
3728 | u32 reg_addr, | ||
3729 | u16 *data) | ||
3730 | { | 3694 | { |
3731 | u32 reg_val; | 3695 | u32 reg_val; |
3732 | u16 swfw; | 3696 | u16 swfw; |
@@ -3756,10 +3720,7 @@ e1000_read_kmrn_reg(struct e1000_hw *hw, | |||
3756 | return E1000_SUCCESS; | 3720 | return E1000_SUCCESS; |
3757 | } | 3721 | } |
3758 | 3722 | ||
3759 | static s32 | 3723 | static s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 reg_addr, u16 data) |
3760 | e1000_write_kmrn_reg(struct e1000_hw *hw, | ||
3761 | u32 reg_addr, | ||
3762 | u16 data) | ||
3763 | { | 3724 | { |
3764 | u32 reg_val; | 3725 | u32 reg_val; |
3765 | u16 swfw; | 3726 | u16 swfw; |
@@ -3788,8 +3749,7 @@ e1000_write_kmrn_reg(struct e1000_hw *hw, | |||
3788 | * | 3749 | * |
3789 | * hw - Struct containing variables accessed by shared code | 3750 | * hw - Struct containing variables accessed by shared code |
3790 | ******************************************************************************/ | 3751 | ******************************************************************************/ |
3791 | s32 | 3752 | s32 e1000_phy_hw_reset(struct e1000_hw *hw) |
3792 | e1000_phy_hw_reset(struct e1000_hw *hw) | ||
3793 | { | 3753 | { |
3794 | u32 ctrl, ctrl_ext; | 3754 | u32 ctrl, ctrl_ext; |
3795 | u32 led_ctrl; | 3755 | u32 led_ctrl; |
@@ -3882,8 +3842,7 @@ e1000_phy_hw_reset(struct e1000_hw *hw) | |||
3882 | * | 3842 | * |
3883 | * Sets bit 15 of the MII Control register | 3843 | * Sets bit 15 of the MII Control register |
3884 | ******************************************************************************/ | 3844 | ******************************************************************************/ |
3885 | s32 | 3845 | s32 e1000_phy_reset(struct e1000_hw *hw) |
3886 | e1000_phy_reset(struct e1000_hw *hw) | ||
3887 | { | 3846 | { |
3888 | s32 ret_val; | 3847 | s32 ret_val; |
3889 | u16 phy_data; | 3848 | u16 phy_data; |
@@ -3934,8 +3893,7 @@ e1000_phy_reset(struct e1000_hw *hw) | |||
3934 | * | 3893 | * |
3935 | * hw - struct containing variables accessed by shared code | 3894 | * hw - struct containing variables accessed by shared code |
3936 | ******************************************************************************/ | 3895 | ******************************************************************************/ |
3937 | void | 3896 | void e1000_phy_powerdown_workaround(struct e1000_hw *hw) |
3938 | e1000_phy_powerdown_workaround(struct e1000_hw *hw) | ||
3939 | { | 3897 | { |
3940 | s32 reg; | 3898 | s32 reg; |
3941 | u16 phy_data; | 3899 | u16 phy_data; |
@@ -3987,8 +3945,7 @@ e1000_phy_powerdown_workaround(struct e1000_hw *hw) | |||
3987 | * | 3945 | * |
3988 | * hw - struct containing variables accessed by shared code | 3946 | * hw - struct containing variables accessed by shared code |
3989 | ******************************************************************************/ | 3947 | ******************************************************************************/ |
3990 | static s32 | 3948 | static s32 e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw) |
3991 | e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw) | ||
3992 | { | 3949 | { |
3993 | s32 ret_val; | 3950 | s32 ret_val; |
3994 | s32 reg; | 3951 | s32 reg; |
@@ -4040,8 +3997,7 @@ e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw) | |||
4040 | * | 3997 | * |
4041 | * hw - Struct containing variables accessed by shared code | 3998 | * hw - Struct containing variables accessed by shared code |
4042 | ******************************************************************************/ | 3999 | ******************************************************************************/ |
4043 | static s32 | 4000 | static s32 e1000_detect_gig_phy(struct e1000_hw *hw) |
4044 | e1000_detect_gig_phy(struct e1000_hw *hw) | ||
4045 | { | 4001 | { |
4046 | s32 phy_init_status, ret_val; | 4002 | s32 phy_init_status, ret_val; |
4047 | u16 phy_id_high, phy_id_low; | 4003 | u16 phy_id_high, phy_id_low; |
@@ -4136,8 +4092,7 @@ e1000_detect_gig_phy(struct e1000_hw *hw) | |||
4136 | * | 4092 | * |
4137 | * hw - Struct containing variables accessed by shared code | 4093 | * hw - Struct containing variables accessed by shared code |
4138 | ******************************************************************************/ | 4094 | ******************************************************************************/ |
4139 | static s32 | 4095 | static s32 e1000_phy_reset_dsp(struct e1000_hw *hw) |
4140 | e1000_phy_reset_dsp(struct e1000_hw *hw) | ||
4141 | { | 4096 | { |
4142 | s32 ret_val; | 4097 | s32 ret_val; |
4143 | DEBUGFUNC("e1000_phy_reset_dsp"); | 4098 | DEBUGFUNC("e1000_phy_reset_dsp"); |
@@ -4163,9 +4118,8 @@ e1000_phy_reset_dsp(struct e1000_hw *hw) | |||
4163 | * hw - Struct containing variables accessed by shared code | 4118 | * hw - Struct containing variables accessed by shared code |
4164 | * phy_info - PHY information structure | 4119 | * phy_info - PHY information structure |
4165 | ******************************************************************************/ | 4120 | ******************************************************************************/ |
4166 | static s32 | 4121 | static s32 e1000_phy_igp_get_info(struct e1000_hw *hw, |
4167 | e1000_phy_igp_get_info(struct e1000_hw *hw, | 4122 | struct e1000_phy_info *phy_info) |
4168 | struct e1000_phy_info *phy_info) | ||
4169 | { | 4123 | { |
4170 | s32 ret_val; | 4124 | s32 ret_val; |
4171 | u16 phy_data, min_length, max_length, average; | 4125 | u16 phy_data, min_length, max_length, average; |
@@ -4240,9 +4194,8 @@ e1000_phy_igp_get_info(struct e1000_hw *hw, | |||
4240 | * hw - Struct containing variables accessed by shared code | 4194 | * hw - Struct containing variables accessed by shared code |
4241 | * phy_info - PHY information structure | 4195 | * phy_info - PHY information structure |
4242 | ******************************************************************************/ | 4196 | ******************************************************************************/ |
4243 | static s32 | 4197 | static s32 e1000_phy_ife_get_info(struct e1000_hw *hw, |
4244 | e1000_phy_ife_get_info(struct e1000_hw *hw, | 4198 | struct e1000_phy_info *phy_info) |
4245 | struct e1000_phy_info *phy_info) | ||
4246 | { | 4199 | { |
4247 | s32 ret_val; | 4200 | s32 ret_val; |
4248 | u16 phy_data; | 4201 | u16 phy_data; |
@@ -4290,9 +4243,8 @@ e1000_phy_ife_get_info(struct e1000_hw *hw, | |||
4290 | * hw - Struct containing variables accessed by shared code | 4243 | * hw - Struct containing variables accessed by shared code |
4291 | * phy_info - PHY information structure | 4244 | * phy_info - PHY information structure |
4292 | ******************************************************************************/ | 4245 | ******************************************************************************/ |
4293 | static s32 | 4246 | static s32 e1000_phy_m88_get_info(struct e1000_hw *hw, |
4294 | e1000_phy_m88_get_info(struct e1000_hw *hw, | 4247 | struct e1000_phy_info *phy_info) |
4295 | struct e1000_phy_info *phy_info) | ||
4296 | { | 4248 | { |
4297 | s32 ret_val; | 4249 | s32 ret_val; |
4298 | u16 phy_data; | 4250 | u16 phy_data; |
@@ -4369,9 +4321,7 @@ e1000_phy_m88_get_info(struct e1000_hw *hw, | |||
4369 | * hw - Struct containing variables accessed by shared code | 4321 | * hw - Struct containing variables accessed by shared code |
4370 | * phy_info - PHY information structure | 4322 | * phy_info - PHY information structure |
4371 | ******************************************************************************/ | 4323 | ******************************************************************************/ |
4372 | s32 | 4324 | s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info) |
4373 | e1000_phy_get_info(struct e1000_hw *hw, | ||
4374 | struct e1000_phy_info *phy_info) | ||
4375 | { | 4325 | { |
4376 | s32 ret_val; | 4326 | s32 ret_val; |
4377 | u16 phy_data; | 4327 | u16 phy_data; |
@@ -4415,8 +4365,7 @@ e1000_phy_get_info(struct e1000_hw *hw, | |||
4415 | return e1000_phy_m88_get_info(hw, phy_info); | 4365 | return e1000_phy_m88_get_info(hw, phy_info); |
4416 | } | 4366 | } |
4417 | 4367 | ||
4418 | s32 | 4368 | s32 e1000_validate_mdi_setting(struct e1000_hw *hw) |
4419 | e1000_validate_mdi_setting(struct e1000_hw *hw) | ||
4420 | { | 4369 | { |
4421 | DEBUGFUNC("e1000_validate_mdi_settings"); | 4370 | DEBUGFUNC("e1000_validate_mdi_settings"); |
4422 | 4371 | ||
@@ -4436,8 +4385,7 @@ e1000_validate_mdi_setting(struct e1000_hw *hw) | |||
4436 | * | 4385 | * |
4437 | * hw - Struct containing variables accessed by shared code | 4386 | * hw - Struct containing variables accessed by shared code |
4438 | *****************************************************************************/ | 4387 | *****************************************************************************/ |
4439 | s32 | 4388 | s32 e1000_init_eeprom_params(struct e1000_hw *hw) |
4440 | e1000_init_eeprom_params(struct e1000_hw *hw) | ||
4441 | { | 4389 | { |
4442 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4390 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4443 | u32 eecd = E1000_READ_REG(hw, EECD); | 4391 | u32 eecd = E1000_READ_REG(hw, EECD); |
@@ -4626,9 +4574,7 @@ e1000_init_eeprom_params(struct e1000_hw *hw) | |||
4626 | * hw - Struct containing variables accessed by shared code | 4574 | * hw - Struct containing variables accessed by shared code |
4627 | * eecd - EECD's current value | 4575 | * eecd - EECD's current value |
4628 | *****************************************************************************/ | 4576 | *****************************************************************************/ |
4629 | static void | 4577 | static void e1000_raise_ee_clk(struct e1000_hw *hw, u32 *eecd) |
4630 | e1000_raise_ee_clk(struct e1000_hw *hw, | ||
4631 | u32 *eecd) | ||
4632 | { | 4578 | { |
4633 | /* Raise the clock input to the EEPROM (by setting the SK bit), and then | 4579 | /* Raise the clock input to the EEPROM (by setting the SK bit), and then |
4634 | * wait <delay> microseconds. | 4580 | * wait <delay> microseconds. |
@@ -4645,9 +4591,7 @@ e1000_raise_ee_clk(struct e1000_hw *hw, | |||
4645 | * hw - Struct containing variables accessed by shared code | 4591 | * hw - Struct containing variables accessed by shared code |
4646 | * eecd - EECD's current value | 4592 | * eecd - EECD's current value |
4647 | *****************************************************************************/ | 4593 | *****************************************************************************/ |
4648 | static void | 4594 | static void e1000_lower_ee_clk(struct e1000_hw *hw, u32 *eecd) |
4649 | e1000_lower_ee_clk(struct e1000_hw *hw, | ||
4650 | u32 *eecd) | ||
4651 | { | 4595 | { |
4652 | /* Lower the clock input to the EEPROM (by clearing the SK bit), and then | 4596 | /* Lower the clock input to the EEPROM (by clearing the SK bit), and then |
4653 | * wait 50 microseconds. | 4597 | * wait 50 microseconds. |
@@ -4665,10 +4609,7 @@ e1000_lower_ee_clk(struct e1000_hw *hw, | |||
4665 | * data - data to send to the EEPROM | 4609 | * data - data to send to the EEPROM |
4666 | * count - number of bits to shift out | 4610 | * count - number of bits to shift out |
4667 | *****************************************************************************/ | 4611 | *****************************************************************************/ |
4668 | static void | 4612 | static void e1000_shift_out_ee_bits(struct e1000_hw *hw, u16 data, u16 count) |
4669 | e1000_shift_out_ee_bits(struct e1000_hw *hw, | ||
4670 | u16 data, | ||
4671 | u16 count) | ||
4672 | { | 4613 | { |
4673 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4614 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4674 | u32 eecd; | 4615 | u32 eecd; |
@@ -4718,9 +4659,7 @@ e1000_shift_out_ee_bits(struct e1000_hw *hw, | |||
4718 | * | 4659 | * |
4719 | * hw - Struct containing variables accessed by shared code | 4660 | * hw - Struct containing variables accessed by shared code |
4720 | *****************************************************************************/ | 4661 | *****************************************************************************/ |
4721 | static u16 | 4662 | static u16 e1000_shift_in_ee_bits(struct e1000_hw *hw, u16 count) |
4722 | e1000_shift_in_ee_bits(struct e1000_hw *hw, | ||
4723 | u16 count) | ||
4724 | { | 4663 | { |
4725 | u32 eecd; | 4664 | u32 eecd; |
4726 | u32 i; | 4665 | u32 i; |
@@ -4762,8 +4701,7 @@ e1000_shift_in_ee_bits(struct e1000_hw *hw, | |||
4762 | * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This | 4701 | * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This |
4763 | * function should be called before issuing a command to the EEPROM. | 4702 | * function should be called before issuing a command to the EEPROM. |
4764 | *****************************************************************************/ | 4703 | *****************************************************************************/ |
4765 | static s32 | 4704 | static s32 e1000_acquire_eeprom(struct e1000_hw *hw) |
4766 | e1000_acquire_eeprom(struct e1000_hw *hw) | ||
4767 | { | 4705 | { |
4768 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4706 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4769 | u32 eecd, i=0; | 4707 | u32 eecd, i=0; |
@@ -4821,8 +4759,7 @@ e1000_acquire_eeprom(struct e1000_hw *hw) | |||
4821 | * | 4759 | * |
4822 | * hw - Struct containing variables accessed by shared code | 4760 | * hw - Struct containing variables accessed by shared code |
4823 | *****************************************************************************/ | 4761 | *****************************************************************************/ |
4824 | static void | 4762 | static void e1000_standby_eeprom(struct e1000_hw *hw) |
4825 | e1000_standby_eeprom(struct e1000_hw *hw) | ||
4826 | { | 4763 | { |
4827 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4764 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4828 | u32 eecd; | 4765 | u32 eecd; |
@@ -4870,8 +4807,7 @@ e1000_standby_eeprom(struct e1000_hw *hw) | |||
4870 | * | 4807 | * |
4871 | * hw - Struct containing variables accessed by shared code | 4808 | * hw - Struct containing variables accessed by shared code |
4872 | *****************************************************************************/ | 4809 | *****************************************************************************/ |
4873 | static void | 4810 | static void e1000_release_eeprom(struct e1000_hw *hw) |
4874 | e1000_release_eeprom(struct e1000_hw *hw) | ||
4875 | { | 4811 | { |
4876 | u32 eecd; | 4812 | u32 eecd; |
4877 | 4813 | ||
@@ -4921,8 +4857,7 @@ e1000_release_eeprom(struct e1000_hw *hw) | |||
4921 | * | 4857 | * |
4922 | * hw - Struct containing variables accessed by shared code | 4858 | * hw - Struct containing variables accessed by shared code |
4923 | *****************************************************************************/ | 4859 | *****************************************************************************/ |
4924 | static s32 | 4860 | static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw) |
4925 | e1000_spi_eeprom_ready(struct e1000_hw *hw) | ||
4926 | { | 4861 | { |
4927 | u16 retry_count = 0; | 4862 | u16 retry_count = 0; |
4928 | u8 spi_stat_reg; | 4863 | u8 spi_stat_reg; |
@@ -4967,11 +4902,7 @@ e1000_spi_eeprom_ready(struct e1000_hw *hw) | |||
4967 | * data - word read from the EEPROM | 4902 | * data - word read from the EEPROM |
4968 | * words - number of words to read | 4903 | * words - number of words to read |
4969 | *****************************************************************************/ | 4904 | *****************************************************************************/ |
4970 | s32 | 4905 | s32 e1000_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
4971 | e1000_read_eeprom(struct e1000_hw *hw, | ||
4972 | u16 offset, | ||
4973 | u16 words, | ||
4974 | u16 *data) | ||
4975 | { | 4906 | { |
4976 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4907 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4977 | u32 i = 0; | 4908 | u32 i = 0; |
@@ -5068,11 +4999,8 @@ e1000_read_eeprom(struct e1000_hw *hw, | |||
5068 | * data - word read from the EEPROM | 4999 | * data - word read from the EEPROM |
5069 | * words - number of words to read | 5000 | * words - number of words to read |
5070 | *****************************************************************************/ | 5001 | *****************************************************************************/ |
5071 | static s32 | 5002 | static s32 e1000_read_eeprom_eerd(struct e1000_hw *hw, u16 offset, u16 words, |
5072 | e1000_read_eeprom_eerd(struct e1000_hw *hw, | 5003 | u16 *data) |
5073 | u16 offset, | ||
5074 | u16 words, | ||
5075 | u16 *data) | ||
5076 | { | 5004 | { |
5077 | u32 i, eerd = 0; | 5005 | u32 i, eerd = 0; |
5078 | s32 error = 0; | 5006 | s32 error = 0; |
@@ -5102,11 +5030,8 @@ e1000_read_eeprom_eerd(struct e1000_hw *hw, | |||
5102 | * data - word read from the EEPROM | 5030 | * data - word read from the EEPROM |
5103 | * words - number of words to read | 5031 | * words - number of words to read |
5104 | *****************************************************************************/ | 5032 | *****************************************************************************/ |
5105 | static s32 | 5033 | static s32 e1000_write_eeprom_eewr(struct e1000_hw *hw, u16 offset, u16 words, |
5106 | e1000_write_eeprom_eewr(struct e1000_hw *hw, | 5034 | u16 *data) |
5107 | u16 offset, | ||
5108 | u16 words, | ||
5109 | u16 *data) | ||
5110 | { | 5035 | { |
5111 | u32 register_value = 0; | 5036 | u32 register_value = 0; |
5112 | u32 i = 0; | 5037 | u32 i = 0; |
@@ -5143,8 +5068,7 @@ e1000_write_eeprom_eewr(struct e1000_hw *hw, | |||
5143 | * | 5068 | * |
5144 | * hw - Struct containing variables accessed by shared code | 5069 | * hw - Struct containing variables accessed by shared code |
5145 | *****************************************************************************/ | 5070 | *****************************************************************************/ |
5146 | static s32 | 5071 | static s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd) |
5147 | e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd) | ||
5148 | { | 5072 | { |
5149 | u32 attempts = 100000; | 5073 | u32 attempts = 100000; |
5150 | u32 i, reg = 0; | 5074 | u32 i, reg = 0; |
@@ -5171,8 +5095,7 @@ e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd) | |||
5171 | * | 5095 | * |
5172 | * hw - Struct containing variables accessed by shared code | 5096 | * hw - Struct containing variables accessed by shared code |
5173 | ****************************************************************************/ | 5097 | ****************************************************************************/ |
5174 | static bool | 5098 | static bool e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw) |
5175 | e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw) | ||
5176 | { | 5099 | { |
5177 | u32 eecd = 0; | 5100 | u32 eecd = 0; |
5178 | 5101 | ||
@@ -5204,8 +5127,7 @@ e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw) | |||
5204 | * If the the sum of the 64 16 bit words is 0xBABA, the EEPROM's checksum is | 5127 | * If the the sum of the 64 16 bit words is 0xBABA, the EEPROM's checksum is |
5205 | * valid. | 5128 | * valid. |
5206 | *****************************************************************************/ | 5129 | *****************************************************************************/ |
5207 | s32 | 5130 | s32 e1000_validate_eeprom_checksum(struct e1000_hw *hw) |
5208 | e1000_validate_eeprom_checksum(struct e1000_hw *hw) | ||
5209 | { | 5131 | { |
5210 | u16 checksum = 0; | 5132 | u16 checksum = 0; |
5211 | u16 i, eeprom_data; | 5133 | u16 i, eeprom_data; |
@@ -5268,8 +5190,7 @@ e1000_validate_eeprom_checksum(struct e1000_hw *hw) | |||
5268 | * Sums the first 63 16 bit words of the EEPROM. Subtracts the sum from 0xBABA. | 5190 | * Sums the first 63 16 bit words of the EEPROM. Subtracts the sum from 0xBABA. |
5269 | * Writes the difference to word offset 63 of the EEPROM. | 5191 | * Writes the difference to word offset 63 of the EEPROM. |
5270 | *****************************************************************************/ | 5192 | *****************************************************************************/ |
5271 | s32 | 5193 | s32 e1000_update_eeprom_checksum(struct e1000_hw *hw) |
5272 | e1000_update_eeprom_checksum(struct e1000_hw *hw) | ||
5273 | { | 5194 | { |
5274 | u32 ctrl_ext; | 5195 | u32 ctrl_ext; |
5275 | u16 checksum = 0; | 5196 | u16 checksum = 0; |
@@ -5313,11 +5234,7 @@ e1000_update_eeprom_checksum(struct e1000_hw *hw) | |||
5313 | * If e1000_update_eeprom_checksum is not called after this function, the | 5234 | * If e1000_update_eeprom_checksum is not called after this function, the |
5314 | * EEPROM will most likely contain an invalid checksum. | 5235 | * EEPROM will most likely contain an invalid checksum. |
5315 | *****************************************************************************/ | 5236 | *****************************************************************************/ |
5316 | s32 | 5237 | s32 e1000_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
5317 | e1000_write_eeprom(struct e1000_hw *hw, | ||
5318 | u16 offset, | ||
5319 | u16 words, | ||
5320 | u16 *data) | ||
5321 | { | 5238 | { |
5322 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 5239 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
5323 | s32 status = 0; | 5240 | s32 status = 0; |
@@ -5370,11 +5287,8 @@ e1000_write_eeprom(struct e1000_hw *hw, | |||
5370 | * data - pointer to array of 8 bit words to be written to the EEPROM | 5287 | * data - pointer to array of 8 bit words to be written to the EEPROM |
5371 | * | 5288 | * |
5372 | *****************************************************************************/ | 5289 | *****************************************************************************/ |
5373 | static s32 | 5290 | static s32 e1000_write_eeprom_spi(struct e1000_hw *hw, u16 offset, u16 words, |
5374 | e1000_write_eeprom_spi(struct e1000_hw *hw, | 5291 | u16 *data) |
5375 | u16 offset, | ||
5376 | u16 words, | ||
5377 | u16 *data) | ||
5378 | { | 5292 | { |
5379 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 5293 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
5380 | u16 widx = 0; | 5294 | u16 widx = 0; |
@@ -5436,11 +5350,8 @@ e1000_write_eeprom_spi(struct e1000_hw *hw, | |||
5436 | * data - pointer to array of 16 bit words to be written to the EEPROM | 5350 | * data - pointer to array of 16 bit words to be written to the EEPROM |
5437 | * | 5351 | * |
5438 | *****************************************************************************/ | 5352 | *****************************************************************************/ |
5439 | static s32 | 5353 | static s32 e1000_write_eeprom_microwire(struct e1000_hw *hw, u16 offset, |
5440 | e1000_write_eeprom_microwire(struct e1000_hw *hw, | 5354 | u16 words, u16 *data) |
5441 | u16 offset, | ||
5442 | u16 words, | ||
5443 | u16 *data) | ||
5444 | { | 5355 | { |
5445 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 5356 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
5446 | u32 eecd; | 5357 | u32 eecd; |
@@ -5523,8 +5434,7 @@ e1000_write_eeprom_microwire(struct e1000_hw *hw, | |||
5523 | * data - word read from the EEPROM | 5434 | * data - word read from the EEPROM |
5524 | * words - number of words to read | 5435 | * words - number of words to read |
5525 | *****************************************************************************/ | 5436 | *****************************************************************************/ |
5526 | static s32 | 5437 | static s32 e1000_commit_shadow_ram(struct e1000_hw *hw) |
5527 | e1000_commit_shadow_ram(struct e1000_hw *hw) | ||
5528 | { | 5438 | { |
5529 | u32 attempts = 100000; | 5439 | u32 attempts = 100000; |
5530 | u32 eecd = 0; | 5440 | u32 eecd = 0; |
@@ -5687,8 +5597,7 @@ e1000_commit_shadow_ram(struct e1000_hw *hw) | |||
5687 | * | 5597 | * |
5688 | * hw - Struct containing variables accessed by shared code | 5598 | * hw - Struct containing variables accessed by shared code |
5689 | *****************************************************************************/ | 5599 | *****************************************************************************/ |
5690 | s32 | 5600 | s32 e1000_read_mac_addr(struct e1000_hw *hw) |
5691 | e1000_read_mac_addr(struct e1000_hw * hw) | ||
5692 | { | 5601 | { |
5693 | u16 offset; | 5602 | u16 offset; |
5694 | u16 eeprom_data, i; | 5603 | u16 eeprom_data, i; |
@@ -5731,8 +5640,7 @@ e1000_read_mac_addr(struct e1000_hw * hw) | |||
5731 | * of the receive addresss registers. Clears the multicast table. Assumes | 5640 | * of the receive addresss registers. Clears the multicast table. Assumes |
5732 | * the receiver is in reset when the routine is called. | 5641 | * the receiver is in reset when the routine is called. |
5733 | *****************************************************************************/ | 5642 | *****************************************************************************/ |
5734 | static void | 5643 | static void e1000_init_rx_addrs(struct e1000_hw *hw) |
5735 | e1000_init_rx_addrs(struct e1000_hw *hw) | ||
5736 | { | 5644 | { |
5737 | u32 i; | 5645 | u32 i; |
5738 | u32 rar_num; | 5646 | u32 rar_num; |
@@ -5770,9 +5678,7 @@ e1000_init_rx_addrs(struct e1000_hw *hw) | |||
5770 | * hw - Struct containing variables accessed by shared code | 5678 | * hw - Struct containing variables accessed by shared code |
5771 | * mc_addr - the multicast address to hash | 5679 | * mc_addr - the multicast address to hash |
5772 | *****************************************************************************/ | 5680 | *****************************************************************************/ |
5773 | u32 | 5681 | u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr) |
5774 | e1000_hash_mc_addr(struct e1000_hw *hw, | ||
5775 | u8 *mc_addr) | ||
5776 | { | 5682 | { |
5777 | u32 hash_value = 0; | 5683 | u32 hash_value = 0; |
5778 | 5684 | ||
@@ -5835,9 +5741,7 @@ e1000_hash_mc_addr(struct e1000_hw *hw, | |||
5835 | * hw - Struct containing variables accessed by shared code | 5741 | * hw - Struct containing variables accessed by shared code |
5836 | * hash_value - Multicast address hash value | 5742 | * hash_value - Multicast address hash value |
5837 | *****************************************************************************/ | 5743 | *****************************************************************************/ |
5838 | void | 5744 | void e1000_mta_set(struct e1000_hw *hw, u32 hash_value) |
5839 | e1000_mta_set(struct e1000_hw *hw, | ||
5840 | u32 hash_value) | ||
5841 | { | 5745 | { |
5842 | u32 hash_bit, hash_reg; | 5746 | u32 hash_bit, hash_reg; |
5843 | u32 mta; | 5747 | u32 mta; |
@@ -5884,10 +5788,7 @@ e1000_mta_set(struct e1000_hw *hw, | |||
5884 | * addr - Address to put into receive address register | 5788 | * addr - Address to put into receive address register |
5885 | * index - Receive address register to write | 5789 | * index - Receive address register to write |
5886 | *****************************************************************************/ | 5790 | *****************************************************************************/ |
5887 | void | 5791 | void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index) |
5888 | e1000_rar_set(struct e1000_hw *hw, | ||
5889 | u8 *addr, | ||
5890 | u32 index) | ||
5891 | { | 5792 | { |
5892 | u32 rar_low, rar_high; | 5793 | u32 rar_low, rar_high; |
5893 | 5794 | ||
@@ -5942,10 +5843,7 @@ e1000_rar_set(struct e1000_hw *hw, | |||
5942 | * offset - Offset in VLAN filer table to write | 5843 | * offset - Offset in VLAN filer table to write |
5943 | * value - Value to write into VLAN filter table | 5844 | * value - Value to write into VLAN filter table |
5944 | *****************************************************************************/ | 5845 | *****************************************************************************/ |
5945 | void | 5846 | void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value) |
5946 | e1000_write_vfta(struct e1000_hw *hw, | ||
5947 | u32 offset, | ||
5948 | u32 value) | ||
5949 | { | 5847 | { |
5950 | u32 temp; | 5848 | u32 temp; |
5951 | 5849 | ||
@@ -5969,8 +5867,7 @@ e1000_write_vfta(struct e1000_hw *hw, | |||
5969 | * | 5867 | * |
5970 | * hw - Struct containing variables accessed by shared code | 5868 | * hw - Struct containing variables accessed by shared code |
5971 | *****************************************************************************/ | 5869 | *****************************************************************************/ |
5972 | static void | 5870 | static void e1000_clear_vfta(struct e1000_hw *hw) |
5973 | e1000_clear_vfta(struct e1000_hw *hw) | ||
5974 | { | 5871 | { |
5975 | u32 offset; | 5872 | u32 offset; |
5976 | u32 vfta_value = 0; | 5873 | u32 vfta_value = 0; |
@@ -6003,8 +5900,7 @@ e1000_clear_vfta(struct e1000_hw *hw) | |||
6003 | } | 5900 | } |
6004 | } | 5901 | } |
6005 | 5902 | ||
6006 | static s32 | 5903 | static s32 e1000_id_led_init(struct e1000_hw *hw) |
6007 | e1000_id_led_init(struct e1000_hw * hw) | ||
6008 | { | 5904 | { |
6009 | u32 ledctl; | 5905 | u32 ledctl; |
6010 | const u32 ledctl_mask = 0x000000FF; | 5906 | const u32 ledctl_mask = 0x000000FF; |
@@ -6086,8 +5982,7 @@ e1000_id_led_init(struct e1000_hw * hw) | |||
6086 | * | 5982 | * |
6087 | * hw - Struct containing variables accessed by shared code | 5983 | * hw - Struct containing variables accessed by shared code |
6088 | *****************************************************************************/ | 5984 | *****************************************************************************/ |
6089 | s32 | 5985 | s32 e1000_setup_led(struct e1000_hw *hw) |
6090 | e1000_setup_led(struct e1000_hw *hw) | ||
6091 | { | 5986 | { |
6092 | u32 ledctl; | 5987 | u32 ledctl; |
6093 | s32 ret_val = E1000_SUCCESS; | 5988 | s32 ret_val = E1000_SUCCESS; |
@@ -6145,8 +6040,7 @@ e1000_setup_led(struct e1000_hw *hw) | |||
6145 | * | 6040 | * |
6146 | * hw - Struct containing variables accessed by shared code | 6041 | * hw - Struct containing variables accessed by shared code |
6147 | *****************************************************************************/ | 6042 | *****************************************************************************/ |
6148 | s32 | 6043 | s32 e1000_blink_led_start(struct e1000_hw *hw) |
6149 | e1000_blink_led_start(struct e1000_hw *hw) | ||
6150 | { | 6044 | { |
6151 | s16 i; | 6045 | s16 i; |
6152 | u32 ledctl_blink = 0; | 6046 | u32 ledctl_blink = 0; |
@@ -6180,8 +6074,7 @@ e1000_blink_led_start(struct e1000_hw *hw) | |||
6180 | * | 6074 | * |
6181 | * hw - Struct containing variables accessed by shared code | 6075 | * hw - Struct containing variables accessed by shared code |
6182 | *****************************************************************************/ | 6076 | *****************************************************************************/ |
6183 | s32 | 6077 | s32 e1000_cleanup_led(struct e1000_hw *hw) |
6184 | e1000_cleanup_led(struct e1000_hw *hw) | ||
6185 | { | 6078 | { |
6186 | s32 ret_val = E1000_SUCCESS; | 6079 | s32 ret_val = E1000_SUCCESS; |
6187 | 6080 | ||
@@ -6222,8 +6115,7 @@ e1000_cleanup_led(struct e1000_hw *hw) | |||
6222 | * | 6115 | * |
6223 | * hw - Struct containing variables accessed by shared code | 6116 | * hw - Struct containing variables accessed by shared code |
6224 | *****************************************************************************/ | 6117 | *****************************************************************************/ |
6225 | s32 | 6118 | s32 e1000_led_on(struct e1000_hw *hw) |
6226 | e1000_led_on(struct e1000_hw *hw) | ||
6227 | { | 6119 | { |
6228 | u32 ctrl = E1000_READ_REG(hw, CTRL); | 6120 | u32 ctrl = E1000_READ_REG(hw, CTRL); |
6229 | 6121 | ||
@@ -6273,8 +6165,7 @@ e1000_led_on(struct e1000_hw *hw) | |||
6273 | * | 6165 | * |
6274 | * hw - Struct containing variables accessed by shared code | 6166 | * hw - Struct containing variables accessed by shared code |
6275 | *****************************************************************************/ | 6167 | *****************************************************************************/ |
6276 | s32 | 6168 | s32 e1000_led_off(struct e1000_hw *hw) |
6277 | e1000_led_off(struct e1000_hw *hw) | ||
6278 | { | 6169 | { |
6279 | u32 ctrl = E1000_READ_REG(hw, CTRL); | 6170 | u32 ctrl = E1000_READ_REG(hw, CTRL); |
6280 | 6171 | ||
@@ -6324,8 +6215,7 @@ e1000_led_off(struct e1000_hw *hw) | |||
6324 | * | 6215 | * |
6325 | * hw - Struct containing variables accessed by shared code | 6216 | * hw - Struct containing variables accessed by shared code |
6326 | *****************************************************************************/ | 6217 | *****************************************************************************/ |
6327 | static void | 6218 | static void e1000_clear_hw_cntrs(struct e1000_hw *hw) |
6328 | e1000_clear_hw_cntrs(struct e1000_hw *hw) | ||
6329 | { | 6219 | { |
6330 | volatile u32 temp; | 6220 | volatile u32 temp; |
6331 | 6221 | ||
@@ -6428,8 +6318,7 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw) | |||
6428 | * current_ifs_val, ifs_min_val, ifs_max_val, ifs_step_size, and ifs_ratio | 6318 | * current_ifs_val, ifs_min_val, ifs_max_val, ifs_step_size, and ifs_ratio |
6429 | * before calling this function. | 6319 | * before calling this function. |
6430 | *****************************************************************************/ | 6320 | *****************************************************************************/ |
6431 | void | 6321 | void e1000_reset_adaptive(struct e1000_hw *hw) |
6432 | e1000_reset_adaptive(struct e1000_hw *hw) | ||
6433 | { | 6322 | { |
6434 | DEBUGFUNC("e1000_reset_adaptive"); | 6323 | DEBUGFUNC("e1000_reset_adaptive"); |
6435 | 6324 | ||
@@ -6456,8 +6345,7 @@ e1000_reset_adaptive(struct e1000_hw *hw) | |||
6456 | * tx_packets - Number of transmits since last callback | 6345 | * tx_packets - Number of transmits since last callback |
6457 | * total_collisions - Number of collisions since last callback | 6346 | * total_collisions - Number of collisions since last callback |
6458 | *****************************************************************************/ | 6347 | *****************************************************************************/ |
6459 | void | 6348 | void e1000_update_adaptive(struct e1000_hw *hw) |
6460 | e1000_update_adaptive(struct e1000_hw *hw) | ||
6461 | { | 6349 | { |
6462 | DEBUGFUNC("e1000_update_adaptive"); | 6350 | DEBUGFUNC("e1000_update_adaptive"); |
6463 | 6351 | ||
@@ -6492,11 +6380,8 @@ e1000_update_adaptive(struct e1000_hw *hw) | |||
6492 | * frame_len - The length of the frame in question | 6380 | * frame_len - The length of the frame in question |
6493 | * mac_addr - The Ethernet destination address of the frame in question | 6381 | * mac_addr - The Ethernet destination address of the frame in question |
6494 | *****************************************************************************/ | 6382 | *****************************************************************************/ |
6495 | void | 6383 | void e1000_tbi_adjust_stats(struct e1000_hw *hw, struct e1000_hw_stats *stats, |
6496 | e1000_tbi_adjust_stats(struct e1000_hw *hw, | 6384 | u32 frame_len, u8 *mac_addr) |
6497 | struct e1000_hw_stats *stats, | ||
6498 | u32 frame_len, | ||
6499 | u8 *mac_addr) | ||
6500 | { | 6385 | { |
6501 | u64 carry_bit; | 6386 | u64 carry_bit; |
6502 | 6387 | ||
@@ -6570,8 +6455,7 @@ e1000_tbi_adjust_stats(struct e1000_hw *hw, | |||
6570 | * | 6455 | * |
6571 | * hw - Struct containing variables accessed by shared code | 6456 | * hw - Struct containing variables accessed by shared code |
6572 | *****************************************************************************/ | 6457 | *****************************************************************************/ |
6573 | void | 6458 | void e1000_get_bus_info(struct e1000_hw *hw) |
6574 | e1000_get_bus_info(struct e1000_hw *hw) | ||
6575 | { | 6459 | { |
6576 | s32 ret_val; | 6460 | s32 ret_val; |
6577 | u16 pci_ex_link_status; | 6461 | u16 pci_ex_link_status; |
@@ -6645,10 +6529,7 @@ e1000_get_bus_info(struct e1000_hw *hw) | |||
6645 | * offset - offset to write to | 6529 | * offset - offset to write to |
6646 | * value - value to write | 6530 | * value - value to write |
6647 | *****************************************************************************/ | 6531 | *****************************************************************************/ |
6648 | static void | 6532 | static void e1000_write_reg_io(struct e1000_hw *hw, u32 offset, u32 value) |
6649 | e1000_write_reg_io(struct e1000_hw *hw, | ||
6650 | u32 offset, | ||
6651 | u32 value) | ||
6652 | { | 6533 | { |
6653 | unsigned long io_addr = hw->io_base; | 6534 | unsigned long io_addr = hw->io_base; |
6654 | unsigned long io_data = hw->io_base + 4; | 6535 | unsigned long io_data = hw->io_base + 4; |
@@ -6672,10 +6553,8 @@ e1000_write_reg_io(struct e1000_hw *hw, | |||
6672 | * register to the minimum and maximum range. | 6553 | * register to the minimum and maximum range. |
6673 | * For IGP phy's, the function calculates the range by the AGC registers. | 6554 | * For IGP phy's, the function calculates the range by the AGC registers. |
6674 | *****************************************************************************/ | 6555 | *****************************************************************************/ |
6675 | static s32 | 6556 | static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length, |
6676 | e1000_get_cable_length(struct e1000_hw *hw, | 6557 | u16 *max_length) |
6677 | u16 *min_length, | ||
6678 | u16 *max_length) | ||
6679 | { | 6558 | { |
6680 | s32 ret_val; | 6559 | s32 ret_val; |
6681 | u16 agc_value = 0; | 6560 | u16 agc_value = 0; |
@@ -6863,9 +6742,8 @@ e1000_get_cable_length(struct e1000_hw *hw, | |||
6863 | * return 0. If the link speed is 1000 Mbps the polarity status is in the | 6742 | * return 0. If the link speed is 1000 Mbps the polarity status is in the |
6864 | * IGP01E1000_PHY_PCS_INIT_REG. | 6743 | * IGP01E1000_PHY_PCS_INIT_REG. |
6865 | *****************************************************************************/ | 6744 | *****************************************************************************/ |
6866 | static s32 | 6745 | static s32 e1000_check_polarity(struct e1000_hw *hw, |
6867 | e1000_check_polarity(struct e1000_hw *hw, | 6746 | e1000_rev_polarity *polarity) |
6868 | e1000_rev_polarity *polarity) | ||
6869 | { | 6747 | { |
6870 | s32 ret_val; | 6748 | s32 ret_val; |
6871 | u16 phy_data; | 6749 | u16 phy_data; |
@@ -6939,8 +6817,7 @@ e1000_check_polarity(struct e1000_hw *hw, | |||
6939 | * Link Health register. In IGP this bit is latched high, so the driver must | 6817 | * Link Health register. In IGP this bit is latched high, so the driver must |
6940 | * read it immediately after link is established. | 6818 | * read it immediately after link is established. |
6941 | *****************************************************************************/ | 6819 | *****************************************************************************/ |
6942 | static s32 | 6820 | static s32 e1000_check_downshift(struct e1000_hw *hw) |
6943 | e1000_check_downshift(struct e1000_hw *hw) | ||
6944 | { | 6821 | { |
6945 | s32 ret_val; | 6822 | s32 ret_val; |
6946 | u16 phy_data; | 6823 | u16 phy_data; |
@@ -6985,9 +6862,7 @@ e1000_check_downshift(struct e1000_hw *hw) | |||
6985 | * | 6862 | * |
6986 | ****************************************************************************/ | 6863 | ****************************************************************************/ |
6987 | 6864 | ||
6988 | static s32 | 6865 | static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, bool link_up) |
6989 | e1000_config_dsp_after_link_change(struct e1000_hw *hw, | ||
6990 | bool link_up) | ||
6991 | { | 6866 | { |
6992 | s32 ret_val; | 6867 | s32 ret_val; |
6993 | u16 phy_data, phy_saved_data, speed, duplex, i; | 6868 | u16 phy_data, phy_saved_data, speed, duplex, i; |
@@ -7173,8 +7048,7 @@ e1000_config_dsp_after_link_change(struct e1000_hw *hw, | |||
7173 | * | 7048 | * |
7174 | * hw - Struct containing variables accessed by shared code | 7049 | * hw - Struct containing variables accessed by shared code |
7175 | ****************************************************************************/ | 7050 | ****************************************************************************/ |
7176 | static s32 | 7051 | static s32 e1000_set_phy_mode(struct e1000_hw *hw) |
7177 | e1000_set_phy_mode(struct e1000_hw *hw) | ||
7178 | { | 7052 | { |
7179 | s32 ret_val; | 7053 | s32 ret_val; |
7180 | u16 eeprom_data; | 7054 | u16 eeprom_data; |
@@ -7218,9 +7092,7 @@ e1000_set_phy_mode(struct e1000_hw *hw) | |||
7218 | * | 7092 | * |
7219 | ****************************************************************************/ | 7093 | ****************************************************************************/ |
7220 | 7094 | ||
7221 | static s32 | 7095 | static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active) |
7222 | e1000_set_d3_lplu_state(struct e1000_hw *hw, | ||
7223 | bool active) | ||
7224 | { | 7096 | { |
7225 | u32 phy_ctrl = 0; | 7097 | u32 phy_ctrl = 0; |
7226 | s32 ret_val; | 7098 | s32 ret_val; |
@@ -7348,9 +7220,7 @@ e1000_set_d3_lplu_state(struct e1000_hw *hw, | |||
7348 | * | 7220 | * |
7349 | ****************************************************************************/ | 7221 | ****************************************************************************/ |
7350 | 7222 | ||
7351 | static s32 | 7223 | static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active) |
7352 | e1000_set_d0_lplu_state(struct e1000_hw *hw, | ||
7353 | bool active) | ||
7354 | { | 7224 | { |
7355 | u32 phy_ctrl = 0; | 7225 | u32 phy_ctrl = 0; |
7356 | s32 ret_val; | 7226 | s32 ret_val; |
@@ -7439,8 +7309,7 @@ e1000_set_d0_lplu_state(struct e1000_hw *hw, | |||
7439 | * | 7309 | * |
7440 | * hw - Struct containing variables accessed by shared code | 7310 | * hw - Struct containing variables accessed by shared code |
7441 | *****************************************************************************/ | 7311 | *****************************************************************************/ |
7442 | static s32 | 7312 | static s32 e1000_set_vco_speed(struct e1000_hw *hw) |
7443 | e1000_set_vco_speed(struct e1000_hw *hw) | ||
7444 | { | 7313 | { |
7445 | s32 ret_val; | 7314 | s32 ret_val; |
7446 | u16 default_page = 0; | 7315 | u16 default_page = 0; |
@@ -7503,8 +7372,7 @@ e1000_set_vco_speed(struct e1000_hw *hw) | |||
7503 | * | 7372 | * |
7504 | * returns: - E1000_SUCCESS . | 7373 | * returns: - E1000_SUCCESS . |
7505 | ****************************************************************************/ | 7374 | ****************************************************************************/ |
7506 | static s32 | 7375 | static s32 e1000_host_if_read_cookie(struct e1000_hw *hw, u8 *buffer) |
7507 | e1000_host_if_read_cookie(struct e1000_hw * hw, u8 *buffer) | ||
7508 | { | 7376 | { |
7509 | u8 i; | 7377 | u8 i; |
7510 | u32 offset = E1000_MNG_DHCP_COOKIE_OFFSET; | 7378 | u32 offset = E1000_MNG_DHCP_COOKIE_OFFSET; |
@@ -7530,8 +7398,7 @@ e1000_host_if_read_cookie(struct e1000_hw * hw, u8 *buffer) | |||
7530 | * timeout | 7398 | * timeout |
7531 | * - E1000_SUCCESS for success. | 7399 | * - E1000_SUCCESS for success. |
7532 | ****************************************************************************/ | 7400 | ****************************************************************************/ |
7533 | static s32 | 7401 | static s32 e1000_mng_enable_host_if(struct e1000_hw *hw) |
7534 | e1000_mng_enable_host_if(struct e1000_hw * hw) | ||
7535 | { | 7402 | { |
7536 | u32 hicr; | 7403 | u32 hicr; |
7537 | u8 i; | 7404 | u8 i; |
@@ -7564,9 +7431,8 @@ e1000_mng_enable_host_if(struct e1000_hw * hw) | |||
7564 | * | 7431 | * |
7565 | * returns - E1000_SUCCESS for success. | 7432 | * returns - E1000_SUCCESS for success. |
7566 | ****************************************************************************/ | 7433 | ****************************************************************************/ |
7567 | static s32 | 7434 | static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, u16 length, |
7568 | e1000_mng_host_if_write(struct e1000_hw * hw, u8 *buffer, | 7435 | u16 offset, u8 *sum) |
7569 | u16 length, u16 offset, u8 *sum) | ||
7570 | { | 7436 | { |
7571 | u8 *tmp; | 7437 | u8 *tmp; |
7572 | u8 *bufptr = buffer; | 7438 | u8 *bufptr = buffer; |
@@ -7632,9 +7498,8 @@ e1000_mng_host_if_write(struct e1000_hw * hw, u8 *buffer, | |||
7632 | * | 7498 | * |
7633 | * returns - E1000_SUCCESS for success. | 7499 | * returns - E1000_SUCCESS for success. |
7634 | ****************************************************************************/ | 7500 | ****************************************************************************/ |
7635 | static s32 | 7501 | static s32 e1000_mng_write_cmd_header(struct e1000_hw *hw, |
7636 | e1000_mng_write_cmd_header(struct e1000_hw * hw, | 7502 | struct e1000_host_mng_command_header *hdr) |
7637 | struct e1000_host_mng_command_header * hdr) | ||
7638 | { | 7503 | { |
7639 | u16 i; | 7504 | u16 i; |
7640 | u8 sum; | 7505 | u8 sum; |
@@ -7672,8 +7537,7 @@ e1000_mng_write_cmd_header(struct e1000_hw * hw, | |||
7672 | * | 7537 | * |
7673 | * returns - E1000_SUCCESS for success. | 7538 | * returns - E1000_SUCCESS for success. |
7674 | ****************************************************************************/ | 7539 | ****************************************************************************/ |
7675 | static s32 | 7540 | static s32 e1000_mng_write_commit(struct e1000_hw *hw) |
7676 | e1000_mng_write_commit(struct e1000_hw * hw) | ||
7677 | { | 7541 | { |
7678 | u32 hicr; | 7542 | u32 hicr; |
7679 | 7543 | ||
@@ -7690,8 +7554,7 @@ e1000_mng_write_commit(struct e1000_hw * hw) | |||
7690 | * | 7554 | * |
7691 | * returns - true when the mode is IAMT or false. | 7555 | * returns - true when the mode is IAMT or false. |
7692 | ****************************************************************************/ | 7556 | ****************************************************************************/ |
7693 | bool | 7557 | bool e1000_check_mng_mode(struct e1000_hw *hw) |
7694 | e1000_check_mng_mode(struct e1000_hw *hw) | ||
7695 | { | 7558 | { |
7696 | u32 fwsm; | 7559 | u32 fwsm; |
7697 | 7560 | ||
@@ -7712,9 +7575,7 @@ e1000_check_mng_mode(struct e1000_hw *hw) | |||
7712 | /***************************************************************************** | 7575 | /***************************************************************************** |
7713 | * This function writes the dhcp info . | 7576 | * This function writes the dhcp info . |
7714 | ****************************************************************************/ | 7577 | ****************************************************************************/ |
7715 | s32 | 7578 | s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length) |
7716 | e1000_mng_write_dhcp_info(struct e1000_hw * hw, u8 *buffer, | ||
7717 | u16 length) | ||
7718 | { | 7579 | { |
7719 | s32 ret_val; | 7580 | s32 ret_val; |
7720 | struct e1000_host_mng_command_header hdr; | 7581 | struct e1000_host_mng_command_header hdr; |
@@ -7744,8 +7605,7 @@ e1000_mng_write_dhcp_info(struct e1000_hw * hw, u8 *buffer, | |||
7744 | * | 7605 | * |
7745 | * returns - checksum of buffer contents. | 7606 | * returns - checksum of buffer contents. |
7746 | ****************************************************************************/ | 7607 | ****************************************************************************/ |
7747 | static u8 | 7608 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length) |
7748 | e1000_calculate_mng_checksum(char *buffer, u32 length) | ||
7749 | { | 7609 | { |
7750 | u8 sum = 0; | 7610 | u8 sum = 0; |
7751 | u32 i; | 7611 | u32 i; |
@@ -7764,8 +7624,7 @@ e1000_calculate_mng_checksum(char *buffer, u32 length) | |||
7764 | * | 7624 | * |
7765 | * returns - true for packet filtering or false. | 7625 | * returns - true for packet filtering or false. |
7766 | ****************************************************************************/ | 7626 | ****************************************************************************/ |
7767 | bool | 7627 | bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw) |
7768 | e1000_enable_tx_pkt_filtering(struct e1000_hw *hw) | ||
7769 | { | 7628 | { |
7770 | /* called in init as well as watchdog timer functions */ | 7629 | /* called in init as well as watchdog timer functions */ |
7771 | 7630 | ||
@@ -7806,8 +7665,7 @@ e1000_enable_tx_pkt_filtering(struct e1000_hw *hw) | |||
7806 | * returns: - true/false | 7665 | * returns: - true/false |
7807 | * | 7666 | * |
7808 | *****************************************************************************/ | 7667 | *****************************************************************************/ |
7809 | u32 | 7668 | u32 e1000_enable_mng_pass_thru(struct e1000_hw *hw) |
7810 | e1000_enable_mng_pass_thru(struct e1000_hw *hw) | ||
7811 | { | 7669 | { |
7812 | u32 manc; | 7670 | u32 manc; |
7813 | u32 fwsm, factps; | 7671 | u32 fwsm, factps; |
@@ -7832,8 +7690,7 @@ e1000_enable_mng_pass_thru(struct e1000_hw *hw) | |||
7832 | return false; | 7690 | return false; |
7833 | } | 7691 | } |
7834 | 7692 | ||
7835 | static s32 | 7693 | static s32 e1000_polarity_reversal_workaround(struct e1000_hw *hw) |
7836 | e1000_polarity_reversal_workaround(struct e1000_hw *hw) | ||
7837 | { | 7694 | { |
7838 | s32 ret_val; | 7695 | s32 ret_val; |
7839 | u16 mii_status_reg; | 7696 | u16 mii_status_reg; |
@@ -7926,8 +7783,7 @@ e1000_polarity_reversal_workaround(struct e1000_hw *hw) | |||
7926 | * returns: - none. | 7783 | * returns: - none. |
7927 | * | 7784 | * |
7928 | ***************************************************************************/ | 7785 | ***************************************************************************/ |
7929 | static void | 7786 | static void e1000_set_pci_express_master_disable(struct e1000_hw *hw) |
7930 | e1000_set_pci_express_master_disable(struct e1000_hw *hw) | ||
7931 | { | 7787 | { |
7932 | u32 ctrl; | 7788 | u32 ctrl; |
7933 | 7789 | ||
@@ -7952,8 +7808,7 @@ e1000_set_pci_express_master_disable(struct e1000_hw *hw) | |||
7952 | * E1000_SUCCESS master requests disabled. | 7808 | * E1000_SUCCESS master requests disabled. |
7953 | * | 7809 | * |
7954 | ******************************************************************************/ | 7810 | ******************************************************************************/ |
7955 | s32 | 7811 | s32 e1000_disable_pciex_master(struct e1000_hw *hw) |
7956 | e1000_disable_pciex_master(struct e1000_hw *hw) | ||
7957 | { | 7812 | { |
7958 | s32 timeout = MASTER_DISABLE_TIMEOUT; /* 80ms */ | 7813 | s32 timeout = MASTER_DISABLE_TIMEOUT; /* 80ms */ |
7959 | 7814 | ||
@@ -7990,8 +7845,7 @@ e1000_disable_pciex_master(struct e1000_hw *hw) | |||
7990 | * E1000_SUCCESS at any other case. | 7845 | * E1000_SUCCESS at any other case. |
7991 | * | 7846 | * |
7992 | ******************************************************************************/ | 7847 | ******************************************************************************/ |
7993 | static s32 | 7848 | static s32 e1000_get_auto_rd_done(struct e1000_hw *hw) |
7994 | e1000_get_auto_rd_done(struct e1000_hw *hw) | ||
7995 | { | 7849 | { |
7996 | s32 timeout = AUTO_READ_DONE_TIMEOUT; | 7850 | s32 timeout = AUTO_READ_DONE_TIMEOUT; |
7997 | 7851 | ||
@@ -8038,8 +7892,7 @@ e1000_get_auto_rd_done(struct e1000_hw *hw) | |||
8038 | * E1000_SUCCESS at any other case. | 7892 | * E1000_SUCCESS at any other case. |
8039 | * | 7893 | * |
8040 | ***************************************************************************/ | 7894 | ***************************************************************************/ |
8041 | static s32 | 7895 | static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw) |
8042 | e1000_get_phy_cfg_done(struct e1000_hw *hw) | ||
8043 | { | 7896 | { |
8044 | s32 timeout = PHY_CFG_TIMEOUT; | 7897 | s32 timeout = PHY_CFG_TIMEOUT; |
8045 | u32 cfg_mask = E1000_EEPROM_CFG_DONE; | 7898 | u32 cfg_mask = E1000_EEPROM_CFG_DONE; |
@@ -8085,8 +7938,7 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw) | |||
8085 | * E1000_SUCCESS at any other case. | 7938 | * E1000_SUCCESS at any other case. |
8086 | * | 7939 | * |
8087 | ***************************************************************************/ | 7940 | ***************************************************************************/ |
8088 | static s32 | 7941 | static s32 e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) |
8089 | e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) | ||
8090 | { | 7942 | { |
8091 | s32 timeout; | 7943 | s32 timeout; |
8092 | u32 swsm; | 7944 | u32 swsm; |
@@ -8135,8 +7987,7 @@ e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) | |||
8135 | * returns: - None. | 7987 | * returns: - None. |
8136 | * | 7988 | * |
8137 | ***************************************************************************/ | 7989 | ***************************************************************************/ |
8138 | static void | 7990 | static void e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw) |
8139 | e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw) | ||
8140 | { | 7991 | { |
8141 | u32 swsm; | 7992 | u32 swsm; |
8142 | 7993 | ||
@@ -8164,8 +8015,7 @@ e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw) | |||
8164 | * E1000_SUCCESS at any other case. | 8015 | * E1000_SUCCESS at any other case. |
8165 | * | 8016 | * |
8166 | ***************************************************************************/ | 8017 | ***************************************************************************/ |
8167 | static s32 | 8018 | static s32 e1000_get_software_semaphore(struct e1000_hw *hw) |
8168 | e1000_get_software_semaphore(struct e1000_hw *hw) | ||
8169 | { | 8019 | { |
8170 | s32 timeout = hw->eeprom.word_size + 1; | 8020 | s32 timeout = hw->eeprom.word_size + 1; |
8171 | u32 swsm; | 8021 | u32 swsm; |
@@ -8200,8 +8050,7 @@ e1000_get_software_semaphore(struct e1000_hw *hw) | |||
8200 | * hw: Struct containing variables accessed by shared code | 8050 | * hw: Struct containing variables accessed by shared code |
8201 | * | 8051 | * |
8202 | ***************************************************************************/ | 8052 | ***************************************************************************/ |
8203 | static void | 8053 | static void e1000_release_software_semaphore(struct e1000_hw *hw) |
8204 | e1000_release_software_semaphore(struct e1000_hw *hw) | ||
8205 | { | 8054 | { |
8206 | u32 swsm; | 8055 | u32 swsm; |
8207 | 8056 | ||
@@ -8228,8 +8077,7 @@ e1000_release_software_semaphore(struct e1000_hw *hw) | |||
8228 | * E1000_SUCCESS | 8077 | * E1000_SUCCESS |
8229 | * | 8078 | * |
8230 | *****************************************************************************/ | 8079 | *****************************************************************************/ |
8231 | s32 | 8080 | s32 e1000_check_phy_reset_block(struct e1000_hw *hw) |
8232 | e1000_check_phy_reset_block(struct e1000_hw *hw) | ||
8233 | { | 8081 | { |
8234 | u32 manc = 0; | 8082 | u32 manc = 0; |
8235 | u32 fwsm = 0; | 8083 | u32 fwsm = 0; |
@@ -8246,8 +8094,7 @@ e1000_check_phy_reset_block(struct e1000_hw *hw) | |||
8246 | E1000_BLK_PHY_RESET : E1000_SUCCESS; | 8094 | E1000_BLK_PHY_RESET : E1000_SUCCESS; |
8247 | } | 8095 | } |
8248 | 8096 | ||
8249 | static u8 | 8097 | static u8 e1000_arc_subsystem_valid(struct e1000_hw *hw) |
8250 | e1000_arc_subsystem_valid(struct e1000_hw *hw) | ||
8251 | { | 8098 | { |
8252 | u32 fwsm; | 8099 | u32 fwsm; |
8253 | 8100 | ||
@@ -8283,8 +8130,7 @@ e1000_arc_subsystem_valid(struct e1000_hw *hw) | |||
8283 | * returns: E1000_SUCCESS | 8130 | * returns: E1000_SUCCESS |
8284 | * | 8131 | * |
8285 | *****************************************************************************/ | 8132 | *****************************************************************************/ |
8286 | static s32 | 8133 | static s32 e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, u32 no_snoop) |
8287 | e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, u32 no_snoop) | ||
8288 | { | 8134 | { |
8289 | u32 gcr_reg = 0; | 8135 | u32 gcr_reg = 0; |
8290 | 8136 | ||
@@ -8324,8 +8170,7 @@ e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, u32 no_snoop) | |||
8324 | * hw: Struct containing variables accessed by shared code | 8170 | * hw: Struct containing variables accessed by shared code |
8325 | * | 8171 | * |
8326 | ***************************************************************************/ | 8172 | ***************************************************************************/ |
8327 | static s32 | 8173 | static s32 e1000_get_software_flag(struct e1000_hw *hw) |
8328 | e1000_get_software_flag(struct e1000_hw *hw) | ||
8329 | { | 8174 | { |
8330 | s32 timeout = PHY_CFG_TIMEOUT; | 8175 | s32 timeout = PHY_CFG_TIMEOUT; |
8331 | u32 extcnf_ctrl; | 8176 | u32 extcnf_ctrl; |
@@ -8363,8 +8208,7 @@ e1000_get_software_flag(struct e1000_hw *hw) | |||
8363 | * hw: Struct containing variables accessed by shared code | 8208 | * hw: Struct containing variables accessed by shared code |
8364 | * | 8209 | * |
8365 | ***************************************************************************/ | 8210 | ***************************************************************************/ |
8366 | static void | 8211 | static void e1000_release_software_flag(struct e1000_hw *hw) |
8367 | e1000_release_software_flag(struct e1000_hw *hw) | ||
8368 | { | 8212 | { |
8369 | u32 extcnf_ctrl; | 8213 | u32 extcnf_ctrl; |
8370 | 8214 | ||
@@ -8388,9 +8232,8 @@ e1000_release_software_flag(struct e1000_hw *hw) | |||
8388 | * data - word read from the EEPROM | 8232 | * data - word read from the EEPROM |
8389 | * words - number of words to read | 8233 | * words - number of words to read |
8390 | *****************************************************************************/ | 8234 | *****************************************************************************/ |
8391 | static s32 | 8235 | static s32 e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, |
8392 | e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | 8236 | u16 *data) |
8393 | u16 *data) | ||
8394 | { | 8237 | { |
8395 | s32 error = E1000_SUCCESS; | 8238 | s32 error = E1000_SUCCESS; |
8396 | u32 flash_bank = 0; | 8239 | u32 flash_bank = 0; |
@@ -8444,9 +8287,8 @@ e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | |||
8444 | * words - number of words to write | 8287 | * words - number of words to write |
8445 | * data - words to write to the EEPROM | 8288 | * data - words to write to the EEPROM |
8446 | *****************************************************************************/ | 8289 | *****************************************************************************/ |
8447 | static s32 | 8290 | static s32 e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, |
8448 | e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | 8291 | u16 *data) |
8449 | u16 *data) | ||
8450 | { | 8292 | { |
8451 | u32 i = 0; | 8293 | u32 i = 0; |
8452 | s32 error = E1000_SUCCESS; | 8294 | s32 error = E1000_SUCCESS; |
@@ -8491,8 +8333,7 @@ e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | |||
8491 | * | 8333 | * |
8492 | * hw - The pointer to the hw structure | 8334 | * hw - The pointer to the hw structure |
8493 | ****************************************************************************/ | 8335 | ****************************************************************************/ |
8494 | static s32 | 8336 | static s32 e1000_ich8_cycle_init(struct e1000_hw *hw) |
8495 | e1000_ich8_cycle_init(struct e1000_hw *hw) | ||
8496 | { | 8337 | { |
8497 | union ich8_hws_flash_status hsfsts; | 8338 | union ich8_hws_flash_status hsfsts; |
8498 | s32 error = E1000_ERR_EEPROM; | 8339 | s32 error = E1000_ERR_EEPROM; |
@@ -8558,8 +8399,7 @@ e1000_ich8_cycle_init(struct e1000_hw *hw) | |||
8558 | * | 8399 | * |
8559 | * hw - The pointer to the hw structure | 8400 | * hw - The pointer to the hw structure |
8560 | ****************************************************************************/ | 8401 | ****************************************************************************/ |
8561 | static s32 | 8402 | static s32 e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout) |
8562 | e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout) | ||
8563 | { | 8403 | { |
8564 | union ich8_hws_flash_ctrl hsflctl; | 8404 | union ich8_hws_flash_ctrl hsflctl; |
8565 | union ich8_hws_flash_status hsfsts; | 8405 | union ich8_hws_flash_status hsfsts; |
@@ -8593,9 +8433,8 @@ e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout) | |||
8593 | * size - Size of data to read, 1=byte 2=word | 8433 | * size - Size of data to read, 1=byte 2=word |
8594 | * data - Pointer to the word to store the value read. | 8434 | * data - Pointer to the word to store the value read. |
8595 | *****************************************************************************/ | 8435 | *****************************************************************************/ |
8596 | static s32 | 8436 | static s32 e1000_read_ich8_data(struct e1000_hw *hw, u32 index, u32 size, |
8597 | e1000_read_ich8_data(struct e1000_hw *hw, u32 index, | 8437 | u16 *data) |
8598 | u32 size, u16* data) | ||
8599 | { | 8438 | { |
8600 | union ich8_hws_flash_status hsfsts; | 8439 | union ich8_hws_flash_status hsfsts; |
8601 | union ich8_hws_flash_ctrl hsflctl; | 8440 | union ich8_hws_flash_ctrl hsflctl; |
@@ -8672,9 +8511,8 @@ e1000_read_ich8_data(struct e1000_hw *hw, u32 index, | |||
8672 | * size - Size of data to read, 1=byte 2=word | 8511 | * size - Size of data to read, 1=byte 2=word |
8673 | * data - The byte(s) to write to the NVM. | 8512 | * data - The byte(s) to write to the NVM. |
8674 | *****************************************************************************/ | 8513 | *****************************************************************************/ |
8675 | static s32 | 8514 | static s32 e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, |
8676 | e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, | 8515 | u16 data) |
8677 | u16 data) | ||
8678 | { | 8516 | { |
8679 | union ich8_hws_flash_status hsfsts; | 8517 | union ich8_hws_flash_status hsfsts; |
8680 | union ich8_hws_flash_ctrl hsflctl; | 8518 | union ich8_hws_flash_ctrl hsflctl; |
@@ -8747,8 +8585,7 @@ e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, | |||
8747 | * index - The index of the byte to read. | 8585 | * index - The index of the byte to read. |
8748 | * data - Pointer to a byte to store the value read. | 8586 | * data - Pointer to a byte to store the value read. |
8749 | *****************************************************************************/ | 8587 | *****************************************************************************/ |
8750 | static s32 | 8588 | static s32 e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8 *data) |
8751 | e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8* data) | ||
8752 | { | 8589 | { |
8753 | s32 status = E1000_SUCCESS; | 8590 | s32 status = E1000_SUCCESS; |
8754 | u16 word = 0; | 8591 | u16 word = 0; |
@@ -8770,8 +8607,7 @@ e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8* data) | |||
8770 | * index - The index of the byte to write. | 8607 | * index - The index of the byte to write. |
8771 | * byte - The byte to write to the NVM. | 8608 | * byte - The byte to write to the NVM. |
8772 | *****************************************************************************/ | 8609 | *****************************************************************************/ |
8773 | static s32 | 8610 | static s32 e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte) |
8774 | e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte) | ||
8775 | { | 8611 | { |
8776 | s32 error = E1000_SUCCESS; | 8612 | s32 error = E1000_SUCCESS; |
8777 | s32 program_retries = 0; | 8613 | s32 program_retries = 0; |
@@ -8803,8 +8639,7 @@ e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte) | |||
8803 | * index - The index of the byte to read. | 8639 | * index - The index of the byte to read. |
8804 | * data - The byte to write to the NVM. | 8640 | * data - The byte to write to the NVM. |
8805 | *****************************************************************************/ | 8641 | *****************************************************************************/ |
8806 | static s32 | 8642 | static s32 e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 data) |
8807 | e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 data) | ||
8808 | { | 8643 | { |
8809 | s32 status = E1000_SUCCESS; | 8644 | s32 status = E1000_SUCCESS; |
8810 | u16 word = (u16)data; | 8645 | u16 word = (u16)data; |
@@ -8821,8 +8656,7 @@ e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 data) | |||
8821 | * index - The starting byte index of the word to read. | 8656 | * index - The starting byte index of the word to read. |
8822 | * data - Pointer to a word to store the value read. | 8657 | * data - Pointer to a word to store the value read. |
8823 | *****************************************************************************/ | 8658 | *****************************************************************************/ |
8824 | static s32 | 8659 | static s32 e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data) |
8825 | e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data) | ||
8826 | { | 8660 | { |
8827 | s32 status = E1000_SUCCESS; | 8661 | s32 status = E1000_SUCCESS; |
8828 | status = e1000_read_ich8_data(hw, index, 2, data); | 8662 | status = e1000_read_ich8_data(hw, index, 2, data); |
@@ -8840,8 +8674,7 @@ e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data) | |||
8840 | * amount of NVM used in each bank is a *minimum* of 4 KBytes, but in fact the | 8674 | * amount of NVM used in each bank is a *minimum* of 4 KBytes, but in fact the |
8841 | * bank size may be 4, 8 or 64 KBytes | 8675 | * bank size may be 4, 8 or 64 KBytes |
8842 | *****************************************************************************/ | 8676 | *****************************************************************************/ |
8843 | static s32 | 8677 | static s32 e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank) |
8844 | e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank) | ||
8845 | { | 8678 | { |
8846 | union ich8_hws_flash_status hsfsts; | 8679 | union ich8_hws_flash_status hsfsts; |
8847 | union ich8_hws_flash_ctrl hsflctl; | 8680 | union ich8_hws_flash_ctrl hsflctl; |
@@ -8930,9 +8763,9 @@ e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank) | |||
8930 | return error; | 8763 | return error; |
8931 | } | 8764 | } |
8932 | 8765 | ||
8933 | static s32 | 8766 | static s32 e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, |
8934 | e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, | 8767 | u32 cnf_base_addr, |
8935 | u32 cnf_base_addr, u32 cnf_size) | 8768 | u32 cnf_size) |
8936 | { | 8769 | { |
8937 | u32 ret_val = E1000_SUCCESS; | 8770 | u32 ret_val = E1000_SUCCESS; |
8938 | u16 word_addr, reg_data, reg_addr; | 8771 | u16 word_addr, reg_data, reg_addr; |
@@ -8972,8 +8805,7 @@ e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, | |||
8972 | * | 8805 | * |
8973 | * hw: Struct containing variables accessed by shared code | 8806 | * hw: Struct containing variables accessed by shared code |
8974 | *****************************************************************************/ | 8807 | *****************************************************************************/ |
8975 | static s32 | 8808 | static s32 e1000_init_lcd_from_nvm(struct e1000_hw *hw) |
8976 | e1000_init_lcd_from_nvm(struct e1000_hw *hw) | ||
8977 | { | 8809 | { |
8978 | u32 reg_data, cnf_base_addr, cnf_size, ret_val, loop; | 8810 | u32 reg_data, cnf_base_addr, cnf_size, ret_val, loop; |
8979 | 8811 | ||
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index cf12b05cd011..9a20ba39346b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -232,8 +232,7 @@ MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); | |||
232 | * loaded. All it does is register with the PCI subsystem. | 232 | * loaded. All it does is register with the PCI subsystem. |
233 | **/ | 233 | **/ |
234 | 234 | ||
235 | static int __init | 235 | static int __init e1000_init_module(void) |
236 | e1000_init_module(void) | ||
237 | { | 236 | { |
238 | int ret; | 237 | int ret; |
239 | printk(KERN_INFO "%s - version %s\n", | 238 | printk(KERN_INFO "%s - version %s\n", |
@@ -261,8 +260,7 @@ module_init(e1000_init_module); | |||
261 | * from memory. | 260 | * from memory. |
262 | **/ | 261 | **/ |
263 | 262 | ||
264 | static void __exit | 263 | static void __exit e1000_exit_module(void) |
265 | e1000_exit_module(void) | ||
266 | { | 264 | { |
267 | pci_unregister_driver(&e1000_driver); | 265 | pci_unregister_driver(&e1000_driver); |
268 | } | 266 | } |
@@ -311,8 +309,7 @@ static void e1000_free_irq(struct e1000_adapter *adapter) | |||
311 | * @adapter: board private structure | 309 | * @adapter: board private structure |
312 | **/ | 310 | **/ |
313 | 311 | ||
314 | static void | 312 | static void e1000_irq_disable(struct e1000_adapter *adapter) |
315 | e1000_irq_disable(struct e1000_adapter *adapter) | ||
316 | { | 313 | { |
317 | E1000_WRITE_REG(&adapter->hw, IMC, ~0); | 314 | E1000_WRITE_REG(&adapter->hw, IMC, ~0); |
318 | E1000_WRITE_FLUSH(&adapter->hw); | 315 | E1000_WRITE_FLUSH(&adapter->hw); |
@@ -324,15 +321,13 @@ e1000_irq_disable(struct e1000_adapter *adapter) | |||
324 | * @adapter: board private structure | 321 | * @adapter: board private structure |
325 | **/ | 322 | **/ |
326 | 323 | ||
327 | static void | 324 | static void e1000_irq_enable(struct e1000_adapter *adapter) |
328 | e1000_irq_enable(struct e1000_adapter *adapter) | ||
329 | { | 325 | { |
330 | E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK); | 326 | E1000_WRITE_REG(&adapter->hw, IMS, IMS_ENABLE_MASK); |
331 | E1000_WRITE_FLUSH(&adapter->hw); | 327 | E1000_WRITE_FLUSH(&adapter->hw); |
332 | } | 328 | } |
333 | 329 | ||
334 | static void | 330 | static void e1000_update_mng_vlan(struct e1000_adapter *adapter) |
335 | e1000_update_mng_vlan(struct e1000_adapter *adapter) | ||
336 | { | 331 | { |
337 | struct net_device *netdev = adapter->netdev; | 332 | struct net_device *netdev = adapter->netdev; |
338 | u16 vid = adapter->hw.mng_cookie.vlan_id; | 333 | u16 vid = adapter->hw.mng_cookie.vlan_id; |
@@ -366,8 +361,7 @@ e1000_update_mng_vlan(struct e1000_adapter *adapter) | |||
366 | * | 361 | * |
367 | **/ | 362 | **/ |
368 | 363 | ||
369 | static void | 364 | static void e1000_release_hw_control(struct e1000_adapter *adapter) |
370 | e1000_release_hw_control(struct e1000_adapter *adapter) | ||
371 | { | 365 | { |
372 | u32 ctrl_ext; | 366 | u32 ctrl_ext; |
373 | u32 swsm; | 367 | u32 swsm; |
@@ -403,8 +397,7 @@ e1000_release_hw_control(struct e1000_adapter *adapter) | |||
403 | * | 397 | * |
404 | **/ | 398 | **/ |
405 | 399 | ||
406 | static void | 400 | static void e1000_get_hw_control(struct e1000_adapter *adapter) |
407 | e1000_get_hw_control(struct e1000_adapter *adapter) | ||
408 | { | 401 | { |
409 | u32 ctrl_ext; | 402 | u32 ctrl_ext; |
410 | u32 swsm; | 403 | u32 swsm; |
@@ -429,8 +422,7 @@ e1000_get_hw_control(struct e1000_adapter *adapter) | |||
429 | } | 422 | } |
430 | } | 423 | } |
431 | 424 | ||
432 | static void | 425 | static void e1000_init_manageability(struct e1000_adapter *adapter) |
433 | e1000_init_manageability(struct e1000_adapter *adapter) | ||
434 | { | 426 | { |
435 | if (adapter->en_mng_pt) { | 427 | if (adapter->en_mng_pt) { |
436 | u32 manc = E1000_READ_REG(&adapter->hw, MANC); | 428 | u32 manc = E1000_READ_REG(&adapter->hw, MANC); |
@@ -456,8 +448,7 @@ e1000_init_manageability(struct e1000_adapter *adapter) | |||
456 | } | 448 | } |
457 | } | 449 | } |
458 | 450 | ||
459 | static void | 451 | static void e1000_release_manageability(struct e1000_adapter *adapter) |
460 | e1000_release_manageability(struct e1000_adapter *adapter) | ||
461 | { | 452 | { |
462 | if (adapter->en_mng_pt) { | 453 | if (adapter->en_mng_pt) { |
463 | u32 manc = E1000_READ_REG(&adapter->hw, MANC); | 454 | u32 manc = E1000_READ_REG(&adapter->hw, MANC); |
@@ -591,8 +582,7 @@ out: | |||
591 | return; | 582 | return; |
592 | } | 583 | } |
593 | 584 | ||
594 | void | 585 | void e1000_down(struct e1000_adapter *adapter) |
595 | e1000_down(struct e1000_adapter *adapter) | ||
596 | { | 586 | { |
597 | struct net_device *netdev = adapter->netdev; | 587 | struct net_device *netdev = adapter->netdev; |
598 | 588 | ||
@@ -620,8 +610,7 @@ e1000_down(struct e1000_adapter *adapter) | |||
620 | e1000_clean_all_rx_rings(adapter); | 610 | e1000_clean_all_rx_rings(adapter); |
621 | } | 611 | } |
622 | 612 | ||
623 | void | 613 | void e1000_reinit_locked(struct e1000_adapter *adapter) |
624 | e1000_reinit_locked(struct e1000_adapter *adapter) | ||
625 | { | 614 | { |
626 | WARN_ON(in_interrupt()); | 615 | WARN_ON(in_interrupt()); |
627 | while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) | 616 | while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) |
@@ -631,8 +620,7 @@ e1000_reinit_locked(struct e1000_adapter *adapter) | |||
631 | clear_bit(__E1000_RESETTING, &adapter->flags); | 620 | clear_bit(__E1000_RESETTING, &adapter->flags); |
632 | } | 621 | } |
633 | 622 | ||
634 | void | 623 | void e1000_reset(struct e1000_adapter *adapter) |
635 | e1000_reset(struct e1000_adapter *adapter) | ||
636 | { | 624 | { |
637 | u32 pba = 0, tx_space, min_tx_space, min_rx_space; | 625 | u32 pba = 0, tx_space, min_tx_space, min_rx_space; |
638 | u16 fc_high_water_mark = E1000_FC_HIGH_DIFF; | 626 | u16 fc_high_water_mark = E1000_FC_HIGH_DIFF; |
@@ -1231,8 +1219,7 @@ err_dma: | |||
1231 | * memory. | 1219 | * memory. |
1232 | **/ | 1220 | **/ |
1233 | 1221 | ||
1234 | static void __devexit | 1222 | static void __devexit e1000_remove(struct pci_dev *pdev) |
1235 | e1000_remove(struct pci_dev *pdev) | ||
1236 | { | 1223 | { |
1237 | struct net_device *netdev = pci_get_drvdata(pdev); | 1224 | struct net_device *netdev = pci_get_drvdata(pdev); |
1238 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1225 | struct e1000_adapter *adapter = netdev_priv(netdev); |
@@ -1283,8 +1270,7 @@ e1000_remove(struct pci_dev *pdev) | |||
1283 | * OS network device settings (MTU size). | 1270 | * OS network device settings (MTU size). |
1284 | **/ | 1271 | **/ |
1285 | 1272 | ||
1286 | static int __devinit | 1273 | static int __devinit e1000_sw_init(struct e1000_adapter *adapter) |
1287 | e1000_sw_init(struct e1000_adapter *adapter) | ||
1288 | { | 1274 | { |
1289 | struct e1000_hw *hw = &adapter->hw; | 1275 | struct e1000_hw *hw = &adapter->hw; |
1290 | struct net_device *netdev = adapter->netdev; | 1276 | struct net_device *netdev = adapter->netdev; |
@@ -1377,8 +1363,7 @@ e1000_sw_init(struct e1000_adapter *adapter) | |||
1377 | * intended for Multiqueue, but should work fine with a single queue. | 1363 | * intended for Multiqueue, but should work fine with a single queue. |
1378 | **/ | 1364 | **/ |
1379 | 1365 | ||
1380 | static int __devinit | 1366 | static int __devinit e1000_alloc_queues(struct e1000_adapter *adapter) |
1381 | e1000_alloc_queues(struct e1000_adapter *adapter) | ||
1382 | { | 1367 | { |
1383 | adapter->tx_ring = kcalloc(adapter->num_tx_queues, | 1368 | adapter->tx_ring = kcalloc(adapter->num_tx_queues, |
1384 | sizeof(struct e1000_tx_ring), GFP_KERNEL); | 1369 | sizeof(struct e1000_tx_ring), GFP_KERNEL); |
@@ -1419,8 +1404,7 @@ e1000_alloc_queues(struct e1000_adapter *adapter) | |||
1419 | * and the stack is notified that the interface is ready. | 1404 | * and the stack is notified that the interface is ready. |
1420 | **/ | 1405 | **/ |
1421 | 1406 | ||
1422 | static int | 1407 | static int e1000_open(struct net_device *netdev) |
1423 | e1000_open(struct net_device *netdev) | ||
1424 | { | 1408 | { |
1425 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1409 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1426 | int err; | 1410 | int err; |
@@ -1503,8 +1487,7 @@ err_setup_tx: | |||
1503 | * hardware, and all transmit and receive resources are freed. | 1487 | * hardware, and all transmit and receive resources are freed. |
1504 | **/ | 1488 | **/ |
1505 | 1489 | ||
1506 | static int | 1490 | static int e1000_close(struct net_device *netdev) |
1507 | e1000_close(struct net_device *netdev) | ||
1508 | { | 1491 | { |
1509 | struct e1000_adapter *adapter = netdev_priv(netdev); | 1492 | struct e1000_adapter *adapter = netdev_priv(netdev); |
1510 | 1493 | ||
@@ -1540,9 +1523,8 @@ e1000_close(struct net_device *netdev) | |||
1540 | * @start: address of beginning of memory | 1523 | * @start: address of beginning of memory |
1541 | * @len: length of memory | 1524 | * @len: length of memory |
1542 | **/ | 1525 | **/ |
1543 | static bool | 1526 | static bool e1000_check_64k_bound(struct e1000_adapter *adapter, void *start, |
1544 | e1000_check_64k_bound(struct e1000_adapter *adapter, | 1527 | unsigned long len) |
1545 | void *start, unsigned long len) | ||
1546 | { | 1528 | { |
1547 | unsigned long begin = (unsigned long) start; | 1529 | unsigned long begin = (unsigned long) start; |
1548 | unsigned long end = begin + len; | 1530 | unsigned long end = begin + len; |
@@ -1565,9 +1547,8 @@ e1000_check_64k_bound(struct e1000_adapter *adapter, | |||
1565 | * Return 0 on success, negative on failure | 1547 | * Return 0 on success, negative on failure |
1566 | **/ | 1548 | **/ |
1567 | 1549 | ||
1568 | static int | 1550 | static int e1000_setup_tx_resources(struct e1000_adapter *adapter, |
1569 | e1000_setup_tx_resources(struct e1000_adapter *adapter, | 1551 | struct e1000_tx_ring *txdr) |
1570 | struct e1000_tx_ring *txdr) | ||
1571 | { | 1552 | { |
1572 | struct pci_dev *pdev = adapter->pdev; | 1553 | struct pci_dev *pdev = adapter->pdev; |
1573 | int size; | 1554 | int size; |
@@ -1641,8 +1622,7 @@ setup_tx_desc_die: | |||
1641 | * Return 0 on success, negative on failure | 1622 | * Return 0 on success, negative on failure |
1642 | **/ | 1623 | **/ |
1643 | 1624 | ||
1644 | int | 1625 | int e1000_setup_all_tx_resources(struct e1000_adapter *adapter) |
1645 | e1000_setup_all_tx_resources(struct e1000_adapter *adapter) | ||
1646 | { | 1626 | { |
1647 | int i, err = 0; | 1627 | int i, err = 0; |
1648 | 1628 | ||
@@ -1668,8 +1648,7 @@ e1000_setup_all_tx_resources(struct e1000_adapter *adapter) | |||
1668 | * Configure the Tx unit of the MAC after a reset. | 1648 | * Configure the Tx unit of the MAC after a reset. |
1669 | **/ | 1649 | **/ |
1670 | 1650 | ||
1671 | static void | 1651 | static void e1000_configure_tx(struct e1000_adapter *adapter) |
1672 | e1000_configure_tx(struct e1000_adapter *adapter) | ||
1673 | { | 1652 | { |
1674 | u64 tdba; | 1653 | u64 tdba; |
1675 | struct e1000_hw *hw = &adapter->hw; | 1654 | struct e1000_hw *hw = &adapter->hw; |
@@ -1782,9 +1761,8 @@ e1000_configure_tx(struct e1000_adapter *adapter) | |||
1782 | * Returns 0 on success, negative on failure | 1761 | * Returns 0 on success, negative on failure |
1783 | **/ | 1762 | **/ |
1784 | 1763 | ||
1785 | static int | 1764 | static int e1000_setup_rx_resources(struct e1000_adapter *adapter, |
1786 | e1000_setup_rx_resources(struct e1000_adapter *adapter, | 1765 | struct e1000_rx_ring *rxdr) |
1787 | struct e1000_rx_ring *rxdr) | ||
1788 | { | 1766 | { |
1789 | struct pci_dev *pdev = adapter->pdev; | 1767 | struct pci_dev *pdev = adapter->pdev; |
1790 | int size, desc_len; | 1768 | int size, desc_len; |
@@ -1887,8 +1865,7 @@ setup_rx_desc_die: | |||
1887 | * Return 0 on success, negative on failure | 1865 | * Return 0 on success, negative on failure |
1888 | **/ | 1866 | **/ |
1889 | 1867 | ||
1890 | int | 1868 | int e1000_setup_all_rx_resources(struct e1000_adapter *adapter) |
1891 | e1000_setup_all_rx_resources(struct e1000_adapter *adapter) | ||
1892 | { | 1869 | { |
1893 | int i, err = 0; | 1870 | int i, err = 0; |
1894 | 1871 | ||
@@ -1913,8 +1890,7 @@ e1000_setup_all_rx_resources(struct e1000_adapter *adapter) | |||
1913 | **/ | 1890 | **/ |
1914 | #define PAGE_USE_COUNT(S) (((S) >> PAGE_SHIFT) + \ | 1891 | #define PAGE_USE_COUNT(S) (((S) >> PAGE_SHIFT) + \ |
1915 | (((S) & (PAGE_SIZE - 1)) ? 1 : 0)) | 1892 | (((S) & (PAGE_SIZE - 1)) ? 1 : 0)) |
1916 | static void | 1893 | static void e1000_setup_rctl(struct e1000_adapter *adapter) |
1917 | e1000_setup_rctl(struct e1000_adapter *adapter) | ||
1918 | { | 1894 | { |
1919 | u32 rctl, rfctl; | 1895 | u32 rctl, rfctl; |
1920 | u32 psrctl = 0; | 1896 | u32 psrctl = 0; |
@@ -2031,8 +2007,7 @@ e1000_setup_rctl(struct e1000_adapter *adapter) | |||
2031 | * Configure the Rx unit of the MAC after a reset. | 2007 | * Configure the Rx unit of the MAC after a reset. |
2032 | **/ | 2008 | **/ |
2033 | 2009 | ||
2034 | static void | 2010 | static void e1000_configure_rx(struct e1000_adapter *adapter) |
2035 | e1000_configure_rx(struct e1000_adapter *adapter) | ||
2036 | { | 2011 | { |
2037 | u64 rdba; | 2012 | u64 rdba; |
2038 | struct e1000_hw *hw = &adapter->hw; | 2013 | struct e1000_hw *hw = &adapter->hw; |
@@ -2131,9 +2106,8 @@ e1000_configure_rx(struct e1000_adapter *adapter) | |||
2131 | * Free all transmit software resources | 2106 | * Free all transmit software resources |
2132 | **/ | 2107 | **/ |
2133 | 2108 | ||
2134 | static void | 2109 | static void e1000_free_tx_resources(struct e1000_adapter *adapter, |
2135 | e1000_free_tx_resources(struct e1000_adapter *adapter, | 2110 | struct e1000_tx_ring *tx_ring) |
2136 | struct e1000_tx_ring *tx_ring) | ||
2137 | { | 2111 | { |
2138 | struct pci_dev *pdev = adapter->pdev; | 2112 | struct pci_dev *pdev = adapter->pdev; |
2139 | 2113 | ||
@@ -2154,8 +2128,7 @@ e1000_free_tx_resources(struct e1000_adapter *adapter, | |||
2154 | * Free all transmit software resources | 2128 | * Free all transmit software resources |
2155 | **/ | 2129 | **/ |
2156 | 2130 | ||
2157 | void | 2131 | void e1000_free_all_tx_resources(struct e1000_adapter *adapter) |
2158 | e1000_free_all_tx_resources(struct e1000_adapter *adapter) | ||
2159 | { | 2132 | { |
2160 | int i; | 2133 | int i; |
2161 | 2134 | ||
@@ -2163,9 +2136,8 @@ e1000_free_all_tx_resources(struct e1000_adapter *adapter) | |||
2163 | e1000_free_tx_resources(adapter, &adapter->tx_ring[i]); | 2136 | e1000_free_tx_resources(adapter, &adapter->tx_ring[i]); |
2164 | } | 2137 | } |
2165 | 2138 | ||
2166 | static void | 2139 | static void e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter, |
2167 | e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter, | 2140 | struct e1000_buffer *buffer_info) |
2168 | struct e1000_buffer *buffer_info) | ||
2169 | { | 2141 | { |
2170 | if (buffer_info->dma) { | 2142 | if (buffer_info->dma) { |
2171 | pci_unmap_page(adapter->pdev, | 2143 | pci_unmap_page(adapter->pdev, |
@@ -2187,9 +2159,8 @@ e1000_unmap_and_free_tx_resource(struct e1000_adapter *adapter, | |||
2187 | * @tx_ring: ring to be cleaned | 2159 | * @tx_ring: ring to be cleaned |
2188 | **/ | 2160 | **/ |
2189 | 2161 | ||
2190 | static void | 2162 | static void e1000_clean_tx_ring(struct e1000_adapter *adapter, |
2191 | e1000_clean_tx_ring(struct e1000_adapter *adapter, | 2163 | struct e1000_tx_ring *tx_ring) |
2192 | struct e1000_tx_ring *tx_ring) | ||
2193 | { | 2164 | { |
2194 | struct e1000_buffer *buffer_info; | 2165 | struct e1000_buffer *buffer_info; |
2195 | unsigned long size; | 2166 | unsigned long size; |
@@ -2222,8 +2193,7 @@ e1000_clean_tx_ring(struct e1000_adapter *adapter, | |||
2222 | * @adapter: board private structure | 2193 | * @adapter: board private structure |
2223 | **/ | 2194 | **/ |
2224 | 2195 | ||
2225 | static void | 2196 | static void e1000_clean_all_tx_rings(struct e1000_adapter *adapter) |
2226 | e1000_clean_all_tx_rings(struct e1000_adapter *adapter) | ||
2227 | { | 2197 | { |
2228 | int i; | 2198 | int i; |
2229 | 2199 | ||
@@ -2239,9 +2209,8 @@ e1000_clean_all_tx_rings(struct e1000_adapter *adapter) | |||
2239 | * Free all receive software resources | 2209 | * Free all receive software resources |
2240 | **/ | 2210 | **/ |
2241 | 2211 | ||
2242 | static void | 2212 | static void e1000_free_rx_resources(struct e1000_adapter *adapter, |
2243 | e1000_free_rx_resources(struct e1000_adapter *adapter, | 2213 | struct e1000_rx_ring *rx_ring) |
2244 | struct e1000_rx_ring *rx_ring) | ||
2245 | { | 2214 | { |
2246 | struct pci_dev *pdev = adapter->pdev; | 2215 | struct pci_dev *pdev = adapter->pdev; |
2247 | 2216 | ||
@@ -2266,8 +2235,7 @@ e1000_free_rx_resources(struct e1000_adapter *adapter, | |||
2266 | * Free all receive software resources | 2235 | * Free all receive software resources |
2267 | **/ | 2236 | **/ |
2268 | 2237 | ||
2269 | void | 2238 | void e1000_free_all_rx_resources(struct e1000_adapter *adapter) |
2270 | e1000_free_all_rx_resources(struct e1000_adapter *adapter) | ||
2271 | { | 2239 | { |
2272 | int i; | 2240 | int i; |
2273 | 2241 | ||
@@ -2281,9 +2249,8 @@ e1000_free_all_rx_resources(struct e1000_adapter *adapter) | |||
2281 | * @rx_ring: ring to free buffers from | 2249 | * @rx_ring: ring to free buffers from |
2282 | **/ | 2250 | **/ |
2283 | 2251 | ||
2284 | static void | 2252 | static void e1000_clean_rx_ring(struct e1000_adapter *adapter, |
2285 | e1000_clean_rx_ring(struct e1000_adapter *adapter, | 2253 | struct e1000_rx_ring *rx_ring) |
2286 | struct e1000_rx_ring *rx_ring) | ||
2287 | { | 2254 | { |
2288 | struct e1000_buffer *buffer_info; | 2255 | struct e1000_buffer *buffer_info; |
2289 | struct e1000_ps_page *ps_page; | 2256 | struct e1000_ps_page *ps_page; |
@@ -2340,8 +2307,7 @@ e1000_clean_rx_ring(struct e1000_adapter *adapter, | |||
2340 | * @adapter: board private structure | 2307 | * @adapter: board private structure |
2341 | **/ | 2308 | **/ |
2342 | 2309 | ||
2343 | static void | 2310 | static void e1000_clean_all_rx_rings(struct e1000_adapter *adapter) |
2344 | e1000_clean_all_rx_rings(struct e1000_adapter *adapter) | ||
2345 | { | 2311 | { |
2346 | int i; | 2312 | int i; |
2347 | 2313 | ||
@@ -2352,8 +2318,7 @@ e1000_clean_all_rx_rings(struct e1000_adapter *adapter) | |||
2352 | /* The 82542 2.0 (revision 2) needs to have the receive unit in reset | 2318 | /* The 82542 2.0 (revision 2) needs to have the receive unit in reset |
2353 | * and memory write and invalidate disabled for certain operations | 2319 | * and memory write and invalidate disabled for certain operations |
2354 | */ | 2320 | */ |
2355 | static void | 2321 | static void e1000_enter_82542_rst(struct e1000_adapter *adapter) |
2356 | e1000_enter_82542_rst(struct e1000_adapter *adapter) | ||
2357 | { | 2322 | { |
2358 | struct net_device *netdev = adapter->netdev; | 2323 | struct net_device *netdev = adapter->netdev; |
2359 | u32 rctl; | 2324 | u32 rctl; |
@@ -2370,8 +2335,7 @@ e1000_enter_82542_rst(struct e1000_adapter *adapter) | |||
2370 | e1000_clean_all_rx_rings(adapter); | 2335 | e1000_clean_all_rx_rings(adapter); |
2371 | } | 2336 | } |
2372 | 2337 | ||
2373 | static void | 2338 | static void e1000_leave_82542_rst(struct e1000_adapter *adapter) |
2374 | e1000_leave_82542_rst(struct e1000_adapter *adapter) | ||
2375 | { | 2339 | { |
2376 | struct net_device *netdev = adapter->netdev; | 2340 | struct net_device *netdev = adapter->netdev; |
2377 | u32 rctl; | 2341 | u32 rctl; |
@@ -2401,8 +2365,7 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter) | |||
2401 | * Returns 0 on success, negative on failure | 2365 | * Returns 0 on success, negative on failure |
2402 | **/ | 2366 | **/ |
2403 | 2367 | ||
2404 | static int | 2368 | static int e1000_set_mac(struct net_device *netdev, void *p) |
2405 | e1000_set_mac(struct net_device *netdev, void *p) | ||
2406 | { | 2369 | { |
2407 | struct e1000_adapter *adapter = netdev_priv(netdev); | 2370 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2408 | struct sockaddr *addr = p; | 2371 | struct sockaddr *addr = p; |
@@ -2452,8 +2415,7 @@ e1000_set_mac(struct net_device *netdev, void *p) | |||
2452 | * promiscuous mode, and all-multi behavior. | 2415 | * promiscuous mode, and all-multi behavior. |
2453 | **/ | 2416 | **/ |
2454 | 2417 | ||
2455 | static void | 2418 | static void e1000_set_rx_mode(struct net_device *netdev) |
2456 | e1000_set_rx_mode(struct net_device *netdev) | ||
2457 | { | 2419 | { |
2458 | struct e1000_adapter *adapter = netdev_priv(netdev); | 2420 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2459 | struct e1000_hw *hw = &adapter->hw; | 2421 | struct e1000_hw *hw = &adapter->hw; |
@@ -2552,8 +2514,7 @@ e1000_set_rx_mode(struct net_device *netdev) | |||
2552 | /* Need to wait a few seconds after link up to get diagnostic information from | 2514 | /* Need to wait a few seconds after link up to get diagnostic information from |
2553 | * the phy */ | 2515 | * the phy */ |
2554 | 2516 | ||
2555 | static void | 2517 | static void e1000_update_phy_info(unsigned long data) |
2556 | e1000_update_phy_info(unsigned long data) | ||
2557 | { | 2518 | { |
2558 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; | 2519 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; |
2559 | e1000_phy_get_info(&adapter->hw, &adapter->phy_info); | 2520 | e1000_phy_get_info(&adapter->hw, &adapter->phy_info); |
@@ -2564,8 +2525,7 @@ e1000_update_phy_info(unsigned long data) | |||
2564 | * @data: pointer to adapter cast into an unsigned long | 2525 | * @data: pointer to adapter cast into an unsigned long |
2565 | **/ | 2526 | **/ |
2566 | 2527 | ||
2567 | static void | 2528 | static void e1000_82547_tx_fifo_stall(unsigned long data) |
2568 | e1000_82547_tx_fifo_stall(unsigned long data) | ||
2569 | { | 2529 | { |
2570 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; | 2530 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; |
2571 | struct net_device *netdev = adapter->netdev; | 2531 | struct net_device *netdev = adapter->netdev; |
@@ -2605,8 +2565,7 @@ e1000_82547_tx_fifo_stall(unsigned long data) | |||
2605 | * e1000_watchdog - Timer Call-back | 2565 | * e1000_watchdog - Timer Call-back |
2606 | * @data: pointer to adapter cast into an unsigned long | 2566 | * @data: pointer to adapter cast into an unsigned long |
2607 | **/ | 2567 | **/ |
2608 | static void | 2568 | static void e1000_watchdog(unsigned long data) |
2609 | e1000_watchdog(unsigned long data) | ||
2610 | { | 2569 | { |
2611 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; | 2570 | struct e1000_adapter *adapter = (struct e1000_adapter *) data; |
2612 | struct net_device *netdev = adapter->netdev; | 2571 | struct net_device *netdev = adapter->netdev; |
@@ -2806,9 +2765,7 @@ enum latency_range { | |||
2806 | * @bytes: the number of bytes during this measurement interval | 2765 | * @bytes: the number of bytes during this measurement interval |
2807 | **/ | 2766 | **/ |
2808 | static unsigned int e1000_update_itr(struct e1000_adapter *adapter, | 2767 | static unsigned int e1000_update_itr(struct e1000_adapter *adapter, |
2809 | u16 itr_setting, | 2768 | u16 itr_setting, int packets, int bytes) |
2810 | int packets, | ||
2811 | int bytes) | ||
2812 | { | 2769 | { |
2813 | unsigned int retval = itr_setting; | 2770 | unsigned int retval = itr_setting; |
2814 | struct e1000_hw *hw = &adapter->hw; | 2771 | struct e1000_hw *hw = &adapter->hw; |
@@ -2926,9 +2883,8 @@ set_itr_now: | |||
2926 | #define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 | 2883 | #define E1000_TX_FLAGS_VLAN_MASK 0xffff0000 |
2927 | #define E1000_TX_FLAGS_VLAN_SHIFT 16 | 2884 | #define E1000_TX_FLAGS_VLAN_SHIFT 16 |
2928 | 2885 | ||
2929 | static int | 2886 | static int e1000_tso(struct e1000_adapter *adapter, |
2930 | e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | 2887 | struct e1000_tx_ring *tx_ring, struct sk_buff *skb) |
2931 | struct sk_buff *skb) | ||
2932 | { | 2888 | { |
2933 | struct e1000_context_desc *context_desc; | 2889 | struct e1000_context_desc *context_desc; |
2934 | struct e1000_buffer *buffer_info; | 2890 | struct e1000_buffer *buffer_info; |
@@ -2999,9 +2955,8 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
2999 | return false; | 2955 | return false; |
3000 | } | 2956 | } |
3001 | 2957 | ||
3002 | static bool | 2958 | static bool e1000_tx_csum(struct e1000_adapter *adapter, |
3003 | e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | 2959 | struct e1000_tx_ring *tx_ring, struct sk_buff *skb) |
3004 | struct sk_buff *skb) | ||
3005 | { | 2960 | { |
3006 | struct e1000_context_desc *context_desc; | 2961 | struct e1000_context_desc *context_desc; |
3007 | struct e1000_buffer *buffer_info; | 2962 | struct e1000_buffer *buffer_info; |
@@ -3038,10 +2993,11 @@ e1000_tx_csum(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
3038 | #define E1000_MAX_TXD_PWR 12 | 2993 | #define E1000_MAX_TXD_PWR 12 |
3039 | #define E1000_MAX_DATA_PER_TXD (1<<E1000_MAX_TXD_PWR) | 2994 | #define E1000_MAX_DATA_PER_TXD (1<<E1000_MAX_TXD_PWR) |
3040 | 2995 | ||
3041 | static int | 2996 | static int e1000_tx_map(struct e1000_adapter *adapter, |
3042 | e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | 2997 | struct e1000_tx_ring *tx_ring, |
3043 | struct sk_buff *skb, unsigned int first, unsigned int max_per_txd, | 2998 | struct sk_buff *skb, unsigned int first, |
3044 | unsigned int nr_frags, unsigned int mss) | 2999 | unsigned int max_per_txd, unsigned int nr_frags, |
3000 | unsigned int mss) | ||
3045 | { | 3001 | { |
3046 | struct e1000_buffer *buffer_info; | 3002 | struct e1000_buffer *buffer_info; |
3047 | unsigned int len = skb->len; | 3003 | unsigned int len = skb->len; |
@@ -3145,9 +3101,9 @@ e1000_tx_map(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
3145 | return count; | 3101 | return count; |
3146 | } | 3102 | } |
3147 | 3103 | ||
3148 | static void | 3104 | static void e1000_tx_queue(struct e1000_adapter *adapter, |
3149 | e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | 3105 | struct e1000_tx_ring *tx_ring, int tx_flags, |
3150 | int tx_flags, int count) | 3106 | int count) |
3151 | { | 3107 | { |
3152 | struct e1000_tx_desc *tx_desc = NULL; | 3108 | struct e1000_tx_desc *tx_desc = NULL; |
3153 | struct e1000_buffer *buffer_info; | 3109 | struct e1000_buffer *buffer_info; |
@@ -3212,8 +3168,8 @@ e1000_tx_queue(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring, | |||
3212 | #define E1000_FIFO_HDR 0x10 | 3168 | #define E1000_FIFO_HDR 0x10 |
3213 | #define E1000_82547_PAD_LEN 0x3E0 | 3169 | #define E1000_82547_PAD_LEN 0x3E0 |
3214 | 3170 | ||
3215 | static int | 3171 | static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, |
3216 | e1000_82547_fifo_workaround(struct e1000_adapter *adapter, struct sk_buff *skb) | 3172 | struct sk_buff *skb) |
3217 | { | 3173 | { |
3218 | u32 fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head; | 3174 | u32 fifo_space = adapter->tx_fifo_size - adapter->tx_fifo_head; |
3219 | u32 skb_fifo_len = skb->len + E1000_FIFO_HDR; | 3175 | u32 skb_fifo_len = skb->len + E1000_FIFO_HDR; |
@@ -3239,8 +3195,8 @@ no_fifo_stall_required: | |||
3239 | } | 3195 | } |
3240 | 3196 | ||
3241 | #define MINIMUM_DHCP_PACKET_SIZE 282 | 3197 | #define MINIMUM_DHCP_PACKET_SIZE 282 |
3242 | static int | 3198 | static int e1000_transfer_dhcp_info(struct e1000_adapter *adapter, |
3243 | e1000_transfer_dhcp_info(struct e1000_adapter *adapter, struct sk_buff *skb) | 3199 | struct sk_buff *skb) |
3244 | { | 3200 | { |
3245 | struct e1000_hw *hw = &adapter->hw; | 3201 | struct e1000_hw *hw = &adapter->hw; |
3246 | u16 length, offset; | 3202 | u16 length, offset; |
@@ -3304,8 +3260,7 @@ static int e1000_maybe_stop_tx(struct net_device *netdev, | |||
3304 | } | 3260 | } |
3305 | 3261 | ||
3306 | #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) | 3262 | #define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1 ) |
3307 | static int | 3263 | static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) |
3308 | e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | ||
3309 | { | 3264 | { |
3310 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3265 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3311 | struct e1000_tx_ring *tx_ring; | 3266 | struct e1000_tx_ring *tx_ring; |
@@ -3482,8 +3437,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
3482 | * @netdev: network interface device structure | 3437 | * @netdev: network interface device structure |
3483 | **/ | 3438 | **/ |
3484 | 3439 | ||
3485 | static void | 3440 | static void e1000_tx_timeout(struct net_device *netdev) |
3486 | e1000_tx_timeout(struct net_device *netdev) | ||
3487 | { | 3441 | { |
3488 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3442 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3489 | 3443 | ||
@@ -3492,8 +3446,7 @@ e1000_tx_timeout(struct net_device *netdev) | |||
3492 | schedule_work(&adapter->reset_task); | 3446 | schedule_work(&adapter->reset_task); |
3493 | } | 3447 | } |
3494 | 3448 | ||
3495 | static void | 3449 | static void e1000_reset_task(struct work_struct *work) |
3496 | e1000_reset_task(struct work_struct *work) | ||
3497 | { | 3450 | { |
3498 | struct e1000_adapter *adapter = | 3451 | struct e1000_adapter *adapter = |
3499 | container_of(work, struct e1000_adapter, reset_task); | 3452 | container_of(work, struct e1000_adapter, reset_task); |
@@ -3509,8 +3462,7 @@ e1000_reset_task(struct work_struct *work) | |||
3509 | * The statistics are actually updated from the timer callback. | 3462 | * The statistics are actually updated from the timer callback. |
3510 | **/ | 3463 | **/ |
3511 | 3464 | ||
3512 | static struct net_device_stats * | 3465 | static struct net_device_stats *e1000_get_stats(struct net_device *netdev) |
3513 | e1000_get_stats(struct net_device *netdev) | ||
3514 | { | 3466 | { |
3515 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3467 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3516 | 3468 | ||
@@ -3526,8 +3478,7 @@ e1000_get_stats(struct net_device *netdev) | |||
3526 | * Returns 0 on success, negative on failure | 3478 | * Returns 0 on success, negative on failure |
3527 | **/ | 3479 | **/ |
3528 | 3480 | ||
3529 | static int | 3481 | static int e1000_change_mtu(struct net_device *netdev, int new_mtu) |
3530 | e1000_change_mtu(struct net_device *netdev, int new_mtu) | ||
3531 | { | 3482 | { |
3532 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3483 | struct e1000_adapter *adapter = netdev_priv(netdev); |
3533 | int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; | 3484 | int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; |
@@ -3620,8 +3571,7 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
3620 | * @adapter: board private structure | 3571 | * @adapter: board private structure |
3621 | **/ | 3572 | **/ |
3622 | 3573 | ||
3623 | void | 3574 | void e1000_update_stats(struct e1000_adapter *adapter) |
3624 | e1000_update_stats(struct e1000_adapter *adapter) | ||
3625 | { | 3575 | { |
3626 | struct e1000_hw *hw = &adapter->hw; | 3576 | struct e1000_hw *hw = &adapter->hw; |
3627 | struct pci_dev *pdev = adapter->pdev; | 3577 | struct pci_dev *pdev = adapter->pdev; |
@@ -3794,8 +3744,7 @@ e1000_update_stats(struct e1000_adapter *adapter) | |||
3794 | * @data: pointer to a network interface device structure | 3744 | * @data: pointer to a network interface device structure |
3795 | **/ | 3745 | **/ |
3796 | 3746 | ||
3797 | static irqreturn_t | 3747 | static irqreturn_t e1000_intr_msi(int irq, void *data) |
3798 | e1000_intr_msi(int irq, void *data) | ||
3799 | { | 3748 | { |
3800 | struct net_device *netdev = data; | 3749 | struct net_device *netdev = data; |
3801 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3750 | struct e1000_adapter *adapter = netdev_priv(netdev); |
@@ -3856,8 +3805,7 @@ e1000_intr_msi(int irq, void *data) | |||
3856 | * @data: pointer to a network interface device structure | 3805 | * @data: pointer to a network interface device structure |
3857 | **/ | 3806 | **/ |
3858 | 3807 | ||
3859 | static irqreturn_t | 3808 | static irqreturn_t e1000_intr(int irq, void *data) |
3860 | e1000_intr(int irq, void *data) | ||
3861 | { | 3809 | { |
3862 | struct net_device *netdev = data; | 3810 | struct net_device *netdev = data; |
3863 | struct e1000_adapter *adapter = netdev_priv(netdev); | 3811 | struct e1000_adapter *adapter = netdev_priv(netdev); |
@@ -3954,8 +3902,7 @@ e1000_intr(int irq, void *data) | |||
3954 | * @adapter: board private structure | 3902 | * @adapter: board private structure |
3955 | **/ | 3903 | **/ |
3956 | 3904 | ||
3957 | static int | 3905 | static int e1000_clean(struct napi_struct *napi, int budget) |
3958 | e1000_clean(struct napi_struct *napi, int budget) | ||
3959 | { | 3906 | { |
3960 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); | 3907 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); |
3961 | struct net_device *poll_dev = adapter->netdev; | 3908 | struct net_device *poll_dev = adapter->netdev; |
@@ -3997,9 +3944,8 @@ e1000_clean(struct napi_struct *napi, int budget) | |||
3997 | * @adapter: board private structure | 3944 | * @adapter: board private structure |
3998 | **/ | 3945 | **/ |
3999 | 3946 | ||
4000 | static bool | 3947 | static bool e1000_clean_tx_irq(struct e1000_adapter *adapter, |
4001 | e1000_clean_tx_irq(struct e1000_adapter *adapter, | 3948 | struct e1000_tx_ring *tx_ring) |
4002 | struct e1000_tx_ring *tx_ring) | ||
4003 | { | 3949 | { |
4004 | struct net_device *netdev = adapter->netdev; | 3950 | struct net_device *netdev = adapter->netdev; |
4005 | struct e1000_tx_desc *tx_desc, *eop_desc; | 3951 | struct e1000_tx_desc *tx_desc, *eop_desc; |
@@ -4111,10 +4057,8 @@ e1000_clean_tx_irq(struct e1000_adapter *adapter, | |||
4111 | * @sk_buff: socket buffer with received data | 4057 | * @sk_buff: socket buffer with received data |
4112 | **/ | 4058 | **/ |
4113 | 4059 | ||
4114 | static void | 4060 | static void e1000_rx_checksum(struct e1000_adapter *adapter, u32 status_err, |
4115 | e1000_rx_checksum(struct e1000_adapter *adapter, | 4061 | u32 csum, struct sk_buff *skb) |
4116 | u32 status_err, u32 csum, | ||
4117 | struct sk_buff *skb) | ||
4118 | { | 4062 | { |
4119 | u16 status = (u16)status_err; | 4063 | u16 status = (u16)status_err; |
4120 | u8 errors = (u8)(status_err >> 24); | 4064 | u8 errors = (u8)(status_err >> 24); |
@@ -4158,15 +4102,13 @@ e1000_rx_checksum(struct e1000_adapter *adapter, | |||
4158 | * e1000_clean_rx_irq - Send received data up the network stack; legacy | 4102 | * e1000_clean_rx_irq - Send received data up the network stack; legacy |
4159 | * @adapter: board private structure | 4103 | * @adapter: board private structure |
4160 | **/ | 4104 | **/ |
4161 | |||
4162 | static bool | ||
4163 | #ifdef CONFIG_E1000_NAPI | 4105 | #ifdef CONFIG_E1000_NAPI |
4164 | e1000_clean_rx_irq(struct e1000_adapter *adapter, | 4106 | static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, |
4165 | struct e1000_rx_ring *rx_ring, | 4107 | struct e1000_rx_ring *rx_ring, |
4166 | int *work_done, int work_to_do) | 4108 | int *work_done, int work_to_do) |
4167 | #else | 4109 | #else |
4168 | e1000_clean_rx_irq(struct e1000_adapter *adapter, | 4110 | static bool e1000_clean_rx_irq(struct e1000_adapter *adapter, |
4169 | struct e1000_rx_ring *rx_ring) | 4111 | struct e1000_rx_ring *rx_ring) |
4170 | #endif | 4112 | #endif |
4171 | { | 4113 | { |
4172 | struct net_device *netdev = adapter->netdev; | 4114 | struct net_device *netdev = adapter->netdev; |
@@ -4330,14 +4272,13 @@ next_desc: | |||
4330 | * @adapter: board private structure | 4272 | * @adapter: board private structure |
4331 | **/ | 4273 | **/ |
4332 | 4274 | ||
4333 | static bool | ||
4334 | #ifdef CONFIG_E1000_NAPI | 4275 | #ifdef CONFIG_E1000_NAPI |
4335 | e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | 4276 | static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, |
4336 | struct e1000_rx_ring *rx_ring, | 4277 | struct e1000_rx_ring *rx_ring, |
4337 | int *work_done, int work_to_do) | 4278 | int *work_done, int work_to_do) |
4338 | #else | 4279 | #else |
4339 | e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, | 4280 | static bool e1000_clean_rx_irq_ps(struct e1000_adapter *adapter, |
4340 | struct e1000_rx_ring *rx_ring) | 4281 | struct e1000_rx_ring *rx_ring) |
4341 | #endif | 4282 | #endif |
4342 | { | 4283 | { |
4343 | union e1000_rx_desc_packet_split *rx_desc, *next_rxd; | 4284 | union e1000_rx_desc_packet_split *rx_desc, *next_rxd; |
@@ -4517,10 +4458,9 @@ next_desc: | |||
4517 | * @adapter: address of board private structure | 4458 | * @adapter: address of board private structure |
4518 | **/ | 4459 | **/ |
4519 | 4460 | ||
4520 | static void | 4461 | static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter, |
4521 | e1000_alloc_rx_buffers(struct e1000_adapter *adapter, | 4462 | struct e1000_rx_ring *rx_ring, |
4522 | struct e1000_rx_ring *rx_ring, | 4463 | int cleaned_count) |
4523 | int cleaned_count) | ||
4524 | { | 4464 | { |
4525 | struct net_device *netdev = adapter->netdev; | 4465 | struct net_device *netdev = adapter->netdev; |
4526 | struct pci_dev *pdev = adapter->pdev; | 4466 | struct pci_dev *pdev = adapter->pdev; |
@@ -4628,10 +4568,9 @@ map_skb: | |||
4628 | * @adapter: address of board private structure | 4568 | * @adapter: address of board private structure |
4629 | **/ | 4569 | **/ |
4630 | 4570 | ||
4631 | static void | 4571 | static void e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter, |
4632 | e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter, | 4572 | struct e1000_rx_ring *rx_ring, |
4633 | struct e1000_rx_ring *rx_ring, | 4573 | int cleaned_count) |
4634 | int cleaned_count) | ||
4635 | { | 4574 | { |
4636 | struct net_device *netdev = adapter->netdev; | 4575 | struct net_device *netdev = adapter->netdev; |
4637 | struct pci_dev *pdev = adapter->pdev; | 4576 | struct pci_dev *pdev = adapter->pdev; |
@@ -4726,8 +4665,7 @@ no_buffers: | |||
4726 | * @adapter: | 4665 | * @adapter: |
4727 | **/ | 4666 | **/ |
4728 | 4667 | ||
4729 | static void | 4668 | static void e1000_smartspeed(struct e1000_adapter *adapter) |
4730 | e1000_smartspeed(struct e1000_adapter *adapter) | ||
4731 | { | 4669 | { |
4732 | u16 phy_status; | 4670 | u16 phy_status; |
4733 | u16 phy_ctrl; | 4671 | u16 phy_ctrl; |
@@ -4783,8 +4721,7 @@ e1000_smartspeed(struct e1000_adapter *adapter) | |||
4783 | * @cmd: | 4721 | * @cmd: |
4784 | **/ | 4722 | **/ |
4785 | 4723 | ||
4786 | static int | 4724 | static int e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) |
4787 | e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | ||
4788 | { | 4725 | { |
4789 | switch (cmd) { | 4726 | switch (cmd) { |
4790 | case SIOCGMIIPHY: | 4727 | case SIOCGMIIPHY: |
@@ -4803,8 +4740,8 @@ e1000_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
4803 | * @cmd: | 4740 | * @cmd: |
4804 | **/ | 4741 | **/ |
4805 | 4742 | ||
4806 | static int | 4743 | static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, |
4807 | e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | 4744 | int cmd) |
4808 | { | 4745 | { |
4809 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4746 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4810 | struct mii_ioctl_data *data = if_mii(ifr); | 4747 | struct mii_ioctl_data *data = if_mii(ifr); |
@@ -4897,8 +4834,7 @@ e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
4897 | return E1000_SUCCESS; | 4834 | return E1000_SUCCESS; |
4898 | } | 4835 | } |
4899 | 4836 | ||
4900 | void | 4837 | void e1000_pci_set_mwi(struct e1000_hw *hw) |
4901 | e1000_pci_set_mwi(struct e1000_hw *hw) | ||
4902 | { | 4838 | { |
4903 | struct e1000_adapter *adapter = hw->back; | 4839 | struct e1000_adapter *adapter = hw->back; |
4904 | int ret_val = pci_set_mwi(adapter->pdev); | 4840 | int ret_val = pci_set_mwi(adapter->pdev); |
@@ -4907,30 +4843,26 @@ e1000_pci_set_mwi(struct e1000_hw *hw) | |||
4907 | DPRINTK(PROBE, ERR, "Error in setting MWI\n"); | 4843 | DPRINTK(PROBE, ERR, "Error in setting MWI\n"); |
4908 | } | 4844 | } |
4909 | 4845 | ||
4910 | void | 4846 | void e1000_pci_clear_mwi(struct e1000_hw *hw) |
4911 | e1000_pci_clear_mwi(struct e1000_hw *hw) | ||
4912 | { | 4847 | { |
4913 | struct e1000_adapter *adapter = hw->back; | 4848 | struct e1000_adapter *adapter = hw->back; |
4914 | 4849 | ||
4915 | pci_clear_mwi(adapter->pdev); | 4850 | pci_clear_mwi(adapter->pdev); |
4916 | } | 4851 | } |
4917 | 4852 | ||
4918 | int | 4853 | int e1000_pcix_get_mmrbc(struct e1000_hw *hw) |
4919 | e1000_pcix_get_mmrbc(struct e1000_hw *hw) | ||
4920 | { | 4854 | { |
4921 | struct e1000_adapter *adapter = hw->back; | 4855 | struct e1000_adapter *adapter = hw->back; |
4922 | return pcix_get_mmrbc(adapter->pdev); | 4856 | return pcix_get_mmrbc(adapter->pdev); |
4923 | } | 4857 | } |
4924 | 4858 | ||
4925 | void | 4859 | void e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc) |
4926 | e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc) | ||
4927 | { | 4860 | { |
4928 | struct e1000_adapter *adapter = hw->back; | 4861 | struct e1000_adapter *adapter = hw->back; |
4929 | pcix_set_mmrbc(adapter->pdev, mmrbc); | 4862 | pcix_set_mmrbc(adapter->pdev, mmrbc); |
4930 | } | 4863 | } |
4931 | 4864 | ||
4932 | s32 | 4865 | s32 e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value) |
4933 | e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value) | ||
4934 | { | 4866 | { |
4935 | struct e1000_adapter *adapter = hw->back; | 4867 | struct e1000_adapter *adapter = hw->back; |
4936 | u16 cap_offset; | 4868 | u16 cap_offset; |
@@ -4944,14 +4876,13 @@ e1000_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value) | |||
4944 | return E1000_SUCCESS; | 4876 | return E1000_SUCCESS; |
4945 | } | 4877 | } |
4946 | 4878 | ||
4947 | void | 4879 | void e1000_io_write(struct e1000_hw *hw, unsigned long port, u32 value) |
4948 | e1000_io_write(struct e1000_hw *hw, unsigned long port, u32 value) | ||
4949 | { | 4880 | { |
4950 | outl(value, port); | 4881 | outl(value, port); |
4951 | } | 4882 | } |
4952 | 4883 | ||
4953 | static void | 4884 | static void e1000_vlan_rx_register(struct net_device *netdev, |
4954 | e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) | 4885 | struct vlan_group *grp) |
4955 | { | 4886 | { |
4956 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4887 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4957 | u32 ctrl, rctl; | 4888 | u32 ctrl, rctl; |
@@ -4993,8 +4924,7 @@ e1000_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) | |||
4993 | e1000_irq_enable(adapter); | 4924 | e1000_irq_enable(adapter); |
4994 | } | 4925 | } |
4995 | 4926 | ||
4996 | static void | 4927 | static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
4997 | e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | ||
4998 | { | 4928 | { |
4999 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4929 | struct e1000_adapter *adapter = netdev_priv(netdev); |
5000 | u32 vfta, index; | 4930 | u32 vfta, index; |
@@ -5010,8 +4940,7 @@ e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
5010 | e1000_write_vfta(&adapter->hw, index, vfta); | 4940 | e1000_write_vfta(&adapter->hw, index, vfta); |
5011 | } | 4941 | } |
5012 | 4942 | ||
5013 | static void | 4943 | static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
5014 | e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | ||
5015 | { | 4944 | { |
5016 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4945 | struct e1000_adapter *adapter = netdev_priv(netdev); |
5017 | u32 vfta, index; | 4946 | u32 vfta, index; |
@@ -5037,8 +4966,7 @@ e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
5037 | e1000_write_vfta(&adapter->hw, index, vfta); | 4966 | e1000_write_vfta(&adapter->hw, index, vfta); |
5038 | } | 4967 | } |
5039 | 4968 | ||
5040 | static void | 4969 | static void e1000_restore_vlan(struct e1000_adapter *adapter) |
5041 | e1000_restore_vlan(struct e1000_adapter *adapter) | ||
5042 | { | 4970 | { |
5043 | e1000_vlan_rx_register(adapter->netdev, adapter->vlgrp); | 4971 | e1000_vlan_rx_register(adapter->netdev, adapter->vlgrp); |
5044 | 4972 | ||
@@ -5052,8 +4980,7 @@ e1000_restore_vlan(struct e1000_adapter *adapter) | |||
5052 | } | 4980 | } |
5053 | } | 4981 | } |
5054 | 4982 | ||
5055 | int | 4983 | int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx) |
5056 | e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx) | ||
5057 | { | 4984 | { |
5058 | adapter->hw.autoneg = 0; | 4985 | adapter->hw.autoneg = 0; |
5059 | 4986 | ||
@@ -5089,8 +5016,7 @@ e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx) | |||
5089 | return 0; | 5016 | return 0; |
5090 | } | 5017 | } |
5091 | 5018 | ||
5092 | static int | 5019 | static int e1000_suspend(struct pci_dev *pdev, pm_message_t state) |
5093 | e1000_suspend(struct pci_dev *pdev, pm_message_t state) | ||
5094 | { | 5020 | { |
5095 | struct net_device *netdev = pci_get_drvdata(pdev); | 5021 | struct net_device *netdev = pci_get_drvdata(pdev); |
5096 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5022 | struct e1000_adapter *adapter = netdev_priv(netdev); |
@@ -5187,8 +5113,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state) | |||
5187 | } | 5113 | } |
5188 | 5114 | ||
5189 | #ifdef CONFIG_PM | 5115 | #ifdef CONFIG_PM |
5190 | static int | 5116 | static int e1000_resume(struct pci_dev *pdev) |
5191 | e1000_resume(struct pci_dev *pdev) | ||
5192 | { | 5117 | { |
5193 | struct net_device *netdev = pci_get_drvdata(pdev); | 5118 | struct net_device *netdev = pci_get_drvdata(pdev); |
5194 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5119 | struct e1000_adapter *adapter = netdev_priv(netdev); |
@@ -5242,8 +5167,7 @@ static void e1000_shutdown(struct pci_dev *pdev) | |||
5242 | * without having to re-enable interrupts. It's not called while | 5167 | * without having to re-enable interrupts. It's not called while |
5243 | * the interrupt routine is executing. | 5168 | * the interrupt routine is executing. |
5244 | */ | 5169 | */ |
5245 | static void | 5170 | static void e1000_netpoll(struct net_device *netdev) |
5246 | e1000_netpoll(struct net_device *netdev) | ||
5247 | { | 5171 | { |
5248 | struct e1000_adapter *adapter = netdev_priv(netdev); | 5172 | struct e1000_adapter *adapter = netdev_priv(netdev); |
5249 | 5173 | ||
@@ -5264,7 +5188,8 @@ e1000_netpoll(struct net_device *netdev) | |||
5264 | * This function is called after a PCI bus error affecting | 5188 | * This function is called after a PCI bus error affecting |
5265 | * this device has been detected. | 5189 | * this device has been detected. |
5266 | */ | 5190 | */ |
5267 | static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state) | 5191 | static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, |
5192 | pci_channel_state_t state) | ||
5268 | { | 5193 | { |
5269 | struct net_device *netdev = pci_get_drvdata(pdev); | 5194 | struct net_device *netdev = pci_get_drvdata(pdev); |
5270 | struct e1000_adapter *adapter = netdev->priv; | 5195 | struct e1000_adapter *adapter = netdev->priv; |
diff --git a/drivers/net/e1000/e1000_param.c b/drivers/net/e1000/e1000_param.c index e6565ce686bc..b9f90a5d3d4d 100644 --- a/drivers/net/e1000/e1000_param.c +++ b/drivers/net/e1000/e1000_param.c | |||
@@ -213,10 +213,9 @@ struct e1000_option { | |||
213 | } arg; | 213 | } arg; |
214 | }; | 214 | }; |
215 | 215 | ||
216 | static int __devinit | 216 | static int __devinit e1000_validate_option(unsigned int *value, |
217 | e1000_validate_option(unsigned int *value, | 217 | const struct e1000_option *opt, |
218 | const struct e1000_option *opt, | 218 | struct e1000_adapter *adapter) |
219 | struct e1000_adapter *adapter) | ||
220 | { | 219 | { |
221 | if (*value == OPTION_UNSET) { | 220 | if (*value == OPTION_UNSET) { |
222 | *value = opt->def; | 221 | *value = opt->def; |
@@ -278,8 +277,7 @@ static void e1000_check_copper_options(struct e1000_adapter *adapter); | |||
278 | * in a variable in the adapter structure. | 277 | * in a variable in the adapter structure. |
279 | **/ | 278 | **/ |
280 | 279 | ||
281 | void __devinit | 280 | void __devinit e1000_check_options(struct e1000_adapter *adapter) |
282 | e1000_check_options(struct e1000_adapter *adapter) | ||
283 | { | 281 | { |
284 | int bd = adapter->bd_number; | 282 | int bd = adapter->bd_number; |
285 | if (bd >= E1000_MAX_NIC) { | 283 | if (bd >= E1000_MAX_NIC) { |
@@ -551,8 +549,7 @@ e1000_check_options(struct e1000_adapter *adapter) | |||
551 | * Handles speed and duplex options on fiber adapters | 549 | * Handles speed and duplex options on fiber adapters |
552 | **/ | 550 | **/ |
553 | 551 | ||
554 | static void __devinit | 552 | static void __devinit e1000_check_fiber_options(struct e1000_adapter *adapter) |
555 | e1000_check_fiber_options(struct e1000_adapter *adapter) | ||
556 | { | 553 | { |
557 | int bd = adapter->bd_number; | 554 | int bd = adapter->bd_number; |
558 | if (num_Speed > bd) { | 555 | if (num_Speed > bd) { |
@@ -579,8 +576,7 @@ e1000_check_fiber_options(struct e1000_adapter *adapter) | |||
579 | * Handles speed and duplex options on copper adapters | 576 | * Handles speed and duplex options on copper adapters |
580 | **/ | 577 | **/ |
581 | 578 | ||
582 | static void __devinit | 579 | static void __devinit e1000_check_copper_options(struct e1000_adapter *adapter) |
583 | e1000_check_copper_options(struct e1000_adapter *adapter) | ||
584 | { | 580 | { |
585 | unsigned int speed, dplx, an; | 581 | unsigned int speed, dplx, an; |
586 | int bd = adapter->bd_number; | 582 | int bd = adapter->bd_number; |