Changes in uspace/drv/bus/usb/vhc/hub/virthubops.c [f81498d:58563585] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/vhc/hub/virthubops.c
rf81498d r58563585 33 33 * @brief Virtual USB hub operations. 34 34 */ 35 35 36 #include <errno.h> 36 37 #include <usb/classes/hub.h> … … 340 341 341 342 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 343 351 344 /** Recipient: other. */ … … 353 346 /** Recipient: device. */ 354 347 #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 348 384 349 385 350 /** Hub operations on control endpoint zero. */ 386 351 static usbvirt_control_request_handler_t endpoint_zero_handlers[] = { 387 352 { 388 STD_REQ (DIR_IN, REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),389 .name = "Get Descriptor",353 STD_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_GET_DESCRIPTOR), 354 .name = "GetStdDescriptor", 390 355 .callback = req_get_descriptor 391 356 }, 392 357 { 393 CLASS_REQ (DIR_IN,REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),394 .name = "Get Descriptor",358 CLASS_REQ_IN(REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR), 359 .name = "GetClassDescriptor", 395 360 .callback = req_get_descriptor 396 361 }, 397 362 { 398 CLASS_REQ (DIR_IN,REC_OTHER, USB_HUB_REQUEST_GET_STATUS),363 CLASS_REQ_IN(REC_OTHER, USB_HUB_REQUEST_GET_STATUS), 399 364 .name = "GetPortStatus", 400 365 .callback = req_get_port_status 401 366 }, 402 367 { 403 CLASS_REQ (DIR_OUT,REC_DEVICE, USB_HUB_REQUEST_CLEAR_FEATURE),368 CLASS_REQ_OUT(REC_DEVICE, USB_HUB_REQUEST_CLEAR_FEATURE), 404 369 .name = "ClearHubFeature", 405 370 .callback = req_clear_hub_feature 406 371 }, 407 372 { 408 CLASS_REQ (DIR_OUT,REC_OTHER, USB_HUB_REQUEST_CLEAR_FEATURE),373 CLASS_REQ_OUT(REC_OTHER, USB_HUB_REQUEST_CLEAR_FEATURE), 409 374 .name = "ClearPortFeature", 410 375 .callback = req_clear_port_feature 411 376 }, 412 377 { 413 CLASS_REQ (DIR_IN,REC_OTHER, USB_HUB_REQUEST_GET_STATE),378 CLASS_REQ_IN(REC_OTHER, USB_HUB_REQUEST_GET_STATE), 414 379 .name = "GetBusState", 415 380 .callback = req_get_bus_state 416 381 }, 417 382 { 418 CLASS_REQ (DIR_IN,REC_DEVICE, USB_HUB_REQUEST_GET_DESCRIPTOR),383 CLASS_REQ_IN(REC_DEVICE, USB_HUB_REQUEST_GET_DESCRIPTOR), 419 384 .name = "GetHubDescriptor", 420 385 .callback = req_get_descriptor 421 386 }, 422 387 { 423 CLASS_REQ (DIR_IN,REC_DEVICE, USB_HUB_REQUEST_GET_STATUS),388 CLASS_REQ_IN(REC_DEVICE, USB_HUB_REQUEST_GET_STATUS), 424 389 .name = "GetHubStatus", 425 390 .callback = req_get_hub_status 426 391 }, 427 392 { 428 CLASS_REQ (DIR_IN,REC_OTHER, USB_HUB_REQUEST_GET_STATUS),393 CLASS_REQ_IN(REC_OTHER, USB_HUB_REQUEST_GET_STATUS), 429 394 .name = "GetPortStatus", 430 395 .callback = req_get_port_status 431 396 }, 432 397 { 433 CLASS_REQ (DIR_OUT,REC_DEVICE, USB_HUB_REQUEST_SET_FEATURE),398 CLASS_REQ_OUT(REC_DEVICE, USB_HUB_REQUEST_SET_FEATURE), 434 399 .name = "SetHubFeature", 435 400 .callback = req_set_hub_feature 436 401 }, 437 402 { 438 CLASS_REQ (DIR_OUT,REC_OTHER, USB_HUB_REQUEST_SET_FEATURE),403 CLASS_REQ_OUT(REC_OTHER, USB_HUB_REQUEST_SET_FEATURE), 439 404 .name = "SetPortFeature", 440 405 .callback = req_set_port_feature
Note:
See TracChangeset
for help on using the changeset viewer.