From: Oliver Neukum <oliver@neukum.org>
To: linux-usb-devel@lists.sourceforge.net
Cc: Tilman Schmidt <tilman@imap.cc>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, Greg KH <gregkh@suse.de>,
Hansjoerg Lipp <hjlipp@web.de>, Karsten Keil <kkeil@suse.de>,
i4ldeveloper@listserv.isdn4linux.de
Subject: Re: [linux-usb-devel] [PATCH 1/2] usb_gigaset: suspend support
Date: Tue, 30 Oct 2007 09:52:43 +0100 [thread overview]
Message-ID: <200710300952.44232.oliver@neukum.org> (raw)
In-Reply-To: <20071029185311.4C955FC04C@xenon.ts.pxnet.com>
Am Montag 29 Oktober 2007 schrieb Tilman Schmidt:
> From: Tilman Schmidt <tilman@imap.cc>
>
> Add basic suspend/resume support to the usb_gigaset driver.
>
> Signed-off-by: Tilman Schmidt <tilman@imap.cc>
> ---
>
> drivers/isdn/gigaset/usb-gigaset.c | 69 ++++++++++++++++++++++++++++++++++++-
> 1 file changed, 68 insertions(+), 1 deletion(-)
>
> --- a/drivers/isdn/gigaset/usb-gigaset.c 2007-10-23 01:48:12.000000000 +0200
> +++ b/drivers/isdn/gigaset/usb-gigaset.c 2007-10-24 00:47:32.000000000 +0200
> @@ -104,10 +104,15 @@ MODULE_DEVICE_TABLE(usb, gigaset_table);
> * flags per packet.
> */
>
> +/* functions called if a device of this driver is connected/disconnected */
> static int gigaset_probe(struct usb_interface *interface,
> const struct usb_device_id *id);
> static void gigaset_disconnect(struct usb_interface *interface);
>
> +/* functions called before/after suspend */
> +static int gigaset_suspend(struct usb_interface *intf, pm_message_t message);
> +static int gigaset_resume(struct usb_interface *intf);
> +
> static struct gigaset_driver *driver = NULL;
> static struct cardstate *cardstate = NULL;
>
> @@ -117,6 +122,11 @@ static struct usb_driver gigaset_usb_dri
> .probe = gigaset_probe,
> .disconnect = gigaset_disconnect,
> .id_table = gigaset_table,
> + .suspend = gigaset_suspend,
> + .resume = gigaset_resume,
> + .reset_resume = gigaset_resume,
> + .pre_reset = gigaset_suspend,
> + .post_reset = gigaset_resume,
> };
>
> struct usb_cardstate {
> @@ -831,7 +843,7 @@ static void gigaset_disconnect(struct us
> usb_set_intfdata(interface, NULL);
> tasklet_kill(&cs->write_tasklet);
>
> - usb_kill_urb(ucs->bulk_out_urb); /* FIXME: only if active? */
> + usb_kill_urb(ucs->bulk_out_urb);
>
> kfree(ucs->bulk_out_buffer);
> usb_free_urb(ucs->bulk_out_urb);
> @@ -847,6 +859,63 @@ static void gigaset_disconnect(struct us
> gigaset_unassign(cs);
> }
>
> +/* gigaset_suspend
> + * This function is called before the USB connection is suspended or reset.
> + */
> +static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
> +{
> + struct cardstate *cs;
> + struct usb_cardstate *ucs;
> + int rc;
> +
> + if ((cs = usb_get_intfdata(intf)) == NULL ||
> + (ucs = cs->hw.usb) == NULL) {
> + err("%s: no cardstate", __func__);
> + return -EFAULT;
> + }
> +
> + //FIXME stop common module activities? ISDN_STAT_STOP? block open()?
> +
> + /* stop submitting bulk URBs */
> + tasklet_disable(&cs->write_tasklet);
> +
> + /* kill pending read URB */
> + usb_kill_urb(ucs->read_urb);
no pending write URB?
Regards
Oliver
next prev parent reply other threads:[~2007-10-30 8:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20071029185311.4C955FC04C@xenon.ts.pxnet.com>
2007-10-29 19:10 ` [linux-usb-devel] [PATCH 1/2] usb_gigaset: suspend support Alan Stern
2007-10-29 21:20 ` Tilman Schmidt
2007-10-30 8:52 ` Oliver Neukum [this message]
2007-11-01 20:17 ` Tilman Schmidt
[not found] ` <20071029214131.70EABFC043@xenon.ts.pxnet.com>
2007-10-30 21:01 ` [PATCH 1/2] usb_gigaset: suspend support [v2] Andrew Morton
2007-11-01 18:20 ` Tilman Schmidt
2007-11-01 18:45 ` Andrew Morton
2007-11-01 19:47 ` [linux-usb-devel] " Alan Stern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200710300952.44232.oliver@neukum.org \
--to=oliver@neukum.org \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=hjlipp@web.de \
--cc=i4ldeveloper@listserv.isdn4linux.de \
--cc=kkeil@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=tilman@imap.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox