Merge "qca-wifi: Use agile width to calculate desired RCAC channel"
diff --git a/direct_attach/umac/dfs/core/src/filtering/ar5212_radar.c b/direct_attach/umac/dfs/core/src/filtering/ar5212_radar.c
deleted file mode 100644
index f4e3207..0000000
--- a/direct_attach/umac/dfs/core/src/filtering/ar5212_radar.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Copyright (c) 2011, 2016-2018 The Linux Foundation. All rights reserved.
- * Copyright (c) 2002-2005 Atheros Communications, Inc.
- * Copyright (c) 2008-2010, Atheros Communications 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
- * 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 has the radar table for AR5212 chipset and function to
- * initialize the radar table.
- */
-#include "dfs.h"
-#include "dfs_internal.h"
-#include "wlan_dfs_utils_api.h"
-
-/* Default 5212/5312 radar phy parameters. */
-#define AR5212_DFS_FIRPWR -41
-#define AR5212_DFS_RRSSI 12
-#define AR5212_DFS_HEIGHT 20
-#define AR5212_DFS_PRSSI 22
-#define AR5212_DFS_INBAND 6
-
-/**
- * struct dfs_pulse ar5212_etsi_radars - ETSI radar pulse table for
- * AR5212 chipset.
- */
-struct dfs_pulse ar5212_etsi_radars[] = {
- /* EN 302 502 frequency hopping pulse */
- /* PRF 3000, 1us duration, 9 pulses per burst */
- {9, 1, 3000, 3000, 1, 4, 5, 0, 1, 18, 0, 0, 1, 1000, 0, 40},
- /* PRF 4500, 20us duration, 9 pulses per burst */
- {9, 20, 4500, 4500, 1, 4, 5, 19, 21, 18, 0, 0, 1, 1000, 0, 41},
-
- /* TYPE 1 */
- {10, 2, 750, 0, 24, 50, 0, 2, 22, 0, 3, 0, 0},
-
- /* TYPE 2 */
- {7, 2, 200, 0, 24, 50, 0, 2, 22, 0, 3, 0, 1},
- {7, 2, 300, 0, 24, 50, 0, 2, 22, 0, 3, 0, 2},
- {7, 2, 500, 0, 24, 50, 0, 2, 22, 1, 3, 0, 3},
- {7, 2, 800, 0, 24, 50, 0, 2, 22, 1, 3, 0, 4},
- {7, 2, 1001, 0, 24, 50, 0, 2, 22, 0, 3, 0, 5},
- {7, 8, 200, 0, 24, 50, 6, 9, 22, 8, 3, 0, 6},
- {7, 8, 300, 0, 24, 50, 6, 9, 22, 8, 3, 0, 7},
- {7, 8, 502, 0, 24, 50, 6, 9, 22, 0, 3, 0, 8},
- {7, 8, 805, 0, 24, 50, 6, 9, 22, 0, 3, 0, 9},
- {7, 8, 1008, 0, 24, 50, 6, 9, 22, 0, 3, 0, 10},
-
- /* TYPE 3 */
- {10, 14, 200, 0, 24, 50, 12, 15, 22, 14, 3, 0, 11},
- {10, 14, 300, 0, 24, 50, 12, 15, 22, 14, 3, 0, 12},
- {10, 14, 503, 0, 24, 50, 12, 15, 22, 2, 3, 0, 13},
- {10, 14, 809, 0, 24, 50, 12, 15, 22, 0, 3, 0, 14},
- {10, 14, 1014, 0, 24, 50, 12, 15, 22, 0, 3, 0, 15},
- {10, 18, 200, 0, 24, 50, 15, 19, 22, 18, 3, 0, 16},
- {10, 18, 301, 0, 24, 50, 15, 19, 22, 7, 3, 0, 17},
- {10, 18, 504, 0, 24, 50, 15, 19, 22, 2, 3, 0, 18},
- {10, 18, 811, 0, 24, 50, 15, 19, 22, 0, 3, 0, 19},
- {10, 18, 1018, 0, 24, 50, 15, 19, 22, 0, 3, 0, 20},
-
- /* TYPE 4 */
- {10, 2, 1200, 0, 24, 50, 0, 2, 22, 0, 3, 0, 21},
- {10, 2, 1500, 0, 24, 50, 0, 2, 22, 0, 3, 0, 22},
- {10, 2, 1600, 0, 24, 50, 0, 2, 22, 0, 3, 0, 23},
- {10, 8, 1212, 0, 24, 50, 6, 9, 22, 0, 3, 0, 24},
- {10, 8, 1517, 0, 24, 50, 6, 9, 22, 0, 3, 0, 25},
- {10, 8, 1620, 0, 24, 50, 6, 9, 22, 0, 3, 0, 26},
- {10, 14, 1221, 0, 24, 50, 12, 15, 22, 0, 3, 0, 27},
- {10, 14, 1531, 0, 24, 50, 12, 15, 22, 0, 3, 0, 28},
- {10, 14, 1636, 0, 24, 50, 12, 15, 22, 0, 3, 0, 29},
- {10, 18, 1226, 0, 24, 50, 15, 19, 22, 0, 3, 0, 30},
- {10, 18, 1540, 0, 24, 50, 15, 19, 22, 0, 3, 0, 31},
- {10, 18, 1647, 0, 24, 50, 15, 19, 22, 0, 3, 0, 32},
-
- /* TYPE 5 */
- {17, 2, 2305, 0, 24, 50, 0, 2, 22, 0, 3, 0, 33},
- {17, 2, 3009, 0, 24, 50, 0, 2, 22, 0, 3, 0, 34},
- {17, 2, 3512, 0, 24, 50, 0, 2, 22, 0, 3, 0, 35},
- {17, 2, 4016, 0, 24, 50, 0, 2, 22, 0, 3, 0, 36},
- {17, 8, 2343, 0, 24, 50, 6, 9, 22, 0, 3, 0, 37},
- {17, 8, 3073, 0, 24, 50, 6, 9, 22, 0, 3, 0, 38},
- {17, 8, 3601, 0, 24, 50, 6, 9, 22, 0, 3, 0, 39},
- {17, 8, 4132, 0, 24, 50, 6, 9, 22, 0, 3, 0, 40},
- {17, 14, 2376, 0, 24, 50, 12, 15, 22, 0, 3, 0, 41},
- {17, 14, 3131, 0, 24, 50, 12, 15, 22, 0, 3, 0, 42},
- {17, 14, 3680, 0, 24, 50, 12, 15, 22, 0, 3, 0, 43},
- {17, 14, 4237, 0, 24, 50, 12, 15, 22, 0, 3, 0, 44},
- {17, 18, 2399, 0, 24, 50, 15, 19, 22, 0, 3, 0, 45},
- {17, 18, 3171, 0, 24, 50, 15, 19, 22, 0, 3, 0, 46},
- {17, 18, 3735, 0, 24, 50, 15, 19, 22, 0, 3, 0, 47},
- {17, 18, 4310, 0, 24, 50, 15, 19, 22, 0, 3, 0, 48},
-
- /* TYPE 6 */
- {14, 22, 2096, 0, 24, 50, 21, 24, 22, 0, 3, 0, 49},
- {14, 22, 3222, 0, 24, 50, 21, 24, 22, 0, 3, 0, 50},
- {14, 22, 4405, 0, 24, 50, 21, 24, 22, 0, 3, 0, 51},
- {14, 32, 2146, 0, 24, 50, 30, 35, 22, 0, 3, 0, 52},
- {14, 32, 3340, 0, 24, 50, 30, 35, 22, 0, 3, 0, 53},
- {14, 32, 4629, 0, 24, 50, 30, 35, 22, 0, 3, 0, 54},
-};
-
-/**
- * struct dfs_pulse ar5212_fcc_radars - FCC radar pulse table for
- * AR5212 chipset.
- */
-struct dfs_pulse ar5212_fcc_radars[] = {
- /* following two filters are specific to Japan/MKK4 */
- {16, 2, 720, 6, 40, 0, 2, 18, 0, 3, 0, 30},
- {16, 3, 260, 6, 40, 0, 5, 18, 0, 3, 0, 31},
-
- /* following filters are common to both FCC and JAPAN */
- {9, 2, 3003, 6, 50, 0, 2, 18, 0, 0, 0, 29},
- {16, 2, 700, 6, 35, 0, 2, 18, 0, 3, 0, 28},
-
- {10, 3, 6666, 10, 90, 2, 3, 22, 0, 3, 0, 0},
- {10, 3, 5900, 10, 90, 2, 3, 22, 0, 3, 0, 1},
- {10, 3, 5200, 10, 90, 2, 3, 22, 0, 3, 0, 2},
- {10, 3, 4800, 10, 90, 2, 3, 22, 0, 3, 0, 3},
- {10, 3, 4400, 10, 90, 2, 3, 22, 0, 3, 0, 4},
- {10, 5, 6666, 50, 30, 3, 10, 22, 0, 3, 0, 5},
- {10, 5, 5900, 70, 30, 3, 10, 22, 0, 3, 0, 6},
- {10, 5, 5200, 70, 30, 3, 10, 22, 0, 3, 0, 7},
- {10, 5, 4800, 70, 30, 3, 10, 22, 0, 3, 0, 8},
- {10, 5, 4400, 50, 30, 3, 9, 22, 0, 3, 0, 9},
-
- {8, 10, 5000, 100, 40, 7, 17, 22, 0, 3, 0, 10},
- {8, 10, 3000, 100, 40, 7, 17, 22, 0, 3, 0, 11},
- {8, 10, 2000, 40, 40, 9, 17, 22, 0, 3, 0, 12},
- {8, 14, 5000, 100, 40, 13, 16, 22, 0, 3, 0, 13},
- {8, 14, 3000, 100, 40, 13, 16, 22, 0, 3, 0, 14},
- {8, 14, 2000, 40, 40, 13, 16, 22, 0, 3, 0, 15},
-
- {6, 10, 5000, 80, 40, 10, 15, 22, 0, 3, 0, 16},
- {6, 10, 3000, 80, 40, 10, 15, 22, 0, 3, 0, 17},
- {6, 10, 2000, 40, 40, 10, 15, 22, 0, 3, 0, 18},
- {6, 10, 5000, 80, 40, 10, 12, 22, 0, 3, 0, 19},
- {6, 10, 3000, 80, 40, 10, 12, 22, 0, 3, 0, 20},
- {6, 10, 2000, 40, 40, 10, 12, 22, 0, 3, 0, 21},
-
- {6, 18, 5000, 80, 40, 16, 25, 22, 0, 3, 0, 22},
- {6, 18, 3000, 80, 40, 16, 25, 22, 0, 3, 0, 23},
- {6, 18, 2000, 40, 40, 16, 25, 22, 0, 3, 0, 24},
-
- {6, 21, 5000, 80, 40, 12, 25, 22, 0, 3, 0, 25},
- {6, 21, 3000, 80, 40, 12, 25, 22, 0, 3, 0, 26},
- {6, 21, 2000, 40, 40, 12, 25, 22, 0, 3, 0, 27},
-};
-
-/**
- * struct dfs_bin5pulse ar5212_bin5pulses - BIN5 pulse for AR5212 chipset.
- */
-struct dfs_bin5pulse ar5212_bin5pulses[] = {
- {5, 52, 100, 12, 22, 3},
-};
-
-void dfs_get_radars_for_ar5212(struct wlan_dfs *dfs)
-{
- struct wlan_dfs_radar_tab_info rinfo;
- int dfsdomain = DFS_FCC_DOMAIN;
-
- qdf_mem_zero(&rinfo, sizeof(rinfo));
- dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
-
- switch (dfsdomain) {
- case DFS_FCC_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_FCC_DOMAIN_5212");
- rinfo.dfsdomain = DFS_FCC_DOMAIN;
- rinfo.dfs_radars = &ar5212_fcc_radars[2];
- rinfo.numradars = QDF_ARRAY_SIZE(ar5212_fcc_radars)-2;
- rinfo.b5pulses = &ar5212_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar5212_bin5pulses);
- break;
- case DFS_ETSI_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_ETSI_DOMAIN_5412");
- rinfo.dfsdomain = DFS_ETSI_DOMAIN;
-
- if (dfs_is_en302_502_applicable(dfs)) {
- rinfo.dfs_radars = ar5212_etsi_radars;
- rinfo.numradars = QDF_ARRAY_SIZE(ar5212_etsi_radars);
- } else {
- uint8_t offset = ETSI_LEGACY_PULSE_ARR_OFFSET;
-
- rinfo.dfs_radars = &ar5212_etsi_radars[offset];
- rinfo.numradars =
- QDF_ARRAY_SIZE(ar5212_etsi_radars) - offset;
- }
- rinfo.b5pulses = &ar5212_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar5212_bin5pulses);
- break;
- case DFS_MKK4_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_MKK4_DOMAIN_5412");
- rinfo.dfsdomain = DFS_MKK4_DOMAIN;
- rinfo.dfs_radars = &ar5212_fcc_radars[0];
- rinfo.numradars = QDF_ARRAY_SIZE(ar5212_fcc_radars);
- rinfo.b5pulses = &ar5212_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar5212_bin5pulses);
- break;
- default:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "No domain");
- return;
- }
-
- rinfo.dfs_defaultparams.pe_firpwr = AR5212_DFS_FIRPWR;
- rinfo.dfs_defaultparams.pe_rrssi = AR5212_DFS_RRSSI;
- rinfo.dfs_defaultparams.pe_height = AR5212_DFS_HEIGHT;
- rinfo.dfs_defaultparams.pe_prssi = AR5212_DFS_PRSSI;
- rinfo.dfs_defaultparams.pe_inband = AR5212_DFS_INBAND;
-
- WLAN_DFS_DATA_STRUCT_LOCK(dfs);
- dfs_init_radar_filters(dfs, &rinfo);
- WLAN_DFS_DATA_STRUCT_UNLOCK(dfs);
-}
diff --git a/direct_attach/umac/dfs/core/src/filtering/ar5416_radar.c b/direct_attach/umac/dfs/core/src/filtering/ar5416_radar.c
deleted file mode 100644
index 1c08a8c..0000000
--- a/direct_attach/umac/dfs/core/src/filtering/ar5416_radar.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Copyright (c) 2011, 2016-2018 The Linux Foundation. All rights reserved.
- * Copyright (c) 2002-2005 Atheros Communications, Inc.
- * Copyright (c) 2008-2010, Atheros Communications 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
- * 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 has the radar table for AR5416 chipset and function to
- * initialize the radar table.
- */
-
-#include "dfs.h"
-#include "dfs_internal.h"
-#include "wlan_dfs_utils_api.h"
-
-/* Default 5413/5416 radar phy parameters. */
-#define AR5416_DFS_FIRPWR -33
-#define AR5416_DFS_RRSSI 20
-#define AR5416_DFS_HEIGHT 10
-#define AR5416_DFS_PRSSI 15
-#define AR5416_DFS_INBAND 15
-#define AR5416_DFS_RELPWR 8
-#define AR5416_DFS_RELSTEP 12
-#define AR5416_DFS_MAXLEN 255
-
-/**
- * struct dfs_pulse ar5416_etsi_radars - ETSI radar pulse table for
- * AR5416 chipset.
- */
-struct dfs_pulse ar5416_etsi_radars[] = {
-
- /* EN 302 502 frequency hopping pulse */
- /* PRF 3000, 1us duration, 9 pulses per burst */
- {9, 1, 3000, 3000, 1, 4, 5, 0, 1, 18, 0, 0, 1, 1000, 0, 40},
- /* PRF 4500, 20us duration, 9 pulses per burst */
- {9, 20, 4500, 4500, 1, 4, 5, 19, 21, 18, 0, 0, 1, 1000, 0, 41},
-
- /* TYPE staggered pulse */
- /* 0.8-2us, 2-3 bursts,300-400 PRF, 10 pulses each */
- {20, 2, 300, 400, 2, 30, 4, 0, 2, 15, 0, 0, 0, 0, 0, 31},
- /* 0.8-2us, 2-3 bursts, 400-1200 PRF, 15 pulses each */
- {30, 2, 400, 1200, 2, 30, 7, 0, 2, 15, 0, 0, 0, 0, 0, 32},
-
- /* constant PRF based */
- /* 0.8-5us, 200 300 PRF, 10 pulses */
- {10, 5, 200, 400, 0, 24, 5, 0, 8, 18, 0, 0, 0, 0, 0, 33},
- {10, 5, 400, 600, 0, 24, 5, 0, 8, 18, 0, 0, 0, 0, 0, 37},
- {10, 5, 600, 800, 0, 24, 5, 0, 8, 18, 0, 0, 0, 0, 0, 38},
- {10, 5, 800, 1000, 0, 24, 5, 0, 8, 18, 0, 0, 0, 0, 0, 39},
-
- /* 0.8-15us, 200-1600 PRF, 15 pulses */
- {15, 15, 200, 1600, 0, 24, 6, 0, 18, 15, 0, 0, 0, 0, 0, 34},
-
- /* 0.8-15us, 2300-4000 PRF, 25 pulses*/
- {25, 15, 2300, 4000, 0, 24, 8, 0, 18, 15, 0, 0, 0, 0, 0, 35},
-
- /* 20-30us, 2000-4000 PRF, 20 pulses*/
- {20, 30, 2000, 4000, 0, 24, 8, 19, 33, 15, 0, 0, 0, 0, 0, 36},
-};
-
-/**
- * struct dfs_pulse ar5416_fcc_radars - FCC radar pulse table for
- * AR5416 chipset.
- */
-struct dfs_pulse ar5416_fcc_radars[] = {
- /* following two filters are specific to Japan/MKK4 */
- /* 1389 +/- 6 us */
- {18, 1, 720, 720, 0, 6, 6, 0, 1, 18, 0, 3, 0, 0, 0, 17},
- /* 4000 +/- 6 us */
- {18, 4, 250, 250, 0, 10, 5, 1, 6, 18, 0, 3, 0, 0, 0, 18},
- /* 3846 +/- 7 us */
- {18, 5, 260, 260, 0, 10, 6, 1, 6, 18, 0, 3, 0, 0, 0, 19},
-
- /* following filters are common to both FCC and JAPAN */
- /* FCC TYPE 1 */
- {18, 1, 700, 700, 0, 6, 5, 0, 1, 18, 0, 3, 0, 0, 0, 0},
- {18, 1, 350, 350, 0, 6, 5, 0, 1, 18, 0, 3, 0, 0, 0, 0},
-
- /* FCC TYPE 6 */
- {9, 1, 3003, 3003, 1, 7, 5, 0, 1, 18, 0, 0, 0, 0, 0, 1},
-
- /* FCC TYPE 2 */
- {23, 5, 4347, 6666, 0, 18, 11, 0, 7, 20, 0, 3, 0, 0, 0, 2},
-
- /* FCC TYPE 3 */
- {18, 10, 2000, 5000, 0, 23, 8, 6, 13, 20, 0, 3, 0, 0, 0, 5},
-
- /* FCC TYPE 4 */
- {16, 15, 2000, 5000, 0, 25, 7, 11, 23, 20, 0, 3, 0, 0, 0, 11},
-};
-
-/**
- * struct dfs_bin5pulse ar5416_bin5pulses - BIN5 pulse for AR5416 chipset.
- */
-struct dfs_bin5pulse ar5416_bin5pulses[] = {
- {2, 28, 105, 12, 22, 5},
-};
-
-void dfs_get_radars_for_ar5416(struct wlan_dfs *dfs)
-{
- struct wlan_dfs_radar_tab_info rinfo;
- int dfsdomain = DFS_FCC_DOMAIN;
-
- qdf_mem_zero(&rinfo, sizeof(rinfo));
- dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
-
- switch (dfsdomain) {
- case DFS_FCC_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_FCC_DOMAIN_5416");
- rinfo.dfsdomain = DFS_FCC_DOMAIN;
- rinfo.dfs_radars = &ar5416_fcc_radars[3];
- rinfo.numradars = QDF_ARRAY_SIZE(ar5416_fcc_radars)-3;
- rinfo.b5pulses = &ar5416_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar5416_bin5pulses);
- break;
- case DFS_ETSI_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_ETSI_DOMAIN_5416");
- rinfo.dfsdomain = DFS_ETSI_DOMAIN;
-
- if (dfs_is_en302_502_applicable(dfs)) {
- rinfo.dfs_radars = ar5416_etsi_radars;
- rinfo.numradars = QDF_ARRAY_SIZE(ar5416_etsi_radars);
- } else {
- uint8_t offset = ETSI_LEGACY_PULSE_ARR_OFFSET;
-
- rinfo.dfs_radars = &ar5416_etsi_radars[offset];
- rinfo.numradars =
- QDF_ARRAY_SIZE(ar5416_etsi_radars) - offset;
- }
-
- rinfo.b5pulses = &ar5416_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar5416_bin5pulses);
- break;
- case DFS_MKK4_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_MKK4_DOMAIN_5416");
- rinfo.dfsdomain = DFS_MKK4_DOMAIN;
- rinfo.dfs_radars = &ar5416_fcc_radars[0];
- rinfo.numradars = QDF_ARRAY_SIZE(ar5416_fcc_radars);
- rinfo.b5pulses = &ar5416_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar5416_bin5pulses);
- break;
- default:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "no domain");
- return;
- }
-
- rinfo.dfs_defaultparams.pe_firpwr = AR5416_DFS_FIRPWR;
- rinfo.dfs_defaultparams.pe_rrssi = AR5416_DFS_RRSSI;
- rinfo.dfs_defaultparams.pe_height = AR5416_DFS_HEIGHT;
- rinfo.dfs_defaultparams.pe_prssi = AR5416_DFS_PRSSI;
- rinfo.dfs_defaultparams.pe_inband = AR5416_DFS_INBAND;
- rinfo.dfs_defaultparams.pe_relpwr = AR5416_DFS_RELPWR;
- rinfo.dfs_defaultparams.pe_relstep = AR5416_DFS_RELSTEP;
- rinfo.dfs_defaultparams.pe_maxlen = AR5416_DFS_MAXLEN;
-
- WLAN_DFS_DATA_STRUCT_LOCK(dfs);
- dfs_init_radar_filters(dfs, &rinfo);
- WLAN_DFS_DATA_STRUCT_UNLOCK(dfs);
-}
diff --git a/direct_attach/umac/dfs/core/src/filtering/ar9300_radar.c b/direct_attach/umac/dfs/core/src/filtering/ar9300_radar.c
deleted file mode 100644
index 0e439de..0000000
--- a/direct_attach/umac/dfs/core/src/filtering/ar9300_radar.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Copyright (c) 2011, 2016-2018 The Linux Foundation. All rights reserved.
- * Copyright (c) 2008-2010, Atheros Communications 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
- * 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 has the radar table for AR9300 chipset and function to
- * initialize the radar table.
- */
-
-#include "dfs.h"
-#include "dfs_internal.h"
-#include "wlan_dfs_utils_api.h"
-#include "wlan_dfs_lmac_api.h"
-
-/*
- * Default 5413/9300 radar phy parameters
- * Values adjusted to fix EV76432/EV76320
- */
-#define AR9300_DFS_FIRPWR -28
-#define AR9300_DFS_RRSSI 0
-#define AR9300_DFS_HEIGHT 10
-#define AR9300_DFS_PRSSI 6
-#define AR9300_DFS_INBAND 8
-#define AR9300_DFS_RELPWR 8
-#define AR9300_DFS_RELSTEP 12
-#define AR9300_DFS_MAXLEN 255
-#define AR9300_DFS_PRSSI_CAC 10
-
-/*
- * Make sure that value matches value in ar9300_osprey_2p2_mac_core[][2] for
- * register 0x1040 to 0x104c.
- */
-#define AR9300_FCC_RADARS_FCC_OFFSET 4
-
-/**
- * struct dfs_pulse ar9300_etsi_radars - ETSI radar pulse table for
- * AR9300 chipset.
- *
- * For short pulses, RSSI threshold should be smaller than Kquick-drop.
- * The chip has only one chance to drop the gain which will be reported
- * as the estimated RSSI.
- */
-struct dfs_pulse ar9300_etsi_radars[] = {
-
- /* EN 302 502 frequency hopping pulse */
- /* PRF 3000, 1us duration, 9 pulses per burst */
- {9, 1, 3000, 3000, 1, 4, 5, 0, 1, 18, 0, 0, 1, 1000, 0, 40},
- /* PRF 4500, 20us duration, 9 pulses per burst */
- {9, 20, 4500, 4500, 1, 4, 5, 19, 21, 18, 0, 0, 1, 1000, 0, 41},
-
- /* TYPE staggered pulse */
- /* Type 5*/
- /* 0.8-2us, 2-3 bursts,300-400 PRF, 10 pulses each */
- {30, 2, 300, 400, 2, 30, 3, 0, 5, 15, 0, 0, 1, 0, 0, 31},
- /* Type 6 */
- /* 0.8-2us, 2-3 bursts, 400-1200 PRF, 15 pulses each */
- {30, 2, 400, 1200, 2, 30, 7, 0, 5, 15, 0, 0, 0, 0, 0, 32},
-
- /* constant PRF based */
- /* Type 1 */
- /* 0.8-5us, 200 300 PRF, 10 pulses */
- {10, 5, 200, 400, 0, 24, 5, 0, 8, 15, 0, 0, 2, 0, 0, 33},
- {10, 5, 400, 600, 0, 24, 5, 0, 8, 15, 0, 0, 2, 0, 0, 37},
- {10, 5, 600, 800, 0, 24, 5, 0, 8, 15, 0, 0, 2, 0, 0, 38},
- {10, 5, 800, 1000, 0, 24, 5, 0, 8, 15, 0, 0, 2, 0, 0, 39},
-
- /* Type 2 */
- /* 0.8-15us, 200-1600 PRF, 15 pulses */
- {15, 15, 200, 1600, 0, 24, 8, 0, 18, 24, 0, 0, 0, 0, 0, 34},
-
- /* Type 3 */
- /* 0.8-15us, 2300-4000 PRF, 25 pulses*/
- {25, 15, 2300, 4000, 0, 24, 10, 0, 18, 24, 0, 0, 0, 0, 0, 35},
-
- /* Type 4 */
- /* 20-30us, 2000-4000 PRF, 20 pulses*/
- {20, 30, 2000, 4000, 0, 24, 8, 19, 33, 24, 0, 0, 0, 0, 0, 36},
-};
-
-/**
- * struct dfs_pulse ar9300_fcc_radars - FCC radar pulse table for
- * AR9300 chipset.
- */
-struct dfs_pulse ar9300_fcc_radars[] = {
- /*
- * Format is as following:
- * Numpulses pulsedur pulsefreq max_pulsefreq patterntype pulsevar
- * threshold mindur maxdur rssithresh meanoffset rssimargin pulseid.
- */
-
- /* following two filters are specific to Japan/MKK4 */
- /* 1389 +/- 6 us */
- {18, 1, 720, 720, 0, 6, 6, 0, 1, 18, 0, 3, 0, 0, 0, 17},
- /* 4000 +/- 6 us */
- {18, 4, 250, 250, 0, 10, 5, 1, 6, 18, 0, 3, 0, 0, 0, 18},
- /* 3846 +/- 7 us */
- {18, 5, 260, 260, 0, 10, 6, 1, 6, 18, 0, 3, 1, 0, 0, 19},
- /* 3846 +/- 7 us */
- {18, 5, 260, 260, 1, 10, 6, 1, 6, 18, 0, 3, 1, 0, 0, 20},
-
- /* following filters are common to both FCC and JAPAN */
-
- /* FCC TYPE 1 */
- {18, 1, 700, 700, 0, 6, 5, 0, 1, 18, 0, 3, 1, 0, 0, 8},
- {18, 1, 350, 350, 0, 6, 5, 0, 1, 18, 0, 3, 0, 0, 0, 0},
-
- /* FCC TYPE 6 */
- {9, 1, 3003, 3003, 0, 7, 5, 0, 1, 18, 0, 0, 1, 0, 0, 1},
-
- /* FCC TYPE 2 */
- {23, 5, 4347, 6666, 0, 18, 11, 0, 7, 22, 0, 3, 0, 0, 0, 2},
-
- /* FCC TYPE 3 */
- {18, 10, 2000, 5000, 0, 23, 8, 6, 13, 22, 0, 3, 0, 0, 0, 5},
-
- /* FCC TYPE 4 */
- {16, 15, 2000, 5000, 0, 25, 7, 11, 23, 22, 0, 3, 0, 0, 0, 11},
-
- /* FCC NEW TYPE 1 */
- /* Search duration is numpulses*maxpri.
- * The last theshold can be increased if false detects happen
- */
- /* 518us to 938us pulses (min 56 pulses) */
- {57, 1, 1066, 1930, 0, 6, 20, 0, 1, 22, 0, 3, 0, 0, 0, 21},
- /* 938us to 2000 pulses (min 26 pulses) */
- {27, 1, 500, 1066, 0, 6, 13, 0, 1, 22, 0, 3, 0, 0, 0, 22},
- /* 2000 to 3067us pulses (min 17 pulses)*/
- {18, 1, 325, 500, 0, 6, 9, 0, 1, 22, 0, 3, 0, 0, 0, 23},
-
-};
-
-/**
- * struct dfs_bin5pulse ar9300_bin5pulses - BIN5 pulse for AR9300 chipset.
- */
-struct dfs_bin5pulse ar9300_bin5pulses[] = {
- {2, 28, 105, 12, 22, 5},
-};
-
-/**
- * struct dfs_pulse ar9300_korea_radars - DFS pulses for KOREA domain.
- */
-struct dfs_pulse ar9300_korea_radars[] = {
- /* Korea Type 1 */
- {18, 1, 700, 700, 0, 6, 5, 0, 1, 18, 0, 3, 1, 0, 0, 40},
- /* Korea Type 2 */
- {10, 1, 1800, 1800, 0, 6, 4, 0, 1, 18, 0, 3, 1, 0, 0, 41},
- /* Korea Type 3 */
- {70, 1, 330, 330, 0, 6, 20, 0, 2, 18, 0, 3, 1, 0, 0, 42},
- /* Korea Type 4 */
- {3, 1, 3003, 3003, 1, 7, 2, 0, 1, 18, 0, 0, 1, 0, 0, 43},
-};
-
-void dfs_get_radars_for_ar9300(struct wlan_dfs *dfs)
-{
- struct wlan_dfs_radar_tab_info rinfo;
- int dfsdomain = DFS_FCC_DOMAIN;
-
- qdf_mem_zero(&rinfo, sizeof(rinfo));
- dfsdomain = utils_get_dfsdomain(dfs->dfs_pdev_obj);
-
- switch (dfsdomain) {
- case DFS_FCC_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_FCC_DOMAIN_9300");
- rinfo.dfsdomain = DFS_FCC_DOMAIN;
- rinfo.dfs_radars =
- &ar9300_fcc_radars[AR9300_FCC_RADARS_FCC_OFFSET];
- rinfo.numradars =
- (QDF_ARRAY_SIZE(ar9300_fcc_radars) -
- AR9300_FCC_RADARS_FCC_OFFSET);
- rinfo.b5pulses = &ar9300_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar9300_bin5pulses);
- break;
- case DFS_ETSI_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_ETSI_DOMAIN_9300");
- rinfo.dfsdomain = DFS_ETSI_DOMAIN;
-
- if (dfs_is_en302_502_applicable(dfs)) {
- rinfo.dfs_radars = ar9300_etsi_radars;
- rinfo.numradars = QDF_ARRAY_SIZE(ar9300_etsi_radars);
- } else {
- uint8_t offset = ETSI_LEGACY_PULSE_ARR_OFFSET;
-
- rinfo.dfs_radars = &ar9300_etsi_radars[offset];
- rinfo.numradars =
- QDF_ARRAY_SIZE(ar9300_etsi_radars) - offset;
- }
-
- rinfo.b5pulses = &ar9300_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar9300_bin5pulses);
- break;
- case DFS_KR_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS,
- "DFS_ETSI_DOMAIN_9300_Country_Korea");
- rinfo.dfsdomain = DFS_ETSI_DOMAIN;
- rinfo.dfs_radars = &ar9300_korea_radars[0];
- rinfo.numradars = QDF_ARRAY_SIZE(ar9300_korea_radars);
- rinfo.b5pulses = &ar9300_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar9300_bin5pulses);
- break;
- case DFS_MKK4_DOMAIN:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "DFS_MKK4_DOMAIN_9300");
- rinfo.dfsdomain = DFS_MKK4_DOMAIN;
- rinfo.dfs_radars = &ar9300_fcc_radars[0];
- rinfo.numradars = QDF_ARRAY_SIZE(ar9300_fcc_radars);
- rinfo.b5pulses = &ar9300_bin5pulses[0];
- rinfo.numb5radars = QDF_ARRAY_SIZE(ar9300_bin5pulses);
- break;
- default:
- dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "no domain");
- return;
- }
-
- lmac_set_use_cac_prssi(dfs->dfs_pdev_obj);
-
- rinfo.dfs_defaultparams.pe_firpwr = AR9300_DFS_FIRPWR;
- rinfo.dfs_defaultparams.pe_rrssi = AR9300_DFS_RRSSI;
- rinfo.dfs_defaultparams.pe_height = AR9300_DFS_HEIGHT;
- rinfo.dfs_defaultparams.pe_prssi = AR9300_DFS_PRSSI;
-
- /*
- * We have an issue with PRSSI.
- * For normal operation we use AR9300_DFS_PRSSI, which is set to 6.
- * Please refer to EV91563, 94164.
- * However, this causes problem during CAC as no radar is detected
- * during that period with PRSSI=6. Only PRSSI= 10 seems to fix this.
- * We use this flag to keep track of change in PRSSI.
- */
- rinfo.dfs_defaultparams.pe_inband = AR9300_DFS_INBAND;
- rinfo.dfs_defaultparams.pe_relpwr = AR9300_DFS_RELPWR;
- rinfo.dfs_defaultparams.pe_relstep = AR9300_DFS_RELSTEP;
- rinfo.dfs_defaultparams.pe_maxlen = AR9300_DFS_MAXLEN;
-
- WLAN_DFS_DATA_STRUCT_LOCK(dfs);
- dfs_init_radar_filters(dfs, &rinfo);
- WLAN_DFS_DATA_STRUCT_UNLOCK(dfs);
-}
diff --git a/direct_attach/umac/dfs/core/src/filtering/dfs_direct_attach_radar.c b/direct_attach/umac/dfs/core/src/filtering/dfs_direct_attach_radar.c
deleted file mode 100644
index f1c4f01..0000000
--- a/direct_attach/umac/dfs/core/src/filtering/dfs_direct_attach_radar.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
- * Copyright (c) 2011, 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 has radar table and initialization function for Beeliner
- * family of chipsets.
- */
-
-#include "dfs.h"
-#include "wlan_dfs_mlme_api.h"
-#include "wlan_dfs_utils_api.h"
-#include "wlan_dfs_lmac_api.h"
-#include "dfs_internal.h"
-
-void dfs_get_da_radars(struct wlan_dfs *dfs)
-{
-#define AR5212_DEVID_IBM 0x1014 /* IBM minipci ID */
-#define AR5212_AR2413 0x001a /* AR2413 aka Griffin-lite */
-#define AR5212_AR2413 0x001a /* AR2413 aka Griffin-lite */
-#define AR5212_AR5413 0x001b /* Eagle */
-#define AR5212_AR5424 0x001c /* Condor (PCI express) */
-#define AR5212_DEVID_FF19 0xff19 /* PCI express */
-#define AR5212_AR2417 0x001d /* Nala, PCI */
-#define AR5212_DEVID 0x0013 /* Final ar5212 devid */
-#define AR5212_FPGA 0xf013 /* Emulation board */
-#define AR5212_DEFAULT 0x1113 /* No eeprom HW default */
-
-#define AR5416_DEVID_PCI 0x0023 /* AR5416 PCI (CB/MB) (Owl)*/
-#define AR5416_DEVID_PCIE 0x0024 /* AR5416 PCI-E (XB) (Owl) */
-#define AR5416_DEVID_AR9160_PCI 0x0027 /* AR9160 PCI (Sowl) */
-#define AR5416_AR9100_DEVID 0x000b /* AR9100 (Howl) */
-#define AR5416_DEVID_AR9280_PCI 0x0029 /* PCI (Merlin) */
-#define AR5416_DEVID_AR9280_PCIE 0x002a /* PCIE (Merlin) */
-#define AR5416_DEVID_AR9285_PCIE 0x002b /* PCIE (Kite) */
-#define AR5416_DEVID_AR9285G_PCIE 0x002c /* PCIE (Kite G only) */
-#define AR5416_DEVID_AR9287_PCI 0x002d /* PCI (Kiwi) */
-#define AR5416_DEVID_AR9287_PCIE 0x002e /* PCIE (Kiwi) */
-
-#define AR9300_DEVID_AR9380_PCIE 0x0030 /* PCIE (Osprey) */
-#define AR9300_DEVID_AR9340 0x0031 /* Wasp */
-#define AR9300_DEVID_AR9485_PCIE 0x0032 /* Poseidon */
-#define AR9300_DEVID_AR9580_PCIE 0x0033 /* Peacock */
-#define AR9300_DEVID_AR1111_PCIE 0x0037 /* AR1111 */
-#define AR9300_DEVID_AR946X_PCIE 0x0034 /* Jupiter: 2x2 DB + BT - AR9462 */
-#define AR9300_DEVID_AR955X 0x0039 /* Scorpion */
-#define AR9300_DEVID_AR953X 0x003d /* Honey Bee */
-#define AR9300_DEVID_AR956X 0x003f /* Dragonfly */
-#define AR9300_DEVID_AR956X_PCIE 0x0036 /* Aphrodite: 1x1 DB + BT - AR9564 */
-#define AR9300_DEVID_EMU_PCIE 0xabcd
-
- uint16_t devid = lmac_get_ah_devid(dfs->dfs_pdev_obj);
- /* For DA */
-
- switch (devid) {
- case AR5212_DEVID_IBM:
- case AR5212_AR2413:
- case AR5212_AR5413:
- case AR5212_AR5424:
- case AR5212_DEVID_FF19:
- devid = AR5212_DEVID;
- case AR5212_AR2417:
- case AR5212_DEVID:
- case AR5212_FPGA:
- case AR5212_DEFAULT:
- dfs_get_radars_for_ar5212(dfs);
- break;
- case AR5416_DEVID_PCI:
- case AR5416_DEVID_PCIE:
- case AR5416_DEVID_AR9160_PCI:
- case AR5416_AR9100_DEVID:
- case AR5416_DEVID_AR9280_PCI:
- case AR5416_DEVID_AR9280_PCIE:
- case AR5416_DEVID_AR9285_PCIE:
- case AR5416_DEVID_AR9285G_PCIE:
- case AR5416_DEVID_AR9287_PCI:
- case AR5416_DEVID_AR9287_PCIE:
- dfs_get_radars_for_ar5416(dfs);
- break;
- case AR9300_DEVID_AR9380_PCIE:
- case AR9300_DEVID_AR9340:
- case AR9300_DEVID_AR9485_PCIE:
- case AR9300_DEVID_AR9580_PCIE:
- case AR9300_DEVID_AR1111_PCIE:
- case AR9300_DEVID_AR946X_PCIE:
- case AR9300_DEVID_AR955X:
- case AR9300_DEVID_AR953X:
- case AR9300_DEVID_AR956X:
- case AR9300_DEVID_AR956X_PCIE:
- case AR9300_DEVID_EMU_PCIE:
- dfs_get_radars_for_ar9300(dfs);
- break;
- }
-}
diff --git a/dp/wifi3.0/dp_mscs.c b/dp/wifi3.0/dp_mscs.c
new file mode 100644
index 0000000..a69beaf
--- /dev/null
+++ b/dp/wifi3.0/dp_mscs.c
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2020 The Linux Foundation. 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
+ * 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.
+ */
+#include "dp_peer.h"
+#include "qdf_nbuf.h"
+#include "dp_types.h"
+#include "dp_internal.h"
+#include "dp_tx.h"
+#include "dp_mscs.h"
+
+#define DP_MSCS_INVALID_TID 0xFF
+#define DP_MSCS_VALID_TID_MASK 0x7
+
+/**
+ * dp_mscs_peer_lookup_n_get_priority() - Get priority for MSCS peer
+ * @soc_hdl - soc handle
+ * @src_mac_addr - src mac address from connection
+ * @nbuf - network buffer
+ *
+ * Return: 0 when peer has active mscs session and valid user priority
+ */
+int dp_mscs_peer_lookup_n_get_priority(struct cdp_soc_t *soc_hdl,
+ uint8_t *src_mac_addr, qdf_nbuf_t nbuf)
+{
+ struct dp_peer *peer;
+ uint8_t user_prio_bitmap;
+ uint8_t user_prio_limit;
+ uint8_t user_prio;
+ int status = 0;
+ struct dp_soc *dpsoc = cdp_soc_t_to_dp_soc(soc_hdl);
+
+ if (!dpsoc) {
+ QDF_TRACE(QDF_MODULE_ID_MSCS, QDF_TRACE_LEVEL_ERROR,
+ "%s: Invalid soc\n", __func__);
+ return -1;
+ }
+
+ /*
+ * Find the MSCS peer from global soc
+ */
+ peer = dp_peer_find_hash_find(dpsoc, src_mac_addr, 0,
+ DP_VDEV_ALL, DP_MOD_ID_MSCS);
+
+ if (!peer) {
+ /*
+ * No WLAN client peer found with this peer mac
+ */
+ return -1;
+ }
+
+ /*
+ * check if there is any active MSCS session for this peer
+ */
+ if (!peer->mscs_active) {
+ QDF_TRACE(QDF_MODULE_ID_MSCS, QDF_TRACE_LEVEL_DEBUG,
+ "%s: MSCS session not active on peer or peer delete in progress\n", __func__);
+ status = 1;
+ goto fail;
+ }
+
+ /*
+ * Get user priority bitmap for this peer MSCS active session
+ */
+ user_prio_bitmap = peer->mscs_ipv4_parameter.user_priority_bitmap;
+ user_prio_limit = peer->mscs_ipv4_parameter.user_priority_limit;
+ user_prio = qdf_nbuf_get_priority(nbuf) & DP_MSCS_VALID_TID_MASK;
+
+ /*
+ * check if nbuf priority is matching with any of the valid priority value
+ */
+ if (!((1 << user_prio) & user_prio_bitmap)) {
+ QDF_TRACE(QDF_MODULE_ID_MSCS, QDF_TRACE_LEVEL_DEBUG,
+ "%s: Nbuf TID is not valid, no match in user prioroty bitmap\n", __func__);
+ status = 1;
+ goto fail;
+ }
+
+ user_prio = QDF_MIN(user_prio, user_prio_limit);
+
+ /*
+ * Update skb priority
+ */
+ qdf_nbuf_set_priority(nbuf, user_prio);
+ QDF_TRACE(QDF_MODULE_ID_MSCS, QDF_TRACE_LEVEL_DEBUG,
+ "%s: User priority for this MSCS session %d\n", __func__, user_prio);
+ status = 0;
+
+fail:
+ if (peer)
+ dp_peer_unref_delete(peer, DP_MOD_ID_MSCS);
+ return status;
+}
+
+qdf_export_symbol(dp_mscs_peer_lookup_n_get_priority);
diff --git a/dp/wifi3.0/dp_mscs.h b/dp/wifi3.0/dp_mscs.h
new file mode 100644
index 0000000..911fe5c
--- /dev/null
+++ b/dp/wifi3.0/dp_mscs.h
@@ -0,0 +1,28 @@
+
+/*
+ * Copyright (c) 2020 The Linux Foundation. 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
+ * 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.
+ */
+
+#ifndef _DP_MSCS_H_
+#define _DP_MSCS_H_
+
+#if WLAN_SUPPORT_MSCS
+int dp_mscs_peer_lookup_n_get_priority(struct cdp_soc_t *soc_hdl,
+ uint8_t *src_mac_addr, qdf_nbuf_t nbuf);
+#endif
+
+#endif /* QCA_MSCS_H*/
diff --git a/dp/wifi3.0/dp_tx_capture.c b/dp/wifi3.0/dp_tx_capture.c
index 9774310..f07b609 100644
--- a/dp/wifi3.0/dp_tx_capture.c
+++ b/dp/wifi3.0/dp_tx_capture.c
@@ -32,7 +32,8 @@
#include <linux/uaccess.h>
#include "qdf_lock.h"
#include "qdf_debugfs.h"
-
+#include "dp_rx.h"
+#include "dp_rx_mon.h"
#include "dp_tx_capture.h"
#define NUM_BITS_DWORD 32
@@ -147,7 +148,7 @@
if (qdf_unlikely(!qdf_nbuf_is_queue_empty(qhead))) {
QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE, QDF_TRACE_LEVEL_FATAL,
"Queue is not empty len(%d) !!",
- qdf_nbuf_queue_len(q_head));
+ qdf_nbuf_queue_len(qhead));
QDF_BUG(0);
}
}
@@ -558,14 +559,15 @@
int tid;
struct dp_tx_tid *tx_tid;
+ /*
+ * For the newly created peer after tx monitor turned ON,
+ * initialization check is already taken care in queue init
+ */
dp_peer_tid_queue_init(peer);
for (tid = 0; tid < DP_MAX_TIDS; tid++) {
tx_tid = &peer->tx_capture.tx_tid[tid];
tx_tid->peer_id = peer_id;
- if (tx_tid->tid != tid) {
- qdf_err("tx tid is corrupted for tid %d, peer_id %d", tid, peer_id);
- tx_tid->tid = tid;
- }
+ tx_tid->tid = tid;
}
}
@@ -576,9 +578,26 @@
*/
void dp_peer_tid_queue_init(struct dp_peer *peer)
{
+ struct dp_pdev *pdev;
+ struct dp_vdev *vdev;
int tid;
struct dp_tx_tid *tx_tid;
+ if (!peer)
+ return;
+
+ vdev = peer->vdev;
+ pdev = vdev->pdev;
+
+ /* only if tx capture is turned on we will initialize the tid */
+ if (qdf_atomic_read(&pdev->tx_capture.tx_cap_usr_mode) ==
+ CDP_TX_ENH_CAPTURE_DISABLED)
+ return;
+
+ QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE,
+ QDF_TRACE_LEVEL_INFO_LOW,
+ "peer(%p) id:%d init!!", peer, peer->peer_id);
+
for (tid = 0; tid < DP_MAX_TIDS; tid++) {
tx_tid = &peer->tx_capture.tx_tid[tid];
@@ -586,6 +605,7 @@
&tx_tid->tid_flags))
continue;
+ tx_tid->peer_id = peer->peer_id;
tx_tid->tid = tid;
check_queue_empty(&tx_tid->defer_msdu_q);
@@ -609,6 +629,7 @@
for (i = 0; i < tid; i++) {
tx_tid = &peer->tx_capture.tx_tid[i];
qdf_mem_free(tx_tid->xretry_ppdu);
+ tx_tid->xretry_ppdu = NULL;
qdf_atomic_clear_bit(DP_PEER_TX_TID_INIT_DONE_BIT,
&tx_tid->tid_flags);
}
@@ -670,6 +691,10 @@
if (!peer->tx_capture.is_tid_initialized)
return;
+ QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE,
+ QDF_TRACE_LEVEL_INFO_LOW,
+ "peer(%p) id:%d cleanup!!", peer, peer->peer_id);
+
for (tid = 0; tid < DP_MAX_TIDS; tid++) {
uint32_t len = 0;
uint32_t actual_len = 0;
@@ -707,6 +732,11 @@
ppdu_desc = (struct cdp_tx_completion_ppdu *)
qdf_nbuf_data(ppdu_nbuf);
+ QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE,
+ QDF_TRACE_LEVEL_INFO_MED,
+ "ppdu_id:%u tsf:%llu removed from pending ppdu q",
+ ppdu_desc->ppdu_id,
+ ppdu_desc->ppdu_start_timestamp);
/*
* check if peer id is matching
* the user peer_id
@@ -731,6 +761,7 @@
TX_CAP_NBUF_QUEUE_FREE(&xretry_user->mpdu_q);
qdf_mem_free(xretry_ppdu);
+ tx_tid->xretry_ppdu = NULL;
tx_tid->max_ppdu_id = 0;
}
@@ -1555,6 +1586,10 @@
uint32_t k;
uint32_t ba_bitmap = 0;
int last_set_bit;
+ uint32_t last_ba_set_bit = 0;
+ uint8_t extra_ba_mpdus = 0;
+ uint32_t last_ba_seq = 0;
+ uint32_t enq_ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS] = {0};
user = (struct cdp_tx_completion_ppdu_user *)data;
@@ -1602,6 +1637,10 @@
}
}
+ if (num_mpdu > mpdu_tried) {
+ extra_ba_mpdus = 1;
+ }
+
/* Adjust failed_bitmap to start from same seq_no as enq_bitmap */
last_set_bit = 0;
if (start_seq <= ba_seq_no) {
@@ -1615,12 +1654,31 @@
carry = ((ba_bitmap & (bitmask << (32 - diff))) >>
(32 - diff));
- user->failed_bitmap[i] = user->enq_bitmap[i] &
- user->failed_bitmap[i];
+ if (user->failed_bitmap[i]) {
+ last_ba_set_bit = i * 32 +
+ qdf_fls(user->failed_bitmap[i]) - 1;
+ if (extra_ba_mpdus) {
+ enq_ba_bitmap[i] =
+ user->failed_bitmap[i];
+ QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE,
+ QDF_TRACE_LEVEL_INFO_MED,
+ "i=%d failed_bitmap[%d] = 0x%x last_ba_set_bit:%d\n",
+ i, i, user->failed_bitmap[i],
+ last_ba_set_bit);
+ }
+ }
+
if (user->enq_bitmap[i]) {
last_set_bit = i * 32 +
qdf_fls(user->enq_bitmap[i]) - 1;
}
+
+ if (extra_ba_mpdus) {
+ user->enq_bitmap[i] = enq_ba_bitmap[i];
+ } else {
+ user->failed_bitmap[i] = user->enq_bitmap[i] &
+ user->failed_bitmap[i];
+ }
}
} else {
/* array index */
@@ -1628,7 +1686,7 @@
diff = diff & 0x1F;
bitmask = (1 << diff) - 1;
- for (i = 0; i < size; i++, k++) {
+ for (i = 0; i < size && (k < (size - 1)); i++, k++) {
ba_bitmap = user->ba_bitmap[k];
user->failed_bitmap[i] = ba_bitmap >> diff;
/* get next ba_bitmap */
@@ -1637,18 +1695,53 @@
user->failed_bitmap[i] |=
((carry & bitmask) << (32 - diff));
- user->failed_bitmap[i] = user->enq_bitmap[i] &
- user->failed_bitmap[i];
+ if (user->failed_bitmap[i]) {
+ last_ba_set_bit = i * 32 +
+ qdf_fls(user->failed_bitmap[i]) - 1;
+ if (extra_ba_mpdus) {
+ enq_ba_bitmap[i] =
+ user->failed_bitmap[i];
+ QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE,
+ QDF_TRACE_LEVEL_INFO_MED,
+ "i=%d failed_bitmap[%d] = 0x%x last_ba_set_bit:%d\n",
+ i, i, user->failed_bitmap[i],
+ last_ba_set_bit);
+ }
+ }
+
if (user->enq_bitmap[i]) {
last_set_bit = i * 32 +
qdf_fls(user->enq_bitmap[i]) - 1;
}
+
+ if (extra_ba_mpdus) {
+ user->enq_bitmap[i] = enq_ba_bitmap[i];
+ } else {
+ user->failed_bitmap[i] = user->enq_bitmap[i] &
+ user->failed_bitmap[i];
+ }
}
}
user->last_enq_seq = user->start_seq + last_set_bit;
user->ba_size = user->last_enq_seq - user->start_seq + 1;
+
+ last_ba_seq = user->start_seq + last_ba_set_bit;
+
+ if (extra_ba_mpdus) {
+ QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE,
+ QDF_TRACE_LEVEL_INFO_MED,
+ "ppdu_id:%u ba_size:%u modified_ba_size:%u last_ba_set_bit:%u start_seq: %u\n",
+ ppdu_id,
+ user->ba_size,
+ last_ba_seq - user->start_seq + 1,
+ last_ba_set_bit, user->start_seq);
+ user->ba_size = last_ba_seq - user->start_seq + 1;
+
+ user->last_enq_seq = last_ba_seq;
+ }
}
+
/*
* dp_soc_set_txrx_ring_map_single()
* @dp_soc: DP handler for soc
@@ -1669,9 +1762,18 @@
struct dp_peer *peer,
void *arg)
{
+ /* disable tx capture flag in peer */
+ peer->tx_cap_enabled = 0;
dp_peer_tid_queue_cleanup(peer);
}
+static void dp_peer_init_msdu_q(struct dp_soc *soc,
+ struct dp_peer *peer,
+ void *arg)
+{
+ dp_peer_tid_queue_init(peer);
+}
+
/*
* dp_soc_is_tx_capture_set_in_pdev() - API to get tx capture set in any pdev
* @soc_handle: DP_SOC handle
@@ -1753,6 +1855,9 @@
void
dp_enh_tx_capture_enable(struct dp_pdev *pdev, uint8_t user_mode)
{
+ dp_pdev_iterate_peer(pdev, dp_peer_init_msdu_q, NULL,
+ DP_MOD_ID_TX_CAPTURE);
+
if (dp_soc_is_tx_capture_set_in_pdev(pdev->soc) == 1)
dp_soc_set_txrx_ring_map_single(pdev->soc);
@@ -4558,8 +4663,16 @@
user->peer_id,
DP_MOD_ID_TX_CAPTURE);
if (!peer) {
- dp_ppdu_desc_free(ptr_nbuf_list, usr_idx);
user->skip = 1;
+ dp_ppdu_desc_free(ptr_nbuf_list, usr_idx);
+ continue;
+ }
+
+ if (!peer->tx_capture.is_tid_initialized) {
+ user->skip = 1;
+ dp_ppdu_desc_free(ptr_nbuf_list, usr_idx);
+ dp_peer_unref_delete(peer,
+ DP_MOD_ID_TX_CAPTURE);
continue;
}
@@ -4615,7 +4728,8 @@
for (i = 0; (i < user->ba_size) && mpdus_tried; i++) {
if (qdf_likely(user->tid != DP_NON_QOS_TID) &&
- !(SEQ_BIT(user->enq_bitmap, i)))
+ !(SEQ_BIT(user->enq_bitmap, i)) &&
+ !mpdu_tried)
continue;
mpdus_tried--;
/* missed seq number */
@@ -4686,6 +4800,25 @@
}
}
+ for (/* get i from previous stored value*/;
+ i < user->ba_size; i++) {
+ qdf_nbuf_queue_t *tmp_q;
+
+ /* missed seq number */
+ seq_no = start_seq + i;
+
+ tmp_q = &user->mpdu_q;
+ /* any error case we need to handle */
+ mpdu_nbuf = qdf_nbuf_queue_remove(tmp_q);
+ /* check mpdu_nbuf NULL */
+ if (!mpdu_nbuf)
+ continue;
+
+ user->mpdus[seq_no - start_seq] = mpdu_nbuf;
+ dp_tx_cap_stats_mpdu_update(peer,
+ PEER_MPDU_ARR, 1);
+ }
+
mpdu_tried = user->mpdu_tried_ucast +
user->mpdu_tried_mcast;
for (i = 0; i < CDP_BA_256_BIT_MAP_SIZE_DWORDS; i++)
@@ -5011,6 +5144,8 @@
if (qdf_nbuf_is_queue_empty(
&head_msdu)) {
+ if (user->completion_status == 2)
+ goto nbuf_add_ref;
user->skip = 1;
goto free_nbuf_dec_ref;
}
@@ -5038,9 +5173,9 @@
qlen);
if (!qlen) {
+ user->skip = 1;
dp_ppdu_queue_free(nbuf_ppdu,
usr_idx);
- user->skip = 1;
goto free_nbuf_dec_ref;
}
@@ -5071,6 +5206,7 @@
mpdu_suc);
dp_tx_cap_stats_mpdu_update(peer, PEER_MPDU_TRI,
mpdu_tri);
+nbuf_add_ref:
dp_peer_unref_delete(peer, DP_MOD_ID_TX_CAPTURE);
/* get reference count */
ref_cnt = qdf_nbuf_get_users(nbuf_ppdu);
@@ -5098,7 +5234,7 @@
*/
/* print ppdu_desc info for debugging purpose */
QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE,
- QDF_TRACE_LEVEL_INFO_HIGH,
+ QDF_TRACE_LEVEL_INFO_LOW,
"%s: ppdu[%d], p_id[%d], tid[%d], fctrl[0x%x 0x%x] ftype[%d] h_frm_t[%d] seq[%d] tsf[%u b %u] dur[%u]",
__func__, ppdu_desc->ppdu_id,
ppdu_desc->user[0].peer_id,
@@ -5389,11 +5525,13 @@
ppdu_desc->sched_cmdid = ppdu_info->sched_cmdid;
if (starved) {
- qdf_err("ppdu starved fc[0x%x] h_ftype[%d] tlv_bitmap[0x%x] cs[%d]\n",
- ppdu_desc->frame_ctrl,
- ppdu_desc->htt_frame_type,
- ppdu_desc->tlv_bitmap,
- ppdu_desc->user[0].completion_status);
+ QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE,
+ QDF_TRACE_LEVEL_INFO_MED,
+ "ppdu starved fc[0x%x] h_ftype[%d] tlv_bitmap[0x%x] cs[%d]\n",
+ ppdu_desc->frame_ctrl,
+ ppdu_desc->htt_frame_type,
+ ppdu_desc->tlv_bitmap,
+ ppdu_desc->user[0].completion_status);
starved = 0;
}
@@ -5900,11 +6038,20 @@
uint16_t bar_ctl;
uint32_t user_id;
uint8_t tid;
+ qdf_frag_t addr;
if (!nbuf)
return QDF_STATUS_E_INVAL;
- wh = (struct ieee80211_ctlframe_addr2 *)qdf_nbuf_data(nbuf);
+ /* Get addr pointing to 80211 header */
+ addr = dp_rx_mon_get_nbuf_80211_hdr(nbuf);
+ if (qdf_unlikely(!addr)) {
+ QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE, QDF_TRACE_LEVEL_ERROR,
+ "%s: Unable to get 80211 header address", __func__);
+ return QDF_STATUS_E_INVAL;
+ }
+
+ wh = (struct ieee80211_ctlframe_addr2 *)addr;
if (wh->i_fc[0] != (IEEE80211_FC0_VERSION_0 |
IEEE80211_FC0_TYPE_CTL | IEEE80211_FC0_SUBTYPE_BAR)) {
@@ -5950,9 +6097,17 @@
struct ieee80211_frame *wh;
uint16_t duration;
struct dp_vdev *vdev = NULL;
- char *ndpa_buf = qdf_nbuf_data(mon_mpdu);
uint8_t token = 0;
uint8_t *frm;
+ char *ndpa_buf = NULL;
+
+ /* Get addr pointing to 80211 header */
+ ndpa_buf = dp_rx_mon_get_nbuf_80211_hdr(mon_mpdu);
+ if (qdf_unlikely(!ndpa_buf)) {
+ QDF_TRACE(QDF_MODULE_ID_TX_CAPTURE, QDF_TRACE_LEVEL_ERROR,
+ "%s: Unable to get 80211 header address", __func__);
+ return;
+ }
wh = (struct ieee80211_frame *)qdf_nbuf_data(mpdu_nbuf);
@@ -6347,8 +6502,7 @@
user->delayed_ba);
qdf_debugfs_printf(file,
- "\tS_SEQ:%d ENQ_BITMAP[",
- user->start_seq);
+ "\tS_SEQ:%d ENQ_BITMAP[", user->start_seq);
for (i = 0; i < CDP_BA_256_BIT_MAP_SIZE_DWORDS; i++)
qdf_debugfs_printf(file, " 0x%x",
user->enq_bitmap[i]);
diff --git a/dp/wifi3.0/dp_txrx_wds.h b/dp/wifi3.0/dp_txrx_wds.h
index e468651..899c249 100644
--- a/dp/wifi3.0/dp_txrx_wds.h
+++ b/dp/wifi3.0/dp_txrx_wds.h
@@ -393,13 +393,23 @@
qdf_spin_lock_bh(&soc->ast_lock);
ast = soc->ast_table[sa_idx];
+ if (!ast) {
+ qdf_spin_unlock_bh(&soc->ast_lock);
+ return QDF_STATUS_E_NULL_VALUE;
+ }
+
+ if (!ast->is_mapped) {
+ qdf_spin_unlock_bh(&soc->ast_lock);
+ return QDF_STATUS_E_INVAL;
+ }
+
/*
* Ensure we are updating the right AST entry by
* validating ast_idx.
* There is a possibility we might arrive here without
* AST MAP event , so this check is mandatory
*/
- if (ast && ast->is_mapped && (ast->ast_idx == sa_idx)) {
+ if (ast->ast_idx == sa_idx) {
ast->is_active = is_active;
qdf_spin_unlock_bh(&soc->ast_lock);
return QDF_STATUS_SUCCESS;
diff --git a/qca_mscs/inc/qca_mscs.h b/qca_mscs/inc/qca_mscs.h
new file mode 100644
index 0000000..e8c8339
--- /dev/null
+++ b/qca_mscs/inc/qca_mscs.h
@@ -0,0 +1,32 @@
+
+/*
+ * Copyright (c) 2020 The Linux Foundation. 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
+ * 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.
+ */
+
+#ifndef __qca_mscs_H_
+#define __qca_mscs_H_
+#include <qdf_module.h>
+#include <qdf_nbuf.h>
+#include <qdf_trace.h>
+#include <ol_if_athvar.h>
+
+#if WLAN_SUPPORT_MSCS
+void qca_mscs_module_init(ol_ath_soc_softc_t *soc);
+void qca_mscs_module_deinit(ol_ath_soc_softc_t *soc);
+#endif
+
+#endif /* qca_mscs_H*/
diff --git a/qca_mscs/inc/qca_mscs_if.h b/qca_mscs/inc/qca_mscs_if.h
new file mode 100644
index 0000000..002f05e
--- /dev/null
+++ b/qca_mscs/inc/qca_mscs_if.h
@@ -0,0 +1,24 @@
+
+/*
+ * Copyright (c) 2020 The Linux Foundation. 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
+ * 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.
+ */
+
+#ifndef __qca_mscs_if_H_
+#define __qca_mscs_if_H_
+
+int qca_mscs_peer_lookup_n_get_priority(uint8_t *src_mac, struct sk_buff *skb);
+#endif /* qca_mscs_if_H*/
diff --git a/qca_mscs/src/qca_mscs.c b/qca_mscs/src/qca_mscs.c
new file mode 100644
index 0000000..2110bbb
--- /dev/null
+++ b/qca_mscs/src/qca_mscs.c
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2020 The Linux Foundation. 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
+ * 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.
+ */
+#include "qca_mscs.h"
+#include "qca_mscs_if.h"
+
+static int mscs_soc_attached_count;
+extern ol_ath_soc_softc_t *ol_global_soc[GLOBAL_SOC_SIZE];
+
+/**
+ * qca_mscs_peer_lookup_n_get_priority() - Find MSCS enabled peer and priority
+ * @src_mac - src mac address to be used for peer lookup
+ * @nbuf - network buffer
+ * @priority - priority/tid to be updated
+ *
+ * Return: QDF_STATUS_SUCCESS for successful peer lookup
+ */
+int qca_mscs_peer_lookup_n_get_priority(uint8_t *src_mac, struct sk_buff *skb)
+{
+ uint8_t i = 0;
+ ol_ath_soc_softc_t *soc = NULL;
+ QDF_STATUS status = QDF_STATUS_SUCCESS;
+ ol_txrx_soc_handle soc_txrx_handle = NULL;
+ qdf_nbuf_t nbuf = (qdf_nbuf_t)skb;
+
+ /*
+ * Loop over all the attached soc for peer lookup
+ * with given src mac address
+ */
+ for (i = 0; i < GLOBAL_SOC_SIZE; i++) {
+ if (!ol_global_soc[i])
+ continue;
+
+ soc = ol_global_soc[i];
+ soc_txrx_handle = wlan_psoc_get_dp_handle(soc->psoc_obj);
+ status = cdp_mscs_peer_lookup_n_get_priority(soc_txrx_handle,
+ src_mac, nbuf);
+ /*
+ * wifi peer is found with this mac address.there can
+ * be 3 possiblities -
+ * 1. peer has no active MSCS session.
+ * 2. peer has active MSCS session but priority not valid.
+ * 3. peer has active MSCS session and priority is valid.
+ * return the status to ECM classifier.
+ */
+ if (status >= QDF_STATUS_SUCCESS)
+ return status;
+ /*
+ * no wifi peer exists in this soc with given src mac address
+ * iterate over next soc
+ */
+ }
+
+ if (i == GLOBAL_SOC_SIZE)
+ /*
+ * No wlan peer is found in any of attached
+ * soc with given mac address
+ * return the status to ECM classifier.
+ */
+ status = QDF_STATUS_E_FAILURE;
+
+ return status;
+}
+
+qdf_export_symbol(qca_mscs_peer_lookup_n_get_priority);
+
+/**
+ * qca_mscs_module_init() - Initialize the MSCS module
+ * @soc - Pointer to soc getting attached
+ *
+ * Return: void
+ */
+
+void qca_mscs_module_init(ol_ath_soc_softc_t *soc)
+{
+ /* Check if soc max init count is reached */
+ if (mscs_soc_attached_count >= GLOBAL_SOC_SIZE)
+ return;
+
+ QDF_TRACE(QDF_MODULE_ID_MSCS, QDF_TRACE_LEVEL_INFO,
+ FL("\n****QCA MSCS Initialization Done**** SoC %pK"), soc);
+
+ mscs_soc_attached_count++;
+}
+
+qdf_export_symbol(qca_mscs_module_init);
+
+/**
+ * qca_mscs_module_deinit() - De-Initialize MSCS module
+ * @soc - Pointer to soc getting detached
+ *
+ * Return: void
+ */
+void qca_mscs_module_deinit(ol_ath_soc_softc_t *soc)
+{
+ if (!soc)
+ return;
+
+ /*
+ * All soc are detached by now
+ */
+ if (mscs_soc_attached_count < 0)
+ return;
+
+ QDF_TRACE(QDF_MODULE_ID_MSCS, QDF_TRACE_LEVEL_INFO,
+ FL("\n****QCA MSCS De-Initialization Done**** SoC %pK"), soc);
+ mscs_soc_attached_count--;
+}
+
+qdf_export_symbol(qca_mscs_module_deinit);
diff --git a/target_if/cfr/src/target_if_cfr_8074v2.c b/target_if/cfr/src/target_if_cfr_8074v2.c
index abcca61..1c52068 100644
--- a/target_if/cfr/src/target_if_cfr_8074v2.c
+++ b/target_if/cfr/src/target_if_cfr_8074v2.c
@@ -417,44 +417,32 @@
WLAN_UMAC_COMP_CFR);
if (!pdev_cfrobj) {
cfr_err("pdev object for CFR is NULL");
- wlan_objmgr_psoc_release_ref(psoc, WLAN_CFR_ID);
- wlan_objmgr_vdev_release_ref(vdev, WLAN_CFR_ID);
- wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
- return -EINVAL;
+ status = -EINVAL;
+ goto done;
}
- if ((tx_evt_param.status & PEER_CFR_CAPTURE_EVT_PS_STATUS_MASK) == 1) {
+ if (tx_evt_param.status & PEER_CFR_CAPTURE_EVT_PS_STATUS_MASK) {
cfr_debug("CFR capture failed as peer is in powersave : %s",
ether_sprintf(&tx_evt_param.peer_mac_addr.bytes[0]));
-
- prepare_cfr_header_txstatus(&tx_evt_param, &header_error);
- rx_ops->cfr_rx_ops.cfr_info_send(pdev, &header_error,
- sizeof(struct csi_cfr_header),
- NULL, 0, &end_magic, 4);
-
- wlan_objmgr_psoc_release_ref(psoc, WLAN_CFR_ID);
- wlan_objmgr_vdev_release_ref(vdev, WLAN_CFR_ID);
- wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
- return -EINVAL;
+ status = -EINVAL;
+ goto relay_failure;
}
if ((tx_evt_param.status & PEER_CFR_CAPTURE_EVT_STATUS_MASK) == 0) {
cfr_debug("CFR capture failed for peer : %s",
ether_sprintf(&tx_evt_param.peer_mac_addr.bytes[0]));
- wlan_objmgr_psoc_release_ref(psoc, WLAN_CFR_ID);
- wlan_objmgr_vdev_release_ref(vdev, WLAN_CFR_ID);
- wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
- return -EINVAL;
+ status = -EINVAL;
+ pdev_cfrobj->tx_peer_status_cfr_fail++;
+ goto relay_failure;
}
if (tx_evt_param.status & CFR_TX_EVT_STATUS_MASK) {
cfr_debug("TX packet returned status %d for peer: %s",
tx_evt_param.status & CFR_TX_EVT_STATUS_MASK,
ether_sprintf(&tx_evt_param.peer_mac_addr.bytes[0]));
- wlan_objmgr_psoc_release_ref(psoc, WLAN_CFR_ID);
- wlan_objmgr_vdev_release_ref(vdev, WLAN_CFR_ID);
- wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
- return -EINVAL;
+ status = -EINVAL;
+ pdev_cfrobj->tx_evt_status_cfr_fail++;
+ goto relay_failure;
}
buf_addr_temp = (tx_evt_param.correlation_info_2 & 0x0f);
@@ -464,10 +452,9 @@
&cookie, 0)) {
cfr_debug("Cookie lookup failure for addr: 0x%pK status: 0x%x",
(void *)((uintptr_t)buf_addr), tx_evt_param.status);
- wlan_objmgr_psoc_release_ref(psoc, WLAN_CFR_ID);
- wlan_objmgr_vdev_release_ref(vdev, WLAN_CFR_ID);
- wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
- return -EINVAL;
+ status = -EINVAL;
+ pdev_cfrobj->tx_dbr_cookie_lookup_fail++;
+ goto done;
}
cfr_debug("buffer address: 0x%pK cookie: %u",
@@ -527,17 +514,24 @@
(void *)((uintptr_t)buf_addr), cookie);
} else {
cfr_err("Correlation returned invalid status!!");
- wlan_objmgr_psoc_release_ref(psoc, WLAN_CFR_ID);
- wlan_objmgr_vdev_release_ref(vdev, WLAN_CFR_ID);
- wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
- return -EINVAL;
+ status = -EINVAL;
+ goto done;
}
+ status = 0;
+ goto done;
+
+relay_failure:
+ prepare_cfr_header_txstatus(&tx_evt_param, &header_error);
+ rx_ops->cfr_rx_ops.cfr_info_send(pdev, &header_error,
+ sizeof(struct csi_cfr_header),
+ NULL, 0, &end_magic, 4);
+done:
wlan_objmgr_psoc_release_ref(psoc, WLAN_CFR_ID);
wlan_objmgr_vdev_release_ref(vdev, WLAN_CFR_ID);
wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
+ return status;
- return 0;
}
#else
static int
diff --git a/tools/linux/cfg80211_ven_cmd.h b/tools/linux/cfg80211_ven_cmd.h
index 7d2a463..a6aabee 100644
--- a/tools/linux/cfg80211_ven_cmd.h
+++ b/tools/linux/cfg80211_ven_cmd.h
@@ -780,6 +780,7 @@
#if WLAN_OBJMGR_REF_ID_TRACE
IEEE80211_PARAM_VDEV_REF_LEAK_TEST = 721,
#endif
+ IEEE80211_PARAM_DISABLE_INACT_PROBING = 722, /* Disable FW inactivity Probing behavior */
};
enum {
@@ -2240,6 +2241,8 @@
#if WLAN_OBJMGR_REF_ID_TRACE
{"enable_ref_leak", IEEE80211_PARAM_VDEV_REF_LEAK_TEST, SET_PARAM, 1},
#endif
+ {"disable_fw_inact_probe", IEEE80211_PARAM_DISABLE_INACT_PROBING, SET_PARAM, 1},
+ {"g_disable_fw_inact_probe", IEEE80211_PARAM_DISABLE_INACT_PROBING, GET_PARAM, 0},
};
struct vendor_commands radio_vendor_cmds[] = {