Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 2009 22:02:32 +0900
From:      Daichi GOTO <daichi@ongs.co.jp>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-current@freebsd.org, Masanori OZAWA <ozawa@ongs.co.jp>
Subject:   Re: USB2: ugd round bug?   including patch to solve.
Message-ID:  <49786E68.3030306@ongs.co.jp>
In-Reply-To: <200901221327.47634.hselasky@c2i.net>
References:  <4978598E.80800@ongs.co.jp> <200901221327.47634.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi HPS,

Cool!  thanks for your fastest check!  I'm looking forward to
current merging time ;)

Hans Petter Selasky wrote:
> On Thursday 22 January 2009, Daichi GOTO wrote:
>> Hi USB2 folks ;-)
>>
>> First I should show you my big respect. Thank you very much for your
>> great usb2 work. That works very well.
>>
>> Using usb2, I have found a issue around uhid.  ugd will be zero-cleared
>> when ioctl(fd, USB_GET_REPORT_DESC, &ugd) is called.
>>
>> For example, follow ioctl are used to get information of report descriptor.
>>
>>      memset(&ugd, 0, sizeof(ugd));
>>      ugd.ugd_data = malloc(len);
>>      ugd.ugd_maxlen = len;
>>
>>      ioctl(fd, USB_GET_REPORT_DESC, &ugd)
>>
>> The information of report descriptor should be copied to ugd, but ugd is
>> zero-cleared.
>>
>>  From my research, perphaps follow patch is good solution to solve this
>> problem. How do you usb2 guys make of this?  Please check and solve
>> this issue. Thanks :)
> 
> Hi Daichi!
> 
> Your patch is absolutely correct! Committed to P4. Will reach -current early 
> next week!
> 
> http://perforce.freebsd.org/chv.cgi?CH=156515
> 
> Thanks for testing and finding bugs!
> 
> --HPS
> 
>> --- sys/dev/usb2/include/usb2_ioctl.h.orig      2009-01-22
>> 20:11:13.000000000 +0900 +++ sys/dev/usb2/include/usb2_ioctl.h   2009-01-22
>> 20:09:35.000000000 +0900 @@ -223,7 +223,7 @@
>>   #define        USB_DEVICEENUMERATE     _IOW ('U', 6, int)
>>
>>   /* Generic HID device */
>> -#define        USB_GET_REPORT_DESC     _IOR ('U', 21, struct
>> usb2_gen_descriptor) +#define        USB_GET_REPORT_DESC     _IOWR('U', 21,
>> struct usb2_gen_descriptor) #define        USB_SET_IMMED           _IOW
>> ('U', 22, int)
>>   #define        USB_GET_REPORT          _IOWR('U', 23, struct
>> usb2_gen_descriptor) #define        USB_SET_REPORT          _IOW ('U', 24,
>> struct usb2_gen_descriptor)
> 
> 
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"

-- 
   Daichi GOTO, http://people.freebsd.org/~daichi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49786E68.3030306>