netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][REPOST] WAN: fix C101 card carrier handling
@ 2006-08-22 12:59 Krzysztof Halasa
  2006-08-24  3:39 ` Jeff Garzik
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Halasa @ 2006-08-22 12:59 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: David Miller, netdev, lkml

Hi,

One of my recent changes broke C101 carrier handling, this patch
fixes it. Also fixes an old TX underrun checking bug.

2.6.18 material. Please apply.
Thanks.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>

diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c
index 435e91e..6b63b35 100644
--- a/drivers/net/wan/c101.c
+++ b/drivers/net/wan/c101.c
@@ -118,7 +118,7 @@ #include "hd6457x.c"
 
 static inline void set_carrier(port_t *port)
 {
-	if (!sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD)
+	if (!(sca_in(MSCI1_OFFSET + ST3, port) & ST3_DCD))
 		netif_carrier_on(port_to_dev(port));
 	else
 		netif_carrier_off(port_to_dev(port));
@@ -127,10 +127,10 @@ static inline void set_carrier(port_t *p
 
 static void sca_msci_intr(port_t *port)
 {
-	u8 stat = sca_in(MSCI1_OFFSET + ST1, port); /* read MSCI ST1 status */
+	u8 stat = sca_in(MSCI0_OFFSET + ST1, port); /* read MSCI ST1 status */
 
-	/* Reset MSCI TX underrun status bit */
-	sca_out(stat & ST1_UDRN, MSCI0_OFFSET + ST1, port);
+	/* Reset MSCI TX underrun and CDCD (ignored) status bit */
+	sca_out(stat & (ST1_UDRN | ST1_CDCD), MSCI0_OFFSET + ST1, port);
 
 	if (stat & ST1_UDRN) {
 		struct net_device_stats *stats = hdlc_stats(port_to_dev(port));
@@ -138,6 +138,7 @@ static void sca_msci_intr(port_t *port)
 		stats->tx_fifo_errors++;
 	}
 
+	stat = sca_in(MSCI1_OFFSET + ST1, port); /* read MSCI1 ST1 status */
 	/* Reset MSCI CDCD status bit - uses ch#2 DCD input */
 	sca_out(stat & ST1_CDCD, MSCI1_OFFSET + ST1, port);
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH][REPOST] WAN: fix C101 card carrier handling
  2006-08-22 12:59 [PATCH][REPOST] WAN: fix C101 card carrier handling Krzysztof Halasa
@ 2006-08-24  3:39 ` Jeff Garzik
  2006-08-24 13:26   ` Krzysztof Halasa
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2006-08-24  3:39 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: David Miller, netdev, lkml

Krzysztof Halasa wrote:
> Hi,
> 
> One of my recent changes broke C101 carrier handling, this patch
> fixes it. Also fixes an old TX underrun checking bug.
> 
> 2.6.18 material. Please apply.

it's already in netdev-2.6.git#upstream-fixes, destined for 2.6.18.

	Jeff




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][REPOST] WAN: fix C101 card carrier handling
  2006-08-24  3:39 ` Jeff Garzik
@ 2006-08-24 13:26   ` Krzysztof Halasa
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Halasa @ 2006-08-24 13:26 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: David Miller, netdev, lkml

Jeff Garzik <jeff@garzik.org> writes:

>> One of my recent changes broke C101 carrier handling, this patch
>> fixes it. Also fixes an old TX underrun checking bug.
>> 2.6.18 material. Please apply.
>
> it's already in netdev-2.6.git#upstream-fixes, destined for 2.6.18.

Great, I somehow missed it. Thank you.
-- 
Krzysztof Halasa

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-24 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-22 12:59 [PATCH][REPOST] WAN: fix C101 card carrier handling Krzysztof Halasa
2006-08-24  3:39 ` Jeff Garzik
2006-08-24 13:26   ` Krzysztof Halasa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).