A bug in USB HID class driver

A bug in USB HID class driver

Post by hilber » Sun, 06 Apr 2003 12:19:54



I am developing vendor specific USB host controller driver.
I have problems with USB composite device[Keyboard+Mouse].
It turns out a Microsoft bug,
May I know how to notify Microsoft to fix it?

The case is here:
In HID code, there are two functions,
CHid::HidThread()
{

    ...
    SetIdle();
    ...

Quote:}

CHid::HidNewDevice()
{
    GetReport();

Quote:}

Since these two calles issue usb control transfer to the
control endpoint from different Task.
There is no serialization to prevent them from get called
the same time.
for the USB composite devie with Kby+Mouse, the racing
condition is raised up.

normally,
HidNewDevice will call GetReport for Keyboard,
and try to call GetReport for Mouse right away,
after a while GetReport for Keyboard is completed,
SetIDLE will be called. so it's naturally serialized.

HidNewDevice will call GetReport for Keyboard,
and suspended by high prority task,
GetReport for Keyboard will be completed, then signal
HidThread, so SetIDLE will be called before calling
GetReport for Mouse,
since now on, HID class driver just hang.

my current workaround is just remove that "SetIDLE"
function. it has no impact on functioning but has impact
on power saving

 
 
 

A bug in USB HID class driver

Post by Steve Schrock [MS » Wed, 09 Apr 2003 01:32:28


The SetIdle() call can always be made, not just for keyboards, so it seems
reasonable to call SetIdle() just after the call to GetReport(). This way
the control transfers will be issued by the same thread. The only potential
problem is if the SetIdle request is stalled by the device, so check for the
USB_STALL error return and clear the stall feature if necessary.

--
Steve Schrock
Windows CE Device Drivers

This posting is provided "AS IS" with no warranties, and confers no rights.


Quote:

> I am developing vendor specific USB host controller driver.
> I have problems with USB composite device[Keyboard+Mouse].
> It turns out a Microsoft bug,
> May I know how to notify Microsoft to fix it?

> The case is here:
> In HID code, there are two functions,
> CHid::HidThread()
> {

>     ...
>     SetIdle();
>     ...
> }

> CHid::HidNewDevice()
> {
>     GetReport();
> }

> Since these two calles issue usb control transfer to the
> control endpoint from different Task.
> There is no serialization to prevent them from get called
> the same time.
> for the USB composite devie with Kby+Mouse, the racing
> condition is raised up.

> normally,
> HidNewDevice will call GetReport for Keyboard,
> and try to call GetReport for Mouse right away,
> after a while GetReport for Keyboard is completed,
> SetIDLE will be called. so it's naturally serialized.

> HidNewDevice will call GetReport for Keyboard,
> and suspended by high prority task,
> GetReport for Keyboard will be completed, then signal
> HidThread, so SetIDLE will be called before calling
> GetReport for Mouse,
> since now on, HID class driver just hang.

> my current workaround is just remove that "SetIDLE"
> function. it has no impact on functioning but has impact
> on power saving


 
 
 

1. Debugger fails to connect with USB HID Class Driver...

Hi,

I have a CEPC platform with WinCE 4.1. I wanted to use it with a USB mouse.
For that, I presume it is necessary to include the USB Human Input
Device (HID) Class Driver feature in my platform.
I did that and then built the platform and tried to download it.
Surprisingly, with the HID driver, my platform fails to boot correctly,
and it is shown a dialog in my development workstation saying that the
debugger has lost the connection to the device.

I don't see the relation between the debugger connection and the HID
component. And the problem is that, after removing the component and
re-building the platform, the debugger connection failure still remains.
Before adding the HID component, everything worked fine (except the USB
mouse, obviously!).

Has anyone noticed this problem before?
Thanks in advance.
Eurico

2. 3D client edge under wxWin

3. Newbie: How to rebuild USB HID Class Driver?

4. FAT32 Question

5. USB hid driver still need kbdmouse driver?

6. logitech ifeel mouse

7. Hiding classes in class view

8. finding product ID number

9. usb to pcmcia class driver - (smartmedia reader)

10. USB Content security class driver development

11. Question: A Whole Lotta Drivers - HID USB ctfmon keyboard and mouse

12. USb driver for Asus A7v266-e where do i find the latest USb driver ??

13. USB HID driver questions