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


Ignore:
Timestamp:
2011-09-16T14:50:20Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
432a269, d1e18573
Parents:
47fecbb (diff), 82a31261 (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 USB changes from bzr://krabicka.net/orome/helenos/usb/

  • Move common HC code from uhci/ohci drivers to libusbhost
  • Rewrite USB HC interface to have common read/write functions for all transfer types.
  • Restructure hc drivers to avoid some hooks and void* casts
  • Cleanup the code and remove unnecessary mallocs.
File:
1 edited

Legend:

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

    r47fecbb rfd07e526  
    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"
     
    5351/** Main OHCI driver structure */
    5452typedef struct hc {
    55         /** USB bus driver, devices and addresses */
    56         usb_device_keeper_t manager;
    57         /** USB bus driver, endpoints */
    58         usb_endpoint_manager_t ep_manager;
     53        /** Generic USB hc driver */
     54        hcd_t generic;
    5955
    6056        /** Memory mapped I/O registers area */
     
    8177int hc_get_irq_commands(
    8278    irq_cmd_t cmds[], size_t cmd_size, uintptr_t regs, size_t reg_size);
     79int hc_register_hub(hc_t *instance, ddf_fun_t *hub_fun);
    8380int hc_init(hc_t *instance, uintptr_t regs, size_t reg_size, bool interrupts);
    84 int hc_register_hub(hc_t *instance, ddf_fun_t *hub_fun);
    8581
    8682/** Safely dispose host controller internal structures
     
    8884 * @param[in] instance Host controller structure to use.
    8985 */
    90 static inline void hc_fini(hc_t *instance)
    91         { /* TODO: implement*/ };
     86static inline void hc_fini(hc_t *instance) { /* TODO: implement*/ };
    9287
    93 int hc_add_endpoint(hc_t *instance, usb_address_t address, usb_endpoint_t ep,
    94     usb_speed_t speed, usb_transfer_type_t type, usb_direction_t direction,
    95     size_t max_packet_size, size_t size, unsigned interval);
    96 int hc_remove_endpoint(hc_t *instance, usb_address_t address,
    97     usb_endpoint_t endpoint, usb_direction_t direction);
    98 endpoint_t * hc_get_endpoint(hc_t *instance, usb_address_t address,
    99     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);
    10090
    101 int hc_schedule(hc_t *instance, usb_transfer_batch_t *batch);
    10291void hc_interrupt(hc_t *instance, uint32_t status);
    103 
    104 /** Get and cast pointer to the driver data
    105  *
    106  * @param[in] fun DDF function pointer
    107  * @return cast pointer to driver_data
    108  */
    109 static inline hc_t * fun_to_hc(ddf_fun_t *fun)
    110         { return fun->driver_data; }
    11192#endif
    11293/**
Note: See TracChangeset for help on using the changeset viewer.