Changeset b4b534ac in mainline for uspace/drv/bus/usb/vhc/hub/virthubops.c
- Timestamp:
- 2016-07-22T08:24:47Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f76d2c2
- Parents:
- 5b18137 (diff), 8351f9a4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/vhc/hub/virthubops.c
r5b18137 rb4b534ac 340 340 341 341 342 /** IN class request. */343 #define CLASS_REQ_IN(recipient) \344 USBVIRT_MAKE_CONTROL_REQUEST_TYPE(USB_DIRECTION_IN, \345 USBVIRT_REQUEST_TYPE_CLASS, recipient)346 /** OUT class request. */347 #define CLASS_REQ_OUT(recipient) \348 USBVIRT_MAKE_CONTROL_REQUEST_TYPE(USB_DIRECTION_OUT, \349 USBVIRT_REQUEST_TYPE_CLASS, recipient)350 342 351 343 /** Recipient: other. */ … … 353 345 /** Recipient: device. */ 354 346 #define REC_DEVICE USB_REQUEST_RECIPIENT_DEVICE 355 /** Direction: in. */ 356 #define DIR_IN USB_DIRECTION_IN 357 /** Direction: out. */ 358 #define DIR_OUT USB_DIRECTION_OUT 359 360 361 /** Create a class request. 362 * 363 * @param direction Request direction. 364 * @param recipient Request recipient. 365 * @param req Request code. 366 */ 367 #define CLASS_REQ(direction, recipient, req) \ 368 .req_direction = direction, \ 369 .req_recipient = recipient, \ 370 .req_type = USB_REQUEST_TYPE_CLASS, \ 371 .request = req 372 373 /** Create a standard request. 374 * 375 * @param direction Request direction. 376 * @param recipient Request recipient. 377 * @param req Request code. 378 */ 379 #define STD_REQ(direction, recipient, req) \ 380 .req_direction = direction, \ 381 .req_recipient = recipient, \ 382 .req_type = USB_REQUEST_TYPE_STANDARD, \ 383 .request = req 347 384 348 385 349 /** Hub operations on control endpoint zero. */ 386 350 static usbvirt_control_request_handler_t endpoint_zero_handlers[] = { 387 351 { 388 STD_REQ (DIR_IN, REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),389 .name = "Get Descriptor",352 STD_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_GET_DESCRIPTOR), 353 .name = "GetStdDescriptor", 390 354 .callback = req_get_descriptor 391 355 }, 392 356 { 393 CLASS_REQ (DIR_IN,REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),394 .name = "Get Descriptor",357 CLASS_REQ_IN(REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR), 358 .name = "GetClassDescriptor", 395 359 .callback = req_get_descriptor 396 360 }, 397 361 { 398 CLASS_REQ (DIR_IN,REC_OTHER, USB_HUB_REQUEST_GET_STATUS),362 CLASS_REQ_IN(REC_OTHER, USB_HUB_REQUEST_GET_STATUS), 399 363 .name = "GetPortStatus", 400 364 .callback = req_get_port_status 401 365 }, 402 366 { 403 CLASS_REQ (DIR_OUT,REC_DEVICE, USB_HUB_REQUEST_CLEAR_FEATURE),367 CLASS_REQ_OUT(REC_DEVICE, USB_HUB_REQUEST_CLEAR_FEATURE), 404 368 .name = "ClearHubFeature", 405 369 .callback = req_clear_hub_feature 406 370 }, 407 371 { 408 CLASS_REQ (DIR_OUT,REC_OTHER, USB_HUB_REQUEST_CLEAR_FEATURE),372 CLASS_REQ_OUT(REC_OTHER, USB_HUB_REQUEST_CLEAR_FEATURE), 409 373 .name = "ClearPortFeature", 410 374 .callback = req_clear_port_feature 411 375 }, 412 376 { 413 CLASS_REQ (DIR_IN,REC_OTHER, USB_HUB_REQUEST_GET_STATE),377 CLASS_REQ_IN(REC_OTHER, USB_HUB_REQUEST_GET_STATE), 414 378 .name = "GetBusState", 415 379 .callback = req_get_bus_state 416 380 }, 417 381 { 418 CLASS_REQ (DIR_IN,REC_DEVICE, USB_HUB_REQUEST_GET_DESCRIPTOR),382 CLASS_REQ_IN(REC_DEVICE, USB_HUB_REQUEST_GET_DESCRIPTOR), 419 383 .name = "GetHubDescriptor", 420 384 .callback = req_get_descriptor 421 385 }, 422 386 { 423 CLASS_REQ (DIR_IN,REC_DEVICE, USB_HUB_REQUEST_GET_STATUS),387 CLASS_REQ_IN(REC_DEVICE, USB_HUB_REQUEST_GET_STATUS), 424 388 .name = "GetHubStatus", 425 389 .callback = req_get_hub_status 426 390 }, 427 391 { 428 CLASS_REQ (DIR_IN,REC_OTHER, USB_HUB_REQUEST_GET_STATUS),392 CLASS_REQ_IN(REC_OTHER, USB_HUB_REQUEST_GET_STATUS), 429 393 .name = "GetPortStatus", 430 394 .callback = req_get_port_status 431 395 }, 432 396 { 433 CLASS_REQ (DIR_OUT,REC_DEVICE, USB_HUB_REQUEST_SET_FEATURE),397 CLASS_REQ_OUT(REC_DEVICE, USB_HUB_REQUEST_SET_FEATURE), 434 398 .name = "SetHubFeature", 435 399 .callback = req_set_hub_feature 436 400 }, 437 401 { 438 CLASS_REQ (DIR_OUT,REC_OTHER, USB_HUB_REQUEST_SET_FEATURE),402 CLASS_REQ_OUT(REC_OTHER, USB_HUB_REQUEST_SET_FEATURE), 439 403 .name = "SetPortFeature", 440 404 .callback = req_set_port_feature
Note:
See TracChangeset
for help on using the changeset viewer.