Commit Graph

64 Commits

Author SHA1 Message Date
Carlos Garces
bb871e7167 Remove wrappers
Port of 788253860c21f4e40add556d7ed715fefb2bafb3
Port of ace050139cee44d06b06b4c78074b4eb80fb7c0a
2021-10-14 22:19:09 +02:00
Carlos Garces
7a5f134424 Replace rtw_get_current_time() with jiffies
Port of c01fb49636b65ceea513c00966c58b8bdb095c8f
2021-10-14 22:03:09 +02:00
Carlos Garces
9d13b33a29 Remove code related to PLATFORM_WINDOWS 2021-10-14 19:32:27 +02:00
Martin Kaiser
507d1c07e0 ctrl vendor req index is not used
The index for r8188eu's vendor-specific control requests is not used.
Remove the index parameter from usbctrl_vendorreq and pass index 0 to
usb_control_msg.

This patch is an adaptation of commit 3d0be94f62fd ("staging: rtl8188eu:
ctrl vendor req index is not used") for the new r8188eu driver.

Link: https://lore.kernel.org/r/20210818200041.10870-2-martin@kaiser.cx
2021-10-14 16:30:39 +02:00
Carlos Garces
4ddd7165fb 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 788fde031027 ("staging: rtl8188eu:
use actual request type as parameter") for the new r8188eu driver.

Link: https://lore.kernel.org/r/20210821164859.4351-3-martin@kaiser.cx
2021-10-14 16:30:39 +02:00
Michael Straube
60aa279428 Use is_multicast_ether_addr instead of custom macro IS_MCAST, the
buffer is properly aligned.

Link: https://lore.kernel.org/r/20210823120106.9633-3-straube.linux@gmail.com
Link: https://lore.kernel.org/r/20210823120106.9633-4-straube.linux@gmail.com
Link: https://lore.kernel.org/r/20210823120106.9633-5-straube.linux@gmail.com
Link: https://lore.kernel.org/r/20210823120106.9633-6-straube.linux@gmail.com
Link: https://lore.kernel.org/r/20210823120106.9633-7-straube.linux@gmail.com
Link: https://lore.kernel.org/r/20210823120106.9633-8-straube.linux@gmail.com
Link: https://lore.kernel.org/r/20210823120106.9633-9-straube.linux@gmail.com
2021-10-14 16:30:30 +02:00
Carlos Garces
91b4661c5f 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 ieee80211.h and wifi.h and use the common ones. Rename where
necessary.
2021-10-12 17:52:52 +02:00
Carlos Garces
71d5c54af2 Replace _rtw_memcpy with memcpy 2021-10-12 17:03:53 +02:00
Martin Kaiser
cd6cb41e0f 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 889ed8b5e374 ("staging: rtl8188eu:
set pipe only once") for the new r8188eu driver.

Link: https://lore.kernel.org/r/20210821164859.4351-10-martin@kaiser.cx
2021-10-12 16:50:33 +02:00
Carlos Garces
1c50f4c603 Removed unused and empty functions 2021-10-12 16:02:19 +02:00
Martin Kaiser
28e0bba794 ctrl vendor req value is always 0x05
The bRequest value for the vendor specific control requests sent by this
driver is always 0x05. Replace the function parameter with the define from
usb_ops.h.

This patch is an adaptation of commit eeb4661560ff ("staging: rtl8188eu:
ctrl vendor req value is always 0x05") for the new r8188eu driver.

Link: https://lore.kernel.org/r/20210818200041.10870-1-martin@kaiser.cx
2021-10-11 16:36:03 +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
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
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
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
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
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