Ignore:
Timestamp:
2016-07-22T08:24:47Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge from lp:~jan.vesely/helenos/usb

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/vhc/hub/virthubops.c

    r5b18137 rb4b534ac  
    340340
    341341
    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)
    350342
    351343/** Recipient: other. */
     
    353345/** Recipient: device. */
    354346#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
    384348
    385349/** Hub operations on control endpoint zero. */
    386350static usbvirt_control_request_handler_t endpoint_zero_handlers[] = {
    387351        {
    388                 STD_REQ(DIR_IN, REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),
    389                 .name = "GetDescriptor",
     352                STD_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),
     353                .name = "GetStdDescriptor",
    390354                .callback = req_get_descriptor
    391355        },
    392356        {
    393                 CLASS_REQ(DIR_IN, REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),
    394                 .name = "GetDescriptor",
     357                CLASS_REQ_IN(REC_DEVICE, USB_DEVREQ_GET_DESCRIPTOR),
     358                .name = "GetClassDescriptor",
    395359                .callback = req_get_descriptor
    396360        },
    397361        {
    398                 CLASS_REQ(DIR_IN, REC_OTHER, USB_HUB_REQUEST_GET_STATUS),
     362                CLASS_REQ_IN(REC_OTHER, USB_HUB_REQUEST_GET_STATUS),
    399363                .name = "GetPortStatus",
    400364                .callback = req_get_port_status
    401365        },
    402366        {
    403                 CLASS_REQ(DIR_OUT, REC_DEVICE, USB_HUB_REQUEST_CLEAR_FEATURE),
     367                CLASS_REQ_OUT(REC_DEVICE, USB_HUB_REQUEST_CLEAR_FEATURE),
    404368                .name = "ClearHubFeature",
    405369                .callback = req_clear_hub_feature
    406370        },
    407371        {
    408                 CLASS_REQ(DIR_OUT, REC_OTHER, USB_HUB_REQUEST_CLEAR_FEATURE),
     372                CLASS_REQ_OUT(REC_OTHER, USB_HUB_REQUEST_CLEAR_FEATURE),
    409373                .name = "ClearPortFeature",
    410374                .callback = req_clear_port_feature
    411375        },
    412376        {
    413                 CLASS_REQ(DIR_IN, REC_OTHER, USB_HUB_REQUEST_GET_STATE),
     377                CLASS_REQ_IN(REC_OTHER, USB_HUB_REQUEST_GET_STATE),
    414378                .name = "GetBusState",
    415379                .callback = req_get_bus_state
    416380        },
    417381        {
    418                 CLASS_REQ(DIR_IN, REC_DEVICE, USB_HUB_REQUEST_GET_DESCRIPTOR),
     382                CLASS_REQ_IN(REC_DEVICE, USB_HUB_REQUEST_GET_DESCRIPTOR),
    419383                .name = "GetHubDescriptor",
    420384                .callback = req_get_descriptor
    421385        },
    422386        {
    423                 CLASS_REQ(DIR_IN, REC_DEVICE, USB_HUB_REQUEST_GET_STATUS),
     387                CLASS_REQ_IN(REC_DEVICE, USB_HUB_REQUEST_GET_STATUS),
    424388                .name = "GetHubStatus",
    425389                .callback = req_get_hub_status
    426390        },
    427391        {
    428                 CLASS_REQ(DIR_IN, REC_OTHER, USB_HUB_REQUEST_GET_STATUS),
     392                CLASS_REQ_IN(REC_OTHER, USB_HUB_REQUEST_GET_STATUS),
    429393                .name = "GetPortStatus",
    430394                .callback = req_get_port_status
    431395        },
    432396        {
    433                 CLASS_REQ(DIR_OUT, REC_DEVICE, USB_HUB_REQUEST_SET_FEATURE),
     397                CLASS_REQ_OUT(REC_DEVICE, USB_HUB_REQUEST_SET_FEATURE),
    434398                .name = "SetHubFeature",
    435399                .callback = req_set_hub_feature
    436400        },
    437401        {
    438                 CLASS_REQ(DIR_OUT, REC_OTHER, USB_HUB_REQUEST_SET_FEATURE),
     402                CLASS_REQ_OUT(REC_OTHER, USB_HUB_REQUEST_SET_FEATURE),
    439403                .name = "SetPortFeature",
    440404                .callback = req_set_port_feature
Note: See TracChangeset for help on using the changeset viewer.