aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-22clk: clocking-wizard: Move clocking-wizard outShubhrajyoti Datta7-692/+0
Add clocking wizard driver to clk. And delete the driver from the staging as it is in drivers/clk. Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Link: https://lore.kernel.org/r/20220411100443.15132-3-shubhrajyoti.datta@xilinx.com Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2022-08-20staging: iio: frequency: ad9832: Fix alignment for DMA safetyJonathan Cameron1-2/+2
____cacheline_aligned is an insufficient guarantee for non-coherent DMA on platforms with 128 byte cachelines above L1. Switch to the updated IIO_DMA_MINALIGN definition. Whilst here, move the marking to cover the whole union. That has no functional affect, but makes it slightly easier to see what is going on. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20220813160600.1157169-1-jic23@kernel.org
2022-08-16staging: r8188eu: Add Rosewill USB-N150 Nano to device tablesLarry Finger1-0/+1
This device is reported as using the RTL8188EUS chip. It has the improbable USB ID of 0bda:ffef, which normally would belong to Realtek, but this ID works for the reporter. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: stable <stable@kernel.org> Link: https://lore.kernel.org/r/20220814175027.2689-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: drop the DRIVERVERSION macroGrzegorz Szymaszek2-2/+0
Since the driver is currently in the kernel, the module version macro is not necessary. Link: https://lore.kernel.org/lkml/Yuy7Lc%2FTJMinuupA@kroah.com/ Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl> Link: https://lore.kernel.org/r/39e6b702918b7bcc59dec381022c1d1b97c2046e.1659715931.git.gszymaszek@short.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: drop the DRV_NAME macroGrzegorz Szymaszek1-2/+0
The DRV_NAME macro is not used anywhere; KBUILD_MODNAME should be used instead. Remove the macro declaration. Link: https://lore.kernel.org/lkml/Yuy7Lc%2FTJMinuupA@kroah.com/ Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl> Link: https://lore.kernel.org/r/f8d7b4ba4533a315ebd6711f17bbfd81e99ccf5a.1659715931.git.gszymaszek@short.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: use KBUILD_MODNAME instead of a string constantGrzegorz Szymaszek1-1/+1
The field .usbdrv.name of the struct rtw_usb_drv hardcoded the module (driver) name as a constant string. Replace the string with the KBUILD_MODNAME macro. Link: https://lore.kernel.org/lkml/Yuy7QSh%2FclQ5Ki09@kroah.com/ Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl> Link: https://lore.kernel.org/r/0325540ba8be0a3dc4083d22e484a8a31fb2a892.1659715931.git.gszymaszek@short.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: set firmware path in a macroGrzegorz Szymaszek3-2/+3
The r8188eu driver requires a firmware file, the path of which was hardcoded as constant strings in two places: (1) in core/rtw_fw.c, in function load_firmware(), (2) in os_dep/os_intfs.c, in the MODULE_FIRMWARE() call. Declare the path using a macro, FW_RTL8188EU, and replace the above constant strings with the macro. That's the way it is done in many other drivers. The new macro is defined in include/drv_types.h, because that file is already included by both of the above files (or at least their headers) and because it already contains other driver constants, like its name and version. Link: https://lore.kernel.org/lkml/YuoQ37PIKzWO1zIY@kroah.com/ Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl> Link: https://lore.kernel.org/r/60dc57fc73e8e6e8e3aaae68784f4be932547bf5.1659715931.git.gszymaszek@short.pl Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: add firmware dependencyGrzegorz Szymaszek1-0/+1
The old rtl8188eu module, removed in commit 55dfa29b43d2 ("staging: rtl8188eu: remove rtl8188eu driver from staging dir") (Linux kernel v5.15-rc1), required (through a MODULE_FIRMWARE call()) the rtlwifi/rtl8188eufw.bin firmware file, which the new r8188eu driver no longer requires. I have tested a few RTL8188EUS-based Wi-Fi cards and, while supported by both drivers, they do not work when using the new one and the firmware wasn't manually loaded. According to Larry Finger, the module maintainer, all such cards need the firmware and the driver should depend on it (see the linked mails). Add a proper MODULE_FIRMWARE() call, like it was done in the old driver. Thanks to Greg Kroah-Hartman and Larry Finger for quick responses to my questions. Link: https://answers.launchpad.net/ubuntu/+source/linux-meta-hwe-5.15/+question/702611 Link: https://lore.kernel.org/lkml/YukkBu3TNODO3or9@nx64de-df6d00/ Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl> Link: https://lore.kernel.org/r/YulcdKfhA8dPQ78s@nx64de-df6d00 Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: add firmware dependencyGrzegorz Szymaszek1-0/+1
The old rtl8188eu module, removed in commit 55dfa29b43d2 ("staging: rtl8188eu: remove rtl8188eu driver from staging dir") (Linux kernel v5.15-rc1), required (through a MODULE_FIRMWARE call()) the rtlwifi/rtl8188eufw.bin firmware file, which the new r8188eu driver no longer requires. I have tested a few RTL8188EUS-based Wi-Fi cards and, while supported by both drivers, they do not work when using the new one and the firmware wasn't manually loaded. According to Larry Finger, the module maintainer, all such cards need the firmware and the driver should depend on it (see the linked mails). Add a proper MODULE_FIRMWARE() call, like it was done in the old driver. Thanks to Greg Kroah-Hartman and Larry Finger for quick responses to my questions. Cc: stable <stable@kernel.org> Link: https://answers.launchpad.net/ubuntu/+source/linux-meta-hwe-5.15/+question/702611 Link: https://lore.kernel.org/lkml/YukkBu3TNODO3or9@nx64de-df6d00/ Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl> Link: https://lore.kernel.org/r/YulcdKfhA8dPQ78s@nx64de-df6d00 Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: make rtw_init_recv_timer() staticMichael Straube4-28/+13
The function rtw_init_recv_timer() is only used in rtw_sta_mgt.c. Make it static and remove the now empty file os_dep/recv_linux.c. 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/20220807181538.8499-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: make rtw_recv_indicatepkt() staticMichael Straube3-82/+79
The function rtw_recv_indicatepkt() is only used in rtw_recv.c. Make it static. 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/20220807181538.8499-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: make rtw_handle_tkip_mic_err() staticMichael Straube3-38/+36
The function rtw_handle_tkip_mic_err() is only used in rtw_recv.c. Make it static. 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/20220807181538.8499-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: merge rtw_os_recvbuf_resource_alloc() into rtw_recv.cMichael Straube3-18/+6
Merge the functionality of the function rtw_os_recvbuf_resource_alloc() into rtl8188eu_init_recv_priv(). Merging the functionality instead of just making the function static improves readability and we have one function less to care about when converting the uses of _FAIL/_SUCCESS to normal kernel error code logic. 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/20220807181538.8499-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: merge rtw_os_recvbuf_resource_free() into rtw_recv.cMichael Straube3-10/+1
The function rtw_os_recvbuf_resource_free() is just a wrapper around usb_free_urb(). Call usb_free_urb() directly in rtl8188eu_free_recv_priv() and remove rtw_os_recvbuf_resource_free() to simplify the driver code. 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/20220807181538.8499-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: do not spam the kernel logMichael Straube2-2/+3
Drivers should not spam the kernel log if they work properly. Convert the functions Hal_EfuseParseIDCode88E() and _netdev_open() to use netdev_dbg() instead of pr_info() so that developers can still enable it if they want to see this information. 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/20220808065023.3175-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: the high prio queue is always selectedMartin Kaiser3-13/+9
The high priority queue is always selected, regardless of the number of out endpoints. Therefore, haldata->OutEpQueueSel & TX_SELE_HQ is always true. We can remove the check and use a define instead of the numHQ variable. This check was the last user of TX_SELE_HQ. Rename haldata->OutEpQueueSel to haldata->out_ep_extra_queues and store only the queues that are selected in addition to the high priority queue. 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/20220808201405.68966-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: remove two unused definesMartin Kaiser1-2/+0
HPQ_PUBLIC_DIS and LPQ_PUBLIC_DIS are not used by the r8188eu driver. Remove them. 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/20220808201405.68966-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: change all num...Q variables to u8Martin Kaiser2-10/+4
All of numPubQ, numHQ and numLQ variables store only u8 values. Change their types to u8. We can then simplify the REG_RQPN expression. The macros and the temporary variable are not needed any more. 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/20220808201405.68966-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: make numNQ a u8Martin Kaiser2-6/+3
The numNQ variable in _InitQueueReservedPage is defined as u32. It is either set to 0 or to 0x1C. Change its type to u8 and remove the code that casts the u32 value to u8. 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/20220808201405.68966-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: remove a temporary variableMartin Kaiser1-2/+1
Use pregistrypriv->wifi_spec directly instead of defining a temporary variable. 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/20220808201405.68966-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: simplify _InitNormalChipTwoOutEpPriorityMartin Kaiser1-16/+7
Simplify the _InitNormalChipTwoOutEpPriority function, now that we have only one configuration for the queues. Remove the variables which are constant. Keep only those settings that depend on wifi_spec. 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/20220806195540.777390-14-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: we always use HQ and NQ for two endpointsMartin Kaiser1-20/+2
When _InitNormalChipTwoOutEpPriority is called, pdvobjpriv->RtNumOutPipes and haldata->OutEpQueueSel have already been initialized. _InitNormalChipTwoOutEpPriority is called only if pdvobjpriv->RtNumOutPipes == 2. In this case, haldata->OutEpQueueSel is always TX_SELE_HQ | TX_SELE_NQ. Remove the switch-case statement and set valueHi and valueLow directly. 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/20220806195540.777390-13-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: remove _InitNormalChipOneOutEpPriorityMartin Kaiser1-23/+2
When _InitNormalChipOneOutEpPriority is called, pdvobjpriv->RtNumOutPipes and haldata->OutEpQueueSel have already been initialized. _InitNormalChipOneOutEpPriority is called only if pdvobjpriv->RtNumOutPipes == 1. In this case, haldata->OutEpQueueSel is always TX_SELE_HQ. We can then simplify _InitNormalChipOneOutEpPriority to a single _InitNormalChipRegPriority call, i.e. we can remove _InitNormalChipOneOutEpPriority and call _InitNormalChipRegPriority directly. 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/20220806195540.777390-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: simplify two_out_pipeMartin Kaiser1-4/+3
Simplify the two_out_pipe function. Move common settings out of the if clause. 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/20220806195540.777390-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: simplify three_out_pipeMartin Kaiser1-11/+6
Only one of the mappings in three_out_pipe depends on the wifi_cfg flag. Simplify the code accordingly. 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/20220806195540.777390-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: summarize common Queue2Pipe settingsMartin Kaiser1-27/+5
Regardless of the number of endpoints, queues 4 to 7 are mapped to pipe 0. Move these mappings to rtl8188eu_interface_configure to make the code simpler. It's ok to make these settings even if we exit with error later. In this case, the driver will not be loaded and pdvobjpriv->Queue2Pipe[] will be freed. 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/20220806195540.777390-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: remove comments about endpoint mappingMartin Kaiser1-18/+6
Remove the comments in two_out_pipe and three_out_pipe that show the mappings. They simply repeat the settings in the code and provide no additional information. Keep the info which RtOutPipe is high, normal or low. Without the removed comments, it'll be easier to summarize and reorganize the code. 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/20220806195540.777390-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: remove OutEpNumberMartin Kaiser2-6/+2
Remove the OutEpNumber component of struct hal_data_8188e. RtNumOutPipes in struct dvobj_priv stores the same info. Update the only place where OutEpNumber is read. 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/20220806195540.777390-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: summarize endpoint-related settingsMartin Kaiser1-38/+17
rtl8188eu_interface_configure calls _ConfigNormalChipOutEP_8188E and Hal_MappingOutPipe. Both of these functions make some settings based on the number of out endpoints on the 8188eu chip. We can merge both of them into rtl8188eu_interface_configure and summarize the common code. 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/20220806195540.777390-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: move endpoint init functions to usb_halinit.cMartin Kaiser3-110/+108
Move the Hal_MappingOutPipe function and the functions one_/two_/three_out_pipe from hal_com.c to usb_halinit.c. After this move, all the functions that rtl8188eu_interface_configure calls are in one file and we can continue to summarize and merge them. 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/20220806195540.777390-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: merge two small functionsMartin Kaiser1-8/+2
All that rtl8188eu_interface_configure does is call HalUsbSetQueuePipeMapping8188EUsb. We can merge the two functions. 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/20220806195540.777390-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: process HalUsbSetQueuePipeMapping8188EUsb's return valueMartin Kaiser3-4/+6
At the moment, HalUsbSetQueuePipeMapping8188EUsb returns an error status to rtl8188eu_interface_configure, where this status is discarded. Pass the error status from rtl8188eu_interface_configure to rtw_usb_if1_init and handle it there. 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/20220806195540.777390-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: Hal_MappingOutPipe should return an intMartin Kaiser3-7/+5
Update the Hal_MappingOutPipe function to return 0 for success or -EXNIO if the caller requested more than the number of available endpoints. This error code is also used by usb_find_common_endpoints if a requested endpoint was not found. Unlike a boolean return value, a negative error code can be returned to external functions that call the r8188eu driver, e.g. to the caller of our probe function. HalUsbSetQueuePipeMapping8188EUsb passes the return value of Hal_MappingOutPipe on to its caller. We have to change its return type from bool to int 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/20220806195540.777390-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: simplify the calculation of ie start offsetMartin Kaiser1-1/+1
Use offsetof to calculate the start offset of the information elements in an association response message. This should make it easier to understand how the offset is calculated. 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/20220806111352.690650-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: read aid from struct ieee80211_mgmtMartin Kaiser1-2/+1
Read the aid of the association response message from struct ieee80211_mgmt. This should be easier to understand and to review than calculating the offset manually. Remove the cast to int, aid is a u16. Keep the 0x3fff mask that is currently applied to the aid. 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/20220806111352.690650-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: read capability info from struct ieee80211_mgmtMartin Kaiser1-2/+1
Read the capability info of the association response message from struct ieee80211_mgmt. This should be easier to understand and to review than calculating the offset manually. 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/20220806111352.690650-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: read status_code from struct ieee80211_mgmtMartin Kaiser1-4/+1
Read the status code of the association response message from struct ieee80211_mgmt. This should be easier to understand and to review than calculating the offset manually. 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/20220806111352.690650-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: replace a get_da callMartin Kaiser1-1/+2
The r8188eu driver implements an internal get_da function to read the destination address (da) from an incoming message. Callers of this function should be updated to use the ieee80211 framework, with the goal of removing get_da eventually. This patch replaces a get_da call in the OnAssocRsp 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/20220806111352.690650-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: clean up comment for phy_calculate_bit_shift()Michael Straube1-11/+1
Clean up the comment for function phy_calculate_bit_shift(). 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/20220806060929.11022-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: avoid camel case in phy_CalculateBitShift()Michael Straube1-6/+6
Rename the function phy_CalculateBitShift() and its parameter BitMask to avoid camel case. phy_CalculateBitShift -> phy_calculate_bit_shift BitMask -> bitmask 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/20220806060929.11022-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: use ffs() in phy_CalculateBitShift()Michael Straube1-6/+2
Use ffs() in phy_CalculateBitShift() to simplify the function and improve readability. 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/20220806060929.11022-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: convert rtw_p2p_enable to correct error code semanticsPhillip Potter2-18/+13
Convert the rtw_p2p_enable function to use correct error code semantics rather than _SUCCESS/_FAIL, and also make sure we allow these to be passed through properly in the one caller where we actually check the code, rtw_wext_p2p_enable. This change moves these functions to a clearer 'return 0;' style at the end of the function, and in the case of errors now returns ret instead of jumping to the end of the function, so that these can still be passed through but without using a goto to jump to a single return statement at the end which is less clear. This change moves the driver slowly closer to using standard error code semantics everywhere. 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/20220802234408.930-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: make rtl8188eu_{init,free}_recv_priv() staticMichael Straube4-94/+79
The functions rtl8188eu_init_recv_priv() and rtl8188eu_free_recv_priv() are only used in rtw_recv.c. Make them static and remove the now empty file rtl8188eu_recv.c. 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/20220804105532.7532-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: make handle_txrpt_ccx_88e() staticMichael Straube4-25/+14
The function handle_txrpt_ccx_88e() is only used in usb_ops_linux.c. Make it static and remove the now empty file rtl8188e_xmit.c. 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/20220804105532.7532-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging/rtl8723bs/core: remove inactive initializationLi zeming1-1/+1
The allocation address of the psta pointer variable is first performed in the function, no initialization assignment is required, and no invalid pointer will appear. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Li zeming <zeming@nfschina.com> Link: https://lore.kernel.org/r/20220802012513.2824-1-zeming@nfschina.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: refactor dump_chip_info()Michael Straube1-19/+13
Refactor the function dump_chip_info() to make the code cleaner and reduce the driver object file size. Instead of using sprintf() to print all the information to a buffer use a char pointer for the cut version string and print the other strings directly by netdev_dbg(). For the unknown cut string we can use a smaller buffer and print to that buffer with snprintf() to be safe. These changes avoid the possible buffer overflow that the original code had and reduces the driver object file size by 1029 bytes. Suggested-by: Joe Perches <joe@perches.com> 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/20220730150637.3550-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: convert dump_chip_info() to use netdev_dbg()Michael Straube1-4/+5
Drivers should not spam the kernel log if they work properly. Convert the dump_chip_info() function to use netdev_dbg() instead of pr_info() so that developers can still enable it if they want to see this information. 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/20220730150637.3550-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: return an error code in rtw_usb_if1_initMartin Kaiser1-20/+24
rtw_usb_if1_init returns a pointer that isn't used by the caller. Return an error code instead. We can then propagate errors from lower-level functions like ReadAdapterInfo8188EU and fail the initialisation of the driver with a proper error code. 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/20220730143939.671951-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: make rtw_handle_dualmac a void functionMartin Kaiser3-8/+3
The rtw_handle_dualmac function always returns _SUCCESS. Remove the return value and update the one caller that checks it. 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/20220730143939.671951-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-16staging: r8188eu: handle errors from ReadAdapterInfo8188EUMartin Kaiser3-5/+7
Update ReadAdapterInfo8188EU to return 0 for success or a negative error code. If rtw_read8 fails, we can just relay the error it returns. Update rtw_usb_if1_init to check the return value from ReadAdapterInfo8188EU. For now, rtw_usb_if1_init does not yet pass errors from ReadAdapterInfo8188EU on to its caller. Suggested-by: Pavel Skripkin <paskripkin@gmail.com> 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/20220730143939.671951-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>