staging: wilc1000: fix line over 80 characters in host_int_parse_join_bss_param()
Split host_int_parse_join_bss_param() to avoid the line over 80 character issue reported by checkpatch.pl script. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8d4279c7ee
commit
d4b4aaba51
1 changed files with 137 additions and 122 deletions
|
@ -3827,38 +3827,18 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
|
|||
return result;
|
||||
}
|
||||
|
||||
static void *host_int_parse_join_bss_param(struct network_info *info)
|
||||
static void host_int_fill_join_bss_param(struct join_bss_param *param, u8 *ies,
|
||||
u16 *out_index, u8 *pcipher_tc,
|
||||
u8 *auth_total_cnt, u32 tsf_lo)
|
||||
{
|
||||
struct join_bss_param *param = NULL;
|
||||
u8 *ies;
|
||||
u16 ies_len;
|
||||
u16 index = 0;
|
||||
u8 rates_no = 0;
|
||||
u8 ext_rates_no;
|
||||
u16 offset;
|
||||
u8 pcipher_cnt;
|
||||
u8 auth_cnt;
|
||||
u8 pcipher_total_cnt = 0;
|
||||
u8 auth_total_cnt = 0;
|
||||
u8 i, j;
|
||||
u16 index = *out_index;
|
||||
|
||||
ies = info->ies;
|
||||
ies_len = info->ies_len;
|
||||
|
||||
param = kzalloc(sizeof(*param), GFP_KERNEL);
|
||||
if (!param)
|
||||
return NULL;
|
||||
|
||||
param->dtim_period = info->dtim_period;
|
||||
param->beacon_period = info->beacon_period;
|
||||
param->cap_info = info->cap_info;
|
||||
memcpy(param->bssid, info->bssid, 6);
|
||||
memcpy((u8 *)param->ssid, info->ssid, info->ssid_len + 1);
|
||||
param->ssid_len = info->ssid_len;
|
||||
memset(param->rsn_pcip_policy, 0xFF, 3);
|
||||
memset(param->rsn_auth_policy, 0xFF, 3);
|
||||
|
||||
while (index < ies_len) {
|
||||
if (ies[index] == SUPP_RATES_IE) {
|
||||
rates_no = ies[index + 1];
|
||||
param->supp_rates[0] = rates_no;
|
||||
|
@ -3884,8 +3864,7 @@ static void *host_int_parse_join_bss_param(struct network_info *info)
|
|||
index += ies[index + 1] + 2;
|
||||
} else if ((ies[index] == WMM_IE) &&
|
||||
(ies[index + 2] == 0x00) && (ies[index + 3] == 0x50) &&
|
||||
(ies[index + 4] == 0xF2) &&
|
||||
(ies[index + 5] == 0x02) &&
|
||||
(ies[index + 4] == 0xF2) && (ies[index + 5] == 0x02) &&
|
||||
((ies[index + 6] == 0x00) || (ies[index + 6] == 0x01)) &&
|
||||
(ies[index + 7] == 0x01)) {
|
||||
param->wmm_cap = true;
|
||||
|
@ -3899,7 +3878,7 @@ static void *host_int_parse_join_bss_param(struct network_info *info)
|
|||
(ies[index + 5] == 0x09) && (ies[index + 6] == 0x0c)) {
|
||||
u16 p2p_cnt;
|
||||
|
||||
param->tsf = info->tsf_lo;
|
||||
param->tsf = tsf_lo;
|
||||
param->noa_enabled = 1;
|
||||
param->idx = ies[index + 9];
|
||||
|
||||
|
@ -3943,19 +3922,28 @@ static void *host_int_parse_join_bss_param(struct network_info *info)
|
|||
pcipher_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
|
||||
rsn_idx += 2;
|
||||
|
||||
for (i = pcipher_total_cnt, j = 0; i < pcipher_cnt + pcipher_total_cnt && i < 3; i++, j++)
|
||||
param->rsn_pcip_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
|
||||
i = *pcipher_tc;
|
||||
j = 0;
|
||||
for (; i < (pcipher_cnt + *pcipher_tc) && i < 3; i++, j++) {
|
||||
u8 *policy = ¶m->rsn_pcip_policy[i];
|
||||
|
||||
pcipher_total_cnt += pcipher_cnt;
|
||||
*policy = ies[rsn_idx + ((j + 1) * 4) - 1];
|
||||
}
|
||||
|
||||
*pcipher_tc += pcipher_cnt;
|
||||
rsn_idx += offset;
|
||||
|
||||
offset = ies[rsn_idx] * 4;
|
||||
|
||||
auth_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
|
||||
rsn_idx += 2;
|
||||
i = *auth_total_cnt;
|
||||
j = 0;
|
||||
for (; i < (*auth_total_cnt + auth_cnt); i++, j++) {
|
||||
u8 *policy = ¶m->rsn_auth_policy[i];
|
||||
|
||||
for (i = auth_total_cnt, j = 0; i < auth_total_cnt + auth_cnt; i++, j++)
|
||||
param->rsn_auth_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
|
||||
*policy = ies[rsn_idx + ((j + 1) * 4) - 1];
|
||||
}
|
||||
|
||||
auth_total_cnt += auth_cnt;
|
||||
rsn_idx += offset;
|
||||
|
@ -3970,7 +3958,34 @@ static void *host_int_parse_join_bss_param(struct network_info *info)
|
|||
} else {
|
||||
index += ies[index + 1] + 2;
|
||||
}
|
||||
}
|
||||
|
||||
*out_index = index;
|
||||
}
|
||||
|
||||
static void *host_int_parse_join_bss_param(struct network_info *info)
|
||||
{
|
||||
struct join_bss_param *param = NULL;
|
||||
u16 index = 0;
|
||||
u8 pcipher_total_cnt = 0;
|
||||
u8 auth_total_cnt = 0;
|
||||
|
||||
param = kzalloc(sizeof(*param), GFP_KERNEL);
|
||||
if (!param)
|
||||
return NULL;
|
||||
|
||||
param->dtim_period = info->dtim_period;
|
||||
param->beacon_period = info->beacon_period;
|
||||
param->cap_info = info->cap_info;
|
||||
memcpy(param->bssid, info->bssid, 6);
|
||||
memcpy((u8 *)param->ssid, info->ssid, info->ssid_len + 1);
|
||||
param->ssid_len = info->ssid_len;
|
||||
memset(param->rsn_pcip_policy, 0xFF, 3);
|
||||
memset(param->rsn_auth_policy, 0xFF, 3);
|
||||
|
||||
while (index < info->ies_len)
|
||||
host_int_fill_join_bss_param(param, info->ies, &index,
|
||||
&pcipher_total_cnt,
|
||||
&auth_total_cnt, info->tsf_lo);
|
||||
|
||||
return (void *)param;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue