Changes in uspace/lib/usb/src/hcdhubd.c [4317827:7972b51] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hcdhubd.c
r4317827 r7972b51 51 51 */ 52 52 static int add_device(device_t *dev) { 53 return ENOTSUP; 53 bool is_hc = str_cmp(dev->name, USB_HUB_DEVICE_NAME) != 0; 54 printf("%s: add_device(name=\"%s\")\n", hc_driver->name, dev->name); 55 56 if (is_hc) { 57 /* 58 * We are the HC itself. 59 */ 60 return usb_add_hc_device(dev); 61 } else { 62 /* 63 * We are some (maybe deeply nested) hub. 64 * Thus, assign our own operations and explore already 65 * connected devices. 66 */ 67 return usb_add_hub_device(dev); 68 } 54 69 } 55 70 … … 90 105 * @return Error code. 91 106 */ 92 int usb_hcd_add_root_hub( device_t *dev)107 int usb_hcd_add_root_hub(usb_hc_device_t *dev) 93 108 { 94 109 char *id; 95 int rc = asprintf(&id, "usb&h ub");110 int rc = asprintf(&id, "usb&hc=%s&hub", hc_driver->name); 96 111 if (rc <= 0) { 97 112 return rc; 98 113 } 99 114 100 rc = usb_hc_add_child_device(dev , USB_HUB_DEVICE_NAME, id, true);115 rc = usb_hc_add_child_device(dev->generic, USB_HUB_DEVICE_NAME, id, true); 101 116 if (rc != EOK) { 102 117 free(id);
Note:
See TracChangeset
for help on using the changeset viewer.