[PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed

STALE6303d

6 messages, 3 authors, 2009-06-08 · open the first message on its own page

[PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed

From: Riccardo Ghetta <hidden>
Date: 2009-06-04 19:04:40

Patches updated as requested. This time at least the day should be correct :-)

First patch is just cosmetic, to make easier to identify newer phys.
Second adds a new phy found on my Asus F5Sr laptop. It's an Atheros/Attansic
chip, but I wasn't able to identify it further.
The third patch should enable sis191 adapters to connect at Gb speeds
(at least, it does on my laptop). Also bumps the version number.
The gigabit check is a remix of SiS own GPL driver and forcedeth.

Riccardo Ghetta (3):
  sis190: better message on unknown PHY
  sis190: add new phy found on asus F5Sr laptop
  sis190: fix gigabit negotiation

 drivers/net/sis190.c |   53 +++++++++++++++++++++++++++++++++-----------------
 1 files changed, 35 insertions(+), 18 deletions(-)

[PATCH 1/3] sis190: better message on unknown PHY

From: Riccardo Ghetta <hidden>
Date: 2009-06-04 19:04:54

Signed-off-by: Riccardo Ghetta <redacted>
---
 drivers/net/sis190.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index 55ccd51..46de808 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -347,7 +347,7 @@ static struct {
 	u32 msg_enable;
 } debug = { -1 };
 
-MODULE_DESCRIPTION("SiS sis190 Gigabit Ethernet driver");
+MODULE_DESCRIPTION("SiS sis190/191 Gigabit Ethernet driver");
 module_param(rx_copybreak, int, 0);
 MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
 module_param_named(debug, debug.msg_enable, int, 0);
@@ -1315,12 +1315,15 @@ static void sis190_init_phy(struct net_device *dev, struct sis190_private *tp,
 			((mii_status & (BMSR_100FULL | BMSR_100HALF)) ?
 				LAN : HOME) : p->type;
 		tp->features |= p->feature;
-	} else
+		net_probe(tp, KERN_INFO "%s: %s transceiver at address %d.\n",
+			pci_name(tp->pci_dev), p->name, phy_id);
+	} else {
 		phy->type = UNKNOWN;
-
-	net_probe(tp, KERN_INFO "%s: %s transceiver at address %d.\n",
-		  pci_name(tp->pci_dev),
-		  (phy->type == UNKNOWN) ? "Unknown PHY" : p->name, phy_id);
+		net_probe(tp, KERN_INFO
+			"%s: unknown PHY 0x%x:0x%x transceiver at address %d\n",
+			pci_name(tp->pci_dev),
+			phy->id[0], (phy->id[1] & 0xfff0), phy_id);
+	}
 }
 
 static void sis190_mii_probe_88e1111_fixup(struct sis190_private *tp)
-- 
1.6.2.4

[PATCH 2/3] sis190: add new phy found on asus F5Sr laptop

From: Riccardo Ghetta <hidden>
Date: 2009-06-04 19:05:07

