Changeset eaf5e86 in mainline for uspace/drv/bus/usb/xhci/hw_struct
- Timestamp:
- 2017-10-11T13:18:54Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63adb18
- Parents:
- ac18b08
- Location:
- uspace/drv/bus/usb/xhci/hw_struct
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hw_struct/common.h
rac18b08 reaf5e86 83 83 static inline void xhci_qword_set_bits(xhci_qword_t *storage, uint64_t value, unsigned hi, unsigned lo) 84 84 { 85 const uint64_t mask = host2xhci(64, BIT_RANGE(uint64_t, hi, lo));86 const uint64_t set = host2xhci(64, value << lo);87 *storage = (*storage & ~mask) | set;85 const uint64_t mask = host2xhci(64, BIT_RANGE(uint64_t, hi, lo)); 86 const uint64_t set = host2xhci(64, value << lo); 87 *storage = (*storage & ~mask) | set; 88 88 } 89 89 -
uspace/drv/bus/usb/xhci/hw_struct/context.h
rac18b08 reaf5e86 65 65 66 66 #define XHCI_EP_TYPE_SET(ctx, val) \ 67 xhci_dword_set_bits(&(ctx).data[1], val, 5, 3)67 xhci_dword_set_bits(&(ctx).data[1], val, 5, 3) 68 68 #define XHCI_EP_MAX_PACKET_SIZE_SET(ctx, val) \ 69 xhci_dword_set_bits(&(ctx).data[1], val, 31, 16)69 xhci_dword_set_bits(&(ctx).data[1], val, 31, 16) 70 70 #define XHCI_EP_MAX_BURST_SIZE_SET(ctx, val) \ 71 xhci_dword_set_bits(&(ctx).data[1], val, 15, 8)71 xhci_dword_set_bits(&(ctx).data[1], val, 15, 8) 72 72 #define XHCI_EP_TR_DPTR_SET(ctx, val) \ 73 xhci_qword_set_bits(&(ctx).data2, (val >> 4), 63, 4)73 xhci_qword_set_bits(&(ctx).data2, (val >> 4), 63, 4) 74 74 #define XHCI_EP_DCS_SET(ctx, val) \ 75 xhci_qword_set_bits(&(ctx).data2, val, 0, 0)75 xhci_qword_set_bits(&(ctx).data2, val, 0, 0) 76 76 #define XHCI_EP_INTERVAL_SET(ctx, val) \ 77 xhci_dword_set_bits(&(ctx).data[0], val, 23, 16)77 xhci_dword_set_bits(&(ctx).data[0], val, 23, 16) 78 78 #define XHCI_EP_MAX_P_STREAMS_SET(ctx, val) \ 79 xhci_dword_set_bits(&(ctx).data[0], val, 14, 10)79 xhci_dword_set_bits(&(ctx).data[0], val, 14, 10) 80 80 #define XHCI_EP_MULT_SET(ctx, val) \ 81 xhci_dword_set_bits(&(ctx).data[0], val, 9, 8)81 xhci_dword_set_bits(&(ctx).data[0], val, 9, 8) 82 82 #define XHCI_EP_ERROR_COUNT_SET(ctx, val) \ 83 xhci_dword_set_bits(&(ctx).data[1], val, 2, 1)83 xhci_dword_set_bits(&(ctx).data[1], val, 2, 1) 84 84 85 85 #define XHCI_EP_STATE(ctx) XHCI_DWORD_EXTRACT((ctx).data[0], 2, 0) … … 108 108 109 109 #define XHCI_SLOT_ROOT_HUB_PORT_SET(ctx, val) \ 110 xhci_dword_set_bits(&(ctx).data[1], val, 23, 16)110 xhci_dword_set_bits(&(ctx).data[1], val, 23, 16) 111 111 #define XHCI_SLOT_CTX_ENTRIES_SET(ctx, val) \ 112 xhci_dword_set_bits(&(ctx).data[0], val, 31, 27)112 xhci_dword_set_bits(&(ctx).data[0], val, 31, 27) 113 113 #define XHCI_SLOT_ROUTE_STRING_SET(ctx, val) \ 114 114 xhci_dword_set_bits(&(ctx).data[0], (val & 0xFFFFF), 19, 0) -
uspace/drv/bus/usb/xhci/hw_struct/regs.h
rac18b08 reaf5e86 499 499 */ 500 500 typedef struct xhci_psi { 501 xhci_dword_t psi;501 xhci_dword_t psi; 502 502 } xhci_psi_t; 503 503 … … 547 547 548 548 static const xhci_sp_name_t xhci_name_usb = { 549 .str = "USB "549 .str = "USB " 550 550 }; 551 551 -
uspace/drv/bus/usb/xhci/hw_struct/trb.h
rac18b08 reaf5e86 170 170 static inline void xhci_trb_copy(xhci_trb_t *dst, xhci_trb_t *src) 171 171 { 172 /*173 * As we do not know, whether our architecture is capable of copying 16174 * bytes atomically, let's copy the fields one by one.175 */176 dst->parameter = src->parameter;177 dst->status = src->status;178 dst->control = src->control;172 /* 173 * As we do not know, whether our architecture is capable of copying 16 174 * bytes atomically, let's copy the fields one by one. 175 */ 176 dst->parameter = src->parameter; 177 dst->status = src->status; 178 dst->control = src->control; 179 179 } 180 180
Note:
See TracChangeset
for help on using the changeset viewer.
