From 2cd5c4ca258b37c2357eda8da1585f254687b37d Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Fri, 4 Jan 2019 15:56:21 +0530 Subject: [PATCH] qcacmn: Rectify logic for disabling indoor channels on SAP start Currently the logic present for disabling the indoor channels during SAP start is not complete. The way of using the two ini deviates the driver from the expected behavior. Mark the indoor channels correctly during SAP start and SAP stop as per the expected behavior. Change-Id: Ia136dcbc4f20ad72812f096531863aeb5fbe66fb CRs-Fixed: 2368218 --- umac/regulatory/core/src/reg_services.c | 41 +++++++++---------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index a152cab392f9..27084d21fb04 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -2183,16 +2183,27 @@ static void reg_modify_chan_list_for_dfs_channels(struct regulatory_channel } } } + static void reg_modify_chan_list_for_indoor_channels( struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj) { enum channel_enum chan_enum; struct regulatory_channel *chan_list = pdev_priv_obj->cur_chan_list; - if (pdev_priv_obj->indoor_chan_enabled) - return; + if (!pdev_priv_obj->indoor_chan_enabled) { + for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) { + if (REGULATORY_CHAN_INDOOR_ONLY & + chan_list[chan_enum].chan_flags) { + chan_list[chan_enum].state = + CHANNEL_STATE_DFS; + chan_list[chan_enum].chan_flags |= + REGULATORY_CHAN_NO_IR; + } + } + } - if (!pdev_priv_obj->force_ssc_disable_indoor_channel) { + if (pdev_priv_obj->force_ssc_disable_indoor_channel && + pdev_priv_obj->sap_state) { for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) { if (REGULATORY_CHAN_INDOOR_ONLY & chan_list[chan_enum].chan_flags) { @@ -2202,30 +2213,6 @@ static void reg_modify_chan_list_for_indoor_channels( REGULATORY_CHAN_DISABLED; } } - } else { - - for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) { - - if (pdev_priv_obj->sap_state) { - - if (REGULATORY_CHAN_INDOOR_ONLY & - chan_list[chan_enum].chan_flags) { - chan_list[chan_enum].state = - CHANNEL_STATE_DISABLE; - chan_list[chan_enum].chan_flags |= - REGULATORY_CHAN_DISABLED; - } - } else { - - if (REGULATORY_CHAN_INDOOR_ONLY & - chan_list[chan_enum].chan_flags) { - chan_list[chan_enum].state = - CHANNEL_STATE_DFS; - chan_list[chan_enum].chan_flags |= - REGULATORY_CHAN_NO_IR; - } - } - } } }