ChangeSet 1.1018.1.6, 2003/04/04 16:14:20-08:00, petkan@users.sourceforge.net [PATCH] USB: pegasus link status fix fixed up the link status detection drivers/usb/net/pegasus.c | 16 ++++++++-------- drivers/usb/net/pegasus.h | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff -Nru a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c --- a/drivers/usb/net/pegasus.c Mon Apr 7 15:14:27 2003 +++ b/drivers/usb/net/pegasus.c Mon Apr 7 15:14:27 2003 @@ -45,7 +45,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v0.5.9 (2002/12/31)" +#define DRIVER_VERSION "v0.5.10 (2003/04/01)" #define DRIVER_AUTHOR "Petko Manolov " #define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver" @@ -121,7 +121,7 @@ char *buffer; DECLARE_WAITQUEUE(wait, current); - buffer = kmalloc(size, GFP_KERNEL); + buffer = kmalloc(size, GFP_DMA); if (!buffer) { warn("%s: looks like we're out of memory", __FUNCTION__); return -ENOMEM; @@ -170,7 +170,7 @@ char *buffer; DECLARE_WAITQUEUE(wait, current); - buffer = kmalloc(size, GFP_KERNEL); + buffer = kmalloc(size, GFP_DMA); if (!buffer) { warn("%s: looks like we're out of memory", __FUNCTION__); return -ENOMEM; @@ -218,7 +218,7 @@ char *tmp; DECLARE_WAITQUEUE(wait, current); - tmp = kmalloc(1, GFP_KERNEL); + tmp = kmalloc(1, GFP_DMA); if (!tmp) { warn("%s: looks like we're out of memory", __FUNCTION__); return -ENOMEM; @@ -711,11 +711,11 @@ pegasus->stats.tx_aborted_errors++; if (d[0] & LATE_COL) pegasus->stats.tx_window_errors++; - if (d[0] & (NO_CARRIER | LOSS_CARRIER)) { - pegasus->stats.tx_carrier_errors++; - netif_carrier_off(net); - } else { + if (d[5] & LINK_STATUS) { netif_carrier_on(net); + } else { + pegasus->stats.tx_carrier_errors++; + netif_carrier_off(net); } } diff -Nru a/drivers/usb/net/pegasus.h b/drivers/usb/net/pegasus.h --- a/drivers/usb/net/pegasus.h Mon Apr 7 15:14:27 2003 +++ b/drivers/usb/net/pegasus.h Mon Apr 7 15:14:27 2003 @@ -52,6 +52,8 @@ #define LOSS_CARRIER 0x08 #define JABBER_TIMEOUT 0x04 +#define LINK_STATUS 0x01 + #define PEGASUS_REQT_READ 0xc0 #define PEGASUS_REQT_WRITE 0x40 #define PEGASUS_REQ_GET_REGS 0xf0