Your message dated Fri, 02 Oct 2020 10:04:10 +0000 with message-id <[email protected]> and subject line Bug#549397: fixed in net-tools 1.60+git20181103.0eebece-1 has caused the Debian Bug report #549397, regarding mii-tool decodes MII vendor ids wrongly to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 549397: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=549397 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: net-tools Version: 1.60-23 Severity: normal Tags: patch The MII specification (IEEE 802.3 clause 22) specifies the PHY id registers to hold the vendor id (OUI) in reverse bit order. Many PHYs have the bytes in reverse order but the bits in normal order, and this is what mii-tool expects. However, recent PHYs from at least AMCC, Broadcom and Solarflare use the specified bit order and mii-tool should follow this. This patch changes mii-tool to decode the OUI according to both interpretations. --- net-tools-1.60.orig/mii-tool.c +++ net-tools-1.60/mii-tool.c @@ -224,6 +224,14 @@ return buf; } +static unsigned char bitreverse_byte(unsigned char byte) +{ + byte = (byte << 4) | (byte >> 4); + byte = (byte & 0x33) << 2 | (byte & 0xcc) >> 2; + byte = (byte & 0x55) << 1 | (byte & 0xaa) >> 1; + return byte; +} + int show_basic_mii(int sock, int phy_id) { char buf[100]; @@ -297,11 +305,31 @@ break; if (i < NMII) printf("%s rev %d\n", mii_id[i].name, mii_val[3]&0x0f); - else - printf("vendor %02x:%02x:%02x, model %d rev %d\n", + else { + /* Each OUI consists of 24 bits a-z of which a and b are + * always assigned as zero. The bit assignments in these + * registers are specified as: + * 2.15-0 c-r + * 3.15-10 s-x + * This is the opposite of the bit order within each byte + * for the written representation specified in section + * 9.5.2 of IEEE 802-2001. However, some vendors mirror + * the written representation, using the bit assignments: + * 2.15-10 f-a (?) + * 2.9-2 p-i + * 2.1-0 x-w + * 3.15-10 v-q + * Therefore we decode the registers under both + * interpretations. + */ + printf("vendor %02x:%02x:%02x or %02x:%02x:%02x, model %d rev %d\n", + bitreverse_byte(mii_val[2]>>10), + bitreverse_byte(mii_val[2]>>2), + bitreverse_byte((mii_val[2]<<6)|(mii_val[3]>>10)), mii_val[2]>>10, (mii_val[2]>>2)&0xff, ((mii_val[2]<<6)|(mii_val[3]>>10))&0xff, (mii_val[3]>>4)&0x3f, mii_val[3]&0x0f); + } printf(" basic mode: "); if (bmcr & MII_BMCR_RESET) printf("software reset, "); --- END --- -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental') Architecture: i386 (x86_64) Kernel: Linux 2.6.30-2-amd64 (SMP w/2 CPU cores) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages net-tools depends on: ii libc6 2.9-26 GNU C Library: Shared libraries net-tools recommends no packages. net-tools suggests no packages. -- debconf-show failed
--- End Message ---
--- Begin Message ---Source: net-tools Source-Version: 1.60+git20181103.0eebece-1 Done: Utkarsh Gupta <[email protected]> We believe that the bug you reported is fixed in the latest version of net-tools, which is due to be installed in the Debian FTP archive. A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to [email protected], and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Utkarsh Gupta <[email protected]> (supplier of updated net-tools package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing [email protected]) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Format: 1.8 Date: Fri, 02 Oct 2020 15:01:04 +0530 Source: net-tools Architecture: source Version: 1.60+git20181103.0eebece-1 Distribution: unstable Urgency: medium Maintainer: net-tools Team <[email protected]> Changed-By: Utkarsh Gupta <[email protected]> Closes: 549397 621752 653117 812886 Changes: net-tools (1.60+git20181103.0eebece-1) unstable; urgency=medium . * New upstream version 1.60+git20181103.0eebece - Fix nstrcmp() to prevent ifconfig from showing duplicate interfaces. (Closes: #812886) * Fix d/watch to point to upstream git repository * Add patch to fix decoding of MII vendor ids. (Closes: #549397) - Thanks, Ben Hutchings, for the patch. * Add patch to fix Japanese translation which uses a wrong Kanji character. (Closes: #621752) - Thanks, Takeshi Hamasaki, for the patch. * Add patch to fix wrong indentation of "collisions" in the Japanese translation. (Closes: #653117) - Thanks, NODA, Kai, for the patch. * Fix Uploaders' field. - Add myself as an uploader. - Fix Tina's details. Checksums-Sha1: a0c6d9d90713e0b150e1d82fb15f9005a2e51473 2142 net-tools_1.60+git20181103.0eebece-1.dsc 29ea41401bebf746b11c237f0e8ffce28f7f7759 197516 net-tools_1.60+git20181103.0eebece.orig.tar.xz d24e162ea83be80d7f6dd93317414bea6aff5a1a 57356 net-tools_1.60+git20181103.0eebece-1.debian.tar.xz 217463c1f5ae199e2e00ba4ad8bc1f9c32d098d3 6243 net-tools_1.60+git20181103.0eebece-1_amd64.buildinfo Checksums-Sha256: e1050dd87be399ee55fd449954633d9906171a81dce0ac385a82f8a9f98a1651 2142 net-tools_1.60+git20181103.0eebece-1.dsc ab56d30a5e40444083c67cb3940e42ad554f99ae38e027d30c30487b2b7820aa 197516 net-tools_1.60+git20181103.0eebece.orig.tar.xz ff1e1cbd0cbde95eb97a25fb00e5b04c13cc16010b31eb02b0397ed7420aa890 57356 net-tools_1.60+git20181103.0eebece-1.debian.tar.xz 6873fa68239dc0acfc4e7ee64350e07ae7e524972b5fd4aaad223b9537179302 6243 net-tools_1.60+git20181103.0eebece-1_amd64.buildinfo Files: 6ef46b1a0885a30de2a46801c353dfbd 2142 net important net-tools_1.60+git20181103.0eebece-1.dsc 06067b9254dbd34db95400ec61272949 197516 net important net-tools_1.60+git20181103.0eebece.orig.tar.xz 29e06c2d7db511a5c003897e07536d45 57356 net important net-tools_1.60+git20181103.0eebece-1.debian.tar.xz bd9cc35d98df080dcb35e057adabfd91 6243 net important net-tools_1.60+git20181103.0eebece-1_amd64.buildinfo -----BEGIN PGP SIGNATURE----- iQJHBAEBCAAxFiEEbJ0QSEqa5Mw4X3xxgj6WdgbDS5YFAl929igTHHV0a2Fyc2hA ZGViaWFuLm9yZwAKCRCCPpZ2BsNLltddEACnP50nIFMY22GlbqQw2lkxqBMbniUd zqt/q1RfVTufJrV2sFJeWmKvrg9INmTo4mSYJkJDqX1kyrM0CAKtYurQJU5eQ5Ti 17tpxahq/1tI+NPoIOEfRsYhZ8g6zkMKh2vlVu9ylQ3kkLsAsHcbfZVpniia7Z53 hIo9TNu9FLpbXo9TKOWAyOk2W7dZd+8YVPlQQrD7OBwzZXsS+Rwc9JX2CSzd18VW Sx3z/+up/XcZsQ43QZU09VRN4+FE+7fFk9TezZreRCfLWH2l2cgYNwrwgRaCxWeB TQDhylmJvQ1iMcu40yceCQlHu29fql5dWh0OcD7dqIsbSXaQSEqViSat3cmiKaHA +C1y04k73O6Ynd5R38whKQDRBuJDmhAXQ4VlJrdiGU425mliItIvoA2ex3iaPWOR +1MUOqn4IBQU317k3xJ8SvOC7AkGkJulWHvJDkyKlh2BdyhpLpGU6qq8G+gxsDh5 foqoVKXF9b+Ei/LY6PQQWjYe/Ez9oWV3XoUesQYkCnDmXfmCKskOZdIC+tsQFCS+ JJroF6I5Q8G22tdJniHFgsI4mx3da3V0yFzoFRYfIdNf0LKM0PptiTwfpc9C7FC+ m+lHk+E/yHIPhiQj0+YHQTM+XUtkmeDxQPl4XN9dygMauPCbp+3vXQb6pA/qYRAJ 6yX5rRhrjiwBsg== =ApCl -----END PGP SIGNATURE-----
--- End Message ---

