[fprint] Hotpluggable devices
Bastien Nocera
hadess at hadess.net
Fri May 23 13:55:35 BST 2008
On Fri, 2008-05-23 at 13:41 +0100, Daniel Drake wrote:
> Bastien Nocera wrote:
> > Heya,
> >
> > I'm thinking of the way we could handle hotpluggable devices in fprintd.
> >
> > - Make libfprint export an FDI file that tells us all the fingerprint
> > reader devices it supports (adding an internal function giving us back a
> > struct containing that)
>
> Would be nice if we could generate it at compile time instead, but the
> idea sounds OK. I think you mentioned this was a requirement during our
> earlier discussions anyway, so that HAL knows which USB devices are
> supported fingerprint readers.
Our home-made application would do that, yes, we wouldn't do it
"on-the-fly". Any opinions on what I should call the function, and where
I should add it?
> > - Monitor hal inside fprintd, and get told when fingerprint devices are
> > added/removed (graceful failure when removed and in use, make sure that
> > libusb re-reads the full list of usb devices when
> > libusb_get_device_list() is called)
>
> Yes, libusb re-enumerates the buses. It should also handle disconnected
> devices OK, but not sure how libfprint deals with that right now.
Well, we'll have to see when I can test that :)
> > - internally, IDs for devices should be gathered from their position on
> > the usb bus, rather than just incrementing (that would mean the path to
> > the devices would stay constant across runs, rather than being
> > reordered). We'd need to modify libfprint to give that to us from
> > libusb.
>
> This is more tricky, since USB bus topology can completely change in a
> flash. There have been some recent discussions on the libusb mailing
> list about this
OK.
> > - DeviceAdded/DeviceRemoved in the manager (path to the object in the
> > signals)
> >
> > What do you think?
>
> It sounds like it would work, but the correct solution would be to have
> libusb provide the backing for this functionality. libusb would offer a
> callback mechanism to inform library users when USB devices are
> connected or disconnected. libfprint would bubble up this interface (for
> recognised devices only) to library users like fprintd.
Yes, most definitely.
> I'm planning this for libusb-1.1. I am planning to use HAL for device
> notifications, and maybe offer some lightweight options for embedded
> systems too. I hope that libusb-1.1 isn't too far off in the future -
> 1.0 is soon to enter beta, and 1.1 will be a fairly small incremental
> release (only planned features right now are some internal cleanups and
> device hotplug)
OK. I just wanted to be sure that the problem was well understood. I can
already get started on the HAL fdi file.
> Is hotpluggable device notifications a high priority requirement? Right
> now we do only get the device list at fprintd startup, but how about if
> we obtained the device list in fprint_manager_get_devices()?
It doesn't make much difference, given that fprintd is only started up
when someone pokes at its interface, usually to get the list of devices.
So we'd only be pushing the problem a tiny bit further.
More information about the fprint
mailing list