Commit 5aee0728 authored by Bjørn Mork's avatar Bjørn Mork Committed by David S. Miller

net: sierra_net: rx_urb_size is constant

The rx_urb_size is set to the same value for every device
supported by this driver.  No need to keep a per-device
data structure to do that. Replacing with a macro constant.

This was the last device specific info, and removing it
allows us to delete the sierra_net_info_data struct.
Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9625e5fa
...@@ -68,9 +68,8 @@ static atomic_t iface_counter = ATOMIC_INIT(0); ...@@ -68,9 +68,8 @@ static atomic_t iface_counter = ATOMIC_INIT(0);
*/ */
#define SIERRA_NET_USBCTL_BUF_LEN 1024 #define SIERRA_NET_USBCTL_BUF_LEN 1024
struct sierra_net_info_data { /* Overriding the default usbnet rx_urb_size */
u16 rx_urb_size; #define SIERRA_NET_RX_URB_SIZE (8 * 1024)
};
/* Private data structure */ /* Private data structure */
struct sierra_net_data { struct sierra_net_data {
...@@ -678,9 +677,6 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -678,9 +677,6 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
static const u8 shdwn_tmplate[sizeof(priv->shdwn_msg)] = { static const u8 shdwn_tmplate[sizeof(priv->shdwn_msg)] = {
0x00, 0x00, SIERRA_NET_HIP_SHUTD_ID, 0x00}; 0x00, 0x00, SIERRA_NET_HIP_SHUTD_ID, 0x00};
struct sierra_net_info_data *data =
(struct sierra_net_info_data *)dev->driver_info->data;
dev_dbg(&dev->udev->dev, "%s", __func__); dev_dbg(&dev->udev->dev, "%s", __func__);
ifacenum = intf->cur_altsetting->desc.bInterfaceNumber; ifacenum = intf->cur_altsetting->desc.bInterfaceNumber;
...@@ -725,9 +721,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -725,9 +721,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
sierra_net_set_ctx_index(priv, 0); sierra_net_set_ctx_index(priv, 0);
/* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */ /* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */
dev->rx_urb_size = data->rx_urb_size; dev->rx_urb_size = SIERRA_NET_RX_URB_SIZE;
if (dev->udev->speed != USB_SPEED_HIGH) if (dev->udev->speed != USB_SPEED_HIGH)
dev->rx_urb_size = min_t(size_t, 4096, data->rx_urb_size); dev->rx_urb_size = min_t(size_t, 4096, SIERRA_NET_RX_URB_SIZE);
dev->net->hard_header_len += SIERRA_NET_HIP_EXT_HDR_LEN; dev->net->hard_header_len += SIERRA_NET_HIP_EXT_HDR_LEN;
dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
...@@ -918,10 +914,6 @@ static struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, ...@@ -918,10 +914,6 @@ static struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev,
return NULL; return NULL;
} }
static const struct sierra_net_info_data sierra_net_info_data_direct_ip = {
.rx_urb_size = 8 * 1024,
};
static const struct driver_info sierra_net_info_direct_ip = { static const struct driver_info sierra_net_info_direct_ip = {
.description = "Sierra Wireless USB-to-WWAN Modem", .description = "Sierra Wireless USB-to-WWAN Modem",
.flags = FLAG_WWAN | FLAG_SEND_ZLP, .flags = FLAG_WWAN | FLAG_SEND_ZLP,
...@@ -930,7 +922,6 @@ static const struct driver_info sierra_net_info_direct_ip = { ...@@ -930,7 +922,6 @@ static const struct driver_info sierra_net_info_direct_ip = {
.status = sierra_net_status, .status = sierra_net_status,
.rx_fixup = sierra_net_rx_fixup, .rx_fixup = sierra_net_rx_fixup,
.tx_fixup = sierra_net_tx_fixup, .tx_fixup = sierra_net_tx_fixup,
.data = (unsigned long)&sierra_net_info_data_direct_ip,
}; };
#define DIRECT_IP_DEVICE(vend, prod) \ #define DIRECT_IP_DEVICE(vend, prod) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment