History log of /linux-master/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
Revision Date Author Comments
# 2f59ee3f 04-Aug-2023 Yang Yingliang <yangyingliang@huawei.com>

staging: rtl8723bs: use is_broadcast_ether_addr() instead of memcmp()

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>


# 6e006508 24-Oct-2022 Emily Peri <eperi1024@gmail.com>

staging: rtl8723bs: Fix indentation in conditional statements

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>


# 3c03b91a 19-Aug-2022 Nam Cao <namcaov@gmail.com>

staging: rtl8723bs: remove function rtw_get_ch_setting_union

because this function is not used.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nam Cao <namcaov@gmail.com>
Link: https://lore.kernel.org/r/c8c5b0c78ee9a4cd8304efeff22b51049c75a3f2.1660916523.git.namcaov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# aa64e956 19-Jun-2022 Daniel Watson <ozzloy@challenge-bot.com>

staging: rtl8723bs: remove trailing whitespace

remove trailing whitespace found by checkpatch

Signed-off-by: Daniel Watson <ozzloy@challenge-bot.com>
Link: https://lore.kernel.org/r/20220620054529.4019-1-ozzloy@challenge-bot.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ed42eb4b 04-Apr-2022 Sevinj Aghayeva <sevinj.aghayeva@gmail.com>

staging: rtl8723bs: fix indentation

Adhere to Linux kernel coding indentation style. Also remove the comments that
became irrelevant after fixing indentation.

Reported by checkpatch:

WARNING: suspect code indent for conditional statements

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/20220405161643.GA630826@euclid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 848448bf 04-Apr-2022 Sevinj Aghayeva <sevinj.aghayeva@gmail.com>

staging: rtl8723bs: remove space after function name

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: space prohibited between function name and open parenthesis

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/86494fef795f1c3e28c55e556d68b407dadd1488.1649128267.git.sevinj.aghayeva@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1663863a 04-Apr-2022 Sevinj Aghayeva <sevinj.aghayeva@gmail.com>

staging: rtl8723bs: remove redundant else branches

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: else is not generally useful after a break or return

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/fcb50e467d5ac81becf222379bcc21136966b86b.1649128267.git.sevinj.aghayeva@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3c22d177 04-Apr-2022 Sevinj Aghayeva <sevinj.aghayeva@gmail.com>

staging: rtl8723bs: remove return from a function returning void

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: void function return statements are not generally useful

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/d1aa09f34cd192e284048999ba8e20d26a224483.1649128267.git.sevinj.aghayeva@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 826fdfaf 04-Apr-2022 Sevinj Aghayeva <sevinj.aghayeva@gmail.com>

staging: rtl8723bs: remove redundant braces in if statements

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/5f3a013af7ca5ac02b4d680fa22a23049f5712db.1649128267.git.sevinj.aghayeva@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5cb47847 31-Mar-2022 Sevinj Aghayeva <sevinj.aghayeva@gmail.com>

staging: rtl8723bs: place constants on the right side of tests

Adhere to Linux kernel coding style.

Reported by checkpatch:

WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Link: https://lore.kernel.org/r/20220331122618.GA434796@euclid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f434708 02-Mar-2022 Hans de Goede <hdegoede@redhat.com>

staging: rtl8723bs: Fix access-point mode deadlock

Commit 54659ca026e5 ("staging: rtl8723bs: remove possible deadlock when
disconnect (v2)") split the locking of pxmitpriv->lock vs sleep_q/lock
into 2 locks in attempt to fix a lockdep reported issue with the locking
order of the sta_hash_lock vs pxmitpriv->lock.

But in the end this turned out to not fully solve the sta_hash_lock issue
so commit a7ac783c338b ("staging: rtl8723bs: remove a second possible
deadlock") was added to fix this in another way.

The original fix was kept as it was still seen as a good thing to have,
but now it turns out that it creates a deadlock in access-point mode:

[Feb20 23:47] ======================================================
[ +0.074085] WARNING: possible circular locking dependency detected
[ +0.074077] 5.16.0-1-amd64 #1 Tainted: G C E
[ +0.064710] ------------------------------------------------------
[ +0.074075] ksoftirqd/3/29 is trying to acquire lock:
[ +0.060542] ffffb8b30062ab00 (&pxmitpriv->lock){+.-.}-{2:2}, at: rtw_xmit_classifier+0x8a/0x140 [r8723bs]
[ +0.114921]
but task is already holding lock:
[ +0.069908] ffffb8b3007ab704 (&psta->sleep_q.lock){+.-.}-{2:2}, at: wakeup_sta_to_xmit+0x3b/0x300 [r8723bs]
[ +0.116976]
which lock already depends on the new lock.

[ +0.098037]
the existing dependency chain (in reverse order) is:
[ +0.089704]
-> #1 (&psta->sleep_q.lock){+.-.}-{2:2}:
[ +0.077232] _raw_spin_lock_bh+0x34/0x40
[ +0.053261] xmitframe_enqueue_for_sleeping_sta+0xc1/0x2f0 [r8723bs]
[ +0.082572] rtw_xmit+0x58b/0x940 [r8723bs]
[ +0.056528] _rtw_xmit_entry+0xba/0x350 [r8723bs]
[ +0.062755] dev_hard_start_xmit+0xf1/0x320
[ +0.056381] sch_direct_xmit+0x9e/0x360
[ +0.052212] __dev_queue_xmit+0xce4/0x1080
[ +0.055334] ip6_finish_output2+0x18f/0x6e0
[ +0.056378] ndisc_send_skb+0x2c8/0x870
[ +0.052209] ndisc_send_ns+0xd3/0x210
[ +0.050130] addrconf_dad_work+0x3df/0x5a0
[ +0.055338] process_one_work+0x274/0x5a0
[ +0.054296] worker_thread+0x52/0x3b0
[ +0.050124] kthread+0x16c/0x1a0
[ +0.044925] ret_from_fork+0x1f/0x30
[ +0.049092]
-> #0 (&pxmitpriv->lock){+.-.}-{2:2}:
[ +0.074101] __lock_acquire+0x10f5/0x1d80
[ +0.054298] lock_acquire+0xd7/0x300
[ +0.049088] _raw_spin_lock_bh+0x34/0x40
[ +0.053248] rtw_xmit_classifier+0x8a/0x140 [r8723bs]
[ +0.066949] rtw_xmitframe_enqueue+0xa/0x20 [r8723bs]
[ +0.066946] rtl8723bs_hal_xmitframe_enqueue+0x14/0x50 [r8723bs]
[ +0.078386] wakeup_sta_to_xmit+0xa6/0x300 [r8723bs]
[ +0.065903] rtw_recv_entry+0xe36/0x1160 [r8723bs]
[ +0.063809] rtl8723bs_recv_tasklet+0x349/0x6c0 [r8723bs]
[ +0.071093] tasklet_action_common.constprop.0+0xe5/0x110
[ +0.070966] __do_softirq+0x16f/0x50a
[ +0.050134] __irq_exit_rcu+0xeb/0x140
[ +0.051172] irq_exit_rcu+0xa/0x20
[ +0.047006] common_interrupt+0xb8/0xd0
[ +0.052214] asm_common_interrupt+0x1e/0x40
[ +0.056381] finish_task_switch.isra.0+0x100/0x3a0
[ +0.063670] __schedule+0x3ad/0xd20
[ +0.048047] schedule+0x4e/0xc0
[ +0.043880] smpboot_thread_fn+0xc4/0x220
[ +0.054298] kthread+0x16c/0x1a0
[ +0.044922] ret_from_fork+0x1f/0x30
[ +0.049088]
other info that might help us debug this:

[ +0.095950] Possible unsafe locking scenario:

[ +0.070952] CPU0 CPU1
[ +0.054282] ---- ----
[ +0.054285] lock(&psta->sleep_q.lock);
[ +0.047004] lock(&pxmitpriv->lock);
[ +0.074082] lock(&psta->sleep_q.lock);
[ +0.077209] lock(&pxmitpriv->lock);
[ +0.043873]
*** DEADLOCK ***

[ +0.070950] 1 lock held by ksoftirqd/3/29:
[ +0.049082] #0: ffffb8b3007ab704 (&psta->sleep_q.lock){+.-.}-{2:2}, at: wakeup_sta_to_xmit+0x3b/0x300 [r8723bs]

Analysis shows that in hindsight the splitting of the lock was not
a good idea, so revert this to fix the access-point mode deadlock.

Note this is a straight-forward revert done with git revert, the commented
out "/* spin_lock_bh(&psta_bmc->sleep_q.lock); */" lines were part of the
code before the reverted changes.

Fixes: 54659ca026e5 ("staging: rtl8723bs: remove possible deadlock when disconnect (v2)")
Cc: stable <stable@vger.kernel.org>
Cc: Fabio Aiuto <fabioaiuto83@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215542
Link: https://lore.kernel.org/r/20220302101637.26542-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 403aa62d 03-Oct-2021 Saurav Girepunje <saurav.girepunje@gmail.com>

staging: rtl8723bs: core: remove reassignment of same value to variable

Remove reassignment of same value to variable pstat->auth_seq.
On if (seq == 1) assigning the value 2. At the end of if statement
also assigning the value pstat->auth_seq = seq + 1 that is again
assigning the value 2.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVnX1HIYoisW621x@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d98f096c 03-Oct-2021 Saurav Girepunje <saurav.girepunje@gmail.com>

staging: rtl8723bs: core: remove condition never execute

Remove condition which never get execute.
as pattrib->mdata is always zero before if condition check.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
Link: https://lore.kernel.org/r/YVnTJCoz2qsXDXGc@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 42bdb41d 29-Sep-2021 Longji Guo <guolongji@uniontech.com>

staging: rtl8723bs: remove meaningless pstat->passoc_req check in OnAssocReq()

kfree(NULL) is safe and the check 'if (pstat->passoc_req)' before kfree
is not necessary.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Longji Guo <guolongji@uniontech.com>
Link: https://lore.kernel.org/r/20210929110613.29979-1-guolongji@uniontech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a7ac783c 20-Sep-2021 Hans de Goede <hdegoede@redhat.com>

staging: rtl8723bs: remove a second possible deadlock

Lockdep complains about rtw_free_assoc_resources() taking the sta_hash_lock
followed by it calling rtw_free_stainfo() which takes xmitpriv->lock.
While the rtl8723bs_xmit_thread takes the sta_hash_lock while already
holding the xmitpriv->lock:

[ 103.849756] ======================================================
[ 103.849761] WARNING: possible circular locking dependency detected
[ 103.849767] 5.15.0-rc1+ #470 Tainted: G C E
[ 103.849773] ------------------------------------------------------
[ 103.849776] wpa_supplicant/695 is trying to acquire lock:
[ 103.849781] ffffa5d0c0562b00 (&pxmitpriv->lock){+.-.}-{2:2}, at: rtw_free_stainfo+0x8a/0x510 [r8723bs]
[ 103.849840]
but task is already holding lock:
[ 103.849843] ffffa5d0c05636a8 (&pstapriv->sta_hash_lock){+.-.}-{2:2}, at: rtw_free_assoc_resources+0x48/0x110 [r8723bs]
[ 103.849881]
which lock already depends on the new lock.

[ 103.849884]
the existing dependency chain (in reverse order) is:
[ 103.849887]
-> #1 (&pstapriv->sta_hash_lock){+.-.}-{2:2}:
[ 103.849898] _raw_spin_lock_bh+0x34/0x40
[ 103.849913] rtw_get_stainfo+0x93/0x110 [r8723bs]
[ 103.849948] rtw_make_wlanhdr+0x14a/0x270 [r8723bs]
[ 103.849983] rtw_xmitframe_coalesce+0x5c/0x6c0 [r8723bs]
[ 103.850019] rtl8723bs_xmit_thread+0x4ac/0x620 [r8723bs]
[ 103.850050] kthread+0x143/0x160
[ 103.850058] ret_from_fork+0x22/0x30
[ 103.850067]
-> #0 (&pxmitpriv->lock){+.-.}-{2:2}:
[ 103.850077] __lock_acquire+0x1158/0x1de0
[ 103.850084] lock_acquire+0xb5/0x2b0
[ 103.850090] _raw_spin_lock_bh+0x34/0x40
[ 103.850095] rtw_free_stainfo+0x8a/0x510 [r8723bs]
[ 103.850130] rtw_free_assoc_resources+0x53/0x110 [r8723bs]
[ 103.850159] PHY_IQCalibrate_8723B+0x122b/0x36a0 [r8723bs]
[ 103.850189] cfg80211_disconnect+0x173/0x320 [cfg80211]
[ 103.850331] nl80211_disconnect+0x6e/0xb0 [cfg80211]
[ 103.850422] genl_family_rcv_msg_doit+0xcd/0x110
[ 103.850430] genl_rcv_msg+0xce/0x1c0
[ 103.850435] netlink_rcv_skb+0x50/0xf0
[ 103.850441] genl_rcv+0x24/0x40
[ 103.850446] netlink_unicast+0x16d/0x230
[ 103.850452] netlink_sendmsg+0x22b/0x450
[ 103.850457] sock_sendmsg+0x5e/0x60
[ 103.850465] ____sys_sendmsg+0x22f/0x270
[ 103.850472] ___sys_sendmsg+0x81/0xc0
[ 103.850479] __sys_sendmsg+0x49/0x80
[ 103.850485] do_syscall_64+0x3b/0x90
[ 103.850493] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 103.850500]
other info that might help us debug this:

[ 103.850504] Possible unsafe locking scenario:

[ 103.850507] CPU0 CPU1
[ 103.850510] ---- ----
[ 103.850512] lock(&pstapriv->sta_hash_lock);
[ 103.850518] lock(&pxmitpriv->lock);
[ 103.850524] lock(&pstapriv->sta_hash_lock);
[ 103.850530] lock(&pxmitpriv->lock);
[ 103.850535]
*** DEADLOCK ***

Push the taking of sta_hash_lock down into rtw_free_stainfo(),
where the critical section is, this allows taking the lock after
rtw_free_stainfo() has released pxmitpriv->lock.

This requires changing rtw_free_all_stainfo() so that it does its freeing
in 2 steps, first moving all stainfo-s to free to a local list while
holding the sta_hash_lock and then walking that list to call
rtw_free_stainfo() on them without holding the sta_hash_lock.

Pushing the taking of sta_hash_lock down into rtw_free_stainfo(),
also fixes a whole bunch of callers of rtw_free_stainfo() which
were not holding that lock even though they should.

Note that this also fixes the deadlock from the "remove possible
deadlock when disconnect" patch in a different way. But the
changes from that patch offer a nice locking cleanup regardless.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210920145502.155454-2-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 54659ca0 20-Sep-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove possible deadlock when disconnect (v2)

when turning off a connection, lockdep complains with the
following warning (a modprobe has been done but the same
happens with a disconnection from NetworkManager,
it's enough to trigger a cfg80211_disconnect call):

[ 682.855867] ======================================================
[ 682.855877] WARNING: possible circular locking dependency detected
[ 682.855887] 5.14.0-rc6+ #16 Tainted: G C OE
[ 682.855898] ------------------------------------------------------
[ 682.855906] modprobe/1770 is trying to acquire lock:
[ 682.855916] ffffb6d000332b00 (&pxmitpriv->lock){+.-.}-{2:2},
at: rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.856073]
but task is already holding lock:
[ 682.856081] ffffb6d0003336a8 (&pstapriv->sta_hash_lock){+.-.}-{2:2},
at: rtw_free_assoc_resources+0x48/0x110 [r8723bs]
[ 682.856207]
which lock already depends on the new lock.

[ 682.856215]
the existing dependency chain (in reverse order) is:
[ 682.856223]
-> #1 (&pstapriv->sta_hash_lock){+.-.}-{2:2}:
[ 682.856247] _raw_spin_lock_bh+0x34/0x40
[ 682.856265] rtw_get_stainfo+0x9a/0x110 [r8723bs]
[ 682.856389] rtw_xmit_classifier+0x27/0x130 [r8723bs]
[ 682.856515] rtw_xmitframe_enqueue+0xa/0x20 [r8723bs]
[ 682.856642] rtl8723bs_hal_xmit+0x3b/0xb0 [r8723bs]
[ 682.856752] rtw_xmit+0x4ef/0x890 [r8723bs]
[ 682.856879] _rtw_xmit_entry+0xba/0x350 [r8723bs]
[ 682.856981] dev_hard_start_xmit+0xee/0x320
[ 682.856999] sch_direct_xmit+0x8c/0x330
[ 682.857014] __dev_queue_xmit+0xba5/0xf00
[ 682.857030] packet_sendmsg+0x981/0x1b80
[ 682.857047] sock_sendmsg+0x5b/0x60
[ 682.857060] __sys_sendto+0xf1/0x160
[ 682.857073] __x64_sys_sendto+0x24/0x30
[ 682.857087] do_syscall_64+0x3a/0x80
[ 682.857102] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 682.857117]
-> #0 (&pxmitpriv->lock){+.-.}-{2:2}:
[ 682.857142] __lock_acquire+0xfd9/0x1b50
[ 682.857158] lock_acquire+0xb4/0x2c0
[ 682.857172] _raw_spin_lock_bh+0x34/0x40
[ 682.857185] rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.857308] rtw_free_assoc_resources+0x53/0x110 [r8723bs]
[ 682.857415] cfg80211_rtw_disconnect+0x4b/0x70 [r8723bs]
[ 682.857522] cfg80211_disconnect+0x12e/0x2f0 [cfg80211]
[ 682.857759] cfg80211_leave+0x2b/0x40 [cfg80211]
[ 682.857961] cfg80211_netdev_notifier_call+0xa9/0x560 [cfg80211]
[ 682.858163] raw_notifier_call_chain+0x41/0x50
[ 682.858180] __dev_close_many+0x62/0x100
[ 682.858195] dev_close_many+0x7d/0x120
[ 682.858209] unregister_netdevice_many+0x416/0x680
[ 682.858225] unregister_netdevice_queue+0xab/0xf0
[ 682.858240] unregister_netdev+0x18/0x20
[ 682.858255] rtw_unregister_netdevs+0x28/0x40 [r8723bs]
[ 682.858360] rtw_dev_remove+0x24/0xd0 [r8723bs]
[ 682.858463] sdio_bus_remove+0x31/0xd0 [mmc_core]
[ 682.858532] device_release_driver_internal+0xf7/0x1d0
[ 682.858550] driver_detach+0x47/0x90
[ 682.858564] bus_remove_driver+0x77/0xd0
[ 682.858579] rtw_drv_halt+0xc/0x678 [r8723bs]
[ 682.858685] __x64_sys_delete_module+0x13f/0x250
[ 682.858699] do_syscall_64+0x3a/0x80
[ 682.858715] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 682.858729]
other info that might help us debug this:

