Skip to contentSkip to conversation

nl80211: vendor-cmd: qca: add command for ap power save

PATCH In review Venkateswara Naralasetty 5 participants 17 messages Aug 24, 2020 – Jan 27, 2021 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 nl80211: vendor-cmd: qca: add command for ap power save

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

This patch is to add vendor command support to enable/disable ap power save.

An example of usage: iw dev wlanx vendor send 0x1374 0x4a ap-ps <val>

0x1374: vendor id
0x4a: vendor subcmd id
val: 0 - disable power save
1 - enable power save

---
v2:
* added use case in the commit log.

 include/uapi/nl80211-vnd-qca.h | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 include/uapi/nl80211-vnd-qca.h
include/uapi/nl80211-vnd-qca.h new file +42 -0
new file mode 100644
index 0000000..357040a
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: ISC */
+/*
+ * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
+ */
+
+#ifndef _UAPI_NL80211_VND_QCA_H
+#define _UAPI_NL80211_VND_QCA_H
+
+/* Vendor id to be used in vendor specific command and events to user space
+ * NOTE: The authoritative place for definition of QCA_NL80211_VENDOR_ID,
+ * vendor subcmd definitions prefixed with QCA_NL80211_VENDOR_SUBCMD, and
+ * qca_wlan_vendor_attr is open source file src/common/qca-vendor.h in
+ * git://w1.fi/srv/git/hostap.git; the values here are just a copy of that
+ */
+#define QCA_NL80211_VENDOR_ID 0x001374
+
+/**
+ * enum qca_nl80211_vendor_subcmds - QCA nl80211 vendor command identifiers
+ *
+ * @QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION: This vendor subcommand is
+ * used to set wifi configurations by the attributes defined in
+ * enum qca_wlan_vendor_attr_config.
+ */
+enum qca_nl80211_vendor_subcmds {
+	QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74,
+};
+
+/**
+ * enum qca_wlan_vendor_attr_config: Attributes for data used by
+ * QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION.
+ *
+ * @QCA_WLAN_VENDOR_ATTR_CONFIG_GTX: 8-bit unsigned value to trigger
+ * green Tx power saving 1-Enable, 0-Disable.
+ */
+enum qca_wlan_vendor_attr_config {
+	QCA_WLAN_VENDOR_ATTR_CONFIG_GTX = 57,
+
+	QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST,
+	QCA_WLAN_VENDOR_ATTR_CONFIG_MAX =
+		QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST - 1,
+};
+#endif /* _UAPI_NL80211_VND_QCA_H_ */
Signature · 7 lines
2.7.4


-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw

PATCH v2 2/2 ath11k: Add ap power save support

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

---
 drivers/net/wireless/ath/ath11k/Makefile |  3 +-
 drivers/net/wireless/ath/ath11k/core.h   |  8 ++++
 drivers/net/wireless/ath/ath11k/mac.c    | 44 +++++++++++++++++
 drivers/net/wireless/ath/ath11k/mac.h    |  1 +
 drivers/net/wireless/ath/ath11k/vendor.c | 81 ++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath11k/vendor.h | 12 +++++
 drivers/net/wireless/ath/ath11k/wmi.c    | 32 +++++++++++++
 drivers/net/wireless/ath/ath11k/wmi.h    |  7 +++
 8 files changed, 187 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/wireless/ath/ath11k/vendor.c
 create mode 100644 drivers/net/wireless/ath/ath11k/vendor.h
drivers/net/wireless/ath/ath11k/Makefile +2 -1
index bc4911f..f0b4975 100644
@@ -16,7 +16,8 @@ ath11k-y += core.o \
 	    ce.o \
 	    peer.o \
 	    dbring.o \
-	    hw.o
+	    hw.o \
+	    vendor.o
 
 ath11k-$(CONFIG_ATH11K_DEBUGFS) += debug_htt_stats.o debugfs_sta.o
 ath11k-$(CONFIG_NL80211_TESTMODE) += testmode.o
drivers/net/wireless/ath/ath11k/core.h +8 -0
index d21191c..827020f 100644
@@ -23,6 +23,7 @@
 #include "thermal.h"
 #include "dbring.h"
 #include "spectral.h"
