Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7272
b: refs/heads/master
c: 6614a6d
h: refs/heads/master
v: v3
  • Loading branch information
Francois Romieu authored and Jeff Garzik committed Sep 5, 2005
1 parent c801287 commit 3c4f70e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 38 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 900eb9d69252cf91d42f6a87fc80b1c5518dbff1
refs/heads/master: 6614a6dc6ebba4d3ca0ba5ea023b61a7d22ab00b
58 changes: 21 additions & 37 deletions trunk/drivers/net/sis190.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,6 @@ enum sis190_register_content {
TxInterFrameGapShift = 24,
TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */

/* StationControl */
_1000bpsF = 0x1c00,
_1000bpsH = 0x0c00,
_100bpsF = 0x1800,
_100bpsH = 0x0800,
_10bpsF = 0x1400,
_10bpsH = 0x0400,

LinkStatus = 0x02, // unused
FullDup = 0x01, // unused

Expand Down Expand Up @@ -886,11 +878,6 @@ static void sis190_hw_start(struct net_device *dev)

SIS_W32(IntrStatus, 0xffffffff);
SIS_W32(IntrMask, 0x0);
/*
* Default is 100Mbps.
* A bit strange: 100Mbps is 0x1801 elsewhere -- FR 2005/06/09
*/
SIS_W16(StationControl, 0x1901);
SIS_W32(GMIIControl, 0x0);
SIS_W32(TxMacControl, 0x60);
SIS_W16(RxMacControl, 0x02);
Expand Down Expand Up @@ -937,29 +924,23 @@ static void sis190_phy_task(void * data)
/* Rejoice ! */
struct {
int val;
u32 ctl;
const char *msg;
u16 ctl;
} reg31[] = {
{ LPA_1000XFULL | LPA_SLCT,
"1000 Mbps Full Duplex",
0x01 | _1000bpsF },
{ LPA_1000XHALF | LPA_SLCT,
"1000 Mbps Half Duplex",
0x01 | _1000bpsH },
{ LPA_100FULL,
"100 Mbps Full Duplex",
0x01 | _100bpsF },
{ LPA_100HALF,
"100 Mbps Half Duplex",
0x01 | _100bpsH },
{ LPA_10FULL,
"10 Mbps Full Duplex",
0x01 | _10bpsF },
{ LPA_10HALF,
"10 Mbps Half Duplex",
0x01 | _10bpsH },
{ 0, "unknown", 0x0000 }
}, *p;
{ LPA_1000XFULL | LPA_SLCT, 0x07000c00 | 0x00001000,
"1000 Mbps Full Duplex" },
{ LPA_1000XHALF | LPA_SLCT, 0x07000c00,
"1000 Mbps Half Duplex" },
{ LPA_100FULL, 0x04000800 | 0x00001000,
"100 Mbps Full Duplex" },
{ LPA_100HALF, 0x04000800,
"100 Mbps Half Duplex" },
{ LPA_10FULL, 0x04000400 | 0x00001000,
"10 Mbps Full Duplex" },
{ LPA_10HALF, 0x04000400,
"10 Mbps Half Duplex" },
{ 0, 0x04000400, "unknown" }
}, *p;
u16 adv;

val = mdio_read(ioaddr, phy_id, 0x1f);
Expand All @@ -972,12 +953,15 @@ static void sis190_phy_task(void * data)

val &= adv;

for (p = reg31; p->ctl; p++) {
for (p = reg31; p->val; p++) {
if ((val & p->val) == p->val)
break;
}
if (p->ctl)
SIS_W16(StationControl, p->ctl);

p->ctl |= SIS_R32(StationControl) & ~0x0f001c00;

SIS_W32(StationControl, p->ctl);

net_link(tp, KERN_INFO "%s: link on %s mode.\n", dev->name,
p->msg);
netif_carrier_on(dev);
Expand Down

0 comments on commit 3c4f70e

Please sign in to comment.