- 23 Aug, 2022 3 commits
-
-
Michael Straube authored
The function init_mlme_ext_timer() is only used in rtw_mlme_ext.c. Make it static to get one step closer to removing os_dep/mlme_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/20220819125428.8412-2-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Wolfram Sang authored
Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20220818210108.7397-1-wsa+renesas@sang-engineering.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
The function rtw_endofpktfile() just checks for pkt_len == 0. Remove rtw_endofpktfile() and merge the check into the caller to improve readability and simplify the driver code. Reviewed-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220817063223.8140-1-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 16 Aug, 2022 37 commits
-
-
Grzegorz Szymaszek authored
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.plSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Grzegorz Szymaszek authored
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.plSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Grzegorz Szymaszek authored
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.plSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Grzegorz Szymaszek authored
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.plSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Grzegorz Szymaszek authored
The old rtl8188eu module, removed in commit 55dfa29b ("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-df6d00Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
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.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
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.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
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.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
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.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
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.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
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.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Martin Kaiser authored
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.cxSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
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.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
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.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
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.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-