Commit Graph

1154296 Commits

Author SHA1 Message Date
Martin Kaiser
99438dab15 staging: r8188eu: remove struct io_priv
struct io_priv has only one member (and a pointer to the enclosing struct
adapter). We can remove struct io_priv and move its member directly into
struct adapter.

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/20230111195640.306748-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:37:26 +01:00
Martin Kaiser
664f99fd54 staging: r8188eu: remove NULL check for usb_kill_urb
usb_kill_urb handles a NULL parameter. There's no need for NULL checks
before we call usb_kill_urb.

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/20230111100201.251905-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:36:17 +01:00
Martin Kaiser
f4f52873a1 staging: r8188eu: always process urb status
Remove the if clause in usb_write_port_complete and process the urb
status regardless of bSurpriseRemoved, bDriverStopped and
bWritePortCancel.

The only possible results of urb status processing are updates to
bSurpriseRemoved and bDriverStopped. All of the three status variable are
set to true only if the whole USB processing has to be stopped (when the
driver is unloaded or when the system goes to sleep).

It's no problem if one of the "stop everything" variables is already set
and the urb status processing sets another one.

This patch removes the last goto in usb_write_port_complete. It's also
part of the ongoing effort to limit the use of the "stop everything"
variables.

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/20230110205626.183516-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:36:14 +01:00
Martin Kaiser
8db002ed48 staging: r8188eu: remove unused function parameter
The regs parameter of the usb_write_port_complete function is not used. We
can remove it.

We can also remove the macro to hide the regs parameter when
usb_write_port_complete is used as callback function for an urb transfer.

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/20230110205626.183516-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:36:14 +01:00
Martin Kaiser
7b42205e9d staging: r8188eu: reformat usb_write_port_complete
This trivial patch reformats the usb_write_port_complete function.
Hopefully, this makes the code a bit easier to read.

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/20230110205626.183516-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:36:14 +01:00
Martin Kaiser
47bdd807ae staging: r8188eu: refactor status handling in usb_write_port_complete
Refactor the satus handling in usb_write_port_complete. Make it clearer
what happens for each status and avoid all the goto statements.

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/20230110205626.183516-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:36:14 +01:00
Martin Kaiser
001c773caf staging: r8188eu: xmit_priv's vcs_setting is not used
vcs_setting in struct xmit_priv is not used any more. We can remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-13-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:25 +01:00
Martin Kaiser
eb67bf2651 staging: r8188eu: xmit_priv's vcs is not used
The vcs component in struct xmit_priv is set but not used. We can remove
vcs and the rtw_update_protection function, whose only job is to set vcs.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:25 +01:00
Martin Kaiser
393669c761 staging: r8188eu: xmit_priv's vcs_type is not used
The vcs_type component of struct xmit_priv is not used. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:25 +01:00
Martin Kaiser
851ae3c208 staging: r8188eu: remove unused QSLT defines
Remove unused defines for Queue Select Value in TxDesc.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:25 +01:00
Martin Kaiser
fe86c3a10c staging: r8188eu: txirp_cnt is write-only
txirp_cnt in struct xmit_priv is initialised but never read. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:25 +01:00
Martin Kaiser
069e3f9441 staging: r8188eu: remove unused hal_xmit_handler define
hal_xmit_handler is not used by the r8188eu driver. Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:25 +01:00
Martin Kaiser
f2355ab565 staging: r8188eu: dir_dev is unused
dir_dev in struct adapter is not used by the r8188eu driver. It can be
removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:24 +01:00
Martin Kaiser
1511463d33 staging: r8188eu: replace switch with if
The switch statement in usb_write_port_complete has only one single case.
Replace it with an if statement.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:24 +01:00
Martin Kaiser
e7b970cc37 staging: r8188eu: voq_cnt is write-only
voq_cnt in struct xmit_priv is initialised, incremented and decremented
but never read. Remove voq_cnt and resulting dead code.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:24 +01:00
Martin Kaiser
763f3eff5e staging: r8188eu: viq_cnt is write-only
viq_cnt in struct xmit_priv is initialised, incremented and decremented
but never read. Remove viq_cnt and resulting dead code.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:24 +01:00
Martin Kaiser
b79601a0aa staging: r8188eu: bkq_cnt is write-only
bkq_cnt in struct xmit_priv is initialised, incremented and decremented
but never read. Remove bkq_cnt and resulting dead code.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:24 +01:00
Martin Kaiser
2b9c7fbc1c staging: r8188eu: beq_cnt is write-only
beq_cnt in struct xmit_priv is initialised, incremented and decremented
but never read. Remove beq_cnt and resulting dead code.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Pavel Skripkin <paskripkin@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20230109212852.75612-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:24 +01:00
Michael Straube
1d0d77f4ec staging: r8188eu: convert rtw_writeN() to common error logic
Convert the function rtw_writeN() away from returning _FAIL or
_SUCCESS which uses inverted error logic. Use the common error logic
instead. Return 0 for success and negative values for failure.

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/20230108123804.3754-1-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:35:22 +01:00
Martin Kaiser
5877852e9f staging: r8188eu: rtw_init_hwxmits is not needed
The _rtw_init_xmit_priv function calls rtw_alloc_hwxmits to allocate
memory for pxmitpriv->hwxmits (this is an array of struct hw_xmit). This
allocation uses kzalloc, the allocated memory is initialised with 0.

