* [PATCH 1/3] sis190: better message on unknown PHY
2009-06-04 19:04 [PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed Riccardo Ghetta
@ 2009-06-04 19:04 ` Riccardo Ghetta
2009-06-04 19:05 ` [PATCH 2/3] sis190: add new phy found on asus F5Sr laptop Riccardo Ghetta
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Riccardo Ghetta @ 2009-06-04 19:04 UTC (permalink / raw)
To: romieu; +Cc: netdev
Signed-off-by: Riccardo Ghetta <birrachiara@tin.it>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/3] sis190: add new phy found on asus F5Sr laptop
2009-06-04 19:04 [PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed Riccardo Ghetta
2009-06-04 19:04 ` [PATCH 1/3] sis190: better message on unknown PHY Riccardo Ghetta
@ 2009-06-04 19:05 ` Riccardo Ghetta
2009-06-04 19:05 ` [PATCH 3/3] sis190: fix gigabit negotiation Riccardo Ghetta
2009-06-04 21:16 ` [PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed Francois Romieu
3 siblings, 0 replies; 6+ messages in thread
From: Riccardo Ghetta @ 2009-06-04 19:05 UTC (permalink / raw)
To: romieu; +Cc: netdev
Signed-off-by: Riccardo Ghetta <birrachiara@tin.it>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 3/3] sis190: fix gigabit negotiation
2009-06-04 19:04 [PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed Riccardo Ghetta
2009-06-04 19:04 ` [PATCH 1/3] sis190: better message on unknown PHY Riccardo Ghetta
2009-06-04 19:05 ` [PATCH 2/3] sis190: add new phy found on asus F5Sr laptop Riccardo Ghetta
@ 2009-06-04 19:05 ` Riccardo Ghetta
2009-06-04 21:16 ` [PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed Francois Romieu
3 siblings, 0 replies; 6+ messages in thread
From: Riccardo Ghetta @ 2009-06-04 19:05 UTC (permalink / raw)
To: romieu; +Cc: netdev
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 <birrachiara@tin.it>
---
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
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed
2009-06-04 19:04 [PATCH 0/3] sis190 gigabit fixes(bug 9735,11149) and new phy - 2nd ed Riccardo Ghetta
` (2 preceding siblings ...)
2009-06-04 19:05 ` [PATCH 3/3] sis190: fix gigabit negotiation Riccardo Ghetta
@ 2009-06-04 21:16 ` Francois Romieu
2009-06-08 7:15 ` David Miller
3 siblings, 1 reply; 6+ messages in thread
From: Francois Romieu @ 2009-06-04 21:16 UTC (permalink / raw)
To: Riccardo Ghetta; +Cc: netdev
Riccardo Ghetta <birrachiara@tin.it> :
> Patches updated as requested. This time at least the day should be correct :-)
The series looks fine. Thanks.
--
Ueimor
^ permalink raw reply [flat|nested] 6+ messages in thread