summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* staging: r8188eu: remove 5 GHz codeMichael Straube2021-08-261-22/+8
| | | | | | | | | | | The driver is for chips that do not operate in the 5 GHz band. Remove some 5 GHz related code. Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210823193028.12391-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove cmd_osdep.h header fileMichael Straube2021-08-263-23/+5
| | | | | | | | | | | All functions declared in the cmd_osdep.h header file are only used in a single c source file. Make the functions static and remove the header file and its includes. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210821155151.25822-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: Make mult-byte entities in dhcp header be big endianLarry Finger2021-08-261-7/+7
| | | | | | | | | | The 16- and 32-bit quantities in the dhcp message definition must be big endian. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210821151459.26078-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: change declaration of Efuse_Read1ByteFromFakeContentPhillip Potter2021-08-261-11/+3
| | | | | | | | | | | | | | | | Remove forward declaration of Efuse_Read1ByteFromFakeContent function from core/rtw_efuse.c, as the function is defined in full directly after this and therefore this forward declaration is redundant. In addition, convert the storage class of the function to static, as the function is only used with rtw_efuse.c, and tidy up the signature alignment. Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Acked-by: Michael Straube<straube.linux@gmail.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210821105615.6307-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: Fix a resource leak in update_bcn_wps_ieXiangyang Zhang2021-08-261-1/+2
| | | | | | | | | | The "pbackup_remainder_ie" variable is not freed when "pwps_ie_src" is null Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Xiangyang Zhang <xyz.sun.ok@gmail.com> Link: https://lore.kernel.org/r/20210821081824.14745-1-xyz.sun.ok@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: set pipe only onceMartin Kaiser2021-08-261-7/+8
| | | | | | | | | | | | | | Set the pipe for reading or writing in usbctrl_vendorreq only once. There's no need to set it again for every retry. This patch is an adaptation of commit 889ed8b5e374 ("staging: rtl8188eu: set pipe only once") for the new r8188eu driver. Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove unused members of struct _io_opsMartin Kaiser2021-08-261-3/+0
| | | | | | | | | | Remove function pointers which are not used by the r8188eu driver. Acked-by: Michael Straube <straube.linux@gmail.com> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: clean up the usb_writeNMartin Kaiser2021-08-261-10/+5
| | | | | | | | | | Remove unnecessary variables, check the length. Acked-by: Michael Straube <straube.linux@gmail.com> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: clean up the usb_writeXY functionsMartin Kaiser2021-08-261-42/+8
| | | | | | | | | | Remove unnecessary variables, summarize declarations and assignments. Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: clean up the usb_readXY functionsMartin Kaiser2021-08-261-23/+7
| | | | | | | | | | Remove unnecessary variables, summarize declarations and assignments. Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove an unused enumMartin Kaiser2021-08-261-4/+0
| | | | | | | | | | The VENDOR_READ and VENDOR_WRITE defines are not used. Acked-by: Michael Straube <straube.linux@gmail.com> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: rewrite usb vendor request definesMartin Kaiser2021-08-261-2/+2
| | | | | | | | | | | Replace the numeric values with USB constants to make their meaning clearer. Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8188eu: use actual request type as parameterMartin Kaiser2021-08-261-34/+12
| | | | | | | | | | | | | | | | At the moment, usbctrl_vendorreq's requesttype parameter must be set to 1 for reading and 0 for writing. It's then converted to the actual bmRequestType for the USB control request. We can simplify the code and avoid this conversion if the caller passes the actual bmRequestType. This patch is an adaptation of commit 788fde031027 ("staging: rtl8188eu: use actual request type as parameter") for the new r8188eu driver. Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove unused defineMartin Kaiser2021-08-261-2/+0
| | | | | | | | | | _HCI_OPS_OS_C_ is not used in the r8188eu driver. Remove it. Acked-by: Michael Straube <straube.linux@gmail.com> Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove unnecessary castMartin Kaiser2021-08-261-1/+1
| | | | | | | | | | name is a const char * by default. This type should be ok for r8188eu. Acked-by: Phillip Potter <phil@philpotter.co.uk> Acked-by: Michael Straube <straube.linux@gmail.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210821164859.4351-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: remove header file ethernet.hMichael Straube2021-08-264-18/+5
| | | | | | | | | | | | | | | | | The header file ehternet.h defines only two constants. #define ETHERNET_HEADER_SIZE 14 /* Ethernet Header Length */ #define LLC_HEADER_SIZE 6 /* LLC Header Length */ Both are only used in the file core/rtw_recv.c and ETHERNET_HEADER_SIZE just duplicates the in-kernel constant ETH_HLEN. Replace the usage of ETHERNET_HEADER_SIZE with ETH_HLEN, move the definition of LLC_HEADER_SIZE into rtw_rev.h (renamed to LLC_HEADER_LENGTH) and remove the now unused header file ethernet.h. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210825100842.13217-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/rtl8192u: Prefer kcalloc over open coded arithmeticLen Baker2021-08-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrapping around and a smaller allocation being made than the caller was expecting. Using those allocations could lead to linear overflows of heap memory and other misbehaviors. In this case these aren't actually dynamic sizes: both sides of the multiplication are constant values. However it is best to refactor these anyway, just to keep the open-coded math idiom out of code. So, use the purpose specific kcalloc() function instead of the argument size * count in the kzalloc() function. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210824090039.GA7999@titan Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/rtl8192u: Initialize variables in the definition blockLen Baker2021-08-261-6/+3
| | | | | | | | | | Initialize the pre_cmd_cnt, post_cmd_cnt and rf_cmd_cnt variables in the definition block as it is not necessary to do this in the middle of the function. Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210824073643.GA7396@titan Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/rtl8192u: Avoid CamelCase in names of variablesLen Baker2021-08-261-48/+47
| | | | | | | | | Avoid CameCase in the names of all local variables inside the function rtl8192_phy_SwChnlStepByStep(). Signed-off-by: Len Baker <len.baker@gmx.com> Link: https://lore.kernel.org/r/20210824072545.7321-2-len.baker@gmx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: remove unused rtw_set_802_11_bssid() functionFabio Aiuto2021-08-262-65/+0
| | | | | | | | | remove rtw_set_802_11_bssid() function left unused after wext routines removal. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/b3d1756b6ae4be7ca4fc50e12bd7e10587a6020c.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: remove functions notifying wext eventsFabio Aiuto2021-08-264-48/+1
| | | | | | | | | | remove functions that once were meant to notify wext events to userspace. Now they are donig nothing useful so just remove them. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/0d745350ff3d411dda329b8c1e2261361570db6e.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: fix logical continuation issueFabio Aiuto2021-08-261-3/+3
| | | | | | | | | | | | | | | | | | | | | fix the following post-commit hook checkpatch issue: CHECK: Logical continuations should be on the previous line 52: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:389: + if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_ + || padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ CHECK: Logical continuations should be on the previous line 53: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:390: + || padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_ + || padapter->securitypriv.dot11PrivacyAlgrthm == _AES_) Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/5d4e7ab18005e69e8cc162619149d6fa93568875.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: fix code indent issuesFabio Aiuto2021-08-261-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix the following post commit hook checkpatch issues: ERROR: code indent should use tabs where possible 2463: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:388: + if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_$ ERROR: code indent should use tabs where possible 2464: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:389: + || padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_$ ERROR: code indent should use tabs where possible 2465: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:390: + || padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)$ ERROR: code indent should use tabs where possible 2466: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:391: + /* WPS open need to enable multicast */$ ERROR: code indent should use tabs where possible 2467: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:392: + /* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */$ ERROR: code indent should use tabs where possible 2468: FILE: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:393: + rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);$ Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/aa394052c8d81b4a00356adf5f98fc3c81f8b1d9.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: rtl8723bs: remove obsolete wext supportFabio Aiuto2021-08-263-3101/+1
| | | | | | | | | | | | | cfg80211 has been fully implemented so remove all wext and wext private handlers and their registration. Now wext userspace calls can be managed via cfg80211 wext compatibility. Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com> Link: https://lore.kernel.org/r/61c4bb20bbb6ce30e4ddd01aa73de3f686a99445.1629727333.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: mt7621-pci: fix hang when nothing is connected to pcie portsSergio Paracuellos2021-08-261-2/+11
| | | | | | | | | | | | | | | | | | | | When nothing is connected to pcie ports, each port is set to reset state. When this occurs, next access result in a hang on boot as follows: mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK) mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK) mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK) [ HANGS HERE ] Fix this just detecting 'nothing is connected state' to avoid next accesses to pcie port related configuration registers. Fixes: b99cc3a2b6b6 ("staging: mt7621-pci: avoid custom 'map_irq' function") Cc: stable <stable@vger.kernel.org> Reported-by: DENG Qingfang <dqfext@gmail.com> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20210823170803.2108-1-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove unused function rtw_remove_bcn_ie()Michael Straube2021-08-262-40/+0
| | | | | | | | | Function rtw_remove_bcn_ie() is not used anywhere, remove it. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210819112200.32030-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove unused function rtw_add_bcn_ie()Michael Straube2021-08-262-65/+0
| | | | | | | | | Function rtw_add_bcn_ie() is not used anywhere, remove it. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210819112200.32030-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove unneeded semicolonYang Li2021-08-263-3/+3
| | | | | | | | | | | | | | Eliminate the following coccicheck warning: ./drivers/staging/r8188eu/hal/rtl8188e_rxdesc.c:73:66-67: Unneeded semicolon ./drivers/staging/r8188eu/hal/rtl8188e_hal_init.c:2225:68-69: Unneeded semicolon ./drivers/staging/r8188eu/core/rtw_xmit.c:615:75-76: Unneeded semicolon Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/1629450505-28247-1-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wlan-ng: Avoid duplicate header in tx/rx framesKees Cook2021-08-266-53/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of open-coding the same header details in the tx/rx frames, directly include the actual struct. Rename associated variables to the more verbose of the two versions. This also has the benefit of being able to replace a field-spanning memcpy() with a direct assignment, helping clear the way for coming FORTIFY_SOURCE improvements. "diffoscope" reports no object code differences after this change, excepting the selection of different registers when switching from memcpy() to direct assignment: --- drivers/staging/wlan-ng/prism2usb.o.before +++ drivers/staging/wlan-ng/prism2usb.o.after ├── objdump --line-numbers --disassemble --demangle --reloc --no-show-raw-insn --section=.text {} │ @@ -4887,24 +4887,24 @@ │ sub %rdi,%rcx │ add $0x3c,%ecx │ shr $0x3,%ecx │ rep stos %rax,%es:(%rdi) │ mov $0x8,%eax │ movl $0x123,0x23e(%rbx) │ mov %ax,0x244(%rbx) │ - mov (%rdx),%rcx │ - mov %rcx,0x246(%rbx) │ - mov 0x8(%rdx),%rcx │ - mov %rcx,0x24e(%rbx) │ - mov 0x10(%rdx),%rcx │ - mov %rcx,0x256(%rbx) │ - mov 0x18(%rdx),%ecx │ - mov %ecx,0x25e(%rbx) │ - movzwl 0x1c(%rdx),%edx │ - mov %dx,0x262(%rbx) │ + mov (%rdx),%rax │ + mov %rax,0x246(%rbx) │ + mov 0x8(%rdx),%rax │ + mov %rax,0x24e(%rbx) │ + mov 0x10(%rdx),%rax │ + mov %rax,0x256(%rbx) │ + mov 0x18(%rdx),%eax │ + mov %eax,0x25e(%rbx) │ + movzwl 0x1c(%rdx),%eax │ + mov %ax,0x262(%rbx) │ cmpq $0x0,0x0(%rbp) │ movzwl 0x70(%rsi),%eax │ je 477a <hfa384x_drvr_txframe+0xba> │ add $0x8,%eax │ mov $0x44,%r12d │ mov %ax,0x264(%rbx) │ mov 0x70(%r13),%edx Cc: Romain Perier <romain.perier@gmail.com> Cc: Allen Pais <apais@linux.microsoft.com> Cc: Ivan Safonov <insafonov@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210819174537.3499227-3-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: wlan-ng: Remove pointless a3/a4 unionKees Cook2021-08-269-62/+48
| | | | | | | | | | | | | | | | | | | | There is no need for the a3/a4 union. The two structs are identical except for the addition of a4. Excepting one place, the structs are only ever used in the union, and the union is always allocated at full size. The one instance of the a3-specific struct can be replaced with the full version, as no sizing information is used. Replace the union with the a4 version of the struct. "diffoscope" reports there are no object code differences after this change. Cc: Allen Pais <apais@linux.microsoft.com> Cc: Romain Perier <romain.perier@gmail.com> Cc: Chen Lin <chen.lin5@zte.com.cn> Cc: Ivan Safonov <insafonov@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-staging@lists.linux.dev Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210819174537.3499227-2-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: use GFP_ATOMIC under spinlockMichael Straube2021-08-261-1/+1
| | | | | | | | | | | | | | kmalloc() in function update_bcn_wps_ie() is called under a spinlock so the allocation have to be atomic. -> update_beacon() <- takes a spinlock -> update_bcn_vendor_spec_ie() -> update_bcn_wps_ie() Fixes: 79f712ea994de ("staging: r8188eu: Remove wrappers for kalloc() and kzalloc()") Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210819152914.17482-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: fix scheduling while atomic bugsMichael Straube2021-08-261-2/+2
| | | | | | | | | | | | | | These allocations are sometimes done under a spin lock so they have to be atomic. The function call tree is: -> update_beacon() <- takes a spin lock -> update_BCNTIM() -> set_tx_beacon_cmd() Fixes: 79f712ea994de ("staging: r8188eu: Remove wrappers for kalloc() and kzalloc()") Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20210819092423.4349-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: Remove empty rtw_mfree_xmit_priv_lock()Fabio M. De Francesco2021-08-191-6/+0
| | | | | | | | | Remove rtw_mfree_xmit_priv_lock() because it is empty. Remove its only call from within _rtw_free_xmit_priv(). Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Link: https://lore.kernel.org/r/20210819050808.28825-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove rtw_update_mem_stat macro and associated flagsPhillip Potter2021-08-191-20/+0
| | | | | | | | | Remove the unused rtw_update_mem_stat macro and the associated flags from include/osdep_service.h as this is all dead code. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234853.208448-8-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove function _rtw_zvmallocPhillip Potter2021-08-192-10/+0
| | | | | | | | | | | | | | | | Remove the function _rtw_zvmalloc from os_dep/osdep_service.c, as this function is now unused and is just an inline wrapper around vmalloc which zeroes out the memory. All previous callers have been converted to use vzalloc. Also remove the declaration from include/osdep_service.h. It is considered generally bad practice to declare functions as inline in the majority of cases, as not only can this qualifier be ignored by the compiler but the compiler generally makes good decisions about inlining anyway. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234853.208448-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove rtw_zvmalloc preprocessor definitionPhillip Potter2021-08-191-1/+0
| | | | | | | | | Remove rtw_zvmalloc preprocessor definition from include/osdep_service.h as it now has no callers. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234853.208448-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: convert all rtw_zvmalloc calls to vzalloc callsPhillip Potter2021-08-199-13/+13
| | | | | | | | | | | | | | | | | | Convert all rtw_zvmalloc calls within the driver to use the existing kernel vzalloc function, which has the same semantics. Also rewrite the two places where it is mentioned in comments to say vzalloc, and remove the redundant cast to struct adapter * in ./os_dep/usb_intf.c as vzalloc returns void *. The reason for the conversion is that rtw_zvmalloc is just a preprocessor definition for _rtw_zvmalloc which itself is just an inline wrapper around vmalloc which then zeroes the memory out. As vzalloc does the same thing via usage of __GFP_ZERO, this code is redundant and can subsequently be removed. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234853.208448-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove function _rtw_vmallocPhillip Potter2021-08-192-9/+1
| | | | | | | | | | | | | | | | | Remove the function _rtw_vmalloc from os_dep/osdep_service.c, converting its only user (also in os_dep/osdep_service.c) to use plain vmalloc. This function is just an inline wrapper around vmalloc which returns a u8 pointer, which isn't needed. Also remove the declaration from include/osdep_service.h. It is considered generally bad practice to declare functions as inline in the majority of cases, as not only can this qualifier be ignored by the compiler but the compiler generally makes good decisions about inlining anyway. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234853.208448-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove rtw_vmalloc preprocessor definitionPhillip Potter2021-08-191-1/+0
| | | | | | | | | Remove rtw_vmalloc preprocessor definition from include/osdep_service.h as it now has no callers. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234853.208448-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: convert only rtw_vmalloc call to vmallocPhillip Potter2021-08-191-1/+1
| | | | | | | | | | | Convert the only call to rtw_vmalloc in os_dep/ioctl_linux.c to the kernel's existing vmalloc function, as rtw_malloc is just a preprocessor definition for _rtw_vmalloc. The _rtw_vmalloc function is defined inline and returns a u8, wrapping standard vmalloc. This behaviour is not necessary. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234853.208448-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove free_xmit_priv field from struct hal_opsPhillip Potter2021-08-191-1/+0
| | | | | | | | | Remove free_xmit_priv function pointer field from struct hal_ops definition in include/hal_intf.h, as it is now no longer used anywhere in the driver. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234253.208271-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove function rtw_hal_free_xmit_privPhillip Potter2021-08-193-9/+0
| | | | | | | | | | | | | Remove function rtw_hal_free_xmit_priv in hal/hal_intf.c and its declaration in include/hal_intf.h, as well as the single call line in core/rtw_xmit.c. This function now essentially checks a function pointer which will always be NULL (due to previous patches) and therefore will never be called. Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234253.208271-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove empty function rtl8188eu_free_xmit_privPhillip Potter2021-08-193-6/+0
| | | | | | | | | | | | Remove empty function rtl8188eu_free_xmit_priv from hal/rtl8188eu_xmit.c and its declaration from include/rtl8188e_xmit.h, as well as the one place where it is stored in the free_xmit_priv function pointer of the HalFunc struct inside padapter. This is safe, as the wrapper function checks for NULL before calling this function via the function pointer. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234253.208271-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove txrpt_ccx_sw_88e and txrpt_ccx_qtime_88e macrosPhillip Potter2021-08-191-4/+0
| | | | | | | | | | | | Remove txrpt_ccx_sw_88e and txrpt_ccx_qtime_88e macro definitions from include/rtl8188e_xmit.h, as these were only called from the now removed dump_txrpt_ccx_88e function, which was itself not called from anywhere anyway. Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234253.208271-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove unused function dump_txrpt_ccx_88ePhillip Potter2021-08-192-23/+0
| | | | | | | | | | | Remove unused function dump_txrpt_ccx_88e from hal/rtl8188e_xmit.c and remove its declaration in include/rtl8188e_xmit.h, as this function is not called from anywhere, and is thus dead code. Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234253.208271-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: remove _dbg_dump_tx_info functionPhillip Potter2021-08-193-35/+0
| | | | | | | | | | | | | Remove _dbg_dump_tx_info from hal/rtl8188e_xmit.c as it is just a dumping function that contains a lot of unclear DBG_88E calls, and has no other external effect, other than calling a function that ultimately determines whether or not to dump/trigger the DBG_88E calls. Also remove its declaration and single call site. Acked-by: Fabio M. De Francesco <fmdefrancesco@gmail.com> Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818234253.208271-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: Fix fall-through warnings for ClangGustavo A. R. Silva2021-08-192-0/+4
| | | | | | | | | | | | | | | | | | Fix the following fallthrough warnings: drivers/staging/r8188eu/core/rtw_mlme_ext.c:1498:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/staging/r8188eu/core/rtw_wlan_util.c:1113:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/staging/r8188eu/core/rtw_wlan_util.c:1147:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] drivers/staging/r8188eu/core/rtw_wlan_util.c:1405:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] This helps with the ongoing efforts to globally enable -Wimplicit-fallthrough for Clang. Link: https://github.com/KSPP/linux/issues/115 Reviewed-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20210818221418.GA311735@embeddedor Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: rename variable within rtl8188e_Add_RateATidPhillip Potter2021-08-181-3/+3
| | | | | | | | | Rename 'shortGIrate' within the rtl8188e_Add_RateATid function to 'short_gi_rate', to comply with kernel camel case style rules. Signed-off-by: Phillip Potter <phil@philpotter.co.uk> Link: https://lore.kernel.org/r/20210818180831.67581-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: ctrl vendor req index is not usedMartin Kaiser2021-08-181-23/+10
| | | | | | | | | | | | | | The index for r8188eu's vendor-specific control requests is not used. Remove the index parameter from usbctrl_vendorreq and pass index 0 to usb_control_msg. This patch is an adaptation of commit 3d0be94f62fd ("staging: rtl8188eu: ctrl vendor req index is not used") for the new r8188eu driver. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210818200041.10870-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: r8188eu: ctrl vendor req value is always 0x05Martin Kaiser2021-08-181-23/+10
| | | | | | | | | | | | | | The bRequest value for the vendor specific control requests sent by this driver is always 0x05. Replace the function parameter with the define from usb_ops.h. This patch is an adaptation of commit eeb4661560ff ("staging: rtl8188eu: ctrl vendor req value is always 0x05") for the new r8188eu driver. Acked-by: Phillip Potter <phil@philpotter.co.uk> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20210818200041.10870-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>