Changes in uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h [668a2e8:70d72dd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h
r668a2e8 r70d72dd 40 40 #include <usb/host/endpoint.h> 41 41 42 #include "../ohci_regs.h"43 42 #include "../utils/malloc32.h" 44 43 #include "transfer_descriptor.h" … … 117 116 { 118 117 assert(instance); 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); 118 return (instance->td_head & ED_TDHEAD_HALTED_FLAG) 119 || (instance->status & ED_STATUS_K_FLAG); 127 120 } 128 121 … … 135 128 { 136 129 assert(instance); 137 return ( OHCI_RD(instance->td_head)& ED_TDHEAD_PTR_MASK)138 != ( OHCI_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); 139 132 } 140 133 … … 148 141 assert(instance); 149 142 const uintptr_t pa = addr_to_phys(td); 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; 143 instance->td_tail = pa & ED_TDTAIL_PTR_MASK; 163 144 } 164 145 … … 174 155 const uint32_t pa = addr_to_phys(next); 175 156 assert((pa & ED_NEXT_PTR_MASK) << ED_NEXT_PTR_SHIFT == pa); 176 OHCI_WR(instance->next, pa); 177 } 178 179 static inline uint32_t ed_next(const ed_t *instance) 180 { 181 assert(instance); 182 return OHCI_RD(instance->next) & ED_NEXT_PTR_MASK; 157 instance->next = pa; 183 158 } 184 159 … … 191 166 { 192 167 assert(instance); 193 return ( OHCI_RD(instance->td_head)& ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0;168 return (instance->td_head & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0; 194 169 } 195 170 … … 203 178 assert(instance); 204 179 if (toggle) { 205 OHCI_SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);180 instance->td_head |= ED_TDHEAD_TOGGLE_CARRY; 206 181 } else { 207 182 /* Clear halted flag when reseting toggle TODO: Why? */ 208 OHCI_CLR(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);209 OHCI_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG);183 instance->td_head &= ~ED_TDHEAD_TOGGLE_CARRY; 184 instance->td_head &= ~ED_TDHEAD_HALTED_FLAG; 210 185 } 211 186 }
Note:
See TracChangeset
for help on using the changeset viewer.