+#include "vendor.h"
 
 #define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK)
 
@@ -419,6 +420,11 @@ struct ath11k_vdev_stop_status {
 	u32  vdev_id;
 };
 
+enum ath11k_ap_ps_state {
+	ATH11K_AP_PS_STATE_OFF,
+	ATH11K_AP_PS_STATE_ON,
+};
+
 struct ath11k {
 	struct ath11k_base *ab;
 	struct ath11k_pdev *pdev;
@@ -543,6 +549,8 @@ struct ath11k {
 #endif
 	bool dfs_block_radar_events;
 	struct ath11k_thermal thermal;
+	int ap_ps_enabled;
+	enum ath11k_ap_ps_state ap_ps_state;
 };
 
 struct ath11k_band_cap {
drivers/net/wireless/ath/ath11k/mac.c +44 -0

86 lines not on this page · raw message

drivers/net/wireless/ath/ath11k/mac.h +1 -0
index 0607479..18d2f28 100644
@@ -146,4 +146,5 @@ int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);
 u8 ath11k_mac_bw_to_mac80211_bw(u8 bw);
 enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw(enum rate_info_bw bw);
 enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher);
+int ath11k_mac_ap_ps_recalc(struct ath11k *ar);
 #endif
drivers/net/wireless/ath/ath11k/vendor.c new file +81 -0

81 lines not on this page · raw message

drivers/net/wireless/ath/ath11k/vendor.h new file +12 -0
new file mode 100644
index 0000000..6eaf07e
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: BSD-3-Clause-Clear
+/*
+ * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
+ */
+
+#ifndef ATH11K_VENDOR_H
+#define ATH11K_VENDOR_H
+
+int ath11k_vendor_register(struct ath11k *ar);
+
+#endif /* QCA_VENDOR_H */
+
drivers/net/wireless/ath/ath11k/wmi.c +32 -0
index a66576f..9aa1718 100644
@@ -1188,6 +1188,38 @@ ath11k_wmi_rx_reord_queue_remove(struct ath11k *ar,
 	return ret;
 }
 
