Commit | Line | Data |
---|---|---|
a7c947b7 LF |
1 | /****************************************************************************** |
2 | * | |
3 | * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. | |
4 | * | |
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. | |
8 | * | |
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 | |
12 | * more details. | |
13 | * | |
a7c947b7 LF |
14 | ******************************************************************************/ |
15 | /*----------------------------------------------------------------------------- | |
16 | ||
17 | For type defines and data structure defines | |
18 | ||
19 | ------------------------------------------------------------------------------*/ | |
20 | ||
21 | ||
22 | #ifndef __DRV_TYPES_H__ | |
23 | #define __DRV_TYPES_H__ | |
24 | ||
25 | #define DRV_NAME "r8188eu" | |
26 | ||
27 | #include <osdep_service.h> | |
28 | #include <wlan_bssdef.h> | |
a7c947b7 LF |
29 | #include <rtw_ht.h> |
30 | #include <rtw_cmd.h> | |
a7c947b7 LF |
31 | #include <rtw_xmit.h> |
32 | #include <rtw_recv.h> | |
33 | #include <hal_intf.h> | |
34 | #include <hal_com.h> | |
35 | #include <rtw_qos.h> | |
36 | #include <rtw_security.h> | |
37 | #include <rtw_pwrctrl.h> | |
a7c947b7 LF |
38 | #include <rtw_eeprom.h> |
39 | #include <sta_info.h> | |
40 | #include <rtw_mlme.h> | |
41 | #include <rtw_debug.h> | |
42 | #include <rtw_rf.h> | |
43 | #include <rtw_event.h> | |
44 | #include <rtw_led.h> | |
45 | #include <rtw_mlme_ext.h> | |
a7c947b7 | 46 | #include <rtw_ap.h> |
a7c947b7 | 47 | |
a7c947b7 LF |
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) | |
54 | ||
a7c947b7 | 55 | struct registry_priv { |
a7c947b7 | 56 | struct ndis_802_11_ssid ssid; |
a7c947b7 LF |
57 | u8 channel;/* ad-hoc support requirement */ |
58 | u8 wireless_mode;/* A, B, G, auto */ | |
a7c947b7 LF |
59 | u8 preamble;/* long, short, auto */ |
60 | u8 vrtl_carrier_sense;/* Enable, Disable, Auto */ | |
61 | u8 vcs_type;/* RTS/CTS, CTS-to-self */ | |
62 | u16 rts_thresh; | |
63 | u16 frag_thresh; | |
a7c947b7 LF |
64 | u8 power_mgnt; |
65 | u8 ips_mode; | |
66 | u8 smart_ps; | |
a7c947b7 LF |
67 | u8 mp_mode; |
68 | u8 software_encrypt; | |
69 | u8 software_decrypt; | |
70 | u8 acm_method; | |
71 | /* UAPSD */ | |
72 | u8 wmm_enable; | |
73 | u8 uapsd_enable; | |
a7c947b7 LF |
74 | |
75 | struct wlan_bssid_ex dev_network; | |
76 | ||
77 | u8 ht_enable; | |
78 | u8 cbw40_enable; | |
79 | u8 ampdu_enable;/* for tx */ | |
80 | u8 rx_stbc; | |
81 | u8 ampdu_amsdu;/* A-MPDU Supports A-MSDU is permitted */ | |
a7c947b7 LF |
82 | |
83 | u8 wifi_spec;/* !turbo_mode */ | |
84 | ||
85 | u8 channel_plan; | |
d6c6ad96 | 86 | bool accept_addba_req; /* true = accept AP's Add BA req */ |
a7c947b7 LF |
87 | |
88 | u8 antdiv_cfg; | |
89 | u8 antdiv_type; | |
90 | ||
91 | u8 usbss_enable;/* 0:disable,1:enable */ | |
92 | u8 hwpdn_mode;/* 0:disable,1:enable,2:decide by EFUSE config */ | |
a7c947b7 LF |
93 | |
94 | u8 max_roaming_times; /* the max number driver will try */ | |
95 | ||
96 | u8 fw_iol; /* enable iol without other concern */ | |
97 | ||
98 | u8 enable80211d; | |
99 | ||
100 | u8 ifname[16]; | |
101 | u8 if2name[16]; | |
102 | ||
103 | u8 notch_filter; | |
0a0796eb | 104 | bool monitor_enable; |
a7c947b7 LF |
105 | }; |
106 | ||
107 | /* For registry parameters */ | |
5e3027b6 | 108 | #define RGTRY_OFT(field) ((u32)offsetof(struct registry_priv, field)) |
a7c947b7 | 109 | #define RGTRY_SZ(field) sizeof(((struct registry_priv *)0)->field) |
5e3027b6 | 110 | #define BSSID_OFT(field) ((u32)offsetofT(struct wlan_bssid_ex, field)) |
a7c947b7 LF |
111 | #define BSSID_SZ(field) sizeof(((struct wlan_bssid_ex *)0)->field) |
112 | ||
113 | #define MAX_CONTINUAL_URB_ERR 4 | |
114 | ||
115 | struct dvobj_priv { | |
116 | struct adapter *if1; | |
a7c947b7 LF |
117 | /* For 92D, DMDP have 2 interface. */ |
118 | u8 InterfaceNumber; | |
119 | u8 NumInterfaces; | |
120 | ||
121 | /* In /Out Pipe information */ | |
122 | int RtInPipe[2]; | |
123 | int RtOutPipe[3]; | |
124 | u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */ | |
125 | ||
a7c947b7 | 126 | /*-------- below is for USB INTERFACE --------*/ |
a7c947b7 LF |
127 | u8 ishighspeed; |
128 | u8 RtNumInPipes; | |
129 | u8 RtNumOutPipes; | |
a7c947b7 LF |
130 | struct mutex usb_vendor_req_mutex; |
131 | ||
a7c947b7 LF |
132 | struct usb_interface *pusbintf; |
133 | struct usb_device *pusbdev; | |
a7c947b7 LF |
134 | }; |
135 | ||
136 | static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj) | |
137 | { | |
138 | /* todo: get interface type from dvobj and the return | |
139 | * the dev accordingly */ | |
140 | return &dvobj->pusbintf->dev; | |
141 | }; | |
142 | ||
a7c947b7 | 143 | struct adapter { |
a7c947b7 LF |
144 | struct dvobj_priv *dvobj; |
145 | struct mlme_priv mlmepriv; | |
146 | struct mlme_ext_priv mlmeextpriv; | |
147 | struct cmd_priv cmdpriv; | |
a7c947b7 LF |
148 | struct xmit_priv xmitpriv; |
149 | struct recv_priv recvpriv; | |
150 | struct sta_priv stapriv; | |
151 | struct security_priv securitypriv; | |
152 | struct registry_priv registrypriv; | |
153 | struct pwrctrl_priv pwrctrlpriv; | |
154 | struct eeprom_priv eeprompriv; | |
155 | struct led_priv ledpriv; | |
a7c947b7 | 156 | |
a7c947b7 | 157 | void *HalData; |
a7c947b7 LF |
158 | |
159 | s32 bDriverStopped; | |
160 | s32 bSurpriseRemoved; | |
a7c947b7 | 161 | |
a7c947b7 | 162 | u8 hw_init_completed; |
a7c947b7 LF |
163 | |
164 | void *cmdThread; | |
a7c947b7 LF |
165 | void (*intf_start)(struct adapter *adapter); |
166 | void (*intf_stop)(struct adapter *adapter); | |
167 | struct net_device *pnetdev; | |
0a0796eb | 168 | struct net_device *pmondev; |
a7c947b7 | 169 | |
a7c947b7 LF |
170 | int bup; |
171 | struct net_device_stats stats; | |
172 | struct iw_statistics iwstats; | |
173 | struct proc_dir_entry *dir_dev;/* for proc directory */ | |
174 | ||
175 | int net_closed; | |
176 | u8 bFWReady; | |
a7c947b7 LF |
177 | u8 bReadPortCancel; |
178 | u8 bWritePortCancel; | |
179 | u8 bRxRSSIDisplay; | |
a7c947b7 | 180 | |
fc8b5ae9 | 181 | struct mutex hw_init_mutex; |
a7c947b7 LF |
182 | }; |
183 | ||
184 | #define adapter_to_dvobj(adapter) (adapter->dvobj) | |
185 | ||
186 | int rtw_handle_dualmac(struct adapter *adapter, bool init); | |
187 | ||
188 | static inline u8 *myid(struct eeprom_priv *peepriv) | |
189 | { | |
190 | return peepriv->mac_addr; | |
191 | } | |
192 | ||
193 | #endif /* __DRV_TYPES_H__ */ |