Commit 22a8591b authored by Petko Manolov's avatar Petko Manolov Committed by Greg Kroah-Hartman

[PATCH] USB: pegasus link status fix

  fixed up the link status detection
parent de37adec
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
/* /*
* Version Information * 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 <petkan@users.sourceforge.net>" #define DRIVER_AUTHOR "Petko Manolov <petkan@users.sourceforge.net>"
#define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver" #define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver"
...@@ -121,7 +121,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size, ...@@ -121,7 +121,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
char *buffer; char *buffer;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
buffer = kmalloc(size, GFP_KERNEL); buffer = kmalloc(size, GFP_DMA);
if (!buffer) { if (!buffer) {
warn("%s: looks like we're out of memory", __FUNCTION__); warn("%s: looks like we're out of memory", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
...@@ -170,7 +170,7 @@ static int set_registers(pegasus_t * pegasus, __u16 indx, __u16 size, ...@@ -170,7 +170,7 @@ static int set_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
char *buffer; char *buffer;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
buffer = kmalloc(size, GFP_KERNEL); buffer = kmalloc(size, GFP_DMA);
if (!buffer) { if (!buffer) {
warn("%s: looks like we're out of memory", __FUNCTION__); warn("%s: looks like we're out of memory", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
...@@ -218,7 +218,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data) ...@@ -218,7 +218,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data)
char *tmp; char *tmp;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
tmp = kmalloc(1, GFP_KERNEL); tmp = kmalloc(1, GFP_DMA);
if (!tmp) { if (!tmp) {
warn("%s: looks like we're out of memory", __FUNCTION__); warn("%s: looks like we're out of memory", __FUNCTION__);
return -ENOMEM; return -ENOMEM;
...@@ -711,11 +711,11 @@ static void intr_callback(struct urb *urb, struct pt_regs *regs) ...@@ -711,11 +711,11 @@ static void intr_callback(struct urb *urb, struct pt_regs *regs)
pegasus->stats.tx_aborted_errors++; pegasus->stats.tx_aborted_errors++;
if (d[0] & LATE_COL) if (d[0] & LATE_COL)
pegasus->stats.tx_window_errors++; pegasus->stats.tx_window_errors++;
if (d[0] & (NO_CARRIER | LOSS_CARRIER)) { if (d[5] & LINK_STATUS) {
pegasus->stats.tx_carrier_errors++;
netif_carrier_off(net);
} else {
netif_carrier_on(net); netif_carrier_on(net);
} else {
pegasus->stats.tx_carrier_errors++;
netif_carrier_off(net);
} }
} }
......
...@@ -52,6 +52,8 @@ ...@@ -52,6 +52,8 @@
#define LOSS_CARRIER 0x08 #define LOSS_CARRIER 0x08
#define JABBER_TIMEOUT 0x04 #define JABBER_TIMEOUT 0x04
#define LINK_STATUS 0x01
#define PEGASUS_REQT_READ 0xc0 #define PEGASUS_REQT_READ 0xc0
#define PEGASUS_REQT_WRITE 0x40 #define PEGASUS_REQT_WRITE 0x40
#define PEGASUS_REQ_GET_REGS 0xf0 #define PEGASUS_REQ_GET_REGS 0xf0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment