Changeset 266d0871 in mainline for uspace/lib/usbvirt/src/stdreq.c


Ignore:
Timestamp:
2010-12-15T13:25:20Z (15 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1840e0d
Parents:
d5e7668
Message:

usbvirt: add callback when device changes state

The virtual root hub uses this to suspend power source to all
ports when entering `configured' state.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbvirt/src/stdreq.c

    rd5e7668 r266d0871  
    157157       
    158158        if (configuration_value == 0) {
     159                if (DEVICE_HAS_OP(device, on_state_change)) {
     160                        device->ops->on_state_change(device, device->state,
     161                            USBVIRT_STATE_ADDRESS);
     162                }
    159163                device->state = USBVIRT_STATE_ADDRESS;
    160164        } else {
     
    163167                * user selected existing configuration.
    164168                */
     169                if (DEVICE_HAS_OP(device, on_state_change)) {
     170                        device->ops->on_state_change(device, device->state,
     171                            USBVIRT_STATE_CONFIGURED);
     172                }
    165173                device->state = USBVIRT_STATE_CONFIGURED;
    166174                if (device->descriptors) {
Note: See TracChangeset for help on using the changeset viewer.