Changeset 2a6e2358 in mainline
- Timestamp:
- 2013-01-05T18:23:25Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b997e7b
- Parents:
- c9399c0
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vuhid/main.c
rc9399c0 r2a6e2358 57 57 static usbvirt_control_request_handler_t endpoint_zero_handlers[] = { 58 58 { 59 .request_type = SETUP_REQUEST_TO_HOST(USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_INTERFACE), 60 .request = USB_DEVREQ_GET_DESCRIPTOR, 59 STD_REQ_IN(USB_REQUEST_RECIPIENT_INTERFACE, USB_DEVREQ_GET_DESCRIPTOR), 61 60 .name = "Get_Descriptor", 62 61 .callback = req_get_descriptor 63 62 }, 64 63 { 65 .request_type = SETUP_REQUEST_TO_DEVICE(USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_INTERFACE), 66 .request = USB_HIDREQ_SET_PROTOCOL, 64 CLASS_REQ_OUT(USB_REQUEST_RECIPIENT_INTERFACE, USB_HIDREQ_SET_PROTOCOL), 67 65 .name = "Set_Protocol", 68 66 .callback = req_set_protocol 69 67 }, 70 68 { 71 .request_type = SETUP_REQUEST_TO_DEVICE(USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_INTERFACE), 72 .request = USB_HIDREQ_SET_REPORT, 69 CLASS_REQ_OUT(USB_REQUEST_RECIPIENT_INTERFACE, USB_HIDREQ_SET_REPORT), 73 70 .name = "Set_Report", 74 71 .callback = req_set_report -
uspace/drv/bus/usb/vhc/hub/virthubops.c
rc9399c0 r2a6e2358 347 347 348 348 349 /** Create a class request to get data from device350 *351 * @param rec Request recipient.352 * @param req Request code.353 */354 #define CLASS_REQ_IN(rec, req) \355 .request_type = SETUP_REQUEST_TO_HOST(USB_REQUEST_TYPE_CLASS, rec), \356 .request = req357 358 /** Create a class request to send data to device359 *360 * @param rec Request recipient.361 * @param req Request code.362 */363 #define CLASS_REQ_OUT(rec, req) \364 .request_type = SETUP_REQUEST_TO_DEVICE(USB_REQUEST_TYPE_CLASS, rec), \365 .request = req366 367 349 /** Hub operations on control endpoint zero. */ 368 350 static usbvirt_control_request_handler_t endpoint_zero_handlers[] = { 369 351 { 370 .request_type = SETUP_REQUEST_TO_HOST(USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE), 371 .request = USB_DEVREQ_GET_DESCRIPTOR, 352 STD_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_GET_DESCRIPTOR), 372 353 .name = "GetDescriptor", 373 354 .callback = req_get_descriptor -
uspace/lib/usbvirt/include/usbvirt/device.h
rc9399c0 r2a6e2358 41 41 #include <async.h> 42 42 43 43 44 /** Maximum number of endpoints supported by virtual USB. */ 44 45 #define USBVIRT_ENDPOINT_MAX 16 … … 87 88 const usb_device_request_setup_packet_t *setup_packet, 88 89 uint8_t *data, size_t *act_data_size); 90 91 /** Create a class request to get data from device 92 * 93 * @param rec Request recipient. 94 * @param req Request code. 95 */ 96 #define CLASS_REQ_IN(rec, req) \ 97 .request_type = SETUP_REQUEST_TO_HOST(USB_REQUEST_TYPE_CLASS, rec), \ 98 .request = req 99 100 /** Create a class request to send data to device 101 * 102 * @param rec Request recipient. 103 * @param req Request code. 104 */ 105 #define CLASS_REQ_OUT(rec, req) \ 106 .request_type = SETUP_REQUEST_TO_DEVICE(USB_REQUEST_TYPE_CLASS, rec), \ 107 .request = req 108 109 /** Create a standard request to get data from device 110 * 111 * @param rec Request recipient. 112 * @param req Request code. 113 */ 114 #define STD_REQ_IN(rec, req) \ 115 .request_type = SETUP_REQUEST_TO_HOST(USB_REQUEST_TYPE_STANDARD, rec), \ 116 .request = req 117 118 /** Create a standard request to send data to device 119 * 120 * @param rec Request recipient. 121 * @param req Request code. 122 */ 123 #define STD_REQ_OUT(rec, req) \ 124 .request_type = SETUP_REQUEST_TO_DEVICE(USB_REQUEST_TYPE_STANDARD, rec), \ 125 .request = req 89 126 90 127 /** Callback for control request on a virtual USB device. -
uspace/lib/usbvirt/src/stdreq.c
rc9399c0 r2a6e2358 192 192 usbvirt_control_request_handler_t library_handlers[] = { 193 193 { 194 .request_type = SETUP_REQUEST_TO_DEVICE(USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE), 195 .request = USB_DEVREQ_SET_ADDRESS, 194 STD_REQ_OUT(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_SET_ADDRESS), 196 195 .name = "SetAddress", 197 196 .callback = req_set_address 198 197 }, 199 198 { 200 .request_type = SETUP_REQUEST_TO_HOST(USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE), 201 .request = USB_DEVREQ_GET_DESCRIPTOR, 199 STD_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_GET_DESCRIPTOR), 202 200 .name = "GetDescriptor", 203 201 .callback = req_get_descriptor 204 202 }, 205 203 { 206 .request_type = SETUP_REQUEST_TO_DEVICE(USB_REQUEST_TYPE_STANDARD, USB_REQUEST_RECIPIENT_DEVICE), 207 .request = USB_DEVREQ_SET_CONFIGURATION, 204 STD_REQ_OUT(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_SET_CONFIGURATION), 208 205 .name = "SetConfiguration", 209 206 .callback = req_set_configuration
Note:
See TracChangeset
for help on using the changeset viewer.