Hi!
Is there a way we can send usb vendor specific requests to a device from
user-mode applications or from a driver which is not in the usb driver
stack.
Thanks
Fareed
Send and receive Hotmail on your mobile device: http://mobile.msn.com
Hi!
Is there a way we can send usb vendor specific requests to a device from
user-mode applications or from a driver which is not in the usb driver
stack.
Thanks
Fareed
Send and receive Hotmail on your mobile device: http://mobile.msn.com
Hi Fareed,
One way is Device I/O Control. You can define your own IOCTL code and use
it for sending messages from User Mode application/other driver.
Regards,
T.Umapathy
Hi,
Here i am giving an example to send vendor specific command to USB
driver from ur driver.
It may help u.
Jagdeesh
xxxxxx( IN PDEVICE_OBJECT
DeviceObject,
IN UINT8
*pBuffer,
IN UINT16
*uLength
)
{
NTSTATUS ntStatus;
ULONG uSize;
PURB urb = NULL;
uSize = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST );
urb = BTUSB_ExAllocatePool(NonPagedPool, uSize);
if (urb) {
RtlZeroMemory(urb, uSize);/*/Fill Memory with null*/
urb->UrbControlVendorClassRequest.Hdr.Length = (USHORT) uSize;
urb->UrbControlVendorClassRequest.Hdr.Function =
URB_FUNCTION_CLASS_DEVICE;
urb->UrbControlVendorClassRequest.TransferFlags = ZERO;
/* short packet is not treated as an error.*/
urb->UrbControlVendorClassRequest.TransferFlags |=
USBD_SHORT_TRANSFER_OK;
urb->UrbControlVendorClassRequest.TransferBuffer =
(PVOID)pBuffer;
urb->UrbControlVendorClassRequest.TransferBufferLength = *uLength;
/* not using linked urb’s*/
urb->UrbControlVendorClassRequest.UrbLink = NULL;
urb->UrbControlVendorClassRequest.TransferBufferMDL = NULL;
urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
REQUEST_TYPE_ENDPOINT_0;
urb->UrbControlVendorClassRequest.Value =
BLUETOOTH_DEVICE_CLASS;
urb->UrbControlVendorClassRequest.Index = 0x0000;
urb->UrbControlVendorClassRequest.Request = REQUEST;
}
else
{
return STATUS_INSUFFICIENT_RESOURCES;
}
/*Submit Urb*/
ntStatus = BTUsb_CallUSBD( DeviceObject, urb);
BTUSB_ExFreePool(urb);
return ntStatus;
}
-----Original Message-----
From: Fareed Anwar [mailto:xxxxx@hotmail.com]
Sent: Tuesday, March 12, 2002 2:16 AM
To: NT Developers Interest List
Subject: [ntdev] usb vendor specific request
Hi!
Is there a way we can send usb vendor specific requests to a device from
user-mode applications or from a driver which is not in the usb driver
stack.
Thanks
Fareed
Send and receive Hotmail on your mobile device: http://mobile.msn.com
You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
To unsubscribe send a blank email to %%email.unsub%%
Hi Prasad,
Our device has only one endpoint(interrupt).Hence
urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
REQUEST_TYPE_ENDPOINT_0 seems fine but I am not able to get
urb->UrbControlVendorClassRequest.Value which you are setting to
BLUETOOTH_DEVICE_CLASS.
One more thing is once you build this URB how are you sending this
to the USB stack,is it that you are building an IRP_MJ_WRITE,passing the urb
in nextStack->Parameters.Others.Argument1 and then calling below driver ?.
Actually my device responds back for this request,how do i receive the
data sent by the device in response to the command i am sending to it
?(I am filling the command to be sent in
URB_CONTROL_VENDOR_OR_CLASS_REQUEST .TransferBuffer).
Thanks.
Best Regards,
Sai Prasad
From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
Reply To: NT Developers Interest List
Sent: Tuesday, March 12, 2002 3:13 PM
To: NT Developers Interest List
Subject: [ntdev] RE: usb vendor specific requestHi,
Here i am giving an example to send vendor specific command to USB
driver from ur driver.
It may help u.Jagdeesh
xxxxxx( IN
PDEVICE_OBJECT
DeviceObject,
IN UINT8
*pBuffer,
IN UINT16
*uLength
)
{
NTSTATUS ntStatus;
ULONG uSize;
PURB urb = NULL;uSize = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST );
urb = BTUSB_ExAllocatePool(NonPagedPool, uSize);
if (urb) {
RtlZeroMemory(urb, uSize);/*/Fill Memory with null*/
urb->UrbControlVendorClassRequest.Hdr.Length = (USHORT) uSize;
urb->UrbControlVendorClassRequest.Hdr.Function =URB_FUNCTION_CLASS_DEVICE;
urb->UrbControlVendorClassRequest.TransferFlags = ZERO;
/* short packet is not treated as an error.*/
urb->UrbControlVendorClassRequest.TransferFlags |=
USBD_SHORT_TRANSFER_OK;urb->UrbControlVendorClassRequest.TransferBuffer =
(PVOID)pBuffer;
urb->UrbControlVendorClassRequest.TransferBufferLength = *uLength;
/* not using linked urb’s*/
urb->UrbControlVendorClassRequest.UrbLink = NULL;urb->UrbControlVendorClassRequest.TransferBufferMDL = NULL;
urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
REQUEST_TYPE_ENDPOINT_0;
urb->UrbControlVendorClassRequest.Value =BLUETOOTH_DEVICE_CLASS;
urb->UrbControlVendorClassRequest.Index = 0x0000;
urb->UrbControlVendorClassRequest.Request = REQUEST;}
else
{
return STATUS_INSUFFICIENT_RESOURCES;
}
/*Submit Urb*/ntStatus = BTUsb_CallUSBD( DeviceObject, urb);
BTUSB_ExFreePool(urb);
return ntStatus;
}-----Original Message-----
From: Fareed Anwar [mailto:xxxxx@hotmail.com]
Sent: Tuesday, March 12, 2002 2:16 AM
To: NT Developers Interest List
Subject: [ntdev] usb vendor specific requestHi!
Is there a way we can send usb vendor specific requests to a device from
user-mode applications or from a driver which is not in the usb driver
stack.Thanks
Fareed
Send and receive Hotmail on your mobile device: http://mobile.msn.com
You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntdev as: xxxxx@satyam.com
To unsubscribe send a blank email to %%email.unsub%%
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************
No - not without a driver in the USB stack. However, building a driver that
attaches to the stack is not that hard and (as the other poster pointer out)
then you can simply expose an IOCTL that can be called from user mode with
the vendor request descriptor as its data.
Dennis Merrill
Embedded Systems Engineer
Thermo Electron Corporation
Spectroscopy Division
-----Original Message-----
From: Fareed Anwar [mailto:xxxxx@hotmail.com]
Sent: Monday, March 11, 2002 2:46 PM
To: NT Developers Interest List
Subject: [ntdev] usb vendor specific request
Hi!
Is there a way we can send usb vendor specific requests to a device from
user-mode applications or from a driver which is not in the usb driver
stack.
Thanks
Fareed
Send and receive Hotmail on your mobile device: http://mobile.msn.com
You are currently subscribed to ntdev as: xxxxx@thermonicolet.com
To unsubscribe send a blank email to %%email.unsub%%
HI Sai,
BLUETOOTH_DEVICE_CLASS, this is bluetooth device specific value.
When ever bluetooth device recieve request having this value, interpret it
as command. It will be different in ur case. See ur device’s specs.
After building URB, build IOCTL_INTERNAL_USB_SUBMIT_URB IRP
and pass urb in nextStack->Parameters.Others.Argument1 = URB
, Parameter.
For building IRP u can use IoBuildDeviceIoControlRequest() finction.
call ioDriver() to submit IRP.
REQUEST 0x00 /*Zero When sending other than standard request*/
See USb spec chaptor 8 for more details.
For receiving data back from device, read device’s detailes.
Ur device has only interrupt endpoint so build
_URB_BULK_OR_INTERRUPT_TRANSFER URB with interrupt pipe handle pass this urb
to lower driver using IRP_MJ_INTERNAL_DEVICE_CONTROL IRP.
Jagdeesh
-----Original Message-----
From: Sai_Prasad [mailto:xxxxx@satyam.com]
Sent: Tuesday, March 12, 2002 5:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: usb vendor specific request
Hi Prasad,
Our device has only one endpoint(interrupt).Hence
urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
REQUEST_TYPE_ENDPOINT_0 seems fine but I am not able to get
urb->UrbControlVendorClassRequest.Value which you are setting to
BLUETOOTH_DEVICE_CLASS.
One more thing is once you build this URB how are you sending this
to the USB stack,is it that you are building an IRP_MJ_WRITE,passing the urb
in nextStack->Parameters.Others.Argument1 and then calling below driver ?.
Actually my device responds back for this request,how do i receive the
data sent by the device in response to the command i am sending to it
?(I am filling the command to be sent in
URB_CONTROL_VENDOR_OR_CLASS_REQUEST .TransferBuffer).
Thanks.
Best Regards,
Sai Prasad
From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
Reply To: NT Developers Interest List
Sent: Tuesday, March 12, 2002 3:13 PM
To: NT Developers Interest List
Subject: [ntdev] RE: usb vendor specific requestHi,
Here i am giving an example to send vendor specific command to USB
driver from ur driver.
It may help u.Jagdeesh
xxxxxx( IN
PDEVICE_OBJECT
DeviceObject,
IN UINT8
*pBuffer,
IN UINT16
*uLength
)
{
NTSTATUS ntStatus;
ULONG uSize;
PURB urb = NULL;uSize = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST );
urb = BTUSB_ExAllocatePool(NonPagedPool, uSize);
if (urb) {
RtlZeroMemory(urb, uSize);/*/Fill Memory with null*/
urb->UrbControlVendorClassRequest.Hdr.Length = (USHORT) uSize;
urb->UrbControlVendorClassRequest.Hdr.Function =URB_FUNCTION_CLASS_DEVICE;
urb->UrbControlVendorClassRequest.TransferFlags = ZERO;
/* short packet is not treated as an error.*/
urb->UrbControlVendorClassRequest.TransferFlags |=
USBD_SHORT_TRANSFER_OK;urb->UrbControlVendorClassRequest.TransferBuffer =
(PVOID)pBuffer;
urb->UrbControlVendorClassRequest.TransferBufferLength = *uLength;
/* not using linked urb’s*/
urb->UrbControlVendorClassRequest.UrbLink = NULL;urb->UrbControlVendorClassRequest.TransferBufferMDL = NULL;
urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
REQUEST_TYPE_ENDPOINT_0;
urb->UrbControlVendorClassRequest.Value =BLUETOOTH_DEVICE_CLASS;
urb->UrbControlVendorClassRequest.Index = 0x0000;
urb->UrbControlVendorClassRequest.Request = REQUEST;}
else
{
return STATUS_INSUFFICIENT_RESOURCES;
}
/*Submit Urb*/ntStatus = BTUsb_CallUSBD( DeviceObject, urb);
BTUSB_ExFreePool(urb);
return ntStatus;
}-----Original Message-----
From: Fareed Anwar [mailto:xxxxx@hotmail.com]
Sent: Tuesday, March 12, 2002 2:16 AM
To: NT Developers Interest List
Subject: [ntdev] usb vendor specific requestHi!
Is there a way we can send usb vendor specific requests to a device from
user-mode applications or from a driver which is not in the usb driver
stack.Thanks
Fareed
Send and receive Hotmail on your mobile device: http://mobile.msn.com
You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntdev as: xxxxx@satyam.com
To unsubscribe send a blank email to %%email.unsub%%
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************
You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
To unsubscribe send a blank email to %%email.unsub%%
Can I make the PNP Manager call IRP_MN_REMOVE for my device?.From an
Application I think it is possible.
My requirement is our Application sends me an IOCTL to remove the device in
which case I should make the PNP Manager to send me
IRP_MN_QUERY_REMOVE_DEVICE and IRP_MN_REMOVE_DEVICE.
Regards,
Sai Prasad
From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
Reply To: NT Developers Interest List
Sent: Wednesday, March 13, 2002 1:26 PM
To: NT Developers Interest List
Subject: [ntdev] RE: usb vendor specific requestHI Sai,
BLUETOOTH_DEVICE_CLASS, this is bluetooth device specific value.
When ever bluetooth device recieve request having this value, interpret it
as command. It will be different in ur case. See ur device’s specs.After building URB, build IOCTL_INTERNAL_USB_SUBMIT_URB IRP
and pass urb in nextStack->Parameters.Others.Argument1 = URB, Parameter.
For building IRP u can use IoBuildDeviceIoControlRequest() finction.
call ioDriver() to submit IRP.
REQUEST 0x00 /*Zero When sending other than standard request*/
See USb spec chaptor 8 for more details.
For receiving data back from device, read device’s detailes.
Ur device has only interrupt endpoint so build
_URB_BULK_OR_INTERRUPT_TRANSFER URB with interrupt pipe handle pass this
urb
to lower driver using IRP_MJ_INTERNAL_DEVICE_CONTROL IRP.Jagdeesh
-----Original Message-----
From: Sai_Prasad [mailto:xxxxx@satyam.com]
Sent: Tuesday, March 12, 2002 5:42 PM
To: NT Developers Interest List
Subject: [ntdev] RE: usb vendor specific requestHi Prasad,
Our device has only one endpoint(interrupt).Hence
urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
> REQUEST_TYPE_ENDPOINT_0 seems fine but I am not able to get
> urb->UrbControlVendorClassRequest.Value which you are setting to
> BLUETOOTH_DEVICE_CLASS.
One more thing is once you build this URB how are you sending this
to the USB stack,is it that you are building an IRP_MJ_WRITE,passing the
urb
in nextStack->Parameters.Others.Argument1 and then calling below driver ?.
Actually my device responds back for this request,how do i receive
the
data sent by the device in response to the command i am sending to it
?(I am filling the command to be sent in
URB_CONTROL_VENDOR_OR_CLASS_REQUEST .TransferBuffer).Thanks.
Best Regards,
Sai Prasad> ----------
> From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
> Reply To: NT Developers Interest List
> Sent: Tuesday, March 12, 2002 3:13 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: usb vendor specific request
>
> Hi,
> Here i am giving an example to send vendor specific command to USB
> driver from ur driver.
> It may help u.
>
> Jagdeesh
>
>
> xxxxxx( IN
> PDEVICE_OBJECT
> DeviceObject,
> IN UINT8
> *pBuffer,
> IN UINT16
> *uLength
> )
> {
> NTSTATUS ntStatus;
> ULONG uSize;
> PURB urb = NULL;
>
> uSize = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST );
>
> urb = BTUSB_ExAllocatePool(NonPagedPool, uSize);
>
> if (urb) {
>
> RtlZeroMemory(urb, uSize);/*/Fill Memory with null*/
> urb->UrbControlVendorClassRequest.Hdr.Length = (USHORT) uSize;
> urb->UrbControlVendorClassRequest.Hdr.Function =
>
> URB_FUNCTION_CLASS_DEVICE;
>
> urb->UrbControlVendorClassRequest.TransferFlags = ZERO;
> /* short packet is not treated as an error.*/
> urb->UrbControlVendorClassRequest.TransferFlags |=
> USBD_SHORT_TRANSFER_OK;
>
> urb->UrbControlVendorClassRequest.TransferBuffer =
> (PVOID)pBuffer;
> urb->UrbControlVendorClassRequest.TransferBufferLength =
*uLength;
> /* not using linked urb’s*/
> urb->UrbControlVendorClassRequest.UrbLink = NULL;
>
> urb->UrbControlVendorClassRequest.TransferBufferMDL = NULL;
>
> urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
>
> REQUEST_TYPE_ENDPOINT_0;
> urb->UrbControlVendorClassRequest.Value =
>
> BLUETOOTH_DEVICE_CLASS;
> urb->UrbControlVendorClassRequest.Index = 0x0000;
> urb->UrbControlVendorClassRequest.Request = REQUEST;
>
> }
> else
> {
> return STATUS_INSUFFICIENT_RESOURCES;
> }
> /*Submit Urb*/
>
> ntStatus = BTUsb_CallUSBD( DeviceObject, urb);
>
> BTUSB_ExFreePool(urb);
>
> return ntStatus;
> }
>
> -----Original Message-----
> From: Fareed Anwar [mailto:xxxxx@hotmail.com]
> Sent: Tuesday, March 12, 2002 2:16 AM
> To: NT Developers Interest List
> Subject: [ntdev] usb vendor specific request
>
>
> Hi!
>
> Is there a way we can send usb vendor specific requests to a device from> user-mode applications or from a driver which is not in the usb driver
> stack.
>
> Thanks
>
> Fareed
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
> To unsubscribe send a blank email to %%email.unsub%%
>
> —
> You are currently subscribed to ntdev as: xxxxx@satyam.com
> To unsubscribe send a blank email to %%email.unsub%%
>
**************************************************************************This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
or
distribution or forwarding of any or all of the contents in this message
is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************
You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntdev as: xxxxx@satyam.com
To unsubscribe send a blank email to %%email.unsub%%
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************
Hi All,
I am writing a Hid Mini Driver. When the Io Manager calls my Add Device
function it will provide a pointer to the functional device Object( FDO) of
the HID Class. But How can I get hold of the HID Class’s PDO.
Thanks in advance.
regards,
shivas
**************************************************************************
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************
Read the documentation on SetupDixxx functions.
Max
----- Original Message -----
From: “Sai_Prasad”
To: “NT Developers Interest List”
Sent: Friday, March 15, 2002 12:30 PM
Subject: [ntdev] RE: usb vendor specific request
> Can I make the PNP Manager call IRP_MN_REMOVE for my device?.From an
> Application I think it is possible.
> My requirement is our Application sends me an IOCTL to remove the device in
> which case I should make the PNP Manager to send me
> IRP_MN_QUERY_REMOVE_DEVICE and IRP_MN_REMOVE_DEVICE.
>
> Regards,
> Sai Prasad
>
> > ----------
> > From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
> > Reply To: NT Developers Interest List
> > Sent: Wednesday, March 13, 2002 1:26 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] RE: usb vendor specific request
> >
> > HI Sai,
> >
> > BLUETOOTH_DEVICE_CLASS, this is bluetooth device specific value.
> > When ever bluetooth device recieve request having this value, interpret it
> > as command. It will be different in ur case. See ur device’s specs.
> >
> > After building URB, build IOCTL_INTERNAL_USB_SUBMIT_URB IRP
> > and pass urb in nextStack->Parameters.Others.Argument1 = URB
> >
> > , Parameter.
> >
> > For building IRP u can use IoBuildDeviceIoControlRequest() finction.
> >
> >
> > call ioDriver() to submit IRP.
> >
> > REQUEST 0x00 /Zero When sending other than standard request/
> >
> > See USb spec chaptor 8 for more details.
> >
> >
> > For receiving data back from device, read device’s detailes.
> > Ur device has only interrupt endpoint so build
> > _URB_BULK_OR_INTERRUPT_TRANSFER URB with interrupt pipe handle pass this
> > urb
> > to lower driver using IRP_MJ_INTERNAL_DEVICE_CONTROL IRP.
> >
> >
> > Jagdeesh
> >
> >
> > -----Original Message-----
> > From: Sai_Prasad [mailto:xxxxx@satyam.com]
> > Sent: Tuesday, March 12, 2002 5:42 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] RE: usb vendor specific request
> >
> >
> > Hi Prasad,
> > Our device has only one endpoint(interrupt).Hence
> > urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
> > > REQUEST_TYPE_ENDPOINT_0 seems fine but I am not able to get
> > > urb->UrbControlVendorClassRequest.Value which you are setting to
> > > BLUETOOTH_DEVICE_CLASS.
> > One more thing is once you build this URB how are you sending this
> > to the USB stack,is it that you are building an IRP_MJ_WRITE,passing the
> > urb
> > in nextStack->Parameters.Others.Argument1 and then calling below driver ?.
> > Actually my device responds back for this request,how do i receive
> > the
> > data sent by the device in response to the command i am sending to it
> > ?(I am filling the command to be sent in
> > URB_CONTROL_VENDOR_OR_CLASS_REQUEST .TransferBuffer).
> >
> > Thanks.
> > Best Regards,
> > Sai Prasad
> >
> >
> > > ----------
> > > From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
> > > Reply To: NT Developers Interest List
> > > Sent: Tuesday, March 12, 2002 3:13 PM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] RE: usb vendor specific request
> > >
> > > Hi,
> > > Here i am giving an example to send vendor specific command to USB
> > > driver from ur driver.
> > > It may help u.
> > >
> > > Jagdeesh
> > >
> > >
> > > xxxxxx( IN
> > > PDEVICE_OBJECT
> > > DeviceObject,
> > > IN UINT8
> > > pBuffer,
> > > IN UINT16
> > > uLength
> > > )
> > > {
> > > NTSTATUS ntStatus;
> > > ULONG uSize;
> > > PURB urb = NULL;
> > >
> > > uSize = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST );
> > >
> > > urb = BTUSB_ExAllocatePool(NonPagedPool, uSize);
> > >
> > > if (urb) {
> > >
> > > RtlZeroMemory(urb, uSize);//Fill Memory with null/
> > > urb->UrbControlVendorClassRequest.Hdr.Length = (USHORT) uSize;
> > > urb->UrbControlVendorClassRequest.Hdr.Function =
> > >
> > > URB_FUNCTION_CLASS_DEVICE;
> > >
> > > urb->UrbControlVendorClassRequest.TransferFlags = ZERO;
> > > /* short packet is not treated as an error./
> > > urb->UrbControlVendorClassRequest.TransferFlags |=
> > > USBD_SHORT_TRANSFER_OK;
> > >
> > > urb->UrbControlVendorClassRequest.TransferBuffer =
> > > (PVOID)pBuffer;
> > > urb->UrbControlVendorClassRequest.TransferBufferLength =
> > uLength;
> > > / not using linked urb’s/
> > > urb->UrbControlVendorClassRequest.UrbLink = NULL;
> > >
> > > urb->UrbControlVendorClassRequest.TransferBufferMDL = NULL;
> > >
> > > urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
> > >
> > > REQUEST_TYPE_ENDPOINT_0;
> > > urb->UrbControlVendorClassRequest.Value =
> > >
> > > BLUETOOTH_DEVICE_CLASS;
> > > urb->UrbControlVendorClassRequest.Index = 0x0000;
> > > urb->UrbControlVendorClassRequest.Request = REQUEST;
> > >
> > > }
> > > else
> > > {
> > > return STATUS_INSUFFICIENT_RESOURCES;
> > > }
> > > /Submit Urb/
> > >
> > > ntStatus = BTUsb_CallUSBD( DeviceObject, urb);
> > >
> > > BTUSB_ExFreePool(urb);
> > >
> > > return ntStatus;
> > > }
> > >
> > > -----Original Message-----
> > > From: Fareed Anwar [mailto:xxxxx@hotmail.com]
> > > Sent: Tuesday, March 12, 2002 2:16 AM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] usb vendor specific request
> > >
> > >
> > > Hi!
> > >
> > > Is there a way we can send usb vendor specific requests to a device from
> >
> > > user-mode applications or from a driver which is not in the usb driver
> > > stack.
> > >
> > > Thanks
> > >
> > > Fareed
> > >
> > >
> > > _________________________________________________________________
> > > Send and receive Hotmail on your mobile device: http://mobile.msn.com
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
> > > To unsubscribe send a blank email to %%email.unsub%%
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@satyam.com
> > > To unsubscribe send a blank email to %%email.unsub%%
> > >
> >
> >
> > This email (including any attachments) is intended for the sole use of the
> > intended recipient/s and may contain material that is CONFIDENTIAL AND
> > PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
> > or
> > distribution or forwarding of any or all of the contents in this message
> > is
> > STRICTLY PROHIBITED. If you are not the intended recipient, please contact
> > the sender by email and delete all copies; your cooperation in this regard
> > is appreciated.
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
> > To unsubscribe send a blank email to %%email.unsub%%
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@satyam.com
> > To unsubscribe send a blank email to %%email.unsub%%
> >
>
> This email (including any attachments) is intended for the sole use of the
> intended recipient/s and may contain material that is CONFIDENTIAL AND
> PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
> distribution or forwarding of any or all of the contents in this message is
> STRICTLY PROHIBITED. If you are not the intended recipient, please contact
> the sender by email and delete all copies; your cooperation in this regard
> is appreciated.
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>
and the src\setup\remove example from 2600 DDK
----- Original Message -----
From: “Maxim S. Shatskih”
To: “NT Developers Interest List”
Sent: Friday, March 15, 2002 11:16 AM
Subject: [ntdev] RE: usb vendor specific request
> Read the documentation on SetupDixxx functions.
>
> Max
>
> ----- Original Message -----
> From: “Sai_Prasad”
> To: “NT Developers Interest List”
> Sent: Friday, March 15, 2002 12:30 PM
> Subject: [ntdev] RE: usb vendor specific request
>
>
> > Can I make the PNP Manager call IRP_MN_REMOVE for my device?.From an
> > Application I think it is possible.
> > My requirement is our Application sends me an IOCTL to remove the device in
> > which case I should make the PNP Manager to send me
> > IRP_MN_QUERY_REMOVE_DEVICE and IRP_MN_REMOVE_DEVICE.
> >
> > Regards,
> > Sai Prasad
> >
> > > ----------
> > > From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
> > > Reply To: NT Developers Interest List
> > > Sent: Wednesday, March 13, 2002 1:26 PM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] RE: usb vendor specific request
> > >
> > > HI Sai,
> > >
> > > BLUETOOTH_DEVICE_CLASS, this is bluetooth device specific value.
> > > When ever bluetooth device recieve request having this value, interpret it
> > > as command. It will be different in ur case. See ur device’s specs.
> > >
> > > After building URB, build IOCTL_INTERNAL_USB_SUBMIT_URB IRP
> > > and pass urb in nextStack->Parameters.Others.Argument1 = URB
> > >
> > > , Parameter.
> > >
> > > For building IRP u can use IoBuildDeviceIoControlRequest() finction.
> > >
> > >
> > > call ioDriver() to submit IRP.
> > >
> > > REQUEST 0x00 /Zero When sending other than standard request/
> > >
> > > See USb spec chaptor 8 for more details.
> > >
> > >
> > > For receiving data back from device, read device’s detailes.
> > > Ur device has only interrupt endpoint so build
> > > _URB_BULK_OR_INTERRUPT_TRANSFER URB with interrupt pipe handle pass this
> > > urb
> > > to lower driver using IRP_MJ_INTERNAL_DEVICE_CONTROL IRP.
> > >
> > >
> > > Jagdeesh
> > >
> > >
> > > -----Original Message-----
> > > From: Sai_Prasad [mailto:xxxxx@satyam.com]
> > > Sent: Tuesday, March 12, 2002 5:42 PM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] RE: usb vendor specific request
> > >
> > >
> > > Hi Prasad,
> > > Our device has only one endpoint(interrupt).Hence
> > > urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
> > > > REQUEST_TYPE_ENDPOINT_0 seems fine but I am not able to get
> > > > urb->UrbControlVendorClassRequest.Value which you are setting to
> > > > BLUETOOTH_DEVICE_CLASS.
> > > One more thing is once you build this URB how are you sending this
> > > to the USB stack,is it that you are building an IRP_MJ_WRITE,passing the
> > > urb
> > > in nextStack->Parameters.Others.Argument1 and then calling below driver ?.
> > > Actually my device responds back for this request,how do i receive
> > > the
> > > data sent by the device in response to the command i am sending to it
> > > ?(I am filling the command to be sent in
> > > URB_CONTROL_VENDOR_OR_CLASS_REQUEST .TransferBuffer).
> > >
> > > Thanks.
> > > Best Regards,
> > > Sai Prasad
> > >
> > >
> > > > ----------
> > > > From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
> > > > Reply To: NT Developers Interest List
> > > > Sent: Tuesday, March 12, 2002 3:13 PM
> > > > To: NT Developers Interest List
> > > > Subject: [ntdev] RE: usb vendor specific request
> > > >
> > > > Hi,
> > > > Here i am giving an example to send vendor specific command to USB
> > > > driver from ur driver.
> > > > It may help u.
> > > >
> > > > Jagdeesh
> > > >
> > > >
> > > > xxxxxx( IN
> > > > PDEVICE_OBJECT
> > > > DeviceObject,
> > > > IN UINT8
> > > > pBuffer,
> > > > IN UINT16
> > > > uLength
> > > > )
> > > > {
> > > > NTSTATUS ntStatus;
> > > > ULONG uSize;
> > > > PURB urb = NULL;
> > > >
> > > > uSize = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST );
> > > >
> > > > urb = BTUSB_ExAllocatePool(NonPagedPool, uSize);
> > > >
> > > > if (urb) {
> > > >
> > > > RtlZeroMemory(urb, uSize);//Fill Memory with null/
> > > > urb->UrbControlVendorClassRequest.Hdr.Length = (USHORT) uSize;
> > > > urb->UrbControlVendorClassRequest.Hdr.Function =
> > > >
> > > > URB_FUNCTION_CLASS_DEVICE;
> > > >
> > > > urb->UrbControlVendorClassRequest.TransferFlags = ZERO;
> > > > /* short packet is not treated as an error./
> > > > urb->UrbControlVendorClassRequest.TransferFlags |=
> > > > USBD_SHORT_TRANSFER_OK;
> > > >
> > > > urb->UrbControlVendorClassRequest.TransferBuffer =
> > > > (PVOID)pBuffer;
> > > > urb->UrbControlVendorClassRequest.TransferBufferLength =
> > > uLength;
> > > > / not using linked urb’s/
> > > > urb->UrbControlVendorClassRequest.UrbLink = NULL;
> > > >
> > > > urb->UrbControlVendorClassRequest.TransferBufferMDL = NULL;
> > > >
> > > > urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
> > > >
> > > > REQUEST_TYPE_ENDPOINT_0;
> > > > urb->UrbControlVendorClassRequest.Value =
> > > >
> > > > BLUETOOTH_DEVICE_CLASS;
> > > > urb->UrbControlVendorClassRequest.Index = 0x0000;
> > > > urb->UrbControlVendorClassRequest.Request = REQUEST;
> > > >
> > > > }
> > > > else
> > > > {
> > > > return STATUS_INSUFFICIENT_RESOURCES;
> > > > }
> > > > /Submit Urb/
> > > >
> > > > ntStatus = BTUsb_CallUSBD( DeviceObject, urb);
> > > >
> > > > BTUSB_ExFreePool(urb);
> > > >
> > > > return ntStatus;
> > > > }
> > > >
> > > > -----Original Message-----
> > > > From: Fareed Anwar [mailto:xxxxx@hotmail.com]
> > > > Sent: Tuesday, March 12, 2002 2:16 AM
> > > > To: NT Developers Interest List
> > > > Subject: [ntdev] usb vendor specific request
> > > >
> > > >
> > > > Hi!
> > > >
> > > > Is there a way we can send usb vendor specific requests to a device from
> > >
> > > > user-mode applications or from a driver which is not in the usb driver
> > > > stack.
> > > >
> > > > Thanks
> > > >
> > > > Fareed
> > > >
> > > >
> > > > _________________________________________________________________
> > > > Send and receive Hotmail on your mobile device: http://mobile.msn.com
> > > >
> > > >
> > > > —
> > > > You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
> > > > To unsubscribe send a blank email to %%email.unsub%%
> > > >
> > > > —
> > > > You are currently subscribed to ntdev as: xxxxx@satyam.com
> > > > To unsubscribe send a blank email to %%email.unsub%%
> > > >
> > >
> > >
> > > This email (including any attachments) is intended for the sole use of the
> > > intended recipient/s and may contain material that is CONFIDENTIAL AND
> > > PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
> > > or
> > > distribution or forwarding of any or all of the contents in this message
> > > is
> > > STRICTLY PROHIBITED. If you are not the intended recipient, please contact
> > > the sender by email and delete all copies; your cooperation in this regard
> > > is appreciated.
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
> > > To unsubscribe send a blank email to %%email.unsub%%
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@satyam.com
> > > To unsubscribe send a blank email to %%email.unsub%%
> > >
> >
> > This email (including any attachments) is intended for the sole use of the
> > intended recipient/s and may contain material that is CONFIDENTIAL AND
> > PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
> > distribution or forwarding of any or all of the contents in this message is
> > STRICTLY PROHIBITED. If you are not the intended recipient, please contact
> > the sender by email and delete all copies; your cooperation in this regard
> > is appreciated.
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to %%email.unsub%%
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@setengineering.com
> To unsubscribe send a blank email to %%email.unsub%%
SetupDixxx functions inform the PNP Manager from Application part…but
what I want is to inform from Kernel Mode…I have framed an IOCTL which
would be received by my Plug and Play Driver and would call
IoInvalidateDeviceRelations passing the PDO of my device stack.The DDK
Documentation says that I should receive IRP_MN_QUERY_RMOVE_DEVICE after
that but I don’t see any PNP Minor IRP coming to my driver.Any
Clues/Suggestions ?
Thanks,
Best Regards
Sai Prasad
From: Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
Reply To: NT Developers Interest List
Sent: Friday, March 15, 2002 11:46 PM
To: NT Developers Interest List
Subject: [ntdev] RE: usb vendor specific requestRead the documentation on SetupDixxx functions.
Max
----- Original Message -----
From: “Sai_Prasad”
> To: “NT Developers Interest List”
> Sent: Friday, March 15, 2002 12:30 PM
> Subject: [ntdev] RE: usb vendor specific request
>
>
> > Can I make the PNP Manager call IRP_MN_REMOVE for my device?.From an
> > Application I think it is possible.
> > My requirement is our Application sends me an IOCTL to remove the device
> in
> > which case I should make the PNP Manager to send me
> > IRP_MN_QUERY_REMOVE_DEVICE and IRP_MN_REMOVE_DEVICE.
> >
> > Regards,
> > Sai Prasad
> >
> > > ----------
> > > From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
> > > Reply To: NT Developers Interest List
> > > Sent: Wednesday, March 13, 2002 1:26 PM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] RE: usb vendor specific request
> > >
> > > HI Sai,
> > >
> > > BLUETOOTH_DEVICE_CLASS, this is bluetooth device specific value.
> > > When ever bluetooth device recieve request having this value,
> interpret it
> > > as command. It will be different in ur case. See ur device’s specs.
> > >
> > > After building URB, build IOCTL_INTERNAL_USB_SUBMIT_URB IRP
> > > and pass urb in nextStack->Parameters.Others.Argument1 = URB
> > >
> > > , Parameter.
> > >
> > > For building IRP u can use IoBuildDeviceIoControlRequest() finction.
> > >
> > >
> > > call ioDriver() to submit IRP.
> > >
> > > REQUEST 0x00 /Zero When sending other than standard request/
> > >
> > > See USb spec chaptor 8 for more details.
> > >
> > >
> > > For receiving data back from device, read device’s detailes.
> > > Ur device has only interrupt endpoint so build
> > > _URB_BULK_OR_INTERRUPT_TRANSFER URB with interrupt pipe handle pass
> this
> > > urb
> > > to lower driver using IRP_MJ_INTERNAL_DEVICE_CONTROL IRP.
> > >
> > >
> > > Jagdeesh
> > >
> > >
> > > -----Original Message-----
> > > From: Sai_Prasad [mailto:xxxxx@satyam.com]
> > > Sent: Tuesday, March 12, 2002 5:42 PM
> > > To: NT Developers Interest List
> > > Subject: [ntdev] RE: usb vendor specific request
> > >
> > >
> > > Hi Prasad,
> > > Our device has only one endpoint(interrupt).Hence
> > > urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
> > > > REQUEST_TYPE_ENDPOINT_0 seems fine but I am not able to get
> > > > urb->UrbControlVendorClassRequest.Value which you are setting to
> > > > BLUETOOTH_DEVICE_CLASS.
> > > One more thing is once you build this URB how are you sending this
> > > to the USB stack,is it that you are building an IRP_MJ_WRITE,passing
> the
> > > urb
> > > in nextStack->Parameters.Others.Argument1 and then calling below
> driver ?.
> > > Actually my device responds back for this request,how do i
> receive
> > > the
> > > data sent by the device in response to the command i am sending to
> it
> > > ?(I am filling the command to be sent in
> > > URB_CONTROL_VENDOR_OR_CLASS_REQUEST .TransferBuffer).
> > >
> > > Thanks.
> > > Best Regards,
> > > Sai Prasad
> > >
> > >
> > > > ----------
> > > > From: Prasad Jagdeesh[SMTP:xxxxx@dcmtech.co.in]
> > > > Reply To: NT Developers Interest List
> > > > Sent: Tuesday, March 12, 2002 3:13 PM
> > > > To: NT Developers Interest List
> > > > Subject: [ntdev] RE: usb vendor specific request
> > > >
> > > > Hi,
> > > > Here i am giving an example to send vendor specific command to USB
> > > > driver from ur driver.
> > > > It may help u.
> > > >
> > > > Jagdeesh
> > > >
> > > >
> > > > xxxxxx( IN
> > > > PDEVICE_OBJECT
> > > > DeviceObject,
> > > > IN UINT8
> > > > pBuffer,
> > > > IN UINT16
> > > > uLength
> > > > )
> > > > {
> > > > NTSTATUS ntStatus;
> > > > ULONG uSize;
> > > > PURB urb = NULL;
> > > >
> > > > uSize = sizeof(struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST );
> > > >
> > > > urb = BTUSB_ExAllocatePool(NonPagedPool, uSize);
> > > >
> > > > if (urb) {
> > > >
> > > > RtlZeroMemory(urb, uSize);//Fill Memory with null/
> > > > urb->UrbControlVendorClassRequest.Hdr.Length = (USHORT)
> uSize;
> > > > urb->UrbControlVendorClassRequest.Hdr.Function =
> > > >
> > > > URB_FUNCTION_CLASS_DEVICE;
> > > >
> > > > urb->UrbControlVendorClassRequest.TransferFlags = ZERO;
> > > > /* short packet is not treated as an error./
> > > > urb->UrbControlVendorClassRequest.TransferFlags |=
> > > > USBD_SHORT_TRANSFER_OK;
> > > >
> > > > urb->UrbControlVendorClassRequest.TransferBuffer =
> > > > (PVOID)pBuffer;
> > > > urb->UrbControlVendorClassRequest.TransferBufferLength =
> > > uLength;
> > > > / not using linked urb’s/
> > > > urb->UrbControlVendorClassRequest.UrbLink = NULL;
> > > >
> > > > urb->UrbControlVendorClassRequest.TransferBufferMDL = NULL;
> > > >
> > > > urb->UrbControlVendorClassRequest.RequestTypeReservedBits =
> > > >
> > > > REQUEST_TYPE_ENDPOINT_0;
> > > > urb->UrbControlVendorClassRequest.Value =
> > > >
> > > > BLUETOOTH_DEVICE_CLASS;
> > > > urb->UrbControlVendorClassRequest.Index = 0x0000;
> > > > urb->UrbControlVendorClassRequest.Request = REQUEST;
> > > >
> > > > }
> > > > else
> > > > {
> > > > return STATUS_INSUFFICIENT_RESOURCES;
> > > > }
> > > > /Submit Urb/
> > > >
> > > > ntStatus = BTUsb_CallUSBD( DeviceObject, urb);
> > > >
> > > > BTUSB_ExFreePool(urb);
> > > >
> > > > return ntStatus;
> > > > }
> > > >
> > > > -----Original Message-----
> > > > From: Fareed Anwar [mailto:xxxxx@hotmail.com]
> > > > Sent: Tuesday, March 12, 2002 2:16 AM
> > > > To: NT Developers Interest List
> > > > Subject: [ntdev] usb vendor specific request
> > > >
> > > >
> > > > Hi!
> > > >
> > > > Is there a way we can send usb vendor specific requests to a device
> from
> > >
> > > > user-mode applications or from a driver which is not in the usb
> driver
> > > > stack.
> > > >
> > > > Thanks
> > > >
> > > > Fareed
> > > >
> > > >
> > > > _________________________________________________________________
> > > > Send and receive Hotmail on your mobile device:
> http://mobile.msn.com
> > > >
> > > >
> > > > —
> > > > You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
> > > > To unsubscribe send a blank email to %%email.unsub%%
> > > >
> > > > —
> > > > You are currently subscribed to ntdev as: xxxxx@satyam.com
> > > > To unsubscribe send a blank email to %%email.unsub%%
> > > >
> > >
>
> > >
> > > This email (including any attachments) is intended for the sole use of
> the
> > > intended recipient/s and may contain material that is CONFIDENTIAL AND
> > > PRIVATE COMPANY INFORMATION. Any review or reliance by others or
> copying
> > > or
> > > distribution or forwarding of any or all of the contents in this
> message
> > > is
> > > STRICTLY PROHIBITED. If you are not the intended recipient, please
> contact
> > > the sender by email and delete all copies; your cooperation in this
> regard
> > > is appreciated.
> > >
>
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@dcmtech.co.in
> > > To unsubscribe send a blank email to %%email.unsub%%
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@satyam.com
> > > To unsubscribe send a blank email to %%email.unsub%%
> > >
> >
>
>
> > This email (including any attachments) is intended for the sole use of
> the
> > intended recipient/s and may contain material that is CONFIDENTIAL AND
> > PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying
> or
> > distribution or forwarding of any or all of the contents in this message
> is
> > STRICTLY PROHIBITED. If you are not the intended recipient, please
> contact
> > the sender by email and delete all copies; your cooperation in this
> regard
> > is appreciated.
> >
>
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to %%email.unsub%%
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@bla.satyam.com
> To unsubscribe send a blank email to %%email.unsub%%
>
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.