RE: [PATCH v6 13/14] platform/x86: wmi: create character devices when requested by drivers

From: Mario.Limonciello
Date: Tue Oct 10 2017 - 09:41:52 EST


> -----Original Message-----
> From: Greg KH [mailto:greg@xxxxxxxxx]
> Sent: Tuesday, October 10, 2017 6:07 AM
> To: Limonciello, Mario <Mario_Limonciello@xxxxxxxx>
> Cc: dvhart@xxxxxxxxxxxxx; Andy Shevchenko <andy.shevchenko@xxxxxxxxx>;
> LKML <linux-kernel@xxxxxxxxxxxxxxx>; platform-driver-x86@xxxxxxxxxxxxxxx;
> Andy Lutomirski <luto@xxxxxxxxxx>; quasisec@xxxxxxxxxx;
> pali.rohar@xxxxxxxxx; rjw@xxxxxxxxxxxxx; mjg59@xxxxxxxxxx; hch@xxxxxx
> Subject: Re: [PATCH v6 13/14] platform/x86: wmi: create character devices when
> requested by drivers
>
> On Mon, Oct 09, 2017 at 05:51:51PM -0500, Mario Limonciello wrote:
> > --- /dev/null
> > +++ b/include/uapi/linux/wmi.h
> > @@ -0,0 +1,19 @@
> > +/*
> > + * User API methods for ACPI-WMI mapping driver
> > + *
> > + * Copyright (C) 2017 Dell, Inc.
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License version 2 as
> > + * published by the Free Software Foundation.
> > + */
> > +#ifndef _UAPI_LINUX_WMI_H
> > +#define _UAPI_LINUX_WMI_H
> > +
> > +#define WMI_IOC 'W'
> > +#define WMI_IO(instance) _IO(WMI_IOC, instance)
> > +#define WMI_IOR(instance, type) _IOR(WMI_IOC, instance, type)
> > +#define WMI_IOW(instance, type) _IOW(WMI_IOC, instance, type)
> > +#define WMI_IOWR(instance, type) _IOWR(WMI_IOC, instance, type)
>
> Are these really needed in a uapi .h file? Who needs them? And why not
> just use a "normal" ioctl macro in your individual driver .h file? Do
> these really help?
>
Since this is setting precedent that WMI drivers will use the IOC 'W' and the WMI
bus driver will dispatch calls to the proper drivers, I think they make sense to include.

I'm a little unclear - do you disagree? Or do you just think I need to include a comment
in the header file with this information?

Thanks,