History log of /linux-master/drivers/staging/rtl8192e/rtllib_rx.c
Revision Date Author Comments
# da8f893d 28-Feb-2024 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename function rtllib_FlushRxTsPendingPkts()

Rename function rtllib_FlushRxTsPendingPkts to
rtllib_flush_rx_ts_pending_pkts to fix checkpatch warning Avoid
CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20240229024325.453374-8-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ba15ff48 26-Feb-2024 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable BssCcxVerNumber

Rename variable BssCcxVerNumber to bss_ccx_ver_number to fix checkpatch
warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20240227044157.407379-11-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 98d602e8 26-Feb-2024 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable bCcxRmEnable

Rename variable bCcxRmEnable to ccx_rm_enable to fix checkpatch
warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20240227044157.407379-9-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ce0ba550 26-Feb-2024 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable bCkipSupported

Rename variable bCkipSupported to ckip_supported to fix checkpatch
warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20240227044157.407379-8-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9880998b 26-Feb-2024 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable Turbo_Enable

Rename variable Turbo_Enable to turbo_enable to fix checkpatch
warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20240227044157.407379-6-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9f965f1e 26-Feb-2024 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable NumRecvDataInPeriod

Rename variable NumRecvDataInPeriod to num_recv_data_in_period to
fix checkpatch warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20240227044157.407379-3-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fa7b3605 21-Feb-2024 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove variables bIsQosData and RxIs40MHzPacket

Remove unused variables bIsQosData and RxIs40MHzPacket as they are set
and never evaluated.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/7a8b579fd3d377fa961fe71e37fe4afa22f2a3b9.1708461563.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 72c068a1 01-Feb-2024 Michael Straube <straube.linux@gmail.com>

staging: rtl8192e: initialize variables at declaration

Initialize two variables at declaration instead of first declare
and then initialize them. This saves a line of code and clears a
checkpatch warning.

WARNING: Missing a blank line after declarations

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20240201081824.6998-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 34eb6bea 26-Jan-2024 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable NumRecvBcnInPeriod

Rename variable NumRecvBcnInPeriod to num_recv_bcn_in_period to fix
checkpatch warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Link: https://lore.kernel.org/r/20240126223106.986093-18-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 124f2e44 05-Jan-2024 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable NumRxUnicastOkInPeriod

Rename variable NumRxUnicastOkInPeriod to num_rx_unicast_ok_in_period
to fix checkpatch warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Link: https://lore.kernel.org/r/20240106055556.430948-13-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 9cbaf63c 25-Dec-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable bIsAggregateFrame

Rename variable bIsAggregateFrame to is_aggregate_frame to fix checkpatch
warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Link: https://lore.kernel.org/r/20231225202314.31869-6-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5fa882a8 25-Dec-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable NumRxOkInPeriod

Rename variable NumRxOkInPeriod to num_rx_ok_in_period to fix checkpatch
warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Link: https://lore.kernel.org/r/20231225202314.31869-4-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a24e0197 25-Dec-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable NumTxOkInPeriod

Rename variable NumTxOkInPeriod to num_tx_ok_in_period to fix checkpatch
warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Link: https://lore.kernel.org/r/20231225202314.31869-3-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b399e239 21-Dec-2023 Gary Rookard <garyrookard@fastmail.org>

staging: rtl8192e: rename variable HTCCheck

Coding style issue, checkpatch Avoid CamelCase,
rename it. HTCCheck -> ht_c_check

Signed-off-by: Gary Rookard <garyrookard@fastmail.org>
Link: https://lore.kernel.org/r/20231221183413.8349-4-garyrookard@fastmail.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6911a08c 21-Dec-2023 Gary Rookard <garyrookard@fastmail.org>

staging: rtl8192e: rename variable HTInitializeBssDesc

Coding style issue, checkpatch Avoid CamelCase,
rename it. HTInitializeBssDesc -> ht_initialize_bss_desc

Signed-off-by: Gary Rookard <garyrookard@fastmail.org>
Link: https://lore.kernel.org/r/20231221183413.8349-2-garyrookard@fastmail.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a99ead4e 16-Dec-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: rename linked list reference: List

Rename variable List to list, to fix Avoid CamelCase checkpatch warning.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Link: https://lore.kernel.org/r/20231216202038.10777-1-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 13afc9bd 08-Dec-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove files dot11d.c and dot11d.h

Remove files dot11d.c and dot11d.h as they are empty.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/ed7de82ade0fde1835bbd88aafba74aeb128beed.1701989555.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# db295ab8 19-Nov-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove unexecuted rtllib_extract_country_ie()

Variable "enabled" is initialized to false and never changed. Therefore
IS_DOT11D_ENABLE(ieee) returns always false. Because of this all code in
rtllib_extract_country_ie() is never executed.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/7b88c62d3cc5c3fb670b5448c7381c7c099b3518.1700431464.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e6377178 21-Oct-2023 Michael Straube <straube.linux@gmail.com>

staging: rtl8192e: clean up comparisons to NULL

Clean up comparisons to NULL to improve readability.
Reported by checkpatch.

if (x == NULL) -> if (!x)
if (x != NULL) -> if (x)

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20231021121947.14516-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 274fba8b 03-Oct-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove constant variable bToOtherSTA

Remove variable bToOtherSTA as it is set to 0 and unchanged. The equations
result accordingly. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/ecfcd8bff80d98a4e9a2797535a274625607c699.1696360404.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0c82f418 03-Oct-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove constant variable net_promiscuous_md

Remove variable net_promiscuous_md as it is set to 0 and unchanged. The
equations result accordingly. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/84a9865f763feeaaa51ce9abecf76c848e13580e.1696360404.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ff56e82a 03-Oct-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove constant variable promiscuous_on

Remove variable promiscuous_on as it is set to 0 and unchanged. The
equation results accordingly. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/07936bcc6a426d6f6d74bece2970ab6028abef44.1696360404.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1e420c19 03-Oct-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove constant variable fltr_src_sta_frame

Remove variable fltr_src_sta_frame as it is set to 0 and unchanged. The
equation results accordingly. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/1a37a8be464bb25531657aa7c868201676d7abb6.1696360404.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d50f64b5 24-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Resolve circular locking with rx_pkt_pending_timer

Resolve circular locking from reorder_spinlock with rx_pkt_pending_timer.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/08ff2088b0264bef60142ca35f7198dd8afa963c.1695582999.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# decfb8dd 22-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove mode IW_MODE_ADHOC from rtllib_rx.c

Remove unsupported mode IW_MODE_ADHOC from rtllib_rx.c and all related
functions and structs.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/5400c68e17b86b1170ac997fae3fe1fb09220af8.1695387832.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a747b924 20-Sep-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename function GetTs()

Rename function GetTs to rtllib_get_ts to fix checkpatch warning Avoid
CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20230921032515.96152-10-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8e050848 15-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Replace frame control constants with IEEE80211_FCTL_*

Replace frame control fields with IEEE80211_FCTL_* to avoid proprietary
constant names.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/24d195f60ab9aa1d419c81b749c3d64dc8f643e3.1694792595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3f48cad5 15-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Replace usage of RTLLIB_FCTL_DSTODS with function

Replace usage of RTLLIB_FCTL_DSTODS with function ieee80211_has_a4() to
avoid proprietary code and to increase readability. To achieve this goal
it was required to change a parameter of function rtllib_rx_data_filter().

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/69f72a352b8129bcc6610c1355a41d966abf24d8.1694792595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 87f8e11d 15-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Replace control subframe types with IEEE80211_STYPE_*

Replace control and data subframe types RTLLIB_STYPE_* with
IEEE80211_STYPE_* to avoid proprietary constant names.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/970555ba76dcf3b9896c51aab8ff333a95f12225.1694792595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 56724b74 15-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove struct rtllib_hdr_4addrqos

Replace struct rtllib_hdr_4addrqos with struct ieee80211_qos_hdr_4addr to
avoid proprietary code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/e146191ec1781a3989b318316fe9d8cdb330a52a.1694792595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cefacff1 15-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove struct rtllib_hdr_3addrqos

Replace struct rtllib_hdr_3addrqos with struct ieee80211_qos_hdr to avoid
proprietary code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/f9c52f9822075476d491b2f1061af51a4b818f3a.1694792595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7e2ee215 15-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove struct rtllib_hdr_4addr

