add MTK-combo-module,continue with commit 17f39ed917874e77e80411f33faba1b7ee8138c8
[firefly-linux-kernel-4.4.55.git] / drivers / mtk_wcn_combo / drv_wlan / wlan / os / linux / include / gl_os.h
1 /*
2 ** $Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_2/os/linux/include/gl_os.h#2 $
3 */
4
5 /*! \file   gl_os.h
6     \brief  List the external reference to OS for GLUE Layer.
7
8     In this file we define the data structure - GLUE_INFO_T to store those objects
9     we acquired from OS - e.g. TIMER, SPINLOCK, NET DEVICE ... . And all the
10     external reference (header file, extern func() ..) to OS for GLUE Layer should
11     also list down here.
12 */
13
14 /*******************************************************************************
15 * Copyright (c) 2007 MediaTek Inc.
16 *
17 * All rights reserved. Copying, compilation, modification, distribution
18 * or any other use whatsoever of this material is strictly prohibited
19 * except in accordance with a Software License Agreement with
20 * MediaTek Inc.
21 ********************************************************************************
22 */
23
24 /*******************************************************************************
25 * LEGAL DISCLAIMER
26 *
27 * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND
28 * AGREES THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK
29 * SOFTWARE") RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
30 * PROVIDED TO BUYER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY
31 * DISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
32 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
33 * PARTICULAR PURPOSE OR NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE
34 * ANY WARRANTY WHATSOEVER WITH RESPECT TO THE SOFTWARE OF ANY THIRD PARTY
35 * WHICH MAY BE USED BY, INCORPORATED IN, OR SUPPLIED WITH THE MEDIATEK
36 * SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH THIRD PARTY FOR ANY
37 * WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE
38 * FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S SPECIFICATION OR TO
39 * CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
40 *
41 * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
42 * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL
43 * BE, AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT
44 * ISSUE, OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
45 * BUYER TO MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
46 *
47 * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
48 * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT
49 * OF LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING
50 * THEREOF AND RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN
51 * FRANCISCO, CA, UNDER THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE
52 * (ICC).
53 ********************************************************************************
54 */
55
56 /*
57 ** $Log: gl_os.h $
58  *
59  * 01 09 2012 terry.wu
60  * [WCXRP00001166] [Wi-Fi] [Driver] cfg80211 integration for p2p newtork
61  * cfg80211 integration for p2p network.
62  *
63  * 01 09 2012 wh.su
64  * [WCXRP00001153] [MT6620 Wi-Fi][Driver] Adding the get_ch_list and set_tx_power proto type function
65  * Check in the Add Tx power Cmd to driver.
66  *
67  * 12 13 2011 cm.chang
68  * [WCXRP00001136] [All Wi-Fi][Driver] Add wake lock for pending timer
69  * Add wake lock if timer timeout value is smaller than 5 seconds
70  *
71  * 11 19 2011 yuche.tsai
72  * NULL
73  * Fix type conflict.
74  *
75  * 11 19 2011 yuche.tsai
76  * NULL
77  * Add P2P RSSI Link Quality Query Support. (Default Off)
78  *
79  * 11 16 2011 yuche.tsai
80  * NULL
81  * Avoid using work thread.
82  *
83  * 11 11 2011 yuche.tsai
84  * NULL
85  * Fix work thread cancel issue.
86  *
87  * 10 19 2011 yuche.tsai
88  * [WCXRP00001045] [WiFi Direct][Driver] Check 2.1 branch.
89  * Branch 2.1
90  * Davinci Maintrunk Label: MT6620_WIFI_DRIVER_FW_TRUNK_MT6620E5_111019_0926.
91  *
92  * 04 18 2011 terry.wu
93  * [WCXRP00000660] [MT6620 Wi-Fi][Driver] Remove flag CFG_WIFI_DIRECT_MOVED
94  * Remove flag CFG_WIFI_DIRECT_MOVED.
95  *
96  * 04 14 2011 cp.wu
97  * [WCXRP00000598] [MT6620 Wi-Fi][Driver] Implementation of interface for communicating with user space process for RESET_START and RESET_END events
98  * sync. whole-chip resetting mechanism to V2.0 branch.
99  *
100  * 03 18 2011 cp.wu
101  * [WCXRP00000577] [MT6620 Wi-Fi][Driver][FW] Create V2.0 branch for firmware and driver
102  * create V2.0 driver release based on label "MT6620_WIFI_DRIVER_V2_0_110318_1600" from main trunk
103  *
104  * 03 17 2011 chinglan.wang
105  * [WCXRP00000570] [MT6620 Wi-Fi][Driver] Add Wi-Fi Protected Setup v2.0 feature
106  * .
107  *
108  * 03 03 2011 jeffrey.chang
109  * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue
110  * support concurrent network
111  *
112  * 03 03 2011 jeffrey.chang
113  * [WCXRP00000512] [MT6620 Wi-Fi][Driver] modify the net device relative functions to support the H/W multiple queue
114  * modify net device relative functions to support multiple H/W queues
115  *
116  * 03 02 2011 wh.su
117  * [WCXRP00000506] [MT6620 Wi-Fi][Driver][FW] Add Security check related code
118  * Add security check code.
119  *
120  * 02 21 2011 cp.wu
121  * [WCXRP00000482] [MT6620 Wi-Fi][Driver] Simplify logic for checking NVRAM existence in driver domain
122  * simplify logic for checking NVRAM existence only once.
123  *
124  * 02 16 2011 jeffrey.chang
125  * NULL
126  * Add query ipv4 and ipv6 address during early suspend and late resume
127  *
128  * 02 10 2011 chinghwa.yu
129  * [WCXRP00000065] Update BoW design and settings
130  * Fix kernel API change issue.
131  * Before ALPS 2.2 (2.2 included), kfifo_alloc() is
132  * struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, spinlock_t *lock);
133  * After ALPS 2.3, kfifo_alloc() is changed to
134  * int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask);
135  *
136  * 02 09 2011 wh.su
137  * [WCXRP00000433] [MT6620 Wi-Fi][Driver] Remove WAPI structure define for avoid P2P module with structure miss-align pointer issue
138  * always pre-allio WAPI related structure for align p2p module.
139  *
140  * 02 09 2011 terry.wu
141  * [WCXRP00000383] [MT6620 Wi-Fi][Driver] Separate WiFi and P2P driver into two modules
142  * Halt p2p module init and exit until TxThread finished p2p register and unregister.
143  *
144  * 02 01 2011 cm.chang
145  * [WCXRP00000415] [MT6620 Wi-Fi][Driver] Check if any memory leakage happens when uninitializing in DGB mode
146  * .
147  *
148  * 01 27 2011 cm.chang
149  * [WCXRP00000402] [MT6620 Wi-Fi][Driver] Enable MCR read/write by iwpriv by default
150  * .
151  *
152  * 01 12 2011 cp.wu
153  * [WCXRP00000357] [MT6620 Wi-Fi][Driver][Bluetooth over Wi-Fi] add another net device interface for BT AMP
154  * implementation of separate BT_OVER_WIFI data path.
155  *
156  * 01 12 2011 cp.wu
157  * [WCXRP00000356] [MT6620 Wi-Fi][Driver] fill mac header length for security frames 'cause hardware header translation needs such information
158  * fill mac header length information for 802.1x frames.
159  *
160  * 01 11 2011 chinglan.wang
161  * NULL
162  * Modify to reslove the CR :[ALPS00028994] Use WEP security to connect Marvell 11N AP.  Connection establish successfully.
163  * Use the WPS function to connect AP, the privacy bit always is set to 1.
164  *
165  * 01 10 2011 cp.wu
166  * [WCXRP00000349] [MT6620 Wi-Fi][Driver] make kalIoctl() of linux port as a thread safe API to avoid potential issues due to multiple access
167  * use mutex to protect kalIoctl() for thread safe.
168  *
169  * 01 05 2011 cp.wu
170  * [WCXRP00000283] [MT6620 Wi-Fi][Driver][Wi-Fi Direct] Implementation of interface for supporting Wi-Fi Direct Service Discovery
171  * ioctl implementations for P2P Service Discovery
172  *
173  * 11 04 2010 wh.su
174  * [WCXRP00000164] [MT6620 Wi-Fi][Driver] Support the p2p random SSID
175  * adding the p2p random ssid support.
176  *
177  * 10 18 2010 cp.wu
178  * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check[WCXRP00000086] [MT6620 Wi-Fi][Driver] The mac address is all zero at android
179  * complete implementation of Android NVRAM access
180  *
181  * 09 28 2010 wh.su
182  * NULL
183  * [WCXRP00000069][MT6620 Wi-Fi][Driver] Fix some code for phase 1 P2P Demo.
184  *
185  * 09 23 2010 cp.wu
186  * [WCXRP00000056] [MT6620 Wi-Fi][Driver] NVRAM implementation with Version Check
187  * add skeleton for NVRAM integration
188  *
189  * 09 13 2010 cp.wu
190  * NULL
191  * add waitq for poll() and read().
192  *
193  * 09 07 2010 wh.su
194  * NULL
195  * adding the code for beacon/probe req/ probe rsp wsc ie at p2p.
196  *
197  * 09 06 2010 wh.su
198  * NULL
199  * let the p2p can set the privacy bit at beacon and rsn ie at assoc req at key handshake state.
200  *
201  * 09 03 2010 kevin.huang
202  * NULL
203  * Refine #include sequence and solve recursive/nested #include issue
204  *
205  * 09 01 2010 wh.su
206  * NULL
207  * adding the wapi support for integration test.
208  *
209  * 08 31 2010 kevin.huang
210  * NULL
211  * Use LINK LIST operation to process SCAN result
212  *
213  * 08 23 2010 cp.wu
214  * NULL
215  * revise constant definitions to be matched with implementation (original cmd-event definition is deprecated)
216  *
217  * 08 16 2010 cp.wu
218  * NULL
219  * P2P packets are now marked when being queued into driver, and identified later without checking MAC address
220  *
221  * 08 16 2010 cp.wu
222  * NULL
223  * revised implementation of Wi-Fi Direct io controls.
224  *
225  * 08 11 2010 cp.wu
226  * NULL
227  * 1) do not use in-stack variable for beacon updating. (for MAUI porting)
228  * 2) extending scanning result to 64 instead of 48
229  *
230  * 08 06 2010 cp.wu
231  * NULL
232  * driver hook modifications corresponding to ioctl interface change.
233  *
234  * 08 03 2010 cp.wu
235  * NULL
236  * [Wi-Fi Direct] add framework for driver hooks
237  *
238  * 08 02 2010 jeffrey.chang
239  * NULL
240  * 1) modify tx service thread to avoid busy looping
241  * 2) add spin lock declartion for linux build
242  *
243  * 07 23 2010 jeffrey.chang
244  *
245  * add new KAL api
246  *
247  * 07 22 2010 jeffrey.chang
248  *
249  * modify tx thread and remove some spinlock
250  *
251  * 07 19 2010 jeffrey.chang
252  *
253  * add security frame pending count
254  *
255  * 07 08 2010 cp.wu
256  *
257  * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
258  *
259  * 06 06 2010 kevin.huang
260  * [WPD00003832][MT6620 5931] Create driver base
261  * [MT6620 5931] Create driver base
262  *
263  * 06 01 2010 cp.wu
264  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
265  * add ioctl to configure scan mode for p2p connection
266  *
267  * 05 31 2010 cp.wu
268  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
269  * add cfg80211 interface, which is to replace WE, for further extension
270  *
271  * 05 14 2010 cp.wu
272  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
273  * add ioctl framework for Wi-Fi Direct by reusing wireless extension ioctls as well
274  *
275  * 05 11 2010 cp.wu
276  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
277  * p2p ioctls revised.
278  *
279  * 05 11 2010 cp.wu
280  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
281  * add ioctl for controlling p2p scan phase parameters
282  *
283  * 05 10 2010 cp.wu
284  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
285  * implement basic wi-fi direct framework
286  *
287  * 05 07 2010 jeffrey.chang
288  * [WPD00003826]Initial import for Linux port
289  * prevent supplicant accessing driver during resume
290  *
291  * 05 07 2010 cp.wu
292  * [WPD00003831][MT6620 Wi-Fi] Add framework for Wi-Fi Direct support
293  * add basic framework for implementating P2P driver hook.
294  *
295  * 05 05 2010 cp.wu
296  * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
297  * change variable names for multiple physical link to match with coding convention
298  *
299  * 04 27 2010 cp.wu
300  * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
301  * identify BT Over Wi-Fi Security frame and mark it as 802.1X frame
302  *
303  * 04 27 2010 cp.wu
304  * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
305  * add multiple physical link support
306  *
307  * 04 27 2010 jeffrey.chang
308  * [WPD00003826]Initial import for Linux port
309  * 1) fix firmware download bug
310  * 2) remove query statistics for acelerating firmware download
311  *
312  * 04 27 2010 jeffrey.chang
313  * [WPD00003826]Initial import for Linux port
314  * follow Linux's firmware framework, and remove unused kal API
315  *
316  * 04 23 2010 cp.wu
317  * [WPD00001943]Create WiFi test driver framework on WinXP
318  * surpress compiler warning
319  *
320  * 04 19 2010 jeffrey.chang
321  * [WPD00003826]Initial import for Linux port
322  * supporting power management
323  *
324  * 04 14 2010 jeffrey.chang
325  * [WPD00003826]Initial import for Linux port
326  * pvInformationBuffer and u4InformationBufferLength are no longer in glue
327  *
328  * 04 13 2010 cp.wu
329  * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
330  * add framework for BT-over-Wi-Fi support.
331  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
332  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * 2) command sequence number is now increased atomically
333  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * 3) private data could be hold and taken use for other purpose
334  *
335  * 04 07 2010 cp.wu
336  * [WPD00001943]Create WiFi test driver framework on WinXP
337  * rWlanInfo should be placed at adapter rather than glue due to most operations
338  *  *  *  *  *  *  *  *  *  * are done in adapter layer.
339  *
340  * 04 06 2010 jeffrey.chang
341  * [WPD00003826]Initial import for Linux port
342  * Tag the packet for QoS on Tx path
343  *
344  * 04 06 2010 jeffrey.chang
345  * [WPD00003826]Initial import for Linux port
346  * (1)deliver the kalOidComplete status to upper layer
347  *  * (2) fix spin lock
348  *
349  * 04 06 2010 jeffrey.chang
350  * [WPD00003826]Initial import for Linux port
351  * add timeout check in the kalOidComplete
352  *
353  * 04 06 2010 jeffrey.chang
354  * [WPD00003826]Initial import for Linux port
355  * improve none-glue code portability
356  *
357  * 04 06 2010 cp.wu
358  * [WPD00001943]Create WiFi test driver framework on WinXP
359  * code refine: fgTestMode should be at adapter rather than glue due to the device/fw is also involved
360  *
361  * 04 06 2010 cp.wu
362  * [WPD00001943]Create WiFi test driver framework on WinXP
363  * eliminate direct access for prGlueInfo->fgIsCardRemoved in non-glue layer
364  *
365  * 03 30 2010 jeffrey.chang
366  * [WPD00003826]Initial import for Linux port
367  * emulate NDIS Pending OID facility
368  *
369  * 03 26 2010 jeffrey.chang
370  * [WPD00003826]Initial import for Linux port
371  * [WPD00003826] Initial import for Linux port
372  * adding firmware download related data type
373  *
374  * 03 25 2010 cp.wu
375  * [WPD00001943]Create WiFi test driver framework on WinXP
376  * 1) correct OID_802_11_CONFIGURATION with frequency setting behavior.
377  *  *  *  * the frequency is used for adhoc connection only
378  *  *  *  * 2) update with SD1 v0.9 CMD/EVENT documentation
379  *
380  * 03 25 2010 cp.wu
381  * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
382  * add Bluetooth-over-Wifi frame header check
383  *
384  * 03 24 2010 jeffrey.chang
385  * [WPD00003826]Initial import for Linux port
386  * initial import for Linux port
387 **  \main\maintrunk.MT5921\30 2009-10-20 17:38:31 GMT mtk01090
388 **  Refine driver unloading and clean up procedure. Block requests, stop main thread and clean up queued requests, and then stop hw.
389 **  \main\maintrunk.MT5921\29 2009-10-08 10:33:33 GMT mtk01090
390 **  Avoid accessing private data of net_device directly. Replace with netdev_priv(). Add more checking for input parameters and pointers.
391 **  \main\maintrunk.MT5921\28 2009-09-28 20:19:26 GMT mtk01090
392 **  Add private ioctl to carry OID structures. Restructure public/private ioctl interfaces to Linux kernel.
393 **  \main\maintrunk.MT5921\27 2009-08-18 22:57:12 GMT mtk01090
394 **  Add Linux SDIO (with mmc core) support.
395 **  Add Linux 2.6.21, 2.6.25, 2.6.26.
396 **  Fix compile warning in Linux.
397 **  \main\maintrunk.MT5921\26 2009-07-06 21:42:25 GMT mtk01088
398 **  fixed the compiling error at linux
399 **  \main\maintrunk.MT5921\25 2009-07-06 20:51:46 GMT mtk01088
400 **  adding the wapi 1x ether type define
401 **  \main\maintrunk.MT5921\24 2009-06-23 23:19:18 GMT mtk01090
402 **  Add build option BUILD_USE_EEPROM and compile option CFG_SUPPORT_EXT_CONFIG for NVRAM support
403 **  \main\maintrunk.MT5921\23 2009-02-07 15:05:06 GMT mtk01088
404 **  add the privacy flag to ingo driver the supplicant selected ap's security
405 **  \main\maintrunk.MT5921\22 2009-02-05 15:34:09 GMT mtk01088
406 **  fixed the compiling error for using bits marco for only one parameter
407 **  \main\maintrunk.MT5921\21 2009-01-22 13:02:13 GMT mtk01088
408 **  data frame is or not 802.1x value share with tid, using the same reserved byte, provide the function to set and get
409 **  \main\maintrunk.MT5921\20 2008-10-24 12:04:16 GMT mtk01088
410 **  move the config.h from precomp.h to here for lint check
411 **  \main\maintrunk.MT5921\19 2008-09-22 23:19:02 GMT mtk01461
412 **  Update driver for code review
413 **  \main\maintrunk.MT5921\18 2008-09-05 17:25:13 GMT mtk01461
414 **  Update Driver for Code Review
415 **  \main\maintrunk.MT5921\17 2008-08-01 13:32:47 GMT mtk01084
416 **  Prevent redundent driver assertion in driver logic when BUS is detached
417 **  \main\maintrunk.MT5921\16 2008-05-30 14:41:43 GMT mtk01461
418 **  Remove WMM Assoc Flag in KAL
419 **  \main\maintrunk.MT5921\15 2008-05-29 14:16:25 GMT mtk01084
420 **  remoev un-used variable
421 **  \main\maintrunk.MT5921\14 2008-05-03 15:17:14 GMT mtk01461
422 **  Add Media Status variable in Glue Layer
423 **  \main\maintrunk.MT5921\13 2008-04-24 11:58:41 GMT mtk01461
424 **  change threshold to 256
425 **  \main\maintrunk.MT5921\12 2008-03-11 14:51:05 GMT mtk01461
426 **  Remove redundant GL_CONN_INFO_T
427 **  \main\maintrunk.MT5921\11 2008-01-07 15:07:41 GMT mtk01461
428 **  Adjust the netif stop threshold to 150
429 **  \main\maintrunk.MT5921\10 2007-11-26 19:43:46 GMT mtk01461
430 **  Add OS_TIMESTAMP macro
431 **
432 **  \main\maintrunk.MT5921\9 2007-11-07 18:38:38 GMT mtk01461
433 **  Move definition
434 **  \main\maintrunk.MT5921\8 2007-11-02 01:04:00 GMT mtk01461
435 **  Unify TX Path for Normal and IBSS Power Save + IBSS neighbor learning
436 ** Revision 1.5  2007/07/12 11:04:28  MTK01084
437 ** update macro to delay for ms order
438 **
439 ** Revision 1.4  2007/07/05 07:25:34  MTK01461
440 ** Add Linux initial code, modify doc, add 11BB, RF init code
441 **
442 ** Revision 1.3  2007/06/27 02:18:51  MTK01461
443 ** Update SCAN_FSM, Initial(Can Load Module), Proc(Can do Reg R/W), TX API
444 **
445 ** Revision 1.2  2007/06/25 06:16:24  MTK01461
446 ** Update illustrations, gl_init.c, gl_kal.c, gl_kal.h, gl_os.h and RX API
447 **
448 */
449
450 #ifndef _GL_OS_H
451 #define _GL_OS_H
452
453 /*******************************************************************************
454 *                         C O M P I L E R   F L A G S
455 ********************************************************************************
456 */
457 /*------------------------------------------------------------------------------
458  * Flags for LINUX(OS) dependent
459  *------------------------------------------------------------------------------
460  */
461 #define CFG_MAX_WLAN_DEVICES                1 /* number of wlan card will coexist*/
462
463 #define CFG_MAX_TXQ_NUM                     4 /* number of tx queue for support multi-queue h/w  */
464
465
466 #define CFG_USE_SPIN_LOCK_BOTTOM_HALF       0 /* 1: Enable use of SPIN LOCK Bottom Half for LINUX
467                                                  0: Disable - use SPIN LOCK IRQ SAVE instead */
468
469 #define CFG_TX_PADDING_SMALL_ETH_PACKET     0 /* 1: Enable - Drop ethernet packet if it < 14 bytes.
470                                                              And pad ethernet packet with dummy 0 if it < 60 bytes.
471                                                  0: Disable */
472
473 #define CFG_TX_STOP_NETIF_QUEUE_THRESHOLD   256 /* packets */
474
475 #define CFG_TX_STOP_NETIF_PER_QUEUE_THRESHOLD   64  /* packets */
476 #define CFG_TX_START_NETIF_PER_QUEUE_THRESHOLD  32  /* packets */
477
478
479 #define ETH_P_1X                            0x888E
480 #define IPTOS_PREC_OFFSET                   5
481 #define USER_PRIORITY_DEFAULT               0
482
483 #define ETH_WPI_1X                         0x88B4
484
485 #define ETH_HLEN                                14
486 #define ETH_TYPE_LEN_OFFSET                     12
487 #define ETH_P_IP                                0x0800
488 #define ETH_P_1X                                0x888E
489 #define ETH_P_PRE_1X                            0x88C7
490
491 #define IPVERSION                               4
492 #define IP_HEADER_LEN                           20
493
494 #define IPVH_VERSION_OFFSET                     4 // For Little-Endian
495 #define IPVH_VERSION_MASK                       0xF0
496 #define IPTOS_PREC_OFFSET                       5
497 #define IPTOS_PREC_MASK                         0xE0
498
499 #define SOURCE_PORT_LEN                         2
500 /* NOTE(Kevin): Without IP Option Length */
501 #define LOOK_AHEAD_LEN                          (ETH_HLEN + IP_HEADER_LEN + SOURCE_PORT_LEN)
502
503 /* 802.2 LLC/SNAP */
504 #define ETH_LLC_OFFSET                          (ETH_HLEN)
505 #define ETH_LLC_LEN                             3
506 #define ETH_LLC_DSAP_SNAP                       0xAA
507 #define ETH_LLC_SSAP_SNAP                       0xAA
508 #define ETH_LLC_CONTROL_UNNUMBERED_INFORMATION  0x03
509
510 /* Bluetooth SNAP */
511 #define ETH_SNAP_OFFSET                         (ETH_HLEN + ETH_LLC_LEN)
512 #define ETH_SNAP_LEN                            5
513 #define ETH_SNAP_BT_SIG_OUI_0                   0x00
514 #define ETH_SNAP_BT_SIG_OUI_1                   0x19
515 #define ETH_SNAP_BT_SIG_OUI_2                   0x58
516
517 #define BOW_PROTOCOL_ID_SECURITY_FRAME          0x0003
518
519
520 #if defined(MT6620)
521     #define DRV_NAME    "[MT6620]: "
522 #elif defined(MT5931)
523     #define DRV_NAME    "[MT5931]: "
524 #elif defined(MT6628)
525     #define DRV_NAME    "[MT6628]: "
526 #endif
527
528 /* Define if target platform is Android.
529  * It should already be defined in Android kernel source
530  */
531 #ifndef CONFIG_ANDROID
532 #define CONFIG_ANDROID      0
533 #endif
534
535 /*******************************************************************************
536 *                    E X T E R N A L   R E F E R E N C E S
537 ********************************************************************************
538 */
539 #include <linux/version.h>      /* constant of kernel version */
540
541 #include <linux/kernel.h>       /* bitops.h */
542
543 #include <linux/timer.h>        /* struct timer_list */
544 #include <linux/jiffies.h>      /* jiffies */
545 #include <linux/delay.h>        /* udelay and mdelay macro */
546
547 #if CONFIG_ANDROID
548 #include <linux/wakelock.h>
549 #endif
550
551 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 12)
552 #include <linux/irq.h>          /* IRQT_FALLING */
553 #endif
554
555 #include <linux/netdevice.h>    /* struct net_device, struct net_device_stats */
556 #include <linux/etherdevice.h>  /* for eth_type_trans() function */
557 #include <linux/wireless.h>     /* struct iw_statistics */
558 #include <linux/if_arp.h>
559 #include <linux/inetdevice.h>   /* struct in_device */
560
561 #include <linux/ip.h>           /* struct iphdr */
562
563 #include <linux/string.h>       /* for memcpy()/memset() function */
564 #include <linux/stddef.h>       /* for offsetof() macro */
565
566 #include <linux/proc_fs.h>      /* The proc filesystem constants/structures */
567
568 #include <linux/rtnetlink.h>    /* for rtnl_lock() and rtnl_unlock() */
569 #include <linux/kthread.h>      /* kthread_should_stop(), kthread_run() */
570 #include <asm/uaccess.h>        /* for copy_from_user() */
571 #include <linux/fs.h>           /* for firmware download */
572 #include <linux/vmalloc.h>
573
574 #include <linux/kfifo.h>        /* for kfifo interface */
575 #include <linux/cdev.h>         /* for cdev interface */
576
577 #include <linux/firmware.h>     /* for firmware download */
578
579 #if defined(_HIF_SDIO)
580 #include <linux/mmc/sdio.h>
581 #include <linux/mmc/sdio_func.h>
582 #endif
583
584 #include <linux/random.h>
585
586
587 #include <asm/io.h>             /* readw and writew */
588
589 #if WIRELESS_EXT > 12
590 #include <net/iw_handler.h>
591 #endif
592
593 #include "version.h"
594 #include "config.h"
595
596 #if CFG_ENABLE_WIFI_DIRECT_CFG_80211
597 #include <linux/wireless.h>
598 #include <net/cfg80211.h>
599 #endif
600
601 #include "gl_typedef.h"
602 #include "typedef.h"
603 #include "queue.h"
604 #include "gl_kal.h"
605 #if CFG_CHIP_RESET_SUPPORT
606     #include "gl_rst.h"
607 #endif
608 #include "hif.h"
609
610
611 #include "debug.h"
612
613 #include "wlan_lib.h"
614 #include "wlan_oid.h"
615
616
617 extern BOOLEAN fgIsBusAccessFailed;
618
619 /*******************************************************************************
620 *                              C O N S T A N T S
621 ********************************************************************************
622 */
623 #define GLUE_FLAG_HALT          BIT(0)
624 #define GLUE_FLAG_INT           BIT(1)
625 #define GLUE_FLAG_OID           BIT(2)
626 #define GLUE_FLAG_TIMEOUT       BIT(3)
627 #define GLUE_FLAG_TXREQ         BIT(4)
628 #define GLUE_FLAG_SUB_MOD_INIT  BIT(5)
629 #define GLUE_FLAG_SUB_MOD_EXIT  BIT(6)
630 #define GLUE_FLAG_SUB_MOD_MULTICAST  BIT(7)
631 #define GLUE_FLAG_HALT_BIT          (0)
632 #define GLUE_FLAG_INT_BIT           (1)
633 #define GLUE_FLAG_OID_BIT           (2)
634 #define GLUE_FLAG_TIMEOUT_BIT       (3)
635 #define GLUE_FLAG_TXREQ_BIT         (4)
636 #define GLUE_FLAG_SUB_MOD_INIT_BIT  (5)
637 #define GLUE_FLAG_SUB_MOD_EXIT_BIT  (6)
638 #define GLUE_FLAG_SUB_MOD_MULTICAST_BIT  (7)
639
640
641
642 #define GLUE_BOW_KFIFO_DEPTH        (1024)
643 //#define GLUE_BOW_DEVICE_NAME        "MT6620 802.11 AMP"
644 #define GLUE_BOW_DEVICE_NAME        "ampc0"
645
646
647 /*******************************************************************************
648 *                             D A T A   T Y P E S
649 ********************************************************************************
650 */
651 typedef struct _GL_WPA_INFO_T {
652     UINT_32 u4WpaVersion;
653     UINT_32 u4KeyMgmt;
654     UINT_32 u4CipherGroup;
655     UINT_32 u4CipherPairwise;
656     UINT_32 u4AuthAlg;
657     BOOLEAN fgPrivacyInvoke;
658 #if CFG_SUPPORT_802_11W
659     UINT_32 u4Mfp;
660 #endif
661 } GL_WPA_INFO_T, *P_GL_WPA_INFO_T;
662
663 typedef enum _ENUM_RSSI_TRIGGER_TYPE {
664     ENUM_RSSI_TRIGGER_NONE,
665     ENUM_RSSI_TRIGGER_GREATER,
666     ENUM_RSSI_TRIGGER_LESS,
667     ENUM_RSSI_TRIGGER_TRIGGERED,
668     ENUM_RSSI_TRIGGER_NUM
669 } ENUM_RSSI_TRIGGER_TYPE;
670
671 #if CFG_ENABLE_WIFI_DIRECT
672 typedef enum _ENUM_SUB_MODULE_IDX_T {
673     P2P_MODULE = 0,
674     SUB_MODULE_NUM
675 } ENUM_SUB_MODULE_IDX_T;
676 #endif
677
678 typedef struct _GL_IO_REQ_T {
679     QUE_ENTRY_T             rQueEntry;
680     //wait_queue_head_t       cmdwait_q;
681     BOOL                    fgRead;
682     BOOL                    fgWaitResp;
683 #if CFG_ENABLE_WIFI_DIRECT
684     BOOL                    fgIsP2pOid;
685 #endif
686     P_ADAPTER_T             prAdapter;
687     PFN_OID_HANDLER_FUNC    pfnOidHandler;
688     PVOID                   pvInfoBuf;
689     UINT_32                 u4InfoBufLen;
690     PUINT_32                pu4QryInfoLen;
691     WLAN_STATUS             rStatus;
692     UINT_32                 u4Flag;
693 } GL_IO_REQ_T, *P_GL_IO_REQ_T;
694
695 #if CFG_ENABLE_BT_OVER_WIFI
696 typedef struct _GL_BOW_INFO {
697     BOOLEAN                 fgIsRegistered;
698     dev_t                   u4DeviceNumber; /* dynamic device number */
699 //    struct kfifo            *prKfifo;       /* for buffering indicated events */
700     struct kfifo                      rKfifo;   /* for buffering indicated events */
701     spinlock_t              rSpinLock;      /* spin lock for kfifo */
702     struct cdev             cdev;
703     UINT_32                 u4FreqInKHz;    /* frequency */
704
705     UINT_8                  aucRole[CFG_BOW_PHYSICAL_LINK_NUM];  /* 0: Responder, 1: Initiator */
706     ENUM_BOW_DEVICE_STATE   aeState[CFG_BOW_PHYSICAL_LINK_NUM];
707     PARAM_MAC_ADDRESS       arPeerAddr[CFG_BOW_PHYSICAL_LINK_NUM];
708
709     wait_queue_head_t       outq;
710
711     #if CFG_BOW_SEPARATE_DATA_PATH
712     /* Device handle */
713     struct net_device           *prDevHandler;
714     BOOLEAN                     fgIsNetRegistered;
715     #endif
716
717 } GL_BOW_INFO, *P_GL_BOW_INFO;
718 #endif
719
720 /*
721 * type definition of pointer to p2p structure
722 */
723 typedef struct _GL_P2P_INFO_T   GL_P2P_INFO_T, *P_GL_P2P_INFO_T;
724
725 struct _GLUE_INFO_T {
726     /* Device handle */
727     struct net_device *prDevHandler;
728
729     /* Device Index(index of arWlanDevInfo[]) */
730     INT_32 i4DevIdx;
731
732     /* Device statistics */
733     struct net_device_stats rNetDevStats;
734
735     /* Wireless statistics struct net_device */
736     struct iw_statistics rIwStats;
737
738     /* spinlock to sync power save mechanism */
739     spinlock_t rSpinLock[SPIN_LOCK_NUM];
740
741     /* semaphore for ioctl */
742     struct semaphore ioctl_sem;
743
744     UINT_32 u4Flag; /* GLUE_FLAG_XXX */
745     UINT_32 u4PendFlag;
746     //UINT_32 u4TimeoutFlag;
747     UINT_32 u4ReadyFlag;  /* check if card is ready */
748
749     /* Number of pending frames, also used for debuging if any frame is
750      * missing during the process of unloading Driver.
751      *
752      * NOTE(Kevin): In Linux, we also use this variable as the threshold
753      * for manipulating the netif_stop(wake)_queue() func.
754      */
755     INT_32             ai4TxPendingFrameNumPerQueue[4][CFG_MAX_TXQ_NUM];
756     INT_32             i4TxPendingFrameNum;
757     INT_32             i4TxPendingSecurityFrameNum;
758
759     /* current IO request for kalIoctl */
760     GL_IO_REQ_T         OidEntry;
761
762     /* registry info*/
763     REG_INFO_T rRegInfo;
764
765     /* firmware */
766     struct firmware     *prFw;
767
768     /* Host interface related information */
769     /* defined in related hif header file */
770     GL_HIF_INFO_T       rHifInfo;
771
772     /*! \brief wext wpa related information */
773     GL_WPA_INFO_T       rWpaInfo;
774
775
776     /* Pointer to ADAPTER_T - main data structure of internal protocol stack */
777     P_ADAPTER_T         prAdapter;
778
779 #ifdef WLAN_INCLUDE_PROC
780     struct proc_dir_entry *pProcRoot;
781 #endif /* WLAN_INCLUDE_PROC */
782
783     /* Indicated media state */
784     ENUM_PARAM_MEDIA_STATE_T eParamMediaStateIndicated;
785
786     /* Device power state D0~D3 */
787     PARAM_DEVICE_POWER_STATE ePowerState;
788
789     struct completion rScanComp; /* indicate scan complete */
790     struct completion rHaltComp; /* indicate main thread halt complete */
791     struct completion rPendComp; /* indicate main thread halt complete */
792 #if CFG_ENABLE_WIFI_DIRECT
793     struct completion rSubModComp; /*indicate sub module init or exit complete*/
794 #endif
795     WLAN_STATUS             rPendStatus;
796
797     QUE_T                   rTxQueue;
798
799
800     /* OID related */
801     QUE_T                   rCmdQueue;
802     //PVOID                   pvInformationBuffer;
803     //UINT_32                 u4InformationBufferLength;
804     //PVOID                   pvOidEntry;
805     //PUINT_8                 pucIOReqBuff;
806     //QUE_T                   rIOReqQueue;
807     //QUE_T                   rFreeIOReqQueue;
808
809     wait_queue_head_t       waitq;
810     struct task_struct      *main_thread;
811
812     struct timer_list tickfn;
813
814
815 #if CFG_SUPPORT_EXT_CONFIG
816     UINT_16     au2ExtCfg[256];  /* NVRAM data buffer */
817     UINT_32     u4ExtCfgLength;  /* 0 means data is NOT valid */
818 #endif
819
820 #if 1//CFG_SUPPORT_WAPI
821     /* Should be large than the PARAM_WAPI_ASSOC_INFO_T */
822     UINT_8                  aucWapiAssocInfoIEs[42];
823     UINT_16                 u2WapiAssocInfoIESz;
824 #endif
825
826 #if CFG_ENABLE_BT_OVER_WIFI
827     GL_BOW_INFO             rBowInfo;
828 #endif
829
830 #if CFG_ENABLE_WIFI_DIRECT
831     P_GL_P2P_INFO_T         prP2PInfo;
832 #if CFG_SUPPORT_P2P_RSSI_QUERY
833     /* Wireless statistics struct net_device */
834     struct iw_statistics    rP2pIwStats;
835 #endif
836 #endif
837     BOOLEAN                 fgWpsActive;
838         UINT_8                  aucWSCIE[500]; /*for probe req*/
839     UINT_16                 u2WSCIELen;
840         UINT_8                  aucWSCAssocInfoIE[200]; /*for Assoc req*/
841     UINT_16                 u2WSCAssocInfoIELen;
842
843     /* NVRAM availability */
844     BOOLEAN                 fgNvramAvailable;
845
846     BOOLEAN                 fgMcrAccessAllowed;
847
848     /* MAC Address Overriden by IOCTL */
849     BOOLEAN                 fgIsMacAddrOverride;
850     PARAM_MAC_ADDRESS       rMacAddrOverride;
851
852     SET_TXPWR_CTRL_T        rTxPwr;
853 };
854
855 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
856     /* linux 2.4 */
857     typedef void (*PFN_WLANISR)(int irq, void *dev_id, struct pt_regs *regs);
858 #else
859     typedef irqreturn_t (*PFN_WLANISR)(int irq, void *dev_id, struct pt_regs *regs);
860 #endif
861
862 typedef void (*PFN_LINUX_TIMER_FUNC)(unsigned long);
863
864
865 /* generic sub module init/exit handler
866 *   now, we only have one sub module, p2p
867 */
868 #if CFG_ENABLE_WIFI_DIRECT
869 typedef BOOLEAN (*SUB_MODULE_INIT)(P_GLUE_INFO_T prGlueInfo);
870 typedef BOOLEAN (*SUB_MODULE_EXIT)(P_GLUE_INFO_T prGlueInfo);
871
872 typedef struct _SUB_MODULE_HANDLER {
873     SUB_MODULE_INIT subModInit;
874     SUB_MODULE_EXIT subModExit;
875     BOOLEAN fgIsInited;
876 } SUB_MODULE_HANDLER, *P_SUB_MODULE_HANDLER;
877
878 #endif
879
880
881 /*******************************************************************************
882 *                            P U B L I C   D A T A
883 ********************************************************************************
884 */
885
886 /*******************************************************************************
887 *                           P R I V A T E   D A T A
888 ********************************************************************************
889 */
890
891 /*******************************************************************************
892 *                                 M A C R O S
893 ********************************************************************************
894 */
895 /*----------------------------------------------------------------------------*/
896 /* Macros of SPIN LOCK operations for using in Glue Layer                     */
897 /*----------------------------------------------------------------------------*/
898 #if CFG_USE_SPIN_LOCK_BOTTOM_HALF
899     #define GLUE_SPIN_LOCK_DECLARATION()
900     #define GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, rLockCategory)   \
901             { \
902                 if (rLockCategory < SPIN_LOCK_NUM) \
903                 spin_lock_bh(&(prGlueInfo->rSpinLock[rLockCategory])); \
904             }
905     #define GLUE_RELEASE_SPIN_LOCK(prGlueInfo, rLockCategory)   \
906             { \
907                 if (rLockCategory < SPIN_LOCK_NUM) \
908                 spin_unlock_bh(&(prGlueInfo->rSpinLock[rLockCategory])); \
909             }
910 #else /* !CFG_USE_SPIN_LOCK_BOTTOM_HALF */
911     #define GLUE_SPIN_LOCK_DECLARATION()                        UINT_32 __u4Flags = 0
912     #define GLUE_ACQUIRE_SPIN_LOCK(prGlueInfo, rLockCategory)   \
913             { \
914                 if (rLockCategory < SPIN_LOCK_NUM) \
915                 spin_lock_irqsave(&(prGlueInfo)->rSpinLock[rLockCategory], __u4Flags); \
916             }
917     #define GLUE_RELEASE_SPIN_LOCK(prGlueInfo, rLockCategory)   \
918             { \
919                 if (rLockCategory < SPIN_LOCK_NUM) \
920                 spin_unlock_irqrestore(&(prGlueInfo->rSpinLock[rLockCategory]), __u4Flags); \
921             }
922 #endif /* !CFG_USE_SPIN_LOCK_BOTTOM_HALF */
923
924
925 /*----------------------------------------------------------------------------*/
926 /* Macros for accessing Reserved Fields of native packet                      */
927 /*----------------------------------------------------------------------------*/
928 #define GLUE_GET_PKT_QUEUE_ENTRY(_p)    \
929             (&( ((struct sk_buff *)(_p))->cb[0] ))
930
931 #define GLUE_GET_PKT_DESCRIPTOR(_prQueueEntry)  \
932             ((P_NATIVE_PACKET) ((UINT_32)_prQueueEntry - offsetof(struct sk_buff, cb[0])) )
933
934 #define  GLUE_SET_PKT_FLAG_802_11(_p)  \
935             (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= BIT(7))
936
937 #define GLUE_SET_PKT_FLAG_1X(_p)  \
938             (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= BIT(6))
939
940 #define GLUE_SET_PKT_FLAG_PAL(_p)  \
941             (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= BIT(5))
942
943 #define GLUE_SET_PKT_FLAG_P2P(_p)  \
944             (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= BIT(4))
945
946
947
948 #define GLUE_SET_PKT_TID(_p, _tid)  \
949             (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) |= (((UINT_8)((_tid) & (BITS(0,3))))))
950
951
952 #define GLUE_SET_PKT_FRAME_LEN(_p, _u2PayloadLen) \
953             (*((PUINT_16) &( ((struct sk_buff *)(_p))->cb[6] )) = (UINT_16)(_u2PayloadLen))
954
955 #define GLUE_GET_PKT_FRAME_LEN(_p)    \
956             (*((PUINT_16) &( ((struct sk_buff *)(_p))->cb[6] )) )
957
958
959 #define  GLUE_GET_PKT_IS_802_11(_p)        \
960             ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BIT(7)))
961
962 #define  GLUE_GET_PKT_IS_1X(_p)        \
963             ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BIT(6)))
964
965 #define GLUE_GET_PKT_TID(_p)        \
966             ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BITS(0,3)))
967
968
969 #define GLUE_GET_PKT_IS_PAL(_p)        \
970             ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BIT(5)))
971
972 #define GLUE_GET_PKT_IS_P2P(_p)        \
973             ((*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[4] )) ) & (BIT(4)))
974
975
976 #define GLUE_SET_PKT_HEADER_LEN(_p, _ucMacHeaderLen)    \
977             (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[5] )) = (UINT_8)(_ucMacHeaderLen))
978
979 #define GLUE_GET_PKT_HEADER_LEN(_p) \
980             (*((PUINT_8) &( ((struct sk_buff *)(_p))->cb[5] )) )
981
982 #define GLUE_SET_PKT_ARRIVAL_TIME(_p, _rSysTime) \
983             (*((POS_SYSTIME) &( ((struct sk_buff *)(_p))->cb[8] )) = (OS_SYSTIME)(_rSysTime))
984
985 #define GLUE_GET_PKT_ARRIVAL_TIME(_p)    \
986             (*((POS_SYSTIME) &( ((struct sk_buff *)(_p))->cb[8] )) )
987
988 /* Check validity of prDev, private data, and pointers */
989 #define GLUE_CHK_DEV(prDev) \
990     ((prDev && netdev_priv(prDev)) ? TRUE : FALSE)
991
992 #define GLUE_CHK_PR2(prDev, pr2) \
993     ((GLUE_CHK_DEV(prDev) && pr2) ? TRUE : FALSE)
994
995 #define GLUE_CHK_PR3(prDev, pr2, pr3) \
996     ((GLUE_CHK_PR2(prDev, pr2) && pr3) ? TRUE : FALSE)
997
998 #define GLUE_CHK_PR4(prDev, pr2, pr3, pr4) \
999     ((GLUE_CHK_PR3(prDev, pr2, pr3) && pr4) ? TRUE : FALSE)
1000
1001 #define GLUE_SET_EVENT(pr) \
1002         kalSetEvent(pr)
1003
1004 #define GLUE_INC_REF_CNT(_refCount)     atomic_inc((atomic_t *)&(_refCount))
1005 #define GLUE_DEC_REF_CNT(_refCount)     atomic_dec((atomic_t *)&(_refCount))
1006
1007
1008 #define DbgPrint(...)
1009 /*******************************************************************************
1010 *                  F U N C T I O N   D E C L A R A T I O N S
1011 ********************************************************************************
1012 */
1013 #ifdef WLAN_INCLUDE_PROC
1014 INT_32
1015 procRemoveProcfs (
1016     struct net_device *prDev,
1017     char *pucDevName
1018     );
1019
1020 INT_32
1021 procInitProcfs (
1022     struct net_device *prDev,
1023     char *pucDevName
1024     );
1025 #endif /* WLAN_INCLUDE_PROC */
1026
1027 #if CFG_ENABLE_BT_OVER_WIFI
1028 BOOLEAN
1029 glRegisterAmpc (
1030     P_GLUE_INFO_T prGlueInfo
1031     );
1032
1033 BOOLEAN
1034 glUnregisterAmpc (
1035     P_GLUE_INFO_T prGlueInfo
1036     );
1037 #endif
1038
1039 #if CFG_ENABLE_WIFI_DIRECT
1040
1041 VOID
1042 wlanSubModRunInit(
1043     P_GLUE_INFO_T prGlueInfo
1044     );
1045
1046 VOID
1047 wlanSubModRunExit(
1048     P_GLUE_INFO_T prGlueInfo
1049     );
1050
1051 BOOLEAN
1052 wlanSubModInit(
1053     P_GLUE_INFO_T prGlueInfo
1054     );
1055
1056 BOOLEAN
1057 wlanSubModExit(
1058     P_GLUE_INFO_T prGlueInfo
1059     );
1060
1061 VOID
1062 wlanSubModRegisterInitExit(
1063     SUB_MODULE_INIT rSubModInit,
1064     SUB_MODULE_EXIT rSubModExit,
1065     ENUM_SUB_MODULE_IDX_T eSubModIdx
1066     );
1067
1068 BOOLEAN
1069 wlanExportGlueInfo(
1070     P_GLUE_INFO_T *prGlueInfoExpAddr
1071     );
1072
1073 BOOLEAN
1074 wlanIsLaunched(
1075     VOID
1076     );
1077
1078 void
1079 p2pSetMulticastListWorkQueueWrapper(
1080     P_GLUE_INFO_T prGlueInfo
1081     );
1082
1083
1084
1085 #endif
1086
1087 /*******************************************************************************
1088 *                              F U N C T I O N S
1089 ********************************************************************************
1090 */
1091
1092 #endif /* _GL_OS_H */
1093