Commit Graph

64 Commits

Author SHA1 Message Date
Carlos Garcés
f218547ef9 Remove unused debug function 2021-10-11 16:14:07 +02:00
Phillip Potter
3255bcf093 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.

Link: https://lore.kernel.org/r/20210818234853.208448-7-phil@philpotter.co.uk
2021-10-11 16:12:10 +02:00
Phillip Potter
2a467a7923 convert all rtw_zvmalloc calls to vzalloc calls
Convert all rtw_zvmalloc calls within the driver to use the existing
kernel vzalloc function, which has the same semantics. Also rewrite the
two places where it is mentioned in comments to say vzalloc, and remove
the redundant cast to struct adapter * in ./os_dep/usb_intf.c as vzalloc
returns void *.

The reason for the conversion is that rtw_zvmalloc is just a
preprocessor definition for _rtw_zvmalloc which itself is just an inline
wrapper around vmalloc which then zeroes the memory out. As vzalloc does
the same thing via usage of __GFP_ZERO, this code is redundant and can
subsequently be removed.

Link: https://lore.kernel.org/r/20210818234853.208448-5-phil@philpotter.co.uk
2021-10-11 15:59:59 +02:00
Phillip Potter
1f0cf855dc remove function _rtw_vmalloc
Remove the function _rtw_vmalloc from os_dep/osdep_service.c, converting
its only user (also in os_dep/osdep_service.c) to use plain vmalloc.
This function is just an inline wrapper around vmalloc which returns a u8
pointer, which isn't needed. 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.

Link: https://lore.kernel.org/r/20210818234853.208448-4-phil@philpotter.co.uk
2021-10-11 15:50:48 +02:00
Phillip Potter
397bbaeacf convert only rtw_vmalloc call to vmalloc
Convert the only call to rtw_vmalloc in os_dep/ioctl_linux.c to the
kernel's existing vmalloc function, as rtw_malloc is just a preprocessor
definition for _rtw_vmalloc. The _rtw_vmalloc function is defined inline
and returns a u8, wrapping standard vmalloc. This behaviour is not necessary.

Link: https://lore.kernel.org/r/20210818234853.208448-2-phil@philpotter.co.uk
2021-10-11 15:45:31 +02:00
Michael Straube
c1f70ba056 use common ieee80211 constants
Many defined constants in wifi.h are unused and/or available from
<linux/ieee80211.h>, some with slightly different names. Remove
the constants from wifi.h and use the common ones. Rename where
necessary.

Link: https://lore.kernel.org/r/20210814165518.8672-1-straube.linux@gmail.com
2021-10-11 15:03:09 +02:00
Fabio M. De Francesco
22a000acb9 Remove defined but not used variables
Remove defined but not used const variables. Issues detected by GCC
running with -Wunused-const-variable option enabled.

Link: https://lore.kernel.org/r/20210814160804.11634-1-fmdefrancesco@gmail.com
2021-10-11 14:25:08 +02:00
Nathan Chancellor
c597fa83da Reorganize error handling in rtw_drv_init()
Looking at the error function as a whole, the error handling is odd
compared to the rest of the kernel, which prefers to set error codes on
goto paths, rather than a global "status" variable which determines the
error code at the end of the function and function calls in the case of
error.

Rearrange the error handling of this function to bring it more inline
with how the kernel does it in most cases, which helps readability.

Link: https://lore.kernel.org/r/20210812204027.338872-4-nathan@kernel.org
Link: https://lore.kernel.org/r/20210813201418.4018631-1-nathan@kernel.org
2021-10-11 14:22:28 +02:00
Michael Straube
c8fd0937e4 replace custom hwaddr_aton_i() with mac_pton()
Replace custom hwaddr_aton_i() with mac_pton() in core/ioctl_linux.c
and remove the now unused function hwaddr_aton_i().

Link: https://lore.kernel.org/r/20210812132057.22579-1-straube.linux@gmail.com
2021-10-11 13:55:23 +02:00
Martin Kaiser
0faae6386e use IW_HANDLER to declare wext handlers
Use the IW_HANDLER macro to declare the handler functions for
wext ioctls. We don't have to skip unused ioctl numbers manually.

