1 /******************************************************************************
2 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
4 * Based on the r8180 driver, which is:
5 * Copyright 2004-2005 Andrea Merello <andreamrl@tiscali.it>, et al.
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.
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
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
19 * The full GNU General Public License is included in this distribution in the
20 * file called LICENSE.
22 * Contact Information:
23 * wlanfae <wlanfae@realtek.com>
24 ******************************************************************************/
29 #include <linux/module.h>
30 #include <linux/kernel.h>
31 #include <linux/init.h>
32 #include <linux/ioport.h>
33 #include <linux/sched.h>
34 #include <linux/types.h>
35 #include <linux/interrupt.h>
36 #include <linux/slab.h>
37 #include <linux/netdevice.h>
38 #include <linux/pci.h>
39 #include <linux/etherdevice.h>
40 #include <linux/delay.h>
41 #include <linux/rtnetlink.h>
42 #include <linux/wireless.h>
43 #include <linux/timer.h>
44 #include <linux/proc_fs.h>
45 #include <linux/if_arp.h>
46 #include <linux/random.h>
49 /* Need this defined before including local include files */
50 #define DRV_NAME "rtl819xE"
52 #include "../rtllib.h"
54 #include "../dot11d.h"
56 #include "r8192E_firmware.h"
57 #include "r8192E_hw.h"
59 #include "r8190P_def.h"
60 #include "r8192E_dev.h"
62 #include "rtl_eeprom.h"
67 #define DRV_COPYRIGHT \
68 "Copyright(c) 2008 - 2010 Realsil Semiconductor Corporation"
69 #define DRV_AUTHOR "<wlanfae@realtek.com>"
70 #define DRV_VERSION "0014.0401.2010"
72 #define IS_HARDWARE_TYPE_819xP(_priv) \
73 ((((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8190P) || \
74 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192E))
75 #define IS_HARDWARE_TYPE_8192SE(_priv) \
76 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192SE)
77 #define IS_HARDWARE_TYPE_8192CE(_priv) \
78 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192CE)
79 #define IS_HARDWARE_TYPE_8192CU(_priv) \
80 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192CU)
81 #define IS_HARDWARE_TYPE_8192DE(_priv) \
82 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192DE)
83 #define IS_HARDWARE_TYPE_8192DU(_priv) \
84 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192DU)
86 #define RTL_PCI_DEVICE(vend, dev, cfg) \
87 .vendor = (vend), .device = (dev), \
88 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID , \
89 .driver_data = (kernel_ulong_t)&(cfg)
91 #define RTL_MAX_SCAN_SIZE 128
93 #define RTL_RATE_MAX 30
95 #define TOTAL_CAM_ENTRY 32
96 #define CAM_CONTENT_COUNT 8
99 #define BIT(_i) (1<<(_i))
102 #define IS_NIC_DOWN(priv) (!(priv)->up)
104 #define IS_ADAPTER_SENDS_BEACON(dev) 0
106 #define IS_UNDER_11N_AES_MODE(_rtllib) \
107 ((_rtllib->pHTInfo->bCurrentHTSupport == true) && \
108 (_rtllib->pairwise_key_type == KEY_TYPE_CCMP))
110 #define HAL_MEMORY_MAPPED_IO_RANGE_8190PCI 0x1000
111 #define HAL_HW_PCI_REVISION_ID_8190PCI 0x00
112 #define HAL_MEMORY_MAPPED_IO_RANGE_8192PCIE 0x4000
113 #define HAL_HW_PCI_REVISION_ID_8192PCIE 0x01
114 #define HAL_MEMORY_MAPPED_IO_RANGE_8192SE 0x4000
115 #define HAL_HW_PCI_REVISION_ID_8192SE 0x10
116 #define HAL_HW_PCI_REVISION_ID_8192CE 0x1
117 #define HAL_MEMORY_MAPPED_IO_RANGE_8192CE 0x4000
118 #define HAL_HW_PCI_REVISION_ID_8192DE 0x0
119 #define HAL_MEMORY_MAPPED_IO_RANGE_8192DE 0x4000
121 #define HAL_HW_PCI_8180_DEVICE_ID 0x8180
122 #define HAL_HW_PCI_8185_DEVICE_ID 0x8185
123 #define HAL_HW_PCI_8188_DEVICE_ID 0x8188
124 #define HAL_HW_PCI_8198_DEVICE_ID 0x8198
125 #define HAL_HW_PCI_8190_DEVICE_ID 0x8190
126 #define HAL_HW_PCI_8192_DEVICE_ID 0x8192
127 #define HAL_HW_PCI_8192SE_DEVICE_ID 0x8192
128 #define HAL_HW_PCI_8174_DEVICE_ID 0x8174
129 #define HAL_HW_PCI_8173_DEVICE_ID 0x8173
130 #define HAL_HW_PCI_8172_DEVICE_ID 0x8172
131 #define HAL_HW_PCI_8171_DEVICE_ID 0x8171
132 #define HAL_HW_PCI_0045_DEVICE_ID 0x0045
133 #define HAL_HW_PCI_0046_DEVICE_ID 0x0046
134 #define HAL_HW_PCI_0044_DEVICE_ID 0x0044
135 #define HAL_HW_PCI_0047_DEVICE_ID 0x0047
136 #define HAL_HW_PCI_700F_DEVICE_ID 0x700F
137 #define HAL_HW_PCI_701F_DEVICE_ID 0x701F
138 #define HAL_HW_PCI_DLINK_DEVICE_ID 0x3304
139 #define HAL_HW_PCI_8192CET_DEVICE_ID 0x8191
140 #define HAL_HW_PCI_8192CE_DEVICE_ID 0x8178
141 #define HAL_HW_PCI_8191CE_DEVICE_ID 0x8177
142 #define HAL_HW_PCI_8188CE_DEVICE_ID 0x8176
143 #define HAL_HW_PCI_8192CU_DEVICE_ID 0x8191
144 #define HAL_HW_PCI_8192DE_DEVICE_ID 0x092D
145 #define HAL_HW_PCI_8192DU_DEVICE_ID 0x092D
147 #define RTL819X_DEFAULT_RF_TYPE RF_1T2R
149 #define RTLLIB_WATCH_DOG_TIME 2000
151 #define MAX_DEV_ADDR_SIZE 8 /*support till 64 bit bus width OS*/
152 #define MAX_FIRMWARE_INFORMATION_SIZE 32
153 #define MAX_802_11_HEADER_LENGTH (40 + MAX_FIRMWARE_INFORMATION_SIZE)
154 #define ENCRYPTION_MAX_OVERHEAD 128
155 #define MAX_FRAGMENT_COUNT 8
156 #define MAX_TRANSMIT_BUFFER_SIZE \
157 (1600 + (MAX_802_11_HEADER_LENGTH + ENCRYPTION_MAX_OVERHEAD) * \
162 #define DEFAULT_FRAG_THRESHOLD 2342U
163 #define MIN_FRAG_THRESHOLD 256U
164 #define DEFAULT_BEACONINTERVAL 0x64U
166 #define DEFAULT_SSID ""
167 #define DEFAULT_RETRY_RTS 7
168 #define DEFAULT_RETRY_DATA 7
169 #define PRISM_HDR_SIZE 64
171 #define PHY_RSSI_SLID_WIN_MAX 100
173 #define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30)
175 #define TxBBGainTableLength 37
176 #define CCKTxBBGainTableLength 23
178 #define CHANNEL_PLAN_LEN 10
181 #define NIC_SEND_HANG_THRESHOLD_NORMAL 4
182 #define NIC_SEND_HANG_THRESHOLD_POWERSAVE 8
184 #define MAX_TX_QUEUE 9
186 #define MAX_RX_QUEUE 1
188 #define MAX_RX_COUNT 64
189 #define MAX_TX_QUEUE_COUNT 9
191 enum RTL819x_PHY_PARAM
{
192 RTL819X_PHY_MACPHY_REG
= 0,
193 RTL819X_PHY_MACPHY_REG_PG
= 1,
194 RTL8188C_PHY_MACREG
= 2,
195 RTL8192C_PHY_MACREG
= 3,
197 RTL819X_PHY_REG_1T2R
= 5,
198 RTL819X_PHY_REG_to1T1R
= 6,
199 RTL819X_PHY_REG_to1T2R
= 7,
200 RTL819X_PHY_REG_to2T2R
= 8,
201 RTL819X_PHY_REG_PG
= 9,
202 RTL819X_AGC_TAB
= 10,
203 RTL819X_PHY_RADIO_A
= 11,
204 RTL819X_PHY_RADIO_A_1T
= 12,
205 RTL819X_PHY_RADIO_A_2T
= 13,
206 RTL819X_PHY_RADIO_B
= 14,
207 RTL819X_PHY_RADIO_B_GM
= 15,
208 RTL819X_PHY_RADIO_C
= 16,
209 RTL819X_PHY_RADIO_D
= 17,
210 RTL819X_EEPROM_MAP
= 18,
211 RTL819X_EFUSE_MAP
= 19,
225 enum rt_eeprom_type
{
232 TXCMD_TXRA_HISTORY_CTRL
= 0xFF900000,
233 TXCMD_RESET_TX_PKT_BUFF
= 0xFF900001,
234 TXCMD_RESET_RX_PKT_BUFF
= 0xFF900002,
235 TXCMD_SET_TX_DURATION
= 0xFF900003,
236 TXCMD_SET_RX_RSSI
= 0xFF900004,
237 TXCMD_SET_TX_PWR_TRACKING
= 0xFF900005,
241 enum rt_rf_type_819xu
{
263 enum rt_customer_id
{
265 RT_CID_8187_ALPHA0
= 1,
266 RT_CID_8187_SERCOMM_PS
= 2,
267 RT_CID_8187_HW_LED
= 3,
268 RT_CID_8187_NETGEAR
= 4,
270 RT_CID_819x_CAMEO
= 6,
271 RT_CID_819x_RUNTOP
= 7,
272 RT_CID_819x_Senao
= 8,
274 RT_CID_819x_Netcore
= 10,
275 RT_CID_Nettronix
= 11,
279 RT_CID_819x_ALPHA
= 15,
280 RT_CID_819x_Sitecom
= 16,
282 RT_CID_819x_Lenovo
= 18,
283 RT_CID_819x_QMI
= 19,
284 RT_CID_819x_Edimax_Belkin
= 20,
285 RT_CID_819x_Sercomm_Belkin
= 21,
286 RT_CID_819x_CAMEO1
= 22,
287 RT_CID_819x_MSI
= 23,
288 RT_CID_819x_Acer
= 24,
290 RT_CID_819x_CLEVO
= 28,
291 RT_CID_819x_Arcadyan_Belkin
= 29,
292 RT_CID_819x_SAMSUNG
= 30,
293 RT_CID_819x_WNC_COREGA
= 31,
297 RESET_TYPE_NORESET
= 0x00,
298 RESET_TYPE_NORMAL
= 0x01,
299 RESET_TYPE_SILENT
= 0x02
302 enum ic_inferiority_8192s
{
303 IC_INFERIORITY_A
= 0,
304 IC_INFERIORITY_B
= 1,
307 enum pci_bridge_vendor
{
308 PCI_BRIDGE_VENDOR_INTEL
= 0x0,
309 PCI_BRIDGE_VENDOR_ATI
,
310 PCI_BRIDGE_VENDOR_AMD
,
311 PCI_BRIDGE_VENDOR_SIS
,
312 PCI_BRIDGE_VENDOR_UNKNOWN
,
313 PCI_BRIDGE_VENDOR_MAX
,
323 struct rtl_reg_debug
{
329 unsigned char length
;
331 unsigned char buf
[0xff];
340 struct rt_smooth_data_4rf
{
341 char elements
[4][100];
351 unsigned long rxframgment
;
352 unsigned long rxurberr
;
353 unsigned long rxstaterr
;
354 unsigned long rxdatacrcerr
;
355 unsigned long rxmgmtcrcerr
;
356 unsigned long rxcrcerrmin
;
357 unsigned long rxcrcerrmid
;
358 unsigned long rxcrcerrmax
;
359 unsigned long received_rate_histogram
[4][32];
360 unsigned long received_preamble_GI
[2][32];
361 unsigned long rx_AMPDUsize_histogram
[5];
362 unsigned long rx_AMPDUnum_histogram
[5];
363 unsigned long numpacket_matchbssid
;
364 unsigned long numpacket_toself
;
365 unsigned long num_process_phyinfo
;
366 unsigned long numqry_phystatus
;
367 unsigned long numqry_phystatusCCK
;
368 unsigned long numqry_phystatusHT
;
369 unsigned long received_bwtype
[5];
370 unsigned long txnperr
;
371 unsigned long txnpdrop
;
372 unsigned long txresumed
;
373 unsigned long rxoverflow
;
375 unsigned long txnpokint
;
377 unsigned long shints
;
378 unsigned long txoverflow
;
379 unsigned long txlpokint
;
380 unsigned long txlpdrop
;
381 unsigned long txlperr
;
382 unsigned long txbeokint
;
383 unsigned long txbedrop
;
384 unsigned long txbeerr
;
385 unsigned long txbkokint
;
386 unsigned long txbkdrop
;
387 unsigned long txbkerr
;
388 unsigned long txviokint
;
389 unsigned long txvidrop
;
390 unsigned long txvierr
;
391 unsigned long txvookint
;
392 unsigned long txvodrop
;
393 unsigned long txvoerr
;
394 unsigned long txbeaconokint
;
395 unsigned long txbeacondrop
;
396 unsigned long txbeaconerr
;
397 unsigned long txmanageokint
;
398 unsigned long txmanagedrop
;
399 unsigned long txmanageerr
;
400 unsigned long txcmdpktokint
;
401 unsigned long txdatapkt
;
402 unsigned long txfeedback
;
403 unsigned long txfeedbackok
;
404 unsigned long txoktotal
;
405 unsigned long txokbytestotal
;
406 unsigned long txokinperiod
;
407 unsigned long txmulticast
;
408 unsigned long txbytesmulticast
;
409 unsigned long txbroadcast
;
410 unsigned long txbytesbroadcast
;
411 unsigned long txunicast
;
412 unsigned long txbytesunicast
;
413 unsigned long rxbytesunicast
;
414 unsigned long txfeedbackfail
;
415 unsigned long txerrtotal
;
416 unsigned long txerrbytestotal
;
417 unsigned long txerrmulticast
;
418 unsigned long txerrbroadcast
;
419 unsigned long txerrunicast
;
420 unsigned long txretrycount
;
421 unsigned long txfeedbackretry
;
423 unsigned long slide_signal_strength
[100];
424 unsigned long slide_evm
[100];
425 unsigned long slide_rssi_total
;
426 unsigned long slide_evm_total
;
427 long signal_strength
;
429 long last_signal_strength_inpercent
;
430 long recv_signal_power
;
431 u8 rx_rssi_percentage
[4];
432 u8 rx_evm_percentage
[2];
434 struct rt_tx_rahis txrate
;
435 u32 Slide_Beacon_pwdb
[100];
436 u32 Slide_Beacon_Total
;
437 struct rt_smooth_data_4rf cck_adc_pwdb
;
438 u32 CurrentShowTxate
;
441 struct channel_access_setting
{
450 enum two_port_status
{
451 TWO_PORT_STATUS__DEFAULT_ONLY
,
452 TWO_PORT_STATUS__EXTENSION_ONLY
,
453 TWO_PORT_STATUS__EXTENSION_FOLLOW_DEFAULT
,
454 TWO_PORT_STATUS__DEFAULT_G_EXTENSION_N20
,
455 TWO_PORT_STATUS__ADHOC
,
456 TWO_PORT_STATUS__WITHOUT_ANY_ASSOCIATE
459 struct txbbgain_struct
{
460 long txbb_iq_amplifygain
;
465 u8 ccktxbb_valuearray
[8];
480 struct tx_ring
*next
;
483 struct rtl8192_tx_ring
{
484 struct tx_desc
*desc
;
487 unsigned int entries
;
488 struct sk_buff_head queue
;
495 void (*get_eeprom_size
)(struct net_device
*dev
);
496 void (*init_adapter_variable
)(struct net_device
*dev
);
497 void (*init_before_adapter_start
)(struct net_device
*dev
);
498 bool (*initialize_adapter
)(struct net_device
*dev
);
499 void (*link_change
)(struct net_device
*dev
);
500 void (*tx_fill_descriptor
)(struct net_device
*dev
,
501 struct tx_desc
*tx_desc
,
502 struct cb_desc
*cb_desc
,
503 struct sk_buff
*skb
);
504 void (*tx_fill_cmd_descriptor
)(struct net_device
*dev
,
505 struct tx_desc_cmd
*entry
,
506 struct cb_desc
*cb_desc
,
507 struct sk_buff
*skb
);
508 bool (*rx_query_status_descriptor
)(struct net_device
*dev
,
509 struct rtllib_rx_stats
*stats
,
510 struct rx_desc
*pdesc
,
511 struct sk_buff
*skb
);
512 bool (*rx_command_packet_handler
)(struct net_device
*dev
,
514 struct rx_desc
*pdesc
);
515 void (*stop_adapter
)(struct net_device
*dev
, bool reset
);
516 void (*update_ratr_table
)(struct net_device
*dev
);
517 void (*irq_enable
)(struct net_device
*dev
);
518 void (*irq_disable
)(struct net_device
*dev
);
519 void (*irq_clear
)(struct net_device
*dev
);
520 void (*rx_enable
)(struct net_device
*dev
);
521 void (*tx_enable
)(struct net_device
*dev
);
522 void (*interrupt_recognized
)(struct net_device
*dev
,
523 u32
*p_inta
, u32
*p_intb
);
524 bool (*TxCheckStuckHandler
)(struct net_device
*dev
);
525 bool (*RxCheckStuckHandler
)(struct net_device
*dev
);
529 struct pci_dev
*pdev
;
530 struct pci_dev
*bridge_pdev
;
533 bool bfirst_after_down
;
534 bool initialized_at_probe
;
535 bool being_init_adapter
;
536 bool bDriverIsGoingToUnload
;
543 struct delayed_work update_beacon_wq
;
544 struct delayed_work watch_dog_wq
;
545 struct delayed_work txpower_tracking_wq
;
546 struct delayed_work rfpath_check_wq
;
547 struct delayed_work gpio_change_rf_wq
;
548 struct delayed_work initialgain_operate_wq
;
549 struct delayed_work check_hw_scan_wq
;
550 struct delayed_work hw_scan_simu_wq
;
551 struct delayed_work start_hw_scan_wq
;
553 struct workqueue_struct
*priv_wq
;
555 struct channel_access_setting ChannelAccessSetting
;
557 struct mp_adapter NdisAdapter
;
559 struct rtl819x_ops
*ops
;
560 struct rtllib_device
*rtllib
;
562 struct work_struct reset_wq
;
564 struct log_int_8190 InterruptLog
;
566 enum rt_customer_id CustomerID
;
569 enum rt_rf_type_819xu rf_chip
;
570 enum ic_inferiority_8192s IC_Class
;
571 enum ht_channel_width CurrentChannelBW
;
572 struct bb_reg_definition PHYRegDef
[4];
573 struct rate_adaptive rate_adaptive
;
575 struct ccktxbbgain cck_txbbgain_table
[CCKTxBBGainTableLength
];
576 struct ccktxbbgain cck_txbbgain_ch14_table
[CCKTxBBGainTableLength
];
578 struct txbbgain_struct txbbgain_table
[TxBBGainTableLength
];
580 enum acm_method AcmMethod
;
582 struct rt_firmware
*pFirmware
;
583 enum rtl819x_loopback LoopbackMode
;
584 enum firmware_source firmware_source
;
586 struct timer_list watch_dog_timer
;
587 struct timer_list fsync_timer
;
588 struct timer_list gpio_polling_timer
;
590 spinlock_t fw_scan_lock
;
592 spinlock_t irq_th_lock
;
594 spinlock_t rf_ps_lock
;
596 spinlock_t rt_h2c_lock
;
600 struct sk_buff_head rx_queue
;
601 struct sk_buff_head skb_queue
;
603 struct tasklet_struct irq_rx_tasklet
;
604 struct tasklet_struct irq_tx_tasklet
;
605 struct tasklet_struct irq_prepare_beacon_tasklet
;
607 struct semaphore wx_sem
;
608 struct semaphore rf_sem
;
611 struct rt_stats stats
;
612 struct iw_statistics wstats
;
613 struct proc_dir_entry
*dir_dev
;
615 short (*rf_set_sens
)(struct net_device
*dev
, short sens
);
616 u8 (*rf_set_chan
)(struct net_device
*dev
, u8 ch
);
617 void (*rf_close
)(struct net_device
*dev
);
618 void (*rf_init
)(struct net_device
*dev
);
620 struct rx_desc
*rx_ring
[MAX_RX_QUEUE
];
621 struct sk_buff
*rx_buf
[MAX_RX_QUEUE
][MAX_RX_COUNT
];
622 dma_addr_t rx_ring_dma
[MAX_RX_QUEUE
];
623 unsigned int rx_idx
[MAX_RX_QUEUE
];
629 u16 EarlyRxThreshold
;
637 struct rtl8192_tx_ring tx_ring
[MAX_TX_QUEUE_COUNT
];
641 atomic_t tx_pending
[0x10];
655 /**********************************************************/
662 struct work_struct qos_activate
;
682 enum nic_t card_8192
;
683 u8 card_8192_version
;
689 char nick
[IW_ESSID_MAX_SIZE
+ 1];
694 bool bTKIPinNmodeFromReg
;
695 bool bWEPinNmodeFromReg
;
699 u8 check_roaming_cnt
;
701 bool bIgnoreSilentReset
;
702 u32 SilentResetRxSoltNum
;
703 u32 SilentResetRxSlotIndex
;
704 u32 SilentResetRxStuckEvent
[MAX_SILENT_RESET_RX_SLOT_NUM
];
710 u8 nrxAMPDU_aggr_num
;
712 u32 last_rxdesc_tsf_high
;
713 u32 last_rxdesc_tsf_low
;
717 u8 dot11CurrentPreambleMode
;
724 u16 FirmwareSubVersion
;
726 bool AutoloadFailFlag
;
731 u8 RegSupportPciASPM
;
739 u8 EfuseMap
[2][HWSET_MAX_SIZE_92S
];
741 u8 EfuseUsedPercentage
;
748 u8 eeprom_CustomerID
;
749 u16 eeprom_ChannelPlan
;
753 u8 EEPROMPwrGroup
[2][3];
756 u8 EEPROMTxPowerLevelCCK
[14];
757 u8 EEPROMTxPowerLevelOFDM24G
[14];
758 u8 EEPROMTxPowerLevelOFDM5G
[24];
759 u8 EEPROMRfACCKChnl1TxPwLevel
[3];
760 u8 EEPROMRfAOfdmChnlTxPwLevel
[3];
761 u8 EEPROMRfCCCKChnl1TxPwLevel
[3];
762 u8 EEPROMRfCOfdmChnlTxPwLevel
[3];
763 u16 EEPROMTxPowerDiff
;
765 u8 EEPROMThermalMeter
;
769 u8 EEPROMBluetoothCoexist
;
770 u8 EEPROMBluetoothType
;
771 u8 EEPROMBluetoothAntNum
;
772 u8 EEPROMBluetoothAntIsolation
;
773 u8 EEPROMBluetoothRadioShared
;
776 u8 EEPROMSupportWoWLAN
;
779 u8 EEPROMHT2T_TxPwr
[6];
782 u8 EEPROMTxPowerLevelCCK_V1
[3];
783 u8 EEPROMLegacyHTTxPowerDiff
;
796 u8 SetBWModeInProgress
;
802 bool brfpath_rxenable
[4];
804 bool bTXPowerDataReadFromEEPORM
;
808 bool bChnlPlanFromHW
;
812 bool bInPowerSaveMode
;
815 bool aspm_clkreq_enable
;
816 u32 pci_bridge_vendor
;
817 u8 RegHostPciASPMSetting
;
818 u8 RegDevicePciASPMSetting
;
820 bool RFChangeInProgress
;
821 bool SetRFPowerStateInProgress
;
842 u32 IQK_MAC_backup
[3];
844 bool SetFwCmdInProgress
;
849 bool bInformFWDriverControlDM
;
850 u8 PwrGroupHT20
[2][14];
851 u8 PwrGroupHT40
[2][14];
854 long EntryMinUndecoratedSmoothedPWDB
;
855 long EntryMaxUndecoratedSmoothedPWDB
;
856 u8 DynamicTxHighPowerLvl
;
859 struct false_alarm_stats FalseAlmCnt
;
867 u8 CCKPresentAttentuation_20Mdefault
;
868 u8 CCKPresentAttentuation_40Mdefault
;
869 char CCKPresentAttentuation_difference
;
870 char CCKPresentAttentuation
;
872 long undecorated_smoothed_pwdb
;
873 long undecorated_smoothed_cck_adc_pwdb
[4];
875 u32 MCSTxPowerLevelOriginalOffset
[6];
876 u32 CCKTxPowerLevelOriginalOffset
;
877 u8 TxPowerLevelCCK
[14];
878 u8 TxPowerLevelCCK_A
[14];
879 u8 TxPowerLevelCCK_C
[14];
880 u8 TxPowerLevelOFDM24G
[14];
881 u8 TxPowerLevelOFDM5G
[14];
882 u8 TxPowerLevelOFDM24G_A
[14];
883 u8 TxPowerLevelOFDM24G_C
[14];
884 u8 LegacyHTTxPowerDiff
;
888 u8 RfTxPwrLevelCck
[2][14];
889 u8 RfTxPwrLevelOfdm1T
[2][14];
890 u8 RfTxPwrLevelOfdm2T
[2][14];
891 u8 AntennaTxPwDiff
[3];
892 u8 TxPwrHt20Diff
[2][14];
893 u8 TxPwrLegacyHtDiff
[2][14];
897 u8 CurrentCckTxPwrIdx
;
898 u8 CurrentOfdm24GTxPwrIdx
;
900 bool bdynamic_txpower
;
901 bool bDynamicTxHighPower
;
902 bool bDynamicTxLowPower
;
903 bool bLastDTPFlag_High
;
904 bool bLastDTPFlag_Low
;
906 bool bstore_last_dtpflag
;
907 bool bstart_txctrl_bydtp
;
909 u8 rfa_txpowertrackingindex
;
910 u8 rfa_txpowertrackingindex_real
;
911 u8 rfa_txpowertracking_default
;
912 u8 rfc_txpowertrackingindex
;
913 u8 rfc_txpowertrackingindex_real
;
914 u8 rfc_txpowertracking_default
;
915 bool btxpower_tracking
;
918 u8 TxPowerTrackControl
;
920 bool btxpower_trackingInit
;
925 u8 Record_CCK_20Mindex
;
926 u8 Record_CCK_40Mindex
;
928 struct init_gain initgain_backup
;
929 u8 DefaultInitialGain
[4];
930 bool bis_any_nonbepkts
;
931 bool bcurrent_turbo_EDCA
;
932 bool bis_cur_rdlstate
;
939 bool bfsync_processing
;
941 u32 rateCountDiffRecord
;
942 u32 ContinueDiffCount
;
948 bool bDMInitialGainEnable
;
949 bool MutualAuthenticationFail
;
951 bool bDisableFrameBursting
;
956 u32 txpower_checkcnt
;
957 u32 txpower_tracking_callback_cnt
;
958 u8 thermal_read_val
[40];
959 u8 thermal_readback_index
;
960 u32 ccktxpower_adjustcnt_not_ch14
;
961 u32 ccktxpower_adjustcnt_ch14
;
963 enum reset_type ResetProgress
;
964 bool bForcedSilentReset
;
965 bool bDisableNormalResetCheck
;
969 bool bResetInProgress
;
972 u8 InitialGainOperateType
;
1000 extern const struct ethtool_ops rtl819x_ethtool_ops
;
1002 void rtl8192_tx_cmd(struct net_device
*dev
, struct sk_buff
*skb
);
1003 short rtl8192_tx(struct net_device
*dev
, struct sk_buff
*skb
);
1005 u8
read_nic_io_byte(struct net_device
*dev
, int x
);
1006 u32
read_nic_io_dword(struct net_device
*dev
, int x
);
1007 u16
read_nic_io_word(struct net_device
*dev
, int x
) ;
1008 void write_nic_io_byte(struct net_device
*dev
, int x
, u8 y
);
1009 void write_nic_io_word(struct net_device
*dev
, int x
, u16 y
);
1010 void write_nic_io_dword(struct net_device
*dev
, int x
, u32 y
);
1012 u8
read_nic_byte(struct net_device
*dev
, int x
);
1013 u32
read_nic_dword(struct net_device
*dev
, int x
);
1014 u16
read_nic_word(struct net_device
*dev
, int x
) ;
1015 void write_nic_byte(struct net_device
*dev
, int x
, u8 y
);
1016 void write_nic_word(struct net_device
*dev
, int x
, u16 y
);
1017 void write_nic_dword(struct net_device
*dev
, int x
, u32 y
);
1019 void force_pci_posting(struct net_device
*dev
);
1021 void rtl8192_rx_enable(struct net_device
*);
1022 void rtl8192_tx_enable(struct net_device
*);
1024 int rtl8192_hard_start_xmit(struct sk_buff
*skb
, struct net_device
*dev
);
1025 void rtl8192_hard_data_xmit(struct sk_buff
*skb
, struct net_device
*dev
,
1027 void rtl8192_data_hard_stop(struct net_device
*dev
);
1028 void rtl8192_data_hard_resume(struct net_device
*dev
);
1029 void rtl8192_restart(void *data
);
1030 void rtl819x_watchdog_wqcallback(void *data
);
1031 void rtl8192_hw_sleep_wq(void *data
);
1032 void watch_dog_timer_callback(unsigned long data
);
1033 void rtl8192_irq_rx_tasklet(struct r8192_priv
*priv
);
1034 void rtl8192_irq_tx_tasklet(struct r8192_priv
*priv
);
1035 int rtl8192_down(struct net_device
*dev
, bool shutdownrf
);
1036 int rtl8192_up(struct net_device
*dev
);
1037 void rtl8192_commit(struct net_device
*dev
);
1038 void rtl8192_set_chan(struct net_device
*dev
, short ch
);
1040 void check_rfctrl_gpio_timer(unsigned long data
);
1042 void rtl8192_hw_wakeup_wq(void *data
);
1043 short rtl8192_pci_initdescring(struct net_device
*dev
);
1045 void rtl8192_cancel_deferred_work(struct r8192_priv
*priv
);
1047 int _rtl8192_up(struct net_device
*dev
, bool is_silent_reset
);
1049 short rtl8192_is_tx_queue_empty(struct net_device
*dev
);
1050 void rtl8192_irq_disable(struct net_device
*dev
);
1052 void rtl8192_tx_timeout(struct net_device
*dev
);
1053 void rtl8192_pci_resetdescring(struct net_device
*dev
);
1054 void rtl8192_SetWirelessMode(struct net_device
*dev
, u8 wireless_mode
);
1055 void rtl8192_irq_enable(struct net_device
*dev
);
1056 void rtl8192_config_rate(struct net_device
*dev
, u16
*rate_config
);
1057 void rtl8192_update_cap(struct net_device
*dev
, u16 cap
);
1058 void rtl8192_irq_disable(struct net_device
*dev
);
1060 void rtl819x_UpdateRxPktTimeStamp(struct net_device
*dev
,
1061 struct rtllib_rx_stats
*stats
);
1062 long rtl819x_translate_todbm(struct r8192_priv
*priv
, u8 signal_strength_index
);
1063 void rtl819x_update_rxsignalstatistics8190pci(struct r8192_priv
*priv
,
1064 struct rtllib_rx_stats
*pprevious_stats
);
1065 u8
rtl819x_evm_dbtopercentage(char value
);
1066 void rtl819x_process_cck_rxpathsel(struct r8192_priv
*priv
,
1067 struct rtllib_rx_stats
*pprevious_stats
);
1068 u8
rtl819x_query_rxpwrpercentage(char antpower
);
1069 void rtl8192_record_rxdesc_forlateruse(struct rtllib_rx_stats
*psrc_stats
,
1070 struct rtllib_rx_stats
*ptarget_stats
);
1071 bool NicIFEnableNIC(struct net_device
*dev
);
1072 bool NicIFDisableNIC(struct net_device
*dev
);
1074 bool MgntActSet_RF_State(struct net_device
*dev
,
1075 enum rt_rf_power_state StateToSet
,
1076 RT_RF_CHANGE_SOURCE ChangeSource
,
1078 void ActUpdateChannelAccessSetting(struct net_device
*dev
,
1079 enum wireless_mode WirelessMode
,
1080 struct channel_access_setting
*ChnlAccessSetting
);