Skip to contentSkip to conversation

staging: et131x: Use MII register defines from mii.h

PATCH New Mark Einon 1 participant 1 message Aug 31, 2011 Staging

lore
Share & tools
lore

Mark Einon

author
#0 lore raw

PATCH 1/1 staging: et131x: Use MII register defines from mii.h

Use defines from include/linux/mii.h instead of et131x_phy.h and delete the latter defines.

---
 drivers/staging/et131x/et1310_phy.c     |   22 ++--
 drivers/staging/et131x/et1310_phy.h     |  160 -------------------------------
 drivers/staging/et131x/et131x_initpci.c |    4 +-
 3 files changed, 13 insertions(+), 173 deletions(-)
drivers/staging/et131x/et1310_phy.c +11 -11
index c216bbb..fedde6b 100644
@@ -122,7 +122,7 @@ int et131x_mdio_reset(struct mii_bus *bus)
 	struct net_device *netdev = bus->priv;
 	struct et131x_adapter *adapter = netdev_priv(netdev);
 
-	et131x_mii_write(adapter, PHY_CONTROL, 0x8000);
+	et131x_mii_write(adapter, MII_BMCR, 0x8000);
 
 	return 0;
 }
@@ -292,11 +292,11 @@ void et1310_phy_power_down(struct et131x_adapter *adapter, bool down)
 {
 	u16 data;
 
-	et131x_mii_read(adapter, PHY_CONTROL, &data);
+	et131x_mii_read(adapter, MII_BMCR, &data);
 	data &= ~0x0800;	/* Power UP */
 	if (down) /* Power DOWN */
 		data |= 0x0800;
-	et131x_mii_write(adapter, PHY_CONTROL, data);
+	et131x_mii_write(adapter, MII_BMCR, data);
 }
 
 /**
@@ -328,10 +328,10 @@ static void et1310_phy_link_status(struct et131x_adapter *adapter,
 	u16 vmi_phystatus = 0;
 	u16 control = 0;
 
-	et131x_mii_read(adapter, PHY_STATUS, &mistatus);
-	et131x_mii_read(adapter, PHY_1000_STATUS, &is1000BaseT);
+	et131x_mii_read(adapter, MII_BMSR, &mistatus);
+	et131x_mii_read(adapter, MII_STAT1000, &is1000BaseT);
 	et131x_mii_read(adapter, PHY_PHY_STATUS, &vmi_phystatus);
-	et131x_mii_read(adapter, PHY_CONTROL, &control);
+	et131x_mii_read(adapter, MII_BMCR, &control);
 
 	*link_status = (vmi_phystatus & 0x0040) ? 1 : 0;
 	*autoneg = (control & 0x1000) ? ((vmi_phystatus & 0x0020) ?
@@ -448,8 +448,8 @@ void et131x_mii_check(struct et131x_adapter *adapter,
 	u32 masterslave;
 	u32 polarity;
 
-	if (bmsr_ints & MI_BMSR_LINK_STATUS) {
-		if (bmsr & MI_BMSR_LINK_STATUS) {
+	if (bmsr_ints & BMSR_LSTATUS) {
+		if (bmsr & BMSR_LSTATUS) {
 			adapter->boot_coma = 20;
 			netif_carrier_on(adapter->netdev);
 		} else {
@@ -505,9 +505,9 @@ void et131x_mii_check(struct et131x_adapter *adapter,
 		}
 	}
 
-	if ((bmsr_ints & MI_BMSR_AUTO_NEG_COMPLETE) ||
-	   (adapter->ai_force_duplex == 3 && (bmsr_ints & MI_BMSR_LINK_STATUS))) {
-		if ((bmsr & MI_BMSR_AUTO_NEG_COMPLETE) ||
+	if ((bmsr_ints & BMSR_ANEGCOMPLETE) ||
+	   (adapter->ai_force_duplex == 3 && (bmsr_ints & BMSR_LSTATUS))) {
+		if ((bmsr & BMSR_ANEGCOMPLETE) ||
 		    adapter->ai_force_duplex == 3) {
 			et1310_phy_link_status(adapter,
 					     &link_status, &autoneg_status,
drivers/staging/et131x/et1310_phy.h +0 -160

178 lines not on this page · raw message

drivers/staging/et131x/et131x_initpci.c +2 -2
index 6ffebfa..2ef2a70 100644
@@ -249,14 +249,14 @@ void et131x_error_timer_handler(unsigned long data)
 		dev_err(&adapter->pdev->dev,
 		    "No interrupts, in PHY coma, pm_csr = 0x%x\n", pm_csr);
 
-	if (!(adapter->bmsr & MI_BMSR_LINK_STATUS) &&
+	if (!(adapter->bmsr & BMSR_LSTATUS) &&
 	    adapter->registry_phy_coma &&
 	    adapter->boot_coma < 11) {
 		adapter->boot_coma++;
 	}
 
 	if (adapter->boot_coma == 10) {
-		if (!(adapter->bmsr & MI_BMSR_LINK_STATUS)
+		if (!(adapter->bmsr & BMSR_LSTATUS)
 		    && adapter->registry_phy_coma) {
 			if ((pm_csr & ET_PM_PHY_SW_COMA) == 0) {
 				/* NOTE - This was originally a 'sync with
Signature · 1 line
1.7.6