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