
#ifndef __INCvrateconstantsh
#define __INCvrateconstantsh

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

typedef enum {
    vRATE_INDEX_HT20_MCS0=numRateCodes,	
    vRATE_INDEX_HT20_MCS1,
    vRATE_INDEX_HT20_MCS2,
    vRATE_INDEX_HT20_MCS3,
    vRATE_INDEX_HT20_MCS4,
    vRATE_INDEX_HT20_MCS5,
    vRATE_INDEX_HT20_MCS6,
    vRATE_INDEX_HT20_MCS7,
    vRATE_INDEX_HT20_MCS8,
    vRATE_INDEX_HT20_MCS9,
    vRATE_INDEX_HT20_MCS10,
    vRATE_INDEX_HT20_MCS11,
    vRATE_INDEX_HT20_MCS12,
    vRATE_INDEX_HT20_MCS13,
    vRATE_INDEX_HT20_MCS14,
    vRATE_INDEX_HT20_MCS15,
    vRATE_INDEX_HT20_MCS16,
    vRATE_INDEX_HT20_MCS17,
    vRATE_INDEX_HT20_MCS18,
    vRATE_INDEX_HT20_MCS19,
    vRATE_INDEX_HT20_MCS20,
    vRATE_INDEX_HT20_MCS21,
    vRATE_INDEX_HT20_MCS22,
    vRATE_INDEX_HT20_MCS23,
    vRATE_INDEX_HT20_MCS24,
    vRATE_INDEX_HT20_MCS25,
    vRATE_INDEX_HT20_MCS26,
    vRATE_INDEX_HT20_MCS27,
    vRATE_INDEX_HT20_MCS28,
    vRATE_INDEX_HT20_MCS29,
    vRATE_INDEX_HT20_MCS30,
    vRATE_INDEX_HT20_MCS31,
    vRATE_INDEX_HT20_MCS32,
    vRATE_INDEX_HT20_MCS33,
    vRATE_INDEX_HT20_MCS34,
    vRATE_INDEX_HT20_MCS35,
    vRATE_INDEX_HT20_MCS36,
    vRATE_INDEX_HT20_MCS37,
    vRATE_INDEX_HT20_MCS38,
    vRATE_INDEX_HT20_MCS39,
    vRATE_INDEX_HT40_MCS0=numRateCodes+48,
    vRATE_INDEX_HT40_MCS1,
    vRATE_INDEX_HT40_MCS2,
    vRATE_INDEX_HT40_MCS3,
    vRATE_INDEX_HT40_MCS4,
    vRATE_INDEX_HT40_MCS5,
    vRATE_INDEX_HT40_MCS6,
    vRATE_INDEX_HT40_MCS7,
    vRATE_INDEX_HT40_MCS8,
    vRATE_INDEX_HT40_MCS9,
    vRATE_INDEX_HT40_MCS10,
    vRATE_INDEX_HT40_MCS11,
    vRATE_INDEX_HT40_MCS12,
    vRATE_INDEX_HT40_MCS13,
    vRATE_INDEX_HT40_MCS14,
    vRATE_INDEX_HT40_MCS15,
    vRATE_INDEX_HT40_MCS16,
    vRATE_INDEX_HT40_MCS17,
    vRATE_INDEX_HT40_MCS18,
    vRATE_INDEX_HT40_MCS19,
    vRATE_INDEX_HT40_MCS20,
    vRATE_INDEX_HT40_MCS21,
    vRATE_INDEX_HT40_MCS22,
    vRATE_INDEX_HT40_MCS23,
    vRATE_INDEX_HT40_MCS24,
    vRATE_INDEX_HT40_MCS25,
    vRATE_INDEX_HT40_MCS26,
    vRATE_INDEX_HT40_MCS27,
    vRATE_INDEX_HT40_MCS28,
    vRATE_INDEX_HT40_MCS29,
    vRATE_INDEX_HT40_MCS30,
    vRATE_INDEX_HT40_MCS31,
    vRATE_INDEX_HT40_MCS32,
    vRATE_INDEX_HT40_MCS33,
    vRATE_INDEX_HT40_MCS34,
    vRATE_INDEX_HT40_MCS35,
    vRATE_INDEX_HT40_MCS36,
    vRATE_INDEX_HT40_MCS37,
    vRATE_INDEX_HT40_MCS38,
    vRATE_INDEX_HT40_MCS39,
    vRATE_INDEX_HT80_MCS0=numRateCodes+96,
    vRATE_INDEX_HT80_MCS1,
    vRATE_INDEX_HT80_MCS2,
    vRATE_INDEX_HT80_MCS3,
    vRATE_INDEX_HT80_MCS4,
    vRATE_INDEX_HT80_MCS5,
    vRATE_INDEX_HT80_MCS6,
    vRATE_INDEX_HT80_MCS7,
    vRATE_INDEX_HT80_MCS8,
    vRATE_INDEX_HT80_MCS9,
    vRATE_INDEX_HT80_MCS10,
    vRATE_INDEX_HT80_MCS11,
    vRATE_INDEX_HT80_MCS12,
    vRATE_INDEX_HT80_MCS13,
    vRATE_INDEX_HT80_MCS14,
    vRATE_INDEX_HT80_MCS15,
    vRATE_INDEX_HT80_MCS16,
    vRATE_INDEX_HT80_MCS17,
    vRATE_INDEX_HT80_MCS18,
    vRATE_INDEX_HT80_MCS19,
    vRATE_INDEX_HT80_MCS20,
    vRATE_INDEX_HT80_MCS21,
    vRATE_INDEX_HT80_MCS22,
    vRATE_INDEX_HT80_MCS23,
    vRATE_INDEX_HT80_MCS24,
    vRATE_INDEX_HT80_MCS25,
    vRATE_INDEX_HT80_MCS26,
    vRATE_INDEX_HT80_MCS27,
    vRATE_INDEX_HT80_MCS28,
    vRATE_INDEX_HT80_MCS29,
    vRATE_INDEX_HT80_MCS30,
    vRATE_INDEX_HT80_MCS31,
    vRATE_INDEX_HT80_MCS32,
    vRATE_INDEX_HT80_MCS33,
    vRATE_INDEX_HT80_MCS34,
    vRATE_INDEX_HT80_MCS35,
    vRATE_INDEX_HT80_MCS36,
    vRATE_INDEX_HT80_MCS37,
    vRATE_INDEX_HT80_MCS38,
    vRATE_INDEX_HT80_MCS39,
}vRATE_INDEX ;

enum
{
	vRateAll=1010,
	vRateHt20,
	vRateHt40,
	vRateHt80,
	vRateDvt,
};


//const A_UINT16 numRateCodes = sizeof(rateCodes)/sizeof(A_UCHAR);
#define vNumRateCodes 192
extern const A_UCHAR vRateValues[vNumRateCodes];
extern const A_UCHAR vRateCodes[vNumRateCodes];
extern char *vRateStrAll[vNumRateCodes];

#define UNKNOWN_RATE_CODE 0xff
#define IS_1STREAM_vRATE_INDEX(x) (((x) >= vRATE_INDEX_HT20_MCS0 && (x) <= vRATE_INDEX_HT20_MCS9) || ((x) >= vRATE_INDEX_HT40_MCS0 && (x) <= vRATE_INDEX_HT40_MCS9) || ((x) >= vRATE_INDEX_HT80_MCS0 && (x) <= vRATE_INDEX_HT80_MCS9))
#define IS_2STREAM_vRATE_INDEX(x) (((x) >= vRATE_INDEX_HT20_MCS10 && (x) <= vRATE_INDEX_HT20_MCS19) || ((x) >= vRATE_INDEX_HT40_MCS10 && (x) <= vRATE_INDEX_HT40_MCS19) || ((x) >= vRATE_INDEX_HT80_MCS10 && (x) <= vRATE_INDEX_HT80_MCS19))
#define IS_3STREAM_vRATE_INDEX(x) (((x) >= vRATE_INDEX_HT20_MCS20 && (x) <= vRATE_INDEX_HT20_MCS29) || ((x) >= vRATE_INDEX_HT40_MCS20 && (x) <= vRATE_INDEX_HT40_MCS29) || ((x) >= vRATE_INDEX_HT80_MCS20 && (x) <= vRATE_INDEX_HT80_MCS29))
#define IS_HT80_vRATE_INDEX(x)    ((x) >= numRateCodes+96 && (x) <= numRateCodes+135)
#define IS_HT40_vRATE_INDEX(x)    ((x) >= numRateCodes+48 && (x) <= numRateCodes+87)
#define IS_HT20_vRATE_INDEX(x)    ((x) >= numRateCodes && (x) <= numRateCodes+39)
#define IS_vRate(x)				(x>=numRateCodes)

extern A_UINT32 descvRate2bin(A_UINT32 descRateCode);
extern A_UINT32 descvRate2RateIndex(A_UINT32 descRateCode, unsigned char htMode);
extern A_UINT32 vRate2bin(A_UINT32 rateCode);
extern int vRateCount(A_UINT32 rateMaskMcs20, A_UINT32 rateMaskMcs40, A_UINT32 rateMaskMcs80, int *Rate);
extern int vRateExpand(int *rate, int nrate);
extern void vRateMaskGet (A_UINT32 *rateMaskMcs20, A_UINT32 *rateMaskMcs40, A_UINT32 *rateMaskMcs80, int *Rate, int nrate);
extern void vRateMask2UtfRateMask (A_UINT32 rateMask, A_UINT32 rateMaskMcs20, A_UINT32 rateMaskMcs40,
						   A_UINT32 *utfRateMask);
extern int UtfvRateBit2RateIndx(A_UINT32 rateBit);
extern int vRateIndx2UtfRateBit(int rateIndx);

A_BOOL Is40MHzCenterFrequency(int frequency);
A_BOOL Is80MHzCenterFrequency(int frequency);

extern void WLAN_Rate2UtfRateMask(unsigned int wlanRate, unsigned int *utfRateMask);
extern int findNextRxRateIndx(int RateIndxStart, unsigned int *utfRateMask);

// this enum is from QC.TILib.WCNTester
typedef enum 
{
    RATE_11B_LONG_1_MBPS = 0,
    RATE_11B_LONG_2_MBPS = 1,
    RATE_11B_LONG_5_5_MBPS = 2,
    RATE_11B_LONG_11_MBPS = 3,
    RATE_11B_SHORT_2_MBPS = 4,
    RATE_11B_SHORT_5_5_MBPS = 5,
    RATE_11B_SHORT_11_MBPS = 6,
    RATE_11A_6_MBPS = 7,
    RATE_11A_9_MBPS = 8,
    RATE_11A_12_MBPS = 9,
    RATE_11A_18_MBPS = 10,
    RATE_11A_24_MBPS = 11,
    RATE_11A_36_MBPS = 12,
    RATE_11A_48_MBPS = 13,
    RATE_11A_54_MBPS = 14,
    RATE_11N_HT20_MCS0 = 15,
    RATE_11N_HT20_MCS1 = 16,
    RATE_11N_HT20_MCS2 = 17,
    RATE_11N_HT20_MCS3 = 18,
    RATE_11N_HT20_MCS4 = 19,
    RATE_11N_HT20_MCS5 = 20,
    RATE_11N_HT20_MCS6 = 21,
    RATE_11N_HT20_MCS7 = 22,
    RATE_11N_HT40_MCS0 = 23,
    RATE_11N_HT40_MCS1 = 24,
    RATE_11N_HT40_MCS2 = 25,
    RATE_11N_HT40_MCS3 = 26,
    RATE_11N_HT40_MCS4 = 27,
    RATE_11N_HT40_MCS5 = 28,
    RATE_11N_HT40_MCS6 = 29,
    RATE_11N_HT40_MCS7 = 30,
    RATE_11AC_HT20_MCS0 = 31,
    RATE_11AC_HT20_MCS1 = 32,
    RATE_11AC_HT20_MCS2 = 33,
    RATE_11AC_HT20_MCS3 = 34,
    RATE_11AC_HT20_MCS4 = 35,
    RATE_11AC_HT20_MCS5 = 36,
    RATE_11AC_HT20_MCS6 = 37,
    RATE_11AC_HT20_MCS7 = 38,
    RATE_11AC_HT20_MCS8 = 39,
    RATE_11AC_HT20_MCS9 = 40,
    RATE_11AC_HT40_MCS0 = 41,
    RATE_11AC_HT40_MCS1 = 42,
    RATE_11AC_HT40_MCS2 = 43,
    RATE_11AC_HT40_MCS3 = 44,
    RATE_11AC_HT40_MCS4 = 45,
    RATE_11AC_HT40_MCS5 = 46,
    RATE_11AC_HT40_MCS6 = 47,
    RATE_11AC_HT40_MCS7 = 48,
    RATE_11AC_HT40_MCS8 = 49,
    RATE_11AC_HT40_MCS9 = 50,
    RATE_11AC_HT80_MCS0 = 51,
    RATE_11AC_HT80_MCS1 = 52,
    RATE_11AC_HT80_MCS2 = 53,
    RATE_11AC_HT80_MCS3 = 54,
    RATE_11AC_HT80_MCS4 = 55,
    RATE_11AC_HT80_MCS5 = 56,
    RATE_11AC_HT80_MCS6 = 57,
    RATE_11AC_HT80_MCS7 = 58,
    RATE_11AC_HT80_MCS8 = 59,
    RATE_11AC_HT80_MCS9 = 60,
    RATE_11N_HT20_MCS8 = 61,
    RATE_11N_HT20_MCS9 = 62,
    RATE_11N_HT20_MCS10 = 63,
    RATE_11N_HT20_MCS11 = 64,
    RATE_11N_HT20_MCS12 = 65,
    RATE_11N_HT20_MCS13 = 66,
    RATE_11N_HT20_MCS14 = 67,
    RATE_11N_HT20_MCS15 = 68,
    RATE_11N_HT40_MCS8 = 69,
    RATE_11N_HT40_MCS9 = 70,
    RATE_11N_HT40_MCS10 = 71,
    RATE_11N_HT40_MCS11 = 72,
    RATE_11N_HT40_MCS12 = 73,
    RATE_11N_HT40_MCS13 = 74,
    RATE_11N_HT40_MCS14 = 75,
    RATE_11N_HT40_MCS15 = 76,
    RATE_11AC_HT20_MCS0_2S = 77,
    RATE_11AC_HT20_MCS1_2S = 78,
    RATE_11AC_HT20_MCS2_2S = 79,
    RATE_11AC_HT20_MCS3_2S = 80,
    RATE_11AC_HT20_MCS4_2S = 81,
    RATE_11AC_HT20_MCS5_2S = 82,
    RATE_11AC_HT20_MCS6_2S = 83,
    RATE_11AC_HT20_MCS7_2S = 84,
    RATE_11AC_HT20_MCS8_2S = 85,
    RATE_11AC_HT20_MCS9_2S = 86,
    RATE_11AC_HT40_MCS0_2S = 87,
    RATE_11AC_HT40_MCS1_2S = 88,
    RATE_11AC_HT40_MCS2_2S = 89,
    RATE_11AC_HT40_MCS3_2S = 90,
    RATE_11AC_HT40_MCS4_2S = 91,
    RATE_11AC_HT40_MCS5_2S = 92,
    RATE_11AC_HT40_MCS6_2S = 93,
    RATE_11AC_HT40_MCS7_2S = 94,
    RATE_11AC_HT40_MCS8_2S = 95,
    RATE_11AC_HT40_MCS9_2S = 96,
    RATE_11AC_HT80_MCS0_2S = 97,
    RATE_11AC_HT80_MCS1_2S = 98,
    RATE_11AC_HT80_MCS2_2S = 99,
    RATE_11AC_HT80_MCS3_2S = 100,
    RATE_11AC_HT80_MCS4_2S = 101,
    RATE_11AC_HT80_MCS5_2S = 102,
    RATE_11AC_HT80_MCS6_2S = 103,
    RATE_11AC_HT80_MCS7_2S = 104,
    RATE_11AC_HT80_MCS8_2S = 105,
    RATE_11AC_HT80_MCS9_2S = 106,
    RATE_11N_HT20_MCS16 = 107,
    RATE_11N_HT20_MCS17 = 108,
    RATE_11N_HT20_MCS18 = 109,
    RATE_11N_HT20_MCS19 = 110,
    RATE_11N_HT20_MCS20 = 111,
    RATE_11N_HT20_MCS21 = 112,
    RATE_11N_HT20_MCS22 = 113,
    RATE_11N_HT20_MCS23 = 114,
    RATE_11N_HT40_MCS16 = 115,
    RATE_11N_HT40_MCS17 = 116,
    RATE_11N_HT40_MCS18 = 117,
    RATE_11N_HT40_MCS19 = 118,
    RATE_11N_HT40_MCS20 = 119,
    RATE_11N_HT40_MCS21 = 120,
    RATE_11N_HT40_MCS22 = 121,
    RATE_11N_HT40_MCS23 = 122,
    RATE_11AC_HT20_MCS0_3S = 123,
    RATE_11AC_HT20_MCS1_3S = 124,
    RATE_11AC_HT20_MCS2_3S = 125,
    RATE_11AC_HT20_MCS3_3S = 126,
    RATE_11AC_HT20_MCS4_3S = 127,
    RATE_11AC_HT20_MCS5_3S = 128,
    RATE_11AC_HT20_MCS6_3S = 129,
    RATE_11AC_HT20_MCS7_3S = 130,
    RATE_11AC_HT20_MCS8_3S = 131,
    RATE_11AC_HT20_MCS9_3S = 132,
    RATE_11AC_HT40_MCS0_3S = 133,
    RATE_11AC_HT40_MCS1_3S = 134,
    RATE_11AC_HT40_MCS2_3S = 135,
    RATE_11AC_HT40_MCS3_3S = 136,
    RATE_11AC_HT40_MCS4_3S = 137,
    RATE_11AC_HT40_MCS5_3S = 138,
    RATE_11AC_HT40_MCS6_3S = 139,
    RATE_11AC_HT40_MCS7_3S = 140,
    RATE_11AC_HT40_MCS8_3S = 141,
    RATE_11AC_HT40_MCS9_3S = 142,
    RATE_11AC_HT80_MCS0_3S = 143,
    RATE_11AC_HT80_MCS1_3S = 144,
    RATE_11AC_HT80_MCS2_3S = 145,
    RATE_11AC_HT80_MCS3_3S = 146,
    RATE_11AC_HT80_MCS4_3S = 147,
    RATE_11AC_HT80_MCS5_3S = 148,
    RATE_11AC_HT80_MCS6_3S = 149,
    RATE_11AC_HT80_MCS7_3S = 150,
    RATE_11AC_HT80_MCS8_3S = 151,
    RATE_11AC_HT80_MCS9_3S = 152,
} WLAN_Rate;		   

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif

