2022-06-03 18:52:14

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH 0/3] staging: r8188eu: some minor cleanups

Some minor cleanups in several places: Remove some defines and a wrapper
function, fix a prototype.

Martin Kaiser (3):
staging: r8188eu: use ieee80211 defines for back action codes
staging: r8188eu: remove rtw_usleep_os
staging: r8188eu: fix the declaration of process_pwrbit_data

drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 +++---
drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +-
drivers/staging/r8188eu/core/rtw_recv.c | 3 +--
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 2 +-
drivers/staging/r8188eu/include/ieee80211.h | 7 -------
drivers/staging/r8188eu/include/osdep_service.h | 2 --
drivers/staging/r8188eu/os_dep/osdep_service.c | 8 --------
7 files changed, 6 insertions(+), 24 deletions(-)

--
2.30.2


2022-06-05 13:32:14

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH 3/3] staging: r8188eu: fix the declaration of process_pwrbit_data

Fix the declaration of process_pwrbit_data. Make the function static and
remove its prototype.

Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_recv.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index df518439aea2..fe3d597fea69 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -452,8 +452,7 @@ static int recv_decache(struct recv_frame *precv_frame, u8 bretry, struct stainf
return _SUCCESS;
}

-void process_pwrbit_data(struct adapter *padapter, struct recv_frame *precv_frame);
-void process_pwrbit_data(struct adapter *padapter, struct recv_frame *precv_frame)
+static void process_pwrbit_data(struct adapter *padapter, struct recv_frame *precv_frame)
{
unsigned char pwrbit;
u8 *ptr = precv_frame->rx_data;
--
2.30.2

2022-06-06 03:40:18

by Pavel Skripkin

[permalink] [raw]
Subject: Re: [PATCH 0/3] staging: r8188eu: some minor cleanups

Hi Martin,

On 6/2/22 22:48, Martin Kaiser wrote:
> Some minor cleanups in several places: Remove some defines and a wrapper
> function, fix a prototype.
>
> Martin Kaiser (3):
> staging: r8188eu: use ieee80211 defines for back action codes
> staging: r8188eu: remove rtw_usleep_os
> staging: r8188eu: fix the declaration of process_pwrbit_data
>
> drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 +++---
> drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +-
> drivers/staging/r8188eu/core/rtw_recv.c | 3 +--
> drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 2 +-
> drivers/staging/r8188eu/include/ieee80211.h | 7 -------
> drivers/staging/r8188eu/include/osdep_service.h | 2 --
> drivers/staging/r8188eu/os_dep/osdep_service.c | 8 --------
> 7 files changed, 6 insertions(+), 24 deletions(-)
>

Tested-by: Pavel Skripkin <[email protected]>



With regards,
Pavel Skripkin


Attachments:
OpenPGP_signature (855.00 B)
OpenPGP digital signature

2022-06-06 05:16:01

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH 1/3] staging: r8188eu: use ieee80211 defines for back action codes

Replace the driver-specific defines for back action codes with the defines
from ieee80211.h.

Signed-off-by: Martin Kaiser <[email protected]>
---
drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 +++---
drivers/staging/r8188eu/include/ieee80211.h | 7 -------
2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 1c1598c71b78..87bf37f33606 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -5606,7 +5606,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
if (initiator == 0) { /* recipient */
for (tid = 0; tid < MAXTID; tid++) {
if (psta->recvreorder_ctrl[tid].enable) {
- issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
+ issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
psta->recvreorder_ctrl[tid].enable = false;
psta->recvreorder_ctrl[tid].indicate_seq = 0xffff;
}
@@ -5614,7 +5614,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
} else if (initiator == 1) { /* originator */
for (tid = 0; tid < MAXTID; tid++) {
if (psta->htpriv.agg_enable_bitmap & BIT(tid)) {
- issue_action_BA(padapter, addr, RTW_WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
+ issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
psta->htpriv.agg_enable_bitmap &= ~BIT(tid);
psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);
}
@@ -7458,7 +7458,7 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf)

if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && (pmlmeinfo->HT_enable)) ||
((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) {
- issue_action_BA(padapter, pparm->addr, RTW_WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid);
+ issue_action_BA(padapter, pparm->addr, WLAN_ACTION_ADDBA_REQ, (u16)pparm->tid);
_set_timer(&psta->addba_retry_timer, ADDBA_TO);
} else {
psta->htpriv.candidate_tid_bitmap &= ~BIT(pparm->tid);
diff --git a/drivers/staging/r8188eu/include/ieee80211.h b/drivers/staging/r8188eu/include/ieee80211.h
index 15636a808f52..e7a4f8af497a 100644
--- a/drivers/staging/r8188eu/include/ieee80211.h
+++ b/drivers/staging/r8188eu/include/ieee80211.h
@@ -624,13 +624,6 @@ enum _PUBLIC_ACTION {
ACT_PUBLIC_MAX
};

-/* BACK action code */
-enum rtw_ieee80211_back_actioncode {
- RTW_WLAN_ACTION_ADDBA_REQ = 0,
- RTW_WLAN_ACTION_ADDBA_RESP = 1,
- RTW_WLAN_ACTION_DELBA = 2,
-};
-
#define OUI_MICROSOFT 0x0050f2 /* Microsoft (also used in Wi-Fi specs)
* 00:50:F2 */
#define WME_OUI_TYPE 2
--
2.30.2

2022-06-26 18:21:42

by Martin Kaiser

[permalink] [raw]
Subject: [PATCH v2] staging: r8188eu: remove rtw_usleep_os

Remove the rtw_usleep_os helper function. There are only two callers, both
of which call rtw_usleep_os(100). This is equivalent to msleep(1).

Signed-off-by: Martin Kaiser <[email protected]>
---
changes in v2:
- use msleep(1) instead of usleep_range

drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +-
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 2 +-
drivers/staging/r8188eu/include/osdep_service.h | 2 --
drivers/staging/r8188eu/os_dep/osdep_service.c | 8 --------
4 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
index 45e85b593665..cf9020a73933 100644
--- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
@@ -273,7 +273,7 @@ static s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
err = -1;
break;
}
- rtw_usleep_os(100);
+ msleep(1);
}

return err;
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
index 5549e7be334a..5b65313e0b9d 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
@@ -243,7 +243,7 @@ static int efuse_read_phymap_from_txpktbuf(
if (reg)
break;

- rtw_usleep_os(100);
+ msleep(1);
} while (time_before(jiffies, timeout));

/* data from EEPROM needs to be in LE */
diff --git a/drivers/staging/r8188eu/include/osdep_service.h b/drivers/staging/r8188eu/include/osdep_service.h
index 1d97d5be46d5..72990a1cdc66 100644
--- a/drivers/staging/r8188eu/include/osdep_service.h
+++ b/drivers/staging/r8188eu/include/osdep_service.h
@@ -76,8 +76,6 @@ void *rtw_malloc2d(int h, int w, int size);
spin_lock_init(&((q)->lock)); \
} while (0)

