Skip to contentSkip to conversation

staging: rtl8723bs: Remove Dead Code in `struct mlme_priv`

PATCH In review Emanuel Bennici 2 participants 11 messages Mar 17, 2019 – Mar 19, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/10 staging: rtl8723bs: Remove Dead Code in `struct mlme_priv`

Some Lines in the struct mlme_priv are Dead due to CONFIG_INTEL_WIDI. This Fix removes the dead code.

---
 drivers/staging/rtl8723bs/include/rtw_mlme.h | 27 --------------------
 1 file changed, 27 deletions(-)
drivers/staging/rtl8723bs/include/rtw_mlme.h +0 -27
index 1ea9ea0e8d2e..ed59f16c26c4 100644
@@ -454,33 +454,6 @@ struct mlme_priv {
 	_lock	bcn_update_lock;
 	u8 update_bcn;
 
-#ifdef CONFIG_INTEL_WIDI
-	int	widi_state;
-	int	listen_state;
-	_timer	listen_timer;
-	atomic_t	rx_probe_rsp; /*  1:receive probe respone from RDS source. */
-	u8 *l2sdTaBuffer;
-	u8 channel_idx;
-	u8 group_cnt;	/* In WiDi 3.5, they specified another scan algo. for WFD/RDS co-existed */
-	u8 sa_ext[L2SDTA_SERVICE_VE_LEN];
-
-	u8 widi_enable;
-	/**
-	 * For WiDi 4; upper layer would set
-	 * p2p_primary_device_type_category_id
-	 * p2p_primary_device_type_sub_category_id
-	 * p2p_secondary_device_type_category_id
-	 * p2p_secondary_device_type_sub_category_id
-	 */
-	u16 p2p_pdt_cid;
-	u16 p2p_pdt_scid;
-	u8 num_p2p_sdt;
-	u16 p2p_sdt_cid[MAX_NUM_P2P_SDT];
-	u16 p2p_sdt_scid[MAX_NUM_P2P_SDT];
-	u8 p2p_reject_disable;	/* When starting NL80211 wpa_supplicant/hostapd, it will call netdev_close */
-							/* such that it will cause p2p disabled. Use this flag to reject. */
-#endif /*  CONFIG_INTEL_WIDI */
-
 	u8 NumOfBcnInfoChkFail;
 	unsigned long	timeBcnInfoChkStart;
 };
Signature · 1 line
2.19.1
#1 lore raw

PATCH 2/10 staging: rtl8723bs: Remove Dead Include in include/drv_types.h

rtw_intel_widi.h is never included due to CONFIG_INTEL_WIDI. This Patch removes the dead code.

---
 drivers/staging/rtl8723bs/include/drv_types.h | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/rtl8723bs/include/drv_types.h +0 -4
index bafb2c30e7fb..d29cc18a0ecc 100644
@@ -37,10 +37,6 @@ enum _NIC_VERSION {
 
 #include <rtw_ht.h>
 
-#ifdef CONFIG_INTEL_WIDI
-#include <rtw_intel_widi.h>
-#endif
-
 #include <rtw_cmd.h>
 #include <cmd_osdep.h>
 #include <rtw_security.h>
Signature · 1 line
2.19.1
#2 lore raw

PATCH 3/10 staging: rtl8723bs: Remove Dead Code in collect_bss_info Function

In reply to Emanuel Bennici

In u8 collect_bss_info is a ifdef-Preprocessor who checks CONFIG_INTEL_WIDI, since this Macro doesn't exists anymore this Patch removes the Dead Code in core/rtw_mlme_ext.c

---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -6
index ebb45acb4446..1f7c87e48c1e 100644
@@ -4579,12 +4579,6 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str
 			pmlmepriv->num_sta_no_ht++;
 	}
 
