1. 15 9月, 2016 1 次提交
    • J
      rtlwifi: rtl818x: constify local structures · d86e6476
      Julia Lawall 提交于
      For structure types defined in the same file or local header files, find
      top-level static structure declarations that have the following
      properties:
      1. Never reassigned.
      2. Address never taken
      3. Not passed to a top-level macro call
      4. No pointer or array-typed field passed to a function or stored in a
      variable.
      Declare structures having all of these properties as const.
      
      Done using Coccinelle.
      Based on a suggestion by Joe Perches <joe@perches.com>.
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      d86e6476
  2. 04 9月, 2016 4 次提交
  3. 03 9月, 2016 1 次提交
  4. 14 8月, 2016 1 次提交
  5. 20 7月, 2016 1 次提交
  6. 08 7月, 2016 13 次提交
  7. 05 7月, 2016 6 次提交
  8. 29 6月, 2016 1 次提交
    • A
      rtlwifi: use s8 instead of char · 08aba42f
      Arnd Bergmann 提交于
      Compiling the rtlwifi drivers for ARM with gcc -Wextra warns about lots of
      incorrect code that results from 'char' being unsigned here, e.g.
      
      realtek/rtlwifi/rc.c:113:18: error: comparison is always true due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8188ee/dm.c:1070:22: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8192ce/trx.c:54:16: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8192cu/mac.c:601:16: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8192de/trx.c:53:16: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8192ee/phy.c:1268:12: error: comparison is always true due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8192se/rf.c:150:20: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8723be/dm.c:877:29: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8723be/phy.c:386:16: error: comparison is always true due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8821ae/dm.c:1514:38: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8821ae/phy.c:1558:11: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8821ae/phy.c:386:24: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/rtl8821ae/trx.c:55:12: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      realtek/rtlwifi/stats.c:31:16: error: comparison is always false due to limited range of data type [-Werror=type-limits]
      
      This patch changes all uses of 'char' in this driver that refer to
      8-bit integers to use 's8' instead, which is signed on all architectures.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      08aba42f
  9. 16 6月, 2016 1 次提交
    • A
      rtlwifi: fix error handling in *_read_adapter_info() · 5345ea6a
      Arnd Bergmann 提交于
      There are nine copies of the _rtl88ee_read_adapter_info() function,
      and most but not all of them cause a build warning in some configurations:
      
      rtl8192de/hw.c: In function '_rtl92de_read_adapter_info':
      rtl8192de/hw.c:1767:12: error: 'hwinfo' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      rtl8723ae/hw.c: In function '_rtl8723e_read_adapter_info.constprop':
      rtlwifi/rtl8723ae/hw.c:1654:12: error: 'hwinfo' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      The problem is that when rtlefuse->epromtype is something other than
      EEPROM_BOOT_EFUSE, the rest of the function uses undefined data, resulting
      in random behavior later.
      
      Apparently, in some drivers, the problem was already found and fixed
      but the fix did not make it into the others.
      
      This picks one approach to deal with the problem and applies identical
      code to all 9 files, to simplify the later consolidation of those.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      5345ea6a
  10. 14 6月, 2016 2 次提交
  11. 28 5月, 2016 1 次提交
    • L
      rtlwifi: Fix scheduling while atomic error from commit 49f86ec2 · de26859d
      Larry Finger 提交于
      Commit 49f86ec2 ("rtlwifi: Change long delays to sleeps") was correct
      for most cases; however, driver rtl8192ce calls the affected routines while
      in atomic context. The kernel bug output is as follows:
      
      BUG: scheduling while atomic: wpa_supplicant/627/0x00000002
      [...]
        [<ffffffff815c2b39>] __schedule+0x899/0xad0
        [<ffffffff815c2dac>] schedule+0x3c/0x90
        [<ffffffff815c5bb2>] schedule_hrtimeout_range_clock+0xa2/0x120
        [<ffffffff810e8b80>] ? hrtimer_init+0x120/0x120
        [<ffffffff815c5ba6>] ? schedule_hrtimeout_range_clock+0x96/0x120
        [<ffffffff815c5c43>] schedule_hrtimeout_range+0x13/0x20
        [<ffffffff815c568f>] usleep_range+0x4f/0x70
        [<ffffffffa0667218>] rtl_rfreg_delay+0x38/0x50 [rtlwifi]
        [<ffffffffa06dd0e7>] rtl92c_phy_config_rf_with_headerfile+0xc7/0xe0 [rtl8192ce]
      
      To fix this bug, three of the changes from delay to sleep are reverted.
      Unfortunately, one of the changes involves a delay of 50 msec. The calling
      code will be modified so that this long delay can be avoided; however,
      this change is being pushed now to fix the problem in kernel 4.6.0.
      
      Fixes: 49f86ec2 ("rtlwifi: Change long delays to sleeps")
      Reported-by: NJames Feeney <james@nurealm.net>
      Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Cc: James Feeney <james@nurealm.net>
      Cc: Stable <stable@vger.kernel.org> [4.6+]
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      de26859d
  12. 12 5月, 2016 5 次提交
    • W
      rtlwifi: pci: use dev_kfree_skb_irq instead of kfree_skb in rtl_pci_reset_trx_ring · cf968937
      wang yanqing 提交于
      We can't use kfree_skb in irq disable context, because spin_lock_irqsave
      make sure we are always in irq disable context, use dev_kfree_skb_irq
      instead of kfree_skb is better than dev_kfree_skb_any.
      
      This patch fix below kernel warning:
      [ 7612.095528] ------------[ cut here ]------------
      [ 7612.095546] WARNING: CPU: 3 PID: 4460 at kernel/softirq.c:150 __local_bh_enable_ip+0x58/0x80()
      [ 7612.095550] Modules linked in: rtl8723be x86_pkg_temp_thermal btcoexist rtl_pci rtlwifi rtl8723_common
      [ 7612.095567] CPU: 3 PID: 4460 Comm: ifconfig Tainted: G        W       4.4.0+ #4
      [ 7612.095570] Hardware name: LENOVO 20DFA04FCD/20DFA04FCD, BIOS J5ET48WW (1.19 ) 08/27/2015
      [ 7612.095574]  00000000 00000000 da37fc70 c12ce7c5 00000000 da37fca0 c104cc59 c19d4454
      [ 7612.095584]  00000003 0000116c c19d4784 00000096 c10508a8 c10508a8 00000200 c1b42400
      [ 7612.095594]  f29be780 da37fcb0 c104ccad 00000009 00000000 da37fcbc c10508a8 f21f08b8
      [ 7612.095604] Call Trace:
      [ 7612.095614]  [<c12ce7c5>] dump_stack+0x41/0x5c
      [ 7612.095620]  [<c104cc59>] warn_slowpath_common+0x89/0xc0
      [ 7612.095628]  [<c10508a8>] ? __local_bh_enable_ip+0x58/0x80
      [ 7612.095634]  [<c10508a8>] ? __local_bh_enable_ip+0x58/0x80
      [ 7612.095640]  [<c104ccad>] warn_slowpath_null+0x1d/0x20
      [ 7612.095646]  [<c10508a8>] __local_bh_enable_ip+0x58/0x80
      [ 7612.095653]  [<c16b7d34>] destroy_conntrack+0x64/0xa0
      [ 7612.095660]  [<c16b300f>] nf_conntrack_destroy+0xf/0x20
      [ 7612.095665]  [<c1677565>] skb_release_head_state+0x55/0xa0
      [ 7612.095670]  [<c16775bb>] skb_release_all+0xb/0x20
      [ 7612.095674]  [<c167760b>] __kfree_skb+0xb/0x60
      [ 7612.095679]  [<c16776f0>] kfree_skb+0x30/0x70
      [ 7612.095686]  [<f81b869d>] ? rtl_pci_reset_trx_ring+0x22d/0x370 [rtl_pci]
      [ 7612.095692]  [<f81b869d>] rtl_pci_reset_trx_ring+0x22d/0x370 [rtl_pci]
      [ 7612.095698]  [<f81b87f9>] rtl_pci_start+0x19/0x190 [rtl_pci]
      [ 7612.095705]  [<f81970e6>] rtl_op_start+0x56/0x90 [rtlwifi]
      [ 7612.095712]  [<c17e3f16>] drv_start+0x36/0xc0
      [ 7612.095717]  [<c17f5ab3>] ieee80211_do_open+0x2d3/0x890
      [ 7612.095725]  [<c16820fe>] ? call_netdevice_notifiers_info+0x2e/0x60
      [ 7612.095730]  [<c17f60bd>] ieee80211_open+0x4d/0x50
      [ 7612.095736]  [<c16891b3>] __dev_open+0xa3/0x130
      [ 7612.095742]  [<c183fa53>] ? _raw_spin_unlock_bh+0x13/0x20
      [ 7612.095748]  [<c1689499>] __dev_change_flags+0x89/0x140
      [ 7612.095753]  [<c127c70d>] ? selinux_capable+0xd/0x10
      [ 7612.095759]  [<c1689589>] dev_change_flags+0x29/0x60
      [ 7612.095765]  [<c1700b93>] devinet_ioctl+0x553/0x670
      [ 7612.095772]  [<c12db758>] ? _copy_to_user+0x28/0x40
      [ 7612.095777]  [<c17018b5>] inet_ioctl+0x85/0xb0
      [ 7612.095783]  [<c166e647>] sock_ioctl+0x67/0x260
      [ 7612.095788]  [<c166e5e0>] ? sock_fasync+0x80/0x80
      [ 7612.095795]  [<c115c99b>] do_vfs_ioctl+0x6b/0x550
      [ 7612.095800]  [<c127c812>] ? selinux_file_ioctl+0x102/0x1e0
      [ 7612.095807]  [<c10a8914>] ? timekeeping_suspend+0x294/0x320
      [ 7612.095813]  [<c10a256a>] ? __hrtimer_run_queues+0x14a/0x210
      [ 7612.095820]  [<c1276e24>] ? security_file_ioctl+0x34/0x50
      [ 7612.095827]  [<c115cef0>] SyS_ioctl+0x70/0x80
      [ 7612.095832]  [<c1001804>] do_fast_syscall_32+0x84/0x120
      [ 7612.095839]  [<c183ff91>] sysenter_past_esp+0x36/0x55
      [ 7612.095844] ---[ end trace 97e9c637a20e8348 ]---
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      Cc: Stable <stable@vger.kernel.org>
      Acked-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      cf968937
    • W
      rtlwifi: Remove double check for cnt_after_linked · 976aff5f
      wang yanqing 提交于
      rtl_lps_enter does two successive check for cnt_after_linked
      to make sure some time has elapsed after linked. The second
      check isn't necessary, because if cnt_after_linked is bigger
      than 5, it is bigger than 2 of course!
      
      This patch remove the second check code.
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      976aff5f
    • D
      rtlwifi: rtl818x: silence uninitialized variable warning · 2f8514b8
      Dan Carpenter 提交于
      What about if "rtlphy->pwrgroup_cnt" is 2?  In that case we would use an
      uninitialized "chnlgroup" variable and probably crash.  Maybe that can't
      happen for some reason which is not obvious but in that case this patch
      is harmless.
      
      Setting it to zero seems like a standard default in the surrounding code
      so it's probably fine here as well.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      2f8514b8
    • W
      rtlwifi: Fix logic error in enter/exit power-save mode · 873ffe15
      wang yanqing 提交于
      In commit a269913c ("rtlwifi: Rework rtl_lps_leave() and
      rtl_lps_enter() to use work queue"), the tests for enter/exit
      power-save mode were inverted. With this change applied, the
      wifi connection becomes much more stable.
      
      Fixes: a269913c ("rtlwifi: Rework rtl_lps_leave() and rtl_lps_enter() to use work queue")
      Signed-off-by: NWang YanQing <udknight@gmail.com>
      CC: Stable <stable@vger.kernel.org> [3.10+]
      Acked-by: NLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      873ffe15
    • J
      rtlwifi: rtl818x: constify rtl_intf_ops structures · 1bfcfdcc
      Julia Lawall 提交于
      The rtl_intf_ops structures are never modified, so declare them as const.
      
      Done with the help of Coccinelle.
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      1bfcfdcc
  13. 26 4月, 2016 1 次提交
  14. 18 4月, 2016 1 次提交
  15. 12 4月, 2016 1 次提交