nl80211: Clear HT flags from the channel when exiting

This commit is contained in:
Jouni Malinen 2008-11-26 10:51:01 +02:00 committed by Jouni Malinen
parent fe0f58fa69
commit 446842b101

View file

@ -70,6 +70,9 @@ struct i802_driver_data {
int dtim_period, beacon_int; int dtim_period, beacon_int;
unsigned int beacon_set:1; unsigned int beacon_set:1;
unsigned int ieee802_1x_active:1; unsigned int ieee802_1x_active:1;
int last_freq;
int last_freq_ht;
}; };
@ -471,6 +474,9 @@ static int i802_set_freq2(void *priv, struct hostapd_freq_params *freq)
if (!msg) if (!msg)
return -1; return -1;
drv->last_freq = freq->freq;
drv->last_freq_ht = freq->ht_enabled;
genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, 0, genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, 0,
NL80211_CMD_SET_WIPHY, 0); NL80211_CMD_SET_WIPHY, 0);
@ -2384,6 +2390,14 @@ static void i802_deinit(void *priv)
{ {
struct i802_driver_data *drv = priv; struct i802_driver_data *drv = priv;
if (drv->last_freq_ht) {
/* Clear HT flags from the driver */
struct hostapd_freq_params freq;
os_memset(&freq, 0, sizeof(freq));
freq.freq = drv->last_freq;
i802_set_freq2(priv, &freq);
}
i802_del_beacon(drv); i802_del_beacon(drv);
/* remove monitor interface */ /* remove monitor interface */