+int ath11k_wmi_pdev_ap_ps_cmd_send(struct ath11k *ar, u8 pdev_id,
+				   u32 param_value)
+{
+	struct ath11k_pdev_wmi *wmi = ar->wmi;
+	struct wmi_pdev_ap_ps_cmd *cmd;
+	struct sk_buff *skb;
+	int ret;
+
+	skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd));
+	if (!skb)
+		return -ENOMEM;
+
+	cmd = (struct wmi_pdev_ap_ps_cmd *)skb->data;
+	cmd->tlv_header = FIELD_PREP(WMI_TLV_TAG,
+				     WMI_TAG_PDEV_GREEN_AP_PS_ENABLE_CMD) |
+			  FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE);
+	cmd->pdev_id = pdev_id;
+	cmd->param_value = param_value;
+
+	ret = ath11k_wmi_cmd_send(wmi, skb, WMI_PDEV_GREEN_AP_PS_ENABLE_CMDID);
+	if (ret) {
+		ath11k_warn(ar->ab, "failed to send ap ps enable/disable cmd\n");
+		dev_kfree_skb(skb);
+	}
+
+	ath11k_dbg(ar->ab, ATH11K_DBG_WMI,
+		   "wmi pdev ap ps set pdev id %d value %d\n",
+		   pdev_id, param_value);
+
+	return ret;
+}
+
 int ath11k_wmi_pdev_set_param(struct ath11k *ar, u32 param_id,
 			      u32 param_value, u8 pdev_id)
 {
drivers/net/wireless/ath/ath11k/wmi.h +7 -0
index 5a32ba0..e3a5751 100644
@@ -2901,6 +2901,12 @@ struct set_fwtest_params {
 	u32 value;
 };
 
+struct wmi_pdev_ap_ps_cmd {
+	u32 tlv_header;
+	u32 pdev_id;
+	u32 param_value;
+} __packed;
+
 struct wmi_fwtest_set_param_cmd_param {
 	u32 tlv_header;
 	u32 param_id;
@@ -5121,4 +5127,5 @@ int ath11k_wmi_vdev_spectral_enable(struct ath11k *ar, u32 vdev_id,
 				    u32 trigger, u32 enable);
 int ath11k_wmi_vdev_spectral_conf(struct ath11k *ar,
 				  struct ath11k_wmi_vdev_spectral_conf_param *param);
+int ath11k_wmi_pdev_ap_ps_cmd_send(struct ath11k *ar, u8 pdev_id, u32 value);
 #endif
Signature · 7 lines
2.7.4


-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#2 lore raw

Re: [PATCHv2 2/2] ath11k: Add ap power save support

Quoted 12 lines · Venkateswara Naralasetty

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

[...]

Quoted 1 line

+static int ath11k_vendor_set_wifi_config(struct wiphy *wihpy,

s/wihpy/wiphy/

Quoted 33 lines
drivers/net/wireless/ath/ath11k/vendor.c new file +33 -0
+					 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]);

drivers/net/wireless/ath/ath11k/vendor.c line 60

Quoted 10 lines
drivers/net/wireless/ath/ath11k/vendor.c new file +10 -0
+	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.

Signature · 8 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#3 lore raw

Re: [PATCHv2 2/2] ath11k: Add ap power save support

Quoted 62 lines · Kalle Valo
Quoted 12 lines · Venkateswara Naralasetty

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

[...]

Quoted 1 line

+static int ath11k_vendor_set_wifi_config(struct wiphy *wihpy,

s/wihpy/wiphy/

Quoted 41 lines
drivers/net/wireless/ath/ath11k/vendor.c new file +41 -0
+					 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);
Quoted 8 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	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.

Actually the problem comes here:

+static struct wiphy_vendor_command ath11k_vendor_commands[] = {
+ {
+ .info.vendor_id = QCA_NL80211_VENDOR_ID,
+ .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION,
+ .flags = WIPHY_VENDOR_CMD_NEED_WDEV |
+ WIPHY_VENDOR_CMD_NEED_RUNNING,
+ .doit = ath11k_vendor_set_wifi_config,
+ .policy = ath11k_vendor_set_wifi_config_policy,
+ .maxattr = QCA_WLAN_VENDOR_ATTR_CONFIG_MAX
+ }

If it's per pdev you shouldn't set WIPHY_VENDOR_CMD_NEED_WDEV.

Signature · 8 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#4 lore raw
In reply to Venkateswara Naralasetty
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Why do you think this requires a vendor command? I mean, that seems like fairly reasonable - even by default - behaviour? And if not done by default, it could possibly even be configured via the normal powersave mode/command we already have in nl80211, or by a new normal one?

Why does it even require an nl80211 setting, seems like something you'd really only want to turn off for debugging (e.g. via debugfs)?

johannes

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#5 lore raw
Quoted 7 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Why do you think this requires a vendor command? I mean, that seems like fairly reasonable - even by default - behaviour?

I have not studied the details, but doesn't AP power save break normal functionality? For example, I would guess probe requests from clients would be lost. So there's a major drawback when enabling this, right?

Signature · 8 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#6 lore raw
Quoted 7 lines · Kalle Valo
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Quoted 6 lines
Quoted 2 lines

Why do you think this requires a vendor command? I mean, that seems like fairly reasonable - even by default - behaviour?

I have not studied the details, but doesn't AP power save break normal functionality? For example, I would guess probe requests from clients would be lost. So there's a major drawback when enabling this, right?

Not the way it's described above?

johannes

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#7 lore raw
In reply to Kalle Valo
Quoted 7 lines · Kalle Valo
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Quoted 6 lines
Quoted 2 lines

Why do you think this requires a vendor command? I mean, that seems like fairly reasonable - even by default - behaviour?

I have not studied the details, but doesn't AP power save break normal functionality? For example, I would guess probe requests from clients would be lost. So there's a major drawback when enabling this, right?

This AP power save feature will not break any functionality, Since one chain is always active and all other chains will be disabled when this feature is enabled. AP can still be able to beacon and receive probe request from the clients. The only drawback is reduced network range when this feature is enabled. Hence, we don't want to enable it by default.

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#8 lore raw
Quoted 16 lines · [email protected] writes:
Quoted 7 lines · Kalle Valo
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Quoted 7 lines
Quoted 3 lines

Why do you think this requires a vendor command? I mean, that seems like
fairly reasonable - even by default - behaviour?

I have not studied the details, but doesn't AP power save break normal functionality? For example, I would guess probe requests from clients would be lost. So there's a major drawback when enabling this, right?

Quoted 6 lines

This AP power save feature will not break any functionality, Since one chain is always active and all other chains will be disabled when this feature is enabled. AP can still be able to beacon and receive probe request from the clients. The only drawback is reduced network range when this feature is enabled. Hence, we don't want to enable it by default.

Yeah, we really would not want to enable that by default. But what should be the path forward, a vendor command or a proper nl80211 command? Any opinions?

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#9 lore raw
Quoted 25 lines · Kalle Valo
Quoted 16 lines · [email protected] writes:
Quoted 7 lines · Kalle Valo
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Quoted 7 lines
Quoted 3 lines

Why do you think this requires a vendor command? I mean, that seems like
fairly reasonable - even by default - behaviour?

I have not studied the details, but doesn't AP power save break normal functionality? For example, I would guess probe requests from clients would be lost. So there's a major drawback when enabling this, right?

Quoted 6 lines

This AP power save feature will not break any functionality, Since one chain is always active and all other chains will be disabled when this feature is enabled. AP can still be able to beacon and receive probe request from the clients. The only drawback is reduced network range when this feature is enabled. Hence, we don't want to enable it by default.

Quoted 3 lines

Yeah, we really would not want to enable that by default. But what should be the path forward, a vendor command or a proper nl80211 command? Any opinions?

I would go for a proper nl80211 command or just add an attribute for use in NL80211_CMD_START_AP or deal with NL80211_CMD_SET_POWERSAVE when operating in AP mode.

Regards,
Arend

#10 lore raw
Quoted 26 lines · Arend Van Spriel
Quoted 25 lines · Kalle Valo
Quoted 22 lines · [email protected] writes:
Quoted 7 lines · Kalle Valo
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Quoted 7 lines
Quoted 3 lines

Why do you think this requires a vendor command? I mean, that seems like
fairly reasonable - even by default - behaviour?

I have not studied the details, but doesn't AP power save break normal functionality? For example, I would guess probe requests from clients would be lost. So there's a major drawback when enabling this, right?

This AP power save feature will not break any functionality, Since one chain is always active and all other chains will be disabled when this feature is enabled. AP can still be able to beacon and receive probe request from the clients. The only drawback is reduced network range when this feature is enabled. Hence, we don't want to enable it by default.

Quoted 5 lines
Quoted 3 lines

Yeah, we really would not want to enable that by default. But what should be the path forward, a vendor command or a proper nl80211 command? Any opinions?

I would go for a proper nl80211 command or just add an attribute for use in NL80211_CMD_START_AP or deal with NL80211_CMD_SET_POWERSAVE when operating in AP mode.

At first I though this functionality was same as SMPS which is in the 802.11 spec, but reading up on it that seems to be a STA feature.

Regards,
Arend

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#11 lore raw
In reply to Arend Van Spriel
Quoted 26 lines · Arend Van Spriel
Quoted 25 lines · Kalle Valo
Quoted 22 lines · [email protected] writes:
Quoted 7 lines · Kalle Valo
Quoted 5 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Quoted 7 lines
Quoted 3 lines

Why do you think this requires a vendor command? I mean, that seems like
fairly reasonable - even by default - behaviour?

I have not studied the details, but doesn't AP power save break normal functionality? For example, I would guess probe requests from clients would be lost. So there's a major drawback when enabling this, right?

This AP power save feature will not break any functionality, Since one chain is always active and all other chains will be disabled when this feature is enabled. AP can still be able to beacon and receive probe request from the clients. The only drawback is reduced network range when this feature is enabled. Hence, we don't want to enable it by default.

Quoted 8 lines
Quoted 3 lines

Yeah, we really would not want to enable that by default. But what should be the path forward, a vendor command or a proper nl80211 command? Any opinions?

I would go for a proper nl80211 command or just add an attribute for use in NL80211_CMD_START_AP or deal with NL80211_CMD_SET_POWERSAVE when operating in AP mode.

Sure, I will go with the existing NL80211_CMD_SET_POWERSAVE and I will send next version.

Quoted 2 lines

Regards,
Arend

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#12 lore raw
Quoted 36 lines · [email protected] writes:
Quoted 35 lines · Arend Van Spriel
Quoted 33 lines · Kalle Valo
Quoted 19 lines · [email protected] writes:
Quoted 11 lines · Kalle Valo
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Why do you think this requires a vendor command? I mean, that seems like
fairly reasonable - even by default - behaviour?

Quoted 6 lines

I have not studied the details, but doesn't AP power save break normal
functionality? For example, I would guess probe requests from clients
would be lost. So there's a major drawback when enabling this, right?

Quoted 8 lines

This AP power save feature will not break any functionality, Since one
chain is always active and all other chains will be disabled when this
feature is enabled. AP can still be able to beacon and receive probe request from the clients. The only drawback is reduced network range when this feature is enabled. Hence, we don't want to enable it by default.

Yeah, we really would not want to enable that by default. But what should be the path forward, a vendor command or a proper nl80211 command? Any opinions?

Quoted 6 lines
Quoted 4 lines

I would go for a proper nl80211 command or just add an attribute for use in NL80211_CMD_START_AP or deal with NL80211_CMD_SET_POWERSAVE when operating in AP mode.

Sure, I will go with the existing NL80211_CMD_SET_POWERSAVE and I will send next version.

Better to wait first so that we have concensus on this. And need to check if NL80211_CMD_SET_POWERSAVE is even suitable for AP mode.

Signature · 8 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#13 lore raw
Quoted 42 lines · Kalle Valo
Quoted 40 lines · [email protected] writes:
Quoted 39 lines · Arend Van Spriel
Quoted 30 lines · Kalle Valo
Quoted 19 lines · [email protected] writes:
Quoted 11 lines · Kalle Valo
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Why do you think this requires a vendor command? I mean, that seems like
fairly reasonable - even by default - behaviour?

Quoted 6 lines

I have not studied the details, but doesn't AP power save break normal
functionality? For example, I would guess probe requests from clients
would be lost. So there's a major drawback when enabling this, right?

Quoted 8 lines

This AP power save feature will not break any functionality, Since one
chain is always active and all other chains will be disabled when this
feature is enabled. AP can still be able to beacon and receive probe request from the clients. The only drawback is reduced network range when this feature is enabled. Hence, we don't want to enable it by default.

Quoted 3 lines

Yeah, we really would not want to enable that by default. But what should be the path forward, a vendor command or a proper nl80211 command? Any opinions?

I would go for a proper nl80211 command or just add an attribute for use in NL80211_CMD_START_AP or deal with NL80211_CMD_SET_POWERSAVE when operating in AP mode.

Quoted 5 lines
Quoted 2 lines

Sure, I will go with the existing NL80211_CMD_SET_POWERSAVE and I will send next version.

Better to wait first so that we have concensus on this. And need to check if NL80211_CMD_SET_POWERSAVE is even suitable for AP mode.

I suspect that SET_POWERSAVE might be confusing.

Perhaps just with an attribute used in START_AP (and CHANGE_BEACON if needed) would be sufficient?

johannes

#14 lore raw
Quoted 46 lines · Johannes Berg
Quoted 45 lines · Kalle Valo
Quoted 42 lines · [email protected] writes:
Quoted 31 lines · Arend Van Spriel
Quoted 30 lines · Kalle Valo
Quoted 27 lines · [email protected] writes:
Quoted 11 lines · Kalle Valo
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Venkateswara Naralasetty

AP power save feature is to save power in AP mode, where AP goes to power save mode when no stations associate to it and comes out of power save when any station associate to AP.

Why do you think this requires a vendor command? I mean, that seems like
fairly reasonable - even by default - behaviour?

Quoted 6 lines

I have not studied the details, but doesn't AP power save break normal
functionality? For example, I would guess probe requests from clients
would be lost. So there's a major drawback when enabling this, right?

This AP power save feature will not break any functionality, Since one
chain is always active and all other chains will be disabled when this
feature is enabled. AP can still be able to beacon and receive probe request from the clients. The only drawback is reduced network range when this feature is enabled. Hence, we don't want to enable it by default.

Quoted 8 lines
Quoted 3 lines

Yeah, we really would not want to enable that by default. But what should be the path forward, a vendor command or a proper nl80211 command? Any opinions?

I would go for a proper nl80211 command or just add an attribute for use in NL80211_CMD_START_AP or deal with NL80211_CMD_SET_POWERSAVE when operating in AP mode.

Sure, I will go with the existing NL80211_CMD_SET_POWERSAVE and I will send next version.

Quoted 7 lines
Quoted 2 lines

Better to wait first so that we have concensus on this. And need to check if NL80211_CMD_SET_POWERSAVE is even suitable for AP mode.

I suspect that SET_POWERSAVE might be confusing.

Perhaps just with an attribute used in START_AP (and CHANGE_BEACON if needed) would be sufficient?

Actually this ap power save configuration is applicable for per pdev. So, I don't think we can use START AP command here. I would prefer to go with a new NL80211 command. Please share your thoughts on this.

Quoted 2 lines

johannes

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#15 lore raw
In reply to Johannes Berg
Quoted 1 line · Johannes Berg

I suspect that SET_POWERSAVE might be confusing.

Why? Isn't the use case here very similar to the existing station mode use of power save even if the power saving mechanism is more of a vendor specific extension that applies while there are no associated stations?

Quoted 2 lines

Perhaps just with an attribute used in START_AP (and CHANGE_BEACON if needed) would be sufficient?

NL80211_CMD_START_AP with a new attribute (or even re-use of NL80211_ATTR_PS_STATE) might work for a case where this does not need to be changed dynamically during the lifetime of the BSS. NL80211_CMD_SET_BEACON (which maps to the change_beacon() callback) feels like something that is currently limited to Beacon data updates with its use of struct cfg80211_beacon_data instead of struct cfg80211_ap_settings..

That SET_BEACON name is still from the old NEW/SET/DEL_BEACON time. Should that be renamed to NL80211_CMD_UPDATE_AP if we extend this to changes that are not really targeting the Beacon frame payload itself? And should the cfg80211_beacon_data argument be replaced with cfg80211_ap_settings? It looks like we already have some struct cfg80211_ap_settings values like inactivity_timeout and beacon_rate (and maybe some HE parameters?) that one might want to update during the lifetime of the BSS..

Signature · 6 lines
Jouni Malinen                                            PGP id EFC895FA

-- 
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#16 lore raw
Quoted 6 lines · Jouni Malinen
Quoted 1 line · Johannes Berg

I suspect that SET_POWERSAVE might be confusing.

Why? Isn't the use case here very similar to the existing station mode use of power save even if the power saving mechanism is more of a vendor specific extension that applies while there are no associated stations?

Yeah, true, fair point.

However, set-powersave is a bit of a legacy API with state in the kernel, and sometimes restrictions on how/when you can set it etc. I'm not sure it's a good idea for those reasons alone?

Quoted 11 lines
Quoted 2 lines

Perhaps just with an attribute used in START_AP (and CHANGE_BEACON if needed) would be sufficient?

NL80211_CMD_START_AP with a new attribute (or even re-use of NL80211_ATTR_PS_STATE) might work for a case where this does not need to be changed dynamically during the lifetime of the BSS. NL80211_CMD_SET_BEACON (which maps to the change_beacon() callback) feels like something that is currently limited to Beacon data updates with its use of struct cfg80211_beacon_data instead of struct cfg80211_ap_settings..

Quoted 3 lines

That SET_BEACON name is still from the old NEW/SET/DEL_BEACON time. Should that be renamed to NL80211_CMD_UPDATE_AP if we extend this to changes that are not really targeting the Beacon frame payload itself?

I'd be surprised if we don't already have non-beacon state there ... but it looks like only very little non-beacon state, namely the FTM responder state.

Renaming seems reasonable, we've done it before with START_AP.

Quoted 5 lines

And should the cfg80211_beacon_data argument be replaced with cfg80211_ap_settings? It looks like we already have some struct cfg80211_ap_settings values like inactivity_timeout and beacon_rate (and maybe some HE parameters?) that one might want to update during the lifetime of the BSS..

That also seems reasonable.

johannes

Signature · 3 lines
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k