All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Luethi <rl@hellgate.ch>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: [3/3] via-rhine: small fixes
Date: Sun, 8 Aug 2004 16:03:12 +0200	[thread overview]
Message-ID: <20040808140312.GA8608@k3.hellgate.ch> (raw)
In-Reply-To: <20040808140216.GA8181@k3.hellgate.ch>

- remove Rhine model names (per Jeff's request)
- remove redundant calls to clear MII cmd
- fill some rhine_private fields earlier

Signed-off-by: Roger Luethi <rl@hellgate.ch>

--- linux-2.6.8-rc3-mm1/drivers/net/via-rhine.c.02	2004-08-08 13:16:11.009654178 +0200
+++ linux-2.6.8-rc3-mm1/drivers/net/via-rhine.c	2004-08-08 13:19:59.350890566 +0200
@@ -346,7 +346,7 @@ enum rhine_revs {
 	VT6105L		= 0x8A,
 	VT6107		= 0x8C,
 	VTunknown2	= 0x8E,
-	VT6105M		= 0x90,
+	VT6105M		= 0x90,	/* Management adapter */
 };
 
 enum rhine_quirks {
@@ -485,9 +485,7 @@ struct rhine_private {
 	dma_addr_t tx_bufs_dma;
 
 	struct pci_dev *pdev;
-#ifdef CONFIG_PM
 	long pioaddr;
-#endif
 	struct net_device_stats stats;
 	spinlock_t lock;
 
@@ -596,7 +594,7 @@ static void rhine_power_init(struct net_
 			default:
 				reason = "Unknown";
 			}
-			printk("%s: Woke system up. Reason: %s.\n",
+			printk(KERN_INFO "%s: Woke system up. Reason: %s.\n",
 			       DRV_NAME, reason);
 		}
 	}
@@ -706,7 +704,7 @@ static int __devinit rhine_init_one(stru
 	long memaddr;
 	long ioaddr;
 	int io_size, phy_id;
-	const char *name, *mname;
+	const char *name;
 
 /* when built into the kernel, we only print version if device is found */
 #ifndef MODULE
@@ -721,41 +719,24 @@ static int __devinit rhine_init_one(stru
 	phy_id = 0;
 	quirks = 0;
 	name = "Rhine";
-	mname = "unknown";
 	if (pci_rev < VTunknown0) {
 		quirks = rqRhineI;
 		io_size = 128;
-		mname = "VT86C100A";
 	}
 	else if (pci_rev >= VT6102) {
 		quirks = rqWOL | rqForceReset;
 		if (pci_rev < VT6105) {
 			name = "Rhine II";
 			quirks |= rqStatusWBRace;	/* Rhine-II exclusive */
-			if (pci_rev < VT8231)
-				mname = "VT6102";
-			else if (pci_rev < VT8233)
-				mname = "VT8231";
-			else if (pci_rev < VT8235)
-				mname = "VT8233";
-			else if (pci_rev < VT8237)
-				mname = "VT8235";
-			else if (pci_rev < VTunknown1)
-				mname = "VT8237";
 		}
 		else {
-			name = "Rhine III";
 			phy_id = 1;	/* Integrated PHY, phy_id fixed to 1 */
 			if (pci_rev >= VT6105_B0)
 				quirks |= rq6patterns;
-			if (pci_rev < VT6105L)
-				mname = "VT6105";
-			else if (pci_rev < VT6107)
-				mname = "VT6105L";
-			else if (pci_rev < VT6105M)
-				mname = "VT6107";
-			else if (pci_rev >= VT6105M)
-				mname = "Management Adapter VT6105M";
+			if (pci_rev < VT6105M)
+				name = "Rhine III";
+			else
+				name = "Rhine III (Management Adapter)";
 		}
 	}
 
@@ -793,6 +774,11 @@ static int __devinit rhine_init_one(stru
 	SET_MODULE_OWNER(dev);
 	SET_NETDEV_DEV(dev, &pdev->dev);
 
+	rp = netdev_priv(dev);
+	rp->quirks = quirks;
+	rp->pioaddr = pioaddr;
+	rp->pdev = pdev;
+
 	rc = pci_request_regions(pdev, DRV_NAME);
 	if (rc)
 		goto err_out_free_netdev;
@@ -826,11 +812,6 @@ static int __devinit rhine_init_one(stru
 #endif /* USE_MMIO */
 
 	dev->base_addr = ioaddr;
-	rp = netdev_priv(dev);
-	rp->quirks = quirks;
-#ifdef CONFIG_PM
-	rp->pioaddr = pioaddr;
-#endif
 
 	/* Get chip registers into a sane state */
 	rhine_power_init(dev);
@@ -852,7 +833,6 @@ static int __devinit rhine_init_one(stru
 	dev->irq = pdev->irq;
 
 	spin_lock_init(&rp->lock);
-	rp->pdev = pdev;
 	rp->mii_if.dev = dev;
 	rp->mii_if.mdio_read = mdio_read;
 	rp->mii_if.mdio_write = mdio_write;
@@ -880,8 +860,8 @@ static int __devinit rhine_init_one(stru
 	if (rc)
 		goto err_out_unmap;
 
-	printk(KERN_INFO "%s: VIA %s (%s) at 0x%lx, ",
-	       dev->name, name, mname,
+	printk(KERN_INFO "%s: VIA %s at 0x%lx, ",
+	       dev->name, name,
 #ifdef USE_MMIO
 		memaddr
 #else
@@ -1181,7 +1161,7 @@ static int mdio_read(struct net_device *
 
 	rhine_disable_linkmon(ioaddr, rp->quirks);
 
-	writeb(0, ioaddr + MIICmd);
+	/* rhine_disable_linkmon already cleared MIICmd */
 	writeb(phy_id, ioaddr + MIIPhyAddr);
 	writeb(regnum, ioaddr + MIIRegAddr);
 	writeb(0x40, ioaddr + MIICmd);		/* Trigger read */
@@ -1199,7 +1179,7 @@ static void mdio_write(struct net_device
 
 	rhine_disable_linkmon(ioaddr, rp->quirks);
 
-	writeb(0, ioaddr + MIICmd);
+	/* rhine_disable_linkmon already cleared MIICmd */
 	writeb(phy_id, ioaddr + MIIPhyAddr);
 	writeb(regnum, ioaddr + MIIRegAddr);
 	writew(value, ioaddr + MIIData);

  parent reply	other threads:[~2004-08-08 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-08 14:02 [0/3] via-rhine: experimental patches Roger Luethi
2004-08-08 14:02 ` [1/3] via-rhine: suspend/resume support Roger Luethi
2004-08-08 14:02 ` [2/3] via-rhine: de-isolate PHY Roger Luethi
2004-08-08 14:03 ` Roger Luethi [this message]
2004-08-10  2:08 ` [0/3] via-rhine: experimental patches Lee Revell
2004-08-10  7:10   ` Roger Luethi
2004-08-10  7:16     ` Lee Revell

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=20040808140312.GA8608@k3.hellgate.ch \
    --to=rl@hellgate.ch \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.