Changeset 47e3a8e in mainline for uspace/lib/usbvirt/stdreq.c


Ignore:
Timestamp:
2010-10-15T16:32:57Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
186d630
Parents:
73301a0
Message:

Virtual USB device tracks its address

Now, each virtual device tracks its address and its state.

The virtual HC dispatches all transactions to all devices, thus
more precisely simulating situation on USB. The usbvirt framework
then decides whether it can accept the data or not, based on
their destination address.

File:
1 edited

Legend:

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

    r73301a0 r47e3a8e  
    118118       
    119119        /*
    120          * TODO: inform the HC that device has new address assigned.
     120         * TODO: handle when this request is invalid (e.g.
     121         * setting address when in configured state).
    121122         */
     123        if (new_address == 0) {
     124                device->state = USBVIRT_STATE_DEFAULT;
     125        } else {
     126                device->state = USBVIRT_STATE_ADDRESS;
     127        }
     128       
     129        device->address = new_address;
     130       
    122131        return EOK;
    123132}
Note: See TracChangeset for help on using the changeset viewer.