diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c index efc18e0..370e0f2 100644 --- a/drivers/net/usb/cdc_mbim.c +++ b/drivers/net/usb/cdc_mbim.c @@ -158,7 +158,7 @@ static int cdc_mbim_bind(struct usbnet *dev, struct usb_interface *intf) if (!cdc_ncm_comm_intf_is_mbim(intf->cur_altsetting)) goto err; - ret = cdc_ncm_bind_common(dev, intf, data_altsetting, 0); + ret = cdc_ncm_bind_common(dev, intf, data_altsetting, CDC_NCM_FLAG_NDP_TO_END); if (ret) goto err; diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index db40175..5cda9ab 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -150,7 +150,7 @@ static u32 cdc_ncm_check_rx_max(struct usbnet *dev, u32 new_rx) /* clamp new_rx to sane values */ min = USB_CDC_NCM_NTB_MIN_IN_SIZE; - max = min_t(u32, CDC_NCM_NTB_MAX_SIZE_RX, le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)); + max = min_t(u32, 64512, le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)); /* dwNtbInMaxSize spec violation? Use MIN size for both limits */ if (max < min) { @@ -541,6 +541,8 @@ static void cdc_ncm_set_dgram_size(struct usbnet *dev, int new_size) if (le16_to_cpu(max_datagram_size) == ctx->max_datagram_size) goto out; + printk(KERN_INFO "cdc_ncm ctx->max_datagram_size=%u\n", + ctx->max_datagram_size); max_datagram_size = cpu_to_le16(ctx->max_datagram_size); err = usbnet_write_cmd(dev, USB_CDC_SET_MAX_DATAGRAM_SIZE, USB_TYPE_CLASS | USB_DIR_OUT | USB_RECIP_INTERFACE, @@ -612,7 +614,7 @@ static int cdc_ncm_setup(struct usbnet *dev) /* be conservative when selecting intial buffer size to * increase the number of hosts this will work for */ - def_rx = min_t(u32, CDC_NCM_NTB_DEF_SIZE_RX, + def_rx = min_t(u32, 64512, le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)); def_tx = min_t(u32, CDC_NCM_NTB_DEF_SIZE_TX, le32_to_cpu(ctx->ncm_parm.dwNtbOutMaxSize));