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

staging: wilc1000: rename pstrHostIFkeyAttr to avoid camelCase issue

Fix 'Avoid camelCase' issue found by checkpatch.pl script.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 172148b8
...@@ -1538,8 +1538,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif, ...@@ -1538,8 +1538,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
return result; return result;
} }
static int handle_key(struct wilc_vif *vif, static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
struct key_attr *pstrHostIFkeyAttr)
{ {
s32 result = 0; s32 result = 0;
struct wid wid; struct wid wid;
...@@ -1550,76 +1549,76 @@ static int handle_key(struct wilc_vif *vif, ...@@ -1550,76 +1549,76 @@ static int handle_key(struct wilc_vif *vif,
s8 ret = 0; s8 ret = 0;
struct host_if_drv *hif_drv = vif->hif_drv; struct host_if_drv *hif_drv = vif->hif_drv;
switch (pstrHostIFkeyAttr->type) { switch (hif_key->type) {
case WEP: case WEP:
if (pstrHostIFkeyAttr->action & ADDKEY_AP) { if (hif_key->action & ADDKEY_AP) {
wid_list[0].id = (u16)WID_11I_MODE; wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].type = WID_CHAR; wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char); wid_list[0].size = sizeof(char);
wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.mode; wid_list[0].val = (s8 *)&hif_key->attr.wep.mode;
wid_list[1].id = WID_AUTH_TYPE; wid_list[1].id = WID_AUTH_TYPE;
wid_list[1].type = WID_CHAR; wid_list[1].type = WID_CHAR;
wid_list[1].size = sizeof(char); wid_list[1].size = sizeof(char);
wid_list[1].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.auth_type; wid_list[1].val = (s8 *)&hif_key->attr.wep.auth_type;
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2, pu8keybuf = kmalloc(hif_key->attr.wep.key_len + 2,
GFP_KERNEL); GFP_KERNEL);
if (!pu8keybuf) if (!pu8keybuf)
return -ENOMEM; return -ENOMEM;
pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index; pu8keybuf[0] = hif_key->attr.wep.index;
pu8keybuf[1] = pstrHostIFkeyAttr->attr.wep.key_len; pu8keybuf[1] = hif_key->attr.wep.key_len;
memcpy(&pu8keybuf[2], pstrHostIFkeyAttr->attr.wep.key, memcpy(&pu8keybuf[2], hif_key->attr.wep.key,
pstrHostIFkeyAttr->attr.wep.key_len); hif_key->attr.wep.key_len);
kfree(pstrHostIFkeyAttr->attr.wep.key); kfree(hif_key->attr.wep.key);
wid_list[2].id = (u16)WID_WEP_KEY_VALUE; wid_list[2].id = (u16)WID_WEP_KEY_VALUE;
wid_list[2].type = WID_STR; wid_list[2].type = WID_STR;
wid_list[2].size = pstrHostIFkeyAttr->attr.wep.key_len + 2; wid_list[2].size = hif_key->attr.wep.key_len + 2;
wid_list[2].val = (s8 *)pu8keybuf; wid_list[2].val = (s8 *)pu8keybuf;
result = wilc_send_config_pkt(vif, SET_CFG, result = wilc_send_config_pkt(vif, SET_CFG,
wid_list, 3, wid_list, 3,
wilc_get_vif_idx(vif)); wilc_get_vif_idx(vif));
kfree(pu8keybuf); kfree(pu8keybuf);
} else if (pstrHostIFkeyAttr->action & ADDKEY) { } else if (hif_key->action & ADDKEY) {
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2, GFP_KERNEL); pu8keybuf = kmalloc(hif_key->attr.wep.key_len + 2, GFP_KERNEL);
if (!pu8keybuf) if (!pu8keybuf)
return -ENOMEM; return -ENOMEM;
pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index; pu8keybuf[0] = hif_key->attr.wep.index;
memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->attr.wep.key_len, 1); memcpy(pu8keybuf + 1, &hif_key->attr.wep.key_len, 1);
memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->attr.wep.key, memcpy(pu8keybuf + 2, hif_key->attr.wep.key,
pstrHostIFkeyAttr->attr.wep.key_len); hif_key->attr.wep.key_len);
kfree(pstrHostIFkeyAttr->attr.wep.key); kfree(hif_key->attr.wep.key);
wid.id = (u16)WID_ADD_WEP_KEY; wid.id = (u16)WID_ADD_WEP_KEY;
wid.type = WID_STR; wid.type = WID_STR;
wid.val = (s8 *)pu8keybuf; wid.val = (s8 *)pu8keybuf;
wid.size = pstrHostIFkeyAttr->attr.wep.key_len + 2; wid.size = hif_key->attr.wep.key_len + 2;
result = wilc_send_config_pkt(vif, SET_CFG, result = wilc_send_config_pkt(vif, SET_CFG,
&wid, 1, &wid, 1,
wilc_get_vif_idx(vif)); wilc_get_vif_idx(vif));
kfree(pu8keybuf); kfree(pu8keybuf);
} else if (pstrHostIFkeyAttr->action & REMOVEKEY) { } else if (hif_key->action & REMOVEKEY) {
wid.id = (u16)WID_REMOVE_WEP_KEY; wid.id = (u16)WID_REMOVE_WEP_KEY;
wid.type = WID_STR; wid.type = WID_STR;
s8idxarray[0] = (s8)pstrHostIFkeyAttr->attr.wep.index; s8idxarray[0] = (s8)hif_key->attr.wep.index;
wid.val = s8idxarray; wid.val = s8idxarray;
wid.size = 1; wid.size = 1;
result = wilc_send_config_pkt(vif, SET_CFG, result = wilc_send_config_pkt(vif, SET_CFG,
&wid, 1, &wid, 1,
wilc_get_vif_idx(vif)); wilc_get_vif_idx(vif));
} else if (pstrHostIFkeyAttr->action & DEFAULTKEY) { } else if (hif_key->action & DEFAULTKEY) {
wid.id = (u16)WID_KEY_ID; wid.id = (u16)WID_KEY_ID;
wid.type = WID_CHAR; wid.type = WID_CHAR;
wid.val = (s8 *)&pstrHostIFkeyAttr->attr.wep.index; wid.val = (s8 *)&hif_key->attr.wep.index;
wid.size = sizeof(char); wid.size = sizeof(char);
result = wilc_send_config_pkt(vif, SET_CFG, result = wilc_send_config_pkt(vif, SET_CFG,
...@@ -1630,25 +1629,25 @@ static int handle_key(struct wilc_vif *vif, ...@@ -1630,25 +1629,25 @@ static int handle_key(struct wilc_vif *vif,
break; break;
case WPA_RX_GTK: case WPA_RX_GTK:
if (pstrHostIFkeyAttr->action & ADDKEY_AP) { if (hif_key->action & ADDKEY_AP) {
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL); pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) { if (!pu8keybuf) {
ret = -ENOMEM; ret = -ENOMEM;
goto out_wpa_rx_gtk; goto out_wpa_rx_gtk;
} }
if (pstrHostIFkeyAttr->attr.wpa.seq) if (hif_key->attr.wpa.seq)
memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->attr.wpa.seq, 8); memcpy(pu8keybuf + 6, hif_key->attr.wpa.seq, 8);
memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->attr.wpa.index, 1); memcpy(pu8keybuf + 14, &hif_key->attr.wpa.index, 1);
memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->attr.wpa.key_len, 1); memcpy(pu8keybuf + 15, &hif_key->attr.wpa.key_len, 1);
memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key, memcpy(pu8keybuf + 16, hif_key->attr.wpa.key,
pstrHostIFkeyAttr->attr.wpa.key_len); hif_key->attr.wpa.key_len);
wid_list[0].id = (u16)WID_11I_MODE; wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].type = WID_CHAR; wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char); wid_list[0].size = sizeof(char);
wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode; wid_list[0].val = (s8 *)&hif_key->attr.wpa.mode;
wid_list[1].id = (u16)WID_ADD_RX_GTK; wid_list[1].id = (u16)WID_ADD_RX_GTK;
wid_list[1].type = WID_STR; wid_list[1].type = WID_STR;
...@@ -1661,7 +1660,7 @@ static int handle_key(struct wilc_vif *vif, ...@@ -1661,7 +1660,7 @@ static int handle_key(struct wilc_vif *vif,
kfree(pu8keybuf); kfree(pu8keybuf);
complete(&hif_drv->comp_test_key_block); complete(&hif_drv->comp_test_key_block);
} else if (pstrHostIFkeyAttr->action & ADDKEY) { } else if (hif_key->action & ADDKEY) {
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL); pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) { if (!pu8keybuf) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -1673,11 +1672,11 @@ static int handle_key(struct wilc_vif *vif, ...@@ -1673,11 +1672,11 @@ static int handle_key(struct wilc_vif *vif,
else else
netdev_err(vif->ndev, "Couldn't handle\n"); netdev_err(vif->ndev, "Couldn't handle\n");
memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->attr.wpa.seq, 8); memcpy(pu8keybuf + 6, hif_key->attr.wpa.seq, 8);
memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->attr.wpa.index, 1); memcpy(pu8keybuf + 14, &hif_key->attr.wpa.index, 1);
memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->attr.wpa.key_len, 1); memcpy(pu8keybuf + 15, &hif_key->attr.wpa.key_len, 1);
memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key, memcpy(pu8keybuf + 16, hif_key->attr.wpa.key,
pstrHostIFkeyAttr->attr.wpa.key_len); hif_key->attr.wpa.key_len);
wid.id = (u16)WID_ADD_RX_GTK; wid.id = (u16)WID_ADD_RX_GTK;
wid.type = WID_STR; wid.type = WID_STR;
...@@ -1692,31 +1691,31 @@ static int handle_key(struct wilc_vif *vif, ...@@ -1692,31 +1691,31 @@ static int handle_key(struct wilc_vif *vif,
complete(&hif_drv->comp_test_key_block); complete(&hif_drv->comp_test_key_block);
} }
out_wpa_rx_gtk: out_wpa_rx_gtk:
kfree(pstrHostIFkeyAttr->attr.wpa.key); kfree(hif_key->attr.wpa.key);
kfree(pstrHostIFkeyAttr->attr.wpa.seq); kfree(hif_key->attr.wpa.seq);
if (ret) if (ret)
return ret; return ret;
break; break;
case WPA_PTK: case WPA_PTK:
if (pstrHostIFkeyAttr->action & ADDKEY_AP) { if (hif_key->action & ADDKEY_AP) {
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL); pu8keybuf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL);
if (!pu8keybuf) { if (!pu8keybuf) {
ret = -ENOMEM; ret = -ENOMEM;
goto out_wpa_ptk; goto out_wpa_ptk;
} }
memcpy(pu8keybuf, pstrHostIFkeyAttr->attr.wpa.mac_addr, 6); memcpy(pu8keybuf, hif_key->attr.wpa.mac_addr, 6);
memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->attr.wpa.index, 1); memcpy(pu8keybuf + 6, &hif_key->attr.wpa.index, 1);
memcpy(pu8keybuf + 7, &pstrHostIFkeyAttr->attr.wpa.key_len, 1); memcpy(pu8keybuf + 7, &hif_key->attr.wpa.key_len, 1);
memcpy(pu8keybuf + 8, pstrHostIFkeyAttr->attr.wpa.key, memcpy(pu8keybuf + 8, hif_key->attr.wpa.key,
pstrHostIFkeyAttr->attr.wpa.key_len); hif_key->attr.wpa.key_len);
wid_list[0].id = (u16)WID_11I_MODE; wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].type = WID_CHAR; wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char); wid_list[0].size = sizeof(char);
wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode; wid_list[0].val = (s8 *)&hif_key->attr.wpa.mode;
wid_list[1].id = (u16)WID_ADD_PTK; wid_list[1].id = (u16)WID_ADD_PTK;
wid_list[1].type = WID_STR; wid_list[1].type = WID_STR;
...@@ -1728,7 +1727,7 @@ static int handle_key(struct wilc_vif *vif, ...@@ -1728,7 +1727,7 @@ static int handle_key(struct wilc_vif *vif,
wilc_get_vif_idx(vif)); wilc_get_vif_idx(vif));
kfree(pu8keybuf); kfree(pu8keybuf);
complete(&hif_drv->comp_test_key_block); complete(&hif_drv->comp_test_key_block);
} else if (pstrHostIFkeyAttr->action & ADDKEY) { } else if (hif_key->action & ADDKEY) {
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL); pu8keybuf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) { if (!pu8keybuf) {
netdev_err(vif->ndev, "No buffer send PTK\n"); netdev_err(vif->ndev, "No buffer send PTK\n");
...@@ -1736,10 +1735,10 @@ static int handle_key(struct wilc_vif *vif, ...@@ -1736,10 +1735,10 @@ static int handle_key(struct wilc_vif *vif,
goto out_wpa_ptk; goto out_wpa_ptk;
} }
memcpy(pu8keybuf, pstrHostIFkeyAttr->attr.wpa.mac_addr, 6); memcpy(pu8keybuf, hif_key->attr.wpa.mac_addr, 6);
memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->attr.wpa.key_len, 1); memcpy(pu8keybuf + 6, &hif_key->attr.wpa.key_len, 1);
memcpy(pu8keybuf + 7, pstrHostIFkeyAttr->attr.wpa.key, memcpy(pu8keybuf + 7, hif_key->attr.wpa.key,
pstrHostIFkeyAttr->attr.wpa.key_len); hif_key->attr.wpa.key_len);
wid.id = (u16)WID_ADD_PTK; wid.id = (u16)WID_ADD_PTK;
wid.type = WID_STR; wid.type = WID_STR;
...@@ -1754,28 +1753,28 @@ static int handle_key(struct wilc_vif *vif, ...@@ -1754,28 +1753,28 @@ static int handle_key(struct wilc_vif *vif,
} }
out_wpa_ptk: out_wpa_ptk:
kfree(pstrHostIFkeyAttr->attr.wpa.key); kfree(hif_key->attr.wpa.key);
if (ret) if (ret)
return ret; return ret;
break; break;
case PMKSA: case PMKSA:
pu8keybuf = kmalloc((pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL); pu8keybuf = kmalloc((hif_key->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL);
if (!pu8keybuf) if (!pu8keybuf)
return -ENOMEM; return -ENOMEM;
pu8keybuf[0] = pstrHostIFkeyAttr->attr.pmkid.numpmkid; pu8keybuf[0] = hif_key->attr.pmkid.numpmkid;
for (i = 0; i < pstrHostIFkeyAttr->attr.pmkid.numpmkid; i++) { for (i = 0; i < hif_key->attr.pmkid.numpmkid; i++) {
memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + 1), pstrHostIFkeyAttr->attr.pmkid.pmkidlist[i].bssid, ETH_ALEN); memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + 1), hif_key->attr.pmkid.pmkidlist[i].bssid, ETH_ALEN);
memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), pstrHostIFkeyAttr->attr.pmkid.pmkidlist[i].pmkid, PMKID_LEN); memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), hif_key->attr.pmkid.pmkidlist[i].pmkid, PMKID_LEN);
} }
wid.id = (u16)WID_PMKID_INFO; wid.id = (u16)WID_PMKID_INFO;
wid.type = WID_STR; wid.type = WID_STR;
wid.val = (s8 *)pu8keybuf; wid.val = (s8 *)pu8keybuf;
wid.size = (pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1; wid.size = (hif_key->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1;
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1, result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif)); wilc_get_vif_idx(vif));
......
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