[ 682.858737] Possible unsafe locking scenario:

[ 682.858744] CPU0 CPU1
[ 682.858751] ---- ----
[ 682.858758] lock(&pstapriv->sta_hash_lock);
[ 682.858772] lock(&pxmitpriv->lock);
[ 682.858786] lock(&pstapriv->sta_hash_lock);
[ 682.858799] lock(&pxmitpriv->lock);
[ 682.858812]
*** DEADLOCK ***

[ 682.858820] 5 locks held by modprobe/1770:
[ 682.858831] #0: ffff8d870697d980 (&dev->mutex){....}-{3:3},
at: device_release_driver_internal+0x1a/0x1d0
[ 682.858869] #1: ffffffffbdbbf1c8 (rtnl_mutex){+.+.}-{3:3},
at: unregister_netdev+0xe/0x20
[ 682.858906] #2: ffff8d87054ee5e8 (&rdev->wiphy.mtx){+.+.}-{3:3},
at: cfg80211_netdev_notifier_call+0x9e/0x560 [cfg80211]
[ 682.859131] #3: ffff8d870f2bc8f0 (&wdev->mtx){+.+.}-{3:3},
at: cfg80211_leave+0x20/0x40 [cfg80211]
[ 682.859354] #4: ffffb6d0003336a8 (&pstapriv->sta_hash_lock){+.-.}-{2:2},
at: rtw_free_assoc_resources+0x48/0x110 [r8723bs]
[ 682.859482]
stack backtrace:
[ 682.859491] CPU: 1 PID: 1770 Comm: modprobe Tainted: G
C OE 5.14.0-rc6+ #16
[ 682.859507] Hardware name: LENOVO 80NR/Madrid, BIOS DACN25WW 08/20/2015
[ 682.859517] Call Trace:
[ 682.859531] dump_stack_lvl+0x56/0x6f
[ 682.859551] check_noncircular+0xdb/0xf0
[ 682.859579] __lock_acquire+0xfd9/0x1b50
[ 682.859606] lock_acquire+0xb4/0x2c0
[ 682.859623] ? rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.859752] ? mark_held_locks+0x48/0x70
[ 682.859769] ? rtw_free_stainfo+0x4a/0x4a0 [r8723bs]
[ 682.859898] _raw_spin_lock_bh+0x34/0x40
[ 682.859914] ? rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.860039] rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.860171] rtw_free_assoc_resources+0x53/0x110 [r8723bs]
[ 682.860286] cfg80211_rtw_disconnect+0x4b/0x70 [r8723bs]
[ 682.860397] cfg80211_disconnect+0x12e/0x2f0 [cfg80211]
[ 682.860629] cfg80211_leave+0x2b/0x40 [cfg80211]
[ 682.860836] cfg80211_netdev_notifier_call+0xa9/0x560 [cfg80211]
[ 682.861048] ? __lock_acquire+0x4dc/0x1b50
[ 682.861070] ? lock_is_held_type+0xa8/0x110
[ 682.861089] ? lock_is_held_type+0xa8/0x110
[ 682.861104] ? find_held_lock+0x2d/0x90
[ 682.861120] ? packet_notifier+0x173/0x300
[ 682.861141] ? lock_release+0xb3/0x250
[ 682.861160] ? packet_notifier+0x192/0x300
[ 682.861184] raw_notifier_call_chain+0x41/0x50
[ 682.861205] __dev_close_many+0x62/0x100
[ 682.861224] dev_close_many+0x7d/0x120
[ 682.861245] unregister_netdevice_many+0x416/0x680
[ 682.861264] ? find_held_lock+0x2d/0x90
[ 682.861284] unregister_netdevice_queue+0xab/0xf0
[ 682.861306] unregister_netdev+0x18/0x20
[ 682.861325] rtw_unregister_netdevs+0x28/0x40 [r8723bs]
[ 682.861434] rtw_dev_remove+0x24/0xd0 [r8723bs]
[ 682.861542] sdio_bus_remove+0x31/0xd0 [mmc_core]
[ 682.861615] device_release_driver_internal+0xf7/0x1d0
[ 682.861637] driver_detach+0x47/0x90
[ 682.861656] bus_remove_driver+0x77/0xd0
[ 682.861674] rtw_drv_halt+0xc/0x678 [r8723bs]
[ 682.861782] __x64_sys_delete_module+0x13f/0x250
[ 682.861801] ? lockdep_hardirqs_on_prepare+0xf3/0x170
[ 682.861817] ? syscall_enter_from_user_mode+0x20/0x70
[ 682.861836] do_syscall_64+0x3a/0x80
[ 682.861855] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 682.861873] RIP: 0033:0x7f6dbe85400b
[ 682.861890] Code: 73 01 c3 48 8b 0d 6d 1e 0c 00 f7 d8 64 89
01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 3d
1e 0c 00 f7 d8 64 89 01 48
[ 682.861906] RSP: 002b:00007ffe7a82f538 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 682.861923] RAX: ffffffffffffffda RBX: 000055a64693bd20 RCX: 00007f6dbe85400b
[ 682.861935] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 000055a64693bd88
[ 682.861946] RBP: 000055a64693bd20 R08: 0000000000000000 R09: 0000000000000000
[ 682.861957] R10: 00007f6dbe8c7ac0 R11: 0000000000000206 R12: 000055a64693bd88
[ 682.861967] R13: 0000000000000000 R14: 000055a64693bd88 R15: 00007ffe7a831848

This happens because when we enqueue a frame for
transmission we do it under xmit_priv lock, then calling
rtw_get_stainfo (needed for enqueuing) takes sta_hash_lock
and this leads to the following lock dependency:

xmit_priv->lock -> sta_hash_lock

Turning off a connection will bring to call
rtw_free_assoc_resources which will set up
the inverse dependency:

sta_hash_lock -> xmit_priv_lock

This could lead to a deadlock as lockdep complains.

Fix it by removing the xmit_priv->lock around
rtw_xmitframe_enqueue call inside rtl8723bs_hal_xmit
and put it in a smaller critical section inside
rtw_xmit_classifier, the only place where
xmit_priv data are actually accessed.

Replace spin_{lock,unlock}_bh(pxmitpriv->lock)
in other tx paths leading to rtw_xmitframe_enqueue
call with spin_{lock,unlock}_bh(psta->sleep_q.lock)
- it's not clear why accessing a sleep_q was protected
by a spinlock on xmitpriv->lock.

