hongbo
驱动牛犊
驱动牛犊
  • 注册日期2001-06-27
  • 最后登录2009-02-07
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1926回复:3

初始化WDM时的一些参数设置

楼主#
更多 发布于:2001-09-28 15:54
我用Driverwork写的USB驱动,在初始化设备时用到KUsbInterface::Initialize,其中有三个参数
   UCHAR InterfaceNumber,
   UCHAR ConfigurationValue,
   UCHAR InitialAlternateSetting
怎样来设置?

InterfaceNumber
Value that identifies the interface belonging to the specified device which is to be abstracted by this instance. The constructor uses this value to locate an interface descriptor for the object. The value must compare to field bInterfaceNumber in the interface descriptor.

ConfigurationValue
Value that identifies which configuration on the device that is to be abstracted by this instance.

InitialAlternateSetting
Value that indicates which alternate setting (if any) is to be initially configured for the device. If the interface supports multiple alternate settings, this value will be used to select the initial alternate setting to configure. For instance, some interfaces may have an alternate setting with zero endpoints or reduced isochronous bandwidth. This can allow the device to try to configure the device for maximum use but also have the ability to configure limited functionality if competing USB devices claim bandwidth.

我用Driverwork生成的代码中有一段注释为:

// Initialize the interface object.  The wizard generates code  to support a single interface.  You may create and add additional  interfaces.  By default, the wizard uses InterfaceNumber 0 (the  first interface descriptor), ConfigurationValue 1 (the first configuration descriptor), and initial interface alternate setting of 0.  If your device has multiple interfaces or alternate settings for an interface, you can add additional KUsbInterface objects or adjust the parameters passed to this function.

那位仁兄给翻译解释一下?

怎样理解这三个值(0,1,0)当我开发多个相同的设备时,是否需要设置这三个值,我要散分了。
前进是我的唯一追求!
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2001-09-29 10:27
你得去看device端的firmware设置。
而且,说明里面也说的很清楚:
InterfaceNumber 0 (the first interface descriptor), ConfigurationValue 1 (the first configuration descriptor), and initial interface alternate setting of 0.
一般的设备都是只有一个interface的。如果你有2个,就要把另外的interface加上来。
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
DK-boy
驱动中牛
驱动中牛
  • 注册日期2001-07-22
  • 最后登录2005-09-21
  • 粉丝0
  • 关注0
  • 积分1分
  • 威望1点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2001-09-29 11:08
用DDK真好!
喜欢清静?享受人生
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
地板#
发布于:2001-09-30 09:10
[QUOTE]原本由 DK-boy 发表
[B]用DDK真好!
 [/B][/QUOTE]
那也不见的噢!如果你的电源处理不好,也会让你死的很难看...
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
游客

返回顶部