On Mon, Apr 18, 2011 at 11:26:42AM -0700, Jason Gerecke wrote:
> Since only protocol 5 devices (Intuos, Cintiq) allow tool-specific
> serial numbers, we limit hotplugging to devices supporting that
> protocol.
> 
> For this to work, we need to move the call to wcmInitModel (which
> several calls down sets common->wcmProtocolLevel) before the call
> to wcmParseOptions. From what I can tell, the order of calls shouldn't
> otherwise matter here.

I dont think that will work for ISDv4. The baud rate is set during
wcmParseOptions and used in wcmInitModel.

I think wcmParseOptions() should be split up into two separate parsing
options, one for model/system specific configuration and one for actual
options that apply to a tool.

Cheers,
  Peter

> Signed-off-by: Jason Gerecke <killert...@gmail.com>
> ---
>  src/wcmConfig.c         |    4 ++--
>  src/wcmValidateDevice.c |    6 ++++++
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/src/wcmConfig.c b/src/wcmConfig.c
> index 5fa8271..1b4fc42 100644
> --- a/src/wcmConfig.c
> +++ b/src/wcmConfig.c
> @@ -564,10 +564,10 @@ static int wcmPreInit(InputDriverPtr drv, InputInfoPtr 
> pInfo, int flags)
>       if (!wcmSetType(pInfo, type))
>               goto SetupProc_fail;
>  
> -     if (!wcmParseOptions(pInfo, need_hotplug, is_dependent))
> +     if (!wcmInitModel(pInfo))
>               goto SetupProc_fail;
>  
> -     if (!wcmInitModel(pInfo))
> +     if (!wcmParseOptions(pInfo, need_hotplug, is_dependent))
>               goto SetupProc_fail;
>  
>       if (need_hotplug)
> diff --git a/src/wcmValidateDevice.c b/src/wcmValidateDevice.c
> index 8e4f4cd..0785c21 100644
> --- a/src/wcmValidateDevice.c
> +++ b/src/wcmValidateDevice.c
> @@ -578,6 +578,12 @@ int wcmParseSerials (InputInfoPtr pInfo)
>               return 0; /*Parse has been already done*/
>       }
>  
> +     if (common->wcmProtocolLevel != WCM_PROTOCOL_5)
> +     {
> +             xf86Msg(X_WARNING, "ToolSerials option not valid on this 
> device.\n");
> +             return 0;
> +     }
> +
>       s = xf86SetStrOption(pInfo->options, "ToolSerials", NULL);
>       if (s) /*Dont parse again, if the commons have values already*/
>       {
> -- 
> 1.7.4.1

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to