Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > USB 2.0 Device Driver

Reply
Thread Tools Display Modes

USB 2.0 Device Driver

 
 
Sekar
Guest
Posts: n/a

 
      01-30-2004
I want to send a command SET CONFIGURATION to change the state of the device
I dont know the IOCTL for this command which I need to use in the DeviceIoControl function (WIN API)
But for Configuration Descriptor, in DDK itself IOCTL is available i.e., IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION
This IOCTL is available in usbioctl.h in DDK libraries
But I dont know how to use the other commands like
1. SET CONFIGURATIO
2. SET ADDRES
3. GET STATU
4. SET FEATUR
5. CLEAR FEATUR
Please help me how to execute the above commands.
 
Reply With Quote
 
 
 
 
Walter Oney
Guest
Posts: n/a

 
      01-30-2004
Sekar wrote:
> I want to send a command SET CONFIGURATION to change the state of the device.
> I dont know the IOCTL for this command which I need to use in the DeviceIoControl function (WIN API).
> But for Configuration Descriptor, in DDK itself IOCTL is available i.e., IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION.
> This IOCTL is available in usbioctl.h in DDK libraries.
> But I dont know how to use the other commands like
> 1. SET CONFIGURATION
> 2. SET ADDRESS
> 3. GET STATUS
> 4. SET FEATURE
> 5. CLEAR FEATURE


You don't execute the SET CONFIGURATION and SET ADDRESS commands
piecemeal on your own. The bus driver automatically does a SET ADDRESS
when the device is first connected. You use
USBD_CreateConfigurationRequestEx to create a complex URB that you then
submit to the bus driver in the normal way. The bus driver issues the
necessary SET CONFIGURATION and SET INTERFACE commands to configure the
device.

You can issue the other commands using specific URBs. There are (terse)
examples of all of this in ch. 12 of my book, along with sample code.

--
Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com
 
Reply With Quote
 
 
 
 
Alexander Grigoriev
Guest
Posts: n/a

 
      01-30-2004
I'm not sure if OP will be able to do it from the user mode, without writing
a driver.

"Walter Oney" <> wrote in message
news:...
> Sekar wrote:
> > I want to send a command SET CONFIGURATION to change the state of the

device.
> > I dont know the IOCTL for this command which I need to use in the

DeviceIoControl function (WIN API).
> > But for Configuration Descriptor, in DDK itself IOCTL is available i.e.,

IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION.
> > This IOCTL is available in usbioctl.h in DDK libraries.
> > But I dont know how to use the other commands like
> > 1. SET CONFIGURATION
> > 2. SET ADDRESS
> > 3. GET STATUS
> > 4. SET FEATURE
> > 5. CLEAR FEATURE

>
> You don't execute the SET CONFIGURATION and SET ADDRESS commands
> piecemeal on your own. The bus driver automatically does a SET ADDRESS
> when the device is first connected. You use
> USBD_CreateConfigurationRequestEx to create a complex URB that you then
> submit to the bus driver in the normal way. The bus driver issues the
> necessary SET CONFIGURATION and SET INTERFACE commands to configure the
> device.
>
> You can issue the other commands using specific URBs. There are (terse)
> examples of all of this in ch. 12 of my book, along with sample code.
>
> --
> Walter Oney, Consulting and Training
> Basic and Advanced Driver Programming Seminars
> Check out our schedule at http://www.oneysoft.com



 
Reply With Quote
 
Sekar
Guest
Posts: n/a

 
      01-31-2004


----- Walter Oney wrote: ----

Sekar wrote
> I want to send a command SET CONFIGURATION to change the state of the device
> I dont know the IOCTL for this command which I need to use in the DeviceIoControl function (WIN API)
> But for Configuration Descriptor, in DDK itself IOCTL is available i.e., IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION
> This IOCTL is available in usbioctl.h in DDK libraries
> But I dont know how to use the other commands lik
> 1. SET CONFIGURATIO
> 2. SET ADDRES
> 3. GET STATU
> 4. SET FEATUR
> 5. CLEAR FEATUR


You don't execute the SET CONFIGURATION and SET ADDRESS command
piecemeal on your own. The bus driver automatically does a SET ADDRES
when the device is first connected. You us
USBD_CreateConfigurationRequestEx to create a complex URB that you the
submit to the bus driver in the normal way. The bus driver issues th
necessary SET CONFIGURATION and SET INTERFACE commands to configure th
device

You can issue the other commands using specific URBs. There are (terse
examples of all of this in ch. 12 of my book, along with sample code

-
Walter Oney, Consulting and Trainin
Basic and Advanced Driver Programming Seminar
Check out our schedule at http://www.oneysoft.co
-----------------------------------------------------------------
Thanks for your reply
According to USBCV (USB Command Verifier Compliance Test Specification), the device has to be tested in DEFAULT, ADDRESS AND CONFIGURED
I am developing the USBCV test cases, so I have to use the SET CONFIGURATION command

The following description is mentioned in USBCV
Default State
1. Put the device in the configured state following the procedure below
2. Issue a valid Set Configuration command to the device with configuration value zero
3. Issue a valid Get Configuration command and verify that the device responds with zero
4. Issue a valid Set Address command to the device with address zero
Address State
1. Put the device in the configured state following the procedure below
2. Issue a valid Set Configuration command to the device with configuration value zero
3. Issue a valid Get Configuration command to the device and verify that device responds with zero

So, if I want to do the above conditions, what I have to do

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB device class is CDC class - which device driver to write. SenseShankar Windows Vista Drivers 11 03-18-2008 03:31 PM
USB Device InstanceID = USB Device SN? Lance Windows Vista Drivers 18 02-26-2007 01:17 PM
USB Audio Device and USB Audio Device (2), how can VC++ mapping out physical PID? Windows Vista Drivers 0 07-29-2006 12:47 AM
cross mapping "USB audio device" to specific USB device descriptor or How to retrieve USB device serial number Windows Vista Drivers 0 07-21-2006 07:13 PM
cross mapping "USB audio device" to specific USB device descriptor. Windows Vista Drivers 0 07-21-2006 06:40 PM