Ignore:
Timestamp:
2011-04-14T22:05:27Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d7f08b0d, e05d6c3
Parents:
0146d41 (diff), c9dc471 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

OHCI fixes

Add support for toggle reset on OHCI ED
Properly handle error conditions on OHCI ED

Fixes strange virtualbox behavior. Tested USB devices no longer hang usbinfo
Logitech keyboard supports HALT feature and makes use of new clea halt mechanism. MS mouse does not use HALT feature.

File:
1 edited

Legend:

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

    r0146d41 re583fd4  
    7373#define ED_TDHEAD_ZERO_SHIFT (2)
    7474#define ED_TDHEAD_TOGGLE_CARRY (0x2)
     75#define ED_TDHEAD_HALTED_FLAG (0x1)
    7576
    7677        volatile uint32_t next;
     
    106107        instance->next = pa;
    107108}
     109
     110static inline int ed_toggle_get(ed_t *instance)
     111{
     112        assert(instance);
     113        return (instance->td_head & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0;
     114}
     115
     116static inline void ed_toggle_set(ed_t *instance, int toggle)
     117{
     118        assert(instance);
     119        assert(toggle == 0 || toggle == 1);
     120        if (toggle == 1) {
     121                instance->td_head |= ED_TDHEAD_TOGGLE_CARRY;
     122        } else {
     123                /* clear halted flag when reseting toggle */
     124                instance->td_head &= ~ED_TDHEAD_TOGGLE_CARRY;
     125                instance->td_head &= ~ED_TDHEAD_HALTED_FLAG;
     126        }
     127}
    108128#endif
    109129/**
Note: See TracChangeset for help on using the changeset viewer.