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