Thread (7 messages) 7 messages, 3 authors, 2005-08-22

Re: [PATCH: 2.6.12-rc1] mii: Add test for GigE support

From: Andy Fleming <hidden>
Date: 2005-03-23 01:21:56

On Mar 22, 2005, at 17:27, Jeff Garzik wrote:
quoted
 +int mii_check_gmii_support(struct mii_if_info *mii)
+{
+	int reg;
+
+	reg = mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR);
+	if (reg & BMSR_HAS_EXTSTAT1000) {
+		reg = mii->mdio_read(mii->dev, mii->phy_id, MII_EXTSTAT1000);
+		if (reg & (ESR_1000_BASE_X_FD | ESR_1000_BASE_T_FD |
+			   ESR_1000_BASE_X_HD | ESR_1000_BASE_T_HD))
+			return 1;
+	}
+
+	return 0;
2) Reading a non-existent register will return all 1's in most cases, 
so I am not sure if this is the best test.
He reads a standard register (BMSR) to determine whether or not 
EXTSTAT1000 exists.  This is part of the 802.3 standard, so it should 
work.

Andy


Andy Fleming
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help