Changes in uspace/drv/vhc/hub/hub.c [6cb58e6:0f21c0c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/hub/hub.c
r6cb58e6 r0f21c0c 34 34 */ 35 35 #include <usb/classes/classes.h> 36 #include <usbvirt/hub.h> 36 37 #include <usbvirt/device.h> 37 38 #include <errno.h> 38 39 #include <str_error.h> 39 #include <assert.h>40 40 #include <stdlib.h> 41 #include <ddf/driver.h> 42 #include <usb/debug.h> 41 #include <driver.h> 43 42 44 43 #include "hub.h" … … 96 95 * @param index Port index (one based). 97 96 */ 98 static void hub_init_port(hub_port_t *port, hub_t *hub,size_t index)97 static void hub_init_port(hub_port_t *port, size_t index) 99 98 { 100 99 port->connected_device = NULL; … … 102 101 port->state = HUB_PORT_STATE_NOT_CONFIGURED; 103 102 port->status_change = 0; 104 port->hub = hub;105 103 } 106 104 … … 113 111 size_t i; 114 112 for (i = 0; i < HUB_PORT_COUNT; i++) { 115 hub_init_port(&hub->ports[i], hub,i + 1);113 hub_init_port(&hub->ports[i], i + 1); 116 114 } 117 115 hub->custom_data = NULL; 118 hub->signal_changes = true;119 116 fibril_mutex_initialize(&hub->guard); 120 117 } … … 231 228 } 232 229 233 usb_log_debug("Setting port %zu to state %d.\n", port_index, state);234 235 230 switch (state) { 236 231 case HUB_PORT_STATE_POWERED_OFF: … … 240 235 break; 241 236 case HUB_PORT_STATE_RESUMING: 242 port->state = state;243 237 set_port_state_delayed(hub, port_index, 244 238 10, state, HUB_PORT_STATE_ENABLED); 245 239 break; 246 240 case HUB_PORT_STATE_RESETTING: 247 port->state = state;248 241 set_port_state_delayed(hub, port_index, 249 242 10, state, HUB_PORT_STATE_ENABLED); … … 421 414 { 422 415 assert(port != NULL); 423 uint16_t old_value = port->status_change;424 416 port->status_change |= change; 425 usb_log_debug("Changing status change on %zu: %04x => %04x\n",426 port->index,427 (unsigned int) old_value, (unsigned int) port->status_change);428 port->hub->signal_changes = true;429 417 } 430 418 … … 439 427 assert(port != NULL); 440 428 port->status_change &= (~change); 441 port->hub->signal_changes = true;442 429 } 443 430
Note:
See TracChangeset
for help on using the changeset viewer.