/* Confirmations */ void ieee80211_mlme_join_complete_infra(struct ieee80211_node *ni) { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211_mlme_priv *mlme_priv = vap->iv_mlme_priv; if ((mlme_priv->im_request_type == MLME_REQ_JOIN_INFRA) && (MLME_STOP_WAITING_FOR_JOIN(mlme_priv) == 1)) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_MLME, "%s\n", __func__); /* Request complete */ mlme_priv->im_request_type = MLME_REQ_NONE; /* * We have received the beacon that synchronises us with the BSS. * We don't care whether the Timer got cancelled or not. The macro * HW_STOP_WAITING_FOR_JOIN synchronizes us with the cancel operation */ OS_CANCEL_TIMER(&mlme_priv->im_timeout_timer); /* Call MLME confirmation handler */ IEEE80211_DELIVER_EVENT_MLME_JOIN_COMPLETE_INFRA(vap, IEEE80211_STATUS_SUCCESS); } else { if (mlme_priv->im_request_type != MLME_REQ_NONE) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_MLME, "%s: Failed: im_request_type=%d\n", __func__, mlme_priv->im_request_type); } } /* start SW bmiss. will be here for every beacon received from our AP */ mlme_sta_swbmiss_timer_start(vap); }
static void mlme_timeout_callback(struct ieee80211vap *vap, IEEE80211_STATUS ieeeStatus) { struct ieee80211_mlme_priv *mlme_priv = vap->iv_mlme_priv; int mlme_request_type = mlme_priv->im_request_type; IEEE80211_DPRINTF(vap, IEEE80211_MSG_MLME, "%s. Request type = %d\n", __func__, mlme_request_type); /* Request complete */ mlme_priv->im_request_type = MLME_REQ_NONE; switch(mlme_request_type) { case MLME_REQ_JOIN_INFRA: ASSERT(vap->iv_opmode != IEEE80211_M_IBSS); /* * Cancel the Join operation if it has not already completed */ if (MLME_STOP_WAITING_FOR_JOIN(mlme_priv) == TRUE) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_MLME,"%s", "Cancelled the Join Operation as it took too long\n"); IEEE80211_DELIVER_EVENT_MLME_JOIN_COMPLETE_INFRA(vap, ieeeStatus); } break; case MLME_REQ_JOIN_ADHOC: ASSERT(vap->iv_opmode == IEEE80211_M_IBSS); /* * Cancel the Join operation if it has not already completed */ if (MLME_STOP_WAITING_FOR_JOIN(mlme_priv) == TRUE) { IEEE80211_DPRINTF(vap, IEEE80211_MSG_MLME,"%s", "Cancelled the Join Operation as it took too long\n"); IEEE80211_DELIVER_EVENT_MLME_JOIN_COMPLETE_ADHOC(vap, ieeeStatus); } break; case MLME_REQ_AUTH: /* * Cancel the auth operation if it has not already completed */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_MLME,"%s", "Cancelled the Auth Operation as it took too long\n"); mlme_priv->im_expected_auth_seq_number = 0; IEEE80211_DELIVER_EVENT_MLME_AUTH_COMPLETE(vap, ieeeStatus); break; case MLME_REQ_ASSOC: /* * Cancel the assoc operation if it has not already completed */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_MLME,"%s", "Cancelled the Assoc Operation as it took too long\n"); IEEE80211_DELIVER_EVENT_MLME_ASSOC_COMPLETE(vap, ieeeStatus, 0, NULL); break; case MLME_REQ_REASSOC: /* * Cancel the reassoc operation if it has not already completed */ IEEE80211_DPRINTF(vap, IEEE80211_MSG_MLME,"%s", "Cancelled the Reassoc Operation as it took too long\n"); IEEE80211_DELIVER_EVENT_MLME_REASSOC_COMPLETE(vap, ieeeStatus, 0, NULL); break; case MLME_REQ_NONE: IEEE80211_DPRINTF(vap, IEEE80211_MSG_MLME,"%s", "mlme_request_type is MLME_REQ_NONE, do nothing.\n"); break; default: ASSERT(0); break; } }