1. 06 4月, 2019 1 次提交
    • Z
      wlcore: Fix memory leak in case wl12xx_fetch_firmware failure · 52cd9e0e
      Zumeng Chen 提交于
      [ Upstream commit ba2ffc96321c8433606ceeb85c9e722b8113e5a7 ]
      
      Release fw_status, raw_fw_status, and tx_res_if when wl12xx_fetch_firmware
      failed instead of meaningless goto out to avoid the following memory leak
      reports(Only the last one listed):
      
      unreferenced object 0xc28a9a00 (size 512):
        comm "kworker/0:4", pid 31298, jiffies 2783204 (age 203.290s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
        backtrace:
          [<6624adab>] kmemleak_alloc+0x40/0x74
          [<500ddb31>] kmem_cache_alloc_trace+0x1ac/0x270
          [<db4d731d>] wl12xx_chip_wakeup+0xc4/0x1fc [wlcore]
          [<76c5db53>] wl1271_op_add_interface+0x4a4/0x8f4 [wlcore]
          [<cbf30777>] drv_add_interface+0xa4/0x1a0 [mac80211]
          [<65bac325>] ieee80211_reconfig+0x9c0/0x1644 [mac80211]
          [<2817c80e>] ieee80211_restart_work+0x90/0xc8 [mac80211]
          [<7e1d425a>] process_one_work+0x284/0x42c
          [<55f9432e>] worker_thread+0x2fc/0x48c
          [<abb582c6>] kthread+0x148/0x160
          [<63144b13>] ret_from_fork+0x14/0x2c
          [< (null)>] (null)
          [<1f6e7715>] 0xffffffff
      Signed-off-by: NZumeng Chen <zumeng.chen@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      52cd9e0e
  2. 14 11月, 2018 1 次提交
    • T
      wlcore: Fix BUG with clear completion on timeout · a0a9e306
      Tony Lindgren 提交于
      [ Upstream commit 4e651bad848955d88b29a568bfbfb4b831270e16 ]
      
      We do not currently clear wl->elp_compl on ELP timeout and we have bogus
      lingering pointer that wlcore_irq then will try to access after recovery
      is done:
      
      BUG: spinlock bad magic on CPU#1, irq/255-wl12xx/580
      ...
      (spin_dump) from [<c01b9344>] (do_raw_spin_lock+0xc8/0x124)
      (do_raw_spin_lock) from [<c09b3970>] (_raw_spin_lock_irqsave+0x68/0x74)
      (_raw_spin_lock_irqsave) from [<c01a02f0>] (complete+0x24/0x58)
      (complete) from [<bf572610>] (wlcore_irq+0x48/0x17c [wlcore])
      (wlcore_irq [wlcore]) from [<c01c5efc>] (irq_thread_fn+0x2c/0x64)
      (irq_thread_fn) from [<c01c623c>] (irq_thread+0x148/0x290)
      (irq_thread) from [<c016b4b0>] (kthread+0x160/0x17c)
      (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20)
      ...
      
      After that the system will hang. Let's fix this by adding a flag for
      recovery and moving the recovery work call to to the error handling
      section.
      
      And we want to set WL1271_FLAG_INTENDED_FW_RECOVERY and actually clear
      it too in wl1271_recovery_work() and just downgrade the error to a
      warning to prevent overly verbose output.
      
      Cc: Eyal Reizer <eyalr@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a0a9e306
  3. 31 7月, 2018 1 次提交
  4. 28 6月, 2018 1 次提交
    • O
      wireless-drivers: use BIT_ULL for NL80211_STA_INFO_ attribute types · 22d0d2fa
      Omer Efrat 提交于
      The BIT macro uses unsigned long which some architectures handle as 32 bit
      and therefore might cause macro's shift to overflow when used on a value
      equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards).
      
      Since 'filled' member in station_info changed to u64, BIT_ULL macro
      should be used with all NL80211_STA_INFO_* attribute types instead of BIT
      to prevent future possible bugs when one will use BIT macro for higher
      attributes by mistake.
      
      This commit cleans up all usages of BIT macro with the above field
      in wireless-drivers by changing it to BIT_ULL instead. In addition, there are
      some places which don't use BIT nor BIT_ULL macros so align those as well.
      Signed-off-by: NOmer Efrat <omer.efrat@tandemg.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      22d0d2fa
  5. 27 6月, 2018 6 次提交
    • T
      wlcore: Enable runtime PM autosuspend support · 9b71578d
      Tony Lindgren 提交于
      With runtime PM tested working for wlcore with no autosuspend, we can
      now enable autosuspend to cut down on enable/disable for interrupts.
      Basically we just replace pm_runtime_put() with the autosuspend variants.
      
      Let's use autosuspend delay of 50ms that MMC drivers typically use.
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      9b71578d
    • T
      wlcore: Make sure firmware is initialized in wl1271_op_add_interface() · c40aad28
      Tony Lindgren 提交于
      We have wl12xx_boot() call wl12xx_enable_interrupts() and if we have
      wl1271_op_add_interface() call pm_runtime_get_sync() before the interrupts
      are enabled. And then we get the following error during boot:
      
      wlcore: ERROR ELP wakeup timeout!
      
      Let's fix this by first checking if we need to boot the firmware. And
      only after that call pm_runtime_get_sync() when interrupts are enabled.
      And only after that do the check for wl12xx_need_fw_change().
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      c40aad28
    • E
      wlcore: Use generic runtime pm calls for wowlan elp configuration · 45aa7f07
      Eyal Reizer 提交于
      With runtime PM enabled, we can now use calls to pm_runtime_force_suspend
      and pm_runtime_force_resume for enabling elp during suspend when wowlan
      is enabled and waking the chip from elp on resume.
      
      Remove the custom API that was used to ensure that the command
      that is used to allow ELP during suspend is completed before the system
      suspend.
      Signed-off-by: NEyal Reizer <eyalr@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      45aa7f07
    • T
      wlcore: Fix timout errors after recovery · db68052b
      Tony Lindgren 提交于
      After enabling runtime PM, if we force hardware reset multiple times with:
      
      # echo 1 > /sys/kernel/debug/ieee80211/phy0/wlcore/start_recovery
      
      We will after few tries get the following error:
      
      wlcore: ERROR timeout waiting for the hardware to complete initialization
      
      And then wlcore is unable to reconnect until after the wlcore related modules
      are reloaded.
      
      Let's fix this by moving pm_runtime_put() earlier before we restart the hardware.
      And let's use the sync version to make sure we're done before we restart.
      
      Note that we still will get -EBUSY warning from wl12xx_sdio_set_power() but let's
      fix that separately once we know exactly why we get the warning.
      Reported-by: NEyal Reizer <eyalr@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      db68052b
    • T
      wlcore: Add support for runtime PM · fa2648a3
      Tony Lindgren 提交于
      We can update wlcore to use PM runtime by adding functions for
      wlcore_runtime_suspend() and wlcore_runtime_resume() and replacing
      calls to wl1271_ps_elp_wakeup() and wl1271_ps_elp_sleep() with calls
      to pm_runtime_get_sync() and pm_runtime_put().
      
      Note that the new wlcore_runtime_suspend() and wlcore_runtime_resume()
      functions are based on simplified versions of wl1271_ps_elp_sleep() and
      wl1271_ps_elp_wakeup().
      
      We don't want to use the old functions as we can now take advantage of
      the runtime PM usage count. And we don't need the old elp_work at all.
      And we can also remove WL1271_FLAG_ELP_REQUESTED that is no longer needed.
      
      Pretty much the only place where we are not just converting the existing
      functions is wl1271_op_suspend() where we add pm_runtime_put_noidle()
      to keep the calls paired.
      
      As the next step is to implement runtime PM autosuspend, let's not add
      wrapper functions for the generic runtime PM calls. We would be getting
      rid of any wrapper functions anyways.
      
      After autoidle we should be able to start using Linux generic wakeirqs
      for the padconf interrupt.
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      fa2648a3
    • T
      wlcore: Make sure PM calls are paired · 02edf813
      Tony Lindgren 提交于
      The call to wl1271_ps_elp_wakeup() in wl12xx_queue_recovery_work() is
      unpaired. Let's remove it and add paired calls to wl1271_recovery_work()
      instead in preparation for changing things to use runtime PM.
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      02edf813
  6. 27 3月, 2018 1 次提交
  7. 14 12月, 2017 1 次提交
    • A
      wlcore: fix unused function warning · 7de241f3
      Arnd Bergmann 提交于
      The newly added wlcore_fw_sleep function is called conditionally,
      which causes a warning without CONFIG_PM:
      
      drivers/net/wireless/ti/wlcore/main.c:981:12: error: 'wlcore_fw_sleep' defined but not used [-Werror=unused-function]
      
      Instead of trying to keep track of what should be in the #ifdef and what
      should not, it's easier to mark the top-level suspend/resume functions
      as __maybe_unused so the compiler can silently drop all the unused code.
      
      Fixes: 37bf241b ("wlcore: allow elp during wowlan suspend")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      7de241f3
  8. 07 12月, 2017 2 次提交
    • R
      wlcore: allow elp during wowlan suspend · 37bf241b
      Reizer, Eyal 提交于
      when enabling wowlan and entering suspend the last write to the firmware
      allowing it to go into elp mode was not completing before suspend, leaving
      the firmware running in full active mode consuming high power.
      Use an immediate call instead of a work queue for this last access
      allowing the firmware to go into power save during wowlan uspend.
      Signed-off-by: NEyal Reizer <eyalr@ti.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      37bf241b
    • A
      wlcore: use boottime for fw time sync · 99f6996d
      Arnd Bergmann 提交于
      Using getnstimeofday()/timespec_to_ns() causes an overflow on 32-bit
      architectures in 2038, and may suffer from time jumps due to
      settimeofday() or leap seconds.
      
      I don't see a reason why this needs to be UTC, so either monotonic
      or boot time would be better here. Assuming that the fw time keeps
      running during suspend, boottime is better than monotonic, and
      ktime_get_boot_ns() will also save the additional conversion to
      nanoseconds.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      99f6996d
  9. 22 11月, 2017 1 次提交
    • K
      treewide: setup_timer() -> timer_setup() · e99e88a9
      Kees Cook 提交于
      This converts all remaining cases of the old setup_timer() API into using
      timer_setup(), where the callback argument is the structure already
      holding the struct timer_list. These should have no behavioral changes,
      since they just change which pointer is passed into the callback with
      the same available pointers after conversion. It handles the following
      examples, in addition to some other variations.
      
      Casting from unsigned long:
      
          void my_callback(unsigned long data)
          {
              struct something *ptr = (struct something *)data;
          ...
          }
          ...
          setup_timer(&ptr->my_timer, my_callback, ptr);
      
      and forced object casts:
      
          void my_callback(struct something *ptr)
          {
          ...
          }
          ...
          setup_timer(&ptr->my_timer, my_callback, (unsigned long)ptr);
      
      become:
      
          void my_callback(struct timer_list *t)
          {
              struct something *ptr = from_timer(ptr, t, my_timer);
          ...
          }
          ...
          timer_setup(&ptr->my_timer, my_callback, 0);
      
      Direct function assignments:
      
          void my_callback(unsigned long data)
          {
              struct something *ptr = (struct something *)data;
          ...
          }
          ...
          ptr->my_timer.function = my_callback;
      
      have a temporary cast added, along with converting the args:
      
          void my_callback(struct timer_list *t)
          {
              struct something *ptr = from_timer(ptr, t, my_timer);
          ...
          }
          ...
          ptr->my_timer.function = (TIMER_FUNC_TYPE)my_callback;
      
      And finally, callbacks without a data assignment:
      
          void my_callback(unsigned long data)
          {
          ...
          }
          ...
          setup_timer(&ptr->my_timer, my_callback, 0);
      
      have their argument renamed to verify they're unused during conversion:
      
          void my_callback(struct timer_list *unused)
          {
          ...
          }
          ...
          timer_setup(&ptr->my_timer, my_callback, 0);
      
      The conversion is done with the following Coccinelle script:
      
      spatch --very-quiet --all-includes --include-headers \
      	-I ./arch/x86/include -I ./arch/x86/include/generated \
      	-I ./include -I ./arch/x86/include/uapi \
      	-I ./arch/x86/include/generated/uapi -I ./include/uapi \
      	-I ./include/generated/uapi --include ./include/linux/kconfig.h \
      	--dir . \
      	--cocci-file ~/src/data/timer_setup.cocci
      
      @fix_address_of@
      expression e;
      @@
      
       setup_timer(
      -&(e)
      +&e
       , ...)
      
      // Update any raw setup_timer() usages that have a NULL callback, but
      // would otherwise match change_timer_function_usage, since the latter
      // will update all function assignments done in the face of a NULL
      // function initialization in setup_timer().
      @change_timer_function_usage_NULL@
      expression _E;
      identifier _timer;
      type _cast_data;
      @@
      
      (
      -setup_timer(&_E->_timer, NULL, _E);
      +timer_setup(&_E->_timer, NULL, 0);
      |
      -setup_timer(&_E->_timer, NULL, (_cast_data)_E);
      +timer_setup(&_E->_timer, NULL, 0);
      |
      -setup_timer(&_E._timer, NULL, &_E);
      +timer_setup(&_E._timer, NULL, 0);
      |
      -setup_timer(&_E._timer, NULL, (_cast_data)&_E);
      +timer_setup(&_E._timer, NULL, 0);
      )
      
      @change_timer_function_usage@
      expression _E;
      identifier _timer;
      struct timer_list _stl;
      identifier _callback;
      type _cast_func, _cast_data;
      @@
      
      (
      -setup_timer(&_E->_timer, _callback, _E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, &_callback, _E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, _callback, (_cast_data)_E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, &_callback, (_cast_data)_E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, (_cast_func)_callback, _E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, (_cast_func)&_callback, _E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, (_cast_func)_callback, (_cast_data)_E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, (_cast_func)&_callback, (_cast_data)_E);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, (_cast_data)_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, (_cast_data)&_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, &_callback, (_cast_data)_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, &_callback, (_cast_data)&_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)&_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)&_E);
      +timer_setup(&_E._timer, _callback, 0);
      |
       _E->_timer@_stl.function = _callback;
      |
       _E->_timer@_stl.function = &_callback;
      |
       _E->_timer@_stl.function = (_cast_func)_callback;
      |
       _E->_timer@_stl.function = (_cast_func)&_callback;
      |
       _E._timer@_stl.function = _callback;
      |
       _E._timer@_stl.function = &_callback;
      |
       _E._timer@_stl.function = (_cast_func)_callback;
      |
       _E._timer@_stl.function = (_cast_func)&_callback;
      )
      
      // callback(unsigned long arg)
      @change_callback_handle_cast
       depends on change_timer_function_usage@
      identifier change_timer_function_usage._callback;
      identifier change_timer_function_usage._timer;
      type _origtype;
      identifier _origarg;
      type _handletype;
      identifier _handle;
      @@
      
       void _callback(
      -_origtype _origarg
      +struct timer_list *t
       )
       {
      (
      	... when != _origarg
      	_handletype *_handle =
      -(_handletype *)_origarg;
      +from_timer(_handle, t, _timer);
      	... when != _origarg
      |
      	... when != _origarg
      	_handletype *_handle =
      -(void *)_origarg;
      +from_timer(_handle, t, _timer);
      	... when != _origarg
      |
      	... when != _origarg
      	_handletype *_handle;
      	... when != _handle
      	_handle =
      -(_handletype *)_origarg;
      +from_timer(_handle, t, _timer);
      	... when != _origarg
      |
      	... when != _origarg
      	_handletype *_handle;
      	... when != _handle
      	_handle =
      -(void *)_origarg;
      +from_timer(_handle, t, _timer);
      	... when != _origarg
      )
       }
      
      // callback(unsigned long arg) without existing variable
      @change_callback_handle_cast_no_arg
       depends on change_timer_function_usage &&
                           !change_callback_handle_cast@
      identifier change_timer_function_usage._callback;
      identifier change_timer_function_usage._timer;
      type _origtype;
      identifier _origarg;
      type _handletype;
      @@
      
       void _callback(
      -_origtype _origarg
      +struct timer_list *t
       )
       {
      +	_handletype *_origarg = from_timer(_origarg, t, _timer);
      +
      	... when != _origarg
      -	(_handletype *)_origarg
      +	_origarg
      	... when != _origarg
       }
      
      // Avoid already converted callbacks.
      @match_callback_converted
       depends on change_timer_function_usage &&
                  !change_callback_handle_cast &&
      	    !change_callback_handle_cast_no_arg@
      identifier change_timer_function_usage._callback;
      identifier t;
      @@
      
       void _callback(struct timer_list *t)
       { ... }
      
      // callback(struct something *handle)
      @change_callback_handle_arg
       depends on change_timer_function_usage &&
      	    !match_callback_converted &&
                  !change_callback_handle_cast &&
                  !change_callback_handle_cast_no_arg@
      identifier change_timer_function_usage._callback;
      identifier change_timer_function_usage._timer;
      type _handletype;
      identifier _handle;
      @@
      
       void _callback(
      -_handletype *_handle
      +struct timer_list *t
       )
       {
      +	_handletype *_handle = from_timer(_handle, t, _timer);
      	...
       }
      
      // If change_callback_handle_arg ran on an empty function, remove
      // the added handler.
      @unchange_callback_handle_arg
       depends on change_timer_function_usage &&
      	    change_callback_handle_arg@
      identifier change_timer_function_usage._callback;
      identifier change_timer_function_usage._timer;
      type _handletype;
      identifier _handle;
      identifier t;
      @@
      
       void _callback(struct timer_list *t)
       {
      -	_handletype *_handle = from_timer(_handle, t, _timer);
       }
      
      // We only want to refactor the setup_timer() data argument if we've found
      // the matching callback. This undoes changes in change_timer_function_usage.
      @unchange_timer_function_usage
       depends on change_timer_function_usage &&
                  !change_callback_handle_cast &&
                  !change_callback_handle_cast_no_arg &&
      	    !change_callback_handle_arg@
      expression change_timer_function_usage._E;
      identifier change_timer_function_usage._timer;
      identifier change_timer_function_usage._callback;
      type change_timer_function_usage._cast_data;
      @@
      
      (
      -timer_setup(&_E->_timer, _callback, 0);
      +setup_timer(&_E->_timer, _callback, (_cast_data)_E);
      |
      -timer_setup(&_E._timer, _callback, 0);
      +setup_timer(&_E._timer, _callback, (_cast_data)&_E);
      )
      
      // If we fixed a callback from a .function assignment, fix the
      // assignment cast now.
      @change_timer_function_assignment
       depends on change_timer_function_usage &&
                  (change_callback_handle_cast ||
                   change_callback_handle_cast_no_arg ||
                   change_callback_handle_arg)@
      expression change_timer_function_usage._E;
      identifier change_timer_function_usage._timer;
      identifier change_timer_function_usage._callback;
      type _cast_func;
      typedef TIMER_FUNC_TYPE;
      @@
      
      (
       _E->_timer.function =
      -_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E->_timer.function =
      -&_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E->_timer.function =
      -(_cast_func)_callback;
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E->_timer.function =
      -(_cast_func)&_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E._timer.function =
      -_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E._timer.function =
      -&_callback;
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E._timer.function =
      -(_cast_func)_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      |
       _E._timer.function =
      -(_cast_func)&_callback
      +(TIMER_FUNC_TYPE)_callback
       ;
      )
      
      // Sometimes timer functions are called directly. Replace matched args.
      @change_timer_function_calls
       depends on change_timer_function_usage &&
                  (change_callback_handle_cast ||
                   change_callback_handle_cast_no_arg ||
                   change_callback_handle_arg)@
      expression _E;
      identifier change_timer_function_usage._timer;
      identifier change_timer_function_usage._callback;
      type _cast_data;
      @@
      
       _callback(
      (
      -(_cast_data)_E
      +&_E->_timer
      |
      -(_cast_data)&_E
      +&_E._timer
      |
      -_E
      +&_E->_timer
      )
       )
      
      // If a timer has been configured without a data argument, it can be
      // converted without regard to the callback argument, since it is unused.
      @match_timer_function_unused_data@
      expression _E;
      identifier _timer;
      identifier _callback;
      @@
      
      (
      -setup_timer(&_E->_timer, _callback, 0);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, _callback, 0L);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E->_timer, _callback, 0UL);
      +timer_setup(&_E->_timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, 0);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, 0L);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_E._timer, _callback, 0UL);
      +timer_setup(&_E._timer, _callback, 0);
      |
      -setup_timer(&_timer, _callback, 0);
      +timer_setup(&_timer, _callback, 0);
      |
      -setup_timer(&_timer, _callback, 0L);
      +timer_setup(&_timer, _callback, 0);
      |
      -setup_timer(&_timer, _callback, 0UL);
      +timer_setup(&_timer, _callback, 0);
      |
      -setup_timer(_timer, _callback, 0);
      +timer_setup(_timer, _callback, 0);
      |
      -setup_timer(_timer, _callback, 0L);
      +timer_setup(_timer, _callback, 0);
      |
      -setup_timer(_timer, _callback, 0UL);
      +timer_setup(_timer, _callback, 0);
      )
      
      @change_callback_unused_data
       depends on match_timer_function_unused_data@
      identifier match_timer_function_unused_data._callback;
      type _origtype;
      identifier _origarg;
      @@
      
       void _callback(
      -_origtype _origarg
      +struct timer_list *unused
       )
       {
      	... when != _origarg
       }
      Signed-off-by: NKees Cook <keescook@chromium.org>
      e99e88a9
  10. 24 8月, 2017 1 次提交
    • R
      wlcore: add missing nvs file name info for wilink8 · d382b9c0
      Reizer, Eyal 提交于
      The following commits:
      commit c815fdeb ("wlcore: spi: Populate config firmware data")
      commit d776fc86 ("wlcore: sdio: Populate config firmware data")
      
      Populated the nvs entry for wilink6 and wilink7 only while it is
      still needed for wilink8 as well.
      This broke user space backward compatibility when upgrading from older
      kernels, as the alternate mac address would not be read from the nvs that
      is present in the file system (lib/firmware/ti-connectivity/wl1271-nvs.bin)
      causing mac address change of the wlan interface.
      
      This patch fix this and update the structure field with the same default
      nvs file name that has been used before.
      
      In addition, some distros hold a default wl1271-nvs.bin in the file
      system with a bogus mac address (deadbeef...) that overrides the mac
      address that is stored inside the device.
      Warn users about this bogus mac address and use the internal mac address
      
      Fixes: c815fdeb ("wlcore: spi: Populate config firmware data")
      Fixes: d776fc86 ("wlcore: sdio: Populate config firmware data")
      Signed-off-by: NEyal Reizer <eyalr@ti.com>
      Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      d382b9c0
  11. 16 6月, 2017 1 次提交
    • J
      networking: convert many more places to skb_put_zero() · b080db58
      Johannes Berg 提交于
      There were many places that my previous spatch didn't find,
      as pointed out by yuan linyu in various patches.
      
      The following spatch found many more and also removes the
      now unnecessary casts:
      
          @@
          identifier p, p2;
          expression len;
          expression skb;
          type t, t2;
          @@
          (
          -p = skb_put(skb, len);
          +p = skb_put_zero(skb, len);
          |
          -p = (t)skb_put(skb, len);
          +p = skb_put_zero(skb, len);
          )
          ... when != p
          (
          p2 = (t2)p;
          -memset(p2, 0, len);
          |
          -memset(p, 0, len);
          )
      
          @@
          type t, t2;
          identifier p, p2;
          expression skb;
          @@
          t *p;
          ...
          (
          -p = skb_put(skb, sizeof(t));
          +p = skb_put_zero(skb, sizeof(t));
          |
          -p = (t *)skb_put(skb, sizeof(t));
          +p = skb_put_zero(skb, sizeof(t));
          )
          ... when != p
          (
          p2 = (t2)p;
          -memset(p2, 0, sizeof(*p));
          |
          -memset(p, 0, sizeof(*p));
          )
      
          @@
          expression skb, len;
          @@
          -memset(skb_put(skb, len), 0, len);
          +skb_put_zero(skb, len);
      
      Apply it to the tree (with one manual fixup to keep the
      comment in vxlan.c, which spatch removed.)
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b080db58
  12. 27 4月, 2017 1 次提交
  13. 15 2月, 2017 1 次提交
  14. 17 11月, 2016 2 次提交
  15. 19 10月, 2016 1 次提交
  16. 26 9月, 2016 1 次提交
    • T
      wlcore: Fix config firmware loading issues · 3e1ac932
      Tony Lindgren 提交于
      Booting multiple wl12xx and wl18xx devices using the same rootfs is
      a pain. You currently have to symlink the right nvs file depending
      on the wl12xx type.
      
      For example, with wl1271-nvs.bin being a symlink to wl127x-nvs.bin
      by default and trying to bring up a wl128x based device:
      
      wlcore: ERROR nvs size is not as expected: 1113 != 912
      wlcore: ERROR NVS file is needed during boot
      wlcore: ERROR NVS file is needed during boot
      wlcore: ERROR firmware boot failed despite 3 retries
      
      Note that wl18xx uses a separate config firmware wl18xx-conf.bin
      that can be generated with tools using the following two git repos:
      
      git.ti.com/wilink8-wlan/18xx-ti-utils
      git.ti.com/wilink8-wlan/wl18xx_fw
      
      So let's not configure the nvs file for wl18xx as it's not needed
      AFAIK. If it turns out that we also need the nvs file for wl18xx,
      we can just add it to the config firmware data for wl18xx.
      
      Let's fix the issue by using the chip specific config firmware
      data, and make sure we produce understandable warnings if something
      is missing.
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      3e1ac932
  17. 04 9月, 2016 1 次提交
  18. 05 8月, 2016 1 次提交
  19. 19 7月, 2016 3 次提交
  20. 06 7月, 2016 1 次提交
  21. 30 6月, 2016 1 次提交
    • G
      wlcore: reconfigure sta rates on authorization · 535633a5
      Guy Mishol 提交于
      Since stations can now be added before association
      (NL80211_FEATURE_FULL_AP_CLIENT_STATE support),
      no supported rates are set when the station is added
      to the fw, resulting in fw recovery.
      
      Fix it by first configuring the AP basic rates as
      the station configured rates (when the station is
      first added to the driver), and after the station
      was authorized re-configure it, now with the actual
      supported rates.
      Signed-off-by: NGuy Mishol <guym@ti.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      535633a5
  22. 12 4月, 2016 1 次提交
  23. 08 4月, 2016 1 次提交
  24. 10 3月, 2016 1 次提交
  25. 14 1月, 2016 1 次提交
  26. 31 12月, 2015 1 次提交
  27. 22 9月, 2015 1 次提交
  28. 11 8月, 2015 1 次提交
    • E
      wlcore: add p2p device support · 7845af35
      Eliad Peller 提交于
      When starting a p2p mgmt interface, enable its device role. This
      allows us to keep the sta role disabled and scan on the dev role.
      
      In general, p2p management interfaces cannot send vif-specific commands
      to FW, as the vif role id is invalid. Only off-channel data and scans
      happen on this vif, so most ops are not relevant.
      
      If the vif is a p2p mgmt vif, block some mac80211 ops.
      
      Configure rate policies for p2p mgmt interface, as
      otherwise p2p packets come out with arbitrary rates.
      
      Since wpa_supplicant currently doesn't support standalone
      p2p device mode (without another attached managed interface),
      add p2p device to the allowed interface combinations without
      decreasing the allowed station count.
      
      Moreover, increase the station count in some cases, as AP
      mode usually starts as station interface, and the AP interface
      is now different from the p2p management one).
      Signed-off-by: NArik Nemtsov <arik@wizery.com>
      Signed-off-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      7845af35
  29. 10 6月, 2015 1 次提交
    • J
      mac80211: convert HW flags to unsigned long bitmap · 30686bf7
      Johannes Berg 提交于
      As we're running out of hardware capability flags pretty quickly,
      convert them to use the regular test_bit() style unsigned long
      bitmaps.
      
      This introduces a number of helper functions/macros to set and to
      test the bits, along with new debugfs code.
      
      The occurrences of an explicit __clear_bit() are intentional, the
      drivers were never supposed to change their supported bits on the
      fly. We should investigate changing this to be a per-frame flag.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      30686bf7
  30. 09 5月, 2015 1 次提交
  31. 24 4月, 2015 1 次提交
    • J
      mac80211: remove support for IFF_PROMISC · df140465
      Johannes Berg 提交于
      This support is essentially useless as typically networks are encrypted,
      frames will be filtered by hardware, and rate scaling will be done with
      the intended recipient in mind. For real monitoring of the network, the
      monitor mode support should be used instead.
      
      Removing it removes a lot of corner cases.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      df140465