Commit 6177eaea authored by Eliad Peller's avatar Eliad Peller Committed by Luciano Coelho

wl12xx: fix some sparse warnings

Note that wl1271_write32() calls cpu_to_le32() by itself, so calling
wl1271_write32(addr, cpu_to_le32(val)) is in fact a bug on BE systems.

Fix the following sparse warnings:

drivers/net/wireless/wl12xx/cmd.c:662:16: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/cmd.c:662:16:    expected unsigned short [unsigned] [addressable] [usertype] llc_type
drivers/net/wireless/wl12xx/cmd.c:662:16:    got restricted __be16 [usertype] <noident>
drivers/net/wireless/wl12xx/cmd.c:674:17: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/cmd.c:674:17:    expected unsigned int [unsigned] [addressable] [usertype] sender_ip
drivers/net/wireless/wl12xx/cmd.c:674:17:    got restricted __be32 [usertype] ip_addr
drivers/net/wireless/wl12xx/rx.c:202:4: warning: incorrect type in argument 3 (different base types)
drivers/net/wireless/wl12xx/rx.c:202:4:    expected unsigned int [unsigned] [usertype] val
drivers/net/wireless/wl12xx/rx.c:202:4:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/acx.c:1247:23: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/acx.c:1247:23:    expected restricted __le32 [usertype] ht_capabilites
drivers/net/wireless/wl12xx/acx.c:1247:23:    got unsigned long
drivers/net/wireless/wl12xx/acx.c:1250:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1250:24:    left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1250:24:    right side has type unsigned long
drivers/net/wireless/wl12xx/acx.c:1253:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1253:24:    left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1253:24:    right side has type unsigned long
drivers/net/wireless/wl12xx/acx.c:1256:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1256:24:    left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1256:24:    right side has type unsigned long
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 0dd38667
...@@ -1233,6 +1233,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, ...@@ -1233,6 +1233,7 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
struct wl1271_acx_ht_capabilities *acx; struct wl1271_acx_ht_capabilities *acx;
u8 mac_address[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; u8 mac_address[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
int ret = 0; int ret = 0;
u32 ht_capabilites = 0;
wl1271_debug(DEBUG_ACX, "acx ht capabilities setting"); wl1271_debug(DEBUG_ACX, "acx ht capabilities setting");
...@@ -1244,16 +1245,16 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, ...@@ -1244,16 +1245,16 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
/* Allow HT Operation ? */ /* Allow HT Operation ? */
if (allow_ht_operation) { if (allow_ht_operation) {
acx->ht_capabilites = ht_capabilites =
WL1271_ACX_FW_CAP_HT_OPERATION; WL1271_ACX_FW_CAP_HT_OPERATION;
if (ht_cap->cap & IEEE80211_HT_CAP_GRN_FLD) if (ht_cap->cap & IEEE80211_HT_CAP_GRN_FLD)
acx->ht_capabilites |= ht_capabilites |=
WL1271_ACX_FW_CAP_GREENFIELD_FRAME_FORMAT; WL1271_ACX_FW_CAP_GREENFIELD_FRAME_FORMAT;
if (ht_cap->cap & IEEE80211_HT_CAP_SGI_20) if (ht_cap->cap & IEEE80211_HT_CAP_SGI_20)
acx->ht_capabilites |= ht_capabilites |=
WL1271_ACX_FW_CAP_SHORT_GI_FOR_20MHZ_PACKETS; WL1271_ACX_FW_CAP_SHORT_GI_FOR_20MHZ_PACKETS;
if (ht_cap->cap & IEEE80211_HT_CAP_LSIG_TXOP_PROT) if (ht_cap->cap & IEEE80211_HT_CAP_LSIG_TXOP_PROT)
acx->ht_capabilites |= ht_capabilites |=
WL1271_ACX_FW_CAP_LSIG_TXOP_PROTECTION; WL1271_ACX_FW_CAP_LSIG_TXOP_PROTECTION;
/* get data from A-MPDU parameters field */ /* get data from A-MPDU parameters field */
...@@ -1261,10 +1262,10 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl, ...@@ -1261,10 +1262,10 @@ int wl1271_acx_set_ht_capabilities(struct wl1271 *wl,
acx->ampdu_min_spacing = ht_cap->ampdu_density; acx->ampdu_min_spacing = ht_cap->ampdu_density;
memcpy(acx->mac_address, mac_address, ETH_ALEN); memcpy(acx->mac_address, mac_address, ETH_ALEN);
} else { /* HT operations are not allowed */
acx->ht_capabilites = 0;
} }
acx->ht_capabilites = cpu_to_le32(ht_capabilites);
ret = wl1271_cmd_configure(wl, ACX_PEER_HT_CAP, acx, sizeof(*acx)); ret = wl1271_cmd_configure(wl, ACX_PEER_HT_CAP, acx, sizeof(*acx));
if (ret < 0) { if (ret < 0) {
wl1271_warning("acx ht capabilities setting failed: %d", ret); wl1271_warning("acx ht capabilities setting failed: %d", ret);
......
...@@ -659,15 +659,15 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr) ...@@ -659,15 +659,15 @@ int wl1271_cmd_build_arp_rsp(struct wl1271 *wl, __be32 ip_addr)
/* llc layer */ /* llc layer */
memcpy(tmpl.llc_hdr, rfc1042_header, sizeof(rfc1042_header)); memcpy(tmpl.llc_hdr, rfc1042_header, sizeof(rfc1042_header));
tmpl.llc_type = htons(ETH_P_ARP); tmpl.llc_type = cpu_to_be16(ETH_P_ARP);
/* arp header */ /* arp header */
arp_hdr = &tmpl.arp_hdr; arp_hdr = &tmpl.arp_hdr;
arp_hdr->ar_hrd = htons(ARPHRD_ETHER); arp_hdr->ar_hrd = cpu_to_be16(ARPHRD_ETHER);
arp_hdr->ar_pro = htons(ETH_P_IP); arp_hdr->ar_pro = cpu_to_be16(ETH_P_IP);
arp_hdr->ar_hln = ETH_ALEN; arp_hdr->ar_hln = ETH_ALEN;
arp_hdr->ar_pln = 4; arp_hdr->ar_pln = 4;
arp_hdr->ar_op = htons(ARPOP_REPLY); arp_hdr->ar_op = cpu_to_be16(ARPOP_REPLY);
/* arp payload */ /* arp payload */
memcpy(tmpl.sender_hw, wl->vif->addr, ETH_ALEN); memcpy(tmpl.sender_hw, wl->vif->addr, ETH_ALEN);
......
...@@ -198,6 +198,5 @@ void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status) ...@@ -198,6 +198,5 @@ void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status)
pkt_offset += pkt_length; pkt_offset += pkt_length;
} }
} }
wl1271_write32(wl, RX_DRIVER_COUNTER_ADDRESS, wl1271_write32(wl, RX_DRIVER_COUNTER_ADDRESS, wl->rx_counter);
cpu_to_le32(wl->rx_counter));
} }
...@@ -138,13 +138,13 @@ struct wl12xx_arp_rsp_template { ...@@ -138,13 +138,13 @@ struct wl12xx_arp_rsp_template {
struct ieee80211_hdr_3addr hdr; struct ieee80211_hdr_3addr hdr;
u8 llc_hdr[sizeof(rfc1042_header)]; u8 llc_hdr[sizeof(rfc1042_header)];
u16 llc_type; __be16 llc_type;
struct arphdr arp_hdr; struct arphdr arp_hdr;
u8 sender_hw[ETH_ALEN]; u8 sender_hw[ETH_ALEN];
u32 sender_ip; __be32 sender_ip;
u8 target_hw[ETH_ALEN]; u8 target_hw[ETH_ALEN];
u32 target_ip; __be32 target_ip;
} __packed; } __packed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment