Commit graph

1765 commits

Author SHA1 Message Date
Michael Straube 5f74a8cbb3 staging: rtl8188eu: Add device code for D-Link DWA-121 rev B1
This device was added to the stand-alone driver on github.
Add it to the staging driver as well.

Link: https://github.com/lwfinger/rtl8188eu/commit/a0619a07cd1e
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-15 16:31:09 +01:00
Larry Finger 7775665aad staging: rtl8188eu: Fix module loading from tasklet for WEP encryption
Commit 2b2ea09e74 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames")
causes scheduling while atomic bugs followed by a hard freeze whenever
the driver tries to connect to a WEP-encrypted network. Experimentation
showed that the freezes were eliminated when module lib80211 was
preloaded, which can be forced by calling lib80211_get_crypto_ops()
directly rather than indirectly through try_then_request_module().
With this change, no BUG messages are logged.

Fixes: 2b2ea09e74 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames")
Cc: Stable <stable@vger.kernel.org> # v4.17+
Cc: Michael Straube <straube.linux@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-07 15:27:59 +01:00
Larry Finger 84cad97a71 staging: rtl8188eu: Fix module loading from tasklet for CCMP encryption
Commit 6bd082af7e ("staging:r8188eu: use lib80211 CCMP decrypt")
causes scheduling while atomic bugs followed by a hard freeze whenever
the driver tries to connect to a CCMP-encrypted network. Experimentation
showed that the freezes were eliminated when module lib80211 was
preloaded, which can be forced by calling lib80211_get_crypto_ops()
directly rather than indirectly through try_then_request_module().
With this change, no BUG messages are logged.

Fixes: 6bd082af7e ("staging:r8188eu: use lib80211 CCMP decrypt")
Cc: Stable <stable@vger.kernel.org> # v4.17+
Reported-and-tested-by: Michael Straube <straube.linux@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-07 15:27:59 +01:00
Michael Straube 0fe6dc4d68 staging: rtl8188eu: cleanup brace coding style issues
Cleanup brace coding style issues reported by checkpatch.

