summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-09-15 05:07:05 -0400
committerLuciano Coelho <coelho@ti.com>2011-09-23 07:38:47 -0400
commit26b4bf2e0f0dbafa4dd575b03ffcb12710ef5611 (patch)
treea64b3882e02f2ca062e9a446d6fd46772c1ea5fa /drivers
parentd48055d9fc730a7389bac782f98a96de763129e3 (diff)
wl12xx: remove P2P ie from probe response
wl12xx uses a single probe response template, regardless of the probe request. However, the P2P spec forbids including the p2p ie in some cases (e.g. the probe request didn't include the p2p ie). The fw responds only to probe requests that don't include the p2p ie, and passes up probe requests that include them (the supplicant will answer them). Thus, strip the p2p ie from the probe response template. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/main.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index a6c22ad0f575..a8728ae2bb02 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3083,6 +3083,23 @@ static void wl12xx_remove_ie(struct sk_buff *skb, u8 eid, int ieoffset)
3083 skb_trim(skb, skb->len - len); 3083 skb_trim(skb, skb->len - len);
3084} 3084}
3085 3085
3086static void wl12xx_remove_vendor_ie(struct sk_buff *skb,
3087 unsigned int oui, u8 oui_type,
3088 int ieoffset)
3089{
3090 int len;
3091 const u8 *next, *end = skb->data + skb->len;
3092 u8 *ie = (u8 *)cfg80211_find_vendor_ie(oui, oui_type,
3093 skb->data + ieoffset,
3094 skb->len - ieoffset);
3095 if (!ie)
3096 return;
3097 len = ie[1] + 2;
3098 next = ie + len;
3099 memmove(ie, next, end - next);
3100 skb_trim(skb, skb->len - len);
3101}
3102
3086static int wl1271_bss_erp_info_changed(struct wl1271 *wl, 3103static int wl1271_bss_erp_info_changed(struct wl1271 *wl,
3087 struct ieee80211_bss_conf *bss_conf, 3104 struct ieee80211_bss_conf *bss_conf,
3088 u32 changed) 3105 u32 changed)
@@ -3168,6 +3185,17 @@ static int wl1271_bss_beacon_info_changed(struct wl1271 *wl,
3168 /* remove TIM ie from probe response */ 3185 /* remove TIM ie from probe response */
3169 wl12xx_remove_ie(beacon, WLAN_EID_TIM, ieoffset); 3186 wl12xx_remove_ie(beacon, WLAN_EID_TIM, ieoffset);
3170 3187
3188 /*
3189 * remove p2p ie from probe response.
3190 * the fw reponds to probe requests that don't include
3191 * the p2p ie. probe requests with p2p ie will be passed,
3192 * and will be responded by the supplicant (the spec
3193 * forbids including the p2p ie when responding to probe
3194 * requests that didn't include it).
3195 */
3196 wl12xx_remove_vendor_ie(beacon, WLAN_OUI_WFA,
3197 WLAN_OUI_TYPE_WFA_P2P, ieoffset);
3198
3171 hdr = (struct ieee80211_hdr *) beacon->data; 3199 hdr = (struct ieee80211_hdr *) beacon->data;
3172 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | 3200 hdr->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
3173 IEEE80211_STYPE_PROBE_RESP); 3201 IEEE80211_STYPE_PROBE_RESP);