diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-09 13:23:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-09 13:23:43 -0400 |
commit | ea44083a7081ac8d9cc84d49525e6041025a7a17 (patch) | |
tree | d2ff5f2d3ea257a3386cfcf7073c2bffa6bdce56 | |
parent | e15e6119062d20cc96f95c8b345e361589a90244 (diff) | |
parent | 4f924b2aa4d3cb30f07e57d6b608838edcbc0d88 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking update from David Miller:
1) Propagate return error values properly in irda, spider_net, sfc, and
bfin_mac. From Wei Yongjun.
2) Fix fec driver OOPS on rapid link up/down, from Frank Li.
3) FIX VF resource allocation and chip message payload length errors in
be2net driver, from Sathya Perla.
4) Fix inner protocol inspection during GSO from Pravin B Shelar.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
if_cablemodem.h: Add parenthesis around ioctl macros
gso: Handle Trans-Ether-Bridging protocol in skb_network_protocol()
net: fec: fix kernel oops when plug/unplug cable many times
bfin_mac: fix error return code in bfin_mac_probe()
sfc: fix return value check in efx_ptp_probe_channel()
net/spider_net: fix error return code in spider_net_open()
net/irda: fix error return code in bfin_sir_open()
net: of_mdio: fix behavior on missing phy device
sierra_net: keep status interrupt URB active
usbnet: allow status interrupt URB to always be active
qmi_wwan/cdc_ether: add device IDs for Dell 5804 (Novatel E371) WWAN card
be2net: disable TX in be_close()
be2net: fix EQ from getting full while cleaning RX CQ
be2net: fix payload_len value for GET_MAC_LIST cmd req
be2net: provision VF resources before enabling SR-IOV
-rw-r--r-- | drivers/net/ethernet/adi/bfin_mac.c | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 30 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fec.h | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 44 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/ptp.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/toshiba/spider_net.c | 3 | ||||
-rw-r--r-- | drivers/net/irda/bfin_sir.c | 6 | ||||
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 7 | ||||
-rw-r--r-- | drivers/net/usb/qmi_wwan.c | 7 | ||||
-rw-r--r-- | drivers/net/usb/sierra_net.c | 38 | ||||
-rw-r--r-- | drivers/net/usb/usbnet.c | 77 | ||||
-rw-r--r-- | drivers/of/of_mdio.c | 11 | ||||
-rw-r--r-- | include/linux/usb/usbnet.h | 5 | ||||
-rw-r--r-- | include/uapi/linux/if_cablemodem.h | 12 | ||||
-rw-r--r-- | net/core/dev.c | 11 | ||||
-rw-r--r-- | net/ipv4/gre.c | 8 | ||||
-rw-r--r-- | net/ipv4/udp.c | 4 |
18 files changed, 212 insertions, 73 deletions
diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c index ee705771bd2c..dada66bfe0d6 100644 --- a/drivers/net/ethernet/adi/bfin_mac.c +++ b/drivers/net/ethernet/adi/bfin_mac.c | |||
@@ -1700,7 +1700,8 @@ static int bfin_mac_probe(struct platform_device *pdev) | |||
1700 | } | 1700 | } |
1701 | 1701 | ||
1702 | bfin_mac_hwtstamp_init(ndev); | 1702 | bfin_mac_hwtstamp_init(ndev); |
1703 | if (bfin_phc_init(ndev, &pdev->dev)) { | 1703 | rc = bfin_phc_init(ndev, &pdev->dev); |
1704 | if (rc) { | ||
1704 | dev_err(&pdev->dev, "Cannot register PHC device!\n"); | 1705 | dev_err(&pdev->dev, "Cannot register PHC device!\n"); |
1705 | goto out_err_phc; | 1706 | goto out_err_phc; |
1706 | } | 1707 | } |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index e1e5bb9d9054..fd7b547698ab 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -2640,9 +2640,8 @@ int be_cmd_get_mac_from_list(struct be_adapter *adapter, u8 *mac, | |||
2640 | req = get_mac_list_cmd.va; | 2640 | req = get_mac_list_cmd.va; |
2641 | 2641 | ||
2642 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | 2642 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, |
2643 | OPCODE_COMMON_GET_MAC_LIST, sizeof(*req), | 2643 | OPCODE_COMMON_GET_MAC_LIST, |
2644 | wrb, &get_mac_list_cmd); | 2644 | get_mac_list_cmd.size, wrb, &get_mac_list_cmd); |
2645 | |||
2646 | req->hdr.domain = domain; | 2645 | req->hdr.domain = domain; |
2647 | req->mac_type = MAC_ADDRESS_TYPE_NETWORK; | 2646 | req->mac_type = MAC_ADDRESS_TYPE_NETWORK; |
2648 | req->perm_override = 1; | 2647 | req->perm_override = 1; |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 6c52a60dcdb7..a444110b060f 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -1827,7 +1827,7 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo) | |||
1827 | mdelay(1); | 1827 | mdelay(1); |
1828 | } else { | 1828 | } else { |
1829 | be_rx_compl_discard(rxo, rxcp); | 1829 | be_rx_compl_discard(rxo, rxcp); |
1830 | be_cq_notify(adapter, rx_cq->id, true, 1); | 1830 | be_cq_notify(adapter, rx_cq->id, false, 1); |
1831 | if (rxcp->num_rcvd == 0) | 1831 | if (rxcp->num_rcvd == 0) |
1832 | break; | 1832 | break; |
1833 | } | 1833 | } |
@@ -2533,11 +2533,6 @@ static void be_rx_qs_destroy(struct be_adapter *adapter) | |||
2533 | q = &rxo->q; | 2533 | q = &rxo->q; |
2534 | if (q->created) { | 2534 | if (q->created) { |
2535 | be_cmd_rxq_destroy(adapter, q); | 2535 | be_cmd_rxq_destroy(adapter, q); |
2536 | /* After the rxq is invalidated, wait for a grace time | ||
2537 | * of 1ms for all dma to end and the flush compl to | ||
2538 | * arrive | ||
2539 | */ | ||
2540 | mdelay(1); | ||
2541 | be_rx_cq_clean(rxo); | 2536 | be_rx_cq_clean(rxo); |
2542 | } | 2537 | } |
2543 | be_queue_free(adapter, q); | 2538 | be_queue_free(adapter, q); |
@@ -2564,6 +2559,7 @@ static int be_close(struct net_device *netdev) | |||
2564 | * all tx skbs are freed. | 2559 | * all tx skbs are freed. |
2565 | */ | 2560 | */ |
2566 | be_tx_compl_clean(adapter); | 2561 | be_tx_compl_clean(adapter); |
2562 | netif_tx_disable(netdev); | ||
2567 | 2563 | ||
2568 | be_rx_qs_destroy(adapter); | 2564 | be_rx_qs_destroy(adapter); |
2569 | 2565 | ||
@@ -2672,6 +2668,7 @@ static int be_open(struct net_device *netdev) | |||
2672 | if (!status) | 2668 | if (!status) |
2673 | be_link_status_update(adapter, link_status); | 2669 | be_link_status_update(adapter, link_status); |
2674 | 2670 | ||
2671 | netif_tx_start_all_queues(netdev); | ||
2675 | be_roce_dev_open(adapter); | 2672 | be_roce_dev_open(adapter); |
2676 | return 0; | 2673 | return 0; |
2677 | err: | 2674 | err: |
@@ -2783,6 +2780,8 @@ static void be_vf_clear(struct be_adapter *adapter) | |||
2783 | goto done; | 2780 | goto done; |
2784 | } | 2781 | } |
2785 | 2782 | ||
2783 | pci_disable_sriov(adapter->pdev); | ||
2784 | |||
2786 | for_all_vfs(adapter, vf_cfg, vf) { | 2785 | for_all_vfs(adapter, vf_cfg, vf) { |
2787 | if (lancer_chip(adapter)) | 2786 | if (lancer_chip(adapter)) |
2788 | be_cmd_set_mac_list(adapter, NULL, 0, vf + 1); | 2787 | be_cmd_set_mac_list(adapter, NULL, 0, vf + 1); |
@@ -2792,7 +2791,6 @@ static void be_vf_clear(struct be_adapter *adapter) | |||
2792 | 2791 | ||
2793 | be_cmd_if_destroy(adapter, vf_cfg->if_handle, vf + 1); | 2792 | be_cmd_if_destroy(adapter, vf_cfg->if_handle, vf + 1); |
2794 | } | 2793 | } |
2795 | pci_disable_sriov(adapter->pdev); | ||
2796 | done: | 2794 | done: |
2797 | kfree(adapter->vf_cfg); | 2795 | kfree(adapter->vf_cfg); |
2798 | adapter->num_vfs = 0; | 2796 | adapter->num_vfs = 0; |
@@ -2889,13 +2887,8 @@ static int be_vf_setup(struct be_adapter *adapter) | |||
2889 | dev_info(dev, "Device supports %d VFs and not %d\n", | 2887 | dev_info(dev, "Device supports %d VFs and not %d\n", |
2890 | adapter->dev_num_vfs, num_vfs); | 2888 | adapter->dev_num_vfs, num_vfs); |
2891 | adapter->num_vfs = min_t(u16, num_vfs, adapter->dev_num_vfs); | 2889 | adapter->num_vfs = min_t(u16, num_vfs, adapter->dev_num_vfs); |
2892 | 2890 | if (!adapter->num_vfs) | |
2893 | status = pci_enable_sriov(adapter->pdev, num_vfs); | ||
2894 | if (status) { | ||
2895 | dev_err(dev, "SRIOV enable failed\n"); | ||
2896 | adapter->num_vfs = 0; | ||
2897 | return 0; | 2891 | return 0; |
2898 | } | ||
2899 | } | 2892 | } |
2900 | 2893 | ||
2901 | status = be_vf_setup_init(adapter); | 2894 | status = be_vf_setup_init(adapter); |
@@ -2944,6 +2937,15 @@ static int be_vf_setup(struct be_adapter *adapter) | |||
2944 | 2937 | ||
2945 | be_cmd_enable_vf(adapter, vf + 1); | 2938 | be_cmd_enable_vf(adapter, vf + 1); |
2946 | } | 2939 | } |
2940 | |||
2941 | if (!old_vfs) { | ||
2942 | status = pci_enable_sriov(adapter->pdev, adapter->num_vfs); | ||
2943 | if (status) { | ||
2944 | dev_err(dev, "SRIOV enable failed\n"); | ||
2945 | adapter->num_vfs = 0; | ||
2946 | goto err; | ||
2947 | } | ||
2948 | } | ||
2947 | return 0; | 2949 | return 0; |
2948 | err: | 2950 | err: |
2949 | dev_err(dev, "VF setup failed\n"); | 2951 | dev_err(dev, "VF setup failed\n"); |
@@ -3198,7 +3200,7 @@ static int be_setup(struct be_adapter *adapter) | |||
3198 | be_cmd_set_flow_control(adapter, adapter->tx_fc, | 3200 | be_cmd_set_flow_control(adapter, adapter->tx_fc, |
3199 | adapter->rx_fc); | 3201 | adapter->rx_fc); |
3200 | 3202 | ||
3201 | if (be_physfn(adapter) && num_vfs) { | 3203 | if (be_physfn(adapter)) { |
3202 | if (adapter->dev_num_vfs) | 3204 | if (adapter->dev_num_vfs) |
3203 | be_vf_setup(adapter); | 3205 | be_vf_setup(adapter); |
3204 | else | 3206 | else |
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index ceb4d43c132d..9ce5b7185fda 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h | |||
@@ -198,6 +198,11 @@ struct bufdesc_ex { | |||
198 | #define FLAG_RX_CSUM_ENABLED (BD_ENET_RX_ICE | BD_ENET_RX_PCR) | 198 | #define FLAG_RX_CSUM_ENABLED (BD_ENET_RX_ICE | BD_ENET_RX_PCR) |
199 | #define FLAG_RX_CSUM_ERROR (BD_ENET_RX_ICE | BD_ENET_RX_PCR) | 199 | #define FLAG_RX_CSUM_ERROR (BD_ENET_RX_ICE | BD_ENET_RX_PCR) |
200 | 200 | ||
201 | struct fec_enet_delayed_work { | ||
202 | struct delayed_work delay_work; | ||
203 | bool timeout; | ||
204 | }; | ||
205 | |||
201 | /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and | 206 | /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and |
202 | * tx_bd_base always point to the base of the buffer descriptors. The | 207 | * tx_bd_base always point to the base of the buffer descriptors. The |
203 | * cur_rx and cur_tx point to the currently available buffer. | 208 | * cur_rx and cur_tx point to the currently available buffer. |
@@ -232,9 +237,6 @@ struct fec_enet_private { | |||
232 | /* The ring entries to be free()ed */ | 237 | /* The ring entries to be free()ed */ |
233 | struct bufdesc *dirty_tx; | 238 | struct bufdesc *dirty_tx; |
234 | 239 | ||
235 | /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */ | ||
236 | spinlock_t hw_lock; | ||
237 | |||
238 | struct platform_device *pdev; | 240 | struct platform_device *pdev; |
239 | 241 | ||
240 | int opened; | 242 | int opened; |
@@ -269,7 +271,7 @@ struct fec_enet_private { | |||
269 | int hwts_rx_en; | 271 | int hwts_rx_en; |
270 | int hwts_tx_en; | 272 | int hwts_tx_en; |
271 | struct timer_list time_keep; | 273 | struct timer_list time_keep; |
272 | 274 | struct fec_enet_delayed_work delay_work; | |
273 | }; | 275 | }; |
274 | 276 | ||
275 | void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev); | 277 | void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev); |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index e25bf832e6b3..aff0310a778b 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -445,6 +445,13 @@ fec_restart(struct net_device *ndev, int duplex) | |||
445 | u32 rcntl = OPT_FRAME_SIZE | 0x04; | 445 | u32 rcntl = OPT_FRAME_SIZE | 0x04; |
446 | u32 ecntl = 0x2; /* ETHEREN */ | 446 | u32 ecntl = 0x2; /* ETHEREN */ |
447 | 447 | ||
448 | if (netif_running(ndev)) { | ||
449 | netif_device_detach(ndev); | ||
450 | napi_disable(&fep->napi); | ||
451 | netif_stop_queue(ndev); | ||
452 | netif_tx_lock(ndev); | ||
453 | } | ||
454 | |||
448 | /* Whack a reset. We should wait for this. */ | 455 | /* Whack a reset. We should wait for this. */ |
449 | writel(1, fep->hwp + FEC_ECNTRL); | 456 | writel(1, fep->hwp + FEC_ECNTRL); |
450 | udelay(10); | 457 | udelay(10); |
@@ -605,6 +612,13 @@ fec_restart(struct net_device *ndev, int duplex) | |||
605 | 612 | ||
606 | /* Enable interrupts we wish to service */ | 613 | /* Enable interrupts we wish to service */ |
607 | writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); | 614 | writel(FEC_DEFAULT_IMASK, fep->hwp + FEC_IMASK); |
615 | |||
616 | if (netif_running(ndev)) { | ||
617 | netif_device_attach(ndev); | ||
618 | napi_enable(&fep->napi); | ||
619 | netif_wake_queue(ndev); | ||
620 | netif_tx_unlock(ndev); | ||
621 | } | ||
608 | } | 622 | } |
609 | 623 | ||
610 | static void | 624 | static void |
@@ -644,8 +658,22 @@ fec_timeout(struct net_device *ndev) | |||
644 | 658 | ||
645 | ndev->stats.tx_errors++; | 659 | ndev->stats.tx_errors++; |
646 | 660 | ||
647 | fec_restart(ndev, fep->full_duplex); | 661 | fep->delay_work.timeout = true; |
648 | netif_wake_queue(ndev); | 662 | schedule_delayed_work(&(fep->delay_work.delay_work), 0); |
663 | } | ||
664 | |||
665 | static void fec_enet_work(struct work_struct *work) | ||
666 | { | ||
667 | struct fec_enet_private *fep = | ||
668 | container_of(work, | ||
669 | struct fec_enet_private, | ||
670 | delay_work.delay_work.work); | ||
671 | |||
672 | if (fep->delay_work.timeout) { | ||
673 | fep->delay_work.timeout = false; | ||
674 | fec_restart(fep->netdev, fep->full_duplex); | ||
675 | netif_wake_queue(fep->netdev); | ||
676 | } | ||
649 | } | 677 | } |
650 | 678 | ||
651 | static void | 679 | static void |
@@ -1024,16 +1052,12 @@ static void fec_enet_adjust_link(struct net_device *ndev) | |||
1024 | { | 1052 | { |
1025 | struct fec_enet_private *fep = netdev_priv(ndev); | 1053 | struct fec_enet_private *fep = netdev_priv(ndev); |
1026 | struct phy_device *phy_dev = fep->phy_dev; | 1054 | struct phy_device *phy_dev = fep->phy_dev; |
1027 | unsigned long flags; | ||
1028 | |||
1029 | int status_change = 0; | 1055 | int status_change = 0; |
1030 | 1056 | ||
1031 | spin_lock_irqsave(&fep->hw_lock, flags); | ||
1032 | |||
1033 | /* Prevent a state halted on mii error */ | 1057 | /* Prevent a state halted on mii error */ |
1034 | if (fep->mii_timeout && phy_dev->state == PHY_HALTED) { | 1058 | if (fep->mii_timeout && phy_dev->state == PHY_HALTED) { |
1035 | phy_dev->state = PHY_RESUMING; | 1059 | phy_dev->state = PHY_RESUMING; |
1036 | goto spin_unlock; | 1060 | return; |
1037 | } | 1061 | } |
1038 | 1062 | ||
1039 | if (phy_dev->link) { | 1063 | if (phy_dev->link) { |
@@ -1061,9 +1085,6 @@ static void fec_enet_adjust_link(struct net_device *ndev) | |||
1061 | } | 1085 | } |
1062 | } | 1086 | } |
1063 | 1087 | ||
1064 | spin_unlock: | ||
1065 | spin_unlock_irqrestore(&fep->hw_lock, flags); | ||
1066 | |||
1067 | if (status_change) | 1088 | if (status_change) |
1068 | phy_print_status(phy_dev); | 1089 | phy_print_status(phy_dev); |
1069 | } | 1090 | } |
@@ -1732,7 +1753,6 @@ static int fec_enet_init(struct net_device *ndev) | |||
1732 | return -ENOMEM; | 1753 | return -ENOMEM; |
1733 | 1754 | ||
1734 | memset(cbd_base, 0, PAGE_SIZE); | 1755 | memset(cbd_base, 0, PAGE_SIZE); |
1735 | spin_lock_init(&fep->hw_lock); | ||
1736 | 1756 | ||
1737 | fep->netdev = ndev; | 1757 | fep->netdev = ndev; |
1738 | 1758 | ||
@@ -1952,6 +1972,7 @@ fec_probe(struct platform_device *pdev) | |||
1952 | if (fep->bufdesc_ex && fep->ptp_clock) | 1972 | if (fep->bufdesc_ex && fep->ptp_clock) |
1953 | netdev_info(ndev, "registered PHC device %d\n", fep->dev_id); | 1973 | netdev_info(ndev, "registered PHC device %d\n", fep->dev_id); |
1954 | 1974 | ||
1975 | INIT_DELAYED_WORK(&(fep->delay_work.delay_work), fec_enet_work); | ||
1955 | return 0; | 1976 | return 0; |
1956 | 1977 | ||
1957 | failed_register: | 1978 | failed_register: |
@@ -1984,6 +2005,7 @@ fec_drv_remove(struct platform_device *pdev) | |||
1984 | struct fec_enet_private *fep = netdev_priv(ndev); | 2005 | struct fec_enet_private *fep = netdev_priv(ndev); |
1985 | int i; | 2006 | int i; |
1986 | 2007 | ||
2008 | cancel_delayed_work_sync(&(fep->delay_work.delay_work)); | ||
1987 | unregister_netdev(ndev); | 2009 | unregister_netdev(ndev); |
1988 | fec_enet_mii_remove(fep); | 2010 | fec_enet_mii_remove(fep); |
1989 | del_timer_sync(&fep->time_keep); | 2011 | del_timer_sync(&fep->time_keep); |
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c index 07f6baa15c0c..9a95abf2dedf 100644 --- a/drivers/net/ethernet/sfc/ptp.c +++ b/drivers/net/ethernet/sfc/ptp.c | |||
@@ -912,8 +912,10 @@ static int efx_ptp_probe_channel(struct efx_channel *channel) | |||
912 | 912 | ||
913 | ptp->phc_clock = ptp_clock_register(&ptp->phc_clock_info, | 913 | ptp->phc_clock = ptp_clock_register(&ptp->phc_clock_info, |
914 | &efx->pci_dev->dev); | 914 | &efx->pci_dev->dev); |
915 | if (!ptp->phc_clock) | 915 | if (IS_ERR(ptp->phc_clock)) { |
916 | rc = PTR_ERR(ptp->phc_clock); | ||
916 | goto fail3; | 917 | goto fail3; |
918 | } | ||
917 | 919 | ||
918 | INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker); | 920 | INIT_WORK(&ptp->pps_work, efx_ptp_pps_worker); |
919 | ptp->pps_workwq = create_singlethread_workqueue("sfc_pps"); | 921 | ptp->pps_workwq = create_singlethread_workqueue("sfc_pps"); |
diff --git a/drivers/net/ethernet/toshiba/spider_net.c b/drivers/net/ethernet/toshiba/spider_net.c index c655fe60121e..5734480c1ecf 100644 --- a/drivers/net/ethernet/toshiba/spider_net.c +++ b/drivers/net/ethernet/toshiba/spider_net.c | |||
@@ -1990,7 +1990,8 @@ spider_net_open(struct net_device *netdev) | |||
1990 | goto alloc_rx_failed; | 1990 | goto alloc_rx_failed; |
1991 | 1991 | ||
1992 | /* Allocate rx skbs */ | 1992 | /* Allocate rx skbs */ |
1993 | if (spider_net_alloc_rx_skbs(card)) | 1993 | result = spider_net_alloc_rx_skbs(card); |
1994 | if (result) | ||
1994 | goto alloc_skbs_failed; | 1995 | goto alloc_skbs_failed; |
1995 | 1996 | ||
1996 | spider_net_set_multi(netdev); | 1997 | spider_net_set_multi(netdev); |
diff --git a/drivers/net/irda/bfin_sir.c b/drivers/net/irda/bfin_sir.c index a06fca61c9a0..22b4527321b1 100644 --- a/drivers/net/irda/bfin_sir.c +++ b/drivers/net/irda/bfin_sir.c | |||
@@ -609,7 +609,7 @@ static int bfin_sir_open(struct net_device *dev) | |||
609 | { | 609 | { |
610 | struct bfin_sir_self *self = netdev_priv(dev); | 610 | struct bfin_sir_self *self = netdev_priv(dev); |
611 | struct bfin_sir_port *port = self->sir_port; | 611 | struct bfin_sir_port *port = self->sir_port; |
612 | int err = -ENOMEM; | 612 | int err; |
613 | 613 | ||
614 | self->newspeed = 0; | 614 | self->newspeed = 0; |
615 | self->speed = 9600; | 615 | self->speed = 9600; |
@@ -623,8 +623,10 @@ static int bfin_sir_open(struct net_device *dev) | |||
623 | bfin_sir_set_speed(port, 9600); | 623 | bfin_sir_set_speed(port, 9600); |
624 | 624 | ||
625 | self->irlap = irlap_open(dev, &self->qos, DRIVER_NAME); | 625 | self->irlap = irlap_open(dev, &self->qos, DRIVER_NAME); |
626 | if (!self->irlap) | 626 | if (!self->irlap) { |
627 | err = -ENOMEM; | ||
627 | goto err_irlap; | 628 | goto err_irlap; |
629 | } | ||
628 | 630 | ||
629 | INIT_WORK(&self->work, bfin_sir_send_work); | 631 | INIT_WORK(&self->work, bfin_sir_send_work); |
630 | 632 | ||
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 24fbec27a22a..078795fe6e31 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -613,6 +613,13 @@ static const struct usb_device_id products [] = { | |||
613 | .driver_info = 0, | 613 | .driver_info = 0, |
614 | }, | 614 | }, |
615 | 615 | ||
616 | /* Dell Wireless 5804 (Novatel E371) - handled by qmi_wwan */ | ||
617 | { | ||
618 | USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x819b, USB_CLASS_COMM, | ||
619 | USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), | ||
620 | .driver_info = 0, | ||
621 | }, | ||
622 | |||
616 | /* AnyDATA ADU960S - handled by qmi_wwan */ | 623 | /* AnyDATA ADU960S - handled by qmi_wwan */ |
617 | { | 624 | { |
618 | USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a, USB_CLASS_COMM, | 625 | USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a, USB_CLASS_COMM, |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 834e405fb57a..cf887c2384e9 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -501,6 +501,13 @@ static const struct usb_device_id products[] = { | |||
501 | USB_CDC_PROTO_NONE), | 501 | USB_CDC_PROTO_NONE), |
502 | .driver_info = (unsigned long)&qmi_wwan_info, | 502 | .driver_info = (unsigned long)&qmi_wwan_info, |
503 | }, | 503 | }, |
504 | { /* Dell Wireless 5804 (Novatel E371) */ | ||
505 | USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x819b, | ||
506 | USB_CLASS_COMM, | ||
507 | USB_CDC_SUBCLASS_ETHERNET, | ||
508 | USB_CDC_PROTO_NONE), | ||
509 | .driver_info = (unsigned long)&qmi_wwan_info, | ||
510 | }, | ||
504 | { /* ADU960S */ | 511 | { /* ADU960S */ |
505 | USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a, | 512 | USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a, |
506 | USB_CLASS_COMM, | 513 | USB_CLASS_COMM, |
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index a923d61c6fc5..a79e9d334928 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
@@ -426,6 +426,13 @@ static void sierra_net_dosync(struct usbnet *dev) | |||
426 | 426 | ||
427 | dev_dbg(&dev->udev->dev, "%s", __func__); | 427 | dev_dbg(&dev->udev->dev, "%s", __func__); |
428 | 428 | ||
429 | /* The SIERRA_NET_HIP_MSYNC_ID command appears to request that the | ||
430 | * firmware restart itself. After restarting, the modem will respond | ||
431 | * with the SIERRA_NET_HIP_RESTART_ID indication. The driver continues | ||
432 | * sending MSYNC commands every few seconds until it receives the | ||
433 | * RESTART event from the firmware | ||
434 | */ | ||
435 | |||
429 | /* tell modem we are ready */ | 436 | /* tell modem we are ready */ |
430 | status = sierra_net_send_sync(dev); | 437 | status = sierra_net_send_sync(dev); |
431 | if (status < 0) | 438 | if (status < 0) |
@@ -704,6 +711,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) | |||
704 | /* set context index initially to 0 - prepares tx hdr template */ | 711 | /* set context index initially to 0 - prepares tx hdr template */ |
705 | sierra_net_set_ctx_index(priv, 0); | 712 | sierra_net_set_ctx_index(priv, 0); |
706 | 713 | ||
714 | /* prepare sync message template */ | ||
715 | memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg)); | ||
716 | |||
707 | /* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */ | 717 | /* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */ |
708 | dev->rx_urb_size = SIERRA_NET_RX_URB_SIZE; | 718 | dev->rx_urb_size = SIERRA_NET_RX_URB_SIZE; |
709 | if (dev->udev->speed != USB_SPEED_HIGH) | 719 | if (dev->udev->speed != USB_SPEED_HIGH) |
@@ -739,11 +749,6 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) | |||
739 | kfree(priv); | 749 | kfree(priv); |
740 | return -ENODEV; | 750 | return -ENODEV; |
741 | } | 751 | } |
742 | /* prepare sync message from template */ | ||
743 | memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg)); | ||
744 | |||
745 | /* initiate the sync sequence */ | ||
746 | sierra_net_dosync(dev); | ||
747 | 752 | ||
748 | return 0; | 753 | return 0; |
749 | } | 754 | } |
@@ -766,8 +771,9 @@ static void sierra_net_unbind(struct usbnet *dev, struct usb_interface *intf) | |||
766 | netdev_err(dev->net, | 771 | netdev_err(dev->net, |
767 | "usb_control_msg failed, status %d\n", status); | 772 | "usb_control_msg failed, status %d\n", status); |
768 | 773 | ||
769 | sierra_net_set_private(dev, NULL); | 774 | usbnet_status_stop(dev); |
770 | 775 | ||
776 | sierra_net_set_private(dev, NULL); | ||
771 | kfree(priv); | 777 | kfree(priv); |
772 | } | 778 | } |
773 | 779 | ||
@@ -908,6 +914,24 @@ static const struct driver_info sierra_net_info_direct_ip = { | |||
908 | .tx_fixup = sierra_net_tx_fixup, | 914 | .tx_fixup = sierra_net_tx_fixup, |
909 | }; | 915 | }; |
910 | 916 | ||
917 | static int | ||
918 | sierra_net_probe(struct usb_interface *udev, const struct usb_device_id *prod) | ||
919 | { | ||
920 | int ret; | ||
921 | |||
922 | ret = usbnet_probe(udev, prod); | ||
923 | if (ret == 0) { | ||
924 | struct usbnet *dev = usb_get_intfdata(udev); | ||
925 | |||
926 | ret = usbnet_status_start(dev, GFP_KERNEL); | ||
927 | if (ret == 0) { | ||
928 | /* Interrupt URB now set up; initiate sync sequence */ | ||
929 | sierra_net_dosync(dev); | ||
930 | } | ||
931 | } | ||
932 | return ret; | ||
933 | } | ||
934 | |||
911 | #define DIRECT_IP_DEVICE(vend, prod) \ | 935 | #define DIRECT_IP_DEVICE(vend, prod) \ |
912 | {USB_DEVICE_INTERFACE_NUMBER(vend, prod, 7), \ | 936 | {USB_DEVICE_INTERFACE_NUMBER(vend, prod, 7), \ |
913 | .driver_info = (unsigned long)&sierra_net_info_direct_ip}, \ | 937 | .driver_info = (unsigned long)&sierra_net_info_direct_ip}, \ |
@@ -930,7 +954,7 @@ MODULE_DEVICE_TABLE(usb, products); | |||
930 | static struct usb_driver sierra_net_driver = { | 954 | static struct usb_driver sierra_net_driver = { |
931 | .name = "sierra_net", | 955 | .name = "sierra_net", |
932 | .id_table = products, | 956 | .id_table = products, |
933 | .probe = usbnet_probe, | 957 | .probe = sierra_net_probe, |
934 | .disconnect = usbnet_disconnect, | 958 | .disconnect = usbnet_disconnect, |
935 | .suspend = usbnet_suspend, | 959 | .suspend = usbnet_suspend, |
936 | .resume = usbnet_resume, | 960 | .resume = usbnet_resume, |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 1e5a9b72650e..f95cb032394b 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -252,6 +252,70 @@ static int init_status (struct usbnet *dev, struct usb_interface *intf) | |||
252 | return 0; | 252 | return 0; |
253 | } | 253 | } |
254 | 254 | ||
255 | /* Submit the interrupt URB if not previously submitted, increasing refcount */ | ||
256 | int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags) | ||
257 | { | ||
258 | int ret = 0; | ||
259 | |||
260 | WARN_ON_ONCE(dev->interrupt == NULL); | ||
261 | if (dev->interrupt) { | ||
262 | mutex_lock(&dev->interrupt_mutex); | ||
263 | |||
264 | if (++dev->interrupt_count == 1) | ||
265 | ret = usb_submit_urb(dev->interrupt, mem_flags); | ||
266 | |||
267 | dev_dbg(&dev->udev->dev, "incremented interrupt URB count to %d\n", | ||
268 | dev->interrupt_count); | ||
269 | mutex_unlock(&dev->interrupt_mutex); | ||
270 | } | ||
271 | return ret; | ||
272 | } | ||
273 | EXPORT_SYMBOL_GPL(usbnet_status_start); | ||
274 | |||
275 | /* For resume; submit interrupt URB if previously submitted */ | ||
276 | static int __usbnet_status_start_force(struct usbnet *dev, gfp_t mem_flags) | ||
277 | { | ||
278 | int ret = 0; | ||
279 | |||
280 | mutex_lock(&dev->interrupt_mutex); | ||
281 | if (dev->interrupt_count) { | ||
282 | ret = usb_submit_urb(dev->interrupt, mem_flags); | ||
283 | dev_dbg(&dev->udev->dev, | ||
284 | "submitted interrupt URB for resume\n"); | ||
285 | } | ||
286 | mutex_unlock(&dev->interrupt_mutex); | ||
287 | return ret; | ||
288 | } | ||
289 | |||
290 | /* Kill the interrupt URB if all submitters want it killed */ | ||
291 | void usbnet_status_stop(struct usbnet *dev) | ||
292 | { | ||
293 | if (dev->interrupt) { | ||
294 | mutex_lock(&dev->interrupt_mutex); | ||
295 | WARN_ON(dev->interrupt_count == 0); | ||
296 | |||
297 | if (dev->interrupt_count && --dev->interrupt_count == 0) | ||
298 | usb_kill_urb(dev->interrupt); | ||
299 | |||
300 | dev_dbg(&dev->udev->dev, | ||
301 | "decremented interrupt URB count to %d\n", | ||
302 | dev->interrupt_count); | ||
303 | mutex_unlock(&dev->interrupt_mutex); | ||
304 | } | ||
305 | } | ||
306 | EXPORT_SYMBOL_GPL(usbnet_status_stop); | ||
307 | |||
308 | /* For suspend; always kill interrupt URB */ | ||
309 | static void __usbnet_status_stop_force(struct usbnet *dev) | ||
310 | { | ||
311 | if (dev->interrupt) { | ||
312 | mutex_lock(&dev->interrupt_mutex); | ||
313 | usb_kill_urb(dev->interrupt); | ||
314 | dev_dbg(&dev->udev->dev, "killed interrupt URB for suspend\n"); | ||
315 | mutex_unlock(&dev->interrupt_mutex); | ||
316 | } | ||
317 | } | ||
318 | |||
255 | /* Passes this packet up the stack, updating its accounting. | 319 | /* Passes this packet up the stack, updating its accounting. |
256 | * Some link protocols batch packets, so their rx_fixup paths | 320 | * Some link protocols batch packets, so their rx_fixup paths |
257 | * can return clones as well as just modify the original skb. | 321 | * can return clones as well as just modify the original skb. |
@@ -725,7 +789,7 @@ int usbnet_stop (struct net_device *net) | |||
725 | if (!(info->flags & FLAG_AVOID_UNLINK_URBS)) | 789 | if (!(info->flags & FLAG_AVOID_UNLINK_URBS)) |
726 | usbnet_terminate_urbs(dev); | 790 | usbnet_terminate_urbs(dev); |
727 | 791 | ||
728 | usb_kill_urb(dev->interrupt); | 792 | usbnet_status_stop(dev); |
729 | 793 | ||
730 | usbnet_purge_paused_rxq(dev); | 794 | usbnet_purge_paused_rxq(dev); |
731 | 795 | ||
@@ -787,7 +851,7 @@ int usbnet_open (struct net_device *net) | |||
787 | 851 | ||
788 | /* start any status interrupt transfer */ | 852 | /* start any status interrupt transfer */ |
789 | if (dev->interrupt) { | 853 | if (dev->interrupt) { |
790 | retval = usb_submit_urb (dev->interrupt, GFP_KERNEL); | 854 | retval = usbnet_status_start(dev, GFP_KERNEL); |
791 | if (retval < 0) { | 855 | if (retval < 0) { |
792 | netif_err(dev, ifup, dev->net, | 856 | netif_err(dev, ifup, dev->net, |
793 | "intr submit %d\n", retval); | 857 | "intr submit %d\n", retval); |
@@ -1458,6 +1522,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1458 | dev->delay.data = (unsigned long) dev; | 1522 | dev->delay.data = (unsigned long) dev; |
1459 | init_timer (&dev->delay); | 1523 | init_timer (&dev->delay); |
1460 | mutex_init (&dev->phy_mutex); | 1524 | mutex_init (&dev->phy_mutex); |
1525 | mutex_init(&dev->interrupt_mutex); | ||
1526 | dev->interrupt_count = 0; | ||
1461 | 1527 | ||
1462 | dev->net = net; | 1528 | dev->net = net; |
1463 | strcpy (net->name, "usb%d"); | 1529 | strcpy (net->name, "usb%d"); |
@@ -1593,7 +1659,7 @@ int usbnet_suspend (struct usb_interface *intf, pm_message_t message) | |||
1593 | */ | 1659 | */ |
1594 | netif_device_detach (dev->net); | 1660 | netif_device_detach (dev->net); |
1595 | usbnet_terminate_urbs(dev); | 1661 | usbnet_terminate_urbs(dev); |
1596 | usb_kill_urb(dev->interrupt); | 1662 | __usbnet_status_stop_force(dev); |
1597 | 1663 | ||
1598 | /* | 1664 | /* |
1599 | * reattach so runtime management can use and | 1665 | * reattach so runtime management can use and |
@@ -1613,9 +1679,8 @@ int usbnet_resume (struct usb_interface *intf) | |||
1613 | int retval; | 1679 | int retval; |
1614 | 1680 | ||
1615 | if (!--dev->suspend_count) { | 1681 | if (!--dev->suspend_count) { |
1616 | /* resume interrupt URBs */ | 1682 | /* resume interrupt URB if it was previously submitted */ |
1617 | if (dev->interrupt && test_bit(EVENT_DEV_OPEN, &dev->flags)) | 1683 | __usbnet_status_start_force(dev, GFP_NOIO); |
1618 | usb_submit_urb(dev->interrupt, GFP_NOIO); | ||
1619 | 1684 | ||
1620 | spin_lock_irq(&dev->txq.lock); | 1685 | spin_lock_irq(&dev->txq.lock); |
1621 | while ((res = usb_get_from_anchor(&dev->deferred))) { | 1686 | while ((res = usb_get_from_anchor(&dev->deferred))) { |
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 23049aeca662..d5a57a9e329c 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c | |||
@@ -84,13 +84,10 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | |||
84 | phy = get_phy_device(mdio, addr, is_c45); | 84 | phy = get_phy_device(mdio, addr, is_c45); |
85 | 85 | ||
86 | if (!phy || IS_ERR(phy)) { | 86 | if (!phy || IS_ERR(phy)) { |
87 | phy = phy_device_create(mdio, addr, 0, false, NULL); | 87 | dev_err(&mdio->dev, |
88 | if (!phy || IS_ERR(phy)) { | 88 | "cannot get PHY at address %i\n", |
89 | dev_err(&mdio->dev, | 89 | addr); |
90 | "error creating PHY at address %i\n", | 90 | continue; |
91 | addr); | ||
92 | continue; | ||
93 | } | ||
94 | } | 91 | } |
95 | 92 | ||
96 | /* Associate the OF node with the device structure so it | 93 | /* Associate the OF node with the device structure so it |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index da46327fca17..f18d64129f99 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -56,6 +56,8 @@ struct usbnet { | |||
56 | struct sk_buff_head done; | 56 | struct sk_buff_head done; |
57 | struct sk_buff_head rxq_pause; | 57 | struct sk_buff_head rxq_pause; |
58 | struct urb *interrupt; | 58 | struct urb *interrupt; |
59 | unsigned interrupt_count; | ||
60 | struct mutex interrupt_mutex; | ||
59 | struct usb_anchor deferred; | 61 | struct usb_anchor deferred; |
60 | struct tasklet_struct bh; | 62 | struct tasklet_struct bh; |
61 | 63 | ||
@@ -248,4 +250,7 @@ extern int usbnet_nway_reset(struct net_device *net); | |||
248 | extern int usbnet_manage_power(struct usbnet *, int); | 250 | extern int usbnet_manage_power(struct usbnet *, int); |
249 | extern void usbnet_link_change(struct usbnet *, bool, bool); | 251 | extern void usbnet_link_change(struct usbnet *, bool, bool); |
250 | 252 | ||
253 | extern int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags); | ||
254 | extern void usbnet_status_stop(struct usbnet *dev); | ||
255 | |||
251 | #endif /* __LINUX_USB_USBNET_H */ | 256 | #endif /* __LINUX_USB_USBNET_H */ |
diff --git a/include/uapi/linux/if_cablemodem.h b/include/uapi/linux/if_cablemodem.h index 9ca1007edd93..ee6b3c442baf 100644 --- a/include/uapi/linux/if_cablemodem.h +++ b/include/uapi/linux/if_cablemodem.h | |||
@@ -12,11 +12,11 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | /* some useful defines for sb1000.c e cmconfig.c - fv */ | 14 | /* some useful defines for sb1000.c e cmconfig.c - fv */ |
15 | #define SIOCGCMSTATS SIOCDEVPRIVATE+0 /* get cable modem stats */ | 15 | #define SIOCGCMSTATS (SIOCDEVPRIVATE+0) /* get cable modem stats */ |
16 | #define SIOCGCMFIRMWARE SIOCDEVPRIVATE+1 /* get cm firmware version */ | 16 | #define SIOCGCMFIRMWARE (SIOCDEVPRIVATE+1) /* get cm firmware version */ |
17 | #define SIOCGCMFREQUENCY SIOCDEVPRIVATE+2 /* get cable modem frequency */ | 17 | #define SIOCGCMFREQUENCY (SIOCDEVPRIVATE+2) /* get cable modem frequency */ |
18 | #define SIOCSCMFREQUENCY SIOCDEVPRIVATE+3 /* set cable modem frequency */ | 18 | #define SIOCSCMFREQUENCY (SIOCDEVPRIVATE+3) /* set cable modem frequency */ |
19 | #define SIOCGCMPIDS SIOCDEVPRIVATE+4 /* get cable modem PIDs */ | 19 | #define SIOCGCMPIDS (SIOCDEVPRIVATE+4) /* get cable modem PIDs */ |
20 | #define SIOCSCMPIDS SIOCDEVPRIVATE+5 /* set cable modem PIDs */ | 20 | #define SIOCSCMPIDS (SIOCDEVPRIVATE+5) /* set cable modem PIDs */ |
21 | 21 | ||
22 | #endif | 22 | #endif |
diff --git a/net/core/dev.c b/net/core/dev.c index 40b1fadaf637..fc1e289397f5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2213,6 +2213,17 @@ __be16 skb_network_protocol(struct sk_buff *skb) | |||
2213 | __be16 type = skb->protocol; | 2213 | __be16 type = skb->protocol; |
2214 | int vlan_depth = ETH_HLEN; | 2214 | int vlan_depth = ETH_HLEN; |
2215 | 2215 | ||
2216 | /* Tunnel gso handlers can set protocol to ethernet. */ | ||
2217 | if (type == htons(ETH_P_TEB)) { | ||
2218 | struct ethhdr *eth; | ||
2219 | |||
2220 | if (unlikely(!pskb_may_pull(skb, sizeof(struct ethhdr)))) | ||
2221 | return 0; | ||
2222 | |||
2223 | eth = (struct ethhdr *)skb_mac_header(skb); | ||
2224 | type = eth->h_proto; | ||
2225 | } | ||
2226 | |||
2216 | while (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) { | 2227 | while (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) { |
2217 | struct vlan_hdr *vh; | 2228 | struct vlan_hdr *vh; |
2218 | 2229 | ||
diff --git a/net/ipv4/gre.c b/net/ipv4/gre.c index cc22363965d2..b2e805af9b87 100644 --- a/net/ipv4/gre.c +++ b/net/ipv4/gre.c | |||
@@ -150,13 +150,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
150 | csum = false; | 150 | csum = false; |
151 | 151 | ||
152 | /* setup inner skb. */ | 152 | /* setup inner skb. */ |
153 | if (greh->protocol == htons(ETH_P_TEB)) { | 153 | skb->protocol = greh->protocol; |
154 | struct ethhdr *eth = (struct ethhdr *)skb_inner_mac_header(skb); | ||
155 | skb->protocol = eth->h_proto; | ||
156 | } else { | ||
157 | skb->protocol = greh->protocol; | ||
158 | } | ||
159 | |||
160 | skb->encapsulation = 0; | 154 | skb->encapsulation = 0; |
161 | 155 | ||
162 | if (unlikely(!pskb_may_pull(skb, ghl))) | 156 | if (unlikely(!pskb_may_pull(skb, ghl))) |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 0ae038a4c7a8..0bf5d399a03c 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -2311,7 +2311,6 @@ static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, | |||
2311 | struct sk_buff *segs = ERR_PTR(-EINVAL); | 2311 | struct sk_buff *segs = ERR_PTR(-EINVAL); |
2312 | int mac_len = skb->mac_len; | 2312 | int mac_len = skb->mac_len; |
2313 | int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb); | 2313 | int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb); |
2314 | struct ethhdr *inner_eth = (struct ethhdr *)skb_inner_mac_header(skb); | ||
2315 | __be16 protocol = skb->protocol; | 2314 | __be16 protocol = skb->protocol; |
2316 | netdev_features_t enc_features; | 2315 | netdev_features_t enc_features; |
2317 | int outer_hlen; | 2316 | int outer_hlen; |
@@ -2324,8 +2323,7 @@ static struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb, | |||
2324 | skb_reset_mac_header(skb); | 2323 | skb_reset_mac_header(skb); |
2325 | skb_set_network_header(skb, skb_inner_network_offset(skb)); | 2324 | skb_set_network_header(skb, skb_inner_network_offset(skb)); |
2326 | skb->mac_len = skb_inner_network_offset(skb); | 2325 | skb->mac_len = skb_inner_network_offset(skb); |
2327 | inner_eth = (struct ethhdr *)skb_mac_header(skb); | 2326 | skb->protocol = htons(ETH_P_TEB); |
2328 | skb->protocol = inner_eth->h_proto; | ||
2329 | 2327 | ||
2330 | /* segment inner packet. */ | 2328 | /* segment inner packet. */ |
2331 | enc_features = skb->dev->hw_enc_features & netif_skb_features(skb); | 2329 | enc_features = skb->dev->hw_enc_features & netif_skb_features(skb); |