-----Original Message-----
>From: Hans Petter Selasky [mailto:hsela...@c2i.net] 
>
>I think mav @ did some work in that area?
>
>Are you sure you cannot use:
>...
>          if (id != 0)
>                       copyin(ugd->ugd_data, &id, 1);
>                error = uhid_set_report(sc, ugd->ugd_report_type, id,
>                    NULL, ugd->ugd_data, imin(ugd->ugd_maxlen, size));
>                break;

That's definitely cleaner, using the ugd fields to denote a special case.
I'm not sure about the (id != 0) - I'll need to check my specific devices,
but something like:

if(ugd->ugd_config_index) // abusing variables to set a flag, use passed in
id and size in lang_id and actlen
        error = uhid_set_report(sc, ugd->ugd_report_type, ugd->ugd_lang_id,
NULL, 
                ugd->ugd_data, ugd->ugd_actlen);
else
        error = uhid_set_report(sc, ugd->ugd_report_type, id, NULL, 
                ugd->ugd_data, size);

Would suit my needs well, as long as I remember to zero out ugd_config_index
on a normal one!

I suppose I need to rebuild the kernel. Thanks for your time and help!

Sam



_______________________________________________
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"

Reply via email to