Ignore:
Timestamp:
2011-10-13T13:20:26Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a5506a
Parents:
cff3fb6 (diff), 22a2b763 (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.
Message:

Merge initial USB unplug support.

Support device_remove and device_gone in libusbdev.
usbhub and uhcirh try to unbind and destroy functions of attached devices.
add unplug support for usbhub driver (only works on empty hubs as there is no support in other drivers).

Drivers to go:

usbmid
usbflbk
usbhid
usbmast
usbmouse

Tested on:

qemu UHCI and emulated hub,
ICH8 hw and Alcor Micro Corp. USB Hub

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdev/include/usb/dev/driver.h

    rcff3fb6 rd083126  
    9696        usb_device_descriptors_t descriptors;
    9797
    98         /** Generic DDF device backing this one. */
     98        /** Generic DDF device backing this one. RO: DO NOT TOUCH!*/
    9999        ddf_dev_t *ddf_dev;
    100100        /** Custom driver data.
     
    112112/** USB driver ops. */
    113113typedef struct {
    114         /** Callback when new device is about to be controlled by the driver. */
    115         int (*add_device)(usb_device_t *);
     114        /** Callback when a new device was added to the system. */
     115        int (*device_add)(usb_device_t *);
     116        /** Callback when a device is about to be removed from the system. */
     117        int (*device_rem)(usb_device_t *);
     118        /** Callback when a device was removed from the system. */
     119        int (*device_gone)(usb_device_t *);
    116120} usb_driver_ops_t;
    117121
     
    163167
    164168int usb_device_retrieve_descriptors(usb_pipe_t *, usb_device_descriptors_t *);
    165 int usb_device_create_pipes(ddf_dev_t *, usb_device_connection_t *,
     169int usb_device_create_pipes(const ddf_dev_t *, usb_device_connection_t *,
    166170    usb_endpoint_description_t **, uint8_t *, size_t, int, int,
    167171    usb_endpoint_mapping_t **, size_t *);
    168 int usb_device_destroy_pipes(ddf_dev_t *, usb_endpoint_mapping_t *, size_t);
     172int usb_device_destroy_pipes(const ddf_dev_t *, usb_endpoint_mapping_t *, size_t);
    169173int usb_device_create(ddf_dev_t *, usb_endpoint_description_t **, usb_device_t **, const char **);
    170174void usb_device_destroy(usb_device_t *);
Note: See TracChangeset for help on using the changeset viewer.