if (!p)
return NULL;
- p->size = cpu_to_le16((u16)(size - sizeof(p->size)));
+ p->size = cpu_to_le16(size - sizeof(p->size));
p->event = cpu_to_le16(event);
return p;
priv->wpa.key[1].key_len == 0 &&
priv->wpa.key[2].key_len == 0 &&
priv->wpa.key[3].key_len == 0) {
- pp->auth_type = cpu_to_le16((u16)TYPE_AUTH);
+ pp->auth_type = cpu_to_le16(TYPE_AUTH);
} else {
if (priv->wpa.pairwise_suite == IW_AUTH_CIPHER_TKIP) {
michael_mic_function(&michael_mic,
skb_len += 8;
p += 8;
pp->auth_type =
- cpu_to_le16((u16)TYPE_DATA);
+ cpu_to_le16(TYPE_DATA);
} else if (priv->wpa.pairwise_suite ==
IW_AUTH_CIPHER_CCMP) {
pp->auth_type =
- cpu_to_le16((u16)TYPE_DATA);
+ cpu_to_le16(TYPE_DATA);
}
}
} else {
if (eth_proto == ETH_P_PAE)
- pp->auth_type = cpu_to_le16((u16)TYPE_AUTH);
+ pp->auth_type = cpu_to_le16(TYPE_AUTH);
else
- pp->auth_type = cpu_to_le16((u16)TYPE_DATA);
+ pp->auth_type = cpu_to_le16(TYPE_DATA);
}
/* header value set */
pp->header.size =
- cpu_to_le16((u16)
- (sizeof(*pp) - sizeof(pp->header.size) + skb_len));
- pp->header.event = cpu_to_le16((u16)HIF_DATA_REQ);
+ cpu_to_le16((sizeof(*pp) - sizeof(pp->header.size) + skb_len));
+ pp->header.event = cpu_to_le16(HIF_DATA_REQ);
/* tx request */
result = ks_wlan_hw_tx(priv, pp, hif_align_size(sizeof(*pp) + skb_len),
return;
pp->mib_attribute = cpu_to_le32(attr);
- pp->mib_value.size = cpu_to_le16((u16)size);
+ pp->mib_value.size = cpu_to_le16(size);
pp->mib_value.type = cpu_to_le16(type);
memcpy(&pp->mib_value.body, data, size);
static inline void hostif_mib_set_request_int(struct ks_wlan_private *priv,
enum mib_attribute attr, int val)
{
- __le32 v = cpu_to_le32((u32)val);
+ __le32 v = cpu_to_le32(val);
size_t size = sizeof(v);
hostif_mib_set_request(priv, attr, MIB_VALUE_TYPE_INT, &v, size);
enum mib_attribute attr,
bool val)
{
- __le32 v = cpu_to_le32((u32)val);
+ __le32 v = cpu_to_le32(val);
size_t size = sizeof(v);
hostif_mib_set_request(priv, attr, MIB_VALUE_TYPE_BOOL, &v, size);
if (!pp)
return;
- pp->mode = cpu_to_le16((u16)mode);
+ pp->mode = cpu_to_le16(mode);
send_request_to_device(priv, pp, hif_align_size(sizeof(*pp)));
static void init_request(struct ks_wlan_private *priv,
struct hostif_request *req)
{
- req->phy_type = cpu_to_le16((u16)(priv->reg.phy_type));
- req->cts_mode = cpu_to_le16((u16)(priv->reg.cts_mode));
- req->scan_type = cpu_to_le16((u16)(priv->reg.scan_type));
+ req->phy_type = cpu_to_le16(priv->reg.phy_type);
+ req->cts_mode = cpu_to_le16(priv->reg.cts_mode);
+ req->scan_type = cpu_to_le16(priv->reg.scan_type);
req->rate_set.size = priv->reg.rate_set.size;
req->capability = ks_wlan_cap(priv);
memcpy(&req->rate_set.body[0], &priv->reg.rate_set.body[0],
return;
init_request(priv, &pp->request);
- pp->channel = cpu_to_le16((u16)(priv->reg.channel));
+ pp->channel = cpu_to_le16(priv->reg.channel);
send_request_to_device(priv, pp, hif_align_size(sizeof(*pp)));
}
pp->ssid.size = priv->reg.ssid.size;
memcpy(&pp->ssid.body[0], &priv->reg.ssid.body[0], priv->reg.ssid.size);
pp->beacon_lost_count =
- cpu_to_le16((u16)(priv->reg.beacon_lost_count));
- pp->auth_type = cpu_to_le16((u16)(priv->reg.authenticate_type));
+ cpu_to_le16(priv->reg.beacon_lost_count);
+ pp->auth_type = cpu_to_le16(priv->reg.authenticate_type);
pp->channel_list.body[0] = 1;
pp->channel_list.body[1] = 8;
return;
init_request(priv, &pp->request);
- pp->channel = cpu_to_le16((u16)(priv->reg.channel));
+ pp->channel = cpu_to_le16(priv->reg.channel);
pp->ssid.size = priv->reg.ssid.size;
memcpy(&pp->ssid.body[0], &priv->reg.ssid.body[0], priv->reg.ssid.size);
return;
if (priv->reg.phy_info_timer) {
- pp->type = cpu_to_le16((u16)TIME_TYPE);
- pp->time = cpu_to_le16((u16)(priv->reg.phy_info_timer));
+ pp->type = cpu_to_le16(TIME_TYPE);
+ pp->time = cpu_to_le16(priv->reg.phy_info_timer);
} else {
- pp->type = cpu_to_le16((u16)NORMAL_TYPE);
- pp->time = cpu_to_le16((u16)0);
+ pp->type = cpu_to_le16(NORMAL_TYPE);
+ pp->time = cpu_to_le16(0);
}
send_request_to_device(priv, pp, hif_align_size(sizeof(*pp)));
pp->scan_type = scan_type;
- pp->ch_time_min = cpu_to_le32((u32)110); /* default value */
- pp->ch_time_max = cpu_to_le32((u32)130); /* default value */
+ pp->ch_time_min = cpu_to_le32(110); /* default value */
+ pp->ch_time_max = cpu_to_le32(130); /* default value */
pp->channel_list.body[0] = 1;
pp->channel_list.body[1] = 8;
pp->channel_list.body[2] = 2;
switch (type) {
case SME_RSN_UCAST_REQUEST:
- wpa_suite.size = cpu_to_le16((u16)1);
+ wpa_suite.size = cpu_to_le16(1);
switch (priv->wpa.pairwise_suite) {
case IW_AUTH_CIPHER_NONE:
buf = (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2) ?
CIPHER_ID_LEN);
break;
case SME_RSN_AUTH_REQUEST:
- wpa_suite.size = cpu_to_le16((u16)1);
+ wpa_suite.size = cpu_to_le16(1);
switch (priv->wpa.key_mgmt_suite) {
case IW_AUTH_KEY_MGMT_802_1X:
buf = (priv->wpa.version == IW_AUTH_WPA_VERSION_WPA2) ?
(priv->wpa.version == IW_AUTH_WPA_VERSION_WPA) ?
RSN_MODE_WPA : RSN_MODE_NONE;
rsn_mode.rsn_mode = cpu_to_le32(mode);
- rsn_mode.rsn_capability = cpu_to_le16((u16)0);
+ rsn_mode.rsn_capability = cpu_to_le16(0);
hostif_mib_set_request_ostring(priv, LOCAL_RSN_MODE,
&rsn_mode, sizeof(rsn_mode));
break;
memcpy(pmkcache.list[i].pmkid, pmk->pmkid, IW_PMKID_LEN);
i++;
}
- pmkcache.size = cpu_to_le16((u16)(priv->pmklist.size));
+ pmkcache.size = cpu_to_le16(priv->pmklist.size);
size = sizeof(priv->pmklist.size) +
((ETH_ALEN + IW_PMKID_LEN) * priv->pmklist.size);
hostif_mib_set_request_ostring(priv, LOCAL_PMK, &pmkcache, size);