Re: USB keyboard HID problem by Steve
Steve
Tue Jun 22 13:34:30 CDT 2004
Thank you for that information. That is a good change for the common case
where there is only one HID input report or where the first input report is
the largest. If this is not the case, then there is probably not much that
software can do to get the HID device to work on SH7727.
In the upcoming release of CE, we do something like the following to get the
count of bytes used for transfers.
for (DWORD dwReport = 0; dwReport < phidpDeviceDesc->ReportIDsLength;
++dwReport) {
PHIDP_REPORT_IDS phidpReportIds =
&phidpDeviceDesc->ReportIDs[dwReport];
*pcbMaxReport = max(*pcbMaxReport, phidpReportIds->InputLength);
}
--
Steve Schrock
Windows CE Device Drivers
This posting is provided "AS IS" with no warranties, and confers no rights.
"R.Fichter" <Ft.nospam@emtrion.de> wrote in message
news:eOHxhLTSEHA.3932@TK2MSFTNGP10.phx.gbl...
> Hello Steve,
>
> you have to modify the function InterruptThreadProc in the file
> %_WINCEROOT%\PUBLIC\COMMON\OAK\DRIVERS\USB\CLASS\HIDCLASS\HID.CPP.
> In this function you have to add a line so that the code look like
>
> pbDataBuffer = pbToTransfer = (BYTE*) HidAlloc(cbBuffer);
> if (pbDataBuffer == NULL) {
> DEBUGMSG(ZONE_ERROR, (TEXT("%s: LocalAlloc error:%d\r\n"),
> pszFname,
> GetLastError()));
> goto EXIT;
> }
>
> //+ added by emtrion (www.emtrion.com)
> cbToTransfer = pUsbHid->phidpDeviceDesc->ReportIDs[0].InputLength;
> //- added by emtrion (www.emtrion.com)
>
> if (fNoReportID == TRUE) {
> // Leave the starting byte empty for the ID of 0
> pbDataBuffer[0] = 0;
> ++pbToTransfer;
> }
>
> This modification solve the problem, that sometimes the USB Host
> controller
> in the SH7727 adds an additional byte when more bytes are requested than
> delivered by the external device (short packets). This problem is
> described
> as a hardware restriction in the USB Host chapter of the SH7727 hardware
> manual. With the modification shown above, the HID driver always requests
> exactly the number of bytes which are send by the HID device (e.g. mouse
> or
> keyboard).
>
> Ruediger
>
> "Steve Schrock [MS]" <sschrock@online.microsoft.com> schrieb im
> Newsbeitrag
> news:eo3Fd4MSEHA.1764@TK2MSFTNGP10.phx.gbl...
>> The USB HID driver stack was completely re-written for CE 4.2 so that it
>> would work with devices that deviate from the samples given in the USB
>> HID
>> specifications.
>>
>> Ruediger, could you explain the changes you were required to make to get
>> KBDHID to work with the SH7727? I am not familiar with its USB host
>> controller. Thank you.
>>
>> --
>> Steve Schrock
>> Windows CE Device Drivers
>>
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>>
>> "R.Fichter" <Ft.nospam@emtrion.de> wrote in message
>> news:eZ7V%23O6REHA.3016@tk2msftngp13.phx.gbl...
>> > I've never used the SH7727 with CE 4.0. But I think the problem occurs
>> > also
>> > in Ce 4.0 because it is caused by the hardware restriction. May be that
>> > the
>> > frequency of the occurrence is not so often in CE 4.0 than in CE 4.2.
> But
>> > why ? I don't know.
>> >
>> > Ruediger
>> >
>> > "Rajesh" <rajeshvinchhi@hotmail.com> schrieb im Newsbeitrag
>> > news:d318ab39.0405302306.707e8441@posting.google.com...
>> >> That may be correct that there may be hardware problem in SH7727 OHCI
>> >> but still I have one question, why it is working with Windows CE 4.0
>> >> ?( there is no separate HID driver for sh7727 in Windows CE 4.0). I am
>> >> using the common USBHID driver in Windows CE 4.0 and it is working
>> >> fine.
>> >>
>> >> Why the USBHID/KBDHID driver given in Windows CE 4.2 requires specific
>> >> modifications for SH7727 ?
>> >>
>> >> Rajesh
>> >
>> >
>>
>>
>
>