* [PATCH v2] mac80211: use oneshot blink API for LED triggers
From: Fabio Baltieri @ 2013-07-25 10:00 UTC (permalink / raw)
To: Johannes Berg
Cc: John W. Linville, linux-wireless, netdev, linux-kernel,
Fabio Baltieri
Change mac80211 LED trigger code to use the generic
led_trigger_blink_oneshot() API for transmit and receive activity
indication.
This gives a better feedback to the user, as with the new API each
activity event results in a visible blink, while a constant traffic
results in a continuous blink at constant rate.
Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
---
Changes from v1:
- fixed some wrong indentations
net/mac80211/ieee80211_i.h | 1 -
net/mac80211/led.c | 19 +++++++------------
net/mac80211/led.h | 2 +-
net/mac80211/status.c | 2 +-
net/mac80211/tx.c | 1 -
5 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 8412a30..1178139 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1063,7 +1063,6 @@ struct ieee80211_local {
u32 dot11TransmittedFrameCount;
#ifdef CONFIG_MAC80211_LEDS
- int tx_led_counter, rx_led_counter;
struct led_trigger *tx_led, *rx_led, *assoc_led, *radio_led;
struct tpt_led_trigger *tpt_led_trigger;
char tx_led_name[32], rx_led_name[32],
diff --git a/net/mac80211/led.c b/net/mac80211/led.c
index bcffa69..e2b8364 100644
--- a/net/mac80211/led.c
+++ b/net/mac80211/led.c
@@ -12,27 +12,22 @@
#include <linux/export.h>
#include "led.h"
+#define MAC80211_BLINK_DELAY 50 /* ms */
+
void ieee80211_led_rx(struct ieee80211_local *local)
{
+ unsigned long led_delay = MAC80211_BLINK_DELAY;
if (unlikely(!local->rx_led))
return;
- if (local->rx_led_counter++ % 2 == 0)
- led_trigger_event(local->rx_led, LED_OFF);
- else
- led_trigger_event(local->rx_led, LED_FULL);
+ led_trigger_blink_oneshot(local->rx_led, &led_delay, &led_delay, 0);
}
-/* q is 1 if a packet was enqueued, 0 if it has been transmitted */
-void ieee80211_led_tx(struct ieee80211_local *local, int q)
+void ieee80211_led_tx(struct ieee80211_local *local)
{
+ unsigned long led_delay = MAC80211_BLINK_DELAY;
if (unlikely(!local->tx_led))
return;
- /* not sure how this is supposed to work ... */
- local->tx_led_counter += 2*q-1;
- if (local->tx_led_counter % 2 == 0)
- led_trigger_event(local->tx_led, LED_OFF);
- else
- led_trigger_event(local->tx_led, LED_FULL);
+ led_trigger_blink_oneshot(local->tx_led, &led_delay, &led_delay, 0);
}
void ieee80211_led_assoc(struct ieee80211_local *local, bool associated)
diff --git a/net/mac80211/led.h b/net/mac80211/led.h
index e0275d9..6ca2f29 100644
--- a/net/mac80211/led.h
+++ b/net/mac80211/led.h
@@ -13,7 +13,7 @@
#ifdef CONFIG_MAC80211_LEDS
void ieee80211_led_rx(struct ieee80211_local *local);
-void ieee80211_led_tx(struct ieee80211_local *local, int q);
+void ieee80211_led_tx(struct ieee80211_local *local);
void ieee80211_led_assoc(struct ieee80211_local *local,
bool associated);
void ieee80211_led_radio(struct ieee80211_local *local,
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 4343920..e3c889b 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -557,7 +557,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
rcu_read_unlock();
- ieee80211_led_tx(local, 0);
+ ieee80211_led_tx(local);
/* SNMP counters
* Fragments are passed to low-level drivers as separate skbs, so these
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 4105d0c..6c4e60d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1281,7 +1281,6 @@ static bool __ieee80211_tx(struct ieee80211_local *local,
txpending);
ieee80211_tpt_led_trig_tx(local, fc, led_len);
- ieee80211_led_tx(local, 1);
WARN_ON_ONCE(!skb_queue_empty(skbs));
--
1.8.2
^ permalink raw reply related
* [PATCH] ath10k: implement get_survey()
From: Michal Kazior @ 2013-07-25 11:06 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Michal Kazior
This implements a limited subset of what can be
reported in the survey dump.
This can be used for assessing approximate channel
load, e.g. for automatic channel selection.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.h | 6 +++
drivers/net/wireless/ath/ath10k/mac.c | 36 +++++++++++++++++
drivers/net/wireless/ath/ath10k/wmi.c | 68 +++++++++++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/wmi.h | 3 ++
4 files changed, 112 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 9f21ecb..e1cd1e7 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -38,6 +38,7 @@
#define ATH10K_SCAN_ID 0
#define WMI_READY_TIMEOUT (5 * HZ)
#define ATH10K_FLUSH_TIMEOUT_HZ (5*HZ)
+#define ATH10K_NUM_CHANS 38
/* Antenna noise floor */
#define ATH10K_DEFAULT_NOISE_FLOOR -95
@@ -374,6 +375,11 @@ struct ath10k {
struct work_struct restart_work;
+ /* cycle count is reported twice for each visited channel during scan */
+ u32 survey_last_rx_clear_count;
+ u32 survey_last_cycle_count;
+ struct survey_info survey[ATH10K_NUM_CHANS];
+
#ifdef CONFIG_ATH10K_DEBUGFS
struct ath10k_debug debug;
#endif
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index d0a7761..5d4ce96 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2934,6 +2934,41 @@ static void ath10k_restart_complete(struct ieee80211_hw *hw)
mutex_unlock(&ar->conf_mutex);
}
+static int ath10k_get_survey(struct ieee80211_hw *hw, int idx,
+ struct survey_info *survey)
+{
+ struct ath10k *ar = hw->priv;
+ struct ieee80211_supported_band *sband;
+ struct survey_info *ar_survey = &ar->survey[idx];
+ int ret = 0;
+
+ mutex_lock(&ar->conf_mutex);
+
+ sband = hw->wiphy->bands[IEEE80211_BAND_2GHZ];
+ if (sband && idx >= sband->n_channels) {
+ idx -= sband->n_channels;
+ sband = NULL;
+ }
+
+ if (!sband)
+ sband = hw->wiphy->bands[IEEE80211_BAND_5GHZ];
+
+ if (!sband || idx >= sband->n_channels) {
+ ret = -ENOENT;
+ goto exit;
+ }
+
+ spin_lock_bh(&ar->data_lock);
+ memcpy(survey, ar_survey, sizeof(*survey));
+ spin_unlock_bh(&ar->data_lock);
+
+ survey->channel = &sband->channels[idx];
+
+exit:
+ mutex_unlock(&ar->conf_mutex);
+ return ret;
+}
+
static const struct ieee80211_ops ath10k_ops = {
.tx = ath10k_tx,
.start = ath10k_start,
@@ -2955,6 +2990,7 @@ static const struct ieee80211_ops ath10k_ops = {
.flush = ath10k_flush,
.tx_last_beacon = ath10k_tx_last_beacon,
.restart_complete = ath10k_restart_complete,
+ .get_survey = ath10k_get_survey,
#ifdef CONFIG_PM
.suspend = ath10k_suspend,
.resume = ath10k_resume,
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 5e42460..cb59235 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -390,9 +390,75 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
return 0;
}
+static int freq_to_idx(struct ath10k *ar, int freq)
+{
+ struct ieee80211_supported_band *sband;
+ int band, ch, idx = 0;
+
+ for (band = IEEE80211_BAND_2GHZ; band < IEEE80211_NUM_BANDS; band++) {
+ sband = ar->hw->wiphy->bands[band];
+ if (!sband)
+ continue;
+
+ for (ch = 0; ch < sband->n_channels; ch++, idx++)
+ if (sband->channels[ch].center_freq == freq)
+ goto exit;
+ }
+
+exit:
+ return idx;
+}
+
static void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb)
{
- ath10k_dbg(ATH10K_DBG_WMI, "WMI_CHAN_INFO_EVENTID\n");
+ struct wmi_chan_info_event *ev;
+ int idx;
+
+ spin_lock_bh(&ar->data_lock);
+
+ ev = (struct wmi_chan_info_event *)skb->data;
+ ath10k_dbg(ATH10K_DBG_WMI,
+ "chan info: err_code:%d freq:%d cmd_flags:%d noise_floor:%d rx_clear_count:%d cycle_count:%d\n",
+ __le32_to_cpu(ev->err_code),
+ __le32_to_cpu(ev->freq),
+ __le32_to_cpu(ev->cmd_flags),
+ __le32_to_cpu(ev->noise_floor),
+ __le32_to_cpu(ev->rx_clear_count),
+ __le32_to_cpu(ev->cycle_count));
+
+ if (!ar->scan.in_progress) {
+ ath10k_warn("chan info event without a scan request?\n");
+ goto exit;
+ }
+
+ if (__le32_to_cpu(ev->cmd_flags) & WMI_CHAN_INFO_FLAG_COMPLETE) {
+ idx = freq_to_idx(ar, __le32_to_cpu(ev->freq));
+ if (idx >= ARRAY_SIZE(ar->survey)) {
+ ath10k_warn("chan info: invalid frequency %d (idx %d out of bounds)\n",
+ __le32_to_cpu(ev->freq), idx);
+ } else {
+ /* During scanning chan info is reported twice for each
+ * visited channel. The reported cycle count is global
+ * and per-channel cycle count must be calculated */
+
+ ar->survey[idx].channel_time += WMI_CHAN_INFO_MSEC(
+ __le32_to_cpu(ev->cycle_count) -
+ ar->survey_last_cycle_count);
+ ar->survey[idx].channel_time_rx += WMI_CHAN_INFO_MSEC(
+ __le32_to_cpu(ev->rx_clear_count) -
+ ar->survey_last_rx_clear_count);
+ ar->survey[idx].noise = __le32_to_cpu(ev->noise_floor);
+ ar->survey[idx].filled = SURVEY_INFO_CHANNEL_TIME |
+ SURVEY_INFO_CHANNEL_TIME_RX |
+ SURVEY_INFO_NOISE_DBM;
+ }
+ }
+
+ ar->survey_last_rx_clear_count = __le32_to_cpu(ev->rx_clear_count);
+ ar->survey_last_cycle_count = __le32_to_cpu(ev->cycle_count);
+
+exit:
+ spin_unlock_bh(&ar->data_lock);
}
static void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index da3b2bc..4acff47 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -2931,6 +2931,9 @@ struct wmi_chan_info_event {
__le32 cycle_count;
} __packed;
+#define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
+#define WMI_CHAN_INFO_MSEC(x) ((x) / 76595) /* XXX: empirically extrapolated */
+
/* Beacon filter wmi command info */
#define BCN_FLT_MAX_SUPPORTED_IES 256
#define BCN_FLT_MAX_ELEMS_IE_LIST (BCN_FLT_MAX_SUPPORTED_IES / 32)
--
1.7.9.5
^ permalink raw reply related
* AR5008 "Failed to stop TX DMA"
From: Sergei Antonov @ 2013-07-25 11:18 UTC (permalink / raw)
To: linux-wireless
Hello!
I use "Atheros Communications Inc. AR5008 Wireless Network Adapter
(rev 01)" PCI card.
The following messages appear in my console approx. once in a minute.
cfg80211: Calling CRDA to update world regulatory domain
ath: phy0: Failed to stop TX DMA, queues=0x001!
wlan0: authenticate with 00:15:af:xx:xx:xx
wlan0: send auth to 00:15:af:xx:xx:xx (try 1/3)
wlan0: authenticated
ath9k 0000:03:06.0 wlan0: disabling HT as WMM/QoS is not supported by the AP
ath9k 0000:03:06.0 wlan0: disabling VHT as WMM/QoS is not supported by the AP
wlan0: associate with 00:15:af:xx:xx:xx (try 1/3)
wlan0: RX AssocResp from 00:15:af:xx:xx:xx (capab=0x411 status=0 aid=3)
wlan0: associated
The connection to WPA access point works, although SSH freezes
regulary for several seconds.
I'm running an x86_64 kernel version 3.10.2. But earlier versions had
the same problem too.
Please, help me to fix that.
^ permalink raw reply
* How to read WiFi radio frequency.
From: KATSUMI masanori @ 2013-07-25 12:02 UTC (permalink / raw)
To: linux-wireless
I am trying to make p2p software with the current device as the group
owner.
I would like to acquire the channel that GO started, from normal user(NOT
root).
How can I get this information?
^ permalink raw reply
* pull request: bluetooth 2013-07-25
From: Gustavo Padovan @ 2013-07-25 13:05 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, linux-bluetooth, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1936 bytes --]
Hi John,
A few fixes and devices ID additions for 3.11:
* There are 3 new ath3k device ids
* Fixed stack memory usage in ath3k.
* Fixed the init process of BlueFRITZ! devices, they were failing to init
due to an unsupported command we sent.
* Fixed wrong use of PTR_ERR in btusb code that was preventing intel devices
to work properly
* Fixed race codition between hci_register_dev() and hci_dev_open() that
could cause a NULL pointer dereference.
Please pull or let me know of any issues. Thanks.
Gustavo
--
The following changes since commit 57bf74407bd501b0599568a3112fc16395b575d9:
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth (2013-06-24 13:53:15 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth for-upstream
for you to fetch changes up to 352c3b276ca7e2df479cd0b9b87d227f14efb20a:
Bluetooth: Fix race between hci_register_dev() and hci_dev_open() (2013-07-25 13:55:59 +0100)
----------------------------------------------------------------
AceLan Kao (1):
Bluetooth: Add support for Atheros [0cf3:3121]
Adam Lee (1):
Bluetooth: fix wrong use of PTR_ERR() in btusb
Gustavo Padovan (1):
Bluetooth: Fix race between hci_register_dev() and hci_dev_open()
Johan Hedberg (1):
Bluetooth: Fix HCI init for BlueFRITZ! devices
Stanislaw Gruszka (1):
Bluetooth: ath3k: don't use stack memory for DMA
Sujith Manoharan (1):
Bluetooth: ath3k: Add support for ID 0x13d3/0x3402
Thomas Loo (1):
Bluetooth: ath3k: Add support for Fujitsu Lifebook UH5x2 [04c5:1330]
drivers/bluetooth/ath3k.c | 44 +++++++++++++++++++++++++++++++++++---------
drivers/bluetooth/btusb.c | 17 ++++++++++-------
net/bluetooth/hci_core.c | 16 ++++++++--------
3 files changed, 53 insertions(+), 24 deletions(-)
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: hung task while plugging in cfg80211
From: Jeff Layton @ 2013-07-25 14:51 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: linux-wireless, linville, netdev, Thomas Graf, Stephen Hemminger,
rjones, Marcel Holtmann
In-Reply-To: <20130724095911.GA1637@redhat.com>
On Wed, 24 Jul 2013 11:59:12 +0200
Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> On Fri, Jul 12, 2013 at 07:49:11AM -0400, Jeff Layton wrote:
> > I updated the kernel on my rawhide KVM guest, and noticed that the
> > ethernet interface wasn't coming up at all. While poking around, I saw
> > this stack trace pop up:
> >
> > Jul 12 07:29:25 rawhide kernel: [ 241.156196] INFO: task modprobe:501 blocked for more than 120 seconds.
> > Jul 12 07:29:25 rawhide kernel: [ 241.157222] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> > Jul 12 07:29:25 rawhide kernel: [ 241.158379] modprobe D ffff880118c526e0 4584 501 500 0x00000080
> > Jul 12 07:29:25 rawhide kernel: [ 241.159458] ffff8800d10c3ba8 0000000000000046 00000000001d5300 ffff8800d10c3fd8
> > Jul 12 07:29:25 rawhide kernel: [ 241.160644] ffff8800d10c3fd8 00000000001d5300 ffff8800d2ae4dc0 ffff8800d2ae4dc0
> > Jul 12 07:29:25 rawhide kernel: [ 241.161875] ffffffff81d0bfa0 ffffffff81d0bfa8 ffffffff00000000 ffffffff81d0bff0
> > Jul 12 07:29:25 rawhide kernel: [ 241.163096] Call Trace:
> > Jul 12 07:29:25 rawhide kernel: [ 241.163460] [<ffffffff817377e9>] schedule+0x29/0x70
> > Jul 12 07:29:25 rawhide kernel: [ 241.164235] [<ffffffff817392ad>] rwsem_down_write_failed+0xed/0x1a0
> > Jul 12 07:29:25 rawhide kernel: [ 241.165489] [<ffffffff810bb600>] ? update_cpu_load_active+0xb0/0xb0
> > Jul 12 07:29:25 rawhide kernel: [ 241.166267] [<ffffffff8137d503>] call_rwsem_down_write_failed+0x13/0x20
> > Jul 12 07:29:25 rawhide kernel: [ 241.166760] [<ffffffff81736aad>] ? down_write+0x9d/0xb2
> > Jul 12 07:29:25 rawhide kernel: [ 241.167189] [<ffffffff8162d975>] ? genl_lock_all+0x15/0x30
> > Jul 12 07:29:25 rawhide kernel: [ 241.167603] [<ffffffff8162d975>] genl_lock_all+0x15/0x30
>
> I reproduced that on qemu-kvm with rawhide LiveCD. Below more
> information gathered using sysrq:
>
> (qemu) [ 2458.110724] SysRq : Show Locks Held
> [ 2458.111347]
> [ 2458.111347] Showing all locks held in the system:
> [ 2458.111347] 1 lock held by NetworkManager/582:
> [ 2458.111347] #0: (cb_lock){++++++}, at: [<ffffffff8162bc79>] genl_rcv+0x19/0x40
> [ 2458.111347] 1 lock held by modprobe/603:
> [ 2458.111347] #0: (cb_lock){++++++}, at: [<ffffffff8162baa5>] genl_lock_all+0x15/0x30
> [ 2458.111347]
> [ 2458.111347] =============================================
> [ 2458.111347]
>
> (qemu) sendkey alt-sysrq-w
> (qemu) [ 2461.579457] SysRq : Show Blocked State
> [ 2461.580103] task PC stack pid father
> [ 2461.580103] NetworkManager D ffff880034b84500 4040 582 1 0x00000080
> [ 2461.580103] ffff8800197ff720 0000000000000046 00000000001d5340 ffff8800197fffd8
> [ 2461.580103] ffff8800197fffd8 00000000001d5340 ffff880019631700 7fffffffffffffff
> [ 2461.580103] ffff8800197ff880 ffff8800197ff878 ffff880019631700 ffff880019631700
> [ 2461.580103] Call Trace:
> [ 2461.580103] [<ffffffff817355f9>] schedule+0x29/0x70
> [ 2461.580103] [<ffffffff81731ad1>] schedule_timeout+0x1c1/0x360
> [ 2461.580103] [<ffffffff810e69eb>] ? mark_held_locks+0xbb/0x140
> [ 2461.580103] [<ffffffff817377ac>] ? _raw_spin_unlock_irq+0x2c/0x50
> [ 2461.580103] [<ffffffff810e6b6d>] ? trace_hardirqs_on_caller+0xfd/0x1c0
> [ 2461.580103] [<ffffffff81736398>] wait_for_completion_killable+0xe8/0x170
> [ 2461.580103] [<ffffffff810b7fa0>] ? wake_up_state+0x20/0x20
> [ 2461.580103] [<ffffffff81095825>] call_usermodehelper_exec+0x1a5/0x210
> [ 2461.580103] [<ffffffff817362ed>] ? wait_for_completion_killable+0x3d/0x170
> [ 2461.580103] [<ffffffff81095cc3>] __request_module+0x1b3/0x370
> [ 2461.580103] [<ffffffff810e6b6d>] ? trace_hardirqs_on_caller+0xfd/0x1c0
> [ 2461.580103] [<ffffffff8162c5c9>] ctrl_getfamily+0x159/0x190
> [ 2461.580103] [<ffffffff8162d8a4>] genl_family_rcv_msg+0x1f4/0x2e0
> [ 2461.580103] [<ffffffff8162d990>] ? genl_family_rcv_msg+0x2e0/0x2e0
> [ 2461.580103] [<ffffffff8162da1e>] genl_rcv_msg+0x8e/0xd0
> [ 2461.580103] [<ffffffff8162b729>] netlink_rcv_skb+0xa9/0xc0
> [ 2461.580103] [<ffffffff8162bc88>] genl_rcv+0x28/0x40
> [ 2461.580103] [<ffffffff8162ad6d>] netlink_unicast+0xdd/0x190
> [ 2461.580103] [<ffffffff8162b149>] netlink_sendmsg+0x329/0x750
> [ 2461.580103] [<ffffffff815db849>] sock_sendmsg+0x99/0xd0
> [ 2461.580103] [<ffffffff810bb58f>] ? local_clock+0x5f/0x70
> [ 2461.580103] [<ffffffff810e96e8>] ? lock_release_non_nested+0x308/0x350
> [ 2461.580103] [<ffffffff815dbc6e>] ___sys_sendmsg+0x39e/0x3b0
> [ 2461.580103] [<ffffffff810565af>] ? kvm_clock_read+0x2f/0x50
> [ 2461.580103] [<ffffffff810218b9>] ? sched_clock+0x9/0x10
> [ 2461.580103] [<ffffffff810bb2bd>] ? sched_clock_local+0x1d/0x80
> [ 2461.580103] [<ffffffff810bb448>] ? sched_clock_cpu+0xa8/0x100
> [ 2461.580103] [<ffffffff810e33ad>] ? trace_hardirqs_off+0xd/0x10
> [ 2461.580103] [<ffffffff810bb58f>] ? local_clock+0x5f/0x70
> [ 2461.580103] [<ffffffff810e3f7f>] ? lock_release_holdtime.part.28+0xf/0x1a0
> [ 2461.580103] [<ffffffff8120fec9>] ? fget_light+0xf9/0x510
> [ 2461.580103] [<ffffffff8120fe0c>] ? fget_light+0x3c/0x510
> [ 2461.580103] [<ffffffff815dd1d2>] __sys_sendmsg+0x42/0x80
> [ 2461.580103] [<ffffffff815dd222>] SyS_sendmsg+0x12/0x20
> [ 2461.580103] [<ffffffff81741ad9>] system_call_fastpath+0x16/0x1b
> [ 2461.580103] modprobe D ffff88000f2c8000 4632 603 602 0x00000080
> [ 2461.580103] ffff88000f04fba8 0000000000000046 00000000001d5340 ffff88000f04ffd8
> [ 2461.580103] ffff88000f04ffd8 00000000001d5340 ffff8800377d4500 ffff8800377d4500
> [ 2461.580103] ffffffff81d0b260 ffffffff81d0b268 ffffffff00000000 ffffffff81d0b2b0
> [ 2461.580103] Call Trace:
> [ 2461.580103] [<ffffffff817355f9>] schedule+0x29/0x70
> [ 2461.580103] [<ffffffff81736d4d>] rwsem_down_write_failed+0xed/0x1a0
> [ 2461.580103] [<ffffffff810bb200>] ? update_cpu_load_active+0x10/0xb0
> [ 2461.580103] [<ffffffff8137b473>] call_rwsem_down_write_failed+0x13/0x20
> [ 2461.580103] [<ffffffff8173492d>] ? down_write+0x9d/0xb2
> [ 2461.580103] [<ffffffff8162baa5>] ? genl_lock_all+0x15/0x30
> [ 2461.580103] [<ffffffff8162baa5>] genl_lock_all+0x15/0x30
> [ 2461.580103] [<ffffffff8162cbb3>] genl_register_family+0x53/0x1f0
> [ 2461.580103] [<ffffffffa01dc000>] ? 0xffffffffa01dbfff
> [ 2461.580103] [<ffffffff8162d650>] genl_register_family_with_ops+0x20/0x80
> [ 2461.580103] [<ffffffffa01dc000>] ? 0xffffffffa01dbfff
> [ 2461.580103] [<ffffffffa017fe84>] nl80211_init+0x24/0xf0 [cfg80211]
> [ 2461.580103] [<ffffffffa01dc000>] ? 0xffffffffa01dbfff
> [ 2461.580103] [<ffffffffa01dc043>] cfg80211_init+0x43/0xdb [cfg80211]
> [ 2461.580103] [<ffffffff810020fa>] do_one_initcall+0xfa/0x1b0
> [ 2461.580103] [<ffffffff8105cb93>] ? set_memory_nx+0x43/0x50
> [ 2461.580103] [<ffffffff810f75af>] load_module+0x1c6f/0x27f0
> [ 2461.580103] [<ffffffff810f2c90>] ? store_uevent+0x40/0x40
> [ 2461.580103] [<ffffffff810f82c6>] SyS_finit_module+0x86/0xb0
> [ 2461.580103] [<ffffffff81741ad9>] system_call_fastpath+0x16/0x1b
> [ 2461.580103] Sched Debug Version: v0.10, 3.11.0-0.rc1.git4.1.fc20.x86_64 #1
>
> So call user space to load cfg80211 module (alias
> net-pf-16-proto-16-family-nl80211) from ctrl_getfamily() with read taken
> cb_lock semaphore. That deadlock in modprobe process in
> genl_register_family() when try to down_write cb_lock.
>
> This is consequence of commit:
>
> commit fb4e156886ce6e8309e912d8b370d192330d19d3
> Author: Marcel Holtmann <marcel@holtmann.org>
> Date: Sun Apr 28 16:22:06 2013 -0700
>
> nl80211: Add generic netlink module alias for cfg80211/nl80211
>
> I prepared a possible fix for that (patch below), but I'm not sure if it
> do right thing, it can cause other oddity, please test (with
> CONFIG_LOCKDEP compiled). I think I would prefer rather remove
> autoloading genetlink modules from kernel or use just one lock
> in instead of two cb_lock & genl_mutex .
>
> Stanislaw
>
> diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
> index 2fd6dbe..1076fe1 100644
> --- a/net/netlink/genetlink.c
> +++ b/net/netlink/genetlink.c
> @@ -877,8 +877,10 @@ static int ctrl_getfamily(struct sk_buff *skb, struct genl_info *info)
> #ifdef CONFIG_MODULES
> if (res == NULL) {
> genl_unlock();
> + up_read(&cb_lock);
> request_module("net-pf-%d-proto-%d-family-%s",
> PF_NETLINK, NETLINK_GENERIC, name);
> + down_read(&cb_lock);
> genl_lock();
> res = genl_family_find_byname(name);
> }
The patch above fixes the problem for me. I'll leave it to others to
decide whether it's the best approach.
Thanks!
--
Jeff Layton <jlayton@redhat.com>
^ permalink raw reply
* Re: pull request: bluetooth 2013-07-25
From: Gustavo Padovan @ 2013-07-25 15:01 UTC (permalink / raw)
To: linville, linux-wireless, linux-bluetooth, linux-kernel
In-Reply-To: <20130725130552.GE9913@joana>
Hi John,
* Gustavo Padovan <gustavo@padovan.org> [2013-07-25 14:05:54 +0100]:
> Hi John,
>
> A few fixes and devices ID additions for 3.11:
>
> * There are 3 new ath3k device ids
> * Fixed stack memory usage in ath3k.
> * Fixed the init process of BlueFRITZ! devices, they were failing to init
> due to an unsupported command we sent.
> * Fixed wrong use of PTR_ERR in btusb code that was preventing intel devices
> to work properly
> * Fixed race codition between hci_register_dev() and hci_dev_open() that
> could cause a NULL pointer dereference.
Marcel just raised the comment that we need to add more information to
the BlueFRITZ! fixes so I'm steping back with it. So just ignore it for
now.
Gustavo
^ permalink raw reply
* TP-LINK wireless USB adapter don't work.
From: atar @ 2013-07-25 16:47 UTC (permalink / raw)
To: linux-wireless
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=iso-8859-8-i; format=flowed; delsp=yes, Size: 531 bytes --]
aHi there!!
I've a TP-LINK USB wireless adapter with model number TL-WN722N. When I
plug it in to one of the USB slots in my PC, its LED diode isn't flashing
(although under WIN XP it is flashing) and I cannot use it. from the
messages of the 'dmesg' command it seems that the kernel detect it, but I
unable to use it because it doesn't appear on the wicd window of available
interfaces.
My Linux distro is Debian squeeze with kernel 2.6.32-5-686.
What should I do in order to solve this problem?
Thanks in advance!!
^ permalink raw reply
* Re: TP-LINK wireless USB adapter don't work.
From: Oleksij Rempel @ 2013-07-25 18:08 UTC (permalink / raw)
To: atar; +Cc: linux-wireless
In-Reply-To: <op.w0sd9ujye4gg2u@xp>
Am 25.07.2013 18:47, schrieb atar:
> aHi there!!
>
> I've a TP-LINK USB wireless adapter with model number TL-WN722N. When I
> plug it in to one of the USB slots in my PC, its LED diode isn't
> flashing (although under WIN XP it is flashing) and I cannot use it.
> from the messages of the 'dmesg' command it seems that the kernel detect
> it, but I unable to use it because it doesn't appear on the wicd window
> of available interfaces.
>
> My Linux distro is Debian squeeze with kernel 2.6.32-5-686.
>
> What should I do in order to solve this problem?
It is ath9k-htc based adapter. Please update your kernel and use latest
firmware. I think Debian squeeze do not provided this firmware, so you
should install it manually.
--
Regards,
Oleksij
^ permalink raw reply
* [PATCH] brcmfmac: inform cfg80211 about disconnect when device is unplugged
From: Arend van Spriel @ 2013-07-25 21:01 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, Arend van Spriel, Ben Greear
When the brcmfmac device is physically removed cfg80211 gives a
warning upon unregistering the net device (see below).
[23052.390197] WARNING: CPU: 0 PID: 30 at net/wireless/core.c:937 cfg80211_netdev_notifier_call+0x164/0x600 [cfg80211]()
[23052.400843] Modules linked in: brcmfmac(O) brcmutil(O) cfg80211(O) pl2303 usbserial binfmt_misc snd_hda_codec_hdmi snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event lpc_ich snd_seq snd_timer snd_seq_device snd psmouse mfd_core serio_raw soundcore snd_page_alloc intel_ips dell_laptop dell_wmi sparse_keymap dcdbas nouveau ttm drm_kms_helper drm i2c_algo_bit mxm_wmi ahci libahci sdhci_pci firewire_ohci firewire_core sdhci crc_itu_t mmc_core intel_agp intel_gtt e1000e ptp pps_core agpgart video [last unloaded: brcmfmac]
[23052.452987] CPU: 0 PID: 30 Comm: khubd Tainted: G O 3.11.0-rc1-wl-testing-lockdep-00002-g41cc093-dirty #1
[23052.463480] Hardware name: Dell Inc. Latitude E6410/07XJP9, BIOS A07 02/15/2011
[23052.470852] 00000000 00000000 f4efdc18 c1522e3d f845bed2 f4efdc48 c103fbe4 c16a9254
[23052.478762] 00000000 0000001e f845bed2 000003a9 f841da44 f841da44 f3790004 f25539c0
[23052.486741] e2700200 f4efdc58 c103fc22 00000009 00000000 f4efdcc0 f841da44 00000002
[23052.494712] Call Trace:
[23052.497165] [<c1522e3d>] dump_stack+0x4b/0x66
[23052.501685] [<c103fbe4>] warn_slowpath_common+0x84/0xa0
[23052.507085] [<f841da44>] ? cfg80211_netdev_notifier_call+0x164/0x600 [cfg80211]
[23052.514542] [<f841da44>] ? cfg80211_netdev_notifier_call+0x164/0x600 [cfg80211]
[23052.521981] [<c103fc22>] warn_slowpath_null+0x22/0x30
[23052.527191] [<f841da44>] cfg80211_netdev_notifier_call+0x164/0x600 [cfg80211]
[23052.534494] [<c150abe8>] ? packet_notifier+0xc8/0x1d0
[23052.539703] [<c150abfc>] ? packet_notifier+0xdc/0x1d0
[23052.544880] [<c150ab20>] ? packet_seq_stop+0x30/0x30
[23052.550002] [<c152d655>] notifier_call_chain+0x45/0x60
[23052.555298] [<c106839f>] raw_notifier_call_chain+0x1f/0x30
[23052.560963] [<c143c693>] call_netdevice_notifiers_info+0x33/0x70
[23052.567153] [<c1459869>] ? qdisc_destroy+0x99/0xb0
[23052.572116] [<c143c6e3>] call_netdevice_notifiers+0x13/0x20
[23052.577861] [<c143df93>] rollback_registered_many+0xf3/0x1d0
[23052.583687] [<c1524cfc>] ? mutex_lock_nested+0x25c/0x350
[23052.589150] [<c143e0f4>] rollback_registered+0x24/0x40
[23052.594445] [<c143e15f>] unregister_netdevice_queue+0x4f/0xb0
[23052.600344] [<c143e299>] unregister_netdev+0x19/0x30
[23052.605484] [<f865b38f>] brcmf_del_if+0xbf/0x160 [brcmfmac]
[23052.611223] [<f865b7ae>] brcmf_detach+0x5e/0xd0 [brcmfmac]
[23052.616881] [<f8667413>] brcmf_usb_disconnect+0x63/0xa0 [brcmfmac]
[23052.623217] [<c13e09aa>] usb_unbind_interface+0x4a/0x180
When the device is physically connected the driver sends a disassoc
command to the device and response triggers the driver to inform cfg80211
about it. However, with the device removed the disassoc command fails.
This patch adds a call to cfg80211_disconnected() when that command fails.
The warning was added by commit below and also cleans up, but better
doing it in the driver if only to get rid of the warning.
commit f9bef3df52fe61067e4c1c6cfb2037cb6b259a6a
Author: Ben Greear <greearb@candelatech.com>
Date: Wed Jun 19 14:06:26 2013 -0700
wireless: check for dangling wdev->current_bss pointer
Cc: Ben Greear <greearb@candelatech.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
---
Hi John,
One more fix for the wireless repository, which happens when unloading
the brcmfmac driver or unplug the device while being connected.
Regards,
Arend
---
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index 277b37a..7fa71f7 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1093,8 +1093,11 @@ static void brcmf_link_down(struct brcmf_cfg80211_vif *vif)
brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n ");
err = brcmf_fil_cmd_data_set(vif->ifp,
BRCMF_C_DISASSOC, NULL, 0);
- if (err)
+ if (err) {
brcmf_err("WLC_DISASSOC failed (%d)\n", err);
+ cfg80211_disconnected(vif->wdev.netdev, 0,
+ NULL, 0, GFP_KERNEL);
+ }
clear_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state);
}
clear_bit(BRCMF_VIF_STATUS_CONNECTING, &vif->sme_state);
--
1.7.10.4
^ permalink raw reply related
* Re: authsae, 'ath9k nohwcrypt=1' & AR9100
From: Yeoh Chun-Yeow @ 2013-07-25 22:56 UTC (permalink / raw)
To: linux-wireless@vger.kernel.org
This patch is to solve the problem for the open mesh to avoid older
chipset filters out certain frame required for mesh. Without this
patch, I am not too sure whether the secure mesh will work.
---
Chun-Yeow
^ permalink raw reply
* RE: [PATCH 18/21] mwifiex: handle driver initialization error paths
From: Bing Zhao @ 2013-07-26 4:25 UTC (permalink / raw)
To: John W. Linville
Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar, Avinash Patil,
Yogesh Powar, Nishant Sarmukadam, Frank Huang
In-Reply-To: <20130724190250.GG2385@tuxdriver.com>
Hi John,
> > 18/21 and 19/21 depend on this patch:
> >
> > commit 232fde062e0a2cc52e8e18a50cda361b4ba88f34
> > Author: Daniel Drake <dsd@laptop.org>
> > Date: Sat Jul 13 10:57:10 2013 -0400
> >
> > mwifiex: fix IRQ enable/disable
> >
> > which is in wireless.git and wireless-testing.git currently.
> >
> >
> > We can apply 18 and 19 later after commit 232fde0 is merged back to wireless-next.git.
> > (I will send you a reminder to merge these two patches once commit 232fde0 is in -next tree.)
> >
> > Thanks,
> > Bing
>
> OK, thanks for checking!
As the commit 232fde0 has been merged to wireless-next you may apply 18/21 and 19/21 now.
Thanks,
Bing
^ permalink raw reply
* RE: [PATCH] mwifiex: Add missing endian conversion.
From: Bing Zhao @ 2013-07-26 4:34 UTC (permalink / raw)
To: Tomasz Moń, linville@tuxdriver.com; +Cc: linux-wireless@vger.kernel.org
In-Reply-To: <1374558169-6888-1-git-send-email-desowin@gmail.com>
SGkgSm9obiwNCg0KPiBCb3RoIHR5cGUgYW5kIHBrdF9sZW4gdmFyaWFibGVzIGFyZSBpbiBob3N0
IGVuZGlhbiBhbmQgdGhlc2Ugc2hvdWxkIGJlIGluDQo+IExpdHRsZSBFbmRpYW4gaW4gdGhlIHBh
eWxvYWQuDQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBUb21hc3ogTW/FhCA8ZGVzb3dpbkBnbWFpbC5j
b20+DQo+IEFja2VkLWJ5OiBCaW5nIFpoYW8gPGJ6aGFvQG1hcnZlbGwuY29tPg0KDQpDYzogPHN0
YWJsZUB2Z2VyLmtlcm5lbC5vcmc+DQoNCkNvdWxkIHlvdSBwbGVhc2UgYXBwbHkgdGhpcyBwYXRj
aCB0byB3aXJlbGVzcy5naXQgZm9yIDMuMTE/DQoNClRoYW5rcywNCkJpbmcNCg0KPiAtLS0NCj4g
IGRyaXZlcnMvbmV0L3dpcmVsZXNzL213aWZpZXgvc2Rpby5jIHwgNCArKy0tDQo+ICAxIGZpbGUg
Y2hhbmdlZCwgMiBpbnNlcnRpb25zKCspLCAyIGRlbGV0aW9ucygtKQ0KPiANCj4gZGlmZiAtLWdp
dCBhL2RyaXZlcnMvbmV0L3dpcmVsZXNzL213aWZpZXgvc2Rpby5jIGIvZHJpdmVycy9uZXQvd2ly
ZWxlc3MvbXdpZmlleC9zZGlvLmMNCj4gaW5kZXggNWVlNWVkMC4uYzlmM2VjZiAxMDA2NDQNCj4g
LS0tIGEvZHJpdmVycy9uZXQvd2lyZWxlc3MvbXdpZmlleC9zZGlvLmMNCj4gKysrIGIvZHJpdmVy
cy9uZXQvd2lyZWxlc3MvbXdpZmlleC9zZGlvLmMNCj4gQEAgLTE2MjUsOCArMTYyNSw4IEBAIHN0
YXRpYyBpbnQgbXdpZmlleF9zZGlvX2hvc3RfdG9fY2FyZChzdHJ1Y3QgbXdpZmlleF9hZGFwdGVy
ICphZGFwdGVyLA0KPiAgCS8qIEFsbG9jYXRlIGJ1ZmZlciBhbmQgY29weSBwYXlsb2FkICovDQo+
ICAJYmxrX3NpemUgPSBNV0lGSUVYX1NESU9fQkxPQ0tfU0laRTsNCj4gIAlidWZfYmxvY2tfbGVu
ID0gKHBrdF9sZW4gKyBibGtfc2l6ZSAtIDEpIC8gYmxrX3NpemU7DQo+IC0JKih1MTYgKikgJnBh
eWxvYWRbMF0gPSAodTE2KSBwa3RfbGVuOw0KPiAtCSoodTE2ICopICZwYXlsb2FkWzJdID0gdHlw
ZTsNCj4gKwkqKF9fbGUxNiAqKSZwYXlsb2FkWzBdID0gY3B1X3RvX2xlMTYoKHUxNilwa3RfbGVu
KTsNCj4gKwkqKF9fbGUxNiAqKSZwYXlsb2FkWzJdID0gY3B1X3RvX2xlMTYodHlwZSk7DQo+IA0K
PiAgCS8qDQo+ICAJICogVGhpcyBpcyBTRElPIHNwZWNpZmljIGhlYWRlcg0KPiAtLQ0KPiAxLjgu
My5tc3lzZ2l0LjANCg0K
^ permalink raw reply
* Re: Updates to wireless-regdb review - vendor namespaces and VHT80
From: Johannes Berg @ 2013-07-26 7:59 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless, wireless-regdb@lists.infradead.org
In-Reply-To: <CAB=NE6V_PKG2UBSLPRhziUDcFzFi8uOJNiNzoPNaK0oU7rmZuQ@mail.gmail.com>
On Tue, 2013-07-02 at 17:38 -0700, Luis R. Rodriguez wrote:
> I'd like to propose a middle ground to also address another issue I've
> noticed. Vendors can disagree and in order to give vendors a warm
> fuzzy on ability to ensure their data is interpreted and provide the
> ability to offload down to wireless-regdb even more interpretations
> I'd like to propose the idea of embracing vendor namespaces within
> wireless-regdb / crda / the kernel. The way I'd envision this is
> '/sbin/crda US OUI' is passed upon a regulatory hint and in turn CRDA
> will read the namespace for the OUI passed in regulatory.bin. Then at
> our wireless summit kumbaya and with the development / enhancements of
> intersect.c and union.c (not yet developed) we'd work on generalizing
> the data. This would also allow vendors to supply their own rules
> without the high bar that we are setting which so far has proven very
> difficult to met.
I'm not really fully convinced, but let's discuss at the summit.
Wasn't the point of the regdb and documentation etc. also that the users
can trust it? It seems to me that if you're building a generic system
you wouldn't really want different regulatory interpretations. And if
you think for some special system (say a tablet) you need a different
database, you'll probably hand-roll one specifically for that system
anyway.
> In the meantime, while that gets developed, I'd still like to supply
> patches to enable VHT80 for a few countries without hopefully such
> high bar for documentation as I cannot get this information.
I've also been sitting on the patch "regulatory: enable channels 52-64
and 100-144 for world roaming" ...
johannes
^ permalink raw reply
* Re: [PATCH 0/2] beacon measurement (beacon filtering disable)
From: Johannes Berg @ 2013-07-26 8:03 UTC (permalink / raw)
To: Kalle Valo, emmanuel.grumbach; +Cc: linux-wireless
In-Reply-To: <87oba1yggl.fsf@purkki.adurom.net>
On Wed, 2013-07-17 at 07:10 +0300, Kalle Valo wrote:
> Johannes Berg <johannes@sipsolutions.net> writes:
>
> > We have beacon filtering (to reduce host wakeups) in our device,
> > but for some measurement/debug purposes we need to turn it off.
>
> TBH I'm not really fond of this. I'm not really sure what's the use
> case but first this sounded a like a factory test for me, not something
> which a regular user would want to do.
Yeah, in a way that's true. FWIW, we could also connect it to testmode
and not worry about it for upstream, but it seemed that others might
want/need similar functionality.
> Can't we connect this to power save? When disabling power save we could
> also disable beacon filtering and would not need a separate command.
I'm not so sure that's a good idea. While superficially beacon filtering
is related to saving power, it's really a different thing - it's about
CPU/host power while powersave is about device power (RX chains etc.)
Connecting them, in particular where disabling beacon filtering isn't
even supported by all devices, doesn't really seem like a good idea,
particularly not for any tool that would require such functionality.
johannes
^ permalink raw reply
* Re: Updates to wireless-regdb review - vendor namespaces and VHT80
From: Luis R. Rodriguez @ 2013-07-26 8:06 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, wireless-regdb@lists.infradead.org
In-Reply-To: <1374825552.8248.2.camel@jlt4.sipsolutions.net>
On Fri, Jul 26, 2013 at 12:59 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2013-07-02 at 17:38 -0700, Luis R. Rodriguez wrote:
>
>> I'd like to propose a middle ground to also address another issue I've
>> noticed. Vendors can disagree and in order to give vendors a warm
>> fuzzy on ability to ensure their data is interpreted and provide the
>> ability to offload down to wireless-regdb even more interpretations
>> I'd like to propose the idea of embracing vendor namespaces within
>> wireless-regdb / crda / the kernel. The way I'd envision this is
>> '/sbin/crda US OUI' is passed upon a regulatory hint and in turn CRDA
>> will read the namespace for the OUI passed in regulatory.bin. Then at
>> our wireless summit kumbaya and with the development / enhancements of
>> intersect.c and union.c (not yet developed) we'd work on generalizing
>> the data. This would also allow vendors to supply their own rules
>> without the high bar that we are setting which so far has proven very
>> difficult to met.
>
> I'm not really fully convinced, but let's discuss at the summit.
>
> Wasn't the point of the regdb and documentation etc. also that the users
> can trust it? It seems to me that if you're building a generic system
> you wouldn't really want different regulatory interpretations. And if
> you think for some special system (say a tablet) you need a different
> database, you'll probably hand-roll one specifically for that system
> anyway.
I don't think that's the problem. The problem is more -- folks are not
used to and don't wan to engage. What do we do in the meantime where
the alternative is something separate and likely redistributable
elsewhere. I'd personally rather have folks engaged and I figured a
namespace would at least provide a central middle ground. Glad to
discuss at the summit.
Luis
^ permalink raw reply
* [PATCH] mac80211: implement critical protocol protection
From: Johannes Berg @ 2013-07-26 8:08 UTC (permalink / raw)
To: linux-wireless; +Cc: Emmanuel Grumbach
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This new API add in cfg80211 wasn't implemented in mac80211.
Advertise the capabilities based on the device's
implementation (possibly NULL) of crit_prot mac80211 ops.
This callback will be called by cfg80211 when hinted by
userspace that a critical protocol is happening, e.g. it can
be EAPOL, DHCP.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
include/net/cfg80211.h | 2 ++
include/net/mac80211.h | 7 +++++++
net/mac80211/cfg.c | 29 +++++++++++++++++++++++++++++
net/mac80211/driver-ops.h | 18 ++++++++++++++++++
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/iface.c | 14 ++++++++++++++
net/mac80211/main.c | 3 +++
net/mac80211/trace.h | 26 ++++++++++++++++++++++++++
net/wireless/nl80211.c | 6 ++++--
9 files changed, 104 insertions(+), 2 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 019e256..5dc5e75 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2452,6 +2452,7 @@ struct cfg80211_ops {
* @WIPHY_FLAG_SUPPORTS_BEACON_MEAS: Device supports beacon measurements. Should
* be set when the device can let all the beacon through up to cfg80211
* to proceed to measurements (i.e. RSSI measurements).
+ * @WIPHY_FLAG_SUPPORTS_CRIT_PROT: Device supports critical protocol protection.
*/
enum wiphy_flags {
WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -2477,6 +2478,7 @@ enum wiphy_flags {
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
WIPHY_FLAG_SUPPORTS_BEACON_MEAS = BIT(23),
+ WIPHY_FLAG_SUPPORTS_CRIT_PROT = BIT(24),
};
/**
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index fb8f6c6..70d8ea4 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2638,6 +2638,10 @@ enum ieee80211_roc_type {
* beacons must be let through and data for measurement should be set in
* &ieee80211_rx_status (rssi etc...).
*
+ * @crit_proto: Start or stop a critical protocol session. This can be DHCP, EAP
+ * or any other protocol that gates the connection. Look at
+ * %crit_prot_start in %cfg80211_ops.
+ *
* @ipv6_addr_change: IPv6 address assignment on the given interface changed.
* Currently, this is only called for managed or P2P client interfaces.
* This callback is optional; it must not sleep.
@@ -2826,6 +2830,9 @@ struct ieee80211_ops {
int (*beacon_measurement)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, bool state);
+ int (*crit_proto)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ enum nl80211_crit_proto_id protocol, bool start);
+
#if IS_ENABLED(CONFIG_IPV6)
void (*ipv6_addr_change)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 34b57a9..3070d5e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3407,6 +3407,33 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
return ret;
}
+static int ieee80211_crit_proto_start(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ enum nl80211_crit_proto_id protocol,
+ u16 duration)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+ int ret;
+
+ ret = drv_crit_proto(local, sdata, protocol, true);
+ if (!ret)
+ return ret;
+
+ ieee80211_queue_delayed_work(&sdata->local->hw,
+ &sdata->crit_prot_end_wk,
+ msecs_to_jiffies(duration));
+ return 0;
+}
+
+static void ieee80211_crit_proto_stop(struct wiphy *wiphy,
+ struct wireless_dev *wdev)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
+
+ flush_delayed_work(&sdata->crit_prot_end_wk);
+}
+
static int ieee80211_beacon_measurement(struct wiphy *wiphy,
struct wireless_dev *wdev,
bool state)
@@ -3505,5 +3532,7 @@ struct cfg80211_ops mac80211_config_ops = {
.get_et_strings = ieee80211_get_et_strings,
.get_channel = ieee80211_cfg_get_channel,
.start_radar_detection = ieee80211_start_radar_detection,
+ .crit_proto_start = ieee80211_crit_proto_start,
+ .crit_proto_stop = ieee80211_crit_proto_stop,
.beacon_measurement = ieee80211_beacon_measurement,
};
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 7fbe57f..30a773b 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1060,6 +1060,24 @@ drv_set_default_unicast_key(struct ieee80211_local *local,
trace_drv_return_void(local);
}
+static inline int drv_crit_proto(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ enum nl80211_crit_proto_id protocol,
+ bool start)
+{
+ int ret = -EOPNOTSUPP;
+ check_sdata_in_driver(sdata);
+
+ trace_drv_crit_proto(local, sdata, protocol, start);
+
+ if (local->ops->crit_proto)
+ ret = local->ops->crit_proto(&local->hw, &sdata->vif, protocol,
+ start);
+ trace_drv_return_int(local, ret);
+
+ return ret;
+}
+
static inline int
drv_beacon_measurement(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata, bool state)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 3d32df1..b04c62f 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -683,6 +683,7 @@ struct ieee80211_sub_if_data {
int crypto_tx_tailroom_needed_cnt;
int crypto_tx_tailroom_pending_dec;
struct delayed_work dec_tailroom_needed_wk;
+ struct delayed_work crit_prot_end_wk;
struct net_device *dev;
struct ieee80211_local *local;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 4c41c11..700c937 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -806,6 +806,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
cancel_work_sync(&sdata->recalc_smps);
cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
+ /* this will end the critical protocol right away */
+ flush_delayed_work(&sdata->crit_prot_end_wk);
if (sdata->wdev.cac_started) {
WARN_ON(local->suspended);
@@ -1568,6 +1570,16 @@ static void ieee80211_cleanup_sdata_stas_wk(struct work_struct *wk)
ieee80211_cleanup_sdata_stas(sdata);
}
+static void ieee80211_crit_prot_timeout(struct work_struct *wk)
+{
+ struct ieee80211_sub_if_data *sdata;
+
+ sdata = container_of(wk, struct ieee80211_sub_if_data,
+ crit_prot_end_wk.work);
+
+ drv_crit_proto(sdata->local, sdata, NL80211_CRIT_PROTO_UNSPEC, false);
+}
+
int ieee80211_if_add(struct ieee80211_local *local, const char *name,
struct wireless_dev **new_wdev, enum nl80211_iftype type,
struct vif_params *params)
@@ -1647,6 +1659,8 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
ieee80211_dfs_cac_timer_work);
INIT_DELAYED_WORK(&sdata->dec_tailroom_needed_wk,
ieee80211_delayed_tailroom_dec);
+ INIT_DELAYED_WORK(&sdata->crit_prot_end_wk,
+ ieee80211_crit_prot_timeout);
for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
struct ieee80211_supported_band *sband;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 25eb35b..c3084e4 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -895,6 +895,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
if (local->ops->sched_scan_start)
local->hw.wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
+ if (local->ops->crit_proto)
+ local->hw.wiphy->flags |= WIPHY_FLAG_SUPPORTS_CRIT_PROT;
+
/* mac80211 based drivers don't support internal TDLS setup */
if (local->hw.wiphy->flags & WIPHY_FLAG_SUPPORTS_TDLS)
local->hw.wiphy->flags |= WIPHY_FLAG_TDLS_EXTERNAL_SETUP;
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index d41bbe2..1e8eaaa 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1887,6 +1887,32 @@ TRACE_EVENT(drv_set_default_unicast_key,
LOCAL_PR_ARG, VIF_PR_ARG, __entry->key_idx)
);
+TRACE_EVENT(drv_crit_proto,
+ TP_PROTO(struct ieee80211_local *local,
+ struct ieee80211_sub_if_data *sdata,
+ enum nl80211_crit_proto_id protocol,
+ bool start),
+
+ TP_ARGS(local, sdata, protocol, start),
+
+ TP_STRUCT__entry(
+ LOCAL_ENTRY
+ VIF_ENTRY
+ __field(unsigned int, protocol)
+ __field(bool, start)
+ ),
+
+ TP_fast_assign(
+ LOCAL_ASSIGN;
+ VIF_ASSIGN;
+ __entry->protocol = protocol;
+ __entry->start = start;
+ ),
+
+ TP_printk(LOCAL_PR_FMT VIF_PR_FMT " protocol:%d start:%d",
+ LOCAL_PR_ARG, VIF_PR_ARG, __entry->protocol, __entry->start)
+);
+
TRACE_EVENT(drv_beacon_measurement,
TP_PROTO(struct ieee80211_local *local,
struct ieee80211_sub_if_data *sdata,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c2b43b6..e39c43d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1421,8 +1421,10 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
CMD(start_p2p_device, START_P2P_DEVICE);
CMD(set_mcast_rate, SET_MCAST_RATE);
if (state->split) {
- CMD(crit_proto_start, CRIT_PROTOCOL_START);
- CMD(crit_proto_stop, CRIT_PROTOCOL_STOP);
+ if (dev->wiphy.flags & WIPHY_FLAG_SUPPORTS_CRIT_PROT) {
+ CMD(crit_proto_start, CRIT_PROTOCOL_START);
+ CMD(crit_proto_stop, CRIT_PROTOCOL_STOP);
+ }
}
#ifdef CONFIG_NL80211_TESTMODE
--
1.8.0
^ permalink raw reply related
* pull-request: iwlwifi-fixes 2013-07-26
From: Johannes Berg @ 2013-07-26 8:17 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 2055 bytes --]
John,
Yet some more fixes - we're adding tests and are doing a debug cycle
with them.
We have a scan fix for passive channels, a new PCI device ID for an old
device, a NIC reset fix, an RF-Kill fix, a fix for powersave when GO
interfaces are present as well as an aggregation session fix (for a
corner case) and a workaround for a firmware design issue - it only
supports a single GTK in D3.
Let me know if there's any problem.
johannes
The following changes since commit a590ad411891de551e6de1b51ea635c0484148d6:
iwlwifi: mvm: remove extra SSID from probe request (2013-07-16 13:55:15 +0300)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git for-john
for you to fetch changes up to a53ee0a308b16e392e0219c585b10f329345766b:
iwlwifi: pcie: clear RFKILL interrupt in AMPG (2013-07-26 10:07:10 +0200)
----------------------------------------------------------------
David Spinadel (1):
iwlwifi: mvm: set SSID bits for passive channels
Emmanuel Grumbach (3):
iwlwifi: add DELL SKU for 5150 HMC
iwlwifi: pcie: reset the NIC before the bring up
iwlwifi: pcie: clear RFKILL interrupt in AMPG
Ilan Peer (1):
iwlwifi: mvm: Disable managed PS when GO is added
Johannes Berg (2):
iwlwifi: mvm: use only a single GTK in D3
iwlwifi: mvm: fix flushing not started aggregation sessions
drivers/net/wireless/iwlwifi/iwl-prph.h | 2 ++
drivers/net/wireless/iwlwifi/mvm/d3.c | 15 ++++++---
drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h | 1 -
drivers/net/wireless/iwlwifi/mvm/mac80211.c | 42 +++++++++++++-------------
drivers/net/wireless/iwlwifi/mvm/scan.c | 11 ++-----
drivers/net/wireless/iwlwifi/mvm/sta.c | 11 +++++--
drivers/net/wireless/iwlwifi/pcie/drv.c | 1 +
drivers/net/wireless/iwlwifi/pcie/rx.c | 8 +++++
drivers/net/wireless/iwlwifi/pcie/trans.c | 5 +++
9 files changed, 57 insertions(+), 39 deletions(-)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
* [PATCH 2/7] iwlwifi: mvm: use only a single GTK in D3
From: Johannes Berg @ 2013-07-26 8:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
In-Reply-To: <1374826768-2440-1-git-send-email-johannes@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
Unfortunately, the firmware only supports replay counters for
a single GTK in D3, so that we should only upload the last
key and use its replay counters. Since mac80211 key iteration
will walk through the keys in order of their addition, simply
use the same HW key index (1) for all GTKs, thus overwriting
previous ones with newer ones. The replay counters for it are
already used.
Reviewed-by: Yaron Vaknin <Yaron.Vaknin@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/d3.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c
index 7e5e5c2..83da884 100644
--- a/drivers/net/wireless/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/iwlwifi/mvm/d3.c
@@ -134,7 +134,7 @@ struct wowlan_key_data {
struct iwl_wowlan_rsc_tsc_params_cmd *rsc_tsc;
struct iwl_wowlan_tkip_params_cmd *tkip;
bool error, use_rsc_tsc, use_tkip;
- int gtk_key_idx;
+ int wep_key_idx;
};
static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
@@ -188,8 +188,8 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
wkc.wep_key.key_offset = 0;
} else {
/* others start at 1 */
- data->gtk_key_idx++;
- wkc.wep_key.key_offset = data->gtk_key_idx;
+ data->wep_key_idx++;
+ wkc.wep_key.key_offset = data->wep_key_idx;
}
ret = iwl_mvm_send_cmd_pdu(mvm, WEP_KEY, CMD_SYNC,
@@ -316,8 +316,13 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw,
mvm->ptk_ivlen = key->iv_len;
mvm->ptk_icvlen = key->icv_len;
} else {
- data->gtk_key_idx++;
- key->hw_key_idx = data->gtk_key_idx;
+ /*
+ * firmware only supports TSC/RSC for a single key,
+ * so if there are multiple keep overwriting them
+ * with new ones -- this relies on mac80211 doing
+ * list_add_tail().
+ */
+ key->hw_key_idx = 1;
mvm->gtk_ivlen = key->iv_len;
mvm->gtk_icvlen = key->icv_len;
}
--
1.8.0
^ permalink raw reply related
* [PATCH 1/7] iwlwifi: add DELL SKU for 5150 HMC
From: Johannes Berg @ 2013-07-26 8:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Emmanuel Grumbach
In-Reply-To: <1374826675.8248.11.camel@jlt4.sipsolutions.net>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This SKU was missing in the list of supported devices
https://bugzilla.kernel.org/show_bug.cgi?id=60577
Cc: <stable@vger.kernel.org> [all versions]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/pcie/drv.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index 81f3ea5..ff13458 100644
--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
@@ -130,6 +130,7 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = {
{IWL_PCI_DEVICE(0x423C, 0x1306, iwl5150_abg_cfg)}, /* Half Mini Card */
{IWL_PCI_DEVICE(0x423C, 0x1221, iwl5150_agn_cfg)}, /* Mini Card */
{IWL_PCI_DEVICE(0x423C, 0x1321, iwl5150_agn_cfg)}, /* Half Mini Card */
+ {IWL_PCI_DEVICE(0x423C, 0x1326, iwl5150_abg_cfg)}, /* Half Mini Card */
{IWL_PCI_DEVICE(0x423D, 0x1211, iwl5150_agn_cfg)}, /* Mini Card */
{IWL_PCI_DEVICE(0x423D, 0x1311, iwl5150_agn_cfg)}, /* Half Mini Card */
--
1.8.0
^ permalink raw reply related
* [PATCH 3/7] iwlwifi: mvm: set SSID bits for passive channels
From: Johannes Berg @ 2013-07-26 8:19 UTC (permalink / raw)
To: linux-wireless; +Cc: David Spinadel
In-Reply-To: <1374826768-2440-1-git-send-email-johannes@sipsolutions.net>
From: David Spinadel <david.spinadel@intel.com>
Set SSID bitmap for direct scan even on passive channels,
for the passive-to-active feature. Without this patch only
the SSID from probe request template is sent on passive
channels, after passive-to-active switching, causing us to
not find all desired networks.
Remove the unused passive scan mask constant.
Cc: stable@vger.kernel.org
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h | 1 -
drivers/net/wireless/iwlwifi/mvm/scan.c | 11 ++---------
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
index b60d141..365095a 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
+++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h
@@ -69,7 +69,6 @@
/* Scan Commands, Responses, Notifications */
/* Masks for iwl_scan_channel.type flags */
-#define SCAN_CHANNEL_TYPE_PASSIVE 0
#define SCAN_CHANNEL_TYPE_ACTIVE BIT(0)
#define SCAN_CHANNEL_NARROW_BAND BIT(22)
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
index 268f027..acdff6b 100644
--- a/drivers/net/wireless/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
@@ -178,19 +178,12 @@ static void iwl_mvm_scan_fill_channels(struct iwl_scan_cmd *cmd,
struct iwl_scan_channel *chan = (struct iwl_scan_channel *)
(cmd->data + le16_to_cpu(cmd->tx_cmd.len));
int i;
- __le32 chan_type_value;
-
- if (req->n_ssids > 0)
- chan_type_value = cpu_to_le32(BIT(req->n_ssids) - 1);
- else
- chan_type_value = SCAN_CHANNEL_TYPE_PASSIVE;
for (i = 0; i < cmd->channel_count; i++) {
chan->channel = cpu_to_le16(req->channels[i]->hw_value);
+ chan->type = cpu_to_le32(BIT(req->n_ssids) - 1);
if (req->channels[i]->flags & IEEE80211_CHAN_PASSIVE_SCAN)
- chan->type = SCAN_CHANNEL_TYPE_PASSIVE;
- else
- chan->type = chan_type_value;
+ chan->type &= cpu_to_le32(~SCAN_CHANNEL_TYPE_ACTIVE);
chan->active_dwell = cpu_to_le16(active_dwell);
chan->passive_dwell = cpu_to_le16(passive_dwell);
chan->iteration_count = cpu_to_le16(1);
--
1.8.0
^ permalink raw reply related
* [PATCH 5/7] iwlwifi: mvm: Disable managed PS when GO is added
From: Johannes Berg @ 2013-07-26 8:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Ilan Peer
In-Reply-To: <1374826768-2440-1-git-send-email-johannes@sipsolutions.net>
From: Ilan Peer <ilan.peer@intel.com>
The managed interface PS was not disabled when a GO interface
was added. As a consequence, when the station VMAC was in PS,
the GO also was not on the medium. Fix this.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/mac80211.c | 42 ++++++++++++++---------------
1 file changed, 21 insertions(+), 21 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 1eedc42..f19baf0 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -512,6 +512,27 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
goto out_unlock;
/*
+ * TODO: remove this temporary code.
+ * Currently MVM FW supports power management only on single MAC.
+ * If new interface added, disable PM on existing interface.
+ * P2P device is a special case, since it is handled by FW similary to
+ * scan. If P2P deviced is added, PM remains enabled on existing
+ * interface.
+ * Note: the method below does not count the new interface being added
+ * at this moment.
+ */
+ if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
+ mvm->vif_count++;
+ if (mvm->vif_count > 1) {
+ IWL_DEBUG_MAC80211(mvm,
+ "Disable power on existing interfaces\n");
+ ieee80211_iterate_active_interfaces_atomic(
+ mvm->hw,
+ IEEE80211_IFACE_ITER_NORMAL,
+ iwl_mvm_pm_disable_iterator, mvm);
+ }
+
+ /*
* The AP binding flow can be done only after the beacon
* template is configured (which happens only in the mac80211
* start_ap() flow), and adding the broadcast station can happen
@@ -534,27 +555,6 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
goto out_unlock;
}
- /*
- * TODO: remove this temporary code.
- * Currently MVM FW supports power management only on single MAC.
- * If new interface added, disable PM on existing interface.
- * P2P device is a special case, since it is handled by FW similary to
- * scan. If P2P deviced is added, PM remains enabled on existing
- * interface.
- * Note: the method below does not count the new interface being added
- * at this moment.
- */
- if (vif->type != NL80211_IFTYPE_P2P_DEVICE)
- mvm->vif_count++;
- if (mvm->vif_count > 1) {
- IWL_DEBUG_MAC80211(mvm,
- "Disable power on existing interfaces\n");
- ieee80211_iterate_active_interfaces_atomic(
- mvm->hw,
- IEEE80211_IFACE_ITER_NORMAL,
- iwl_mvm_pm_disable_iterator, mvm);
- }
-
ret = iwl_mvm_mac_ctxt_add(mvm, vif);
if (ret)
goto out_release;
--
1.8.0
^ permalink raw reply related
* [PATCH 4/7] iwlwifi: pcie: reset the NIC before the bring up
From: Johannes Berg @ 2013-07-26 8:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Emmanuel Grumbach
In-Reply-To: <1374826768-2440-1-git-send-email-johannes@sipsolutions.net>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This allows to clean all kinds of bad state it might be in.
This solves situation where HW RFkill was switched while
the NIC was offline.
Until now, we relied on the firmware to do clean the
interrupt, but new firmwares don't do that any more.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/pcie/trans.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 826c156..96cfcdd 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -670,6 +670,11 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
return err;
}
+ /* Reset the entire device */
+ iwl_set_bit(trans, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
+
+ usleep_range(10, 15);
+
iwl_pcie_apm_init(trans);
/* From now on, the op_mode will be kept updated about RF kill state */
--
1.8.0
^ permalink raw reply related
* [PATCH 6/7] iwlwifi: mvm: fix flushing not started aggregation sessions
From: Johannes Berg @ 2013-07-26 8:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
In-Reply-To: <1374826768-2440-1-git-send-email-johannes@sipsolutions.net>
From: Johannes Berg <johannes.berg@intel.com>
When a not fully started aggregation session is destroyed
and flushed, we get a warning, e.g.
WARNING: at drivers/net/wireless/iwlwifi/pcie/tx.c:1142 iwl_trans_pcie_txq_disable+0x11c/0x160
queue 16 not used
Modules linked in: [...]
Pid: 5135, comm: hostapd Tainted: G W O 3.5.0 #10
Call Trace:
wlan0: driver sets block=0 for sta 00:03:7f:10:44:d3
[<ffffffff81036492>] warn_slowpath_common+0x72/0xa0
[<ffffffff81036577>] warn_slowpath_fmt+0x47/0x50
[<ffffffffa0368d6c>] iwl_trans_pcie_txq_disable+0x11c/0x160 [iwlwifi]
[<ffffffffa03a2099>] iwl_mvm_sta_tx_agg_flush+0xe9/0x150 [iwlmvm]
[<ffffffffa0396c43>] iwl_mvm_mac_ampdu_action+0xf3/0x1e0 [iwlmvm]
[<ffffffffa0293ad3>] ___ieee80211_stop_tx_ba_session+0x193/0x920 [mac80211]
[<ffffffffa0294ed8>] __ieee80211_stop_tx_ba_session+0x48/0x70 [mac80211]
[<ffffffffa029159f>] ieee80211_sta_tear_down_BA_sessions+0x4f/0x80 [mac80211]
[<ffffffffa028a686>] __sta_info_destroy+0x66/0x370 [mac80211]
[<ffffffffa028abb4>] sta_info_destroy_addr_bss+0x44/0x70 [mac80211]
[<ffffffffa02a3e26>] ieee80211_del_station+0x26/0x50 [mac80211]
[<ffffffffa01e6395>] nl80211_del_station+0x85/0x200 [cfg80211]
when a station deauthenticated from us without fully setting
up the aggregation session.
Fix this by checking the aggregation state before removing
the hardware queue.
Cc: stable@vger.kernel.org
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/sta.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c
index 85d4bbe..563f559 100644
--- a/drivers/net/wireless/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/mvm/sta.c
@@ -915,6 +915,7 @@ int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct iwl_mvm_sta *mvmsta = (void *)sta->drv_priv;
struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid];
u16 txq_id;
+ enum iwl_mvm_agg_state old_state;
/*
* First set the agg state to OFF to avoid calling
@@ -924,13 +925,17 @@ int iwl_mvm_sta_tx_agg_flush(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
txq_id = tid_data->txq_id;
IWL_DEBUG_TX_QUEUES(mvm, "Flush AGG: sta %d tid %d q %d state %d\n",
mvmsta->sta_id, tid, txq_id, tid_data->state);
+ old_state = tid_data->state;
tid_data->state = IWL_AGG_OFF;
spin_unlock_bh(&mvmsta->lock);
- if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), true))
- IWL_ERR(mvm, "Couldn't flush the AGG queue\n");
+ if (old_state >= IWL_AGG_ON) {
+ if (iwl_mvm_flush_tx_path(mvm, BIT(txq_id), true))
+ IWL_ERR(mvm, "Couldn't flush the AGG queue\n");
+
+ iwl_trans_txq_disable(mvm->trans, tid_data->txq_id);
+ }
- iwl_trans_txq_disable(mvm->trans, tid_data->txq_id);
mvm->queue_to_mac80211[tid_data->txq_id] =
IWL_INVALID_MAC80211_QUEUE;
--
1.8.0
^ permalink raw reply related
* [PATCH 7/7] iwlwifi: pcie: clear RFKILL interrupt in AMPG
From: Johannes Berg @ 2013-07-26 8:19 UTC (permalink / raw)
To: linux-wireless; +Cc: Emmanuel Grumbach
In-Reply-To: <1374826768-2440-1-git-send-email-johannes@sipsolutions.net>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
If we forget to do so, we can't send HCMD to firmware while
the NIC is in RFKILL state.
Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
drivers/net/wireless/iwlwifi/iwl-prph.h | 2 ++
drivers/net/wireless/iwlwifi/pcie/rx.c | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h
index ff8cc75..a70c7b9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
@@ -97,6 +97,8 @@
#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800)
+#define APMG_RTC_INT_STT_RFKILL (0x10000000)
+
/* Device system time */
#define DEVICE_SYSTEM_TIME_REG 0xA0206C
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index fd848cd..f600e68 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -888,6 +888,14 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
if (hw_rfkill) {
+ /*
+ * Clear the interrupt in APMG if the NIC is going down.
+ * Note that when the NIC exits RFkill (else branch), we
+ * can't access prph and the NIC will be reset in
+ * start_hw anyway.
+ */
+ iwl_write_prph(trans, APMG_RTC_INT_STT_REG,
+ APMG_RTC_INT_STT_RFKILL);
set_bit(STATUS_RFKILL, &trans_pcie->status);
if (test_and_clear_bit(STATUS_HCMD_ACTIVE,
&trans_pcie->status))
--
1.8.0
^ permalink raw reply related
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