博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
usb_submit_urb
阅读量:7013 次
发布时间:2019-06-28

本文共 3648 字,大约阅读时间需要 12 分钟。

 --> usb_submit_urb()  --> usb_submit_urb()

一旦urb被USB驱动程序正确地创建和初始化后,就可以递交到USB核心以发送到USB设备了。如果函数调用成功,当urb被HC处理结束的时候,urb的结束处理例程(urb->complete)正好被调用一次,当该结束处理函数被调用时,USB核心就结束了对urb的处理,此刻对urb的控制器权就返回给设备驱动程序了。
函数usb_submit_urb()用来递交URB,它在对URB进行设置后,调用主机控制器函数usb_hcd_submit_urb()来完成递交操作。
错误代码:
-ENOMEM        内存不足
-ENODEV        没有设备可用
-EPIPE         端点停止
-EAGAIN        排队等候同步传输的太多
-EFBIG         请求ISO frame的太多
-EINVAL        无效的中断间隔
函数usb_submit_urb递交URB后,urb->status为-EINPROGRESS.

https://www.cnblogs.com/zxc2man/p/6650505.html

 

 

urb status

int status

    When the urb is finished, or being processed by the USB core, this variable is set
    to the current status of the urb. The only time a USB driver can safely access this
    variable is in the urb completion handler function (described in the section
    “Completing Urbs: The Completion Callback Handler”). This restriction is to
    prevent race conditions that occur while the urb is being processed by the USB
    core. For isochronous urbs, a successful value (0) in this variable merely indi-
    cates whether the urb has been unlinked. To obtain a detailed status on isochro-
    nous urbs, the iso_frame_desc variables should be checked.

    Valid values for this variable include:
0
    The urb transfer was successful.
-ENOENT
    The urb was stopped by a call to usb_kill_urb.
-ECONNRESET
    The urb was unlinked by a call to usb_unlink_urb, and the transfer_flags
    variable of the urb was set to URB_ASYNC_UNLINK.
-EINPROGRESS
    The urb is still being processed by the USB host controllers. If your driver
    ever sees this value, it is a bug in your driver.
-EPROTO
    One of the following errors occurred with this urb:
        ? A bitstuff error happened during the transfer.
        ? No response packet was received in time by the hardware.
-EILSEQ
    There was a CRC mismatch in the urb transfer.
-EPIPE
    The endpoint is now stalled. If the endpoint involved is not a control end-
    point, this error can be cleared through a call to the function usb_clear_halt.
-ECOMM
    Data was received faster during the transfer than it could be written to sys-
    tem memory. This error value happens only for an IN urb.
-ENOSR
    Data could not be retrieved from the system memory during the transfer fast
    enough to keep up with the requested USB data rate. This error value hap-
    pens only for an OUT urb.
-EOVERFLOW
    A “babble” error happened to the urb. A “babble” error occurs when the
    endpoint receives more data than the endpoint’s specified maximum packet
    size.
-EREMOTEIO
    Occurs only if the URB_SHORT_NOT_OK flag is set in the urb’s transfer_flags
    variable and means that the full amount of data requested by the urb was
    not received.
-ENODEV
    The USB device is now gone from the system.
-EXDEV
    Occurs only for a isochronous urb and means that the transfer was only par-
    tially completed. In order to determine what was transferred, the driver
    must look at the individual frame status.
-EINVAL
    Something very bad happened with the urb. The USB kernel documentation
    describes what this value means:
         ISO madness, if this happens: Log off and go home
    It also can happen if a parameter is incorrectly set in the urb stucture or if an
    incorrect function parameter in the usb_submit_urb call submitted the urb to
    the USB core.
-ESHUTDOWN
    There was a severe error with the USB host controller driver; it has now
    been disabled, or the device was disconnected from the system, and the urb
    was submitted after the device was removed. It can also occur if the configu-
    ration was changed for the device, while the urb was submitted to the
    device.

    Generally, the error values -EPROTO, -EILSEQ, and -EOVERFLOW indicate hardware
problems with the device, the device firmware, or the cable connecting the
device to the computer.

 源地址:

 

你可能感兴趣的文章
Spring源码(一)---BeanFactory
查看>>
java指定垃圾回收
查看>>
aop排除某些类型不拦截
查看>>
Firefox 61已经为Ubuntu 提供支持
查看>>
Google推出了以隐私和安全为中心的变更
查看>>
Scrapy Extensions(扩展)
查看>>
架在云上的商业智能
查看>>
在windows下使用OpenSSH(下)copy /b authorized_keys + ...
查看>>
Java订单系统原型设计
查看>>
JPA 实战 OneToOne
查看>>
MongoDb Architecture
查看>>
React Native
查看>>
节约内存:Instagram的Redis实践
查看>>
Cmd命令总结
查看>>
BAE试用
查看>>
Linphone学习之 Oss
查看>>
mysql 建立索引的时候 字段太长导致的异常
查看>>
解析nginx负载均衡
查看>>
Spring Boot 2.0配置druid
查看>>
【转】[VS2005]解决“由于应用程序的配置不正确,应用程序未能启动,重新安装应用程序可能会......
查看>>