aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/net/pegasus.c17
-rw-r--r--drivers/usb/net/pegasus.h3
2 files changed, 14 insertions, 6 deletions
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c
index d48c024cff59..6d12961cf9f9 100644
--- a/drivers/usb/net/pegasus.c
+++ b/drivers/usb/net/pegasus.c
@@ -316,6 +316,7 @@ static int update_eth_regs_async(pegasus_t * pegasus)
316 return ret; 316 return ret;
317} 317}
318 318
319/* Returns 0 on success, error on failure */
319static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd) 320static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
320{ 321{
321 int i; 322 int i;
@@ -847,10 +848,16 @@ static void intr_callback(struct urb *urb)
847 * d[0].NO_CARRIER kicks in only with failed TX. 848 * d[0].NO_CARRIER kicks in only with failed TX.
848 * ... so monitoring with MII may be safest. 849 * ... so monitoring with MII may be safest.
849 */ 850 */
850 if (d[0] & NO_CARRIER) 851 if (pegasus->features & TRUST_LINK_STATUS) {
851 netif_carrier_off(net); 852 if (d[5] & LINK_STATUS)
852 else 853 netif_carrier_on(net);
853 netif_carrier_on(net); 854 else
855 netif_carrier_off(net);
856 } else {
857 /* Never set carrier _on_ based on ! NO_CARRIER */
858 if (d[0] & NO_CARRIER)
859 netif_carrier_off(net);
860 }
854 861
855 /* bytes 3-4 == rx_lostpkt, reg 2E/2F */ 862 /* bytes 3-4 == rx_lostpkt, reg 2E/2F */
856 pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4]; 863 pegasus->stats.rx_missed_errors += ((d[3] & 0x7f) << 8) | d[4];
@@ -950,7 +957,7 @@ static void set_carrier(struct net_device *net)
950 pegasus_t *pegasus = netdev_priv(net); 957 pegasus_t *pegasus = netdev_priv(net);
951 u16 tmp; 958 u16 tmp;
952 959
953 if (!read_mii_word(pegasus, pegasus->phy, MII_BMSR, &tmp)) 960 if (read_mii_word(pegasus, pegasus->phy, MII_BMSR, &tmp))
954 return; 961 return;
955 962
956 if (tmp & BMSR_LSTATUS) 963 if (tmp & BMSR_LSTATUS)
diff --git a/drivers/usb/net/pegasus.h b/drivers/usb/net/pegasus.h
index c7467823cd1c..c7aadb413e8c 100644
--- a/drivers/usb/net/pegasus.h
+++ b/drivers/usb/net/pegasus.h
@@ -11,6 +11,7 @@
11 11
12#define PEGASUS_II 0x80000000 12#define PEGASUS_II 0x80000000
13#define HAS_HOME_PNA 0x40000000 13#define HAS_HOME_PNA 0x40000000
14#define TRUST_LINK_STATUS 0x20000000
14 15
15#define PEGASUS_MTU 1536 16#define PEGASUS_MTU 1536
16#define RX_SKBS 4 17#define RX_SKBS 4
@@ -203,7 +204,7 @@ PEGASUS_DEV( "AEI USB Fast Ethernet Adapter", VENDOR_AEILAB, 0x1701,
203PEGASUS_DEV( "Allied Telesyn Int. AT-USB100", VENDOR_ALLIEDTEL, 0xb100, 204PEGASUS_DEV( "Allied Telesyn Int. AT-USB100", VENDOR_ALLIEDTEL, 0xb100,
204 DEFAULT_GPIO_RESET | PEGASUS_II ) 205 DEFAULT_GPIO_RESET | PEGASUS_II )
205PEGASUS_DEV( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121, 206PEGASUS_DEV( "Belkin F5D5050 USB Ethernet", VENDOR_BELKIN, 0x0121,
206 DEFAULT_GPIO_RESET | PEGASUS_II ) 207 DEFAULT_GPIO_RESET | PEGASUS_II | TRUST_LINK_STATUS )
207PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986, 208PEGASUS_DEV( "Billionton USB-100", VENDOR_BILLIONTON, 0x0986,
208 DEFAULT_GPIO_RESET ) 209 DEFAULT_GPIO_RESET )
209PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987, 210PEGASUS_DEV( "Billionton USBLP-100", VENDOR_BILLIONTON, 0x0987,