Commit 973324ff authored by Pedersen, Thomas's avatar Pedersen, Thomas Committed by Kalle Valo

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: default avatarThomas Pedersen <twp@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent ff32eeb8
...@@ -7012,6 +7012,30 @@ static void ath10k_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ...@@ -7012,6 +7012,30 @@ static void ath10k_set_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
ath10k_warn(ar, "failed to set tsf offset: %d\n", ret); ath10k_warn(ar, "failed to set tsf offset: %d\n", ret);
} }
static void ath10k_offset_tsf(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, s64 tsf_offset)
{
struct ath10k *ar = hw->priv;
struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
u32 offset, vdev_param;
int ret;
if (tsf_offset < 0) {
vdev_param = ar->wmi.vdev_param->dec_tsf;
offset = -tsf_offset;
} else {
vdev_param = ar->wmi.vdev_param->inc_tsf;
offset = tsf_offset;
}
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
vdev_param, offset);
if (ret && ret != -EOPNOTSUPP)
ath10k_warn(ar, "failed to set tsf offset %d cmd %d: %d\n",
offset, vdev_param, ret);
}
static int ath10k_ampdu_action(struct ieee80211_hw *hw, static int ath10k_ampdu_action(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_ampdu_params *params) struct ieee80211_ampdu_params *params)
...@@ -7476,6 +7500,7 @@ static const struct ieee80211_ops ath10k_ops = { ...@@ -7476,6 +7500,7 @@ static const struct ieee80211_ops ath10k_ops = {
.sta_rc_update = ath10k_sta_rc_update, .sta_rc_update = ath10k_sta_rc_update,
.get_tsf = ath10k_get_tsf, .get_tsf = ath10k_get_tsf,
.set_tsf = ath10k_set_tsf, .set_tsf = ath10k_set_tsf,
.offset_tsf = ath10k_offset_tsf,
.ampdu_action = ath10k_ampdu_action, .ampdu_action = ath10k_ampdu_action,
.get_et_sset_count = ath10k_debug_get_et_sset_count, .get_et_sset_count = ath10k_debug_get_et_sset_count,
.get_et_stats = ath10k_debug_get_et_stats, .get_et_stats = ath10k_debug_get_et_stats,
......
...@@ -1013,6 +1013,8 @@ static struct wmi_vdev_param_map wmi_10_4_vdev_param_map = { ...@@ -1013,6 +1013,8 @@ static struct wmi_vdev_param_map wmi_10_4_vdev_param_map = {
.rx_decap_type = WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE, .rx_decap_type = WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE,
.bw_nss_ratemask = WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK, .bw_nss_ratemask = WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK,
.set_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT, .set_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT,
.inc_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT,
.dec_tsf = WMI_10_4_VDEV_PARAM_TSF_DECREMENT,
}; };
static struct wmi_pdev_param_map wmi_pdev_param_map = { static struct wmi_pdev_param_map wmi_pdev_param_map = {
......
...@@ -4677,6 +4677,8 @@ struct wmi_vdev_param_map { ...@@ -4677,6 +4677,8 @@ struct wmi_vdev_param_map {
u32 rx_decap_type; u32 rx_decap_type;
u32 bw_nss_ratemask; u32 bw_nss_ratemask;
u32 set_tsf; u32 set_tsf;
u32 inc_tsf;
u32 dec_tsf;
}; };
#define WMI_VDEV_PARAM_UNSUPPORTED 0 #define WMI_VDEV_PARAM_UNSUPPORTED 0
...@@ -5009,6 +5011,11 @@ enum wmi_10_4_vdev_param { ...@@ -5009,6 +5011,11 @@ enum wmi_10_4_vdev_param {
WMI_10_4_VDEV_PARAM_STA_KICKOUT, WMI_10_4_VDEV_PARAM_STA_KICKOUT,
WMI_10_4_VDEV_PARAM_CAPABILITIES, WMI_10_4_VDEV_PARAM_CAPABILITIES,
WMI_10_4_VDEV_PARAM_TSF_INCREMENT, WMI_10_4_VDEV_PARAM_TSF_INCREMENT,
WMI_10_4_VDEV_PARAM_RX_FILTER,
WMI_10_4_VDEV_PARAM_MGMT_TX_POWER,
WMI_10_4_VDEV_PARAM_ATF_SSID_SCHED_POLICY,
WMI_10_4_VDEV_PARAM_DISABLE_DYN_BW_RTS,
WMI_10_4_VDEV_PARAM_TSF_DECREMENT,
}; };
#define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0) #define WMI_VDEV_PARAM_TXBF_SU_TX_BFEE BIT(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment