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

staging: rtl8723au: rtw_set_802_11_infrastructure_mode23a(): Make it readable

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 52017955
...@@ -284,23 +284,22 @@ u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter, ...@@ -284,23 +284,22 @@ u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter,
{ {
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network; struct wlan_network *cur_network = &pmlmepriv->cur_network;
enum ndis_802_11_net_infra* pold_state = &cur_network->network.InfrastructureMode; enum ndis_802_11_net_infra* pold_state;
pold_state = &cur_network->network.InfrastructureMode;
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_notice_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_notice_,
("+rtw_set_802_11_infrastructure_mode23a: old =%d new =%d fw_state = 0x%08x\n", ("+rtw_set_802_11_infrastructure_mode23a: old =%d new =%d "
"fw_state = 0x%08x\n",
*pold_state, networktype, get_fwstate(pmlmepriv))); *pold_state, networktype, get_fwstate(pmlmepriv)));
if (*pold_state != networktype) if (*pold_state != networktype) {
{
spin_lock_bh(&pmlmepriv->lock); spin_lock_bh(&pmlmepriv->lock);
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_, (" change mode!")); RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
/* DBG_8723A("change mode, old_mode =%d, new_mode =%d, fw_state = 0x%x\n", *pold_state, networktype, get_fwstate(pmlmepriv)); */ (" change mode!"));
if (*pold_state == Ndis802_11APMode) if (*pold_state == Ndis802_11APMode) {
{
/* change to other mode from Ndis802_11APMode */ /* change to other mode from Ndis802_11APMode */
cur_network->join_res = -1; cur_network->join_res = -1;
...@@ -309,18 +308,21 @@ u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter, ...@@ -309,18 +308,21 @@ u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter,
#endif #endif
} }
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) ||(*pold_state == Ndis802_11IBSS)) if (check_fwstate(pmlmepriv, _FW_LINKED) ||
*pold_state == Ndis802_11IBSS)
rtw_disassoc_cmd23a(padapter, 0, true); rtw_disassoc_cmd23a(padapter, 0, true);
if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) || if (check_fwstate(pmlmepriv, _FW_LINKED) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
rtw_free_assoc_resources23a(padapter, 1); rtw_free_assoc_resources23a(padapter, 1);
if ((*pold_state == Ndis802_11Infrastructure) ||(*pold_state == Ndis802_11IBSS)) if (*pold_state == Ndis802_11Infrastructure ||
{ *pold_state == Ndis802_11IBSS) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED)) {
{ /* will clr Linked_state; before this function,
rtw_indicate_disconnect23a(padapter); /* will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not */ we must have chked whether issue
dis-assoc_cmd or not */
rtw_indicate_disconnect23a(padapter);
} }
} }
...@@ -344,7 +346,6 @@ u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter, ...@@ -344,7 +346,6 @@ u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter,
start_ap_mode23a(padapter); start_ap_mode23a(padapter);
/* rtw_indicate_connect23a(padapter); */ /* rtw_indicate_connect23a(padapter); */
#endif #endif
break; break;
case Ndis802_11AutoUnknown: case Ndis802_11AutoUnknown:
...@@ -354,14 +355,13 @@ u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter, ...@@ -354,14 +355,13 @@ u8 rtw_set_802_11_infrastructure_mode23a(struct rtw_adapter* padapter,
/* SecClearAllKeys(adapter); */ /* SecClearAllKeys(adapter); */
/* RT_TRACE(COMP_OID_SET, DBG_LOUD, ("set_infrastructure: fw_state:%x after changing mode\n", */ /* RT_TRACE(COMP_OID_SET, DBG_LOUD,
("set_infrastructure: fw_state:%x after changing mode\n", */
/* get_fwstate(pmlmepriv))); */ /* get_fwstate(pmlmepriv))); */
spin_unlock_bh(&pmlmepriv->lock); spin_unlock_bh(&pmlmepriv->lock);
} }
return true; return true;
} }
......
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