* Hotplugging USB Compact flash reader
@ 2002-08-09 4:40 Ajay
2002-08-10 4:58 ` Ajay
2002-08-10 19:49 ` David Brownell
0 siblings, 2 replies; 3+ messages in thread
From: Ajay @ 2002-08-09 4:40 UTC (permalink / raw)
To: linux-hotplug
HI,
I am a first timer in this groups.
I am trying to develop something that can recognize
when a USB Flash card reader is plugged in, when a
media is plugged into the reader, and when either of
them are removed. Something like plug and play - just
plug in and an icon appears on the desktop which takes
you to the diectory. I guess hotplugging should have
the answer.
I read as much as I could but I can't figure out where
/sbin/hotplug and usb.agent fit in. How do I trap the
hotplug notification? Do I have to "register"? How do
I do that?
Thanks and regards,
Ajay
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Hotplugging USB Compact flash reader
2002-08-09 4:40 Hotplugging USB Compact flash reader Ajay
@ 2002-08-10 4:58 ` Ajay
2002-08-10 19:49 ` David Brownell
1 sibling, 0 replies; 3+ messages in thread
From: Ajay @ 2002-08-10 4:58 UTC (permalink / raw)
To: linux-hotplug
I figured out enough of usb.agent to be able to trace
it to a point where I found that the handbook and the
userbook do not have a match for the VID-PID for the
reader that I'm using (it's an SCM ORCA cf-ms-sm-sd
reader). However I found that it loads (binds?) the
correct drivers. So in the "add" event I simply added
"mount /dev/sda /mnt/cf" and in the "remove" event I
unmounted it. All this is in usb.agent.
In Gnome this works fine - an icon comes to the
desktop without me having to do anything else. In KDE,
there is no icon, but the device is mounted.
My question is:
1. Is it correct to modify usb.agent itself? Should I
rather include the VID-PID and other details in
the handbook/userbook?
2. What is the "match-flag"?? AFAI can see it seems to
be a "mask flag" - something to be 'anded' with
something else. What is the principle behind it?
3. This is premature, but could someone give me a hint
as to which desktop agent I should be talking to?
Thanks and regards,
Ajay.
--- David Brownell <david-b@pacbell.net> wrote: >
Ajay wrote:
> > HI,
> > I am a first timer in this groups.
> > I am trying to develop something that can
> recognize
> > when a USB Flash card reader is plugged in, when a
> > media is plugged into the reader, and when either
> of
> > them are removed. Something like plug and play -
> just
> > plug in and an icon appears on the desktop which
> takes
> > you to the diectory. I guess hotplugging should
> have
> > the answer.
>
> You're asking about a missing piece, or maybe a
> couple.
>
> - "disk level" hotplug events, reporting new storage
> so that it can be mounted. in 2.5 it seems like
> at least the "scsi hotplug" may really happen,
> which
> should solve your USB cardreader issue.
>
> - hotplug events talking to X11 desktops
>
> UNIX desktops traditionally "knew" that only a few
> devices
> might ever get new media, and polled things like
> diskette
> and cdrom devices from some desktop monitoring
> program.
> (Maybe not the same one polling for filesystem
> changes.)
>
> Of Linux today, such devices can connect
> dynamically, so
> any "poll only these devices" architecture just
> loses.
>
> One of the KDE or GNOME object model hooks ought to
> do
> nicely to let some hotplug agent talk to some
> service
> running inside the desktop, reusing infrastructure
> that'd
> otherwise need to be reinvented for a "raw X11"
> solution.
>
>
> > I read as much as I could but I can't figure out
> where
> > /sbin/hotplug and usb.agent fit in. How do I trap
> the
> > hotplug notification? Do I have to "register"? How
> do
> > I do that?
>
> Considering that you'd need to design some of the
> hotplug
> events needed to address this problem, you'll need
> to
> understand enough to create those answers yourself
> ... or
> wait for someone else to address them! :)
>
> The core observation will be that the hotplug agent
> for
> some TBD "storage hotplug event" would need to
> invoke some
> program that's permitted to talk to the relevant
> desktop
> service, which would pop up your desktop icon.
>
> - Dave
>
>
>
>
-------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> 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
=="The worst thing one can do is not to try, to be aware of what one wants and not give in to it, to spend years in silent hurt wondering if something could have materialized -- and never knowing."
- David Viscott
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Hotplugging USB Compact flash reader
2002-08-09 4:40 Hotplugging USB Compact flash reader Ajay
2002-08-10 4:58 ` Ajay
@ 2002-08-10 19:49 ` David Brownell
1 sibling, 0 replies; 3+ messages in thread
From: David Brownell @ 2002-08-10 19:49 UTC (permalink / raw)
To: linux-hotplug
> 1. Is it correct to modify usb.agent itself? Should I
> rather include the VID-PID and other details in
> the handbook/userbook?
Don't modify usb.agent, no ... /etc/hotplug/usb/$DRIVERNAME
is where you put per-driver setup/config tweaks.
From what you said, you're assuming only one reader (or
SCSI-ish device) will ever be connected ... you're choosing
a single device name and mount point. That's error prone;
the reason is that you're using the wrong level of hotplug
event. As I said earlier, to solve this safely you need
higher level hotplug events: "here's a disk" (/dev/sdc or
whatever).
> 2. What is the "match-flag"?? AFAI can see it seems to
> be a "mask flag" - something to be 'anded' with
> something else. What is the principle behind it?
See <linux/usb.h> for "struct usb_device_id" support.
> 3. This is premature, but could someone give me a hint
> as to which desktop agent I should be talking to?
To my knowledge, there is no such desktop agent yet.
That's why I suggested you be prepared to write one.
- Dave
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-08-10 19:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-09 4:40 Hotplugging USB Compact flash reader Ajay
2002-08-10 4:58 ` Ajay
2002-08-10 19:49 ` David Brownell
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).