Replace struct rtllib_hdr_4addr with struct ieee80211_hdr to avoid
proprietary code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/532a589e017bb6edefe60fc2ea402f541eb237ed.1694792595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 71ddc43e 15-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Replace struct rtllib_hdr_3addr in structs of rtllib.h

Replace struct rtllib_hdr_3addr with struct ieee80211_hdr_3addr to avoid
proprietary struct in structs of rtllib.h.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/e327712027b022561759d7cadcf51bf8274ab05a.1694792595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5db7df8e 15-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Replace struct rtllib_hdr_3addr in rtllib_rx.c

Replace struct rtllib_hdr_3addr with struct ieee80211_hdr_3addr to avoid
proprietary struct.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/4d5409433c681557f8187b13f0bbf124a662ff96.1694792595.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a00e00a2 12-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Use standard function in rtllib_rx_check_duplicate()

Use standard function ieee80211_is_beacon() to avoid proprietary code and
to increase readability.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/b74b6ef5e266504b9e3d84495bcd8fe4978b4ded.1694546300.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dabd8585 12-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Use standard function in rtllib_process_probe_response()

Replace proprietary is_beacon() with ieee80211_is_beacon() and
proprietary "WLAN_FC_GET_STYPE(frame_ctl) == RTLLIB_STYPE_PROBE_RESP"
with standard function to increase readability.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/ad24a52c045d6638103f4263b811c87d18cb3e97.1694546300.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 95862d08 12-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Use standard ieee80211 function in rtllib_rx_mgt()

Replace WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)) and comparison
with standard function to avoid proprietary code and to increase
readability.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/26cb0a7758186090a618a134c21e237594bbc525.1694546300.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 19444ae9 12-Sep-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove useless equation in debug output

When "switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)))" results
in "case RTLLIB_STYPE_BEACON:" there is no need to calculate this again
inside "case" and when a frame is a beacon there is no need to print the
frame identifier again as it is explicit.
Same for PROBE RESPONSE and PROBE REQUEST. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/f3c8deddac66d11c41ba720e4048aba37e41e885.1694546300.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 18c258e4 25-Aug-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable pTS in function rtllib_rx_InfraAdhoc()

Rename variable pTS in function rtllib_rx_InfraAdhoc() to ts
to fix checkpatch warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20230825140847.501113-17-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# eb49f437 25-Aug-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable pRxTS in function rtllib_rx_check_duplicate()

Rename variable pRxTS in function rtllib_rx_check_duplicate() to ts
to fix checkpatch warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20230825140847.501113-16-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 959e4565 25-Aug-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable pTS in function RxReorderIndicatePacket()

Rename variable pTS in function RxReorderIndicatePacket() to ts
to fix checkpatch warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20230825140847.501113-15-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 90b35a75 25-Aug-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable pTS in function rtllib_FlushRxTsPendingPkts()

Rename variable pTS in function rtllib_FlushRxTsPendingPkts() to ts
to fix checkpatch warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20230825140847.501113-14-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b4a08d2e 25-Aug-2023 Tree Davies <tdavies@darkphysics.net>

Staging: rtl8192e: Rename variable pTS in function AddReorderEntry()

Rename variable pTS in function AddReorderEntry() to ts
to fix checkpatch warning Avoid CamelCase.

Signed-off-by: Tree Davies <tdavies@darkphysics.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20230825140847.501113-13-tdavies@darkphysics.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 42f9bcfc 13-Aug-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove unsupported mode IW_MODE_MESH

Tasklet irq_rx_tasklet is scheduled when hw is receiving frames. Function
_rtl92e_irq_rx_tasklet() is then called which calls then
_rtl92e_rx_normal(). In _rtl92e_rx_normal() all frames are processed by
rtllib_rx(). When ieee->iw_mode is IW_MODE_MESH the function returns
0. The calling function then calls: dev_kfree_skb_any() which clears
the skb. So the driver clears all packets received in this mode. Remove
dead code in mode IW_MODE_MESH.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/54230361abba9f33827eac9bf5074dd9f62d787b.1691908402.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 31a14cba 13-Aug-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove unsupported mode IW_MODE_REPEAT

Tasklet irq_rx_tasklet is scheduled when hw is receiving frames. Function
_rtl92e_irq_rx_tasklet() is then called which calls then
_rtl92e_rx_normal(). In _rtl92e_rx_normal() all frames are processed by
rtllib_rx(). When ieee->iw_mode is IW_MODE_REPEAT the function returns
0. The calling function then calls: dev_kfree_skb_any() which clears
the skb. So the driver clears all packets received in this mode. Remove
dead code in mode IW_MODE_REPEAT.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/dc6a0ac89970f5b80a552453a9d057c24f53f43b.1691908402.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2b632f7f 13-Aug-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove unsupported mode IW_MODE_MASTER

Tasklet irq_rx_tasklet is scheduled when hw is receiving frames. Function
_rtl92e_irq_rx_tasklet() is then called which calls then
_rtl92e_rx_normal(). In _rtl92e_rx_normal() all frames are processed by
rtllib_rx(). When ieee->iw_mode is IW_MODE_MASTER the function returns
0. The calling function then calls: dev_kfree_skb_any() which clears the
skb. So the driver clears all packets received in this mode. Remove dead
code in mode IW_MODE_MASTER.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/9cd4574e4cfe0a2d7afce03c9b868757e215a23c.1691908402.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 206e69b6 29-Jul-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove empty function rtllib_rx_Mesh()

Function rtllib_rx_Mesh() returns always 0. Variable ret is already
initialized with 0. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/7c1aee16a95cd52149faf80c83b6fa19d6499913.1690615475.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 37a207d8 29-Jul-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove empty function rtllib_rx_Master()

Function rtllib_rx_Master() returns always 0. Variable ret is already
initialized with 0. Remove dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/9604360121c5547cfaa282f73af5b948cdfbd769.1690615475.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a56cbbcc 24-Jun-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove variable host_decrypt as it is constant

ieee->host_decrypt also named priv->rtllib->host_decrypt is initialized
to 1 and then unchanged. All evaluations will result accordingly. Remove
resulting dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/637350e9bc3edded665009a30d12350157e8a9a9.1687583718.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a6efe935 19-Jun-2023 Yogesh Hegde <yogi.kernel@gmail.com>

staging: rtl8192e: Rename variable LeisurePSLeave

Rename variable LeisurePSLeave to leisure_ps_leave to avoid
CamelCase which is not accepted by checkpatch.

Signed-off-by: Yogesh Hegde <yogi.kernel@gmail.com>
Link: https://lore.kernel.org/r/3c63f4d750b7365f233c35c676325c5e4ca54a4c.1687183827.git.yogi.kernel@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2445e3a5 17-Jun-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename RTLLIB_LINKED to MAC80211_LINKED

Rename RTLLIB_LINKED to MAC80211_LINKED to align with rtlwifi driver.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/532bd98301657b2a8329e95eccb993540ae9ba3f.1687007788.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fff6e869 17-Jun-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename RTLLIB_NOLINK to MAC80211_NOLINK

Rename RTLLIB_NOLINK to MAC80211_NOLINK to align with rtlwifi driver.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/74feefdf800304deaf918efbc04344865f7aa01d.1687007788.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 52ac3ff9 17-Jun-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename state to link_state

Rename state to link_state to align with rtlwifi driver and to
increase readability as state is to general.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/9cf4d0b01c6a84a11939099b628754d4c6d54839.1687007788.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5cac011c 17-Jun-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename constant IEEE_x to WIRELESS_MODE_x

Rename constant IEEE_B to WIRELESS_MODE_B, IEEE_G -> WIRELESS_MODE_G and
IEEE_N_24G -> WIRELESS_MODE_N_24G to align with rtlwifi driver as
requested in TODO.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/37d81ab3cbb0231868d75b11eaa2f65a0e6a9379.1687007788.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 26cdc2b7 17-Jun-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove unsupported modes IEEE_N_5G and IEEE_A

Remove unsupported modes IEEE_N_5G and IEEE_A as those are not supported
by hardware and are not offered by user software. Remove resulting dead
code and unused defines.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/40c5b21654376348144280dbe45203140c6e6807.1687007788.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 90262a95 17-Jun-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove variable stats->freq as it is constant

stats->freq is initialized with 1 and then unchanged. All evaluations
will result accordingly. Remove resulting dead code and unused defines.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/4d8801d37889e6af4f43dff10d1426fc7918f562.1687007788.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d88b46ce 03-Jun-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Add cfg80211.h and remove defined variables

Add cfg80211 and remove defined variables rfc1042_header and
bridge_tunnel_header as they are then already defined. Usage of cfg80211
is required to merge driver into wireless subsystem.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Message-ID: <20230603085251.GA20230@matrix-ESPRIMO-P710>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 77f2760e 20-Apr-2023 Stephan Snyman <rooiratel@tinyglitch.net>

staging: rtl8192e: add missing braces {}

Add missing braces to if/else statements to adhere to the
Linux kernel coding-style guidelines.
These issues were reported by checkpatch.pl

"CHECK: braces {} should be used on all arms of this statement"

Signed-off-by: Stephan Snyman <rooiratel@tinyglitch.net>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20230420133209.4661-1-rooiratel@tinyglitch.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6e1ce577 24-Mar-2023 Khadija Kamran <kamrankhadijadj@gmail.com>

staging: rtl8192e: remove blank lines after '{'

Remove unnecessary blank lines after an open brace to adhere to the
Linux kernel coding-style guidelines. These issues are reported by
checkpatch.pl

"CHECK: Blank lines aren't necessary after an open brace '{'"

Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/e7cd8152e6986d361f81289868040889224bd1bf.1679696777.git.kamrankhadijadj@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2ac74cf1 24-Mar-2023 Khadija Kamran <kamrankhadijadj@gmail.com>

staging: rtl8192e: add spaces around binary operators

Use spaces around binary operators as suggested by Linux kernel coding
style guidelines.
Issues reported by checkpatch.pl for the following binary operators:
+ , - , * , | , <<

Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/44a545cf8e99ebfdbfc3f5bb314f3828abe98558.1679696777.git.kamrankhadijadj@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6ca4e57a 24-Mar-2023 Khadija Kamran <kamrankhadijadj@gmail.com>

staging: rtl8192e: add blank lines after declarations

Add blank lines after declarations to adhere to the Linux kernel
coding-style guidelines. These issues are reported by checkpatch.pl

"CHECK: Please use a blank line after function/struct/union/enum
declarations"

Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/d8a5e738046ffdc1b257e1935eacb8e16af34d5e.1679696777.git.kamrankhadijadj@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 336af4bb 24-Mar-2023 Khadija Kamran <kamrankhadijadj@gmail.com>

staging: rtl8192e: remove extra blank lines

Remove the extra blank line in accordance with the Linux kernel
coding-style regulations. These issues were reported by checkpatch.pl

"CHECK: Please don't use multiple blank lines"

Signed-off-by: Khadija Kamran <kamrankhadijadj@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/6d7388f944e8296227269c7472a462ea7c94149c.1679696777.git.kamrankhadijadj@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f7cc8739 25-Feb-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove checks of pointer to LeisureP.. and start_se..

Function pointers of LeisurePSLeave and start_send_beacons is set while
executing the probe function. Therefore a NULL pointer check is not
required. Remove checks as it is dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/cd828bb1c8dfbb6d2a85d770c82afbb9889e0ea2.1677345331.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 237fea2f 25-Feb-2023 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Remove checks of pointer to handle_a.. and handle_b..

Function pointers of handle_assoc_response and handle_beacon is set while
executing the probe function. Therefore a NULL pointer check is not
required. Remove checks as it is dead code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/5c0fd114c24616bc03271ccb0a72a6bc68e45d61.1677345331.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# c7912f27 07-Dec-2022 Colin Ian King <colin.i.king@gmail.com>

staging: rtl8192e: Fix spelling mistake "ContryIE" -> "CountryIE"

There is a spelling mistake in a netdev_info message. Fix it.

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


# d30f4436 23-Nov-2022 YueHaibing <yuehaibing@huawei.com>

staging: rtl8192e: Fix potential use-after-free in rtllib_rx_Monitor()

The skb is delivered to netif_rx() in rtllib_monitor_rx(), which may free it,
after calling this, dereferencing skb may trigger use-after-free.
Found by Smatch.

Fixes: 94a799425eee ("From: wlanfae <wlanfae@realtek.com> [PATCH 1/8] rtl8192e: Import new version of driver from realtek")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20221123081253.22296-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ccdbe14b 12-Nov-2022 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename pHTInfo

Rename variable pHTInfo to ht_info to avoid CamelCase which is not
accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/88cdc0ef393c92cb2102a66893c5320e8c8606df.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 62310f88 12-Nov-2022 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename bFilterSour.., CCKPresentAt.. and ResetProg..

Rename variable bFilterSourceStationFrame to fltr_src_sta_frame,
CCKPresentAttentuation to cck_present_attn and ResetProgress to
rst_progress to avoid CamelCase which is not accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/25ab52350a4a3249a1f76b28eea10c44e2f9552d.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8e5d08ce 12-Nov-2022 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename bNetPromisc.., IntelPromiscu.. and bPromiscu..

Rename variable bNetPromiscuousMode to net_promiscuous_md,
IntelPromiscuousModeInfo to intel_promiscuous_md_info and bPromiscuousOn
to promiscuous_on to avoid CamelCase which is not accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/69d9998a30ce2286c3ae6cb4510174e1255b3f9e.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7e5cfa3c 12-Nov-2022 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename LinkDetectInfo

Rename variable LinkDetectInfo to link_detect_info to avoid CamelCase
which is not accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/48d043893fa755490e810af204e5b7ad2ba606de.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 155c89f1 24-Sep-2022 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename RxRe...WinSize, RxReorder... and RxReorderDr...

Rename variable RxReorderWinSize to rx_reorder_win_size,
RxReorderPendingTime to rx_reorder_pending_time and RxReorderDropCounter
to rx_reorder_drop_counter to avoid CamelCase which is not accepted by
checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/e09ef6e2edc88e32782202589a9230204b547a9c.1664055213.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 55bce0ae 24-Sep-2022 Philipp Hortmann <philipp.g.hortmann@gmail.com>

staging: rtl8192e: Rename szRT2RTAggBuffer, bRegRxRe... and bCurRxReo...

Rename variable szRT2RTAggBuffer to sz_rt2rt_agg_buf, bRegRxReorderEnable
to reg_rx_reorder_enable and bCurRxReorderEnable to cur_rx_reorder_enable
to avoid CamelCase which is not accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/af445e0a80dc8e153a1ba81df99309f19a69d6cb.1664055213.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 55de6cb7 19-Apr-2022 Solomon Tan <wjsota@gmail.com>

staging: rtl8192e: Remove space after cast

This patch addresses the checkpatch.pl flag that there should not be a
space after a cast.

Signed-off-by: Solomon Tan <wjsota@gmail.com>
Link: https://lore.kernel.org/r/20220419124318.8028-1-wjsota@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f96f8ae0 11-Apr-2022 Davidlohr Bueso <dave@stgolabs.net>

staging/rtl8192e,ieee80211: replace ps tasklet with work

Tasklets have long been deprecated as being too heavy on the system
by running in irq context - and this is not a performance critical
path. If a higher priority process wants to run, it must wait for
the tasklet to finish before doing so.

rtllib_sta_ps() and ieee80211_sta_ps() will now run in process context
and have further concurrency (tasklets being serialized among themselves),
but this is done holding the ieee->lock, so it should be fine.

Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://lore.kernel.org/r/20220411151620.129178-7-dave@stgolabs.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 02d838de 15-Mar-2022 Colin Ian King <colin.king@intel.com>

staging: rtl8192e: Fix spelling mistake "RESQUEST" -> "REQUEST"

There is a spelling mistake in a netdev_dbg message. Fix it.

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


# ada0e6db 06-Aug-2021 Kees Cook <keescook@chromium.org>

staging: rtl8192e: Avoid field-overflowing memcpy()

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memcpy(), memmove(), and memset(), avoid
intentionally writing across neighboring fields.

Split the 3 addr memcpy() into 3 memcpy() calls so the compiler doesn't
think an overflowing memcpy() happens against the addr1 field (the
neighbors are intended to be copied as well).

rtllib_read_qos_param_element() copies a struct rtllib_info_element
into a struct rtllib_qos_information_element, but is actually wanting to
copy into the larger struct rtllib_qos_parameter_info (the contents of
ac_params_record[] is later examined). Refactor the routine to perform
centralized checks, and copy the entire contents directly (since the id
and len members match the elementID and length members):

struct rtllib_info_element {
u8 id;
u8 len;
u8 data[];
} __packed;

