Changeset 71ed4849 in mainline for uspace/drv/usbhub/usbhub.c


Ignore:
Timestamp:
2010-12-28T14:00:36Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8f8a0cd6
Parents:
de2c901
Message:

Connecting to "parent" host controller

USB drivers can now connect to host controller drivers they physically
belong to (so far, everything connected to VHC).

Each USB device must implement the USB interface of libdrv to allow
this (it is absolutely neccesary for hubs).

USB drivers can use usb_drv_hc_connect() to connect to "their" host
controller.

Child devices created with usb_drv_register_child_in_devman()are set
to handle this connection automatically.

UHCI and VHC drivers were updated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhub/usbhub.c

    rde2c901 r71ed4849  
    3737#include <errno.h>
    3838
    39 #include <usbhc_iface.h>
     39#include <usb_iface.h>
    4040#include <usb/usbdrv.h>
    4141#include <usb/descriptor.h>
     
    4646#include "usbhub_private.h"
    4747#include "port_status.h"
     48
     49static usb_iface_t hub_usb_iface = {
     50        .get_hc_handle = usb_drv_find_hc
     51};
     52
     53static device_ops_t hub_device_ops = {
     54        .interfaces[USB_DEV_IFACE] = &hub_usb_iface
     55};
    4856
    4957//*********************************************
     
    135143         * connected devices.
    136144         */
     145        dev->ops = &hub_device_ops;
    137146
    138147        //create the hub structure
    139148        //get hc connection
    140         int hc = usb_drv_hc_connect(dev, 0);
     149        int hc = usb_drv_hc_connect_auto(dev, 0);
     150        if (hc < 0) {
     151                return hc;
     152        }
    141153
    142154        usb_hub_info_t * hub_info = usb_create_hub_info(dev, hc);
     
    464476                 * Connect to respective HC.
    465477                 */
    466                 int hc = usb_drv_hc_connect(hub_info->device, 0);
     478                int hc = usb_drv_hc_connect_auto(hub_info->device, 0);
    467479                if (hc < 0) {
    468480                        continue;
Note: See TracChangeset for help on using the changeset viewer.