diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2008-06-18 08:40:12 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-06-28 10:23:34 -0400 |
commit | 818727badc14ce57dc099a075b05505d50b7956e (patch) | |
tree | 11dd25656d1fbcdf8861de3a11eeeb1f9538a93f /drivers/net | |
parent | 0caa11663cbfc55209fd3ccab6afab2708bb44fd (diff) |
rndis_host: pass buffer length to rndis_command
Pass buffer length to rndis_command so that rndis_command can read full
response buffer from device instead of max CONTROL_BUFFER_SIZE bytes.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/usb/rndis_host.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index ae467f182c40..61c98beb4d17 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -74,7 +74,7 @@ EXPORT_SYMBOL_GPL(rndis_status); | |||
74 | * Call context is likely probe(), before interface name is known, | 74 | * Call context is likely probe(), before interface name is known, |
75 | * which is why we won't try to use it in the diagnostics. | 75 | * which is why we won't try to use it in the diagnostics. |
76 | */ | 76 | */ |
77 | int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf) | 77 | int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) |
78 | { | 78 | { |
79 | struct cdc_state *info = (void *) &dev->data; | 79 | struct cdc_state *info = (void *) &dev->data; |
80 | int master_ifnum; | 80 | int master_ifnum; |
@@ -121,7 +121,7 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf) | |||
121 | USB_CDC_GET_ENCAPSULATED_RESPONSE, | 121 | USB_CDC_GET_ENCAPSULATED_RESPONSE, |
122 | USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, | 122 | USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, |
123 | 0, master_ifnum, | 123 | 0, master_ifnum, |
124 | buf, CONTROL_BUFFER_SIZE, | 124 | buf, buflen, |
125 | RNDIS_CONTROL_TIMEOUT_MS); | 125 | RNDIS_CONTROL_TIMEOUT_MS); |
126 | if (likely(retval >= 8)) { | 126 | if (likely(retval >= 8)) { |
127 | msg_len = le32_to_cpu(buf->msg_len); | 127 | msg_len = le32_to_cpu(buf->msg_len); |
@@ -239,7 +239,7 @@ static int rndis_query(struct usbnet *dev, struct usb_interface *intf, | |||
239 | u.get->len = cpu_to_le32(in_len); | 239 | u.get->len = cpu_to_le32(in_len); |
240 | u.get->offset = ccpu2(20); | 240 | u.get->offset = ccpu2(20); |
241 | 241 | ||
242 | retval = rndis_command(dev, u.header); | 242 | retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); |
243 | if (unlikely(retval < 0)) { | 243 | if (unlikely(retval < 0)) { |
244 | dev_err(&intf->dev, "RNDIS_MSG_QUERY(0x%08x) failed, %d\n", | 244 | dev_err(&intf->dev, "RNDIS_MSG_QUERY(0x%08x) failed, %d\n", |
245 | oid, retval); | 245 | oid, retval); |
@@ -328,7 +328,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
328 | u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size); | 328 | u.init->max_transfer_size = cpu_to_le32(dev->rx_urb_size); |
329 | 329 | ||
330 | net->change_mtu = NULL; | 330 | net->change_mtu = NULL; |
331 | retval = rndis_command(dev, u.header); | 331 | retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); |
332 | if (unlikely(retval < 0)) { | 332 | if (unlikely(retval < 0)) { |
333 | /* it might not even be an RNDIS device!! */ | 333 | /* it might not even be an RNDIS device!! */ |
334 | dev_err(&intf->dev, "RNDIS init failed, %d\n", retval); | 334 | dev_err(&intf->dev, "RNDIS init failed, %d\n", retval); |
@@ -409,7 +409,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
409 | u.set->offset = ccpu2((sizeof *u.set) - 8); | 409 | u.set->offset = ccpu2((sizeof *u.set) - 8); |
410 | *(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER; | 410 | *(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER; |
411 | 411 | ||
412 | retval = rndis_command(dev, u.header); | 412 | retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); |
413 | if (unlikely(retval < 0)) { | 413 | if (unlikely(retval < 0)) { |
414 | dev_err(&intf->dev, "rndis set packet filter, %d\n", retval); | 414 | dev_err(&intf->dev, "rndis set packet filter, %d\n", retval); |
415 | goto halt_fail_and_release; | 415 | goto halt_fail_and_release; |
@@ -424,7 +424,7 @@ halt_fail_and_release: | |||
424 | memset(u.halt, 0, sizeof *u.halt); | 424 | memset(u.halt, 0, sizeof *u.halt); |
425 | u.halt->msg_type = RNDIS_MSG_HALT; | 425 | u.halt->msg_type = RNDIS_MSG_HALT; |
426 | u.halt->msg_len = ccpu2(sizeof *u.halt); | 426 | u.halt->msg_len = ccpu2(sizeof *u.halt); |
427 | (void) rndis_command(dev, (void *)u.halt); | 427 | (void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE); |
428 | fail_and_release: | 428 | fail_and_release: |
429 | usb_set_intfdata(info->data, NULL); | 429 | usb_set_intfdata(info->data, NULL); |
430 | usb_driver_release_interface(driver_of(intf), info->data); | 430 | usb_driver_release_interface(driver_of(intf), info->data); |
@@ -449,7 +449,7 @@ void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) | |||
449 | if (halt) { | 449 | if (halt) { |
450 | halt->msg_type = RNDIS_MSG_HALT; | 450 | halt->msg_type = RNDIS_MSG_HALT; |
451 | halt->msg_len = ccpu2(sizeof *halt); | 451 | halt->msg_len = ccpu2(sizeof *halt); |
452 | (void) rndis_command(dev, (void *)halt); | 452 | (void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE); |
453 | kfree(halt); | 453 | kfree(halt); |
454 | } | 454 | } |
455 | 455 | ||
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index a36d2c85e26e..f001f2afd05e 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -448,7 +448,7 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len) | |||
448 | u.get->msg_len = ccpu2(sizeof *u.get); | 448 | u.get->msg_len = ccpu2(sizeof *u.get); |
449 | u.get->oid = oid; | 449 | u.get->oid = oid; |
450 | 450 | ||
451 | ret = rndis_command(dev, u.header); | 451 | ret = rndis_command(dev, u.header, buflen); |
452 | if (ret == 0) { | 452 | if (ret == 0) { |
453 | ret = le32_to_cpu(u.get_c->len); | 453 | ret = le32_to_cpu(u.get_c->len); |
454 | *len = (*len > ret) ? ret : *len; | 454 | *len = (*len > ret) ? ret : *len; |
@@ -498,7 +498,7 @@ static int rndis_set_oid(struct usbnet *dev, __le32 oid, void *data, int len) | |||
498 | u.set->handle = ccpu2(0); | 498 | u.set->handle = ccpu2(0); |
499 | memcpy(u.buf + sizeof(*u.set), data, len); | 499 | memcpy(u.buf + sizeof(*u.set), data, len); |
500 | 500 | ||
501 | ret = rndis_command(dev, u.header); | 501 | ret = rndis_command(dev, u.header, buflen); |
502 | if (ret == 0) | 502 | if (ret == 0) |
503 | ret = rndis_error_status(u.set_c->status); | 503 | ret = rndis_error_status(u.set_c->status); |
504 | 504 | ||