source: mainline/uspace/drv/bus/usb/uhci/hc.c@ bd41ac52

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since bd41ac52 was 5f97ef44, checked in by Jiří Zárevúcky <jiri.zarevucky@…>, 7 years ago

Sleep is more natural as part of the fibril API.
(the implementation will move later)

  • Property mode set to 100644
File size: 18.9 KB
Line 
1/*
2 * Copyright (c) 2011 Jan Vesely
3 * Copyright (c) 2018 Ondrej Hlavaty, Petr Manek
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * - The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29
30/** @addtogroup drvusbuhcihc
31 * @{
32 */
33/** @file
34 * @brief UHCI Host controller driver routines
35 */
36
37#include <adt/list.h>
38#include <assert.h>
39#include <async.h>
40#include <ddi.h>
41#include <device/hw_res_parsed.h>
42#include <fibril.h>
43#include <errno.h>
44#include <macros.h>
45#include <mem.h>
46#include <stdbool.h>
47#include <stdlib.h>
48#include <stdint.h>
49#include <str_error.h>
50
51#include <usb/debug.h>
52#include <usb/usb.h>
53#include <usb/host/utils/malloc32.h>
54#include <usb/host/bandwidth.h>
55#include <usb/host/utility.h>
56
57#include "uhci_batch.h"
58#include "transfer_list.h"
59#include "hc.h"
60
61#define UHCI_INTR_ALLOW_INTERRUPTS \
62 (UHCI_INTR_CRC | UHCI_INTR_COMPLETE | UHCI_INTR_SHORT_PACKET)
63#define UHCI_STATUS_USED_INTERRUPTS \
64 (UHCI_STATUS_INTERRUPT | UHCI_STATUS_ERROR_INTERRUPT)
65
66static const irq_pio_range_t uhci_irq_pio_ranges[] = {
67 {
68 .base = 0,
69 .size = sizeof(uhci_regs_t)
70 }
71};
72
73static const irq_cmd_t uhci_irq_commands[] = {
74 {
75 .cmd = CMD_PIO_READ_16,
76 .dstarg = 1,
77 .addr = NULL
78 },
79 {
80 .cmd = CMD_AND,
81 .srcarg = 1,
82 .dstarg = 2,
83 .value = UHCI_STATUS_USED_INTERRUPTS | UHCI_STATUS_NM_INTERRUPTS
84 },
85 {
86 .cmd = CMD_PREDICATE,
87 .srcarg = 2,
88 .value = 2
89 },
90 {
91 .cmd = CMD_PIO_WRITE_A_16,
92 .srcarg = 1,
93 .addr = NULL
94 },
95 {
96 .cmd = CMD_ACCEPT
97 }
98};
99
100static void hc_init_hw(const hc_t *instance);
101static errno_t hc_init_mem_structures(hc_t *instance);
102static errno_t hc_init_transfer_lists(hc_t *instance);
103
104static errno_t hc_debug_checker(void *arg);
105
106
107/** Generate IRQ code.
108 * @param[out] code IRQ code structure.
109 * @param[in] hw_res Device's resources.
110 * @param[out] irq
111 *
112 * @return Error code.
113 */
114errno_t hc_gen_irq_code(irq_code_t *code, hc_device_t *hcd, const hw_res_list_parsed_t *hw_res, int *irq)
115{
116 assert(code);
117 assert(hw_res);
118
119 if (hw_res->irqs.count != 1 || hw_res->io_ranges.count != 1)
120 return EINVAL;
121 const addr_range_t regs = hw_res->io_ranges.ranges[0];
122
123 if (RNGSZ(regs) < sizeof(uhci_regs_t))
124 return EOVERFLOW;
125
126 code->ranges = malloc(sizeof(uhci_irq_pio_ranges));
127 if (code->ranges == NULL)
128 return ENOMEM;
129
130 code->cmds = malloc(sizeof(uhci_irq_commands));
131 if (code->cmds == NULL) {
132 free(code->ranges);
133 return ENOMEM;
134 }
135
136 code->rangecount = ARRAY_SIZE(uhci_irq_pio_ranges);
137 code->cmdcount = ARRAY_SIZE(uhci_irq_commands);
138
139 memcpy(code->ranges, uhci_irq_pio_ranges, sizeof(uhci_irq_pio_ranges));
140 code->ranges[0].base = RNGABS(regs);
141
142 memcpy(code->cmds, uhci_irq_commands, sizeof(uhci_irq_commands));
143 uhci_regs_t *registers = (uhci_regs_t *) RNGABSPTR(regs);
144 code->cmds[0].addr = (void *)&registers->usbsts;
145 code->cmds[3].addr = (void *)&registers->usbsts;
146
147 usb_log_debug("I/O regs at %p (size %zu), IRQ %d.",
148 RNGABSPTR(regs), RNGSZ(regs), hw_res->irqs.irqs[0]);
149
150 *irq = hw_res->irqs.irqs[0];
151 return EOK;
152}
153
154/** Take action based on the interrupt cause.
155 *
156 * @param[in] hcd HCD structure to use.
157 * @param[in] status Value of the status register at the time of interrupt.
158 *
159 * Interrupt might indicate:
160 * - transaction completed, either by triggering IOC, SPD, or an error
161 * - some kind of device error
162 * - resume from suspend state (not implemented)
163 */
164static void hc_interrupt(bus_t *bus, uint32_t status)
165{
166 hc_t *instance = bus_to_hc(bus);
167
168 /* Lower 2 bits are transaction error and transaction complete */
169 if (status & (UHCI_STATUS_INTERRUPT | UHCI_STATUS_ERROR_INTERRUPT)) {
170 transfer_list_check_finished(&instance->transfers_interrupt);
171 transfer_list_check_finished(&instance->transfers_control_slow);
172 transfer_list_check_finished(&instance->transfers_control_full);
173 transfer_list_check_finished(&instance->transfers_bulk_full);
174 }
175
176 /* Resume interrupts are not supported */
177 if (status & UHCI_STATUS_RESUME) {
178 usb_log_error("Resume interrupt!");
179 }
180
181 /* Bits 4 and 5 indicate hc error */
182 if (status & (UHCI_STATUS_PROCESS_ERROR | UHCI_STATUS_SYSTEM_ERROR)) {
183 usb_log_error("UHCI hardware failure!.");
184 ++instance->hw_failures;
185 transfer_list_abort_all(&instance->transfers_interrupt);
186 transfer_list_abort_all(&instance->transfers_control_slow);
187 transfer_list_abort_all(&instance->transfers_control_full);
188 transfer_list_abort_all(&instance->transfers_bulk_full);
189
190 if (instance->hw_failures < UHCI_ALLOWED_HW_FAIL) {
191 /* reinitialize hw, this triggers virtual disconnect*/
192 hc_init_hw(instance);
193 } else {
194 usb_log_fatal("Too many UHCI hardware failures!.");
195 hc_gone(&instance->base);
196 }
197 }
198}
199
200/** Initialize UHCI hc driver structure
201 *
202 * @param[in] instance Memory place to initialize.
203 * @param[in] regs Range of device's I/O control registers.
204 * @param[in] interrupts True if hw interrupts should be used.
205 * @return Error code.
206 * @note Should be called only once on any structure.
207 *
208 * Initializes memory structures, starts up hw, and launches debugger and
209 * interrupt fibrils.
210 */
211errno_t hc_add(hc_device_t *hcd, const hw_res_list_parsed_t *hw_res)
212{
213 hc_t *instance = hcd_to_hc(hcd);
214 assert(hw_res);
215 if (hw_res->io_ranges.count != 1 ||
216 hw_res->io_ranges.ranges[0].size < sizeof(uhci_regs_t))
217 return EINVAL;
218
219 instance->hw_failures = 0;
220
221 /* allow access to hc control registers */
222 errno_t ret = pio_enable_range(&hw_res->io_ranges.ranges[0],
223 (void **) &instance->registers);
224 if (ret != EOK) {
225 usb_log_error("Failed to gain access to registers: %s.",
226 str_error(ret));
227 return ret;
228 }
229
230 usb_log_debug("Device registers at %" PRIx64 " (%zuB) accessible.",
231 hw_res->io_ranges.ranges[0].address.absolute,
232 hw_res->io_ranges.ranges[0].size);
233
234 ret = hc_init_mem_structures(instance);
235 if (ret != EOK) {
236 usb_log_error("Failed to init UHCI memory structures: %s.",
237 str_error(ret));
238 // TODO: we should disable pio here
239 return ret;
240 }
241
242 return EOK;
243}
244
245int hc_start(hc_device_t *hcd)
246{
247 hc_t *instance = hcd_to_hc(hcd);
248 hc_init_hw(instance);
249 (void)hc_debug_checker;
250
251 return uhci_rh_init(&instance->rh, instance->registers->ports, "uhci");
252}
253
254int hc_setup_roothub(hc_device_t *hcd)
255{
256 return hc_setup_virtual_root_hub(hcd, USB_SPEED_FULL);
257}
258
259/** Safely dispose host controller internal structures
260 *
261 * @param[in] instance Host controller structure to use.
262 */
263int hc_gone(hc_device_t *instance)
264{
265 assert(instance);
266 //TODO Implement
267 return ENOTSUP;
268}
269
270/** Initialize UHCI hc hw resources.
271 *
272 * @param[in] instance UHCI structure to use.
273 * For magic values see UHCI Design Guide
274 */
275void hc_init_hw(const hc_t *instance)
276{
277 assert(instance);
278 uhci_regs_t *registers = instance->registers;
279
280 /* Reset everything, who knows what touched it before us */
281 pio_write_16(&registers->usbcmd, UHCI_CMD_GLOBAL_RESET);
282 fibril_usleep(50000); /* 50ms according to USB spec(root hub reset) */
283 pio_write_16(&registers->usbcmd, 0);
284
285 /* Reset hc, all states and counters. Hope that hw is not broken */
286 pio_write_16(&registers->usbcmd, UHCI_CMD_HCRESET);
287 do {
288 fibril_usleep(10);
289 } while ((pio_read_16(&registers->usbcmd) & UHCI_CMD_HCRESET) != 0);
290
291 /* Set frame to exactly 1ms */
292 pio_write_8(&registers->sofmod, 64);
293
294 /* Set frame list pointer */
295 const uint32_t pa = addr_to_phys(instance->frame_list);
296 pio_write_32(&registers->flbaseadd, pa);
297
298 if (CAP_HANDLE_VALID(instance->base.irq_handle)) {
299 /* Enable all interrupts, but resume interrupt */
300 pio_write_16(&instance->registers->usbintr,
301 UHCI_INTR_ALLOW_INTERRUPTS);
302 }
303
304 const uint16_t cmd = pio_read_16(&registers->usbcmd);
305 if (cmd != 0)
306 usb_log_warning("Previous command value: %x.", cmd);
307
308 /* Start the hc with large(64B) packet FSBR */
309 pio_write_16(&registers->usbcmd,
310 UHCI_CMD_RUN_STOP | UHCI_CMD_MAX_PACKET | UHCI_CMD_CONFIGURE);
311}
312
313static usb_transfer_batch_t *create_transfer_batch(endpoint_t *ep)
314{
315 uhci_transfer_batch_t *batch = uhci_transfer_batch_create(ep);
316 return &batch->base;
317}
318
319static void destroy_transfer_batch(usb_transfer_batch_t *batch)
320{
321 uhci_transfer_batch_destroy(uhci_transfer_batch_get(batch));
322}
323
324static endpoint_t *endpoint_create(device_t *device, const usb_endpoint_descriptors_t *desc)
325{
326 endpoint_t *ep = calloc(1, sizeof(uhci_endpoint_t));
327 if (ep)
328 endpoint_init(ep, device, desc);
329 return ep;
330}
331
332static errno_t endpoint_register(endpoint_t *ep)
333{
334 hc_t *const hc = bus_to_hc(endpoint_get_bus(ep));
335
336 const errno_t err = usb2_bus_endpoint_register(&hc->bus_helper, ep);
337 if (err)
338 return err;
339
340 transfer_list_t *list = hc->transfers[ep->device->speed][ep->transfer_type];
341 if (!list)
342 /*
343 * We don't support this combination (e.g. isochronous). Do not
344 * fail early, because that would block any device with these
345 * endpoints from connecting. Instead, make sure these transfers
346 * are denied soon enough with ENOTSUP not to fail on asserts.
347 */
348 return EOK;
349
350 endpoint_set_online(ep, &list->guard);
351 return EOK;
352}
353
354static void endpoint_unregister(endpoint_t *ep)
355{
356 hc_t *const hc = bus_to_hc(endpoint_get_bus(ep));
357 usb2_bus_endpoint_unregister(&hc->bus_helper, ep);
358
359 // Check for the roothub, as it does not schedule into lists
360 if (ep->device->address == uhci_rh_get_address(&hc->rh)) {
361 // FIXME: We shall check the roothub for active transfer. But
362 // as it is polling, there is no way to make it stop doing so.
363 // Return after rewriting uhci rh.
364 return;
365 }
366
367 transfer_list_t *list = hc->transfers[ep->device->speed][ep->transfer_type];
368 if (!list)
369 /*
370 * We don't support this combination (e.g. isochronous),
371 * so no transfer can be active.
372 */
373 return;
374
375 fibril_mutex_lock(&list->guard);
376
377 endpoint_set_offline_locked(ep);
378 /* From now on, no other transfer will be scheduled. */
379
380 if (!ep->active_batch) {
381 fibril_mutex_unlock(&list->guard);
382 return;
383 }
384
385 /* First, offer the batch a short chance to be finished. */
386 endpoint_wait_timeout_locked(ep, 10000);
387
388 if (!ep->active_batch) {
389 fibril_mutex_unlock(&list->guard);
390 return;
391 }
392
393 uhci_transfer_batch_t *const batch =
394 uhci_transfer_batch_get(ep->active_batch);
395
396 /* Remove the batch from the schedule to stop it from being finished. */
397 endpoint_deactivate_locked(ep);
398 transfer_list_remove_batch(list, batch);
399
400 fibril_mutex_unlock(&list->guard);
401
402 /*
403 * We removed the batch from software schedule only, it's still possible
404 * that HC has it in its caches. Better wait a while before we release
405 * the buffers.
406 */
407 fibril_usleep(20000);
408 batch->base.error = EINTR;
409 batch->base.transferred_size = 0;
410 usb_transfer_batch_finish(&batch->base);
411}
412
413static int device_enumerate(device_t *dev)
414{
415 hc_t *const hc = bus_to_hc(dev->bus);
416 return usb2_bus_device_enumerate(&hc->bus_helper, dev);
417}
418
419static void device_gone(device_t *dev)
420{
421 hc_t *const hc = bus_to_hc(dev->bus);
422 usb2_bus_device_gone(&hc->bus_helper, dev);
423}
424
425static int hc_status(bus_t *, uint32_t *);
426static int hc_schedule(usb_transfer_batch_t *);
427
428static const bus_ops_t uhci_bus_ops = {
429 .interrupt = hc_interrupt,
430 .status = hc_status,
431
432 .device_enumerate = device_enumerate,
433 .device_gone = device_gone,
434
435 .endpoint_create = endpoint_create,
436 .endpoint_register = endpoint_register,
437 .endpoint_unregister = endpoint_unregister,
438
439 .batch_create = create_transfer_batch,
440 .batch_schedule = hc_schedule,
441 .batch_destroy = destroy_transfer_batch,
442};
443
444/** Initialize UHCI hc memory structures.
445 *
446 * @param[in] instance UHCI structure to use.
447 * @return Error code
448 * @note Should be called only once on any structure.
449 *
450 * Structures:
451 * - transfer lists (queue heads need to be accessible by the hw)
452 * - frame list page (needs to be one UHCI hw accessible 4K page)
453 */
454errno_t hc_init_mem_structures(hc_t *instance)
455{
456 assert(instance);
457
458 usb2_bus_helper_init(&instance->bus_helper, &bandwidth_accounting_usb11);
459
460 bus_init(&instance->bus, sizeof(device_t));
461 instance->bus.ops = &uhci_bus_ops;
462
463 hc_device_setup(&instance->base, &instance->bus);
464
465 /* Init USB frame list page */
466 instance->frame_list = get_page();
467 if (!instance->frame_list) {
468 return ENOMEM;
469 }
470 usb_log_debug("Initialized frame list at %p.", instance->frame_list);
471
472 /* Init transfer lists */
473 errno_t ret = hc_init_transfer_lists(instance);
474 if (ret != EOK) {
475 usb_log_error("Failed to initialize transfer lists.");
476 return_page(instance->frame_list);
477 return ENOMEM;
478 }
479 list_initialize(&instance->pending_endpoints);
480 usb_log_debug("Initialized transfer lists.");
481
482
483 /* Set all frames to point to the first queue head */
484 const uint32_t queue = LINK_POINTER_QH(
485 addr_to_phys(instance->transfers_interrupt.queue_head));
486
487 for (unsigned i = 0; i < UHCI_FRAME_LIST_COUNT; ++i) {
488 instance->frame_list[i] = queue;
489 }
490
491 return EOK;
492}
493
494/** Initialize UHCI hc transfer lists.
495 *
496 * @param[in] instance UHCI structure to use.
497 * @return Error code
498 * @note Should be called only once on any structure.
499 *
500 * Initializes transfer lists and sets them in one chain to support proper
501 * USB scheduling. Sets pointer table for quick access.
502 */
503errno_t hc_init_transfer_lists(hc_t *instance)
504{
505 assert(instance);
506#define SETUP_TRANSFER_LIST(type, name) \
507do { \
508 errno_t ret = transfer_list_init(&instance->transfers_##type, name); \
509 if (ret != EOK) { \
510 usb_log_error("Failed to setup %s transfer list: %s.", \
511 name, str_error(ret)); \
512 transfer_list_fini(&instance->transfers_bulk_full); \
513 transfer_list_fini(&instance->transfers_control_full); \
514 transfer_list_fini(&instance->transfers_control_slow); \
515 transfer_list_fini(&instance->transfers_interrupt); \
516 return ret; \
517 } \
518} while (0)
519
520 SETUP_TRANSFER_LIST(bulk_full, "BULK FULL");
521 SETUP_TRANSFER_LIST(control_full, "CONTROL FULL");
522 SETUP_TRANSFER_LIST(control_slow, "CONTROL LOW");
523 SETUP_TRANSFER_LIST(interrupt, "INTERRUPT");
524#undef SETUP_TRANSFER_LIST
525 /* Connect lists into one schedule */
526 transfer_list_set_next(&instance->transfers_control_full,
527 &instance->transfers_bulk_full);
528 transfer_list_set_next(&instance->transfers_control_slow,
529 &instance->transfers_control_full);
530 transfer_list_set_next(&instance->transfers_interrupt,
531 &instance->transfers_control_slow);
532
533 /*
534 * FSBR, This feature is not needed (adds no benefit) and is supposedly
535 * buggy on certain hw, enable at your own risk.
536 */
537#ifdef FSBR
538 transfer_list_set_next(&instance->transfers_bulk_full,
539 &instance->transfers_control_full);
540#endif
541
542 /* Assign pointers to be used during scheduling */
543 instance->transfers[USB_SPEED_FULL][USB_TRANSFER_INTERRUPT] =
544 &instance->transfers_interrupt;
545 instance->transfers[USB_SPEED_LOW][USB_TRANSFER_INTERRUPT] =
546 &instance->transfers_interrupt;
547 instance->transfers[USB_SPEED_FULL][USB_TRANSFER_CONTROL] =
548 &instance->transfers_control_full;
549 instance->transfers[USB_SPEED_LOW][USB_TRANSFER_CONTROL] =
550 &instance->transfers_control_slow;
551 instance->transfers[USB_SPEED_FULL][USB_TRANSFER_BULK] =
552 &instance->transfers_bulk_full;
553
554 return EOK;
555}
556
557static errno_t hc_status(bus_t *bus, uint32_t *status)
558{
559 hc_t *instance = bus_to_hc(bus);
560 assert(status);
561
562 *status = 0;
563 if (instance->registers) {
564 uint16_t s = pio_read_16(&instance->registers->usbsts);
565 pio_write_16(&instance->registers->usbsts, s);
566 *status = s;
567 }
568 return EOK;
569}
570
571/**
572 * Schedule batch for execution.
573 *
574 * @param[in] instance UHCI structure to use.
575 * @param[in] batch Transfer batch to schedule.
576 * @return Error code
577 */
578static errno_t hc_schedule(usb_transfer_batch_t *batch)
579{
580 uhci_transfer_batch_t *uhci_batch = uhci_transfer_batch_get(batch);
581 endpoint_t *ep = batch->ep;
582 hc_t *hc = bus_to_hc(endpoint_get_bus(ep));
583
584 if (batch->target.address == uhci_rh_get_address(&hc->rh))
585 return uhci_rh_schedule(&hc->rh, batch);
586
587 transfer_list_t *const list =
588 hc->transfers[ep->device->speed][ep->transfer_type];
589
590 if (!list)
591 return ENOTSUP;
592
593 errno_t err;
594 if ((err = uhci_transfer_batch_prepare(uhci_batch)))
595 return err;
596
597 return transfer_list_add_batch(list, uhci_batch);
598}
599
600/** Debug function, checks consistency of memory structures.
601 *
602 * @param[in] arg UHCI structure to use.
603 * @return EOK (should never return)
604 */
605errno_t hc_debug_checker(void *arg)
606{
607 hc_t *instance = arg;
608 assert(instance);
609
610#define QH(queue) \
611 instance->transfers_##queue.queue_head
612
613 while (true) {
614 const uint16_t cmd = pio_read_16(&instance->registers->usbcmd);
615 const uint16_t sts = pio_read_16(&instance->registers->usbsts);
616 const uint16_t intr =
617 pio_read_16(&instance->registers->usbintr);
618
619 if (((cmd & UHCI_CMD_RUN_STOP) != 1) || (sts != 0)) {
620 usb_log_debug2("Command: %X Status: %X Intr: %x",
621 cmd, sts, intr);
622 }
623
624 const uintptr_t frame_list =
625 pio_read_32(&instance->registers->flbaseadd) & ~0xfff;
626 if (frame_list != addr_to_phys(instance->frame_list)) {
627 usb_log_debug("Framelist address: %p vs. %p.",
628 (void *) frame_list,
629 (void *) addr_to_phys(instance->frame_list));
630 }
631
632 int frnum = pio_read_16(&instance->registers->frnum) & 0x3ff;
633
634 uintptr_t expected_pa = instance->frame_list[frnum] &
635 LINK_POINTER_ADDRESS_MASK;
636 uintptr_t real_pa = addr_to_phys(QH(interrupt));
637 if (expected_pa != real_pa) {
638 usb_log_debug("Interrupt QH: %p (frame %d) vs. %p.",
639 (void *) expected_pa, frnum, (void *) real_pa);
640 }
641
642 expected_pa = QH(interrupt)->next & LINK_POINTER_ADDRESS_MASK;
643 real_pa = addr_to_phys(QH(control_slow));
644 if (expected_pa != real_pa) {
645 usb_log_debug("Control Slow QH: %p vs. %p.",
646 (void *) expected_pa, (void *) real_pa);
647 }
648
649 expected_pa = QH(control_slow)->next & LINK_POINTER_ADDRESS_MASK;
650 real_pa = addr_to_phys(QH(control_full));
651 if (expected_pa != real_pa) {
652 usb_log_debug("Control Full QH: %p vs. %p.",
653 (void *) expected_pa, (void *) real_pa);
654 }
655
656 expected_pa = QH(control_full)->next & LINK_POINTER_ADDRESS_MASK;
657 real_pa = addr_to_phys(QH(bulk_full));
658 if (expected_pa != real_pa) {
659 usb_log_debug("Bulk QH: %p vs. %p.",
660 (void *) expected_pa, (void *) real_pa);
661 }
662 fibril_usleep(UHCI_DEBUGER_TIMEOUT);
663 }
664 return EOK;
665#undef QH
666}
667/**
668 * @}
669 */
Note: See TracBrowser for help on using the repository browser.