wa-rpipe.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. /*
  2. * WUSB Wire Adapter
  3. * rpipe management
  4. *
  5. * Copyright (C) 2005-2006 Intel Corporation
  6. * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License version
  10. * 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  20. * 02110-1301, USA.
  21. *
  22. *
  23. * FIXME: docs
  24. *
  25. * RPIPE
  26. *
  27. * Targeted at different downstream endpoints
  28. *
  29. * Descriptor: use to config the remote pipe.
  30. *
  31. * The number of blocks could be dynamic (wBlocks in descriptor is
  32. * 0)--need to schedule them then.
  33. *
  34. * Each bit in wa->rpipe_bm represents if an rpipe is being used or
  35. * not. Rpipes are represented with a 'struct wa_rpipe' that is
  36. * attached to the hcpriv member of a 'struct usb_host_endpoint'.
  37. *
  38. * When you need to xfer data to an endpoint, you get an rpipe for it
  39. * with wa_ep_rpipe_get(), which gives you a reference to the rpipe
  40. * and keeps a single one (the first one) with the endpoint. When you
  41. * are done transferring, you drop that reference. At the end the
  42. * rpipe is always allocated and bound to the endpoint. There it might
  43. * be recycled when not used.
  44. *
  45. * Addresses:
  46. *
  47. * We use a 1:1 mapping mechanism between port address (0 based
  48. * index, actually) and the address. The USB stack knows about this.
  49. *
  50. * USB Stack port number 4 (1 based)
  51. * WUSB code port index 3 (0 based)
  52. * USB Address 5 (2 based -- 0 is for default, 1 for root hub)
  53. *
  54. * Now, because we don't use the concept as default address exactly
  55. * like the (wired) USB code does, we need to kind of skip it. So we
  56. * never take addresses from the urb->pipe, but from the
  57. * urb->dev->devnum, to make sure that we always have the right
  58. * destination address.
  59. */
  60. #include <linux/init.h>
  61. #include <linux/atomic.h>
  62. #include <linux/bitmap.h>
  63. #include <linux/slab.h>
  64. #include <linux/export.h>
  65. #include "wusbhc.h"
  66. #include "wa-hc.h"
  67. static int __rpipe_get_descr(struct wahc *wa,
  68. struct usb_rpipe_descriptor *descr, u16 index)
  69. {
  70. ssize_t result;
  71. struct device *dev = &wa->usb_iface->dev;
  72. /* Get the RPIPE descriptor -- we cannot use the usb_get_descriptor()
  73. * function because the arguments are different.
  74. */
  75. result = usb_control_msg(
  76. wa->usb_dev, usb_rcvctrlpipe(wa->usb_dev, 0),
  77. USB_REQ_GET_DESCRIPTOR,
  78. USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_RPIPE,
  79. USB_DT_RPIPE<<8, index, descr, sizeof(*descr),
  80. 1000 /* FIXME: arbitrary */);
  81. if (result < 0) {
  82. dev_err(dev, "rpipe %u: get descriptor failed: %d\n",
  83. index, (int)result);
  84. goto error;
  85. }
  86. if (result < sizeof(*descr)) {
  87. dev_err(dev, "rpipe %u: got short descriptor "
  88. "(%zd vs %zd bytes needed)\n",
  89. index, result, sizeof(*descr));
  90. result = -EINVAL;
  91. goto error;
  92. }
  93. result = 0;
  94. error:
  95. return result;
  96. }
  97. /*
  98. *
  99. * The descriptor is assumed to be properly initialized (ie: you got
  100. * it through __rpipe_get_descr()).
  101. */
  102. static int __rpipe_set_descr(struct wahc *wa,
  103. struct usb_rpipe_descriptor *descr, u16 index)
  104. {
  105. ssize_t result;
  106. struct device *dev = &wa->usb_iface->dev;
  107. /* we cannot use the usb_get_descriptor() function because the
  108. * arguments are different.
  109. */
  110. result = usb_control_msg(
  111. wa->usb_dev, usb_sndctrlpipe(wa->usb_dev, 0),
  112. USB_REQ_SET_DESCRIPTOR,
  113. USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_RPIPE,
  114. USB_DT_RPIPE<<8, index, descr, sizeof(*descr),
  115. HZ / 10);
  116. if (result < 0) {
  117. dev_err(dev, "rpipe %u: set descriptor failed: %d\n",
  118. index, (int)result);
  119. goto error;
  120. }
  121. if (result < sizeof(*descr)) {
  122. dev_err(dev, "rpipe %u: sent short descriptor "
  123. "(%zd vs %zd bytes required)\n",
  124. index, result, sizeof(*descr));
  125. result = -EINVAL;
  126. goto error;
  127. }
  128. result = 0;
  129. error:
  130. return result;
  131. }
  132. static void rpipe_init(struct wa_rpipe *rpipe)
  133. {
  134. kref_init(&rpipe->refcnt);
  135. spin_lock_init(&rpipe->seg_lock);
  136. INIT_LIST_HEAD(&rpipe->seg_list);
  137. INIT_LIST_HEAD(&rpipe->list_node);
  138. }
  139. static unsigned rpipe_get_idx(struct wahc *wa, unsigned rpipe_idx)
  140. {
  141. unsigned long flags;
  142. spin_lock_irqsave(&wa->rpipe_lock, flags);
  143. rpipe_idx = find_next_zero_bit(wa->rpipe_bm, wa->rpipes, rpipe_idx);
  144. if (rpipe_idx < wa->rpipes)
  145. set_bit(rpipe_idx, wa->rpipe_bm);
  146. spin_unlock_irqrestore(&wa->rpipe_lock, flags);
  147. return rpipe_idx;
  148. }
  149. static void rpipe_put_idx(struct wahc *wa, unsigned rpipe_idx)
  150. {
  151. unsigned long flags;
  152. spin_lock_irqsave(&wa->rpipe_lock, flags);
  153. clear_bit(rpipe_idx, wa->rpipe_bm);
  154. spin_unlock_irqrestore(&wa->rpipe_lock, flags);
  155. }
  156. void rpipe_destroy(struct kref *_rpipe)
  157. {
  158. struct wa_rpipe *rpipe = container_of(_rpipe, struct wa_rpipe, refcnt);
  159. u8 index = le16_to_cpu(rpipe->descr.wRPipeIndex);
  160. if (rpipe->ep)
  161. rpipe->ep->hcpriv = NULL;
  162. rpipe_put_idx(rpipe->wa, index);
  163. wa_put(rpipe->wa);
  164. kfree(rpipe);
  165. }
  166. EXPORT_SYMBOL_GPL(rpipe_destroy);
  167. /*
  168. * Locate an idle rpipe, create an structure for it and return it
  169. *
  170. * @wa is referenced and unlocked
  171. * @crs enum rpipe_attr, required endpoint characteristics
  172. *
  173. * The rpipe can be used only sequentially (not in parallel).
  174. *
  175. * The rpipe is moved into the "ready" state.
  176. */
  177. static int rpipe_get_idle(struct wa_rpipe **prpipe, struct wahc *wa, u8 crs,
  178. gfp_t gfp)
  179. {
  180. int result;
  181. unsigned rpipe_idx;
  182. struct wa_rpipe *rpipe;
  183. struct device *dev = &wa->usb_iface->dev;
  184. rpipe = kzalloc(sizeof(*rpipe), gfp);
  185. if (rpipe == NULL)
  186. return -ENOMEM;
  187. rpipe_init(rpipe);
  188. /* Look for an idle pipe */
  189. for (rpipe_idx = 0; rpipe_idx < wa->rpipes; rpipe_idx++) {
  190. rpipe_idx = rpipe_get_idx(wa, rpipe_idx);
  191. if (rpipe_idx >= wa->rpipes) /* no more pipes :( */
  192. break;
  193. result = __rpipe_get_descr(wa, &rpipe->descr, rpipe_idx);
  194. if (result < 0)
  195. dev_err(dev, "Can't get descriptor for rpipe %u: %d\n",
  196. rpipe_idx, result);
  197. else if ((rpipe->descr.bmCharacteristics & crs) != 0)
  198. goto found;
  199. rpipe_put_idx(wa, rpipe_idx);
  200. }
  201. *prpipe = NULL;
  202. kfree(rpipe);
  203. return -ENXIO;
  204. found:
  205. set_bit(rpipe_idx, wa->rpipe_bm);
  206. rpipe->wa = wa_get(wa);
  207. *prpipe = rpipe;
  208. return 0;
  209. }
  210. static int __rpipe_reset(struct wahc *wa, unsigned index)
  211. {
  212. int result;
  213. struct device *dev = &wa->usb_iface->dev;
  214. result = usb_control_msg(
  215. wa->usb_dev, usb_sndctrlpipe(wa->usb_dev, 0),
  216. USB_REQ_RPIPE_RESET,
  217. USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_RPIPE,
  218. 0, index, NULL, 0, 1000 /* FIXME: arbitrary */);
  219. if (result < 0)
  220. dev_err(dev, "rpipe %u: reset failed: %d\n",
  221. index, result);
  222. return result;
  223. }
  224. /*
  225. * Fake companion descriptor for ep0
  226. *
  227. * See WUSB1.0[7.4.4], most of this is zero for bulk/int/ctl
  228. */
  229. static struct usb_wireless_ep_comp_descriptor epc0 = {
  230. .bLength = sizeof(epc0),
  231. .bDescriptorType = USB_DT_WIRELESS_ENDPOINT_COMP,
  232. .bMaxBurst = 1,
  233. .bMaxSequence = 2,
  234. };
  235. /*
  236. * Look for EP companion descriptor
  237. *
  238. * Get there, look for Inara in the endpoint's extra descriptors
  239. */
  240. static struct usb_wireless_ep_comp_descriptor *rpipe_epc_find(
  241. struct device *dev, struct usb_host_endpoint *ep)
  242. {
  243. void *itr;
  244. size_t itr_size;
  245. struct usb_descriptor_header *hdr;
  246. struct usb_wireless_ep_comp_descriptor *epcd;
  247. if (ep->desc.bEndpointAddress == 0) {
  248. epcd = &epc0;
  249. goto out;
  250. }
  251. itr = ep->extra;
  252. itr_size = ep->extralen;
  253. epcd = NULL;
  254. while (itr_size > 0) {
  255. if (itr_size < sizeof(*hdr)) {
  256. dev_err(dev, "HW Bug? ep 0x%02x: extra descriptors "
  257. "at offset %zu: only %zu bytes left\n",
  258. ep->desc.bEndpointAddress,
  259. itr - (void *) ep->extra, itr_size);
  260. break;
  261. }
  262. hdr = itr;
  263. if (hdr->bDescriptorType == USB_DT_WIRELESS_ENDPOINT_COMP) {
  264. epcd = itr;
  265. break;
  266. }
  267. if (hdr->bLength > itr_size) {
  268. dev_err(dev, "HW Bug? ep 0x%02x: extra descriptor "
  269. "at offset %zu (type 0x%02x) "
  270. "length %d but only %zu bytes left\n",
  271. ep->desc.bEndpointAddress,
  272. itr - (void *) ep->extra, hdr->bDescriptorType,
  273. hdr->bLength, itr_size);
  274. break;
  275. }
  276. itr += hdr->bLength;
  277. itr_size -= hdr->bDescriptorType;
  278. }
  279. out:
  280. return epcd;
  281. }
  282. /*
  283. * Aim an rpipe to its device & endpoint destination
  284. *
  285. * Make sure we change the address to unauthenticathed if the device
  286. * is WUSB and it is not authenticated.
  287. */
  288. static int rpipe_aim(struct wa_rpipe *rpipe, struct wahc *wa,
  289. struct usb_host_endpoint *ep, struct urb *urb, gfp_t gfp)
  290. {
  291. int result = -ENOMSG; /* better code for lack of companion? */
  292. struct device *dev = &wa->usb_iface->dev;
  293. struct usb_device *usb_dev = urb->dev;
  294. struct usb_wireless_ep_comp_descriptor *epcd;
  295. u32 ack_window, epcd_max_sequence;
  296. u8 unauth;
  297. epcd = rpipe_epc_find(dev, ep);
  298. if (epcd == NULL) {
  299. dev_err(dev, "ep 0x%02x: can't find companion descriptor\n",
  300. ep->desc.bEndpointAddress);
  301. goto error;
  302. }
  303. unauth = usb_dev->wusb && !usb_dev->authenticated ? 0x80 : 0;
  304. __rpipe_reset(wa, le16_to_cpu(rpipe->descr.wRPipeIndex));
  305. atomic_set(&rpipe->segs_available, le16_to_cpu(rpipe->descr.wRequests));
  306. /* FIXME: block allocation system; request with queuing and timeout */
  307. /* FIXME: compute so seg_size > ep->maxpktsize */
  308. rpipe->descr.wBlocks = cpu_to_le16(16); /* given */
  309. /* ep0 maxpktsize is 0x200 (WUSB1.0[4.8.1]) */
  310. rpipe->descr.wMaxPacketSize = cpu_to_le16(ep->desc.wMaxPacketSize);
  311. rpipe->descr.hwa_bMaxBurst = max(min_t(unsigned int,
  312. epcd->bMaxBurst, 16U), 1U);
  313. rpipe->descr.hwa_bDeviceInfoIndex =
  314. wusb_port_no_to_idx(urb->dev->portnum);
  315. /* FIXME: use maximum speed as supported or recommended by device */
  316. rpipe->descr.bSpeed = usb_pipeendpoint(urb->pipe) == 0 ?
  317. UWB_PHY_RATE_53 : UWB_PHY_RATE_200;
  318. dev_dbg(dev, "addr %u (0x%02x) rpipe #%u ep# %u speed %d\n",
  319. urb->dev->devnum, urb->dev->devnum | unauth,
  320. le16_to_cpu(rpipe->descr.wRPipeIndex),
  321. usb_pipeendpoint(urb->pipe), rpipe->descr.bSpeed);
  322. rpipe->descr.hwa_reserved = 0;
  323. rpipe->descr.bEndpointAddress = ep->desc.bEndpointAddress;
  324. /* FIXME: bDataSequence */
  325. rpipe->descr.bDataSequence = 0;
  326. /* start with base window of hwa_bMaxBurst bits starting at 0. */
  327. ack_window = 0xFFFFFFFF >> (32 - rpipe->descr.hwa_bMaxBurst);
  328. rpipe->descr.dwCurrentWindow = cpu_to_le32(ack_window);
  329. epcd_max_sequence = max(min_t(unsigned int,
  330. epcd->bMaxSequence, 32U), 2U);
  331. rpipe->descr.bMaxDataSequence = epcd_max_sequence - 1;
  332. rpipe->descr.bInterval = ep->desc.bInterval;
  333. if (usb_endpoint_xfer_isoc(&ep->desc))
  334. rpipe->descr.bOverTheAirInterval = epcd->bOverTheAirInterval;
  335. else
  336. rpipe->descr.bOverTheAirInterval = 0; /* 0 if not isoc */
  337. /* FIXME: xmit power & preamble blah blah */
  338. rpipe->descr.bmAttribute = (ep->desc.bmAttributes &
  339. USB_ENDPOINT_XFERTYPE_MASK);
  340. /* rpipe->descr.bmCharacteristics RO */
  341. rpipe->descr.bmRetryOptions = (wa->wusb->retry_count & 0xF);
  342. /* FIXME: use for assessing link quality? */
  343. rpipe->descr.wNumTransactionErrors = 0;
  344. result = __rpipe_set_descr(wa, &rpipe->descr,
  345. le16_to_cpu(rpipe->descr.wRPipeIndex));
  346. if (result < 0) {
  347. dev_err(dev, "Cannot aim rpipe: %d\n", result);
  348. goto error;
  349. }
  350. result = 0;
  351. error:
  352. return result;
  353. }
  354. /*
  355. * Check an aimed rpipe to make sure it points to where we want
  356. *
  357. * We use bit 19 of the Linux USB pipe bitmap for unauth vs auth
  358. * space; when it is like that, we or 0x80 to make an unauth address.
  359. */
  360. static int rpipe_check_aim(const struct wa_rpipe *rpipe, const struct wahc *wa,
  361. const struct usb_host_endpoint *ep,
  362. const struct urb *urb, gfp_t gfp)
  363. {
  364. int result = 0;
  365. struct device *dev = &wa->usb_iface->dev;
  366. u8 portnum = wusb_port_no_to_idx(urb->dev->portnum);
  367. #define AIM_CHECK(rdf, val, text) \
  368. do { \
  369. if (rpipe->descr.rdf != (val)) { \
  370. dev_err(dev, \
  371. "rpipe aim discrepancy: " #rdf " " text "\n", \
  372. rpipe->descr.rdf, (val)); \
  373. result = -EINVAL; \
  374. WARN_ON(1); \
  375. } \
  376. } while (0)
  377. AIM_CHECK(hwa_bDeviceInfoIndex, portnum, "(%u vs %u)");
  378. AIM_CHECK(bSpeed, usb_pipeendpoint(urb->pipe) == 0 ?
  379. UWB_PHY_RATE_53 : UWB_PHY_RATE_200,
  380. "(%u vs %u)");
  381. AIM_CHECK(bEndpointAddress, ep->desc.bEndpointAddress, "(%u vs %u)");
  382. AIM_CHECK(bInterval, ep->desc.bInterval, "(%u vs %u)");
  383. AIM_CHECK(bmAttribute, ep->desc.bmAttributes & 0x03, "(%u vs %u)");
  384. #undef AIM_CHECK
  385. return result;
  386. }
  387. #ifndef CONFIG_BUG
  388. #define CONFIG_BUG 0
  389. #endif
  390. /*
  391. * Make sure there is an rpipe allocated for an endpoint
  392. *
  393. * If already allocated, we just refcount it; if not, we get an
  394. * idle one, aim it to the right location and take it.
  395. *
  396. * Attaches to ep->hcpriv and rpipe->ep to ep.
  397. */
  398. int rpipe_get_by_ep(struct wahc *wa, struct usb_host_endpoint *ep,
  399. struct urb *urb, gfp_t gfp)
  400. {
  401. int result = 0;
  402. struct device *dev = &wa->usb_iface->dev;
  403. struct wa_rpipe *rpipe;
  404. u8 eptype;
  405. mutex_lock(&wa->rpipe_mutex);
  406. rpipe = ep->hcpriv;
  407. if (rpipe != NULL) {
  408. if (CONFIG_BUG == 1) {
  409. result = rpipe_check_aim(rpipe, wa, ep, urb, gfp);
  410. if (result < 0)
  411. goto error;
  412. }
  413. __rpipe_get(rpipe);
  414. dev_dbg(dev, "ep 0x%02x: reusing rpipe %u\n",
  415. ep->desc.bEndpointAddress,
  416. le16_to_cpu(rpipe->descr.wRPipeIndex));
  417. } else {
  418. /* hmm, assign idle rpipe, aim it */
  419. result = -ENOBUFS;
  420. eptype = ep->desc.bmAttributes & 0x03;
  421. result = rpipe_get_idle(&rpipe, wa, 1 << eptype, gfp);
  422. if (result < 0)
  423. goto error;
  424. result = rpipe_aim(rpipe, wa, ep, urb, gfp);
  425. if (result < 0) {
  426. rpipe_put(rpipe);
  427. goto error;
  428. }
  429. ep->hcpriv = rpipe;
  430. rpipe->ep = ep;
  431. __rpipe_get(rpipe); /* for caching into ep->hcpriv */
  432. dev_dbg(dev, "ep 0x%02x: using rpipe %u\n",
  433. ep->desc.bEndpointAddress,
  434. le16_to_cpu(rpipe->descr.wRPipeIndex));
  435. }
  436. error:
  437. mutex_unlock(&wa->rpipe_mutex);
  438. return result;
  439. }
  440. /*
  441. * Allocate the bitmap for each rpipe.
  442. */
  443. int wa_rpipes_create(struct wahc *wa)
  444. {
  445. wa->rpipes = le16_to_cpu(wa->wa_descr->wNumRPipes);
  446. wa->rpipe_bm = kzalloc(BITS_TO_LONGS(wa->rpipes)*sizeof(unsigned long),
  447. GFP_KERNEL);
  448. if (wa->rpipe_bm == NULL)
  449. return -ENOMEM;
  450. return 0;
  451. }
  452. void wa_rpipes_destroy(struct wahc *wa)
  453. {
  454. struct device *dev = &wa->usb_iface->dev;
  455. if (!bitmap_empty(wa->rpipe_bm, wa->rpipes)) {
  456. char buf[256];
  457. WARN_ON(1);
  458. bitmap_scnprintf(buf, sizeof(buf), wa->rpipe_bm, wa->rpipes);
  459. dev_err(dev, "BUG: pipes not released on exit: %s\n", buf);
  460. }
  461. kfree(wa->rpipe_bm);
  462. }
  463. /*
  464. * Release resources allocated for an endpoint
  465. *
  466. * If there is an associated rpipe to this endpoint, Abort any pending
  467. * transfers and put it. If the rpipe ends up being destroyed,
  468. * __rpipe_destroy() will cleanup ep->hcpriv.
  469. *
  470. * This is called before calling hcd->stop(), so you don't need to do
  471. * anything else in there.
  472. */
  473. void rpipe_ep_disable(struct wahc *wa, struct usb_host_endpoint *ep)
  474. {
  475. struct wa_rpipe *rpipe;
  476. mutex_lock(&wa->rpipe_mutex);
  477. rpipe = ep->hcpriv;
  478. if (rpipe != NULL) {
  479. u16 index = le16_to_cpu(rpipe->descr.wRPipeIndex);
  480. usb_control_msg(
  481. wa->usb_dev, usb_rcvctrlpipe(wa->usb_dev, 0),
  482. USB_REQ_RPIPE_ABORT,
  483. USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_RPIPE,
  484. 0, index, NULL, 0, 1000 /* FIXME: arbitrary */);
  485. rpipe_put(rpipe);
  486. }
  487. mutex_unlock(&wa->rpipe_mutex);
  488. }
  489. EXPORT_SYMBOL_GPL(rpipe_ep_disable);
  490. /* Clear the stalled status of an RPIPE. */
  491. void rpipe_clear_feature_stalled(struct wahc *wa, struct usb_host_endpoint *ep)
  492. {
  493. struct wa_rpipe *rpipe;
  494. mutex_lock(&wa->rpipe_mutex);
  495. rpipe = ep->hcpriv;
  496. if (rpipe != NULL) {
  497. u16 index = le16_to_cpu(rpipe->descr.wRPipeIndex);
  498. usb_control_msg(
  499. wa->usb_dev, usb_rcvctrlpipe(wa->usb_dev, 0),
  500. USB_REQ_CLEAR_FEATURE,
  501. USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_RPIPE,
  502. RPIPE_STALL, index, NULL, 0, 1000);
  503. }
  504. mutex_unlock(&wa->rpipe_mutex);
  505. }
  506. EXPORT_SYMBOL_GPL(rpipe_clear_feature_stalled);