qcacmn: Add support to dynamic MAC address update
Currently, MAC address update is supported only when interface is down. Because of this framework needs to issue interface down and interface up to update the MAC address. This is resulting in connection time increase when MAC address randomization is enabled for every new connection. To optimize the connection time, add support to update the MAC address without bringing the interface to down state. Change-Id: Ic3eff6a9571f885292021b2c178d26b0eace5042 CRs-Fixed: 3063475
This commit is contained in:

committed by
Madan Koyyalamudi

parent
a50a68c40d
commit
ca4b3fabf6
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -1205,6 +1206,41 @@ static void target_if_vdev_register_tx_fils(
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
static QDF_STATUS
|
||||
target_if_vdev_mgr_set_mac_address_send(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct set_mac_addr_params params = {0};
|
||||
struct wmi_unified *wmi_handle;
|
||||
|
||||
wmi_handle = target_if_vdev_mgr_wmi_handle_get(vdev);
|
||||
if (!wmi_handle) {
|
||||
mlme_err("Failed to get WMI handle!");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
params.vdev_id = wlan_vdev_get_id(vdev);
|
||||
params.mac_addr = mac_addr;
|
||||
params.mld_addr = mld_addr;
|
||||
|
||||
return wmi_unified_send_set_mac_addr(wmi_handle, ¶ms);
|
||||
}
|
||||
|
||||
static void target_if_vdev_register_set_mac_address(
|
||||
struct wlan_lmac_if_mlme_tx_ops *mlme_tx_ops)
|
||||
{
|
||||
mlme_tx_ops->vdev_send_set_mac_addr =
|
||||
target_if_vdev_mgr_set_mac_address_send;
|
||||
}
|
||||
#else
|
||||
static void target_if_vdev_register_set_mac_address(
|
||||
struct wlan_lmac_if_mlme_tx_ops *mlme_tx_ops)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS
|
||||
target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
||||
{
|
||||
@@ -1273,5 +1309,6 @@ target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
||||
target_if_wake_lock_deinit;
|
||||
mlme_tx_ops->vdev_mgr_rsp_timer_stop =
|
||||
target_if_vdev_mgr_rsp_timer_stop;
|
||||
target_if_vdev_register_set_mac_address(mlme_tx_ops);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -893,6 +894,21 @@ static inline void wlan_peer_set_macaddr(struct wlan_objmgr_peer *peer,
|
||||
WLAN_ADDR_COPY(peer->macaddr, macaddr);
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
/**
|
||||
* wlan_peer_update_macaddr() - Update peer MAC address
|
||||
* @peer: PEER object
|
||||
* @new_macaddr: New MAC address
|
||||
*
|
||||
* API to update peer MAC address and corresponding peer hash entry in PSOC
|
||||
* peer list.
|
||||
*
|
||||
* Return: SUCCESS/FAILURE
|
||||
*/
|
||||
QDF_STATUS wlan_peer_update_macaddr(struct wlan_objmgr_peer *peer,
|
||||
uint8_t *new_macaddr);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* wlan_peer_get_macaddr() - get mac addr
|
||||
* @peer: PEER object
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -1291,3 +1292,53 @@ wlan_objmgr_peer_get_comp_ref_cnt(struct wlan_objmgr_peer *peer,
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
QDF_STATUS wlan_peer_update_macaddr(struct wlan_objmgr_peer *peer,
|
||||
uint8_t *new_macaddr)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
uint8_t *macaddr;
|
||||
QDF_STATUS status;
|
||||
|
||||
if (!peer) {
|
||||
obj_mgr_err("PEER is NULL");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
macaddr = wlan_peer_get_macaddr(peer);
|
||||
|
||||
vdev = wlan_peer_get_vdev(peer);
|
||||
if (!vdev) {
|
||||
obj_mgr_err("VDEV is NULL for peer(" QDF_MAC_ADDR_FMT ")",
|
||||
QDF_MAC_ADDR_REF(macaddr));
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/* get PSOC from VDEV, if it is NULL, return */
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
obj_mgr_err("PSOC is NULL for peer(" QDF_MAC_ADDR_FMT ")",
|
||||
QDF_MAC_ADDR_REF(macaddr));
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
status = wlan_objmgr_psoc_peer_detach(psoc, peer);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
obj_mgr_err("Failed to detach peer(" QDF_MAC_ADDR_FMT ")",
|
||||
QDF_MAC_ADDR_REF(macaddr));
|
||||
return status;
|
||||
}
|
||||
|
||||
wlan_peer_set_macaddr(peer, new_macaddr);
|
||||
|
||||
status = wlan_objmgr_psoc_peer_attach(psoc, peer);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
obj_mgr_err("Failed to attach peer(" QDF_MAC_ADDR_FMT ")",
|
||||
QDF_MAC_ADDR_REF(new_macaddr));
|
||||
return status;
|
||||
}
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
@@ -404,6 +404,7 @@ enum wlan_mlme_cfg_id;
|
||||
* @psoc_wake_lock_init: Initialize psoc wake lock for vdev response timer
|
||||
* @psoc_wake_lock_deinit: De-Initialize psoc wake lock for vdev response timer
|
||||
* @get_hw_link_id: Get hw_link_id for pdev
|
||||
* @vdev_send_set_mac_addr: API to send set MAC address request to FW
|
||||
*/
|
||||
struct wlan_lmac_if_mlme_tx_ops {
|
||||
uint32_t (*get_wifi_iface_id) (struct wlan_objmgr_pdev *pdev);
|
||||
@@ -494,6 +495,11 @@ struct wlan_lmac_if_mlme_tx_ops {
|
||||
QDF_STATUS (*target_if_mlo_ready)(struct wlan_objmgr_pdev **pdev,
|
||||
uint8_t num_pdevs);
|
||||
#endif
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
QDF_STATUS (*vdev_send_set_mac_addr)(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev);
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -162,6 +163,8 @@ struct mlme_cm_ops {
|
||||
* @mlme_cm_ext_roam_start_ind_cb: callback to indicate roam start
|
||||
* @mlme_cm_ext_reassoc_req_cb: callback for reassoc request to
|
||||
* VDEV/PEER SM
|
||||
* @mlme_vdev_send_set_mac_addr: callback to send set MAC address
|
||||
* request to FW
|
||||
*/
|
||||
struct mlme_ext_ops {
|
||||
QDF_STATUS (*mlme_psoc_ext_hdl_create)(
|
||||
@@ -232,6 +235,12 @@ struct mlme_ext_ops {
|
||||
QDF_STATUS (*mlme_cm_ext_reassoc_req_cb)(
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_cm_vdev_reassoc_req *req);
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
QDF_STATUS (*mlme_vdev_send_set_mac_addr)(
|
||||
struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev);
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -751,4 +760,19 @@ void mlme_set_osif_cm_cb(osif_cm_get_global_ops_cb cm_osif_ops);
|
||||
*/
|
||||
bool mlme_max_chan_switch_is_set(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
/**
|
||||
* mlme_vdev_ops_send_set_mac_address() - Send set MAC address request to FW
|
||||
* @mac_addr: VDEV MAC address
|
||||
* @mld_addr: VDEV MLD address
|
||||
* @vdev: vdev pointer
|
||||
*
|
||||
* API to send set MAC address request command to FW
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS mlme_vdev_ops_send_set_mac_address(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev);
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -1169,4 +1169,21 @@ static inline struct wlan_vdev_aid_mgr *wlan_vdev_mlme_get_aid_mgr(
|
||||
return vdev_mlme->mgmt.ap.aid_mgr;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
/**
|
||||
* vdev_mgr_cdp_vdev_attach() - MLME API to attach CDP vdev
|
||||
* @mlme_obj: pointer to vdev_mlme_obj
|
||||
*
|
||||
* Return: QDF_STATUS - Success or Failure
|
||||
*/
|
||||
QDF_STATUS vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj);
|
||||
|
||||
/**
|
||||
* vdev_mgr_cdp_vdev_detach() - MLME API to detach CDP vdev
|
||||
* @mlme_obj: pointer to vdev_mlme_obj
|
||||
*
|
||||
* Return: QDF_STATUS - Success or Failure
|
||||
*/
|
||||
QDF_STATUS vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj);
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -208,4 +209,18 @@ QDF_STATUS wlan_mlme_psoc_enable(struct wlan_objmgr_psoc *psoc);
|
||||
* FAILURE, if cleanup fails
|
||||
*/
|
||||
QDF_STATUS wlan_mlme_psoc_disable(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
/**
|
||||
* wlan_vdev_mlme_send_set_mac_addr() - Send set MAC address command to FW
|
||||
* @mac_addr: VDEV MAC address
|
||||
* @mld_addr: VDEV MLD address
|
||||
* @vdev: Pointer to object manager VDEV
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_vdev_mlme_send_set_mac_addr(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev);
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -573,3 +574,18 @@ bool mlme_max_chan_switch_is_set(struct wlan_objmgr_vdev *vdev)
|
||||
|
||||
return phy_config->max_chan_switch_ie;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
QDF_STATUS mlme_vdev_ops_send_set_mac_address(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
QDF_STATUS ret = QDF_STATUS_E_FAILURE;
|
||||
|
||||
if (glbl_ops && glbl_ops->mlme_vdev_send_set_mac_addr)
|
||||
ret = glbl_ops->mlme_vdev_send_set_mac_addr(mac_addr, mld_addr,
|
||||
vdev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
@@ -299,3 +300,12 @@ QDF_STATUS wlan_vdev_mlme_deinit(void)
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
QDF_STATUS wlan_vdev_mlme_send_set_mac_addr(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
return mlme_vdev_ops_send_set_mac_address(mac_addr, mld_addr, vdev);
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -820,3 +821,21 @@ QDF_STATUS vdev_mgr_peer_delete_all_send(struct vdev_mlme_obj *mlme_obj)
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
QDF_STATUS vdev_mgr_send_set_mac_addr(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
return tgt_vdev_mgr_send_set_mac_addr(mac_addr, mld_addr, vdev);
|
||||
}
|
||||
|
||||
QDF_STATUS vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj)
|
||||
{
|
||||
return tgt_vdev_mgr_cdp_vdev_attach(mlme_obj);
|
||||
}
|
||||
|
||||
QDF_STATUS vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj)
|
||||
{
|
||||
return tgt_vdev_mgr_cdp_vdev_detach(mlme_obj);
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -250,4 +251,20 @@ static inline uint32_t vdev_mgr_fetch_ratecode(struct vdev_mlme_obj *mlme_obj)
|
||||
return mlme_obj->mgmt.rate_info.bcn_tx_rate;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
/**
|
||||
* vdev_mgr_send_set_mac_addr() - Send set MAC address command to FW
|
||||
* @mac_addr: VDEV MAC address
|
||||
* @mld_addr: VDEV MLD address
|
||||
* @vdev: Pointer to object manager VDEV
|
||||
*
|
||||
* API to send set MAC address request to FW
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS vdev_mgr_send_set_mac_addr(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev);
|
||||
#endif
|
||||
#endif /* __VDEV_MGR_OPS_H__ */
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -88,6 +89,10 @@ defined(QCA_WIFI_QCA5018)
|
||||
#define PEER_DELETE_ALL_RESPONSE_TIMER 6000
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
#define WLAN_SET_MAC_ADDR_TIMEOUT START_RESPONSE_TIMER
|
||||
#endif
|
||||
|
||||
/**
|
||||
* struct vdev_response_timer - vdev mgmt response ops timer
|
||||
* @psoc: Object manager psoc
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -314,4 +315,35 @@ QDF_STATUS tgt_vdev_mgr_peer_delete_all_send(
|
||||
struct vdev_mlme_obj *mlme_obj,
|
||||
struct peer_delete_all_params *param);
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
/**
|
||||
* tgt_vdev_mgr_send_set_mac_addr() - Send set MAC address command to FW
|
||||
* @mac_addr: VDEV MAC address
|
||||
* @mld_addr: VDEV MLD address
|
||||
* @vdev: Pointer to object manager VDEV
|
||||
*
|
||||
* API to send set MAC address request to FW
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_vdev_mgr_send_set_mac_addr(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* tgt_vdev_mgr_cdp_vdev_attach() - API to send CDP VDEV attach
|
||||
* @mlme_obj: pointer to vdev_mlme_obj
|
||||
*
|
||||
* Return: QDF_STATUS - Success or Failure
|
||||
*/
|
||||
QDF_STATUS tgt_vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj);
|
||||
|
||||
/**
|
||||
* tgt_vdev_mgr_cdp_vdev_detach() - API to send CDP VDEV detach
|
||||
* @mlme_obj: pointer to vdev_mlme_obj
|
||||
*
|
||||
* Return: QDF_STATUS - Success or Failure
|
||||
*/
|
||||
QDF_STATUS tgt_vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj);
|
||||
#endif
|
||||
#endif /* __WLAN_VDEV_MGR_TX_OPS_API_H__ */
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -213,4 +214,21 @@ void ucfg_wlan_vdev_mgr_get_trans_bssid(struct wlan_objmgr_vdev *vdev,
|
||||
void ucfg_wlan_vdev_mgr_get_tsf_adjust(struct wlan_objmgr_vdev *vdev,
|
||||
uint64_t *tsf_adjust);
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
/**
|
||||
* ucfg_vdev_mgr_cdp_vdev_attach() - ucfg MLME API to attach CDP vdev
|
||||
* @vdev: pointer to vdev object
|
||||
*
|
||||
* Return: QDF_STATUS - Success or Failure
|
||||
*/
|
||||
QDF_STATUS ucfg_vdev_mgr_cdp_vdev_attach(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* vdev_mgr_cdp_vdev_detach() - ucfg MLME API to detach CDP vdev
|
||||
* @vdev: pointer to vdev object
|
||||
*
|
||||
* Return: QDF_STATUS - Success or Failure
|
||||
*/
|
||||
QDF_STATUS ucfg_vdev_mgr_cdp_vdev_detach(struct wlan_objmgr_vdev *vdev);
|
||||
#endif
|
||||
#endif /* __WLAN_VDEV_MLME_UCFG_H__ */
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -705,3 +706,89 @@ QDF_STATUS tgt_vdev_mgr_peer_delete_all_send(
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
static inline void
|
||||
tgt_vdev_mgr_fill_mlo_params(struct cdp_vdev_info *vdev_info,
|
||||
struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
vdev_info->mld_mac_addr = wlan_vdev_mlme_get_mldaddr(vdev);
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
tgt_vdev_mgr_fill_mlo_params(struct cdp_vdev_info *vdev_info,
|
||||
struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS tgt_vdev_mgr_cdp_vdev_attach(struct vdev_mlme_obj *mlme_obj)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
ol_txrx_soc_handle soc_txrx_handle;
|
||||
struct cdp_vdev_info vdev_info = { 0 };
|
||||
|
||||
vdev = mlme_obj->vdev;
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
mlme_err("psoc object is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
pdev = wlan_vdev_get_pdev(vdev);
|
||||
soc_txrx_handle = wlan_psoc_get_dp_handle(psoc);
|
||||
if (!soc_txrx_handle)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
vdev_info.vdev_mac_addr = wlan_vdev_mlme_get_macaddr(vdev);
|
||||
vdev_info.vdev_id = wlan_vdev_get_id(vdev);
|
||||
vdev_info.op_mode = wlan_util_vdev_get_cdp_txrx_opmode(vdev);
|
||||
vdev_info.subtype = wlan_util_vdev_get_cdp_txrx_subtype(vdev);
|
||||
tgt_vdev_mgr_fill_mlo_params(&vdev_info, vdev);
|
||||
return cdp_vdev_attach(soc_txrx_handle,
|
||||
wlan_objmgr_pdev_get_pdev_id(pdev),
|
||||
&vdev_info);
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_vdev_mgr_cdp_vdev_detach(struct vdev_mlme_obj *mlme_obj)
|
||||
{
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
ol_txrx_soc_handle soc_txrx_handle;
|
||||
|
||||
vdev = mlme_obj->vdev;
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
soc_txrx_handle = wlan_psoc_get_dp_handle(psoc);
|
||||
if (soc_txrx_handle)
|
||||
return cdp_vdev_detach(soc_txrx_handle, wlan_vdev_get_id(vdev),
|
||||
NULL, NULL);
|
||||
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
QDF_STATUS tgt_vdev_mgr_send_set_mac_addr(struct qdf_mac_addr mac_addr,
|
||||
struct qdf_mac_addr mld_addr,
|
||||
struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct wlan_lmac_if_mlme_tx_ops *txops;
|
||||
uint8_t vdev_id;
|
||||
QDF_STATUS status;
|
||||
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
txops = wlan_vdev_mlme_get_lmac_txops(vdev);
|
||||
if (!txops || !txops->vdev_send_set_mac_addr) {
|
||||
mlme_err("VDEV_%d: No Tx Ops", vdev_id);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
status = txops->vdev_send_set_mac_addr(mac_addr, mld_addr, vdev);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
@@ -183,3 +184,39 @@ void ucfg_wlan_vdev_mgr_get_param(
|
||||
}
|
||||
|
||||
qdf_export_symbol(ucfg_wlan_vdev_mgr_get_param);
|
||||
|
||||
#ifdef WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE
|
||||
QDF_STATUS ucfg_vdev_mgr_cdp_vdev_attach(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct vdev_mlme_obj *vdev_mlme;
|
||||
|
||||
vdev_mlme = wlan_objmgr_vdev_get_comp_private_obj(
|
||||
vdev,
|
||||
WLAN_UMAC_COMP_MLME);
|
||||
|
||||
if (!vdev_mlme)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return vdev_mgr_cdp_vdev_attach(vdev_mlme);
|
||||
}
|
||||
|
||||
qdf_export_symbol(ucfg_vdev_mgr_cdp_vdev_attach);
|
||||
|
||||
QDF_STATUS ucfg_vdev_mgr_cdp_vdev_detach(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
struct vdev_mlme_obj *vdev_mlme;
|
||||
|
||||
vdev_mlme = wlan_objmgr_vdev_get_comp_private_obj(
|
||||
vdev,
|
||||
WLAN_UMAC_COMP_MLME);
|
||||
|
||||
if (!vdev_mlme) {
|
||||
QDF_ASSERT(0);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return vdev_mgr_cdp_vdev_detach(vdev_mlme);
|
||||
}
|
||||
|
||||
qdf_export_symbol(ucfg_vdev_mgr_cdp_vdev_detach);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user