|
@@ -52,6 +52,7 @@
|
|
|
#include "wlan_policy_mgr_ucfg.h"
|
|
|
#include "nan_ucfg_api.h"
|
|
|
#include "wlan_pkt_capture_ucfg_api.h"
|
|
|
+#include "wlan_hdd_object_manager.h"
|
|
|
|
|
|
/* Ms to Time Unit Micro Sec */
|
|
|
#define MS_TO_TU_MUS(x) ((x) * 1024)
|
|
@@ -85,12 +86,20 @@ const char *tdls_action_frame_type[] = { "TDLS Setup Request",
|
|
|
|
|
|
void wlan_hdd_cancel_existing_remain_on_channel(struct hdd_adapter *adapter)
|
|
|
{
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
+
|
|
|
if (!adapter) {
|
|
|
hdd_err("null adapter");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- ucfg_p2p_cleanup_roc_by_vdev(adapter->vdev);
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (!vdev) {
|
|
|
+ hdd_err("vdev is NULL");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ucfg_p2p_cleanup_roc_by_vdev(vdev);
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
}
|
|
|
|
|
|
int wlan_hdd_check_remain_on_channel(struct hdd_adapter *adapter)
|
|
@@ -104,22 +113,39 @@ int wlan_hdd_check_remain_on_channel(struct hdd_adapter *adapter)
|
|
|
/* Clean up RoC context at hdd_stop_adapter*/
|
|
|
void wlan_hdd_cleanup_remain_on_channel_ctx(struct hdd_adapter *adapter)
|
|
|
{
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
+
|
|
|
if (!adapter) {
|
|
|
hdd_err("null adapter");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- ucfg_p2p_cleanup_roc_by_vdev(adapter->vdev);
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (!vdev) {
|
|
|
+ hdd_err("vdev is NULL");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ ucfg_p2p_cleanup_roc_by_vdev(vdev);
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
}
|
|
|
|
|
|
void wlan_hdd_cleanup_actionframe(struct hdd_adapter *adapter)
|
|
|
{
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
+
|
|
|
if (!adapter) {
|
|
|
hdd_err("null adapter");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- ucfg_p2p_cleanup_tx_by_vdev(adapter->vdev);
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (!vdev) {
|
|
|
+ hdd_err("vdev is NULL");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ucfg_p2p_cleanup_tx_by_vdev(vdev);
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
}
|
|
|
|
|
|
static int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
|
|
@@ -131,6 +157,7 @@ static int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
|
|
|
struct net_device *dev = wdev->netdev;
|
|
|
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
struct hdd_context *hdd_ctx;
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
QDF_STATUS status;
|
|
|
int ret;
|
|
|
|
|
@@ -149,10 +176,17 @@ static int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
|
|
|
if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
|
|
|
return -EINVAL;
|
|
|
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (!vdev) {
|
|
|
+ hdd_err("vdev is NULL");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
/* Disable NAN Discovery if enabled */
|
|
|
ucfg_nan_disable_concurrency(hdd_ctx->psoc);
|
|
|
|
|
|
- status = wlan_cfg80211_roc(adapter->vdev, chan, duration, cookie);
|
|
|
+ status = wlan_cfg80211_roc(vdev, chan, duration, cookie);
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
hdd_debug("remain on channel request, status:%d, cookie:0x%llx",
|
|
|
status, *cookie);
|
|
|
|
|
@@ -187,6 +221,7 @@ __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
|
|
|
QDF_STATUS status;
|
|
|
struct net_device *dev = wdev->netdev;
|
|
|
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
|
|
|
hdd_enter();
|
|
|
|
|
@@ -198,7 +233,15 @@ __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
|
|
|
if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
|
|
|
return -EINVAL;
|
|
|
|
|
|
- status = wlan_cfg80211_cancel_roc(adapter->vdev, cookie);
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (!vdev) {
|
|
|
+ hdd_err("vdev is NULL");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ status = wlan_cfg80211_cancel_roc(vdev, cookie);
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
+
|
|
|
hdd_debug("cancel remain on channel, status:%d", status);
|
|
|
|
|
|
return 0;
|
|
@@ -262,6 +305,7 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
|
|
struct net_device *dev = wdev->netdev;
|
|
|
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
uint8_t type;
|
|
|
uint8_t sub_type;
|
|
|
QDF_STATUS qdf_status;
|
|
@@ -296,8 +340,7 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
|
|
(type == SIR_MAC_MGMT_FRAME &&
|
|
|
sub_type == SIR_MAC_MGMT_AUTH)) {
|
|
|
qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_SME,
|
|
|
- TRACE_CODE_HDD_SEND_MGMT_TX,
|
|
|
- wlan_vdev_get_id(adapter->vdev), 0);
|
|
|
+ TRACE_CODE_HDD_SEND_MGMT_TX, adapter->vdev_id, 0);
|
|
|
|
|
|
qdf_status = sme_send_mgmt_tx(hdd_ctx->mac_handle,
|
|
|
adapter->vdev_id, buf, len);
|
|
@@ -316,12 +359,19 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
|
|
|
|
|
wlan_hdd_validate_and_override_offchan(adapter, chan, &offchan);
|
|
|
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (!vdev) {
|
|
|
+ hdd_err("vdev is NULL");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_OS_IF,
|
|
|
TRACE_CODE_HDD_SEND_MGMT_TX,
|
|
|
- wlan_vdev_get_id(adapter->vdev), 0);
|
|
|
+ wlan_vdev_get_id(vdev), 0);
|
|
|
|
|
|
- status = wlan_cfg80211_mgmt_tx(adapter->vdev, chan, offchan, wait, buf,
|
|
|
+ status = wlan_cfg80211_mgmt_tx(vdev, chan, offchan, wait, buf,
|
|
|
len, no_cck, dont_wait_for_ack, cookie);
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
hdd_debug("mgmt tx, status:%d, cookie:0x%llx", status, *cookie);
|
|
|
|
|
|
return 0;
|
|
@@ -368,6 +418,7 @@ static int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
|
|
|
QDF_STATUS status;
|
|
|
struct net_device *dev = wdev->netdev;
|
|
|
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
|
|
|
hdd_enter();
|
|
|
|
|
@@ -379,7 +430,15 @@ static int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
|
|
|
if (wlan_hdd_validate_vdev_id(adapter->vdev_id))
|
|
|
return -EINVAL;
|
|
|
|
|
|
- status = wlan_cfg80211_mgmt_tx_cancel(adapter->vdev, cookie);
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (!vdev) {
|
|
|
+ hdd_err("vdev is NULL");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ status = wlan_cfg80211_mgmt_tx_cancel(vdev, cookie);
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
+
|
|
|
hdd_debug("cancel mgmt tx, status:%d", status);
|
|
|
|
|
|
return 0;
|
|
@@ -635,6 +694,7 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
|
|
|
bool p2p_dev_addr_admin = false;
|
|
|
enum QDF_OPMODE mode;
|
|
|
QDF_STATUS status;
|
|
|
+ struct wlan_objmgr_vdev *vdev;
|
|
|
int ret;
|
|
|
|
|
|
hdd_enter();
|
|
@@ -677,11 +737,17 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
|
|
|
|
|
|
adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
|
|
|
if (adapter && !wlan_hdd_validate_vdev_id(adapter->vdev_id)) {
|
|
|
- if (ucfg_scan_get_vdev_status(adapter->vdev) !=
|
|
|
- SCAN_NOT_IN_PROGRESS) {
|
|
|
- wlan_abort_scan(hdd_ctx->pdev, INVAL_PDEV_ID,
|
|
|
- adapter->vdev_id, INVALID_SCAN_ID,
|
|
|
- false);
|
|
|
+ vdev = hdd_objmgr_get_vdev(adapter);
|
|
|
+ if (vdev) {
|
|
|
+ if (ucfg_scan_get_vdev_status(vdev) !=
|
|
|
+ SCAN_NOT_IN_PROGRESS) {
|
|
|
+ wlan_abort_scan(hdd_ctx->pdev, INVAL_PDEV_ID,
|
|
|
+ adapter->vdev_id,
|
|
|
+ INVALID_SCAN_ID, false);
|
|
|
+ }
|
|
|
+ hdd_objmgr_put_vdev(vdev);
|
|
|
+ } else {
|
|
|
+ hdd_err("vdev is NULL");
|
|
|
}
|
|
|
}
|
|
|
|