* [ath9k-devel] Set vendor specific element ID in probe request
@ 2012-06-11 11:07 Amith Belur
2012-06-11 14:24 ` Wojciech Dubowik
0 siblings, 1 reply; 5+ messages in thread
From: Amith Belur @ 2012-06-11 11:07 UTC (permalink / raw)
To: ath9k-devel
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.
Thanks
--
Best Regards,
Amith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120611/d9b4b991/attachment.htm
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ath9k-devel] Set vendor specific element ID in probe request
2012-06-11 11:07 [ath9k-devel] Set vendor specific element ID in probe request Amith Belur
@ 2012-06-11 14:24 ` Wojciech Dubowik
2012-06-11 14:33 ` Wojciech Dubowik
0 siblings, 1 reply; 5+ messages in thread
From: Wojciech Dubowik @ 2012-06-11 14:24 UTC (permalink / raw)
To: ath9k-devel
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [ath9k-devel] Set vendor specific element ID in probe request
2012-06-11 14:24 ` Wojciech Dubowik
@ 2012-06-11 14:33 ` Wojciech Dubowik
2012-06-17 19:51 ` Amith Belur
0 siblings, 1 reply; 5+ messages in thread
From: Wojciech Dubowik @ 2012-06-11 14:33 UTC (permalink / raw)
To: ath9k-devel
I have got confused myself. It should be probe request and not probe
response.
Mechanism is same but you need to modify ieee80211_probereq_get in tx.c
Br,
Wojtek
> 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
>
>
>
> _______________________________________________
> 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/e6869b6a/attachment-0001.htm
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ath9k-devel] Set vendor specific element ID in probe request
2012-06-11 14:33 ` Wojciech Dubowik
@ 2012-06-17 19:51 ` Amith Belur
2012-06-17 19:58 ` Amith Belur
0 siblings, 1 reply; 5+ messages in thread
From: Amith Belur @ 2012-06-17 19:51 UTC (permalink / raw)
To: ath9k-devel
Hello Wojciech,
Have you modified ieee80211_bss_conf adding vendor_data_oui? I don't find
this.
On Mon, Jun 11, 2012 at 4:33 PM, Wojciech Dubowik <
Wojciech.Dubowik@neratec.com> wrote:
> I have got confused myself. It should be probe request and not probe
> response.
> Mechanism is same but you need to modify ieee80211_probereq_get in tx.c
>
> Br,
> Wojtek
>
> 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 listath9k-devel at lists.ath9k.orghttps://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
>
>
>
> _______________________________________________
> ath9k-devel mailing listath9k-devel at lists.ath9k.orghttps://lists.ath9k.org/mailman/listinfo/ath9k-devel
>
>
>
--
Best Regards,
Amith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120617/a970c14d/attachment.htm
^ permalink raw reply [flat|nested] 5+ messages in thread
* [ath9k-devel] Set vendor specific element ID in probe request
2012-06-17 19:51 ` Amith Belur
@ 2012-06-17 19:58 ` Amith Belur
0 siblings, 0 replies; 5+ messages in thread
From: Amith Belur @ 2012-06-17 19:58 UTC (permalink / raw)
To: ath9k-devel
Sorry for the oversight. I missed the initial part of the reply!
On Sun, Jun 17, 2012 at 9:51 PM, Amith Belur <amithbn@gmail.com> wrote:
> Hello Wojciech,
>
> Have you modified ieee80211_bss_conf adding vendor_data_oui? I don't find
> this.
>
> On Mon, Jun 11, 2012 at 4:33 PM, Wojciech Dubowik <
> Wojciech.Dubowik at neratec.com> wrote:
>
>> I have got confused myself. It should be probe request and not probe
>> response.
>> Mechanism is same but you need to modify ieee80211_probereq_get in tx.c
>>
>> Br,
>> Wojtek
>>
>> 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 listath9k-devel at lists.ath9k.orghttps://lists.ath9k.org/mailman/listinfo/ath9k-devel
>>
>>
>>
>>
>> _______________________________________________
>> ath9k-devel mailing listath9k-devel at lists.ath9k.orghttps://lists.ath9k.org/mailman/listinfo/ath9k-devel
>>
>>
>>
>
>
> --
> Best Regards,
> Amith
>
>
--
Best Regards,
Amith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20120617/9ae387db/attachment-0001.htm
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-06-17 19:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-11 11:07 [ath9k-devel] Set vendor specific element ID in probe request Amith Belur
2012-06-11 14:24 ` Wojciech Dubowik
2012-06-11 14:33 ` Wojciech Dubowik
2012-06-17 19:51 ` Amith Belur
2012-06-17 19:58 ` Amith Belur
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.