mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/5] miitool: drop internal table of known MII, use phy drivers instead
Date: Wed, 25 Dec 2013 11:50:03 +0400	[thread overview]
Message-ID: <1387957805-1532-4-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1387957805-1532-1-git-send-email-antonynpavlov@gmail.com>

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 commands/miitool.c | 30 +++++-------------------------
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/commands/miitool.c b/commands/miitool.c
index 6e8ae80..63feca8 100644
--- a/commands/miitool.c
+++ b/commands/miitool.c
@@ -41,17 +41,6 @@
 #include <linux/phy.h>
 #include <linux/err.h>
 
-
-/* Table of known MII's */
-static const struct {
-	u_short	id1, id2;
-	u_short	mask1, mask2;
-	char	*name;
-} mii_id[] = {
-	{ 0x0013, 0x78e0, 0xffff, 0xfff0, "Level One LXT971A" },
-};
-#define NMII (sizeof(mii_id)/sizeof(mii_id[0]))
-
 const struct {
 	char	*name;
 	u_short	value[2];
@@ -189,20 +178,11 @@ static int show_basic_mii(struct mii_bus *mii, struct phy_device *phydev,
 	}
 
 	if (verbose) {
-		printf("  product info: ");
-		for (i = 0; i < NMII; i++)
-			if ((mii_id[i].id1 == (mii_val[2] & mii_id[i].mask1)) &&
-				(mii_id[i].id2 ==
-					(mii_val[3] & mii_id[i].mask2)))
-				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",
-				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("  product info: %s ", phydrv->drv.name);
+		printf("(vendor %02x:%02x:%02x, model %d rev %d)\n",
+			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 & BMCR_RESET)
-- 
1.8.5.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-12-25  7:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-25  7:50 [PATCH 0/5] miitool patches Antony Pavlov
2013-12-25  7:50 ` [PATCH 1/5] miitool: change behaviour closer to linux' mii-tool Antony Pavlov
2014-01-06  8:52   ` Sascha Hauer
2013-12-25  7:50 ` [PATCH 2/5] miitool: add initial GbE support Antony Pavlov
2013-12-25  7:50 ` Antony Pavlov [this message]
2013-12-25  7:50 ` [PATCH 4/5] net/phy: add driver for LXT PHYs Antony Pavlov
2013-12-25  7:50 ` [PATCH 5/5] net/phy/phy.c: fix whitespace Antony Pavlov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1387957805-1532-4-git-send-email-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox