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>
54 #include <rtw_mlme_ext.h>
57 #include "ioctl_cfg80211.h"
59 struct registry_priv {
62 struct cfg80211_ssid ssid;
63 u8 channel;/* ad-hoc support requirement */
64 u8 wireless_mode;/* A, B, G, auto */
65 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 */
87 struct wlan_bssid_ex dev_network;
91 u8 ampdu_enable;/* for tx */
93 u8 ampdu_amsdu;/* A-MPDU Supports A-MSDU is permitted */
99 u8 wifi_spec;/* !turbo_mode */
102 #ifdef CONFIG_8723AU_BT_COEXIST
108 bool bAcceptAddbaReq;
113 u8 hwpdn_mode;/* 0:disable,1:enable,2:decide by EFUSE config */
114 u8 hwpwrp_detect;/* 0:disable,1:enable */
116 u8 hw_wps_pbc;/* 0:disable,1:enable */
118 u8 max_roaming_times; /* max number driver will try to roaming */
131 #define MAX_CONTINUAL_URB_ERR 4
133 #define GET_PRIMARY_ADAPTER(padapter) \
134 (((struct rtw_adapter *)padapter)->dvobj->if1)
137 IFACE_ID0, /* maping to PRIMARY_ADAPTER */
138 IFACE_ID1, /* maping to SECONDARY_ADAPTER */
145 struct rtw_adapter *if1; /* PRIMARY_ADAPTER */
146 struct rtw_adapter *if2; /* SECONDARY_ADAPTER */
148 /* for local/global synchronization */
149 struct mutex hw_init_mutex;
150 struct mutex h2c_fwcmd_mutex;
151 struct mutex setch_mutex;
152 struct mutex setbw_mutex;
154 unsigned char oper_channel; /* saved chan info when set chan bw */
155 unsigned char oper_bwmode;
156 unsigned char oper_ch_offset;/* PRIME_CHNL_OFFSET */
158 struct rtw_adapter *padapters[IFACE_ID_MAX];
159 u8 iface_nums; /* total number of ifaces used runtime */
161 /* For 92D, DMDP have 2 interface. */
165 /* In /Out Pipe information */
168 u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
170 /*-------- below is for USB INTERFACE --------*/
176 int ep_num[5]; /* endpoint number */
178 struct mutex usb_vendor_req_mutex;
186 struct usb_interface *pusbintf;
187 struct usb_device *pusbdev;
188 atomic_t continual_urb_error;
190 /*-------- below is for PCIE INTERFACE --------*/
194 static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
196 /* todo: get interface type from dvobj and the return the dev accordingly */
197 return &dvobj->pusbintf->dev;
201 IFACE_PORT0, /* mapping to port0 for C/D series chips */
202 IFACE_PORT1, /* mapping to port1 for C/D series chip */
213 int pid[3];/* process id from UI, 0:wps, 1:hostapd, 2:dhcpcd */
214 int bDongle;/* build-in module or external dongle */
218 struct dvobj_priv *dvobj;
219 struct mlme_priv mlmepriv;
220 struct mlme_ext_priv mlmeextpriv;
221 struct cmd_priv cmdpriv;
222 struct evt_priv evtpriv;
223 struct xmit_priv xmitpriv;
224 struct recv_priv recvpriv;
225 struct sta_priv stapriv;
226 struct security_priv securitypriv;
227 struct registry_priv registrypriv;
228 struct pwrctrl_priv pwrctrlpriv;
229 struct eeprom_priv eeprompriv;
236 s32 bSurpriseRemoved;
237 s32 bCardDisableWOHSM;
242 u8 EepromAddressSize;
243 u8 hw_init_completed;
244 u8 bDriverIsGoingToUnload;
245 u8 init_adpt_in_progress;
248 struct net_device *pnetdev;
250 /* used by rtw_rereg_nd_name related function */
252 struct net_device_stats stats;
254 struct wireless_dev *rtw_wdev;
261 /* extend to support multi interface */
262 /* IFACE_ID0 is equals to PRIMARY_ADAPTER */
263 /* IFACE_ID1 is equals to SECONDARY_ADAPTER */
267 #define adapter_to_dvobj(adapter) (adapter->dvobj)
269 static inline u8 *myid(struct eeprom_priv *peepriv)
271 return peepriv->mac_addr;
274 #endif /* __DRV_TYPES_H__ */