This way is avoided the same faulty lock nesting
order.

Extra changes in v2 by Hans de Goede:
-Lift the taking of the struct __queue.lock spinlock out of
rtw_free_xmitframe_queue() into the callers this allows also
protecting a bunch of related state in rtw_free_stainfo():
-Protect psta->sleepq_len on rtw_free_xmitframe_queue(&psta->sleep_q);
-Protect struct tx_servq.tx_pending and tx_servq.qcnt when
calling rtw_free_xmitframe_queue(&tx_servq.sta_pending)
-This also allows moving the spin_lock_bh(&pxmitpriv->lock); to below
the sleep_q free-ing code, avoiding another ABBA locking issue

CC: Larry Finger <Larry.Finger@lwfinger.net>
Co-developed-by: Hans de Goede <hdegoede@redhat.com>
Tested-on: Lenovo Ideapad MiiX 300-10IBY
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210920145502.155454-1-hdegoede@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ea2054ba 17-Sep-2021 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Revert "staging: rtl8723bs: remove possible deadlock when disconnect"

This reverts commit 78a1614a81f06032055a25b7acd9965a81196433.

There's been attempts to fix this, but it's not quite right yet, so just
remove the original commit.

Link: https://lore.kernel.org/r/20210913130346.2390-1-fabioaiuto83@gmail.com
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Fabio Aiuto <fabioaiuto83@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 78a1614a 02-Sep-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove possible deadlock when disconnect

when turning off a connection, lockdep complains with the
following warning (a modprobe has been done but the same
happens with a disconnection from NetworkManager,
it's enough to trigger a cfg80211_disconnect call):

[ 682.855867] ======================================================
[ 682.855877] WARNING: possible circular locking dependency detected
[ 682.855887] 5.14.0-rc6+ #16 Tainted: G C OE
[ 682.855898] ------------------------------------------------------
[ 682.855906] modprobe/1770 is trying to acquire lock:
[ 682.855916] ffffb6d000332b00 (&pxmitpriv->lock){+.-.}-{2:2},
at: rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.856073]
but task is already holding lock:
[ 682.856081] ffffb6d0003336a8 (&pstapriv->sta_hash_lock){+.-.}-{2:2},
at: rtw_free_assoc_resources+0x48/0x110 [r8723bs]
[ 682.856207]
which lock already depends on the new lock.

[ 682.856215]
the existing dependency chain (in reverse order) is:
[ 682.856223]
-> #1 (&pstapriv->sta_hash_lock){+.-.}-{2:2}:
[ 682.856247] _raw_spin_lock_bh+0x34/0x40
[ 682.856265] rtw_get_stainfo+0x9a/0x110 [r8723bs]
[ 682.856389] rtw_xmit_classifier+0x27/0x130 [r8723bs]
[ 682.856515] rtw_xmitframe_enqueue+0xa/0x20 [r8723bs]
[ 682.856642] rtl8723bs_hal_xmit+0x3b/0xb0 [r8723bs]
[ 682.856752] rtw_xmit+0x4ef/0x890 [r8723bs]
[ 682.856879] _rtw_xmit_entry+0xba/0x350 [r8723bs]
[ 682.856981] dev_hard_start_xmit+0xee/0x320
[ 682.856999] sch_direct_xmit+0x8c/0x330
[ 682.857014] __dev_queue_xmit+0xba5/0xf00
[ 682.857030] packet_sendmsg+0x981/0x1b80
[ 682.857047] sock_sendmsg+0x5b/0x60
[ 682.857060] __sys_sendto+0xf1/0x160
[ 682.857073] __x64_sys_sendto+0x24/0x30
[ 682.857087] do_syscall_64+0x3a/0x80
[ 682.857102] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 682.857117]
-> #0 (&pxmitpriv->lock){+.-.}-{2:2}:
[ 682.857142] __lock_acquire+0xfd9/0x1b50
[ 682.857158] lock_acquire+0xb4/0x2c0
[ 682.857172] _raw_spin_lock_bh+0x34/0x40
[ 682.857185] rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.857308] rtw_free_assoc_resources+0x53/0x110 [r8723bs]
[ 682.857415] cfg80211_rtw_disconnect+0x4b/0x70 [r8723bs]
[ 682.857522] cfg80211_disconnect+0x12e/0x2f0 [cfg80211]
[ 682.857759] cfg80211_leave+0x2b/0x40 [cfg80211]
[ 682.857961] cfg80211_netdev_notifier_call+0xa9/0x560 [cfg80211]
[ 682.858163] raw_notifier_call_chain+0x41/0x50
[ 682.858180] __dev_close_many+0x62/0x100
[ 682.858195] dev_close_many+0x7d/0x120
[ 682.858209] unregister_netdevice_many+0x416/0x680
[ 682.858225] unregister_netdevice_queue+0xab/0xf0
[ 682.858240] unregister_netdev+0x18/0x20
[ 682.858255] rtw_unregister_netdevs+0x28/0x40 [r8723bs]
[ 682.858360] rtw_dev_remove+0x24/0xd0 [r8723bs]
[ 682.858463] sdio_bus_remove+0x31/0xd0 [mmc_core]
[ 682.858532] device_release_driver_internal+0xf7/0x1d0
[ 682.858550] driver_detach+0x47/0x90
[ 682.858564] bus_remove_driver+0x77/0xd0
[ 682.858579] rtw_drv_halt+0xc/0x678 [r8723bs]
[ 682.858685] __x64_sys_delete_module+0x13f/0x250
[ 682.858699] do_syscall_64+0x3a/0x80
[ 682.858715] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 682.858729]
other info that might help us debug this:

[ 682.858737] Possible unsafe locking scenario:

[ 682.858744] CPU0 CPU1
[ 682.858751] ---- ----
[ 682.858758] lock(&pstapriv->sta_hash_lock);
[ 682.858772] lock(&pxmitpriv->lock);
[ 682.858786] lock(&pstapriv->sta_hash_lock);
[ 682.858799] lock(&pxmitpriv->lock);
[ 682.858812]
*** DEADLOCK ***

[ 682.858820] 5 locks held by modprobe/1770:
[ 682.858831] #0: ffff8d870697d980 (&dev->mutex){....}-{3:3},
at: device_release_driver_internal+0x1a/0x1d0
[ 682.858869] #1: ffffffffbdbbf1c8 (rtnl_mutex){+.+.}-{3:3},
at: unregister_netdev+0xe/0x20
[ 682.858906] #2: ffff8d87054ee5e8 (&rdev->wiphy.mtx){+.+.}-{3:3},
at: cfg80211_netdev_notifier_call+0x9e/0x560 [cfg80211]
[ 682.859131] #3: ffff8d870f2bc8f0 (&wdev->mtx){+.+.}-{3:3},
at: cfg80211_leave+0x20/0x40 [cfg80211]
[ 682.859354] #4: ffffb6d0003336a8 (&pstapriv->sta_hash_lock){+.-.}-{2:2},
at: rtw_free_assoc_resources+0x48/0x110 [r8723bs]
[ 682.859482]
stack backtrace:
[ 682.859491] CPU: 1 PID: 1770 Comm: modprobe Tainted: G
C OE 5.14.0-rc6+ #16
[ 682.859507] Hardware name: LENOVO 80NR/Madrid, BIOS DACN25WW 08/20/2015
[ 682.859517] Call Trace:
[ 682.859531] dump_stack_lvl+0x56/0x6f
[ 682.859551] check_noncircular+0xdb/0xf0
[ 682.859579] __lock_acquire+0xfd9/0x1b50
[ 682.859606] lock_acquire+0xb4/0x2c0
[ 682.859623] ? rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.859752] ? mark_held_locks+0x48/0x70
[ 682.859769] ? rtw_free_stainfo+0x4a/0x4a0 [r8723bs]
[ 682.859898] _raw_spin_lock_bh+0x34/0x40
[ 682.859914] ? rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.860039] rtw_free_stainfo+0x52/0x4a0 [r8723bs]
[ 682.860171] rtw_free_assoc_resources+0x53/0x110 [r8723bs]
[ 682.860286] cfg80211_rtw_disconnect+0x4b/0x70 [r8723bs]
[ 682.860397] cfg80211_disconnect+0x12e/0x2f0 [cfg80211]
[ 682.860629] cfg80211_leave+0x2b/0x40 [cfg80211]
[ 682.860836] cfg80211_netdev_notifier_call+0xa9/0x560 [cfg80211]
[ 682.861048] ? __lock_acquire+0x4dc/0x1b50
[ 682.861070] ? lock_is_held_type+0xa8/0x110
[ 682.861089] ? lock_is_held_type+0xa8/0x110
[ 682.861104] ? find_held_lock+0x2d/0x90
[ 682.861120] ? packet_notifier+0x173/0x300
[ 682.861141] ? lock_release+0xb3/0x250
[ 682.861160] ? packet_notifier+0x192/0x300
[ 682.861184] raw_notifier_call_chain+0x41/0x50
[ 682.861205] __dev_close_many+0x62/0x100
[ 682.861224] dev_close_many+0x7d/0x120
[ 682.861245] unregister_netdevice_many+0x416/0x680
[ 682.861264] ? find_held_lock+0x2d/0x90
[ 682.861284] unregister_netdevice_queue+0xab/0xf0
[ 682.861306] unregister_netdev+0x18/0x20
[ 682.861325] rtw_unregister_netdevs+0x28/0x40 [r8723bs]
[ 682.861434] rtw_dev_remove+0x24/0xd0 [r8723bs]
[ 682.861542] sdio_bus_remove+0x31/0xd0 [mmc_core]
[ 682.861615] device_release_driver_internal+0xf7/0x1d0
[ 682.861637] driver_detach+0x47/0x90
[ 682.861656] bus_remove_driver+0x77/0xd0
[ 682.861674] rtw_drv_halt+0xc/0x678 [r8723bs]
[ 682.861782] __x64_sys_delete_module+0x13f/0x250
[ 682.861801] ? lockdep_hardirqs_on_prepare+0xf3/0x170
[ 682.861817] ? syscall_enter_from_user_mode+0x20/0x70
[ 682.861836] do_syscall_64+0x3a/0x80
[ 682.861855] entry_SYSCALL_64_after_hwframe+0x44/0xae
[ 682.861873] RIP: 0033:0x7f6dbe85400b
[ 682.861890] Code: 73 01 c3 48 8b 0d 6d 1e 0c 00 f7 d8 64 89
01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa
b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 3d
1e 0c 00 f7 d8 64 89 01 48
[ 682.861906] RSP: 002b:00007ffe7a82f538 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
[ 682.861923] RAX: ffffffffffffffda RBX: 000055a64693bd20 RCX: 00007f6dbe85400b
[ 682.861935] RDX: 0000000000000000 RSI: 0000000000000800 RDI: 000055a64693bd88
[ 682.861946] RBP: 000055a64693bd20 R08: 0000000000000000 R09: 0000000000000000
[ 682.861957] R10: 00007f6dbe8c7ac0 R11: 0000000000000206 R12: 000055a64693bd88
[ 682.861967] R13: 0000000000000000 R14: 000055a64693bd88 R15: 00007ffe7a831848

This happens because when we enqueue a frame for
transmission we do it under xmit_priv lock, then calling
rtw_get_stainfo (needed for enqueuing) takes sta_hash_lock
and this leads to the following lock dependency:

xmit_priv->lock -> sta_hash_lock

Turning off a connection will bring to call
rtw_free_assoc_resources which will set up
the inverse dependency:

sta_hash_lock -> xmit_priv_lock

This could lead to a deadlock as lockdep complains.

Fix it by removing the xmit_priv->lock around
rtw_xmitframe_enqueue call inside rtl8723bs_hal_xmit
and put it in a smaller critical section inside
rtw_xmit_classifier, the only place where
xmit_priv data are actually accessed.

Replace spin_{lock,unlock}_bh(pxmitpriv->lock)
in other tx paths leading to rtw_xmitframe_enqueue
call with spin_{lock,unlock}_bh(psta->sleep_q.lock)
- it's not clear why accessing a sleep_q was protected
by a spinlock on xmitpriv->lock.

This way is avoided the same faulty lock nesting
order.

CC: Larry Finger <Larry.Finger@lwfinger.net>
Tested-on: Lenovo Ideapad MiiX 300-10IBY
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210902093559.9779-1-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cd1f1450 29-Aug-2021 Michael Straube <straube.linux@gmail.com>

