|
@@ -10017,22 +10017,12 @@ hdd_dbam_config_resp_cb(void *context,
|
|
|
osif_request_put(request);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * hdd_set_dbam_config() - enable/disable DBAM config
|
|
|
- * @adapter: hdd adapter
|
|
|
- * @attr: pointer to nla attr
|
|
|
- *
|
|
|
- * Return: 0 on success, negative errno on failure
|
|
|
- */
|
|
|
-static int hdd_set_dbam_config(struct hdd_adapter *adapter,
|
|
|
- const struct nlattr *attr)
|
|
|
+int hdd_send_dbam_config(struct hdd_adapter *adapter,
|
|
|
+ enum coex_dbam_config_mode dbam_mode)
|
|
|
{
|
|
|
- struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
- struct wlan_objmgr_vdev *vdev;
|
|
|
int errno;
|
|
|
QDF_STATUS status;
|
|
|
- enum qca_dbam_config dbam_config;
|
|
|
- enum coex_dbam_config_mode dbam_mode;
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
enum coex_dbam_comp_status dbam_resp;
|
|
|
struct coex_dbam_config_params dbam_params = {0};
|
|
|
void *cookie;
|
|
@@ -10043,18 +10033,7 @@ static int hdd_set_dbam_config(struct hdd_adapter *adapter,
|
|
|
.timeout_ms = WLAN_SET_DBAM_CONFIG_TIMEOUT,
|
|
|
};
|
|
|
|
|
|
- errno = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (errno)
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- if (hdd_ctx->num_rf_chains < 2) {
|
|
|
- hdd_debug("Num of chains [%u] < 2, DBAM config is not allowed",
|
|
|
- hdd_ctx->num_rf_chains);
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- dbam_config = nla_get_u8(attr);
|
|
|
- errno = hdd_convert_qca_dbam_config_mode(dbam_config, &dbam_mode);
|
|
|
+ errno = hdd_validate_adapter(adapter);
|
|
|
if (errno)
|
|
|
return errno;
|
|
|
|
|
@@ -10099,6 +10078,43 @@ err:
|
|
|
osif_request_put(request);
|
|
|
return errno;
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * hdd_set_dbam_config() - set DBAM config
|
|
|
+ * @adapter: hdd adapter
|
|
|
+ * @attr: pointer to nla attr
|
|
|
+ *
|
|
|
+ * Return: 0 on success, negative errno on failure
|
|
|
+ */
|
|
|
+static int hdd_set_dbam_config(struct hdd_adapter *adapter,
|
|
|
+ const struct nlattr *attr)
|
|
|
+{
|
|
|
+ struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
+ int errno;
|
|
|
+ enum qca_dbam_config dbam_config;
|
|
|
+ enum coex_dbam_config_mode dbam_mode;
|
|
|
+
|
|
|
+ errno = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (errno)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ if (hdd_ctx->num_rf_chains < 2) {
|
|
|
+ hdd_debug("Num of chains [%u] < 2, DBAM config is not allowed",
|
|
|
+ hdd_ctx->num_rf_chains);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ dbam_config = nla_get_u8(attr);
|
|
|
+ errno = hdd_convert_qca_dbam_config_mode(dbam_config, &dbam_mode);
|
|
|
+ if (errno)
|
|
|
+ return errno;
|
|
|
+
|
|
|
+ /* Store dbam config in hdd_ctx, to restore in case of an SSR */
|
|
|
+ adapter->is_dbam_configured = true;
|
|
|
+ hdd_ctx->dbam_mode = dbam_mode;
|
|
|
+
|
|
|
+ return hdd_send_dbam_config(adapter, dbam_mode);
|
|
|
+}
|
|
|
#endif
|
|
|
|
|
|
/**
|