Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211_regdomain.c
Show All 29 Lines | |||||
* IEEE 802.11 regdomain support. | * IEEE 802.11 regdomain support. | ||||
*/ | */ | ||||
#include "opt_wlan.h" | #include "opt_wlan.h" | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <net/if.h> | #include <net/if.h> | ||||
#include <net/if_var.h> | #include <net/if_var.h> | ||||
#include <net/if_media.h> | #include <net/if_media.h> | ||||
#include <net/ethernet.h> | #include <net/ethernet.h> | ||||
#include <net80211/ieee80211_var.h> | #include <net80211/ieee80211_var.h> | ||||
▲ Show 20 Lines • Show All 435 Lines • ▼ Show 20 Lines | ieee80211_setregdomain(struct ieee80211vap *vap, | ||||
memcpy(&ic->ic_regdomain, ®->rd, sizeof(reg->rd)); | memcpy(&ic->ic_regdomain, ®->rd, sizeof(reg->rd)); | ||||
/* channel table */ | /* channel table */ | ||||
memcpy(ic->ic_channels, reg->chaninfo.ic_chans, | memcpy(ic->ic_channels, reg->chaninfo.ic_chans, | ||||
reg->chaninfo.ic_nchans * sizeof(struct ieee80211_channel)); | reg->chaninfo.ic_nchans * sizeof(struct ieee80211_channel)); | ||||
ic->ic_nchans = reg->chaninfo.ic_nchans; | ic->ic_nchans = reg->chaninfo.ic_nchans; | ||||
memset(&ic->ic_channels[ic->ic_nchans], 0, | memset(&ic->ic_channels[ic->ic_nchans], 0, | ||||
(IEEE80211_CHAN_MAX - ic->ic_nchans) * | (IEEE80211_CHAN_MAX - ic->ic_nchans) * | ||||
sizeof(struct ieee80211_channel)); | sizeof(struct ieee80211_channel)); | ||||
ieee80211_media_init(ic); | ieee80211_chan_init(ic); | ||||
/* | /* | ||||
* Invalidate channel-related state. | * Invalidate channel-related state. | ||||
*/ | */ | ||||
if (ic->ic_countryie != NULL) { | if (ic->ic_countryie != NULL) { | ||||
IEEE80211_FREE(ic->ic_countryie, M_80211_NODE_IE); | IEEE80211_FREE(ic->ic_countryie, M_80211_NODE_IE); | ||||
ic->ic_countryie = NULL; | ic->ic_countryie = NULL; | ||||
} | } | ||||
Show All 11 Lines |