Changeset e6b9182 in mainline for uspace/drv/bus/usb/ohci/ohci_bus.h


Ignore:
Timestamp:
2017-10-13T08:49:29Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
741bcdeb
Parents:
0a5833d7
Message:

WIP usbhost refactoring: ohci completed

Along with that we noticed hcd_t in bus_t is superfluous and it complicates initialization (and breaks isolation), so we removed it. Also, type of the toggle has changed to bool in the functions.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/ohci_bus.h

    r0a5833d7 re6b9182  
    11/*
    22 * Copyright (c) 2011 Jan Vesely
     3 * Copyright (c) 2017 Ondrej Hlavaty <aearsis@eideo.cz>
    34 * All rights reserved.
    45 *
     
    3233 * @brief OHCI driver
    3334 */
    34 #ifndef DRV_OHCI_HCD_ENDPOINT_H
    35 #define DRV_OHCI_HCD_ENDPOINT_H
     35#ifndef DRV_OHCI_HCD_BUS_H
     36#define DRV_OHCI_HCD_BUS_H
    3637
    3738#include <assert.h>
    3839#include <adt/list.h>
    39 #include <usb/host/endpoint.h>
    40 #include <usb/host/hcd.h>
     40#include <usb/host/usb2_bus.h>
    4141
    4242#include "hw_struct/endpoint_descriptor.h"
     
    4545/** Connector structure linking ED to to prepared TD. */
    4646typedef struct ohci_endpoint {
     47        endpoint_t base;
     48
    4749        /** OHCI endpoint descriptor */
    4850        ed_t *ed;
     
    5355} ohci_endpoint_t;
    5456
    55 int ohci_endpoint_init(hcd_t *hcd, endpoint_t *ep);
    56 void ohci_endpoint_fini(hcd_t *hcd, endpoint_t *ep);
     57typedef struct hc hc_t;
     58
     59typedef struct {
     60        usb2_bus_t base;
     61        hc_t *hc;
     62
     63        /* Stored original ops from base, they are called in our handlers */
     64        bus_ops_t parent_ops;
     65} ohci_bus_t;
     66
     67int ohci_bus_init(ohci_bus_t *, hc_t *);
    5768
    5869/** Get and convert assigned ohci_endpoint_t structure
     
    6374{
    6475        assert(ep);
    65         return ep->hc_data.data;
     76        return (ohci_endpoint_t *) ep;
    6677}
    6778
Note: See TracChangeset for help on using the changeset viewer.