1. 22 7月, 2008 2 次提交
    • D
      usb gadget serial: use composite gadget framework · 7bb5ea54
      David Brownell 提交于
      This switches the serial gadget over to using the new "function"
      versions of the serial port interfacing code.  The remaining code
      in the main source file is quite small...
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7bb5ea54
    • D
      usb gadget: use new serial core · a7707adf
      David Brownell 提交于
      Teach "gadget serial" to use the new abstracted (and bugfixed) TTY glue,
      and remove all the orignal tangled-up code.  Update the documentation
      accordingly.  This is a net object code shrink and cleanup; it should
      make it a lot easier to see how the TTY glue should accomodate updates
      to the TTY layer, be bugfixed, etc.
      
      Notable behavior changes include:  it can now support getty even when
      there's no USB connection; it fits properly into the mdev/udev world;
      and RX handling is better (throttling works, and low latency).
      
      Configurations with scripts setting up the /dev/ttygserial device node
      (with "experimental" major number) may want to change that to be a
      symlink pointing to the /dev/ttyGS0 file, as a migration aid; else,
      just switch entirely over to mdev/udev.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a7707adf
  2. 15 5月, 2008 4 次提交
    • D
      USB: serial gadget: descriptor cleanup · b9370332
      David Brownell 提交于
      Bugfix some serial gadget descriptors:
      
       - Stop mangling the low bits (controller type ID) of bcdDevice;
         just use the high bits for a driver revision code.
      
       - Serial numbers that aren't specific to individual devices
         are useless; stop reporting "0" for this.
      
       - Since it's not part of a CDC-conformant function, the "bulk only"
         configuration shouldn't be using "CDC Data" as its interface class.
         Switch over to using CLASS_VENDOR_SPEC (different value, 0xff).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Al Borchers <alborchers@steinerpoint.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      b9370332
    • D
      USB: serial gadget: simplify endpoint handling · 734d37c6
      David Brownell 提交于
      Switch serial gadget away from a *very* old idiom:  just remember
      the endpoints we'll be using, instead of looking them up by name
      each time.  This is a net code and data (globals) shrink.
      
      Also fix a small memory leak in the rmmod path, by working the
      same as the disconnect code.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Al Borchers <alborchers@steinerpoint.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      734d37c6
    • D
      USB: serial gadget: remove needless data structure · 2c2d28a0
      David Brownell 提交于
      This removes a needless data structure from the serial gadget code;
      it's a small code shrink, and a larger data shrink.
      
      Since "struct usb_request" already has a "struct list_head" reserved
      for use by gadget drivers, the serial gadget code doesn't need to
      allocate wrapper structs to hold that list ... it can (and should!)
      just use the list_head provided for that exact use.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Al Borchers <alborchers@steinerpoint.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      2c2d28a0
    • D
      USB: serial gadget: cleanup/reorg · 9079e91b
      David Brownell 提交于
      Some cleanup/reorg of g_serial ... simplifying it, and disentangling
      its structure so morphing it into a "function" driver (combinable with
      other interfaces) should be less painful.
      
       - Remove most forward declarations
           * put tty and gadget driver structs after their contents
           * snug module init/exit decls next to their functions
           * reordered some functions
      
       - Other cleanup:
           * convert a funky macro to an inline function
           * snug up module params next to their declarations
           * add missing driver.owner
           * add separator lines between major driver sections
      
       - Add comments re potential parameter/#define changes:
           * only supports one port (shrank GS_NUM_PORTS)
           * changing from 9600-8-N-1 affects multiple sites
      
       - Remove net2280-specific optimization ... it was being done
         way too late, can be done by net2280 module options, and in
         any case doesn't matter at any sane serial data rates.
      
      There are no behavioral changes, but the macro thing saves I-space.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Al Borchers <alborchers@steinerpoint.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      9079e91b
  3. 03 5月, 2008 1 次提交
    • D
      usb serial gadget: CDC ACM fixes · f371e750
      David Brownell 提交于
      Based on a patch from <Aurel.Thomi@ruag.com>, this makes the
      CDC-ACM support in the serial gadget handle the SET_LINE_CODING
      and SET_CONTROL_LINE_STATE requests ... which should improve
      interop with at least MS-Windows "usbser.sys" if not some other
      ACM host drivers.
      
      It also adds a few REVISIT comments where this code plays a bit
      loose with the CDC ACM spec.  If this were used to hook up to a
      real RS232 or modem link, those places would need a bit of work.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      f371e750
  4. 30 4月, 2008 1 次提交
  5. 25 4月, 2008 1 次提交
  6. 02 2月, 2008 1 次提交
  7. 13 10月, 2007 3 次提交
  8. 11 9月, 2007 1 次提交
  9. 20 7月, 2007 2 次提交
  10. 13 7月, 2007 1 次提交
  11. 09 5月, 2007 1 次提交
  12. 17 2月, 2007 1 次提交
    • B
      USB: fix g_serial small error · 8356f311
      Bryan O'Donoghue 提交于
      A SET_LINE_CODING control request should return a zero length packet
      as an ACK to the host, during the status phase of a USB transaction.
      
      The return value of gs_setup_class() is treated as the number of
      bytes to write in the status phase of the control request, by
      gs_setup(). For this case, the value returned by gs_setup_class should
      be zero for SET_LINE_CODING but, right now, appears to be
      sizeof(struct usb_cdc_line_coding).
      
      However, if after doing the memcpy of the line coding descriptor we
      set the variable "ret" to be zero, we should return the appropiate ZLP
      to the host as an ACK in the status phase of the control request.
      I've tested this out using Linux as both host and slave and confirmed
      that the following small change fixes the spurious return of
      sizeof(struct usb_cdc_line_coding)/wLength bytes in the status phase
      of a USB_CDC_REQ_SET_LINE_CODING request. It's not a huge bug but, it
      is worth fixing.
      Signed-off-by: NBryan O'Donoghue <bodonoghue@codehermit.ie>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      8356f311
  13. 15 2月, 2007 1 次提交
    • T
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau 提交于
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  14. 08 2月, 2007 1 次提交
  15. 21 12月, 2006 1 次提交
    • D
      USB: gadget driver unbind() is optional; section fixes; misc · 6bea476c
      David Brownell 提交于
      Allow gadget drivers to omit the unbind() method.  When they're
      statically linked, that's an appropriate memory saving tweak.
      
      Similarly, provide consistent/simpler handling for a should-not-happen
      error case:  removing a peripheral controller driver when a gadget
      driver is still loaded.  Such code dates back to early versions of the
      first implementation of the gadget API, and has never been triggered.
      
      Includes relevant section annotation fixs for gmidi.c, file_storage.c,
      and serial.c; we don't yet have an "init or exit" annotation.  Also
      some whitespace fixes in gmidi.c (space at EOL, before tabs, etc).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6bea476c
  16. 14 12月, 2006 1 次提交
    • R
      [PATCH] getting rid of all casts of k[cmz]alloc() calls · 5cbded58
      Robert P. J. Day 提交于
      Run this:
      
      	#!/bin/sh
      	for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
      	  echo "De-casting $f..."
      	  perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
      	done
      
      And then go through and reinstate those cases where code is casting pointers
      to non-pointers.
      
      And then drop a few hunks which conflicted with outstanding work.
      
      Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Roman Zippel <zippel@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: Jens Axboe <jens.axboe@oracle.com>
      Cc: Paul Fulghum <paulkf@microgate.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Karsten Keil <kkeil@suse.de>
      Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
      Cc: Jeff Garzik <jeff@garzik.org>
      Cc: James Bottomley <James.Bottomley@steeleye.com>
      Cc: Ian Kent <raven@themaw.net>
      Cc: Steven French <sfrench@us.ibm.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Neil Brown <neilb@cse.unsw.edu.au>
      Cc: Jaroslav Kysela <perex@suse.cz>
      Cc: Takashi Iwai <tiwai@suse.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      5cbded58
  17. 09 12月, 2006 1 次提交
    • A
      [PATCH] tty: switch to ktermios · 606d099c
      Alan Cox 提交于
      This is the grungy swap all the occurrences in the right places patch that
      goes with the updates.  At this point we have the same functionality as
      before (except that sgttyb() returns speeds not zero) and are ready to
      begin turning new stuff on providing nobody reports lots of bugs
      
      If you are a tty driver author converting an out of tree driver the only
      impact should be termios->ktermios name changes for the speed/property
      setting functions from your upper layers.
      
      If you are implementing your own TCGETS function before then your driver
      was broken already and its about to get a whole lot more painful for you so
      please fix it 8)
      
      Also fill in c_ispeed/ospeed on init for most devices, although the current
      code will do this for you anyway but I'd like eventually to lose that extra
      paranoia
      
      [akpm@osdl.org: bluetooth fix]
      [mp3@de.ibm.com: sclp fix]
      [mp3@de.ibm.com: warning fix for tty3270]
      [hugh@veritas.com: fix tty_ioctl powerpc build]
      [jdike@addtoit.com: uml: fix ->set_termios declaration]
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NMartin Peschke <mp3@de.ibm.com>
      Acked-by: NPeter Oberparleiter <oberpar@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      606d099c
  18. 02 10月, 2006 2 次提交
    • S
      [PATCH] namespaces: utsname: use init_utsname when appropriate · 96b644bd
      Serge E. Hallyn 提交于
      In some places, particularly drivers and __init code, the init utsns is the
      appropriate one to use.  This patch replaces those with a the init_utsname
      helper.
      
      Changes: Removed several uses of init_utsname().  Hope I picked all the
      	right ones in net/ipv4/ipconfig.c.  These are now changed to
      	utsname() (the per-process namespace utsname) in the previous
      	patch (2/7)
      
      [akpm@osdl.org: CIFS fix]
      Signed-off-by: NSerge E. Hallyn <serue@us.ibm.com>
      Cc: Kirill Korotaev <dev@openvz.org>
      Cc: "Eric W. Biederman" <ebiederm@xmission.com>
      Cc: Herbert Poetzl <herbert@13thfloor.at>
      Cc: Andrey Savochkin <saw@sw.ru>
      Cc: Serge Hallyn <serue@us.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      96b644bd
    • J
      [PATCH] const struct tty_operations · b68e31d0
      Jeff Dike 提交于
      As part of an SMP cleanliness pass over UML, I consted a bunch of
      structures in order to not have to document their locking.  One of these
      structures was a struct tty_operations.  In order to const it in UML
      without introducing compiler complaints, the declaration of
      tty_set_operations needs to be changed, and then all of its callers need to
      be fixed.
      
      This patch declares all struct tty_operations in the tree as const.  In all
      cases, they are static and used only as input to tty_set_operations.  As an
      extra check, I ran an i386 allyesconfig build which produced no extra
      warnings.
      
      53 drivers are affected.  I checked the history of a bunch of them, and in
      most cases, there have been only a handful of maintenance changes in the
      last six months.  serial_core.c was the busiest one that I looked at.
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Acked-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b68e31d0
  19. 28 9月, 2006 1 次提交
  20. 13 7月, 2006 1 次提交
    • D
      [PATCH] USB: gadget section fixups · a353678d
      David Brownell 提交于
      Recent section changes broke gadget builds on some platforms.  This patch
      is the best fix that's available until better section markings exist:
      
       - There's a lot of cleanup code that gets used in both init and exit paths;
         stop marking it as "__exit".
      
         (Best fix for this would be an "__init_or_exit" section marking, putting
         the cleanup in __init when __exit sections get discarded else in __exit.)
      
       - Stop marking the use-once probe routines as "__init" since references
         to those routines are not allowed from driver structures.  They're now
         marked "__devinit", which in practice is a net lose.
      
         (Best fix for this is likely to separate such use-once probe routines
         from the driver structure ... but in general, all busses that aren't
         hotpluggable will be forced to waste memory for all probe-only code.)
      
      In general these broken section rules waste an average of two to four kBytes
      per driver of code bloat ... because none of the relevant code can ever be
      reused after module initialization.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a353678d
  21. 01 7月, 2006 1 次提交
  22. 27 6月, 2006 2 次提交
  23. 22 6月, 2006 3 次提交
  24. 21 3月, 2006 2 次提交
  25. 14 1月, 2006 1 次提交
  26. 11 1月, 2006 1 次提交
    • A
      [PATCH] TTY layer buffering revamp · 33f0f88f
      Alan Cox 提交于
      The API and code have been through various bits of initial review by
      serial driver people but they definitely need to live somewhere for a
      while so the unconverted drivers can get knocked into shape, existing
      drivers that have been updated can be better tuned and bugs whacked out.
      
      This replaces the tty flip buffers with kmalloc objects in rings. In the
      normal situation for an IRQ driven serial port at typical speeds the
      behaviour is pretty much the same, two buffers end up allocated and the
      kernel cycles between them as before.
      
      When there are delays or at high speed we now behave far better as the
      buffer pool can grow a bit rather than lose characters. This also means
      that we can operate at higher speeds reliably.
      
      For drivers that receive characters in blocks (DMA based, USB and
      especially virtualisation) the layer allows a lot of driver specific
      code that works around the tty layer with private secondary queues to be
      removed. The IBM folks need this sort of layer, the smart serial port
      people do, the virtualisers do (because a virtualised tty typically
      operates at infinite speed rather than emulating 9600 baud).
      
      Finally many drivers had invalid and unsafe attempts to avoid buffer
      overflows by directly invoking tty methods extracted out of the innards
      of work queue structs. These are no longer needed and all go away. That
      fixes various random hangs with serial ports on overflow.
      
      The other change in here is to optimise the receive_room path that is
      used by some callers. It turns out that only one ldisc uses receive room
      except asa constant and it updates it far far less than the value is
      read. We thus make it a variable not a function call.
      
      I expect the code to contain bugs due to the size alone but I'll be
      watching and squashing them and feeding out new patches as it goes.
      
      Because the buffers now dynamically expand you should only run out of
      buffering when the kernel runs out of memory for real.  That means a lot of
      the horrible hacks high performance drivers used to do just aren't needed any
      more.
      
      Description:
      
      tty_insert_flip_char is an old API and continues to work as before, as does
      tty_flip_buffer_push() [this is why many drivers dont need modification].  It
      does now also return the number of chars inserted
      
      There are also
      
      tty_buffer_request_room(tty, len)
      
      which asks for a buffer block of the length requested and returns the space
      found.  This improves efficiency with hardware that knows how much to
      transfer.
      
      and tty_insert_flip_string_flags(tty, str, flags, len)
      
      to insert a string of characters and flags
      
      For a smart interface the usual code is
      
          len = tty_request_buffer_room(tty, amount_hardware_says);
          tty_insert_flip_string(tty, buffer_from_card, len);
      
      More description!
      
      At the moment tty buffers are attached directly to the tty.  This is causing a
      lot of the problems related to tty layer locking, also problems at high speed
      and also with bursty data (such as occurs in virtualised environments)
      
      I'm working on ripping out the flip buffers and replacing them with a pool of
      dynamically allocated buffers.  This allows both for old style "byte I/O"
      devices and also helps virtualisation and smart devices where large blocks of
      data suddenely materialise and need storing.
      
      So far so good.  Lots of drivers reference tty->flip.*.  Several of them also
      call directly and unsafely into function pointers it provides.  This will all
      break.  Most drivers can use tty_insert_flip_char which can be kept as an API
      but others need more.
      
      At the moment I've added the following interfaces, if people think more will
      be needed now is a good time to say
      
       int tty_buffer_request_room(tty, size)
      
      Try and ensure at least size bytes are available, returns actual room (may be
      zero).  At the moment it just uses the flipbuf space but that will change.
      Repeated calls without characters being added are not cumulative.  (ie if you
      call it with 1, 1, 1, and then 4 you'll have four characters of space.  The
      other functions will also try and grow buffers in future but this will be a
      more efficient way when you know block sizes.
      
       int tty_insert_flip_char(tty, ch, flag)
      
      As before insert a character if there is room.  Now returns 1 for success, 0
      for failure.
      
       int tty_insert_flip_string(tty, str, len)
      
      Insert a block of non error characters.  Returns the number inserted.
      
       int tty_prepare_flip_string(tty, strptr, len)
      
      Adjust the buffer to allow len characters to be added.  Returns a buffer
      pointer in strptr and the length available.  This allows for hardware that
      needs to use functions like insl or mencpy_fromio.
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Cc: Paul Fulghum <paulkf@microgate.com>
      Signed-off-by: NHirokazu Takata <takata@linux-m32r.org>
      Signed-off-by: NSerge Hallyn <serue@us.ibm.com>
      Signed-off-by: NJeff Dike <jdike@addtoit.com>
      Signed-off-by: NJohn Hawkes <hawkes@sgi.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NAdrian Bunk <bunk@stusta.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      33f0f88f
  27. 05 1月, 2006 1 次提交
  28. 28 10月, 2005 1 次提交