diff options
author | Riccardo Ghetta <birrachiara@tin.it> | 2010-02-17 04:28:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 16:38:10 -0500 |
commit | 08326dbe7b5825295ec3711eec53b093549749e5 (patch) | |
tree | 684dc4907ea770c3660500961e4559e0df2bf2bd /drivers/net/sis190.c | |
parent | 7af3351f71f4b3b5dbccb66cdc9b097052760a7f (diff) |
SiS190/191 half-duplex initialization fix
Adds half-duplex specific setup code (taken from SiS own GPL driver).
Without those, half-duplex connections are very unreliable, often
working on small transfers and failing after a while.
Signed-off-by: Riccardo Ghetta <birrachiara@tin.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sis190.c')
-rw-r--r-- | drivers/net/sis190.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c index 8c4e38f9ebf7..bf2ffbb913ff 100644 --- a/drivers/net/sis190.c +++ b/drivers/net/sis190.c | |||
@@ -47,7 +47,7 @@ | |||
47 | #define PHY_ID_ANY 0x1f | 47 | #define PHY_ID_ANY 0x1f |
48 | #define MII_REG_ANY 0x1f | 48 | #define MII_REG_ANY 0x1f |
49 | 49 | ||
50 | #define DRV_VERSION "1.3" | 50 | #define DRV_VERSION "1.4" |
51 | #define DRV_NAME "sis190" | 51 | #define DRV_NAME "sis190" |
52 | #define SIS190_DRIVER_NAME DRV_NAME " Gigabit Ethernet driver " DRV_VERSION | 52 | #define SIS190_DRIVER_NAME DRV_NAME " Gigabit Ethernet driver " DRV_VERSION |
53 | #define PFX DRV_NAME ": " | 53 | #define PFX DRV_NAME ": " |
@@ -294,6 +294,7 @@ struct sis190_private { | |||
294 | struct mii_if_info mii_if; | 294 | struct mii_if_info mii_if; |
295 | struct list_head first_phy; | 295 | struct list_head first_phy; |
296 | u32 features; | 296 | u32 features; |
297 | u32 negotiated_lpa; | ||
297 | }; | 298 | }; |
298 | 299 | ||
299 | struct sis190_phy { | 300 | struct sis190_phy { |
@@ -1004,6 +1005,8 @@ static void sis190_phy_task(struct work_struct *work) | |||
1004 | SIS_W32(RGDelay, 0x0440); | 1005 | SIS_W32(RGDelay, 0x0440); |
1005 | } | 1006 | } |
1006 | 1007 | ||
1008 | tp->negotiated_lpa = p->val; | ||
1009 | |||
1007 | net_link(tp, KERN_INFO "%s: link on %s mode.\n", dev->name, | 1010 | net_link(tp, KERN_INFO "%s: link on %s mode.\n", dev->name, |
1008 | p->msg); | 1011 | p->msg); |
1009 | netif_carrier_on(dev); | 1012 | netif_carrier_on(dev); |
@@ -1211,6 +1214,12 @@ static netdev_tx_t sis190_start_xmit(struct sk_buff *skb, | |||
1211 | wmb(); | 1214 | wmb(); |
1212 | 1215 | ||
1213 | desc->status = cpu_to_le32(OWNbit | INTbit | DEFbit | CRCbit | PADbit); | 1216 | desc->status = cpu_to_le32(OWNbit | INTbit | DEFbit | CRCbit | PADbit); |
1217 | if (tp->negotiated_lpa & (LPA_1000HALF | LPA_100HALF | LPA_10HALF)) { | ||
1218 | /* Half Duplex */ | ||
1219 | desc->status |= cpu_to_le32(COLEN | CRSEN | BKFEN); | ||
1220 | if (tp->negotiated_lpa & (LPA_1000HALF | LPA_1000FULL)) | ||
1221 | desc->status |= cpu_to_le32(EXTEN | BSTEN); /* gigabit HD */ | ||
1222 | } | ||
1214 | 1223 | ||
1215 | tp->cur_tx++; | 1224 | tp->cur_tx++; |
1216 | 1225 | ||