wifi: renew patch drivers/net/wireless
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / combo_mt66xx / mt6620 / wlan / os / linux / include / gl_p2p_ioctl.h
1 /*
2 ** $Id: //Department/DaVinci/TRUNK/WiFi_P2P_Driver/os/linux/include/gl_p2p_ioctl.h#9 $
3 */
4
5 /*! \file   gl_p2p_ioctl.h
6     \brief  This file is for custom ioctls for Wi-Fi Direct only
7 */
8
9
10
11 /*
12 ** $Log: gl_p2p_ioctl.h $
13 ** 
14 ** 07 26 2012 yuche.tsai
15 ** [ALPS00324337] [ALPS.JB][Hot-Spot] Driver update for Hot-Spot
16 ** Update driver code of ALPS.JB for hot-spot.
17 ** 
18 ** 07 19 2012 yuche.tsai
19 ** NULL
20 ** Code update for JB.
21  *
22  * 07 17 2012 yuche.tsai
23  * NULL
24  * Compile no error before trial run.
25  *
26  * 06 07 2011 yuche.tsai
27  * [WCXRP00000763] [Volunteer Patch][MT6620][Driver] RX Service Discovery Frame under AP mode Issue
28  * Fix RX SD request under AP mode issue.
29  *
30  * 03 25 2011 wh.su
31  * NULL
32  * Fix P2P IOCTL of multicast address bug, add low power driver stop control.
33  *
34  * 11 22 2011 yuche.tsai
35  * NULL
36  * Update RSSI link quality of P2P Network query method. (Bug fix)
37  *
38  * 11 19 2011 yuche.tsai
39  * NULL
40  * Add RSSI support for P2P network.
41  *
42  * 11 11 2011 yuche.tsai
43  * NULL
44  * Fix work thread cancel issue.
45  *
46  * 11 08 2011 yuche.tsai
47  * [WCXRP00001094] [Volunteer Patch][Driver] Driver version & supplicant version query & set support for service discovery version check.
48  * Add support for driver version query & p2p supplicant verseion set.
49  * For new service discovery mechanism sync.
50  *
51  * 10 25 2011 cm.chang
52  * [WCXRP00001058] [All Wi-Fi][Driver] Fix sta_rec's phyTypeSet and OBSS scan in AP mode
53  * .
54  *
55  * 10 18 2011 yuche.tsai
56  * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch.
57  * New 2.1 branch
58
59  *
60  * 08 16 2011 chinglan.wang
61  * NULL
62  * Add the group id information in the invitation indication.
63  *
64  * 08 09 2011 yuche.tsai
65  * [WCXRP00000919] [Volunteer Patch][WiFi Direct][Driver] Invitation New Feature.
66  * Invitation Feature add on.
67  *
68  * 05 04 2011 chinglan.wang
69  * [WCXRP00000698] [MT6620 Wi-Fi][P2P][Driver] Add p2p invitation command for the p2p driver
70  * .
71  *
72  * 03 29 2011 wh.su
73  * [WCXRP00000095] [MT6620 Wi-Fi] [FW] Refine the P2P GO send broadcast protected code
74  * add the set power and get power function sample.
75  *
76  * 03 22 2011 george.huang
77  * [WCXRP00000504] [MT6620 Wi-Fi][FW] Support Sigma CAPI for power saving related command
78  * link with supplicant commands
79  *
80  * 03 07 2011 wh.su
81  * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code
82  * rename the define to anti_pviracy.
83  *
84  * 03 02 2011 wh.su
85  * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code
86  * Add Security check related code.
87  *
88  * 03 01 2011 wh.su
89  * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver
90  * fixed the ioctl sumcmd to meet the p2p_supplicant setting.
91  *
92  * 02 23 2011 wh.su
93  * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver
94  * adding the ioctl set int define for p2p parameter.
95  *
96  * 02 22 2011 wh.su
97  * [WCXRP00000488] [MT6620 Wi-Fi][Driver] Support the SIGMA set p2p parameter to driver
98  * adding the ioctl set int from supplicant, and can used to set the p2p paramters
99  *
100  * 02 17 2011 wh.su
101  * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request
102  * adjust the set wsc ie structure.
103  *
104  * 01 05 2011 cp.wu
105  * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery
106  * ioctl implementations for P2P Service Discovery
107  *
108  * 12 22 2010 cp.wu
109  * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery
110  * 1. header file restructure for more clear module isolation
111  * 2. add function interface definition for implementing Service Discovery callbacks
112  *
113  * 12 15 2010 cp.wu
114  * NULL
115  * invoke nicEnableInterrupt() before leaving from wlanAdapterStart()
116  *
117  * 12 07 2010 cp.wu
118  * [WCXRP00000237] [MT6620 Wi-Fi][Wi-Fi Direct][Driver] Add interface for supporting service discovery
119  * define a pair of i/o control for multiplexing layer
120  *
121  * 11 04 2010 wh.su
122  * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID
123  * adding the p2p random ssid support.
124  *
125  * 10 20 2010 wh.su
126  * [WCXRP00000124] [MT6620 Wi-Fi] [Driver] Support the dissolve P2P Group
127  * Add the code to support disconnect p2p group
128  *
129  * 09 21 2010 kevin.huang
130  * [WCXRP00000054] [MT6620 Wi-Fi][Driver] Restructure driver for second Interface
131  * Isolate P2P related function for Hardware Software Bundle
132  *
133  * 09 10 2010 george.huang
134  * NULL
135  * update iwpriv LP related
136  *
137  * 09 07 2010 wh.su
138  * NULL
139  * adding the code for beacon/probe req/ probe rsp wsc ie at p2p.
140  *
141  * 08 25 2010 cp.wu
142  * NULL
143  * add netdev_ops(NDO) for linux kernel 2.6.31 or greater
144  *
145  * 08 20 2010 yuche.tsai
146  * NULL
147  * Refine a function parameter name.
148  *
149  * 08 19 2010 cp.wu
150  * NULL
151  * add set mac address interface for further possibilities of wpa_supplicant overriding interface address.
152  *
153  * 08 16 2010 george.huang
154  * NULL
155  * add wext handlers to link P2P set PS profile/ network address function (TBD)
156  *
157  * 08 16 2010 cp.wu
158  * NULL
159  * revised implementation of Wi-Fi Direct io controls.
160  *
161  * 08 12 2010 cp.wu
162  * NULL
163  * follow-up with ioctl interface update for Wi-Fi Direct application
164  *
165  * 08 06 2010 cp.wu
166  * NULL
167  * driver hook modifications corresponding to ioctl interface change.
168  *
169  * 08 03 2010 cp.wu
170  * NULL
171  * [Wi-Fi Direct] add framework for driver hooks
172  *
173  * 07 08 2010 cp.wu
174  *
175  * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
176  *
177  * 06 06 2010 kevin.huang
178  * [WPD00003832][MT6620 5931] Create driver base
179  * [MT6620 5931] Create driver base
180  *
181  * 06 01 2010 cp.wu
182  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
183  * add ioctl to configure scan mode for p2p connection
184  *
185  * 05 31 2010 cp.wu
186  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
187  * add cfg80211 interface, which is to replace WE, for further extension
188  *
189  * 05 17 2010 cp.wu
190  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
191  * implement get scan result.
192  *
193  * 05 14 2010 cp.wu
194  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
195  * implement wireless extension ioctls in iw_handler form.
196  *
197  * 05 14 2010 cp.wu
198  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
199  * add ioctl framework for Wi-Fi Direct by reusing wireless extension ioctls as well
200  *
201  * 05 11 2010 cp.wu
202  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
203  * p2p ioctls revised.
204  *
205  * 05 11 2010 cp.wu
206  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
207  * add ioctl for controlling p2p scan phase parameters
208  *
209 */
210
211 #ifndef _GL_P2P_IOCTL_H
212 #define _GL_P2P_IOCTL_H
213
214 /*******************************************************************************
215 *                         C O M P I L E R   F L A G S
216 ********************************************************************************
217 */
218
219 /*******************************************************************************
220 *                    E X T E R N A L   R E F E R E N C E S
221 ********************************************************************************
222 */
223 #include <linux/kernel.h>
224 #include <linux/netdevice.h>
225 #include <linux/wireless.h>
226 #if CFG_ENABLE_WIFI_DIRECT_CFG_80211
227     #include <linux/ieee80211.h>
228     #include <net/cfg80211.h>
229 #endif
230
231 #include "wlan_oid.h"
232
233 /*******************************************************************************
234 *                              C O N S T A N T S
235 ********************************************************************************
236 */
237
238 // (WirelessExtension) Private I/O Controls
239 #define IOC_P2P_CFG_DEVICE              (SIOCIWFIRSTPRIV+0)
240 #define IOC_P2P_PROVISION_COMPLETE      (SIOCIWFIRSTPRIV+2)
241 #define IOC_P2P_START_STOP_DISCOVERY    (SIOCIWFIRSTPRIV+4)
242 #define IOC_P2P_DISCOVERY_RESULTS       (SIOCIWFIRSTPRIV+5)
243 #define IOC_P2P_WSC_BEACON_PROBE_RSP_IE (SIOCIWFIRSTPRIV+6)
244 #define IOC_P2P_GO_WSC_IE               IOC_P2P_WSC_BEACON_PROBE_RSP_IE
245 #define IOC_P2P_CONNECT_DISCONNECT      (SIOCIWFIRSTPRIV+8)
246 #define IOC_P2P_PASSWORD_READY          (SIOCIWFIRSTPRIV+10)
247 //#define IOC_P2P_SET_PWR_MGMT_PARAM      (SIOCIWFIRSTPRIV+12)
248 #define IOC_P2P_SET_INT                 (SIOCIWFIRSTPRIV+12)
249 #define IOC_P2P_GET_STRUCT              (SIOCIWFIRSTPRIV+13)
250 #define IOC_P2P_SET_STRUCT              (SIOCIWFIRSTPRIV+14)
251 #define IOC_P2P_GET_REQ_DEVICE_INFO     (SIOCIWFIRSTPRIV+15)
252
253 #define PRIV_CMD_INT_P2P_SET            0
254
255 // IOC_P2P_PROVISION_COMPLETE (iw_point . flags)
256 #define P2P_PROVISIONING_SUCCESS        0
257 #define P2P_PROVISIONING_FAIL           1
258
259 // IOC_P2P_START_STOP_DISCOVERY (iw_point . flags)
260 #define P2P_STOP_DISCOVERY              0
261 #define P2P_START_DISCOVERY             1
262
263 // IOC_P2P_CONNECT_DISCONNECT (iw_point . flags)
264 #define P2P_CONNECT                     0
265 #define P2P_DISCONNECT                  1
266
267 // IOC_P2P_START_STOP_DISCOVERY (scan_type)
268 #define P2P_SCAN_FULL_AND_FIND          0
269 #define P2P_SCAN_FULL                   1
270 #define P2P_SCAN_SEARCH_AND_LISTEN      2
271 #define P2P_LISTEN                      3
272
273 // IOC_P2P_GET_STRUCT/IOC_P2P_SET_STRUCT
274 #define P2P_SEND_SD_RESPONSE            0
275 #define P2P_GET_SD_REQUEST              1
276 #define P2P_SEND_SD_REQUEST             2
277 #define P2P_GET_SD_RESPONSE             3
278 #define P2P_TERMINATE_SD_PHASE          4
279
280 /*******************************************************************************
281 *                             D A T A   T Y P E S
282 ********************************************************************************
283 */
284 /*----------------------------------------------------------------------------*/
285 /* Wireless Extension: Private I/O Control                                    */
286 /*----------------------------------------------------------------------------*/
287 typedef struct iw_p2p_cfg_device_type {
288     void __user     *ssid;
289     UINT_8          ssid_len;
290     UINT_8          pri_device_type[8];
291     UINT_8          snd_device_type[8];
292     void __user     *device_name;
293     UINT_8          device_name_len;
294     UINT_8          intend;
295     UINT_8          persistence;
296     UINT_8          sec_mode;
297     UINT_8          ch;
298     UINT_8          ch_width; /* 0: 20 Mhz  1:20/40 Mhz auto */
299     UINT_8          max_scb;
300 } IW_P2P_CFG_DEVICE_TYPE, *P_IW_P2P_CFG_DEVICE_TYPE;
301
302 typedef struct iw_p2p_hostapd_param {
303     UINT_8  cmd;
304     UINT_8  rsv[3];
305     UINT_8  sta_addr[6];
306     void __user   *data;
307     UINT_16       len;
308 } IW_P2P_HOSTAPD_PARAM, *P_IW_P2P_HOSTAPD_PARAM;
309
310 typedef struct iw_p2p_req_device_type {
311     UINT_8      scan_type;  /* 0: Full scan + Find
312                              * 1: Full scan
313                              * 2: Scan (Search +Listen)
314                              * 3: Listen
315                              * other : reserved
316                              */
317     UINT_8      pri_device_type[8];
318     void __user *probe_req_ie;
319     UINT_16     probe_req_len;
320     void __user *probe_rsp_ie;
321     UINT_16     probe_rsp_len;
322 } IW_P2P_REQ_DEVICE_TYPE, *P_IW_P2P_REQ_DEVICE_TYPE;
323
324 typedef struct iw_p2p_connect_device {
325     UINT_8  sta_addr[6];
326     UINT_8  p2pRole;        /* 0: P2P Device, 1:GC, 2: GO */
327     UINT_8  needProvision;  /* 0: Don't needed provision, 1: doing the wsc provision first */
328     UINT_8  authPeer;       /* 1: auth peer invitation request */
329     UINT_8  intend_config_method; /* Request Peer Device used config method */
330 } IW_P2P_CONNECT_DEVICE, *P_IW_P2P_CONNECT_DEVICE;
331
332 typedef struct iw_p2p_password_ready {
333     UINT_8      active_config_method;
334     void __user *probe_req_ie;
335     UINT_16     probe_req_len;
336     void __user *probe_rsp_ie;
337     UINT_16     probe_rsp_len;
338 } IW_P2P_PASSWORD_READY, *P_IW_P2P_PASSWORD_READY;
339
340 typedef struct iw_p2p_device_req {
341     UINT_8      name[33];
342     UINT_32     name_len;
343     UINT_8      device_addr[6];
344     UINT_8      device_type;
345     INT_32      config_method;
346     INT_32      active_config_method;
347 } IW_P2P_DEVICE_REQ, *P_IW_P2P_DEVICE_REQ;
348
349 typedef struct iw_p2p_transport_struct {
350     UINT_32 u4CmdId;
351     UINT_32 inBufferLength;
352     UINT_32 outBufferLength;
353     UINT_8  aucBuffer[16];
354 } IW_P2P_TRANSPORT_STRUCT, *P_IW_P2P_TRANSPORT_STRUCT;
355
356 // For Invitation
357 typedef struct iw_p2p_ioctl_invitation_struct {
358     UINT_8 aucDeviceID[6];
359     UINT_8 aucGroupID[6];  // BSSID
360     UINT_8 aucSsid[32];
361     UINT_32 u4SsidLen;
362     UINT_8 ucReinvoke;
363 } IW_P2P_IOCTL_INVITATION_STRUCT, *P_IW_P2P_IOCTL_INVITATION_STRUCT;
364
365 typedef struct iw_p2p_ioctl_abort_invitation {
366     UINT_8  dev_addr[6];
367 } IW_P2P_IOCTL_ABORT_INVITATION, *P_IW_P2P_IOCTL_ABORT_INVITATION;
368
369 typedef struct iw_p2p_ioctl_invitation_indicate {
370     UINT_8  dev_addr[6];
371         UINT_8  group_bssid[6];
372     INT_32  config_method;     /* peer device supported config method */
373     UINT_8  dev_name[32];      /* for reinvoke */
374     UINT_32 name_len;
375     UINT_8  operating_channel; /* for re-invoke, target operating channel */
376     UINT_8  invitation_type;   /* invitation or re-invoke */
377 } IW_P2P_IOCTL_INVITATION_INDICATE, *P_IW_P2P_IOCTL_INVITATION_INDICATE;
378
379 typedef struct iw_p2p_ioctl_invitation_status {
380     UINT_32 status_code;
381 } IW_P2P_IOCTL_INVITATION_STATUS, *P_IW_P2P_IOCTL_INVITATION_STATUS;
382
383 //For Formation
384 typedef struct iw_p2p_ioctl_start_formation {
385    UINT_8  dev_addr[6];         /* bssid */
386    UINT_8  role;                /* 0: P2P Device, 1:GC, 2: GO */
387    UINT_8  needProvision;       /* 0: Don't needed provision, 1: doing the wsc provision first */
388    UINT_8  auth;                /* 1: auth peer invitation request */
389    UINT_8  config_method;       /* Request Peer Device used config method */
390 }IW_P2P_IOCTL_START_FORMATION, *P_IW_P2P_IOCTL_START_FORMATION;
391
392 /* SET_STRUCT / GET_STRUCT */
393 typedef enum _ENUM_P2P_CMD_ID_T {
394     P2P_CMD_ID_SEND_SD_RESPONSE = 0,               /* 0x00 (Set) */
395     P2P_CMD_ID_GET_SD_REQUEST,                     /* 0x01 (Get) */
396     P2P_CMD_ID_SEND_SD_REQUEST,                    /* 0x02 (Set) */
397     P2P_CMD_ID_GET_SD_RESPONSE,                    /* 0x03 (Get) */
398     P2P_CMD_ID_TERMINATE_SD_PHASE,                 /* 0x04 (Set) */
399 #if 1 /* CFG_SUPPORT_ANTI_PIRACY */
400     P2P_CMD_ID_SEC_CHECK,                          /* 0x05(Set) */
401 #endif
402     P2P_CMD_ID_INVITATION,                         /* 0x06 (Set) */
403     P2P_CMD_ID_INVITATION_INDICATE,                /* 0x07 (Get) */
404     P2P_CMD_ID_INVITATION_STATUS,                  /* 0x08 (Get) */
405     P2P_CMD_ID_INVITATION_ABORT,                   /* 0x09 (Set) */
406     P2P_CMD_ID_START_FORMATION,                    /* 0x0A (Set) */
407     P2P_CMD_ID_P2P_VERSION,                            /* 0x0B (Set/Get) */
408     P2P_CMD_ID_GET_CH_LIST = 12,                   /* 0x0C (Get) */
409     P2P_CMD_ID_GET_OP_CH = 14                      /* 0x0E (Get) */
410 } ENUM_P2P_CMD_ID_T, *P_ENUM_P2P_CMD_ID_T;
411
412 /* Service Discovery */
413 typedef struct iw_p2p_cmd_send_sd_response {
414     PARAM_MAC_ADDRESS   rReceiverAddr;
415     UINT_8              fgNeedTxDoneIndication;
416     UINT_8              ucSeqNum;
417     UINT_16                 u2PacketLength;
418     UINT_8              aucPacketContent[0]; /*native 802.11*/
419 } IW_P2P_CMD_SEND_SD_RESPONSE, *P_IW_P2P_CMD_SEND_SD_RESPONSE;
420
421 typedef struct iw_p2p_cmd_get_sd_request {
422     PARAM_MAC_ADDRESS   rTransmitterAddr;
423     UINT_16                 u2PacketLength;
424     UINT_8              aucPacketContent[0]; /*native 802.11*/
425 } IW_P2P_CMD_GET_SD_REQUEST, *P_IW_P2P_CMD_GET_SD_REQUEST;
426
427 typedef struct iw_p2p_cmd_send_service_discovery_request {
428     PARAM_MAC_ADDRESS   rReceiverAddr;
429     UINT_8              fgNeedTxDoneIndication;
430     UINT_8              ucSeqNum;
431     UINT_16             u2PacketLength;
432     UINT_8              aucPacketContent[0]; /*native 802.11*/
433 } IW_P2P_CMD_SEND_SD_REQUEST, *P_IW_P2P_CMD_SEND_SD_REQUEST;
434
435 typedef struct iw_p2p_cmd_get_sd_response {
436     PARAM_MAC_ADDRESS   rTransmitterAddr;
437     UINT_16             u2PacketLength;
438     UINT_8              aucPacketContent[0]; /*native 802.11*/
439 } IW_P2P_CMD_GET_SD_RESPONSE, *P_IW_P2P_CMD_GET_SD_RESPONSE;
440
441 typedef struct iw_p2p_cmd_terminate_sd_phase {
442     PARAM_MAC_ADDRESS   rPeerAddr;
443 } IW_P2P_CMD_TERMINATE_SD_PHASE, *P_IW_P2P_CMD_TERMINATE_SD_PHASE;
444
445 typedef struct iw_p2p_version {
446     UINT_32 u4Version;
447 } IW_P2P_VERSION, *P_IW_P2P_VERSION;
448
449 /*******************************************************************************
450 *                            P U B L I C   D A T A
451 ********************************************************************************
452 */
453
454 /*******************************************************************************
455 *                           P R I V A T E   D A T A
456 ********************************************************************************
457 */
458
459 /*******************************************************************************
460 *                                 M A C R O S
461 ********************************************************************************
462 */
463 /* Macros used for cfg80211 */
464 #define RATETAB_ENT(_rate, _rateid, _flags) \
465     {                                       \
466         .bitrate    = (_rate),              \
467         .hw_value   = (_rateid),            \
468         .flags      = (_flags),             \
469     }
470
471 #define CHAN2G(_channel, _freq, _flags)             \
472     {                                               \
473         .band               = IEEE80211_BAND_2GHZ,  \
474         .center_freq        = (_freq),              \
475         .hw_value           = (_channel),           \
476         .flags              = (_flags),             \
477         .max_antenna_gain   = 0,                    \
478         .max_power          = 30,                   \
479     }
480
481 #define CHAN5G(_channel, _flags)                        \
482     {                                                   \
483         .band               = IEEE80211_BAND_5GHZ,      \
484         .center_freq        = 5000 + (5 * (_channel)),  \
485         .hw_value           = (_channel),               \
486         .flags              = (_flags),                 \
487         .max_antenna_gain   = 0,                        \
488         .max_power          = 30,                       \
489     }
490
491 /*******************************************************************************
492 *                  F U N C T I O N   D E C L A R A T I O N S
493 ********************************************************************************
494 */
495
496 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) && (CFG_ENABLE_WIFI_DIRECT_CFG_80211 != 0)
497 int mtk_p2p_cfg80211_change_iface(
498     struct wiphy *wiphy,
499     struct net_device *ndev,
500     enum nl80211_iftype type, u32 *flags,
501     struct vif_params *params
502     );
503
504 int mtk_p2p_cfg80211_add_key(
505     struct wiphy *wiphy,
506     struct net_device *ndev,
507     u8 key_index,
508     bool pairwise,
509     const u8 *mac_addr,
510     struct key_params *params
511     );
512
513 int mtk_p2p_cfg80211_get_key(
514     struct wiphy *wiphy,
515     struct net_device *ndev,
516     u8 key_index,
517     bool pairwise,
518     const u8 *mac_addr,
519     void *cookie,
520     void (*callback)(void *cookie, struct key_params*)
521     );
522
523 int mtk_p2p_cfg80211_del_key(
524     struct wiphy *wiphy,
525     struct net_device *ndev,
526     u8 key_index,
527     bool pairwise,
528     const u8 *mac_addr
529     );
530
531 int
532 mtk_p2p_cfg80211_set_default_key(
533     struct wiphy *wiphy,
534     struct net_device *netdev,
535     u8 key_index,
536     bool unicast,
537     bool multicast
538     );
539
540
541 int mtk_p2p_cfg80211_get_station(
542     struct wiphy *wiphy,
543     struct net_device *ndev,
544     u8 *mac,
545     struct station_info *sinfo
546     );
547
548 int mtk_p2p_cfg80211_scan(
549     struct wiphy *wiphy,
550     struct net_device *ndev,
551     struct cfg80211_scan_request *request
552     );
553
554 int mtk_p2p_cfg80211_set_wiphy_params(
555     struct wiphy *wiphy,
556     u32 changed
557     );
558
559 int mtk_p2p_cfg80211_connect(
560     struct wiphy *wiphy,
561     struct net_device *dev,
562     struct cfg80211_connect_params *sme
563     );
564
565 int mtk_p2p_cfg80211_disconnect(
566     struct wiphy *wiphy,
567     struct net_device *dev,
568     u16 reason_code
569     );
570
571 int mtk_p2p_cfg80211_join_ibss(
572     struct wiphy *wiphy,
573     struct net_device *dev,
574     struct cfg80211_ibss_params *params
575     );
576
577 int mtk_p2p_cfg80211_leave_ibss(
578     struct wiphy *wiphy,
579     struct net_device *dev
580     );
581
582 int mtk_p2p_cfg80211_set_txpower(
583     struct wiphy *wiphy,
584     enum nl80211_tx_power_setting type,
585     int mbm
586     );
587
588 int mtk_p2p_cfg80211_get_txpower(
589     struct wiphy *wiphy,
590     int *dbm
591     );
592
593 int mtk_p2p_cfg80211_set_power_mgmt(
594     struct wiphy *wiphy,
595     struct net_device *dev,
596     bool enabled,
597     int timeout
598     );
599
600 int
601 mtk_p2p_cfg80211_change_bss(
602     struct wiphy * wiphy,
603     struct net_device * dev,
604     struct bss_parameters * params
605     );
606
607 int
608 mtk_p2p_cfg80211_remain_on_channel(
609     struct wiphy * wiphy,
610     struct net_device * dev,
611     struct ieee80211_channel * chan,
612     enum nl80211_channel_type channel_type,
613     unsigned int duration,
614     u64 * cookie
615     );
616
617 int
618 mtk_p2p_cfg80211_cancel_remain_on_channel(
619     struct wiphy * wiphy,
620     struct net_device * dev,
621     u64 cookie
622     );
623
624 int
625 mtk_p2p_cfg80211_deauth(
626     struct wiphy * wiphy,
627     struct net_device * dev,
628     struct cfg80211_deauth_request * req
629 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
630     , void *cookie
631 #endif
632     );
633
634
635 int
636 mtk_p2p_cfg80211_disassoc(
637     struct wiphy * wiphy,
638     struct net_device * dev,
639     struct cfg80211_disassoc_request * req
640 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
641     , void *cookie
642 #endif
643     );
644 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
645
646 int
647 mtk_p2p_cfg80211_start_ap(
648     struct wiphy *wiphy, 
649     struct net_device *dev,
650     struct cfg80211_ap_settings *settings
651     );
652
653
654 int
655 mtk_p2p_cfg80211_change_beacon(
656     struct wiphy *wiphy,
657     struct net_device *dev,
658     struct cfg80211_beacon_data *info
659     );
660
661 int
662 mtk_p2p_cfg80211_mgmt_tx(
663     struct wiphy *wiphy,
664     struct net_device *dev,
665     struct ieee80211_channel *chan,
666     bool offchan,
667     enum nl80211_channel_type channel_type,
668     bool channel_type_valid,
669     unsigned int wait,
670     const u8 *buf, 
671     size_t len, 
672     bool no_cck,
673     bool dont_wait_for_ack,
674     u64 *cookie);
675
676 #else
677 int
678 mtk_p2p_cfg80211_add_set_beacon(
679     struct wiphy *wiphy,
680     struct net_device *dev,
681     struct beacon_parameters *info
682     );
683
684 int
685 mtk_p2p_cfg80211_mgmt_tx(
686     struct wiphy * wiphy,
687     struct net_device * dev,
688     struct ieee80211_channel * chan,
689     bool offchan,
690     enum nl80211_channel_type channel_type,
691     bool channel_type_valid,
692     unsigned int wait,
693     const u8 * buf,
694     size_t len,
695     u64 *cookie
696     );
697
698 #endif
699 int
700 mtk_p2p_cfg80211_mgmt_tx_cancel_wait (
701     struct wiphy *wiphy,
702     struct net_device *ndev,
703     u64 cookie
704     );
705
706
707 int
708 mtk_p2p_cfg80211_stop_ap(
709     struct wiphy * wiphy,
710     struct net_device * dev
711     );
712
713
714
715 int
716 mtk_p2p_cfg80211_del_station(
717     struct wiphy * wiphy,
718     struct net_device * dev,
719     u8 * mac
720     );
721
722 int
723 mtk_p2p_cfg80211_set_channel(
724     IN struct wiphy * wiphy,
725     IN struct net_device * dev,
726     IN struct ieee80211_channel * chan,
727     IN enum nl80211_channel_type channel_type
728     );
729
730 int
731 mtk_p2p_cfg80211_set_bitrate_mask(
732     IN struct wiphy *wiphy,
733     IN struct net_device *dev,
734     IN const u8 *peer,
735     IN const struct cfg80211_bitrate_mask *mask
736     );
737
738
739 void
740 mtk_p2p_cfg80211_mgmt_frame_register(
741     IN struct wiphy *wiphy,
742     IN struct net_device *dev,
743     IN u16 frame_type,
744     IN bool reg
745     );
746
747 #if CONFIG_NL80211_TESTMODE
748 int
749 mtk_p2p_cfg80211_testmode_cmd(
750     IN struct wiphy *wiphy,
751     IN void *data,
752     IN int len
753     );
754 int
755 mtk_p2p_cfg80211_testmode_p2p_sigma_pre_cmd(
756     IN struct wiphy *wiphy,
757     IN void *data,
758     IN int len
759     );
760 int
761 mtk_p2p_cfg80211_testmode_p2p_sigma_cmd(
762     IN struct wiphy *wiphy,
763     IN void *data,
764     IN int len
765     );
766
767 #if CFG_SUPPORT_WFD
768 int
769 mtk_p2p_cfg80211_testmode_wfd_update_cmd(
770     IN struct wiphy *wiphy,
771     IN void *data,
772     IN int len
773     );
774 #endif
775
776 int
777 mtk_p2p_cfg80211_testmode_hotspot_block_list_cmd(
778     IN struct wiphy *wiphy,
779     IN void *data,
780     IN int len
781     );
782 #else
783     #error "Please ENABLE kernel config (CONFIG_NL80211_TESTMODE) to support Wi-Fi Direct"
784 #endif
785
786 #endif
787
788 /* I/O control handlers */
789
790 int
791 mtk_p2p_wext_get_priv (
792     IN struct net_device *prDev,
793     IN struct iw_request_info *info,
794     IN OUT union iwreq_data *wrqu,
795     IN OUT char *extra
796     );
797
798 int
799 mtk_p2p_wext_reconnect (
800     IN struct net_device *prDev,
801     IN struct iw_request_info *info,
802     IN OUT union iwreq_data *wrqu,
803     IN OUT char *extra
804     );
805
806 int
807 mtk_p2p_wext_set_auth (
808     IN struct net_device *prDev,
809     IN struct iw_request_info *info,
810     IN OUT union iwreq_data *wrqu,
811     IN OUT char *extra
812     );
813
814 int
815 mtk_p2p_wext_set_key (
816     IN struct net_device *prDev,
817     IN struct iw_request_info *info,
818     IN OUT union iwreq_data *wrqu,
819     IN OUT char *extra
820     );
821
822 int
823 mtk_p2p_wext_mlme_handler(
824     IN struct net_device *prDev,
825     IN struct iw_request_info *info,
826     IN OUT union iwreq_data *wrqu,
827     IN OUT char *extra
828     );
829
830 int
831 mtk_p2p_wext_set_powermode(
832     IN struct net_device *prDev,
833     IN struct iw_request_info *info,
834     IN OUT union iwreq_data *wrqu,
835     IN OUT char *extra
836     );
837
838 int
839 mtk_p2p_wext_get_powermode(
840     IN struct net_device *prDev,
841     IN struct iw_request_info *info,
842     IN OUT union iwreq_data *wrqu,
843     IN OUT char *extra
844     );
845
846 /* Private Wireless I/O Controls takes use of iw_handler */
847 int
848 mtk_p2p_wext_set_local_dev_info(
849     IN struct net_device *prDev,
850     IN struct iw_request_info *info,
851     IN OUT union iwreq_data *wrqu,
852     IN OUT char *extra
853     );
854
855 int
856 mtk_p2p_wext_set_provision_complete(
857     IN struct net_device *prDev,
858     IN struct iw_request_info *info,
859     IN OUT union iwreq_data *wrqu,
860     IN OUT char *extra
861     );
862
863 int
864 mtk_p2p_wext_start_stop_discovery(
865     IN struct net_device *prDev,
866     IN struct iw_request_info *info,
867     IN OUT union iwreq_data *wrqu,
868     IN OUT char *extra
869     );
870
871 int
872 mtk_p2p_wext_discovery_results(
873     IN struct net_device *prDev,
874     IN struct iw_request_info *info,
875     IN OUT union iwreq_data *wrqu,
876     IN OUT char *extra
877     );
878
879 int
880 mtk_p2p_wext_wsc_ie(
881     IN struct net_device *prDev,
882     IN struct iw_request_info *info,
883     IN OUT union iwreq_data *wrqu,
884     IN OUT char *extra
885     );
886
887 int
888 mtk_p2p_wext_connect_disconnect(
889     IN struct net_device *prDev,
890     IN struct iw_request_info *info,
891     IN OUT union iwreq_data *wrqu,
892     IN OUT char *extra
893     );
894
895 int
896 mtk_p2p_wext_password_ready(
897     IN struct net_device *prDev,
898     IN struct iw_request_info *info,
899     IN OUT union iwreq_data *wrqu,
900     IN OUT char *extra
901     );
902
903 int
904 mtk_p2p_wext_request_dev_info(
905     IN struct net_device *prDev,
906     IN struct iw_request_info *info,
907     IN OUT union iwreq_data *wrqu,
908     IN OUT char *extra
909     );
910
911 int
912 mtk_p2p_wext_invitation_indicate(
913     IN struct net_device *prDev,
914     IN struct iw_request_info *info,
915     IN OUT union iwreq_data *wrqu,
916     IN OUT char *extra
917     );
918
919 int
920 mtk_p2p_wext_invitation_status(
921     IN struct net_device *prDev,
922     IN struct iw_request_info *info,
923     IN OUT union iwreq_data *wrqu,
924     IN OUT char *extra
925     );
926
927 int
928 mtk_p2p_wext_set_pm_param (
929     IN struct net_device *prDev,
930     IN struct iw_request_info *info,
931     IN OUT union iwreq_data *wrqu,
932     IN OUT char *extra
933     );
934
935 int
936 mtk_p2p_wext_set_ps_profile (
937     IN struct net_device *prDev,
938     IN struct iw_request_info *info,
939     IN OUT union iwreq_data *wrqu,
940     IN OUT char *extra
941     );
942
943 int
944 mtk_p2p_wext_set_network_address (
945     IN struct net_device *prDev,
946     IN struct iw_request_info *info,
947     IN OUT union iwreq_data *wrqu,
948     IN OUT char *extra
949     );
950
951 int
952 mtk_p2p_wext_set_int (
953     IN struct net_device *prDev,
954     IN struct iw_request_info *info,
955     IN OUT union iwreq_data *wrqu,
956     IN OUT char *extra
957     );
958
959 /* Private Wireless I/O Controls for IOC_SET_STRUCT/IOC_GET_STRUCT */
960 int
961 mtk_p2p_wext_set_struct (
962     IN struct net_device *prDev,
963     IN struct iw_request_info *info,
964     IN OUT union iwreq_data *wrqu,
965     IN OUT char *extra
966     );
967
968 int
969 mtk_p2p_wext_get_struct (
970     IN struct net_device *prDev,
971     IN struct iw_request_info *info,
972     IN OUT union iwreq_data *wrqu,
973     IN OUT char *extra
974     );
975
976 /* IOC_SET_STRUCT/IOC_GET_STRUCT: Service Discovery */
977 int
978 mtk_p2p_wext_get_service_discovery_request (
979     IN struct net_device *prDev,
980     IN struct iw_request_info *info,
981     IN OUT union iwreq_data *wrqu,
982     IN OUT char *extra
983     );
984
985 int
986 mtk_p2p_wext_get_service_discovery_response (
987     IN struct net_device *prDev,
988     IN struct iw_request_info *info,
989     IN OUT union iwreq_data *wrqu,
990     IN OUT char *extra
991     );
992
993 int
994 mtk_p2p_wext_send_service_discovery_request (
995     IN struct net_device *prDev,
996     IN struct iw_request_info *info,
997     IN OUT union iwreq_data *wrqu,
998     IN OUT char *extra
999     );
1000
1001 int
1002 mtk_p2p_wext_send_service_discovery_response (
1003     IN struct net_device *prDev,
1004     IN struct iw_request_info *info,
1005     IN OUT union iwreq_data *wrqu,
1006     IN OUT char *extra
1007     );
1008
1009 int
1010 mtk_p2p_wext_terminate_service_discovery_phase (
1011     IN struct net_device *prDev,
1012     IN struct iw_request_info *info,
1013     IN OUT union iwreq_data *wrqu,
1014     IN OUT char *extra
1015     );
1016
1017 #if CFG_SUPPORT_ANTI_PIRACY
1018 int
1019 mtk_p2p_wext_set_sec_check_request (
1020     IN struct net_device *prDev,
1021     IN struct iw_request_info *info,
1022     IN OUT union iwreq_data *wrqu,
1023     IN OUT char *extra
1024     );
1025
1026 int
1027 mtk_p2p_wext_get_sec_check_response (
1028     IN struct net_device *prDev,
1029     IN struct iw_request_info *info,
1030     IN OUT union iwreq_data *wrqu,
1031     IN OUT char *extra
1032     );
1033 #endif
1034
1035 int
1036 mtk_p2p_wext_set_noa_param (
1037     IN struct net_device *prDev,
1038     IN struct iw_request_info *info,
1039     IN OUT union iwreq_data *wrqu,
1040     IN OUT char *extra
1041     );
1042
1043 int
1044 mtk_p2p_wext_set_oppps_param (
1045     IN struct net_device *prDev,
1046     IN struct iw_request_info *info,
1047     IN OUT union iwreq_data *wrqu,
1048     IN OUT char *extra
1049     );
1050
1051 int
1052 mtk_p2p_wext_set_p2p_version(
1053     IN struct net_device *prDev,
1054     IN struct iw_request_info *info,
1055     IN OUT union iwreq_data *wrqu,
1056     IN OUT char *extra
1057     );
1058
1059 int
1060 mtk_p2p_wext_get_p2p_version(
1061     IN struct net_device *prDev,
1062     IN struct iw_request_info *info,
1063     IN OUT union iwreq_data *wrqu,
1064     IN OUT char *extra
1065     );
1066
1067
1068 void
1069 mtk_p2p_wext_set_Multicastlist(
1070     IN P_GLUE_INFO_T prGlueInfo
1071     );
1072
1073 #if CFG_SUPPORT_P2P_RSSI_QUERY
1074 int
1075 mtk_p2p_wext_get_rssi(
1076     IN struct net_device *prDev,
1077     IN struct iw_request_info *info,
1078     IN OUT union iwreq_data *wrqu,
1079     IN OUT char *extra
1080     );
1081
1082 struct iw_statistics *
1083 mtk_p2p_wext_get_wireless_stats(
1084     struct net_device *prDev
1085     );
1086
1087 #endif
1088
1089 int
1090 mtk_p2p_wext_set_txpow(
1091     IN struct net_device *prDev,
1092     IN struct iw_request_info *prIwrInfo,
1093     IN OUT union iwreq_data *prTxPow,
1094     IN char *pcExtra
1095     );
1096
1097
1098 /*******************************************************************************
1099 *                              F U N C T I O N S
1100 ********************************************************************************
1101 */
1102
1103 #endif /* _GL_P2P_IOCTL_H */
1104