Changeset 26e7d6d in mainline for uspace/drv/bus/usb/ohci/hc.h


Ignore:
Timestamp:
2011-09-19T16:31:00Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a347a11
Parents:
3842a955 (diff), 086290d (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 mainline changes

File:
1 moved

Legend:

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

    r3842a955 r26e7d6d  
    4141
    4242#include <usb/usb.h>
    43 #include <usb/host/device_keeper.h>
    44 #include <usb/host/usb_endpoint_manager.h>
    45 #include <usbhc_iface.h>
     43#include <usb/host/hcd.h>
    4644
    47 #include "batch.h"
     45#include "ohci_batch.h"
    4846#include "ohci_regs.h"
    4947#include "root_hub.h"
     
    5149#include "hw_struct/hcca.h"
    5250
    53 #define OHCI_NEEDED_IRQ_COMMANDS 5
    54 
    55 /** Main OHCI drier structure */
     51/** Main OHCI driver structure */
    5652typedef struct hc {
    57         /** USB bus driver, devices and addresses */
    58         usb_device_keeper_t manager;
    59         /** USB bus driver, endpoints */
    60         usb_endpoint_manager_t ep_manager;
     53        /** Generic USB hc driver */
     54        hcd_t generic;
    6155
    6256        /** Memory mapped I/O registers area */
     
    7670        fibril_mutex_t guard;
    7771
    78         /** Code to be executed in kernel interrupt handler */
    79         irq_code_t interrupt_code;
    80 
    81         /** Commands that form interrupt code */
    82         irq_cmd_t interrupt_commands[OHCI_NEEDED_IRQ_COMMANDS];
    83 
    8472        /** USB hub emulation structure */
    8573        rh_t rh;
    8674} hc_t;
    8775
     76size_t hc_irq_cmd_count(void);
     77int hc_get_irq_commands(
     78    irq_cmd_t cmds[], size_t cmd_size, uintptr_t regs, size_t reg_size);
    8879int hc_register_hub(hc_t *instance, ddf_fun_t *hub_fun);
    8980int hc_init(hc_t *instance, uintptr_t regs, size_t reg_size, bool interrupts);
    90 void hc_start_hw(hc_t *instance);
    9181
    9282/** Safely dispose host controller internal structures
     
    9484 * @param[in] instance Host controller structure to use.
    9585 */
    96 static inline void hc_fini(hc_t *instance)
    97         { /* TODO: implement*/ };
     86static inline void hc_fini(hc_t *instance) { /* TODO: implement*/ };
    9887
    99 int hc_add_endpoint(hc_t *instance, usb_address_t address, usb_endpoint_t ep,
    100     usb_speed_t speed, usb_transfer_type_t type, usb_direction_t direction,
    101     size_t max_packet_size, size_t size, unsigned interval);
    102 int hc_remove_endpoint(hc_t *instance, usb_address_t address,
    103     usb_endpoint_t endpoint, usb_direction_t direction);
    104 endpoint_t * hc_get_endpoint(hc_t *instance, usb_address_t address,
    105     usb_endpoint_t endpoint, usb_direction_t direction, size_t *bw);
     88void hc_enqueue_endpoint(hc_t *instance, endpoint_t *ep);
     89void hc_dequeue_endpoint(hc_t *instance, endpoint_t *ep);
    10690
    107 int hc_schedule(hc_t *instance, usb_transfer_batch_t *batch);
    10891void hc_interrupt(hc_t *instance, uint32_t status);
    109 
    110 /** Get and cast pointer to the driver data
    111  *
    112  * @param[in] fun DDF function pointer
    113  * @return cast pointer to driver_data
    114  */
    115 static inline hc_t * fun_to_hc(ddf_fun_t *fun)
    116         { return fun->driver_data; }
    11792#endif
    11893/**
Note: See TracChangeset for help on using the changeset viewer.