The same modification was applied to the deprecated rtl8188eu driver in
commit af249fce390f ("staging: rtl8188eu: use IW_HANDLER to declare wext
handlers").

Link: https://lore.kernel.org/r/20210807153636.11712-11-martin@kaiser.cx
2021-10-11 13:37:30 +02:00
Larry Finger
9ad10523e3 Remove wrapper rtw_sleep_schedulable()
This wrapper is never used.

Link: https://lore.kernel.org/r/20210805192644.15978-6-Larry.Finger@lwfinger.net
2021-10-11 13:03:59 +02:00
Larry Finger
a5adfa895b Remove wrapper rtw_udelay_os()
This wrapper is a simple call to udelay(). Remove it.

Link: https://lore.kernel.org/r/20210805192644.15978-4-Larry.Finger@lwfinger.net
2021-10-11 13:00:27 +02:00
Larry Finger
7f8451a86e Remove wrapper rtw_mdelay_os()
This wrapper just calls mdelay(). Remove it.

Link: https://lore.kernel.org/r/20210805192644.15978-3-Larry.Finger@lwfinger.net
2021-10-11 12:57:06 +02:00
Carlos Garcés
cf246719f1 Remove wrapper for memset()
Link: 545d963a9e (diff-16d649c4743131c1aae5f812af5596dae6423bb63eaaf2990b8c89c9a681a913)
2021-10-11 12:09:34 +02:00
Larry Finger
fdbea81f08 Remove wrapper routine rtw_msleep_os()
The effect of this macro is to call msleep(). Remove the wrapper.

Link: https://lore.kernel.org/r/20210805192644.15978-2-Larry.Finger@lwfinger.net
2021-10-11 10:44:02 +02:00
Larry Finger
1fcfef2e07 Remove rtw_yield_os()
This wrapper is just a call to yield().

Link: https://lore.kernel.org/r/20210805192644.15978-1-Larry.Finger@lwfinger.net
2021-10-11 10:44:02 +02:00
Larry Finger
51e1f13a91 Remove all calls to _rtw_spinlock_free()
This routine is empty, thus all calls to it can be removed.

Link: https://lore.kernel.org/r/20210805183717.23007-4-Larry.Finger@lwfinger.net
2021-10-11 10:44:02 +02:00
Larry Finger
34ec238387 Remove wrapper around vfree
This call is so simple that there is no need, or use, for a wrapper.

Link: https://lore.kernel.org/r/20210805183717.23007-3-Larry.Finger@lwfinger.net
2021-10-11 10:44:02 +02:00
Larry Finger
4d3d23dd24 Remove wrapper around do_div
Wrapper routine rtw_modular64() contains only a call to do_div() and
is used once in the code. Remove the wrapper.

Link: https://lore.kernel.org/r/20210803135223.12543-9-Larry.Finger@lwfinger.net
2021-10-11 10:44:02 +02:00
Larry Finger
d7c3737cd5 Remove wrappers for atomic operations
These wrappers were useful when this driver had the hooks for Windows,
but are no longer needed.

Link: https://lore.kernel.org/r/20210802192721.23110-4-Larry.Finger@lwfinger.net
2021-10-11 10:44:02 +02:00
Greg Kroah-Hartman
6b5e7665c9 remove rtw_usb_control_msg() macro
It is a wrapper around usb_control_msg() that does nothing, so remove
the macro and just call the correct USB function instead in the one
place it is used.

Link: https://lore.kernel.org/r/20210730092417.1014392-12-gregkh@linuxfoundation.org
2021-10-11 10:44:01 +02:00
Greg Kroah-Hartman
ac1790da7c remove rtw_mfree2d() function
It is just a wrapper around kfree(), so remove it and just call kfree()
instead.

Adaptation of: https://lore.kernel.org/r/20210730092417.1014392-7-gregkh@linuxfoundation.org
2021-10-11 10:44:01 +02:00
Carlos Garcés
59fd03940c Fix for kernel 5.15
Fixed compilation warnings with GCC 11
Fix libc6 dependency 2.34
2021-10-09 13:33:01 +02:00
Carlos Garcés
09c5222d59 Fixed 5.12 support. 2021-05-10 19:06:13 +02:00
Carlos Garcés
ab35c7e967
Merge pull request #233 from CGarces/fix_5.12
Add kernel 5.12(+) (GRO_DROP removed) support
2021-04-03 16:53:01 +02:00
Carlos Garcés
e103b7c701
Merge pull request #232 from CGarces/centos8_fix
Add RHEL/CENTOS 8 support
2021-04-03 16:52:43 +02:00
clnhub
ac90a311a3 Add kernel 5.12(+) (GRO_DROP removed) support 2021-04-03 14:46:24 +00:00
Carlos
48460503c0 Add RHEL/CENTOS 8 support 2021-04-01 15:37:13 +00:00
Carlos Garces
8fa56156a8 Fix wireless regulatory API misuse
Port of 81f153faac
2021-03-11 23:39:00 +01:00
Gleb Mazovetskiy
d6e1690ae8 Fix build with gcc-10 (-Wrestrict)
Fixes errors such as this:

```
os_dep/linux/ioctl_mp.c:611:4: warning: 'sprintf' argument 3 overlaps destination object 'extra' [-Wrestrict]
error, forbidden warning:ioctl_mp.c:611
  611 |    sprintf(extra, "%s,pathb=%d", extra, txpower_inx);
```

Fixes #221
2021-02-06 17:13:16 +01:00
Carlos Garcés
8133834ebe Fix cfg80211_ch_switch_started_notify on kernel 5.11-rc3
See 669b84134a
2021-01-11 11:12:16 +00:00
Carlos Garcés
2ff6fb4f87
Merge pull request #201 from CGarces/kernel_5.10
Fix Kernel compilation 5.10-rc1
2020-11-12 10:46:15 +01:00
Carlos
8ba6813bfd Fix Kernel compilation 5.10-rc1
Adapt code due set_fs() removal
See f56e65dff6
2020-11-10 22:09:15 +00:00
Carlos Garces
326965ada9 Fix fallthrough errors 2020-10-31 18:39:03 +01:00
Carlos Garces
b6a5f1bce9 Fix c90 errors 2020-10-31 18:27:48 +01:00
Pascal Terjan
827a02287a Fix the 5.8 fix
The original fix stopped calling cfg80211_rtw_mgmt_frame_register.
2020-08-23 17:05:47 +00:00
5kft
28c2e151e1
rtl8192eu: Fix driver startup traps in rtw_cfg80211_ch_switch_notify
These changes are a backport of associated newer changes made in the v5.6.4.2
rtl8812au driver, and correct problems in the previous initialization process
that caused multiple kernel traps on startup.
2020-08-17 19:33:52 -07:00
Carlos
f0a1b30419 Fix kernel 5.8 compilation 2020-06-15 22:35:08 +02:00
Carlos Garces
02e23dbf71 add proc_ops for kernel 5.6 2020-04-26 13:24:18 +02:00
默默
b1c290c001
Add TMall MagicAP support
Co-authored-by: Carlos Garcés <CGarces@users.noreply.github.com>
2020-04-19 22:51:50 +02:00
Carlos Garces
1d807f14d8 Add version v5.6.4 2019-11-13 22:12:20 +01:00
Carlos Garcés
e7361e951c
linux-5.3: adding vendor command policy (#141)
* Fix for kernel 5.3
* Update Travis CI to last mainline and LTS kernels
Fetch from 50da975628
2019-09-19 21:30:52 +02:00
vasreb
d899c57f8f Add VID/PID to support Mercusys MW300UH adapter (#137)
* Add VID/PID to support Mercusys MW300UH adapter
2019-09-10 21:35:58 +02:00
Maxim Buzdalov
30ba4de6ef Enable power management (hopefully).
I mean, it does not crash, but I have no hardware to tell
whether the output power actually changes.
2019-08-22 02:02:40 +03:00
SatanicRaw
13b9c39980 Add VID/PID to support Mercusys MW300UM adapter. (#133)
* Add VID/PID to support MW300UM adapter.
2019-07-11 14:51:14 +02:00
Maxim Buzdalov
5342dd8f29 Get rid of the unnecessary local ieee80211_band enum 2019-07-08 04:03:08 +03:00
MilhouseVH
16c378456e fix 5.2-rc1: remove 'fallback' argument
a350eccee5
2019-05-23 00:26:19 +01:00
Carlos Garcés
0a7199b457
Merge pull request #119 from MilhouseVH/fix-5.1-rc1
kernel-5.1-rc1 fix
2019-03-19 09:18:49 +01:00
MilhouseVH
7bcaeb0bb1 get rid of legacy 'get_ds()' function
736706bee3
2019-03-18 16:17:39 +00:00
MilhouseVH
00229b3318 kernel 5.0: Remove 'type' argument from access_ok() function
See: 96d4f267e4
2019-01-08 07:13:46 +00:00