qcacmn: Add API to check Do Not Break Stream eligibility

1) Adds new policy mgr API 'policy_mgr_is_chan_ok_for_dnbs' to check
if a channel is OK for "Do Not Break Stream".
It means that if Do_Not_Switch_Channel is set for AP/GO vdev,
the channel passed should be either the AP/GO channel or a channel
from the other band.
2) Adds a new function policy_mgr_get_mode_specific_conn_info() to get
the mode specific connection count.

Change-Id: I4da6f7d56d01b01761a5f3557b8acbb84226a6fd
CRs-Fixed: 2037302
This commit is contained in:
Ajit Pal Singh
2017-04-17 16:49:01 +05:30
committed by snandini
vanhempi 0c5110a424
commit ec973b0aa7
5 muutettua tiedostoa jossa 192 lisäystä ja 6 poistoa

Näytä tiedosto

@@ -34,6 +34,7 @@
#include <wlan_cfg80211_scan.h>
#include <qdf_mem.h>
#include <wlan_utility.h>
#include <wlan_policy_mgr_api.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
static uint32_t hdd_config_sched_scan_start_delay(
@@ -945,10 +946,35 @@ int wlan_cfg80211_scan(struct wlan_objmgr_pdev *pdev,
if (request->n_channels) {
char chl[(request->n_channels * 5) + 1];
int len = 0;
bool ap_or_go_present =
policy_mgr_mode_specific_connection_count(
psoc, QDF_SAP_MODE, NULL) ||
policy_mgr_mode_specific_connection_count(
psoc, QDF_P2P_GO_MODE, NULL);
for (i = 0; i < request->n_channels; i++) {
channel = request->channels[i]->hw_value;
if (wlan_is_dsrc_channel(wlan_chan_to_freq(channel)))
continue;
if (ap_or_go_present) {
bool ok;
int ret;
ret = policy_mgr_is_chan_ok_for_dnbs(psoc,
channel,
&ok);
if (QDF_IS_STATUS_ERROR(ret)) {
cfg80211_err("DNBS check failed");
qdf_mem_free(req);
status = -EINVAL;
goto end;
}
if (!ok)
continue;
}
len += snprintf(chl + len, 5, "%d ", channel);
req->scan_req.chan_list[i] = wlan_chan_to_freq(channel);
num_chan++;
@@ -1296,4 +1322,3 @@ void wlan_cfg80211_inform_bss_frame(struct wlan_objmgr_pdev *pdev,
frame_len, rssi, GFP_KERNEL);
qdf_mem_free(mgmt);
}