struct rtllib_qos_information_element {
u8 elementID;
u8 length;
u8 qui[QOS_OUI_LEN];
u8 qui_type;
u8 qui_subtype;
u8 version;
u8 ac_info;
} __packed;

struct rtllib_qos_parameter_info {
struct rtllib_qos_information_element info_element;
u8 reserved;
struct rtllib_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
} __packed;

Cc: Darshan D V <darshandv10@gmail.com>
Cc: Aditya Srivastava <yashsri421@gmail.com>
Cc: devel@driverdev.osuosl.org
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210806201106.2871169-1-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1ba6d8dc 10-May-2021 Ojaswin Mujoo <ojaswin98@gmail.com>

staging: rtl8192e: Avoid multiple line dereference

Avoid multiple line dereference to make the code more readable, as
suggested by checkpatch.pl

This patch fixes the following checkpatch.pl warning:

- WARNING: Avoid multiple line dereference
prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
FILE: ./rtl8192e/rtl8192e/rtl_cam.c:189

- WARNING: Avoid multiple line dereference
prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
FILE: ./rtl8192e/rtl8192e/rtl_cam.c:195

- WARNING: Avoid multiple line dereference
prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
FILE: ./rtl8192e/rtl8192e/rtl_cam.c:204

- WARNING: Avoid multiple line dereference
prefer 'priv->rtllib->swcamtable[4].key_buf[0]'
FILE: ./rtl8192e/rtl8192e/rtl_cam.c:209

- WARNING: Avoid multiple line dereference
prefer 'info_element->data[info_element->len]'
FILE: ./rtl8192e/rtllib_rx.c:2287

Signed-off-by: Ojaswin Mujoo <ojaswin98@gmail.com>
Link: https://lore.kernel.org/r/435b60bd8874f8105b4af6e7eb9ee5bdbfe3112f.1620642396.git.ojaswin98@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3b32b210 01-Mar-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename RxLastFragNum to rx_last_frag_num in rx_ts_record struct

Rename RxLastFragNum to rx_last_frag_num to silence a checkpatch warning
about CamelCase.

Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210301215335.767-9-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6d852649 01-Mar-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename RxLastSeqNum to rx_last_seq_num in rx_ts_record struct

Rename RxLastSeqNum to rx_last_seq_num to silence a checkpatch warning
about CamelCase.

Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210301215335.767-8-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d36d3096 01-Mar-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename RxPktPendingTimer to rx_pkt_pending_timer in rx_ts_record struct

Rename RxPktPendingTimer to rx_pkt_pending_timer to silence a checkpatch
warning about CamelCase.

Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210301215335.767-6-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bd1b2779 01-Mar-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename RxPendingPktList to rx_pending_pkt_list in rx_ts_record struct

Rename RxPendingPktList to rx_pending_pkt_list to silence a checkpatch
warning about CamelCase.

Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210301215335.767-5-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 57f1e71e 01-Mar-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename RxTimeoutIndicateSeq to rx_timeout_indicate_seq in rx_ts_record struct

Rename RxTimeoutIndicateSeq to rx_timeout_indicate_seq to silence a
checkpatch warning about CamelCase.

Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210301215335.767-4-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b9788755 01-Mar-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename RxIndicateSeq to rx_indicate_seq in rx_ts_record struct

Rename RxIndicateSeq to rx_indicate_seq to silence a checkpatch warning
about CamelCase.

Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210301215335.767-3-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f7138484 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdHT1R to bd_ht_1r in bss_ht struct

Rename bdHT1R to bd_ht_1r to silence a checkpatch warning about
CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-13-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6628c674 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename RT2RT_HT_Mode to rt2rt_ht_mode in bss_ht struct

Rename RT2RT_HT_Mode to rt2rt_ht_mode to silence a checkpatch warning
about CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-12-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fe403d4b 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdRT2RTLongSlotTime to bd_rt2rt_long_slot_time in bss_ht struct

Rename bdRT2RTLongSlotTime to bd_rt2rt_long_slot_time to silence a
checkpatch warning about CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-11-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3f1f39fb 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdRT2RTAggregation to bd_rt2rt_aggregation in bss_ht struct

Rename bdRT2RTAggregation to bd_rt2rt_aggregation to silence a
checkpatch warning about CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-10-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e6378e21 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdBandWidth to bd_bandwidth in bss_ht struct

Rename bdBandWidth to bd_bandwidth to silence a checkpatch warning about
CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-9-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2fbcd6de 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdHTSpecVer to bd_ht_spec_ver in bss_ht struct

Rename bdHTSpecVer to bd_ht_spec_ver to silence a checkpatch warning
about CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-8-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 060d3f6c 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdHTInfoLen to bd_ht_info_len in bss_ht struct

Rename bdHTInfoLen to bd_ht_info_len to silence a checkpatch warning
about CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-7-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 2408ee9e 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdHTInfoBuf to bd_ht_info_buf in bss_ht struct

Rename bdHTInfoBuf to bd_ht_info_buf to silence a checkpatch warning
about CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-6-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 20e90635 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdHTCapLen to bd_ht_cap_len in bss_ht struct

Rename bdHTCapLen to bd_ht_cap_len to silence a checkpatch warning about
CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-5-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b87b2108 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdHTCapBuf to bd_ht_cap_buf in bss_ht struct

Rename bdHTCapBuf to bd_ht_cap_buf to silence a checkpatch warning about
CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-4-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b3b55bd7 20-Feb-2021 William Durand <will+git@drnd.me>

staging: rtl8192e: rename bdSupportHT to bd_support_ht in bss_ht struct

Rename bdSupportHT to bd_support_ht to silence a checkpatch warning
about CamelCase.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: William Durand <will+git@drnd.me>
Link: https://lore.kernel.org/r/20210220172909.15812-3-will+git@drnd.me
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 72ad25fb 23-Mar-2021 Atul Gopinathan <atulgopinathan@gmail.com>

staging: rtl8192e: Fix incorrect source in memcpy()

The variable "info_element" is of the following type:

struct rtllib_info_element *info_element

defined in drivers/staging/rtl8192e/rtllib.h:

struct rtllib_info_element {
u8 id;
u8 len;
u8 data[];
} __packed;

The "len" field defines the size of the "data[]" array. The code is
supposed to check if "info_element->len" is greater than 4 and later
equal to 6. If this is satisfied then, the last two bytes (the 4th and
5th element of u8 "data[]" array) are copied into "network->CcxRmState".

Right now the code uses "memcpy()" with the source as "&info_element[4]"
which would copy in wrong and unintended information. The struct
"rtllib_info_element" has a size of 2 bytes for "id" and "len",
therefore indexing will be done in interval of 2 bytes. So,
"info_element[4]" would point to data which is beyond the memory
allocated for this pointer (that is, at x+8, while "info_element" has
been allocated only from x to x+7 (2 + 6 => 8 bytes)).

This patch rectifies this error by using "&info_element->data[4]" which
correctly copies the last two bytes of "data[]".

NOTE: The faulty line of code came from the following commit:

commit ecdfa44610fa ("Staging: add Realtek 8192 PCI wireless driver")

The above commit created the file `rtl8192e/ieee80211/ieee80211_rx.c`
which had the faulty line of code. This file has been deleted (or
possibly renamed) with the contents copied in to a new file
`rtl8192e/rtllib_rx.c` along with additional code in the commit
94a799425eee (tagged in Fixes).

Fixes: 94a799425eee ("From: wlanfae <wlanfae@realtek.com> [PATCH 1/8] rtl8192e: Import new version of driver from realtek")
Cc: stable@vger.kernel.org
Signed-off-by: Atul Gopinathan <atulgopinathan@gmail.com>
Link: https://lore.kernel.org/r/20210323113413.29179-1-atulgopinathan@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1e9a9c7c 20-Dec-2020 Aditya Srivastava <yashsri421@gmail.com>

staging: rtl8192e: fix bool comparison in expressions

There are certain conditional expressions in rtl8192e, where a boolean
variable is compared with true/false, in forms such as (foo == true) or
(false != bar), which does not comply with checkpatch.pl (CHECK:
BOOL_COMPARISON), according to which boolean variables should be
themselves used in the condition, rather than comparing with true/false

E.g. in drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c,
"if (Type == true)" can be replaced with: "if (Type)"

Replace all such expressions with the bool variables appropriately

Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
Link: https://lore.kernel.org/r/20201220194224.12835-1-yashsri421@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 39ddadf1 11-Mar-2020 Takashi Iwai <tiwai@suse.de>

