1
0

qcacld-3.0: Self peer update during dynamic MAC update

The dynamic MAC address update for non-MLO netdev is not
updating the self-peer MAC address which is causing
reference count leak during VDEV destroy.

For non-MLO netdev always update the self-peer MAC address
and for MLO netdev, update self-peer MAC address only
on the link adapter which is associated to MLD adapter.

For non-MLO netdev, send MLD MAC address as NULL in the
request sent to FW set MAC address.

Change-Id: I37a4fdaef0fb8b274769295fd8a920ebd45ffae4
CRs-Fixed: 3265957
Este cometimento está contido em:
Vinod Kumar Pirla
2022-08-11 15:52:44 +05:30
cometido por Madan Koyyalamudi
ascendente d568977f87
cometimento 50ac86e63c
4 ficheiros modificados com 30 adições e 9 eliminações

Ver ficheiro

@@ -304,6 +304,9 @@ else
CONFIG_QCACLD_WLAN_LFR2 := y
endif
#Flag to enable Dynamic MAC address update
CONFIG_WLAN_FEATURE_DYNAMIC_MAC_ADDR_UPDATE := y
ifeq (y,$(filter y,$(CONFIG_LITHIUM) $(CONFIG_BERYLLIUM)))
CONFIG_WIFI_MONITOR_SUPPORT := y
CONFIG_QCA_MONITOR_PKT_SUPPORT := y

Ver ficheiro

