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 <andrea.merello@gmail.com>, 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/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>
48 /* Need this defined before including local include files */
49 #define DRV_NAME "rtl819xE"
51 #include "../rtllib.h"
53 #include "../dot11d.h"
55 #include "r8192E_firmware.h"
56 #include "r8192E_hw.h"
58 #include "r8190P_def.h"
59 #include "r8192E_dev.h"
61 #include "rtl_eeprom.h"
66 #define DRV_COPYRIGHT \
67 "Copyright(c) 2008 - 2010 Realsil Semiconductor Corporation"
68 #define DRV_AUTHOR "<wlanfae@realtek.com>"
69 #define DRV_VERSION "0014.0401.2010"
71 #define IS_HARDWARE_TYPE_819xP(_priv) \
72 ((((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8190P) || \
73 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192E))
74 #define IS_HARDWARE_TYPE_8192SE(_priv) \
75 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192SE)
76 #define IS_HARDWARE_TYPE_8192CE(_priv) \
77 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192CE)
78 #define IS_HARDWARE_TYPE_8192CU(_priv) \
79 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192CU)
80 #define IS_HARDWARE_TYPE_8192DE(_priv) \
81 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192DE)
82 #define IS_HARDWARE_TYPE_8192DU(_priv) \
83 (((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192DU)
85 #define RTL_PCI_DEVICE(vend, dev, cfg) \
86 .vendor = (vend), .device = (dev), \
87 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID , \
88 .driver_data = (kernel_ulong_t)&(cfg)
90 #define RTL_MAX_SCAN_SIZE 128
92 #define RTL_RATE_MAX 30
94 #define TOTAL_CAM_ENTRY 32
95 #define CAM_CONTENT_COUNT 8
98 #define BIT(_i) (1<<(_i))
101 #define IS_NIC_DOWN(priv) (!(priv)->up)
103 #define IS_ADAPTER_SENDS_BEACON(dev) 0
105 #define IS_UNDER_11N_AES_MODE(_rtllib) \
106 ((_rtllib->pHTInfo->bCurrentHTSupport == true) && \
107 (_rtllib->pairwise_key_type == KEY_TYPE_CCMP))
109 #define HAL_MEMORY_MAPPED_IO_RANGE_8190PCI 0x1000
110 #define HAL_HW_PCI_REVISION_ID_8190PCI 0x00
111 #define HAL_MEMORY_MAPPED_IO_RANGE_8192PCIE 0x4000
112 #define HAL_HW_PCI_REVISION_ID_8192PCIE 0x01
113 #define HAL_MEMORY_MAPPED_IO_RANGE_8192SE 0x4000
114 #define HAL_HW_PCI_REVISION_ID_8192SE 0x10
115 #define HAL_HW_PCI_REVISION_ID_8192CE 0x1
116 #define HAL_MEMORY_MAPPED_IO_RANGE_8192CE 0x4000
117 #define HAL_HW_PCI_REVISION_ID_8192DE 0x0
118 #define HAL_MEMORY_MAPPED_IO_RANGE_8192DE 0x4000
120 #define HAL_HW_PCI_8180_DEVICE_ID 0x8180
121 #define HAL_HW_PCI_8185_DEVICE_ID 0x8185
122 #define HAL_HW_PCI_8188_DEVICE_ID 0x8188
123 #define HAL_HW_PCI_8198_DEVICE_ID 0x8198
124 #define HAL_HW_PCI_8190_DEVICE_ID 0x8190
125 #define HAL_HW_PCI_8192_DEVICE_ID 0x8192
126 #define HAL_HW_PCI_8192SE_DEVICE_ID 0x8192
127 #define HAL_HW_PCI_8174_DEVICE_ID 0x8174
128 #define HAL_HW_PCI_8173_DEVICE_ID 0x8173
129 #define HAL_HW_PCI_8172_DEVICE_ID 0x8172
130 #define HAL_HW_PCI_8171_DEVICE_ID 0x8171
131 #define HAL_HW_PCI_0045_DEVICE_ID 0x0045
132 #define HAL_HW_PCI_0046_DEVICE_ID 0x0046
133 #define HAL_HW_PCI_0044_DEVICE_ID 0x0044
134 #define HAL_HW_PCI_0047_DEVICE_ID 0x0047
135 #define HAL_HW_PCI_700F_DEVICE_ID 0x700F
136 #define HAL_HW_PCI_701F_DEVICE_ID 0x701F
137 #define HAL_HW_PCI_DLINK_DEVICE_ID 0x3304
138 #define HAL_HW_PCI_8192CET_DEVICE_ID 0x8191
139 #define HAL_HW_PCI_8192CE_DEVICE_ID 0x8178
140 #define HAL_HW_PCI_8191CE_DEVICE_ID 0x8177
141 #define HAL_HW_PCI_8188CE_DEVICE_ID 0x8176
142 #define HAL_HW_PCI_8192CU_DEVICE_ID 0x8191
143 #define HAL_HW_PCI_8192DE_DEVICE_ID 0x092D
144 #define HAL_HW_PCI_8192DU_DEVICE_ID 0x092D
146 #define RTL819X_DEFAULT_RF_TYPE RF_1T2R
148 #define RTLLIB_WATCH_DOG_TIME 2000
150 #define MAX_DEV_ADDR_SIZE 8 /*support till 64 bit bus width OS*/
151 #define MAX_FIRMWARE_INFORMATION_SIZE 32
152 #define MAX_802_11_HEADER_LENGTH (40 + MAX_FIRMWARE_INFORMATION_SIZE)
153 #define ENCRYPTION_MAX_OVERHEAD 128
154 #define MAX_FRAGMENT_COUNT 8
155 #define MAX_TRANSMIT_BUFFER_SIZE \
156 (1600 + (MAX_802_11_HEADER_LENGTH + ENCRYPTION_MAX_OVERHEAD) * \
161 #define DEFAULT_FRAG_THRESHOLD 2342U
162 #define MIN_FRAG_THRESHOLD 256U
163 #define DEFAULT_BEACONINTERVAL 0x64U
165 #define DEFAULT_SSID ""
166 #define DEFAULT_RETRY_RTS 7
167 #define DEFAULT_RETRY_DATA 7
168 #define PRISM_HDR_SIZE 64
170 #define PHY_RSSI_SLID_WIN_MAX 100
172 #define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30)
174 #define TxBBGainTableLength 37
175 #define CCKTxBBGainTableLength 23
177 #define CHANNEL_PLAN_LEN 10
180 #define NIC_SEND_HANG_THRESHOLD_NORMAL 4
181 #define NIC_SEND_HANG_THRESHOLD_POWERSAVE 8
183 #define MAX_TX_QUEUE 9
185 #define MAX_RX_QUEUE 1
187 #define MAX_RX_COUNT 64
188 #define MAX_TX_QUEUE_COUNT 9
192 enum RTL819x_PHY_PARAM
{
193 RTL819X_PHY_MACPHY_REG
= 0,
194 RTL819X_PHY_MACPHY_REG_PG
= 1,
195 RTL8188C_PHY_MACREG
= 2,
196 RTL8192C_PHY_MACREG
= 3,
198 RTL819X_PHY_REG_1T2R
= 5,
199 RTL819X_PHY_REG_to1T1R
= 6,
200 RTL819X_PHY_REG_to1T2R
= 7,
201 RTL819X_PHY_REG_to2T2R
= 8,
202 RTL819X_PHY_REG_PG
= 9,
203 RTL819X_AGC_TAB
= 10,
204 RTL819X_PHY_RADIO_A
= 11,
205 RTL819X_PHY_RADIO_A_1T
= 12,
206 RTL819X_PHY_RADIO_A_2T
= 13,
207 RTL819X_PHY_RADIO_B
= 14,
208 RTL819X_PHY_RADIO_B_GM
= 15,
209 RTL819X_PHY_RADIO_C
= 16,
210 RTL819X_PHY_RADIO_D
= 17,
211 RTL819X_EEPROM_MAP
= 18,
212 RTL819X_EFUSE_MAP
= 19,
226 enum rt_eeprom_type
{
233 TXCMD_TXRA_HISTORY_CTRL
= 0xFF900000,
234 TXCMD_RESET_TX_PKT_BUFF
= 0xFF900001,
235 TXCMD_RESET_RX_PKT_BUFF
= 0xFF900002,
236 TXCMD_SET_TX_DURATION
= 0xFF900003,
237 TXCMD_SET_RX_RSSI
= 0xFF900004,
238 TXCMD_SET_TX_PWR_TRACKING
= 0xFF900005,
242 enum rt_rf_type_819xu
{
264 enum rt_customer_id
{
266 RT_CID_8187_ALPHA0
= 1,
267 RT_CID_8187_SERCOMM_PS
= 2,
268 RT_CID_8187_HW_LED
= 3,
269 RT_CID_8187_NETGEAR
= 4,
271 RT_CID_819x_CAMEO
= 6,
272 RT_CID_819x_RUNTOP
= 7,
273 RT_CID_819x_Senao
= 8,
275 RT_CID_819x_Netcore
= 10,
276 RT_CID_Nettronix
= 11,
280 RT_CID_819x_ALPHA
= 15,
281 RT_CID_819x_Sitecom
= 16,
283 RT_CID_819x_Lenovo
= 18,
284 RT_CID_819x_QMI
= 19,
285 RT_CID_819x_Edimax_Belkin
= 20,
286 RT_CID_819x_Sercomm_Belkin
= 21,
287 RT_CID_819x_CAMEO1
= 22,
288 RT_CID_819x_MSI
= 23,
289 RT_CID_819x_Acer
= 24,
291 RT_CID_819x_CLEVO
= 28,
292 RT_CID_819x_Arcadyan_Belkin
= 29,
293 RT_CID_819x_SAMSUNG
= 30,
294 RT_CID_819x_WNC_COREGA
= 31,
298 RESET_TYPE_NORESET
= 0x00,
299 RESET_TYPE_NORMAL
= 0x01,
300 RESET_TYPE_SILENT
= 0x02
303 enum ic_inferiority_8192s
{
304 IC_INFERIORITY_A
= 0,
305 IC_INFERIORITY_B
= 1,
308 enum pci_bridge_vendor
{
309 PCI_BRIDGE_VENDOR_INTEL
= 0x0,
310 PCI_BRIDGE_VENDOR_ATI
,
311 PCI_BRIDGE_VENDOR_AMD
,
312 PCI_BRIDGE_VENDOR_SIS
,
313 PCI_BRIDGE_VENDOR_UNKNOWN
,
314 PCI_BRIDGE_VENDOR_MAX
,
324 struct rtl_reg_debug
{
330 unsigned char length
;
332 unsigned char buf
[0xff];
341 struct rt_smooth_data_4rf
{
342 char elements
[4][100];
352 unsigned long rxframgment
;
353 unsigned long rxurberr
;
354 unsigned long rxstaterr
;
355 unsigned long rxdatacrcerr
;
356 unsigned long rxmgmtcrcerr
;
357 unsigned long rxcrcerrmin
;
358 unsigned long rxcrcerrmid
;
359 unsigned long rxcrcerrmax
;
360 unsigned long received_rate_histogram
[4][32];
361 unsigned long received_preamble_GI
[2][32];
362 unsigned long rx_AMPDUsize_histogram
[5];
363 unsigned long rx_AMPDUnum_histogram
[5];
364 unsigned long numpacket_matchbssid
;
365 unsigned long numpacket_toself
;
366 unsigned long num_process_phyinfo
;
367 unsigned long numqry_phystatus
;
368 unsigned long numqry_phystatusCCK
;
369 unsigned long numqry_phystatusHT
;
370 unsigned long received_bwtype
[5];
371 unsigned long txnperr
;
372 unsigned long txnpdrop
;
373 unsigned long txresumed
;
374 unsigned long rxoverflow
;
376 unsigned long txnpokint
;
378 unsigned long shints
;
379 unsigned long txoverflow
;
380 unsigned long txlpokint
;
381 unsigned long txlpdrop
;
382 unsigned long txlperr
;
383 unsigned long txbeokint
;
384 unsigned long txbedrop
;
385 unsigned long txbeerr
;
386 unsigned long txbkokint
;
387 unsigned long txbkdrop
;
388 unsigned long txbkerr
;
389 unsigned long txviokint
;
390 unsigned long txvidrop
;
391 unsigned long txvierr
;
392 unsigned long txvookint
;
393 unsigned long txvodrop
;
394 unsigned long txvoerr
;
395 unsigned long txbeaconokint
;
396 unsigned long txbeacondrop
;
397 unsigned long txbeaconerr
;
398 unsigned long txmanageokint
;
399 unsigned long txmanagedrop
;
400 unsigned long txmanageerr
;
401 unsigned long txcmdpktokint
;
402 unsigned long txdatapkt
;
403 unsigned long txfeedback
;
404 unsigned long txfeedbackok
;
405 unsigned long txoktotal
;
406 unsigned long txokbytestotal
;
407 unsigned long txokinperiod
;
408 unsigned long txmulticast
;
409 unsigned long txbytesmulticast
;
410 unsigned long txbroadcast
;
411 unsigned long txbytesbroadcast
;
412 unsigned long txunicast
;
413 unsigned long txbytesunicast
;
414 unsigned long rxbytesunicast
;
415 unsigned long txfeedbackfail
;
416 unsigned long txerrtotal
;
417 unsigned long txerrbytestotal
;
418 unsigned long txerrmulticast
;
419 unsigned long txerrbroadcast
;
420 unsigned long txerrunicast
;
421 unsigned long txretrycount
;
422 unsigned long txfeedbackretry
;
424 unsigned long slide_signal_strength
[100];
425 unsigned long slide_evm
[100];
426 unsigned long slide_rssi_total
;
427 unsigned long slide_evm_total
;
428 long signal_strength
;
430 long last_signal_strength_inpercent
;
431 long recv_signal_power
;
432 u8 rx_rssi_percentage
[4];
433 u8 rx_evm_percentage
[2];
435 struct rt_tx_rahis txrate
;
436 u32 Slide_Beacon_pwdb
[100];
437 u32 Slide_Beacon_Total
;
438 struct rt_smooth_data_4rf cck_adc_pwdb
;
439 u32 CurrentShowTxate
;
442 struct channel_access_setting
{
451 enum two_port_status
{
452 TWO_PORT_STATUS__DEFAULT_ONLY
,
453 TWO_PORT_STATUS__EXTENSION_ONLY
,
454 TWO_PORT_STATUS__EXTENSION_FOLLOW_DEFAULT
,
455 TWO_PORT_STATUS__DEFAULT_G_EXTENSION_N20
,
456 TWO_PORT_STATUS__ADHOC
,
457 TWO_PORT_STATUS__WITHOUT_ANY_ASSOCIATE
460 struct txbbgain_struct
{
461 long txbb_iq_amplifygain
;
466 u8 ccktxbb_valuearray
[8];
481 struct tx_ring
*next
;
484 struct rtl8192_tx_ring
{
485 struct tx_desc
*desc
;
488 unsigned int entries
;
489 struct sk_buff_head queue
;
496 void (*get_eeprom_size
)(struct net_device
*dev
);
497 void (*init_adapter_variable
)(struct net_device
*dev
);
498 void (*init_before_adapter_start
)(struct net_device
*dev
);
499 bool (*initialize_adapter
)(struct net_device
*dev
);
500 void (*link_change
)(struct net_device
*dev
);
501 void (*tx_fill_descriptor
)(struct net_device
*dev
,
502 struct tx_desc
*tx_desc
,
503 struct cb_desc
*cb_desc
,
504 struct sk_buff
*skb
);
505 void (*tx_fill_cmd_descriptor
)(struct net_device
*dev
,
506 struct tx_desc_cmd
*entry
,
507 struct cb_desc
*cb_desc
,
508 struct sk_buff
*skb
);
509 bool (*rx_query_status_descriptor
)(struct net_device
*dev
,
510 struct rtllib_rx_stats
*stats
,
511 struct rx_desc
*pdesc
,
512 struct sk_buff
*skb
);
513 bool (*rx_command_packet_handler
)(struct net_device
*dev
,
515 struct rx_desc
*pdesc
);
516 void (*stop_adapter
)(struct net_device
*dev
, bool reset
);
517 void (*update_ratr_table
)(struct net_device
*dev
);
518 void (*irq_enable
)(struct net_device
*dev
);
519 void (*irq_disable
)(struct net_device
*dev
);
520 void (*irq_clear
)(struct net_device
*dev
);
521 void (*rx_enable
)(struct net_device
*dev
);
522 void (*tx_enable
)(struct net_device
*dev
);
523 void (*interrupt_recognized
)(struct net_device
*dev
,
524 u32
*p_inta
, u32
*p_intb
);
525 bool (*TxCheckStuckHandler
)(struct net_device
*dev
);
526 bool (*RxCheckStuckHandler
)(struct net_device
*dev
);
530 struct pci_dev
*pdev
;
531 struct pci_dev
*bridge_pdev
;
534 bool bfirst_after_down
;
535 bool initialized_at_probe
;
536 bool being_init_adapter
;
537 bool bDriverIsGoingToUnload
;
544 struct delayed_work update_beacon_wq
;
545 struct delayed_work watch_dog_wq
;
546 struct delayed_work txpower_tracking_wq
;
547 struct delayed_work rfpath_check_wq
;
548 struct delayed_work gpio_change_rf_wq
;
549 struct delayed_work initialgain_operate_wq
;
550 struct delayed_work check_hw_scan_wq
;
551 struct delayed_work hw_scan_simu_wq
;
552 struct delayed_work start_hw_scan_wq
;
554 struct workqueue_struct
*priv_wq
;
556 struct channel_access_setting ChannelAccessSetting
;
558 struct mp_adapter NdisAdapter
;
560 struct rtl819x_ops
*ops
;
561 struct rtllib_device
*rtllib
;
563 struct work_struct reset_wq
;
565 struct log_int_8190 InterruptLog
;
567 enum rt_customer_id CustomerID
;
570 enum rt_rf_type_819xu rf_chip
;
571 enum ic_inferiority_8192s IC_Class
;
572 enum ht_channel_width CurrentChannelBW
;
573 struct bb_reg_definition PHYRegDef
[4];
574 struct rate_adaptive rate_adaptive
;
576 struct ccktxbbgain cck_txbbgain_table
[CCKTxBBGainTableLength
];
577 struct ccktxbbgain cck_txbbgain_ch14_table
[CCKTxBBGainTableLength
];
579 struct txbbgain_struct txbbgain_table
[TxBBGainTableLength
];
581 enum acm_method AcmMethod
;
583 struct rt_firmware
*pFirmware
;
584 enum rtl819x_loopback LoopbackMode
;
585 enum firmware_source firmware_source
;
587 struct timer_list watch_dog_timer
;
588 struct timer_list fsync_timer
;
589 struct timer_list gpio_polling_timer
;
591 spinlock_t fw_scan_lock
;
593 spinlock_t irq_th_lock
;
595 spinlock_t rf_ps_lock
;
597 spinlock_t rt_h2c_lock
;
601 struct sk_buff_head rx_queue
;
602 struct sk_buff_head skb_queue
;
604 struct tasklet_struct irq_rx_tasklet
;
605 struct tasklet_struct irq_tx_tasklet
;
606 struct tasklet_struct irq_prepare_beacon_tasklet
;
608 struct semaphore wx_sem
;
609 struct semaphore rf_sem
;
612 struct rt_stats stats
;
613 struct iw_statistics wstats
;
614 struct proc_dir_entry
*dir_dev
;
616 short (*rf_set_sens
)(struct net_device
*dev
, short sens
);
617 u8 (*rf_set_chan
)(struct net_device
*dev
, u8 ch
);
618 void (*rf_close
)(struct net_device
*dev
);
619 void (*rf_init
)(struct net_device
*dev
);
621 struct rx_desc
*rx_ring
[MAX_RX_QUEUE
];
622 struct sk_buff
*rx_buf
[MAX_RX_QUEUE
][MAX_RX_COUNT
];
623 dma_addr_t rx_ring_dma
[MAX_RX_QUEUE
];
624 unsigned int rx_idx
[MAX_RX_QUEUE
];
630 u16 EarlyRxThreshold
;
638 struct rtl8192_tx_ring tx_ring
[MAX_TX_QUEUE_COUNT
];
642 atomic_t tx_pending
[0x10];
656 /**********************************************************/
663 struct work_struct qos_activate
;
683 enum nic_t card_8192
;
684 u8 card_8192_version
;
690 char nick
[IW_ESSID_MAX_SIZE
+ 1];
695 bool bTKIPinNmodeFromReg
;
696 bool bWEPinNmodeFromReg
;
700 u8 check_roaming_cnt
;
702 bool bIgnoreSilentReset
;
703 u32 SilentResetRxSoltNum
;
704 u32 SilentResetRxSlotIndex
;
705 u32 SilentResetRxStuckEvent
[MAX_SILENT_RESET_RX_SLOT_NUM
];
711 u8 nrxAMPDU_aggr_num
;
713 u32 last_rxdesc_tsf_high
;
714 u32 last_rxdesc_tsf_low
;
718 u8 dot11CurrentPreambleMode
;
725 u16 FirmwareSubVersion
;
727 bool AutoloadFailFlag
;
732 u8 RegSupportPciASPM
;
740 u8 EfuseMap
[2][HWSET_MAX_SIZE_92S
];
742 u8 EfuseUsedPercentage
;
749 u8 eeprom_CustomerID
;
750 u16 eeprom_ChannelPlan
;
754 u8 EEPROMPwrGroup
[2][3];
757 u8 EEPROMTxPowerLevelCCK
[14];
758 u8 EEPROMTxPowerLevelOFDM24G
[14];
759 u8 EEPROMTxPowerLevelOFDM5G
[24];
760 u8 EEPROMRfACCKChnl1TxPwLevel
[3];
761 u8 EEPROMRfAOfdmChnlTxPwLevel
[3];
762 u8 EEPROMRfCCCKChnl1TxPwLevel
[3];
763 u8 EEPROMRfCOfdmChnlTxPwLevel
[3];
764 u16 EEPROMTxPowerDiff
;
766 u8 EEPROMThermalMeter
;
770 u8 EEPROMBluetoothCoexist
;
771 u8 EEPROMBluetoothType
;
772 u8 EEPROMBluetoothAntNum
;
773 u8 EEPROMBluetoothAntIsolation
;
774 u8 EEPROMBluetoothRadioShared
;
777 u8 EEPROMSupportWoWLAN
;
780 u8 EEPROMHT2T_TxPwr
[6];
783 u8 EEPROMTxPowerLevelCCK_V1
[3];
784 u8 EEPROMLegacyHTTxPowerDiff
;
797 u8 SetBWModeInProgress
;
803 bool brfpath_rxenable
[4];
805 bool bTXPowerDataReadFromEEPORM
;
809 bool bChnlPlanFromHW
;
813 bool bInPowerSaveMode
;
816 bool aspm_clkreq_enable
;
817 u32 pci_bridge_vendor
;
818 u8 RegHostPciASPMSetting
;
819 u8 RegDevicePciASPMSetting
;
821 bool RFChangeInProgress
;
822 bool SetRFPowerStateInProgress
;
843 u32 IQK_MAC_backup
[3];
845 bool SetFwCmdInProgress
;
850 bool bInformFWDriverControlDM
;
851 u8 PwrGroupHT20
[2][14];
852 u8 PwrGroupHT40
[2][14];
855 long EntryMinUndecoratedSmoothedPWDB
;
856 long EntryMaxUndecoratedSmoothedPWDB
;
857 u8 DynamicTxHighPowerLvl
;
860 struct false_alarm_stats FalseAlmCnt
;
868 u8 CCKPresentAttentuation_20Mdefault
;
869 u8 CCKPresentAttentuation_40Mdefault
;
870 char CCKPresentAttentuation_difference
;
871 char CCKPresentAttentuation
;
873 long undecorated_smoothed_pwdb
;
874 long undecorated_smoothed_cck_adc_pwdb
[4];
876 u32 MCSTxPowerLevelOriginalOffset
[6];
877 u32 CCKTxPowerLevelOriginalOffset
;
878 u8 TxPowerLevelCCK
[14];
879 u8 TxPowerLevelCCK_A
[14];
880 u8 TxPowerLevelCCK_C
[14];
881 u8 TxPowerLevelOFDM24G
[14];
882 u8 TxPowerLevelOFDM5G
[14];
883 u8 TxPowerLevelOFDM24G_A
[14];
884 u8 TxPowerLevelOFDM24G_C
[14];
885 u8 LegacyHTTxPowerDiff
;
889 u8 RfTxPwrLevelCck
[2][14];
890 u8 RfTxPwrLevelOfdm1T
[2][14];
891 u8 RfTxPwrLevelOfdm2T
[2][14];
892 u8 AntennaTxPwDiff
[3];
893 u8 TxPwrHt20Diff
[2][14];
894 u8 TxPwrLegacyHtDiff
[2][14];
898 u8 CurrentCckTxPwrIdx
;
899 u8 CurrentOfdm24GTxPwrIdx
;
901 bool bdynamic_txpower
;
902 bool bDynamicTxHighPower
;
903 bool bDynamicTxLowPower
;
904 bool bLastDTPFlag_High
;
905 bool bLastDTPFlag_Low
;
907 bool bstore_last_dtpflag
;
908 bool bstart_txctrl_bydtp
;
910 u8 rfa_txpowertrackingindex
;
911 u8 rfa_txpowertrackingindex_real
;
912 u8 rfa_txpowertracking_default
;
913 u8 rfc_txpowertrackingindex
;
914 u8 rfc_txpowertrackingindex_real
;
915 u8 rfc_txpowertracking_default
;
916 bool btxpower_tracking
;
919 u8 TxPowerTrackControl
;
921 bool btxpower_trackingInit
;
926 u8 Record_CCK_20Mindex
;
927 u8 Record_CCK_40Mindex
;
929 struct init_gain initgain_backup
;
930 u8 DefaultInitialGain
[4];
931 bool bis_any_nonbepkts
;
932 bool bcurrent_turbo_EDCA
;
933 bool bis_cur_rdlstate
;
940 bool bfsync_processing
;
942 u32 rateCountDiffRecord
;
943 u32 ContinueDiffCount
;
949 bool bDMInitialGainEnable
;
950 bool MutualAuthenticationFail
;
952 bool bDisableFrameBursting
;
957 u32 txpower_checkcnt
;
958 u32 txpower_tracking_callback_cnt
;
959 u8 thermal_read_val
[40];
960 u8 thermal_readback_index
;
961 u32 ccktxpower_adjustcnt_not_ch14
;
962 u32 ccktxpower_adjustcnt_ch14
;
964 enum reset_type ResetProgress
;
965 bool bForcedSilentReset
;
966 bool bDisableNormalResetCheck
;
970 bool bResetInProgress
;
973 u8 InitialGainOperateType
;
1001 extern const struct ethtool_ops rtl819x_ethtool_ops
;
1003 void rtl8192_tx_cmd(struct net_device
*dev
, struct sk_buff
*skb
);
1004 short rtl8192_tx(struct net_device
*dev
, struct sk_buff
*skb
);
1006 u8
read_nic_io_byte(struct net_device
*dev
, int x
);
1007 u32
read_nic_io_dword(struct net_device
*dev
, int x
);
1008 u16
read_nic_io_word(struct net_device
*dev
, int x
) ;
1009 void write_nic_io_byte(struct net_device
*dev
, int x
, u8 y
);
1010 void write_nic_io_word(struct net_device
*dev
, int x
, u16 y
);
1011 void write_nic_io_dword(struct net_device
*dev
, int x
, u32 y
);
1013 u8
read_nic_byte(struct net_device
*dev
, int x
);
1014 u32
read_nic_dword(struct net_device
*dev
, int x
);
1015 u16
read_nic_word(struct net_device
*dev
, int x
) ;
1016 void write_nic_byte(struct net_device
*dev
, int x
, u8 y
);
1017 void write_nic_word(struct net_device
*dev
, int x
, u16 y
);
1018 void write_nic_dword(struct net_device
*dev
, int x
, u32 y
);
1020 void force_pci_posting(struct net_device
*dev
);
1022 void rtl8192_rx_enable(struct net_device
*);
1023 void rtl8192_tx_enable(struct net_device
*);
1025 int rtl8192_hard_start_xmit(struct sk_buff
*skb
, struct net_device
*dev
);
1026 void rtl8192_hard_data_xmit(struct sk_buff
*skb
, struct net_device
*dev
,
1028 void rtl8192_data_hard_stop(struct net_device
*dev
);
1029 void rtl8192_data_hard_resume(struct net_device
*dev
);
1030 void rtl8192_restart(void *data
);
1031 void rtl819x_watchdog_wqcallback(void *data
);
1032 void rtl8192_hw_sleep_wq(void *data
);
1033 void watch_dog_timer_callback(unsigned long data
);
1034 void rtl8192_irq_rx_tasklet(struct r8192_priv
*priv
);
1035 void rtl8192_irq_tx_tasklet(struct r8192_priv
*priv
);
1036 int rtl8192_down(struct net_device
*dev
, bool shutdownrf
);
1037 int rtl8192_up(struct net_device
*dev
);
1038 void rtl8192_commit(struct net_device
*dev
);
1039 void rtl8192_set_chan(struct net_device
*dev
, short ch
);
1041 void check_rfctrl_gpio_timer(unsigned long data
);
1043 void rtl8192_hw_wakeup_wq(void *data
);
1044 short rtl8192_pci_initdescring(struct net_device
*dev
);
1046 void rtl8192_cancel_deferred_work(struct r8192_priv
*priv
);
1048 int _rtl8192_up(struct net_device
*dev
, bool is_silent_reset
);
1050 short rtl8192_is_tx_queue_empty(struct net_device
*dev
);
1051 void rtl8192_irq_disable(struct net_device
*dev
);
1053 void rtl8192_tx_timeout(struct net_device
*dev
);
1054 void rtl8192_pci_resetdescring(struct net_device
*dev
);
1055 void rtl8192_SetWirelessMode(struct net_device
*dev
, u8 wireless_mode
);
1056 void rtl8192_irq_enable(struct net_device
*dev
);
1057 void rtl8192_config_rate(struct net_device
*dev
, u16
*rate_config
);
1058 void rtl8192_update_cap(struct net_device
*dev
, u16 cap
);
1059 void rtl8192_irq_disable(struct net_device
*dev
);
1061 void rtl819x_UpdateRxPktTimeStamp(struct net_device
*dev
,
1062 struct rtllib_rx_stats
*stats
);
1063 long rtl819x_translate_todbm(struct r8192_priv
*priv
, u8 signal_strength_index
);
1064 void rtl819x_update_rxsignalstatistics8190pci(struct r8192_priv
*priv
,
1065 struct rtllib_rx_stats
*pprevious_stats
);
1066 u8
rtl819x_evm_dbtopercentage(char value
);
1067 void rtl819x_process_cck_rxpathsel(struct r8192_priv
*priv
,
1068 struct rtllib_rx_stats
*pprevious_stats
);
1069 u8
rtl819x_query_rxpwrpercentage(char antpower
);
1070 void rtl8192_record_rxdesc_forlateruse(struct rtllib_rx_stats
*psrc_stats
,
1071 struct rtllib_rx_stats
*ptarget_stats
);
1072 bool NicIFEnableNIC(struct net_device
*dev
);
1073 bool NicIFDisableNIC(struct net_device
*dev
);
1075 bool MgntActSet_RF_State(struct net_device
*dev
,
1076 enum rt_rf_power_state StateToSet
,
1077 RT_RF_CHANGE_SOURCE ChangeSource
,
1079 void ActUpdateChannelAccessSetting(struct net_device
*dev
,
1080 enum wireless_mode WirelessMode
,
1081 struct channel_access_setting
*ChnlAccessSetting
);