aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-03-23 15:07:25 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-04-14 11:12:20 -0700
commit14cd5f8e85e90c9dead2393377b9a2c23131e0ce (patch)
treef83f012b51ecdcf2415c3886a05aad580391ef92 /drivers/usb
parent70ffe6e14d7c5db84b92841471ce6fd0200010cd (diff)
[PATCH] USB: g_file_storage: add comment about buffer allocation
This patch (as664) adds a comment to file_storage.c, noting that the driver is slightly non-portable because it assumes that a buffer allocated for a bulk-in endpoint will also be useable for a bulk-out endpoint. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/file_storage.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c
index eb2821542b7..b6d920f349e 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -71,6 +71,12 @@
* requirement amounts to two 16K buffers, size configurable by a parameter.
* Support is included for both full-speed and high-speed operation.
*
+ * Note that the driver is slightly non-portable in that it assumes a
+ * single memory/DMA buffer will be useable for bulk-in, bulk-out, and
+ * interrupt-in endpoints. With most device controllers this isn't an
+ * issue, but there may be some with hardware restrictions that prevent
+ * a buffer from being used by more than one endpoint.
+ *
* Module options:
*
* file=filename[,filename...]
@@ -3956,6 +3962,9 @@ static int __init fsg_bind(struct usb_gadget *gadget)
for (i = 0; i < NUM_BUFFERS; ++i) {
struct fsg_buffhd *bh = &fsg->buffhds[i];
+ /* Allocate for the bulk-in endpoint. We assume that
+ * the buffer will also work with the bulk-out (and
+ * interrupt-in) endpoint. */
bh->buf = usb_ep_alloc_buffer(fsg->bulk_in, mod_data.buflen,
&bh->dma, GFP_KERNEL);
if (!bh->buf)