|
4 | 4 | * xHCI Specification Section 5.3, Revision 1.2. |
5 | 5 | */ |
6 | 6 |
|
| 7 | +#include <linux/bits.h> |
| 8 | + |
7 | 9 | /* hc_capbase - bitmasks */ |
8 | 10 | /* bits 7:0 - Capability Registers Length */ |
9 | 11 | #define HC_LENGTH(p) ((p) & 0xff) |
|
32 | 34 | * xHCI specification section 5.3.4. |
33 | 35 | */ |
34 | 36 | #define HCS_IST_VALUE(p) ((p) & 0x7) |
35 | | -#define HCS_IST_UNIT(p) ((p) & (1 << 3)) |
| 37 | +#define HCS_IST_UNIT BIT(3) |
36 | 38 | /* bits 7:4 - Event Ring Segment Table Max, 2^(n) */ |
37 | 39 | #define HCS_ERST_MAX(p) (((p) >> 4) & 0xf) |
38 | 40 | /* bits 20:8 - Rsvd */ |
|
52 | 54 |
|
53 | 55 | /* HCCPARAMS1 - hcc_params - bitmasks */ |
54 | 56 | /* bit 0 - 64-bit Addressing Capability */ |
55 | | -#define HCC_64BIT_ADDR(p) ((p) & (1 << 0)) |
| 57 | +#define HCC_64BIT_ADDR BIT(0) |
56 | 58 | /* bit 1 - BW Negotiation Capability */ |
57 | | -#define HCC_BANDWIDTH_NEG(p) ((p) & (1 << 1)) |
| 59 | +#define HCC_BANDWIDTH_NEG BIT(1) |
58 | 60 | /* bit 2 - Context Size */ |
59 | | -#define HCC_64BYTE_CONTEXT(p) ((p) & (1 << 2)) |
60 | | -#define CTX_SIZE(_hcc) (HCC_64BYTE_CONTEXT(_hcc) ? 64 : 32) |
| 61 | +#define HCC_64BYTE_CONTEXT BIT(2) |
| 62 | +#define CTX_SIZE(_hcc) (_hcc & HCC_64BYTE_CONTEXT ? 64 : 32) |
61 | 63 | /* bit 3 - Port Power Control */ |
62 | | -#define HCC_PPC(p) ((p) & (1 << 3)) |
| 64 | +#define HCC_PPC BIT(3) |
63 | 65 | /* bit 4 - Port Indicators */ |
64 | | -#define HCS_INDICATOR(p) ((p) & (1 << 4)) |
| 66 | +#define HCS_INDICATOR BIT(4) |
65 | 67 | /* bit 5 - Light HC Reset Capability */ |
66 | | -#define HCC_LIGHT_RESET(p) ((p) & (1 << 5)) |
| 68 | +#define HCC_LIGHT_RESET BIT(5) |
67 | 69 | /* bit 6 - Latency Tolerance Messaging Capability */ |
68 | | -#define HCC_LTC(p) ((p) & (1 << 6)) |
| 70 | +#define HCC_LTC BIT(6) |
69 | 71 | /* bit 7 - No Secondary Stream ID Support */ |
70 | | -#define HCC_NSS(p) ((p) & (1 << 7)) |
| 72 | +#define HCC_NSS BIT(7) |
71 | 73 | /* bit 8 - Parse All Event Data */ |
72 | 74 | /* bit 9 - Short Packet Capability */ |
73 | | -#define HCC_SPC(p) ((p) & (1 << 9)) |
| 75 | +#define HCC_SPC BIT(9) |
74 | 76 | /* bit 10 - Stopped EDTLA Capability */ |
75 | 77 | /* bit 11 - Contiguous Frame ID Capability */ |
76 | | -#define HCC_CFC(p) ((p) & (1 << 11)) |
| 78 | +#define HCC_CFC BIT(11) |
77 | 79 | /* bits 15:12 - Max size for Primary Stream Arrays, 2^(n+1) */ |
78 | 80 | #define HCC_MAX_PSA(p) (1 << ((((p) >> 12) & 0xf) + 1)) |
79 | 81 | /* bits 31:16 - xHCI Extended Capabilities Pointer, from PCI base: 2^(n) */ |
|
91 | 93 |
|
92 | 94 | /* HCCPARAMS2 - hcc_params2 - bitmasks */ |
93 | 95 | /* bit 0 - U3 Entry Capability */ |
94 | | -#define HCC2_U3C(p) ((p) & (1 << 0)) |
| 96 | +#define HCC2_U3C BIT(0) |
95 | 97 | /* bit 1 - Configure Endpoint Command Max Exit Latency Too Large Capability */ |
96 | | -#define HCC2_CMC(p) ((p) & (1 << 1)) |
| 98 | +#define HCC2_CMC BIT(1) |
97 | 99 | /* bit 2 - Force Save Context Capabilitu */ |
98 | | -#define HCC2_FSC(p) ((p) & (1 << 2)) |
| 100 | +#define HCC2_FSC BIT(2) |
99 | 101 | /* bit 3 - Compliance Transition Capability, false: compliance is enabled by default */ |
100 | | -#define HCC2_CTC(p) ((p) & (1 << 3)) |
| 102 | +#define HCC2_CTC BIT(3) |
101 | 103 | /* bit 4 - Large ESIT Payload Capability, true: HC support ESIT payload > 48k */ |
102 | | -#define HCC2_LEC(p) ((p) & (1 << 4)) |
| 104 | +#define HCC2_LEC BIT(4) |
103 | 105 | /* bit 5 - Configuration Information Capability */ |
104 | | -#define HCC2_CIC(p) ((p) & (1 << 5)) |
| 106 | +#define HCC2_CIC BIT(5) |
105 | 107 | /* bit 6 - Extended TBC Capability, true: Isoc burst count > 65535 */ |
106 | | -#define HCC2_ETC(p) ((p) & (1 << 6)) |
| 108 | +#define HCC2_ETC BIT(6) |
107 | 109 | /* bit 7 - Extended TBC TRB Status Capability */ |
108 | | -#define HCC2_ETC_TSC(p) ((p) & (1 << 7)) |
| 110 | +#define HCC2_ETC_TSC BIT(7) |
109 | 111 | /* bit 8 - Get/Set Extended Property Capability */ |
110 | | -#define HCC2_GSC(p) ((p) & (1 << 8)) |
| 112 | +#define HCC2_GSC BIT(8) |
111 | 113 | /* bit 9 - Virtualization Based Trusted I/O Capability */ |
112 | | -#define HCC2_VTC(p) ((p) & (1 << 9)) |
| 114 | +#define HCC2_VTC BIT(9) |
113 | 115 | /* bit 10 - Rsvd */ |
114 | 116 | /* bit 11 - HC support Double BW on a eUSB2 HS ISOC EP */ |
115 | | -#define HCC2_EUSB2_DIC(p) ((p) & (1 << 11)) |
| 117 | +#define HCC2_EUSB2_DIC BIT(11) |
116 | 118 | /* bits 31:12 - Rsvd */ |
0 commit comments