Changeset e1dbcbc in mainline for uspace/drv/vhc/hub/hub.c
- Timestamp:
- 2011-04-29T13:43:01Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a81a1d09
- Parents:
- 380e0364 (diff), f19f1b7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/hub/hub.c
r380e0364 re1dbcbc 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> … … 41 40 #include <stdlib.h> 42 41 #include <ddf/driver.h> 42 #include <usb/debug.h> 43 43 44 44 #include "hub.h" … … 96 96 * @param index Port index (one based). 97 97 */ 98 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) 99 99 { 100 100 port->connected_device = NULL; … … 102 102 port->state = HUB_PORT_STATE_NOT_CONFIGURED; 103 103 port->status_change = 0; 104 port->hub = hub; 104 105 } 105 106 … … 112 113 size_t i; 113 114 for (i = 0; i < HUB_PORT_COUNT; i++) { 114 hub_init_port(&hub->ports[i], i + 1);115 hub_init_port(&hub->ports[i], hub, i + 1); 115 116 } 116 117 hub->custom_data = NULL; 118 hub->signal_changes = true; 117 119 fibril_mutex_initialize(&hub->guard); 118 120 } … … 229 231 } 230 232 233 usb_log_debug("Setting port %zu to state %d.\n", port_index, state); 234 231 235 switch (state) { 232 236 case HUB_PORT_STATE_POWERED_OFF: … … 236 240 break; 237 241 case HUB_PORT_STATE_RESUMING: 242 port->state = state; 238 243 set_port_state_delayed(hub, port_index, 239 244 10, state, HUB_PORT_STATE_ENABLED); 240 245 break; 241 246 case HUB_PORT_STATE_RESETTING: 247 port->state = state; 242 248 set_port_state_delayed(hub, port_index, 243 249 10, state, HUB_PORT_STATE_ENABLED); … … 415 421 { 416 422 assert(port != NULL); 423 uint16_t old_value = port->status_change; 417 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; 418 429 } 419 430 … … 428 439 assert(port != NULL); 429 440 port->status_change &= (~change); 441 port->hub->signal_changes = true; 430 442 } 431 443
Note:
See TracChangeset
for help on using the changeset viewer.