mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
qcacmn: Delete WIN only files from cmn_dev
WIN DFS only files are moved from cmn_dev to qca-wifi-oss Change-Id: I597386caf00992b82e8ce52c65a6e82395119aa4 CRs-Fixed: 2330709
This commit is contained in:
parent
628dfd3422
commit
4fdc754bca
3 changed files with 0 additions and 1891 deletions
|
|
@ -1,316 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2013, 2016-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2002-2010, Atheros Communications Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: This file contains now obsolete code which used to implement AR
|
||||
* (Adaptive Radio) feature for older chipsets.
|
||||
*/
|
||||
|
||||
#include "../dfs.h"
|
||||
|
||||
#define UPDATE_TOP_THREE_PEAKS(_histo, _peakPtrList, _currWidth) \
|
||||
do { \
|
||||
if ((_histo)[(_peakPtrList)[0]] < (_histo)[(_currWidth)]) { \
|
||||
(_peakPtrList)[2] = \
|
||||
(_currWidth != (_peakPtrList)[1]) ? \
|
||||
(_peakPtrList)[1] : (_peakPtrList)[2]; \
|
||||
(_peakPtrList)[1] = (_peakPtrList)[0]; \
|
||||
(_peakPtrList)[0] = (_currWidth); \
|
||||
} else if ((_currWidth != (_peakPtrList)[0]) \
|
||||
&& ((_histo)[(_peakPtrList)[1]] < \
|
||||
(_histo)[(_currWidth)])) { \
|
||||
(_peakPtrList)[2] = (_peakPtrList)[1]; \
|
||||
(_peakPtrList)[1] = (_currWidth); \
|
||||
} else if ((_currWidth != (_peakPtrList)[1]) \
|
||||
&& (_currWidth != (_peakPtrList)[0]) \
|
||||
&& ((_histo)[(_peakPtrList)[2]] < \
|
||||
(_histo)[(_currWidth)])) { \
|
||||
(_peakPtrList)[2] = (_currWidth); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
void dfs_process_ar_event(struct wlan_dfs *dfs,
|
||||
struct dfs_channel *chan)
|
||||
{
|
||||
struct dfs_ar_state *ar;
|
||||
struct dfs_event *re = NULL;
|
||||
uint32_t sumpeak = 0, numpeaks = 0;
|
||||
uint32_t rssi = 0, width = 0;
|
||||
uint32_t origregionsum = 0, i = 0;
|
||||
uint16_t thistimestamp;
|
||||
int empty;
|
||||
|
||||
if (!dfs) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
ar = (struct dfs_ar_state *) &(dfs->dfs_ar_state);
|
||||
WLAN_ARQ_LOCK(dfs);
|
||||
empty = STAILQ_EMPTY(&(dfs->dfs_arq));
|
||||
WLAN_ARQ_UNLOCK(dfs);
|
||||
while (!empty) {
|
||||
WLAN_ARQ_LOCK(dfs);
|
||||
re = STAILQ_FIRST(&(dfs->dfs_arq));
|
||||
if (re != NULL)
|
||||
STAILQ_REMOVE_HEAD(&(dfs->dfs_arq), re_list);
|
||||
WLAN_ARQ_UNLOCK(dfs);
|
||||
if (!re)
|
||||
return;
|
||||
|
||||
thistimestamp = re->re_ts;
|
||||
rssi = re->re_rssi;
|
||||
width = re->re_dur;
|
||||
|
||||
/* Return the dfs event to the free event list. */
|
||||
qdf_mem_zero(re, sizeof(struct dfs_event));
|
||||
WLAN_DFSEVENTQ_LOCK(dfs);
|
||||
STAILQ_INSERT_TAIL(&(dfs->dfs_eventq), re, re_list);
|
||||
WLAN_DFSEVENTQ_UNLOCK(dfs);
|
||||
|
||||
/*
|
||||
* Determine if current radar is an extension of previous
|
||||
* radar.
|
||||
*/
|
||||
if (ar->ar_prevwidth == 255) {
|
||||
/*
|
||||
* Tag on previous width for consideraion of low data
|
||||
* rate ACKs.
|
||||
*/
|
||||
ar->ar_prevwidth += width;
|
||||
width = (width == 255) ? 255 : ar->ar_prevwidth;
|
||||
} else if ((width == 255) &&
|
||||
(ar->ar_prevwidth == 510 ||
|
||||
ar->ar_prevwidth == 765 ||
|
||||
ar->ar_prevwidth == 1020)) {
|
||||
/*
|
||||
* Aggregate up to 5 consecuate max radar widths to
|
||||
* consider 11Mbps long preamble 1500-byte pkts.
|
||||
*/
|
||||
ar->ar_prevwidth += width;
|
||||
} else if (ar->ar_prevwidth == 1275 && width != 255) {
|
||||
/* Found 5th consecute maxed out radar, reset history */
|
||||
width += ar->ar_prevwidth;
|
||||
ar->ar_prevwidth = 0;
|
||||
} else if (ar->ar_prevwidth > 255) {
|
||||
/*
|
||||
* Ignore if there are less than 5 consecutive maxed
|
||||
* out radars.
|
||||
*/
|
||||
ar->ar_prevwidth = width;
|
||||
width = 255;
|
||||
} else {
|
||||
ar->ar_prevwidth = width;
|
||||
}
|
||||
|
||||
/*
|
||||
* For ignoring noises with radar duration in ranges
|
||||
* of 3-30: AP4x. Region 7 - 5.5Mbps (long pre)
|
||||
* ACK = 270 = 216 us.
|
||||
*/
|
||||
if ((width >= 257 && width <= 278) ||
|
||||
/*
|
||||
* Region 8 - 2Mbps (long pre)
|
||||
* ACKC = 320 = 256us.
|
||||
*/
|
||||
(width >= 295 && width <= 325) ||
|
||||
(width >= 1280 && width <= 1300)) {
|
||||
uint16_t wraparoundadj = 0;
|
||||
uint16_t base = (width >= 1280) ? 1275 : 255;
|
||||
|
||||
if (thistimestamp < ar->ar_prevtimestamp)
|
||||
wraparoundadj = 32768;
|
||||
|
||||
if ((thistimestamp + wraparoundadj -
|
||||
ar->ar_prevtimestamp) != (width - base))
|
||||
width = 1;
|
||||
}
|
||||
if (width <= 10) {
|
||||
WLAN_ARQ_LOCK(dfs);
|
||||
empty = STAILQ_EMPTY(&(dfs->dfs_arq));
|
||||
WLAN_ARQ_UNLOCK(dfs);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Overloading the width=2 in: Store a count of
|
||||
* radars w/max duration and high RSSI (not noise)
|
||||
*/
|
||||
if ((width == 255) && (rssi > DFS_AR_RSSI_THRESH_STRONG_PKTS))
|
||||
width = 2;
|
||||
|
||||
/*
|
||||
* Overloading the width=3 bin:
|
||||
* Double and store a count of rdars of durtaion that matches
|
||||
* 11Mbps (long preamble) TCP ACKs or 1500-byte data packets.
|
||||
*/
|
||||
if ((width >= 1280 && width <= 1300) ||
|
||||
(width >= 318 && width <= 325)) {
|
||||
width = 3;
|
||||
ar->ar_phyerrcount[3] += 2;
|
||||
ar->ar_acksum += 2;
|
||||
}
|
||||
|
||||
/* Build histogram of radar duration. */
|
||||
if (width > 0 && width <= 510)
|
||||
ar->ar_phyerrcount[width]++;
|
||||
else {
|
||||
/* Invalid radar width, throw it away. */
|
||||
WLAN_ARQ_LOCK(dfs);
|
||||
empty = STAILQ_EMPTY(&(dfs->dfs_arq));
|
||||
WLAN_ARQ_UNLOCK(dfs);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Received radar of interest (i.e., signature match),
|
||||
* proceed to check if there is enough neighboring
|
||||
* traffic to drop out of Turbo.
|
||||
*/
|
||||
/* Region 0: 24Mbps ACK = 35 = 28us */
|
||||
if ((width >= REG0_MIN_WIDTH && width <= REG0_MAX_WIDTH) ||
|
||||
/* Region 1: 12Mbps ACK = 40 = 32us */
|
||||
(width >= REG1_MIN_WIDTH && width <= REG1_MAX_WIDTH) ||
|
||||
/* Region 2: 6Mbps ACK = 55 = 44us */
|
||||
(width >= REG2_MIN_WIDTH && width <= REG2_MAX_WIDTH) ||
|
||||
/* Region 3: 11Mbps ACK = 135 = 108us */
|
||||
(width >= REG3_MIN_WIDTH && width <= REG3_MAX_WIDTH) ||
|
||||
/* Region 4: 5.5Mbps ACK = 150 = 120us */
|
||||
(width >= REG4_MIN_WIDTH && width <= REG4_MAX_WIDTH) ||
|
||||
/* Region 5: 2Mbps ACK = 200 = 160us */
|
||||
(width >= REG5_MIN_WIDTH && width <= REG5_MAX_WIDTH) ||
|
||||
/* Region 6: 1Mbps ACK = 400 = 320us */
|
||||
(width >= REG6_MIN_WIDTH && width <= REG6_MAX_WIDTH) ||
|
||||
/* Region 7: 5.5Mbps (Long Pre) ACK = 270 = 216us. */
|
||||
(width >= REG7_MIN_WIDTH && width <= REG7_MAX_WIDTH) ||
|
||||
/* Region 8: 2Mbps (Long Pre) ACK = 320 = 256us. */
|
||||
(width >= REG8_MIN_WIDTH && width <= REG8_MAX_WIDTH) ||
|
||||
/*
|
||||
* Ignoring Region 9 due to overlap with 255 which is
|
||||
* same as board noise.
|
||||
*/
|
||||
/* Region 9: 11Mbps (Long Pre) ACK = 255 = 204us. */
|
||||
(width == 3)) {
|
||||
ar->ar_acksum++;
|
||||
/*
|
||||
* Double the count for strong radars that match
|
||||
* one of the ACK signatures.
|
||||
*/
|
||||
if (rssi > DFS_AR_RSSI_DOUBLE_THRESHOLD) {
|
||||
ar->ar_phyerrcount[width]++;
|
||||
ar->ar_acksum++;
|
||||
}
|
||||
UPDATE_TOP_THREE_PEAKS(ar->ar_phyerrcount,
|
||||
ar->ar_peaklist, width);
|
||||
/* Sum the counts of these peaks. */
|
||||
numpeaks = DFS_AR_MAX_NUM_PEAKS;
|
||||
origregionsum = ar->ar_acksum;
|
||||
for (i = 0; i < DFS_AR_MAX_NUM_PEAKS; i++) {
|
||||
if (ar->ar_peaklist[i] > 0) {
|
||||
if ((i == 0) &&
|
||||
(ar->ar_peaklist[i] == 3) &&
|
||||
(ar->ar_phyerrcount[3] <
|
||||
ar->ar_phyerrcount[2]) &&
|
||||
(ar->ar_phyerrcount[3] > 6)) {
|
||||
/*
|
||||
* If the top peak is one that
|
||||
* matches the 11Mbps long
|
||||
* preamble TCP Ack/1500-byte
|
||||
* data, include the count for
|
||||
* radars that hav emax duration
|
||||
* and high rssi (width = 2) to
|
||||
* boost the sum for the PAR
|
||||
* test that follows.
|
||||
*/
|
||||
sumpeak +=
|
||||
(ar->ar_phyerrcount[2] +
|
||||
ar->ar_phyerrcount[3]);
|
||||
ar->ar_acksum +=
|
||||
(ar->ar_phyerrcount[2] +
|
||||
ar->ar_phyerrcount[3]);
|
||||
} else {
|
||||
sumpeak += ar->ar_phyerrcount[
|
||||
ar->ar_peaklist[i]];
|
||||
}
|
||||
} else
|
||||
numpeaks--;
|
||||
}
|
||||
/*
|
||||
* If sum of patterns matches exceeds packet threshold,
|
||||
* perform comparison between peak-to-avg ratio against
|
||||
* parThreshold.
|
||||
*/
|
||||
if ((ar->ar_acksum > ar->ar_packetthreshold) &&
|
||||
((sumpeak * DFS_AR_REGION_WIDTH) >
|
||||
(ar->ar_parthreshold * numpeaks *
|
||||
ar->ar_acksum))) {
|
||||
/*
|
||||
* Neighboring traffic detected, get out of
|
||||
* Turbo.
|
||||
*/
|
||||
chan->dfs_ch_flagext |= CHANNEL_INTERFERENCE;
|
||||
qdf_mem_zero(ar->ar_peaklist,
|
||||
sizeof(ar->ar_peaklist));
|
||||
ar->ar_acksum = 0;
|
||||
qdf_mem_zero(ar->ar_phyerrcount,
|
||||
sizeof(ar->ar_phyerrcount));
|
||||
} else {
|
||||
/*
|
||||
* Reset sum of matches to discount the count
|
||||
* of strong radars with max duration.
|
||||
*/
|
||||
ar->ar_acksum = origregionsum;
|
||||
}
|
||||
}
|
||||
ar->ar_prevtimestamp = thistimestamp;
|
||||
WLAN_ARQ_LOCK(dfs);
|
||||
empty = STAILQ_EMPTY(&(dfs->dfs_arq));
|
||||
WLAN_ARQ_UNLOCK(dfs);
|
||||
}
|
||||
}
|
||||
|
||||
void dfs_reset_ar(struct wlan_dfs *dfs)
|
||||
{
|
||||
if (!dfs) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_mem_zero(&dfs->dfs_ar_state, sizeof(dfs->dfs_ar_state));
|
||||
dfs->dfs_ar_state.ar_packetthreshold = DFS_AR_PKT_COUNT_THRESH;
|
||||
dfs->dfs_ar_state.ar_parthreshold = DFS_AR_ACK_DETECT_PAR_THRESH;
|
||||
}
|
||||
|
||||
void dfs_reset_arq(struct wlan_dfs *dfs)
|
||||
{
|
||||
struct dfs_event *event;
|
||||
|
||||
if (!dfs) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
WLAN_ARQ_LOCK(dfs);
|
||||
WLAN_DFSEVENTQ_LOCK(dfs);
|
||||
while (!STAILQ_EMPTY(&(dfs->dfs_arq))) {
|
||||
event = STAILQ_FIRST(&(dfs->dfs_arq));
|
||||
STAILQ_REMOVE_HEAD(&(dfs->dfs_arq), re_list);
|
||||
qdf_mem_zero(event, sizeof(struct dfs_event));
|
||||
STAILQ_INSERT_TAIL(&(dfs->dfs_eventq), event, re_list);
|
||||
}
|
||||
WLAN_DFSEVENTQ_UNLOCK(dfs);
|
||||
WLAN_ARQ_UNLOCK(dfs);
|
||||
}
|
||||
|
|
@ -1,345 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: This file has ETSI CAC DFS functions.
|
||||
* Summary: In ETSI domain, after CAC, channel is added to ETSI CAC cleared
|
||||
* list, so that next time it can skip CAC if channel already present in this
|
||||
* list. If radar found, remove channel from this list indicating to redo
|
||||
* CAC,when channel is selected in future.
|
||||
*/
|
||||
|
||||
#include "../dfs_etsi_precac.h"
|
||||
#include "wlan_dfs_lmac_api.h"
|
||||
#include "wlan_dfs_mlme_api.h"
|
||||
#include "wlan_dfs_utils_api.h"
|
||||
#include "../dfs_internal.h"
|
||||
#include "../dfs_process_radar_found_ind.h"
|
||||
|
||||
#define ETSI_CAC_TIME_OUT_MS 86400000
|
||||
int dfs_is_subchan_in_etsi_precac_done_list(struct wlan_dfs *dfs,
|
||||
uint8_t channel)
|
||||
{
|
||||
struct dfs_etsi_precac_entry *precac_entry = NULL;
|
||||
struct dfs_etsi_precac_entry *tmp_precac_entry = NULL;
|
||||
uint8_t found = 0;
|
||||
uint32_t diff_ms;
|
||||
|
||||
if (utils_is_dfs_ch(dfs->dfs_pdev_obj, channel)) {
|
||||
/*For each channel in the list here do the below operation*/
|
||||
PRECAC_LIST_LOCK(dfs);
|
||||
if (TAILQ_EMPTY(&dfs->dfs_etsiprecac_done_list)) {
|
||||
PRECAC_LIST_UNLOCK(dfs);
|
||||
return 0;
|
||||
}
|
||||
|
||||
TAILQ_FOREACH_SAFE(precac_entry, &dfs->dfs_etsiprecac_done_list,
|
||||
pe_list, tmp_precac_entry) {
|
||||
diff_ms = qdf_system_ticks_to_msecs(qdf_system_ticks() -
|
||||
precac_entry->etsi_caclst_ticks);
|
||||
if (channel == precac_entry->ieee &&
|
||||
diff_ms < ETSI_CAC_TIME_OUT_MS) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
PRECAC_LIST_UNLOCK(dfs);
|
||||
if (found)
|
||||
return 1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool dfs_is_etsi_precac_done(struct wlan_dfs *dfs)
|
||||
{
|
||||
bool ret_val = 1;
|
||||
uint8_t channels[NUM_CHANNELS_160MHZ];
|
||||
uint8_t nchannels = 0;
|
||||
int i;
|
||||
|
||||
nchannels = dfs_get_bonding_channels_without_seg_info(dfs->dfs_curchan,
|
||||
channels);
|
||||
|
||||
for (i = 0; i < nchannels; i++) {
|
||||
if (dfs_is_subchan_in_etsi_precac_done_list(dfs, channels[i])) {
|
||||
continue;
|
||||
} else {
|
||||
ret_val = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
dfs_debug(dfs, WLAN_DEBUG_DFS, "ret_val = %d", ret_val);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
void dfs_mark_etsi_precac_dfs(struct wlan_dfs *dfs, uint8_t *channels,
|
||||
uint8_t num_channels)
|
||||
{
|
||||
struct dfs_etsi_precac_entry *precac_entry = NULL;
|
||||
struct dfs_etsi_precac_entry *tmp_precac_entry = NULL;
|
||||
int i = 0;
|
||||
|
||||
if (num_channels > NUM_CHANNELS_160MHZ) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS,
|
||||
"Invalid num channels: %d", num_channels);
|
||||
return;
|
||||
}
|
||||
|
||||
PRECAC_LIST_LOCK(dfs);
|
||||
for (i = 0; i < num_channels; i++) {
|
||||
TAILQ_FOREACH_SAFE(precac_entry, &dfs->dfs_etsiprecac_done_list,
|
||||
pe_list, tmp_precac_entry) {
|
||||
if (channels[i] != precac_entry->ieee)
|
||||
continue;
|
||||
|
||||
TAILQ_REMOVE(&dfs->dfs_etsiprecac_done_list,
|
||||
precac_entry, pe_list);
|
||||
TAILQ_INSERT_TAIL(&dfs->dfs_etsiprecac_required_list,
|
||||
precac_entry, pe_list);
|
||||
}
|
||||
}
|
||||
PRECAC_LIST_UNLOCK(dfs);
|
||||
}
|
||||
|
||||
void dfs_init_etsi_precac_list(struct wlan_dfs *dfs)
|
||||
{
|
||||
u_int i;
|
||||
uint8_t found;
|
||||
struct dfs_etsi_precac_entry *tmp_precac_entry;
|
||||
int nchans = 0;
|
||||
struct dfs_channel *chan_list = NULL;
|
||||
|
||||
/*
|
||||
* We need to prepare list of unique VHT20 center frequencies.
|
||||
* But at the beginning we do not know how many unique frequencies
|
||||
* are present. Therefore, we calculate the MAX size and allocate
|
||||
* a temporary list/array. However we fill the temporary array with
|
||||
* unique frequencies and copy the unique list of frequencies to
|
||||
* the final list with exact size.
|
||||
*/
|
||||
TAILQ_INIT(&dfs->dfs_etsiprecac_done_list);
|
||||
TAILQ_INIT(&dfs->dfs_etsiprecac_required_list);
|
||||
|
||||
nchans = dfs_get_num_chans();
|
||||
|
||||
chan_list = qdf_mem_malloc(nchans * sizeof(*chan_list));
|
||||
if (!chan_list)
|
||||
return;
|
||||
|
||||
utils_dfs_get_chan_list(dfs->dfs_pdev_obj, (void *)chan_list, &nchans);
|
||||
if (!nchans) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "zero channels");
|
||||
qdf_mem_free(chan_list);
|
||||
return;
|
||||
}
|
||||
|
||||
PRECAC_LIST_LOCK(dfs);
|
||||
for (i = 0; i < nchans; i++) {
|
||||
if (!WLAN_IS_CHAN_DFS(&chan_list[i]))
|
||||
continue;
|
||||
|
||||
found = 0;
|
||||
TAILQ_FOREACH(tmp_precac_entry,
|
||||
&dfs->dfs_etsiprecac_required_list,
|
||||
pe_list) {
|
||||
if (tmp_precac_entry->ieee ==
|
||||
chan_list[i].dfs_ch_ieee) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
struct dfs_etsi_precac_entry *etsi_precac_entry;
|
||||
|
||||
etsi_precac_entry = qdf_mem_malloc(
|
||||
sizeof(*etsi_precac_entry));
|
||||
if (!etsi_precac_entry) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"etsi precac entry alloc fail");
|
||||
continue;
|
||||
}
|
||||
etsi_precac_entry->ieee = chan_list[i].dfs_ch_ieee;
|
||||
etsi_precac_entry->dfs = dfs;
|
||||
TAILQ_INSERT_TAIL(&dfs->dfs_etsiprecac_required_list,
|
||||
etsi_precac_entry, pe_list);
|
||||
}
|
||||
}
|
||||
PRECAC_LIST_UNLOCK(dfs);
|
||||
|
||||
dfs_debug(dfs, WLAN_DEBUG_DFS,
|
||||
"Print the list of VHT20 frequencies from linked list");
|
||||
TAILQ_FOREACH(tmp_precac_entry,
|
||||
&dfs->dfs_etsiprecac_required_list,
|
||||
pe_list)
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS, "ieee=%u", tmp_precac_entry->ieee);
|
||||
|
||||
qdf_mem_free(chan_list);
|
||||
}
|
||||
|
||||
void dfs_deinit_etsi_precac_list(struct wlan_dfs *dfs)
|
||||
{
|
||||
struct dfs_etsi_precac_entry *tmp_precac_entry, *precac_entry;
|
||||
|
||||
dfs_debug(dfs, WLAN_DEBUG_DFS,
|
||||
"Free list of HT20/VHT20 freq from etsiprecac_required list");
|
||||
PRECAC_LIST_LOCK(dfs);
|
||||
|
||||
if (!TAILQ_EMPTY(&dfs->dfs_etsiprecac_required_list))
|
||||
TAILQ_FOREACH_SAFE(precac_entry,
|
||||
&dfs->dfs_etsiprecac_required_list,
|
||||
pe_list,
|
||||
tmp_precac_entry) {
|
||||
TAILQ_REMOVE(&dfs->dfs_etsiprecac_required_list,
|
||||
precac_entry, pe_list);
|
||||
qdf_mem_free(precac_entry);
|
||||
}
|
||||
|
||||
dfs_debug(dfs, WLAN_DEBUG_DFS,
|
||||
"Free list of HT20/VHT20 freq from etsipcac_done list");
|
||||
|
||||
if (!TAILQ_EMPTY(&dfs->dfs_etsiprecac_done_list))
|
||||
TAILQ_FOREACH_SAFE(precac_entry,
|
||||
&dfs->dfs_etsiprecac_done_list,
|
||||
pe_list,
|
||||
tmp_precac_entry) {
|
||||
TAILQ_REMOVE(&dfs->dfs_etsiprecac_done_list,
|
||||
precac_entry, pe_list);
|
||||
qdf_mem_free(precac_entry);
|
||||
}
|
||||
|
||||
PRECAC_LIST_UNLOCK(dfs);
|
||||
}
|
||||
|
||||
void dfs_etsi_precac_attach(struct wlan_dfs *dfs)
|
||||
{
|
||||
}
|
||||
|
||||
void dfs_etsi_precac_detach(struct wlan_dfs *dfs)
|
||||
{
|
||||
dfs_deinit_etsi_precac_list(dfs);
|
||||
}
|
||||
|
||||
void dfs_print_etsi_precaclists(struct wlan_dfs *dfs)
|
||||
{
|
||||
struct dfs_etsi_precac_entry *tmp_precac_entry;
|
||||
|
||||
if (!dfs) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
PRECAC_LIST_LOCK(dfs);
|
||||
/* Print the ETSI Pre-CAC required List */
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"Pre-cac-required list of VHT20 frequencies");
|
||||
TAILQ_FOREACH(tmp_precac_entry,
|
||||
&dfs->dfs_etsiprecac_required_list,
|
||||
pe_list) {
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"ieee=%u ", tmp_precac_entry->ieee);
|
||||
}
|
||||
|
||||
/* Print the ETSI Pre-CAC done List */
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"Pre-cac-done list of VHT20 frequencies");
|
||||
TAILQ_FOREACH(tmp_precac_entry,
|
||||
&dfs->dfs_etsiprecac_done_list,
|
||||
pe_list) {
|
||||
unsigned long time_added =
|
||||
qdf_system_ticks_to_msecs(
|
||||
tmp_precac_entry->etsi_caclst_ticks);
|
||||
|
||||
dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
|
||||
"ieee=%u added at (msec): %lu", tmp_precac_entry->ieee,
|
||||
time_added);
|
||||
}
|
||||
PRECAC_LIST_UNLOCK(dfs);
|
||||
}
|
||||
|
||||
void dfs_reset_etsiprecaclists(struct wlan_dfs *dfs)
|
||||
{
|
||||
dfs_debug(dfs, WLAN_DEBUG_DFS,
|
||||
"Reset precaclist of VHT80 frequencies");
|
||||
dfs_deinit_etsi_precac_list(dfs);
|
||||
dfs_init_etsi_precac_list(dfs);
|
||||
}
|
||||
|
||||
void dfs_reset_etsi_precac_lists(struct wlan_dfs *dfs)
|
||||
{
|
||||
if (!dfs) {
|
||||
dfs_err(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs is NULL");
|
||||
return;
|
||||
}
|
||||
dfs_reset_etsiprecaclists(dfs);
|
||||
}
|
||||
|
||||
int dfs_add_chan_to_etsi_done_list(struct wlan_dfs *dfs, uint8_t channel)
|
||||
{
|
||||
struct dfs_etsi_precac_entry *precac_entry, *tmp_precac_entry;
|
||||
|
||||
PRECAC_LIST_LOCK(dfs);
|
||||
TAILQ_FOREACH_SAFE(precac_entry,
|
||||
&dfs->dfs_etsiprecac_required_list,
|
||||
pe_list, tmp_precac_entry) {
|
||||
if (channel == precac_entry->ieee) {
|
||||
TAILQ_REMOVE(&dfs->dfs_etsiprecac_required_list,
|
||||
precac_entry, pe_list);
|
||||
TAILQ_INSERT_TAIL(&dfs->dfs_etsiprecac_done_list,
|
||||
precac_entry,
|
||||
pe_list);
|
||||
precac_entry->etsi_caclst_ticks = qdf_system_ticks();
|
||||
PRECAC_LIST_UNLOCK(dfs);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
PRECAC_LIST_UNLOCK(dfs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void dfs_add_to_etsi_precac_done_list(struct wlan_dfs *dfs)
|
||||
{
|
||||
uint8_t channels[NUM_CHANNELS_160MHZ];
|
||||
uint8_t nchannels = 0;
|
||||
int i = 0;
|
||||
|
||||
nchannels = dfs_get_bonding_channels_without_seg_info(dfs->dfs_curchan,
|
||||
channels);
|
||||
for (i = 0; i < nchannels; i++) {
|
||||
if (!utils_is_dfs_ch(dfs->dfs_pdev_obj, channels[i]))
|
||||
continue;
|
||||
|
||||
if (TAILQ_EMPTY(&dfs->dfs_etsiprecac_required_list))
|
||||
break;
|
||||
|
||||
dfs_add_chan_to_etsi_done_list(dfs, channels[i]);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue