From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wojciech Dubowik Date: Mon, 11 Jun 2012 16:24:28 +0200 Subject: [ath9k-devel] Set vendor specific element ID in probe request In-Reply-To: References: Message-ID: <4FD5FF9C.8050407@neratec.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On 06/11/2012 01:07 PM, Amith Belur wrote: > Help needed, newbie here. I am trying to find how to set vendor > specific element id in probe request and I am not quite clear how to > do this. Any pointers would be really helpful. I have used changes below to send vendor data in probe responses. It's in mac80211 so you can use it with other drivers as well i.e. mac80211_hwsim. vendor_data_oui is just debugfs entry but you might just get rid of this and add your own control. At the moment I am using 16-bit for data but you can send what you want. Just add your struct instead of vendor_data_value and change IE length. This is just part of my testing patchest and it hasn't been reviewed, cleaned, etc. I have also patch to send vendor data in beacons based on debugfs entries (fast) or through hostapd (slow). I don't plan to publish them unless there is general interest in it. It's "vendor specific" so applications and means of control can vary... Br, Wojtek diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 4b1319b..ac58a1b 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1465,6 +1465,7 @@ void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; int headroom; bool may_encrypt; + u8 *pos; rcu_read_lock(); @@ -1485,6 +1486,32 @@ void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) hdr = (struct ieee80211_hdr *) skb->data; info->control.vif = &sdata->vif; + /* Add vendor specific data to probe response (if present) */ + if (ieee80211_is_probe_resp(hdr->frame_control) && + !(info->control.vif->bss_conf.vendor_data_oui[0] == 0 && + info->control.vif->bss_conf.vendor_data_oui[1] == 0 && + info->control.vif->bss_conf.vendor_data_oui[2] == 0)) { + + if (skb->end - skb->tail < 8) + pskb_expand_head(skb, 0, 8, GFP_ATOMIC); + + if (skb->end - skb->tail > 8) { + pos = (u8 *) skb_put(skb, 8); + *pos++ = WLAN_EID_VENDOR_SPECIFIC; + *pos++ = 3 + 1 + 2; /* oui, type, data16 */ + memcpy(pos, info->control.vif->bss_conf.vendor_data_oui, + sizeof(info->control.vif->bss_conf.vendor_data_oui)); + pos += sizeof(info->control.vif->bss_conf.vendor_data_oui); + *pos++ = info->control.vif->bss_conf.vendor_data_type; + memcpy(pos, &info->control.vif->bss_conf.vendor_data_value, + sizeof(info->control.vif->bss_conf.vendor_data_value)); + } else { + printk(KERN_DEBUG "%s: Unable to add vendor data to probe response" + " directed to %pM\n", sdata->name, + hdr->addr1); + } + } + if (ieee80211_vif_is_mesh(&sdata->vif) && ieee80211_is_data(hdr->frame_control) && !is_multicast_ether_addr(hdr->addr1) && > > Thanks > > -- > Best Regards, > Amith > > > > _______________________________________________ > ath9k-devel mailing list > ath9k-devel at lists.ath9k.org > https://lists.ath9k.org/mailman/listinfo/ath9k-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120611/ca0bae2d/attachment.htm