1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2007 - 2012 Realtek Corporation. */
4 /*-----------------------------------------------------------------------------
6 For type defines and data structure defines
8 ------------------------------------------------------------------------------*/
10 #ifndef __DRV_TYPES_H__
11 #define __DRV_TYPES_H__
13 #define DRV_NAME "r8188eu"
15 #include "osdep_service.h"
16 #include "wlan_bssdef.h"
23 #include "rtw_security.h"
24 #include "rtw_pwrctrl.h"
26 #include "rtw_eeprom.h"
29 #include "rtw_debug.h"
31 #include "rtw_event.h"
33 #include "rtw_mlme_ext.h"
36 #include "rtw_br_ext.h"
37 #include "rtl8188e_hal.h"
39 #define DRIVERVERSION "v4.1.4_6773.20130222"
41 struct registry_priv {
46 struct ndis_802_11_ssid ssid;
47 u8 network_mode; /* infra, ad-hoc, auto */
48 u8 channel;/* ad-hoc support requirement */
49 u8 wireless_mode;/* A, B, G, auto */
50 u8 scan_mode;/* active, passive */
52 u8 preamble;/* long, short, auto */
53 u8 vrtl_carrier_sense;/* Enable, Disable, Auto */
54 u8 vcs_type;/* RTS/CTS, CTS-to-self */
80 struct wlan_bssid_ex dev_network;
84 u8 ampdu_enable;/* for tx */
86 u8 ampdu_amsdu;/* A-MPDU Supports A-MSDU is permitted */
91 u8 wifi_spec;/* !turbo_mode */
99 u8 usbss_enable;/* 0:disable,1:enable */
100 u8 hwpdn_mode;/* 0:disable,1:enable,2:decide by EFUSE config */
101 u8 hwpwrp_detect;/* 0:disable,1:enable */
103 u8 hw_wps_pbc;/* 0:disable,1:enable */
105 u8 max_roaming_times; /* the max number driver will try */
107 u8 fw_iol; /* enable iol without other concern */
117 #define MAX_CONTINUAL_URB_ERR 4
127 /* For 92D, DMDP have 2 interface. */
131 /* In /Out Pipe information */
134 u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
136 struct rt_firmware firmware;
138 /*-------- below is for USB INTERFACE --------*/
142 struct usb_interface *pusbintf;
143 struct usb_device *pusbdev;
145 atomic_t continual_urb_error;
148 static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
150 /* todo: get interface type from dvobj and the return
151 * the dev accordingly */
152 return &dvobj->pusbintf->dev;
156 int pid[3];/* process id from UI, 0:wps, 1:hostapd, 2:dhcpcd */
158 struct dvobj_priv *dvobj;
159 struct mlme_priv mlmepriv;
160 struct mlme_ext_priv mlmeextpriv;
161 struct cmd_priv cmdpriv;
162 struct evt_priv evtpriv;
163 struct io_priv iopriv;
164 struct xmit_priv xmitpriv;
165 struct recv_priv recvpriv;
166 struct sta_priv stapriv;
167 struct security_priv securitypriv;
168 struct registry_priv registrypriv;
169 struct pwrctrl_priv pwrctrlpriv;
170 struct eeprom_priv eeprompriv;
171 struct led_priv ledpriv;
172 struct wifidirect_info wdinfo;
174 struct hal_data_8188e haldata;
177 s32 bSurpriseRemoved;
178 s32 bCardDisableWOHSM;
180 u8 hw_init_completed;
184 void (*intf_start)(struct adapter *adapter);
185 void (*intf_stop)(struct adapter *adapter);
186 struct net_device *pnetdev;
188 /* used by rtw_rereg_nd_name related function */
189 struct rereg_nd_name_data {
190 struct net_device *old_pnetdev;
191 char old_ifname[IFNAMSIZ];
194 } rereg_nd_name_priv;
197 struct net_device_stats stats;
198 struct iw_statistics iwstats;
199 struct proc_dir_entry *dir_dev;/* for proc directory */
206 /* The driver will show up the desired channel number
207 * when this flag is 1. */
208 u8 bNotifyChannelChange;
209 /* The driver will show the current P2P status when the
210 * upper application reads it. */
212 struct adapter *pbuddy_adapter;
214 struct mutex *hw_init_mutex;
216 spinlock_t br_ext_lock;
217 struct nat25_network_db_entry *nethash[NAT25_HASH_SIZE];
218 int pppoe_connection_in_progress;
219 unsigned char pppoe_addr[ETH_ALEN];
220 unsigned char scdb_mac[ETH_ALEN];
221 unsigned char scdb_ip[4];
222 struct nat25_network_db_entry *scdb_entry;
223 unsigned char br_mac[ETH_ALEN];
224 unsigned char br_ip[4];
225 struct br_ext_info ethBrExtInfo;
228 #define adapter_to_dvobj(adapter) (adapter->dvobj)
230 int rtw_handle_dualmac(struct adapter *adapter, bool init);
232 static inline u8 *myid(struct eeprom_priv *peepriv)
234 return peepriv->mac_addr;
237 #endif /* __DRV_TYPES_H__ */