Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340435
b: refs/heads/master
c: dad957d
h: refs/heads/master
i:
  340433: d804f9a
  340431: 192d728
v: v3
  • Loading branch information
Bjørn Mork authored and David S. Miller committed Oct 23, 2012
1 parent c2626aa commit 7be6763
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0668744f792a737872aa1904010e5fba5f95376b
refs/heads/master: dad957d7386873c600a365a9d0dcc7cc73f36883
46 changes: 13 additions & 33 deletions trunk/drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,41 +215,21 @@ static u8 cdc_ncm_setup(struct cdc_ncm_ctx *ctx)

/* inform device about NTB input size changes */
if (ctx->rx_max != le32_to_cpu(ctx->ncm_parm.dwNtbInMaxSize)) {
__le32 *dwNtbInMaxSize;

if (flags & USB_CDC_NCM_NCAP_NTB_INPUT_SIZE) {
struct usb_cdc_ncm_ndp_input_size *ndp_in_sz;

ndp_in_sz = kzalloc(sizeof(*ndp_in_sz), GFP_KERNEL);
if (!ndp_in_sz) {
err = -ENOMEM;
goto size_err;
}

err = usb_control_msg(ctx->udev,
usb_sndctrlpipe(ctx->udev, 0),
USB_CDC_SET_NTB_INPUT_SIZE,
USB_TYPE_CLASS | USB_DIR_OUT
| USB_RECIP_INTERFACE,
0, iface_no, ndp_in_sz, 8, 1000);
kfree(ndp_in_sz);
} else {
__le32 *dwNtbInMaxSize;
dwNtbInMaxSize = kzalloc(sizeof(*dwNtbInMaxSize),
GFP_KERNEL);
if (!dwNtbInMaxSize) {
err = -ENOMEM;
goto size_err;
}
*dwNtbInMaxSize = cpu_to_le32(ctx->rx_max);

err = usb_control_msg(ctx->udev,
usb_sndctrlpipe(ctx->udev, 0),
USB_CDC_SET_NTB_INPUT_SIZE,
USB_TYPE_CLASS | USB_DIR_OUT
| USB_RECIP_INTERFACE,
0, iface_no, dwNtbInMaxSize, 4, 1000);
kfree(dwNtbInMaxSize);
dwNtbInMaxSize = kzalloc(sizeof(*dwNtbInMaxSize), GFP_KERNEL);
if (!dwNtbInMaxSize) {
err = -ENOMEM;
goto size_err;
}
*dwNtbInMaxSize = cpu_to_le32(ctx->rx_max);
err = usb_control_msg(ctx->udev,
usb_sndctrlpipe(ctx->udev, 0),
USB_CDC_SET_NTB_INPUT_SIZE,
USB_TYPE_CLASS | USB_DIR_OUT
| USB_RECIP_INTERFACE,
0, iface_no, dwNtbInMaxSize, 4, 1000);
kfree(dwNtbInMaxSize);
size_err:
if (err < 0)
pr_debug("Setting NTB Input Size failed\n");
Expand Down

0 comments on commit 7be6763

Please sign in to comment.