Changeset 1ae51ae in mainline
- Timestamp:
- 2011-02-27T02:39:13Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ad6857c
- Parents:
- 48563a3
- Location:
- uspace/drv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
r48563a3 r1ae51ae 149 149 assert(hc); 150 150 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 151 usb_log_debug("Control WRITE %d:%d %zu(%zu).\n", 152 target.address, target.endpoint, size, max_packet_size); 151 153 152 154 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, … … 169 171 usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address); 170 172 173 usb_log_debug("Control READ %d:%d %zu(%zu).\n", 174 target.address, target.endpoint, size, max_packet_size); 171 175 batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL, 172 176 max_packet_size, speed, data, size, setup_data, setup_size, callback, -
uspace/drv/uhci-hcd/uhci.c
r48563a3 r1ae51ae 48 48 { 49 49 .cmd = CMD_PIO_READ_16, 50 .addr = (void*)0xc022,50 .addr = NULL, /* patched for every instance */ 51 51 .dstarg = 1 52 52 }, 53 53 { 54 54 .cmd = CMD_PIO_WRITE_16, 55 .addr = (void*)0xc022,55 .addr = NULL, /* pathed for every instance */ 56 56 .value = 0x1f 57 57 }, … … 61 61 }; 62 62 63 64 63 static int usb_iface_get_address(ddf_fun_t *fun, devman_handle_t handle, 65 64 usb_address_t *address) … … 69 68 assert(hc); 70 69 71 // usb_address_t addr = usb_address_keeping_find(&hc->address_manager,72 // handle);73 70 usb_address_t addr = device_keeper_find(&hc->device_manager, 74 71 handle); -
uspace/drv/uhci-rhd/port.c
r48563a3 r1ae51ae 92 92 uhci_port_t *port_instance = port; 93 93 assert(port_instance); 94 // port_status_write(port_instance->address, 0); 94 port_status_write(port_instance->address, 0); 95 96 uint64_t count = 0; 95 97 96 98 while (1) { 99 async_usleep(port_instance->wait_period_usec); 100 97 101 /* read register value */ 98 102 port_status_t port_status = … … 102 106 static fibril_mutex_t dbg_mtx = FIBRIL_MUTEX_INITIALIZER(dbg_mtx); 103 107 fibril_mutex_lock(&dbg_mtx); 104 usb_log_debug("Port %d status at %p: 0x%04x. \n",105 port_instance->number, port_instance->address, port_status );108 usb_log_debug("Port %d status at %p: 0x%04x. === %llu\n", 109 port_instance->number, port_instance->address, port_status, count++); 106 110 // print_port_status(port_status); 107 111 fibril_mutex_unlock(&dbg_mtx); 108 112 109 if (port_status & STATUS_CONNECTED_CHANGED) { 110 usb_log_debug("Change detected on port %d.\n", port_instance->number); 113 if ((port_status & STATUS_CONNECTED_CHANGED) != 0) { 114 usb_log_debug("Change detected on port %d: %x.\n", 115 port_instance->number, port_status); 116 117 111 118 int rc = usb_hc_connection_open( 112 119 &port_instance->hc_connection); 113 120 if (rc != EOK) { 114 121 usb_log_error("Failed to connect to HC."); 115 goto next; 116 } 117 118 port_status_write(port_instance->address, port_status); 119 usb_log_debug("Change status ack on port %d.\n", 120 port_instance->number); 122 continue; 123 } 121 124 122 125 /* remove any old device */ … … 127 130 } 128 131 129 if ( port_status & STATUS_CONNECTED) {132 if ((port_status & STATUS_CONNECTED) != 0) { 130 133 /* new device */ 131 134 uhci_port_new_device(port_instance, port_status); 135 } else { 136 /* ack changes by writing one to WC bits */ 137 port_status_write(port_instance->address, port_status); 138 usb_log_debug("Change status ack on port %d.\n", 139 port_instance->number); 132 140 } 133 141 … … 136 144 if (rc != EOK) { 137 145 usb_log_error("Failed to disconnect from HC."); 138 goto next;139 146 } 140 147 } 141 next:142 async_usleep(port_instance->wait_period_usec);143 148 } 144 149 return EOK; … … 202 207 new_device_enable_port, port->number, port, 203 208 &dev_addr, &port->attached_device, NULL, NULL, NULL); 209 204 210 if (rc != EOK) { 205 211 usb_log_error("Failed adding new device on port %u: %s.\n",
Note:
See TracChangeset
for help on using the changeset viewer.