-#ifdef CONFIG_INTEL_WIDI
-	/* process_intel_widi_query_or_tigger(padapter, bssid); */
-	if (process_intel_widi_query_or_tigger(padapter, bssid))
-		return _FAIL;
-#endif /*  CONFIG_INTEL_WIDI */
-
 	#if defined(DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) & 1
 	if (strcmp(bssid->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) {
 		DBG_871X("Receiving %s("MAC_FMT", DSConfig:%u) from ch%u with ss:%3u, sq:%3u, RawRSSI:%3ld\n"
Signature · 1 line
2.19.1
#3 lore raw

PATCH 4/10 staging: rtl8723bs: Remove old unreachable Code

In reply to Emanuel Bennici

The commented code in core/rtw_mlme_ext.c obsolete because the macro CONFIG_INTEL_WIDI no longer exists.

---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +0 -5
index 1f7c87e48c1e..b2813eb3d9d2 100644
@@ -5707,11 +5707,6 @@ void linked_status_chk(struct adapter *padapter)
 		/*  Marked by Kurt 20130715 */
 		/*  For WiDi 3.5 and latered on, they don't ask WiDi sink to do roaming, so we could not check rx limit that strictly. */
 		/*  todo: To check why we under miracast session, rx_chk would be false */
-		/* ifdef CONFIG_INTEL_WIDI */
-		/* if (padapter->mlmepriv.widi_state != INTEL_WIDI_STATE_NONE) */
-		/* 	rx_chk_limit = 1; */
-		/* endif */
-
 		psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.MacAddress);
 		if (psta != NULL) {
 			if (chk_ap_is_alive(padapter, psta) == false)
Signature · 1 line
2.19.1
#4 lore raw

PATCH 5/10 staging: rtl8723bs: Remove unreachable Code in core/rtw_cmd.c

In reply to Emanuel Bennici

The case INTEl_WIDI_WK_CID-Statement in Function u8 rtw_drvextra_cmd_hdl wouldn't be used because of CONFIG_INTEL_WIDI.

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +0 -5
index 91520ca3bbad..6c6ddf461590 100644
@@ -2007,11 +2007,6 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
 	case CHECK_HIQ_WK_CID:
 		rtw_chk_hi_queue_hdl(padapter);
 		break;
-#ifdef CONFIG_INTEL_WIDI
-	case INTEl_WIDI_WK_CID:
-		intel_widi_wk_hdl(padapter, pdrvextra_cmd->type, pdrvextra_cmd->pbuf);
-		break;
-#endif /* CONFIG_INTEL_WIDI */
 	/* add for CONFIG_IEEE80211W, none 11w can use it */
 	case RESET_SECURITYPRIV:
 		reset_securitypriv_hdl(padapter);
Signature · 1 line
2.19.1
#5 lore raw

Re: [PATCH 05/10] staging: rtl8723bs: Remove unreachable Code in core/rtw_cmd.c

Quoted 13 lines · Emanuel Bennici

The case INTEl_WIDI_WK_CID-Statement in Function u8 rtw_drvextra_cmd_hdl wouldn't be used because of CONFIG_INTEL_WIDI.

---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/rtl8723bs/core/rtw_cmd.c +0 -0
index 91520ca3bbad..6c6ddf461590 100644

drivers/staging/rtl8723bs/core/rtw_cmd.c u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf) · line 2014

Quoted 8 lines
drivers/staging/rtl8723bs/core/rtw_cmd.c +0 -5
@@ -2007,11 +2007,6 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
 	case CHECK_HIQ_WK_CID:
 		rtw_chk_hi_queue_hdl(padapter);
 		break;
-#ifdef CONFIG_INTEL_WIDI
-	case INTEl_WIDI_WK_CID:
-		intel_widi_wk_hdl(padapter, pdrvextra_cmd->type, pdrvextra_cmd->pbuf);
-		break;
-#endif /* CONFIG_INTEL_WIDI */

Could you just remove all the CONFIG_INTEL_WIDI at once? That would be easier to review.

(I don't know where the other patches from this series are. Maybe gmail ate them).

regards,
dan carpenter

#6 lore raw

PATCH 6/10 staging: rtl8723bs: Remove Dead Code in os_dep/os_intfs.c

In reply to Emanuel Bennici

uint loadparam uses the Macro CONFIG_INTEL_WIDI witch doesn't exists anymore.

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +0 -3
index 143e3f9b31aa..4980fedb2fcc 100644
@@ -309,9 +309,6 @@ static uint loadparam(struct adapter *padapter, _nic_hdl pnetdev)
 	registry_par->hw_wps_pbc = (u8)rtw_hw_wps_pbc;
 
 	registry_par->max_roaming_times = (u8)rtw_max_roaming_times;
-#ifdef CONFIG_INTEL_WIDI
-	registry_par->max_roaming_times = (u8)rtw_max_roaming_times + 2;
-#endif /*  CONFIG_INTEL_WIDI */
 
 	registry_par->enable80211d = (u8)rtw_80211d;
 
Signature · 1 line
2.19.1
#7 lore raw

PATCH 7/10 staging: rtl8723bs: Remove Dead Code in os_dep/os_intfs.c

In reply to Emanuel Bennici

The Functions u8 rtw_init_drv_sw and u8 rtw_free_drv_sw uses the Macro CONFIG_INTEL_WIDI witch doesn't exists anymore. This Patch removes those redundant Code Lines.

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 12 ------------
 1 file changed, 12 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +0 -12
index 4980fedb2fcc..5c0fbf5170cc 100644
@@ -813,14 +813,6 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
 
 	rtw_hal_dm_init(padapter);
 
-#ifdef CONFIG_INTEL_WIDI
-	if (rtw_init_intel_widi(padapter) == _FAIL) {
-		DBG_871X("Can't rtw_init_intel_widi\n");
-		ret8 = _FAIL;
-		goto exit;
-	}
-#endif /* CONFIG_INTEL_WIDI */
-
 exit:
 
 	RT_TRACE(_module_os_intfs_c_, _drv_info_, ("-rtw_init_drv_sw\n"));
@@ -857,10 +849,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
 {
 	RT_TRACE(_module_os_intfs_c_, _drv_info_, ("==>rtw_free_drv_sw"));
 
-#ifdef CONFIG_INTEL_WIDI
-	rtw_free_intel_widi(padapter);
-#endif /* CONFIG_INTEL_WIDI */
-
 	free_mlme_ext_priv(&padapter->mlmeextpriv);
 
 	rtw_free_cmd_priv(&padapter->cmdpriv);
Signature · 1 line
2.19.1
#8 lore raw

PATCH 8/10 staging: rtl8723bs: Remove Dead Code in os_dep/ioctl_linux.c

In reply to Emanuel Bennici

Remove Dead Code in static int rtw_wps_start,
struct iw_handler rtw_private_handler[] and
struct iw_priv_args rtw_private_args[] since they use the Macro CONFIG_INTEL_WIDI witch doesn't exists any more.

---
 .../staging/rtl8723bs/os_dep/ioctl_linux.c    | 19 -------------------
 1 file changed, 19 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0 -19
index 8fb03efd588b..f1a1baf72488 100644
@@ -2590,10 +2590,6 @@ static int rtw_wps_start(struct net_device *dev,
 
 	DBG_871X("[%s] wps_start = %d\n", __func__, u32wps_start);
 
-#ifdef CONFIG_INTEL_WIDI
-	process_intel_widi_wps_status(padapter, u32wps_start);
-#endif /* CONFIG_INTEL_WIDI */
-
 exit:
 
 	return ret;
@@ -4791,17 +4787,6 @@ static const struct iw_priv_args rtw_private_args[] = {
 		IW_PRIV_TYPE_CHAR | 40, IW_PRIV_TYPE_CHAR | 0x7FF, "test"
 	},
 
-#ifdef CONFIG_INTEL_WIDI
-	{
-		SIOCIWFIRSTPRIV + 0x1E,
-		IW_PRIV_TYPE_CHAR | 1024, 0, "widi_set"
-	},
-	{
-		SIOCIWFIRSTPRIV + 0x1F,
-		IW_PRIV_TYPE_CHAR | 128, 0, "widi_prob_req"
-	},
-#endif /*  CONFIG_INTEL_WIDI */
-
 #ifdef CONFIG_WOWLAN
 		{ MP_WOW_ENABLE , IW_PRIV_TYPE_CHAR | 1024, 0, "wow_mode" }, /* set */
 #endif
@@ -4852,10 +4837,6 @@ static iw_handler rtw_private_handler[] = {
 	rtw_mp_efuse_get,				/* 0x1B */
 	NULL,							/*  0x1C is reserved for hostapd */
 	rtw_test,						/*  0x1D */
-#ifdef CONFIG_INTEL_WIDI
-	rtw_widi_set,					/* 0x1E */
-	rtw_widi_set_probe_request,		/* 0x1F */
-#endif /*  CONFIG_INTEL_WIDI */
 };
 
 static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev)
Signature · 1 line
2.19.1
#9 lore raw

PATCH 9/10 staging: rtl8723bs: Remove Dead Functions in os_dep/ioctl_linux.c

In reply to Emanuel Bennici

The Functions static int rtw_widi_set() and
static int rtw_widi_set_probe_request() part of dead code due to CONFIG_INTEL_WIDI.
The fix removes the deadcode.

---
 .../staging/rtl8723bs/os_dep/ioctl_linux.c    | 36 -------------------
 1 file changed, 36 deletions(-)
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +0 -36
index f1a1baf72488..4fcd404f0dfc 100644
@@ -4514,42 +4514,6 @@ static int rtw_tdls_get(struct net_device *dev,
 
 
 
-#ifdef CONFIG_INTEL_WIDI
-static int rtw_widi_set(struct net_device *dev,
-                               struct iw_request_info *info,
-                               union iwreq_data *wrqu, char *extra)
-{
-	int ret = 0;
-	struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
-
-	process_intel_widi_cmd(padapter, extra);
-
-	return ret;
-}
-
-static int rtw_widi_set_probe_request(struct net_device *dev,
-                               struct iw_request_info *info,
-                               union iwreq_data *wrqu, char *extra)
-{
-	int	ret = 0;
-	u8 *pbuf = NULL;
-	struct adapter	*padapter = (struct adapter *)rtw_netdev_priv(dev);
-
-	pbuf = rtw_malloc(sizeof(l2_msg_t));
-	if (pbuf) {
-		if (copy_from_user(pbuf, wrqu->data.pointer, wrqu->data.length))
-			ret = -EFAULT;
-		/* memcpy(pbuf, wrqu->data.pointer, wrqu->data.length); */
-
-		if (wrqu->data.flags == 0)
-			intel_widi_wk_cmd(padapter, INTEL_WIDI_ISSUE_PROB_WK, pbuf, sizeof(l2_msg_t));
-		else if (wrqu->data.flags == 1)
-			rtw_set_wfd_rds_sink_info(padapter, (l2_msg_t *)pbuf);
-	}
-	return ret;
-}
-#endif /*  CONFIG_INTEL_WIDI */
-
 static int rtw_test(
 	struct net_device *dev,
 	struct iw_request_info *info,
Signature · 1 line
2.19.1
#10 lore raw

PATCH 10/10 staging: rtl8723bs: Remove Dead Code in core/rtw_mlme.c

In reply to Emanuel Bennici

The Functions void rtw_surveydone_event_callback, void rtw_indicate_connect, void rtw_stadel_event_callback and void _rtw_join_timeout_handler are using the Macro CONFIG_INTEL_WIDI which doesn't exists anymore.

---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 32 -----------------------
 1 file changed, 32 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +0 -32
index 406e313477aa..79adc6f1e53a 100644
@@ -943,13 +943,6 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 						|| _SUCCESS != rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)
 					) {
 						rtw_set_to_roam(adapter, 0);
-#ifdef CONFIG_INTEL_WIDI
-						if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
-							memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
-							intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
-							DBG_871X("change to widi listen\n");
-						}
-#endif /*  CONFIG_INTEL_WIDI */
 						rtw_free_assoc_resources(adapter, 1);
 						rtw_indicate_disconnect(adapter);
 					} else {
@@ -1108,14 +1101,6 @@ void rtw_indicate_connect(struct adapter *padapter)
 	}
 
 	rtw_set_to_roam(padapter, 0);
-#ifdef CONFIG_INTEL_WIDI
-	if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
-		memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
-		intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
-		DBG_871X("change to widi listen\n");
-	}
-#endif /*  CONFIG_INTEL_WIDI */
-
 	rtw_set_scan_deny(padapter, 3000);
 
 	RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("-rtw_indicate_connect: fw_state = 0x%08x\n", get_fwstate(pmlmepriv)));
@@ -1703,11 +1688,6 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
 			roam = true;
 			roam_target = pmlmepriv->roam_network;
 		}
-#ifdef CONFIG_INTEL_WIDI
-		else if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_CONNECTED) {
-			roam = true;
-		}
-#endif /*  CONFIG_INTEL_WIDI */
 
 		if (roam == true) {
 			if (rtw_to_roam(adapter) > 0)
@@ -1732,11 +1712,6 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
 		}
 		spin_unlock_bh(&(pmlmepriv->scanned_queue.lock));
 
-#ifdef CONFIG_INTEL_WIDI
-		if (!rtw_to_roam(adapter))
-			process_intel_widi_disconnect(adapter, 1);
-#endif /*  CONFIG_INTEL_WIDI */
-
 		_rtw_roaming(adapter, roam_target);
 	}
 
@@ -1833,13 +1808,6 @@ void _rtw_join_timeout_handler(struct timer_list *t)
 				}
 				break;
 			} else {
-#ifdef CONFIG_INTEL_WIDI
-				if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) {
-					memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN);
-					intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0);
-					DBG_871X("change to widi listen\n");
-				}
-#endif /*  CONFIG_INTEL_WIDI */
 				DBG_871X("%s We've try roaming but fail\n", __func__);
 				rtw_indicate_disconnect(adapter);
 				break;
Signature · 1 line
2.19.1