* [PATCH 4/5] mac80211: add primarily CAC support
From: Bernhard Schmidt @ 2011-01-17 10:24 UTC (permalink / raw)
To: linux-wireless; +Cc: lrodriguez, nbd, dubowoj, zefir.kurtisi, simon.wunderlich
In-Reply-To: <201101171621.29863.bernhard.schmidt@saxnet.de>
---
net/mac80211/radar.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++
net/mac80211/radar.h | 4 +++
2 files changed, 69 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/radar.c b/net/mac80211/radar.c
index e90b8bf..afb2ae1 100644
--- a/net/mac80211/radar.c
+++ b/net/mac80211/radar.c
@@ -15,6 +15,66 @@
#include "driver-ops.h"
#include "radar.h"
+static void cac_timer(unsigned long data)
+{
+ struct ieee80211_local *local = (void *) data;
+ struct ieee80211_radar *radar = &local->radar;
+ struct ieee80211_channel *chan;
+
+ printk(KERN_INFO "CAC done\n");
+
+ chan = local->oper_channel;
+ mutex_lock(&radar->mtx);
+ if ((chan->flags & IEEE80211_CHAN_RADAR_INTERFERENCE) == 0) {
+ chan->flags |= IEEE80211_CHAN_RADAR_CLEAR;
+ }
+ radar->cac = 0;
+ mutex_unlock(&radar->mtx);
+}
+
+int ieee80211_radar_cac(struct wiphy *wiphy, int enable)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+ struct ieee80211_radar *radar = &local->radar;
+ struct ieee80211_channel *chan = local->oper_channel;
+ int ret;
+
+ ret = ieee80211_radar_detection_enable(local, chan);
+ if (ret != 0)
+ return ret;
+
+ if (!enable && !radar->cac)
+ return -EINVAL;
+ if (!enable && radar->cac) {
+ printk(KERN_INFO "stopping CAC\n");
+
+ del_timer_sync(&radar->cac_timer);
+ mutex_lock(&radar->mtx);
+ radar->cac = 0;
+ mutex_unlock(&radar->mtx);
+ return 0;
+ }
+ if (enable) {
+ if ((chan->flags & IEEE80211_CHAN_RADAR_INTERFERENCE))
+ return -EINVAL;
+
+ printk(KERN_INFO "starting CAC\n");
+
+ del_timer_sync(&radar->cac_timer);
+ mutex_lock(&radar->mtx);
+ if ((chan->flags & IEEE80211_CHAN_RADAR) &&
+ (chan->flags & IEEE80211_CHAN_RADAR_CLEAR)) {
+ chan->flags &= ~IEEE80211_CHAN_RADAR_CLEAR;
+ }
+ radar->cac = 1;
+ mutex_unlock(&radar->mtx);
+ mod_timer(&radar->cac_timer, jiffies +
+ msecs_to_jiffies(radar->params->cac_period * 1000));
+ }
+
+ return 0;
+}
+
static void nol_timer(unsigned long data)
{
struct ieee80211_local *local = (void *) data;
@@ -136,6 +196,9 @@ void ieee80211_radar_init(struct ieee80211_local *local)
mutex_init(&radar->mtx);
+ radar->cac = 0;
+ setup_timer(&radar->cac_timer, cac_timer, (unsigned long)local);
+
INIT_LIST_HEAD(&radar->nol_list);
setup_timer(&radar->nol_timer, nol_timer, (unsigned long)local);
mod_timer(&radar->nol_timer, jiffies + msecs_to_jiffies(1000));
@@ -146,6 +209,8 @@ void ieee80211_radar_deinit(struct ieee80211_local *local)
struct ieee80211_radar *radar = &local->radar;
struct ieee80211_radar_nol_list *nol, *tmp;
+ del_timer_sync(&radar->cac_timer);
+
del_timer_sync(&radar->nol_timer);
mutex_lock(&radar->mtx);
list_for_each_entry_safe(nol, tmp, &radar->nol_list, list) {
diff --git a/net/mac80211/radar.h b/net/mac80211/radar.h
index 79684b5..6e8bc36 100644
--- a/net/mac80211/radar.h
+++ b/net/mac80211/radar.h
@@ -31,10 +31,14 @@ struct ieee80211_radar {
struct mutex mtx;
struct ieee80211_radar_parameters *params;
+ int cac;
+ struct timer_list cac_timer;
+
struct timer_list nol_timer;
struct list_head nol_list;
};
+int ieee80211_radar_cac(struct wiphy *wiphy, int enable);
int ieee80211_radar_detection_enable(struct ieee80211_local *local,
struct ieee80211_channel *chan);
int ieee80211_radar_detection_disable(struct ieee80211_local *local,
--
1.5.6.5
^ permalink raw reply related
* [PATCH 3/8] hostapd: select random channel of the list
From: Bernhard Schmidt @ 2011-01-17 13:00 UTC (permalink / raw)
To: linux-wireless; +Cc: lrodriguez, nbd, dubowoj, zefir.kurtisi, simon.wunderlich
In-Reply-To: <201101171621.29863.bernhard.schmidt@saxnet.de>
---
src/ap/hw_features.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/ap/hw_features.h | 1 +
2 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 133ed74..743d567 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -27,6 +27,58 @@
#include "hw_features.h"
+int hostapd_select_random_channel(struct hostapd_iface *iface)
+{
+ int i, j, ret;
+
+ if (iface->conf->channel_list == NULL ||
+ iface->conf->channel_list[0] == -1)
+ return -1;
+
+ ret = -1;
+ if (iface->conf->channel == 0 && iface->conf->channel_list != NULL) {
+ int *chans, chans_num = 1, hw_chans_num;
+ u8 buf;
+
+ for (i = 0; iface->conf->channel_list[i] > 0; i++)
+ chans_num++;
+
+ chans = os_malloc(sizeof(int) * chans_num);
+ if (chans == NULL)
+ return -1;
+ os_memcpy(chans, iface->conf->channel_list,
+ sizeof(int) * chans_num);
+
+ hw_chans_num = iface->current_mode->num_channels;
+ buf = chans_num;
+ do {
+ struct hostapd_channel_data *hchan = NULL;
+
+ for (i = j = 0; i < chans_num; i++, j++) {
+ if (i == buf)
+ j++;
+ chans[i] = chans[j];
+ }
+
+ os_get_random(&buf, 1);
+ buf %= chans_num;
+
+ for (i = 0; i < hw_chans_num; i++) {
+ hchan = &iface->current_mode->channels[i];
+ if (hchan->chan == chans[buf] &&
+ !(hchan->flag & HOSTAPD_CHAN_DISABLED)) {
+ iface->conf->channel = hchan->chan;
+ ret = 0;
+ break;
+ }
+ }
+ chans_num--;
+ } while (iface->conf->channel == 0 && chans_num > 0);
+ os_free(chans);
+ }
+ return ret;
+}
+
void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
size_t num_hw_features)
{
@@ -642,6 +694,8 @@ int hostapd_select_hw_mode(struct hostapd_iface *iface)
break;
}
}
+ if (iface->conf->channel == 0 && !hostapd_select_random_channel(iface))
+ ok = 1;
if (ok && iface->conf->secondary_channel) {
int sec_ok = 0;
int sec_chan = iface->conf->channel +
diff --git a/src/ap/hw_features.h b/src/ap/hw_features.h
index 88c2322..f800562 100644
--- a/src/ap/hw_features.h
+++ b/src/ap/hw_features.h
@@ -17,6 +17,7 @@
#define HW_FEATURES_H
#ifdef NEED_AP_MLME
+int hostapd_select_random_channel(struct hostapd_iface *iface);
void hostapd_free_hw_features(struct hostapd_hw_modes *hw_features,
size_t num_hw_features);
int hostapd_get_hw_features(struct hostapd_iface *iface);
--
1.5.6.5
^ permalink raw reply related
* [PATCH 4/8] hostap: sync nl80211_copy.h
From: Bernhard Schmidt @ 2011-01-17 13:07 UTC (permalink / raw)
To: linux-wireless; +Cc: lrodriguez, nbd, dubowoj, zefir.kurtisi, simon.wunderlich
In-Reply-To: <201101171621.29863.bernhard.schmidt@saxnet.de>
---
src/drivers/nl80211_copy.h | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
index 7483a89..960341c 100644
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
@@ -406,6 +406,12 @@
* notification. This event is used to indicate that an unprotected
* disassociation frame was dropped when MFP is in use.
*
+ * @NL80211_CMD_RADAR_CAC_START: Request a CAC
+ * @NL80211_CMD_RADAR_CAC_STOP: Stop as CAC earler
+ * @NL80211_CMD_RADAR_CAC_DONE: Notification sent if a CAC has completed.
+ * @NL80211_CMD_RADAR_FLAGS_CHANGED: Notification sent if channel flags
+ * have changed.
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -518,6 +524,11 @@ enum nl80211_commands {
NL80211_CMD_UNPROT_DEAUTHENTICATE,
NL80211_CMD_UNPROT_DISASSOCIATE,
+ NL80211_CMD_RADAR_CAC_START,
+ NL80211_CMD_RADAR_CAC_STOP,
+ NL80211_CMD_RADAR_CAC_DONE,
+ NL80211_CMD_RADAR_FLAGS_CHANGED,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -1338,6 +1349,10 @@ enum nl80211_band_attr {
* (100 * dBm).
* @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
* currently defined
+ * @NL80211_FREQUENCY_ATTR_RADAR_CLEAR: during a full CAC no interference has
+ * been detected
+ * @NL80211_FREQUENCY_ATTR_RADAR_INTERFERENCE: either during a CAC or
+ * in-service monitoring radar interference was detected
* @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
*/
enum nl80211_frequency_attr {
@@ -1348,6 +1363,8 @@ enum nl80211_frequency_attr {
NL80211_FREQUENCY_ATTR_NO_IBSS,
NL80211_FREQUENCY_ATTR_RADAR,
NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
+ NL80211_FREQUENCY_ATTR_RADAR_CLEAR,
+ NL80211_FREQUENCY_ATTR_RADAR_INTEFERENCE,
/* keep last */
__NL80211_FREQUENCY_ATTR_AFTER_LAST,
--
1.5.6.5
^ permalink raw reply related
* [PATCH 2/5] mac80211: initialize radar params + add driver API
From: Bernhard Schmidt @ 2011-01-17 9:16 UTC (permalink / raw)
To: linux-wireless; +Cc: lrodriguez, nbd, dubowoj, zefir.kurtisi, simon.wunderlich
In-Reply-To: <201101171621.29863.bernhard.schmidt@saxnet.de>
- ieee80211_radar_update_params() can be used by drivers to update regdomain
related parameters on regulatory changes.
- radar_detection is used to identify if a driver has support for radar
detection or not. It is called when switching from and to a channel
marked as radar detection required.
---
include/net/mac80211.h | 11 ++++++
net/mac80211/Makefile | 3 +-
net/mac80211/cfg.c | 5 +++
net/mac80211/driver-ops.h | 14 +++++++
net/mac80211/driver-trace.h | 21 +++++++++++
net/mac80211/ieee80211_i.h | 3 ++
net/mac80211/main.c | 5 +++
net/mac80211/radar.c | 84 +++++++++++++++++++++++++++++++++++++++++++
net/mac80211/radar.h | 36 ++++++++++++++++++
9 files changed, 181 insertions(+), 1 deletions(-)
create mode 100644 net/mac80211/radar.c
create mode 100644 net/mac80211/radar.h
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 62c0ce2..b158be5 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1767,6 +1767,8 @@ enum ieee80211_ampdu_mlme_action {
* ieee80211_remain_on_channel_expired(). This callback may sleep.
* @cancel_remain_on_channel: Requests that an ongoing off-channel period is
* aborted before it expires. This callback may sleep.
+ *
+ * @radar_detection: Enable or disable radar detection on current channel.
*/
struct ieee80211_ops {
int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1845,6 +1847,8 @@ struct ieee80211_ops {
enum nl80211_channel_type channel_type,
int duration);
int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
+
+ int (*radar_detection)(struct ieee80211_hw *hw, int enable);
};
/**
@@ -2762,6 +2766,13 @@ void ieee80211_ready_on_channel(struct ieee80211_hw *hw);
*/
void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw);
+/**
+ * ieee80211_radar_update_params - update regdomain related radar parameteters
+ * @hw: pointer as obtained from ieee80211_alloc_hw()
+ */
+void ieee80211_radar_update_params(struct ieee80211_hw *hw,
+ const struct ieee80211_regdomain *regd);
+
/* Rate control API */
/**
diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile
index fdb54e6..deff05b 100644
--- a/net/mac80211/Makefile
+++ b/net/mac80211/Makefile
@@ -24,7 +24,8 @@ mac80211-y := \
util.o \
wme.o \
event.o \
- chan.o
+ chan.o \
+ radar.o
mac80211-$(CONFIG_MAC80211_LEDS) += led.o
mac80211-$(CONFIG_MAC80211_DEBUGFS) += \
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 4bc8a92..a6a2c0b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -18,6 +18,7 @@
#include "cfg.h"
#include "rate.h"
#include "mesh.h"
+#include "radar.h"
static struct net_device *ieee80211_add_iface(struct wiphy *wiphy, char *name,
enum nl80211_iftype type,
@@ -1232,6 +1233,8 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
break;
}
+ ieee80211_radar_detection_disable(local, local->oper_channel);
+
local->oper_channel = chan;
if (!ieee80211_set_channel_type(local, sdata, channel_type))
@@ -1241,6 +1244,8 @@ static int ieee80211_set_channel(struct wiphy *wiphy,
if (sdata && sdata->vif.type != NL80211_IFTYPE_MONITOR)
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT);
+ ieee80211_radar_detection_enable(local, chan);
+
return 0;
}
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 98d5899..b8bcf46 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -495,4 +495,18 @@ static inline int drv_cancel_remain_on_channel(struct ieee80211_local *local)
return ret;
}
+static inline int drv_radar_detection(struct ieee80211_local *local, int enable)
+{
+ int ret = -EOPNOTSUPP;
+
+ might_sleep();
+
+ trace_drv_radar_detection(local, enable);
+ if (local->ops->radar_detection)
+ ret = local->ops->radar_detection(&local->hw, enable);
+ trace_drv_return_int(local, ret);
+
+ return ret;
+}
+
#endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h
index 49c8421..09cd205 100644
--- a/net/mac80211/driver-trace.h
+++ b/net/mac80211/driver-trace.h
@@ -1250,6 +1250,27 @@ TRACE_EVENT(api_remain_on_channel_expired,
)
);
+TRACE_EVENT(drv_radar_detection,
+ TP_PROTO(struct ieee80211_local *local, int enable),
+
+ TP_ARGS(local, enable),
+
+ TP_STRUCT__entry(
+ LOCAL_ENTRY
+ __field(int, enable)
+ ),
+
+ TP_fast_assign(
+ LOCAL_ASSIGN;
+ __entry->enable = enable;
+ ),
+
+ TP_printk(
+ LOCAL_PR_FMT " enable:%d",
+ LOCAL_PR_ARG, __entry->enable
+ )
+);
+
/*
* Tracing for internal functions
* (which may also be called in response to driver calls)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c47d7c0..5c46b14 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -29,6 +29,7 @@
#include <net/mac80211.h>
#include "key.h"
#include "sta_info.h"
+#include "radar.h"
struct ieee80211_local;
@@ -929,6 +930,8 @@ struct ieee80211_local {
struct notifier_block network_latency_notifier;
struct notifier_block ifa_notifier;
+ struct ieee80211_radar radar;
+
/*
* The dynamic ps timeout configured from user space via WEXT -
* this will override whatever chosen by mac80211 internally.
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index a46ff06..5841920 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -32,6 +32,7 @@
#include "led.h"
#include "cfg.h"
#include "debugfs.h"
+#include "radar.h"
bool ieee80211_disable_40mhz_24ghz;
@@ -621,6 +622,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
ieee80211_hw_roc_setup(local);
+ ieee80211_radar_init(local);
+
return local_to_hw(local);
}
EXPORT_SYMBOL(ieee80211_alloc_hw);
@@ -891,6 +894,8 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
{
struct ieee80211_local *local = hw_to_local(hw);
+ ieee80211_radar_deinit(local);
+
tasklet_kill(&local->tx_pending_tasklet);
tasklet_kill(&local->tasklet);
diff --git a/net/mac80211/radar.c b/net/mac80211/radar.c
new file mode 100644
index 0000000..9f41dd7
--- /dev/null
+++ b/net/mac80211/radar.c
@@ -0,0 +1,84 @@
+/*
+ * Radar handling
+ *
+ * Copyright 2011 Bernhard Schmidt <bernhard.schmidt@saxnet.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <net/mac80211.h>
+#include <net/rtnetlink.h>
+
+#include "ieee80211_i.h"
+#include "driver-ops.h"
+#include "radar.h"
+
+int ieee80211_radar_detection_enable(struct ieee80211_local *local,
+ struct ieee80211_channel *chan)
+{
+ int ret = 0;
+
+ if ((chan->flags & IEEE80211_CHAN_RADAR))
+ ret = drv_radar_detection(local, 1);
+
+ return ret;
+}
+
+int ieee80211_radar_detection_disable(struct ieee80211_local *local,
+ struct ieee80211_channel *chan)
+{
+ int ret = 0;
+
+ if ((chan->flags & IEEE80211_CHAN_RADAR))
+ ret = drv_radar_detection(local, 0);
+
+ return ret;
+}
+
+static struct ieee80211_radar_parameters regdomain_params[] = {
+ { .cac_period = 60, .nol_period = 1800 }, /* FCC, correct? */
+ { .cac_period = 60, .nol_period = 1800 }, /* ETSI */
+ { .cac_period = 60, .nol_period = 1800 }, /* JP, correct? */
+};
+
+void ieee80211_radar_update_params(struct ieee80211_hw *hw,
+ const struct ieee80211_regdomain *regd)
+{
+ struct ieee80211_local *local = hw_to_local(hw);
+ struct ieee80211_radar *radar = &local->radar;
+
+ switch (regd->flags & NL80211_CFLAG_ALL_DFS_FLAGS) {
+ case NL80211_CFLAG_DFS_ETSI:
+ radar->params = ®domain_params[1];
+ break;
+ case NL80211_CFLAG_DFS_JP:
+ radar->params = ®domain_params[2];
+ break;
+ default:
+ radar->params = ®domain_params[0];
+ break;
+ }
+}
+EXPORT_SYMBOL(ieee80211_radar_update_params);
+
+void ieee80211_radar_init(struct ieee80211_local *local)
+{
+ struct ieee80211_radar *radar = &local->radar;
+
+ /*
+ * NB: use FCC by default, will be updated later once regulatory
+ * information are available.
+ */
+ radar->params = ®domain_params[0];
+
+ mutex_init(&radar->mtx);
+}
+
+void ieee80211_radar_deinit(struct ieee80211_local *local)
+{
+ struct ieee80211_radar *radar = &local->radar;
+
+ mutex_destroy(&radar->mtx);
+}
diff --git a/net/mac80211/radar.h b/net/mac80211/radar.h
new file mode 100644
index 0000000..6536e28
--- /dev/null
+++ b/net/mac80211/radar.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2011 Bernhard Schmidt <bernhard.schmidt@saxnet.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef RADAR_H
+#define RADAR_H
+
+/*
+ * Regdomain related parameters.
+ */
+struct ieee80211_radar_parameters {
+
+ /* Time in seconds for a CAC period. */
+ int cac_period;
+
+ /* Time in seconds a channel is on the no operations list. */
+ int nol_period;
+};
+
+struct ieee80211_radar {
+ struct mutex mtx;
+ struct ieee80211_radar_parameters *params;
+};
+
+int ieee80211_radar_detection_enable(struct ieee80211_local *local,
+ struct ieee80211_channel *chan);
+int ieee80211_radar_detection_disable(struct ieee80211_local *local,
+ struct ieee80211_channel *chan);
+void ieee80211_radar_init(struct ieee80211_local *local);
+void ieee80211_radar_deinit(struct ieee80211_local *local);
+
+#endif
--
1.5.6.5
^ permalink raw reply related
* [PATCH 5/5] cfg80211: userspace commands/notifications
From: Bernhard Schmidt @ 2011-01-17 11:49 UTC (permalink / raw)
To: linux-wireless; +Cc: lrodriguez, nbd, dubowoj, zefir.kurtisi, simon.wunderlich
In-Reply-To: <201101171621.29863.bernhard.schmidt@saxnet.de>
---
include/linux/nl80211.h | 11 +++++
include/net/cfg80211.h | 18 ++++++++
net/mac80211/cfg.c | 1 +
net/mac80211/radar.c | 21 +++++++++
net/wireless/nl80211.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++
net/wireless/nl80211.h | 4 ++
net/wireless/util.c | 20 +++++++++
7 files changed, 179 insertions(+), 0 deletions(-)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index acb3c33..fa65287 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -410,6 +410,12 @@
* notification. This event is used to indicate that an unprotected
* disassociation frame was dropped when MFP is in use.
*
+ * @NL80211_CMD_RADAR_CAC_START: Request a CAC
+ * @NL80211_CMD_RADAR_CAC_STOP: Stop as CAC earler
+ * @NL80211_CMD_RADAR_CAC_DONE: Notification sent if a CAC has completed.
+ * @NL80211_CMD_RADAR_FLAGS_CHANGED: Notification sent if channel flags
+ * have changed.
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -522,6 +528,11 @@ enum nl80211_commands {
NL80211_CMD_UNPROT_DEAUTHENTICATE,
NL80211_CMD_UNPROT_DISASSOCIATE,
+ NL80211_CMD_RADAR_CAC_START,
+ NL80211_CMD_RADAR_CAC_STOP,
+ NL80211_CMD_RADAR_CAC_DONE,
+ NL80211_CMD_RADAR_FLAGS_CHANGED,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 1e9a052..4f77662 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1200,6 +1200,8 @@ struct cfg80211_pmksa {
* (also see nl80211.h @NL80211_ATTR_WIPHY_ANTENNA_TX).
*
* @get_antenna: Get current antenna configuration from device (tx_ant, rx_ant).
+ *
+ * @radar_cac: Request CAC.
*/
struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy);
@@ -1367,6 +1369,8 @@ struct cfg80211_ops {
int (*set_antenna)(struct wiphy *wiphy, u32 tx_ant, u32 rx_ant);
int (*get_antenna)(struct wiphy *wiphy, u32 *tx_ant, u32 *rx_ant);
+
+ int (*radar_cac)(struct wiphy *wiphy, int enable);
};
/*
@@ -2720,6 +2724,20 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
void cfg80211_cqm_pktloss_notify(struct net_device *dev,
const u8 *peer, u32 num_packets, gfp_t gfp);
+/**
+ * cfg80211_radar_cac_done - notify userspace that a CAC has been done.
+ * @wiphy: the wireless device to give the hint
+ */
+int cfg80211_radar_cac_done(struct wiphy *wiphy);
+
+/**
+ * cfg80211_radar_flags_changed - notify userspace about channel flag changes
+ * @wiphy: the wireless device to give the hint
+ * @channel: the channel on which flag changes occurred
+ */
+int cfg80211_radar_flags_changed(struct wiphy *wiphy,
+ struct ieee80211_channel *channel);
+
/* Logging, debugging and troubleshooting/diagnostic helpers. */
/* wiphy_printk helpers, similar to dev_printk */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a6a2c0b..43f657d 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1999,4 +1999,5 @@ struct cfg80211_ops mac80211_config_ops = {
.mgmt_frame_register = ieee80211_mgmt_frame_register,
.set_antenna = ieee80211_set_antenna,
.get_antenna = ieee80211_get_antenna,
+ .radar_cac = ieee80211_radar_cac,
};
diff --git a/net/mac80211/radar.c b/net/mac80211/radar.c
index afb2ae1..d825e3c 100644
--- a/net/mac80211/radar.c
+++ b/net/mac80211/radar.c
@@ -18,8 +18,10 @@
static void cac_timer(unsigned long data)
{
struct ieee80211_local *local = (void *) data;
+ struct wiphy *wiphy = local->hw.wiphy;
struct ieee80211_radar *radar = &local->radar;
struct ieee80211_channel *chan;
+ int changed = 0;
printk(KERN_INFO "CAC done\n");
@@ -27,9 +29,16 @@ static void cac_timer(unsigned long data)
mutex_lock(&radar->mtx);
if ((chan->flags & IEEE80211_CHAN_RADAR_INTERFERENCE) == 0) {
chan->flags |= IEEE80211_CHAN_RADAR_CLEAR;
+ changed = 1;
}
+ mutex_unlock(&radar->mtx);
+ if (changed)
+ cfg80211_radar_flags_changed(wiphy, chan);
+
+ mutex_lock(&radar->mtx);
radar->cac = 0;
mutex_unlock(&radar->mtx);
+ cfg80211_radar_cac_done(wiphy);
}
int ieee80211_radar_cac(struct wiphy *wiphy, int enable)
@@ -52,9 +61,12 @@ int ieee80211_radar_cac(struct wiphy *wiphy, int enable)
mutex_lock(&radar->mtx);
radar->cac = 0;
mutex_unlock(&radar->mtx);
+ cfg80211_radar_cac_done(wiphy);
return 0;
}
if (enable) {
+ int changed = 0;
+
if ((chan->flags & IEEE80211_CHAN_RADAR_INTERFERENCE))
return -EINVAL;
@@ -65,7 +77,12 @@ int ieee80211_radar_cac(struct wiphy *wiphy, int enable)
if ((chan->flags & IEEE80211_CHAN_RADAR) &&
(chan->flags & IEEE80211_CHAN_RADAR_CLEAR)) {
chan->flags &= ~IEEE80211_CHAN_RADAR_CLEAR;
+ changed = 1;
}
+ mutex_unlock(&radar->mtx);
+ if (changed)
+ cfg80211_radar_flags_changed(wiphy, chan);
+ mutex_lock(&radar->mtx);
radar->cac = 1;
mutex_unlock(&radar->mtx);
mod_timer(&radar->cac_timer, jiffies +
@@ -78,6 +95,7 @@ int ieee80211_radar_cac(struct wiphy *wiphy, int enable)
static void nol_timer(unsigned long data)
{
struct ieee80211_local *local = (void *) data;
+ struct wiphy *wiphy = local->hw.wiphy;
struct ieee80211_radar *radar = &local->radar;
struct ieee80211_radar_nol_list *nol, *tmp;
@@ -93,6 +111,7 @@ static void nol_timer(unsigned long data)
list_del(&nol->list);
mutex_unlock(&radar->mtx);
kfree(nol);
+ cfg80211_radar_flags_changed(wiphy, chan);
}
}
@@ -103,6 +122,7 @@ int ieee80211_radar_interference(struct ieee80211_hw *hw,
struct ieee80211_channel *chan)
{
struct ieee80211_local *local = hw_to_local(hw);
+ struct wiphy *wiphy = local->hw.wiphy;
struct ieee80211_radar *radar = &local->radar;
struct ieee80211_radar_nol_list *nol, *tmp;
@@ -131,6 +151,7 @@ int ieee80211_radar_interference(struct ieee80211_hw *hw,
chan->flags |= IEEE80211_CHAN_RADAR_INTERFERENCE;
list_add_tail(&nol->list, &radar->nol_list);
mutex_unlock(&radar->mtx);
+ cfg80211_radar_flags_changed(wiphy, chan);
return 0;
}
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0524423..2f43b6e 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4729,6 +4729,26 @@ out:
return err;
}
+static int nl80211_radar_start_cac(struct sk_buff *skb, struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+
+ if (!rdev->ops->radar_cac)
+ return -EOPNOTSUPP;
+
+ return rdev->ops->radar_cac(&rdev->wiphy, 1);
+}
+
+static int nl80211_radar_stop_cac(struct sk_buff *skb, struct genl_info *info)
+{
+ struct cfg80211_registered_device *rdev = info->user_ptr[0];
+
+ if (!rdev->ops->radar_cac)
+ return -EOPNOTSUPP;
+
+ return rdev->ops->radar_cac(&rdev->wiphy, 0);
+}
+
static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
@@ -5271,6 +5291,22 @@ static struct genl_ops nl80211_ops[] = {
.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |
NL80211_FLAG_NEED_RTNL,
},
+ {
+ .cmd = NL80211_CMD_RADAR_CAC_START,
+ .doit = nl80211_radar_start_cac,
+ .policy = nl80211_policy,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = NL80211_FLAG_NEED_NETDEV |
+ NL80211_FLAG_NEED_RTNL,
+ },
+ {
+ .cmd = NL80211_CMD_RADAR_CAC_STOP,
+ .doit = nl80211_radar_stop_cac,
+ .policy = nl80211_policy,
+ .flags = GENL_ADMIN_PERM,
+ .internal_flags = NL80211_FLAG_NEED_NETDEV |
+ NL80211_FLAG_NEED_RTNL,
+ },
};
static struct genl_multicast_group nl80211_mlme_mcgrp = {
@@ -6128,6 +6164,74 @@ nl80211_send_cqm_pktloss_notify(struct cfg80211_registered_device *rdev,
nlmsg_free(msg);
}
+void nl80211_radar_cac_done(struct cfg80211_registered_device *rdev)
+{
+ struct sk_buff *msg;
+ void *hdr;
+
+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!msg)
+ return;
+
+ hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_RADAR_CAC_DONE);
+ if (!hdr) {
+ nlmsg_free(msg);
+ return;
+ }
+
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
+
+ if (genlmsg_end(msg, hdr) < 0) {
+ nlmsg_free(msg);
+ return;
+ }
+
+ genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
+ nl80211_mlme_mcgrp.id, GFP_KERNEL);
+ return;
+
+ nla_put_failure:
+ genlmsg_cancel(msg, hdr);
+ nlmsg_free(msg);
+}
+
+void nl80211_radar_flags_changed(struct cfg80211_registered_device *rdev,
+ struct ieee80211_channel *chan)
+{
+ struct sk_buff *msg;
+ void *hdr;
+
+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!msg)
+ return;
+
+ hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_RADAR_FLAGS_CHANGED);
+ if (!hdr) {
+ nlmsg_free(msg);
+ return;
+ }
+
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
+ NLA_PUT_U32(msg, NL80211_FREQUENCY_ATTR_FREQ, chan->center_freq);
+ if ((chan->flags & IEEE80211_CHAN_RADAR_CLEAR))
+ NLA_PUT_FLAG(msg, NL80211_FREQUENCY_ATTR_RADAR_CLEAR);
+ if ((chan->flags & IEEE80211_CHAN_RADAR_INTERFERENCE))
+ NLA_PUT_FLAG(msg, NL80211_FREQUENCY_ATTR_RADAR_INTERFERENCE);
+
+ if (genlmsg_end(msg, hdr) < 0) {
+ nlmsg_free(msg);
+ return;
+ }
+
+ genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
+ nl80211_mlme_mcgrp.id, GFP_KERNEL);
+ return;
+
+ nla_put_failure:
+ genlmsg_cancel(msg, hdr);
+ nlmsg_free(msg);
+}
+
static int nl80211_netlink_notify(struct notifier_block * nb,
unsigned long state,
void *_notify)
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
index e3f7fa8..e7f84d8 100644
--- a/net/wireless/nl80211.h
+++ b/net/wireless/nl80211.h
@@ -98,4 +98,8 @@ nl80211_send_cqm_pktloss_notify(struct cfg80211_registered_device *rdev,
struct net_device *netdev, const u8 *peer,
u32 num_packets, gfp_t gfp);
+void nl80211_radar_cac_done(struct cfg80211_registered_device *rdev);
+void nl80211_radar_flags_changed(struct cfg80211_registered_device *rdev,
+ struct ieee80211_channel *chan);
+
#endif /* __NET_WIRELESS_NL80211_H */
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 7620ae2..3c87c2f 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -9,6 +9,7 @@
#include <net/cfg80211.h>
#include <net/ip.h>
#include "core.h"
+#include "nl80211.h"
struct ieee80211_rate *
ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
@@ -885,3 +886,22 @@ u16 cfg80211_calculate_bitrate(struct rate_info *rate)
/* do NOT round down here */
return (bitrate + 50000) / 100000;
}
+
+int cfg80211_radar_cac_done(struct wiphy *wiphy)
+{
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+
+ nl80211_radar_cac_done(rdev);
+ return 0;
+}
+EXPORT_SYMBOL(cfg80211_radar_cac_done);
+
+int cfg80211_radar_flags_changed(struct wiphy *wiphy,
+ struct ieee80211_channel *chan)
+{
+ struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+
+ nl80211_radar_flags_changed(rdev, chan);
+ return 0;
+}
+EXPORT_SYMBOL(cfg80211_radar_flags_changed);
--
1.5.6.5
^ permalink raw reply related
* [PATCH 7/8] hostap: handle interference on current channel
From: Bernhard Schmidt @ 2011-01-17 13:26 UTC (permalink / raw)
To: linux-wireless; +Cc: lrodriguez, nbd, dubowoj, zefir.kurtisi, simon.wunderlich
In-Reply-To: <201101171621.29863.bernhard.schmidt@saxnet.de>
---
src/ap/hostapd.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index a065fc9..1024d73 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -993,6 +993,34 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
wpa_auth_sta_associated(hapd->wpa_auth, sta->wpa_sm);
}
+static void hostapd_radar_flags_cb(struct hostapd_data *hapd)
+{
+ struct hostapd_iface *iface = hapd->iface;
+ u32 flags;
+
+ iface->radar_cac_cb = NULL;
+ iface->radar_flags_cb = NULL;
+ flags = hostapd_hw_get_radar_flags(hapd, iface->conf->channel);
+ if ((flags & HOSTAPD_CHAN_RADAR_CLEAR)) {
+ hostapd_reload_bss(hapd);
+ } else if ((flags & HOSTAPD_CHAN_RADAR_INTERFERENCE)) {
+ int chan = iface->conf->channel;
+ u32 newflags;
+ iface->conf->channel = 0;
+ if (hostapd_select_random_channel(iface))
+ iface->conf->channel = chan;
+ newflags = hostapd_hw_get_radar_flags(hapd,
+ iface->conf->channel);
+ if ((newflags & HOSTAPD_CHAN_RADAR_INTERFERENCE))
+ iface->radar_flags_cb = hostapd_radar_flags_cb;
+ else
+ hostapd_radar_flags_cb(hapd);
+ } else {
+ hostapd_channel_availability_check(hapd);
+ iface->radar_cac_cb = hostapd_radar_flags_cb;
+ }
+}
+
void hostapd_radar_flags_changed(struct hostapd_data *hapd, int freq, u32 flags)
{
struct hostapd_iface *iface = hapd->iface;
@@ -1003,4 +1031,8 @@ void hostapd_radar_flags_changed(struct hostapd_data *hapd, int freq, u32 flags)
iface->radar_flags_cb(hapd);
return;
}
+ if (iface->radar_cac_cb || iface->freq != freq)
+ return;
+ else if ((flags & HOSTAPD_CHAN_RADAR_INTERFERENCE))
+ hostapd_radar_flags_cb(hapd);
}
--
1.5.6.5
^ permalink raw reply related
* [PATCH 8/8] hostap: do not disable radar channels
From: Bernhard Schmidt @ 2011-01-17 13:27 UTC (permalink / raw)
To: linux-wireless; +Cc: lrodriguez, nbd, dubowoj, zefir.kurtisi, simon.wunderlich
In-Reply-To: <201101171621.29863.bernhard.schmidt@saxnet.de>
---
src/ap/hw_features.c | 13 -------------
1 files changed, 0 insertions(+), 13 deletions(-)
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index a7f4eda..81caf63 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -126,19 +126,6 @@ int hostapd_get_hw_features(struct hostapd_iface *iface)
/* set flag for channels we can use in current regulatory
* domain */
for (j = 0; j < feature->num_channels; j++) {
- /*
- * Disable all channels that are marked not to allow
- * IBSS operation or active scanning. In addition,
- * disable all channels that require radar detection,
- * since that (in addition to full DFS) is not yet
- * supported.
- */
- if (feature->channels[j].flag &
- (HOSTAPD_CHAN_NO_IBSS |
- HOSTAPD_CHAN_PASSIVE_SCAN |
- HOSTAPD_CHAN_RADAR))
- feature->channels[j].flag |=
- HOSTAPD_CHAN_DISABLED;
if (feature->channels[j].flag & HOSTAPD_CHAN_DISABLED)
continue;
wpa_printf(MSG_MSGDUMP, "Allowed channel: mode=%d "
--
1.5.6.5
^ permalink raw reply related
* [PATCH 6/8] hostap: request CAC before using a radar channel
From: Bernhard Schmidt @ 2011-01-17 13:23 UTC (permalink / raw)
To: linux-wireless; +Cc: lrodriguez, nbd, dubowoj, zefir.kurtisi, simon.wunderlich
In-Reply-To: <201101171621.29863.bernhard.schmidt@saxnet.de>
---
src/ap/ap_drv_ops.c | 7 ++++
src/ap/ap_drv_ops.h | 1 +
src/ap/drv_callbacks.c | 4 ++
src/ap/hostapd.c | 83 ++++++++++++++++++++++++++++++++++++++++++
src/ap/hostapd.h | 5 +++
src/ap/hw_features.c | 2 +-
src/drivers/driver.h | 9 +++++
src/drivers/driver_nl80211.c | 35 ++++++++++++++++++
8 files changed, 145 insertions(+), 1 deletions(-)
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 7f9522a..4d260ac 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -429,6 +429,13 @@ int hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq,
return hapd->driver->set_freq(hapd->drv_priv, &data);
}
+int hostapd_radar_cac(struct hostapd_data *hapd, int enable)
+{
+ if (hapd->driver == NULL || hapd->driver->radar_cac == NULL)
+ return -1;
+ return hapd->driver->radar_cac(hapd->drv_priv, enable);
+}
+
int hostapd_set_rts(struct hostapd_data *hapd, int rts)
{
if (hapd->driver == NULL || hapd->driver->set_rts == NULL)
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
index 5bc9d01..3c51422 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -53,6 +53,7 @@ int hostapd_get_seqnum(const char *ifname, struct hostapd_data *hapd,
int hostapd_flush(struct hostapd_data *hapd);
int hostapd_set_freq(struct hostapd_data *hapd, int mode, int freq,
int channel, int ht_enabled, int sec_channel_offset);
+int hostapd_radar_cac(struct hostapd_data *hapd, int enable);
int hostapd_set_rts(struct hostapd_data *hapd, int rts);
int hostapd_set_frag(struct hostapd_data *hapd, int frag);
int hostapd_sta_set_flags(struct hostapd_data *hapd, u8 *addr,
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index c55c42a..1006bc0 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -521,6 +521,10 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
break;
hostapd_event_sta_low_ack(hapd, data->low_ack.addr);
break;
+ case EVENT_RADAR_CAC_DONE:
+ if (hapd->iface->radar_cac_cb)
+ hapd->iface->radar_cac_cb(hapd);
+ break;
case EVENT_RADAR_FLAGS_CHANGED:
hostapd_radar_flags_changed(hapd, data->radar.freq,
data->radar.flags);
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 592a01f..a065fc9 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -695,6 +695,82 @@ static int setup_interface(struct hostapd_iface *iface)
return 0;
}
}
+ return hostapd_setup_radar_complete(iface);
+}
+
+static int hostapd_channel_availability_check(struct hostapd_data *hapd)
+{
+ struct hostapd_iface *iface = hapd->iface;
+
+ iface->freq = hostapd_hw_get_freq(hapd, hapd->iconf->channel);
+ if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq,
+ hapd->iconf->channel,
+ hapd->iconf->ieee80211n,
+ hapd->iconf->secondary_channel)) {
+ wpa_printf(MSG_ERROR, "Could not set channel for "
+ "kernel driver");
+ return -1;
+ }
+
+ if (hostapd_radar_cac(hapd, 1))
+ return -1;
+
+ return 0;
+}
+
+static void hostapd_cac_done(struct hostapd_data *hapd)
+{
+ struct hostapd_iface *iface = hapd->iface;
+ u32 flags;
+
+ iface->radar_cac_cb = NULL;
+ iface->radar_flags_cb = NULL;
+ flags = hostapd_hw_get_radar_flags(hapd, iface->conf->channel);
+ if ((flags & HOSTAPD_CHAN_RADAR_CLEAR)) {
+ hostapd_setup_interface_complete(iface, 0);
+ return;
+ }
+ if ((flags & HOSTAPD_CHAN_RADAR_INTERFERENCE)) {
+ int chan = iface->conf->channel;
+ u32 newflags;
+ iface->conf->channel = 0;
+ if (hostapd_select_random_channel(iface))
+ iface->conf->channel = chan;
+ newflags = hostapd_hw_get_radar_flags(hapd,
+ iface->conf->channel);
+ if ((newflags & HOSTAPD_CHAN_RADAR_INTERFERENCE))
+ iface->radar_flags_cb = hostapd_cac_done;
+ else
+ hostapd_cac_done(hapd);
+ } else {
+ if (hostapd_channel_availability_check(hapd))
+ hostapd_setup_interface_complete(iface, 1);
+ iface->radar_cac_cb = hostapd_cac_done;
+ }
+}
+
+int hostapd_setup_radar_complete(struct hostapd_iface *iface)
+{
+ struct hostapd_data *hapd = iface->bss[0];
+ u32 flags;
+
+ flags = hostapd_hw_get_radar_flags(hapd, iface->conf->channel);
+ if ((flags & HOSTAPD_CHAN_RADAR) == 0)
+ return hostapd_setup_interface_complete(iface, 0);
+ if ((flags & HOSTAPD_CHAN_RADAR_INTERFERENCE)) {
+ hapd->iface->radar_flags_cb = hostapd_cac_done;
+ wpa_printf(MSG_DEBUG, "Interface initialization will "
+ "be completed in a callback");
+ return 0;
+ }
+ if ((flags & HOSTAPD_CHAN_RADAR_CLEAR) == 0) {
+ if (hostapd_channel_availability_check(hapd))
+ return hostapd_setup_interface_complete(iface, 1);
+ iface->radar_cac_cb = hostapd_cac_done;
+ wpa_printf(MSG_DEBUG, "Interface initialization will "
+ "be completed in a callback");
+ return 0;
+ }
return hostapd_setup_interface_complete(iface, 0);
}
@@ -919,5 +995,12 @@ void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
void hostapd_radar_flags_changed(struct hostapd_data *hapd, int freq, u32 flags)
{
+ struct hostapd_iface *iface = hapd->iface;
+
hostapd_hw_set_radar_flags(hapd, freq, flags);
+
+ if (iface->radar_flags_cb) {
+ iface->radar_flags_cb(hapd);
+ return;
+ }
}
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index e2e4234..b38a91d 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -215,6 +215,10 @@ struct hostapd_iface {
u16 ht_op_mode;
void (*scan_cb)(struct hostapd_iface *iface);
+ /* Radar handling callbacks */
+ void (*radar_cac_cb)(struct hostapd_data *hapd);
+ void (*radar_flags_cb)(struct hostapd_data *hapd);
+
int (*ctrl_iface_init)(struct hostapd_data *hapd);
void (*ctrl_iface_deinit)(struct hostapd_data *hapd);
@@ -230,6 +234,7 @@ hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
struct hostapd_config *conf,
struct hostapd_bss_config *bss);
int hostapd_setup_interface(struct hostapd_iface *iface);
+int hostapd_setup_radar_complete(struct hostapd_iface *iface);
int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
void hostapd_interface_deinit(struct hostapd_iface *iface);
void hostapd_interface_free(struct hostapd_iface *iface);
diff --git a/src/ap/hw_features.c b/src/ap/hw_features.c
index 04bf210..a7f4eda 100644
--- a/src/ap/hw_features.c
+++ b/src/ap/hw_features.c
@@ -505,7 +505,7 @@ static void ieee80211n_check_scan(struct hostapd_iface *iface)
iface->conf->ht_capab &= ~HT_CAP_INFO_SUPP_CHANNEL_WIDTH_SET;
}
- hostapd_setup_interface_complete(iface, 0);
+ hostapd_setup_radar_complete(iface);
}
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 777f854..0bbf4bd 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1498,6 +1498,14 @@ struct wpa_driver_ops {
int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
/**
+ * radar_cac - Start/stop CAC (AP only)
+ * @priv: Private driver interface data
+ * @enable: Enable/disable CAC (0 = disable, 1 = enable)
+ * Returns 0 on success, -1 on failure
+ */
+ int (*radar_cac)(void *priv, int enable);
+
+ /**
* set_rts - Set RTS threshold
* @priv: Private driver interface data
* @rts: RTS threshold in octets
@@ -2581,6 +2589,7 @@ enum wpa_event_type {
EVENT_P2P_SD_REQUEST,
EVENT_P2P_SD_RESPONSE,
+ EVENT_RADAR_CAC_DONE,
EVENT_RADAR_FLAGS_CHANGED,
};
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index d919a73..b7b7bdb 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1294,6 +1294,9 @@ static void nl80211_radar_event(struct wpa_driver_nl80211_data *drv, u32 cmd,
union wpa_event_data data;
switch (cmd) {
+ case NL80211_CMD_RADAR_CAC_DONE:
+ wpa_supplicant_event(drv->ctx, EVENT_RADAR_CAC_DONE, NULL);
+ break;
case NL80211_CMD_RADAR_FLAGS_CHANGED:
if (!tb[NL80211_FREQUENCY_ATTR_FREQ])
return;
@@ -1424,6 +1427,7 @@ static int process_event(struct nl_msg *msg, void *arg)
case NL80211_CMD_NEW_STATION:
nl80211_new_station_event(drv, tb);
break;
+ case NL80211_CMD_RADAR_CAC_DONE:
case NL80211_CMD_RADAR_FLAGS_CHANGED:
nl80211_radar_event(drv, gnlh->cmd, tb);
break;
@@ -5102,6 +5106,36 @@ static int i802_set_freq(void *priv, struct hostapd_freq_params *freq)
#ifdef HOSTAPD
+static int i802_radar_cac(void *priv, int enable)
+{
+ struct i802_bss *bss = priv;
+ struct wpa_driver_nl80211_data *drv = bss->drv;
+ struct nl_msg *msg;
+ int cmd, ret;
+
+ msg = nlmsg_alloc();
+ if (!msg)
+ return -1;
+
+ if (enable)
+ cmd = NL80211_CMD_RADAR_CAC_START;
+ else
+ cmd = NL80211_CMD_RADAR_CAC_STOP;
+
+ genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, 0, cmd, 0);
+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(bss->ifname));
+
+ ret = send_and_recv_msgs(drv, msg, NULL, NULL);
+ if (ret != 0) {
+ wpa_printf(MSG_DEBUG, "nl80211: Failed to start CAC: %d (%s)",
+ ret, strerror(-ret));
+ }
+ return ret;
+
+ nla_put_failure:
+ return -1;
+}
+
static int i802_set_rts(void *priv, int rts)
{
struct i802_bss *bss = priv;
@@ -6424,6 +6458,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.hapd_deinit = i802_deinit,
.get_seqnum = i802_get_seqnum,
.flush = i802_flush,
+ .radar_cac = i802_radar_cac,
.read_sta_data = i802_read_sta_data,
.sta_deauth = i802_sta_deauth,
.sta_disassoc = i802_sta_disassoc,
--
1.5.6.5
^ permalink raw reply related
* WWAN driver for Huawei MU509 chip?
From: Brzezowski, Karen @ 2011-01-17 16:52 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org
Is this the right mailing list for asking for information
on drivers for the Huawei MU509 WCDMA chip?
thanks,
Karen
^ permalink raw reply
* [PATCH] wl12xx: free firmware after booting the chip
From: Eliad Peller @ 2011-01-17 17:17 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless
There is no need to save the fw in memory after it has been
uploaded to the chip.
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
drivers/net/wireless/wl12xx/main.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 8a35491..e1944b1 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -691,7 +691,6 @@ static int wl1271_fetch_firmware(struct wl1271 *wl)
goto out;
}
- vfree(wl->fw);
wl->fw_len = fw->size;
wl->fw = vmalloc(wl->fw_len);
@@ -891,7 +890,7 @@ int wl1271_plt_start(struct wl1271 *wl)
wl->state = WL1271_STATE_PLT;
wl1271_notice("firmware booted in PLT mode (%s)",
wl->chip.fw_ver);
- goto out;
+ goto out_free_fw;
irq_disable:
wl1271_disable_interrupts(wl);
@@ -911,6 +910,9 @@ power_off:
wl1271_error("firmware boot in PLT mode failed despite %d retries",
WL1271_BOOT_RETRIES);
+out_free_fw:
+ vfree(wl->fw);
+ wl->fw = NULL;
out:
mutex_unlock(&wl->mutex);
@@ -1126,7 +1128,7 @@ power_off:
if (!booted) {
wl1271_error("firmware boot failed despite %d retries",
WL1271_BOOT_RETRIES);
- goto out;
+ goto out_free_fw;
}
wl->vif = vif;
@@ -1148,6 +1150,9 @@ power_off:
wl1271_debug(DEBUG_MAC80211, "11a is %ssupported",
wl->enable_11a ? "" : "not ");
+out_free_fw:
+ vfree(wl->fw);
+ wl->fw = NULL;
out:
mutex_unlock(&wl->mutex);
@@ -3300,8 +3305,6 @@ int wl1271_free_hw(struct wl1271 *wl)
wl1271_debugfs_exit(wl);
- vfree(wl->fw);
- wl->fw = NULL;
kfree(wl->nvs);
wl->nvs = NULL;
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH] mac80211: drop non-auth 3-addr data frames when running as a 4-addr station
From: Felix Fietkau @ 2011-01-17 17:40 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, linville
In-Reply-To: <1295274050.3726.11.camel@jlt3.sipsolutions.net>
On 2011-01-17 3:20 PM, Johannes Berg wrote:
> On Sat, 2011-01-15 at 14:38 +0100, Felix Fietkau wrote:
>> When running as a 4-addr station against an AP that has the 4-addr VLAN
>> interface and the main 3-addr AP interface bridged together, sometimes
>> frames originating from the station were looping back from the 3-addr AP
>> interface, causing the bridge code to emit warnings about receiving frames
>> with its own source address.
>> I'm not sure why this is happening yet, but I think it's a good idea to
>> drop all frames (except 802.1x/EAP frames) that do not match the configured
>> addressing mode, including 4-address frames sent to a 3-address station.
>> User test reports indicate that the problem goes away with this patch.
>>
>> Signed-off-by: Felix Fietkau<nbd@openwrt.org>
>> ---
>> net/mac80211/rx.c | 8 ++++++--
>> 1 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
>> index a6701ed..54e3108 100644
>> --- a/net/mac80211/rx.c
>> +++ b/net/mac80211/rx.c
>> @@ -1561,9 +1561,13 @@ __ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
>> sdata->vif.type == NL80211_IFTYPE_AP_VLAN&& !sdata->u.vlan.sta)
>> return -1;
>>
>> + if (!ieee80211_802_1x_port_control(rx)&&
>
> I think you need a different check there. This just checks the STA is
> authorized.
You're right. I'll fix and resend.
- Felix
^ permalink raw reply
* Re: [PATCH] wl12xx: free firmware after booting the chip
From: Johannes Berg @ 2011-01-17 17:58 UTC (permalink / raw)
To: Eliad Peller; +Cc: Luciano Coelho, linux-wireless
In-Reply-To: <1295284675-30029-1-git-send-email-eliad@wizery.com>
On Mon, 2011-01-17 at 19:17 +0200, Eliad Peller wrote:
> There is no need to save the fw in memory after it has been
> uploaded to the chip.
Are you sure it's not needed for resume? At which point userspace isn't
up so you can't load it.
johannes
^ permalink raw reply
* [PATCH 1/1] mac80211: mesh only parameter mppath maybe unused
From: wey-yi.w.guy @ 2011-01-17 18:08 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Wey-Yi Guy
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
mppath is mesh related parameter and maybe unused
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
net/mac80211/tx.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index dc261bb..2378305 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1750,7 +1750,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
__le16 fc;
struct ieee80211_hdr hdr;
struct ieee80211s_hdr mesh_hdr __maybe_unused;
- struct mesh_path *mppath = NULL;
+ struct mesh_path __maybe_unused *mppath = NULL;
const u8 *encaps_data;
int encaps_len, skip_header_bytes;
int nh_pos, h_pos;
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCH] wl12xx: free firmware after booting the chip
From: Eliad Peller @ 2011-01-17 18:11 UTC (permalink / raw)
To: Johannes Berg; +Cc: Luciano Coelho, linux-wireless
In-Reply-To: <1295287108.3726.49.camel@jlt3.sipsolutions.net>
good point!
does loading it on suspend makes sense, or i should abandon this patch?
On Mon, Jan 17, 2011 at 7:58 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2011-01-17 at 19:17 +0200, Eliad Peller wrote:
>> There is no need to save the fw in memory after it has been
>> uploaded to the chip.
>
> Are you sure it's not needed for resume? At which point userspace isn't
> up so you can't load it.
>
> johannes
>
>
^ permalink raw reply
* Re: [PATCH] wl12xx: free firmware after booting the chip
From: Johannes Berg @ 2011-01-17 18:13 UTC (permalink / raw)
To: Eliad Peller; +Cc: Luciano Coelho, linux-wireless
In-Reply-To: <AANLkTikhz0p1SCP1Lm2qzR4TYdh3OH+vSzWBshfoG5-e@mail.gmail.com>
On Mon, 2011-01-17 at 20:11 +0200, Eliad Peller wrote:
> good point!
> does loading it on suspend makes sense, or i should abandon this patch?
I wouldn't, you then run into failure modes where it can't be loaded
during suspend either, etc. It's not huge anyway, is it?
johannes
^ permalink raw reply
* Re: [PATCH] wl12xx: free firmware after booting the chip
From: Eliad Peller @ 2011-01-17 19:32 UTC (permalink / raw)
To: Johannes Berg; +Cc: Luciano Coelho, linux-wireless
In-Reply-To: <1295287996.3726.50.camel@jlt3.sipsolutions.net>
it's about 270K...
i guess i'll leave it for now.
thanks!
On Mon, Jan 17, 2011 at 8:13 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2011-01-17 at 20:11 +0200, Eliad Peller wrote:
>> good point!
>> does loading it on suspend makes sense, or i should abandon this patch?
>
> I wouldn't, you then run into failure modes where it can't be loaded
> during suspend either, etc. It's not huge anyway, is it?
>
> johannes
>
>
^ permalink raw reply
* [PATCH v4 2/2] ath9k: Add 'misc' file to debugfs, fix queue indexes.
From: greearb @ 2011-01-17 19:54 UTC (permalink / raw)
To: linux-wireless; +Cc: ath9k-devel, Ben Greear
From: Ben Greear <greearb@candelatech.com>
Add a misc file to show hardware op-mode, irq setup,
number of various types of VIFs and more.
Also, previous patches were using the wrong xmit queue
indexes. Change to use the internal ath9k indexes instead
of the mac80211 queue indexes.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
v4: Update to use iterator to gather vif stats. Print
calculated bssid mask as well. (Forgot to refresh patch
last time, so patch didn't actually match description.)
:100644 100644 b0cb792... f0c80ec... M drivers/net/wireless/ath/ath9k/debug.c
drivers/net/wireless/ath/ath9k/debug.c | 137 +++++++++++++++++++++++++++++---
1 files changed, 125 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index b0cb792..f0c80ec 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -595,10 +595,10 @@ static const struct file_operations fops_wiphy = {
do { \
len += snprintf(buf + len, size - len, \
"%s%13u%11u%10u%10u\n", str, \
- (unsigned int)(sc->tx.txq[WME_AC_BE].elem), \
- (unsigned int)(sc->tx.txq[WME_AC_BK].elem), \
- (unsigned int)(sc->tx.txq[WME_AC_VI].elem), \
- (unsigned int)(sc->tx.txq[WME_AC_VO].elem)); \
+ (unsigned int)(sc->tx.txq[ATH_TXQ_AC_BE].elem), \
+ (unsigned int)(sc->tx.txq[ATH_TXQ_AC_BK].elem), \
+ (unsigned int)(sc->tx.txq[ATH_TXQ_AC_VI].elem), \
+ (unsigned int)(sc->tx.txq[ATH_TXQ_AC_VO].elem)); \
if (len >= size) \
goto done; \
} while(0)
@@ -607,10 +607,10 @@ do { \
do { \
len += snprintf(buf + len, size - len, \
"%s%13i%11i%10i%10i\n", str, \
- list_empty(&sc->tx.txq[WME_AC_BE].elem), \
- list_empty(&sc->tx.txq[WME_AC_BK].elem), \
- list_empty(&sc->tx.txq[WME_AC_VI].elem), \
- list_empty(&sc->tx.txq[WME_AC_VO].elem)); \
+ list_empty(&sc->tx.txq[ATH_TXQ_AC_BE].elem), \
+ list_empty(&sc->tx.txq[ATH_TXQ_AC_BK].elem), \
+ list_empty(&sc->tx.txq[ATH_TXQ_AC_VI].elem), \
+ list_empty(&sc->tx.txq[ATH_TXQ_AC_VO].elem)); \
if (len >= size) \
goto done; \
} while (0)
@@ -657,10 +657,10 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
PR("hw-tx-proc-desc: ", txprocdesc);
len += snprintf(buf + len, size - len,
"%s%11p%11p%10p%10p\n", "txq-memory-address:",
- &(sc->tx.txq[WME_AC_BE]),
- &(sc->tx.txq[WME_AC_BK]),
- &(sc->tx.txq[WME_AC_VI]),
- &(sc->tx.txq[WME_AC_VO]));
+ &(sc->tx.txq[ATH_TXQ_AC_BE]),
+ &(sc->tx.txq[ATH_TXQ_AC_BK]),
+ &(sc->tx.txq[ATH_TXQ_AC_VI]),
+ &(sc->tx.txq[ATH_TXQ_AC_VO]));
if (len >= size)
goto done;
@@ -777,6 +777,108 @@ done:
return retval;
}
+static ssize_t read_file_misc(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath_softc *sc = file->private_data;
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct ath_hw *ah = sc->sc_ah;
+ struct ieee80211_hw *hw = sc->hw;
+ char *buf;
+ unsigned int len = 0, size = 8000;
+ ssize_t retval = 0;
+ const char *tmp;
+ unsigned int reg;
+ struct ath9k_vif_iter_data iter_data;
+
+ ath9k_calculate_iter_data(hw, NULL, &iter_data);
+
+ buf = kzalloc(size, GFP_KERNEL);
+ if (buf == NULL)
+ return -ENOMEM;
+
+ switch (sc->sc_ah->opmode) {
+ case NL80211_IFTYPE_ADHOC:
+ tmp = "ADHOC";
+ break;
+ case NL80211_IFTYPE_MESH_POINT:
+ tmp = "MESH";
+ break;
+ case NL80211_IFTYPE_AP:
+ tmp = "AP";
+ break;
+ case NL80211_IFTYPE_STATION:
+ tmp = "STATION";
+ break;
+ default:
+ tmp = "???";
+ break;
+ }
+
+ len += snprintf(buf + len, size - len,
+ "curbssid: %pM\n"
+ "OP-Mode: %s(%i)\n"
+ "Beacon-Timer-Register: 0x%x\n",
+ common->curbssid,
+ tmp, (int)(sc->sc_ah->opmode),
+ REG_READ(ah, AR_BEACON_PERIOD));
+
+ reg = REG_READ(ah, AR_TIMER_MODE);
+ len += snprintf(buf + len, size - len, "Timer-Mode-Register: 0x%x (",
+ reg);
+ if (reg & AR_TBTT_TIMER_EN)
+ len += snprintf(buf + len, size - len, "TBTT ");
+ if (reg & AR_DBA_TIMER_EN)
+ len += snprintf(buf + len, size - len, "DBA ");
+ if (reg & AR_SWBA_TIMER_EN)
+ len += snprintf(buf + len, size - len, "SWBA ");
+ if (reg & AR_HCF_TIMER_EN)
+ len += snprintf(buf + len, size - len, "HCF ");
+ if (reg & AR_TIM_TIMER_EN)
+ len += snprintf(buf + len, size - len, "TIM ");
+ if (reg & AR_DTIM_TIMER_EN)
+ len += snprintf(buf + len, size - len, "DTIM ");
+ len += snprintf(buf + len, size - len, ")\n");
+
+ reg = sc->sc_ah->imask;
+ len += snprintf(buf + len, size - len, "imask: 0x%x (", reg);
+ if (reg & ATH9K_INT_SWBA)
+ len += snprintf(buf + len, size - len, "SWBA ");
+ if (reg & ATH9K_INT_BMISS)
+ len += snprintf(buf + len, size - len, "BMISS ");
+ if (reg & ATH9K_INT_CST)
+ len += snprintf(buf + len, size - len, "CST ");
+ if (reg & ATH9K_INT_RX)
+ len += snprintf(buf + len, size - len, "RX ");
+ if (reg & ATH9K_INT_RXHP)
+ len += snprintf(buf + len, size - len, "RXHP ");
+ if (reg & ATH9K_INT_RXLP)
+ len += snprintf(buf + len, size - len, "RXLP ");
+ if (reg & ATH9K_INT_BB_WATCHDOG)
+ len += snprintf(buf + len, size - len, "BB_WATCHDOG ");
+ /* there are other IRQs if one wanted to add them. */
+ len += snprintf(buf + len, size - len, ")\n");
+
+ len += snprintf(buf + len, size - len,
+ "VIF Counts: AP: %i STA: %i MESH: %i WDS: %i"
+ " ADHOC: %i OTHER: %i nvifs: %hi beacon-vifs: %hi\n",
+ iter_data.naps, iter_data.nstations, iter_data.nmeshes,
+ iter_data.nwds, iter_data.nadhocs, iter_data.nothers,
+ sc->nvifs, sc->nbcnvifs);
+
+ len += snprintf(buf + len, size - len,
+ "Calculated-BSSID-Mask: %pM\n",
+ iter_data.mask);
+
+ if (len > size)
+ len = size;
+
+ retval = simple_read_from_buffer(user_buf, count, ppos, buf, len);
+ kfree(buf);
+
+ return retval;
+}
+
void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
struct ath_tx_status *ts)
{
@@ -822,6 +924,13 @@ static const struct file_operations fops_stations = {
.llseek = default_llseek,
};
+static const struct file_operations fops_misc = {
+ .read = read_file_misc,
+ .open = ath9k_debugfs_open,
+ .owner = THIS_MODULE,
+ .llseek = default_llseek,
+};
+
static ssize_t read_file_recv(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
@@ -1063,6 +1172,10 @@ int ath9k_init_debug(struct ath_hw *ah)
sc, &fops_stations))
goto err;
+ if (!debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy,
+ sc, &fops_misc))
+ goto err;
+
if (!debugfs_create_file("recv", S_IRUSR, sc->debug.debugfs_phy,
sc, &fops_recv))
goto err;
--
1.7.2.3
^ permalink raw reply related
* Compat-wireless release for 2011-01-17 is baked
From: Compat-wireless cronjob account @ 2011-01-17 20:04 UTC (permalink / raw)
To: linux-wireless
>From git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next
bed36d7..3281fc3 history -> origin/history
+ e8883f8...f6c6cea master -> origin/master (forced update)
6ab8219..8a335bc stable -> origin/stable
* [new tag] next-20110117 -> next-20110117
compat-wireless code metrics
782520 - Total upstream lines of code being pulled
2103 - backport code changes
1843 - backport code additions
260 - backport code deletions
7279 - backport from compat module
9382 - total backport code
1.1989 - % of code consists of backport work
1531 - Crap changes not yet posted
1488 - Crap additions not yet posted
43 - Crap deletions not yet posted
0.1956 - % of crap code
Base tree: linux-next.git
Base tree version: next-20110117
compat-wireless release: compat-wireless-2011-01-06-3-g8db1608-pc
^ permalink raw reply
* Re: [PATCH 2] cfg80211: Extend channel to frequency mapping for 802.11j
From: Brian Prodoehl @ 2011-01-17 20:17 UTC (permalink / raw)
To: Bruno Randolf
Cc: johannes, linville, gwingerde, libertas-dev, dcbw, IvDoorn,
linux-wireless, users
In-Reply-To: <20110117043728.8024.13541.stgit@localhost6.localdomain6>
On Sun, Jan 16, 2011 at 11:37 PM, Bruno Randolf <br1@einfach.org> wrote:
> Extend channel to frequency mapping for 802.11j Japan 4.9GHz band, according to
> IEEE802.11 section 17.3.8.3.2 and Annex J. Because there are now overlapping
> channel numbers in the 2GHz and 5GHz band we can't map from channel to
> frequency without knowing the band. This is no problem as in most contexts we
> know the band. In places where we don't know the band (and WEXT compatibility)
> we assume the 2GHz band for channels below 14.
>
> This patch does not implement all channel to frequency mappings defined in
> 802.11, it's just an extension for 802.11j 20MHz channels. 5MHz and 10MHz
> channels as well as 802.11y channels have been omitted.
>
> The following drivers have been updated to reflect the API changes:
> iwl-3945, iwl-agn, iwmc3200wifi, libertas, mwl8k, rt2x00, wl1251, wl12xx.
> The drivers have been compile-tested only.
>
> Signed-off-by: Bruno Randolf <br1@einfach.org>
>
> ---
>
> v2: Added necessary driver changes first posted by Brian Prodoehl.
> Brian, do you want to add your Signed-off-by?
> ---
> drivers/net/wireless/iwlwifi/iwl-3945.c | 5 ++--
> drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 5 ++--
> drivers/net/wireless/iwlwifi/iwl-core.c | 3 +-
> drivers/net/wireless/iwmc3200wifi/cfg80211.c | 3 +-
> drivers/net/wireless/iwmc3200wifi/rx.c | 7 ++++-
> drivers/net/wireless/libertas/cfg.c | 6 +++-
> drivers/net/wireless/mwl8k.c | 6 +++-
> drivers/net/wireless/rt2x00/rt2x00dev.c | 5 +++-
> drivers/net/wireless/wl1251/rx.c | 3 +-
> drivers/net/wireless/wl12xx/rx.c | 2 +
> include/net/cfg80211.h | 3 +-
> net/mac80211/ibss.c | 3 +-
> net/mac80211/mesh.c | 2 +
> net/mac80211/mlme.c | 8 ++++--
> net/mac80211/scan.c | 3 +-
> net/wireless/reg.c | 6 ++--
> net/wireless/util.c | 36 ++++++++++++++++----------
> net/wireless/wext-compat.c | 5 +++-
> 18 files changed, 71 insertions(+), 40 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
> index a9b852b..1d9dcd7 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-3945.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
> @@ -594,10 +594,11 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,
>
> rx_status.flag = 0;
> rx_status.mactime = le64_to_cpu(rx_end->timestamp);
> - rx_status.freq =
> - ieee80211_channel_to_frequency(le16_to_cpu(rx_hdr->channel));
> rx_status.band = (rx_hdr->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
> IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
> + rx_status.freq =
> + ieee80211_channel_to_frequency(le16_to_cpu(rx_hdr->channel),
> + rx_status.band);
>
> rx_status.rate_idx = iwl3945_hwrate_to_plcp_idx(rx_hdr->rate);
> if (rx_status.band == IEEE80211_BAND_5GHZ)
> diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> index 3dee87e..a800318 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
> @@ -1157,10 +1157,11 @@ void iwlagn_rx_reply_rx(struct iwl_priv *priv,
>
> /* rx_status carries information about the packet to mac80211 */
> rx_status.mactime = le64_to_cpu(phy_res->timestamp);
> - rx_status.freq =
> - ieee80211_channel_to_frequency(le16_to_cpu(phy_res->channel));
> rx_status.band = (phy_res->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
> IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
> + rx_status.freq =
> + ieee80211_channel_to_frequency(le16_to_cpu(phy_res->channel),
> + rx_status.band);
> rx_status.rate_idx =
> iwlagn_hwrate_to_mac80211_idx(rate_n_flags, rx_status.band);
> rx_status.flag = 0;
> diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
> index efbde1f..a8d4a93 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-core.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-core.c
> @@ -227,7 +227,8 @@ int iwlcore_init_geos(struct iwl_priv *priv)
> geo_ch = &sband->channels[sband->n_channels++];
>
> geo_ch->center_freq =
> - ieee80211_channel_to_frequency(ch->channel);
> + ieee80211_channel_to_frequency(ch->channel,
> + sband->band);
> geo_ch->max_power = ch->max_power_avg;
> geo_ch->max_antenna_gain = 0xff;
> geo_ch->hw_value = ch->channel;
> diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
> index 5a49822..ed57e44 100644
> --- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c
> +++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
> @@ -287,7 +287,8 @@ int iwm_cfg80211_inform_bss(struct iwm_priv *iwm)
> return -EINVAL;
> }
>
> - freq = ieee80211_channel_to_frequency(umac_bss->channel);
> + freq = ieee80211_channel_to_frequency(umac_bss->channel,
> + band->band);
> channel = ieee80211_get_channel(wiphy, freq);
> signal = umac_bss->rssi * 100;
>
> diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c
> index a944893..9a57cf6 100644
> --- a/drivers/net/wireless/iwmc3200wifi/rx.c
> +++ b/drivers/net/wireless/iwmc3200wifi/rx.c
> @@ -543,7 +543,10 @@ static int iwm_mlme_assoc_complete(struct iwm_priv *iwm, u8 *buf,
> switch (le32_to_cpu(complete->status)) {
> case UMAC_ASSOC_COMPLETE_SUCCESS:
> chan = ieee80211_get_channel(wiphy,
> - ieee80211_channel_to_frequency(complete->channel));
> + ieee80211_channel_to_frequency(complete->channel,
> + complete->band == UMAC_BAND_2GHZ ?
> + IEEE80211_BAND_2GHZ :
> + IEEE80211_BAND_5GHZ));
> if (!chan || chan->flags & IEEE80211_CHAN_DISABLED) {
> /* Associated to a unallowed channel, disassociate. */
> __iwm_invalidate_mlme_profile(iwm);
> @@ -841,7 +844,7 @@ static int iwm_mlme_update_bss_table(struct iwm_priv *iwm, u8 *buf,
> goto err;
> }
>
> - freq = ieee80211_channel_to_frequency(umac_bss->channel);
> + freq = ieee80211_channel_to_frequency(umac_bss->channel, band->band);
> channel = ieee80211_get_channel(wiphy, freq);
> signal = umac_bss->rssi * 100;
>
> diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
> index 698a1f7..30ef035 100644
> --- a/drivers/net/wireless/libertas/cfg.c
> +++ b/drivers/net/wireless/libertas/cfg.c
> @@ -607,7 +607,8 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
> /* No channel, no luck */
> if (chan_no != -1) {
> struct wiphy *wiphy = priv->wdev->wiphy;
> - int freq = ieee80211_channel_to_frequency(chan_no);
> + int freq = ieee80211_channel_to_frequency(chan_no,
> + IEEE80211_BAND_2GHZ);
> struct ieee80211_channel *channel =
> ieee80211_get_channel(wiphy, freq);
>
> @@ -1597,7 +1598,8 @@ static int lbs_get_survey(struct wiphy *wiphy, struct net_device *dev,
> lbs_deb_enter(LBS_DEB_CFG80211);
>
> survey->channel = ieee80211_get_channel(wiphy,
> - ieee80211_channel_to_frequency(priv->channel));
> + ieee80211_channel_to_frequency(priv->channel,
> + IEEE80211_BAND_2GHZ));
>
> ret = lbs_get_rssi(priv, &signal, &noise);
> if (ret == 0) {
> diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
> index 809f2bf..b62f7ef 100644
> --- a/drivers/net/wireless/mwl8k.c
> +++ b/drivers/net/wireless/mwl8k.c
> @@ -906,7 +906,8 @@ mwl8k_rxd_8366_ap_process(void *_rxd, struct ieee80211_rx_status *status,
> } else {
> status->band = IEEE80211_BAND_2GHZ;
> }
> - status->freq = ieee80211_channel_to_frequency(rxd->channel);
> + status->freq = ieee80211_channel_to_frequency(rxd->channel,
> + status->band);
>
> *qos = rxd->qos_control;
>
> @@ -1013,7 +1014,8 @@ mwl8k_rxd_sta_process(void *_rxd, struct ieee80211_rx_status *status,
> } else {
> status->band = IEEE80211_BAND_2GHZ;
> }
> - status->freq = ieee80211_channel_to_frequency(rxd->channel);
> + status->freq = ieee80211_channel_to_frequency(rxd->channel,
> + status->band);
>
> *qos = rxd->qos_control;
> if ((rxd->rx_ctrl & MWL8K_STA_RX_CTRL_DECRYPT_ERROR) &&
> diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
> index 9597a03..31b7db0 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
> @@ -649,7 +649,10 @@ static void rt2x00lib_channel(struct ieee80211_channel *entry,
> const int channel, const int tx_power,
> const int value)
> {
> - entry->center_freq = ieee80211_channel_to_frequency(channel);
> + /* XXX: this assumption about the band is wrong for 802.11j */
> + entry->band = channel <= 14 ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
> + entry->center_freq = ieee80211_channel_to_frequency(channel,
> + entry->band);
> entry->hw_value = value;
> entry->max_power = tx_power;
> entry->max_antenna_gain = 0xff;
> diff --git a/drivers/net/wireless/wl1251/rx.c b/drivers/net/wireless/wl1251/rx.c
> index efa5360..86eef45 100644
> --- a/drivers/net/wireless/wl1251/rx.c
> +++ b/drivers/net/wireless/wl1251/rx.c
> @@ -78,7 +78,8 @@ static void wl1251_rx_status(struct wl1251 *wl,
> */
> wl->noise = desc->rssi - desc->snr / 2;
>
> - status->freq = ieee80211_channel_to_frequency(desc->channel);
> + status->freq = ieee80211_channel_to_frequency(desc->channel,
> + status->band);
>
> status->flag |= RX_FLAG_TSFT;
>
> diff --git a/drivers/net/wireless/wl12xx/rx.c b/drivers/net/wireless/wl12xx/rx.c
> index 682304c..ec8d843 100644
> --- a/drivers/net/wireless/wl12xx/rx.c
> +++ b/drivers/net/wireless/wl12xx/rx.c
> @@ -76,7 +76,7 @@ static void wl1271_rx_status(struct wl1271 *wl,
> */
> wl->noise = desc->rssi - (desc->snr >> 1);
>
> - status->freq = ieee80211_channel_to_frequency(desc->channel);
> + status->freq = ieee80211_channel_to_frequency(desc->channel, desc_band);
>
> if (desc->flags & WL1271_RX_DESC_ENCRYPT_MASK) {
> status->flag |= RX_FLAG_IV_STRIPPED | RX_FLAG_MMIC_STRIPPED;
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index 1322695..679a049 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -1790,8 +1790,9 @@ static inline void *wdev_priv(struct wireless_dev *wdev)
> /**
> * ieee80211_channel_to_frequency - convert channel number to frequency
> * @chan: channel number
> + * @band: band, necessary due to channel number overlap
> */
> -extern int ieee80211_channel_to_frequency(int chan);
> +extern int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band);
>
> /**
> * ieee80211_frequency_to_channel - convert frequency to channel number
> diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
> index 53c7077..775fb63 100644
> --- a/net/mac80211/ibss.c
> +++ b/net/mac80211/ibss.c
> @@ -270,7 +270,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
> enum ieee80211_band band = rx_status->band;
>
> if (elems->ds_params && elems->ds_params_len == 1)
> - freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
> + freq = ieee80211_channel_to_frequency(elems->ds_params[0],
> + band);
> else
> freq = rx_status->freq;
>
> diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
> index 2563fd1..2a57cc0 100644
> --- a/net/mac80211/mesh.c
> +++ b/net/mac80211/mesh.c
> @@ -574,7 +574,7 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
> &elems);
>
> if (elems.ds_params && elems.ds_params_len == 1)
> - freq = ieee80211_channel_to_frequency(elems.ds_params[0]);
> + freq = ieee80211_channel_to_frequency(elems.ds_params[0], band);
> else
> freq = rx_status->freq;
>
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 45fbb9e..33bd6d4 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -176,7 +176,7 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
>
> /* check that channel matches the right operating channel */
> if (local->hw.conf.channel->center_freq !=
> - ieee80211_channel_to_frequency(hti->control_chan))
> + ieee80211_channel_to_frequency(hti->control_chan, sband->band))
> enable_ht = false;
>
> if (enable_ht) {
> @@ -429,7 +429,8 @@ void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
> container_of((void *)bss, struct cfg80211_bss, priv);
> struct ieee80211_channel *new_ch;
> struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
> - int new_freq = ieee80211_channel_to_frequency(sw_elem->new_ch_num);
> + int new_freq = ieee80211_channel_to_frequency(sw_elem->new_ch_num,
> + cbss->channel->band);
>
> ASSERT_MGD_MTX(ifmgd);
>
> @@ -1519,7 +1520,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
> }
>
> if (elems->ds_params && elems->ds_params_len == 1)
> - freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
> + freq = ieee80211_channel_to_frequency(elems->ds_params[0],
> + rx_status->band);
> else
> freq = rx_status->freq;
>
> diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
> index fb274db..1ef73be 100644
> --- a/net/mac80211/scan.c
> +++ b/net/mac80211/scan.c
> @@ -196,7 +196,8 @@ ieee80211_scan_rx(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
> ieee802_11_parse_elems(elements, skb->len - baselen, &elems);
>
> if (elems.ds_params && elems.ds_params_len == 1)
> - freq = ieee80211_channel_to_frequency(elems.ds_params[0]);
> + freq = ieee80211_channel_to_frequency(elems.ds_params[0],
> + rx_status->band);
> else
> freq = rx_status->freq;
>
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index 37693b6..c565689 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -1801,9 +1801,9 @@ void regulatory_hint_disconnect(void)
>
> static bool freq_is_chan_12_13_14(u16 freq)
> {
> - if (freq == ieee80211_channel_to_frequency(12) ||
> - freq == ieee80211_channel_to_frequency(13) ||
> - freq == ieee80211_channel_to_frequency(14))
> + if (freq == ieee80211_channel_to_frequency(12, IEEE80211_BAND_2GHZ) ||
> + freq == ieee80211_channel_to_frequency(13, IEEE80211_BAND_2GHZ) ||
> + freq == ieee80211_channel_to_frequency(14, IEEE80211_BAND_2GHZ))
> return true;
> return false;
> }
> diff --git a/net/wireless/util.c b/net/wireless/util.c
> index 7620ae2..4ed065d 100644
> --- a/net/wireless/util.c
> +++ b/net/wireless/util.c
> @@ -29,29 +29,37 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
> }
> EXPORT_SYMBOL(ieee80211_get_response_rate);
>
> -int ieee80211_channel_to_frequency(int chan)
> +int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band)
> {
> - if (chan < 14)
> - return 2407 + chan * 5;
> -
> - if (chan == 14)
> - return 2484;
> -
> - /* FIXME: 802.11j 17.3.8.3.2 */
> - return (chan + 1000) * 5;
> + /* see 802.11 17.3.8.3.2 and Annex J
> + * there are overlapping channel numbers in 5GHz and 2GHz bands */
> + if (band == IEEE80211_BAND_5GHZ) {
> + if (chan >= 182 && chan <= 196)
> + return 4000 + chan * 5;
> + else
> + return 5000 + chan * 5;
> + } else { /* IEEE80211_BAND_2GHZ */
> + if (chan == 14)
> + return 2484;
> + else if (chan < 14)
> + return 2407 + chan * 5;
> + else
> + return 0; /* not supported */
> + }
> }
> EXPORT_SYMBOL(ieee80211_channel_to_frequency);
>
> int ieee80211_frequency_to_channel(int freq)
> {
> + /* see 802.11 17.3.8.3.2 and Annex J */
> if (freq == 2484)
> return 14;
> -
> - if (freq < 2484)
> + else if (freq < 2484)
> return (freq - 2407) / 5;
> -
> - /* FIXME: 802.11j 17.3.8.3.2 */
> - return freq/5 - 1000;
> + else if (freq >= 4910 && freq <= 4980)
> + return (freq - 4000) / 5;
> + else
> + return (freq - 5000) / 5;
> }
> EXPORT_SYMBOL(ieee80211_frequency_to_channel);
>
> diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
> index 3e5dbd4..7f1f4ec 100644
> --- a/net/wireless/wext-compat.c
> +++ b/net/wireless/wext-compat.c
> @@ -267,9 +267,12 @@ int cfg80211_wext_freq(struct wiphy *wiphy, struct iw_freq *freq)
> * -EINVAL for impossible things.
> */
> if (freq->e == 0) {
> + enum ieee80211_band band = IEEE80211_BAND_2GHZ;
> if (freq->m < 0)
> return 0;
> - return ieee80211_channel_to_frequency(freq->m);
> + if (freq->m > 14)
> + band = IEEE80211_BAND_5GHZ;
> + return ieee80211_channel_to_frequency(freq->m, band);
> } else {
> int i, div = 1000000;
> for (i = 0; i < freq->e; i++)
Yeah, looks good. Is it worth noting that none of the drivers
actually support the 802.11j channels yet? Not sure of the format of
follow-up s-o-b's, so here goes...
Signed-off-by: Brian Prodoehl <bprodoehl@gmail.com>
^ permalink raw reply
* Logs spammed by associate / authenticate / CRDA calls
From: Larry Finger @ 2011-01-17 20:18 UTC (permalink / raw)
To: wireless
I have just gotten the mac80211 code for the RTL8192CU devices for integration
into wireless-testing and then to mainline. All seems to be working, but I get a
lot of disassociation./reassociation messages followed by a call to CRDA. The
output from an 'iw event -t -f' command is the following:
1295294459.884470: wlan22 (phy #4): connected to c0:3f:0e:be:2b:45
1295294530.254474: wlan22 (phy #4): unknown event 64
1295294537.006563: wlan22 (phy #4): scan started
1295294538.642236: wlan22 (phy #4): scan finished: 2412 2417 2422 2427 2432 2437
2442 2447 2452 2457 2462 2467 2472, ""
1295294538.738591: wlan22 (phy #4): deauth 00:1f:1f:c8:8e:cb ->
c0:3f:0e:be:2b:45 reason 4: Disassociated due to inactivity [frame: c0 00 00 00
c0 3f 0e be 2b 45 00 1f 1f c8 8e cb c0 3f 0e be 2b 45 00 00 04 00]
1295294538.738858: wlan22 (phy #4): disconnected (local request)
1295294538.779587: phy #0: regulatory domain change: set to world roaming by the
wireless core upon initialization request
1295294538.861421: wlan22 (phy #4): scan started
1295294539.894265: wlan22 (phy #4): scan finished: 2412 2417 2422 2427 2432 2437
2442 2447 2452 2457 2462 2467 2472, "lwfdjf_rad"
1295294539.937094: wlan22 (phy #4): auth c0:3f:0e:be:2b:45 -> 00:1f:1f:c8:8e:cb
status: 0: Successful [frame: b0 00 3a 01 00 1f 1f c8 8e cb c0 3f 0e be 2b 45 c0
3f 0e be 2b 45 a0 52 00 00 02 00 00 00 dd 09 00 10 18 02 02 f0 04 00 00]
1295294539.941963: wlan22: unknown event 19
1295294539.948184: wlan22 (phy #4): assoc c0:3f:0e:be:2b:45 -> 00:1f:1f:c8:8e:cb
status: 0: Successful [frame: 10 00 3a 01 00 1f 1f c8 8e cb c0 3f 0e be 2b 45 c0
3f 0e be 2b 45 b0 52 11 04 00 00 03 c0 01 08 82 84 8b 96 24 30 48 6c 32 04 0c 12
18 60 dd 09 00 10 18 02 02 f0 04 00 00 dd 18 00 50 f2 02 01 01 80 00 03 a4 00 00
27 a4 00 00 42 43 5e 00 62 32 2f 00]
1295294539.948508: wlan22 (phy #4): connected to c0:3f:0e:be:2b:45
1295294637.011546: wlan22 (phy #4): scan started
1295294638.646848: wlan22 (phy #4): scan finished: 2412 2417 2422 2427 2432 2437
2442 2447 2452 2457 2462 2467 2472, ""
1295294638.726666: wlan22 (phy #4): deauth 00:1f:1f:c8:8e:cb ->
c0:3f:0e:be:2b:45 reason 4: Disassociated due to inactivity [frame: c0 00 00 00
c0 3f 0e be 2b 45 00 1f 1f c8 8e cb c0 3f 0e be 2b 45 00 00 04 00]
1295294638.726940: wlan22 (phy #4): disconnected (local request)
1295294638.764810: phy #0: regulatory domain change: set to world roaming by the
wireless core upon initialization request
1295294638.845333: wlan22 (phy #4): scan started
1295294639.862231: wlan22 (phy #4): scan finished: 2412 2417 2422 2427 2432 2437
2442 2447 2452 2457 2462 2467 2472, "lwfdjf_rad"
1295294639.899905: wlan22 (phy #4): auth c0:3f:0e:be:2b:45 -> 00:1f:1f:c8:8e:cb
status: 0: Successful [frame: b0 00 3a 01 00 1f 1f c8 8e cb c0 3f 0e be 2b 45 c0
3f 0e be 2b 45 40 98 00 00 02 00 00 00 dd 09 00 10 18 02 02 f0 04 00 00]
1295294639.902684: wlan22: unknown event 19
1295294639.905854: wlan22 (phy #4): assoc c0:3f:0e:be:2b:45 -> 00:1f:1f:c8:8e:cb
status: 0: Successful [frame: 10 00 3a 01 00 1f 1f c8 8e cb c0 3f 0e be 2b 45 c0
3f 0e be 2b 45 50 98 11 04 00 00 03 c0 01 08 82 84 8b 96 24 30 48 6c 32 04 0c 12
18 60 dd 09 00 10 18 02 02 f0 04 00 00 dd 18 00 50 f2 02 01 01 80 00 03 a4 00 00
27 a4 00 00 42 43 5e 00 62 32 2f 00]
1295294639.906219: wlan22 (phy #4): connected to c0:3f:0e:be:2b:45
The MAC address for the device is 00:1F:1F:C8:8E:CB and that of the AP is
C0:3F:0E:BE:2B:45, thus corresponding with the above output.
Is scanning this often normal? I suspect it is, but I have not looged the events
before.
Although both AP and STA support 802.11n, the connection is 802.11g (max 54
Mbps) using WPA2-PSK.
What triggers the "Disassociated due to inactivity"?
Thanks,
Larry
^ permalink raw reply
* Re: Logs spammed by associate / authenticate / CRDA calls
From: Daniel Halperin @ 2011-01-17 20:26 UTC (permalink / raw)
To: Larry Finger; +Cc: wireless
In-Reply-To: <4D34A421.3070804@lwfinger.net>
On Mon, Jan 17, 2011 at 12:18 PM, Larry Finger
<Larry.Finger@lwfinger.net> wrote:
> The MAC address for the device is 00:1F:1F:C8:8E:CB and that of the AP is
> C0:3F:0E:BE:2B:45, thus corresponding with the above output.
>
> Is scanning this often normal? I suspect it is, but I have not looged the events
> before.
>
> Although both AP and STA support 802.11n, the connection is 802.11g (max 54
> Mbps) using WPA2-PSK.
>
> What triggers the "Disassociated due to inactivity"?
Scanning happens every time you associate/re-associate; disassociation
due to inactivity happens when your device doesn't send packets to the
AP for some period of time. It looks like your AP's (or device's)
timeout is 100s.
Dan
^ permalink raw reply
* Re: BUG in rt2x00lib_txdone() with 2.6.37-rc8
From: Ivo Van Doorn @ 2011-01-17 20:36 UTC (permalink / raw)
To: Ingo Brunberg; +Cc: helmut.schaa, linux-kernel, linux-wireless
In-Reply-To: <m3pqrxr1vl.fsf@ingo.homenetwork>
Hi,
On Sun, Jan 16, 2011 at 3:58 AM, Ingo Brunberg <ingo_brunberg@web.de> wrote:
> Ivo Van Doorn <ivdoorn@gmail.com> writes:
>
>> This could be, would be interesting to know if compat-wireless also shows
>> this problem. Because the queue refactoring code which should have solved
>> these race conditions was added after 2.6.37.
>
> I really would like to give it a try, but compat-wireless-2011-01-15
> crashes right on module loading. Is there a version known to work?
You could try the rt2x00-special package:
http://kernel.org/pub/linux/kernel/people/ivd/compat-rt2x00.tar.bz2
this is compat-wireless + rt2x00 patches from rt2x00.git.
For me it is working without any crashes..
Ivo
^ permalink raw reply
* Re: Logs spammed by associate / authenticate / CRDA calls
From: Ben Greear @ 2011-01-17 22:02 UTC (permalink / raw)
To: Daniel Halperin; +Cc: Larry Finger, wireless
In-Reply-To: <AANLkTin_DESckMrOMK41z3oJtXwmHvL026Mi8ayLeKLA@mail.gmail.com>
On 01/17/2011 12:26 PM, Daniel Halperin wrote:
> On Mon, Jan 17, 2011 at 12:18 PM, Larry Finger
> <Larry.Finger@lwfinger.net> wrote:
>> The MAC address for the device is 00:1F:1F:C8:8E:CB and that of the AP is
>> C0:3F:0E:BE:2B:45, thus corresponding with the above output.
>>
>> Is scanning this often normal? I suspect it is, but I have not looged the events
>> before.
>>
>> Although both AP and STA support 802.11n, the connection is 802.11g (max 54
>> Mbps) using WPA2-PSK.
>>
>> What triggers the "Disassociated due to inactivity"?
>
> Scanning happens every time you associate/re-associate; disassociation
> due to inactivity happens when your device doesn't send packets to the
> AP for some period of time. It looks like your AP's (or device's)
> timeout is 100s.
From what I can tell, this message can also happen if the local
STA thinks it cannot connect to the remote. For instance, if it
doesn't get a TX callback within 500ms for ath5k/ath9k (and perhaps
others).
Thanks,
Ben
>
> Dan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: Logs spammed by associate / authenticate / CRDA calls
From: Larry Finger @ 2011-01-17 22:26 UTC (permalink / raw)
To: Ben Greear; +Cc: Daniel Halperin, wireless
In-Reply-To: <4D34BC83.2030406@candelatech.com>
On 01/17/2011 04:02 PM, Ben Greear wrote:
> On 01/17/2011 12:26 PM, Daniel Halperin wrote:
>> On Mon, Jan 17, 2011 at 12:18 PM, Larry Finger
>>
>> Scanning happens every time you associate/re-associate; disassociation
>> due to inactivity happens when your device doesn't send packets to the
>> AP for some period of time. It looks like your AP's (or device's)
>> timeout is 100s.
>
> From what I can tell, this message can also happen if the local
> STA thinks it cannot connect to the remote. For instance, if it
> doesn't get a TX callback within 500ms for ath5k/ath9k (and perhaps
> others).
Thanks Dan and Ben. It is clearly not an ordinary timeout from inactivity as it
happens even when I'm doing a download. I'll push it back to the Realtek people
to see if they can figure out a cause.
Larry
^ permalink raw reply
* Re: Fwd: [PATCH 06/10] mac80211: add HW flag for disabling auto link-PS in AP mode
From: Arik Nemtsov @ 2011-01-17 22:47 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Luciano Coelho
In-Reply-To: <1295256929.3726.2.camel@jlt3.sipsolutions.net>
On Mon, Jan 17, 2011 at 11:35, Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Sun, 2011-01-16 at 23:53 +0200, Arik Nemtsov wrote:
>
> > > Also, I'm worried about races between this and RX. All of the RX path
> > > assumes that it is running at the same time. The ap_sta_ps_{start,end}
> > > functions won't be called from the RX path when the flag is set, and
> > > this is dependent on setting the flag, but is there really nothing in
> > > them that could race?
> >
> > They might race if the user is not careful. On a SMP machine a user
> > can call ieee80211_rx() and ap_sta_ps_start() from two different
> > workqueues for example.
> > I can add an explicit mutex, but a documentation warning will suffice here no?
>
> Well, a mutex won't be possible, and we don't do "code path locking"
I meant a spinlock of course (but its not really a good idea)
>
> anyway. I'd appreciate if you could actually see which things would
> potentially race -- I took a brief look into these functions and it
> didn't look like there are actually races except of these two against
> each other maybe?
Upon closer examination, I could find no races in the RX path. A race
of ps_start/stop is possible of course, but I guess we can demand the
calls to be synchronized against each other?
I did notice some concurrency that can happen in the TX path. I think
the same essential race is described in
ieee80211_handle_filtered_frame() between RX and TX paths. Only this
time the PS state is changed manually and not in the RX handler. The
warning in ieee80211_handle_filtered_frame() can be expanded to
include:
"always change PS state of connected stations before TX status events
if ordering can be unknown, for example with different interrupt
status bits."
> > sta_notify is pretty useless when the low level driver calls toggles
> > the PS-mode by itself. How about I simply remove the call to
> > sta_notify in case IEEE80211_HW_AP_LINK_PS is set?
> > If a low level driver needs to do some deferred processing after a
> > PS-mode transition, it can queue a work on its own..
>
> Yes, that's probably a good idea -- but definitely needs to be
> documented in the sta_notify docs. OTOH, mac80211 de-bounces sta_notify
> in a way. Maybe that needs to be done for the function call as well,
> maybe via a return value?
>
I'm afraid I didn't catch your meaning here.
Regards,
Arik
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox