Changeset 013e4ca4 in mainline
- Timestamp:
- 2011-02-25T19:58:25Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2d33eb5
- Parents:
- 4d37c42
- Location:
- uspace/drv/uhci-rhd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-rhd/main.c
r4d37c42 r013e4ca4 116 116 int main(int argc, char *argv[]) 117 117 { 118 usb_log_enable(USB_LOG_LEVEL_ INFO, NAME);118 usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME); 119 119 return ddf_driver_main(&uhci_rh_driver); 120 120 } -
uspace/drv/uhci-rhd/port.c
r4d37c42 r013e4ca4 50 50 static int uhci_port_set_enabled(uhci_port_t *port, bool enabled); 51 51 static int uhci_port_check(void *port); 52 static int new_device_enable_port(int portno, void *arg); 52 53 53 54 int uhci_port_init( … … 92 93 assert(port_instance); 93 94 94 /* disable port, to avoid device confusion */95 uhci_port_set_enabled(port, false);96 97 95 while (1) { 98 96 /* read register value */ … … 109 107 110 108 if (port_status & STATUS_CONNECTED_CHANGED) { 109 usb_log_debug("Change detected on port %d.\n", port_instance->number); 111 110 int rc = usb_hc_connection_open( 112 111 &port_instance->hc_connection); … … 118 117 /* remove any old device */ 119 118 if (port_instance->attached_device) { 119 usb_log_debug("Removing device on port %d.\n", 120 port_instance->number); 120 121 uhci_port_remove_device(port_instance); 121 122 } 123 124 usb_log_debug("Change status erased on port %d.\n", 125 port_instance->number); 126 port_status_write(port_instance->address, STATUS_CONNECTED_CHANGED); 122 127 123 128 if (port_status & STATUS_CONNECTED) { 124 129 /* new device */ 125 130 uhci_port_new_device(port_instance); 126 } else {127 port_status_write(port_instance->address, STATUS_CONNECTED_CHANGED);128 131 } 129 132 … … 159 162 async_usleep(100000); 160 163 161 /* Enable the port. */162 uhci_port_set_enabled(port, true);163 164 164 165 /* The hub maintains the reset signal to that port for 10 ms … … 181 182 } 182 183 184 /* Enable the port. */ 185 uhci_port_set_enabled(port, true); 186 183 187 return EOK; 184 188 } -
uspace/drv/uhci-rhd/root_hub.h
r4d37c42 r013e4ca4 41 41 42 42 #define UHCI_ROOT_HUB_PORT_COUNT 2 43 #define UHCI_ROOT_HUB_PORT_REGISTERS_OFFSET 0x10 44 #define ROOT_HUB_WAIT_USEC 10000000 /* 10 seconds */ 43 #define ROOT_HUB_WAIT_USEC 5000000 /* 5 seconds */ 45 44 46 45 typedef struct root_hub {
Note:
See TracChangeset
for help on using the changeset viewer.