Commit Graph

1901 Commits

Author SHA1 Message Date
Nishka Dasgupta c6255d2d24 staging: rtl8188eu: Remove function rtw_os_indicate_scan_done()
In function rtw_indicate_scan_done, replace call to
rtw_os_indicate_scan_done with call to indicate_wx_scan_complete_event
as all that rtw_os_indicate_scan_done does is call
indicate_wx_scan_complete_event.
Remove now-unused function rtw_os_indicate_scan_done.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-4-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:14 +02:00
Nishka Dasgupta 01625b0bbb staging: rtl8188eu: Replace function beacon_timing_control()
Remove function beacon_timing_control as all it does is call
rtw_hal_bcn_related_reg_setting.
Rename rtw_hal_bcn_related_reg_setting to beacon_timing_control for
compatibility with call sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-3-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:14 +02:00
Nishka Dasgupta d6a496f937 staging: rtl8188eu: core: Remove function enable_rate_adaptive()
Remove function enable_rate_adaptive as it does nothing except call
Update_RA_Entry.
Modify call site of enable_rate_adaptive to call Update_RA_Entry
instead.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-2-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:14 +02:00
Nishka Dasgupta 6290da3e43 staging: rtl8188eu: core: Replace function Set_MSR()
Change reference to Set_NETYPE0_MSR to Set_MSR.
Replace the contents of Set_MSR with the contents of Set_NETYPE0_MSR as
Set_MSR does nothing but call Set_NETYPE0_MSR.
Delete Set_NETYPE0_MSR.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190712071746.2474-1-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:14 +02:00
Michael Straube 6c90bade52 staging: rtl8188eu: remove unused definitions from hal8188e_phy_reg.h
Remove unused definitions from the file hal8188e_phy_reg.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20190707165649.1558-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-22 07:34:13 +02:00
Hariprasad Kelam 690a993f10 staging/rtl8188eu/os_dep: Remove unneeded variable ret
Below list of functions returns 0 in success and -EINVAL in failure. So
directly return 0 on Success.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:07:03 +02:00
Nishka Dasgupta 01bc283e81 staging: rtl8188eu: Remove declarations of unused functions
Remove the declarations of the following unused functions from
rtw_eeprom.h:
- eeprom_write16
- eeprom_read16
- eeprom_read_sz
- read_eeprom_content
- read_eeprom_content_by_attrib.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:07:03 +02:00
Nishka Dasgupta c41ee96b3b staging: rtl8188eu: hal: Replace function ODM_TXPowerTrackingCheck()
Remove function ODM_TXPowerTrackingCheck as all it does is call
odm_TXPowerTrackingCheckCE.
Rename odm_TXPowerTrackingCheckCE to ODM_TXPowerTrackingCheck for
compatibility with call sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:07:03 +02:00
Nishka Dasgupta 2995c182f8 staging: rtl8188eu: hal: Replace function odm_TXPowerTrackingInit()
Remove function odm_TXPowerTrackingInit as all it does is call
odm_TXPowerTrackingThermalMeterInit.
Rename odm_TXPowerTrackingThermalMeterInit to odm_TXPowerTrackingInit
for compatibility with call sites.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:07:03 +02:00
Nishka Dasgupta 1f22b8f1bd staging: rtl8188eu: os_dep: Remove return variable
Remove return variable as its value is not altered between
initialisation and return.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 09:07:03 +02:00
Alexander Dahl 95392b0260 staging: rtl8188eu: Add 'rtl8188eufw.bin' to MODULE_FIRMWARE list
This is the file loaded by the code anyway, but now you can use
'modinfo' to determine the needed firmware file for this module.

Spotted when packaging firmware files for the fli4l Linux router
distribution, where a script uses the information from 'modinfo' to
collect all needed firmware files to package.

