Changeset dff940f8 in mainline for uspace/drv/usbhub/usbhub.c
- Timestamp:
- 2011-02-25T16:56:52Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8c877b2, b8622e2
- Parents:
- cc34f32f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/usbhub.c
rcc34f32f rdff940f8 150 150 151 151 //configuration descriptor 152 /// \TODO check other configurations 152 /// \TODO check other configurations? 153 153 usb_standard_configuration_descriptor_t config_descriptor; 154 154 opResult = usb_request_get_bare_configuration_descriptor( … … 194 194 } 195 195 196 /**197 * Initialize the interrupt in endpoint.198 * \TODO this code should be checked...199 */200 196 usb_endpoint_mapping_t endpoint_mapping[1] = { 201 197 { … … 225 221 return EOK; 226 222 227 228 // Initialize the interrupt(=status change) endpoint.229 /*usb_endpoint_pipe_initialize(230 &result->endpoints->status_change,231 &result->device_connection, );USB_TRANSFER_INTERRUPT232 USB_DIRECTION_IN*/233 234 223 } 235 224 … … 282 271 } 283 272 284 285 273 dprintf(USB_LOG_LEVEL_INFO, "setting port count to %d",descriptor->ports_count); 286 274 result->port_count = descriptor->ports_count; … … 581 569 //determine type of change 582 570 usb_endpoint_pipe_t *pipe = &hub->endpoints.control; 583 //int opResult = usb_endpoint_pipe_start_session(pipe);584 571 585 /*if(opResult != EOK){ 586 dprintf(USB_LOG_LEVEL_ERROR, "cannot open pipe %d", opResult); 587 }*/ 588 int opResult; 589 590 /* 591 usb_target_t target; 592 target.address=address; 593 target.endpoint=0; 594 */ 572 int opResult; 595 573 596 574 usb_port_status_t status; … … 655 633 } 656 634 /// \TODO handle other changes 657 /// \TODO debug log for various situations658 //usb_endpoint_pipe_end_session(pipe);659 660 661 635 } 662 636 … … 674 648 } 675 649 676 /*677 * Check status change pipe of this hub.678 */679 /*680 usb_target_t target;681 target.address = hub_info->address;682 target.endpoint = 1;/// \TODO get from endpoint descriptor683 dprintf(USB_LOG_LEVEL_INFO, "checking changes for hub at addr %d",684 target.address);685 */686 650 size_t port_count = hub_info->port_count; 687 688 /*689 * Connect to respective HC.690 *691 int hc = usb_drv_hc_connect_auto(hub_info->device, 0);692 if (hc < 0) {693 continue;694 }*/695 651 696 652 /// FIXME: count properly … … 699 655 size_t actual_size; 700 656 701 //usb_handle_t handle;702 657 /* 703 658 * Send the request. … … 708 663 ); 709 664 710 //usb_drv_async_wait_for(handle);711 712 665 if (opResult != EOK) { 713 666 free(change_bitmap); 714 667 dprintf(USB_LOG_LEVEL_WARNING, "something went wrong while getting status of hub"); 668 usb_endpoint_pipe_end_session(&hub_info->endpoints.status_change); 715 669 return; 716 670 } 717 671 unsigned int port; 718 672 opResult = usb_endpoint_pipe_start_session(&hub_info->endpoints.control); 719 usb_hc_connection_open(&hub_info->connection); 673 if(opResult!=EOK){ 674 dprintf(USB_LOG_LEVEL_ERROR, "could not start control pipe session %d", 675 opResult); 676 usb_endpoint_pipe_end_session(&hub_info->endpoints.status_change); 677 return; 678 } 679 opResult = usb_hc_connection_open(&hub_info->connection); 680 if(opResult!=EOK){ 681 dprintf(USB_LOG_LEVEL_ERROR, "could not start host controller session %d", 682 opResult); 683 usb_endpoint_pipe_end_session(&hub_info->endpoints.control); 684 usb_endpoint_pipe_end_session(&hub_info->endpoints.status_change); 685 return; 686 } 720 687 721 688 ///todo, opresult check, pre obe konekce … … 734 701 } 735 702 736 /**737 * Check changes on all known hubs.738 */739 /*740 void usb_hub_check_hub_changes(void) {741 // Iterate through all hubs.742 743 usb_general_list_t * lst_item;744 fibril_mutex_lock(&usb_hub_list_lock);745 for (lst_item = usb_hub_list.next;746 lst_item != &usb_hub_list;747 lst_item = lst_item->next) {748 fibril_mutex_unlock(&usb_hub_list_lock);749 usb_hub_info_t * hub_info = ((usb_hub_info_t*)lst_item->data);750 usb_hub_check_hub_changes(hub_info);751 fibril_mutex_lock(&usb_hub_list_lock);752 }753 fibril_mutex_unlock(&usb_hub_list_lock);754 }755 */756 757 758 703 759 704
Note:
See TracChangeset
for help on using the changeset viewer.