diff options
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/kaweth.c | 2 | ||||
-rw-r--r-- | drivers/net/usb/qmi_wwan.c | 10 | ||||
-rw-r--r-- | drivers/net/usb/r8152.c | 17 |
3 files changed, 25 insertions, 4 deletions
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index dcb6d33141e0..1e9cdca37014 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c | |||
@@ -1276,7 +1276,7 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length) | |||
1276 | awd.done = 0; | 1276 | awd.done = 0; |
1277 | 1277 | ||
1278 | urb->context = &awd; | 1278 | urb->context = &awd; |
1279 | status = usb_submit_urb(urb, GFP_NOIO); | 1279 | status = usb_submit_urb(urb, GFP_ATOMIC); |
1280 | if (status) { | 1280 | if (status) { |
1281 | // something went wrong | 1281 | // something went wrong |
1282 | usb_free_urb(urb); | 1282 | usb_free_urb(urb); |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index b8a82b86f909..602dc6668c3a 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -56,6 +56,8 @@ struct qmi_wwan_state { | |||
56 | /* default ethernet address used by the modem */ | 56 | /* default ethernet address used by the modem */ |
57 | static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; | 57 | static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3}; |
58 | 58 | ||
59 | static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00}; | ||
60 | |||
59 | /* Make up an ethernet header if the packet doesn't have one. | 61 | /* Make up an ethernet header if the packet doesn't have one. |
60 | * | 62 | * |
61 | * A firmware bug common among several devices cause them to send raw | 63 | * A firmware bug common among several devices cause them to send raw |
@@ -332,10 +334,12 @@ next_desc: | |||
332 | usb_driver_release_interface(driver, info->data); | 334 | usb_driver_release_interface(driver, info->data); |
333 | } | 335 | } |
334 | 336 | ||
335 | /* Never use the same address on both ends of the link, even | 337 | /* Never use the same address on both ends of the link, even if the |
336 | * if the buggy firmware told us to. | 338 | * buggy firmware told us to. Or, if device is assigned the well-known |
339 | * buggy firmware MAC address, replace it with a random address, | ||
337 | */ | 340 | */ |
338 | if (ether_addr_equal(dev->net->dev_addr, default_modem_addr)) | 341 | if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) || |
342 | ether_addr_equal(dev->net->dev_addr, buggy_fw_addr)) | ||
339 | eth_hw_addr_random(dev->net); | 343 | eth_hw_addr_random(dev->net); |
340 | 344 | ||
341 | /* make MAC addr easily distinguishable from an IP header */ | 345 | /* make MAC addr easily distinguishable from an IP header */ |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 2d1c77e81836..57ec23e8ccfa 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -1897,6 +1897,22 @@ static void _rtl8152_set_rx_mode(struct net_device *netdev) | |||
1897 | netif_wake_queue(netdev); | 1897 | netif_wake_queue(netdev); |
1898 | } | 1898 | } |
1899 | 1899 | ||
1900 | static netdev_features_t | ||
1901 | rtl8152_features_check(struct sk_buff *skb, struct net_device *dev, | ||
1902 | netdev_features_t features) | ||
1903 | { | ||
1904 | u32 mss = skb_shinfo(skb)->gso_size; | ||
1905 | int max_offset = mss ? GTTCPHO_MAX : TCPHO_MAX; | ||
1906 | int offset = skb_transport_offset(skb); | ||
1907 | |||
1908 | if ((mss || skb->ip_summed == CHECKSUM_PARTIAL) && offset > max_offset) | ||
1909 | features &= ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK); | ||
1910 | else if ((skb->len + sizeof(struct tx_desc)) > agg_buf_sz) | ||
1911 | features &= ~NETIF_F_GSO_MASK; | ||
1912 | |||
1913 | return features; | ||
1914 | } | ||
1915 | |||
1900 | static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, | 1916 | static netdev_tx_t rtl8152_start_xmit(struct sk_buff *skb, |
1901 | struct net_device *netdev) | 1917 | struct net_device *netdev) |
1902 | { | 1918 | { |
@@ -3706,6 +3722,7 @@ static const struct net_device_ops rtl8152_netdev_ops = { | |||
3706 | .ndo_set_mac_address = rtl8152_set_mac_address, | 3722 | .ndo_set_mac_address = rtl8152_set_mac_address, |
3707 | .ndo_change_mtu = rtl8152_change_mtu, | 3723 | .ndo_change_mtu = rtl8152_change_mtu, |
3708 | .ndo_validate_addr = eth_validate_addr, | 3724 | .ndo_validate_addr = eth_validate_addr, |
3725 | .ndo_features_check = rtl8152_features_check, | ||
3709 | }; | 3726 | }; |
3710 | 3727 | ||
3711 | static void r8152b_get_version(struct r8152 *tp) | 3728 | static void r8152b_get_version(struct r8152 *tp) |