php做上位机,开发过usb上位机驱动的大虾请看一下(附图)

我不太明白你的意思,既然主机已经检测到我的usb设备,提示我安装驱动,那么说明我在00 09 01 00 00 00 00  00 之前的程序应该都是正确的,而我现在按照ddk+vc+driverstudio编写的sys和inf文件就是通不过,真是搞不懂,到底我还忽略了那个方面。

;~~~~~~~~~~~~~~~~~~~~~~~~~~~

;设备描述符

;~~~~~~~~~~~~~~~~~~~~~~~~~~~

TAB_DEVICE_DESCRIPTOR:

DB      12H         ;size of descriptor

DB      01H         ;device descriptor type

DB      10H,01H     ;usb specification

DB      0DCH         ;device class

DB      00H         ;deivice sub class

DB      00H         ;device protocol

DB      10H         ;MAX packet size

DB      071H,04H     ;id vendor  C4H,07H,  5EH,04H

DB      66H,06H     ;product ID 00H, 0A4H

DB      00H,01H     ;device release   13H,01H

DB      00H         ;index  of manufacture  string

DB      00H         ;index  of product      string

DB      00H         ;serial number   of     string

DB      01H         ;Nomber of possible configration

;~~~~~~~~~~~~~~~~~~~~~~~~~~~

TAB_Configration_Descriptor:

DB      09H         ;Blength

DB      02H         ;descripter type

DB      CON_Descripter_Total_length,00H ;total length--2EH

DB      01H         ;number of interface

DB      Con_configration_Value      ;configration Value--01H

DB      00H         ;configration string index

DB      040H         ;attributes--自供电方式

DB      32H         ;max power

;~~~~~~~~~~~~~~~~~~~~~~~~~~~

TAB_Interface_Descriptor:

DB      09H         ;length

DB      04H         ;descriptor type

DB      00H         ;interface number

DB      00H         ;alternate setting

DB      04H         ;number of endpoint

DB      0DCH         ;interface class

DB      0A0H         ;interface sub class

DB      0B0H         ;interface protocol

DB      00H         ;interface index

;~~~~~~~~~~~~~~~~~~~~~~~~~~~

TAB_Endpoint1_output:

DB      07H         ;  length

DB      05H         ;  descripter type

DB      81H         ;  endpoint address    output addr=81

DB      02H         ;  mattributes

DB      10H,00H     ;  max packet size

DB      10H         ;  interval

;~~~~~~~~~~~~~~~~~~~~~~~~~~~

TAB_Endpoint1_input:

DB      07H         ;  length

DB      05H         ;  descripter type

DB      01H         ;  endpoint address  input   addr=01

DB      02H         ;  mattributes

DB      10H,00H     ;  max packet size

DB      10H         ;  interval

;~~~~~~~~~~~~~~~~~~~~~~~~~~~

TAB_Mainoint_output:

DB      07H         ;  length

DB      05H         ;  descripter type

DB      82H         ;  endpoint address  output addr=82

DB      02H         ;  mattributes       02H ÅúÁ¿´«Êä

DB      40H,00H     ;  max packet size

DB      10H         ;  interval

;~~~~~~~~~~~~~~~~~~~~~~~~~~~

TAB_Mainoint_input:

DB      07H         ;  length

DB      05H         ;  descripter type

DB      02H         ;  endpoint address   input addr=02

DB      02H         ;  mattributes        02H ÅúÁ¿´«Êä

DB      40H,00H     ;  max packet size

DB      10H         ;  interval

根据这些描述符,我在编写驱动的时候,设置如图:

在IOCTL上添加了一个测试函数,加入的代码

PURB pUrb=m_Lower.BuildVendorRequest(

NULL,

0,

0,

0,

0

);

status=m_Lower.SubmitUrb(pUrb,NULL,NULL,5000L);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值