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 d690337ea74bd312679d3fc04c82966b8504a4a7..4be83807405c112ef6e1cafa6f6a5d948903e869 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 d859f2d8a0c8e7576ad1e28daa9902afa6632b3d..d163a1a256ed350f7c3ef23a13c992619f62dc86 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 d2ea2659d58e8b572a3f3c38efec42a8c1756ce8..2c80635b64787a29272cdf9f3a291ea41fe7dac5 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 6b6d560d71436edb359e1ee16c23c8737b6ec57d..9a76aa85de940b3815c2948281960a5fcdb87a3f 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 d6b6021a42505e3010620eb72b23efa177883930..2de2e1e32738a7569cba0fd82e71497a8d1e1c3c 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);
                }