Skip to contentSkip to conversation

staging: rtl8192e: Remove unused code for hardware rtl8192se

PATCH New Philipp Hortmann 1 participant 5 messages Apr 7, 2023 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: rtl8192e: Remove unused code for hardware rtl8192se

Remove unused macro IS_HARDWARE_TYPE_8192SE and unused function _rtl92e_dm_init_wa_broadcom_iot. Remove a double check for hardware rtl8192se. Remove unused variable.

Tested with rtl8192e
Transferred this patch over wlan connection of rtl8192e
---
v1->v2: Removed patch "staging: rtl8192e: Remove unused local
variable irq_line" as it is unclear if the pci_read is needed for a hidden feature.
Checked in patch "staging: rtl8192e: Remove one of two checks for hardware RTL8192SE" that the pci_read does not follow a pci_write
No changes to other patches.

Philipp Hortmann (4):
staging: rtl8192e: Remove macro IS_HARDWARE_TYPE_8192SE
staging: rtl8192e: Remove unused function

    _rtl92e_dm_init_wa_broadcom_iot

staging: rtl8192e: Remove one of two checks for hardware RTL8192SE
staging: rtl8192e: Remove unused variable RF_Type

 drivers/staging/rtl8192e/rtl8192e/rtl_core.c |  6 ------
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h |  3 ---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c   | 18 +-----------------
 drivers/staging/rtl8192e/rtl819x_HT.h        |  3 ---
 drivers/staging/rtl8192e/rtllib.h            |  1 -
 5 files changed, 1 insertion(+), 30 deletions(-)
Signature · 1 line
2.40.0
#1 lore raw

PATCH v2 1/4 staging: rtl8192e: Remove macro IS_HARDWARE_TYPE_8192SE

Remove unused macro IS_HARDWARE_TYPE_8192SE as it is used only in code areas that are not executed when 8192SE hardware is found.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 3 ---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c   | 7 +------
 2 files changed, 1 insertion(+), 9 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -3
index 2b2d8af4cf6e..b0aa76574738 100644
@@ -52,9 +52,6 @@
 #define DRV_AUTHOR  "<[email protected]>"
 #define DRV_VERSION  "0014.0401.2010"
 
-#define IS_HARDWARE_TYPE_8192SE(_priv)		\
-	(((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192SE)
-
 #define TOTAL_CAM_ENTRY		32
 #define CAM_CONTENT_COUNT	8
 
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +1 -6
index cde41111012a..50486f2a6f3a 100644
@@ -214,8 +214,6 @@ void rtl92e_dm_init(struct net_device *dev)
 	_rtl92e_dm_init_fsync(dev);
 	_rtl92e_dm_init_rx_path_selection(dev);
 	_rtl92e_dm_init_cts_to_self(dev);
-	if (IS_HARDWARE_TYPE_8192SE(dev))
-		_rtl92e_dm_init_wa_broadcom_iot(dev);
 
 	INIT_DELAYED_WORK(&priv->gpio_change_rf_wq, (void *)_rtl92e_dm_check_rf_ctrl_gpio);
 }
@@ -816,10 +814,7 @@ static void _rtl92e_dm_check_tx_power_tracking_thermal(struct net_device *dev)
 	static u8	TM_Trigger;
 	u8		TxPowerCheckCnt = 0;
 
-	if (IS_HARDWARE_TYPE_8192SE(dev))
-		TxPowerCheckCnt = 5;
-	else
-		TxPowerCheckCnt = 2;
+	TxPowerCheckCnt = 2;
 	if (!priv->btxpower_tracking)
 		return;
 
Signature · 1 line
2.40.0
#2 lore raw

PATCH v2 2/4 staging: rtl8192e: Remove unused function _rtl92e_dm_init_wa_broadcom_iot

In reply to Philipp Hortmann

Remove unused function _rtl92e_dm_init_wa_broadcom_iot and the variables that are not any longer used.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 11 -----------
 drivers/staging/rtl8192e/rtl819x_HT.h      |  3 ---
 2 files changed, 14 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +0 -11
index 50486f2a6f3a..93504d5a8578 100644
@@ -173,7 +173,6 @@ static void _rtl92e_dm_pd_th(struct net_device *dev);
 static void _rtl92e_dm_cs_ratio(struct net_device *dev);
 
 static	void _rtl92e_dm_init_cts_to_self(struct net_device *dev);
-static void _rtl92e_dm_init_wa_broadcom_iot(struct net_device *dev);
 
 static void _rtl92e_dm_check_edca_turbo(struct net_device *dev);
 static void _rtl92e_dm_check_rx_path_selection(struct net_device *dev);
@@ -1531,16 +1530,6 @@ static void _rtl92e_dm_cts_to_self(struct net_device *dev)
 	}
 }
 
