Commit e73d82ef authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Pass a struct wlan_network to rtw_set_ssid()

There is no point copying the ssid out of struct wlan_network when we
can just pass on the whole struct.
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9cb08ff3
...@@ -1981,8 +1981,8 @@ static int rtw_cfg80211_add_wep(struct rtw_adapter *padapter, ...@@ -1981,8 +1981,8 @@ static int rtw_cfg80211_add_wep(struct rtw_adapter *padapter,
return res; return res;
} }
static int rtw_set_ssid(struct rtw_adapter* padapter, static int rtw_set_ssid(struct rtw_adapter *padapter,
struct cfg80211_ssid *ssid) struct wlan_network *newnetwork)
{ {
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *pnetwork = &pmlmepriv->cur_network; struct wlan_network *pnetwork = &pmlmepriv->cur_network;
...@@ -1990,7 +1990,7 @@ static int rtw_set_ssid(struct rtw_adapter* padapter, ...@@ -1990,7 +1990,7 @@ static int rtw_set_ssid(struct rtw_adapter* padapter,
u32 cur_time = 0; u32 cur_time = 0;
DBG_8723A_LEVEL(_drv_always_, "set ssid [%s] fw_state = 0x%08x\n", DBG_8723A_LEVEL(_drv_always_, "set ssid [%s] fw_state = 0x%08x\n",
ssid->ssid, get_fwstate(pmlmepriv)); newnetwork->network.Ssid.ssid, get_fwstate(pmlmepriv));
if (padapter->hw_init_completed == false) { if (padapter->hw_init_completed == false) {
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
...@@ -2011,9 +2011,11 @@ static int rtw_set_ssid(struct rtw_adapter* padapter, ...@@ -2011,9 +2011,11 @@ static int rtw_set_ssid(struct rtw_adapter* padapter,
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
("set_ssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); ("set_ssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n"));
if (pmlmepriv->assoc_ssid.ssid_len == ssid->ssid_len && if (pmlmepriv->assoc_ssid.ssid_len ==
!memcmp(&pmlmepriv->assoc_ssid.ssid, ssid->ssid, newnetwork->network.Ssid.ssid_len &&
ssid->ssid_len)) { !memcmp(&pmlmepriv->assoc_ssid.ssid,
newnetwork->network.Ssid.ssid,
newnetwork->network.Ssid.ssid_len)) {
if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
RT_TRACE(_module_rtl871x_ioctl_set_c_, RT_TRACE(_module_rtl871x_ioctl_set_c_,
_drv_err_, ("New SSID is same SSID, " _drv_err_, ("New SSID is same SSID, "
...@@ -2056,8 +2058,9 @@ static int rtw_set_ssid(struct rtw_adapter* padapter, ...@@ -2056,8 +2058,9 @@ static int rtw_set_ssid(struct rtw_adapter* padapter,
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
("Set SSID not the same ssid\n")); ("Set SSID not the same ssid\n"));
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
("set_ssid =[%s] len = 0x%x\n", ssid->ssid, ("set_ssid =[%s] len = 0x%x\n",
ssid->ssid_len)); newnetwork->network.Ssid.ssid,
newnetwork->network.Ssid.ssid_len));
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
("assoc_ssid =[%s] len = 0x%x\n", ("assoc_ssid =[%s] len = 0x%x\n",
pmlmepriv->assoc_ssid.ssid, pmlmepriv->assoc_ssid.ssid,
...@@ -2093,7 +2096,9 @@ static int rtw_set_ssid(struct rtw_adapter* padapter, ...@@ -2093,7 +2096,9 @@ static int rtw_set_ssid(struct rtw_adapter* padapter,
} }
} }
memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(struct cfg80211_ssid)); memcpy(&pmlmepriv->assoc_ssid, &newnetwork->network.Ssid,
sizeof(struct cfg80211_ssid));
pmlmepriv->assoc_by_bssid = false; pmlmepriv->assoc_by_bssid = false;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
...@@ -2117,7 +2122,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, ...@@ -2117,7 +2122,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
int ret = 0; int ret = 0;
struct list_head *phead, *plist, *ptmp; struct list_head *phead, *plist, *ptmp;
struct wlan_network *pnetwork = NULL; struct wlan_network *pnetwork = NULL;
struct cfg80211_ssid ssid;
/* u8 matched_by_bssid = false; */ /* u8 matched_by_bssid = false; */
/* u8 matched_by_ssid = false; */ /* u8 matched_by_ssid = false; */
u8 matched = false; u8 matched = false;
...@@ -2161,8 +2165,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, ...@@ -2161,8 +2165,6 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
rtw_scan_abort23a(padapter); rtw_scan_abort23a(padapter);
} }
memset(ssid.ssid, 0, sizeof(struct cfg80211_ssid));
spin_lock_bh(&queue->lock); spin_lock_bh(&queue->lock);
phead = get_list_head(queue); phead = get_list_head(queue);
...@@ -2315,11 +2317,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, ...@@ -2315,11 +2317,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
/* rtw_set_802_11_encryption_mode(padapter, /* rtw_set_802_11_encryption_mode(padapter,
padapter->securitypriv.ndisencryptstatus); */ padapter->securitypriv.ndisencryptstatus); */
memcpy(ssid.ssid, pnetwork->network.Ssid.ssid, if (rtw_set_ssid(padapter, pnetwork) != _SUCCESS) {
pnetwork->network.Ssid.ssid_len);
ssid.ssid_len = pnetwork->network.Ssid.ssid_len;
if (rtw_set_ssid(padapter, &ssid) != _SUCCESS) {
ret = -EBUSY; ret = -EBUSY;
goto exit; goto exit;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment