Use is_multicast_ether_addr() and is_broadcast_ether_addr()
instead of custom macro IS_MCAST() and MacAddr_isBcst(), the buffer
is properly aligned.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230814105623.292541-1-ruanjinjie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use is_broadcast_ether_addr() instead of memcmp to check
if the ethernet address is broadcast address.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20230804083841.1321554-2-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the following checkpatch issues:
- CHECK: spaces preferred around that '+' (ctx:VxV)
- CHECK: spaces preferred around that '&' (ctx:VxV)
- CHECK: spaces preferred around that '|' (ctx:VxV)
- CHECK: spaces required around that ':' (ctx:VxV)
Signed-off-by: Franziska Naepelt <franziska.naepelt@googlemail.com>
Link: https://lore.kernel.org/r/20230722215916.4413-1-franziska.naepelt@googlemail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the following checkpatch issues:
- CHECK: Blank lines aren't necessary before a close brace '}'
- CHECK: Blank lines aren't necessary after an open brace '{'
Signed-off-by: Franziska Naepelt <franziska.naepelt@googlemail.com>
Link: https://lore.kernel.org/r/20230722215840.4323-1-franziska.naepelt@googlemail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the following checkpatch space issues:
- CHECK: spaces preferred around that '*' (ctx:VxV)
- CHECK: spaces preferred around that '+' (ctx:VxV)
- CHECK: spaces preferred around that '-' (ctx:VxV)
- CHECK: spaces preferred around that '|' (ctx:VxV)
- CHECK: No space is necessary after a cast
- WARNING: please, no spaces at the start of a line
Signed-off-by: Franziska Naepelt <franziska.naepelt@googlemail.com>
Link: https://lore.kernel.org/r/20230701102538.5359-1-franziska.naepelt@googlemail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fix the following checkpatch blank line issues:
- CHECK: Please don't use multiple blank lines
- CHECK: Blank lines aren't necessary before a close brace '}'
- CHECK: Blank lines aren't necessary after an open brace '{'
Signed-off-by: Franziska Naepelt <franziska.naepelt@gmail.com>
Link: https://lore.kernel.org/r/20230619181246.19112-1-franziska.naepelt@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
replace the ternary operator used for assignment of pHalData->ant_path
with an if-else block for better readability
Signed-off-by: Atin Bainada <hi@atinb.me>
Link: https://lore.kernel.org/r/20230513214338.79833-1-hi@atinb.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use tabs for indentation to conform to styleguide.
Signed-off-by: Daniel Watson <ozzloy@gmail.com>
Link: https://lore.kernel.org/r/ZEyAaC0riuuBJO14@trent-reznor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Use tabs to indent code and spaces to align in order to make the code
consistent and easier to read.
Signed-off-by: Daniel Watson <ozzloy@gmail.com>
Link: https://lore.kernel.org/r/ZCdmCBIdabBGqm11@trent-reznor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Move the open brace of if-statements to the same line. This matches the
brace placement style described in the kernel's style guide.
Signed-off-by: Daniel Watson <ozzloy@gmail.com>
Link: https://lore.kernel.org/r/ZCOGhkLvLtBEo92Y@trent-reznor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the function hal_btcoex_SetChipType() as it does nothing and
produces the following gcc warning when compiling with W=1.
drivers/staging/rtl8723bs/hal/hal_btcoex.c:1182:30: warning: variable 'pHalData' set but not used [-Wunused-but-set-variable]
1182 | struct hal_com_data *pHalData;
| ^~~~~~~~
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230324084334.12183-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Convert `dvobj_to_dev` macro into a static inline function.
it is not great to have macro that use `container_of` macro,
because from looking at the definition one cannot tell
what type it applies to.
One can get the same benefit from an efficiency point of view
by making an inline function.
Suggested-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: Menna Mahmoud <eng.mennamahmoud.mm@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230319201134.253839-1-eng.mennamahmoud.mm@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function rtw_get_raw_rssi_info() is not used anywhere, remove it.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230310083449.23775-6-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function linked_info_dump() is not used anywhere, remove it.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230310083449.23775-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function isAllSpaceOrTab() is not used anywhere, remove it.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230310083449.23775-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function ParseQualifiedString() is not used anywhere, remove it.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230310083449.23775-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The function MapCharToHexDigit() is not used anywhere, remove it.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230310083449.23775-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
We need the removal of the r8188eu staging driver in here as well so
that outreachy and LF mentor applicants do not try to submit patches
against it as it is now gone from the tree.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To last 2 parameters to cfg80211_get_bss() should be of
the enum ieee80211_bss_type resp. enum ieee80211_privacy types,
which WLAN_CAPABILITY_ESS very much is not.
Fix both cfg80211_get_bss() calls in ioctl_cfg80211.c to pass
the right parameters.
Note that the second call was already somewhat fixed by commenting
out WLAN_CAPABILITY_ESS and passing in 0 instead. This was still
not entirely correct though since that would limit returned
BSS-es to ESS type BSS-es with privacy on.
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230306153512.162104-2-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There are 2 issues with the key-store index handling
1. The non WEP key stores can store keys with indexes 0 - BIP_MAX_KEYID,
this means that they should be an array with BIP_MAX_KEYID + 1
entries. But some of the arrays where just BIP_MAX_KEYID entries
big. While one other array was hardcoded to a size of 6 entries,
instead of using the BIP_MAX_KEYID define.
2. The rtw_cfg80211_set_encryption() and wpa_set_encryption() functions
index check where checking that the passed in key-index would fit
inside both the WEP key store (which only has 4 entries) as well as
in the non WEP key stores. This breaks any attempts to set non WEP
keys with index 4 or 5.
Issue 2. specifically breaks wifi connection with some access points
which advertise PMF support. Without this fix connecting to these
access points fails with the following wpa_supplicant messages:
nl80211: kernel reports: key addition failed
wlan0: WPA: Failed to configure IGTK to the driver
wlan0: RSN: Failed to configure IGTK
wlan0: CTRL-EVENT-DISCONNECTED bssid=... reason=1 locally_generated=1
Fix 1. by using the right size for the key-stores. After this 2. can
safely be fixed by checking the right max-index value depending on the
used algorithm, fixing wifi not working with some PMF capable APs.
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230306153512.162104-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Commit cc7ad0d77b ("drivers: staging: rtl8723bs: Fix deadlock in
rtw_surveydone_event_callback()") besides fixing the deadlock also
modified rtw_scan_timeout_handler() to use spin_[un]lock_irq()
instead of spin_[un]lock_bh().
Disabling the IRQs is not necessary since all code taking this lock
runs from either user contexts or from softirqs
rtw_scan_timeout_handler() is the only function taking pmlmepriv->lock
which uses spin_[un]lock_irq() for this. Switch back to
spin_[un]lock_bh() to make it consistent with the rest of the code.
Fixes: cc7ad0d77b ("drivers: staging: rtl8723bs: Fix deadlock in rtw_surveydone_event_callback()")
Cc: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230221145326.7808-2-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Commit 041879b12d ("drivers: staging: rtl8192bs: Fix deadlock in
rtw_joinbss_event_prehandle()") besides fixing the deadlock also
modified _rtw_join_timeout_handler() to use spin_[un]lock_irq()
instead of spin_[un]lock_bh().
_rtw_join_timeout_handler() calls rtw_do_join() which takes
pmlmepriv->scanned_queue.lock using spin_[un]lock_bh(). This
spin_unlock_bh() call re-enables softirqs which triggers an oops in
kernel/softirq.c: __local_bh_enable_ip() when it calls
lockdep_assert_irqs_enabled():
[ 244.506087] WARNING: CPU: 2 PID: 0 at kernel/softirq.c:376 __local_bh_enable_ip+0xa6/0x100
...
[ 244.509022] Call Trace:
[ 244.509048] <IRQ>
[ 244.509100] _rtw_join_timeout_handler+0x134/0x170 [r8723bs]
[ 244.509468] ? __pfx__rtw_join_timeout_handler+0x10/0x10 [r8723bs]
[ 244.509772] ? __pfx__rtw_join_timeout_handler+0x10/0x10 [r8723bs]
[ 244.510076] call_timer_fn+0x95/0x2a0
[ 244.510200] __run_timers.part.0+0x1da/0x2d0
This oops is causd by the switch to spin_[un]lock_irq() which disables
the IRQs for the entire duration of _rtw_join_timeout_handler().
Disabling the IRQs is not necessary since all code taking this lock
runs from either user contexts or from softirqs, switch back to
spin_[un]lock_bh() to fix this.
Fixes: 041879b12d ("drivers: staging: rtl8192bs: Fix deadlock in rtw_joinbss_event_prehandle()")
Cc: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230221145326.7808-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
They are appear to be spelling mistakes,
Initially identified in a codespell report and never been addressed so far.
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:656: regsiters ==> registers
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:1696: beacause ==> because
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:2092: Checl ==> Check
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:2513: checksume ==> checksum
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:2726: sequense ==> sequence
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:2780: vlaue ==> value
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:3409: equall ==> equal, equally
Signed-off-by: Anup Sharma <anupnewsmail@gmail.com>
Link: https://lore.kernel.org/r/Y61y+flJp9/jEicc@local
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
For structure iqk_matrix_regs_setting, only the "Value" member variable
is utilized whereas the other struct members are only declared but not
utilised. Replace the struct declaration and implementation by an
equivalent variable similar to the only used struct member variable.
While in there, update the macro mixed case names to uppercase style.
The resultant code is simpler and is easy to maintain.
Suggested-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Deepak R Varma <drv@mailo.com>
Link: https://lore.kernel.org/r/Y2ZF6O1KU3zZ6r3C@qemulion
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Simplify code by using min and max helper macros in place of lengthy
if/else block oriented logical evaluation and value assignment. This
issue is identified by coccicheck using the minmax.cocci file.
Signed-off-by: Deepak R Varma <drv@mailo.com>
Link: https://lore.kernel.org/r/Y2OK6fcIkH3S2/1f@qemulion
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Ternary statements that pick the min of two values can be replaced by
the macro min_t(). This improves readability, since its quicker to
understand min_t(type, x, y) than x < y ? x : y. Issue found by
coccicheck.
Signed-off-by: Emily Peri <eperi1024@gmail.com>
Link: https://lore.kernel.org/r/Y1wh1zYMAbbKSrGB@marshmallow
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove/add tabs in block statements in rtl8723bs/core to fix checkpatch
warnings for suspect code indent for conditionals.
Signed-off-by: Emily Peri <eperi1024@gmail.com>
Link: https://lore.kernel.org/r/Y1cH7br3mMcT4Dm5@marshmallow
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
checkpatch found extra tabs in two conditional statements in
rtw_ieee80211.c. Should be one tab instead of two.
Signed-off-by: Emily Peri <eperi1024@gmail.com>
Link: https://lore.kernel.org/r/Y1BQfiwOXzAZpCCa@marshmallow
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The variable efuseValue is being initialized with a value that is never
read. The variable is being re-assigned later on. The initialization is
redundant and can be removed.
Cleans up warning:
drivers/staging/rtl8723bs/core/rtw_efuse.c:285:6: warning: variable
'efuseValue' set but not used [-Wunused-but-set-variable]
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20221004153539.150867-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Here is the large set of staging driver changes for 6.1-rc1.
Nothing really interesting in here at all except we deleted a driver
(fwserial) as no one had been using it for a long time. Other than
that, just the normal cleanups and minor fixes:
- rtl8723bs driver cleanups
- loads of r8188eu driver cleanups, making the driver smaller and
fixing up some firmware dependency issues.
- vt6655 driver cleanups.
- lots of other small staging driver cleanups.
All of these have been in linux-next for a while with no reported
issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCY0GPBg8cZ3JlZ0Brcm9h
aC5jb20ACgkQMUfUDdst+ynd8gCeJS+vq6paXc/p8nMfz82Q87pn3SAAoKtCLeKa
k9ZtNB9ci3ws0E2mZFal
=3CGs
-----END PGP SIGNATURE-----
Merge tag 'staging-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
"Here is the large set of staging driver changes for 6.1-rc1.
Nothing really interesting in here at all except we deleted a driver
(fwserial) as no one had been using it for a long time. Other than
that, just the normal cleanups and minor fixes:
- rtl8723bs driver cleanups
- loads of r8188eu driver cleanups, making the driver smaller and
fixing up some firmware dependency issues.
- vt6655 driver cleanups.
- lots of other small staging driver cleanups.
All of these have been in linux-next for a while with no reported
issues"
* tag 'staging-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (266 commits)
staging: rtl8192e: Rename variable Bandwidth to avoid CamelCase
staging: r8188eu: remove PHY_RFConfig8188E()
staging: r8188eu: remove PHY_RF6052_Config8188E()
staging: r8188eu: convert ODM_ReadAndConfig_AGC_TAB_1T_8188E() to int
staging: r8188eu: convert ODM_ReadAndConfig_PHY_REG_1T_8188E() to int
staging: r8188eu: convert ODM_ReadAndConfig_RadioA_1T_8188E() to int
staging: r8188eu: convert ODM_ReadAndConfig_MAC_REG_8188E() to int
staging: rtl8192e: cmdpkt: Use skb_put_data() instead of skb_put/memcpy pair
staging: r8188eu: Use skb_put_data() instead of skb_put/memcpy pair
staging: r8188eu: remove hal/odm_RegConfig8188E.c
staging: r8188eu: make odm_ConfigRF_RadioA_8188E() static
staging: r8188eu: make odm_ConfigMAC_8188E() static
staging: r8188eu: don't check for stop/removal in the blink worker
staging: r8188eu: don't check bSurpriseRemoved in SwLedOff
staging: rtl8192e: Remove unused variables ForcedAMSDUMaxSize, ...
staging: rtl8192e: Rename CurrentMPDU..., ForcedAMPDU... and ForcedMPDU...
staging: rtl8192e: Rename SelfMimoPs, CurrentOpMode and bForcedShortGI
staging: rtl8192e: Rename PeerMimoPs, IOTAction and IOTRaFunc
staging: rtl8192e: Rename RxRe...WinSize, RxReorder... and RxReorderDr...
staging: rtl8192e: Rename szRT2RTAggBuffer, bRegRxRe... and bCurRxReo...
...