Changeset 3f189c5 in mainline for uspace/drv/uhci-hcd/uhci_struct


Ignore:
Timestamp:
2011-02-07T14:06:57Z (15 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
fe10e72
Parents:
7e62b62
Message:

Lots of cleanup, removes unused code (replaced by trackers)

Location:
uspace/drv/uhci-hcd/uhci_struct
Files:
2 edited

Legend:

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

    r7e62b62 r3f189c5  
    3636
    3737#include "transfer_descriptor.h"
     38#include "utils/malloc32.h"
    3839
    3940void transfer_descriptor_init(transfer_descriptor_t *instance,
     
    5859
    5960        instance->buffer_ptr = 0;
    60 
    61         instance->next_va = NULL;
    62         instance->callback = NULL;
    6361
    6462        if (size) {
     
    118116        return EOK;
    119117}
    120 /*----------------------------------------------------------------------------*/
    121 void transfer_descriptor_fini(transfer_descriptor_t *instance)
    122 {
    123         assert(instance);
    124         callback_run(instance->callback,
    125                 convert_outcome(instance->status),
    126                 ((instance->status >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK
    127         );
    128 }
    129118/**
    130119 * @}
  • uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.h

    r7e62b62 r3f189c5  
    3838#include <usb/usb.h>
    3939
    40 #include "utils/malloc32.h"
    41 #include "callback.h"
    4240#include "link_pointer.h"
    4341
     
    8684        volatile uint32_t buffer_ptr;
    8785
    88         /* there is 16 bytes of data available here
    89          * those are used to store callback pointer
    90          * and next pointer. Thus, there is some free space
    91          * on 32bits systems.
     86        /* there is 16 bytes of data available here, according to UHCI
     87         * Design guide, according to linux kernel the hardware does not care
     88         * we don't use it anyway
    9289         */
    93         struct transfer_descriptor *next_va;
    94         callback_t *callback;
    9590} __attribute__((packed)) transfer_descriptor_t;
    9691
     
    10095        int pid, void *buffer);
    10196
    102 static inline transfer_descriptor_t * transfer_descriptor_get(
    103   int error_count, size_t size, bool isochronous, usb_target_t target,
    104   int pid, void *buffer)
    105 {
    106         transfer_descriptor_t * instance =
    107           malloc32(sizeof(transfer_descriptor_t));
    108 
    109         if (instance)
    110                 transfer_descriptor_init(
    111                   instance, error_count, size, isochronous, target, pid, buffer);
    112         return instance;
    113 }
    114 
    115 void transfer_descriptor_fini(transfer_descriptor_t *instance);
    116 
    117 static inline void transfer_descriptor_dispose(transfer_descriptor_t *instance)
    118 {
    119         assert(instance);
    120         transfer_descriptor_fini(instance);
    121         free32(instance);
    122 }
    12397
    12498int transfer_descriptor_status(transfer_descriptor_t *instance);
     
    130104        return instance->status & TD_STATUS_ERROR_ACTIVE;
    131105}
    132 
    133 static inline void transfer_descriptor_append(
    134   transfer_descriptor_t *instance, transfer_descriptor_t *item)
    135 {
    136         assert(instance);
    137         instance->next_va = item;
    138         instance->next = (uintptr_t)addr_to_phys(item) & LINK_POINTER_ADDRESS_MASK;
    139 }
    140106#endif
    141107/**
Note: See TracChangeset for help on using the changeset viewer.