Commit f10d4c18 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: rename variables using camelCase in host_int_ParseJoinBssParam()

Fix "Avoid CamelCase:" issue reported by checkpatch.pl script.
Rename host_int_ParseJoinBssParam() & its variables using camelCase.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5c5e6ef6
...@@ -265,7 +265,7 @@ static struct wilc_vif *join_req_vif; ...@@ -265,7 +265,7 @@ static struct wilc_vif *join_req_vif;
#define FLUSHED_JOIN_REQ 1 #define FLUSHED_JOIN_REQ 1
#define FLUSHED_BYTE_POS 79 #define FLUSHED_BYTE_POS 79
static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo); static void *host_int_parse_join_bss_param(struct network_info *info);
static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx); static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
static s32 Handle_ScanDone(struct wilc_vif *vif, enum scan_event enuEvent); static s32 Handle_ScanDone(struct wilc_vif *vif, enum scan_event enuEvent);
static void host_if_work(struct work_struct *work); static void host_if_work(struct work_struct *work);
...@@ -1288,7 +1288,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif, ...@@ -1288,7 +1288,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
hif_drv->usr_scan_req.rcvd_ch_cnt++; hif_drv->usr_scan_req.rcvd_ch_cnt++;
pstrNetworkInfo->new_network = true; pstrNetworkInfo->new_network = true;
pJoinParams = host_int_ParseJoinBssParam(pstrNetworkInfo); pJoinParams = host_int_parse_join_bss_param(pstrNetworkInfo);
hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo, hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
hif_drv->usr_scan_req.arg, hif_drv->usr_scan_req.arg,
...@@ -3870,152 +3870,152 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled, ...@@ -3870,152 +3870,152 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
return result; return result;
} }
static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo) static void *host_int_parse_join_bss_param(struct network_info *info)
{ {
struct join_bss_param *pNewJoinBssParam = NULL; struct join_bss_param *param = NULL;
u8 *pu8IEs; u8 *ies;
u16 u16IEsLen; u16 ies_len;
u16 index = 0; u16 index = 0;
u8 suppRatesNo = 0; u8 rates_no = 0;
u8 extSuppRatesNo; u8 ext_rates_no;
u16 jumpOffset; u16 offset;
u8 pcipherCount; u8 pcipher_cnt;
u8 authCount; u8 auth_cnt;
u8 pcipherTotalCount = 0; u8 pcipher_total_cnt = 0;
u8 authTotalCount = 0; u8 auth_total_cnt = 0;
u8 i, j; u8 i, j;
pu8IEs = ptstrNetworkInfo->ies; ies = info->ies;
u16IEsLen = ptstrNetworkInfo->ies_len; ies_len = info->ies_len;
pNewJoinBssParam = kzalloc(sizeof(*pNewJoinBssParam), GFP_KERNEL); param = kzalloc(sizeof(*param), GFP_KERNEL);
if (pNewJoinBssParam) { if (param) {
pNewJoinBssParam->dtim_period = ptstrNetworkInfo->dtim_period; param->dtim_period = info->dtim_period;
pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period; param->beacon_period = info->beacon_period;
pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info; param->cap_info = info->cap_info;
memcpy(pNewJoinBssParam->bssid, ptstrNetworkInfo->bssid, 6); memcpy(param->bssid, info->bssid, 6);
memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid, memcpy((u8 *)param->ssid, info->ssid,
ptstrNetworkInfo->ssid_len + 1); info->ssid_len + 1);
pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len; param->ssid_len = info->ssid_len;
memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3); memset(param->rsn_pcip_policy, 0xFF, 3);
memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3); memset(param->rsn_auth_policy, 0xFF, 3);
while (index < u16IEsLen) { while (index < ies_len) {
if (pu8IEs[index] == SUPP_RATES_IE) { if (ies[index] == SUPP_RATES_IE) {
suppRatesNo = pu8IEs[index + 1]; rates_no = ies[index + 1];
pNewJoinBssParam->supp_rates[0] = suppRatesNo; param->supp_rates[0] = rates_no;
index += 2; index += 2;
for (i = 0; i < suppRatesNo; i++) for (i = 0; i < rates_no; i++)
pNewJoinBssParam->supp_rates[i + 1] = pu8IEs[index + i]; param->supp_rates[i + 1] = ies[index + i];
index += suppRatesNo; index += rates_no;
} else if (pu8IEs[index] == EXT_SUPP_RATES_IE) { } else if (ies[index] == EXT_SUPP_RATES_IE) {
extSuppRatesNo = pu8IEs[index + 1]; ext_rates_no = ies[index + 1];
if (extSuppRatesNo > (MAX_RATES_SUPPORTED - suppRatesNo)) if (ext_rates_no > (MAX_RATES_SUPPORTED - rates_no))
pNewJoinBssParam->supp_rates[0] = MAX_RATES_SUPPORTED; param->supp_rates[0] = MAX_RATES_SUPPORTED;
else else
pNewJoinBssParam->supp_rates[0] += extSuppRatesNo; param->supp_rates[0] += ext_rates_no;
index += 2; index += 2;
for (i = 0; i < (pNewJoinBssParam->supp_rates[0] - suppRatesNo); i++) for (i = 0; i < (param->supp_rates[0] - rates_no); i++)
pNewJoinBssParam->supp_rates[suppRatesNo + i + 1] = pu8IEs[index + i]; param->supp_rates[rates_no + i + 1] = ies[index + i];
index += extSuppRatesNo; index += ext_rates_no;
} else if (pu8IEs[index] == HT_CAPABILITY_IE) { } else if (ies[index] == HT_CAPABILITY_IE) {
pNewJoinBssParam->ht_capable = true; param->ht_capable = true;
index += pu8IEs[index + 1] + 2; index += ies[index + 1] + 2;
} else if ((pu8IEs[index] == WMM_IE) && } else if ((ies[index] == WMM_IE) &&
(pu8IEs[index + 2] == 0x00) && (pu8IEs[index + 3] == 0x50) && (ies[index + 2] == 0x00) && (ies[index + 3] == 0x50) &&
(pu8IEs[index + 4] == 0xF2) && (ies[index + 4] == 0xF2) &&
(pu8IEs[index + 5] == 0x02) && (ies[index + 5] == 0x02) &&
((pu8IEs[index + 6] == 0x00) || (pu8IEs[index + 6] == 0x01)) && ((ies[index + 6] == 0x00) || (ies[index + 6] == 0x01)) &&
(pu8IEs[index + 7] == 0x01)) { (ies[index + 7] == 0x01)) {
pNewJoinBssParam->wmm_cap = true; param->wmm_cap = true;
if (pu8IEs[index + 8] & BIT(7)) if (ies[index + 8] & BIT(7))
pNewJoinBssParam->uapsd_cap = true; param->uapsd_cap = true;
index += pu8IEs[index + 1] + 2; index += ies[index + 1] + 2;
} else if ((pu8IEs[index] == P2P_IE) && } else if ((ies[index] == P2P_IE) &&
(pu8IEs[index + 2] == 0x50) && (pu8IEs[index + 3] == 0x6f) && (ies[index + 2] == 0x50) && (ies[index + 3] == 0x6f) &&
(pu8IEs[index + 4] == 0x9a) && (ies[index + 4] == 0x9a) &&
(pu8IEs[index + 5] == 0x09) && (pu8IEs[index + 6] == 0x0c)) { (ies[index + 5] == 0x09) && (ies[index + 6] == 0x0c)) {
u16 u16P2P_count; u16 p2p_cnt;
pNewJoinBssParam->tsf = ptstrNetworkInfo->tsf_lo; param->tsf = info->tsf_lo;
pNewJoinBssParam->noa_enabled = 1; param->noa_enabled = 1;
pNewJoinBssParam->idx = pu8IEs[index + 9]; param->idx = ies[index + 9];
if (pu8IEs[index + 10] & BIT(7)) { if (ies[index + 10] & BIT(7)) {
pNewJoinBssParam->opp_enabled = 1; param->opp_enabled = 1;
pNewJoinBssParam->ct_window = pu8IEs[index + 10]; param->ct_window = ies[index + 10];
} else { } else {
pNewJoinBssParam->opp_enabled = 0; param->opp_enabled = 0;
} }
pNewJoinBssParam->cnt = pu8IEs[index + 11]; param->cnt = ies[index + 11];
u16P2P_count = index + 12; p2p_cnt = index + 12;
memcpy(pNewJoinBssParam->duration, pu8IEs + u16P2P_count, 4); memcpy(param->duration, ies + p2p_cnt, 4);
u16P2P_count += 4; p2p_cnt += 4;
memcpy(pNewJoinBssParam->interval, pu8IEs + u16P2P_count, 4); memcpy(param->interval, ies + p2p_cnt, 4);
u16P2P_count += 4; p2p_cnt += 4;
memcpy(pNewJoinBssParam->start_time, pu8IEs + u16P2P_count, 4); memcpy(param->start_time, ies + p2p_cnt, 4);
index += pu8IEs[index + 1] + 2; index += ies[index + 1] + 2;
} else if ((pu8IEs[index] == RSN_IE) || } else if ((ies[index] == RSN_IE) ||
((pu8IEs[index] == WPA_IE) && (pu8IEs[index + 2] == 0x00) && ((ies[index] == WPA_IE) && (ies[index + 2] == 0x00) &&
(pu8IEs[index + 3] == 0x50) && (pu8IEs[index + 4] == 0xF2) && (ies[index + 3] == 0x50) && (ies[index + 4] == 0xF2) &&
(pu8IEs[index + 5] == 0x01))) { (ies[index + 5] == 0x01))) {
u16 rsnIndex = index; u16 rsn_idx = index;
if (pu8IEs[rsnIndex] == RSN_IE) { if (ies[rsn_idx] == RSN_IE) {
pNewJoinBssParam->mode_802_11i = 2; param->mode_802_11i = 2;
} else { } else {
if (pNewJoinBssParam->mode_802_11i == 0) if (param->mode_802_11i == 0)
pNewJoinBssParam->mode_802_11i = 1; param->mode_802_11i = 1;
rsnIndex += 4; rsn_idx += 4;
} }
rsnIndex += 7; rsn_idx += 7;
pNewJoinBssParam->rsn_grp_policy = pu8IEs[rsnIndex]; param->rsn_grp_policy = ies[rsn_idx];
rsnIndex++; rsn_idx++;
jumpOffset = pu8IEs[rsnIndex] * 4; offset = ies[rsn_idx] * 4;
pcipherCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex]; pcipher_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
rsnIndex += 2; rsn_idx += 2;
for (i = pcipherTotalCount, j = 0; i < pcipherCount + pcipherTotalCount && i < 3; i++, j++) for (i = pcipher_total_cnt, j = 0; i < pcipher_cnt + pcipher_total_cnt && i < 3; i++, j++)
pNewJoinBssParam->rsn_pcip_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1]; param->rsn_pcip_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
pcipherTotalCount += pcipherCount; pcipher_total_cnt += pcipher_cnt;
rsnIndex += jumpOffset; rsn_idx += offset;
jumpOffset = pu8IEs[rsnIndex] * 4; offset = ies[rsn_idx] * 4;
authCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex]; auth_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
rsnIndex += 2; rsn_idx += 2;
for (i = authTotalCount, j = 0; i < authTotalCount + authCount; i++, j++) for (i = auth_total_cnt, j = 0; i < auth_total_cnt + auth_cnt; i++, j++)
pNewJoinBssParam->rsn_auth_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1]; param->rsn_auth_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
authTotalCount += authCount; auth_total_cnt += auth_cnt;
rsnIndex += jumpOffset; rsn_idx += offset;
if (pu8IEs[index] == RSN_IE) { if (ies[index] == RSN_IE) {
pNewJoinBssParam->rsn_cap[0] = pu8IEs[rsnIndex]; param->rsn_cap[0] = ies[rsn_idx];
pNewJoinBssParam->rsn_cap[1] = pu8IEs[rsnIndex + 1]; param->rsn_cap[1] = ies[rsn_idx + 1];
rsnIndex += 2; rsn_idx += 2;
} }
pNewJoinBssParam->rsn_found = true; param->rsn_found = true;
index += pu8IEs[index + 1] + 2; index += ies[index + 1] + 2;
} else { } else {
index += pu8IEs[index + 1] + 2; index += ies[index + 1] + 2;
} }
} }
} }
return (void *)pNewJoinBssParam; return (void *)param;
} }
int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx) int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
......
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