|
@@ -45,6 +45,7 @@
|
|
|
#include "wlan_tdls_cfg_api.h"
|
|
|
#include "wlan_hdd_object_manager.h"
|
|
|
#include <wlan_reg_ucfg_api.h>
|
|
|
+#include "wlan_tdls_api.h"
|
|
|
|
|
|
/**
|
|
|
* enum qca_wlan_vendor_tdls_trigger_mode_hdd_map: Maps the user space TDLS
|
|
@@ -526,6 +527,39 @@ int wlan_hdd_cfg80211_exttdls_set_link_id(struct wiphy *wiphy,
|
|
|
return errno;
|
|
|
}
|
|
|
|
|
|
+static int wlan_hdd_tdls_enable(struct hdd_context *hdd_ctx,
|
|
|
+ struct hdd_adapter *adapter)
|
|
|
+{
|
|
|
+ struct wlan_hdd_link_info *link_info;
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
+ bool tdls_chan_switch_prohibited;
|
|
|
+ bool tdls_prohibited;
|
|
|
+
|
|
|
+ hdd_adapter_for_each_active_link_info(adapter, link_info) {
|
|
|
+ vdev = hdd_objmgr_get_vdev_by_user(link_info, WLAN_TDLS_NB_ID);
|
|
|
+ if (!vdev)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ tdls_chan_switch_prohibited =
|
|
|
+ ucfg_mlme_get_tdls_chan_switch_prohibited(vdev);
|
|
|
+ tdls_prohibited = ucfg_mlme_get_tdls_prohibited(vdev);
|
|
|
+
|
|
|
+ ucfg_tdls_set_user_tdls_enable(vdev, true);
|
|
|
+
|
|
|
+ wlan_tdls_notify_sta_connect(wlan_vdev_get_id(vdev),
|
|
|
+ tdls_chan_switch_prohibited,
|
|
|
+ tdls_prohibited, vdev);
|
|
|
+ if (!wlan_vdev_mlme_is_mlo_vdev(vdev)) {
|
|
|
+ hdd_objmgr_put_vdev_by_user(vdev, WLAN_TDLS_NB_ID);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ hdd_objmgr_put_vdev_by_user(vdev, WLAN_TDLS_NB_ID);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* __wlan_hdd_cfg80211_exttdls_enable() - enable an externally controllable
|
|
|
* TDLS peer and set parameters
|
|
@@ -545,8 +579,30 @@ __wlan_hdd_cfg80211_exttdls_enable(struct wiphy *wiphy,
|
|
|
const void *data,
|
|
|
int data_len)
|
|
|
{
|
|
|
- /* TODO */
|
|
|
- return 0;
|
|
|
+ struct net_device *dev = wdev->netdev;
|
|
|
+ struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
+ struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
|
|
+ int ret = 0;
|
|
|
+
|
|
|
+ hdd_enter_dev(wdev->netdev);
|
|
|
+ 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))
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ if (adapter->device_mode != QDF_STA_MODE &&
|
|
|
+ adapter->device_mode != QDF_P2P_CLIENT_MODE) {
|
|
|
+ hdd_debug("Failed to get TDLS info due to opmode:%d",
|
|
|
+ adapter->device_mode);
|
|
|
+ return -EOPNOTSUPP;
|
|
|
+ }
|
|
|
+
|
|
|
+ ret = wlan_hdd_tdls_enable(hdd_ctx, adapter);
|
|
|
+
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
/**
|