mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
qcacld-3.0: Don't proceed with NDP peer handling if NDI is not UP
Firmware might send NDP peer indication/NDP responder response while NDI deletion is in progress. Currently, NDP peer entry gets added though vdev is moved to DOWN state and cleanup is in progress. This leads to stale peer entry on that NDI vdev and doesn't allow vdev delete when IFF_DOWN comes, as a peer is present. Check the vdev state before creating peer for NDP and skip peer creation if NDI vdev is not in UP state(which indicates that the vdev down is happening). Also, don't process the NDP confirm if NDP peer is not created. Change-Id: I73e79cc33b1a294e3f4a4a6e2f371033862c5709 CRs-Fixed: 3061756
This commit is contained in:
parent
7a81e44044
commit
83f49ec2d0
4 changed files with 46 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2022 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
|
||||
|
|
@ -774,4 +774,13 @@ QDF_STATUS mlme_get_cfg_wlm_reset(struct wlan_objmgr_psoc *psoc,
|
|||
*/
|
||||
void mlme_reinit_control_config_lfr_params(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_mlme_lfr_cfg *lfr);
|
||||
|
||||
/**
|
||||
* wlan_is_vdev_id_up() - check if vdev id is in UP state
|
||||
* @pdev: Pointer to pdev
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Return: if vdev is up
|
||||
*/
|
||||
bool wlan_is_vdev_id_up(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3276,3 +3276,22 @@ QDF_STATUS mlme_get_fw_scan_channels(struct wlan_objmgr_psoc *psoc,
|
|||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool wlan_is_vdev_id_up(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
|
||||
{
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
bool is_up = false;
|
||||
|
||||
if (!pdev)
|
||||
return is_up;
|
||||
|
||||
vdev = wlan_objmgr_get_vdev_by_id_from_pdev(pdev, vdev_id,
|
||||
WLAN_LEGACY_MAC_ID);
|
||||
|
||||
if (vdev) {
|
||||
is_up = QDF_IS_STATUS_SUCCESS(wlan_vdev_is_up(vdev));
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_MAC_ID);
|
||||
}
|
||||
|
||||
return is_up;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 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
|
||||
|
|
@ -550,6 +551,7 @@ static QDF_STATUS nan_handle_confirm(struct nan_datapath_confirm_event *confirm)
|
|||
struct wlan_objmgr_psoc *psoc;
|
||||
struct nan_psoc_priv_obj *psoc_nan_obj;
|
||||
struct nan_vdev_priv_obj *vdev_nan_obj;
|
||||
struct wlan_objmgr_peer *peer;
|
||||
|
||||
vdev_id = wlan_vdev_get_id(confirm->vdev);
|
||||
psoc = wlan_vdev_get_psoc(confirm->vdev);
|
||||
|
|
@ -558,6 +560,15 @@ static QDF_STATUS nan_handle_confirm(struct nan_datapath_confirm_event *confirm)
|
|||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
peer = wlan_objmgr_get_peer_by_mac(psoc,
|
||||
confirm->peer_ndi_mac_addr.bytes,
|
||||
WLAN_NAN_ID);
|
||||
if (!peer) {
|
||||
nan_debug("Drop NDP confirm as peer isn't available");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
wlan_objmgr_peer_release_ref(peer, WLAN_NAN_ID);
|
||||
|
||||
psoc_nan_obj = nan_get_psoc_priv_obj(psoc);
|
||||
if (!psoc_nan_obj) {
|
||||
nan_err("psoc_nan_obj is null");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 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
|
||||
|
|
@ -50,6 +51,11 @@ static QDF_STATUS lim_add_ndi_peer(struct mac_context *mac_ctx,
|
|||
QDF_STATUS status;
|
||||
uint8_t zero_mac_addr[QDF_MAC_ADDR_SIZE] = { 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
if (!wlan_is_vdev_id_up(mac_ctx->pdev, vdev_id)) {
|
||||
pe_err_rl("NDI vdev is not up");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
if (!qdf_mem_cmp(&zero_mac_addr, &peer_mac_addr.bytes[0],
|
||||
QDF_MAC_ADDR_SIZE)) {
|
||||
pe_err("Failing to add peer with all zero mac addr");
|
||||
|
|
|
|||
Loading…
Reference in a new issue