Ignore:
Timestamp:
2011-08-25T14:21:57Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
961c29e8
Parents:
e20eaed
Message:

libushost: promote endpoint data dtor to destruction hook

ohci: use new usb c driver architecture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/ohci_endpoint.c

    re20eaed r620c710  
    3434#include "utils/malloc32.h"
    3535#include "ohci_endpoint.h"
     36#include "hc.h"
    3637
    3738/** Callback to set toggle on ED.
     
    6566 * @param[in] hcd_ep endpoint structure
    6667 */
    67 static void ohci_ep_destroy(void *ohci_ep)
     68static void ohci_endpoint_fini(endpoint_t *ep)
    6869{
    69         if (ohci_ep) {
    70                 ohci_endpoint_t *instance = ohci_ep;
     70        ohci_endpoint_t *instance = ep->hc_data.data;
     71        hc_dequeue_endpoint(instance->hcd->private_data, ep);
     72        if (instance) {
    7173                free32(instance->ed);
    7274                free32(instance->td);
     
    8082 * @return pointer to a new hcd endpoint structure, NULL on failure.
    8183 */
    82 int ohci_endpoint_assign(hcd_t *hcd, endpoint_t *ep)
     84int ohci_endpoint_init(hcd_t *hcd, endpoint_t *ep)
    8385{
    8486        assert(ep);
     
    103105        ed_set_td(ohci_ep->ed, ohci_ep->td);
    104106        endpoint_set_hc_data(
    105             ep, ohci_ep, ohci_ep_destroy, ohci_ep_toggle_get, ohci_ep_toggle_set);
    106 
     107            ep, ohci_ep, ohci_endpoint_fini, ohci_ep_toggle_get, ohci_ep_toggle_set);
     108        ohci_ep->hcd = hcd;
     109        hc_enqueue_endpoint(hcd->private_data, ep);
    107110        return EOK;
    108111}
Note: See TracChangeset for help on using the changeset viewer.