ERROR: space required before the open brace '{'
WARNING: braces {} are not necessary for single statement blocks
CHECK: Unbalanced braces around else statement

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 241e15dbfc staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.c
Add spaces around '&' to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube e54a823e90 staging: rtl8188eu: change return type of is_basicrate() to bool
The function is_basicrate() returns true or false, so change the
return type from int to bool.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 79ebad324b staging: rtl8188eu: simplify null array initializations
Simplfy initialization of null arrays to improve readability
and save some lines.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube b7d54304d9 staging: rtl8188eu: change order of declarations to improve readability
Change the order of array declarations in rtw_mlme_ext.c to improve
readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 7a6394398f staging: rtl8188eu: make some arrays static in rtw_mlme_ext.c
Make some arrays that are only used in rtw_mlme_ext.c static and
remove the corresponding extern declarations from rtw_mlme_ext.h.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 03449acb77 staging: rtl8188eu: constify some arrays
The values of these arrays in rtw_mlme_ext.c and rtw_wlan_util.c
are never changed, so make them const.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 0ef9f86b93 staging: rtl8188eu: convert unsigned char arrays to u8
Change the type of some arrays from unsigned char to u8.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 55fc57809a staging: rtl8188eu: remove redundant declaration in rtw_mlme_ext.c
The array REALTEK_96B_IE is already declared in rtw_mlme.h,
so remove the declaration in rtw_mlme_ext.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 4f1a961ae1 staging: rtl8188eu: remove unused arrays WFD_OUI and WMM_INFO_OUI
The arrays WFD_OUI and WMM_INFO_OUI are not used anywhere,
so remove them.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:32:33 +01:00
Michael Straube 25c641ec2a staging: rtl8188eu: remove unnecessary parentheses in rtw_mlme_ext.c
Remove unnecessary parentheses, most of them reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:30:29 +01:00
Michael Straube 011844addf staging: rtl8188eu: remove unnecessary comments in rtw_mlme_ext.c
Remove comments from 'endif's where the corresponding 'if' is just
a few lines above to improve readability.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:30:29 +01:00
Michael Straube 7acaed81ab staging: rtl8188eu: add blank line after declarations
Add a missing blank line after declarations in rtw_mlme_ext.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:30:29 +01:00
Michael Straube f20ac243ff staging: rtl8188eu: remove blank lines between declarations
Remove blank lines between declarations in rtw_mlme_ext.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:30:29 +01:00
Michael Straube 83691365f1 staging: rtl8188eu: remove commented declarations in rtw_mlme_ext.c
Remove unused/commented declarations.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:30:29 +01:00
Michael Straube 1673616a00 staging: rtl8188eu: replace tabs with spaces in rtw_mlme_ext.c
Replace tabs with spaces where appropriate.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:29:29 +01:00
Michael Straube 502b90d4c6 staging: rtl8188eu: cleanup declarations in rtw_mlme_ext.c
Replace tabs with spaces and/or remove spaces in declarations.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-19 08:29:28 +01:00
Michael Straube 15f11e0ffc staging: rtl8188eu: reuse Hal_GetChnlGroup88E()
Use Hal_GetChnlGroup88E() instead of duplicating it's code
in get_rx_power_val_by_reg().

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12 11:37:58 +01:00
Michael Straube a793dbe926 staging: rtl8188eu: simplify loop in rtl88eu_phy_iq_calibrate()
Zeroing the array result[m][n] and setting only the values at
even 'n's simplifies the code and slightly reduces object file
size.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-12 11:37:58 +01:00
Michael Straube 83cbfb6bba staging: rtl8188eu: remove unused code in rtw_cmd.c
Remove unused/commented code in rtw_cmd.c.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:19 +01:00
Michael Straube 747c615edd staging: rtl8188eu: rename struct field Wifi_Error_Status
Rename struct field Wifi_Error_Status to avoid CamelCase.
Wifi_Error_Status -> wifi_error_status

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:19 +01:00
Michael Straube 4fea3f99b5 staging: rtl8188eu: replace if else with ternary operator
Replace if else with a single call and ternary operator to
slightly reduce object file size. Also clears a checkpatch
warning: WARNING: Statements should start on a tabstop

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:19 +01:00
Michael Straube d5fa6721f6 staging: rtl8188eu: write out multiplying in wifirate2_ratetbl_inx()
Write out multiplying in wifirate2_ratetbl_inx() to improve
readabilitiy and clear checkpatch issues with missing spaces
around '*' operator.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:18 +01:00
Michael Straube 497d6a7441 staging: rtl8188eu: add spaces around operators in rtw_wlan_util.c
Add spaces around '+', '-', '&' and '>>' to follow kernel coding
style. Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:18 +01:00
Michael Straube 3a3b5defd3 staging: rtl8188eu: cleanup long lines in rtw_wlan_util.c
Cleanup some lines over 80 characters by adding appropriate
line breaks and removing commented code.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:18 +01:00
Michael Straube 54b48fda9c staging: rtl8188eu: cleanup block comment in rtw_wlan_util.c
Cleanup a block comment to clear a checkpatch warning.
WARNING: Block comments use * on subsequent lines

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:18 +01:00
Michael Straube e2307b086c staging: rtl8188eu: cleanup declarations in rtw_wlan_util.c
Replace tabs with spaces and/or remove spaces in declarations
to cleanup whitespace. Remove unused/commented declarations.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:18 +01:00
Michael Straube a2871106b5 staging: rtl8188eu: remove unnecessary parentheses in rtw_wlan_util.c
Remove unnecessary parentheses reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:18 +01:00
Michael Straube 3499477cd9 staging: rtl8188eu: simplify array initializations
Simplfy initialization of arrays with zero only values
to improve readability and save a line.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:18 +01:00
Michael Straube c61583b162 staging: rtl8188eu: refactor cckratesonly_included()
Refactor cckratesonly_included() to improve readability and slightly
reduce object file size. Also change the return type to bool.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:18 +01:00
Michael Straube 3101957f4a staging: rtl8188eu: refactor cckrates_included()
Refactor cckrates_included() to improve readability and slightly
reduce object file size. Also change the return type to bool.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-06 16:12:18 +01:00
Michael Straube 2166e0f552 staging: rtl8188eu: cleanup comment in hal8188e_rate_adaptive.c
Cleanup comment in hal8188e_rate_adaptive.c.
Clears checkpatch warnings.

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:42:27 +01:00
Michael Straube a9236c0867 staging: rtl8188eu: cleanup alignment issues in hal8188e_rate_adaptive.c
Cleanup alignment issues reported by checkpatch.
CHECK: Alignment should match open parenthesis

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:42:27 +01:00
Michael Straube 4b1ea01b50 staging: rtl8188eu: cleanup lines ending with '('
Cleanup lines ending with '(' in hal8188e_rate_adaptive.c.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:42:27 +01:00
Michael Straube 256b95bf09 staging: rtl8188eu: add spaces around operators in hal8188e_rate_adaptive.c
Add spaces around operators to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:42:26 +01:00
Michael Straube ae4224fc83 staging: rtl8188eu: remove parentheses in hal8188e_rate_adaptive.c
Remove unnecessary parentheses reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:42:26 +01:00
Michael Straube 8195b3e8d3 staging: rtl8188eu: use __func__ in hal8188e_rate_adaptive.c
Use __func__ instead of hardcoded function names.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:42:26 +01:00
Colin Ian King c48f12e28d staging: rtl8188eu: fix spelling mistake "inferface" -> "interface"
Fix spelling mistake in module description text.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-05 09:39:45 +01:00
Michael Straube 3253374714 staging: rtl8188eu: cleanup lines over 80 characters
Cleanup lines over 80 characters by replacing tabs with spaces
or adding appropriate line breaks.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26 20:59:05 +01:00
Michael Straube a08a9a6517 staging: rtl8188eu: correct indentation
Correct indentation to clear a checkpatch warning.
WARNING: suspect code indent for conditional statements (8, 24)

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26 20:59:05 +01:00
Michael Straube 5e51ed1a90 staging: rtl8188eu: remove return from void function
Remove return from a void function to clear a checkpatch warning.
WARNING: void function return statements are not generally useful

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26 20:59:05 +01:00
Michael Straube c202e1ab78 staging: rtl8188eu: refactor if else statement
Refactor if else statement to clear checkpatch warnings.
WARNING: else is not generally useful after a break or return
WARNING: line over 80 characters

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26 20:59:05 +01:00
Michael Straube 794f816566 staging: rtl8188eu: cleanup declarations in rtw_mlme.c
Replace tabs with spaces, remove spaces, remove blank lines
and break lines appropriatly in declarations.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26 20:59:05 +01:00
Michael Straube 2077ca1cd4 staging: rtl8188eu: remove rtw_android_set_block()
The function rtw_android_set_block() just returns zero. The only user
is the function rtw_android_priv_cmd(). The variable bytes_written is
initialized to zero and not changed before the use of
rtw_android_set_block(). Remove rtw_android_set_block() and it's only
use.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26 20:59:04 +01:00
Michael Straube 1d9416d6d5 staging: rtl8188eu: use __func__ in rtw_mlme.c
Use __func__ instead of hardcoded function names.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26 20:59:04 +01:00
Michael Straube 18bd05bb9c staging: rtl8188eu: remove unnecessary parentheses in rtw_mlme.c
Remove unnecessary parentheses reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26 20:59:04 +01:00
Michael Straube 3f95106ea0 staging: rtl8188eu: cleanup remaining comparsions to true
Cleanup remaining comparsions to true.
if (x == true) -> if (x)
if (x != true) -> if (!x)
if (!x == true) -> if (!x)

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-26 20:59:04 +01:00