Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 2759c52 in mainline


Ignore:
Timestamp:
2011-04-13T11:14:28Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
5a2c42b
Parents:
6bb0f43
Message:

Add OHCI endpoint structure to endpoint manager.

Location:
uspace/drv/ohci
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/Makefile

    r6bb0f43 r2759c52  
    3535        batch.c \
    3636        hc.c \
     37        hcd_endpoint.c \
    3738        iface.c \
    3839        main.c \
  • uspace/drv/ohci/hc.c

    r6bb0f43 r2759c52  
    4343
    4444#include "hc.h"
     45#include "hcd_endpoint.h"
    4546
    4647static int interrupt_emulator(hc_t *instance);
     
    149150        }
    150151
     152        hcd_endpoint_t *hcd_ep = hcd_endpoint_assign(ep);
     153        if (hcd_ep == NULL) {
     154                free(ep);
     155                return ENOMEM;
     156        }
     157        // TODO: enqueue hcd_ep here!
     158
    151159        ret = usb_endpoint_manager_register_ep(&instance->ep_manager, ep, size);
    152160        if (ret != EOK) {
     
    159167    usb_endpoint_t endpoint, usb_direction_t direction)
    160168{
     169        endpoint_t *ep = usb_endpoint_manager_get_ep(&instance->ep_manager,
     170            address, endpoint, direction, NULL);
     171        if (ep == NULL) {
     172                usb_log_error("Endpoint unregister failed.\n");
     173                return ENOENT;
     174        }
     175
     176        hcd_endpoint_t *hcd_ep = hcd_endpoint_get(ep);
     177        if (hcd_ep) {
     178                // TODO: dequeue hcd_ep here!
     179                hcd_endpoint_clear(ep);
     180        } else {
     181                usb_log_warning("Endpoint without hcd equivalent structure.\n");
     182        }
    161183        return usb_endpoint_manager_unregister_ep(&instance->ep_manager,
    162184            address, endpoint, direction);
Note: See TracChangeset for help on using the changeset viewer.