diff options
author | David S. Miller <davem@davemloft.net> | 2009-11-29 03:57:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 03:57:15 -0500 |
commit | 9b963e5d0e01461099a40117b05480f24b63381f (patch) | |
tree | 4756d554e37bf4ab7202f2c564cbe629af98b576 | |
parent | 3b8626ba01a8a745a3fdf22dd347edd708b0af13 (diff) | |
parent | 5fdd4baef6195a1f2960e901c8877e2105f832ca (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/ieee802154/fakehard.c
drivers/net/e1000e/ich8lan.c
drivers/net/e1000e/phy.c
drivers/net/netxen/netxen_nic_init.c
drivers/net/wireless/ath/ath9k/main.c
31 files changed, 297 insertions, 260 deletions
diff --git a/drivers/ieee802154/fakehard.c b/drivers/ieee802154/fakehard.c index 617549f30ef9..5f67540e669c 100644 --- a/drivers/ieee802154/fakehard.c +++ b/drivers/ieee802154/fakehard.c | |||
@@ -284,13 +284,13 @@ static netdev_tx_t ieee802154_fake_xmit(struct sk_buff *skb, | |||
284 | { | 284 | { |
285 | skb->skb_iif = dev->ifindex; | 285 | skb->skb_iif = dev->ifindex; |
286 | skb->dev = dev; | 286 | skb->dev = dev; |
287 | |||
287 | dev->stats.tx_packets++; | 288 | dev->stats.tx_packets++; |
288 | dev->stats.tx_bytes += skb->len; | 289 | dev->stats.tx_bytes += skb->len; |
289 | 290 | ||
290 | dev->trans_start = jiffies; | ||
291 | |||
292 | /* FIXME: do hardware work here ... */ | 291 | /* FIXME: do hardware work here ... */ |
293 | 292 | ||
293 | dev_kfree_skb(skb); | ||
294 | return NETDEV_TX_OK; | 294 | return NETDEV_TX_OK; |
295 | } | 295 | } |
296 | 296 | ||
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 6399abbdad6b..0bbd5ae49862 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -975,7 +975,7 @@ config ENC28J60_WRITEVERIFY | |||
975 | 975 | ||
976 | config ETHOC | 976 | config ETHOC |
977 | tristate "OpenCores 10/100 Mbps Ethernet MAC support" | 977 | tristate "OpenCores 10/100 Mbps Ethernet MAC support" |
978 | depends on NET_ETHERNET && HAS_IOMEM | 978 | depends on NET_ETHERNET && HAS_IOMEM && HAS_DMA |
979 | select MII | 979 | select MII |
980 | select PHYLIB | 980 | select PHYLIB |
981 | select CRC32 | 981 | select CRC32 |
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index e67533cf78d8..6bac04603a88 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -1088,7 +1088,14 @@ static struct net_device * au1000_probe(int port_num) | |||
1088 | return NULL; | 1088 | return NULL; |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | if ((err = register_netdev(dev)) != 0) { | 1091 | dev->base_addr = base; |
1092 | dev->irq = irq; | ||
1093 | dev->netdev_ops = &au1000_netdev_ops; | ||
1094 | SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops); | ||
1095 | dev->watchdog_timeo = ETH_TX_TIMEOUT; | ||
1096 | |||
1097 | err = register_netdev(dev); | ||
1098 | if (err != 0) { | ||
1092 | printk(KERN_ERR "%s: Cannot register net device, error %d\n", | 1099 | printk(KERN_ERR "%s: Cannot register net device, error %d\n", |
1093 | DRV_NAME, err); | 1100 | DRV_NAME, err); |
1094 | free_netdev(dev); | 1101 | free_netdev(dev); |
@@ -1209,12 +1216,6 @@ static struct net_device * au1000_probe(int port_num) | |||
1209 | aup->tx_db_inuse[i] = pDB; | 1216 | aup->tx_db_inuse[i] = pDB; |
1210 | } | 1217 | } |
1211 | 1218 | ||
1212 | dev->base_addr = base; | ||
1213 | dev->irq = irq; | ||
1214 | dev->netdev_ops = &au1000_netdev_ops; | ||
1215 | SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops); | ||
1216 | dev->watchdog_timeo = ETH_TX_TIMEOUT; | ||
1217 | |||
1218 | /* | 1219 | /* |
1219 | * The boot code uses the ethernet controller, so reset it to start | 1220 | * The boot code uses the ethernet controller, so reset it to start |
1220 | * fresh. au1000_init() expects that the device is in reset state. | 1221 | * fresh. au1000_init() expects that the device is in reset state. |
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index c9fcef7f8462..3102d738cfd1 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -142,6 +142,8 @@ struct e1000_info; | |||
142 | #define HV_TNCRS_UPPER PHY_REG(778, 29) /* Transmit with no CRS */ | 142 | #define HV_TNCRS_UPPER PHY_REG(778, 29) /* Transmit with no CRS */ |
143 | #define HV_TNCRS_LOWER PHY_REG(778, 30) | 143 | #define HV_TNCRS_LOWER PHY_REG(778, 30) |
144 | 144 | ||
145 | #define E1000_FCRTV_PCH 0x05F40 /* PCH Flow Control Refresh Timer Value */ | ||
146 | |||
145 | /* BM PHY Copper Specific Status */ | 147 | /* BM PHY Copper Specific Status */ |
146 | #define BM_CS_STATUS 17 | 148 | #define BM_CS_STATUS 17 |
147 | #define BM_CS_STATUS_LINK_UP 0x0400 | 149 | #define BM_CS_STATUS_LINK_UP 0x0400 |
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 568bb259c6fd..7530fc5d81c3 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -1110,7 +1110,8 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) | |||
1110 | oem_reg |= HV_OEM_BITS_LPLU; | 1110 | oem_reg |= HV_OEM_BITS_LPLU; |
1111 | } | 1111 | } |
1112 | /* Restart auto-neg to activate the bits */ | 1112 | /* Restart auto-neg to activate the bits */ |
1113 | oem_reg |= HV_OEM_BITS_RESTART_AN; | 1113 | if (!e1000_check_reset_block(hw)) |
1114 | oem_reg |= HV_OEM_BITS_RESTART_AN; | ||
1114 | ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg); | 1115 | ret_val = hw->phy.ops.write_reg_locked(hw, HV_OEM_BITS, oem_reg); |
1115 | 1116 | ||
1116 | out: | 1117 | out: |
@@ -3545,6 +3546,7 @@ struct e1000_info e1000_pch_info = { | |||
3545 | | FLAG_HAS_AMT | 3546 | | FLAG_HAS_AMT |
3546 | | FLAG_HAS_FLASH | 3547 | | FLAG_HAS_FLASH |
3547 | | FLAG_HAS_JUMBO_FRAMES | 3548 | | FLAG_HAS_JUMBO_FRAMES |
3549 | | FLAG_DISABLE_FC_PAUSE_TIME /* errata */ | ||
3548 | | FLAG_APME_IN_WUC, | 3550 | | FLAG_APME_IN_WUC, |
3549 | .pba = 26, | 3551 | .pba = 26, |
3550 | .max_hw_frame_size = 4096, | 3552 | .max_hw_frame_size = 4096, |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 11a527484e18..e546b4ebf155 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -2760,25 +2760,38 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
2760 | /* | 2760 | /* |
2761 | * flow control settings | 2761 | * flow control settings |
2762 | * | 2762 | * |
2763 | * The high water mark must be low enough to fit two full frame | 2763 | * The high water mark must be low enough to fit one full frame |
2764 | * (or the size used for early receive) above it in the Rx FIFO. | 2764 | * (or the size used for early receive) above it in the Rx FIFO. |
2765 | * Set it to the lower of: | 2765 | * Set it to the lower of: |
2766 | * - 90% of the Rx FIFO size, and | 2766 | * - 90% of the Rx FIFO size, and |
2767 | * - the full Rx FIFO size minus the early receive size (for parts | 2767 | * - the full Rx FIFO size minus the early receive size (for parts |
2768 | * with ERT support assuming ERT set to E1000_ERT_2048), or | 2768 | * with ERT support assuming ERT set to E1000_ERT_2048), or |
2769 | * - the full Rx FIFO size minus two full frames | 2769 | * - the full Rx FIFO size minus one full frame |
2770 | */ | 2770 | */ |
2771 | if ((adapter->flags & FLAG_HAS_ERT) && | 2771 | if (hw->mac.type == e1000_pchlan) { |
2772 | (adapter->netdev->mtu > ETH_DATA_LEN)) | 2772 | /* |
2773 | hwm = min(((pba << 10) * 9 / 10), | 2773 | * Workaround PCH LOM adapter hangs with certain network |
2774 | ((pba << 10) - (E1000_ERT_2048 << 3))); | 2774 | * loads. If hangs persist, try disabling Tx flow control. |
2775 | else | 2775 | */ |
2776 | hwm = min(((pba << 10) * 9 / 10), | 2776 | if (adapter->netdev->mtu > ETH_DATA_LEN) { |
2777 | ((pba << 10) - (2 * adapter->max_frame_size))); | 2777 | fc->high_water = 0x3500; |
2778 | fc->low_water = 0x1500; | ||
2779 | } else { | ||
2780 | fc->high_water = 0x5000; | ||
2781 | fc->low_water = 0x3000; | ||
2782 | } | ||
2783 | } else { | ||
2784 | if ((adapter->flags & FLAG_HAS_ERT) && | ||
2785 | (adapter->netdev->mtu > ETH_DATA_LEN)) | ||
2786 | hwm = min(((pba << 10) * 9 / 10), | ||
2787 | ((pba << 10) - (E1000_ERT_2048 << 3))); | ||
2788 | else | ||
2789 | hwm = min(((pba << 10) * 9 / 10), | ||
2790 | ((pba << 10) - adapter->max_frame_size)); | ||
2778 | 2791 | ||
2779 | fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */ | 2792 | fc->high_water = hwm & E1000_FCRTH_RTH; /* 8-byte granularity */ |
2780 | fc->low_water = (fc->high_water - (2 * adapter->max_frame_size)); | 2793 | fc->low_water = fc->high_water - 8; |
2781 | fc->low_water &= E1000_FCRTL_RTL; /* 8-byte granularity */ | 2794 | } |
2782 | 2795 | ||
2783 | if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME) | 2796 | if (adapter->flags & FLAG_DISABLE_FC_PAUSE_TIME) |
2784 | fc->pause_time = 0xFFFF; | 2797 | fc->pause_time = 0xFFFF; |
@@ -2804,6 +2817,10 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
2804 | if (mac->ops.init_hw(hw)) | 2817 | if (mac->ops.init_hw(hw)) |
2805 | e_err("Hardware Error\n"); | 2818 | e_err("Hardware Error\n"); |
2806 | 2819 | ||
2820 | /* additional part of the flow-control workaround above */ | ||
2821 | if (hw->mac.type == e1000_pchlan) | ||
2822 | ew32(FCRTV_PCH, 0x1000); | ||
2823 | |||
2807 | e1000_update_mng_vlan(adapter); | 2824 | e1000_update_mng_vlan(adapter); |
2808 | 2825 | ||
2809 | /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ | 2826 | /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */ |
@@ -3612,7 +3629,7 @@ static void e1000_watchdog_task(struct work_struct *work) | |||
3612 | case SPEED_100: | 3629 | case SPEED_100: |
3613 | txb2b = 0; | 3630 | txb2b = 0; |
3614 | netdev->tx_queue_len = 100; | 3631 | netdev->tx_queue_len = 100; |
3615 | /* maybe add some timeout factor ? */ | 3632 | adapter->tx_timeout_factor = 10; |
3616 | break; | 3633 | break; |
3617 | } | 3634 | } |
3618 | 3635 | ||
@@ -4284,8 +4301,10 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
4284 | 4301 | ||
4285 | while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) | 4302 | while (test_and_set_bit(__E1000_RESETTING, &adapter->state)) |
4286 | msleep(1); | 4303 | msleep(1); |
4287 | /* e1000e_down has a dependency on max_frame_size */ | 4304 | /* e1000e_down -> e1000e_reset dependent on max_frame_size & mtu */ |
4288 | adapter->max_frame_size = max_frame; | 4305 | adapter->max_frame_size = max_frame; |
4306 | e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu); | ||
4307 | netdev->mtu = new_mtu; | ||
4289 | if (netif_running(netdev)) | 4308 | if (netif_running(netdev)) |
4290 | e1000e_down(adapter); | 4309 | e1000e_down(adapter); |
4291 | 4310 | ||
@@ -4315,9 +4334,6 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
4315 | adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN | 4334 | adapter->rx_buffer_len = ETH_FRAME_LEN + VLAN_HLEN |
4316 | + ETH_FCS_LEN; | 4335 | + ETH_FCS_LEN; |
4317 | 4336 | ||
4318 | e_info("changing MTU from %d to %d\n", netdev->mtu, new_mtu); | ||
4319 | netdev->mtu = new_mtu; | ||
4320 | |||
4321 | if (netif_running(netdev)) | 4337 | if (netif_running(netdev)) |
4322 | e1000e_up(adapter); | 4338 | e1000e_up(adapter); |
4323 | else | 4339 | else |
diff --git a/drivers/net/e1000e/phy.c b/drivers/net/e1000e/phy.c index 99d53fae4307..5cd01c691c53 100644 --- a/drivers/net/e1000e/phy.c +++ b/drivers/net/e1000e/phy.c | |||
@@ -71,7 +71,6 @@ static const u16 e1000_igp_2_cable_length_table[] = | |||
71 | #define I82577_CFG_ASSERT_CRS_ON_TX (1 << 15) | 71 | #define I82577_CFG_ASSERT_CRS_ON_TX (1 << 15) |
72 | #define I82577_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift 100/10 */ | 72 | #define I82577_CFG_ENABLE_DOWNSHIFT (3 << 10) /* auto downshift 100/10 */ |
73 | #define I82577_CTRL_REG 23 | 73 | #define I82577_CTRL_REG 23 |
74 | #define I82577_CTRL_DOWNSHIFT_MASK (7 << 10) | ||
75 | 74 | ||
76 | /* 82577 specific PHY registers */ | 75 | /* 82577 specific PHY registers */ |
77 | #define I82577_PHY_CTRL_2 18 | 76 | #define I82577_PHY_CTRL_2 18 |
@@ -660,15 +659,6 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw) | |||
660 | phy_data |= I82577_CFG_ENABLE_DOWNSHIFT; | 659 | phy_data |= I82577_CFG_ENABLE_DOWNSHIFT; |
661 | 660 | ||
662 | ret_val = phy->ops.write_reg(hw, I82577_CFG_REG, phy_data); | 661 | ret_val = phy->ops.write_reg(hw, I82577_CFG_REG, phy_data); |
663 | if (ret_val) | ||
664 | goto out; | ||
665 | |||
666 | /* Set number of link attempts before downshift */ | ||
667 | ret_val = phy->ops.read_reg(hw, I82577_CTRL_REG, &phy_data); | ||
668 | if (ret_val) | ||
669 | goto out; | ||
670 | phy_data &= ~I82577_CTRL_DOWNSHIFT_MASK; | ||
671 | ret_val = phy->ops.write_reg(hw, I82577_CTRL_REG, phy_data); | ||
672 | 662 | ||
673 | out: | 663 | out: |
674 | return ret_val; | 664 | return ret_val; |
@@ -2658,19 +2648,18 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2658 | page = 0; | 2648 | page = 0; |
2659 | 2649 | ||
2660 | if (reg > MAX_PHY_MULTI_PAGE_REG) { | 2650 | if (reg > MAX_PHY_MULTI_PAGE_REG) { |
2661 | if ((hw->phy.type != e1000_phy_82578) || | 2651 | u32 phy_addr = hw->phy.addr; |
2662 | ((reg != I82578_ADDR_REG) && | ||
2663 | (reg != I82578_ADDR_REG + 1))) { | ||
2664 | u32 phy_addr = hw->phy.addr; | ||
2665 | 2652 | ||
2666 | hw->phy.addr = 1; | 2653 | hw->phy.addr = 1; |
2667 | 2654 | ||
2668 | /* Page is shifted left, PHY expects (page x 32) */ | 2655 | /* Page is shifted left, PHY expects (page x 32) */ |
2669 | ret_val = e1000e_write_phy_reg_mdic(hw, | 2656 | ret_val = e1000e_write_phy_reg_mdic(hw, |
2670 | IGP01E1000_PHY_PAGE_SELECT, | 2657 | IGP01E1000_PHY_PAGE_SELECT, |
2671 | (page << IGP_PAGE_SHIFT)); | 2658 | (page << IGP_PAGE_SHIFT)); |
2672 | hw->phy.addr = phy_addr; | 2659 | hw->phy.addr = phy_addr; |
2673 | } | 2660 | |
2661 | if (ret_val) | ||
2662 | goto out; | ||
2674 | } | 2663 | } |
2675 | 2664 | ||
2676 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, | 2665 | ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, |
@@ -2678,7 +2667,7 @@ static s32 __e1000_read_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 *data, | |||
2678 | out: | 2667 | out: |
2679 | /* Revert to MDIO fast mode, if applicable */ | 2668 | /* Revert to MDIO fast mode, if applicable */ |
2680 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | 2669 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) |
2681 | ret_val = e1000_set_mdio_slow_mode_hv(hw, false); | 2670 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); |
2682 | 2671 | ||
2683 | if (!locked) | 2672 | if (!locked) |
2684 | hw->phy.ops.release(hw); | 2673 | hw->phy.ops.release(hw); |
@@ -2784,19 +2773,18 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
2784 | } | 2773 | } |
2785 | 2774 | ||
2786 | if (reg > MAX_PHY_MULTI_PAGE_REG) { | 2775 | if (reg > MAX_PHY_MULTI_PAGE_REG) { |
2787 | if ((hw->phy.type != e1000_phy_82578) || | 2776 | u32 phy_addr = hw->phy.addr; |
2788 | ((reg != I82578_ADDR_REG) && | ||
2789 | (reg != I82578_ADDR_REG + 1))) { | ||
2790 | u32 phy_addr = hw->phy.addr; | ||
2791 | 2777 | ||
2792 | hw->phy.addr = 1; | 2778 | hw->phy.addr = 1; |
2793 | 2779 | ||
2794 | /* Page is shifted left, PHY expects (page x 32) */ | 2780 | /* Page is shifted left, PHY expects (page x 32) */ |
2795 | ret_val = e1000e_write_phy_reg_mdic(hw, | 2781 | ret_val = e1000e_write_phy_reg_mdic(hw, |
2796 | IGP01E1000_PHY_PAGE_SELECT, | 2782 | IGP01E1000_PHY_PAGE_SELECT, |
2797 | (page << IGP_PAGE_SHIFT)); | 2783 | (page << IGP_PAGE_SHIFT)); |
2798 | hw->phy.addr = phy_addr; | 2784 | hw->phy.addr = phy_addr; |
2799 | } | 2785 | |
2786 | if (ret_val) | ||
2787 | goto out; | ||
2800 | } | 2788 | } |
2801 | 2789 | ||
2802 | ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, | 2790 | ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & reg, |
@@ -2805,7 +2793,7 @@ static s32 __e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data, | |||
2805 | out: | 2793 | out: |
2806 | /* Revert to MDIO fast mode, if applicable */ | 2794 | /* Revert to MDIO fast mode, if applicable */ |
2807 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) | 2795 | if ((hw->phy.type == e1000_phy_82577) && in_slow_mode) |
2808 | ret_val = e1000_set_mdio_slow_mode_hv(hw, false); | 2796 | ret_val |= e1000_set_mdio_slow_mode_hv(hw, false); |
2809 | 2797 | ||
2810 | if (!locked) | 2798 | if (!locked) |
2811 | hw->phy.ops.release(hw); | 2799 | hw->phy.ops.release(hw); |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 5182b2893431..5c56f2a741f3 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -242,11 +242,11 @@ static void ixgbe_unmap_and_free_tx_resource(struct ixgbe_adapter *adapter, | |||
242 | static inline bool ixgbe_tx_is_paused(struct ixgbe_adapter *adapter, | 242 | static inline bool ixgbe_tx_is_paused(struct ixgbe_adapter *adapter, |
243 | struct ixgbe_ring *tx_ring) | 243 | struct ixgbe_ring *tx_ring) |
244 | { | 244 | { |
245 | int tc; | ||
246 | u32 txoff = IXGBE_TFCS_TXOFF; | 245 | u32 txoff = IXGBE_TFCS_TXOFF; |
247 | 246 | ||
248 | #ifdef CONFIG_IXGBE_DCB | 247 | #ifdef CONFIG_IXGBE_DCB |
249 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { | 248 | if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { |
249 | int tc; | ||
250 | int reg_idx = tx_ring->reg_idx; | 250 | int reg_idx = tx_ring->reg_idx; |
251 | int dcb_i = adapter->ring_feature[RING_F_DCB].indices; | 251 | int dcb_i = adapter->ring_feature[RING_F_DCB].indices; |
252 | 252 | ||
diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c index 0be14d702beb..c146304d8d6c 100644 --- a/drivers/net/ks8851_mll.c +++ b/drivers/net/ks8851_mll.c | |||
@@ -568,6 +568,16 @@ static inline void ks_outblk(struct ks_net *ks, u16 *wptr, u32 len) | |||
568 | iowrite16(*wptr++, ks->hw_addr); | 568 | iowrite16(*wptr++, ks->hw_addr); |
569 | } | 569 | } |
570 | 570 | ||
571 | static void ks_disable_int(struct ks_net *ks) | ||
572 | { | ||
573 | ks_wrreg16(ks, KS_IER, 0x0000); | ||
574 | } /* ks_disable_int */ | ||
575 | |||
576 | static void ks_enable_int(struct ks_net *ks) | ||
577 | { | ||
578 | ks_wrreg16(ks, KS_IER, ks->rc_ier); | ||
579 | } /* ks_enable_int */ | ||
580 | |||
571 | /** | 581 | /** |
572 | * ks_tx_fifo_space - return the available hardware buffer size. | 582 | * ks_tx_fifo_space - return the available hardware buffer size. |
573 | * @ks: The chip information | 583 | * @ks: The chip information |
@@ -681,6 +691,47 @@ static void ks_soft_reset(struct ks_net *ks, unsigned op) | |||
681 | } | 691 | } |
682 | 692 | ||
683 | 693 | ||
694 | void ks_enable_qmu(struct ks_net *ks) | ||
695 | { | ||
696 | u16 w; | ||
697 | |||
698 | w = ks_rdreg16(ks, KS_TXCR); | ||
699 | /* Enables QMU Transmit (TXCR). */ | ||
700 | ks_wrreg16(ks, KS_TXCR, w | TXCR_TXE); | ||
701 | |||
702 | /* | ||
703 | * RX Frame Count Threshold Enable and Auto-Dequeue RXQ Frame | ||
704 | * Enable | ||
705 | */ | ||
706 | |||
707 | w = ks_rdreg16(ks, KS_RXQCR); | ||
708 | ks_wrreg16(ks, KS_RXQCR, w | RXQCR_RXFCTE); | ||
709 | |||
710 | /* Enables QMU Receive (RXCR1). */ | ||
711 | w = ks_rdreg16(ks, KS_RXCR1); | ||
712 | ks_wrreg16(ks, KS_RXCR1, w | RXCR1_RXE); | ||
713 | ks->enabled = true; | ||
714 | } /* ks_enable_qmu */ | ||
715 | |||
716 | static void ks_disable_qmu(struct ks_net *ks) | ||
717 | { | ||
718 | u16 w; | ||
719 | |||
720 | w = ks_rdreg16(ks, KS_TXCR); | ||
721 | |||
722 | /* Disables QMU Transmit (TXCR). */ | ||
723 | w &= ~TXCR_TXE; | ||
724 | ks_wrreg16(ks, KS_TXCR, w); | ||
725 | |||
726 | /* Disables QMU Receive (RXCR1). */ | ||
727 | w = ks_rdreg16(ks, KS_RXCR1); | ||
728 | w &= ~RXCR1_RXE ; | ||
729 | ks_wrreg16(ks, KS_RXCR1, w); | ||
730 | |||
731 | ks->enabled = false; | ||
732 | |||
733 | } /* ks_disable_qmu */ | ||
734 | |||
684 | /** | 735 | /** |
685 | * ks_read_qmu - read 1 pkt data from the QMU. | 736 | * ks_read_qmu - read 1 pkt data from the QMU. |
686 | * @ks: The chip information | 737 | * @ks: The chip information |
@@ -752,7 +803,7 @@ static void ks_rcv(struct ks_net *ks, struct net_device *netdev) | |||
752 | (frame_hdr->len < RX_BUF_SIZE) && frame_hdr->len)) { | 803 | (frame_hdr->len < RX_BUF_SIZE) && frame_hdr->len)) { |
753 | skb_reserve(skb, 2); | 804 | skb_reserve(skb, 2); |
754 | /* read data block including CRC 4 bytes */ | 805 | /* read data block including CRC 4 bytes */ |
755 | ks_read_qmu(ks, (u16 *)skb->data, frame_hdr->len + 4); | 806 | ks_read_qmu(ks, (u16 *)skb->data, frame_hdr->len); |
756 | skb_put(skb, frame_hdr->len); | 807 | skb_put(skb, frame_hdr->len); |
757 | skb->dev = netdev; | 808 | skb->dev = netdev; |
758 | skb->protocol = eth_type_trans(skb, netdev); | 809 | skb->protocol = eth_type_trans(skb, netdev); |
@@ -861,7 +912,7 @@ static int ks_net_open(struct net_device *netdev) | |||
861 | ks_dbg(ks, "%s - entry\n", __func__); | 912 | ks_dbg(ks, "%s - entry\n", __func__); |
862 | 913 | ||
863 | /* reset the HW */ | 914 | /* reset the HW */ |
864 | err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, ks); | 915 | err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); |
865 | 916 | ||
866 | if (err) { | 917 | if (err) { |
867 | printk(KERN_ERR "Failed to request IRQ: %d: %d\n", | 918 | printk(KERN_ERR "Failed to request IRQ: %d: %d\n", |
@@ -869,6 +920,15 @@ static int ks_net_open(struct net_device *netdev) | |||
869 | return err; | 920 | return err; |
870 | } | 921 | } |
871 | 922 | ||
923 | /* wake up powermode to normal mode */ | ||
924 | ks_set_powermode(ks, PMECR_PM_NORMAL); | ||
925 | mdelay(1); /* wait for normal mode to take effect */ | ||
926 | |||
927 | ks_wrreg16(ks, KS_ISR, 0xffff); | ||
928 | ks_enable_int(ks); | ||
929 | ks_enable_qmu(ks); | ||
930 | netif_start_queue(ks->netdev); | ||
931 | |||
872 | if (netif_msg_ifup(ks)) | 932 | if (netif_msg_ifup(ks)) |
873 | ks_dbg(ks, "network device %s up\n", netdev->name); | 933 | ks_dbg(ks, "network device %s up\n", netdev->name); |
874 | 934 | ||
@@ -892,19 +952,14 @@ static int ks_net_stop(struct net_device *netdev) | |||
892 | 952 | ||
893 | netif_stop_queue(netdev); | 953 | netif_stop_queue(netdev); |
894 | 954 | ||
895 | kfree(ks->frame_head_info); | ||
896 | |||
897 | mutex_lock(&ks->lock); | 955 | mutex_lock(&ks->lock); |
898 | 956 | ||
899 | /* turn off the IRQs and ack any outstanding */ | 957 | /* turn off the IRQs and ack any outstanding */ |
900 | ks_wrreg16(ks, KS_IER, 0x0000); | 958 | ks_wrreg16(ks, KS_IER, 0x0000); |
901 | ks_wrreg16(ks, KS_ISR, 0xffff); | 959 | ks_wrreg16(ks, KS_ISR, 0xffff); |
902 | 960 | ||
903 | /* shutdown RX process */ | 961 | /* shutdown RX/TX QMU */ |
904 | ks_wrreg16(ks, KS_RXCR1, 0x0000); | 962 | ks_disable_qmu(ks); |
905 | |||
906 | /* shutdown TX process */ | ||
907 | ks_wrreg16(ks, KS_TXCR, 0x0000); | ||
908 | 963 | ||
909 | /* set powermode to soft power down to save power */ | 964 | /* set powermode to soft power down to save power */ |
910 | ks_set_powermode(ks, PMECR_PM_SOFTDOWN); | 965 | ks_set_powermode(ks, PMECR_PM_SOFTDOWN); |
@@ -929,17 +984,8 @@ static int ks_net_stop(struct net_device *netdev) | |||
929 | */ | 984 | */ |
930 | static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len) | 985 | static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len) |
931 | { | 986 | { |
932 | unsigned fid = ks->fid; | ||
933 | |||
934 | fid = ks->fid; | ||
935 | ks->fid = (ks->fid + 1) & TXFR_TXFID_MASK; | ||
936 | |||
937 | /* reduce the tx interrupt occurrances. */ | ||
938 | if (!fid) | ||
939 | fid |= TXFR_TXIC; /* irq on completion */ | ||
940 | |||
941 | /* start header at txb[0] to align txw entries */ | 987 | /* start header at txb[0] to align txw entries */ |
942 | ks->txh.txw[0] = cpu_to_le16(fid); | 988 | ks->txh.txw[0] = 0; |
943 | ks->txh.txw[1] = cpu_to_le16(len); | 989 | ks->txh.txw[1] = cpu_to_le16(len); |
944 | 990 | ||
945 | /* 1. set sudo-DMA mode */ | 991 | /* 1. set sudo-DMA mode */ |
@@ -957,16 +1003,6 @@ static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len) | |||
957 | ; | 1003 | ; |
958 | } | 1004 | } |
959 | 1005 | ||
960 | static void ks_disable_int(struct ks_net *ks) | ||
961 | { | ||
962 | ks_wrreg16(ks, KS_IER, 0x0000); | ||
963 | } /* ks_disable_int */ | ||
964 | |||
965 | static void ks_enable_int(struct ks_net *ks) | ||
966 | { | ||
967 | ks_wrreg16(ks, KS_IER, ks->rc_ier); | ||
968 | } /* ks_enable_int */ | ||
969 | |||
970 | /** | 1006 | /** |
971 | * ks_start_xmit - transmit packet | 1007 | * ks_start_xmit - transmit packet |
972 | * @skb : The buffer to transmit | 1008 | * @skb : The buffer to transmit |
@@ -1410,25 +1446,6 @@ static int ks_read_selftest(struct ks_net *ks) | |||
1410 | return ret; | 1446 | return ret; |
1411 | } | 1447 | } |
1412 | 1448 | ||
1413 | static void ks_disable(struct ks_net *ks) | ||
1414 | { | ||
1415 | u16 w; | ||
1416 | |||
1417 | w = ks_rdreg16(ks, KS_TXCR); | ||
1418 | |||
1419 | /* Disables QMU Transmit (TXCR). */ | ||
1420 | w &= ~TXCR_TXE; | ||
1421 | ks_wrreg16(ks, KS_TXCR, w); | ||
1422 | |||
1423 | /* Disables QMU Receive (RXCR1). */ | ||
1424 | w = ks_rdreg16(ks, KS_RXCR1); | ||
1425 | w &= ~RXCR1_RXE ; | ||
1426 | ks_wrreg16(ks, KS_RXCR1, w); | ||
1427 | |||
1428 | ks->enabled = false; | ||
1429 | |||
1430 | } /* ks_disable */ | ||
1431 | |||
1432 | static void ks_setup(struct ks_net *ks) | 1449 | static void ks_setup(struct ks_net *ks) |
1433 | { | 1450 | { |
1434 | u16 w; | 1451 | u16 w; |
@@ -1463,7 +1480,7 @@ static void ks_setup(struct ks_net *ks) | |||
1463 | w = TXCR_TXFCE | TXCR_TXPE | TXCR_TXCRC | TXCR_TCGIP; | 1480 | w = TXCR_TXFCE | TXCR_TXPE | TXCR_TXCRC | TXCR_TCGIP; |
1464 | ks_wrreg16(ks, KS_TXCR, w); | 1481 | ks_wrreg16(ks, KS_TXCR, w); |
1465 | 1482 | ||
1466 | w = RXCR1_RXFCE | RXCR1_RXBE | RXCR1_RXUE; | 1483 | w = RXCR1_RXFCE | RXCR1_RXBE | RXCR1_RXUE | RXCR1_RXME | RXCR1_RXIPFCC; |
1467 | 1484 | ||
1468 | if (ks->promiscuous) /* bPromiscuous */ | 1485 | if (ks->promiscuous) /* bPromiscuous */ |
1469 | w |= (RXCR1_RXAE | RXCR1_RXINVF); | 1486 | w |= (RXCR1_RXAE | RXCR1_RXINVF); |
@@ -1486,28 +1503,6 @@ static void ks_setup_int(struct ks_net *ks) | |||
1486 | ks->rc_ier = (IRQ_LCI | IRQ_TXI | IRQ_RXI); | 1503 | ks->rc_ier = (IRQ_LCI | IRQ_TXI | IRQ_RXI); |
1487 | } /* ks_setup_int */ | 1504 | } /* ks_setup_int */ |
1488 | 1505 | ||
1489 | void ks_enable(struct ks_net *ks) | ||
1490 | { | ||
1491 | u16 w; | ||
1492 | |||
1493 | w = ks_rdreg16(ks, KS_TXCR); | ||
1494 | /* Enables QMU Transmit (TXCR). */ | ||
1495 | ks_wrreg16(ks, KS_TXCR, w | TXCR_TXE); | ||
1496 | |||
1497 | /* | ||
1498 | * RX Frame Count Threshold Enable and Auto-Dequeue RXQ Frame | ||
1499 | * Enable | ||
1500 | */ | ||
1501 | |||
1502 | w = ks_rdreg16(ks, KS_RXQCR); | ||
1503 | ks_wrreg16(ks, KS_RXQCR, w | RXQCR_RXFCTE); | ||
1504 | |||
1505 | /* Enables QMU Receive (RXCR1). */ | ||
1506 | w = ks_rdreg16(ks, KS_RXCR1); | ||
1507 | ks_wrreg16(ks, KS_RXCR1, w | RXCR1_RXE); | ||
1508 | ks->enabled = true; | ||
1509 | } /* ks_enable */ | ||
1510 | |||
1511 | static int ks_hw_init(struct ks_net *ks) | 1506 | static int ks_hw_init(struct ks_net *ks) |
1512 | { | 1507 | { |
1513 | #define MHEADER_SIZE (sizeof(struct type_frame_head) * MAX_RECV_FRAMES) | 1508 | #define MHEADER_SIZE (sizeof(struct type_frame_head) * MAX_RECV_FRAMES) |
@@ -1612,11 +1607,9 @@ static int __devinit ks8851_probe(struct platform_device *pdev) | |||
1612 | 1607 | ||
1613 | ks_soft_reset(ks, GRR_GSR); | 1608 | ks_soft_reset(ks, GRR_GSR); |
1614 | ks_hw_init(ks); | 1609 | ks_hw_init(ks); |
1615 | ks_disable(ks); | 1610 | ks_disable_qmu(ks); |
1616 | ks_setup(ks); | 1611 | ks_setup(ks); |
1617 | ks_setup_int(ks); | 1612 | ks_setup_int(ks); |
1618 | ks_enable_int(ks); | ||
1619 | ks_enable(ks); | ||
1620 | memcpy(netdev->dev_addr, ks->mac_addr, 6); | 1613 | memcpy(netdev->dev_addr, ks->mac_addr, 6); |
1621 | 1614 | ||
1622 | data = ks_rdreg16(ks, KS_OBCR); | 1615 | data = ks_rdreg16(ks, KS_OBCR); |
@@ -1658,6 +1651,7 @@ static int __devexit ks8851_remove(struct platform_device *pdev) | |||
1658 | struct ks_net *ks = netdev_priv(netdev); | 1651 | struct ks_net *ks = netdev_priv(netdev); |
1659 | struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1652 | struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1660 | 1653 | ||
1654 | kfree(ks->frame_head_info); | ||
1661 | unregister_netdev(netdev); | 1655 | unregister_netdev(netdev); |
1662 | iounmap(ks->hw_addr); | 1656 | iounmap(ks->hw_addr); |
1663 | free_netdev(netdev); | 1657 | free_netdev(netdev); |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 322112c7358a..93c3e6edf702 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -446,6 +446,7 @@ static int macvlan_init(struct net_device *dev) | |||
446 | dev->state = (dev->state & ~MACVLAN_STATE_MASK) | | 446 | dev->state = (dev->state & ~MACVLAN_STATE_MASK) | |
447 | (lowerdev->state & MACVLAN_STATE_MASK); | 447 | (lowerdev->state & MACVLAN_STATE_MASK); |
448 | dev->features = lowerdev->features & MACVLAN_FEATURES; | 448 | dev->features = lowerdev->features & MACVLAN_FEATURES; |
449 | dev->gso_max_size = lowerdev->gso_max_size; | ||
449 | dev->iflink = lowerdev->ifindex; | 450 | dev->iflink = lowerdev->ifindex; |
450 | dev->hard_header_len = lowerdev->hard_header_len; | 451 | dev->hard_header_len = lowerdev->hard_header_len; |
451 | 452 | ||
@@ -772,6 +773,7 @@ static int macvlan_device_event(struct notifier_block *unused, | |||
772 | case NETDEV_FEAT_CHANGE: | 773 | case NETDEV_FEAT_CHANGE: |
773 | list_for_each_entry(vlan, &port->vlans, list) { | 774 | list_for_each_entry(vlan, &port->vlans, list) { |
774 | vlan->dev->features = dev->features & MACVLAN_FEATURES; | 775 | vlan->dev->features = dev->features & MACVLAN_FEATURES; |
776 | vlan->dev->gso_max_size = dev->gso_max_size; | ||
775 | netdev_features_change(vlan->dev); | 777 | netdev_features_change(vlan->dev); |
776 | } | 778 | } |
777 | break; | 779 | break; |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 645450d93f4e..76cd1f3e9fc8 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -1202,6 +1202,8 @@ struct netxen_adapter { | |||
1202 | u32 int_vec_bit; | 1202 | u32 int_vec_bit; |
1203 | u32 heartbit; | 1203 | u32 heartbit; |
1204 | 1204 | ||
1205 | u8 mac_addr[ETH_ALEN]; | ||
1206 | |||
1205 | struct netxen_adapter_stats stats; | 1207 | struct netxen_adapter_stats stats; |
1206 | 1208 | ||
1207 | struct netxen_recv_context recv_ctx; | 1209 | struct netxen_recv_context recv_ctx; |
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h index a39155d61bad..d138fc22927a 100644 --- a/drivers/net/netxen/netxen_nic_hdr.h +++ b/drivers/net/netxen/netxen_nic_hdr.h | |||
@@ -545,6 +545,8 @@ enum { | |||
545 | #define NETXEN_NIU_TEST_MUX_CTL (NETXEN_CRB_NIU + 0x00094) | 545 | #define NETXEN_NIU_TEST_MUX_CTL (NETXEN_CRB_NIU + 0x00094) |
546 | #define NETXEN_NIU_XG_PAUSE_CTL (NETXEN_CRB_NIU + 0x00098) | 546 | #define NETXEN_NIU_XG_PAUSE_CTL (NETXEN_CRB_NIU + 0x00098) |
547 | #define NETXEN_NIU_XG_PAUSE_LEVEL (NETXEN_CRB_NIU + 0x000dc) | 547 | #define NETXEN_NIU_XG_PAUSE_LEVEL (NETXEN_CRB_NIU + 0x000dc) |
548 | #define NETXEN_NIU_FRAME_COUNT_SELECT (NETXEN_CRB_NIU + 0x000ac) | ||
549 | #define NETXEN_NIU_FRAME_COUNT (NETXEN_CRB_NIU + 0x000b0) | ||
548 | #define NETXEN_NIU_XG_SEL (NETXEN_CRB_NIU + 0x00128) | 550 | #define NETXEN_NIU_XG_SEL (NETXEN_CRB_NIU + 0x00128) |
549 | #define NETXEN_NIU_GB_PAUSE_CTL (NETXEN_CRB_NIU + 0x0030c) | 551 | #define NETXEN_NIU_GB_PAUSE_CTL (NETXEN_CRB_NIU + 0x0030c) |
550 | 552 | ||
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index b3054c6cc608..e71ca30433ef 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -389,24 +389,51 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter) | |||
389 | 389 | ||
390 | int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) | 390 | int netxen_p2_nic_set_promisc(struct netxen_adapter *adapter, u32 mode) |
391 | { | 391 | { |
392 | __u32 reg; | 392 | u32 mac_cfg; |
393 | u32 cnt = 0; | ||
394 | __u32 reg = 0x0200; | ||
393 | u32 port = adapter->physical_port; | 395 | u32 port = adapter->physical_port; |
396 | u16 board_type = adapter->ahw.board_type; | ||
394 | 397 | ||
395 | if (port > NETXEN_NIU_MAX_XG_PORTS) | 398 | if (port > NETXEN_NIU_MAX_XG_PORTS) |
396 | return -EINVAL; | 399 | return -EINVAL; |
397 | 400 | ||
398 | reg = NXRD32(adapter, NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port)); | 401 | mac_cfg = NXRD32(adapter, NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port)); |
399 | if (mode == NETXEN_NIU_PROMISC_MODE) | 402 | mac_cfg &= ~0x4; |
400 | reg = (reg | 0x2000UL); | 403 | NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), mac_cfg); |
401 | else | ||
402 | reg = (reg & ~0x2000UL); | ||
403 | 404 | ||
404 | if (mode == NETXEN_NIU_ALLMULTI_MODE) | 405 | if ((board_type == NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) || |
405 | reg = (reg | 0x1000UL); | 406 | (board_type == NETXEN_BRDTYPE_P2_SB31_10G_HMEZ)) |
406 | else | 407 | reg = (0x20 << port); |
407 | reg = (reg & ~0x1000UL); | 408 | |
409 | NXWR32(adapter, NETXEN_NIU_FRAME_COUNT_SELECT, reg); | ||
410 | |||
411 | mdelay(10); | ||
412 | |||
413 | while (NXRD32(adapter, NETXEN_NIU_FRAME_COUNT) && ++cnt < 20) | ||
414 | mdelay(10); | ||
415 | |||
416 | if (cnt < 20) { | ||
417 | |||
418 | reg = NXRD32(adapter, | ||
419 | NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port)); | ||
420 | |||
421 | if (mode == NETXEN_NIU_PROMISC_MODE) | ||
422 | reg = (reg | 0x2000UL); | ||
423 | else | ||
424 | reg = (reg & ~0x2000UL); | ||
425 | |||
426 | if (mode == NETXEN_NIU_ALLMULTI_MODE) | ||
427 | reg = (reg | 0x1000UL); | ||
428 | else | ||
429 | reg = (reg & ~0x1000UL); | ||
430 | |||
431 | NXWR32(adapter, | ||
432 | NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), reg); | ||
433 | } | ||
408 | 434 | ||
409 | NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_1 + (0x10000 * port), reg); | 435 | mac_cfg |= 0x4; |
436 | NXWR32(adapter, NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), mac_cfg); | ||
410 | 437 | ||
411 | return 0; | 438 | return 0; |
412 | } | 439 | } |
@@ -442,7 +469,7 @@ netxen_nic_enable_mcast_filter(struct netxen_adapter *adapter) | |||
442 | { | 469 | { |
443 | u32 val = 0; | 470 | u32 val = 0; |
444 | u16 port = adapter->physical_port; | 471 | u16 port = adapter->physical_port; |
445 | u8 *addr = adapter->netdev->dev_addr; | 472 | u8 *addr = adapter->mac_addr; |
446 | 473 | ||
447 | if (adapter->mc_enabled) | 474 | if (adapter->mc_enabled) |
448 | return 0; | 475 | return 0; |
@@ -471,7 +498,7 @@ netxen_nic_disable_mcast_filter(struct netxen_adapter *adapter) | |||
471 | { | 498 | { |
472 | u32 val = 0; | 499 | u32 val = 0; |
473 | u16 port = adapter->physical_port; | 500 | u16 port = adapter->physical_port; |
474 | u8 *addr = adapter->netdev->dev_addr; | 501 | u8 *addr = adapter->mac_addr; |
475 | 502 | ||
476 | if (!adapter->mc_enabled) | 503 | if (!adapter->mc_enabled) |
477 | return 0; | 504 | return 0; |
@@ -666,7 +693,7 @@ void netxen_p3_nic_set_multi(struct net_device *netdev) | |||
666 | 693 | ||
667 | list_splice_tail_init(&adapter->mac_list, &del_list); | 694 | list_splice_tail_init(&adapter->mac_list, &del_list); |
668 | 695 | ||
669 | nx_p3_nic_add_mac(adapter, netdev->dev_addr, &del_list); | 696 | nx_p3_nic_add_mac(adapter, adapter->mac_addr, &del_list); |
670 | nx_p3_nic_add_mac(adapter, bcast_addr, &del_list); | 697 | nx_p3_nic_add_mac(adapter, bcast_addr, &del_list); |
671 | 698 | ||
672 | if (netdev->flags & IFF_PROMISC) { | 699 | if (netdev->flags & IFF_PROMISC) { |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index bfbf75c17cf8..838420dbc633 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -445,6 +445,7 @@ netxen_read_mac_addr(struct netxen_adapter *adapter) | |||
445 | netdev->dev_addr[i] = *(p + 5 - i); | 445 | netdev->dev_addr[i] = *(p + 5 - i); |
446 | 446 | ||
447 | memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); | 447 | memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len); |
448 | memcpy(adapter->mac_addr, netdev->dev_addr, netdev->addr_len); | ||
448 | 449 | ||
449 | /* set station address */ | 450 | /* set station address */ |
450 | 451 | ||
@@ -467,6 +468,7 @@ int netxen_nic_set_mac(struct net_device *netdev, void *p) | |||
467 | netxen_napi_disable(adapter); | 468 | netxen_napi_disable(adapter); |
468 | } | 469 | } |
469 | 470 | ||
471 | memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len); | ||
470 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | 472 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); |
471 | adapter->macaddr_set(adapter, addr->sa_data); | 473 | adapter->macaddr_set(adapter, addr->sa_data); |
472 | 474 | ||
@@ -960,7 +962,7 @@ netxen_nic_up(struct netxen_adapter *adapter, struct net_device *netdev) | |||
960 | return err; | 962 | return err; |
961 | } | 963 | } |
962 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) | 964 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) |
963 | adapter->macaddr_set(adapter, netdev->dev_addr); | 965 | adapter->macaddr_set(adapter, adapter->mac_addr); |
964 | 966 | ||
965 | adapter->set_multi(netdev); | 967 | adapter->set_multi(netdev); |
966 | adapter->set_mtu(adapter, netdev->mtu); | 968 | adapter->set_mtu(adapter, netdev->mtu); |
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index e961e7593c1f..40813f0b5339 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
@@ -416,13 +416,8 @@ static void init_dma_desc_rings(struct net_device *dev) | |||
416 | unsigned int txsize = priv->dma_tx_size; | 416 | unsigned int txsize = priv->dma_tx_size; |
417 | unsigned int rxsize = priv->dma_rx_size; | 417 | unsigned int rxsize = priv->dma_rx_size; |
418 | unsigned int bfsize = priv->dma_buf_sz; | 418 | unsigned int bfsize = priv->dma_buf_sz; |
419 | int buff2_needed = 0; | 419 | int buff2_needed = 0, dis_ic = 0; |
420 | int dis_ic = 0; | ||
421 | 420 | ||
422 | #ifdef CONFIG_STMMAC_TIMER | ||
423 | /* Using Timers disable interrupts on completion for the reception */ | ||
424 | dis_ic = 1; | ||
425 | #endif | ||
426 | /* Set the Buffer size according to the MTU; | 421 | /* Set the Buffer size according to the MTU; |
427 | * indeed, in case of jumbo we need to bump-up the buffer sizes. | 422 | * indeed, in case of jumbo we need to bump-up the buffer sizes. |
428 | */ | 423 | */ |
@@ -437,6 +432,11 @@ static void init_dma_desc_rings(struct net_device *dev) | |||
437 | else | 432 | else |
438 | bfsize = DMA_BUFFER_SIZE; | 433 | bfsize = DMA_BUFFER_SIZE; |
439 | 434 | ||
435 | #ifdef CONFIG_STMMAC_TIMER | ||
436 | /* Disable interrupts on completion for the reception if timer is on */ | ||
437 | if (likely(priv->tm->enable)) | ||
438 | dis_ic = 1; | ||
439 | #endif | ||
440 | /* If the MTU exceeds 8k so use the second buffer in the chain */ | 440 | /* If the MTU exceeds 8k so use the second buffer in the chain */ |
441 | if (bfsize >= BUF_SIZE_8KiB) | 441 | if (bfsize >= BUF_SIZE_8KiB) |
442 | buff2_needed = 1; | 442 | buff2_needed = 1; |
@@ -809,20 +809,22 @@ static void stmmac_tx(struct stmmac_priv *priv) | |||
809 | 809 | ||
810 | static inline void stmmac_enable_irq(struct stmmac_priv *priv) | 810 | static inline void stmmac_enable_irq(struct stmmac_priv *priv) |
811 | { | 811 | { |
812 | #ifndef CONFIG_STMMAC_TIMER | 812 | #ifdef CONFIG_STMMAC_TIMER |
813 | writel(DMA_INTR_DEFAULT_MASK, priv->dev->base_addr + DMA_INTR_ENA); | 813 | if (likely(priv->tm->enable)) |
814 | #else | 814 | priv->tm->timer_start(tmrate); |
815 | priv->tm->timer_start(tmrate); | 815 | else |
816 | #endif | 816 | #endif |
817 | writel(DMA_INTR_DEFAULT_MASK, priv->dev->base_addr + DMA_INTR_ENA); | ||
817 | } | 818 | } |
818 | 819 | ||
819 | static inline void stmmac_disable_irq(struct stmmac_priv *priv) | 820 | static inline void stmmac_disable_irq(struct stmmac_priv *priv) |
820 | { | 821 | { |
821 | #ifndef CONFIG_STMMAC_TIMER | 822 | #ifdef CONFIG_STMMAC_TIMER |
822 | writel(0, priv->dev->base_addr + DMA_INTR_ENA); | 823 | if (likely(priv->tm->enable)) |
823 | #else | 824 | priv->tm->timer_stop(); |
824 | priv->tm->timer_stop(); | 825 | else |
825 | #endif | 826 | #endif |
827 | writel(0, priv->dev->base_addr + DMA_INTR_ENA); | ||
826 | } | 828 | } |
827 | 829 | ||
828 | static int stmmac_has_work(struct stmmac_priv *priv) | 830 | static int stmmac_has_work(struct stmmac_priv *priv) |
@@ -1031,22 +1033,23 @@ static int stmmac_open(struct net_device *dev) | |||
1031 | } | 1033 | } |
1032 | 1034 | ||
1033 | #ifdef CONFIG_STMMAC_TIMER | 1035 | #ifdef CONFIG_STMMAC_TIMER |
1034 | priv->tm = kmalloc(sizeof(struct stmmac_timer *), GFP_KERNEL); | 1036 | priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL); |
1035 | if (unlikely(priv->tm == NULL)) { | 1037 | if (unlikely(priv->tm == NULL)) { |
1036 | pr_err("%s: ERROR: timer memory alloc failed \n", __func__); | 1038 | pr_err("%s: ERROR: timer memory alloc failed \n", __func__); |
1037 | return -ENOMEM; | 1039 | return -ENOMEM; |
1038 | } | 1040 | } |
1039 | priv->tm->freq = tmrate; | 1041 | priv->tm->freq = tmrate; |
1040 | 1042 | ||
1041 | /* Test if the HW timer can be actually used. | 1043 | /* Test if the external timer can be actually used. |
1042 | * In case of failure continue with no timer. */ | 1044 | * In case of failure continue without timer. */ |
1043 | if (unlikely((stmmac_open_ext_timer(dev, priv->tm)) < 0)) { | 1045 | if (unlikely((stmmac_open_ext_timer(dev, priv->tm)) < 0)) { |
1044 | pr_warning("stmmaceth: cannot attach the HW timer\n"); | 1046 | pr_warning("stmmaceth: cannot attach the external timer.\n"); |
1045 | tmrate = 0; | 1047 | tmrate = 0; |
1046 | priv->tm->freq = 0; | 1048 | priv->tm->freq = 0; |
1047 | priv->tm->timer_start = stmmac_no_timer_started; | 1049 | priv->tm->timer_start = stmmac_no_timer_started; |
1048 | priv->tm->timer_stop = stmmac_no_timer_stopped; | 1050 | priv->tm->timer_stop = stmmac_no_timer_stopped; |
1049 | } | 1051 | } else |
1052 | priv->tm->enable = 1; | ||
1050 | #endif | 1053 | #endif |
1051 | 1054 | ||
1052 | /* Create and initialize the TX/RX descriptors chains. */ | 1055 | /* Create and initialize the TX/RX descriptors chains. */ |
@@ -1322,9 +1325,11 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1322 | 1325 | ||
1323 | /* Interrupt on completition only for the latest segment */ | 1326 | /* Interrupt on completition only for the latest segment */ |
1324 | priv->mac_type->ops->close_tx_desc(desc); | 1327 | priv->mac_type->ops->close_tx_desc(desc); |
1328 | |||
1325 | #ifdef CONFIG_STMMAC_TIMER | 1329 | #ifdef CONFIG_STMMAC_TIMER |
1326 | /* Clean IC while using timers */ | 1330 | /* Clean IC while using timer */ |
1327 | priv->mac_type->ops->clear_tx_ic(desc); | 1331 | if (likely(priv->tm->enable)) |
1332 | priv->mac_type->ops->clear_tx_ic(desc); | ||
1328 | #endif | 1333 | #endif |
1329 | /* To avoid raise condition */ | 1334 | /* To avoid raise condition */ |
1330 | priv->mac_type->ops->set_tx_owner(first); | 1335 | priv->mac_type->ops->set_tx_owner(first); |
@@ -2028,7 +2033,8 @@ static int stmmac_suspend(struct platform_device *pdev, pm_message_t state) | |||
2028 | 2033 | ||
2029 | #ifdef CONFIG_STMMAC_TIMER | 2034 | #ifdef CONFIG_STMMAC_TIMER |
2030 | priv->tm->timer_stop(); | 2035 | priv->tm->timer_stop(); |
2031 | dis_ic = 1; | 2036 | if (likely(priv->tm->enable)) |
2037 | dis_ic = 1; | ||
2032 | #endif | 2038 | #endif |
2033 | napi_disable(&priv->napi); | 2039 | napi_disable(&priv->napi); |
2034 | 2040 | ||
diff --git a/drivers/net/stmmac/stmmac_timer.c b/drivers/net/stmmac/stmmac_timer.c index b838c6582077..679f61ffb1f8 100644 --- a/drivers/net/stmmac/stmmac_timer.c +++ b/drivers/net/stmmac/stmmac_timer.c | |||
@@ -63,7 +63,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm) | |||
63 | 63 | ||
64 | stmmac_rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); | 64 | stmmac_rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); |
65 | if (stmmac_rtc == NULL) { | 65 | if (stmmac_rtc == NULL) { |
66 | pr_error("open rtc device failed\n"); | 66 | pr_err("open rtc device failed\n"); |
67 | return -ENODEV; | 67 | return -ENODEV; |
68 | } | 68 | } |
69 | 69 | ||
@@ -71,7 +71,7 @@ int stmmac_open_ext_timer(struct net_device *dev, struct stmmac_timer *tm) | |||
71 | 71 | ||
72 | /* Periodic mode is not supported */ | 72 | /* Periodic mode is not supported */ |
73 | if ((rtc_irq_set_freq(stmmac_rtc, &stmmac_task, tm->freq) < 0)) { | 73 | if ((rtc_irq_set_freq(stmmac_rtc, &stmmac_task, tm->freq) < 0)) { |
74 | pr_error("set periodic failed\n"); | 74 | pr_err("set periodic failed\n"); |
75 | rtc_irq_unregister(stmmac_rtc, &stmmac_task); | 75 | rtc_irq_unregister(stmmac_rtc, &stmmac_task); |
76 | rtc_class_close(stmmac_rtc); | 76 | rtc_class_close(stmmac_rtc); |
77 | return -1; | 77 | return -1; |
diff --git a/drivers/net/stmmac/stmmac_timer.h b/drivers/net/stmmac/stmmac_timer.h index f795cae33725..6863590d184b 100644 --- a/drivers/net/stmmac/stmmac_timer.h +++ b/drivers/net/stmmac/stmmac_timer.h | |||
@@ -26,6 +26,7 @@ struct stmmac_timer { | |||
26 | void (*timer_start) (unsigned int new_freq); | 26 | void (*timer_start) (unsigned int new_freq); |
27 | void (*timer_stop) (void); | 27 | void (*timer_stop) (void); |
28 | unsigned int freq; | 28 | unsigned int freq; |
29 | unsigned int enable; | ||
29 | }; | 30 | }; |
30 | 31 | ||
31 | /* Open the HW timer device and return 0 in case of success */ | 32 | /* Open the HW timer device and return 0 in case of success */ |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index fa4e58196c21..43bc3fcc0d85 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -378,7 +378,7 @@ static void dbg_dump(int line_count, const char *func_name, unsigned char *buf, | |||
378 | } | 378 | } |
379 | 379 | ||
380 | #define DUMP(buf_, len_) \ | 380 | #define DUMP(buf_, len_) \ |
381 | dbg_dump(__LINE__, __func__, buf_, len_) | 381 | dbg_dump(__LINE__, __func__, (unsigned char *)buf_, len_) |
382 | 382 | ||
383 | #define DUMP1(buf_, len_) \ | 383 | #define DUMP1(buf_, len_) \ |
384 | do { \ | 384 | do { \ |
@@ -1363,7 +1363,7 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) | |||
1363 | /* reset the rts and dtr */ | 1363 | /* reset the rts and dtr */ |
1364 | /* do the actual close */ | 1364 | /* do the actual close */ |
1365 | serial->open_count--; | 1365 | serial->open_count--; |
1366 | kref_put(&serial->parent->ref, hso_serial_ref_free); | 1366 | |
1367 | if (serial->open_count <= 0) { | 1367 | if (serial->open_count <= 0) { |
1368 | serial->open_count = 0; | 1368 | serial->open_count = 0; |
1369 | spin_lock_irq(&serial->serial_lock); | 1369 | spin_lock_irq(&serial->serial_lock); |
@@ -1383,6 +1383,8 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) | |||
1383 | usb_autopm_put_interface(serial->parent->interface); | 1383 | usb_autopm_put_interface(serial->parent->interface); |
1384 | 1384 | ||
1385 | mutex_unlock(&serial->parent->mutex); | 1385 | mutex_unlock(&serial->parent->mutex); |
1386 | |||
1387 | kref_put(&serial->parent->ref, hso_serial_ref_free); | ||
1386 | } | 1388 | } |
1387 | 1389 | ||
1388 | /* close the requested serial port */ | 1390 | /* close the requested serial port */ |
@@ -1527,7 +1529,7 @@ static void tiocmget_intr_callback(struct urb *urb) | |||
1527 | dev_warn(&usb->dev, | 1529 | dev_warn(&usb->dev, |
1528 | "hso received invalid serial state notification\n"); | 1530 | "hso received invalid serial state notification\n"); |
1529 | DUMP(serial_state_notification, | 1531 | DUMP(serial_state_notification, |
1530 | sizeof(hso_serial_state_notifation)) | 1532 | sizeof(struct hso_serial_state_notification)); |
1531 | } else { | 1533 | } else { |
1532 | 1534 | ||
1533 | UART_state_bitmap = le16_to_cpu(serial_state_notification-> | 1535 | UART_state_bitmap = le16_to_cpu(serial_state_notification-> |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 6c4b5a2d7877..63099c58a6dd 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -199,32 +199,29 @@ rx_drop: | |||
199 | static struct net_device_stats *veth_get_stats(struct net_device *dev) | 199 | static struct net_device_stats *veth_get_stats(struct net_device *dev) |
200 | { | 200 | { |
201 | struct veth_priv *priv; | 201 | struct veth_priv *priv; |
202 | struct net_device_stats *dev_stats; | ||
203 | int cpu; | 202 | int cpu; |
204 | struct veth_net_stats *stats; | 203 | struct veth_net_stats *stats, total = {0}; |
205 | 204 | ||
206 | priv = netdev_priv(dev); | 205 | priv = netdev_priv(dev); |
207 | dev_stats = &dev->stats; | ||
208 | |||
209 | dev_stats->rx_packets = 0; | ||
210 | dev_stats->tx_packets = 0; | ||
211 | dev_stats->rx_bytes = 0; | ||
212 | dev_stats->tx_bytes = 0; | ||
213 | dev_stats->tx_dropped = 0; | ||
214 | dev_stats->rx_dropped = 0; | ||
215 | 206 | ||
216 | for_each_online_cpu(cpu) { | 207 | for_each_possible_cpu(cpu) { |
217 | stats = per_cpu_ptr(priv->stats, cpu); | 208 | stats = per_cpu_ptr(priv->stats, cpu); |
218 | 209 | ||
219 | dev_stats->rx_packets += stats->rx_packets; | 210 | total.rx_packets += stats->rx_packets; |
220 | dev_stats->tx_packets += stats->tx_packets; | 211 | total.tx_packets += stats->tx_packets; |
221 | dev_stats->rx_bytes += stats->rx_bytes; | 212 | total.rx_bytes += stats->rx_bytes; |
222 | dev_stats->tx_bytes += stats->tx_bytes; | 213 | total.tx_bytes += stats->tx_bytes; |
223 | dev_stats->tx_dropped += stats->tx_dropped; | 214 | total.tx_dropped += stats->tx_dropped; |
224 | dev_stats->rx_dropped += stats->rx_dropped; | 215 | total.rx_dropped += stats->rx_dropped; |
225 | } | 216 | } |
226 | 217 | dev->stats.rx_packets = total.rx_packets; | |
227 | return dev_stats; | 218 | dev->stats.tx_packets = total.tx_packets; |
219 | dev->stats.rx_bytes = total.rx_bytes; | ||
220 | dev->stats.tx_bytes = total.tx_bytes; | ||
221 | dev->stats.tx_dropped = total.tx_dropped; | ||
222 | dev->stats.rx_dropped = total.rx_dropped; | ||
223 | |||
224 | return &dev->stats; | ||
228 | } | 225 | } |
229 | 226 | ||
230 | static int veth_open(struct net_device *dev) | 227 | static int veth_open(struct net_device *dev) |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index bc3f8d879c5c..7571e32723bf 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -899,7 +899,6 @@ struct sctp_transport { | |||
899 | */ | 899 | */ |
900 | /* RTO : The current retransmission timeout value. */ | 900 | /* RTO : The current retransmission timeout value. */ |
901 | unsigned long rto; | 901 | unsigned long rto; |
902 | unsigned long last_rto; | ||
903 | 902 | ||
904 | __u32 rtt; /* This is the most recent RTT. */ | 903 | __u32 rtt; /* This is the most recent RTT. */ |
905 | 904 | ||
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index d38470a32792..b44104d3e6be 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -364,6 +364,7 @@ struct pktgen_dev { | |||
364 | * device name (not when the inject is | 364 | * device name (not when the inject is |
365 | * started as it used to do.) | 365 | * started as it used to do.) |
366 | */ | 366 | */ |
367 | char odevname[32]; | ||
367 | struct flow_state *flows; | 368 | struct flow_state *flows; |
368 | unsigned cflows; /* Concurrent flows (config) */ | 369 | unsigned cflows; /* Concurrent flows (config) */ |
369 | unsigned lflow; /* Flow length (config) */ | 370 | unsigned lflow; /* Flow length (config) */ |
@@ -427,7 +428,7 @@ static const char version[] = | |||
427 | static int pktgen_remove_device(struct pktgen_thread *t, struct pktgen_dev *i); | 428 | static int pktgen_remove_device(struct pktgen_thread *t, struct pktgen_dev *i); |
428 | static int pktgen_add_device(struct pktgen_thread *t, const char *ifname); | 429 | static int pktgen_add_device(struct pktgen_thread *t, const char *ifname); |
429 | static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, | 430 | static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, |
430 | const char *ifname); | 431 | const char *ifname, bool exact); |
431 | static int pktgen_device_event(struct notifier_block *, unsigned long, void *); | 432 | static int pktgen_device_event(struct notifier_block *, unsigned long, void *); |
432 | static void pktgen_run_all_threads(void); | 433 | static void pktgen_run_all_threads(void); |
433 | static void pktgen_reset_all_threads(void); | 434 | static void pktgen_reset_all_threads(void); |
@@ -529,7 +530,7 @@ static int pktgen_if_show(struct seq_file *seq, void *v) | |||
529 | seq_printf(seq, | 530 | seq_printf(seq, |
530 | " frags: %d delay: %llu clone_skb: %d ifname: %s\n", | 531 | " frags: %d delay: %llu clone_skb: %d ifname: %s\n", |
531 | pkt_dev->nfrags, (unsigned long long) pkt_dev->delay, | 532 | pkt_dev->nfrags, (unsigned long long) pkt_dev->delay, |
532 | pkt_dev->clone_skb, pkt_dev->odev->name); | 533 | pkt_dev->clone_skb, pkt_dev->odevname); |
533 | 534 | ||
534 | seq_printf(seq, " flows: %u flowlen: %u\n", pkt_dev->cflows, | 535 | seq_printf(seq, " flows: %u flowlen: %u\n", pkt_dev->cflows, |
535 | pkt_dev->lflow); | 536 | pkt_dev->lflow); |
@@ -1689,13 +1690,13 @@ static int pktgen_thread_show(struct seq_file *seq, void *v) | |||
1689 | if_lock(t); | 1690 | if_lock(t); |
1690 | list_for_each_entry(pkt_dev, &t->if_list, list) | 1691 | list_for_each_entry(pkt_dev, &t->if_list, list) |
1691 | if (pkt_dev->running) | 1692 | if (pkt_dev->running) |
1692 | seq_printf(seq, "%s ", pkt_dev->odev->name); | 1693 | seq_printf(seq, "%s ", pkt_dev->odevname); |
1693 | 1694 | ||
1694 | seq_printf(seq, "\nStopped: "); | 1695 | seq_printf(seq, "\nStopped: "); |
1695 | 1696 | ||
1696 | list_for_each_entry(pkt_dev, &t->if_list, list) | 1697 | list_for_each_entry(pkt_dev, &t->if_list, list) |
1697 | if (!pkt_dev->running) | 1698 | if (!pkt_dev->running) |
1698 | seq_printf(seq, "%s ", pkt_dev->odev->name); | 1699 | seq_printf(seq, "%s ", pkt_dev->odevname); |
1699 | 1700 | ||
1700 | if (t->result[0]) | 1701 | if (t->result[0]) |
1701 | seq_printf(seq, "\nResult: %s\n", t->result); | 1702 | seq_printf(seq, "\nResult: %s\n", t->result); |
@@ -1818,9 +1819,10 @@ static struct pktgen_dev *__pktgen_NN_threads(const char *ifname, int remove) | |||
1818 | { | 1819 | { |
1819 | struct pktgen_thread *t; | 1820 | struct pktgen_thread *t; |
1820 | struct pktgen_dev *pkt_dev = NULL; | 1821 | struct pktgen_dev *pkt_dev = NULL; |
1822 | bool exact = (remove == FIND); | ||
1821 | 1823 | ||
1822 | list_for_each_entry(t, &pktgen_threads, th_list) { | 1824 | list_for_each_entry(t, &pktgen_threads, th_list) { |
1823 | pkt_dev = pktgen_find_dev(t, ifname); | 1825 | pkt_dev = pktgen_find_dev(t, ifname, exact); |
1824 | if (pkt_dev) { | 1826 | if (pkt_dev) { |
1825 | if (remove) { | 1827 | if (remove) { |
1826 | if_lock(t); | 1828 | if_lock(t); |
@@ -1995,7 +1997,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
1995 | "queue_map_min (zero-based) (%d) exceeds valid range " | 1997 | "queue_map_min (zero-based) (%d) exceeds valid range " |
1996 | "[0 - %d] for (%d) queues on %s, resetting\n", | 1998 | "[0 - %d] for (%d) queues on %s, resetting\n", |
1997 | pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq, | 1999 | pkt_dev->queue_map_min, (ntxq ?: 1) - 1, ntxq, |
1998 | pkt_dev->odev->name); | 2000 | pkt_dev->odevname); |
1999 | pkt_dev->queue_map_min = ntxq - 1; | 2001 | pkt_dev->queue_map_min = ntxq - 1; |
2000 | } | 2002 | } |
2001 | if (pkt_dev->queue_map_max >= ntxq) { | 2003 | if (pkt_dev->queue_map_max >= ntxq) { |
@@ -2003,7 +2005,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) | |||
2003 | "queue_map_max (zero-based) (%d) exceeds valid range " | 2005 | "queue_map_max (zero-based) (%d) exceeds valid range " |
2004 | "[0 - %d] for (%d) queues on %s, resetting\n", | 2006 | "[0 - %d] for (%d) queues on %s, resetting\n", |
2005 | pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq, | 2007 | pkt_dev->queue_map_max, (ntxq ?: 1) - 1, ntxq, |
2006 | pkt_dev->odev->name); | 2008 | pkt_dev->odevname); |
2007 | pkt_dev->queue_map_max = ntxq - 1; | 2009 | pkt_dev->queue_map_max = ntxq - 1; |
2008 | } | 2010 | } |
2009 | 2011 | ||
@@ -3263,7 +3265,7 @@ static int pktgen_stop_device(struct pktgen_dev *pkt_dev) | |||
3263 | 3265 | ||
3264 | if (!pkt_dev->running) { | 3266 | if (!pkt_dev->running) { |
3265 | printk(KERN_WARNING "pktgen: interface: %s is already " | 3267 | printk(KERN_WARNING "pktgen: interface: %s is already " |
3266 | "stopped\n", pkt_dev->odev->name); | 3268 | "stopped\n", pkt_dev->odevname); |
3267 | return -EINVAL; | 3269 | return -EINVAL; |
3268 | } | 3270 | } |
3269 | 3271 | ||
@@ -3467,7 +3469,7 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev) | |||
3467 | default: /* Drivers are not supposed to return other values! */ | 3469 | default: /* Drivers are not supposed to return other values! */ |
3468 | if (net_ratelimit()) | 3470 | if (net_ratelimit()) |
3469 | pr_info("pktgen: %s xmit error: %d\n", | 3471 | pr_info("pktgen: %s xmit error: %d\n", |
3470 | odev->name, ret); | 3472 | pkt_dev->odevname, ret); |
3471 | pkt_dev->errors++; | 3473 | pkt_dev->errors++; |
3472 | /* fallthru */ | 3474 | /* fallthru */ |
3473 | case NETDEV_TX_LOCKED: | 3475 | case NETDEV_TX_LOCKED: |
@@ -3570,13 +3572,18 @@ static int pktgen_thread_worker(void *arg) | |||
3570 | } | 3572 | } |
3571 | 3573 | ||
3572 | static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, | 3574 | static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, |
3573 | const char *ifname) | 3575 | const char *ifname, bool exact) |
3574 | { | 3576 | { |
3575 | struct pktgen_dev *p, *pkt_dev = NULL; | 3577 | struct pktgen_dev *p, *pkt_dev = NULL; |
3576 | if_lock(t); | 3578 | size_t len = strlen(ifname); |
3577 | 3579 | ||
3580 | if_lock(t); | ||
3578 | list_for_each_entry(p, &t->if_list, list) | 3581 | list_for_each_entry(p, &t->if_list, list) |
3579 | if (strncmp(p->odev->name, ifname, IFNAMSIZ) == 0) { | 3582 | if (strncmp(p->odevname, ifname, len) == 0) { |
3583 | if (p->odevname[len]) { | ||
3584 | if (exact || p->odevname[len] != '@') | ||
3585 | continue; | ||
3586 | } | ||
3580 | pkt_dev = p; | 3587 | pkt_dev = p; |
3581 | break; | 3588 | break; |
3582 | } | 3589 | } |
@@ -3632,6 +3639,7 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname) | |||
3632 | if (!pkt_dev) | 3639 | if (!pkt_dev) |
3633 | return -ENOMEM; | 3640 | return -ENOMEM; |
3634 | 3641 | ||
3642 | strcpy(pkt_dev->odevname, ifname); | ||
3635 | pkt_dev->flows = vmalloc(MAX_CFLOWS * sizeof(struct flow_state)); | 3643 | pkt_dev->flows = vmalloc(MAX_CFLOWS * sizeof(struct flow_state)); |
3636 | if (pkt_dev->flows == NULL) { | 3644 | if (pkt_dev->flows == NULL) { |
3637 | kfree(pkt_dev); | 3645 | kfree(pkt_dev); |
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index b50b2bc3b8c5..adf01fcd462e 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
@@ -175,12 +175,14 @@ static void sta_addba_resp_timer_expired(unsigned long data) | |||
175 | 175 | ||
176 | /* check if the TID waits for addBA response */ | 176 | /* check if the TID waits for addBA response */ |
177 | spin_lock_bh(&sta->lock); | 177 | spin_lock_bh(&sta->lock); |
178 | if (!(*state & HT_ADDBA_REQUESTED_MSK)) { | 178 | if ((*state & (HT_ADDBA_REQUESTED_MSK | HT_ADDBA_RECEIVED_MSK)) != |
179 | HT_ADDBA_REQUESTED_MSK) { | ||
179 | spin_unlock_bh(&sta->lock); | 180 | spin_unlock_bh(&sta->lock); |
180 | *state = HT_AGG_STATE_IDLE; | 181 | *state = HT_AGG_STATE_IDLE; |
181 | #ifdef CONFIG_MAC80211_HT_DEBUG | 182 | #ifdef CONFIG_MAC80211_HT_DEBUG |
182 | printk(KERN_DEBUG "timer expired on tid %d but we are not " | 183 | printk(KERN_DEBUG "timer expired on tid %d but we are not " |
183 | "expecting addBA response there", tid); | 184 | "(or no longer) expecting addBA response there", |
185 | tid); | ||
184 | #endif | 186 | #endif |
185 | return; | 187 | return; |
186 | } | 188 | } |
@@ -649,21 +651,21 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
649 | 651 | ||
650 | state = &sta->ampdu_mlme.tid_state_tx[tid]; | 652 | state = &sta->ampdu_mlme.tid_state_tx[tid]; |
651 | 653 | ||
652 | del_timer_sync(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer); | ||
653 | |||
654 | spin_lock_bh(&sta->lock); | 654 | spin_lock_bh(&sta->lock); |
655 | 655 | ||
656 | if (!(*state & HT_ADDBA_REQUESTED_MSK)) | 656 | if (!(*state & HT_ADDBA_REQUESTED_MSK)) |
657 | goto timer_still_needed; | 657 | goto out; |
658 | 658 | ||
659 | if (mgmt->u.action.u.addba_resp.dialog_token != | 659 | if (mgmt->u.action.u.addba_resp.dialog_token != |
660 | sta->ampdu_mlme.tid_tx[tid]->dialog_token) { | 660 | sta->ampdu_mlme.tid_tx[tid]->dialog_token) { |
661 | #ifdef CONFIG_MAC80211_HT_DEBUG | 661 | #ifdef CONFIG_MAC80211_HT_DEBUG |
662 | printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid); | 662 | printk(KERN_DEBUG "wrong addBA response token, tid %d\n", tid); |
663 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | 663 | #endif /* CONFIG_MAC80211_HT_DEBUG */ |
664 | goto timer_still_needed; | 664 | goto out; |
665 | } | 665 | } |
666 | 666 | ||
667 | del_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer); | ||
668 | |||
667 | #ifdef CONFIG_MAC80211_HT_DEBUG | 669 | #ifdef CONFIG_MAC80211_HT_DEBUG |
668 | printk(KERN_DEBUG "switched off addBA timer for tid %d \n", tid); | 670 | printk(KERN_DEBUG "switched off addBA timer for tid %d \n", tid); |
669 | #endif /* CONFIG_MAC80211_HT_DEBUG */ | 671 | #endif /* CONFIG_MAC80211_HT_DEBUG */ |
@@ -682,10 +684,6 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
682 | ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR); | 684 | ___ieee80211_stop_tx_ba_session(sta, tid, WLAN_BACK_INITIATOR); |
683 | } | 685 | } |
684 | 686 | ||
685 | goto out; | ||
686 | |||
687 | timer_still_needed: | ||
688 | add_timer(&sta->ampdu_mlme.tid_tx[tid]->addba_resp_timer); | ||
689 | out: | 687 | out: |
690 | spin_unlock_bh(&sta->lock); | 688 | spin_unlock_bh(&sta->lock); |
691 | } | 689 | } |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 04093e84ebd7..ab2894211638 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -601,6 +601,14 @@ struct ieee80211_local { | |||
601 | bool suspended; | 601 | bool suspended; |
602 | 602 | ||
603 | /* | 603 | /* |
604 | * Resuming is true while suspended, but when we're reprogramming the | ||
605 | * hardware -- at that time it's allowed to use ieee80211_queue_work() | ||
606 | * again even though some other parts of the stack are still suspended | ||
607 | * and we still drop received frames to avoid waking the stack. | ||
608 | */ | ||
609 | bool resuming; | ||
610 | |||
611 | /* | ||
604 | * quiescing is true during the suspend process _only_ to | 612 | * quiescing is true during the suspend process _only_ to |
605 | * ease timer cancelling etc. | 613 | * ease timer cancelling etc. |
606 | */ | 614 | */ |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 2fb0432ac830..d09f78bb2442 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -520,9 +520,9 @@ EXPORT_SYMBOL_GPL(ieee80211_iterate_active_interfaces_atomic); | |||
520 | */ | 520 | */ |
521 | static bool ieee80211_can_queue_work(struct ieee80211_local *local) | 521 | static bool ieee80211_can_queue_work(struct ieee80211_local *local) |
522 | { | 522 | { |
523 | if (WARN(local->suspended, "queueing ieee80211 work while " | 523 | if (WARN(local->suspended && !local->resuming, |
524 | "going to suspend\n")) | 524 | "queueing ieee80211 work while going to suspend\n")) |
525 | return false; | 525 | return false; |
526 | 526 | ||
527 | return true; | 527 | return true; |
528 | } | 528 | } |
@@ -1033,13 +1033,9 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
1033 | struct sta_info *sta; | 1033 | struct sta_info *sta; |
1034 | unsigned long flags; | 1034 | unsigned long flags; |
1035 | int res; | 1035 | int res; |
1036 | bool from_suspend = local->suspended; | ||
1037 | 1036 | ||
1038 | /* | 1037 | if (local->suspended) |
1039 | * We're going to start the hardware, at that point | 1038 | local->resuming = true; |
1040 | * we are no longer suspended and can RX frames. | ||
1041 | */ | ||
1042 | local->suspended = false; | ||
1043 | 1039 | ||
1044 | /* restart hardware */ | 1040 | /* restart hardware */ |
1045 | if (local->open_count) { | 1041 | if (local->open_count) { |
@@ -1137,11 +1133,14 @@ int ieee80211_reconfig(struct ieee80211_local *local) | |||
1137 | * If this is for hw restart things are still running. | 1133 | * If this is for hw restart things are still running. |
1138 | * We may want to change that later, however. | 1134 | * We may want to change that later, however. |
1139 | */ | 1135 | */ |
1140 | if (!from_suspend) | 1136 | if (!local->suspended) |
1141 | return 0; | 1137 | return 0; |
1142 | 1138 | ||
1143 | #ifdef CONFIG_PM | 1139 | #ifdef CONFIG_PM |
1140 | /* first set suspended false, then resuming */ | ||
1144 | local->suspended = false; | 1141 | local->suspended = false; |
1142 | mb(); | ||
1143 | local->resuming = false; | ||
1145 | 1144 | ||
1146 | list_for_each_entry(sdata, &local->interfaces, list) { | 1145 | list_for_each_entry(sdata, &local->interfaces, list) { |
1147 | switch(sdata->vif.type) { | 1146 | switch(sdata->vif.type) { |
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index c93494fef8ef..d65d3481919c 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c | |||
@@ -128,9 +128,8 @@ EXPORT_SYMBOL(nf_log_packet); | |||
128 | 128 | ||
129 | #ifdef CONFIG_PROC_FS | 129 | #ifdef CONFIG_PROC_FS |
130 | static void *seq_start(struct seq_file *seq, loff_t *pos) | 130 | static void *seq_start(struct seq_file *seq, loff_t *pos) |
131 | __acquires(RCU) | ||
132 | { | 131 | { |
133 | rcu_read_lock(); | 132 | mutex_lock(&nf_log_mutex); |
134 | 133 | ||
135 | if (*pos >= ARRAY_SIZE(nf_loggers)) | 134 | if (*pos >= ARRAY_SIZE(nf_loggers)) |
136 | return NULL; | 135 | return NULL; |
@@ -149,9 +148,8 @@ static void *seq_next(struct seq_file *s, void *v, loff_t *pos) | |||
149 | } | 148 | } |
150 | 149 | ||
151 | static void seq_stop(struct seq_file *s, void *v) | 150 | static void seq_stop(struct seq_file *s, void *v) |
152 | __releases(RCU) | ||
153 | { | 151 | { |
154 | rcu_read_unlock(); | 152 | mutex_unlock(&nf_log_mutex); |
155 | } | 153 | } |
156 | 154 | ||
157 | static int seq_show(struct seq_file *s, void *v) | 155 | static int seq_show(struct seq_file *s, void *v) |
@@ -161,7 +159,7 @@ static int seq_show(struct seq_file *s, void *v) | |||
161 | struct nf_logger *t; | 159 | struct nf_logger *t; |
162 | int ret; | 160 | int ret; |
163 | 161 | ||
164 | logger = rcu_dereference(nf_loggers[*pos]); | 162 | logger = nf_loggers[*pos]; |
165 | 163 | ||
166 | if (!logger) | 164 | if (!logger) |
167 | ret = seq_printf(s, "%2lld NONE (", *pos); | 165 | ret = seq_printf(s, "%2lld NONE (", *pos); |
@@ -171,22 +169,16 @@ static int seq_show(struct seq_file *s, void *v) | |||
171 | if (ret < 0) | 169 | if (ret < 0) |
172 | return ret; | 170 | return ret; |
173 | 171 | ||
174 | mutex_lock(&nf_log_mutex); | ||
175 | list_for_each_entry(t, &nf_loggers_l[*pos], list[*pos]) { | 172 | list_for_each_entry(t, &nf_loggers_l[*pos], list[*pos]) { |
176 | ret = seq_printf(s, "%s", t->name); | 173 | ret = seq_printf(s, "%s", t->name); |
177 | if (ret < 0) { | 174 | if (ret < 0) |
178 | mutex_unlock(&nf_log_mutex); | ||
179 | return ret; | 175 | return ret; |
180 | } | ||
181 | if (&t->list[*pos] != nf_loggers_l[*pos].prev) { | 176 | if (&t->list[*pos] != nf_loggers_l[*pos].prev) { |
182 | ret = seq_printf(s, ","); | 177 | ret = seq_printf(s, ","); |
183 | if (ret < 0) { | 178 | if (ret < 0) |
184 | mutex_unlock(&nf_log_mutex); | ||
185 | return ret; | 179 | return ret; |
186 | } | ||
187 | } | 180 | } |
188 | } | 181 | } |
189 | mutex_unlock(&nf_log_mutex); | ||
190 | 182 | ||
191 | return seq_printf(s, ")\n"); | 183 | return seq_printf(s, ")\n"); |
192 | } | 184 | } |
diff --git a/net/netfilter/xt_limit.c b/net/netfilter/xt_limit.c index 2e8089ecd0af..2773be6a71dd 100644 --- a/net/netfilter/xt_limit.c +++ b/net/netfilter/xt_limit.c | |||
@@ -112,7 +112,7 @@ static bool limit_mt_check(const struct xt_mtchk_param *par) | |||
112 | 112 | ||
113 | priv = kmalloc(sizeof(*priv), GFP_KERNEL); | 113 | priv = kmalloc(sizeof(*priv), GFP_KERNEL); |
114 | if (priv == NULL) | 114 | if (priv == NULL) |
115 | return -ENOMEM; | 115 | return false; |
116 | 116 | ||
117 | /* For SMP, we only want to use one set of state. */ | 117 | /* For SMP, we only want to use one set of state. */ |
118 | r->master = priv; | 118 | r->master = priv; |
diff --git a/net/netfilter/xt_osf.c b/net/netfilter/xt_osf.c index 63e190504656..4d1a41bbd5d7 100644 --- a/net/netfilter/xt_osf.c +++ b/net/netfilter/xt_osf.c | |||
@@ -118,7 +118,7 @@ static int xt_osf_remove_callback(struct sock *ctnl, struct sk_buff *skb, | |||
118 | { | 118 | { |
119 | struct xt_osf_user_finger *f; | 119 | struct xt_osf_user_finger *f; |
120 | struct xt_osf_finger *sf; | 120 | struct xt_osf_finger *sf; |
121 | int err = ENOENT; | 121 | int err = -ENOENT; |
122 | 122 | ||
123 | if (!osf_attrs[OSF_ATTR_FINGER]) | 123 | if (!osf_attrs[OSF_ATTR_FINGER]) |
124 | return -EINVAL; | 124 | return -EINVAL; |
diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 09f4e161799b..448e5a0fcc2e 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c | |||
@@ -1191,6 +1191,7 @@ static long rfkill_fop_ioctl(struct file *file, unsigned int cmd, | |||
1191 | #endif | 1191 | #endif |
1192 | 1192 | ||
1193 | static const struct file_operations rfkill_fops = { | 1193 | static const struct file_operations rfkill_fops = { |
1194 | .owner = THIS_MODULE, | ||
1194 | .open = rfkill_fop_open, | 1195 | .open = rfkill_fop_open, |
1195 | .read = rfkill_fop_read, | 1196 | .read = rfkill_fop_read, |
1196 | .write = rfkill_fop_write, | 1197 | .write = rfkill_fop_write, |
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 2f2377369e2b..e231a9831016 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -423,16 +423,6 @@ void sctp_retransmit_mark(struct sctp_outq *q, | |||
423 | if ((reason == SCTP_RTXR_FAST_RTX && | 423 | if ((reason == SCTP_RTXR_FAST_RTX && |
424 | (chunk->fast_retransmit == SCTP_NEED_FRTX)) || | 424 | (chunk->fast_retransmit == SCTP_NEED_FRTX)) || |
425 | (reason != SCTP_RTXR_FAST_RTX && !chunk->tsn_gap_acked)) { | 425 | (reason != SCTP_RTXR_FAST_RTX && !chunk->tsn_gap_acked)) { |
426 | /* If this chunk was sent less then 1 rto ago, do not | ||
427 | * retransmit this chunk, but give the peer time | ||
428 | * to acknowlege it. Do this only when | ||
429 | * retransmitting due to T3 timeout. | ||
430 | */ | ||
431 | if (reason == SCTP_RTXR_T3_RTX && | ||
432 | time_before(jiffies, chunk->sent_at + | ||
433 | transport->last_rto)) | ||
434 | continue; | ||
435 | |||
436 | /* RFC 2960 6.2.1 Processing a Received SACK | 426 | /* RFC 2960 6.2.1 Processing a Received SACK |
437 | * | 427 | * |
438 | * C) Any time a DATA chunk is marked for | 428 | * C) Any time a DATA chunk is marked for |
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 8ae67098e094..d771cc1b777a 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -479,7 +479,6 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc, | |||
479 | * that indicates that we have an outstanding HB. | 479 | * that indicates that we have an outstanding HB. |
480 | */ | 480 | */ |
481 | if (!is_hb || transport->hb_sent) { | 481 | if (!is_hb || transport->hb_sent) { |
482 | transport->last_rto = transport->rto; | ||
483 | transport->rto = min((transport->rto * 2), transport->asoc->rto_max); | 482 | transport->rto = min((transport->rto * 2), transport->asoc->rto_max); |
484 | } | 483 | } |
485 | } | 484 | } |
diff --git a/net/sctp/transport.c b/net/sctp/transport.c index 9a6cb22d129f..b827d21dbe54 100644 --- a/net/sctp/transport.c +++ b/net/sctp/transport.c | |||
@@ -74,7 +74,7 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer, | |||
74 | * given destination transport address, set RTO to the protocol | 74 | * given destination transport address, set RTO to the protocol |
75 | * parameter 'RTO.Initial'. | 75 | * parameter 'RTO.Initial'. |
76 | */ | 76 | */ |
77 | peer->last_rto = peer->rto = msecs_to_jiffies(sctp_rto_initial); | 77 | peer->rto = msecs_to_jiffies(sctp_rto_initial); |
78 | peer->rtt = 0; | 78 | peer->rtt = 0; |
79 | peer->rttvar = 0; | 79 | peer->rttvar = 0; |
80 | peer->srtt = 0; | 80 | peer->srtt = 0; |
@@ -385,7 +385,6 @@ void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt) | |||
385 | tp->rto = tp->asoc->rto_max; | 385 | tp->rto = tp->asoc->rto_max; |
386 | 386 | ||
387 | tp->rtt = rtt; | 387 | tp->rtt = rtt; |
388 | tp->last_rto = tp->rto; | ||
389 | 388 | ||
390 | /* Reset rto_pending so that a new RTT measurement is started when a | 389 | /* Reset rto_pending so that a new RTT measurement is started when a |
391 | * new data chunk is sent. | 390 | * new data chunk is sent. |
@@ -637,7 +636,7 @@ void sctp_transport_reset(struct sctp_transport *t) | |||
637 | t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380)); | 636 | t->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380)); |
638 | t->burst_limited = 0; | 637 | t->burst_limited = 0; |
639 | t->ssthresh = asoc->peer.i.a_rwnd; | 638 | t->ssthresh = asoc->peer.i.a_rwnd; |
640 | t->last_rto = t->rto = asoc->rto_initial; | 639 | t->rto = asoc->rto_initial; |
641 | t->rtt = 0; | 640 | t->rtt = 0; |
642 | t->srtt = 0; | 641 | t->srtt = 0; |
643 | t->rttvar = 0; | 642 | t->rttvar = 0; |