Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150575
b: refs/heads/master
c: e13f931
h: refs/heads/master
i:
  150573: 627cc58
  150571: f3c84f2
  150567: ae83346
  150559: 66d807f
v: v3
  • Loading branch information
Tadashi Abe authored and David S. Miller committed May 30, 2009
1 parent 5dad0b3 commit cad933e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cd39c7a5717191c677a140565bda2f1ca485ecd8
refs/heads/master: e13f93188b8a3b418da2a02dfa1a46718cf4607b
40 changes: 40 additions & 0 deletions trunk/drivers/net/irda/irda-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1859,6 +1859,42 @@ static void irda_usb_disconnect(struct usb_interface *intf)
IRDA_DEBUG(0, "%s(), USB IrDA Disconnected\n", __func__);
}

#ifdef CONFIG_PM
/* USB suspend, so power off the transmitter/receiver */
static int irda_usb_suspend(struct usb_interface *intf, pm_message_t message)
{
struct irda_usb_cb *self = usb_get_intfdata(intf);
int i;

netif_device_detach(self->netdev);

if (self->tx_urb != NULL)
usb_kill_urb(self->tx_urb);
if (self->speed_urb != NULL)
usb_kill_urb(self->speed_urb);
for (i = 0; i < self->max_rx_urb; i++) {
if (self->rx_urb[i] != NULL)
usb_kill_urb(self->rx_urb[i]);
}
return 0;
}

/* Coming out of suspend, so reset hardware */
static int irda_usb_resume(struct usb_interface *intf)
{
struct irda_usb_cb *self = usb_get_intfdata(intf);
int i;

for (i = 0; i < self->max_rx_urb; i++) {
if (self->rx_urb[i] != NULL)
usb_submit_urb(self->rx_urb[i], GFP_KERNEL);
}

netif_device_attach(self->netdev);
return 0;
}
#endif

/*------------------------------------------------------------------*/
/*
* USB device callbacks
Expand All @@ -1868,6 +1904,10 @@ static struct usb_driver irda_driver = {
.probe = irda_usb_probe,
.disconnect = irda_usb_disconnect,
.id_table = dongles,
#ifdef CONFIG_PM
.suspend = irda_usb_suspend,
.resume = irda_usb_resume,
#endif
};

/************************* MODULE CALLBACKS *************************/
Expand Down

0 comments on commit cad933e

Please sign in to comment.