1. 04 5月, 2012 1 次提交
  2. 29 2月, 2012 2 次提交
  3. 24 1月, 2012 3 次提交
    • F
      usb: gadget: f_mass_storage: Use "bool" instead of "int" in fsg_module_parameters · 4b5203f1
      Fabio Estevam 提交于
      Fix the following build warnings:
      
       CC [M]  drivers/usb/gadget/acm_ms.o
      drivers/usb/gadget/acm_ms.c: In function ‘__check_ro’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
      drivers/usb/gadget/acm_ms.c: In function ‘__check_removable’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
      drivers/usb/gadget/acm_ms.c: In function ‘__check_cdrom’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
      drivers/usb/gadget/acm_ms.c: In function ‘__check_nofua’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
      drivers/usb/gadget/acm_ms.c: In function ‘__check_stall’:
      drivers/usb/gadget/acm_ms.c:119: warning: return from incompatible pointer type
        CC [M]  drivers/usb/gadget/mass_storage.o
      drivers/usb/gadget/mass_storage.c: In function ‘__check_ro’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      drivers/usb/gadget/mass_storage.c: In function ‘__check_removable’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      drivers/usb/gadget/mass_storage.c: In function ‘__check_cdrom’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      drivers/usb/gadget/mass_storage.c: In function ‘__check_nofua’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      drivers/usb/gadget/mass_storage.c: In function ‘__check_stall’:
      drivers/usb/gadget/mass_storage.c:94: warning: return from incompatible pointer type
      
      Declare the fsg_module_parameters fields as "bool" so that they can match the types
      passed in FSG_MODULE_PARAM_ARRAY macro.
      
      Since commit 493c90ef (module_param: check that bool parameters really are bool.),
      moduleparam.h was changed in a way that the "bool" parameter type now really
      requires "bool" type and no longer allows "unsigned int".
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      4b5203f1
    • S
      usb: gadget: f_mass_storage: remove one FSG_NO_INTR_EP · fcc0bb5a
      Sebastian Andrzej Siewior 提交于
      Remove one define of FSG_NO_INTR_EP and we still have that we can use.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      fcc0bb5a
    • M
      usb: gadget: update Michal Nazarewicz's email address · 54b8360f
      Michal Nazarewicz 提交于
      The m.nazarewicz@samsung.com email address is no longer valid,
      so this commit replaces it with mina86@mina86.com which is
      employer-agnostic and thus should be valid for foreseeable
      feature.
      Signed-off-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      54b8360f
  4. 12 12月, 2011 3 次提交
  5. 15 11月, 2011 2 次提交
  6. 14 10月, 2011 2 次提交
  7. 09 9月, 2011 3 次提交
    • P
      usb: gadget: storage: make FSG_NUM_BUFFERS variable size · 6532c7fd
      Per Forlin 提交于
      FSG_NUM_BUFFERS is set to 2 as default.
      Usually 2 buffers are enough to establish a good buffering pipeline.
      The number may be increased in order to compensate a for bursty VFS
      behaviour.
      
      Here follows a description of system that may require more than
      2 buffers.
       * CPU ondemand governor active
       * latency cost for wake up and/or frequency change
       * DMA for IO
      
      Use case description.
       * Data transfer from MMC via VFS to USB.
       * DMA shuffles data from MMC and to USB.
       * The CPU wakes up every now and then to pass data in and out from VFS,
         which cause the bursty VFS behaviour.
      
      Test set up
       * Running dd on the host reading from the mass storage device
       * cmdline: dd if=/dev/sdb of=/dev/null bs=4k count=$((256*100))
       * Caches are dropped on the host and on the device before each run
      
      Measurements on a Snowball board with ondemand_governor active.
      
      FSG_NUM_BUFFERS 2
      104857600 bytes (105 MB) copied, 5.62173 s, 18.7 MB/s
      104857600 bytes (105 MB) copied, 5.61811 s, 18.7 MB/s
      104857600 bytes (105 MB) copied, 5.57817 s, 18.8 MB/s
      
      FSG_NUM_BUFFERS 4
      104857600 bytes (105 MB) copied, 5.26839 s, 19.9 MB/s
      104857600 bytes (105 MB) copied, 5.2691 s, 19.9 MB/s
      104857600 bytes (105 MB) copied, 5.2711 s, 19.9 MB/s
      
      There may not be one optimal number for all boards. This is why
      the number is added to Kconfig. If selecting USB_GADGET_DEBUG_FILES
      this value may be set by a module parameter as well.
      Signed-off-by: NPer Forlin <per.forlin@linaro.org>
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      6532c7fd
    • A
      USB: gadget: storage: remove alignment assumption · 04eee25b
      Alan Stern 提交于
      This patch (as1481) fixes a problem affecting g_file_storage and
      g_mass_storage when running at SuperSpeed.  The two drivers currently
      assume that the bulk-out maxpacket size can evenly divide the SCSI
      block size, which is 512 bytes.  But SuperSpeed bulk endpoints have a
      maxpacket size of 1024, so the assumption is no longer true.
      
      This patch removes that assumption from the drivers, by getting rid of
      a small optimization (they try to align VFS reads and writes on page
      cache boundaries).  If a command's starting logical block address is
      512 bytes below the end of a page, it's not okay to issue a USB
      command for just those 512 bytes when the maxpacket size is 1024 -- it
      would result in either babble (for an OUT transfer) or a short packet
      (for an IN transfer).
      
      Also, for backward compatibility, the test for writes extending beyond
      the end of the backing storage has to be changed.  If the host tries
      to do this, we should accept the data that fits in the backing storage
      and ignore the rest.  Because the storage's end may not align with a
      USB packet boundary, this means we may have to accept a USB OUT
      transfer that extends beyond the end of the storage and then write out
      only the part of the data that fits.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Acked-by: NMichal Nazarewicz <mina86@mina86.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      04eee25b
    • P
      usb: gadget: storage: adapt logic block size to bound block devices · 3f565a36
      Peiyu Li 提交于
      Now the mass storage driver has fixed logic block size of 512 bytes.
      
      The mass storage gadget read/write bound devices only through VFS, so the
      bottom level devices actually are just RAW devices to the driver and connected
      PC. As a RAW, hosts can always format, read and write it right in 512 bytes
      logic block and don't care about the actual logic block size of devices bound
      to the gadget.
      
      But if we want to share the bound block device partition between target board
      and PC, in case the logic block size of the bound block device is 4KB, we
      execute the following steps:
      
      1. connect a board with mass storage gadget to PC(the board has set one
      	partition of on-board block device as file name of the mass storage)
      2. PC format the mass storage to VFAT by default logic block size and
      	read/write it
      3. disconnect boards from PC
      4. target board mount the partition as VFAT
      
      Step 4 will fail since kernel on target thinks the logic block size of the
      bound partition as 4KB.
      A typical error is "FAT: logical sector size too small for device (logical
      sector size = 512)"
      
      If we execute opposite steps:
      1. format the partition to VFAT on target board and read/write this partition
      2. connect the board to Windows PC as usb mass storage gadget, windows will
      	think the disk is not formatted
      
      So the conclusion is that only as a gadget, the mass storage driver has no any
      problem.  But being shared VFAT or other filesystem on PC and target board, it
      will fail.
      
      This patch adapts logic block size to bound block devices and fix the issue.
      
      Cc: Michal Nazarewicz <mina86@mina86.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NPeiyu Li <peiyu.li@csr.com>
      Signed-off-by: NXianglong Du <xianglong.du@csr.com>
      Signed-off-by: NHuayi Li <huayi.li@csr.com>
      Signed-off-by: NBarry Song <Baohua.Song@csr.com>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      3f565a36
  8. 24 8月, 2011 1 次提交
    • K
      USB: use usb_endpoint_maxp() instead of le16_to_cpu() · 29cc8897
      Kuninori Morimoto 提交于
      Now ${LINUX}/drivers/usb/* can use usb_endpoint_maxp(desc) to get maximum packet size
      instead of le16_to_cpu(desc->wMaxPacketSize).
      This patch fix it up
      
      Cc: Armin Fuerst <fuerst@in.tum.de>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Johannes Erdfelt <johannes@erdfelt.com>
      Cc: Vojtech Pavlik <vojtech@suse.cz>
      Cc: Oliver Neukum <oliver@neukum.name>
      Cc: David Kubicek <dave@awk.cz>
      Cc: Johan Hovold <jhovold@gmail.com>
      Cc: Brad Hards <bhards@bigpond.net.au>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: David Lopo <dlopo@chipidea.mips.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Michal Nazarewicz <m.nazarewicz@samsung.com>
      Cc: Xie Xiaobo <X.Xie@freescale.com>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Jiang Bo <tanya.jiang@freescale.com>
      Cc: Yuan-hsin Chen <yhchen@faraday-tech.com>
      Cc: Darius Augulis <augulis.darius@gmail.com>
      Cc: Xiaochen Shen <xiaochen.shen@intel.com>
      Cc: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Cc: OKI SEMICONDUCTOR, <toshiharu-linux@dsn.okisemi.com>
      Cc: Robert Jarzmik <robert.jarzmik@free.fr>
      Cc: Ben Dooks <ben@simtec.co.uk>
      Cc: Thomas Abraham <thomas.ab@samsung.com>
      Cc: Herbert Pötzl <herbert@13thfloor.at>
      Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
      Cc: Roman Weissgaerber <weissg@vienna.at>
      Acked-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
      Cc: Tony Olech <tony.olech@elandigitalsystems.com>
      Cc: Florian Floe Echtler <echtler@fs.tum.de>
      Cc: Christian Lucht <lucht@codemercs.com>
      Cc: Juergen Stuber <starblue@sourceforge.net>
      Cc: Georges Toth <g.toth@e-biz.lu>
      Cc: Bill Ryder <bryder@sgi.com>
      Cc: Kuba Ober <kuba@mareimbrium.org>
      Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
      Signed-off-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      29cc8897
  9. 29 6月, 2011 2 次提交
  10. 11 5月, 2011 2 次提交
  11. 15 4月, 2011 1 次提交
    • G
      Revert "usb: usb_storage: do not align length of request for CBW to maxp size" · 98346f7d
      Greg Kroah-Hartman 提交于
      This reverts commit 806e8f8f.
      
      To quote Alan Stern:
      	The necessity for this patch has been under discussion.
      
      	It turns out the UDC that Mian has been working on and Felipe's
      	UDC have contradictory requirements.  Mian's UDC driver wants a
      	bulk-OUT transfer length to be shorter than the maxpacket size
      	if a short packet is expected, whereas Felipe's UDC hardware
      	always needs bulk-OUT transfer lengths to be evenly divisible by
      	the maxpacket size.
      
      	Mian has agreed to go back over the driver to resolve this
      	conflict.  This means we probably will not want this patch after
      	all.  (In fact, we may ultimately decide to change the gadget
      	framework to require that bulk-OUT transfer lengths _always_ be
      	divisible by the maxpacket size -- only the g_file_storage and
      	g_mass_storage gadgets would need to be changed.)
      
      Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
      Cc: Michal Nazarewicz <mina86@mina86.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      98346f7d
  12. 14 4月, 2011 4 次提交
  13. 05 2月, 2011 1 次提交
    • J
      USB, Mass Storage, composite, gadget: Fix build failure and memset of a struct · a283c03a
      Jesper Juhl 提交于
      Trying to compile drivers/usb/gadget/f_mass_storage.o currently fails and
      spews a ton of warnings :
      
        CC      drivers/usb/gadget/f_mass_storage.o
      drivers/usb/gadget/f_mass_storage.c:436:22: error: field ‘function’ has incomplete type
      drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_from_func’:
      drivers/usb/gadget/f_mass_storage.c:466:9: warning: type defaults to ‘int’ in declaration of ‘__mptr’
      drivers/usb/gadget/f_mass_storage.c:466:9: warning: initialization from incompatible pointer type
      drivers/usb/gadget/f_mass_storage.c: At top level:
      drivers/usb/gadget/f_mass_storage.c:2743:15: warning: ‘struct usb_composite_dev’ declared inside parameter list
      drivers/usb/gadget/f_mass_storage.c:2743:15: warning: its scope is only this definition or declaration, which is probably not what you want
      drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_common_init’:
      drivers/usb/gadget/f_mass_storage.c:2745:34: error: dereferencing pointer to incomplete type
      drivers/usb/gadget/f_mass_storage.c:2775:23: error: dereferencing pointer to incomplete type
      drivers/usb/gadget/f_mass_storage.c:2779:3: error: implicit declaration of function ‘usb_string_id’
      drivers/usb/gadget/f_mass_storage.c: At top level:
      drivers/usb/gadget/f_mass_storage.c:2984:60: warning: ‘struct usb_configuration’ declared inside parameter list
      drivers/usb/gadget/f_mass_storage.c:3003:57: warning: ‘struct usb_configuration’ declared inside parameter list
      drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_bind’:
      drivers/usb/gadget/f_mass_storage.c:3006:31: error: dereferencing pointer to incomplete type
      drivers/usb/gadget/f_mass_storage.c:3013:2: error: implicit declaration of function ‘usb_interface_id’
      drivers/usb/gadget/f_mass_storage.c:3033:3: error: dereferencing pointer to incomplete type
      drivers/usb/gadget/f_mass_storage.c:3034:6: error: dereferencing pointer to incomplete type
      drivers/usb/gadget/f_mass_storage.c:3043:4: error: dereferencing pointer to incomplete type
      drivers/usb/gadget/f_mass_storage.c:3044:7: error: dereferencing pointer to incomplete type
      drivers/usb/gadget/f_mass_storage.c:3045:26: error: dereferencing pointer to incomplete type
      drivers/usb/gadget/f_mass_storage.c: At top level:
      drivers/usb/gadget/f_mass_storage.c:3067:14: warning: ‘struct usb_configuration’ declared inside parameter list
      drivers/usb/gadget/f_mass_storage.c:3067:14: warning: ‘struct usb_composite_dev’ declared inside parameter list
      drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_bind_config’:
      drivers/usb/gadget/f_mass_storage.c:3093:2: error: implicit declaration of function ‘usb_add_function’
      drivers/usb/gadget/f_mass_storage.c: At top level:
      drivers/usb/gadget/f_mass_storage.c:3103:9: warning: ‘struct usb_configuration’ declared inside parameter list
      drivers/usb/gadget/f_mass_storage.c:3103:9: warning: ‘struct usb_composite_dev’ declared inside parameter list
      drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_add’:
      drivers/usb/gadget/f_mass_storage.c:3105:2: warning: passing argument 1 of ‘fsg_bind_config’ from incompatible pointer type
      drivers/usb/gadget/f_mass_storage.c:3065:12: note: expected ‘struct usb_composite_dev *’ but argument is of type ‘struct usb_composite_dev *’
      drivers/usb/gadget/f_mass_storage.c:3105:2: warning: passing argument 2 of ‘fsg_bind_config’ from incompatible pointer type
      drivers/usb/gadget/f_mass_storage.c:3065:12: note: expected ‘struct usb_configuration *’ but argument is of type ‘struct usb_configuration *’
      drivers/usb/gadget/f_mass_storage.c: At top level:
      drivers/usb/gadget/f_mass_storage.c:3190:23: warning: ‘struct usb_composite_dev’ declared inside parameter list
      drivers/usb/gadget/f_mass_storage.c:3195:23: warning: ‘struct usb_composite_dev’ declared inside parameter list
      drivers/usb/gadget/f_mass_storage.c:3193:1: error: conflicting types for ‘fsg_common_from_params’
      drivers/usb/gadget/f_mass_storage.c:3188:1: note: previous declaration of ‘fsg_common_from_params’ was here
      drivers/usb/gadget/f_mass_storage.c: In function ‘fsg_common_from_params’:
      drivers/usb/gadget/f_mass_storage.c:3199:2: warning: passing argument 2 of ‘fsg_common_init’ from incompatible pointer type
      drivers/usb/gadget/f_mass_storage.c:2741:27: note: expected ‘struct usb_composite_dev *’ but argument is of type ‘struct usb_composite_dev *’
      make[1]: *** [drivers/usb/gadget/f_mass_storage.o] Error 1
      make: *** [drivers/usb/gadget/f_mass_storage.o] Error 2
      
      This is due to the missing include of linux/usb/composite.h - this patch
      adds the missing include.
      
      In addition there's also a problem in fsg_common_init() where we memset
      'common', but we use the size of a pointer to 'struct fsg_common' as the
      size argument to memset(), not the actual size of the struct. This patch
      fixes the sizeof so we zero the entire struct as intended.
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a283c03a
  14. 11 11月, 2010 5 次提交
  15. 23 10月, 2010 2 次提交
  16. 11 8月, 2010 3 次提交
  17. 30 6月, 2010 2 次提交
  18. 21 5月, 2010 1 次提交