import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / connectivity / combo / drv_wlan / 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) (IN P_ADAPTER_T prAdapter,
72 IN P_CMD_INFO_T prCmdInfo, IN PUINT_8 pucEventBuf);
73
74 typedef VOID(*PFN_CMD_TIMEOUT_HANDLER) (IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
75
76 struct _CMD_INFO_T {
77 QUE_ENTRY_T rQueEntry;
78
79 COMMAND_TYPE eCmdType;
80
81 UINT_16 u2InfoBufLen; /* This is actual CMD buffer length */
82 PUINT_8 pucInfoBuffer; /* May pointer to structure in prAdapter */
83 P_NATIVE_PACKET prPacket; /* only valid when it's a security frame */
84
85 ENUM_NETWORK_TYPE_INDEX_T eNetworkType;
86 UINT_8 ucStaRecIndex; /* only valid when it's a security frame */
87
88 PFN_CMD_DONE_HANDLER pfCmdDoneHandler;
89 PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler;
90
91 BOOLEAN fgIsOid; /* Used to check if we need indicate */
92
93 UINT_8 ucCID;
94 BOOLEAN fgSetQuery;
95 BOOLEAN fgNeedResp;
96 BOOLEAN fgDriverDomainMCR; /* Access Driver Domain MCR, for CMD_ID_ACCESS_REG only */
97 UINT_8 ucCmdSeqNum;
98 UINT_32 u4SetInfoLen; /* Indicate how many byte we read for Set OID */
99
100 /* information indicating by OID/ioctl */
101 PVOID pvInformationBuffer;
102 UINT_32 u4InformationBufferLength;
103
104 /* private data */
105 UINT_32 u4PrivateData;
106 };
107
108
109 /*******************************************************************************
110 * P U B L I C D A T A
111 ********************************************************************************
112 */
113
114 /*******************************************************************************
115 * P R I V A T E D A T A
116 ********************************************************************************
117 */
118
119 /*******************************************************************************
120 * M A C R O S
121 ********************************************************************************
122 */
123
124 /*******************************************************************************
125 * F U N C T I O N D E C L A R A T I O N S
126 ********************************************************************************
127 */
128 VOID cmdBufInitialize(IN P_ADAPTER_T prAdapter);
129
130 P_CMD_INFO_T cmdBufAllocateCmdInfo(IN P_ADAPTER_T prAdapter, IN UINT_32 u4Length);
131
132 VOID cmdBufFreeCmdInfo(IN P_ADAPTER_T prAdapter, IN P_CMD_INFO_T prCmdInfo);
133
134 /*----------------------------------------------------------------------------*/
135 /* Routines for CMDs */
136 /*----------------------------------------------------------------------------*/
137 WLAN_STATUS
138 wlanSendSetQueryCmd(IN P_ADAPTER_T prAdapter,
139 UINT_8 ucCID,
140 BOOLEAN fgSetQuery,
141 BOOLEAN fgNeedResp,
142 BOOLEAN fgIsOid,
143 PFN_CMD_DONE_HANDLER pfCmdDoneHandler,
144 PFN_CMD_TIMEOUT_HANDLER pfCmdTimeoutHandler,
145 UINT_32 u4SetQueryInfoLen,
146 PUINT_8 pucInfoBuffer,
147 OUT PVOID pvSetQueryBuffer, IN UINT_32 u4SetQueryBufferLen);
148
149
150 /*******************************************************************************
151 * F U N C T I O N S
152 ********************************************************************************
153 */
154 #endif /* _CMD_BUF_H */