From 1720fd98a6eedb3d0ebaa618e9e84a0a35b45f60 Mon Sep 17 00:00:00 2001 From: Hariharan Basuthkar Date: Fri, 22 Feb 2019 12:31:50 +0530 Subject: [PATCH] qcacmn: After NOL timeout add channels to ETSI PreCAC Required List After NOL timeout, if ETSI PreCAC is supported, add the HT20 Channel to ETSI PreCAC Required List. Also, move NOL detach after ETSI PreCAC detach to avoid channels being added to ETSI PreCAC Required List when NOL expiry happens after ETSI PreCAC detach. Change-Id: I9cdb359eb6905f4f4cfb9d1c784865af0bf39119 CRs-Fixed: 2403489 --- umac/dfs/core/src/dfs_etsi_precac.h | 18 +++++++++++++++++- umac/dfs/core/src/misc/dfs.c | 2 +- umac/dfs/core/src/misc/dfs_nol.c | 2 ++ umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h | 17 +++++++++++++++++ umac/dfs/dispatcher/src/wlan_dfs_utils_api.c | 14 ++++++++++++++ 5 files changed, 51 insertions(+), 2 deletions(-) diff --git a/umac/dfs/core/src/dfs_etsi_precac.h b/umac/dfs/core/src/dfs_etsi_precac.h index 18544c139da7..59c449b9bd7d 100644 --- a/umac/dfs/core/src/dfs_etsi_precac.h +++ b/umac/dfs/core/src/dfs_etsi_precac.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting * All rights reserved. * @@ -87,6 +87,22 @@ static inline void dfs_reset_etsiprecaclists(struct wlan_dfs *dfs) } #endif +/** + * dfs_add_to_etsi_precac_required_list()- Add channel to ETSI PreCAC Required + * list. + * + * @dfs: Pointer to wlan_dfs structure. + * @chan: Pointer to channel to be added to ETSI PreCAC Required List. + */ +#if defined(QCA_SUPPORT_ETSI_PRECAC_DFS) +void dfs_add_to_etsi_precac_required_list(struct wlan_dfs *dfs, uint8_t *chan); +#else +static inline void dfs_add_to_etsi_precac_required_list(struct wlan_dfs *dfs, + uint8_t *chan) +{ +} +#endif + /** * dfs_deinit_etsi_precac_list() - Clears the etsi precac list. * @dfs: Pointer to wlan_dfs dtructure. diff --git a/umac/dfs/core/src/misc/dfs.c b/umac/dfs/core/src/misc/dfs.c index fa0ea7c5e5db..d69592f7beda 100644 --- a/umac/dfs/core/src/misc/dfs.c +++ b/umac/dfs/core/src/misc/dfs.c @@ -255,9 +255,9 @@ void dfs_detach(struct wlan_dfs *dfs) dfs_timer_detach(dfs); if (!dfs->dfs_is_offload_enabled) dfs_main_detach(dfs); - dfs_etsi_precac_detach(dfs); dfs_zero_cac_detach(dfs); dfs_nol_detach(dfs); + dfs_etsi_precac_detach(dfs); } #ifndef WLAN_DFS_STATIC_MEM_ALLOC diff --git a/umac/dfs/core/src/misc/dfs_nol.c b/umac/dfs/core/src/misc/dfs_nol.c index f135f5c05dd7..b064bee20403 100644 --- a/umac/dfs/core/src/misc/dfs_nol.c +++ b/umac/dfs/core/src/misc/dfs_nol.c @@ -251,6 +251,8 @@ static os_timer_func(dfs_remove_from_nol) chan = utils_dfs_freq_to_chan(delfreq); dfs_debug(dfs, WLAN_DEBUG_DFS_NOL, "remove channel %d from nol", chan); + utils_dfs_add_to_etsi_precac_required_list(dfs->dfs_pdev_obj, + &chan); utils_dfs_reg_update_nol_ch(dfs->dfs_pdev_obj, &chan, 1, DFS_NOL_RESET); utils_dfs_save_nol(dfs->dfs_pdev_obj); diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h index f6f6ed0043f7..134ea6d36ad6 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_utils_api.h @@ -145,6 +145,23 @@ static inline QDF_STATUS utils_dfs_reset_etsi_precaclists( } #endif +/** utils_dfs_add_to_etsi_precac_required_list() - Add channel to ETSI PreCAC + * Required list. + * @pdev: Pointer to DFS pdev object. + * @chan: Pointer to channel to be added to ETSI PreCAC Required List. + * + * Return: void + */ +#ifdef QCA_SUPPORT_ETSI_PRECAC_DFS +void utils_dfs_add_to_etsi_precac_required_list(struct wlan_objmgr_pdev *pdev, + uint8_t *chan); +#else +static inline void +utils_dfs_add_to_etsi_precac_required_list(struct wlan_objmgr_pdev *pdev, + uint8_t *chan) +{ +} +#endif /** * utils_dfs_cancel_precac_timer() - Cancel the precac timer. * @pdev: Pointer to DFS pdev object. diff --git a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c index 39665054d907..242162d5d2b0 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_utils_api.c @@ -115,6 +115,20 @@ QDF_STATUS utils_dfs_reset_etsi_precaclists(struct wlan_objmgr_pdev *pdev) } qdf_export_symbol(utils_dfs_reset_etsi_precaclists); + +void utils_dfs_add_to_etsi_precac_required_list(struct wlan_objmgr_pdev *pdev, + uint8_t *chan) +{ + struct wlan_dfs *dfs; + + dfs = wlan_pdev_get_dfs_obj(pdev); + if (!dfs) + return; + + dfs_add_to_etsi_precac_required_list(dfs, chan); +} + +qdf_export_symbol(utils_dfs_add_to_etsi_precac_required_list); #endif QDF_STATUS utils_dfs_cancel_precac_timer(struct wlan_objmgr_pdev *pdev)