Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/endpoint.c

    r9d58539 r8d2e251  
    3333 */
    3434
     35#include <usb/host/endpoint.h>
     36
    3537#include <assert.h>
    3638#include <stdlib.h>
    37 #include <errno.h>
    38 #include <usb/host/endpoint.h>
    3939
    4040/** Allocate ad initialize endpoint_t structure.
     
    5050endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint,
    5151    usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed,
    52     size_t max_packet_size, size_t bw)
     52    size_t max_packet_size, size_t bw, usb_address_t tt_address, unsigned tt_p)
    5353{
    5454        endpoint_t *instance = malloc(sizeof(endpoint_t));
     
    6363                instance->toggle = 0;
    6464                instance->active = false;
     65                instance->tt.address = tt_address;
     66                instance->tt.port = tt_p;
    6567                instance->hc_data.data = NULL;
    6668                instance->hc_data.toggle_get = NULL;
     
    7274        return instance;
    7375}
    74 /*----------------------------------------------------------------------------*/
     76
    7577/** Properly dispose of endpoint_t structure.
    7678 * @param instance endpoint_t structure.
     
    8486        free(instance);
    8587}
    86 /*----------------------------------------------------------------------------*/
     88
    8789/** Set device specific data and hooks.
    8890 * @param instance endpoint_t structure.
     
    101103        fibril_mutex_unlock(&instance->guard);
    102104}
    103 /*----------------------------------------------------------------------------*/
     105
    104106/** Clear device specific data and hooks.
    105107 * @param instance endpoint_t structure.
     
    109111{
    110112        assert(instance);
    111         fibril_mutex_lock(&instance->guard);
    112         instance->hc_data.data = NULL;
    113         instance->hc_data.toggle_get = NULL;
    114         instance->hc_data.toggle_set = NULL;
    115         fibril_mutex_unlock(&instance->guard);
     113        endpoint_set_hc_data(instance, NULL, NULL, NULL);
    116114}
    117 /*----------------------------------------------------------------------------*/
     115
    118116/** Mark the endpoint as active and block access for further fibrils.
    119117 * @param instance endpoint_t structure.
     
    128126        fibril_mutex_unlock(&instance->guard);
    129127}
    130 /*----------------------------------------------------------------------------*/
     128
    131129/** Mark the endpoint as inactive and allow access for further fibrils.
    132130 * @param instance endpoint_t structure.
     
    140138        fibril_condvar_signal(&instance->avail);
    141139}
    142 /*----------------------------------------------------------------------------*/
     140
    143141/** Get the value of toggle bit.
    144142 * @param instance endpoint_t structure.
     
    156154        return ret;
    157155}
    158 /*----------------------------------------------------------------------------*/
     156
    159157/** Set the value of toggle bit.
    160158 * @param instance endpoint_t structure.
Note: See TracChangeset for help on using the changeset viewer.