On Tue, 11 Jun 2013, Thomas Pugliese wrote: > On Tue, 11 Jun 2013, Alan Stern wrote: > > > On Tue, 11 Jun 2013, Thomas Pugliese wrote: > > > > > This patch adds support for scatter gather DMA to the wire adapter and > > > updates the HWA to advertise support for SG transfers. This allows the > > > block layer to submit transfer requests to the HWA HC without first > > > breaking them up into PAGE_SIZE requests. > > > > While I do not really understand what is going on here, it nevertheless > > seems very peculiar. To begin with, whether or not the block layer > > breaks up transfers into PAGE_SIZE requests has no connection with SG. > > For another thing, the patch has the HCD creating an SG list. That's > > not how things work -- the HCD _receives_ the SG list attached to an > > URB. > > > > I'm not sure what problem this patch is intended to solve. Can you > > explain in more detail? > > > > Alan Stern > > > > > > Sure. The HWA is a USB connected wireless HCD so the HWA driver > communicates with the hardware by sending URBs instead of using mapped > memory regions like *HCI devices. There is not necessarily a 1 to 1 > correlation between the URBs that come in to the driver and URBs that get > forwarded down the stack as HCD commands since there is some encapsulation > and segmentation that may be done. Once SG support is enabled in the HWA, > the driver now needs to create SGs for the URBs it sends down the stack. > In the case of a buffer read URB, it looks like this: > > 1. The HWA HCD receives a read URB addressed to a device connected > wirelessly downstream of the HWA. > > 2. The HWA driver creates an internal URB to send a Transfer Request > command to the HWA on its bulk out endpoint that requests some or all of > the data associated with the user's URB. This is analagous to filling in > a qTD in EHCI. > > 3. The HWA driver creates another interal URB to read the Transfer > Results back from the HWA's bulk in endpoint. > > 4. Based on the contents of the Transfer Result. The HWA driver submits > a bulk in URB to read the actual data received from the device into the > user's buffer. > > Depending on the amount of data associated with the user's URB, steps 2-4 > may be iterated over multiple times due to the limited internal memory of > the HWA. My patch updates step 4 to handle URBs that have SGs associated > with them. The URB submitted in step 4 will need to include an SG that > represents the portion of the origial URB buffer that it is currently > reading from the HWA. I see. Thanks for the explanation. Things do get confusing when you have a USB-connected host controller! Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html