Changeset 4144630 in mainline for uspace/lib/usb/src/hubdrv.c
- Timestamp:
- 2010-12-03T15:43:43Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2cb6571, 45e9cc6
- Parents:
- c39544a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hubdrv.c
rc39544a r4144630 113 113 usb_hcd_hub_info_t* result = (usb_hcd_hub_info_t*) malloc(sizeof (usb_hcd_hub_info_t)); 114 114 //get parent device 115 /// @TODO this code is not correct116 115 device_t * my_hcd = device; 117 116 while (my_hcd->parent) 118 117 my_hcd = my_hcd->parent; 119 118 //dev-> 120 printf(" %s: owner hcd found: %s\n", hc_driver->name, my_hcd->name);119 printf("[hcdhubd]%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name); 121 120 //we add the hub into the first hc 122 121 //link_t *link_hc = hc_list.next; … … 135 134 */ 136 135 int usb_add_hub_device(device_t *dev) { 137 usb_hc_device_t *hc = list_get_instance(hc_list.next, usb_hc_device_t, link); 138 set_hub_address(hc, 5); 136 //usb_hc_device_t *hc = list_get_instance(hc_list.next, usb_hc_device_t, link); 137 assert(dev->parent); 138 usb_hc_device_t *hc = (usb_hc_device_t*)dev->parent->driver_data; 139 usb_address_t addr =usb_use_free_address(hc); 140 if(addr<0){ 141 printf("[hcdhubd] ERROR: cannot find an address \n"); 142 } 143 set_hub_address(hc, addr); 139 144 140 145 check_hub_changes(); … … 151 156 my_hcd = my_hcd->parent; 152 157 //dev-> 153 printf(" %s: owner hcd found: %s\n", hc_driver->name, my_hcd->name);158 printf("[hcdhubd]%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name); 154 159 my_hcd = dev; 155 160 while (my_hcd->parent) … … 157 162 //dev-> 158 163 159 printf(" %s: owner hcd found: %s\n", hc_driver->name, my_hcd->name);164 printf("[hcdhubd]%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name); 160 165 161 166 //create the hub structure … … 183 188 */ 184 189 static void set_hub_address(usb_hc_device_t *hc, usb_address_t address) { 185 printf(" %s: setting hub address to %d\n", hc->generic->name, address);190 printf("[hcdhubd]%s: setting hub address to %d\n", hc->generic->name, address); 186 191 usb_target_t target = {0, 0}; 187 192 usb_handle_t handle; … … 217 222 } 218 223 219 printf("%s: hub address changed\n", hc->generic->name); 224 printf("[hcdhubd]%s: hub address changed successfully to %d\n", 225 hc->generic->name, address); 220 226 } 221 227
Note:
See TracChangeset
for help on using the changeset viewer.