diff options
author | Bjørn Mork <bjorn@mork.no> | 2013-11-01 06:16:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-02 02:02:03 -0400 |
commit | 43c87f78388443e3bf6c73c05574bfa15b994f0a (patch) | |
tree | 49bfc39c2ec45139d95e60288accab56dcda98e2 /drivers/net/usb | |
parent | 0e2c4a00547a406aeb3bb5a3007cc90a62104980 (diff) |
net: cdc_ncm: set correct dev->hard_mtu
usbnet use the hard_mtu value for sizing the tx queue and nothing
else. We will be transmitting buffers of up to tx_max size, so
that's the proper value to give usbnet.
The individual datagram size is completely irrelevant here.
Cc: Alexey Orishko <alexey.orishko@gmail.com>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/cdc_ncm.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index 8fc1a06604aa..c40f742f6200 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c | |||
@@ -404,13 +404,6 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ | |||
404 | 404 | ||
405 | ctx->ether_desc = | 405 | ctx->ether_desc = |
406 | (const struct usb_cdc_ether_desc *)buf; | 406 | (const struct usb_cdc_ether_desc *)buf; |
407 | dev->hard_mtu = | ||
408 | le16_to_cpu(ctx->ether_desc->wMaxSegmentSize); | ||
409 | |||
410 | if (dev->hard_mtu < CDC_NCM_MIN_DATAGRAM_SIZE) | ||
411 | dev->hard_mtu = CDC_NCM_MIN_DATAGRAM_SIZE; | ||
412 | else if (dev->hard_mtu > CDC_NCM_MAX_DATAGRAM_SIZE) | ||
413 | dev->hard_mtu = CDC_NCM_MAX_DATAGRAM_SIZE; | ||
414 | break; | 407 | break; |
415 | 408 | ||
416 | case USB_CDC_NCM_TYPE: | 409 | case USB_CDC_NCM_TYPE: |
@@ -485,6 +478,8 @@ advance: | |||
485 | dev_info(&dev->udev->dev, "MAC-Address: %pM\n", dev->net->dev_addr); | 478 | dev_info(&dev->udev->dev, "MAC-Address: %pM\n", dev->net->dev_addr); |
486 | } | 479 | } |
487 | 480 | ||
481 | /* usbnet use these values for sizing tx/rx queues */ | ||
482 | dev->hard_mtu = ctx->tx_max; | ||
488 | dev->rx_urb_size = ctx->rx_max; | 483 | dev->rx_urb_size = ctx->rx_max; |
489 | 484 | ||
490 | return 0; | 485 | return 0; |