diff options
author | Pedersen, Thomas <twp@qca.qualcomm.com> | 2016-09-28 19:56:29 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2016-11-23 08:54:12 -0500 |
commit | 973324fff154beb51711136d5d242df7f328f708 (patch) | |
tree | bdce64652075a50c7f5cd071a52c61ac5e6d985c /drivers/net/wireless | |
parent | ff32eeb86aa18a3d11e32b279faaae4b2e4fef38 (diff) |
ath10k: implement offset_tsf ieee80211_op
Current set_tsf is implemented in terms of TSF_INCREMENT
only. Instead support new WMI command TSF_DECREMENT and
export these through offset_tsf. Advantage is we get
more accurate TSF adjustments, and don't calculate wrong
offset in case absolute TSF was calculated from rx_mactime
(actual TSF).
The new WMI command is available in firmware
10.4-3.2.1-00033 for QCA4019 chips. Old drivers on new
firmware or vice versa shouldn't be a problem since
get/set tsf logic was already broken.
Signed-off-by: Thomas Pedersen <twp@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/mac.c | 25 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.h | 7 |
3 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 12602af0917c..7ab74a1b45dc 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c | |||
@@ -7012,6 +7012,30 @@ static void ath10k_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
7012 | ath10k_warn(ar, "failed to set tsf offset: %d\n", ret); | 7012 | ath10k_warn(ar, "failed to set tsf offset: %d\n", ret); |
7013 | } | 7013 | } |
7014 | 7014 | ||
7015 | static void ath10k_offset_tsf(struct ieee80211_hw *hw, | ||
7016 | struct ieee80211_vif *vif, s64 tsf_offset) | ||
7017 | { | ||
7018 | struct ath10k *ar = hw->priv; | ||
7019 | struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); | ||
7020 | u32 offset, vdev_param; | ||
7021 | int ret; | ||
7022 | |||
7023 | if (tsf_offset < 0) { | ||
7024 | vdev_param = ar->wmi.vdev_param->dec_tsf; | ||
7025 | offset = -tsf_offset; | ||
7026 | } else { | ||
7027 | vdev_param = ar->wmi.vdev_param->inc_tsf; | ||
7028 | offset = tsf_offset; | ||
7029 | } | ||
7030 | |||
7031 | ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, | ||
7032 | vdev_param, offset); | ||
7033 | |||
7034 | if (ret && ret != -EOPNOTSUPP) | ||
7035 | ath10k_warn(ar, "failed to set tsf offset %d cmd %d: %d\n", | ||
7036 | offset, vdev_param, ret); | ||
7037 | } | ||
7038 | |||
7015 | static int ath10k_ampdu_action(struct ieee80211_hw *hw, | 7039 | static int ath10k_ampdu_action(struct ieee80211_hw *hw, |
7016 | struct ieee80211_vif *vif, | 7040 | struct ieee80211_vif *vif, |
7017 | struct ieee80211_ampdu_params *params) | 7041 | struct ieee80211_ampdu_params *params) |
@@ -7476,6 +7500,7 @@ static const struct ieee80211_ops ath10k_ops = { | |||
7476 | .sta_rc_update = ath10k_sta_rc_update, | 7500 | .sta_rc_update = ath10k_sta_rc_update, |
7477 | .get_tsf = ath10k_get_tsf, | 7501 | .get_tsf = ath10k_get_tsf, |
7478 | .set_tsf = ath10k_set_tsf, | 7502 | .set_tsf = ath10k_set_tsf, |
7503 | .offset_tsf = ath10k_offset_tsf, | ||
7479 | .ampdu_action = ath10k_ampdu_action, | 7504 | .ampdu_action = ath10k_ampdu_action, |
7480 | .get_et_sset_count = ath10k_debug_get_et_sset_count, | 7505 | .get_et_sset_count = ath10k_debug_get_et_sset_count, |
7481 | .get_et_stats = ath10k_debug_get_et_stats, | 7506 | .get_et_stats = ath10k_debug_get_et_stats, |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 387c4eede388..bc896137798c 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -1013,6 +1013,8 @@ static struct wmi_vdev_param_map wmi_10_4_vdev_param_map = { | |||
1013 | .rx_decap_type = WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE, | 1013 | .rx_decap_type = WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE, |
1014 | .bw_nss_ratemask = WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK, | 1014 | .bw_nss_ratemask = WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK, |
1015 | .set_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT, | 1015 | .set_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT, |
1016 | .inc_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT, | ||
1017 | .dec_tsf = WMI_10_4_VDEV_PARAM_TSF_DECREMENT, | ||
1016 | }; | 1018 | }; |
1017 | 1019 | ||
1018 | static struct wmi_pdev_param_map wmi_pdev_param_map = { | 1020 | static struct wmi_pdev_param_map wmi_pdev_param_map = { |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 1b243c899bef..9d13c6f1ba21 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h | |||
@@ -4677,6 +4677,8 @@ struct wmi_vdev_param_map { | |||
4677 | u32 rx_decap_type; | 4677 | u32 rx_decap_type; |
4678 | u32 bw_nss_ratemask; | 4678 | u32 bw_nss_ratemask; |
4679 | u32 set_tsf; | 4679 | u32 set_tsf; |
4680 | u32 inc_tsf; | ||
4681 | u32 dec_tsf; | ||
4680 | }; | 4682 | }; |
4681 | 4683 | ||
4682 | #define WMI_VDEV_PARAM_UNSUPPORTED 0 | 4684 | #define WMI_VDEV_PARAM_UNSUPPORTED 0 |
@@ -5009,6 +5011,11 @@ enum wmi_10_4_vdev_param { | |||
5009 | WMI_10_4_VDEV_PARAM_STA_KICKOUT, | 5011 | WMI_10_4_VDEV_PARAM_STA_KICKOUT, |
5010 | WMI_10_4_VDEV_PARAM_CAPABILITIES, | 5012 | WMI_10_4_VDEV_PARAM_CAPABILITIES, |
5011 | WMI_10_4_VDEV_PARAM_TSF_INCREMENT, | 5013 | WMI_10_4_VDEV_PARAM_TSF_INCREMENT, |
5014 | WMI_10_4_VDEV_PARAM_RX_FILTER, | ||
5015 | WMI_10_4_VDEV_PARAM_MGMT_TX_POWER, | ||
5016 | WMI_10_4_VDEV_PARAM_ATF_SSID_SCHED_POLICY, | ||
5017 | WMI_10_4_VDEV_PARAM_DISABLE_DYN_BW_RTS, | ||
5018 | WMI_10_4_VDEV_PARAM_TSF_DECREMENT, | ||
5012 | }; | 5019 | }; |
5013 | 5020 | ||
5014 | #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0) | 5021 | #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0) |