diff options
Diffstat (limited to 'drivers/net/usb/sierra_net.c')
-rw-r--r-- | drivers/net/usb/sierra_net.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index 8e22417fa6c1..c27d27701aee 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 | ||
71 | struct 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 */ |
76 | struct sierra_net_data { | 75 | struct 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 | */ |
563 | void sierra_sync_timer(unsigned long syncdata) | 562 | static 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 ----------------------*/ |
869 | struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb, | 865 | static 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 | ||
921 | static const struct sierra_net_info_data sierra_net_info_data_direct_ip = { | ||
922 | .rx_urb_size = 8 * 1024, | ||
923 | }; | ||
924 | |||
925 | static const struct driver_info sierra_net_info_direct_ip = { | 917 | static 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) \ |