Changeset b997e7b in mainline
- Timestamp:
- 2013-01-05T19:49:16Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 32c2c8f
- Parents:
- 2a6e2358
- Location:
- uspace/lib/usbvirt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbvirt/include/usbvirt/device.h
r2a6e2358 rb997e7b 213 213 /** Virtual USB device. */ 214 214 struct usbvirt_device { 215 /** Device does not require USB bus power */ 216 bool self_powered; 217 /** Device is allowed to signal remote wakeup */ 218 bool remote_wakeup; 215 219 /** Name for debugging purposes. */ 216 220 const char *name; -
uspace/lib/usbvirt/src/stdreq.c
r2a6e2358 rb997e7b 189 189 } 190 190 191 static int req_get_dev_status(usbvirt_device_t *device, 192 const usb_device_request_setup_packet_t *setup_packet, uint8_t *data, size_t *act_size) 193 { 194 if (setup_packet->length != 2) 195 return ESTALL; 196 data[0] = (device->self_powered ? 1 : 0) | (device->remote_wakeup ? 2 : 0); 197 data[1] = 0; 198 *act_size = 2; 199 return EOK; 200 } 201 static int req_get_iface_ep_status(usbvirt_device_t *device, 202 const usb_device_request_setup_packet_t *setup_packet, uint8_t *data, size_t *act_size) 203 { 204 if (setup_packet->length != 2) 205 return ESTALL; 206 data[0] = 0; 207 data[1] = 0; 208 *act_size = 2; 209 return EOK; 210 } 211 191 212 /** Standard request handlers. */ 192 213 usbvirt_control_request_handler_t library_handlers[] = { … … 206 227 .callback = req_set_configuration 207 228 }, 229 { 230 STD_REQ_IN(USB_REQUEST_RECIPIENT_DEVICE, USB_DEVREQ_GET_STATUS), 231 .name = "GetDeviceStatus", 232 .callback = req_get_dev_status, 233 }, 234 { 235 STD_REQ_IN(USB_REQUEST_RECIPIENT_INTERFACE, USB_DEVREQ_GET_STATUS), 236 .name = "GetInterfaceStatus", 237 .callback = req_get_iface_ep_status, 238 }, 239 { 240 /* virtual EPs by default cannot be stalled */ 241 STD_REQ_IN(USB_REQUEST_RECIPIENT_ENDPOINT, USB_DEVREQ_GET_STATUS), 242 .name = "GetEndpointStatus", 243 .callback = req_get_iface_ep_status, 244 }, 208 245 { .callback = NULL } 209 246 };
Note:
See TracChangeset
for help on using the changeset viewer.