Changes in uspace/drv/usbhub/usbhub.c [df3ad97:8123695a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
rdf3ad97 r8123695a 74 74 75 75 while(errorCode == EOK){ 76 async_usleep(1000 * 1000 * 10 );/// \TODO proper number once 76 77 errorCode = usb_hub_check_hub_changes(hub_info); 77 async_usleep(1000 * 1000 );/// \TODO proper number once78 78 } 79 79 usb_log_error("something in ctrl loop went wrong, errno %d\n",errorCode); … … 317 317 //set the status change bit, so it will be noticed in driver loop 318 318 if(usb_port_dev_connected(&status)){ 319 usb_hub_set_ enable_port_feature_request(&request, port,320 USB_HUB_FEATURE_ C_PORT_CONNECTION);319 usb_hub_set_disable_port_feature_request(&request, port, 320 USB_HUB_FEATURE_PORT_CONNECTION); 321 321 opResult = usb_pipe_control_read( 322 322 hub->control_pipe, … … 326 326 if (opResult != EOK) { 327 327 usb_log_warning( 328 "could not set port changeon port %d errno:%d\n",328 "could not clear port connection on port %d errno:%d\n", 329 329 port, opResult); 330 330 } 331 usb_log_debug("cleared port connection\n"); 332 usb_hub_set_enable_port_feature_request(&request, port, 333 USB_HUB_FEATURE_PORT_ENABLE); 334 opResult = usb_pipe_control_read( 335 hub->control_pipe, 336 &request, sizeof(usb_device_request_setup_packet_t), 337 &status, 4, &rcvd_size 338 ); 339 if (opResult != EOK) { 340 usb_log_warning( 341 "could not set port enabled on port %d errno:%d\n", 342 port, opResult); 343 } 344 usb_log_debug("port set to enabled - should lead to connection change\n"); 331 345 } 346 } 347 } 348 /// \TODO this is just a debug code 349 for(port=1;port<=descriptor->ports_count;++port){ 350 bool is_non_removable = 351 ((non_removable_dev_bitmap[port/8]) >> (port%8)) %2; 352 if(is_non_removable){ 353 usb_log_debug("port %d is non-removable\n",port); 354 usb_port_status_t status; 355 size_t rcvd_size; 356 usb_device_request_setup_packet_t request; 357 //int opResult; 358 usb_hub_set_port_status_request(&request, port); 359 //endpoint 0 360 opResult = usb_pipe_control_read( 361 hub->control_pipe, 362 &request, sizeof(usb_device_request_setup_packet_t), 363 &status, 4, &rcvd_size 364 ); 365 if (opResult != EOK) { 366 usb_log_error("could not get port status %d\n",opResult); 367 } 368 if (rcvd_size != sizeof (usb_port_status_t)) { 369 usb_log_error("received status has incorrect size\n"); 370 } 371 //something connected/disconnected 372 if (usb_port_connect_change(&status)) { 373 usb_log_debug("some connection changed\n"); 374 } 375 usb_log_debug("status: %s\n",usb_debug_str_buffer( 376 (uint8_t *)&status,4,4)); 332 377 } 333 378 } … … 582 627 //something connected/disconnected 583 628 if (usb_port_connect_change(&status)) { 629 usb_log_debug("connection change on port\n"); 584 630 if (usb_port_dev_connected(&status)) { 585 631 usb_log_debug("some connection changed\n"); … … 592 638 if (usb_port_overcurrent_change(&status)) { 593 639 //check if it was not auto-resolved 640 usb_log_debug("overcurrent change on port\n"); 594 641 if(usb_port_over_current(&status)){ 595 642 usb_hub_over_current(hub,port); … … 608 655 } 609 656 } 657 usb_log_debug("status %x\n ",status); 610 658 611 659 usb_port_set_connect_change(&status, false);
Note:
See TracChangeset
for help on using the changeset viewer.