aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtlwifi/wifi.h
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2013-03-24 23:06:33 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-04-01 16:17:06 -0400
commit26634c4b1868323f49f8cd24c3493b57819867fd (patch)
tree281409ae1cc5c43951ea74761065a427a5a3ea84 /drivers/net/wireless/rtlwifi/wifi.h
parentcbafb601cad81de612013fad8daf710ca900015a (diff)
rtlwifi Modify existing bits to match vendor version 2013.02.07
These changes add the new variables for P2P and modify the various struct definitions for other new features. This patch updates files base.{c,h} for the changes in the newest vendor driver. This patch updates files ps.{c,h} for the changes in the newest vendor driver. This patch updates files debug.{c,h}, efuse.c, pci.{c,h}, and wifi.h for the changes in the newest vendor driver. This patch updates files core.c, ps.c, rc.c, and wifi.h for the changes in the newest vendor driver. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: jcheung@suse.com Cc: machen@suse.com Cc: mmarek@suse.cz Cc: zhiyuan_yang@realsil.com.cn Cc: page_he@realsil.com.cn Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/wifi.h')
-rw-r--r--drivers/net/wireless/rtlwifi/wifi.h116
1 files changed, 108 insertions, 8 deletions
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index c3eff32acf6c..528888d69d2f 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -104,6 +104,7 @@
104/* for early mode */ 104/* for early mode */
105#define FCS_LEN 4 105#define FCS_LEN 4
106#define EM_HDR_LEN 8 106#define EM_HDR_LEN 8
107
107enum intf_type { 108enum intf_type {
108 INTF_PCI = 0, 109 INTF_PCI = 0,
109 INTF_USB = 1, 110 INTF_USB = 1,
@@ -263,7 +264,7 @@ enum hw_variables {
263 HW_VAR_RATR_0, 264 HW_VAR_RATR_0,
264 HW_VAR_RRSR, 265 HW_VAR_RRSR,
265 HW_VAR_CPU_RST, 266 HW_VAR_CPU_RST,
266 HW_VAR_CECHK_BSSID, 267 HW_VAR_CHECK_BSSID,
267 HW_VAR_LBK_MODE, 268 HW_VAR_LBK_MODE,
268 HW_VAR_AES_11N_FIX, 269 HW_VAR_AES_11N_FIX,
269 HW_VAR_USB_RX_AGGR, 270 HW_VAR_USB_RX_AGGR,
@@ -278,7 +279,10 @@ enum hw_variables {
278 HW_VAR_SET_RPWM, 279 HW_VAR_SET_RPWM,
279 HW_VAR_H2C_FW_PWRMODE, 280 HW_VAR_H2C_FW_PWRMODE,
280 HW_VAR_H2C_FW_JOINBSSRPT, 281 HW_VAR_H2C_FW_JOINBSSRPT,
282 HW_VAR_H2C_FW_P2P_PS_OFFLOAD,
281 HW_VAR_FW_PSMODE_STATUS, 283 HW_VAR_FW_PSMODE_STATUS,
284 HW_VAR_RESUME_CLK_ON,
285 HW_VAR_FW_LPS_ACTION,
282 HW_VAR_1X1_RECV_COMBINE, 286 HW_VAR_1X1_RECV_COMBINE,
283 HW_VAR_STOP_SEND_BEACON, 287 HW_VAR_STOP_SEND_BEACON,
284 HW_VAR_TSF_TIMER, 288 HW_VAR_TSF_TIMER,
@@ -305,6 +309,7 @@ enum hw_variables {
305 HW_VAR_INT_AC, 309 HW_VAR_INT_AC,
306 HW_VAR_RF_TIMING, 310 HW_VAR_RF_TIMING,
307 311
312 HAL_DEF_WOWLAN,
308 HW_VAR_MRC, 313 HW_VAR_MRC,
309 314
310 HW_VAR_MGT_FILTER, 315 HW_VAR_MGT_FILTER,
@@ -461,6 +466,7 @@ enum rtl_var_map {
461 EFUSE_MAX_SECTION_MAP, 466 EFUSE_MAX_SECTION_MAP,
462 EFUSE_REAL_CONTENT_SIZE, 467 EFUSE_REAL_CONTENT_SIZE,
463 EFUSE_OOB_PROTECT_BYTES_LEN, 468 EFUSE_OOB_PROTECT_BYTES_LEN,
469 EFUSE_ACCESS,
464 470
465 /*CAM map */ 471 /*CAM map */
466 RWCAM, 472 RWCAM,
@@ -742,6 +748,11 @@ struct false_alarm_statistics {
742 u32 cnt_ofdm_fail; 748 u32 cnt_ofdm_fail;
743 u32 cnt_cck_fail; 749 u32 cnt_cck_fail;
744 u32 cnt_all; 750 u32 cnt_all;
751 u32 cnt_ofdm_cca;
752 u32 cnt_cck_cca;
753 u32 cnt_cca_all;
754 u32 cnt_bw_usc;
755 u32 cnt_bw_lsc;
745}; 756};
746 757
747struct init_gain { 758struct init_gain {
@@ -826,8 +837,67 @@ struct rtl_rfkill {
826 bool rfkill_state; /*0 is off, 1 is on */ 837 bool rfkill_state; /*0 is off, 1 is on */
827}; 838};
828 839
840/*for P2P PS**/
841#define P2P_MAX_NOA_NUM 2
842
843enum p2p_role {
844 P2P_ROLE_DISABLE = 0,
845 P2P_ROLE_DEVICE = 1,
846 P2P_ROLE_CLIENT = 2,
847 P2P_ROLE_GO = 3
848};
849
850enum p2p_ps_state {
851 P2P_PS_DISABLE = 0,
852 P2P_PS_ENABLE = 1,
853 P2P_PS_SCAN = 2,
854 P2P_PS_SCAN_DONE = 3,
855 P2P_PS_ALLSTASLEEP = 4, /* for P2P GO */
856};
857
858enum p2p_ps_mode {
859 P2P_PS_NONE = 0,
860 P2P_PS_CTWINDOW = 1,
861 P2P_PS_NOA = 2,
862 P2P_PS_MIX = 3, /* CTWindow and NoA */
863};
864
865struct rtl_p2p_ps_info {
866 enum p2p_ps_mode p2p_ps_mode; /* indicate p2p ps mode */
867 enum p2p_ps_state p2p_ps_state; /* indicate p2p ps state */
868 u8 noa_index; /* Identifies instance of Notice of Absence timing. */
869 /* Client traffic window. A period of time in TU after TBTT. */
870 u8 ctwindow;
871 u8 opp_ps; /* opportunistic power save. */
872 u8 noa_num; /* number of NoA descriptor in P2P IE. */
873 /* Count for owner, Type of client. */
874 u8 noa_count_type[P2P_MAX_NOA_NUM];
875 /* Max duration for owner, preferred or min acceptable duration
876 * for client.
877 */
878 u32 noa_duration[P2P_MAX_NOA_NUM];
879 /* Length of interval for owner, preferred or max acceptable intervali
880 * of client.
881 */
882 u32 noa_interval[P2P_MAX_NOA_NUM];
883 /* schedule in terms of the lower 4 bytes of the TSF timer. */
884 u32 noa_start_time[P2P_MAX_NOA_NUM];
885};
886
887struct p2p_ps_offload_t {
888 u8 offload_en:1;
889 u8 role:1; /* 1: Owner, 0: Client */
890 u8 ctwindow_en:1;
891 u8 noa0_en:1;
892 u8 noa1_en:1;
893 u8 allstasleep:1;
894 u8 discovery:1;
895 u8 reserved:1;
896};
897
829#define IQK_MATRIX_REG_NUM 8 898#define IQK_MATRIX_REG_NUM 8
830#define IQK_MATRIX_SETTINGS_NUM (1 + 24 + 21) 899#define IQK_MATRIX_SETTINGS_NUM (1 + 24 + 21)
900
831struct iqk_matrix_regs { 901struct iqk_matrix_regs {
832 bool iqk_done; 902 bool iqk_done;
833 long value[1][IQK_MATRIX_REG_NUM]; 903 long value[1][IQK_MATRIX_REG_NUM];
@@ -902,6 +972,8 @@ struct rtl_phy {
902 /* the current Tx power level */ 972 /* the current Tx power level */
903 u8 cur_cck_txpwridx; 973 u8 cur_cck_txpwridx;
904 u8 cur_ofdm24g_txpwridx; 974 u8 cur_ofdm24g_txpwridx;
975 u8 cur_bw20_txpwridx;
976 u8 cur_bw40_txpwridx;
905 977
906 u32 rfreg_chnlval[2]; 978 u32 rfreg_chnlval[2];
907 bool apk_done; 979 bool apk_done;
@@ -940,20 +1012,21 @@ struct rtl_ht_agg {
940 u8 rx_agg_state; 1012 u8 rx_agg_state;
941}; 1013};
942 1014
1015struct rssi_sta {
1016 long undec_sm_pwdb;
1017};
1018
943struct rtl_tid_data { 1019struct rtl_tid_data {
944 u16 seq_number; 1020 u16 seq_number;
945 struct rtl_ht_agg agg; 1021 struct rtl_ht_agg agg;
946}; 1022};
947 1023
948struct rssi_sta {
949 long undec_sm_pwdb;
950};
951
952struct rtl_sta_info { 1024struct rtl_sta_info {
953 struct list_head list; 1025 struct list_head list;
954 u8 ratr_index; 1026 u8 ratr_index;
955 u8 wireless_mode; 1027 u8 wireless_mode;
956 u8 mimo_ps; 1028 u8 mimo_ps;
1029 u8 mac_addr[ETH_ALEN];
957 struct rtl_tid_data tids[MAX_TID_COUNT]; 1030 struct rtl_tid_data tids[MAX_TID_COUNT];
958 1031
959 /* just used for ap adhoc or mesh*/ 1032 /* just used for ap adhoc or mesh*/
@@ -1005,6 +1078,8 @@ struct rtl_mac {
1005 int n_bitrates; 1078 int n_bitrates;
1006 1079
1007 bool offchan_delay; 1080 bool offchan_delay;
1081 u8 p2p; /*using p2p role*/
1082 bool p2p_in_use;
1008 1083
1009 /*filters */ 1084 /*filters */
1010 u32 rx_conf; 1085 u32 rx_conf;
@@ -1014,11 +1089,11 @@ struct rtl_mac {
1014 1089
1015 bool act_scanning; 1090 bool act_scanning;
1016 u8 cnt_after_linked; 1091 u8 cnt_after_linked;
1092 bool skip_scan;
1017 1093
1018 /* early mode */ 1094 /* early mode */
1019 /* skb wait queue */ 1095 /* skb wait queue */
1020 struct sk_buff_head skb_waitq[MAX_TID_COUNT]; 1096 struct sk_buff_head skb_waitq[MAX_TID_COUNT];
1021 u8 earlymode_threshold;
1022 1097
1023 /*RDG*/ 1098 /*RDG*/
1024 bool rdg_en; 1099 bool rdg_en;
@@ -1042,6 +1117,7 @@ struct rtl_mac {
1042 u8 retry_short; 1117 u8 retry_short;
1043 u8 retry_long; 1118 u8 retry_long;
1044 u16 assoc_id; 1119 u16 assoc_id;
1120 bool hiddenssid;
1045 1121
1046 /*IBSS*/ 1122 /*IBSS*/
1047 int beacon_interval; 1123 int beacon_interval;
@@ -1111,10 +1187,13 @@ struct bt_coexist_8723 {
1111 1187
1112struct rtl_hal { 1188struct rtl_hal {
1113 struct ieee80211_hw *hw; 1189 struct ieee80211_hw *hw;
1114 struct bt_coexist_8723 hal_coex_8723; 1190 bool driver_is_goingto_unload;
1115 bool up_first_time; 1191 bool up_first_time;
1192 bool first_init;
1116 bool being_init_adapter; 1193 bool being_init_adapter;
1117 bool bbrf_ready; 1194 bool bbrf_ready;
1195 bool mac_func_enable;
1196 struct bt_coexist_8723 hal_coex_8723;
1118 1197
1119 enum intf_type interface; 1198 enum intf_type interface;
1120 u16 hw_type; /*92c or 92d or 92s and so on */ 1199 u16 hw_type; /*92c or 92d or 92s and so on */
@@ -1122,6 +1201,7 @@ struct rtl_hal {
1122 u8 oem_id; 1201 u8 oem_id;
1123 u32 version; /*version of chip */ 1202 u32 version; /*version of chip */
1124 u8 state; /*stop 0, start 1 */ 1203 u8 state; /*stop 0, start 1 */
1204 u8 board_type;
1125 1205
1126 /*firmware */ 1206 /*firmware */
1127 u32 fwsize; 1207 u32 fwsize;
@@ -1141,6 +1221,10 @@ struct rtl_hal {
1141 bool set_fwcmd_inprogress; 1221 bool set_fwcmd_inprogress;
1142 u8 current_fwcmd_io; 1222 u8 current_fwcmd_io;
1143 1223
1224 bool fw_clk_change_in_progress;
1225 bool allow_sw_to_change_hwclc;
1226 u8 fw_ps_state;
1227 struct p2p_ps_offload_t p2p_ps_offload;
1144 /**/ 1228 /**/
1145 bool driver_going2unload; 1229 bool driver_going2unload;
1146 1230
@@ -1157,6 +1241,7 @@ struct rtl_hal {
1157 /* just for DualMac S3S4 */ 1241 /* just for DualMac S3S4 */
1158 u8 macphyctl_reg; 1242 u8 macphyctl_reg;
1159 bool earlymode_enable; 1243 bool earlymode_enable;
1244 u8 max_earlymode_num;
1160 /* Dual mac*/ 1245 /* Dual mac*/
1161 bool during_mac0init_radiob; 1246 bool during_mac0init_radiob;
1162 bool during_mac1init_radioa; 1247 bool during_mac1init_radioa;
@@ -1341,6 +1426,7 @@ struct rtl_ps_ctl {
1341 bool fw_current_inpsmode; 1426 bool fw_current_inpsmode;
1342 u8 reg_max_lps_awakeintvl; 1427 u8 reg_max_lps_awakeintvl;
1343 bool report_linked; 1428 bool report_linked;
1429 bool low_power_enable;/*for 32k*/
1344 1430
1345 /*for IPS */ 1431 /*for IPS */
1346 bool inactiveps; 1432 bool inactiveps;
@@ -1373,6 +1459,11 @@ struct rtl_ps_ctl {
1373 unsigned long last_beacon; 1459 unsigned long last_beacon;
1374 unsigned long last_action; 1460 unsigned long last_action;
1375 unsigned long last_slept; 1461 unsigned long last_slept;
1462
1463 /*For P2P PS */
1464 struct rtl_p2p_ps_info p2p_ps_info;
1465 u8 pwr_mode;
1466 u8 smart_ps;
1376}; 1467};
1377 1468
1378struct rtl_stats { 1469struct rtl_stats {
@@ -1553,7 +1644,7 @@ struct rtl_hal_ops {
1553 void (*allow_all_destaddr)(struct ieee80211_hw *hw, 1644 void (*allow_all_destaddr)(struct ieee80211_hw *hw,
1554 bool allow_all_da, bool write_into_reg); 1645 bool allow_all_da, bool write_into_reg);
1555 void (*linked_set_reg) (struct ieee80211_hw *hw); 1646 void (*linked_set_reg) (struct ieee80211_hw *hw);
1556 void (*check_switch_to_dmdp) (struct ieee80211_hw *hw); 1647 void (*chk_switch_dmdp) (struct ieee80211_hw *hw);
1557 void (*dualmac_easy_concurrent) (struct ieee80211_hw *hw); 1648 void (*dualmac_easy_concurrent) (struct ieee80211_hw *hw);
1558 void (*dualmac_switch_to_dmdp) (struct ieee80211_hw *hw); 1649 void (*dualmac_switch_to_dmdp) (struct ieee80211_hw *hw);
1559 bool (*phy_rf6052_config) (struct ieee80211_hw *hw); 1650 bool (*phy_rf6052_config) (struct ieee80211_hw *hw);
@@ -1662,6 +1753,8 @@ struct rtl_locks {
1662 /*spin lock */ 1753 /*spin lock */
1663 spinlock_t ips_lock; 1754 spinlock_t ips_lock;
1664 spinlock_t irq_th_lock; 1755 spinlock_t irq_th_lock;
1756 spinlock_t irq_pci_lock;
1757 spinlock_t tx_lock;
1665 spinlock_t h2c_lock; 1758 spinlock_t h2c_lock;
1666 spinlock_t rf_ps_lock; 1759 spinlock_t rf_ps_lock;
1667 spinlock_t rf_lock; 1760 spinlock_t rf_lock;
@@ -1670,6 +1763,9 @@ struct rtl_locks {
1670 spinlock_t entry_list_lock; 1763 spinlock_t entry_list_lock;
1671 spinlock_t usb_lock; 1764 spinlock_t usb_lock;
1672 1765
1766 /*FW clock change */
1767 spinlock_t fw_ps_lock;
1768
1673 /*Dual mac*/ 1769 /*Dual mac*/
1674 spinlock_t cck_and_rw_pagea_lock; 1770 spinlock_t cck_and_rw_pagea_lock;
1675 1771
@@ -1683,6 +1779,8 @@ struct rtl_works {
1683 /*timer */ 1779 /*timer */
1684 struct timer_list watchdog_timer; 1780 struct timer_list watchdog_timer;
1685 struct timer_list dualmac_easyconcurrent_retrytimer; 1781 struct timer_list dualmac_easyconcurrent_retrytimer;
1782 struct timer_list fw_clockoff_timer;
1783 struct timer_list fast_antenna_training_timer;
1686 1784
1687 /*task */ 1785 /*task */
1688 struct tasklet_struct irq_tasklet; 1786 struct tasklet_struct irq_tasklet;
@@ -1696,6 +1794,7 @@ struct rtl_works {
1696 /* For SW LPS */ 1794 /* For SW LPS */
1697 struct delayed_work ps_work; 1795 struct delayed_work ps_work;
1698 struct delayed_work ps_rfon_wq; 1796 struct delayed_work ps_rfon_wq;
1797 struct delayed_work fwevt_wq;
1699 1798
1700 struct work_struct lps_leave_work; 1799 struct work_struct lps_leave_work;
1701}; 1800};
@@ -1802,6 +1901,7 @@ struct rtl_global_var {
1802}; 1901};
1803 1902
1804struct rtl_priv { 1903struct rtl_priv {
1904 struct ieee80211_hw *hw;
1805 struct completion firmware_loading_complete; 1905 struct completion firmware_loading_complete;
1806 struct list_head list; 1906 struct list_head list;
1807 struct rtl_priv *buddy_priv; 1907 struct rtl_priv *buddy_priv;