Commit 43c87f78 authored by Bjørn Mork's avatar Bjørn Mork Committed by David S. Miller

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: default avatarBjørn Mork <bjorn@mork.no>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0e2c4a00
...@@ -404,13 +404,6 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ ...@@ -404,13 +404,6 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
ctx->ether_desc = ctx->ether_desc =
(const struct usb_cdc_ether_desc *)buf; (const struct usb_cdc_ether_desc *)buf;
dev->hard_mtu =
le16_to_cpu(ctx->ether_desc->wMaxSegmentSize);
if (dev->hard_mtu < CDC_NCM_MIN_DATAGRAM_SIZE)
dev->hard_mtu = CDC_NCM_MIN_DATAGRAM_SIZE;
else if (dev->hard_mtu > CDC_NCM_MAX_DATAGRAM_SIZE)
dev->hard_mtu = CDC_NCM_MAX_DATAGRAM_SIZE;
break; break;
case USB_CDC_NCM_TYPE: case USB_CDC_NCM_TYPE:
...@@ -485,6 +478,8 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_ ...@@ -485,6 +478,8 @@ int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_
dev_info(&dev->udev->dev, "MAC-Address: %pM\n", dev->net->dev_addr); dev_info(&dev->udev->dev, "MAC-Address: %pM\n", dev->net->dev_addr);
} }
/* usbnet use these values for sizing tx/rx queues */
dev->hard_mtu = ctx->tx_max;
dev->rx_urb_size = ctx->rx_max; dev->rx_urb_size = ctx->rx_max;
return 0; return 0;
......
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