aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
AgeCommit message (Collapse)AuthorFilesLines
2022-04-07staging: r8188eu: format comments in drivers/net styleRebecca Mckeever1-6/+3
Format comments according to the Linux kernerl coding style for drivers/net so they do not need to be reformatted after this driver is accepted into the drivers/net tree. Suggested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Rebecca Mckeever <remckee0@gmail.com> Link: https://lore.kernel.org/r/bd7960acafb871c17ef733cd98b37294f38ad3fb.1649233201.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-07staging: rtl8712: remove unnecessary parenthesesAlaa Mohamed1-10/+10
Reported by checkpatch: Remove unnecessary parentheses around structure field references Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com> Link: https://lore.kernel.org/r/20220407125947.8525-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-07staging: r8188eu: remove unused _RND* from osdep_service.hMichael Straube1-18/+0
Remove the unused macro _RND() and the unused functions _RND256(), _RND512() from osdep_service.h. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220407125742.7814-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-07staging: r8188eu: use round_up() instead of _RND128()Michael Straube2-9/+1
Use in-kernel round_up() instead of custom _RND128(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220407125742.7814-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-07staging: r8188eu: use round_up() instead of _RND8()Michael Straube2-11/+3
Use in-kernel round_up() instead of custom _RND8(). Just remove _RND8 where it is not necessary to round up. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220407125742.7814-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-07staging: r8188eu: use round_up() instead of _RND4()Michael Straube2-9/+1
Use in-kernel round_up() instead of custom _RND4(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220407125742.7814-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-07staging: r8188eu: use PTR_ALIGN() instead of RND4()Michael Straube4-10/+6
Use in-kernel PTR_ALIGN() instead of custom RND4(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220407125742.7814-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-07Merge branch 'wfx-move-out-of-staging' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next into staging-nextGreg Kroah-Hartman41-8172/+0
This moves the wfx driver out of staging. * 'wfx-move-out-of-staging' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: wfx: get out from the staging area
2022-04-06wfx: get out from the staging areaJérôme Pouiller41-8172/+0
The wfx driver is now mature enough to leave the staging area. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Signed-off-by: Kalle Valo <kvalo@kernel.org>
2022-04-05staging: rtl8712: fix a potential memory leak in r871xu_drv_init()Xiaoke Wang2-4/+3
In r871xu_drv_init(), if r8712_init_drv_sw() fails, then the memory allocated by r8712_alloc_io_queue() in r8712_usb_dvobj_init() is not properly released as there is no action will be performed by r8712_usb_dvobj_deinit(). To properly release it, we should call r8712_free_io_queue() in r8712_usb_dvobj_deinit(). Besides, in r871xu_dev_remove(), r8712_usb_dvobj_deinit() will be called by r871x_dev_unload() under condition `padapter->bup` and r8712_free_io_queue() is called by r8712_free_drv_sw(). However, r8712_usb_dvobj_deinit() does not rely on `padapter->bup` and calling r8712_free_io_queue() in r8712_free_drv_sw() is negative for better understading the code. So I move r8712_usb_dvobj_deinit() into r871xu_dev_remove(), and remove r8712_free_io_queue() from r8712_free_drv_sw(). Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com> Link: https://lore.kernel.org/r/tencent_B8048C592777830380A23A7C4409F9DF1305@qq.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: drop redundant if check in IS_MCASTVihas Makwana1-4/+1
The if check is redundant. Drop it and simplify the funciton. Signed-off-by: Vihas Makwana <makvihas@gmail.com> Link: https://lore.kernel.org/r/20220405124239.3372-2-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: remove GetHalDefVar8188EUsb()Michael Straube3-22/+1
The local variable odm_flag in rtw_dbg_port() is set but never used. This are the last two remaining calls to GetHalDefVar8188EUsb(). Both calls can be removed and we finally can remove GetHalDefVar8188EUsb() itself. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220405104910.9769-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: remove HAL_DEF_CURRENT_ANTENNAMichael Straube5-7/+13
In order to get rid of the function GetHalDefVar8188EUsb(), remove the HAL_DEF_CURRENT_ANTENNA case from it and move the functionality into a new function. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220405104910.9769-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: remove HAL_DEF_IS_SUPPORT_ANT_DIVMichael Straube3-7/+8
In order to get rid of the function GetHalDefVar8188EUsb(), remove the HAL_DEF_IS_SUPPORT_ANT_DIV case from it and move the functionality into a new function. This is part of the ongoing effort to get rid of the unwanted hal layer. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220405104910.9769-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: cur_ant is set but never usedMichael Straube1-7/+0
In rtw_select_and_join_from_scanned_queue() the local variable cur_ant is set but never used. Remove the variable and related dead code. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220405104910.9769-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: remove unused macros from ieee80211.hMichael Straube1-18/+0
Remove unused macros from ieee80211.h. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220405060813.8448-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: remove unncessary ternary operatorMichael Straube8-12/+12
There are some uses of ternary operator where it explicitly sets true or false but the condition already evaluates to true or false. In this cases the ternary operator is redundant and can be removed. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220405060813.8448-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: vt6655: Rename constant definitions with CamelCasePhilipp Hortmann1-18/+18
Rename constant definitions with CamelCase in mac.h as they are not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/19cfb3ec78eaba8e839578b1ea5a6eb09e8c09be.1649103348.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: vt6655: Remove unused macros in mac.hPhilipp Hortmann1-133/+0
Remove unused macros with do-while(0) loop or CamelCase in mac.h as they are not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/78f72d0aa3d1bdddf3c415fd4c458399aa5e7cbf.1649103348.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8723bs: remove space after function nameSevinj Aghayeva1-1/+1
Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: space prohibited between function name and open parenthesis Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com> Link: https://lore.kernel.org/r/86494fef795f1c3e28c55e556d68b407dadd1488.1649128267.git.sevinj.aghayeva@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8723bs: remove redundant else branchesSevinj Aghayeva1-32/+30
Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com> Link: https://lore.kernel.org/r/fcb50e467d5ac81becf222379bcc21136966b86b.1649128267.git.sevinj.aghayeva@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8723bs: remove return from a function returning voidSevinj Aghayeva1-7/+2
Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: void function return statements are not generally useful Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com> Link: https://lore.kernel.org/r/d1aa09f34cd192e284048999ba8e20d26a224483.1649128267.git.sevinj.aghayeva@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8723bs: remove redundant braces in if statementsSevinj Aghayeva1-52/+27
Adhere to Linux kernel coding style. Reported by checkpatch: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com> Link: https://lore.kernel.org/r/5f3a013af7ca5ac02b4d680fa22a23049f5712db.1649128267.git.sevinj.aghayeva@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8723bs: combine both sides of conditional statementRebecca Mckeever1-6/+2
Both sides of conditional statement are the same except for the comment. Additional instances found with git grep. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rebecca Mckeever <remckee0@gmail.com> Link: https://lore.kernel.org/r/23cfd782614e09f57a514aab68407183702b0a2c.1649120568.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8723bs: remove handlerOS independent commentRebecca Mckeever1-2/+0
The "need to make timeout handlerOS independent" comment is incorrect. Remove the comment to avoid misleading developers. Additional instances found with git grep. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rebecca Mckeever <remckee0@gmail.com> Link: https://lore.kernel.org/r/416ed753b7b3062cc8c674dea9028fc901e85426.1649120568.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8723bs: simplify control flowSevinj Aghayeva1-14/+4
Checkpatch issues "WARNING: else is not generally useful after a break or return" for the following code: while (1) { do_join_r = rtw_do_join(padapter); if (do_join_r == _SUCCESS) { break; } else { rtw_dec_to_roam(padapter); if (rtw_to_roam(padapter) > 0) { continue; } else { rtw_indicate_disconnect(padapter); break; } } } We simplify this code in multiple steps. First, we remove do_join_r variable because it is only used right after it is assigned. Second, we remove the unnecessary else statement right after break: while (1) { if (rtw_do_join(padapter) == _SUCCESS) break; rtw_dec_to_roam(padapter); if (rtw_to_roam(padapter) > 0) { continue; } else { rtw_indicate_disconnect(padapter); break; } } Next, we move the call to rtw_do_join into the while test because the while will loop only until the call is successful: while (rtw_do_join(padapter) != _SUCCESS) { rtw_dec_to_roam(padapter); if (rtw_to_roam(padapter) > 0) { continue; } else { rtw_indicate_disconnect(padapter); break; } } Finally, looking at the code above, it is clear that the code will break out of the loop if rtw_to_roam call is <= 0. Hence: while (rtw_do_join(padapter) != _SUCCESS) { rtw_dec_to_roam(padapter); if (rtw_to_roam(padapter) <= 0) { rtw_indicate_disconnect(padapter); break; } } Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com> Link: https://lore.kernel.org/r/20220403224207.GA397480@euclid Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8712: simplify control flowSevinj Aghayeva1-19/+6
The function iterates an index from 0 to NUM_PMKID_CACHE and returns the first index for which the condition is true. If no such index is found, the function returns -1. Current code has a complex control flow that obfuscates this simple task. Replace it with a loop. Also, given the shortened function body, replace the long variable name psecuritypriv with a short variable name p. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com> Link: https://lore.kernel.org/r/20220403165325.GA374638@euclid Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: simplify control flowSevinj Aghayeva1-19/+6
The function iterates an index from 0 to NUM_PMKID_CACHE and returns the first index for which the condition is true. If no such index is found, the function returns -1. Current code has a complex control flow that obfuscates this simple task. Replace it with a loop. Also, given the shortened function body, replace the long variable name psecuritypriv with a short variable name p. Reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com> Link: https://lore.kernel.org/r/20220403164250.GA371601@euclid Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8712: remove Unnecessary parenthesesAlaa Mohamed1-8/+8
Reported by checkpatch: CHECK: Unnecessary parentheses Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com> Link: https://lore.kernel.org/r/20220404211942.11446-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: rtl8712: Fix multiple line dereferenceAlaa Mohamed1-52/+25
Reported by checkpatch: WARNING: Avoid multiple line dereference Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com> Link: https://lore.kernel.org/r/20220404210010.9795-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: remove unnecessary blank linesAlaa Mohamed1-3/+0
Reported by checkpatch: CHECK: Blank lines aren't necessary before a close brace '}' Acked_by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com> Link: https://lore.kernel.org/r/20220404145217.15069-1-eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-05staging: r8188eu: Add line after declarationsAlaa Mohamed1-2/+3
Reported by checkpatch: WARNING: Missing a blank line after declarations Acked_by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Alaa Mohamed <eng.alaamohamedsoliman.am@gmail.com> Link: https://lore.kernel.org/r/19d8f316e43d16c9341f7fe94e68534cf60cc05c.1649082939.git.eng.alaamohamedsoliman.am@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: Fix PPPoE tag insertion on little endian systemsGuenter Roeck1-1/+1
In __nat25_add_pppoe_tag(), the tag length is read from the tag data structure. The value is kept in network format, but read as raw value. With -Warray-bounds, this results in the following gcc error/warning when building the driver on alpha. In function '__nat25_add_pppoe_tag', inlined from 'nat25_db_handle' at drivers/staging/r8188eu/core/rtw_br_ext.c:479:11: arch/alpha/include/asm/string.h:22:16: error: '__builtin_memcpy' forming offset [40, 2051] is out of the bounds [0, 40] of object 'tag_buf' with type 'unsigned char[40]' Add the missing be16_to_cpu() to fix the compile error. It should be noted, however, that this fix means that the code did probably not work on any little endian systems and/or that the driver has other endiannes related issues. A build with C=1 suggests that this is indeed the case. This patch does not attempt to fix any of those other issues. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Cc: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220404134338.3276991-1-linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: ps_flag is never setMichael Straube2-9/+0
The field ps_flag in struct pwrctrl_priv is never set. It stays at its default value 0. Remove it and remove related dead code. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220404082142.4639-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: pwr_state_check_cnts is always zeroMichael Straube3-7/+1
The field pwr_state_check_cnts in struct pwrctrl_priv is set to 0 and never changed. Remove it and remove related dead code. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220404082142.4639-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: pnp_bstop_trx is never setMichael Straube3-7/+4
The field pnp_bstop_trx in struct pwrctrl_priv is never set. It stays at its default value 0. Remove it and remove related dead code. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220404082142.4639-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: reg_rfoff is never setMichael Straube2-6/+0
The field reg_rfoff in struct pwrctrl_priv is never set. It stays at its default value 0. Remove it and remove related dead code. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220404082142.4639-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: remove unused fields from struct pwrctrl_privMichael Straube1-8/+0
There are some unused fields in the pwrctrl_priv structure. Remove them. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220404082142.4639-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: rtl8712: Fix multiple blank lines warning from .c filesSathish Kumar4-4/+0
This patch fixes the checkpatch.pl warnings like: CHECK: Please don't use multiple blank lines + + from rtl871x_ioctl_rtl.c, rtl871x_ioctl_set.c, rtl871x_recv.c, and rtl871x_security.c Signed-off-by: Sathish Kumar <skumark1902@gmail.com> Link: https://lore.kernel.org/r/20220404035213.2609-1-skumark1902@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: rtl8712: Fix multiple blank lines warning from .h filesSathish Kumar16-28/+0
This patch fixes the checkpatch.pl warnings like: CHECK: Please don't use multiple blank lines + + from rtl8712_*.h, rtl871x_*.h, sta_info.h, and wifi.h Signed-off-by: Sathish Kumar <skumark1902@gmail.com> Link: https://lore.kernel.org/r/20220404034706.2384-1-skumark1902@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: add blank line between functionsRebecca Mckeever1-0/+1
Conform to Linux kernel coding style. Noticed when completing a different patch. Signed-off-by: Rebecca Mckeever <remckee0@gmail.com> Link: https://lore.kernel.org/r/ccacca6f679a879ad2032dc0aeb0b0156e3a847b.1649011311.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: combine both sides of conditional statementRebecca Mckeever1-6/+2
Both sides of conditional statement are the same except for the comment. Additional instance found with git grep. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rebecca Mckeever <remckee0@gmail.com> Link: https://lore.kernel.org/r/d33c51bc3a20fa25e4737b258f3b1c42cc8124e3.1649011311.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: remove handlerOS independent commentRebecca Mckeever1-1/+0
The "need to make timeout handlerOS independent" comment is incorrect. Remove the comment to avoid misleading developers. Additional instance found with git grep. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Rebecca Mckeever <remckee0@gmail.com> Link: https://lore.kernel.org/r/7d0d2253d86f46bc0def0447de424727d70f03a7.1649011311.git.remckee0@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: remove the bretry variableMartin Kaiser1-4/+2
Remove the bretry variable. It's set and used only once. Call the ieee80211 helper directly. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220403165438.357728-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: don't call get_hdr_bssidMartin Kaiser1-10/+7
Do not call get_hdr_bssid from validate_recv_data_frame. We already distinguish between the four cases for to_ds, from_ds. Copy the bssid address as described in the "DS bit usage" table in include/linux/ieee80211.h. Eventually, we should remove get_hdr_bssid (and other similar driver-specific parsing functions). Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220403165438.357728-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: remove psa, pdaMartin Kaiser1-5/+3
Remove the psa, pda variables. They are set and read only once. We can use the ieee80211 helpers directly. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220403165438.357728-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: ra and ta do not depend on to_ds, from_dsMartin Kaiser1-10/+6
The "DS bit usage" table in include/linux/ieee80211.h shows that ra is always addr1 and ta is always addr2. We can set pattrib->ra and pattrib->ta regardless of the to_ds and from_ds bits. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220403165438.357728-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: remove to_fr_ds from struct rx_pkt_attribMartin Kaiser3-19/+10
to_fr_ds in struct rx_pkt_attrib stores the values of the to_ds and from_ds bits of an incoming data frame. to_fr_ds is set by parsing the frame control bytes and it's used only in validate_recv_data_frame. Remove to_fr_ds from struct rx_pkt_attrib and use the ieee80211 helpers to distinguish between the four different cases for to_ds, from_ds. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220403165438.357728-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: don't copy ra and ta before we failMartin Kaiser1-5/+0
In validate_recv_data_frame, we return an error if both to_ds and from_ds are set in the incoming data frame. There's no need to populate patrib->ra and ta before we return. The caller will free the received frame, including pattrib. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220403165438.357728-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-04staging: r8188eu: to_fr_ds cannot be 3 hereMartin Kaiser1-2/+2
Remove two unnecessary ternary operators in validate_recv_data_frame. pattrib->to_fr_ds cannot be 3 in these places. If it was 3, we'd already have returned an error to the caller. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220403165438.357728-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>