Changes in uspace/lib/usb/src/hubdrv.c [4144630:dac43be] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hubdrv.c
r4144630 rdac43be 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 correct 115 116 device_t * my_hcd = device; 116 117 while (my_hcd->parent) 117 118 my_hcd = my_hcd->parent; 118 119 //dev-> 119 printf(" [hcdhubd]%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name);120 printf("%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name); 120 121 //we add the hub into the first hc 121 122 //link_t *link_hc = hc_list.next; … … 134 135 */ 135 136 int usb_add_hub_device(device_t *dev) { 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); 137 usb_hc_device_t *hc = list_get_instance(hc_list.next, usb_hc_device_t, link); 138 set_hub_address(hc, 5); 144 139 145 140 check_hub_changes(); … … 156 151 my_hcd = my_hcd->parent; 157 152 //dev-> 158 printf(" [hcdhubd]%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name);153 printf("%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name); 159 154 my_hcd = dev; 160 155 while (my_hcd->parent) … … 162 157 //dev-> 163 158 164 printf(" [hcdhubd]%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name);159 printf("%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name); 165 160 166 161 //create the hub structure … … 188 183 */ 189 184 static void set_hub_address(usb_hc_device_t *hc, usb_address_t address) { 190 printf(" [hcdhubd]%s: setting hub address to %d\n", hc->generic->name, address);185 printf("%s: setting hub address to %d\n", hc->generic->name, address); 191 186 usb_target_t target = {0, 0}; 192 187 usb_handle_t handle; … … 222 217 } 223 218 224 printf("[hcdhubd]%s: hub address changed successfully to %d\n", 225 hc->generic->name, address); 219 printf("%s: hub address changed\n", hc->generic->name); 226 220 } 227 221
Note:
See TracChangeset
for help on using the changeset viewer.