mii_bmcr_encode_fixed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mii_bmcr_encode_fixed β€” the Kernel API Manual moment

okay so bestie, welcome to mii_bmcr_encode_fixed(9), part of the Kernel API Manual, and honestly this one is short but it does the thing. Let's get into it πŸŽ€


✨ NAME ✨

mii_bmcr_encode_fixed β€” encodes fixed speed/duplex settings into a BMCR value. that's it, that's the job, and it does it slayfully πŸ’–


🌸 SYNOPSIS 🌸

u16 mii_bmcr_encode_fixed (int speed , int duplex );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • speed β€” a SPEED_* value. yep, one of those 🫢
  • duplex β€” a DUPLEX_* value. also one of those ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

So what this icon does is encode the speed and the duplex into a single BMCR value. one value. two things going in. it's giving efficiency, fr fr πŸ’…

Speeds 2500, 1000, 100 and 10 Mbps are supported. that's the whole guest list.

Now, the little plot twist: 2500 Mbps gets encoded to 1000 Mbps. not a typo, that's just how it goes 😭

Other speeds β€” the ones not on the list β€” get encoded as 10 Mbps. so like, unknown speed? you're getting 10. no cap.

And duplex? Unknown duplex values get encoded to half-duplex. so if it's not a duplex value we recognise, it's going half. periodt 🧚

ngl, if you're passing in something weird, this function has opinions and it will make a decision for you. it's not asking. it's telling 🌈

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/linux/mii.h β€” and honestly the whole friend group, all of them, here we go:

that's the whole group chat, go read them too πŸ’œ


okay that's the page!! πŸŽ€ and for the cute sign-off: this one lives under ./include/linux, dated October 2026, and it's mii_bmcr_encode_fixed(9) β€” kudos to the kernel crew, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from