1. 05 Oct, 2010 1 commit
  2. 16 Jun, 2010 1 commit
  3. 03 Jun, 2010 1 commit
  4. 18 May, 2010 1 commit
  5. 14 May, 2010 1 commit
    • Joe Perches's avatar
      drivers/net: Remove unnecessary returns from void function()s · a4b77097
      Joe Perches authored
      This patch removes from drivers/net/ all the unnecessary
      return; statements that precede the last closing brace of
      void functions.
      
      It does not remove the returns that are immediately
      preceded by a label as gcc doesn't like that.
      
      It also does not remove null void functions with return.
      
      Done via:
      $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \
        xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }'
      
      with some cleanups by hand.
      
      Compile tested x86 allmodconfig only.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a4b77097
  6. 11 May, 2010 1 commit
    • Prasanna S Panchamukhi's avatar
      wimax/i2400m: Move module params to other file so they can be static · 9d7fdf1b
      Prasanna S Panchamukhi authored
      This patch moves the module parameters to the file where they
      can be avoided to be global and allow them to be static.
      
      The module param : idle_mode_disabled and power_save_disabled
      are moved from  driver.c to control.c. Also these module parameters
      are declared to be static as they are not required to be global anymore.
      The module param : rx_reorder_disabled is moved from driver.c file to
      rx.c file. Also this parameter is declated as static as it is not
      required to be global anymore.
      
      Signed-off-by: Prasanna S Panchamukhi<prasannax.s.panchamukhi@intel.com>
      9d7fdf1b
  7. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  8. 03 Nov, 2009 2 commits
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: introduce i2400m_reset(), stopping TX and carrier · c931ceeb
      Inaky Perez-Gonzalez authored
      Currently the i2400m driver was resetting by just calling
      i2400m->bus_reset(). However, this was missing stopping the TX queue
      and downing the carrier. This was causing, for the corner case of the
      driver reseting a device that refuses to go out of idle mode, that a
      few packets would be queued and more than one reset would go through,
      making the recovery a wee bit messy.
      
      To avoid introducing the same cleanup in all the bus-specific driver,
      introduced a i2400m_reset() function that takes care of house cleaning
      and then calling the bus-level reset implementation.
      
      The bulk of the changes in all files are just to rename the call from
      i2400m->bus_reset() to i2400m_reset().
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      c931ceeb
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: implement passive mode as a module option · 55a662d6
      Inaky Perez-Gonzalez authored
      Some versions of the user space Intel WiMAX daemon need to have full
      control over the device initialization sequence. By setting the module
      option i2400.passive_mode to 1, the driver defers all device
      configuration and initialization to user space.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      55a662d6
  9. 19 Oct, 2009 1 commit
  10. 11 Jun, 2009 4 commits
    • Cindy H Kao's avatar
      wimax/i2400m: use -EL3RST to indicate device reset instead of -ERESTARTSYS · 0bcfc5ef
      Cindy H Kao authored
      When the i2400m device resets, the driver code will force some
      functions to return a -ERESTARTSYS error code, which can is used by
      the caller to determine which recovery actions to take.
      
      However, in certain situations the only thing that can be done is to
      bubble up said error code to user space, for handling.
      
      However, -ERESTARSYS was a poor choice, as it is supposed to be used
      by the kernel only.
      
      As such, replace -ERESTARTSYS with -EL3RST; as well, in
      i2400m_msg_to_dev(), when the device is in boot mode (following a
      recent reset), return -EL3RST instead of -ENODEV (meaning the device
      is in bootrom mode after a reset, not that the device was
      disconnected, and thus, normal commands cannot be executed).
      Signed-off-by: default avatarCindy H Kao <cindy.h.kao@intel.com>
      0bcfc5ef
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: if a device reboot happens during probe, handle it · b4013f91
      Inaky Perez-Gonzalez authored
      When a device reboot happens when we are under probe, with init_mutex
      taken, make sure we can recover. Have dev_reset_handle set boot mode
      and i2400m_msg_to_dev() will see it and fail gracefully instead of
      timing out.
      
      Found and diagnosed by Cindy H. Kao.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      b4013f91
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: don't reset device on i2400m_dev_shutdown() · b4bd07e3
      Inaky Perez-Gonzalez authored
      i2400m_dev_shutdown() tried to reset the device to put it in a known
      state before shutting down.
      
      But that turned out to be pointless. We reach this case in two paths:
      
       1 - when the device resets, to clean up state
       2 - when the driver is unloaded, for the same
      
      however, in both cases it is pointless; in (1) the device is already
      reset, why do it again? in (2) we can't -- the USB stack, for example,
      doesn't allow communicating with the device when the driver is being
      unbound and if the device is disconnected, the device is gone already.
      
      So just remove it. Leave the function as a placeholder for future
      cleanups that will be done from data allocated by the driver during
      device operation.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      b4bd07e3
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: introduce module parameter to disable entering power save · fb101674
      Inaky Perez-Gonzalez authored
      The i2400m driver waits for the device to report being ready for
      entering power save before asking it to do so. This module parameter
      allows control of said operation; if disabled, the driver won't ask
      the device to enter power save mode.
      
      This is useful in setups where power saving is not so important or
      when the overhead imposed by network reentry after power save is not
      acceptable; by combining this with parameter 'idle_mode_disabled', the
      driver will always maintain both the connection and the device in
      active state.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      fb101674
  11. 29 May, 2009 3 commits
  12. 02 Mar, 2009 5 commits
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: implement RX reorder support · c747583d
      Inaky Perez-Gonzalez authored
      Allow the device to give the driver RX data with reorder information.
      
      When that is done, the device will indicate the driver if a packet has
      to be held in a (sorted) queue. It will also tell the driver when held
      packets have to be released to the OS.
      
      This is done to improve the WiMAX-protocol level retransmission
      support when missing frames are detected.
      
      The code docs provide details about the implementation.
      
      In general, this just hooks into the RX path in rx.c; if a packet with
      the reorder bit in the RX header is detected, the reorder information
      in the header is extracted and one of the four main reorder operations
      are executed. In one case (queue) no packet will be delivered to the
      networking stack, just queued, whereas in the others (reset, update_ws
      and queue_update_ws), queued packet might be delivered depending on
      the window start for the specific queue.
      
      The modifications to files other than rx.c are:
      
      - control.c: during device initialization, enable reordering support
        if the rx_reorder_disabled module parameter is not enabled
      
      - driver.c: expose a rx_reorder_disable module parameter and call
        i2400m_rx_setup/release() to initialize/shutdown RX reorder
        support.
      
      - i2400m.h: introduce members in 'struct i2400m' needed for
        implementing reorder support.
      
      - linux/i2400m.h: introduce TLVs, commands and constant definitions
        related to RX reorder
      
      Last but not least, the rx reorder code includes an small circular log
      where the last N reorder operations are recorded to be displayed in
      case of inconsistency. Otherwise diagnosing issues would be almost
      impossible.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c747583d
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: support extended data RX protocol (no need to reallocate skbs) · fd5c565c
      Inaky Perez-Gonzalez authored
      Newer i2400m firmwares (>= v1.4) extend the data RX protocol so that
      each packet has a 16 byte header. This header is mainly used to
      implement host reordeing (which is addressed in later commits).
      
      However, this header also allows us to overwrite it (once data has
      been extracted) with an Ethernet header and deliver to the networking
      stack without having to reallocate the skb (as it happened in fw <=
      v1.3) to make room for it.
      
      - control.c: indicate the device [dev_initialize()] that the driver
        wants to use the extended data RX protocol. Also involves adding the
        definition of the needed data types in include/linux/wimax/i2400m.h.
      
      - rx.c: handle the new payload type for the extended RX data
        protocol. Prepares the skb for delivery to
        netdev.c:i2400m_net_erx().
      
      - netdev.c: Introduce i2400m_net_erx() that adds the fake ethernet
        address to a prepared skb and delivers it to the networking
        stack.
      
      - cleanup: in most instances in rx.c, the variable 'single' was
        renamed to 'single_last' for it better conveys its meaning.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fd5c565c
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: allow control of the base-station idle mode timeout · 8987691a
      Inaky Perez-Gonzalez authored
      For power saving reasons, WiMAX links can be put in idle mode while
      connected after a certain time of the link not being used for tx or
      rx. In this mode, the device pages the base-station regularly and when
      data is ready to be transmitted, the link is revived.
      
      This patch allows the user to control the time the device has to be
      idle before it decides to go to idle mode from a sysfs
      interace.
      
      It also updates the initialization code to acknowledge the module
      variable 'idle_mode_disabled' when the firmware is a newer version
      (upcoming 1.4 vs 2.6.29's v1.3).
      
      The method for setting the idle mode timeout in the older firmwares is
      much more limited and can be only done at initialization time. Thus,
      the sysfs file will return -ENOSYS on older ones.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8987691a
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: firmware_check() encodes the firmware version in i2400m->fw_version · 6a0f7ab8
      Inaky Perez-Gonzalez authored
      Upcoming modifications will need to test for the running firmware
      version before activating a feature or not. This is helpful to
      implement backward compatibility with older firmware versions.
      
      Modify i2400m_firmware_check() to encode in i2400m->fw_version the
      major and minor version numbers of the firmware interface.
      
      As well, move the call to be done as the very first operation once we
      have communication with the device during probe() [in
      __i2400m_dev_start()]. This is needed so any operation that is
      executed afterwards can determine which fw version it is talking to.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a0f7ab8
    • Inaky Perez-Gonzalez's avatar
      wimax/i2400m: drop support for deprecated major fw interface, add for new minor · efa05d0f
      Inaky Perez-Gonzalez authored
      Firmware interface version 8.x.x has long been deprecated and is no
      longer supported (nor available, as it is a preproduction firmware),
      so it can be safely dropped.
      
      Add support for firmware interface v9.2.x (current is 9.1.x). Firmware
      version 9.2.x is backwards compatible with 9.1.x; new features are
      enabled if switches are pressed to turn them on. Forthcoming commits
      to the driver will start pressing those switches when the firmware
      interface supports it.
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      efa05d0f
  13. 20 Jan, 2009 1 commit
  14. 07 Jan, 2009 1 commit
    • Inaky Perez-Gonzalez's avatar
      i2400m: various functions for device management · 3a35a1d0
      Inaky Perez-Gonzalez authored
      This is a collection of functions used to control the device (plus a
      few helpers).
      
      There are utilities for handling TLV buffers, hooks on the device's
      reports to act on device changes of state [i2400m_report_hook()], on
      acks to commands [i2400m_msg_ack_hook()], a helper for sending
      commands to the device and blocking until a reply arrives
      [i2400m_msg_to_dev()], a few high level commands for manipulating the
      device state, powersaving mode and configuration plus the routines to
      setup the device once communication is established with it
      [i2400m_dev_initialize()].
      Signed-off-by: default avatarInaky Perez-Gonzalez <inaky@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      3a35a1d0