This patch series contains changes to fix issues reported by checkpatch.pl script.
Ajay Singh (14):
staging: wilc1000: remove unnecessary use of parentheses
staging: wilc1000: removed unnecessary defined enums typedef
staging: wilc1000: fix alignments to match open parenthesis
staging: wilc1000: rename host_int_ParseJoinBssParam() and it's
variable using camelCase
staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its
variable
staging: wilc1000: rename strWIDList variable to wid_list to avoid
camelCase
staging: wilc1000: rename u32WidsCount variable to avoid camelCase
staging: wilc1000: rename pu8CurrByte variable to avoid camelCase
staging: wilc1000: rename pstrHostIFconnectAttr argument to avoid
camelCase
staging: wilc1000: rename ptstrJoinBssParam variable to avoid
camelCase
staging: wilc1000: rename strConnectInfo variable to avoid camelCase
staging: wilc1000: rename Handle_ScanDone() to avoid camelCase
staging: wilc1000: rename Handle_Connect() to avoid camelCase
staging: wilc1000: rename Handle_ConnectTimeout() and Handle_Key()
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/host_interface.c | 936 +++++++++++-----------
drivers/staging/wilc1000/linux_wlan.c | 10 +-
drivers/staging/wilc1000/wilc_sdio.c | 4 +-
drivers/staging/wilc1000/wilc_spi.c | 20 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 64 +-
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_wlan_cfg.c | 6 +-
drivers/staging/wilc1000/wilc_wlan_if.h | 72 +-
9 files changed, 555 insertions(+), 561 deletions(-)
--
2.7.4
fix "Unnecessary parentheses around" issue found by checkpatch.pl
script.Remove the unnecessary parentheses to follow linux coding style.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/coreconfigurator.c | 2 +-
drivers/staging/wilc1000/host_interface.c | 34 +++++++++++------------
drivers/staging/wilc1000/linux_wlan.c | 8 +++---
drivers/staging/wilc1000/wilc_sdio.c | 4 +--
drivers/staging/wilc1000/wilc_spi.c | 20 ++++++-------
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 26 ++++++++---------
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_wlan_cfg.c | 6 ++--
8 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 8cf886d..e98fc8e 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -201,7 +201,7 @@ static inline u16 get_cap_info(u8 *data)
st = get_sub_type(data);
- if ((st == BEACON) || (st == PROBE_RSP))
+ if (st == BEACON || st == PROBE_RSP)
index += TIME_STAMP_LEN + BEACON_INTERVAL_LEN;
cap_info = data[index];
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4ff1a59..46e2d55 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -394,7 +394,7 @@ static void handle_set_operation_mode(struct wilc_vif *vif,
ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif));
- if ((hif_op_mode->mode) == IDLE_MODE)
+ if (hif_op_mode->mode == IDLE_MODE)
complete(&hif_driver_comp);
if (ret)
@@ -760,8 +760,8 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
hif_drv->usr_scan_req.scan_result = scan_info->result;
hif_drv->usr_scan_req.arg = scan_info->arg;
- if ((hif_drv->hif_state >= HOST_IF_SCANNING) &&
- (hif_drv->hif_state < HOST_IF_CONNECTED)) {
+ if (hif_drv->hif_state >= HOST_IF_SCANNING &&
+ hif_drv->hif_state < HOST_IF_CONNECTED) {
netdev_err(vif->ndev, "Already scan\n");
result = -EBUSY;
goto ERRORHANDLER;
@@ -1025,7 +1025,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
pu8CurrByte += MAX_SSID_LEN;
*(pu8CurrByte++) = INFRASTRUCTURE;
- if ((pstrHostIFconnectAttr->ch >= 1) && (pstrHostIFconnectAttr->ch <= 14)) {
+ if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
*(pu8CurrByte++) = pstrHostIFconnectAttr->ch;
} else {
netdev_err(vif->ndev, "Channel out of range\n");
@@ -1258,8 +1258,8 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
if (hif_drv->usr_scan_req.scan_result) {
wilc_parse_network_info(pstrRcvdNetworkInfo->buffer, &pstrNetworkInfo);
- if ((!pstrNetworkInfo) ||
- (!hif_drv->usr_scan_req.scan_result)) {
+ if (!pstrNetworkInfo ||
+ !hif_drv->usr_scan_req.scan_result) {
netdev_err(vif->ndev, "driver is null\n");
result = -EINVAL;
goto done;
@@ -1340,8 +1340,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
return -ENODEV;
}
- if ((hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) ||
- (hif_drv->hif_state == HOST_IF_CONNECTED) ||
+ if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP ||
+ hif_drv->hif_state == HOST_IF_CONNECTED ||
hif_drv->usr_scan_req.scan_result) {
if (!pstrRcvdGnrlAsyncInfo->buffer ||
!hif_drv->usr_conn_req.conn_result) {
@@ -1400,8 +1400,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
}
}
- if ((u8MacStatus == MAC_CONNECTED) &&
- (strConnectInfo.status != SUCCESSFUL_STATUSCODE)) {
+ if (u8MacStatus == MAC_CONNECTED &&
+ strConnectInfo.status != SUCCESSFUL_STATUSCODE) {
netdev_err(vif->ndev, "Received MAC status is MAC_CONNECTED while the received status code in Asoc Resp is not SUCCESSFUL_STATUSCODE\n");
eth_zero_addr(wilc_connected_ssid);
} else if (u8MacStatus == MAC_DISCONNECTED) {
@@ -1412,8 +1412,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
if (hif_drv->usr_conn_req.bssid) {
memcpy(strConnectInfo.bssid, hif_drv->usr_conn_req.bssid, 6);
- if ((u8MacStatus == MAC_CONNECTED) &&
- (strConnectInfo.status == SUCCESSFUL_STATUSCODE)) {
+ if (u8MacStatus == MAC_CONNECTED &&
+ strConnectInfo.status == SUCCESSFUL_STATUSCODE) {
memcpy(hif_drv->assoc_bssid,
hif_drv->usr_conn_req.bssid, ETH_ALEN);
}
@@ -1434,8 +1434,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
NULL,
hif_drv->usr_conn_req.arg);
- if ((u8MacStatus == MAC_CONNECTED) &&
- (strConnectInfo.status == SUCCESSFUL_STATUSCODE)) {
+ if (u8MacStatus == MAC_CONNECTED &&
+ strConnectInfo.status == SUCCESSFUL_STATUSCODE) {
wilc_set_power_mgmt(vif, 0, 0);
hif_drv->hif_state = HOST_IF_CONNECTED;
@@ -1864,8 +1864,8 @@ void wilc_resolve_disconnect_aberration(struct wilc_vif *vif)
{
if (!vif->hif_drv)
return;
- if ((vif->hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) ||
- (vif->hif_drv->hif_state == HOST_IF_CONNECTING))
+ if (vif->hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP ||
+ vif->hif_drv->hif_state == HOST_IF_CONNECTING)
wilc_disconnect(vif, 1);
}
@@ -2414,7 +2414,7 @@ static void Handle_SetMulticastFilter(struct wilc_vif *vif,
wid.id = (u16)WID_SETUP_MULTICAST_FILTER;
wid.type = WID_BIN;
- wid.size = sizeof(struct set_multicast) + ((strHostIfSetMulti->cnt) * ETH_ALEN);
+ wid.size = sizeof(struct set_multicast) + (strHostIfSetMulti->cnt * ETH_ALEN);
wid.val = kmalloc(wid.size, GFP_KERNEL);
if (!wid.val)
goto ERRORHANDLER;
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index da1fe43..3c3f1863 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -911,13 +911,13 @@ static void wilc_set_multicast_list(struct net_device *dev)
if (dev->flags & IFF_PROMISC)
return;
- if ((dev->flags & IFF_ALLMULTI) ||
- (dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
+ if (dev->flags & IFF_ALLMULTI ||
+ dev->mc.count > WILC_MULTICAST_TABLE_SIZE) {
wilc_setup_multicast_filter(vif, false, 0);
return;
}
- if ((dev->mc.count) == 0) {
+ if (dev->mc.count == 0) {
wilc_setup_multicast_filter(vif, true, 0);
return;
}
@@ -1030,7 +1030,7 @@ static int wilc_mac_close(struct net_device *ndev)
if (!hif_drv)
return 0;
- if ((wl->open_ifcs) > 0)
+ if (wl->open_ifcs > 0)
wl->open_ifcs--;
else
return 0;
diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index bd2b29b..bb65b37 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -375,7 +375,7 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data)
data = cpu_to_le32(data);
- if ((addr >= 0xf0) && (addr <= 0xff)) {
+ if (addr >= 0xf0 && addr <= 0xff) {
struct sdio_cmd52 cmd;
cmd.read_write = 1;
@@ -515,7 +515,7 @@ static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data)
struct sdio_func *func = dev_to_sdio_func(wilc->dev);
int ret;
- if ((addr >= 0xf0) && (addr <= 0xff)) {
+ if (addr >= 0xf0 && addr <= 0xff) {
struct sdio_cmd52 cmd;
cmd.read_write = 0;
diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index ff2ba10..8f71a60 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -390,11 +390,11 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
#define NUM_DATA_BYTES (4)
#define NUM_CRC_BYTES (2)
#define NUM_DUMMY_BYTES (3)
- if ((cmd == CMD_RESET) ||
- (cmd == CMD_TERMINATE) ||
- (cmd == CMD_REPEAT)) {
+ if (cmd == CMD_RESET ||
+ cmd == CMD_TERMINATE ||
+ cmd == CMD_REPEAT) {
len2 = len + (NUM_SKIP_BYTES + NUM_RSP_BYTES + NUM_DUMMY_BYTES);
- } else if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ)) {
+ } else if (cmd == CMD_INTERNAL_READ || cmd == CMD_SINGLE_READ) {
if (!g_spi.crc_off) {
len2 = len + (NUM_RSP_BYTES + NUM_DATA_HDR_BYTES + NUM_DATA_BYTES
+ NUM_CRC_BYTES + NUM_DUMMY_BYTES);
@@ -425,9 +425,9 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
/**
* Command/Control response
**/
- if ((cmd == CMD_RESET) ||
- (cmd == CMD_TERMINATE) ||
- (cmd == CMD_REPEAT)) {
+ if (cmd == CMD_RESET ||
+ cmd == CMD_TERMINATE ||
+ cmd == CMD_REPEAT) {
rix++; /* skip 1 byte */
}
@@ -453,8 +453,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
return N_FAIL;
}
- if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ) ||
- (cmd == CMD_DMA_READ) || (cmd == CMD_DMA_EXT_READ)) {
+ if (cmd == CMD_INTERNAL_READ || cmd == CMD_SINGLE_READ ||
+ cmd == CMD_DMA_READ || cmd == CMD_DMA_EXT_READ) {
int retry;
/* u16 crc1, crc2; */
u8 crc[2];
@@ -480,7 +480,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
return N_RESET;
}
- if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ)) {
+ if (cmd == CMD_INTERNAL_READ || cmd == CMD_SINGLE_READ) {
/**
* Read bytes
**/
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 47c7e2e..fb4a142 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -495,8 +495,8 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt,
connect_status = conn_info->status;
- if ((mac_status == MAC_DISCONNECTED) &&
- (conn_info->status == SUCCESSFUL_STATUSCODE)) {
+ if (mac_status == MAC_DISCONNECTED &&
+ conn_info->status == SUCCESSFUL_STATUSCODE) {
connect_status = WLAN_STATUS_UNSPECIFIED_FAILURE;
wilc_wlan_set_bssid(priv->dev, null_bssid,
STATION_MODE);
@@ -548,9 +548,9 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt,
if (!wfi_drv->p2p_connect)
wlan_channel = INVALID_CHANNEL;
- if ((wfi_drv->IFC_UP) && (dev == wl->vif[1]->ndev))
+ if (wfi_drv->IFC_UP && dev == wl->vif[1]->ndev)
disconn_info->reason = 3;
- else if ((!wfi_drv->IFC_UP) && (dev == wl->vif[1]->ndev))
+ else if (!wfi_drv->IFC_UP && dev == wl->vif[1]->ndev)
disconn_info->reason = 1;
cfg80211_disconnected(dev, disconn_info->reason, disconn_info->ie,
@@ -671,7 +671,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
wfi_drv->p2p_connect = 0;
for (i = 0; i < last_scanned_cnt; i++) {
- if ((sme->ssid_len == last_scanned_shadow[i].ssid_len) &&
+ if (sme->ssid_len == last_scanned_shadow[i].ssid_len &&
memcmp(last_scanned_shadow[i].ssid,
sme->ssid,
sme->ssid_len) == 0) {
@@ -932,7 +932,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
memcpy(priv->wilc_gtk[key_index]->key, params->key, params->key_len);
kfree(priv->wilc_gtk[key_index]->seq);
- if ((params->seq_len) > 0) {
+ if (params->seq_len > 0) {
priv->wilc_gtk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL);
memcpy(priv->wilc_gtk[key_index]->seq, params->seq, params->seq_len);
}
@@ -964,12 +964,12 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
kfree(priv->wilc_ptk[key_index]->seq);
- if ((params->seq_len) > 0)
+ if (params->seq_len > 0)
priv->wilc_ptk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL);
memcpy(priv->wilc_ptk[key_index]->key, params->key, params->key_len);
- if ((params->seq_len) > 0)
+ if (params->seq_len > 0)
memcpy(priv->wilc_ptk[key_index]->seq, params->seq, params->seq_len);
priv->wilc_ptk[key_index]->cipher = params->cipher;
@@ -1082,7 +1082,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
kfree(g_key_wep_params.key);
g_key_wep_params.key = NULL;
- if ((priv->wilc_gtk[key_index]) != NULL) {
+ if (priv->wilc_gtk[key_index] != NULL) {
kfree(priv->wilc_gtk[key_index]->key);
priv->wilc_gtk[key_index]->key = NULL;
kfree(priv->wilc_gtk[key_index]->seq);
@@ -1092,7 +1092,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
priv->wilc_gtk[key_index] = NULL;
}
- if ((priv->wilc_ptk[key_index]) != NULL) {
+ if (priv->wilc_ptk[key_index] != NULL) {
kfree(priv->wilc_ptk[key_index]->key);
priv->wilc_ptk[key_index]->key = NULL;
kfree(priv->wilc_ptk[key_index]->seq);
@@ -1216,8 +1216,8 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
sinfo->tx_failed = stats.tx_fail_cnt;
sinfo->txrate.legacy = stats.link_speed * 10;
- if ((stats.link_speed > TCP_ACK_FILTER_LINK_SPEED_THRESH) &&
- (stats.link_speed != DEFAULT_LINK_SPEED))
+ if (stats.link_speed > TCP_ACK_FILTER_LINK_SPEED_THRESH &&
+ stats.link_speed != DEFAULT_LINK_SPEED)
wilc_enable_tcp_ack_filter(true);
else if (stats.link_speed != DEFAULT_LINK_SPEED)
wilc_enable_tcp_ack_filter(false);
@@ -1893,7 +1893,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
static int start_ap(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_settings *settings)
{
- struct cfg80211_beacon_data *beacon = &(settings->beacon);
+ struct cfg80211_beacon_data *beacon = &settings->beacon;
struct wilc_priv *priv;
s32 ret = 0;
struct wilc *wl;
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index ac76bc7..acaeafc 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -693,7 +693,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
i = 0;
do {
tqe = wilc_wlan_txq_remove_from_head(dev);
- if (tqe && (vmm_table[i] != 0)) {
+ if (tqe && vmm_table[i] != 0) {
u32 header, buffer_offset;
vmm_table[i] = cpu_to_le32(vmm_table[i]);
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index 19e4f85..aeb5417 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -235,7 +235,7 @@ static int wilc_wlan_cfg_set_str(u8 *frame, u32 offset, u16 id, u8 *str, u32 siz
buf[2] = (u8)size;
buf[3] = (u8)(size >> 8);
- if ((str) && (size != 0))
+ if (str && size != 0)
memcpy(&buf[4], str, size);
return (size + 4);
@@ -256,7 +256,7 @@ static int wilc_wlan_cfg_set_bin(u8 *frame, u32 offset, u16 id, u8 *b, u32 size)
buf[2] = (u8)size;
buf[3] = (u8)(size >> 8);
- if ((b) && (size != 0)) {
+ if ((b) && size != 0) {
memcpy(&buf[4], b, size);
for (i = 0; i < size; i++)
checksum += buf[i + 4];
@@ -370,7 +370,7 @@ static int wilc_wlan_parse_info_frame(u8 *info, int size)
len = info[2];
- if ((len == 1) && (wid == WID_STATUS)) {
+ if (len == 1 && wid == WID_STATUS) {
pd->mac_status = info[3];
type = WILC_CFG_RSP_STATUS;
}
--
2.7.4
fix "Avoid camelCase" issue found by checkpatch.pl script.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 15fca67..49f35f7 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1159,7 +1159,7 @@ static s32 handle_connect(struct wilc_vif *vif,
return result;
}
-static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
+static s32 handle_connect_timeout(struct wilc_vif *vif)
{
s32 result = 0;
struct connect_info conn_info;
@@ -1519,7 +1519,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
return result;
}
-static int Handle_Key(struct wilc_vif *vif,
+static int handle_key(struct wilc_vif *vif,
struct key_attr *pstrHostIFkeyAttr)
{
s32 result = 0;
@@ -2505,7 +2505,7 @@ static void host_if_work(struct work_struct *work)
break;
case HOST_IF_MSG_KEY:
- Handle_Key(msg->vif, &msg->body.key_info);
+ handle_key(msg->vif, &msg->body.key_info);
break;
case HOST_IF_MSG_CFG_PARAMS:
@@ -2572,7 +2572,7 @@ static void host_if_work(struct work_struct *work)
break;
case HOST_IF_MSG_CONNECT_TIMER_FIRED:
- Handle_ConnectTimeout(msg->vif);
+ handle_connect_timeout(msg->vif);
break;
case HOST_IF_MSG_POWER_MGMT:
--
2.7.4
On 18.01.2018 15:17, Ajay Singh wrote:
> fix "Avoid camelCase" issue reported by checkpatch.pl script.
>
> Signed-off-by: Ajay Singh <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 78 +++++++++++++++----------------
> 1 file changed, 39 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 4ddd1a8..cc27b5a 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -909,7 +909,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> struct wid wid_list[8];
> u32 wid_cnt = 0, dummyval = 0;
> u8 *cur_byte = NULL;
> - struct join_bss_param *ptstrJoinBssParam;
> + struct join_bss_param *j_bss_param;
I would choose either join_bss_param or bss_param for the name.
> struct host_if_drv *hif_drv = vif->hif_drv;
>
> if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> @@ -918,8 +918,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> return result;
> }
>
> - ptstrJoinBssParam = attr->params;
> - if (!ptstrJoinBssParam) {
> + j_bss_param = attr->params;
> + if (!j_bss_param) {
> netdev_err(vif->ndev, "Required BSSID not found\n");
> result = -ENOENT;
> goto ERRORHANDLER;
> @@ -1027,8 +1027,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> netdev_err(vif->ndev, "Channel out of range\n");
> *(cur_byte++) = 0xFF;
> }
> - *(cur_byte++) = (ptstrJoinBssParam->cap_info) & 0xFF;
> - *(cur_byte++) = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
> + *(cur_byte++) = (j_bss_param->cap_info) & 0xFF;
> + *(cur_byte++) = ((j_bss_param->cap_info) >> 8) & 0xFF;
>
> if (attr->bssid)
> memcpy(cur_byte, attr->bssid, 6);
> @@ -1038,57 +1038,57 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> memcpy(cur_byte, attr->bssid, 6);
> cur_byte += 6;
>
> - *(cur_byte++) = (ptstrJoinBssParam->beacon_period) & 0xFF;
> - *(cur_byte++) = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
> - *(cur_byte++) = ptstrJoinBssParam->dtim_period;
> + *(cur_byte++) = (j_bss_param->beacon_period) & 0xFF;
> + *(cur_byte++) = ((j_bss_param->beacon_period) >> 8) & 0xFF;
> + *(cur_byte++) = j_bss_param->dtim_period;
>
> - memcpy(cur_byte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
> + memcpy(cur_byte, j_bss_param->supp_rates, MAX_RATES_SUPPORTED + 1);
> cur_byte += (MAX_RATES_SUPPORTED + 1);
>
> - *(cur_byte++) = ptstrJoinBssParam->wmm_cap;
> - *(cur_byte++) = ptstrJoinBssParam->uapsd_cap;
> + *(cur_byte++) = j_bss_param->wmm_cap;
> + *(cur_byte++) = j_bss_param->uapsd_cap;
>
> - *(cur_byte++) = ptstrJoinBssParam->ht_capable;
> - hif_drv->usr_conn_req.ht_capable = ptstrJoinBssParam->ht_capable;
> + *(cur_byte++) = j_bss_param->ht_capable;
> + hif_drv->usr_conn_req.ht_capable = j_bss_param->ht_capable;
>
> - *(cur_byte++) = ptstrJoinBssParam->rsn_found;
> - *(cur_byte++) = ptstrJoinBssParam->rsn_grp_policy;
> - *(cur_byte++) = ptstrJoinBssParam->mode_802_11i;
> + *(cur_byte++) = j_bss_param->rsn_found;
> + *(cur_byte++) = j_bss_param->rsn_grp_policy;
> + *(cur_byte++) = j_bss_param->mode_802_11i;
>
> - memcpy(cur_byte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
> - cur_byte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
> + memcpy(cur_byte, j_bss_param->rsn_pcip_policy, sizeof(j_bss_param->rsn_pcip_policy));> + cur_byte += sizeof(j_bss_param->rsn_pcip_policy);
>
> - memcpy(cur_byte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
> - cur_byte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
> + memcpy(cur_byte, j_bss_param->rsn_auth_policy, sizeof(j_bss_param->rsn_auth_policy));
> + cur_byte += sizeof(j_bss_param->rsn_auth_policy);
>
> - memcpy(cur_byte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
> - cur_byte += sizeof(ptstrJoinBssParam->rsn_cap);
> + memcpy(cur_byte, j_bss_param->rsn_cap, sizeof(j_bss_param->rsn_cap));
> + cur_byte += sizeof(j_bss_param->rsn_cap);
>
> *(cur_byte++) = REAL_JOIN_REQ;
> - *(cur_byte++) = ptstrJoinBssParam->noa_enabled;
> + *(cur_byte++) = j_bss_param->noa_enabled;
>
> - if (ptstrJoinBssParam->noa_enabled) {
> - *(cur_byte++) = (ptstrJoinBssParam->tsf) & 0xFF;
> - *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
> - *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
> - *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
> + if (j_bss_param->noa_enabled) {
> + *(cur_byte++) = (j_bss_param->tsf) & 0xFF;
> + *(cur_byte++) = ((j_bss_param->tsf) >> 8) & 0xFF;
> + *(cur_byte++) = ((j_bss_param->tsf) >> 16) & 0xFF;
> + *(cur_byte++) = ((j_bss_param->tsf) >> 24) & 0xFF;
>
> - *(cur_byte++) = ptstrJoinBssParam->opp_enabled;
> - *(cur_byte++) = ptstrJoinBssParam->idx;
> + *(cur_byte++) = j_bss_param->opp_enabled;
> + *(cur_byte++) = j_bss_param->idx;
>
> - if (ptstrJoinBssParam->opp_enabled)
> - *(cur_byte++) = ptstrJoinBssParam->ct_window;
> + if (j_bss_param->opp_enabled)
> + *(cur_byte++) = j_bss_param->ct_window;
>
> - *(cur_byte++) = ptstrJoinBssParam->cnt;
> + *(cur_byte++) = j_bss_param->cnt;
>
> - memcpy(cur_byte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
> - cur_byte += sizeof(ptstrJoinBssParam->duration);
> + memcpy(cur_byte, j_bss_param->duration, sizeof(j_bss_param->duration));
> + cur_byte += sizeof(j_bss_param->duration);
>
> - memcpy(cur_byte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
> - cur_byte += sizeof(ptstrJoinBssParam->interval);
> + memcpy(cur_byte, j_bss_param->interval, sizeof(j_bss_param->interval));
> + cur_byte += sizeof(j_bss_param->interval);
>
> - memcpy(cur_byte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
> - cur_byte += sizeof(ptstrJoinBssParam->start_time);
> + memcpy(cur_byte, j_bss_param->start_time, sizeof(j_bss_param->start_time));
> + cur_byte += sizeof(j_bss_param->start_time);
> }
>
> cur_byte = wid_list[wid_cnt].val;
>
On 18.01.2018 15:17, Ajay Singh wrote:
> fix "Avoid camelCase" issue found by checkpatch.pl script.
>
> Signed-off-by: Ajay Singh <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 104 ++++++++++++++----------------
> 1 file changed, 49 insertions(+), 55 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index e3931bc..4ddd1a8 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -903,7 +903,7 @@ static s32 Handle_ScanDone(struct wilc_vif *vif,
>
> u8 wilc_connected_ssid[6] = {0};
> static s32 Handle_Connect(struct wilc_vif *vif,
> - struct connect_attr *pstrHostIFconnectAttr)
> + struct connect_attr *attr)
> {
> s32 result = 0;
> struct wid wid_list[8];
> @@ -912,45 +912,41 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> struct join_bss_param *ptstrJoinBssParam;
> struct host_if_drv *hif_drv = vif->hif_drv;
>
> - if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> + if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> result = 0;
> netdev_err(vif->ndev, "Discard connect request\n");
> return result;
> }
>
> - ptstrJoinBssParam = pstrHostIFconnectAttr->params;
> + ptstrJoinBssParam = attr->params;
> if (!ptstrJoinBssParam) {
> netdev_err(vif->ndev, "Required BSSID not found\n");
> result = -ENOENT;
> goto ERRORHANDLER;
> }
>
> - if (pstrHostIFconnectAttr->bssid) {
> + if (attr->bssid) {
> hif_drv->usr_conn_req.bssid = kmalloc(6, GFP_KERNEL);
> - memcpy(hif_drv->usr_conn_req.bssid, pstrHostIFconnectAttr->bssid, 6);
> + memcpy(hif_drv->usr_conn_req.bssid, attr->bssid, 6);
> }
>
> - hif_drv->usr_conn_req.ssid_len = pstrHostIFconnectAttr->ssid_len;
> - if (pstrHostIFconnectAttr->ssid) {
> - hif_drv->usr_conn_req.ssid = kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
> - memcpy(hif_drv->usr_conn_req.ssid,
> - pstrHostIFconnectAttr->ssid,
> - pstrHostIFconnectAttr->ssid_len);
> - hif_drv->usr_conn_req.ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
> + hif_drv->usr_conn_req.ssid_len = attr->ssid_len;
> + if (attr->ssid) {
> + hif_drv->usr_conn_req.ssid = kmalloc(attr->ssid_len + 1, GFP_KERNEL);
> + memcpy(hif_drv->usr_conn_req.ssid, attr->ssid, attr->ssid_len);
> + hif_drv->usr_conn_req.ssid[attr->ssid_len] = '\0';
> }
>
> - hif_drv->usr_conn_req.ies_len = pstrHostIFconnectAttr->ies_len;
> - if (pstrHostIFconnectAttr->ies) {
> - hif_drv->usr_conn_req.ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
> - memcpy(hif_drv->usr_conn_req.ies,
> - pstrHostIFconnectAttr->ies,
> - pstrHostIFconnectAttr->ies_len);
> + hif_drv->usr_conn_req.ies_len = attr->ies_len;
> + if (attr->ies) {
> + hif_drv->usr_conn_req.ies = kmalloc(attr->ies_len, GFP_KERNEL);
> + memcpy(hif_drv->usr_conn_req.ies, attr->ies, attr->ies_len);
> }
>
> - hif_drv->usr_conn_req.security = pstrHostIFconnectAttr->security;
> - hif_drv->usr_conn_req.auth_type = pstrHostIFconnectAttr->auth_type;
> - hif_drv->usr_conn_req.conn_result = pstrHostIFconnectAttr->result;
> - hif_drv->usr_conn_req.arg = pstrHostIFconnectAttr->arg;
> + hif_drv->usr_conn_req.security = attr->security;
> + hif_drv->usr_conn_req.auth_type = attr->auth_type;
> + hif_drv->usr_conn_req.conn_result = attr->result;
> + hif_drv->usr_conn_req.arg = attr->arg;
>
> wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
> wid_list[wid_cnt].type = WID_INT;
> @@ -977,7 +973,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> wid_list[wid_cnt].size = hif_drv->usr_conn_req.ies_len;
> wid_cnt++;
>
> - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
> + if (memcmp("DIRECT-", attr->ssid, 7)) {
> info_element_size = hif_drv->usr_conn_req.ies_len;
> info_element = kmalloc(info_element_size, GFP_KERNEL);
> memcpy(info_element, hif_drv->usr_conn_req.ies,
> @@ -990,7 +986,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.security;
> wid_cnt++;
>
> - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
> + if (memcmp("DIRECT-", attr->ssid, 7))
> mode_11i = hif_drv->usr_conn_req.security;
>
> wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
> @@ -999,7 +995,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
> wid_cnt++;
>
> - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
> + if (memcmp("DIRECT-", attr->ssid, 7))
> auth_type = (u8)hif_drv->usr_conn_req.auth_type;
>
> wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
> @@ -1007,7 +1003,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> wid_list[wid_cnt].size = 112;
> wid_list[wid_cnt].val = kmalloc(wid_list[wid_cnt].size, GFP_KERNEL);
>
> - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
> + if (memcmp("DIRECT-", attr->ssid, 7)) {
> join_req_size = wid_list[wid_cnt].size;
> join_req = kmalloc(join_req_size, GFP_KERNEL);
> }
> @@ -1018,15 +1014,15 @@ static s32 Handle_Connect(struct wilc_vif *vif,
>
> cur_byte = wid_list[wid_cnt].val;
>
> - if (pstrHostIFconnectAttr->ssid) {
> - memcpy(cur_byte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
> - cur_byte[pstrHostIFconnectAttr->ssid_len] = '\0';
> + if (attr->ssid) {
> + memcpy(cur_byte, attr->ssid, attr->ssid_len);
> + cur_byte[attr->ssid_len] = '\0';
> }
> cur_byte += MAX_SSID_LEN;
> *(cur_byte++) = INFRASTRUCTURE;
>
> - if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
> - *(cur_byte++) = pstrHostIFconnectAttr->ch;
> + if (attr->ch >= 1 && attr->ch <= 14) {
> + *(cur_byte++) = attr->ch;
> } else {
> netdev_err(vif->ndev, "Channel out of range\n");
> *(cur_byte++) = 0xFF;
> @@ -1034,12 +1030,12 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> *(cur_byte++) = (ptstrJoinBssParam->cap_info) & 0xFF;
> *(cur_byte++) = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
>
> - if (pstrHostIFconnectAttr->bssid)
> - memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
> + if (attr->bssid)
> + memcpy(cur_byte, attr->bssid, 6);
> cur_byte += 6;
>
> - if (pstrHostIFconnectAttr->bssid)
> - memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
> + if (attr->bssid)
> + memcpy(cur_byte, attr->bssid, 6);
> cur_byte += 6;
>
> *(cur_byte++) = (ptstrJoinBssParam->beacon_period) & 0xFF;
> @@ -1098,14 +1094,14 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> cur_byte = wid_list[wid_cnt].val;
> wid_cnt++;
>
> - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
> + if (memcmp("DIRECT-", attr->ssid, 7)) {
> memcpy(join_req, cur_byte, join_req_size);
> join_req_vif = vif;
> }
>
> - if (pstrHostIFconnectAttr->bssid)
> + if (attr->bssid)
> memcpy(wilc_connected_ssid,
> - pstrHostIFconnectAttr->bssid, ETH_ALEN);
> + attr->bssid, ETH_ALEN);
You can put everything on one line.
>
> result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
> wid_cnt,
> @@ -1126,23 +1122,21 @@ static s32 Handle_Connect(struct wilc_vif *vif,
>
> memset(&strConnectInfo, 0, sizeof(struct connect_info));
>
> - if (pstrHostIFconnectAttr->result) {
> - if (pstrHostIFconnectAttr->bssid)
> - memcpy(strConnectInfo.bssid, pstrHostIFconnectAttr->bssid, 6);
> + if (attr->result) {
> + if (attr->bssid)
> + memcpy(strConnectInfo.bssid, attr->bssid, 6);
>
> - if (pstrHostIFconnectAttr->ies) {
> - strConnectInfo.req_ies_len = pstrHostIFconnectAttr->ies_len;
> - strConnectInfo.req_ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
> - memcpy(strConnectInfo.req_ies,
> - pstrHostIFconnectAttr->ies,
> - pstrHostIFconnectAttr->ies_len);
> + if (attr->ies) {
> + strConnectInfo.req_ies_len = attr->ies_len;
> + strConnectInfo.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
> + memcpy(strConnectInfo.req_ies, attr->ies, attr->ies_len);
> }
>
> - pstrHostIFconnectAttr->result(CONN_DISCONN_EVENT_CONN_RESP,
> + attr->result(CONN_DISCONN_EVENT_CONN_RESP,
> &strConnectInfo,
> MAC_DISCONNECTED,
> NULL,
> - pstrHostIFconnectAttr->arg);
> + attr->arg);
> hif_drv->hif_state = HOST_IF_IDLE;
> kfree(strConnectInfo.req_ies);
> strConnectInfo.req_ies = NULL;
> @@ -1152,14 +1146,14 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> }
> }
>
> - kfree(pstrHostIFconnectAttr->bssid);
> - pstrHostIFconnectAttr->bssid = NULL;
> + kfree(attr->bssid);
> + attr->bssid = NULL;
>
> - kfree(pstrHostIFconnectAttr->ssid);
> - pstrHostIFconnectAttr->ssid = NULL;
> + kfree(attr->ssid);
> + attr->ssid = NULL;
>
> - kfree(pstrHostIFconnectAttr->ies);
> - pstrHostIFconnectAttr->ies = NULL;
> + kfree(attr->ies);
> + attr->ies = NULL;
>
> kfree(cur_byte);
> return result;
>
On Fri, 19 Jan 2018 16:50:18 +0530
Claudiu Beznea - M18063 <[email protected]> wrote:
> On 18.01.2018 15:17, Ajay Singh wrote:
> > fix "Avoid camelCase" issue reported by checkpatch.pl script.
> >
> > Signed-off-by: Ajay Singh <[email protected]>
> > ---
> > drivers/staging/wilc1000/host_interface.c | 78 +++++++++++++++----------------
> > 1 file changed, 39 insertions(+), 39 deletions(-)
> >
> > diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> > index 4ddd1a8..cc27b5a 100644
> > --- a/drivers/staging/wilc1000/host_interface.c
> > +++ b/drivers/staging/wilc1000/host_interface.c
> > @@ -909,7 +909,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > struct wid wid_list[8];
> > u32 wid_cnt = 0, dummyval = 0;
> > u8 *cur_byte = NULL;
> > - struct join_bss_param *ptstrJoinBssParam;
> > + struct join_bss_param *j_bss_param;
> I would choose either join_bss_param or bss_param for the name.
>
Claudiu, Thanks for the code review comments.
I will change j_bss_param to bss_param as per the comments.
> > struct host_if_drv *hif_drv = vif->hif_drv;
> >
> > if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> > @@ -918,8 +918,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > return result;
> > }
> >
> > - ptstrJoinBssParam = attr->params;
> > - if (!ptstrJoinBssParam) {
> > + j_bss_param = attr->params;
> > + if (!j_bss_param) {
> > netdev_err(vif->ndev, "Required BSSID not found\n");
> > result = -ENOENT;
> > goto ERRORHANDLER;
> > @@ -1027,8 +1027,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > netdev_err(vif->ndev, "Channel out of range\n");
> > *(cur_byte++) = 0xFF;
> > }
> > - *(cur_byte++) = (ptstrJoinBssParam->cap_info) & 0xFF;
> > - *(cur_byte++) = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
> > + *(cur_byte++) = (j_bss_param->cap_info) & 0xFF;
> > + *(cur_byte++) = ((j_bss_param->cap_info) >> 8) & 0xFF;
> >
> > if (attr->bssid)
> > memcpy(cur_byte, attr->bssid, 6);
> > @@ -1038,57 +1038,57 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > memcpy(cur_byte, attr->bssid, 6);
> > cur_byte += 6;
> >
> > - *(cur_byte++) = (ptstrJoinBssParam->beacon_period) & 0xFF;
> > - *(cur_byte++) = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
> > - *(cur_byte++) = ptstrJoinBssParam->dtim_period;
> > + *(cur_byte++) = (j_bss_param->beacon_period) & 0xFF;
> > + *(cur_byte++) = ((j_bss_param->beacon_period) >> 8) & 0xFF;
> > + *(cur_byte++) = j_bss_param->dtim_period;
> >
> > - memcpy(cur_byte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
> > + memcpy(cur_byte, j_bss_param->supp_rates, MAX_RATES_SUPPORTED + 1);
> > cur_byte += (MAX_RATES_SUPPORTED + 1);
> >
> > - *(cur_byte++) = ptstrJoinBssParam->wmm_cap;
> > - *(cur_byte++) = ptstrJoinBssParam->uapsd_cap;
> > + *(cur_byte++) = j_bss_param->wmm_cap;
> > + *(cur_byte++) = j_bss_param->uapsd_cap;
> >
> > - *(cur_byte++) = ptstrJoinBssParam->ht_capable;
> > - hif_drv->usr_conn_req.ht_capable = ptstrJoinBssParam->ht_capable;
> > + *(cur_byte++) = j_bss_param->ht_capable;
> > + hif_drv->usr_conn_req.ht_capable = j_bss_param->ht_capable;
> >
> > - *(cur_byte++) = ptstrJoinBssParam->rsn_found;
> > - *(cur_byte++) = ptstrJoinBssParam->rsn_grp_policy;
> > - *(cur_byte++) = ptstrJoinBssParam->mode_802_11i;
> > + *(cur_byte++) = j_bss_param->rsn_found;
> > + *(cur_byte++) = j_bss_param->rsn_grp_policy;
> > + *(cur_byte++) = j_bss_param->mode_802_11i;
> >
> > - memcpy(cur_byte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
> > - cur_byte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
> > + memcpy(cur_byte, j_bss_param->rsn_pcip_policy, sizeof(j_bss_param->rsn_pcip_policy));> + cur_byte += sizeof(j_bss_param->rsn_pcip_policy);
> >
> > - memcpy(cur_byte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
> > - cur_byte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
> > + memcpy(cur_byte, j_bss_param->rsn_auth_policy, sizeof(j_bss_param->rsn_auth_policy));
> > + cur_byte += sizeof(j_bss_param->rsn_auth_policy);
> >
> > - memcpy(cur_byte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
> > - cur_byte += sizeof(ptstrJoinBssParam->rsn_cap);
> > + memcpy(cur_byte, j_bss_param->rsn_cap, sizeof(j_bss_param->rsn_cap));
> > + cur_byte += sizeof(j_bss_param->rsn_cap);
> >
> > *(cur_byte++) = REAL_JOIN_REQ;
> > - *(cur_byte++) = ptstrJoinBssParam->noa_enabled;
> > + *(cur_byte++) = j_bss_param->noa_enabled;
> >
> > - if (ptstrJoinBssParam->noa_enabled) {
> > - *(cur_byte++) = (ptstrJoinBssParam->tsf) & 0xFF;
> > - *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
> > - *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
> > - *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
> > + if (j_bss_param->noa_enabled) {
> > + *(cur_byte++) = (j_bss_param->tsf) & 0xFF;
> > + *(cur_byte++) = ((j_bss_param->tsf) >> 8) & 0xFF;
> > + *(cur_byte++) = ((j_bss_param->tsf) >> 16) & 0xFF;
> > + *(cur_byte++) = ((j_bss_param->tsf) >> 24) & 0xFF;
> >
> > - *(cur_byte++) = ptstrJoinBssParam->opp_enabled;
> > - *(cur_byte++) = ptstrJoinBssParam->idx;
> > + *(cur_byte++) = j_bss_param->opp_enabled;
> > + *(cur_byte++) = j_bss_param->idx;
> >
> > - if (ptstrJoinBssParam->opp_enabled)
> > - *(cur_byte++) = ptstrJoinBssParam->ct_window;
> > + if (j_bss_param->opp_enabled)
> > + *(cur_byte++) = j_bss_param->ct_window;
> >
> > - *(cur_byte++) = ptstrJoinBssParam->cnt;
> > + *(cur_byte++) = j_bss_param->cnt;
> >
> > - memcpy(cur_byte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
> > - cur_byte += sizeof(ptstrJoinBssParam->duration);
> > + memcpy(cur_byte, j_bss_param->duration, sizeof(j_bss_param->duration));
> > + cur_byte += sizeof(j_bss_param->duration);
> >
> > - memcpy(cur_byte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
> > - cur_byte += sizeof(ptstrJoinBssParam->interval);
> > + memcpy(cur_byte, j_bss_param->interval, sizeof(j_bss_param->interval));
> > + cur_byte += sizeof(j_bss_param->interval);
> >
> > - memcpy(cur_byte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
> > - cur_byte += sizeof(ptstrJoinBssParam->start_time);
> > + memcpy(cur_byte, j_bss_param->start_time, sizeof(j_bss_param->start_time));
> > + cur_byte += sizeof(j_bss_param->start_time);
> > }
> >
> > cur_byte = wid_list[wid_cnt].val;
> >
fix "Alignment should match open parenthesis" issues reported by
checkpatch.pl script. changes to comply with linux coding style.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 4 +--
drivers/staging/wilc1000/linux_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 38 +++++++++++------------
3 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 46e2d55..358354b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3730,8 +3730,8 @@ int wilc_add_station(struct wilc_vif *vif, struct add_sta_param *sta_param)
memcpy(add_sta_info, sta_param, sizeof(struct add_sta_param));
if (add_sta_info->rates_len > 0) {
add_sta_info->rates = kmemdup(sta_param->rates,
- add_sta_info->rates_len,
- GFP_KERNEL);
+ add_sta_info->rates_len,
+ GFP_KERNEL);
if (!add_sta_info->rates)
return -ENOMEM;
}
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 3c3f1863..d9725ef 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -695,7 +695,7 @@ static int wlan_initialize_threads(struct net_device *dev)
wilc = vif->wilc;
wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)dev,
- "K_TXQ_TASK");
+ "K_TXQ_TASK");
if (IS_ERR(wilc->txq_thread)) {
netdev_err(dev, "couldn't create TXQ thread\n");
wilc->close = 0;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index fb4a142..621810d 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -470,10 +470,10 @@ static void CfgScanResult(enum scan_event scan_event,
int wilc_connecting;
static void cfg_connect_result(enum conn_event conn_disconn_evt,
- struct connect_info *conn_info,
- u8 mac_status,
- struct disconnect_info *disconn_info,
- void *priv_data)
+ struct connect_info *conn_info,
+ u8 mac_status,
+ struct disconnect_info *disconn_info,
+ void *priv_data)
{
struct wilc_priv *priv;
struct net_device *dev;
@@ -623,18 +623,18 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
}
}
ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
- au8ScanChanList,
- request->n_channels,
- (const u8 *)request->ie,
- request->ie_len, CfgScanResult,
- (void *)priv, &strHiddenNetwork);
+ au8ScanChanList,
+ request->n_channels,
+ (const u8 *)request->ie,
+ request->ie_len, CfgScanResult,
+ (void *)priv, &strHiddenNetwork);
} else {
ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
- au8ScanChanList,
- request->n_channels,
- (const u8 *)request->ie,
- request->ie_len, CfgScanResult,
- (void *)priv, NULL);
+ au8ScanChanList,
+ request->n_channels,
+ (const u8 *)request->ie,
+ request->ie_len, CfgScanResult,
+ (void *)priv, NULL);
}
} else {
netdev_err(priv->dev, "Requested scanned channels over\n");
@@ -793,11 +793,11 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
wilc_wlan_set_bssid(dev, pstrNetworkInfo->bssid, STATION_MODE);
ret = wilc_set_join_req(vif, pstrNetworkInfo->bssid, sme->ssid,
- sme->ssid_len, sme->ie, sme->ie_len,
- cfg_connect_result, (void *)priv,
- u8security, auth_type,
- pstrNetworkInfo->ch,
- pstrNetworkInfo->join_params);
+ sme->ssid_len, sme->ie, sme->ie_len,
+ cfg_connect_result, (void *)priv,
+ u8security, auth_type,
+ pstrNetworkInfo->ch,
+ pstrNetworkInfo->join_params);
if (ret != 0) {
netdev_err(dev, "wilc_set_join_req(): Error\n");
ret = -ENOENT;
--
2.7.4
On Fri, Jan 19, 2018 at 01:20:00PM +0200, Claudiu Beznea wrote:
> It is hard to review this. Anyway, Reviewed-by: Claudiu Beznea <[email protected]>
>
I have a script I use. It's sort of hacky, but it's a time saver. I've
attached it.
To review this one, I do `cat <email.txt> | rename_rev.pl -a`
regards,
dan carpenter
fix "Avoid camleCase" issue reported by checkpatch.pl script.
rename variable name from u32WidsCount to wid_cnt to fix
checkpatch.pl report issue.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 146 +++++++++++++++---------------
1 file changed, 73 insertions(+), 73 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 57b872c..912d223 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -907,7 +907,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
{
s32 result = 0;
struct wid wid_list[8];
- u32 u32WidsCount = 0, dummyval = 0;
+ u32 wid_cnt = 0, dummyval = 0;
u8 *pu8CurrByte = NULL;
struct join_bss_param *ptstrJoinBssParam;
struct host_if_drv *hif_drv = vif->hif_drv;
@@ -952,30 +952,30 @@ static s32 Handle_Connect(struct wilc_vif *vif,
hif_drv->usr_conn_req.conn_result = pstrHostIFconnectAttr->result;
hif_drv->usr_conn_req.arg = pstrHostIFconnectAttr->arg;
- wid_list[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
- wid_list[u32WidsCount].type = WID_INT;
- wid_list[u32WidsCount].size = sizeof(u32);
- wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
- u32WidsCount++;
+ wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
+ wid_list[wid_cnt].type = WID_INT;
+ wid_list[wid_cnt].size = sizeof(u32);
+ wid_list[wid_cnt].val = (s8 *)(&(dummyval));
+ wid_cnt++;
- wid_list[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
- wid_list[u32WidsCount].type = WID_INT;
- wid_list[u32WidsCount].size = sizeof(u32);
- wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
- u32WidsCount++;
+ wid_list[wid_cnt].id = WID_RECEIVED_FRAGMENT_COUNT;
+ wid_list[wid_cnt].type = WID_INT;
+ wid_list[wid_cnt].size = sizeof(u32);
+ wid_list[wid_cnt].val = (s8 *)(&(dummyval));
+ wid_cnt++;
- wid_list[u32WidsCount].id = WID_FAILED_COUNT;
- wid_list[u32WidsCount].type = WID_INT;
- wid_list[u32WidsCount].size = sizeof(u32);
- wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
- u32WidsCount++;
+ wid_list[wid_cnt].id = WID_FAILED_COUNT;
+ wid_list[wid_cnt].type = WID_INT;
+ wid_list[wid_cnt].size = sizeof(u32);
+ wid_list[wid_cnt].val = (s8 *)(&(dummyval));
+ wid_cnt++;
{
- wid_list[u32WidsCount].id = WID_INFO_ELEMENT_ASSOCIATE;
- wid_list[u32WidsCount].type = WID_BIN_DATA;
- wid_list[u32WidsCount].val = hif_drv->usr_conn_req.ies;
- wid_list[u32WidsCount].size = hif_drv->usr_conn_req.ies_len;
- u32WidsCount++;
+ wid_list[wid_cnt].id = WID_INFO_ELEMENT_ASSOCIATE;
+ wid_list[wid_cnt].type = WID_BIN_DATA;
+ wid_list[wid_cnt].val = hif_drv->usr_conn_req.ies;
+ wid_list[wid_cnt].size = hif_drv->usr_conn_req.ies_len;
+ wid_cnt++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
info_element_size = hif_drv->usr_conn_req.ies_len;
@@ -984,39 +984,39 @@ static s32 Handle_Connect(struct wilc_vif *vif,
info_element_size);
}
}
- wid_list[u32WidsCount].id = (u16)WID_11I_MODE;
- wid_list[u32WidsCount].type = WID_CHAR;
- wid_list[u32WidsCount].size = sizeof(char);
- wid_list[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.security;
- u32WidsCount++;
+ wid_list[wid_cnt].id = (u16)WID_11I_MODE;
+ wid_list[wid_cnt].type = WID_CHAR;
+ wid_list[wid_cnt].size = sizeof(char);
+ wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.security;
+ wid_cnt++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
mode_11i = hif_drv->usr_conn_req.security;
- wid_list[u32WidsCount].id = (u16)WID_AUTH_TYPE;
- wid_list[u32WidsCount].type = WID_CHAR;
- wid_list[u32WidsCount].size = sizeof(char);
- wid_list[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
- u32WidsCount++;
+ wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
+ wid_list[wid_cnt].type = WID_CHAR;
+ wid_list[wid_cnt].size = sizeof(char);
+ wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
+ wid_cnt++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
auth_type = (u8)hif_drv->usr_conn_req.auth_type;
- wid_list[u32WidsCount].id = (u16)WID_JOIN_REQ_EXTENDED;
- wid_list[u32WidsCount].type = WID_STR;
- wid_list[u32WidsCount].size = 112;
- wid_list[u32WidsCount].val = kmalloc(wid_list[u32WidsCount].size, GFP_KERNEL);
+ wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
+ wid_list[wid_cnt].type = WID_STR;
+ wid_list[wid_cnt].size = 112;
+ wid_list[wid_cnt].val = kmalloc(wid_list[wid_cnt].size, GFP_KERNEL);
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
- join_req_size = wid_list[u32WidsCount].size;
+ join_req_size = wid_list[wid_cnt].size;
join_req = kmalloc(join_req_size, GFP_KERNEL);
}
- if (!wid_list[u32WidsCount].val) {
+ if (!wid_list[wid_cnt].val) {
result = -EFAULT;
goto ERRORHANDLER;
}
- pu8CurrByte = wid_list[u32WidsCount].val;
+ pu8CurrByte = wid_list[wid_cnt].val;
if (pstrHostIFconnectAttr->ssid) {
memcpy(pu8CurrByte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
@@ -1095,8 +1095,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
pu8CurrByte += sizeof(ptstrJoinBssParam->start_time);
}
- pu8CurrByte = wid_list[u32WidsCount].val;
- u32WidsCount++;
+ pu8CurrByte = wid_list[wid_cnt].val;
+ wid_cnt++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
memcpy(join_req, pu8CurrByte, join_req_size);
@@ -1108,7 +1108,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
pstrHostIFconnectAttr->bssid, ETH_ALEN);
result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
- u32WidsCount,
+ wid_cnt,
wilc_get_vif_idx(vif));
if (result) {
netdev_err(vif->ndev, "failed to send config packet\n");
@@ -1893,40 +1893,40 @@ static s32 Handle_GetStatistics(struct wilc_vif *vif,
struct rf_info *pstrStatistics)
{
struct wid wid_list[5];
- u32 u32WidsCount = 0, result = 0;
-
- wid_list[u32WidsCount].id = WID_LINKSPEED;
- wid_list[u32WidsCount].type = WID_CHAR;
- wid_list[u32WidsCount].size = sizeof(char);
- wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->link_speed;
- u32WidsCount++;
-
- wid_list[u32WidsCount].id = WID_RSSI;
- wid_list[u32WidsCount].type = WID_CHAR;
- wid_list[u32WidsCount].size = sizeof(char);
- wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->rssi;
- u32WidsCount++;
-
- wid_list[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
- wid_list[u32WidsCount].type = WID_INT;
- wid_list[u32WidsCount].size = sizeof(u32);
- wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->tx_cnt;
- u32WidsCount++;
-
- wid_list[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
- wid_list[u32WidsCount].type = WID_INT;
- wid_list[u32WidsCount].size = sizeof(u32);
- wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->rx_cnt;
- u32WidsCount++;
-
- wid_list[u32WidsCount].id = WID_FAILED_COUNT;
- wid_list[u32WidsCount].type = WID_INT;
- wid_list[u32WidsCount].size = sizeof(u32);
- wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->tx_fail_cnt;
- u32WidsCount++;
+ u32 wid_cnt = 0, result = 0;
+
+ wid_list[wid_cnt].id = WID_LINKSPEED;
+ wid_list[wid_cnt].type = WID_CHAR;
+ wid_list[wid_cnt].size = sizeof(char);
+ wid_list[wid_cnt].val = (s8 *)&pstrStatistics->link_speed;
+ wid_cnt++;
+
+ wid_list[wid_cnt].id = WID_RSSI;
+ wid_list[wid_cnt].type = WID_CHAR;
+ wid_list[wid_cnt].size = sizeof(char);
+ wid_list[wid_cnt].val = (s8 *)&pstrStatistics->rssi;
+ wid_cnt++;
+
+ wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
+ wid_list[wid_cnt].type = WID_INT;
+ wid_list[wid_cnt].size = sizeof(u32);
+ wid_list[wid_cnt].val = (s8 *)&pstrStatistics->tx_cnt;
+ wid_cnt++;
+
+ wid_list[wid_cnt].id = WID_RECEIVED_FRAGMENT_COUNT;
+ wid_list[wid_cnt].type = WID_INT;
+ wid_list[wid_cnt].size = sizeof(u32);
+ wid_list[wid_cnt].val = (s8 *)&pstrStatistics->rx_cnt;
+ wid_cnt++;
+
+ wid_list[wid_cnt].id = WID_FAILED_COUNT;
+ wid_list[wid_cnt].type = WID_INT;
+ wid_list[wid_cnt].size = sizeof(u32);
+ wid_list[wid_cnt].val = (s8 *)&pstrStatistics->tx_fail_cnt;
+ wid_cnt++;
result = wilc_send_config_pkt(vif, GET_CFG, wid_list,
- u32WidsCount,
+ wid_cnt,
wilc_get_vif_idx(vif));
if (result)
--
2.7.4
fix "Avoid camelCase" issue found by checkpatch.pl script.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 104 ++++++++++++++----------------
1 file changed, 49 insertions(+), 55 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e3931bc..4ddd1a8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -903,7 +903,7 @@ static s32 Handle_ScanDone(struct wilc_vif *vif,
u8 wilc_connected_ssid[6] = {0};
static s32 Handle_Connect(struct wilc_vif *vif,
- struct connect_attr *pstrHostIFconnectAttr)
+ struct connect_attr *attr)
{
s32 result = 0;
struct wid wid_list[8];
@@ -912,45 +912,41 @@ static s32 Handle_Connect(struct wilc_vif *vif,
struct join_bss_param *ptstrJoinBssParam;
struct host_if_drv *hif_drv = vif->hif_drv;
- if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
+ if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
result = 0;
netdev_err(vif->ndev, "Discard connect request\n");
return result;
}
- ptstrJoinBssParam = pstrHostIFconnectAttr->params;
+ ptstrJoinBssParam = attr->params;
if (!ptstrJoinBssParam) {
netdev_err(vif->ndev, "Required BSSID not found\n");
result = -ENOENT;
goto ERRORHANDLER;
}
- if (pstrHostIFconnectAttr->bssid) {
+ if (attr->bssid) {
hif_drv->usr_conn_req.bssid = kmalloc(6, GFP_KERNEL);
- memcpy(hif_drv->usr_conn_req.bssid, pstrHostIFconnectAttr->bssid, 6);
+ memcpy(hif_drv->usr_conn_req.bssid, attr->bssid, 6);
}
- hif_drv->usr_conn_req.ssid_len = pstrHostIFconnectAttr->ssid_len;
- if (pstrHostIFconnectAttr->ssid) {
- hif_drv->usr_conn_req.ssid = kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
- memcpy(hif_drv->usr_conn_req.ssid,
- pstrHostIFconnectAttr->ssid,
- pstrHostIFconnectAttr->ssid_len);
- hif_drv->usr_conn_req.ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
+ hif_drv->usr_conn_req.ssid_len = attr->ssid_len;
+ if (attr->ssid) {
+ hif_drv->usr_conn_req.ssid = kmalloc(attr->ssid_len + 1, GFP_KERNEL);
+ memcpy(hif_drv->usr_conn_req.ssid, attr->ssid, attr->ssid_len);
+ hif_drv->usr_conn_req.ssid[attr->ssid_len] = '\0';
}
- hif_drv->usr_conn_req.ies_len = pstrHostIFconnectAttr->ies_len;
- if (pstrHostIFconnectAttr->ies) {
- hif_drv->usr_conn_req.ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
- memcpy(hif_drv->usr_conn_req.ies,
- pstrHostIFconnectAttr->ies,
- pstrHostIFconnectAttr->ies_len);
+ hif_drv->usr_conn_req.ies_len = attr->ies_len;
+ if (attr->ies) {
+ hif_drv->usr_conn_req.ies = kmalloc(attr->ies_len, GFP_KERNEL);
+ memcpy(hif_drv->usr_conn_req.ies, attr->ies, attr->ies_len);
}
- hif_drv->usr_conn_req.security = pstrHostIFconnectAttr->security;
- hif_drv->usr_conn_req.auth_type = pstrHostIFconnectAttr->auth_type;
- hif_drv->usr_conn_req.conn_result = pstrHostIFconnectAttr->result;
- hif_drv->usr_conn_req.arg = pstrHostIFconnectAttr->arg;
+ hif_drv->usr_conn_req.security = attr->security;
+ hif_drv->usr_conn_req.auth_type = attr->auth_type;
+ hif_drv->usr_conn_req.conn_result = attr->result;
+ hif_drv->usr_conn_req.arg = attr->arg;
wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
wid_list[wid_cnt].type = WID_INT;
@@ -977,7 +973,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
wid_list[wid_cnt].size = hif_drv->usr_conn_req.ies_len;
wid_cnt++;
- if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
+ if (memcmp("DIRECT-", attr->ssid, 7)) {
info_element_size = hif_drv->usr_conn_req.ies_len;
info_element = kmalloc(info_element_size, GFP_KERNEL);
memcpy(info_element, hif_drv->usr_conn_req.ies,
@@ -990,7 +986,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.security;
wid_cnt++;
- if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
+ if (memcmp("DIRECT-", attr->ssid, 7))
mode_11i = hif_drv->usr_conn_req.security;
wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
@@ -999,7 +995,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
wid_cnt++;
- if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
+ if (memcmp("DIRECT-", attr->ssid, 7))
auth_type = (u8)hif_drv->usr_conn_req.auth_type;
wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
@@ -1007,7 +1003,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
wid_list[wid_cnt].size = 112;
wid_list[wid_cnt].val = kmalloc(wid_list[wid_cnt].size, GFP_KERNEL);
- if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
+ if (memcmp("DIRECT-", attr->ssid, 7)) {
join_req_size = wid_list[wid_cnt].size;
join_req = kmalloc(join_req_size, GFP_KERNEL);
}
@@ -1018,15 +1014,15 @@ static s32 Handle_Connect(struct wilc_vif *vif,
cur_byte = wid_list[wid_cnt].val;
- if (pstrHostIFconnectAttr->ssid) {
- memcpy(cur_byte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
- cur_byte[pstrHostIFconnectAttr->ssid_len] = '\0';
+ if (attr->ssid) {
+ memcpy(cur_byte, attr->ssid, attr->ssid_len);
+ cur_byte[attr->ssid_len] = '\0';
}
cur_byte += MAX_SSID_LEN;
*(cur_byte++) = INFRASTRUCTURE;
- if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
- *(cur_byte++) = pstrHostIFconnectAttr->ch;
+ if (attr->ch >= 1 && attr->ch <= 14) {
+ *(cur_byte++) = attr->ch;
} else {
netdev_err(vif->ndev, "Channel out of range\n");
*(cur_byte++) = 0xFF;
@@ -1034,12 +1030,12 @@ static s32 Handle_Connect(struct wilc_vif *vif,
*(cur_byte++) = (ptstrJoinBssParam->cap_info) & 0xFF;
*(cur_byte++) = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
- if (pstrHostIFconnectAttr->bssid)
- memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+ if (attr->bssid)
+ memcpy(cur_byte, attr->bssid, 6);
cur_byte += 6;
- if (pstrHostIFconnectAttr->bssid)
- memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+ if (attr->bssid)
+ memcpy(cur_byte, attr->bssid, 6);
cur_byte += 6;
*(cur_byte++) = (ptstrJoinBssParam->beacon_period) & 0xFF;
@@ -1098,14 +1094,14 @@ static s32 Handle_Connect(struct wilc_vif *vif,
cur_byte = wid_list[wid_cnt].val;
wid_cnt++;
- if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
+ if (memcmp("DIRECT-", attr->ssid, 7)) {
memcpy(join_req, cur_byte, join_req_size);
join_req_vif = vif;
}
- if (pstrHostIFconnectAttr->bssid)
+ if (attr->bssid)
memcpy(wilc_connected_ssid,
- pstrHostIFconnectAttr->bssid, ETH_ALEN);
+ attr->bssid, ETH_ALEN);
result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
wid_cnt,
@@ -1126,23 +1122,21 @@ static s32 Handle_Connect(struct wilc_vif *vif,
memset(&strConnectInfo, 0, sizeof(struct connect_info));
- if (pstrHostIFconnectAttr->result) {
- if (pstrHostIFconnectAttr->bssid)
- memcpy(strConnectInfo.bssid, pstrHostIFconnectAttr->bssid, 6);
+ if (attr->result) {
+ if (attr->bssid)
+ memcpy(strConnectInfo.bssid, attr->bssid, 6);
- if (pstrHostIFconnectAttr->ies) {
- strConnectInfo.req_ies_len = pstrHostIFconnectAttr->ies_len;
- strConnectInfo.req_ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
- memcpy(strConnectInfo.req_ies,
- pstrHostIFconnectAttr->ies,
- pstrHostIFconnectAttr->ies_len);
+ if (attr->ies) {
+ strConnectInfo.req_ies_len = attr->ies_len;
+ strConnectInfo.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
+ memcpy(strConnectInfo.req_ies, attr->ies, attr->ies_len);
}
- pstrHostIFconnectAttr->result(CONN_DISCONN_EVENT_CONN_RESP,
+ attr->result(CONN_DISCONN_EVENT_CONN_RESP,
&strConnectInfo,
MAC_DISCONNECTED,
NULL,
- pstrHostIFconnectAttr->arg);
+ attr->arg);
hif_drv->hif_state = HOST_IF_IDLE;
kfree(strConnectInfo.req_ies);
strConnectInfo.req_ies = NULL;
@@ -1152,14 +1146,14 @@ static s32 Handle_Connect(struct wilc_vif *vif,
}
}
- kfree(pstrHostIFconnectAttr->bssid);
- pstrHostIFconnectAttr->bssid = NULL;
+ kfree(attr->bssid);
+ attr->bssid = NULL;
- kfree(pstrHostIFconnectAttr->ssid);
- pstrHostIFconnectAttr->ssid = NULL;
+ kfree(attr->ssid);
+ attr->ssid = NULL;
- kfree(pstrHostIFconnectAttr->ies);
- pstrHostIFconnectAttr->ies = NULL;
+ kfree(attr->ies);
+ attr->ies = NULL;
kfree(cur_byte);
return result;
--
2.7.4
It is hard to review this. Anyway, Reviewed-by: Claudiu Beznea <[email protected]>
On 18.01.2018 15:17, Ajay Singh wrote:
> fix "Avoid CamelCase:" issue reported by checkpatch.pl script
> Rename host_int_ParseJoinBssParam() & its variables name using
> camelCase.
>
> Signed-off-by: Ajay Singh <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 230 +++++++++++++++---------------
> 1 file changed, 115 insertions(+), 115 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 358354b..9f6365a 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -265,7 +265,7 @@ static struct wilc_vif *join_req_vif;
> #define FLUSHED_JOIN_REQ 1
> #define FLUSHED_BYTE_POS 79
>
> -static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo);
> +static void *host_parse_join_bss_param(struct network_info *info);
> 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 void host_if_work(struct work_struct *work);
> @@ -1288,7 +1288,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
> hif_drv->usr_scan_req.rcvd_ch_cnt++;
>
> pstrNetworkInfo->new_network = true;
> - pJoinParams = host_int_ParseJoinBssParam(pstrNetworkInfo);
> + pJoinParams = host_parse_join_bss_param(pstrNetworkInfo);
>
> hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
> hif_drv->usr_scan_req.arg,
> @@ -3870,152 +3870,152 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
> return result;
> }
>
> -static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
I would use host_int_parse_join_bss_param() of at least hif_parse_join_bss_param, if any.
> +static void *host_parse_join_bss_param(struct network_info *info)
> {
> - struct join_bss_param *pNewJoinBssParam = NULL;
> - u8 *pu8IEs;
> - u16 u16IEsLen;
> + struct join_bss_param *param = NULL;
> + u8 *ies;
> + u16 ies_len;
> u16 index = 0;
> - u8 suppRatesNo = 0;
> - u8 extSuppRatesNo;
> - u16 jumpOffset;
> - u8 pcipherCount;
> - u8 authCount;
> - u8 pcipherTotalCount = 0;
> - u8 authTotalCount = 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;
>
> - pu8IEs = ptstrNetworkInfo->ies;
> - u16IEsLen = ptstrNetworkInfo->ies_len;
> -
> - pNewJoinBssParam = kzalloc(sizeof(*pNewJoinBssParam), GFP_KERNEL);
> - if (pNewJoinBssParam) {
> - pNewJoinBssParam->dtim_period = ptstrNetworkInfo->dtim_period;
> - pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period;
> - pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
> - memcpy(pNewJoinBssParam->bssid, ptstrNetworkInfo->bssid, 6);
> - memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid,
> - ptstrNetworkInfo->ssid_len + 1);
> - pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len;
> - memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3);
> - memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3);
> -
> - while (index < u16IEsLen) {
> - if (pu8IEs[index] == SUPP_RATES_IE) {
> - suppRatesNo = pu8IEs[index + 1];
> - pNewJoinBssParam->supp_rates[0] = suppRatesNo;
> + ies = info->ies;
> + ies_len = info->ies_len;
> +
> + param = kzalloc(sizeof(*param), GFP_KERNEL);
> + if (param) {
> + 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;
> index += 2;
>
> - for (i = 0; i < suppRatesNo; i++)
> - pNewJoinBssParam->supp_rates[i + 1] = pu8IEs[index + i];
> + for (i = 0; i < rates_no; i++)
> + param->supp_rates[i + 1] = ies[index + i];
>
> - index += suppRatesNo;
> - } else if (pu8IEs[index] == EXT_SUPP_RATES_IE) {
> - extSuppRatesNo = pu8IEs[index + 1];
> - if (extSuppRatesNo > (MAX_RATES_SUPPORTED - suppRatesNo))
> - pNewJoinBssParam->supp_rates[0] = MAX_RATES_SUPPORTED;
> + index += rates_no;
> + } else if (ies[index] == EXT_SUPP_RATES_IE) {
> + ext_rates_no = ies[index + 1];
> + if (ext_rates_no > (MAX_RATES_SUPPORTED - rates_no))
> + param->supp_rates[0] = MAX_RATES_SUPPORTED;
> else
> - pNewJoinBssParam->supp_rates[0] += extSuppRatesNo;
> + param->supp_rates[0] += ext_rates_no;
> index += 2;
> - for (i = 0; i < (pNewJoinBssParam->supp_rates[0] - suppRatesNo); i++)
> - pNewJoinBssParam->supp_rates[suppRatesNo + i + 1] = pu8IEs[index + i];
> -
> - index += extSuppRatesNo;
> - } else if (pu8IEs[index] == HT_CAPABILITY_IE) {
> - pNewJoinBssParam->ht_capable = true;
> - index += pu8IEs[index + 1] + 2;
> - } else if ((pu8IEs[index] == WMM_IE) &&
> - (pu8IEs[index + 2] == 0x00) && (pu8IEs[index + 3] == 0x50) &&
> - (pu8IEs[index + 4] == 0xF2) &&
> - (pu8IEs[index + 5] == 0x02) &&
> - ((pu8IEs[index + 6] == 0x00) || (pu8IEs[index + 6] == 0x01)) &&
> - (pu8IEs[index + 7] == 0x01)) {
> - pNewJoinBssParam->wmm_cap = true;
> -
> - if (pu8IEs[index + 8] & BIT(7))
> - pNewJoinBssParam->uapsd_cap = true;
> - index += pu8IEs[index + 1] + 2;
> - } else if ((pu8IEs[index] == P2P_IE) &&
> - (pu8IEs[index + 2] == 0x50) && (pu8IEs[index + 3] == 0x6f) &&
> - (pu8IEs[index + 4] == 0x9a) &&
> - (pu8IEs[index + 5] == 0x09) && (pu8IEs[index + 6] == 0x0c)) {
> - u16 u16P2P_count;
> -
> - pNewJoinBssParam->tsf = ptstrNetworkInfo->tsf_lo;
> - pNewJoinBssParam->noa_enabled = 1;
> - pNewJoinBssParam->idx = pu8IEs[index + 9];
> -
> - if (pu8IEs[index + 10] & BIT(7)) {
> - pNewJoinBssParam->opp_enabled = 1;
> - pNewJoinBssParam->ct_window = pu8IEs[index + 10];
> + for (i = 0; i < (param->supp_rates[0] - rates_no); i++)
> + param->supp_rates[rates_no + i + 1] = ies[index + i];
> +
> + index += ext_rates_no;
> + } else if (ies[index] == HT_CAPABILITY_IE) {
> + param->ht_capable = true;
> + 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 + 6] == 0x00) || (ies[index + 6] == 0x01)) &&
> + (ies[index + 7] == 0x01)) {
> + param->wmm_cap = true;
> +
> + if (ies[index + 8] & BIT(7))
> + param->uapsd_cap = true;
> + index += ies[index + 1] + 2;
> + } else if ((ies[index] == P2P_IE) &&
> + (ies[index + 2] == 0x50) && (ies[index + 3] == 0x6f) &&
> + (ies[index + 4] == 0x9a) &&
> + (ies[index + 5] == 0x09) && (ies[index + 6] == 0x0c)) {
> + u16 p2p_cnt;
> +
> + param->tsf = info->tsf_lo;
> + param->noa_enabled = 1;
> + param->idx = ies[index + 9];
> +
> + if (ies[index + 10] & BIT(7)) {
> + param->opp_enabled = 1;
> + param->ct_window = ies[index + 10];
> } else {
> - pNewJoinBssParam->opp_enabled = 0;
> + param->opp_enabled = 0;
> }
>
> - pNewJoinBssParam->cnt = pu8IEs[index + 11];
> - u16P2P_count = index + 12;
> + param->cnt = ies[index + 11];
> + p2p_cnt = index + 12;
>
> - memcpy(pNewJoinBssParam->duration, pu8IEs + u16P2P_count, 4);
> - u16P2P_count += 4;
> + memcpy(param->duration, ies + p2p_cnt, 4);
> + p2p_cnt += 4;
>
> - memcpy(pNewJoinBssParam->interval, pu8IEs + u16P2P_count, 4);
> - u16P2P_count += 4;
> + memcpy(param->interval, ies + p2p_cnt, 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;
> - } else if ((pu8IEs[index] == RSN_IE) ||
> - ((pu8IEs[index] == WPA_IE) && (pu8IEs[index + 2] == 0x00) &&
> - (pu8IEs[index + 3] == 0x50) && (pu8IEs[index + 4] == 0xF2) &&
> - (pu8IEs[index + 5] == 0x01))) {
> - u16 rsnIndex = index;
> + index += ies[index + 1] + 2;
> + } else if ((ies[index] == RSN_IE) ||
> + ((ies[index] == WPA_IE) && (ies[index + 2] == 0x00) &&
> + (ies[index + 3] == 0x50) && (ies[index + 4] == 0xF2) &&
> + (ies[index + 5] == 0x01))) {
> + u16 rsn_idx = index;
>
> - if (pu8IEs[rsnIndex] == RSN_IE) {
> - pNewJoinBssParam->mode_802_11i = 2;
> + if (ies[rsn_idx] == RSN_IE) {
> + param->mode_802_11i = 2;
> } else {
> - if (pNewJoinBssParam->mode_802_11i == 0)
> - pNewJoinBssParam->mode_802_11i = 1;
> - rsnIndex += 4;
> + if (param->mode_802_11i == 0)
> + param->mode_802_11i = 1;
> + rsn_idx += 4;
> }
>
> - rsnIndex += 7;
> - pNewJoinBssParam->rsn_grp_policy = pu8IEs[rsnIndex];
> - rsnIndex++;
> - jumpOffset = pu8IEs[rsnIndex] * 4;
> - pcipherCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
> - rsnIndex += 2;
> + rsn_idx += 7;
> + param->rsn_grp_policy = ies[rsn_idx];
> + rsn_idx++;
> + offset = ies[rsn_idx] * 4;
> + pcipher_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
> + rsn_idx += 2;
>
> - for (i = pcipherTotalCount, j = 0; i < pcipherCount + pcipherTotalCount && i < 3; i++, j++)
> - pNewJoinBssParam->rsn_pcip_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
> + 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];
>
> - pcipherTotalCount += pcipherCount;
> - rsnIndex += jumpOffset;
> + pcipher_total_cnt += pcipher_cnt;
> + rsn_idx += offset;
>
> - jumpOffset = pu8IEs[rsnIndex] * 4;
> + offset = ies[rsn_idx] * 4;
>
> - authCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
> - rsnIndex += 2;
> + auth_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
> + rsn_idx += 2;
>
> - for (i = authTotalCount, j = 0; i < authTotalCount + authCount; i++, j++)
> - pNewJoinBssParam->rsn_auth_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
> + 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];
>
> - authTotalCount += authCount;
> - rsnIndex += jumpOffset;
> + auth_total_cnt += auth_cnt;
> + rsn_idx += offset;
>
> - if (pu8IEs[index] == RSN_IE) {
> - pNewJoinBssParam->rsn_cap[0] = pu8IEs[rsnIndex];
> - pNewJoinBssParam->rsn_cap[1] = pu8IEs[rsnIndex + 1];
> - rsnIndex += 2;
> + if (ies[index] == RSN_IE) {
> + param->rsn_cap[0] = ies[rsn_idx];
> + param->rsn_cap[1] = ies[rsn_idx + 1];
> + rsn_idx += 2;
> }
> - pNewJoinBssParam->rsn_found = true;
> - index += pu8IEs[index + 1] + 2;
> + param->rsn_found = true;
> + index += ies[index + 1] + 2;
> } 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)
>
fix the "do not add new typedefs" issue found by checkpatch.pl
script
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan_if.h | 72 ++++++++++++++++-----------------
1 file changed, 36 insertions(+), 36 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index 1641ddb..e186509 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -114,28 +114,28 @@ enum {
G_MIXED_11B_2_MODE, /* 1,2,5,11,6,12,24 otherwise all on */
};
-typedef enum {
+enum {
G_SHORT_PREAMBLE = 0, /* Short Preamble */
G_LONG_PREAMBLE = 1, /* Long Preamble */
G_AUTO_PREAMBLE = 2, /* Auto Preamble Selection */
-} G_PREAMBLE_T;
+};
#define MAC_CONNECTED 1
#define MAC_DISCONNECTED 0
#define SCAN_DONE TRUE
-typedef enum {
+enum {
PASSIVE_SCAN = 0,
ACTIVE_SCAN = 1,
-} SCANTYPE_T;
+};
-typedef enum {
+enum {
NO_POWERSAVE = 0,
MIN_FAST_PS = 1,
MAX_FAST_PS = 2,
MIN_PSPOLL_PS = 3,
MAX_PSPOLL_PS = 4
-} USER_PS_MODE_T;
+};
enum chip_ps_states {
CHIP_WAKEDUP = 0,
@@ -153,7 +153,7 @@ enum bus_release {
RELEASE_ALLOW_SLEEP = 1,
};
-typedef enum {
+enum {
NO_SECURITY = 0,
WEP_40 = 0x3,
WEP_104 = 0x7,
@@ -163,7 +163,7 @@ typedef enum {
WPA2_AES = 0x31,
WPA2_TKIP = 0x51,
WPA2_AES_TKIP = 0x71, /* Aes or Tkip */
-} SECURITY_T;
+};
enum AUTHTYPE {
OPEN_SYSTEM = 1,
@@ -178,88 +178,88 @@ enum SITESURVEY {
SITE_SURVEY_OFF = 2
};
-typedef enum {
+enum {
NORMAL_ACK = 0,
NO_ACK,
-} ACK_POLICY_T;
+};
-typedef enum {
+enum {
DONT_RESET = 0,
DO_RESET = 1,
NO_REQUEST = 2,
-} RESET_REQ_T;
+};
-typedef enum {
+enum {
REKEY_DISABLE = 1,
REKEY_TIME_BASE,
REKEY_PKT_BASE,
REKEY_TIME_PKT_BASE
-} RSNA_REKEY_POLICY_T;
+};
-typedef enum {
+enum {
FILTER_NO = 0x00,
FILTER_AP_ONLY = 0x01,
FILTER_STA_ONLY = 0x02
-} SCAN_CLASS_FITLER_T;
+};
-typedef enum {
+enum {
PRI_HIGH_RSSI = 0x00,
PRI_LOW_RSSI = 0x04,
PRI_DETECT = 0x08
-} SCAN_PRI_T;
+};
-typedef enum {
+enum {
CH_FILTER_OFF = 0x00,
CH_FILTER_ON = 0x10
-} CH_FILTER_T;
+};
-typedef enum {
+enum {
AUTO_PROT = 0, /* Auto */
NO_PROT, /* Do not use any protection */
ERP_PROT, /* Protect all ERP frame exchanges */
HT_PROT, /* Protect all HT frame exchanges */
GF_PROT, /* Protect all GF frame exchanges */
-} N_PROTECTION_MODE_T;
+};
-typedef enum {
+enum {
G_SELF_CTS_PROT,
G_RTS_CTS_PROT,
-} G_PROTECTION_MODE_T;
+};
-typedef enum {
+enum {
HT_MIXED_MODE = 1,
HT_ONLY_20MHZ_MODE,
HT_ONLY_20_40MHZ_MODE,
-} N_OPERATING_MODE_T;
+};
-typedef enum {
+enum {
NO_DETECT = 0,
DETECT_ONLY = 1,
DETECT_PROTECT = 2,
DETECT_PROTECT_REPORT = 3,
-} N_OBSS_DETECTION_T;
+};
-typedef enum {
+enum {
RTS_CTS_NONHT_PROT = 0, /* RTS-CTS at non-HT rate */
FIRST_FRAME_NONHT_PROT, /* First frame at non-HT rate */
LSIG_TXOP_PROT, /* LSIG TXOP Protection */
FIRST_FRAME_MIXED_PROT, /* First frame at Mixed format */
-} N_PROTECTION_TYPE_T;
+};
-typedef enum {
+enum {
STATIC_MODE = 1,
DYNAMIC_MODE = 2,
MIMO_MODE = 3, /* power save disable */
-} N_SMPS_MODE_T;
+};
-typedef enum {
+enum {
DISABLE_SELF_CTS,
ENABLE_SELF_CTS,
DISABLE_TX_ABORT,
ENABLE_TX_ABORT,
HW_TRIGGER_ABORT,
SW_TRIGGER_ABORT,
-} TX_ABORT_OPTION_T;
+};
enum wid_type {
WID_CHAR = 0,
@@ -281,7 +281,7 @@ struct wid {
s8 *val;
};
-typedef enum {
+enum {
WID_NIL = 0xffff,
/*
@@ -889,7 +889,7 @@ typedef enum {
/* Miscellaneous WIDs */
WID_ALL = 0x7FFE,
WID_MAX = 0xFFFF
-} WID_T;
+};
struct wilc;
int wilc_wlan_init(struct net_device *dev);
--
2.7.4
fix "Avoid camelCase" issue reported by checkpatch.pl script.
rename variable name from "pu8CurrByte" to "cur_byte"
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 232 +++++++++++++++---------------
1 file changed, 116 insertions(+), 116 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 912d223..e3931bc 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -908,7 +908,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
s32 result = 0;
struct wid wid_list[8];
u32 wid_cnt = 0, dummyval = 0;
- u8 *pu8CurrByte = NULL;
+ u8 *cur_byte = NULL;
struct join_bss_param *ptstrJoinBssParam;
struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1016,90 +1016,90 @@ static s32 Handle_Connect(struct wilc_vif *vif,
goto ERRORHANDLER;
}
- pu8CurrByte = wid_list[wid_cnt].val;
+ cur_byte = wid_list[wid_cnt].val;
if (pstrHostIFconnectAttr->ssid) {
- memcpy(pu8CurrByte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
- pu8CurrByte[pstrHostIFconnectAttr->ssid_len] = '\0';
+ memcpy(cur_byte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
+ cur_byte[pstrHostIFconnectAttr->ssid_len] = '\0';
}
- pu8CurrByte += MAX_SSID_LEN;
- *(pu8CurrByte++) = INFRASTRUCTURE;
+ cur_byte += MAX_SSID_LEN;
+ *(cur_byte++) = INFRASTRUCTURE;
if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
- *(pu8CurrByte++) = pstrHostIFconnectAttr->ch;
+ *(cur_byte++) = pstrHostIFconnectAttr->ch;
} else {
netdev_err(vif->ndev, "Channel out of range\n");
- *(pu8CurrByte++) = 0xFF;
+ *(cur_byte++) = 0xFF;
}
- *(pu8CurrByte++) = (ptstrJoinBssParam->cap_info) & 0xFF;
- *(pu8CurrByte++) = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
+ *(cur_byte++) = (ptstrJoinBssParam->cap_info) & 0xFF;
+ *(cur_byte++) = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
if (pstrHostIFconnectAttr->bssid)
- memcpy(pu8CurrByte, pstrHostIFconnectAttr->bssid, 6);
- pu8CurrByte += 6;
+ memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+ cur_byte += 6;
if (pstrHostIFconnectAttr->bssid)
- memcpy(pu8CurrByte, pstrHostIFconnectAttr->bssid, 6);
- pu8CurrByte += 6;
+ memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+ cur_byte += 6;
- *(pu8CurrByte++) = (ptstrJoinBssParam->beacon_period) & 0xFF;
- *(pu8CurrByte++) = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
- *(pu8CurrByte++) = ptstrJoinBssParam->dtim_period;
+ *(cur_byte++) = (ptstrJoinBssParam->beacon_period) & 0xFF;
+ *(cur_byte++) = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
+ *(cur_byte++) = ptstrJoinBssParam->dtim_period;
- memcpy(pu8CurrByte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
- pu8CurrByte += (MAX_RATES_SUPPORTED + 1);
+ memcpy(cur_byte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
+ cur_byte += (MAX_RATES_SUPPORTED + 1);
- *(pu8CurrByte++) = ptstrJoinBssParam->wmm_cap;
- *(pu8CurrByte++) = ptstrJoinBssParam->uapsd_cap;
+ *(cur_byte++) = ptstrJoinBssParam->wmm_cap;
+ *(cur_byte++) = ptstrJoinBssParam->uapsd_cap;
- *(pu8CurrByte++) = ptstrJoinBssParam->ht_capable;
+ *(cur_byte++) = ptstrJoinBssParam->ht_capable;
hif_drv->usr_conn_req.ht_capable = ptstrJoinBssParam->ht_capable;
- *(pu8CurrByte++) = ptstrJoinBssParam->rsn_found;
- *(pu8CurrByte++) = ptstrJoinBssParam->rsn_grp_policy;
- *(pu8CurrByte++) = ptstrJoinBssParam->mode_802_11i;
+ *(cur_byte++) = ptstrJoinBssParam->rsn_found;
+ *(cur_byte++) = ptstrJoinBssParam->rsn_grp_policy;
+ *(cur_byte++) = ptstrJoinBssParam->mode_802_11i;
- memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
- pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
+ memcpy(cur_byte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
+ cur_byte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
- memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
- pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
+ memcpy(cur_byte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
+ cur_byte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
- memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
- pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_cap);
+ memcpy(cur_byte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
+ cur_byte += sizeof(ptstrJoinBssParam->rsn_cap);
- *(pu8CurrByte++) = REAL_JOIN_REQ;
- *(pu8CurrByte++) = ptstrJoinBssParam->noa_enabled;
+ *(cur_byte++) = REAL_JOIN_REQ;
+ *(cur_byte++) = ptstrJoinBssParam->noa_enabled;
if (ptstrJoinBssParam->noa_enabled) {
- *(pu8CurrByte++) = (ptstrJoinBssParam->tsf) & 0xFF;
- *(pu8CurrByte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
- *(pu8CurrByte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
- *(pu8CurrByte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
+ *(cur_byte++) = (ptstrJoinBssParam->tsf) & 0xFF;
+ *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
+ *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
+ *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
- *(pu8CurrByte++) = ptstrJoinBssParam->opp_enabled;
- *(pu8CurrByte++) = ptstrJoinBssParam->idx;
+ *(cur_byte++) = ptstrJoinBssParam->opp_enabled;
+ *(cur_byte++) = ptstrJoinBssParam->idx;
if (ptstrJoinBssParam->opp_enabled)
- *(pu8CurrByte++) = ptstrJoinBssParam->ct_window;
+ *(cur_byte++) = ptstrJoinBssParam->ct_window;
- *(pu8CurrByte++) = ptstrJoinBssParam->cnt;
+ *(cur_byte++) = ptstrJoinBssParam->cnt;
- memcpy(pu8CurrByte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
- pu8CurrByte += sizeof(ptstrJoinBssParam->duration);
+ memcpy(cur_byte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
+ cur_byte += sizeof(ptstrJoinBssParam->duration);
- memcpy(pu8CurrByte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
- pu8CurrByte += sizeof(ptstrJoinBssParam->interval);
+ memcpy(cur_byte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
+ cur_byte += sizeof(ptstrJoinBssParam->interval);
- memcpy(pu8CurrByte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
- pu8CurrByte += sizeof(ptstrJoinBssParam->start_time);
+ memcpy(cur_byte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
+ cur_byte += sizeof(ptstrJoinBssParam->start_time);
}
- pu8CurrByte = wid_list[wid_cnt].val;
+ cur_byte = wid_list[wid_cnt].val;
wid_cnt++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
- memcpy(join_req, pu8CurrByte, join_req_size);
+ memcpy(join_req, cur_byte, join_req_size);
join_req_vif = vif;
}
@@ -1161,7 +1161,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
kfree(pstrHostIFconnectAttr->ies);
pstrHostIFconnectAttr->ies = NULL;
- kfree(pu8CurrByte);
+ kfree(cur_byte);
return result;
}
@@ -1992,7 +1992,7 @@ static void Handle_AddBeacon(struct wilc_vif *vif,
{
s32 result = 0;
struct wid wid;
- u8 *pu8CurrByte;
+ u8 *cur_byte;
wid.id = (u16)WID_ADD_BEACON;
wid.type = WID_BIN;
@@ -2001,33 +2001,33 @@ static void Handle_AddBeacon(struct wilc_vif *vif,
if (!wid.val)
goto ERRORHANDLER;
- pu8CurrByte = wid.val;
- *pu8CurrByte++ = (pstrSetBeaconParam->interval & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->interval >> 8) & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->interval >> 16) & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->interval >> 24) & 0xFF);
+ cur_byte = wid.val;
+ *cur_byte++ = (pstrSetBeaconParam->interval & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->interval >> 8) & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->interval >> 16) & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->interval >> 24) & 0xFF);
- *pu8CurrByte++ = (pstrSetBeaconParam->dtim_period & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->dtim_period >> 8) & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->dtim_period >> 16) & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->dtim_period >> 24) & 0xFF);
+ *cur_byte++ = (pstrSetBeaconParam->dtim_period & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->dtim_period >> 8) & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->dtim_period >> 16) & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->dtim_period >> 24) & 0xFF);
- *pu8CurrByte++ = (pstrSetBeaconParam->head_len & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->head_len >> 8) & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->head_len >> 16) & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->head_len >> 24) & 0xFF);
+ *cur_byte++ = (pstrSetBeaconParam->head_len & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->head_len >> 8) & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->head_len >> 16) & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->head_len >> 24) & 0xFF);
- memcpy(pu8CurrByte, pstrSetBeaconParam->head, pstrSetBeaconParam->head_len);
- pu8CurrByte += pstrSetBeaconParam->head_len;
+ memcpy(cur_byte, pstrSetBeaconParam->head, pstrSetBeaconParam->head_len);
+ cur_byte += pstrSetBeaconParam->head_len;
- *pu8CurrByte++ = (pstrSetBeaconParam->tail_len & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 8) & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
- *pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
+ *cur_byte++ = (pstrSetBeaconParam->tail_len & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->tail_len >> 8) & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
+ *cur_byte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
if (pstrSetBeaconParam->tail)
- memcpy(pu8CurrByte, pstrSetBeaconParam->tail, pstrSetBeaconParam->tail_len);
- pu8CurrByte += pstrSetBeaconParam->tail_len;
+ memcpy(cur_byte, pstrSetBeaconParam->tail, pstrSetBeaconParam->tail_len);
+ cur_byte += pstrSetBeaconParam->tail_len;
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif));
@@ -2044,7 +2044,7 @@ static void Handle_DelBeacon(struct wilc_vif *vif)
{
s32 result = 0;
struct wid wid;
- u8 *pu8CurrByte;
+ u8 *cur_byte;
wid.id = (u16)WID_DEL_BEACON;
wid.type = WID_CHAR;
@@ -2054,7 +2054,7 @@ static void Handle_DelBeacon(struct wilc_vif *vif)
if (!wid.val)
return;
- pu8CurrByte = wid.val;
+ cur_byte = wid.val;
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif));
@@ -2065,34 +2065,34 @@ static void Handle_DelBeacon(struct wilc_vif *vif)
static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer,
struct add_sta_param *pstrStationParam)
{
- u8 *pu8CurrByte;
+ u8 *cur_byte;
- pu8CurrByte = pu8Buffer;
+ cur_byte = pu8Buffer;
- memcpy(pu8CurrByte, pstrStationParam->bssid, ETH_ALEN);
- pu8CurrByte += ETH_ALEN;
+ memcpy(cur_byte, pstrStationParam->bssid, ETH_ALEN);
+ cur_byte += ETH_ALEN;
- *pu8CurrByte++ = pstrStationParam->aid & 0xFF;
- *pu8CurrByte++ = (pstrStationParam->aid >> 8) & 0xFF;
+ *cur_byte++ = pstrStationParam->aid & 0xFF;
+ *cur_byte++ = (pstrStationParam->aid >> 8) & 0xFF;
- *pu8CurrByte++ = pstrStationParam->rates_len;
+ *cur_byte++ = pstrStationParam->rates_len;
if (pstrStationParam->rates_len > 0)
- memcpy(pu8CurrByte, pstrStationParam->rates,
+ memcpy(cur_byte, pstrStationParam->rates,
pstrStationParam->rates_len);
- pu8CurrByte += pstrStationParam->rates_len;
+ cur_byte += pstrStationParam->rates_len;
- *pu8CurrByte++ = pstrStationParam->ht_supported;
- memcpy(pu8CurrByte, &pstrStationParam->ht_capa,
+ *cur_byte++ = pstrStationParam->ht_supported;
+ memcpy(cur_byte, &pstrStationParam->ht_capa,
sizeof(struct ieee80211_ht_cap));
- pu8CurrByte += sizeof(struct ieee80211_ht_cap);
+ cur_byte += sizeof(struct ieee80211_ht_cap);
- *pu8CurrByte++ = pstrStationParam->flags_mask & 0xFF;
- *pu8CurrByte++ = (pstrStationParam->flags_mask >> 8) & 0xFF;
+ *cur_byte++ = pstrStationParam->flags_mask & 0xFF;
+ *cur_byte++ = (pstrStationParam->flags_mask >> 8) & 0xFF;
- *pu8CurrByte++ = pstrStationParam->flags_set & 0xFF;
- *pu8CurrByte++ = (pstrStationParam->flags_set >> 8) & 0xFF;
+ *cur_byte++ = pstrStationParam->flags_set & 0xFF;
+ *cur_byte++ = (pstrStationParam->flags_set >> 8) & 0xFF;
- return pu8CurrByte - pu8Buffer;
+ return cur_byte - pu8Buffer;
}
static void Handle_AddStation(struct wilc_vif *vif,
@@ -2100,7 +2100,7 @@ static void Handle_AddStation(struct wilc_vif *vif,
{
s32 result = 0;
struct wid wid;
- u8 *pu8CurrByte;
+ u8 *cur_byte;
wid.id = (u16)WID_ADD_STA;
wid.type = WID_BIN;
@@ -2110,8 +2110,8 @@ static void Handle_AddStation(struct wilc_vif *vif,
if (!wid.val)
goto ERRORHANDLER;
- pu8CurrByte = wid.val;
- pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
+ cur_byte = wid.val;
+ cur_byte += WILC_HostIf_PackStaParam(cur_byte, pstrStationParam);
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif));
@@ -2169,7 +2169,7 @@ static void Handle_DelStation(struct wilc_vif *vif,
{
s32 result = 0;
struct wid wid;
- u8 *pu8CurrByte;
+ u8 *cur_byte;
wid.id = (u16)WID_REMOVE_STA;
wid.type = WID_BIN;
@@ -2179,9 +2179,9 @@ static void Handle_DelStation(struct wilc_vif *vif,
if (!wid.val)
goto ERRORHANDLER;
- pu8CurrByte = wid.val;
+ cur_byte = wid.val;
- ether_addr_copy(pu8CurrByte, pstrDelStaParam->mac_addr);
+ ether_addr_copy(cur_byte, pstrDelStaParam->mac_addr);
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif));
@@ -2197,7 +2197,7 @@ static void Handle_EditStation(struct wilc_vif *vif,
{
s32 result = 0;
struct wid wid;
- u8 *pu8CurrByte;
+ u8 *cur_byte;
wid.id = (u16)WID_EDIT_STA;
wid.type = WID_BIN;
@@ -2207,8 +2207,8 @@ static void Handle_EditStation(struct wilc_vif *vif,
if (!wid.val)
goto ERRORHANDLER;
- pu8CurrByte = wid.val;
- pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
+ cur_byte = wid.val;
+ cur_byte += WILC_HostIf_PackStaParam(cur_byte, pstrStationParam);
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif));
@@ -2294,7 +2294,7 @@ static int Handle_RegisterFrame(struct wilc_vif *vif,
{
s32 result = 0;
struct wid wid;
- u8 *pu8CurrByte;
+ u8 *cur_byte;
wid.id = (u16)WID_REGISTER_FRAME;
wid.type = WID_STR;
@@ -2302,11 +2302,11 @@ static int Handle_RegisterFrame(struct wilc_vif *vif,
if (!wid.val)
return -ENOMEM;
- pu8CurrByte = wid.val;
+ cur_byte = wid.val;
- *pu8CurrByte++ = pstrHostIfRegisterFrame->reg;
- *pu8CurrByte++ = pstrHostIfRegisterFrame->reg_id;
- memcpy(pu8CurrByte, &pstrHostIfRegisterFrame->frame_type, sizeof(u16));
+ *cur_byte++ = pstrHostIfRegisterFrame->reg;
+ *cur_byte++ = pstrHostIfRegisterFrame->reg_id;
+ memcpy(cur_byte, &pstrHostIfRegisterFrame->frame_type, sizeof(u16));
wid.size = sizeof(u16) + 2;
@@ -2410,7 +2410,7 @@ static void Handle_SetMulticastFilter(struct wilc_vif *vif,
{
s32 result = 0;
struct wid wid;
- u8 *pu8CurrByte;
+ u8 *cur_byte;
wid.id = (u16)WID_SETUP_MULTICAST_FILTER;
wid.type = WID_BIN;
@@ -2419,19 +2419,19 @@ static void Handle_SetMulticastFilter(struct wilc_vif *vif,
if (!wid.val)
goto ERRORHANDLER;
- pu8CurrByte = wid.val;
- *pu8CurrByte++ = (strHostIfSetMulti->enabled & 0xFF);
- *pu8CurrByte++ = 0;
- *pu8CurrByte++ = 0;
- *pu8CurrByte++ = 0;
+ cur_byte = wid.val;
+ *cur_byte++ = (strHostIfSetMulti->enabled & 0xFF);
+ *cur_byte++ = 0;
+ *cur_byte++ = 0;
+ *cur_byte++ = 0;
- *pu8CurrByte++ = (strHostIfSetMulti->cnt & 0xFF);
- *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF);
- *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 16) & 0xFF);
- *pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 24) & 0xFF);
+ *cur_byte++ = (strHostIfSetMulti->cnt & 0xFF);
+ *cur_byte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF);
+ *cur_byte++ = ((strHostIfSetMulti->cnt >> 16) & 0xFF);
+ *cur_byte++ = ((strHostIfSetMulti->cnt >> 24) & 0xFF);
if ((strHostIfSetMulti->cnt) > 0)
- memcpy(pu8CurrByte, wilc_multicast_mac_addr_list,
+ memcpy(cur_byte, wilc_multicast_mac_addr_list,
((strHostIfSetMulti->cnt) * ETH_ALEN));
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
--
2.7.4
On Fri, 19 Jan 2018 16:50:29 +0530
Claudiu Beznea - M18063 <[email protected]> wrote:
> On 18.01.2018 15:17, Ajay Singh wrote:
> > fix "Avoid camelCase" issue found by checkpatch.pl script.
> >
> > Signed-off-by: Ajay Singh <[email protected]>
> > ---
> > drivers/staging/wilc1000/host_interface.c | 104 ++++++++++++++----------------
> > 1 file changed, 49 insertions(+), 55 deletions(-)
> >
> > diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> > index e3931bc..4ddd1a8 100644
> > --- a/drivers/staging/wilc1000/host_interface.c
> > +++ b/drivers/staging/wilc1000/host_interface.c
> > @@ -903,7 +903,7 @@ static s32 Handle_ScanDone(struct wilc_vif *vif,
> >
> > u8 wilc_connected_ssid[6] = {0};
> > static s32 Handle_Connect(struct wilc_vif *vif,
> > - struct connect_attr *pstrHostIFconnectAttr)
> > + struct connect_attr *attr)
> > {
> > s32 result = 0;
> > struct wid wid_list[8];
> > @@ -912,45 +912,41 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > struct join_bss_param *ptstrJoinBssParam;
> > struct host_if_drv *hif_drv = vif->hif_drv;
> >
> > - if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> > + if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> > result = 0;
> > netdev_err(vif->ndev, "Discard connect request\n");
> > return result;
> > }
> >
> > - ptstrJoinBssParam = pstrHostIFconnectAttr->params;
> > + ptstrJoinBssParam = attr->params;
> > if (!ptstrJoinBssParam) {
> > netdev_err(vif->ndev, "Required BSSID not found\n");
> > result = -ENOENT;
> > goto ERRORHANDLER;
> > }
> >
> > - if (pstrHostIFconnectAttr->bssid) {
> > + if (attr->bssid) {
> > hif_drv->usr_conn_req.bssid = kmalloc(6, GFP_KERNEL);
> > - memcpy(hif_drv->usr_conn_req.bssid, pstrHostIFconnectAttr->bssid, 6);
> > + memcpy(hif_drv->usr_conn_req.bssid, attr->bssid, 6);
> > }
> >
> > - hif_drv->usr_conn_req.ssid_len = pstrHostIFconnectAttr->ssid_len;
> > - if (pstrHostIFconnectAttr->ssid) {
> > - hif_drv->usr_conn_req.ssid = kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
> > - memcpy(hif_drv->usr_conn_req.ssid,
> > - pstrHostIFconnectAttr->ssid,
> > - pstrHostIFconnectAttr->ssid_len);
> > - hif_drv->usr_conn_req.ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
> > + hif_drv->usr_conn_req.ssid_len = attr->ssid_len;
> > + if (attr->ssid) {
> > + hif_drv->usr_conn_req.ssid = kmalloc(attr->ssid_len + 1, GFP_KERNEL);
> > + memcpy(hif_drv->usr_conn_req.ssid, attr->ssid, attr->ssid_len);
> > + hif_drv->usr_conn_req.ssid[attr->ssid_len] = '\0';
> > }
> >
> > - hif_drv->usr_conn_req.ies_len = pstrHostIFconnectAttr->ies_len;
> > - if (pstrHostIFconnectAttr->ies) {
> > - hif_drv->usr_conn_req.ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
> > - memcpy(hif_drv->usr_conn_req.ies,
> > - pstrHostIFconnectAttr->ies,
> > - pstrHostIFconnectAttr->ies_len);
> > + hif_drv->usr_conn_req.ies_len = attr->ies_len;
> > + if (attr->ies) {
> > + hif_drv->usr_conn_req.ies = kmalloc(attr->ies_len, GFP_KERNEL);
> > + memcpy(hif_drv->usr_conn_req.ies, attr->ies, attr->ies_len);
> > }
> >
> > - hif_drv->usr_conn_req.security = pstrHostIFconnectAttr->security;
> > - hif_drv->usr_conn_req.auth_type = pstrHostIFconnectAttr->auth_type;
> > - hif_drv->usr_conn_req.conn_result = pstrHostIFconnectAttr->result;
> > - hif_drv->usr_conn_req.arg = pstrHostIFconnectAttr->arg;
> > + hif_drv->usr_conn_req.security = attr->security;
> > + hif_drv->usr_conn_req.auth_type = attr->auth_type;
> > + hif_drv->usr_conn_req.conn_result = attr->result;
> > + hif_drv->usr_conn_req.arg = attr->arg;
> >
> > wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
> > wid_list[wid_cnt].type = WID_INT;
> > @@ -977,7 +973,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > wid_list[wid_cnt].size = hif_drv->usr_conn_req.ies_len;
> > wid_cnt++;
> >
> > - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
> > + if (memcmp("DIRECT-", attr->ssid, 7)) {
> > info_element_size = hif_drv->usr_conn_req.ies_len;
> > info_element = kmalloc(info_element_size, GFP_KERNEL);
> > memcpy(info_element, hif_drv->usr_conn_req.ies,
> > @@ -990,7 +986,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.security;
> > wid_cnt++;
> >
> > - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
> > + if (memcmp("DIRECT-", attr->ssid, 7))
> > mode_11i = hif_drv->usr_conn_req.security;
> >
> > wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
> > @@ -999,7 +995,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
> > wid_cnt++;
> >
> > - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
> > + if (memcmp("DIRECT-", attr->ssid, 7))
> > auth_type = (u8)hif_drv->usr_conn_req.auth_type;
> >
> > wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
> > @@ -1007,7 +1003,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > wid_list[wid_cnt].size = 112;
> > wid_list[wid_cnt].val = kmalloc(wid_list[wid_cnt].size, GFP_KERNEL);
> >
> > - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
> > + if (memcmp("DIRECT-", attr->ssid, 7)) {
> > join_req_size = wid_list[wid_cnt].size;
> > join_req = kmalloc(join_req_size, GFP_KERNEL);
> > }
> > @@ -1018,15 +1014,15 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> >
> > cur_byte = wid_list[wid_cnt].val;
> >
> > - if (pstrHostIFconnectAttr->ssid) {
> > - memcpy(cur_byte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
> > - cur_byte[pstrHostIFconnectAttr->ssid_len] = '\0';
> > + if (attr->ssid) {
> > + memcpy(cur_byte, attr->ssid, attr->ssid_len);
> > + cur_byte[attr->ssid_len] = '\0';
> > }
> > cur_byte += MAX_SSID_LEN;
> > *(cur_byte++) = INFRASTRUCTURE;
> >
> > - if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
> > - *(cur_byte++) = pstrHostIFconnectAttr->ch;
> > + if (attr->ch >= 1 && attr->ch <= 14) {
> > + *(cur_byte++) = attr->ch;
> > } else {
> > netdev_err(vif->ndev, "Channel out of range\n");
> > *(cur_byte++) = 0xFF;
> > @@ -1034,12 +1030,12 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > *(cur_byte++) = (ptstrJoinBssParam->cap_info) & 0xFF;
> > *(cur_byte++) = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
> >
> > - if (pstrHostIFconnectAttr->bssid)
> > - memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
> > + if (attr->bssid)
> > + memcpy(cur_byte, attr->bssid, 6);
> > cur_byte += 6;
> >
> > - if (pstrHostIFconnectAttr->bssid)
> > - memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
> > + if (attr->bssid)
> > + memcpy(cur_byte, attr->bssid, 6);
> > cur_byte += 6;
> >
> > *(cur_byte++) = (ptstrJoinBssParam->beacon_period) & 0xFF;
> > @@ -1098,14 +1094,14 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > cur_byte = wid_list[wid_cnt].val;
> > wid_cnt++;
> >
> > - if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
> > + if (memcmp("DIRECT-", attr->ssid, 7)) {
> > memcpy(join_req, cur_byte, join_req_size);
> > join_req_vif = vif;
> > }
> >
> > - if (pstrHostIFconnectAttr->bssid)
> > + if (attr->bssid)
> > memcpy(wilc_connected_ssid,
> > - pstrHostIFconnectAttr->bssid, ETH_ALEN);
> > + attr->bssid, ETH_ALEN);
> You can put everything on one line.
Will submit the updated patch to include this change.
>
> >
> > result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
> > wid_cnt,
> > @@ -1126,23 +1122,21 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> >
> > memset(&strConnectInfo, 0, sizeof(struct connect_info));
> >
> > - if (pstrHostIFconnectAttr->result) {
> > - if (pstrHostIFconnectAttr->bssid)
> > - memcpy(strConnectInfo.bssid, pstrHostIFconnectAttr->bssid, 6);
> > + if (attr->result) {
> > + if (attr->bssid)
> > + memcpy(strConnectInfo.bssid, attr->bssid, 6);
> >
> > - if (pstrHostIFconnectAttr->ies) {
> > - strConnectInfo.req_ies_len = pstrHostIFconnectAttr->ies_len;
> > - strConnectInfo.req_ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
> > - memcpy(strConnectInfo.req_ies,
> > - pstrHostIFconnectAttr->ies,
> > - pstrHostIFconnectAttr->ies_len);
> > + if (attr->ies) {
> > + strConnectInfo.req_ies_len = attr->ies_len;
> > + strConnectInfo.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
> > + memcpy(strConnectInfo.req_ies, attr->ies, attr->ies_len);
> > }
> >
> > - pstrHostIFconnectAttr->result(CONN_DISCONN_EVENT_CONN_RESP,
> > + attr->result(CONN_DISCONN_EVENT_CONN_RESP,
> > &strConnectInfo,
> > MAC_DISCONNECTED,
> > NULL,
> > - pstrHostIFconnectAttr->arg);
> > + attr->arg);
> > hif_drv->hif_state = HOST_IF_IDLE;
> > kfree(strConnectInfo.req_ies);
> > strConnectInfo.req_ies = NULL;
> > @@ -1152,14 +1146,14 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> > }
> > }
> >
> > - kfree(pstrHostIFconnectAttr->bssid);
> > - pstrHostIFconnectAttr->bssid = NULL;
> > + kfree(attr->bssid);
> > + attr->bssid = NULL;
> >
> > - kfree(pstrHostIFconnectAttr->ssid);
> > - pstrHostIFconnectAttr->ssid = NULL;
> > + kfree(attr->ssid);
> > + attr->ssid = NULL;
> >
> > - kfree(pstrHostIFconnectAttr->ies);
> > - pstrHostIFconnectAttr->ies = NULL;
> > + kfree(attr->ies);
> > + attr->ies = NULL;
> >
> > kfree(cur_byte);
> > return result;
> >
On 18.01.2018 15:17, Ajay Singh wrote:
> fix "Avoid camelCase" issue reported by checkpatch.pl script.
>
> Signed-off-by: Ajay Singh <[email protected]>
> ---
> drivers/staging/wilc1000/host_interface.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 9f6365a..1ac079a 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -2123,34 +2123,34 @@ static void Handle_AddStation(struct wilc_vif *vif,
> kfree(wid.val);
> }
>
> -static void Handle_DelAllSta(struct wilc_vif *vif,
> - struct del_all_sta *pstrDelAllStaParam)
> +static void handle_del_all_sta(struct wilc_vif *vif,
> + struct del_all_sta *param)
> {
> s32 result = 0;
> struct wid wid;
> - u8 *pu8CurrByte;
> + u8 *curr_byte;
> u8 i;
> - u8 au8Zero_Buff[6] = {0};
> + u8 zero_buff[6] = {0};
>
> wid.id = (u16)WID_DEL_ALL_STA;
> wid.type = WID_STR;
> - wid.size = (pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1;
> + wid.size = (param->assoc_sta * ETH_ALEN) + 1;
>
> - wid.val = kmalloc((pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
> + wid.val = kmalloc((param->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
> if (!wid.val)
> goto ERRORHANDLER;
>
> - pu8CurrByte = wid.val;
> + curr_byte = wid.val;
>
> - *(pu8CurrByte++) = pstrDelAllStaParam->assoc_sta;
> + *(curr_byte++) = param->assoc_sta;
>
> for (i = 0; i < MAX_NUM_STA; i++) {
> - if (memcmp(pstrDelAllStaParam->del_all_sta[i], au8Zero_Buff, ETH_ALEN))
> - memcpy(pu8CurrByte, pstrDelAllStaParam->del_all_sta[i], ETH_ALEN);> + if (memcmp(param->del_all_sta[i], zero_buff, ETH_ALEN))
For future, you could use is_zero_ether_addr() if you ensure
pstrDelAllStaParam->del_all_sta[i] is alligned to u16.
> + memcpy(curr_byte, param->del_all_sta[i], ETH_ALEN);
> else
> continue;
>
> - pu8CurrByte += ETH_ALEN;
> + curr_byte += ETH_ALEN;
> }
>
> result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
> @@ -2626,7 +2626,7 @@ static void host_if_work(struct work_struct *work)
> break;
>
> case HOST_IF_MSG_DEL_ALL_STA:
> - Handle_DelAllSta(msg->vif, &msg->body.del_all_sta_info);
> + handle_del_all_sta(msg->vif, &msg->body.del_all_sta_info);
> break;
>
> case HOST_IF_MSG_SET_TX_POWER:
>
fix "Avoid camelCase" issue reported by checkpatch.pl script.
In this patch rename "strConnectInfo" variable to resolve
issue reported by checkpatch.pl script.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 74 +++++++++++++++----------------
1 file changed, 37 insertions(+), 37 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index cc27b5a..d017c86 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1116,30 +1116,30 @@ static s32 Handle_Connect(struct wilc_vif *vif,
ERRORHANDLER:
if (result) {
- struct connect_info strConnectInfo;
+ struct connect_info conn_info;
del_timer(&hif_drv->connect_timer);
- memset(&strConnectInfo, 0, sizeof(struct connect_info));
+ memset(&conn_info, 0, sizeof(struct connect_info));
if (attr->result) {
if (attr->bssid)
- memcpy(strConnectInfo.bssid, attr->bssid, 6);
+ memcpy(conn_info.bssid, attr->bssid, 6);
if (attr->ies) {
- strConnectInfo.req_ies_len = attr->ies_len;
- strConnectInfo.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
- memcpy(strConnectInfo.req_ies, attr->ies, attr->ies_len);
+ conn_info.req_ies_len = attr->ies_len;
+ conn_info.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
+ memcpy(conn_info.req_ies, attr->ies, attr->ies_len);
}
attr->result(CONN_DISCONN_EVENT_CONN_RESP,
- &strConnectInfo,
+ &conn_info,
MAC_DISCONNECTED,
NULL,
attr->arg);
hif_drv->hif_state = HOST_IF_IDLE;
- kfree(strConnectInfo.req_ies);
- strConnectInfo.req_ies = NULL;
+ kfree(conn_info.req_ies);
+ conn_info.req_ies = NULL;
} else {
netdev_err(vif->ndev, "Connect callback is NULL\n");
@@ -1162,7 +1162,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
{
s32 result = 0;
- struct connect_info strConnectInfo;
+ struct connect_info conn_info;
struct wid wid;
u16 u16DummyReasonCode = 0;
struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1176,30 +1176,30 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
scan_while_connected = false;
- memset(&strConnectInfo, 0, sizeof(struct connect_info));
+ memset(&conn_info, 0, sizeof(struct connect_info));
if (hif_drv->usr_conn_req.conn_result) {
if (hif_drv->usr_conn_req.bssid) {
- memcpy(strConnectInfo.bssid,
+ memcpy(conn_info.bssid,
hif_drv->usr_conn_req.bssid, 6);
}
if (hif_drv->usr_conn_req.ies) {
- strConnectInfo.req_ies_len = hif_drv->usr_conn_req.ies_len;
- strConnectInfo.req_ies = kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
- memcpy(strConnectInfo.req_ies,
+ conn_info.req_ies_len = hif_drv->usr_conn_req.ies_len;
+ conn_info.req_ies = kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
+ memcpy(conn_info.req_ies,
hif_drv->usr_conn_req.ies,
hif_drv->usr_conn_req.ies_len);
}
hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_CONN_RESP,
- &strConnectInfo,
+ &conn_info,
MAC_DISCONNECTED,
NULL,
hif_drv->usr_conn_req.arg);
- kfree(strConnectInfo.req_ies);
- strConnectInfo.req_ies = NULL;
+ kfree(conn_info.req_ies);
+ conn_info.req_ies = NULL;
} else {
netdev_err(vif->ndev, "Connect callback is NULL\n");
}
@@ -1324,7 +1324,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
u8 u8MacStatus;
u8 u8MacStatusReasonCode;
u8 u8MacStatusAdditionalInfo;
- struct connect_info strConnectInfo;
+ struct connect_info conn_info;
struct disconnect_info strDisconnectNotifInfo;
s32 s32Err = 0;
struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1361,7 +1361,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
u32 u32RcvdAssocRespInfoLen = 0;
struct connect_resp_info *pstrConnectRespInfo = NULL;
- memset(&strConnectInfo, 0, sizeof(struct connect_info));
+ memset(&conn_info, 0, sizeof(struct connect_info));
if (u8MacStatus == MAC_CONNECTED) {
memset(rcv_assoc_resp, 0, MAX_ASSOC_RESP_FRAME_SIZE);
@@ -1377,12 +1377,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
if (s32Err) {
netdev_err(vif->ndev, "wilc_parse_assoc_resp_info() returned error %d\n", s32Err);
} else {
- strConnectInfo.status = pstrConnectRespInfo->status;
+ conn_info.status = pstrConnectRespInfo->status;
- if (strConnectInfo.status == SUCCESSFUL_STATUSCODE && pstrConnectRespInfo->ies) {
- strConnectInfo.resp_ies_len = pstrConnectRespInfo->ies_len;
- strConnectInfo.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
- memcpy(strConnectInfo.resp_ies, pstrConnectRespInfo->ies,
+ if (conn_info.status == SUCCESSFUL_STATUSCODE && pstrConnectRespInfo->ies) {
+ conn_info.resp_ies_len = pstrConnectRespInfo->ies_len;
+ conn_info.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
+ memcpy(conn_info.resp_ies, pstrConnectRespInfo->ies,
pstrConnectRespInfo->ies_len);
}
@@ -1395,7 +1395,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
}
if (u8MacStatus == MAC_CONNECTED &&
- strConnectInfo.status != SUCCESSFUL_STATUSCODE) {
+ conn_info.status != SUCCESSFUL_STATUSCODE) {
netdev_err(vif->ndev, "Received MAC status is MAC_CONNECTED while the received status code in Asoc Resp is not SUCCESSFUL_STATUSCODE\n");
eth_zero_addr(wilc_connected_ssid);
} else if (u8MacStatus == MAC_DISCONNECTED) {
@@ -1404,32 +1404,32 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
}
if (hif_drv->usr_conn_req.bssid) {
- memcpy(strConnectInfo.bssid, hif_drv->usr_conn_req.bssid, 6);
+ memcpy(conn_info.bssid, hif_drv->usr_conn_req.bssid, 6);
if (u8MacStatus == MAC_CONNECTED &&
- strConnectInfo.status == SUCCESSFUL_STATUSCODE) {
+ conn_info.status == SUCCESSFUL_STATUSCODE) {
memcpy(hif_drv->assoc_bssid,
hif_drv->usr_conn_req.bssid, ETH_ALEN);
}
}
if (hif_drv->usr_conn_req.ies) {
- strConnectInfo.req_ies_len = hif_drv->usr_conn_req.ies_len;
- strConnectInfo.req_ies = kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
- memcpy(strConnectInfo.req_ies,
+ conn_info.req_ies_len = hif_drv->usr_conn_req.ies_len;
+ conn_info.req_ies = kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
+ memcpy(conn_info.req_ies,
hif_drv->usr_conn_req.ies,
hif_drv->usr_conn_req.ies_len);
}
del_timer(&hif_drv->connect_timer);
hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_CONN_RESP,
- &strConnectInfo,
+ &conn_info,
u8MacStatus,
NULL,
hif_drv->usr_conn_req.arg);
if (u8MacStatus == MAC_CONNECTED &&
- strConnectInfo.status == SUCCESSFUL_STATUSCODE) {
+ conn_info.status == SUCCESSFUL_STATUSCODE) {
wilc_set_power_mgmt(vif, 0, 0);
hif_drv->hif_state = HOST_IF_CONNECTED;
@@ -1442,11 +1442,11 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
scan_while_connected = false;
}
- kfree(strConnectInfo.resp_ies);
- strConnectInfo.resp_ies = NULL;
+ kfree(conn_info.resp_ies);
+ conn_info.resp_ies = NULL;
- kfree(strConnectInfo.req_ies);
- strConnectInfo.req_ies = NULL;
+ kfree(conn_info.req_ies);
+ conn_info.req_ies = NULL;
hif_drv->usr_conn_req.ssid_len = 0;
kfree(hif_drv->usr_conn_req.ssid);
hif_drv->usr_conn_req.ssid = NULL;
--
2.7.4
fix "Avoid camelcase" issue found by checkpatch.pl
script.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5ea7c4b..15fca67 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -902,7 +902,7 @@ static s32 handle_scan_done(struct wilc_vif *vif,
}
u8 wilc_connected_ssid[6] = {0};
-static s32 Handle_Connect(struct wilc_vif *vif,
+static s32 handle_connect(struct wilc_vif *vif,
struct connect_attr *attr)
{
s32 result = 0;
@@ -2492,7 +2492,7 @@ static void host_if_work(struct work_struct *work)
break;
case HOST_IF_MSG_CONNECT:
- Handle_Connect(msg->vif, &msg->body.con_info);
+ handle_connect(msg->vif, &msg->body.con_info);
break;
case HOST_IF_MSG_RCVD_NTWRK_INFO:
--
2.7.4
All series Reviewed-by: Claudiu Beznea <[email protected]>
with the inline comments.
Ajay, one general remark, please use Capital letters when beginning new
sentences (I'm talking about commit descriptions).
Thanks,
Claudiu Beznea
On 18.01.2018 15:16, Ajay Singh wrote:
> This patch series contains changes to fix issues reported by checkpatch.pl script.
>
>
> Ajay Singh (14):
> staging: wilc1000: remove unnecessary use of parentheses
> staging: wilc1000: removed unnecessary defined enums typedef
> staging: wilc1000: fix alignments to match open parenthesis
> staging: wilc1000: rename host_int_ParseJoinBssParam() and it's
> variable using camelCase
> staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its
> variable
> staging: wilc1000: rename strWIDList variable to wid_list to avoid
> camelCase
> staging: wilc1000: rename u32WidsCount variable to avoid camelCase
> staging: wilc1000: rename pu8CurrByte variable to avoid camelCase
> staging: wilc1000: rename pstrHostIFconnectAttr argument to avoid
> camelCase
> staging: wilc1000: rename ptstrJoinBssParam variable to avoid
> camelCase
> staging: wilc1000: rename strConnectInfo variable to avoid camelCase
> staging: wilc1000: rename Handle_ScanDone() to avoid camelCase
> staging: wilc1000: rename Handle_Connect() to avoid camelCase
> staging: wilc1000: rename Handle_ConnectTimeout() and Handle_Key()
>
> drivers/staging/wilc1000/coreconfigurator.c | 2 +-
> drivers/staging/wilc1000/host_interface.c | 936 +++++++++++-----------
> drivers/staging/wilc1000/linux_wlan.c | 10 +-
> drivers/staging/wilc1000/wilc_sdio.c | 4 +-
> drivers/staging/wilc1000/wilc_spi.c | 20 +-
> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 64 +-
> drivers/staging/wilc1000/wilc_wlan.c | 2 +-
> drivers/staging/wilc1000/wilc_wlan_cfg.c | 6 +-
> drivers/staging/wilc1000/wilc_wlan_if.h | 72 +-
> 9 files changed, 555 insertions(+), 561 deletions(-)
>
fix "Avoid camelCase" issue reported by checkpatch.pl script.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 9f6365a..1ac079a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2123,34 +2123,34 @@ static void Handle_AddStation(struct wilc_vif *vif,
kfree(wid.val);
}
-static void Handle_DelAllSta(struct wilc_vif *vif,
- struct del_all_sta *pstrDelAllStaParam)
+static void handle_del_all_sta(struct wilc_vif *vif,
+ struct del_all_sta *param)
{
s32 result = 0;
struct wid wid;
- u8 *pu8CurrByte;
+ u8 *curr_byte;
u8 i;
- u8 au8Zero_Buff[6] = {0};
+ u8 zero_buff[6] = {0};
wid.id = (u16)WID_DEL_ALL_STA;
wid.type = WID_STR;
- wid.size = (pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1;
+ wid.size = (param->assoc_sta * ETH_ALEN) + 1;
- wid.val = kmalloc((pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
+ wid.val = kmalloc((param->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
if (!wid.val)
goto ERRORHANDLER;
- pu8CurrByte = wid.val;
+ curr_byte = wid.val;
- *(pu8CurrByte++) = pstrDelAllStaParam->assoc_sta;
+ *(curr_byte++) = param->assoc_sta;
for (i = 0; i < MAX_NUM_STA; i++) {
- if (memcmp(pstrDelAllStaParam->del_all_sta[i], au8Zero_Buff, ETH_ALEN))
- memcpy(pu8CurrByte, pstrDelAllStaParam->del_all_sta[i], ETH_ALEN);
+ if (memcmp(param->del_all_sta[i], zero_buff, ETH_ALEN))
+ memcpy(curr_byte, param->del_all_sta[i], ETH_ALEN);
else
continue;
- pu8CurrByte += ETH_ALEN;
+ curr_byte += ETH_ALEN;
}
result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
@@ -2626,7 +2626,7 @@ static void host_if_work(struct work_struct *work)
break;
case HOST_IF_MSG_DEL_ALL_STA:
- Handle_DelAllSta(msg->vif, &msg->body.del_all_sta_info);
+ handle_del_all_sta(msg->vif, &msg->body.del_all_sta_info);
break;
case HOST_IF_MSG_SET_TX_POWER:
--
2.7.4
fix "Avoid camelCase" issue reported by checkpatch.pl
script.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index d017c86..5ea7c4b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -267,7 +267,7 @@ static struct wilc_vif *join_req_vif;
static void *host_parse_join_bss_param(struct network_info *info);
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_scan_done(struct wilc_vif *vif, enum scan_event enuEvent);
static void host_if_work(struct work_struct *work);
/*!
@@ -847,7 +847,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
ERRORHANDLER:
if (result) {
del_timer(&hif_drv->scan_timer);
- Handle_ScanDone(vif, SCAN_EVENT_ABORTED);
+ handle_scan_done(vif, SCAN_EVENT_ABORTED);
}
kfree(scan_info->ch_freq_list);
@@ -863,8 +863,8 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
return result;
}
-static s32 Handle_ScanDone(struct wilc_vif *vif,
- enum scan_event enuEvent)
+static s32 handle_scan_done(struct wilc_vif *vif,
+ enum scan_event enuEvent)
{
s32 result = 0;
u8 u8abort_running_scan;
@@ -1461,7 +1461,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
if (hif_drv->usr_scan_req.scan_result) {
del_timer(&hif_drv->scan_timer);
- Handle_ScanDone(vif, SCAN_EVENT_ABORTED);
+ handle_scan_done(vif, SCAN_EVENT_ABORTED);
}
strDisconnectNotifInfo.reason = 0;
@@ -1509,7 +1509,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
(hif_drv->usr_scan_req.scan_result)) {
del_timer(&hif_drv->scan_timer);
if (hif_drv->usr_scan_req.scan_result)
- Handle_ScanDone(vif, SCAN_EVENT_ABORTED);
+ handle_scan_done(vif, SCAN_EVENT_ABORTED);
}
}
@@ -2526,7 +2526,7 @@ static void host_if_work(struct work_struct *work)
if (!wilc_wlan_get_num_conn_ifcs(wilc))
wilc_chip_sleep_manually(wilc);
- Handle_ScanDone(msg->vif, SCAN_EVENT_DONE);
+ handle_scan_done(msg->vif, SCAN_EVENT_DONE);
if (msg->vif->hif_drv->remain_on_ch_pending)
Handle_RemainOnChan(msg->vif,
@@ -2568,7 +2568,7 @@ static void host_if_work(struct work_struct *work)
break;
case HOST_IF_MSG_SCAN_TIMER_FIRED:
- Handle_ScanDone(msg->vif, SCAN_EVENT_ABORTED);
+ handle_scan_done(msg->vif, SCAN_EVENT_ABORTED);
break;
case HOST_IF_MSG_CONNECT_TIMER_FIRED:
--
2.7.4
On 19.01.2018 14:44, Dan Carpenter wrote:
> On Fri, Jan 19, 2018 at 01:20:00PM +0200, Claudiu Beznea wrote:
>> It is hard to review this. Anyway, Reviewed-by: Claudiu Beznea <[email protected]>
>>
>
> I have a script I use. It's sort of hacky, but it's a time saver. I've
> attached it.
>
> To review this one, I do `cat <email.txt> | rename_rev.pl -a`
Good do have it!
Thanks,
Claudiu Beznea
>
> regards,
> dan carpenter
>
fix "Avoid CamelCase:" issue reported by checkpatch.pl script
Rename host_int_ParseJoinBssParam() & its variables name using
camelCase.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 230 +++++++++++++++---------------
1 file changed, 115 insertions(+), 115 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 358354b..9f6365a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -265,7 +265,7 @@ static struct wilc_vif *join_req_vif;
#define FLUSHED_JOIN_REQ 1
#define FLUSHED_BYTE_POS 79
-static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo);
+static void *host_parse_join_bss_param(struct network_info *info);
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 void host_if_work(struct work_struct *work);
@@ -1288,7 +1288,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
hif_drv->usr_scan_req.rcvd_ch_cnt++;
pstrNetworkInfo->new_network = true;
- pJoinParams = host_int_ParseJoinBssParam(pstrNetworkInfo);
+ pJoinParams = host_parse_join_bss_param(pstrNetworkInfo);
hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
hif_drv->usr_scan_req.arg,
@@ -3870,152 +3870,152 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
return result;
}
-static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
+static void *host_parse_join_bss_param(struct network_info *info)
{
- struct join_bss_param *pNewJoinBssParam = NULL;
- u8 *pu8IEs;
- u16 u16IEsLen;
+ struct join_bss_param *param = NULL;
+ u8 *ies;
+ u16 ies_len;
u16 index = 0;
- u8 suppRatesNo = 0;
- u8 extSuppRatesNo;
- u16 jumpOffset;
- u8 pcipherCount;
- u8 authCount;
- u8 pcipherTotalCount = 0;
- u8 authTotalCount = 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;
- pu8IEs = ptstrNetworkInfo->ies;
- u16IEsLen = ptstrNetworkInfo->ies_len;
-
- pNewJoinBssParam = kzalloc(sizeof(*pNewJoinBssParam), GFP_KERNEL);
- if (pNewJoinBssParam) {
- pNewJoinBssParam->dtim_period = ptstrNetworkInfo->dtim_period;
- pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period;
- pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
- memcpy(pNewJoinBssParam->bssid, ptstrNetworkInfo->bssid, 6);
- memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid,
- ptstrNetworkInfo->ssid_len + 1);
- pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len;
- memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3);
- memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3);
-
- while (index < u16IEsLen) {
- if (pu8IEs[index] == SUPP_RATES_IE) {
- suppRatesNo = pu8IEs[index + 1];
- pNewJoinBssParam->supp_rates[0] = suppRatesNo;
+ ies = info->ies;
+ ies_len = info->ies_len;
+
+ param = kzalloc(sizeof(*param), GFP_KERNEL);
+ if (param) {
+ 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;
index += 2;
- for (i = 0; i < suppRatesNo; i++)
- pNewJoinBssParam->supp_rates[i + 1] = pu8IEs[index + i];
+ for (i = 0; i < rates_no; i++)
+ param->supp_rates[i + 1] = ies[index + i];
- index += suppRatesNo;
- } else if (pu8IEs[index] == EXT_SUPP_RATES_IE) {
- extSuppRatesNo = pu8IEs[index + 1];
- if (extSuppRatesNo > (MAX_RATES_SUPPORTED - suppRatesNo))
- pNewJoinBssParam->supp_rates[0] = MAX_RATES_SUPPORTED;
+ index += rates_no;
+ } else if (ies[index] == EXT_SUPP_RATES_IE) {
+ ext_rates_no = ies[index + 1];
+ if (ext_rates_no > (MAX_RATES_SUPPORTED - rates_no))
+ param->supp_rates[0] = MAX_RATES_SUPPORTED;
else
- pNewJoinBssParam->supp_rates[0] += extSuppRatesNo;
+ param->supp_rates[0] += ext_rates_no;
index += 2;
- for (i = 0; i < (pNewJoinBssParam->supp_rates[0] - suppRatesNo); i++)
- pNewJoinBssParam->supp_rates[suppRatesNo + i + 1] = pu8IEs[index + i];
-
- index += extSuppRatesNo;
- } else if (pu8IEs[index] == HT_CAPABILITY_IE) {
- pNewJoinBssParam->ht_capable = true;
- index += pu8IEs[index + 1] + 2;
- } else if ((pu8IEs[index] == WMM_IE) &&
- (pu8IEs[index + 2] == 0x00) && (pu8IEs[index + 3] == 0x50) &&
- (pu8IEs[index + 4] == 0xF2) &&
- (pu8IEs[index + 5] == 0x02) &&
- ((pu8IEs[index + 6] == 0x00) || (pu8IEs[index + 6] == 0x01)) &&
- (pu8IEs[index + 7] == 0x01)) {
- pNewJoinBssParam->wmm_cap = true;
-
- if (pu8IEs[index + 8] & BIT(7))
- pNewJoinBssParam->uapsd_cap = true;
- index += pu8IEs[index + 1] + 2;
- } else if ((pu8IEs[index] == P2P_IE) &&
- (pu8IEs[index + 2] == 0x50) && (pu8IEs[index + 3] == 0x6f) &&
- (pu8IEs[index + 4] == 0x9a) &&
- (pu8IEs[index + 5] == 0x09) && (pu8IEs[index + 6] == 0x0c)) {
- u16 u16P2P_count;
-
- pNewJoinBssParam->tsf = ptstrNetworkInfo->tsf_lo;
- pNewJoinBssParam->noa_enabled = 1;
- pNewJoinBssParam->idx = pu8IEs[index + 9];
-
- if (pu8IEs[index + 10] & BIT(7)) {
- pNewJoinBssParam->opp_enabled = 1;
- pNewJoinBssParam->ct_window = pu8IEs[index + 10];
+ for (i = 0; i < (param->supp_rates[0] - rates_no); i++)
+ param->supp_rates[rates_no + i + 1] = ies[index + i];
+
+ index += ext_rates_no;
+ } else if (ies[index] == HT_CAPABILITY_IE) {
+ param->ht_capable = true;
+ 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 + 6] == 0x00) || (ies[index + 6] == 0x01)) &&
+ (ies[index + 7] == 0x01)) {
+ param->wmm_cap = true;
+
+ if (ies[index + 8] & BIT(7))
+ param->uapsd_cap = true;
+ index += ies[index + 1] + 2;
+ } else if ((ies[index] == P2P_IE) &&
+ (ies[index + 2] == 0x50) && (ies[index + 3] == 0x6f) &&
+ (ies[index + 4] == 0x9a) &&
+ (ies[index + 5] == 0x09) && (ies[index + 6] == 0x0c)) {
+ u16 p2p_cnt;
+
+ param->tsf = info->tsf_lo;
+ param->noa_enabled = 1;
+ param->idx = ies[index + 9];
+
+ if (ies[index + 10] & BIT(7)) {
+ param->opp_enabled = 1;
+ param->ct_window = ies[index + 10];
} else {
- pNewJoinBssParam->opp_enabled = 0;
+ param->opp_enabled = 0;
}
- pNewJoinBssParam->cnt = pu8IEs[index + 11];
- u16P2P_count = index + 12;
+ param->cnt = ies[index + 11];
+ p2p_cnt = index + 12;
- memcpy(pNewJoinBssParam->duration, pu8IEs + u16P2P_count, 4);
- u16P2P_count += 4;
+ memcpy(param->duration, ies + p2p_cnt, 4);
+ p2p_cnt += 4;
- memcpy(pNewJoinBssParam->interval, pu8IEs + u16P2P_count, 4);
- u16P2P_count += 4;
+ memcpy(param->interval, ies + p2p_cnt, 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;
- } else if ((pu8IEs[index] == RSN_IE) ||
- ((pu8IEs[index] == WPA_IE) && (pu8IEs[index + 2] == 0x00) &&
- (pu8IEs[index + 3] == 0x50) && (pu8IEs[index + 4] == 0xF2) &&
- (pu8IEs[index + 5] == 0x01))) {
- u16 rsnIndex = index;
+ index += ies[index + 1] + 2;
+ } else if ((ies[index] == RSN_IE) ||
+ ((ies[index] == WPA_IE) && (ies[index + 2] == 0x00) &&
+ (ies[index + 3] == 0x50) && (ies[index + 4] == 0xF2) &&
+ (ies[index + 5] == 0x01))) {
+ u16 rsn_idx = index;
- if (pu8IEs[rsnIndex] == RSN_IE) {
- pNewJoinBssParam->mode_802_11i = 2;
+ if (ies[rsn_idx] == RSN_IE) {
+ param->mode_802_11i = 2;
} else {
- if (pNewJoinBssParam->mode_802_11i == 0)
- pNewJoinBssParam->mode_802_11i = 1;
- rsnIndex += 4;
+ if (param->mode_802_11i == 0)
+ param->mode_802_11i = 1;
+ rsn_idx += 4;
}
- rsnIndex += 7;
- pNewJoinBssParam->rsn_grp_policy = pu8IEs[rsnIndex];
- rsnIndex++;
- jumpOffset = pu8IEs[rsnIndex] * 4;
- pcipherCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
- rsnIndex += 2;
+ rsn_idx += 7;
+ param->rsn_grp_policy = ies[rsn_idx];
+ rsn_idx++;
+ offset = ies[rsn_idx] * 4;
+ pcipher_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
+ rsn_idx += 2;
- for (i = pcipherTotalCount, j = 0; i < pcipherCount + pcipherTotalCount && i < 3; i++, j++)
- pNewJoinBssParam->rsn_pcip_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
+ 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];
- pcipherTotalCount += pcipherCount;
- rsnIndex += jumpOffset;
+ pcipher_total_cnt += pcipher_cnt;
+ rsn_idx += offset;
- jumpOffset = pu8IEs[rsnIndex] * 4;
+ offset = ies[rsn_idx] * 4;
- authCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
- rsnIndex += 2;
+ auth_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
+ rsn_idx += 2;
- for (i = authTotalCount, j = 0; i < authTotalCount + authCount; i++, j++)
- pNewJoinBssParam->rsn_auth_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
+ 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];
- authTotalCount += authCount;
- rsnIndex += jumpOffset;
+ auth_total_cnt += auth_cnt;
+ rsn_idx += offset;
- if (pu8IEs[index] == RSN_IE) {
- pNewJoinBssParam->rsn_cap[0] = pu8IEs[rsnIndex];
- pNewJoinBssParam->rsn_cap[1] = pu8IEs[rsnIndex + 1];
- rsnIndex += 2;
+ if (ies[index] == RSN_IE) {
+ param->rsn_cap[0] = ies[rsn_idx];
+ param->rsn_cap[1] = ies[rsn_idx + 1];
+ rsn_idx += 2;
}
- pNewJoinBssParam->rsn_found = true;
- index += pu8IEs[index + 1] + 2;
+ param->rsn_found = true;
+ index += ies[index + 1] + 2;
} 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)
--
2.7.4
fix "Avoid camelCase" issue reported by checkpatch.pl script.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 78 +++++++++++++++----------------
1 file changed, 39 insertions(+), 39 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4ddd1a8..cc27b5a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -909,7 +909,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
struct wid wid_list[8];
u32 wid_cnt = 0, dummyval = 0;
u8 *cur_byte = NULL;
- struct join_bss_param *ptstrJoinBssParam;
+ struct join_bss_param *j_bss_param;
struct host_if_drv *hif_drv = vif->hif_drv;
if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
@@ -918,8 +918,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
return result;
}
- ptstrJoinBssParam = attr->params;
- if (!ptstrJoinBssParam) {
+ j_bss_param = attr->params;
+ if (!j_bss_param) {
netdev_err(vif->ndev, "Required BSSID not found\n");
result = -ENOENT;
goto ERRORHANDLER;
@@ -1027,8 +1027,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
netdev_err(vif->ndev, "Channel out of range\n");
*(cur_byte++) = 0xFF;
}
- *(cur_byte++) = (ptstrJoinBssParam->cap_info) & 0xFF;
- *(cur_byte++) = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
+ *(cur_byte++) = (j_bss_param->cap_info) & 0xFF;
+ *(cur_byte++) = ((j_bss_param->cap_info) >> 8) & 0xFF;
if (attr->bssid)
memcpy(cur_byte, attr->bssid, 6);
@@ -1038,57 +1038,57 @@ static s32 Handle_Connect(struct wilc_vif *vif,
memcpy(cur_byte, attr->bssid, 6);
cur_byte += 6;
- *(cur_byte++) = (ptstrJoinBssParam->beacon_period) & 0xFF;
- *(cur_byte++) = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
- *(cur_byte++) = ptstrJoinBssParam->dtim_period;
+ *(cur_byte++) = (j_bss_param->beacon_period) & 0xFF;
+ *(cur_byte++) = ((j_bss_param->beacon_period) >> 8) & 0xFF;
+ *(cur_byte++) = j_bss_param->dtim_period;
- memcpy(cur_byte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
+ memcpy(cur_byte, j_bss_param->supp_rates, MAX_RATES_SUPPORTED + 1);
cur_byte += (MAX_RATES_SUPPORTED + 1);
- *(cur_byte++) = ptstrJoinBssParam->wmm_cap;
- *(cur_byte++) = ptstrJoinBssParam->uapsd_cap;
+ *(cur_byte++) = j_bss_param->wmm_cap;
+ *(cur_byte++) = j_bss_param->uapsd_cap;
- *(cur_byte++) = ptstrJoinBssParam->ht_capable;
- hif_drv->usr_conn_req.ht_capable = ptstrJoinBssParam->ht_capable;
+ *(cur_byte++) = j_bss_param->ht_capable;
+ hif_drv->usr_conn_req.ht_capable = j_bss_param->ht_capable;
- *(cur_byte++) = ptstrJoinBssParam->rsn_found;
- *(cur_byte++) = ptstrJoinBssParam->rsn_grp_policy;
- *(cur_byte++) = ptstrJoinBssParam->mode_802_11i;
+ *(cur_byte++) = j_bss_param->rsn_found;
+ *(cur_byte++) = j_bss_param->rsn_grp_policy;
+ *(cur_byte++) = j_bss_param->mode_802_11i;
- memcpy(cur_byte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
- cur_byte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
+ memcpy(cur_byte, j_bss_param->rsn_pcip_policy, sizeof(j_bss_param->rsn_pcip_policy));
+ cur_byte += sizeof(j_bss_param->rsn_pcip_policy);
- memcpy(cur_byte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
- cur_byte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
+ memcpy(cur_byte, j_bss_param->rsn_auth_policy, sizeof(j_bss_param->rsn_auth_policy));
+ cur_byte += sizeof(j_bss_param->rsn_auth_policy);
- memcpy(cur_byte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
- cur_byte += sizeof(ptstrJoinBssParam->rsn_cap);
+ memcpy(cur_byte, j_bss_param->rsn_cap, sizeof(j_bss_param->rsn_cap));
+ cur_byte += sizeof(j_bss_param->rsn_cap);
*(cur_byte++) = REAL_JOIN_REQ;
- *(cur_byte++) = ptstrJoinBssParam->noa_enabled;
+ *(cur_byte++) = j_bss_param->noa_enabled;
- if (ptstrJoinBssParam->noa_enabled) {
- *(cur_byte++) = (ptstrJoinBssParam->tsf) & 0xFF;
- *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
- *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
- *(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
+ if (j_bss_param->noa_enabled) {
+ *(cur_byte++) = (j_bss_param->tsf) & 0xFF;
+ *(cur_byte++) = ((j_bss_param->tsf) >> 8) & 0xFF;
+ *(cur_byte++) = ((j_bss_param->tsf) >> 16) & 0xFF;
+ *(cur_byte++) = ((j_bss_param->tsf) >> 24) & 0xFF;
- *(cur_byte++) = ptstrJoinBssParam->opp_enabled;
- *(cur_byte++) = ptstrJoinBssParam->idx;
+ *(cur_byte++) = j_bss_param->opp_enabled;
+ *(cur_byte++) = j_bss_param->idx;
- if (ptstrJoinBssParam->opp_enabled)
- *(cur_byte++) = ptstrJoinBssParam->ct_window;
+ if (j_bss_param->opp_enabled)
+ *(cur_byte++) = j_bss_param->ct_window;
- *(cur_byte++) = ptstrJoinBssParam->cnt;
+ *(cur_byte++) = j_bss_param->cnt;
- memcpy(cur_byte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
- cur_byte += sizeof(ptstrJoinBssParam->duration);
+ memcpy(cur_byte, j_bss_param->duration, sizeof(j_bss_param->duration));
+ cur_byte += sizeof(j_bss_param->duration);
- memcpy(cur_byte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
- cur_byte += sizeof(ptstrJoinBssParam->interval);
+ memcpy(cur_byte, j_bss_param->interval, sizeof(j_bss_param->interval));
+ cur_byte += sizeof(j_bss_param->interval);
- memcpy(cur_byte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
- cur_byte += sizeof(ptstrJoinBssParam->start_time);
+ memcpy(cur_byte, j_bss_param->start_time, sizeof(j_bss_param->start_time));
+ cur_byte += sizeof(j_bss_param->start_time);
}
cur_byte = wid_list[wid_cnt].val;
--
2.7.4
fix "Avoid camelCase" issue found by checkpatch.pl script.
Rename variable name from strWIDList to wid_list.
Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 176 +++++++++++++++---------------
1 file changed, 88 insertions(+), 88 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 1ac079a..57b872c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -906,7 +906,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
struct connect_attr *pstrHostIFconnectAttr)
{
s32 result = 0;
- struct wid strWIDList[8];
+ struct wid wid_list[8];
u32 u32WidsCount = 0, dummyval = 0;
u8 *pu8CurrByte = NULL;
struct join_bss_param *ptstrJoinBssParam;
@@ -952,29 +952,29 @@ static s32 Handle_Connect(struct wilc_vif *vif,
hif_drv->usr_conn_req.conn_result = pstrHostIFconnectAttr->result;
hif_drv->usr_conn_req.arg = pstrHostIFconnectAttr->arg;
- strWIDList[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
- strWIDList[u32WidsCount].type = WID_INT;
- strWIDList[u32WidsCount].size = sizeof(u32);
- strWIDList[u32WidsCount].val = (s8 *)(&(dummyval));
+ wid_list[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
+ wid_list[u32WidsCount].type = WID_INT;
+ wid_list[u32WidsCount].size = sizeof(u32);
+ wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
u32WidsCount++;
- strWIDList[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
- strWIDList[u32WidsCount].type = WID_INT;
- strWIDList[u32WidsCount].size = sizeof(u32);
- strWIDList[u32WidsCount].val = (s8 *)(&(dummyval));
+ wid_list[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
+ wid_list[u32WidsCount].type = WID_INT;
+ wid_list[u32WidsCount].size = sizeof(u32);
+ wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
u32WidsCount++;
- strWIDList[u32WidsCount].id = WID_FAILED_COUNT;
- strWIDList[u32WidsCount].type = WID_INT;
- strWIDList[u32WidsCount].size = sizeof(u32);
- strWIDList[u32WidsCount].val = (s8 *)(&(dummyval));
+ wid_list[u32WidsCount].id = WID_FAILED_COUNT;
+ wid_list[u32WidsCount].type = WID_INT;
+ wid_list[u32WidsCount].size = sizeof(u32);
+ wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
u32WidsCount++;
{
- strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_ASSOCIATE;
- strWIDList[u32WidsCount].type = WID_BIN_DATA;
- strWIDList[u32WidsCount].val = hif_drv->usr_conn_req.ies;
- strWIDList[u32WidsCount].size = hif_drv->usr_conn_req.ies_len;
+ wid_list[u32WidsCount].id = WID_INFO_ELEMENT_ASSOCIATE;
+ wid_list[u32WidsCount].type = WID_BIN_DATA;
+ wid_list[u32WidsCount].val = hif_drv->usr_conn_req.ies;
+ wid_list[u32WidsCount].size = hif_drv->usr_conn_req.ies_len;
u32WidsCount++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
@@ -984,39 +984,39 @@ static s32 Handle_Connect(struct wilc_vif *vif,
info_element_size);
}
}
- strWIDList[u32WidsCount].id = (u16)WID_11I_MODE;
- strWIDList[u32WidsCount].type = WID_CHAR;
- strWIDList[u32WidsCount].size = sizeof(char);
- strWIDList[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.security;
+ wid_list[u32WidsCount].id = (u16)WID_11I_MODE;
+ wid_list[u32WidsCount].type = WID_CHAR;
+ wid_list[u32WidsCount].size = sizeof(char);
+ wid_list[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.security;
u32WidsCount++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
mode_11i = hif_drv->usr_conn_req.security;
- strWIDList[u32WidsCount].id = (u16)WID_AUTH_TYPE;
- strWIDList[u32WidsCount].type = WID_CHAR;
- strWIDList[u32WidsCount].size = sizeof(char);
- strWIDList[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
+ wid_list[u32WidsCount].id = (u16)WID_AUTH_TYPE;
+ wid_list[u32WidsCount].type = WID_CHAR;
+ wid_list[u32WidsCount].size = sizeof(char);
+ wid_list[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
u32WidsCount++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
auth_type = (u8)hif_drv->usr_conn_req.auth_type;
- strWIDList[u32WidsCount].id = (u16)WID_JOIN_REQ_EXTENDED;
- strWIDList[u32WidsCount].type = WID_STR;
- strWIDList[u32WidsCount].size = 112;
- strWIDList[u32WidsCount].val = kmalloc(strWIDList[u32WidsCount].size, GFP_KERNEL);
+ wid_list[u32WidsCount].id = (u16)WID_JOIN_REQ_EXTENDED;
+ wid_list[u32WidsCount].type = WID_STR;
+ wid_list[u32WidsCount].size = 112;
+ wid_list[u32WidsCount].val = kmalloc(wid_list[u32WidsCount].size, GFP_KERNEL);
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
- join_req_size = strWIDList[u32WidsCount].size;
+ join_req_size = wid_list[u32WidsCount].size;
join_req = kmalloc(join_req_size, GFP_KERNEL);
}
- if (!strWIDList[u32WidsCount].val) {
+ if (!wid_list[u32WidsCount].val) {
result = -EFAULT;
goto ERRORHANDLER;
}
- pu8CurrByte = strWIDList[u32WidsCount].val;
+ pu8CurrByte = wid_list[u32WidsCount].val;
if (pstrHostIFconnectAttr->ssid) {
memcpy(pu8CurrByte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
@@ -1095,7 +1095,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
pu8CurrByte += sizeof(ptstrJoinBssParam->start_time);
}
- pu8CurrByte = strWIDList[u32WidsCount].val;
+ pu8CurrByte = wid_list[u32WidsCount].val;
u32WidsCount++;
if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
@@ -1107,7 +1107,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
memcpy(wilc_connected_ssid,
pstrHostIFconnectAttr->bssid, ETH_ALEN);
- result = wilc_send_config_pkt(vif, SET_CFG, strWIDList,
+ result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
u32WidsCount,
wilc_get_vif_idx(vif));
if (result) {
@@ -1530,7 +1530,7 @@ static int Handle_Key(struct wilc_vif *vif,
{
s32 result = 0;
struct wid wid;
- struct wid strWIDList[5];
+ struct wid wid_list[5];
u8 i;
u8 *pu8keybuf;
s8 s8idxarray[1];
@@ -1541,15 +1541,15 @@ static int Handle_Key(struct wilc_vif *vif,
case WEP:
if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
- strWIDList[0].id = (u16)WID_11I_MODE;
- strWIDList[0].type = WID_CHAR;
- strWIDList[0].size = sizeof(char);
- strWIDList[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.mode;
+ wid_list[0].id = (u16)WID_11I_MODE;
+ wid_list[0].type = WID_CHAR;
+ wid_list[0].size = sizeof(char);
+ wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.mode;
- strWIDList[1].id = WID_AUTH_TYPE;
- strWIDList[1].type = WID_CHAR;
- strWIDList[1].size = sizeof(char);
- strWIDList[1].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.auth_type;
+ wid_list[1].id = WID_AUTH_TYPE;
+ wid_list[1].type = WID_CHAR;
+ wid_list[1].size = sizeof(char);
+ wid_list[1].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.auth_type;
pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2,
GFP_KERNEL);
@@ -1564,13 +1564,13 @@ static int Handle_Key(struct wilc_vif *vif,
kfree(pstrHostIFkeyAttr->attr.wep.key);
- strWIDList[2].id = (u16)WID_WEP_KEY_VALUE;
- strWIDList[2].type = WID_STR;
- strWIDList[2].size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
- strWIDList[2].val = (s8 *)pu8keybuf;
+ wid_list[2].id = (u16)WID_WEP_KEY_VALUE;
+ wid_list[2].type = WID_STR;
+ wid_list[2].size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
+ wid_list[2].val = (s8 *)pu8keybuf;
result = wilc_send_config_pkt(vif, SET_CFG,
- strWIDList, 3,
+ wid_list, 3,
wilc_get_vif_idx(vif));
kfree(pu8keybuf);
} else if (pstrHostIFkeyAttr->action & ADDKEY) {
@@ -1632,18 +1632,18 @@ static int Handle_Key(struct wilc_vif *vif,
memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key,
pstrHostIFkeyAttr->attr.wpa.key_len);
- strWIDList[0].id = (u16)WID_11I_MODE;
- strWIDList[0].type = WID_CHAR;
- strWIDList[0].size = sizeof(char);
- strWIDList[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
+ wid_list[0].id = (u16)WID_11I_MODE;
+ wid_list[0].type = WID_CHAR;
+ wid_list[0].size = sizeof(char);
+ wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
- strWIDList[1].id = (u16)WID_ADD_RX_GTK;
- strWIDList[1].type = WID_STR;
- strWIDList[1].val = (s8 *)pu8keybuf;
- strWIDList[1].size = RX_MIC_KEY_MSG_LEN;
+ wid_list[1].id = (u16)WID_ADD_RX_GTK;
+ wid_list[1].type = WID_STR;
+ wid_list[1].val = (s8 *)pu8keybuf;
+ wid_list[1].size = RX_MIC_KEY_MSG_LEN;
result = wilc_send_config_pkt(vif, SET_CFG,
- strWIDList, 2,
+ wid_list, 2,
wilc_get_vif_idx(vif));
kfree(pu8keybuf);
@@ -1700,18 +1700,18 @@ static int Handle_Key(struct wilc_vif *vif,
memcpy(pu8keybuf + 8, pstrHostIFkeyAttr->attr.wpa.key,
pstrHostIFkeyAttr->attr.wpa.key_len);
- strWIDList[0].id = (u16)WID_11I_MODE;
- strWIDList[0].type = WID_CHAR;
- strWIDList[0].size = sizeof(char);
- strWIDList[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
+ wid_list[0].id = (u16)WID_11I_MODE;
+ wid_list[0].type = WID_CHAR;
+ wid_list[0].size = sizeof(char);
+ wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
- strWIDList[1].id = (u16)WID_ADD_PTK;
- strWIDList[1].type = WID_STR;
- strWIDList[1].val = (s8 *)pu8keybuf;
- strWIDList[1].size = PTK_KEY_MSG_LEN + 1;
+ wid_list[1].id = (u16)WID_ADD_PTK;
+ wid_list[1].type = WID_STR;
+ wid_list[1].val = (s8 *)pu8keybuf;
+ wid_list[1].size = PTK_KEY_MSG_LEN + 1;
result = wilc_send_config_pkt(vif, SET_CFG,
- strWIDList, 2,
+ wid_list, 2,
wilc_get_vif_idx(vif));
kfree(pu8keybuf);
complete(&hif_drv->comp_test_key_block);
@@ -1892,40 +1892,40 @@ static void Handle_GetRssi(struct wilc_vif *vif)
static s32 Handle_GetStatistics(struct wilc_vif *vif,
struct rf_info *pstrStatistics)
{
- struct wid strWIDList[5];
+ struct wid wid_list[5];
u32 u32WidsCount = 0, result = 0;
- strWIDList[u32WidsCount].id = WID_LINKSPEED;
- strWIDList[u32WidsCount].type = WID_CHAR;
- strWIDList[u32WidsCount].size = sizeof(char);
- strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->link_speed;
+ wid_list[u32WidsCount].id = WID_LINKSPEED;
+ wid_list[u32WidsCount].type = WID_CHAR;
+ wid_list[u32WidsCount].size = sizeof(char);
+ wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->link_speed;
u32WidsCount++;
- strWIDList[u32WidsCount].id = WID_RSSI;
- strWIDList[u32WidsCount].type = WID_CHAR;
- strWIDList[u32WidsCount].size = sizeof(char);
- strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->rssi;
+ wid_list[u32WidsCount].id = WID_RSSI;
+ wid_list[u32WidsCount].type = WID_CHAR;
+ wid_list[u32WidsCount].size = sizeof(char);
+ wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->rssi;
u32WidsCount++;
- strWIDList[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
- strWIDList[u32WidsCount].type = WID_INT;
- strWIDList[u32WidsCount].size = sizeof(u32);
- strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->tx_cnt;
+ wid_list[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
+ wid_list[u32WidsCount].type = WID_INT;
+ wid_list[u32WidsCount].size = sizeof(u32);
+ wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->tx_cnt;
u32WidsCount++;
- strWIDList[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
- strWIDList[u32WidsCount].type = WID_INT;
- strWIDList[u32WidsCount].size = sizeof(u32);
- strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->rx_cnt;
+ wid_list[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
+ wid_list[u32WidsCount].type = WID_INT;
+ wid_list[u32WidsCount].size = sizeof(u32);
+ wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->rx_cnt;
u32WidsCount++;
- strWIDList[u32WidsCount].id = WID_FAILED_COUNT;
- strWIDList[u32WidsCount].type = WID_INT;
- strWIDList[u32WidsCount].size = sizeof(u32);
- strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->tx_fail_cnt;
+ wid_list[u32WidsCount].id = WID_FAILED_COUNT;
+ wid_list[u32WidsCount].type = WID_INT;
+ wid_list[u32WidsCount].size = sizeof(u32);
+ wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->tx_fail_cnt;
u32WidsCount++;
- result = wilc_send_config_pkt(vif, GET_CFG, strWIDList,
+ result = wilc_send_config_pkt(vif, GET_CFG, wid_list,
u32WidsCount,
wilc_get_vif_idx(vif));
--
2.7.4