|
@@ -14106,59 +14106,31 @@ wlan_hdd_cfg80211_sta_roam_policy(struct wiphy *wiphy,
|
|
|
}
|
|
|
|
|
|
const struct nla_policy
|
|
|
-wlan_hdd_set_dual_sta_policy[
|
|
|
-QCA_WLAN_VENDOR_ATTR_CONCURRENT_STA_POLICY_MAX + 1] = {
|
|
|
- [QCA_WLAN_VENDOR_ATTR_CONCURRENT_STA_POLICY_CONFIG] = {.type = NLA_U8 },
|
|
|
+wlan_hdd_set_concurrent_session_policy[
|
|
|
+QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_MAX + 1] = {
|
|
|
+ [QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_STA_CONFIG] = {.type = NLA_U8 },
|
|
|
+ [QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_AP_CONFIG] = {.type = NLA_U8 },
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* __wlan_hdd_cfg80211_dual_sta_policy() - Wrapper to configure the concurrent
|
|
|
* session policies
|
|
|
- * @wiphy: wiphy structure pointer
|
|
|
- * @wdev: Wireless device structure pointer
|
|
|
- * @data: Pointer to the data received
|
|
|
- * @data_len: Length of @data
|
|
|
+ * @hdd_ctx: Pointer to HDD context
|
|
|
+ * @tb: parsed attribute array
|
|
|
*
|
|
|
* Configure the concurrent session policies when multiple STA ifaces are
|
|
|
* (getting) active.
|
|
|
* Return: 0 on success; errno on failure
|
|
|
*/
|
|
|
-static int __wlan_hdd_cfg80211_dual_sta_policy(struct wiphy *wiphy,
|
|
|
- struct wireless_dev *wdev,
|
|
|
- const void *data, int data_len)
|
|
|
+static int __wlan_hdd_cfg80211_dual_sta_policy(struct hdd_context *hdd_ctx,
|
|
|
+ struct nlattr **tb)
|
|
|
{
|
|
|
- struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
|
|
- struct nlattr *tb[
|
|
|
- QCA_WLAN_VENDOR_ATTR_CONCURRENT_STA_POLICY_MAX + 1];
|
|
|
QDF_STATUS status;
|
|
|
uint8_t dual_sta_config =
|
|
|
QCA_WLAN_CONCURRENT_STA_POLICY_UNBIASED;
|
|
|
|
|
|
- if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
|
|
- hdd_err("Command not allowed in FTM mode");
|
|
|
- return -EPERM;
|
|
|
- }
|
|
|
-
|
|
|
- if (wlan_hdd_validate_context(hdd_ctx)) {
|
|
|
- hdd_err("Invalid hdd context");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- if (wlan_cfg80211_nla_parse(tb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_CONCURRENT_STA_POLICY_MAX,
|
|
|
- data, data_len,
|
|
|
- wlan_hdd_set_dual_sta_policy)) {
|
|
|
- hdd_err("nla_parse failed");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- if (!tb[QCA_WLAN_VENDOR_ATTR_CONCURRENT_STA_POLICY_CONFIG]) {
|
|
|
- hdd_err("sta policy config attribute not present");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
dual_sta_config = nla_get_u8(
|
|
|
- tb[QCA_WLAN_VENDOR_ATTR_CONCURRENT_STA_POLICY_CONFIG]);
|
|
|
+ tb[QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_STA_CONFIG]);
|
|
|
hdd_debug("Concurrent STA policy : %d", dual_sta_config);
|
|
|
|
|
|
if (dual_sta_config > QCA_WLAN_CONCURRENT_STA_POLICY_UNBIASED)
|
|
@@ -14181,8 +14153,105 @@ static int __wlan_hdd_cfg80211_dual_sta_policy(struct wiphy *wiphy,
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * wlan_hdd_cfg80211_dual_sta_policy() - Wrapper to configure the concurrent
|
|
|
+ * __wlan_hdd_cfg80211_ap_policy() - Wrapper to configure the concurrent
|
|
|
* session policies
|
|
|
+ * @vdev: pointer to vdev
|
|
|
+ * @tb: parsed attribute array
|
|
|
+ *
|
|
|
+ * Configure the concurrent session policies when multiple STA ifaces are
|
|
|
+ * (getting) active.
|
|
|
+ * Return: 0 on success; errno on failure
|
|
|
+ */
|
|
|
+static int __wlan_hdd_cfg80211_ap_policy(struct wlan_objmgr_vdev *vdev,
|
|
|
+ struct nlattr **tb)
|
|
|
+{
|
|
|
+ QDF_STATUS status;
|
|
|
+ uint8_t ap_cfg_policy;
|
|
|
+ uint8_t ap_config =
|
|
|
+ QCA_WLAN_CONCURRENT_AP_POLICY_LOSSLESS_AUDIO_STREAMING;
|
|
|
+
|
|
|
+ ap_config = nla_get_u8(
|
|
|
+ tb[QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_AP_CONFIG]);
|
|
|
+ hdd_debug("AP policy : %d", ap_config);
|
|
|
+
|
|
|
+ if (ap_config > QCA_WLAN_CONCURRENT_AP_POLICY_LOSSLESS_AUDIO_STREAMING) {
|
|
|
+ hdd_err_rl("Invalid concurrent policy ap config %d", ap_config);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ ap_cfg_policy = wlan_mlme_convert_ap_policy_config(ap_config);
|
|
|
+ status = ucfg_mlme_set_ap_policy(vdev, ap_cfg_policy);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ hdd_err("failed to set MLME ap config");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * __wlan_hdd_cfg80211_concurrent_session_policy() - Wrapper to configure the
|
|
|
+ * concurrent session policies
|
|
|
+ * @wiphy: wiphy structure pointer
|
|
|
+ * @wdev: Wireless device structure pointer
|
|
|
+ * @data: Pointer to the data received
|
|
|
+ * @data_len: Length of @data
|
|
|
+ *
|
|
|
+ * Configure the concurrent session policies when low latency SAP or multiple
|
|
|
+ * STA ifaces are (getting) active.
|
|
|
+ * Return: 0 on success; errno on failure
|
|
|
+ */
|
|
|
+static int __wlan_hdd_cfg80211_concurrent_session_policy(
|
|
|
+ struct wiphy *wiphy,
|
|
|
+ struct wireless_dev *wdev,
|
|
|
+ const void *data, int data_len)
|
|
|
+{
|
|
|
+ struct net_device *ndev = wdev->netdev;
|
|
|
+ struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(ndev);
|
|
|
+ struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_MAX + 1];
|
|
|
+
|
|
|
+ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
|
|
+ hdd_err_rl("Command not allowed in FTM mode");
|
|
|
+ return -EPERM;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (hdd_validate_adapter(adapter)) {
|
|
|
+ hdd_err_rl("Invalid adapter");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wlan_hdd_validate_context(adapter->hdd_ctx)) {
|
|
|
+ hdd_err_rl("Invalid hdd context");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (wlan_cfg80211_nla_parse(
|
|
|
+ tb,
|
|
|
+ QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_MAX,
|
|
|
+ data, data_len,
|
|
|
+ wlan_hdd_set_concurrent_session_policy)) {
|
|
|
+ hdd_err_rl("nla_parse failed");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!tb[QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_STA_CONFIG] &&
|
|
|
+ !tb[QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_AP_CONFIG]) {
|
|
|
+ hdd_err_rl("concurrent session policy attr not present");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (tb[QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_STA_CONFIG])
|
|
|
+ __wlan_hdd_cfg80211_dual_sta_policy(adapter->hdd_ctx, tb);
|
|
|
+
|
|
|
+ if (tb[QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_AP_CONFIG])
|
|
|
+ __wlan_hdd_cfg80211_ap_policy(adapter->vdev, tb);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_hdd_cfg80211_concurrent_session_policy() - Wrapper to configure the
|
|
|
+ * concurrent session policies
|
|
|
* @wiphy: wiphy structure pointer
|
|
|
* @wdev: Wireless device structure pointer
|
|
|
* @data: Pointer to the data received
|
|
@@ -14192,9 +14261,11 @@ static int __wlan_hdd_cfg80211_dual_sta_policy(struct wiphy *wiphy,
|
|
|
* (getting) active.
|
|
|
* Return: 0 on success; errno on failure
|
|
|
*/
|
|
|
-static int wlan_hdd_cfg80211_dual_sta_policy(struct wiphy *wiphy,
|
|
|
- struct wireless_dev *wdev,
|
|
|
- const void *data, int data_len)
|
|
|
+static int wlan_hdd_cfg80211_concurrent_session_policy(
|
|
|
+ struct wiphy *wiphy,
|
|
|
+ struct wireless_dev *wdev,
|
|
|
+ const void *data,
|
|
|
+ int data_len)
|
|
|
{
|
|
|
int errno;
|
|
|
struct osif_vdev_sync *vdev_sync;
|
|
@@ -14203,8 +14274,10 @@ static int wlan_hdd_cfg80211_dual_sta_policy(struct wiphy *wiphy,
|
|
|
if (errno)
|
|
|
return errno;
|
|
|
|
|
|
- errno = __wlan_hdd_cfg80211_dual_sta_policy(wiphy, wdev, data,
|
|
|
- data_len);
|
|
|
+ errno = __wlan_hdd_cfg80211_concurrent_session_policy(
|
|
|
+ wiphy, wdev, data,
|
|
|
+ data_len);
|
|
|
+
|
|
|
|
|
|
osif_vdev_sync_op_stop(vdev_sync);
|
|
|
|
|
@@ -17997,13 +18070,14 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = {
|
|
|
{
|
|
|
.info.vendor_id = QCA_NL80211_VENDOR_ID,
|
|
|
.info.subcmd =
|
|
|
- QCA_NL80211_VENDOR_SUBCMD_CONCURRENT_MULTI_STA_POLICY,
|
|
|
+ QCA_NL80211_VENDOR_SUBCMD_CONCURRENT_POLICY,
|
|
|
.flags = WIPHY_VENDOR_CMD_NEED_WDEV |
|
|
|
- WIPHY_VENDOR_CMD_NEED_NETDEV,
|
|
|
- .doit = wlan_hdd_cfg80211_dual_sta_policy,
|
|
|
+ WIPHY_VENDOR_CMD_NEED_NETDEV |
|
|
|
+ WIPHY_VENDOR_CMD_NEED_RUNNING,
|
|
|
+ .doit = wlan_hdd_cfg80211_concurrent_session_policy,
|
|
|
vendor_command_policy(
|
|
|
- wlan_hdd_set_dual_sta_policy,
|
|
|
- QCA_WLAN_VENDOR_ATTR_CONCURRENT_STA_POLICY_MAX)
|
|
|
+ wlan_hdd_set_concurrent_session_policy,
|
|
|
+ QCA_WLAN_VENDOR_ATTR_CONCURRENT_POLICY_MAX)
|
|
|
},
|
|
|
|
|
|
#ifdef FEATURE_WLAN_CH_AVOID
|