Commit | Line | Data |
---|---|---|
94a79942 LF |
1 | /****************************************************************************** |
2 | * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved. | |
3 | * | |
4 | * Based on the r8180 driver, which is: | |
559a4c31 | 5 | * Copyright 2004-2005 Andrea Merello <andrea.merello@gmail.com>, et al. |
94a79942 LF |
6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of version 2 of the GNU General Public License as | |
8 | * published by the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
13 | * more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License along with | |
16 | * this program; if not, write to the Free Software Foundation, Inc., | |
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | |
18 | * | |
19 | * The full GNU General Public License is included in this distribution in the | |
20 | * file called LICENSE. | |
21 | * | |
22 | * Contact Information: | |
23 | * wlanfae <wlanfae@realtek.com> | |
24 | ******************************************************************************/ | |
25 | ||
26 | #ifndef _RTL_CORE_H | |
27 | #define _RTL_CORE_H | |
28 | ||
29 | #include <linux/module.h> | |
30 | #include <linux/kernel.h> | |
94a79942 LF |
31 | #include <linux/ioport.h> |
32 | #include <linux/sched.h> | |
33 | #include <linux/types.h> | |
34 | #include <linux/interrupt.h> | |
35 | #include <linux/slab.h> | |
36 | #include <linux/netdevice.h> | |
37 | #include <linux/pci.h> | |
38 | #include <linux/etherdevice.h> | |
39 | #include <linux/delay.h> | |
40 | #include <linux/rtnetlink.h> | |
41 | #include <linux/wireless.h> | |
42 | #include <linux/timer.h> | |
43 | #include <linux/proc_fs.h> | |
44 | #include <linux/if_arp.h> | |
45 | #include <linux/random.h> | |
1344ee25 | 46 | #include <linux/io.h> |
ea74fedc SM |
47 | |
48 | /* Need this defined before including local include files */ | |
49 | #define DRV_NAME "rtl819xE" | |
50 | ||
3d461c91 | 51 | #include "../rtllib.h" |
94a79942 | 52 | |
3d461c91 | 53 | #include "../dot11d.h" |
94a79942 LF |
54 | |
55 | #include "r8192E_firmware.h" | |
56 | #include "r8192E_hw.h" | |
57 | ||
58 | #include "r8190P_def.h" | |
59 | #include "r8192E_dev.h" | |
60 | ||
94a79942 LF |
61 | #include "rtl_eeprom.h" |
62 | #include "rtl_ps.h" | |
63 | #include "rtl_pci.h" | |
64 | #include "rtl_cam.h" | |
65 | ||
1344ee25 LF |
66 | #define DRV_COPYRIGHT \ |
67 | "Copyright(c) 2008 - 2010 Realsil Semiconductor Corporation" | |
94a79942 LF |
68 | #define DRV_AUTHOR "<wlanfae@realtek.com>" |
69 | #define DRV_VERSION "0014.0401.2010" | |
70 | ||
1344ee25 LF |
71 | #define IS_HARDWARE_TYPE_8192SE(_priv) \ |
72 | (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192SE) | |
94a79942 LF |
73 | |
74 | #define RTL_PCI_DEVICE(vend, dev, cfg) \ | |
75 | .vendor = (vend), .device = (dev), \ | |
f6692285 | 76 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \ |
94a79942 | 77 | .driver_data = (kernel_ulong_t)&(cfg) |
94a79942 | 78 | |
94a79942 LF |
79 | #define TOTAL_CAM_ENTRY 32 |
80 | #define CAM_CONTENT_COUNT 8 | |
81 | ||
94a79942 | 82 | #define HAL_HW_PCI_REVISION_ID_8192PCIE 0x01 |
94a79942 | 83 | #define HAL_HW_PCI_REVISION_ID_8192SE 0x10 |
94a79942 LF |
84 | |
85 | #define RTL819X_DEFAULT_RF_TYPE RF_1T2R | |
86 | ||
87 | #define RTLLIB_WATCH_DOG_TIME 2000 | |
88 | ||
1344ee25 | 89 | #define MAX_DEV_ADDR_SIZE 8 /*support till 64 bit bus width OS*/ |
94a79942 LF |
90 | #define MAX_FIRMWARE_INFORMATION_SIZE 32 |
91 | #define MAX_802_11_HEADER_LENGTH (40 + MAX_FIRMWARE_INFORMATION_SIZE) | |
92 | #define ENCRYPTION_MAX_OVERHEAD 128 | |
93 | #define MAX_FRAGMENT_COUNT 8 | |
1344ee25 LF |
94 | #define MAX_TRANSMIT_BUFFER_SIZE \ |
95 | (1600 + (MAX_802_11_HEADER_LENGTH + ENCRYPTION_MAX_OVERHEAD) * \ | |
96 | MAX_FRAGMENT_COUNT) | |
94a79942 | 97 | |
94a79942 LF |
98 | #define DEFAULT_FRAG_THRESHOLD 2342U |
99 | #define MIN_FRAG_THRESHOLD 256U | |
100 | #define DEFAULT_BEACONINTERVAL 0x64U | |
101 | ||
94a79942 LF |
102 | #define DEFAULT_RETRY_RTS 7 |
103 | #define DEFAULT_RETRY_DATA 7 | |
94a79942 LF |
104 | |
105 | #define PHY_RSSI_SLID_WIN_MAX 100 | |
106 | ||
1344ee25 | 107 | #define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30) |
94a79942 | 108 | |
1344ee25 LF |
109 | #define TxBBGainTableLength 37 |
110 | #define CCKTxBBGainTableLength 23 | |
94a79942 LF |
111 | |
112 | #define CHANNEL_PLAN_LEN 10 | |
1344ee25 | 113 | #define sCrcLng 4 |
94a79942 LF |
114 | |
115 | #define NIC_SEND_HANG_THRESHOLD_NORMAL 4 | |
116 | #define NIC_SEND_HANG_THRESHOLD_POWERSAVE 8 | |
117 | ||
118 | #define MAX_TX_QUEUE 9 | |
119 | ||
120 | #define MAX_RX_QUEUE 1 | |
121 | ||
1344ee25 LF |
122 | #define MAX_RX_COUNT 64 |
123 | #define MAX_TX_QUEUE_COUNT 9 | |
94a79942 | 124 | |
fa63c9ce RK |
125 | extern int hwwep; |
126 | ||
b55941af | 127 | enum nic_t { |
94a79942 LF |
128 | NIC_UNKNOWN = 0, |
129 | NIC_8192E = 1, | |
130 | NIC_8190P = 2, | |
131 | NIC_8192SE = 4, | |
1344ee25 LF |
132 | NIC_8192CE = 5, |
133 | NIC_8192CU = 6, | |
134 | NIC_8192DE = 7, | |
135 | NIC_8192DU = 8, | |
136 | }; | |
94a79942 | 137 | |
e9463775 | 138 | enum rt_eeprom_type { |
94a79942 LF |
139 | EEPROM_93C46, |
140 | EEPROM_93C56, | |
e9463775 | 141 | }; |
94a79942 | 142 | |
aec1148c | 143 | enum dcmg_txcmd_op { |
1344ee25 | 144 | TXCMD_TXRA_HISTORY_CTRL = 0xFF900000, |
94a79942 LF |
145 | TXCMD_RESET_TX_PKT_BUFF = 0xFF900001, |
146 | TXCMD_RESET_RX_PKT_BUFF = 0xFF900002, | |
147 | TXCMD_SET_TX_DURATION = 0xFF900003, | |
148 | TXCMD_SET_RX_RSSI = 0xFF900004, | |
149 | TXCMD_SET_TX_PWR_TRACKING = 0xFF900005, | |
150 | TXCMD_XXXX_CTRL, | |
aec1148c | 151 | }; |
94a79942 | 152 | |
fc6094f6 | 153 | enum rt_rf_type_819xu { |
1344ee25 LF |
154 | RF_TYPE_MIN = 0, |
155 | RF_8225, | |
156 | RF_8256, | |
157 | RF_8258, | |
158 | RF_6052 = 4, | |
159 | RF_PSEUDO_11N = 5, | |
fc6094f6 | 160 | }; |
94a79942 | 161 | |
ed8eac2f | 162 | enum rt_customer_id { |
1344ee25 | 163 | RT_CID_DEFAULT = 0, |
94a79942 LF |
164 | RT_CID_8187_ALPHA0 = 1, |
165 | RT_CID_8187_SERCOMM_PS = 2, | |
166 | RT_CID_8187_HW_LED = 3, | |
167 | RT_CID_8187_NETGEAR = 4, | |
1344ee25 | 168 | RT_CID_WHQL = 5, |
94a79942 LF |
169 | RT_CID_819x_CAMEO = 6, |
170 | RT_CID_819x_RUNTOP = 7, | |
171 | RT_CID_819x_Senao = 8, | |
1344ee25 | 172 | RT_CID_TOSHIBA = 9, |
94a79942 | 173 | RT_CID_819x_Netcore = 10, |
1344ee25 LF |
174 | RT_CID_Nettronix = 11, |
175 | RT_CID_DLINK = 12, | |
176 | RT_CID_PRONET = 13, | |
177 | RT_CID_COREGA = 14, | |
94a79942 LF |
178 | RT_CID_819x_ALPHA = 15, |
179 | RT_CID_819x_Sitecom = 16, | |
1344ee25 | 180 | RT_CID_CCX = 17, |
94a79942 | 181 | RT_CID_819x_Lenovo = 18, |
1344ee25 | 182 | RT_CID_819x_QMI = 19, |
94a79942 LF |
183 | RT_CID_819x_Edimax_Belkin = 20, |
184 | RT_CID_819x_Sercomm_Belkin = 21, | |
185 | RT_CID_819x_CAMEO1 = 22, | |
186 | RT_CID_819x_MSI = 23, | |
187 | RT_CID_819x_Acer = 24, | |
1344ee25 | 188 | RT_CID_819x_HP = 27, |
94a79942 LF |
189 | RT_CID_819x_CLEVO = 28, |
190 | RT_CID_819x_Arcadyan_Belkin = 29, | |
191 | RT_CID_819x_SAMSUNG = 30, | |
192 | RT_CID_819x_WNC_COREGA = 31, | |
ed8eac2f | 193 | }; |
94a79942 | 194 | |
ab0d7cca | 195 | enum reset_type { |
94a79942 LF |
196 | RESET_TYPE_NORESET = 0x00, |
197 | RESET_TYPE_NORMAL = 0x01, | |
198 | RESET_TYPE_SILENT = 0x02 | |
ab0d7cca | 199 | }; |
94a79942 | 200 | |
2fac6fc4 | 201 | struct rt_stats { |
94a79942 LF |
202 | unsigned long rxrdu; |
203 | unsigned long rxok; | |
94a79942 LF |
204 | unsigned long rxdatacrcerr; |
205 | unsigned long rxmgmtcrcerr; | |
206 | unsigned long rxcrcerrmin; | |
207 | unsigned long rxcrcerrmid; | |
208 | unsigned long rxcrcerrmax; | |
209 | unsigned long received_rate_histogram[4][32]; | |
210 | unsigned long received_preamble_GI[2][32]; | |
94a79942 LF |
211 | unsigned long numpacket_matchbssid; |
212 | unsigned long numpacket_toself; | |
213 | unsigned long num_process_phyinfo; | |
214 | unsigned long numqry_phystatus; | |
215 | unsigned long numqry_phystatusCCK; | |
216 | unsigned long numqry_phystatusHT; | |
217 | unsigned long received_bwtype[5]; | |
94a79942 LF |
218 | unsigned long rxoverflow; |
219 | unsigned long rxint; | |
94a79942 LF |
220 | unsigned long ints; |
221 | unsigned long shints; | |
222 | unsigned long txoverflow; | |
94a79942 | 223 | unsigned long txbeokint; |
94a79942 | 224 | unsigned long txbkokint; |
94a79942 | 225 | unsigned long txviokint; |
94a79942 | 226 | unsigned long txvookint; |
94a79942 | 227 | unsigned long txbeaconokint; |
94a79942 LF |
228 | unsigned long txbeaconerr; |
229 | unsigned long txmanageokint; | |
94a79942 | 230 | unsigned long txcmdpktokint; |
94a79942 | 231 | unsigned long txbytesmulticast; |
94a79942 | 232 | unsigned long txbytesbroadcast; |
94a79942 LF |
233 | unsigned long txbytesunicast; |
234 | unsigned long rxbytesunicast; | |
94a79942 | 235 | unsigned long txretrycount; |
1344ee25 | 236 | u8 last_packet_rate; |
94a79942 LF |
237 | unsigned long slide_signal_strength[100]; |
238 | unsigned long slide_evm[100]; | |
239 | unsigned long slide_rssi_total; | |
240 | unsigned long slide_evm_total; | |
241 | long signal_strength; | |
242 | long signal_quality; | |
243 | long last_signal_strength_inpercent; | |
244 | long recv_signal_power; | |
245 | u8 rx_rssi_percentage[4]; | |
246 | u8 rx_evm_percentage[2]; | |
247 | long rxSNRdB[4]; | |
94a79942 LF |
248 | u32 Slide_Beacon_pwdb[100]; |
249 | u32 Slide_Beacon_Total; | |
94a79942 | 250 | u32 CurrentShowTxate; |
2fac6fc4 | 251 | }; |
94a79942 | 252 | |
e91dbf03 | 253 | struct channel_access_setting { |
94a79942 LF |
254 | u16 SIFS_Timer; |
255 | u16 DIFS_Timer; | |
256 | u16 SlotTimeTimer; | |
257 | u16 EIFS_Timer; | |
258 | u16 CWminIndex; | |
259 | u16 CWmaxIndex; | |
e91dbf03 | 260 | }; |
94a79942 | 261 | |
43267fef | 262 | struct init_gain { |
1344ee25 LF |
263 | u8 xaagccore1; |
264 | u8 xbagccore1; | |
265 | u8 xcagccore1; | |
266 | u8 xdagccore1; | |
267 | u8 cca; | |
94a79942 | 268 | |
43267fef | 269 | }; |
94a79942 | 270 | |
b7a14040 | 271 | struct tx_ring { |
1344ee25 | 272 | u32 *desc; |
94a79942 | 273 | u8 nStuckCount; |
1344ee25 | 274 | struct tx_ring *next; |
b7a14040 | 275 | } __packed; |
94a79942 LF |
276 | |
277 | struct rtl8192_tx_ring { | |
1344ee25 LF |
278 | struct tx_desc *desc; |
279 | dma_addr_t dma; | |
280 | unsigned int idx; | |
281 | unsigned int entries; | |
282 | struct sk_buff_head queue; | |
94a79942 LF |
283 | }; |
284 | ||
285 | ||
286 | ||
1344ee25 | 287 | struct rtl819x_ops { |
b55941af | 288 | enum nic_t nic_type; |
1344ee25 LF |
289 | void (*get_eeprom_size)(struct net_device *dev); |
290 | void (*init_adapter_variable)(struct net_device *dev); | |
291 | void (*init_before_adapter_start)(struct net_device *dev); | |
292 | bool (*initialize_adapter)(struct net_device *dev); | |
293 | void (*link_change)(struct net_device *dev); | |
294 | void (*tx_fill_descriptor)(struct net_device *dev, | |
295 | struct tx_desc *tx_desc, | |
296 | struct cb_desc *cb_desc, | |
297 | struct sk_buff *skb); | |
298 | void (*tx_fill_cmd_descriptor)(struct net_device *dev, | |
299 | struct tx_desc_cmd *entry, | |
300 | struct cb_desc *cb_desc, | |
301 | struct sk_buff *skb); | |
302 | bool (*rx_query_status_descriptor)(struct net_device *dev, | |
303 | struct rtllib_rx_stats *stats, | |
304 | struct rx_desc *pdesc, | |
305 | struct sk_buff *skb); | |
306 | bool (*rx_command_packet_handler)(struct net_device *dev, | |
307 | struct sk_buff *skb, | |
308 | struct rx_desc *pdesc); | |
309 | void (*stop_adapter)(struct net_device *dev, bool reset); | |
310 | void (*update_ratr_table)(struct net_device *dev); | |
311 | void (*irq_enable)(struct net_device *dev); | |
312 | void (*irq_disable)(struct net_device *dev); | |
313 | void (*irq_clear)(struct net_device *dev); | |
314 | void (*rx_enable)(struct net_device *dev); | |
315 | void (*tx_enable)(struct net_device *dev); | |
316 | void (*interrupt_recognized)(struct net_device *dev, | |
317 | u32 *p_inta, u32 *p_intb); | |
318 | bool (*TxCheckStuckHandler)(struct net_device *dev); | |
319 | bool (*RxCheckStuckHandler)(struct net_device *dev); | |
94a79942 LF |
320 | }; |
321 | ||
e3e37629 | 322 | struct r8192_priv { |
94a79942 LF |
323 | struct pci_dev *pdev; |
324 | struct pci_dev *bridge_pdev; | |
325 | ||
94a79942 LF |
326 | bool bfirst_init; |
327 | bool bfirst_after_down; | |
328 | bool initialized_at_probe; | |
329 | bool being_init_adapter; | |
330 | bool bDriverIsGoingToUnload; | |
331 | ||
332 | int irq; | |
333 | short irq_enabled; | |
334 | ||
335 | short up; | |
336 | short up_first_time; | |
edc4b2c5 LF |
337 | struct delayed_work update_beacon_wq; |
338 | struct delayed_work watch_dog_wq; | |
339 | struct delayed_work txpower_tracking_wq; | |
340 | struct delayed_work rfpath_check_wq; | |
341 | struct delayed_work gpio_change_rf_wq; | |
94a79942 LF |
342 | |
343 | struct workqueue_struct *priv_wq; | |
344 | ||
e91dbf03 | 345 | struct channel_access_setting ChannelAccessSetting; |
94a79942 | 346 | |
94a79942 LF |
347 | struct rtl819x_ops *ops; |
348 | struct rtllib_device *rtllib; | |
349 | ||
edc4b2c5 | 350 | struct work_struct reset_wq; |
94a79942 | 351 | |
c13ac63b | 352 | struct log_int_8190 InterruptLog; |
94a79942 | 353 | |
ed8eac2f | 354 | enum rt_customer_id CustomerID; |
94a79942 LF |
355 | |
356 | ||
fc6094f6 | 357 | enum rt_rf_type_819xu rf_chip; |
6e579119 | 358 | enum ht_channel_width CurrentChannelBW; |
9bf6e4c1 | 359 | struct bb_reg_definition PHYRegDef[4]; |
9be6f10e | 360 | struct rate_adaptive rate_adaptive; |
94a79942 | 361 | |
379a20fb | 362 | enum acm_method AcmMethod; |
94a79942 | 363 | |
5aca114d | 364 | struct rt_firmware *pFirmware; |
70f9f79c | 365 | enum rtl819x_loopback LoopbackMode; |
94a79942 LF |
366 | |
367 | struct timer_list watch_dog_timer; | |
368 | struct timer_list fsync_timer; | |
369 | struct timer_list gpio_polling_timer; | |
370 | ||
94a79942 LF |
371 | spinlock_t irq_th_lock; |
372 | spinlock_t tx_lock; | |
373 | spinlock_t rf_ps_lock; | |
94a79942 LF |
374 | spinlock_t ps_lock; |
375 | ||
94a79942 LF |
376 | struct sk_buff_head skb_queue; |
377 | ||
378 | struct tasklet_struct irq_rx_tasklet; | |
379 | struct tasklet_struct irq_tx_tasklet; | |
380 | struct tasklet_struct irq_prepare_beacon_tasklet; | |
381 | ||
382 | struct semaphore wx_sem; | |
383 | struct semaphore rf_sem; | |
94a79942 | 384 | struct mutex mutex; |
94a79942 | 385 | |
2fac6fc4 | 386 | struct rt_stats stats; |
94a79942 | 387 | struct iw_statistics wstats; |
94a79942 | 388 | |
1344ee25 LF |
389 | short (*rf_set_sens)(struct net_device *dev, short sens); |
390 | u8 (*rf_set_chan)(struct net_device *dev, u8 ch); | |
94a79942 | 391 | |
4f534b36 | 392 | struct rx_desc *rx_ring[MAX_RX_QUEUE]; |
94a79942 LF |
393 | struct sk_buff *rx_buf[MAX_RX_QUEUE][MAX_RX_COUNT]; |
394 | dma_addr_t rx_ring_dma[MAX_RX_QUEUE]; | |
395 | unsigned int rx_idx[MAX_RX_QUEUE]; | |
396 | int rxringcount; | |
397 | u16 rxbuffersize; | |
398 | ||
0dd56506 | 399 | u64 LastRxDescTSF; |
94a79942 | 400 | |
94a79942 | 401 | u32 ReceiveConfig; |
94a79942 LF |
402 | u8 retry_data; |
403 | u8 retry_rts; | |
404 | u16 rts; | |
405 | ||
406 | struct rtl8192_tx_ring tx_ring[MAX_TX_QUEUE_COUNT]; | |
407 | int txringcount; | |
94a79942 LF |
408 | atomic_t tx_pending[0x10]; |
409 | ||
410 | u16 ShortRetryLimit; | |
411 | u16 LongRetryLimit; | |
94a79942 | 412 | |
94a79942 | 413 | bool bHwRadioOff; |
94a79942 LF |
414 | bool blinked_ingpio; |
415 | u8 polling_timer_on; | |
416 | ||
417 | /**********************************************************/ | |
418 | ||
1344ee25 LF |
419 | enum card_type { |
420 | PCI, MINIPCI, | |
421 | CARDBUS, USB | |
422 | } card_type; | |
94a79942 | 423 | |
edc4b2c5 | 424 | struct work_struct qos_activate; |
94a79942 | 425 | |
94a79942 | 426 | short promisc; |
94a79942 LF |
427 | |
428 | short chan; | |
429 | short sens; | |
430 | short max_sens; | |
94a79942 | 431 | |
1344ee25 LF |
432 | u8 ScanDelay; |
433 | bool ps_force; | |
94a79942 | 434 | |
1344ee25 | 435 | u32 irq_mask[2]; |
94a79942 | 436 | |
1344ee25 | 437 | u8 Rf_Mode; |
b55941af | 438 | enum nic_t card_8192; |
1344ee25 | 439 | u8 card_8192_version; |
94a79942 | 440 | |
1344ee25 LF |
441 | u8 rf_type; |
442 | u8 IC_Cut; | |
443 | char nick[IW_ESSID_MAX_SIZE + 1]; | |
1344ee25 | 444 | u8 check_roaming_cnt; |
94a79942 | 445 | |
1344ee25 LF |
446 | u32 SilentResetRxSlotIndex; |
447 | u32 SilentResetRxStuckEvent[MAX_SILENT_RESET_RX_SLOT_NUM]; | |
94a79942 | 448 | |
1344ee25 LF |
449 | u16 basic_rate; |
450 | u8 short_preamble; | |
451 | u8 dot11CurrentPreambleMode; | |
452 | u8 slot_time; | |
453 | u16 SifsTime; | |
94a79942 | 454 | |
1344ee25 | 455 | bool AutoloadFailFlag; |
94a79942 | 456 | |
94a79942 | 457 | short epromtype; |
1344ee25 LF |
458 | u16 eeprom_vid; |
459 | u16 eeprom_did; | |
1344ee25 LF |
460 | u8 eeprom_CustomerID; |
461 | u16 eeprom_ChannelPlan; | |
1344ee25 LF |
462 | |
463 | u8 EEPROMTxPowerLevelCCK[14]; | |
464 | u8 EEPROMTxPowerLevelOFDM24G[14]; | |
1344ee25 LF |
465 | u8 EEPROMRfACCKChnl1TxPwLevel[3]; |
466 | u8 EEPROMRfAOfdmChnlTxPwLevel[3]; | |
467 | u8 EEPROMRfCCCKChnl1TxPwLevel[3]; | |
468 | u8 EEPROMRfCOfdmChnlTxPwLevel[3]; | |
1344ee25 LF |
469 | u16 EEPROMAntPwDiff; |
470 | u8 EEPROMThermalMeter; | |
1344ee25 LF |
471 | u8 EEPROMCrystalCap; |
472 | ||
1344ee25 LF |
473 | u8 EEPROMLegacyHTTxPowerDiff; |
474 | ||
1344ee25 LF |
475 | u8 CrystalCap; |
476 | u8 ThermalMeter[2]; | |
477 | ||
1344ee25 LF |
478 | u8 SwChnlInProgress; |
479 | u8 SwChnlStage; | |
480 | u8 SwChnlStep; | |
481 | u8 SetBWModeInProgress; | |
482 | ||
483 | u8 nCur40MhzPrimeSC; | |
484 | ||
485 | u32 RfReg0Value[4]; | |
486 | u8 NumTotalRFPath; | |
487 | bool brfpath_rxenable[4]; | |
488 | ||
489 | bool bTXPowerDataReadFromEEPORM; | |
490 | ||
491 | u16 RegChannelPlan; | |
492 | u16 ChannelPlan; | |
1344ee25 LF |
493 | |
494 | bool RegRfOff; | |
495 | bool isRFOff; | |
496 | bool bInPowerSaveMode; | |
497 | u8 bHwRfOffAction; | |
498 | ||
1344ee25 LF |
499 | bool RFChangeInProgress; |
500 | bool SetRFPowerStateInProgress; | |
501 | bool bdisable_nic; | |
502 | ||
1344ee25 LF |
503 | u8 DM_Type; |
504 | ||
505 | u8 CckPwEnl; | |
506 | u16 TSSI_13dBm; | |
507 | u32 Pwr_Track; | |
508 | u8 CCKPresentAttentuation_20Mdefault; | |
509 | u8 CCKPresentAttentuation_40Mdefault; | |
510 | char CCKPresentAttentuation_difference; | |
511 | char CCKPresentAttentuation; | |
1344ee25 | 512 | long undecorated_smoothed_pwdb; |
1344ee25 LF |
513 | |
514 | u32 MCSTxPowerLevelOriginalOffset[6]; | |
1344ee25 LF |
515 | u8 TxPowerLevelCCK[14]; |
516 | u8 TxPowerLevelCCK_A[14]; | |
517 | u8 TxPowerLevelCCK_C[14]; | |
94a79942 | 518 | u8 TxPowerLevelOFDM24G[14]; |
94a79942 LF |
519 | u8 TxPowerLevelOFDM24G_A[14]; |
520 | u8 TxPowerLevelOFDM24G_C[14]; | |
521 | u8 LegacyHTTxPowerDiff; | |
94a79942 | 522 | s8 RF_C_TxPwDiff; |
94a79942 | 523 | u8 AntennaTxPwDiff[3]; |
d8ca20fe | 524 | |
94a79942 LF |
525 | bool bDynamicTxHighPower; |
526 | bool bDynamicTxLowPower; | |
527 | bool bLastDTPFlag_High; | |
528 | bool bLastDTPFlag_Low; | |
529 | ||
94a79942 LF |
530 | u8 rfa_txpowertrackingindex; |
531 | u8 rfa_txpowertrackingindex_real; | |
532 | u8 rfa_txpowertracking_default; | |
533 | u8 rfc_txpowertrackingindex; | |
534 | u8 rfc_txpowertrackingindex_real; | |
94a79942 LF |
535 | bool btxpower_tracking; |
536 | bool bcck_in_ch14; | |
537 | ||
94a79942 LF |
538 | u8 txpower_count; |
539 | bool btxpower_trackingInit; | |
540 | ||
541 | u8 OFDM_index[2]; | |
542 | u8 CCK_index; | |
543 | ||
544 | u8 Record_CCK_20Mindex; | |
545 | u8 Record_CCK_40Mindex; | |
546 | ||
43267fef | 547 | struct init_gain initgain_backup; |
94a79942 LF |
548 | u8 DefaultInitialGain[4]; |
549 | bool bis_any_nonbepkts; | |
550 | bool bcurrent_turbo_EDCA; | |
551 | bool bis_cur_rdlstate; | |
552 | ||
94a79942 LF |
553 | bool bfsync_processing; |
554 | u32 rate_record; | |
555 | u32 rateCountDiffRecord; | |
4c234ebc | 556 | u32 ContinueDiffCount; |
94a79942 LF |
557 | bool bswitch_fsync; |
558 | u8 framesync; | |
559 | u32 framesyncC34; | |
560 | u8 framesyncMonitor; | |
561 | ||
94a79942 | 562 | u32 reset_count; |
94a79942 | 563 | |
ab0d7cca | 564 | enum reset_type ResetProgress; |
94a79942 LF |
565 | bool bForcedSilentReset; |
566 | bool bDisableNormalResetCheck; | |
567 | u16 TxCounter; | |
568 | u16 RxCounter; | |
94a79942 LF |
569 | bool bResetInProgress; |
570 | bool force_reset; | |
571 | bool force_lps; | |
94a79942 LF |
572 | |
573 | bool chan_forced; | |
94a79942 LF |
574 | |
575 | u8 PwrDomainProtect; | |
576 | u8 H2CTxCmdSeq; | |
d3b2c172 | 577 | }; |
94a79942 LF |
578 | |
579 | extern const struct ethtool_ops rtl819x_ethtool_ops; | |
580 | ||
b59a4ca3 | 581 | u8 rtl92e_readb(struct net_device *dev, int x); |
99aa47e0 | 582 | u32 rtl92e_readl(struct net_device *dev, int x); |
1c0a7c0e | 583 | u16 rtl92e_readw(struct net_device *dev, int x); |
1344ee25 LF |
584 | void write_nic_byte(struct net_device *dev, int x, u8 y); |
585 | void write_nic_word(struct net_device *dev, int x, u16 y); | |
586 | void write_nic_dword(struct net_device *dev, int x, u32 y); | |
94a79942 LF |
587 | |
588 | void force_pci_posting(struct net_device *dev); | |
589 | ||
630268b7 | 590 | void rtl92e_rx_enable(struct net_device *); |
94199b35 | 591 | void rtl92e_tx_enable(struct net_device *); |
94a79942 | 592 | |
1344ee25 | 593 | void rtl8192_hw_sleep_wq(void *data); |
bc4f2cc9 | 594 | void rtl92e_commit(struct net_device *dev); |
94a79942 | 595 | |
a643d927 | 596 | void rtl92e_check_rfctrl_gpio_timer(unsigned long data); |
94a79942 LF |
597 | |
598 | void rtl8192_hw_wakeup_wq(void *data); | |
94a79942 | 599 | |
36154dc3 | 600 | void rtl92e_reset_desc_ring(struct net_device *dev); |
35bf848f | 601 | void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode); |
b74299cd | 602 | void rtl92e_irq_enable(struct net_device *dev); |
122fe9f1 | 603 | void rtl92e_config_rate(struct net_device *dev, u16 *rate_config); |
b7b50d65 | 604 | void rtl92e_irq_disable(struct net_device *dev); |
94a79942 | 605 | |
1344ee25 LF |
606 | void rtl819x_UpdateRxPktTimeStamp(struct net_device *dev, |
607 | struct rtllib_rx_stats *stats); | |
608 | long rtl819x_translate_todbm(struct r8192_priv *priv, u8 signal_strength_index); | |
609 | void rtl819x_update_rxsignalstatistics8190pci(struct r8192_priv *priv, | |
610 | struct rtllib_rx_stats *pprevious_stats); | |
6b89d0e7 | 611 | u8 rtl92e_evm_db_to_percent(char value); |
aa804031 | 612 | u8 rtl92e_rx_db_to_percent(char antpower); |
e58701da MK |
613 | void rtl92e_copy_mpdu_stats(struct rtllib_rx_stats *psrc_stats, |
614 | struct rtllib_rx_stats *ptarget_stats); | |
502bd1d7 | 615 | bool rtl92e_enable_nic(struct net_device *dev); |
af002dc6 | 616 | bool rtl92e_disable_nic(struct net_device *dev); |
1344ee25 | 617 | |
f434f9d5 | 618 | bool rtl92e_set_rf_state(struct net_device *dev, |
1344ee25 LF |
619 | enum rt_rf_power_state StateToSet, |
620 | RT_RF_CHANGE_SOURCE ChangeSource, | |
621 | bool ProtectOrNot); | |
622 | void ActUpdateChannelAccessSetting(struct net_device *dev, | |
623 | enum wireless_mode WirelessMode, | |
624 | struct channel_access_setting *ChnlAccessSetting); | |
94a79942 | 625 | |
94a79942 | 626 | #endif |