aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/sierra_net.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 16:38:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-02 16:38:27 -0400
commitaecdc33e111b2c447b622e287c6003726daa1426 (patch)
tree3e7657eae4b785e1a1fb5dfb225dbae0b2f0cfc6 /drivers/net/usb/sierra_net.c
parenta20acf99f75e49271381d65db097c9763060a1e8 (diff)
parenta3a6cab5ea10cca64d036851fe0d932448f2fe4f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking changes from David Miller: 1) GRE now works over ipv6, from Dmitry Kozlov. 2) Make SCTP more network namespace aware, from Eric Biederman. 3) TEAM driver now works with non-ethernet devices, from Jiri Pirko. 4) Make openvswitch network namespace aware, from Pravin B Shelar. 5) IPV6 NAT implementation, from Patrick McHardy. 6) Server side support for TCP Fast Open, from Jerry Chu and others. 7) Packet BPF filter supports MOD and XOR, from Eric Dumazet and Daniel Borkmann. 8) Increate the loopback default MTU to 64K, from Eric Dumazet. 9) Use a per-task rather than per-socket page fragment allocator for outgoing networking traffic. This benefits processes that have very many mostly idle sockets, which is quite common. From Eric Dumazet. 10) Use up to 32K for page fragment allocations, with fallbacks to smaller sizes when higher order page allocations fail. Benefits are a) less segments for driver to process b) less calls to page allocator c) less waste of space. From Eric Dumazet. 11) Allow GRO to be used on GRE tunnels, from Eric Dumazet. 12) VXLAN device driver, one way to handle VLAN issues such as the limitation of 4096 VLAN IDs yet still have some level of isolation. From Stephen Hemminger. 13) As usual there is a large boatload of driver changes, with the scale perhaps tilted towards the wireless side this time around. Fix up various fairly trivial conflicts, mostly caused by the user namespace changes. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1012 commits) hyperv: Add buffer for extended info after the RNDIS response message. hyperv: Report actual status in receive completion packet hyperv: Remove extra allocated space for recv_pkt_list elements hyperv: Fix page buffer handling in rndis_filter_send_request() hyperv: Fix the missing return value in rndis_filter_set_packet_filter() hyperv: Fix the max_xfer_size in RNDIS initialization vxlan: put UDP socket in correct namespace vxlan: Depend on CONFIG_INET sfc: Fix the reported priorities of different filter types sfc: Remove EFX_FILTER_FLAG_RX_OVERRIDE_IP sfc: Fix loopback self-test with separate_tx_channels=1 sfc: Fix MCDI structure field lookup sfc: Add parentheses around use of bitfield macro arguments sfc: Fix null function pointer in efx_sriov_channel_type vxlan: virtual extensible lan igmp: export symbol ip_mc_leave_group netlink: add attributes to fdb interface tg3: unconditionally select HWMON support when tg3 is enabled. Revert "net: ti cpsw ethernet: allow reading phy interface mode from DT" gre: fix sparse warning ...
Diffstat (limited to 'drivers/net/usb/sierra_net.c')
-rw-r--r--drivers/net/usb/sierra_net.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index 8e22417fa6c..c27d27701ae 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -68,9 +68,8 @@ static atomic_t iface_counter = ATOMIC_INIT(0);
68 */ 68 */
69#define SIERRA_NET_USBCTL_BUF_LEN 1024 69#define SIERRA_NET_USBCTL_BUF_LEN 1024
70 70
71struct sierra_net_info_data { 71/* Overriding the default usbnet rx_urb_size */
72 u16 rx_urb_size; 72#define SIERRA_NET_RX_URB_SIZE (8 * 1024)
73};
74 73
75/* Private data structure */ 74/* Private data structure */
76struct sierra_net_data { 75struct sierra_net_data {
@@ -560,7 +559,7 @@ static void sierra_net_defer_kevent(struct usbnet *dev, int work)
560/* 559/*
561 * Sync Retransmit Timer Handler. On expiry, kick the work queue 560 * Sync Retransmit Timer Handler. On expiry, kick the work queue
562 */ 561 */
563void sierra_sync_timer(unsigned long syncdata) 562static void sierra_sync_timer(unsigned long syncdata)
564{ 563{
565 struct usbnet *dev = (struct usbnet *)syncdata; 564 struct usbnet *dev = (struct usbnet *)syncdata;
566 565
@@ -678,9 +677,6 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
678 static const u8 shdwn_tmplate[sizeof(priv->shdwn_msg)] = { 677 static const u8 shdwn_tmplate[sizeof(priv->shdwn_msg)] = {
679 0x00, 0x00, SIERRA_NET_HIP_SHUTD_ID, 0x00}; 678 0x00, 0x00, SIERRA_NET_HIP_SHUTD_ID, 0x00};
680 679
681 struct sierra_net_info_data *data =
682 (struct sierra_net_info_data *)dev->driver_info->data;
683
684 dev_dbg(&dev->udev->dev, "%s", __func__); 680 dev_dbg(&dev->udev->dev, "%s", __func__);
685 681
686 ifacenum = intf->cur_altsetting->desc.bInterfaceNumber; 682 ifacenum = intf->cur_altsetting->desc.bInterfaceNumber;
@@ -725,9 +721,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
725 sierra_net_set_ctx_index(priv, 0); 721 sierra_net_set_ctx_index(priv, 0);
726 722
727 /* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */ 723 /* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */
728 dev->rx_urb_size = data->rx_urb_size; 724 dev->rx_urb_size = SIERRA_NET_RX_URB_SIZE;
729 if (dev->udev->speed != USB_SPEED_HIGH) 725 if (dev->udev->speed != USB_SPEED_HIGH)
730 dev->rx_urb_size = min_t(size_t, 4096, data->rx_urb_size); 726 dev->rx_urb_size = min_t(size_t, 4096, SIERRA_NET_RX_URB_SIZE);
731 727
732 dev->net->hard_header_len += SIERRA_NET_HIP_EXT_HDR_LEN; 728 dev->net->hard_header_len += SIERRA_NET_HIP_EXT_HDR_LEN;
733 dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; 729 dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
@@ -842,7 +838,7 @@ static int sierra_net_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
842 netdev_err(dev->net, "HIP/ETH: Invalid pkt\n"); 838 netdev_err(dev->net, "HIP/ETH: Invalid pkt\n");
843 839
844 dev->net->stats.rx_frame_errors++; 840 dev->net->stats.rx_frame_errors++;
845 /* dev->net->stats.rx_errors incremented by caller */; 841 /* dev->net->stats.rx_errors incremented by caller */
846 return 0; 842 return 0;
847 } 843 }
848 844
@@ -866,8 +862,8 @@ static int sierra_net_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
866} 862}
867 863
868/* ---------------------------- Transmit data path ----------------------*/ 864/* ---------------------------- Transmit data path ----------------------*/
869struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb, 865static struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev,
870 gfp_t flags) 866 struct sk_buff *skb, gfp_t flags)
871{ 867{
872 struct sierra_net_data *priv = sierra_net_get_private(dev); 868 struct sierra_net_data *priv = sierra_net_get_private(dev);
873 u16 len; 869 u16 len;
@@ -918,10 +914,6 @@ struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
918 return NULL; 914 return NULL;
919} 915}
920 916
921static const struct sierra_net_info_data sierra_net_info_data_direct_ip = {
922 .rx_urb_size = 8 * 1024,
923};
924
925static const struct driver_info sierra_net_info_direct_ip = { 917static const struct driver_info sierra_net_info_direct_ip = {
926 .description = "Sierra Wireless USB-to-WWAN Modem", 918 .description = "Sierra Wireless USB-to-WWAN Modem",
927 .flags = FLAG_WWAN | FLAG_SEND_ZLP, 919 .flags = FLAG_WWAN | FLAG_SEND_ZLP,
@@ -930,7 +922,6 @@ static const struct driver_info sierra_net_info_direct_ip = {
930 .status = sierra_net_status, 922 .status = sierra_net_status,
931 .rx_fixup = sierra_net_rx_fixup, 923 .rx_fixup = sierra_net_rx_fixup,
932 .tx_fixup = sierra_net_tx_fixup, 924 .tx_fixup = sierra_net_tx_fixup,
933 .data = (unsigned long)&sierra_net_info_data_direct_ip,
934}; 925};
935 926
936#define DIRECT_IP_DEVICE(vend, prod) \ 927#define DIRECT_IP_DEVICE(vend, prod) \