diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2016-11-14 08:26:40 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2016-11-23 08:56:50 -0500 |
commit | 5a401f36ba3080cded5a65fc671648e7cf285ee4 (patch) | |
tree | d1eb03b997b954eacbebce9e886f17615083c325 /drivers/net/wireless | |
parent | 18ae68fff392e445af3c2d8be9bef8a16e1c72a7 (diff) |
ath10k: add spectral scan support to wmi-tlv
Command structure and event flow doesn't seem to
be any different compared to existing
implementation for other firmware branches.
This patch effectively adds in-driver support for
spectral scanning on QCA61x4 and QCA9377.
Tested QCA9377 w/ WLAN.TF.1.0-00267-1.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-tlv.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 5e399c67de3a..97b536e8ab36 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c | |||
@@ -3136,6 +3136,76 @@ ath10k_wmi_tlv_op_gen_echo(struct ath10k *ar, u32 value) | |||
3136 | return skb; | 3136 | return skb; |
3137 | } | 3137 | } |
3138 | 3138 | ||
3139 | static struct sk_buff * | ||
3140 | ath10k_wmi_tlv_op_gen_vdev_spectral_conf(struct ath10k *ar, | ||
3141 | const struct wmi_vdev_spectral_conf_arg *arg) | ||
3142 | { | ||
3143 | struct wmi_vdev_spectral_conf_cmd *cmd; | ||
3144 | struct sk_buff *skb; | ||
3145 | struct wmi_tlv *tlv; | ||
3146 | void *ptr; | ||
3147 | size_t len; | ||
3148 | |||
3149 | len = sizeof(*tlv) + sizeof(*cmd); | ||
3150 | skb = ath10k_wmi_alloc_skb(ar, len); | ||
3151 | if (!skb) | ||
3152 | return ERR_PTR(-ENOMEM); | ||
3153 | |||
3154 | ptr = (void *)skb->data; | ||
3155 | tlv = ptr; | ||
3156 | tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_VDEV_SPECTRAL_CONFIGURE_CMD); | ||
3157 | tlv->len = __cpu_to_le16(sizeof(*cmd)); | ||
3158 | cmd = (void *)tlv->value; | ||
3159 | cmd->vdev_id = __cpu_to_le32(arg->vdev_id); | ||
3160 | cmd->scan_count = __cpu_to_le32(arg->scan_count); | ||
3161 | cmd->scan_period = __cpu_to_le32(arg->scan_period); | ||
3162 | cmd->scan_priority = __cpu_to_le32(arg->scan_priority); | ||
3163 | cmd->scan_fft_size = __cpu_to_le32(arg->scan_fft_size); | ||
3164 | cmd->scan_gc_ena = __cpu_to_le32(arg->scan_gc_ena); | ||
3165 | cmd->scan_restart_ena = __cpu_to_le32(arg->scan_restart_ena); | ||
3166 | cmd->scan_noise_floor_ref = __cpu_to_le32(arg->scan_noise_floor_ref); | ||
3167 | cmd->scan_init_delay = __cpu_to_le32(arg->scan_init_delay); | ||
3168 | cmd->scan_nb_tone_thr = __cpu_to_le32(arg->scan_nb_tone_thr); | ||
3169 | cmd->scan_str_bin_thr = __cpu_to_le32(arg->scan_str_bin_thr); | ||
3170 | cmd->scan_wb_rpt_mode = __cpu_to_le32(arg->scan_wb_rpt_mode); | ||
3171 | cmd->scan_rssi_rpt_mode = __cpu_to_le32(arg->scan_rssi_rpt_mode); | ||
3172 | cmd->scan_rssi_thr = __cpu_to_le32(arg->scan_rssi_thr); | ||
3173 | cmd->scan_pwr_format = __cpu_to_le32(arg->scan_pwr_format); | ||
3174 | cmd->scan_rpt_mode = __cpu_to_le32(arg->scan_rpt_mode); | ||
3175 | cmd->scan_bin_scale = __cpu_to_le32(arg->scan_bin_scale); | ||
3176 | cmd->scan_dbm_adj = __cpu_to_le32(arg->scan_dbm_adj); | ||
3177 | cmd->scan_chn_mask = __cpu_to_le32(arg->scan_chn_mask); | ||
3178 | |||
3179 | return skb; | ||
3180 | } | ||
3181 | |||
3182 | static struct sk_buff * | ||
3183 | ath10k_wmi_tlv_op_gen_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, | ||
3184 | u32 trigger, u32 enable) | ||
3185 | { | ||
3186 | struct wmi_vdev_spectral_enable_cmd *cmd; | ||
3187 | struct sk_buff *skb; | ||
3188 | struct wmi_tlv *tlv; | ||
3189 | void *ptr; | ||
3190 | size_t len; | ||
3191 | |||
3192 | len = sizeof(*tlv) + sizeof(*cmd); | ||
3193 | skb = ath10k_wmi_alloc_skb(ar, len); | ||
3194 | if (!skb) | ||
3195 | return ERR_PTR(-ENOMEM); | ||
3196 | |||
3197 | ptr = (void *)skb->data; | ||
3198 | tlv = ptr; | ||
3199 | tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_VDEV_SPECTRAL_ENABLE_CMD); | ||
3200 | tlv->len = __cpu_to_le16(sizeof(*cmd)); | ||
3201 | cmd = (void *)tlv->value; | ||
3202 | cmd->vdev_id = __cpu_to_le32(vdev_id); | ||
3203 | cmd->trigger_cmd = __cpu_to_le32(trigger); | ||
3204 | cmd->enable_cmd = __cpu_to_le32(enable); | ||
3205 | |||
3206 | return skb; | ||
3207 | } | ||
3208 | |||
3139 | /****************/ | 3209 | /****************/ |
3140 | /* TLV mappings */ | 3210 | /* TLV mappings */ |
3141 | /****************/ | 3211 | /****************/ |
@@ -3541,6 +3611,8 @@ static const struct wmi_ops wmi_tlv_ops = { | |||
3541 | .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, | 3611 | .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill, |
3542 | .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, | 3612 | .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype, |
3543 | .gen_echo = ath10k_wmi_tlv_op_gen_echo, | 3613 | .gen_echo = ath10k_wmi_tlv_op_gen_echo, |
3614 | .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, | ||
3615 | .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, | ||
3544 | }; | 3616 | }; |
3545 | 3617 | ||
3546 | static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { | 3618 | static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { |