Changeset d083126 in mainline for uspace/drv/bus/usb/usbmast/main.c


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/drv/bus/usb/usbmast/main.c

    rcff3fb6 rd083126  
    8787 * @return Error code.
    8888 */
    89 static int usbmast_add_device(usb_device_t *dev)
     89static int usbmast_device_add(usb_device_t *dev)
    9090{
    9191        int rc;
     
    9494
    9595        /* Allocate softstate */
    96         mdev = ddf_dev_data_alloc(dev->ddf_dev, sizeof(usbmast_dev_t));
     96        dev->driver_data = mdev = malloc(sizeof(usbmast_dev_t));
    9797        if (mdev == NULL) {
    9898                usb_log_error("Failed allocating softstate.\n");
     
    103103        mdev->usb_dev = dev;
    104104
    105         usb_log_info("Initializing mass storage `%s'.\n",
    106             dev->ddf_dev->name);
     105        usb_log_info("Initializing mass storage `%s'.\n", dev->ddf_dev->name);
    107106        usb_log_debug(" Bulk in endpoint: %d [%zuB].\n",
    108107            dev->pipes[BULK_IN_EP].pipe->endpoint_no,
     
    295294/** USB mass storage driver ops. */
    296295static usb_driver_ops_t usbmast_driver_ops = {
    297         .add_device = usbmast_add_device,
     296        .device_add = usbmast_device_add,
    298297};
    299298
Note: See TracChangeset for help on using the changeset viewer.