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

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 64d138b was 6832245, checked in by Ondřej Hlavatý <aearsis@…>, 8 years ago

usbhost bus: refactor the bus ops

This way, method names better represent the entity it is working with.
Their semantics was shifted a bit.

Regarding the tree of structures:

bus ← device ← endpoint ← batch

Previously, devices were kept in DDF function nodes, and endpoints had
pointer to the bus and device. Now, devices have pointer to bus,
endpoints don't.

Pointer to hcd_t in bus is WIP, and will be removed.

  • Property mode set to 100644
File size: 16.0 KB
RevLine 
[9351353]1/*
2 * Copyright (c) 2011 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 */
[58563585]28
[17ceb72]29/** @addtogroup drvusbuhcihc
[9351353]30 * @{
31 */
32/** @file
[17ceb72]33 * @brief UHCI Host controller driver routines
[9351353]34 */
[8064c2f6]35
[9351353]36#include <adt/list.h>
[8064c2f6]37#include <assert.h>
38#include <async.h>
[1ae74c6]39#include <ddi.h>
[8064c2f6]40#include <device/hw_res_parsed.h>
41#include <fibril.h>
42#include <errno.h>
43#include <macros.h>
44#include <mem.h>
45#include <stdlib.h>
[8d2dd7f2]46#include <stdint.h>
[8064c2f6]47#include <str_error.h>
[9351353]48
49#include <usb/debug.h>
50#include <usb/usb.h>
[8fc61c8]51#include <usb/host/utils/malloc32.h>
[e6b9182]52#include <usb/host/bandwidth.h>
[9351353]53
[07f49ae]54#include "uhci_batch.h"
[8064c2f6]55#include "hc.h"
[9351353]56
[8986412]57#define UHCI_INTR_ALLOW_INTERRUPTS \
[af81980]58 (UHCI_INTR_CRC | UHCI_INTR_COMPLETE | UHCI_INTR_SHORT_PACKET)
[8986412]59#define UHCI_STATUS_USED_INTERRUPTS \
60 (UHCI_STATUS_INTERRUPT | UHCI_STATUS_ERROR_INTERRUPT)
[af81980]61
[d57122c]62static const irq_pio_range_t uhci_irq_pio_ranges[] = {
63 {
[8486c07]64 .base = 0,
[d57122c]65 .size = sizeof(uhci_regs_t)
66 }
67};
[5fe0a697]68
[d57122c]69static const irq_cmd_t uhci_irq_commands[] = {
[8486c07]70 {
71 .cmd = CMD_PIO_READ_16,
72 .dstarg = 1,
73 .addr = NULL
74 },
75 {
76 .cmd = CMD_AND,
77 .srcarg = 1,
78 .dstarg = 2,
79 .value = UHCI_STATUS_USED_INTERRUPTS | UHCI_STATUS_NM_INTERRUPTS
80 },
81 {
82 .cmd = CMD_PREDICATE,
83 .srcarg = 2,
84 .value = 2
85 },
86 {
87 .cmd = CMD_PIO_WRITE_A_16,
88 .srcarg = 1,
89 .addr = NULL
90 },
91 {
92 .cmd = CMD_ACCEPT
93 }
[dfe4955]94};
[302a4b6]95
[3afb758]96static void hc_init_hw(const hc_t *instance);
[6832245]97static int hc_init_mem_structures(hc_t *instance, hcd_t *);
[3afb758]98static int hc_init_transfer_lists(hc_t *instance);
[9351353]99
[c01cd32]100static int hc_debug_checker(void *arg);
[dfe4955]101
[76fbd9a]102
[d57122c]103/** Generate IRQ code.
[6210a333]104 * @param[out] code IRQ code structure.
[ba4a03a5]105 * @param[in] hw_res Device's resources.
[dfe4955]106 *
107 * @return Error code.
108 */
[e4d7363]109int uhci_hc_gen_irq_code(irq_code_t *code, hcd_t *hcd, const hw_res_list_parsed_t *hw_res)
[dfe4955]110{
[6210a333]111 assert(code);
[ba4a03a5]112 assert(hw_res);
[6210a333]113
[ba4a03a5]114 if (hw_res->irqs.count != 1 || hw_res->io_ranges.count != 1)
115 return EINVAL;
116 const addr_range_t regs = hw_res->io_ranges.ranges[0];
117
118 if (RNGSZ(regs) < sizeof(uhci_regs_t))
[dfe4955]119 return EOVERFLOW;
120
[6210a333]121 code->ranges = malloc(sizeof(uhci_irq_pio_ranges));
122 if (code->ranges == NULL)
123 return ENOMEM;
124
125 code->cmds = malloc(sizeof(uhci_irq_commands));
126 if (code->cmds == NULL) {
127 free(code->ranges);
128 return ENOMEM;
129 }
130
131 code->rangecount = ARRAY_SIZE(uhci_irq_pio_ranges);
132 code->cmdcount = ARRAY_SIZE(uhci_irq_commands);
[dfe4955]133
[6210a333]134 memcpy(code->ranges, uhci_irq_pio_ranges, sizeof(uhci_irq_pio_ranges));
[ba4a03a5]135 code->ranges[0].base = RNGABS(regs);
[6210a333]136
137 memcpy(code->cmds, uhci_irq_commands, sizeof(uhci_irq_commands));
[ba4a03a5]138 uhci_regs_t *registers = (uhci_regs_t *) RNGABSPTR(regs);
[6210a333]139 code->cmds[0].addr = (void*)&registers->usbsts;
140 code->cmds[3].addr = (void*)&registers->usbsts;
[dfe4955]141
[ba4a03a5]142 usb_log_debug("I/O regs at %p (size %zu), IRQ %d.\n",
143 RNGABSPTR(regs), RNGSZ(regs), hw_res->irqs.irqs[0]);
144
145 return hw_res->irqs.irqs[0];
[dfe4955]146}
[76fbd9a]147
[3afb758]148/** Take action based on the interrupt cause.
149 *
[4bfcf22]150 * @param[in] hcd HCD structure to use.
[3afb758]151 * @param[in] status Value of the status register at the time of interrupt.
152 *
153 * Interrupt might indicate:
154 * - transaction completed, either by triggering IOC, SPD, or an error
155 * - some kind of device error
156 * - resume from suspend state (not implemented)
157 */
[9f6cb910]158void uhci_hc_interrupt(hcd_t *hcd, uint32_t status)
[3afb758]159{
[4bfcf22]160 assert(hcd);
[b5f813c]161 hc_t *instance = hcd_get_driver_data(hcd);
[3afb758]162 assert(instance);
163 /* Lower 2 bits are transaction error and transaction complete */
164 if (status & (UHCI_STATUS_INTERRUPT | UHCI_STATUS_ERROR_INTERRUPT)) {
165 LIST_INITIALIZE(done);
166 transfer_list_remove_finished(
167 &instance->transfers_interrupt, &done);
168 transfer_list_remove_finished(
169 &instance->transfers_control_slow, &done);
170 transfer_list_remove_finished(
171 &instance->transfers_control_full, &done);
172 transfer_list_remove_finished(
173 &instance->transfers_bulk_full, &done);
174
[ad5f149]175 list_foreach_safe(done, current, next) {
176 list_remove(current);
[b991d37]177 uhci_transfer_batch_t *batch =
[ad5f149]178 uhci_transfer_batch_from_link(current);
[17873ac7]179 usb_transfer_batch_finish(&batch->base);
[3afb758]180 }
181 }
182 /* Resume interrupts are not supported */
183 if (status & UHCI_STATUS_RESUME) {
184 usb_log_error("Resume interrupt!\n");
185 }
186
187 /* Bits 4 and 5 indicate hc error */
188 if (status & (UHCI_STATUS_PROCESS_ERROR | UHCI_STATUS_SYSTEM_ERROR)) {
189 usb_log_error("UHCI hardware failure!.\n");
190 ++instance->hw_failures;
191 transfer_list_abort_all(&instance->transfers_interrupt);
192 transfer_list_abort_all(&instance->transfers_control_slow);
193 transfer_list_abort_all(&instance->transfers_control_full);
194 transfer_list_abort_all(&instance->transfers_bulk_full);
195
196 if (instance->hw_failures < UHCI_ALLOWED_HW_FAIL) {
197 /* reinitialize hw, this triggers virtual disconnect*/
198 hc_init_hw(instance);
199 } else {
200 usb_log_fatal("Too many UHCI hardware failures!.\n");
201 hc_fini(instance);
202 }
203 }
204}
[76fbd9a]205
[02cacce]206/** Initialize UHCI hc driver structure
[9351353]207 *
208 * @param[in] instance Memory place to initialize.
[7de1988c]209 * @param[in] regs Range of device's I/O control registers.
[23f40280]210 * @param[in] interrupts True if hw interrupts should be used.
[9351353]211 * @return Error code.
212 * @note Should be called only once on any structure.
[17ceb72]213 *
214 * Initializes memory structures, starts up hw, and launches debugger and
215 * interrupt fibrils.
[9351353]216 */
[6832245]217int hc_init(hc_t *instance, hcd_t *hcd, const hw_res_list_parsed_t *hw_res)
[9351353]218{
[3f03199]219 assert(instance);
[7813516]220 assert(hw_res);
221 if (hw_res->io_ranges.count != 1 ||
222 hw_res->io_ranges.ranges[0].size < sizeof(uhci_regs_t))
223 return EINVAL;
[9351353]224
[fcc525d]225 instance->hw_failures = 0;
226
[9351353]227 /* allow access to hc control registers */
[7813516]228 int ret = pio_enable_range(&hw_res->io_ranges.ranges[0],
229 (void **) &instance->registers);
[e0d8b740]230 if (ret != EOK) {
[7813516]231 usb_log_error("Failed to gain access to registers: %s.\n",
232 str_error(ret));
[e0d8b740]233 return ret;
234 }
235
[7813516]236 usb_log_debug("Device registers at %" PRIx64 " (%zuB) accessible.\n",
237 hw_res->io_ranges.ranges[0].address.absolute,
238 hw_res->io_ranges.ranges[0].size);
[3afb758]239
[6832245]240 ret = hc_init_mem_structures(instance, hcd);
[e0d8b740]241 if (ret != EOK) {
242 usb_log_error("Failed to init UHCI memory structures: %s.\n",
243 str_error(ret));
244 // TODO: we should disable pio here
245 return ret;
246 }
[7265558]247
[e4d7363]248 return EOK;
249}
250
251void hc_start(hc_t *instance)
252{
[c01cd32]253 hc_init_hw(instance);
[ea993d18]254 (void)hc_debug_checker;
[9351353]255
[e646c61]256 uhci_rh_init(&instance->rh, instance->registers->ports, "uhci");
[9351353]257}
[76fbd9a]258
[7813516]259/** Safely dispose host controller internal structures
260 *
261 * @param[in] instance Host controller structure to use.
262 */
263void hc_fini(hc_t *instance)
264{
265 assert(instance);
266 //TODO Implement
267}
268
[17ceb72]269/** Initialize UHCI hc hw resources.
[9351353]270 *
271 * @param[in] instance UHCI structure to use.
[17ceb72]272 * For magic values see UHCI Design Guide
[9351353]273 */
[3afb758]274void hc_init_hw(const hc_t *instance)
[9351353]275{
276 assert(instance);
[dfe4955]277 uhci_regs_t *registers = instance->registers;
[9351353]278
279 /* Reset everything, who knows what touched it before us */
280 pio_write_16(&registers->usbcmd, UHCI_CMD_GLOBAL_RESET);
[26858040]281 async_usleep(50000); /* 50ms according to USB spec(root hub reset) */
[9351353]282 pio_write_16(&registers->usbcmd, 0);
283
[26858040]284 /* Reset hc, all states and counters. Hope that hw is not broken */
[9351353]285 pio_write_16(&registers->usbcmd, UHCI_CMD_HCRESET);
286 do { async_usleep(10); }
287 while ((pio_read_16(&registers->usbcmd) & UHCI_CMD_HCRESET) != 0);
288
[eb2a48a]289 /* Set frame to exactly 1ms */
290 pio_write_8(&registers->sofmod, 64);
291
292 /* Set frame list pointer */
[9351353]293 const uint32_t pa = addr_to_phys(instance->frame_list);
294 pio_write_32(&registers->flbaseadd, pa);
295
[ff34e5a]296 if (instance->hw_interrupts) {
297 /* Enable all interrupts, but resume interrupt */
298 pio_write_16(&instance->registers->usbintr,
[8986412]299 UHCI_INTR_ALLOW_INTERRUPTS);
[ff34e5a]300 }
[9351353]301
[26858040]302 const uint16_t cmd = pio_read_16(&registers->usbcmd);
303 if (cmd != 0)
304 usb_log_warning("Previous command value: %x.\n", cmd);
[9351353]305
306 /* Start the hc with large(64B) packet FSBR */
307 pio_write_16(&registers->usbcmd,
308 UHCI_CMD_RUN_STOP | UHCI_CMD_MAX_PACKET | UHCI_CMD_CONFIGURE);
309}
[76fbd9a]310
[6832245]311static usb_transfer_batch_t *create_transfer_batch(endpoint_t *ep)
[5fd9c30]312{
313 uhci_transfer_batch_t *batch = uhci_transfer_batch_create(ep);
314 return &batch->base;
315}
316
317static void destroy_transfer_batch(usb_transfer_batch_t *batch)
318{
319 uhci_transfer_batch_destroy(uhci_transfer_batch_get(batch));
320}
321
[6832245]322static const bus_ops_t uhci_bus_ops = {
323 .parent = &usb2_bus_ops,
324
325 .endpoint_count_bw = bandwidth_count_usb11,
326 .batch_create = create_transfer_batch,
327 .batch_destroy = destroy_transfer_batch,
328};
329
[17ceb72]330/** Initialize UHCI hc memory structures.
[9351353]331 *
332 * @param[in] instance UHCI structure to use.
333 * @return Error code
334 * @note Should be called only once on any structure.
[17ceb72]335 *
336 * Structures:
337 * - transfer lists (queue heads need to be accessible by the hw)
338 * - frame list page (needs to be one UHCI hw accessible 4K page)
[9351353]339 */
[6832245]340int hc_init_mem_structures(hc_t *instance, hcd_t *hcd)
[9351353]341{
[e6b9182]342 int err;
[9351353]343 assert(instance);
344
[6832245]345 if ((err = usb2_bus_init(&instance->bus, hcd, BANDWIDTH_AVAILABLE_USB11)))
[e6b9182]346 return err;
347
[6832245]348 bus_t *bus = (bus_t *) &instance->bus;
349 bus->ops = &uhci_bus_ops;
[5fd9c30]350
[3afb758]351 /* Init USB frame list page */
[9351353]352 instance->frame_list = get_page();
[26858040]353 if (!instance->frame_list) {
354 return ENOMEM;
355 }
[001b152]356 usb_log_debug("Initialized frame list at %p.\n", instance->frame_list);
[9351353]357
[3afb758]358 /* Init transfer lists */
359 int ret = hc_init_transfer_lists(instance);
360 if (ret != EOK) {
361 usb_log_error("Failed to initialize transfer lists.\n");
362 return_page(instance->frame_list);
363 return ENOMEM;
364 }
365 usb_log_debug("Initialized transfer lists.\n");
366
367
[9351353]368 /* Set all frames to point to the first queue head */
[302a4b6]369 const uint32_t queue = LINK_POINTER_QH(
370 addr_to_phys(instance->transfers_interrupt.queue_head));
[75f9dcd]371
372 for (unsigned i = 0; i < UHCI_FRAME_LIST_COUNT; ++i) {
[9351353]373 instance->frame_list[i] = queue;
374 }
375
376 return EOK;
377}
[76fbd9a]378
[17ceb72]379/** Initialize UHCI hc transfer lists.
[9351353]380 *
381 * @param[in] instance UHCI structure to use.
382 * @return Error code
383 * @note Should be called only once on any structure.
[17ceb72]384 *
385 * Initializes transfer lists and sets them in one chain to support proper
386 * USB scheduling. Sets pointer table for quick access.
[9351353]387 */
[c01cd32]388int hc_init_transfer_lists(hc_t *instance)
[9351353]389{
390 assert(instance);
[27205841]391#define SETUP_TRANSFER_LIST(type, name) \
392do { \
393 int ret = transfer_list_init(&instance->transfers_##type, name); \
[9351353]394 if (ret != EOK) { \
[26858040]395 usb_log_error("Failed to setup %s transfer list: %s.\n", \
396 name, str_error(ret)); \
[9351353]397 transfer_list_fini(&instance->transfers_bulk_full); \
398 transfer_list_fini(&instance->transfers_control_full); \
399 transfer_list_fini(&instance->transfers_control_slow); \
400 transfer_list_fini(&instance->transfers_interrupt); \
401 return ret; \
[27205841]402 } \
403} while (0)
404
405 SETUP_TRANSFER_LIST(bulk_full, "BULK FULL");
406 SETUP_TRANSFER_LIST(control_full, "CONTROL FULL");
407 SETUP_TRANSFER_LIST(control_slow, "CONTROL LOW");
408 SETUP_TRANSFER_LIST(interrupt, "INTERRUPT");
409#undef SETUP_TRANSFER_LIST
410 /* Connect lists into one schedule */
[9351353]411 transfer_list_set_next(&instance->transfers_control_full,
412 &instance->transfers_bulk_full);
413 transfer_list_set_next(&instance->transfers_control_slow,
414 &instance->transfers_control_full);
415 transfer_list_set_next(&instance->transfers_interrupt,
416 &instance->transfers_control_slow);
417
[e247d83]418 /*FSBR, This feature is not needed (adds no benefit) and is supposedly
419 * buggy on certain hw, enable at your own risk. */
[9351353]420#ifdef FSBR
421 transfer_list_set_next(&instance->transfers_bulk_full,
[302a4b6]422 &instance->transfers_control_full);
[9351353]423#endif
424
425 /* Assign pointers to be used during scheduling */
426 instance->transfers[USB_SPEED_FULL][USB_TRANSFER_INTERRUPT] =
427 &instance->transfers_interrupt;
428 instance->transfers[USB_SPEED_LOW][USB_TRANSFER_INTERRUPT] =
429 &instance->transfers_interrupt;
430 instance->transfers[USB_SPEED_FULL][USB_TRANSFER_CONTROL] =
431 &instance->transfers_control_full;
432 instance->transfers[USB_SPEED_LOW][USB_TRANSFER_CONTROL] =
433 &instance->transfers_control_slow;
434 instance->transfers[USB_SPEED_FULL][USB_TRANSFER_BULK] =
435 &instance->transfers_bulk_full;
436
437 return EOK;
438}
[76fbd9a]439
[9f6cb910]440int uhci_hc_status(hcd_t *hcd, uint32_t *status)
[e26a9d95]441{
442 assert(hcd);
443 assert(status);
[b5f813c]444 hc_t *instance = hcd_get_driver_data(hcd);
[e26a9d95]445 assert(instance);
446
447 *status = 0;
448 if (instance->registers) {
449 uint16_t s = pio_read_16(&instance->registers->usbsts);
450 pio_write_16(&instance->registers->usbsts, s);
451 *status = s;
452 }
453 return EOK;
454}
455
[17ceb72]456/** Schedule batch for execution.
[9351353]457 *
458 * @param[in] instance UHCI structure to use.
459 * @param[in] batch Transfer batch to schedule.
460 * @return Error code
[17ceb72]461 *
462 * Checks for bandwidth availability and appends the batch to the proper queue.
[9351353]463 */
[9f6cb910]464int uhci_hc_schedule(hcd_t *hcd, usb_transfer_batch_t *batch)
[9351353]465{
[3afb758]466 assert(hcd);
[b5f813c]467 hc_t *instance = hcd_get_driver_data(hcd);
[9351353]468 assert(instance);
469 assert(batch);
[c95c00e]470
[a5b3de6]471 if (batch->target.address == uhci_rh_get_address(&instance->rh))
[3848fec]472 return uhci_rh_schedule(&instance->rh, batch);
[c95c00e]473
[5fd9c30]474 uhci_transfer_batch_t *uhci_batch = (uhci_transfer_batch_t *) batch;
[b991d37]475 if (!uhci_batch) {
476 usb_log_error("Failed to create UHCI transfer structures.\n");
477 return ENOMEM;
[23b0fe8]478 }
[9351353]479
[5fd9c30]480 const int err = uhci_transfer_batch_prepare(uhci_batch);
481 if (err)
482 return err;
483
[9351353]484 transfer_list_t *list =
[888238e9]485 instance->transfers[batch->ep->device->speed][batch->ep->transfer_type];
[9351353]486 assert(list);
[b991d37]487 transfer_list_add_batch(list, uhci_batch);
[9351353]488
489 return EOK;
490}
[76fbd9a]491
[9351353]492/** Debug function, checks consistency of memory structures.
493 *
494 * @param[in] arg UHCI structure to use.
[17ceb72]495 * @return EOK (should never return)
[9351353]496 */
[c01cd32]497int hc_debug_checker(void *arg)
[9351353]498{
[6f122df]499 hc_t *instance = arg;
[9351353]500 assert(instance);
501
502#define QH(queue) \
503 instance->transfers_##queue.queue_head
504
505 while (1) {
506 const uint16_t cmd = pio_read_16(&instance->registers->usbcmd);
507 const uint16_t sts = pio_read_16(&instance->registers->usbsts);
508 const uint16_t intr =
509 pio_read_16(&instance->registers->usbintr);
510
511 if (((cmd & UHCI_CMD_RUN_STOP) != 1) || (sts != 0)) {
512 usb_log_debug2("Command: %X Status: %X Intr: %x\n",
513 cmd, sts, intr);
514 }
515
[e247d83]516 const uintptr_t frame_list =
[9351353]517 pio_read_32(&instance->registers->flbaseadd) & ~0xfff;
518 if (frame_list != addr_to_phys(instance->frame_list)) {
519 usb_log_debug("Framelist address: %p vs. %p.\n",
[4125b7d]520 (void *) frame_list,
521 (void *) addr_to_phys(instance->frame_list));
[9351353]522 }
523
524 int frnum = pio_read_16(&instance->registers->frnum) & 0x3ff;
525
526 uintptr_t expected_pa = instance->frame_list[frnum]
527 & LINK_POINTER_ADDRESS_MASK;
528 uintptr_t real_pa = addr_to_phys(QH(interrupt));
529 if (expected_pa != real_pa) {
[4125b7d]530 usb_log_debug("Interrupt QH: %p (frame %d) vs. %p.\n",
531 (void *) expected_pa, frnum, (void *) real_pa);
[9351353]532 }
533
534 expected_pa = QH(interrupt)->next & LINK_POINTER_ADDRESS_MASK;
535 real_pa = addr_to_phys(QH(control_slow));
536 if (expected_pa != real_pa) {
537 usb_log_debug("Control Slow QH: %p vs. %p.\n",
[4125b7d]538 (void *) expected_pa, (void *) real_pa);
[9351353]539 }
540
541 expected_pa = QH(control_slow)->next & LINK_POINTER_ADDRESS_MASK;
542 real_pa = addr_to_phys(QH(control_full));
543 if (expected_pa != real_pa) {
544 usb_log_debug("Control Full QH: %p vs. %p.\n",
[4125b7d]545 (void *) expected_pa, (void *) real_pa);
[9351353]546 }
547
548 expected_pa = QH(control_full)->next & LINK_POINTER_ADDRESS_MASK;
549 real_pa = addr_to_phys(QH(bulk_full));
550 if (expected_pa != real_pa ) {
551 usb_log_debug("Bulk QH: %p vs. %p.\n",
[4125b7d]552 (void *) expected_pa, (void *) real_pa);
[9351353]553 }
554 async_usleep(UHCI_DEBUGER_TIMEOUT);
555 }
556 return EOK;
557#undef QH
558}
559/**
560 * @}
561 */
Note: See TracBrowser for help on using the repository browser.