staging: rtl8192e: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20200311092451.23933-3-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 756e4624 17-Jul-2019 YueHaibing <yuehaibing@huawei.com>

staging: rtl8192e: remove set but not used variable 'payload '

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/staging/rtl8192e/rtllib_rx.c: In function rtllib_rx_InfraAdhoc:
drivers/staging/rtl8192e/rtllib_rx.c:1303:6: warning:
variable payload set but not used [-Wunused-but-set-variable]

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190717143551.29200-1-yuehaibing@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 18056f34 01-Apr-2019 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

staging: rtl8192e: add proper SPDX identifiers on files that did not have them.

There were a few files for the rtl8192e driver that did not have SPDX
identifiers on them, so fix that up. At the same time, remove the "free
form" text that specified the license of the file, as that is impossible
for any tool to properly parse.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 43defd93 10-Feb-2019 Himadri Pandya <himadri18.07@gmail.com>

staging: rtl8192e: rename function Dot11d_UpdateCountryIe to dot11d_update_country - style

Rename function Dot11d_UpdateCountryIe to dot11d_update_country to fix
checkpatch warning: Avoid CamelCase.

Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e4441911 07-Jan-2019 Colin Ian King <colin.king@canonical.com>

staging: rtl8192e: fix various indentation issues

There are several statements that have indentation issues, fix these.

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


# 1b873bd4 28-Feb-2018 Santha Meena Ramamoorthy <santhameena13@gmail.com>

staging: rtl8192e: move logical continuation to previous line

Move logical continuation '&&' to the previous line to conform to the
Linux kernel coding style. Issue found using checkpatch.

Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 783778e3 20-Jan-2018 Colin Ian King <colin.king@canonical.com>

staging: rtl8192e: remove two redundant assignments

Clang detected two redundant assignments that can be safely removed.
The first is the removal of the duplicated assignment to pointer 'hdr',
this has already been initialized with the same value. The second is
the removal of the redundant initialization of variable 'timeout', this
assigned value is never read and the variable is reassigned a new value
a little later.

Remove both redundant assignments, cleans up clang warnings:
drivers/staging/rtl8192e/rtllib_rx.c:1305:27: warning: Value stored to
'hdr' during its initialization is never read
drivers/staging/rtl8192e/rtllib_softmac.c:1971:6: warning: Value stored
to 'timeout' during its initialization is never read

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


# b952f4df 18-Jun-2017 yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>

net: manual clean code which call skb_put_[data:zero]

Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 59ae1d12 16-Jun-2017 Johannes Berg <johannes.berg@intel.com>

networking: introduce and use skb_put_data()

A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.

An spatch similar to the one for skb_put_zero() converts many
of the places using it:

@@
identifier p, p2;
expression len, skb, data;
type t, t2;
@@
(
-p = skb_put(skb, len);
+p = skb_put_data(skb, data, len);
|
-p = (t)skb_put(skb, len);
+p = skb_put_data(skb, data, len);
)
(
p2 = (t2)p;
-memcpy(p2, data, len);
|
-memcpy(p, data, len);
)

@@
type t, t2;
identifier p, p2;
expression skb, data;
@@
t *p;
...
(
-p = skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
|
-p = (t *)skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
)
(
p2 = (t2)p;
-memcpy(p2, data, sizeof(*p));
|
-memcpy(p, data, sizeof(*p));
)

@@
expression skb, len, data;
@@
-memcpy(skb_put(skb, len), data, len);
+skb_put_data(skb, data, len);

(again, manually post-processed to retain some comments)

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 8f931dcd 13-May-2017 Malcolm Priestley <tvboxspy@gmail.com>

staging: rtl8192e: Remove RX: IEEE802.1X EAPOL frame! warning.

RX will receive countless EAPOL frames over the life of the connection.

A number of conditional calls to rtllib_is_eapol_frame are made in this function.

So this call serves no purpose other than to spam logs with false warning that
it is indeed a EAPOL frame, remove it.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4a7c9726 18-Jan-2017 Tobias Klauser <tklauser@distanz.ch>

net: Remove usage of net_device last_rx member

The network stack no longer uses the last_rx member of struct net_device
since the bonding driver switched to use its own private last_rx in
commit 9f242738376d ("bonding: use last_arp_rx in slave_last_rx()").

However, some drivers still (ab)use the field for their own purposes and
some driver just update it without actually using it.

