USB 2.0 Device Driver

Discussion in 'Windows Vista Drivers' started by Sekar, Jan 30, 2004.

  1. Sekar

    Sekar Guest

    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.
     
    Sekar, Jan 30, 2004
    #1
    1. Advertising

  2. Sekar

    Walter Oney Guest

    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
     
    Walter Oney, Jan 30, 2004
    #2
    1. Advertising

  3. 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
     
    Alexander Grigoriev, Jan 30, 2004
    #3
  4. Sekar

    Sekar Guest

    ----- 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
     
    Sekar, Jan 31, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    0
    Views:
    332
    Guest
    Jul 21, 2006
  2. Guest
    Replies:
    0
    Views:
    724
    Guest
    Jul 21, 2006
  3. Guest
    Replies:
    0
    Views:
    304
    Guest
    Jul 29, 2006
  4. Lance

    USB Device InstanceID = USB Device SN?

    Lance, Feb 21, 2007, in forum: Windows Vista Drivers
    Replies:
    18
    Views:
    891
    Lance
    Feb 26, 2007
  5. SenseShankar

    USB device class is CDC class - which device driver to write.

    SenseShankar, Mar 7, 2008, in forum: Windows Vista Drivers
    Replies:
    11
    Views:
    1,237
    SenseShankar
    Mar 18, 2008
Loading...

Share This Page