Cc: Christoph Schulz <mail@kristov.de>
Signed-off-by: Alexander Dahl <post@lespocky.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-07-01 08:58:21 +02:00
Michael Straube b107b94b3b staging: rtl8188eu: remove unused function is_ap_in_wep()
Function is_ap_in_wep() is not used in the driver code, so remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-26 09:50:52 +08:00
Michael Straube 65e307d7da staging: rtl8188eu: remove unused function get_bsstype()
Function get_bsstype() is not used in the driver code, so remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-26 09:50:51 +08:00
Michael Straube 6faeb50503 staging: rtl8188eu: remove hal_init_macaddr()
Function hal_init_macaddr() just calls rtw_hal_set_hwreg().
Use rtw_hal_set_hwreg() directly and remove hal_init_macaddr().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-26 09:50:51 +08:00
Michael Straube 08289a5604 staging: rtl8188eu: cleanup lines ending with a '('
Cleanup checkpatch issues in usb_halinit.c.
CHECK: Lines should not end with a '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-26 09:50:51 +08:00
Michael Straube c2e1e0f30b staging: rtl8188eu: remove unused code
Remove unused and/or commented code from rtw_wlan_util.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-20 14:45:04 +02:00
Nishka Dasgupta 232034b342 staging: rtl8188eu: Change type of rtw_get_sec_ie()
Change return type of function rtw_get_sec_ie from int to void and
remove its return statement as the return value is never stored, checked
or otherwise used.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-13 11:55:49 +02:00
Nishka Dasgupta 7a58b4abc7 staging: rtl8188eu: core: Replace function rtw_free_network_nolock()
Remove function rtw_free_network_nolock, as all it does is call
_rtw_free_network_nolock, and rename _rtw_free_network_nolock to
rtw_free_network_nolock.
Keep the new rtw_free_network_nolock a static function and remove the
old version from the header file.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-09 13:07:23 +02:00
Nishka Dasgupta ca039163d8 staging: rtl8188eu: core: Remove initialisation of return variable
Remove initialisation of return variable as it is never used.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-06 15:03:34 +02:00
Michael Straube 7acc77d208 staging: rtl8188eu: remove ODM_PhyStatusQuery() wrapper
Function ODM_PhyStatusQuery() is just a wrapper around
ODM_PhyStatusQuery_92CSeries(). Rename ODM_PhyStatusQuery_92CSeries()
to ODM_PhyStatusQuery() and remove the wrapper.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-03 14:19:33 +02:00
Michael Straube ee598a61ec staging: rtl8188eu: remove unused definitions from ieee80211.h
MGMT_QUEUE_NUM, ETH_TYPE_LEN and PAYLOAD_TYPE_LEN are defined but
not used in the driver code, so remove them.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-03 14:17:01 +02:00
Michael Straube 14f252e821 staging: rtl8188eu: remove redundant definition of ETH_ALEN
ETH_ALEN is defined in linux/if_ether.h which is included by
osdep_service.h, so remove the redundant definition from ieee80211.h.

osdep_service.h:33:#include <linux/etherdevice.h>
etherdevice.h:25:#include <linux/if_ether.h>

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-06-03 14:17:01 +02:00
Puranjay Mohan 67436a1ecc Staging: rtl8188eu: core: Use !x in place of NULL comparisons
Change (x == NULL) to !x and (x != NULL) to x, to fix
following checkpatch.pl warnings:
CHECK: Comparison to NULL could be written "!x".

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-22 14:32:40 +02:00
Puranjay Mohan fd078b4209 Staging: rtl8188eu: os_dep: Replace comparison with zero to !x
Change comparison to zero to !x.
Replace (x == 0) to !x.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-22 14:32:40 +02:00
Puranjay Mohan 7ccbc42a2b Staging: rtl8188eu: core: Remove else after break
Remove else after break statements to fix following checkpatch.pl
warnings:
WARNING: else is not generally useful after a break or return.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21 08:16:40 +02:00
Moses Christopher 7c6840b633 staging: rtl8188eu: use help instead of ---help--- in Kconfig
- Resolve the following warning from the Kconfig,
    "WARNING: prefer 'help' over '---help---' for new help texts"

