mwifiex: fix ext_capab IE structure definition
authorAvinash Patil <patila@marvell.com>
Fri, 23 Aug 2013 23:48:22 +0000 (16:48 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 26 Aug 2013 18:09:05 +0000 (14:09 -0400)
EXT_CAPAB_IE format involves IEEE header followed by bytestream of
capabilities. Current structure has incorrect member u8 for data;
fix it by defining it as u8[0].

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/11n.c
drivers/net/wireless/mwifiex/fw.h

index 41e9d25a2d8e9d135a2f6b9b3b451149d36a0518..b579a2e54f4bd9ba3245051c5d32fc58400d982e 100644 (file)
@@ -292,6 +292,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
        struct mwifiex_ie_types_extcap *ext_cap;
        int ret_len = 0;
        struct ieee80211_supported_band *sband;
+       struct ieee_types_header *hdr;
        u8 radio_type;
 
        if (!buffer || !*buffer)
@@ -388,17 +389,18 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
        }
 
        if (bss_desc->bcn_ext_cap) {
+               hdr = (void *)bss_desc->bcn_ext_cap;
                ext_cap = (struct mwifiex_ie_types_extcap *) *buffer;
                memset(ext_cap, 0, sizeof(struct mwifiex_ie_types_extcap));
                ext_cap->header.type = cpu_to_le16(WLAN_EID_EXT_CAPABILITY);
-               ext_cap->header.len = cpu_to_le16(sizeof(ext_cap->ext_cap));
+               ext_cap->header.len = cpu_to_le16(hdr->len);
 
-               memcpy((u8 *)ext_cap + sizeof(struct mwifiex_ie_types_header),
+               memcpy((u8 *)ext_cap->ext_capab,
                       bss_desc->bcn_ext_cap + sizeof(struct ieee_types_header),
                       le16_to_cpu(ext_cap->header.len));
 
-               *buffer += sizeof(struct mwifiex_ie_types_extcap);
-               ret_len += sizeof(struct mwifiex_ie_types_extcap);
+               *buffer += sizeof(struct mwifiex_ie_types_extcap) + hdr->len;
+               ret_len += sizeof(struct mwifiex_ie_types_extcap) + hdr->len;
        }
 
        return ret_len;
index c9ad1c0d338d259071212f396d845d86f26d5904..f80f30b6160e7f4be38811198e76c245f26e08ca 100644 (file)
@@ -1330,7 +1330,7 @@ struct mwifiex_ie_types_2040bssco {
 
 struct mwifiex_ie_types_extcap {
        struct mwifiex_ie_types_header header;
-       u8 ext_cap;
+       u8 ext_capab[0];
 } __packed;
 
 struct host_cmd_ds_mac_reg_access {