From: Jes Sorensen Date: Mon, 9 Jun 2014 13:16:36 +0000 (+0200) Subject: staging: rtl8723au: Make rtw_is_same_ibss23a() return bool X-Git-Tag: v3.17-rc1~123^2~2059 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ec36ce29ca8e935d747ec0eddfa813da9324ee6d;p=platform%2Fkernel%2Flinux-exynos.git staging: rtl8723au: Make rtw_is_same_ibss23a() return bool Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c index 1d2ea4e..8d76748 100644 --- a/drivers/staging/rtl8723au/core/rtw_ioctl_set.c +++ b/drivers/staging/rtl8723au/core/rtw_ioctl_set.c @@ -188,26 +188,38 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter, !memcmp(&pmlmepriv->assoc_ssid.ssid, ssid->ssid, ssid->ssid_len)) { if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { - RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, - ("Set SSID is the same ssid, fw_state = 0x%08x\n", - get_fwstate(pmlmepriv))); + RT_TRACE(_module_rtl871x_ioctl_set_c_, + _drv_err_, ("New SSID is same SSID, " + "fw_state = 0x%08x\n", + get_fwstate(pmlmepriv))); + + if (rtw_is_same_ibss23a(padapter, pnetwork)) { + /* + * it means driver is in + * WIFI_ADHOC_MASTER_STATE, we needn't + * create bss again. + */ + goto release_mlme_lock; + } - if (rtw_is_same_ibss23a(padapter, pnetwork) == false) - { - /* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */ - rtw_disassoc_cmd23a(padapter, 0, true); + /* + * if in WIFI_ADHOC_MASTER_STATE | + * WIFI_ADHOC_STATE, create bss or + * rejoin again + */ + rtw_disassoc_cmd23a(padapter, 0, true); - if (check_fwstate(pmlmepriv, _FW_LINKED)) - rtw_indicate_disconnect23a(padapter); + if (check_fwstate(pmlmepriv, _FW_LINKED)) + rtw_indicate_disconnect23a(padapter); - rtw_free_assoc_resources23a(padapter, 1); + rtw_free_assoc_resources23a(padapter, 1); - if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { - _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE); - set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); - } - } else { - goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */ + if (check_fwstate(pmlmepriv, + WIFI_ADHOC_MASTER_STATE)) { + _clr_fwstate_(pmlmepriv, + WIFI_ADHOC_MASTER_STATE); + set_fwstate(pmlmepriv, + WIFI_ADHOC_STATE); } } else { rtw_lps_ctrl_wk_cmd23a(padapter, LPS_CTRL_JOINBSS, 1); diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index bcc6893..2a0c43a 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -334,10 +334,10 @@ static void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, _rtw_free_network23a(pmlmepriv, pnetwork); } -int rtw_is_same_ibss23a(struct rtw_adapter *adapter, - struct wlan_network *pnetwork) +bool rtw_is_same_ibss23a(struct rtw_adapter *adapter, + struct wlan_network *pnetwork) { - int ret = true; + int ret; struct security_priv *psecuritypriv = &adapter->securitypriv; if (psecuritypriv->dot11PrivacyAlgrthm != 0 && diff --git a/drivers/staging/rtl8723au/include/rtw_mlme.h b/drivers/staging/rtl8723au/include/rtw_mlme.h index baac8da..c8e82bf 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme.h @@ -361,8 +361,8 @@ void rtw_update_ht_cap23a(struct rtw_adapter *padapter, void rtw_issue_addbareq_cmd23a(struct rtw_adapter *padapter, struct xmit_frame *pxmitframe); -int rtw_is_same_ibss23a(struct rtw_adapter *adapter, - struct wlan_network *pnetwork); +bool rtw_is_same_ibss23a(struct rtw_adapter *adapter, + struct wlan_network *pnetwork); int is_same_network23a(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst); void rtw23a_roaming(struct rtw_adapter *adapter,