All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] staging: r8188eu: remove hal sreset
@ 2021-12-12 18:58 Martin Kaiser
  2021-12-12 18:58 ` [PATCH 1/3] staging: r8188eu: move xmit status check from hal to rtw_cmd Martin Kaiser
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Martin Kaiser @ 2021-12-12 18:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

This patch set moves two simple functions out of the hal layer into
the place where they are used. Since we support only a single chipset
in this driver, there's no need to go through the hal layer for such
simple functions.

Martin Kaiser (3):
  staging: r8188eu: move xmit status check from hal to rtw_cmd
  staging: r8188eu: move linked status check from hal to rtw_mlme_ext
  staging: r8188eu: clean up rtl8188e_sreset_linked_status_check

 drivers/staging/r8188eu/Makefile              |  1 -
 drivers/staging/r8188eu/core/rtw_cmd.c        | 13 ++++++-
 drivers/staging/r8188eu/core/rtw_mlme_ext.c   | 18 ++++++++-
 drivers/staging/r8188eu/hal/rtl8188e_sreset.c | 37 -------------------
 .../staging/r8188eu/include/rtl8188e_hal.h    |  1 -
 .../staging/r8188eu/include/rtl8188e_sreset.h | 13 -------
 6 files changed, 29 insertions(+), 54 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/hal/rtl8188e_sreset.c
 delete mode 100644 drivers/staging/r8188eu/include/rtl8188e_sreset.h

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] staging: r8188eu: move xmit status check from hal to rtw_cmd
  2021-12-12 18:58 [PATCH 0/3] staging: r8188eu: remove hal sreset Martin Kaiser
@ 2021-12-12 18:58 ` Martin Kaiser
  2021-12-12 18:58 ` [PATCH 2/3] staging: r8188eu: move linked status check from hal to rtw_mlme_ext Martin Kaiser
  2021-12-12 18:58 ` [PATCH 3/3] staging: r8188eu: clean up rtl8188e_sreset_linked_status_check Martin Kaiser
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Kaiser @ 2021-12-12 18:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Move rtl8188e_sreset_xmit_status_check from the hal layer into
rtw_cmd.c.

As this driver supports only the 8188 chipset, there's no need
to go through the hal layer for simple operations that have only
one caller.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/core/rtw_cmd.c            | 12 ++++++++++++
 drivers/staging/r8188eu/hal/rtl8188e_sreset.c     | 12 ------------
 drivers/staging/r8188eu/include/rtl8188e_sreset.h |  1 -
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index ace3a6342e01..283ae08ae4cb 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -950,6 +950,18 @@ static void traffic_status_watchdog(struct adapter *padapter)
 	pmlmepriv->LinkDetectInfo.bHigherBusyTxTraffic = bHigherBusyTxTraffic;
 }
 
