|
@@ -8488,6 +8488,8 @@ static const struct independent_setters independent_setters[] = {
|
|
|
hdd_set_dynamic_bw},
|
|
|
{QCA_WLAN_VENDOR_ATTR_CONFIG_NSS,
|
|
|
hdd_set_nss},
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_CONFIG_OPTIMIZED_POWER_MANAGEMENT,
|
|
|
+ hdd_config_power},
|
|
|
};
|
|
|
|
|
|
#ifdef WLAN_FEATURE_ELNA
|
|
@@ -8856,6 +8858,39 @@ static int hdd_get_nss_config(struct hdd_adapter *adapter,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * hdd_get_optimized_power_config() - Get the number of spatial streams
|
|
|
+ * supported by the adapter
|
|
|
+ * @adapter: Pointer to HDD adapter
|
|
|
+ * @skb: sk buffer to hold nl80211 attributes
|
|
|
+ * @attr: Pointer to struct nlattr
|
|
|
+ *
|
|
|
+ * Return: 0 on success; error number otherwise
|
|
|
+ */
|
|
|
+static int hdd_get_optimized_power_config(struct hdd_adapter *adapter,
|
|
|
+ struct sk_buff *skb,
|
|
|
+ const struct nlattr *attr)
|
|
|
+{
|
|
|
+ struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
+ uint8_t optimized_power_cfg;
|
|
|
+ int errno;
|
|
|
+
|
|
|
+ errno = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (errno)
|
|
|
+ return errno;
|
|
|
+
|
|
|
+ optimized_power_cfg = ucfg_pmo_get_power_save_mode(hdd_ctx->psoc);
|
|
|
+
|
|
|
+ if (nla_put_u8(skb,
|
|
|
+ QCA_WLAN_VENDOR_ATTR_CONFIG_OPTIMIZED_POWER_MANAGEMENT,
|
|
|
+ optimized_power_cfg)) {
|
|
|
+ hdd_err_rl("nla_put failure");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* typedef config_getter_fn - get configuration handler
|
|
|
* @adapter: The adapter being configured
|
|
@@ -8921,6 +8956,9 @@ static const struct config_getters config_getters[] = {
|
|
|
{QCA_WLAN_VENDOR_ATTR_CONFIG_NSS,
|
|
|
sizeof(uint8_t),
|
|
|
hdd_get_nss_config},
|
|
|
+ {QCA_WLAN_VENDOR_ATTR_CONFIG_OPTIMIZED_POWER_MANAGEMENT,
|
|
|
+ sizeof(uint8_t),
|
|
|
+ hdd_get_optimized_power_config},
|
|
|
};
|
|
|
|
|
|
/**
|