Changeset 45f4f19 in mainline for uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h
- Timestamp:
- 2012-03-05T20:33:48Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b90e90
- Parents:
- d1ca752
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h
rd1ca752 r45f4f19 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" 45 44 46 45 #include "completion_codes.h" 46 #include "mem_access.h" 47 47 48 48 /** … … 117 117 { 118 118 assert(instance); 119 return (OHCI_ RD(instance->td_head) & ED_TDHEAD_HALTED_FLAG)120 || (OHCI_ RD(instance->status) & ED_STATUS_K_FLAG);119 return (OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_HALTED_FLAG) 120 || (OHCI_MEM32_RD(instance->status) & ED_STATUS_K_FLAG); 121 121 } 122 122 … … 124 124 { 125 125 assert(instance); 126 OHCI_ CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG);126 OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG); 127 127 } 128 128 … … 135 135 { 136 136 assert(instance); 137 return (OHCI_ RD(instance->td_head) & ED_TDHEAD_PTR_MASK)138 != (OHCI_ RD(instance->td_tail) & ED_TDTAIL_PTR_MASK);137 return (OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_PTR_MASK) 138 != (OHCI_MEM32_RD(instance->td_tail) & ED_TDTAIL_PTR_MASK); 139 139 } 140 140 … … 148 148 assert(instance); 149 149 const uintptr_t pa = addr_to_phys(td); 150 OHCI_ WR(instance->td_tail, pa & ED_TDTAIL_PTR_MASK);150 OHCI_MEM32_WR(instance->td_tail, pa & ED_TDTAIL_PTR_MASK); 151 151 } 152 152 … … 154 154 { 155 155 assert(instance); 156 return OHCI_ RD(instance->td_tail) & ED_TDTAIL_PTR_MASK;156 return OHCI_MEM32_RD(instance->td_tail) & ED_TDTAIL_PTR_MASK; 157 157 } 158 158 … … 160 160 { 161 161 assert(instance); 162 return OHCI_ RD(instance->td_head) & ED_TDHEAD_PTR_MASK;162 return OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_PTR_MASK; 163 163 } 164 164 … … 174 174 const uint32_t pa = addr_to_phys(next); 175 175 assert((pa & ED_NEXT_PTR_MASK) << ED_NEXT_PTR_SHIFT == pa); 176 OHCI_ WR(instance->next, pa);176 OHCI_MEM32_WR(instance->next, pa); 177 177 } 178 178 … … 180 180 { 181 181 assert(instance); 182 return OHCI_ RD(instance->next) & ED_NEXT_PTR_MASK;182 return OHCI_MEM32_RD(instance->next) & ED_NEXT_PTR_MASK; 183 183 } 184 184 … … 191 191 { 192 192 assert(instance); 193 return (OHCI_ RD(instance->td_head) & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0;193 return (OHCI_MEM32_RD(instance->td_head) & ED_TDHEAD_TOGGLE_CARRY) ? 1 : 0; 194 194 } 195 195 … … 203 203 assert(instance); 204 204 if (toggle) { 205 OHCI_ SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY);205 OHCI_MEM32_SET(instance->td_head, ED_TDHEAD_TOGGLE_CARRY); 206 206 } else { 207 207 /* 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);208 OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_TOGGLE_CARRY); 209 OHCI_MEM32_CLR(instance->td_head, ED_TDHEAD_HALTED_FLAG); 210 210 } 211 211 }
Note:
See TracChangeset
for help on using the changeset viewer.