Commit Graph

285 Commits

Author SHA1 Message Date
Arnd Bergmann aa3233ea7b staging: r8188eu: fix -Wrestrict warnings
Adding back the nonstandard ioctl commands caused -Wrestrict warnings
when building with 'make W=1':

drivers/staging/r8188eu/os_dep/ioctl_linux.c: In function 'rtw_mp_read_rf':
drivers/staging/r8188eu/os_dep/ioctl_linux.c:5515:27: error: 'sprintf' argument 3 overlaps destination object 'extra' [-Werror=restrict]
 5515 |                           sprintf(extra, "%s %d", extra, strtou);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/r8188eu/os_dep/ioctl_linux.c:5470:54: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
 5470 |                         struct iw_point *wrqu, char *extra)
      |                                                ~~~~~~^~~~~

Change these to the same construct used elsewhere in that driver,
with an offset to the string to make the warning go away.

The ioctl commands were previously removed, and it's unlikely that
anything is actually using them, so ideally I would prefer to have
them removed again.

The lack of range checking of the 'extra' output buffer is also
slightly worrying, but I did not check whether this could cause
harm.

Fixes: 2b42bd58b3 ("staging: r8188eu: introduce new os_dep dir for RTL8188eu driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210920095525.1150678-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-20 12:33:22 +02:00
Linus Torvalds ebf435d3b5 IIO / Staging driver update for 5.15-rc1
Here is the big set of staging and IIO driver updates for 5.15-rc1.
 Also included in here are the counter driver subsystem updates as the
 IIO drivers needed them.
 
 Lots of churn in some staging drivers, we dropped the "old" rtl8188eu
 driver and replaced it with a newer version of the driver that had been
 maintained out-of-tree by Larry with the end goal of actually being able
 to get this driver out of staging eventually.  Despite that driver being
 "newer" the line count of this pull request is going up.
 
 Some drivers moved out of staging as well, which is always nice to see,
 that is why there are additions to the mfc and misc driver subsystems.
 All of these were acked by the various subsystem maintainers involved.
 
 But by far, as normal, it's coding style cleanups all over the
 drivers/staging/ tree in here.
 
 Full details of these changes are in the shortlog.
 
 All of these have been in linux-next for a while with no reported
 problems.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYS+BKg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+yku5gCgyMykJ2mwtEiQxfAWu13e2iZX29AAnjk38ANp
 Un2sQXYnL9RVlcnjLg+X
 =jMWL
 -----END PGP SIGNATURE-----

Merge tag 'staging-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull IIO and staging driver updates from Greg KH:
 "Here is the big set of staging and IIO driver updates for 5.15-rc1.
  Also included in here are the counter driver subsystem updates as the
  IIO drivers needed them.

  Lots of churn in some staging drivers, we dropped the "old" rtl8188eu
  driver and replaced it with a newer version of the driver that had
  been maintained out-of-tree by Larry with the end goal of actually
  being able to get this driver out of staging eventually. Despite that
  driver being "newer" the line count of this pull request is going up.

  Some drivers moved out of staging as well, which is always nice to
  see, that is why there are additions to the mfc and misc driver
  subsystems. All of these were acked by the various subsystem
  maintainers involved.

  But by far, as normal, it's coding style cleanups all over the
  drivers/staging/ tree in here.

  Full details of these changes are in the shortlog.

  All of these have been in linux-next for a while with no reported
  problems"

[ Note: the r8188eu merge clashed with commit 89939e8906 ("staging:
  rtlwifi: use siocdevprivate") from the networking tree. When resolving
  the issue, I noted that the whole r8188eu rtw_android code is dead
  since commit ae7471cae0 ("staging: r8188eu: remove rtw_ioctl
  function").

  End result: the merge resolution was to throw all of that away,
  rather than do the mindless fixup to code that isn't actually
  reachable                                               - Linus ]

* tag 'staging-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (551 commits)
  staging: vt6655: Remove filenames in files
  staging: r8188eu: add extra TODO entries
  staging: vt6656: Remove filenames in files
  staging: wlan-ng: fix invalid assignment warning
  staging: r8188eu: rename fields of struct rtl_ps
  staging: r8188eu: remove ODM_DynamicPrimaryCCA_DupRTS()
  staging: r8188eu: rename fields of struct dyn_primary_cca
  staging: r8188eu: rename struct field Wifi_Error_Status
  staging: r8188eu: Provide a TODO file for this driver
  staging: r8188eu: remove unneeded variable
  staging: r8188eu: remove unneeded conversions to bool
  staging: r8188eu: remove {read,write}_macreg
  staging: r8188eu: core: remove condition with no effect
  staging: r8188eu: remove ethernet.h header file
  staging: r8188eu: remove ip.h header file
  staging: r8188eu: remove if_ether.h header file
  staging: r8188eu: make rtw_deinit_intf_priv return void
  staging: r8188eu: use is_multicast_ether_addr in os_dep/recv_linux.c
  staging: r8188eu: use is_multicast_ether_addr in hal/rtl8188eu_xmit.c
  staging: r8188eu: use is_multicast_ether_addr in core/rtw_xmit.c
  ...
2021-09-01 09:45:57 -07:00
Phillip Potter 6506cd9f3a staging: r8188eu: add extra TODO entries
Add entry for CFG80211 to reflect that it is currently being worked on
and is a desirable feature to have for this driver. Leave entries for
LIB80211 and MAC80211 in case anyone else wishes to work on them - they
can always be removed later, but MAC80211 in particular would certainly
be good to aim for. Also, include an entry for improving error handling,
as this is another goal of the cleanup effort.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210828000231.1458-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-28 08:33:42 +02:00
Michael Straube f6bc526acc staging: r8188eu: rename fields of struct rtl_ps
Rename fields of struct rtl_ps to avoid camel case.

PreCCAState -> pre_cca_state
CurCCAState -> cur_cca_state

PreRFState -> pre_rf_state
CurRFState -> cur_rf_state

Rssi_val_min -> rssi_val_min

Reg874 -> reg_874
RegC70 -> reg_c70
Reg85C -> reg_85c
RegA74 -> reg_a74

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210827094144.13290-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-27 16:16:20 +02:00
Michael Straube 9f801ac94d staging: r8188eu: remove ODM_DynamicPrimaryCCA_DupRTS()
Function ODM_DynamicPrimaryCCA_DupRTS() is unused, remove it.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210827094144.13290-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-27 16:16:19 +02:00
Michael Straube 9f30a2312c staging: r8188eu: rename fields of struct dyn_primary_cca
Rename fields of struct dyn_primary_cca to avoid camel case.
PriCCA_flag -> pri_cca_flag
DupRTS_flag -> dup_rts_flag
Monitor_flag -> monitor_flag

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210827094144.13290-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-27 16:16:19 +02:00
Michael Straube a01b0006de staging: r8188eu: rename struct field Wifi_Error_Status
Rename struct field Wifi_Error_Status to avoid camel case.

Wifi_Error_Status -> wifi_error_status

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210827094144.13290-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-27 16:16:19 +02:00
Fabio M. De Francesco 71419e03d8 staging: r8188eu: Provide a TODO file for this driver
Provide a TODO file that lists the tasks that should be carried out in
order to move this driver off drivers/staging.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210827100813.18610-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-27 16:16:11 +02:00
Jing Yangyang 7990b535d2 staging: r8188eu: remove unneeded variable
Eliminate the following coccicheck warning:
./drivers/staging/r8188eu/os_dep/os_intfs.c:505:6-12:
 Unneeded variable "status". Return "_SUCCESS" on line 577
./drivers/staging/r8188eu/os_dep/os_intfs.c:772: 4-7:
  Unneeded variable "ret". Return "_SUCCESS" on line 818
./drivers/staging/r8188eu/os_dep/os_intfs.c:823:4-8:
Unneeded variable "ret8". Return "_SUCCESS" on line 849

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
Link: https://lore.kernel.org/r/20210825061531.69678-1-deng.changcheng@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-27 10:39:00 +02:00
Jing Yangyang 62dbd849e0 staging: r8188eu: remove unneeded conversions to bool
Found with scripts/coccinelle/misc/boolconv.cocci.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Reviewed-by: Pavel Skripkin <paskripkin@gmail.com>
Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>
Link: https://lore.kernel.org/r/20210824063443.59724-1-deng.changcheng@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-27 10:38:40 +02:00
Pavel Skripkin ce6a700704 staging: r8188eu: remove {read,write}_macreg
These 2 functions are unused, so they can be simply removed

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/d591e29d77da73790c71f7a8e508a8b16fd48f65.1629789580.git.paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:39:36 +02:00
Saurav Girepunje 3f60c32f15 staging: r8188eu: core: remove condition with no effect
Remove the condition with no effect (if == else) in rtw_led.c
file.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YSFgrLUfXzgcT6k4@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:33:24 +02:00
Michael Straube f7766f1b00 staging: r8188eu: remove ethernet.h header file
There are only two definitions from ethernet.h used in the driver.
Namely:

#define ETHERNET_HEADER_SIZE           14      /*  Ethernet Header Length */
#define LLC_HEADER_SIZE                6       /*  LLC Header Length */

Both are only used in the file core/rtw_recv.c. Replace the usage of
ETHERNET_HEADER_SIZE with ETH_HLEN, move the definition of LLC_HEADER_SIZE
into rtw_recv.h and remove the now unused ethernet.h header file.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210824123621.10801-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:29:05 +02:00
Michael Straube f09dc911bd staging: r8188eu: remove ip.h header file
The struct ip_options declared in ip.h is only unsed in the optlength
macro which is also defined in ip.h and not used in the driver code.
All other definitions/declarations in ip.h are duplicated from
<include/uapi/linux/ip.h>. Remove the ip.h header file and its includes.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210824123621.10801-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:29:05 +02:00
Michael Straube 68ad97bc5a staging: r8188eu: remove if_ether.h header file
All constants, declarations and macros in if_ether.h are either
duplicated from <uapi/linux/if_ether.h> or unused. Remove the file
if_ether.h and its includes.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210824123621.10801-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:29:04 +02:00
Pavel Skripkin f228d1d509 staging: r8188eu: make rtw_deinit_intf_priv return void
rtw_deinit_intf_priv() always return success, so there is no need in
return value

Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Link: https://lore.kernel.org/r/20210823184059.19742-1-paskripkin@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:24:19 +02:00
Michael Straube bd5f258aff staging: r8188eu: use is_multicast_ether_addr in os_dep/recv_linux.c
Use is_multicast_ether_addr instead of custom macro IS_MCAST, the
buffer is properly aligned.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823120106.9633-9-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:23:13 +02:00
Michael Straube 0b704920fb staging: r8188eu: use is_multicast_ether_addr in hal/rtl8188eu_xmit.c
Use is_multicast_ether_addr instead of custom macro IS_MCAST, the
buffer is properly aligned.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823120106.9633-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:23:13 +02:00
Michael Straube 544984a774 staging: r8188eu: use is_multicast_ether_addr in core/rtw_xmit.c
Use is_multicast_ether_addr instead of custom macro IS_MCAST, all
buffers are properly aligned.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823120106.9633-7-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:23:13 +02:00
Michael Straube 2d4fe65101 staging: r8188eu: use is_multicast_ether_addr in core/rtw_security.c
Use is_multicast_ether_addr instead of custom macro IS_MCAST, all
buffers are properly aligned.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823120106.9633-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:23:12 +02:00
Michael Straube d0624c3379 staging: r8188eu: use is_multicast_ether_addr in core/rtw_recv.c
Use is_multicast_ether_addr instead of custom macro IS_MCAST, all
buffers are properly aligned.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823120106.9633-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:23:12 +02:00
Michael Straube 129f4197f2 staging: r8188eu: use is_multicast_ether_addr in core/rtw_mp.c
Use is_multicast_ether_addr instead of custom macro IS_MCAST, the
buffer is properly aligned.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823120106.9633-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:23:12 +02:00
Michael Straube 08cff18916 staging: r8188eu: use is_multicast_ether_addr in core/rtw_mlme.c
Use is_multicast_ether_addr instead of custom macro IS_MCAST, the
buffer is properly aligned.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823120106.9633-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:23:12 +02:00
Michael Straube 8aa824f2ec staging: r8188eu: ensure proper alignment for eth address buffers
Add __aligned(2) to eth address buffers in structs rx_pkt_attrib and
pkt_attrib to ensure proper alignment for usage with functions from
<linux/etherdevice.h>

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823120106.9633-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:23:11 +02:00
Michael Straube 2a3afb168e staging: r8188eu: remove unnecessary parentheses
Remove unnecessary parentheses to improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210822114014.21584-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:20:25 +02:00
Michael Straube f9f72f7f72 staging: r8188eu: remove dead code
if (0) is never true, remove code that is never executed.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210822114014.21584-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:20:25 +02:00
Michael Straube 3eaa30d162 staging: r8188eu: remove 5 GHz code
The driver is for chips that do not operate in the 5 GHz band.
Remove some 5 GHz related code.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210823193028.12391-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:19:56 +02:00
Michael Straube 8d82693b0b staging: r8188eu: remove cmd_osdep.h header file
All functions declared in the cmd_osdep.h header file are only used in
a single c source file. Make the functions static and remove the header
file and its includes.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210821155151.25822-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:19:29 +02:00
Larry Finger 6ca88cb5e8 staging: r8188eu: Make mult-byte entities in dhcp header be big endian
The 16- and 32-bit quantities in the dhcp message definition must be
big endian.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Link: https://lore.kernel.org/r/20210821151459.26078-1-Larry.Finger@lwfinger.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:19:07 +02:00
Phillip Potter e92e5f30ad staging: r8188eu: change declaration of Efuse_Read1ByteFromFakeContent
Remove forward declaration of Efuse_Read1ByteFromFakeContent function
from core/rtw_efuse.c, as the function is defined in full directly
after this and therefore this forward declaration is redundant.

In addition, convert the storage class of the function to static, as the
function is only used with rtw_efuse.c, and tidy up the signature
alignment.

Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Acked-by: Michael Straube<straube.linux@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210821105615.6307-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:18:43 +02:00
Xiangyang Zhang 2d29f81ce8 staging: r8188eu: Fix a resource leak in update_bcn_wps_ie
The "pbackup_remainder_ie" variable is not freed when "pwps_ie_src" is null

Fixes: 15865124fe ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com>
Link: https://lore.kernel.org/r/20210821081824.14745-1-xyz.sun.ok@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:51 +02:00
Martin Kaiser 5598e47a79 staging: r8188eu: set pipe only once
Set the pipe for reading or writing in usbctrl_vendorreq only once.
There's no need to set it again for every retry.

This patch is an adaptation of commit 889ed8b5e3 ("staging: rtl8188eu:
set pipe only once") for the new r8188eu driver.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:01 +02:00
Martin Kaiser f7231a04e4 staging: r8188eu: remove unused members of struct _io_ops
Remove function pointers which are not used by the r8188eu driver.

Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:01 +02:00
Martin Kaiser 22d0d6104e staging: r8188eu: clean up the usb_writeN
Remove unnecessary variables, check the length.

Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:01 +02:00
Martin Kaiser e8baed3c76 staging: r8188eu: clean up the usb_writeXY functions
Remove unnecessary variables, summarize declarations and assignments.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:01 +02:00
Martin Kaiser 0d3e1be506 staging: r8188eu: clean up the usb_readXY functions
Remove unnecessary variables, summarize declarations and assignments.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:00 +02:00
Martin Kaiser 2214ea8299 staging: r8188eu: remove an unused enum
The VENDOR_READ and VENDOR_WRITE defines are not used.

Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:00 +02:00
Martin Kaiser f410923ad5 staging: r8188eu: rewrite usb vendor request defines
Replace the numeric values with USB constants to make their
meaning clearer.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:00 +02:00
Martin Kaiser 805ac0da01 staging: rtl8188eu: use actual request type as parameter
At the moment, usbctrl_vendorreq's requesttype parameter must be set to
1 for reading and 0 for writing. It's then converted to the actual
bmRequestType for the USB control request. We can simplify the code and
avoid this conversion if the caller passes the actual bmRequestType.

This patch is an adaptation of commit 788fde0310 ("staging: rtl8188eu:
use actual request type as parameter") for the new r8188eu driver.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:00 +02:00
Martin Kaiser 74f64654ec staging: r8188eu: remove unused define
_HCI_OPS_OS_C_ is not used in the r8188eu driver. Remove it.

Acked-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:17:00 +02:00
Martin Kaiser 65945da601 staging: r8188eu: remove unnecessary cast
name is a const char * by default. This type should be ok for r8188eu.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210821164859.4351-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 12:16:59 +02:00
Michael Straube a69bbd2f77 staging: r8188eu: remove unused function rtw_remove_bcn_ie()
Function rtw_remove_bcn_ie() is not used anywhere, remove it.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210819112200.32030-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 10:43:14 +02:00
Michael Straube fbdbd861c8 staging: r8188eu: remove unused function rtw_add_bcn_ie()
Function rtw_add_bcn_ie() is not used anywhere, remove it.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210819112200.32030-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 10:43:14 +02:00
Yang Li 30e98ce81b staging: r8188eu: remove unneeded semicolon
Eliminate the following coccicheck warning:
./drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c:73:66-67: Unneeded
semicolon
./drivers/staging/r8188eu/hal/rtl8188e_hal_init.c:2225:68-69: Unneeded
semicolon
./drivers/staging/r8188eu/core/rtw_xmit.c:615:75-76: Unneeded semicolon

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1629450505-28247-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 10:42:08 +02:00
Michael Straube 55cdf7d7b2 staging: r8188eu: use GFP_ATOMIC under spinlock
kmalloc() in function update_bcn_wps_ie() is called under a spinlock
so the allocation have to be atomic.

-> update_beacon() <- takes a spinlock
   -> update_bcn_vendor_spec_ie()
      -> update_bcn_wps_ie()

Fixes: 79f712ea99 ("staging: r8188eu: Remove wrappers for kalloc() and kzalloc()")
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210819152914.17482-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 10:40:27 +02:00
Michael Straube 89b9f3f39a staging: r8188eu: fix scheduling while atomic bugs
These allocations are sometimes done under a spin lock so they
have to be atomic. The function call tree is:

-> update_beacon() <- takes a spin lock
   -> update_BCNTIM()
      -> set_tx_beacon_cmd()

Fixes: 79f712ea99 ("staging: r8188eu: Remove wrappers for kalloc() and kzalloc()")
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210819092423.4349-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-26 10:40:13 +02:00
Fabio M. De Francesco 093991aaad staging: r8188eu: Remove empty rtw_mfree_xmit_priv_lock()
Remove rtw_mfree_xmit_priv_lock() because it is empty. Remove its only
call from within _rtw_free_xmit_priv().

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210819050808.28825-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-19 07:43:13 +02:00
Phillip Potter 90356e9810 staging: r8188eu: remove rtw_update_mem_stat macro and associated flags
Remove the unused rtw_update_mem_stat macro and the associated flags
from include/osdep_service.h as this is all dead code.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-8-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-19 07:42:57 +02:00
Phillip Potter 41b8a93867 staging: r8188eu: remove function _rtw_zvmalloc
Remove the function _rtw_zvmalloc from os_dep/osdep_service.c, as this
function is now unused and is just an inline wrapper around vmalloc
which zeroes out the memory. All previous callers have been converted to
use vzalloc. Also remove the declaration from include/osdep_service.h.

It is considered generally bad practice to declare functions as inline in
the majority of cases, as not only can this qualifier be ignored by the
compiler but the compiler generally makes good decisions about inlining
anyway.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-7-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-19 07:42:57 +02:00
Phillip Potter 00d7a5613b staging: r8188eu: remove rtw_zvmalloc preprocessor definition
Remove rtw_zvmalloc preprocessor definition from include/osdep_service.h
as it now has no callers.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210818234853.208448-6-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-19 07:42:57 +02:00