Re: [PATCH] usb-net/pegasus: simplify carrier detection

2007-04-27 Thread Jeff Garzik

Dan Williams wrote:

Simplify pegasus carrier detection; rely only on the periodic MII
polling.  Reverts pieces of c43c49bd61fdb9bb085ddafcaadb17d06f95ec43.

Signed-off-by: Dan Williams <[EMAIL PROTECTED]>

--- a/drivers/usb/net/pegasus.h 2007-04-25 21:21:00.0 -0400
+++ b/drivers/usb/net/pegasus.h 2007-04-25 21:21:13.0 -0400
@@ -11,7 +11,6 @@
 
 #define	PEGASUS_II		0x8000

 #defineHAS_HOME_PNA0x4000
-#defineTRUST_LINK_STATUS   0x2000
 
 #define	PEGASUS_MTU		1536

 #defineRX_SKBS 4
@@ -204,7 +203,7 @@
 PEGASUS_DEV( "Allied Telesyn Int. AT-USB100", VENDOR_ALLIEDTEL, 0xb100,
DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121,
-   DEFAULT_GPIO_RESET | PEGASUS_II | TRUST_LINK_STATUS )
+   DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986,
DEFAULT_GPIO_RESET )
 PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,
--- a/drivers/usb/net/pegasus.c 2007-04-25 21:20:32.0 -0400
+++ b/drivers/usb/net/pegasus.c 2007-04-25 21:22:15.0 -0400
@@ -848,16 +848,6 @@
 * d[0].NO_CARRIER kicks in only with failed TX.
 * ... so monitoring with MII may be safest.
 */
-   if (pegasus->features & TRUST_LINK_STATUS) {
-   if (d[5] & LINK_STATUS)
-   netif_carrier_on(net);
-   else
-   netif_carrier_off(net);
-   } else {
-   /* Never set carrier _on_ based on ! NO_CARRIER */
-   if (d[0] & NO_CARRIER)
-   netif_carrier_off(net); 
-   }
 
 		/* bytes 3-4 == rx_lostpkt, reg 2E/2F */

pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4];


applied


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] usb-net/pegasus: simplify carrier detection

2007-04-26 Thread Petko Manolov

Good man, I owe you a beer. :)


cheers,
Petko



On Wed, 25 Apr 2007, Dan Williams wrote:


Simplify pegasus carrier detection; rely only on the periodic MII
polling.  Reverts pieces of c43c49bd61fdb9bb085ddafcaadb17d06f95ec43.

Signed-off-by: Dan Williams <[EMAIL PROTECTED]>

--- a/drivers/usb/net/pegasus.h 2007-04-25 21:21:00.0 -0400
+++ b/drivers/usb/net/pegasus.h 2007-04-25 21:21:13.0 -0400
@@ -11,7 +11,6 @@

#define PEGASUS_II  0x8000
#define HAS_HOME_PNA0x4000
-#defineTRUST_LINK_STATUS   0x2000

#define PEGASUS_MTU 1536
#define RX_SKBS 4
@@ -204,7 +203,7 @@
PEGASUS_DEV( "Allied Telesyn Int. AT-USB100", VENDOR_ALLIEDTEL, 0xb100,
DEFAULT_GPIO_RESET | PEGASUS_II )
PEGASUS_DEV( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121,
-   DEFAULT_GPIO_RESET | PEGASUS_II | TRUST_LINK_STATUS )
+   DEFAULT_GPIO_RESET | PEGASUS_II )
PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986,
DEFAULT_GPIO_RESET )
PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,
--- a/drivers/usb/net/pegasus.c 2007-04-25 21:20:32.0 -0400
+++ b/drivers/usb/net/pegasus.c 2007-04-25 21:22:15.0 -0400
@@ -848,16 +848,6 @@
 * d[0].NO_CARRIER kicks in only with failed TX.
 * ... so monitoring with MII may be safest.
 */
-   if (pegasus->features & TRUST_LINK_STATUS) {
-   if (d[5] & LINK_STATUS)
-   netif_carrier_on(net);
-   else
-   netif_carrier_off(net);
-   } else {
-   /* Never set carrier _on_ based on ! NO_CARRIER */
-   if (d[0] & NO_CARRIER)
-   netif_carrier_off(net);
-   }

/* bytes 3-4 == rx_lostpkt, reg 2E/2F */
pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4];




-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] usb-net/pegasus: simplify carrier detection

2007-04-25 Thread Dan Williams
Simplify pegasus carrier detection; rely only on the periodic MII
polling.  Reverts pieces of c43c49bd61fdb9bb085ddafcaadb17d06f95ec43.

Signed-off-by: Dan Williams <[EMAIL PROTECTED]>

--- a/drivers/usb/net/pegasus.h 2007-04-25 21:21:00.0 -0400
+++ b/drivers/usb/net/pegasus.h 2007-04-25 21:21:13.0 -0400
@@ -11,7 +11,6 @@
 
 #definePEGASUS_II  0x8000
 #defineHAS_HOME_PNA0x4000
-#defineTRUST_LINK_STATUS   0x2000
 
 #definePEGASUS_MTU 1536
 #defineRX_SKBS 4
@@ -204,7 +203,7 @@
 PEGASUS_DEV( "Allied Telesyn Int. AT-USB100", VENDOR_ALLIEDTEL, 0xb100,
DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121,
-   DEFAULT_GPIO_RESET | PEGASUS_II | TRUST_LINK_STATUS )
+   DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986,
DEFAULT_GPIO_RESET )
 PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,
--- a/drivers/usb/net/pegasus.c 2007-04-25 21:20:32.0 -0400
+++ b/drivers/usb/net/pegasus.c 2007-04-25 21:22:15.0 -0400
@@ -848,16 +848,6 @@
 * d[0].NO_CARRIER kicks in only with failed TX.
 * ... so monitoring with MII may be safest.
 */
-   if (pegasus->features & TRUST_LINK_STATUS) {
-   if (d[5] & LINK_STATUS)
-   netif_carrier_on(net);
-   else
-   netif_carrier_off(net);
-   } else {
-   /* Never set carrier _on_ based on ! NO_CARRIER */
-   if (d[0] & NO_CARRIER)
-   netif_carrier_off(net); 
-   }
 
/* bytes 3-4 == rx_lostpkt, reg 2E/2F */
pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4];


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html