staging: rtl8723bs: clean up comparsions to NULL

Clean up comparsions to NULL reported by checkpatch.

x == NULL -> !x
x != NULL -> x

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210829154533.11054-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 76ac3b19 30-Jul-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: fix camel case issue in struct wlan_bssid_ex

fix camel case issue in field Reserved in struct wlan_bssid_ex

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/a70fd91a46fd2c75eb27824ea57ae0d87d65bf81.1627656773.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 61ba4fae 21-Jul-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: fix camel case in IE structures

fix camel case in IE structures all over the driver.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c1b36466fb5e17aa0dbbcdf6dfef3a82f9739c00.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 631f42e9 21-Jul-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: fix camel case in struct wlan_phy_info

fix camel case in struct wlan_phy_info all over the driver.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/caadcfc157d62b633fd757d5696c1abce5ef9ae9.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6994aa43 21-Jul-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: fix camel case in struct ndis_802_11_ssid

fix camel case in struct ndis_802_11_ssid all over the driver.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/e7c4cc09840e112d59ed7dcf8465f1916f95b819.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d8b322b6 21-Jul-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: fix camel case in struct ndis_802_11_conf

fix camel case in struct ndis_802_11_conf

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/90317df66de1476515bf46477ac097a73f35cf81.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d3fcee1b 21-Jul-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: fix camel case in struct wlan_bssid_ex

fix camel case in struct wlan_bssid_ex.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/561065e95ff38f0dbedf030c3acf0498396a1759.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ddd7c8b0 21-Jul-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove 5Ghz code blocks

remove 5 Ghz code blocks, related to networks
working over channel numbers above 14.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c64443b92ce1a60f568db153842a62e3244a8c3a.1626874164.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 198e84ae 17-Jul-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: fix camel case name in macro IsSupported24G

fix camel case name in macro IsSupported24G

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/fd5e1873f72e7d5f72b6f4bf801ede882e9df4e2.1626533647.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fc2cda0f 22-Jun-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove VHT dead code

remove VHT dead code, as the device doesn't support
VHT (which is a 802.11ac capability).

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2ca4be24e401bd862a96e2641a9b0377be36a25d.1624367072.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ec84d0ae 22-Jun-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove 5Ghz code related to channel plan definition

remove 5Ghz code related to channel plan definition.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/17a707952cec951893748d2cb59d02a294cdd1be.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c659a468 22-Jun-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove struct rt_channel_plan_5g

remove struct rt_channel_plan_5g, for rtl8723bs works
only on 2.4Ghz band.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c9780328291ef84a8b0874e34da881d5e3885ddc.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 708180a9 22-Jun-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove all 5Ghz network types

remove all 5Ghz network types. rtl8723bs works on
802.11bgn standards and on 2.4Ghz band.

So remove all code related to 802.11a and 802.11ac
standards, which the device doesn't support.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/7e4644a71d0ba2819370171b3dc78bfc755f6313.1624367071.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3b0a4a1b 16-Jun-2021 Yang Yingliang <yangyingliang@huawei.com>

staging: rtl8723bs: core: 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.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210616081243.2511663-3-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3c67430b 07-Jun-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: use list_for_each_safe in loops deleting iterated items

Fix some beautified loops over linked lists.
Use list_for_each_safe on loops which could delete
objects in the list.

Fixes: b3cd518c5abd ("staging: rtl8723bs: Use list iterators and helpers")
Suggested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210607134618.11237-1-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6a80a7ab 31-May-2021 Yu Kuai <yukuai3@huawei.com>

staging: rtl8723bs: core: rtw_mlme_ext.c: remove deadcode

'CHECK_EVENT_SEQ' is not defined anywhere, remove the deadcode.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20210531140234.3352465-1-yukuai3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f57e6d91 24-May-2021 Fabio M. De Francesco <fmdefrancesco@gmail.com>

staging: rtl8723bs: core: rtw_mlme_ext.c: Remove set but unused variable

Removed set but unused 'reason_code' variable. Issue detected by GCC
running with the warning option -Wunused-but-set-variable.

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210524113433.25923-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5f8e9aff 13-May-2021 Bryan Brattlof <hello@bryanbrattlof.com>

staging: rtl8723bs: remove unused argument 'msg'

After the removal of the DBG_871X macros, the 'msg' argument
for rtw_sctx_wait() is no longer used.

Signed-off-by: Bryan Brattlof <hello@bryanbrattlof.com>
Link: https://lore.kernel.org/r/20210513160848.1057564-1-hello@bryanbrattlof.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 76dfbca4 12-May-2021 Fabio M. De Francesco <fmdefrancesco@gmail.com>

staging: rtl8723bs: core: Remove unnecessary lines of code

Removed unnecessary lines of code inside an "else if" block.
That code acquires a spinlock and iterates over each item in
a linked list for no purpose.

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210512153208.9584-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b3cd518c 28-Apr-2021 Guenter Roeck <linux@roeck-us.net>

staging: rtl8723bs: Use list iterators and helpers

The rtl8723bs driver manually re-implements list helper functions
and macros in various ways. Replace with existing list helpers.

The following coccinelle script was used to convert the code.

@@
identifier v1, v2, v3, v4;
symbol next;
expression e;
iterator name list_for_each;
statement S;
@@

<+...
(
- e = v1->next;
|
- e = get_next(v1);
)
... when != e
- while ( \( v1 != e \| e != v1 \) )
+ list_for_each (e, v1)
{
...
- v2 = container_of(e, struct v3, v4);
+ v2 = list_entry(e, struct v3, v4);
?- if (!v2) S
...
(
- e = e->next;
|
- e = get_next(e);
)
... when != e
}
...+>

@@
identifier v1, v2, v3, v4;
symbol next;
expression e;
iterator name list_for_each;
statement S;
@@

<+...
(
- e = v1->next;
|
- e = get_next(v1);
)
... when != e
- while (1)
+ list_for_each (e, v1)
{
- if ( \( e == v1 \| v1 == e \) )
- break;
...
- v2 = container_of(e, struct v3, v4);
+ v2 = list_entry(e, struct v3, v4);
?- if (!v2) S
...
(
- e = e->next;
|
- e = get_next(e);
)
... when != e
}
...+>

Manually fixed up formatting, and added auto-removed comments back in.
Compile tested only.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210428173301.149619-1-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5e7106f6 30-Apr-2021 Fabio M. De Francesco <fmdefrancesco@gmail.com>

staging: rtl8723bs: core: Remove set but unused variable

Removed set but unused variable. Issue detected by gcc.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210430095319.23226-3-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cab77590 28-Apr-2021 Saurav Girepunje <saurav.girepunje@gmail.com>

staging: rtl8723bs: core: remove unneeded variable

Below are the changes:

Remove unneeded variable "u8 *pbuf" from function start_bss_network
argument as this can be get from first argument "padapter"

Remove the struct wlan_bssid_ex *network from createbss_hdl function
as this is only used to pass as second argument to start_bss_network()

Remove the struct mlme_priv *mlmepriv from rtw_ap_restore_network
function as this is only used to pass as second argument
to start_bss_network()

Signed-off-by: Saurav Girepunje <saurav.girepunje@google.com>
Link: https://lore.kernel.org/r/20210428154011.GA5571@user
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c0b8b55c 24-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove debug macros related to core/rtw_mlme_ext.c tracing

remove debug macro definitions related to core/rtw_mlme_ext.c
obsolete tracing.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/1579e958f5aa4584f6477a5b7c9bc3bd8933a5f7.1619254603.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ffc49b55 24-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: move static array definition from header to .c file

move static array definition from header to .c file.
This prepare removal of a conditional compile block
_RTW_MLME_EXT_C_.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/665c9d33a97954508ca9257850a5690afcf0a9a9.1619254603.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 705655a2 14-Apr-2021 Lee Jones <lee.jones@linaro.org>

staging: rtl8723bs: core: rtw_mlme_ext: Move very large data buffer onto the heap

Fixes the following W=1 kernel build warning(s):

drivers/staging/rtl8723bs/core/rtw_mlme_ext.c: In function ‘issue_probersp’:
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2543:1: warning: the frame size of 1096 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-staging@lists.linux.dev
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20210414181129.1628598-54-lee.jones@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 98dc1208 14-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: split too long line

fix the following post-commit hook checkpatch issue.

WARNING: line length of 103 exceeds 100 columns
30: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:711:
+
receive_disconnect(padapter, pmlmeinfo->network.MacAddress, 0);

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/4e87fb741205b9f314aec739921405a7ebef908a.1618480688.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5a94f5c8 14-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: fix indentation in if block

fix following post-commit hook checkpatch issues:

