Changeset 15701921 in mainline
- Timestamp:
- 2011-01-07T15:47:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8f748215
- Parents:
- 8324b65
- Location:
- uspace/drv/uhci/root_hub
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci/root_hub/port.c
r8324b65 r15701921 37 37 38 38 /* debug print */ 39 uhci_print_info("Port(%d) status %# x:\n",39 uhci_print_info("Port(%d) status %#.4x:\n", 40 40 port_instance->number, port_status.raw_value); 41 41 print_port_status( &port_status ); … … 48 48 /* TODO */ 49 49 /* remove device here */ 50 uhci_print_error( 51 "Don't know how to remove device %#x.\n", 52 port_instance->attached_device); 53 uhci_port_set_enabled(port_instance, false); 50 54 } 51 55 } … … 78 82 if (address <= 0) { /* address assigning went wrong */ 79 83 uhci_port_set_enabled(port, false); 80 uhci_print_error("Failed to assign address to the device ");84 uhci_print_error("Failed to assign address to the device.\n"); 81 85 return ENOMEM; 82 86 } 83 87 84 88 /* report to devman */ 85 devman_handle_t child = 0; 86 report_new_device(port->hc, address, port->number, &child); 89 assert( port->attached_device == 0 ); 90 report_new_device(port->hc, address, port->number, 91 &port->attached_device); 87 92 88 93 /* bind address */ 89 94 usb_address_keeping_devman_bind(&uhci_instance->address_manager, 90 address, child);95 address, port->attached_device); 91 96 92 97 return EOK; … … 102 107 103 108 /* enable port: register write */ 104 port_status.status.enabled_change = 0; 105 port_status.status.enabled = (bool)enabled; 109 port_status.status.enabled = enabled; 106 110 pio_write_16( port->address, port_status.raw_value ); 107 111 108 uhci_print_info( "Enabled port %d.\n", port->number ); 112 uhci_print_info( "%s port %d.\n", 113 enabled ? "Enabled" : "Disabled", port->number ); 109 114 return EOK; 110 115 } … … 216 221 uhci_setup( 217 222 hc, new_device, USB_TRANSFER_CONTROL, &data, sizeof(data), 218 sync_out_callback, (void*)&value 223 sync_out_callback, (void*)&value); 219 224 uhci_print_verbose("address assignment sent, waiting to complete.\n"); 220 225 221 226 sync_wait_for(&value); 222 223 uhci_print_info( "Assigned address %#x.\n", usb_address ); 224 227 if (value.result != USB_OUTCOME_OK) { 228 uhci_print_error( 229 "Failed to assign address to the connected device.\n"); 230 usb_address_keeping_release(&uhci_instance->address_manager, 231 usb_address); 232 return -1; 233 } 234 235 uhci_print_info("Assigned address %#x.\n", usb_address); 225 236 return usb_address; 226 237 } -
uspace/drv/uhci/root_hub/port.h
r8324b65 r15701921 47 47 unsigned number; 48 48 unsigned wait_period_usec; 49 devman_handle_t attached_device; 49 50 } uhci_port_t; 50 51 … … 58 59 port->number = number; 59 60 port->wait_period_usec = usec; 61 port->attached_device = 0; 60 62 } 61 63
Note:
See TracChangeset
for help on using the changeset viewer.