Changeset 8e10ef4 in mainline
- Timestamp:
- 2013-01-26T18:13:25Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b208b3b
- Parents:
- ad97131
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbflbk/main.c
rad97131 r8e10ef4 49 49 { 50 50 usb_log_info("Pretending to control %s `%s'.\n", 51 dev->interface_no< 0 ? "device" : "interface",51 usb_device_get_iface_number(dev) < 0 ? "device" : "interface", 52 52 usb_device_get_name(dev)); 53 53 return EOK; -
uspace/drv/bus/usb/usbhid/kbd/kbddev.c
rad97131 r8e10ef4 272 272 rc = usbhid_req_set_report( 273 273 usb_device_get_default_pipe(hid_dev->usb_dev), 274 hid_dev->usb_dev->interface_no, USB_HID_REPORT_TYPE_OUTPUT, 274 usb_device_get_iface_number(hid_dev->usb_dev), 275 USB_HID_REPORT_TYPE_OUTPUT, 275 276 kbd_dev->output_buffer, kbd_dev->output_size); 276 277 if (rc != EOK) { … … 583 584 584 585 usbhid_req_set_idle(usb_device_get_default_pipe(hid_dev->usb_dev), 585 hid_dev->usb_dev->interface_no, IDLE_RATE);586 usb_device_get_iface_number(hid_dev->usb_dev), IDLE_RATE); 586 587 587 588 … … 789 790 rc = usbhid_req_set_protocol( 790 791 usb_device_get_default_pipe(hid_dev->usb_dev), 791 hid_dev->usb_dev->interface_no, USB_HID_PROTOCOL_BOOT); 792 usb_device_get_iface_number(hid_dev->usb_dev), 793 USB_HID_PROTOCOL_BOOT); 792 794 793 795 if (rc != EOK) { -
uspace/drv/bus/usb/usbhid/main.c
rad97131 r8e10ef4 65 65 } 66 66 67 if ( dev->interface_no< 0) {67 if (usb_device_get_iface_number(dev) < 0) { 68 68 usb_log_error("Failed to add HID device: endpoints not found." 69 69 "\n"); -
uspace/drv/bus/usb/usbhid/mouse/mousedev.c
rad97131 r8e10ef4 316 316 // TODO: how to know if the device supports the request??? 317 317 usbhid_req_set_idle(usb_device_get_default_pipe(hid_dev->usb_dev), 318 hid_dev->usb_dev->interface_no, IDLE_RATE);318 usb_device_get_iface_number(hid_dev->usb_dev), IDLE_RATE); 319 319 return EOK; 320 320 } … … 427 427 rc = usbhid_req_set_protocol( 428 428 usb_device_get_default_pipe(hid_dev->usb_dev), 429 hid_dev->usb_dev->interface_no, USB_HID_PROTOCOL_BOOT); 429 usb_device_get_iface_number(hid_dev->usb_dev), 430 USB_HID_PROTOCOL_BOOT); 430 431 431 432 if (rc != EOK) { -
uspace/drv/bus/usb/usbmast/bo_trans.c
rad97131 r8e10ef4 202 202 usb_device_get_default_pipe(mdev->usb_dev), 203 203 USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_INTERFACE, 204 0xFF, 0, mdev->usb_dev->interface_no, NULL, 0);204 0xFF, 0, usb_device_get_iface_number(mdev->usb_dev), NULL, 0); 205 205 } 206 206 … … 242 242 usb_device_get_default_pipe(mdev->usb_dev), 243 243 USB_REQUEST_TYPE_CLASS, USB_REQUEST_RECIPIENT_INTERFACE, 244 0xFE, 0, mdev->usb_dev->interface_no, &max_lun, 1, &data_recv_len); 244 0xFE, 0, usb_device_get_iface_number(mdev->usb_dev), &max_lun, 1, 245 &data_recv_len); 245 246 if (rc != EOK) { 246 247 return rc; -
uspace/lib/usbdev/include/usb/dev/driver.h
rad97131 r8e10ef4 66 66 } usb_alternate_interfaces_t; 67 67 68 size_t usb_interface_count_alternates(const uint8_t *, size_t, uint8_t); 69 int usb_alternate_interfaces_init(usb_alternate_interfaces_t *, 70 const uint8_t *, size_t, int); 71 void usb_alternate_interfaces_deinit(usb_alternate_interfaces_t *); 72 68 73 /** USB device structure. */ 69 74 typedef struct { … … 182 187 usb_endpoint_mapping_t **, size_t *); 183 188 void usb_device_destroy_pipes(usb_endpoint_mapping_t *, size_t); 189 184 190 usb_pipe_t *usb_device_get_default_pipe(usb_device_t *); 185 191 usb_pipe_t *usb_device_get_pipe(usb_device_t *, usb_endpoint_t, usb_direction_t); 186 192 193 int usb_device_get_iface_number(usb_device_t *); 187 194 const usb_standard_device_descriptor_t * 188 195 usb_device_get_device_descriptor(usb_device_t *); 189 196 const void * usb_device_get_configuration_descriptor(usb_device_t *, size_t *); 190 197 const usb_alternate_interfaces_t * usb_device_get_alternative_ifaces( 198 usb_device_t *); 191 199 192 200 void * usb_device_data_alloc(usb_device_t *, size_t); 193 201 void * usb_device_data_get(usb_device_t *); 194 202 195 size_t usb_interface_count_alternates(const uint8_t *, size_t, uint8_t);196 int usb_alternate_interfaces_init(usb_alternate_interfaces_t *,197 const uint8_t *, size_t, int);198 void usb_alternate_interfaces_deinit(usb_alternate_interfaces_t *);199 203 #endif 200 204 /** -
uspace/lib/usbdev/src/devdrv.c
rad97131 r8e10ef4 279 279 } 280 280 281 int usb_device_get_iface_number(usb_device_t *usb_dev) 282 { 283 assert(usb_dev); 284 return usb_dev->interface_no; 285 } 286 281 287 const usb_standard_device_descriptor_t * 282 288 usb_device_get_device_descriptor(usb_device_t *usb_dev) … … 293 299 *size = usb_dev->descriptors.configuration_size; 294 300 return usb_dev->descriptors.configuration; 301 } 302 303 const usb_alternate_interfaces_t * usb_device_get_alternative_ifaces( 304 usb_device_t *usb_dev) 305 { 306 assert(usb_dev); 307 return &usb_dev->alternate_interfaces; 295 308 } 296 309
Note:
See TracChangeset
for help on using the changeset viewer.