aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2012-10-07 19:31:23 +0200
committerBjørn Mork <bjorn@mork.no>2012-10-09 10:56:59 +0200
commit6aa80bd23c91c105af294afe09e24f6547770029 (patch)
tree2bbdf33303552ea255f43c682cf0d3a7d5c061ff
parentdadf9eb9e185aae3c986aee6d11e37fbf3cd9966 (diff)
net: cdc_ncm: use device rx_max value if update failed
If the device refuses our updated value, then we must be prepared to receive URBs as big as the device wants to send. Set rx_max to the device provided value on error. Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--drivers/net/usb/cdc_ncm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 4cd582a4f62..6a65662aa9d 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -251,8 +251,11 @@ static u8 cdc_ncm_setup(struct cdc_ncm_ctx *ctx)
kfree(dwNtbInMaxSize);
}
size_err:
- if (err < 0)
- pr_debug("Setting NTB Input Size failed\n");
+ if (err < 0) {
+ /* failed, so attempt to use the device suggested size */
+ ctx->rx_max = le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize);
+ pr_debug("Setting NTB Input Size failed, reverting to %u\n", ctx->rx_max);
+ }
}
/* verify maximum size of transmitted NTB in bytes */