Signed-off-by: Moses Christopher <moseschristopherb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-20 10:49:07 +02:00
Puranjay Mohan 8f3d9001dd Staging: rtl8188eu: os_dep: Use %s and __func__ in strings
Fix following checkpatch.pl warnings by using %s and __func__
in strings instead of function names.

WARNING: Prefer using '"%s...", __func__' to using 'rtw_report_sec_ie', this function's name, in a string
and other similar warning.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-20 07:40:43 +02:00
Linus Torvalds 80f232121b Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:
 "Highlights:

   1) Support AES128-CCM ciphers in kTLS, from Vakul Garg.

   2) Add fib_sync_mem to control the amount of dirty memory we allow to
      queue up between synchronize RCU calls, from David Ahern.

   3) Make flow classifier more lockless, from Vlad Buslov.

   4) Add PHY downshift support to aquantia driver, from Heiner
      Kallweit.

   5) Add SKB cache for TCP rx and tx, from Eric Dumazet. This reduces
      contention on SLAB spinlocks in heavy RPC workloads.

   6) Partial GSO offload support in XFRM, from Boris Pismenny.

   7) Add fast link down support to ethtool, from Heiner Kallweit.

   8) Use siphash for IP ID generator, from Eric Dumazet.

   9) Pull nexthops even further out from ipv4/ipv6 routes and FIB
      entries, from David Ahern.

  10) Move skb->xmit_more into a per-cpu variable, from Florian
      Westphal.

  11) Improve eBPF verifier speed and increase maximum program size,
      from Alexei Starovoitov.

  12) Eliminate per-bucket spinlocks in rhashtable, and instead use bit
      spinlocks. From Neil Brown.

  13) Allow tunneling with GUE encap in ipvs, from Jacky Hu.

  14) Improve link partner cap detection in generic PHY code, from
      Heiner Kallweit.

  15) Add layer 2 encap support to bpf_skb_adjust_room(), from Alan
      Maguire.

  16) Remove SKB list implementation assumptions in SCTP, your's truly.

  17) Various cleanups, optimizations, and simplifications in r8169
      driver. From Heiner Kallweit.

  18) Add memory accounting on TX and RX path of SCTP, from Xin Long.

  19) Switch PHY drivers over to use dynamic featue detection, from
      Heiner Kallweit.

  20) Support flow steering without masking in dpaa2-eth, from Ioana
      Ciocoi.

  21) Implement ndo_get_devlink_port in netdevsim driver, from Jiri
      Pirko.

  22) Increase the strict parsing of current and future netlink
      attributes, also export such policies to userspace. From Johannes
      Berg.

  23) Allow DSA tag drivers to be modular, from Andrew Lunn.

  24) Remove legacy DSA probing support, also from Andrew Lunn.

  25) Allow ll_temac driver to be used on non-x86 platforms, from Esben
      Haabendal.

  26) Add a generic tracepoint for TX queue timeouts to ease debugging,
      from Cong Wang.

  27) More indirect call optimizations, from Paolo Abeni"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1763 commits)
  cxgb4: Fix error path in cxgb4_init_module
  net: phy: improve pause mode reporting in phy_print_status
  dt-bindings: net: Fix a typo in the phy-mode list for ethernet bindings
  net: macb: Change interrupt and napi enable order in open
  net: ll_temac: Improve error message on error IRQ
  net/sched: remove block pointer from common offload structure
  net: ethernet: support of_get_mac_address new ERR_PTR error
  net: usb: smsc: fix warning reported by kbuild test robot
  staging: octeon-ethernet: Fix of_get_mac_address ERR_PTR check
  net: dsa: support of_get_mac_address new ERR_PTR error
  net: dsa: sja1105: Fix status initialization in sja1105_get_ethtool_stats
  vrf: sit mtu should not be updated when vrf netdev is the link
  net: dsa: Fix error cleanup path in dsa_init_module
  l2tp: Fix possible NULL pointer dereference
  taprio: add null check on sched_nest to avoid potential null pointer dereference
  net: mvpp2: cls: fix less than zero check on a u32 variable
  net_sched: sch_fq: handle non connected flows
  net_sched: sch_fq: do not assume EDT packets are ordered
  net: hns3: use devm_kcalloc when allocating desc_cb
  net: hns3: some cleanup for struct hns3_enet_ring
  ...
