* Read VLAN Tag in mac80211
@ 2014-01-17 16:26 Dani Camps
2014-01-20 9:35 ` voncken
0 siblings, 1 reply; 3+ messages in thread
From: Dani Camps @ 2014-01-17 16:26 UTC (permalink / raw)
To: linux-wireless
Dear all,
I am having trouble reading a VLAN tag inside mac80211. I believe the tag is in the packet because I can see it in wireshark. This is a simple test code that I am using in tx.c:
#include <linux/if_vlan.h>
...
unsigned short TCI;
unsigned short id;
...
// Checking if VLAN tag is present
if(vlan_tx_tag_present(skb)){
TCI = vlan_tx_tag_get (skb);
id = TCI & VLAN_VID_MASK;
printk ("VLAN detection: Detected frame with VLAN ID = %x \n", id);
}
else{
printk ("VLAN detection: No VLAN Tag detected but skb->vlan_tci is %x \n", skb->vlan_tci);
}
The previous code always fails to enter the VLAN present case, and goes to the else condition printing a skb->vlan_tci value of zero, whereas I can see in wireshark a frame with a VLAN tag and VLAN ID=1.
Can anyone help me figure out what I am missing here?
Best Regards
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Read VLAN Tag in mac80211
2014-01-17 16:26 Read VLAN Tag in mac80211 Dani Camps
@ 2014-01-20 9:35 ` voncken
0 siblings, 0 replies; 3+ messages in thread
From: voncken @ 2014-01-20 9:35 UTC (permalink / raw)
To: 'Dani Camps', linux-wireless
The VLAN tag is moved from frame to the field skb->vlan_tci by the
input netdev.
In your case, if vlan_tci is always equal to 0, I think your driver
do not support the VLAN, or you need to enable it.
You can have more information from netdev mailing list.
Cedric Voncken
> -----Message d'origine-----
> De : linux-wireless-owner@vger.kernel.org [mailto:linux-wireless-
> owner@vger.kernel.org] De la part de Dani Camps
> Envoyé : vendredi 17 janvier 2014 17:27
> À : linux-wireless@vger.kernel.org
> Objet : Read VLAN Tag in mac80211
>
>
>
> Dear all,
>
> I am having trouble reading a VLAN tag inside mac80211. I believe the tag
is
> in the packet because I can see it in wireshark. This is a simple test
code that
> I am using in tx.c:
>
> #include <linux/if_vlan.h>
>
> ...
> unsigned short TCI;
> unsigned short id;
> ...
>
> // Checking if VLAN tag is present
> if(vlan_tx_tag_present(skb)){
> TCI = vlan_tx_tag_get (skb);
> id = TCI & VLAN_VID_MASK;
> printk ("VLAN detection: Detected frame with VLAN ID = %x
\n", id);
> }
> else{
> printk ("VLAN detection: No VLAN Tag detected but
skb->vlan_tci is
> %x \n", skb->vlan_tci);
> }
>
> The previous code always fails to enter the VLAN present case, and goes to
> the else condition printing a skb->vlan_tci value of zero, whereas I can
see in
> wireshark a frame with a VLAN tag and VLAN ID=1.
>
> Can anyone help me figure out what I am missing here?
>
> Best Regards
>
> Daniel
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless"
in the
> body of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Read VLAN Tag in mac80211
@ 2014-01-18 9:02 Dani Camps
0 siblings, 0 replies; 3+ messages in thread
From: Dani Camps @ 2014-01-18 9:02 UTC (permalink / raw)
To: linux-wireless
Dear all,
I am having trouble reading a VLAN tag inside mac80211. I believe the tag is in the packet because I can see it in wireshark. This is a simple test code that I am using in tx.c:
#include <linux/if_vlan.h>
...
unsigned short TCI;
unsigned short id;
...
// Checking if VLAN tag is present
if(vlan_tx_tag_present(skb)){
TCI = vlan_tx_tag_get (skb);
id = TCI & VLAN_VID_MASK;
printk ("VLAN detection: Detected frame with VLAN ID = %x \n", id);
}
else{
printk ("VLAN detection: No VLAN Tag detected but skb->vlan_tci is %x \n", skb->vlan_tci);
}
The previous code always fails to enter the VLAN present case, and goes to the else condition printing a skb->vlan_tci value of zero, whereas I can see in wireshark a frame with a VLAN tag and VLAN ID=1.
Can anyone help me figure out what I am missing here?
Best Regards
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-20 9:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-17 16:26 Read VLAN Tag in mac80211 Dani Camps
2014-01-20 9:35 ` voncken
2014-01-18 9:02 Dani Camps
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.