Signed-off-by: Riccardo Ghetta <redacted>
---
 drivers/net/sis190.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index 46de808..df1d1f7 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -317,6 +317,7 @@ static struct mii_chip_info {
         unsigned int type;
 	u32 feature;
 } mii_chip_table[] = {
+	{ "Atheros PHY",          { 0x004d, 0xd010 }, LAN, 0 },
 	{ "Atheros PHY AR8012",   { 0x004d, 0xd020 }, LAN, 0 },
 	{ "Broadcom PHY BCM5461", { 0x0020, 0x60c0 }, LAN, F_PHY_BCM5461 },
 	{ "Broadcom PHY AC131",   { 0x0143, 0xbc70 }, LAN, 0 },
-- 
1.6.2.4

[PATCH 3/3] sis190: fix gigabit negotiation

From: Riccardo Ghetta <hidden>
Date: 2009-06-04 19:05:19

Fixes an initialization error; the chip negotiates gigabit, but
the driver mistakenly handled it as 100Mb.
Changes based on both SiS own GPL driver and forcedeth.
Hopefully should fix
	http://bugzilla.kernel.org/show_bug.cgi?id=9735
	http://bugzilla.kernel.org/show_bug.cgi?id=11149

Signed-off-by: Riccardo Ghetta <redacted>
---
 drivers/net/sis190.c |   37 +++++++++++++++++++++++++------------
 1 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index df1d1f7..f0d73ab 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -47,7 +47,7 @@
 #define PHY_ID_ANY		0x1f
 #define MII_REG_ANY		0x1f
 
-#define DRV_VERSION		"1.2"
+#define DRV_VERSION		"1.3"
 #define DRV_NAME		"sis190"
 #define SIS190_DRIVER_NAME	DRV_NAME " Gigabit Ethernet driver " DRV_VERSION
 #define PFX DRV_NAME ": "
@@ -943,9 +943,9 @@ static void sis190_phy_task(struct work_struct *work)
 			u32 ctl;
 			const char *msg;
 		} reg31[] = {
-			{ LPA_1000XFULL | LPA_SLCT, 0x07000c00 | 0x00001000,
+			{ LPA_1000FULL, 0x07000c00 | 0x00001000,
 				"1000 Mbps Full Duplex" },
-			{ LPA_1000XHALF | LPA_SLCT, 0x07000c00,
+			{ LPA_1000HALF, 0x07000c00,
 				"1000 Mbps Half Duplex" },
 			{ LPA_100FULL, 0x04000800 | 0x00001000,
 				"100 Mbps Full Duplex" },
@@ -956,22 +956,35 @@ static void sis190_phy_task(struct work_struct *work)
 			{ LPA_10HALF, 0x04000400,
 				"10 Mbps Half Duplex" },
 			{ 0, 0x04000400, "unknown" }
- 		}, *p;
-		u16 adv;
+		}, *p = NULL;
+		u16 adv, autoexp, gigadv, gigrec;
 
 		val = mdio_read(ioaddr, phy_id, 0x1f);
 		net_link(tp, KERN_INFO "%s: mii ext = %04x.\n", dev->name, val);
 
 		val = mdio_read(ioaddr, phy_id, MII_LPA);
 		adv = mdio_read(ioaddr, phy_id, MII_ADVERTISE);
-		net_link(tp, KERN_INFO "%s: mii lpa = %04x adv = %04x.\n",
-			 dev->name, val, adv);
-
-		val &= adv;
+		autoexp = mdio_read(ioaddr, phy_id, MII_EXPANSION);
+		net_link(tp, KERN_INFO "%s: mii lpa=%04x adv=%04x exp=%04x.\n",
+			 dev->name, val, adv, autoexp);
+
+		if (val & LPA_NPAGE && autoexp & EXPANSION_NWAY) {
+			/* check for gigabit speed */
+			gigadv = mdio_read(ioaddr, phy_id, MII_CTRL1000);
+			gigrec = mdio_read(ioaddr, phy_id, MII_STAT1000);
+			val = (gigadv & (gigrec >> 2));
+			if (val & ADVERTISE_1000FULL)
+				p = reg31;
+			else if (val & ADVERTISE_1000HALF)
+				p = reg31 + 1;
+		}
+		if (!p) {
+			val &= adv;
 
-		for (p = reg31; p->val; p++) {
-			if ((val & p->val) == p->val)
-				break;
+			for (p = reg31; p->val; p++) {
+				if ((val & p->val) == p->val)
+					break;
+			}
 		}
 
 		p->ctl |= SIS_R32(StationControl) & ~0x0f001c00;
-- 
1.6.2.4

Re: [PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed

From: Francois Romieu <romieu@fr.zoreil.com>
Date: 2009-06-04 21:14:40

Riccardo Ghetta [off-list ref] :
Patches updated as requested. This time at least the day should be correct :-)
The series looks fine. Thanks.

-- 
Ueimor

Re: [PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed

From: David Miller <davem@davemloft.net>
Date: 2009-06-08 07:15:33

From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 4 Jun 2009 23:16:28 +0200
Riccardo Ghetta [off-list ref] :
quoted
Patches updated as requested. This time at least the day should be correct :-)
The series looks fine. Thanks.
All applied to net-next-2.6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help