After the allocation, _rtw_init_xmit_priv calls rtw_init_hwxmits to set an
element of each hw_xmit to 0. This is not necessary, we can remove the
rtw_init_hwxmits call and the now unused function rtw_init_hwxmits.

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/20221230180646.91008-20-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:23 +01:00
Martin Kaiser
1b757dfdab staging: r8188eu: phwxmit parameter is unused
Remove the unused function parameter phwxmit from function
dequeue_one_xmitframe.

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/20221230180646.91008-19-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:23 +01:00
Martin Kaiser
51cbbb0efe staging: r8188eu: remove unnecessary rtw_free_xmitframe call
There's no need to call rtw_free_xmitframe before we dequeue the first
frame. pxmitframe is always NULL at this point, rtw_free_xmitframe will do
nothing in this case.

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/20221230180646.91008-18-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:23 +01:00
Martin Kaiser
26cf6c2c22 staging: r8188eu: tx_retevt semaphore is not used
Remove tx_retevt from struct xmit_priv. This semaphore is initialised but
not used.

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/20221230180646.91008-17-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:23 +01:00
Martin Kaiser
38a9b8372e staging: r8188eu: terminate_xmitthread_sema is not used
Remove terminate_xmitthread_sema from struct xmit_priv. This semaphore is
initialised but not used.

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/20221230180646.91008-16-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
fcef1518e6 staging: r8188eu: bm_pending is not used
The bm_pending queue in struct xmit_priv is initialised but 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/20221230180646.91008-15-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
61d6aec28c staging: r8188eu: remove unused dma_transfer_addr
The dma_transfer_addr component in struct xmit_buf is initialised but 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/20221230180646.91008-14-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
3de5122ccf staging: r8188eu: remove unused bpending array
The bpending array in struct xmit_buf is unused. Remove it.

(struct xmit_buf is not part of the interface between the kernel driver and
the device's firmware. It's safe to remove components from this struct.)

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/20221230180646.91008-13-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
3d1edfe65d staging: r8188eu: clean up qos_option setting
The qos_option variable in function rtw_make_wlanhdr should be a boolean
as it's set to true or false. We can directly set it to
pqospriv->qos_option instead of using a default value and if statements.

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/20221230180646.91008-12-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
a6b25e291f staging: r8188eu: simplify rtw_make_wlanhdr's error handling
Simplify the error handling in rtw_make_wlanhdr. Exit immediately instead
of jumping to the end of the function. We don't have to do any clean-up.

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/20221230180646.91008-11-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
e263d79eb1 staging: r8188eu: simplify frame type check
Reorder the code in rtw_make_wlanhdr to make the function simpler.
There's a large if statement to check that we process only data frames.
Revert the condition and exit for non-data frames.

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/20221230180646.91008-10-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
6dd8420d4b staging: r8188eu: remove duplicate psta check
We do not need the psta check in the while loop of rtw_xmitframe_coalesce.
psta is already checked near the start of the function and is not modified
afterwards.

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/20221230180646.91008-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
a8dce6b4ad staging: r8188eu: remove rtl8188eu_init_xmit_priv
rtl8188eu_init_xmit_priv's only jobs is to initialise the xmit tasklet.

Remove rtl8188eu_init_xmit_priv and initialise the xmit tasklet in
_rtw_init_xmit_priv. Yet again, this makes the code a tiny bit smaller.

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/20221230180646.91008-8-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
9431a9370f staging: r8188eu: simplify rtl8188eu_xmit_tasklet
Simplify the rtl8188eu_xmit_tasklet function. Remove an unnecessary
temporary variable and reformat the code.

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/20221230180646.91008-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
4126f99b9e staging: r8188eu: remove unused parameter
All callers of rtl8188eu_xmitframe_complete set the pxmitbuf parameter to
NULL, in which case rtl8188eu_xmitframe_complete allocates another
xmit_buf internally.

Remove the pxmitbuf parameter and resulting dead code.

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/20221230180646.91008-6-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:22 +01:00
Martin Kaiser
c22afb2e5d staging: r8188eu: return immediately if we're not meant to encrypt
In function xmitframe_swencrypt, we can return immediately if our packet
needs no encryption. This is simpler than wrapping all the code into a
large if statement.

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/20221230180646.91008-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:21 +01:00
Martin Kaiser
00df407396 staging: r8188eu: cmd_seq is write-only
The cmd_seq component of struct cmd_priv is set and incremented but never
read. 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/20221230180646.91008-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:21 +01:00
Martin Kaiser
55074f02b4 staging: r8188eu: remove some unused CAM defines
Remove some CAM-related 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/20221230180646.91008-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:21 +01:00
Martin Kaiser
75f697b361 staging: r8188eu: make xmitframe_swencrypt a void function
xmitframe_swencrypt always returns _SUCCESS and the caller does not check
the return value. We can remove the return value and make
xmitframe_swencrypt 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/20221230180646.91008-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:21 +01:00
Martin Kaiser
6803d6cdf2 staging: r8188eu: remove intermediate token variable
Remove the token variable in on_action_public and use frame_body[2] as
function parameter. This saves another few lines of code.

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/20221230175326.90617-5-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:11 +01:00
Martin Kaiser
0a663eafa1 staging: r8188eu: remove intermediate pframe pointer
The pframe pointer in on_action_public is used only in the definition of
frame_body, which points to the payload of an incoming action frame.

