On Mon, 2006-05-01 at 23:17 +0200, Mattias Bergsten wrote:
> Had to upgrade to 2.6.17-rc3 to get the driver version to agree with
> the
> patch because of the restructuring. Tried with and without the patch
> on
> ppc but unfortunately does not work either way, without it's the same
> as
> before and with it I get this message: 

That's a good demonstration of testing code before you send it out!  I
meant to move that block that checks the PHY ID below the part where I
actually read the PHY address but I didn't so it was reading from the
wrong place.  The attached patch seems to behave fine on x86 and should
work better on PPC.  Let me know if it works better and if so, I'll get
it submitted.



-- 
David Hollis <[EMAIL PROTECTED]>
--- a/linux/drivers/usb/net/asix.c	2006-04-21 08:13:42.000000000 -0400
+++ b/linux/drivers/usb/net/asix.c	2006-05-01 19:33:45.000000000 -0400
@@ -618,16 +618,6 @@ static int ax88772_bind(struct usbnet *d
 	}
 	memcpy(dev->net->dev_addr, buf, ETH_ALEN);
 
-	if ((ret = asix_set_sw_mii(dev)) < 0)
-		goto out2;
-
-	if (((ret = asix_read_cmd(dev, AX_CMD_READ_MII_REG,
-	      			0x0010, 2, 2, buf)) < 0)
-			|| (*((u16 *)buf) != 0x003b)) {
-		dbg("Read PHY register 2 must be 0x3b00: %d", ret);
-		goto out2;
-	}
-
 	/* Initialize MII structure */
 	dev->mii.dev = dev->net;
 	dev->mii.mdio_read = asix_mdio_read;
@@ -637,6 +627,12 @@ static int ax88772_bind(struct usbnet *d
 	dev->net->do_ioctl = asix_ioctl;
 	dev->mii.phy_id = asix_get_phyid(dev);
 
+	if ((ret = asix_mdio_read_le(dev->net,
+			dev->mii.phy_id, MII_PHYSID1)) != 0x003b) {
+		dbg("Read PHYSID1 must be 0x003b.  Read: %04x", ret);
+		goto out2;
+	}
+
 	if ((ret = asix_sw_reset(dev, AX_SWRESET_PRL)) < 0)
 		goto out2;
 
@@ -667,8 +663,6 @@ static int ax88772_bind(struct usbnet *d
 		dbg("Write IPG,IPG1,IPG2 failed: %d", ret);
 		goto out2;
 	}
-	if ((ret = asix_set_hw_mii(dev)) < 0)
-		goto out2;
 
 	/* Set RX_CTL to default values with 2k buffer, and enable cactus */
 	if ((ret = asix_write_rx_ctl(dev, 0x0088)) < 0)

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to