Changes in uspace/lib/usb/src/recognise.c [71ed4849:a66225f3] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/recognise.c
r71ed4849 ra66225f3 33 33 * @brief Functions for recognising kind of attached devices. 34 34 */ 35 #include <usb_iface.h>36 35 #include <usb/usbdrv.h> 37 36 #include <usb/classes/classes.h> … … 39 38 #include <errno.h> 40 39 41 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)42 {43 assert(dev);44 assert(dev->parent != NULL);45 46 device_t *parent = dev->parent;47 48 if (parent->ops && parent->ops->interfaces[USB_DEV_IFACE]) {49 usb_iface_t *usb_iface50 = (usb_iface_t *) parent->ops->interfaces[USB_DEV_IFACE];51 assert(usb_iface != NULL);52 if (usb_iface->get_hc_handle) {53 int rc = usb_iface->get_hc_handle(parent, handle);54 return rc;55 }56 }57 58 return ENOTSUP;59 }60 61 static usb_iface_t usb_iface = {62 .get_hc_handle = usb_iface_get_hc_handle63 };64 65 static device_ops_t child_ops = {66 .interfaces[USB_DEV_IFACE] = &usb_iface67 };68 40 69 41 #define BCD_INT(a) (((unsigned int)(a)) / 256) … … 313 285 goto failure; 314 286 } 315 child->parent = parent;316 287 child->name = child_name; 317 child->ops = &child_ops;318 288 319 289 rc = usb_drv_create_device_match_ids(hc, &child->match_ids, address);
Note:
See TracChangeset
for help on using the changeset viewer.