aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/file_storage.c
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 14:12:20 -0400
commit14cd5f8e85e90c9dead2393377b9a2c23131e0ce (patch)
treef83f012b51ecdcf2415c3886a05aad580391ef92 /drivers/usb/gadget/file_storage.c
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/gadget/file_storage.c')
-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 eb2821542b7c..b6d920f349ea 100644
--- a/drivers/usb/gadget/file_storage.c
+++ b/drivers/usb/gadget/file_storage.c
@@ -71,6 +71,12 @@
71 * requirement amounts to two 16K buffers, size configurable by a parameter. 71 * requirement amounts to two 16K buffers, size configurable by a parameter.
72 * Support is included for both full-speed and high-speed operation. 72 * Support is included for both full-speed and high-speed operation.
73 * 73 *
74 * Note that the driver is slightly non-portable in that it assumes a
75 * single memory/DMA buffer will be useable for bulk-in, bulk-out, and
76 * interrupt-in endpoints. With most device controllers this isn't an
77 * issue, but there may be some with hardware restrictions that prevent
78 * a buffer from being used by more than one endpoint.
79 *
74 * Module options: 80 * Module options:
75 * 81 *
76 * file=filename[,filename...] 82 * file=filename[,filename...]
@@ -3956,6 +3962,9 @@ static int __init fsg_bind(struct usb_gadget *gadget)
3956 for (i = 0; i < NUM_BUFFERS; ++i) { 3962 for (i = 0; i < NUM_BUFFERS; ++i) {
3957 struct fsg_buffhd *bh = &fsg->buffhds[i]; 3963 struct fsg_buffhd *bh = &fsg->buffhds[i];
3958 3964
3965 /* Allocate for the bulk-in endpoint. We assume that
3966 * the buffer will also work with the bulk-out (and
3967 * interrupt-in) endpoint. */
3959 bh->buf = usb_ep_alloc_buffer(fsg->bulk_in, mod_data.buflen, 3968 bh->buf = usb_ep_alloc_buffer(fsg->bulk_in, mod_data.buflen,
3960 &bh->dma, GFP_KERNEL); 3969 &bh->dma, GFP_KERNEL);
3961 if (!bh->buf) 3970 if (!bh->buf)