@@ -4982,6 +4982,7 @@ int hdd_dynamic_mac_address_set(struct hdd_context *hdd_ctx,
int ret;
QDF_STATUS qdf_ret_status;
struct qdf_mac_addr mld_addr;
bool update_self_peer, update_mld_addr;
qdf_ret_status = ucfg_vdev_mgr_cdp_vdev_detach(adapter->vdev);
if (QDF_IS_STATUS_ERROR(qdf_ret_status)) {
@@ -4995,12 +4996,21 @@ int hdd_dynamic_mac_address_set(struct hdd_context *hdd_ctx,
goto status_ret;
}
if (hdd_adapter_is_link_adapter(adapter)) {
update_self_peer =
hdd_adapter_is_associated_with_ml_adapter(adapter);
update_mld_addr = true;
} else {
update_self_peer = true;
update_mld_addr = false;
}
cookie = osif_request_cookie(request);
hdd_update_set_mac_addr_req_ctx(adapter, cookie);
qdf_mem_copy(&mld_addr, adapter->mld_addr.bytes, sizeof(mld_addr));
qdf_ret_status = sme_send_set_mac_addr(mac_addr, mld_addr,
adapter->vdev);
adapter->vdev, update_mld_addr);
ret = qdf_status_to_os_return(qdf_ret_status);
if (QDF_STATUS_SUCCESS != qdf_ret_status) {
hdd_nofl_err("Failed to send set MAC address command. Status:%d",
@@ -5025,7 +5035,7 @@ int hdd_dynamic_mac_address_set(struct hdd_context *hdd_ctx,
qdf_ret_status = sme_update_vdev_mac_addr(
hdd_ctx->psoc, mac_addr, adapter->vdev,
hdd_adapter_is_associated_with_ml_adapter(adapter),
update_self_peer, update_mld_addr,
ret);
if (QDF_IS_STATUS_ERROR(qdf_ret_status))

Ver ficheiro

@@ -4490,6 +4490,7 @@ QDF_STATUS sme_switch_channel(mac_handle_t mac_handle,
* @mac_addr: VDEV MAC address
* @mld_addr: VDEV MLD address
* @vdev: Pointer to object manager VDEV
* @update_mld_addr: Flag to check whether to update MLD addr or not
*
* API to send set MAC address request command to FW
*
@@ -4497,7 +4498,8 @@ QDF_STATUS sme_switch_channel(mac_handle_t mac_handle,
*/
QDF_STATUS sme_send_set_mac_addr(struct qdf_mac_addr mac_addr,
struct qdf_mac_addr mld_addr,
struct wlan_objmgr_vdev *vdev);
struct wlan_objmgr_vdev *vdev,
bool update_mld_addr);
/**
* sme_update_vdev_mac_addr() - Update VDEV MAC address
@@ -4505,6 +4507,7 @@ QDF_STATUS sme_send_set_mac_addr(struct qdf_mac_addr mac_addr,
* @mac_addr: VDEV MAC address
* @vdev: Pointer to object manager VDEV
* @update_sta_self_peer: Flag to check self peer MAC address or not.
* @update_mld_addr: Flag to check if MLD address update needed or not.
* @req_status: Status of the set MAC address request to the FW
*
* API to update MLME structures with new MAC address. This will be invoked
@@ -4516,7 +4519,8 @@ QDF_STATUS sme_send_set_mac_addr(struct qdf_mac_addr mac_addr,
QDF_STATUS sme_update_vdev_mac_addr(struct wlan_objmgr_psoc *psoc,
struct qdf_mac_addr mac_addr,
struct wlan_objmgr_vdev *vdev,
bool update_sta_self_peer, int req_status);
bool update_sta_self_peer,
bool update_mld_addr, int req_status);
#endif
/**

Ver ficheiro

@@ -15891,7 +15891,8 @@ static inline bool sme_is_11be_capable(void)
QDF_STATUS sme_send_set_mac_addr(struct qdf_mac_addr mac_addr,
struct qdf_mac_addr mld_addr,
struct wlan_objmgr_vdev *vdev)
struct wlan_objmgr_vdev *vdev,
bool update_mld_addr)
{
enum QDF_OPMODE vdev_opmode;
struct qdf_mac_addr vdev_mac_addr = mac_addr;
@@ -15911,7 +15912,8 @@ QDF_STATUS sme_send_set_mac_addr(struct qdf_mac_addr mac_addr,
return qdf_ret_status;
}
if (sme_is_11be_capable() && (vdev_opmode == QDF_STA_MODE)) {
if (vdev_opmode == QDF_STA_MODE &&
sme_is_11be_capable() && update_mld_addr) {
/* Set new MAC addr as MLD address incase of MLO */
mld_addr = mac_addr;
qdf_mem_copy(&vdev_mac_addr, wlan_vdev_mlme_get_linkaddr(vdev),
@@ -15949,7 +15951,8 @@ QDF_STATUS sme_send_set_mac_addr(struct qdf_mac_addr mac_addr,
QDF_STATUS sme_update_vdev_mac_addr(struct wlan_objmgr_psoc *psoc,
struct qdf_mac_addr mac_addr,
struct wlan_objmgr_vdev *vdev,
bool update_sta_self_peer, int req_status)
bool update_sta_self_peer,
bool update_mld_addr, int req_status)
{
enum QDF_OPMODE vdev_opmode;
uint8_t *old_mac_addr_bytes;
@@ -15968,7 +15971,7 @@ QDF_STATUS sme_update_vdev_mac_addr(struct wlan_objmgr_psoc *psoc,
goto p2p_self_peer_create;
if ((vdev_opmode == QDF_STA_MODE) && update_sta_self_peer) {
if (sme_is_11be_capable())
if (sme_is_11be_capable() && update_mld_addr)
old_mac_addr_bytes = wlan_vdev_mlme_get_mldaddr(vdev);
else
old_mac_addr_bytes = wlan_vdev_mlme_get_macaddr(vdev);
@@ -15994,7 +15997,8 @@ QDF_STATUS sme_update_vdev_mac_addr(struct wlan_objmgr_psoc *psoc,
}
/* Update VDEV MAC address */
if ((vdev_opmode == QDF_STA_MODE) && sme_is_11be_capable()) {
if (vdev_opmode == QDF_STA_MODE &&
sme_is_11be_capable() && update_mld_addr) {
if (update_sta_self_peer) {
qdf_ret_status = wlan_mlo_mgr_update_mld_addr(
(struct qdf_mac_addr *)