Skip to content

Commit a6fe670

Browse files
bmorkdavem330
authored andcommitted
net: cdc_ncm: no not set tx_max higher than the device supports
There are MBIM devices out there reporting dwNtbInMaxSize=2048 dwNtbOutMaxSize=2048 and since the spec require a datagram max size of at least 2048, this means that a full sized datagram will never fit. Still, sending larger NTBs than the device supports is not going to help. We do not have any other options than either a) refusing to bindi, or b) respect the insanely low value. Alternative b will at least make these devices work, so go for it. 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>
1 parent 296e81f commit a6fe670

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/usb/cdc_ncm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ static u8 cdc_ncm_setup(struct usbnet *dev)
159159
}
160160

161161
/* verify maximum size of transmitted NTB in bytes */
162-
if ((ctx->tx_max < (CDC_NCM_MIN_HDR_SIZE + ctx->max_datagram_size)) ||
163-
(ctx->tx_max > CDC_NCM_NTB_MAX_SIZE_TX)) {
162+
if (ctx->tx_max > CDC_NCM_NTB_MAX_SIZE_TX) {
164163
dev_dbg(&dev->intf->dev, "Using default maximum transmit length=%d\n",
165164
CDC_NCM_NTB_MAX_SIZE_TX);
166165
ctx->tx_max = CDC_NCM_NTB_MAX_SIZE_TX;

0 commit comments

Comments
 (0)