-void rtw_usleep_os(int us);
-
static inline unsigned char _cancel_timer_ex(struct timer_list *ptimer)
{
return del_timer_sync(ptimer);
diff --git a/drivers/staging/r8188eu/os_dep/osdep_service.c b/drivers/staging/r8188eu/os_dep/osdep_service.c
index 812acd59be79..3504a0a9ba87 100644
--- a/drivers/staging/r8188eu/os_dep/osdep_service.c
+++ b/drivers/staging/r8188eu/os_dep/osdep_service.c
@@ -42,14 +42,6 @@ Otherwise, there will be racing condition.
Caller must check if the list is empty before calling rtw_list_delete
*/

-void rtw_usleep_os(int us)
-{
- if (1 < (us / 1000))
- msleep(1);
- else
- msleep((us / 1000) + 1);
-}
-
static const struct device_type wlan_type = {
.name = "wlan",
};
--
2.30.2

2022-06-26 20:53:49

by Philipp Hortmann

[permalink] [raw]
Subject: Re: [PATCH v2] staging: r8188eu: remove rtw_usleep_os

On 6/26/22 20:06, Martin Kaiser wrote:
> Remove the rtw_usleep_os helper function. There are only two callers, both
> of which call rtw_usleep_os(100). This is equivalent to msleep(1).
>
> Signed-off-by: Martin Kaiser <[email protected]>
> ---
> changes in v2:
> - use msleep(1) instead of usleep_range
>
> drivers/staging/r8188eu/core/rtw_pwrctrl.c | 2 +-
> drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 2 +-
> drivers/staging/r8188eu/include/osdep_service.h | 2 --
> drivers/staging/r8188eu/os_dep/osdep_service.c | 8 --------
> 4 files changed, 2 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
> index 45e85b593665..cf9020a73933 100644
> --- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
> +++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
> @@ -273,7 +273,7 @@ static s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
> err = -1;
> break;
> }
> - rtw_usleep_os(100);
> + msleep(1);
> }
>
> return err;
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> index 5549e7be334a..5b65313e0b9d 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> @@ -243,7 +243,7 @@ static int efuse_read_phymap_from_txpktbuf(
> if (reg)
> break;
>
> - rtw_usleep_os(100);
> + msleep(1);
> } while (time_before(jiffies, timeout));
>
> /* data from EEPROM needs to be in LE */
> diff --git a/drivers/staging/r8188eu/include/osdep_service.h b/drivers/staging/r8188eu/include/osdep_service.h
> index 1d97d5be46d5..72990a1cdc66 100644
> --- a/drivers/staging/r8188eu/include/osdep_service.h
> +++ b/drivers/staging/r8188eu/include/osdep_service.h
> @@ -76,8 +76,6 @@ void *rtw_malloc2d(int h, int w, int size);
> spin_lock_init(&((q)->lock)); \
> } while (0)
>
> -void rtw_usleep_os(int us);
> -
> static inline unsigned char _cancel_timer_ex(struct timer_list *ptimer)
> {
> return del_timer_sync(ptimer);
> diff --git a/drivers/staging/r8188eu/os_dep/osdep_service.c b/drivers/staging/r8188eu/os_dep/osdep_service.c
> index 812acd59be79..3504a0a9ba87 100644
> --- a/drivers/staging/r8188eu/os_dep/osdep_service.c
> +++ b/drivers/staging/r8188eu/os_dep/osdep_service.c
> @@ -42,14 +42,6 @@ Otherwise, there will be racing condition.
> Caller must check if the list is empty before calling rtw_list_delete
> */
>
> -void rtw_usleep_os(int us)
> -{
> - if (1 < (us / 1000))
> - msleep(1);
> - else
> - msleep((us / 1000) + 1);
> -}
> -
> static const struct device_type wlan_type = {
> .name = "wlan",
> };

Tested-by: Philipp Hortmann <[email protected]> # Edimax N150