+static const MII_field_desc_t reg_4_desc_tbl[] = {
+ { 15, 15, 0x01, "next page able" },
+ { 14, 14, 0x01, "reserved" },
+ { 13, 13, 0x01, "remote fault" },
+ { 12, 12, 0x01, "reserved" },
+ { 11, 11, 0x01, "asymmetric pause" },
+ { 10, 10, 0x01, "pause enable" },
+ { 9, 9, 0x01, "100BASE-T4 able" },
+ { 8, 8, 0x01, "100BASE-TX full duplex able" },
+ { 7, 7, 0x01, "100BASE-TX able" },
+ { 6, 6, 0x01, "10BASE-T full duplex able" },
+ { 5, 5, 0x01, "10BASE-T able" },
+ { 4, 0, 0x1f, "xxx to do" },
+};
+
+static const MII_field_desc_t reg_5_desc_tbl[] = {
+ { 15, 15, 0x01, "next page able" },
+ { 14, 14, 0x01, "acknowledge" },
+ { 13, 13, 0x01, "remote fault" },
+ { 12, 12, 0x01, "(reserved)" },
+ { 11, 11, 0x01, "asymmetric pause able" },
+ { 10, 10, 0x01, "pause able" },
+ { 9, 9, 0x01, "100BASE-T4 able" },
+ { 8, 8, 0x01, "100BASE-X full duplex able" },
+ { 7, 7, 0x01, "100BASE-TX able" },
+ { 6, 6, 0x01, "10BASE-T full duplex able" },
+ { 5, 5, 0x01, "10BASE-T able" },
+ { 4, 0, 0x1f, "xxx to do" },
+};
+typedef struct _MII_field_desc_and_len_t {
+ const MII_field_desc_t *pdesc;
+ ushort len;
+} MII_field_desc_and_len_t;
+
+static const MII_field_desc_and_len_t desc_and_len_tbl[] = {
+ { reg_0_desc_tbl, ARRAY_SIZE(reg_0_desc_tbl) },
+ { reg_1_desc_tbl, ARRAY_SIZE(reg_1_desc_tbl) },
+ { reg_2_desc_tbl, ARRAY_SIZE(reg_2_desc_tbl) },
+ { reg_3_desc_tbl, ARRAY_SIZE(reg_3_desc_tbl) },
+ { reg_4_desc_tbl, ARRAY_SIZE(reg_4_desc_tbl) },
+ { reg_5_desc_tbl, ARRAY_SIZE(reg_5_desc_tbl) },
+};
+
+static void dump_reg(
+ ushort regval,
+ const MII_reg_desc_t *prd,
+ const MII_field_desc_and_len_t *pdl);
+
+static int special_field(
+ ushort regno,
+ const MII_field_desc_t *pdesc,
+ ushort regval);
+
+static void MII_dump_0_to_5(
+ ushort regvals[6],
+ uchar reglo,
+ uchar reghi)