wifi: renew patch drivers/net/wireless
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / combo_mt66xx / mt6628 / wlan / include / nic / cmd_buf.h
1 /*
2 ** $Id:
3 */
4
5 /*! \file   "cmd_buf.h"
6     \brief  In this file we define the structure for Command Packet.
7
8                 In this file we define the structure for Command Packet and the control unit
9     of MGMT Memory Pool.
10 */
11
12
13
14 /*
15 ** $Log: cmd_buf.h $
16  *
17  * 10 04 2010 cp.wu
18  * [WCXRP00000077] [MT6620 Wi-Fi][Driver][FW] Eliminate use of ENUM_NETWORK_TYPE_T and replaced by ENUM_NETWORK_TYPE_INDEX_T only
19  * remove ENUM_NETWORK_TYPE_T definitions
20  *
21  * 09 03 2010 kevin.huang
22  * NULL
23  * Refine #include sequence and solve recursive/nested #include issue
24  *
25  * 07 13 2010 cp.wu
26  * 
27  * 1) MMPDUs are now sent to MT6620 by CMD queue for keeping strict order of 1X/MMPDU/CMD packets
28  * 2) integrate with qmGetFrameAction() for deciding which MMPDU/1X could pass checking for sending
29  * 2) enhance CMD_INFO_T descriptor number from 10 to 32 to avoid descriptor underflow under concurrent network operation
30  *
31  * 07 08 2010 cp.wu
32  * 
33  * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
34  *
35  * 07 01 2010 cm.chang
36  * [WPD00003841][LITE Driver] Migrate RLM/CNM to host driver 
37  * Enable change log
38 */
39
40 #ifndef _CMD_BUF_H
41 #define _CMD_BUF_H
42
43 /*******************************************************************************
44 *                         C O M P I L E R   F L A G S
45 ********************************************************************************
46 */
47
48 /*******************************************************************************
49 *                    E X T E R N A L   R E F E R E N C E S
50 ********************************************************************************
51 */
52
53 /*******************************************************************************
54 *                              C O N S T A N T S
55 ********************************************************************************
56 */
57
58 /*******************************************************************************
59 *                             D A T A   T Y P E S
60 ********************************************************************************
61 */
62
63 typedef enum _COMMAND_TYPE {
64     COMMAND_TYPE_GENERAL_IOCTL,
65     COMMAND_TYPE_NETWORK_IOCTL,
66     COMMAND_TYPE_SECURITY_FRAME,
67     COMMAND_TYPE_MANAGEMENT_FRAME,
68     COMMAND_TYPE_NUM
69 } COMMAND_TYPE, *P_COMMAND_TYPE;
70
71 typedef VOID (*PFN_CMD_DONE_HANDLER) (
72     IN P_ADAPTER_T  prAdapter,
73     IN P_CMD_INFO_T prCmdInfo,
74     IN PUINT_8      pucEventBuf
75     );
76
77 typedef VOID (*PFN_CMD_TIMEOUT_HANDLER) (
78     IN P_ADAPTER_T  prAdapter,
79     IN P_CMD_INFO_T prCmdInfo
80     );
81
82 struct _CMD_INFO_T {
83     QUE_ENTRY_T rQueEntry;
84
85     COMMAND_TYPE    eCmdType;
86
87     UINT_16     u2InfoBufLen;   /* This is actual CMD buffer length */
88     PUINT_8     pucInfoBuffer;  /* May pointer to structure in prAdapter */
89     P_NATIVE_PACKET prPacket;   /* only valid when it's a security frame */
90
91     ENUM_NETWORK_TYPE_INDEX_T eNetworkType;
92     UINT_8      ucStaRecIndex;  /* only valid when it's a security frame */
93
94     PFN_CMD_DONE_HANDLER        pfCmdDoneHandler;
95     PFN_CMD_TIMEOUT_HANDLER     pfCmdTimeoutHandler;
96
97     BOOLEAN     fgIsOid; /* Used to check if we need indicate */
98
99     UINT_8      ucCID;
100     BOOLEAN     fgSetQuery;
101     BOOLEAN     fgNeedResp;
102     BOOLEAN     fgDriverDomainMCR; /* Access Driver Domain MCR, for CMD_ID_ACCESS_REG only */
103     UINT_8      ucCmdSeqNum;
104     UINT_32     u4SetInfoLen; /* Indicate how many byte we read for Set OID */
105
106     /* information indicating by OID/ioctl */
107     PVOID       pvInformationBuffer;
108     UINT_32     u4InformationBufferLength;
109
110     /* private data */
111     UINT_32     u4PrivateData;
112 };
113
114
115 /*******************************************************************************
116 *                            P U B L I C   D A T A
117 ********************************************************************************
118 */
119
120 /*******************************************************************************
121 *                           P R I V A T E   D A T A
122 ********************************************************************************
123 */
124
125 /*******************************************************************************
126 *                                 M A C R O S
127 ********************************************************************************
128 */
129
130 /*******************************************************************************
131 *                   F U N C T I O N   D E C L A R A T I O N S
132 ********************************************************************************
133 */
134 VOID
135 cmdBufInitialize (
136     IN P_ADAPTER_T prAdapter
137     );
138
139 P_CMD_INFO_T
140 cmdBufAllocateCmdInfo (
141     IN P_ADAPTER_T prAdapter,
142     IN UINT_32 u4Length
143     );
144
145 VOID
146 cmdBufFreeCmdInfo (
147     IN P_ADAPTER_T prAdapter,
148     IN P_CMD_INFO_T prCmdInfo
149     );
150
151 /*----------------------------------------------------------------------------*/
152 /* Routines for CMDs                                                          */
153 /*----------------------------------------------------------------------------*/
154 WLAN_STATUS
155 wlanSendSetQueryCmd (
156     IN P_ADAPTER_T  prAdapter,
157     UINT_8          ucCID,
158     BOOLEAN         fgSetQuery,
159     BOOLEAN         fgNeedResp,
160     BOOLEAN         fgIsOid,
161     PFN_CMD_DONE_HANDLER pfCmdDoneHandler,
162     PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler,
163     UINT_32         u4SetQueryInfoLen,
164     PUINT_8         pucInfoBuffer,
165     OUT PVOID       pvSetQueryBuffer,
166     IN UINT_32      u4SetQueryBufferLen
167     );
168
169
170 /*******************************************************************************
171 *                              F U N C T I O N S
172 ********************************************************************************
173 */
174 #endif /* _CMD_BUF_H */
175
176