Commit 68e6831e authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

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: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 34df0dd9
...@@ -419,96 +419,88 @@ static void init_channel_list(struct rtw_adapter *padapter, ...@@ -419,96 +419,88 @@ static void init_channel_list(struct rtw_adapter *padapter,
channel_list->reg_classes = cla; channel_list->reg_classes = cla;
} }
static u8 init_channel_set(struct rtw_adapter* padapter, u8 ChannelPlan, static u8 init_channel_set(struct rtw_adapter* padapter, u8 cplan,
struct rt_channel_info *channel_set) struct rt_channel_info *c_set)
{ {
u8 index, chanset_size = 0; u8 i, ch_size = 0;
u8 b5GBand = false, b2_4GBand = false; u8 b5GBand = false, b2_4GBand = false;
u8 Index2G = 0, Index5G = 0; 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 && if (cplan >= RT_CHANNEL_DOMAIN_MAX &&
ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) { cplan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE) {
DBG_8723A("ChannelPlan ID %x error !!!!!\n", ChannelPlan); DBG_8723A("ChannelPlan ID %x error !!!!!\n", cplan);
return chanset_size; return ch_size;
} }
if (padapter->registrypriv.wireless_mode & WIRELESS_11G) { if (padapter->registrypriv.wireless_mode & WIRELESS_11G) {
b2_4GBand = true; 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; Index2G = RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE.Index2G;
else else
Index2G = RTW_ChannelPlanMap[ChannelPlan].Index2G; Index2G = RTW_ChannelPlanMap[cplan].Index2G;
} }
if (padapter->registrypriv.wireless_mode & WIRELESS_11A) { if (padapter->registrypriv.wireless_mode & WIRELESS_11A) {
b5GBand = true; b5GBand = true;
if (RT_CHANNEL_DOMAIN_REALTEK_DEFINE == ChannelPlan) if (RT_CHANNEL_DOMAIN_REALTEK_DEFINE == cplan)
Index5G = RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE.Index5G; Index5G = RTW_CHANNEL_PLAN_MAP_REALTEK_DEFINE.Index5G;
else else
Index5G = RTW_ChannelPlanMap[ChannelPlan].Index5G; Index5G = RTW_ChannelPlanMap[cplan].Index5G;
} }
if (b2_4GBand) { if (b2_4GBand) {
for (index = 0; index<RTW_ChannelPlan2G[Index2G].Len; index++) { for (i = 0; i < RTW_ChannelPlan2G[Index2G].Len; i++) {
channel_set[chanset_size].ChannelNum = c_set[ch_size].ChannelNum =
RTW_ChannelPlan2G[Index2G].Channel[index]; RTW_ChannelPlan2G[Index2G].Channel[i];
if ((RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN == ChannelPlan) || if ((RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN == cplan) ||
/* Channel 1~11 is active, and 12~14 is passive */ /* Channel 1~11 is active, and 12~14 is passive */
(RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G == ChannelPlan)){ RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G == cplan) {
if (channel_set[chanset_size].ChannelNum >= 1 && if (c_set[ch_size].ChannelNum >= 1 &&
channel_set[chanset_size].ChannelNum <= 11) c_set[ch_size].ChannelNum <= 11)
channel_set[chanset_size].ScanType = c_set[ch_size].ScanType = SCAN_ACTIVE;
SCAN_ACTIVE; else if (c_set[ch_size].ChannelNum >= 12 &&
else if ((channel_set[chanset_size].ChannelNum >= 12 && c_set[ch_size].ChannelNum <= 14)
channel_set[chanset_size].ChannelNum <= 14)) c_set[ch_size].ScanType = SCAN_PASSIVE;
channel_set[chanset_size].ScanType = } else if (RT_CHANNEL_DOMAIN_WORLD_WIDE_13 == cplan ||
SCAN_PASSIVE; RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == cplan ||
} else if (RT_CHANNEL_DOMAIN_WORLD_WIDE_13 ==
ChannelPlan ||
RT_CHANNEL_DOMAIN_WORLD_WIDE_5G ==
ChannelPlan ||
RT_CHANNEL_DOMAIN_2G_WORLD == Index2G) { RT_CHANNEL_DOMAIN_2G_WORLD == Index2G) {
/* channel 12~13, passive scan */ /* channel 12~13, passive scan */
if (channel_set[chanset_size].ChannelNum <= 11) if (c_set[ch_size].ChannelNum <= 11)
channel_set[chanset_size].ScanType = c_set[ch_size].ScanType = SCAN_ACTIVE;
SCAN_ACTIVE;
else else
channel_set[chanset_size].ScanType = c_set[ch_size].ScanType = SCAN_PASSIVE;
SCAN_PASSIVE;
} else } else
channel_set[chanset_size].ScanType = c_set[ch_size].ScanType = SCAN_ACTIVE;
SCAN_ACTIVE;
chanset_size++; ch_size++;
} }
} }
if (b5GBand) { if (b5GBand) {
for (index = 0;index<RTW_ChannelPlan5G[Index5G].Len;index++) { for (i = 0; i < RTW_ChannelPlan5G[Index5G].Len; i++) {
if (RTW_ChannelPlan5G[Index5G].Channel[index] <= 48 || if (RTW_ChannelPlan5G[Index5G].Channel[i] <= 48 ||
RTW_ChannelPlan5G[Index5G].Channel[index] >= 149) { RTW_ChannelPlan5G[Index5G].Channel[i] >= 149) {
channel_set[chanset_size].ChannelNum = c_set[ch_size].ChannelNum =
RTW_ChannelPlan5G[Index5G].Channel[index]; RTW_ChannelPlan5G[Index5G].Channel[i];
if (RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == if (RT_CHANNEL_DOMAIN_WORLD_WIDE_5G == cplan) {
ChannelPlan) {
/* passive scan for all 5G channels */ /* passive scan for all 5G channels */
channel_set[chanset_size].ScanType = c_set[ch_size].ScanType =
SCAN_PASSIVE; SCAN_PASSIVE;
} else } else
channel_set[chanset_size].ScanType = c_set[ch_size].ScanType =
SCAN_ACTIVE; SCAN_ACTIVE;
DBG_8723A("%s(): channel_set[%d].ChannelNum = " DBG_8723A("%s(): channel_set[%d].ChannelNum = "
"%d\n", __func__, chanset_size, "%d\n", __func__, ch_size,
channel_set[chanset_size].ChannelNum); c_set[ch_size].ChannelNum);
chanset_size++; ch_size++;
} }
} }
} }
return chanset_size; return ch_size;
} }
int init_mlme_ext_priv23a(struct rtw_adapter* padapter) int init_mlme_ext_priv23a(struct rtw_adapter* padapter)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment