Changes in uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h [0d4b110:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h
r0d4b110 r9d58539 36 36 37 37 #include <assert.h> 38 #include <stdbool.h> 39 #include <sys/types.h> 38 #include <stdint.h> 40 39 41 40 #include <usb/host/endpoint.h> … … 45 44 46 45 #include "completion_codes.h" 47 #include "mem_access.h"48 46 49 47 /** … … 118 116 { 119 117 assert(instance); 120 return (OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_HALTED_FLAG) 121 || (OHCI_MEM32_RD(instance->status) & ED_STATUS_K_FLAG); 122 } 123 124 static inline void ed_clear_halt(ed_t *instance) 125 { 126 assert(instance); 127 OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG); 118 return (instance->td_head & ED_TDHEAD_HALTED_FLAG) 119 || (instance->status & ED_STATUS_K_FLAG); 128 120 } 129 121 … … 136 128 { 137 129 assert(instance); 138 return ( OHCI_MEM32_RD(instance->td_head)& ED_TDHEAD_PTR_MASK)139 != ( OHCI_MEM32_RD(instance->td_tail)& ED_TDTAIL_PTR_MASK);130 return (instance->td_head & ED_TDHEAD_PTR_MASK) 131 != (instance->td_tail & ED_TDTAIL_PTR_MASK); 140 132 } 141 133 … … 149 141 assert(instance); 150 142 const uintptr_t pa = addr_to_phys(td); 151 OHCI_MEM32_WR(instance->td_tail, pa & ED_TDTAIL_PTR_MASK); 152 } 153 154 static inline uint32_t ed_tail_td(const ed_t *instance) 155 { 156 assert(instance); 157 return OHCI_MEM32_RD(instance->td_tail) & ED_TDTAIL_PTR_MASK; 158 } 159 160 static inline uint32_t ed_head_td(const ed_t *instance) 161 { 162 assert(instance); 163 return OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_PTR_MASK; 143 instance->td_tail = pa & ED_TDTAIL_PTR_MASK; 164 144 } 165 145 … … 175 155 const uint32_t pa = addr_to_phys(next); 176 156 assert((pa & ED_NEXT_PTR_MASK) << ED_NEXT_PTR_SHIFT == pa); 177 OHCI_MEM32_WR(instance->next, pa); 178 } 179 180 static inline uint32_t ed_next(const ed_t *instance) 181 { 182 assert(instance); 183 return OHCI_MEM32_RD(instance->next) & ED_NEXT_PTR_MASK; 157 instance->next = pa; 184 158 } 185 159 … … 192 166 { 193 167 assert(instance); 194 return ( OHCI_MEM32_RD(instance->td_head)& ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0;168 return (instance->td_head & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0; 195 169 } 196 170 … … 204 178 assert(instance); 205 179 if (toggle) { 206 OHCI_MEM32_SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);180 instance->td_head |= ED_TDHEAD_TOGGLE_CARRY; 207 181 } else { 208 182 /* Clear halted flag when reseting toggle TODO: Why? */ 209 OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);210 OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG);183 instance->td_head &= ~ED_TDHEAD_TOGGLE_CARRY; 184 instance->td_head &= ~ED_TDHEAD_HALTED_FLAG; 211 185 } 212 186 }
Note:
See TracChangeset
for help on using the changeset viewer.