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>
41 #include <rtw_security.h>
42 #include <rtw_pwrctrl.h>
43 #include <rtw_eeprom.h>
46 #include <rtw_debug.h>
48 #include <rtw_event.h>
50 #include <rtw_mlme_ext.h>
53 #define SPEC_DEV_ID_NONE BIT(0)
54 #define SPEC_DEV_ID_DISABLE_HT BIT(1)
55 #define SPEC_DEV_ID_ENABLE_PS BIT(2)
56 #define SPEC_DEV_ID_RF_CONFIG_1T1R BIT(3)
57 #define SPEC_DEV_ID_RF_CONFIG_2T2R BIT(4)
58 #define SPEC_DEV_ID_ASSIGN_IFNAME BIT(5)
60 struct registry_priv {
65 struct ndis_802_11_ssid ssid;
66 u8 network_mode; /* infra, ad-hoc, auto */
67 u8 channel;/* ad-hoc support requirement */
68 u8 wireless_mode;/* A, B, G, auto */
69 u8 scan_mode;/* active, passive */
71 u8 preamble;/* long, short, auto */
72 u8 vrtl_carrier_sense;/* Enable, Disable, Auto */
73 u8 vcs_type;/* RTS/CTS, CTS-to-self */
98 struct wlan_bssid_ex dev_network;
102 u8 ampdu_enable;/* for tx */
104 u8 ampdu_amsdu;/* A-MPDU Supports A-MSDU is permitted */
110 u8 wifi_spec;/* !turbo_mode */
113 bool bAcceptAddbaReq;
118 u8 usbss_enable;/* 0:disable,1:enable */
119 u8 hwpdn_mode;/* 0:disable,1:enable,2:decide by EFUSE config */
120 u8 hwpwrp_detect;/* 0:disable,1:enable */
122 u8 hw_wps_pbc;/* 0:disable,1:enable */
124 u8 max_roaming_times; /* the max number driver will try */
126 u8 fw_iol; /* enable iol without other concern */
136 /* For registry parameters */
137 #define RGTRY_OFT(field) ((u32)FIELD_OFFSET(struct registry_priv, field))
138 #define RGTRY_SZ(field) sizeof(((struct registry_priv *)0)->field)
139 #define BSSID_OFT(field) ((u32)FIELD_OFFSET(struct wlan_bssid_ex, field))
140 #define BSSID_SZ(field) sizeof(((struct wlan_bssid_ex *)0)->field)
142 #define MAX_CONTINUAL_URB_ERR 4
146 /* For 92D, DMDP have 2 interface. */
150 /* In /Out Pipe information */
153 u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
155 /*-------- below is for USB INTERFACE --------*/
161 int ep_num[5]; /* endpoint number */
162 struct mutex usb_vendor_req_mutex;
164 u8 *usb_vendor_req_buf;
166 struct usb_interface *pusbintf;
167 struct usb_device *pusbdev;
170 static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
172 /* todo: get interface type from dvobj and the return
173 * the dev accordingly */
174 return &dvobj->pusbintf->dev;
180 struct dvobj_priv *dvobj;
181 struct mlme_priv mlmepriv;
182 struct mlme_ext_priv mlmeextpriv;
183 struct cmd_priv cmdpriv;
184 struct xmit_priv xmitpriv;
185 struct recv_priv recvpriv;
186 struct sta_priv stapriv;
187 struct security_priv securitypriv;
188 struct registry_priv registrypriv;
189 struct pwrctrl_priv pwrctrlpriv;
190 struct eeprom_priv eeprompriv;
191 struct led_priv ledpriv;
193 #ifdef CONFIG_88EU_AP_MODE
194 struct hostapd_priv *phostapdpriv;
197 struct wifidirect_info wdinfo;
200 struct hal_ops HalFunc;
203 s32 bSurpriseRemoved;
205 u8 hw_init_completed;
209 void (*intf_start)(struct adapter *adapter);
210 void (*intf_stop)(struct adapter *adapter);
211 struct net_device *pnetdev;
213 /* used by rtw_rereg_nd_name related function */
214 struct rereg_nd_name_data {
215 struct net_device *old_pnetdev;
216 char old_ifname[IFNAMSIZ];
219 } rereg_nd_name_priv;
222 struct net_device_stats stats;
223 struct iw_statistics iwstats;
224 struct proc_dir_entry *dir_dev;/* for proc directory */
231 /* The driver will show up the desired channel number
232 * when this flag is 1. */
233 u8 bNotifyChannelChange;
235 struct mutex hw_init_mutex;
237 spinlock_t br_ext_lock;
241 unsigned char in_cta_test;
244 #define adapter_to_dvobj(adapter) (adapter->dvobj)
246 int rtw_handle_dualmac(struct adapter *adapter, bool init);
248 static inline u8 *myid(struct eeprom_priv *peepriv)
250 return peepriv->mac_addr;
253 #endif /* __DRV_TYPES_H__ */