最終更新:2014-05-18 (日) 18:24:41 (3624d)  

URB
Top / URB

USB Request Block

Windows

  • USBデバイスドライバは、ハードウェアとは直接やり取りしない。変わりにURBを作成し、それをバスドライバに転送する。
  • A Universal Serial Bus (USB) client driver cannot communicate with its device directly.
  • Instead, the client driver creates requests and submits them to the USB driver stack for processing.
  • Within each request, the client driver provides a variable-length data structure called a USB Request Block (URB).
  • The URB structure describes the details of the request and also contains information about the status of the completed request.
  • http://msdn.microsoft.com/en-us/library/windows/hardware/ff537056(v=vs.85).aspx

Linux

構造体

類似

  • kiocb?
  • skbuff?

URBのライフサイクル

  • USBデバイスドライバによって作成される。
  • 特定のUSBデバイスの特定のエンドポイントに割り当てられる。
  • USBデバイスドライバによって、USBコアにサブミットされる。
  • USBコアによって、特定のデバイスのための特定のUSBホストコントローラに送信される。
  • デバイスに対するUSB転送を行うUSBホストコントローラによって処理される。
  • 要求が完了したときに、USBホストコントローラドライバがUSBデバイスドライバに通知する。

関数

ホストにキューイング

hc_driver.urb_enqueue

ehci_hc_driver

xhci_plat_xhci_driver

メモ

  • urb構造体を、ドライバで静的に、あるいは別の構造体内に作成してはいけません。USBコアがURBを管理するために使う参照カウント?のしくみを破壊してしまうからです。URBの作成 には、関数usb_alloc_urbを呼び出します。

URBを使わない関数 (単純なデータ送受信)

ドキュメント

LDD3

関連

参考