2019-05-07 22:03:58 -07:00
Greg Kroah-Hartman adc7af464c staging: rtlwifi: move remaining phydm .h files
The rtl8188eu driver uses the phydm .h files from the rtlwifi driver,
but now that the rtlwifi driver is gone, it's silly to have a whole
directory for just 2 .h files.  So move these files into the rtl8188eu
driver's directory so that it can be self-contained.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-01 10:40:10 +02:00
Michael Straube 06e8c289a2 staging: rtl8188eu: remove unnecessary parentheses
Remove unnecessary parentheses to improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25 12:06:56 +02:00
Michael Straube 58585aa8eb staging: rtl8188eu: add spaces around '-' in rtw_cmd.c
Add spaces around '-' to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25 12:06:56 +02:00
Michael Straube 74e226b302 staging: rtl8188eu: replace subtraction with result
Replace subtraction with the result to improve readability and
clear missing spaces around '-' checkpatch issues.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25 12:06:56 +02:00
Michael Straube 8e7f59e50d staging: rtl8188eu: add spaces around operators in rtw_ap.c
Add spaces around '+', '-' and '|' to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25 12:06:56 +02:00
Michael Straube 0f7741bb87 staging: rtl8188eu: cleanup indenting issue in odm.c
Cleanup indenting issue reported by checkpatch.
WARNING: suspect code indent for conditional statements (8, 17)

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25 12:04:48 +02:00
Michael Straube 307e07486a staging: rtl8188eu: make sta2sta_data_frame() static
Function sta2sta_data_frame() is only used in rtw_recv.c.
So make it static.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16 13:31:58 +02:00
Michael Straube 7e894d1086 staging: rtl8188eu: remove unnecessary declaration
The declaration of sta2sta_data_frame() is directly above
the function definition. Remove the unnecessary declaration.

This also clears a checkpatch issue.
CHECK: Lines should not end with a '('

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-16 13:31:58 +02:00
David S. Miller f83f715195 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Minor comment merge conflict in mlx5.

Staging driver has a fixup due to the skb->xmit_more changes
in 'net-next', but was removed in 'net'.

