Changeset 1e70157 in mainline for uspace/drv/uhci-hcd/endpoint.c


Ignore:
Timestamp:
2011-04-06T19:52:17Z (15 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8dc762e0
Parents:
fb8927d
Message:

Header fixes, add qh to endpoint structure, add endpoint toggle reset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/endpoint.c

    rfb8927d r1e70157  
    3434 */
    3535
     36#include <errno.h>
     37
    3638#include "endpoint.h"
     39#include "utils/malloc32.h"
    3740
    38 void endpoint_init(endpoint_t *instance, usb_transfer_type_t transfer_type,
     41int endpoint_init(endpoint_t *instance, usb_transfer_type_t transfer_type,
    3942    usb_speed_t speed, size_t max_packet_size)
    4043{
     
    4548        instance->max_packet_size = max_packet_size;
    4649        instance->toggle = 0;
     50        instance->qh = malloc32(sizeof(qh_t));
     51        if (instance->qh == NULL)
     52                return ENOMEM;
     53        return EOK;
    4754}
    4855/*----------------------------------------------------------------------------*/
    49 void endpoint_destroy(void *instance)
     56void endpoint_destroy(void *ep)
    5057{
     58        endpoint_t *instance = ep;
    5159        assert(instance);
     60        list_remove(&instance->same_device_eps);
     61        free32(instance->qh);
    5262        free(instance);
     63}
     64/*----------------------------------------------------------------------------*/
     65void endpoint_toggle_reset(link_t *ep)
     66{
     67        endpoint_t *instance =
     68            list_get_instance(ep, endpoint_t, same_device_eps);
     69        assert(instance);
     70        instance->toggle = 0;
    5371}
    5472/**
Note: See TracChangeset for help on using the changeset viewer.