Changeset 7ed5b576 in mainline
- Timestamp:
- 2010-12-12T13:28:16Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0c05496, a66225f3
- Parents:
- 03e02248
- Location:
- uspace/lib/usb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/include/usb/usbdrv.h
r03e02248 r7ed5b576 95 95 96 96 int usb_drv_create_device_match_ids(int, match_id_list_t *, usb_address_t); 97 int usb_drv_register_child_in_devman(int, device_t *, usb_address_t, 98 devman_handle_t *); 99 97 100 98 101 #endif -
uspace/lib/usb/src/recognise.c
r03e02248 r7ed5b576 174 174 } 175 175 176 #if 0 176 177 177 /** Probe for device kind and register it in devman. 178 178 * 179 179 * @param hc Open phone to the host controller. 180 * @param devParent device.180 * @param parent Parent device. 181 181 * @param address Address of the (unknown) attached device. 182 182 * @return Error code. 183 183 */ 184 int usb_drv_register_child_in_devman(int hc, device_t * dev,185 usb_address_t address )184 int usb_drv_register_child_in_devman(int hc, device_t *parent, 185 usb_address_t address, devman_handle_t *child_handle) 186 186 { 187 device_t *child = NULL; 188 char *child_name = NULL; 189 int rc; 190 191 child = create_device(); 192 if (child == NULL) { 193 rc = ENOMEM; 194 goto failure; 195 } 196 197 /* 198 * TODO: some better child naming 199 */ 200 rc = asprintf(&child_name, "usb%p", child); 201 if (rc < 0) { 202 goto failure; 203 } 204 child->name = child_name; 205 206 rc = usb_drv_create_device_match_ids(hc, &child->match_ids, address); 207 if (rc != EOK) { 208 goto failure; 209 } 210 211 rc = child_device_register(child, parent); 212 if (rc != EOK) { 213 goto failure; 214 } 215 216 if (child_handle != NULL) { 217 *child_handle = child->handle; 218 } 219 220 return EOK; 221 222 failure: 223 if (child != NULL) { 224 child->name = NULL; 225 /* This takes care of match_id deallocation as well. */ 226 delete_device(child); 227 } 228 if (child_name != NULL) { 229 free(child_name); 230 } 231 232 return rc; 187 233 188 234 } 189 #endif 235 190 236 191 237 /**
Note:
See TracChangeset
for help on using the changeset viewer.