KMDFFW
Wed Apr 25 19:14:01 CDT 2007
Doron:
Thanks for the useful link. And I did the initialization for the setup packet.
Later on I found the error that I encountered was caused by incorrect
data flow direction specified.
Meanwhile, I am wondering whether there is a corresponding kernel API
like Sleep() from user mode? I know there are timer object defined in kernel
mode, but it's kind of overkill for my situation as I just want to have
something
like Sleep(30) since my device is not able to process incoming data fast
enough.
Thanks.
AT
"Doron Holan [MS]" wrote:
> did you initialize the setup packet using the INIT() routine? in general,
> you can use KMDF's log (accessible via !wdfkd.wdflogdump) to see what the
> error is, read
http://blogs.msdn.com/doronh/archive/2006/07/31/684531.aspx
> for more info and links on how to use this extension command
>
> d
>
> --
> Please do not send e-mail directly to this alias. this alias is for
> newsgroup purposes only.
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> "KMDF_FW" <KMDFFW@discussions.microsoft.com> wrote in message
> news:A37F470D-1AD1-4502-BC7C-490220AA93A5@microsoft.com...
> > Doron:
> >
> > As for using API WdfUsbTargetDeviceSendControlTransferSynchronously() to
> > send vendor
> > command to USB device, I tried it and got an error status of 0xc0000004,
> > which is the
> > STATUS_INFO_LENGTH_MISMATCH, where "The specified information record
> > length
> > does not match the length required for the specified information class."
> > After checking the memory
> > descriptor that I used for the control transfer, I did not see an error.
> > Do
> > you know how this error can be generated?
> >
> > Thanks.
> >
> > AT
> >
> > "Doron Holan [MS]" wrote:
> >
> >> to write data on the INT pipe, use WdfUsbTargetPipeWriteSynchronously (or
> >> WdfUsbTargetPipeFormatRequestForWrite + WdfRequestSend).
> >>
> >> Typically you should only use WdfUsbTargetDeviceSendUrbSynchronously when
> >> there is no built in KMDF routine that does what you need. In the case
> >> of
> >> sending a vendor command, you can do this
> >>
> >> WDF_USB_CONTROL_SETUP_PACKET setup;
> >> WDF_USB_CONTROL_SETUP_PACKET_INIT_VENDOR(&setup, <insert your
> >> parameters>);
> >>
> >> WdfUsbTargetDeviceSendControlTransferSynchronously(usbDevice, ...,
> >> &setup,
> >> ....);
> >>
> >> You do not need to break up the data, the usb core will do this for you,
> >> just write the entire buffer in one shot.
> >>
> >> d
> >>
> >> --
> >> Please do not send e-mail directly to this alias. this alias is for
> >> newsgroup purposes only.
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >>
> >> "KMDF_FW" <KMDFFW@discussions.microsoft.com> wrote in message
> >> news:97CE50BF-ED67-4223-8C23-E98255389C92@microsoft.com...
> >> > Hi, I am writing a KMDF driver to send about 10K data to a USB device.
> >> > However, the device only has a interrupt pipe, not bulk write pipe.
> >> > does
> >> > anyone know what is the right approach in sending the data over? I can
> >> > use
> >> > api
> >> >
> >> > WdfUsbTargetDeviceSendUrbSynchronously()
> >> >
> >> > to send an URB that contains a vendor command after I fill up the urb
> >> > using
> >> > its UrbControlVendorClassRequest substructure. But I do not think I can
> >> > use
> >> > the same approach in sending data data longer than 8 bytes. I read
> >> > somewhere
> >> > that in cases like this, we need to break up the data stream into
> >> > smaller
> >> > segments and send them over sequnentially. But I did not find any
> >> > sample
> >> > KMDF
> >> > code in WDF kit for cases like this. The sample available show how to
> >> > do
> >> > read/write for device with ISOChronous or bulkwrite pipe present on the
> >> > device.
> >> >
> >> > I would appreciate it if someone can share their thoughts on how to do
> >> > this.
> >> >
> >> > AT
> >>
> >>
> >>
>
>
>