Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
0004  *
0005  * Contact Information: wlanfae <wlanfae@realtek.com>
0006  */
0007 #ifndef __INC_QOS_TYPE_H
0008 #define __INC_QOS_TYPE_H
0009 
0010 #define BIT0            0x00000001
0011 #define BIT1            0x00000002
0012 #define BIT2            0x00000004
0013 #define BIT3            0x00000008
0014 #define BIT4            0x00000010
0015 #define BIT5            0x00000020
0016 #define BIT6            0x00000040
0017 #define BIT7            0x00000080
0018 #define BIT8            0x00000100
0019 #define BIT9            0x00000200
0020 #define BIT10          0x00000400
0021 #define BIT11          0x00000800
0022 #define BIT12          0x00001000
0023 #define BIT13          0x00002000
0024 #define BIT14          0x00004000
0025 #define BIT15          0x00008000
0026 #define BIT16          0x00010000
0027 #define BIT17          0x00020000
0028 #define BIT18          0x00040000
0029 #define BIT19          0x00080000
0030 #define BIT20          0x00100000
0031 #define BIT21          0x00200000
0032 #define BIT22          0x00400000
0033 #define BIT23          0x00800000
0034 #define BIT24          0x01000000
0035 #define BIT25          0x02000000
0036 #define BIT26          0x04000000
0037 #define BIT27          0x08000000
0038 #define BIT28          0x10000000
0039 #define BIT29          0x20000000
0040 #define BIT30          0x40000000
0041 #define BIT31          0x80000000
0042 
0043 union qos_tsinfo {
0044     u8      charData[3];
0045     struct {
0046         u8      ucTrafficType:1;
0047         u8      ucTSID:4;
0048         u8      ucDirection:2;
0049         u8      ucAccessPolicy:2;
0050         u8      ucAggregation:1;
0051         u8      ucPSB:1;
0052         u8      ucUP:3;
0053         u8      ucTSInfoAckPolicy:2;
0054         u8      ucSchedule:1;
0055         u8      ucReserved:7;
0056     } field;
0057 };
0058 
0059 union tspec_body {
0060     u8      charData[55];
0061 
0062     struct {
0063         union qos_tsinfo TSInfo;
0064         u16 NominalMSDUsize;
0065         u16 MaxMSDUsize;
0066         u32 MinServiceItv;
0067         u32 MaxServiceItv;
0068         u32 InactivityItv;
0069         u32 SuspenItv;
0070         u32 ServiceStartTime;
0071         u32 MinDataRate;
0072         u32 MeanDataRate;
0073         u32 PeakDataRate;
0074         u32 MaxBurstSize;
0075         u32 DelayBound;
0076         u32 MinPhyRate;
0077         u16 SurplusBandwidthAllowance;
0078         u16 MediumTime;
0079     } f;
0080 };
0081 
0082 struct octet_string {
0083     u8 *Octet;
0084     u16 Length;
0085 };
0086 
0087 #define AC0_BE  0
0088 #define AC1_BK  1
0089 #define AC2_VI  2
0090 #define AC3_VO  3
0091 #define AC_MAX  4
0092 
0093 enum direction_value {
0094     DIR_UP          = 0,
0095     DIR_DOWN        = 1,
0096     DIR_DIRECT      = 2,
0097     DIR_BI_DIR      = 3,
0098 };
0099 
0100 enum acm_method {
0101     eAcmWay0_SwAndHw        = 0,
0102     eAcmWay1_HW         = 1,
0103     eAcmWay2_SW         = 2,
0104 };
0105 
0106 
0107 struct acm {
0108     u64     UsedTime;
0109     u64     MediumTime;
0110     u8      HwAcmCtl;
0111 };
0112 
0113 union qos_tclas {
0114 
0115     struct _TYPE_GENERAL {
0116         u8      Priority;
0117         u8      ClassifierType;
0118         u8      Mask;
0119     } TYPE_GENERAL;
0120 
0121     struct _TYPE0_ETH {
0122         u8      Priority;
0123         u8      ClassifierType;
0124         u8      Mask;
0125         u8      SrcAddr[ETH_ALEN];
0126         u8      DstAddr[ETH_ALEN];
0127         u16     Type;
0128     } TYPE0_ETH;
0129 
0130     struct _TYPE1_IPV4 {
0131         u8      Priority;
0132         u8      ClassifierType;
0133         u8      Mask;
0134         u8      Version;
0135         u8      SrcIP[4];
0136         u8      DstIP[4];
0137         u16     SrcPort;
0138         u16     DstPort;
0139         u8      DSCP;
0140         u8      Protocol;
0141         u8      Reserved;
0142     } TYPE1_IPV4;
0143 
0144     struct _TYPE1_IPV6 {
0145         u8      Priority;
0146         u8      ClassifierType;
0147         u8      Mask;
0148         u8      Version;
0149         u8      SrcIP[16];
0150         u8      DstIP[16];
0151         u16     SrcPort;
0152         u16     DstPort;
0153         u8      FlowLabel[3];
0154     } TYPE1_IPV6;
0155 
0156     struct _TYPE2_8021Q {
0157         u8      Priority;
0158         u8      ClassifierType;
0159         u8      Mask;
0160         u16     TagType;
0161     } TYPE2_8021Q;
0162 };
0163 
0164 union aci_aifsn {
0165     u8  charData;
0166 
0167     struct {
0168         u8  AIFSN:4;
0169         u8  acm:1;
0170         u8  ACI:2;
0171         u8  Reserved:1;
0172     } f;
0173 };
0174 
0175 #endif