Changeset 6df4adc4 in mainline
- Timestamp:
- 2012-12-30T19:56:50Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9e2132a
- Parents:
- 68e1023
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmid/explore.c
r68e1023 r6df4adc4 72 72 * @param list List where to add the interfaces. 73 73 */ 74 static voidcreate_interfaces(const uint8_t *config_descriptor,75 size_t config_descriptor_size, list_t *list )74 static int create_interfaces(const uint8_t *config_descriptor, 75 size_t config_descriptor_size, list_t *list, usb_device_t *usb_dev) 76 76 { 77 assert(config_descriptor); 78 assert(usb_dev); 79 77 80 const usb_dp_parser_data_t data = { 78 81 .data = config_descriptor, … … 107 110 continue; 108 111 } 112 109 113 usbmid_interface_t *iface = malloc(sizeof(usbmid_interface_t)); 110 114 if (iface == NULL) { … … 119 123 120 124 list_append(&iface->link, list); 121 } 125 126 usb_log_info("Creating child for interface %d (%s).\n", 127 interface->interface_number, 128 usb_str_class(interface->interface_class)); 129 130 const int rc = usbmid_spawn_interface_child(usb_dev, iface, 131 &usb_dev->descriptors.device, interface); 132 if (rc != EOK) { 133 usb_log_error("Failed to create interface child for " 134 "%d (%s): %s.\n", interface->interface_number, 135 usb_str_class(interface->interface_class), 136 str_error(rc)); 137 } 138 } 139 return EOK; 122 140 } 123 141 … … 187 205 list_initialize(&usb_mid->interface_list); 188 206 create_interfaces(config_descriptor_raw, config_descriptor_size, 189 &usb_mid->interface_list); 190 191 /* Start child function for every interface. */ 192 list_foreach(usb_mid->interface_list, link) { 193 usbmid_interface_t *iface = usbmid_interface_from_link(link); 194 195 usb_log_info("Creating child for interface %d.\n", 196 iface->interface_no); 197 198 rc = usbmid_spawn_interface_child(dev, iface, 199 &dev->descriptors.device, iface->interface); 200 if (rc != EOK) { 201 usb_log_error("Failed to create interface child: %s.\n", 202 str_error(rc)); 203 } 204 } 207 &usb_mid->interface_list, dev); 205 208 206 209 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.