コード例 #1
0
void Voodoo80211Device::
ieee80211_node_detach(struct ieee80211com *ic)
{
	if (ic->ic_bss != NULL) {
		ieee80211_node_free(ic, ic->ic_bss);
		ic->ic_bss = NULL;
	}
	ieee80211_free_allnodes(ic);
	timeout_del(ic->ic_rsn_timeout);
}
コード例 #2
0
ファイル: ieee80211_node.c プロジェクト: SylvestreG/bitrig
/*
 * Begin an active scan.
 */
void
ieee80211_begin_scan(struct ifnet *ifp)
{
	struct ieee80211com *ic = (void *)ifp;

	if (ic->ic_scan_lock & IEEE80211_SCAN_LOCKED)
		return;
	ic->ic_scan_lock |= IEEE80211_SCAN_LOCKED;

	/*
	 * In all but hostap mode scanning starts off in
	 * an active mode before switching to passive.
	 */
#ifndef IEEE80211_STA_ONLY
	if (ic->ic_opmode != IEEE80211_M_HOSTAP)
#endif
	{
		ic->ic_flags |= IEEE80211_F_ASCAN;
		ic->ic_stats.is_scan_active++;
	}
#ifndef IEEE80211_STA_ONLY
	else
		ic->ic_stats.is_scan_passive++;
#endif
	if (ifp->if_flags & IFF_DEBUG)
		printf("%s: begin %s scan\n", ifp->if_xname,
			(ic->ic_flags & IEEE80211_F_ASCAN) ?
				"active" : "passive");

	/*
	 * Flush any previously seen AP's. Note that the latter 
	 * assumes we don't act as both an AP and a station,
	 * otherwise we'll potentially flush state of stations
	 * associated with us.
	 */
	ieee80211_free_allnodes(ic);

	/*
	 * Reset the current mode. Setting the current mode will also
	 * reset scan state.
	 */
	if (IFM_MODE(ic->ic_media.ifm_cur->ifm_media) == IFM_AUTO)
		ic->ic_curmode = IEEE80211_MODE_AUTO;
	ieee80211_setmode(ic, ic->ic_curmode);

	ic->ic_scan_count = 0;

	/* Scan the next channel. */
	ieee80211_next_scan(ifp);
}
コード例 #3
0
void
ieee80211_node_detach(struct ifnet *ifp)
{
	struct ieee80211com *ic = (void *)ifp;

	if (ic->ic_bss != NULL) {
		(*ic->ic_node_free)(ic, ic->ic_bss);
		ic->ic_bss = NULL;
	}
	ieee80211_free_allnodes(ic);
	IEEE80211_NODE_LOCK_DESTROY(ic);
	if (ic->ic_aid_bitmap != NULL)
		FREE(ic->ic_aid_bitmap, M_DEVBUF);
}
コード例 #4
0
void
ieee80211_node_detach(struct ifnet *ifp)
{
	struct ieee80211com *ic = (void *)ifp;

	if (ic->ic_bss != NULL) {
		(*ic->ic_node_free)(ic, ic->ic_bss);
		ic->ic_bss = NULL;
	}
	ieee80211_free_allnodes(ic);
#ifndef IEEE80211_STA_ONLY
	if (ic->ic_aid_bitmap != NULL)
		free(ic->ic_aid_bitmap, M_DEVBUF);
	if (ic->ic_tim_bitmap != NULL)
		free(ic->ic_tim_bitmap, M_DEVBUF);
#endif
	timeout_del(&ic->ic_rsn_timeout);
}
コード例 #5
0
/*
 * Begin an active scan.
 */
void Voodoo80211Device::
ieee80211_begin_scan(struct ieee80211com *ic)
{
	if (ic->ic_scan_lock & IEEE80211_SCAN_LOCKED)
		return;
	ic->ic_scan_lock |= IEEE80211_SCAN_LOCKED;
    
	/*
	 * In all but hostap mode scanning starts off in
	 * an active mode before switching to passive.
	 */
	{
		ic->ic_flags |= IEEE80211_F_ASCAN;
		ic->ic_stats.is_scan_active++;
	}
	if (false /* ifp->debugOn */)
		printf("%s: begin %s scan\n", "voodoo_wifi",
               (ic->ic_flags & IEEE80211_F_ASCAN) ?
               "active" : "passive");
    
	/*
	 * Flush any previously seen AP's. Note that the latter 
	 * assumes we don't act as both an AP and a station,
	 * otherwise we'll potentially flush state of stations
	 * associated with us.
	 */
	ieee80211_free_allnodes(ic);
    
	/*
	 * Reset the current mode. Setting the current mode will also
	 * reset scan state.
	 */
    if (getCurrentMedium()->getType() & IFM_AUTO)
		ic->ic_curmode = IEEE80211_MODE_AUTO;
	ieee80211_setmode(ic, (enum ieee80211_phymode) ic->ic_curmode);
    
	ic->ic_scan_count = 0;
    
	/* Scan the next channel. */
	ieee80211_next_scan(ic);
}