Changeset 8627377 in mainline for uspace/drv/ohci/main.c


Ignore:
Timestamp:
2011-03-21T12:23:31Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ff582d47
Parents:
a6d1bc1
Message:

Add usb iface implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/main.c

    ra6d1bc1 r8627377  
    4848
    4949static int ohci_add_device(ddf_dev_t *device);
     50static int get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle)
     51{
     52        assert(handle);
     53  assert(fun != NULL);
     54
     55  *handle = fun->handle;
     56  return EOK;
     57}
     58/*----------------------------------------------------------------------------*/
     59static int get_address(
     60    ddf_fun_t *fun, devman_handle_t handle, usb_address_t *address)
     61{
     62        assert(fun);
     63        device_keeper_t *manager = &fun_to_hc(fun)->manager;
     64  usb_address_t addr = device_keeper_find(manager, handle);
     65  if (addr < 0) {
     66    return addr;
     67  }
     68
     69  if (address != NULL) {
     70    *address = addr;
     71  }
     72
     73  return EOK;
     74}
    5075/*----------------------------------------------------------------------------*/
    5176/** IRQ handling callback, identifies device
     
    7196        .driver_ops = &ohci_driver_ops
    7297};
     98/*----------------------------------------------------------------------------*/
     99static usb_iface_t hc_usb_iface = {
     100        .get_address = get_address,
     101        .get_hc_handle = get_hc_handle,
     102};
     103/*----------------------------------------------------------------------------*/
    73104static ddf_dev_ops_t hc_ops = {
     105        .interfaces[USB_DEV_IFACE] = &hc_usb_iface,
    74106        .interfaces[USBHC_DEV_IFACE] = &hc_iface,
    75107};
    76 
    77108/*----------------------------------------------------------------------------*/
    78109/** Initializes a new ddf driver instance of OHCI hcd.
Note: See TracChangeset for help on using the changeset viewer.