ChangeSet 1.1101.3.6, 2003/04/09 17:00:27-07:00, petkan@users.sourceforge.net [PATCH] USB: pegasus link status detection fix This one is fixing up the link status detection. One device is removed from the list - it turned out it isn't a Linksys device after all. Overlooked allocation of urb buffer with GFP_KERNEL flag fixed too. drivers/usb/pegasus.c | 10 +++++++--- drivers/usb/pegasus.h | 6 +++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff -Nru a/drivers/usb/pegasus.c b/drivers/usb/pegasus.c --- a/drivers/usb/pegasus.c Fri Apr 18 15:01:02 2003 +++ b/drivers/usb/pegasus.c Fri Apr 18 15:01:02 2003 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2002 Petko Manolov (petkan@users.sourceforge.net) + * Copyright (c) 1999-2003 Petko Manolov (petkan@users.sourceforge.net) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -42,7 +42,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v0.4.29 (2002/12/31)" +#define DRIVER_VERSION "v0.4.30 (2003/04/01)" #define DRIVER_AUTHOR "Petko Manolov " #define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver" @@ -625,8 +625,12 @@ pegasus->stats.tx_aborted_errors++; if (d[0] & LATE_COL) pegasus->stats.tx_window_errors++; - if (d[0] & (NO_CARRIER | LOSS_CARRIER)) + if (d[5] & LINK_STATUS) { + netif_carrier_on(net); + } else { + netif_carrier_off(net); pegasus->stats.tx_carrier_errors++; + } } } #endif diff -Nru a/drivers/usb/pegasus.h b/drivers/usb/pegasus.h --- a/drivers/usb/pegasus.h Fri Apr 18 15:01:02 2003 +++ b/drivers/usb/pegasus.h Fri Apr 18 15:01:02 2003 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2002 Petko Manolov - Petkan (petkan@users.sourceforge.net) + * Copyright (c) 1999-2003 Petko Manolov - Petkan (petkan@users.sourceforge.net) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as published @@ -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 @@ -231,8 +233,6 @@ PEGASUS_DEV( "LANEED USB Ethernet LD-USB/T", VENDOR_LANEED, 0xabc1, DEFAULT_GPIO_RESET ) PEGASUS_DEV( "LANEED USB Ethernet LD-USB/TX", VENDOR_LANEED, 0x200c, - DEFAULT_GPIO_RESET | PEGASUS_II ) -PEGASUS_DEV( "LANEED USB Ethernet LD-USBL/TX", VENDOR_LANEED, 0x4005, DEFAULT_GPIO_RESET | PEGASUS_II ) PEGASUS_DEV( "Linksys USB10TX", VENDOR_LINKSYS, 0x2202, LINKSYS_GPIO_RESET )