net: wireless: rockchip_wlan: add rtl8188eu support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8188eu / hal / phydm / rtl8188e / hal8188erateadaptive.h
1 #ifndef __INC_RA_H
2 #define __INC_RA_H
3 /*++
4 Copyright (c) Realtek Semiconductor Corp. All rights reserved.
5
6 Module Name:
7         RateAdaptive.h
8         
9 Abstract:
10         Prototype of RA and related data structure.
11             
12 Major Change History:
13         When       Who               What
14         ---------- ---------------   -------------------------------
15         2011-08-12 Page            Create.      
16 --*/
17
18 // Rate adaptive define
19 #define PERENTRY        23
20 #define RETRYSIZE       5
21 #define RATESIZE        28
22 #define TX_RPT2_ITEM_SIZE       8
23
24 #if (DM_ODM_SUPPORT_TYPE  != ODM_WIN)
25 //
26 // TX report 2 format in Rx desc
27 //
28 #define GET_TX_RPT2_DESC_PKT_LEN_88E(__pRxStatusDesc)                           LE_BITS_TO_4BYTE( __pRxStatusDesc, 0, 9)
29 #define GET_TX_RPT2_DESC_MACID_VALID_1_88E(__pRxStatusDesc)             LE_BITS_TO_4BYTE( __pRxStatusDesc+16, 0, 32)
30 #define GET_TX_RPT2_DESC_MACID_VALID_2_88E(__pRxStatusDesc)             LE_BITS_TO_4BYTE( __pRxStatusDesc+20, 0, 32)
31
32 #define GET_TX_REPORT_TYPE1_RERTY_0(__pAddr)                                            LE_BITS_TO_4BYTE( __pAddr, 0, 16)
33 #define GET_TX_REPORT_TYPE1_RERTY_1(__pAddr)                                            LE_BITS_TO_1BYTE( __pAddr+2, 0, 8)
34 #define GET_TX_REPORT_TYPE1_RERTY_2(__pAddr)                                            LE_BITS_TO_1BYTE( __pAddr+3, 0, 8)
35 #define GET_TX_REPORT_TYPE1_RERTY_3(__pAddr)                                            LE_BITS_TO_1BYTE( __pAddr+4, 0, 8)
36 #define GET_TX_REPORT_TYPE1_RERTY_4(__pAddr)                                            LE_BITS_TO_1BYTE( __pAddr+4+1, 0, 8)
37 #define GET_TX_REPORT_TYPE1_DROP_0(__pAddr)                                             LE_BITS_TO_1BYTE( __pAddr+4+2, 0, 8)
38 #define GET_TX_REPORT_TYPE1_DROP_1(__pAddr)                                             LE_BITS_TO_1BYTE( __pAddr+4+3, 0, 8)
39 #endif
40
41 // End rate adaptive define
42
43 VOID
44 ODM_RASupport_Init(
45         IN      PDM_ODM_T       pDM_Odm
46         );
47
48 int 
49 ODM_RAInfo_Init_all(
50         IN    PDM_ODM_T         pDM_Odm
51         );
52
53 int 
54 ODM_RAInfo_Init(
55         IN      PDM_ODM_T       pDM_Odm,
56         IN      u1Byte          MacID   
57         );
58
59 u1Byte 
60 ODM_RA_GetShortGI_8188E(
61         IN      PDM_ODM_T       pDM_Odm, 
62         IN      u1Byte          MacID
63         );
64
65 u1Byte 
66 ODM_RA_GetDecisionRate_8188E(
67         IN      PDM_ODM_T       pDM_Odm, 
68         IN      u1Byte          MacID
69         );
70
71 u1Byte
72 ODM_RA_GetHwPwrStatus_8188E(
73         IN      PDM_ODM_T       pDM_Odm, 
74         IN      u1Byte          MacID
75         );
76 VOID 
77 ODM_RA_UpdateRateInfo_8188E(
78         IN PDM_ODM_T pDM_Odm,
79         IN u1Byte MacID,
80         IN u1Byte RateID, 
81         IN u4Byte RateMask,
82         IN u1Byte SGIEnable
83         );
84
85 VOID 
86 ODM_RA_SetRSSI_8188E(
87         IN      PDM_ODM_T               pDM_Odm, 
88         IN      u1Byte                  MacID, 
89         IN      u1Byte                  Rssi
90         );
91
92 VOID
93 ODM_RA_TxRPT2Handle_8188E(      
94         IN      PDM_ODM_T               pDM_Odm,
95         IN      pu1Byte                 TxRPT_Buf,
96         IN      u2Byte                  TxRPT_Len,
97         IN      u4Byte                  MacIDValidEntry0,
98         IN      u4Byte                  MacIDValidEntry1
99         );
100         
101
102 VOID 
103 ODM_RA_Set_TxRPT_Time(
104         IN      PDM_ODM_T               pDM_Odm,
105         IN      u2Byte                  minRptTime
106         );      
107 #endif
108