请教USB数据传输大小问题

[复制链接]
3272|8
 楼主| kingyou 发表于 2009-3-27 16:10 | 显示全部楼层 |阅读模式
&nbsp;&nbsp;&nbsp;&nbsp;请教下当主机驱动端读取的字节数可不可以大于设备端返回的字节数?谢谢了先....<br />&nbsp;&nbsp;&nbsp;&nbsp;我试过当主机驱动端读取的字节数小于设备端返回的字节数时,驱动会读取失败,但是当主机驱动端读取的字节数小于设备端返回的字节数时,很多时候主机端读取一次数据,D12端会产生两到三次中断,然后D12就会返回几次数据...
computer00 发表于 2009-3-27 16:15 | 显示全部楼层

可以少于。在驱动程序中指定,数据少于指定字节时,是否

  
 楼主| kingyou 发表于 2009-3-27 16:21 | 显示全部楼层

谢谢了

谢谢了,但是还有个问题就是为什么主机驱动端读取的字节数小于设备端返回的字节数时,D12会产生多次中断呢?<br />想了好久没想明白,不知道是我驱动的问题还是没操作好D12的问题。
 楼主| kingyou 发表于 2009-3-27 16:31 | 显示全部楼层

谢谢了

具体情况是这样的:<br />&nbsp;&nbsp;&nbsp;&nbsp;我现在想在主机端通过使用USB通过D12来读取我设备端上网卡接收到的数据包,我每次固定读取1536个字节的数据,然后D12将实际接收到的一个网络包发送给主机,因为基本上D12发送的数据都小于主机请求的1536个字节,这样的话每次我的D12都会中断几次,将接收到的数据包重复发给主机几次...请求高人给解释下原因啊,谢谢了...
computer00 发表于 2009-3-27 16:58 | 显示全部楼层

D12端点大小最大只有64字节,当然要多次中断才能发送完毕了

  
小小电子 发表于 2009-3-30 22:55 | 显示全部楼层

借宝地问个问题

如果主机请求返回大数据大于描述符的大小&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;那么我只返回描述符的大小是否可以呢?<br />
小小电子 发表于 2009-3-30 23:01 | 显示全部楼层

忘记贴上这个了

##&nbsp;Starting&nbsp;application&nbsp;at&nbsp;0x0C008000&nbsp;...<br />/************************************************************/<br />this&nbsp;is&nbsp;my&nbsp;usbtest&nbsp;on&nbsp;S3C44B0x<br />/************************************************************/<br />System&nbsp;Initialized&nbsp;done.<br />Find&nbsp;Pdiusbd12,&nbsp;chip&nbsp;id&nbsp;=&nbsp;1210<br />the&nbsp;dmaset&nbsp;is&nbsp;40<br />the&nbsp;usb&nbsp;init&nbsp;is&nbsp;success!<br />the&nbsp;irq&nbsp;ep0out&nbsp;is&nbsp;happen!<br />the&nbsp;pkt&nbsp;is&nbsp;80<br />the&nbsp;pkt&nbsp;is&nbsp;6<br />the&nbsp;pkt&nbsp;is&nbsp;0<br />the&nbsp;pkt&nbsp;is&nbsp;1<br />the&nbsp;pkt&nbsp;is&nbsp;0<br />the&nbsp;pkt&nbsp;is&nbsp;0<br />the&nbsp;pkt&nbsp;is&nbsp;40<br />the&nbsp;pkt&nbsp;is&nbsp;0<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />Usb_GetDescriptor&nbsp;is&nbsp;happen!<br />the&nbsp;buf&nbsp;is&nbsp;12<br />the&nbsp;buf&nbsp;is&nbsp;1<br />the&nbsp;buf&nbsp;is&nbsp;10<br />the&nbsp;buf&nbsp;is&nbsp;1<br />the&nbsp;buf&nbsp;is&nbsp;0<br />the&nbsp;buf&nbsp;is&nbsp;0<br />the&nbsp;buf&nbsp;is&nbsp;0<br />the&nbsp;buf&nbsp;is&nbsp;10<br />the&nbsp;buf&nbsp;is&nbsp;71<br />the&nbsp;buf&nbsp;is&nbsp;4<br />the&nbsp;buf&nbsp;is&nbsp;22<br />the&nbsp;buf&nbsp;is&nbsp;2<br />the&nbsp;buf&nbsp;is&nbsp;13<br />the&nbsp;buf&nbsp;is&nbsp;1<br />the&nbsp;buf&nbsp;is&nbsp;0<br />the&nbsp;buf&nbsp;is&nbsp;0<br />have&nbsp;send&nbsp;Desc!!<br />the&nbsp;irq&nbsp;busreset&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;bussuspend&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />Usb_GetDescriptor&nbsp;is&nbsp;happen!<br />the&nbsp;buf&nbsp;is&nbsp;12<br />the&nbsp;buf&nbsp;is&nbsp;1<br />have&nbsp;send&nbsp;Desc!!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;busreset&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0out&nbsp;is&nbsp;happen!<br />the&nbsp;pkt&nbsp;is&nbsp;80<br />the&nbsp;pkt&nbsp;is&nbsp;6<br />the&nbsp;pkt&nbsp;is&nbsp;0<br />the&nbsp;pkt&nbsp;is&nbsp;1<br />the&nbsp;pkt&nbsp;is&nbsp;0<br />the&nbsp;pkt&nbsp;is&nbsp;0<br />the&nbsp;pkt&nbsp;is&nbsp;40<br />the&nbsp;pkt&nbsp;is&nbsp;0<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />Usb_GetDescriptor&nbsp;is&nbsp;happen!<br />the&nbsp;buf&nbsp;is&nbsp;12<br />the&nbsp;buf&nbsp;is&nbsp;1<br />the&nbsp;buf&nbsp;is&nbsp;10<br />the&nbsp;buf&nbsp;is&nbsp;1<br />the&nbsp;buf&nbsp;is&nbsp;0<br />the&nbsp;buf&nbsp;is&nbsp;0<br />the&nbsp;buf&nbsp;is&nbsp;0<br />the&nbsp;buf&nbsp;is&nbsp;10<br />the&nbsp;buf&nbsp;is&nbsp;71<br />the&nbsp;buf&nbsp;is&nbsp;4<br />the&nbsp;buf&nbsp;is&nbsp;22<br />the&nbsp;buf&nbsp;is&nbsp;2<br />the&nbsp;buf&nbsp;is&nbsp;13<br />the&nbsp;buf&nbsp;is&nbsp;1<br />the&nbsp;buf&nbsp;is&nbsp;0<br />the&nbsp;buf&nbsp;is&nbsp;0<br />have&nbsp;send&nbsp;Desc!!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />Usb_GetDescriptor&nbsp;is&nbsp;happen!<br />the&nbsp;buf&nbsp;is&nbsp;12<br />the&nbsp;buf&nbsp;is&nbsp;1<br />have&nbsp;send&nbsp;Desc!!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!<br />the&nbsp;irq&nbsp;ep0in&nbsp;is&nbsp;happen!
 楼主| kingyou 发表于 2009-3-30 23:07 | 显示全部楼层

可以

可以的。。
computer00 发表于 2009-3-30 23:09 | 显示全部楼层

可以。注意当少于请求数据量时,刚好又是端点大小整数倍

需要返回一个0长度的数据包以结束数据过程。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

11

主题

33

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部