* [PATCH] SiS190/191 half-duplex initialization fix
@ 2010-02-17 19:28 Riccardo Ghetta
2010-02-17 21:39 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Riccardo Ghetta @ 2010-02-17 19:28 UTC (permalink / raw)
To: romieu; +Cc: netdev, Riccardo Ghetta
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>
---
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 8c4e38f..bf2ffbb 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.3"
+#define DRV_VERSION "1.4"
#define DRV_NAME "sis190"
#define SIS190_DRIVER_NAME DRV_NAME " Gigabit Ethernet driver " DRV_VERSION
#define PFX DRV_NAME ": "
@@ -294,6 +294,7 @@ struct sis190_private {
struct mii_if_info mii_if;
struct list_head first_phy;
u32 features;
+ u32 negotiated_lpa;
};
struct sis190_phy {
@@ -1004,6 +1005,8 @@ static void sis190_phy_task(struct work_struct *work)
SIS_W32(RGDelay, 0x0440);
}
+ tp->negotiated_lpa = p->val;
+
net_link(tp, KERN_INFO "%s: link on %s mode.\n", dev->name,
p->msg);
netif_carrier_on(dev);
@@ -1211,6 +1214,12 @@ static netdev_tx_t sis190_start_xmit(struct sk_buff *skb,
wmb();
desc->status = cpu_to_le32(OWNbit | INTbit | DEFbit | CRCbit | PADbit);
+ if (tp->negotiated_lpa & (LPA_1000HALF | LPA_100HALF | LPA_10HALF)) {
+ /* Half Duplex */
+ desc->status |= cpu_to_le32(COLEN | CRSEN | BKFEN);
+ if (tp->negotiated_lpa & (LPA_1000HALF | LPA_1000FULL))
+ desc->status |= cpu_to_le32(EXTEN | BSTEN); /* gigabit HD */
+ }
tp->cur_tx++;
--
1.6.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] SiS190/191 half-duplex initialization fix
2010-02-17 19:28 [PATCH] SiS190/191 half-duplex initialization fix Riccardo Ghetta
@ 2010-02-17 21:39 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-02-17 21:39 UTC (permalink / raw)
To: birrachiara; +Cc: romieu, netdev
From: Riccardo Ghetta <birrachiara@tin.it>
Date: Wed, 17 Feb 2010 20:28:58 +0100
> 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>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] SiS190/191 half-duplex initialization fix
2010-02-15 20:19 Riccardo Ghetta
@ 2010-02-16 22:47 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-02-16 22:47 UTC (permalink / raw)
To: birrachiara; +Cc: romieu, netdev
From: Riccardo Ghetta <birrachiara@tin.it>
Date: Mon, 15 Feb 2010 21:19:00 +0100
> + u32 negotiated_lpa;
Uses spaces instead of tabs.
> + tp->negotiated_lpa = p->val;
Has a space then tabs, should be all tab characters.
> + if (tp->negotiated_lpa & (LPA_1000HALF | LPA_100HALF | LPA_10HALF))
> + {
Should be:
if (condition) {
ie. the openning brace need to be on the same line as the if
statement.
Please fix these issues up and resubmit your patch, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] SiS190/191 half-duplex initialization fix
@ 2010-02-15 20:19 Riccardo Ghetta
2010-02-16 22:47 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Riccardo Ghetta @ 2010-02-15 20:19 UTC (permalink / raw)
To: romieu; +Cc: netdev, Riccardo Ghetta
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>
---
drivers/net/sis190.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index 626de76..6f581e7 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.3"
+#define DRV_VERSION "1.4"
#define DRV_NAME "sis190"
#define SIS190_DRIVER_NAME DRV_NAME " Gigabit Ethernet driver " DRV_VERSION
#define PFX DRV_NAME ": "
@@ -294,6 +294,7 @@ struct sis190_private {
struct mii_if_info mii_if;
struct list_head first_phy;
u32 features;
+ u32 negotiated_lpa;
};
struct sis190_phy {
@@ -1004,6 +1005,8 @@ static void sis190_phy_task(struct work_struct *work)
SIS_W32(RGDelay, 0x0440);
}
+ tp->negotiated_lpa = p->val;
+
net_link(tp, KERN_INFO "%s: link on %s mode.\n", dev->name,
p->msg);
netif_carrier_on(dev);
@@ -1211,6 +1214,13 @@ static netdev_tx_t sis190_start_xmit(struct sk_buff *skb,
wmb();
desc->status = cpu_to_le32(OWNbit | INTbit | DEFbit | CRCbit | PADbit);
+ if (tp->negotiated_lpa & (LPA_1000HALF | LPA_100HALF | LPA_10HALF))
+ {
+ /* Half Duplex */
+ desc->status |= cpu_to_le32(COLEN | CRSEN | BKFEN);
+ if (tp->negotiated_lpa & (LPA_1000HALF | LPA_1000FULL))
+ desc->status |= cpu_to_le32(EXTEN | BSTEN); /* gigabit HD */
+ }
tp->cur_tx++;
--
1.6.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-17 21:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-17 19:28 [PATCH] SiS190/191 half-duplex initialization fix Riccardo Ghetta
2010-02-17 21:39 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2010-02-15 20:19 Riccardo Ghetta
2010-02-16 22:47 ` David Miller
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.