source: mainline/uspace/drv/uhci-hcd/iface.c@ 2e6bbcf

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 2e6bbcf was 2e6bbcf, checked in by Jan Vesely <jano.vesely@…>, 15 years ago

Use one function to setup all transfers.

  • Property mode set to 100644
File size: 20.2 KB
Line 
1/*
2 * Copyright (c) 2011 Vojtech Horky, Jan Vesely
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28/** @addtogroup drvusbuhcihc
29 * @{
30 */
31/** @file
32 * @brief UHCI driver hc interface implementation
33 */
34#include <ddf/driver.h>
35#include <errno.h>
36
37#include <usb/debug.h>
38#include <usb/host/endpoint.h>
39
40#include "iface.h"
41#include "hc.h"
42
43static inline int setup_batch(
44 ddf_fun_t *fun, usb_target_t target, usb_direction_t direction,
45 void *data, size_t size, void * setup_data, size_t setup_size,
46 usbhc_iface_transfer_in_callback_t in,
47 usbhc_iface_transfer_out_callback_t out, void *arg, const char* name,
48 hc_t **hc, usb_transfer_batch_t **batch)
49{
50 assert(hc);
51 assert(batch);
52 assert(fun);
53 *hc = fun_to_hc(fun);
54 assert(*hc);
55
56 size_t res_bw;
57 endpoint_t *ep = usb_endpoint_manager_get_ep(&(*hc)->ep_manager,
58 target.address, target.endpoint, direction, &res_bw);
59 if (ep == NULL) {
60 usb_log_error("Endpoint(%d:%d) not registered for %s.\n",
61 target.address, target.endpoint, name);
62 return ENOENT;
63 }
64
65 const size_t bw = bandwidth_count_usb11(
66 ep->speed, ep->transfer_type, size, ep->max_packet_size);
67 if (res_bw < bw) {
68 usb_log_error("Endpoint(%d:%d) %s needs %zu bw "
69 "but only %zu is reserved.\n",
70 name, target.address, target.endpoint, bw, res_bw);
71 return ENOSPC;
72 }
73 usb_log_debug("%s %d:%d %zu(%zu).\n",
74 name, target.address, target.endpoint, size, ep->max_packet_size);
75
76 assert(ep->speed ==
77 usb_device_keeper_get_speed(&(*hc)->manager, target.address));
78// assert(ep->max_packet_size == max_packet_size);
79// assert(ep->transfer_type == USB_TRANSFER_CONTROL);
80
81 *batch =
82 batch_get(fun, ep, data, size, setup_data, setup_size,
83 in, out, arg);
84 if (!batch)
85 return ENOMEM;
86 return EOK;
87}
88
89
90/** Reserve default address interface function
91 *
92 * @param[in] fun DDF function that was called.
93 * @param[in] speed Speed to associate with the new default address.
94 * @return Error code.
95 */
96static int reserve_default_address(ddf_fun_t *fun, usb_speed_t speed)
97{
98 assert(fun);
99 hc_t *hc = fun_to_hc(fun);
100 assert(hc);
101 usb_log_debug("Default address request with speed %d.\n", speed);
102 usb_device_keeper_reserve_default_address(&hc->manager, speed);
103 return EOK;
104#if 0
105 endpoint_t *ep = malloc(sizeof(endpoint_t));
106 if (ep == NULL)
107 return ENOMEM;
108 const size_t max_packet_size = speed == USB_SPEED_LOW ? 8 : 64;
109 endpoint_init(ep, USB_TRANSFER_CONTROL, speed, max_packet_size);
110 int ret;
111try_retgister:
112 ret = usb_endpoint_manager_register_ep(&hc->ep_manager,
113 USB_ADDRESS_DEFAULT, 0, USB_DIRECTION_BOTH, ep, endpoint_destroy, 0);
114 if (ret == EEXISTS) {
115 async_usleep(1000);
116 goto try_retgister;
117 }
118 if (ret != EOK) {
119 endpoint_destroy(ep);
120 }
121 return ret;
122#endif
123}
124/*----------------------------------------------------------------------------*/
125/** Release default address interface function
126 *
127 * @param[in] fun DDF function that was called.
128 * @return Error code.
129 */
130static int release_default_address(ddf_fun_t *fun)
131{
132 assert(fun);
133 hc_t *hc = fun_to_hc(fun);
134 assert(hc);
135 usb_log_debug("Default address release.\n");
136// return usb_endpoint_manager_unregister_ep(&hc->ep_manager,
137// USB_ADDRESS_DEFAULT, 0, USB_DIRECTION_BOTH);
138 usb_device_keeper_release_default_address(&hc->manager);
139 return EOK;
140}
141/*----------------------------------------------------------------------------*/
142/** Request address interface function
143 *
144 * @param[in] fun DDF function that was called.
145 * @param[in] speed Speed to associate with the new default address.
146 * @param[out] address Place to write a new address.
147 * @return Error code.
148 */
149static int request_address(
150 ddf_fun_t *fun, usb_speed_t speed, usb_address_t *address)
151{
152 assert(fun);
153 hc_t *hc = fun_to_hc(fun);
154 assert(hc);
155 assert(address);
156
157 usb_log_debug("Address request with speed %d.\n", speed);
158 *address = device_keeper_get_free_address(&hc->manager, speed);
159 usb_log_debug("Address request with result: %d.\n", *address);
160 if (*address <= 0)
161 return *address;
162 return EOK;
163}
164/*----------------------------------------------------------------------------*/
165/** Bind address interface function
166 *
167 * @param[in] fun DDF function that was called.
168 * @param[in] address Address of the device
169 * @param[in] handle Devman handle of the device driver.
170 * @return Error code.
171 */
172static int bind_address(
173 ddf_fun_t *fun, usb_address_t address, devman_handle_t handle)
174{
175 assert(fun);
176 hc_t *hc = fun_to_hc(fun);
177 assert(hc);
178 usb_log_debug("Address bind %d-%d.\n", address, handle);
179 usb_device_keeper_bind(&hc->manager, address, handle);
180 return EOK;
181}
182/*----------------------------------------------------------------------------*/
183/** Release address interface function
184 *
185 * @param[in] fun DDF function that was called.
186 * @param[in] address USB address to be released.
187 * @return Error code.
188 */
189static int release_address(ddf_fun_t *fun, usb_address_t address)
190{
191 assert(fun);
192 hc_t *hc = fun_to_hc(fun);
193 assert(hc);
194 usb_log_debug("Address release %d.\n", address);
195 usb_device_keeper_release(&hc->manager, address);
196 return EOK;
197}
198/*----------------------------------------------------------------------------*/
199static int register_endpoint(
200 ddf_fun_t *fun, usb_address_t address, usb_endpoint_t endpoint,
201 usb_transfer_type_t transfer_type, usb_direction_t direction,
202 size_t max_packet_size, unsigned int interval)
203{
204 hc_t *hc = fun_to_hc(fun);
205 assert(hc);
206 const usb_speed_t speed =
207 usb_device_keeper_get_speed(&hc->manager, address);
208 const size_t size =
209 (transfer_type == USB_TRANSFER_INTERRUPT
210 || transfer_type == USB_TRANSFER_ISOCHRONOUS) ?
211 max_packet_size : 0;
212 int ret;
213
214 endpoint_t *ep = malloc(sizeof(endpoint_t));
215 if (ep == NULL)
216 return ENOMEM;
217 ret = endpoint_init(ep, address, endpoint, direction,
218 transfer_type, speed, max_packet_size);
219 if (ret != EOK) {
220 free(ep);
221 return ret;
222 }
223
224 usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n",
225 address, endpoint, usb_str_transfer_type(transfer_type),
226 usb_str_speed(speed), direction, size, max_packet_size, interval);
227
228 ret = usb_endpoint_manager_register_ep(&hc->ep_manager, ep, size);
229 if (ret != EOK) {
230 endpoint_destroy(ep);
231 } else {
232 usb_device_keeper_add_ep(&hc->manager, address, ep);
233 }
234 return ret;
235}
236/*----------------------------------------------------------------------------*/
237static int unregister_endpoint(
238 ddf_fun_t *fun, usb_address_t address,
239 usb_endpoint_t endpoint, usb_direction_t direction)
240{
241 hc_t *hc = fun_to_hc(fun);
242 assert(hc);
243 usb_log_debug("Unregister endpoint %d:%d %d.\n",
244 address, endpoint, direction);
245 return usb_endpoint_manager_unregister_ep(&hc->ep_manager, address,
246 endpoint, direction);
247}
248/*----------------------------------------------------------------------------*/
249/** Interrupt out transaction interface function
250 *
251 * @param[in] fun DDF function that was called.
252 * @param[in] target USB device to write to.
253 * @param[in] max_packet_size maximum size of data packet the device accepts
254 * @param[in] data Source of data.
255 * @param[in] size Size of data source.
256 * @param[in] callback Function to call on transaction completion
257 * @param[in] arg Additional for callback function.
258 * @return Error code.
259 */
260static int interrupt_out(
261 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
262 size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
263{
264 usb_transfer_batch_t *batch = NULL;
265 hc_t *hc = NULL;
266 int ret = setup_batch(fun, target, USB_DIRECTION_OUT, data, size,
267 NULL, 0, NULL, callback, arg, "Interrupt OUT", &hc, &batch);
268 if (ret != EOK)
269 return ret;
270#if 0
271 assert(fun);
272 hc_t *hc = fun_to_hc(fun);
273 assert(hc);
274
275 usb_log_debug("Interrupt OUT %d:%d %zu(%zu).\n",
276 target.address, target.endpoint, size, max_packet_size);
277
278 size_t res_bw;
279 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
280 target.address, target.endpoint, USB_DIRECTION_OUT, &res_bw);
281 if (ep == NULL) {
282 usb_log_error("Endpoint(%d:%d) not registered for INT OUT.\n",
283 target.address, target.endpoint);
284 return ENOENT;
285 }
286 const size_t bw = bandwidth_count_usb11(ep->speed, ep->transfer_type,
287 size, ep->max_packet_size);
288 if (res_bw < bw) {
289 usb_log_error("Endpoint(%d:%d) INT OUT needs %zu bw "
290 "but only %zu is reserved.\n",
291 target.address, target.endpoint, bw, res_bw);
292 return ENOSPC;
293 }
294
295 assert(ep->speed ==
296 usb_device_keeper_get_speed(&hc->manager, target.address));
297 assert(ep->max_packet_size == max_packet_size);
298 assert(ep->transfer_type == USB_TRANSFER_INTERRUPT);
299
300 usb_transfer_batch_t *batch =
301 batch_get(fun, ep, data, size, NULL, 0, NULL, callback, arg);
302 if (!batch)
303 return ENOMEM;
304#endif
305 batch_interrupt_out(batch);
306 ret = hc_schedule(hc, batch);
307 if (ret != EOK) {
308 batch_dispose(batch);
309 }
310 return ret;
311}
312/*----------------------------------------------------------------------------*/
313/** Interrupt in transaction interface function
314 *
315 * @param[in] fun DDF function that was called.
316 * @param[in] target USB device to write to.
317 * @param[in] max_packet_size maximum size of data packet the device accepts
318 * @param[out] data Data destination.
319 * @param[in] size Size of data source.
320 * @param[in] callback Function to call on transaction completion
321 * @param[in] arg Additional for callback function.
322 * @return Error code.
323 */
324static int interrupt_in(
325 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
326 size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
327{
328 usb_transfer_batch_t *batch = NULL;
329 hc_t *hc = NULL;
330 int ret = setup_batch(fun, target, USB_DIRECTION_IN, data, size,
331 NULL, 0, callback, NULL, arg, "Interrupt IN", &hc, &batch);
332 if (ret != EOK)
333 return ret;
334#if 0
335 assert(fun);
336 hc_t *hc = fun_to_hc(fun);
337 assert(hc);
338
339 usb_log_debug("Interrupt IN %d:%d %zu(%zu).\n",
340 target.address, target.endpoint, size, max_packet_size);
341
342 size_t res_bw;
343 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
344 target.address, target.endpoint, USB_DIRECTION_IN, &res_bw);
345 if (ep == NULL) {
346 usb_log_error("Endpoint(%d:%d) not registered for INT IN.\n",
347 target.address, target.endpoint);
348 return ENOSPC;
349 }
350 const size_t bw = bandwidth_count_usb11(ep->speed, ep->transfer_type,
351 size, ep->max_packet_size);
352 if (res_bw < bw) {
353 usb_log_error("Endpoint(%d:%d) INT IN needs %zu bw "
354 "but only %zu bw is reserved.\n",
355 target.address, target.endpoint, bw, res_bw);
356 return ENOENT;
357 }
358
359 assert(ep->speed ==
360 usb_device_keeper_get_speed(&hc->manager, target.address));
361 assert(ep->max_packet_size == max_packet_size);
362 assert(ep->transfer_type == USB_TRANSFER_INTERRUPT);
363
364 usb_transfer_batch_t *batch =
365 batch_get(fun, ep, data, size, NULL, 0, callback, NULL, arg);
366 if (!batch)
367 return ENOMEM;
368#endif
369 batch_interrupt_in(batch);
370 ret = hc_schedule(hc, batch);
371 if (ret != EOK) {
372 batch_dispose(batch);
373 }
374 return ret;
375}
376/*----------------------------------------------------------------------------*/
377/** Bulk out transaction interface function
378 *
379 * @param[in] fun DDF function that was called.
380 * @param[in] target USB device to write to.
381 * @param[in] max_packet_size maximum size of data packet the device accepts
382 * @param[in] data Source of data.
383 * @param[in] size Size of data source.
384 * @param[in] callback Function to call on transaction completion
385 * @param[in] arg Additional for callback function.
386 * @return Error code.
387 */
388static int bulk_out(
389 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
390 size_t size, usbhc_iface_transfer_out_callback_t callback, void *arg)
391{
392 usb_transfer_batch_t *batch = NULL;
393 hc_t *hc = NULL;
394 int ret = setup_batch(fun, target, USB_DIRECTION_OUT, data, size,
395 NULL, 0, NULL, callback, arg, "Bulk OUT", &hc, &batch);
396 if (ret != EOK)
397 return ret;
398#if 0
399 assert(fun);
400 hc_t *hc = fun_to_hc(fun);
401 assert(hc);
402
403 usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n",
404 target.address, target.endpoint, size, max_packet_size);
405
406 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
407 target.address, target.endpoint, USB_DIRECTION_OUT, NULL);
408 if (ep == NULL) {
409 usb_log_error("Endpoint(%d:%d) not registered for BULK OUT.\n",
410 target.address, target.endpoint);
411 return ENOENT;
412 }
413 assert(ep->speed ==
414 usb_device_keeper_get_speed(&hc->manager, target.address));
415 assert(ep->max_packet_size == max_packet_size);
416 assert(ep->transfer_type == USB_TRANSFER_BULK);
417
418 usb_transfer_batch_t *batch =
419 batch_get(fun, ep, data, size, NULL, 0, NULL, callback, arg);
420 if (!batch)
421 return ENOMEM;
422#endif
423 batch_bulk_out(batch);
424 ret = hc_schedule(hc, batch);
425 if (ret != EOK) {
426 batch_dispose(batch);
427 }
428 return ret;
429}
430/*----------------------------------------------------------------------------*/
431/** Bulk in transaction interface function
432 *
433 * @param[in] fun DDF function that was called.
434 * @param[in] target USB device to write to.
435 * @param[in] max_packet_size maximum size of data packet the device accepts
436 * @param[out] data Data destination.
437 * @param[in] size Size of data source.
438 * @param[in] callback Function to call on transaction completion
439 * @param[in] arg Additional for callback function.
440 * @return Error code.
441 */
442static int bulk_in(
443 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size, void *data,
444 size_t size, usbhc_iface_transfer_in_callback_t callback, void *arg)
445{
446 usb_transfer_batch_t *batch = NULL;
447 hc_t *hc = NULL;
448 int ret = setup_batch(fun, target, USB_DIRECTION_IN, data, size,
449 NULL, 0, callback, NULL, arg, "Bulk IN", &hc, &batch);
450 if (ret != EOK)
451 return ret;
452#if 0
453 assert(fun);
454 hc_t *hc = fun_to_hc(fun);
455 assert(hc);
456
457 usb_log_debug("Bulk IN %d:%d %zu(%zu).\n",
458 target.address, target.endpoint, size, max_packet_size);
459
460 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
461 target.address, target.endpoint, USB_DIRECTION_IN, NULL);
462 if (ep == NULL) {
463 usb_log_error("Endpoint(%d:%d) not registered for BULK IN.\n",
464 target.address, target.endpoint);
465 return ENOENT;
466 }
467 assert(ep->speed ==
468 usb_device_keeper_get_speed(&hc->manager, target.address));
469 assert(ep->max_packet_size == max_packet_size);
470 assert(ep->transfer_type == USB_TRANSFER_BULK);
471
472 usb_transfer_batch_t *batch =
473 batch_get(fun, ep, data, size, NULL, 0, callback, NULL, arg);
474 if (!batch)
475 return ENOMEM;
476#endif
477 batch_bulk_in(batch);
478 ret = hc_schedule(hc, batch);
479 if (ret != EOK) {
480 batch_dispose(batch);
481 }
482 return ret;
483}
484/*----------------------------------------------------------------------------*/
485/** Control write transaction interface function
486 *
487 * @param[in] fun DDF function that was called.
488 * @param[in] target USB device to write to.
489 * @param[in] max_packet_size maximum size of data packet the device accepts.
490 * @param[in] setup_data Data to send with SETUP transfer.
491 * @param[in] setup_size Size of data to send with SETUP transfer (always 8B).
492 * @param[in] data Source of data.
493 * @param[in] size Size of data source.
494 * @param[in] callback Function to call on transaction completion.
495 * @param[in] arg Additional for callback function.
496 * @return Error code.
497 */
498static int control_write(
499 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
500 void *setup_data, size_t setup_size, void *data, size_t size,
501 usbhc_iface_transfer_out_callback_t callback, void *arg)
502{
503 usb_transfer_batch_t *batch = NULL;
504 hc_t *hc = NULL;
505 int ret = setup_batch(fun, target, USB_DIRECTION_BOTH, data, size,
506 setup_data, setup_size, NULL, callback, arg, "Control WRITE",
507 &hc, &batch);
508 if (ret != EOK)
509 return ret;
510#if 0
511 assert(fun);
512 hc_t *hc = fun_to_hc(fun);
513 assert(hc);
514
515 usb_log_debug("Control WRITE %d:%d %zu(%zu).\n",
516 target.address, target.endpoint, size, max_packet_size);
517
518 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
519 target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
520 if (ep == NULL) {
521 usb_log_error("Endpoint(%d:%d) not registered for CONTROL.\n",
522 target.address, target.endpoint);
523 return ENOENT;
524 }
525 assert(ep->speed ==
526 usb_device_keeper_get_speed(&hc->manager, target.address));
527 assert(ep->max_packet_size == max_packet_size);
528 assert(ep->transfer_type == USB_TRANSFER_CONTROL);
529
530 if (setup_size != 8)
531 return EINVAL;
532
533 usb_transfer_batch_t *batch =
534 batch_get(fun, ep, data, size, setup_data, setup_size,
535 NULL, callback, arg);
536 if (!batch)
537 return ENOMEM;
538#endif
539 usb_device_keeper_reset_if_need(&hc->manager, target, setup_data);
540 batch_control_write(batch);
541 ret = hc_schedule(hc, batch);
542 if (ret != EOK) {
543 batch_dispose(batch);
544 }
545 return ret;
546}
547/*----------------------------------------------------------------------------*/
548/** Control read transaction interface function
549 *
550 * @param[in] fun DDF function that was called.
551 * @param[in] target USB device to write to.
552 * @param[in] max_packet_size maximum size of data packet the device accepts.
553 * @param[in] setup_data Data to send with SETUP packet.
554 * @param[in] setup_size Size of data to send with SETUP packet (should be 8B).
555 * @param[out] data Source of data.
556 * @param[in] size Size of data source.
557 * @param[in] callback Function to call on transaction completion.
558 * @param[in] arg Additional for callback function.
559 * @return Error code.
560 */
561static int control_read(
562 ddf_fun_t *fun, usb_target_t target, size_t max_packet_size,
563 void *setup_data, size_t setup_size, void *data, size_t size,
564 usbhc_iface_transfer_in_callback_t callback, void *arg)
565{
566 usb_transfer_batch_t *batch = NULL;
567 hc_t *hc = NULL;
568 int ret = setup_batch(fun, target, USB_DIRECTION_BOTH, data, size,
569 setup_data, setup_size, callback, NULL, arg, "Control READ",
570 &hc, &batch);
571 if (ret != EOK)
572 return ret;
573#if 0
574 assert(fun);
575 hc_t *hc = fun_to_hc(fun);
576 assert(hc);
577
578 usb_log_debug("Control READ %d:%d %zu(%zu).\n",
579 target.address, target.endpoint, size, max_packet_size);
580
581 endpoint_t *ep = usb_endpoint_manager_get_ep(&hc->ep_manager,
582 target.address, target.endpoint, USB_DIRECTION_BOTH, NULL);
583 if (ep == NULL) {
584 usb_log_error("Endpoint(%d:%d) not registered for CONTROL.\n",
585 target.address, target.endpoint);
586 return ENOENT;
587 }
588 assert(ep->speed ==
589 usb_device_keeper_get_speed(&hc->manager, target.address));
590 assert(ep->max_packet_size == max_packet_size);
591 assert(ep->transfer_type == USB_TRANSFER_CONTROL);
592
593 usb_transfer_batch_t *batch =
594 batch_get(fun, ep, data, size, setup_data, setup_size,
595 callback, NULL, arg);
596 if (!batch)
597 return ENOMEM;
598#endif
599 batch_control_read(batch);
600 ret = hc_schedule(hc, batch);
601 if (ret != EOK) {
602 batch_dispose(batch);
603 }
604 return ret;
605}
606/*----------------------------------------------------------------------------*/
607usbhc_iface_t hc_iface = {
608 .reserve_default_address = reserve_default_address,
609 .release_default_address = release_default_address,
610 .request_address = request_address,
611 .bind_address = bind_address,
612 .release_address = release_address,
613
614 .register_endpoint = register_endpoint,
615 .unregister_endpoint = unregister_endpoint,
616
617 .interrupt_out = interrupt_out,
618 .interrupt_in = interrupt_in,
619
620 .bulk_out = bulk_out,
621 .bulk_in = bulk_in,
622
623 .control_write = control_write,
624 .control_read = control_read,
625};
626/**
627 * @}
628 */
Note: See TracBrowser for help on using the repository browser.