Commit Graph

106 Commits

Author SHA1 Message Date
Franz Eitzinger
166d1a4bb9 Use device_driver directly in struct usb_driver for Kernel 6.8
See 49a78b05d5
2024-02-22 22:08:04 +01:00
Norbert Brondeau
94d6dfbe9d
Fix Build with Kernel 6.7 (#331)
* Fix Build with Kernel 6.7

* Update ioctl_cfg80211.c

...
2024-01-20 13:10:15 +01:00
Dmitry Geurkov
f2fc8af7ab
fix netif_napi_add Linux 6.1/6.3 execution issue (#321)
* fix netif_napi_add Linux 6.1/6.3 compile issue
2023-06-13 14:58:04 +02:00
Carlos Garcés
94841bf289 Fix kernel 6.3
wifi: cfg80211: include puncturing bitmap in channel switch events
see b345f0637c
2023-03-13 17:07:40 +00:00
Nikolay Edigaryev
0043022f0c cfg80211_rtw_scan: fix NULL pointer dereference in Wi-Fi Direct logic 2022-12-09 12:03:36 +04:00
Konstantin Lebedev
a4a3f52912
fix: Waddress (#298)
* fix: Waddress
2022-11-30 11:38:53 +01:00
Pascal Terjan
58b5ea9b36 Fix mistakes from 355a2df
This makes the driver work again for me
2022-11-16 11:56:52 +00:00
Carlos Garcés
8051c5f3b3 Fix update_beacon calls
Error introduced at 3555bdb258
Also clean up validate_recv_ctrl_frame
Link: 797afdf248
Link aaa0bc19fa
2022-10-31 16:45:45 +00:00
Carlos Garcés
563780d2eb Fix kernel 6.1 compilation
wifi: cfg80211: Add link_id parameter to various key operations for MLO
wifi: cfg80211: Add link_id to cfg80211_ch_switch_started_notify()
net: drop the weight argument from netif_napi_add
random: convert get_random_int/long into get_random_u32/u64

Link: https://lore.kernel.org/r/20220722131143.3438042-1-quic_vjakkam@quicinc.com
Link: https://lore.kernel.org/r/20220722131143.3438042-2-quic_vjakkam@quicinc.com
Link: https://lore.kernel.org/r/20220730052643.1959111-4-quic_vjakkam@quicinc.com
Link: https://lore.kernel.org/r/20220927132753.750069-1-kuba@kernel.org

Link: e7a7b84e33
Link: de492c83ca
Link: c440408cf6
2022-10-25 19:15:54 +00:00
Igor Pecovnik
ec5c2446db Add support for Linux 5.19.2 and 6.0 2022-08-21 11:11:38 +00:00
Carlos Garcés
352330be93 Simplify 5.17 patch 2022-04-06 12:33:58 +02:00
Carlos Garcés
0f1952813c Cleanup memcpy warnings
Introduce eth_hw_addr_set from 5.15
Port 48eab831ae
Port 6ed178cb23
2022-03-13 13:26:14 +01:00
heitbaum
5fb30bc593 rtl8192eu: Fix code for kernel 5.17 API change
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
2022-02-10 07:19:24 +00:00
Carlos Garces
97bac22d5b Remove duplicate names for rtw_read[n] and rtw_write[n]
rtw_read[n]() is redefined as _rtw_read[n]() and PlatformEFIORead[n]Byte
Same for rtw_write[n]() furntions

Link: https://lore.kernel.org/r/9880c86c2aad7d95a714d8b03b28b83634f98c1e.1621361919.git-series.hello@bryanbrattlof.com
Link: https://lore.kernel.org/r/11458342572f21d9df58b3969ad1f16fdff157f4.1621361919.git-series.hello@bryanbrattlof.com
Link: https://lore.kernel.org/r/15956707341f76de683245c392063b8121a805ea.1621361919.git-series.hello@bryanbrattlof.com
Link: https://lore.kernel.org/r/35ffc9cd5af7009b317361033a6ca5263307d61a.1621361919.git-series.hello@bryanbrattlof.com
Link: https://lore.kernel.org/r/7d53fb295f67f01c72640045afb88150391bce35.1621361919.git-series.hello@bryanbrattlof.com
Link: https://lore.kernel.org/r/43917aee34e85139e613578cf6f14938211c8835.1621361919.git-series.hello@bryanbrattlof.com

Port of
51d4aa6d6bf35d85d318831df60a34bad27cdb9e
8ff74e4307b42302c89023faf8fd37dbde4c4666
16b1b3c8221a40bf899dfeebdb3d5245ecb65515
7f06caf9a40bb3c08fe86c8355ace25b7ce69ba9
1c42d72e4747fb546eba53821ae56ecf827202a7
4d6bfc6f62705ec5baee9c572d4ca03bc9e36c00
2021-10-23 11:09:24 +02:00
Carlos Garces
7a0d67040a remove ELEMENT_ID enum
Values are replaced with the equivalent ones from enum ieee80211_eid linux/ieee80211.h

Link: https://lore.kernel.org/r/20201208040733.379197-22-ross.schm.dev@gmail.com
2021-10-22 16:48:30 +02:00
Carlos Garces
86199d0791 use native wireless IE codes from linux/ieee80211.h
IE code definitions have been replaced with native ones
to avoid code duplication.

The unobvious substitutions are:
_WPA_IE_ID_ -> WLAN_EID_VENDOR_SPECIFIC;
_WPA2_IE_ID_ -> WLAN_EID_RSN.

Link: https://lore.kernel.org/r/20201011105050.5896-1-insafonov@gmail.com
2021-10-22 16:47:14 +02:00
Carlos Garces
4799326c6f switch to common ieee80211 headers
This patch switches to <linux/ieee80211.h> and <net/cfg80211.h> and
deletes a lot of duplicate definitions plus many unused ones.

rtw_ieee80211_hdr_3addr_qos is duplicate of ieee80211_qos_hdr.
rtw_ieee80211_spectrum_mgmt_actioncode is a duplication of ieee80211_spectrum_mgmt_actioncode
rtw_ieee80211_hdr_3addr is duplicate of ieee80211_hdr_3addr.
rtw_ieee80211_hdr is duplicate of ieee80211_hdr
rtw_ieee80211s_hdr is duplicate of ieee80211s_hdr
rtw_ieee80211_rann_ie is duplicate of ieee80211_rann_ie
from include/linux/ieee80211.h.

Link: https://lore.kernel.org/r/20200906133236.556427-1-insafonov@gmail.com
Link: https://lore.kernel.org/r/20200609194848.166130-1-pterjan@google.com
Also port
5cd8396540b5f7ef7c3ac499e967dd4deb8e9930
bbfe286b07d8282f4957dee692e85b3bd60de770
d87f574d6923c546e7d0f75ce0581436376b98a6
36eb7d108e8de3097f373eb8629d8739d4fa3e74
1b9e6df5169b36b3242e2e28c39f9bbfc01863e8
d94971aa97670d400371baef5d9d5cf6dc8ea2b5
2021-10-22 16:46:01 +02:00
Carlos Garces
6b480dfa8e include/ieee80211.h cleaup.
Remove empty functions from ieee80211.h
Use values from linux/ieee80211.h

port 12a17d72f7948148b80c0dfa72ea983da33464ba
port a9d8763889737b7e0f83956e093bd48190876044
port 872cfb096d3a009709b56f23f5280a359bbe58e2
port a4bc0fa9ec51008bb494943ec98b4ad836e3a216
port 13e00f8ebded278a7887d98ad65ceabc24f3776a
2021-10-21 22:33:41 +02:00
Carlos Garces
27246f4eb5 use eth_broadcast_addr() to assign broadcast address
Using eth_broadcast_addr() to assign broadcast address instead
of copying from an array that contains the all-ones broadcast
address

Port 78adf574c969c14a470b686af8d6bd7e1dcf142b
Port 3b0a4a1bdb0f6348dba797a0fa1cf161f5639ded
Port 44c26bec861476f89ac5aee0bb19df128a42543b

Link: https://lore.kernel.org/r/20210616081243.2511663-4-yangyingliang@huawei.com
2021-10-20 20:13:18 +02:00
Carlos Garces
77e7d6747c Replace custom emun
Replace rtw_ieee80211_channel_flags with ieee80211_channel_flags from net/cfg80211.h
Replace rtw_ieee80211_root_mode_identifier with ieee80211_root_mode_identifier from linux/ieee80211.h

port b658acbf64ae38b8fca982c2929ccc0bf4eb1ea2
port 5befa937e8daaebcde81b9423eb93f3ff2e918f7
2021-10-20 18:36:56 +02:00
Carlos Garces
de617fc8d5 Fix IEEE80211 authentication algorithm constants.
Use the values provided by linux/wireless.h

Port 5befa937e8daaebcde81b9423eb93f3ff2e918f7
Port b658acbf64ae38b8fca982c2929ccc0bf4eb1ea2
2021-10-20 17:34:38 +02:00
Carlos Garces
51d0819382 Use cpu_to_le16() insted of RTW_PUT_LE16()
Port 83a9b6694d1e300ca8240fdf654650dcc096c86f
2021-10-20 16:42:09 +02:00
Carlos Garces
04a730b326 replace rtw_ieee80211_ht_cap with ieee80211_ht_cap
port 042ca34b9ab19d0a52c3b01862a6c07fcb032e86
2021-10-18 17:09:47 +02:00
Carlos Garces
c5f30cb5cc remove enum WIFI_FRAME_SUBTYPE
The values defined in enum WIFI_FRAME_SUBTYPE are the same the #define
IEEE80211_STYPE_xxx from <linux/ieee80211.h>.

Port 33ed2b7079f6c38abce6abbaf1e6be4edad919d8
2021-10-18 16:05:53 +02:00
Carlos Garces
3555bdb258 Replace custom definitions with existing
ones at linux/ieee80211.h.

port 69fea2b4e59c52844cf5196c9c81157792d194fb
port 6ee9e6ee5c486f68e424185e133984d0a6ae662c
port f179515da9780c4cd37bee76c3cbb6f7364451d6
port aaa0bc19facf31426ca57267edc681a42dbd1ee1
port 99bb776980eeb231558a6ede0a1dd8d1a6e8ec0c
port 00f0b682841337c4d2e7dd2e75d86acb6b7ce2d8
port fc41e9618fc65bea5d615d487ca7de3b0e1110bc
port 3359e2927b321c635d9529bab1f087ac39c82227
port 38caee0abe9db1db387e7bea60a980eda22e9fa6
port b05cc3a9156b6b674904016d9c213e71c149f4c2
2021-10-15 17:42:20 +02:00
Carlos Garces
355a2df5ab Remove function rtw_end_of_queue_search()
Port of 84660700807cbcd649c58ff8ce7f65021765b15c
2021-10-14 22:37:57 +02:00
Carlos Garces
bb871e7167 Remove wrappers
Port of 788253860c21f4e40add556d7ed715fefb2bafb3
Port of ace050139cee44d06b06b4c78074b4eb80fb7c0a
2021-10-14 22:19:09 +02:00
Larry Finger
5ac00c9dc2 Remove more empty routines
After removing some empty routines in os_dep/osdep_service.c, new routines
become empty. These include rtw_mfree_stainfo(),
_rtw_free_sta_xmit_priv_lock(), and rtw_mfree_recv_priv_lock.

Link: https://lore.kernel.org/r/20210805183717.23007-5-Larry.Finger@lwfinger.net
2021-10-14 22:03:44 +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
b7fc146dee Remove code related to PLATFORM_OS_CE 2021-10-14 20:40:03 +02:00
Carlos Garces
b8fb1c691d Remove code related to PLATFORM_OS_XP 2021-10-14 20:23:16 +02:00
Carlos Garces
9e36a8086e Remove code related to PLATFORM_FREEBSD 2021-10-14 20:09:07 +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
bb3dc5ca12 Replace _rtw_memmove with memmove 2021-10-12 17:09:01 +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
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