浏览代码

USB: Support for submitting control URBs under xHCI.

Warn users of URB_NO_SETUP_DMA_MAP about xHCI behavior.

Device drivers can choose to DMA map the setup packet of a control transfer
before submitting the URB to the USB core.  Drivers then set the
URB_NO_SETUP_DMA_MAP and pass in the DMA memory address in setup_dma, instead of
providing a kernel address for setup_packet.  However, xHCI requires that the
setup packet be copied into an internal data structure, and we need a kernel
memory address pointer for that.  Warn users of URB_NO_SETUP_DMA_MAP that they
should provide a valid pointer for setup_packet, along with the DMA address.

FIXME:  I'm not entirely sure how to work around this in the xHCI driver
or USB core.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sarah Sharp 16 年之前
父节点
当前提交
6d65b78a09
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      include/linux/usb.h

+ 3 - 1
include/linux/usb.h

@@ -1044,7 +1044,9 @@ typedef void (*usb_complete_t)(struct urb *);
  * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the
  * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the
  *	device driver has provided this DMA address for the setup packet.
  *	device driver has provided this DMA address for the setup packet.
  *	The host controller driver should use this in preference to
  *	The host controller driver should use this in preference to
- *	setup_packet.
+ *	setup_packet, but the HCD may chose to ignore the address if it must
+ *	copy the setup packet into internal structures.  Therefore, setup_packet
+ *	must always point to a valid buffer.
  * @start_frame: Returns the initial frame for isochronous transfers.
  * @start_frame: Returns the initial frame for isochronous transfers.
  * @number_of_packets: Lists the number of ISO transfer buffers.
  * @number_of_packets: Lists the number of ISO transfer buffers.
  * @interval: Specifies the polling interval for interrupt or isochronous
  * @interval: Specifies the polling interval for interrupt or isochronous