summaryrefslogtreecommitdiffstats
path: root/drivers/staging
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'staging-6.0-rc1' of ↵Linus Torvalds2022-08-04101-1984/+9805
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here is the big set of staging driver patches for 6.0-rc1. Another round where we removed more lines of code than added, always a nice progression. Some of that came from the movement of the vme code back into staging, and removal of some other of the vme driver code as there are no known users and it is very obsolete and unmaintained. It can be added back easily if someone offers to maintain it. Other than that this merge has lots of little things: - huge cleanups for r8188eu driver - minor cleanups for other wifi drivers - tiny loop fixes for greybus code - other small coding style fixes All of these have been in linux-next for a while with no reported issues" * tag 'staging-6.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (191 commits) staging: r8188eu: fix potential uninitialised variable use in rtw_pwrctrl.c staging: r8188eu: remove initializer from ret in rtw_pwr_wakeup staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to function staging: vt6655: Rename MACvClearStckDS staging: fbtft: core: set smem_len before fb_deferred_io_init call staging: r8188eu: convert rtw_pwr_wakeup to correct error code semantics staging: r8188eu: make dump_chip_info() static staging: r8188eu: remove DoReserved prototype staging: r8188eu: remove OnAtim prototype staging: r8188eu: remove SetHwReg8188EU() staging: r8188eu: make update_TSF() and correct_TSF() static staging: r8188eu: remove unused parameter from update_TSF() staging: r8188eu: remove unused parameter from correct_TSF() staging: r8188eu: remove HW_VAR_SET_OPMODE from SetHwReg8188EU() staging: pi433: remove duplicated comments staging: qlge: refine variable name staging: vt6655: Convert macro vt6655_mac_word_reg_bits_off to function staging: vt6655: Convert macro vt6655_mac_reg_bits_off to function staging: vt6655: Convert macro vt6655_mac_word_reg_bits_on to function staging: vt6655: Convert macro vt6655_mac_reg_bits_on to function ...
| * staging: r8188eu: fix potential uninitialised variable use in rtw_pwrctrl.cPhillip Potter2022-07-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set ret to 0 (success) before entering first if statement, thereby assuring that even if the device is not associated and further checks pass, we do not then end up returning the uninitialized value of ret. This assignment is deliberately now directly before the if statement, in order to keep it clear what is happening as opposed to having it as an initialization at the start of the function like it was originally. Also add a comment to make it clear this first if block is currently a success path. As a side note, smatch does not trigger warnings for this change, for me at least. Within core/rtw_pwrctrl.c in the rtw_pwr_wakeup function, I previously dropped the initialization of 'ret' (int ret = 0;) in favour of its assignment which happens inside the first if block directly before its corresponding goto. This was the cause of this bug, and was introduced by: commit f3a76018dd55 ("staging: r8188eu: remove initializer from ret in rtw_pwr_wakeup"). Fixes: f3a76018dd55 ("staging: r8188eu: remove initializer from ret in rtw_pwr_wakeup") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220730235910.1145-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove initializer from ret in rtw_pwr_wakeupPhillip Potter2022-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Remove the success initializer from the ret variable in rtw_pwr_wakeup, as we set it later anyway in the success path, and also set on failure. This makes the function appear cleaner and more consistent. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220728231150.972-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Convert macro vt6655_mac_clear_stck_ds to functionPhilipp Hortmann2022-07-282-8/+9
| | | | | | | | | | | | | | | | | | | | | | Convert once used macro to static function. Multiline macros are not liked by kernel community. Rename variable byOrgValue to reg_value to avoid CamelCase which is not accepted by checkpatch.pl. Change variable declaration to u8 as this improves readability. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/cbfe5cc170b68564ff45bb7f45c63de241c2a664.1658986804.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename MACvClearStckDSPhilipp Hortmann2022-07-282-2/+2
| | | | | | | | | | | | | | | | | | | | Rename MACvClearStckDS macro to vt6655_mac_clear_stck_ds to avoid CamelCase which is not accepted by checkpatch.pl and to clean up namespace. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/8ba4413d52e95406393755f48da065511b891f03.1658986804.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: fbtft: core: set smem_len before fb_deferred_io_init callPeter Suti2022-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The fbtft_framebuffer_alloc() calls fb_deferred_io_init() before initializing info->fix.smem_len. It is set to zero by the framebuffer_alloc() function. It will trigger a WARN_ON() at the start of fb_deferred_io_init() and the function will not do anything. Fixes: 856082f021a2 ("fbdev: defio: fix the pagelist corruption") Signed-off-by: Peter Suti <peter.suti@streamunlimited.com> Link: https://lore.kernel.org/r/20220727073550.1491126-1-peter.suti@streamunlimited.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: convert rtw_pwr_wakeup to correct error code semanticsPhillip Potter2022-07-273-23/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the rtw_pwr_wakeup function to use 0 on success and an appropriate error code on error. For the first failure block where ips_leave is invoked, use -ENOMEM as this is the main cause of failure here anyway. For the second failure block, use -EBUSY, as it seems the most appropriate. Finally, within the functions rtw_wx_set_mode, rtw_wx_set_wap, rtw_wx_set_scan and rtw_wx_set_essid, pass the error code on from rtw_pwr_wakeup as appropriate now that it is converted. This gets the driver closer to removal of the non-standard _SUCCESS and _FAIL definitions, which are inverted compared to the standard in-kernel error code mechanism. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20220725220745.12739-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: make dump_chip_info() staticMichael Straube2022-07-273-42/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function dump_chip_info() is only used in rtl8188e_hal_init.c. Make it static to reduce the driver object file size by 281 bytes. before: text data bss dec hex filename 530606 43897 7072 581575 8dfc7 drivers/staging/r8188eu/r8188eu.o after: text data bss dec hex filename 530405 43817 7072 581294 8deae drivers/staging/r8188eu/r8188eu.o 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/20220724182520.7794-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove DoReserved prototypeMartin Kaiser2022-07-271-2/+0
| | | | | | | | | | | | | | | | | | | | | | The DoReserved function was removed in commit 869ddbfccdea ("staging: r8188eu: remove dummy entries from OnAction_tbl"). Remove the prototype as well. 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/20220724153349.138741-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove OnAtim prototypeMartin Kaiser2022-07-271-2/+0
| | | | | | | | | | | | | | | | | | | | The OnAtim function was removed in commit 6d933902c609 ("staging: r8188eu: remove OnAtim"). Remove the prototype as well. 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/20220724153349.138741-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove SetHwReg8188EU()Michael Straube2022-07-273-52/+33
| | | | | | | | | | | | | | | | | | | | | | | | Remove the case HW_VAR_CORRECT_TSF from SetHwReg8188EU() and move the functionality to the function that calls SetHwReg8188EU() with HW_VAR_CORRECT_TSF. SetHwReg8188EU() is empty now and we can finally remove it. Tested-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220715062908.8547-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: make update_TSF() and correct_TSF() staticMichael Straube2022-07-273-23/+20
| | | | | | | | | | | | | | | | | | The functions update_TSF() and correct_TSF() are only used in rtw_mlme_ext.c. Make them static. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220715062908.8547-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove unused parameter from update_TSF()Michael Straube2022-07-273-4/+4
| | | | | | | | | | | | | | | | The parameter 'len' of update_TSF() is unused. Remove it. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220715062908.8547-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove unused parameter from correct_TSF()Michael Straube2022-07-273-4/+4
| | | | | | | | | | | | | | | | The parameter 'pmlmeext' of correct_TSF() is unused. Remove it. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220715062908.8547-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove HW_VAR_SET_OPMODE from SetHwReg8188EU()Michael Straube2022-07-274-110/+107
| | | | | | | | | | | | | | | | | | | | Remove the HW_VAR_SET_OPMODE case from SetHwReg8188EU() and move the functions that are called by that case to rtw_mlme_ext.c. This is part of the ongoing effort to get rid of SetHwReg8188EU(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220715062908.8547-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: pi433: remove duplicated commentsSidong Yang2022-07-271-1/+1
| | | | | | | | | | | | | | | | | | Remove duplicated words in comments for readability. The words are duplicated from a sentence below. Signed-off-by: Sidong Yang <realwakka@gmail.com> Link: https://lore.kernel.org/r/20220725114513.85089-1-realwakka@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: qlge: refine variable nameBinyi Han2022-07-271-7/+7
| | | | | | | | | | | | | | | | tmp as a variable name don't have much information, change tmp to dma. Signed-off-by: Binyi Han <dantengknight@gmail.com> Link: https://lore.kernel.org/r/20220715061754.GA6657@cloud-MacBookPro Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Convert macro vt6655_mac_word_reg_bits_off to functionPhilipp Hortmann2022-07-142-7/+10
| | | | | | | | | | | | | | | | | | Convert macro vt6655_mac_word_reg_bits_off to function. checkpatch.pl does not accept multiline macros. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/04fb37871c4d383c27287934a0dddb3aa7974b08.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Convert macro vt6655_mac_reg_bits_off to functionPhilipp Hortmann2022-07-142-7/+9
| | | | | | | | | | | | | | | | | | Convert macro vt6655_mac_reg_bits_off to function. checkpatch.pl does not accept multiline macros. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/422950c8e1349fba2f97b0b95ba13f361cde05d9.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Convert macro vt6655_mac_word_reg_bits_on to functionPhilipp Hortmann2022-07-142-7/+9
| | | | | | | | | | | | | | | | | | Convert macro vt6655_mac_word_reg_bits_on to function. checkpatch.pl does not accept multiline macros. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/255c7f5a5e98a399aa4e299e7cf567016bd86d60.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Convert macro vt6655_mac_reg_bits_on to functionPhilipp Hortmann2022-07-142-7/+9
| | | | | | | | | | | | | | | | | | Convert macro vt6655_mac_reg_bits_on to function. checkpatch.pl does not accept multiline macros. Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/6b23869ec13b35359b135f005a81f3ed50e5801e.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename MACvWordRegBitsOffPhilipp Hortmann2022-07-143-8/+8
| | | | | | | | | | | | | | | | | | Fix name of a macro that uses CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/b8d4b72ddfdefb6b8a73fb95f6851e0f365118ba.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename MACvRegBitsOffPhilipp Hortmann2022-07-145-22/+22
| | | | | | | | | | | | | | | | | | Fix name of a macro that uses CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/e6bea6707f20a53d0631dd1f477ce72d36cd6f3e.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename MACvWordRegBitsOnPhilipp Hortmann2022-07-144-13/+13
| | | | | | | | | | | | | | | | | | Fix name of a macro that uses CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/b3873e1103d642a804d42c945dc0c73d94b0c1cf.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename MACvRegBitsOnPhilipp Hortmann2022-07-147-28/+24
| | | | | | | | | | | | | | | | | | Fix name of a macro that uses CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/7fb9627441ff97897d132c62d59676355b6d14ea.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename wData to reg_value in two macrosPhilipp Hortmann2022-07-141-6/+6
| | | | | | | | | | | | | | | | | | Fix name of a variable in two macros that use CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/8f2e9451a24e380c997fcf7c87249f7ed9b66787.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename byData to reg_value in two macrosPhilipp Hortmann2022-07-141-6/+6
| | | | | | | | | | | | | | | | | | Fix name of a variable in two macros that use CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/159014866cce40913d360a0692fb3c426d4cb840.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename wBits to bit_mask in two macrosPhilipp Hortmann2022-07-141-4/+4
| | | | | | | | | | | | | | | | | | Fix name of a variable in two macros that use CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/8929407dc7355df515b7f9fdd195b45ff44f6b98.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename byBits to bit_mask in two macrosPhilipp Hortmann2022-07-141-4/+4
| | | | | | | | | | | | | | | | | | Fix name of a variable in two macros that use CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/5ac7e8860ecb23232cf5befea024872e7db76d59.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: vt6655: Rename byRegOfs to reg_offset in four macrosPhilipp Hortmann2022-07-141-12/+12
| | | | | | | | | | | | | | | | | | Fix name of a variable in four macros that use CamelCase which is not accepted by checkpatch.pl Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/82f65d22ac8cd75b2c7790c13be3d0068968925b.1657657918.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: fall back to random mac addressMartin Kaiser2022-07-141-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call eth_random_addr to generate a random mac address if we cannot load the mac address from the efuses. Do not use a constant mac address as fallback. This may create conflicts if we have several r8188eu devices on the network. Suggested-by: Joe Perches <joe@perches.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Reviewed-by: Pavel Skripkin <paskripkin@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220713075552.140927-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r888eu: use dynamic allocation for efuse bufferMartin Kaiser2022-07-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use kmalloc to allocate the efuse buffer in ReadAdapterInfo8188EU and free it on exit. This is better than using a 512 byte array on the stack. It's ok to drop the __aligned(4) qualifier. kmalloc aligns to ARCH_KMALLOC_MINALIGN, this is at least 8 bytes. Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Suggested-by: Larry Finger <Larry.Finger@lwfinger.net> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220713075804.140986-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: qlge: Avoid multiplication while keep the same logicBinyi Han2022-07-141-6/+8
| | | | | | | | | | | | | | | | Avoid the more expensive multiplication while keep the same logic. Signed-off-by: Binyi Han <dantengknight@gmail.com> Link: https://lore.kernel.org/r/31fe21bf4a9e8f13cf27bd50073e9d5d197654ea.1657697683.git.dantengknight@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: qlge: Fix indentation issue under long for loopBinyi Han2022-07-141-8/+10
| | | | | | | | | | | | | | | | | | Fix indentation issue to adhere to Linux kernel coding style, issue found by checkpatch. And change the long for loop into 3 lines. Signed-off-by: Binyi Han <dantengknight@gmail.com> Link: https://lore.kernel.org/r/4e18dabcce7f589386a33ceed59096aa049779f0.1657697683.git.dantengknight@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove HW_VAR_MLME_SITESURVEY from SetHwReg8188EU()Michael Straube2022-07-125-66/+70
| | | | | | | | | | | | | | | | | | | | | | Remove the HW_VAR_MLME_SITESURVEY case from SetHwReg8188EU() and move the functionality to two new functions in rtw_mlme_ext.c. This is part of the ongoing effort to get rid of SetHwReg8188EU(). 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/20220711174417.10721-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: the bcnhead parameter is always 0Martin Kaiser2022-07-111-14/+2
| | | | | | | | | | | | | | | | | | The only caller of efuse_read_phymap_from_txpktbuf sets bcnhead to 0. Remove this function parameter and simplify the function body. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-15-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: efuse_utilized is never readMartin Kaiser2022-07-111-9/+0
| | | | | | | | | | | | | | | | | | The efuse_utilized variable in function efuse_phymap_to_logical is written to but never read. Remove it. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-14-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: _offset is always 0 in efuse_phymap_to_logicalMartin Kaiser2022-07-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | The _offset parameter of iol_read_efuse is always 0. Remove the parameter and use 0 in the function body. We can now replace the bytewise copy from efuseTbl to pbuf with memcpy. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-13-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: offset is always 0 in iol_read_efuseMartin Kaiser2022-07-111-3/+3
| | | | | | | | | | | | | | | | | | The offset parameter of iol_read_efuse is always 0. Remove the parameter and use 0 in the function body. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: offset is always 0 in rtl8188e_ReadEFuseMartin Kaiser2022-07-113-5/+5
| | | | | | | | | | | | | | | | | | The offset parameter of rtl8188e_ReadEFuse is always 0. Remove the parameter and use 0 in the function body. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: txpktbuf_bndy is always 0Martin Kaiser2022-07-111-4/+4
| | | | | | | | | | | | | | | | | | The only caller of iol_read_efuse sets the txpktbuf_bndy parameter to 0. Remove the parameter from iol_read_efuse and use 0 in the function body. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: merge ReadEFuseByIC into rtl8188e_ReadEFuseMartin Kaiser2022-07-111-6/+1
| | | | | | | | | | | | | | | | | | The rtl8188e_ReadEFuse function is just a wrapper to call ReadEFuseByIC. Copy ReadEFuseByIC into rtl8188e_ReadEFuse and remove ReadEFuseByIC. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: use memcpy for fallback mac addressMartin Kaiser2022-07-111-3/+1
| | | | | | | | | | | | | | | | | | Use memcpy to store the fallback mac address in eeprom->mac_addr. Do not copy byte by byte. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: always initialise efuse buffer with 0xffMartin Kaiser2022-07-111-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If BOOT_FROM_EEPROM is set, efuse_buf is not initialised before it is passed to functions that read from it. The buffer will be filled with 0x00 in this case like all local variables. However, the parsing functions expect the buffer to be filled with 0xFF if reading eeprom/efuse data failed. Fill the buffer with 0xFF before we try to read the data. Please note that this problem existed before we started using a local buffer. Adapter->eeprompriv->efuse_eeprom_data was allocated as a part of struct adapter by a vzalloc call in rtw_usb_if1_init. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: use a local buffer for efuse dataMartin Kaiser2022-07-112-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The efuse_eeprom_data array in struct eeprom_priv is used only by ReadAdapterInfo8188EU. We can remove efuse_eeprom_data and use a local buffer instead. Use EFUSE_MAP_LEN_88E as buffer size. Its value is the same as HWSET_MAX_SIZE_512. The functions that access the buffer use EFUSE_MAP_LEN_88E for its size. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: merge EFUSE_ShadowMapUpdate with its callerMartin Kaiser2022-07-113-34/+9
| | | | | | | | | | | | | | | | | | | | | | | | Merge the EFUSE_ShadowMapUpdate function into ReadAdapterInfo8188EU, which is the only caller. Merging the two functions makes it clearer that eeprom->efuse_eeprom_data is in fact a temporary buffer that stores info read from efuses. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove eeprom function prototypesMartin Kaiser2022-07-111-6/+0
| | | | | | | | | | | | | | | | | | Remove prototypes for non-existing eeprom functions. It seems that r8188eu has efuses but no eeprom. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove EepromOrEfuse from struct eeprom_privMartin Kaiser2022-07-113-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EepromOrEfuse flag in struct eeprom_priv is used only in the ReadAdapterInfo8188EU function. We can remove EepromOrEfuse from struct eeprom_priv. As the meaning of EepromOrEfuse isn't obvious, there is a macro is_boot_from_eeprom that's used for checking the value. We don't need the macro, writing the check as !(eeValue & BOOT_FROM_EEPROM) makes it clear what is checked. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove unused eeprom definesMartin Kaiser2022-07-111-6/+0
| | | | | | | | | | | | | | | | | | | | Remove some eeprom-related defines which are not used by the r8188eu driver. This driver uses BOOT_FROM_EEPROM and EEPROM_EN instead of the defines that this patch removes. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220709171000.180481-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * staging: r8188eu: remove HW_VAR_DM_FUNC_CLR from SetHwReg8188EU()Michael Straube2022-07-113-8/+10
| | | | | | | | | | | | | | | | | | | | Remove the HW_VAR_DM_FUNC_CLR case from SetHwReg8188EU() and move its functionality to a static function. This is part of the ongoing effort to get rid of SetHwReg8188EU(). Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220709094458.9578-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>