From 7f201acf475de7109029812aa5079d1448f0d269 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:33 +0100 Subject: [PATCH 001/744] staging: r8192U_core: Remove unused variable 'ret' and demote kernel-doc abuse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/r8192U_core.c: In function ‘rtl8192_hard_data_xmit’: drivers/staging/rtl8192u/r8192U_core.c:905:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: Andrea Merello Cc: Jerry chuang Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-2-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r8192U_core.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index f48186a89fa1..643769e32e43 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -902,7 +902,6 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, int rate) { struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); - int ret; unsigned long flags; struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); u8 queue_index = tcb_desc->queue_index; @@ -915,7 +914,7 @@ static void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, *(struct net_device **)(skb->cb) = dev; tcb_desc->bTxEnableFwCalcDur = 1; skb_push(skb, priv->ieee80211->tx_headroom); - ret = rtl8192_tx(dev, skb); + rtl8192_tx(dev, skb); spin_unlock_irqrestore(&priv->tx_lock, flags); } @@ -2972,12 +2971,10 @@ static RESET_TYPE RxCheckStuck(struct net_device *dev) return RESET_TYPE_NORESET; } -/** +/* * This function is called by Checkforhang to check whether we should * ask OS to reset driver * - * \param pAdapter The adapter context for this miniport - * * Note:NIC with USB interface sholud not call this function because we * cannot scan descriptor to judge whether there is tx stuck. * Note: This function may be required to be rewrite for Vista OS. From 9a6ce484e88520e5cbdd1970b9fd8d5f5f33db8d Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:34 +0100 Subject: [PATCH 002/744] staging: android: ashmem: Supply description for 'new_range' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/android/ashmem.c:189: warning: Function parameter or member 'new_range' not described in 'range_alloc' Cc: Greg Kroah-Hartman Cc: "Arve Hjønnevåg" Cc: Todd Kjos Cc: Martijn Coenen Cc: Joel Fernandes Cc: Christian Brauner Cc: Hridya Valsaraju Cc: Suren Baghdasaryan Cc: Robert Love Cc: linux-staging@lists.linux.dev Acked-by: Todd Kjos Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-3-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/android/ashmem.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index d66a64e42273..8ee4320a5dc6 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -179,6 +179,7 @@ static inline void lru_del(struct ashmem_range *range) * @purged: Initial purge status (ASMEM_NOT_PURGED or ASHMEM_WAS_PURGED) * @start: The starting page (inclusive) * @end: The ending page (inclusive) + * @new_range: The placeholder for the new range * * This function is protected by ashmem_mutex. */ From 52ee2c7c825be4e958a0ac57b1769c8d4fad3ad2 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:36 +0100 Subject: [PATCH 003/744] staging: r8192U_core: Do not use kernel-doc formatting for !kernel-doc headers Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/r8192U_core.c:3714: warning: Function parameter or member 'dev' not described in 'UpdateRxPktTimeStamp8190' drivers/staging/rtl8192u/r8192U_core.c:3714: warning: Function parameter or member 'stats' not described in 'UpdateRxPktTimeStamp8190' drivers/staging/rtl8192u/r8192U_core.c:3714: warning: expecting prototype for Function(). Prototype was for UpdateRxPktTimeStamp8190() instead drivers/staging/rtl8192u/r8192U_core.c:4314: warning: Function parameter or member 'dev' not described in 'UpdateReceivedRateHistogramStatistics8190' drivers/staging/rtl8192u/r8192U_core.c:4314: warning: Function parameter or member 'stats' not described in 'UpdateReceivedRateHistogramStatistics8190' drivers/staging/rtl8192u/r8192U_core.c:4314: warning: expecting prototype for Function(). Prototype was for UpdateReceivedRateHistogramStatistics8190() instead Cc: Greg Kroah-Hartman Cc: Andrea Merello Cc: Jerry chuang Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-5-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r8192U_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 643769e32e43..932b942ca1f3 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -3694,7 +3694,7 @@ static u8 HwRateToMRate90(bool bIsHT, u8 rate) return ret_rate; } -/** +/* * Function: UpdateRxPktTimeStamp * Overview: Record the TSF time stamp when receiving a packet * @@ -4294,7 +4294,7 @@ static void TranslateRxSignalStuff819xUsb(struct sk_buff *skb, rtl8192_record_rxdesc_forlateruse(pstats, &previous_stats); } -/** +/* * Function: UpdateReceivedRateHistogramStatistics * Overview: Record the received data rate * From 803c63d960d8878d2ea621c02e883a7d8d2cb7cd Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:37 +0100 Subject: [PATCH 004/744] staging: r819xU_phy: Remove some local variables from the stack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/r819xU_phy.c: In function ‘rtl8192_phy_SwChnlStepByStep’: drivers/staging/rtl8192u/r819xU_phy.c:1328:1: warning: the frame size of 1096 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Greg Kroah-Hartman Cc: Michael Straube Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-6-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r819xU_phy.c | 48 ++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c index eef751d2b12e..37b82553412e 100644 --- a/drivers/staging/rtl8192u/r819xU_phy.c +++ b/drivers/staging/rtl8192u/r819xU_phy.c @@ -1185,14 +1185,32 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, u8 *stage, u8 *step, u32 *delay) { struct r8192_priv *priv = ieee80211_priv(dev); - struct sw_chnl_cmd PreCommonCmd[MAX_PRECMD_CNT]; + struct sw_chnl_cmd *PreCommonCmd; u32 PreCommonCmdCnt; - struct sw_chnl_cmd PostCommonCmd[MAX_POSTCMD_CNT]; + struct sw_chnl_cmd *PostCommonCmd; u32 PostCommonCmdCnt; - struct sw_chnl_cmd RfDependCmd[MAX_RFDEPENDCMD_CNT]; + struct sw_chnl_cmd *RfDependCmd; u32 RfDependCmdCnt; struct sw_chnl_cmd *CurrentCmd = NULL; u8 e_rfpath; + bool ret; + + PreCommonCmd = kzalloc(sizeof(*PreCommonCmd) * MAX_PRECMD_CNT, GFP_KERNEL); + if (!PreCommonCmd) + return false; + + PostCommonCmd = kzalloc(sizeof(*PostCommonCmd) * MAX_POSTCMD_CNT, GFP_KERNEL); + if (!PostCommonCmd) { + kfree(PreCommonCmd); + return false; + } + + RfDependCmd = kzalloc(sizeof(*RfDependCmd) * MAX_RFDEPENDCMD_CNT, GFP_KERNEL); + if (!RfDependCmd) { + kfree(PreCommonCmd); + kfree(PostCommonCmd); + return false; + } RT_TRACE(COMP_CH, "%s() stage: %d, step: %d, channel: %d\n", __func__, *stage, *step, channel); @@ -1201,7 +1219,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, /* return true to tell upper caller function this channel * setting is finished! Or it will in while loop. */ - return true; + ret = true; + goto out; } /* FIXME: need to check whether channel is legal or not here */ @@ -1227,7 +1246,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, RT_TRACE(COMP_ERR, "illegal channel for Zebra 8225: %d\n", channel); - return true; + ret = true; + goto out; } rtl8192_phy_SetSwChnlCmdArray(RfDependCmd, RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT, @@ -1246,7 +1266,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, RT_TRACE(COMP_ERR, "illegal channel for Zebra 8256: %d\n", channel); - return true; + ret = true; + goto out; } rtl8192_phy_SetSwChnlCmdArray(RfDependCmd, RfDependCmdCnt++, MAX_RFDEPENDCMD_CNT, @@ -1262,7 +1283,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, default: RT_TRACE(COMP_ERR, "Unknown RFChipID: %d\n", priv->rf_chip); - return true; + ret = true; + goto out; } do { @@ -1281,7 +1303,8 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, if (CurrentCmd->cmd_id == CMD_ID_END) { if ((*stage) == 2) { (*delay) = CurrentCmd->ms_delay; - return true; + ret = true; + goto out; } (*stage)++; (*step) = 0; @@ -1324,7 +1347,14 @@ static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, (*delay) = CurrentCmd->ms_delay; (*step)++; - return false; + ret = false; + +out: + kfree(PreCommonCmd); + kfree(PostCommonCmd); + kfree(RfDependCmd); + + return ret; } /****************************************************************************** From 4a29a072b1e5ecc83750b533d87aec5a69c7ce12 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:38 +0100 Subject: [PATCH 005/744] staging: r819xU_cmdpkt: Remove functionless method 'cmpk_handle_query_config_rx' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/r819xU_cmdpkt.c: In function ‘cmpk_handle_query_config_rx’: drivers/staging/rtl8192u/r819xU_cmdpkt.c:274:24: warning: variable ‘rx_query_cfg’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: Michael Straube Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-7-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/r819xU_cmdpkt.c | 41 ------------------------ 1 file changed, 41 deletions(-) diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c b/drivers/staging/rtl8192u/r819xU_cmdpkt.c index 4cece40a92f6..30a320422358 100644 --- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c +++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c @@ -249,46 +249,6 @@ static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg) DMESG("<---- cmpk_handle_interrupt_status()\n"); } -/*----------------------------------------------------------------------------- - * Function: cmpk_handle_query_config_rx() - * - * Overview: The function is responsible for extract the message from - * firmware. It will contain dedicated info in - * ws-06-0063-rtl8190-command-packet-specification. Please - * refer to chapter "Beacon State Element". - * - * Input: u8 *pmsg - Message Pointer of the command packet. - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 05/12/2008 amy Create Version 0 porting from windows code. - * - *--------------------------------------------------------------------------- - */ -static void cmpk_handle_query_config_rx(struct net_device *dev, u8 *pmsg) -{ - struct cmpk_query_cfg rx_query_cfg; - - /* 1. Extract TX feedback info from RFD to temp structure buffer. */ - /* It seems that FW use big endian(MIPS) and DRV use little endian in - * windows OS. So we have to read the content byte by byte or transfer - * endian type before copy the message copy. - */ - rx_query_cfg.cfg_action = (pmsg[4] & 0x80) >> 7; - rx_query_cfg.cfg_type = (pmsg[4] & 0x60) >> 5; - rx_query_cfg.cfg_size = (pmsg[4] & 0x18) >> 3; - rx_query_cfg.cfg_page = (pmsg[6] & 0x0F) >> 0; - rx_query_cfg.cfg_offset = pmsg[7]; - rx_query_cfg.value = (pmsg[8] << 24) | (pmsg[9] << 16) | - (pmsg[10] << 8) | (pmsg[11] << 0); - rx_query_cfg.mask = (pmsg[12] << 24) | (pmsg[13] << 16) | - (pmsg[14] << 8) | (pmsg[15] << 0); -} - /*----------------------------------------------------------------------------- * Function: cmpk_count_tx_status() * @@ -514,7 +474,6 @@ u32 cmpk_message_handle_rx(struct net_device *dev, break; case BOTH_QUERY_CONFIG: - cmpk_handle_query_config_rx(dev, pcmd_buff); cmd_length = CMPK_BOTH_QUERY_CONFIG_SIZE; break; From ea82ff749587807fa48e3277c977ff3cec266f25 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:39 +0100 Subject: [PATCH 006/744] staging: wlan-ng: cfg80211: Move large struct onto the heap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/wlan-ng/cfg80211.c: In function ‘prism2_scan’: drivers/staging/wlan-ng/cfg80211.c:388:1: warning: the frame size of 1296 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Greg Kroah-Hartman Cc: Sumera Priyadarsini Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-8-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/cfg80211.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index 759e475e303c..7951bd63816f 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c @@ -276,7 +276,7 @@ static int prism2_scan(struct wiphy *wiphy, struct prism2_wiphy_private *priv = wiphy_priv(wiphy); struct wlandevice *wlandev; struct p80211msg_dot11req_scan msg1; - struct p80211msg_dot11req_scan_results msg2; + struct p80211msg_dot11req_scan_results *msg2; struct cfg80211_bss *bss; struct cfg80211_scan_info info = {}; @@ -301,6 +301,10 @@ static int prism2_scan(struct wiphy *wiphy, return -EOPNOTSUPP; } + msg2 = kzalloc(sizeof(*msg2), GFP_KERNEL); + if (!msg2) + return -ENOMEM; + priv->scan_request = request; memset(&msg1, 0x00, sizeof(msg1)); @@ -342,31 +346,30 @@ static int prism2_scan(struct wiphy *wiphy, for (i = 0; i < numbss; i++) { int freq; - memset(&msg2, 0, sizeof(msg2)); - msg2.msgcode = DIDMSG_DOT11REQ_SCAN_RESULTS; - msg2.bssindex.data = i; + msg2->msgcode = DIDMSG_DOT11REQ_SCAN_RESULTS; + msg2->bssindex.data = i; result = p80211req_dorequest(wlandev, (u8 *)&msg2); if ((result != 0) || - (msg2.resultcode.data != P80211ENUM_resultcode_success)) { + (msg2->resultcode.data != P80211ENUM_resultcode_success)) { break; } ie_buf[0] = WLAN_EID_SSID; - ie_buf[1] = msg2.ssid.data.len; + ie_buf[1] = msg2->ssid.data.len; ie_len = ie_buf[1] + 2; - memcpy(&ie_buf[2], &msg2.ssid.data.data, msg2.ssid.data.len); - freq = ieee80211_channel_to_frequency(msg2.dschannel.data, + memcpy(&ie_buf[2], &msg2->ssid.data.data, msg2->ssid.data.len); + freq = ieee80211_channel_to_frequency(msg2->dschannel.data, NL80211_BAND_2GHZ); bss = cfg80211_inform_bss(wiphy, ieee80211_get_channel(wiphy, freq), CFG80211_BSS_FTYPE_UNKNOWN, - (const u8 *)&msg2.bssid.data.data, - msg2.timestamp.data, msg2.capinfo.data, - msg2.beaconperiod.data, + (const u8 *)&msg2->bssid.data.data, + msg2->timestamp.data, msg2->capinfo.data, + msg2->beaconperiod.data, ie_buf, ie_len, - (msg2.signal.data - 65536) * 100, /* Conversion to signed type */ + (msg2->signal.data - 65536) * 100, /* Conversion to signed type */ GFP_KERNEL); if (!bss) { @@ -378,12 +381,13 @@ static int prism2_scan(struct wiphy *wiphy, } if (result) - err = prism2_result2err(msg2.resultcode.data); + err = prism2_result2err(msg2->resultcode.data); exit: info.aborted = !!(err); cfg80211_scan_done(request, &info); priv->scan_request = NULL; + kfree(msg2); return err; } From 683707c7ed87167768188b729cdee92f0dc545b6 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:41 +0100 Subject: [PATCH 007/744] staging: rtl8188eu: core: rtw_ieee80211: Fix incorrectly documented function Fixes the following W=1 kernel build warning(s): from drivers/staging/rtl8188eu/core/rtw_ieee80211.c:11: drivers/staging/rtl8188eu/core/rtw_ieee80211.c:778: warning: expecting prototype for ieee802_11_parse_elems(). Prototype was for rtw_ieee802_11_parse_elems() instead Cc: Larry Finger Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-10-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c index 7a706fe11750..e88ebe8891fc 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c @@ -765,7 +765,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, } /** - * ieee802_11_parse_elems - Parse information elements in management frames + * rtw_ieee802_11_parse_elems - Parse information elements in management frames * @start: Pointer to the start of ies * @len: Length of IE buffer in octets * @elems: Data structure for parsed elements From 4c98e73f28e28a96c44108cbb05af73f748682c8 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:42 +0100 Subject: [PATCH 008/744] staging: rtl8723bs: core: rtw_mlme: Remove a bunch of unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/core/rtw_mlme.c: In function ‘rtw_build_wmm_ie_ht’: drivers/staging/rtl8723bs/core/rtw_mlme.c:2482:6: warning: variable ‘pframe’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/core/rtw_mlme.c: In function ‘rtw_restructure_ht_ie’: drivers/staging/rtl8723bs/core/rtw_mlme.c:2498:21: warning: variable ‘pframe’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/core/rtw_mlme.c: In function ‘rtw_update_ht_cap’: drivers/staging/rtl8723bs/core/rtw_mlme.c:2647:33: warning: variable ‘pht_addtinfo’ set but not used [-Wunused-but-set-variable] from drivers/staging/rtl8188eu/core/rtw_mlme.c:12: Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-11-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 4707dba90397..a16eabdeafd1 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -2353,12 +2353,11 @@ void rtw_build_wmm_ie_ht(struct adapter *padapter, u8 *out_ie, uint *pout_len) { unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00}; int out_len; - u8 *pframe; if (padapter->mlmepriv.qospriv.qos_option == 0) { out_len = *pout_len; - pframe = rtw_set_ie(out_ie+out_len, WLAN_EID_VENDOR_SPECIFIC, - _WMM_IE_Length_, WMM_IE, pout_len); + rtw_set_ie(out_ie+out_len, WLAN_EID_VENDOR_SPECIFIC, + _WMM_IE_Length_, WMM_IE, pout_len); padapter->mlmepriv.qospriv.qos_option = 1; } @@ -2369,7 +2368,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ { u32 ielen, out_len; enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor; - unsigned char *p, *pframe; + unsigned char *p; struct ieee80211_ht_cap ht_capie; u8 cbw40_enable = 0, stbc_rx_enable = 0, rf_type = 0, operation_bw = 0; struct registry_priv *pregistrypriv = &padapter->registrypriv; @@ -2492,8 +2491,8 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ else ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00); - pframe = rtw_set_ie(out_ie+out_len, WLAN_EID_HT_CAPABILITY, - sizeof(struct ieee80211_ht_cap), (unsigned char *)&ht_capie, pout_len); + rtw_set_ie(out_ie+out_len, WLAN_EID_HT_CAPABILITY, + sizeof(struct ieee80211_ht_cap), (unsigned char *)&ht_capie, pout_len); phtpriv->ht_option = true; @@ -2501,7 +2500,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ p = rtw_get_ie(in_ie, WLAN_EID_HT_OPERATION, &ielen, in_len); if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) { out_len = *pout_len; - pframe = rtw_set_ie(out_ie+out_len, WLAN_EID_HT_OPERATION, ielen, p+2, pout_len); + rtw_set_ie(out_ie+out_len, WLAN_EID_HT_OPERATION, ielen, p+2, pout_len); } } @@ -2516,7 +2515,6 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe int len; /* struct sta_info *bmc_sta, *psta; */ struct ieee80211_ht_cap *pht_capie; - struct ieee80211_ht_addt_info *pht_addtinfo; /* struct recv_reorder_ctrl *preorder_ctrl; */ struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct ht_priv *phtpriv = &pmlmepriv->htpriv; @@ -2553,7 +2551,6 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe len = 0; p = rtw_get_ie(pie+sizeof(struct ndis_802_11_fix_ie), WLAN_EID_HT_OPERATION, &len, ie_len-sizeof(struct ndis_802_11_fix_ie)); if (p && len > 0) { - pht_addtinfo = (struct ieee80211_ht_addt_info *)(p+2); /* todo: */ } From 02d06dd53463eeeb24333047849f304f59bdf7bd Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:44 +0100 Subject: [PATCH 009/744] staging: rtl8712: rtl871x_mp_ioctl: Remove a bunch of unused tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8712/rtl871x_mp_ioctl.h:256:34: warning: ‘oid_rtl_seg_81_85’ defined but not used [-Wunused-const-variable=] drivers/staging/rtl8712/rtl871x_mp_ioctl.h:249:34: warning: ‘oid_rtl_seg_81_80_80’ defined but not used [-Wunused-const-variable=] drivers/staging/rtl8712/rtl871x_mp_ioctl.h:240:34: warning: ‘oid_rtl_seg_81_80_40’ defined but not used [-Wunused-const-variable=] drivers/staging/rtl8712/rtl871x_mp_ioctl.h:205:34: warning: ‘oid_rtl_seg_81_80_20’ defined but not used [-Wunused-const-variable=] drivers/staging/rtl8712/rtl871x_mp_ioctl.h:138:34: warning: ‘oid_rtl_seg_81_80_00’ defined but not used [-Wunused-const-variable=] Cc: Larry Finger Cc: Florian Schilhabel Cc: Greg Kroah-Hartman Cc: WLAN FAE Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-13-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl871x_mp_ioctl.h | 127 --------------------- 1 file changed, 127 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h index 59fa6664d868..98204493a04c 100644 --- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h +++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h @@ -135,135 +135,8 @@ uint oid_rt_get_power_mode_hdl( struct oid_par_priv *poid_par_priv); #ifdef _RTL871X_MP_IOCTL_C_ /* CAUTION!!! */ /* This ifdef _MUST_ be left in!! */ -static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = { - /* 0x00 OID_RT_PRO_RESET_DUT */ - {1, oid_null_function}, - /* 0x01 */ - {1, oid_rt_pro_set_data_rate_hdl}, - /* 0x02 */ - {1, oid_rt_pro_start_test_hdl}, - /* 0x03 */ - {1, oid_rt_pro_stop_test_hdl}, - /* 0x04 OID_RT_PRO_SET_PREAMBLE */ - {1, oid_null_function}, - /* 0x05 OID_RT_PRO_SET_SCRAMBLER */ - {1, oid_null_function}, - /* 0x06 OID_RT_PRO_SET_FILTER_BB */ - {1, oid_null_function}, - /* 0x07 OID_RT_PRO_SET_MANUAL_DIVERS_BB */ - {1, oid_null_function}, - /* 0x08 */ - {1, oid_rt_pro_set_channel_direct_call_hdl}, - /* 0x09 OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL */ - {1, oid_null_function}, - /* 0x0A OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL */ - {1, oid_null_function}, - /* 0x0B OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL */ - {1, oid_rt_pro_set_continuous_tx_hdl}, - /* 0x0C OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS */ - {1, oid_rt_pro_set_single_carrier_tx_hdl}, - /* 0x0D OID_RT_PRO_SET_TX_ANTENNA_BB */ - {1, oid_null_function}, - /* 0x0E */ - {1, oid_rt_pro_set_antenna_bb_hdl}, - /* 0x0F OID_RT_PRO_SET_CR_SCRAMBLER */ - {1, oid_null_function}, - /* 0x10 OID_RT_PRO_SET_CR_NEW_FILTER */ - {1, oid_null_function}, - /* 0x11 OID_RT_PRO_SET_TX_POWER_CONTROL */ - {1, oid_rt_pro_set_tx_power_control_hdl}, - /* 0x12 OID_RT_PRO_SET_CR_TX_CONFIG */ - {1, oid_null_function}, - /* 0x13 OID_RT_PRO_GET_TX_POWER_CONTROL */ - {1, oid_null_function}, - /* 0x14 OID_RT_PRO_GET_CR_SIGNAL_QUALITY */ - {1, oid_null_function}, - /* 0x15 OID_RT_PRO_SET_CR_SETPOINT */ - {1, oid_null_function}, - /* 0x16 OID_RT_PRO_SET_INTEGRATOR */ - {1, oid_null_function}, - /* 0x17 OID_RT_PRO_SET_SIGNAL_QUALITY */ - {1, oid_null_function}, - /* 0x18 OID_RT_PRO_GET_INTEGRATOR */ - {1, oid_null_function}, - /* 0x19 OID_RT_PRO_GET_SIGNAL_QUALITY */ - {1, oid_null_function}, - /* 0x1A OID_RT_PRO_QUERY_EEPROM_TYPE */ - {1, oid_null_function}, - /* 0x1B OID_RT_PRO_WRITE_MAC_ADDRESS */ - {1, oid_null_function}, - /* 0x1C OID_RT_PRO_READ_MAC_ADDRESS */ - {1, oid_null_function}, - /* 0x1D OID_RT_PRO_WRITE_CIS_DATA */ - {1, oid_null_function}, - /* 0x1E OID_RT_PRO_READ_CIS_DATA */ - {1, oid_null_function}, - /* 0x1F OID_RT_PRO_WRITE_POWER_CONTROL */ - {1, oid_null_function} -}; - -static const struct oid_obj_priv oid_rtl_seg_81_80_20[] = { - /* 0x20 OID_RT_PRO_READ_POWER_CONTROL */ - {1, oid_null_function}, - /* 0x21 OID_RT_PRO_WRITE_EEPROM */ - {1, oid_null_function}, - /* 0x22 OID_RT_PRO_READ_EEPROM */ - {1, oid_null_function}, - /* 0x23 */ - {1, oid_rt_pro_reset_tx_packet_sent_hdl}, - /* 0x24 */ - {1, oid_rt_pro_query_tx_packet_sent_hdl}, - /* 0x25 */ - {1, oid_rt_pro_reset_rx_packet_received_hdl}, - /* 0x26 */ - {1, oid_rt_pro_query_rx_packet_received_hdl}, - /* 0x27 */ - {1, oid_rt_pro_query_rx_packet_crc32_error_hdl}, - /* 0x28 OID_RT_PRO_QUERY_CURRENT_ADDRESS */ - {1, oid_null_function}, - /* 0x29 OID_RT_PRO_QUERY_PERMANENT_ADDRESS */ - {1, oid_null_function}, - /* 0x2A OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS */ - {1, oid_null_function}, - /* 0x2B OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX */ - {1, oid_rt_pro_set_carrier_suppression_tx_hdl}, - /* 0x2C OID_RT_PRO_RECEIVE_PACKET */ - {1, oid_null_function}, - /* 0x2D OID_RT_PRO_WRITE_EEPROM_BYTE */ - {1, oid_null_function}, - /* 0x2E OID_RT_PRO_READ_EEPROM_BYTE */ - {1, oid_null_function}, - /* 0x2F */ - {1, oid_rt_pro_set_modulation_hdl} -}; - -static const struct oid_obj_priv oid_rtl_seg_81_80_40[] = { - {1, oid_null_function}, /* 0x40 */ - {1, oid_null_function}, /* 0x41 */ - {1, oid_null_function}, /* 0x42 */ - {1, oid_rt_pro_set_single_tone_tx_hdl}, /* 0x43 */ - {1, oid_null_function}, /* 0x44 */ - {1, oid_null_function} /* 0x45 */ -}; - -static const struct oid_obj_priv oid_rtl_seg_81_80_80[] = { - {1, oid_null_function}, /* 0x80 OID_RT_DRIVER_OPTION */ - {1, oid_null_function}, /* 0x81 OID_RT_RF_OFF */ - {1, oid_null_function} /* 0x82 OID_RT_AUTH_STATUS */ - -}; - -static const struct oid_obj_priv oid_rtl_seg_81_85[] = { - /* 0x00 OID_RT_WIRELESS_MODE */ - {1, oid_rt_wireless_mode_hdl} -}; #else /* _RTL871X_MP_IOCTL_C_ */ -extern struct oid_obj_priv oid_rtl_seg_81_80_00[32]; -extern struct oid_obj_priv oid_rtl_seg_81_80_20[16]; -extern struct oid_obj_priv oid_rtl_seg_81_80_40[6]; -extern struct oid_obj_priv oid_rtl_seg_81_80_80[3]; -extern struct oid_obj_priv oid_rtl_seg_81_85[1]; extern struct oid_obj_priv oid_rtl_seg_81_87[5]; extern struct oid_obj_priv oid_rtl_seg_87_11_00[32]; extern struct oid_obj_priv oid_rtl_seg_87_11_20[5]; From daa2627c7f2f9c30c4955e8367cdbfb84d149e50 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:45 +0100 Subject: [PATCH 010/744] staging: rtl8723bs: core: rtw_recv: Mark debug variable as __maybe_unused MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): from drivers/staging/rtl8188eu/core/rtw_recv.c:12: drivers/staging/rtl8723bs/core/rtw_recv.c: In function ‘rtw_signal_stat_timer_hdl’: drivers/staging/rtl8723bs/core/rtw_recv.c:2341:6: warning: variable ‘num_signal_qual’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-14-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c index 668a703dee7f..f15cd7e39521 100644 --- a/drivers/staging/rtl8723bs/core/rtw_recv.c +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c @@ -2123,7 +2123,7 @@ static void rtw_signal_stat_timer_hdl(struct timer_list *t) u8 avg_signal_strength = 0; u8 avg_signal_qual = 0; u32 num_signal_strength = 0; - u32 num_signal_qual = 0; + u32 __maybe_unused num_signal_qual = 0; u8 _alpha = 5; /* this value is based on converging_constant = 5000 and sampling_interval = 1000 */ if (adapter->recvpriv.is_signal_dbg) { From 9d65023547dc62820fb3cf83a4bc180b5c1c9756 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:46 +0100 Subject: [PATCH 011/744] staging: rtl8188eu: core: rtw_security: Fix some formatting and misdocumentation Fixes the following W=1 kernel build warning(s): from drivers/staging/rtl8188eu/core/rtw_security.c:10: drivers/staging/rtl8188eu/core/rtw_security.c:478: warning: Function parameter or member 'p1k' not described in 'phase1' drivers/staging/rtl8188eu/core/rtw_security.c:478: warning: Function parameter or member 'tk' not described in 'phase1' drivers/staging/rtl8188eu/core/rtw_security.c:478: warning: Function parameter or member 'ta' not described in 'phase1' drivers/staging/rtl8188eu/core/rtw_security.c:517: warning: Function parameter or member 'rc4key' not described in 'phase2' drivers/staging/rtl8188eu/core/rtw_security.c:517: warning: Function parameter or member 'tk' not described in 'phase2' drivers/staging/rtl8188eu/core/rtw_security.c:517: warning: Function parameter or member 'p1k' not described in 'phase2' drivers/staging/rtl8723bs/core/rtw_security.c:1937: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Cc: Larry Finger Cc: Greg Kroah-Hartman Cc: Michael Straube Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-15-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_security.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c index 617f89842c81..4d0a23bf3f66 100644 --- a/drivers/staging/rtl8188eu/core/rtw_security.c +++ b/drivers/staging/rtl8188eu/core/rtw_security.c @@ -465,8 +465,9 @@ static const unsigned short Sbox1[2][256] = { /* Sbox for hash (can be in ROM) /** * phase1() - generate P1K, given TA, TK, IV32 - * @tk[]: temporal key [128 bits] - * @ta[]: transmitter's MAC address [ 48 bits] + * @p1k: placeholder for the returned phase 1 key + * @tk: temporal key [128 bits] + * @ta: transmitter's MAC address [ 48 bits] * @iv32: upper 32 bits of IV [ 32 bits] * * This function only needs to be called every 2**16 packets, @@ -498,8 +499,9 @@ static void phase1(u16 *p1k, const u8 *tk, const u8 *ta, u32 iv32) /** * phase2() - generate RC4KEY, given TK, P1K, IV16 - * @tk[]: Temporal key [128 bits] - * @p1k[]: Phase 1 output key [ 80 bits] + * @rc4key: Placeholder for the returned key + * @tk: Temporal key [128 bits] + * @p1k: Phase 1 output key [ 80 bits] * @iv16: low 16 bits of IV counter [ 16 bits] * * The value {TA, IV32, IV16} for Phase1/Phase2 must be unique From e06ede38f38046d2af2915c0c21939338a2c0596 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:47 +0100 Subject: [PATCH 012/744] staging: rtl8723bs: core: rtw_security: Demote non-conformant kernel-doc header Fixes the following W=1 kernel build warning(s): from drivers/staging/rtl8188eu/core/rtw_security.c:10: drivers/staging/rtl8188eu/core/rtw_security.c:478: warning: Function parameter or member 'p1k' not described in 'phase1' drivers/staging/rtl8188eu/core/rtw_security.c:478: warning: Function parameter or member 'tk' not described in 'phase1' drivers/staging/rtl8188eu/core/rtw_security.c:478: warning: Function parameter or member 'ta' not described in 'phase1' drivers/staging/rtl8188eu/core/rtw_security.c:517: warning: Function parameter or member 'rc4key' not described in 'phase2' drivers/staging/rtl8188eu/core/rtw_security.c:517: warning: Function parameter or member 'tk' not described in 'phase2' drivers/staging/rtl8188eu/core/rtw_security.c:517: warning: Function parameter or member 'p1k' not described in 'phase2' drivers/staging/rtl8723bs/core/rtw_security.c:1937: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-16-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_security.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c index 7823055ed32d..804168a37771 100644 --- a/drivers/staging/rtl8723bs/core/rtw_security.c +++ b/drivers/staging/rtl8723bs/core/rtw_security.c @@ -1933,7 +1933,7 @@ const u8 rcons[] = { /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ }; -/** +/* * Expand the cipher key into the encryption key schedule. * * @return the number of rounds for the given cipher key size. From f02eafb7f1b4a1f82ca020c544bab403ed813fdc Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:48 +0100 Subject: [PATCH 013/744] staging: rtl8723bs: core: rtw_sta_mgt: Remove unused variable 'psta' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/core/rtw_sta_mgt.c: In function ‘kfree_all_stainfo’: drivers/staging/rtl8723bs/core/rtw_sta_mgt.c:128:19: warning: variable ‘psta’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: Ross Schmidt Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-17-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c index 85663182b388..7b631a6b258a 100644 --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c @@ -119,7 +119,6 @@ void kfree_all_stainfo(struct sta_priv *pstapriv); void kfree_all_stainfo(struct sta_priv *pstapriv) { struct list_head *plist, *phead; - struct sta_info *psta = NULL; spin_lock_bh(&pstapriv->sta_hash_lock); @@ -127,7 +126,6 @@ void kfree_all_stainfo(struct sta_priv *pstapriv) plist = get_next(phead); while (phead != plist) { - psta = container_of(plist, struct sta_info, list); plist = get_next(plist); } From 324960df12a08583d4d194cc8c86974da8c4f1d0 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:49 +0100 Subject: [PATCH 014/744] staging: rtl8723bs: core: rtw_sta_mgt: Return error value directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/core/rtw_sta_mgt.c: In function ‘rtw_init_bcmc_stainfo’: drivers/staging/rtl8723bs/core/rtw_sta_mgt.c:512:6: warning: variable ‘res’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: Ross Schmidt Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-18-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c index 7b631a6b258a..233febc14598 100644 --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c @@ -497,7 +497,6 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) u32 rtw_init_bcmc_stainfo(struct adapter *padapter) { struct sta_info *psta; - u32 res = _SUCCESS; NDIS_802_11_MAC_ADDRESS bcast_addr = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; struct sta_priv *pstapriv = &padapter->stapriv; @@ -505,15 +504,12 @@ u32 rtw_init_bcmc_stainfo(struct adapter *padapter) psta = rtw_alloc_stainfo(pstapriv, bcast_addr); - if (!psta) { - res = _FAIL; - goto exit; - } + if (!psta) + return _FAIL; /* default broadcast & multicast use macid 1 */ psta->mac_id = 1; -exit: return _SUCCESS; } From efda125b79e8f4e907ed465b1d3eccee7c2dc960 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:50 +0100 Subject: [PATCH 015/744] staging: octeon: ethernet-tx: Fix formatting issue in function header Fixes the following W=1 kernel build warning(s): drivers/staging/octeon/ethernet-tx.c:507: warning: bad line: Cc: Greg Kroah-Hartman Cc: Thomas Gleixner Cc: Kees Cook Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-19-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/octeon/ethernet-tx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c index 9c71ad5af7b9..1ad94c5060b5 100644 --- a/drivers/staging/octeon/ethernet-tx.c +++ b/drivers/staging/octeon/ethernet-tx.c @@ -504,7 +504,6 @@ skip_xmit: * cvm_oct_xmit_pow - transmit a packet to the POW * @skb: Packet to send * @dev: Device info structure - * Returns Always returns zero */ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev) From c337ee00146aa5b1ad5509df796bb00ac51fd90e Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:51 +0100 Subject: [PATCH 016/744] staging: rtl8723bs: core: rtw_wlan_util: Remove unused variable 'start_seq' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/core/rtw_wlan_util.c: In function ‘process_addba_req’: drivers/staging/rtl8723bs/core/rtw_wlan_util.c:1774:11: warning: variable ‘start_seq’ set but not used [-Wunused-but-set-variable] from drivers/staging/rtl8188eu/core/rtw_wlan_util.c:12: Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-20-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_wlan_util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c index f9bd7c167da7..ce47ef4edea0 100644 --- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c @@ -1716,7 +1716,7 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_l void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr) { struct sta_info *psta; - u16 tid, start_seq, param; + u16 tid, param; struct recv_reorder_ctrl *preorder_ctrl; struct sta_priv *pstapriv = &padapter->stapriv; struct ADDBA_request *preq = (struct ADDBA_request *)paddba_req; @@ -1726,8 +1726,6 @@ void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr) psta = rtw_get_stainfo(pstapriv, addr); if (psta) { - start_seq = le16_to_cpu(preq->BA_starting_seqctrl) >> 4; - param = le16_to_cpu(preq->BA_para_set); tid = (param>>2)&0x0f; From 0b18e5fe6008c163f2d245724fc6db88158c3eb3 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:52 +0100 Subject: [PATCH 017/744] staging: rtl8712: rtl871x_mp_ioctl: Move a large data struct onto the heap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8712/rtl871x_mp_ioctl.c: In function ‘mp_start_test’: drivers/staging/rtl8712/rtl871x_mp_ioctl.c:204:1: warning: the frame size of 1136 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Larry Finger Cc: Florian Schilhabel Cc: Greg Kroah-Hartman Cc: Zhansaya Bagdauletkyzy Cc: Michael Straube Cc: WLAN FAE Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-21-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl871x_mp_ioctl.c | 29 +++++++++++++--------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c index 31414a960c9e..adbeb46770d7 100644 --- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c +++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c @@ -149,26 +149,30 @@ static int mp_start_test(struct _adapter *padapter) struct mp_priv *pmppriv = &padapter->mppriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct wlan_network *tgt_network = &pmlmepriv->cur_network; - struct wlan_bssid_ex bssid; + struct wlan_bssid_ex *bssid; struct sta_info *psta; unsigned long length; unsigned long irqL; int res = 0; + bssid = kzalloc(sizeof(*bssid), GFP_KERNEL); + if (!bssid) + return -ENOMEM; + /* 3 1. initialize a new struct wlan_bssid_ex */ - memcpy(bssid.MacAddress, pmppriv->network_macaddr, ETH_ALEN); - bssid.Ssid.SsidLength = 16; - memcpy(bssid.Ssid.Ssid, (unsigned char *)"mp_pseudo_adhoc", - bssid.Ssid.SsidLength); - bssid.InfrastructureMode = Ndis802_11IBSS; - bssid.NetworkTypeInUse = Ndis802_11DS; - bssid.IELength = 0; - length = r8712_get_wlan_bssid_ex_sz(&bssid); + memcpy(bssid->MacAddress, pmppriv->network_macaddr, ETH_ALEN); + bssid->Ssid.SsidLength = 16; + memcpy(bssid->Ssid.Ssid, (unsigned char *)"mp_pseudo_adhoc", + bssid->Ssid.SsidLength); + bssid->InfrastructureMode = Ndis802_11IBSS; + bssid->NetworkTypeInUse = Ndis802_11DS; + bssid->IELength = 0; + length = r8712_get_wlan_bssid_ex_sz(bssid); if (length % 4) { /*round up to multiple of 4 bytes.*/ - bssid.Length = ((length >> 2) + 1) << 2; + bssid->Length = ((length >> 2) + 1) << 2; } else { - bssid.Length = length; + bssid->Length = length; } spin_lock_irqsave(&pmlmepriv->lock, irqL); if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) @@ -185,7 +189,7 @@ static int mp_start_test(struct _adapter *padapter) tgt_network->network.MacAddress); if (psta) r8712_free_stainfo(padapter, psta); - psta = r8712_alloc_stainfo(&padapter->stapriv, bssid.MacAddress); + psta = r8712_alloc_stainfo(&padapter->stapriv, bssid->MacAddress); if (!psta) { res = -ENOMEM; goto end_of_mp_start_test; @@ -200,6 +204,7 @@ static int mp_start_test(struct _adapter *padapter) set_fwstate(pmlmepriv, _FW_LINKED); end_of_mp_start_test: spin_unlock_irqrestore(&pmlmepriv->lock, irqL); + kfree(bssid); return res; } From d57d7ac576394bd60024cc2354201f921cb498dc Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:53 +0100 Subject: [PATCH 018/744] staging: iio: frequency: ad9834: Provide missing description for 'devid' Also demote kernel-doc abuses Fixes the following W=1 kernel build warning(s): drivers/staging/iio/frequency/ad9834.c:87: warning: Function parameter or member 'devid' not described in 'ad9834_state' drivers/staging/iio/frequency/ad9834.c:93: warning: cannot understand function prototype: 'enum ad9834_supported_device_ids ' drivers/staging/iio/frequency/ad9834.c:320: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Cc: Lars-Peter Clausen Cc: Michael Hennerich Cc: Jonathan Cameron Cc: Greg Kroah-Hartman Cc: linux-iio@vger.kernel.org Cc: linux-staging@lists.linux.dev Acked-by: Jonathan Cameron Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-22-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/frequency/ad9834.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/iio/frequency/ad9834.c b/drivers/staging/iio/frequency/ad9834.c index 60a3ae5587b9..94b131ef8a22 100644 --- a/drivers/staging/iio/frequency/ad9834.c +++ b/drivers/staging/iio/frequency/ad9834.c @@ -58,6 +58,7 @@ * @spi: spi_device * @mclk: external master clock * @control: cached control word + * @devid: device id * @xfer: default spi transfer * @msg: default spi message * @freq_xfer: tuning word spi transfer @@ -86,7 +87,7 @@ struct ad9834_state { __be16 freq_data[2]; }; -/** +/* * ad9834_supported_device_ids: */ @@ -316,7 +317,7 @@ ssize_t ad9834_show_out1_wavetype_available(struct device *dev, static IIO_DEVICE_ATTR(out_altvoltage0_out1_wavetype_available, 0444, ad9834_show_out1_wavetype_available, NULL, 0); -/** +/* * see dds.h for further information */ From e950dd6bb36fe3274d1678391e7372ecaf291147 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:54 +0100 Subject: [PATCH 019/744] staging: nvec: Fix a bunch of kernel-doc issues Fixes the following W=1 kernel build warning(s): drivers/staging/nvec/nvec.c:109: warning: Function parameter or member 'events' not described in 'nvec_register_notifier' drivers/staging/nvec/nvec.c:136: warning: Function parameter or member 'nb' not described in 'nvec_status_notifier' drivers/staging/nvec/nvec.c:136: warning: Function parameter or member 'event_type' not described in 'nvec_status_notifier' drivers/staging/nvec/nvec.c:136: warning: Function parameter or member 'data' not described in 'nvec_status_notifier' drivers/staging/nvec/nvec.c:358: warning: Function parameter or member 'ev' not described in 'nvec_event_mask' drivers/staging/nvec/nvec.c:358: warning: Function parameter or member 'mask' not described in 'nvec_event_mask' Cc: Marc Dietrich Cc: Greg Kroah-Hartman Cc: Philipp Zabel Cc: Kernel Team Cc: Pierre-Hugues Husson Cc: Ilya Petrov Cc: Andres Klode Cc: ac100@lists.launchpad.net Cc: linux-tegra@vger.kernel.org Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-23-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/nvec/nvec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index a80996b2f5ce..990d15c31a13 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -99,6 +99,7 @@ static const struct mfd_cell nvec_devices[] = { * nvec_register_notifier - Register a notifier with nvec * @nvec: A &struct nvec_chip * @nb: The notifier block to register + * @events: Unused * * Registers a notifier with @nvec. The notifier will be added to an atomic * notifier chain that is called for all received messages except those that @@ -125,7 +126,7 @@ int nvec_unregister_notifier(struct nvec_chip *nvec, struct notifier_block *nb) } EXPORT_SYMBOL_GPL(nvec_unregister_notifier); -/** +/* * nvec_status_notifier - The final notifier * * Prints a message about control events not handled in the notifier @@ -343,8 +344,8 @@ static void nvec_toggle_global_events(struct nvec_chip *nvec, bool state) /** * nvec_event_mask - fill the command string with event bitfield - * ev: points to event command string - * mask: bit to insert into the event mask + * @ev: points to event command string + * @mask: bit to insert into the event mask * * Configure event command expects a 32 bit bitfield which describes * which events to enable. The bitfield has the following structure From fbd3996990b6bb2140b4dede897f23e36dc51c4a Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:55 +0100 Subject: [PATCH 020/744] staging: ks7010: ks_hostif: Remove a bunch of unused variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add comments to preserve documentation. Fixes the following W=1 kernel build warning(s): drivers/staging/ks7010/ks_hostif.c: In function ‘hostif_mib_get_confirm’: drivers/staging/ks7010/ks_hostif.c:528:6: warning: variable ‘mib_val_type’ set but not used [-Wunused-but-set-variable] drivers/staging/ks7010/ks_hostif.c:527:6: warning: variable ‘mib_val_size’ set but not used [-Wunused-but-set-variable] drivers/staging/ks7010/ks_hostif.c: In function ‘hostif_infrastructure_set_confirm’: drivers/staging/ks7010/ks_hostif.c:849:6: warning: variable ‘result_code’ set but not used [-Wunused-but-set-variable] drivers/staging/ks7010/ks_hostif.c: In function ‘hostif_phy_information_confirm’: drivers/staging/ks7010/ks_hostif.c:929:19: warning: variable ‘noise’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-24-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ks7010/ks_hostif.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c index 8bc3b7d8d3d5..eaa70893224a 100644 --- a/drivers/staging/ks7010/ks_hostif.c +++ b/drivers/staging/ks7010/ks_hostif.c @@ -524,13 +524,11 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv) struct net_device *dev = priv->net_dev; u32 mib_status; u32 mib_attribute; - u16 mib_val_size; - u16 mib_val_type; mib_status = get_dword(priv); mib_attribute = get_dword(priv); - mib_val_size = get_word(priv); - mib_val_type = get_word(priv); + get_word(priv); /* mib_val_size */ + get_word(priv); /* mib_val_type */ if (mib_status) { netdev_err(priv->net_dev, "attribute=%08X, status=%08X\n", @@ -846,9 +844,7 @@ void hostif_ps_adhoc_set_confirm(struct ks_wlan_private *priv) static void hostif_infrastructure_set_confirm(struct ks_wlan_private *priv) { - u16 result_code; - - result_code = get_word(priv); + get_word(priv); /* result_code */ priv->infra_status = 1; /* infrastructure mode set */ hostif_sme_enqueue(priv, SME_MODE_SET_CONFIRM); } @@ -926,14 +922,14 @@ static void hostif_phy_information_confirm(struct ks_wlan_private *priv) { struct iw_statistics *wstats = &priv->wstats; - u8 rssi, signal, noise; + u8 rssi, signal; u8 link_speed; u32 transmitted_frame_count, received_fragment_count; u32 failed_count, fcs_error_count; rssi = get_byte(priv); signal = get_byte(priv); - noise = get_byte(priv); + get_byte(priv); /* noise */ link_speed = get_byte(priv); transmitted_frame_count = get_dword(priv); received_fragment_count = get_dword(priv); From 204d839bbe077a672abf591ba98f186872fc21f1 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:56 +0100 Subject: [PATCH 021/744] staging: fwserial: Demote a whole host of kernel-doc abuses Fixes the following W=1 kernel build warning(s): drivers/staging/fwserial/fwserial.c:52: warning: Function parameter or member 'fwserial_list' not described in 'LIST_HEAD' drivers/staging/fwserial/fwserial.c:52: warning: expecting prototype for fwserial_list(). Prototype was for LIST_HEAD() instead drivers/staging/fwserial/fwserial.c:62: warning: cannot understand function prototype: 'struct fwtty_port *port_table[MAX_TOTAL_PORTS]; ' drivers/staging/fwserial/fwserial.c:295: warning: Function parameter or member 'port' not described in 'fwtty_update_port_status' drivers/staging/fwserial/fwserial.c:295: warning: Function parameter or member 'status' not described in 'fwtty_update_port_status' drivers/staging/fwserial/fwserial.c:388: warning: Function parameter or member 'port' not described in '__fwtty_port_line_status' drivers/staging/fwserial/fwserial.c:412: warning: Function parameter or member 'port' not described in '__fwtty_write_port_status' drivers/staging/fwserial/fwserial.c:433: warning: Function parameter or member 'port' not described in 'fwtty_write_port_status' drivers/staging/fwserial/fwserial.c:486: warning: Function parameter or member 'work' not described in 'fwtty_do_hangup' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'card' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'request' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'tcode' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'destination' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'source' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'generation' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'addr' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'data' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'len' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Function parameter or member 'callback_data' not described in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:605: warning: Excess function parameter 'parameters' description in 'fwtty_port_handler' drivers/staging/fwserial/fwserial.c:670: warning: Function parameter or member 'card' not described in 'fwtty_tx_complete' drivers/staging/fwserial/fwserial.c:670: warning: Function parameter or member 'rcode' not described in 'fwtty_tx_complete' drivers/staging/fwserial/fwserial.c:670: warning: Function parameter or member 'txn' not described in 'fwtty_tx_complete' drivers/staging/fwserial/fwserial.c:914: warning: Function parameter or member 'tty_port' not described in 'fwtty_port_carrier_raised' drivers/staging/fwserial/fwserial.c:1021: warning: Function parameter or member 'tty_port' not described in 'fwtty_port_shutdown' drivers/staging/fwserial/fwserial.c:1312: warning: Function parameter or member 'tty' not described in 'fwtty_break_ctl' drivers/staging/fwserial/fwserial.c:1312: warning: Function parameter or member 'state' not described in 'fwtty_break_ctl' drivers/staging/fwserial/fwserial.c:1681: warning: Function parameter or member 'peer' not described in 'fwserial_claim_port' drivers/staging/fwserial/fwserial.c:1681: warning: Function parameter or member 'index' not described in 'fwserial_claim_port' drivers/staging/fwserial/fwserial.c:1708: warning: Function parameter or member 'peer' not described in 'fwserial_find_port' drivers/staging/fwserial/fwserial.c:1775: warning: Function parameter or member 'peer' not described in 'fwserial_connect_peer' drivers/staging/fwserial/fwserial.c:1844: warning: Function parameter or member 'driver' not described in 'fwserial_close_port' drivers/staging/fwserial/fwserial.c:1844: warning: Function parameter or member 'port' not described in 'fwserial_close_port' drivers/staging/fwserial/fwserial.c:1911: warning: Function parameter or member 'card' not described in '__fwserial_peer_by_node_id' drivers/staging/fwserial/fwserial.c:1911: warning: Function parameter or member 'generation' not described in '__fwserial_peer_by_node_id' drivers/staging/fwserial/fwserial.c:1911: warning: Function parameter or member 'id' not described in '__fwserial_peer_by_node_id' drivers/staging/fwserial/fwserial.c:2090: warning: Function parameter or member 'peer' not described in 'fwserial_remove_peer' drivers/staging/fwserial/fwserial.c:2321: warning: Function parameter or member 'unit' not described in 'fwserial_probe' drivers/staging/fwserial/fwserial.c:2321: warning: Function parameter or member 'id' not described in 'fwserial_probe' drivers/staging/fwserial/fwserial.c:2344: warning: Function parameter or member 'unit' not described in 'fwserial_remove' drivers/staging/fwserial/fwserial.c:2382: warning: Function parameter or member 'unit' not described in 'fwserial_update' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'card' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'request' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'tcode' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'destination' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'source' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'generation' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'addr' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'data' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'len' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Function parameter or member 'callback_data' not described in 'fwserial_mgmt_handler' drivers/staging/fwserial/fwserial.c:2717: warning: Excess function parameter 'parameters' description in 'fwserial_mgmt_handler' Cc: Greg Kroah-Hartman Cc: Peter Hurley Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-25-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/fwserial/fwserial.c | 46 ++++++++++++++--------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 1ee6382cafc4..9ade8e7a68ba 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -45,14 +45,14 @@ module_param_named(loop, create_loop_dev, bool, 0644); */ #define WAKEUP_CHARS 256 -/** +/* * fwserial_list: list of every fw_serial created for each fw_card * See discussion in fwserial_probe. */ static LIST_HEAD(fwserial_list); static DEFINE_MUTEX(fwserial_list_mutex); -/** +/* * port_table: array of tty ports allocated to each fw_card * * tty ports are allocated during probe when an fw_serial is first @@ -284,7 +284,7 @@ static void fwtty_restart_tx(struct fwtty_port *port) spin_unlock_bh(&port->lock); } -/** +/* * fwtty_update_port_status - decodes & dispatches line status changes * * Note: in loopback, the port->lock is being held. Only use functions that @@ -375,7 +375,7 @@ static void fwtty_update_port_status(struct fwtty_port *port, wake_up_interruptible(&port->port.delta_msr_wait); } -/** +/* * __fwtty_port_line_status - generate 'line status' for indicated port * * This function returns a remote 'MSR' state based on the local 'MCR' state, @@ -403,7 +403,7 @@ static unsigned int __fwtty_port_line_status(struct fwtty_port *port) return status; } -/** +/* * __fwtty_write_port_status - send the port line status to peer * * Note: caller must be holding the port lock. @@ -426,7 +426,7 @@ static int __fwtty_write_port_status(struct fwtty_port *port) return err; } -/** +/* * fwtty_write_port_status - same as above but locked by port lock */ static int fwtty_write_port_status(struct fwtty_port *port) @@ -462,7 +462,7 @@ static void fwtty_throttle_port(struct fwtty_port *port) tty_kref_put(tty); } -/** +/* * fwtty_do_hangup - wait for ldisc to deliver all pending rx; only then hangup * * When the remote has finished tx, and all in-flight rx has been received and @@ -589,9 +589,8 @@ out: return err; } -/** +/* * fwtty_port_handler - bus address handler for port reads/writes - * @parameters: fw_address_callback_t as specified by firewire core interface * * This handler is responsible for handling inbound read/write dma from remotes. */ @@ -656,7 +655,7 @@ respond: fw_send_response(card, request, rcode); } -/** +/* * fwtty_tx_complete - callback for tx dma * @data: ignored, has no meaning for write txns * @length: ignored, has no meaning for write txns @@ -904,7 +903,7 @@ static void fwtty_port_dtr_rts(struct tty_port *tty_port, int on) spin_unlock_bh(&port->lock); } -/** +/* * fwtty_port_carrier_raised: required tty_port operation * * This port operation is polled after a tty has been opened and is waiting for @@ -1011,7 +1010,7 @@ static int fwtty_port_activate(struct tty_port *tty_port, return 0; } -/** +/* * fwtty_port_shutdown * * Note: the tty port core ensures this is not the console and @@ -1297,7 +1296,7 @@ static void fwtty_set_termios(struct tty_struct *tty, struct ktermios *old) } } -/** +/* * fwtty_break_ctl - start/stop sending breaks * * Signals the remote to start or stop generating simulated breaks. @@ -1669,7 +1668,7 @@ static inline int fwserial_send_mgmt_sync(struct fwtty_peer *peer, return rcode; } -/** +/* * fwserial_claim_port - attempt to claim port @ index for peer * * Returns ptr to claimed port or error code (as ERR_PTR()) @@ -1697,7 +1696,7 @@ static struct fwtty_port *fwserial_claim_port(struct fwtty_peer *peer, return port; } -/** +/* * fwserial_find_port - find avail port and claim for peer * * Returns ptr to claimed port or NULL if none avail @@ -1764,7 +1763,7 @@ static void fwserial_plug_timeout(struct timer_list *t) fwserial_release_port(port, false); } -/** +/* * fwserial_connect_peer - initiate virtual cable with peer * * Returns 0 if VIRT_CABLE_PLUG request was successfully sent, @@ -1829,7 +1828,7 @@ free_pkt: return err; } -/** +/* * fwserial_close_port - * HUP the tty (if the tty exists) and unregister the tty device. * Only used by the unit driver upon unit removal to disconnect and @@ -1893,7 +1892,7 @@ static struct fw_serial *__fwserial_lookup_rcu(struct fw_card *card) return NULL; } -/** +/* * __fwserial_peer_by_node_id - finds a peer matching the given generation + id * * If a matching peer could not be found for the specified generation/node id, @@ -2076,7 +2075,7 @@ static int fwserial_add_peer(struct fw_serial *serial, struct fw_unit *unit) return 0; } -/** +/* * fwserial_remove_peer - remove a 'serial' unit device as a 'peer' * * Remove a 'peer' from its list of peers. This function is only @@ -2279,7 +2278,7 @@ free_ports: return err; } -/** +/* * fwserial_probe: bus probe function for firewire 'serial' unit devices * * A 'serial' unit device is created and probed as a result of: @@ -2331,7 +2330,7 @@ static int fwserial_probe(struct fw_unit *unit, return err; } -/** +/* * fwserial_remove: bus removal function for firewire 'serial' unit devices * * The corresponding 'peer' for this unit device is removed from the list of @@ -2363,7 +2362,7 @@ static void fwserial_remove(struct fw_unit *unit) mutex_unlock(&fwserial_list_mutex); } -/** +/* * fwserial_update: bus update function for 'firewire' serial unit devices * * Updates the new node_id and bus generation for this peer. Note that locking @@ -2699,9 +2698,8 @@ static int fwserial_parse_mgmt_write(struct fwtty_peer *peer, return rcode; } -/** +/* * fwserial_mgmt_handler: bus address handler for mgmt requests - * @parameters: fw_address_callback_t as specified by firewire core interface * * This handler is responsible for handling virtual cable requests from remotes * for all cards. From d12dd1e0e3b96b1a2c9ffdb0fa9c115aeb82b569 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:57 +0100 Subject: [PATCH 022/744] staging: sm750fb: sm750_accel: Provide description for 'accel' and fix function naming Fixes the following W=1 kernel build warning(s): drivers/staging/sm750fb/sm750_accel.c:155: warning: Function parameter or member 'accel' not described in 'sm750_hw_copyarea' drivers/staging/sm750fb/sm750_accel.c:155: warning: expecting prototype for sm750_hm_copyarea(). Prototype was for sm750_hw_copyarea() instead drivers/staging/sm750fb/sm750_accel.c:321: warning: Function parameter or member 'accel' not described in 'sm750_hw_imageblit' Cc: Sudip Mukherjee Cc: Teddy Wang Cc: Greg Kroah-Hartman Cc: linux-fbdev@vger.kernel.org Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-26-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750_accel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 8faa601c700b..24b9077a634a 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -131,7 +131,8 @@ int sm750_hw_fillrect(struct lynx_accel *accel, } /** - * sm750_hm_copyarea + * sm750_hw_copyarea + * @accel: Acceleration device data * @sBase: Address of source: offset in frame buffer * @sPitch: Pitch value of source surface in BYTE * @sx: Starting x coordinate of source surface @@ -298,6 +299,7 @@ static unsigned int deGetTransparency(struct lynx_accel *accel) /** * sm750_hw_imageblit + * @accel: Acceleration device data * @pSrcbuf: pointer to start of source buffer in system memory * @srcDelta: Pitch value (in bytes) of the source buffer, +ive means top down * and -ive mean button up From 2f61c6649f470b094f32586872e95648410e38f0 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:58 +0100 Subject: [PATCH 023/744] staging: most: net: Fix some kernel-doc formatting issues Fixes the following W=1 kernel build warning(s): drivers/staging/most/net/net.c:548: warning: Function parameter or member 'iface' not described in 'on_netinfo' drivers/staging/most/net/net.c:548: warning: Function parameter or member 'link_stat' not described in 'on_netinfo' drivers/staging/most/net/net.c:548: warning: Function parameter or member 'mac_addr' not described in 'on_netinfo' Cc: Greg Kroah-Hartman Cc: Andrey Shvetsov Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-27-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/net/net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c index f125bb6da406..a5fd14246046 100644 --- a/drivers/staging/most/net/net.c +++ b/drivers/staging/most/net/net.c @@ -539,9 +539,9 @@ static void __exit most_net_exit(void) /** * on_netinfo - callback for HDM to be informed about HW's MAC - * @param iface - most interface instance - * @param link_stat - link status - * @param mac_addr - MAC address + * @iface: most interface instance + * @link_stat: link status + * @mac_addr: MAC address */ static void on_netinfo(struct most_interface *iface, unsigned char link_stat, unsigned char *mac_addr) From b259c9b2380a1a4150cd2bdda90076d1e3fbd386 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:10:59 +0100 Subject: [PATCH 024/744] staging: vt6655: upc: Suppress set but not used warning in macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable is used in the function using the macro. Fixes the following W=1 kernel build warning(s): drivers/staging/vt6655/upc.h:45:16: warning: variable ‘byData’ set but not used [-Wunused-but-set-variable] Cc: Forest Bond Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-28-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vt6655/upc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vt6655/upc.h b/drivers/staging/vt6655/upc.h index e086ec6e77f7..8608693ae9c3 100644 --- a/drivers/staging/vt6655/upc.h +++ b/drivers/staging/vt6655/upc.h @@ -42,7 +42,7 @@ #define PCAvDelayByIO(uDelayUnit) \ do { \ - unsigned char byData; \ + unsigned char __maybe_unused byData; \ unsigned long ii; \ \ if (uDelayUnit <= 50) { \ From 061e390b7c87fa719b95d1dae258dc3f6c3023c3 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:00 +0100 Subject: [PATCH 025/744] staging: rtl8192u: ieee80211_softmac: Move a large data struct onto the heap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c: In function ‘ieee80211_rx_frame_softmac’: drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2009:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Greg Kroah-Hartman Cc: Romain Perier Cc: Allen Pais Cc: Andrea Merello Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-29-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 25ea8e1b6b65..965fa1fb5e1b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -1911,8 +1911,11 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATED && ieee->iw_mode == IW_MODE_INFRA) { - struct ieee80211_network network_resp; - struct ieee80211_network *network = &network_resp; + struct ieee80211_network *network; + + network = kzalloc(sizeof(*network), GFP_KERNEL); + if (!network) + return -ENOMEM; errcode = assoc_parse(ieee, skb, &aid); if (!errcode) { @@ -1923,7 +1926,6 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, /* Let the register setting defaultly with Legacy station */ if (ieee->qos_support) { assoc_resp = (struct ieee80211_assoc_response_frame *)skb->data; - memset(network, 0, sizeof(*network)); if (ieee80211_parse_info_param(ieee, assoc_resp->info_element,\ rx_stats->len - sizeof(*assoc_resp), \ network, rx_stats)) { @@ -1949,6 +1951,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, else ieee80211_associate_abort(ieee); } + kfree(network); } break; From 6f4d367f3356661028f785db9c4f96491da5f18b Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:01 +0100 Subject: [PATCH 026/744] staging: most: dim2: Provide missing descriptions and fix doc-rot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also demote merely half-complete header. Fixes the following W=1 kernel build warning(s): drivers/staging/most/dim2/dim2.c:69: warning: Function parameter or member 'name' not described in 'hdm_channel' drivers/staging/most/dim2/dim2.c:69: warning: Function parameter or member 'reset_dbr_size' not described in 'hdm_channel' drivers/staging/most/dim2/dim2.c:104: warning: Function parameter or member 'dev' not described in 'dim2_hdm' drivers/staging/most/dim2/dim2.c:104: warning: Function parameter or member 'name' not described in 'dim2_hdm' drivers/staging/most/dim2/dim2.c:104: warning: Function parameter or member 'clk_speed' not described in 'dim2_hdm' drivers/staging/most/dim2/dim2.c:104: warning: Function parameter or member 'clk' not described in 'dim2_hdm' drivers/staging/most/dim2/dim2.c:104: warning: Function parameter or member 'clk_pll' not described in 'dim2_hdm' drivers/staging/most/dim2/dim2.c:104: warning: Function parameter or member 'bus' not described in 'dim2_hdm' drivers/staging/most/dim2/dim2.c:104: warning: Function parameter or member 'on_netinfo' not described in 'dim2_hdm' drivers/staging/most/dim2/dim2.c:104: warning: Function parameter or member 'disable_platform' not described in 'dim2_hdm' drivers/staging/most/dim2/dim2.c:440: warning: Function parameter or member 'most_iface' not described in 'configure_channel' drivers/staging/most/dim2/dim2.c:440: warning: Function parameter or member 'ch_idx' not described in 'configure_channel' drivers/staging/most/dim2/dim2.c:440: warning: Function parameter or member 'ccfg' not described in 'configure_channel' drivers/staging/most/dim2/dim2.c:440: warning: Excess function parameter 'iface' description in 'configure_channel' drivers/staging/most/dim2/dim2.c:440: warning: Excess function parameter 'channel' description in 'configure_channel' drivers/staging/most/dim2/dim2.c:440: warning: Excess function parameter 'channel_config' description in 'configure_channel' drivers/staging/most/dim2/dim2.c:558: warning: Function parameter or member 'most_iface' not described in 'enqueue' drivers/staging/most/dim2/dim2.c:558: warning: Function parameter or member 'ch_idx' not described in 'enqueue' drivers/staging/most/dim2/dim2.c:558: warning: Excess function parameter 'iface' description in 'enqueue' drivers/staging/most/dim2/dim2.c:558: warning: Excess function parameter 'channel' description in 'enqueue' drivers/staging/most/dim2/dim2.c:591: warning: Function parameter or member 'most_iface' not described in 'request_netinfo' drivers/staging/most/dim2/dim2.c:591: warning: Function parameter or member 'ch_idx' not described in 'request_netinfo' drivers/staging/most/dim2/dim2.c:591: warning: Function parameter or member 'on_netinfo' not described in 'request_netinfo' drivers/staging/most/dim2/dim2.c:591: warning: Excess function parameter 'iface' description in 'request_netinfo' drivers/staging/most/dim2/dim2.c:591: warning: Excess function parameter 'channel_id' description in 'request_netinfo' drivers/staging/most/dim2/dim2.c:631: warning: Function parameter or member 'most_iface' not described in 'poison_channel' drivers/staging/most/dim2/dim2.c:631: warning: Function parameter or member 'ch_idx' not described in 'poison_channel' drivers/staging/most/dim2/dim2.c:631: warning: Excess function parameter 'iface' description in 'poison_channel' drivers/staging/most/dim2/dim2.c:631: warning: Excess function parameter 'channel_id' description in 'poison_channel' Cc: Greg Kroah-Hartman Cc: "Nícolas F. R. A. Prado" Cc: Andrey Shvetsov Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-30-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/dim2/dim2.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/staging/most/dim2/dim2.c b/drivers/staging/most/dim2/dim2.c index b34e3c130f53..093ef9a2b291 100644 --- a/drivers/staging/most/dim2/dim2.c +++ b/drivers/staging/most/dim2/dim2.c @@ -50,8 +50,10 @@ static DECLARE_TASKLET_OLD(dim2_tasklet, dim2_tasklet_fn); /** * struct hdm_channel - private structure to keep channel specific data + * @name: channel name * @is_initialized: identifier to know whether the channel is initialized * @ch: HAL specific channel data + * @reset_dbr_size: reset DBR data buffer size * @pending_list: list to keep MBO's before starting transfer * @started_list: list to keep MBO's after starting transfer * @direction: channel direction (TX or RX) @@ -68,7 +70,7 @@ struct hdm_channel { enum most_channel_data_type data_type; }; -/** +/* * struct dim2_hdm - private structure to keep interface specific data * @hch: an array of channel specific data * @most_iface: most interface structure @@ -428,9 +430,9 @@ static void complete_all_mbos(struct list_head *head) /** * configure_channel - initialize a channel - * @iface: interface the channel belongs to - * @channel: channel to be configured - * @channel_config: structure that holds the configuration information + * @most_iface: interface the channel belongs to + * @ch_idx: channel index to be configured + * @ccfg: structure that holds the configuration information * * Receives configuration information from mostcore and initialize * the corresponding channel. Return 0 on success, negative on failure. @@ -546,8 +548,8 @@ static int configure_channel(struct most_interface *most_iface, int ch_idx, /** * enqueue - enqueue a buffer for data transfer - * @iface: intended interface - * @channel: ID of the channel the buffer is intended for + * @most_iface: intended interface + * @ch_idx: ID of the channel the buffer is intended for * @mbo: pointer to the buffer object * * Push the buffer into pending_list and try to transfer one buffer from @@ -579,8 +581,9 @@ static int enqueue(struct most_interface *most_iface, int ch_idx, /** * request_netinfo - triggers retrieving of network info - * @iface: pointer to the interface - * @channel_id: corresponding channel ID + * @most_iface: pointer to the interface + * @ch_idx: corresponding channel ID + * @on_netinfo: call-back used to deliver network status to mostcore * * Send a command to INIC which triggers retrieving of network info by means of * "Message exchange over MDP/MEP". Return 0 on success, negative on failure. @@ -621,8 +624,8 @@ static void request_netinfo(struct most_interface *most_iface, int ch_idx, /** * poison_channel - poison buffers of a channel - * @iface: pointer to the interface the channel to be poisoned belongs to - * @channel_id: corresponding channel ID + * @most_iface: pointer to the interface the channel to be poisoned belongs to + * @ch_idx: corresponding channel ID * * Destroy a channel and complete all the buffers in both started_list & * pending_list. Return 0 on success, negative on failure. From 80566ab54229c40cf871a37c41fbc19dd3744a05 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:02 +0100 Subject: [PATCH 027/744] staging: rtl8723bs: core: rtw_ieee80211: Remove seemingly pointless copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/core/rtw_ieee80211.c: In function ‘rtw_ies_remove_ie’: drivers/staging/rtl8723bs/core/rtw_ieee80211.c:259:1: warning: the frame size of 1048 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-31-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c index ae057eefeeb3..d8513acf4911 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c @@ -239,12 +239,10 @@ int rtw_ies_remove_ie(u8 *ies, uint *ies_len, uint offset, u8 eid, u8 *oui, u8 o while (1) { target_ie = rtw_get_ie_ex(start, search_len, eid, oui, oui_len, NULL, &target_ielen); if (target_ie && target_ielen) { - u8 buf[MAX_IE_SZ] = {0}; u8 *remain_ies = target_ie + target_ielen; uint remain_len = search_len - (remain_ies - start); - memcpy(buf, remain_ies, remain_len); - memcpy(target_ie, buf, remain_len); + memcpy(target_ie, remain_ies, remain_len); *ies_len = *ies_len - target_ielen; ret = _SUCCESS; From 1658384fc3d3caa2632ef90a9789b77c30e2462c Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:03 +0100 Subject: [PATCH 028/744] staging: rtl8723bs: core: rtw_mlme: 'retry' is only used if REJOIN is set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/core/rtw_mlme.c: In function ‘rtw_joinbss_event_prehandle’: drivers/staging/rtl8723bs/core/rtw_mlme.c:1192:12: warning: variable ‘retry’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: Fabio Aiuto Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-32-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index a16eabdeafd1..b9bd1e8a3f07 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -1189,7 +1189,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net /* define REJOIN */ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf) { - static u8 retry; + static u8 __maybe_unused retry; struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL; struct sta_priv *pstapriv = &adapter->stapriv; struct mlme_priv *pmlmepriv = &(adapter->mlmepriv); From f74afcfd9438272ad292e040ffc481f227c76da2 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:05 +0100 Subject: [PATCH 029/744] staging: most: i2c: Fix a little doc-rot Fixes the following W=1 kernel build warning(s): drivers/staging/most/i2c/i2c.c:66: warning: Function parameter or member 'most_iface' not described in 'configure_channel' drivers/staging/most/i2c/i2c.c:66: warning: Function parameter or member 'ch_idx' not described in 'configure_channel' drivers/staging/most/i2c/i2c.c:66: warning: Excess function parameter 'iface' description in 'configure_channel' drivers/staging/most/i2c/i2c.c:66: warning: Excess function parameter 'channel' description in 'configure_channel' drivers/staging/most/i2c/i2c.c:121: warning: Function parameter or member 'most_iface' not described in 'enqueue' drivers/staging/most/i2c/i2c.c:121: warning: Function parameter or member 'ch_idx' not described in 'enqueue' drivers/staging/most/i2c/i2c.c:121: warning: Excess function parameter 'iface' description in 'enqueue' drivers/staging/most/i2c/i2c.c:121: warning: Excess function parameter 'channel' description in 'enqueue' drivers/staging/most/i2c/i2c.c:166: warning: Function parameter or member 'most_iface' not described in 'poison_channel' drivers/staging/most/i2c/i2c.c:166: warning: Function parameter or member 'ch_idx' not described in 'poison_channel' drivers/staging/most/i2c/i2c.c:166: warning: Excess function parameter 'iface' description in 'poison_channel' drivers/staging/most/i2c/i2c.c:166: warning: Excess function parameter 'channel_id' description in 'poison_channel' Cc: Greg Kroah-Hartman Cc: Andrey Shvetsov Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-34-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/i2c/i2c.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/most/i2c/i2c.c b/drivers/staging/most/i2c/i2c.c index 893a8babdb2f..7042f10887bb 100644 --- a/drivers/staging/most/i2c/i2c.c +++ b/drivers/staging/most/i2c/i2c.c @@ -51,8 +51,8 @@ static void pending_rx_work(struct work_struct *); /** * configure_channel - called from MOST core to configure a channel - * @iface: interface the channel belongs to - * @channel: channel to be configured + * @most_iface: interface the channel belongs to + * @ch_idx: channel to be configured * @channel_config: structure that holds the configuration information * * Return 0 on success, negative on failure. @@ -107,8 +107,8 @@ static int configure_channel(struct most_interface *most_iface, /** * enqueue - called from MOST core to enqueue a buffer for data transfer - * @iface: intended interface - * @channel: ID of the channel the buffer is intended for + * @most_iface: intended interface + * @ch_idx: ID of the channel the buffer is intended for * @mbo: pointer to the buffer object * * Return 0 on success, negative on failure. @@ -153,8 +153,8 @@ static int enqueue(struct most_interface *most_iface, /** * poison_channel - called from MOST core to poison buffers of a channel - * @iface: pointer to the interface the channel to be poisoned belongs to - * @channel_id: corresponding channel ID + * @most_iface: pointer to the interface the channel to be poisoned belongs to + * @ch_idx: corresponding channel ID * * Return 0 on success, negative on failure. * From 7af9b4444fab2e1579202ea19b3faaf962ef437b Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:06 +0100 Subject: [PATCH 030/744] staging: most: dim2: hal: Fix one kernel-doc header and demote two non-conforming ones Fixes the following W=1 kernel build warning(s): drivers/staging/most/dim2/hal.c:99: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst drivers/staging/most/dim2/hal.c:788: warning: Function parameter or member 'buf_size' not described in 'dim_norm_isoc_buffer_size' drivers/staging/most/dim2/hal.c:788: warning: Function parameter or member 'packet_length' not described in 'dim_norm_isoc_buffer_size' drivers/staging/most/dim2/hal.c:788: warning: expecting prototype for Retrieves maximal possible correct buffer size for isochronous data type(). Prototype was for dim_norm_isoc_buffer_size() instead drivers/staging/most/dim2/hal.c:802: warning: Function parameter or member 'buf_size' not described in 'dim_norm_sync_buffer_size' drivers/staging/most/dim2/hal.c:802: warning: Function parameter or member 'bytes_per_frame' not described in 'dim_norm_sync_buffer_size' drivers/staging/most/dim2/hal.c:802: warning: expecting prototype for Retrieves maximal possible correct buffer size for synchronous data type(). Prototype was for dim_norm_sync_buffer_size() instead Cc: Greg Kroah-Hartman Cc: Andrey Shvetsov Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-35-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/dim2/hal.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/most/dim2/hal.c b/drivers/staging/most/dim2/hal.c index 39e17a7d2f24..30112413f20a 100644 --- a/drivers/staging/most/dim2/hal.c +++ b/drivers/staging/most/dim2/hal.c @@ -97,7 +97,7 @@ static int dbr_get_mask_size(u16 size) /** * Allocates DBR memory. - * @param size Allocating memory size. + * @size: Allocating memory size. * @return Offset in DBR memory by success or DBR_SIZE if out of memory. */ static int alloc_dbr(u16 size) @@ -778,7 +778,7 @@ void dim_service_mlb_int_irq(void) writel(0, &g.dim2->MS1); } -/** +/* * Retrieves maximal possible correct buffer size for isochronous data type * conform to given packet length and not bigger than given buffer size. * @@ -792,7 +792,7 @@ u16 dim_norm_isoc_buffer_size(u16 buf_size, u16 packet_length) return norm_isoc_buffer_size(buf_size, packet_length); } -/** +/* * Retrieves maximal possible correct buffer size for synchronous data type * conform to given bytes per frame and not bigger than given buffer size. * From 51ca97af82af8a6aa3558210d040907057451b26 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:07 +0100 Subject: [PATCH 031/744] staging: most: dim2: hal: Demote non-conformant kernel-doc headers Fixes the following W=1 kernel build warning(s): drivers/staging/most/dim2/hal.c:99: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst drivers/staging/most/dim2/hal.c:788: warning: Function parameter or member 'buf_size' not described in 'dim_norm_isoc_buffer_size' drivers/staging/most/dim2/hal.c:788: warning: Function parameter or member 'packet_length' not described in 'dim_norm_isoc_buffer_size' drivers/staging/most/dim2/hal.c:788: warning: expecting prototype for Retrieves maximal possible correct buffer size for isochronous data type(). Prototype was for dim_norm_isoc_buffer_size() instead drivers/staging/most/dim2/hal.c:802: warning: Function parameter or member 'buf_size' not described in 'dim_norm_sync_buffer_size' drivers/staging/most/dim2/hal.c:802: warning: Function parameter or member 'bytes_per_frame' not described in 'dim_norm_sync_buffer_size' drivers/staging/most/dim2/hal.c:802: warning: expecting prototype for Retrieves maximal possible correct buffer size for synchronous data type(). Prototype was for dim_norm_sync_buffer_size() instead Cc: Greg Kroah-Hartman Cc: Lee Jones Cc: Andrey Shvetsov Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-36-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/dim2/hal.c | 4 ++-- drivers/staging/qlge/qlge_main.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/most/dim2/hal.c b/drivers/staging/most/dim2/hal.c index 30112413f20a..65282c276862 100644 --- a/drivers/staging/most/dim2/hal.c +++ b/drivers/staging/most/dim2/hal.c @@ -96,9 +96,9 @@ static int dbr_get_mask_size(u16 size) } /** - * Allocates DBR memory. + * alloc_dbr() - Allocates DBR memory. * @size: Allocating memory size. - * @return Offset in DBR memory by success or DBR_SIZE if out of memory. + * Returns: Offset in DBR memory by success or DBR_SIZE if out of memory. */ static int alloc_dbr(u16 size) { diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c index c9dc6a852af4..55a04ca9307c 100644 --- a/drivers/staging/qlge/qlge_main.c +++ b/drivers/staging/qlge/qlge_main.c @@ -1389,7 +1389,7 @@ static void qlge_categorize_rx_err(struct qlge_adapter *qdev, u8 rx_err, } } -/** +/* * qlge_update_mac_hdr_len - helper routine to update the mac header length * based on vlan tags if present */ @@ -2235,7 +2235,7 @@ static void qlge_vlan_mode(struct net_device *ndev, netdev_features_t features) } } -/** +/* * qlge_update_hw_vlan_features - helper routine to reinitialize the adapter * based on the features to enable/disable hardware vlan accel */ From c848434c629db5d08350bfb49939f447dc1257eb Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:08 +0100 Subject: [PATCH 032/744] staging: axis-fifo: axis-fifo: Fix some formatting issues Fixes the following W=1 kernel build warning(s): drivers/staging/axis-fifo/axis-fifo.c:356: warning: Function parameter or member 'f' not described in 'axis_fifo_read' drivers/staging/axis-fifo/axis-fifo.c:356: warning: Function parameter or member 'buf' not described in 'axis_fifo_read' drivers/staging/axis-fifo/axis-fifo.c:356: warning: Function parameter or member 'len' not described in 'axis_fifo_read' drivers/staging/axis-fifo/axis-fifo.c:356: warning: Function parameter or member 'off' not described in 'axis_fifo_read' drivers/staging/axis-fifo/axis-fifo.c:356: warning: expecting prototype for axis_fifo_write(). Prototype was for axis_fifo_read() instead drivers/staging/axis-fifo/axis-fifo.c:478: warning: Function parameter or member 'f' not described in 'axis_fifo_write' drivers/staging/axis-fifo/axis-fifo.c:478: warning: Function parameter or member 'buf' not described in 'axis_fifo_write' drivers/staging/axis-fifo/axis-fifo.c:478: warning: Function parameter or member 'len' not described in 'axis_fifo_write' drivers/staging/axis-fifo/axis-fifo.c:478: warning: Function parameter or member 'off' not described in 'axis_fifo_write' Cc: Greg Kroah-Hartman Cc: "John B. Wyatt IV" Cc: Jacob Feder Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-37-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/axis-fifo/axis-fifo.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c index ed9281089738..8eee17dc77ab 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -338,10 +338,10 @@ static void reset_ip_core(struct axis_fifo *fifo) /** * axis_fifo_write() - Read a packet from AXIS-FIFO character device. - * @f Open file. - * @buf User space buffer to read to. - * @len User space buffer length. - * @off Buffer offset. + * @f: Open file. + * @buf: User space buffer to read to. + * @len: User space buffer length. + * @off: Buffer offset. * * As defined by the device's documentation, we need to check the device's * occupancy before reading the length register and then the data. All these @@ -460,10 +460,10 @@ end_unlock: /** * axis_fifo_write() - Write buffer to AXIS-FIFO character device. - * @f Open file. - * @buf User space buffer to write to the device. - * @len User space buffer length. - * @off Buffer offset. + * @f: Open file. + * @buf: User space buffer to write to the device. + * @len: User space buffer length. + * @off: Buffer offset. * * As defined by the device's documentation, we need to write to the device's * data buffer then to the device's packet length register atomically. Also, From 7dd8ffdbc00565bd26762f0c56cf851ee1afdc91 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:09 +0100 Subject: [PATCH 033/744] staging: rtl8188eu: os_dep: ioctl_linux: Move 2 large data buffers into the heap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function ‘translate_scan’: drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:310:1: warning: the frame size of 1064 bytes is larger than 1024 bytes [-Wframe-larger-than=] drivers/staging/rtl8723bs/os_dep/ioctl_linux.c: In function ‘rtw_wx_set_mlme’: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:1128:6: warning: variable ‘reason’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/os_dep/ioctl_linux.c: In function ‘rtw_dbg_port’: drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2548:33: warning: variable ‘preorder_ctrl’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:2573:33: warning: variable ‘preorder_ctrl’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/os_dep/ioctl_linux.c:36:27: warning: ‘iw_operation_mode’ defined but not used [-Wunused-const-variable=] Cc: Larry Finger Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-38-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index c95ae4d6a3b6..cc14f0094778 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -224,7 +224,7 @@ static char *translate_scan(struct adapter *padapter, /* parsing WPA/WPA2 IE */ { u8 *buf; - u8 wpa_ie[255], rsn_ie[255]; + u8 *wpa_ie, *rsn_ie; u16 wpa_len = 0, rsn_len = 0; u8 *p; @@ -232,6 +232,14 @@ static char *translate_scan(struct adapter *padapter, if (!buf) return start; + wpa_ie = kzalloc(255, GFP_ATOMIC); + if (!wpa_ie) + return start; + + rsn_ie = kzalloc(255, GFP_ATOMIC); + if (!rsn_ie) + return start; + rtw_get_sec_ie(pnetwork->network.ies, pnetwork->network.ie_length, rsn_ie, &rsn_len, wpa_ie, &wpa_len); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: ssid =%s\n", pnetwork->network.ssid.ssid)); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len)); @@ -268,6 +276,8 @@ static char *translate_scan(struct adapter *padapter, start = iwe_stream_add_point(info, start, stop, &iwe, rsn_ie); } kfree(buf); + kfree(wpa_ie); + kfree(rsn_ie); } {/* parsing WPS IE */ From f877899b9a4b48d175187d039e22b63d758b60c4 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:10 +0100 Subject: [PATCH 034/744] staging: fbtft: fb_ili9320: Remove unused variable 'ret' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/fbtft/fb_ili9320.c: In function ‘read_devicecode’: drivers/staging/fbtft/fb_ili9320.c:25:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-39-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/fbtft/fb_ili9320.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/fbtft/fb_ili9320.c b/drivers/staging/fbtft/fb_ili9320.c index f2e72d14431d..f0ebc40857b3 100644 --- a/drivers/staging/fbtft/fb_ili9320.c +++ b/drivers/staging/fbtft/fb_ili9320.c @@ -22,11 +22,10 @@ static unsigned int read_devicecode(struct fbtft_par *par) { - int ret; u8 rxbuf[8] = {0, }; write_reg(par, 0x0000); - ret = par->fbtftops.read(par, rxbuf, 4); + par->fbtftops.read(par, rxbuf, 4); return (rxbuf[2] << 8) | rxbuf[3]; } From 50676c55f00e932bc6a462298ed76076d76241d3 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:11 +0100 Subject: [PATCH 035/744] staging: rtl8723bs: core: rtw_ieee80211: Fix incorrectly named function Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/core/rtw_ieee80211.c:889: warning: expecting prototype for ieee802_11_parse_elems(). Prototype was for rtw_ieee802_11_parse_elems() instead Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-40-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c index d8513acf4911..e341789954b9 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c @@ -875,7 +875,7 @@ static int rtw_ieee802_11_parse_vendor_specific(u8 *pos, uint elen, } /** - * ieee802_11_parse_elems - Parse information elements in management frames + * rtw_ieee802_11_parse_elems - Parse information elements in management frames * @start: Pointer to the start of IEs * @len: Length of IE buffer in octets * @elems: Data structure for parsed elements From ad7e84ef4c213aca251a59928382ddd293486fef Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:12 +0100 Subject: [PATCH 036/744] staging: rtl8723bs: hal: odm_NoiseMonitor: Remove unused variable and dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c: In function ‘odm_InbandNoise_Monitor_NSeries’: drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c:32:34: warning: variable ‘func_end’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: Marco Cesati Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-41-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c index c3de123e2a48..e3b44481bd88 100644 --- a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c +++ b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c @@ -29,7 +29,7 @@ static s16 odm_InbandNoise_Monitor_NSeries( u8 max_rf_path = 0, rf_path; u8 reg_c50, reg_c58, valid_done = 0; struct noise_level noise_data; - u32 start = 0, func_start = 0, func_end = 0; + u32 start = 0, func_start = 0; func_start = jiffies; pDM_Odm->noise_level.noise_all = 0; @@ -150,12 +150,6 @@ static s16 odm_InbandNoise_Monitor_NSeries( if (bPauseDIG) odm_PauseDIG(pDM_Odm, ODM_RESUME_DIG, IGIValue); - func_end = jiffies_to_msecs(jiffies - func_start); - /* printk("%s noise_a = %d, noise_b = %d noise_all:%d (%d ms)\n", __func__, */ - /* pDM_Odm->noise_level.noise[ODM_RF_PATH_A], */ - /* pDM_Odm->noise_level.noise[ODM_RF_PATH_B], */ - /* pDM_Odm->noise_level.noise_all, func_end); */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_DebugControlInbandNoise_Nseries() <==\n")); return pDM_Odm->noise_level.noise_all; From 55016d099acd06ef7ff3b2c8f26cdabe2ce4024b Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:13 +0100 Subject: [PATCH 037/744] staging: rtl8188eu: os_dep: mon: Demote non-conforming kernel-doc headers Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8188eu/os_dep/mon.c:21: warning: Function parameter or member 'skb' not described in 'unprotect_frame' drivers/staging/rtl8188eu/os_dep/mon.c:21: warning: Function parameter or member 'iv_len' not described in 'unprotect_frame' drivers/staging/rtl8188eu/os_dep/mon.c:21: warning: Function parameter or member 'icv_len' not described in 'unprotect_frame' drivers/staging/rtl8188eu/os_dep/mon.c:75: warning: Function parameter or member 'dev' not described in 'rtl88eu_mon_recv_hook' drivers/staging/rtl8188eu/os_dep/mon.c:75: warning: Function parameter or member 'frame' not described in 'rtl88eu_mon_recv_hook' drivers/staging/rtl8188eu/os_dep/mon.c:108: warning: Function parameter or member 'dev' not described in 'rtl88eu_mon_xmit_hook' drivers/staging/rtl8188eu/os_dep/mon.c:108: warning: Function parameter or member 'frame' not described in 'rtl88eu_mon_xmit_hook' drivers/staging/rtl8188eu/os_dep/mon.c:108: warning: Function parameter or member 'frag_len' not described in 'rtl88eu_mon_xmit_hook' Cc: Larry Finger Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-42-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/os_dep/mon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c index 73b9599fe0dc..9b40de7d39e7 100644 --- a/drivers/staging/rtl8188eu/os_dep/mon.c +++ b/drivers/staging/rtl8188eu/os_dep/mon.c @@ -14,7 +14,7 @@ #include #include -/** +/* * unprotect_frame() - unset Protected flag and strip off IV and ICV/MIC */ static void unprotect_frame(struct sk_buff *skb, int iv_len, int icv_len) @@ -65,7 +65,7 @@ static void mon_recv_encrypted(struct net_device *dev, const u8 *data, netdev_info(dev, "Encrypted packets are not supported"); } -/** +/* * rtl88eu_mon_recv_hook() - forward received frame to the monitor interface * * Assumes that the frame contains an IV and an ICV/MIC, and that @@ -96,7 +96,7 @@ void rtl88eu_mon_recv_hook(struct net_device *dev, struct recv_frame *frame) mon_recv_encrypted(dev, data, data_len); } -/** +/* * rtl88eu_mon_xmit_hook() - forward trasmitted frame to the monitor interface * * Assumes that: From 904f18483591e64de15d9cd93c2e901728269afe Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:16 +0100 Subject: [PATCH 038/744] staging: rtl8723bs: hal: rtl8723b_phycfg: Fix a bunch of misnamed functions ... and fix a misnamed param. Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c:53: warning: expecting prototype for PHY_QueryBBReg(). Prototype was for PHY_QueryBBReg_8723B() instead drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c:87: warning: expecting prototype for PHY_SetBBReg(). Prototype was for PHY_SetBBReg_8723B() instead drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c:252: warning: Function parameter or member 'RegAddr' not described in 'PHY_QueryRFReg_8723B' drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c:252: warning: expecting prototype for PHY_QueryRFReg(). Prototype was for PHY_QueryRFReg_8723B() instead drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c:285: warning: expecting prototype for PHY_SetRFReg(). Prototype was for PHY_SetRFReg_8723B() instead Cc: Greg Kroah-Hartman Cc: karthik alapati Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-45-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c index f43abf9b0d22..011b42e1b991 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c @@ -38,7 +38,7 @@ static u32 phy_CalculateBitShift(u32 BitMask) /** - * PHY_QueryBBReg - Read "specific bits" from BB register. + * PHY_QueryBBReg_8723B - Read "specific bits" from BB register. * @Adapter: * @RegAddr: The target address to be readback * @BitMask: The target bit position in the target address @@ -66,7 +66,7 @@ u32 PHY_QueryBBReg_8723B(struct adapter *Adapter, u32 RegAddr, u32 BitMask) /** - * PHY_SetBBReg - Write "Specific bits" to BB register (page 8~). + * PHY_SetBBReg_8723B - Write "Specific bits" to BB register (page 8~). * @Adapter: * @RegAddr: The target address to be modified * @BitMask: The target bit position in the target address @@ -231,10 +231,10 @@ static void phy_RFSerialWrite_8723B( /** - * PHY_QueryRFReg - Query "Specific bits" to RF register (page 8~). + * PHY_QueryRFReg_8723B - Query "Specific bits" to RF register (page 8~). * @Adapter: * @eRFPath: Radio path of A/B/C/D - * @RegAdd: The target address to be read + * @RegAddr: The target address to be read * @BitMask: The target bit position in the target address * to be read * @@ -263,7 +263,7 @@ u32 PHY_QueryRFReg_8723B( } /** - * PHY_SetRFReg - Write "Specific bits" to RF register (page 8~). + * PHY_SetRFReg_8723B - Write "Specific bits" to RF register (page 8~). * @Adapter: * @eRFPath: Radio path of A/B/C/D * @RegAddr: The target address to be modified From 433cb9f05aa9c3dad96981f92f8d117e3443fb8f Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:18 +0100 Subject: [PATCH 039/744] staging: rtl8723bs: hal: sdio_ops: Mark used 'err' as __maybe_unused and remove another MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'err' is only used if debug is enabled. Also remove 4 year old TODO. Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/hal/sdio_ops.c: In function ‘sdio_read32’: drivers/staging/rtl8723bs/hal/sdio_ops.c:170:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/hal/sdio_ops.c: In function ‘sdio_read_mem’: drivers/staging/rtl8723bs/hal/sdio_ops.c:381:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: Fabio Aiuto Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-47-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/sdio_ops.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c index a31694525bc1..c1b29e18950e 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_ops.c +++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c @@ -160,7 +160,7 @@ static u32 sdio_read32(struct intf_hdl *intfhdl, u32 addr) u32 ftaddr; u8 shift; u32 val; - s32 err; + s32 __maybe_unused err; __le32 le_tmp; adapter = intfhdl->padapter; @@ -360,10 +360,7 @@ static void sdio_read_mem( u8 *rmem ) { - s32 err; - - err = sdio_readN(intfhdl, addr, cnt, rmem); - /* TODO: Report error is err not zero */ + sdio_readN(intfhdl, addr, cnt, rmem); } static void sdio_write_mem( From 3821526719f13cc7125d21a4a74089654ed35b79 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:19 +0100 Subject: [PATCH 040/744] staging: rtl8723bs: os_dep: ioctl_cfg80211: 'ack' is used when debug is enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c: In function ‘_cfg80211_rtw_mgmt_tx’: drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c:2754:7: warning: variable ‘ack’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-48-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index c1dac6eec59f..2d8d4920785c 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -2595,7 +2595,7 @@ static int _cfg80211_rtw_mgmt_tx(struct adapter *padapter, u8 tx_ch, const u8 *b struct pkt_attrib *pattrib; unsigned char *pframe; int ret = _FAIL; - bool ack = true; + bool __maybe_unused ack = true; struct ieee80211_hdr *pwlanhdr; struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); From bbf40b2f6e38d04262cfbb68e2a9435d10e97d14 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:23 +0100 Subject: [PATCH 041/744] staging: axis-fifo: axis-fifo: Fix function naming in the documentation Fixes the following W=1 kernel build warning(s): drivers/staging/axis-fifo/axis-fifo.c:356: warning: expecting prototype for axis_fifo_write(). Prototype was for axis_fifo_read() instead Cc: Greg Kroah-Hartman Cc: Jacob Feder Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-52-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/axis-fifo/axis-fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c index 8eee17dc77ab..b23eabb863d1 100644 --- a/drivers/staging/axis-fifo/axis-fifo.c +++ b/drivers/staging/axis-fifo/axis-fifo.c @@ -337,7 +337,7 @@ static void reset_ip_core(struct axis_fifo *fifo) } /** - * axis_fifo_write() - Read a packet from AXIS-FIFO character device. + * axis_fifo_read() - Read a packet from AXIS-FIFO character device. * @f: Open file. * @buf: User space buffer to read to. * @len: User space buffer length. From e3a7f78dc096f9354b996aecc526d63dd318800c Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:24 +0100 Subject: [PATCH 042/744] staging: rtl8723bs: hal: odm_NoiseMonitor: Remove unused variable 'func_start' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c: In function ‘odm_InbandNoise_Monitor_NSeries’: drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c:32:18: warning: variable ‘func_start’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: Marco Cesati Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-53-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c index e3b44481bd88..956e5a725a5d 100644 --- a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c +++ b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c @@ -29,9 +29,8 @@ static s16 odm_InbandNoise_Monitor_NSeries( u8 max_rf_path = 0, rf_path; u8 reg_c50, reg_c58, valid_done = 0; struct noise_level noise_data; - u32 start = 0, func_start = 0; + u32 start = 0; - func_start = jiffies; pDM_Odm->noise_level.noise_all = 0; if ((pDM_Odm->RFType == ODM_1T2R) || (pDM_Odm->RFType == ODM_2T2R)) From 705655a2c4cb81b5d26d4d14e8a7511952dbfc48 Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:25 +0100 Subject: [PATCH 043/744] staging: rtl8723bs: core: rtw_mlme_ext: Move very large data buffer onto the heap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/core/rtw_mlme_ext.c: In function ‘issue_probersp’: drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2543:1: warning: the frame size of 1096 bytes is larger than 1024 bytes [-Wframe-larger-than=] Cc: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-54-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 9031cf7657ae..602d00f1e6df 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -2457,9 +2457,13 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p u8 *ssid_ie; signed int ssid_ielen; signed int ssid_ielen_diff; - u8 buf[MAX_IE_SZ]; + u8 *buf; u8 *ies = pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct ieee80211_hdr_3addr); + buf = rtw_zmalloc(MAX_IE_SZ); + if (!buf) + return; + ssid_ie = rtw_get_ie(ies+_FIXED_IE_LENGTH_, WLAN_EID_SSID, &ssid_ielen, (pframe-ies)-_FIXED_IE_LENGTH_); @@ -2487,6 +2491,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p pframe += ssid_ielen_diff; pattrib->pktlen += ssid_ielen_diff; } + kfree (buf); } } else { /* timestamp will be inserted by hardware */ From 1873cb875525b1f1fef166fb56619942401c85dc Mon Sep 17 00:00:00 2001 From: Lee Jones Date: Wed, 14 Apr 2021 19:11:29 +0100 Subject: [PATCH 044/744] staging: rtl8723bs: hal: sdio_halinit: Remove unused variable 'ret' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following W=1 kernel build warning(s): drivers/staging/rtl8723bs/hal/sdio_halinit.c: In function ‘CardDisableRTL8723BSdio’: drivers/staging/rtl8723bs/hal/sdio_halinit.c:881:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/hal/sdio_halinit.c: In function ‘CardDisableRTL8723BSdio’: drivers/staging/rtl8723bs/hal/sdio_halinit.c:881:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/hal/sdio_halinit.c: In function ‘CardDisableRTL8723BSdio’: drivers/staging/rtl8723bs/hal/sdio_halinit.c:881:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/hal/sdio_halinit.c: In function ‘CardDisableRTL8723BSdio’: drivers/staging/rtl8723bs/hal/sdio_halinit.c:881:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] drivers/staging/rtl8723bs/hal/sdio_halinit.c: In function ‘CardDisableRTL8723BSdio’: drivers/staging/rtl8723bs/hal/sdio_halinit.c:881:5: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] Cc: Greg Kroah-Hartman Cc: Fabio Aiuto Cc: Stanley@BB.SD3 Cc: linux-staging@lists.linux.dev Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20210414181129.1628598-58-lee.jones@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/sdio_halinit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c index abd90026a8c7..a19c6ec0d063 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c @@ -878,10 +878,9 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter) { u8 u1bTmp; u8 bMacPwrCtrlOn; - u8 ret = _FAIL; /* Run LPS WL RFOFF flow */ - ret = HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow); + HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow); /* ==== Reset digital sequence ====== */ @@ -909,9 +908,8 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter) /* ==== Reset digital sequence end ====== */ bMacPwrCtrlOn = false; /* Disable CMD53 R/W */ - ret = false; rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn); - ret = HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow); + HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow); } static u32 rtl8723bs_hal_deinit(struct adapter *padapter) From ad843f3920354871bb26a92a8511426a662c7526 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 22 Apr 2021 12:20:46 +0100 Subject: [PATCH 045/744] staging: wlan-ng: remove redundant initialization of variable txresult The variable txresult is being initialized with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed. Signed-off-by: Colin Ian King Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/r/20210422112046.245144-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index 70570e8a5ad2..a02ae9b13ccc 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -325,7 +325,7 @@ static netdev_tx_t p80211knetdev_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev) { int result = 0; - int txresult = -1; + int txresult; struct wlandevice *wlandev = netdev->ml_priv; union p80211_hdr p80211_hdr; struct p80211_metawep p80211_wep; From bdf2b26de6124a175d03092e89610f15ebc6a733 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:50:53 +0200 Subject: [PATCH 046/744] staging: vchiq_arm: avoid crashing the kernel Using BUG_ON in a non-essential driver isn't recommend. So better trigger a stacktrace and bailout. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-2-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_arm.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index e39897c38e6a..367fa3d371eb 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -602,7 +602,9 @@ service_callback(enum vchiq_reason reason, struct vchiq_header *header, DEBUG_TRACE(SERVICE_CALLBACK_LINE); service = handle_to_service(handle); - BUG_ON(!service); + if (WARN_ON(!service)) + return VCHIQ_SUCCESS; + user_service = (struct user_service *)service->base.userdata; instance = user_service->instance; @@ -918,8 +920,12 @@ static int vchiq_ioc_dequeue_message(struct vchiq_instance *instance, goto out; } - BUG_ON((int)(user_service->msg_insert - - user_service->msg_remove) < 0); + if (WARN_ON_ONCE((int)(user_service->msg_insert - + user_service->msg_remove) < 0)) { + spin_unlock(&msg_queue_spinlock); + ret = -EINVAL; + goto out; + } header = user_service->msg_queue[user_service->msg_remove & (MSG_QUEUE_SIZE - 1)]; @@ -1937,7 +1943,10 @@ static int vchiq_release(struct inode *inode, struct file *file) wait_for_completion(&service->remove_event); - BUG_ON(service->srvstate != VCHIQ_SRVSTATE_FREE); + if (WARN_ON(service->srvstate != VCHIQ_SRVSTATE_FREE)) { + unlock_service(service); + break; + } spin_lock(&msg_queue_spinlock); From bd18b980a21d9654143e7b5167ab82e82c706798 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:50:54 +0200 Subject: [PATCH 047/744] staging: vchiq_core: break early in vchiq_close_service_internal The logic in VCHIQ_SRVSTATE_OPEN* is unnecessary complex. Handle the error case of queue_message() first makes it easier to read. Btw we get the rid of the checkpatch warning: WARNING: else is not generally useful after a break or return Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-3-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_core.c | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 517a8c9b41ed..8a1e6f5a11bb 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -2763,21 +2763,21 @@ vchiq_close_service_internal(struct vchiq_service *service, int close_recvd) VCHIQ_MSG_DSTPORT(service->remoteport)), NULL, NULL, 0, QMFLAGS_NO_MUTEX_UNLOCK); - if (status == VCHIQ_SUCCESS) { - if (!close_recvd) { - /* Change the state while the mutex is still held */ - vchiq_set_service_state(service, - VCHIQ_SRVSTATE_CLOSESENT); - mutex_unlock(&state->slot_mutex); - if (service->sync) - mutex_unlock(&state->sync_mutex); - break; - } - } else if (service->srvstate == VCHIQ_SRVSTATE_OPENSYNC) { - mutex_unlock(&state->sync_mutex); + if (status != VCHIQ_SUCCESS) { + if (service->srvstate == VCHIQ_SRVSTATE_OPENSYNC) + mutex_unlock(&state->sync_mutex); break; - } else + } + + if (!close_recvd) { + /* Change the state while the mutex is still held */ + vchiq_set_service_state(service, + VCHIQ_SRVSTATE_CLOSESENT); + mutex_unlock(&state->slot_mutex); + if (service->sync) + mutex_unlock(&state->sync_mutex); break; + } /* Change the state while the mutex is still held */ vchiq_set_service_state(service, VCHIQ_SRVSTATE_CLOSERECVD); From f7ba60127a3a123c4d3439b5bc527955e8923e3d Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:50:55 +0200 Subject: [PATCH 048/744] staging: vchiq_core: return early in do_abort_bulks Avoid the multiline statement for notify_bulks by return early in error case. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-4-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 8a1e6f5a11bb..f13d5738e731 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -2622,9 +2622,10 @@ do_abort_bulks(struct vchiq_service *service) mutex_unlock(&service->bulk_mutex); status = notify_bulks(service, &service->bulk_tx, 0/*!retry_poll*/); - if (status == VCHIQ_SUCCESS) - status = notify_bulks(service, &service->bulk_rx, - 0/*!retry_poll*/); + if (status != VCHIQ_SUCCESS) + return 0; + + status = notify_bulks(service, &service->bulk_rx, 0/*!retry_poll*/); return (status == VCHIQ_SUCCESS); } From 08f31d0196cb9387ca9d2fa1720d34ae1e2cf25b Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:50:56 +0200 Subject: [PATCH 049/744] staging: vchiq_core: introduce get_bulk_reason Nesting multiple ternary operators over multiple lines isn't easy to read. Move this logic into a separate inline function. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-5-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_core.c | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index f13d5738e731..3a72c364f25d 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -1226,6 +1226,22 @@ release_slot(struct vchiq_state *state, struct vchiq_slot_info *slot_info, mutex_unlock(&state->recycle_mutex); } +static inline enum vchiq_reason +get_bulk_reason(struct vchiq_bulk *bulk) +{ + if (bulk->dir == VCHIQ_BULK_TRANSMIT) { + if (bulk->actual == VCHIQ_BULK_ACTUAL_ABORTED) + return VCHIQ_BULK_TRANSMIT_ABORTED; + + return VCHIQ_BULK_TRANSMIT_DONE; + } + + if (bulk->actual == VCHIQ_BULK_ACTUAL_ABORTED) + return VCHIQ_BULK_RECEIVE_ABORTED; + + return VCHIQ_BULK_RECEIVE_DONE; +} + /* Called by the slot handler - don't hold the bulk mutex */ static enum vchiq_status notify_bulks(struct vchiq_service *service, struct vchiq_bulk_queue *queue, @@ -1281,16 +1297,8 @@ notify_bulks(struct vchiq_service *service, struct vchiq_bulk_queue *queue, spin_unlock(&bulk_waiter_spinlock); } else if (bulk->mode == VCHIQ_BULK_MODE_CALLBACK) { - enum vchiq_reason reason = (bulk->dir == - VCHIQ_BULK_TRANSMIT) ? - ((bulk->actual == - VCHIQ_BULK_ACTUAL_ABORTED) ? - VCHIQ_BULK_TRANSMIT_ABORTED : - VCHIQ_BULK_TRANSMIT_DONE) : - ((bulk->actual == - VCHIQ_BULK_ACTUAL_ABORTED) ? - VCHIQ_BULK_RECEIVE_ABORTED : - VCHIQ_BULK_RECEIVE_DONE); + enum vchiq_reason reason = + get_bulk_reason(bulk); status = make_service_callback(service, reason, NULL, bulk->userdata); if (status == VCHIQ_RETRY) From 82aa95ee2d37fdae6cbd1d7d32fd59e295fe3557 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:50:57 +0200 Subject: [PATCH 050/744] staging: vchiq_core: Drop unnecessary check in notify_bulks There is no modification to the vchiq_status before the first if, so drop this unnecessary check. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-6-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_core.c | 92 +++++++++---------- 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 3a72c364f25d..9dc9a6a96104 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -1257,61 +1257,59 @@ notify_bulks(struct vchiq_service *service, struct vchiq_bulk_queue *queue, queue->remote_notify = queue->process; - if (status == VCHIQ_SUCCESS) { - while (queue->remove != queue->remote_notify) { - struct vchiq_bulk *bulk = - &queue->bulks[BULK_INDEX(queue->remove)]; + while (queue->remove != queue->remote_notify) { + struct vchiq_bulk *bulk = + &queue->bulks[BULK_INDEX(queue->remove)]; - /* - * Only generate callbacks for non-dummy bulk - * requests, and non-terminated services - */ - if (bulk->data && service->instance) { - if (bulk->actual != VCHIQ_BULK_ACTUAL_ABORTED) { - if (bulk->dir == VCHIQ_BULK_TRANSMIT) { - VCHIQ_SERVICE_STATS_INC(service, - bulk_tx_count); - VCHIQ_SERVICE_STATS_ADD(service, - bulk_tx_bytes, - bulk->actual); - } else { - VCHIQ_SERVICE_STATS_INC(service, - bulk_rx_count); - VCHIQ_SERVICE_STATS_ADD(service, - bulk_rx_bytes, - bulk->actual); - } + /* + * Only generate callbacks for non-dummy bulk + * requests, and non-terminated services + */ + if (bulk->data && service->instance) { + if (bulk->actual != VCHIQ_BULK_ACTUAL_ABORTED) { + if (bulk->dir == VCHIQ_BULK_TRANSMIT) { + VCHIQ_SERVICE_STATS_INC(service, + bulk_tx_count); + VCHIQ_SERVICE_STATS_ADD(service, + bulk_tx_bytes, + bulk->actual); } else { VCHIQ_SERVICE_STATS_INC(service, - bulk_aborted_count); - } - if (bulk->mode == VCHIQ_BULK_MODE_BLOCKING) { - struct bulk_waiter *waiter; - - spin_lock(&bulk_waiter_spinlock); - waiter = bulk->userdata; - if (waiter) { - waiter->actual = bulk->actual; - complete(&waiter->event); - } - spin_unlock(&bulk_waiter_spinlock); - } else if (bulk->mode == - VCHIQ_BULK_MODE_CALLBACK) { - enum vchiq_reason reason = - get_bulk_reason(bulk); - status = make_service_callback(service, - reason, NULL, bulk->userdata); - if (status == VCHIQ_RETRY) - break; + bulk_rx_count); + VCHIQ_SERVICE_STATS_ADD(service, + bulk_rx_bytes, + bulk->actual); } + } else { + VCHIQ_SERVICE_STATS_INC(service, + bulk_aborted_count); } + if (bulk->mode == VCHIQ_BULK_MODE_BLOCKING) { + struct bulk_waiter *waiter; - queue->remove++; - complete(&service->bulk_remove_event); + spin_lock(&bulk_waiter_spinlock); + waiter = bulk->userdata; + if (waiter) { + waiter->actual = bulk->actual; + complete(&waiter->event); + } + spin_unlock(&bulk_waiter_spinlock); + } else if (bulk->mode == + VCHIQ_BULK_MODE_CALLBACK) { + enum vchiq_reason reason = + get_bulk_reason(bulk); + status = make_service_callback(service, + reason, NULL, bulk->userdata); + if (status == VCHIQ_RETRY) + break; + } } - if (!retry_poll) - status = VCHIQ_SUCCESS; + + queue->remove++; + complete(&service->bulk_remove_event); } + if (!retry_poll) + status = VCHIQ_SUCCESS; if (status == VCHIQ_RETRY) request_poll(service->state, service, From c74541f7c7ce10b7600f00ee3bf7354dfec18985 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:50:58 +0200 Subject: [PATCH 051/744] staging: vchiq_arm: drop return value of vchiq_arm_init_state The function vchiq_arm_init_state() cannot fail. So drop the return value and the unnecessary code. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-7-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 8 ++------ .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 +-- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.h | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index 8782ebe0b39a..7c336d092232 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -172,7 +172,6 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) enum vchiq_status vchiq_platform_init_state(struct vchiq_state *state) { - enum vchiq_status status = VCHIQ_SUCCESS; struct vchiq_2835_state *platform_state; state->platform_state = kzalloc(sizeof(*platform_state), GFP_KERNEL); @@ -182,12 +181,9 @@ vchiq_platform_init_state(struct vchiq_state *state) platform_state = (struct vchiq_2835_state *)state->platform_state; platform_state->inited = 1; - status = vchiq_arm_init_state(state, &platform_state->arm_state); + vchiq_arm_init_state(state, &platform_state->arm_state); - if (status != VCHIQ_SUCCESS) - platform_state->inited = 0; - - return status; + return VCHIQ_SUCCESS; } struct vchiq_arm_state* diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 367fa3d371eb..2774407bbb87 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -2312,7 +2312,7 @@ exit: return 0; } -enum vchiq_status +void vchiq_arm_init_state(struct vchiq_state *state, struct vchiq_arm_state *arm_state) { @@ -2328,7 +2328,6 @@ vchiq_arm_init_state(struct vchiq_state *state, arm_state->first_connect = 0; } - return VCHIQ_SUCCESS; } enum vchiq_status diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h index 24c331c94354..c7d2cf1f2e68 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h @@ -67,7 +67,7 @@ int vchiq_platform_init(struct platform_device *pdev, extern struct vchiq_state * vchiq_get_state(void); -extern enum vchiq_status +extern void vchiq_arm_init_state(struct vchiq_state *state, struct vchiq_arm_state *arm_state); From ae69402867b6bd4dc61e1d09078cf3eaf772f06a Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:50:59 +0200 Subject: [PATCH 052/744] staging: vchiq_2835_arm: drop enum vchiq_status Replace the custom set of return values with proper Linux error codes. As a result we need to initialize vchiq_status in vchiq_init_state. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-8-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_2835_arm.c | 12 ++++++------ .../vc04_services/interface/vchiq_arm/vchiq_core.c | 11 +++++------ .../vc04_services/interface/vchiq_arm/vchiq_core.h | 4 ++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index 7c336d092232..a644fe6b5d12 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -169,21 +169,21 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) return 0; } -enum vchiq_status +int vchiq_platform_init_state(struct vchiq_state *state) { struct vchiq_2835_state *platform_state; state->platform_state = kzalloc(sizeof(*platform_state), GFP_KERNEL); if (!state->platform_state) - return VCHIQ_ERROR; + return -ENOMEM; platform_state = (struct vchiq_2835_state *)state->platform_state; platform_state->inited = 1; vchiq_arm_init_state(state, &platform_state->arm_state); - return VCHIQ_SUCCESS; + return 0; } struct vchiq_arm_state* @@ -211,7 +211,7 @@ remote_event_signal(struct remote_event *event) writel(0, g_regs + BELL2); /* trigger vc interrupt */ } -enum vchiq_status +int vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset, void __user *uoffset, int size, int dir) { @@ -223,7 +223,7 @@ vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset, : PAGELIST_WRITE); if (!pagelistinfo) - return VCHIQ_ERROR; + return -ENOMEM; bulk->data = pagelistinfo->dma_addr; @@ -233,7 +233,7 @@ vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset, */ bulk->remote_data = pagelistinfo; - return VCHIQ_SUCCESS; + return 0; } void diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 9dc9a6a96104..9f9677a229e5 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -2162,9 +2162,9 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) { struct vchiq_shared_state *local; struct vchiq_shared_state *remote; - enum vchiq_status status; + enum vchiq_status status = VCHIQ_SUCCESS; char threadname[16]; - int i; + int i, ret; if (vchiq_states[0]) { pr_err("%s: VCHIQ state already initialized\n", __func__); @@ -2246,8 +2246,8 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) local->debug[DEBUG_ENTRIES] = DEBUG_MAX; - status = vchiq_platform_init_state(state); - if (status != VCHIQ_SUCCESS) + ret = vchiq_platform_init_state(state); + if (ret) return VCHIQ_ERROR; /* @@ -3141,8 +3141,7 @@ enum vchiq_status vchiq_bulk_transfer(unsigned int handle, bulk->size = size; bulk->actual = VCHIQ_BULK_ACTUAL_ABORTED; - if (vchiq_prepare_bulk_data(bulk, offset, uoffset, size, dir) - != VCHIQ_SUCCESS) + if (vchiq_prepare_bulk_data(bulk, offset, uoffset, size, dir)) goto unlock_error_exit; wmb(); diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h index b817097651fa..6b3a90774ecf 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -644,7 +644,7 @@ vchiq_queue_message(unsigned int handle, * implementations must be provided. */ -extern enum vchiq_status +extern int vchiq_prepare_bulk_data(struct vchiq_bulk *bulk, void *offset, void __user *uoffset, int size, int dir); @@ -679,7 +679,7 @@ vchiq_on_remote_use(struct vchiq_state *state); extern void vchiq_on_remote_release(struct vchiq_state *state); -extern enum vchiq_status +extern int vchiq_platform_init_state(struct vchiq_state *state); extern enum vchiq_status From a9fbd828be7fb7cf5c1af28d8f7fd34aee48c5ae Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:51:00 +0200 Subject: [PATCH 053/744] staging: vchiq_arm: drop enum vchiq_status from vchiq_*_internal Replace the custom set of return values with proper Linux error codes for the following functions: vchiq_use_internal() vchiq_release_internal() vchiq_use_service_internal() vchiq_release_service_internal() Now we can use the result directly as return value for vchiq_ioctl(). Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-9-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_arm.c | 31 +++++++++---------- .../interface/vchiq_arm/vchiq_core.h | 4 +-- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 2774407bbb87..b1c58b54452b 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1385,21 +1385,20 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) service = find_service_for_instance(instance, handle); if (service) { - status = (cmd == VCHIQ_IOC_USE_SERVICE) ? + ret = (cmd == VCHIQ_IOC_USE_SERVICE) ? vchiq_use_service_internal(service) : vchiq_release_service_internal(service); - if (status != VCHIQ_SUCCESS) { + if (ret) { vchiq_log_error(vchiq_susp_log_level, - "%s: cmd %s returned error %d for service %c%c%c%c:%03d", + "%s: cmd %s returned error %ld for service %c%c%c%c:%03d", __func__, (cmd == VCHIQ_IOC_USE_SERVICE) ? "VCHIQ_IOC_USE_SERVICE" : "VCHIQ_IOC_RELEASE_SERVICE", - status, + ret, VCHIQ_FOURCC_AS_4CHARS( service->base.fourcc), service->client_id); - ret = -EINVAL; } } else ret = -EINVAL; @@ -2330,18 +2329,18 @@ vchiq_arm_init_state(struct vchiq_state *state, } } -enum vchiq_status +int vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, enum USE_TYPE_E use_type) { struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state); - enum vchiq_status ret = VCHIQ_SUCCESS; + int ret = 0; char entity[16]; int *entity_uc; int local_uc; if (!arm_state) { - ret = VCHIQ_ERROR; + ret = -EINVAL; goto out; } @@ -2357,7 +2356,7 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, entity_uc = &service->service_use_count; } else { vchiq_log_error(vchiq_susp_log_level, "%s null service ptr", __func__); - ret = VCHIQ_ERROR; + ret = -EINVAL; goto out; } @@ -2371,7 +2370,7 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, write_unlock_bh(&arm_state->susp_res_lock); - if (ret == VCHIQ_SUCCESS) { + if (!ret) { enum vchiq_status status = VCHIQ_SUCCESS; long ack_cnt = atomic_xchg(&arm_state->ka_use_ack_count, 0); @@ -2391,16 +2390,16 @@ out: return ret; } -enum vchiq_status +int vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service) { struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state); - enum vchiq_status ret = VCHIQ_SUCCESS; + int ret = 0; char entity[16]; int *entity_uc; if (!arm_state) { - ret = VCHIQ_ERROR; + ret = -EINVAL; goto out; } @@ -2421,7 +2420,7 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service) /* Don't use BUG_ON - don't allow user thread to crash kernel */ WARN_ON(!arm_state->videocore_use_count); WARN_ON(!(*entity_uc)); - ret = VCHIQ_ERROR; + ret = -EINVAL; goto unlock; } --arm_state->videocore_use_count; @@ -2460,13 +2459,13 @@ vchiq_on_remote_release(struct vchiq_state *state) complete(&arm_state->ka_evt); } -enum vchiq_status +int vchiq_use_service_internal(struct vchiq_service *service) { return vchiq_use_internal(service->state, service, USE_TYPE_SERVICE); } -enum vchiq_status +int vchiq_release_service_internal(struct vchiq_service *service) { return vchiq_release_internal(service->state, service); diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h index 6b3a90774ecf..aad1c5cb9683 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -667,10 +667,10 @@ extern int vchiq_dump_platform_service_state(void *dump_context, struct vchiq_service *service); -extern enum vchiq_status +extern int vchiq_use_service_internal(struct vchiq_service *service); -extern enum vchiq_status +extern int vchiq_release_service_internal(struct vchiq_service *service); extern void From a2161d1d5e10c879a192e01b16c85f1832b45c57 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:51:01 +0200 Subject: [PATCH 054/744] staging: vchiq_core: drop vchiq_status from vchiq_set_service_option Replace the custom set of return values with proper Linux error codes for vchiq_set_service_option(). Now we can use the result directly as return value for vchiq_ioctl(). Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-10-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_arm.c | 4 ++-- .../interface/vchiq_arm/vchiq_core.c | 18 +++++++++--------- .../interface/vchiq_arm/vchiq_core.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index b1c58b54452b..8f67b15d81be 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1517,8 +1517,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) break; } - status = vchiq_set_service_option( - args.handle, args.option, args.value); + ret = vchiq_set_service_option(args.handle, args.option, + args.value); } break; case VCHIQ_IOC_LIB_VERSION: { diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 9f9677a229e5..e150feb8ff86 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -3371,21 +3371,21 @@ void vchiq_get_config(struct vchiq_config *config) config->version_min = VCHIQ_VERSION_MIN; } -enum vchiq_status +int vchiq_set_service_option(unsigned int handle, enum vchiq_service_option option, int value) { struct vchiq_service *service = find_service_by_handle(handle); - enum vchiq_status status = VCHIQ_ERROR; struct vchiq_service_quota *quota; + int ret = -EINVAL; if (!service) - return VCHIQ_ERROR; + return -EINVAL; switch (option) { case VCHIQ_SERVICE_OPTION_AUTOCLOSE: service->auto_close = value; - status = VCHIQ_SUCCESS; + ret = 0; break; case VCHIQ_SERVICE_OPTION_SLOT_QUOTA: @@ -3402,7 +3402,7 @@ vchiq_set_service_option(unsigned int handle, * dropped below its quota */ complete("a->quota_event); - status = VCHIQ_SUCCESS; + ret = 0; } break; @@ -3420,7 +3420,7 @@ vchiq_set_service_option(unsigned int handle, * dropped below its quota */ complete("a->quota_event); - status = VCHIQ_SUCCESS; + ret = 0; } break; @@ -3428,13 +3428,13 @@ vchiq_set_service_option(unsigned int handle, if ((service->srvstate == VCHIQ_SRVSTATE_HIDDEN) || (service->srvstate == VCHIQ_SRVSTATE_LISTENING)) { service->sync = value; - status = VCHIQ_SUCCESS; + ret = 0; } break; case VCHIQ_SERVICE_OPTION_TRACE: service->trace = value; - status = VCHIQ_SUCCESS; + ret = 0; break; default: @@ -3442,7 +3442,7 @@ vchiq_set_service_option(unsigned int handle, } unlock_service(service); - return status; + return ret; } static int diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h index aad1c5cb9683..bd1f5906846a 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -712,7 +712,7 @@ extern int vchiq_get_client_id(unsigned int service); extern void vchiq_get_config(struct vchiq_config *config); -extern enum vchiq_status +extern int vchiq_set_service_option(unsigned int service, enum vchiq_service_option option, int value); From abf2836a381a30763e24acd58da56fa615c6581a Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:51:02 +0200 Subject: [PATCH 055/744] staging: vchiq_core: drop vchiq_status from vchiq_initialise Replace the custom set of return values with proper Linux error codes for vchiq_initialise(). Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-11-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_arm.c | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 8f67b15d81be..1b1356833b8f 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -147,12 +147,11 @@ vchiq_blocking_bulk_transfer(unsigned int handle, void *data, unsigned int size, enum vchiq_bulk_dir dir); #define VCHIQ_INIT_RETRIES 10 -enum vchiq_status vchiq_initialise(struct vchiq_instance **instance_out) +int vchiq_initialise(struct vchiq_instance **instance_out) { - enum vchiq_status status = VCHIQ_ERROR; struct vchiq_state *state; struct vchiq_instance *instance = NULL; - int i; + int i, ret; vchiq_log_trace(vchiq_core_log_level, "%s called", __func__); @@ -170,6 +169,7 @@ enum vchiq_status vchiq_initialise(struct vchiq_instance **instance_out) if (i == VCHIQ_INIT_RETRIES) { vchiq_log_error(vchiq_core_log_level, "%s: videocore not initialized\n", __func__); + ret = -ENOTCONN; goto failed; } else if (i > 0) { vchiq_log_warning(vchiq_core_log_level, @@ -181,6 +181,7 @@ enum vchiq_status vchiq_initialise(struct vchiq_instance **instance_out) if (!instance) { vchiq_log_error(vchiq_core_log_level, "%s: error allocating vchiq instance\n", __func__); + ret = -ENOMEM; goto failed; } @@ -191,13 +192,13 @@ enum vchiq_status vchiq_initialise(struct vchiq_instance **instance_out) *instance_out = instance; - status = VCHIQ_SUCCESS; + ret = 0; failed: vchiq_log_trace(vchiq_core_log_level, - "%s(%p): returning %d", __func__, instance, status); + "%s(%p): returning %d", __func__, instance, ret); - return status; + return ret; } EXPORT_SYMBOL(vchiq_initialise); @@ -2236,6 +2237,7 @@ vchiq_keepalive_thread_func(void *v) enum vchiq_status status; struct vchiq_instance *instance; unsigned int ka_handle; + int ret; struct vchiq_service_params_kernel params = { .fourcc = VCHIQ_MAKE_FOURCC('K', 'E', 'E', 'P'), @@ -2244,10 +2246,10 @@ vchiq_keepalive_thread_func(void *v) .version_min = KEEPALIVE_VER_MIN }; - status = vchiq_initialise(&instance); - if (status != VCHIQ_SUCCESS) { + ret = vchiq_initialise(&instance); + if (ret) { vchiq_log_error(vchiq_susp_log_level, - "%s vchiq_initialise failed %d", __func__, status); + "%s vchiq_initialise failed %d", __func__, ret); goto exit; } From fd11b55da4d58b75e11e8f10b8aa50393922cff9 Mon Sep 17 00:00:00 2001 From: Stefan Wahren Date: Sun, 25 Apr 2021 12:51:03 +0200 Subject: [PATCH 056/744] staging: vchiq_core: drop vchiq_status from vchiq_init_state Replace the custom set of return values with proper Linux error codes for vchiq_init_state(). Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Stefan Wahren Link: https://lore.kernel.org/r/1619347863-16080-12-git-send-email-stefan.wahren@i2se.com Signed-off-by: Greg Kroah-Hartman --- .../interface/vchiq_arm/vchiq_2835_arm.c | 5 +++-- .../interface/vchiq_arm/vchiq_core.c | 15 ++++++++------- .../interface/vchiq_arm/vchiq_core.h | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index a644fe6b5d12..c3fbb29741f0 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -132,8 +132,9 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) *(char **)&g_fragments_base[i * g_fragments_size] = NULL; sema_init(&g_free_fragments_sema, MAX_FRAGMENTS); - if (vchiq_init_state(state, vchiq_slot_zero) != VCHIQ_SUCCESS) - return -EINVAL; + err = vchiq_init_state(state, vchiq_slot_zero); + if (err) + return err; g_regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(g_regs)) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index e150feb8ff86..ff853273786c 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -2162,13 +2162,12 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) { struct vchiq_shared_state *local; struct vchiq_shared_state *remote; - enum vchiq_status status = VCHIQ_SUCCESS; char threadname[16]; int i, ret; if (vchiq_states[0]) { pr_err("%s: VCHIQ state already initialized\n", __func__); - return VCHIQ_ERROR; + return -EINVAL; } local = &slot_zero->slave; @@ -2181,7 +2180,7 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) else vchiq_loud_error("master/slave mismatch two slaves"); vchiq_loud_error_footer(); - return VCHIQ_ERROR; + return -EINVAL; } memset(state, 0, sizeof(struct vchiq_state)); @@ -2248,7 +2247,7 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) ret = vchiq_platform_init_state(state); if (ret) - return VCHIQ_ERROR; + return ret; /* * bring up slot handler thread @@ -2262,7 +2261,7 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) vchiq_loud_error_header(); vchiq_loud_error("couldn't create thread %s", threadname); vchiq_loud_error_footer(); - return VCHIQ_ERROR; + return PTR_ERR(state->slot_handler_thread); } set_user_nice(state->slot_handler_thread, -19); @@ -2274,6 +2273,7 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) vchiq_loud_error_header(); vchiq_loud_error("couldn't create thread %s", threadname); vchiq_loud_error_footer(); + ret = PTR_ERR(state->recycle_thread); goto fail_free_handler_thread; } set_user_nice(state->recycle_thread, -19); @@ -2286,6 +2286,7 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) vchiq_loud_error_header(); vchiq_loud_error("couldn't create thread %s", threadname); vchiq_loud_error_footer(); + ret = PTR_ERR(state->sync_thread); goto fail_free_recycle_thread; } set_user_nice(state->sync_thread, -20); @@ -2299,14 +2300,14 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) /* Indicate readiness to the other side */ local->initialised = 1; - return status; + return 0; fail_free_recycle_thread: kthread_stop(state->recycle_thread); fail_free_handler_thread: kthread_stop(state->slot_handler_thread); - return VCHIQ_ERROR; + return ret; } void vchiq_msg_queue_push(unsigned int handle, struct vchiq_header *header) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h index bd1f5906846a..89f898ce62a1 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -539,7 +539,7 @@ get_conn_state_name(enum vchiq_connstate conn_state); extern struct vchiq_slot_zero * vchiq_init_slots(void *mem_base, int mem_size); -extern enum vchiq_status +extern int vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero); extern enum vchiq_status From 6332d14f0043a20e7bb17b4e5b40cb7925e9c32d Mon Sep 17 00:00:00 2001 From: Amos Gross Date: Mon, 26 Apr 2021 20:20:24 +0000 Subject: [PATCH 057/744] Staging: rtl8188eu: rtw_ioctl_set.c: fixed indentation issue Fixed an issue for checkpatch, file was using spaces for indentation. Switched out for tabs. Signed-off-by: Amos Gross Link: https://lore.kernel.org/r/YIcgW0Av26N2Etxf@arch.localdomain Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c index 17b999f45132..76dcaffea0fc 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8188eu/core/rtw_ioctl_set.c @@ -12,12 +12,12 @@ #include static const struct { - int channel_plan; - char *name; + int channel_plan; + char *name; } channel_table[] = { { RT_CHANNEL_DOMAIN_FCC, "US" }, - { RT_CHANNEL_DOMAIN_ETSI, "EU" }, - { RT_CHANNEL_DOMAIN_MKK, "JP" }, - { RT_CHANNEL_DOMAIN_CHINA, "CN"} }; + { RT_CHANNEL_DOMAIN_ETSI, "EU" }, + { RT_CHANNEL_DOMAIN_MKK, "JP" }, + { RT_CHANNEL_DOMAIN_CHINA, "CN"} }; extern void indicate_wx_scan_complete_event(struct adapter *padapter); From 9d1d2621248f1442ed43ffb4517db4c565dbc51f Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:44 +0200 Subject: [PATCH 058/744] staging: rtl8723bs: remove unused log function remove unused sd_f0_reg_dump() function. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/397a4082fa2a49c67ac7d6869284334d3fa7bea6.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_debug.c | 17 ----------------- drivers/staging/rtl8723bs/include/rtw_debug.h | 2 -- 2 files changed, 19 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c index 79fd968bb147..0ee0190c09d7 100644 --- a/drivers/staging/rtl8723bs/core/rtw_debug.c +++ b/drivers/staging/rtl8723bs/core/rtw_debug.c @@ -14,23 +14,6 @@ u32 GlobalDebugLevel = _drv_err_; #include -void sd_f0_reg_dump(void *sel, struct adapter *adapter) -{ - int i; - - for (i = 0x0; i <= 0xff; i++) { - if (i%16 == 0) - netdev_dbg(adapter->pnetdev, "0x%02x ", i); - - DBG_871X_SEL(sel, "%02x ", rtw_sd_f0_read8(adapter, i)); - - if (i%16 == 15) - DBG_871X_SEL(sel, "\n"); - else if (i%8 == 7) - DBG_871X_SEL(sel, "\t"); - } -} - void mac_reg_dump(void *sel, struct adapter *adapter) { int i, j = 1; diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 23f4cb4711d4..ed75db1b16f8 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -169,8 +169,6 @@ #endif /* defined(_dbgdump) */ -void sd_f0_reg_dump(void *sel, struct adapter *adapter); - void mac_reg_dump(void *sel, struct adapter *adapter); void bb_reg_dump(void *sel, struct adapter *adapter); void rf_reg_dump(void *sel, struct adapter *adapter); From 33fad5b4df5e2d037f17d501cdd90ff8d76fcb57 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:45 +0200 Subject: [PATCH 059/744] staging: rtl8723bs: replace DBG_871X_SEL log macro with netdev_dbg() replace DBG_871X_SEL log macro with the net device driver recommended netdev_dbg(). This macro by default does a raw printk, and the alternative behaviour, never triggered is a seq_print() call. So replace with netdev_dbg(). The operation has been done with the following semantic patch script: @@ expression sel; expression list args; identifier padapter; identifier func; @@ func(..., struct adapter *padapter, ...) { <... - DBG_871X_SEL(sel, args); + netdev_dbg(padapter->pnetdev, args); ...> Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/9e6a1e4dc8962bfd58375be98619c76e8e28febe.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_debug.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c index 0ee0190c09d7..a43fa38cae62 100644 --- a/drivers/staging/rtl8723bs/core/rtw_debug.c +++ b/drivers/staging/rtl8723bs/core/rtw_debug.c @@ -23,9 +23,10 @@ void mac_reg_dump(void *sel, struct adapter *adapter) for (i = 0x0; i < 0x800; i += 4) { if (j%4 == 1) netdev_dbg(adapter->pnetdev, "0x%03x", i); - DBG_871X_SEL(sel, " 0x%08x ", rtw_read32(adapter, i)); + netdev_dbg(adapter->pnetdev, " 0x%08x ", + rtw_read32(adapter, i)); if ((j++)%4 == 0) - DBG_871X_SEL(sel, "\n"); + netdev_dbg(adapter->pnetdev, "\n"); } } @@ -37,9 +38,10 @@ void bb_reg_dump(void *sel, struct adapter *adapter) for (i = 0x800; i < 0x1000 ; i += 4) { if (j%4 == 1) netdev_dbg(adapter->pnetdev, "0x%03x", i); - DBG_871X_SEL(sel, " 0x%08x ", rtw_read32(adapter, i)); + netdev_dbg(adapter->pnetdev, " 0x%08x ", + rtw_read32(adapter, i)); if ((j++)%4 == 0) - DBG_871X_SEL(sel, "\n"); + netdev_dbg(adapter->pnetdev, "\n"); } } @@ -64,9 +66,9 @@ void rf_reg_dump(void *sel, struct adapter *adapter) value = rtw_hal_read_rfreg(adapter, path, i, 0xffffffff); if (j%4 == 1) netdev_dbg(adapter->pnetdev, "0x%02x ", i); - DBG_871X_SEL(sel, " 0x%08x ", value); + netdev_dbg(adapter->pnetdev, " 0x%08x ", value); if ((j++)%4 == 0) - DBG_871X_SEL(sel, "\n"); + netdev_dbg(adapter->pnetdev, "\n"); } } } From 2867c27bf854bb2e233abbdba75cb0333d7e00ad Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:46 +0200 Subject: [PATCH 060/744] staging: rtl8723bs: add two functions to improve register dump in core/rtw_debug.c Beautify register dump by adding two functions printing four register values per line. This is necessary after old macro replacement with netdev_dbg(), the former wrapped a raw printk, the latter prints lots of driver information overhead per line for each call. So avoid this noisy behaviour by dumping four values on each line. Suggested-by: Joe Perches Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/0f3300e6b07f811c0d3fc9c6dd46e5270dfb7a54.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_debug.c | 63 ++++++++++++---------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c index a43fa38cae62..0e13a226e9be 100644 --- a/drivers/staging/rtl8723bs/core/rtw_debug.c +++ b/drivers/staging/rtl8723bs/core/rtw_debug.c @@ -14,41 +14,54 @@ u32 GlobalDebugLevel = _drv_err_; #include +static void dump_4_regs(struct adapter *adapter, int offset) +{ + u32 reg[4]; + int i; + + for (i = 0; i < 4; i++) + reg[i] = rtw_read32(adapter, offset + i); + + netdev_dbg(adapter->pnetdev, "0x%03x 0x%08x 0x%08x 0x%08x 0x%08x\n", + i, reg[0], reg[1], reg[2], reg[3]); +} + void mac_reg_dump(void *sel, struct adapter *adapter) { - int i, j = 1; + int i; netdev_dbg(adapter->pnetdev, "======= MAC REG =======\n"); - for (i = 0x0; i < 0x800; i += 4) { - if (j%4 == 1) - netdev_dbg(adapter->pnetdev, "0x%03x", i); - netdev_dbg(adapter->pnetdev, " 0x%08x ", - rtw_read32(adapter, i)); - if ((j++)%4 == 0) - netdev_dbg(adapter->pnetdev, "\n"); - } + for (i = 0x0; i < 0x800; i += 4) + dump_4_regs(adapter, i); } void bb_reg_dump(void *sel, struct adapter *adapter) { - int i, j = 1; + int i; netdev_dbg(adapter->pnetdev, "======= BB REG =======\n"); - for (i = 0x800; i < 0x1000 ; i += 4) { - if (j%4 == 1) - netdev_dbg(adapter->pnetdev, "0x%03x", i); - netdev_dbg(adapter->pnetdev, " 0x%08x ", - rtw_read32(adapter, i)); - if ((j++)%4 == 0) - netdev_dbg(adapter->pnetdev, "\n"); - } + + for (i = 0x800; i < 0x1000 ; i += 4) + dump_4_regs(adapter, i); +} + +static void dump_4_rf_regs(struct adapter *adapter, int path, int offset) +{ + u8 reg[4]; + int i; + + for (i = 0; i < 4; i++) + reg[i] = rtw_hal_read_rfreg(adapter, path, offset + i, + 0xffffffff); + + netdev_dbg(adapter->pnetdev, "0x%02x 0x%08x 0x%08x 0x%08x 0x%08x\n", + i, reg[0], reg[1], reg[2], reg[3]); } void rf_reg_dump(void *sel, struct adapter *adapter) { - int i, j = 1, path; - u32 value; + int i, path; u8 rf_type = 0; u8 path_nums = 0; @@ -62,13 +75,7 @@ void rf_reg_dump(void *sel, struct adapter *adapter) for (path = 0; path < path_nums; path++) { netdev_dbg(adapter->pnetdev, "RF_Path(%x)\n", path); - for (i = 0; i < 0x100; i++) { - value = rtw_hal_read_rfreg(adapter, path, i, 0xffffffff); - if (j%4 == 1) - netdev_dbg(adapter->pnetdev, "0x%02x ", i); - netdev_dbg(adapter->pnetdev, " 0x%08x ", value); - if ((j++)%4 == 0) - netdev_dbg(adapter->pnetdev, "\n"); - } + for (i = 0; i < 0x100; i++) + dump_4_rf_regs(adapter, path, i); } } From c106cb190cb7608e609b600d55441f97e8eb6344 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:47 +0200 Subject: [PATCH 061/744] staging: rtl8723bs: remove DBG_871X_SEL macro declaration remove DBG_871X_SEL macro declaration. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/1a0949adfc352d2560e9a68d340df386d94a79e8.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index ed75db1b16f8..fbae0d3b168c 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -158,15 +158,6 @@ #define RTW_DBGDUMP NULL /* 'stream' for _dbgdump */ -/* dump message to selected 'stream' */ -#define DBG_871X_SEL(sel, fmt, arg...) \ - do { \ - if (sel == RTW_DBGDUMP) \ - _DBG_871X_LEVEL(_drv_always_, fmt, ##arg); \ - else \ - seq_printf(sel, fmt, ##arg); \ - } while (0) - #endif /* defined(_dbgdump) */ void mac_reg_dump(void *sel, struct adapter *adapter); From 10cf7747638c60cc90585184ccd37ada425858d8 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:48 +0200 Subject: [PATCH 062/744] staging: rtl8723bs: remove unused _DBG_871X_LEVEL macro remove unused _DBG_871X_LEVEL macro, after DBG_871X_SEL deletion. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/83ff6acd438ad2107a9a1c9446cabb22a6c77f0a.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index fbae0d3b168c..fdd5933a3d5a 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -144,18 +144,6 @@ #if defined(_dbgdump) -/* without driver-defined prefix */ -#undef _DBG_871X_LEVEL -#define _DBG_871X_LEVEL(level, fmt, arg...) \ - do {\ - if (level <= GlobalDebugLevel) {\ - if (level <= _drv_err_ && level > _drv_always_) \ - _dbgdump("ERROR " fmt, ##arg);\ - else \ - _dbgdump(fmt, ##arg);\ - } \ - } while (0) - #define RTW_DBGDUMP NULL /* 'stream' for _dbgdump */ #endif /* defined(_dbgdump) */ From a8ce8f9f96347456ad12779e9872aec530b64bd3 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:49 +0200 Subject: [PATCH 063/744] staging: rtl8723bs: remove unused mac_reg_dump() function argument remove unused function argument void *sel from mac_reg_dump. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2ae03ee765c861d1fd4237af7b8d11a918be0d76.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_debug.c | 2 +- drivers/staging/rtl8723bs/include/rtw_debug.h | 2 +- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c index 0e13a226e9be..ad3cdbe45e55 100644 --- a/drivers/staging/rtl8723bs/core/rtw_debug.c +++ b/drivers/staging/rtl8723bs/core/rtw_debug.c @@ -26,7 +26,7 @@ static void dump_4_regs(struct adapter *adapter, int offset) i, reg[0], reg[1], reg[2], reg[3]); } -void mac_reg_dump(void *sel, struct adapter *adapter) +void mac_reg_dump(struct adapter *adapter) { int i; diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index fdd5933a3d5a..eabc21d2b689 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -148,7 +148,7 @@ #endif /* defined(_dbgdump) */ -void mac_reg_dump(void *sel, struct adapter *adapter); +void mac_reg_dump(struct adapter *adapter); void bb_reg_dump(void *sel, struct adapter *adapter); void rf_reg_dump(void *sel, struct adapter *adapter); diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index e98e5388d5c7..7951c362d664 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -2734,7 +2734,7 @@ static int rtw_dbg_port(struct net_device *dev, case 0xdd:/* registers dump , 0 for mac reg, 1 for bb reg, 2 for rf reg */ { if (extra_arg == 0) - mac_reg_dump(RTW_DBGDUMP, padapter); + mac_reg_dump(padapter); else if (extra_arg == 1) bb_reg_dump(RTW_DBGDUMP, padapter); else if (extra_arg == 2) From 5d047570e0a216a0fcc5d3bebf0bab4f3ee267ee Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:50 +0200 Subject: [PATCH 064/744] staging: rtl8723bs: remove unused bb_reg_dump() function argument remove unused function argument void *sel from bb_reg_dump. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/62bfb844bc77818ca0595b369e64eca3b8872470.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_debug.c | 2 +- drivers/staging/rtl8723bs/include/rtw_debug.h | 2 +- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c index ad3cdbe45e55..9dfa71580b2e 100644 --- a/drivers/staging/rtl8723bs/core/rtw_debug.c +++ b/drivers/staging/rtl8723bs/core/rtw_debug.c @@ -36,7 +36,7 @@ void mac_reg_dump(struct adapter *adapter) dump_4_regs(adapter, i); } -void bb_reg_dump(void *sel, struct adapter *adapter) +void bb_reg_dump(struct adapter *adapter) { int i; diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index eabc21d2b689..6064de93c24c 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -149,7 +149,7 @@ #endif /* defined(_dbgdump) */ void mac_reg_dump(struct adapter *adapter); -void bb_reg_dump(void *sel, struct adapter *adapter); +void bb_reg_dump(struct adapter *adapter); void rf_reg_dump(void *sel, struct adapter *adapter); #endif /* __RTW_DEBUG_H__ */ diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index 7951c362d664..fa260714b588 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -2736,7 +2736,7 @@ static int rtw_dbg_port(struct net_device *dev, if (extra_arg == 0) mac_reg_dump(padapter); else if (extra_arg == 1) - bb_reg_dump(RTW_DBGDUMP, padapter); + bb_reg_dump(padapter); else if (extra_arg == 2) rf_reg_dump(RTW_DBGDUMP, padapter); } From eeec59e45cc4f9faeee62c4643fbfd4ab35f04aa Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:51 +0200 Subject: [PATCH 065/744] staging: rtl8723bs: remove unused rf_reg_dump() function argument remove unused function argument void *sel from rf_reg_dump. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/32d99e0a094cc59a35788c468dd3e20b486c9e20.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_debug.c | 2 +- drivers/staging/rtl8723bs/include/rtw_debug.h | 2 +- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c index 9dfa71580b2e..642aa556c462 100644 --- a/drivers/staging/rtl8723bs/core/rtw_debug.c +++ b/drivers/staging/rtl8723bs/core/rtw_debug.c @@ -59,7 +59,7 @@ static void dump_4_rf_regs(struct adapter *adapter, int path, int offset) i, reg[0], reg[1], reg[2], reg[3]); } -void rf_reg_dump(void *sel, struct adapter *adapter) +void rf_reg_dump(struct adapter *adapter) { int i, path; u8 rf_type = 0; diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 6064de93c24c..fc187a4ed2c3 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -150,6 +150,6 @@ void mac_reg_dump(struct adapter *adapter); void bb_reg_dump(struct adapter *adapter); -void rf_reg_dump(void *sel, struct adapter *adapter); +void rf_reg_dump(struct adapter *adapter); #endif /* __RTW_DEBUG_H__ */ diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index fa260714b588..5912915a7870 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -2738,7 +2738,7 @@ static int rtw_dbg_port(struct net_device *dev, else if (extra_arg == 1) bb_reg_dump(padapter); else if (extra_arg == 2) - rf_reg_dump(RTW_DBGDUMP, padapter); + rf_reg_dump(padapter); } break; From aeef75e7c4a7c9f1a8e6ee3a72aac038ae3e7305 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:52 +0200 Subject: [PATCH 066/744] staging: rtl8723bs: remove unused RTW_DBGDUMP macro definition remove unused RTW_DBGDUMP macro definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/5efe991636b899936f39a7efceaac9edce9da91e.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index fc187a4ed2c3..c7e8187ca7f5 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -144,8 +144,6 @@ #if defined(_dbgdump) -#define RTW_DBGDUMP NULL /* 'stream' for _dbgdump */ - #endif /* defined(_dbgdump) */ void mac_reg_dump(struct adapter *adapter); From 33a5f34c56684ec7f2b247a1ba2051a0e23a7f4c Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:53 +0200 Subject: [PATCH 067/744] staging: rtl8723bs: remove all defs related to _dbgdump macro remove obsolete _dbgdump macro definition, undef and empty conditional code block. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/d9eaace0a9312dbc9bc5b6775489dbbb64554ed2.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index c7e8187ca7f5..2232a1014528 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -131,21 +131,13 @@ #define _MODULE_DEFINE_ _module_efuse_ #endif -#undef _dbgdump - #ifndef _RTL871X_DEBUG_C_ extern u32 GlobalDebugLevel; extern u64 GlobalDebugComponents; #endif -#define _dbgdump printk - #define DRIVER_PREFIX "RTL8723BS: " -#if defined(_dbgdump) - -#endif /* defined(_dbgdump) */ - void mac_reg_dump(struct adapter *adapter); void bb_reg_dump(struct adapter *adapter); void rf_reg_dump(struct adapter *adapter); From 198ffd276ff9ca4768e7174c7611e1f1b0e5e8a8 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:54 +0200 Subject: [PATCH 068/744] staging: rtl8723bs: remove unused debug variables declarations and initialization remove unused debug variables extern declarations and containing #ifndef block. remove initialization as well. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/d566a6eb49949c1c80df286056b9df6114c8cc97.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_debug.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 ----- 2 files changed, 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c index 642aa556c462..576b039f741c 100644 --- a/drivers/staging/rtl8723bs/core/rtw_debug.c +++ b/drivers/staging/rtl8723bs/core/rtw_debug.c @@ -10,8 +10,6 @@ #include #include -u32 GlobalDebugLevel = _drv_err_; - #include static void dump_4_regs(struct adapter *adapter, int offset) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 2232a1014528..579724e8fc2f 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -131,11 +131,6 @@ #define _MODULE_DEFINE_ _module_efuse_ #endif -#ifndef _RTL871X_DEBUG_C_ - extern u32 GlobalDebugLevel; - extern u64 GlobalDebugComponents; -#endif - #define DRIVER_PREFIX "RTL8723BS: " void mac_reg_dump(struct adapter *adapter); From 2ee42acab194b42c0a893ee0ed40f6b463086e6d Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:55 +0200 Subject: [PATCH 069/744] staging: rtl8723bs: remove unneeded header file include remove unneeded header file include. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/b58b5edf820026f08cb7289c1461561ecc95d41f.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 579724e8fc2f..acf4deacd3a7 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,8 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#include - #define _drv_always_ 1 #define _drv_emerg_ 2 #define _drv_alert_ 3 From 67f3a1c02844012024f7dc4775a5441a070e388b Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:56 +0200 Subject: [PATCH 070/744] staging: rtl8723bs: remove unused debug macro definitions remove unused debug macro definitions related to private log level tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/93b7f5af8f5220bd17530f7a907fa4fff4cb87d4.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index acf4deacd3a7..8f56d1e7e644 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,18 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _drv_always_ 1 -#define _drv_emerg_ 2 -#define _drv_alert_ 3 -#define _drv_crit_ 4 -#define _drv_err_ 5 -#define _drv_warning_ 6 -#define _drv_notice_ 7 -#define _drv_info_ 8 -#define _drv_dump_ 9 -#define _drv_debug_ 10 - - #define _module_rtl871x_xmit_c_ BIT(0) #define _module_xmit_osdep_c_ BIT(1) #define _module_rtl871x_recv_c_ BIT(2) From 9ce42bc33fd4a93f129822c07a019608f9b1eeda Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:57 +0200 Subject: [PATCH 071/744] staging: rtl8723bs: remove debug macros related to core/rtw_xmit.c tracing remove debug macros definitions related to core/rtw_xmit.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/fd7f02bee9b97bf4222931710092a54892825a3a.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_xmit.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index bd3acdd7d75f..03d036bd2ac6 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_XMIT_C_ - #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 8f56d1e7e644..ea4d34678b9c 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_xmit_c_ BIT(0) #define _module_xmit_osdep_c_ BIT(1) #define _module_rtl871x_recv_c_ BIT(2) #define _module_recv_osdep_c_ BIT(3) @@ -43,9 +42,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_XMIT_C_ - #define _MODULE_DEFINE_ _module_rtl871x_xmit_c_ -#elif defined _XMIT_OSDEP_C_ +#if defined _XMIT_OSDEP_C_ #define _MODULE_DEFINE_ _module_xmit_osdep_c_ #elif defined _RTW_RECV_C_ #define _MODULE_DEFINE_ _module_rtl871x_recv_c_ From 54f8a6ab76d7b3d45a68c053431e626cc7efc4ed Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:58 +0200 Subject: [PATCH 072/744] staging: rtl8723bs: remove debug macros related to os_dep/xmit_linux.c tracing remove debug macros definitions related to os_dep/xmit_linux.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/ab5984670fac9e534b08ae043ddb7cd63ce60450.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index ea4d34678b9c..6403a11d712d 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_xmit_osdep_c_ BIT(1) #define _module_rtl871x_recv_c_ BIT(2) #define _module_recv_osdep_c_ BIT(3) #define _module_rtl871x_mlme_c_ BIT(4) @@ -42,9 +41,7 @@ #undef _MODULE_DEFINE_ -#if defined _XMIT_OSDEP_C_ - #define _MODULE_DEFINE_ _module_xmit_osdep_c_ -#elif defined _RTW_RECV_C_ +#if defined _RTW_RECV_C_ #define _MODULE_DEFINE_ _module_rtl871x_recv_c_ #elif defined _RECV_OSDEP_C_ #define _MODULE_DEFINE_ _module_recv_osdep_c_ diff --git a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c index 639408eaf4df..6b039c1d8d57 100644 --- a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _XMIT_OSDEP_C_ - #include #include From a596ef1956034340212ee2e33ca55a595a794321 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:01:59 +0200 Subject: [PATCH 073/744] staging: rtl8723bs: remove debug macros related to core/rtw_recv.c tracing remove debug macros definitions related to core/rtw_recv.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/5af86d4dea96caf9c84f9ac302ec060edbc2fb65.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_recv.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c index f15cd7e39521..3e671cba6b94 100644 --- a/drivers/staging/rtl8723bs/core/rtw_recv.c +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_RECV_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 6403a11d712d..422d6bcfcc6f 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_recv_c_ BIT(2) #define _module_recv_osdep_c_ BIT(3) #define _module_rtl871x_mlme_c_ BIT(4) #define _module_mlme_osdep_c_ BIT(5) @@ -41,9 +40,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_RECV_C_ - #define _MODULE_DEFINE_ _module_rtl871x_recv_c_ -#elif defined _RECV_OSDEP_C_ +#if defined _RECV_OSDEP_C_ #define _MODULE_DEFINE_ _module_recv_osdep_c_ #elif defined _RTW_MLME_C_ #define _MODULE_DEFINE_ _module_rtl871x_mlme_c_ From 93026ce6a7bb2aa24869a69a3f9d40f3467648a5 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:00 +0200 Subject: [PATCH 074/744] staging: rtl8723bs: remove debug macros related to os_dep/recv_linux.c tracing remove debug macros definitions related to os_dep/recv_linux.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/7461d3589ff726ad3c61bb8c6edb1f177fcb0532.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- drivers/staging/rtl8723bs/os_dep/recv_linux.c | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 422d6bcfcc6f..d04f116bc9a4 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_recv_osdep_c_ BIT(3) #define _module_rtl871x_mlme_c_ BIT(4) #define _module_mlme_osdep_c_ BIT(5) #define _module_rtl871x_sta_mgt_c_ BIT(6) @@ -40,9 +39,7 @@ #undef _MODULE_DEFINE_ -#if defined _RECV_OSDEP_C_ - #define _MODULE_DEFINE_ _module_recv_osdep_c_ -#elif defined _RTW_MLME_C_ +#if defined _RTW_MLME_C_ #define _MODULE_DEFINE_ _module_rtl871x_mlme_c_ #elif defined _MLME_OSDEP_C_ #define _MODULE_DEFINE_ _module_mlme_osdep_c_ diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c index cd51430d4618..88a69c7ca8f2 100644 --- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RECV_OSDEP_C_ - #include #include #include From c2f04efd30c665e5336f235f474bec6ccd64f3c1 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:01 +0200 Subject: [PATCH 075/744] staging: rtl8723bs: remove debug macros related to core/rtw_mlme.c tracing remove debug macro definitions related to core/rtw_mlme.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/5ab63de74186fb9e8f90ffed9d7557b3e2d4caed.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index b9bd1e8a3f07..a6cd63b11ea1 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_MLME_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index d04f116bc9a4..01d723268254 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_mlme_c_ BIT(4) #define _module_mlme_osdep_c_ BIT(5) #define _module_rtl871x_sta_mgt_c_ BIT(6) #define _module_rtl871x_cmd_c_ BIT(7) @@ -39,9 +38,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_MLME_C_ - #define _MODULE_DEFINE_ _module_rtl871x_mlme_c_ -#elif defined _MLME_OSDEP_C_ +#if defined _MLME_OSDEP_C_ #define _MODULE_DEFINE_ _module_mlme_osdep_c_ #elif defined _RTW_MLME_EXT_C_ #define _MODULE_DEFINE_ 1 From bc5c27b687302f805f695eb321e56ae90194f592 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:02 +0200 Subject: [PATCH 076/744] staging: rtl8723bs: remove debug macros related to os_dep/mlme_linux.c tracing remove debug macro definitions related to os_dep/mlme_linux.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2528845d21764e95ab03d9245999b79acb2febd8.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- drivers/staging/rtl8723bs/os_dep/mlme_linux.c | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 01d723268254..7f5b98578d60 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_mlme_osdep_c_ BIT(5) #define _module_rtl871x_sta_mgt_c_ BIT(6) #define _module_rtl871x_cmd_c_ BIT(7) #define _module_cmd_osdep_c_ BIT(8) @@ -38,9 +37,7 @@ #undef _MODULE_DEFINE_ -#if defined _MLME_OSDEP_C_ - #define _MODULE_DEFINE_ _module_mlme_osdep_c_ -#elif defined _RTW_MLME_EXT_C_ +#if defined _RTW_MLME_EXT_C_ #define _MODULE_DEFINE_ 1 #elif defined _RTW_STA_MGT_C_ #define _MODULE_DEFINE_ _module_rtl871x_sta_mgt_c_ diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c index 0a16752f805b..a4560ba22db1 100644 --- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c @@ -4,10 +4,6 @@ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ - - -#define _MLME_OSDEP_C_ - #include #include From ffc49b55c97976a0efad5211139332da1e3dd709 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:03 +0200 Subject: [PATCH 077/744] staging: rtl8723bs: move static array definition from header to .c file move static array definition from header to .c file. This prepare removal of a conditional compile block _RTW_MLME_EXT_C_. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/665c9d33a97954508ca9257850a5690afcf0a9a9.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 30 +++++++++++++++++ .../staging/rtl8723bs/include/rtw_mlme_ext.h | 32 ------------------- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 602d00f1e6df..3a7a2dbac050 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -6002,6 +6002,36 @@ exit: return res; } +static struct fwevent wlanevents[] = { + {0, rtw_dummy_event_callback}, /*0*/ + {0, NULL}, + {0, NULL}, + {0, NULL}, + {0, NULL}, + {0, NULL}, + {0, NULL}, + {0, NULL}, + {0, &rtw_survey_event_callback}, /*8*/ + {sizeof(struct surveydone_event), &rtw_surveydone_event_callback}, /*9*/ + + {0, &rtw_joinbss_event_callback}, /*10*/ + {sizeof(struct stassoc_event), &rtw_stassoc_event_callback}, + {sizeof(struct stadel_event), &rtw_stadel_event_callback}, + {0, &rtw_atimdone_event_callback}, + {0, rtw_dummy_event_callback}, + {0, NULL}, /*15*/ + {0, NULL}, + {0, NULL}, + {0, NULL}, + {0, rtw_fwdbg_event_callback}, + {0, NULL}, /*20*/ + {0, NULL}, + {0, NULL}, + {0, &rtw_cpwm_event_callback}, + {0, NULL}, + {0, &rtw_wmm_event_callback}, + +}; u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf) { diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h index 472818c5fd83..0248b91b4525 100644 --- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h @@ -805,38 +805,6 @@ enum { #ifdef _RTW_MLME_EXT_C_ -static struct fwevent wlanevents[] = -{ - {0, rtw_dummy_event_callback}, /*0*/ - {0, NULL}, - {0, NULL}, - {0, NULL}, - {0, NULL}, - {0, NULL}, - {0, NULL}, - {0, NULL}, - {0, &rtw_survey_event_callback}, /*8*/ - {sizeof(struct surveydone_event), &rtw_surveydone_event_callback}, /*9*/ - - {0, &rtw_joinbss_event_callback}, /*10*/ - {sizeof(struct stassoc_event), &rtw_stassoc_event_callback}, - {sizeof(struct stadel_event), &rtw_stadel_event_callback}, - {0, &rtw_atimdone_event_callback}, - {0, rtw_dummy_event_callback}, - {0, NULL}, /*15*/ - {0, NULL}, - {0, NULL}, - {0, NULL}, - {0, rtw_fwdbg_event_callback}, - {0, NULL}, /*20*/ - {0, NULL}, - {0, NULL}, - {0, &rtw_cpwm_event_callback}, - {0, NULL}, - {0, &rtw_wmm_event_callback}, - -}; - #endif/* _RTL8192C_CMD_C_ */ #endif From c0b8b55ce1b9951869ec35e331dda1accfccb654 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:04 +0200 Subject: [PATCH 078/744] staging: rtl8723bs: remove debug macros related to core/rtw_mlme_ext.c tracing remove debug macro definitions related to core/rtw_mlme_ext.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/1579e958f5aa4584f6477a5b7c9bc3bd8933a5f7.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 3a7a2dbac050..a2fdd5ea5fc4 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_MLME_EXT_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 7f5b98578d60..d51e22ee1328 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -37,9 +37,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_MLME_EXT_C_ - #define _MODULE_DEFINE_ 1 -#elif defined _RTW_STA_MGT_C_ +#if defined _RTW_STA_MGT_C_ #define _MODULE_DEFINE_ _module_rtl871x_sta_mgt_c_ #elif defined _RTW_CMD_C_ #define _MODULE_DEFINE_ _module_rtl871x_cmd_c_ From 8acdc8db86d55a8a93dac132b995f4513c60f6f1 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:05 +0200 Subject: [PATCH 079/744] staging: rtl8723bs: remove debug macros related to core/rtw_sta_mgt.c tracing remove debug macro definitions related to core/rtw_sta_mgt.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/7f82e61bc21e53a6c3e5bdcd2ac0322b6ff75a47.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c index 233febc14598..385bbbdb2de5 100644 --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_STA_MGT_C_ - #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index d51e22ee1328..76756f6aac99 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_sta_mgt_c_ BIT(6) #define _module_rtl871x_cmd_c_ BIT(7) #define _module_cmd_osdep_c_ BIT(8) #define _module_rtl871x_io_c_ BIT(9) @@ -37,9 +36,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_STA_MGT_C_ - #define _MODULE_DEFINE_ _module_rtl871x_sta_mgt_c_ -#elif defined _RTW_CMD_C_ +#if defined _RTW_CMD_C_ #define _MODULE_DEFINE_ _module_rtl871x_cmd_c_ #elif defined _CMD_OSDEP_C_ #define _MODULE_DEFINE_ _module_cmd_osdep_c_ From 3c747a990438f11478cf5389f91cb1250c8a9d53 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:06 +0200 Subject: [PATCH 080/744] staging: rtl8723bs: remove debug macros related to core/rtw_cmd.c tracing remove debug macro definitions related to core/rtw_cmd.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/7b32950581f7584b448ee277627fc57beb113026.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index e1a8f8b47edd..75db4272e537 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_CMD_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 76756f6aac99..bb56d38e6b7a 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_cmd_c_ BIT(7) #define _module_cmd_osdep_c_ BIT(8) #define _module_rtl871x_io_c_ BIT(9) #define _module_io_osdep_c_ BIT(10) @@ -36,9 +35,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_CMD_C_ - #define _MODULE_DEFINE_ _module_rtl871x_cmd_c_ -#elif defined _CMD_OSDEP_C_ +#if defined _CMD_OSDEP_C_ #define _MODULE_DEFINE_ _module_cmd_osdep_c_ #elif defined _RTW_IO_C_ #define _MODULE_DEFINE_ _module_rtl871x_io_c_ From e45199eaa0a483d6723500455227aa768644349e Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:07 +0200 Subject: [PATCH 081/744] staging: rtl8723bs: remove obsolete debug macro definitions remove debug macro definition untied to any tracing component. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/5bc9e69d8ba03d2bd8031bcff73b22aeed5c0912.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index bb56d38e6b7a..6e6dea4779d9 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_cmd_osdep_c_ BIT(8) #define _module_rtl871x_io_c_ BIT(9) #define _module_io_osdep_c_ BIT(10) #define _module_os_intfs_c_ BIT(11) @@ -35,9 +34,7 @@ #undef _MODULE_DEFINE_ -#if defined _CMD_OSDEP_C_ - #define _MODULE_DEFINE_ _module_cmd_osdep_c_ -#elif defined _RTW_IO_C_ +#if defined _RTW_IO_C_ #define _MODULE_DEFINE_ _module_rtl871x_io_c_ #elif defined _IO_OSDEP_C_ #define _MODULE_DEFINE_ _module_io_osdep_c_ From c479026ce60ffe90b5dd2febcc2a86df8cd0de48 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:08 +0200 Subject: [PATCH 082/744] staging: rtl8723bs: remove debug macros related to core/rtw_io.c tracing remove debug macro definitions related to core/rtw_io.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2c97fc0121e3dfbc97bbc1ce5bb9d4a05e5c88d4.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_io.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_io.c b/drivers/staging/rtl8723bs/core/rtw_io.c index c860ab7d618c..ecbb679fbc16 100644 --- a/drivers/staging/rtl8723bs/core/rtw_io.c +++ b/drivers/staging/rtl8723bs/core/rtw_io.c @@ -25,8 +25,6 @@ jackson@realtek.com.tw */ -#define _RTW_IO_C_ - #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 6e6dea4779d9..7206fdfbe12d 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_io_c_ BIT(9) #define _module_io_osdep_c_ BIT(10) #define _module_os_intfs_c_ BIT(11) #define _module_rtl871x_security_c_ BIT(12) @@ -34,9 +33,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_IO_C_ - #define _MODULE_DEFINE_ _module_rtl871x_io_c_ -#elif defined _IO_OSDEP_C_ +#if defined _IO_OSDEP_C_ #define _MODULE_DEFINE_ _module_io_osdep_c_ #elif defined _OS_INTFS_C_ #define _MODULE_DEFINE_ _module_os_intfs_c_ From 7c75c38553ba061228474f4aa43ffbc601966241 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:09 +0200 Subject: [PATCH 083/744] staging: rtl8723bs: remove obsolete _IO_OSDEP_C_ debug macro definition remove _IO_OSDEP_C_ debug macro definition untied to any tracing component. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/ba3b9ef9a999f6039f204f5b06be45584c267af2.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 7206fdfbe12d..470edb0b655b 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_io_osdep_c_ BIT(10) #define _module_os_intfs_c_ BIT(11) #define _module_rtl871x_security_c_ BIT(12) #define _module_rtl871x_eeprom_c_ BIT(13) @@ -33,9 +32,7 @@ #undef _MODULE_DEFINE_ -#if defined _IO_OSDEP_C_ - #define _MODULE_DEFINE_ _module_io_osdep_c_ -#elif defined _OS_INTFS_C_ +#if defined _OS_INTFS_C_ #define _MODULE_DEFINE_ _module_os_intfs_c_ #elif defined _RTW_SECURITY_C_ #define _MODULE_DEFINE_ _module_rtl871x_security_c_ From 4c53cdb3b3ac54bf3fa9a9aced7a3e820750ce62 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:10 +0200 Subject: [PATCH 084/744] staging: rtl8723bs: remove debug macros related to os_dep/os_intfs.c tracing remove debug macro definitions related to os_dep/os_intfs.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/53110c205451e641f8e24c07d36fe6cc5d087e60.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 470edb0b655b..f7c2d9ac3a61 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_os_intfs_c_ BIT(11) #define _module_rtl871x_security_c_ BIT(12) #define _module_rtl871x_eeprom_c_ BIT(13) #define _module_hal_init_c_ BIT(14) @@ -32,9 +31,7 @@ #undef _MODULE_DEFINE_ -#if defined _OS_INTFS_C_ - #define _MODULE_DEFINE_ _module_os_intfs_c_ -#elif defined _RTW_SECURITY_C_ +#if defined _RTW_SECURITY_C_ #define _MODULE_DEFINE_ _module_rtl871x_security_c_ #elif defined _RTW_EEPROM_C_ #define _MODULE_DEFINE_ _module_rtl871x_eeprom_c_ diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 160f624612c7..6ac78a9ae615 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _OS_INTFS_C_ - #include #include #include From 5610af57dc499aa02c361c4fe166123795324f3e Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:11 +0200 Subject: [PATCH 085/744] staging: rtl8723bs: remove debug macros related to core/rtw_security.c tracing remove debug macro definitions related to core/rtw_security.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/510d1f1223156d1b613c6562aeaf86385734214c.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_security.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c index 804168a37771..e4f3049ac351 100644 --- a/drivers/staging/rtl8723bs/core/rtw_security.c +++ b/drivers/staging/rtl8723bs/core/rtw_security.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_SECURITY_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index f7c2d9ac3a61..70bfe24d9e0c 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_security_c_ BIT(12) #define _module_rtl871x_eeprom_c_ BIT(13) #define _module_hal_init_c_ BIT(14) #define _module_hci_hal_init_c_ BIT(15) @@ -31,9 +30,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_SECURITY_C_ - #define _MODULE_DEFINE_ _module_rtl871x_security_c_ -#elif defined _RTW_EEPROM_C_ +#if defined _RTW_EEPROM_C_ #define _MODULE_DEFINE_ _module_rtl871x_eeprom_c_ #elif defined _HAL_INTF_C_ #define _MODULE_DEFINE_ _module_hal_init_c_ From 8edee4306a87e25f476ef6264ead7a1c68aa2e4e Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:12 +0200 Subject: [PATCH 086/744] staging: rtl8723bs: remove debug macros related to core/rtw_eeprom.c tracing remove debug macro definitions related to core/rtw_eeprom.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/d11884043d17db211793e35e9d07a570951110e8.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_eeprom.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_eeprom.c b/drivers/staging/rtl8723bs/core/rtw_eeprom.c index be0eda1604d0..4dcee4d2e513 100644 --- a/drivers/staging/rtl8723bs/core/rtw_eeprom.c +++ b/drivers/staging/rtl8723bs/core/rtw_eeprom.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_EEPROM_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 70bfe24d9e0c..8a4ee840434e 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_eeprom_c_ BIT(13) #define _module_hal_init_c_ BIT(14) #define _module_hci_hal_init_c_ BIT(15) #define _module_rtl871x_ioctl_c_ BIT(16) @@ -30,9 +29,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_EEPROM_C_ - #define _MODULE_DEFINE_ _module_rtl871x_eeprom_c_ -#elif defined _HAL_INTF_C_ +#if defined _HAL_INTF_C_ #define _MODULE_DEFINE_ _module_hal_init_c_ #elif (defined _HCI_HAL_INIT_C_) || (defined _SDIO_HALINIT_C_) #define _MODULE_DEFINE_ _module_hci_hal_init_c_ From 3ddc92d111e4859b1233dc47c873d421088d3bf3 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:13 +0200 Subject: [PATCH 087/744] staging: rtl8723bs: remove debug macros related to hal/hal_intf.c tracing remove debug macro definitions related to hal/hal_intf.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/7f64d5d78b42874364f24a2fb11f664ad9988d99.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/hal_intf.c | 3 --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_intf.c b/drivers/staging/rtl8723bs/hal/hal_intf.c index 8dc4dd8c6d4c..4868a69cdb8f 100644 --- a/drivers/staging/rtl8723bs/hal/hal_intf.c +++ b/drivers/staging/rtl8723bs/hal/hal_intf.c @@ -4,9 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ - -#define _HAL_INTF_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 8a4ee840434e..4da881e3a0c0 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_hal_init_c_ BIT(14) #define _module_hci_hal_init_c_ BIT(15) #define _module_rtl871x_ioctl_c_ BIT(16) #define _module_rtl871x_ioctl_set_c_ BIT(17) @@ -29,9 +28,7 @@ #undef _MODULE_DEFINE_ -#if defined _HAL_INTF_C_ - #define _MODULE_DEFINE_ _module_hal_init_c_ -#elif (defined _HCI_HAL_INIT_C_) || (defined _SDIO_HALINIT_C_) +#if (defined _HCI_HAL_INIT_C_) || (defined _SDIO_HALINIT_C_) #define _MODULE_DEFINE_ _module_hci_hal_init_c_ #elif defined _RTL871X_IOCTL_C_ #define _MODULE_DEFINE_ _module_rtl871x_ioctl_c_ From c529c96139a2e7efc71157f83e435ee31ecc0c52 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:14 +0200 Subject: [PATCH 088/744] staging: rtl8723bs: remove debug macros related to hal/sdio_halinit.c tracing remove debug macro definitions related to hal/sdio_halinit.c obsolete tracing. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/0de5a9cd0c70f1a5609320e545206376a7cf4498.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/sdio_halinit.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c index a19c6ec0d063..fa285003b427 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _SDIO_HALINIT_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 4da881e3a0c0..4146acb1cbb2 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_hci_hal_init_c_ BIT(15) #define _module_rtl871x_ioctl_c_ BIT(16) #define _module_rtl871x_ioctl_set_c_ BIT(17) #define _module_rtl871x_ioctl_query_c_ BIT(18) @@ -28,9 +27,7 @@ #undef _MODULE_DEFINE_ -#if (defined _HCI_HAL_INIT_C_) || (defined _SDIO_HALINIT_C_) - #define _MODULE_DEFINE_ _module_hci_hal_init_c_ -#elif defined _RTL871X_IOCTL_C_ +#if defined _RTL871X_IOCTL_C_ #define _MODULE_DEFINE_ _module_rtl871x_ioctl_c_ #elif defined _RTL871X_IOCTL_SET_C_ #define _MODULE_DEFINE_ _module_rtl871x_ioctl_set_c_ From ebb0a22ea4be838a32727cded1f7b23c3e5d256c Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:15 +0200 Subject: [PATCH 089/744] staging: rtl8723bs: remove unused debug macros tied to _RTL871X_IOCTL_C_ definition remove unused private debug macros tied to _RTL871X_IOCTL_C_ definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/216def2b5e244490debe86aafdc23cabc32f3c1e.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 4146acb1cbb2..501155c8c9cf 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_ioctl_c_ BIT(16) #define _module_rtl871x_ioctl_set_c_ BIT(17) #define _module_rtl871x_ioctl_query_c_ BIT(18) #define _module_rtl871x_pwrctrl_c_ BIT(19) @@ -27,9 +26,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTL871X_IOCTL_C_ - #define _MODULE_DEFINE_ _module_rtl871x_ioctl_c_ -#elif defined _RTL871X_IOCTL_SET_C_ +#if defined _RTL871X_IOCTL_SET_C_ #define _MODULE_DEFINE_ _module_rtl871x_ioctl_set_c_ #elif defined _RTL871X_IOCTL_QUERY_C_ #define _MODULE_DEFINE_ _module_rtl871x_ioctl_query_c_ From 8b63686eab1afabe02b72007051f8994f7bb5728 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:16 +0200 Subject: [PATCH 090/744] staging: rtl8723bs: remove unused debug macros tied to _RTL871X_IOCTL_SET_C_ definition remove unused debug macros tied to _RTL871X_IOCTL_SET_C_ definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/f21423d909f1c2b95cac10a715ea49af76b776b1.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 501155c8c9cf..7f84bc03e9c7 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_ioctl_set_c_ BIT(17) #define _module_rtl871x_ioctl_query_c_ BIT(18) #define _module_rtl871x_pwrctrl_c_ BIT(19) #define _module_hci_intfs_c_ BIT(20) @@ -26,9 +25,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTL871X_IOCTL_SET_C_ - #define _MODULE_DEFINE_ _module_rtl871x_ioctl_set_c_ -#elif defined _RTL871X_IOCTL_QUERY_C_ +#if defined _RTL871X_IOCTL_QUERY_C_ #define _MODULE_DEFINE_ _module_rtl871x_ioctl_query_c_ #elif defined _RTL871X_PWRCTRL_C_ #define _MODULE_DEFINE_ _module_rtl871x_pwrctrl_c_ From 0744b91b59e2640ace1b9c5c418288bf97c0d67a Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:17 +0200 Subject: [PATCH 091/744] staging: rtl8723bs: remove unused debug macros tied to _RTL871X_IOCTL_QUERY_C_ definition remove unused debug macros tied to _RTL871X_IOCTL_QUERY_C_ definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/9157d4b219072ef48e5e91814718d2b19d0e3b77.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 7f84bc03e9c7..be44d72599d3 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_ioctl_query_c_ BIT(18) #define _module_rtl871x_pwrctrl_c_ BIT(19) #define _module_hci_intfs_c_ BIT(20) #define _module_hci_ops_c_ BIT(21) @@ -25,9 +24,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTL871X_IOCTL_QUERY_C_ - #define _MODULE_DEFINE_ _module_rtl871x_ioctl_query_c_ -#elif defined _RTL871X_PWRCTRL_C_ +#if defined _RTL871X_PWRCTRL_C_ #define _MODULE_DEFINE_ _module_rtl871x_pwrctrl_c_ #elif defined _RTW_PWRCTRL_C_ #define _MODULE_DEFINE_ 1 From 74a0738db3fffe1a6d55699f03117cb6625f4781 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:18 +0200 Subject: [PATCH 092/744] staging: rtl8723bs: remove unused debug macros tied to _RTL871X_PWRCTRL_C_ definition remove unused debug macros tied to _RTL871X_PWRCTRL_C_ definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/97a5e6be392933da40c4c31cebe7ad2d8d21cf33.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index be44d72599d3..8e324313ebf9 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_pwrctrl_c_ BIT(19) #define _module_hci_intfs_c_ BIT(20) #define _module_hci_ops_c_ BIT(21) #define _module_osdep_service_c_ BIT(22) @@ -24,9 +23,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTL871X_PWRCTRL_C_ - #define _MODULE_DEFINE_ _module_rtl871x_pwrctrl_c_ -#elif defined _RTW_PWRCTRL_C_ +#if defined _RTW_PWRCTRL_C_ #define _MODULE_DEFINE_ 1 #elif defined _HCI_INTF_C_ #define _MODULE_DEFINE_ _module_hci_intfs_c_ From e8bc244c28e128e794af47a22e56fa2877e77240 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:19 +0200 Subject: [PATCH 093/744] staging: rtl8723bs: remove unused macros tied to core/rtw_pwrctrl.c debug remove unused macro definitions tied to core/rtw_pwrctrl.c debug. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/0f746668ec65d6c188ba422778d6edc2b6eb7d91.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c index 251b9abdf591..a392d5b4caf2 100644 --- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_PWRCTRL_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 8e324313ebf9..a7f6827c282f 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -23,9 +23,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTW_PWRCTRL_C_ - #define _MODULE_DEFINE_ 1 -#elif defined _HCI_INTF_C_ +#if defined _HCI_INTF_C_ #define _MODULE_DEFINE_ _module_hci_intfs_c_ #elif defined _HCI_OPS_C_ #define _MODULE_DEFINE_ _module_hci_ops_c_ From 65b00505f1fb2ea7ba8550a231150f4a62901256 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:20 +0200 Subject: [PATCH 094/744] staging: rtl8723bs: remove unused macros tied to os_dep/sdio_intf.c debug remove unused macro definitions tied to os_dep/sdio_intf.c debug. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/c6f3a9d8eb1d868c869b0e37753cf7cfe15bad91.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 7 +------ drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 2 -- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index a7f6827c282f..130cfe3d2032 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_hci_intfs_c_ BIT(20) #define _module_hci_ops_c_ BIT(21) #define _module_osdep_service_c_ BIT(22) #define _module_mp_ BIT(23) @@ -23,14 +22,10 @@ #undef _MODULE_DEFINE_ -#if defined _HCI_INTF_C_ - #define _MODULE_DEFINE_ _module_hci_intfs_c_ -#elif defined _HCI_OPS_C_ +#if defined _HCI_OPS_C_ #define _MODULE_DEFINE_ _module_hci_ops_c_ #elif defined _SDIO_OPS_C_ #define _MODULE_DEFINE_ 1 -#elif defined _OSDEP_HCI_INTF_C_ - #define _MODULE_DEFINE_ _module_hci_intfs_c_ #elif defined _OSDEP_SERVICE_C_ #define _MODULE_DEFINE_ _module_osdep_service_c_ #elif defined _HCI_OPS_OS_C_ diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c index d2bf444117b8..5e484344e172 100644 --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _HCI_INTF_C_ - #include #include #include From c7432a3c7ab3b9fde85f40dec35a090036fa76a8 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:21 +0200 Subject: [PATCH 095/744] staging: rtl8723bs: remove unused debug macros tied to _HCI_OPS_C_ definition remove unused debug macros tied to _HCI_OPS_C_ definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/044b8f9e0ea4f09287b73be0c65a526606c86d89.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 130cfe3d2032..3becb1b8d15e 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_hci_ops_c_ BIT(21) #define _module_osdep_service_c_ BIT(22) #define _module_mp_ BIT(23) #define _module_hci_ops_os_c_ BIT(24) @@ -22,9 +21,7 @@ #undef _MODULE_DEFINE_ -#if defined _HCI_OPS_C_ - #define _MODULE_DEFINE_ _module_hci_ops_c_ -#elif defined _SDIO_OPS_C_ +#if defined _SDIO_OPS_C_ #define _MODULE_DEFINE_ 1 #elif defined _OSDEP_SERVICE_C_ #define _MODULE_DEFINE_ _module_osdep_service_c_ From 57e3a852160a3844710d8a35299dfa7eead9d954 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:22 +0200 Subject: [PATCH 096/744] staging: rtl8723bs: remove unused debug macros tied to hal/sdio_ops.c debug remove unused debug macros tied to hal/sdio_ops.c debug. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/8f3acec03ecd9ece6d60404520a9ac188f718a55.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/sdio_ops.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/sdio_ops.c b/drivers/staging/rtl8723bs/hal/sdio_ops.c index c1b29e18950e..196b2232c17d 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_ops.c +++ b/drivers/staging/rtl8723bs/hal/sdio_ops.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * *******************************************************************************/ -#define _SDIO_OPS_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 3becb1b8d15e..c061d874f4e6 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -21,9 +21,7 @@ #undef _MODULE_DEFINE_ -#if defined _SDIO_OPS_C_ - #define _MODULE_DEFINE_ 1 -#elif defined _OSDEP_SERVICE_C_ +#if defined _OSDEP_SERVICE_C_ #define _MODULE_DEFINE_ _module_osdep_service_c_ #elif defined _HCI_OPS_OS_C_ #define _MODULE_DEFINE_ _module_hci_ops_os_c_ From 43a0faffd44d9fba482306e7bf65e012740ba729 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:23 +0200 Subject: [PATCH 097/744] staging: rtl8723bs: remove unused debug macros tied to os_dep/osdep_service.c debug remove unused debug macros tied to os_dep/osdep_service.c debug. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/c6e1367c0cc08a06e4eefe60f1aadd25d46675c3.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- drivers/staging/rtl8723bs/os_dep/osdep_service.c | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index c061d874f4e6..3e391a23ac8f 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_osdep_service_c_ BIT(22) #define _module_mp_ BIT(23) #define _module_hci_ops_os_c_ BIT(24) #define _module_rtl871x_ioctl_os_c BIT(25) @@ -21,9 +20,7 @@ #undef _MODULE_DEFINE_ -#if defined _OSDEP_SERVICE_C_ - #define _MODULE_DEFINE_ _module_osdep_service_c_ -#elif defined _HCI_OPS_OS_C_ +#if defined _HCI_OPS_OS_C_ #define _MODULE_DEFINE_ _module_hci_ops_os_c_ #elif defined _RTL871X_IOCTL_LINUX_C_ #define _MODULE_DEFINE_ _module_rtl871x_ioctl_os_c diff --git a/drivers/staging/rtl8723bs/os_dep/osdep_service.c b/drivers/staging/rtl8723bs/os_dep/osdep_service.c index 9c6b1666df13..c58555a4012f 100644 --- a/drivers/staging/rtl8723bs/os_dep/osdep_service.c +++ b/drivers/staging/rtl8723bs/os_dep/osdep_service.c @@ -4,10 +4,6 @@ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. * ******************************************************************************/ - - -#define _OSDEP_SERVICE_C_ - #include #include From 3dc3456e0d43b6a68786cb0f6e413002bb870fc6 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:24 +0200 Subject: [PATCH 098/744] staging: rtl8723bs: remove unused _module_mp_ def remove unused _module_mp_ def. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/9e8945a3f4f58b32eb2ed3e943f8cc0cd6c26823.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 3e391a23ac8f..261317b07635 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_mp_ BIT(23) #define _module_hci_ops_os_c_ BIT(24) #define _module_rtl871x_ioctl_os_c BIT(25) #define _module_rtl8712_cmd_c_ BIT(26) From 72b2b0467b4f0856d7d26d5b13a10ff36362be1a Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:25 +0200 Subject: [PATCH 099/744] staging: rtl8723bs: remove unused macros tied to _HCI_OPS_OS_C_ definition remove unused macros tied to _HCI_OPS_OS_C_ definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/8cddae8116da58df3f5a9be48e618418a4c686ef.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 261317b07635..a6c2956133ed 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_hci_ops_os_c_ BIT(24) #define _module_rtl871x_ioctl_os_c BIT(25) #define _module_rtl8712_cmd_c_ BIT(26) /* define _module_efuse_ BIT(27) */ @@ -19,9 +18,7 @@ #undef _MODULE_DEFINE_ -#if defined _HCI_OPS_OS_C_ - #define _MODULE_DEFINE_ _module_hci_ops_os_c_ -#elif defined _RTL871X_IOCTL_LINUX_C_ +#if defined _RTL871X_IOCTL_LINUX_C_ #define _MODULE_DEFINE_ _module_rtl871x_ioctl_os_c #elif defined _RTL8712_CMD_C_ #define _MODULE_DEFINE_ _module_rtl8712_cmd_c_ From d0ffbfae136a4b0acaaa1aef883c77b990b9fe60 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:26 +0200 Subject: [PATCH 100/744] staging: rtl8723bs: remove unused macros tied to _RTL871X_IOCTL_LINUX_C definition remove unused macros tied to _RTL871X_IOCTL_LINUX_C_ definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/6c836355bb4a51a3f9925e0cc75cbce3c0b63df8.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index a6c2956133ed..550cff9b1147 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl871x_ioctl_os_c BIT(25) #define _module_rtl8712_cmd_c_ BIT(26) /* define _module_efuse_ BIT(27) */ #define _module_rtl8192c_xmit_c_ BIT(28) @@ -18,9 +17,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTL871X_IOCTL_LINUX_C_ - #define _MODULE_DEFINE_ _module_rtl871x_ioctl_os_c -#elif defined _RTL8712_CMD_C_ +#if defined _RTL8712_CMD_C_ #define _MODULE_DEFINE_ _module_rtl8712_cmd_c_ #elif defined _RTL8192C_XMIT_C_ #define _MODULE_DEFINE_ 1 From 7d8fff53cd7a46d1aaaa3f88efaa93851a8cbcb7 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:27 +0200 Subject: [PATCH 101/744] staging: rtl8723bs: remove unused macros tied to _RTL8712_CMD_C_ definition remove unused macros tied to _RTL8712_CMD_C_ definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/5e4a8015eaca090e8a4df872760c9a1556ff551f.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 550cff9b1147..1a52200e525c 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl8712_cmd_c_ BIT(26) /* define _module_efuse_ BIT(27) */ #define _module_rtl8192c_xmit_c_ BIT(28) #define _module_hal_xmit_c_ BIT(28) @@ -17,9 +16,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTL8712_CMD_C_ - #define _MODULE_DEFINE_ _module_rtl8712_cmd_c_ -#elif defined _RTL8192C_XMIT_C_ +#if defined _RTL8192C_XMIT_C_ #define _MODULE_DEFINE_ 1 #elif defined _RTL8723AS_XMIT_C_ #define _MODULE_DEFINE_ 1 From c9727c55874f1e8caafdbe0c261a22ae69b76019 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:28 +0200 Subject: [PATCH 102/744] staging: rtl8723bs: remove commented out macro definition remove commented out debug macro definition. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2b56922e8e4c5fde6e594a9bbeb888bf7717015d.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 1a52200e525c..cde4b1d6a4b7 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -/* define _module_efuse_ BIT(27) */ #define _module_rtl8192c_xmit_c_ BIT(28) #define _module_hal_xmit_c_ BIT(28) #define _module_efuse_ BIT(29) From e5ec9bf4a0f5ea7da802cf0411f00f38646f34df Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:29 +0200 Subject: [PATCH 103/744] staging: rtl8723bs: remove unused debug macro definitions remove unused debug macro definitions. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/02f0a7ad7ad00dbafeaee1796f62f8f2e921d772.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index cde4b1d6a4b7..ad96fe1de971 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,11 +7,8 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl8192c_xmit_c_ BIT(28) -#define _module_hal_xmit_c_ BIT(28) #define _module_efuse_ BIT(29) #define _module_rtl8712_recv_c_ BIT(30) -#define _module_rtl8712_led_c_ BIT(31) #undef _MODULE_DEFINE_ From 2f3103bf4f07f5f8390caf6ce9f1e7861cdc6704 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:30 +0200 Subject: [PATCH 104/744] staging: rtl8723bs: remove unused macros tied to core/rtw_efuse.c debug remove unused macros tied to core/rtw_efuse.c debug. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/13673f9241ca482e6f02cfb16a765dd0c4feaa84.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_efuse.c | 2 -- drivers/staging/rtl8723bs/include/rtw_debug.h | 3 --- 2 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_efuse.c b/drivers/staging/rtl8723bs/core/rtw_efuse.c index a28a06d5a576..1f22eb4a29fa 100644 --- a/drivers/staging/rtl8723bs/core/rtw_efuse.c +++ b/drivers/staging/rtl8723bs/core/rtw_efuse.c @@ -4,8 +4,6 @@ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. * ******************************************************************************/ -#define _RTW_EFUSE_C_ - #include #include #include diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index ad96fe1de971..6b657190b124 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_efuse_ BIT(29) #define _module_rtl8712_recv_c_ BIT(30) #undef _MODULE_DEFINE_ @@ -22,8 +21,6 @@ #define _MODULE_DEFINE_ _module_rtl8712_recv_c_ #elif defined _RTL871X_MLME_EXT_C_ #define _MODULE_DEFINE_ _module_mlme_osdep_c_ -#elif defined _RTW_EFUSE_C_ - #define _MODULE_DEFINE_ _module_efuse_ #endif #define DRIVER_PREFIX "RTL8723BS: " From 4a98eb30e4654b47751530b86271648262ba49d6 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:31 +0200 Subject: [PATCH 105/744] staging: rtl8723bs: remove unsed debug macros tied to no particular code debug remove unused debug macros tied to no particular code debug Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/a16431ce89e313029c09381f78bb0f58c23fd7e2.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 6b657190b124..c9f53c08efbb 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -11,11 +11,7 @@ #undef _MODULE_DEFINE_ -#if defined _RTL8192C_XMIT_C_ - #define _MODULE_DEFINE_ 1 -#elif defined _RTL8723AS_XMIT_C_ - #define _MODULE_DEFINE_ 1 -#elif defined _RTL8712_RECV_C_ +#if defined _RTL8712_RECV_C_ #define _MODULE_DEFINE_ _module_rtl8712_recv_c_ #elif defined _RTL8192CU_RECV_C_ #define _MODULE_DEFINE_ _module_rtl8712_recv_c_ From 5a155c08c0b71cd6f200d48a34d69dc134da6b45 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:32 +0200 Subject: [PATCH 106/744] staging: rtl8723bs: remove last unused debug macros remove last unused debug macros. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/3baf120a9e99d087968e8db55e2b1c33ae5c5e8a.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index c9f53c08efbb..189f02a8300a 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,18 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define _module_rtl8712_recv_c_ BIT(30) - -#undef _MODULE_DEFINE_ - -#if defined _RTL8712_RECV_C_ - #define _MODULE_DEFINE_ _module_rtl8712_recv_c_ -#elif defined _RTL8192CU_RECV_C_ - #define _MODULE_DEFINE_ _module_rtl8712_recv_c_ -#elif defined _RTL871X_MLME_EXT_C_ - #define _MODULE_DEFINE_ _module_mlme_osdep_c_ -#endif - #define DRIVER_PREFIX "RTL8723BS: " void mac_reg_dump(struct adapter *adapter); From acbc0849bd30c28a35f8404e75c0ac5bc50fef1f Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Sat, 24 Apr 2021 11:02:33 +0200 Subject: [PATCH 107/744] staging: rtl8723bs: macro DRIVER_PREFIX expands to lowercase driver name macro DRIVER_PREFIX expands to lowercase driver name. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/c986e9a3c9b2f73cb784bd5dc7c877eb9a669c89.1619254603.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 189f02a8300a..3a5b083e95a1 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,7 +7,7 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define DRIVER_PREFIX "RTL8723BS: " +#define DRIVER_PREFIX "rtl8723bs: " void mac_reg_dump(struct adapter *adapter); void bb_reg_dump(struct adapter *adapter); From b1e9109aeff366d7e1934e8b3ef8025684c9f6e8 Mon Sep 17 00:00:00 2001 From: Ashish Kalra Date: Sat, 1 May 2021 19:22:41 +0530 Subject: [PATCH 108/744] staging: wlan-ng: silence incorrect type in argument 1 (different address spaces) Currently p80211knetdev_do_ioctl use type casting to req->data to prevent sparse warning while calling memdup_user, instead of type casting it here, its better to change data type for data inside p80211ioctl_req to include __user. Signed-off-by: Ashish Kalra Link: https://lore.kernel.org/r/YI1dKdfBKaSh3J8v@ashish-NUC8i5BEH Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlan-ng/p80211ioctl.h | 2 +- drivers/staging/wlan-ng/p80211netdev.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wlan-ng/p80211ioctl.h b/drivers/staging/wlan-ng/p80211ioctl.h index ed65ac57adbe..77e8d2913b76 100644 --- a/drivers/staging/wlan-ng/p80211ioctl.h +++ b/drivers/staging/wlan-ng/p80211ioctl.h @@ -81,7 +81,7 @@ struct p80211ioctl_req { char name[WLAN_DEVNAMELEN_MAX]; - caddr_t data; + char __user *data; u32 magic; u16 len; u32 result; diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers/staging/wlan-ng/p80211netdev.c index a02ae9b13ccc..6f470e7ba647 100644 --- a/drivers/staging/wlan-ng/p80211netdev.c +++ b/drivers/staging/wlan-ng/p80211netdev.c @@ -569,7 +569,7 @@ static int p80211knetdev_do_ioctl(struct net_device *dev, goto bail; } - msgbuf = memdup_user((void __user *)req->data, req->len); + msgbuf = memdup_user(req->data, req->len); if (IS_ERR(msgbuf)) { result = PTR_ERR(msgbuf); goto bail; @@ -579,7 +579,7 @@ static int p80211knetdev_do_ioctl(struct net_device *dev, if (result == 0) { if (copy_to_user - ((void __user *)req->data, msgbuf, req->len)) { + (req->data, msgbuf, req->len)) { result = -EFAULT; } } From 23017c8842d2b067e3d6ff927e10af61cd65f3a0 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Wed, 28 Apr 2021 09:35:22 -0700 Subject: [PATCH 109/744] staging: rtl8188eu: Use list iterators and helpers The rtl8188eu manually re-implements list helper functions and macros in various ways. Replace with existing list helpers. The following coccinelle script was used to convert the code. @@ identifier v1, v2, v3, v4; symbol next; expression e; iterator name list_for_each; statement S; @@ <+... ( - e = v1->next; | - e = get_next(v1); ) ... when != e - while ( \( v1 != e \| e != v1 \) ) + list_for_each (e, v1) { ... - v2 = container_of(e, struct v3, v4); + v2 = list_entry(e, struct v3, v4); ?- if (!v2) S ... ( - e = e->next; | - e = get_next(e); ) ... when != e } ...+> @@ identifier v1, v2, v3, v4; symbol next; expression e; iterator name list_for_each; statement S; @@ <+... ( - e = v1->next; | - e = get_next(v1); ) ... when != e - while (1) + list_for_each (e, v1) { - if ( \( e == v1 \| v1 == e \) ) - break; ... - v2 = container_of(e, struct v3, v4); + v2 = list_entry(e, struct v3, v4); ?- if (!v2) S ... ( - e = e->next; | - e = get_next(e); ) ... when != e } ...+> Manually fixed up formatting, and added autoremoved comments back in. Compile tested only. Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20210428163522.129189-1-linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_ap.c | 50 +++++------------- drivers/staging/rtl8188eu/core/rtw_mlme.c | 34 ++++-------- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 19 +++---- drivers/staging/rtl8188eu/core/rtw_sta_mgt.c | 28 +++------- drivers/staging/rtl8188eu/core/rtw_xmit.c | 52 ++++++------------- .../staging/rtl8188eu/hal/rtl8188eu_xmit.c | 8 ++- .../staging/rtl8188eu/os_dep/ioctl_linux.c | 26 +++------- drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 8 +-- 8 files changed, 67 insertions(+), 158 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ap.c b/drivers/staging/rtl8188eu/core/rtw_ap.c index 008b60e72758..ca9a321c4921 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ap.c +++ b/drivers/staging/rtl8188eu/core/rtw_ap.c @@ -175,12 +175,9 @@ void expire_timeout_chk(struct adapter *padapter) spin_lock_bh(&pstapriv->auth_list_lock); phead = &pstapriv->auth_list; - plist = phead->next; - /* check auth_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, auth_list); - plist = plist->next; + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, auth_list); if (psta->expire_to > 0) { psta->expire_to--; @@ -208,12 +205,9 @@ void expire_timeout_chk(struct adapter *padapter) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = phead->next; - /* check asoc_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); - plist = plist->next; + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, asoc_list); if (chk_sta_is_alive(psta) || !psta->expire_to) { psta->expire_to = pstapriv->expire_to; @@ -1032,11 +1026,8 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) spin_lock_bh(&pacl_node_q->lock); phead = get_list_head(pacl_node_q); - plist = phead->next; - - while (phead != plist) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - plist = plist->next; + list_for_each(plist, phead) { + paclnode = list_entry(plist, struct rtw_wlan_acl_node, list); if (!memcmp(paclnode->addr, addr, ETH_ALEN)) { if (paclnode->valid) { @@ -1092,11 +1083,8 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) spin_lock_bh(&pacl_node_q->lock); phead = get_list_head(pacl_node_q); - plist = phead->next; - - while (phead != plist) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - plist = plist->next; + list_for_each(plist, phead) { + paclnode = list_entry(plist, struct rtw_wlan_acl_node, list); if (!memcmp(paclnode->addr, addr, ETH_ALEN)) { if (paclnode->valid) { @@ -1338,13 +1326,9 @@ void associated_clients_update(struct adapter *padapter, u8 updated) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = phead->next; - /* check asoc_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); - - plist = plist->next; + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, asoc_list); VCS_update(padapter, psta); } @@ -1609,13 +1593,9 @@ int rtw_sta_flush(struct adapter *padapter) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = phead->next; - /* free sta asoc_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); - - plist = plist->next; + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, asoc_list); list_del_init(&psta->asoc_list); pstapriv->asoc_list_cnt--; @@ -1738,10 +1718,8 @@ void stop_ap_mode(struct adapter *padapter) /* for ACL */ spin_lock_bh(&pacl_node_q->lock); phead = get_list_head(pacl_node_q); - plist = phead->next; - while (phead != plist) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - plist = plist->next; + list_for_each(plist, phead) { + paclnode = list_entry(plist, struct rtw_wlan_acl_node, list); if (paclnode->valid) { paclnode->valid = false; diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c index b6ac5b8915b1..049e25455849 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c @@ -188,13 +188,10 @@ struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr) goto exit; } phead = get_list_head(scanned_queue); - plist = phead->next; - - while (plist != phead) { - pnetwork = container_of(plist, struct wlan_network, list); + list_for_each(plist, phead) { + pnetwork = list_entry(plist, struct wlan_network, list); if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN)) break; - plist = plist->next; } if (plist == phead) pnetwork = NULL; @@ -212,12 +209,8 @@ void rtw_free_network_queue(struct adapter *padapter, u8 isfreeall) spin_lock_bh(&scanned_queue->lock); phead = get_list_head(scanned_queue); - plist = phead->next; - - while (phead != plist) { - pnetwork = container_of(plist, struct wlan_network, list); - - plist = plist->next; + list_for_each(plist, phead) { + pnetwork = list_entry(plist, struct wlan_network, list); _rtw_free_network(pmlmepriv, pnetwork, isfreeall); } @@ -400,17 +393,14 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t spin_lock_bh(&queue->lock); phead = get_list_head(queue); - plist = phead->next; - - while (phead != plist) { - pnetwork = container_of(plist, struct wlan_network, list); + list_for_each(plist, phead) { + pnetwork = list_entry(plist, struct wlan_network, list); if (is_same_network(&pnetwork->network, target)) break; if ((oldest == ((struct wlan_network *)0)) || time_after(oldest->last_scanned, pnetwork->last_scanned)) oldest = pnetwork; - plist = plist->next; } /* If we didn't find a match, then get a new network slot to initialize * with this beacon's information @@ -1465,15 +1455,9 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) spin_lock_bh(&pmlmepriv->scanned_queue.lock); phead = get_list_head(queue); adapter = (struct adapter *)pmlmepriv->nic_hdl; - pmlmepriv->pscanned = phead->next; - while (phead != pmlmepriv->pscanned) { - pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); - if (!pnetwork) { - RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork==NULL)\n", __func__)); - ret = _FAIL; - goto exit; - } - pmlmepriv->pscanned = pmlmepriv->pscanned->next; + list_for_each(pmlmepriv->pscanned, phead) { + pnetwork = list_entry(pmlmepriv->pscanned, + struct wlan_network, list); rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork); } if (!candidate) { diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 50d3c3631be0..53a3939666ea 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -1760,16 +1760,13 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) spin_lock_bh(&pmlmepriv->scanned_queue.lock); phead = get_list_head(queue); - plist = phead->next; - - while (phead != plist) { + list_for_each(plist, phead) { uint len; u8 *p; struct wlan_bssid_ex *pbss_network; - pnetwork = container_of(plist, struct wlan_network, list); - - plist = plist->next; + pnetwork = list_entry(plist, struct wlan_network, + list); pbss_network = &pnetwork->network; @@ -5400,12 +5397,10 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) spin_lock_bh(&psta_bmc->sleep_q.lock); xmitframe_phead = get_list_head(&psta_bmc->sleep_q); - xmitframe_plist = xmitframe_phead->next; - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = xmitframe_plist->next; + list_for_each(xmitframe_plist, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, + struct xmit_frame, + list); list_del_init(&pxmitframe->list); diff --git a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c index 3c03141e25b1..7941ca0397ed 100644 --- a/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8188eu/core/rtw_sta_mgt.c @@ -142,13 +142,10 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) spin_lock_bh(&pstapriv->sta_hash_lock); for (index = 0; index < NUM_STA; index++) { phead = &pstapriv->sta_hash[index]; - plist = phead->next; - - while (phead != plist) { + list_for_each(plist, phead) { int i; - psta = container_of(plist, struct sta_info, hash_list); - plist = plist->next; + psta = list_entry(plist, struct sta_info, hash_list); for (i = 0; i < 16; i++) { preorder_ctrl = &psta->recvreorder_ctrl[i]; @@ -395,12 +392,8 @@ void rtw_free_all_stainfo(struct adapter *padapter) for (index = 0; index < NUM_STA; index++) { phead = &pstapriv->sta_hash[index]; - plist = phead->next; - - while (phead != plist) { - psta = container_of(plist, struct sta_info, hash_list); - - plist = plist->next; + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, hash_list); if (pbcmc_stainfo != psta) rtw_free_stainfo(padapter, psta); @@ -431,17 +424,14 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) spin_lock_bh(&pstapriv->sta_hash_lock); phead = &pstapriv->sta_hash[index]; - plist = phead->next; - - while (phead != plist) { - psta = container_of(plist, struct sta_info, hash_list); + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, hash_list); if (!memcmp(psta->hwaddr, addr, ETH_ALEN)) { /* if found the matched address */ break; } psta = NULL; - plist = plist->next; } spin_unlock_bh(&pstapriv->sta_hash_lock); @@ -489,10 +479,8 @@ bool rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr) spin_lock_bh(&pacl_node_q->lock); phead = get_list_head(pacl_node_q); - plist = phead->next; - while (phead != plist) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - plist = plist->next; + list_for_each(plist, phead) { + paclnode = list_entry(plist, struct rtw_wlan_acl_node, list); if (!memcmp(paclnode->addr, mac_addr, ETH_ALEN)) { if (paclnode->valid) { diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c b/drivers/staging/rtl8188eu/core/rtw_xmit.c index 99e44b2c6f36..3763d188b892 100644 --- a/drivers/staging/rtl8188eu/core/rtw_xmit.c +++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c @@ -1335,12 +1335,8 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram spin_lock_bh(&pframequeue->lock); phead = get_list_head(pframequeue); - plist = phead->next; - - while (phead != plist) { - pxmitframe = container_of(plist, struct xmit_frame, list); - - plist = plist->next; + list_for_each(plist, phead) { + pxmitframe = list_entry(plist, struct xmit_frame, list); rtw_free_xmitframe(pxmitpriv, pxmitframe); } @@ -1404,10 +1400,9 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi phwxmit = phwxmit_i + inx[i]; sta_phead = get_list_head(phwxmit->sta_queue); - sta_plist = sta_phead->next; - - while (sta_phead != sta_plist) { - ptxservq = container_of(sta_plist, struct tx_servq, tx_pending); + list_for_each(sta_plist, sta_phead) { + ptxservq = list_entry(sta_plist, struct tx_servq, + tx_pending); pframe_queue = &ptxservq->sta_pending; @@ -1421,8 +1416,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi list_del_init(&ptxservq->tx_pending); goto exit; } - - sta_plist = sta_plist->next; } } exit: @@ -1746,12 +1739,8 @@ static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struc struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits; phead = get_list_head(pframequeue); - plist = phead->next; - - while (phead != plist) { - pxmitframe = container_of(plist, struct xmit_frame, list); - - plist = plist->next; + list_for_each(plist, phead) { + pxmitframe = list_entry(plist, struct xmit_frame, list); xmitframe_enqueue_for_sleeping_sta(padapter, pxmitframe); @@ -1818,12 +1807,9 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) spin_lock_bh(&psta->sleep_q.lock); xmitframe_phead = get_list_head(&psta->sleep_q); - xmitframe_plist = xmitframe_phead->next; - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = xmitframe_plist->next; + list_for_each(xmitframe_plist, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, struct xmit_frame, + list); list_del_init(&pxmitframe->list); @@ -1899,12 +1885,9 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) spin_lock_bh(&psta_bmc->sleep_q.lock); xmitframe_phead = get_list_head(&psta_bmc->sleep_q); - xmitframe_plist = xmitframe_phead->next; - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = xmitframe_plist->next; + list_for_each(xmitframe_plist, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, + struct xmit_frame, list); list_del_init(&pxmitframe->list); @@ -1946,12 +1929,9 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst spin_lock_bh(&psta->sleep_q.lock); xmitframe_phead = get_list_head(&psta->sleep_q); - xmitframe_plist = xmitframe_phead->next; - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = xmitframe_plist->next; + list_for_each(xmitframe_plist, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, struct xmit_frame, + list); switch (pxmitframe->attrib.priority) { case 1: diff --git a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c index 2866283c211d..10a8dcc6ca95 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c @@ -507,11 +507,9 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, spin_lock_bh(&pxmitpriv->lock); xmitframe_phead = get_list_head(&ptxservq->sta_pending); - xmitframe_plist = xmitframe_phead->next; - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - xmitframe_plist = xmitframe_plist->next; + list_for_each(xmitframe_plist, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, struct xmit_frame, + list); pxmitframe->agg_num = 0; /* not first frame of aggregation */ pxmitframe->pkt_offset = 0; /* not first frame of aggregation, no need to reserve offset */ diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index cc14f0094778..9dacdd595b63 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -962,12 +962,9 @@ static int rtw_wx_set_wap(struct net_device *dev, authmode = padapter->securitypriv.ndisauthtype; spin_lock_bh(&queue->lock); phead = get_list_head(queue); - pmlmepriv->pscanned = phead->next; - - while (phead != pmlmepriv->pscanned) { - pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); - - pmlmepriv->pscanned = pmlmepriv->pscanned->next; + list_for_each(pmlmepriv->pscanned, phead) { + pnetwork = list_entry(pmlmepriv->pscanned, + struct wlan_network, list); dst_bssid = pnetwork->network.MacAddress; @@ -1221,21 +1218,17 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, spin_lock_bh(&pmlmepriv->scanned_queue.lock); phead = get_list_head(queue); - plist = phead->next; - - while (phead != plist) { + list_for_each(plist, phead) { if ((stop - ev) < SCAN_ITEM_SIZE) { ret = -E2BIG; break; } - pnetwork = container_of(plist, struct wlan_network, list); + pnetwork = list_entry(plist, struct wlan_network, list); /* report network only if the current channel set contains the channel to which this network belongs */ if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0) ev = translate_scan(padapter, a, pnetwork, ev, stop); - - plist = plist->next; } spin_unlock_bh(&pmlmepriv->scanned_queue.lock); @@ -1305,12 +1298,9 @@ static int rtw_wx_set_essid(struct net_device *dev, RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("%s: ssid =[%s]\n", __func__, src_ssid)); spin_lock_bh(&queue->lock); phead = get_list_head(queue); - pmlmepriv->pscanned = phead->next; - - while (phead != pmlmepriv->pscanned) { - pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); - - pmlmepriv->pscanned = pmlmepriv->pscanned->next; + list_for_each(pmlmepriv->pscanned, phead) { + pnetwork = list_entry(pmlmepriv->pscanned, + struct wlan_network, list); dst_ssid = pnetwork->network.ssid.ssid; diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c index a9c42fb80583..6935bdb2d7d2 100644 --- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c @@ -118,13 +118,9 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = phead->next; - /* free sta asoc_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); - - plist = plist->next; + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, asoc_list); /* avoid come from STA1 and send back STA1 */ if (!memcmp(psta->hwaddr, &skb->data[6], 6)) From 3580942c864f90d4eedfbcdf08cdd66ca51494d2 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Wed, 28 Apr 2021 10:35:23 -0700 Subject: [PATCH 110/744] staging: rtl8712: Use list iterators and helpers Use existing list iterators and helper functions. The following coccinelle script was used to convert the code. @@ identifier v1, v2, v3, v4; symbol next; expression e; iterator name list_for_each; statement S; @@ <+... ( - e = v1->next; | - e = get_next(v1); ) ... when != e - while ( \( v1 != e \| e != v1 \) ) + list_for_each (e, v1) { ... - v2 = container_of(e, struct v3, v4); + v2 = list_entry(e, struct v3, v4); ?- if (!v2) S ... ( - e = e->next; | - e = get_next(e); ) ... when != e } ...+> Compile tested only. Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20210428173523.149958-1-linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl871x_mlme.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c index ba4a71e91ae0..92b7c9c07df6 100644 --- a/drivers/staging/rtl8712/rtl871x_mlme.c +++ b/drivers/staging/rtl8712/rtl871x_mlme.c @@ -139,10 +139,8 @@ static struct wlan_network *r8712_find_network(struct __queue *scanned_queue, return NULL; spin_lock_irqsave(&scanned_queue->lock, irqL); phead = &scanned_queue->queue; - plist = phead->next; - while (plist != phead) { - pnetwork = container_of(plist, struct wlan_network, list); - plist = plist->next; + list_for_each(plist, phead) { + pnetwork = list_entry(plist, struct wlan_network, list); if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN)) break; } From 5660634d8d48e2d5f9b528e057455c9bc657b0b1 Mon Sep 17 00:00:00 2001 From: Iain Craig Date: Wed, 28 Apr 2021 07:17:34 -0700 Subject: [PATCH 111/744] staging: rtl8192u: fix typos in comments correct spelling errors across 8 lines of comments. Signed-off-by: Iain Craig Link: https://lore.kernel.org/r/20210428141734.GA2498@ubuntu Signed-off-by: Greg Kroah-Hartman --- .../rtl8192u/ieee80211/ieee80211_softmac.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 965fa1fb5e1b..ab885353f668 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -33,9 +33,9 @@ short ieee80211_is_shortslot(const struct ieee80211_network *net) } EXPORT_SYMBOL(ieee80211_is_shortslot); -/* returns the total length needed for pleacing the RATE MFIE +/* returns the total length needed for placing the RATE MFIE * tag and the EXTENDED RATE MFIE tag if needed. - * It encludes two bytes per tag for the tag itself and its len + * It includes two bytes per tag for the tag itself and its len */ static unsigned int ieee80211_MFIE_rate_len(struct ieee80211_device *ieee) { @@ -50,7 +50,7 @@ static unsigned int ieee80211_MFIE_rate_len(struct ieee80211_device *ieee) return rate_len; } -/* pleace the MFIE rate, tag to the memory (double) poined. +/* place the MFIE rate, tag to the memory (double) pointer. * Then it updates the pointer so that * it points after the new MFIE tag added. */ @@ -436,7 +436,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee) * So we switch to IEEE80211_LINKED_SCANNING to remember * that we are still logically linked (not interested in * new network events, despite for updating the net list, - * but we are temporarly 'unlinked' as the driver shall + * but we are temporarily 'unlinked' as the driver shall * not filter RX frames and the channel is changing. * So the only situation in witch are interested is to check * if the state become LINKED because of the #1 situation @@ -1162,7 +1162,7 @@ void ieee80211_associate_abort(struct ieee80211_device *ieee) ieee->associate_seq++; - /* don't scan, and avoid to have the RX path possibily + /* don't scan, and avoid having the RX path possibly * try again to associate. Even do not react to AUTH or * ASSOC response. Just wait for the retry wq to be scheduled. * Here we will check if there are good nets to associate @@ -1373,7 +1373,7 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee /* if the user set the AP check if match. * if the network does not broadcast essid we check the user supplyed ANY essid * if the network does broadcast and the user does not set essid it is OK - * if the network does broadcast and the user did set essid chech if essid match + * if the network does broadcast and the user did set essid check if essid match */ if ((apset && apmatch && ((ssidset && ssidbroad && ssidmatch) || (ssidbroad && !ssidset) || (!ssidbroad && ssidset))) || @@ -2243,9 +2243,9 @@ static void ieee80211_start_ibss_wq(struct work_struct *work) * time to scan all the chans..) or we have just run up the iface * after setting ad-hoc mode. So we have to give another try.. * Here, in ibss mode, should be safe to do this without extra care - * (in bss mode we had to make sure no-one tryed to associate when + * (in bss mode we had to make sure no-one tried to associate when * we had just checked the ieee->state and we was going to start the - * scan) beacause in ibss mode the ieee80211_new_net function, when + * scan) because in ibss mode the ieee80211_new_net function, when * finds a good net, just set the ieee->state to IEEE80211_LINKED, * so, at worst, we waste a bit of time to initiate an unneeded syncro * scan, that will stop at the first round because it sees the state From 89bbf2a5136eff891b222e1bfa7cc20e51127f2c Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Wed, 28 Apr 2021 09:28:04 +0200 Subject: [PATCH 112/744] staging: rtl8723bs: remove unnecessary hex dumps Remove unnecessary hex dumps in kernel log. This deletion has been done with the following semantic patch: @@ @@ - print_hex_dump_debug(...); Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/8bbf5ce17f2d778a67e86cb948395e9ed27478d9.1619594707.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/hal_com.c | 6 ------ drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 18 ------------------ .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 3 --- 3 files changed, 27 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c index e82f59fc5e9b..2c82282958e9 100644 --- a/drivers/staging/rtl8723bs/hal/hal_com.c +++ b/drivers/staging/rtl8723bs/hal/hal_com.c @@ -916,16 +916,10 @@ s32 c2h_evt_read_88xx(struct adapter *adapter, u8 *buf) c2h_evt->seq = rtw_read8(adapter, REG_C2HEVT_CMD_SEQ_88XX); c2h_evt->plen = rtw_read8(adapter, REG_C2HEVT_CMD_LEN_88XX); - print_hex_dump_debug(DRIVER_PREFIX ": c2h_evt_read(): ", DUMP_PREFIX_NONE, - 16, 1, &c2h_evt, sizeof(c2h_evt), false); - /* Read the content */ for (i = 0; i < c2h_evt->plen; i++) c2h_evt->payload[i] = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 2 + i); - print_hex_dump_debug(DRIVER_PREFIX ": c2h_evt_read(): Command Content:\n", - DUMP_PREFIX_NONE, 16, 1, c2h_evt->payload, c2h_evt->plen, false); - ret = _SUCCESS; clear_evt: diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c index 2451875ab3c0..e2ec82915073 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c @@ -309,9 +309,6 @@ static void rtl8723b_set_FwRsvdPage_cmd(struct adapter *padapter, struct rsvdpag SET_8723B_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocQosNull); SET_8723B_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocBTQosNull); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CRsvdPageParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CRsvdPageParm, H2C_RSVDPAGE_LOC_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_RSVD_PAGE, H2C_RSVDPAGE_LOC_LEN, u1H2CRsvdPageParm); } @@ -329,9 +326,6 @@ void rtl8723b_set_FwMediaStatusRpt_cmd(struct adapter *padapter, u8 mstatus, u8 SET_8723B_H2CCMD_MSRRPT_PARM_MACID(u1H2CMediaStatusRptParm, macid); SET_8723B_H2CCMD_MSRRPT_PARM_MACID_END(u1H2CMediaStatusRptParm, macid_end); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CMediaStatusRptParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CMediaStatusRptParm, H2C_MEDIA_STATUS_RPT_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_MEDIA_STATUS_RPT, H2C_MEDIA_STATUS_RPT_LEN, u1H2CMediaStatusRptParm); } @@ -348,9 +342,6 @@ void rtl8723b_set_FwMacIdConfig_cmd(struct adapter *padapter, u8 mac_id, u8 raid SET_8723B_H2CCMD_MACID_CFG_RATE_MASK2(u1H2CMacIdConfigParm, (u8)((mask & 0x00ff0000) >> 16)); SET_8723B_H2CCMD_MACID_CFG_RATE_MASK3(u1H2CMacIdConfigParm, (u8)((mask & 0xff000000) >> 24)); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CMacIdConfigParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CMacIdConfigParm, H2C_MACID_CFG_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_MACID_CFG, H2C_MACID_CFG_LEN, u1H2CMacIdConfigParm); } @@ -365,9 +356,6 @@ void rtl8723b_set_rssi_cmd(struct adapter *padapter, u8 *param) SET_8723B_H2CCMD_RSSI_SETTING_RSSI(u1H2CRssiSettingParm, rssi); SET_8723B_H2CCMD_RSSI_SETTING_ULDL_STATE(u1H2CRssiSettingParm, uldl_state); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CRssiSettingParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CRssiSettingParm, H2C_RSSI_SETTING_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_RSSI_SETTING, H2C_RSSI_SETTING_LEN, u1H2CRssiSettingParm); } @@ -465,9 +453,6 @@ void rtl8723b_set_FwPwrMode_cmd(struct adapter *padapter, u8 psmode) hal_btcoex_RecordPwrMode(padapter, u1H2CPwrModeParm, H2C_PWRMODE_LEN); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CPwrModeParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CPwrModeParm, H2C_PWRMODE_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_SET_PWR_MODE, H2C_PWRMODE_LEN, u1H2CPwrModeParm); } @@ -485,9 +470,6 @@ void rtl8723b_set_FwPsTuneParam_cmd(struct adapter *padapter) SET_8723B_H2CCMD_PSTUNE_PARM_ADOPT(u1H2CPsTuneParm, 1); SET_8723B_H2CCMD_PSTUNE_PARM_DTIM_PERIOD(u1H2CPsTuneParm, dtim_period); - print_hex_dump_debug(DRIVER_PREFIX ": u1H2CPsTuneParm:", DUMP_PREFIX_NONE, - 16, 1, u1H2CPsTuneParm, H2C_PSTUNEPARAM_LEN, false); - FillH2CCmd8723B(padapter, H2C_8723B_PS_TUNING_PARA, H2C_PSTUNEPARAM_LEN, u1H2CPsTuneParm); } diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index 082448557b53..103135aad41a 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -3315,9 +3315,6 @@ void C2HPacketHandler_8723B(struct adapter *padapter, u8 *pbuffer, u16 length) C2hEvent.CmdLen = length-2; tmpBuf = pbuffer+2; - print_hex_dump_debug(DRIVER_PREFIX ": C2HPacketHandler_8723B(): Command Content:\n", - DUMP_PREFIX_NONE, 16, 1, tmpBuf, C2hEvent.CmdLen, false); - process_c2h_event(padapter, &C2hEvent, tmpBuf); /* c2h_handler_8723b(padapter,&C2hEvent); */ } From ac76b43834059519954d43e72748428b22677e10 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Wed, 28 Apr 2021 09:28:05 +0200 Subject: [PATCH 113/744] staging: rtl8723bs: remove unused macro DRIVER_PREFIX remove unused macro DRIVER_PREFIX. Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2fac5d7f2334f0a9765f2ddfb31502323e49fce1.1619594707.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/rtw_debug.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/rtw_debug.h b/drivers/staging/rtl8723bs/include/rtw_debug.h index 3a5b083e95a1..7f96ff66915f 100644 --- a/drivers/staging/rtl8723bs/include/rtw_debug.h +++ b/drivers/staging/rtl8723bs/include/rtw_debug.h @@ -7,8 +7,6 @@ #ifndef __RTW_DEBUG_H__ #define __RTW_DEBUG_H__ -#define DRIVER_PREFIX "rtl8723bs: " - void mac_reg_dump(struct adapter *adapter); void bb_reg_dump(struct adapter *adapter); void rf_reg_dump(struct adapter *adapter); From cab7759088897152559291043f0df604e1725c32 Mon Sep 17 00:00:00 2001 From: Saurav Girepunje Date: Wed, 28 Apr 2021 21:10:11 +0530 Subject: [PATCH 114/744] staging: rtl8723bs: core: remove unneeded variable Below are the changes: Remove unneeded variable "u8 *pbuf" from function start_bss_network argument as this can be get from first argument "padapter" Remove the struct wlan_bssid_ex *network from createbss_hdl function as this is only used to pass as second argument to start_bss_network() Remove the struct mlme_priv *mlmepriv from rtw_ap_restore_network function as this is only used to pass as second argument to start_bss_network() Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/20210428154011.GA5571@user Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_ap.c | 5 ++--- drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 4 +--- drivers/staging/rtl8723bs/include/rtw_ap.h | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index 4a9bd4825fab..dc8f029e8b7f 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c @@ -653,7 +653,7 @@ static void update_hw_ht_param(struct adapter *padapter) /* pmlmeinfo->HT_protection = pmlmeinfo->HT_info.infos[1] & 0x3; */ } -void start_bss_network(struct adapter *padapter, u8 *pbuf) +void start_bss_network(struct adapter *padapter) { u8 *p; u8 val8, cur_channel, cur_bwmode, cur_ch_offset; @@ -2039,7 +2039,6 @@ void ap_sta_info_defer_update(struct adapter *padapter, struct sta_info *psta) /* restore hw setting from sw data structures */ void rtw_ap_restore_network(struct adapter *padapter) { - struct mlme_priv *mlmepriv = &padapter->mlmepriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct sta_priv *pstapriv = &padapter->stapriv; struct sta_info *psta; @@ -2058,7 +2057,7 @@ void rtw_ap_restore_network(struct adapter *padapter) pmlmeext->cur_bwmode ); - start_bss_network(padapter, (u8 *)&mlmepriv->cur_network.network); + start_bss_network(padapter); if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) || (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) { diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 75db4272e537..3ed996bba98e 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -669,7 +669,7 @@ int rtw_startbss_cmd(struct adapter *padapter, int flags) if (flags & RTW_CMDF_DIRECTLY) { /* no need to enqueue, do the cmd hdl directly and free cmd parameter */ - start_bss_network(padapter, (u8 *)&(padapter->mlmepriv.cur_network.network)); + start_bss_network(padapter); } else { /* need enqueue, prepare cmd_obj and enqueue */ pcmd = rtw_zmalloc(sizeof(struct cmd_obj)); diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index a2fdd5ea5fc4..1ff24f37022a 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -5455,9 +5455,7 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf) /* u32 initialgain; */ if (pmlmeinfo->state == WIFI_FW_AP_STATE) { - struct wlan_bssid_ex *network = &padapter->mlmepriv.cur_network.network; - - start_bss_network(padapter, (u8 *)network); + start_bss_network(padapter); return H2C_SUCCESS; } diff --git a/drivers/staging/rtl8723bs/include/rtw_ap.h b/drivers/staging/rtl8723bs/include/rtw_ap.h index 4a1ed9eff83a..7a735e691399 100644 --- a/drivers/staging/rtl8723bs/include/rtw_ap.h +++ b/drivers/staging/rtl8723bs/include/rtw_ap.h @@ -14,7 +14,7 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx); void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level); void expire_timeout_chk(struct adapter *padapter); void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta); -void start_bss_network(struct adapter *padapter, u8 *pbuf); +void start_bss_network(struct adapter *padapter); int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len); void rtw_ap_restore_network(struct adapter *padapter); void rtw_set_macaddr_acl(struct adapter *padapter, int mode); From bd8d4ba394c4247d3a719aeae4267d92a6a23516 Mon Sep 17 00:00:00 2001 From: "Fabio M. De Francesco" Date: Fri, 30 Apr 2021 11:53:18 +0200 Subject: [PATCH 115/744] staging: rtl8723bs: hal: Remove set but unused variables Removed four set but unused variables. Issue detected by gcc. Reviewed-by: Dan Carpenter Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210430095319.23226-2-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index 103135aad41a..871e614db878 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -3897,14 +3897,11 @@ u8 GetHalDefVar8723B(struct adapter *padapter, enum hal_def_variable variable, v u32 cmd; u32 ra_info1, ra_info2; u32 rate_mask1, rate_mask2; - u8 curr_tx_rate, curr_tx_sgi, hight_rate, lowest_rate; cmd = 0x40000100 | mac_id; rtw_write32(padapter, REG_HMEBOX_DBG_2_8723B, cmd); msleep(10); ra_info1 = rtw_read32(padapter, 0x2F0); - curr_tx_rate = ra_info1&0x7F; - curr_tx_sgi = (ra_info1>>7)&0x01; cmd = 0x40000400 | mac_id; rtw_write32(padapter, REG_HMEBOX_DBG_2_8723B, cmd); @@ -3913,8 +3910,6 @@ u8 GetHalDefVar8723B(struct adapter *padapter, enum hal_def_variable variable, v ra_info2 = rtw_read32(padapter, 0x2F4); rate_mask1 = rtw_read32(padapter, 0x2F8); rate_mask2 = rtw_read32(padapter, 0x2FC); - hight_rate = ra_info2&0xFF; - lowest_rate = (ra_info2>>8) & 0xFF; } break; From 5e7106f6c96a9d4d7290e6406c91d70ea5842fa6 Mon Sep 17 00:00:00 2001 From: "Fabio M. De Francesco" Date: Fri, 30 Apr 2021 11:53:19 +0200 Subject: [PATCH 116/744] staging: rtl8723bs: core: Remove set but unused variable Removed set but unused variable. Issue detected by gcc. Reviewed-by: Dan Carpenter Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20210430095319.23226-3-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 1ff24f37022a..655a57a27c9f 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -1019,7 +1019,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) u16 capab_info; struct rtw_ieee802_11_elems elems; struct sta_info *pstat; - unsigned char reassoc, *p, *pos, *wpa_ie; + unsigned char *p, *pos, *wpa_ie; unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01}; int i, ie_len, wpa_ie_len, left; unsigned char supportRate[16]; @@ -1039,13 +1039,10 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame) return _FAIL; frame_type = GetFrameSubType(pframe); - if (frame_type == WIFI_ASSOCREQ) { - reassoc = 0; + if (frame_type == WIFI_ASSOCREQ) ie_offset = _ASOCREQ_IE_OFFSET_; - } else { /* WIFI_REASSOCREQ */ - reassoc = 1; + else /* WIFI_REASSOCREQ */ ie_offset = _REASOCREQ_IE_OFFSET_; - } if (pkt_len < sizeof(struct ieee80211_hdr_3addr) + ie_offset) From 66d708e655afd89dc3a80e38412b9cf848a3e25a Mon Sep 17 00:00:00 2001 From: zhaoxiao Date: Fri, 30 Apr 2021 20:28:25 +0800 Subject: [PATCH 117/744] staging: rtl8192e: remove unnecesasry ftrace-like logging Fixed Check: Remove unnecessary ftrace-like logging by simply deleting that statement as we have other modes of logging like ftrace. Reported by checkpatch. Signed-off-by: zhaoxiao Link: https://lore.kernel.org/r/20210430122826.9899-1-zhaoxiao@uniontech.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtllib_softmac.c | 1 - drivers/staging/rtl8192e/rtllib_wx.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index f9a51f3620d2..25b3d3950a3c 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -730,7 +730,6 @@ EXPORT_SYMBOL(rtllib_act_scanning); /* called with ieee->lock held */ static void rtllib_start_scan(struct rtllib_device *ieee) { - RT_TRACE(COMP_DBG, "===>%s()\n", __func__); if (ieee->rtllib_ips_leave_wq != NULL) ieee->rtllib_ips_leave_wq(ieee->dev); diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c index ab1b8217c4e0..0d67d5880377 100644 --- a/drivers/staging/rtl8192e/rtllib_wx.c +++ b/drivers/staging/rtl8192e/rtllib_wx.c @@ -293,8 +293,6 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee, int i, key, key_provided, len; struct lib80211_crypt_data **crypt; - netdev_dbg(ieee->dev, "%s()\n", __func__); - key = erq->flags & IW_ENCODE_INDEX; if (key) { if (key > NUM_WEP_KEYS) @@ -463,8 +461,6 @@ int rtllib_wx_get_encode(struct rtllib_device *ieee, int len, key; struct lib80211_crypt_data *crypt; - netdev_dbg(ieee->dev, "%s()\n", __func__); - if (ieee->iw_mode == IW_MODE_MONITOR) return -1; From 84b45d4ff9e00ac37bfd3d64f00ec13ca17c2551 Mon Sep 17 00:00:00 2001 From: zhaoxiao Date: Fri, 30 Apr 2021 20:56:57 +0800 Subject: [PATCH 118/744] staging: rtl8192e: replace comparison to NULL by bool Fixed Comparison to NULL can be written as '!...' by replacing it with simpler form i.e boolean expression. This makes code more readable alternative. Reported by checkpatch. Signed-off-by: zhaoxiao Link: https://lore.kernel.org/r/20210430125657.18264-1-zhaoxiao@uniontech.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8192e/rtl819x_HTProc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c b/drivers/staging/rtl8192e/rtl819x_HTProc.c index 48d28c7d870b..3b8efaf9b88c 100644 --- a/drivers/staging/rtl8192e/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c @@ -276,7 +276,7 @@ void HTConstructCapabilityElement(struct rtllib_device *ieee, u8 *posHTCap, struct rt_hi_throughput *pHT = ieee->pHTInfo; struct ht_capab_ele *pCapELE = NULL; - if ((posHTCap == NULL) || (pHT == NULL)) { + if (!posHTCap || !pHT) { netdev_warn(ieee->dev, "%s(): posHTCap and pHTInfo are null\n", __func__); return; @@ -357,7 +357,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo, struct rt_hi_throughput *pHT = ieee->pHTInfo; struct ht_info_ele *pHTInfoEle = (struct ht_info_ele *)posHTInfo; - if ((posHTInfo == NULL) || (pHTInfoEle == NULL)) { + if (!posHTInfo || !pHTInfoEle) { netdev_warn(ieee->dev, "%s(): posHTInfo and pHTInfoEle are null\n", __func__); @@ -397,7 +397,7 @@ void HTConstructInfoElement(struct rtllib_device *ieee, u8 *posHTInfo, void HTConstructRT2RTAggElement(struct rtllib_device *ieee, u8 *posRT2RTAgg, u8 *len) { - if (posRT2RTAgg == NULL) { + if (!posRT2RTAgg) { netdev_warn(ieee->dev, "%s(): posRT2RTAgg is null\n", __func__); return; } @@ -420,7 +420,7 @@ static u8 HT_PickMCSRate(struct rtllib_device *ieee, u8 *pOperateMCS) { u8 i; - if (pOperateMCS == NULL) { + if (!pOperateMCS) { netdev_warn(ieee->dev, "%s(): pOperateMCS is null\n", __func__); return false; } @@ -453,7 +453,7 @@ u8 HTGetHighestMCSRate(struct rtllib_device *ieee, u8 *pMCSRateSet, u8 mcsRate = 0; u8 availableMcsRate[16]; - if (pMCSRateSet == NULL || pMCSFilter == NULL) { + if (!pMCSRateSet || !pMCSFilter) { netdev_warn(ieee->dev, "%s(): pMCSRateSet and pMCSFilter are null\n", __func__); From 62409b31dbb54fe0e6facc7644deefd3c5eb373d Mon Sep 17 00:00:00 2001 From: Alexander Vorwerk Date: Sun, 2 May 2021 01:45:01 +0200 Subject: [PATCH 119/744] staging: rtl8712: remove multiple multiple assignments Documentation/process/coding-style.rst says (in line 88) "Don't put multiple assignments on a single line either." This patch fixes the coding style issue reported by checkpatch.pl. Signed-off-by: Alexander Vorwerk Link: https://lore.kernel.org/r/20210501234501.5411-1-alec@vc-celle.de Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl8712_recv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index db5c7a487ab3..0ffb30f1af7e 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -1039,8 +1039,9 @@ static void recvbuf2recvframe(struct _adapter *padapter, struct sk_buff *pskb) skb_reserve(pkt_copy, 4 - ((addr_t)(pkt_copy->data) % 4)); skb_reserve(pkt_copy, shift_sz); memcpy(pkt_copy->data, pbuf, tmp_len); - precvframe->u.hdr.rx_head = precvframe->u.hdr.rx_data = - precvframe->u.hdr.rx_tail = pkt_copy->data; + precvframe->u.hdr.rx_head = pkt_copy->data; + precvframe->u.hdr.rx_data = pkt_copy->data; + precvframe->u.hdr.rx_tail = pkt_copy->data; precvframe->u.hdr.rx_end = pkt_copy->data + alloc_sz; recvframe_put(precvframe, tmp_len); From a616d1212a7a7efb2d62a9433a2fdcfc933d9a83 Mon Sep 17 00:00:00 2001 From: Saurav Girepunje Date: Wed, 28 Apr 2021 23:25:20 +0530 Subject: [PATCH 120/744] staging: rtl8723bs: Change the return type Remove the ret variable in rtw_suspend_common() and change the return type from int to void as rtw_suspend_common() always return zero unconditionally. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/20210428175520.GA8921@user Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/osdep_intf.h | 2 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 5 ++--- drivers/staging/rtl8723bs/os_dep/sdio_intf.c | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/osdep_intf.h b/drivers/staging/rtl8723bs/include/osdep_intf.h index 48c90f00cc2e..111e0179712a 100644 --- a/drivers/staging/rtl8723bs/include/osdep_intf.h +++ b/drivers/staging/rtl8723bs/include/osdep_intf.h @@ -66,7 +66,7 @@ void rtw_ips_pwr_down(struct adapter *padapter); int rtw_drv_register_netdev(struct adapter *padapter); void rtw_ndev_destructor(struct net_device *ndev); -int rtw_suspend_common(struct adapter *padapter); +void rtw_suspend_common(struct adapter *padapter); int rtw_resume_common(struct adapter *padapter); int netdev_open(struct net_device *pnetdev); diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 6ac78a9ae615..1988f666228d 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -1150,14 +1150,13 @@ static void rtw_suspend_normal(struct adapter *padapter) padapter->intf_deinit(adapter_to_dvobj(padapter)); } -int rtw_suspend_common(struct adapter *padapter) +void rtw_suspend_common(struct adapter *padapter) { struct dvobj_priv *psdpriv = padapter->dvobj; struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(psdpriv); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - int ret = 0; unsigned long start_time = jiffies; netdev_dbg(padapter->pnetdev, " suspend start\n"); @@ -1200,7 +1199,7 @@ int rtw_suspend_common(struct adapter *padapter) exit: - return ret; + return; } static int rtw_resume_process_normal(struct adapter *padapter) diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c index 5e484344e172..490431484524 100644 --- a/drivers/staging/rtl8723bs/os_dep/sdio_intf.c +++ b/drivers/staging/rtl8723bs/os_dep/sdio_intf.c @@ -447,7 +447,9 @@ static int rtw_sdio_suspend(struct device *dev) return 0; } - return rtw_suspend_common(padapter); + rtw_suspend_common(padapter); + + return 0; } static int rtw_resume_process(struct adapter *padapter) From 116138c3bd34f92e550431d495db515f5ea19f13 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sun, 2 May 2021 09:21:08 +0200 Subject: [PATCH 121/744] staging: rtl8712: Fix some tests against some 'data' subtype frames Commit 6e2baa44c6d1 ("staging: rtl8712: remove enum WIFI_FRAME_SUBTYPE") was wrong because: WIFI_DATA_NULL != IEEE80211_STYPE_NULLFUNC WIFI_DATA_CFACK != IEEE80211_STYPE_DATA_CFACK WIFI_DATA_CFPOLL != IEEE80211_STYPE_DATA_CFPOLL WIFI_DATA_CFACKPOLL != IEEE80211_STYPE_DATA_CFACKPOLL the WIFI_DATA_xxx definitions include WIFI_DATA_TYPE, which is 'BIT(3)'. Restore the previous behavior by adding the missing 'IEEE80211_FTYPE_DATA |' (0x0008, that is to say BIT(3)) when these values are used. Hopefully, the wrong commit was small enough and hand review is possible. Fixes: 6e2baa44c6d1 ("staging: rtl8712: remove enum WIFI_FRAME_SUBTYPE") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/44aebfa3c5ce8f45ae05369c73e9ff77c6d271f9.1619939806.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl871x_recv.c | 2 +- drivers/staging/rtl8712/rtl871x_security.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c index db2add576418..c23f6b376111 100644 --- a/drivers/staging/rtl8712/rtl871x_recv.c +++ b/drivers/staging/rtl8712/rtl871x_recv.c @@ -374,7 +374,7 @@ static sint ap2sta_data_frame(struct _adapter *adapter, if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED)) { /* if NULL-frame, drop packet */ - if ((GetFrameSubType(ptr)) == IEEE80211_STYPE_NULLFUNC) + if ((GetFrameSubType(ptr)) == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC)) return _FAIL; /* drop QoS-SubType Data, including QoS NULL, * excluding QoS-Data diff --git a/drivers/staging/rtl8712/rtl871x_security.c b/drivers/staging/rtl8712/rtl871x_security.c index 63d63f7be481..e0a1c30a8fe6 100644 --- a/drivers/staging/rtl8712/rtl871x_security.c +++ b/drivers/staging/rtl8712/rtl871x_security.c @@ -1045,9 +1045,9 @@ static void aes_cipher(u8 *key, uint hdrlen, else a4_exists = 1; - if ((frtype == IEEE80211_STYPE_DATA_CFACK) || - (frtype == IEEE80211_STYPE_DATA_CFPOLL) || - (frtype == IEEE80211_STYPE_DATA_CFACKPOLL)) { + if ((frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACK)) || + (frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFPOLL)) || + (frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACKPOLL))) { qc_exists = 1; if (hdrlen != WLAN_HDR_A3_QOS_LEN) hdrlen += 2; @@ -1225,9 +1225,9 @@ static void aes_decipher(u8 *key, uint hdrlen, a4_exists = 0; else a4_exists = 1; - if ((frtype == IEEE80211_STYPE_DATA_CFACK) || - (frtype == IEEE80211_STYPE_DATA_CFPOLL) || - (frtype == IEEE80211_STYPE_DATA_CFACKPOLL)) { + if ((frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACK)) || + (frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFPOLL)) || + (frtype == (IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA_CFACKPOLL))) { qc_exists = 1; if (hdrlen != WLAN_HDR_A3_QOS_LEN) hdrlen += 2; From 33ed2b7079f6c38abce6abbaf1e6be4edad919d8 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sun, 2 May 2021 13:30:06 +0200 Subject: [PATCH 122/744] staging: rtl8188eu: remove enum WIFI_FRAME_SUBTYPE The values defined in enum WIFI_FRAME_SUBTYPE are the same the #define IEEE80211_STYPE_xxx from . Special care must be taken for control and data frame, because the coding of the frame type is not included in the IEEE80211_STYPE_xxx values and must be added explicitly. There is no problem for management frame because the type si coded as (0) (in rtl8188eu) and (0x0000) (in ). Values used for control frame (WIFI_PSPOLL) must be OR'eded with IEEE80211_FTYPE_CTL. Values used for data frame (WIFI_DATA_NULL and WIFI_QOS_DATA_NULL) must be OR'ed with IEEE80211_FTYPE_DATA. Use theses values to avoid code duplication. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/7c1007d5706a42e0ba1fe805089fab523f9db7ea.1619953884.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 86 +++++++++---------- drivers/staging/rtl8188eu/core/rtw_recv.c | 8 +- .../staging/rtl8188eu/core/rtw_wlan_util.c | 2 +- drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c | 10 +-- .../staging/rtl8188eu/hal/rtl8188e_rxdesc.c | 2 +- drivers/staging/rtl8188eu/include/wifi.h | 36 -------- 6 files changed, 54 insertions(+), 90 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c index 53a3939666ea..20feb2f0ef8f 100644 --- a/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8188eu/core/rtw_mlme_ext.c @@ -344,7 +344,7 @@ static void issue_beacon(struct adapter *padapter, int timeout_ms) SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); /* pmlmeext->mgnt_seq++; */ - SetFrameSubType(pframe, WIFI_BEACON); + SetFrameSubType(pframe, IEEE80211_STYPE_BEACON); pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -487,7 +487,7 @@ static void issue_probersp(struct adapter *padapter, unsigned char *da) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(fctrl, WIFI_PROBERSP); + SetFrameSubType(fctrl, IEEE80211_STYPE_PROBE_RESP); pattrib->hdrlen = sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = pattrib->hdrlen; @@ -640,7 +640,7 @@ static int issue_probereq(struct adapter *padapter, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_PROBEREQ); + SetFrameSubType(pframe, IEEE80211_STYPE_PROBE_REQ); pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -762,7 +762,7 @@ static void issue_auth(struct adapter *padapter, struct sta_info *psta, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_AUTH); + SetFrameSubType(pframe, IEEE80211_STYPE_AUTH); pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -912,7 +912,7 @@ static void issue_asocrsp(struct adapter *padapter, unsigned short status, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - if ((pkt_type == WIFI_ASSOCRSP) || (pkt_type == WIFI_REASSOCRSP)) + if ((pkt_type == IEEE80211_STYPE_ASSOC_RESP) || (pkt_type == IEEE80211_STYPE_REASSOC_RESP)) SetFrameSubType(pwlanhdr, pkt_type); else return; @@ -1034,7 +1034,7 @@ static void issue_assocreq(struct adapter *padapter) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_ASSOCREQ); + SetFrameSubType(pframe, IEEE80211_STYPE_ASSOC_REQ); pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -1226,7 +1226,7 @@ static int _issue_nulldata(struct adapter *padapter, unsigned char *da, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_DATA_NULL); + SetFrameSubType(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -1355,7 +1355,7 @@ static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_QOS_DATA_NULL); + SetFrameSubType(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); pframe += sizeof(struct ieee80211_qos_hdr); pattrib->pktlen = sizeof(struct ieee80211_qos_hdr); @@ -1460,7 +1460,7 @@ static int _issue_deauth(struct adapter *padapter, unsigned char *da, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_DEAUTH); + SetFrameSubType(pframe, IEEE80211_STYPE_DEAUTH); pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -1578,7 +1578,7 @@ static void issue_action_BA(struct adapter *padapter, unsigned char *raddr, SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_ACTION); + SetFrameSubType(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -1735,7 +1735,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq); pmlmeext->mgnt_seq++; - SetFrameSubType(pframe, WIFI_ACTION); + SetFrameSubType(pframe, IEEE80211_STYPE_ACTION); pframe += sizeof(struct ieee80211_hdr_3addr); pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -2021,15 +2021,15 @@ static u8 collect_bss_info(struct adapter *padapter, subtype = GetFrameSubType(pframe); - if (subtype == WIFI_BEACON) { + if (subtype == IEEE80211_STYPE_BEACON) { bssid->Reserved[0] = 1; ie_offset = _BEACON_IE_OFFSET_; } else { /* FIXME : more type */ - if (subtype == WIFI_PROBEREQ) { + if (subtype == IEEE80211_STYPE_PROBE_REQ) { ie_offset = _PROBEREQ_IE_OFFSET_; bssid->Reserved[0] = 2; - } else if (subtype == WIFI_PROBERSP) { + } else if (subtype == IEEE80211_STYPE_PROBE_RESP) { ie_offset = _PROBERSP_IE_OFFSET_; bssid->Reserved[0] = 3; } else { @@ -2117,7 +2117,7 @@ static u8 collect_bss_info(struct adapter *padapter, } } - if (subtype == WIFI_PROBEREQ) { + if (subtype == IEEE80211_STYPE_PROBE_REQ) { /* FIXME */ bssid->InfrastructureMode = Ndis802_11Infrastructure; ether_addr_copy(bssid->MacAddress, GetAddr2Ptr(pframe)); @@ -2904,10 +2904,10 @@ static unsigned int OnAssocReq(struct adapter *padapter, return _FAIL; frame_type = GetFrameSubType(pframe); - if (frame_type == WIFI_ASSOCREQ) { + if (frame_type == IEEE80211_STYPE_ASSOC_REQ) { reassoc = 0; ie_offset = _ASOCREQ_IE_OFFSET_; - } else { /* WIFI_REASSOCREQ */ + } else { /* IEEE80211_STYPE_REASSOC_REQ */ reassoc = 1; ie_offset = _REASOCREQ_IE_OFFSET_; } @@ -3279,10 +3279,10 @@ static unsigned int OnAssocReq(struct adapter *padapter, sta_info_update(padapter, pstat); /* issue assoc rsp before notify station join event. */ - if (frame_type == WIFI_ASSOCREQ) - issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP); + if (frame_type == IEEE80211_STYPE_ASSOC_REQ) + issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_ASSOC_RESP); else - issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); + issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_REASSOC_RESP); /* 2 - report to upper layer */ DBG_88E("indicate_sta_join_event to upper layer - hostapd\n"); @@ -3303,10 +3303,10 @@ asoc_class2_error: OnAssocReqFail: pstat->aid = 0; - if (frame_type == WIFI_ASSOCREQ) - issue_asocrsp(padapter, status, pstat, WIFI_ASSOCRSP); + if (frame_type == IEEE80211_STYPE_ASSOC_REQ) + issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_ASSOC_RESP); else - issue_asocrsp(padapter, status, pstat, WIFI_REASSOCRSP); + issue_asocrsp(padapter, status, pstat, IEEE80211_STYPE_REASSOC_RESP); #endif /* CONFIG_88EU_AP_MODE */ @@ -3819,20 +3819,20 @@ Following are the initialization functions for WiFi MLME *****************************************************************************/ static struct mlme_handler mlme_sta_tbl[] = { - {WIFI_ASSOCREQ, "OnAssocReq", &OnAssocReq}, - {WIFI_ASSOCRSP, "OnAssocRsp", &OnAssocRsp}, - {WIFI_REASSOCREQ, "OnReAssocReq", &OnAssocReq}, - {WIFI_REASSOCRSP, "OnReAssocRsp", &OnAssocRsp}, - {WIFI_PROBEREQ, "OnProbeReq", &OnProbeReq}, - {WIFI_PROBERSP, "OnProbeRsp", &OnProbeRsp}, - {0, "DoReserved", &DoReserved}, - {0, "DoReserved", &DoReserved}, - {WIFI_BEACON, "OnBeacon", &OnBeacon}, - {WIFI_ATIM, "OnATIM", &OnAtim}, - {WIFI_DISASSOC, "OnDisassoc", &OnDisassoc}, - {WIFI_AUTH, "OnAuth", &OnAuthClient}, - {WIFI_DEAUTH, "OnDeAuth", &OnDeAuth}, - {WIFI_ACTION, "OnAction", &OnAction}, + {IEEE80211_STYPE_ASSOC_REQ, "OnAssocReq", &OnAssocReq}, + {IEEE80211_STYPE_ASSOC_RESP, "OnAssocRsp", &OnAssocRsp}, + {IEEE80211_STYPE_REASSOC_REQ, "OnReAssocReq", &OnAssocReq}, + {IEEE80211_STYPE_REASSOC_RESP, "OnReAssocRsp", &OnAssocRsp}, + {IEEE80211_STYPE_PROBE_REQ, "OnProbeReq", &OnProbeReq}, + {IEEE80211_STYPE_PROBE_RESP, "OnProbeRsp", &OnProbeRsp}, + {0, "DoReserved", &DoReserved}, + {0, "DoReserved", &DoReserved}, + {IEEE80211_STYPE_BEACON, "OnBeacon", &OnBeacon}, + {IEEE80211_STYPE_ATIM, "OnATIM", &OnAtim}, + {IEEE80211_STYPE_DISASSOC, "OnDisassoc", &OnDisassoc}, + {IEEE80211_STYPE_AUTH, "OnAuth", &OnAuthClient}, + {IEEE80211_STYPE_DEAUTH, "OnDeAuth", &OnDeAuth}, + {IEEE80211_STYPE_ACTION, "OnAction", &OnAction}, }; int init_hw_mlme_ext(struct adapter *padapter) @@ -4118,17 +4118,17 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame) #ifdef CONFIG_88EU_AP_MODE switch (GetFrameSubType(pframe)) { - case WIFI_AUTH: + case IEEE80211_STYPE_AUTH: if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) ptable->func = &OnAuth; else ptable->func = &OnAuthClient; fallthrough; - case WIFI_ASSOCREQ: - case WIFI_REASSOCREQ: - case WIFI_PROBEREQ: - case WIFI_BEACON: - case WIFI_ACTION: + case IEEE80211_STYPE_ASSOC_REQ: + case IEEE80211_STYPE_REASSOC_REQ: + case IEEE80211_STYPE_PROBE_REQ: + case IEEE80211_STYPE_BEACON: + case IEEE80211_STYPE_ACTION: _mgt_dispatcher(padapter, ptable, precv_frame); break; default: diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index b2fe448d999d..e79cfdd4bf90 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -866,7 +866,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter, return _FAIL; /* only handle ps-poll */ - if (GetFrameSubType(pframe) == WIFI_PSPOLL) { + if (GetFrameSubType(pframe) == (IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL)) { u16 aid; u8 wmmps_ac = 0; struct sta_info *psta = NULL; @@ -997,11 +997,11 @@ static int validate_recv_mgnt_frame(struct adapter *padapter, GetAddr2Ptr(precv_frame->pkt->data)); if (psta) { psta->sta_stats.rx_mgnt_pkts++; - if (GetFrameSubType(precv_frame->pkt->data) == WIFI_BEACON) { + if (GetFrameSubType(precv_frame->pkt->data) == IEEE80211_STYPE_BEACON) { psta->sta_stats.rx_beacon_pkts++; - } else if (GetFrameSubType(precv_frame->pkt->data) == WIFI_PROBEREQ) { + } else if (GetFrameSubType(precv_frame->pkt->data) == IEEE80211_STYPE_PROBE_REQ) { psta->sta_stats.rx_probereq_pkts++; - } else if (GetFrameSubType(precv_frame->pkt->data) == WIFI_PROBERSP) { + } else if (GetFrameSubType(precv_frame->pkt->data) == IEEE80211_STYPE_PROBE_RESP) { if (!memcmp(padapter->eeprompriv.mac_addr, GetAddr1Ptr(precv_frame->pkt->data), ETH_ALEN)) psta->sta_stats.rx_probersp_pkts++; diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c index 7015db16dcf8..3e244e949995 100644 --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c @@ -820,7 +820,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len) subtype = GetFrameSubType(pframe) >> 4; - if (subtype == WIFI_BEACON) + if (subtype == IEEE80211_STYPE_BEACON) bssid->Reserved[0] = 1; bssid->Length = sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + len; diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c index 3a0e3d41a404..34d2c62765f0 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_cmd.c @@ -218,7 +218,7 @@ static void ConstructBeacon(struct adapter *adapt, u8 *pframe, u32 *pLength) ether_addr_copy(pwlanhdr->addr3, cur_network->MacAddress); SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/); - SetFrameSubType(pframe, WIFI_BEACON); + SetFrameSubType(pframe, IEEE80211_STYPE_BEACON); pframe += sizeof(struct ieee80211_hdr_3addr); pktlen = sizeof(struct ieee80211_hdr_3addr); @@ -297,7 +297,7 @@ static void ConstructPSPoll(struct adapter *adapt, u8 *pframe, u32 *pLength) fctrl = &pwlanhdr->frame_control; *(fctrl) = 0; SetPwrMgt(fctrl); - SetFrameSubType(pframe, WIFI_PSPOLL); + SetFrameSubType(pframe, IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL); /* AID. */ SetDuration(pframe, (pmlmeinfo->aid | 0xc000)); @@ -361,7 +361,7 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe, if (bQoS) { struct ieee80211_qos_hdr *pwlanqoshdr; - SetFrameSubType(pframe, WIFI_QOS_DATA_NULL); + SetFrameSubType(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); pwlanqoshdr = (struct ieee80211_qos_hdr *)pframe; SetPriority(&pwlanqoshdr->qos_ctrl, AC); @@ -369,7 +369,7 @@ static void ConstructNullFunctionData(struct adapter *adapt, u8 *pframe, pktlen = sizeof(struct ieee80211_qos_hdr); } else { - SetFrameSubType(pframe, WIFI_DATA_NULL); + SetFrameSubType(pframe, IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); pktlen = sizeof(struct ieee80211_hdr_3addr); } @@ -399,7 +399,7 @@ static void ConstructProbeRsp(struct adapter *adapt, u8 *pframe, u32 *pLength, u ether_addr_copy(pwlanhdr->addr3, bssid); SetSeqNum(pwlanhdr, 0); - SetFrameSubType(fctrl, WIFI_PROBERSP); + SetFrameSubType(fctrl, IEEE80211_STYPE_PROBE_RESP); pktlen = sizeof(struct ieee80211_hdr_3addr); pframe += pktlen; diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c index 8669bf097479..05dbd3f08328 100644 --- a/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c +++ b/drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c @@ -156,7 +156,7 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, myid(&padapter->eeprompriv), ETH_ALEN)); pkt_info.bPacketBeacon = pkt_info.bPacketMatchBSSID && - (GetFrameSubType(wlanhdr) == WIFI_BEACON); + (GetFrameSubType(wlanhdr) == IEEE80211_STYPE_BEACON); if (pkt_info.bPacketBeacon) { if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE)) diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu/include/wifi.h index 84e17330628e..716fec036e54 100644 --- a/drivers/staging/rtl8188eu/include/wifi.h +++ b/drivers/staging/rtl8188eu/include/wifi.h @@ -25,42 +25,6 @@ enum WIFI_FRAME_TYPE { WIFI_QOS_DATA_TYPE = (BIT(7) | BIT(3)), /* QoS Data */ }; -enum WIFI_FRAME_SUBTYPE { - /* below is for mgt frame */ - WIFI_ASSOCREQ = (0 | WIFI_MGT_TYPE), - WIFI_ASSOCRSP = (BIT(4) | WIFI_MGT_TYPE), - WIFI_REASSOCREQ = (BIT(5) | WIFI_MGT_TYPE), - WIFI_REASSOCRSP = (BIT(5) | BIT(4) | WIFI_MGT_TYPE), - WIFI_PROBEREQ = (BIT(6) | WIFI_MGT_TYPE), - WIFI_PROBERSP = (BIT(6) | BIT(4) | WIFI_MGT_TYPE), - WIFI_BEACON = (BIT(7) | WIFI_MGT_TYPE), - WIFI_ATIM = (BIT(7) | BIT(4) | WIFI_MGT_TYPE), - WIFI_DISASSOC = (BIT(7) | BIT(5) | WIFI_MGT_TYPE), - WIFI_AUTH = (BIT(7) | BIT(5) | BIT(4) | WIFI_MGT_TYPE), - WIFI_DEAUTH = (BIT(7) | BIT(6) | WIFI_MGT_TYPE), - WIFI_ACTION = (BIT(7) | BIT(6) | BIT(4) | WIFI_MGT_TYPE), - - /* below is for control frame */ - WIFI_PSPOLL = (BIT(7) | BIT(5) | WIFI_CTRL_TYPE), - WIFI_RTS = (BIT(7) | BIT(5) | BIT(4) | WIFI_CTRL_TYPE), - WIFI_CTS = (BIT(7) | BIT(6) | WIFI_CTRL_TYPE), - WIFI_ACK = (BIT(7) | BIT(6) | BIT(4) | WIFI_CTRL_TYPE), - WIFI_CFEND = (BIT(7) | BIT(6) | BIT(5) | WIFI_CTRL_TYPE), - WIFI_CFEND_CFACK = (BIT(7) | BIT(6) | BIT(5) | BIT(4) | - WIFI_CTRL_TYPE), - - /* below is for data frame */ - WIFI_DATA = (0 | WIFI_DATA_TYPE), - WIFI_DATA_CFACK = (BIT(4) | WIFI_DATA_TYPE), - WIFI_DATA_CFPOLL = (BIT(5) | WIFI_DATA_TYPE), - WIFI_DATA_CFACKPOLL = (BIT(5) | BIT(4) | WIFI_DATA_TYPE), - WIFI_DATA_NULL = (BIT(6) | WIFI_DATA_TYPE), - WIFI_CF_ACK = (BIT(6) | BIT(4) | WIFI_DATA_TYPE), - WIFI_CF_POLL = (BIT(6) | BIT(5) | WIFI_DATA_TYPE), - WIFI_CF_ACKPOLL = (BIT(6) | BIT(5) | BIT(4) | WIFI_DATA_TYPE), - WIFI_QOS_DATA_NULL = (BIT(6) | WIFI_QOS_DATA_TYPE), -}; - #define SetToDs(pbuf) \ *(__le16 *)(pbuf) |= cpu_to_le16(IEEE80211_FCTL_TODS) From b3cd518c5abd42fbc747ef55a5fdc40bf7bf01c0 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Wed, 28 Apr 2021 10:33:01 -0700 Subject: [PATCH 123/744] staging: rtl8723bs: Use list iterators and helpers The rtl8723bs driver manually re-implements list helper functions and macros in various ways. Replace with existing list helpers. The following coccinelle script was used to convert the code. @@ identifier v1, v2, v3, v4; symbol next; expression e; iterator name list_for_each; statement S; @@ <+... ( - e = v1->next; | - e = get_next(v1); ) ... when != e - while ( \( v1 != e \| e != v1 \) ) + list_for_each (e, v1) { ... - v2 = container_of(e, struct v3, v4); + v2 = list_entry(e, struct v3, v4); ?- if (!v2) S ... ( - e = e->next; | - e = get_next(e); ) ... when != e } ...+> @@ identifier v1, v2, v3, v4; symbol next; expression e; iterator name list_for_each; statement S; @@ <+... ( - e = v1->next; | - e = get_next(v1); ) ... when != e - while (1) + list_for_each (e, v1) { - if ( \( e == v1 \| v1 == e \) ) - break; ... - v2 = container_of(e, struct v3, v4); + v2 = list_entry(e, struct v3, v4); ?- if (!v2) S ... ( - e = e->next; | - e = get_next(e); ) ... when != e } ...+> Manually fixed up formatting, and added auto-removed comments back in. Compile tested only. Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20210428173301.149619-1-linux@roeck-us.net Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_ap.c | 58 +++++---------- drivers/staging/rtl8723bs/core/rtw_mlme.c | 72 +++++-------------- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 16 ++--- drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 29 +++----- drivers/staging/rtl8723bs/core/rtw_xmit.c | 43 ++++------- .../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 7 +- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 19 ++--- .../staging/rtl8723bs/os_dep/ioctl_linux.c | 47 +++--------- drivers/staging/rtl8723bs/os_dep/xmit_linux.c | 8 +-- 9 files changed, 80 insertions(+), 219 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index dc8f029e8b7f..9df4476b2e2d 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c @@ -188,13 +188,9 @@ void expire_timeout_chk(struct adapter *padapter) spin_lock_bh(&pstapriv->auth_list_lock); phead = &pstapriv->auth_list; - plist = get_next(phead); - /* check auth_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, auth_list); - - plist = get_next(plist); + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, auth_list); if (psta->expire_to > 0) { psta->expire_to--; @@ -217,12 +213,9 @@ void expire_timeout_chk(struct adapter *padapter) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = get_next(phead); - /* check asoc_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); - plist = get_next(plist); + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, asoc_list); if (chk_sta_is_alive(psta) || !psta->expire_to) { psta->expire_to = pstapriv->expire_to; psta->keep_alive_trycnt = 0; @@ -1210,11 +1203,8 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr) spin_lock_bh(&(pacl_node_q->lock)); phead = get_list_head(pacl_node_q); - plist = get_next(phead); - - while (phead != plist) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - plist = get_next(plist); + list_for_each(plist, phead) { + paclnode = list_entry(plist, struct rtw_wlan_acl_node, list); if (!memcmp(paclnode->addr, addr, ETH_ALEN)) { if (paclnode->valid == true) { @@ -1266,11 +1256,8 @@ void rtw_acl_remove_sta(struct adapter *padapter, u8 *addr) spin_lock_bh(&(pacl_node_q->lock)); phead = get_list_head(pacl_node_q); - plist = get_next(phead); - - while (phead != plist) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - plist = get_next(plist); + list_for_each(plist, phead) { + paclnode = list_entry(plist, struct rtw_wlan_acl_node, list); if ( !memcmp(paclnode->addr, addr, ETH_ALEN) || @@ -1716,13 +1703,9 @@ void associated_clients_update(struct adapter *padapter, u8 updated) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = get_next(phead); - /* check asoc_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); - - plist = get_next(plist); + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, asoc_list); VCS_update(padapter, psta); } @@ -1972,13 +1955,9 @@ void rtw_sta_flush(struct adapter *padapter) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = get_next(phead); - /* free sta asoc_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); - - plist = get_next(plist); + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, asoc_list); list_del_init(&psta->asoc_list); pstapriv->asoc_list_cnt--; @@ -2074,13 +2053,10 @@ void rtw_ap_restore_network(struct adapter *padapter) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = get_next(phead); - - while (phead != plist) { + list_for_each(plist, phead) { int stainfo_offset; - psta = container_of(plist, struct sta_info, asoc_list); - plist = get_next(plist); + psta = list_entry(plist, struct sta_info, asoc_list); stainfo_offset = rtw_stainfo_offset(pstapriv, psta); if (stainfo_offset_valid(stainfo_offset)) @@ -2183,10 +2159,8 @@ void stop_ap_mode(struct adapter *padapter) /* for ACL */ spin_lock_bh(&(pacl_node_q->lock)); phead = get_list_head(pacl_node_q); - plist = get_next(phead); - while (phead != plist) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - plist = get_next(plist); + list_for_each(plist, phead) { + paclnode = list_entry(plist, struct rtw_wlan_acl_node, list); if (paclnode->valid) { paclnode->valid = false; diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index a6cd63b11ea1..7bd9e3a4f345 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -242,15 +242,11 @@ struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr) /* spin_lock_bh(&scanned_queue->lock); */ phead = get_list_head(scanned_queue); - plist = get_next(phead); - - while (plist != phead) { - pnetwork = container_of(plist, struct wlan_network, list); + list_for_each(plist, phead) { + pnetwork = list_entry(plist, struct wlan_network, list); if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN)) break; - - plist = get_next(plist); } if (plist == phead) @@ -272,13 +268,9 @@ void rtw_free_network_queue(struct adapter *padapter, u8 isfreeall) spin_lock_bh(&scanned_queue->lock); phead = get_list_head(scanned_queue); - plist = get_next(phead); + list_for_each(plist, phead) { - while (phead != plist) { - - pnetwork = container_of(plist, struct wlan_network, list); - - plist = get_next(plist); + pnetwork = list_entry(plist, struct wlan_network, list); _rtw_free_network(pmlmepriv, pnetwork, isfreeall); @@ -420,15 +412,11 @@ struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue, struc struct wlan_network *found = NULL; phead = get_list_head(scanned_queue); - plist = get_next(phead); - - while (plist != phead) { - found = container_of(plist, struct wlan_network, list); + list_for_each(plist, phead) { + found = list_entry(plist, struct wlan_network, list); if (is_same_network(&network->network, &found->network, 0)) break; - - plist = get_next(plist); } if (plist == phead) @@ -446,21 +434,14 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue) phead = get_list_head(scanned_queue); - plist = get_next(phead); + list_for_each(plist, phead) { - while (1) { - - if (phead == plist) - break; - - pwlan = container_of(plist, struct wlan_network, list); + pwlan = list_entry(plist, struct wlan_network, list); if (!pwlan->fixed) { if (oldest == NULL || time_after(oldest->last_scanned, pwlan->last_scanned)) oldest = pwlan; } - - plist = get_next(plist); } return oldest; @@ -547,13 +528,8 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t spin_lock_bh(&queue->lock); phead = get_list_head(queue); - plist = get_next(phead); - - while (1) { - if (phead == plist) - break; - - pnetwork = container_of(plist, struct wlan_network, list); + list_for_each(plist, phead) { + pnetwork = list_entry(plist, struct wlan_network, list); rtw_bug_check(pnetwork, pnetwork, pnetwork, pnetwork); @@ -569,8 +545,6 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t if (oldest == NULL || time_after(oldest->last_scanned, pnetwork->last_scanned)) oldest = pnetwork; - plist = get_next(plist); - } /* If we didn't find a match, then get a new network slot to initialize @@ -1786,17 +1760,10 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme) spin_lock_bh(&(mlme->scanned_queue.lock)); phead = get_list_head(queue); - mlme->pscanned = get_next(phead); + list_for_each(mlme->pscanned, phead) { - while (phead != mlme->pscanned) { - - pnetwork = container_of(mlme->pscanned, struct wlan_network, list); - if (!pnetwork) { - ret = _FAIL; - goto exit; - } - - mlme->pscanned = get_next(mlme->pscanned); + pnetwork = list_entry(mlme->pscanned, struct wlan_network, + list); rtw_check_roaming_candidate(mlme, &candidate, pnetwork); @@ -1890,17 +1857,10 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv) } phead = get_list_head(queue); - pmlmepriv->pscanned = get_next(phead); + list_for_each(pmlmepriv->pscanned, phead) { - while (phead != pmlmepriv->pscanned) { - - pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); - if (!pnetwork) { - ret = _FAIL; - goto exit; - } - - pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); + pnetwork = list_entry(pmlmepriv->pscanned, + struct wlan_network, list); rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork); diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 655a57a27c9f..c5430e737bb1 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -5135,10 +5135,9 @@ void _linked_info_dump(struct adapter *padapter) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = get_next(phead); - while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); - plist = get_next(plist); + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, + asoc_list); } spin_unlock_bh(&pstapriv->asoc_list_lock); @@ -6108,12 +6107,9 @@ u8 chk_bmc_sleepq_hdl(struct adapter *padapter, unsigned char *pbuf) spin_lock_bh(&pxmitpriv->lock); xmitframe_phead = get_list_head(&psta_bmc->sleep_q); - xmitframe_plist = get_next(xmitframe_phead); - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = get_next(xmitframe_plist); + list_for_each(xmitframe_plist, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, + struct xmit_frame, list); list_del_init(&pxmitframe->list); diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c index 385bbbdb2de5..fa164d25f4eb 100644 --- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c +++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c @@ -148,13 +148,11 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) spin_lock_bh(&pstapriv->sta_hash_lock); for (index = 0; index < NUM_STA; index++) { phead = &(pstapriv->sta_hash[index]); - plist = get_next(phead); - - while (phead != plist) { + list_for_each(plist, phead) { int i; - psta = container_of(plist, struct sta_info, hash_list); - plist = get_next(plist); + psta = list_entry(plist, struct sta_info, + hash_list); for (i = 0; i < 16 ; i++) { preorder_ctrl = &psta->recvreorder_ctrl[i]; @@ -438,12 +436,8 @@ void rtw_free_all_stainfo(struct adapter *padapter) for (index = 0; index < NUM_STA; index++) { phead = &(pstapriv->sta_hash[index]); - plist = get_next(phead); - - while (phead != plist) { - psta = container_of(plist, struct sta_info, hash_list); - - plist = get_next(plist); + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, hash_list); if (pbcmc_stainfo != psta) rtw_free_stainfo(padapter, psta); @@ -475,17 +469,14 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) spin_lock_bh(&pstapriv->sta_hash_lock); phead = &(pstapriv->sta_hash[index]); - plist = get_next(phead); - - while (phead != plist) { - psta = container_of(plist, struct sta_info, hash_list); + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, hash_list); if ((!memcmp(psta->hwaddr, addr, ETH_ALEN))) /* if found the matched address */ break; psta = NULL; - plist = get_next(plist); } spin_unlock_bh(&pstapriv->sta_hash_lock); @@ -531,10 +522,8 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr) spin_lock_bh(&(pacl_node_q->lock)); phead = get_list_head(pacl_node_q); - plist = get_next(phead); - while (phead != plist) { - paclnode = container_of(plist, struct rtw_wlan_acl_node, list); - plist = get_next(plist); + list_for_each(plist, phead) { + paclnode = list_entry(plist, struct rtw_wlan_acl_node, list); if (!memcmp(paclnode->addr, mac_addr, ETH_ALEN)) if (paclnode->valid == true) { diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 03d036bd2ac6..7e3477a45a0f 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -1729,12 +1729,8 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram spin_lock_bh(&pframequeue->lock); phead = get_list_head(pframequeue); - plist = get_next(phead); - - while (phead != plist) { - pxmitframe = container_of(plist, struct xmit_frame, list); - - plist = get_next(plist); + list_for_each(plist, phead) { + pxmitframe = list_entry(plist, struct xmit_frame, list); rtw_free_xmitframe(pxmitpriv, pxmitframe); } @@ -2134,12 +2130,8 @@ static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struc struct hw_xmit *phwxmits = padapter->xmitpriv.hwxmits; phead = get_list_head(pframequeue); - plist = get_next(phead); - - while (phead != plist) { - pxmitframe = container_of(plist, struct xmit_frame, list); - - plist = get_next(plist); + list_for_each(plist, phead) { + pxmitframe = list_entry(plist, struct xmit_frame, list); pattrib = &pxmitframe->attrib; @@ -2209,12 +2201,9 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) spin_lock_bh(&pxmitpriv->lock); xmitframe_phead = get_list_head(&psta->sleep_q); - xmitframe_plist = get_next(xmitframe_phead); - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = get_next(xmitframe_plist); + list_for_each(xmitframe_plist, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, struct xmit_frame, + list); list_del_init(&pxmitframe->list); @@ -2283,12 +2272,9 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) if ((pstapriv->sta_dz_bitmap&0xfffe) == 0x0) { /* no any sta in ps mode */ xmitframe_phead = get_list_head(&psta_bmc->sleep_q); - xmitframe_plist = get_next(xmitframe_phead); - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = get_next(xmitframe_plist); + list_for_each(xmitframe_plist, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, + struct xmit_frame, list); list_del_init(&pxmitframe->list); @@ -2330,12 +2316,9 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst spin_lock_bh(&pxmitpriv->lock); xmitframe_phead = get_list_head(&psta->sleep_q); - xmitframe_plist = get_next(xmitframe_phead); - - while (xmitframe_phead != xmitframe_plist) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = get_next(xmitframe_plist); + list_for_each(xmitframe_plist, xmitframe_phead) { + pxmitframe = list_entry(xmitframe_plist, struct xmit_frame, + list); switch (pxmitframe->attrib.priority) { case 1: diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c index bd95e62fb053..ec9f275cbc7e 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c @@ -223,12 +223,11 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv spin_lock_bh(&pxmitpriv->lock); sta_phead = get_list_head(phwxmit->sta_queue); - sta_plist = get_next(sta_phead); /* because stop_sta_xmit may delete sta_plist at any time */ /* so we should add lock here, or while loop can not exit */ - while (sta_phead != sta_plist) { - ptxservq = container_of(sta_plist, struct tx_servq, tx_pending); - sta_plist = get_next(sta_plist); + list_for_each(sta_plist, sta_phead) { + ptxservq = list_entry(sta_plist, struct tx_servq, + tx_pending); pframe_queue = &ptxservq->sta_pending; diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 2d8d4920785c..2a78e6a205ac 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -1262,14 +1262,9 @@ void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter) spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); phead = get_list_head(queue); - plist = get_next(phead); - - while (1) + list_for_each(plist, phead) { - if (phead == plist) - break; - - pnetwork = container_of(plist, struct wlan_network, list); + pnetwork = list_entry(plist, struct wlan_network, list); /* report network only if the current channel set contains the channel to which this network belongs */ if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0 @@ -1281,8 +1276,6 @@ void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter) rtw_cfg80211_inform_bss(padapter, pnetwork); } - plist = get_next(plist); - } spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); @@ -2486,13 +2479,9 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = get_next(phead); - /* check asoc_queue */ - while (phead != plist) { - psta = container_of(plist, struct sta_info, asoc_list); - - plist = get_next(plist); + list_for_each(plist, phead) { + psta = list_entry(plist, struct sta_info, asoc_list); if (!memcmp((u8 *)mac, psta->hwaddr, ETH_ALEN)) { if (psta->dot8021xalg != 1 || psta->bpairwise_key_installed) { diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index 5912915a7870..189e3137a232 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -1052,15 +1052,9 @@ static int rtw_wx_set_wap(struct net_device *dev, authmode = padapter->securitypriv.ndisauthtype; spin_lock_bh(&queue->lock); phead = get_list_head(queue); - pmlmepriv->pscanned = get_next(phead); - - while (1) { - if (phead == pmlmepriv->pscanned) - break; - - pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); - - pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); + list_for_each(pmlmepriv->pscanned, phead) { + pnetwork = list_entry(pmlmepriv->pscanned, + struct wlan_network, list); dst_bssid = pnetwork->network.MacAddress; @@ -1299,18 +1293,13 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); phead = get_list_head(queue); - plist = get_next(phead); - - while (1) { - if (phead == plist) - break; - + list_for_each(plist, phead) { if ((stop - ev) < SCAN_ITEM_SIZE) { ret = -E2BIG; break; } - pnetwork = container_of(plist, struct wlan_network, list); + pnetwork = list_entry(plist, struct wlan_network, list); /* report network only if the current channel set contains the channel to which this network belongs */ if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0 @@ -1320,8 +1309,6 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, ev = translate_scan(padapter, a, pnetwork, ev, stop); } - plist = get_next(plist); - } spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); @@ -1387,15 +1374,9 @@ static int rtw_wx_set_essid(struct net_device *dev, spin_lock_bh(&queue->lock); phead = get_list_head(queue); - pmlmepriv->pscanned = get_next(phead); - - while (1) { - if (phead == pmlmepriv->pscanned) - break; - - pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); - - pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); + list_for_each(pmlmepriv->pscanned, phead) { + pnetwork = list_entry(pmlmepriv->pscanned, + struct wlan_network, list); dst_ssid = pnetwork->network.Ssid.Ssid; @@ -2252,14 +2233,8 @@ static int rtw_get_ap_info(struct net_device *dev, spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); phead = get_list_head(queue); - plist = get_next(phead); - - while (1) { - if (phead == plist) - break; - - - pnetwork = container_of(plist, struct wlan_network, list); + list_for_each(plist, phead) { + pnetwork = list_entry(plist, struct wlan_network, list); if (!mac_pton(data, bssid)) { spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); @@ -2282,8 +2257,6 @@ static int rtw_get_ap_info(struct net_device *dev, } } - plist = get_next(plist); - } spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); diff --git a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c index 6b039c1d8d57..530e7a6c67c5 100644 --- a/drivers/staging/rtl8723bs/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/xmit_linux.c @@ -137,13 +137,11 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb) spin_lock_bh(&pstapriv->asoc_list_lock); phead = &pstapriv->asoc_list; - plist = get_next(phead); - /* free sta asoc_queue */ - while (phead != plist) { + list_for_each(plist, phead) { int stainfo_offset; - psta = container_of(plist, struct sta_info, asoc_list); - plist = get_next(plist); + + psta = list_entry(plist, struct sta_info, asoc_list); stainfo_offset = rtw_stainfo_offset(pstapriv, psta); if (stainfo_offset_valid(stainfo_offset)) { From a76455587f1d899deb73c1fcd1c271d66759952a Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:23 +0200 Subject: [PATCH 124/744] staging: rtl8723bs: remove ODM_RT_TRACE logs remove all ODM_RT_TRACE logs. ODM_RT_TRACE macro default behaviour is _trace nothing_. To enable it a hand code edit is needed in hal/odm_debug.c. So just remove it. Applied the semantic patch: @@ @@ - ODM_RT_TRACE(...); Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/23e21c100ba4f0753c6f03a1bb28d9bd7729b64b.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8723bs/hal/HalHWImg8723B_BB.c | 62 ---- .../staging/rtl8723bs/hal/HalHWImg8723B_MAC.c | 49 --- .../staging/rtl8723bs/hal/HalHWImg8723B_RF.c | 63 ---- drivers/staging/rtl8723bs/hal/HalPhyRf.c | 325 +----------------- .../staging/rtl8723bs/hal/HalPhyRf_8723B.c | 140 +------- drivers/staging/rtl8723bs/hal/odm.c | 34 -- .../staging/rtl8723bs/hal/odm_CfoTracking.c | 107 ------ drivers/staging/rtl8723bs/hal/odm_DIG.c | 319 ----------------- .../rtl8723bs/hal/odm_EdcaTurboCheck.c | 18 - drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 18 - .../staging/rtl8723bs/hal/odm_NoiseMonitor.c | 27 -- drivers/staging/rtl8723bs/hal/odm_PathDiv.c | 14 +- .../rtl8723bs/hal/odm_RegConfig8723B.c | 66 ---- 13 files changed, 7 insertions(+), 1235 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c index 016d257b90a0..77b9c672ff0e 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c @@ -33,47 +33,6 @@ static bool CheckPositive( pDM_Odm->TypeALNA << 16 | pDM_Odm->TypeAPA << 24; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", - cond1, - cond2 - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", - driver1, - driver2 - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - (" (Platform, Interface) = (0x%X, 0x%X)\n", - pDM_Odm->SupportPlatform, - pDM_Odm->SupportInterface - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Board, Package) = (0x%X, 0x%X)\n", - pDM_Odm->BoardType, - pDM_Odm->PackageType - ) - ); - /* Value Defined Check =============== */ /* QFN Type [15:12] and Cut Version [27:24] need to do value check */ @@ -263,13 +222,6 @@ void ODM_ReadAndConfig_MP_8723B_AGC_TAB(struct dm_odm_t *pDM_Odm) u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_AGC_TAB); u32 *Array = Array_MP_8723B_AGC_TAB; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_AGC_TAB\n") - ); - for (i = 0; i < ArrayLen; i += 2) { u32 v1 = Array[i]; u32 v2 = Array[i+1]; @@ -532,13 +484,6 @@ void ODM_ReadAndConfig_MP_8723B_PHY_REG(struct dm_odm_t *pDM_Odm) u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_PHY_REG); u32 *Array = Array_MP_8723B_PHY_REG; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_PHY_REG\n") - ); - for (i = 0; i < ArrayLen; i += 2) { u32 v1 = Array[i]; u32 v2 = Array[i+1]; @@ -611,13 +556,6 @@ void ODM_ReadAndConfig_MP_8723B_PHY_REG_PG(struct dm_odm_t *pDM_Odm) u32 i = 0; u32 *Array = Array_MP_8723B_PHY_REG_PG; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_PHY_REG_PG\n") - ); - pDM_Odm->PhyRegPgVersion = 1; pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE; diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c index 677bcfa10b0d..47e66f4ad9d1 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_MAC.c @@ -33,48 +33,6 @@ static bool CheckPositive( pDM_Odm->TypeALNA << 16 | pDM_Odm->TypeAPA << 24; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", - cond1, - cond2 - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", - driver1, - driver2 - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Platform, Interface) = (0x%X, 0x%X)\n", - pDM_Odm->SupportPlatform, - pDM_Odm->SupportInterface - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Board, Package) = (0x%X, 0x%X)\n", - pDM_Odm->BoardType, - pDM_Odm->PackageType - ) - ); - /* Value Defined Check =============== */ /* QFN Type [15:12] and Cut Version [27:24] need to do value check */ @@ -234,13 +192,6 @@ void ODM_ReadAndConfig_MP_8723B_MAC_REG(struct dm_odm_t *pDM_Odm) u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_MAC_REG); u32 *Array = Array_MP_8723B_MAC_REG; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_MAC_REG\n") - ); - for (i = 0; i < ArrayLen; i += 2) { u32 v1 = Array[i]; u32 v2 = Array[i+1]; diff --git a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c index 2c450c1ce7e7..e7a6566f2a24 100644 --- a/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c +++ b/drivers/staging/rtl8723bs/hal/HalHWImg8723B_RF.c @@ -33,48 +33,6 @@ static bool CheckPositive( pDM_Odm->TypeALNA << 16 | pDM_Odm->TypeAPA << 24; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", - cond1, - cond2 - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", - driver1, - driver2 - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Platform, Interface) = (0x%X, 0x%X)\n", - pDM_Odm->SupportPlatform, - pDM_Odm->SupportInterface - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - " (Board, Package) = (0x%X, 0x%X)\n", - pDM_Odm->BoardType, - pDM_Odm->PackageType - ) - ); - /* Value Defined Check =============== */ /* QFN Type [15:12] and Cut Version [27:24] need to do value check */ @@ -265,13 +223,6 @@ void ODM_ReadAndConfig_MP_8723B_RadioA(struct dm_odm_t *pDM_Odm) u32 ArrayLen = ARRAY_SIZE(Array_MP_8723B_RadioA); u32 *Array = Array_MP_8723B_RadioA; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_RadioA\n") - ); - for (i = 0; i < ArrayLen; i += 2) { u32 v1 = Array[i]; u32 v2 = Array[i+1]; @@ -424,13 +375,6 @@ void ODM_ReadAndConfig_MP_8723B_TxPowerTrack_SDIO(struct dm_odm_t *pDM_Odm) { struct odm_rf_cal_t *pRFCalibrateInfo = &pDM_Odm->RFCalibrateInfo; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_MP_8723B\n") - ); - memcpy( pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, @@ -760,13 +704,6 @@ void ODM_ReadAndConfig_MP_8723B_TXPWR_LMT(struct dm_odm_t *pDM_Odm) u32 i = 0; u8 **Array = Array_MP_8723B_TXPWR_LMT; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ("===> ODM_ReadAndConfig_MP_8723B_TXPWR_LMT\n") - ); - for (i = 0; i < ARRAY_SIZE(Array_MP_8723B_TXPWR_LMT); i += 7) { u8 *regulation = Array[i]; u8 *band = Array[i+1]; diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf.c b/drivers/staging/rtl8723bs/hal/HalPhyRf.c index 14426151faae..2e10817bf3dd 100644 --- a/drivers/staging/rtl8723bs/hal/HalPhyRf.c +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf.c @@ -108,18 +108,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) pDM_Odm->RFCalibrateInfo.TXPowerTrackingCallbackCnt++; pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = true; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "===>ODM_TXPowerTrackingCallback_ThermalMeter,\npDM_Odm->BbSwingIdxCckBase: %d, pDM_Odm->BbSwingIdxOfdmBase[A]: %d, pDM_Odm->DefaultOfdmIndex: %d\n", - pDM_Odm->BbSwingIdxCckBase, - pDM_Odm->BbSwingIdxOfdmBase[ODM_RF_PATH_A], - pDM_Odm->DefaultOfdmIndex - ) - ); - ThermalValue = (u8)PHY_QueryRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, c.ThermalRegAddr, 0xfc00); /* 0x42: RF Reg[15:10] 88E */ if ( !pDM_Odm->RFCalibrateInfo.TxPowerTrackControl || @@ -131,11 +119,7 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* 4 3. Initialize ThermalValues of RFCalibrateInfo */ if (pDM_Odm->RFCalibrateInfo.bReloadtxpowerindex) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("reload ofdm index for band switch\n") - ); + {} /* 4 4. Calculate average thermal meter */ @@ -154,16 +138,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* Calculate Average ThermalValue after average enough times */ if (ThermalValue_AVG_count) { ThermalValue = (u8)(ThermalValue_AVG / ThermalValue_AVG_count); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", - ThermalValue, - pHalData->EEPROMThermalMeter - ) - ); } /* 4 5. Calculate delta, delta_LCK, delta_IQK. */ @@ -181,31 +155,9 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) (ThermalValue - pDM_Odm->RFCalibrateInfo.ThermalValue_IQK) : (pDM_Odm->RFCalibrateInfo.ThermalValue_IQK - ThermalValue); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", - delta, - delta_LCK, - delta_IQK - ) - ); - /* 4 6. If necessary, do LCK. */ /* Delta temperature is equal to or larger than 20 centigrade. */ if (delta_LCK >= c.Threshold_IQK) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "delta_LCK(%d) >= Threshold_IQK(%d)\n", - delta_LCK, - c.Threshold_IQK - ) - ); pDM_Odm->RFCalibrateInfo.ThermalValue_LCK = ThermalValue; if (c.PHY_LCCalibrate) (*c.PHY_LCCalibrate)(pDM_Odm); @@ -224,16 +176,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* 4 7.1 The Final Power Index = BaseIndex + PowerIndexOffset */ if (ThermalValue > pHalData->EEPROMThermalMeter) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "deltaSwingTableIdx_TUP_A[%d] = %d\n", - delta, - deltaSwingTableIdx_TUP_A[delta] - ) - ); pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_A] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A]; pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A] = @@ -243,27 +185,7 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = deltaSwingTableIdx_TUP_A[delta]; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", - pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] - ) - ); - if (c.RfPathCount > 1) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "deltaSwingTableIdx_TUP_B[%d] = %d\n", - delta, - deltaSwingTableIdx_TUP_B[delta] - ) - ); pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_B] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B]; pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B] = @@ -272,29 +194,9 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* Record delta swing for mix mode power tracking */ pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = deltaSwingTableIdx_TUP_B[delta]; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", - pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] - ) - ); } } else { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "deltaSwingTableIdx_TDOWN_A[%d] = %d\n", - delta, - deltaSwingTableIdx_TDOWN_A[delta] - ) - ); - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_A] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A]; pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A] = @@ -304,28 +206,7 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = -1 * deltaSwingTableIdx_TDOWN_A[delta]; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", - pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] - ) - ); - if (c.RfPathCount > 1) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "deltaSwingTableIdx_TDOWN_B[%d] = %d\n", - delta, - deltaSwingTableIdx_TDOWN_B[delta] - ) - ); - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_B] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B]; pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B] = @@ -334,30 +215,10 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* Record delta swing for mix mode power tracking */ pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = -1 * deltaSwingTableIdx_TDOWN_B[delta]; - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", - pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] - ) - ); } } for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "\n\n ================================ [Path-%c] Calculating PowerIndexOffset ================================\n", - (p == ODM_RF_PATH_A ? 'A' : 'B') - ) - ); - if ( pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] == pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p] @@ -366,20 +227,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) else pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p]; /* Power Index Diff between 2 times Power Tracking */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "[Path-%c] PowerIndexOffset(%d) = DeltaPowerIndex(%d) - DeltaPowerIndexLast(%d)\n", - ( - p == ODM_RF_PATH_A ? 'A' : 'B'), - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p], - pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p], - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p] - ) - ); - pDM_Odm->RFCalibrateInfo.OFDM_index[p] = pDM_Odm->BbSwingIdxOfdmBase[p] + pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p]; @@ -394,87 +241,23 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) pDM_Odm->BbSwingIdxOfdm[p] = pDM_Odm->RFCalibrateInfo.OFDM_index[p]; - /* *************Print BB Swing Base and Index Offset************* */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n", - pDM_Odm->BbSwingIdxCck, - pDM_Odm->BbSwingIdxCckBase, - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n", - pDM_Odm->BbSwingIdxOfdm[p], - (p == ODM_RF_PATH_A ? 'A' : 'B'), - pDM_Odm->BbSwingIdxOfdmBase[p], - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] - ) - ); - /* 4 7.1 Handle boundary conditions of index. */ if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] > c.SwingTableSize_OFDM-1) pDM_Odm->RFCalibrateInfo.OFDM_index[p] = c.SwingTableSize_OFDM-1; else if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] < OFDM_min_index) pDM_Odm->RFCalibrateInfo.OFDM_index[p] = OFDM_min_index; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ("\n\n ========================================================================================================\n") - ); if (pDM_Odm->RFCalibrateInfo.CCK_index > c.SwingTableSize_CCK-1) pDM_Odm->RFCalibrateInfo.CCK_index = c.SwingTableSize_CCK-1; /* else if (pDM_Odm->RFCalibrateInfo.CCK_index < 0) */ /* pDM_Odm->RFCalibrateInfo.CCK_index = 0; */ } else { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "The thermal meter is unchanged or TxPowerTracking OFF(%d): ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d\n", - pDM_Odm->RFCalibrateInfo.TxPowerTrackControl, - ThermalValue, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); - for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = 0; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "TxPowerTracking: [CCK] Swing Current Index: %d, Swing Base Index: %d\n", - pDM_Odm->RFCalibrateInfo.CCK_index, - pDM_Odm->BbSwingIdxCckBase - ) - ); /* Print Swing base & current */ for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "TxPowerTracking: [OFDM] Swing Current Index: %d, Swing Base Index[%c]: %d\n", - pDM_Odm->RFCalibrateInfo.OFDM_index[p], - (p == ODM_RF_PATH_A ? 'A' : 'B'), - pDM_Odm->BbSwingIdxOfdmBase[p] - ) - ); } if ( @@ -491,105 +274,20 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* */ /* 2012/04/25 MH Add for tx power tracking to set tx power in tx agc for 88E. */ if (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature Increasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_A], - delta, - ThermalValue, - pHalData->EEPROMThermalMeter, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); - if (c.RfPathCount > 1) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature Increasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_B], - delta, - ThermalValue, - pHalData->EEPROMThermalMeter, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); + {} } else if (ThermalValue < pDM_Odm->RFCalibrateInfo.ThermalValue) { /* Low temperature */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_A], - delta, - ThermalValue, - pHalData->EEPROMThermalMeter, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); if (c.RfPathCount > 1) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature Decreasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n", - pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_B], - delta, - ThermalValue, - pHalData->EEPROMThermalMeter, - pDM_Odm->RFCalibrateInfo.ThermalValue - ) - ); + {} } if (ThermalValue > pHalData->EEPROMThermalMeter) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature(%d) higher than PG value(%d)\n", - ThermalValue, - pHalData->EEPROMThermalMeter - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ("**********Enter POWER Tracking MIX_MODE**********\n") - ); for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) (*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, MIX_MODE, p, 0); } else { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ( - "Temperature(%d) lower than PG value(%d)\n", - ThermalValue, - pHalData->EEPROMThermalMeter - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ("**********Enter POWER Tracking MIX_MODE**********\n") - ); for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) (*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, MIX_MODE, p, Indexforchannel); } @@ -599,26 +297,9 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) pDM_Odm->BbSwingIdxOfdmBase[p] = pDM_Odm->BbSwingIdxOfdm[p]; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ( - "pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue = %d\n", - pDM_Odm->RFCalibrateInfo.ThermalValue, - ThermalValue - ) - ); - /* Record last Power Tracking Thermal Value */ pDM_Odm->RFCalibrateInfo.ThermalValue = ThermalValue; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_TX_PWR_TRACK, - ODM_DBG_LOUD, - ("<===ODM_TXPowerTrackingCallback_ThermalMeter\n") - ); - pDM_Odm->RFCalibrateInfo.TXPowercount = 0; } diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c index c70b9cf2da32..471418f3f724 100644 --- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c @@ -129,9 +129,6 @@ static void setIqkMatrix_8723B( break; } } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("TxPwrTracking path B: X = 0x%x, Y = 0x%x ele_A = 0x%x ele_C = 0x%x ele_D = 0x%x 0xeb4 = 0x%x 0xebc = 0x%x\n", - (u32)IqkResult_X, (u32)IqkResult_Y, (u32)ele_A, (u32)ele_C, (u32)ele_D, (u32)IqkResult_X, (u32)IqkResult_Y)); } @@ -210,8 +207,6 @@ void ODM_TxPwrTrackSetPwr_8723B( } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("===>ODM_TxPwrTrackSetPwr8723B\n")); - if (TxRate != 0xFF) { /* 2 CCK */ if ((TxRate >= MGN_1M) && (TxRate <= MGN_11M)) @@ -233,13 +228,10 @@ void ODM_TxPwrTrackSetPwr_8723B( else PwrTrackingLimit_OFDM = pDM_Odm->DefaultOfdmIndex; /* Default OFDM index = 30 */ } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("TxRate = 0x%x, PwrTrackingLimit =%d\n", TxRate, PwrTrackingLimit_OFDM)); if (Method == TXAGC) { struct adapter *Adapter = pDM_Odm->Adapter; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("odm_TxPwrTrackSetPwr8723B CH =%d\n", *(pDM_Odm->pChannel))); - pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = pDM_Odm->Absolute_OFDMSwingIdx[RFPath]; pDM_Odm->Modify_TxAGC_Flag_PathA = true; @@ -270,10 +262,6 @@ void ODM_TxPwrTrackSetPwr_8723B( setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index); } else if (Method == MIX_MODE) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("pDM_Odm->DefaultOfdmIndex =%d, pDM_Odm->DefaultCCKIndex =%d, pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n", - pDM_Odm->DefaultOfdmIndex, pDM_Odm->DefaultCckIndex, pDM_Odm->Absolute_OFDMSwingIdx[RFPath], RFPath)); - Final_OFDM_Swing_Index = pDM_Odm->DefaultOfdmIndex + pDM_Odm->Absolute_OFDMSwingIdx[RFPath]; Final_CCK_Swing_Index = pDM_Odm->DefaultCckIndex + pDM_Odm->Absolute_OFDMSwingIdx[RFPath]; @@ -287,10 +275,6 @@ void ODM_TxPwrTrackSetPwr_8723B( pDM_Odm->Modify_TxAGC_Flag_PathA = true; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A Over BBSwing Limit , PwrTrackingLimit = %d , Remnant TxAGC Value = %d\n", - PwrTrackingLimit_OFDM, pDM_Odm->Remnant_OFDMSwingIdx[RFPath])); } else if (Final_OFDM_Swing_Index <= 0) { pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = Final_OFDM_Swing_Index; @@ -301,26 +285,16 @@ void ODM_TxPwrTrackSetPwr_8723B( pDM_Odm->Modify_TxAGC_Flag_PathA = true; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A Lower then BBSwing lower bound 0 , Remnant TxAGC Value = %d\n", - pDM_Odm->Remnant_OFDMSwingIdx[RFPath])); } else { setIqkMatrix_8723B(pDM_Odm, Final_OFDM_Swing_Index, RFPath, pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][0], pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[ChannelMappedIndex].Value[0][1]); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A Compensate with BBSwing , Final_OFDM_Swing_Index = %d\n", Final_OFDM_Swing_Index)); - if (pDM_Odm->Modify_TxAGC_Flag_PathA) { /* If TxAGC has changed, reset TxAGC again */ pDM_Odm->Remnant_OFDMSwingIdx[RFPath] = 0; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, OFDM); PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, HT_MCS0_MCS7); pDM_Odm->Modify_TxAGC_Flag_PathA = false; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A pDM_Odm->Modify_TxAGC_Flag = false\n")); } } @@ -329,30 +303,18 @@ void ODM_TxPwrTrackSetPwr_8723B( setCCKFilterCoefficient(pDM_Odm, PwrTrackingLimit_CCK); pDM_Odm->Modify_TxAGC_Flag_PathA_CCK = true; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, CCK); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A CCK Over Limit , PwrTrackingLimit_CCK = %d , pDM_Odm->Remnant_CCKSwingIdx = %d\n", PwrTrackingLimit_CCK, pDM_Odm->Remnant_CCKSwingIdx)); } else if (Final_CCK_Swing_Index <= 0) { /* Lowest CCK Index = 0 */ pDM_Odm->Remnant_CCKSwingIdx = Final_CCK_Swing_Index; setCCKFilterCoefficient(pDM_Odm, 0); pDM_Odm->Modify_TxAGC_Flag_PathA_CCK = true; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, CCK); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A CCK Under Limit , PwrTrackingLimit_CCK = %d , pDM_Odm->Remnant_CCKSwingIdx = %d\n", 0, pDM_Odm->Remnant_CCKSwingIdx)); } else { setCCKFilterCoefficient(pDM_Odm, Final_CCK_Swing_Index); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A CCK Compensate with BBSwing , Final_CCK_Swing_Index = %d\n", Final_CCK_Swing_Index)); - if (pDM_Odm->Modify_TxAGC_Flag_PathA_CCK) { /* If TxAGC has changed, reset TxAGC again */ pDM_Odm->Remnant_CCKSwingIdx = 0; PHY_SetTxPowerIndexByRateSection(Adapter, RFPath, pHalData->CurrentChannel, CCK); pDM_Odm->Modify_TxAGC_Flag_PathA_CCK = false; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, - ("******Path_A pDM_Odm->Modify_TxAGC_Flag_CCK = false\n")); } } } else @@ -442,8 +404,6 @@ static u8 phy_PathA_IQK_8723B( /* Save RF Path */ Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A IQK!\n")); - /* leave IQK mode */ PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); @@ -513,11 +473,6 @@ static u8 phy_PathA_IQK_8723B( regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regE94 = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord); regE9C = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe94 = 0x%x, 0xe9c = 0x%x\n", regE94, regE9C)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe90(before IQK) = 0x%x, 0xe98(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xe90, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xe98, bMaskDWord))); /* Allen 20131125 */ @@ -557,8 +512,6 @@ static u8 phy_PathA_RxIQK8723B( /* leave IQK mode */ PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A RX IQK:Get TXIMR setting\n")); /* 1 Get TXIMR setting */ /* modify RXIQK mode table */ /* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table!\n")); */ @@ -626,11 +579,6 @@ static u8 phy_PathA_RxIQK8723B( regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regE94 = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord); regE9C = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe94 = 0x%x, 0xe9c = 0x%x\n", regE94, regE9C)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe90(before IQK) = 0x%x, 0xe98(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xe90, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xe98, bMaskDWord))); /* Allen 20131125 */ tmp = (regE9C & 0x03FF0000)>>16; @@ -651,11 +599,6 @@ static u8 phy_PathA_RxIQK8723B( u4tmp = 0x80007C00 | (regE94&0x3FF0000) | ((regE9C&0x3FF0000) >> 16); PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord, u4tmp); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe40 = 0x%x u4tmp = 0x%x\n", PHY_QueryBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord), u4tmp)); - - - /* 1 RX IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A RX IQK\n")); /* modify RXIQK mode table */ /* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table 2!\n")); */ @@ -726,11 +669,6 @@ static u8 phy_PathA_RxIQK8723B( /* Check failed */ regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regEA4 = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea4 = 0x%x, 0xeac = 0x%x\n", regEA4, regEAC)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea0(before IQK) = 0x%x, 0xea8(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xea0, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xea8, bMaskDWord))); /* PA/PAD controlled by 0x0 */ /* leave IQK mode */ @@ -752,7 +690,7 @@ static u8 phy_PathA_RxIQK8723B( ) result |= 0x02; else /* if Tx not OK, ignore Rx */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK fail!!\n")); + {} return result; } @@ -764,8 +702,6 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQK!\n")); - /* Save RF Path */ Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord); @@ -839,11 +775,6 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regE94 = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord); regE9C = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe94 = 0x%x, 0xe9c = 0x%x\n", regE94, regE9C)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe90(before IQK) = 0x%x, 0xe98(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xe90, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xe98, bMaskDWord))); /* Allen 20131125 */ tmp = (regE9C & 0x03FF0000)>>16; @@ -880,9 +811,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) /* switch to path B */ PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280); - - /* 1 Get TXIMR setting */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B RX IQK:Get TXIMR setting!\n")); /* modify RXIQK mode table */ /* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table!\n")); */ PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_WE_LUT, 0x80000, 0x1); @@ -948,11 +876,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regE94 = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord); regE9C = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe94 = 0x%x, 0xe9c = 0x%x\n", regE94, regE9C)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe90(before IQK) = 0x%x, 0xe98(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xe90, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xe98, bMaskDWord))); /* Allen 20131125 */ tmp = (regE9C & 0x03FF0000)>>16; @@ -975,10 +898,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) u4tmp = 0x80007C00 | (regE94&0x3FF0000) | ((regE9C&0x3FF0000) >> 16); PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord, u4tmp); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xe40 = 0x%x u4tmp = 0x%x\n", PHY_QueryBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord), u4tmp)); - - /* 1 RX IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B RX IQK\n")); /* modify RXIQK mode table */ /* 20121009, Kordan> RF Mode = 3 */ @@ -1048,12 +967,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regEA4 = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xeac = 0x%x\n", regEAC)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea4 = 0x%x, 0xeac = 0x%x\n", regEA4, regEAC)); - /* monitor image power before & after IQK */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0xea0(before IQK) = 0x%x, 0xea8(afer IQK) = 0x%x\n", - PHY_QueryBBReg(pDM_Odm->Adapter, 0xea0, bMaskDWord), PHY_QueryBBReg(pDM_Odm->Adapter, 0xea8, bMaskDWord))); - /* PA/PAD controlled by 0x0 */ /* leave IQK mode */ /* PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, 0xffffff00, 0x00000000); */ @@ -1076,7 +989,7 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) ) result |= 0x02; else - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Rx IQK fail!!\n")); + {} return result; } @@ -1096,8 +1009,6 @@ static void _PHY_PathAFillIQKMatrix8723B( struct odm_rf_cal_t *pRFCalibrateInfo = &pDM_Odm->RFCalibrateInfo; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A IQ Calibration %s !\n", (bIQKOK)?"Success":"Failed")); - if (final_candidate == 0xFF) return; @@ -1108,7 +1019,6 @@ static void _PHY_PathAFillIQKMatrix8723B( if ((X & 0x00000200) != 0) X = X | 0xFFFFFC00; TX0_A = (X * Oldval_0) >> 8; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("X = 0x%x, TX0_A = 0x%x, Oldval_0 0x%x\n", X, TX0_A, Oldval_0)); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XATxIQImbalance, 0x3FF, TX0_A); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, BIT(31), ((X*Oldval_0>>7) & 0x1)); @@ -1119,7 +1029,6 @@ static void _PHY_PathAFillIQKMatrix8723B( /* 2 Tx IQC */ TX0_C = (Y * Oldval_0) >> 8; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Y = 0x%x, TX = 0x%x\n", Y, TX0_C)); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XCTxAFE, 0xF0000000, ((TX0_C&0x3C0)>>6)); pRFCalibrateInfo->TxIQC_8723B[PATH_S1][IDX_0xC94][KEY] = rOFDM0_XCTxAFE; pRFCalibrateInfo->TxIQC_8723B[PATH_S1][IDX_0xC94][VAL] = PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XCTxAFE, bMaskDWord); @@ -1133,8 +1042,6 @@ static void _PHY_PathAFillIQKMatrix8723B( pRFCalibrateInfo->TxIQC_8723B[PATH_S1][IDX_0xC4C][VAL] = PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskDWord); if (bTxOnly) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("_PHY_PathAFillIQKMatrix8723B only Tx OK\n")); - /* <20130226, Kordan> Saving RxIQC, otherwise not initialized. */ pRFCalibrateInfo->RxIQC_8723B[PATH_S1][IDX_0xCA0][KEY] = rOFDM0_RxIQExtAnta; pRFCalibrateInfo->RxIQC_8723B[PATH_S1][IDX_0xCA0][VAL] = 0xfffffff & PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_RxIQExtAnta, bMaskDWord); @@ -1176,8 +1083,6 @@ static void _PHY_PathBFillIQKMatrix8723B( struct odm_rf_cal_t *pRFCalibrateInfo = &pDM_Odm->RFCalibrateInfo; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQ Calibration %s !\n", (bIQKOK)?"Success":"Failed")); - if (final_candidate == 0xFF) return; @@ -1188,7 +1093,6 @@ static void _PHY_PathBFillIQKMatrix8723B( if ((X & 0x00000200) != 0) X = X | 0xFFFFFC00; TX1_A = (X * Oldval_1) >> 8; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("X = 0x%x, TX1_A = 0x%x\n", X, TX1_A)); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XBTxIQImbalance, 0x3FF, TX1_A); @@ -1199,7 +1103,6 @@ static void _PHY_PathBFillIQKMatrix8723B( Y = Y | 0xFFFFFC00; TX1_C = (Y * Oldval_1) >> 8; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Y = 0x%x, TX1_C = 0x%x\n", Y, TX1_C)); /* 2 Tx IQC */ PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XDTxAFE, 0xF0000000, ((TX1_C&0x3C0)>>6)); @@ -1217,8 +1120,6 @@ static void _PHY_PathBFillIQKMatrix8723B( pRFCalibrateInfo->TxIQC_8723B[PATH_S0][IDX_0xC4C][VAL] = PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskDWord); if (bTxOnly) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("_PHY_PathBFillIQKMatrix8723B only Tx OK\n")); - pRFCalibrateInfo->RxIQC_8723B[PATH_S0][IDX_0xC14][KEY] = rOFDM0_XARxIQImbalance; /* pRFCalibrateInfo->RxIQC_8723B[PATH_S0][IDX_0xC14][VAL] = PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XARxIQImbalance, bMaskDWord); */ pRFCalibrateInfo->RxIQC_8723B[PATH_S0][IDX_0xC14][VAL] = 0x40000100; @@ -1297,7 +1198,6 @@ static void _PHY_SaveADDARegisters8723B( if (!ODM_CheckPowerStatus(padapter)) return; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Save ADDA parameters.\n")); for (i = 0 ; i < RegisterNum ; i++) { ADDABackup[i] = PHY_QueryBBReg(pDM_Odm->Adapter, ADDAReg[i], bMaskDWord); } @@ -1312,7 +1212,6 @@ static void _PHY_SaveMACRegisters8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Save MAC parameters.\n")); for (i = 0 ; i < (IQK_MAC_REG_NUM - 1); i++) { MACBackup[i] = rtw_read8(pDM_Odm->Adapter, MACReg[i]); } @@ -1332,7 +1231,6 @@ static void _PHY_ReloadADDARegisters8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Reload ADDA power saving parameters !\n")); for (i = 0 ; i < RegiesterNum; i++) { PHY_SetBBReg(pDM_Odm->Adapter, ADDAReg[i], bMaskDWord, ADDABackup[i]); } @@ -1362,8 +1260,6 @@ static void _PHY_PathADDAOn8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("ADDA ON.\n")); - pathOn = 0x01c00014; if (!is2T) { pathOn = 0x01c00014; @@ -1386,8 +1282,6 @@ static void _PHY_MACSettingCalibration8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("MAC settings for Calibration.\n")); - rtw_write8(pDM_Odm->Adapter, MACReg[i], 0x3F); for (i = 1 ; i < (IQK_MAC_REG_NUM - 1); i++) { @@ -1540,17 +1434,12 @@ static void phy_IQCalibrate_8723B( /* u32 bbvalue; */ if (t == 0) { -/* bbvalue = PHY_QueryBBReg(pDM_Odm->Adapter, rFPGA0_RFMOD, bMaskDWord); */ -/* RT_DISP(FINIT, INIT_IQK, ("phy_IQCalibrate_8188E() ==>0x%08x\n", bbvalue)); */ - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t)); /* Save ADDA parameters, turn Path A ADDA on */ _PHY_SaveADDARegisters8723B(padapter, ADDA_REG, pDM_Odm->RFCalibrateInfo.ADDA_backup, IQK_ADDA_REG_NUM); _PHY_SaveMACRegisters8723B(padapter, IQK_MAC_REG, pDM_Odm->RFCalibrateInfo.IQK_MAC_backup); _PHY_SaveADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM); } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQ Calibration for %s for %d times\n", (is2T ? "2T2R" : "1T1R"), t)); _PHY_PathADDAOn8723B(padapter, ADDA_REG, is2T); @@ -1596,7 +1485,6 @@ static void phy_IQCalibrate_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); pDM_Odm->RFCalibrateInfo.TxLOK[ODM_RF_PATH_A] = PHY_QueryRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, 0x8, bRFRegOffsetMask); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Tx IQK Success!!\n")); result[t][0] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16; result[t][1] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16; break; @@ -1607,19 +1495,16 @@ static void phy_IQCalibrate_8723B( for (i = 0 ; i < retryCount ; i++) { PathAOK = phy_PathA_RxIQK8723B(padapter, is2T, RF_Path); if (PathAOK == 0x03) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK Success!!\n")); /* result[t][0] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16; */ /* result[t][1] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16; */ result[t][2] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; result[t][3] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; break; } else { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK Fail!!\n")); } } if (0x00 == PathAOK) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A IQK failed!!\n")); } /* path B IQK */ @@ -1633,7 +1518,6 @@ static void phy_IQCalibrate_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); pDM_Odm->RFCalibrateInfo.TxLOK[ODM_RF_PATH_B] = PHY_QueryRFReg(pDM_Odm->Adapter, ODM_RF_PATH_B, 0x8, bRFRegOffsetMask); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Tx IQK Success!!\n")); result[t][4] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16; result[t][5] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16; break; @@ -1644,25 +1528,21 @@ static void phy_IQCalibrate_8723B( for (i = 0 ; i < retryCount ; i++) { PathBOK = phy_PathB_RxIQK8723B(padapter, is2T); if (PathBOK == 0x03) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Rx IQK Success!!\n")); /* result[t][0] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord)&0x3FF0000)>>16; */ /* result[t][1] = (PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_After_IQK_A, bMaskDWord)&0x3FF0000)>>16; */ result[t][6] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; result[t][7] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; break; } else { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Rx IQK Fail!!\n")); } } /* Allen end */ if (0x00 == PathBOK) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B IQK failed!!\n")); } } /* Back to BB mode, load original value */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:Back to BB mode, load original value!\n")); PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0); if (t != 0) { @@ -1692,7 +1572,6 @@ static void phy_IQCalibrate_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_Tone_A, bMaskDWord, 0x01008c00); } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("phy_IQCalibrate_8723B() <==\n")); } @@ -1868,12 +1747,10 @@ void PHY_IQCalibrate_8723B( } if (bReCovery) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("PHY_IQCalibrate_8723B: Return due to bReCovery!\n")); _PHY_ReloadADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); return; } StartTime = jiffies; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK:Start!!!\n")); /* save default GNT_BT */ GNT_BT_default = PHY_QueryBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord); @@ -1908,7 +1785,6 @@ void PHY_IQCalibrate_8723B( is12simular = phy_SimularityCompare_8723B(padapter, result, 0, 1); if (is12simular) { final_candidate = 0; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is12simular final_candidate is %x\n", final_candidate)); break; } } @@ -1917,7 +1793,6 @@ void PHY_IQCalibrate_8723B( is13simular = phy_SimularityCompare_8723B(padapter, result, 0, 2); if (is13simular) { final_candidate = 0; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is13simular final_candidate is %x\n", final_candidate)); break; } @@ -1925,7 +1800,6 @@ void PHY_IQCalibrate_8723B( is23simular = phy_SimularityCompare_8723B(padapter, result, 1, 2); if (is23simular) { final_candidate = 1; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: is23simular final_candidate is %x\n", final_candidate)); } else { for (i = 0; i < 8; i++) RegTmp += result[3][i]; @@ -1947,7 +1821,6 @@ void PHY_IQCalibrate_8723B( RegEBC = result[i][5]; RegEC4 = result[i][6]; RegECC = result[i][7]; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: RegE94 =%x RegE9C =%x RegEA4 =%x RegEAC =%x RegEB4 =%x RegEBC =%x RegEC4 =%x RegECC =%x\n ", RegE94, RegE9C, RegEA4, RegEAC, RegEB4, RegEBC, RegEC4, RegECC)); } if (final_candidate != 0xff) { @@ -1959,12 +1832,8 @@ void PHY_IQCalibrate_8723B( pDM_Odm->RFCalibrateInfo.RegEBC = RegEBC = result[final_candidate][5]; RegEC4 = result[final_candidate][6]; RegECC = result[final_candidate][7]; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: final_candidate is %x\n", final_candidate)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: RegE94 =%x RegE9C =%x RegEA4 =%x RegEAC =%x RegEB4 =%x RegEBC =%x RegEC4 =%x RegECC =%x\n ", RegE94, RegE9C, RegEA4, RegEAC, RegEB4, RegEBC, RegEC4, RegECC)); bPathAOK = bPathBOK = true; } else { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK: FAIL use default value\n")); - pDM_Odm->RFCalibrateInfo.RegE94 = pDM_Odm->RFCalibrateInfo.RegEB4 = 0x100; /* X default value */ pDM_Odm->RFCalibrateInfo.RegE9C = pDM_Odm->RFCalibrateInfo.RegEBC = 0x0; /* Y default value */ } @@ -1985,7 +1854,6 @@ void PHY_IQCalibrate_8723B( pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].Value[0][i] = result[final_candidate][i]; pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[0].bIQKDone = true; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("\nIQK OK Indexforchannel %d.\n", 0)); _PHY_SaveADDARegisters8723B(padapter, IQK_BB_REG_92C, pDM_Odm->RFCalibrateInfo.IQK_BB_backup_recover, 9); @@ -2016,9 +1884,7 @@ void PHY_IQCalibrate_8723B( pDM_Odm->RFCalibrateInfo.bIQKInProgress = false; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK finished\n")); ProgressingTime = jiffies_to_msecs(jiffies - StartTime); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("IQK ProgressingTime = %d\n", ProgressingTime)); } @@ -2056,7 +1922,5 @@ void PHY_LCCalibrate_8723B(struct dm_odm_t *pDM_Odm) pDM_Odm->RFCalibrateInfo.bLCKInProgress = false; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LCK:Finish!!!interface %d\n", pDM_Odm->InterfaceIndex)); ProgressingTime = jiffies_to_msecs(jiffies - StartTime); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LCK ProgressingTime = %d\n", ProgressingTime)); } diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c index 092b32c41ff3..a9f8d6a4a62c 100644 --- a/drivers/staging/rtl8723bs/hal/odm.c +++ b/drivers/staging/rtl8723bs/hal/odm.c @@ -323,32 +323,10 @@ static void odm_CommonInfoSelfUpdate(struct dm_odm_t *pDM_Odm) static void odm_CmnInfoInit_Debug(struct dm_odm_t *pDM_Odm) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_CmnInfoInit_Debug ==>\n")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportPlatform =%d\n", pDM_Odm->SupportPlatform)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportAbility = 0x%x\n", pDM_Odm->SupportAbility)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportInterface =%d\n", pDM_Odm->SupportInterface)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("SupportICType = 0x%x\n", pDM_Odm->SupportICType)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("CutVersion =%d\n", pDM_Odm->CutVersion)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("FabVersion =%d\n", pDM_Odm->FabVersion)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("RFType =%d\n", pDM_Odm->RFType)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("BoardType =%d\n", pDM_Odm->BoardType)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("ExtLNA =%d\n", pDM_Odm->ExtLNA)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("ExtPA =%d\n", pDM_Odm->ExtPA)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("ExtTRSW =%d\n", pDM_Odm->ExtTRSW)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("PatchID =%d\n", pDM_Odm->PatchID)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("bInHctTest =%d\n", pDM_Odm->bInHctTest)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("bWIFITest =%d\n", pDM_Odm->bWIFITest)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("bDualMacSmartConcurrent =%d\n", pDM_Odm->bDualMacSmartConcurrent)); - } static void odm_BasicDbgMessage(struct dm_odm_t *pDM_Odm) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_BasicDbgMsg ==>\n")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("bLinked = %d, RSSI_Min = %d,\n", - pDM_Odm->bLinked, pDM_Odm->RSSI_Min)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("RxRate = 0x%x, RSSI_A = %d, RSSI_B = %d\n", - pDM_Odm->RxRate, pDM_Odm->RSSI_A, pDM_Odm->RSSI_B)); } /* 3 ============================================================ */ @@ -482,9 +460,6 @@ u32 ODM_Get_Rate_Bitmap( break; } - /* printk("%s ==> rssi_level:0x%02x, WirelessMode:0x%02x, rate_bitmap:0x%08x\n", __func__, rssi_level, WirelessMode, rate_bitmap); */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, (" ==> rssi_level:0x%02x, WirelessMode:0x%02x, rate_bitmap:0x%08x\n", rssi_level, WirelessMode, rate_bitmap)); - return ra_mask & rate_bitmap; } @@ -495,12 +470,10 @@ static void odm_RefreshRateAdaptiveMaskCE(struct dm_odm_t *pDM_Odm) struct adapter *padapter = pDM_Odm->Adapter; if (padapter->bDriverStopped) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("<---- odm_RefreshRateAdaptiveMask(): driver is going to unload\n")); return; } if (!pDM_Odm->bUseRAMask) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("<---- odm_RefreshRateAdaptiveMask(): driver does not control rate adaptive mask\n")); return; } @@ -512,7 +485,6 @@ static void odm_RefreshRateAdaptiveMaskCE(struct dm_odm_t *pDM_Odm) continue; if (true == ODM_RAStateCheck(pDM_Odm, pstat->rssi_stat.UndecoratedSmoothedPWDB, false, &pstat->rssi_level)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.UndecoratedSmoothedPWDB, pstat->rssi_level)); /* printk("RSSI:%d, RSSI_LEVEL:%d\n", pstat->rssi_stat.UndecoratedSmoothedPWDB, pstat->rssi_level); */ rtw_hal_update_ra_mask(pstat, pstat->rssi_level); } @@ -541,9 +513,7 @@ static void odm_RefreshRateAdaptiveMaskCE(struct dm_odm_t *pDM_Odm) static void odm_RefreshRateAdaptiveMask(struct dm_odm_t *pDM_Odm) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("odm_RefreshRateAdaptiveMask()---------->\n")); if (!(pDM_Odm->SupportAbility & ODM_BB_RA_MASK)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_TRACE, ("odm_RefreshRateAdaptiveMask(): Return cos not supported\n")); return; } odm_RefreshRateAdaptiveMaskCE(pDM_Odm); @@ -596,7 +566,6 @@ bool ODM_RAStateCheck( /* printk("==>%s, RATRState:0x%02x , RSSI:%d\n", __func__, RATRState, RSSI); */ if (*pRATRState != RATRState || bForceUpdate) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_RA_MASK, ODM_DBG_LOUD, ("RSSI Level %d -> %d\n", *pRATRState, RATRState)); *pRATRState = RATRState; return true; } @@ -858,7 +827,6 @@ void ODM_DMWatchdog(struct dm_odm_t *pDM_Odm) odm_BasicDbgMessage(pDM_Odm); odm_FalseAlarmCounterStatistics(pDM_Odm); odm_NHMCounterStatistics(pDM_Odm); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): RSSI = 0x%x\n", pDM_Odm->RSSI_Min)); odm_RSSIMonitorCheck(pDM_Odm); @@ -872,8 +840,6 @@ void ODM_DMWatchdog(struct dm_odm_t *pDM_Odm) /* (pDM_Odm->SupportICType & (ODM_RTL8188E) &&(&&(((pDM_Odm->SupportInterface == ODM_ITRF_SDIO))) */ /* */ ) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("----Step1: odm_DIG is in LPS mode\n")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("---Step2: 8723AS is in LPS mode\n")); odm_DIGbyRSSI_LPS(pDM_Odm); } else odm_DIG(pDM_Odm); diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c index 75471c6c168e..0f6b9d661e39 100644 --- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c +++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c @@ -25,16 +25,6 @@ static void odm_SetCrystalCap(void *pDM_VOID, u8 CrystalCap) 0x00FFF000, (CrystalCap | (CrystalCap << 6)) ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "odm_SetCrystalCap(): CrystalCap = 0x%x\n", - CrystalCap - ) - ); } static u8 odm_GetDefaultCrytaltalCap(void *pDM_VOID) @@ -98,22 +88,6 @@ void ODM_CfoTrackingInit(void *pDM_VOID) pCfoTrack->CrystalCap = odm_GetDefaultCrytaltalCap(pDM_Odm); pCfoTrack->bATCStatus = odm_GetATCStatus(pDM_Odm); pCfoTrack->bAdjust = true; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking_init() =========>\n") - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking_init(): bATCStatus = %d, CrystalCap = 0x%x\n", - pCfoTrack->bATCStatus, - pCfoTrack->DefXCap - ) - ); } void ODM_CfoTracking(void *pDM_VOID) @@ -127,47 +101,16 @@ void ODM_CfoTracking(void *pDM_VOID) /* 4 Support ability */ if (!(pDM_Odm->SupportAbility & ODM_BB_CFO_TRACKING)) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking(): Return: SupportAbility ODM_BB_CFO_TRACKING is disabled\n") - ); return; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking() =========>\n") - ); - if (!pDM_Odm->bLinked || !pDM_Odm->bOneEntryOnly) { /* 4 No link or more than one entry */ ODM_CfoTrackingReset(pDM_Odm); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): Reset: bLinked = %d, bOneEntryOnly = %d\n", - pDM_Odm->bLinked, - pDM_Odm->bOneEntryOnly - ) - ); } else { /* 3 1. CFO Tracking */ /* 4 1.1 No new packet */ if (pCfoTrack->packetCount == pCfoTrack->packetCount_pre) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): packet counter doesn't change\n" - ) - ); return; } pCfoTrack->packetCount_pre = pCfoTrack->packetCount; @@ -180,17 +123,6 @@ void ODM_CfoTracking(void *pDM_VOID) CFO_ave = CFO_kHz_A; else CFO_ave = (int)(CFO_kHz_A + CFO_kHz_B) >> 1; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): CFO_kHz_A = %dkHz, CFO_kHz_B = %dkHz, CFO_ave = %dkHz\n", - CFO_kHz_A, - CFO_kHz_B, - CFO_ave - ) - ); /* 4 1.3 Avoid abnormal large CFO */ CFO_ave_diff = @@ -203,7 +135,6 @@ void ODM_CfoTracking(void *pDM_VOID) pCfoTrack->largeCFOHit == 0 && !pCfoTrack->bAdjust ) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_CFO_TRACKING, ODM_DBG_LOUD, ("ODM_CfoTracking(): first large CFO hit\n")); pCfoTrack->largeCFOHit = 1; return; } else @@ -223,12 +154,6 @@ void ODM_CfoTracking(void *pDM_VOID) if (pDM_Odm->bBtEnabled) { pCfoTrack->bAdjust = false; odm_SetCrystalCap(pDM_Odm, pCfoTrack->DefXCap); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking(): Disable CFO tracking for BT!!\n") - ); } /* 4 1.6 Big jump */ @@ -237,16 +162,6 @@ void ODM_CfoTracking(void *pDM_VOID) Adjust_Xtal = Adjust_Xtal+((CFO_ave-CFO_TH_XTAL_LOW)>>2); else if (CFO_ave < (-CFO_TH_XTAL_LOW)) Adjust_Xtal = Adjust_Xtal+((CFO_TH_XTAL_LOW-CFO_ave)>>2); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): Crystal cap offset = %d\n", - Adjust_Xtal - ) - ); } /* 4 1.7 Adjust Crystal Cap. */ @@ -263,34 +178,12 @@ void ODM_CfoTracking(void *pDM_VOID) odm_SetCrystalCap(pDM_Odm, (u8)CrystalCap); } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ( - "ODM_CfoTracking(): Crystal cap = 0x%x, Default Crystal cap = 0x%x\n", - pCfoTrack->CrystalCap, - pCfoTrack->DefXCap - ) - ); /* 3 2. Dynamic ATC switch */ if (CFO_ave < CFO_TH_ATC && CFO_ave > -CFO_TH_ATC) { odm_SetATCStatus(pDM_Odm, false); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking(): Disable ATC!!\n") - ); } else { odm_SetATCStatus(pDM_Odm, true); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CFO_TRACKING, - ODM_DBG_LOUD, - ("ODM_CfoTracking(): Enable ATC!!\n") - ); } } } diff --git a/drivers/staging/rtl8723bs/hal/odm_DIG.c b/drivers/staging/rtl8723bs/hal/odm_DIG.c index dcef7fb17389..4bb558426427 100644 --- a/drivers/staging/rtl8723bs/hal/odm_DIG.c +++ b/drivers/staging/rtl8723bs/hal/odm_DIG.c @@ -81,17 +81,6 @@ void odm_NHMBB(void *pDM_VOID) *(pDM_Odm->pNumTxBytesUnicast); pDM_Odm->NHMLastRxOkcnt = *(pDM_Odm->pNumRxBytesUnicast); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "NHM_cnt_0 =%d, NHMCurTxOkcnt = %llu, NHMCurRxOkcnt = %llu\n", - pDM_Odm->NHM_cnt_0, - pDM_Odm->NHMCurTxOkcnt, - pDM_Odm->NHMCurRxOkcnt - ) - ); if ((pDM_Odm->NHMCurTxOkcnt) + 1 > (u64)(pDM_Odm->NHMCurRxOkcnt<<2) + 1) { /* Tx > 4*Rx possible for adaptivity test */ @@ -127,8 +116,6 @@ void odm_NHMBB(void *pDM_VOID) } } } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("adaptivity_flag = %d\n ", pDM_Odm->adaptivity_flag)); } void odm_SearchPwdBLowerBound(void *pDM_VOID, u8 IGI_target) @@ -199,8 +186,6 @@ void odm_SearchPwdBLowerBound(void *pDM_VOID, u8 IGI_target) pDM_Odm->Adaptivity_IGI_upper = IGI; } } - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("IGI = 0x%x, H2L_lb = 0x%x, L2H_lb = 0x%x\n", IGI, pDM_Odm->H2L_lb, pDM_Odm->L2H_lb)); } void odm_AdaptivityInit(void *pDM_VOID) @@ -239,12 +224,8 @@ void odm_Adaptivity(void *pDM_VOID, u8 IGI) bool EDCCA_State = false; if (!(pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("Go to odm_DynamicEDCCA()\n")); return; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_Adaptivity() =====>\n")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("ForceEDCCA =%d, IGI_Base = 0x%x, TH_L2H_ini = %d, TH_EDCCA_HL_diff = %d, AdapEn_RSSI = %d\n", - pDM_Odm->ForceEDCCA, pDM_Odm->IGI_Base, pDM_Odm->TH_L2H_ini, pDM_Odm->TH_EDCCA_HL_diff, pDM_Odm->AdapEn_RSSI)); if (*pDM_Odm->pBandWidth == ODM_BW20M) /* CHANNEL_WIDTH_20 */ IGI_target = pDM_Odm->IGI_Base; @@ -284,19 +265,6 @@ void odm_Adaptivity(void *pDM_VOID, u8 IGI) ) odm_NHMBB(pDM_Odm); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "BandWidth =%s, IGI_target = 0x%x, EDCCA_State =%d\n", - (*pDM_Odm->pBandWidth == ODM_BW80M) ? "80M" : - ((*pDM_Odm->pBandWidth == ODM_BW40M) ? "40M" : "20M"), - IGI_target, - EDCCA_State - ) - ); - if (EDCCA_State) { Diff = IGI_target-(s8)IGI; TH_L2H_dmc = pDM_Odm->TH_L2H_ini + Diff; @@ -314,8 +282,6 @@ void odm_Adaptivity(void *pDM_VOID, u8 IGI) TH_L2H_dmc = 0x7f; TH_H2L_dmc = 0x7f; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("IGI = 0x%x, TH_L2H_dmc = %d, TH_H2L_dmc = %d\n", - IGI, TH_L2H_dmc, TH_H2L_dmc)); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskByte0, (u8)TH_L2H_dmc); PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_ECCAThreshold, bMaskByte2, (u8)TH_H2L_dmc); } @@ -326,18 +292,13 @@ void ODM_Write_DIG(void *pDM_VOID, u8 CurrentIGI) struct dig_t *pDM_DigTable = &pDM_Odm->DM_DigTable; if (pDM_DigTable->bStopDIG) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("Stop Writing IGI\n")); return; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_TRACE, ("ODM_REG(IGI_A, pDM_Odm) = 0x%x, ODM_BIT(IGI, pDM_Odm) = 0x%x\n", - ODM_REG(IGI_A, pDM_Odm), ODM_BIT(IGI, pDM_Odm))); - if (pDM_DigTable->CurIGValue != CurrentIGI) { /* 1 Check initial gain by upper bound */ if (!pDM_DigTable->bPSDInProgress) { if (CurrentIGI > pDM_DigTable->rx_gain_range_max) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_TRACE, ("CurrentIGI(0x%02x) is larger than upper bound !!\n", pDM_DigTable->rx_gain_range_max)); CurrentIGI = pDM_DigTable->rx_gain_range_max; } @@ -352,8 +313,6 @@ void ODM_Write_DIG(void *pDM_VOID, u8 CurrentIGI) pDM_DigTable->CurIGValue = CurrentIGI; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_TRACE, ("CurrentIGI(0x%02x).\n", CurrentIGI)); - } void odm_PauseDIG( @@ -366,18 +325,10 @@ void odm_PauseDIG( struct dig_t *pDM_DigTable = &pDM_Odm->DM_DigTable; static bool bPaused; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG() =========>\n")); - if ( (pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY) && pDM_Odm->TxHangFlg == true ) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_PauseDIG(): Dynamic adjust threshold in progress !!\n") - ); return; } @@ -385,12 +336,6 @@ void odm_PauseDIG( !bPaused && (!(pDM_Odm->SupportAbility & ODM_BB_DIG) || !(pDM_Odm->SupportAbility & ODM_BB_FA_CNT)) ){ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_PauseDIG(): Return: SupportAbility ODM_BB_DIG or ODM_BB_FA_CNT is disabled\n") - ); return; } @@ -399,18 +344,15 @@ void odm_PauseDIG( case ODM_PAUSE_DIG: /* 2 Disable DIG */ ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_ABILITY, pDM_Odm->SupportAbility & (~ODM_BB_DIG)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Pause DIG !!\n")); /* 2 Backup IGI value */ if (!bPaused) { pDM_DigTable->IGIBackup = pDM_DigTable->CurIGValue; bPaused = true; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Backup IGI = 0x%x\n", pDM_DigTable->IGIBackup)); /* 2 Write new IGI value */ ODM_Write_DIG(pDM_Odm, IGIValue); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Write new IGI = 0x%x\n", IGIValue)); break; /* 1 Resume DIG */ @@ -419,16 +361,13 @@ void odm_PauseDIG( /* 2 Write backup IGI value */ ODM_Write_DIG(pDM_Odm, pDM_DigTable->IGIBackup); bPaused = false; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Write original IGI = 0x%x\n", pDM_DigTable->IGIBackup)); /* 2 Enable DIG */ ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_ABILITY, pDM_Odm->SupportAbility | ODM_BB_DIG); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Resume DIG !!\n")); } break; default: - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG(): Wrong type !!\n")); break; } } @@ -439,25 +378,21 @@ bool odm_DigAbort(void *pDM_VOID) /* SupportAbility */ if (!(pDM_Odm->SupportAbility & ODM_BB_FA_CNT)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: SupportAbility ODM_BB_FA_CNT is disabled\n")); return true; } /* SupportAbility */ if (!(pDM_Odm->SupportAbility & ODM_BB_DIG)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: SupportAbility ODM_BB_DIG is disabled\n")); return true; } /* ScanInProcess */ if (*(pDM_Odm->pbScanInProcess)) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: In Scan Progress\n")); return true; } /* add by Neil Chen to avoid PSD is processing */ if (pDM_Odm->bDMInitialGainEnable == false) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Return: PSD is Processing\n")); return true; } @@ -523,8 +458,6 @@ void odm_DIG(void *pDM_VOID) if (odm_DigAbort(pDM_Odm)) return; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG() ===========================>\n\n")); - if (pDM_Odm->adaptivity_flag == true) Adap_IGI_Upper = pDM_Odm->Adaptivity_IGI_upper; @@ -540,15 +473,12 @@ void odm_DIG(void *pDM_VOID) dm_dig_min = DM_DIG_MIN_NIC; DIG_MaxOfMin = DM_DIG_MAX_AP; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Absolutely upper bound = 0x%x, lower bound = 0x%x\n", dm_dig_max, dm_dig_min)); - /* 1 Adjust boundary by RSSI */ if (pDM_Odm->bLinked && bPerformance) { /* 2 Modify DIG upper bound */ /* 4 Modify DIG upper bound for 92E, 8723A\B, 8821 & 8812 BT */ if (pDM_Odm->bBtLimitedDig == 1) { offset = 10; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Coex. case: Force upper bound to RSSI + %d !!!!!!\n", offset)); } else offset = 15; @@ -586,49 +516,9 @@ void odm_DIG(void *pDM_VOID) DIG_Dynamic_MIN = DIG_MaxOfMin; else DIG_Dynamic_MIN = (u8) pDM_DigTable->AntDiv_RSSI_max; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_ANT_DIV, - ODM_DBG_LOUD, - ( - "odm_DIG(): Antenna diversity case: Force lower bound to 0x%x !!!!!!\n", - DIG_Dynamic_MIN - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_ANT_DIV, - ODM_DBG_LOUD, - ( - "odm_DIG(): Antenna diversity case: RSSI_max = 0x%x !!!!!!\n", - pDM_DigTable->AntDiv_RSSI_max - ) - ); } } } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Adjust boundary by RSSI Upper bound = 0x%x, Lower bound = 0x%x\n", - pDM_DigTable->rx_gain_range_max, - DIG_Dynamic_MIN - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Link status: bLinked = %d, RSSI = %d, bFirstConnect = %d, bFirsrDisConnect = %d\n\n", - pDM_Odm->bLinked, - pDM_Odm->RSSI_Min, - FirstConnect, - FirstDisConnect - ) - ); /* 1 Modify DIG lower bound, deal with abnormal case */ /* 2 Abnormal false alarm case */ @@ -645,47 +535,20 @@ void odm_DIG(void *pDM_VOID) pDM_Odm->bsta_state ) { pDM_DigTable->rx_gain_range_min = dm_dig_min; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Abnormal #beacon (%d) case in STA mode: Force lower bound to 0x%x !!!!!!\n\n", - pDM_Odm->PhyDbgInfo.NumQryBeaconPkt, - pDM_DigTable->rx_gain_range_min - ) - ); } } /* 2 Abnormal lower bound case */ if (pDM_DigTable->rx_gain_range_min > pDM_DigTable->rx_gain_range_max) { pDM_DigTable->rx_gain_range_min = pDM_DigTable->rx_gain_range_max; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Abnormal lower bound case: Force lower bound to 0x%x !!!!!!\n\n", - pDM_DigTable->rx_gain_range_min - ) - ); } /* 1 False alarm threshold decision */ odm_FAThresholdCheck(pDM_Odm, bDFSBand, bPerformance, RxTp, TxTp, dm_FA_thres); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): False alarm threshold = %d, %d, %d\n\n", dm_FA_thres[0], dm_FA_thres[1], dm_FA_thres[2])); /* 1 Adjust initial gain by false alarm */ if (pDM_Odm->bLinked && bPerformance) { - /* 2 After link */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIG(): Adjust IGI after link\n") - ); if (bFirstTpTarget || (FirstConnect && bPerformance)) { pDM_DigTable->LargeFAHit = 0; @@ -698,16 +561,6 @@ void odm_DIG(void *pDM_VOID) CurrentIGI = DIG_MaxOfMin; } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): First connect case: IGI does on-shot to 0x%x\n", - CurrentIGI - ) - ); - } else { if (pFalseAlmCnt->Cnt_all > dm_FA_thres[2]) CurrentIGI = CurrentIGI + 4; @@ -722,35 +575,12 @@ void odm_DIG(void *pDM_VOID) (pDM_Odm->bsta_state) ) { CurrentIGI = pDM_DigTable->rx_gain_range_min; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): Abnormal #beacon (%d) case: IGI does one-shot to 0x%x\n", - pDM_Odm->PhyDbgInfo.NumQryBeaconPkt, - CurrentIGI - ) - ); } } } else { - /* 2 Before link */ - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIG(): Adjust IGI before link\n") - ); if (FirstDisConnect || bFirstCoverage) { CurrentIGI = dm_dig_min; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIG(): First disconnect case: IGI does on-shot to lower bound\n") - ); } else { if (pFalseAlmCnt->Cnt_all > dm_FA_thres[2]) CurrentIGI = CurrentIGI + 4; @@ -768,17 +598,6 @@ void odm_DIG(void *pDM_VOID) if (CurrentIGI > pDM_DigTable->rx_gain_range_max) CurrentIGI = pDM_DigTable->rx_gain_range_max; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ( - "odm_DIG(): CurIGValue = 0x%x, TotalFA = %d\n\n", - CurrentIGI, - pFalseAlmCnt->Cnt_all - ) - ); - /* 1 Force upper bound and lower bound for adaptivity */ if ( pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY && @@ -791,8 +610,6 @@ void odm_DIG(void *pDM_VOID) if (CurrentIGI < pDM_Odm->IGI_LowerBound) CurrentIGI = pDM_Odm->IGI_LowerBound; } - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Adaptivity case: Force upper bound to 0x%x !!!!!!\n", Adap_IGI_Upper)); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Adaptivity case: Force lower bound to 0x%x !!!!!!\n\n", pDM_Odm->IGI_LowerBound)); } @@ -831,13 +648,6 @@ void odm_DIGbyRSSI_LPS(void *pDM_VOID) CurrentIGI = CurrentIGI+RSSI_OFFSET_DIG; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIGbyRSSI_LPS() ==>\n") - ); - /* Using FW PS mode to make IGI */ /* Adjust by FA in LPS MODE */ if (pFalseAlmCnt->Cnt_all > DM_DIG_FA_TH2_LPS) @@ -862,26 +672,6 @@ void odm_DIGbyRSSI_LPS(void *pDM_VOID) else if (CurrentIGI < RSSI_Lower) CurrentIGI = RSSI_Lower; - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIGbyRSSI_LPS(): pFalseAlmCnt->Cnt_all = %d\n", pFalseAlmCnt->Cnt_all) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIGbyRSSI_LPS(): pDM_Odm->RSSI_Min = %d\n", pDM_Odm->RSSI_Min) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_DIG, - ODM_DBG_LOUD, - ("odm_DIGbyRSSI_LPS(): CurrentIGI = 0x%x\n", CurrentIGI) - ); - ODM_Write_DIG(pDM_Odm, CurrentIGI); /* ODM_Write_DIG(pDM_Odm, pDM_DigTable->CurIGValue); */ } @@ -970,86 +760,6 @@ void odm_FalseAlarmCounterStatistics(void *pDM_VOID) FalseAlmCnt->Cnt_CCA_all = FalseAlmCnt->Cnt_OFDM_CCA + FalseAlmCnt->Cnt_CCK_CCA; - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Enter odm_FalseAlarmCounterStatistics\n") - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ( - "Cnt_Fast_Fsync =%d, Cnt_SB_Search_fail =%d\n", - FalseAlmCnt->Cnt_Fast_Fsync, - FalseAlmCnt->Cnt_SB_Search_fail - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ( - "Cnt_Parity_Fail =%d, Cnt_Rate_Illegal =%d\n", - FalseAlmCnt->Cnt_Parity_Fail, - FalseAlmCnt->Cnt_Rate_Illegal - ) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ( - "Cnt_Crc8_fail =%d, Cnt_Mcs_fail =%d\n", - FalseAlmCnt->Cnt_Crc8_fail, - FalseAlmCnt->Cnt_Mcs_fail - ) - ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_OFDM_CCA =%d\n", FalseAlmCnt->Cnt_OFDM_CCA) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_CCK_CCA =%d\n", FalseAlmCnt->Cnt_CCK_CCA) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_CCA_all =%d\n", FalseAlmCnt->Cnt_CCA_all) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_Ofdm_fail =%d\n", FalseAlmCnt->Cnt_Ofdm_fail) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_Cck_fail =%d\n", FalseAlmCnt->Cnt_Cck_fail) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Cnt_Ofdm_fail =%d\n", FalseAlmCnt->Cnt_Ofdm_fail) - ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_FA_CNT, - ODM_DBG_LOUD, - ("Total False Alarm =%d\n", FalseAlmCnt->Cnt_all) - ); } @@ -1084,8 +794,6 @@ u8 odm_ForbiddenIGICheck(void *pDM_VOID, u8 DIG_Dynamic_MIN, u8 CurrentIGI) u8 rx_gain_range_min = pDM_DigTable->rx_gain_range_min; if (pFalseAlmCnt->Cnt_all > 10000) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Abnormally false alarm case.\n")); - if (pDM_DigTable->LargeFAHit != 3) pDM_DigTable->LargeFAHit++; @@ -1102,22 +810,18 @@ u8 odm_ForbiddenIGICheck(void *pDM_VOID, u8 DIG_Dynamic_MIN, u8 CurrentIGI) else rx_gain_range_min = (pDM_DigTable->ForbiddenIGI + 2); pDM_DigTable->Recover_cnt = 1800; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Abnormally false alarm case: Recover_cnt = %d\n", pDM_DigTable->Recover_cnt)); } } else { if (pDM_DigTable->Recover_cnt != 0) { pDM_DigTable->Recover_cnt--; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: Recover_cnt = %d\n", pDM_DigTable->Recover_cnt)); } else { if (pDM_DigTable->LargeFAHit < 3) { if ((pDM_DigTable->ForbiddenIGI - 2) < DIG_Dynamic_MIN) { /* DM_DIG_MIN) */ pDM_DigTable->ForbiddenIGI = DIG_Dynamic_MIN; /* DM_DIG_MIN; */ rx_gain_range_min = DIG_Dynamic_MIN; /* DM_DIG_MIN; */ - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: At Lower Bound\n")); } else { pDM_DigTable->ForbiddenIGI -= 2; rx_gain_range_min = (pDM_DigTable->ForbiddenIGI + 2); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_DIG(): Normal Case: Approach Lower Bound\n")); } } else pDM_DigTable->LargeFAHit = 0; @@ -1143,25 +847,12 @@ void odm_CCKPacketDetectionThresh(void *pDM_VOID) !(pDM_Odm->SupportAbility & ODM_BB_CCK_PD) || !(pDM_Odm->SupportAbility & ODM_BB_FA_CNT) ) { - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CCK_PD, - ODM_DBG_LOUD, - ("odm_CCKPacketDetectionThresh() return ==========\n") - ); return; } if (pDM_Odm->ExtLNA) return; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CCK_PD, - ODM_DBG_LOUD, - ("odm_CCKPacketDetectionThresh() ==========>\n") - ); - if (pDM_Odm->bLinked) { if (pDM_Odm->RSSI_Min > 25) CurCCK_CCAThres = 0xcd; @@ -1181,16 +872,6 @@ void odm_CCKPacketDetectionThresh(void *pDM_VOID) } ODM_Write_CCK_CCA_Thres(pDM_Odm, CurCCK_CCAThres); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_CCK_PD, - ODM_DBG_LOUD, - ( - "odm_CCKPacketDetectionThresh() CurCCK_CCAThres = 0x%x\n", - CurCCK_CCAThres - ) - ); } void ODM_Write_CCK_CCA_Thres(void *pDM_VOID, u8 CurCCK_CCAThres) diff --git a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c index 12b37c17ea0c..f3856e47bfd3 100644 --- a/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c +++ b/drivers/staging/rtl8723bs/hal/odm_EdcaTurboCheck.c @@ -37,19 +37,6 @@ void ODM_EdcaTurboInit(void *pDM_VOID) pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = false; pDM_Odm->DM_EDCA_Table.bIsCurRDLState = false; Adapter->recvpriv.bIsAnyNonBEPkts = false; - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("Original VO PARAM: 0x%x\n", - rtw_read32(pDM_Odm->Adapter, ODM_EDCA_VO_PARAM))); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("Original VI PARAM: 0x%x\n", - rtw_read32(pDM_Odm->Adapter, ODM_EDCA_VI_PARAM))); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("Original BE PARAM: 0x%x\n", - rtw_read32(pDM_Odm->Adapter, ODM_EDCA_BE_PARAM))); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("Original BK PARAM: 0x%x\n", - rtw_read32(pDM_Odm->Adapter, ODM_EDCA_BK_PARAM))); } /* ODM_InitEdcaTurbo */ void odm_EdcaTurboCheck(void *pDM_VOID) @@ -60,15 +47,10 @@ void odm_EdcaTurboCheck(void *pDM_VOID) */ struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("odm_EdcaTurboCheck ========================>\n")); - if (!(pDM_Odm->SupportAbility & ODM_MAC_EDCA_TURBO)) return; odm_EdcaTurboCheckCE(pDM_Odm); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_EDCA_TURBO, ODM_DBG_LOUD, - ("<========================odm_EdcaTurboCheck\n")); } /* odm_CheckEdcaTurbo */ void odm_EdcaTurboCheckCE(void *pDM_VOID) diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c index 638c16f5c668..c7010015b334 100644 --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c @@ -427,12 +427,6 @@ enum hal_status ODM_ConfigRFWithHeaderFile( enum odm_rf_radio_path_e eRFPath ) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("===>ODM_ConfigRFWithHeaderFile (%s)\n", (pDM_Odm->bIsMPChip) ? "MPChip" : "TestChip")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", - pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); - if (ConfigType == CONFIG_RF_RADIO) READ_AND_CONFIG(8723B, _RadioA); else if (ConfigType == CONFIG_RF_TXPWR_LMT) @@ -443,12 +437,6 @@ enum hal_status ODM_ConfigRFWithHeaderFile( enum hal_status ODM_ConfigRFWithTxPwrTrackHeaderFile(struct dm_odm_t *pDM_Odm) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("===>ODM_ConfigRFWithTxPwrTrackHeaderFile (%s)\n", (pDM_Odm->bIsMPChip) ? "MPChip" : "TestChip")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", - pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); - if (pDM_Odm->SupportInterface == ODM_ITRF_SDIO) READ_AND_CONFIG(8723B, _TxPowerTrack_SDIO); @@ -459,12 +447,6 @@ enum hal_status ODM_ConfigBBWithHeaderFile( struct dm_odm_t *pDM_Odm, enum ODM_BB_Config_Type ConfigType ) { - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("===>ODM_ConfigBBWithHeaderFile (%s)\n", (pDM_Odm->bIsMPChip) ? "MPChip" : "TestChip")); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, - ("pDM_Odm->SupportPlatform: 0x%X, pDM_Odm->SupportInterface: 0x%X, pDM_Odm->BoardType: 0x%X\n", - pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface, pDM_Odm->BoardType)); - if (ConfigType == CONFIG_BB_PHY_REG) READ_AND_CONFIG(8723B, _PHY_REG); else if (ConfigType == CONFIG_BB_AGC_TAB) diff --git a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c index 956e5a725a5d..ad169704f3e9 100644 --- a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c +++ b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c @@ -38,8 +38,6 @@ static s16 odm_InbandNoise_Monitor_NSeries( else max_rf_path = 1; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_DebugControlInbandNoise_Nseries() ==>\n")); - memset(&noise_data, 0, sizeof(struct noise_level)); /* */ @@ -64,7 +62,6 @@ static s16 odm_InbandNoise_Monitor_NSeries( /* Read Noise Floor Report */ tmp4b = PHY_QueryBBReg(pDM_Odm->Adapter, 0x8f8, bMaskDWord); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("Noise Floor Report (0x8f8) = 0x%08x\n", tmp4b)); /* PHY_SetBBReg(pDM_Odm->Adapter, rOFDM0_XAAGCCore1, bMaskByte0, TestInitialGain); */ /* if (max_rf_path == 2) */ @@ -76,17 +73,10 @@ static s16 odm_InbandNoise_Monitor_NSeries( noise_data.value[ODM_RF_PATH_A] = (u8)(tmp4b&0xff); noise_data.value[ODM_RF_PATH_B] = (u8)((tmp4b&0xff00)>>8); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("value_a = 0x%x(%d), value_b = 0x%x(%d)\n", - noise_data.value[ODM_RF_PATH_A], noise_data.value[ODM_RF_PATH_A], noise_data.value[ODM_RF_PATH_B], noise_data.value[ODM_RF_PATH_B])); - for (rf_path = ODM_RF_PATH_A; rf_path < max_rf_path; rf_path++) { noise_data.sval[rf_path] = (s8)noise_data.value[rf_path]; noise_data.sval[rf_path] /= 2; } - - - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("sval_a = %d, sval_b = %d\n", - noise_data.sval[ODM_RF_PATH_A], noise_data.sval[ODM_RF_PATH_B])); /* mdelay(10); */ /* msleep(10); */ @@ -94,11 +84,8 @@ static s16 odm_InbandNoise_Monitor_NSeries( if ((noise_data.valid_cnt[rf_path] < ValidCnt) && (noise_data.sval[rf_path] < Valid_Max && noise_data.sval[rf_path] >= Valid_Min)) { noise_data.valid_cnt[rf_path]++; noise_data.sum[rf_path] += noise_data.sval[rf_path]; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("RF_Path:%d Valid sval = %d\n", rf_path, noise_data.sval[rf_path])); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("Sum of sval = %d,\n", noise_data.sum[rf_path])); if (noise_data.valid_cnt[rf_path] == ValidCnt) { valid_done++; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("After divided, RF_Path:%d , sum = %d\n", rf_path, noise_data.sum[rf_path])); } } @@ -119,37 +106,23 @@ static s16 odm_InbandNoise_Monitor_NSeries( } reg_c50 = (s32)PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XAAGCCore1, bMaskByte0); reg_c50 &= ~BIT7; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("0x%x = 0x%02x(%d)\n", rOFDM0_XAAGCCore1, reg_c50, reg_c50)); pDM_Odm->noise_level.noise[ODM_RF_PATH_A] = -110 + reg_c50 + noise_data.sum[ODM_RF_PATH_A]; pDM_Odm->noise_level.noise_all += pDM_Odm->noise_level.noise[ODM_RF_PATH_A]; if (max_rf_path == 2) { reg_c58 = (s32)PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XBAGCCore1, bMaskByte0); reg_c58 &= ~BIT7; - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("0x%x = 0x%02x(%d)\n", rOFDM0_XBAGCCore1, reg_c58, reg_c58)); pDM_Odm->noise_level.noise[ODM_RF_PATH_B] = -110 + reg_c58 + noise_data.sum[ODM_RF_PATH_B]; pDM_Odm->noise_level.noise_all += pDM_Odm->noise_level.noise[ODM_RF_PATH_B]; } pDM_Odm->noise_level.noise_all /= max_rf_path; - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_COMMON, - ODM_DBG_LOUD, - ( - "noise_a = %d, noise_b = %d\n", - pDM_Odm->noise_level.noise[ODM_RF_PATH_A], - pDM_Odm->noise_level.noise[ODM_RF_PATH_B] - ) - ); - /* */ /* Step 4. Recover the Dig */ /* */ if (bPauseDIG) odm_PauseDIG(pDM_Odm, ODM_RESUME_DIG, IGIValue); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_DebugControlInbandNoise_Nseries() <==\n")); return pDM_Odm->noise_level.noise_all; } diff --git a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c b/drivers/staging/rtl8723bs/hal/odm_PathDiv.c index 92b708265d47..cfcbc3741803 100644 --- a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c +++ b/drivers/staging/rtl8723bs/hal/odm_PathDiv.c @@ -12,12 +12,7 @@ void odm_PathDiversityInit(void *pDM_VOID) struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; if (!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_PATH_DIV, - ODM_DBG_LOUD, - ("Return: Not Support PathDiv\n") - ); + {} } void odm_PathDiversity(void *pDM_VOID) @@ -25,10 +20,5 @@ void odm_PathDiversity(void *pDM_VOID) struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; if (!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_PATH_DIV, - ODM_DBG_LOUD, - ("Return: Not Support PathDiv\n") - ); + {} } diff --git a/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.c b/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.c index 63bf5ba3e0d5..b77c61598294 100644 --- a/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.c +++ b/drivers/staging/rtl8723bs/hal/odm_RegConfig8723B.c @@ -38,17 +38,6 @@ void odm_ConfigRFReg_8723B( PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH, RegAddr, bRFRegOffsetMask, Data); udelay(1); getvalue = PHY_QueryRFReg(pDM_Odm->Adapter, RF_PATH, Addr, bMaskDWord); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigRFWithHeaderFile: [B6] getvalue 0x%x, Data 0x%x, count %d\n", - getvalue, - Data, - count - ) - ); if (count > 5) break; } @@ -86,17 +75,6 @@ void odm_ConfigRFReg_8723B( getvalue = PHY_QueryRFReg( pDM_Odm->Adapter, RF_PATH, Addr, bMaskDWord ); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigRFWithHeaderFile: [B2] getvalue 0x%x, Data 0x%x, count %d\n", - getvalue, - Data, - count - ) - ); if (count > 5) break; @@ -118,32 +96,11 @@ void odm_ConfigRF_RadioA_8723B(struct dm_odm_t *pDM_Odm, u32 Addr, u32 Data) ODM_RF_PATH_A, Addr|maskforPhySet ); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", - Addr, - Data - ) - ); } void odm_ConfigMAC_8723B(struct dm_odm_t *pDM_Odm, u32 Addr, u8 Data) { rtw_write8(pDM_Odm->Adapter, Addr, Data); - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", - Addr, - Data - ) - ); } void odm_ConfigBB_AGC_8723B( @@ -156,17 +113,6 @@ void odm_ConfigBB_AGC_8723B( PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data); /* Add 1us delay between BB/RF register setting. */ udelay(1); - - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_TRACE, - ( - "===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n", - Addr, - Data - ) - ); } void odm_ConfigBB_PHY_REG_PG_8723B( @@ -184,17 +130,6 @@ void odm_ConfigBB_PHY_REG_PG_8723B( else { PHY_StoreTxPowerByRate(pDM_Odm->Adapter, Band, RfPath, TxNum, Addr, Bitmask, Data); } - ODM_RT_TRACE( - pDM_Odm, - ODM_COMP_INIT, - ODM_DBG_LOUD, - ( - "===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X %08X\n", - Addr, - Bitmask, - Data - ) - ); } void odm_ConfigBB_PHY_8723B( @@ -222,7 +157,6 @@ void odm_ConfigBB_PHY_8723B( /* Add 1us delay between BB/RF register setting. */ udelay(1); - ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X\n", Addr, Data)); } void odm_ConfigBB_TXPWR_LMT_8723B( From 7fa2973a1a6b5b2cec1250f341b02abc7df23f61 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:24 +0200 Subject: [PATCH 125/744] staging: rtl8723bs: remove if-else blocks left empty by ODM_RT_TRACE deletion remove if-else blocks left empty by ODM_RT_TRACE deletion. remove unused variables to suppress compiler warnings. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/0e1196ebf56787f62dcbfbcba1fcbc2ed37a65ce.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalPhyRf.c | 13 ------------- drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c | 9 +-------- drivers/staging/rtl8723bs/hal/odm_PathDiv.c | 8 -------- 3 files changed, 1 insertion(+), 29 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf.c b/drivers/staging/rtl8723bs/hal/HalPhyRf.c index 2e10817bf3dd..b8e385fdda89 100644 --- a/drivers/staging/rtl8723bs/hal/HalPhyRf.c +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf.c @@ -118,9 +118,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* 4 3. Initialize ThermalValues of RFCalibrateInfo */ - if (pDM_Odm->RFCalibrateInfo.bReloadtxpowerindex) - {} - /* 4 4. Calculate average thermal meter */ pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index] = ThermalValue; @@ -273,16 +270,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter) /* to increase TX power. Otherwise, EVM will be bad. */ /* */ /* 2012/04/25 MH Add for tx power tracking to set tx power in tx agc for 88E. */ - if (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue) { - if (c.RfPathCount > 1) - {} - - } else if (ThermalValue < pDM_Odm->RFCalibrateInfo.ThermalValue) { /* Low temperature */ - - if (c.RfPathCount > 1) - {} - - } if (ThermalValue > pHalData->EEPROMThermalMeter) { for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++) diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c index 471418f3f724..858aafc24931 100644 --- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c @@ -689,8 +689,7 @@ static u8 phy_PathA_RxIQK8723B( (tmp < 0xf) ) result |= 0x02; - else /* if Tx not OK, ignore Rx */ - {} + return result; } @@ -988,8 +987,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) (tmp < 0xf) ) result |= 0x02; - else - {} return result; } @@ -1500,7 +1497,6 @@ static void phy_IQCalibrate_8723B( result[t][2] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; result[t][3] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; break; - } else { } } @@ -1533,13 +1529,10 @@ static void phy_IQCalibrate_8723B( result[t][6] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; result[t][7] = (PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord)&0x3FF0000)>>16; break; - } else { } } /* Allen end */ - if (0x00 == PathBOK) { - } } /* Back to BB mode, load original value */ diff --git a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c b/drivers/staging/rtl8723bs/hal/odm_PathDiv.c index cfcbc3741803..bedce2c10b22 100644 --- a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c +++ b/drivers/staging/rtl8723bs/hal/odm_PathDiv.c @@ -9,16 +9,8 @@ void odm_PathDiversityInit(void *pDM_VOID) { - struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; - - if (!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) - {} } void odm_PathDiversity(void *pDM_VOID) { - struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; - - if (!(pDM_Odm->SupportAbility & ODM_BB_PATH_DIV)) - {} } From 2523c9978e0035e1d905ff7f7ae0831027559646 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:25 +0200 Subject: [PATCH 126/744] staging: rtl8723bs: remove empty functions remove functions left empty after ODM_RT_TRACE deletion. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2a0606394fec2cbb32df6ec0bf4b5974416195f6.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm.c | 4 ---- drivers/staging/rtl8723bs/hal/odm_PathDiv.c | 7 ------- 2 files changed, 11 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c index a9f8d6a4a62c..73068a1681a9 100644 --- a/drivers/staging/rtl8723bs/hal/odm.c +++ b/drivers/staging/rtl8723bs/hal/odm.c @@ -807,9 +807,6 @@ void ODM_DMInit(struct dm_odm_t *pDM_Odm) ODM_ClearTxPowerTrackingState(pDM_Odm); - if (*(pDM_Odm->mp_mode) != 1) - odm_PathDiversityInit(pDM_Odm); - odm_DynamicBBPowerSavingInit(pDM_Odm); odm_DynamicTxPowerInit(pDM_Odm); @@ -857,7 +854,6 @@ void ODM_DMWatchdog(struct dm_odm_t *pDM_Odm) odm_RefreshRateAdaptiveMask(pDM_Odm); odm_EdcaTurboCheck(pDM_Odm); - odm_PathDiversity(pDM_Odm); ODM_CfoTracking(pDM_Odm); ODM_TXPowerTrackingCheck(pDM_Odm); diff --git a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c b/drivers/staging/rtl8723bs/hal/odm_PathDiv.c index bedce2c10b22..1a2e367bb306 100644 --- a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c +++ b/drivers/staging/rtl8723bs/hal/odm_PathDiv.c @@ -7,10 +7,3 @@ #include "odm_precomp.h" -void odm_PathDiversityInit(void *pDM_VOID) -{ -} - -void odm_PathDiversity(void *pDM_VOID) -{ -} From 8b2a605a6e6e8da3b34f9bc6ea6a90b25a92ce1f Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:26 +0200 Subject: [PATCH 127/744] staging: rtl8723bs: remove empty hal/odm_PathDiv.c source file remove empty hal/odm_PathDiv.c source file. remove related target in Makefile. Reported-by: kernel test robot Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/90ebcf46a58375ae25d51638ae91fa40521c6c06.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/Makefile | 1 - drivers/staging/rtl8723bs/hal/odm_PathDiv.c | 9 --------- 2 files changed, 10 deletions(-) delete mode 100644 drivers/staging/rtl8723bs/hal/odm_PathDiv.c diff --git a/drivers/staging/rtl8723bs/Makefile b/drivers/staging/rtl8723bs/Makefile index dfe410283ca0..c40983496608 100644 --- a/drivers/staging/rtl8723bs/Makefile +++ b/drivers/staging/rtl8723bs/Makefile @@ -35,7 +35,6 @@ r8723bs-y = \ hal/odm_EdcaTurboCheck.o \ hal/odm_HWConfig.o \ hal/odm_NoiseMonitor.o \ - hal/odm_PathDiv.o \ hal/odm_RegConfig8723B.o \ hal/odm_RTL8723B.o \ hal/rtl8723b_cmd.o \ diff --git a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c b/drivers/staging/rtl8723bs/hal/odm_PathDiv.c deleted file mode 100644 index 1a2e367bb306..000000000000 --- a/drivers/staging/rtl8723bs/hal/odm_PathDiv.c +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - ******************************************************************************/ - -#include "odm_precomp.h" - From 466bd365857df8aa71551d3e673c1b045507f42d Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:27 +0200 Subject: [PATCH 128/744] staging: rtl8723bs: remove undefined function prototypes remove undefined function prototypes. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/77c0c9027448be020a00e7ded9ffeb967341b588.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_PathDiv.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_PathDiv.h b/drivers/staging/rtl8723bs/hal/odm_PathDiv.h index 7a5bc00c3682..de69d5ea6ffd 100644 --- a/drivers/staging/rtl8723bs/hal/odm_PathDiv.h +++ b/drivers/staging/rtl8723bs/hal/odm_PathDiv.h @@ -8,14 +8,4 @@ #ifndef __ODMPATHDIV_H__ #define __ODMPATHDIV_H__ -void -odm_PathDiversityInit( - void *pDM_VOID - ); - -void -odm_PathDiversity( - void *pDM_VOID - ); - #endif /* ifndef __ODMPATHDIV_H__ */ From 7081d290d32be5db29395c802d5174b72b4182c0 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:28 +0200 Subject: [PATCH 129/744] staging: rtl8723bs: remove empty header file remove empty header file. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/5f38543b96f491cf9a11bb8cda17e5be754a3636.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm.h | 1 - drivers/staging/rtl8723bs/hal/odm_PathDiv.h | 11 ----------- drivers/staging/rtl8723bs/hal/odm_precomp.h | 1 - 3 files changed, 13 deletions(-) delete mode 100644 drivers/staging/rtl8723bs/hal/odm_PathDiv.h diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h index ff21343fbe0b..ba723ed7aa96 100644 --- a/drivers/staging/rtl8723bs/hal/odm.h +++ b/drivers/staging/rtl8723bs/hal/odm.h @@ -11,7 +11,6 @@ #include "odm_EdcaTurboCheck.h" #include "odm_DIG.h" -#include "odm_PathDiv.h" #include "odm_DynamicBBPowerSaving.h" #include "odm_DynamicTxPower.h" #include "odm_CfoTracking.h" diff --git a/drivers/staging/rtl8723bs/hal/odm_PathDiv.h b/drivers/staging/rtl8723bs/hal/odm_PathDiv.h deleted file mode 100644 index de69d5ea6ffd..000000000000 --- a/drivers/staging/rtl8723bs/hal/odm_PathDiv.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - ******************************************************************************/ - -#ifndef __ODMPATHDIV_H__ -#define __ODMPATHDIV_H__ - - #endif /* ifndef __ODMPATHDIV_H__ */ diff --git a/drivers/staging/rtl8723bs/hal/odm_precomp.h b/drivers/staging/rtl8723bs/hal/odm_precomp.h index d48d681472d5..440a549bffc7 100644 --- a/drivers/staging/rtl8723bs/hal/odm_precomp.h +++ b/drivers/staging/rtl8723bs/hal/odm_precomp.h @@ -31,7 +31,6 @@ #include "odm_RegDefine11N.h" #include "odm_EdcaTurboCheck.h" #include "odm_DIG.h" -#include "odm_PathDiv.h" #include "odm_DynamicBBPowerSaving.h" #include "odm_DynamicTxPower.h" #include "odm_CfoTracking.h" From 364787f9415057c29e81b8b758d72137cbf44ebb Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:29 +0200 Subject: [PATCH 130/744] staging: rtl8723bs: remove ODM_RT_TRACE* unused macro defs remove unused ODM_RT_TRACE* macro defs. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/f0feec848702a12594bb67acceb42f4be647088e.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index be0d4c49a747..09e8bfec7664 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -96,27 +96,6 @@ #endif #if DBG -#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)\ - do {\ - if (\ - (comp & pDM_Odm->DebugComponents) &&\ - (level <= pDM_Odm->DebugLevel ||\ - level == ODM_DBG_SERIOUS)\ - ) {\ - RT_PRINTK fmt;\ - } \ - } while (0) - -#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)\ - do {\ - if (\ - (comp & pDM_Odm->DebugComponents) &&\ - (level <= pDM_Odm->DebugLevel)\ - ) {\ - RT_PRINTK fmt;\ - } \ - } while (0) - #define ODM_RT_ASSERT(pDM_Odm, expr, fmt)\ do {\ if (!expr) {\ @@ -150,8 +129,6 @@ } \ } while (0) #else -#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) no_printk fmt -#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) no_printk fmt #define ODM_RT_ASSERT(pDM_Odm, expr, fmt) no_printk fmt #define ODM_dbg_enter() do {} while (0) #define ODM_dbg_exit() do {} while (0) From 9e517aca02cf10e9b55b4d785b0cdee21e090125 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:30 +0200 Subject: [PATCH 131/744] staging: rtl8723bs: remove all commented out ODM_RT_TRACE logs remove all commented out ODM_RT_TRACE logs. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/a98ce6637bb15de79997325a78672fc81c48cd6a.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8723bs/hal/HalPhyRf_8723B.c | 32 ------------------- drivers/staging/rtl8723bs/hal/odm.c | 3 -- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 1 - 3 files changed, 36 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c index 858aafc24931..c42fd36c88ef 100644 --- a/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c +++ b/drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c @@ -421,7 +421,6 @@ static u8 phy_PathA_IQK_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord, 0x01007c00); PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK, bMaskDWord, 0x01004800); /* path-A IQK setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A IQK setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK_Tone_A, bMaskDWord, 0x18008c1c); PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_Tone_A, bMaskDWord, 0x38008c1c); PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK_Tone_B, bMaskDWord, 0x38008c1c); @@ -433,7 +432,6 @@ static u8 phy_PathA_IQK_8723B( PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x00462911); /* enter IQK mode */ @@ -451,12 +449,10 @@ static u8 phy_PathA_IQK_8723B( PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path A LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path A LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_8723B)); */ /* PlatformStallExecution(IQK_DELAY_TIME_8723B*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -505,8 +501,6 @@ static u8 phy_PathA_RxIQK8723B( struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path A Rx IQK!\n")); */ - /* Save RF Path */ Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord); @@ -514,7 +508,6 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); /* 1 Get TXIMR setting */ /* modify RXIQK mode table */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table!\n")); */ PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_WE_LUT, 0x80000, 0x1); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x18000); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0001f); @@ -540,7 +533,6 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x0046a911); /* enter IQK mode */ @@ -558,12 +550,10 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path A LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path A LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_8723B)); */ /* PlatformStallExecution(IQK_DELAY_TIME_8723B*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -601,7 +591,6 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord, u4tmp); /* modify RXIQK mode table */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table 2!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_WE_LUT, 0x80000, 0x1); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x18000); @@ -631,7 +620,6 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x0046a8d1); /* enter IQK mode */ @@ -649,12 +637,10 @@ static u8 phy_PathA_RxIQK8723B( PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path A LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path A LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_88E)); */ /* PlatformStallExecution(IQK_DELAY_TIME_8723B*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -723,7 +709,6 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK, bMaskDWord, 0x01007c00); PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK, bMaskDWord, 0x01004800); /* path-A IQK setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-B IQK setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK_Tone_A, bMaskDWord, 0x18008c1c); PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_Tone_A, bMaskDWord, 0x38008c1c); PHY_SetBBReg(pDM_Odm->Adapter, rTx_IQK_Tone_B, bMaskDWord, 0x38008c1c); @@ -736,7 +721,6 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x00462911); /* enter IQK mode */ @@ -750,12 +734,10 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path B LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path B LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path B LOK & IQK.\n", IQK_DELAY_TIME_88E)); */ /* PlatformStallExecution(IQK_DELAY_TIME_88E*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -767,9 +749,6 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter) /* leave IQK mode */ PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000); -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("0x948 = 0x%x\n", PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord))); */ - - /* Check failed */ regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord); regE94 = PHY_QueryBBReg(pDM_Odm->Adapter, rTx_Power_Before_IQK_A, bMaskDWord); @@ -801,8 +780,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) struct hal_com_data *pHalData = GET_HAL_DATA(padapter); struct dm_odm_t *pDM_Odm = &pHalData->odmpriv; -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path B Rx IQK!\n")); */ - /* Save RF Path */ Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord); /* leave IQK mode */ @@ -811,7 +788,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) /* switch to path B */ PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280); /* modify RXIQK mode table */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Path-A Rx IQK modify RXIQK mode table!\n")); */ PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_WE_LUT, 0x80000, 0x1); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x18000); PHY_SetRFReg(pDM_Odm->Adapter, ODM_RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0001f); @@ -839,7 +815,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x0046a911); /* enter IQK mode */ @@ -853,13 +828,11 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path B TXIQK @ RXIQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path B LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_88E)); */ /* PlatformStallExecution(IQK_DELAY_TIME_88E*1000); */ mdelay(IQK_DELAY_TIME_8723B); @@ -878,10 +851,8 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) /* Allen 20131125 */ tmp = (regE9C & 0x03FF0000)>>16; -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("tmp1 = 0x%x\n", tmp)); */ if ((tmp & 0x200) > 0) tmp = 0x400 - tmp; -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("tmp2 = 0x%x\n", tmp)); */ if ( !(regEAC & BIT28) && @@ -931,7 +902,6 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) PHY_SetBBReg(pDM_Odm->Adapter, rRx_IQK_PI_B, bMaskDWord, 0x28110000); /* LO calibration setting */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("LO calibration setting!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Rsp, bMaskDWord, 0x0046a8d1); /* enter IQK mode */ @@ -945,12 +915,10 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB) PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800); /* One shot, path B LOK & IQK */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("One shot, path B LOK & IQK!\n")); */ PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf9000000); PHY_SetBBReg(pDM_Odm->Adapter, rIQK_AGC_Pts, bMaskDWord, 0xf8000000); /* delay x ms */ -/* ODM_RT_TRACE(pDM_Odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD, ("Delay %d ms for One shot, path A LOK & IQK.\n", IQK_DELAY_TIME_88E)); */ /* PlatformStallExecution(IQK_DELAY_TIME_88E*1000); */ mdelay(IQK_DELAY_TIME_8723B); diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c index 73068a1681a9..0027ce211619 100644 --- a/drivers/staging/rtl8723bs/hal/odm.c +++ b/drivers/staging/rtl8723bs/hal/odm.c @@ -600,11 +600,8 @@ static void FindMinimumRSSI(struct adapter *padapter) (pdmpriv->EntryMinUndecoratedSmoothedPWDB == 0) ) { pdmpriv->MinUndecoratedPWDBForDM = 0; - /* ODM_RT_TRACE(pDM_Odm, COMP_BB_POWERSAVING, DBG_LOUD, ("Not connected to any\n")); */ } else pdmpriv->MinUndecoratedPWDBForDM = pdmpriv->EntryMinUndecoratedSmoothedPWDB; - - /* ODM_RT_TRACE(pDM_Odm, COMP_DIG, DBG_LOUD, ("MinUndecoratedPWDBForDM =%d\n", pHalData->MinUndecoratedPWDBForDM)); */ } static void odm_RSSIMonitorCheckCE(struct dm_odm_t *pDM_Odm) diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c index c7010015b334..db703a3b1b25 100644 --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c @@ -186,7 +186,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( /* RT_DISP(FRX, RX_PHY_SS, ("PWDB_ALL =%d\n", PWDB_ALL)); */ pPhyInfo->rx_pwd_ba11 = PWDB_ALL; - /* ODM_RT_TRACE(pDM_Odm, ODM_COMP_RSSI_MONITOR, ODM_DBG_LOUD, ("ODM OFDM RSSI =%d\n", pPhyInfo->rx_pwd_ba11)); */ pPhyInfo->bt_rx_rssi_percentage = PWDB_ALL_BT; pPhyInfo->rx_power = rx_pwr_all; pPhyInfo->recv_signal_power = rx_pwr_all; From 57c73cb6fdbac1660c77ae1775c0f46276f64170 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:31 +0200 Subject: [PATCH 132/744] staging: rtl8723bs: replace ODM_RT_ASSERT with netdev_dbg() replace ODM_RT_ASSERT with netdev dbg. Marco ODM_RT_ASSERT wraps a raw prink and prints a message everytime second argument is false. This occurrence prints always, so replace it with netdev_dbg() Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/3f172aaefb84aaac639f1850c5eb45678578e393.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c index 0027ce211619..fcd3f97e7df5 100644 --- a/drivers/staging/rtl8723bs/hal/odm.c +++ b/drivers/staging/rtl8723bs/hal/odm.c @@ -552,7 +552,8 @@ bool ODM_RAStateCheck( break; default: - ODM_RT_ASSERT(pDM_Odm, false, ("wrong rssi level setting %d !", *pRATRState)); + netdev_dbg(pDM_Odm->Adapter->pnetdev, + "wrong rssi level setting %d !", *pRATRState); break; } From 7c87fd54d55259dba8cb13d078223ed52c4a288c Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:32 +0200 Subject: [PATCH 133/744] staging: rtl8723bs: remove unused ODM_RT_ASSERT macro remove unused ODM_RT_ASSERT macro declarations. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/4d9fd27f60d1ef4bf8384d411885d05c6d40768e.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index 09e8bfec7664..b4fc247242fe 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -96,20 +96,6 @@ #endif #if DBG -#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)\ - do {\ - if (!expr) {\ - DbgPrint("Assertion failed! %s at ......\n", #expr);\ - DbgPrint(\ - " ......%s,%s, line =%d\n",\ - __FILE__,\ - __func__,\ - __LINE__\ - );\ - RT_PRINTK fmt;\ - ASSERT(false);\ - } \ - } while (0) #define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __func__, str); } #define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)\ @@ -129,7 +115,6 @@ } \ } while (0) #else -#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) no_printk fmt #define ODM_dbg_enter() do {} while (0) #define ODM_dbg_exit() do {} while (0) #define ODM_dbg_trace(str) no_printk("%s", str) From 37066837974ed5a43f6ed4c743cdf98731940e36 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:33 +0200 Subject: [PATCH 134/744] staging: rtl8723bs: remove unused ODM_PRINT_ADDR macro remove unused ODM_PRINT_ADDR macro definitions. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/8f04c3b8b841efc4271d4a7ef71a95e04894d64a.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index b4fc247242fe..58de4d16335e 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -97,29 +97,10 @@ #if DBG #define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __func__, str); } - -#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)\ - do {\ - if (\ - (comp & pDM_Odm->DebugComponents) &&\ - (level <= pDM_Odm->DebugLevel)\ - ) {\ - int __i;\ - u8 *__ptr = (u8 *)ptr;\ - DbgPrint("[ODM] ");\ - DbgPrint(title_str);\ - DbgPrint(" ");\ - for (__i = 0; __i < 6; __i++)\ - DbgPrint("%02X%s", __ptr[__i], (__i == 5) ? "" : "-");\ - DbgPrint("\n");\ - } \ - } while (0) #else #define ODM_dbg_enter() do {} while (0) #define ODM_dbg_exit() do {} while (0) #define ODM_dbg_trace(str) no_printk("%s", str) -#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \ - no_printk("%s %p", title_str, ptr) #endif void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); From b5edd20dfef03bfdec1b449f4c619fb6abbb1a9e Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:34 +0200 Subject: [PATCH 135/744] staging: rtl8723bs: remove unused ODM_dbg_trace macro remove unused ODM_dbg_trace macro definitions. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/ed3cc3b2c0df4f3c3f691b353f181f7c22309dbd.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index 58de4d16335e..cd68c583699a 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -96,11 +96,9 @@ #endif #if DBG -#define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __func__, str); } #else #define ODM_dbg_enter() do {} while (0) #define ODM_dbg_exit() do {} while (0) -#define ODM_dbg_trace(str) no_printk("%s", str) #endif void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); From 187f0a97333c7949345cce12f37d7862811321f7 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:35 +0200 Subject: [PATCH 136/744] staging: rtl8723bs: remove unused ODM_dbg_enter remove unused ODM_dbg_enter macro definition. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/b52f307265b7662bc6a02eac56dec92b3613a58c.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index cd68c583699a..7c9a87fb8e51 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -97,7 +97,6 @@ #if DBG #else -#define ODM_dbg_enter() do {} while (0) #define ODM_dbg_exit() do {} while (0) #endif From a8a21160c2c49f2fc3a4112b5dd61a5a60e4723b Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:36 +0200 Subject: [PATCH 137/744] staging: rtl8723bs: remove unused ODM_dbg_exit macro remove unused ODM_dbg_exit macro definition. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/84b76bc814f44e3b2da92318b05f101f59cf0889.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index 7c9a87fb8e51..c359eabebb67 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -97,7 +97,6 @@ #if DBG #else -#define ODM_dbg_exit() do {} while (0) #endif void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); From 2a966470249158654aa1cc0f440fa928e416a7ae Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:37 +0200 Subject: [PATCH 138/744] staging: rtl8723bs: remove empty ifdef block remove empty ifdef block Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/e30ccbe6cf20069e1a24a7a150d0b6241a7b57f8.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index c359eabebb67..8ae9948fb0c6 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -95,10 +95,6 @@ #define ASSERT(expr) #endif -#if DBG -#else -#endif - void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); #endif /* __ODM_DBG_H__ */ From ae5351da40fb14d0a0c955595c3ac5711e33963d Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:38 +0200 Subject: [PATCH 139/744] staging: rtl8723bs: remove unused ASSERT macro remove unused do nothing ASSERT macro definition. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/f13bc57cc3a821c40443dddc38258b87962774a7.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index 8ae9948fb0c6..78b9b4548dcb 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -92,7 +92,6 @@ #define RT_DISP(dbgtype, dbgflag, printstr) #ifndef ASSERT - #define ASSERT(expr) #endif void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); From 22a555bb47ba458e57c150c9e483e10b4b11e63b Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:39 +0200 Subject: [PATCH 140/744] staging: rtl8723bs: remove empty #ifndef block remove empty ifndef block. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/2caae2efcfbe74cafe6aa000ca7b330cc371dca2.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index 78b9b4548dcb..3faf4da42bd7 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -91,9 +91,6 @@ DbgPrint("%s(): " fmt, __func__, ## args) #define RT_DISP(dbgtype, dbgflag, printstr) -#ifndef ASSERT -#endif - void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); #endif /* __ODM_DBG_H__ */ From 2172a6576388e63958f47923e435c46af8d006ba Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:40 +0200 Subject: [PATCH 141/744] staging: rtl8723bs: remove commented out RT_ASSERT occurrences remove commented out obsoete RT_ASSERT macro occurences. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/3ee98d7bf1685af627e625f413de355fce58d52d.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_recv.c | 2 -- drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 1 - drivers/staging/rtl8723bs/hal/sdio_halinit.c | 5 ----- 3 files changed, 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c index 3e671cba6b94..c0689a4b7cb1 100644 --- a/drivers/staging/rtl8723bs/core/rtw_recv.c +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c @@ -1794,8 +1794,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor /* pTS->RxIndicateState = RXTS_INDICATE_PROCESSING; */ /* Indicate packets */ - /* RT_ASSERT((index<=REORDER_WIN_SIZE), ("RxReorderIndicatePacket(): Rx Reorder buffer full!!\n")); */ - /* indicate this recv_frame */ /* DbgPrint("recv_indicatepkts_in_order, indicate_seq =%d, seq_num =%d\n", precvpriv->indicate_seq, pattrib->seq_num); */ diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index 871e614db878..385b2510087a 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -122,7 +122,6 @@ static int _WriteFW(struct adapter *padapter, void *buffer, u32 size) u8 *bufferPtr = buffer; pageNums = size / MAX_DLFW_PAGE_SIZE; - /* RT_ASSERT((pageNums <= 4), ("Page numbers should not greater then 4\n")); */ remainSize = size % MAX_DLFW_PAGE_SIZE; for (page = 0; page < pageNums; page++) { diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c index fa285003b427..fd060cf7bc57 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c @@ -226,7 +226,6 @@ static void _InitNormalChipOneOutEpPriority(struct adapter *Adapter) value = QUEUE_NORMAL; break; default: - /* RT_ASSERT(false, ("Shall not reach here!\n")); */ break; } @@ -260,7 +259,6 @@ static void _InitNormalChipTwoOutEpPriority(struct adapter *Adapter) valueLow = QUEUE_NORMAL; break; default: - /* RT_ASSERT(false, ("Shall not reach here!\n")); */ break; } @@ -325,7 +323,6 @@ static void _InitQueuePriority(struct adapter *Adapter) _InitNormalChipThreeOutEpPriority(Adapter); break; default: - /* RT_ASSERT(false, ("Shall not reach here!\n")); */ break; } @@ -516,7 +513,6 @@ static void _InitOperationMode(struct adapter *padapter) regBwOpMode = BW_OPMODE_20MHZ; break; case WIRELESS_MODE_A: -/* RT_ASSERT(false, ("Error wireless a mode\n")); */ break; case WIRELESS_MODE_G: regBwOpMode = BW_OPMODE_20MHZ; @@ -530,7 +526,6 @@ static void _InitOperationMode(struct adapter *padapter) regBwOpMode = BW_OPMODE_20MHZ; break; case WIRELESS_MODE_N_5G: -/* RT_ASSERT(false, ("Error wireless mode")); */ regBwOpMode = BW_OPMODE_5G; break; From 292611481c8b019b6a2490dd4fda70b11609bbd1 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:41 +0200 Subject: [PATCH 142/744] staging: rtl8723bs: remove unused RT_PRINTK macro remove unused RT_PRINTK macro definition. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/edf86e39fce8a53f52c8c8463d134ea426f58b60.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index 3faf4da42bd7..5c4412bf6fbd 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -87,8 +87,6 @@ /*------------------------Export Marco Definition---------------------------*/ #define DbgPrint printk - #define RT_PRINTK(fmt, args...)\ - DbgPrint("%s(): " fmt, __func__, ## args) #define RT_DISP(dbgtype, dbgflag, printstr) void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); From 8e30fb99d729cb302f787241686a1d246dab5dfc Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:42 +0200 Subject: [PATCH 143/744] staging: rtl8723bs: remove BTC_PRINT logs Remove BTC_PRINT logs. BTC_PRINT macro's default behavoiur is _do nothing_. It's enabled by uncommenting some code in hal/hal_btcoex.c file. So just remove it. Applied following semantic patch: @@ @@ - BTC_PRINT(...); Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/9a9a8ce817929f1705b623c470cbafcc75fb3e72.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 580 +----------------- .../staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 489 --------------- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 7 - 3 files changed, 2 insertions(+), 1074 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c index 503790924532..28f41a637c96 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c @@ -41,43 +41,18 @@ static u8 halbtc8723b1ant_BtRssiState( if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) { btRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to High\n") - ); } else { btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at Low\n") - ); } } else { if (btRssi < rssiThresh) { btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to Low\n") - ); } else { btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at High\n") - ); } } } else if (levelNum == 3) { if (rssiThresh > rssiThresh1) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi thresh error!!\n") - ); return pCoexSta->preBtRssiState; } @@ -87,18 +62,8 @@ static u8 halbtc8723b1ant_BtRssiState( ) { if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) { btRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to Medium\n") - ); } else { btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at Low\n") - ); } } else if ( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || @@ -106,41 +71,16 @@ static u8 halbtc8723b1ant_BtRssiState( ) { if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) { btRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to High\n") - ); } else if (btRssi < rssiThresh) { btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to Low\n") - ); } else { btRssiState = BTC_RSSI_STATE_STAY_MEDIUM; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at Medium\n") - ); } } else { if (btRssi < rssiThresh1) { btRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state switch to Medium\n") - ); } else { btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_RSSI_STATE, - ("[BTCoex], BT Rssi state stay at High\n") - ); } } } @@ -322,12 +262,6 @@ static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist) H2C_Parameter[0] |= BIT0; /* trigger */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ("[BTCoex], Query Bt Info, FW write 0x61 = 0x%x\n", H2C_Parameter[0]) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); } @@ -367,18 +301,6 @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) if ((pCoexSta->lowPriorityTx >= 1050) && (!pCoexSta->bC2hBtInquiryPage)) pCoexSta->popEventCnt++; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ( - "[BTCoex], Hi-Pri Rx/Tx: %d/%d, Lo-Pri Rx/Tx: %d/%d\n", - regHPRx, - regHPTx, - regLPRx, - regLPTx - ) - ); - /* reset counter */ pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); @@ -587,11 +509,6 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if (!pBtLinkInfo->bBtLinkExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], No BT link exists!!!\n") - ); return algorithm; } @@ -606,41 +523,16 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) if (numOfDiffProfile == 1) { if (pBtLinkInfo->bScoExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO only\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_SCO; } else { if (pBtLinkInfo->bHidExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID only\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID; } else if (pBtLinkInfo->bA2dpExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = A2DP only\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_A2DP; } else if (pBtLinkInfo->bPanExist) { if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = PAN(HS) only\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_PANHS; } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = PAN(EDR) only\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR; } } @@ -648,74 +540,29 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) } else if (numOfDiffProfile == 2) { if (pBtLinkInfo->bScoExist) { if (pBtLinkInfo->bHidExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + HID\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID; } else if (pBtLinkInfo->bA2dpExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + A2DP ==> SCO\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_SCO; } else if (pBtLinkInfo->bPanExist) { if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + PAN(HS)\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_SCO; } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + PAN(EDR)\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; } } } else { if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + A2DP\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; } else if (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist) { if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + PAN(HS)\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + PAN(EDR)\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; } } else if (pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist) { if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = A2DP + PAN(HS)\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS; } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = A2DP + PAN(EDR)\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP; } } @@ -723,32 +570,19 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) } else if (numOfDiffProfile == 3) { if (pBtLinkInfo->bScoExist) { if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + HID + A2DP ==> HID\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID; } else if ( pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT Profile = SCO + HID + PAN(HS)\n")); algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT Profile = SCO + HID + PAN(EDR)\n")); algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; } } else if (pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT Profile = SCO + A2DP + PAN(HS)\n")); algorithm = BT_8723B_1ANT_COEX_ALGO_SCO; } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + A2DP + PAN(EDR) ==> HID\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; } } @@ -759,18 +593,8 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + A2DP + PAN(HS)\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = HID + A2DP + PAN(EDR)\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR; } } @@ -783,18 +607,7 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Error!!! BT Profile = SCO + HID + A2DP + PAN(HS)\n") - ); - } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT Profile = SCO + HID + A2DP + PAN(EDR) ==>PAN(EDR)+HID\n") - ); algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; } } @@ -820,15 +633,6 @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( H2C_Parameter[5] = 0xf9; /* MCS5 or OFDM36 */ } - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], set WiFi Low-Penalty Retry: %s", - (bLowPenaltyRa ? "ON!!" : "OFF!!") - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter); } @@ -857,32 +661,12 @@ static void halbtc8723b1ant_SetCoexTable( u8 val0x6cc ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c0 = 0x%x\n", val0x6c0) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c4 = 0x%x\n", val0x6c4) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c8 = 0x%x\n", val0x6c8) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6cc = 0x%x\n", val0x6cc) - ); pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc); } @@ -895,15 +679,6 @@ static void halbtc8723b1ant_CoexTable( u8 val0x6cc ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s write Coex Table 0x6c0 = 0x%x, 0x6c4 = 0x%x, 0x6cc = 0x%x\n", - (bForceExec ? "force to" : ""), - val0x6c0, val0x6c4, val0x6cc - ) - ); pCoexDm->curVal0x6c0 = val0x6c0; pCoexDm->curVal0x6c4 = val0x6c4; pCoexDm->curVal0x6c8 = val0x6c8; @@ -933,12 +708,6 @@ static void halbtc8723b1ant_CoexTableWithType( struct btc_coexist *pBtCoexist, bool bForceExec, u8 type ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], ********** CoexTable(%d) **********\n", type) - ); - pCoexSta->nCoexTableType = type; switch (type) { @@ -996,15 +765,6 @@ static void halbtc8723b1ant_SetFwIgnoreWlanAct( if (bEnable) H2C_Parameter[0] |= BIT0; /* function enable */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x63 = 0x%x\n", - H2C_Parameter[0] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter); } @@ -1012,28 +772,9 @@ static void halbtc8723b1ant_IgnoreWlanAct( struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s turn Ignore WlanAct %s\n", - (bForceExec ? "force to" : ""), - (bEnable ? "ON" : "OFF") - ) - ); pCoexDm->bCurIgnoreWlanAct = bEnable; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], bPreIgnoreWlanAct = %d, bCurIgnoreWlanAct = %d!!\n", - pCoexDm->bPreIgnoreWlanAct, - pCoexDm->bCurIgnoreWlanAct - ) - ); - if (pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct) return; } @@ -1057,44 +798,14 @@ static void halbtc8723b1ant_LpsRpwm( struct btc_coexist *pBtCoexist, bool bForceExec, u8 lpsVal, u8 rpwmVal ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s set lps/rpwm = 0x%x/0x%x\n", - (bForceExec ? "force to" : ""), - lpsVal, - rpwmVal - ) - ); pCoexDm->curLps = lpsVal; pCoexDm->curRpwm = rpwmVal; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], LPS-RxBeaconMode = 0x%x , LPS-RPWM = 0x%x!!\n", - pCoexDm->curLps, - pCoexDm->curRpwm - ) - ); - if ( (pCoexDm->preLps == pCoexDm->curLps) && (pCoexDm->preRpwm == pCoexDm->curRpwm) ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], LPS-RPWM_Last = 0x%x , LPS-RPWM_Now = 0x%x!!\n", - pCoexDm->preRpwm, - pCoexDm->curRpwm - ) - ); - return; } } @@ -1108,12 +819,6 @@ static void halbtc8723b1ant_SwMechanism( struct btc_coexist *pBtCoexist, bool bLowPenaltyRA ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_MONITOR, - ("[BTCoex], SM[LpRA] = %d\n", bLowPenaltyRA) - ); - halbtc8723b1ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA); } @@ -1190,10 +895,8 @@ static void halbtc8723b1ant_SetAntPath( cntBtCalChk++; if (u1Tmp & BIT0) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ########### BT is calibrating (wait cnt =%d) ###########\n", cntBtCalChk)); mdelay(50); } else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ********** BT is NOT calibrating (wait cnt =%d)**********\n", cntBtCalChk)); break; } } @@ -1318,11 +1021,6 @@ static void halbtc8723b1ant_SetFwPstdma( if (bApEnable) { if (byte1 & BIT4 && !(byte1 & BIT5)) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], FW for 1Ant AP mode\n") - ); realByte1 &= ~BIT4; realByte1 |= BIT5; @@ -1343,19 +1041,6 @@ static void halbtc8723b1ant_SetFwPstdma( pCoexDm->psTdmaPara[3] = byte4; pCoexDm->psTdmaPara[4] = realByte5; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], PS-TDMA H2C cmd = 0x%x%08x\n", - H2C_Parameter[0], - H2C_Parameter[1] << 24 | - H2C_Parameter[2] << 16 | - H2C_Parameter[3] << 8 | - H2C_Parameter[4] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter); } @@ -1379,23 +1064,7 @@ static void halbtc8723b1ant_PsTdma( pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); if (pCoexDm->bCurPsTdmaOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ( - "[BTCoex], ********** TDMA(on, %d) **********\n", - pCoexDm->curPsTdma - ) - ); } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ( - "[BTCoex], ********** TDMA(off, %d) **********\n", - pCoexDm->curPsTdma - ) - ); } if (!bForceExec) { @@ -1672,12 +1341,6 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) !bWifiConnected && BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi non connected-idle + BT non connected-idle!!\n") - ); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; @@ -1685,12 +1348,6 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) bWifiConnected && (BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus) ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi connected + BT non connected-idle!!\n") - ); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; @@ -1698,12 +1355,6 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) !bWifiConnected && (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi non connected-idle + BT connected-idle!!\n") - ); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; @@ -1711,8 +1362,6 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) bWifiConnected && (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT connected-idle!!\n")); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; @@ -1720,28 +1369,12 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) !bWifiConnected && (BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE != pCoexDm->btStatus) ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi non connected-idle + BT Busy!!\n") - ); - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ bCommon = true; } else { if (bWifiBusy) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi Connected-Busy + BT Busy!!\n") - ); } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], Wifi Connected-Idle + BT Busy!!\n") - ); } bCommon = false; @@ -1759,12 +1392,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( s32 result; /* 0: no change, +1: increase WiFi duration, -1: decrease WiFi duration */ u8 retryCount = 0, btInfoExt; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ("[BTCoex], TdmaDurationAdjustForAcl()\n") - ); - if ( (BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN == wifiStatus) || (BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN == wifiStatus) || @@ -1791,11 +1418,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( if (!pCoexDm->bAutoTdmaAdjust) { pCoexDm->bAutoTdmaAdjust = true; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ("[BTCoex], first run TdmaDurationAdjust()!!\n") - ); halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2); pCoexDm->psTdmaDuAdjType = 2; @@ -1833,11 +1455,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( up = 0; dn = 0; result = 1; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ("[BTCoex], Increase wifi duration!!\n") - ); } } else if (retryCount <= 3) { /* <=3 retry in the last 2-second duration */ up--; @@ -1860,7 +1477,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n")); } } else { /* retry count > 3, 只要1次 retry count > 3, 則調窄WiFi duration */ if (WaitCount == 1) @@ -1876,11 +1492,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ("[BTCoex], Decrease wifi duration for retryCounter>3!!\n") - ); } if (result == -1) { @@ -1918,14 +1529,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( pCoexDm->psTdmaDuAdjType = 1; } } else { /* no change */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], ********** TDMA(on, %d) **********\n", - pCoexDm->curPsTdma - ) - ); } if ( @@ -2271,20 +1874,9 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) bool bScan = false, bLink = false, bRoam = false; bool bUnder4way = false, bApEnable = false; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], CoexForWifiConnect() ===>\n") - ); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way); if (bUnder4way) { halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], CoexForWifiConnect(), return for wifi is under 4way<===\n") - ); return; } @@ -2296,11 +1888,6 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist); else halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], CoexForWifiConnect(), return for wifi is under scan<===\n") - ); return; } @@ -2397,47 +1984,36 @@ static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist } else { switch (pCoexDm->curAlgorithm) { case BT_8723B_1ANT_COEX_ALGO_SCO: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = SCO.\n")); /* halbtc8723b1ant_ActionSco(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HID.\n")); /* halbtc8723b1ant_ActionHid(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = A2DP.\n")); /* halbtc8723b1ant_ActionA2dp(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = A2DP+PAN(HS).\n")); /* halbtc8723b1ant_ActionA2dpPanHs(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = PAN(EDR).\n")); /* halbtc8723b1ant_ActionPanEdr(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HS mode.\n")); /* halbtc8723b1ant_ActionPanHs(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = PAN+A2DP.\n")); /* halbtc8723b1ant_ActionPanEdrA2dp(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANEDR_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = PAN(EDR)+HID.\n")); /* halbtc8723b1ant_ActionPanEdrHid(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HID+A2DP+PAN.\n")); /* halbtc8723b1ant_ActionHidA2dpPanEdr(pBtCoexist); */ break; case BT_8723B_1ANT_COEX_ALGO_HID_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = HID+A2DP.\n")); /* halbtc8723b1ant_ActionHidA2dp(pBtCoexist); */ break; default: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action algorithm = coexist All Off!!\n")); break; } pCoexDm->preAlgorithm = pCoexDm->curAlgorithm; @@ -2454,20 +2030,15 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) u32 wifiLinkStatus = 0; u32 numOfWifiLink = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism() ===>\n")); - if (pBtCoexist->bManualControl) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism(), return for Manual CTRL <===\n")); return; } if (pBtCoexist->bStopCoexDm) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism(), return for Stop Coex DM <===\n")); return; } if (pCoexSta->bUnderIps) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi is under IPS !!!\n")); return; } @@ -2498,24 +2069,10 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) numOfWifiLink = wifiLinkStatus >> 16; if ((numOfWifiLink >= 2) || (wifiLinkStatus & WIFI_P2P_GO_CONNECTED)) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ( - "############# [BTCoex], Multi-Port numOfWifiLink = %d, wifiLinkStatus = 0x%x\n", - numOfWifiLink, - wifiLinkStatus - ) - ); halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize); if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage)) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("############# [BTCoex], BT Is Inquirying\n") - ); halbtc8723b1ant_ActionBtInquiry(pBtCoexist); } else halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); @@ -2544,11 +2101,6 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if (pCoexSta->bC2hBtInquiryPage) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("############# [BTCoex], BT Is Inquirying\n") - ); halbtc8723b1ant_ActionBtInquiry(pBtCoexist); return; } else if (bBtHsOn) { @@ -2560,8 +2112,6 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) if (!bWifiConnected) { bool bScan = false, bLink = false, bRoam = false; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi is non connected-idle !!!\n")); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); @@ -2599,12 +2149,6 @@ static void halbtc8723b1ant_InitHwConfig( u32 u4Tmp = 0;/* fwVer; */ u8 u1Tmpa = 0, u1Tmpb = 0; - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_INIT, - ("[BTCoex], 1Ant Init HW Config!!\n") - ); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */ /* 0x790[5:0]= 0x5 */ @@ -2627,17 +2171,6 @@ static void halbtc8723b1ant_InitHwConfig( u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); - - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ( - "############# [BTCoex], 0x948 = 0x%x, 0x765 = 0x%x, 0x67 = 0x%x\n", - u4Tmp, - u1Tmpa, - u1Tmpb - ) - ); } /* */ @@ -2705,12 +2238,6 @@ void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOn void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_INIT, - ("[BTCoex], Coex Mechanism Init!!\n") - ); - pBtCoexist->bStopCoexDm = false; halbtc8723b1ant_InitCoexDm(pBtCoexist); @@ -3187,18 +2714,12 @@ void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) return; if (BTC_IPS_ENTER == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n") - ); pCoexSta->bUnderIps = true; halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); } else if (BTC_IPS_LEAVE == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n") - ); pCoexSta->bUnderIps = false; halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false); @@ -3213,14 +2734,8 @@ void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) return; if (BTC_LPS_ENABLE == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS ENABLE notify\n") - ); pCoexSta->bUnderLps = true; } else if (BTC_LPS_DISABLE == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS DISABLE notify\n") - ); pCoexSta->bUnderLps = false; } } @@ -3241,31 +2756,13 @@ void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) if (BTC_SCAN_START == type) { pCoexSta->bWiFiIsHighPriTask = true; - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n") - ); halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */ u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); u1Tmpa = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); u1Tmpb = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); - - - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ( - "[BTCoex], 0x948 = 0x%x, 0x765 = 0x%x, 0x67 = 0x%x\n", - u4Tmp, - u1Tmpa, - u1Tmpb - ) - ); } else { pCoexSta->bWiFiIsHighPriTask = false; - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n") - ); pBtCoexist->fBtcGet( pBtCoexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum @@ -3332,11 +2829,9 @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) if (BTC_ASSOCIATE_START == type) { pCoexSta->bWiFiIsHighPriTask = true; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); pCoexDm->nArpCnt = 0; } else { pCoexSta->bWiFiIsHighPriTask = false; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); /* pCoexDm->nArpCnt = 0; */ } @@ -3387,8 +2882,6 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type return; if (BTC_MEDIA_CONNECT == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n")); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode); /* Set CCK Tx/Rx high Pri except 11b mode */ @@ -3405,7 +2898,6 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type pCoexDm->backupRetryLimit = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a); pCoexDm->backupAmpduMaxTime = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456); } else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n")); pCoexDm->nArpCnt = 0; pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x0); /* CCK Tx */ @@ -3430,15 +2922,6 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1]; pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2]; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], FW write 0x66 = 0x%x\n", - H2C_Parameter[0] << 16 | H2C_Parameter[1] << 8 | H2C_Parameter[2] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); } @@ -3463,18 +2946,7 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty BTC_PACKET_ARP == type ) { if (BTC_PACKET_ARP == type) { - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], special Packet ARP notify\n") - ); - pCoexDm->nArpCnt++; - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], ARP Packet Count = %d\n", pCoexDm->nArpCnt) - ); if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(pBtCoexist) */ pCoexSta->bWiFiIsHighPriTask = false; @@ -3482,19 +2954,9 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty pCoexSta->bWiFiIsHighPriTask = true; } else { pCoexSta->bWiFiIsHighPriTask = true; - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], special Packet DHCP or EAPOL notify\n") - ); } } else { pCoexSta->bWiFiIsHighPriTask = false; - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], special Packet [Type = %d] notify\n", type) - ); } pCoexSta->specialPktPeriodCnt = 0; @@ -3546,23 +3008,14 @@ void EXhalbtc8723b1ant_BtInfoNotify( rspSource = BT_INFO_SRC_8723B_1ANT_WIFI_FW; pCoexSta->btInfoC2hCnt[rspSource]++; - BTC_PRINT( - BTC_MSG_INTERFACE, - INTF_NOTIFY, - ("[BTCoex], Bt info[%d], length =%d, hex data =[", - rspSource, - length) - ); for (i = 0; i < length; i++) { pCoexSta->btInfoC2h[rspSource][i] = tmpBuf[i]; if (i == 1) btInfo = tmpBuf[i]; if (i == length - 1) - BTC_PRINT( - BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x]\n", tmpBuf[i]) - ); + {} else - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x, ", tmpBuf[i])); + {} } if (BT_INFO_SRC_8723B_1ANT_WIFI_FW != rspSource) { @@ -3586,18 +3039,12 @@ void EXhalbtc8723b1ant_BtInfoNotify( if (!pCoexSta->bBtTxRxMask) { /* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */ - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x15\n")); pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); } /* Here we need to resend some wifi info to BT */ /* because bt is reset and loss of the info. */ if (pCoexSta->btInfoExt & BIT1) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT ext info bit1 check, send wifi BW&Chnl to BT!!\n") - ); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if (bWifiConnected) EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_CONNECT); @@ -3607,11 +3054,6 @@ void EXhalbtc8723b1ant_BtInfoNotify( if (pCoexSta->btInfoExt & BIT3) { if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], BT ext info bit3 check, set BT NOT to ignore Wlan active!!\n") - ); halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false); } } else { @@ -3661,26 +3103,21 @@ void EXhalbtc8723b1ant_BtInfoNotify( if (!(btInfo & BT_INFO_8723B_1ANT_B_CONNECTION)) { pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Non-Connected idle!!!\n")); } else if (btInfo == BT_INFO_8723B_1ANT_B_CONNECTION) { /* connection exists but no busy */ pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Connected-idle!!!\n")); } else if ( (btInfo & BT_INFO_8723B_1ANT_B_SCO_ESCO) || (btInfo & BT_INFO_8723B_1ANT_B_SCO_BUSY) ) { pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_SCO_BUSY; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT SCO busy!!!\n")); } else if (btInfo & BT_INFO_8723B_1ANT_B_ACL_BUSY) { if (BT_8723B_1ANT_BT_STATUS_ACL_BUSY != pCoexDm->btStatus) pCoexDm->bAutoTdmaAdjust = false; pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_ACL_BUSY; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT ACL busy!!!\n")); } else { pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_MAX; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Non-Defined state!!!\n")); } if ( @@ -3698,8 +3135,6 @@ void EXhalbtc8723b1ant_BtInfoNotify( void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *pBtCoexist) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 0); halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); @@ -3713,11 +3148,7 @@ void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *pBtCoexist) void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify\n")); - if (BTC_WIFI_PNP_SLEEP == pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to SLEEP\n")); - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); @@ -3725,7 +3156,6 @@ void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState) pBtCoexist->bStopCoexDm = true; } else if (BTC_WIFI_PNP_WAKE_UP == pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to WAKE UP\n")); pBtCoexist->bStopCoexDm = false; halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false); halbtc8723b1ant_InitCoexDm(pBtCoexist); @@ -3738,16 +3168,10 @@ void EXhalbtc8723b1ant_Periodical(struct btc_coexist *pBtCoexist) static u8 disVerInfoCnt; u32 fwVer = 0, btPatchVer = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ==========================Periodical ===========================\n")); - if (disVerInfoCnt <= 5) { disVerInfoCnt += 1; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], CoexVer/ FwVer/ PatchVer = %d_%x/ 0x%x/ 0x%x(%d)\n", \ - GLCoexVerDate8723b1Ant, GLCoexVer8723b1Ant, fwVer, btPatchVer, btPatchVer)); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); } halbtc8723b1ant_MonitorBtCtr(pBtCoexist); diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c index 4b570ec75e67..73f1cc6bc27c 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c @@ -46,23 +46,18 @@ static u8 halbtc8723b2ant_BtRssiState( ) { if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { btRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to High\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Low\n")); } } else { if (btRssi < rssiThresh) { btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Low\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at High\n")); } } } else if (levelNum == 3) { if (rssiThresh > rssiThresh1) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi thresh error!!\n")); return pCoexSta->preBtRssiState; } @@ -72,10 +67,8 @@ static u8 halbtc8723b2ant_BtRssiState( ) { if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { btRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Medium\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Low\n")); } } else if ( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || @@ -83,21 +76,16 @@ static u8 halbtc8723b2ant_BtRssiState( ) { if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { btRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to High\n")); } else if (btRssi < rssiThresh) { btRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Low\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at Medium\n")); } } else { if (btRssi < rssiThresh1) { btRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state switch to Medium\n")); } else { btRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_RSSI_STATE, ("[BTCoex], BT Rssi state stay at High\n")); } } } @@ -127,23 +115,18 @@ static u8 halbtc8723b2ant_WifiRssiState( ) { if (wifiRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { wifiRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n")); } } else { if (wifiRssi < rssiThresh) { wifiRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n")); } } } else if (levelNum == 3) { if (rssiThresh > rssiThresh1) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI thresh error!!\n")); return pCoexSta->preWifiRssiState[index]; } @@ -153,10 +136,8 @@ static u8 halbtc8723b2ant_WifiRssiState( ) { if (wifiRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { wifiRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n")); } } else if ( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_MEDIUM) || @@ -164,21 +145,16 @@ static u8 halbtc8723b2ant_WifiRssiState( ) { if (wifiRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT)) { wifiRssiState = BTC_RSSI_STATE_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n")); } else if (wifiRssi < rssiThresh) { wifiRssiState = BTC_RSSI_STATE_LOW; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Medium\n")); } } else { if (wifiRssi < rssiThresh1) { wifiRssiState = BTC_RSSI_STATE_MEDIUM; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n")); } else { wifiRssiState = BTC_RSSI_STATE_STAY_HIGH; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n")); } } } @@ -233,31 +209,6 @@ static void halbtc8723b2ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) pCoexSta->lowPriorityTx = regLPTx; pCoexSta->lowPriorityRx = regLPRx; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_MONITOR, - ( - "[BTCoex], High Priority Tx/Rx (reg 0x%x) = 0x%x(%d)/0x%x(%d)\n", - regHPTxRx, - regHPTx, - regHPTx, - regHPRx, - regHPRx - ) - ); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_BT_MONITOR, - ( - "[BTCoex], Low Priority Tx/Rx (reg 0x%x) = 0x%x(%d)/0x%x(%d)\n", - regLPTxRx, - regLPTx, - regLPTx, - regLPRx, - regLPRx - ) - ); - /* reset counter */ pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); } @@ -270,12 +221,6 @@ static void halbtc8723b2ant_QueryBtInfo(struct btc_coexist *pBtCoexist) H2C_Parameter[0] |= BIT0; /* trigger */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ("[BTCoex], Query Bt Info, FW write 0x61 = 0x%x\n", H2C_Parameter[0]) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); } @@ -384,7 +329,6 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if (!pBtLinkInfo->bBtLinkExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], No BT link exists!!!\n")); return algorithm; } @@ -402,21 +346,16 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) if (numOfDiffProfile == 1) { if (pBtLinkInfo->bScoExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_SCO; } else { if (pBtLinkInfo->bHidExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID; } else if (pBtLinkInfo->bA2dpExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_A2DP; } else if (pBtLinkInfo->bPanExist) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN(HS) only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANHS; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN(EDR) only\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR; } } @@ -424,17 +363,13 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) } else if (numOfDiffProfile == 2) { if (pBtLinkInfo->bScoExist) { if (pBtLinkInfo->bHidExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } else if (pBtLinkInfo->bA2dpExist) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP ==> SCO\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } else if (pBtLinkInfo->bPanExist) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + PAN(HS)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_SCO; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + PAN(EDR)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } } @@ -443,17 +378,14 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist ) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID_A2DP; } else if ( pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN(HS)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN(EDR)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } } else if ( @@ -461,10 +393,8 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP + PAN(HS)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP + PAN(EDR)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP; } } @@ -475,29 +405,14 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], SCO + HID + A2DP ==> HID\n") - ); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } else if ( pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist ) { if (bBtHsOn) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], SCO + HID + PAN(HS)\n") - ); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } else { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ("[BTCoex], SCO + HID + PAN(EDR)\n") - ); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } } else if ( @@ -505,10 +420,8 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP + PAN(HS)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + A2DP + PAN(EDR) ==> HID\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } } @@ -519,10 +432,8 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP + PAN(HS)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID_A2DP; } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP + PAN(EDR)\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR; } } @@ -535,10 +446,7 @@ static u8 halbtc8723b2ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Error!!! SCO + HID + A2DP + PAN(HS)\n")); - } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO + HID + A2DP + PAN(EDR) ==>PAN(EDR)+HID\n")); algorithm = BT_8723B_2ANT_COEX_ALGO_PANEDR_HID; } } @@ -558,17 +466,6 @@ static void halbtc8723b2ant_SetFwDacSwingLevel( /* 0x18/ 0x10/ 0xc/ 0x8/ 0x4/ 0x6 */ H2C_Parameter[0] = dacSwingLvl; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ("[BTCoex], Set Dac Swing Level = 0x%x\n", dacSwingLvl) - ); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ("[BTCoex], FW write 0x64 = 0x%x\n", H2C_Parameter[0]) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x64, 1, H2C_Parameter); } @@ -580,16 +477,6 @@ static void halbtc8723b2ant_SetFwDecBtPwr( H2C_Parameter[0] = decBtPwrLvl; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], decrease Bt Power level = %d, FW write 0x62 = 0x%x\n", - decBtPwrLvl, - H2C_Parameter[0] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x62, 1, H2C_Parameter); } @@ -597,28 +484,9 @@ static void halbtc8723b2ant_DecBtPwr( struct btc_coexist *pBtCoexist, bool bForceExec, u8 decBtPwrLvl ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s Dec BT power level = %d\n", - (bForceExec ? "force to" : ""), - decBtPwrLvl - ) - ); pCoexDm->curBtDecPwrLvl = decBtPwrLvl; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], preBtDecPwrLvl =%d, curBtDecPwrLvl =%d\n", - pCoexDm->preBtDecPwrLvl, - pCoexDm->curBtDecPwrLvl - ) - ); - if (pCoexDm->preBtDecPwrLvl == pCoexDm->curBtDecPwrLvl) return; } @@ -631,28 +499,9 @@ static void halbtc8723b2ant_FwDacSwingLvl( struct btc_coexist *pBtCoexist, bool bForceExec, u8 fwDacSwingLvl ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s set FW Dac Swing level = %d\n", - (bForceExec ? "force to" : ""), - fwDacSwingLvl - ) - ); pCoexDm->curFwDacSwingLvl = fwDacSwingLvl; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], preFwDacSwingLvl =%d, curFwDacSwingLvl =%d\n", - pCoexDm->preFwDacSwingLvl, - pCoexDm->curFwDacSwingLvl - ) - ); - if (pCoexDm->preFwDacSwingLvl == pCoexDm->curFwDacSwingLvl) return; } @@ -669,17 +518,11 @@ static void halbtc8723b2ant_SetSwRfRxLpfCorner( { if (bRxRfShrinkOn) { /* Shrink RF Rx LPF corner */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], Shrink RF Rx LPF corner!!\n") - ); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, 0xffffc); } else { /* Resume RF Rx LPF corner */ /* After initialized, we can use pCoexDm->btRf0x1eBackup */ if (pBtCoexist->bInitilized) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Resume RF Rx LPF corner!!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, pCoexDm->btRf0x1eBackup); } } @@ -689,28 +532,9 @@ static void halbtc8723b2ant_RfShrink( struct btc_coexist *pBtCoexist, bool bForceExec, bool bRxRfShrinkOn ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s turn Rx RF Shrink = %s\n", - (bForceExec ? "force to" : ""), - (bRxRfShrinkOn ? "ON" : "OFF") - ) - ); pCoexDm->bCurRfRxLpfShrink = bRxRfShrinkOn; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], bPreRfRxLpfShrink =%d, bCurRfRxLpfShrink =%d\n", - pCoexDm->bPreRfRxLpfShrink, - pCoexDm->bCurRfRxLpfShrink - ) - ); - if (pCoexDm->bPreRfRxLpfShrink == pCoexDm->bCurRfRxLpfShrink) return; } @@ -735,15 +559,6 @@ static void halbtc8723b2ant_SetSwPenaltyTxRateAdaptive( H2C_Parameter[5] = 0xf9; /* MCS5 or OFDM36 */ } - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], set WiFi Low-Penalty Retry: %s", - (bLowPenaltyRa ? "ON!!" : "OFF!!") - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter); } @@ -752,28 +567,9 @@ static void halbtc8723b2ant_LowPenaltyRa( ) { /* return; */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s turn LowPenaltyRA = %s\n", - (bForceExec ? "force to" : ""), - (bLowPenaltyRa ? "ON" : "OFF") - ) - ); pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], bPreLowPenaltyRa =%d, bCurLowPenaltyRa =%d\n", - pCoexDm->bPreLowPenaltyRa, - pCoexDm->bCurLowPenaltyRa - ) - ); - if (pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa) return; } @@ -786,11 +582,6 @@ static void halbtc8723b2ant_SetDacSwingReg(struct btc_coexist *pBtCoexist, u32 l { u8 val = (u8)level; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], Write SwDacSwing = 0x%x\n", level) - ); pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x883, 0x3e, val); } @@ -812,32 +603,10 @@ static void halbtc8723b2ant_DacSwing( u32 dacSwingLvl ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s turn DacSwing =%s, dacSwingLvl = 0x%x\n", - (bForceExec ? "force to" : ""), - (bDacSwingOn ? "ON" : "OFF"), - dacSwingLvl - ) - ); pCoexDm->bCurDacSwingOn = bDacSwingOn; pCoexDm->curDacSwingLvl = dacSwingLvl; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], bPreDacSwingOn =%d, preDacSwingLvl = 0x%x, bCurDacSwingOn =%d, curDacSwingLvl = 0x%x\n", - pCoexDm->bPreDacSwingOn, - pCoexDm->preDacSwingLvl, - pCoexDm->bCurDacSwingOn, - pCoexDm->curDacSwingLvl - ) - ); - if ((pCoexDm->bPreDacSwingOn == pCoexDm->bCurDacSwingOn) && (pCoexDm->preDacSwingLvl == pCoexDm->curDacSwingLvl)) return; @@ -857,7 +626,6 @@ static void halbtc8723b2ant_SetAgcTable( /* BB AGC Gain Table */ if (bAgcTableEn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB Agc Table On!\n")); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6e1A0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6d1B0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x6c1C0001); @@ -866,7 +634,6 @@ static void halbtc8723b2ant_SetAgcTable( pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x691F0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0x68200001); } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB Agc Table Off!\n")); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xaa1A0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa91B0001); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78, 0xa81C0001); @@ -880,11 +647,9 @@ static void halbtc8723b2ant_SetAgcTable( /* RF Gain */ pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xef, 0xfffff, 0x02000); if (bAgcTableEn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table On!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x38fff); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x38ffe); } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table Off!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x380c3); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x3b, 0xfffff, 0x28ce6); } @@ -892,11 +657,9 @@ static void halbtc8723b2ant_SetAgcTable( pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0xed, 0xfffff, 0x1); if (bAgcTableEn) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table On!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x38fff); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x38ffe); } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table Off!\n")); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x380c3); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x40, 0xfffff, 0x28ce6); } @@ -913,28 +676,9 @@ static void halbtc8723b2ant_AgcTable( struct btc_coexist *pBtCoexist, bool bForceExec, bool bAgcTableEn ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s %s Agc Table\n", - (bForceExec ? "force to" : ""), - (bAgcTableEn ? "Enable" : "Disable") - ) - ); pCoexDm->bCurAgcTableEn = bAgcTableEn; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], bPreAgcTableEn =%d, bCurAgcTableEn =%d\n", - pCoexDm->bPreAgcTableEn, - pCoexDm->bCurAgcTableEn - ) - ); - if (pCoexDm->bPreAgcTableEn == pCoexDm->bCurAgcTableEn) return; } @@ -951,32 +695,12 @@ static void halbtc8723b2ant_SetCoexTable( u8 val0x6cc ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c0 = 0x%x\n", val0x6c0) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c4 = 0x%x\n", val0x6c4) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6c8 = 0x%x\n", val0x6c8) - ); pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_EXEC, - ("[BTCoex], set coex table, set 0x6cc = 0x%x\n", val0x6cc) - ); pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc); } @@ -989,47 +713,12 @@ static void halbtc8723b2ant_CoexTable( u8 val0x6cc ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW, - ( - "[BTCoex], %s write Coex Table 0x6c0 = 0x%x, 0x6c4 = 0x%x, 0x6c8 = 0x%x, 0x6cc = 0x%x\n", - (bForceExec ? "force to" : ""), - val0x6c0, - val0x6c4, - val0x6c8, - val0x6cc - ) - ); pCoexDm->curVal0x6c0 = val0x6c0; pCoexDm->curVal0x6c4 = val0x6c4; pCoexDm->curVal0x6c8 = val0x6c8; pCoexDm->curVal0x6cc = val0x6cc; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], preVal0x6c0 = 0x%x, preVal0x6c4 = 0x%x, preVal0x6c8 = 0x%x, preVal0x6cc = 0x%x !!\n", - pCoexDm->preVal0x6c0, - pCoexDm->preVal0x6c4, - pCoexDm->preVal0x6c8, - pCoexDm->preVal0x6cc - ) - ); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_SW_DETAIL, - ( - "[BTCoex], curVal0x6c0 = 0x%x, curVal0x6c4 = 0x%x, curVal0x6c8 = 0x%x, curVal0x6cc = 0x%x !!\n", - pCoexDm->curVal0x6c0, - pCoexDm->curVal0x6c4, - pCoexDm->curVal0x6c8, - pCoexDm->curVal0x6cc - ) - ); - if ( (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) && (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) && @@ -1104,15 +793,6 @@ static void halbtc8723b2ant_SetFwIgnoreWlanAct( if (bEnable) H2C_Parameter[0] |= BIT0; /* function enable */ - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x63 = 0x%x\n", - H2C_Parameter[0] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter); } @@ -1120,22 +800,9 @@ static void halbtc8723b2ant_IgnoreWlanAct( struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s turn Ignore WlanAct %s\n", - (bForceExec ? "force to" : ""), - (bEnable ? "ON" : "OFF") - ) - ); - pCoexDm->bCurIgnoreWlanAct = bEnable; if (!bForceExec) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreIgnoreWlanAct = %d, bCurIgnoreWlanAct = %d!!\n", - pCoexDm->bPreIgnoreWlanAct, pCoexDm->bCurIgnoreWlanAct)); - if (pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct) return; } @@ -1167,19 +834,6 @@ static void halbtc8723b2ant_SetFwPstdma( pCoexDm->psTdmaPara[3] = byte4; pCoexDm->psTdmaPara[4] = byte5; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], FW write 0x60(5bytes) = 0x%x%08x\n", - H2C_Parameter[0], - H2C_Parameter[1] << 24 | - H2C_Parameter[2] << 16 | - H2C_Parameter[3] << 8 | - H2C_Parameter[4] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter); } @@ -1305,38 +959,10 @@ static void halbtc8723b2ant_PsTdma( struct btc_coexist *pBtCoexist, bool bForceExec, bool bTurnOn, u8 type ) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW, - ( - "[BTCoex], %s turn %s PS TDMA, type =%d\n", - (bForceExec ? "force to" : ""), - (bTurnOn ? "ON" : "OFF"), - type - ) - ); pCoexDm->bCurPsTdmaOn = bTurnOn; pCoexDm->curPsTdma = type; if (!bForceExec) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], bPrePsTdmaOn = %d, bCurPsTdmaOn = %d!!\n", - pCoexDm->bPrePsTdmaOn, - pCoexDm->bCurPsTdmaOn - ) - ); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], prePsTdma = %d, curPsTdma = %d!!\n", - pCoexDm->prePsTdma, pCoexDm->curPsTdma - ) - ); - if ( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && (pCoexDm->prePsTdma == pCoexDm->curPsTdma) @@ -1505,8 +1131,6 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi non-connected idle!!\n")); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 1); @@ -1523,8 +1147,6 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT non connected-idle!!\n")); - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 1); @@ -1542,7 +1164,6 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) if (bBtHsOn) return false; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi connected + BT connected-idle!!\n")); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); @@ -1560,13 +1181,11 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); if (bWifiBusy) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Connected-Busy + BT Busy!!\n")); bCommon = false; } else { if (bBtHsOn) return false; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Wifi Connected-Idle + BT Busy!!\n")); btRssiState = halbtc8723b2ant_BtRssiState(2, 29, 0); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); @@ -1598,11 +1217,8 @@ static void halbtc8723b2ant_TdmaDurationAdjust( s32 result; /* 0: no change, +1: increase WiFi duration, -1: decrease WiFi duration */ u8 retryCount = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], TdmaDurationAdjust()\n")); - if (!pCoexDm->bAutoTdmaAdjust) { pCoexDm->bAutoTdmaAdjust = true; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], first run TdmaDurationAdjust()!!\n")); { if (bScoHid) { if (bTxPause) { @@ -1648,15 +1264,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( } else { /* acquire the BT TRx retry count from BT_Info byte2 */ retryCount = pCoexSta->btRetryCnt; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], up =%d, dn =%d, m =%d, n =%d, WaitCount =%d\n", - up, dn, m, n, WaitCount - ) - ); result = 0; WaitCount++; @@ -1673,7 +1280,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( up = 0; dn = 0; result = 1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Increase wifi duration!!\n")); } } else if (retryCount <= 3) { /* <=3 retry in the last 2-second duration */ up--; @@ -1696,7 +1302,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n")); } } else { /* retry count > 3, 只要1次 retry count > 3, 則調窄WiFi duration */ if (WaitCount == 1) @@ -1712,14 +1317,10 @@ static void halbtc8723b2ant_TdmaDurationAdjust( dn = 0; WaitCount = 0; result = -1; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], Decrease wifi duration for retryCounter>3!!\n")); } - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], max Interval = %d\n", maxInterval)); if (maxInterval == 1) { if (bTxPause) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); - if (pCoexDm->curPsTdma == 71) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(5); else if (pCoexDm->curPsTdma == 1) @@ -1768,7 +1369,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(13); } } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); if (pCoexDm->curPsTdma == 5) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(71); else if (pCoexDm->curPsTdma == 6) @@ -1821,7 +1421,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( } } else if (maxInterval == 2) { if (bTxPause) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); if (pCoexDm->curPsTdma == 1) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(6); else if (pCoexDm->curPsTdma == 2) @@ -1868,7 +1467,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(14); } } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); if (pCoexDm->curPsTdma == 5) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(2); else if (pCoexDm->curPsTdma == 6) @@ -1917,7 +1515,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( } } else if (maxInterval == 3) { if (bTxPause) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 1\n")); if (pCoexDm->curPsTdma == 1) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(7); else if (pCoexDm->curPsTdma == 2) @@ -1964,7 +1561,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(15); } } else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], TxPause = 0\n")); if (pCoexDm->curPsTdma == 5) HAL_BTC8723B2ANT_DMA_DURATION_ADJUST(3); else if (pCoexDm->curPsTdma == 6) @@ -2018,15 +1614,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( /* then we have to adjust it back to the previous record one. */ if (pCoexDm->curPsTdma != pCoexDm->psTdmaDuAdjType) { bool bScan = false, bLink = false, bRoam = false; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_DETAIL, - ( - "[BTCoex], PsTdma type mismatch!!!, curPsTdma =%d, recordPsTdma =%d\n", - pCoexDm->curPsTdma, - pCoexDm->psTdmaDuAdjType - ) - ); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); @@ -2035,7 +1622,6 @@ static void halbtc8723b2ant_TdmaDurationAdjust( if (!bScan && !bLink && !bRoam) halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType); else { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], roaming/link/scan is under progress, will adjust next time!!!\n")); } } } @@ -2660,21 +2246,16 @@ static void halbtc8723b2ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) { u8 algorithm = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism() ===>\n")); - if (pBtCoexist->bManualControl) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], RunCoexistMechanism(), return for Manual CTRL <===\n")); return; } if (pCoexSta->bUnderIps) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi is under IPS !!!\n")); return; } algorithm = halbtc8723b2ant_ActionAlgorithm(pBtCoexist); if (pCoexSta->bC2hBtInquiryPage && (BT_8723B_2ANT_COEX_ALGO_PANHS != algorithm)) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT is under inquiry/page scan !!\n")); halbtc8723b2ant_ActionBtInquiry(pBtCoexist); return; } else { @@ -2685,69 +2266,47 @@ static void halbtc8723b2ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) } pCoexDm->curAlgorithm = algorithm; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Algorithm = %d\n", pCoexDm->curAlgorithm)); if (halbtc8723b2ant_IsCommonAction(pBtCoexist)) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant common.\n")); pCoexDm->bAutoTdmaAdjust = false; } else { if (pCoexDm->curAlgorithm != pCoexDm->preAlgorithm) { - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE, - ( - "[BTCoex], preAlgorithm =%d, curAlgorithm =%d\n", - pCoexDm->preAlgorithm, - pCoexDm->curAlgorithm - ) - ); pCoexDm->bAutoTdmaAdjust = false; } switch (pCoexDm->curAlgorithm) { case BT_8723B_2ANT_COEX_ALGO_SCO: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = SCO.\n")); halbtc8723b2ant_ActionSco(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID.\n")); halbtc8723b2ant_ActionHid(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP.\n")); halbtc8723b2ant_ActionA2dp(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP+PAN(HS).\n")); halbtc8723b2ant_ActionA2dpPanHs(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR).\n")); halbtc8723b2ant_ActionPanEdr(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_PANHS: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HS mode.\n")); halbtc8723b2ant_ActionPanHs(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN+A2DP.\n")); halbtc8723b2ant_ActionPanEdrA2dp(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_PANEDR_HID: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN(EDR)+HID.\n")); halbtc8723b2ant_ActionPanEdrHid(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP+PAN.\n")); halbtc8723b2ant_ActionHidA2dpPanEdr(pBtCoexist); break; case BT_8723B_2ANT_COEX_ALGO_HID_A2DP: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP.\n")); halbtc8723b2ant_ActionHidA2dp(pBtCoexist); break; default: - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = coexist All Off!!\n")); halbtc8723b2ant_CoexAllOff(pBtCoexist); break; } @@ -2784,8 +2343,6 @@ static void halbtc8723b2ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bB { u8 u1Tmp = 0; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 2Ant Init HW Config!!\n")); - /* backup rf 0x1e value */ pCoexDm->btRf0x1eBackup = pBtCoexist->fBtcGetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff); @@ -2873,8 +2430,6 @@ void EXhalbtc8723b2ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOn void EXhalbtc8723b2ant_InitCoexDm(struct btc_coexist *pBtCoexist) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Coex Mechanism Init!!\n")); - halbtc8723b2ant_InitCoexDm(pBtCoexist); } @@ -3262,13 +2817,11 @@ void EXhalbtc8723b2ant_DisplayCoexInfo(struct btc_coexist *pBtCoexist) void EXhalbtc8723b2ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) { if (BTC_IPS_ENTER == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n")); pCoexSta->bUnderIps = true; halbtc8723b2ant_WifiOffHwCfg(pBtCoexist); halbtc8723b2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, true); halbtc8723b2ant_CoexAllOff(pBtCoexist); } else if (BTC_IPS_LEAVE == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n")); pCoexSta->bUnderIps = false; halbtc8723b2ant_InitHwConfig(pBtCoexist, false); halbtc8723b2ant_InitCoexDm(pBtCoexist); @@ -3279,10 +2832,8 @@ void EXhalbtc8723b2ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) void EXhalbtc8723b2ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) { if (BTC_LPS_ENABLE == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS ENABLE notify\n")); pCoexSta->bUnderLps = true; } else if (BTC_LPS_DISABLE == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS DISABLE notify\n")); pCoexSta->bUnderLps = false; } } @@ -3290,18 +2841,14 @@ void EXhalbtc8723b2ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) void EXhalbtc8723b2ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) { if (BTC_SCAN_START == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); } else if (BTC_SCAN_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); } } void EXhalbtc8723b2ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) { if (BTC_ASSOCIATE_START == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); } else if (BTC_ASSOCIATE_FINISH == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); } } @@ -3313,9 +2860,7 @@ void EXhalbtc8723b2ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type u8 apNum = 0; if (BTC_MEDIA_CONNECT == type) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n")); } else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n")); } /* only 2.4G we need to inform bt the chnl mask */ @@ -3339,22 +2884,12 @@ void EXhalbtc8723b2ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1]; pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2]; - BTC_PRINT( - BTC_MSG_ALGORITHM, - ALGO_TRACE_FW_EXEC, - ( - "[BTCoex], FW write 0x66 = 0x%x\n", - H2C_Parameter[0] << 16 | H2C_Parameter[1] << 8 | H2C_Parameter[2] - ) - ); - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); } void EXhalbtc8723b2ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 type) { if (type == BTC_PACKET_DHCP) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], DHCP Packet notify\n")); } } @@ -3375,21 +2910,17 @@ void EXhalbtc8723b2ant_BtInfoNotify( pCoexSta->btInfoC2hCnt[rspSource]++; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Bt info[%d], length =%d, hex data =[", rspSource, length)); for (i = 0; i < length; i++) { pCoexSta->btInfoC2h[rspSource][i] = tmpBuf[i]; if (i == 1) btInfo = tmpBuf[i]; if (i == length - 1) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x]\n", tmpBuf[i])); } else { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x, ", tmpBuf[i])); } } if (pBtCoexist->bManualControl) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), return for Manual CTRL<===\n")); return; } @@ -3404,14 +2935,12 @@ void EXhalbtc8723b2ant_BtInfoNotify( pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); if (pCoexSta->bBtTxRxMask) { /* BT into is responded by BT FW and BT RF REG 0x3C != 0x01 => Need to switch BT TRx Mask */ - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Switch BT TRx Mask since BT RF REG 0x3C != 0x01\n")); pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x01); } /* Here we need to resend some wifi info to BT */ /* because bt is reset and loss of the info. */ if ((pCoexSta->btInfoExt & BIT1)) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT ext info bit1 check, send wifi BW&Chnl to BT!!\n")); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if (bWifiConnected) @@ -3421,7 +2950,6 @@ void EXhalbtc8723b2ant_BtInfoNotify( } if ((pCoexSta->btInfoExt & BIT3)) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT ext info bit3 check, set BT NOT to ignore Wlan active!!\n")); halbtc8723b2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false); } else { /* BT already NOT ignore Wlan active, do nothing here. */ @@ -3465,22 +2993,17 @@ void EXhalbtc8723b2ant_BtInfoNotify( if (!(btInfo & BT_INFO_8723B_2ANT_B_CONNECTION)) { pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Non-Connected idle!!!\n")); } else if (btInfo == BT_INFO_8723B_2ANT_B_CONNECTION) { /* connection exists but no busy */ pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Connected-idle!!!\n")); } else if ( (btInfo & BT_INFO_8723B_2ANT_B_SCO_ESCO) || (btInfo & BT_INFO_8723B_2ANT_B_SCO_BUSY) ) { pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_SCO_BUSY; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT SCO busy!!!\n")); } else if (btInfo & BT_INFO_8723B_2ANT_B_ACL_BUSY) { pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_ACL_BUSY; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT ACL busy!!!\n")); } else { pCoexDm->btStatus = BT_8723B_2ANT_BT_STATUS_MAX; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BtInfoNotify(), BT Non-Defined state!!!\n")); } if ( @@ -3505,8 +3028,6 @@ void EXhalbtc8723b2ant_BtInfoNotify( void EXhalbtc8723b2ant_HaltNotify(struct btc_coexist *pBtCoexist) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n")); - halbtc8723b2ant_WifiOffHwCfg(pBtCoexist); pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT goto standby while GNT_BT 1-->0 */ halbtc8723b2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, true); @@ -3516,12 +3037,8 @@ void EXhalbtc8723b2ant_HaltNotify(struct btc_coexist *pBtCoexist) void EXhalbtc8723b2ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify\n")); - if (BTC_WIFI_PNP_SLEEP == pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to SLEEP\n")); } else if (BTC_WIFI_PNP_WAKE_UP == pnpState) { - BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Pnp notify to WAKE UP\n")); halbtc8723b2ant_InitHwConfig(pBtCoexist, false); halbtc8723b2ant_InitCoexDm(pBtCoexist); halbtc8723b2ant_QueryBtInfo(pBtCoexist); @@ -3533,16 +3050,10 @@ void EXhalbtc8723b2ant_Periodical(struct btc_coexist *pBtCoexist) static u8 disVerInfoCnt; u32 fwVer = 0, btPatchVer = 0; - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ==========================Periodical ===========================\n")); - if (disVerInfoCnt <= 5) { disVerInfoCnt += 1; - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], CoexVer/ FwVer/ PatchVer = %d_%x/ 0x%x/ 0x%x(%d)\n", \ - GLCoexVerDate8723b2Ant, GLCoexVer8723b2Ant, fwVer, btPatchVer, btPatchVer)); - BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], ****************************************************************\n")); } if ( diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index 5802ed4c6f82..30d763b48349 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -131,9 +131,6 @@ static void halbtcoutsrc_NormalLps(struct btc_coexist *pBtCoexist) { struct adapter *padapter; - - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Normal LPS behavior!!!\n")); - padapter = pBtCoexist->Adapter; if (pBtCoexist->btInfo.bBtCtrlLps) { @@ -1481,10 +1478,6 @@ u32 hal_btcoex_GetRaMask(struct adapter *padapter) void hal_btcoex_RecordPwrMode(struct adapter *padapter, u8 *pCmdBuf, u8 cmdLen) { - BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write pwrModeCmd = 0x%04x%08x\n", - pCmdBuf[0] << 8 | pCmdBuf[1], - pCmdBuf[2] << 24 | pCmdBuf[3] << 16 | pCmdBuf[4] << 8 | pCmdBuf[5])); - memcpy(GLBtCoexist.pwrModeVal, pCmdBuf, cmdLen); } From fda6c767fbd975094eda0ca1bd38792d2e408cd0 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:43 +0200 Subject: [PATCH 144/744] staging: rtl8723bs: remove empty if-else blocks after BTC_PRINT removal remove if-else blocks left empty after BTC_PRINT removal. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/102455368fa9535dc78584d7d24cd12ee4160737.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 16 +--------------- drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 12 +----------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c index 28f41a637c96..57579d7eab71 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c @@ -606,8 +606,7 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist ) { - if (bBtHsOn) { - } else { + if (!bBtHsOn) { algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; } } @@ -1063,10 +1062,6 @@ static void halbtc8723b1ant_PsTdma( pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - if (pCoexDm->bCurPsTdmaOn) { - } else { - } - if (!bForceExec) { if ( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && @@ -1373,10 +1368,6 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) bCommon = true; } else { - if (bWifiBusy) { - } else { - } - bCommon = false; } @@ -1528,7 +1519,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 1); pCoexDm->psTdmaDuAdjType = 1; } - } else { /* no change */ } if ( @@ -3012,10 +3002,6 @@ void EXhalbtc8723b1ant_BtInfoNotify( pCoexSta->btInfoC2h[rspSource][i] = tmpBuf[i]; if (i == 1) btInfo = tmpBuf[i]; - if (i == length - 1) - {} - else - {} } if (BT_INFO_SRC_8723B_1ANT_WIFI_FW != rspSource) { diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c index 73f1cc6bc27c..15304feb2442 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c @@ -1621,8 +1621,7 @@ static void halbtc8723b2ant_TdmaDurationAdjust( if (!bScan && !bLink && !bRoam) halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType); - else { - } + } } @@ -2859,10 +2858,6 @@ void EXhalbtc8723b2ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type u8 wifiCentralChnl; u8 apNum = 0; - if (BTC_MEDIA_CONNECT == type) { - } else { - } - /* only 2.4G we need to inform bt the chnl mask */ pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl); if ((BTC_MEDIA_CONNECT == type) && (wifiCentralChnl <= 14)) { @@ -2889,8 +2884,6 @@ void EXhalbtc8723b2ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type void EXhalbtc8723b2ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 type) { - if (type == BTC_PACKET_DHCP) { - } } void EXhalbtc8723b2ant_BtInfoNotify( @@ -2915,9 +2908,6 @@ void EXhalbtc8723b2ant_BtInfoNotify( if (i == 1) btInfo = tmpBuf[i]; - if (i == length - 1) { - } else { - } } if (pBtCoexist->bManualControl) { From ec0e82b45f744424c8921d6351639c2dea710b54 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:44 +0200 Subject: [PATCH 145/744] staging: rtl8723bs: remove braces around single statement in if block fix following post-commit hook checkatch issue: WARNING: braces {} are not necessary for single statement blocks 21: FILE: drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c:609: + if (!bBtHsOn) { algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; } Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/1c95d3d0d4ccd74d4e97ee496f7a04eadd1f8ff0.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c index 57579d7eab71..911d753e51f6 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c @@ -606,9 +606,9 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist ) { - if (!bBtHsOn) { + if (!bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; - } + } } } From f003ab00a5a4c57741e1472a613be95343e548ad Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:45 +0200 Subject: [PATCH 146/744] staging: rtl8723bs: remove commented out BTC_PRINT logs remove commented out BTC_PRINT logs. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/dd6ea6b65cb7db15254ac6ab3fbdfcabb7e66a1a.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c index 911d753e51f6..300327f8706c 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c @@ -1055,8 +1055,6 @@ static void halbtc8723b1ant_PsTdma( s8 nWiFiDurationAdjust = 0x0; /* u32 fwVer = 0; */ - /* BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn %s PS TDMA, type =%d\n", */ - /* (bForceExec? "force to":""), (bTurnOn? "ON":"OFF"), type)); */ pCoexDm->bCurPsTdmaOn = bTurnOn; pCoexDm->curPsTdma = type; @@ -1423,9 +1421,6 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( /* acquire the BT TRx retry count from BT_Info byte2 */ retryCount = pCoexSta->btRetryCnt; btInfoExt = pCoexSta->btInfoExt; - /* BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], retryCount = %d\n", retryCount)); */ - /* BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], up =%d, dn =%d, m =%d, n =%d, WaitCount =%d\n", */ - /* up, dn, m, n, WaitCount)); */ if (pCoexSta->lowPriorityTx > 1050 || pCoexSta->lowPriorityRx > 1250) retryCount++; @@ -2788,13 +2783,11 @@ void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) } if (BTC_SCAN_START == type) { - /* BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n")); */ if (!bWifiConnected) /* non-connected scan */ halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist); else /* wifi is connected */ halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist); } else if (BTC_SCAN_FINISH == type) { - /* BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n")); */ if (!bWifiConnected) /* non-connected scan */ halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); else @@ -2844,11 +2837,8 @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) } if (BTC_ASSOCIATE_START == type) { - /* BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n")); */ halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); } else if (BTC_ASSOCIATE_FINISH == type) { - /* BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n")); */ - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if (!bWifiConnected) /* non-connected scan */ halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); From 698a405f08e6adff8815d8bb8876c6c1ca339122 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:46 +0200 Subject: [PATCH 147/744] staging: rtl8723bs: remove BTC_PRINT macro definitions remove unused BTC_PRINT macro definitions. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/0f0129063880553001a2c1d8272d10079abc7132.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h index 7b2d94a33d9c..ad19ffc2de57 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +++ b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h @@ -114,12 +114,6 @@ extern u32 GLBtcDbgType[]; /* The following is for dbgview print */ #if DBG -#define BTC_PRINT(dbgtype, dbgflag, printstr)\ -{\ - if (GLBtcDbgType[dbgtype] & dbgflag)\ - DbgPrint printstr;\ -} - #define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)\ {\ if (GLBtcDbgType[dbgtype] & dbgflag) {\ @@ -149,7 +143,6 @@ extern u32 GLBtcDbgType[]; } #else -#define BTC_PRINT(dbgtype, dbgflag, printstr) no_printk printstr #define BTC_PRINT_F(dbgtype, dbgflag, printstr) no_printk printstr #define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) no_printk printstr #define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen) \ From 1bd9ebfd7d1309125382358c4678f6c7e11a95ac Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:47 +0200 Subject: [PATCH 148/744] staging: rtl8723bs: remove BTC_PRINT_ADDR macro definitions remove unused BTC_PRINT_ADDR macro definitions. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/31af3e56cfd52f2797499d3beb38741bddaff65d.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h index ad19ffc2de57..00705305305b 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +++ b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h @@ -114,19 +114,6 @@ extern u32 GLBtcDbgType[]; /* The following is for dbgview print */ #if DBG -#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)\ -{\ - if (GLBtcDbgType[dbgtype] & dbgflag) {\ - int __i;\ - u8 *ptr = (u8 *)_Ptr;\ - DbgPrint printstr;\ - DbgPrint(" ");\ - for (__i = 0; __i < 6; __i++)\ - DbgPrint("%02X%s", ptr[__i], (__i == 5) ? "" : "-");\ - DbgPrint("\n");\ - } \ -} - #define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\ {\ if (GLBtcDbgType[dbgtype] & dbgflag) {\ @@ -144,7 +131,6 @@ extern u32 GLBtcDbgType[]; #else #define BTC_PRINT_F(dbgtype, dbgflag, printstr) no_printk printstr -#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) no_printk printstr #define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen) \ no_printk("%s %p %zu", _TitleString, _HexData, _HexDataLen) #endif From 2875b3bf04454bd8aa130debf1115519e47a7503 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:48 +0200 Subject: [PATCH 149/744] staging: rtl8723bs: remove BTC_PRINT_DATA definitions remove unused BTC_PRINT_DATA definitions. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/0b83b96133af86e73bed64d7fe35ea96b2940208.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h index 00705305305b..36636ad62aac 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +++ b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h @@ -114,25 +114,8 @@ extern u32 GLBtcDbgType[]; /* The following is for dbgview print */ #if DBG -#define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\ -{\ - if (GLBtcDbgType[dbgtype] & dbgflag) {\ - int __i;\ - u8 *ptr = (u8 *)_HexData;\ - DbgPrint(_TitleString);\ - for (__i = 0; __i < (int)_HexDataLen; __i++) {\ - DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? " " : " ");\ - if (((__i + 1) % 16) == 0)\ - DbgPrint("\n");\ - } \ - DbgPrint("\n");\ - } \ -} - #else #define BTC_PRINT_F(dbgtype, dbgflag, printstr) no_printk printstr -#define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen) \ - no_printk("%s %p %zu", _TitleString, _HexData, _HexDataLen) #endif struct btc_board_info { From 87c596b03be78aba52c3502b83be0db520213894 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:49 +0200 Subject: [PATCH 150/744] staging: rtl8723bs: remove BTC_PRINT_F macro definition remove unused BTC_PRINT_F macro definition. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/503423caee1cc2b7a8fe321e0efb546556f2887f.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h index 36636ad62aac..9c9ad29870e2 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +++ b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h @@ -115,7 +115,6 @@ extern u32 GLBtcDbgType[]; /* The following is for dbgview print */ #if DBG #else -#define BTC_PRINT_F(dbgtype, dbgflag, printstr) no_printk printstr #endif struct btc_board_info { From ad91b3d47b6fb2a78f02f83f93cef66900a4a9a3 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:50 +0200 Subject: [PATCH 151/744] staging: rtl8723bs: remove empty #ifdef block remove empty #ifdef block. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/9a2095cfd69647dd304eb9e059a6aa9aa00694e6.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h index 9c9ad29870e2..f2793d5d9a30 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +++ b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h @@ -112,11 +112,6 @@ extern u32 GLBtcDbgType[]; #define CL_SPRINTF snprintf #define CL_PRINTF DCMD_Printf -/* The following is for dbgview print */ -#if DBG -#else -#endif - struct btc_board_info { /* The following is some board information */ u8 btChipType; From 2732143564295b569ee7beeda6fb08c765bad985 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:51 +0200 Subject: [PATCH 152/744] staging: rtl8723bs: remove unsed hal_btcoex_SetDBG() function remove unused hal_btcoex_SetDBG() function definition and prototype. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/4f8aa4e4312777aff1aea621d26c00e81754025a.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 12 ------------ drivers/staging/rtl8723bs/include/hal_btcoex.h | 1 - 2 files changed, 13 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index 30d763b48349..cac2d6077403 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -1492,18 +1492,6 @@ void hal_btcoex_DisplayBtCoexInfo(struct adapter *padapter, u8 *pbuf, u32 bufsiz DBG_BT_INFO_INIT(pinfo, NULL, 0); } -void hal_btcoex_SetDBG(struct adapter *padapter, u32 *pDbgModule) -{ - u32 i; - - - if (!pDbgModule) - return; - - for (i = 0; i < BTC_MSG_MAX; i++) - GLBtcDbgType[i] = pDbgModule[i]; -} - u32 hal_btcoex_GetDBG(struct adapter *padapter, u8 *pStrBuf, u32 bufSize) { s32 count; diff --git a/drivers/staging/rtl8723bs/include/hal_btcoex.h b/drivers/staging/rtl8723bs/include/hal_btcoex.h index 3c03be210d87..9048499e756a 100644 --- a/drivers/staging/rtl8723bs/include/hal_btcoex.h +++ b/drivers/staging/rtl8723bs/include/hal_btcoex.h @@ -53,7 +53,6 @@ u8 hal_btcoex_LpsVal(struct adapter *); u32 hal_btcoex_GetRaMask(struct adapter *); void hal_btcoex_RecordPwrMode(struct adapter *padapter, u8 *pCmdBuf, u8 cmdLen); void hal_btcoex_DisplayBtCoexInfo(struct adapter *, u8 *pbuf, u32 bufsize); -void hal_btcoex_SetDBG(struct adapter *, u32 *pDbgModule); u32 hal_btcoex_GetDBG(struct adapter *, u8 *pStrBuf, u32 bufSize); #endif /* !__HAL_BTCOEX_H__ */ From c8fc131b499468c87fd7c6aea4d7514d114aaba5 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:52 +0200 Subject: [PATCH 153/744] staging: rtl8723bs: remove hal_btcoex_GetDBG() function remove unused hal_btcoex_GetDBG() function definition and prototype. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/8b06dc12a65ef15f3e67bd32d097dc4db3f78586.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 123 ------------------ .../staging/rtl8723bs/include/hal_btcoex.h | 1 - 2 files changed, 124 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index cac2d6077403..02d9997094f2 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -1492,126 +1492,3 @@ void hal_btcoex_DisplayBtCoexInfo(struct adapter *padapter, u8 *pbuf, u32 bufsiz DBG_BT_INFO_INIT(pinfo, NULL, 0); } -u32 hal_btcoex_GetDBG(struct adapter *padapter, u8 *pStrBuf, u32 bufSize) -{ - s32 count; - u8 *pstr; - u32 leftSize; - - - if (!pStrBuf || bufSize == 0) - return 0; - - pstr = pStrBuf; - leftSize = bufSize; - - count = rtw_sprintf(pstr, leftSize, "#define DBG\t%d\n", DBG); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - - count = rtw_sprintf(pstr, leftSize, "BTCOEX Debug Setting:\n"); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - - count = rtw_sprintf(pstr, leftSize, - "INTERFACE / ALGORITHM: 0x%08X / 0x%08X\n\n", - GLBtcDbgType[BTC_MSG_INTERFACE], - GLBtcDbgType[BTC_MSG_ALGORITHM]); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - - count = rtw_sprintf(pstr, leftSize, "INTERFACE Debug Setting Definition:\n"); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[0]=%d for INTF_INIT\n", - (GLBtcDbgType[BTC_MSG_INTERFACE] & INTF_INIT) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[2]=%d for INTF_NOTIFY\n\n", - (GLBtcDbgType[BTC_MSG_INTERFACE] & INTF_NOTIFY) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - - count = rtw_sprintf(pstr, leftSize, "ALGORITHM Debug Setting Definition:\n"); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[0]=%d for BT_RSSI_STATE\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_BT_RSSI_STATE) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[1]=%d for WIFI_RSSI_STATE\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_WIFI_RSSI_STATE) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[2]=%d for BT_MONITOR\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_BT_MONITOR) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[3]=%d for TRACE\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[4]=%d for TRACE_FW\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[5]=%d for TRACE_FW_DETAIL\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW_DETAIL) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[6]=%d for TRACE_FW_EXEC\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_FW_EXEC) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[7]=%d for TRACE_SW\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[8]=%d for TRACE_SW_DETAIL\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW_DETAIL) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - count = rtw_sprintf(pstr, leftSize, "\tbit[9]=%d for TRACE_SW_EXEC\n", - (GLBtcDbgType[BTC_MSG_ALGORITHM] & ALGO_TRACE_SW_EXEC) ? 1 : 0); - if ((count < 0) || (count >= leftSize)) - goto exit; - pstr += count; - leftSize -= count; - -exit: - count = pstr - pStrBuf; - - return count; -} diff --git a/drivers/staging/rtl8723bs/include/hal_btcoex.h b/drivers/staging/rtl8723bs/include/hal_btcoex.h index 9048499e756a..eb9d0ba861a5 100644 --- a/drivers/staging/rtl8723bs/include/hal_btcoex.h +++ b/drivers/staging/rtl8723bs/include/hal_btcoex.h @@ -53,6 +53,5 @@ u8 hal_btcoex_LpsVal(struct adapter *); u32 hal_btcoex_GetRaMask(struct adapter *); void hal_btcoex_RecordPwrMode(struct adapter *padapter, u8 *pCmdBuf, u8 cmdLen); void hal_btcoex_DisplayBtCoexInfo(struct adapter *, u8 *pbuf, u32 bufsize); -u32 hal_btcoex_GetDBG(struct adapter *, u8 *pStrBuf, u32 bufSize); #endif /* !__HAL_BTCOEX_H__ */ From e7f0be6415a02b61585fe79be6e70521308e9ed1 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:53 +0200 Subject: [PATCH 154/744] staging: rtl8723bs: remove unnecessary halbtcoutsrc_DbgInit() function halbtcoutsrc_DbgInit() static function was intended for manual activation of private tracing facilities. So remove it. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/f6c4f680b2d0ee8850f97532ca76dd405c1d50c3.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index 02d9997094f2..fd26187a976a 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -75,32 +75,6 @@ static u8 halbtcoutsrc_IsBtCoexistAvailable(struct btc_coexist *pBtCoexist) return true; } -static void halbtcoutsrc_DbgInit(void) -{ - u8 i; - - for (i = 0; i < BTC_MSG_MAX; i++) - GLBtcDbgType[i] = 0; - - GLBtcDbgType[BTC_MSG_INTERFACE] = \ -/* INTF_INIT | */ -/* INTF_NOTIFY | */ - 0; - - GLBtcDbgType[BTC_MSG_ALGORITHM] = \ -/* ALGO_BT_RSSI_STATE | */ -/* ALGO_WIFI_RSSI_STATE | */ -/* ALGO_BT_MONITOR | */ -/* ALGO_TRACE | */ -/* ALGO_TRACE_FW | */ -/* ALGO_TRACE_FW_DETAIL | */ -/* ALGO_TRACE_FW_EXEC | */ -/* ALGO_TRACE_SW | */ -/* ALGO_TRACE_SW_DETAIL | */ -/* ALGO_TRACE_SW_EXEC | */ - 0; -} - static void halbtcoutsrc_LeaveLps(struct btc_coexist *pBtCoexist) { struct adapter *padapter; @@ -919,8 +893,6 @@ void hal_btcoex_Initialize(void *padapter) /* pBtCoexist->statistics.cntBind++; */ - halbtcoutsrc_DbgInit(); - pBtCoexist->chipInterface = BTC_INTF_SDIO; EXhalbtcoutsrc_BindBtCoexWithAdapter(padapter); From b0a21a60afb009bbd1b375418aa47b6ff958403f Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:54 +0200 Subject: [PATCH 155/744] staging: rtl8723bs: remove obsolete GLBtcDbgType array declarations remove obsolete GLBtcDbgType declarations for it was intended for private debug facilities. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/000825941048c41cc53a0cc675fae2b45b781aad.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 1 - drivers/staging/rtl8723bs/hal/hal_btcoex.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h index f2793d5d9a30..c5444f965699 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +++ b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h @@ -83,7 +83,6 @@ enum { BTC_MSG_ALGORITHM = 0x1, BTC_MSG_MAX }; -extern u32 GLBtcDbgType[]; /* following is for BTC_MSG_INTERFACE */ #define INTF_INIT BIT0 diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index fd26187a976a..da545c4eaac0 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -17,7 +17,6 @@ struct btc_coexist GLBtCoexist; static u8 GLBtcWiFiInScanState; static u8 GLBtcWiFiInIQKState; -u32 GLBtcDbgType[BTC_MSG_MAX]; static u8 GLBtcDbgBuf[BT_TMP_BUF_SIZE]; struct btcdbginfo { /* _btcoexdbginfo */ From f71c344766a38af1bce74a1b5317a44a9393d900 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:55 +0200 Subject: [PATCH 156/744] staging: rtl8723bs: remove unused enum remove unused enum. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/029a9639ef046e44defc59854d6bb9a86dd3db4f.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h index c5444f965699..c4616a69425d 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +++ b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h @@ -78,12 +78,6 @@ enum { BTC_CHIP_MAX }; -enum { - BTC_MSG_INTERFACE = 0x0, - BTC_MSG_ALGORITHM = 0x1, - BTC_MSG_MAX -}; - /* following is for BTC_MSG_INTERFACE */ #define INTF_INIT BIT0 #define INTF_NOTIFY BIT2 From 76c80b8931b02d5daeb0b3793410765e0f23ac88 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:56 +0200 Subject: [PATCH 157/744] staging: rtl8723bs: remove obsolete debug macros remove obsolete debug macros. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/a35b084444ca423ba3b8a212c38b974535a7048c.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h index c4616a69425d..db9d8a529877 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h +++ b/drivers/staging/rtl8723bs/hal/HalBtcOutSrc.h @@ -78,22 +78,6 @@ enum { BTC_CHIP_MAX }; -/* following is for BTC_MSG_INTERFACE */ -#define INTF_INIT BIT0 -#define INTF_NOTIFY BIT2 - -/* following is for BTC_ALGORITHM */ -#define ALGO_BT_RSSI_STATE BIT0 -#define ALGO_WIFI_RSSI_STATE BIT1 -#define ALGO_BT_MONITOR BIT2 -#define ALGO_TRACE BIT3 -#define ALGO_TRACE_FW BIT4 -#define ALGO_TRACE_FW_DETAIL BIT5 -#define ALGO_TRACE_FW_EXEC BIT6 -#define ALGO_TRACE_SW BIT7 -#define ALGO_TRACE_SW_DETAIL BIT8 -#define ALGO_TRACE_SW_EXEC BIT9 - /* following is for wifi link status */ #define WIFI_STA_CONNECTED BIT0 #define WIFI_AP_CONNECTED BIT1 From 2ce75c4f9ecb5ef8eb98fd42124a88269608ceba Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:57 +0200 Subject: [PATCH 158/744] staging: rtl8723bs: remove commented out DbgPrint logs remove commented out DbgPrint logs. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/63eb0244a9e25d5633d78b67fd5a0c61cb48d83e.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_efuse.c | 1 - drivers/staging/rtl8723bs/core/rtw_recv.c | 20 ------------------- .../staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 1 - drivers/staging/rtl8723bs/hal/odm_DIG.c | 1 - drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 12 ----------- drivers/staging/rtl8723bs/hal/odm_RTL8723B.c | 1 - drivers/staging/rtl8723bs/hal/sdio_halinit.c | 2 -- 7 files changed, 38 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_efuse.c b/drivers/staging/rtl8723bs/core/rtw_efuse.c index 1f22eb4a29fa..81457467461c 100644 --- a/drivers/staging/rtl8723bs/core/rtw_efuse.c +++ b/drivers/staging/rtl8723bs/core/rtw_efuse.c @@ -38,7 +38,6 @@ Efuse_Read1ByteFromFakeContent( { if (Offset >= EFUSE_MAX_HW_SIZE) return false; - /* DbgPrint("Read fake content, offset = %d\n", Offset); */ if (fakeEfuseBank == 0) *Value = fakeEfuseContent[Offset]; else diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c index c0689a4b7cb1..d4c1725718d9 100644 --- a/drivers/staging/rtl8723bs/core/rtw_recv.c +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c @@ -1644,16 +1644,10 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n /* Rx Reorder initialize condition. */ if (preorder_ctrl->indicate_seq == 0xFFFF) { preorder_ctrl->indicate_seq = seq_num; - - /* DbgPrint("check_indicate_seq, 1st->indicate_seq =%d\n", precvpriv->indicate_seq); */ } - /* DbgPrint("enter->check_indicate_seq(): IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */ - /* Drop out the packet which SeqNum is smaller than WinStart */ if (SN_LESS(seq_num, preorder_ctrl->indicate_seq)) { - /* DbgPrint("CheckRxTsIndicateSeq(): Packet Drop! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */ - return false; } @@ -1666,8 +1660,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF; } else if (SN_LESS(wend, seq_num)) { - /* DbgPrint("CheckRxTsIndicateSeq(): Window Shift! IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */ - /* boundary situation, when seq_num cross 0xFFF */ if (seq_num >= (wsize - 1)) preorder_ctrl->indicate_seq = seq_num + 1 - wsize; @@ -1676,8 +1668,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n pdbgpriv->dbg_rx_ampdu_window_shift_cnt++; } - /* DbgPrint("exit->check_indicate_seq(): IndicateSeq: %d, NewSeq: %d\n", precvpriv->indicate_seq, seq_num); */ - return true; } @@ -1689,8 +1679,6 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un union recv_frame *pnextrframe; struct rx_pkt_attrib *pnextattrib; - /* DbgPrint("+enqueue_reorder_recvframe()\n"); */ - /* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */ /* spin_lock(&ppending_recvframe_queue->lock); */ @@ -1711,8 +1699,6 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un else break; - /* DbgPrint("enqueue_reorder_recvframe():while\n"); */ - } @@ -1751,8 +1737,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor struct dvobj_priv *psdpriv = padapter->dvobj; struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; - /* DbgPrint("+recv_indicatepkts_in_order\n"); */ - /* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */ /* spin_lock(&ppending_recvframe_queue->lock); */ @@ -1796,7 +1780,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor /* Indicate packets */ /* indicate this recv_frame */ - /* DbgPrint("recv_indicatepkts_in_order, indicate_seq =%d, seq_num =%d\n", precvpriv->indicate_seq, pattrib->seq_num); */ if (!pattrib->amsdu) { if ((padapter->bDriverStopped == false) && (padapter->bSurpriseRemoved == false)) @@ -1819,8 +1802,6 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor break; } - /* DbgPrint("recv_indicatepkts_in_order():while\n"); */ - } /* spin_unlock(&ppending_recvframe_queue->lock); */ @@ -1890,7 +1871,6 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame * /* s3. Insert all packet into Reorder Queue to maintain its ordering. */ if (!enqueue_reorder_recvframe(preorder_ctrl, prframe)) { - /* DbgPrint("recv_indicatepkt_reorder, enqueue_reorder_recvframe fail!\n"); */ /* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */ /* return _FAIL; */ goto _err_exit; diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c index 15304feb2442..6822990bca7f 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c @@ -1756,7 +1756,6 @@ static void halbtc8723b2ant_ActionA2dp(struct btc_coexist *pBtCoexist) /* define the office environment */ if (apNum >= 10 && BTC_RSSI_HIGH(wifiRssiState1)) { - /* DbgPrint(" AP#>10(%d)\n", apNum); */ pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x0); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); diff --git a/drivers/staging/rtl8723bs/hal/odm_DIG.c b/drivers/staging/rtl8723bs/hal/odm_DIG.c index 4bb558426427..702bb065636a 100644 --- a/drivers/staging/rtl8723bs/hal/odm_DIG.c +++ b/drivers/staging/rtl8723bs/hal/odm_DIG.c @@ -152,7 +152,6 @@ void odm_SearchPwdBLowerBound(void *pDM_VOID, u8 IGI_target) else pDM_Odm->txEdcca0 = pDM_Odm->txEdcca0 + 1; } - /* DbgPrint("txEdcca1 = %d, txEdcca0 = %d\n", pDM_Odm->txEdcca1, pDM_Odm->txEdcca0); */ if (pDM_Odm->txEdcca1 > 5) { IGI = IGI-1; diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c index db703a3b1b25..179199993fa7 100644 --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c @@ -59,7 +59,6 @@ static u8 odm_EVMdbToPercentage(s8 Value) ret_val = Value; ret_val /= 2; - /* DbgPrint("Value =%d\n", Value); */ /* ODM_RT_DISP(FRX, RX_PHY_SQ, ("EVMdbToPercentage92C Value =%d / %x\n", ret_val, ret_val)); */ if (ret_val >= 0) @@ -141,7 +140,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( } - /* DbgPrint("cck SQ = %d\n", SQ); */ pPhyInfo->signal_quality = SQ; pPhyInfo->rx_mimo_signal_quality[ODM_RF_PATH_A] = SQ; pPhyInfo->rx_mimo_signal_quality[ODM_RF_PATH_B] = -1; @@ -231,9 +229,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( pPhyInfo->signal_strength = (u8)(odm_SignalScaleMapping(pDM_Odm, total_rssi /= rf_rx_num)); } } - - /* DbgPrint("isCCKrate = %d, pPhyInfo->rx_pwd_ba11 = %d, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a = 0x%x\n", */ - /* isCCKrate, pPhyInfo->rx_pwd_ba11, pPhyStaRpt->cck_agc_rpt_ofdm_cfosho_a); */ } static void odm_Process_RSSIForDM( @@ -285,8 +280,6 @@ static void odm_Process_RSSIForDM( pDM_Odm->RSSI_A = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A]; pDM_Odm->RSSI_B = 0; } else { - /* DbgPrint("pRfd->Status.rx_mimo_signal_strength[0] = %d, pRfd->Status.rx_mimo_signal_strength[1] = %d\n", */ - /* pRfd->Status.rx_mimo_signal_strength[0], pRfd->Status.rx_mimo_signal_strength[1]); */ pDM_Odm->RSSI_A = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_A]; pDM_Odm->RSSI_B = pPhyInfo->rx_mimo_signal_strength[ODM_RF_PATH_B]; @@ -376,11 +369,6 @@ static void odm_Process_RSSIForDM( pEntry->rssi_stat.UndecoratedSmoothedCCK = UndecoratedSmoothedCCK; pEntry->rssi_stat.UndecoratedSmoothedOFDM = UndecoratedSmoothedOFDM; pEntry->rssi_stat.UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB; - - /* DbgPrint("OFDM_pkt =%d, Weighting =%d\n", OFDM_pkt, Weighting); */ - /* DbgPrint("UndecoratedSmoothedOFDM =%d, UndecoratedSmoothedPWDB =%d, UndecoratedSmoothedCCK =%d\n", */ - /* UndecoratedSmoothedOFDM, UndecoratedSmoothedPWDB, UndecoratedSmoothedCCK); */ - } } diff --git a/drivers/staging/rtl8723bs/hal/odm_RTL8723B.c b/drivers/staging/rtl8723bs/hal/odm_RTL8723B.c index ecf0045fcad9..54518ea1be6b 100644 --- a/drivers/staging/rtl8723bs/hal/odm_RTL8723B.c +++ b/drivers/staging/rtl8723bs/hal/odm_RTL8723B.c @@ -29,7 +29,6 @@ s8 odm_CCKRSSI_8723B(u8 LNA_idx, u8 VGA_idx) break; default: /* rx_pwr_all = -53+(2*(31-VGA_idx)); */ - /* DbgPrint("wrong LNA index\n"); */ break; } diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c index fd060cf7bc57..a63f2f6bf7c1 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c @@ -791,8 +791,6 @@ static u32 rtl8723bs_hal_init(struct adapter *padapter) rtl8723b_InitHalDm(padapter); - /* DbgPrint("pHalData->DefaultTxPwrDbm = %d\n", pHalData->DefaultTxPwrDbm); */ - /* */ /* Update current Tx FIFO page status. */ /* */ From 367fce0d9e920957530cd5bfb5eb8db66f1f6f6c Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:58 +0200 Subject: [PATCH 159/744] staging: rtl8723bs: remove unused DbgPrint macro remove unused DbgPrint macro definition. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/00e9b407fa1a7c911295b2fec215d82f5da058f8.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index 5c4412bf6fbd..c6c62bed5f3c 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -86,7 +86,6 @@ #define ODM_COMP_INIT BIT31 /*------------------------Export Marco Definition---------------------------*/ - #define DbgPrint printk #define RT_DISP(dbgtype, dbgflag, printstr) void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); From 3a96d356b9fd264e48decbc4d0ea77d0e8b0ee3d Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:56:59 +0200 Subject: [PATCH 160/744] staging: rtl8723bs: remove commented out *RT_DISP logs remove commented out ODM_RT_DISP and RT_DISP logs. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/23b7764fc40e1b201952be79e94e0782cf33d546.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 7 ------- drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 2 -- 2 files changed, 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c index 179199993fa7..32f7eb952ca8 100644 --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c @@ -59,8 +59,6 @@ static u8 odm_EVMdbToPercentage(s8 Value) ret_val = Value; ret_val /= 2; - /* ODM_RT_DISP(FRX, RX_PHY_SQ, ("EVMdbToPercentage92C Value =%d / %x\n", ret_val, ret_val)); */ - if (ret_val >= 0) ret_val = 0; if (ret_val <= -33) @@ -166,7 +164,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( /* Translate DBM to percentage. */ RSSI = odm_QueryRxPwrPercentage(rx_pwr[i]); total_rssi += RSSI; - /* RT_DISP(FRX, RX_PHY_SS, ("RF-%d RXPWR =%x RSSI =%d\n", i, rx_pwr[i], RSSI)); */ pPhyInfo->rx_mimo_signal_strength[i] = (u8) RSSI; @@ -181,7 +178,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( rx_pwr_all = (((pPhyStaRpt->cck_sig_qual_ofdm_pwdb_all) >> 1)&0x7f)-110; PWDB_ALL_BT = PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all); - /* RT_DISP(FRX, RX_PHY_SS, ("PWDB_ALL =%d\n", PWDB_ALL)); */ pPhyInfo->rx_pwd_ba11 = PWDB_ALL; pPhyInfo->bt_rx_rssi_percentage = PWDB_ALL_BT; @@ -203,9 +199,6 @@ static void odm_RxPhyStatus92CSeries_Parsing( /* value to positive one, then the dbm value (which is supposed to be negative) is not correct anymore. */ EVM = odm_EVMdbToPercentage((pPhyStaRpt->stream_rxevm[i])); /* dbm */ - /* RT_DISP(FRX, RX_PHY_SQ, ("RXRATE =%x RXEVM =%x EVM =%s%d\n", */ - /* GET_RX_STATUS_DESC_RX_MCS(pDesc), pDrvInfo->rxevm[i], "%", EVM)); */ - /* if (pPktinfo->bPacketMatchBSSID) */ { if (i == ODM_RF_PATH_A) /* Fill value in RFD, Get the first spatial stream only */ diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index 385b2510087a..33942ab58772 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -1148,10 +1148,8 @@ static u16 hal_EfuseGetCurrentSize_BT(struct adapter *padapter, u8 bPseudoTest) retU2 = ((bank-1)*EFUSE_BT_REAL_BANK_CONTENT_LEN)+efuse_addr; if (bPseudoTest) { pEfuseHal->fakeBTEfuseUsedBytes = retU2; - /* RT_DISP(FEEPROM, EFUSE_PG, ("Hal_EfuseGetCurrentSize_BT92C(), already use %u bytes\n", pEfuseHal->fakeBTEfuseUsedBytes)); */ } else { pEfuseHal->BTEfuseUsedBytes = retU2; - /* RT_DISP(FEEPROM, EFUSE_PG, ("Hal_EfuseGetCurrentSize_BT92C(), already use %u bytes\n", pEfuseHal->BTEfuseUsedBytes)); */ } return retU2; From 603693d1cf878eb0b909c4af2897ac4e4aeb875c Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:57:00 +0200 Subject: [PATCH 161/744] staging: rtl8723bs: remove RT_DISP macro definition remove unused RT_DISP macro definition. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/8983c3077979830aec02427ed895507213b38f95.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index c6c62bed5f3c..c7c7865dd7e2 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -85,9 +85,6 @@ #define ODM_COMP_COMMON BIT30 #define ODM_COMP_INIT BIT31 -/*------------------------Export Marco Definition---------------------------*/ - #define RT_DISP(dbgtype, dbgflag, printstr) - void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); #endif /* __ODM_DBG_H__ */ From 4f7cffcfe49f4a7c6a6caae133920dcb069e5d8e Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:57:01 +0200 Subject: [PATCH 162/744] staging: rtl8723bs: remove ODM_InitDebugSetting() function remove ODM_InitDebugSetting() function. It was intended to initialize removed private debug system. So remove it. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/6a8524b780674d05f33977eb86878d95c7338a1a.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm.c | 2 -- drivers/staging/rtl8723bs/hal/odm_debug.c | 35 ----------------------- drivers/staging/rtl8723bs/hal/odm_debug.h | 2 -- 3 files changed, 39 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c index fcd3f97e7df5..45e4038530c0 100644 --- a/drivers/staging/rtl8723bs/hal/odm.c +++ b/drivers/staging/rtl8723bs/hal/odm.c @@ -290,8 +290,6 @@ static void odm_CommonInfoSelfInit(struct dm_odm_t *pDM_Odm) pDM_Odm->bCckHighPower = (bool) PHY_QueryBBReg(pDM_Odm->Adapter, ODM_REG(CCK_RPT_FORMAT, pDM_Odm), ODM_BIT(CCK_RPT_FORMAT, pDM_Odm)); pDM_Odm->RFPathRxEnable = (u8) PHY_QueryBBReg(pDM_Odm->Adapter, ODM_REG(BB_RX_PATH, pDM_Odm), ODM_BIT(BB_RX_PATH, pDM_Odm)); - ODM_InitDebugSetting(pDM_Odm); - pDM_Odm->TxRate = 0xFF; } diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.c b/drivers/staging/rtl8723bs/hal/odm_debug.c index b35451bcb437..1a2e367bb306 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.c +++ b/drivers/staging/rtl8723bs/hal/odm_debug.c @@ -7,38 +7,3 @@ #include "odm_precomp.h" -void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm) -{ - pDM_Odm->DebugLevel = ODM_DBG_LOUD; - - pDM_Odm->DebugComponents = -/* BB Functions */ -/* ODM_COMP_DIG | */ -/* ODM_COMP_RA_MASK | */ -/* ODM_COMP_DYNAMIC_TXPWR | */ -/* ODM_COMP_FA_CNT | */ -/* ODM_COMP_RSSI_MONITOR | */ -/* ODM_COMP_CCK_PD | */ -/* ODM_COMP_ANT_DIV | */ -/* ODM_COMP_PWR_SAVE | */ -/* ODM_COMP_PWR_TRAIN | */ -/* ODM_COMP_RATE_ADAPTIVE | */ -/* ODM_COMP_PATH_DIV | */ -/* ODM_COMP_DYNAMIC_PRICCA | */ -/* ODM_COMP_RXHP | */ -/* ODM_COMP_MP | */ -/* ODM_COMP_CFO_TRACKING | */ - -/* MAC Functions */ -/* ODM_COMP_EDCA_TURBO | */ -/* ODM_COMP_EARLY_MODE | */ -/* RF Functions */ -/* ODM_COMP_TX_PWR_TRACK | */ -/* ODM_COMP_RX_GAIN_TRACK | */ -/* ODM_COMP_CALIBRATION | */ -/* Common */ -/* ODM_COMP_COMMON | */ -/* ODM_COMP_INIT | */ -/* ODM_COMP_PSD | */ -0; -} diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h index c7c7865dd7e2..94011343f7e7 100644 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ b/drivers/staging/rtl8723bs/hal/odm_debug.h @@ -85,6 +85,4 @@ #define ODM_COMP_COMMON BIT30 #define ODM_COMP_INIT BIT31 -void ODM_InitDebugSetting(struct dm_odm_t *pDM_Odm); - #endif /* __ODM_DBG_H__ */ From 83147d899eb8ddbe963fde14efa898b3898b3f80 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:57:02 +0200 Subject: [PATCH 163/744] staging: rtl8723bs: remove empty hal/odm_debug.c file remove file left empty after function deletion. remove related target in Makefile. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/0bd6ce2da09a5e2a671dc4a53f1c2e7ba1a64066.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/Makefile | 1 - drivers/staging/rtl8723bs/hal/odm_debug.c | 9 --------- 2 files changed, 10 deletions(-) delete mode 100644 drivers/staging/rtl8723bs/hal/odm_debug.c diff --git a/drivers/staging/rtl8723bs/Makefile b/drivers/staging/rtl8723bs/Makefile index c40983496608..fe45200ff53c 100644 --- a/drivers/staging/rtl8723bs/Makefile +++ b/drivers/staging/rtl8723bs/Makefile @@ -28,7 +28,6 @@ r8723bs-y = \ hal/HalPwrSeqCmd.o \ hal/odm.o \ hal/odm_CfoTracking.o \ - hal/odm_debug.o \ hal/odm_DIG.o \ hal/odm_DynamicBBPowerSaving.o \ hal/odm_DynamicTxPower.o \ diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.c b/drivers/staging/rtl8723bs/hal/odm_debug.c deleted file mode 100644 index 1a2e367bb306..000000000000 --- a/drivers/staging/rtl8723bs/hal/odm_debug.c +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - ******************************************************************************/ - -#include "odm_precomp.h" - From ae75f934658c33772f809bc75e51499183283744 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:57:03 +0200 Subject: [PATCH 164/744] staging: rtl8723bs: remove member in dm_odm_t struct remove DebugComponent in dm_odm_t struct, remove private debug component tracing. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/313d08514d2105c826ef3c92555fa557def2b9c2.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/hal_com.c | 10 ---------- drivers/staging/rtl8723bs/hal/odm.c | 4 ---- drivers/staging/rtl8723bs/hal/odm.h | 1 - 3 files changed, 15 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c index 2c82282958e9..c236f6124e06 100644 --- a/drivers/staging/rtl8723bs/hal/hal_com.c +++ b/drivers/staging/rtl8723bs/hal/hal_com.c @@ -1087,13 +1087,6 @@ u8 SetHalDefVar( u8 bResult = _SUCCESS; switch (variable) { - case HW_DEF_FA_CNT_DUMP: - /* ODM_COMP_COMMON */ - if (*((u8 *)value)) - odm->DebugComponents |= (ODM_COMP_DIG | ODM_COMP_FA_CNT); - else - odm->DebugComponents &= ~(ODM_COMP_DIG | ODM_COMP_FA_CNT); - break; case HAL_DEF_DBG_RX_INFO_DUMP: if (odm->bLinked) { @@ -1177,9 +1170,6 @@ u8 GetHalDefVar( *((int *)value) = psta->rssi_stat.UndecoratedSmoothedPWDB; } break; - case HW_DEF_ODM_DBG_FLAG: - *((u64 *)value) = odm->DebugComponents; - break; case HW_DEF_ODM_DBG_LEVEL: *((u32 *)value) = odm->DebugLevel; break; diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c index 45e4038530c0..b867629a577b 100644 --- a/drivers/staging/rtl8723bs/hal/odm.c +++ b/drivers/staging/rtl8723bs/hal/odm.c @@ -1172,10 +1172,6 @@ void ODM_CmnInfoUpdate(struct dm_odm_t *pDM_Odm, u32 CmnInfo, u64 Value) pDM_Odm->RSSI_Min = (u8)Value; break; - case ODM_CMNINFO_DBG_COMP: - pDM_Odm->DebugComponents = Value; - break; - case ODM_CMNINFO_DBG_LEVEL: pDM_Odm->DebugLevel = (u32)Value; break; diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h index ba723ed7aa96..6b9865f5f283 100644 --- a/drivers/staging/rtl8723bs/hal/odm.h +++ b/drivers/staging/rtl8723bs/hal/odm.h @@ -709,7 +709,6 @@ struct dm_odm_t { /* DM_Out_Source_Dynamic_Mechanism_Structure */ enum phy_reg_pg_type PhyRegPgValueType; u8 PhyRegPgVersion; - u64 DebugComponents; u32 DebugLevel; u32 NumQryPhyStatusAll; /* CCK + OFDM */ From 1cad68fc834311bc8db937ec4d9400b141e97b7a Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:57:04 +0200 Subject: [PATCH 165/744] staging: rtl8723bs: remove DebugLevel member in dm_odm_t struct remove DebugLevel in dm_odm_t struct, remove private debug level tracing. remove unused variable as well to suppress compiler warning. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/ac4afb00f904511e0cbb23136f8e7a3e204ad7ed.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/hal_com.c | 4 ---- drivers/staging/rtl8723bs/hal/odm.c | 3 --- drivers/staging/rtl8723bs/hal/odm.h | 2 -- 3 files changed, 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c index c236f6124e06..7a88447f8294 100644 --- a/drivers/staging/rtl8723bs/hal/hal_com.c +++ b/drivers/staging/rtl8723bs/hal/hal_com.c @@ -1153,7 +1153,6 @@ u8 GetHalDefVar( ) { struct hal_com_data *hal_data = GET_HAL_DATA(adapter); - struct dm_odm_t *odm = &(hal_data->odmpriv); u8 bResult = _SUCCESS; switch (variable) { @@ -1170,9 +1169,6 @@ u8 GetHalDefVar( *((int *)value) = psta->rssi_stat.UndecoratedSmoothedPWDB; } break; - case HW_DEF_ODM_DBG_LEVEL: - *((u32 *)value) = odm->DebugLevel; - break; case HAL_DEF_DBG_DM_FUNC: *((u32 *)value) = hal_data->odmpriv.SupportAbility; break; diff --git a/drivers/staging/rtl8723bs/hal/odm.c b/drivers/staging/rtl8723bs/hal/odm.c index b867629a577b..fa275138c983 100644 --- a/drivers/staging/rtl8723bs/hal/odm.c +++ b/drivers/staging/rtl8723bs/hal/odm.c @@ -1172,9 +1172,6 @@ void ODM_CmnInfoUpdate(struct dm_odm_t *pDM_Odm, u32 CmnInfo, u64 Value) pDM_Odm->RSSI_Min = (u8)Value; break; - case ODM_CMNINFO_DBG_LEVEL: - pDM_Odm->DebugLevel = (u32)Value; - break; case ODM_CMNINFO_RA_THRESHOLD_HIGH: pDM_Odm->RateAdaptive.HighRSSIThresh = (u8)Value; break; diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h index 6b9865f5f283..950e7850bac2 100644 --- a/drivers/staging/rtl8723bs/hal/odm.h +++ b/drivers/staging/rtl8723bs/hal/odm.h @@ -709,8 +709,6 @@ struct dm_odm_t { /* DM_Out_Source_Dynamic_Mechanism_Structure */ enum phy_reg_pg_type PhyRegPgValueType; u8 PhyRegPgVersion; - u32 DebugLevel; - u32 NumQryPhyStatusAll; /* CCK + OFDM */ u32 LastNumQryPhyStatusAll; u32 RxPWDBAve; From 0d59ca5a7ed1195feacc99560f91004d334aa4a9 Mon Sep 17 00:00:00 2001 From: Fabio Aiuto Date: Fri, 30 Apr 2021 16:57:05 +0200 Subject: [PATCH 166/744] staging: rtl8723bs: remove odm_debug.h header file remove obsolete odm_debug.h header file. Reviewed-by: Dan Carpenter Signed-off-by: Fabio Aiuto Link: https://lore.kernel.org/r/58f3ed0c7706fdb33614d3e38ed802d56d77f0ec.1619794331.git.fabioaiuto83@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_debug.h | 88 --------------------- drivers/staging/rtl8723bs/hal/odm_precomp.h | 1 - 2 files changed, 89 deletions(-) delete mode 100644 drivers/staging/rtl8723bs/hal/odm_debug.h diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h deleted file mode 100644 index 94011343f7e7..000000000000 --- a/drivers/staging/rtl8723bs/hal/odm_debug.h +++ /dev/null @@ -1,88 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/****************************************************************************** - * - * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. - * - ******************************************************************************/ - -#ifndef __ODM_DBG_H__ -#define __ODM_DBG_H__ - - -/* */ -/* Define the debug levels */ -/* */ -/* 1. DBG_TRACE and DBG_LOUD are used for normal cases. */ -/* So that, they can help SW engineer to developed or trace states changed */ -/* and also help HW enginner to trace every operation to and from HW, */ -/* e.g IO, Tx, Rx. */ -/* */ -/* 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases, */ -/* which help us to debug SW or HW. */ -/* */ -/* */ -/* */ -/* Never used in a call to ODM_RT_TRACE()! */ -/* */ -#define ODM_DBG_OFF 1 - -/* */ -/* Fatal bug. */ -/* For example, Tx/Rx/IO locked up, OS hangs, memory access violation, */ -/* resource allocation failed, unexpected HW behavior, HW BUG and so on. */ -/* */ -#define ODM_DBG_SERIOUS 2 - -/* */ -/* Abnormal, rare, or unexpected cases. */ -/* For example, */ -/* IRP/Packet/OID canceled, */ -/* device suprisely unremoved and so on. */ -/* */ -#define ODM_DBG_WARNING 3 - -/* */ -/* Normal case with useful information about current SW or HW state. */ -/* For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status, */ -/* SW protocol state change, dynamic mechanism state change and so on. */ -/* */ -#define ODM_DBG_LOUD 4 - -/* */ -/* Normal case with detail execution flow or information. */ -/* */ -#define ODM_DBG_TRACE 5 - -/* */ -/* Define the tracing components */ -/* */ -/* */ -/* BB Functions */ -#define ODM_COMP_DIG BIT0 -#define ODM_COMP_RA_MASK BIT1 -#define ODM_COMP_DYNAMIC_TXPWR BIT2 -#define ODM_COMP_FA_CNT BIT3 -#define ODM_COMP_RSSI_MONITOR BIT4 -#define ODM_COMP_CCK_PD BIT5 -#define ODM_COMP_ANT_DIV BIT6 -#define ODM_COMP_PWR_SAVE BIT7 -#define ODM_COMP_PWR_TRAIN BIT8 -#define ODM_COMP_RATE_ADAPTIVE BIT9 -#define ODM_COMP_PATH_DIV BIT10 -#define ODM_COMP_PSD BIT11 -#define ODM_COMP_DYNAMIC_PRICCA BIT12 -#define ODM_COMP_RXHP BIT13 -#define ODM_COMP_MP BIT14 -#define ODM_COMP_CFO_TRACKING BIT15 -/* MAC Functions */ -#define ODM_COMP_EDCA_TURBO BIT16 -#define ODM_COMP_EARLY_MODE BIT17 -/* RF Functions */ -#define ODM_COMP_TX_PWR_TRACK BIT24 -#define ODM_COMP_RX_GAIN_TRACK BIT25 -#define ODM_COMP_CALIBRATION BIT26 -/* Common Functions */ -#define ODM_COMP_COMMON BIT30 -#define ODM_COMP_INIT BIT31 - -#endif /* __ODM_DBG_H__ */ diff --git a/drivers/staging/rtl8723bs/hal/odm_precomp.h b/drivers/staging/rtl8723bs/hal/odm_precomp.h index 440a549bffc7..5041c9535e9a 100644 --- a/drivers/staging/rtl8723bs/hal/odm_precomp.h +++ b/drivers/staging/rtl8723bs/hal/odm_precomp.h @@ -27,7 +27,6 @@ #include "odm.h" #include "odm_HWConfig.h" -#include "odm_debug.h" #include "odm_RegDefine11N.h" #include "odm_EdcaTurboCheck.h" #include "odm_DIG.h" From ec03c2104365ead0a33627c05e685093eed3eaef Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Mon, 3 May 2021 20:21:10 +0300 Subject: [PATCH 167/744] staging: fbtft: Rectify GPIO handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The infamous commit c440eee1a7a1 ("Staging: staging: fbtft: Switch to the GPIO descriptor interface") broke GPIO handling completely. It has already four commits to rectify and it seems not enough. In order to fix the mess here we: 1) Set default to "inactive" for all requested pins 2) Fix CS#, RD#, and WR# pins polarity since it's active low and GPIO descriptor interface takes it into consideration from the Device Tree or ACPI 3) Consolidate chip activation (CS# assertion) under default ->reset() callback To summarize the expectations about polarity for GPIOs: RD# Low WR# Low CS# Low RESET# Low DC or RS High RW High Data 0 .. 15 High See also Adafruit learning course [1] for the example of the schematics. While at it, drop unneeded NULL checks, since GPIO API is tolerant to that. [1]: https://learn.adafruit.com/adafruit-2-8-and-3-2-color-tft-touchscreen-breakout-v2/downloads Fixes: 92e3e884887c ("Staging: fbtft: Fix GPIO handling") Fixes: b918d1c27066 ("Staging: fbtft: Fix reset assertion when using gpio descriptor") Fixes: dbc4f989c878 ("Staging: fbtft: Fix probing of gpio descriptor") Fixes: c440eee1a7a1 ("Staging: fbtft: Switch to the gpio descriptor interface") Cc: Jan Sebastian Götte Cc: Nishad Kamdar Reviewed-by: Phil Reid Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20210503172114.27891-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/fbtft/fb_agm1264k-fl.c | 20 ++++++++++---------- drivers/staging/fbtft/fb_bd663474.c | 4 ---- drivers/staging/fbtft/fb_ili9163.c | 4 ---- drivers/staging/fbtft/fb_ili9320.c | 1 - drivers/staging/fbtft/fb_ili9325.c | 4 ---- drivers/staging/fbtft/fb_ili9340.c | 1 - drivers/staging/fbtft/fb_s6d1121.c | 4 ---- drivers/staging/fbtft/fb_sh1106.c | 1 - drivers/staging/fbtft/fb_ssd1289.c | 4 ---- drivers/staging/fbtft/fb_ssd1325.c | 2 -- drivers/staging/fbtft/fb_ssd1331.c | 6 ++---- drivers/staging/fbtft/fb_ssd1351.c | 1 - drivers/staging/fbtft/fb_upd161704.c | 4 ---- drivers/staging/fbtft/fb_watterott.c | 1 - drivers/staging/fbtft/fbtft-bus.c | 3 +-- drivers/staging/fbtft/fbtft-core.c | 13 ++++++------- drivers/staging/fbtft/fbtft-io.c | 12 ++++++------ 17 files changed, 25 insertions(+), 60 deletions(-) diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index eeeeec97ad27..b545c2ca80a4 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -84,9 +84,9 @@ static void reset(struct fbtft_par *par) dev_dbg(par->info->device, "%s()\n", __func__); - gpiod_set_value(par->gpio.reset, 0); - udelay(20); gpiod_set_value(par->gpio.reset, 1); + udelay(20); + gpiod_set_value(par->gpio.reset, 0); mdelay(120); } @@ -194,12 +194,12 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) /* select chip */ if (*buf) { /* cs1 */ - gpiod_set_value(par->CS0, 1); - gpiod_set_value(par->CS1, 0); - } else { - /* cs0 */ gpiod_set_value(par->CS0, 0); gpiod_set_value(par->CS1, 1); + } else { + /* cs0 */ + gpiod_set_value(par->CS0, 1); + gpiod_set_value(par->CS1, 0); } gpiod_set_value(par->RS, 0); /* RS->0 (command mode) */ @@ -397,8 +397,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) } kfree(convert_buf); - gpiod_set_value(par->CS0, 1); - gpiod_set_value(par->CS1, 1); + gpiod_set_value(par->CS0, 0); + gpiod_set_value(par->CS1, 0); return ret; } @@ -419,10 +419,10 @@ static int write(struct fbtft_par *par, void *buf, size_t len) for (i = 0; i < 8; ++i) gpiod_set_value(par->gpio.db[i], data & (1 << i)); /* set E */ - gpiod_set_value(par->EPIN, 1); + gpiod_set_value(par->EPIN, 0); udelay(5); /* unset E - write */ - gpiod_set_value(par->EPIN, 0); + gpiod_set_value(par->EPIN, 1); udelay(1); } diff --git a/drivers/staging/fbtft/fb_bd663474.c b/drivers/staging/fbtft/fb_bd663474.c index e2c7646588f8..1629c2c440a9 100644 --- a/drivers/staging/fbtft/fb_bd663474.c +++ b/drivers/staging/fbtft/fb_bd663474.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include "fbtft.h" @@ -24,9 +23,6 @@ static int init_display(struct fbtft_par *par) { - if (par->gpio.cs) - gpiod_set_value(par->gpio.cs, 0); /* Activate chip */ - par->fbtftops.reset(par); /* Initialization sequence from Lib_UTFT */ diff --git a/drivers/staging/fbtft/fb_ili9163.c b/drivers/staging/fbtft/fb_ili9163.c index 05648c3ffe47..6582a2c90aaf 100644 --- a/drivers/staging/fbtft/fb_ili9163.c +++ b/drivers/staging/fbtft/fb_ili9163.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include