rhine_get_vlan_tci(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… rhine_get_vlan_tci(9) β€” bestie edition 🌸

okay so this is a page from the Kernel API Manual and it's about one (1) little function that pulls a VLAN TCI out of your Rx buffer. it's giving "small but essential" energy and honestly? we're obsessed πŸ’–


✨ NAME ✨

rhine_get_vlan_tci β€” extract TCI from Rx data buffer πŸ‘‘

like literally, that's the whole job. it reaches into your receive data buffer and pulls the TCI out. no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

u16 rhine_get_vlan_tci (struct sk_buff *skb , int data_size );

it returns a u16 (that's the TCI, bestie πŸŽ€) and it takes two things. that's it. that's the whole signature.


πŸŽ€ ARGUMENTS πŸŽ€

  • skb β€” pointer to sk_buff πŸ’« your classic socket buffer pointer, main character of the networking world, we stan
  • data_size β€” the used data area of the buffer, including the CRC ⭐ don't forget the CRC is in there, it's part of the count, iykyk

🌈 DESCRIPTION 🌈

so here's the vibe check 🧚 β€” if hardware VLAN tag extraction is enabled, and the chip says "hey this is a 802.1Q packet", then the extracted 802.1Q header lands in a very specific spot:

  • it's 2 bytes TPID + 2 bytes TCI (that's the header, 4 bytes total, cute)
  • it's 4-byte aligned
  • and it comes following the CRC πŸ”₯

so like. TPID, TCI, aligned to 4, sitting right after the CRC. that's the whole layout. periodt. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

go read the kernel file ./drivers/net/ethernet/via/via-rhine.c β€” it's the source of truth, fr fr πŸ“– and while you're in there, these are all siblings / besties in the same driver family 🫢

all of them. every single one. no skipping πŸ’€


mwah πŸ’œ that's the page!! huge shoutout to the ./drivers/net/ethernet/via crew for hosting this whole thing and to October 2026 for the timestamp β€” slay, see u next revision 🌟

πŸ“¦ where this page comes from