1. 01 9月, 2017 1 次提交
    • C
      wl1251: add a missing spin_lock_init() · f581a0dd
      Cong Wang 提交于
      wl1251: add a missing spin_lock_init()
      
      This fixes the following kernel warning:
      
       [ 5668.771453] BUG: spinlock bad magic on CPU#0, kworker/u2:3/9745
       [ 5668.771850]  lock: 0xce63ef20, .magic: 00000000, .owner: <none>/-1,
       .owner_cpu: 0
       [ 5668.772277] CPU: 0 PID: 9745 Comm: kworker/u2:3 Tainted: G        W
       4.12.0-03002-gec979a4-dirty #40
       [ 5668.772796] Hardware name: Nokia RX-51 board
       [ 5668.773071] Workqueue: phy1 wl1251_irq_work
       [ 5668.773345] [<c010c9e4>] (unwind_backtrace) from [<c010a274>]
       (show_stack+0x10/0x14)
       [ 5668.773803] [<c010a274>] (show_stack) from [<c01545a4>]
       (do_raw_spin_lock+0x6c/0xa0)
       [ 5668.774230] [<c01545a4>] (do_raw_spin_lock) from [<c06ca578>]
       (_raw_spin_lock_irqsave+0x10/0x18)
       [ 5668.774658] [<c06ca578>] (_raw_spin_lock_irqsave) from [<c048c010>]
       (wl1251_op_tx+0x38/0x5c)
       [ 5668.775115] [<c048c010>] (wl1251_op_tx) from [<c06a12e8>]
       (ieee80211_tx_frags+0x188/0x1c0)
       [ 5668.775543] [<c06a12e8>] (ieee80211_tx_frags) from [<c06a138c>]
       (__ieee80211_tx+0x6c/0x130)
       [ 5668.775970] [<c06a138c>] (__ieee80211_tx) from [<c06a3dbc>]
       (ieee80211_tx+0xdc/0x104)
       [ 5668.776367] [<c06a3dbc>] (ieee80211_tx) from [<c06a4af0>]
       (__ieee80211_subif_start_xmit+0x454/0x8c8)
       [ 5668.776824] [<c06a4af0>] (__ieee80211_subif_start_xmit) from
       [<c06a4f94>] (ieee80211_subif_start_xmit+0x30/0x2fc)
       [ 5668.777343] [<c06a4f94>] (ieee80211_subif_start_xmit) from
       [<c0578848>] (dev_hard_start_xmit+0x80/0x118)
      ...
      
          by adding the missing spin_lock_init().
      Reported-by: NPavel Machek <pavel@ucw.cz>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NPavel Machek <pavel@ucw.cz>
      Cc: stable@kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f581a0dd
  2. 16 6月, 2017 1 次提交
    • J
      networking: introduce and use skb_put_data() · 59ae1d12
      Johannes Berg 提交于
      A common pattern with skb_put() is to just want to memcpy()
      some data into the new space, introduce skb_put_data() for
      this.
      
      An spatch similar to the one for skb_put_zero() converts many
      of the places using it:
      
          @@
          identifier p, p2;
          expression len, skb, data;
          type t, t2;
          @@
          (
          -p = skb_put(skb, len);
          +p = skb_put_data(skb, data, len);
          |
          -p = (t)skb_put(skb, len);
          +p = skb_put_data(skb, data, len);
          )
          (
          p2 = (t2)p;
          -memcpy(p2, data, len);
          |
          -memcpy(p, data, len);
          )
      
          @@
          type t, t2;
          identifier p, p2;
          expression skb, data;
          @@
          t *p;
          ...
          (
          -p = skb_put(skb, sizeof(t));
          +p = skb_put_data(skb, data, sizeof(t));
          |
          -p = (t *)skb_put(skb, sizeof(t));
          +p = skb_put_data(skb, data, sizeof(t));
          )
          (
          p2 = (t2)p;
          -memcpy(p2, data, sizeof(*p));
          |
          -memcpy(p, data, sizeof(*p));
          )
      
          @@
          expression skb, len, data;
          @@
          -memcpy(skb_put(skb, len), data, len);
          +skb_put_data(skb, data, len);
      
      (again, manually post-processed to retain some comments)
      Reviewed-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      59ae1d12
  3. 06 7月, 2016 1 次提交
  4. 12 4月, 2016 1 次提交
  5. 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
  6. 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
  7. 08 4月, 2015 1 次提交
  8. 04 3月, 2015 1 次提交
  9. 15 12月, 2014 1 次提交
  10. 20 11月, 2014 1 次提交
  11. 25 6月, 2014 1 次提交
  12. 14 5月, 2014 3 次提交
  13. 09 1月, 2014 10 次提交
  14. 08 1月, 2014 1 次提交
  15. 27 12月, 2013 1 次提交
  16. 26 3月, 2013 1 次提交
  17. 12 2月, 2013 1 次提交
  18. 30 11月, 2012 1 次提交
  19. 31 7月, 2012 1 次提交
  20. 21 6月, 2012 3 次提交
  21. 12 4月, 2012 1 次提交
  22. 28 1月, 2012 2 次提交
  23. 04 10月, 2011 1 次提交
    • E
      mac80211: pass vif param to conf_tx() callback · 8a3a3c85
      Eliad Peller 提交于
      tx params should be configured per interface.
      add ieee80211_vif param to the conf_tx callback,
      and change all the drivers that use this callback.
      
      The following spatch was used:
      @rule1@
      struct ieee80211_ops ops;
      identifier conf_tx_op;
      @@
      	ops.conf_tx = conf_tx_op;
      
      @rule2@
      identifier rule1.conf_tx_op;
      identifier hw, queue, params;
      @@
      	conf_tx_op (
      -		struct ieee80211_hw *hw,
      +		struct ieee80211_hw *hw, struct ieee80211_vif *vif,
      		u16 queue,
      		const struct ieee80211_tx_queue_params *params) {...}
      Signed-off-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8a3a3c85
  24. 08 4月, 2011 2 次提交
    • J
      wl1251: Add support for idle mode · 1e5f52de
      Jarkko Nikula 提交于
      On Nokia N900 the wl1251 consumes the most power when the interface is up
      but not associated to access point (that supports PSM). In terms of battery
      current consumption, the consumption is ~180 mA higher when the interface is
      up but not associated and only ~5 mA higher when associated compared to
      interface down and driver not loaded cases.
      
      This patch adds support for the mac80211 idle notifications. Chip is put into
      idle very much the same way when entering into PSM by utilizing the Extreme
      Low Power (ELP) mode. I.e. idle is entered by setting necessary conditions
      in wl1251_ps_set_mode followed by a call to wl1251_ps_elp_sleep.
      
      It seems it is just enough the authorize ELP mode followed by
      CMD_DISCONNECT (thanks to Kalle Valo about the idea to use it).
      Without disconnect command the chip remains somewhat active and stays
      consuming ~20 mA. Idle mode is left by same way than PSM. The wl1251_join
      call is used to revert the CMD_DISCONNECT. Without it association to AP
      doesn't work when trying second time.
      
      With this patch the interface up but not associated case the battery current
      consumption is less than 1 mA higher compared to interface down case.
      Signed-off-by: NJarkko Nikula <jhnikula@gmail.com>
      Acked-by: NKalle Valo <kvalo@adurom.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1e5f52de
    • J
      wl1251: Prepare for idle mode support · a0bbb58b
      Jarkko Nikula 提交于
      RFC for WL1251 idle mode support brought a few issues that are worth to
      update before adding the idle mode support.
      
      Since the idle mode can reuse the code that is now used in Power Save Mode
      (PSM), the flag psm in struct wl1251 is changed to variable station_mode
      to be able to distinguish between PSM and idle modes.
      
      As the station mode is different than the power power save mode command
      that is sent to chip, the enum wl1251_cmd_ps_mod values are used only when
      communicating with the chip and new enum wl1251_station_mode values are used
      inside the driver.
      
      Confusing comment about psm and elp relation is removed since the PSM is
      actually activated by putting the chip into Entreme Low Power (ELP) mode.
      Signed-off-by: NJarkko Nikula <jhnikula@gmail.com>
      Acked-by: NKalle Valo <kvalo@adurom.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a0bbb58b
  25. 26 2月, 2011 1 次提交
    • J
      mac80211: make tx() operation return void · 7bb45683
      Johannes Berg 提交于
      The return value of the tx operation is commonly
      misused by drivers, leading to errors. All drivers
      will drop frames if they fail to TX the frame, and
      they must also properly manage the queues (if they
      didn't, mac80211 would already warn).
      
      Removing the ability for drivers to return a BUSY
      value also allows significant cleanups of the TX
      TX handling code in mac80211.
      
      Note that this also fixes a bug in ath9k_htc, the
      old "return -1" there was wrong.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Tested-by: Sedat Dilek <sedat.dilek@googlemail.com> [ath5k]
      Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> [rt2x00]
      Acked-by: Larry Finger <Larry.Finger@lwfinger.net> [b43, rtl8187, rtlwifi]
      Acked-by: Luciano Coelho <coelho@ti.com> [wl12xx]
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7bb45683