---
name: "mdioblock"
section: "1"
platform: "linux"
package: "plc-utils-extra"
version: "0.0.6+git20250517.7fb8ac5-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mdioblock"
---

# mdioblock(1)

Qualcomm Atheros Clause 22 MDIO Instruction Block Assembler

## NAME

mdioblock - Qualcomm Atheros Clause 22 MDIO Instruction Block Assembler

## SYNOPSIS

**mdioblock** \[*options*\] *file* \[*file*\] \[*...*\] \[\>*stdout*\]

**mdioblock** \[*options*\] \[\<*stdin*\] \[\>*stdout*\]

## DESCRIPTION

Assemble an Atheros MDIO instruction block from hexadecimal register instructions. MDIO instruction blocks are written to Atheros powerline devices as modules using the **VS\_MOD\_OP** message type. Alternately, program **int6kmod** can be used.

Atheros MDIO modules consists of a 16-bit header followed by one or more MDIO communication frames with register masks and padded to the nearest multiple of 32-bits for download purposes. MDIO instructions are specified here using **802.3 Clause 22** (or *phy*, *reg*, *data* and *mask*) format. See program **mdioblock2** for a similar program that accepts instructions in **802.3ae Clause 45** (or *address*, *data* and *mask*) format.

This program is part of the Qualcomm Atheros Powerline Toolkit. See the **AMP** man page for an overview and installation instructions.

## OPTIONS

- \-**q**

  Quiet mode. Suppresses error messages caused by instruction syntax errors.

- \-**v**

  Verbose mode. Prints instructions on stderr as they are processed.

- \-**?**,--**help**

  Displays program help information on stderr. This option takes precedence over all other options on the command line except version information.

- \-**!**,--**version**

  Displays program version information on stderr. This option takes precedence over all other options on the command line except help information. Use this option when sending screen dumps to Atheros technical staff.

## ARGUMENTS

- *file*

  A text files contining one or more generic MDIO register intructions consisting of a **phy**, **reg**, **data** and **mask** fields. Fields are seperated by whitespace and instructions are terminated with 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.

## REFERENCES

See the Qualcomm Atheros *AR7x00 Firmware Technical Reference Manual* section on the *Module Operation* message type for more information on MDIO Block format.

## DISCLAIMER

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. Qualcomm Atheros reserves the right to modify message structure and content in future firmware releases without any obligation to notify or compensate users of this program.

## EXAMPLES

The following command reads register instructions from file **mdio.txt** and writes them as an MDIO program block to file **mdio.bin**. In this example, the program acts as a filter.

   \# mdioblock \< mdio.txt \> mdio.bin

The following command reads register instructions from files **physetup.dat**, **flowctl.dat** and **misc.ins** and write them all as one MDIO block to file **mdio.bin**. The previous contents of file **mdio.bin** is overwritten.

   \# mdioblock physetup.dat flowctl.dat misc.ins \> mdio.bin

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 instruction 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. The application of these fields is beyond the scope of this man page. Consult the IEEE standards for more information.

   \# 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

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.

   \# 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

**amp**(**1**), **int6kmod**(**1**), **int6kmdio**(**1**), **int6kmdio2**(**1**), **mdioblock2**(**1**), **mdiodump**(**1**), **mdiogen**(**1**)

## CREDITS

Charles Maier
