From: Kalle Valo <kvalo@codeaurora.org>
To: Venkateswara Naralasetty <vnaralas@codeaurora.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCHv2 2/2] ath11k: Add ap power save support
Date: Wed, 27 Jan 2021 20:02:08 +0200 [thread overview]
Message-ID: <87h7n28di7.fsf@codeaurora.org> (raw)
In-Reply-To: <1598257589-19091-2-git-send-email-vnaralas@codeaurora.org> (Venkateswara Naralasetty's message of "Mon, 24 Aug 2020 13:56:29 +0530")
Venkateswara Naralasetty <vnaralas@codeaurora.org> writes:
> AP power save where AP goes to power save mode when no stations associate
> to it and come out of power save when any station associate to AP.
>
> This AP power save capability can be used to save power with the drawback
> of reduced range or delayed discovery of the AP
>
> This patch also porvides user configuration to enable/disable
> this feature using vendor command. This feature is disabled by default.
>
> Tested-on: IPQ8074 WLAN.HK.2.1.0.1-01228-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Venkateswara Naralasetty <vnaralas@codeaurora.org>
[...]
> +static int ath11k_vendor_set_wifi_config(struct wiphy *wihpy,
s/wihpy/wiphy/
> + struct wireless_dev *wdev,
> + const void *data,
> + int data_len)
> +{
> + struct ieee80211_vif *vif;
> + struct ath11k_vif *arvif;
> + struct ath11k *ar;
> + struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1];
> + int ret = 0;
> +
> + if (!wdev)
> + return -EINVAL;
> +
> + vif = wdev_to_ieee80211_vif(wdev);
> + if (!vif)
> + return -EINVAL;
> +
> + arvif = (struct ath11k_vif *)vif->drv_priv;
> + if (!arvif)
> + return -EINVAL;
> +
> + ar = arvif->ar;
> +
> + mutex_lock(&ar->conf_mutex);
> +
> + ret = nla_parse(tb, QCA_WLAN_VENDOR_ATTR_CONFIG_MAX, data, data_len,
> + ath11k_vendor_set_wifi_config_policy, NULL);
> + if (ret) {
> + ath11k_warn(ar->ab, "invalid set wifi config policy attribute\n");
> + goto exit;
> + }
> +
> + ar->ap_ps_enabled = nla_get_flag(tb[QCA_WLAN_VENDOR_ATTR_CONFIG_GTX]);
> + ret = ath11k_mac_ap_ps_recalc(ar);
> + if (ret) {
> + ath11k_warn(ar->ab, "failed to send ap ps ret %d\n", ret);
> + goto exit;
> + }
> +
> +exit:
> + mutex_unlock(&ar->conf_mutex);
> + return ret;
> +}
Something which I find awkward here is that this is per pdev (=all
vdevs), even though the vendor command is per vif. So if you change the
config on one vif, all other vifs will change as well. And there's no
way to check if the state from user space as there's only a set command
and no equivalent get command.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2021-01-27 18:03 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-24 8:26 [PATCHv2 1/2] nl80211: vendor-cmd: qca: add command for ap power save Venkateswara Naralasetty
2020-08-24 8:26 ` [PATCHv2 2/2] ath11k: Add ap power save support Venkateswara Naralasetty
2021-01-27 18:02 ` Kalle Valo [this message]
2021-01-27 18:14 ` Kalle Valo
2020-09-28 11:24 ` [PATCHv2 1/2] nl80211: vendor-cmd: qca: add command for ap power save Johannes Berg
2020-09-29 7:40 ` Kalle Valo
2020-09-29 8:04 ` Johannes Berg
2020-09-29 12:39 ` vnaralas
2020-10-21 17:19 ` Kalle Valo
2020-10-22 8:00 ` Arend Van Spriel
2020-10-22 8:05 ` Arend Van Spriel
2020-10-23 3:47 ` vnaralas
2020-11-02 19:44 ` Kalle Valo
2020-11-06 10:41 ` Johannes Berg
2020-11-17 11:23 ` vnaralas
2020-12-23 12:46 ` Jouni Malinen
2021-01-15 10:10 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h7n28di7.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=ath11k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=vnaralas@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).