staging: r8188eu: remove channel parameters from rtw_sitesurvey_cmd
authorMartin Kaiser <martin@kaiser.cx>
Mon, 5 Sep 2022 19:56:12 +0000 (21:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Sep 2022 07:51:48 +0000 (09:51 +0200)
The rtw_sitesurvey_cmd function may receive an array of channels in the
ch and ch_num parameters. All of the callers set ch = NULL and ch_num = 0.

Remove the two parameters from rtw_sitesurvey_cmd and the code to process
them.

Tested-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220905195612.81945-1-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_cmd.c
drivers/staging/r8188eu/core/rtw_ioctl_set.c
drivers/staging/r8188eu/core/rtw_mlme.c
drivers/staging/r8188eu/include/rtw_cmd.h
drivers/staging/r8188eu/os_dep/ioctl_linux.c

index d690337..4be8380 100644 (file)
@@ -287,8 +287,7 @@ post_process:
  *     ### NOTE:#### (!!!!)
  *     MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock
  */
-u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid, int ssid_num,
-       struct rtw_ieee80211_channel *ch, int ch_num)
+u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid, int ssid_num)
 {
        u8 res = _FAIL;
        struct cmd_obj          *ph2c;
@@ -330,17 +329,6 @@ u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid,
                }
        }
 
-       /* prepare channel list */
-       if (ch) {
-               int i;
-               for (i = 0; i < ch_num && i < RTW_CHANNEL_SCAN_AMOUNT; i++) {
-                       if (ch[i].hw_value && !(ch[i].flags & RTW_IEEE80211_CHAN_DISABLED)) {
-                               memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
-                               psurveyPara->ch_num++;
-                       }
-               }
-       }
-
        set_fwstate(pmlmepriv, _FW_UNDER_SURVEY);
 
        res = rtw_enqueue_cmd(pcmdpriv, ph2c);
index d859f2d..d163a1a 100644 (file)
@@ -41,7 +41,7 @@ u8 rtw_do_join(struct adapter *padapter)
                if (!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
                    pmlmepriv->to_roaming > 0) {
                        /*  submit site_survey_cmd */
-                       ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
+                       ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1);
                        if (ret != _SUCCESS)
                                pmlmepriv->to_join = false;
                } else {
@@ -87,7 +87,7 @@ u8 rtw_do_join(struct adapter *padapter)
                                /* we try to issue sitesurvey firstly */
                                if (!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
                                    pmlmepriv->to_roaming > 0) {
-                                       ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
+                                       ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1);
                                        if (ret != _SUCCESS)
                                                pmlmepriv->to_join = false;
                                } else {
@@ -358,7 +358,7 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s
 
                spin_lock_bh(&pmlmepriv->lock);
 
-               res = rtw_sitesurvey_cmd(padapter, pssid, ssid_max_num, NULL, 0);
+               res = rtw_sitesurvey_cmd(padapter, pssid, ssid_max_num);
 
                spin_unlock_bh(&pmlmepriv->lock);
        }
index d2ea265..2c80635 100644 (file)
@@ -743,7 +743,7 @@ void rtw_surveydone_event_callback(struct adapter   *adapter, u8 *pbuf)
                        } else {
                                if (rtw_to_roaming(adapter) != 0) {
                                        if (--pmlmepriv->to_roaming == 0 ||
-                                           rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1, NULL, 0) != _SUCCESS) {
+                                           rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1) != _SUCCESS) {
                                                rtw_set_roaming(adapter, 0);
                                                rtw_free_assoc_resources(adapter, 1);
                                                rtw_indicate_disconnect(adapter);
index 6b6d560..9a76aa8 100644 (file)
@@ -730,9 +730,7 @@ Result:
 #define H2C_CMD_OVERFLOW       0x06
 #define H2C_RESERVED           0x07
 
-u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid,
-                     int ssid_num, struct rtw_ieee80211_channel *ch,
-                     int ch_num);
+u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid, int ssid_num);
 u8 rtw_createbss_cmd(struct adapter  *padapter);
 u8 rtw_setstakey_cmd(struct adapter *padapter, u8 *psta, u8 unicast_key);
 u8 rtw_clearstakey_cmd(struct adapter *padapter, u8 *psta, u8 entry, u8 enqueue);
index d6b6021..2de2e1e 100644 (file)
@@ -1099,7 +1099,7 @@ static int rtw_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
 
                        spin_lock_bh(&pmlmepriv->lock);
 
-                       _status = rtw_sitesurvey_cmd(padapter, ssid, 1, NULL, 0);
+                       _status = rtw_sitesurvey_cmd(padapter, ssid, 1);
 
                        spin_unlock_bh(&pmlmepriv->lock);
                }