Changes in uspace/drv/usbhub/usbhub.c [8123695a:66a54cc] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
r8123695a r66a54cc 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_ disable_port_feature_request(&request, port,320 USB_HUB_FEATURE_ PORT_CONNECTION);319 usb_hub_set_enable_port_feature_request(&request, port, 320 USB_HUB_FEATURE_C_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 clear port connectionon port %d errno:%d\n",328 "could not set port change 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_size338 );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");345 331 } 346 }347 }348 /// \TODO this is just a debug code349 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 0360 opResult = usb_pipe_control_read(361 hub->control_pipe,362 &request, sizeof(usb_device_request_setup_packet_t),363 &status, 4, &rcvd_size364 );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/disconnected372 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));377 332 } 378 333 } … … 627 582 //something connected/disconnected 628 583 if (usb_port_connect_change(&status)) { 629 usb_log_debug("connection change on port\n");630 584 if (usb_port_dev_connected(&status)) { 631 585 usb_log_debug("some connection changed\n"); … … 638 592 if (usb_port_overcurrent_change(&status)) { 639 593 //check if it was not auto-resolved 640 usb_log_debug("overcurrent change on port\n");641 594 if(usb_port_over_current(&status)){ 642 595 usb_hub_over_current(hub,port); … … 655 608 } 656 609 } 657 usb_log_debug("status %x\n ",status);658 610 659 611 usb_port_set_connect_change(&status, false);
Note:
See TracChangeset
for help on using the changeset viewer.