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 #include <osdep_service.h>
26 #include <wlan_bssdef.h>
45 #include <rtw_security.h>
46 #include <rtw_pwrctrl.h>
48 #include <rtw_eeprom.h>
51 #include <rtw_debug.h>
53 #include <rtw_event.h>
55 #include <rtw_mlme_ext.h>
58 #include "ioctl_cfg80211.h"
60 struct registry_priv {
63 struct cfg80211_ssid ssid;
64 u8 channel;/* ad-hoc support requirement */
65 u8 wireless_mode;/* A, B, G, auto */
66 u8 scan_mode;/* active, passive */
67 u8 preamble;/* long, short, auto */
68 u8 vrtl_carrier_sense;/* Enable, Disable, Auto */
69 u8 vcs_type;/* RTS/CTS, CTS-to-self */
88 struct wlan_bssid_ex dev_network;
92 u8 ampdu_enable;/* for tx */
94 u8 ampdu_amsdu;/* A-MPDU Supports A-MSDU is permitted */
100 u8 wifi_spec;/* !turbo_mode */
103 #ifdef CONFIG_8723AU_BT_COEXIST
109 bool bAcceptAddbaReq;
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; /* max number driver will try to roaming */
132 #define MAX_CONTINUAL_URB_ERR 4
134 #define GET_PRIMARY_ADAPTER(padapter) \
135 (((struct rtw_adapter *)padapter)->dvobj->if1)
138 IFACE_ID0, /* maping to PRIMARY_ADAPTER */
139 IFACE_ID1, /* maping to SECONDARY_ADAPTER */
146 struct rtw_adapter *if1; /* PRIMARY_ADAPTER */
147 struct rtw_adapter *if2; /* SECONDARY_ADAPTER */
149 /* for local/global synchronization */
150 struct mutex hw_init_mutex;
151 struct mutex h2c_fwcmd_mutex;
152 struct mutex setch_mutex;
153 struct mutex setbw_mutex;
155 unsigned char oper_channel; /* saved chan info when set chan bw */
156 unsigned char oper_bwmode;
157 unsigned char oper_ch_offset;/* PRIME_CHNL_OFFSET */
159 struct rtw_adapter *padapters[IFACE_ID_MAX];
160 u8 iface_nums; /* total number of ifaces used runtime */
162 /* For 92D, DMDP have 2 interface. */
166 /* In /Out Pipe information */
169 u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
171 /*-------- below is for USB INTERFACE --------*/
177 int ep_num[5]; /* endpoint number */
179 struct mutex usb_vendor_req_mutex;
187 struct usb_interface *pusbintf;
188 struct usb_device *pusbdev;
189 atomic_t continual_urb_error;
191 /*-------- below is for PCIE INTERFACE --------*/
195 static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
197 /* todo: get interface type from dvobj and the return the dev accordingly */
198 return &dvobj->pusbintf->dev;
202 IFACE_PORT0, /* mapping to port0 for C/D series chips */
203 IFACE_PORT1, /* mapping to port1 for C/D series chip */
214 int pid[3];/* process id from UI, 0:wps, 1:hostapd, 2:dhcpcd */
215 int bDongle;/* build-in module or external dongle */
219 struct dvobj_priv *dvobj;
220 struct mlme_priv mlmepriv;
221 struct mlme_ext_priv mlmeextpriv;
222 struct cmd_priv cmdpriv;
223 struct evt_priv evtpriv;
224 struct xmit_priv xmitpriv;
225 struct recv_priv recvpriv;
226 struct sta_priv stapriv;
227 struct security_priv securitypriv;
228 struct registry_priv registrypriv;
229 struct pwrctrl_priv pwrctrlpriv;
230 struct eeprom_priv eeprompriv;
231 struct led_priv ledpriv;
238 s32 bSurpriseRemoved;
239 s32 bCardDisableWOHSM;
244 u8 EepromAddressSize;
245 u8 hw_init_completed;
246 u8 bDriverIsGoingToUnload;
247 u8 init_adpt_in_progress;
250 struct net_device *pnetdev;
252 /* used by rtw_rereg_nd_name related function */
254 struct net_device_stats stats;
256 struct wireless_dev *rtw_wdev;
263 /* extend to support multi interface */
264 /* IFACE_ID0 is equals to PRIMARY_ADAPTER */
265 /* IFACE_ID1 is equals to SECONDARY_ADAPTER */
269 #define adapter_to_dvobj(adapter) (adapter->dvobj)
271 static inline u8 *myid(struct eeprom_priv *peepriv)
273 return peepriv->mac_addr;
276 #endif /* __DRV_TYPES_H__ */