Changeset 6967c14 in mainline for uspace/drv/vhc/devices.c


Ignore:
Timestamp:
2011-01-25T17:44:06Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
875e7227
Parents:
afc4fbb
Message:

VHC registers device unplugging

The virtual host controller is now able to register that a virtual USB device
was unplugged (i.e. that the task representing the device closed the
connection).

However, the change is not yet propagated to the root hub of the host
controller.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/vhc/devices.c

    rafc4fbb r6967c14  
    5959 *
    6060 * @param phone Callback phone.
     61 * @param id Device id.
    6162 * @return New device.
    6263 * @retval NULL Out of memory.
    6364 */
    64 virtdev_connection_t *virtdev_add_device(int phone)
     65virtdev_connection_t *virtdev_add_device(int phone, sysarg_t id)
    6566{
    6667        virtdev_connection_t *dev = (virtdev_connection_t *)
     
    7172
    7273        dev->phone = phone;
     74        dev->id = id;
    7375        list_append(&dev->link, &devices);
    7476       
     
    7678       
    7779        return dev;
     80}
     81
     82/** Find virtual device by id.
     83 *
     84 * @param id Device id.
     85 * @return Device with given id.
     86 * @retval NULL No such device.
     87 */
     88virtdev_connection_t *virtdev_find(sysarg_t id)
     89{
     90        link_t *pos;
     91        list_foreach(pos, &devices) {
     92                virtdev_connection_t *dev
     93                    = list_get_instance(pos, virtdev_connection_t, link);
     94                if (dev->id == id) {
     95                        return dev;
     96                }
     97        }
     98
     99        return NULL;
    78100}
    79101
Note: See TracChangeset for help on using the changeset viewer.