Shiva,
Short answer:
If VLAN or 802.1q header are specified in outgoing NBL’s OOB, use it
instead of the one statically configured in advanced page by user.
Long answer:
This is the case that the system has teaming driver who explicitly tells
the miniport to use this tag for given packet(s).
The outgoing VLAN IDs come from 3 sources if I recall correctly 1) OOB, 2)
OID_GEN_VLAN_ID and 3) Registry.
They are valid if they are non-zero. In the event you have too many of them
at a time, the #1 wins.
Don’t tag the packet with both. Yes, there are networking technologies
that make use of multiple VLAN tags, but certainly not this case. I
personally found the static VLAN ID configuration useless, annoying and
confusing.
Good luck!
Calvin
On Tue, Aug 28, 2012 at 9:00 PM, wrote:
> Hi Calvin, Thanks for your reply.
> I am writing miniport driver for windows 7 OS. I understood your pseudo
> code. And my question is if the OS stack send the packet with some vlan id,
> is that indicated in NBL OOB data or tag header? If it is indicated in OOB
> data and my vlan_enabled, which vlan id should i consider in-order to tell
> to my HW.
> If i enable Vlan packets through PackEth tool and my vlan_enabled is also
> present, the packets are tagging with two vlan id’s (Observed in
> Wireshark). Is this a correct way?
>
> Thanks,
> Shiva
>
> For basic VLAN support at miniport level, and if your NIC supports HW
> tagging, do the following as illustrated in the pseudo code.
>
> For any other value added fancy multi-tag VLAN, priority support, you need
> an NDIS intermediate driver. After all, all participating stations,
> switches, routers need to be configured consistently and correctly in order
> for VLAN to work.
>
> pseudo code for basic VLAN support at miniport level:
> nic_init()
> {
> if (vlan_enabled && vlan_tag) /* both read from registry during
> mp_init()/
> {
> / VLAN tag will be DMA’d to somewhere so that the driver will
> find out*/
> init_the_chip_to_strip_off_vlan_tag_on_rx_pkts_if_any();
> }
> }
>
> send_nbl_down()
> {
> if (vlan_enabled && vlan_tag) /* both read from registry during
> mp_init()/
> {
> tell_hw_to_insert_vlan_tag_to_the_pkt();
> }
> xmit();
> }
> scan_rx_pkts()
> {
> if (vlan_enabled && vlan_tag) / both read from registry during
> mp_init()*/
> {
> /VLAN tag should have been stripped off by hw, and DMA’d to
> somewhere/
> read_vlan_tag_and_set_nbl_oob();
> }
> shoot_nbl_up();
> }
> Good luck,
> Calvin
>
> On Tue, Aug 28, 2012 at 8:46 AM, wrote:
>
> > Hi,
> > I am writing ndis mini port driver 6.0. I want to handle the VLAN
> > packets in that. How the windows OS will insert vlan tags into packet and
> > at what condition miniport driver should add the vlan id to the packet.
> > When enable vlan in my driver, vlan id is inserting into tag header but
> > other side pc is unable to reply to my request (packet has a vlan id).
> >
> > Also while receiving should i remove the vlan id from the packet and send
> > to host or will i need to send as it is the packet to OS. What i observed
> > is when i send the vlan id by inserting through the NDIS_PACKET_INFO for
> <…excess quoted lines suppressed…>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>