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 ******************************************************************************/
15 /*-----------------------------------------------------------------------------
17 For type defines and data structure defines
19 ------------------------------------------------------------------------------*/
22 #ifndef __DRV_TYPES_H__
23 #define __DRV_TYPES_H__
25 #define DRV_NAME "r8188eu"
27 #include <osdep_service.h>
28 #include <wlan_bssdef.h>
36 #include <rtw_security.h>
37 #include <rtw_pwrctrl.h>
38 #include <rtw_eeprom.h>
41 #include <rtw_debug.h>
43 #include <rtw_event.h>
45 #include <rtw_mlme_ext.h>
48 #define SPEC_DEV_ID_NONE BIT(0)
49 #define SPEC_DEV_ID_DISABLE_HT BIT(1)
50 #define SPEC_DEV_ID_ENABLE_PS BIT(2)
51 #define SPEC_DEV_ID_RF_CONFIG_1T1R BIT(3)
52 #define SPEC_DEV_ID_RF_CONFIG_2T2R BIT(4)
53 #define SPEC_DEV_ID_ASSIGN_IFNAME BIT(5)
55 struct registry_priv {
60 struct ndis_802_11_ssid ssid;
61 u8 network_mode; /* infra, ad-hoc, auto */
62 u8 channel;/* ad-hoc support requirement */
63 u8 wireless_mode;/* A, B, G, auto */
64 u8 scan_mode;/* active, passive */
66 u8 preamble;/* long, short, auto */
67 u8 vrtl_carrier_sense;/* Enable, Disable, Auto */
68 u8 vcs_type;/* RTS/CTS, CTS-to-self */
93 struct wlan_bssid_ex dev_network;
97 u8 ampdu_enable;/* for tx */
99 u8 ampdu_amsdu;/* A-MPDU Supports A-MSDU is permitted */
105 u8 wifi_spec;/* !turbo_mode */
108 bool accept_addba_req; /* true = accept AP's Add BA req */
113 u8 usbss_enable;/* 0:disable,1:enable */
114 u8 hwpdn_mode;/* 0:disable,1:enable,2:decide by EFUSE config */
115 u8 hwpwrp_detect;/* 0:disable,1:enable */
117 u8 hw_wps_pbc;/* 0:disable,1:enable */
119 u8 max_roaming_times; /* the max number driver will try */
121 u8 fw_iol; /* enable iol without other concern */
132 /* For registry parameters */
133 #define RGTRY_OFT(field) ((u32)offsetof(struct registry_priv, field))
134 #define RGTRY_SZ(field) sizeof(((struct registry_priv *)0)->field)
135 #define BSSID_OFT(field) ((u32)offsetofT(struct wlan_bssid_ex, field))
136 #define BSSID_SZ(field) sizeof(((struct wlan_bssid_ex *)0)->field)
138 #define MAX_CONTINUAL_URB_ERR 4
142 /* For 92D, DMDP have 2 interface. */
146 /* In /Out Pipe information */
149 u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
151 /*-------- below is for USB INTERFACE --------*/
157 int ep_num[5]; /* endpoint number */
158 struct mutex usb_vendor_req_mutex;
160 u8 *usb_vendor_req_buf;
162 struct usb_interface *pusbintf;
163 struct usb_device *pusbdev;
166 static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
168 /* todo: get interface type from dvobj and the return
169 * the dev accordingly */
170 return &dvobj->pusbintf->dev;
174 struct dvobj_priv *dvobj;
175 struct mlme_priv mlmepriv;
176 struct mlme_ext_priv mlmeextpriv;
177 struct cmd_priv cmdpriv;
178 struct xmit_priv xmitpriv;
179 struct recv_priv recvpriv;
180 struct sta_priv stapriv;
181 struct security_priv securitypriv;
182 struct registry_priv registrypriv;
183 struct pwrctrl_priv pwrctrlpriv;
184 struct eeprom_priv eeprompriv;
185 struct led_priv ledpriv;
187 #ifdef CONFIG_88EU_AP_MODE
188 struct hostapd_priv *phostapdpriv;
191 struct wifidirect_info wdinfo;
194 struct hal_ops HalFunc;
197 s32 bSurpriseRemoved;
199 u8 hw_init_completed;
203 void (*intf_start)(struct adapter *adapter);
204 void (*intf_stop)(struct adapter *adapter);
205 struct net_device *pnetdev;
206 struct net_device *pmondev;
208 /* used by rtw_rereg_nd_name related function */
209 struct rereg_nd_name_data {
210 struct net_device *old_pnetdev;
211 char old_ifname[IFNAMSIZ];
214 } rereg_nd_name_priv;
217 struct net_device_stats stats;
218 struct iw_statistics iwstats;
219 struct proc_dir_entry *dir_dev;/* for proc directory */
226 /* The driver will show up the desired channel number
227 * when this flag is 1. */
228 u8 bNotifyChannelChange;
230 struct mutex hw_init_mutex;
232 spinlock_t br_ext_lock;
236 unsigned char in_cta_test;
239 #define adapter_to_dvobj(adapter) (adapter->dvobj)
241 int rtw_handle_dualmac(struct adapter *adapter, bool init);
243 static inline u8 *myid(struct eeprom_priv *peepriv)
245 return peepriv->mac_addr;
248 #endif /* __DRV_TYPES_H__ */