mudehuai <> wrote:
>
>I am new to driver and want to modify the bulkusb example to talk to our
>device.
>
>The problem is that when the driver receives the raw data from the user
>space, I need to add a header to it before sending the data to the device.
>
>In BulkUsb_DispatchReadWrite(), it calls the IoBuildPartialMdl to map the
>user mdl directly to the URB mdl allocated by the driver. In my case, i want
>the new URB mdl to include a header and then the data described by the user
>mdl.
Does it have to be part of the same transfer? Can you create a new URB
with just the header, and then forward the original URB unchanged?
>I cannot figure out how to do this with MDL manipulation.
You can't do it with MDL manipulation.
>I thought about allocate a buffer in the driver and fill it with the header
>and the data described by the user mdl. Then create the new URB mdl from this
>buffer.
>
>However, it would be great if I can avoid this extra copy with MDL
>manipulation.
Nope. If you can't send it as two transfers, then you'll need to copy.
--
Tim Roberts,
Providenza & Boekelheide, Inc.