Explorar o código

qcacmn: Don't update channel if it is disabled

If a channel is disabled when changing the band settings, a subsequent
function such as modifying for indoor channels can override this state.
Add a check in the indoor channel modification to make sure channel is
not disabled first, before proceeding.

Change-Id: Ic47391ca2ceaee7dc0909e0c81b06b81d49d3893
CRs-fixed: 3071801
Lincoln Tran %!s(int64=3) %!d(string=hai) anos
pai
achega
2f9ac643f6
Modificáronse 1 ficheiros con 9 adicións e 4 borrados
  1. 9 4
      umac/regulatory/core/src/reg_build_chan_list.c

+ 9 - 4
umac/regulatory/core/src/reg_build_chan_list.c

@@ -1,5 +1,6 @@
 /*
 /*
  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -324,8 +325,10 @@ static void reg_modify_chan_list_for_indoor_channels(
 
 
 	if (!pdev_priv_obj->indoor_chan_enabled) {
 	if (!pdev_priv_obj->indoor_chan_enabled) {
 		for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
 		for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
-			if (REGULATORY_CHAN_INDOOR_ONLY &
-			    chan_list[chan_enum].chan_flags) {
+			if (!(REGULATORY_CHAN_DISABLED &
+			      chan_list[chan_enum].chan_flags) &&
+			    (REGULATORY_CHAN_INDOOR_ONLY &
+			     chan_list[chan_enum].chan_flags)) {
 				chan_list[chan_enum].state =
 				chan_list[chan_enum].state =
 					CHANNEL_STATE_DFS;
 					CHANNEL_STATE_DFS;
 				chan_list[chan_enum].chan_flags |=
 				chan_list[chan_enum].chan_flags |=
@@ -337,8 +340,10 @@ static void reg_modify_chan_list_for_indoor_channels(
 	if (pdev_priv_obj->force_ssc_disable_indoor_channel &&
 	if (pdev_priv_obj->force_ssc_disable_indoor_channel &&
 	    pdev_priv_obj->sap_state) {
 	    pdev_priv_obj->sap_state) {
 		for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
 		for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
-			if (REGULATORY_CHAN_INDOOR_ONLY &
-			    chan_list[chan_enum].chan_flags) {
+			if (!(REGULATORY_CHAN_DISABLED &
+			      chan_list[chan_enum].chan_flags) &&
+			    (REGULATORY_CHAN_INDOOR_ONLY &
+			    chan_list[chan_enum].chan_flags)) {
 				chan_list[chan_enum].state =
 				chan_list[chan_enum].state =
 					CHANNEL_STATE_DISABLE;
 					CHANNEL_STATE_DISABLE;
 				chan_list[chan_enum].chan_flags |=
 				chan_list[chan_enum].chan_flags |=