WARNING: suspect code indent for conditional statements (32, 48)
323: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:708:
if (!ret) {
+
netdev_dbg(padapter->pnetdev,

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/7f548510ebe2427e85f3fe8b33ed937160c64e9f.1618480688.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 79df841b 14-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: replace DBG_871X_LEVEL logs with netdev_*()

Replace DBG_871X_LEVEL logs with netdev_*() functions
where possible (i.e. where a pointer to netdev is easily
available).

This is not possible in correspondance of redundant
log in module initialization.

So remove those ones.

DBG_871X_LEVEL macro wraps a raw printk call which is not
recommended in a device driver context, prefer using
netdev_*() log functions.

The remove/replace operation has been done with the
following semantic patch script:

@@
expression list args;
identifier padapter;
identifier func;
symbol _drv_always_, _drv_info_, _drv_warning_;
symbol _drv_err_, _drv_emerg_;
@@

func(..., struct adapter *padapter, ...) {
<...
(
- DBG_871X_LEVEL(_drv_always_, args);
+ netdev_dbg(padapter->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_info_, args);
+ netdev_info(padapter->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_warning_, args);
+ netdev_warn(padapter->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_err_, args);
+ netdev_err(padapter->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_emerg_, args);
+ netdev_emerg(padapter->pnetdev, args);
)
...>
}

@rule@
identifier func, context, padapter;
@@

func(void *context)
{
...
struct adapter *padapter = context;
...
}

@@
expression list args;
identifier rule.padapter;
identifier rule.func, rule.context;
@@

func(void *context)
{
<...
(
- DBG_871X_LEVEL(_drv_always_, args);
+ netdev_dbg(padapter->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_info_, args);
+ netdev_info(padapter->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_warning_, args);
+ netdev_warn(padapter->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_err_, args);
+ netdev_err(padapter->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_emerg_, args);
+ netdev_emerg(padapter->pnetdev, args);
)
...>
}

@@
expression list args;
expression get_dev;
identifier func, dev;
@@

func(...)
{
...
struct net_device *dev = get_dev;
<...
(
- DBG_871X_LEVEL(_drv_always_, args);
+ netdev_dbg(dev, args);
|
- DBG_871X_LEVEL(_drv_info_, args);
+ netdev_info(dev, args);
|
- DBG_871X_LEVEL(_drv_warning_, args);
+ netdev_warn(dev, args);
|
- DBG_871X_LEVEL(_drv_err_, args);
+ netdev_err(dev, args);
|
- DBG_871X_LEVEL(_drv_emerg_, args);
+ netdev_emerg(dev, args);
)
...>
}

@@
expression list args;
identifier func, dev;
@@

func(struct net_device *dev)
{
<...
(
- DBG_871X_LEVEL(_drv_always_, args);
+ netdev_dbg(dev, args);
|
- DBG_871X_LEVEL(_drv_info_, args);
+ netdev_info(dev, args);
|
- DBG_871X_LEVEL(_drv_warning_, args);
+ netdev_warn(dev, args);
|
- DBG_871X_LEVEL(_drv_err_, args);
+ netdev_err(dev, args);
|
- DBG_871X_LEVEL(_drv_emerg_, args);
+ netdev_emerg(dev, args);
)
...>
}

@@
expression list args;
identifier func, dvobj;
@@

func(struct dvobj_priv *dvobj)
{
<...
(
- DBG_871X_LEVEL(_drv_always_, args);
+ netdev_dbg(dvobj->if1->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_info_, args);
+ netdev_info(dvobj->if1->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_warning_, args);
+ netdev_warn(dvobj->if1->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_err_, args);
+ netdev_err(dvobj->if1->pnetdev, args);
|
- DBG_871X_LEVEL(_drv_emerg_, args);
+ netdev_emerg(dvobj->if1->pnetdev, args);
)
...>
}

@@
@@

- DBG_871X_LEVEL(...);

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/4a02f9f5665fa4b78c0b321ce0cc62254255c9dd.1618480688.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 71d3edc6 15-Apr-2021 Fabio M. De Francesco <fmdefrancesco@gmail.com>

staging: rtl8723bs: Remove led_blink_hdl() and everything related

Removed useless led_blink_hdl() prototype and definition.
Removed struct LedBlink_param. Removed LedBlink entries in
rtw_cmd_callback[] and in wlancmds[]. Everything related to LedBlink is
not anymore needed. Index of slots changed in arrays comments to reflect
current positions.

Reported-by: Julia Lawall <julia.lawall@inria.fr>
Reported-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Matthew Wilcox <willy@infradead.org>
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210415071731.25725-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d5c09ff0 14-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: fix indentation issue introduced by long line split

fix indentation of last line in if condition.

Fixes: af6afdb63f17 (staging: rtl8723bs: split long lines)
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210414081739.2990-1-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3d7ac040 13-Apr-2021 Fabio M. De Francesco <fmdefrancesco@gmail.com>

staging: rtl8723bs: core: Remove unused but set variable

Removed "ledBlink_param" because it was set to the value of "pbuf" but was
never reused. This set was made by direct assignment (no helper had been
called), therefore it had no side effect to the location pointed by "pbuf".

Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210413150517.12533-1-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0a62cc7a 10-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove unused code blocks guarded by DEBUG_RTL871X

remove unused code blocks guarded by never set DEBUG_RTL871X

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/c7b590b7ae7fad08cd913462ab385db9230ede4d.1618064274.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dcc48e08 10-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove all DBG_8192C logs

remove all DBG_8192C logs.

Macro DBG_8192C belongs to a family of verbose
private tracing macros.

The default behaviour is _do nothing_, to activate
it one should define DEBUG symbol by hand.

So just remove it with the following semantic patch:

@@
expression a, b, c, d, e, f, g, h, i, j, k;
constant B, C, D, E;
@@

(
- DBG_8192C(a);
|
- DBG_8192C(a, b);
|
- DBG_8192C(a, B);
|
- DBG_8192C(a, b, c);
|
- DBG_8192C(a, B, c);
|
- DBG_8192C(a, b, C);
|
- DBG_8192C(a, B, C);
|
- DBG_8192C(a, b, c, d);
|
- DBG_8192C(a, B, c, d);
|
- DBG_8192C(a, b, C, d);
|
- DBG_8192C(a, b, c, D);
|
- DBG_8192C(a, B, C, d);
|
- DBG_8192C(a, B, c, D);
|
- DBG_8192C(a, b, C, D);
|
- DBG_8192C(a, B, C, D);
|
- DBG_8192C(a, b, c, d, e);
|
- DBG_8192C(a, B, c, d, e);
|
- DBG_8192C(a, b, C, d, e);
|
- DBG_8192C(a, b, c, D, e);
|
- DBG_8192C(a, b, c, d, E);
|
- DBG_8192C(a, B, C, d, e);
|
- DBG_8192C(a, B, c, D, e);
|
- DBG_8192C(a, B, c, d, E);
|
- DBG_8192C(a, b, C, D, e);
|
- DBG_8192C(a, b, C, d, E);
|
- DBG_8192C(a, b, c, D, E);
|
- DBG_8192C(a, B, C, D, e);
|
- DBG_8192C(a, B, C, d, E);
|
- DBG_8192C(a, B, c, D, E);
|
- DBG_8192C(a, b, C, D, E);
|
- DBG_8192C(a, B, C, D, E);
|
- DBG_8192C(a, b, c, d, e, f);
|
- DBG_8192C(a, b, c, d, e, f, g);
|
- DBG_8192C(a, b, c, d, e, f, g, h);
|
- DBG_8192C(a, b, c, d, e, f, g, h, i);
|
- DBG_8192C(a, b, c, d, e, f, g, h, i, j);
|
- DBG_8192C(a, b, c, d, e, f, g, h, i, j, k);
)

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/9b338b3781e40c04104f26832add075e7f72d890.1618064274.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# af6afdb6 07-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: split long lines

fix following post-commit checkpatch hooks:

WARNING: line length of 110 exceeds 100 columns
266: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:623:
+ pmlmepriv->cur_network.join_res) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
--
WARNING: line length of 102 exceeds 100 columns
468: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:5234:
+ if (tx_chk != _SUCCESS && pmlmeinfo->link_count++ == link_count_limit)
--
WARNING: line length of 124 exceeds 100 columns
543: FILE: drivers/staging/rtl8723bs/core/rtw_pwrctrl.c:335:
+ if ((padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) && !(padapter->securitypriv.binstallGrpkey))
--
WARNING: line length of 112 exceeds 100 columns
828: FILE: drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1061:
+ if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_TX_STBC(pIE->data))
--
WARNING: line length of 113 exceeds 100 columns
836: FILE: drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1067:
+ if (TEST_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_LDPC_CAP(pIE->data))
--
WARNING: line length of 112 exceeds 100 columns
844: FILE: drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1073:
+ if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX) && GET_HT_CAPABILITY_ELE_RX_STBC(pIE->data))
--
WARNING: line length of 125 exceeds 100 columns
883: FILE: drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1282:
+ rtw_get_ie(bssid->IEs + _FIXED_IE_LENGTH_, WLAN_EID_HT_OPERATION, &len, bssid->IELength - _FIXED_IE_LENGTH_);
--
WARNING: line length of 101 exceeds 100 columns
904: FILE: drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1305:
+ if (bssid->Ssid.Ssid[0] != '\0' && bssid->Ssid.SsidLength != 0) /* not hidden ssid */
--
WARNING: line length of 129 exceeds 100 columns
953: FILE: drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1345:
+ if (pairwise_cipher != cur_network->BcnInfo.pairwise_cipher || group_cipher != cur_network->BcnInfo.group_cipher)
--
WARNING: line length of 113 exceeds 100 columns
1712: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2651:

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/814139162ef516bb07bb50876578b032573271ac.1617802415.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e427bdd8 07-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: rewrite comparison to null

fi following post-commit checkpatch issues:

CHECK: Comparison to NULL could be written "!p"
290: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:978:
+ if (p == NULL)
--
CHECK: Comparison to NULL could be written "!pmgntframe"
328: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2016:
+ if (pmgntframe == NULL)
--
CHECK: Comparison to NULL could be written "!pmgntframe"
361: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2378:
+ if (pmgntframe == NULL)
--
CHECK: Comparison to NULL could be written "!pmgntframe"
391: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3478:
+ if (pmgntframe == NULL)
--
CHECK: Comparison to NULL could be written "!p"
427: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:4071:
+ if (p == NULL)
--
CHECK: Comparison to NULL could be written "!BIP_AAD"
781: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1690:
+ if (BIP_AAD == NULL)
--
CHECK: Comparison to NULL could be written "!pwep"
1773: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3062:
+ if (pwep == NULL)
--
CHECK: Comparison to NULL could be written "!pmlmepriv->wps_beacon_ie"
1784: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3510:
+ if (pmlmepriv->wps_beacon_ie == NULL)
--
CHECK: Comparison to NULL could be written "!pmlmepriv->wps_probe_resp_ie"
1795: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3544:
+ if (pmlmepriv->wps_probe_resp_ie == NULL)
--
CHECK: Comparison to NULL could be written "!pmlmepriv->wps_assoc_resp_ie"
1807: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3574:
+ if (pmlmepriv->wps_assoc_resp_ie == NULL)
--
CHECK: Comparison to NULL could be written "!pbuf"
1818: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:3928:
+ if (pbuf == NULL)
--
CHECK: Comparison to NULL could be written "!if1"
1944: FILE: drivers/staging/rtl8723bs/os_dep/sdio_intf.c:392:
+ if (if1 == NULL)

CHECK: Using comparison to false is error prone
402: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3890:
+ if (false == bxmitok)
--
CHECK: Using comparison to true is error prone
671: FILE: drivers/staging/rtl8723bs/core/rtw_recv.c:365:
+ if ((prxattrib->bdecrypted == true) && (brpt_micerror == true))
--
CHECK: Using comparison to true is error prone
1051: FILE: drivers/staging/rtl8723bs/core/rtw_xmit.c:1174:
+ if (padapter->securitypriv.binstallBIPkey != true)
--
CHECK: Using comparison to false is error prone
1632: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2194:
+ if (false == bMatched)

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/572f96dcb6217fd3e6ea23c37b55b0ebb3231f14.1617802415.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e6e7ad69 07-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: add spaces around operators

fix the following post-commit checkpatch issues:

CHECK: spaces preferred around that '|' (ctx:VxV)
187: FILE: drivers/staging/rtl8723bs/core/rtw_mlme.c:1659:
+ if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true)
--
CHECK: spaces preferred around that '|' (ctx:VxV)
373: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3023:
+ == (sta_bssrate[j]|IEEE80211_BASIC_RATE_MASK))
--
CHECK: spaces preferred around that '-' (ctx:VxV)
456: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:4098:
+ if (len > (NDIS_802_11_LENGTH_RATES_EX-i))
--
CHECK: spaces preferred around that '+' (ctx:VxV)
770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590:
+ if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
--
CHECK: spaces preferred around that '+' (ctx:VxV)
770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590:
+ if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
--
CHECK: spaces preferred around that '-' (ctx:VxV)
770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590:
+ if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
--
CHECK: spaces preferred around that '+' (ctx:VxV)
770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590:
+ if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
--
CHECK: spaces preferred around that '+' (ctx:VxV)
770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590:
+ if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
--
CHECK: spaces preferred around that '+' (ctx:VxV)
770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590:
+ if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
--
CHECK: spaces preferred around that '-' (ctx:VxV)
770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590:
+ if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
--
CHECK: spaces preferred around that '+' (ctx:VxV)
770: FILE: drivers/staging/rtl8723bs/core/rtw_security.c:1590:
+ if (pframe[hdrlen+8+plen-8+i] != message[hdrlen+8+plen-8+i])
--
CHECK: spaces preferred around that '-' (ctx:VxV)
1001: FILE: drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1849:
+ if (i > (NUM_STA-1))
--
CHECK: spaces preferred around that '&' (ctx:VxV)
1647: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:211:
+ if (mcs_rate&0x8000) /* MCS15 */

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/28885311d4351d4df4508a50765a9b92a2b8da77.1617802415.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 709c8e49 07-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove unnecessary bracks on DBG_871X removal sites

remove unnecessary bracks on DBG_871X removal sites

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/35f5edf0f39b717b3de3ad7861cbaa5f4ba60576.1617802415.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b4f27a06 07-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove empty #ifdef blocks after DBG_871X removal

remove #ifdef and blocks #if defined() blocks left empty
after DBG_871X removal.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/4e19eb1c71bc1d43d30c1b0a04851ab7ce528f36.1617802415.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 21e161c3 07-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove all if-else empty blocks left by DBG_871X removal

remove all if-else empty {} blocks left by spatch application.

removed unused variables and an unused static function definition
after if-else blocks removal, to suppress compiler warnings.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/56055b20bc064d7ac1e8f14bd1ed42aba6b02c36.1617802415.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 68e79909 07-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove commented out DBG_871X logs

remove all commented out DBG_871X logs unmatched by
semantic patch.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/125e216e3bb5bc938e06b15dadfbbf51d9517dde.1617802415.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 968b15ad 07-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove all DBG_871X logs

Remove all of the DBG_871X logs as they
currently do nothing as they require the code to be modified by
hand in order to be turned on. This obviously has not happened
since the code was merged, so just remove them as they are unused.

applied the following semantic patch script:

@@
expression a, b, c, d, e, f, g, h, i, j, k;
constant B, C, D, E;
@@