Signed-off-by: David S. Miller <davem@davemloft.net>
2019-04-05 14:14:19 -07:00
Greg Kroah-Hartman 99b75a4e32 staging: add missing SPDX lines to Kconfig files
There are a few remaining drivers/staging/*/Kconfig files that do not
have SPDX identifiers in them.  Add the correct GPL-2.0 identifier to
them to make scanning tools happy.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-03 11:10:15 +02:00
Sanjana Sanikommu d34709c64d staging: rtl8188eu: Modify return statement.
Challenge suggested by coccinelle.
Remove return variable and directly return the value
Issue found using ret.cocci

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-01 19:31:11 +02:00
Greg Kroah-Hartman b397f82585 Merge 5.1-rc3 into staging-next
We want those fixes and this resolves an erofs merge conflict.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-01 07:49:24 +02:00
Madhumitha Prabakaran f40c9e3d77 Staging: rtl8188eu: Get rid of custom macro, DBG_88E in kmalloc
Get rid of custom macro, DBG_88E for printing message in kmalloc
in order to maintain Linux kernel coding style based on which kernel
does not print failure warning.

Issue suggested by Coccinelle.

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-27 23:33:26 +09:00
Michael Straube d638e7eeda staging: rtl8188eu: cleanup long line in odm.c
Align a comment to clear a line over 80 characters
checkpatch warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-26 05:49:12 +09:00
Michael Straube 51385436f1 staging: rtl8188eu: remove unnecessary parentheses
Remove unnecessary parentheses in rtl8188eu_xmit.c.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-22 15:20:25 +01:00
Vatsala Narang e9e2d2e34f staging: rtl8188eu: core: Add spaces around operators
Add spaces around '+' operator to get rid of checkpatch warning.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21 20:01:43 +01:00
Vatsala Narang 72369b1b87 staging: rtl8188eu: core: Remove unnecessary parentheses
Remove unnecessary parentheses after 'address-of' operator
Issue found with checkpatch.pl

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21 20:01:43 +01:00
Sanjana Sanikommu 0049363c92 staging: rtl8188eu: core: rtw_mlme: Remove return variables.
The last two lines in the function could
be compressed into one. Avoid usage of local variable.
Issue found with Coccinelle using ret.cocci.

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21 20:01:42 +01:00
Aditya Pakki 7671ce0d92 staging: rtl8188eu: Fix potential NULL pointer dereference of kcalloc
hwxmits is allocated via kcalloc and not checked for failure before its
dereference. The patch fixes this problem by returning error upstream
in rtl8723bs, rtl8188eu.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Acked-by: Mukesh Ojha <mojha@codeaurora.org>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21 08:32:57 +01:00
Ivan Safonov 19c74ea577 staging: r8188eu: refactor recvframe_defrag()
Local variables pfhdr and prframe always have a same value,
so one of them is unnecessary.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21 08:25:01 +01:00
Sanjana Sanikommu 9e4f62f42c staging: rtl8188eu: core: rtw_recv.c: Modify return type suggested by Coccinelle.
The last two lines in the function could
be compressed into one. Avoid usage of local variable.

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-21 08:25:00 +01:00
Paolo Abeni a350eccee5 net: remove 'fallback' argument from dev->ndo_select_queue()
After the previous patch, all the callers of ndo_select_queue()
provide as a 'fallback' argument netdev_pick_tx.
The only exceptions are nested calls to ndo_select_queue(),
which pass down the 'fallback' available in the current scope
- still netdev_pick_tx.

We can drop such argument and replace fallback() invocation with
netdev_pick_tx(). This avoids an indirect call per xmit packet
in some scenarios (TCP syn, UDP unconnected, XDP generic, pktgen)
with device drivers implementing such ndo. It also clean the code
a bit.

Tested with ixgbe and CONFIG_FCOE=m

With pktgen using queue xmit:
threads		vanilla 	patched
		(kpps)		(kpps)
1		2334		2428
2		4166		4278
4		7895		8100

 v1 -> v2:
 - rebased after helper's name change

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-20 11:18:55 -07:00
Michael Straube ac22353f80 staging: rtl8188eu: remove unused WFD defines
All defined WFD* in wifi.h are unused in the driver code,
so remove them.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-20 10:43:50 +01:00
Michael Straube 7f2c439642 staging: rtl8188eu: remove unused defines from wifi.h
All defined P2P* in wifi.h are unused in the driver code,
so remove them.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-19 14:31:39 +01:00
Sanjana Sanikommu 758904ad61 Staging: rtl8188eu: rtw_ieee80211: Fix indent for 'if' statement.
Adjust indentation for the condition statement.
Issue found by checkpatch.pl

WARNING: suspect code indent for condition statements(8,24)

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18 21:06:57 +01:00
Sanjana Sanikommu d85be9b1f0 Staging: rtl8188eu: core: rtw_mlme.c: Replace NULL comparision.
Replace NULL comparison with '!' in the file rtw_mlme.c
Issue found by checkpatch.pl semantic patch results for rtw_mlme.c

CHECK:Comparision to NULL could be written "!candidate"

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18 18:53:17 +01:00
Sanjana Sanikommu 7af9181020 Staging: rtl8188eu: core: rtw_pwrctrl.c: Fix a comparision warning.
Move the constant to the right side of comparision.
Issue found by checkpatch.pl semantic patch results for rtw_ap.c

WARNING:Comparision should place the constant on the right side of the
test.

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18 18:53:16 +01:00
Sanjana Sanikommu a02da43c81 staging: rtl8188eu: core: rtw_recv.c: Fix a tab indent issue
Fix a tab indent issue which removed warnings after compilation using
checkpatch.pl.

[WARNING]:No extra space at the beginning of a line.

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18 07:50:16 +01:00
Sanjana Sanikommu 5c4f225918 staging: rtl8188eu: core: rtw_recv.c: fix a paranthesis issue around pframe -> list in rtw_recv.c
Remove unnecessary parathesis issue around '->' .
Issue found by checkpatch.pl semantic patch results for
rtw_recv.c

CHECK: Remove unnecessary paranthesis around pframe -> list

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18 07:50:13 +01:00
Sanjana Sanikommu 0842eabb6f staging: rtl8188eu: core: rtw_recv.c: fix a space issue
Fix a space issue around the below operators mentioned in CHECK.
Issue found by checkpatch.pl semantic patch results for
rtw_recv.c..

CHECK: spaces preferred around '%' (ctx:VxV)
CHECK: spaces preferred around '&' (ctx:VxV)
CHECK: spaces preferred around '+' (ctx:VxV)
CHECK: spaces preferred around '<<' (ctx:VxV)

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18 07:50:11 +01:00
Sanjana Sanikommu 42f56fef67 staging: rtl8188eu: core: rtw_ap.c: Fix multiple blank lines
Remove multiple blank lines.
Issue found by checkpatch.pl semantic patch results for rtw_ap.c

CHECK: Please dont use multiple blank lines.

Signed-off-by: Sanjana Sanikommu <sanjana99reddy99@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18 07:47:53 +01:00
Hugo Lange df9ce52c8a staging: rtl8188eu: remove unnecessary braces from if/else
Removed unnecessary braces for single blocks.

Signed-off-by: Hugo Lange <hugolange7000@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18 07:06:08 +01:00
Robert Eshleman 173e3e69b2 staging: rtl8188eu: cleanup spacing style
This patch fixes a few spacing warnings from checkpatch.pl,
as well as an incorrect spacing between a function type and
the function name.

Signed-off-by: Robert Eshleman <bobbyeshleman@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-18 07:05:21 +01:00
Michael Straube 9f22637b00 staging: rtl8188eu: remove unused P2P_PRIVATE_IOCTL_SET_LEN
Defined P2P_PRIVATE_IOCTL_SET_LEN is not used in the driver code,
so remove it from wifi.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-28 08:45:28 +01:00
Michael Straube c329a8fd58 staging: rtl8188eu: remove unused enum P2P_PROTO_WK_ID
Enumeration P2P_PROTO_WK_ID is not used in the driver code,
so remove it from wifi.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-28 08:45:28 +01:00
Michael Straube 2c62d36c81 staging: rtl8188eu: cleanup comparsions to NULL in rtl8188eu_xmit.c
Use !x instead of x == NULL. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26 11:52:46 +01:00
Michael Straube 423c16f4bf staging: rtl8188eu: add spaces around '*' in rtl8188e_cmd.c
Add spaces around '*' to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26 11:52:46 +01:00
Michael Straube 5241d965b4 staging: rtl8188eu: remove unused function declarations
There are no definitions of odm_DIGbyRSSI_LPS(), ODM_PhyStatusQuery()
and ODM_MacStatusQuery() in the driver code. So remove the unused
declarations from the headers odm.h and odm_hwconfig.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26 11:52:46 +01:00
Michael Straube 87dd57588a staging: rtl8188eu: remove blank line between declarations
Remove unnecessary blank line between declarations.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26 11:52:46 +01:00
Michael Straube 0143802620 staging: rtl8188eu: cleanup declarations in rtl8188e_cmd.c
Replace tabs with spaces in declarations to cleanup whitespace.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26 11:52:46 +01:00
Michael Straube 00fa3661a4 staging: rtl8188eu: remove unnecessary parentheses in rtl8188e_cmd.c
Remove unnecessary parentheses reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26 11:52:46 +01:00
Stephen Martin 8126c7c188 staging: rtl8188eu: fix bad indentation for conditional statement
Fixed else block indentation

Signed-off-by: Stephen Martin <lockwood@opperline.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-19 11:14:14 +01:00
Michael Straube da17ad1e6f staging: rtl8188eu: cleanup ODM_CmnInfoPtrArrayHook()
Convert single case switch to if statement to cleanup and
simplify code in ODM_CmnInfoPtrArrayHook().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-04 12:36:14 +01:00
Michael Straube 1c516c54ac staging: rtl8188eu: refactor rtw_reset_securitypriv()
Move the declaration of 'psec_priv' out of the else path and use it
in the if path as well to improve readability. Also clears line over
80 characters checkpatch warnings.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-30 15:40:58 +01:00
Michael Straube 46c36e5a03 staging: rtl8188eu: &array[0] -> array
Change '&array[0]' to just 'array' in rtw_reset_securitypriv().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-30 15:40:58 +01:00
Michael Straube d8e2a9a58e staging: rtl8188eu: remove unncessary asignment to cleanup long line
Instead of first asign 'wrqu.data.length = p - buff' use 'p - buff'
directly in min_t() in the subsequent asignment. Clears a line over
80 characters checkpatch warning.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-30 15:40:58 +01:00
Michael Straube 0a6286668b staging: rtl8188eu: cleanup declarations in mlme_linux.c
Replace tabs with spaces in declarations to cleanup whitespace.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-30 15:40:58 +01:00
Michael Straube b543e1fdd1 staging: rtl8188eu: remove unnecessary initializations
The local variables backup_index, backup_counter and backup_time
in rtw_reset_securitypriv() are all asigned before their uses, so
initialization to zero is not necessary.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-30 15:40:58 +01:00
Michael Straube 48a254d7ff staging: rtl8188eu: cleanup comments in mlme_linux.c
Cleanup comments to avoid lines over 80 characters
and follow kernel style for block comments.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-30 15:40:58 +01:00
Greg Kroah-Hartman d61b5d546a Merge 5.0-rc4 into staging-next
We need the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-28 08:17:02 +01:00
Stephen Martin 3060da7a19 staging: rtw_ieee80211: fix constant comparison warning
Fixed comparison on right side of test warnings.

Signed-off-by: Stephen Martin <lockwood@opperline.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-25 09:52:01 +01:00
Michael Straube 01f7e722aa staging: rtl8188eu: cleanup indenting issue in mlme_linux.c
Cleanup indenting issue reported by checkpatch.
CHECK: Alignment should match open parenthesis

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18 10:34:01 +01:00
Michael Straube 6e3da68c7f staging: rtl8188eu: add spaces around operators in mlme_linux.c
Add spaces around '+' and '-' to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18 10:34:01 +01:00
Michael Straube 9435bbd4b9 staging: rtl8188eu: add spaces around operators in os_intfs.c
Add spaces around '+', '<<' and '*' to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18 10:34:01 +01:00
Michael Straube 58d37ddf75 staging: rtl8188eu: cleanup declarations in os_intfs.c
Replace tabs with spaces and/or remove extra spaces in declarations.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18 10:34:01 +01:00
Florian Büstgens 82f1cebe64 staging: rtl8188eu: Refactoring struct ndis_802_11_ssid from CamelCase to correct code style.
rtl8188eu uses CamelCase for many struct members.
Refactors the ndis_802_11_ssid members Ssid and SsidLength to keep correct code style.
Issue found by checkpatch.

Signed-off-by: Florian Büstgens <flbue@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15 17:31:52 +01:00
Michael Straube 5f74a8cbb3 staging: rtl8188eu: Add device code for D-Link DWA-121 rev B1
This device was added to the stand-alone driver on github.
Add it to the staging driver as well.

Link: https://github.com/lwfinger/rtl8188eu/commit/a0619a07cd1e
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15 16:31:09 +01:00
Michael Straube e94e6d1454 staging: rtl8188eu: remove unnecessary parentheses in os_intfs.c
Remove unnecessary parentheses reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15 16:19:32 +01:00
Gustavo A. R. Silva 891fd84760 staging: rtl8188eu: Replace kzalloc with kcalloc
Replace kzalloc() function with its 2-factor argument form, kcalloc().

This patch replaces cases of:

	kzalloc(a * b, gfp)

with:
	kcalloc(a, b, gfp)

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15 16:08:04 +01:00
Larry Finger 7775665aad staging: rtl8188eu: Fix module loading from tasklet for WEP encryption
Commit 2b2ea09e74 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames")
causes scheduling while atomic bugs followed by a hard freeze whenever
the driver tries to connect to a WEP-encrypted network. Experimentation
showed that the freezes were eliminated when module lib80211 was
preloaded, which can be forced by calling lib80211_get_crypto_ops()
directly rather than indirectly through try_then_request_module().
With this change, no BUG messages are logged.

Fixes: 2b2ea09e74 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames")
Cc: Stable <stable@vger.kernel.org> # v4.17+
Cc: Michael Straube <straube.linux@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-07 15:27:59 +01:00
Larry Finger 84cad97a71 staging: rtl8188eu: Fix module loading from tasklet for CCMP encryption
Commit 6bd082af7e ("staging:r8188eu: use lib80211 CCMP decrypt")
causes scheduling while atomic bugs followed by a hard freeze whenever
the driver tries to connect to a CCMP-encrypted network. Experimentation
showed that the freezes were eliminated when module lib80211 was
preloaded, which can be forced by calling lib80211_get_crypto_ops()
directly rather than indirectly through try_then_request_module().
With this change, no BUG messages are logged.

Fixes: 6bd082af7e ("staging:r8188eu: use lib80211 CCMP decrypt")
Cc: Stable <stable@vger.kernel.org> # v4.17+
Reported-and-tested-by: Michael Straube <straube.linux@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-07 15:27:59 +01:00
Michael Straube 0fe6dc4d68 staging: rtl8188eu: cleanup brace coding style issues
Cleanup brace coding style issues reported by checkpatch.

ERROR: space required before the open brace '{'
WARNING: braces {} are not necessary for single statement blocks
CHECK: Unbalanced braces around else statement

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 241e15dbfc staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.c
Add spaces around '&' to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube e54a823e90 staging: rtl8188eu: change return type of is_basicrate() to bool
The function is_basicrate() returns true or false, so change the
return type from int to bool.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 79ebad324b staging: rtl8188eu: simplify null array initializations
Simplfy initialization of null arrays to improve readability
and save some lines.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube b7d54304d9 staging: rtl8188eu: change order of declarations to improve readability
Change the order of array declarations in rtw_mlme_ext.c to improve
readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 7a6394398f staging: rtl8188eu: make some arrays static in rtw_mlme_ext.c
Make some arrays that are only used in rtw_mlme_ext.c static and
remove the corresponding extern declarations from rtw_mlme_ext.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 03449acb77 staging: rtl8188eu: constify some arrays
The values of these arrays in rtw_mlme_ext.c and rtw_wlan_util.c
are never changed, so make them const.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 0ef9f86b93 staging: rtl8188eu: convert unsigned char arrays to u8
Change the type of some arrays from unsigned char to u8.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 55fc57809a staging: rtl8188eu: remove redundant declaration in rtw_mlme_ext.c
The array REALTEK_96B_IE is already declared in rtw_mlme.h,
so remove the declaration in rtw_mlme_ext.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 4f1a961ae1 staging: rtl8188eu: remove unused arrays WFD_OUI and WMM_INFO_OUI
The arrays WFD_OUI and WMM_INFO_OUI are not used anywhere,
so remove them.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 25c641ec2a staging: rtl8188eu: remove unnecessary parentheses in rtw_mlme_ext.c
Remove unnecessary parentheses, most of them reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:30:29 +01:00