From 68e6831e6394cba73cf64f071a8a02f83c13c659 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Tue, 15 Apr 2014 19:44:35 +0200 Subject: [PATCH] staging: rtl8723au: init_channel_set(): Restructure variable names Shorten variable names allowing for fewer broken lines due to the large number of indents. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 96 +++++++++---------- 1 file changed, 44 insertions(+), 52 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 3f2f8f91d056..c2ab4c66607c 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -419,96 +419,88 @@ static void init_channel_list(struct rtw_adapter *padapter, channel_list->reg_classes = cla; } -static u8 init_channel_set(struct rtw_adapter* padapter, u8 ChannelPlan, - struct rt_channel_info *channel_set) +static u8 init_channel_set(struct rtw_adapter* padapter, u8 cplan, + struct rt_channel_info *c_set) { - u8 index, chanset_size = 0; - u8 b5GBand = false, b2_4GBand = false; - u8 Index2G = 0, Index5G = 0; + u8 i, ch_size = 0; + u8 b5GBand = false, b2_4GBand = false; + u8 Index2G = 0, Index5G = 0; - memset(channel_set, 0, sizeof(struct rt_channel_info)*MAX_CHANNEL_NUM); + memset(c_set, 0, sizeof(struct rt_channel_info) * MAX_CHANNEL_NUM); - if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && - ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) { - DBG_8723A("ChannelPlan ID %x error !!!!!\n", ChannelPlan); - return chanset_size; + if (cplan >= RT_CHANNEL_DOMAIN_MAX && + cplan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) { + DBG_8723A("ChannelPlan ID %x error !!!!!\n", cplan); + return ch_size; } if (padapter->registrypriv.wireless_mode & WIRELESS_11G) { b2_4GBand = true; - if (RT_CHANNEL_DOMAIN_REALTEK_DEFINE == ChannelPlan) + if (RT_CHANNEL_DOMAIN_REALTEK_DEFINE == cplan) Index2G = RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE.Index2G; else - Index2G = RTW_ChannelPlanMap[ChannelPlan].Index2G; + Index2G = RTW_ChannelPlanMap[cplan].Index2G; } if (padapter->registrypriv.wireless_mode & WIRELESS_11A) { b5GBand = true; - if (RT_CHANNEL_DOMAIN_REALTEK_DEFINE == ChannelPlan) + if (RT_CHANNEL_DOMAIN_REALTEK_DEFINE == cplan) Index5G = RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE.Index5G; else - Index5G = RTW_ChannelPlanMap[ChannelPlan].Index5G; + Index5G = RTW_ChannelPlanMap[cplan].Index5G; } if (b2_4GBand) { - for (index = 0; index= 1 && - channel_set[chanset_size].ChannelNum <= 11) - channel_set[chanset_size].ScanType = - SCAN_ACTIVE; - else if ((channel_set[chanset_size].ChannelNum >= 12 && - channel_set[chanset_size].ChannelNum <= 14)) - channel_set[chanset_size].ScanType = - SCAN_PASSIVE; - } else if (RT_CHANNEL_DOMAIN_WORLD_WIDE_13 == - ChannelPlan || - RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == - ChannelPlan || + RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G == cplan) { + if (c_set[ch_size].ChannelNum >= 1 && + c_set[ch_size].ChannelNum <= 11) + c_set[ch_size].ScanType = SCAN_ACTIVE; + else if (c_set[ch_size].ChannelNum >= 12 && + c_set[ch_size].ChannelNum <= 14) + c_set[ch_size].ScanType = SCAN_PASSIVE; + } else if (RT_CHANNEL_DOMAIN_WORLD_WIDE_13 == cplan || + RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == cplan || RT_CHANNEL_DOMAIN_2G_WORLD == Index2G) { /* channel 12~13, passive scan */ - if (channel_set[chanset_size].ChannelNum <= 11) - channel_set[chanset_size].ScanType = - SCAN_ACTIVE; + if (c_set[ch_size].ChannelNum <= 11) + c_set[ch_size].ScanType = SCAN_ACTIVE; else - channel_set[chanset_size].ScanType = - SCAN_PASSIVE; + c_set[ch_size].ScanType = SCAN_PASSIVE; } else - channel_set[chanset_size].ScanType = - SCAN_ACTIVE; + c_set[ch_size].ScanType = SCAN_ACTIVE; - chanset_size++; + ch_size++; } } if (b5GBand) { - for (index = 0;index= 149) { - channel_set[chanset_size].ChannelNum = - RTW_ChannelPlan5G[Index5G].Channel[index]; - if (RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == - ChannelPlan) { + for (i = 0; i < RTW_ChannelPlan5G[Index5G].Len; i++) { + if (RTW_ChannelPlan5G[Index5G].Channel[i] <= 48 || + RTW_ChannelPlan5G[Index5G].Channel[i] >= 149) { + c_set[ch_size].ChannelNum = + RTW_ChannelPlan5G[Index5G].Channel[i]; + if (RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == cplan) { /* passive scan for all 5G channels */ - channel_set[chanset_size].ScanType = + c_set[ch_size].ScanType = SCAN_PASSIVE; } else - channel_set[chanset_size].ScanType = + c_set[ch_size].ScanType = SCAN_ACTIVE; DBG_8723A("%s(): channel_set[%d].ChannelNum = " - "%d\n", __func__, chanset_size, - channel_set[chanset_size].ChannelNum); - chanset_size++; + "%d\n", __func__, ch_size, + c_set[ch_size].ChannelNum); + ch_size++; } } } - return chanset_size; + return ch_size; } int init_mlme_ext_priv23a(struct rtw_adapter* padapter)