+static void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
+{
+	u32 txdma_status;
+
+	txdma_status = rtw_read32(padapter, REG_TXDMA_STATUS);
+	if (txdma_status != 0x00) {
+		DBG_88E("%s REG_TXDMA_STATUS:0x%08x\n", __func__, txdma_status);
+		rtw_write32(padapter, REG_TXDMA_STATUS, txdma_status);
+	}
+	/* total xmit irp = 4 */
+}
+
 static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf)
 {
 	struct mlme_priv *pmlmepriv;
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_sreset.c b/drivers/staging/r8188eu/hal/rtl8188e_sreset.c
index 7b3ac6e306ce..7fec776a8e87 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_sreset.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_sreset.c
@@ -6,18 +6,6 @@
 #include "../include/rtl8188e_sreset.h"
 #include "../include/rtl8188e_hal.h"
 
-void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
-{
-	u32 txdma_status;
-
-	txdma_status = rtw_read32(padapter, REG_TXDMA_STATUS);
-	if (txdma_status != 0x00) {
-		DBG_88E("%s REG_TXDMA_STATUS:0x%08x\n", __func__, txdma_status);
-		rtw_write32(padapter, REG_TXDMA_STATUS, txdma_status);
-	}
-	/* total xmit irp = 4 */
-}
-
 void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
 {
 	u32 rx_dma_status = 0;
diff --git a/drivers/staging/r8188eu/include/rtl8188e_sreset.h b/drivers/staging/r8188eu/include/rtl8188e_sreset.h
index bb8b0048fbf9..4e96a5a6e075 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_sreset.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_sreset.h
@@ -7,7 +7,6 @@
 #include "osdep_service.h"
 #include "drv_types.h"
 
-void rtl8188e_sreset_xmit_status_check(struct adapter *padapter);
 void rtl8188e_sreset_linked_status_check(struct adapter *padapter);
 
 #endif
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] staging: r8188eu: move linked status check from hal to rtw_mlme_ext
  2021-12-12 18:58 [PATCH 0/3] staging: r8188eu: remove hal sreset Martin Kaiser
  2021-12-12 18:58 ` [PATCH 1/3] staging: r8188eu: move xmit status check from hal to rtw_cmd Martin Kaiser
@ 2021-12-12 18:58 ` Martin Kaiser
  2021-12-12 18:58 ` [PATCH 3/3] staging: r8188eu: clean up rtl8188e_sreset_linked_status_check Martin Kaiser
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Kaiser @ 2021-12-12 18:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Move rtl8188e_sreset_linked_status_check from the hal layer into
rtw_mlme_ext.c.

Like the xmit status check, this is a simple function that's only
called from one place.

With this function gone, hal/rtl8188e_sreset.c and
include/rtl8188e_sreset.h are now empty and can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/Makefile              |  1 -
 drivers/staging/r8188eu/core/rtw_cmd.c        |  1 -
 drivers/staging/r8188eu/core/rtw_mlme_ext.c   | 19 +++++++++++++-
 drivers/staging/r8188eu/hal/rtl8188e_sreset.c | 25 -------------------
 .../staging/r8188eu/include/rtl8188e_hal.h    |  1 -
 .../staging/r8188eu/include/rtl8188e_sreset.h | 12 ---------
 6 files changed, 18 insertions(+), 41 deletions(-)
 delete mode 100644 drivers/staging/r8188eu/hal/rtl8188e_sreset.c
 delete mode 100644 drivers/staging/r8188eu/include/rtl8188e_sreset.h

diff --git a/drivers/staging/r8188eu/Makefile b/drivers/staging/r8188eu/Makefile
index 62933b0f29b5..580b9308d566 100644
--- a/drivers/staging/r8188eu/Makefile
+++ b/drivers/staging/r8188eu/Makefile
@@ -21,7 +21,6 @@ r8188eu-y = \
 		hal/rtl8188e_phycfg.o \
 		hal/rtl8188e_rf6052.o \
 		hal/rtl8188e_rxdesc.o \
-		hal/rtl8188e_sreset.o \
 		hal/rtl8188e_xmit.o \
 		hal/rtl8188eu_led.o \
 		hal/rtl8188eu_recv.o \
diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c
index 283ae08ae4cb..6d503eb7ff26 100644
--- a/drivers/staging/r8188eu/core/rtw_cmd.c
+++ b/drivers/staging/r8188eu/core/rtw_cmd.c
@@ -10,7 +10,6 @@
 #include "../include/rtw_br_ext.h"
 #include "../include/rtw_mlme_ext.h"
 #include "../include/rtl8188e_dm.h"
-#include "../include/rtl8188e_sreset.h"
 
 /*
 Caller and the rtw_cmd_thread can protect cmd_q by spin_lock.
diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 4b6d33249d95..15a443b9bc6d 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -10,7 +10,6 @@
 #include "../include/wlan_bssdef.h"
 #include "../include/mlme_osdep.h"
 #include "../include/recv_osdep.h"
-#include "../include/rtl8188e_sreset.h"
 #include "../include/rtl8188e_xmit.h"
 #include "../include/rtl8188e_dm.h"
 
@@ -7160,6 +7159,24 @@ static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
 	return ret;
 }
 
+static void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
+{
+	u32 rx_dma_status = 0;
+	u8 fw_status = 0;
+	rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
+	if (rx_dma_status != 0x00) {
+		DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
+		rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status);
+	}
+	fw_status = rtw_read8(padapter, REG_FMETHR);
+	if (fw_status != 0x00) {
+		if (fw_status == 1)
+			DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
+		else if (fw_status == 2)
+			DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
+	}
+}
+
 void linked_status_chk(struct adapter *padapter)
 {
 	u32	i;
diff --git a/drivers/staging/r8188eu/hal/rtl8188e_sreset.c b/drivers/staging/r8188eu/hal/rtl8188e_sreset.c
deleted file mode 100644
index 7fec776a8e87..000000000000
--- a/drivers/staging/r8188eu/hal/rtl8188e_sreset.c
+++ /dev/null
@@ -1,25 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/* Copyright(c) 2007 - 2011 Realtek Corporation. */
-
-#define _RTL8188E_SRESET_C_
-
-#include "../include/rtl8188e_sreset.h"
-#include "../include/rtl8188e_hal.h"
-
-void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
-{
-	u32 rx_dma_status = 0;
-	u8 fw_status = 0;
-	rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
-	if (rx_dma_status != 0x00) {
-		DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
-		rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status);
-	}
-	fw_status = rtw_read8(padapter, REG_FMETHR);
-	if (fw_status != 0x00) {
-		if (fw_status == 1)
-			DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
-		else if (fw_status == 2)
-			DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
-	}
-}
diff --git a/drivers/staging/r8188eu/include/rtl8188e_hal.h b/drivers/staging/r8188eu/include/rtl8188e_hal.h
index f8ac4920f049..9bfa255f1679 100644
--- a/drivers/staging/r8188eu/include/rtl8188e_hal.h
+++ b/drivers/staging/r8188eu/include/rtl8188e_hal.h
@@ -13,7 +13,6 @@
 #include "rtl8188e_recv.h"
 #include "rtl8188e_xmit.h"
 #include "rtl8188e_cmd.h"
-#include "rtl8188e_sreset.h"
 #include "rtw_efuse.h"
 #include "odm_precomp.h"
 #include "odm.h"
diff --git a/drivers/staging/r8188eu/include/rtl8188e_sreset.h b/drivers/staging/r8188eu/include/rtl8188e_sreset.h
deleted file mode 100644
index 4e96a5a6e075..000000000000
--- a/drivers/staging/r8188eu/include/rtl8188e_sreset.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
-/* Copyright(c) 2007 - 2011 Realtek Corporation. */
-
-#ifndef _RTL8188E_SRESET_H_
-#define _RTL8188E_SRESET_H_
-
-#include "osdep_service.h"
-#include "drv_types.h"
-
-void rtl8188e_sreset_linked_status_check(struct adapter *padapter);
-
-#endif
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] staging: r8188eu: clean up rtl8188e_sreset_linked_status_check
  2021-12-12 18:58 [PATCH 0/3] staging: r8188eu: remove hal sreset Martin Kaiser
  2021-12-12 18:58 ` [PATCH 1/3] staging: r8188eu: move xmit status check from hal to rtw_cmd Martin Kaiser
  2021-12-12 18:58 ` [PATCH 2/3] staging: r8188eu: move linked status check from hal to rtw_mlme_ext Martin Kaiser
@ 2021-12-12 18:58 ` Martin Kaiser
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Kaiser @ 2021-12-12 18:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Clean up the rtl8188e_sreset_linked_status_check, which has just
been moved to rtw_mlme_ext.

Don't initialise variables to 0 if the first access sets a new value.

Check the value of fw_status only once.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/core/rtw_mlme_ext.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 15a443b9bc6d..8e04238fb5fc 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -7161,20 +7161,19 @@ static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
 
 static void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
 {
-	u32 rx_dma_status = 0;
-	u8 fw_status = 0;
-	rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
+	u32 rx_dma_status =  rtw_read32(padapter, REG_RXDMA_STATUS);
+	u8 fw_status;
+
 	if (rx_dma_status != 0x00) {
 		DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
 		rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status);
 	}
+
 	fw_status = rtw_read8(padapter, REG_FMETHR);
-	if (fw_status != 0x00) {
-		if (fw_status == 1)
-			DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
-		else if (fw_status == 2)
-			DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
-	}
+	if (fw_status == 1)
+		DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
+	else if (fw_status == 2)
+		DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
 }
 
 void linked_status_chk(struct adapter *padapter)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-12 18:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-12 18:58 [PATCH 0/3] staging: r8188eu: remove hal sreset Martin Kaiser
2021-12-12 18:58 ` [PATCH 1/3] staging: r8188eu: move xmit status check from hal to rtw_cmd Martin Kaiser
2021-12-12 18:58 ` [PATCH 2/3] staging: r8188eu: move linked status check from hal to rtw_mlme_ext Martin Kaiser
2021-12-12 18:58 ` [PATCH 3/3] staging: r8188eu: clean up rtl8188e_sreset_linked_status_check Martin Kaiser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.