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];
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)
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;
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");
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;
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) {
}
}
- 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) {
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);
}
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;
{
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);
}
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;
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;
}
if (!hif_drv)
return 0;
- if ((wl->open_ifcs) > 0)
+ if (wl->open_ifcs > 0)
wl->open_ifcs--;
else
return 0;
data = cpu_to_le32(data);
- if ((addr >= 0xf0) && (addr <= 0xff)) {
+ if (addr >= 0xf0 && addr <= 0xff) {
struct sdio_cmd52 cmd;
cmd.read_write = 1;
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;
#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);
/**
* 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 */
}
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];
return N_RESET;
}
- if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ)) {
+ if (cmd == CMD_INTERNAL_READ || cmd == CMD_SINGLE_READ) {
/**
* Read bytes
**/
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);
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,
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) {
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);
}
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;
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);
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);
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);
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;
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]);
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);
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];
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;
}