source: mainline/uspace/drv/bus/usb/ehci/ehci_rh.c@ 6ef69e9

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

ehci: Add more debugging output

  • Property mode set to 100644
File size: 18.3 KB
Line 
1/*
2 * Copyright (c) 2013 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 drvusbehci
29 * @{
30 */
31/** @file
32 * @brief EHCI driver
33 */
34
35#include <assert.h>
36#include <errno.h>
37#include <mem.h>
38#include <str_error.h>
39#include <sys/types.h>
40
41#include <usb/classes/hub.h>
42#include <usb/debug.h>
43#include <usb/descriptor.h>
44#include <usb/request.h>
45#include <usb/usb.h>
46
47#include <usb/host/endpoint.h>
48#include <usbvirt/device.h>
49
50#include "ehci_rh.h"
51
52enum {
53 HUB_STATUS_CHANGE_PIPE = 1,
54};
55
56static usbvirt_device_ops_t ops;
57
58/** Initialize internal USB HUB class descriptor.
59 * @param instance EHCI root hub.
60 * Use register based info to create accurate descriptor.
61 */
62static void ehci_rh_hub_desc_init(ehci_rh_t *instance, unsigned hcs)
63{
64 assert(instance);
65 const unsigned dsize = sizeof(usb_hub_descriptor_header_t) +
66 STATUS_BYTES(instance->port_count) * 2;
67 assert(dsize <= sizeof(instance->hub_descriptor));
68
69 instance->hub_descriptor.header.length = dsize;
70 instance->hub_descriptor.header.descriptor_type = USB_DESCTYPE_HUB;
71 instance->hub_descriptor.header.port_count = instance->port_count;
72 /* Bits 0,1 indicate power switching mode
73 * Bit 2 indicates device type (compound device)
74 * Bits 3,4 indicate over-current protection mode */
75 instance->hub_descriptor.header.characteristics = 0 |
76 ((hcs & EHCI_CAPS_HCS_PPC_FLAG) ? 0x09 : 0x12) |
77 ((hcs & EHCI_CAPS_HCS_INDICATORS_FLAG) ? 0x80 : 0) |
78 (0x3 << 5); /* Need 32 FS bit times */ // TODO Implement
79 instance->hub_descriptor.header.characteristics_reserved = 0;
80 instance->hub_descriptor.header.power_good_time = 50;
81 /* bHubContrCurrent, root hubs don't need no power. */
82 instance->hub_descriptor.header.max_current = 0;
83
84 /* Device removable and some legacy 1.0 stuff*/
85 instance->hub_descriptor.rempow[0] = 0xff;
86 instance->hub_descriptor.rempow[1] = 0xff;
87 instance->hub_descriptor.rempow[2] = 0xff;
88 instance->hub_descriptor.rempow[3] = 0xff;
89
90}
91/** Initialize EHCI root hub.
92 * @param instance Place to initialize.
93 * @param regs EHCI device registers.
94 * @param name Device name.
95 * return Error code, EOK on success.
96 *
97 * Selects preconfigured port powering mode, sets up descriptor, and
98 * initializes internal virtual hub.
99 */
100int ehci_rh_init(ehci_rh_t *instance, ehci_caps_regs_t *caps, ehci_regs_t *regs,
101const char *name)
102{
103 assert(instance);
104 instance->registers = regs;
105 instance->port_count =
106 (EHCI_RD(caps->hcsparams) >> EHCI_CAPS_HCS_N_PORTS_SHIFT) &
107 EHCI_CAPS_HCS_N_PORTS_MASK;
108 usb_log_debug2("hcsparams: %x.\n", EHCI_RD(caps->hcsparams));
109 usb_log_info("%s: Found %u ports.\n", name, instance->port_count);
110
111 if (EHCI_RD(caps->hcsparams) & EHCI_CAPS_HCS_PPC_FLAG) {
112 usb_log_info("%s: Per-port power switching.\n", name);
113 } else {
114 usb_log_info("%s: No power switching.\n", name);
115 }
116
117 for (unsigned i = 0; i < EHCI_MAX_PORTS; ++i) {
118 instance->reset_flag[i] = false;
119 instance->resume_flag[i] = false;
120 }
121
122 ehci_rh_hub_desc_init(instance, EHCI_RD(caps->hcsparams));
123 instance->unfinished_interrupt_transfer = NULL;
124
125 return virthub_base_init(&instance->base, name, &ops, instance,
126 NULL, &instance->hub_descriptor.header, HUB_STATUS_CHANGE_PIPE);
127}
128
129/** Schedule USB request.
130 * @param instance OCHI root hub instance.
131 * @param batch USB requst batch to schedule.
132 * @return Always EOK.
133 * Most requests complete even before this function returns,
134 * status change requests might be postponed until there is something to report.
135 */
136int ehci_rh_schedule(ehci_rh_t *instance, usb_transfer_batch_t *batch)
137{
138 assert(instance);
139 assert(batch);
140 const usb_target_t target = {{
141 .address = batch->ep->address,
142 .endpoint = batch->ep->endpoint,
143 }};
144 batch->error = virthub_base_request(&instance->base, target,
145 usb_transfer_batch_direction(batch), (void*)batch->setup_buffer,
146 batch->buffer, batch->buffer_size, &batch->transfered_size);
147 if (batch->error == ENAK) {
148 usb_log_debug("EHCI RH(%p): BATCH(%p) adding as unfinished\n",
149 instance, batch);
150 /* This is safe because only status change interrupt transfers
151 * return NAK. The assertion holds true because the batch
152 * existence prevents communication with that ep */
153 assert(instance->unfinished_interrupt_transfer == NULL);
154 instance->unfinished_interrupt_transfer = batch;
155 } else {
156 usb_transfer_batch_finish(batch, NULL);
157 usb_transfer_batch_destroy(batch);
158 usb_log_debug("EHCI RH(%p): BATCH(%p) virtual request: %s\n",
159 instance, batch, str_error(batch->error));
160 }
161 return EOK;
162}
163
164/** Handle EHCI RHSC interrupt.
165 * @param instance EHCI root hub isntance.
166 * @return Always EOK.
167 *
168 * Interrupt means there is a change of status to report. It may trigger
169 * processing of a postponed request.
170 */
171int ehci_rh_interrupt(ehci_rh_t *instance)
172{
173 //TODO atomic swap needed
174 usb_transfer_batch_t *batch = instance->unfinished_interrupt_transfer;
175 instance->unfinished_interrupt_transfer = NULL;
176 if (batch) {
177 const usb_target_t target = {{
178 .address = batch->ep->address,
179 .endpoint = batch->ep->endpoint,
180 }};
181 batch->error = virthub_base_request(&instance->base, target,
182 usb_transfer_batch_direction(batch),
183 (void*)batch->setup_buffer,
184 batch->buffer, batch->buffer_size, &batch->transfered_size);
185 usb_transfer_batch_finish(batch, NULL);
186 usb_transfer_batch_destroy(batch);
187 }
188 return EOK;
189}
190
191/* HUB ROUTINES IMPLEMENTATION */
192#define TEST_SIZE_INIT(size, port, hub) \
193do { \
194 hub = virthub_get_data(device); \
195 assert(hub);\
196 if (uint16_usb2host(setup_packet->length) != size) \
197 return ESTALL; \
198 port = uint16_usb2host(setup_packet->index) - 1; \
199 if (port > hub->port_count) \
200 return EINVAL; \
201} while (0)
202
203/** Hub status request handler.
204 * @param device Virtual hub device
205 * @param setup_packet USB setup stage data.
206 * @param[out] data destination data buffer, size must be at least
207 * setup_packet->length bytes
208 * @param[out] act_size Sized of the valid response part of the buffer.
209 * @return Error code.
210 */
211static int req_get_status(usbvirt_device_t *device,
212 const usb_device_request_setup_packet_t *setup_packet,
213 uint8_t *data, size_t *act_size)
214{
215 ehci_rh_t *hub = virthub_get_data(device);
216 assert(hub);
217 if (uint16_usb2host(setup_packet->length) != 4)
218 return ESTALL;
219 /* ECHI RH does not report global OC, and local power is always good */
220 const uint32_t val = 0;
221 memcpy(data, &val, sizeof(val));
222 *act_size = sizeof(val);
223 return EOK;
224}
225
226/** Hub set feature request handler.
227 * @param device Virtual hub device
228 * @param setup_packet USB setup stage data.
229 * @param[out] data destination data buffer, size must be at least
230 * setup_packet->length bytes
231 * @param[out] act_size Sized of the valid response part of the buffer.
232 * @return Error code.
233 */
234static int req_clear_hub_feature(usbvirt_device_t *device,
235 const usb_device_request_setup_packet_t *setup_packet,
236 uint8_t *data, size_t *act_size)
237{
238 ehci_rh_t *hub = virthub_get_data(device);
239 assert(hub);
240
241 /*
242 * Chapter 11.16.2 specifies that only C_HUB_LOCAL_POWER and
243 * C_HUB_OVER_CURRENT are supported.
244 * C_HUB_LOCAL_POWER is not supported because root hubs do not support
245 * local power status feature.
246 * EHCI RH does not report global OC condition either
247 */
248 return ESTALL;
249}
250
251#define BIT_VAL(val, bit) ((val & bit) ? 1 : 0)
252#define EHCI2USB(val, bit, feat) (BIT_VAL(val, bit) << feat)
253
254/** Port status request handler.
255 * @param device Virtual hub device
256 * @param setup_packet USB setup stage data.
257 * @param[out] data destination data buffer, size must be at least
258 * setup_packet->length bytes
259 * @param[out] act_size Sized of the valid response part of the buffer.
260 * @return Error code.
261 */
262static int req_get_port_status(usbvirt_device_t *device,
263 const usb_device_request_setup_packet_t *setup_packet,
264 uint8_t *data, size_t *act_size)
265{
266 ehci_rh_t *hub;
267 unsigned port;
268 TEST_SIZE_INIT(4, port, hub);
269 if (setup_packet->value != 0)
270 return EINVAL;
271
272 const uint32_t reg = EHCI_RD(hub->registers->portsc[port]);
273 const uint32_t status = uint32_host2usb(
274 EHCI2USB(reg, USB_PORTSC_CONNECT_FLAG, USB_HUB_FEATURE_PORT_CONNECTION) |
275 EHCI2USB(reg, USB_PORTSC_ENABLED_FLAG, USB_HUB_FEATURE_PORT_ENABLE) |
276 EHCI2USB(reg, USB_PORTSC_SUSPEND_FLAG, USB_HUB_FEATURE_PORT_SUSPEND) |
277 EHCI2USB(reg, USB_PORTSC_OC_ACTIVE_FLAG, USB_HUB_FEATURE_PORT_OVER_CURRENT) |
278 EHCI2USB(reg, USB_PORTSC_PORT_RESET_FLAG, USB_HUB_FEATURE_PORT_RESET) |
279 EHCI2USB(reg, USB_PORTSC_PORT_POWER_FLAG, USB_HUB_FEATURE_PORT_POWER) |
280 (((reg & USB_PORTSC_LINE_STATUS_MASK) == USB_PORTSC_LINE_STATUS_K) ?
281 (1 << USB_HUB_FEATURE_PORT_LOW_SPEED) : 0) |
282 ((reg & USB_PORTSC_PORT_OWNER_FLAG) ? 0 : (1 << USB_HUB_FEATURE_PORT_HIGH_SPEED)) |
283 EHCI2USB(reg, USB_PORTSC_PORT_TEST_MASK, 11) |
284 EHCI2USB(reg, USB_PORTSC_INDICATOR_MASK, 12) |
285 EHCI2USB(reg, USB_PORTSC_CONNECT_CH_FLAG, USB_HUB_FEATURE_C_PORT_CONNECTION) |
286 EHCI2USB(reg, USB_PORTSC_EN_CHANGE_FLAG, USB_HUB_FEATURE_C_PORT_ENABLE) |
287 (hub->resume_flag[port] ? (1 << USB_HUB_FEATURE_C_PORT_SUSPEND) : 0) |
288 EHCI2USB(reg, USB_PORTSC_OC_CHANGE_FLAG, USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
289 (hub->reset_flag[port] ? (1 << USB_HUB_FEATURE_C_PORT_RESET): 0)
290 );
291 /* Note feature numbers for test and indicator feature do not
292 * corespond to the port status bit locations */
293 memcpy(data, &status, sizeof(status));
294 *act_size = sizeof(status);
295 return EOK;
296}
297
298typedef struct {
299 ehci_rh_t *hub;
300 unsigned port;
301} ehci_rh_job_t;
302
303static int stop_reset(void *arg)
304{
305 ehci_rh_job_t *job = arg;
306 async_usleep(50000);
307 EHCI_CLR(job->hub->registers->portsc[job->port],
308 USB_PORTSC_PORT_RESET_FLAG);
309 /* wait for reset to complete */
310 while (EHCI_RD(job->hub->registers->portsc[job->port]) &
311 USB_PORTSC_PORT_RESET_FLAG) {
312 async_usleep(1);
313 };
314 /* Handle port ownership, if the port is not enabled
315 * after reset it's a full speed device */
316 if (!(EHCI_RD(job->hub->registers->portsc[job->port]) &
317 USB_PORTSC_ENABLED_FLAG)) {
318 EHCI_SET(job->hub->registers->portsc[job->port],
319 USB_PORTSC_PORT_OWNER_FLAG);
320 } else {
321 job->hub->reset_flag[job->port] = true;
322 }
323 ehci_rh_interrupt(job->hub);
324 free(job);
325 return 0;
326}
327
328static int stop_resume(void *arg)
329{
330 ehci_rh_job_t *job = arg;
331 async_usleep(20000);
332 EHCI_CLR(job->hub->registers->portsc[job->port],
333 USB_PORTSC_RESUME_FLAG);
334 job->hub->resume_flag[job->port] = true;
335 ehci_rh_interrupt(job->hub);
336 free(job);
337 return 0;
338}
339
340static int delayed_job(int (*func)(void*), ehci_rh_t *rh, unsigned port)
341{
342 ehci_rh_job_t *job = malloc(sizeof(*job));
343 if (!job)
344 return ENOMEM;
345 job->hub = rh;
346 job->port = port;
347 fid_t fib = fibril_create(func, job);
348 if (!fib) {
349 free(job);
350 return ENOMEM;
351 }
352 fibril_add_ready(fib);
353 return EOK;
354}
355
356
357/** Port clear feature request handler.
358 * @param device Virtual hub device
359 * @param setup_packet USB setup stage data.
360 * @param[out] data destination data buffer, size must be at least
361 * setup_packet->length bytes
362 * @param[out] act_size Sized of the valid response part of the buffer.
363 * @return Error code.
364 */
365static int req_clear_port_feature(usbvirt_device_t *device,
366 const usb_device_request_setup_packet_t *setup_packet,
367 uint8_t *data, size_t *act_size)
368{
369 ehci_rh_t *hub;
370 unsigned port;
371 TEST_SIZE_INIT(0, port, hub);
372 const unsigned feature = uint16_usb2host(setup_packet->value);
373 /* Enabled features to clear: see page 269 of USB specs */
374 switch (feature)
375 {
376 case USB_HUB_FEATURE_PORT_POWER: /*8*/
377 EHCI_CLR(hub->registers->portsc[port],
378 USB_PORTSC_PORT_POWER_FLAG);
379 return EOK;
380
381 case USB_HUB_FEATURE_PORT_ENABLE: /*1*/
382 EHCI_CLR(hub->registers->portsc[port],
383 USB_PORTSC_ENABLED_FLAG);
384 return EOK;
385
386 case USB_HUB_FEATURE_PORT_SUSPEND: /*2*/
387 /* If not in suspend it's noop */
388 if ((EHCI_RD(hub->registers->portsc[port]) &
389 USB_PORTSC_SUSPEND_FLAG) == 0)
390 return EOK;
391 /* Host driven resume */
392 EHCI_SET(hub->registers->portsc[port],
393 USB_PORTSC_RESUME_FLAG);
394 delayed_job(stop_resume, hub, port);
395 return EOK;
396
397 case USB_HUB_FEATURE_C_PORT_CONNECTION: /*16*/
398 EHCI_SET(hub->registers->portsc[port],
399 USB_PORTSC_CONNECT_CH_FLAG);
400 return EOK;
401 case USB_HUB_FEATURE_C_PORT_ENABLE: /*17*/
402 EHCI_SET(hub->registers->portsc[port],
403 USB_PORTSC_CONNECT_CH_FLAG);
404 return EOK;
405 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: /*19*/
406 EHCI_SET(hub->registers->portsc[port],
407 USB_PORTSC_OC_CHANGE_FLAG);
408 return EOK;
409 case USB_HUB_FEATURE_C_PORT_SUSPEND: /*18*/
410 hub->resume_flag[port] = false;
411 return EOK;
412 case USB_HUB_FEATURE_C_PORT_RESET: /*20*/
413 hub->reset_flag[port] = false;
414 return EOK;
415
416 default:
417 return ENOTSUP;
418 }
419}
420
421/** Port set feature request handler.
422 * @param device Virtual hub device
423 * @param setup_packet USB setup stage data.
424 * @param[out] data destination data buffer, size must be at least
425 * setup_packet->length bytes
426 * @param[out] act_size Sized of the valid response part of the buffer.
427 * @return Error code.
428 */
429static int req_set_port_feature(usbvirt_device_t *device,
430 const usb_device_request_setup_packet_t *setup_packet,
431 uint8_t *data, size_t *act_size)
432{
433 ehci_rh_t *hub;
434 unsigned port;
435 TEST_SIZE_INIT(0, port, hub);
436 const unsigned feature = uint16_usb2host(setup_packet->value);
437 switch (feature) {
438 case USB_HUB_FEATURE_PORT_ENABLE: /*1*/
439 EHCI_SET(hub->registers->portsc[port],
440 USB_PORTSC_ENABLED_FLAG);
441 return EOK;
442 case USB_HUB_FEATURE_PORT_SUSPEND: /*2*/
443 EHCI_SET(hub->registers->portsc[port],
444 USB_PORTSC_SUSPEND_FLAG);
445 return EOK;
446 case USB_HUB_FEATURE_PORT_RESET: /*4*/
447 EHCI_SET(hub->registers->portsc[port],
448 USB_PORTSC_PORT_RESET_FLAG);
449 delayed_job(stop_reset, hub, port);
450 return EOK;
451 case USB_HUB_FEATURE_PORT_POWER: /*8*/
452 EHCI_SET(hub->registers->portsc[port],
453 USB_PORTSC_PORT_POWER_FLAG);
454 return EOK;
455 default:
456 return ENOTSUP;
457 }
458}
459
460/** Status change handler.
461 * @param device Virtual hub device
462 * @param endpoint Endpoint number
463 * @param tr_type Transfer type
464 * @param buffer Response destination
465 * @param buffer_size Bytes available in buffer
466 * @param actual_size Size us the used part of the dest buffer.
467 *
468 * Produces status mask. Bit 0 indicates hub status change the other bits
469 * represent port status change. Endian does not matter as UHCI root hubs
470 * only need 1 byte.
471 */
472static int req_status_change_handler(usbvirt_device_t *device,
473 usb_endpoint_t endpoint, usb_transfer_type_t tr_type,
474 void *buffer, size_t buffer_size, size_t *actual_size)
475{
476 ehci_rh_t *hub = virthub_get_data(device);
477 assert(hub);
478
479 if (buffer_size < STATUS_BYTES(hub->port_count))
480 return ESTALL;
481
482 uint16_t mask = 0;
483 for (unsigned port = 0; port < hub->port_count; ++port) {
484 /* Write-clean bits are those that indicate change */
485 uint32_t status = EHCI_RD(hub->registers->portsc[port]);
486 if ((status & USB_PORTSC_WC_MASK)
487 || hub->reset_flag[port] || hub->reset_flag[port]) {
488 /* Ignore new LS device */
489 if ((status & USB_PORTSC_CONNECT_CH_FLAG) &&
490 (status & USB_PORTSC_LINE_STATUS_MASK) ==
491 USB_PORTSC_LINE_STATUS_K)
492 EHCI_SET(hub->registers->portsc[port],
493 USB_PORTSC_PORT_OWNER_FLAG);
494 else
495 mask |= (2 << port);
496 }
497 }
498
499 usb_log_debug2("EHCI root hub interrupt mask: %hx.\n", mask);
500
501 if (mask == 0)
502 return ENAK;
503 mask = uint16_host2usb(mask);
504 memcpy(buffer, &mask, STATUS_BYTES(hub->port_count));
505 *actual_size = STATUS_BYTES(hub->port_count);
506 return EOK;
507}
508
509/** EHCI root hub request handlers */
510static const usbvirt_control_request_handler_t control_transfer_handlers[] = {
511 {
512 STD_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),
513 .name = "GetDescriptor",
514 .callback = virthub_base_get_hub_descriptor,
515 },
516 {
517 CLASS_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),
518 .name = "GetDescriptor",
519 .callback = virthub_base_get_hub_descriptor,
520 },
521 {
522 CLASS_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_HUB_REQUEST_GET_DESCRIPTOR),
523 .name = "GetHubDescriptor",
524 .callback = virthub_base_get_hub_descriptor,
525 },
526 {
527 CLASS_REQ_IN(USB_REQUEST_RECIPIENT_OTHER, USB_HUB_REQUEST_GET_STATUS),
528 .name = "GetPortStatus",
529 .callback = req_get_port_status,
530 },
531 {
532 CLASS_REQ_OUT(USB_REQUEST_RECIPIENT_DEVICE, USB_HUB_REQUEST_CLEAR_FEATURE),
533 .name = "ClearHubFeature",
534 .callback = req_clear_hub_feature,
535 },
536 {
537 CLASS_REQ_OUT(USB_REQUEST_RECIPIENT_OTHER, USB_HUB_REQUEST_CLEAR_FEATURE),
538 .name = "ClearPortFeature",
539 .callback = req_clear_port_feature,
540 },
541 {
542 CLASS_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_HUB_REQUEST_GET_STATUS),
543 .name = "GetHubStatus",
544 .callback = req_get_status,
545 },
546 {
547 CLASS_REQ_IN(USB_REQUEST_RECIPIENT_OTHER, USB_HUB_REQUEST_GET_STATUS),
548 .name = "GetPortStatus",
549 .callback = req_get_port_status,
550 },
551 {
552 CLASS_REQ_OUT(USB_REQUEST_RECIPIENT_DEVICE, USB_HUB_REQUEST_SET_FEATURE),
553 .name = "SetHubFeature",
554 .callback = req_nop,
555 },
556 {
557 CLASS_REQ_OUT(USB_REQUEST_RECIPIENT_OTHER, USB_HUB_REQUEST_SET_FEATURE),
558 .name = "SetPortFeature",
559 .callback = req_set_port_feature,
560 },
561 {
562 .callback = NULL
563 }
564};
565
566/** Virtual EHCI root hub ops */
567static usbvirt_device_ops_t ops = {
568 .control = control_transfer_handlers,
569 .data_in[HUB_STATUS_CHANGE_PIPE] = req_status_change_handler,
570};
Note: See TracBrowser for help on using the repository browser.