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 usbss_enable;/* 0:disable,1:enable */
115 u8 hwpdn_mode;/* 0:disable,1:enable,2:decide by EFUSE config */
116 u8 hwpwrp_detect;/* 0:disable,1:enable */
118 u8 hw_wps_pbc;/* 0:disable,1:enable */
120 u8 max_roaming_times; /* max number driver will try to roaming */
133 #define MAX_CONTINUAL_URB_ERR 4
135 #define GET_PRIMARY_ADAPTER(padapter) \
136 (((struct rtw_adapter *)padapter)->dvobj->if1)
139 IFACE_ID0, /* maping to PRIMARY_ADAPTER */
140 IFACE_ID1, /* maping to SECONDARY_ADAPTER */
147 struct rtw_adapter *if1; /* PRIMARY_ADAPTER */
148 struct rtw_adapter *if2; /* SECONDARY_ADAPTER */
150 /* for local/global synchronization */
151 struct mutex hw_init_mutex;
152 struct mutex h2c_fwcmd_mutex;
153 struct mutex setch_mutex;
154 struct mutex setbw_mutex;
156 unsigned char oper_channel; /* saved chan info when set chan bw */
157 unsigned char oper_bwmode;
158 unsigned char oper_ch_offset;/* PRIME_CHNL_OFFSET */
160 struct rtw_adapter *padapters[IFACE_ID_MAX];
161 u8 iface_nums; /* total number of ifaces used runtime */
163 /* For 92D, DMDP have 2 interface. */
167 /* In /Out Pipe information */
170 u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
172 /*-------- below is for USB INTERFACE --------*/
178 int ep_num[5]; /* endpoint number */
180 struct mutex usb_vendor_req_mutex;
182 u8 *usb_alloc_vendor_req_buf;
183 u8 *usb_vendor_req_buf;
185 struct usb_interface *pusbintf;
186 struct usb_device *pusbdev;
187 atomic_t continual_urb_error;
189 /*-------- below is for PCIE INTERFACE --------*/
193 static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj)
195 /* todo: get interface type from dvobj and the return the dev accordingly */
196 return &dvobj->pusbintf->dev;
200 IFACE_PORT0, /* mapping to port0 for C/D series chips */
201 IFACE_PORT1, /* mapping to port1 for C/D series chip */
212 int pid[3];/* process id from UI, 0:wps, 1:hostapd, 2:dhcpcd */
213 int bDongle;/* build-in module or external dongle */
217 struct dvobj_priv *dvobj;
218 struct mlme_priv mlmepriv;
219 struct mlme_ext_priv mlmeextpriv;
220 struct cmd_priv cmdpriv;
221 struct evt_priv evtpriv;
222 struct xmit_priv xmitpriv;
223 struct recv_priv recvpriv;
224 struct sta_priv stapriv;
225 struct security_priv securitypriv;
226 struct registry_priv registrypriv;
227 struct pwrctrl_priv pwrctrlpriv;
228 struct eeprom_priv eeprompriv;
229 struct led_priv ledpriv;
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;
260 /* The driver will show the desired chan nor when this flag is 1. */
261 u8 bNotifyChannelChange;
262 struct rtw_adapter *pbuddy_adapter;
264 /* extend to support multi interface */
265 /* IFACE_ID0 is equals to PRIMARY_ADAPTER */
266 /* IFACE_ID1 is equals to SECONDARY_ADAPTER */
270 #define adapter_to_dvobj(adapter) (adapter->dvobj)
272 int rtw_handle_dualmac23a(struct rtw_adapter *adapter, bool init);
274 static inline u8 *myid(struct eeprom_priv *peepriv)
276 return peepriv->mac_addr;
279 #endif /* __DRV_TYPES_H__ */