예제 #1
0
void ieee80211_rx_bss_remove(struct ieee80211_sub_if_data *sdata, u8 *bssid,
                             int freq, u8 *ssid, u8 ssid_len)
{
    struct ieee80211_bss *bss;
    struct ieee80211_local *local = sdata->local;

    bss = ieee80211_rx_bss_get(local, bssid, freq, ssid, ssid_len);
    if (bss) {
        cfg80211_unlink_bss(local->hw.wiphy, (void *)bss);
        ieee80211_rx_bss_put(local, bss);
    }
}
예제 #2
0
파일: main.c 프로젝트: chunkeey/rtl8192su
static void r92su_bss_free_connected(struct r92su *r92su,
				     bool locally_generated)
{
	struct cfg80211_bss *old_bss;

	if (r92su_is_connected(r92su))
		r92su_set_state(r92su, R92SU_OPEN);

	rcu_read_lock();
	old_bss = rcu_dereference(r92su->connect_bss);
	rcu_assign_pointer(r92su->connect_bss, NULL);
	if (old_bss) {
		switch (r92su->wdev.iftype) {
		case NL80211_IFTYPE_STATION:
			/* cfg80211 doesn't like it when cfg80211_disconnected
			 * is called without reason. So check if we were really
			 * connected.
			 */
			cfg80211_disconnected(r92su->wdev.netdev,
				      WLAN_STATUS_UNSPECIFIED_FAILURE, NULL, 0,
				      locally_generated, GFP_ATOMIC);
			break;

		case NL80211_IFTYPE_ADHOC:
			cfg80211_unlink_bss(r92su->wdev.wiphy, old_bss);
			break;

		default:
			WARN(1, "unsupported network type %d\n",
			     r92su->wdev.iftype);
			break;
		}
		r92su_bss_free(r92su, old_bss);
	}
	rcu_read_unlock();
}