Martin Kaiser
d43ea3d4d2
staging: r8188eu: drop return value from issue_probereq_ex
...
The only caller of issue_probereq_ex does not check the return value. We
can remove it and make issue_probereq_ex a void function.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Link: https://lore.kernel.org/r/20221126154253.178275-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-12-05 13:26:13 +01:00
YueHaibing
d30f4436f3
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: 94a799425e ("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 >
2022-12-05 13:26:08 +01:00
Philipp Hortmann
e0005909e5
staging: rtl8192e: Remove unused variable int_log
...
int_log is initialized and incremented but never evaluated. Remove
resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com >
Link: https://lore.kernel.org/r/e2edcde052cc3c47e6e6b94d09e460b8cf6a49a8.1669156825.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-12-05 13:25:00 +01:00
Philipp Hortmann
aae3567db0
staging: rtl8192e: Remove unused variable ChannelAccessSetting
...
ChannelAccessSetting is never used. Remove resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com >
Link: https://lore.kernel.org/r/b88a31954532f47a4caf9abfcad8e20b32a618cc.1669156825.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-12-05 13:24:59 +01:00
Philipp Hortmann
efc6f7ce3a
staging: rtl8192e: Remove unused variable initialized_at_probe
...
initialized_at_probe is initialized and never used. Remove resulting dead
code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com >
Link: https://lore.kernel.org/r/4855b2dd5b7296b0eb10e697f605fb820e1dfc7b.1669156825.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-12-05 13:24:59 +01:00
Philipp Hortmann
d694a05fda
staging: rtl8192e: Remove unused variable skb_aggQ
...
skb_aggQ is initialized, never used and purged. Remove resulting dead
code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com >
Link: https://lore.kernel.org/r/3197be3cb412eea1c662a5bec1b1afda2cee675d.1669156825.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-12-05 13:24:59 +01:00
Philipp Hortmann
24a525a671
staging: rtl8192e: Remove unchanged variable AcmMethod
...
AcmMethod is initialized and never changed. The evaluation will always
have the same result. Remove resulting dead code.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com >
Link: https://lore.kernel.org/r/7d73a66184e13d5f8d4af7d21564032247a7e923.1669156825.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-12-05 13:24:59 +01:00
Dan Carpenter
bcc5e2dcf0
staging: rtl8192u: Fix use after free in ieee80211_rx()
...
We cannot dereference the "skb" pointer after calling
ieee80211_monitor_rx(), because it is a use after free.
Fixes: 8fc8598e61 ("Staging: Added Realtek rtl8192u driver to staging")
Signed-off-by: Dan Carpenter <error27@gmail.com >
Link: https://lore.kernel.org/r/Y33BArx3k/aw6yv/@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-12-05 13:24:50 +01:00
Uwe Kleine-König
9dadff0662
staging: iio: ade7854: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221118224540.619276-569-uwe@kleine-koenig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-22 13:23:53 +01:00
Uwe Kleine-König
b62649822e
staging: olpc_dcon: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221118224540.619276-571-uwe@kleine-koenig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-22 13:23:25 +01:00
Uwe Kleine-König
9a2c1d64c8
staging: most: i2c: Convert to i2c's .probe_new()
...
The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20221118224540.619276-570-uwe@kleine-koenig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-22 13:23:25 +01:00
Umang Jain
f198d34759
vc04_services: bcm2835-camera: Use bool values for mmal_fmt.remove_padding
...
mmal_fmt.remove_padding is defined as a boolean type hence, use boolean
values for it instead of 0/1 integers. This enhances code readability.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com >
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com >
Link: https://lore.kernel.org/r/20221118084244.199909-4-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-22 13:20:21 +01:00
Umang Jain
c0012a39cf
vc04_services: mmal-vchiq: Use bool for vchiq_mmal_component.in_use
...
In commit 7967656ffb ("coding-style: Clarify the expectations around
bool") the check to dis-allow bool structure members was removed from
checkpatch.pl. It promotes bool structure members to store boolean
values. This enhances code readability.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com >
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com >
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Link: https://lore.kernel.org/r/20221118084244.199909-3-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-22 13:20:21 +01:00
Umang Jain
7336117306
Revert "staging: mmal-vchiq: Avoid use of bool in structures"
...
This reverts commit 640e77466e .
In commit 7967656ffb ("coding-style: Clarify the expectations around
bool") the check to dis-allow bool structure members was removed from
checkpatch.pl. It promotes bool structure members to store boolean
values. This enhances code readability.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com >
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com >
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com >
Link: https://lore.kernel.org/r/20221118084244.199909-2-umang.jain@ideasonboard.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-22 13:20:21 +01:00
Brent Pappas
2b7962bd05
staging: gdm724x: Replace macro GDM_TTY_READY with static inline function
...
Replace the macro GDM_TTY_READY with a static inline function
to follow the Linux kernel coding style.
Signed-off-by: Brent Pappas <bpappas@pappasbrent.com >
Link: https://lore.kernel.org/r/20221117195443.19616-1-bpappas@pappasbrent.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-22 13:20:16 +01:00
Gaosheng Cui
357057ee55
staging: vme_user: Fix possible UAF in tsi148_dma_list_add
...
Smatch report warning as follows:
drivers/staging/vme_user/vme_tsi148.c:1757 tsi148_dma_list_add() warn:
'&entry->list' not removed from list
In tsi148_dma_list_add(), the error path "goto err_dma" will not
remove entry->list from list->entries, but entry will be freed,
then list traversal may cause UAF.
Fix by removeing it from list->entries before free().
Fixes: b2383c90a9 ("vme: tsi148: fix first DMA item mapping")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com >
Link: https://lore.kernel.org/r/20221117035914.2954454-1-cuigaosheng1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-22 13:20:13 +01:00
Philipp Hortmann
ccdbe14b77
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 >
2022-11-17 19:50:15 +01:00
Philipp Hortmann
41fa3d42a3
staging: rtl8192e: Rename InterruptLog, RxCounter and bHwRfOffAction
...
Rename variable InterruptLog to int_log, RxCounter to rx_ctr and
bHwRfOffAction to hw_rf_off_action 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/82ea07ddd894ac9b863ce90ddb9ba78065bd1f4e.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:50:15 +01:00
Philipp Hortmann
62310f889a
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 >
2022-11-17 19:50:15 +01:00
Philipp Hortmann
8e5d08ceb8
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 >
2022-11-17 19:50:15 +01:00
Philipp Hortmann
7e5cfa3c77
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 >
2022-11-17 19:50:15 +01:00
Philipp Hortmann
ab4bcf795e
staging: rtl8192e: Rename RFInProgres.., bEnableHT and RegChannelPlan
...
Rename variable RFInProgressTimeOut to rf_in_progress_timeout, bEnableHT
to enable_ht and RegChannelPlan to reg_chnl_plan 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/aa3b8fd4a51fc9b1c32566cd079590bf11a9190d.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:50:15 +01:00
Philipp Hortmann
ca0298c09a
staging: rtl8192e: Rename pPSC
...
Rename variable pPSC to psc 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/47ded8a906e55d6f09b51cd8f2dfb78b7b92c1cc.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:50:15 +01:00
Philipp Hortmann
ca25401e21
staging: rtl8192e: Rename Regdot11TxHT.., dot11HTOpera.. and RegHTSuppRa..
...
Rename variable Regdot11TxHTOperationalRateSet to
reg_dot11tx_ht_oper_rate_set, dot11HTOperationalRateSet to
dot11ht_oper_rate_set and RegHTSuppRateSet to reg_ht_supp_rate_set 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/0c87e7ffc94be1c26f6400f5e12419f2df0418a3.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:50:15 +01:00
Philipp Hortmann
c7bf6d33d0
staging: rtl8192e: Rename Regdot11HTOper.., bSupportM.. and PowerSaveCo..
...
Rename variable Regdot11HTOperationalRateSet to
reg_dot11ht_oper_rate_set, bSupportMode to support_mode and
PowerSaveControl to pwr_save_ctrl to avoid CamelCase which is not accepted
by checkpatch. Fix unnecessary parentheses warning from checkpatch when
used with this variables.
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com >
Link: https://lore.kernel.org/r/1ef7fd22b4a037c4d1f8685065ce7916b6f0930b.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:50:15 +01:00
Philipp Hortmann
b397fc48c5
staging: rtl8192e: Rename bTxDisableRate.., RegMaxLPSAwa.. and bTxUseD..
...
Rename variable bTxDisableRateFallBack to tx_dis_rate_fallback,
RegMaxLPSAwakeIntvl to reg_max_lps_awake_intvl and
bTxUseDriverAssingedRate to tx_use_drv_assinged_rate 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/092eb2dc73d37daf851ea9ef9cb7e4df6f766845.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:50:15 +01:00
Michael Straube
7209757311
staging: r8188eu: binstallGrpkey is set to _FAIL
...
The variable binstallGrpkey is set to _FAIL which is defined as 0.
Use false to set the variable to get rid of another use of _FAIL.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20221111083733.3144-5-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:48:46 +01:00
Michael Straube
64ce3acd0a
staging: r8188eu: convert _rtw_init_xmit_priv() to common error logic
...
Convert the function _rtw_init_xmit_priv() away from returning _FAIL
or _SUCCESS which uses inverted error logic. Use the common error
logic instead. Return 0 for success and negative values for failure.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20221111083733.3144-4-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:48:46 +01:00
Michael Straube
8985814bb3
staging: r8188eu: convert rtw_xmit_resource_alloc() to common error logic
...
Convert the function rtw_xmit_resource_alloc() away from returning
_FAIL or _SUCCESS which uses inverted error logic. Use the common
error logic instead. Return 0 for success and negative values for
failure.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20221111083733.3144-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:48:46 +01:00
Michael Straube
9b35a6926c
staging: r8188eu: convert aes_cipher() to void
...
The function aes_cipher() returns always _SUCCESS and its callers
do not use the return value. So we can convert the return type to
void and get rid of another use of _SUCCESS.
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20221111083733.3144-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:48:46 +01:00
Michael Straube
a3f3e97a03
staging: r8188eu: rename three functions
...
Prefix the names of the following functions with the driver name. The
original names are bad for the global namespace. While at it, convert
is_IBSS_empty() to all lower case to follow kernel coding style.
is_client_associated_to_ap()
is_client_associated_to_ibss()
is_IBSS_empty()
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Link: https://lore.kernel.org/r/20221110090927.17274-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-17 19:48:30 +01:00
Deepak R Varma
3351401167
staging: rtl8192u: remove redundant macro definitions
...
Several ieee80211_* symbol names are extended with _rsl tag using
macros. This is done to avoid a conflict when a similar symbol is
already in use in another part of kernel and may lead to conflicts.
However, most of these base symbol names are not found to being used
anywhere in the code and hence are not useful today. These symbols
are not used outside of the module and hence can be safely removed.
The code continues to use the original symbol names.
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Deepak R Varma <drv@mailo.com >
Link: https://lore.kernel.org/r/17f69a042e215c484931a0327fdf7775eea5f918.1667930292.git.drv@mailo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-09 14:43:11 +01:00
Deepak R Varma
fb7d5ebea9
staging: fieldbus: use sysfs_emit() in show functions
...
The show() methods should only use sysfs_emit() when formatting values
to be returned to the user space.
Ref: Documentation/filesystems/sysfs.rst
Issue identified by coccicheck.
Signed-off-by: Deepak R Varma <drv@mailo.com >
Link: https://lore.kernel.org/r/Y2uEIzebbM/Fs5Jz@qemulion
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-09 14:40:13 +01:00
Gustavo A. R. Silva
8ce256540f
staging: ks7010: Avoid clashing function prototypes
...
When built with Control Flow Integrity, function prototypes between
caller and function declaration must match. These mismatches are visible
at compile time with the new -Wcast-function-type-strict in Clang[1].
Fix a total of 27 warnings like these:
drivers/staging/ks7010/ks_wlan_net.c:2415:2: warning: cast from 'int (*)(struct net_device *, struct iw_request_info *, struct iw_point *, char *)' to 'iw_handler' (aka 'int (*)(struct net_device *, struct iw_request_info *, union iwreq_data *, char *)') converts to incompatible function type [-Wcast-function-type-strict]
(iw_handler)ks_wlan_get_firmware_version,/* 3 KS_WLAN_GET_FIRM_VERSION */
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ks_wlan_net Wireless Extension handler callbacks (iw_handler) use a
union for the data argument. Actually use the union and perform explicit
member selection in the function body instead of having a function
prototype mismatch. There are no resulting binary differences
before/after changes.
These changes were made partly manually and partly with the help of
Coccinelle.
Link: https://reviews.llvm.org/D134831 [1]
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Link: https://lore.kernel.org/r/8d2ceee1248b5a76e9b6c379f578e65482c91168.1667934775.git.gustavoars@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-09 14:39:03 +01:00
Duoming Zhou
ce8cc75c74
drivers: staging: r8188eu: Fix sleep-in-atomic-context bug in rtw_join_timeout_handler
...
The rtw_join_timeout_handler() is a timer handler that
runs in atomic context, but it could call msleep().
As a result, the sleep-in-atomic-context bug will happen.
The process is shown below:
(atomic context)
rtw_join_timeout_handler
_rtw_join_timeout_handler
rtw_do_join
rtw_select_and_join_from_scanned_queue
rtw_indicate_disconnect
rtw_lps_ctrl_wk_cmd
lps_ctrl_wk_hdl
LPS_Leave
LPS_RF_ON_check
msleep //sleep in atomic context
Fix by removing msleep() and replacing with mdelay().
Fixes: 15865124fe ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn >
Link: https://lore.kernel.org/r/20221018083424.79741-1-duoming@zju.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-09 14:38:19 +01:00
Martin Kaiser
a614e753e8
staging: r8188eu: drop removal/stop check in dump_mgntframe_and_wait_ack
...
We can remove the checks for bDriverStopped and bSurpriseRemoved in
dump_mgntframe_and_wait_ack.
The code path from this function looks like
dump_mgntframe_and_wait_ack
rtl8188eu_mgnt_xmit
rtw_dump_xframe
loop over all fragments
rtw_write_port is called for each fragment. bSurpriseRemoved and
bDriverStopped are checked in rtw_write_port.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Link: https://lore.kernel.org/r/20221107202824.61431-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:55 +01:00
Martin Kaiser
fa2a8d4284
staging: r8188eu: drop another removal/stop check
...
There's no need to check bDriverStopped and bSurpriseRemoved in
issue_probereq_ex.
The code path looks like
issue_probereq_ex
_issue_probereq
dump_mgntframe
or
dump_mgntframe_and_wait_ack
All paths from dump_mgntframe check the two variables.
dump_mgntframe_and_wait_ack contains a check as well.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Link: https://lore.kernel.org/r/20221107202824.61431-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:55 +01:00
Martin Kaiser
d54b6ac14d
staging: r8188eu: use a qos_hdr in validate_recv_data_frame
...
Define a struct ieee80211_qos_hdr in the validate_recv_data_frame
function. Use this struct to replace some numeric offsets and make the
code easier to understand.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com >
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Link: https://lore.kernel.org/r/20221107202824.61431-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:55 +01:00
Deepak R Varma
a57ef65a09
staging: r8188eu: remove unnecessary casting
...
The dhcpMessage struct member variable "cookie" is already declared
to be of type __be32. There is no need to cast it again as __be32.
Signed-off-by: Deepak R Varma <drv@mailo.com >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/c333e22349c5c347c740b425330b35830b969fa9.1667755987.git.drv@mailo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:46 +01:00
Deepak R Varma
c1a84fe1f4
staging: r8188eu: simplify complex pointer casting
...
Pointers to structures udphdr and dhcpMessage are derived by casting
adjacent pointers with size_t. Such typecast of pointer using size_t
is not preferred. The code looks complex and delicate. Simplify such
casting by utilizing generic "void *" casting.
Suggested-by: Joe Perches <joe@perches.com >
Signed-off-by: Deepak R Varma <drv@mailo.com >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/1428580d09a9916899209c9278dca40ee2d297d3.1667755987.git.drv@mailo.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:46 +01:00
Michael Straube
2b62e1b447
staging: r8188eu: clean up error handling in rtw_start_drv_threads()
...
Convert the error handling in the function rtw_start_drv_threads() to
the common logic used in the kernel. Another step to get rid of _FAIL
and _SUCCESS which uses inverted logic.
Signed-off-by: Michael Straube <straube.linux@gmail.com >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106133443.8872-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:43 +01:00
Martin Kaiser
c12b5b5614
staging: r8188eu: remove checks in dump_mgntframe
...
There's no need to check for bSurpriseRemoved and bDriverStopped in
dump_mgmtframe.
The sequence of function calls is
dump_mgntframe
rtl8188eu_mgnt_xmit
rtw_dump_xframe
loop over all fragments
For each fragment, rtw_write_port is called. This function checks
bSurpriseRemoved and bDriverStopped.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106124901.720785-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:30 +01:00
Martin Kaiser
32265aaf61
staging: r8188eu: merge two rtw_free_network_nolock functions
...
Remove the _rtw_free_network_nolock function and merge it into
rtw_free_network_nolock, which is its only caller.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106124901.720785-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:30 +01:00
Martin Kaiser
b78ec61d94
staging: r8188eu: remove get_fwstate
...
The get_fwstate function is not used. Remove it.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106124901.720785-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:30 +01:00
Martin Kaiser
b693737876
staging: r8188eu: clean up rtw_hal_init
...
Clean up the rtw_hal_init function.
Remove the status variable. Exit immediately for errors.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106124901.720785-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:29 +01:00
Martin Kaiser
d44fa4cb2e
staging: r8188eu: remove state checks in rtw_led_control
...
There's no need to check for bSurpriseRemoved or bDriverStopped in the
rtw_led_control function. This function schedules a delayed worker which
calls SwLedOn or SwLedOff (or the function calls SwLedOff directly).
SwLedOn and SwLedOff check bDriverStopped themselves or they initiate a
USB control transfer via usb_write, where bSurpriseRemoved is checked.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106124901.720785-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:29 +01:00
Martin Kaiser
2dbc324eaa
staging: r8188eu: reformat a function header
...
The definition of Hal_EfuseParseIDCode88E can be a single line.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106124901.720785-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:29 +01:00
Martin Kaiser
8554c4768a
staging: r8188eu: reorder assignments, clarify the header format
...
Reorder some of the assignments in update_recvframe_attrib_88e.
This should make it a bit easier to understand the format of the header
that is added by the chip's firmware.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106124901.720785-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:29 +01:00
Martin Kaiser
4142c442f2
staging: r8188eu: remove some obsolete comments
...
Remove obsolete comments in validate_recv_data_frame.
There is no prxcmd variable (any more?).
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106124901.720785-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:29 +01:00
Martin Kaiser
cc027b3e40
staging: r8188eu: don't store addba request
...
There's no need to store an incoming addba request in struct
mlme_ext_info. We only need the addba request to copy some of its fields
into our addba response.
It's simpler to pass the incoming request's management frame to
issue_action_BA as an additional parameter. issue_action_BA can then
extract the required fields. If issue_action_BA prepares a request rather
than a response, the caller sets the parameter for the incoming request to
NULL.
Signed-off-by: Martin Kaiser <martin@kaiser.cx >
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com > # Edimax N150
Link: https://lore.kernel.org/r/20221106124901.720785-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2022-11-08 16:29:29 +01:00