(
- DBG_871X(a);
|
- DBG_871X(a, b);
|
- DBG_871X(a, B);
|
- DBG_871X(a, b, c);
|
- DBG_871X(a, B, c);
|
- DBG_871X(a, b, C);
|
- DBG_871X(a, B, C);
|
- DBG_871X(a, b, c, d);
|
- DBG_871X(a, B, c, d);
|
- DBG_871X(a, b, C, d);
|
- DBG_871X(a, b, c, D);
|
- DBG_871X(a, B, C, d);
|
- DBG_871X(a, B, c, D);
|
- DBG_871X(a, b, C, D);
|
- DBG_871X(a, B, C, D);
|
- DBG_871X(a, b, c, d, e);
|
- DBG_871X(a, B, c, d, e);
|
- DBG_871X(a, b, C, d, e);
|
- DBG_871X(a, b, c, D, e);
|
- DBG_871X(a, b, c, d, E);
|
- DBG_871X(a, B, C, d, e);
|
- DBG_871X(a, B, c, D, e);
|
- DBG_871X(a, B, c, d, E);
|
- DBG_871X(a, b, C, D, e);
|
- DBG_871X(a, b, C, d, E);
|
- DBG_871X(a, b, c, D, E);
|
- DBG_871X(a, B, C, D, e);
|
- DBG_871X(a, B, C, d, E);
|
- DBG_871X(a, B, c, D, E);
|
- DBG_871X(a, b, C, D, E);
|
- DBG_871X(a, B, C, D, E);
|
- DBG_871X(a, b, c, d, e, f);
|
- DBG_871X(a, b, c, d, e, f, g);
|
- DBG_871X(a, b, c, d, e, f, g, h);
|
- DBG_871X(a, b, c, d, e, f, g, h, i);
|
- DBG_871X(a, b, c, d, e, f, g, h, i, j);
|
- DBG_871X(a, b, c, d, e, f, g, h, i, j, k);
)

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/89a39f551107ba73b44dd2422765cf8ce371501a.1617802415.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0ac666f8 04-Apr-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove RT_TRACE logs in core/rtw_mlme_ext.c

Remove all of the RT_TRACE logs in the core/rtw_mlme_ext.c file as they
currently do nothing as they require the code to be modified by
hand in order to be turned on. This obviously has not happened
since the code was merged. Moreover it relies on an unneeded
private log level tracing which overrides the in-kernel public one,
so just remove them as they are unused.

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/4f838d1ce3cd16fab8f05d1e0f80c2e7469701b8.1617545239.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 81ff14a3 18-Mar-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove unnecessary logging in core/rtw_mlme_ext.c

fix the following checkpatch.pl issues:

WARNING: Unnecessary ftrace-like logging - prefer using ftrace
987: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:987:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
1115: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1115:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
1547: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1547:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
1760: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1760:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
1813: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1813:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
2340: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2340:
+ /* DBG_871X("%s\n", __func__); */
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
2499: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2499:
+ /* DBG_871X("%s\n", __func__); */
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
2948: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2948:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
2969: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2969:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
3445: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3445:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
3677: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3677:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
3915: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:3915:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
4599: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:4599:
+ DBG_871X("%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
5355: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:5355:
+ DBG_871X("=>%s\n", __func__);
--
WARNING: Unnecessary ftrace-like logging - prefer using ftrace
5366: FILE: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:5366:
+ DBG_871X("%s\n", __func__);

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/20210318152610.16758-4-fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f0e46c47 17-Mar-2021 Marco Cesati <marcocesati@gmail.com>

Staging: rtl8723bs: fix names in rtw_mlme_ext.h

This commit converts names of structs / enums
in include/rtw_mlme_ext.h from ALL_CAPS format to lowercase

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210317222130.29528-21-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c2e0b9a7 17-Mar-2021 Marco Cesati <marcocesati@gmail.com>

Staging: rtl8723bs: fix names in rtw_mlme.h

This commit converts names of structs / enums
in include/rtw_mlme.h from ALL_CAPS format to lowercase

Signed-off-by: Marco Cesati <marcocesati@gmail.com>
Link: https://lore.kernel.org/r/20210317222130.29528-2-marcocesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 29171180 15-Mar-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove unused code blocks conditioned by never set CONFIG_BACKGROUND_NOISE_MONITOR

remove conditional code blocks checked by unused
CONFIG_BACKGROUND_NOISE_MONITOR

cleaning required in TODO file:

find and remove code blocks guarded by never set CONFIG_FOO defines

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/2872c6f848b8b7aa0dc2d0399123d798f4b18820.1615801722.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2c6accb3 15-Mar-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove unused code blocks conditioned by never set CONFIG_SIGNAL_DISPLAY_DBM

remove conditional code blocks checked by unused CONFIG_SIGNAL_DISPLAY_DBM

cleaning required in TODO file:

find and remove code blocks guarded by never set CONFIG_FOO defines

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/abfd2f2fa0425d8e5d8618dd64ef40b4974c71b4.1615801721.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5306e022 15-Mar-2021 Fabio Aiuto <fabioaiuto83@gmail.com>

staging: rtl8723bs: remove unused code blocks conditioned by never set CONFIG_AUTO_AP_MODE

remove conditional code blocks checked by unused CONFIG_AUTO_AP_MODE

cleaning required in TODO file:

find and remove code blocks guarded by never set CONFIG_FOO defines

Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/342607e2b4ba2a19b367705a0b47cac95d601d44.1615801721.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 00d5865c 12-Mar-2021 Marco Cesati <marcocesati@gmail.com>

staging: rtl8723bs: remove typedefs in osdep_service_linux.h

This commit fixes the following checkpatch.pl warnings:

WARNING: do not add new typedefs
#43: FILE: include/osdep_service_linux.h:43:
+ typedef spinlock_t _lock;

WARNING: do not add new typedefs
#44: FILE: include/osdep_service_linux.h:44:
+ typedef struct mutex _mutex;

WARNING: do not add new typedefs
#45: FILE: include/osdep_service_linux.h:45:
+ typedef struct timer_list _timer;

WARNING: do not add new typedefs
#52: FILE: include/osdep_service_linux.h:52:
+ typedef struct sk_buff _pkt;

WARNING: do not add new typedefs
#53: FILE: include/osdep_service_linux.h:53:
+ typedef unsigned char _buffer;

WARNING: do not add new typedefs
#55: FILE: include/osdep_service_linux.h:55:
+ typedef int _OS_STATUS;

WARNING: do not add new typedefs
#57: FILE: include/osdep_service_linux.h:57:
+ typedef unsigned long _irqL;

WARNING: do not add new typedefs
#58: FILE: include/osdep_service_linux.h:58:
+ typedef struct net_device * _nic_hdl;

WARNING: do not add new typedefs
#62: FILE: include/osdep_service_linux.h:62:
+ typedef void timer_hdl_return;

WARNING: do not add new typedefs
#63: FILE: include/osdep_service_linux.h:63:
+ typedef void* timer_hdl_context;

WARNING: do not add new typedefs
#65: FILE: include/osdep_service_linux.h:65:
+ typedef struct work_struct _workitem;

Signed-off-by: Marco Cesati <marco.cesati@gmail.com>
Link: https://lore.kernel.org/r/20210312082638.25512-29-marco.cesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d495c5503 12-Mar-2021 Marco Cesati <marcocesati@gmail.com>

staging: rtl8723bs: remove typedefs in basic_types.h

This commit fixes the following checkpatch.pl warning:

WARNING: do not add new typedefs
#16: FILE: include/basic_types.h:16:
+typedef signed int sint;

Signed-off-by: Marco Cesati <marco.cesati@gmail.com>
Link: https://lore.kernel.org/r/20210312082638.25512-28-marco.cesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d44d0312 12-Mar-2021 Marco Cesati <marcocesati@gmail.com>

staging: rtl8723bs: remove typedefs in rtw_mlme_ext.h

This commit fixes the following checkpatch.pl warnings:

WARNING: do not add new typedefs
#118: FILE: include/rtw_mlme_ext.h:118:
+typedef enum _RT_CHANNEL_DOMAIN {

WARNING: do not add new typedefs
#186: FILE: include/rtw_mlme_ext.h:186:
+typedef enum _RT_CHANNEL_DOMAIN_2G {

WARNING: do not add new typedefs
#198: FILE: include/rtw_mlme_ext.h:198:
+typedef enum _RT_CHANNEL_DOMAIN_5G {

WARNING: do not add new typedefs
#241: FILE: include/rtw_mlme_ext.h:241:
+typedef struct _RT_CHANNEL_PLAN {

WARNING: do not add new typedefs
#246: FILE: include/rtw_mlme_ext.h:246:
+typedef struct _RT_CHANNEL_PLAN_2G {

WARNING: do not add new typedefs
#251: FILE: include/rtw_mlme_ext.h:251:
+typedef struct _RT_CHANNEL_PLAN_5G {

WARNING: do not add new typedefs
#256: FILE: include/rtw_mlme_ext.h:256:
+typedef struct _RT_CHANNEL_PLAN_MAP {

WARNING: do not add new typedefs
#273: FILE: include/rtw_mlme_ext.h:273:
+typedef enum _HT_IOT_PEER {

Signed-off-by: Marco Cesati <marco.cesati@gmail.com>
Link: https://lore.kernel.org/r/20210312082638.25512-24-marco.cesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 743c5f85 12-Mar-2021 Marco Cesati <marcocesati@gmail.com>

staging: rtl8723bs: remove typedefs in rtw_mlme.h

This commit fixes the following checkpatch.pl warnings:

WARNING: do not add new typedefs
#84: FILE: include/rtw_mlme.h:84:
+typedef enum _RT_SCAN_TYPE {

WARNING: do not add new typedefs
#137: FILE: include/rtw_mlme.h:137:
+typedef struct _RT_LINK_DETECT_T {

Signed-off-by: Marco Cesati <marco.cesati@gmail.com>
Link: https://lore.kernel.org/r/20210312082638.25512-3-marco.cesati@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 41b25593 01-Mar-2021 Candy Febriyanto <cfebriyanto@gmail.com>

staging: rtl8723bs: core: Replace sprintf with scnprintf

The use of sprintf with format string here means that there is a risk
that the writes will go out of bounds, replace it with scnprintf.

In on_action_public_default the variable "cnt" isn't being used for
anything meaningful so remove it.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Candy Febriyanto <cfebriyanto@gmail.com>
Link: https://lore.kernel.org/r/6c260641164d6856fc4447555fe739124cb27c19.1614610197.git.cfebriyanto@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5b45010f 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace EID_EXTCapability

Replace unique EID_EXTCapability constant with kernel provided
WLAN_EID_EXT_CAPABILITY from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-20-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d7ca2c3d 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace EID_BSSIntolerantChlReport

Replace unique EID_BSSIntolerantChlReport constant with kernel provided
WLAN_EID_BSS_INTOLERANT_CHL_REPORT from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-19-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9b5d8c1f 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace EID_BSSCoexistence

Replace unique EID_BSSCoexistence constant with kernel provided
WLAN_EID_BSS_COEX_2040 from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-18-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 00f0b682 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace _EXT_SUPPORTEDRATES_IE_

Replace unique _EXT_SUPPORTEDRATES_IE_ macro with kernel provided
WLAN_EID_EXT_SUPP_RATES from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-15-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7bd332ec 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace _ERPINFO_IE_

Replace unique _ERPINFO_IE_ macro with kernel provided WLAN_EID_ERP_INFO
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-14-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 38caee0a 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace _CHLGETXT_IE_

Replace unique _CHLGETXT_IE_ macro with kernel provided WLAN_EID_CHALLENGE
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-13-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0b44fca9 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace _COUNTRY_IE_

Replace unique _COUNTRY_IE_ macro with kernel provided WLAN_EID_COUNTRY
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-12-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e6038a48 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace _IBSS_PARA_IE_

Replace unique _IBSS_PARA_IE_ macro with kernel provided
WLAN_EID_IBSS_PARAMS from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-11-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f6a9446 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace _DSSET_IE_

Replace unique _DSSET_IE_ macro with kernel provdied WLAN_EID_DS_PARAMS
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-9-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c34c45ed 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace _SUPPORTEDRATES_IE_

Replace unique _SUPPORTEDRATES_IE_ macro with kernel provided
WLAN_EID_SUPP_RATES from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-8-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3f15277b 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace _SSID_IE_

Replace unique _SSID_IE_ macro with kernel provided WLAN_EID_SSID from
linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-7-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 332ec9db 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: use WLAN_EID_HT_OPERATION

Replace unique _HT_EXTRA_INFO_IE_ and _HT_ADD_INFO_IE_ macros with kernel
provided WLAN_EID_HT_OPERATION from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-5-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3359e292 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: use WLAN_EID_RSN

Replace unique _WPA2_IE_ID_, EID_WPA2, and _RSN_IE_2_ with kernel provided
WLAN_EID_RSN from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-4-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b05cc3a9 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: use WLAN_EID_VENDOR_SPECIFIC

Replace unique WLAN_EID_GENERIC, _WPA_IE_ID_, _SSN_IE_1_, and
_VENDOR_SPECIFIC_IE_ macros with kernel provided WLAN_EID_VENDOR_SPECIFIC
from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-3-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fc6a6528 07-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: use WLAN_EID_HT_CAPABILITY

Replace unique WLAN_EID_HT_CAP, _HT_CAPABILITY_IE_, and EID_HTCapability
with kernel provided WLAN_EID_HT_CAPABILITY from linux/ieee80211.h.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201208040733.379197-2-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 19cf9d7a 05-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: remove LIST_CONTAINOR

Remove unnecessary macro for container_of and call it directly.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201206034517.4276-9-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b3ae8af6 05-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK

Replace unique macro RTW_IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK with kernel
provided IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK. The other
IEEE80211_ADDBA_* and IEEE_DELBA_* macros are duplicates already defined
in linux/ieee80211.h, remove them.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201206034517.4276-7-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 98b32c71 05-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace HT_CAP_AMPDU_FACTOR

Replace unique HT_CAP_AMPDU_FACTOR enum with kernel provided
ieee80211_max_ampdu_length_exp enum.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201206034517.4276-4-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2415ae7f 05-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace cap_* macros

Replace unique cap_* macros with kernel provided WLAN_CAPABILITY_*
macros.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201206034517.4276-3-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5ed3e6f2 05-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace WIFI_REASON_CODE

Replace unique macros and WIFI_REASON_CODE enum with the kernel provided
ieee80211_reasoncode.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201206034517.4276-2-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6d75b504 05-Dec-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace unique macros and WIFI_STATUS_CODE

Replace many unique macros and WIFI_STATUS_CODE enum with kernel
provided ieee80211_statuscode. A duplicate
WLAN_STATUS_ASSOC_DENIED_NOSHORT macro is also removed.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201206034517.4276-1-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2811861b 19-Nov-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

staging: rtl8723bs: core: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix multiple
warnings by explicitly adding multiple break statements instead of just
letting the code fall through to the next case.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/cd07e3ebc11b44a3fe016341438e24cf950994a3.1605896059.git.gustavoars@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5641eeec 09-Nov-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: clean up open ended lines

Move declarations to fix coding style issues and clear checkpatch
checks.

CHECK: Lines should not end with a '('

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201110041008.15847-4-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f4acd33c 04-Nov-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace ieee80211_back_actioncode

Replace the unique rtw_ieee80211_back_actioncode with the standard
provided ieee80211_back_actioncode.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201105034754.12383-9-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a9d87638 04-Nov-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace rtw_ieee80211_ht_actioncode

Replace the unique rtw_ieee80211_ht_actioncode enum with the provided
standard ieee80211_ht_actioncode.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201105034754.12383-8-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 72cac683 04-Nov-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace rtw_ieee80211_spectrum_mgmt_actioncode

Replace the unique rtw_ieee80211_mgmt_actioncode enum with the provided
standard ieee80211_spectrum_mgmt_actioncode.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201105034754.12383-7-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c25d8a7d 04-Nov-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace rtw_ieee80211_ht_cap

Replace the unique rtw_ieee80211_ht_cap struct with the provided standard
ieee80211_ht_cap.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201105034754.12383-6-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d0cc39cd 04-Nov-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: remove ADPT_FMT macro

Remove unnecessary macro for %s and call it directly.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201105034754.12383-5-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bbda3ac4 04-Nov-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: remove MAC_FMT macro

Remove unnecessary macro for %pM and call it directly.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201105034754.12383-1-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 34557e23 26-Oct-2020 Izabela Bakollari <izabela.bakollari@gmail.com>

staging: rtl8723bs: Rewrite comparison to NULL

Rewrite comparison to NULL by modifying (p != NULL) to (p).
Issue reported by checkpatch.

Signed-off-by: Izabela Bakollari <izabela.bakollari@gmail.com>
Link: https://lore.kernel.org/r/20201026232310.48128-1-izabela.bakollari@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d48603af 03-Oct-2020 Ross Schmidt <ross.schm.dev@gmail.com>

staging: rtl8723bs: replace RTW_GET_LE16 with get_unaligned_le16

Replace RTW_GET_LE16 macro with get_unaligned_le16.

Signed-off-by: Ross Schmidt <ross.schm.dev@gmail.com>
Link: https://lore.kernel.org/r/20201004011743.10750-6-ross.schm.dev@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 52a1d9d4 27-Jul-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

staging: rtl8723bs: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1].

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20200727190657.GA30194@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 47548aa9 26-Apr-2020 Jason Yan <yanaijie@huawei.com>

staging: rtl8723bs: core: remove set but not used 'listen_interval'

Fix the following gcc warning:

drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1173:18: warning: variable
‘listen_interval’ set but not used [-Wunused-but-set-variable]
u16 capab_info, listen_interval;
^~~~~~~~~~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200427032342.27211-6-yanaijie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3a0514a9 26-Apr-2020 Jason Yan <yanaijie@huawei.com>

staging: rtl8723bs: core: remove set but not used 'algthm'

Fix the following gcc warning:

drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1087:33: warning: variable
‘algthm’ set but not used [-Wunused-but-set-variable]
unsigned int seq, len, status, algthm, offset;
^~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20200427032342.27211-5-yanaijie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c926f022 25-Mar-2020 Simran Singhal <singhalsimran0@gmail.com>

staging: rtl8723bs: Add line after variable declarations

Add whiteline after variable declarations to remove the checkpatch.pl
warning:
WARNING: Missing a blank line after declarations

Signed-off-by: Simran Singhal <singhalsimran0@gmail.com>
Link: https://lore.kernel.org/r/20200325164451.GA17569@simran-Inspiron-5558
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4d17363d 29-Nov-2019 Andreas Hellmich <dy26hofu@stud.informatik.uni-erlangen.de>

staging: rtl8723bs: Fix line length

Fix some line length errors.

Co-developed-by: Annika Knepper <av91obul@stud.informatik.uni-erlangen.de>
Signed-off-by: Annika Knepper <av91obul@stud.informatik.uni-erlangen.de>
Signed-off-by: Andreas Hellmich <dy26hofu@stud.informatik.uni-erlangen.de>
Link: https://lore.kernel.org/r/20191129093939.2782-2-dy26hofu@stud.informatik.uni-erlangen.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 68468503 29-Nov-2019 Andreas Hellmich <dy26hofu@stud.informatik.uni-erlangen.de>

staging: rtl8723bs: Fix spelling errors

Fix spelling errors.

Co-developed-by: Annika Knepper <av91obul@stud.informatik.uni-erlangen.de>
Signed-off-by: Annika Knepper <av91obul@stud.informatik.uni-erlangen.de>
Signed-off-by: Andreas Hellmich <dy26hofu@stud.informatik.uni-erlangen.de>
Link: https://lore.kernel.org/r/20191129093939.2782-1-dy26hofu@stud.informatik.uni-erlangen.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 87a966d8 14-Sep-2019 Michael Straube <straube.linux@gmail.com>

staging: rtl8723bs: remove return statements from void functions

Remove unnecessary return statements from void functions reported by
checkpatch.

WARNING: void function return statements are not generally useful

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20190914115634.67874-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9cdb1928 12-Sep-2019 Saiyam Doshi <saiyamdoshi.in@gmail.com>

staging: rtl8723bs: remove unneeded conversion to bool

Relational and logical operators evaluate to bool,
explicit conversion is overly verbose and unneeded.

This issue found using - Coccinelle (http://coccinelle.lip6.fr)

Signed-off-by: Saiyam Doshi <saiyamdoshi.in@gmail.com>
Link: https://lore.kernel.org/r/20190912145346.GA9013@SD.eic.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 53e3a7e1 06-Sep-2019 Colin Ian King <colin.king@canonical.com>

staging: rtl8723bs: core: make array op_class static const, makes object smaller

Don't populate the array op_class on the stack but instead make it
static const. Makes the object code smaller by 64 bytes.

Before:
text data bss dec hex filename
93553 7944 5056 106553 1a039 rtl8723bs/core/rtw_mlme_ext.o

After:
text data bss dec hex filename
93425 8008 5056 106489 19ff9 rtl8723bs/core/rtw_mlme_ext.o

(gcc version 9.2.1, amd64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20190906175021.25103-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1c4bfacf 17-Jul-2019 Hariprasad Kelam <hariprasad.kelam@gmail.com>

staging: rtl8723bs: core: Remove Unneeded variable ret

Remove Unneeded variable ret . Return _FAIL .

We cannot change return type of on_action_spct as its callback function.

Issue identified with coccicheck.

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190717180635.GA11412@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 067756ac 15-Jul-2019 Hariprasad Kelam <hariprasad.kelam@gmail.com>

staging: rtl8723bs: core: Change return type of init_mlme_ext_priv

As init_mlme_ext_priv function always returns SUCCESS , We can change
return type from int to void.

Fixes below issue identified by coccicheck
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:464:5-8: Unneeded
variable: "res". Return "_SUCCESS" on line 492

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190715174618.GA8947@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2615f966 14-Jul-2019 Hariprasad Kelam <hariprasad.kelam@gmail.com>

staging: rtl8723bs: core: Remove code valid only for 5GHz

As per TODO ,remove code valid only for 5 GHz(channel > 14).

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Link: https://lore.kernel.org/r/20190714172826.GA6950@hari-Inspiron-1545
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d312a47f 01-Jul-2019 Nishka Dasgupta <nishkadg.linux@gmail.com>

staging: rtl8723bs: Remove rtw_btcoex_IsBTCoexCtrlAMPDUSize()

Remove function rtw_btcoex_IsBTCoexCtrlAMPDUSize as it does nothing
except call hal_btcoex_IsBTCoexCtrlAMPDUSize.
Modify call site accordingly.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190702070132.6997-5-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 777a4334 28-Jun-2019 Nishka Dasgupta <nishkadg.linux@gmail.com>

staging: rtl8723bs: Remove rtw_hal_networktype_to_raid()

Change call sites of rtw_hal_networktype_to_raid to instead call
networktype_to_raid_ex as rtw_hal_networktype_to_raid does nothing
except call networktype_to_raid_ex.
Remove now-unused function rtw_hal_networktype_to_raid.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# eb569cc0 12-Jun-2019 Nishka Dasgupta <nishkadg.linux@gmail.com>

staging: rtl8723bs: core: Replace function Set_MSR()

Remove function Set_NETYPE0_MSR as it only has one line and it is only
called by one other function, Set_MSR.
Replace contents of Set_MSR with the contents of Set_NETYPE0_MSR as
Set_MSR does nothing except call Set_NETYPE0_MSR.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fc98ef8f 10-Jun-2019 Nishka Dasgupta <nishkadg.linux@gmail.com>

staging: rtl8723bs: core: rtw_mlme_ext.c: Remove unused variables

Remove variables that are declared and assigned values but not otherwise
used.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 63a9c3ed 17-May-2019 Jeeeun Evans <jeeeunevans@gmail.com>

staging: rtl8723bs: Fix boolinit.cocci warnings

This patch removes unnecessary comparisons to bool.

Issue found by coccinelle:
drivers/staging/rtl8723bs/core/rtw_ap.c:2159:5-11: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_cmd.c:1741:7-17: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:360:5-15: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c:360:28-39: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_mlme.c:1675:6-10: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:6766:8-21: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c:181:5-40: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_wlan_util.c:748:14-42: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_xmit.c:2429:15-47: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_xmit.c:2458:7-17: WARNING: Comparison to bool
drivers/staging/rtl8723bs/core/rtw_xmit.c:2524:8-18: WARNING: Comparison to bool
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:1653:13-36: WARNING: Comparison to bool

Signed-off-by: Jeeeun Evans <jeeeunevans@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5706396f 05-May-2019 Vatsala Narang <vatsalanarang@gmail.com>

staging: rtl8723bs: core: Fix variable constant comparisons.

Swap the terms of comparisons whenever the constant comes first to get
rid of checkpatch warning.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a65f0d18 05-May-2019 Vatsala Narang <vatsalanarang@gmail.com>

staging: rtl8723bs: core: Remove braces from single if statement.

Remove braces from single if statement to get rid of checkpatch warning.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c872ed07 05-May-2019 Vatsala Narang <vatsalanarang@gmail.com>

staging: rtl8723bs: core: Remove unnecessary parentheses.

Remove unnecessary parentheses after 'address-of' operator to get rid of
checkpatch warning.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 41452327 05-May-2019 Vatsala Narang <vatsalanarang@gmail.com>

staging: rtl8723bs: core: Replace NULL comparisons.

Replace NULL comparisons in the file to get rid of checkpatch warning.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 68106250 05-May-2019 Vatsala Narang <vatsalanarang@gmail.com>

staging: rtl8723bs: core: Remove blank line.

To avoid style issues, remove multiple blank lines.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e52d8d0d 01-May-2019 Vatsala Narang <vatsalanarang@gmail.com>

staging: rtl8723bs: core: Prefer using the BIT Macro.

Replace bit shifting on 1 with the BIT(x) macro.

Issue found using coccinelle.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9358bd52 28-Apr-2019 Vatsala Narang <vatsalanarang@gmail.com>

staging: rtl8723bs: core: Remove else after return statement.

Remove else after return statement as it is not useful. Issue found
using checkpatch.

Signed-off-by: Vatsala Narang <vatsalanarang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f36fa2d9 02-Apr-2019 Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>

staging: rtl8723bs: core: Replace bit shifting with BIT macro

Challenge suggested by coccinelle.
Prefer using BIT and replace bit shifting with the BIT(x) macro.

Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f24f505 01-Apr-2019 Madhumitha Prabakaran <madhumithabiw@gmail.com>

Staging: rtl8723bs: core: Remove typecast in kfree

Remove typecast in kfree, as per definition of kfree in
include/linux/slab.h#L144, the parameter type of kfree is void*, and
hence C compiler casts any pointer type to void*.

Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 63ff599a 21-Mar-2019 Nishka Dasgupta <nishka.dasgupta@yahoo.com>

staging: rtl8723bs: core: Remove return variables in rtw_mlme_ext.c

Remove unnecessary local return variables in rtw_mlme_ext.c. Issue found
with Coccinelle using ret.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5947e900 21-Mar-2019 Nishka Dasgupta <nishka.dasgupta@yahoo.com>

staging: rtl8723bs: core: Change NULL comparisons to Boolean negation

Change NULL comparisons to Boolean negations. Issue found with
Coccinelle using matchnull.cocci.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta@yahoo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 391d9469 17-Mar-2019 Emanuel Bennici <benniciemanuel78@gmail.com>

staging: rtl8723bs: Remove old unreachable Code

The commented code in core/rtw_mlme_ext.c obsolete because the macro
CONFIG_INTEL_WIDI no longer exists.

Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8ecd30a6 17-Mar-2019 Emanuel Bennici <benniciemanuel78@gmail.com>

staging: rtl8723bs: Remove Dead Code in collect_bss_info Function

In `u8 collect_bss_info` is a ifdef-Preprocessor who checks
CONFIG_INTEL_WIDI, since this Macro doesn't exists anymore this Patch
removes the Dead Code in core/rtw_mlme_ext.c

Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cb9a242c 12-Dec-2018 Hardik Singh Rathore <hardiksingh.k@gmail.com>

Staging: rtl8723bs: Fix code style issue in rtl8723bs driver

Add space between 'else' and '{' to solve code style issue
in all the files for rtl8723bs driver.

Signed-off-by: Hardik Singh Rathore <hardiksingh.k@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c45140bc 10-Dec-2018 Michael Straube <straube.linux@gmail.com>

staging: rtl8723bs: remove dead code, rtw_port_switch_chk()

The function rtw_port_switch_chk() returns always false.
Remove the function and related dead code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 87e4a540 27-Nov-2018 Young Xiao <YangX92@hotmail.com>

Revert commit ef9209b642f "staging: rtl8723bs: Fix indenting errors and an off-by-one mistake in core/rtw_mlme_ext.c"

pstapriv->max_num_sta is always <= NUM_STA, since max_num_sta is either
set in _rtw_init_sta_priv() or rtw_set_beacon().

Fixes: ef9209b642f1 ("staging: rtl8723bs: Fix indenting errors and an off-by-one mistake in core/rtw_mlme_ext.c")
Signed-off-by: Young Xiao <YangX92@hotmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6493a78f 27-Sep-2018 Aymen Qader <qader.aymen@gmail.com>

staging: rtl8723bs: Skip unnecessary field checks

Skip unnecessary request field checks when the information element
pointer is null.

Signed-off-by: Aymen Qader <qader.aymen@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1c8cb89e 14-Sep-2018 Jia-Ju Bai <baijiaju1990@gmail.com>

staging: rtl8723bs: Fix a sleep-in-atomic-context bug in issue_deauth_ex()

The driver may sleep with holding a spinlock.
The function call paths (from bottom to top) in Linux-4.17 are:

[FUNC] msleep
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c, 3805:
msleep in issue_deauth_ex
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c, 6336:
issue_deauth_ex in disconnect_hdl
drivers/staging/rtl8723bs/core/rtw_cmd.c, 963:
disconnect_hdl in rtw_disassoc_cmd
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c, 506:
rtw_disassoc_cmd in rtw_set_802_11_disassociate
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c, 501:
spin_lock_bh in rtw_set_802_11_disassociate

[FUNC] msleep
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c, 3805:
msleep in issue_deauth_ex
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c, 6336:
issue_deauth_ex in disconnect_hdl
drivers/staging/rtl8723bs/core/rtw_cmd.c, 963:
disconnect_hdl in rtw_disassoc_cmd
drivers/staging/rtl8723bs/core/rtw_mlme.c, 2256:
rtw_disassoc_cmd in rtw_select_and_join_from_scanned_queue
drivers/staging/rtl8723bs/core/rtw_mlme.c, 2204:
spin_lock_bh in rtw_select_and_join_from_scanned_queue

To fix this bug, msleep() is replaced with mdelay().

This bug is found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3520c7a4 22-Jun-2018 Henriette Hofmeier <passt@h-hofmeier.de>

staging: rtl8723bs: Move definition open brace

Move open braces of definitions to the next line
to comply with codestyle.
Criticized by checkpatch.

Signed-off-by: Henriette Hofmeier <passt@h-hofmeier.de>
Signed-off-by: Florian Harbecke <florian.harbecke@fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 58391efd 08-May-2018 Nathan Chancellor <nathan@kernel.org>

staging: rtl8723bs: Replace license boilerplate with SPDX identifiers

This satisfies a checkpatch.pl warning and is the preferred method for
notating the license due to its lack of ambiguity.

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c22da34a 28-Mar-2018 Thomas Avery <tavery321@gmail.com>

staging: rtl8723bs: Replace yield() call with cond_resched()

Remove yield call(). yield does not guarantee progress, and should not
be used. cond_resched() is a safe alternative.

Signed-off-by: Thomas Avery <tavery321@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7d0b4f3c 27-Mar-2018 Quytelda Kahja <quytelda@tamalin.org>

staging: rtl8723bs: Remove unnecessary length #define's.

This driver statically defines constants representing the size of
certain structs using literal integers as values. Replace those
constants with the sizeof() macro. Other length constants are already
defined in 'linux/ieee80211.h'; remove those #define's.

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e8b1844a 24-Oct-2017 Kees Cook <keescook@chromium.org>

staging: rtl8723bs: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. This performs some refactoring to
remove needless wrapper functions, and adds a pointer back to the desired
adapter.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Shreeya Patel <shreeya.patel23498@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Himanshu Jha <himanshujha199640@gmail.com>
Cc: Joe Perches <joe@perches.com>
Cc: Derek Robson <robsonde@gmail.com>
Cc: Harsha Sharma <harshasharmaiitr@gmail.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Cc: Johannes Berg <johannes.berg@intel.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 76ec4e8e 12-Oct-2017 Gustavo A. R. Silva <garsilva@embeddedor.com>

staging: rtl8723bs: rtw_mlme_ext: mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 42b3b621 09-Oct-2017 Aishwarya Pant <aishpant@gmail.com>

staging: rtl8723bs: remove implicit int->bool conversions

Implicit type conversions are bad; they hinder readability of code and
have potential to cause bugs. Here the variable wait_ack is always
supplied a bool value while in function declarations it is defined as an
int type. Fix it by defining wait_ack a bool type in all usages.

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2646633f 07-Oct-2017 Aastha Gupta <aastha.gupta4104@gmail.com>

staging: rtl8723bs: rename camelcase bAcceptAddbaReq

bAcceptAddbaReq uses camelcase which is not according to Linux kernel
coding style.
There is a 'bAcceptAddbaReq' field both in struct mlme_ext_info and
in struct registry_priv.Rename both of them.

Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 60db8d10 01-Oct-2017 Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>

staging: rtl8723bs: use ARRAY_SIZE

Using the ARRAY_SIZE macro improves the readability of the code. Also,
it is not always useful to use a variable to store this constant
calculated at compile time.

Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)

Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8eb1f34c 01-Oct-2017 Shreeya Patel <shreeya.patel23498@gmail.com>

Staging: rtl8723bs: Remove unnecessary comments

Remove unnecessary comments which are there
to explain why call to memset is in comments. Both of the
comments are not needed as they are not very useful.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0ad02fa8 22-Sep-2017 Georgiana Chelu <georgiana.chelu93@gmail.com>

Staging: rtl8723bs: core: Remove boolean comparison

Remove comparison to bool in order to improve
the clearness of the code.

Issue found using coccinelle script.

Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2ef2b7c2 09-Sep-2017 Joe Perches <joe@perches.com>

staging: rtl8723bs: Remove unnecessary rtw_z?malloc casts

These functions now return void * and no longer need casts.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 529d87b4 28-Aug-2017 Himanshu Jha <himanshujha199640@gmail.com>

staging: rtl8723bs: core: remove cast to void pointer

casting to void pointer from any pointer type and vice-versa is done
implicitly and therefore casting is not needed in such a case.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 40d4aa0f 29-Jul-2017 Shreeya Patel <shreeya.patel23498@gmail.com>

Staging: rtl8723bs: Do not initialise static to 0.

Do not initialise static to 0.
Static variables by default initialise to 0.

This patch fixes the errors found by checkpatch.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f55a6d45 21-Apr-2017 Arnd Bergmann <arnd@arndb.de>

staging: rtl8723bs: rework debug configuration handling

I ran into this warning during randconfig testing:

drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_deinit':
drivers/staging/rtl8723bs/os_dep/rtw_proc.c:738:25: error: unused variable 'drv_proc' [-Werror=unused-variable]
drivers/staging/rtl8723bs/os_dep/rtw_proc.c: In function 'rtw_adapter_proc_replace':
drivers/staging/rtl8723bs/os_dep/rtw_proc.c:762:25: error: unused variable 'drv_proc' [-Werror=unused-variable]

The problem is that the code procfs code gets built even when CONFIG_PROC_FS
is disabled, but some functions are turned into empty stubs then. This
is easily addressed by adding an #ifdef around the definition of the
CONFIG_PROC_DEBUG macro.

However, I could not bear looking at the macro name that clashes with the
Kconfig name space, so I also renamed it to simply PROC_DEBUG, along with
the other rtl8723bs specific CONFIG_DEBUG_* macros that I renamed the same
way. This is consistent with how we handle the same checks in the non-staging
rtlwifi driver.

As the code path for !CONFIG_PROC_DEBUG had not been tested properly, it
turned out to be incorrect and requires adding 'static inline' annotations
for the stub handlers, and moving some variables around.

Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 103ab687 11-Apr-2017 Colin Ian King <colin.king@canonical.com>

staging: rtl8723bs: fix spelling mistakes in RT_TRACE messages

Fix a few spelling mistakes in RT_TRACE messages and split up
wide lines to span multiple lines

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ef9209b6 08-Apr-2017 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8723bs: Fix indenting errors and an off-by-one mistake in core/rtw_mlme_ext.c

Smatch lists the following:

CHECK drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:525 _mgt_dispatcher() warn: inconsistent indenting
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1595 OnAssocReq() error: buffer overflow 'pstapriv->sta_aid' 32 <= 32
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2391 dump_mgntframe_and_wait() warn: inconsistent indenting
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2420 dump_mgntframe_and_wait_ack() warn: inconsistent indenting
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:4969 process_80211d() error: testing array offset 'i' after use.
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:5738 linked_status_chk() warn: inconsistent indenting
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:6459 sitesurvey_cmd_hdl() warn: inconsistent indenting

The indenting problems were fixed with white-space changes. The error at
line 1595 was the result of an off-by-one error in a for loop. The error
at line 4969 was not fixed as that code lies inside a block of code that
only is needed for 5G channels. This chip only works at 2.4 GHz.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 554c0a3a 29-Mar-2017 Hans de Goede <hdegoede@redhat.com>

staging: Add rtl8723bs sdio wifi driver

The rtl8723bs is found on quite a few systems used by Linux users,
such as on Atom systems (Intel Computestick and various other
Atom based devices) and on many (budget) ARM boards such as
the CHIP.

The plan moving forward with this is for the new clean,
written from scratch, rtl8xxxu driver to eventually gain
support for sdio devices. But there is no clear timeline
for that, so lets add this driver included in staging for now.

Cc: Bastien Nocera <hadess@hadess.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jes Sorensen <jes.sorensen@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>