Documentation-usb-dwc3.txt

来源:互联网 发布:淘宝怎么样才能排名靠前 编辑:程序博客网 时间:2024/04/30 05:58
Chinese translated version of Documentation/usb/dwc3.txt


If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.


Maintainer: Eric W. Biederman <ebiederman@xmission.com>
Chinese maintainer: Shao Qi <shaoqitony@gmail.com>
---------------------------------------------------------------------
Documentation/usb/dwc3.txt 的中文翻译


如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。
英文版维护者: Eric W. Biederman <ebiederman@xmission.com>
中文版维护者: 邵奇 Shao Qi <shaoqitony@gmail.com>
中文版翻译者: 邵奇 Shao Qi <shaoqitony@gmail.com>
中文版校译者: 邵奇 Shao Qi <shaoqitony@gmail.com>


以下为正文
---------------------------------------------------------------------




TODO
备忘录
~~~~~~
Please pick something while reading :)
在阅读时请整理一下 :)


- Convert interrupt handler to per-ep-thread-irq
- 转换中断处理程序到per-ep-thread-irq


  As it turns out some DWC3-commands ~1ms to complete. Currently we spin
  until the command completes which is bad.
  当一些DWC3命令要1ms完成。当前,知道坏命令完成之后才回转。
  
  Implementation idea:
  实现思路:
  - dwc core implements a demultiplexing irq chip for interrupts per
    endpoint. The interrupt numbers are allocated during probe and belong
    to the device. If MSI provides per-endpoint interrupt this dummy
    interrupt chip can be replaced with "real" interrupts.
  - dwc核心实现多路解编IRQ芯片来终端每一个末端。终端号在探测期间被分配,并归属于
    此设备。如果MSI提供每个端点中断功能,此虚拟中断芯片能被真正的中断代替。
  
  - interrupts are requested / allocated on usb_ep_enable() and removed on
    usb_ep_disable(). Worst case are 32 interrupts, the lower limit is two
    for ep0/1.
  - 中断在usb_ep_enable()被请求/分配,在 usb_ep_disable()被移除。最坏的情况是
    32个中断,下限为2个ep0/1.

  - dwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout()
    until the command completes.
  - dwc3_send_gadget_ep_cmd()将在wait_for_completion_timeout()完成之前休眠。
  
  - the interrupt handler is split into the following pieces:
  - 中断处理程序被分成以下几部分:
    - primary handler of the device
      goes through every event and calls generic_handle_irq() for event
      it. On return from generic_handle_irq() in acknowledges the event
      counter so interrupt goes away (eventually).
    - 主处理设备
 参加每一个事件,调用generic_handle_irq()来通知。在generic_handle_irq()
      返回时认可事件计数器,最终中断消失。  
    - threaded handler of the device
      none
- 线程处理设备
 无


    - primary handler of the EP-interrupt
      reads the event and tries to process it. Everything that requires
      sleeping is handed over to the Thread. The event is saved in an
      per-endpoint data-structure.
      We probably have to pay attention not to process events once we
      handed something to thread so we don't process event X prio Y
      where X > Y.
- EP中断的主处理器
 读取事件并尝试处理它。所有请求休眠的事件被移交给线程。此事件被保存
 在一个per-endpoint数据结构中。
 我们可能不得不注意,一旦我们移交东西给线程,不能去处理事件。所以当
 X > Y 时我们不能处理事件X prio Y。


    - threaded handler of the EP-interrupt
      handles the remaining EP work which might sleep such as waiting
      for command completion.
    - EP中断的线程级处理器
 处理余下的可能休眠的EP工作,比如等待命令完成。
  Latency:
   There should be no increase in latency since the interrupt-thread has a
   high priority and will be run before an average task in user land
  (except the user changed priorities).
  延迟:
  由于中断线程有高优先级,所以不该增加延迟。并且在用户范围的平均任务之前运行
  (除非用户改变优先级)。