1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#ifndef __DRV_TYPES_H__
23#define __DRV_TYPES_H__
24
25#include <osdep_service.h>
26#include <wlan_bssdef.h>
27
28
29enum _NIC_VERSION {
30 RTL8711_NIC,
31 RTL8712_NIC,
32 RTL8713_NIC,
33 RTL8716_NIC
34
35};
36
37
38#include <rtw_ht.h>
39
40#include <rtw_cmd.h>
41#include <rtw_xmit.h>
42#include <rtw_recv.h>
43#include <hal_intf.h>
44#include <hal_com.h>
45#include <rtw_security.h>
46#include <rtw_pwrctrl.h>
47#include <rtw_io.h>
48#include <rtw_eeprom.h>
49#include <sta_info.h>
50#include <rtw_mlme.h>
51#include <rtw_debug.h>
52#include <rtw_rf.h>
53#include <rtw_event.h>
54#include <rtw_mlme_ext.h>
55#include <rtw_ap.h>
56
57#include "ioctl_cfg80211.h"
58
59struct registry_priv {
60 u8 chip_version;
61 u8 rfintfs;
62 struct cfg80211_ssid ssid;
63 u8 channel;
64 u8 wireless_mode;
65 u8 scan_mode;
66 u8 preamble;
67 u8 vrtl_carrier_sense;
68 u8 vcs_type;
69 u16 rts_thresh;
70 u16 frag_thresh;
71 u8 adhoc_tx_pwr;
72 u8 soft_ap;
73 u8 power_mgnt;
74 u8 ips_mode;
75 u8 smart_ps;
76 u8 long_retry_lmt;
77 u8 short_retry_lmt;
78 u16 busy_thresh;
79 u8 ack_policy;
80 u8 software_encrypt;
81 u8 software_decrypt;
82 u8 acm_method;
83
84 u8 wmm_enable;
85 u8 uapsd_enable;
86
87 struct wlan_bssid_ex dev_network;
88
89 u8 ht_enable;
90 u8 cbw40_enable;
91 u8 ampdu_enable;
92 u8 rx_stbc;
93 u8 ampdu_amsdu;
94 u8 lowrate_two_xmit;
95
96 u8 rf_config;
97 u8 low_power;
98
99 u8 wifi_spec;
100
101 u8 channel_plan;
102#ifdef CONFIG_8723AU_BT_COEXIST
103 u8 btcoex;
104 u8 bt_iso;
105 u8 bt_sco;
106 u8 bt_ampdu;
107#endif
108 bool bAcceptAddbaReq;
109
110 u8 antdiv_cfg;
111 u8 antdiv_type;
112
113 u8 hwpdn_mode;
114 u8 hwpwrp_detect;
115
116 u8 hw_wps_pbc;
117
118 u8 max_roaming_times;
119
120 u8 enable80211d;
121
122 u8 ifname[16];
123 u8 if2name[16];
124
125 u8 notch_filter;
126
127 u8 regulatory_tid;
128};
129
130
131#define MAX_CONTINUAL_URB_ERR 4
132
133#define GET_PRIMARY_ADAPTER(padapter) \
134 (((struct rtw_adapter *)padapter)->dvobj->if1)
135
136enum _IFACE_ID {
137 IFACE_ID0,
138 IFACE_ID1,
139 IFACE_ID2,
140 IFACE_ID3,
141 IFACE_ID_MAX,
142};
143
144struct dvobj_priv {
145 struct rtw_adapter *if1;
146 struct rtw_adapter *if2;
147
148
149 struct mutex hw_init_mutex;
150 struct mutex h2c_fwcmd_mutex;
151 struct mutex setch_mutex;
152 struct mutex setbw_mutex;
153
154 unsigned char oper_channel;
155 unsigned char oper_bwmode;
156 unsigned char oper_ch_offset;
157
158 struct rtw_adapter *padapters[IFACE_ID_MAX];
159 u8 iface_nums;
160
161
162 u8 InterfaceNumber;
163 u8 NumInterfaces;
164
165
166 int RtInPipe[2];
167 int RtOutPipe[3];
168 u8 Queue2Pipe[HW_QUEUE_ENTRY];
169
170
171
172 u8 nr_endpoint;
173 u8 ishighspeed;
174 u8 RtNumInPipes;
175 u8 RtNumOutPipes;
176 int ep_num[5];
177
178 struct mutex usb_vendor_req_mutex;
179
180 union {
181 __le32 val32;
182 __le16 val16;
183 u8 val8;
184 } usb_buf;
185
186 struct usb_interface *pusbintf;
187 struct usb_device *pusbdev;
188 atomic_t continual_urb_error;
189
190
191
192};
193
194static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
195{
196
197 return &dvobj->pusbintf->dev;
198}
199
200enum _IFACE_TYPE {
201 IFACE_PORT0,
202 IFACE_PORT1,
203 MAX_IFACE_PORT,
204};
205
206enum _ADAPTER_TYPE {
207 PRIMARY_ADAPTER,
208 SECONDARY_ADAPTER,
209 MAX_ADAPTER,
210};
211
212struct rtw_adapter {
213 int pid[3];
214 int bDongle;
215 u16 chip_type;
216 u16 HardwareType;
217
218 struct dvobj_priv *dvobj;
219 struct mlme_priv mlmepriv;
220 struct mlme_ext_priv mlmeextpriv;
221 struct cmd_priv cmdpriv;
222 struct evt_priv evtpriv;
223 struct xmit_priv xmitpriv;
224 struct recv_priv recvpriv;
225 struct sta_priv stapriv;
226 struct security_priv securitypriv;
227 struct registry_priv registrypriv;
228 struct pwrctrl_priv pwrctrlpriv;
229 struct eeprom_priv eeprompriv;
230
231 u32 setband;
232
233 void *HalData;
234
235 s32 bDriverStopped;
236 s32 bSurpriseRemoved;
237 s32 bCardDisableWOHSM;
238
239 u32 IsrContent;
240 u32 ImrContent;
241
242 u8 EepromAddressSize;
243 u8 hw_init_completed;
244 u8 bDriverIsGoingToUnload;
245 u8 init_adpt_in_progress;
246 u8 bHaltInProgress;
247
248 struct net_device *pnetdev;
249
250
251 int bup;
252 struct net_device_stats stats;
253
254 struct wireless_dev *rtw_wdev;
255 int net_closed;
256
257 u8 bFWReady;
258 u8 bReadPortCancel;
259 u8 bWritePortCancel;
260
261
262
263
264 u8 iface_id;
265};
266
267#define adapter_to_dvobj(adapter) (adapter->dvobj)
268
269static inline u8 *myid(struct eeprom_priv *peepriv)
270{
271 return peepriv->mac_addr;
272}
273
274#endif
275