qcacld-3.0: Pick a valid channel for NDI start

Currently, NAN 5GHz social channel 44(5220) is picked to start
the BSS for NDI if 5GHz band is supported. But the channel
might get disabled due to regulatory constraints or
user/applications might also disable based on the usecase.
NDI fails to start in such cases.
Pick a valid channel to start the BSS and give preference to
NAN social channels.
Also, don't allow NDI start when NAN discovery is not enabled
to avoid issues due to DBS incase if NDI to be started in
a 2.4GHz channel.

Change-Id: I562d0f4f6a425ad7fb4cd043e696d3d573854b3b
CRs-Fixed: 3068545
This commit is contained in:
Srinivas Dasari
2021-11-02 23:41:18 +05:30
committed by Madan Koyyalamudi
부모 df37a6ab38
커밋 63b110484e
2개의 변경된 파일141개의 추가작업 그리고 27개의 파일을 삭제

파일 보기

@@ -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
@@ -1055,6 +1056,16 @@ int os_if_nan_process_ndp_cmd(struct wlan_objmgr_psoc *psoc,
switch (ndp_cmd_type) {
case QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_CREATE:
/**
* NDI creation is not allowed if NAN discovery is not running.
* Allowing NDI creation when NAN discovery is not enabled may
* lead to issues if NDI has to be started in a
* 2GHz channel and if the target is not operating in DBS mode.
*/
if (!ucfg_is_nan_disc_active(psoc)) {
osif_err("NDI creation is not allowed when NAN discovery is not running");
return -EOPNOTSUPP;
}
return os_if_nan_process_ndi_create(psoc, tb);
case QCA_WLAN_VENDOR_ATTR_NDP_INTERFACE_DELETE:
return os_if_nan_process_ndi_delete(psoc, tb);