1 /******************************************************************************
3 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 /*-----------------------------------------------------------------------------
22 For type defines and data structure defines
24 ------------------------------------------------------------------------------*/
27 #ifndef __DRV_TYPES_H__
28 #define __DRV_TYPES_H__
30 #define DRV_NAME "r8188eu"
32 #include <osdep_service.h>
33 #include <wlan_bssdef.h>
34 #include <drv_types_linux.h>
42 #include <rtw_security.h>
43 #include <rtw_pwrctrl.h>
45 #include <rtw_eeprom.h>
48 #include <rtw_debug.h>
50 #include <rtw_event.h>
52 #include <rtw_mlme_ext.h>
56 #include <rtw_br_ext.h>
65 #define SPEC_DEV_ID_NONE BIT(0)
66 #define SPEC_DEV_ID_DISABLE_HT BIT(1)
67 #define SPEC_DEV_ID_ENABLE_PS BIT(2)
68 #define SPEC_DEV_ID_RF_CONFIG_1T1R BIT(3)
69 #define SPEC_DEV_ID_RF_CONFIG_2T2R BIT(4)
70 #define SPEC_DEV_ID_ASSIGN_IFNAME BIT(5)
72 struct specific_device_id {
78 struct registry_priv {
83 struct ndis_802_11_ssid ssid;
84 u8 network_mode; /* infra, ad-hoc, auto */
85 u8 channel;/* ad-hoc support requirement */
86 u8 wireless_mode;/* A, B, G, auto */
87 u8 scan_mode;/* active, passive */
89 u8 preamble;/* long, short, auto */
90 u8 vrtl_carrier_sense;/* Enable, Disable, Auto */
91 u8 vcs_type;/* RTS/CTS, CTS-to-self */
116 struct wlan_bssid_ex dev_network;
120 u8 ampdu_enable;/* for tx */
122 u8 ampdu_amsdu;/* A-MPDU Supports A-MSDU is permitted */
128 u8 wifi_spec;/* !turbo_mode */
131 bool bAcceptAddbaReq;
136 u8 usbss_enable;/* 0:disable,1:enable */
137 u8 hwpdn_mode;/* 0:disable,1:enable,2:decide by EFUSE config */
138 u8 hwpwrp_detect;/* 0:disable,1:enable */
140 u8 hw_wps_pbc;/* 0:disable,1:enable */
142 u8 max_roaming_times; /* the max number driver will try */
144 u8 fw_iol; /* enable iol without other concern */
154 /* For registry parameters */
155 #define RGTRY_OFT(field) ((u32)FIELD_OFFSET(struct registry_priv, field))
156 #define RGTRY_SZ(field) sizeof(((struct registry_priv *)0)->field)
157 #define BSSID_OFT(field) ((u32)FIELD_OFFSET(struct wlan_bssid_ex, field))
158 #define BSSID_SZ(field) sizeof(((struct wlan_bssid_ex *)0)->field)
160 #define MAX_CONTINUAL_URB_ERR 4
166 /* For 92D, DMDP have 2 interface. */
170 /* In /Out Pipe information */
173 u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
177 /*-------- below is for USB INTERFACE --------*/
183 int ep_num[5]; /* endpoint number */
185 struct semaphore usb_suspend_sema;
186 struct mutex usb_vendor_req_mutex;
188 u8 *usb_alloc_vendor_req_buf;
189 u8 *usb_vendor_req_buf;
191 struct usb_interface *pusbintf;
192 struct usb_device *pusbdev;
194 ATOMIC_T continual_urb_error;
197 static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
199 /* todo: get interface type from dvobj and the return
200 * the dev accordingly */
201 return &dvobj->pusbintf->dev;
205 IFACE_PORT0, /* mapping to port0 for C/D series chips */
206 IFACE_PORT1, /* mapping to port1 for C/D series chip */
218 DRIVER_DISAPPEAR = 1,
219 DRIVER_REPLACE_DONGLE = 2,
223 int DriverState;/* for disable driver using module, use dongle toi
225 int pid[3];/* process id from UI, 0:wps, 1:hostapd, 2:dhcpcd */
226 int bDongle;/* build-in module or external dongle */
229 u16 interface_type;/* USB,SDIO,SPI,PCI */
231 struct dvobj_priv *dvobj;
232 struct mlme_priv mlmepriv;
233 struct mlme_ext_priv mlmeextpriv;
234 struct cmd_priv cmdpriv;
235 struct evt_priv evtpriv;
236 struct io_priv iopriv;
237 struct xmit_priv xmitpriv;
238 struct recv_priv recvpriv;
239 struct sta_priv stapriv;
240 struct security_priv securitypriv;
241 struct registry_priv registrypriv;
242 struct pwrctrl_priv pwrctrlpriv;
243 struct eeprom_priv eeprompriv;
244 struct led_priv ledpriv;
245 struct mp_priv mppriv;
247 #ifdef CONFIG_88EU_AP_MODE
248 struct hostapd_priv *phostapdpriv;
251 struct wifidirect_info wdinfo;
255 struct hal_ops HalFunc;
258 s32 bSurpriseRemoved;
259 s32 bCardDisableWOHSM;
264 u8 EepromAddressSize;
265 u8 hw_init_completed;
266 u8 bDriverIsGoingToUnload;
267 u8 init_adpt_in_progress;
274 void (*intf_start)(struct adapter *adapter);
275 void (*intf_stop)(struct adapter *adapter);
276 struct net_device *pnetdev;
278 /* used by rtw_rereg_nd_name related function */
279 struct rereg_nd_name_data {
280 struct net_device *old_pnetdev;
281 char old_ifname[IFNAMSIZ];
284 } rereg_nd_name_priv;
287 struct net_device_stats stats;
288 struct iw_statistics iwstats;
289 struct proc_dir_entry *dir_dev;/* for proc directory */
297 /* The driver will show up the desired channel number
298 * when this flag is 1. */
299 u8 bNotifyChannelChange;
300 #ifdef CONFIG_88EU_P2P
301 /* The driver will show the current P2P status when the
302 * upper application reads it. */
305 struct adapter *pbuddy_adapter;
307 struct mutex *hw_init_mutex;
309 spinlock_t br_ext_lock;
310 struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE];
311 int pppoe_connection_in_progress;
312 unsigned char pppoe_addr[MACADDRLEN];
313 unsigned char scdb_mac[MACADDRLEN];
314 unsigned char scdb_ip[4];
315 struct nat25_network_db_entry *scdb_entry;
316 unsigned char br_mac[MACADDRLEN];
317 unsigned char br_ip[4];
318 struct br_ext_info ethBrExtInfo;
322 unsigned char in_cta_test;
325 #define adapter_to_dvobj(adapter) (adapter->dvobj)
327 int rtw_handle_dualmac(struct adapter *adapter, bool init);
329 static inline u8 *myid(struct eeprom_priv *peepriv)
331 return peepriv->mac_addr;
334 #endif /* __DRV_TYPES_H__ */