Ignore:
Timestamp:
2011-04-09T00:22:30Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4c28d17
Parents:
e42dd32
Message:

Add forgotten TD implementation, add error parsing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/hw_struct/transfer_descriptor.h

    re42dd32 rf1be95c8  
    3535#define DRV_OHCI_HW_STRUCT_TRANSFER_DESCRIPTOR_H
    3636
     37#include <bool.h>
    3738#include <stdint.h>
    3839#include "utils/malloc32.h"
     
    7980        instance->next = addr_to_phys(next) & TD_NEXT_PTR_MASK;
    8081}
     82
     83inline static bool td_is_finished(td_t *instance)
     84{
     85        assert(instance);
     86        int cc = (instance->status >> TD_STATUS_CC_SHIFT) & TD_STATUS_CC_MASK;
     87        /* something went wrong, error code is set */
     88        if (cc != CC_NOACCESS1 && cc != CC_NOACCESS2 && cc != CC_NOERROR) {
     89                return true;
     90        }
     91        /* everything done */
     92        if (cc == CC_NOERROR && instance->cbp == 0) {
     93                return true;
     94        }
     95        return false;
     96}
     97
     98static inline int td_error(td_t *instance)
     99{
     100        assert(instance);
     101        int cc = (instance->status >> TD_STATUS_CC_SHIFT) & TD_STATUS_CC_MASK;
     102        return cc_to_rc(cc);
     103}
    81104#endif
    82105/**
Note: See TracChangeset for help on using the changeset viewer.