Commit graph

2079 commits

Author SHA1 Message Date
Martin Kaiser
b5929325f0 staging: r8188eu: Revert "staging: r8188eu: simplify rtw_get_ff_hwaddr"
This reverts commit fd48124e09 ("staging: r8188eu: simplify
rtw_get_ff_hwaddr").

The cleanup in this commit removes the qsel to addr mappings in
rtw_get_ff_hwaddr. The underlying assumption is that rtw_write_port
uses its addr parameter only for the high_queue check.

This is obviously incorrect as rtw_write_port calls
ffaddr2pipehdl(pdvobj, addr);
where addr is mapped to a usb bulk endpoint.

Unfortunately, testing did not show any problems. The Edimax V2 on which I
tested has two bulk out endpoints. I guess that with the incorrect patch,
addr could only be 0 (no high queue) or 6 (high queue), both of which were
mapped to the first bulk out endpoint. Data transfers did still work...

Fixes: fd48124e09 ("staging: r8188eu: simplify rtw_get_ff_hwaddr")
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230213195407.15085-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-16 13:55:03 +01:00
Martin Kaiser
c17ffe0084 staging: r8188eu: replace hand coded loop with list_for_each_entry
In function rtw_get_stainfo, we can use list_for_each_entry to iterate
over the list of stations and make the code a bit simpler.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230211170223.419205-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-16 13:54:41 +01:00
Martin Kaiser
da8b09464c staging: r8188eu: merge _rtw_enqueue_cmd into its caller
The _rtw_enqueue_cmd function is called only by rtw_enqueue_cmd.

When _rtw_enqueue_cmd is called, the caller has already checked that the
obj parameter is not NULL. _rtw_enqueue_cmd returns _SUCCESS in any case.

We can merge the two functions and simplify the error handling.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230211165045.414424-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-16 13:54:38 +01:00
Martin Kaiser
7652f95f52 staging: r8188eu: bagg_pkt parameter is not used
The bagg_pkt parameter in function update_txdesc is not used, it can be
removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230207192319.294203-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-08 13:30:00 +01:00
Martin Kaiser
fd48124e09 staging: r8188eu: simplify rtw_get_ff_hwaddr
On both occassions where rtw_get_ff_hwaddr is called, the result is used
as addr parameter for rtw_write_port. rtw_write_port only needs the info
if the high queue was used or not. Simplify rtw_get_ff_hwaddr accordingly
and remove the now unused queue defines.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230207192319.294203-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-08 13:30:00 +01:00
Martin Kaiser
2bc00bac61 staging: r8188eu: simplify xmit_buf flags
rtw_write_port stores a queue index in pxmitbuf->flags before submitting
an urb. The urb completion function reads the flags. All it needs is the
info if the high queue was used or not.

We can replace the flags with a boolean high_queue variable.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230207192319.294203-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-08 13:30:00 +01:00
Martin Kaiser
b5e9b07427 staging: r8188eu: xmit_buf's ff_hwaddr is not used
ff_hwaddr in struct xmit_buf is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230207192319.294203-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-08 13:30:00 +01:00
Martin Kaiser
b7c269aef0 staging: r8188eu: remove unused frametag defines
Remove some frametag defines which are not used in the r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230207192319.294203-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-08 13:30:00 +01:00
Martin Kaiser
f141c234cb staging: r8188eu: simplify rtw_alloc_xmitframe
Make the rtw_alloc_xmitframe function a bit simpler.

The container_of() call never returns NULL. The if (pxframe) check is
false only if pfree_xmit_queue is empty. Handle this special case
explicitly and save one level of indentation.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230207192319.294203-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-08 13:30:00 +01:00
Martin Kaiser
aec9b5bb8f staging: r8188eu: merge do_queue_select into its only caller
Merge do_queue_select into its only caller. It's only a simple assignment.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230207192319.294203-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-08 13:30:00 +01:00
Martin Kaiser
0fb449c574 staging: r8188eu: remove change_rfpwrstate
Remove the change_rfpwrstate component in struct pwrctrl_priv.

change_rfpwrstate is set to rf_off directly before each ips_enter call and
then checked in ips_enter. This makes no sense.

change_rfpwrstate might have been used to avoid conflicts between
suspend and resume operations. If a driver has to do this at all,
pwrpriv->ps_processing will do this job.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206210124.150142-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-07 08:41:18 +01:00
Martin Kaiser
75c68a49cb staging: r8188eu: make ips_leave static
The ips_leave function is used only in rtw_pwrctrl.c. We can make this
function static.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206210124.150142-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-07 08:41:18 +01:00
Martin Kaiser
815950ef52 staging: r8188eu: make ips_enter static
The ips_enter function is used only in rtw_pwrctrl.c. We can make this
function static.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206210124.150142-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-07 08:41:18 +01:00
Martin Kaiser
64e8bbbc08 staging: r8188eu: remove intf_stop pointer
Remove the intf_stop pointer that points to a media-specific stop
function. The r8188eu driver supports only usb.

For usb drivers, intf_stop points to usb_intf_stop, which is only
two lines long.  We can remove intf_stop and usb_intf_stop and call
the two cancel functions directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206201800.139195-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-07 08:41:03 +01:00
Martin Kaiser
da61c45f48 staging: r8188eu: handle rtl8188eu_inirp_init errors
The rtl8188eu_inirp_init returns 0 for success or a negative error code.
Handle this return value in the two places where rtl8188eu_inirp_init is
called.

Suggested-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206201800.139195-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-07 08:41:03 +01:00
Martin Kaiser
49c41602a3 staging: r8188eu: remove intf_start pointer
Remove the intf_start pointer that points to a media-specific start
function (pci, usb, sdio, ...). The r8188eu driver supports only usb.

We could call usb_intf_start directly instead of going through the
function pointer. usb_intf_start is just a call to rtl8188eu_inirp_init so
we can directly replace the intf_start pointer with rtl8188eu_inirp_init.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206201800.139195-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-07 08:41:03 +01:00
Martin Kaiser
a0b3a1c269 staging: r8188eu: use standard error codes in rtl8188eu_inirp_init
Replace the driver-specific _SUCCESS and _FAIL error codes in
rtl8188eu_inirp_init. Return 0 for success or a negative error
code as we do elsewhere in the kernel.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206201800.139195-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-07 08:41:03 +01:00
Martin Kaiser
972b28a485 staging: r8188eu: use standard error codes in rtw_read_port
Replace the driver-specific _SUCCESS and _FAIL error codes in
rtw_read_port. Return 0 for success or a negative error code as
we do elsewhere in the kernel.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206201800.139195-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-07 08:41:03 +01:00
Martin Kaiser
ca0e0d84ae staging: r8188eu: pass a struct recv_buf to rtw_read_port
The rtw_read_port function needs a struct recv_buf for preparing the usb
transfer.

Replace its u8 *rmem parameter with a struct recv_buf pointer to avoid
casts in the caller and in rtw_read_port.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230206201800.139195-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-07 08:41:03 +01:00
Michael Straube
3d281bdbff staging: r8188eu: correct error logic of _rtw_init_recv_priv()
Convert the function _rtw_init_recv_priv() away from returning _FAIL
and _SUCCESS, which uses inverted error logic. Return 0 for success
and negative values for failure instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230205080559.8319-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-06 10:48:01 +01:00
Michael Straube
7e00e0c42d staging: r8188eu: correct error logic of rtl8188eu_init_recv_priv()
Convert the function rtl8188eu_init_recv_priv() away from returning
_FAIL and _SUCCESS, which uses inverted error logic. Return 0 for
success and negative values for failure instead.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230205080559.8319-2-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-06 10:48:01 +01:00
Martin Kaiser
c6dd307144 staging: r8188eu: clean up NULL check for rcu pointer
Clean up the NULL check for padapter->pnetdev->rx_handler_data.

The current code calls rcu_dereference while it holds the rcu read lock
and checks the pointer after releasing the lock. An rcu pointer may only be
used between calls to rcu_read_lock and rcu_read_unlock.

Replace the check with rcu_access_pointer. My understanding is that this
function returns the value of the pointer and needs no locking. We can
then check the pointer but we must not dereference it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230131090057.241779-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-06 10:44:38 +01:00
Martin Kaiser
edb3e231e4 staging: r8188eu: replace switch-case with if
Replace a switch-case in rtw_write_port with an if statement and make the
code a bit shorter.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230130195303.138941-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-31 11:16:57 +01:00
Martin Kaiser
b6d2e4e0f3 staging: r8188eu: option in struct sta_xmit_priv is not used
The option component in struct sta_xmit_priv is not used, remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230130195303.138941-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-31 11:16:57 +01:00
Martin Kaiser
6a800cf386 staging: r8188eu: apsd is initialised but never used
apsd in struct sta_xmit_priv is initialised but not used. It can be
removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230130195303.138941-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-31 11:16:57 +01:00
Martin Kaiser
5a4d1fd158 staging: r8188eu: legacy_dz is initialised but never used
legacy_dz in struct sta_xmit_priv is initialised but not used. It can be
removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230130195303.138941-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-31 11:16:57 +01:00
Martin Kaiser
9cc5265ac8 staging: r8188eu: use kernel helper to iterate over a list
rtw_free_xmitframe_list iterates over the list of xmit_frames and frees
each entry. We can use list_for_each_entry_safe instead of coding this
manually. We need the _safe version as the current pxmitframe will be
removed from the list by rtw_free_xmitframe.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230130195303.138941-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-31 11:16:57 +01:00
Martin Kaiser
f5a8949570 staging: r8188eu: make sta_pending a list_head
We can now change sta_pending in struct tx_servq from __queue to
list_head. The driver defines __queue as list_head + spinlock, the
spinlock is not used for sta_pending.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230130195303.138941-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-31 11:16:56 +01:00
Martin Kaiser
5bdc94816b staging: r8188eu: change another function param from __queue to list_head
Modify the rtw_free_xmitframe_queue function to take a list_head pointer
instead of a __queue pointer.

This is an intermediate step towards changing struct tx_servq's
sta_pending from __queue to list_head.

Now that the function takes a list instead of a queue, we should also
rename it to rtw_free_xmitframe_list.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230130195303.138941-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-31 11:16:56 +01:00
Martin Kaiser
5ae3750cca staging: r8188eu: change function param from __queue to list_head
Modify the dequeue_xmitframes_to_sleeping_queue function to take a
list_head pointer instead of a __queue pointer.

This is an intermediate step towards changing struct tx_servq's
sta_pending from __queue to list_head.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230130195303.138941-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-31 11:16:56 +01:00
Martin Kaiser
9bd121f827 staging: r8188eu: rtw_free_xmitframe_queue needs no spinlock
There's no need for a spinlock in rtw_free_xmitframe_queue.

This function is called only from rtw_free_stainfo. rtw_free_stainfo holds
pxmitpriv->lock during all rtw_free_xmitframe_queue calls.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20230130195303.138941-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-31 11:16:56 +01:00
Martin Kaiser
88c1907365 staging: r8188eu: remove usb_ops_linux.h
There's only two defines left in usb_ops_linux.h. Move those defines to
usb_ops_linux.c, where they are used.

Remove the now empty file usb_ops_linux.h.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230124210108.62170-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:12:55 +01:00
Martin Kaiser
e39c36d0d0 staging: r8188eu: remove unused defines
Remove some unused defines from usb_ops_linux.h.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230124210108.62170-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:12:55 +01:00
Martin Kaiser
3dc04d5b53 staging: r8188eu: remove defines that strip regs parameter
usb_ops_linux.h has a number of defines that strip the regs parameter from
function that should be used as urb callbacks.

Remove the defines for functions that don't exist in the r8188eu driver.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230124210108.62170-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:12:55 +01:00
Martin Kaiser
cbfc31a71d staging: r8188eu: usb_read_port_complete needs no regs parameter
Remove the regs parameter from usb_read_port_complete, it is not used.

Without the regs parameter, there's no need for the define that makes
usb_read_port_complete usable as urb callback function.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230124210108.62170-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:12:55 +01:00
Martin Kaiser
cfe635af8a staging: r8188eu: merge rtw_free_hwxmits into its only caller
rtw_free_hwxmits is called only by _rtw_free_xmit_priv. We can merge the
two functions and make the code a bit shorter.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-24-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:37 +01:00
Martin Kaiser
b87a04c4a8 staging: r8188eu: apsd_setting is unused
apsd_setting in struct tx_servq is not used, it can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-23-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:37 +01:00
Martin Kaiser
b666a3ea67 staging: r8188eu: struct agg_pkt_info is unused
struct agg_pkt_info is not used in the r8188eu driver. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-22-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:37 +01:00
Martin Kaiser
a548cdc58b staging: r8188eu: remove rtw_xmitframe_enqueue
The rtw_xmitframe_enqueue function is only one line. We can remove it and
call rtw_xmit_classifier directly.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-21-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:37 +01:00
Martin Kaiser
9c07d8cc88 staging: r8188eu: fix rtw_xmitframe_enqueue error handling
In function rtw_xmitframe_enqueue, we can simply relay the error code from
rtw_xmit_classifier.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-20-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:37 +01:00
Martin Kaiser
e558c19278 staging: r8188eu: use lists for hwxmits
struct hw_xmit's sta_list points to one of vo, vi, be or bk_pending in
struct xmit_priv. All of these are defined as struct __queue, which is a
list plus a spinlock.

For these components, the spinlock is unused, we need only the list.

This patch converts sta_list and vo, vi, be and bk_pending to struct
list_head.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-19-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:37 +01:00
Martin Kaiser
45bbc110e9 staging: r8188eu: merge dequeue_one_xmitframe into its caller
dequeue_one_xmitframe is a small function that is called only from
rtw_dequeue_xframe. Merge the two functions.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-18-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:36 +01:00
Martin Kaiser
dfac03bde0 staging: r8188eu: use list_head for xmitframe list
The r8188eu driver defines a struct __queue that contains a list_head and
a spinlock.

struct tx_servq describes a station for which we have pending tx packets.
This struct contains a __queue for the pending packets (a __queue of
struct xmit_frame entries). In this particular case, the queue's spinlock
is not used, we need only the list_head.

rtw_dequeue_xframe uses a local variable for such an xmit_frame queue.
This patch replaces this variable with a list_head.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-17-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:36 +01:00
Martin Kaiser
ca21b2db68 staging: r8188eu: simplify dequeue_one_xmitframe
Simplify the dequeue_one_xmitframe function without changing its
behaviour. Drop the temporary variable xmitframe_plist.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-16-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:36 +01:00
Martin Kaiser
6500084a41 staging: r8188eu: decrement qcnt in rtw_dequeue_xframe
rtw_dequeue_xframe calls dequeue_one_xmitframe and passes a struct
tx_servq. The only use for this parameter is to decrement its qcnt if an
xmit_frame could be extracted.

It makes more sense to remove the struct tx_servq parameter from
dequeue_one_xmitframe and decrement qcnt in the calling function when
dequeue_one_xmitframe returns success, i.e. when an xmit_frame was
extracted.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-15-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:36 +01:00
Martin Kaiser
081c483510 staging: r8188eu: make rtw_chk_hi_queue_cmd a void function
Both callers of rtw_chk_hi_queue_cmd do not check the return value.
Convert rtw_chk_hi_queue_cmd to a void function.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-14-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:36 +01:00
Martin Kaiser
c00ed7dde8 staging: r8188eu: remove redundant parameter
The rtl8188eu_xmitframe_complete function takes two parameters: adapter
and xmit_priv. xmit_priv is part of struct adapter, this parameter can be
removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-13-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:36 +01:00
Martin Kaiser
8d97399beb staging: r8188eu: simplify dequeue_one_xmitframe
Revert the if condition and exit immediately if the list of xmitframes
is empty. Hopefully, this makes the code a little bit simpler.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:36 +01:00
Martin Kaiser
d5986148e8 staging: r8188eu: use list_empty
Use list_empty to check for an empty list instead of coding the check
manually.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:36 +01:00
Martin Kaiser
cbdd52099d staging: r8188eu: remove dead assignment
There's no point in moving xmitframe_plist to the next list element.
xmitframe_plist is not used any more after this assignment.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230123205342.229589-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-27 10:10:36 +01:00