Commit Graph

98 Commits

Author SHA1 Message Date
pbrochart
37600b1eaf fix UBSAN: array-index-out-of-bounds 2024-05-07 17:08:57 +02:00
Carlos Garcés
3cffd844ec
Added compatibility with backported kernels. (#327) 2024-01-20 14:30:39 +01:00
Carlos Garcés
b9cfa37026 eth_hw_addr_set: use memcpy
eth_hw_addr_set() replaces memcpy() calls so we can't use ether_addr_copy()
which assumes both arguments are 2-bytes aligned.

3f6cffb860
adeef3e321
2022-05-15 21:32:00 +00:00
Carlos Garcés
047a8aefc4 Fix 5.18 compilation errors 2022-04-06 12:56:25 +02: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 Garcés
879f617f82 Remove extern as it is defined but never used
RTW_WPA_VERSION is removed as is declared and defined but
never used in the code.
Port 2c4b2980ae16a2d8d35f126ddb9fbcba809e2612
2021-10-23 10:33:02 +02:00
Carlos Garcés
04b4fa6f82 use the proper WLAN_OUI_TYPE_MICROSOFT_* definitions.
port 42282f4147e2bc5b89d6a050244a7c5475613d83
2021-10-23 10:32:35 +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
34f947ef16 remove typedefs in ieee80211.h
This commit fixes checkpatch.pl warnings:

also port the folowing commits
5ef6c5db04ffff21006099961c3c8acc5727b2c8
74941703accd4a94e7a74c31050d7985216b7034
7d0b4f3c9300f43b65125115f5728e1a5d39e270
2021-10-22 16:47:43 +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
3f3d3a0986 remove unused macros in include/wifi.h
remove declarations of unused macros in include/wifi.h

Link: https://lore.kernel.org/r/1192085c7e891f801751f3adb7884083a2999483.1616854134.git.fabioaiuto83@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
539ec6269e remove HAL_{BB,MAC,RF,FW}_ENABLE macros
remove HAL_{BB,MAC,RF,FW}_ENABLE macros.
They are used to turn on/off by hand some core
capabilities we want to be always 'on'.

port bb1c456d7f88b60b28b9f51e28031fc67cdb8d7b
port b4e1882d750facd317ac2572d6bf36a05b0b0c36

Link: https://lore.kernel.org/r/04248acbd22f9be30d21891926e134490b34036a.1623756906.git.fabioaiuto83@gmail.com
2021-10-20 20:13:32 +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
7a17174176 remove unused macros in include/ieee80211.h
Link: https://lore.kernel.org/r/c50cba3974772347888bd55085b1e5e44ef0687d.1626533647.git.fabioaiuto83@gmail.com
2021-10-20 16:58:06 +02:00
Carlos Garces
4bd55ad644 Remove unused sd_int_dpc 2021-10-20 16:51:24 +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
c832879ea1 Remove unused headers
Port 109709e142eb69c76c78176fe8cd70a4278410a0
Port 0aba3f417fff530fbf031b8f31c37e2d018e44c2
2021-10-20 13:23:32 +02:00
Carlos Garces
813f544e1e Remove unused SetRetry macro
port e80c2859b16fbfe209e7ee7cf2b2b65deb890971
2021-10-18 20:03:20 +02:00
Carlos Garces
158017aa86 replace get_(d|s)a with ieee80211_get_(D|S)A
get_da()/get_sa() duplicate native ieee80211_get_(D|S)A functions.
Remove get_(d|s)a, use ieee80211_get_(D|S)A instead.

Link: https://lore.kernel.org/r/20210314090247.21181-2-insafonov@gmail.com
2021-10-18 19:40:27 +02:00
Carlos Garces
5ae45c1296 use IEEE80211_FCTL_* kernel definitions
_TO_DS_, _FROM_DS_, _MORE_FRAG_, _RETRY_, _PWRMGT_, _MORE_DATA_,
_PRIVACY_, _ORDER_ definitions are duplicate IEEE80211_FCTL_*
kernel definitions.

Link: https://lore.kernel.org/r/20210213131148.458582-1-insafonov@gmail.com
2021-10-18 19:32:53 +02:00
Carlos Garces
0242513fe3 Replace custom defimitions OP_MODE_ and HT_INFO_HT_PARAM_
Use the values provided by linux/ieee80211.h
IEEE80211_HT_OP_*
IEEE80211_HT_PARAM_*
2021-10-18 18:46:22 +02:00
Carlos Garces
db6ccf24e0 Removed unsused stbc_paramm definitions
If need IEEE80211_HT_STBC_PARAM_* from linux/ieee80211.h can be used
2021-10-18 18:04:37 +02:00
Carlos Garces
2cd85b6799 remove unused rtw_ieee80211_bar structure definition
port of bdf299c1407b249eb5d623b1ebdd7269a2a88729
2021-10-18 17:45:44 +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
b4be42500f Use Spatial Multiplexing Power Save Modes from <linux/ieee80211.h> 2021-10-18 16:36:45 +02:00
Carlos Garces
3acac3288c Replace AMPDU emun structures with kernel provided
Port 98b32c71a455ff289442779fee02ad60a6217006
2021-10-18 16:28:25 +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
264085886d Remove wrappers _rtw_free_sema
Port of 2ca4ab5324062e70393e9a37a8db1ea94d6e2f99
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
4032543691 Remove OUI_MICROSOFT and use the value from kernel 2021-10-14 21:26:34 +02:00
Carlos Garces
3264bb634a Remove garbage after platform cleanup 2021-10-14 20:45:33 +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
Pavel Skripkin
a0549c5041 remove {read,write}_macreg
These 2 functions are unused, so they can be simply removed

Link: https://lore.kernel.org/r/d591e29d77da73790c71f7a8e508a8b16fd48f65.1629789580.git.paskripkin@gmail.com
2021-10-14 16:30:39 +02:00
Michael Straube
2f0a5e695b remove ethernet.h header file
There are only two definitions from ethernet.h used in the driver.
Namely:

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.

Link: https://lore.kernel.org/r/20210824123621.10801-4-straube.linux@gmail.com
2021-10-14 16:30:39 +02:00
Michael Straube
a99eff7ea3 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.

Link: https://lore.kernel.org/r/20210824123621.10801-2-straube.linux@gmail.com
2021-10-14 16:30:39 +02:00