Changes in uspace/drv/usbhub/usbhub.c [f40a1e2:5097bed4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
rf40a1e2 r5097bed4 46 46 #include "usbhub_private.h" 47 47 #include "port_status.h" 48 #include "usb/usb.h"49 48 50 49 static usb_iface_t hub_usb_iface = { … … 86 85 87 86 // get hub descriptor 87 usb_target_t target; 88 target.address = addr; 89 target.endpoint = 0; 90 usb_device_request_setup_packet_t request; 91 //printf("[usb_hub] creating descriptor request\n"); 92 usb_hub_set_descriptor_request(&request); 88 93 89 94 //printf("[usb_hub] creating serialized descriptor\n"); … … 93 98 int opResult; 94 99 //printf("[usb_hub] starting control transaction\n"); 95 96 opResult = usb_drv_req_get_descriptor(hc, addr, 97 USB_REQUEST_TYPE_CLASS, 98 USB_DESCTYPE_HUB, 0, 0, serialized_descriptor, 100 opResult = usb_drv_sync_control_read( 101 hc, target, &request, serialized_descriptor, 99 102 USB_HUB_MAX_DESCRIPTOR_SIZE, &received_size); 100 101 103 if (opResult != EOK) { 102 104 dprintf(1,"[usb_hub] failed when receiving hub descriptor, badcode = %d",opResult); … … 153 155 int port; 154 156 int opResult; 157 usb_device_request_setup_packet_t request; 155 158 usb_target_t target; 156 159 target.address = hub_info->usb_device->address; … … 170 173 if(std_descriptor.configuration_count<1){ 171 174 dprintf(1,"[usb_hub] THERE ARE NO CONFIGURATIONS AVAILABLE"); 172 //shouldn`t I return?173 175 } 174 176 /// \TODO check other configurations … … 182 184 } 183 185 //set configuration 184 opResult = usb_drv_req_set_configuration(hc, target.address, 185 config_descriptor.configuration_number); 186 186 request.request_type = 0; 187 request.request = USB_DEVREQ_SET_CONFIGURATION; 188 request.index=0; 189 request.length=0; 190 request.value_high=0; 191 request.value_low = config_descriptor.configuration_number; 192 opResult = usb_drv_sync_control_write(hc, target, &request, NULL, 0); 187 193 if (opResult != EOK) { 188 194 dprintf(1,"[usb_hub]something went wrong when setting hub`s configuration, %d", opResult); 189 195 } 190 196 191 usb_device_request_setup_packet_t request;192 197 for (port = 1; port < hub_info->port_count+1; ++port) { 193 198 usb_hub_set_power_port_request(&request, port); … … 224 229 225 230 231 226 232 //********************************************* 227 233 // … … 231 237 232 238 /** 233 * Convenience function for releasing default address and writing debug info234 * (these few lines are used too often to be written again and again) .239 * convenience function for releasing default address and writing debug info 240 * (these few lines are used too often to be written again and again) 235 241 * @param hc 236 242 * @return … … 247 253 248 254 /** 249 * Reset the port with new device and reserve the default address.255 * reset the port with new device and reserve the default address 250 256 * @param hc 251 257 * @param port … … 276 282 277 283 /** 278 * Finalize adding new device after port reset284 * finalize adding new device after port reset 279 285 * @param hc 280 286 * @param port … … 339 345 340 346 /** 341 * Unregister device address in hc347 * unregister device address in hc 342 348 * @param hc 343 349 * @param port … … 349 355 int opResult; 350 356 351 /** \TODO remove device from device manager - not yet implemented in 352 * devide manager 353 */ 357 /// \TODO remove device 354 358 355 359 hub->attached_devs[port].devman_handle=0; … … 372 376 373 377 /** 374 * Process interrupts on given hub port378 * process interrupts on given hub port 375 379 * @param hc 376 380 * @param port … … 430 434 usb_port_set_reset_completed(&status, false); 431 435 usb_port_set_dev_connected(&status, false); 432 if (status>>16) { 433 dprintf(1,"[usb_hub]there was some unsupported change on port %d: %X",port,status); 434 436 if (status) { 437 dprintf(1,"[usb_hub]there was some unsupported change on port %d",port); 435 438 } 436 439 /// \TODO handle other changes … … 439 442 } 440 443 441 /** 442 * Check changes on all known hubs. 444 /* Check changes on all known hubs. 443 445 */ 444 446 void usb_hub_check_hub_changes(void) {
Note:
See TracChangeset
for help on using the changeset viewer.