Ignore:
File:
1 edited

Legend:

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

    r8d2e251 r9d58539  
    3333 */
    3434
    35 #include <usb/host/endpoint.h>
    36 
    3735#include <assert.h>
    3836#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, usb_address_t tt_address, unsigned tt_p)
     52    size_t max_packet_size, size_t bw)
    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;
    6765                instance->hc_data.data = NULL;
    6866                instance->hc_data.toggle_get = NULL;
     
    7472        return instance;
    7573}
    76 
     74/*----------------------------------------------------------------------------*/
    7775/** Properly dispose of endpoint_t structure.
    7876 * @param instance endpoint_t structure.
     
    8684        free(instance);
    8785}
    88 
     86/*----------------------------------------------------------------------------*/
    8987/** Set device specific data and hooks.
    9088 * @param instance endpoint_t structure.
     
    103101        fibril_mutex_unlock(&instance->guard);
    104102}
    105 
     103/*----------------------------------------------------------------------------*/
    106104/** Clear device specific data and hooks.
    107105 * @param instance endpoint_t structure.
     
    111109{
    112110        assert(instance);
    113         endpoint_set_hc_data(instance, NULL, NULL, NULL);
     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);
    114116}
    115 
     117/*----------------------------------------------------------------------------*/
    116118/** Mark the endpoint as active and block access for further fibrils.
    117119 * @param instance endpoint_t structure.
     
    126128        fibril_mutex_unlock(&instance->guard);
    127129}
    128 
     130/*----------------------------------------------------------------------------*/
    129131/** Mark the endpoint as inactive and allow access for further fibrils.
    130132 * @param instance endpoint_t structure.
     
    138140        fibril_condvar_signal(&instance->avail);
    139141}
    140 
     142/*----------------------------------------------------------------------------*/
    141143/** Get the value of toggle bit.
    142144 * @param instance endpoint_t structure.
     
    154156        return ret;
    155157}
    156 
     158/*----------------------------------------------------------------------------*/
    157159/** Set the value of toggle bit.
    158160 * @param instance endpoint_t structure.
Note: See TracChangeset for help on using the changeset viewer.