-
-static void _rtl92e_dm_init_wa_broadcom_iot(struct net_device *dev)
-{
-	struct r8192_priv *priv = rtllib_priv((struct net_device *)dev);
-	struct rt_hi_throughput *ht_info = priv->rtllib->ht_info;
-
-	ht_info->bWAIotBroadcom = false;
-	ht_info->WAIotTH = WA_IOT_TH_VAL;
-}
-
 static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
 {
 	struct r8192_priv *priv = container_of_dwork_rsl(data,
drivers/staging/rtl8192e/rtl819x_HT.h +0 -3
index 22e4f126ed56..f4e9fa849796 100644
@@ -162,9 +162,6 @@ struct rt_hi_throughput {
 	u8				IOTPeer;
 	u32 iot_action;
 	u8 iot_ra_func;
-
-	u8	bWAIotBroadcom;
-	u8	WAIotTH;
 } __packed;
 
 struct bss_ht {
Signature · 1 line
2.40.0
#3 lore raw

PATCH v2 3/4 staging: rtl8192e: Remove one of two checks for hardware RTL8192SE

In reply to Philipp Hortmann

Check for hardware RTL8192SE is done in function _rtl92e_pci_probe() directly and also two lines later in function rtl92e_check_adapter(). Remove top level check to increase readability.
This pci_read does not follow a pci_write to ensure data is written to the device.

---
v1->v2: Added check for pci_read does not follow pci_write.

---
 drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -6
index 7506d7eb7b4c..45989a77a27c 100644
@@ -2130,7 +2130,6 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
 	struct r8192_priv *priv = NULL;
 	unsigned long pmem_start, pmem_len, pmem_flags;
 	int err = -ENOMEM;
-	u8 revision_id;
 
 	if (pci_enable_device(pdev)) {
 		dev_err(&pdev->dev, "Failed to enable PCI device");
@@ -2189,11 +2188,6 @@ static int _rtl92e_pci_probe(struct pci_dev *pdev,
 	dev->mem_start = ioaddr;
 	dev->mem_end = ioaddr + pci_resource_len(pdev, 0);
 
-	pci_read_config_byte(pdev, 0x08, &revision_id);
-	/* If the revisionid is 0x10, the device uses rtl8192se. */
-	if (pdev->device == 0x8192 && revision_id == 0x10)
-		goto err_unmap;
-
 	if (!rtl92e_check_adapter(pdev, dev))
 		goto err_unmap;
 
Signature · 1 line
2.40.0
#4 lore raw

PATCH v2 4/4 staging: rtl8192e: Remove unused variable RF_Type

In reply to Philipp Hortmann

Remove unused variable RF_Type.

---
 drivers/staging/rtl8192e/rtllib.h | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/rtl8192e/rtllib.h +0 -1
index 1a0177cd64af..b1729d65f67f 100644
@@ -1393,7 +1393,6 @@ struct rtllib_device {
 	size_t assocreq_ies_len, assocresp_ies_len;
 
 	bool	bForcedBgMode;
-	u8 RF_Type;
 
 	u8 hwsec_active;
 	bool is_silent_reset;
Signature · 1 line
2.40.0