From 1d6bab1b0bfe0cf00249815b0c03f751ab4e2897 Mon Sep 17 00:00:00 2001 From: Lincoln Tran Date: Fri, 26 Mar 2021 10:31:15 -0700 Subject: [PATCH] qcacmn: Drop ch avoid event if list is empty Add check to drop the avoid channel list event if the range count is 0 since it would not affect the channel list anyways. Also, add the rate limited debug print for the target_if module. Change-Id: I176b9c09106cc0d7f5cfbc474912e4a48d633ff2 CRs-fixed: 2909614 --- target_if/core/inc/target_if.h | 2 ++ target_if/regulatory/src/target_if_reg_lte.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/target_if/core/inc/target_if.h b/target_if/core/inc/target_if.h index 956d5f835332..84fdfc31454c 100644 --- a/target_if/core/inc/target_if.h +++ b/target_if/core/inc/target_if.h @@ -51,6 +51,8 @@ QDF_TRACE_EXIT(QDF_MODULE_ID_TARGET_IF, "exit") #define target_if_err_rl(params...) \ QDF_TRACE_ERROR_RL(QDF_MODULE_ID_TARGET_IF, params) +#define target_if_debug_rl(params...) \ + QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_TARGET_IF, params) #define targetif_nofl_fatal(params...) \ diff --git a/target_if/regulatory/src/target_if_reg_lte.c b/target_if/regulatory/src/target_if_reg_lte.c index 762240a62eee..e0b25c2c2965 100644 --- a/target_if/regulatory/src/target_if_reg_lte.c +++ b/target_if/regulatory/src/target_if_reg_lte.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -75,6 +75,11 @@ static int tgt_reg_ch_avoid_event_handler(ol_scn_t handle, uint8_t *event_buf, return -EFAULT; } + if (!ch_avoid_event.ch_avoid_range_cnt) { + target_if_debug_rl("ch avoid range count is 0, dropping the event"); + return 0; + } + status = reg_rx_ops->reg_ch_avoid_event_handler(psoc, &ch_avoid_event); if (status != QDF_STATUS_SUCCESS) { target_if_err("Failed to process CH avoid event");