diff options
Diffstat (limited to 'drivers/net')
38 files changed, 299 insertions, 303 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index d9f85464b362..69aff72c8957 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4492,6 +4492,7 @@ static int __init bonding_init(void) | |||
4492 | out: | 4492 | out: |
4493 | return res; | 4493 | return res; |
4494 | err: | 4494 | err: |
4495 | bond_destroy_debugfs(); | ||
4495 | bond_netlink_fini(); | 4496 | bond_netlink_fini(); |
4496 | err_link: | 4497 | err_link: |
4497 | unregister_pernet_subsys(&bond_net_ops); | 4498 | unregister_pernet_subsys(&bond_net_ops); |
diff --git a/drivers/net/ethernet/8390/apne.c b/drivers/net/ethernet/8390/apne.c index 30104b60da85..c56ac9ebc08f 100644 --- a/drivers/net/ethernet/8390/apne.c +++ b/drivers/net/ethernet/8390/apne.c | |||
@@ -560,9 +560,7 @@ static struct net_device *apne_dev; | |||
560 | static int __init apne_module_init(void) | 560 | static int __init apne_module_init(void) |
561 | { | 561 | { |
562 | apne_dev = apne_probe(-1); | 562 | apne_dev = apne_probe(-1); |
563 | if (IS_ERR(apne_dev)) | 563 | return PTR_ERR_OR_ZERO(apne_dev); |
564 | return PTR_ERR(apne_dev); | ||
565 | return 0; | ||
566 | } | 564 | } |
567 | 565 | ||
568 | static void __exit apne_module_exit(void) | 566 | static void __exit apne_module_exit(void) |
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index fcaeeb8a4929..28460676b8ca 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c | |||
@@ -268,15 +268,6 @@ static unsigned int emac_setup(struct net_device *ndev) | |||
268 | writel(reg_val | EMAC_TX_MODE_ABORTED_FRAME_EN, | 268 | writel(reg_val | EMAC_TX_MODE_ABORTED_FRAME_EN, |
269 | db->membase + EMAC_TX_MODE_REG); | 269 | db->membase + EMAC_TX_MODE_REG); |
270 | 270 | ||
271 | /* set up RX */ | ||
272 | reg_val = readl(db->membase + EMAC_RX_CTL_REG); | ||
273 | |||
274 | writel(reg_val | EMAC_RX_CTL_PASS_LEN_OOR_EN | | ||
275 | EMAC_RX_CTL_ACCEPT_UNICAST_EN | EMAC_RX_CTL_DA_FILTER_EN | | ||
276 | EMAC_RX_CTL_ACCEPT_MULTICAST_EN | | ||
277 | EMAC_RX_CTL_ACCEPT_BROADCAST_EN, | ||
278 | db->membase + EMAC_RX_CTL_REG); | ||
279 | |||
280 | /* set MAC */ | 271 | /* set MAC */ |
281 | /* set MAC CTL0 */ | 272 | /* set MAC CTL0 */ |
282 | reg_val = readl(db->membase + EMAC_MAC_CTL0_REG); | 273 | reg_val = readl(db->membase + EMAC_MAC_CTL0_REG); |
@@ -309,6 +300,26 @@ static unsigned int emac_setup(struct net_device *ndev) | |||
309 | return 0; | 300 | return 0; |
310 | } | 301 | } |
311 | 302 | ||
303 | static void emac_set_rx_mode(struct net_device *ndev) | ||
304 | { | ||
305 | struct emac_board_info *db = netdev_priv(ndev); | ||
306 | unsigned int reg_val; | ||
307 | |||
308 | /* set up RX */ | ||
309 | reg_val = readl(db->membase + EMAC_RX_CTL_REG); | ||
310 | |||
311 | if (ndev->flags & IFF_PROMISC) | ||
312 | reg_val |= EMAC_RX_CTL_PASS_ALL_EN; | ||
313 | else | ||
314 | reg_val &= ~EMAC_RX_CTL_PASS_ALL_EN; | ||
315 | |||
316 | writel(reg_val | EMAC_RX_CTL_PASS_LEN_OOR_EN | | ||
317 | EMAC_RX_CTL_ACCEPT_UNICAST_EN | EMAC_RX_CTL_DA_FILTER_EN | | ||
318 | EMAC_RX_CTL_ACCEPT_MULTICAST_EN | | ||
319 | EMAC_RX_CTL_ACCEPT_BROADCAST_EN, | ||
320 | db->membase + EMAC_RX_CTL_REG); | ||
321 | } | ||
322 | |||
312 | static unsigned int emac_powerup(struct net_device *ndev) | 323 | static unsigned int emac_powerup(struct net_device *ndev) |
313 | { | 324 | { |
314 | struct emac_board_info *db = netdev_priv(ndev); | 325 | struct emac_board_info *db = netdev_priv(ndev); |
@@ -782,6 +793,7 @@ static const struct net_device_ops emac_netdev_ops = { | |||
782 | .ndo_stop = emac_stop, | 793 | .ndo_stop = emac_stop, |
783 | .ndo_start_xmit = emac_start_xmit, | 794 | .ndo_start_xmit = emac_start_xmit, |
784 | .ndo_tx_timeout = emac_timeout, | 795 | .ndo_tx_timeout = emac_timeout, |
796 | .ndo_set_rx_mode = emac_set_rx_mode, | ||
785 | .ndo_do_ioctl = emac_ioctl, | 797 | .ndo_do_ioctl = emac_ioctl, |
786 | .ndo_change_mtu = eth_change_mtu, | 798 | .ndo_change_mtu = eth_change_mtu, |
787 | .ndo_validate_addr = eth_validate_addr, | 799 | .ndo_validate_addr = eth_validate_addr, |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_hw.c b/drivers/net/ethernet/intel/e1000/e1000_hw.c index 2879b9631e15..c1d3fdb296a0 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_hw.c +++ b/drivers/net/ethernet/intel/e1000/e1000_hw.c | |||
@@ -115,8 +115,6 @@ static DEFINE_SPINLOCK(e1000_phy_lock); | |||
115 | */ | 115 | */ |
116 | static s32 e1000_set_phy_type(struct e1000_hw *hw) | 116 | static s32 e1000_set_phy_type(struct e1000_hw *hw) |
117 | { | 117 | { |
118 | e_dbg("e1000_set_phy_type"); | ||
119 | |||
120 | if (hw->mac_type == e1000_undefined) | 118 | if (hw->mac_type == e1000_undefined) |
121 | return -E1000_ERR_PHY_TYPE; | 119 | return -E1000_ERR_PHY_TYPE; |
122 | 120 | ||
@@ -159,8 +157,6 @@ static void e1000_phy_init_script(struct e1000_hw *hw) | |||
159 | u32 ret_val; | 157 | u32 ret_val; |
160 | u16 phy_saved_data; | 158 | u16 phy_saved_data; |
161 | 159 | ||
162 | e_dbg("e1000_phy_init_script"); | ||
163 | |||
164 | if (hw->phy_init_script) { | 160 | if (hw->phy_init_script) { |
165 | msleep(20); | 161 | msleep(20); |
166 | 162 | ||
@@ -253,8 +249,6 @@ static void e1000_phy_init_script(struct e1000_hw *hw) | |||
253 | */ | 249 | */ |
254 | s32 e1000_set_mac_type(struct e1000_hw *hw) | 250 | s32 e1000_set_mac_type(struct e1000_hw *hw) |
255 | { | 251 | { |
256 | e_dbg("e1000_set_mac_type"); | ||
257 | |||
258 | switch (hw->device_id) { | 252 | switch (hw->device_id) { |
259 | case E1000_DEV_ID_82542: | 253 | case E1000_DEV_ID_82542: |
260 | switch (hw->revision_id) { | 254 | switch (hw->revision_id) { |
@@ -365,8 +359,6 @@ void e1000_set_media_type(struct e1000_hw *hw) | |||
365 | { | 359 | { |
366 | u32 status; | 360 | u32 status; |
367 | 361 | ||
368 | e_dbg("e1000_set_media_type"); | ||
369 | |||
370 | if (hw->mac_type != e1000_82543) { | 362 | if (hw->mac_type != e1000_82543) { |
371 | /* tbi_compatibility is only valid on 82543 */ | 363 | /* tbi_compatibility is only valid on 82543 */ |
372 | hw->tbi_compatibility_en = false; | 364 | hw->tbi_compatibility_en = false; |
@@ -415,8 +407,6 @@ s32 e1000_reset_hw(struct e1000_hw *hw) | |||
415 | u32 led_ctrl; | 407 | u32 led_ctrl; |
416 | s32 ret_val; | 408 | s32 ret_val; |
417 | 409 | ||
418 | e_dbg("e1000_reset_hw"); | ||
419 | |||
420 | /* For 82542 (rev 2.0), disable MWI before issuing a device reset */ | 410 | /* For 82542 (rev 2.0), disable MWI before issuing a device reset */ |
421 | if (hw->mac_type == e1000_82542_rev2_0) { | 411 | if (hw->mac_type == e1000_82542_rev2_0) { |
422 | e_dbg("Disabling MWI on 82542 rev 2.0\n"); | 412 | e_dbg("Disabling MWI on 82542 rev 2.0\n"); |
@@ -566,8 +556,6 @@ s32 e1000_init_hw(struct e1000_hw *hw) | |||
566 | u32 mta_size; | 556 | u32 mta_size; |
567 | u32 ctrl_ext; | 557 | u32 ctrl_ext; |
568 | 558 | ||
569 | e_dbg("e1000_init_hw"); | ||
570 | |||
571 | /* Initialize Identification LED */ | 559 | /* Initialize Identification LED */ |
572 | ret_val = e1000_id_led_init(hw); | 560 | ret_val = e1000_id_led_init(hw); |
573 | if (ret_val) { | 561 | if (ret_val) { |
@@ -683,8 +671,6 @@ static s32 e1000_adjust_serdes_amplitude(struct e1000_hw *hw) | |||
683 | u16 eeprom_data; | 671 | u16 eeprom_data; |
684 | s32 ret_val; | 672 | s32 ret_val; |
685 | 673 | ||
686 | e_dbg("e1000_adjust_serdes_amplitude"); | ||
687 | |||
688 | if (hw->media_type != e1000_media_type_internal_serdes) | 674 | if (hw->media_type != e1000_media_type_internal_serdes) |
689 | return E1000_SUCCESS; | 675 | return E1000_SUCCESS; |
690 | 676 | ||
@@ -730,8 +716,6 @@ s32 e1000_setup_link(struct e1000_hw *hw) | |||
730 | s32 ret_val; | 716 | s32 ret_val; |
731 | u16 eeprom_data; | 717 | u16 eeprom_data; |
732 | 718 | ||
733 | e_dbg("e1000_setup_link"); | ||
734 | |||
735 | /* Read and store word 0x0F of the EEPROM. This word contains bits | 719 | /* Read and store word 0x0F of the EEPROM. This word contains bits |
736 | * that determine the hardware's default PAUSE (flow control) mode, | 720 | * that determine the hardware's default PAUSE (flow control) mode, |
737 | * a bit that determines whether the HW defaults to enabling or | 721 | * a bit that determines whether the HW defaults to enabling or |
@@ -848,8 +832,6 @@ static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw) | |||
848 | u32 signal = 0; | 832 | u32 signal = 0; |
849 | s32 ret_val; | 833 | s32 ret_val; |
850 | 834 | ||
851 | e_dbg("e1000_setup_fiber_serdes_link"); | ||
852 | |||
853 | /* On adapters with a MAC newer than 82544, SWDP 1 will be | 835 | /* On adapters with a MAC newer than 82544, SWDP 1 will be |
854 | * set when the optics detect a signal. On older adapters, it will be | 836 | * set when the optics detect a signal. On older adapters, it will be |
855 | * cleared when there is a signal. This applies to fiber media only. | 837 | * cleared when there is a signal. This applies to fiber media only. |
@@ -1051,8 +1033,6 @@ static s32 e1000_copper_link_preconfig(struct e1000_hw *hw) | |||
1051 | s32 ret_val; | 1033 | s32 ret_val; |
1052 | u16 phy_data; | 1034 | u16 phy_data; |
1053 | 1035 | ||
1054 | e_dbg("e1000_copper_link_preconfig"); | ||
1055 | |||
1056 | ctrl = er32(CTRL); | 1036 | ctrl = er32(CTRL); |
1057 | /* With 82543, we need to force speed and duplex on the MAC equal to | 1037 | /* With 82543, we need to force speed and duplex on the MAC equal to |
1058 | * what the PHY speed and duplex configuration is. In addition, we need | 1038 | * what the PHY speed and duplex configuration is. In addition, we need |
@@ -1112,8 +1092,6 @@ static s32 e1000_copper_link_igp_setup(struct e1000_hw *hw) | |||
1112 | s32 ret_val; | 1092 | s32 ret_val; |
1113 | u16 phy_data; | 1093 | u16 phy_data; |
1114 | 1094 | ||
1115 | e_dbg("e1000_copper_link_igp_setup"); | ||
1116 | |||
1117 | if (hw->phy_reset_disable) | 1095 | if (hw->phy_reset_disable) |
1118 | return E1000_SUCCESS; | 1096 | return E1000_SUCCESS; |
1119 | 1097 | ||
@@ -1254,8 +1232,6 @@ static s32 e1000_copper_link_mgp_setup(struct e1000_hw *hw) | |||
1254 | s32 ret_val; | 1232 | s32 ret_val; |
1255 | u16 phy_data; | 1233 | u16 phy_data; |
1256 | 1234 | ||
1257 | e_dbg("e1000_copper_link_mgp_setup"); | ||
1258 | |||
1259 | if (hw->phy_reset_disable) | 1235 | if (hw->phy_reset_disable) |
1260 | return E1000_SUCCESS; | 1236 | return E1000_SUCCESS; |
1261 | 1237 | ||
@@ -1362,8 +1338,6 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw) | |||
1362 | s32 ret_val; | 1338 | s32 ret_val; |
1363 | u16 phy_data; | 1339 | u16 phy_data; |
1364 | 1340 | ||
1365 | e_dbg("e1000_copper_link_autoneg"); | ||
1366 | |||
1367 | /* Perform some bounds checking on the hw->autoneg_advertised | 1341 | /* Perform some bounds checking on the hw->autoneg_advertised |
1368 | * parameter. If this variable is zero, then set it to the default. | 1342 | * parameter. If this variable is zero, then set it to the default. |
1369 | */ | 1343 | */ |
@@ -1432,7 +1406,6 @@ static s32 e1000_copper_link_autoneg(struct e1000_hw *hw) | |||
1432 | static s32 e1000_copper_link_postconfig(struct e1000_hw *hw) | 1406 | static s32 e1000_copper_link_postconfig(struct e1000_hw *hw) |
1433 | { | 1407 | { |
1434 | s32 ret_val; | 1408 | s32 ret_val; |
1435 | e_dbg("e1000_copper_link_postconfig"); | ||
1436 | 1409 | ||
1437 | if ((hw->mac_type >= e1000_82544) && (hw->mac_type != e1000_ce4100)) { | 1410 | if ((hw->mac_type >= e1000_82544) && (hw->mac_type != e1000_ce4100)) { |
1438 | e1000_config_collision_dist(hw); | 1411 | e1000_config_collision_dist(hw); |
@@ -1473,8 +1446,6 @@ static s32 e1000_setup_copper_link(struct e1000_hw *hw) | |||
1473 | u16 i; | 1446 | u16 i; |
1474 | u16 phy_data; | 1447 | u16 phy_data; |
1475 | 1448 | ||
1476 | e_dbg("e1000_setup_copper_link"); | ||
1477 | |||
1478 | /* Check if it is a valid PHY and set PHY mode if necessary. */ | 1449 | /* Check if it is a valid PHY and set PHY mode if necessary. */ |
1479 | ret_val = e1000_copper_link_preconfig(hw); | 1450 | ret_val = e1000_copper_link_preconfig(hw); |
1480 | if (ret_val) | 1451 | if (ret_val) |
@@ -1554,8 +1525,6 @@ s32 e1000_phy_setup_autoneg(struct e1000_hw *hw) | |||
1554 | u16 mii_autoneg_adv_reg; | 1525 | u16 mii_autoneg_adv_reg; |
1555 | u16 mii_1000t_ctrl_reg; | 1526 | u16 mii_1000t_ctrl_reg; |
1556 | 1527 | ||
1557 | e_dbg("e1000_phy_setup_autoneg"); | ||
1558 | |||
1559 | /* Read the MII Auto-Neg Advertisement Register (Address 4). */ | 1528 | /* Read the MII Auto-Neg Advertisement Register (Address 4). */ |
1560 | ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg); | 1529 | ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg); |
1561 | if (ret_val) | 1530 | if (ret_val) |
@@ -1707,8 +1676,6 @@ static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw) | |||
1707 | u16 phy_data; | 1676 | u16 phy_data; |
1708 | u16 i; | 1677 | u16 i; |
1709 | 1678 | ||
1710 | e_dbg("e1000_phy_force_speed_duplex"); | ||
1711 | |||
1712 | /* Turn off Flow control if we are forcing speed and duplex. */ | 1679 | /* Turn off Flow control if we are forcing speed and duplex. */ |
1713 | hw->fc = E1000_FC_NONE; | 1680 | hw->fc = E1000_FC_NONE; |
1714 | 1681 | ||
@@ -1939,8 +1906,6 @@ void e1000_config_collision_dist(struct e1000_hw *hw) | |||
1939 | { | 1906 | { |
1940 | u32 tctl, coll_dist; | 1907 | u32 tctl, coll_dist; |
1941 | 1908 | ||
1942 | e_dbg("e1000_config_collision_dist"); | ||
1943 | |||
1944 | if (hw->mac_type < e1000_82543) | 1909 | if (hw->mac_type < e1000_82543) |
1945 | coll_dist = E1000_COLLISION_DISTANCE_82542; | 1910 | coll_dist = E1000_COLLISION_DISTANCE_82542; |
1946 | else | 1911 | else |
@@ -1970,8 +1935,6 @@ static s32 e1000_config_mac_to_phy(struct e1000_hw *hw) | |||
1970 | s32 ret_val; | 1935 | s32 ret_val; |
1971 | u16 phy_data; | 1936 | u16 phy_data; |
1972 | 1937 | ||
1973 | e_dbg("e1000_config_mac_to_phy"); | ||
1974 | |||
1975 | /* 82544 or newer MAC, Auto Speed Detection takes care of | 1938 | /* 82544 or newer MAC, Auto Speed Detection takes care of |
1976 | * MAC speed/duplex configuration. | 1939 | * MAC speed/duplex configuration. |
1977 | */ | 1940 | */ |
@@ -2049,8 +2012,6 @@ s32 e1000_force_mac_fc(struct e1000_hw *hw) | |||
2049 | { | 2012 | { |
2050 | u32 ctrl; | 2013 | u32 ctrl; |
2051 | 2014 | ||
2052 | e_dbg("e1000_force_mac_fc"); | ||
2053 | |||
2054 | /* Get the current configuration of the Device Control Register */ | 2015 | /* Get the current configuration of the Device Control Register */ |
2055 | ctrl = er32(CTRL); | 2016 | ctrl = er32(CTRL); |
2056 | 2017 | ||
@@ -2120,8 +2081,6 @@ static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw) | |||
2120 | u16 speed; | 2081 | u16 speed; |
2121 | u16 duplex; | 2082 | u16 duplex; |
2122 | 2083 | ||
2123 | e_dbg("e1000_config_fc_after_link_up"); | ||
2124 | |||
2125 | /* Check for the case where we have fiber media and auto-neg failed | 2084 | /* Check for the case where we have fiber media and auto-neg failed |
2126 | * so we had to force link. In this case, we need to force the | 2085 | * so we had to force link. In this case, we need to force the |
2127 | * configuration of the MAC to match the "fc" parameter. | 2086 | * configuration of the MAC to match the "fc" parameter. |
@@ -2337,8 +2296,6 @@ static s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw) | |||
2337 | u32 status; | 2296 | u32 status; |
2338 | s32 ret_val = E1000_SUCCESS; | 2297 | s32 ret_val = E1000_SUCCESS; |
2339 | 2298 | ||
2340 | e_dbg("e1000_check_for_serdes_link_generic"); | ||
2341 | |||
2342 | ctrl = er32(CTRL); | 2299 | ctrl = er32(CTRL); |
2343 | status = er32(STATUS); | 2300 | status = er32(STATUS); |
2344 | rxcw = er32(RXCW); | 2301 | rxcw = er32(RXCW); |
@@ -2449,8 +2406,6 @@ s32 e1000_check_for_link(struct e1000_hw *hw) | |||
2449 | s32 ret_val; | 2406 | s32 ret_val; |
2450 | u16 phy_data; | 2407 | u16 phy_data; |
2451 | 2408 | ||
2452 | e_dbg("e1000_check_for_link"); | ||
2453 | |||
2454 | ctrl = er32(CTRL); | 2409 | ctrl = er32(CTRL); |
2455 | status = er32(STATUS); | 2410 | status = er32(STATUS); |
2456 | 2411 | ||
@@ -2632,8 +2587,6 @@ s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex) | |||
2632 | s32 ret_val; | 2587 | s32 ret_val; |
2633 | u16 phy_data; | 2588 | u16 phy_data; |
2634 | 2589 | ||
2635 | e_dbg("e1000_get_speed_and_duplex"); | ||
2636 | |||
2637 | if (hw->mac_type >= e1000_82543) { | 2590 | if (hw->mac_type >= e1000_82543) { |
2638 | status = er32(STATUS); | 2591 | status = er32(STATUS); |
2639 | if (status & E1000_STATUS_SPEED_1000) { | 2592 | if (status & E1000_STATUS_SPEED_1000) { |
@@ -2699,7 +2652,6 @@ static s32 e1000_wait_autoneg(struct e1000_hw *hw) | |||
2699 | u16 i; | 2652 | u16 i; |
2700 | u16 phy_data; | 2653 | u16 phy_data; |
2701 | 2654 | ||
2702 | e_dbg("e1000_wait_autoneg"); | ||
2703 | e_dbg("Waiting for Auto-Neg to complete.\n"); | 2655 | e_dbg("Waiting for Auto-Neg to complete.\n"); |
2704 | 2656 | ||
2705 | /* We will wait for autoneg to complete or 4.5 seconds to expire. */ | 2657 | /* We will wait for autoneg to complete or 4.5 seconds to expire. */ |
@@ -2866,8 +2818,6 @@ s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 *phy_data) | |||
2866 | u32 ret_val; | 2818 | u32 ret_val; |
2867 | unsigned long flags; | 2819 | unsigned long flags; |
2868 | 2820 | ||
2869 | e_dbg("e1000_read_phy_reg"); | ||
2870 | |||
2871 | spin_lock_irqsave(&e1000_phy_lock, flags); | 2821 | spin_lock_irqsave(&e1000_phy_lock, flags); |
2872 | 2822 | ||
2873 | if ((hw->phy_type == e1000_phy_igp) && | 2823 | if ((hw->phy_type == e1000_phy_igp) && |
@@ -2894,8 +2844,6 @@ static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | |||
2894 | u32 mdic = 0; | 2844 | u32 mdic = 0; |
2895 | const u32 phy_addr = (hw->mac_type == e1000_ce4100) ? hw->phy_addr : 1; | 2845 | const u32 phy_addr = (hw->mac_type == e1000_ce4100) ? hw->phy_addr : 1; |
2896 | 2846 | ||
2897 | e_dbg("e1000_read_phy_reg_ex"); | ||
2898 | |||
2899 | if (reg_addr > MAX_PHY_REG_ADDRESS) { | 2847 | if (reg_addr > MAX_PHY_REG_ADDRESS) { |
2900 | e_dbg("PHY Address %d is out of range\n", reg_addr); | 2848 | e_dbg("PHY Address %d is out of range\n", reg_addr); |
2901 | return -E1000_ERR_PARAM; | 2849 | return -E1000_ERR_PARAM; |
@@ -3008,8 +2956,6 @@ s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 phy_data) | |||
3008 | u32 ret_val; | 2956 | u32 ret_val; |
3009 | unsigned long flags; | 2957 | unsigned long flags; |
3010 | 2958 | ||
3011 | e_dbg("e1000_write_phy_reg"); | ||
3012 | |||
3013 | spin_lock_irqsave(&e1000_phy_lock, flags); | 2959 | spin_lock_irqsave(&e1000_phy_lock, flags); |
3014 | 2960 | ||
3015 | if ((hw->phy_type == e1000_phy_igp) && | 2961 | if ((hw->phy_type == e1000_phy_igp) && |
@@ -3036,8 +2982,6 @@ static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | |||
3036 | u32 mdic = 0; | 2982 | u32 mdic = 0; |
3037 | const u32 phy_addr = (hw->mac_type == e1000_ce4100) ? hw->phy_addr : 1; | 2983 | const u32 phy_addr = (hw->mac_type == e1000_ce4100) ? hw->phy_addr : 1; |
3038 | 2984 | ||
3039 | e_dbg("e1000_write_phy_reg_ex"); | ||
3040 | |||
3041 | if (reg_addr > MAX_PHY_REG_ADDRESS) { | 2985 | if (reg_addr > MAX_PHY_REG_ADDRESS) { |
3042 | e_dbg("PHY Address %d is out of range\n", reg_addr); | 2986 | e_dbg("PHY Address %d is out of range\n", reg_addr); |
3043 | return -E1000_ERR_PARAM; | 2987 | return -E1000_ERR_PARAM; |
@@ -3129,8 +3073,6 @@ s32 e1000_phy_hw_reset(struct e1000_hw *hw) | |||
3129 | u32 ctrl, ctrl_ext; | 3073 | u32 ctrl, ctrl_ext; |
3130 | u32 led_ctrl; | 3074 | u32 led_ctrl; |
3131 | 3075 | ||
3132 | e_dbg("e1000_phy_hw_reset"); | ||
3133 | |||
3134 | e_dbg("Resetting Phy...\n"); | 3076 | e_dbg("Resetting Phy...\n"); |
3135 | 3077 | ||
3136 | if (hw->mac_type > e1000_82543) { | 3078 | if (hw->mac_type > e1000_82543) { |
@@ -3189,8 +3131,6 @@ s32 e1000_phy_reset(struct e1000_hw *hw) | |||
3189 | s32 ret_val; | 3131 | s32 ret_val; |
3190 | u16 phy_data; | 3132 | u16 phy_data; |
3191 | 3133 | ||
3192 | e_dbg("e1000_phy_reset"); | ||
3193 | |||
3194 | switch (hw->phy_type) { | 3134 | switch (hw->phy_type) { |
3195 | case e1000_phy_igp: | 3135 | case e1000_phy_igp: |
3196 | ret_val = e1000_phy_hw_reset(hw); | 3136 | ret_val = e1000_phy_hw_reset(hw); |
@@ -3229,8 +3169,6 @@ static s32 e1000_detect_gig_phy(struct e1000_hw *hw) | |||
3229 | u16 phy_id_high, phy_id_low; | 3169 | u16 phy_id_high, phy_id_low; |
3230 | bool match = false; | 3170 | bool match = false; |
3231 | 3171 | ||
3232 | e_dbg("e1000_detect_gig_phy"); | ||
3233 | |||
3234 | if (hw->phy_id != 0) | 3172 | if (hw->phy_id != 0) |
3235 | return E1000_SUCCESS; | 3173 | return E1000_SUCCESS; |
3236 | 3174 | ||
@@ -3301,7 +3239,6 @@ static s32 e1000_detect_gig_phy(struct e1000_hw *hw) | |||
3301 | static s32 e1000_phy_reset_dsp(struct e1000_hw *hw) | 3239 | static s32 e1000_phy_reset_dsp(struct e1000_hw *hw) |
3302 | { | 3240 | { |
3303 | s32 ret_val; | 3241 | s32 ret_val; |
3304 | e_dbg("e1000_phy_reset_dsp"); | ||
3305 | 3242 | ||
3306 | do { | 3243 | do { |
3307 | ret_val = e1000_write_phy_reg(hw, 29, 0x001d); | 3244 | ret_val = e1000_write_phy_reg(hw, 29, 0x001d); |
@@ -3333,8 +3270,6 @@ static s32 e1000_phy_igp_get_info(struct e1000_hw *hw, | |||
3333 | u16 phy_data, min_length, max_length, average; | 3270 | u16 phy_data, min_length, max_length, average; |
3334 | e1000_rev_polarity polarity; | 3271 | e1000_rev_polarity polarity; |
3335 | 3272 | ||
3336 | e_dbg("e1000_phy_igp_get_info"); | ||
3337 | |||
3338 | /* The downshift status is checked only once, after link is established, | 3273 | /* The downshift status is checked only once, after link is established, |
3339 | * and it stored in the hw->speed_downgraded parameter. | 3274 | * and it stored in the hw->speed_downgraded parameter. |
3340 | */ | 3275 | */ |
@@ -3414,8 +3349,6 @@ static s32 e1000_phy_m88_get_info(struct e1000_hw *hw, | |||
3414 | u16 phy_data; | 3349 | u16 phy_data; |
3415 | e1000_rev_polarity polarity; | 3350 | e1000_rev_polarity polarity; |
3416 | 3351 | ||
3417 | e_dbg("e1000_phy_m88_get_info"); | ||
3418 | |||
3419 | /* The downshift status is checked only once, after link is established, | 3352 | /* The downshift status is checked only once, after link is established, |
3420 | * and it stored in the hw->speed_downgraded parameter. | 3353 | * and it stored in the hw->speed_downgraded parameter. |
3421 | */ | 3354 | */ |
@@ -3487,8 +3420,6 @@ s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info) | |||
3487 | s32 ret_val; | 3420 | s32 ret_val; |
3488 | u16 phy_data; | 3421 | u16 phy_data; |
3489 | 3422 | ||
3490 | e_dbg("e1000_phy_get_info"); | ||
3491 | |||
3492 | phy_info->cable_length = e1000_cable_length_undefined; | 3423 | phy_info->cable_length = e1000_cable_length_undefined; |
3493 | phy_info->extended_10bt_distance = e1000_10bt_ext_dist_enable_undefined; | 3424 | phy_info->extended_10bt_distance = e1000_10bt_ext_dist_enable_undefined; |
3494 | phy_info->cable_polarity = e1000_rev_polarity_undefined; | 3425 | phy_info->cable_polarity = e1000_rev_polarity_undefined; |
@@ -3527,8 +3458,6 @@ s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info) | |||
3527 | 3458 | ||
3528 | s32 e1000_validate_mdi_setting(struct e1000_hw *hw) | 3459 | s32 e1000_validate_mdi_setting(struct e1000_hw *hw) |
3529 | { | 3460 | { |
3530 | e_dbg("e1000_validate_mdi_settings"); | ||
3531 | |||
3532 | if (!hw->autoneg && (hw->mdix == 0 || hw->mdix == 3)) { | 3461 | if (!hw->autoneg && (hw->mdix == 0 || hw->mdix == 3)) { |
3533 | e_dbg("Invalid MDI setting detected\n"); | 3462 | e_dbg("Invalid MDI setting detected\n"); |
3534 | hw->mdix = 1; | 3463 | hw->mdix = 1; |
@@ -3551,8 +3480,6 @@ s32 e1000_init_eeprom_params(struct e1000_hw *hw) | |||
3551 | s32 ret_val = E1000_SUCCESS; | 3480 | s32 ret_val = E1000_SUCCESS; |
3552 | u16 eeprom_size; | 3481 | u16 eeprom_size; |
3553 | 3482 | ||
3554 | e_dbg("e1000_init_eeprom_params"); | ||
3555 | |||
3556 | switch (hw->mac_type) { | 3483 | switch (hw->mac_type) { |
3557 | case e1000_82542_rev2_0: | 3484 | case e1000_82542_rev2_0: |
3558 | case e1000_82542_rev2_1: | 3485 | case e1000_82542_rev2_1: |
@@ -3770,8 +3697,6 @@ static s32 e1000_acquire_eeprom(struct e1000_hw *hw) | |||
3770 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 3697 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
3771 | u32 eecd, i = 0; | 3698 | u32 eecd, i = 0; |
3772 | 3699 | ||
3773 | e_dbg("e1000_acquire_eeprom"); | ||
3774 | |||
3775 | eecd = er32(EECD); | 3700 | eecd = er32(EECD); |
3776 | 3701 | ||
3777 | /* Request EEPROM Access */ | 3702 | /* Request EEPROM Access */ |
@@ -3871,8 +3796,6 @@ static void e1000_release_eeprom(struct e1000_hw *hw) | |||
3871 | { | 3796 | { |
3872 | u32 eecd; | 3797 | u32 eecd; |
3873 | 3798 | ||
3874 | e_dbg("e1000_release_eeprom"); | ||
3875 | |||
3876 | eecd = er32(EECD); | 3799 | eecd = er32(EECD); |
3877 | 3800 | ||
3878 | if (hw->eeprom.type == e1000_eeprom_spi) { | 3801 | if (hw->eeprom.type == e1000_eeprom_spi) { |
@@ -3920,8 +3843,6 @@ static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw) | |||
3920 | u16 retry_count = 0; | 3843 | u16 retry_count = 0; |
3921 | u8 spi_stat_reg; | 3844 | u8 spi_stat_reg; |
3922 | 3845 | ||
3923 | e_dbg("e1000_spi_eeprom_ready"); | ||
3924 | |||
3925 | /* Read "Status Register" repeatedly until the LSB is cleared. The | 3846 | /* Read "Status Register" repeatedly until the LSB is cleared. The |
3926 | * EEPROM will signal that the command has been completed by clearing | 3847 | * EEPROM will signal that the command has been completed by clearing |
3927 | * bit 0 of the internal status register. If it's not cleared within | 3848 | * bit 0 of the internal status register. If it's not cleared within |
@@ -3974,8 +3895,6 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, | |||
3974 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 3895 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
3975 | u32 i = 0; | 3896 | u32 i = 0; |
3976 | 3897 | ||
3977 | e_dbg("e1000_read_eeprom"); | ||
3978 | |||
3979 | if (hw->mac_type == e1000_ce4100) { | 3898 | if (hw->mac_type == e1000_ce4100) { |
3980 | GBE_CONFIG_FLASH_READ(GBE_CONFIG_BASE_VIRT, offset, words, | 3899 | GBE_CONFIG_FLASH_READ(GBE_CONFIG_BASE_VIRT, offset, words, |
3981 | data); | 3900 | data); |
@@ -4076,8 +3995,6 @@ s32 e1000_validate_eeprom_checksum(struct e1000_hw *hw) | |||
4076 | u16 checksum = 0; | 3995 | u16 checksum = 0; |
4077 | u16 i, eeprom_data; | 3996 | u16 i, eeprom_data; |
4078 | 3997 | ||
4079 | e_dbg("e1000_validate_eeprom_checksum"); | ||
4080 | |||
4081 | for (i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) { | 3998 | for (i = 0; i < (EEPROM_CHECKSUM_REG + 1); i++) { |
4082 | if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) { | 3999 | if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) { |
4083 | e_dbg("EEPROM Read Error\n"); | 4000 | e_dbg("EEPROM Read Error\n"); |
@@ -4112,8 +4029,6 @@ s32 e1000_update_eeprom_checksum(struct e1000_hw *hw) | |||
4112 | u16 checksum = 0; | 4029 | u16 checksum = 0; |
4113 | u16 i, eeprom_data; | 4030 | u16 i, eeprom_data; |
4114 | 4031 | ||
4115 | e_dbg("e1000_update_eeprom_checksum"); | ||
4116 | |||
4117 | for (i = 0; i < EEPROM_CHECKSUM_REG; i++) { | 4032 | for (i = 0; i < EEPROM_CHECKSUM_REG; i++) { |
4118 | if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) { | 4033 | if (e1000_read_eeprom(hw, i, 1, &eeprom_data) < 0) { |
4119 | e_dbg("EEPROM Read Error\n"); | 4034 | e_dbg("EEPROM Read Error\n"); |
@@ -4154,8 +4069,6 @@ static s32 e1000_do_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, | |||
4154 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4069 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4155 | s32 status = 0; | 4070 | s32 status = 0; |
4156 | 4071 | ||
4157 | e_dbg("e1000_write_eeprom"); | ||
4158 | |||
4159 | if (hw->mac_type == e1000_ce4100) { | 4072 | if (hw->mac_type == e1000_ce4100) { |
4160 | GBE_CONFIG_FLASH_WRITE(GBE_CONFIG_BASE_VIRT, offset, words, | 4073 | GBE_CONFIG_FLASH_WRITE(GBE_CONFIG_BASE_VIRT, offset, words, |
4161 | data); | 4074 | data); |
@@ -4205,8 +4118,6 @@ static s32 e1000_write_eeprom_spi(struct e1000_hw *hw, u16 offset, u16 words, | |||
4205 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4118 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4206 | u16 widx = 0; | 4119 | u16 widx = 0; |
4207 | 4120 | ||
4208 | e_dbg("e1000_write_eeprom_spi"); | ||
4209 | |||
4210 | while (widx < words) { | 4121 | while (widx < words) { |
4211 | u8 write_opcode = EEPROM_WRITE_OPCODE_SPI; | 4122 | u8 write_opcode = EEPROM_WRITE_OPCODE_SPI; |
4212 | 4123 | ||
@@ -4274,8 +4185,6 @@ static s32 e1000_write_eeprom_microwire(struct e1000_hw *hw, u16 offset, | |||
4274 | u16 words_written = 0; | 4185 | u16 words_written = 0; |
4275 | u16 i = 0; | 4186 | u16 i = 0; |
4276 | 4187 | ||
4277 | e_dbg("e1000_write_eeprom_microwire"); | ||
4278 | |||
4279 | /* Send the write enable command to the EEPROM (3-bit opcode plus | 4188 | /* Send the write enable command to the EEPROM (3-bit opcode plus |
4280 | * 6/8-bit dummy address beginning with 11). It's less work to include | 4189 | * 6/8-bit dummy address beginning with 11). It's less work to include |
4281 | * the 11 of the dummy address as part of the opcode than it is to shift | 4190 | * the 11 of the dummy address as part of the opcode than it is to shift |
@@ -4354,8 +4263,6 @@ s32 e1000_read_mac_addr(struct e1000_hw *hw) | |||
4354 | u16 offset; | 4263 | u16 offset; |
4355 | u16 eeprom_data, i; | 4264 | u16 eeprom_data, i; |
4356 | 4265 | ||
4357 | e_dbg("e1000_read_mac_addr"); | ||
4358 | |||
4359 | for (i = 0; i < NODE_ADDRESS_SIZE; i += 2) { | 4266 | for (i = 0; i < NODE_ADDRESS_SIZE; i += 2) { |
4360 | offset = i >> 1; | 4267 | offset = i >> 1; |
4361 | if (e1000_read_eeprom(hw, offset, 1, &eeprom_data) < 0) { | 4268 | if (e1000_read_eeprom(hw, offset, 1, &eeprom_data) < 0) { |
@@ -4394,8 +4301,6 @@ static void e1000_init_rx_addrs(struct e1000_hw *hw) | |||
4394 | u32 i; | 4301 | u32 i; |
4395 | u32 rar_num; | 4302 | u32 rar_num; |
4396 | 4303 | ||
4397 | e_dbg("e1000_init_rx_addrs"); | ||
4398 | |||
4399 | /* Setup the receive address. */ | 4304 | /* Setup the receive address. */ |
4400 | e_dbg("Programming MAC Address into RAR[0]\n"); | 4305 | e_dbg("Programming MAC Address into RAR[0]\n"); |
4401 | 4306 | ||
@@ -4553,8 +4458,6 @@ static s32 e1000_id_led_init(struct e1000_hw *hw) | |||
4553 | u16 eeprom_data, i, temp; | 4458 | u16 eeprom_data, i, temp; |
4554 | const u16 led_mask = 0x0F; | 4459 | const u16 led_mask = 0x0F; |
4555 | 4460 | ||
4556 | e_dbg("e1000_id_led_init"); | ||
4557 | |||
4558 | if (hw->mac_type < e1000_82540) { | 4461 | if (hw->mac_type < e1000_82540) { |
4559 | /* Nothing to do */ | 4462 | /* Nothing to do */ |
4560 | return E1000_SUCCESS; | 4463 | return E1000_SUCCESS; |
@@ -4626,8 +4529,6 @@ s32 e1000_setup_led(struct e1000_hw *hw) | |||
4626 | u32 ledctl; | 4529 | u32 ledctl; |
4627 | s32 ret_val = E1000_SUCCESS; | 4530 | s32 ret_val = E1000_SUCCESS; |
4628 | 4531 | ||
4629 | e_dbg("e1000_setup_led"); | ||
4630 | |||
4631 | switch (hw->mac_type) { | 4532 | switch (hw->mac_type) { |
4632 | case e1000_82542_rev2_0: | 4533 | case e1000_82542_rev2_0: |
4633 | case e1000_82542_rev2_1: | 4534 | case e1000_82542_rev2_1: |
@@ -4678,8 +4579,6 @@ s32 e1000_cleanup_led(struct e1000_hw *hw) | |||
4678 | { | 4579 | { |
4679 | s32 ret_val = E1000_SUCCESS; | 4580 | s32 ret_val = E1000_SUCCESS; |
4680 | 4581 | ||
4681 | e_dbg("e1000_cleanup_led"); | ||
4682 | |||
4683 | switch (hw->mac_type) { | 4582 | switch (hw->mac_type) { |
4684 | case e1000_82542_rev2_0: | 4583 | case e1000_82542_rev2_0: |
4685 | case e1000_82542_rev2_1: | 4584 | case e1000_82542_rev2_1: |
@@ -4714,8 +4613,6 @@ s32 e1000_led_on(struct e1000_hw *hw) | |||
4714 | { | 4613 | { |
4715 | u32 ctrl = er32(CTRL); | 4614 | u32 ctrl = er32(CTRL); |
4716 | 4615 | ||
4717 | e_dbg("e1000_led_on"); | ||
4718 | |||
4719 | switch (hw->mac_type) { | 4616 | switch (hw->mac_type) { |
4720 | case e1000_82542_rev2_0: | 4617 | case e1000_82542_rev2_0: |
4721 | case e1000_82542_rev2_1: | 4618 | case e1000_82542_rev2_1: |
@@ -4760,8 +4657,6 @@ s32 e1000_led_off(struct e1000_hw *hw) | |||
4760 | { | 4657 | { |
4761 | u32 ctrl = er32(CTRL); | 4658 | u32 ctrl = er32(CTRL); |
4762 | 4659 | ||
4763 | e_dbg("e1000_led_off"); | ||
4764 | |||
4765 | switch (hw->mac_type) { | 4660 | switch (hw->mac_type) { |
4766 | case e1000_82542_rev2_0: | 4661 | case e1000_82542_rev2_0: |
4767 | case e1000_82542_rev2_1: | 4662 | case e1000_82542_rev2_1: |
@@ -4889,8 +4784,6 @@ static void e1000_clear_hw_cntrs(struct e1000_hw *hw) | |||
4889 | */ | 4784 | */ |
4890 | void e1000_reset_adaptive(struct e1000_hw *hw) | 4785 | void e1000_reset_adaptive(struct e1000_hw *hw) |
4891 | { | 4786 | { |
4892 | e_dbg("e1000_reset_adaptive"); | ||
4893 | |||
4894 | if (hw->adaptive_ifs) { | 4787 | if (hw->adaptive_ifs) { |
4895 | if (!hw->ifs_params_forced) { | 4788 | if (!hw->ifs_params_forced) { |
4896 | hw->current_ifs_val = 0; | 4789 | hw->current_ifs_val = 0; |
@@ -4917,8 +4810,6 @@ void e1000_reset_adaptive(struct e1000_hw *hw) | |||
4917 | */ | 4810 | */ |
4918 | void e1000_update_adaptive(struct e1000_hw *hw) | 4811 | void e1000_update_adaptive(struct e1000_hw *hw) |
4919 | { | 4812 | { |
4920 | e_dbg("e1000_update_adaptive"); | ||
4921 | |||
4922 | if (hw->adaptive_ifs) { | 4813 | if (hw->adaptive_ifs) { |
4923 | if ((hw->collision_delta *hw->ifs_ratio) > hw->tx_packet_delta) { | 4814 | if ((hw->collision_delta *hw->ifs_ratio) > hw->tx_packet_delta) { |
4924 | if (hw->tx_packet_delta > MIN_NUM_XMITS) { | 4815 | if (hw->tx_packet_delta > MIN_NUM_XMITS) { |
@@ -5114,8 +5005,6 @@ static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length, | |||
5114 | u16 i, phy_data; | 5005 | u16 i, phy_data; |
5115 | u16 cable_length; | 5006 | u16 cable_length; |
5116 | 5007 | ||
5117 | e_dbg("e1000_get_cable_length"); | ||
5118 | |||
5119 | *min_length = *max_length = 0; | 5008 | *min_length = *max_length = 0; |
5120 | 5009 | ||
5121 | /* Use old method for Phy older than IGP */ | 5010 | /* Use old method for Phy older than IGP */ |
@@ -5231,8 +5120,6 @@ static s32 e1000_check_polarity(struct e1000_hw *hw, | |||
5231 | s32 ret_val; | 5120 | s32 ret_val; |
5232 | u16 phy_data; | 5121 | u16 phy_data; |
5233 | 5122 | ||
5234 | e_dbg("e1000_check_polarity"); | ||
5235 | |||
5236 | if (hw->phy_type == e1000_phy_m88) { | 5123 | if (hw->phy_type == e1000_phy_m88) { |
5237 | /* return the Polarity bit in the Status register. */ | 5124 | /* return the Polarity bit in the Status register. */ |
5238 | ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, | 5125 | ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, |
@@ -5299,8 +5186,6 @@ static s32 e1000_check_downshift(struct e1000_hw *hw) | |||
5299 | s32 ret_val; | 5186 | s32 ret_val; |
5300 | u16 phy_data; | 5187 | u16 phy_data; |
5301 | 5188 | ||
5302 | e_dbg("e1000_check_downshift"); | ||
5303 | |||
5304 | if (hw->phy_type == e1000_phy_igp) { | 5189 | if (hw->phy_type == e1000_phy_igp) { |
5305 | ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH, | 5190 | ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH, |
5306 | &phy_data); | 5191 | &phy_data); |
@@ -5411,8 +5296,6 @@ static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, bool link_up) | |||
5411 | s32 ret_val; | 5296 | s32 ret_val; |
5412 | u16 phy_data, phy_saved_data, speed, duplex, i; | 5297 | u16 phy_data, phy_saved_data, speed, duplex, i; |
5413 | 5298 | ||
5414 | e_dbg("e1000_config_dsp_after_link_change"); | ||
5415 | |||
5416 | if (hw->phy_type != e1000_phy_igp) | 5299 | if (hw->phy_type != e1000_phy_igp) |
5417 | return E1000_SUCCESS; | 5300 | return E1000_SUCCESS; |
5418 | 5301 | ||
@@ -5546,8 +5429,6 @@ static s32 e1000_set_phy_mode(struct e1000_hw *hw) | |||
5546 | s32 ret_val; | 5429 | s32 ret_val; |
5547 | u16 eeprom_data; | 5430 | u16 eeprom_data; |
5548 | 5431 | ||
5549 | e_dbg("e1000_set_phy_mode"); | ||
5550 | |||
5551 | if ((hw->mac_type == e1000_82545_rev_3) && | 5432 | if ((hw->mac_type == e1000_82545_rev_3) && |
5552 | (hw->media_type == e1000_media_type_copper)) { | 5433 | (hw->media_type == e1000_media_type_copper)) { |
5553 | ret_val = | 5434 | ret_val = |
@@ -5594,7 +5475,6 @@ static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active) | |||
5594 | { | 5475 | { |
5595 | s32 ret_val; | 5476 | s32 ret_val; |
5596 | u16 phy_data; | 5477 | u16 phy_data; |
5597 | e_dbg("e1000_set_d3_lplu_state"); | ||
5598 | 5478 | ||
5599 | if (hw->phy_type != e1000_phy_igp) | 5479 | if (hw->phy_type != e1000_phy_igp) |
5600 | return E1000_SUCCESS; | 5480 | return E1000_SUCCESS; |
@@ -5699,8 +5579,6 @@ static s32 e1000_set_vco_speed(struct e1000_hw *hw) | |||
5699 | u16 default_page = 0; | 5579 | u16 default_page = 0; |
5700 | u16 phy_data; | 5580 | u16 phy_data; |
5701 | 5581 | ||
5702 | e_dbg("e1000_set_vco_speed"); | ||
5703 | |||
5704 | switch (hw->mac_type) { | 5582 | switch (hw->mac_type) { |
5705 | case e1000_82545_rev_3: | 5583 | case e1000_82545_rev_3: |
5706 | case e1000_82546_rev_3: | 5584 | case e1000_82546_rev_3: |
@@ -5872,7 +5750,6 @@ static s32 e1000_polarity_reversal_workaround(struct e1000_hw *hw) | |||
5872 | */ | 5750 | */ |
5873 | static s32 e1000_get_auto_rd_done(struct e1000_hw *hw) | 5751 | static s32 e1000_get_auto_rd_done(struct e1000_hw *hw) |
5874 | { | 5752 | { |
5875 | e_dbg("e1000_get_auto_rd_done"); | ||
5876 | msleep(5); | 5753 | msleep(5); |
5877 | return E1000_SUCCESS; | 5754 | return E1000_SUCCESS; |
5878 | } | 5755 | } |
@@ -5887,7 +5764,6 @@ static s32 e1000_get_auto_rd_done(struct e1000_hw *hw) | |||
5887 | */ | 5764 | */ |
5888 | static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw) | 5765 | static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw) |
5889 | { | 5766 | { |
5890 | e_dbg("e1000_get_phy_cfg_done"); | ||
5891 | msleep(10); | 5767 | msleep(10); |
5892 | return E1000_SUCCESS; | 5768 | return E1000_SUCCESS; |
5893 | } | 5769 | } |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 46e6544ed1b7..27058dfe418b 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -2682,14 +2682,13 @@ static int e1000_tso(struct e1000_adapter *adapter, | |||
2682 | u32 cmd_length = 0; | 2682 | u32 cmd_length = 0; |
2683 | u16 ipcse = 0, tucse, mss; | 2683 | u16 ipcse = 0, tucse, mss; |
2684 | u8 ipcss, ipcso, tucss, tucso, hdr_len; | 2684 | u8 ipcss, ipcso, tucss, tucso, hdr_len; |
2685 | int err; | ||
2686 | 2685 | ||
2687 | if (skb_is_gso(skb)) { | 2686 | if (skb_is_gso(skb)) { |
2688 | if (skb_header_cloned(skb)) { | 2687 | int err; |
2689 | err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 2688 | |
2690 | if (err) | 2689 | err = skb_cow_head(skb, 0); |
2691 | return err; | 2690 | if (err < 0) |
2692 | } | 2691 | return err; |
2693 | 2692 | ||
2694 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); | 2693 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
2695 | mss = skb_shinfo(skb)->gso_size; | 2694 | mss = skb_shinfo(skb)->gso_size; |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index dce377b59b2c..d50c91e50528 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -5100,16 +5100,14 @@ static int e1000_tso(struct e1000_ring *tx_ring, struct sk_buff *skb) | |||
5100 | u32 cmd_length = 0; | 5100 | u32 cmd_length = 0; |
5101 | u16 ipcse = 0, mss; | 5101 | u16 ipcse = 0, mss; |
5102 | u8 ipcss, ipcso, tucss, tucso, hdr_len; | 5102 | u8 ipcss, ipcso, tucss, tucso, hdr_len; |
5103 | int err; | ||
5103 | 5104 | ||
5104 | if (!skb_is_gso(skb)) | 5105 | if (!skb_is_gso(skb)) |
5105 | return 0; | 5106 | return 0; |
5106 | 5107 | ||
5107 | if (skb_header_cloned(skb)) { | 5108 | err = skb_cow_head(skb, 0); |
5108 | int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 5109 | if (err < 0) |
5109 | 5110 | return err; | |
5110 | if (err) | ||
5111 | return err; | ||
5112 | } | ||
5113 | 5111 | ||
5114 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); | 5112 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
5115 | mss = skb_shinfo(skb)->gso_size; | 5113 | mss = skb_shinfo(skb)->gso_size; |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c index 53be5f44d015..b9f50f40abe1 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c | |||
@@ -1114,20 +1114,18 @@ static int i40e_tso(struct i40e_ring *tx_ring, struct sk_buff *skb, | |||
1114 | u64 *cd_type_cmd_tso_mss, u32 *cd_tunneling) | 1114 | u64 *cd_type_cmd_tso_mss, u32 *cd_tunneling) |
1115 | { | 1115 | { |
1116 | u32 cd_cmd, cd_tso_len, cd_mss; | 1116 | u32 cd_cmd, cd_tso_len, cd_mss; |
1117 | struct ipv6hdr *ipv6h; | ||
1117 | struct tcphdr *tcph; | 1118 | struct tcphdr *tcph; |
1118 | struct iphdr *iph; | 1119 | struct iphdr *iph; |
1119 | u32 l4len; | 1120 | u32 l4len; |
1120 | int err; | 1121 | int err; |
1121 | struct ipv6hdr *ipv6h; | ||
1122 | 1122 | ||
1123 | if (!skb_is_gso(skb)) | 1123 | if (!skb_is_gso(skb)) |
1124 | return 0; | 1124 | return 0; |
1125 | 1125 | ||
1126 | if (skb_header_cloned(skb)) { | 1126 | err = skb_cow_head(skb, 0); |
1127 | err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 1127 | if (err < 0) |
1128 | if (err) | 1128 | return err; |
1129 | return err; | ||
1130 | } | ||
1131 | 1129 | ||
1132 | if (protocol == htons(ETH_P_IP)) { | 1130 | if (protocol == htons(ETH_P_IP)) { |
1133 | iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb); | 1131 | iph = skb->encapsulation ? inner_ip_hdr(skb) : ip_hdr(skb); |
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index e35e66ffa782..2797548fde0d 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c | |||
@@ -1412,6 +1412,14 @@ restart_watchdog: | |||
1412 | schedule_work(&adapter->adminq_task); | 1412 | schedule_work(&adapter->adminq_task); |
1413 | } | 1413 | } |
1414 | 1414 | ||
1415 | /** | ||
1416 | * i40evf_configure_rss - increment to next available tx queue | ||
1417 | * @adapter: board private structure | ||
1418 | * @j: queue counter | ||
1419 | * | ||
1420 | * Helper function for RSS programming to increment through available | ||
1421 | * queus. Returns the next queue value. | ||
1422 | **/ | ||
1415 | static int next_queue(struct i40evf_adapter *adapter, int j) | 1423 | static int next_queue(struct i40evf_adapter *adapter, int j) |
1416 | { | 1424 | { |
1417 | j += 1; | 1425 | j += 1; |
@@ -1451,10 +1459,14 @@ static void i40evf_configure_rss(struct i40evf_adapter *adapter) | |||
1451 | /* Populate the LUT with max no. of queues in round robin fashion */ | 1459 | /* Populate the LUT with max no. of queues in round robin fashion */ |
1452 | j = adapter->vsi_res->num_queue_pairs; | 1460 | j = adapter->vsi_res->num_queue_pairs; |
1453 | for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { | 1461 | for (i = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { |
1454 | lut = next_queue(adapter, j); | 1462 | j = next_queue(adapter, j); |
1455 | lut |= next_queue(adapter, j) << 8; | 1463 | lut = j; |
1456 | lut |= next_queue(adapter, j) << 16; | 1464 | j = next_queue(adapter, j); |
1457 | lut |= next_queue(adapter, j) << 24; | 1465 | lut |= j << 8; |
1466 | j = next_queue(adapter, j); | ||
1467 | lut |= j << 16; | ||
1468 | j = next_queue(adapter, j); | ||
1469 | lut |= j << 24; | ||
1458 | wr32(hw, I40E_VFQF_HLUT(i), lut); | 1470 | wr32(hw, I40E_VFQF_HLUT(i), lut); |
1459 | } | 1471 | } |
1460 | i40e_flush(hw); | 1472 | i40e_flush(hw); |
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h index 7fbe1e925143..27130065d92a 100644 --- a/drivers/net/ethernet/intel/igb/igb.h +++ b/drivers/net/ethernet/intel/igb/igb.h | |||
@@ -241,7 +241,6 @@ struct igb_ring { | |||
241 | struct igb_tx_buffer *tx_buffer_info; | 241 | struct igb_tx_buffer *tx_buffer_info; |
242 | struct igb_rx_buffer *rx_buffer_info; | 242 | struct igb_rx_buffer *rx_buffer_info; |
243 | }; | 243 | }; |
244 | unsigned long last_rx_timestamp; | ||
245 | void *desc; /* descriptor ring memory */ | 244 | void *desc; /* descriptor ring memory */ |
246 | unsigned long flags; /* ring specific flags */ | 245 | unsigned long flags; /* ring specific flags */ |
247 | void __iomem *tail; /* pointer to ring tail register */ | 246 | void __iomem *tail; /* pointer to ring tail register */ |
@@ -437,6 +436,7 @@ struct igb_adapter { | |||
437 | struct hwtstamp_config tstamp_config; | 436 | struct hwtstamp_config tstamp_config; |
438 | unsigned long ptp_tx_start; | 437 | unsigned long ptp_tx_start; |
439 | unsigned long last_rx_ptp_check; | 438 | unsigned long last_rx_ptp_check; |
439 | unsigned long last_rx_timestamp; | ||
440 | spinlock_t tmreg_lock; | 440 | spinlock_t tmreg_lock; |
441 | struct cyclecounter cc; | 441 | struct cyclecounter cc; |
442 | struct timecounter tc; | 442 | struct timecounter tc; |
@@ -533,20 +533,6 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter); | |||
533 | void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb); | 533 | void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb); |
534 | void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va, | 534 | void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va, |
535 | struct sk_buff *skb); | 535 | struct sk_buff *skb); |
536 | static inline void igb_ptp_rx_hwtstamp(struct igb_ring *rx_ring, | ||
537 | union e1000_adv_rx_desc *rx_desc, | ||
538 | struct sk_buff *skb) | ||
539 | { | ||
540 | if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TS) && | ||
541 | !igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) | ||
542 | igb_ptp_rx_rgtstamp(rx_ring->q_vector, skb); | ||
543 | |||
544 | /* Update the last_rx_timestamp timer in order to enable watchdog check | ||
545 | * for error case of latched timestamp on a dropped packet. | ||
546 | */ | ||
547 | rx_ring->last_rx_timestamp = jiffies; | ||
548 | } | ||
549 | |||
550 | int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr); | 536 | int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr); |
551 | int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr); | 537 | int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr); |
552 | #ifdef CONFIG_IGB_HWMON | 538 | #ifdef CONFIG_IGB_HWMON |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 30198185d19a..fb98d4602f9d 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -4605,6 +4605,7 @@ static int igb_tso(struct igb_ring *tx_ring, | |||
4605 | struct sk_buff *skb = first->skb; | 4605 | struct sk_buff *skb = first->skb; |
4606 | u32 vlan_macip_lens, type_tucmd; | 4606 | u32 vlan_macip_lens, type_tucmd; |
4607 | u32 mss_l4len_idx, l4len; | 4607 | u32 mss_l4len_idx, l4len; |
4608 | int err; | ||
4608 | 4609 | ||
4609 | if (skb->ip_summed != CHECKSUM_PARTIAL) | 4610 | if (skb->ip_summed != CHECKSUM_PARTIAL) |
4610 | return 0; | 4611 | return 0; |
@@ -4612,11 +4613,9 @@ static int igb_tso(struct igb_ring *tx_ring, | |||
4612 | if (!skb_is_gso(skb)) | 4613 | if (!skb_is_gso(skb)) |
4613 | return 0; | 4614 | return 0; |
4614 | 4615 | ||
4615 | if (skb_header_cloned(skb)) { | 4616 | err = skb_cow_head(skb, 0); |
4616 | int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 4617 | if (err < 0) |
4617 | if (err) | 4618 | return err; |
4618 | return err; | ||
4619 | } | ||
4620 | 4619 | ||
4621 | /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ | 4620 | /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ |
4622 | type_tucmd = E1000_ADVTXD_TUCMD_L4T_TCP; | 4621 | type_tucmd = E1000_ADVTXD_TUCMD_L4T_TCP; |
@@ -6955,7 +6954,9 @@ static void igb_process_skb_fields(struct igb_ring *rx_ring, | |||
6955 | 6954 | ||
6956 | igb_rx_checksum(rx_ring, rx_desc, skb); | 6955 | igb_rx_checksum(rx_ring, rx_desc, skb); |
6957 | 6956 | ||
6958 | igb_ptp_rx_hwtstamp(rx_ring, rx_desc, skb); | 6957 | if (igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TS) && |
6958 | !igb_test_staterr(rx_desc, E1000_RXDADV_STAT_TSIP)) | ||
6959 | igb_ptp_rx_rgtstamp(rx_ring->q_vector, skb); | ||
6959 | 6960 | ||
6960 | if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) && | 6961 | if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) && |
6961 | igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) { | 6962 | igb_test_staterr(rx_desc, E1000_RXD_STAT_VP)) { |
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index 2cca8fd5e574..9209d652e1c9 100644 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c | |||
@@ -427,10 +427,8 @@ static void igb_ptp_overflow_check(struct work_struct *work) | |||
427 | void igb_ptp_rx_hang(struct igb_adapter *adapter) | 427 | void igb_ptp_rx_hang(struct igb_adapter *adapter) |
428 | { | 428 | { |
429 | struct e1000_hw *hw = &adapter->hw; | 429 | struct e1000_hw *hw = &adapter->hw; |
430 | struct igb_ring *rx_ring; | ||
431 | u32 tsyncrxctl = rd32(E1000_TSYNCRXCTL); | 430 | u32 tsyncrxctl = rd32(E1000_TSYNCRXCTL); |
432 | unsigned long rx_event; | 431 | unsigned long rx_event; |
433 | int n; | ||
434 | 432 | ||
435 | if (hw->mac.type != e1000_82576) | 433 | if (hw->mac.type != e1000_82576) |
436 | return; | 434 | return; |
@@ -445,11 +443,8 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter) | |||
445 | 443 | ||
446 | /* Determine the most recent watchdog or rx_timestamp event */ | 444 | /* Determine the most recent watchdog or rx_timestamp event */ |
447 | rx_event = adapter->last_rx_ptp_check; | 445 | rx_event = adapter->last_rx_ptp_check; |
448 | for (n = 0; n < adapter->num_rx_queues; n++) { | 446 | if (time_after(adapter->last_rx_timestamp, rx_event)) |
449 | rx_ring = adapter->rx_ring[n]; | 447 | rx_event = adapter->last_rx_timestamp; |
450 | if (time_after(rx_ring->last_rx_timestamp, rx_event)) | ||
451 | rx_event = rx_ring->last_rx_timestamp; | ||
452 | } | ||
453 | 448 | ||
454 | /* Only need to read the high RXSTMP register to clear the lock */ | 449 | /* Only need to read the high RXSTMP register to clear the lock */ |
455 | if (time_is_before_jiffies(rx_event + 5 * HZ)) { | 450 | if (time_is_before_jiffies(rx_event + 5 * HZ)) { |
@@ -540,6 +535,11 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, | |||
540 | regval |= (u64)rd32(E1000_RXSTMPH) << 32; | 535 | regval |= (u64)rd32(E1000_RXSTMPH) << 32; |
541 | 536 | ||
542 | igb_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval); | 537 | igb_ptp_systim_to_hwtstamp(adapter, skb_hwtstamps(skb), regval); |
538 | |||
539 | /* Update the last_rx_timestamp timer in order to enable watchdog check | ||
540 | * for error case of latched timestamp on a dropped packet. | ||
541 | */ | ||
542 | adapter->last_rx_timestamp = jiffies; | ||
543 | } | 543 | } |
544 | 544 | ||
545 | /** | 545 | /** |
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index b7ab03a2f28f..d608599e123a 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c | |||
@@ -1910,20 +1910,18 @@ static int igbvf_tso(struct igbvf_adapter *adapter, | |||
1910 | struct sk_buff *skb, u32 tx_flags, u8 *hdr_len) | 1910 | struct sk_buff *skb, u32 tx_flags, u8 *hdr_len) |
1911 | { | 1911 | { |
1912 | struct e1000_adv_tx_context_desc *context_desc; | 1912 | struct e1000_adv_tx_context_desc *context_desc; |
1913 | unsigned int i; | ||
1914 | int err; | ||
1915 | struct igbvf_buffer *buffer_info; | 1913 | struct igbvf_buffer *buffer_info; |
1916 | u32 info = 0, tu_cmd = 0; | 1914 | u32 info = 0, tu_cmd = 0; |
1917 | u32 mss_l4len_idx, l4len; | 1915 | u32 mss_l4len_idx, l4len; |
1916 | unsigned int i; | ||
1917 | int err; | ||
1918 | |||
1918 | *hdr_len = 0; | 1919 | *hdr_len = 0; |
1919 | 1920 | ||
1920 | if (skb_header_cloned(skb)) { | 1921 | err = skb_cow_head(skb, 0); |
1921 | err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 1922 | if (err < 0) { |
1922 | if (err) { | 1923 | dev_err(&adapter->pdev->dev, "igbvf_tso returning an error\n"); |
1923 | dev_err(&adapter->pdev->dev, | 1924 | return err; |
1924 | "igbvf_tso returning an error\n"); | ||
1925 | return err; | ||
1926 | } | ||
1927 | } | 1925 | } |
1928 | 1926 | ||
1929 | l4len = tcp_hdrlen(skb); | 1927 | l4len = tcp_hdrlen(skb); |
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c index f42c201f727f..60801273915c 100644 --- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c +++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c | |||
@@ -1220,17 +1220,15 @@ ixgb_tso(struct ixgb_adapter *adapter, struct sk_buff *skb) | |||
1220 | unsigned int i; | 1220 | unsigned int i; |
1221 | u8 ipcss, ipcso, tucss, tucso, hdr_len; | 1221 | u8 ipcss, ipcso, tucss, tucso, hdr_len; |
1222 | u16 ipcse, tucse, mss; | 1222 | u16 ipcse, tucse, mss; |
1223 | int err; | ||
1224 | 1223 | ||
1225 | if (likely(skb_is_gso(skb))) { | 1224 | if (likely(skb_is_gso(skb))) { |
1226 | struct ixgb_buffer *buffer_info; | 1225 | struct ixgb_buffer *buffer_info; |
1227 | struct iphdr *iph; | 1226 | struct iphdr *iph; |
1227 | int err; | ||
1228 | 1228 | ||
1229 | if (skb_header_cloned(skb)) { | 1229 | err = skb_cow_head(skb, 0); |
1230 | err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 1230 | if (err < 0) |
1231 | if (err) | 1231 | return err; |
1232 | return err; | ||
1233 | } | ||
1234 | 1232 | ||
1235 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); | 1233 | hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); |
1236 | mss = skb_shinfo(skb)->gso_size; | 1234 | mss = skb_shinfo(skb)->gso_size; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index 55c53a1cbb62..1a12c1dd7a27 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h | |||
@@ -811,6 +811,7 @@ enum ixgbe_state_t { | |||
811 | __IXGBE_DISABLED, | 811 | __IXGBE_DISABLED, |
812 | __IXGBE_REMOVING, | 812 | __IXGBE_REMOVING, |
813 | __IXGBE_SERVICE_SCHED, | 813 | __IXGBE_SERVICE_SCHED, |
814 | __IXGBE_SERVICE_INITED, | ||
814 | __IXGBE_IN_SFP_INIT, | 815 | __IXGBE_IN_SFP_INIT, |
815 | __IXGBE_PTP_RUNNING, | 816 | __IXGBE_PTP_RUNNING, |
816 | __IXGBE_PTP_TX_IN_PROGRESS, | 817 | __IXGBE_PTP_TX_IN_PROGRESS, |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 8436c651b735..c4c526b7f99f 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -297,7 +297,8 @@ static void ixgbe_remove_adapter(struct ixgbe_hw *hw) | |||
297 | return; | 297 | return; |
298 | hw->hw_addr = NULL; | 298 | hw->hw_addr = NULL; |
299 | e_dev_err("Adapter removed\n"); | 299 | e_dev_err("Adapter removed\n"); |
300 | ixgbe_service_event_schedule(adapter); | 300 | if (test_bit(__IXGBE_SERVICE_INITED, &adapter->state)) |
301 | ixgbe_service_event_schedule(adapter); | ||
301 | } | 302 | } |
302 | 303 | ||
303 | void ixgbe_check_remove(struct ixgbe_hw *hw, u32 reg) | 304 | void ixgbe_check_remove(struct ixgbe_hw *hw, u32 reg) |
@@ -6509,6 +6510,7 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring, | |||
6509 | struct sk_buff *skb = first->skb; | 6510 | struct sk_buff *skb = first->skb; |
6510 | u32 vlan_macip_lens, type_tucmd; | 6511 | u32 vlan_macip_lens, type_tucmd; |
6511 | u32 mss_l4len_idx, l4len; | 6512 | u32 mss_l4len_idx, l4len; |
6513 | int err; | ||
6512 | 6514 | ||
6513 | if (skb->ip_summed != CHECKSUM_PARTIAL) | 6515 | if (skb->ip_summed != CHECKSUM_PARTIAL) |
6514 | return 0; | 6516 | return 0; |
@@ -6516,11 +6518,9 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring, | |||
6516 | if (!skb_is_gso(skb)) | 6518 | if (!skb_is_gso(skb)) |
6517 | return 0; | 6519 | return 0; |
6518 | 6520 | ||
6519 | if (skb_header_cloned(skb)) { | 6521 | err = skb_cow_head(skb, 0); |
6520 | int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 6522 | if (err < 0) |
6521 | if (err) | 6523 | return err; |
6522 | return err; | ||
6523 | } | ||
6524 | 6524 | ||
6525 | /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ | 6525 | /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ |
6526 | type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_TCP; | 6526 | type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_TCP; |
@@ -7077,8 +7077,8 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb, | |||
7077 | IXGBE_TX_FLAGS_VLAN_PRIO_SHIFT; | 7077 | IXGBE_TX_FLAGS_VLAN_PRIO_SHIFT; |
7078 | if (tx_flags & IXGBE_TX_FLAGS_SW_VLAN) { | 7078 | if (tx_flags & IXGBE_TX_FLAGS_SW_VLAN) { |
7079 | struct vlan_ethhdr *vhdr; | 7079 | struct vlan_ethhdr *vhdr; |
7080 | if (skb_header_cloned(skb) && | 7080 | |
7081 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | 7081 | if (skb_cow_head(skb, 0)) |
7082 | goto out_drop; | 7082 | goto out_drop; |
7083 | vhdr = (struct vlan_ethhdr *)skb->data; | 7083 | vhdr = (struct vlan_ethhdr *)skb->data; |
7084 | vhdr->h_vlan_TCI = htons(tx_flags >> | 7084 | vhdr->h_vlan_TCI = htons(tx_flags >> |
@@ -8023,6 +8023,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
8023 | /* EEPROM */ | 8023 | /* EEPROM */ |
8024 | memcpy(&hw->eeprom.ops, ii->eeprom_ops, sizeof(hw->eeprom.ops)); | 8024 | memcpy(&hw->eeprom.ops, ii->eeprom_ops, sizeof(hw->eeprom.ops)); |
8025 | eec = IXGBE_READ_REG(hw, IXGBE_EEC); | 8025 | eec = IXGBE_READ_REG(hw, IXGBE_EEC); |
8026 | if (ixgbe_removed(hw->hw_addr)) { | ||
8027 | err = -EIO; | ||
8028 | goto err_ioremap; | ||
8029 | } | ||
8026 | /* If EEPROM is valid (bit 8 = 1), use default otherwise use bit bang */ | 8030 | /* If EEPROM is valid (bit 8 = 1), use default otherwise use bit bang */ |
8027 | if (!(eec & (1 << 8))) | 8031 | if (!(eec & (1 << 8))) |
8028 | hw->eeprom.ops.read = &ixgbe_read_eeprom_bit_bang_generic; | 8032 | hw->eeprom.ops.read = &ixgbe_read_eeprom_bit_bang_generic; |
@@ -8185,7 +8189,12 @@ skip_sriov: | |||
8185 | setup_timer(&adapter->service_timer, &ixgbe_service_timer, | 8189 | setup_timer(&adapter->service_timer, &ixgbe_service_timer, |
8186 | (unsigned long) adapter); | 8190 | (unsigned long) adapter); |
8187 | 8191 | ||
8192 | if (ixgbe_removed(hw->hw_addr)) { | ||
8193 | err = -EIO; | ||
8194 | goto err_sw_init; | ||
8195 | } | ||
8188 | INIT_WORK(&adapter->service_task, ixgbe_service_task); | 8196 | INIT_WORK(&adapter->service_task, ixgbe_service_task); |
8197 | set_bit(__IXGBE_SERVICE_INITED, &adapter->state); | ||
8189 | clear_bit(__IXGBE_SERVICE_SCHED, &adapter->state); | 8198 | clear_bit(__IXGBE_SERVICE_SCHED, &adapter->state); |
8190 | 8199 | ||
8191 | err = ixgbe_init_interrupt_scheme(adapter); | 8200 | err = ixgbe_init_interrupt_scheme(adapter); |
@@ -8494,6 +8503,9 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev, | |||
8494 | 8503 | ||
8495 | skip_bad_vf_detection: | 8504 | skip_bad_vf_detection: |
8496 | #endif /* CONFIG_PCI_IOV */ | 8505 | #endif /* CONFIG_PCI_IOV */ |
8506 | if (!test_bit(__IXGBE_SERVICE_INITED, &adapter->state)) | ||
8507 | return PCI_ERS_RESULT_DISCONNECT; | ||
8508 | |||
8497 | rtnl_lock(); | 8509 | rtnl_lock(); |
8498 | netif_device_detach(netdev); | 8510 | netif_device_detach(netdev); |
8499 | 8511 | ||
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h index e7e7d695816b..a0a1de9ce238 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | |||
@@ -421,6 +421,7 @@ enum ixbgevf_state_t { | |||
421 | __IXGBEVF_DOWN, | 421 | __IXGBEVF_DOWN, |
422 | __IXGBEVF_DISABLED, | 422 | __IXGBEVF_DISABLED, |
423 | __IXGBEVF_REMOVING, | 423 | __IXGBEVF_REMOVING, |
424 | __IXGBEVF_WORK_INIT, | ||
424 | }; | 425 | }; |
425 | 426 | ||
426 | struct ixgbevf_cb { | 427 | struct ixgbevf_cb { |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 4ba139b2d25a..d0799e8e31e4 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -107,7 +107,8 @@ static void ixgbevf_remove_adapter(struct ixgbe_hw *hw) | |||
107 | return; | 107 | return; |
108 | hw->hw_addr = NULL; | 108 | hw->hw_addr = NULL; |
109 | dev_err(&adapter->pdev->dev, "Adapter removed\n"); | 109 | dev_err(&adapter->pdev->dev, "Adapter removed\n"); |
110 | schedule_work(&adapter->watchdog_task); | 110 | if (test_bit(__IXGBEVF_WORK_INIT, &adapter->state)) |
111 | schedule_work(&adapter->watchdog_task); | ||
111 | } | 112 | } |
112 | 113 | ||
113 | static void ixgbevf_check_remove(struct ixgbe_hw *hw, u32 reg) | 114 | static void ixgbevf_check_remove(struct ixgbe_hw *hw, u32 reg) |
@@ -2838,6 +2839,7 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring, | |||
2838 | struct sk_buff *skb = first->skb; | 2839 | struct sk_buff *skb = first->skb; |
2839 | u32 vlan_macip_lens, type_tucmd; | 2840 | u32 vlan_macip_lens, type_tucmd; |
2840 | u32 mss_l4len_idx, l4len; | 2841 | u32 mss_l4len_idx, l4len; |
2842 | int err; | ||
2841 | 2843 | ||
2842 | if (skb->ip_summed != CHECKSUM_PARTIAL) | 2844 | if (skb->ip_summed != CHECKSUM_PARTIAL) |
2843 | return 0; | 2845 | return 0; |
@@ -2845,11 +2847,9 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring, | |||
2845 | if (!skb_is_gso(skb)) | 2847 | if (!skb_is_gso(skb)) |
2846 | return 0; | 2848 | return 0; |
2847 | 2849 | ||
2848 | if (skb_header_cloned(skb)) { | 2850 | err = skb_cow_head(skb, 0); |
2849 | int err = pskb_expand_head(skb, 0, 0, GFP_ATOMIC); | 2851 | if (err < 0) |
2850 | if (err) | 2852 | return err; |
2851 | return err; | ||
2852 | } | ||
2853 | 2853 | ||
2854 | /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ | 2854 | /* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */ |
2855 | type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_TCP; | 2855 | type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_TCP; |
@@ -3573,8 +3573,13 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3573 | adapter->watchdog_timer.function = ixgbevf_watchdog; | 3573 | adapter->watchdog_timer.function = ixgbevf_watchdog; |
3574 | adapter->watchdog_timer.data = (unsigned long)adapter; | 3574 | adapter->watchdog_timer.data = (unsigned long)adapter; |
3575 | 3575 | ||
3576 | if (IXGBE_REMOVED(hw->hw_addr)) { | ||
3577 | err = -EIO; | ||
3578 | goto err_sw_init; | ||
3579 | } | ||
3576 | INIT_WORK(&adapter->reset_task, ixgbevf_reset_task); | 3580 | INIT_WORK(&adapter->reset_task, ixgbevf_reset_task); |
3577 | INIT_WORK(&adapter->watchdog_task, ixgbevf_watchdog_task); | 3581 | INIT_WORK(&adapter->watchdog_task, ixgbevf_watchdog_task); |
3582 | set_bit(__IXGBEVF_WORK_INIT, &adapter->state); | ||
3578 | 3583 | ||
3579 | err = ixgbevf_init_interrupt_scheme(adapter); | 3584 | err = ixgbevf_init_interrupt_scheme(adapter); |
3580 | if (err) | 3585 | if (err) |
@@ -3667,6 +3672,9 @@ static pci_ers_result_t ixgbevf_io_error_detected(struct pci_dev *pdev, | |||
3667 | struct net_device *netdev = pci_get_drvdata(pdev); | 3672 | struct net_device *netdev = pci_get_drvdata(pdev); |
3668 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | 3673 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); |
3669 | 3674 | ||
3675 | if (!test_bit(__IXGBEVF_WORK_INIT, &adapter->state)) | ||
3676 | return PCI_ERS_RESULT_DISCONNECT; | ||
3677 | |||
3670 | rtnl_lock(); | 3678 | rtnl_lock(); |
3671 | netif_device_detach(netdev); | 3679 | netif_device_detach(netdev); |
3672 | 3680 | ||
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 5d5fec6c4eb0..36aa109416c4 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -687,7 +687,7 @@ static void cpsw_rx_handler(void *token, int len, int status) | |||
687 | 687 | ||
688 | cpsw_dual_emac_src_port_detect(status, priv, ndev, skb); | 688 | cpsw_dual_emac_src_port_detect(status, priv, ndev, skb); |
689 | 689 | ||
690 | if (unlikely(status < 0)) { | 690 | if (unlikely(status < 0) || unlikely(!netif_running(ndev))) { |
691 | /* the interface is going down, skbs are purged */ | 691 | /* the interface is going down, skbs are purged */ |
692 | dev_kfree_skb_any(skb); | 692 | dev_kfree_skb_any(skb); |
693 | return; | 693 | return; |
@@ -1201,8 +1201,7 @@ static int cpsw_ndo_open(struct net_device *ndev) | |||
1201 | for_each_slave(priv, cpsw_slave_open, priv); | 1201 | for_each_slave(priv, cpsw_slave_open, priv); |
1202 | 1202 | ||
1203 | /* Add default VLAN */ | 1203 | /* Add default VLAN */ |
1204 | if (!priv->data.dual_emac) | 1204 | cpsw_add_default_vlan(priv); |
1205 | cpsw_add_default_vlan(priv); | ||
1206 | 1205 | ||
1207 | if (!cpsw_common_res_usage_state(priv)) { | 1206 | if (!cpsw_common_res_usage_state(priv)) { |
1208 | /* setup tx dma to fixed prio and zero offset */ | 1207 | /* setup tx dma to fixed prio and zero offset */ |
@@ -1253,6 +1252,12 @@ static int cpsw_ndo_open(struct net_device *ndev) | |||
1253 | cpsw_set_coalesce(ndev, &coal); | 1252 | cpsw_set_coalesce(ndev, &coal); |
1254 | } | 1253 | } |
1255 | 1254 | ||
1255 | napi_enable(&priv->napi); | ||
1256 | cpdma_ctlr_start(priv->dma); | ||
1257 | cpsw_intr_enable(priv); | ||
1258 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
1259 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
1260 | |||
1256 | prim_cpsw = cpsw_get_slave_priv(priv, 0); | 1261 | prim_cpsw = cpsw_get_slave_priv(priv, 0); |
1257 | if (prim_cpsw->irq_enabled == false) { | 1262 | if (prim_cpsw->irq_enabled == false) { |
1258 | if ((priv == prim_cpsw) || !netif_running(prim_cpsw->ndev)) { | 1263 | if ((priv == prim_cpsw) || !netif_running(prim_cpsw->ndev)) { |
@@ -1261,12 +1266,6 @@ static int cpsw_ndo_open(struct net_device *ndev) | |||
1261 | } | 1266 | } |
1262 | } | 1267 | } |
1263 | 1268 | ||
1264 | napi_enable(&priv->napi); | ||
1265 | cpdma_ctlr_start(priv->dma); | ||
1266 | cpsw_intr_enable(priv); | ||
1267 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | ||
1268 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | ||
1269 | |||
1270 | if (priv->data.dual_emac) | 1269 | if (priv->data.dual_emac) |
1271 | priv->slaves[priv->emac_port].open_stat = true; | 1270 | priv->slaves[priv->emac_port].open_stat = true; |
1272 | return 0; | 1271 | return 0; |
diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h index 13010b4dae5b..d18f711d0b0c 100644 --- a/drivers/net/hyperv/hyperv_net.h +++ b/drivers/net/hyperv/hyperv_net.h | |||
@@ -747,6 +747,7 @@ struct ndis_oject_header { | |||
747 | #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV4 0 | 747 | #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV4 0 |
748 | #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV6 1 | 748 | #define NDIS_TCP_LARGE_SEND_OFFLOAD_IPV6 1 |
749 | 749 | ||
750 | #define VERSION_4_OFFLOAD_SIZE 22 | ||
750 | /* | 751 | /* |
751 | * New offload OIDs for NDIS 6 | 752 | * New offload OIDs for NDIS 6 |
752 | */ | 753 | */ |
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index daddea2654ce..f7629ecefa84 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c | |||
@@ -344,7 +344,7 @@ static int netvsc_connect_vsp(struct hv_device *device) | |||
344 | memset(init_packet, 0, sizeof(struct nvsp_message)); | 344 | memset(init_packet, 0, sizeof(struct nvsp_message)); |
345 | 345 | ||
346 | if (net_device->nvsp_version <= NVSP_PROTOCOL_VERSION_4) | 346 | if (net_device->nvsp_version <= NVSP_PROTOCOL_VERSION_4) |
347 | ndis_version = 0x00050001; | 347 | ndis_version = 0x00060001; |
348 | else | 348 | else |
349 | ndis_version = 0x0006001e; | 349 | ndis_version = 0x0006001e; |
350 | 350 | ||
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 4e4cf9e0c8d7..31e55fba7cad 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -319,7 +319,9 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) | |||
319 | packet = kzalloc(sizeof(struct hv_netvsc_packet) + | 319 | packet = kzalloc(sizeof(struct hv_netvsc_packet) + |
320 | (num_data_pgs * sizeof(struct hv_page_buffer)) + | 320 | (num_data_pgs * sizeof(struct hv_page_buffer)) + |
321 | sizeof(struct rndis_message) + | 321 | sizeof(struct rndis_message) + |
322 | NDIS_VLAN_PPI_SIZE, GFP_ATOMIC); | 322 | NDIS_VLAN_PPI_SIZE + |
323 | NDIS_CSUM_PPI_SIZE + | ||
324 | NDIS_LSO_PPI_SIZE, GFP_ATOMIC); | ||
323 | if (!packet) { | 325 | if (!packet) { |
324 | /* out of memory, drop packet */ | 326 | /* out of memory, drop packet */ |
325 | netdev_err(net, "unable to allocate hv_netvsc_packet\n"); | 327 | netdev_err(net, "unable to allocate hv_netvsc_packet\n"); |
@@ -396,7 +398,30 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net) | |||
396 | csum_info->transmit.tcp_checksum = 1; | 398 | csum_info->transmit.tcp_checksum = 1; |
397 | csum_info->transmit.tcp_header_offset = hdr_offset; | 399 | csum_info->transmit.tcp_header_offset = hdr_offset; |
398 | } else if (net_trans_info & INFO_UDP) { | 400 | } else if (net_trans_info & INFO_UDP) { |
399 | csum_info->transmit.udp_checksum = 1; | 401 | /* UDP checksum offload is not supported on ws2008r2. |
402 | * Furthermore, on ws2012 and ws2012r2, there are some | ||
403 | * issues with udp checksum offload from Linux guests. | ||
404 | * (these are host issues). | ||
405 | * For now compute the checksum here. | ||
406 | */ | ||
407 | struct udphdr *uh; | ||
408 | u16 udp_len; | ||
409 | |||
410 | ret = skb_cow_head(skb, 0); | ||
411 | if (ret) | ||
412 | goto drop; | ||
413 | |||
414 | uh = udp_hdr(skb); | ||
415 | udp_len = ntohs(uh->len); | ||
416 | uh->check = 0; | ||
417 | uh->check = csum_tcpudp_magic(ip_hdr(skb)->saddr, | ||
418 | ip_hdr(skb)->daddr, | ||
419 | udp_len, IPPROTO_UDP, | ||
420 | csum_partial(uh, udp_len, 0)); | ||
421 | if (uh->check == 0) | ||
422 | uh->check = CSUM_MANGLED_0; | ||
423 | |||
424 | csum_info->transmit.udp_checksum = 0; | ||
400 | } | 425 | } |
401 | goto do_send; | 426 | goto do_send; |
402 | 427 | ||
@@ -436,6 +461,7 @@ do_send: | |||
436 | 461 | ||
437 | ret = netvsc_send(net_device_ctx->device_ctx, packet); | 462 | ret = netvsc_send(net_device_ctx->device_ctx, packet); |
438 | 463 | ||
464 | drop: | ||
439 | if (ret == 0) { | 465 | if (ret == 0) { |
440 | net->stats.tx_bytes += skb->len; | 466 | net->stats.tx_bytes += skb->len; |
441 | net->stats.tx_packets++; | 467 | net->stats.tx_packets++; |
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 4a37e3db9e32..143a98caf618 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c | |||
@@ -641,6 +641,16 @@ int rndis_filter_set_offload_params(struct hv_device *hdev, | |||
641 | struct rndis_set_complete *set_complete; | 641 | struct rndis_set_complete *set_complete; |
642 | u32 extlen = sizeof(struct ndis_offload_params); | 642 | u32 extlen = sizeof(struct ndis_offload_params); |
643 | int ret, t; | 643 | int ret, t; |
644 | u32 vsp_version = nvdev->nvsp_version; | ||
645 | |||
646 | if (vsp_version <= NVSP_PROTOCOL_VERSION_4) { | ||
647 | extlen = VERSION_4_OFFLOAD_SIZE; | ||
648 | /* On NVSP_PROTOCOL_VERSION_4 and below, we do not support | ||
649 | * UDP checksum offload. | ||
650 | */ | ||
651 | req_offloads->udp_ip_v4_csum = 0; | ||
652 | req_offloads->udp_ip_v6_csum = 0; | ||
653 | } | ||
644 | 654 | ||
645 | request = get_rndis_request(rdev, RNDIS_MSG_SET, | 655 | request = get_rndis_request(rdev, RNDIS_MSG_SET, |
646 | RNDIS_MESSAGE_SIZE(struct rndis_set_request) + extlen); | 656 | RNDIS_MESSAGE_SIZE(struct rndis_set_request) + extlen); |
@@ -674,7 +684,7 @@ int rndis_filter_set_offload_params(struct hv_device *hdev, | |||
674 | } else { | 684 | } else { |
675 | set_complete = &request->response_msg.msg.set_complete; | 685 | set_complete = &request->response_msg.msg.set_complete; |
676 | if (set_complete->status != RNDIS_STATUS_SUCCESS) { | 686 | if (set_complete->status != RNDIS_STATUS_SUCCESS) { |
677 | netdev_err(ndev, "Fail to set MAC on host side:0x%x\n", | 687 | netdev_err(ndev, "Fail to set offload on host side:0x%x\n", |
678 | set_complete->status); | 688 | set_complete->status); |
679 | ret = -EINVAL; | 689 | ret = -EINVAL; |
680 | } | 690 | } |
diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c index f3cdf64997d6..63aa9d9e34c5 100644 --- a/drivers/net/ntb_netdev.c +++ b/drivers/net/ntb_netdev.c | |||
@@ -78,11 +78,19 @@ static void ntb_netdev_event_handler(void *data, int status) | |||
78 | netdev_dbg(ndev, "Event %x, Link %x\n", status, | 78 | netdev_dbg(ndev, "Event %x, Link %x\n", status, |
79 | ntb_transport_link_query(dev->qp)); | 79 | ntb_transport_link_query(dev->qp)); |
80 | 80 | ||
81 | /* Currently, only link status event is supported */ | 81 | switch (status) { |
82 | if (status) | 82 | case NTB_LINK_DOWN: |
83 | netif_carrier_on(ndev); | ||
84 | else | ||
85 | netif_carrier_off(ndev); | 83 | netif_carrier_off(ndev); |
84 | break; | ||
85 | case NTB_LINK_UP: | ||
86 | if (!ntb_transport_link_query(dev->qp)) | ||
87 | return; | ||
88 | |||
89 | netif_carrier_on(ndev); | ||
90 | break; | ||
91 | default: | ||
92 | netdev_warn(ndev, "Unsupported event type %d\n", status); | ||
93 | } | ||
86 | } | 94 | } |
87 | 95 | ||
88 | static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data, | 96 | static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data, |
@@ -182,8 +190,10 @@ static int ntb_netdev_open(struct net_device *ndev) | |||
182 | 190 | ||
183 | rc = ntb_transport_rx_enqueue(dev->qp, skb, skb->data, | 191 | rc = ntb_transport_rx_enqueue(dev->qp, skb, skb->data, |
184 | ndev->mtu + ETH_HLEN); | 192 | ndev->mtu + ETH_HLEN); |
185 | if (rc == -EINVAL) | 193 | if (rc == -EINVAL) { |
194 | dev_kfree_skb(skb); | ||
186 | goto err; | 195 | goto err; |
196 | } | ||
187 | } | 197 | } |
188 | 198 | ||
189 | netif_carrier_off(ndev); | 199 | netif_carrier_off(ndev); |
@@ -367,12 +377,15 @@ static void ntb_netdev_remove(struct pci_dev *pdev) | |||
367 | { | 377 | { |
368 | struct net_device *ndev; | 378 | struct net_device *ndev; |
369 | struct ntb_netdev *dev; | 379 | struct ntb_netdev *dev; |
380 | bool found = false; | ||
370 | 381 | ||
371 | list_for_each_entry(dev, &dev_list, list) { | 382 | list_for_each_entry(dev, &dev_list, list) { |
372 | if (dev->pdev == pdev) | 383 | if (dev->pdev == pdev) { |
384 | found = true; | ||
373 | break; | 385 | break; |
386 | } | ||
374 | } | 387 | } |
375 | if (dev == NULL) | 388 | if (!found) |
376 | return; | 389 | return; |
377 | 390 | ||
378 | list_del(&dev->list); | 391 | list_del(&dev->list); |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 1d788f19135b..1b6d09aef427 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -756,12 +756,8 @@ void phy_state_machine(struct work_struct *work) | |||
756 | netif_carrier_on(phydev->attached_dev); | 756 | netif_carrier_on(phydev->attached_dev); |
757 | phydev->adjust_link(phydev->attached_dev); | 757 | phydev->adjust_link(phydev->attached_dev); |
758 | 758 | ||
759 | } else if (0 == phydev->link_timeout--) { | 759 | } else if (0 == phydev->link_timeout--) |
760 | needs_aneg = 1; | 760 | needs_aneg = 1; |
761 | /* If we have the magic_aneg bit, we try again */ | ||
762 | if (phydev->drv->flags & PHY_HAS_MAGICANEG) | ||
763 | break; | ||
764 | } | ||
765 | break; | 761 | break; |
766 | case PHY_NOLINK: | 762 | case PHY_NOLINK: |
767 | err = phy_read_status(phydev); | 763 | err = phy_read_status(phydev); |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 18e12a3f7fc3..3fbfb0869030 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -929,6 +929,9 @@ static int read_mii_word(struct net_device *netdev, int phy_id, int reg) | |||
929 | struct r8152 *tp = netdev_priv(netdev); | 929 | struct r8152 *tp = netdev_priv(netdev); |
930 | int ret; | 930 | int ret; |
931 | 931 | ||
932 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
933 | return -ENODEV; | ||
934 | |||
932 | if (phy_id != R8152_PHY_ID) | 935 | if (phy_id != R8152_PHY_ID) |
933 | return -EINVAL; | 936 | return -EINVAL; |
934 | 937 | ||
@@ -949,6 +952,9 @@ void write_mii_word(struct net_device *netdev, int phy_id, int reg, int val) | |||
949 | { | 952 | { |
950 | struct r8152 *tp = netdev_priv(netdev); | 953 | struct r8152 *tp = netdev_priv(netdev); |
951 | 954 | ||
955 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
956 | return; | ||
957 | |||
952 | if (phy_id != R8152_PHY_ID) | 958 | if (phy_id != R8152_PHY_ID) |
953 | return; | 959 | return; |
954 | 960 | ||
@@ -1962,6 +1968,9 @@ static int rtl_enable(struct r8152 *tp) | |||
1962 | 1968 | ||
1963 | static int rtl8152_enable(struct r8152 *tp) | 1969 | static int rtl8152_enable(struct r8152 *tp) |
1964 | { | 1970 | { |
1971 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
1972 | return -ENODEV; | ||
1973 | |||
1965 | set_tx_qlen(tp); | 1974 | set_tx_qlen(tp); |
1966 | rtl_set_eee_plus(tp); | 1975 | rtl_set_eee_plus(tp); |
1967 | 1976 | ||
@@ -1994,6 +2003,9 @@ static void r8153_set_rx_agg(struct r8152 *tp) | |||
1994 | 2003 | ||
1995 | static int rtl8153_enable(struct r8152 *tp) | 2004 | static int rtl8153_enable(struct r8152 *tp) |
1996 | { | 2005 | { |
2006 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
2007 | return -ENODEV; | ||
2008 | |||
1997 | set_tx_qlen(tp); | 2009 | set_tx_qlen(tp); |
1998 | rtl_set_eee_plus(tp); | 2010 | rtl_set_eee_plus(tp); |
1999 | r8153_set_rx_agg(tp); | 2011 | r8153_set_rx_agg(tp); |
@@ -2006,6 +2018,11 @@ static void rtl8152_disable(struct r8152 *tp) | |||
2006 | u32 ocp_data; | 2018 | u32 ocp_data; |
2007 | int i; | 2019 | int i; |
2008 | 2020 | ||
2021 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) { | ||
2022 | rtl_drop_queued_tx(tp); | ||
2023 | return; | ||
2024 | } | ||
2025 | |||
2009 | ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR); | 2026 | ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR); |
2010 | ocp_data &= ~RCR_ACPT_ALL; | 2027 | ocp_data &= ~RCR_ACPT_ALL; |
2011 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); | 2028 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); |
@@ -2232,6 +2249,9 @@ static void r8152b_exit_oob(struct r8152 *tp) | |||
2232 | u32 ocp_data; | 2249 | u32 ocp_data; |
2233 | int i; | 2250 | int i; |
2234 | 2251 | ||
2252 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
2253 | return; | ||
2254 | |||
2235 | ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR); | 2255 | ocp_data = ocp_read_dword(tp, MCU_TYPE_PLA, PLA_RCR); |
2236 | ocp_data &= ~RCR_ACPT_ALL; | 2256 | ocp_data &= ~RCR_ACPT_ALL; |
2237 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); | 2257 | ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RCR, ocp_data); |
@@ -2460,6 +2480,9 @@ static void r8153_first_init(struct r8152 *tp) | |||
2460 | u32 ocp_data; | 2480 | u32 ocp_data; |
2461 | int i; | 2481 | int i; |
2462 | 2482 | ||
2483 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
2484 | return; | ||
2485 | |||
2463 | rxdy_gated_en(tp, true); | 2486 | rxdy_gated_en(tp, true); |
2464 | r8153_teredo_off(tp); | 2487 | r8153_teredo_off(tp); |
2465 | 2488 | ||
@@ -2687,6 +2710,11 @@ out: | |||
2687 | 2710 | ||
2688 | static void rtl8152_down(struct r8152 *tp) | 2711 | static void rtl8152_down(struct r8152 *tp) |
2689 | { | 2712 | { |
2713 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) { | ||
2714 | rtl_drop_queued_tx(tp); | ||
2715 | return; | ||
2716 | } | ||
2717 | |||
2690 | r8152_power_cut_en(tp, false); | 2718 | r8152_power_cut_en(tp, false); |
2691 | r8152b_disable_aldps(tp); | 2719 | r8152b_disable_aldps(tp); |
2692 | r8152b_enter_oob(tp); | 2720 | r8152b_enter_oob(tp); |
@@ -2695,6 +2723,11 @@ static void rtl8152_down(struct r8152 *tp) | |||
2695 | 2723 | ||
2696 | static void rtl8153_down(struct r8152 *tp) | 2724 | static void rtl8153_down(struct r8152 *tp) |
2697 | { | 2725 | { |
2726 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) { | ||
2727 | rtl_drop_queued_tx(tp); | ||
2728 | return; | ||
2729 | } | ||
2730 | |||
2698 | r8153_u1u2en(tp, false); | 2731 | r8153_u1u2en(tp, false); |
2699 | r8153_power_cut_en(tp, false); | 2732 | r8153_power_cut_en(tp, false); |
2700 | r8153_disable_aldps(tp); | 2733 | r8153_disable_aldps(tp); |
@@ -2904,6 +2937,9 @@ static void r8152b_init(struct r8152 *tp) | |||
2904 | { | 2937 | { |
2905 | u32 ocp_data; | 2938 | u32 ocp_data; |
2906 | 2939 | ||
2940 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
2941 | return; | ||
2942 | |||
2907 | if (tp->version == RTL_VER_01) { | 2943 | if (tp->version == RTL_VER_01) { |
2908 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE); | 2944 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_LED_FEATURE); |
2909 | ocp_data &= ~LED_MODE_MASK; | 2945 | ocp_data &= ~LED_MODE_MASK; |
@@ -2939,6 +2975,9 @@ static void r8153_init(struct r8152 *tp) | |||
2939 | u32 ocp_data; | 2975 | u32 ocp_data; |
2940 | int i; | 2976 | int i; |
2941 | 2977 | ||
2978 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
2979 | return; | ||
2980 | |||
2942 | r8153_u1u2en(tp, false); | 2981 | r8153_u1u2en(tp, false); |
2943 | 2982 | ||
2944 | for (i = 0; i < 500; i++) { | 2983 | for (i = 0; i < 500; i++) { |
@@ -3213,6 +3252,9 @@ static int rtl8152_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) | |||
3213 | struct mii_ioctl_data *data = if_mii(rq); | 3252 | struct mii_ioctl_data *data = if_mii(rq); |
3214 | int res; | 3253 | int res; |
3215 | 3254 | ||
3255 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
3256 | return -ENODEV; | ||
3257 | |||
3216 | res = usb_autopm_get_interface(tp->intf); | 3258 | res = usb_autopm_get_interface(tp->intf); |
3217 | if (res < 0) | 3259 | if (res < 0) |
3218 | goto out; | 3260 | goto out; |
@@ -3293,12 +3335,18 @@ static void r8152b_get_version(struct r8152 *tp) | |||
3293 | 3335 | ||
3294 | static void rtl8152_unload(struct r8152 *tp) | 3336 | static void rtl8152_unload(struct r8152 *tp) |
3295 | { | 3337 | { |
3338 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
3339 | return; | ||
3340 | |||
3296 | if (tp->version != RTL_VER_01) | 3341 | if (tp->version != RTL_VER_01) |
3297 | r8152_power_cut_en(tp, true); | 3342 | r8152_power_cut_en(tp, true); |
3298 | } | 3343 | } |
3299 | 3344 | ||
3300 | static void rtl8153_unload(struct r8152 *tp) | 3345 | static void rtl8153_unload(struct r8152 *tp) |
3301 | { | 3346 | { |
3347 | if (test_bit(RTL8152_UNPLUG, &tp->flags)) | ||
3348 | return; | ||
3349 | |||
3302 | r8153_power_cut_en(tp, true); | 3350 | r8153_power_cut_en(tp, true); |
3303 | } | 3351 | } |
3304 | 3352 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c index 3b3e91057a4c..00fb8badbacc 100644 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c | |||
@@ -1004,11 +1004,9 @@ static bool ar5008_hw_ani_control_new(struct ath_hw *ah, | |||
1004 | case ATH9K_ANI_FIRSTEP_LEVEL:{ | 1004 | case ATH9K_ANI_FIRSTEP_LEVEL:{ |
1005 | u32 level = param; | 1005 | u32 level = param; |
1006 | 1006 | ||
1007 | value = level * 2; | 1007 | value = level; |
1008 | REG_RMW_FIELD(ah, AR_PHY_FIND_SIG, | 1008 | REG_RMW_FIELD(ah, AR_PHY_FIND_SIG, |
1009 | AR_PHY_FIND_SIG_FIRSTEP, value); | 1009 | AR_PHY_FIND_SIG_FIRSTEP, value); |
1010 | REG_RMW_FIELD(ah, AR_PHY_FIND_SIG_LOW, | ||
1011 | AR_PHY_FIND_SIG_FIRSTEP_LOW, value); | ||
1012 | 1010 | ||
1013 | if (level != aniState->firstepLevel) { | 1011 | if (level != aniState->firstepLevel) { |
1014 | ath_dbg(common, ANI, | 1012 | ath_dbg(common, ANI, |
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index 471e0f624e81..bd9e634879e6 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c | |||
@@ -312,10 +312,9 @@ static void ath9k_csa_update_vif(void *data, u8 *mac, struct ieee80211_vif *vif) | |||
312 | 312 | ||
313 | void ath9k_csa_update(struct ath_softc *sc) | 313 | void ath9k_csa_update(struct ath_softc *sc) |
314 | { | 314 | { |
315 | ieee80211_iterate_active_interfaces(sc->hw, | 315 | ieee80211_iterate_active_interfaces_atomic(sc->hw, |
316 | IEEE80211_IFACE_ITER_NORMAL, | 316 | IEEE80211_IFACE_ITER_NORMAL, |
317 | ath9k_csa_update_vif, | 317 | ath9k_csa_update_vif, sc); |
318 | sc); | ||
319 | } | 318 | } |
320 | 319 | ||
321 | void ath9k_beacon_tasklet(unsigned long data) | 320 | void ath9k_beacon_tasklet(unsigned long data) |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index e8149e3dbdd5..289f3d8924b5 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c | |||
@@ -471,8 +471,11 @@ static void ath9k_htc_tx_process(struct ath9k_htc_priv *priv, | |||
471 | if (!txok || !vif || !txs) | 471 | if (!txok || !vif || !txs) |
472 | goto send_mac80211; | 472 | goto send_mac80211; |
473 | 473 | ||
474 | if (txs->ts_flags & ATH9K_HTC_TXSTAT_ACK) | 474 | if (txs->ts_flags & ATH9K_HTC_TXSTAT_ACK) { |
475 | tx_info->flags |= IEEE80211_TX_STAT_ACK; | 475 | tx_info->flags |= IEEE80211_TX_STAT_ACK; |
476 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) | ||
477 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU; | ||
478 | } | ||
476 | 479 | ||
477 | if (txs->ts_flags & ATH9K_HTC_TXSTAT_FILT) | 480 | if (txs->ts_flags & ATH9K_HTC_TXSTAT_FILT) |
478 | tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; | 481 | tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index c0a4e866edca..cbbb02a6b13b 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -670,6 +670,7 @@ static const struct ieee80211_iface_combination if_comb[] = { | |||
670 | .num_different_channels = 1, | 670 | .num_different_channels = 1, |
671 | .beacon_int_infra_match = true, | 671 | .beacon_int_infra_match = true, |
672 | }, | 672 | }, |
673 | #ifdef CONFIG_ATH9K_DFS_CERTIFIED | ||
673 | { | 674 | { |
674 | .limits = if_dfs_limits, | 675 | .limits = if_dfs_limits, |
675 | .n_limits = ARRAY_SIZE(if_dfs_limits), | 676 | .n_limits = ARRAY_SIZE(if_dfs_limits), |
@@ -679,6 +680,7 @@ static const struct ieee80211_iface_combination if_comb[] = { | |||
679 | .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | | 680 | .radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | |
680 | BIT(NL80211_CHAN_WIDTH_20), | 681 | BIT(NL80211_CHAN_WIDTH_20), |
681 | } | 682 | } |
683 | #endif | ||
682 | }; | 684 | }; |
683 | 685 | ||
684 | static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | 686 | static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) |
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index 05ee7f10cc8f..24ccbe96e0c8 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c | |||
@@ -5176,22 +5176,22 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev, | |||
5176 | int ch = new_channel->hw_value; | 5176 | int ch = new_channel->hw_value; |
5177 | 5177 | ||
5178 | u16 old_band_5ghz; | 5178 | u16 old_band_5ghz; |
5179 | u32 tmp32; | 5179 | u16 tmp16; |
5180 | 5180 | ||
5181 | old_band_5ghz = | 5181 | old_band_5ghz = |
5182 | b43_phy_read(dev, B43_NPHY_BANDCTL) & B43_NPHY_BANDCTL_5GHZ; | 5182 | b43_phy_read(dev, B43_NPHY_BANDCTL) & B43_NPHY_BANDCTL_5GHZ; |
5183 | if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) { | 5183 | if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) { |
5184 | tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); | 5184 | tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR); |
5185 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); | 5185 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4); |
5186 | b43_phy_set(dev, B43_PHY_B_BBCFG, 0xC000); | 5186 | b43_phy_set(dev, B43_PHY_B_BBCFG, 0xC000); |
5187 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32); | 5187 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16); |
5188 | b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ); | 5188 | b43_phy_set(dev, B43_NPHY_BANDCTL, B43_NPHY_BANDCTL_5GHZ); |
5189 | } else if (new_channel->band == IEEE80211_BAND_2GHZ && old_band_5ghz) { | 5189 | } else if (new_channel->band == IEEE80211_BAND_2GHZ && old_band_5ghz) { |
5190 | b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ); | 5190 | b43_phy_mask(dev, B43_NPHY_BANDCTL, ~B43_NPHY_BANDCTL_5GHZ); |
5191 | tmp32 = b43_read32(dev, B43_MMIO_PSM_PHY_HDR); | 5191 | tmp16 = b43_read16(dev, B43_MMIO_PSM_PHY_HDR); |
5192 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32 | 4); | 5192 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16 | 4); |
5193 | b43_phy_mask(dev, B43_PHY_B_BBCFG, 0x3FFF); | 5193 | b43_phy_mask(dev, B43_PHY_B_BBCFG, 0x3FFF); |
5194 | b43_write32(dev, B43_MMIO_PSM_PHY_HDR, tmp32); | 5194 | b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp16); |
5195 | } | 5195 | } |
5196 | 5196 | ||
5197 | b43_chantab_phy_upload(dev, e); | 5197 | b43_chantab_phy_upload(dev, e); |
diff --git a/drivers/net/wireless/rsi/rsi_91x_core.c b/drivers/net/wireless/rsi/rsi_91x_core.c index e89535e86caf..1a8d32138593 100644 --- a/drivers/net/wireless/rsi/rsi_91x_core.c +++ b/drivers/net/wireless/rsi/rsi_91x_core.c | |||
@@ -102,10 +102,10 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common) | |||
102 | } | 102 | } |
103 | 103 | ||
104 | get_queue_num: | 104 | get_queue_num: |
105 | q_num = 0; | ||
106 | recontend_queue = false; | 105 | recontend_queue = false; |
107 | 106 | ||
108 | q_num = rsi_determine_min_weight_queue(common); | 107 | q_num = rsi_determine_min_weight_queue(common); |
108 | |||
109 | q_len = skb_queue_len(&common->tx_queue[ii]); | 109 | q_len = skb_queue_len(&common->tx_queue[ii]); |
110 | ii = q_num; | 110 | ii = q_num; |
111 | 111 | ||
@@ -118,7 +118,9 @@ get_queue_num: | |||
118 | } | 118 | } |
119 | } | 119 | } |
120 | 120 | ||
121 | common->tx_qinfo[q_num].pkt_contended = 0; | 121 | if (q_num < NUM_EDCA_QUEUES) |
122 | common->tx_qinfo[q_num].pkt_contended = 0; | ||
123 | |||
122 | /* Adjust the back off values for all queues again */ | 124 | /* Adjust the back off values for all queues again */ |
123 | recontend_queue = rsi_recalculate_weights(common); | 125 | recontend_queue = rsi_recalculate_weights(common); |
124 | 126 | ||
diff --git a/drivers/net/wireless/rsi/rsi_91x_debugfs.c b/drivers/net/wireless/rsi/rsi_91x_debugfs.c index 7e4ef4554411..c466246a323f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_debugfs.c +++ b/drivers/net/wireless/rsi/rsi_91x_debugfs.c | |||
@@ -289,32 +289,29 @@ int rsi_init_dbgfs(struct rsi_hw *adapter) | |||
289 | const struct rsi_dbg_files *files; | 289 | const struct rsi_dbg_files *files; |
290 | 290 | ||
291 | dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL); | 291 | dev_dbgfs = kzalloc(sizeof(*dev_dbgfs), GFP_KERNEL); |
292 | if (!dev_dbgfs) | ||
293 | return -ENOMEM; | ||
294 | |||
292 | adapter->dfsentry = dev_dbgfs; | 295 | adapter->dfsentry = dev_dbgfs; |
293 | 296 | ||
294 | snprintf(devdir, sizeof(devdir), "%s", | 297 | snprintf(devdir, sizeof(devdir), "%s", |
295 | wiphy_name(adapter->hw->wiphy)); | 298 | wiphy_name(adapter->hw->wiphy)); |
296 | dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL); | ||
297 | 299 | ||
298 | if (IS_ERR(dev_dbgfs->subdir)) { | 300 | dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL); |
299 | if (dev_dbgfs->subdir == ERR_PTR(-ENODEV)) | ||
300 | rsi_dbg(ERR_ZONE, | ||
301 | "%s:Debugfs has not been mounted\n", __func__); | ||
302 | else | ||
303 | rsi_dbg(ERR_ZONE, "debugfs:%s not created\n", devdir); | ||
304 | 301 | ||
305 | adapter->dfsentry = NULL; | 302 | if (!dev_dbgfs->subdir) { |
306 | kfree(dev_dbgfs); | 303 | kfree(dev_dbgfs); |
307 | return (int)PTR_ERR(dev_dbgfs->subdir); | 304 | return -ENOMEM; |
308 | } else { | 305 | } |
309 | for (ii = 0; ii < adapter->num_debugfs_entries; ii++) { | 306 | |
310 | files = &dev_debugfs_files[ii]; | 307 | for (ii = 0; ii < adapter->num_debugfs_entries; ii++) { |
311 | dev_dbgfs->rsi_files[ii] = | 308 | files = &dev_debugfs_files[ii]; |
312 | debugfs_create_file(files->name, | 309 | dev_dbgfs->rsi_files[ii] = |
313 | files->perms, | 310 | debugfs_create_file(files->name, |
314 | dev_dbgfs->subdir, | 311 | files->perms, |
315 | common, | 312 | dev_dbgfs->subdir, |
316 | &files->fops); | 313 | common, |
317 | } | 314 | &files->fops); |
318 | } | 315 | } |
319 | return 0; | 316 | return 0; |
320 | } | 317 | } |
diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c index 2361a6849ad7..73694295648f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c +++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c | |||
@@ -738,7 +738,7 @@ int rsi_hal_load_key(struct rsi_common *common, | |||
738 | * | 738 | * |
739 | * Return: 0 on success, corresponding error code on failure. | 739 | * Return: 0 on success, corresponding error code on failure. |
740 | */ | 740 | */ |
741 | static u8 rsi_load_bootup_params(struct rsi_common *common) | 741 | static int rsi_load_bootup_params(struct rsi_common *common) |
742 | { | 742 | { |
743 | struct sk_buff *skb; | 743 | struct sk_buff *skb; |
744 | struct rsi_boot_params *boot_params; | 744 | struct rsi_boot_params *boot_params; |
@@ -1272,6 +1272,7 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg) | |||
1272 | { | 1272 | { |
1273 | s32 msg_len = (le16_to_cpu(*(__le16 *)&msg[0]) & 0x0fff); | 1273 | s32 msg_len = (le16_to_cpu(*(__le16 *)&msg[0]) & 0x0fff); |
1274 | u16 msg_type = (msg[2]); | 1274 | u16 msg_type = (msg[2]); |
1275 | int ret; | ||
1275 | 1276 | ||
1276 | rsi_dbg(FSM_ZONE, "%s: Msg Len: %d, Msg Type: %4x\n", | 1277 | rsi_dbg(FSM_ZONE, "%s: Msg Len: %d, Msg Type: %4x\n", |
1277 | __func__, msg_len, msg_type); | 1278 | __func__, msg_len, msg_type); |
@@ -1284,8 +1285,9 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg) | |||
1284 | if (common->fsm_state == FSM_CARD_NOT_READY) { | 1285 | if (common->fsm_state == FSM_CARD_NOT_READY) { |
1285 | rsi_set_default_parameters(common); | 1286 | rsi_set_default_parameters(common); |
1286 | 1287 | ||
1287 | if (rsi_load_bootup_params(common)) | 1288 | ret = rsi_load_bootup_params(common); |
1288 | return -ENOMEM; | 1289 | if (ret) |
1290 | return ret; | ||
1289 | else | 1291 | else |
1290 | common->fsm_state = FSM_BOOT_PARAMS_SENT; | 1292 | common->fsm_state = FSM_BOOT_PARAMS_SENT; |
1291 | } else { | 1293 | } else { |
diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c index 852453f386e2..2e39d38d6a9e 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c | |||
@@ -756,12 +756,13 @@ fail: | |||
756 | static void rsi_disconnect(struct sdio_func *pfunction) | 756 | static void rsi_disconnect(struct sdio_func *pfunction) |
757 | { | 757 | { |
758 | struct rsi_hw *adapter = sdio_get_drvdata(pfunction); | 758 | struct rsi_hw *adapter = sdio_get_drvdata(pfunction); |
759 | struct rsi_91x_sdiodev *dev = | 759 | struct rsi_91x_sdiodev *dev; |
760 | (struct rsi_91x_sdiodev *)adapter->rsi_dev; | ||
761 | 760 | ||
762 | if (!adapter) | 761 | if (!adapter) |
763 | return; | 762 | return; |
764 | 763 | ||
764 | dev = (struct rsi_91x_sdiodev *)adapter->rsi_dev; | ||
765 | |||
765 | dev->write_fail = 2; | 766 | dev->write_fail = 2; |
766 | rsi_mac80211_detach(adapter); | 767 | rsi_mac80211_detach(adapter); |
767 | 768 | ||
diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c index f1cb99cafed8..20d11ccfffe3 100644 --- a/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c +++ b/drivers/net/wireless/rsi/rsi_91x_sdio_ops.c | |||
@@ -247,7 +247,7 @@ static int rsi_process_pkt(struct rsi_common *common) | |||
247 | if (!common->rx_data_pkt) { | 247 | if (!common->rx_data_pkt) { |
248 | rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n", | 248 | rsi_dbg(ERR_ZONE, "%s: Failed in memory allocation\n", |
249 | __func__); | 249 | __func__); |
250 | return -1; | 250 | return -ENOMEM; |
251 | } | 251 | } |
252 | 252 | ||
253 | status = rsi_sdio_host_intf_read_pkt(adapter, | 253 | status = rsi_sdio_host_intf_read_pkt(adapter, |
@@ -260,12 +260,10 @@ static int rsi_process_pkt(struct rsi_common *common) | |||
260 | } | 260 | } |
261 | 261 | ||
262 | status = rsi_read_pkt(common, rcv_pkt_len); | 262 | status = rsi_read_pkt(common, rcv_pkt_len); |
263 | kfree(common->rx_data_pkt); | ||
264 | return status; | ||
265 | 263 | ||
266 | fail: | 264 | fail: |
267 | kfree(common->rx_data_pkt); | 265 | kfree(common->rx_data_pkt); |
268 | return -1; | 266 | return status; |
269 | } | 267 | } |
270 | 268 | ||
271 | /** | 269 | /** |
diff --git a/drivers/net/wireless/rsi/rsi_91x_usb.c b/drivers/net/wireless/rsi/rsi_91x_usb.c index bb1bf96670eb..4c46e5631e2f 100644 --- a/drivers/net/wireless/rsi/rsi_91x_usb.c +++ b/drivers/net/wireless/rsi/rsi_91x_usb.c | |||
@@ -154,24 +154,30 @@ static int rsi_usb_reg_read(struct usb_device *usbdev, | |||
154 | u16 *value, | 154 | u16 *value, |
155 | u16 len) | 155 | u16 len) |
156 | { | 156 | { |
157 | u8 temp_buf[4]; | 157 | u8 *buf; |
158 | int status = 0; | 158 | int status = -ENOMEM; |
159 | |||
160 | buf = kmalloc(0x04, GFP_KERNEL); | ||
161 | if (!buf) | ||
162 | return status; | ||
159 | 163 | ||
160 | status = usb_control_msg(usbdev, | 164 | status = usb_control_msg(usbdev, |
161 | usb_rcvctrlpipe(usbdev, 0), | 165 | usb_rcvctrlpipe(usbdev, 0), |
162 | USB_VENDOR_REGISTER_READ, | 166 | USB_VENDOR_REGISTER_READ, |
163 | USB_TYPE_VENDOR, | 167 | USB_TYPE_VENDOR, |
164 | ((reg & 0xffff0000) >> 16), (reg & 0xffff), | 168 | ((reg & 0xffff0000) >> 16), (reg & 0xffff), |
165 | (void *)temp_buf, | 169 | (void *)buf, |
166 | len, | 170 | len, |
167 | HZ * 5); | 171 | HZ * 5); |
168 | 172 | ||
169 | *value = (temp_buf[0] | (temp_buf[1] << 8)); | 173 | *value = (buf[0] | (buf[1] << 8)); |
170 | if (status < 0) { | 174 | if (status < 0) { |
171 | rsi_dbg(ERR_ZONE, | 175 | rsi_dbg(ERR_ZONE, |
172 | "%s: Reg read failed with error code :%d\n", | 176 | "%s: Reg read failed with error code :%d\n", |
173 | __func__, status); | 177 | __func__, status); |
174 | } | 178 | } |
179 | kfree(buf); | ||
180 | |||
175 | return status; | 181 | return status; |
176 | } | 182 | } |
177 | 183 | ||
@@ -190,8 +196,12 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, | |||
190 | u16 value, | 196 | u16 value, |
191 | u16 len) | 197 | u16 len) |
192 | { | 198 | { |
193 | u8 usb_reg_buf[4]; | 199 | u8 *usb_reg_buf; |
194 | int status = 0; | 200 | int status = -ENOMEM; |
201 | |||
202 | usb_reg_buf = kmalloc(0x04, GFP_KERNEL); | ||
203 | if (!usb_reg_buf) | ||
204 | return status; | ||
195 | 205 | ||
196 | usb_reg_buf[0] = (value & 0x00ff); | 206 | usb_reg_buf[0] = (value & 0x00ff); |
197 | usb_reg_buf[1] = (value & 0xff00) >> 8; | 207 | usb_reg_buf[1] = (value & 0xff00) >> 8; |
@@ -212,6 +222,8 @@ static int rsi_usb_reg_write(struct usb_device *usbdev, | |||
212 | "%s: Reg write failed with error code :%d\n", | 222 | "%s: Reg write failed with error code :%d\n", |
213 | __func__, status); | 223 | __func__, status); |
214 | } | 224 | } |
225 | kfree(usb_reg_buf); | ||
226 | |||
215 | return status; | 227 | return status; |
216 | } | 228 | } |
217 | 229 | ||
@@ -286,7 +298,7 @@ int rsi_usb_write_register_multiple(struct rsi_hw *adapter, | |||
286 | return -ENOMEM; | 298 | return -ENOMEM; |
287 | 299 | ||
288 | while (count) { | 300 | while (count) { |
289 | transfer = min_t(int, count, 4096); | 301 | transfer = (u8)(min_t(u32, count, 4096)); |
290 | memcpy(buf, data, transfer); | 302 | memcpy(buf, data, transfer); |
291 | status = usb_control_msg(dev->usbdev, | 303 | status = usb_control_msg(dev->usbdev, |
292 | usb_sndctrlpipe(dev->usbdev, 0), | 304 | usb_sndctrlpipe(dev->usbdev, 0), |
diff --git a/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c index b6722de64a31..33da3dfcfa4f 100644 --- a/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c +++ b/drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c | |||
@@ -625,17 +625,7 @@ bool exhalbtc_initlize_variables(struct rtl_priv *adapter) | |||
625 | else | 625 | else |
626 | btcoexist->binded = true; | 626 | btcoexist->binded = true; |
627 | 627 | ||
628 | #if (defined(CONFIG_PCI_HCI)) | ||
629 | btcoexist->chip_interface = BTC_INTF_PCI; | ||
630 | #elif (defined(CONFIG_USB_HCI)) | ||
631 | btcoexist->chip_interface = BTC_INTF_USB; | ||
632 | #elif (defined(CONFIG_SDIO_HCI)) | ||
633 | btcoexist->chip_interface = BTC_INTF_SDIO; | ||
634 | #elif (defined(CONFIG_GSPI_HCI)) | ||
635 | btcoexist->chip_interface = BTC_INTF_GSPI; | ||
636 | #else | ||
637 | btcoexist->chip_interface = BTC_INTF_UNKNOWN; | 628 | btcoexist->chip_interface = BTC_INTF_UNKNOWN; |
638 | #endif | ||
639 | 629 | ||
640 | if (NULL == btcoexist->adapter) | 630 | if (NULL == btcoexist->adapter) |
641 | btcoexist->adapter = adapter; | 631 | btcoexist->adapter = adapter; |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 057b05700f8b..158b5e639fc7 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1291,13 +1291,13 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev) | |||
1291 | for (i = 0; i < NET_TX_RING_SIZE; i++) { | 1291 | for (i = 0; i < NET_TX_RING_SIZE; i++) { |
1292 | skb_entry_set_link(&np->tx_skbs[i], i+1); | 1292 | skb_entry_set_link(&np->tx_skbs[i], i+1); |
1293 | np->grant_tx_ref[i] = GRANT_INVALID_REF; | 1293 | np->grant_tx_ref[i] = GRANT_INVALID_REF; |
1294 | np->grant_tx_page[i] = NULL; | ||
1294 | } | 1295 | } |
1295 | 1296 | ||
1296 | /* Clear out rx_skbs */ | 1297 | /* Clear out rx_skbs */ |
1297 | for (i = 0; i < NET_RX_RING_SIZE; i++) { | 1298 | for (i = 0; i < NET_RX_RING_SIZE; i++) { |
1298 | np->rx_skbs[i] = NULL; | 1299 | np->rx_skbs[i] = NULL; |
1299 | np->grant_rx_ref[i] = GRANT_INVALID_REF; | 1300 | np->grant_rx_ref[i] = GRANT_INVALID_REF; |
1300 | np->grant_tx_page[i] = NULL; | ||
1301 | } | 1301 | } |
1302 | 1302 | ||
1303 | /* A grant for every tx ring slot */ | 1303 | /* A grant for every tx ring slot */ |