Previously, there was an accompanying comment for the last_rx member
added in commit 4dc89133f49b ("net: add a comment on netdev->last_rx")
which asked drivers not to update is, unless really needed. However,
this commend was removed in commit f8ff080dacec ("bonding: remove
useless updating of slave->dev->last_rx"), so some drivers added later
on still did update last_rx.

Remove all usage of last_rx and switch three drivers (sky2, atp and
smc91c92_cs) which actually read and write it to use their own private
copy in netdev_priv.

Compile-tested with allyesconfig and allmodconfig on x86 and arm.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jay Vosburgh <j.vosburgh@gmail.com>
Cc: Veaceslav Falico <vfalico@gmail.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Cc: Mirko Lindner <mlindner@marvell.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jay Vosburgh <jay.vosburgh@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 29f22246 15-Nov-2016 Yamanappagouda Patil <goudapatilk@gmail.com>

staging: rtl8192e: Added new line after declaration

Fixed checkpatch.pl "Missing a blank line after declarations" warnings.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 15ed5398 28-Oct-2016 Elise Lennion <elise.lennion@gmail.com>

staging: rtl8192e: Standardize test for NULL.

The test for NULL of the return variable of functions was changed from
(ret == NULL) to !ret to match the standard.

Coccinelle was used with semantic patch:
@@
expression e;
identifier id, f;
statement S;
@@

f(...) { <+...

id =
\(kmalloc\|devm_kzalloc\|kmalloc_array\|devm_ioremap
\|usb_alloc_urb\|alloc_netdev\|dev_alloc_skb\) (...)

... when any
when != id = e

+ if (!id)
- if (\(NULL == id\|id == NULL\))
S

...+> }

Signed-off-by: Elise Lennion <elise.lennion@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5d43dfdb 24-Oct-2016 Arnd Bergmann <arnd@arndb.de>

staging: rtl8192x: fix bogus maybe-uninitialized warning

The rtllib_rx_extract_addr() is supposed to set up the mac addresses
for four possible cases, based on two bits of input data. For
some reason, gcc decides that it's possible that none of the these
four cases apply and the addresses remain uninitialized:

drivers/staging/rtl8192e/rtllib_rx.c: In function ‘rtllib_rx_InfraAdhoc’:
include/linux/etherdevice.h:316:61: error: ‘*((void *)&dst+4)’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/staging/rtl8192e/rtllib_rx.c:1318:5: note: ‘*((void *)&dst+4)’ was declared here
ded from /git/arm-soc/drivers/staging/rtl8192e/rtllib_rx.c:40:0:
include/linux/etherdevice.h:316:36: error: ‘dst’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
drivers/staging/rtl8192e/rtllib_rx.c:1318:5: note: ‘dst’ was declared here

This warning is clearly nonsense, but changing the last case into
'default' makes it obvious to the compiler too, which avoids the
warning and probably leads to better object code too.

As the same warning appears in other files that have the exact
same code, I'm fixing it in both rtl8192e and rtl8192u, even
though I did not observe it for the latter.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 138bdc6d 24-Feb-2016 Tapan Prakash T <tapanprakasht@gmail.com>

drivers: staging: rtl8192e: rtllib_rx.c: Fix blank lines before a close brace

Fixed checkpatch.pl issue 'Blank lines aren't necessary before a close
brace'

Signed-off-by: Tapan Prakash T <tapanprakasht@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3d152862 24-Feb-2016 Tapan Prakash T <tapanprakasht@gmail.com>

drivers: staging: rtl8192e: rtllib_rx.c: Fix code indent for conditional statement

Fixed checkpatch.pl warning 'suspect code indent for conditional
statements'

Signed-off-by: Tapan Prakash T <tapanprakasht@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7949be66 18-Feb-2016 Bhaktipriya Shridhar <bhaktipriya96@gmail.com>

staging: rtl8192e: Drop useless initialisation

Removed initialisation of a varible if it is immediately reassigned.

Changes were made using Coccinelle.

@@
type T;
constant C;
expression e;
identifier i;
@@
T i
- = C
;
i = e;

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4c29207a 20-Sep-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix CONSTANT_COMPARISON warnings

Remove yoda conditions where pointed by checkpatch.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fc00af0c 20-Sep-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix SUSPECT_CODE_INDENT warnings

Fix SUSPECT_CODE_INDENT warnings (indentation).

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5143f7a3 23-Jul-2015 Ioan-Adrian Ratiu <adi@adirat.com>

staging: rtl8192e: rtllib: fix macro style issue

Remove macro and use explicit case statements. Code is a little
longer but clearer. Checkpatch.pl does not complain anymore.

Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ed436033 14-Jul-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Make rtllib_rx_mgt() static

Function is not referenced outside of rtllib_rx.c

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e93c18c7 14-Jul-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Remove rtllib_stats structure

Two remaining fields of rtllib_stats are only incremented, but
never read.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 47eae6dd 15-Jun-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Remove rtllib_device::agregation

Variable is always true; Resolve condition where it is used
(and change indentation of conditional expression).

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7f5678ee 15-Jun-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Remove rtllib_network::last_associate

Variable was initialized and never used.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 12080974 04-Jun-2015 Dan Carpenter <dan.carpenter@oracle.com>

staging: rtl8192e: fix some confusing indenting

The indenting here causes a static checker warning:

drivers/staging/rtl8192e/rtllib_rx.c:626 RxReorderIndicatePacket()
warn: curly braces intended?

The code is actually correct, it's just that these lines were pushed in
an extra indent level by mistake in 35e33b0468ab ('staging: rtl8192e:
Fix LONG_LINE warnings').

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d9c1fff5 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix trivial LONG_LINE errors

Reindent lines to make checkpatch happy.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a94aa9ad 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Replace ?: with max_t

Improve readability and make checkpatch happy.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 31085232 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix LONG_LING in rtllib_parse_info_param()

Take out MIFE_TYPE_HT_CAP processing into separate function -
rtllib_parse_mfie_ht_cap()

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 35e33b04 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix LONG_LINE warnings

Fix most of simple LONG_LINE warnings. None of the changes should affect
behaviour of code, so several modifications are included in this patch:
- Code is reindented where needed
- Local variable names are compacted (priv -> p)
- Unnecessary casts are removed
- Nested ifs are replaced with logical and
- a = b = c = d expressions are split
- Replace if/then series with clamp_t()
- Removed unneeded scopes

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7bdfaa0a 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix PREFER_PR_LEVEL warnings

Fix most of remaining PREFER_PR_LEVEL warnings in rtllib.
Replace printk() with netdev_* if possible, pr_* in other cases.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b94436b5 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Remove RTLLIB_DEBUG()

- Use netdev_dbg or netdev_vdbg instead of RTLLIB_DEBUG()
- Reformat some messages for better readability
- Remove RTLLIB_DEBUG messages that make no sense

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e9fea2ec 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Remove RTLLIB_DEBUG_MGMT()

- Use netdev_dbg() instead of RTLLIB_DEBUG_MGMT()
- Remove RTLLIB_DEBUG_MGMT()
- Pass net_device to auth_parse(), auth_rq_parse() and assoc_rq_parse()
- Remove duplicated messages

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8f90dfbf 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Remove RTLLIB_DEBUG_QOS()

- Pass extra argument (rtllib_device) to rtllib_parse_qos_info_param_IE()
and update_network()
- Replace RTLLIB_DEBUG_QOS() with netdev_dbg()
- Remove RTLLIB_DEBUG_QOS()

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e77c752f 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Remove RTLLIB_DEBUG_(FRAG|EAP|DROP|STATE|TX|RX)()

Use netdev_dbg() instead.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 521a9cbd 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Remove RTLLIB_DEBUG_SCAN()

Use netdev_dbg() instead, remove duplicated logs.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ad5c8e05 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Simplify rtllib_process_probe_response()

- Extract frame_ctl once and use it as variable.
- Drop endian conversion in is_beacon() function
(used in simplified function only)
- Simplify debug messages
- Invert STYPE checks in debug messages - it is valid
as only BEACON and PROBE_RESP are allowed

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 11e672c3 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Replace RTLLIB_DEBUG(DL_ERR) with netdev_*()

Replace all RTLLIB_DEBUG(RTLLIB_DL_ERR, *) calls with netdev_err()
for errors that really should be reported to user.
Use netdev_warn() for the rest.
Rephrase some of the messages to make them more readable/compact.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 80d2579d 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param()

Move MFIE_TYPE_GENERIC handler to rtllib_parse_mife_generic() function.
Code was not altered significantly, therefore in some places it generates
LONG_LINE checkpatch.pl warnings.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b57ceb19 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix PREFER_ETHER_ADDR_COPY warnings

Replace memcpy() with ether_addr_copy() where possible to make
checkpatch.pl happy.
Change was target tested (download 1Mb file over WPA2 network)
with BUG trap for unaligned addresses in ether_addr_copy()

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 06c11107 31-May-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Make ethernet addresses properly aligned

Reorder ethernet addresses allocated on stack or in non-packed
structures to keep them aligned(2).
Use ETH_ALEN as array length in places where it was hardcoded to 6.

Alignment verified using pahole where possible and target-tested
with BUG_ON() trap in ether_addr_copy.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# fbb052f9 13-Apr-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtllib_parse_info_param()

- Replace ?: with min_t
- Remove condition that is always true

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f6692285 13-Apr-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix SPACING errors

Fix several SPACING errors to make checkpatch happy.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8852112e 31-Mar-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Remove dead code

Remove commented-out code

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 14b40d92 31-Mar-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Comment cleanup (style/format)

- Multiline comments use "network subsystem comment style"
- Merge short multiline comments
- Remove empty comments
- Remove function name comment at the end of small (<1 screen) functions
- Reformat 802.11 data frame format to use spaces and network format

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 025b8bbe 31-Mar-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix UNNECESSARY_PARENTHESES warnings

Fix 'Unnecessary parentheses' checkpatch.pl warning

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0f0688b3 31-Mar-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix RETURN_VOID warnings

Fix 'void function return statements are not generally useful'
checkpatch.pl warnings

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 285b7c00 31-Mar-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: Fix UNNECESSARY_ELSE warning

Fix checkpatch warnings 'else is not generally useful after a break or return'

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d69d2054 16-Mar-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: fix coding style warnings (printk -> netdev_*)

Use netdev_*, dev_* or pr_* instead of printk where possible.
KERN_DEBUG messages are left intact as pr_dbg has different behaviour.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dc986e3e 16-Mar-2015 Mateusz Kulikowski <mateusz.kulikowski@gmail.com>

staging: rtl8192e: fix coding style issues (spaces before semicolon)

Fix checkpatch.pl warning 'space prohibited before semicolon'.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8b9733c1 11-Mar-2015 Vaishali Thakkar <vthakkar1994@gmail.com>

Staging: rtl8192e: Eliminate use of MSECS macro

Use msecs_to_jiffies instead of driver specific macro
MSECS. This is done using Coccinelle and semantic
patch used for this is as follows:

@@expression t;@@

- MSECS(t)
+ msecs_to_jiffies(t)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d009f0d7 08-Mar-2015 Darshana Padmadas <darshanapadmadas@gmail.com>

staging: rtl8192e: Replace min with min_t

This patch replaces min with min_t and eliminates the
following warnings found by checkpatch.pl:

WARNING: min() should probably be min_t

Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# ad22d55c 04-Mar-2015 Matteo Semenzato <mattew8898@gmail.com>

Staging: rtl8192e: remove assignment of function parameter

This patch removes the assignment of a function parameter that has no
effect.

Signed-off-by: Matteo Semenzato <mattew8898@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b6b0012c 05-Mar-2015 Quentin Lambert <lambert.quentin@gmail.com>

staging: rtl8192e: Remove unnecessary OOM message

This patch reduces the kernel size by removing error messages that duplicate
the normal OOM message.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)

@@
identifier f,print,l;
expression e;
constant char[] c;
@@

e = \(kzalloc\|kmalloc\|devm_kzalloc\|devm_kmalloc\)(...);
if (e == NULL) {
<+...
- print(...,c,...);
... when any
(
goto l;
|
return ...;
)
...+> }

Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# b5133fde 21-Dec-2014 Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

staging: rtl8192e: rtllib_rx.c: Remove some unused functions

Removes some functions that are not used anywhere:
update_ibss_network() rtllib_SignalStrengthTranslate()

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 6d6163c3 15-Dec-2014 Jonathan Jin <jjin082693@gmail.com>

staging: rtl8192e: rejoin split quoted strings

Fix a checkpatch.pl warning regarding quoted string splits across lines.
While each join of these quoted strings results in a new checkpatch.pl
"lines over 80 characters" warning, the regained ability to grep for
these log strings in the codebase is, I would argue, well worth the
trade-off.

Signed-off-by: Jonathan Jin <jjin082693@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 73df9986 28-Nov-2014 Athira Lekshmi <andnlnbn18@gmail.com>

Drivers:staging:rtl8192e: Fixed checkpatch warning

Fixed checkpatch warning:
WARNING: space prohibited before semicolon

Signed-off-by: Athira Lekshmi <andnlnbn18@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f14557f9 24-Oct-2014 Tapasweni Pathak <tapaswenipathak@gmail.com>

staging: rtl8192e: Remove unnecessary code

kfree on NULL pointer is a no-op.

This used the following semantic patch to identify such a instance

// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);
@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

As rxb is always null at this point, so the code to kfree it and intializing
it to NULL is removed completely.

Suggested by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3f76a4ea 18-Sep-2014 Mahati Chamarthy <mahati.chamarthy@gmail.com>

Staging: rtl8192e: Fix __constant_htons to htons style warning

This fixes the following checkpatch.pl warning:
WARNING: __constant_htons should be htons

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 59422a74 19-Sep-2014 Mahati Chamarthy <mahati.chamarthy@gmail.com>

Staging: rtl8192e: Fix else is not useful style warning

This fixes the following checkpatch.pl warnings:
WARNING: else is not generally useful after a break or return

Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3a6b70c3 22-Aug-2014 Matthew Casey <mdcasey@chabloom.com>

staging: rtl8192e: fixed coding style issues

Fixed missing blank line after declarations issues

Signed-off-by: Matthew Casey <mdcasey@chabloom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4fa42602 02-Jul-2014 Emil Goode <emilgoode@gmail.com>

Staging: rtl8192e: Fix potential NULL pointer dereference

We need to make sure the struct rtllib_device pointer ieee is not NULL
after the goto rx_dropped label since it is dereferenced there.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4764ca98 26-May-2014 Peter Senna Tschudin <peter.senna@gmail.com>

drivers/staging: Remove useless return variables

This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

Verified by compilation only.

The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
when strict
return
- ret
+ C
;
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 430fb250 24-Apr-2014 Masanari Iida <standby24x7@gmail.com>

staging: rtl8192e: Fix typo in rtl8192e

Fix spelling typo in comments within rtl8192e.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Reviewed-by: James Cameron <quozl@laptop.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a0711c4d 26-Dec-2013 Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>

Staging rtl8192e: Fixing checkpatch errors

We fixed checkpatch errors of the following type:
ERROR: "foo * bar" should be "foo *bar"

The error was fixed in the following files of the rtl8192e staging driver:
rtllib_softmac.c
rtllib_rx.c
rtllib_crypt.c
rtllib.h

There are no functional changes in this patch.

Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# e0b1ca60 02-Nov-2013 Rashika Kheria <rashika.kheria@gmail.com>

Staging: rtl8192e: Fix incorrect casting in rtllib_rx.c

This patch fixes the following sparse warning in rtllib_rx.c-

drivers/staging/rtl8192e/rtllib_rx.c:2267:34: warning: cast to restricted __le32
drivers/staging/rtl8192e/rtllib_rx.c:2268:34: warning: cast to restricted __le32
drivers/staging/rtl8192e/rtllib_rx.c:2269:36: warning: cast to restricted __le32
drivers/staging/rtl8192e/rtllib_rx.c:2269:36: warning: cast from restricted __le16

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 26a6b074 02-Nov-2013 Rashika Kheria <rashika.kheria@gmail.com>

Staging: rtl8192e: Fix Sparse warning of restricted __le16 degrades to integer in rtllib_rx.c

This patch fixes the following sparse warning in rtllib_rx.c-
warning: restricted __le16 degrades to integer

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1f5a0d0c 02-Nov-2013 Rashika Kheria <rashika.kheria@gmail.com>

Staging: rtl8192e: Fix incorrect type in assignment in rtllib_rx.c

This patch fixes the following Sparse warning in rtllib_rx.c-

drivers/staging/rtl8192e/rtllib_rx.c:493:37: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:493:37: expected unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192e/rtllib_rx.c:493:37: got restricted __be16 [usertype] <noident>

drivers/staging/rtl8192e/rtllib_rx.c:1227:37: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:1227:37: expected unsigned short [unsigned] [usertype] len
drivers/staging/rtl8192e/rtllib_rx.c:1227:37: got restricted __be16 [usertype] <noident>

drivers/staging/rtl8192e/rtllib_rx.c:1635:40: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:1635:40: expected restricted __le16 <noident>
drivers/staging/rtl8192e/rtllib_rx.c:1635:40: got int

drivers/staging/rtl8192e/rtllib_rx.c:1637:40: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:1637:40: expected restricted __le16 <noident>
drivers/staging/rtl8192e/rtllib_rx.c:1637:40: got int

drivers/staging/rtl8192e/rtllib_rx.c:1641:45: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192e/rtllib_rx.c:1641:45: expected restricted __le16 <noident>
drivers/staging/rtl8192e/rtllib_rx.c:1641:45: got unsigned short [unsigned] [usertype] <noident>

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 014e4c27 29-Oct-2013 Valentina Manea <valentina.manea.m@gmail.com>

staging: rtl8192e: use true and false for bool variables

This patch fixes coccinelle errors for bool variables
initialized with 1 or 0 instead of true and false.

Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 4bb01423 25-Oct-2013 Valentina Manea <valentina.manea.m@gmail.com>

staging: rtl8192e: do not use comparisons on bool tests

This patch fixes coccinelle errors regarding comparisons
used in bool tests.

Signed-off-by: Valentina Manea <valentina.manea.m@gmail.com>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 8329419a 01-Sep-2013 Joe Perches <joe@perches.com>

Staging: Convert uses of compare_ether_addr to ether_addr_equal

Preliminary to removing compare_ether_addr altogether:

Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.

Additionally:

Used is_zero_ether_addr, removed now unused variable
Converted uses of &foo[0] to foo

Done via cocci script: (and a little typing)

$ cat compare_ether_addr.cocci
@@
expression a,b;
@@
- !compare_ether_addr(a, b)
+ ether_addr_equal(a, b)

@@
expression a,b;
@@
- compare_ether_addr(a, b)
+ !ether_addr_equal(a, b)

@@
expression a,b;
@@
- !ether_addr_equal(a, b) == 0
+ ether_addr_equal(a, b)

@@
expression a,b;
@@
- !ether_addr_equal(a, b) != 0
+ !ether_addr_equal(a, b)

@@
expression a,b;
@@
- ether_addr_equal(a, b) == 0
+ !ether_addr_equal(a, b)

@@
expression a,b;
@@
- ether_addr_equal(a, b) != 0
+ ether_addr_equal(a, b)

@@
expression a,b;
@@
- !!ether_addr_equal(a, b)
+ ether_addr_equal(a, b)

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


# 559a4c31 26-Aug-2013 Andrea Merello <andrea.merello@gmail.com>

staging: Update e-mail address for Andrea Merello

A lot of files contain reference to my old e-mail address.
Now I'm going not to read mail from it anymore, so update it
with my current address everywhere.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 93ba2a85 26-Aug-2013 Andrea Merello <andrea.merello@gmail.com>

Update e-mail address for Andrea Merello (resubmit)

A lot of files contain reference to my old e-mail address.
Now I'm going not to read mail from it anymore, so update it
with my current address everywhere.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>


# 59aabd6a 07-Aug-2013 Iker Pedrosa <ikerpedrosam@gmail.com>

Staging: rtl8192e: rtllib_rx: checking NULL value after doing dev_alloc_skb

Checking the return of dev_alloc_skb as stated in the following bug:
https://bugzilla.kernel.org/show_bug.cgi?id=60401

Reported-by: RUC_Soft_Sec rucsoftsec@gmail.com
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 03e71d6b 29-May-2013 Dan Carpenter <dan.carpenter@oracle.com>

Staging: rtl8192e: printing the wrong array

Smatch complained that there is an array overflow here. It looks
like we are supposed to be printing the ->rates_ex[] array which is
slightly larger than the ->rates[] array. This is a cut and paste
error.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 14fc4235 08-May-2012 Joe Perches <joe@perches.com>

staging: Remove test of is_broadcast with is_multicast

A broadcast packet is a multicast packet, no need to test twice.

Reorder one defective test in rtl_core of is_multi_ether_addr
before is_broadcast_ether_addr as the is_multi returns true for
broadcast frames.

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


# cd017123 23-Apr-2012 Justin P. Mattock <justinmattock@gmail.com>

staging: rtl8192e: Fix typos.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
ACKed-by: Larry Finger <Larry.finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a2f9dc55 12-Jan-2012 Julia Lawall <Julia.Lawall@lip6.fr>

drivers/staging: adjust double test

Rewrite a duplicated test to test the correct value

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E;
@@

(
* E
|| ... || E
|
* E
&& ... && E
)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 0ddcf5fd 19-Dec-2011 Sean MacLennan <seanm@seanm.ca>

staging/rtl8192e: Convert to lib80211_crypt_info

Convert rtllib to use lib80211_crypt_info.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 32c44cb5 19-Dec-2011 Sean MacLennan <seanm@seanm.ca>

staging/rtl8192e: Convert to lib80211_crypt_data and lib80211_crypt_ops

Convert rtllib_crypt_data to lib80211_crypt_data and
rtllib_crypt_ops to lib80211_crypt_ops.

This is almost a 1:1 replacement, only extra_prefix_len and
extra_postfix_len changed.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# e0ec8a67 12-Dec-2011 Devendra Naga <devendra.aaru@gmail.com>

staging: remove version.h includes in rtl8192e

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 976d5341 30-Nov-2011 Sean MacLennan <seanm@seanm.ca>

rtl8192e: Rename clashing symbols

The "rtl8192e: Export symbols" patch exported three functions already
exported by the rtl8192u driver. This patch renames the three functions:
Dot11d_Init => dot11d_init
HTUpdateSelfAndPeerSetting => HT_update_self_and_peer_setting
IsLegalChannel => rtllib_legal_channel

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 3b28499c 28-Nov-2011 Sean MacLennan <seanm@seanm.ca>

rtl8192e: Export symbols

The rtl8192e driver had a natural split between the more generic
rtllib code and the more specific rtl8192e code. This patch exports
all the symbols needed by the r8192 specific code from the rtllib
generic code.

Signed-off-by: Sean MacLennan <seanm@seanm.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 2eed3dee 31-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Fix smatch warnings regarding large arrays on stack

Smatch reports the follwing warnings:

CHECK drivers/staging/rtl8192e/rtllib_rx.c
drivers/staging/rtl8192e/rtllib_rx.c +552 RxReorderIndicatePacket(6) warn: 'prxbIndicateArray' puts 1024 bytes on stack

CHECK drivers/staging/rtl8192e/rtl819x_TSProc.c
drivers/staging/rtl8192e/rtl819x_TSProc.c +40 RxPktPendingTimeout(9) warn: 'stats_IndicateArray' puts 1024 bytes on stack

CHECK drivers/staging/rtl8192e/r8192E_phy.c
drivers/staging/rtl8192e/r8192E_phy.c +859 rtl8192_phy_SwChnlStepByStep(11) warn: function puts 797 bytes on stack

CHECK drivers/staging/rtl8192e/rtllib_rx.c
drivers/staging/rtl8192e/rtllib_rx.c +552 RxReorderIndicatePacket(6) warn: 'prxbIndicateArray' puts 1024 bytes on stack

These are fixed by adding the arrays in question as a union in a struct used
by nearly all routines.

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


# 49aab5fd 25-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Fix sparse (non-endian) warnings - Part II

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


# ac50ddaa 25-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove MAC_FMT and MAC_ARG for %pM

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


# fec90b64 11-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Fix sparse (non-endian) warnings - Part II

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 438812c3 11-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove MAC_FMT and MAC_ARG for %pM

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# db8971b6 25-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Cleanup checkpatch -f errors - Part XIII

With this patch, all of the checkpatch errors are fixed; however, only
some of the lines that are too long were fixed. To complete the fixing
of these warnings, the file rtl_dm.c will need refactoring. In addition,
some of the variables will need renaming. Those changes can be deferred.

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


# 0dd56506 25-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Modify time handling

In several places, the driver keeps times (in jiffies) in two 32-bit
quantities. In the rtl8192_hw_to_sleep(), there is an error in the
calculation of the difference between two 64-bit quantities. Rather
than fix that error, I have converted to a single 64-bit number. That
makes the code be much cleaner and clearer.

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


# 87d30617 07-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Cleanup checkpatch -f errors - Part XIII

With this patch, all of the checkpatch errors are fixed; however, only
some of the lines that are too long were fixed. To complete the fixing
of these warnings, the file rtl_dm.c will need refactoring. In addition,
some of the variables will need renaming. Those changes can be deferred.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# e829d65e 01-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Modify time handling

In several places, the driver keeps times (in jiffies) in two 32-bit
quantities. In the rtl8192_hw_to_sleep(), there is an error in the
calculation of the difference between two 64-bit quantities. Rather
than fix that error, I have converted to a single 64-bit number. That
makes the code be much cleaner and clearer.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 6e579119 19-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Convert typedef HT_CHANNEL_WIDTH to enum ht_channel_width

Remove typedef from enum.
Rename enum.
Rename uses.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 66ba443a 19-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Convert typedef frameqos to union frameqos

Remove typedef from union.
Rename union.
Rename uses.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# fc22c052 18-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Convert typedef buffer to struct buffer

Remove typedef from struct.
Rename struct.
Rename uses.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 3b83db43 18-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Convert typedef cb_desc to struct cb_desc

Remove typedef from struct.
Rename struct.
Rename uses.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 8cba1432 18-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Convert typedef RX_REORDER_ENTRY to struct rx_reorder_entry

Remove typedef from struct.
Rename struct.
Rename uses.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# e92b71d5 18-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Convert typedef HT_CAPABILITY_ELE to struct ht_capab_ele

Remove typedef from struct.
Rename struct.
Rename uses.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 7796d93e 18-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Convert typedef RT_HIGH_THROUGHPUT to struct rt_hi_throughput

Remove typedef from struct.
Rename struct.
Rename uses.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 74724de1 18-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Convert typedef TS_COMMON_INFO to struct ts_common_info

Remove typedef from struct.
Rename struct.
Rename uses.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 2c47ae28 18-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Convert typedef RX_TS_RECORD to struct rx_ts_record

Remove typedef from struct.
Rename struct.
Rename uses.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 8cc638e9 14-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove ifdefs for CONFIG_RTLLIB_DEBUG

This symbol is unconditionally defined in a header file, thus tests for it can be removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 69dbddce 14-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove dead code associated with CONFIG_RTLLIB_CRYPT_TKIP

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 1bd7bcfc 14-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove dead code associated with CONFIG_CFG_80211

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# e11fd513 13-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove dead code associated with NOT_YET

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 94114a5a 13-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove dead code associated with TCP_CSUM_OFFLOAD_RX

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 2b259bd3 13-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove ifdefs that depend on ENABLE_DOT11D

This configuration parameter is selected in the Makefile, thus the
conditional code can be removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 34a7eb3d 12-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove dead code inside 'ifdef MERGE_TO_DO'

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 8df91dae 11-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove dead code associated with RTL8192SU

The vendor code will generate several different drivers. Eliminate
code used to generate code for the RTL8192SU devices.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 1e71e6d0 11-Jul-2011 Larry Finger <Larry.Finger@lwfinger.net>

staging: rtl8192e: Remove dead code associated with RTL8192SE

The vendor code will generate several different drivers. As the RTL8192SE
is covered by a mac80211 driver in mainline, eliminate that code heere.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>


# 4f6807e8 10-Jul-2011 Mike McCormack <mikem@ring3k.org>

rtl8192e: Remove occurences of #if 1

Signed-off-by: Mike McCormack <mikem@ring3k.org>


# 3591733d 10-Jul-2011 Mike McCormack <mikem@ring3k.org>

rtl8192e: Remove WIRELESS_EXT macro checks

Signed-off-by: Mike McCormack <mikem@ring3k.org>


# cb762154 10-Jul-2011 Mike McCormack <mikem@ring3k.org>

rtl8192e: Remove extra ifdefs

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Mike McCormack <mikem@ring3k.org>


# 94a79942 23-Aug-2011 Larry Finger <Larry.Finger@lwfinger.net>

From: wlanfae <wlanfae@realtek.com>
[PATCH 1/8] rtl8192e: Import new version of driver from realtek

Signed-off-by: wlanfae <wlanfae@realtek.com>
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---