{
if (!bypasswmi)
{
- if (ar->arConnected == true || ar->arConnectPending == true)
- {
- AR_DEBUG_PRINTF(ATH_DEBUG_INFO,("%s(): Disconnect\n", __func__));
- if (!keepprofile) {
- AR6000_SPIN_LOCK(&ar->arLock, 0);
- ar6000_init_profile_info(ar);
- AR6000_SPIN_UNLOCK(&ar->arLock, 0);
- }
- wmi_disconnect_cmd(ar->arWmi);
+ bool disconnectIssued;
+
+ disconnectIssued = (ar->arConnected) || (ar->arConnectPending);
+ ar6000_disconnect(ar);
+ if (!keepprofile) {
+ ar6000_init_profile_info(ar);
}
A_UNTIMEOUT(&ar->disconnect_timer);
* Sometimes disconnect_event will be received when the debug logs
* are collected.
*/
- if (ar->arConnected == true || ar->arConnectPending == true) {
+ if (disconnectIssued) {
if(ar->arNetworkType & AP_NETWORK) {
ar6000_disconnect_event(ar, DISCONNECT_CMD, bcast_mac, 0, NULL, 0);
} else {
ar6000_disconnect_event(ar, DISCONNECT_CMD, ar->arBssid, 0, NULL, 0);
}
- ar->arConnected = false;
- ar->arConnectPending = false;
}
#ifdef USER_KEYS
ar->user_savedkeys_stat = USER_SAVEDKEYS_STAT_INIT;
A_UNTIMEOUT(&ar->disconnect_timer);
ar6000_init_profile_info(ar);
- wmi_disconnect_cmd(ar->arWmi);
+ ar6000_disconnect(ar);
}
static void ar6000_detect_error(unsigned long ptr)
A_MEMZERO(ar->arReqBssid, sizeof(ar->arReqBssid));
A_MEMZERO(ar->arBssid, sizeof(ar->arBssid));
ar->arBssChannel = 0;
- ar->arConnected = false;
}
static void
netif_stop_queue(dev);
#ifdef ATH6K_CONFIG_CFG80211
- AR6000_SPIN_LOCK(&ar->arLock, 0);
- if (ar->arConnected == true || ar->arConnectPending == true) {
- AR6000_SPIN_UNLOCK(&ar->arLock, 0);
- wmi_disconnect_cmd(ar->arWmi);
- } else {
- AR6000_SPIN_UNLOCK(&ar->arLock, 0);
- }
+ ar6000_disconnect(ar);
if(ar->arWmiReady == true) {
if (wmi_scanparams_cmd(ar->arWmi, 0xFFFF, 0,
A_MEMCPY(wrqu.addr.sa_data, bssid, ATH_MAC_LEN);
wireless_send_event(ar->arNetDev, IWEVEXPIRED, &wrqu, NULL);
}
+
+ ar->arConnected = false;
return;
}
*/
if( reason == DISCONNECT_CMD)
{
- ar->arConnectPending = false;
if ((!ar->arUserBssFilter) && (ar->arWmiReady)) {
wmi_bssfilter_cmd(ar->arWmi, NONE_BSS_FILTER, 0);
}
p.groupCryptoLen = ar->arGroupCryptoLen;
p.ctrl_flags = ar->arConnectCtrlFlags;
- ar->arConnected = false;
-
wmi_ap_profile_commit(ar->arWmi, &p);
spin_lock_irqsave(&ar->arLock, flags);
ar->arConnected = true;
}
int
+ar6000_disconnect(struct ar6_softc *ar)
+{
+ if ((ar->arConnected == true) || (ar->arConnectPending == true)) {
+ wmi_disconnect_cmd(ar->arWmi);
+ /*
+ * Disconnect cmd is issued, clear connectPending.
+ * arConnected will be cleard in disconnect_event notification.
+ */
+ ar->arConnectPending = false;
+ }
+
+ return 0;
+}
+
+int
ar6000_ap_mode_get_wpa_ie(struct ar6_softc *ar, struct ieee80211req_wpaie *wpaie)
{
sta_t *conn = NULL;
return 0;
} else if(ar->arSsidLen == sme->ssid_len &&
!A_MEMCMP(ar->arSsid, sme->ssid, ar->arSsidLen)) {
- wmi_disconnect_cmd(ar->arWmi);
+ ar6000_disconnect(ar);
}
A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
}
reconnect_flag = 0;
- wmi_disconnect_cmd(ar->arWmi);
+ ar6000_disconnect(ar);
A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
ar->arSsidLen = 0;
ar->arSsidLen, ar->arSsid,
ar->arReqBssid, ar->arChannelHint,
ar->arConnectCtrlFlags);
+ ar->arConnectPending = true;
return 0;
}
return -EIO;
}
- wmi_disconnect_cmd(ar->arWmi);
+ ar6000_disconnect(ar);
A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
ar->arSsidLen = 0;
/* Update the arNetworkType */
ar->arNetworkType = ar->arNextMode;
-
if ((prevMode != AP_NETWORK) &&
- ((ar->arSsidLen) || ((ar->arSsidLen == 0) && ar->arConnected) || (!data->flags)))
+ ((ar->arSsidLen) ||
+ ((ar->arSsidLen == 0) && (ar->arConnected || ar->arConnectPending)) ||
+ (!data->flags)))
{
if ((!data->flags) ||
(A_MEMCMP(ar->arSsid, ssid, ar->arSsidLen) != 0) ||
if (ar->arWmiReady == true) {
reconnect_flag = 0;
status = wmi_setPmkid_cmd(ar->arWmi, ar->arBssid, NULL, 0);
- status = wmi_disconnect_cmd(ar->arWmi);
+ ar6000_disconnect(ar);
A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
ar->arSsidLen = 0;
if (ar->arSkipScan == false) {
ar6000_init_profile_info(ar);
ar->arNetworkType = arNetworkType;
reconnect_flag = 0;
- wmi_disconnect_cmd(ar->arWmi);
+ ar6000_disconnect(ar);
A_MEMZERO(ar->arSsid, sizeof(ar->arSsid));
ar->arSsidLen = 0;
if (ar->arSkipScan == false) {
* update the host driver association state for the STA|IBSS mode.
*/
if (ar->arNetworkType != AP_NETWORK && ar->arNextMode == AP_NETWORK) {
- ar->arConnectPending = false;
- ar->arConnected = false;
/* Stop getting pkts from upper stack */
netif_stop_queue(ar->arNetDev);
A_MEMZERO(ar->arBssid, sizeof(ar->arBssid));