diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2013-03-24 23:06:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-04-01 16:19:59 -0400 |
commit | 3a16b41240aa893b2c397ea3bd07d86e95e7694b (patch) | |
tree | c0019b42f5d0001b2b9cad6d166932cab947786b /drivers | |
parent | 4b04edc1a7ff1b7c337c3dac920b64865dbd7548 (diff) |
rtlwifi: rtl8192c: rtl8192ce: Update to vendor driver of 2013.02.07
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')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 89 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | 99 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 98 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/hw.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/reg.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 324 |
8 files changed, 298 insertions, 323 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c index b793a659a465..b0b9f905848e 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c +++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | |||
@@ -1147,75 +1147,6 @@ void rtl92c_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw) | |||
1147 | } | 1147 | } |
1148 | EXPORT_SYMBOL(rtl92c_dm_init_rate_adaptive_mask); | 1148 | EXPORT_SYMBOL(rtl92c_dm_init_rate_adaptive_mask); |
1149 | 1149 | ||
1150 | static void rtl92c_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw) | ||
1151 | { | ||
1152 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
1153 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | ||
1154 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); | ||
1155 | struct rate_adaptive *p_ra = &(rtlpriv->ra); | ||
1156 | u32 low_rssi_thresh, high_rssi_thresh; | ||
1157 | struct ieee80211_sta *sta = NULL; | ||
1158 | |||
1159 | if (is_hal_stop(rtlhal)) { | ||
1160 | RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, | ||
1161 | "<---- driver is going to unload\n"); | ||
1162 | return; | ||
1163 | } | ||
1164 | |||
1165 | if (!rtlpriv->dm.useramask) { | ||
1166 | RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, | ||
1167 | "<---- driver does not control rate adaptive mask\n"); | ||
1168 | return; | ||
1169 | } | ||
1170 | |||
1171 | if (mac->link_state == MAC80211_LINKED && | ||
1172 | mac->opmode == NL80211_IFTYPE_STATION) { | ||
1173 | switch (p_ra->pre_ratr_state) { | ||
1174 | case DM_RATR_STA_HIGH: | ||
1175 | high_rssi_thresh = 50; | ||
1176 | low_rssi_thresh = 20; | ||
1177 | break; | ||
1178 | case DM_RATR_STA_MIDDLE: | ||
1179 | high_rssi_thresh = 55; | ||
1180 | low_rssi_thresh = 20; | ||
1181 | break; | ||
1182 | case DM_RATR_STA_LOW: | ||
1183 | high_rssi_thresh = 50; | ||
1184 | low_rssi_thresh = 25; | ||
1185 | break; | ||
1186 | default: | ||
1187 | high_rssi_thresh = 50; | ||
1188 | low_rssi_thresh = 20; | ||
1189 | break; | ||
1190 | } | ||
1191 | |||
1192 | if (rtlpriv->dm.undec_sm_pwdb > (long)high_rssi_thresh) | ||
1193 | p_ra->ratr_state = DM_RATR_STA_HIGH; | ||
1194 | else if (rtlpriv->dm.undec_sm_pwdb > (long)low_rssi_thresh) | ||
1195 | p_ra->ratr_state = DM_RATR_STA_MIDDLE; | ||
1196 | else | ||
1197 | p_ra->ratr_state = DM_RATR_STA_LOW; | ||
1198 | |||
1199 | if (p_ra->pre_ratr_state != p_ra->ratr_state) { | ||
1200 | RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, "RSSI = %ld\n", | ||
1201 | rtlpriv->dm.undec_sm_pwdb); | ||
1202 | RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, | ||
1203 | "RSSI_LEVEL = %d\n", p_ra->ratr_state); | ||
1204 | RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, | ||
1205 | "PreState = %d, CurState = %d\n", | ||
1206 | p_ra->pre_ratr_state, p_ra->ratr_state); | ||
1207 | |||
1208 | rcu_read_lock(); | ||
1209 | sta = ieee80211_find_sta(mac->vif, mac->bssid); | ||
1210 | rtlpriv->cfg->ops->update_rate_tbl(hw, sta, | ||
1211 | p_ra->ratr_state); | ||
1212 | |||
1213 | p_ra->pre_ratr_state = p_ra->ratr_state; | ||
1214 | rcu_read_unlock(); | ||
1215 | } | ||
1216 | } | ||
1217 | } | ||
1218 | |||
1219 | static void rtl92c_dm_init_dynamic_bb_powersaving(struct ieee80211_hw *hw) | 1150 | static void rtl92c_dm_init_dynamic_bb_powersaving(struct ieee80211_hw *hw) |
1220 | { | 1151 | { |
1221 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 1152 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -1437,6 +1368,9 @@ void rtl92c_dm_watchdog(struct ieee80211_hw *hw) | |||
1437 | rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_FWLPS_RF_ON, | 1368 | rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_FWLPS_RF_ON, |
1438 | (u8 *) (&fw_ps_awake)); | 1369 | (u8 *) (&fw_ps_awake)); |
1439 | 1370 | ||
1371 | if (ppsc->p2p_ps_info.p2p_ps_mode) | ||
1372 | fw_ps_awake = false; | ||
1373 | |||
1440 | if ((ppsc->rfpwr_state == ERFON) && ((!fw_current_inpsmode) && | 1374 | if ((ppsc->rfpwr_state == ERFON) && ((!fw_current_inpsmode) && |
1441 | fw_ps_awake) | 1375 | fw_ps_awake) |
1442 | && (!ppsc->rfchange_inprogress)) { | 1376 | && (!ppsc->rfchange_inprogress)) { |
@@ -1446,7 +1380,7 @@ void rtl92c_dm_watchdog(struct ieee80211_hw *hw) | |||
1446 | rtl92c_dm_dynamic_bb_powersaving(hw); | 1380 | rtl92c_dm_dynamic_bb_powersaving(hw); |
1447 | rtl92c_dm_dynamic_txpower(hw); | 1381 | rtl92c_dm_dynamic_txpower(hw); |
1448 | rtl92c_dm_check_txpower_tracking(hw); | 1382 | rtl92c_dm_check_txpower_tracking(hw); |
1449 | rtl92c_dm_refresh_rate_adaptive_mask(hw); | 1383 | /* rtl92c_dm_refresh_rate_adaptive_mask(hw); */ |
1450 | rtl92c_dm_bt_coexist(hw); | 1384 | rtl92c_dm_bt_coexist(hw); |
1451 | rtl92c_dm_check_edca_turbo(hw); | 1385 | rtl92c_dm_check_edca_turbo(hw); |
1452 | } | 1386 | } |
@@ -1651,7 +1585,7 @@ static void rtl92c_bt_set_normal(struct ieee80211_hw *hw) | |||
1651 | } | 1585 | } |
1652 | } | 1586 | } |
1653 | 1587 | ||
1654 | static void rtl92c_bt_ant_isolation(struct ieee80211_hw *hw) | 1588 | static void rtl92c_bt_ant_isolation(struct ieee80211_hw *hw, u8 tmp1byte) |
1655 | { | 1589 | { |
1656 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 1590 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
1657 | struct rtl_pci_priv *rtlpcipriv = rtl_pcipriv(hw); | 1591 | struct rtl_pci_priv *rtlpcipriv = rtl_pcipriv(hw); |
@@ -1673,9 +1607,9 @@ static void rtl92c_bt_ant_isolation(struct ieee80211_hw *hw) | |||
1673 | BT_RSSI_STATE_SPECIAL_LOW)) { | 1607 | BT_RSSI_STATE_SPECIAL_LOW)) { |
1674 | rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, 0xa0); | 1608 | rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, 0xa0); |
1675 | } else if (rtlpcipriv->bt_coexist.bt_service == BT_PAN) { | 1609 | } else if (rtlpcipriv->bt_coexist.bt_service == BT_PAN) { |
1676 | rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, 0x00); | 1610 | rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, tmp1byte); |
1677 | } else { | 1611 | } else { |
1678 | rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, 0x00); | 1612 | rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, tmp1byte); |
1679 | } | 1613 | } |
1680 | } | 1614 | } |
1681 | 1615 | ||
@@ -1726,12 +1660,17 @@ static void rtl92c_check_bt_change(struct ieee80211_hw *hw) | |||
1726 | { | 1660 | { |
1727 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 1661 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
1728 | struct rtl_pci_priv *rtlpcipriv = rtl_pcipriv(hw); | 1662 | struct rtl_pci_priv *rtlpcipriv = rtl_pcipriv(hw); |
1663 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | ||
1664 | u8 tmp1byte = 0; | ||
1729 | 1665 | ||
1666 | if (IS_81xxC_VENDOR_UMC_B_CUT(rtlhal->version) && | ||
1667 | rtlpcipriv->bt_coexist.bt_coexistence) | ||
1668 | tmp1byte |= BIT(5); | ||
1730 | if (rtlpcipriv->bt_coexist.bt_cur_state) { | 1669 | if (rtlpcipriv->bt_coexist.bt_cur_state) { |
1731 | if (rtlpcipriv->bt_coexist.bt_ant_isolation) | 1670 | if (rtlpcipriv->bt_coexist.bt_ant_isolation) |
1732 | rtl92c_bt_ant_isolation(hw); | 1671 | rtl92c_bt_ant_isolation(hw, tmp1byte); |
1733 | } else { | 1672 | } else { |
1734 | rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, 0x00); | 1673 | rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG, tmp1byte); |
1735 | rtlpriv->cfg->ops->set_rfreg(hw, RF90_PATH_A, 0x1e, 0xf0, | 1674 | rtlpriv->cfg->ops->set_rfreg(hw, RF90_PATH_A, 0x1e, 0xf0, |
1736 | rtlpcipriv->bt_coexist.bt_rfreg_origin_1e); | 1675 | rtlpcipriv->bt_coexist.bt_rfreg_origin_1e); |
1737 | 1676 | ||
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c index 883f23ae9519..04a41628ceed 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | |||
@@ -552,7 +552,9 @@ void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode) | |||
552 | RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "FW LPS mode = %d\n", mode); | 552 | RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD, "FW LPS mode = %d\n", mode); |
553 | 553 | ||
554 | SET_H2CCMD_PWRMODE_PARM_MODE(u1_h2c_set_pwrmode, mode); | 554 | SET_H2CCMD_PWRMODE_PARM_MODE(u1_h2c_set_pwrmode, mode); |
555 | SET_H2CCMD_PWRMODE_PARM_SMART_PS(u1_h2c_set_pwrmode, 1); | 555 | SET_H2CCMD_PWRMODE_PARM_SMART_PS(u1_h2c_set_pwrmode, |
556 | (rtlpriv->mac80211.p2p) ? | ||
557 | ppsc->smart_ps : 1); | ||
556 | SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(u1_h2c_set_pwrmode, | 558 | SET_H2CCMD_PWRMODE_PARM_BCN_PASS_TIME(u1_h2c_set_pwrmode, |
557 | ppsc->reg_max_lps_awakeintvl); | 559 | ppsc->reg_max_lps_awakeintvl); |
558 | 560 | ||
@@ -808,3 +810,98 @@ void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus) | |||
808 | rtl92c_fill_h2c_cmd(hw, H2C_JOINBSSRPT, 1, u1_joinbssrpt_parm); | 810 | rtl92c_fill_h2c_cmd(hw, H2C_JOINBSSRPT, 1, u1_joinbssrpt_parm); |
809 | } | 811 | } |
810 | EXPORT_SYMBOL(rtl92c_set_fw_joinbss_report_cmd); | 812 | EXPORT_SYMBOL(rtl92c_set_fw_joinbss_report_cmd); |
813 | |||
814 | static void rtl92c_set_p2p_ctw_period_cmd(struct ieee80211_hw *hw, u8 ctwindow) | ||
815 | { | ||
816 | u8 u1_ctwindow_period[1] = {ctwindow}; | ||
817 | |||
818 | rtl92c_fill_h2c_cmd(hw, H2C_P2P_PS_CTW_CMD, 1, u1_ctwindow_period); | ||
819 | } | ||
820 | |||
821 | void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state) | ||
822 | { | ||
823 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
824 | struct rtl_ps_ctl *rtlps = rtl_psc(rtl_priv(hw)); | ||
825 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | ||
826 | struct rtl_p2p_ps_info *p2pinfo = &(rtlps->p2p_ps_info); | ||
827 | struct p2p_ps_offload_t *p2p_ps_offload = &rtlhal->p2p_ps_offload; | ||
828 | u8 i; | ||
829 | u16 ctwindow; | ||
830 | u32 start_time, tsf_low; | ||
831 | |||
832 | switch (p2p_ps_state) { | ||
833 | case P2P_PS_DISABLE: | ||
834 | RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_DISABLE\n"); | ||
835 | memset(p2p_ps_offload, 0, sizeof(struct p2p_ps_offload_t)); | ||
836 | break; | ||
837 | case P2P_PS_ENABLE: | ||
838 | RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_ENABLE\n"); | ||
839 | /* update CTWindow value. */ | ||
840 | if (p2pinfo->ctwindow > 0) { | ||
841 | p2p_ps_offload->ctwindow_en = 1; | ||
842 | ctwindow = p2pinfo->ctwindow; | ||
843 | rtl92c_set_p2p_ctw_period_cmd(hw, ctwindow); | ||
844 | } | ||
845 | /* hw only support 2 set of NoA */ | ||
846 | for (i = 0; i < p2pinfo->noa_num; i++) { | ||
847 | /* To control the register setting for which NOA*/ | ||
848 | rtl_write_byte(rtlpriv, 0x5cf, (i << 4)); | ||
849 | if (i == 0) | ||
850 | p2p_ps_offload->noa0_en = 1; | ||
851 | else | ||
852 | p2p_ps_offload->noa1_en = 1; | ||
853 | |||
854 | /* config P2P NoA Descriptor Register */ | ||
855 | rtl_write_dword(rtlpriv, 0x5E0, | ||
856 | p2pinfo->noa_duration[i]); | ||
857 | rtl_write_dword(rtlpriv, 0x5E4, | ||
858 | p2pinfo->noa_interval[i]); | ||
859 | |||
860 | /*Get Current TSF value */ | ||
861 | tsf_low = rtl_read_dword(rtlpriv, REG_TSFTR); | ||
862 | |||
863 | start_time = p2pinfo->noa_start_time[i]; | ||
864 | if (p2pinfo->noa_count_type[i] != 1) { | ||
865 | while (start_time <= (tsf_low+(50*1024))) { | ||
866 | start_time += p2pinfo->noa_interval[i]; | ||
867 | if (p2pinfo->noa_count_type[i] != 255) | ||
868 | p2pinfo->noa_count_type[i]--; | ||
869 | } | ||
870 | } | ||
871 | rtl_write_dword(rtlpriv, 0x5E8, start_time); | ||
872 | rtl_write_dword(rtlpriv, 0x5EC, | ||
873 | p2pinfo->noa_count_type[i]); | ||
874 | } | ||
875 | |||
876 | if ((p2pinfo->opp_ps == 1) || (p2pinfo->noa_num > 0)) { | ||
877 | /* rst p2p circuit */ | ||
878 | rtl_write_byte(rtlpriv, REG_DUAL_TSF_RST, BIT(4)); | ||
879 | |||
880 | p2p_ps_offload->offload_en = 1; | ||
881 | |||
882 | if (P2P_ROLE_GO == rtlpriv->mac80211.p2p) { | ||
883 | p2p_ps_offload->role = 1; | ||
884 | p2p_ps_offload->allstasleep = 0; | ||
885 | } else { | ||
886 | p2p_ps_offload->role = 0; | ||
887 | } | ||
888 | |||
889 | p2p_ps_offload->discovery = 0; | ||
890 | } | ||
891 | break; | ||
892 | case P2P_PS_SCAN: | ||
893 | RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_SCAN\n"); | ||
894 | p2p_ps_offload->discovery = 1; | ||
895 | break; | ||
896 | case P2P_PS_SCAN_DONE: | ||
897 | RT_TRACE(rtlpriv, COMP_FW, DBG_LOUD, "P2P_PS_SCAN_DONE\n"); | ||
898 | p2p_ps_offload->discovery = 0; | ||
899 | p2pinfo->p2p_ps_state = P2P_PS_ENABLE; | ||
900 | break; | ||
901 | default: | ||
902 | break; | ||
903 | } | ||
904 | |||
905 | rtl92c_fill_h2c_cmd(hw, H2C_P2P_PS_OFFLOAD, 1, (u8 *)p2p_ps_offload); | ||
906 | } | ||
907 | EXPORT_SYMBOL_GPL(rtl92c_set_p2p_ps_offload_cmd); | ||
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h index 780ea5b1e24c..15b2055e6212 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h +++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h | |||
@@ -67,6 +67,9 @@ enum rtl8192c_h2c_cmd { | |||
67 | H2C_RSVDPAGE = 3, | 67 | H2C_RSVDPAGE = 3, |
68 | H2C_RSSI_REPORT = 5, | 68 | H2C_RSSI_REPORT = 5, |
69 | H2C_RA_MASK = 6, | 69 | H2C_RA_MASK = 6, |
70 | H2C_MACID_PS_MODE = 7, | ||
71 | H2C_P2P_PS_OFFLOAD = 8, | ||
72 | H2C_P2P_PS_CTW_CMD = 32, | ||
70 | MAX_H2CCMD | 73 | MAX_H2CCMD |
71 | }; | 74 | }; |
72 | 75 | ||
@@ -95,5 +98,6 @@ void rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); | |||
95 | void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished); | 98 | void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished); |
96 | void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); | 99 | void rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); |
97 | void usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, void *data, u16 len); | 100 | void usb_writeN_async(struct rtl_priv *rtlpriv, u32 addr, void *data, u16 len); |
101 | void rtl92c_set_p2p_ps_offload_cmd(struct ieee80211_hw *hw, u8 p2p_ps_state); | ||
98 | 102 | ||
99 | #endif | 103 | #endif |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c index 1b65db7fd651..3da9a785ab62 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | |||
@@ -475,6 +475,9 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
475 | 475 | ||
476 | break; | 476 | break; |
477 | } | 477 | } |
478 | case HW_VAR_H2C_FW_P2P_PS_OFFLOAD: | ||
479 | rtl92c_set_p2p_ps_offload_cmd(hw, (*(u8 *)val)); | ||
480 | break; | ||
478 | case HW_VAR_AID:{ | 481 | case HW_VAR_AID:{ |
479 | u16 u2btmp; | 482 | u16 u2btmp; |
480 | u2btmp = rtl_read_word(rtlpriv, REG_BCN_PSR_RPT); | 483 | u2btmp = rtl_read_word(rtlpriv, REG_BCN_PSR_RPT); |
@@ -505,6 +508,40 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val) | |||
505 | break; | 508 | break; |
506 | 509 | ||
507 | } | 510 | } |
511 | case HW_VAR_FW_LPS_ACTION: { | ||
512 | bool enter_fwlps = *((bool *)val); | ||
513 | u8 rpwm_val, fw_pwrmode; | ||
514 | bool fw_current_inps; | ||
515 | |||
516 | if (enter_fwlps) { | ||
517 | rpwm_val = 0x02; /* RF off */ | ||
518 | fw_current_inps = true; | ||
519 | rtlpriv->cfg->ops->set_hw_reg(hw, | ||
520 | HW_VAR_FW_PSMODE_STATUS, | ||
521 | (u8 *)(&fw_current_inps)); | ||
522 | rtlpriv->cfg->ops->set_hw_reg(hw, | ||
523 | HW_VAR_H2C_FW_PWRMODE, | ||
524 | (u8 *)(&ppsc->fwctrl_psmode)); | ||
525 | |||
526 | rtlpriv->cfg->ops->set_hw_reg(hw, | ||
527 | HW_VAR_SET_RPWM, | ||
528 | (u8 *)(&rpwm_val)); | ||
529 | } else { | ||
530 | rpwm_val = 0x0C; /* RF on */ | ||
531 | fw_pwrmode = FW_PS_ACTIVE_MODE; | ||
532 | fw_current_inps = false; | ||
533 | rtlpriv->cfg->ops->set_hw_reg(hw, | ||
534 | HW_VAR_SET_RPWM, | ||
535 | (u8 *)(&rpwm_val)); | ||
536 | rtlpriv->cfg->ops->set_hw_reg(hw, | ||
537 | HW_VAR_H2C_FW_PWRMODE, | ||
538 | (u8 *)(&fw_pwrmode)); | ||
539 | |||
540 | rtlpriv->cfg->ops->set_hw_reg(hw, | ||
541 | HW_VAR_FW_PSMODE_STATUS, | ||
542 | (u8 *)(&fw_current_inps)); | ||
543 | } | ||
544 | break; } | ||
508 | default: | 545 | default: |
509 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 546 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
510 | "switch case not processed\n"); | 547 | "switch case not processed\n"); |
@@ -1105,7 +1142,8 @@ static int _rtl92ce_set_media_status(struct ieee80211_hw *hw, | |||
1105 | type == NL80211_IFTYPE_STATION) { | 1142 | type == NL80211_IFTYPE_STATION) { |
1106 | _rtl92ce_stop_tx_beacon(hw); | 1143 | _rtl92ce_stop_tx_beacon(hw); |
1107 | _rtl92ce_enable_bcn_sub_func(hw); | 1144 | _rtl92ce_enable_bcn_sub_func(hw); |
1108 | } else if (type == NL80211_IFTYPE_ADHOC || type == NL80211_IFTYPE_AP) { | 1145 | } else if (type == NL80211_IFTYPE_ADHOC || type == NL80211_IFTYPE_AP || |
1146 | type == NL80211_IFTYPE_MESH_POINT) { | ||
1109 | _rtl92ce_resume_tx_beacon(hw); | 1147 | _rtl92ce_resume_tx_beacon(hw); |
1110 | _rtl92ce_disable_bcn_sub_func(hw); | 1148 | _rtl92ce_disable_bcn_sub_func(hw); |
1111 | } else { | 1149 | } else { |
@@ -1137,6 +1175,11 @@ static int _rtl92ce_set_media_status(struct ieee80211_hw *hw, | |||
1137 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, | 1175 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, |
1138 | "Set Network type to AP!\n"); | 1176 | "Set Network type to AP!\n"); |
1139 | break; | 1177 | break; |
1178 | case NL80211_IFTYPE_MESH_POINT: | ||
1179 | bt_msr |= MSR_ADHOC; | ||
1180 | RT_TRACE(rtlpriv, COMP_INIT, DBG_TRACE, | ||
1181 | "Set Network type to Mesh Point!\n"); | ||
1182 | break; | ||
1140 | default: | 1183 | default: |
1141 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1184 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
1142 | "Network type %d not supported!\n", type); | 1185 | "Network type %d not supported!\n", type); |
@@ -1184,7 +1227,8 @@ int rtl92ce_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type) | |||
1184 | return -EOPNOTSUPP; | 1227 | return -EOPNOTSUPP; |
1185 | 1228 | ||
1186 | if (rtlpriv->mac80211.link_state == MAC80211_LINKED) { | 1229 | if (rtlpriv->mac80211.link_state == MAC80211_LINKED) { |
1187 | if (type != NL80211_IFTYPE_AP) | 1230 | if (type != NL80211_IFTYPE_AP && |
1231 | type != NL80211_IFTYPE_MESH_POINT) | ||
1188 | rtl92ce_set_check_bssid(hw, true); | 1232 | rtl92ce_set_check_bssid(hw, true); |
1189 | } else { | 1233 | } else { |
1190 | rtl92ce_set_check_bssid(hw, false); | 1234 | rtl92ce_set_check_bssid(hw, false); |
@@ -1629,6 +1673,21 @@ static void _rtl92ce_read_adapter_info(struct ieee80211_hw *hw) | |||
1629 | if (rtlefuse->autoload_failflag) | 1673 | if (rtlefuse->autoload_failflag) |
1630 | return; | 1674 | return; |
1631 | 1675 | ||
1676 | rtlefuse->eeprom_vid = *(u16 *)&hwinfo[EEPROM_VID]; | ||
1677 | rtlefuse->eeprom_did = *(u16 *)&hwinfo[EEPROM_DID]; | ||
1678 | rtlefuse->eeprom_svid = *(u16 *)&hwinfo[EEPROM_SVID]; | ||
1679 | rtlefuse->eeprom_smid = *(u16 *)&hwinfo[EEPROM_SMID]; | ||
1680 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | ||
1681 | "EEPROMId = 0x%4x\n", eeprom_id); | ||
1682 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | ||
1683 | "EEPROM VID = 0x%4x\n", rtlefuse->eeprom_vid); | ||
1684 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | ||
1685 | "EEPROM DID = 0x%4x\n", rtlefuse->eeprom_did); | ||
1686 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | ||
1687 | "EEPROM SVID = 0x%4x\n", rtlefuse->eeprom_svid); | ||
1688 | RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, | ||
1689 | "EEPROM SMID = 0x%4x\n", rtlefuse->eeprom_smid); | ||
1690 | |||
1632 | for (i = 0; i < 6; i += 2) { | 1691 | for (i = 0; i < 6; i += 2) { |
1633 | usvalue = *(u16 *)&hwinfo[EEPROM_MAC_ADDR + i]; | 1692 | usvalue = *(u16 *)&hwinfo[EEPROM_MAC_ADDR + i]; |
1634 | *((u16 *) (&rtlefuse->dev_addr[i])) = usvalue; | 1693 | *((u16 *) (&rtlefuse->dev_addr[i])) = usvalue; |
@@ -1766,6 +1825,9 @@ static void rtl92ce_update_hal_rate_table(struct ieee80211_hw *hw, | |||
1766 | ratr_value = sta->supp_rates[1] << 4; | 1825 | ratr_value = sta->supp_rates[1] << 4; |
1767 | else | 1826 | else |
1768 | ratr_value = sta->supp_rates[0]; | 1827 | ratr_value = sta->supp_rates[0]; |
1828 | if (mac->opmode == NL80211_IFTYPE_ADHOC) | ||
1829 | ratr_value = 0xfff; | ||
1830 | |||
1769 | ratr_value |= (sta->ht_cap.mcs.rx_mask[1] << 20 | | 1831 | ratr_value |= (sta->ht_cap.mcs.rx_mask[1] << 20 | |
1770 | sta->ht_cap.mcs.rx_mask[0] << 12); | 1832 | sta->ht_cap.mcs.rx_mask[0] << 12); |
1771 | switch (wirelessmode) { | 1833 | switch (wirelessmode) { |
@@ -1860,7 +1922,8 @@ static void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, | |||
1860 | 1922 | ||
1861 | sta_entry = (struct rtl_sta_info *) sta->drv_priv; | 1923 | sta_entry = (struct rtl_sta_info *) sta->drv_priv; |
1862 | wirelessmode = sta_entry->wireless_mode; | 1924 | wirelessmode = sta_entry->wireless_mode; |
1863 | if (mac->opmode == NL80211_IFTYPE_STATION) | 1925 | if (mac->opmode == NL80211_IFTYPE_STATION || |
1926 | mac->opmode == NL80211_IFTYPE_MESH_POINT) | ||
1864 | curtxbw_40mhz = mac->bw_40; | 1927 | curtxbw_40mhz = mac->bw_40; |
1865 | else if (mac->opmode == NL80211_IFTYPE_AP || | 1928 | else if (mac->opmode == NL80211_IFTYPE_AP || |
1866 | mac->opmode == NL80211_IFTYPE_ADHOC) | 1929 | mac->opmode == NL80211_IFTYPE_ADHOC) |
@@ -1870,6 +1933,8 @@ static void rtl92ce_update_hal_rate_mask(struct ieee80211_hw *hw, | |||
1870 | ratr_bitmap = sta->supp_rates[1] << 4; | 1933 | ratr_bitmap = sta->supp_rates[1] << 4; |
1871 | else | 1934 | else |
1872 | ratr_bitmap = sta->supp_rates[0]; | 1935 | ratr_bitmap = sta->supp_rates[0]; |
1936 | if (mac->opmode == NL80211_IFTYPE_ADHOC) | ||
1937 | ratr_bitmap = 0xfff; | ||
1873 | ratr_bitmap |= (sta->ht_cap.mcs.rx_mask[1] << 20 | | 1938 | ratr_bitmap |= (sta->ht_cap.mcs.rx_mask[1] << 20 | |
1874 | sta->ht_cap.mcs.rx_mask[0] << 12); | 1939 | sta->ht_cap.mcs.rx_mask[0] << 12); |
1875 | switch (wirelessmode) { | 1940 | switch (wirelessmode) { |
@@ -2135,7 +2200,8 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index, | |||
2135 | macaddr = cam_const_broad; | 2200 | macaddr = cam_const_broad; |
2136 | entry_id = key_index; | 2201 | entry_id = key_index; |
2137 | } else { | 2202 | } else { |
2138 | if (mac->opmode == NL80211_IFTYPE_AP) { | 2203 | if (mac->opmode == NL80211_IFTYPE_AP || |
2204 | mac->opmode == NL80211_IFTYPE_MESH_POINT) { | ||
2139 | entry_id = rtl_cam_get_free_entry(hw, | 2205 | entry_id = rtl_cam_get_free_entry(hw, |
2140 | p_macaddr); | 2206 | p_macaddr); |
2141 | if (entry_id >= TOTAL_CAM_ENTRY) { | 2207 | if (entry_id >= TOTAL_CAM_ENTRY) { |
@@ -2157,7 +2223,8 @@ void rtl92ce_set_key(struct ieee80211_hw *hw, u32 key_index, | |||
2157 | RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, | 2223 | RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG, |
2158 | "delete one entry, entry_id is %d\n", | 2224 | "delete one entry, entry_id is %d\n", |
2159 | entry_id); | 2225 | entry_id); |
2160 | if (mac->opmode == NL80211_IFTYPE_AP) | 2226 | if (mac->opmode == NL80211_IFTYPE_AP || |
2227 | mac->opmode == NL80211_IFTYPE_MESH_POINT) | ||
2161 | rtl_cam_del_entry(hw, p_macaddr); | 2228 | rtl_cam_del_entry(hw, p_macaddr); |
2162 | rtl_cam_delete_one_entry(hw, p_macaddr, entry_id); | 2229 | rtl_cam_delete_one_entry(hw, p_macaddr, entry_id); |
2163 | } else { | 2230 | } else { |
@@ -2338,3 +2405,24 @@ void rtl92ce_suspend(struct ieee80211_hw *hw) | |||
2338 | void rtl92ce_resume(struct ieee80211_hw *hw) | 2405 | void rtl92ce_resume(struct ieee80211_hw *hw) |
2339 | { | 2406 | { |
2340 | } | 2407 | } |
2408 | |||
2409 | /* Turn on AAP (RCR:bit 0) for promicuous mode. */ | ||
2410 | void rtl92ce_allow_all_destaddr(struct ieee80211_hw *hw, | ||
2411 | bool allow_all_da, bool write_into_reg) | ||
2412 | { | ||
2413 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
2414 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | ||
2415 | |||
2416 | if (allow_all_da) {/* Set BIT0 */ | ||
2417 | rtlpci->receive_config |= RCR_AAP; | ||
2418 | } else {/* Clear BIT0 */ | ||
2419 | rtlpci->receive_config &= ~RCR_AAP; | ||
2420 | } | ||
2421 | |||
2422 | if (write_into_reg) | ||
2423 | rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config); | ||
2424 | |||
2425 | RT_TRACE(rtlpriv, COMP_TURBO | COMP_INIT, DBG_LOUD, | ||
2426 | "receive_config=0x%08X, write_into_reg=%d\n", | ||
2427 | rtlpci->receive_config, write_into_reg); | ||
2428 | } | ||
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.h b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.h index 52a3aea9b3de..2d063b0c7760 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.h +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.h | |||
@@ -61,6 +61,8 @@ void rtl92ce_update_interrupt_mask(struct ieee80211_hw *hw, | |||
61 | void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); | 61 | void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); |
62 | void rtl92ce_update_hal_rate_tbl(struct ieee80211_hw *hw, | 62 | void rtl92ce_update_hal_rate_tbl(struct ieee80211_hw *hw, |
63 | struct ieee80211_sta *sta, u8 rssi_level); | 63 | struct ieee80211_sta *sta, u8 rssi_level); |
64 | void rtl92ce_update_hal_rate_tbl(struct ieee80211_hw *hw, | ||
65 | struct ieee80211_sta *sta, u8 rssi_level); | ||
64 | void rtl92ce_update_channel_access_setting(struct ieee80211_hw *hw); | 66 | void rtl92ce_update_channel_access_setting(struct ieee80211_hw *hw); |
65 | bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); | 67 | bool rtl92ce_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 *valid); |
66 | void rtl92ce_enable_hw_security_config(struct ieee80211_hw *hw); | 68 | void rtl92ce_enable_hw_security_config(struct ieee80211_hw *hw); |
@@ -74,5 +76,7 @@ void rtl8192ce_bt_reg_init(struct ieee80211_hw *hw); | |||
74 | void rtl8192ce_bt_hw_init(struct ieee80211_hw *hw); | 76 | void rtl8192ce_bt_hw_init(struct ieee80211_hw *hw); |
75 | void rtl92ce_suspend(struct ieee80211_hw *hw); | 77 | void rtl92ce_suspend(struct ieee80211_hw *hw); |
76 | void rtl92ce_resume(struct ieee80211_hw *hw); | 78 | void rtl92ce_resume(struct ieee80211_hw *hw); |
79 | void rtl92ce_allow_all_destaddr(struct ieee80211_hw *hw, | ||
80 | bool allow_all_da, bool write_into_reg); | ||
77 | 81 | ||
78 | #endif | 82 | #endif |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/reg.h b/drivers/net/wireless/rtlwifi/rtl8192ce/reg.h index e4d738f6166d..bd4aef74c056 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/reg.h +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/reg.h | |||
@@ -544,6 +544,7 @@ | |||
544 | #define IMR_WLANOFF BIT(0) | 544 | #define IMR_WLANOFF BIT(0) |
545 | 545 | ||
546 | #define EFUSE_REAL_CONTENT_LEN 512 | 546 | #define EFUSE_REAL_CONTENT_LEN 512 |
547 | #define EFUSE_OOB_PROTECT_BYTES 15 | ||
547 | 548 | ||
548 | #define EEPROM_DEFAULT_TSSI 0x0 | 549 | #define EEPROM_DEFAULT_TSSI 0x0 |
549 | #define EEPROM_DEFAULT_TXPOWERDIFF 0x0 | 550 | #define EEPROM_DEFAULT_TXPOWERDIFF 0x0 |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c index 49f663bd93ff..7347f5931319 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | |||
@@ -228,6 +228,7 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = { | |||
228 | .enable_hw_sec = rtl92ce_enable_hw_security_config, | 228 | .enable_hw_sec = rtl92ce_enable_hw_security_config, |
229 | .set_key = rtl92ce_set_key, | 229 | .set_key = rtl92ce_set_key, |
230 | .init_sw_leds = rtl92ce_init_sw_leds, | 230 | .init_sw_leds = rtl92ce_init_sw_leds, |
231 | .allow_all_destaddr = rtl92ce_allow_all_destaddr, | ||
231 | .get_bbreg = rtl92c_phy_query_bb_reg, | 232 | .get_bbreg = rtl92c_phy_query_bb_reg, |
232 | .set_bbreg = rtl92c_phy_set_bb_reg, | 233 | .set_bbreg = rtl92c_phy_set_bb_reg, |
233 | .set_rfreg = rtl92ce_phy_set_rf_reg, | 234 | .set_rfreg = rtl92ce_phy_set_rf_reg, |
@@ -278,6 +279,7 @@ static struct rtl_hal_cfg rtl92ce_hal_cfg = { | |||
278 | .maps[EFUSE_HWSET_MAX_SIZE] = HWSET_MAX_SIZE, | 279 | .maps[EFUSE_HWSET_MAX_SIZE] = HWSET_MAX_SIZE, |
279 | .maps[EFUSE_MAX_SECTION_MAP] = EFUSE_MAX_SECTION, | 280 | .maps[EFUSE_MAX_SECTION_MAP] = EFUSE_MAX_SECTION, |
280 | .maps[EFUSE_REAL_CONTENT_SIZE] = EFUSE_REAL_CONTENT_LEN, | 281 | .maps[EFUSE_REAL_CONTENT_SIZE] = EFUSE_REAL_CONTENT_LEN, |
282 | .maps[EFUSE_OOB_PROTECT_BYTES_LEN] = EFUSE_OOB_PROTECT_BYTES, | ||
281 | 283 | ||
282 | .maps[RWCAM] = REG_CAMCMD, | 284 | .maps[RWCAM] = REG_CAMCMD, |
283 | .maps[WCAMI] = REG_CAMWRITE, | 285 | .maps[WCAMI] = REG_CAMWRITE, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c index b9b1a6e0b16e..65bf5fb97002 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "../wifi.h" | 30 | #include "../wifi.h" |
31 | #include "../pci.h" | 31 | #include "../pci.h" |
32 | #include "../base.h" | 32 | #include "../base.h" |
33 | #include "../stats.h" | ||
33 | #include "reg.h" | 34 | #include "reg.h" |
34 | #include "def.h" | 35 | #include "def.h" |
35 | #include "phy.h" | 36 | #include "phy.h" |
@@ -42,7 +43,7 @@ static u8 _rtl92ce_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue) | |||
42 | 43 | ||
43 | if (unlikely(ieee80211_is_beacon(fc))) | 44 | if (unlikely(ieee80211_is_beacon(fc))) |
44 | return QSLT_BEACON; | 45 | return QSLT_BEACON; |
45 | if (ieee80211_is_mgmt(fc)) | 46 | if (ieee80211_is_mgmt(fc) || ieee80211_is_ctl(fc)) |
46 | return QSLT_MGNT; | 47 | return QSLT_MGNT; |
47 | 48 | ||
48 | return skb->priority; | 49 | return skb->priority; |
@@ -78,16 +79,6 @@ static u8 _rtl92c_evm_db_to_percentage(char value) | |||
78 | return ret_val; | 79 | return ret_val; |
79 | } | 80 | } |
80 | 81 | ||
81 | static long _rtl92ce_translate_todbm(struct ieee80211_hw *hw, | ||
82 | u8 signal_strength_index) | ||
83 | { | ||
84 | long signal_power; | ||
85 | |||
86 | signal_power = (long)((signal_strength_index + 1) >> 1); | ||
87 | signal_power -= 95; | ||
88 | return signal_power; | ||
89 | } | ||
90 | |||
91 | static long _rtl92ce_signal_scale_mapping(struct ieee80211_hw *hw, | 82 | static long _rtl92ce_signal_scale_mapping(struct ieee80211_hw *hw, |
92 | long currsig) | 83 | long currsig) |
93 | { | 84 | { |
@@ -139,7 +130,6 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, | |||
139 | pstats->packet_toself = packet_toself; | 130 | pstats->packet_toself = packet_toself; |
140 | pstats->is_cck = is_cck_rate; | 131 | pstats->is_cck = is_cck_rate; |
141 | pstats->packet_beacon = packet_beacon; | 132 | pstats->packet_beacon = packet_beacon; |
142 | pstats->is_cck = is_cck_rate; | ||
143 | pstats->rx_mimo_sig_qual[0] = -1; | 133 | pstats->rx_mimo_sig_qual[0] = -1; |
144 | pstats->rx_mimo_sig_qual[1] = -1; | 134 | pstats->rx_mimo_sig_qual[1] = -1; |
145 | 135 | ||
@@ -192,10 +182,30 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, | |||
192 | } | 182 | } |
193 | } | 183 | } |
194 | 184 | ||
195 | pwdb_all = _rtl92c_query_rxpwrpercentage(rx_pwr_all); | 185 | pwdb_all = rtl_query_rxpwrpercentage(rx_pwr_all); |
186 | /* CCK gain is smaller than OFDM/MCS gain, | ||
187 | * so we add gain diff by experiences, | ||
188 | * the val is 6 | ||
189 | */ | ||
190 | pwdb_all += 6; | ||
191 | if (pwdb_all > 100) | ||
192 | pwdb_all = 100; | ||
193 | /* modify the offset to make the same | ||
194 | * gain index with OFDM. | ||
195 | */ | ||
196 | if (pwdb_all > 34 && pwdb_all <= 42) | ||
197 | pwdb_all -= 2; | ||
198 | else if (pwdb_all > 26 && pwdb_all <= 34) | ||
199 | pwdb_all -= 6; | ||
200 | else if (pwdb_all > 14 && pwdb_all <= 26) | ||
201 | pwdb_all -= 8; | ||
202 | else if (pwdb_all > 4 && pwdb_all <= 14) | ||
203 | pwdb_all -= 4; | ||
204 | |||
196 | pstats->rx_pwdb_all = pwdb_all; | 205 | pstats->rx_pwdb_all = pwdb_all; |
197 | pstats->recvsignalpower = rx_pwr_all; | 206 | pstats->recvsignalpower = rx_pwr_all; |
198 | 207 | ||
208 | /* (3) Get Signal Quality (EVM) */ | ||
199 | if (packet_match_bssid) { | 209 | if (packet_match_bssid) { |
200 | u8 sq; | 210 | u8 sq; |
201 | if (pstats->rx_pwdb_all > 40) | 211 | if (pstats->rx_pwdb_all > 40) |
@@ -217,29 +227,38 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, | |||
217 | } else { | 227 | } else { |
218 | rtlpriv->dm.rfpath_rxenable[0] = | 228 | rtlpriv->dm.rfpath_rxenable[0] = |
219 | rtlpriv->dm.rfpath_rxenable[1] = true; | 229 | rtlpriv->dm.rfpath_rxenable[1] = true; |
230 | /* (1)Get RSSI for HT rate */ | ||
220 | for (i = RF90_PATH_A; i < RF90_PATH_MAX; i++) { | 231 | for (i = RF90_PATH_A; i < RF90_PATH_MAX; i++) { |
232 | /* we will judge RF RX path now. */ | ||
221 | if (rtlpriv->dm.rfpath_rxenable[i]) | 233 | if (rtlpriv->dm.rfpath_rxenable[i]) |
222 | rf_rx_num++; | 234 | rf_rx_num++; |
223 | 235 | ||
224 | rx_pwr[i] = | 236 | rx_pwr[i] = |
225 | ((p_drvinfo->gain_trsw[i] & 0x3f) * 2) - 110; | 237 | ((p_drvinfo->gain_trsw[i] & 0x3f) * 2) - 110; |
238 | /* Translate DBM to percentage. */ | ||
226 | rssi = _rtl92c_query_rxpwrpercentage(rx_pwr[i]); | 239 | rssi = _rtl92c_query_rxpwrpercentage(rx_pwr[i]); |
227 | total_rssi += rssi; | 240 | total_rssi += rssi; |
241 | /* Get Rx snr value in DB */ | ||
228 | rtlpriv->stats.rx_snr_db[i] = | 242 | rtlpriv->stats.rx_snr_db[i] = |
229 | (long)(p_drvinfo->rxsnr[i] / 2); | 243 | (long)(p_drvinfo->rxsnr[i] / 2); |
230 | 244 | ||
245 | /* Record Signal Strength for next packet */ | ||
231 | if (packet_match_bssid) | 246 | if (packet_match_bssid) |
232 | pstats->rx_mimo_signalstrength[i] = (u8) rssi; | 247 | pstats->rx_mimo_signalstrength[i] = (u8) rssi; |
233 | } | 248 | } |
234 | 249 | ||
250 | /* (2)PWDB, Average PWDB cacluated by | ||
251 | * hardware (for rate adaptive) | ||
252 | */ | ||
235 | rx_pwr_all = ((p_drvinfo->pwdb_all >> 1) & 0x7f) - 110; | 253 | rx_pwr_all = ((p_drvinfo->pwdb_all >> 1) & 0x7f) - 110; |
236 | pwdb_all = _rtl92c_query_rxpwrpercentage(rx_pwr_all); | 254 | pwdb_all = _rtl92c_query_rxpwrpercentage(rx_pwr_all); |
237 | pstats->rx_pwdb_all = pwdb_all; | 255 | pstats->rx_pwdb_all = pwdb_all; |
238 | pstats->rxpower = rx_pwr_all; | 256 | pstats->rxpower = rx_pwr_all; |
239 | pstats->recvsignalpower = rx_pwr_all; | 257 | pstats->recvsignalpower = rx_pwr_all; |
240 | 258 | ||
241 | if (pdesc->rxht && pdesc->rxmcs >= DESC92_RATEMCS8 && | 259 | /* (3)EVM of HT rate */ |
242 | pdesc->rxmcs <= DESC92_RATEMCS15) | 260 | if (pstats->is_ht && pstats->rate >= DESC92_RATEMCS8 && |
261 | pstats->rate <= DESC92_RATEMCS15) | ||
243 | max_spatial_stream = 2; | 262 | max_spatial_stream = 2; |
244 | else | 263 | else |
245 | max_spatial_stream = 1; | 264 | max_spatial_stream = 1; |
@@ -248,6 +267,9 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, | |||
248 | evm = _rtl92c_evm_db_to_percentage(p_drvinfo->rxevm[i]); | 267 | evm = _rtl92c_evm_db_to_percentage(p_drvinfo->rxevm[i]); |
249 | 268 | ||
250 | if (packet_match_bssid) { | 269 | if (packet_match_bssid) { |
270 | /* Fill value in RFD, Get the first | ||
271 | * spatial stream only | ||
272 | */ | ||
251 | if (i == 0) | 273 | if (i == 0) |
252 | pstats->signalquality = | 274 | pstats->signalquality = |
253 | (u8) (evm & 0xff); | 275 | (u8) (evm & 0xff); |
@@ -256,6 +278,9 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, | |||
256 | } | 278 | } |
257 | } | 279 | } |
258 | 280 | ||
281 | /* UI BSS List signal strength(in percentage), | ||
282 | * make it good looking, from 0~100. | ||
283 | */ | ||
259 | if (is_cck_rate) | 284 | if (is_cck_rate) |
260 | pstats->signalstrength = | 285 | pstats->signalstrength = |
261 | (u8) (_rtl92ce_signal_scale_mapping(hw, pwdb_all)); | 286 | (u8) (_rtl92ce_signal_scale_mapping(hw, pwdb_all)); |
@@ -265,215 +290,6 @@ static void _rtl92ce_query_rxphystatus(struct ieee80211_hw *hw, | |||
265 | (hw, total_rssi /= rf_rx_num)); | 290 | (hw, total_rssi /= rf_rx_num)); |
266 | } | 291 | } |
267 | 292 | ||
268 | static void _rtl92ce_process_ui_rssi(struct ieee80211_hw *hw, | ||
269 | struct rtl_stats *pstats) | ||
270 | { | ||
271 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
272 | struct rtl_phy *rtlphy = &(rtlpriv->phy); | ||
273 | u8 rfpath; | ||
274 | u32 last_rssi, tmpval; | ||
275 | |||
276 | if (pstats->packet_toself || pstats->packet_beacon) { | ||
277 | rtlpriv->stats.rssi_calculate_cnt++; | ||
278 | |||
279 | if (rtlpriv->stats.ui_rssi.total_num++ >= | ||
280 | PHY_RSSI_SLID_WIN_MAX) { | ||
281 | |||
282 | rtlpriv->stats.ui_rssi.total_num = | ||
283 | PHY_RSSI_SLID_WIN_MAX; | ||
284 | last_rssi = | ||
285 | rtlpriv->stats.ui_rssi.elements[rtlpriv-> | ||
286 | stats.ui_rssi.index]; | ||
287 | rtlpriv->stats.ui_rssi.total_val -= last_rssi; | ||
288 | } | ||
289 | |||
290 | rtlpriv->stats.ui_rssi.total_val += pstats->signalstrength; | ||
291 | rtlpriv->stats.ui_rssi.elements[rtlpriv->stats.ui_rssi. | ||
292 | index++] = | ||
293 | pstats->signalstrength; | ||
294 | |||
295 | if (rtlpriv->stats.ui_rssi.index >= PHY_RSSI_SLID_WIN_MAX) | ||
296 | rtlpriv->stats.ui_rssi.index = 0; | ||
297 | |||
298 | tmpval = rtlpriv->stats.ui_rssi.total_val / | ||
299 | rtlpriv->stats.ui_rssi.total_num; | ||
300 | rtlpriv->stats.signal_strength = | ||
301 | _rtl92ce_translate_todbm(hw, (u8) tmpval); | ||
302 | pstats->rssi = rtlpriv->stats.signal_strength; | ||
303 | } | ||
304 | |||
305 | if (!pstats->is_cck && pstats->packet_toself) { | ||
306 | for (rfpath = RF90_PATH_A; rfpath < rtlphy->num_total_rfpath; | ||
307 | rfpath++) { | ||
308 | if (rtlpriv->stats.rx_rssi_percentage[rfpath] == 0) { | ||
309 | rtlpriv->stats.rx_rssi_percentage[rfpath] = | ||
310 | pstats->rx_mimo_signalstrength[rfpath]; | ||
311 | |||
312 | } | ||
313 | |||
314 | if (pstats->rx_mimo_signalstrength[rfpath] > | ||
315 | rtlpriv->stats.rx_rssi_percentage[rfpath]) { | ||
316 | rtlpriv->stats.rx_rssi_percentage[rfpath] = | ||
317 | ((rtlpriv->stats. | ||
318 | rx_rssi_percentage[rfpath] * | ||
319 | (RX_SMOOTH_FACTOR - 1)) + | ||
320 | (pstats->rx_mimo_signalstrength[rfpath])) / | ||
321 | (RX_SMOOTH_FACTOR); | ||
322 | |||
323 | rtlpriv->stats.rx_rssi_percentage[rfpath] = | ||
324 | rtlpriv->stats.rx_rssi_percentage[rfpath] + | ||
325 | 1; | ||
326 | } else { | ||
327 | rtlpriv->stats.rx_rssi_percentage[rfpath] = | ||
328 | ((rtlpriv->stats. | ||
329 | rx_rssi_percentage[rfpath] * | ||
330 | (RX_SMOOTH_FACTOR - 1)) + | ||
331 | (pstats->rx_mimo_signalstrength[rfpath])) / | ||
332 | (RX_SMOOTH_FACTOR); | ||
333 | } | ||
334 | |||
335 | } | ||
336 | } | ||
337 | } | ||
338 | |||
339 | static void _rtl92ce_update_rxsignalstatistics(struct ieee80211_hw *hw, | ||
340 | struct rtl_stats *pstats) | ||
341 | { | ||
342 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
343 | int weighting = 0; | ||
344 | |||
345 | if (rtlpriv->stats.recv_signal_power == 0) | ||
346 | rtlpriv->stats.recv_signal_power = pstats->recvsignalpower; | ||
347 | |||
348 | if (pstats->recvsignalpower > rtlpriv->stats.recv_signal_power) | ||
349 | weighting = 5; | ||
350 | |||
351 | else if (pstats->recvsignalpower < rtlpriv->stats.recv_signal_power) | ||
352 | weighting = (-5); | ||
353 | |||
354 | rtlpriv->stats.recv_signal_power = | ||
355 | (rtlpriv->stats.recv_signal_power * 5 + | ||
356 | pstats->recvsignalpower + weighting) / 6; | ||
357 | } | ||
358 | |||
359 | static void _rtl92ce_process_pwdb(struct ieee80211_hw *hw, | ||
360 | struct rtl_stats *pstats) | ||
361 | { | ||
362 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
363 | struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); | ||
364 | long undec_sm_pwdb; | ||
365 | |||
366 | if (mac->opmode == NL80211_IFTYPE_ADHOC) { | ||
367 | return; | ||
368 | } else { | ||
369 | undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb; | ||
370 | } | ||
371 | |||
372 | if (pstats->packet_toself || pstats->packet_beacon) { | ||
373 | if (undec_sm_pwdb < 0) | ||
374 | undec_sm_pwdb = pstats->rx_pwdb_all; | ||
375 | |||
376 | if (pstats->rx_pwdb_all > (u32) undec_sm_pwdb) { | ||
377 | undec_sm_pwdb = (((undec_sm_pwdb) * | ||
378 | (RX_SMOOTH_FACTOR - 1)) + | ||
379 | (pstats->rx_pwdb_all)) / (RX_SMOOTH_FACTOR); | ||
380 | |||
381 | undec_sm_pwdb += 1; | ||
382 | } else { | ||
383 | undec_sm_pwdb = (((undec_sm_pwdb) * | ||
384 | (RX_SMOOTH_FACTOR - 1)) + | ||
385 | (pstats->rx_pwdb_all)) / (RX_SMOOTH_FACTOR); | ||
386 | } | ||
387 | |||
388 | rtlpriv->dm.undec_sm_pwdb = undec_sm_pwdb; | ||
389 | _rtl92ce_update_rxsignalstatistics(hw, pstats); | ||
390 | } | ||
391 | } | ||
392 | |||
393 | static void _rtl92ce_process_ui_link_quality(struct ieee80211_hw *hw, | ||
394 | struct rtl_stats *pstats) | ||
395 | { | ||
396 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
397 | u32 last_evm, n_spatialstream, tmpval; | ||
398 | |||
399 | if (pstats->signalquality != 0) { | ||
400 | if (pstats->packet_toself || pstats->packet_beacon) { | ||
401 | |||
402 | if (rtlpriv->stats.ui_link_quality.total_num++ >= | ||
403 | PHY_LINKQUALITY_SLID_WIN_MAX) { | ||
404 | rtlpriv->stats.ui_link_quality.total_num = | ||
405 | PHY_LINKQUALITY_SLID_WIN_MAX; | ||
406 | last_evm = | ||
407 | rtlpriv->stats. | ||
408 | ui_link_quality.elements[rtlpriv-> | ||
409 | stats.ui_link_quality. | ||
410 | index]; | ||
411 | rtlpriv->stats.ui_link_quality.total_val -= | ||
412 | last_evm; | ||
413 | } | ||
414 | |||
415 | rtlpriv->stats.ui_link_quality.total_val += | ||
416 | pstats->signalquality; | ||
417 | rtlpriv->stats.ui_link_quality.elements[rtlpriv->stats. | ||
418 | ui_link_quality. | ||
419 | index++] = | ||
420 | pstats->signalquality; | ||
421 | |||
422 | if (rtlpriv->stats.ui_link_quality.index >= | ||
423 | PHY_LINKQUALITY_SLID_WIN_MAX) | ||
424 | rtlpriv->stats.ui_link_quality.index = 0; | ||
425 | |||
426 | tmpval = rtlpriv->stats.ui_link_quality.total_val / | ||
427 | rtlpriv->stats.ui_link_quality.total_num; | ||
428 | rtlpriv->stats.signal_quality = tmpval; | ||
429 | |||
430 | rtlpriv->stats.last_sigstrength_inpercent = tmpval; | ||
431 | |||
432 | for (n_spatialstream = 0; n_spatialstream < 2; | ||
433 | n_spatialstream++) { | ||
434 | if (pstats-> | ||
435 | rx_mimo_sig_qual[n_spatialstream] != -1) { | ||
436 | if (rtlpriv->stats. | ||
437 | rx_evm_percentage[n_spatialstream] | ||
438 | == 0) { | ||
439 | rtlpriv->stats. | ||
440 | rx_evm_percentage | ||
441 | [n_spatialstream] = | ||
442 | pstats->rx_mimo_sig_qual | ||
443 | [n_spatialstream]; | ||
444 | } | ||
445 | |||
446 | rtlpriv->stats. | ||
447 | rx_evm_percentage[n_spatialstream] = | ||
448 | ((rtlpriv-> | ||
449 | stats.rx_evm_percentage | ||
450 | [n_spatialstream] * | ||
451 | (RX_SMOOTH_FACTOR - 1)) + | ||
452 | (pstats->rx_mimo_sig_qual | ||
453 | [n_spatialstream] * 1)) / | ||
454 | (RX_SMOOTH_FACTOR); | ||
455 | } | ||
456 | } | ||
457 | } | ||
458 | } else { | ||
459 | ; | ||
460 | } | ||
461 | } | ||
462 | |||
463 | static void _rtl92ce_process_phyinfo(struct ieee80211_hw *hw, | ||
464 | u8 *buffer, | ||
465 | struct rtl_stats *pcurrent_stats) | ||
466 | { | ||
467 | |||
468 | if (!pcurrent_stats->packet_matchbssid && | ||
469 | !pcurrent_stats->packet_beacon) | ||
470 | return; | ||
471 | |||
472 | _rtl92ce_process_ui_rssi(hw, pcurrent_stats); | ||
473 | _rtl92ce_process_pwdb(hw, pcurrent_stats); | ||
474 | _rtl92ce_process_ui_link_quality(hw, pcurrent_stats); | ||
475 | } | ||
476 | |||
477 | static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw, | 293 | static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw, |
478 | struct sk_buff *skb, | 294 | struct sk_buff *skb, |
479 | struct rtl_stats *pstats, | 295 | struct rtl_stats *pstats, |
@@ -516,7 +332,7 @@ static void _rtl92ce_translate_rx_signal_stuff(struct ieee80211_hw *hw, | |||
516 | packet_matchbssid, packet_toself, | 332 | packet_matchbssid, packet_toself, |
517 | packet_beacon); | 333 | packet_beacon); |
518 | 334 | ||
519 | _rtl92ce_process_phyinfo(hw, tmp_buf, pstats); | 335 | rtl_process_phyinfo(hw, tmp_buf, pstats); |
520 | } | 336 | } |
521 | 337 | ||
522 | bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw, | 338 | bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw, |
@@ -526,7 +342,7 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw, | |||
526 | { | 342 | { |
527 | struct rx_fwinfo_92c *p_drvinfo; | 343 | struct rx_fwinfo_92c *p_drvinfo; |
528 | struct rx_desc_92c *pdesc = (struct rx_desc_92c *)p_desc; | 344 | struct rx_desc_92c *pdesc = (struct rx_desc_92c *)p_desc; |
529 | 345 | struct ieee80211_hdr *hdr; | |
530 | u32 phystatus = GET_RX_DESC_PHYST(pdesc); | 346 | u32 phystatus = GET_RX_DESC_PHYST(pdesc); |
531 | stats->length = (u16) GET_RX_DESC_PKT_LEN(pdesc); | 347 | stats->length = (u16) GET_RX_DESC_PKT_LEN(pdesc); |
532 | stats->rx_drvinfo_size = (u8) GET_RX_DESC_DRV_INFO_SIZE(pdesc) * | 348 | stats->rx_drvinfo_size = (u8) GET_RX_DESC_DRV_INFO_SIZE(pdesc) * |
@@ -539,37 +355,60 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw, | |||
539 | stats->rate = (u8) GET_RX_DESC_RXMCS(pdesc); | 355 | stats->rate = (u8) GET_RX_DESC_RXMCS(pdesc); |
540 | stats->shortpreamble = (u16) GET_RX_DESC_SPLCP(pdesc); | 356 | stats->shortpreamble = (u16) GET_RX_DESC_SPLCP(pdesc); |
541 | stats->isampdu = (bool) (GET_RX_DESC_PAGGR(pdesc) == 1); | 357 | stats->isampdu = (bool) (GET_RX_DESC_PAGGR(pdesc) == 1); |
542 | stats->isampdu = (bool) ((GET_RX_DESC_PAGGR(pdesc) == 1) | 358 | stats->isfirst_ampdu = (bool) ((GET_RX_DESC_PAGGR(pdesc) == 1) |
543 | && (GET_RX_DESC_FAGGR(pdesc) == 1)); | 359 | && (GET_RX_DESC_FAGGR(pdesc) == 1)); |
544 | stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); | 360 | stats->timestamp_low = GET_RX_DESC_TSFL(pdesc); |
545 | stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc); | 361 | stats->rx_is40Mhzpacket = (bool) GET_RX_DESC_BW(pdesc); |
362 | stats->is_ht = (bool)GET_RX_DESC_RXHT(pdesc); | ||
363 | |||
364 | stats->is_cck = RX_HAL_IS_CCK_RATE(pdesc); | ||
546 | 365 | ||
547 | rx_status->freq = hw->conf.channel->center_freq; | 366 | rx_status->freq = hw->conf.channel->center_freq; |
548 | rx_status->band = hw->conf.channel->band; | 367 | rx_status->band = hw->conf.channel->band; |
549 | 368 | ||
550 | if (GET_RX_DESC_CRC32(pdesc)) | 369 | hdr = (struct ieee80211_hdr *)(skb->data + stats->rx_drvinfo_size |
551 | rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; | 370 | + stats->rx_bufshift); |
552 | 371 | ||
553 | if (!GET_RX_DESC_SWDEC(pdesc)) | 372 | if (stats->crc) |
554 | rx_status->flag |= RX_FLAG_DECRYPTED; | 373 | rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; |
555 | 374 | ||
556 | if (GET_RX_DESC_BW(pdesc)) | 375 | if (stats->rx_is40Mhzpacket) |
557 | rx_status->flag |= RX_FLAG_40MHZ; | 376 | rx_status->flag |= RX_FLAG_40MHZ; |
558 | 377 | ||
559 | if (GET_RX_DESC_RXHT(pdesc)) | 378 | if (stats->is_ht) |
560 | rx_status->flag |= RX_FLAG_HT; | 379 | rx_status->flag |= RX_FLAG_HT; |
561 | 380 | ||
562 | rx_status->flag |= RX_FLAG_MACTIME_START; | 381 | rx_status->flag |= RX_FLAG_MACTIME_START; |
563 | 382 | ||
564 | if (stats->decrypted) | 383 | /* hw will set stats->decrypted true, if it finds the |
565 | rx_status->flag |= RX_FLAG_DECRYPTED; | 384 | * frame is open data frame or mgmt frame. |
566 | 385 | * So hw will not decryption robust managment frame | |
386 | * for IEEE80211w but still set status->decrypted | ||
387 | * true, so here we should set it back to undecrypted | ||
388 | * for IEEE80211w frame, and mac80211 sw will help | ||
389 | * to decrypt it | ||
390 | */ | ||
391 | if (stats->decrypted) { | ||
392 | if (!hdr) { | ||
393 | /* In testing, hdr was NULL here */ | ||
394 | return false; | ||
395 | } | ||
396 | if ((ieee80211_is_robust_mgmt_frame(hdr)) && | ||
397 | (ieee80211_has_protected(hdr->frame_control))) | ||
398 | rx_status->flag &= ~RX_FLAG_DECRYPTED; | ||
399 | else | ||
400 | rx_status->flag |= RX_FLAG_DECRYPTED; | ||
401 | } | ||
402 | /* rate_idx: index of data rate into band's | ||
403 | * supported rates or MCS index if HT rates | ||
404 | * are use (RX_FLAG_HT) | ||
405 | * Notice: this is diff with windows define | ||
406 | */ | ||
567 | rx_status->rate_idx = rtlwifi_rate_mapping(hw, | 407 | rx_status->rate_idx = rtlwifi_rate_mapping(hw, |
568 | (bool)GET_RX_DESC_RXHT(pdesc), | 408 | stats->is_ht, stats->rate, |
569 | (u8)GET_RX_DESC_RXMCS(pdesc), | 409 | stats->isfirst_ampdu); |
570 | (bool)GET_RX_DESC_PAGGR(pdesc)); | ||
571 | 410 | ||
572 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); | 411 | rx_status->mactime = stats->timestamp_low; |
573 | if (phystatus) { | 412 | if (phystatus) { |
574 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + | 413 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + |
575 | stats->rx_bufshift); | 414 | stats->rx_bufshift); |
@@ -580,7 +419,7 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw, | |||
580 | } | 419 | } |
581 | 420 | ||
582 | /*rx_status->qual = stats->signal; */ | 421 | /*rx_status->qual = stats->signal; */ |
583 | rx_status->signal = stats->rssi + 10; | 422 | rx_status->signal = stats->recvsignalpower + 10; |
584 | /*rx_status->noise = -stats->noise; */ | 423 | /*rx_status->noise = -stats->noise; */ |
585 | 424 | ||
586 | return true; | 425 | return true; |
@@ -624,7 +463,8 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, | |||
624 | if (mac->opmode == NL80211_IFTYPE_STATION) { | 463 | if (mac->opmode == NL80211_IFTYPE_STATION) { |
625 | bw_40 = mac->bw_40; | 464 | bw_40 = mac->bw_40; |
626 | } else if (mac->opmode == NL80211_IFTYPE_AP || | 465 | } else if (mac->opmode == NL80211_IFTYPE_AP || |
627 | mac->opmode == NL80211_IFTYPE_ADHOC) { | 466 | mac->opmode == NL80211_IFTYPE_ADHOC || |
467 | mac->opmode == NL80211_IFTYPE_MESH_POINT) { | ||
628 | if (sta) | 468 | if (sta) |
629 | bw_40 = sta->bandwidth >= IEEE80211_STA_RX_BW_40; | 469 | bw_40 = sta->bandwidth >= IEEE80211_STA_RX_BW_40; |
630 | } | 470 | } |