aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/hwa-hc.c
diff options
context:
space:
mode:
authorThomas Pugliese <thomas.pugliese@gmail.com>2013-12-09 14:19:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-09 16:28:48 -0500
commit7b3e3740f2d0faca9351db88974be534009a3d8d (patch)
tree0ffed75bf0500ef176681a3af0999bd15747d126 /drivers/usb/host/hwa-hc.c
parent83e83ecb79a8225e79bc8e54e9aff3e0e27658a2 (diff)
usb: wusbcore: use USB_CTRL_SET_TIMEOUT and USB_CTRL_GET_TIMEOUT
Use USB_CTRL_SET_TIMEOUT and USB_CTRL_GET_TIMEOUT for USB control messages instead of an arbitrary 1s timeout value. This is particularly useful for WUSB since in the worst case RF scanario, a WUSB device can be unresponsive for up to 4s and still be connected. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/hwa-hc.c')
-rw-r--r--drivers/usb/host/hwa-hc.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c
index 7fd3f9bd7b83..f0b97bb08791 100644
--- a/drivers/usb/host/hwa-hc.c
+++ b/drivers/usb/host/hwa-hc.c
@@ -86,7 +86,7 @@ static int __hwahc_set_cluster_id(struct hwahc *hwahc, u8 cluster_id)
86 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 86 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
87 cluster_id, 87 cluster_id,
88 wa->usb_iface->cur_altsetting->desc.bInterfaceNumber, 88 wa->usb_iface->cur_altsetting->desc.bInterfaceNumber,
89 NULL, 0, 1000 /* FIXME: arbitrary */); 89 NULL, 0, USB_CTRL_SET_TIMEOUT);
90 if (result < 0) 90 if (result < 0)
91 dev_err(dev, "Cannot set WUSB Cluster ID to 0x%02x: %d\n", 91 dev_err(dev, "Cannot set WUSB Cluster ID to 0x%02x: %d\n",
92 cluster_id, result); 92 cluster_id, result);
@@ -106,7 +106,7 @@ static int __hwahc_op_set_num_dnts(struct wusbhc *wusbhc, u8 interval, u8 slots)
106 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 106 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
107 interval << 8 | slots, 107 interval << 8 | slots,
108 wa->usb_iface->cur_altsetting->desc.bInterfaceNumber, 108 wa->usb_iface->cur_altsetting->desc.bInterfaceNumber,
109 NULL, 0, 1000 /* FIXME: arbitrary */); 109 NULL, 0, USB_CTRL_SET_TIMEOUT);
110} 110}
111 111
112/* 112/*
@@ -281,7 +281,7 @@ static void __hwahc_op_wusbhc_stop(struct wusbhc *wusbhc, int delay)
281 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 281 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
282 delay * 1000, 282 delay * 1000,
283 iface_no, 283 iface_no,
284 NULL, 0, 1000 /* FIXME: arbitrary */); 284 NULL, 0, USB_CTRL_SET_TIMEOUT);
285 if (ret == 0) 285 if (ret == 0)
286 msleep(delay); 286 msleep(delay);
287 287
@@ -310,7 +310,7 @@ static int __hwahc_op_bwa_set(struct wusbhc *wusbhc, s8 stream_index,
310 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 310 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
311 stream_index, 311 stream_index,
312 wa->usb_iface->cur_altsetting->desc.bInterfaceNumber, 312 wa->usb_iface->cur_altsetting->desc.bInterfaceNumber,
313 NULL, 0, 1000 /* FIXME: arbitrary */); 313 NULL, 0, USB_CTRL_SET_TIMEOUT);
314 if (result < 0) { 314 if (result < 0) {
315 dev_err(dev, "Cannot set WUSB stream index: %d\n", result); 315 dev_err(dev, "Cannot set WUSB stream index: %d\n", result);
316 goto out; 316 goto out;
@@ -321,7 +321,7 @@ static int __hwahc_op_bwa_set(struct wusbhc *wusbhc, s8 stream_index,
321 WUSB_REQ_SET_WUSB_MAS, 321 WUSB_REQ_SET_WUSB_MAS,
322 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 322 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
323 0, wa->usb_iface->cur_altsetting->desc.bInterfaceNumber, 323 0, wa->usb_iface->cur_altsetting->desc.bInterfaceNumber,
324 mas_le, 32, 1000 /* FIXME: arbitrary */); 324 mas_le, 32, USB_CTRL_SET_TIMEOUT);
325 if (result < 0) 325 if (result < 0)
326 dev_err(dev, "Cannot set WUSB MAS allocation: %d\n", result); 326 dev_err(dev, "Cannot set WUSB MAS allocation: %d\n", result);
327out: 327out:
@@ -355,7 +355,7 @@ static int __hwahc_op_mmcie_add(struct wusbhc *wusbhc, u8 interval,
355 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 355 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
356 interval << 8 | repeat_cnt, 356 interval << 8 | repeat_cnt,
357 handle << 8 | iface_no, 357 handle << 8 | iface_no,
358 wuie, wuie->bLength, 1000 /* FIXME: arbitrary */); 358 wuie, wuie->bLength, USB_CTRL_SET_TIMEOUT);
359} 359}
360 360
361/* 361/*
@@ -372,7 +372,7 @@ static int __hwahc_op_mmcie_rm(struct wusbhc *wusbhc, u8 handle)
372 WUSB_REQ_REMOVE_MMC_IE, 372 WUSB_REQ_REMOVE_MMC_IE,
373 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 373 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
374 0, handle << 8 | iface_no, 374 0, handle << 8 | iface_no,
375 NULL, 0, 1000 /* FIXME: arbitrary */); 375 NULL, 0, USB_CTRL_SET_TIMEOUT);
376} 376}
377 377
378/* 378/*
@@ -415,7 +415,7 @@ static int __hwahc_op_dev_info_set(struct wusbhc *wusbhc,
415 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 415 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
416 0, wusb_dev->port_idx << 8 | iface_no, 416 0, wusb_dev->port_idx << 8 | iface_no,
417 dev_info, sizeof(struct hwa_dev_info), 417 dev_info, sizeof(struct hwa_dev_info),
418 1000 /* FIXME: arbitrary */); 418 USB_CTRL_SET_TIMEOUT);
419 kfree(dev_info); 419 kfree(dev_info);
420 return ret; 420 return ret;
421} 421}
@@ -455,7 +455,7 @@ static int __hwahc_dev_set_key(struct wusbhc *wusbhc, u8 port_idx, u32 tkid,
455 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 455 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
456 USB_DT_KEY << 8 | key_idx, 456 USB_DT_KEY << 8 | key_idx,
457 port_idx << 8 | iface_no, 457 port_idx << 8 | iface_no,
458 keyd, keyd_len, 1000 /* FIXME: arbitrary */); 458 keyd, keyd_len, USB_CTRL_SET_TIMEOUT);
459 459
460 kzfree(keyd); /* clear keys etc. */ 460 kzfree(keyd); /* clear keys etc. */
461 return result; 461 return result;
@@ -497,7 +497,7 @@ static int __hwahc_op_set_ptk(struct wusbhc *wusbhc, u8 port_idx, u32 tkid,
497 USB_REQ_SET_ENCRYPTION, 497 USB_REQ_SET_ENCRYPTION,
498 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 498 USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
499 encryption_value, port_idx << 8 | iface_no, 499 encryption_value, port_idx << 8 | iface_no,
500 NULL, 0, 1000 /* FIXME: arbitrary */); 500 NULL, 0, USB_CTRL_SET_TIMEOUT);
501 if (result < 0) 501 if (result < 0)
502 dev_err(wusbhc->dev, "Can't set host's WUSB encryption for " 502 dev_err(wusbhc->dev, "Can't set host's WUSB encryption for "
503 "port index %u to %s (value %d): %d\n", port_idx, 503 "port index %u to %s (value %d): %d\n", port_idx,