[systemd-devel] systemd unit review requested

Peter Hutterer peter.hutterer at who-t.net
Sun Dec 8 18:18:55 PST 2013


On Fri, Dec 06, 2013 at 04:10:02PM +0100, Kay Sievers wrote:
> On Fri, Dec 6, 2013 at 7:20 AM, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> 
> >> >It also depends on the wacom_w8001 and how it reacts when it's loaded
> >> >and no hardware is present.
> >> >
> >> >Peter, couldn't this module be autoloaded?
> >
> > the module just sits there, it needs to be triggered by
> > inputattach to actually hook onto the device. there's a small number of
> > devices only that need it, so unconditionally modprobing it seems a bit
> > wasteful.
> 
> Just curious:
> 
> There is one auto-loading alias in the module for the serio bus:
>   $ modinfo wacom_w8001 | grep alias
>   alias:          serio:ty02pr39id*ex*
> 
> Does that work? For all devices or only a few?
> Can the serial device be detected that way?
> Does inputattach talk to the device to find out what it is?

tbh, I'm not sure how to answer these questions, it's not something I've had
to deal with in the past so I've got little to no knowledge of this.

inputattach does not talk to the device, it merely sets various fields as
provided by the user, hence the --w8001 flag. other than that, it's pretty
much down to four commands:
    open(dev/ttyS0)
    setline(fd, CS8, baudrate)
    ioctl(fd, TIOSETD, N_MOUSE)
    ioctl(fd, SPIOCSTYPE, SERIO_W8001)

That's why we need the udev rule to match the pnpid, because inputattach
doesn't do any matching and we need to provide the right arguments already.
afaik the only way to detect the device is to search for e.g. WACf in
the pnpid.

Cheers,
   Peter


More information about the systemd-devel mailing list