aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/net
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-05-01 14:02:45 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-05-08 23:43:55 -0700
commit7e713b825610de9a9584c189c72e2d9f2326359c (patch)
treed0936b3d12c2185f537b339942719ca2cedbef9d /drivers/usb/net
parent6275cdfa0fe032208937a3567ebb8bcfd42d20b1 (diff)
[PATCH] USB: pegasus fixes (logstorm, suspend)
Teach "pegasus" to handle a few of the disconnect fault paths without hundreds of usless syslog messages. Handle the carrier check workqueue entry even if the driver has not been opened. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/net')
-rw-r--r--drivers/usb/net/pegasus.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c
index 2deb4c01539..7683926a1b6 100644
--- a/drivers/usb/net/pegasus.c
+++ b/drivers/usb/net/pegasus.c
@@ -318,6 +318,8 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
set_register(pegasus, PhyCtrl, (indx | PHY_READ));
for (i = 0; i < REG_TIMEOUT; i++) {
ret = get_registers(pegasus, PhyCtrl, 1, data);
+ if (ret == -ESHUTDOWN)
+ goto fail;
if (data[0] & PHY_DONE)
break;
}
@@ -326,6 +328,7 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd)
*regd = le16_to_cpu(regdi);
return ret;
}
+fail:
if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
@@ -354,12 +357,15 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd)
set_register(pegasus, PhyCtrl, (indx | PHY_WRITE));
for (i = 0; i < REG_TIMEOUT; i++) {
ret = get_registers(pegasus, PhyCtrl, 1, data);
+ if (ret == -ESHUTDOWN)
+ goto fail;
if (data[0] & PHY_DONE)
break;
}
if (i < REG_TIMEOUT)
return ret;
+fail:
if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
return -ETIMEDOUT;
@@ -387,6 +393,8 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata)
ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
if (tmp & EPROM_DONE)
break;
+ if (ret == -ESHUTDOWN)
+ goto fail;
}
if (i < REG_TIMEOUT) {
ret = get_registers(pegasus, EpromData, 2, &retdatai);
@@ -394,6 +402,7 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata)
return ret;
}
+fail:
if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
return -ETIMEDOUT;
@@ -433,12 +442,15 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data)
for (i = 0; i < REG_TIMEOUT; i++) {
ret = get_registers(pegasus, EpromCtrl, 1, &tmp);
+ if (ret == -ESHUTDOWN)
+ goto fail;
if (tmp & EPROM_DONE)
break;
}
disable_eprom_write(pegasus);
if (i < REG_TIMEOUT)
return ret;
+fail:
if (netif_msg_drv(pegasus))
dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__);
return -ETIMEDOUT;
@@ -1378,9 +1390,8 @@ static int pegasus_suspend (struct usb_interface *intf, pm_message_t message)
struct pegasus *pegasus = usb_get_intfdata(intf);
netif_device_detach (pegasus->net);
+ cancel_delayed_work(&pegasus->carrier_check);
if (netif_running(pegasus->net)) {
- cancel_delayed_work(&pegasus->carrier_check);
-
usb_kill_urb(pegasus->rx_urb);
usb_kill_urb(pegasus->intr_urb);
}
@@ -1400,10 +1411,9 @@ static int pegasus_resume (struct usb_interface *intf)
pegasus->intr_urb->status = 0;
pegasus->intr_urb->actual_length = 0;
intr_callback(pegasus->intr_urb, NULL);
-
- queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
- CARRIER_CHECK_DELAY);
}
+ queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
+ CARRIER_CHECK_DELAY);
return 0;
}