1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. 4 * 5 * Contact Information: wlanfae <wlanfae@realtek.com> 6 */ 7 #ifndef __INC_QOS_TYPE_H 8 #define __INC_QOS_TYPE_H 9 10 #define BIT0 0x00000001 11 #define BIT1 0x00000002 12 #define BIT2 0x00000004 13 #define BIT3 0x00000008 14 #define BIT4 0x00000010 15 #define BIT5 0x00000020 16 #define BIT6 0x00000040 17 #define BIT7 0x00000080 18 #define BIT8 0x00000100 19 #define BIT9 0x00000200 20 #define BIT10 0x00000400 21 #define BIT11 0x00000800 22 #define BIT12 0x00001000 23 #define BIT13 0x00002000 24 #define BIT14 0x00004000 25 #define BIT15 0x00008000 26 #define BIT16 0x00010000 27 #define BIT17 0x00020000 28 #define BIT18 0x00040000 29 #define BIT19 0x00080000 30 #define BIT20 0x00100000 31 #define BIT21 0x00200000 32 #define BIT22 0x00400000 33 #define BIT23 0x00800000 34 #define BIT24 0x01000000 35 #define BIT25 0x02000000 36 #define BIT26 0x04000000 37 #define BIT27 0x08000000 38 #define BIT28 0x10000000 39 #define BIT29 0x20000000 40 #define BIT30 0x40000000 41 #define BIT31 0x80000000 42 43 union qos_tsinfo { 44 u8 charData[3]; 45 struct { 46 u8 ucTrafficType:1; 47 u8 ucTSID:4; 48 u8 ucDirection:2; 49 u8 ucAccessPolicy:2; 50 u8 ucAggregation:1; 51 u8 ucPSB:1; 52 u8 ucUP:3; 53 u8 ucTSInfoAckPolicy:2; 54 u8 ucSchedule:1; 55 u8 ucReserved:7; 56 } field; 57 }; 58 59 union tspec_body { 60 u8 charData[55]; 61 62 struct { 63 union qos_tsinfo TSInfo; 64 u16 NominalMSDUsize; 65 u16 MaxMSDUsize; 66 u32 MinServiceItv; 67 u32 MaxServiceItv; 68 u32 InactivityItv; 69 u32 SuspenItv; 70 u32 ServiceStartTime; 71 u32 MinDataRate; 72 u32 MeanDataRate; 73 u32 PeakDataRate; 74 u32 MaxBurstSize; 75 u32 DelayBound; 76 u32 MinPhyRate; 77 u16 SurplusBandwidthAllowance; 78 u16 MediumTime; 79 } f; 80 }; 81 82 struct octet_string { 83 u8 *Octet; 84 u16 Length; 85 }; 86 87 #define AC0_BE 0 88 #define AC1_BK 1 89 #define AC2_VI 2 90 #define AC3_VO 3 91 #define AC_MAX 4 92 93 enum direction_value { 94 DIR_UP = 0, 95 DIR_DOWN = 1, 96 DIR_DIRECT = 2, 97 DIR_BI_DIR = 3, 98 }; 99 100 struct acm { 101 u64 UsedTime; 102 u64 MediumTime; 103 u8 HwAcmCtl; 104 }; 105 106 union qos_tclas { 107 struct _TYPE_GENERAL { 108 u8 Priority; 109 u8 ClassifierType; 110 u8 Mask; 111 } TYPE_GENERAL; 112 113 struct _TYPE0_ETH { 114 u8 Priority; 115 u8 ClassifierType; 116 u8 Mask; 117 u8 SrcAddr[ETH_ALEN]; 118 u8 DstAddr[ETH_ALEN]; 119 u16 Type; 120 } TYPE0_ETH; 121 122 struct _TYPE1_IPV4 { 123 u8 Priority; 124 u8 ClassifierType; 125 u8 Mask; 126 u8 Version; 127 u8 SrcIP[4]; 128 u8 DstIP[4]; 129 u16 SrcPort; 130 u16 DstPort; 131 u8 DSCP; 132 u8 Protocol; 133 u8 Reserved; 134 } TYPE1_IPV4; 135 136 struct _TYPE1_IPV6 { 137 u8 Priority; 138 u8 ClassifierType; 139 u8 Mask; 140 u8 Version; 141 u8 SrcIP[16]; 142 u8 DstIP[16]; 143 u16 SrcPort; 144 u16 DstPort; 145 u8 FlowLabel[3]; 146 } TYPE1_IPV6; 147 148 struct _TYPE2_8021Q { 149 u8 Priority; 150 u8 ClassifierType; 151 u8 Mask; 152 u16 TagType; 153 } TYPE2_8021Q; 154 }; 155 156 union aci_aifsn { 157 u8 charData; 158 159 struct { 160 u8 AIFSN:4; 161 u8 acm:1; 162 u8 ACI:2; 163 u8 Reserved:1; 164 } f; 165 }; 166 167 #endif 168