Changeset 65eac7b in mainline for uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h
- Timestamp:
- 2012-02-24T03:08:24Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 668a2e8
- Parents:
- 4e30369
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h
r4e30369 r65eac7b 40 40 #include <usb/host/endpoint.h> 41 41 42 #include "../ohci_regs.h" 42 43 #include "../utils/malloc32.h" 43 44 #include "transfer_descriptor.h" … … 116 117 { 117 118 assert(instance); 118 return (instance->td_head & ED_TDHEAD_HALTED_FLAG) 119 || (instance->status & ED_STATUS_K_FLAG); 119 return (OHCI_RD(instance->td_head) & ED_TDHEAD_HALTED_FLAG) 120 || (OHCI_RD(instance->status) & ED_STATUS_K_FLAG); 121 } 122 123 static inline void ed_clear_halt(ed_t *instance) 124 { 125 assert(instance); 126 OHCI_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG); 120 127 } 121 128 … … 128 135 { 129 136 assert(instance); 130 return ( instance->td_head& ED_TDHEAD_PTR_MASK)131 != ( instance->td_tail& ED_TDTAIL_PTR_MASK);137 return (OHCI_RD(instance->td_head) & ED_TDHEAD_PTR_MASK) 138 != (OHCI_RD(instance->td_tail) & ED_TDTAIL_PTR_MASK); 132 139 } 133 140 … … 141 148 assert(instance); 142 149 const uintptr_t pa = addr_to_phys(td); 143 instance->td_tail = pa & ED_TDTAIL_PTR_MASK; 150 OHCI_WR(instance->td_tail, pa & ED_TDTAIL_PTR_MASK); 151 } 152 153 static inline uint32_t ed_tail_td(const ed_t *instance) 154 { 155 assert(instance); 156 return OHCI_RD(instance->td_tail) & ED_TDTAIL_PTR_MASK; 157 } 158 159 static inline uint32_t ed_head_td(const ed_t *instance) 160 { 161 assert(instance); 162 return OHCI_RD(instance->td_head) & ED_TDHEAD_PTR_MASK; 144 163 } 145 164 … … 155 174 const uint32_t pa = addr_to_phys(next); 156 175 assert((pa & ED_NEXT_PTR_MASK) << ED_NEXT_PTR_SHIFT == pa); 157 instance->next = pa;176 OHCI_WR(instance->next, pa); 158 177 } 159 178 … … 166 185 { 167 186 assert(instance); 168 return ( instance->td_head& ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0;187 return (OHCI_RD(instance->td_head) & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0; 169 188 } 170 189 … … 178 197 assert(instance); 179 198 if (toggle) { 180 instance->td_head |= ED_TDHEAD_TOGGLE_CARRY;199 OHCI_SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY); 181 200 } else { 182 201 /* Clear halted flag when reseting toggle TODO: Why? */ 183 instance->td_head &= ~ED_TDHEAD_TOGGLE_CARRY;184 instance->td_head &= ~ED_TDHEAD_HALTED_FLAG;202 OHCI_CLR(instance->td_head, ED_TDHEAD_TOGGLE_CARRY); 203 OHCI_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG); 185 204 } 186 205 }
Note:
See TracChangeset
for help on using the changeset viewer.