Changeset 4317827 in mainline for uspace/lib
- Timestamp:
- 2010-12-04T14:00:41Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 36c410e
- Parents:
- 62c9661
- Location:
- uspace/lib/usb
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/Makefile
r62c9661 r4317827 35 35 src/hcdhubd.c \ 36 36 src/hcdrv.c \ 37 src/hubdrv.c \38 37 src/localdrv.c \ 39 38 src/remotedrv.c \ -
uspace/lib/usb/include/usb/hcdhubd.h
r62c9661 r4317827 146 146 147 147 int usb_hcd_main(usb_hc_driver_t *); 148 int usb_hcd_add_root_hub( usb_hc_device_t *dev);148 int usb_hcd_add_root_hub(device_t *dev); 149 149 150 150 -
uspace/lib/usb/src/hcdhubd.c
r62c9661 r4317827 51 51 */ 52 52 static int add_device(device_t *dev) { 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 } 53 return ENOTSUP; 69 54 } 70 55 … … 105 90 * @return Error code. 106 91 */ 107 int usb_hcd_add_root_hub( usb_hc_device_t *dev)92 int usb_hcd_add_root_hub(device_t *dev) 108 93 { 109 94 char *id; 110 int rc = asprintf(&id, "usb&h c=%s&hub", hc_driver->name);95 int rc = asprintf(&id, "usb&hub"); 111 96 if (rc <= 0) { 112 97 return rc; 113 98 } 114 99 115 rc = usb_hc_add_child_device(dev ->generic, USB_HUB_DEVICE_NAME, id, true);100 rc = usb_hc_add_child_device(dev, USB_HUB_DEVICE_NAME, id, true); 116 101 if (rc != EOK) { 117 102 free(id); -
uspace/lib/usb/src/hcdhubd_private.h
r62c9661 r4317827 46 46 usb_address_t usb_get_address_by_handle(devman_handle_t); 47 47 int usb_add_hc_device(device_t *); 48 int usb_add_hub_device(device_t *);49 48 50 49 #endif -
uspace/lib/usb/src/hcdrv.c
r62c9661 r4317827 47 47 LIST_INITIALIZE(hc_list); 48 48 49 /* Fake driver to have the name item initialized. */ 50 static usb_hc_driver_t hc_driver_fake = { 51 .name = "HCD", 52 }; 53 49 54 /** Our HC driver. */ 50 usb_hc_driver_t *hc_driver = NULL;55 usb_hc_driver_t *hc_driver = &hc_driver_fake; 51 56 52 57 static device_ops_t usb_device_ops = { … … 71 76 int usb_add_hc_device(device_t *dev) 72 77 { 78 return ENOTSUP; 73 79 usb_hc_device_t *hc_dev = usb_hc_device_create(dev); 74 80
Note:
See TracChangeset
for help on using the changeset viewer.