All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] Set vendor specific element ID in probe request
Date: Mon, 11 Jun 2012 16:33:13 +0200	[thread overview]
Message-ID: <4FD601A9.5000709@neratec.com> (raw)
In-Reply-To: <4FD5FF9C.8050407@neratec.com>

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 

  reply	other threads:[~2012-06-11 14:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2012-06-17 19:51     ` Amith Belur
2012-06-17 19:58       ` Amith Belur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FD601A9.5000709@neratec.com \
    --to=wojciech.dubowik@neratec.com \
    --cc=ath9k-devel@lists.ath9k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.