Changeset 8627377 in mainline


Ignore:
Timestamp:
2011-03-21T12:23:31Z (13 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

Location:
uspace/drv/ohci
Files:
4 edited

Legend:

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

    ra6d1bc1 r8627377  
    6767{
    6868        assert(instance);
    69         return rh_register(&instance->rh, dev);
     69        return EOK;
    7070}
    7171/*----------------------------------------------------------------------------*/
  • 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.
  • uspace/drv/ohci/root_hub.c

    ra6d1bc1 r8627377  
    6767        /* TODO: implement */
    6868}
    69 /*----------------------------------------------------------------------------*/
    70 int rh_register(rh_t *instance, ddf_dev_t *dev)
    71 {
    72         return EOK;
    73 }
    7469/**
    7570 * @}
  • uspace/drv/ohci/root_hub.h

    ra6d1bc1 r8627377  
    5252
    5353void rh_interrupt(rh_t *instance);
    54 
    55 int rh_register(rh_t *instance, ddf_dev_t *dev);
    5654#endif
    5755/**
Note: See TracChangeset for help on using the changeset viewer.