I have got a composite device , with Bulk IN/OUT in Interface1 and and Bulk IN/OUT Interrupt IN in Interface2 . It appear 2 devices in Device Manager (Interface1 : VID/PID1,
Interface2 : VID/PID2).
My question:
if they are in the same class ,It is better to generate 2 drivers that one for Interface1 ,and the other for Interface2 , or just write a driver and install in Interface1 and Interface2 ?
Let the usbser.sys be an example .I install ubser.sys to composite devices . It enumerate all the descriptors in the device , so for Interface1(BULK ONLY) it can send down a command from Interrupt pipe!!! Does it means better to have 2 drivers and ignore the Interrupt Pipe in Interface1?
Any reply will be appreciated ! Thanks in advance!
Which interface to use, will be dependent on the application you are going to use. So architecturally if your device is supporting two interface, your driver should present both the interfaces. Having said that, I think a single driver model is recommended.
So , It should not be a limitation of the driver , but dependent on the application which interface it used . As the usbser.sys usage example, it depending on which com port it call CreateFile . on the driver side , it should enumerate all the descriptors and keep them.
Do you have any ideas about the problem talking at the begining of the topic. If i enumerate all the descriptors , i will keep the interrupt pipe handle in Interface2 , I createfile with the Interface1(BULK ONLY) , and send down command (mostly it is IOCTLs) will use the interrupt pipe handle belong to Interface2 . I still felling that is weird. or that is a normal scenario .
Another way is you can replace the inbox USB Generic Parent Driver with your
own (a single driver instance which can enum both interfaces). The only
drawback is you play second fiddle to the inbox driver in terms of who the
pnp manager is going to choose until you get WHQL’ed (so you have to force
install)
On Thu, Nov 18, 2010 at 4:29 PM, wrote:
> Hi all, > > I have got a composite device , with Bulk IN/OUT in Interface1 and > and Bulk IN/OUT Interrupt IN in Interface2 . It appear 2 devices in Device > Manager (Interface1 : VID/PID1, > Interface2 : VID/PID2). > > My question: > if they are in the same class ,It is better to generate 2 drivers that one > for Interface1 ,and the other for Interface2 , or just write a driver and > install in Interface1 and Interface2 ? > > Let the usbser.sys be an example .I install ubser.sys to composite devices > . It enumerate all the descriptors in the device , so for Interface1(BULK > ONLY) it can send down a command from Interrupt pipe!!! Does it means better > to have 2 drivers and ignore the Interrupt Pipe in Interface1? > > Any reply will be appreciated ! Thanks in advance! > > > > — > NTDEV is sponsored by OSR > > For our schedule of WDF, WDM, debugging and other seminars visit: > http://www.osr.com/seminars > > To unsubscribe, visit the List Server section of OSR Online at > http://www.osronline.com/page.cfm?name=ListServer >
As I can understand from your posting, you are selecting interface1 ( BULK only ) while configuring your device. But you see requests going down the interrupt endpoint, which belongs to interface 2. This is not right. Probably you are not selecting the interface correctly.
As I can understand from your posting, you are selecting interface1 ( BULK only
) while configuring your device. But you see requests going down the interrupt
endpoint, which belongs to interface 2. This is not right. Probably you are not
selecting the interface correctly.
That make me come into another problem . I just selected a interface one time by calling WdfUsbTargetDeviceSelectConfig in the driver. when i plug in device ,install the driver in interface1 and Interface2 . Will the WdfUsbTargetDeviceSelectConfig can recognize the Interface1 to select Interface1 and Interface2 to select Interface2 ? It becomes dynamic select ?
That make me come into another problem . I just selected a interface one time by calling WdfUsbTargetDeviceSelectConfig in the driver. when i plug in device ,install the driver in interface1 and Interface2 . Will the WdfUsbTargetDeviceSelectConfig can recognize the Interface1 to select Interface1 and Interface2 to select Interface2 ? It becomes dynamic select ?
If your INF matches the composite device (USB\VID_xxxx&PID_xxxx), then
you can select both interfaces, by using
WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_MULTIPLE_INTERFACES. All of
the pipes in all of the interfaces will be available to you.
But if you let the standard composite driver handle your composite
device, so that your INF matches a single interface
(USB\VID_xxxx&PID_xxxx&MI_00), then the composite driver is providing
“fake” descriptors to each of your drivers, so that each one thinks he
has a one-interface configuration. In that case, the &MI_00 driver can
only talk to interface 0, and the &MI_01 driver can only talk to
interface 1.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.