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