linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rainer Dorsch <rdorsch@web.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: hotplug and test and set
Date: Sun, 02 Jan 2005 17:07:04 +0000	[thread overview]
Message-ID: <200501021807.05051.rdorsch@web.de> (raw)
In-Reply-To: <200501020003.46376.rdorsch@web.de>

Am Sonntag, 2. Januar 2005 16:23 schrieb Kay Sievers:
> On Sun, 2005-01-02 at 14:30 +0100, Rainer Dorsch wrote:
> > Am Sonntag, 2. Januar 2005 02:27 schrieb Marco d'Itri:
> > > On Jan 02, Rainer Dorsch <rdorsch@web.de> wrote:
> > > > My problem is that this script is called four times when the dongle
> > > > is plugged in. I order to avoid to call pand four times, I added a
> > > > poor test and set to the script to add a lock when a pand is running.
> > > > Does anybody know, what I could do to get a better locking behaviour,
> > > > e.g. an atomic test and set?
> > > >
> > > >From http://linux-hotplug.sourceforge.net/?selected=usb:
> > >
> > > There are two kinds of usb hotplug event: device, and interface. Kernel
> > > 2.6 added device events, as well as reporting the complete set of
> > > interface events. You can tell which kind of event by the environment
> > > variables: device events don't include PRODUCT, or any of the other
> > > parameters here except DEVPATH and ACTION.
> > >
> > > So:
> > >
> > > # ignore device events
> > > [ "$PRODUCT" ] || exit 0
> >
> > Many thanks for the quick reply.
> >
> > /devices/pci0000:00/0000:00:07.2/usb1/1-2
> > /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.0
> > a12/1/525
> > /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.1
> > a12/1/525
> > /devices/pci0000:00/0000:00:07.2/usb1/1-2/1-2:1.2
> > a12/1/525
>
> You get one device event and three interface events for this USB device.
>
> > That means that I should scan for a DEVPATH variable ending with 1.0 (?)
>
> You may just just match the event for the device. Just add the exit
> statement Marco suggested and negate it to skip interface events
> instead.
>

Hmm... $PRODUCT and $TYPE are empty for the interface. Wouldn't that mean that 
I try to start pand for every usb device?

Thanks,
Rainer

-- 
Rainer Dorsch
Alzentalstr. 28
D-71083 Herrenberg
07032-919495
Icq: 32550367


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2005-01-02 17:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-01 23:03 hotplug and test and set Rainer Dorsch
2005-01-02  0:06 ` Kay Sievers
2005-01-02  1:27 ` Marco d'Itri
2005-01-02 13:30 ` Rainer Dorsch
2005-01-02 15:23 ` Kay Sievers
2005-01-02 17:07 ` Rainer Dorsch [this message]
2005-01-02 18:15 ` Kay Sievers

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=200501021807.05051.rdorsch@web.de \
    --to=rdorsch@web.de \
    --cc=linux-hotplug@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).