We can use mgmt to locate the action payload and remove the pframe
pointer.

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/20221230175326.90617-4-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:11 +01:00
Martin Kaiser
0c9adc24ea staging: r8188eu: merge on_action_public_default into its only caller
Merge on_action_public_default into on_action_public, which is the only
caller. Yet again, this makes the code a tiny bit smaller.

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/20221230175326.90617-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:11 +01:00
Martin Kaiser
51413ad540 staging: r8188eu: merge on_action_public_vendor into its caller
Apart from declaring variables, on_action_public_vendor is only an if
statement. Merge this function into its only caller. This makes the code a
tiny bit smaller.

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/20221230175326.90617-2-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:11 +01:00
Xu Panda
78dde77b22 staging: r8188eu: use strscpy() to instead of strncpy()
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL-terminated strings.

Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
Signed-off-by: Yang Yang <yang.yang29@zte.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/r/202212261905476729002@zte.com.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:08 +01:00
Kang Minchul
799468fb50 staging: r8188eu: Prefer kcalloc over kzalloc
Fixed following checkpatch.pl warning:
 * WARNING: Prefer kcalloc over kzalloc with multiply

Instead of specifying (number of bytes) * (size) as arugment
in kzalloc, prefer kcalloc.

Signed-off-by: Kang Minchul <tegongkang@gmail.com>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Reviewed-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20221216223942.334221-1-tegongkang@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:31:05 +01:00
Philipp Hortmann
1cd8fbfafd staging: rtl8192e: Rename EEPROMTxPower.., AutoloadF.. and SilentReset..
Rename variable SilentResetRxSlotIndex to silent_reset_rx_slot_index,
IC_Cut to ic_cut and Rf_Mode to rf_mode to avoid CamelCase which is not
accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/60c1fb2861143c8736f061cf85e737b78c210a09.1673812850.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:29:04 +01:00
Philipp Hortmann
69c382a5e0 staging: rtl8192e: Rename EEPROMTxPower.., AutoloadF.. and SilentReset..
Rename variable EEPROMTxPowerLevelCCK to eeprom_tx_pwr_level_cck,
AutoloadFailFlag to autoload_fail_flag and SilentResetRxStuckEvent to
silent_reset_rx_stuck_event to avoid CamelCase which is not accepted by
checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/328bdd5fd16ba000d2083473e16e89ce2e2521ee.1673812850.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:29:04 +01:00
Philipp Hortmann
0f9d51975f staging: rtl8192e: Rename EEPROMTherma.., EEPROMAntPw.. and EEPROMTxPow..
Rename variable EEPROMThermalMeter to eeprom_thermal_meter,
EEPROMAntPwDiff to eeprom_ant_pwr_diff and EEPROMTxPowerLevelOFDM24G to
eeprom_tx_pwr_level_ofdm24g to avoid CamelCase which is not accepted by
checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/f708533cc24af1e08f34b681b9e8e8c01dc7b8f5.1673812850.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:29:04 +01:00
Philipp Hortmann
ca17bcc740 staging: rtl8192e: Rename CrystalCap, EEPROMLegacyHTT.. and EEPROMCrys..
Rename variable CrystalCap to crystal_cap, EEPROMLegacyHTTxPowerDiff to
eeprom_legacy_ht_tx_pwr_diff and EEPROMCrystalCap to eeprom_crystal_cap
to avoid CamelCase which is not accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/16337153218e9d1e25f90ca17774d1246086f1a7.1673812849.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:29:04 +01:00
Philipp Hortmann
cc7c9cb659 staging: rtl8192e: Rename SetBWModeIn.., SwChnlInPro.. and ThermalMet..
Rename variable SetBWModeInProgress to set_bw_mode_in_progress,
SwChnlInProgress to sw_chnl_in_progress and ThermalMeter to thermal_meter
to avoid CamelCase which is not accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/fc8bffbef60dba7aeb3bdfeab031c4e02e551c82.1673812849.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:29:03 +01:00
Philipp Hortmann
18651492d5 staging: rtl8192e: Rename bResetInPro.., framesyncMo.. and nCur40MhzPri..
Rename variable bResetInProgress to reset_in_progress, framesyncMonitor to
frame_sync_monitor and nCur40MhzPrimeSC to n_cur_40mhz_prime_sc to avoid
CamelCase which is not accepted by checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/dc9a6353e2342f524d8cbf0de6a6340990dc913b.1673812849.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-17 19:29:03 +01:00