mdioblock(1)
π mdioblock(1) β the Qualcomm Atheros Clause 22 MDIO Instruction Block Assembler π
okay bestie, sit down, hydrate, because this one is a little iconic. this is the mdioblock page from the Qualcomm Atheros Open Powerline Toolkit, and it's here to teach you how to smash a pile of hex register instructions into a single MDIO instruction block. no cap.
β¨ NAME β¨
mdioblock β Qualcomm Atheros Clause 22 MDIO Instruction Block Assembler π οΈ
πΈ SYNOPSIS πΈ
mdioblock [options] file [file] [...] [>stdout]
mdioblock [options] [<stdin] [>stdout]
like, either you hand it files or you pipe stuff in. either way it's giving assembler energy.
π¦ DESCRIPTION π¦
So basically: this program assembles an Atheros MDIO instruction block out of hexadecimal register instructions. Those MDIO instruction blocks get written to Atheros powerline devices as modules using the VS_MOD_OP message type. And if that's not your vibe, you can also use the program int6kmod instead. options, bestie. we love options. π
Atheros MDIO modules are built like this: a 16-bit header, followed by one or more MDIO communication frames with register masks, and then padded to the nearest multiple of 32-bits so it can be downloaded. here you write the MDIO instructions using 802.3 Clause 22 format (that's phy, reg, data and mask, iykyk). and hey β if you want a similar program that accepts instructions in 802.3ae Clause 45 format instead (that's address, data and mask), go look at mdioblock2. twin behavior fr fr.
This program is part of the Qualcomm Atheros Powerline Toolkit. For the whole overview plus installation instructions, check out the AMP man page. π«Ά
π OPTIONS π
-qβ Quiet mode. It suppresses the error messages that come from instruction syntax errors. shhh. π€«-vβ Verbose mode. Prints instructions onstderras they get processed. nosy but make it useful.-?,--helpβ Displays program help information onstderr. This option takes precedence over all other options on the command line β except version information. it's the main character of the command line. π-!,--versionβ Displays program version information onstderr. This option takes precedence over all other options on the command line β except help information. Use this one when you're sending screen dumps to Atheros technical staff. πΈ
π ARGUMENTS π
fileβ A text file containing one or more generic MDIO register instructions, made up of a phy, reg, data and mask field. Fields are separated by whitespace and instructions are terminated with a semicolon. Multiple instructions may appear on a single line, or a single instruction can span multiple lines. Script-style comments are permitted between instructions β but not between fields. ngl that last part matters, don't test it.
π₯ REFERENCES π₯
For more info on the MDIO Block format, go read the Qualcomm Atheros AR7x00 Firmware Technical Reference Manual, specifically the section on the Module Operation message type. it's giving required reading. π
β οΈ DISCLAIMER β οΈ
okay this is the serious part, pay attention bestie. The Atheros HomePlug AV Vendor Specific Management Message structure and content is proprietary to Qualcomm Atheros, Ocala FL USA. Consequently, public information may not be available. And Qualcomm Atheros reserves the right to modify the message structure and content in future firmware releases without any obligation to notify or compensate users of this program. so yeah. read that again. π
π EXAMPLES π
First up: this command reads register instructions from the file mdio.txt and writes them as an MDIO program block to the file mdio.bin. In this example the program is acting as a filter. β¨
# mdioblock < mdio.txt > mdio.bin
Next: this command reads register instructions from the files physetup.dat, flowctl.dat and misc.ins, and writes them all as one MDIO block to the file mdio.bin. Heads up β the previous contents of mdio.bin get overwritten. π«£
# mdioblock physetup.dat flowctl.dat misc.ins > mdio.bin
And an example register instruction file might look like this. The first two lines consist of one instruction each. An instruction has phy, reg, data and mask fields. Instruction fields are separated by whitespace. Instructions are separated by a semicolon. Multiple instructions may appear on one line, and one instruction can span multiple lines. Script-style comments are permitted between instructions but not between instruction fields.
18 00 0000 FFFF;
10 16 003F FFFF;
# multiple instructions on one line;
10 17 7E3F FFFF; 18 00 0000 FFFF;
# one instruction on multiple lines;
10
02
0700
FFFF;
10 03 0000 FFFF;
18 00 0000 FFFF;
14 00 007D FFFF;
14 01 0000 FFFF;
A 16-bit hexdump of the MDIO block will look like this on little-endian hosts. The block consists of a 16-bit header followed by a variable number of 16-bit triplets. The header indicates the number of triplets that follow. Each triplet specifies a 16-bit operation, a 16-bit data value and a 16-bit data mask. What you actually do with those fields is beyond the scope of this man page β consult the IEEE standards for more info. π§
# hexdump mdio.bin
0000000 0241 8185 0000 ffff ad05 003f ffff af05
0000010 7e3f ffff 8185 0000 ffff 8505 0700 ffff
0000020 8705 0000 ffff 8185 0000 ffff 8145 007d
0000030 ffff 8345 0000 ffff
And an 8-bit dump of the MDIO block will look like this on all hosts, since the MDIO block is always distributed in little-endian format. consistent queen. π
# hexdmp mdio.bin
00000000 41 02 85 81 00 00 FF FF 05 AD 3F 00 FF FF 05 AF
A.........?.....
00000010 3F 7E FF FF 85 81 00 00 FF FF 05 85 00 07 FF FF
?~..............
00000020 05 87 00 00 FF FF 85 81 00 00 FF FF 45 81 7D 00
............E.}.
00000030 FF FF 45 83 00 00 FF FF ..E.....
π SEE ALSO π
the whole friend group, honestly. π«Ά
β CREDITS β
Charles Maier
and that's the whole page, bestie β this one came out of open-plc-utils-0.0.3 and it's dated November 2013, so go forth and assemble those blocks. slay, no cap, periodt. πβ¨π
π¦ where this page comes from
- alpine 3.24: open-plc-utils-doc 0_git20250712-r1 Β· BSD-3-Clause-Clear
- debian bookworm: plc-utils-extra 0.0.6+git20230504.1ba7d5a0-1 Β· BSD-3
- debian trixie: plc-utils-extra 0.0.6+git20250517.7fb8ac5-1 Β· BSD-3
- ubuntu noble: plc-utils-extra 0.0.6+git20230504.1ba7d5a0-1 Β· BSD-3
- ubuntu questing: plc-utils-extra 0.0.6+git20250517.7fb8ac5-1
- ubuntu resolute: plc-utils-extra 0.0.6+git20250712.46c3506-1 Β· BSD-3
- ubuntu stonking: plc-utils-extra 0.0.6+git20250712.46c3506-1 Β· BSD-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms