1 /******************************************************************************
2  * Copyright (c) 2013-2016 Realtek Semiconductor Corp.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  ******************************************************************************/
16 #ifndef __WLAN_INTF_H__
17 #define __WLAN_INTF_H__
18 
19 #ifdef	__cplusplus
20 extern "C" {
21 #endif
22 #include <autoconf.h>
23 
24 #include <wireless.h>
25 #include "wifi_constants.h"
26 
27 #ifndef WLAN0_IDX
28 	#define WLAN0_IDX	0
29 #endif
30 #ifndef WLAN1_IDX
31 	#define WLAN1_IDX	1
32 #endif
33 #ifndef WLAN_UNDEF
34 	#define WLAN_UNDEF	-1
35 #endif
36 
37 /***********************************************************/
38 /*
39 struct sk_buff {
40 	// These two members must be first.
41 	struct sk_buff		*next;		// Next buffer in list
42 	struct sk_buff		*prev;		// Previous buffer in list
43 
44 	struct sk_buff_head	*list;			// List we are on
45 	unsigned char		*head;		// Head of buffer
46 	unsigned char		*data;		// Data head pointer
47 	unsigned char		*tail;		// Tail pointer
48 	unsigned char		*end;		//End pointer
49 	struct net_device 	*dev;		//Device we arrived on/are leaving by
50 	unsigned int 		len;			// Length of actual data
51 };
52 */
53 /************************************************************/
54 
55 //----- ------------------------------------------------------------------
56 // Wlan Interface opened for upper layer
57 //----- ------------------------------------------------------------------
58 int rltk_wlan_init(int idx_wlan, rtw_mode_t mode);				//return 0: success. -1:fail
59 void rltk_wlan_deinit(void);
60 void rltk_wlan_deinit_fastly(void);
61 int rltk_wlan_start(int idx_wlan);
62 void rltk_wlan_statistic(unsigned char idx);
63 unsigned char rltk_wlan_running(unsigned char idx);		// interface is up. 0: interface is down
64 int rltk_wlan_control(unsigned long cmd, void *data);
65 int rltk_wlan_handshake_done(void);
66 int rltk_wlan_rf_on(void);
67 int rltk_wlan_rf_off(void);
68 int rltk_wlan_check_bus(void);
69 int rltk_wlan_wireless_mode(unsigned char mode);
70 int rltk_wlan_get_wireless_mode(unsigned char *pmode);
71 int rltk_wlan_set_wps_phase(unsigned char is_trigger_wps);
72 int rtw_ps_enable(int enable);
73 int rltk_wlan_is_connected_to_ap(void);
74 void rltk_wlan_btcoex_set_bt_state(unsigned char state);
75 int rltk_wlan_change_channel_plan(unsigned char channel_plan);
76 int rltk_set_tx_pause(unsigned char pause);
77 void rltk_set_rts_cts_mode(unsigned char mode);
78 
79 #ifdef CONFIG_IEEE80211W
80 void rltk_wlan_tx_sa_query(unsigned char key_type);
81 void rltk_wlan_tx_deauth(unsigned char b_broadcast, unsigned char key_type);
82 void rltk_wlan_tx_auth(void);
83 #endif
84 
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 
90 
91 #endif //#ifndef __WLAN_INTF_H__
92