Hi,
can anybody here test suspend/resume patches for the usb irda driver?
Regards
Oliver
----
--- a/drivers/net/irda/irda-usb.c 2007-10-12 10:22:47.000000000 +0200
+++ b/drivers/net/irda/irda-usb.c 2007-10-12 13:04:41.000000000 +0200
@@ -1799,6 +1799,19 @@ err_out:
}
/*------------------------------------------------------------------*/
+static void irda_kill_urbs(struct irda_usb_cb *self)
+{
+ int i;
+
+ /* Stop all the receive URBs. Must be synchronous. */
+ for (i = 0; i < self->max_rx_urb; i++)
+ usb_kill_urb(self->rx_urb[i]);
+ /* Cancel Tx and speed URB.
+ * Make sure it's synchronous to avoid races. */
+ usb_kill_urb(self->tx_urb);
+ usb_kill_urb(self->speed_urb);
+}
+
/*
* The current irda-usb device is removed, the USB layer tell us
* to shut it down...
@@ -1841,13 +1854,7 @@ static void irda_usb_disconnect(struct u
/* Accept no more transmissions */
/*netif_device_detach(self->netdev);*/
netif_stop_queue(self->netdev);
- /* Stop all the receive URBs. Must be synchronous. */
- for (i = 0; i < self->max_rx_urb; i++)
- usb_kill_urb(self->rx_urb[i]);
- /* Cancel Tx and speed URB.
- * Make sure it's synchronous to avoid races. */
- usb_kill_urb(self->tx_urb);
- usb_kill_urb(self->speed_urb);
+ irda_kill_urbs(self);
}
/* Cleanup the device stuff */
@@ -1869,6 +1876,37 @@ static void irda_usb_disconnect(struct u
IRDA_DEBUG(0, "%s(), USB IrDA Disconnected\n", __FUNCTION__);
}
+static int irda_usb_suspend(struct usb_interface *intf, pm_message_t message)
+{
+ struct irda_usb_cb *self = usb_get_intfdata(intf);
+
+ if (!self)
+ return 0;
+
+ irda_kill_urbs(self);
+
+ return 0;
+}
+
+static int irda_usb_resume(struct usb_interface *intf)
+{
+ struct irda_usb_cb *self = usb_get_intfdata(intf);
+ struct urb *urb;
+ int i;
+
+ if (!self)
+ return -ENODEV;
+
+ if (self->netopen) {
+ for (i = 0; i < IU_MAX_ACTIVE_RX_URBS; i++) {
+ urb = self->rx_urb[i];
+ irda_usb_submit(self, urb->context, urb);
+ }
+ return 0;
+ } else {
+ return 0;
+ }
+}
/*------------------------------------------------------------------*/
/*
* USB device callbacks
@@ -1877,6 +1915,8 @@ static struct usb_driver irda_driver = {
.name = "irda-usb",
.probe = irda_usb_probe,
.disconnect = irda_usb_disconnect,
+ .suspend = irda_usb_suspend,
+ .resume = irda_usb_resume,
.id_table = dongles,
};
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users