1. 22 1月, 2013 1 次提交
    • S
      usb: gadget: allocate & giveback serial ports instead hard code them · 19b10a88
      Sebastian Andrzej Siewior 提交于
      This patch removes gserial_setup() and gserial_cleanup() and adds
      gserial_alloc_line() and gserial_free_line() to replace them.
      
      The initial setup of u_serial happens now on module load time. A
      maximum of four TTY ports can be requested which is the current limit.
      In theory we could extend this limit, the hard limit is the number of
      available endpoints.
      alloc_tty_driver() is now called at module init time with the max
      available ports. The per-line footprint here is on 32bit is 3 * size of
      pointer + 60 bytes (for cdevs).
      The remaining memory (struct gs_port) is allocated once a port is
      requested.
      
      With this change it is possible to load g_multi and g_serial at the same
      time. GS0 receives the module that is loaded first, GS1 is received by
      the next module and so on. With the configfs interface the port number
      can be exported and the device node is more predictable. Nothing changes
      for g_serial and friends as long as one module is used.
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NFelipe Balbi <balbi@ti.com>
      19b10a88
  2. 29 6月, 2011 1 次提交
  3. 18 10月, 2008 1 次提交
  4. 14 8月, 2008 1 次提交
    • D
      usb gadget: issue notifications from ACM function · 1f1ba11b
      David Brownell 提交于
      Update the CDC-ACM gadget code to support the peripheral-to-host
      notifications when the tty is opened or closed, or issues a BREAK.
      The serial framework code calls new generic hooks; right now only
      CDC-ACM uses those hooks.  This resolves several REVISIT comments
      in the code.  (Based on a patch from Felipe Balbi.)
      
      Note that this doesn't expose USB_CDC_CAP_BRK to the host, since
      this code still rejects USB_CDC_REQ_SEND_BREAK control requests
      for host-to-peripheral BREAK signaling (received via /dev/ttyGS*).
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Cc: Felipe Balbi <felipe.balbi@nokia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      1f1ba11b
  5. 22 7月, 2008 4 次提交
    • 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 serial: split out generic serial function · 61d8baea
      David Brownell 提交于
      Split out the generic serial support into a "function driver".  This
      closely mimics the ACM support, but with a MUCH simpler control model.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      61d8baea
    • D
      usb gadget serial: split out CDC ACM function · 4d5a73dc
      David Brownell 提交于
      Split out CDC ACM parts of "gadget serial" to a "function driver".
      Some key structural differences from the previous ACM support, shared
      with with the generic serial function (next patch):
      
       - As a function driver, it can be combined with other functions.
         One gadget configuration could offer both serial and network
         links, as an example.
      
       - One serial port can be exposed in multiple configurations;
         the /dev/ttyGS0 node could be exposed regardless of which
         config the host selected.
      
       - One configuration can expose multiple serial ports, such as
         ttyGS0, ttyGS1, ttyGS2, and ttyGS3.
      
      This code should be a lot easier to understand than the previous
      all-in-one-big-file version of the driver.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4d5a73dc
    • D
      usb gadget: split out serial core · c1dca562
      David Brownell 提交于
      This abstracts the "gadget serial" driver TTY glue into a separate
      component, cleaning it up and disentangling it from connection state.
      
      It also changed some behaviors for the better:
      
        - Stops using "experimental" major #127, and switches over to
          having the TTY layer allocate the dev_t numbers.
          
        - Provides /sys/class/tty/ttyGS* nodes, thus mdev/udev support.
          (Note "mdev" hotplug bug in Busybox v1.7.2: /dev/ttyGS0 will
          be a *block* device without CONFIG_SYSFS_DEPRECATED_V2.)
      
        - The tty nodes no longer reject opens when there's no host.
          Now they can support normal getty configs in /etc/inttab...
      
        - Now implements RX throttling.  When the line discipline says
          it doesn't want any more data, only packets in flight will be
          delivered (currently, max 1K/8K at full/high speeds) until it
          unthrottles the data.
      
        - Supports low_latency.  This is a good policy for all USB serial
          adapters, since it eliminates scheduler overhead on RX paths.
      
      This also includes much cleanup including better comments, fixing
      memory leaks and other bugs (including some locking fixes), messaging
      cleanup, and an interface audit and tightening.  This added up to a
      significant object code shrinkage, on the order of 20% (!) depending
      on CPU and compiler.
      
      A separate patch actually kicks in this new code, using the functions
      declared in this new header, and removes the previous glue.
      Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c1dca562