summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-12 20:31:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-12 20:31:22 -0400
commit454fd351f2e2b6baa926d61064aaf70d2a77976e (patch)
tree14cd2bea1c2c945c241d27368be63abcb4578acc
parentfd18f00dd9d4e896060aa3d3e074a04830b13e50 (diff)
parenteda43ce03919f2b929a884fddbefa98cfb04fec9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull yet more networking updates from David Miller: 1) Various fixes to the new Redpine Signals wireless driver, from Fariya Fatima. 2) L2TP PPP connect code takes PMTU from the wrong socket, fix from Dmitry Petukhov. 3) UFO and TSO packets differ in whether they include the protocol header in gso_size, account for that in skb_gso_transport_seglen(). From Florian Westphal. 4) If VLAN untagging fails, we double free the SKB in the bridging output path. From Toshiaki Makita. 5) Several call sites of sk->sk_data_ready() were referencing an SKB just added to the socket receive queue in order to calculate the second argument via skb->len. This is dangerous because the moment the skb is added to the receive queue it can be consumed in another context and freed up. It turns out also that none of the sk->sk_data_ready() implementations even care about this second argument. So just kill it off and thus fix all these use-after-free bugs as a side effect. 6) Fix inverted test in tcp_v6_send_response(), from Lorenzo Colitti. 7) pktgen needs to do locking properly for LLTX devices, from Daniel Borkmann. 8) xen-netfront driver initializes TX array entries in RX loop :-) From Vincenzo Maffione. 9) After refactoring, some tunnel drivers allow a tunnel to be configured on top itself. Fix from Nicolas Dichtel. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (46 commits) vti: don't allow to add the same tunnel twice gre: don't allow to add the same tunnel twice drivers: net: xen-netfront: fix array initialization bug pktgen: be friendly to LLTX devices r8152: check RTL8152_UNPLUG net: sun4i-emac: add promiscuous support net/apne: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO net: ipv6: Fix oif in TCP SYN+ACK route lookup. drivers: net: cpsw: enable interrupts after napi enable and clearing previous interrupts drivers: net: cpsw: discard all packets received when interface is down net: Fix use after free by removing length arg from sk_data_ready callbacks. Drivers: net: hyperv: Address UDP checksum issues Drivers: net: hyperv: Negotiate suitable ndis version for offload support Drivers: net: hyperv: Allocate memory for all possible per-pecket information bridge: Fix double free and memory leak around br_allowed_ingress bonding: Remove debug_fs files when module init fails i40evf: program RSS LUT correctly i40evf: remove open-coded skb_cow_head ixgb: remove open-coded skb_cow_head igbvf: remove open-coded skb_cow_head ...
-rw-r--r--drivers/net/bonding/bond_main.c1
-rw-r--r--drivers/net/ethernet/8390/apne.c4
-rw-r--r--drivers/net/ethernet/allwinner/sun4i-emac.c30
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_hw.c124
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c11
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c10
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40e_txrx.c10
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c20
-rw-r--r--drivers/net/ethernet/intel/igb/igb.h16
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c13
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ptp.c14
-rw-r--r--drivers/net/ethernet/intel/igbvf/netdev.c16
-rw-r--r--drivers/net/ethernet/intel/ixgb/ixgb_main.c10
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c28
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf.h1
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c20
-rw-r--r--drivers/net/ethernet/ti/cpsw.c17
-rw-r--r--drivers/net/hyperv/hyperv_net.h1
-rw-r--r--drivers/net/hyperv/netvsc.c2
-rw-r--r--drivers/net/hyperv/netvsc_drv.c30
-rw-r--r--drivers/net/hyperv/rndis_filter.c12
-rw-r--r--drivers/net/phy/phy.c6
-rw-r--r--drivers/net/usb/r8152.c48
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_txrx.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c2
-rw-r--r--drivers/net/wireless/b43/phy_n.c14
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_core.c6
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_debugfs.c35
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_mgmt.c8
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_sdio.c5
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_sdio_ops.c6
-rw-r--r--drivers/net/wireless/rsi/rsi_91x_usb.c26
-rw-r--r--drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c10
-rw-r--r--drivers/net/xen-netfront.c2
-rw-r--r--drivers/scsi/iscsi_tcp.c2
-rw-r--r--drivers/scsi/iscsi_tcp.h2
-rw-r--r--drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c4
-rw-r--r--drivers/target/iscsi/iscsi_target_core.h2
-rw-r--r--drivers/target/iscsi/iscsi_target_nego.c2
-rw-r--r--fs/dlm/lowcomms.c2
-rw-r--r--fs/ncpfs/ncp_fs_sb.h4
-rw-r--r--fs/ncpfs/sock.c4
-rw-r--r--fs/ocfs2/cluster/tcp.c15
-rw-r--r--fs/ocfs2/cluster/tcp_internal.h2
-rw-r--r--include/linux/sunrpc/svcsock.h2
-rw-r--r--include/net/sctp/sctp.h2
-rw-r--r--include/net/sock.h2
-rw-r--r--net/atm/clip.c2
-rw-r--r--net/atm/lec.c10
-rw-r--r--net/atm/mpc.c6
-rw-r--r--net/atm/raw.c2
-rw-r--r--net/atm/signaling.c2
-rw-r--r--net/ax25/ax25_in.c2
-rw-r--r--net/bluetooth/l2cap_sock.c6
-rw-r--r--net/bluetooth/rfcomm/core.c4
-rw-r--r--net/bluetooth/rfcomm/sock.c4
-rw-r--r--net/bluetooth/sco.c2
-rw-r--r--net/bridge/br_input.c2
-rw-r--r--net/bridge/br_vlan.c7
-rw-r--r--net/caif/caif_socket.c4
-rw-r--r--net/ceph/messenger.c2
-rw-r--r--net/core/pktgen.c8
-rw-r--r--net/core/skbuff.c16
-rw-r--r--net/core/sock.c4
-rw-r--r--net/dccp/input.c2
-rw-r--r--net/dccp/minisocks.c2
-rw-r--r--net/decnet/dn_nsp_in.c4
-rw-r--r--net/ipv4/ip_gre.c2
-rw-r--r--net/ipv4/ip_vti.c2
-rw-r--r--net/ipv4/tcp_input.c10
-rw-r--r--net/ipv4/tcp_ipv4.c2
-rw-r--r--net/ipv4/tcp_minisocks.c2
-rw-r--r--net/ipv6/tcp_ipv6.c2
-rw-r--r--net/iucv/af_iucv.c4
-rw-r--r--net/key/af_key.c2
-rw-r--r--net/l2tp/l2tp_ppp.c4
-rw-r--r--net/netlink/af_netlink.c4
-rw-r--r--net/netrom/af_netrom.c2
-rw-r--r--net/nfc/llcp_core.c2
-rw-r--r--net/packet/af_packet.c6
-rw-r--r--net/phonet/pep-gprs.c4
-rw-r--r--net/phonet/pep.c8
-rw-r--r--net/rds/tcp.h4
-rw-r--r--net/rds/tcp_listen.c6
-rw-r--r--net/rds/tcp_recv.c8
-rw-r--r--net/rose/af_rose.c2
-rw-r--r--net/rxrpc/ar-input.c6
-rw-r--r--net/rxrpc/ar-internal.h2
-rw-r--r--net/sctp/socket.c8
-rw-r--r--net/sctp/ulpqueue.c4
-rw-r--r--net/sunrpc/svcsock.c12
-rw-r--r--net/sunrpc/xprtsock.c8
-rw-r--r--net/tipc/server.c4
-rw-r--r--net/tipc/socket.c6
-rw-r--r--net/unix/af_unix.c6
-rw-r--r--net/vmw_vsock/vmci_transport_notify.c2
-rw-r--r--net/vmw_vsock/vmci_transport_notify_qstate.c4
-rw-r--r--net/x25/af_x25.c2
-rw-r--r--net/x25/x25_in.c2
102 files changed, 420 insertions, 433 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)
4492out: 4492out:
4493 return res; 4493 return res;
4494err: 4494err:
4495 bond_destroy_debugfs();
4495 bond_netlink_fini(); 4496 bond_netlink_fini();
4496err_link: 4497err_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;
560static int __init apne_module_init(void) 560static 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
568static void __exit apne_module_exit(void) 566static 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
303static 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
312static unsigned int emac_powerup(struct net_device *ndev) 323static 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 */
116static s32 e1000_set_phy_type(struct e1000_hw *hw) 116static 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 */
254s32 e1000_set_mac_type(struct e1000_hw *hw) 250s32 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)
1432static s32 e1000_copper_link_postconfig(struct e1000_hw *hw) 1406static 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)
3301static s32 e1000_phy_reset_dsp(struct e1000_hw *hw) 3239static 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
3528s32 e1000_validate_mdi_setting(struct e1000_hw *hw) 3459s32 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 */
4890void e1000_reset_adaptive(struct e1000_hw *hw) 4785void 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 */
4918void e1000_update_adaptive(struct e1000_hw *hw) 4811void 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 */
5873static s32 e1000_get_auto_rd_done(struct e1000_hw *hw) 5751static 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 */
5888static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw) 5765static 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 **/
1415static int next_queue(struct i40evf_adapter *adapter, int j) 1423static 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);
533void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb); 533void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb);
534void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va, 534void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
535 struct sk_buff *skb); 535 struct sk_buff *skb);
536static 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
550int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr); 536int igb_ptp_set_ts_config(struct net_device *netdev, struct ifreq *ifr);
551int igb_ptp_get_ts_config(struct net_device *netdev, struct ifreq *ifr); 537int 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)
427void igb_ptp_rx_hang(struct igb_adapter *adapter) 427void 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
303void ixgbe_check_remove(struct ixgbe_hw *hw, u32 reg) 304void 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
8495skip_bad_vf_detection: 8504skip_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
426struct ixgbevf_cb { 427struct 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
113static void ixgbevf_check_remove(struct ixgbe_hw *hw, u32 reg) 114static 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
464drop:
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/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
1963static int rtl8152_enable(struct r8152 *tp) 1969static 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
1995static int rtl8153_enable(struct r8152 *tp) 2004static 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
2688static void rtl8152_down(struct r8152 *tp) 2711static 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
2696static void rtl8153_down(struct r8152 *tp) 2724static 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
3294static void rtl8152_unload(struct r8152 *tp) 3336static 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
3300static void rtl8153_unload(struct r8152 *tp) 3345static 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
313void ath9k_csa_update(struct ath_softc *sc) 313void 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
321void ath9k_beacon_tasklet(unsigned long data) 320void 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
684static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) 686static 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
104get_queue_num: 104get_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 */
741static u8 rsi_load_bootup_params(struct rsi_common *common) 741static 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:
756static void rsi_disconnect(struct sdio_func *pfunction) 756static 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
266fail: 264fail:
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 */
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index bfb6d07d87f0..11854845393b 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -125,7 +125,7 @@ static inline int iscsi_sw_sk_state_check(struct sock *sk)
125 return 0; 125 return 0;
126} 126}
127 127
128static void iscsi_sw_tcp_data_ready(struct sock *sk, int flag) 128static void iscsi_sw_tcp_data_ready(struct sock *sk)
129{ 129{
130 struct iscsi_conn *conn; 130 struct iscsi_conn *conn;
131 struct iscsi_tcp_conn *tcp_conn; 131 struct iscsi_tcp_conn *tcp_conn;
diff --git a/drivers/scsi/iscsi_tcp.h b/drivers/scsi/iscsi_tcp.h
index 666fe09378fa..f42ecb238af5 100644
--- a/drivers/scsi/iscsi_tcp.h
+++ b/drivers/scsi/iscsi_tcp.h
@@ -40,7 +40,7 @@ struct iscsi_sw_tcp_conn {
40 40
41 struct iscsi_sw_tcp_send out; 41 struct iscsi_sw_tcp_send out;
42 /* old values for socket callbacks */ 42 /* old values for socket callbacks */
43 void (*old_data_ready)(struct sock *, int); 43 void (*old_data_ready)(struct sock *);
44 void (*old_state_change)(struct sock *); 44 void (*old_state_change)(struct sock *);
45 void (*old_write_space)(struct sock *); 45 void (*old_write_space)(struct sock *);
46 46
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
index b87b246111c0..37758d1c8a68 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.c
@@ -617,7 +617,7 @@ extern void ksocknal_write_callback (ksock_conn_t *conn);
617 * socket call back in Linux 617 * socket call back in Linux
618 */ 618 */
619static void 619static void
620ksocknal_data_ready (struct sock *sk, int n) 620ksocknal_data_ready (struct sock *sk)
621{ 621{
622 ksock_conn_t *conn; 622 ksock_conn_t *conn;
623 623
@@ -628,7 +628,7 @@ ksocknal_data_ready (struct sock *sk, int n)
628 conn = sk->sk_user_data; 628 conn = sk->sk_user_data;
629 if (conn == NULL) { /* raced with ksocknal_terminate_conn */ 629 if (conn == NULL) { /* raced with ksocknal_terminate_conn */
630 LASSERT (sk->sk_data_ready != &ksocknal_data_ready); 630 LASSERT (sk->sk_data_ready != &ksocknal_data_ready);
631 sk->sk_data_ready (sk, n); 631 sk->sk_data_ready (sk);
632 } else 632 } else
633 ksocknal_read_callback(conn); 633 ksocknal_read_callback(conn);
634 634
diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h
index 886d74d6f3d4..6960f22909ae 100644
--- a/drivers/target/iscsi/iscsi_target_core.h
+++ b/drivers/target/iscsi/iscsi_target_core.h
@@ -557,7 +557,7 @@ struct iscsi_conn {
557 struct completion rx_half_close_comp; 557 struct completion rx_half_close_comp;
558 /* socket used by this connection */ 558 /* socket used by this connection */
559 struct socket *sock; 559 struct socket *sock;
560 void (*orig_data_ready)(struct sock *, int); 560 void (*orig_data_ready)(struct sock *);
561 void (*orig_state_change)(struct sock *); 561 void (*orig_state_change)(struct sock *);
562#define LOGIN_FLAGS_READ_ACTIVE 1 562#define LOGIN_FLAGS_READ_ACTIVE 1
563#define LOGIN_FLAGS_CLOSED 2 563#define LOGIN_FLAGS_CLOSED 2
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c
index 582ba84075ec..75b685960e80 100644
--- a/drivers/target/iscsi/iscsi_target_nego.c
+++ b/drivers/target/iscsi/iscsi_target_nego.c
@@ -375,7 +375,7 @@ static int iscsi_target_do_tx_login_io(struct iscsi_conn *conn, struct iscsi_log
375 return 0; 375 return 0;
376} 376}
377 377
378static void iscsi_target_sk_data_ready(struct sock *sk, int count) 378static void iscsi_target_sk_data_ready(struct sock *sk)
379{ 379{
380 struct iscsi_conn *conn = sk->sk_user_data; 380 struct iscsi_conn *conn = sk->sk_user_data;
381 bool rc; 381 bool rc;
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 3190ca973dd6..1e5b45359509 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -424,7 +424,7 @@ int dlm_lowcomms_addr(int nodeid, struct sockaddr_storage *addr, int len)
424} 424}
425 425
426/* Data available on socket or listen socket received a connect */ 426/* Data available on socket or listen socket received a connect */
427static void lowcomms_data_ready(struct sock *sk, int count_unused) 427static void lowcomms_data_ready(struct sock *sk)
428{ 428{
429 struct connection *con = sock2con(sk); 429 struct connection *con = sock2con(sk);
430 if (con && !test_and_set_bit(CF_READ_PENDING, &con->flags)) 430 if (con && !test_and_set_bit(CF_READ_PENDING, &con->flags))
diff --git a/fs/ncpfs/ncp_fs_sb.h b/fs/ncpfs/ncp_fs_sb.h
index 7fa17e459366..55e26fd80886 100644
--- a/fs/ncpfs/ncp_fs_sb.h
+++ b/fs/ncpfs/ncp_fs_sb.h
@@ -109,7 +109,7 @@ struct ncp_server {
109 109
110 spinlock_t requests_lock; /* Lock accesses to tx.requests, tx.creq and rcv.creq when STREAM mode */ 110 spinlock_t requests_lock; /* Lock accesses to tx.requests, tx.creq and rcv.creq when STREAM mode */
111 111
112 void (*data_ready)(struct sock* sk, int len); 112 void (*data_ready)(struct sock* sk);
113 void (*error_report)(struct sock* sk); 113 void (*error_report)(struct sock* sk);
114 void (*write_space)(struct sock* sk); /* STREAM mode only */ 114 void (*write_space)(struct sock* sk); /* STREAM mode only */
115 struct { 115 struct {
@@ -151,7 +151,7 @@ extern void ncp_tcp_tx_proc(struct work_struct *work);
151extern void ncpdgram_rcv_proc(struct work_struct *work); 151extern void ncpdgram_rcv_proc(struct work_struct *work);
152extern void ncpdgram_timeout_proc(struct work_struct *work); 152extern void ncpdgram_timeout_proc(struct work_struct *work);
153extern void ncpdgram_timeout_call(unsigned long server); 153extern void ncpdgram_timeout_call(unsigned long server);
154extern void ncp_tcp_data_ready(struct sock* sk, int len); 154extern void ncp_tcp_data_ready(struct sock* sk);
155extern void ncp_tcp_write_space(struct sock* sk); 155extern void ncp_tcp_write_space(struct sock* sk);
156extern void ncp_tcp_error_report(struct sock* sk); 156extern void ncp_tcp_error_report(struct sock* sk);
157 157
diff --git a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c
index 04a69a4d8e96..471bc3d1139e 100644
--- a/fs/ncpfs/sock.c
+++ b/fs/ncpfs/sock.c
@@ -97,11 +97,11 @@ static void ncp_req_put(struct ncp_request_reply *req)
97 kfree(req); 97 kfree(req);
98} 98}
99 99
100void ncp_tcp_data_ready(struct sock *sk, int len) 100void ncp_tcp_data_ready(struct sock *sk)
101{ 101{
102 struct ncp_server *server = sk->sk_user_data; 102 struct ncp_server *server = sk->sk_user_data;
103 103
104 server->data_ready(sk, len); 104 server->data_ready(sk);
105 schedule_work(&server->rcv.tq); 105 schedule_work(&server->rcv.tq);
106} 106}
107 107
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index dfda2ffdb16c..c6b90e670389 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -137,7 +137,7 @@ static int o2net_sys_err_translations[O2NET_ERR_MAX] =
137static void o2net_sc_connect_completed(struct work_struct *work); 137static void o2net_sc_connect_completed(struct work_struct *work);
138static void o2net_rx_until_empty(struct work_struct *work); 138static void o2net_rx_until_empty(struct work_struct *work);
139static void o2net_shutdown_sc(struct work_struct *work); 139static void o2net_shutdown_sc(struct work_struct *work);
140static void o2net_listen_data_ready(struct sock *sk, int bytes); 140static void o2net_listen_data_ready(struct sock *sk);
141static void o2net_sc_send_keep_req(struct work_struct *work); 141static void o2net_sc_send_keep_req(struct work_struct *work);
142static void o2net_idle_timer(unsigned long data); 142static void o2net_idle_timer(unsigned long data);
143static void o2net_sc_postpone_idle(struct o2net_sock_container *sc); 143static void o2net_sc_postpone_idle(struct o2net_sock_container *sc);
@@ -597,9 +597,9 @@ static void o2net_set_nn_state(struct o2net_node *nn,
597} 597}
598 598
599/* see o2net_register_callbacks() */ 599/* see o2net_register_callbacks() */
600static void o2net_data_ready(struct sock *sk, int bytes) 600static void o2net_data_ready(struct sock *sk)
601{ 601{
602 void (*ready)(struct sock *sk, int bytes); 602 void (*ready)(struct sock *sk);
603 603
604 read_lock(&sk->sk_callback_lock); 604 read_lock(&sk->sk_callback_lock);
605 if (sk->sk_user_data) { 605 if (sk->sk_user_data) {
@@ -613,7 +613,7 @@ static void o2net_data_ready(struct sock *sk, int bytes)
613 } 613 }
614 read_unlock(&sk->sk_callback_lock); 614 read_unlock(&sk->sk_callback_lock);
615 615
616 ready(sk, bytes); 616 ready(sk);
617} 617}
618 618
619/* see o2net_register_callbacks() */ 619/* see o2net_register_callbacks() */
@@ -1926,9 +1926,9 @@ static void o2net_accept_many(struct work_struct *work)
1926 cond_resched(); 1926 cond_resched();
1927} 1927}
1928 1928
1929static void o2net_listen_data_ready(struct sock *sk, int bytes) 1929static void o2net_listen_data_ready(struct sock *sk)
1930{ 1930{
1931 void (*ready)(struct sock *sk, int bytes); 1931 void (*ready)(struct sock *sk);
1932 1932
1933 read_lock(&sk->sk_callback_lock); 1933 read_lock(&sk->sk_callback_lock);
1934 ready = sk->sk_user_data; 1934 ready = sk->sk_user_data;
@@ -1951,7 +1951,6 @@ static void o2net_listen_data_ready(struct sock *sk, int bytes)
1951 */ 1951 */
1952 1952
1953 if (sk->sk_state == TCP_LISTEN) { 1953 if (sk->sk_state == TCP_LISTEN) {
1954 mlog(ML_TCP, "bytes: %d\n", bytes);
1955 queue_work(o2net_wq, &o2net_listen_work); 1954 queue_work(o2net_wq, &o2net_listen_work);
1956 } else { 1955 } else {
1957 ready = NULL; 1956 ready = NULL;
@@ -1960,7 +1959,7 @@ static void o2net_listen_data_ready(struct sock *sk, int bytes)
1960out: 1959out:
1961 read_unlock(&sk->sk_callback_lock); 1960 read_unlock(&sk->sk_callback_lock);
1962 if (ready != NULL) 1961 if (ready != NULL)
1963 ready(sk, bytes); 1962 ready(sk);
1964} 1963}
1965 1964
1966static int o2net_open_listening_sock(__be32 addr, __be16 port) 1965static int o2net_open_listening_sock(__be32 addr, __be16 port)
diff --git a/fs/ocfs2/cluster/tcp_internal.h b/fs/ocfs2/cluster/tcp_internal.h
index 4cbcb65784a3..dc024367110a 100644
--- a/fs/ocfs2/cluster/tcp_internal.h
+++ b/fs/ocfs2/cluster/tcp_internal.h
@@ -165,7 +165,7 @@ struct o2net_sock_container {
165 165
166 /* original handlers for the sockets */ 166 /* original handlers for the sockets */
167 void (*sc_state_change)(struct sock *sk); 167 void (*sc_state_change)(struct sock *sk);
168 void (*sc_data_ready)(struct sock *sk, int bytes); 168 void (*sc_data_ready)(struct sock *sk);
169 169
170 u32 sc_msg_key; 170 u32 sc_msg_key;
171 u16 sc_msg_type; 171 u16 sc_msg_type;
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 947009ed5996..2e780134f449 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -22,7 +22,7 @@ struct svc_sock {
22 22
23 /* We keep the old state_change and data_ready CB's here */ 23 /* We keep the old state_change and data_ready CB's here */
24 void (*sk_ostate)(struct sock *); 24 void (*sk_ostate)(struct sock *);
25 void (*sk_odata)(struct sock *, int bytes); 25 void (*sk_odata)(struct sock *);
26 void (*sk_owspace)(struct sock *); 26 void (*sk_owspace)(struct sock *);
27 27
28 /* private TCP part */ 28 /* private TCP part */
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index a3353f45ef94..8e4de46c052e 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -101,7 +101,7 @@ void sctp_addr_wq_mgmt(struct net *, struct sctp_sockaddr_entry *, int);
101int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); 101int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb);
102int sctp_inet_listen(struct socket *sock, int backlog); 102int sctp_inet_listen(struct socket *sock, int backlog);
103void sctp_write_space(struct sock *sk); 103void sctp_write_space(struct sock *sk);
104void sctp_data_ready(struct sock *sk, int len); 104void sctp_data_ready(struct sock *sk);
105unsigned int sctp_poll(struct file *file, struct socket *sock, 105unsigned int sctp_poll(struct file *file, struct socket *sock,
106 poll_table *wait); 106 poll_table *wait);
107void sctp_sock_rfree(struct sk_buff *skb); 107void sctp_sock_rfree(struct sk_buff *skb);
diff --git a/include/net/sock.h b/include/net/sock.h
index 06a5668f05c9..8338a14e4805 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -418,7 +418,7 @@ struct sock {
418 u32 sk_classid; 418 u32 sk_classid;
419 struct cg_proto *sk_cgrp; 419 struct cg_proto *sk_cgrp;
420 void (*sk_state_change)(struct sock *sk); 420 void (*sk_state_change)(struct sock *sk);
421 void (*sk_data_ready)(struct sock *sk, int bytes); 421 void (*sk_data_ready)(struct sock *sk);
422 void (*sk_write_space)(struct sock *sk); 422 void (*sk_write_space)(struct sock *sk);
423 void (*sk_error_report)(struct sock *sk); 423 void (*sk_error_report)(struct sock *sk);
424 int (*sk_backlog_rcv)(struct sock *sk, 424 int (*sk_backlog_rcv)(struct sock *sk,
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 8215f7cb170b..ba291ce4bdff 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -68,7 +68,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip)
68 68
69 sk = sk_atm(atmarpd); 69 sk = sk_atm(atmarpd);
70 skb_queue_tail(&sk->sk_receive_queue, skb); 70 skb_queue_tail(&sk->sk_receive_queue, skb);
71 sk->sk_data_ready(sk, skb->len); 71 sk->sk_data_ready(sk);
72 return 0; 72 return 0;
73} 73}
74 74
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 5a2f602d07e1..4c5b8ba0f84f 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -152,7 +152,7 @@ static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev)
152 atm_force_charge(priv->lecd, skb2->truesize); 152 atm_force_charge(priv->lecd, skb2->truesize);
153 sk = sk_atm(priv->lecd); 153 sk = sk_atm(priv->lecd);
154 skb_queue_tail(&sk->sk_receive_queue, skb2); 154 skb_queue_tail(&sk->sk_receive_queue, skb2);
155 sk->sk_data_ready(sk, skb2->len); 155 sk->sk_data_ready(sk);
156 } 156 }
157} 157}
158#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ 158#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */
@@ -447,7 +447,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
447 atm_force_charge(priv->lecd, skb2->truesize); 447 atm_force_charge(priv->lecd, skb2->truesize);
448 sk = sk_atm(priv->lecd); 448 sk = sk_atm(priv->lecd);
449 skb_queue_tail(&sk->sk_receive_queue, skb2); 449 skb_queue_tail(&sk->sk_receive_queue, skb2);
450 sk->sk_data_ready(sk, skb2->len); 450 sk->sk_data_ready(sk);
451 } 451 }
452 } 452 }
453#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ 453#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */
@@ -530,13 +530,13 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
530 atm_force_charge(priv->lecd, skb->truesize); 530 atm_force_charge(priv->lecd, skb->truesize);
531 sk = sk_atm(priv->lecd); 531 sk = sk_atm(priv->lecd);
532 skb_queue_tail(&sk->sk_receive_queue, skb); 532 skb_queue_tail(&sk->sk_receive_queue, skb);
533 sk->sk_data_ready(sk, skb->len); 533 sk->sk_data_ready(sk);
534 534
535 if (data != NULL) { 535 if (data != NULL) {
536 pr_debug("about to send %d bytes of data\n", data->len); 536 pr_debug("about to send %d bytes of data\n", data->len);
537 atm_force_charge(priv->lecd, data->truesize); 537 atm_force_charge(priv->lecd, data->truesize);
538 skb_queue_tail(&sk->sk_receive_queue, data); 538 skb_queue_tail(&sk->sk_receive_queue, data);
539 sk->sk_data_ready(sk, skb->len); 539 sk->sk_data_ready(sk);
540 } 540 }
541 541
542 return 0; 542 return 0;
@@ -616,7 +616,7 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
616 616
617 pr_debug("%s: To daemon\n", dev->name); 617 pr_debug("%s: To daemon\n", dev->name);
618 skb_queue_tail(&sk->sk_receive_queue, skb); 618 skb_queue_tail(&sk->sk_receive_queue, skb);
619 sk->sk_data_ready(sk, skb->len); 619 sk->sk_data_ready(sk);
620 } else { /* Data frame, queue to protocol handlers */ 620 } else { /* Data frame, queue to protocol handlers */
621 struct lec_arp_table *entry; 621 struct lec_arp_table *entry;
622 unsigned char *src, *dst; 622 unsigned char *src, *dst;
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 91dc58f1124d..e8e0e7a8a23d 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -706,7 +706,7 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
706 dprintk("(%s) control packet arrived\n", dev->name); 706 dprintk("(%s) control packet arrived\n", dev->name);
707 /* Pass control packets to daemon */ 707 /* Pass control packets to daemon */
708 skb_queue_tail(&sk->sk_receive_queue, skb); 708 skb_queue_tail(&sk->sk_receive_queue, skb);
709 sk->sk_data_ready(sk, skb->len); 709 sk->sk_data_ready(sk);
710 return; 710 return;
711 } 711 }
712 712
@@ -992,7 +992,7 @@ int msg_to_mpoad(struct k_message *mesg, struct mpoa_client *mpc)
992 992
993 sk = sk_atm(mpc->mpoad_vcc); 993 sk = sk_atm(mpc->mpoad_vcc);
994 skb_queue_tail(&sk->sk_receive_queue, skb); 994 skb_queue_tail(&sk->sk_receive_queue, skb);
995 sk->sk_data_ready(sk, skb->len); 995 sk->sk_data_ready(sk);
996 996
997 return 0; 997 return 0;
998} 998}
@@ -1273,7 +1273,7 @@ static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry)
1273 1273
1274 sk = sk_atm(vcc); 1274 sk = sk_atm(vcc);
1275 skb_queue_tail(&sk->sk_receive_queue, skb); 1275 skb_queue_tail(&sk->sk_receive_queue, skb);
1276 sk->sk_data_ready(sk, skb->len); 1276 sk->sk_data_ready(sk);
1277 dprintk("exiting\n"); 1277 dprintk("exiting\n");
1278} 1278}
1279 1279
diff --git a/net/atm/raw.c b/net/atm/raw.c
index b4f7b9ff3c74..2e17e97a7a8b 100644
--- a/net/atm/raw.c
+++ b/net/atm/raw.c
@@ -25,7 +25,7 @@ static void atm_push_raw(struct atm_vcc *vcc, struct sk_buff *skb)
25 struct sock *sk = sk_atm(vcc); 25 struct sock *sk = sk_atm(vcc);
26 26
27 skb_queue_tail(&sk->sk_receive_queue, skb); 27 skb_queue_tail(&sk->sk_receive_queue, skb);
28 sk->sk_data_ready(sk, skb->len); 28 sk->sk_data_ready(sk);
29 } 29 }
30} 30}
31 31
diff --git a/net/atm/signaling.c b/net/atm/signaling.c
index 4176887e72eb..523bce72f698 100644
--- a/net/atm/signaling.c
+++ b/net/atm/signaling.c
@@ -51,7 +51,7 @@ static void sigd_put_skb(struct sk_buff *skb)
51#endif 51#endif
52 atm_force_charge(sigd, skb->truesize); 52 atm_force_charge(sigd, skb->truesize);
53 skb_queue_tail(&sk_atm(sigd)->sk_receive_queue, skb); 53 skb_queue_tail(&sk_atm(sigd)->sk_receive_queue, skb);
54 sk_atm(sigd)->sk_data_ready(sk_atm(sigd), skb->len); 54 sk_atm(sigd)->sk_data_ready(sk_atm(sigd));
55} 55}
56 56
57static void modify_qos(struct atm_vcc *vcc, struct atmsvc_msg *msg) 57static void modify_qos(struct atm_vcc *vcc, struct atmsvc_msg *msg)
diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index 96f4cab3a2f9..7ed8ab724819 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -422,7 +422,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
422 422
423 if (sk) { 423 if (sk) {
424 if (!sock_flag(sk, SOCK_DEAD)) 424 if (!sock_flag(sk, SOCK_DEAD))
425 sk->sk_data_ready(sk, skb->len); 425 sk->sk_data_ready(sk);
426 sock_put(sk); 426 sock_put(sk);
427 } else { 427 } else {
428free: 428free:
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index f59e00c2daa9..ef5e5b04f34f 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1271,7 +1271,7 @@ static void l2cap_sock_teardown_cb(struct l2cap_chan *chan, int err)
1271 1271
1272 if (parent) { 1272 if (parent) {
1273 bt_accept_unlink(sk); 1273 bt_accept_unlink(sk);
1274 parent->sk_data_ready(parent, 0); 1274 parent->sk_data_ready(parent);
1275 } else { 1275 } else {
1276 sk->sk_state_change(sk); 1276 sk->sk_state_change(sk);
1277 } 1277 }
@@ -1327,7 +1327,7 @@ static void l2cap_sock_ready_cb(struct l2cap_chan *chan)
1327 sk->sk_state_change(sk); 1327 sk->sk_state_change(sk);
1328 1328
1329 if (parent) 1329 if (parent)
1330 parent->sk_data_ready(parent, 0); 1330 parent->sk_data_ready(parent);
1331 1331
1332 release_sock(sk); 1332 release_sock(sk);
1333} 1333}
@@ -1340,7 +1340,7 @@ static void l2cap_sock_defer_cb(struct l2cap_chan *chan)
1340 1340
1341 parent = bt_sk(sk)->parent; 1341 parent = bt_sk(sk)->parent;
1342 if (parent) 1342 if (parent)
1343 parent->sk_data_ready(parent, 0); 1343 parent->sk_data_ready(parent);
1344 1344
1345 release_sock(sk); 1345 release_sock(sk);
1346} 1346}
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 633cceeb943e..cf620260affa 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -186,9 +186,9 @@ static void rfcomm_l2state_change(struct sock *sk)
186 rfcomm_schedule(); 186 rfcomm_schedule();
187} 187}
188 188
189static void rfcomm_l2data_ready(struct sock *sk, int bytes) 189static void rfcomm_l2data_ready(struct sock *sk)
190{ 190{
191 BT_DBG("%p bytes %d", sk, bytes); 191 BT_DBG("%p", sk);
192 rfcomm_schedule(); 192 rfcomm_schedule();
193} 193}
194 194
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index eabd25ab5ad9..c603a5eb4720 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -54,7 +54,7 @@ static void rfcomm_sk_data_ready(struct rfcomm_dlc *d, struct sk_buff *skb)
54 54
55 atomic_add(skb->len, &sk->sk_rmem_alloc); 55 atomic_add(skb->len, &sk->sk_rmem_alloc);
56 skb_queue_tail(&sk->sk_receive_queue, skb); 56 skb_queue_tail(&sk->sk_receive_queue, skb);
57 sk->sk_data_ready(sk, skb->len); 57 sk->sk_data_ready(sk);
58 58
59 if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf) 59 if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
60 rfcomm_dlc_throttle(d); 60 rfcomm_dlc_throttle(d);
@@ -84,7 +84,7 @@ static void rfcomm_sk_state_change(struct rfcomm_dlc *d, int err)
84 sock_set_flag(sk, SOCK_ZAPPED); 84 sock_set_flag(sk, SOCK_ZAPPED);
85 bt_accept_unlink(sk); 85 bt_accept_unlink(sk);
86 } 86 }
87 parent->sk_data_ready(parent, 0); 87 parent->sk_data_ready(parent);
88 } else { 88 } else {
89 if (d->state == BT_CONNECTED) 89 if (d->state == BT_CONNECTED)
90 rfcomm_session_getaddr(d->session, 90 rfcomm_session_getaddr(d->session,
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index ab1e6fcca4c5..c06dbd3938e8 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -1024,7 +1024,7 @@ static void sco_conn_ready(struct sco_conn *conn)
1024 sk->sk_state = BT_CONNECTED; 1024 sk->sk_state = BT_CONNECTED;
1025 1025
1026 /* Wake up parent */ 1026 /* Wake up parent */
1027 parent->sk_data_ready(parent, 1); 1027 parent->sk_data_ready(parent);
1028 1028
1029 bh_unlock_sock(parent); 1029 bh_unlock_sock(parent);
1030 1030
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index d0cca3c65f01..7985deaff52f 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -73,7 +73,7 @@ int br_handle_frame_finish(struct sk_buff *skb)
73 goto drop; 73 goto drop;
74 74
75 if (!br_allowed_ingress(p->br, nbp_get_vlan_info(p), skb, &vid)) 75 if (!br_allowed_ingress(p->br, nbp_get_vlan_info(p), skb, &vid))
76 goto drop; 76 goto out;
77 77
78 /* insert into forwarding database after filtering to avoid spoofing */ 78 /* insert into forwarding database after filtering to avoid spoofing */
79 br = p->br; 79 br = p->br;
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 91510712c7a7..4a3716102789 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -170,7 +170,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
170 * rejected. 170 * rejected.
171 */ 171 */
172 if (!v) 172 if (!v)
173 return false; 173 goto drop;
174 174
175 /* If vlan tx offload is disabled on bridge device and frame was 175 /* If vlan tx offload is disabled on bridge device and frame was
176 * sent from vlan device on the bridge device, it does not have 176 * sent from vlan device on the bridge device, it does not have
@@ -193,7 +193,7 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
193 * vlan untagged or priority-tagged traffic belongs to. 193 * vlan untagged or priority-tagged traffic belongs to.
194 */ 194 */
195 if (pvid == VLAN_N_VID) 195 if (pvid == VLAN_N_VID)
196 return false; 196 goto drop;
197 197
198 /* PVID is set on this port. Any untagged or priority-tagged 198 /* PVID is set on this port. Any untagged or priority-tagged
199 * ingress frame is considered to belong to this vlan. 199 * ingress frame is considered to belong to this vlan.
@@ -216,7 +216,8 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v,
216 /* Frame had a valid vlan tag. See if vlan is allowed */ 216 /* Frame had a valid vlan tag. See if vlan is allowed */
217 if (test_bit(*vid, v->vlan_bitmap)) 217 if (test_bit(*vid, v->vlan_bitmap))
218 return true; 218 return true;
219 219drop:
220 kfree_skb(skb);
220 return false; 221 return false;
221} 222}
222 223
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c
index d6be3edb7a43..e8437094d15f 100644
--- a/net/caif/caif_socket.c
+++ b/net/caif/caif_socket.c
@@ -124,7 +124,6 @@ static void caif_flow_ctrl(struct sock *sk, int mode)
124static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) 124static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
125{ 125{
126 int err; 126 int err;
127 int skb_len;
128 unsigned long flags; 127 unsigned long flags;
129 struct sk_buff_head *list = &sk->sk_receive_queue; 128 struct sk_buff_head *list = &sk->sk_receive_queue;
130 struct caifsock *cf_sk = container_of(sk, struct caifsock, sk); 129 struct caifsock *cf_sk = container_of(sk, struct caifsock, sk);
@@ -153,14 +152,13 @@ static int caif_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
153 * may be freed by other threads of control pulling packets 152 * may be freed by other threads of control pulling packets
154 * from the queue. 153 * from the queue.
155 */ 154 */
156 skb_len = skb->len;
157 spin_lock_irqsave(&list->lock, flags); 155 spin_lock_irqsave(&list->lock, flags);
158 if (!sock_flag(sk, SOCK_DEAD)) 156 if (!sock_flag(sk, SOCK_DEAD))
159 __skb_queue_tail(list, skb); 157 __skb_queue_tail(list, skb);
160 spin_unlock_irqrestore(&list->lock, flags); 158 spin_unlock_irqrestore(&list->lock, flags);
161 159
162 if (!sock_flag(sk, SOCK_DEAD)) 160 if (!sock_flag(sk, SOCK_DEAD))
163 sk->sk_data_ready(sk, skb_len); 161 sk->sk_data_ready(sk);
164 else 162 else
165 kfree_skb(skb); 163 kfree_skb(skb);
166 return 0; 164 return 0;
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 4f55f9ce63fa..dac7f9b98687 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -383,7 +383,7 @@ static void con_sock_state_closed(struct ceph_connection *con)
383 */ 383 */
384 384
385/* data available on socket, or listen socket received a connect */ 385/* data available on socket, or listen socket received a connect */
386static void ceph_sock_data_ready(struct sock *sk, int count_unused) 386static void ceph_sock_data_ready(struct sock *sk)
387{ 387{
388 struct ceph_connection *con = sk->sk_user_data; 388 struct ceph_connection *con = sk->sk_user_data;
389 if (atomic_read(&con->msgr->stopping)) { 389 if (atomic_read(&con->msgr->stopping)) {
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index d068ec25db1e..0304f981f7ff 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3338,7 +3338,9 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
3338 queue_map = skb_get_queue_mapping(pkt_dev->skb); 3338 queue_map = skb_get_queue_mapping(pkt_dev->skb);
3339 txq = netdev_get_tx_queue(odev, queue_map); 3339 txq = netdev_get_tx_queue(odev, queue_map);
3340 3340
3341 __netif_tx_lock_bh(txq); 3341 local_bh_disable();
3342
3343 HARD_TX_LOCK(odev, txq, smp_processor_id());
3342 3344
3343 if (unlikely(netif_xmit_frozen_or_drv_stopped(txq))) { 3345 if (unlikely(netif_xmit_frozen_or_drv_stopped(txq))) {
3344 ret = NETDEV_TX_BUSY; 3346 ret = NETDEV_TX_BUSY;
@@ -3374,7 +3376,9 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
3374 pkt_dev->last_ok = 0; 3376 pkt_dev->last_ok = 0;
3375 } 3377 }
3376unlock: 3378unlock:
3377 __netif_tx_unlock_bh(txq); 3379 HARD_TX_UNLOCK(odev, txq);
3380
3381 local_bh_enable();
3378 3382
3379 /* If pkt_dev->count is zero, then run forever */ 3383 /* If pkt_dev->count is zero, then run forever */
3380 if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) { 3384 if ((pkt_dev->count != 0) && (pkt_dev->sofar >= pkt_dev->count)) {
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 30c7d35dd862..1b62343f5837 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3458,8 +3458,6 @@ static void sock_rmem_free(struct sk_buff *skb)
3458 */ 3458 */
3459int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) 3459int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
3460{ 3460{
3461 int len = skb->len;
3462
3463 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= 3461 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
3464 (unsigned int)sk->sk_rcvbuf) 3462 (unsigned int)sk->sk_rcvbuf)
3465 return -ENOMEM; 3463 return -ENOMEM;
@@ -3474,7 +3472,7 @@ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
3474 3472
3475 skb_queue_tail(&sk->sk_error_queue, skb); 3473 skb_queue_tail(&sk->sk_error_queue, skb);
3476 if (!sock_flag(sk, SOCK_DEAD)) 3474 if (!sock_flag(sk, SOCK_DEAD))
3477 sk->sk_data_ready(sk, len); 3475 sk->sk_data_ready(sk);
3478 return 0; 3476 return 0;
3479} 3477}
3480EXPORT_SYMBOL(sock_queue_err_skb); 3478EXPORT_SYMBOL(sock_queue_err_skb);
@@ -3937,12 +3935,14 @@ EXPORT_SYMBOL_GPL(skb_scrub_packet);
3937unsigned int skb_gso_transport_seglen(const struct sk_buff *skb) 3935unsigned int skb_gso_transport_seglen(const struct sk_buff *skb)
3938{ 3936{
3939 const struct skb_shared_info *shinfo = skb_shinfo(skb); 3937 const struct skb_shared_info *shinfo = skb_shinfo(skb);
3940 unsigned int hdr_len;
3941 3938
3942 if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))) 3939 if (likely(shinfo->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)))
3943 hdr_len = tcp_hdrlen(skb); 3940 return tcp_hdrlen(skb) + shinfo->gso_size;
3944 else 3941
3945 hdr_len = sizeof(struct udphdr); 3942 /* UFO sets gso_size to the size of the fragmentation
3946 return hdr_len + shinfo->gso_size; 3943 * payload, i.e. the size of the L4 (UDP) header is already
3944 * accounted for.
3945 */
3946 return shinfo->gso_size;
3947} 3947}
3948EXPORT_SYMBOL_GPL(skb_gso_transport_seglen); 3948EXPORT_SYMBOL_GPL(skb_gso_transport_seglen);
diff --git a/net/core/sock.c b/net/core/sock.c
index c0fc6bdad1e3..b4fff008136f 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -428,7 +428,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
428 spin_unlock_irqrestore(&list->lock, flags); 428 spin_unlock_irqrestore(&list->lock, flags);
429 429
430 if (!sock_flag(sk, SOCK_DEAD)) 430 if (!sock_flag(sk, SOCK_DEAD))
431 sk->sk_data_ready(sk, skb_len); 431 sk->sk_data_ready(sk);
432 return 0; 432 return 0;
433} 433}
434EXPORT_SYMBOL(sock_queue_rcv_skb); 434EXPORT_SYMBOL(sock_queue_rcv_skb);
@@ -2196,7 +2196,7 @@ static void sock_def_error_report(struct sock *sk)
2196 rcu_read_unlock(); 2196 rcu_read_unlock();
2197} 2197}
2198 2198
2199static void sock_def_readable(struct sock *sk, int len) 2199static void sock_def_readable(struct sock *sk)
2200{ 2200{
2201 struct socket_wq *wq; 2201 struct socket_wq *wq;
2202 2202
diff --git a/net/dccp/input.c b/net/dccp/input.c
index 14cdafad7a90..3c8ec7d4a34e 100644
--- a/net/dccp/input.c
+++ b/net/dccp/input.c
@@ -28,7 +28,7 @@ static void dccp_enqueue_skb(struct sock *sk, struct sk_buff *skb)
28 __skb_pull(skb, dccp_hdr(skb)->dccph_doff * 4); 28 __skb_pull(skb, dccp_hdr(skb)->dccph_doff * 4);
29 __skb_queue_tail(&sk->sk_receive_queue, skb); 29 __skb_queue_tail(&sk->sk_receive_queue, skb);
30 skb_set_owner_r(skb, sk); 30 skb_set_owner_r(skb, sk);
31 sk->sk_data_ready(sk, 0); 31 sk->sk_data_ready(sk);
32} 32}
33 33
34static void dccp_fin(struct sock *sk, struct sk_buff *skb) 34static void dccp_fin(struct sock *sk, struct sk_buff *skb)
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c
index 9e2f78bc1553..c69eb9c4fbb8 100644
--- a/net/dccp/minisocks.c
+++ b/net/dccp/minisocks.c
@@ -237,7 +237,7 @@ int dccp_child_process(struct sock *parent, struct sock *child,
237 237
238 /* Wakeup parent, send SIGIO */ 238 /* Wakeup parent, send SIGIO */
239 if (state == DCCP_RESPOND && child->sk_state != state) 239 if (state == DCCP_RESPOND && child->sk_state != state)
240 parent->sk_data_ready(parent, 0); 240 parent->sk_data_ready(parent);
241 } else { 241 } else {
242 /* Alas, it is possible again, because we do lookup 242 /* Alas, it is possible again, because we do lookup
243 * in main socket hash table and lock on listening 243 * in main socket hash table and lock on listening
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c
index c344163e6ac0..fe5f01485d33 100644
--- a/net/decnet/dn_nsp_in.c
+++ b/net/decnet/dn_nsp_in.c
@@ -585,7 +585,6 @@ out:
585static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig, struct sk_buff_head *queue) 585static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig, struct sk_buff_head *queue)
586{ 586{
587 int err; 587 int err;
588 int skb_len;
589 588
590 /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces 589 /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
591 number of warnings when compiling with -W --ANK 590 number of warnings when compiling with -W --ANK
@@ -600,12 +599,11 @@ static __inline__ int dn_queue_skb(struct sock *sk, struct sk_buff *skb, int sig
600 if (err) 599 if (err)
601 goto out; 600 goto out;
602 601
603 skb_len = skb->len;
604 skb_set_owner_r(skb, sk); 602 skb_set_owner_r(skb, sk);
605 skb_queue_tail(queue, skb); 603 skb_queue_tail(queue, skb);
606 604
607 if (!sock_flag(sk, SOCK_DEAD)) 605 if (!sock_flag(sk, SOCK_DEAD))
608 sk->sk_data_ready(sk, skb_len); 606 sk->sk_data_ready(sk);
609out: 607out:
610 return err; 608 return err;
611} 609}
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index ec4f762efda5..94213c891565 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -463,6 +463,7 @@ static const struct net_device_ops ipgre_netdev_ops = {
463static void ipgre_tunnel_setup(struct net_device *dev) 463static void ipgre_tunnel_setup(struct net_device *dev)
464{ 464{
465 dev->netdev_ops = &ipgre_netdev_ops; 465 dev->netdev_ops = &ipgre_netdev_ops;
466 dev->type = ARPHRD_IPGRE;
466 ip_tunnel_setup(dev, ipgre_net_id); 467 ip_tunnel_setup(dev, ipgre_net_id);
467} 468}
468 469
@@ -501,7 +502,6 @@ static int ipgre_tunnel_init(struct net_device *dev)
501 memcpy(dev->dev_addr, &iph->saddr, 4); 502 memcpy(dev->dev_addr, &iph->saddr, 4);
502 memcpy(dev->broadcast, &iph->daddr, 4); 503 memcpy(dev->broadcast, &iph->daddr, 4);
503 504
504 dev->type = ARPHRD_IPGRE;
505 dev->flags = IFF_NOARP; 505 dev->flags = IFF_NOARP;
506 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; 506 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
507 dev->addr_len = 4; 507 dev->addr_len = 4;
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
index 687ddef4e574..afcee51b90ed 100644
--- a/net/ipv4/ip_vti.c
+++ b/net/ipv4/ip_vti.c
@@ -337,6 +337,7 @@ static const struct net_device_ops vti_netdev_ops = {
337static void vti_tunnel_setup(struct net_device *dev) 337static void vti_tunnel_setup(struct net_device *dev)
338{ 338{
339 dev->netdev_ops = &vti_netdev_ops; 339 dev->netdev_ops = &vti_netdev_ops;
340 dev->type = ARPHRD_TUNNEL;
340 ip_tunnel_setup(dev, vti_net_id); 341 ip_tunnel_setup(dev, vti_net_id);
341} 342}
342 343
@@ -348,7 +349,6 @@ static int vti_tunnel_init(struct net_device *dev)
348 memcpy(dev->dev_addr, &iph->saddr, 4); 349 memcpy(dev->dev_addr, &iph->saddr, 4);
349 memcpy(dev->broadcast, &iph->daddr, 4); 350 memcpy(dev->broadcast, &iph->daddr, 4);
350 351
351 dev->type = ARPHRD_TUNNEL;
352 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr); 352 dev->hard_header_len = LL_MAX_HEADER + sizeof(struct iphdr);
353 dev->mtu = ETH_DATA_LEN; 353 dev->mtu = ETH_DATA_LEN;
354 dev->flags = IFF_NOARP; 354 dev->flags = IFF_NOARP;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e1661f46fd19..d6b46eb2f94c 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4413,7 +4413,7 @@ queue_and_out:
4413 if (eaten > 0) 4413 if (eaten > 0)
4414 kfree_skb_partial(skb, fragstolen); 4414 kfree_skb_partial(skb, fragstolen);
4415 if (!sock_flag(sk, SOCK_DEAD)) 4415 if (!sock_flag(sk, SOCK_DEAD))
4416 sk->sk_data_ready(sk, 0); 4416 sk->sk_data_ready(sk);
4417 return; 4417 return;
4418 } 4418 }
4419 4419
@@ -4914,7 +4914,7 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *t
4914 BUG(); 4914 BUG();
4915 tp->urg_data = TCP_URG_VALID | tmp; 4915 tp->urg_data = TCP_URG_VALID | tmp;
4916 if (!sock_flag(sk, SOCK_DEAD)) 4916 if (!sock_flag(sk, SOCK_DEAD))
4917 sk->sk_data_ready(sk, 0); 4917 sk->sk_data_ready(sk);
4918 } 4918 }
4919 } 4919 }
4920} 4920}
@@ -5000,11 +5000,11 @@ static bool tcp_dma_try_early_copy(struct sock *sk, struct sk_buff *skb,
5000 (tcp_flag_word(tcp_hdr(skb)) & TCP_FLAG_PSH) || 5000 (tcp_flag_word(tcp_hdr(skb)) & TCP_FLAG_PSH) ||
5001 (atomic_read(&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >> 1))) { 5001 (atomic_read(&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >> 1))) {
5002 tp->ucopy.wakeup = 1; 5002 tp->ucopy.wakeup = 1;
5003 sk->sk_data_ready(sk, 0); 5003 sk->sk_data_ready(sk);
5004 } 5004 }
5005 } else if (chunk > 0) { 5005 } else if (chunk > 0) {
5006 tp->ucopy.wakeup = 1; 5006 tp->ucopy.wakeup = 1;
5007 sk->sk_data_ready(sk, 0); 5007 sk->sk_data_ready(sk);
5008 } 5008 }
5009out: 5009out:
5010 return copied_early; 5010 return copied_early;
@@ -5275,7 +5275,7 @@ no_ack:
5275#endif 5275#endif
5276 if (eaten) 5276 if (eaten)
5277 kfree_skb_partial(skb, fragstolen); 5277 kfree_skb_partial(skb, fragstolen);
5278 sk->sk_data_ready(sk, 0); 5278 sk->sk_data_ready(sk);
5279 return; 5279 return;
5280 } 5280 }
5281 } 5281 }
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 6379894ec210..438f3b95143d 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1434,7 +1434,7 @@ static int tcp_v4_conn_req_fastopen(struct sock *sk,
1434 tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; 1434 tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq;
1435 tp->syn_data_acked = 1; 1435 tp->syn_data_acked = 1;
1436 } 1436 }
1437 sk->sk_data_ready(sk, 0); 1437 sk->sk_data_ready(sk);
1438 bh_unlock_sock(child); 1438 bh_unlock_sock(child);
1439 sock_put(child); 1439 sock_put(child);
1440 WARN_ON(req->sk == NULL); 1440 WARN_ON(req->sk == NULL);
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index ca788ada5bd3..05c1b155251d 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -745,7 +745,7 @@ int tcp_child_process(struct sock *parent, struct sock *child,
745 skb->len); 745 skb->len);
746 /* Wakeup parent, send SIGIO */ 746 /* Wakeup parent, send SIGIO */
747 if (state == TCP_SYN_RECV && child->sk_state != state) 747 if (state == TCP_SYN_RECV && child->sk_state != state)
748 parent->sk_data_ready(parent, 0); 748 parent->sk_data_ready(parent);
749 } else { 749 } else {
750 /* Alas, it is possible again, because we do lookup 750 /* Alas, it is possible again, because we do lookup
751 * in main socket hash table and lock on listening 751 * in main socket hash table and lock on listening
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 5ca56cee2dae..e289830ed6e3 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -798,7 +798,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,
798 __tcp_v6_send_check(buff, &fl6.saddr, &fl6.daddr); 798 __tcp_v6_send_check(buff, &fl6.saddr, &fl6.daddr);
799 799
800 fl6.flowi6_proto = IPPROTO_TCP; 800 fl6.flowi6_proto = IPPROTO_TCP;
801 if (rt6_need_strict(&fl6.daddr) || !oif) 801 if (rt6_need_strict(&fl6.daddr) && !oif)
802 fl6.flowi6_oif = inet6_iif(skb); 802 fl6.flowi6_oif = inet6_iif(skb);
803 else 803 else
804 fl6.flowi6_oif = oif; 804 fl6.flowi6_oif = oif;
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index a5e03119107a..01e77b0ae075 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -1757,7 +1757,7 @@ static int iucv_callback_connreq(struct iucv_path *path,
1757 1757
1758 /* Wake up accept */ 1758 /* Wake up accept */
1759 nsk->sk_state = IUCV_CONNECTED; 1759 nsk->sk_state = IUCV_CONNECTED;
1760 sk->sk_data_ready(sk, 1); 1760 sk->sk_data_ready(sk);
1761 err = 0; 1761 err = 0;
1762fail: 1762fail:
1763 bh_unlock_sock(sk); 1763 bh_unlock_sock(sk);
@@ -1968,7 +1968,7 @@ static int afiucv_hs_callback_syn(struct sock *sk, struct sk_buff *skb)
1968 if (!err) { 1968 if (!err) {
1969 iucv_accept_enqueue(sk, nsk); 1969 iucv_accept_enqueue(sk, nsk);
1970 nsk->sk_state = IUCV_CONNECTED; 1970 nsk->sk_state = IUCV_CONNECTED;
1971 sk->sk_data_ready(sk, 1); 1971 sk->sk_data_ready(sk);
1972 } else 1972 } else
1973 iucv_sock_kill(nsk); 1973 iucv_sock_kill(nsk);
1974 bh_unlock_sock(sk); 1974 bh_unlock_sock(sk);
diff --git a/net/key/af_key.c b/net/key/af_key.c
index e72589a8400d..f3c83073afc4 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -205,7 +205,7 @@ static int pfkey_broadcast_one(struct sk_buff *skb, struct sk_buff **skb2,
205 if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) { 205 if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) {
206 skb_set_owner_r(*skb2, sk); 206 skb_set_owner_r(*skb2, sk);
207 skb_queue_tail(&sk->sk_receive_queue, *skb2); 207 skb_queue_tail(&sk->sk_receive_queue, *skb2);
208 sk->sk_data_ready(sk, (*skb2)->len); 208 sk->sk_data_ready(sk);
209 *skb2 = NULL; 209 *skb2 = NULL;
210 err = 0; 210 err = 0;
211 } 211 }
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index d276e2d4a589..950909f04ee6 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -753,9 +753,9 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
753 session->deref = pppol2tp_session_sock_put; 753 session->deref = pppol2tp_session_sock_put;
754 754
755 /* If PMTU discovery was enabled, use the MTU that was discovered */ 755 /* If PMTU discovery was enabled, use the MTU that was discovered */
756 dst = sk_dst_get(sk); 756 dst = sk_dst_get(tunnel->sock);
757 if (dst != NULL) { 757 if (dst != NULL) {
758 u32 pmtu = dst_mtu(__sk_dst_get(sk)); 758 u32 pmtu = dst_mtu(__sk_dst_get(tunnel->sock));
759 if (pmtu != 0) 759 if (pmtu != 0)
760 session->mtu = session->mru = pmtu - 760 session->mtu = session->mru = pmtu -
761 PPPOL2TP_HEADER_OVERHEAD; 761 PPPOL2TP_HEADER_OVERHEAD;
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index c2d585c4f7c5..894cda0206bb 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1653,7 +1653,7 @@ static int __netlink_sendskb(struct sock *sk, struct sk_buff *skb)
1653 else 1653 else
1654#endif /* CONFIG_NETLINK_MMAP */ 1654#endif /* CONFIG_NETLINK_MMAP */
1655 skb_queue_tail(&sk->sk_receive_queue, skb); 1655 skb_queue_tail(&sk->sk_receive_queue, skb);
1656 sk->sk_data_ready(sk, len); 1656 sk->sk_data_ready(sk);
1657 return len; 1657 return len;
1658} 1658}
1659 1659
@@ -2394,7 +2394,7 @@ out:
2394 return err ? : copied; 2394 return err ? : copied;
2395} 2395}
2396 2396
2397static void netlink_data_ready(struct sock *sk, int len) 2397static void netlink_data_ready(struct sock *sk)
2398{ 2398{
2399 BUG(); 2399 BUG();
2400} 2400}
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index b74aa0755521..ede50d197e10 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1011,7 +1011,7 @@ int nr_rx_frame(struct sk_buff *skb, struct net_device *dev)
1011 skb_queue_head(&sk->sk_receive_queue, skb); 1011 skb_queue_head(&sk->sk_receive_queue, skb);
1012 1012
1013 if (!sock_flag(sk, SOCK_DEAD)) 1013 if (!sock_flag(sk, SOCK_DEAD))
1014 sk->sk_data_ready(sk, skb->len); 1014 sk->sk_data_ready(sk);
1015 1015
1016 bh_unlock_sock(sk); 1016 bh_unlock_sock(sk);
1017 1017
diff --git a/net/nfc/llcp_core.c b/net/nfc/llcp_core.c
index b486f12ae243..b4671958fcf9 100644
--- a/net/nfc/llcp_core.c
+++ b/net/nfc/llcp_core.c
@@ -976,7 +976,7 @@ static void nfc_llcp_recv_connect(struct nfc_llcp_local *local,
976 new_sk->sk_state = LLCP_CONNECTED; 976 new_sk->sk_state = LLCP_CONNECTED;
977 977
978 /* Wake the listening processes */ 978 /* Wake the listening processes */
979 parent->sk_data_ready(parent, 0); 979 parent->sk_data_ready(parent);
980 980
981 /* Send CC */ 981 /* Send CC */
982 nfc_llcp_send_cc(new_sock); 982 nfc_llcp_send_cc(new_sock);
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 72e0c71fb01d..b85c67ccb797 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -1848,7 +1848,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev,
1848 skb->dropcount = atomic_read(&sk->sk_drops); 1848 skb->dropcount = atomic_read(&sk->sk_drops);
1849 __skb_queue_tail(&sk->sk_receive_queue, skb); 1849 __skb_queue_tail(&sk->sk_receive_queue, skb);
1850 spin_unlock(&sk->sk_receive_queue.lock); 1850 spin_unlock(&sk->sk_receive_queue.lock);
1851 sk->sk_data_ready(sk, skb->len); 1851 sk->sk_data_ready(sk);
1852 return 0; 1852 return 0;
1853 1853
1854drop_n_acct: 1854drop_n_acct:
@@ -2054,7 +2054,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,
2054 else 2054 else
2055 prb_clear_blk_fill_status(&po->rx_ring); 2055 prb_clear_blk_fill_status(&po->rx_ring);
2056 2056
2057 sk->sk_data_ready(sk, 0); 2057 sk->sk_data_ready(sk);
2058 2058
2059drop_n_restore: 2059drop_n_restore:
2060 if (skb_head != skb->data && skb_shared(skb)) { 2060 if (skb_head != skb->data && skb_shared(skb)) {
@@ -2069,7 +2069,7 @@ ring_is_full:
2069 po->stats.stats1.tp_drops++; 2069 po->stats.stats1.tp_drops++;
2070 spin_unlock(&sk->sk_receive_queue.lock); 2070 spin_unlock(&sk->sk_receive_queue.lock);
2071 2071
2072 sk->sk_data_ready(sk, 0); 2072 sk->sk_data_ready(sk);
2073 kfree_skb(copy_skb); 2073 kfree_skb(copy_skb);
2074 goto drop_n_restore; 2074 goto drop_n_restore;
2075} 2075}
diff --git a/net/phonet/pep-gprs.c b/net/phonet/pep-gprs.c
index a2fba7edfd1f..66dc65e7c6a1 100644
--- a/net/phonet/pep-gprs.c
+++ b/net/phonet/pep-gprs.c
@@ -37,7 +37,7 @@
37struct gprs_dev { 37struct gprs_dev {
38 struct sock *sk; 38 struct sock *sk;
39 void (*old_state_change)(struct sock *); 39 void (*old_state_change)(struct sock *);
40 void (*old_data_ready)(struct sock *, int); 40 void (*old_data_ready)(struct sock *);
41 void (*old_write_space)(struct sock *); 41 void (*old_write_space)(struct sock *);
42 42
43 struct net_device *dev; 43 struct net_device *dev;
@@ -146,7 +146,7 @@ drop:
146 return err; 146 return err;
147} 147}
148 148
149static void gprs_data_ready(struct sock *sk, int len) 149static void gprs_data_ready(struct sock *sk)
150{ 150{
151 struct gprs_dev *gp = sk->sk_user_data; 151 struct gprs_dev *gp = sk->sk_user_data;
152 struct sk_buff *skb; 152 struct sk_buff *skb;
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index e77411735de8..70a547ea5177 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -462,10 +462,9 @@ out:
462queue: 462queue:
463 skb->dev = NULL; 463 skb->dev = NULL;
464 skb_set_owner_r(skb, sk); 464 skb_set_owner_r(skb, sk);
465 err = skb->len;
466 skb_queue_tail(queue, skb); 465 skb_queue_tail(queue, skb);
467 if (!sock_flag(sk, SOCK_DEAD)) 466 if (!sock_flag(sk, SOCK_DEAD))
468 sk->sk_data_ready(sk, err); 467 sk->sk_data_ready(sk);
469 return NET_RX_SUCCESS; 468 return NET_RX_SUCCESS;
470} 469}
471 470
@@ -587,10 +586,9 @@ static int pipe_handler_do_rcv(struct sock *sk, struct sk_buff *skb)
587 pn->rx_credits--; 586 pn->rx_credits--;
588 skb->dev = NULL; 587 skb->dev = NULL;
589 skb_set_owner_r(skb, sk); 588 skb_set_owner_r(skb, sk);
590 err = skb->len;
591 skb_queue_tail(&sk->sk_receive_queue, skb); 589 skb_queue_tail(&sk->sk_receive_queue, skb);
592 if (!sock_flag(sk, SOCK_DEAD)) 590 if (!sock_flag(sk, SOCK_DEAD))
593 sk->sk_data_ready(sk, err); 591 sk->sk_data_ready(sk);
594 return NET_RX_SUCCESS; 592 return NET_RX_SUCCESS;
595 593
596 case PNS_PEP_CONNECT_RESP: 594 case PNS_PEP_CONNECT_RESP:
@@ -698,7 +696,7 @@ static int pep_do_rcv(struct sock *sk, struct sk_buff *skb)
698 skb_queue_head(&sk->sk_receive_queue, skb); 696 skb_queue_head(&sk->sk_receive_queue, skb);
699 sk_acceptq_added(sk); 697 sk_acceptq_added(sk);
700 if (!sock_flag(sk, SOCK_DEAD)) 698 if (!sock_flag(sk, SOCK_DEAD))
701 sk->sk_data_ready(sk, 0); 699 sk->sk_data_ready(sk);
702 return NET_RX_SUCCESS; 700 return NET_RX_SUCCESS;
703 701
704 case PNS_PEP_DISCONNECT_REQ: 702 case PNS_PEP_DISCONNECT_REQ:
diff --git a/net/rds/tcp.h b/net/rds/tcp.h
index 9cf2927d0021..65637491f728 100644
--- a/net/rds/tcp.h
+++ b/net/rds/tcp.h
@@ -61,12 +61,12 @@ void rds_tcp_state_change(struct sock *sk);
61/* tcp_listen.c */ 61/* tcp_listen.c */
62int rds_tcp_listen_init(void); 62int rds_tcp_listen_init(void);
63void rds_tcp_listen_stop(void); 63void rds_tcp_listen_stop(void);
64void rds_tcp_listen_data_ready(struct sock *sk, int bytes); 64void rds_tcp_listen_data_ready(struct sock *sk);
65 65
66/* tcp_recv.c */ 66/* tcp_recv.c */
67int rds_tcp_recv_init(void); 67int rds_tcp_recv_init(void);
68void rds_tcp_recv_exit(void); 68void rds_tcp_recv_exit(void);
69void rds_tcp_data_ready(struct sock *sk, int bytes); 69void rds_tcp_data_ready(struct sock *sk);
70int rds_tcp_recv(struct rds_connection *conn); 70int rds_tcp_recv(struct rds_connection *conn);
71void rds_tcp_inc_free(struct rds_incoming *inc); 71void rds_tcp_inc_free(struct rds_incoming *inc);
72int rds_tcp_inc_copy_to_user(struct rds_incoming *inc, struct iovec *iov, 72int rds_tcp_inc_copy_to_user(struct rds_incoming *inc, struct iovec *iov,
diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
index 7787537e9c2e..4e638f851185 100644
--- a/net/rds/tcp_listen.c
+++ b/net/rds/tcp_listen.c
@@ -108,9 +108,9 @@ static void rds_tcp_accept_worker(struct work_struct *work)
108 cond_resched(); 108 cond_resched();
109} 109}
110 110
111void rds_tcp_listen_data_ready(struct sock *sk, int bytes) 111void rds_tcp_listen_data_ready(struct sock *sk)
112{ 112{
113 void (*ready)(struct sock *sk, int bytes); 113 void (*ready)(struct sock *sk);
114 114
115 rdsdebug("listen data ready sk %p\n", sk); 115 rdsdebug("listen data ready sk %p\n", sk);
116 116
@@ -132,7 +132,7 @@ void rds_tcp_listen_data_ready(struct sock *sk, int bytes)
132 132
133out: 133out:
134 read_unlock(&sk->sk_callback_lock); 134 read_unlock(&sk->sk_callback_lock);
135 ready(sk, bytes); 135 ready(sk);
136} 136}
137 137
138int rds_tcp_listen_init(void) 138int rds_tcp_listen_init(void)
diff --git a/net/rds/tcp_recv.c b/net/rds/tcp_recv.c
index 4fac4f2bb9dc..9ae6e0a264ec 100644
--- a/net/rds/tcp_recv.c
+++ b/net/rds/tcp_recv.c
@@ -314,13 +314,13 @@ int rds_tcp_recv(struct rds_connection *conn)
314 return ret; 314 return ret;
315} 315}
316 316
317void rds_tcp_data_ready(struct sock *sk, int bytes) 317void rds_tcp_data_ready(struct sock *sk)
318{ 318{
319 void (*ready)(struct sock *sk, int bytes); 319 void (*ready)(struct sock *sk);
320 struct rds_connection *conn; 320 struct rds_connection *conn;
321 struct rds_tcp_connection *tc; 321 struct rds_tcp_connection *tc;
322 322
323 rdsdebug("data ready sk %p bytes %d\n", sk, bytes); 323 rdsdebug("data ready sk %p\n", sk);
324 324
325 read_lock(&sk->sk_callback_lock); 325 read_lock(&sk->sk_callback_lock);
326 conn = sk->sk_user_data; 326 conn = sk->sk_user_data;
@@ -337,7 +337,7 @@ void rds_tcp_data_ready(struct sock *sk, int bytes)
337 queue_delayed_work(rds_wq, &conn->c_recv_w, 0); 337 queue_delayed_work(rds_wq, &conn->c_recv_w, 0);
338out: 338out:
339 read_unlock(&sk->sk_callback_lock); 339 read_unlock(&sk->sk_callback_lock);
340 ready(sk, bytes); 340 ready(sk);
341} 341}
342 342
343int rds_tcp_recv_init(void) 343int rds_tcp_recv_init(void)
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
index c2cca2ee6aef..8451c8cdc9de 100644
--- a/net/rose/af_rose.c
+++ b/net/rose/af_rose.c
@@ -1041,7 +1041,7 @@ int rose_rx_call_request(struct sk_buff *skb, struct net_device *dev, struct ros
1041 rose_start_heartbeat(make); 1041 rose_start_heartbeat(make);
1042 1042
1043 if (!sock_flag(sk, SOCK_DEAD)) 1043 if (!sock_flag(sk, SOCK_DEAD))
1044 sk->sk_data_ready(sk, skb->len); 1044 sk->sk_data_ready(sk);
1045 1045
1046 return 1; 1046 return 1;
1047} 1047}
diff --git a/net/rxrpc/ar-input.c b/net/rxrpc/ar-input.c
index 73742647c135..63b21e580de9 100644
--- a/net/rxrpc/ar-input.c
+++ b/net/rxrpc/ar-input.c
@@ -113,7 +113,7 @@ int rxrpc_queue_rcv_skb(struct rxrpc_call *call, struct sk_buff *skb,
113 spin_unlock_bh(&sk->sk_receive_queue.lock); 113 spin_unlock_bh(&sk->sk_receive_queue.lock);
114 114
115 if (!sock_flag(sk, SOCK_DEAD)) 115 if (!sock_flag(sk, SOCK_DEAD))
116 sk->sk_data_ready(sk, skb_len); 116 sk->sk_data_ready(sk);
117 } 117 }
118 skb = NULL; 118 skb = NULL;
119 } else { 119 } else {
@@ -632,14 +632,14 @@ cant_find_conn:
632 * handle data received on the local endpoint 632 * handle data received on the local endpoint
633 * - may be called in interrupt context 633 * - may be called in interrupt context
634 */ 634 */
635void rxrpc_data_ready(struct sock *sk, int count) 635void rxrpc_data_ready(struct sock *sk)
636{ 636{
637 struct rxrpc_skb_priv *sp; 637 struct rxrpc_skb_priv *sp;
638 struct rxrpc_local *local; 638 struct rxrpc_local *local;
639 struct sk_buff *skb; 639 struct sk_buff *skb;
640 int ret; 640 int ret;
641 641
642 _enter("%p, %d", sk, count); 642 _enter("%p", sk);
643 643
644 ASSERT(!irqs_disabled()); 644 ASSERT(!irqs_disabled());
645 645
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index c831d44b0841..ba9fd36d3f15 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -518,7 +518,7 @@ void rxrpc_UDP_error_handler(struct work_struct *);
518 */ 518 */
519extern const char *rxrpc_pkts[]; 519extern const char *rxrpc_pkts[];
520 520
521void rxrpc_data_ready(struct sock *, int); 521void rxrpc_data_ready(struct sock *);
522int rxrpc_queue_rcv_skb(struct rxrpc_call *, struct sk_buff *, bool, bool); 522int rxrpc_queue_rcv_skb(struct rxrpc_call *, struct sk_buff *, bool, bool);
523void rxrpc_fast_process_packet(struct rxrpc_call *, struct sk_buff *); 523void rxrpc_fast_process_packet(struct rxrpc_call *, struct sk_buff *);
524 524
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 5f83a6a2fa67..e13519e9df80 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -6604,6 +6604,12 @@ static void sctp_wake_up_waiters(struct sock *sk,
6604 if (asoc->ep->sndbuf_policy) 6604 if (asoc->ep->sndbuf_policy)
6605 return __sctp_write_space(asoc); 6605 return __sctp_write_space(asoc);
6606 6606
6607 /* If association goes down and is just flushing its
6608 * outq, then just normally notify others.
6609 */
6610 if (asoc->base.dead)
6611 return sctp_write_space(sk);
6612
6607 /* Accounting for the sndbuf space is per socket, so we 6613 /* Accounting for the sndbuf space is per socket, so we
6608 * need to wake up others, try to be fair and in case of 6614 * need to wake up others, try to be fair and in case of
6609 * other associations, let them have a go first instead 6615 * other associations, let them have a go first instead
@@ -6739,7 +6745,7 @@ do_nonblock:
6739 goto out; 6745 goto out;
6740} 6746}
6741 6747
6742void sctp_data_ready(struct sock *sk, int len) 6748void sctp_data_ready(struct sock *sk)
6743{ 6749{
6744 struct socket_wq *wq; 6750 struct socket_wq *wq;
6745 6751
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index 5dc94117e9d4..7144eb6a1b95 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -259,7 +259,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
259 sctp_ulpq_clear_pd(ulpq); 259 sctp_ulpq_clear_pd(ulpq);
260 260
261 if (queue == &sk->sk_receive_queue) 261 if (queue == &sk->sk_receive_queue)
262 sk->sk_data_ready(sk, 0); 262 sk->sk_data_ready(sk);
263 return 1; 263 return 1;
264 264
265out_free: 265out_free:
@@ -1135,5 +1135,5 @@ void sctp_ulpq_abort_pd(struct sctp_ulpq *ulpq, gfp_t gfp)
1135 1135
1136 /* If there is data waiting, send it up the socket now. */ 1136 /* If there is data waiting, send it up the socket now. */
1137 if (sctp_ulpq_clear_pd(ulpq) || ev) 1137 if (sctp_ulpq_clear_pd(ulpq) || ev)
1138 sk->sk_data_ready(sk, 0); 1138 sk->sk_data_ready(sk);
1139} 1139}
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index d06cb8752dcd..43bcb4699d69 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -60,7 +60,7 @@
60 60
61static struct svc_sock *svc_setup_socket(struct svc_serv *, struct socket *, 61static struct svc_sock *svc_setup_socket(struct svc_serv *, struct socket *,
62 int flags); 62 int flags);
63static void svc_udp_data_ready(struct sock *, int); 63static void svc_udp_data_ready(struct sock *);
64static int svc_udp_recvfrom(struct svc_rqst *); 64static int svc_udp_recvfrom(struct svc_rqst *);
65static int svc_udp_sendto(struct svc_rqst *); 65static int svc_udp_sendto(struct svc_rqst *);
66static void svc_sock_detach(struct svc_xprt *); 66static void svc_sock_detach(struct svc_xprt *);
@@ -403,14 +403,14 @@ static void svc_sock_setbufsize(struct socket *sock, unsigned int snd,
403/* 403/*
404 * INET callback when data has been received on the socket. 404 * INET callback when data has been received on the socket.
405 */ 405 */
406static void svc_udp_data_ready(struct sock *sk, int count) 406static void svc_udp_data_ready(struct sock *sk)
407{ 407{
408 struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data; 408 struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data;
409 wait_queue_head_t *wq = sk_sleep(sk); 409 wait_queue_head_t *wq = sk_sleep(sk);
410 410
411 if (svsk) { 411 if (svsk) {
412 dprintk("svc: socket %p(inet %p), count=%d, busy=%d\n", 412 dprintk("svc: socket %p(inet %p), busy=%d\n",
413 svsk, sk, count, 413 svsk, sk,
414 test_bit(XPT_BUSY, &svsk->sk_xprt.xpt_flags)); 414 test_bit(XPT_BUSY, &svsk->sk_xprt.xpt_flags));
415 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); 415 set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags);
416 svc_xprt_enqueue(&svsk->sk_xprt); 416 svc_xprt_enqueue(&svsk->sk_xprt);
@@ -731,7 +731,7 @@ static void svc_udp_init(struct svc_sock *svsk, struct svc_serv *serv)
731 * A data_ready event on a listening socket means there's a connection 731 * A data_ready event on a listening socket means there's a connection
732 * pending. Do not use state_change as a substitute for it. 732 * pending. Do not use state_change as a substitute for it.
733 */ 733 */
734static void svc_tcp_listen_data_ready(struct sock *sk, int count_unused) 734static void svc_tcp_listen_data_ready(struct sock *sk)
735{ 735{
736 struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data; 736 struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data;
737 wait_queue_head_t *wq; 737 wait_queue_head_t *wq;
@@ -783,7 +783,7 @@ static void svc_tcp_state_change(struct sock *sk)
783 wake_up_interruptible_all(wq); 783 wake_up_interruptible_all(wq);
784} 784}
785 785
786static void svc_tcp_data_ready(struct sock *sk, int count) 786static void svc_tcp_data_ready(struct sock *sk)
787{ 787{
788 struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data; 788 struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data;
789 wait_queue_head_t *wq = sk_sleep(sk); 789 wait_queue_head_t *wq = sk_sleep(sk);
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 6735e1d1e9bb..25a3dcf15cae 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -254,7 +254,7 @@ struct sock_xprt {
254 /* 254 /*
255 * Saved socket callback addresses 255 * Saved socket callback addresses
256 */ 256 */
257 void (*old_data_ready)(struct sock *, int); 257 void (*old_data_ready)(struct sock *);
258 void (*old_state_change)(struct sock *); 258 void (*old_state_change)(struct sock *);
259 void (*old_write_space)(struct sock *); 259 void (*old_write_space)(struct sock *);
260 void (*old_error_report)(struct sock *); 260 void (*old_error_report)(struct sock *);
@@ -951,7 +951,7 @@ static int xs_local_copy_to_xdr(struct xdr_buf *xdr, struct sk_buff *skb)
951 * 951 *
952 * Currently this assumes we can read the whole reply in a single gulp. 952 * Currently this assumes we can read the whole reply in a single gulp.
953 */ 953 */
954static void xs_local_data_ready(struct sock *sk, int len) 954static void xs_local_data_ready(struct sock *sk)
955{ 955{
956 struct rpc_task *task; 956 struct rpc_task *task;
957 struct rpc_xprt *xprt; 957 struct rpc_xprt *xprt;
@@ -1014,7 +1014,7 @@ static void xs_local_data_ready(struct sock *sk, int len)
1014 * @len: how much data to read 1014 * @len: how much data to read
1015 * 1015 *
1016 */ 1016 */
1017static void xs_udp_data_ready(struct sock *sk, int len) 1017static void xs_udp_data_ready(struct sock *sk)
1018{ 1018{
1019 struct rpc_task *task; 1019 struct rpc_task *task;
1020 struct rpc_xprt *xprt; 1020 struct rpc_xprt *xprt;
@@ -1437,7 +1437,7 @@ static int xs_tcp_data_recv(read_descriptor_t *rd_desc, struct sk_buff *skb, uns
1437 * @bytes: how much data to read 1437 * @bytes: how much data to read
1438 * 1438 *
1439 */ 1439 */
1440static void xs_tcp_data_ready(struct sock *sk, int bytes) 1440static void xs_tcp_data_ready(struct sock *sk)
1441{ 1441{
1442 struct rpc_xprt *xprt; 1442 struct rpc_xprt *xprt;
1443 read_descriptor_t rd_desc; 1443 read_descriptor_t rd_desc;
diff --git a/net/tipc/server.c b/net/tipc/server.c
index 646a930eefbf..a538a02f869b 100644
--- a/net/tipc/server.c
+++ b/net/tipc/server.c
@@ -119,7 +119,7 @@ static struct tipc_conn *tipc_conn_lookup(struct tipc_server *s, int conid)
119 return con; 119 return con;
120} 120}
121 121
122static void sock_data_ready(struct sock *sk, int unused) 122static void sock_data_ready(struct sock *sk)
123{ 123{
124 struct tipc_conn *con; 124 struct tipc_conn *con;
125 125
@@ -297,7 +297,7 @@ static int tipc_accept_from_sock(struct tipc_conn *con)
297 newcon->usr_data = s->tipc_conn_new(newcon->conid); 297 newcon->usr_data = s->tipc_conn_new(newcon->conid);
298 298
299 /* Wake up receive process in case of 'SYN+' message */ 299 /* Wake up receive process in case of 'SYN+' message */
300 newsock->sk->sk_data_ready(newsock->sk, 0); 300 newsock->sk->sk_data_ready(newsock->sk);
301 return ret; 301 return ret;
302} 302}
303 303
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index adc12e227303..3c0256962f7d 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -45,7 +45,7 @@
45#define CONN_TIMEOUT_DEFAULT 8000 /* default connect timeout = 8s */ 45#define CONN_TIMEOUT_DEFAULT 8000 /* default connect timeout = 8s */
46 46
47static int backlog_rcv(struct sock *sk, struct sk_buff *skb); 47static int backlog_rcv(struct sock *sk, struct sk_buff *skb);
48static void tipc_data_ready(struct sock *sk, int len); 48static void tipc_data_ready(struct sock *sk);
49static void tipc_write_space(struct sock *sk); 49static void tipc_write_space(struct sock *sk);
50static int tipc_release(struct socket *sock); 50static int tipc_release(struct socket *sock);
51static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags); 51static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags);
@@ -1248,7 +1248,7 @@ static void tipc_write_space(struct sock *sk)
1248 * @sk: socket 1248 * @sk: socket
1249 * @len: the length of messages 1249 * @len: the length of messages
1250 */ 1250 */
1251static void tipc_data_ready(struct sock *sk, int len) 1251static void tipc_data_ready(struct sock *sk)
1252{ 1252{
1253 struct socket_wq *wq; 1253 struct socket_wq *wq;
1254 1254
@@ -1410,7 +1410,7 @@ static u32 filter_rcv(struct sock *sk, struct sk_buff *buf)
1410 __skb_queue_tail(&sk->sk_receive_queue, buf); 1410 __skb_queue_tail(&sk->sk_receive_queue, buf);
1411 skb_set_owner_r(buf, sk); 1411 skb_set_owner_r(buf, sk);
1412 1412
1413 sk->sk_data_ready(sk, 0); 1413 sk->sk_data_ready(sk);
1414 return TIPC_OK; 1414 return TIPC_OK;
1415} 1415}
1416 1416
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 94404f19f9de..bb7e8ba821f4 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1217,7 +1217,7 @@ restart:
1217 __skb_queue_tail(&other->sk_receive_queue, skb); 1217 __skb_queue_tail(&other->sk_receive_queue, skb);
1218 spin_unlock(&other->sk_receive_queue.lock); 1218 spin_unlock(&other->sk_receive_queue.lock);
1219 unix_state_unlock(other); 1219 unix_state_unlock(other);
1220 other->sk_data_ready(other, 0); 1220 other->sk_data_ready(other);
1221 sock_put(other); 1221 sock_put(other);
1222 return 0; 1222 return 0;
1223 1223
@@ -1600,7 +1600,7 @@ restart:
1600 if (max_level > unix_sk(other)->recursion_level) 1600 if (max_level > unix_sk(other)->recursion_level)
1601 unix_sk(other)->recursion_level = max_level; 1601 unix_sk(other)->recursion_level = max_level;
1602 unix_state_unlock(other); 1602 unix_state_unlock(other);
1603 other->sk_data_ready(other, len); 1603 other->sk_data_ready(other);
1604 sock_put(other); 1604 sock_put(other);
1605 scm_destroy(siocb->scm); 1605 scm_destroy(siocb->scm);
1606 return len; 1606 return len;
@@ -1706,7 +1706,7 @@ static int unix_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
1706 if (max_level > unix_sk(other)->recursion_level) 1706 if (max_level > unix_sk(other)->recursion_level)
1707 unix_sk(other)->recursion_level = max_level; 1707 unix_sk(other)->recursion_level = max_level;
1708 unix_state_unlock(other); 1708 unix_state_unlock(other);
1709 other->sk_data_ready(other, size); 1709 other->sk_data_ready(other);
1710 sent += size; 1710 sent += size;
1711 } 1711 }
1712 1712
diff --git a/net/vmw_vsock/vmci_transport_notify.c b/net/vmw_vsock/vmci_transport_notify.c
index 9a730744e7bc..9b7f207f2bee 100644
--- a/net/vmw_vsock/vmci_transport_notify.c
+++ b/net/vmw_vsock/vmci_transport_notify.c
@@ -315,7 +315,7 @@ vmci_transport_handle_wrote(struct sock *sk,
315 struct vsock_sock *vsk = vsock_sk(sk); 315 struct vsock_sock *vsk = vsock_sk(sk);
316 PKT_FIELD(vsk, sent_waiting_read) = false; 316 PKT_FIELD(vsk, sent_waiting_read) = false;
317#endif 317#endif
318 sk->sk_data_ready(sk, 0); 318 sk->sk_data_ready(sk);
319} 319}
320 320
321static void vmci_transport_notify_pkt_socket_init(struct sock *sk) 321static void vmci_transport_notify_pkt_socket_init(struct sock *sk)
diff --git a/net/vmw_vsock/vmci_transport_notify_qstate.c b/net/vmw_vsock/vmci_transport_notify_qstate.c
index 622bd7aa1016..dc9c7929a2f9 100644
--- a/net/vmw_vsock/vmci_transport_notify_qstate.c
+++ b/net/vmw_vsock/vmci_transport_notify_qstate.c
@@ -92,7 +92,7 @@ vmci_transport_handle_wrote(struct sock *sk,
92 bool bottom_half, 92 bool bottom_half,
93 struct sockaddr_vm *dst, struct sockaddr_vm *src) 93 struct sockaddr_vm *dst, struct sockaddr_vm *src)
94{ 94{
95 sk->sk_data_ready(sk, 0); 95 sk->sk_data_ready(sk);
96} 96}
97 97
98static void vsock_block_update_write_window(struct sock *sk) 98static void vsock_block_update_write_window(struct sock *sk)
@@ -290,7 +290,7 @@ vmci_transport_notify_pkt_recv_post_dequeue(
290 /* See the comment in 290 /* See the comment in
291 * vmci_transport_notify_pkt_send_post_enqueue(). 291 * vmci_transport_notify_pkt_send_post_enqueue().
292 */ 292 */
293 sk->sk_data_ready(sk, 0); 293 sk->sk_data_ready(sk);
294 } 294 }
295 295
296 return err; 296 return err;
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 6177479c7de9..5ad4418ef093 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1064,7 +1064,7 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,
1064 x25_start_heartbeat(make); 1064 x25_start_heartbeat(make);
1065 1065
1066 if (!sock_flag(sk, SOCK_DEAD)) 1066 if (!sock_flag(sk, SOCK_DEAD))
1067 sk->sk_data_ready(sk, skb->len); 1067 sk->sk_data_ready(sk);
1068 rc = 1; 1068 rc = 1;
1069 sock_put(sk); 1069 sock_put(sk);
1070out: 1070out:
diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c
index d1b0dc79bb6f..7ac50098a375 100644
--- a/net/x25/x25_in.c
+++ b/net/x25/x25_in.c
@@ -79,7 +79,7 @@ static int x25_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
79 skb_set_owner_r(skbn, sk); 79 skb_set_owner_r(skbn, sk);
80 skb_queue_tail(&sk->sk_receive_queue, skbn); 80 skb_queue_tail(&sk->sk_receive_queue, skbn);
81 if (!sock_flag(sk, SOCK_DEAD)) 81 if (!sock_flag(sk, SOCK_DEAD))
82 sk->sk_data_ready(sk, skbn->len); 82 sk->sk_data_ready(sk);
83 83
84 return 0; 84 return 0;
85} 85}