* Re: [RFC 2/5] iwlwifi: fix request_module() use
From: Luis R. Rodriguez @ 2017-02-21 20:17 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Grumbach, Emmanuel, Berg, Johannes, Coelho, Luciano,
tj@kernel.org, arjan@linux.intel.com, ming.lei@canonical.com,
zajec5@gmail.com, jeyu@redhat.com, rusty@rustcorp.com.au,
pmladek@suse.com, gregkh@linuxfoundation.org, linuxwifi,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20170221181541.GN31264@wotan.suse.de>
On Tue, Feb 21, 2017 at 07:15:41PM +0100, Luis R. Rodriguez wrote:
> On Tue, Feb 21, 2017 at 07:16:16AM +0000, Grumbach, Emmanuel wrote:
> > >
> > > a) just remove the print and use instead request_module_nowait() (this is
> > > more in alignment of what your code actually does today; or
> > >
> > > b) fix the request_module() use so that the error print matches the
> > > expected and proper recommended use of request_module() (what this patch
> > > does)
> > >
> > > I prefer a) actually but I had to show what b) looked like first :)
> >
> > Me too. Let's do the simple thing. After all, it's been working for 5 years
> > now (maybe more?) and I don't see a huge need to verify that the opmode
> > module has been loaded. It is very unlikely to fail anyway, and in the case
> > it did fail, it's not that we can do much from iwlwifi point of view.
>
> I tend to agree with you on this, retries would be the only sensible thing to
> do, but why do that -- the error should be logged right and addressed by any
> upper layers. Its one reason to consider in the future adding verifiers
> as built-in optional part of module loading.
It would seem we still need to offload the opmode start as it is the one that
really should be issuing the completion, otherwise we would end up sending a
completion while the opmode module is being loaded asynchronously. The changes
are for that are still very likely desirable as it should help with speeding
boot up.
So the sharing of the opcode start will go first.
Will send v2.
Luis
^ permalink raw reply
* Re: [PATCH] Revert "ath10k: Search SMBIOS for OEM board file extension"
From: David Miller @ 2017-02-21 21:00 UTC (permalink / raw)
To: kvalo; +Cc: netdev, linux-wireless, ath10k
In-Reply-To: <1487706426-31172-1-git-send-email-kvalo@qca.qualcomm.com>
From: Kalle Valo <kvalo@qca.qualcomm.com>
Date: Tue, 21 Feb 2017 21:47:06 +0200
> This reverts commit f2593cb1b29185d38db706cbcbe22ed538720ae1.
>
> Paul reported that this patch with older board-2.bin ath10k initialisation
> fails on Dell XPS 13:
>
> ath10k_pci 0000:3a:00.0: failed to fetch board data for bus=pci,vendor=168c,
> device=003e,subsystem-vendor=1a56,subsystem-device=1535,variant=RV_0520 from
> ath10k/QCA6174/hw3.0/board-2.bin
>
> The reason is that the older board-2.bin does not have the variant version of
> the image name and ath10k does not fallback to the older naming scheme.
>
> Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=185621#c9
> Fixes: f2593cb1b291 ("ath10k: Search SMBIOS for OEM board file extension")
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
> ---
>
> Dave, please take this directly if you can.
Applied, thanks Kalle.
^ permalink raw reply
* Re: ath10k regression on XPS13
From: David Miller @ 2017-02-21 21:00 UTC (permalink / raw)
To: kvalo; +Cc: torvalds, jikos, linux-kernel, ath10k, linux-wireless
In-Reply-To: <87poibb9ze.fsf@kamboji.qca.qualcomm.com>
From: Kalle Valo <kvalo@codeaurora.org>
Date: Tue, 21 Feb 2017 21:49:09 +0200
> David Miller <davem@davemloft.net> writes:
>
>> From: Kalle Valo <kvalo@codeaurora.org>
>> Date: Tue, 21 Feb 2017 20:38:48 +0200
>>
>>> David Miller <davem@davemloft.net> writes:
>>>
>>>> From: Kalle Valo <kvalo@codeaurora.org>
>>>> Date: Tue, 21 Feb 2017 11:32:49 +0200
>>>>
>>>>> We are working on a fix so that ath10k continues to work with older
>>>>> board-2.bin, but that might take a day or two still.
>>>>
>>>> Kalle I really wanted to send my net-next pull request to Linus later
>>>> today. But I guess I have to wait for this ath10k first.
>>>>
>>>> Please get this to me as soon as possible, thanks.
>>>
>>> We have a fix now but it's not really tested that well so I'm reluctant
>>> to submit it yet. As I don't want to make you wait I think I'll submit
>>> you a patch reverting f2593cb1b291 in an hour or two. And later in the
>>> week I send you a properly fixed (and tested) version of f2593cb1b291.
>>>
>>> Does that sound ok to you?
>>
>> Sure.
>
> Here's the revert:
>
> https://patchwork.ozlabs.org/patch/730735/
>
> I didn't send a pull request because that felt overkill to do just for
> one patch.
Yep, that's fine.
^ permalink raw reply
* Re: ath10k regression on XPS13
From: David Miller @ 2017-02-21 21:01 UTC (permalink / raw)
To: torvalds; +Cc: kvalo, jikos, linux-kernel, ath10k, linux-wireless
In-Reply-To: <CA+55aFyqH3WAKsD_AaCe905zJbPzTXGygu2eiD1L0d6c2sAkGA@mail.gmail.com>
From: Linus Torvalds <torvalds@linux-foundation.org>
Date: Tue, 21 Feb 2017 10:52:33 -0800
> On Tue, Feb 21, 2017 at 10:18 AM, David Miller <davem@davemloft.net> wrote:
>>
>> Kalle I really wanted to send my net-next pull request to Linus later
>> today. But I guess I have to wait for this ath10k first.
>
> Feel free to send it to me - it sounds like the regression is
> (a) easy to work around
> and
> (b) has a fix coming up.
>
> And it won't even be something that I personally notice, since I have
> the prev-gen XPS13 that has intel wireless.
I have the revert in my tree, it's all good.
I'll let my tree sit quietly for a few hours then send a pull
request out later tonight.
^ permalink raw reply
* Regression with Intel 3160 AP: client not reconnecting
From: Jarek Kamiński @ 2017-02-21 21:33 UTC (permalink / raw)
To: Johannes Berg, Emmanuel Grumbach, Intel Linux Wireless; +Cc: linux-wireless
Hello,
I have an accesspoint running on Intel 3160 (ZBOX RI-323). It was
running just fine on 3.16 from Debian, but I recently tried upgrading it
to 4.9 and noticed strange issues with wireless clients.
With the recent versions of iwlwifi, when a client disconnects, it is
not noticed by the accesspoint. The following log comes from
backport-iwlwifi master (7ae529a404a30fdb78d7dcc1a7e5883a014c6552) on
3.16 (similar results on 4.9 as well):
#v+
lut 21 22:12:04 Wintermute hostapd[2419]: wlan0: STA xx:xx:xx:xx:xx:xx RADIUS: VLAN ID 2
lut 21 22:12:04 Wintermute hostapd[2419]: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
lut 21 22:12:04 Wintermute hostapd[2419]: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: associated (aid 3)
lut 21 22:12:04 Wintermute hostapd[2419]: wlan0: STA xx:xx:xx:xx:xx:xx RADIUS: starting accounting session 58ACAD18-00000002
lut 21 22:12:04 Wintermute hostapd[2419]: wlan0: STA xx:xx:xx:xx:xx:xx WPA: pairwise key handshake completed (RSN)
[disconnect: nothing happens]
[try to reconnect: nothing happens, client doesn't connect]
#v-
Only running iw wlan0.2 station del xx:xx:xx:xx:xx:xx helps and allows
the client to connect.
To compare, on iwlwifi from Debian 3.16.39-1-amd64 everything works fine:
#v+
lut 21 22:03:46 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx RADIUS: VLAN ID 2
lut 21 22:03:46 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
lut 21 22:03:46 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: associated (aid 2)
lut 21 22:03:49 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx RADIUS: starting accounting session 58A9650D-00000084
lut 21 22:03:49 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx WPA: pairwise key handshake completed (RSN)
lut 21 22:04:16 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: disassociated
lut 21 22:04:16 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: disassociated
lut 21 22:04:17 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
lut 21 22:04:24 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx RADIUS: VLAN ID 2
lut 21 22:04:24 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
lut 21 22:04:24 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: associated (aid 2)
lut 21 22:04:26 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx RADIUS: starting accounting session 58A9650D-00000085
lut 21 22:04:26 Wintermute hostapd[12719]: wlan0: STA xx:xx:xx:xx:xx:xx WPA: pairwise key handshake completed (RSN)
#v-
I bisected it using the backport-iwlwifi tree on 4.5 down to
4061dda503118ef5c70e0afe77798c94a48a79b9 (iwlwifi: mvm: pass station to
mac80211 RX where known, [1]). I was using the following test procedure:
1) Build, load, start hostapd.
2) Connect with an Android mobile phone (which I had at hand).
3) Disable Wi-Fi on Android.
4) Reenable Wi-Fi. Connected -> git bisect good, didn't connect -> git
bisect bad.
I was using 4.5 because that was the lowest version against which all
intermediate commits were compiling without errors.
To verify, I patched the backports-iwlwifi master with the following
patch (on 3.16) and the Android phone started reconnecting.
#v+
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
index b02ad68..70edf42 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
@@ -144,7 +144,7 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
fraglen, rxb->truesize);
}
- ieee80211_rx_napi(mvm->hw, sta, skb, napi);
+ ieee80211_rx_napi(mvm->hw, NULL, skb, napi);
}
/*
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index 66d237c..93c2542 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -209,7 +209,7 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
if (iwl_mvm_check_pn(mvm, skb, queue, sta))
kfree_skb(skb);
else
- ieee80211_rx_napi(mvm->hw, sta, skb, napi);
+ ieee80211_rx_napi(mvm->hw, NULL, skb, napi);
}
static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm,
#v-
I assume that's not a correct fix, but maybe it can help to pinpoint the
root cause.
I'm running hostapd in a fairly normal configuration. One notable thing
is dynamic_vlan=1 with accept_mac_file and individual PSKs set in
wpa_psk_file.
What might be the cause? Is there anything I can do to help debug or fix
this?
Thanks in advance!
[1] http://git.kernel.org/cgit/linux/kernel/git/iwlwifi/backport-iwlwifi.git/commit/?id=4061dda503118ef5c70e0afe77798c94a48a79b9
--
pozdr(); // Jarek
^ permalink raw reply related
* Usage of WoWLAN with iwlwifi driver (Device phy0 failed to suspend async: error -16)
From: Oliver Freyermuth @ 2017-02-21 21:46 UTC (permalink / raw)
To: linux-wireless
Dear wireless experts,
I have been trying to get basic WoWLAN to work with the following configuration:
- Intel Corporation Wireless 7260 (rev 73) with in-tree iwlwifi driver
- Kernel 4.10.0 (on Gentoo Linux)
- Very recent firmware version for the card and revision:
iwlwifi 0000:0a:00.0: loaded firmware version 17.459231.0 op_mode iwlmvm
iwlwifi 0000:0a:00.0: Detected Intel(R) Dual Band Wireless AC 7260, REV=0x144
I try to do:
$ iw phy phy0 wowlan enable magic-packet
$ iw phy phy0 wowlan show
WoWLAN is enabled:
* wake up on magic packet
However, when trying to suspend to RAM ( echo mem > /sys/power/state ), I get:
[46656.403767] dpm_run_callback(): wiphy_suspend+0x0/0x97 [cfg80211] returns -16
[46656.403769] PM: Device phy0 failed to suspend async: error -16
[46656.967002] PM: Some devices failed to suspend, or early wake event detected
It also happens with more complex configurations (e.g. TCP connection WoWLAN mode).
Only after:
$ iw phy phy0 wowlan disable
I can suspend normally again.
I found an earlier report here:
https://bugzilla.kernel.org/show_bug.cgi?id=109591#c25
from somebody using kernel 4.6.
Is this a known issue? Is WoWLAN supposed to work with this hardware (I guess it's quite wide-spread)?
If possible, please ping me directly in replies, I am not subscribed to the list (but will try to check gmane regularly).
Cheers and thanks for any support,
Oliver
^ permalink raw reply
* [PATCH] mac80211: Jitter HWMP MPATH reply frames to reduce collision, on dense networks.
From: Alexis Green @ 2017-02-21 23:24 UTC (permalink / raw)
To: linux-wireless; +Cc: Jesse Jones
From: Jesse Jones <jjones@uniumwifi.com>
When more than one station hears a broadcast request, it is possible that
multiple devices will reply at the same time, potentially causing
collision. This patch helps reduce this issue.
Signed-off-by: Alexis Green <agreen@uniumwifi.com>
Signed-off-by: Benjamin Morgan <bmorgan@uniumwifi.com>
---
net/mac80211/ieee80211_i.h | 11 ++++
net/mac80211/iface.c | 58 +++++++++++++++++++++
net/mac80211/mesh.c | 2 +
net/mac80211/mesh_hwmp.c | 124 +++++++++++++++++++++++++++++++++++----------
4 files changed, 168 insertions(+), 27 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 159a1a7..f422897 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -330,6 +330,11 @@ struct mesh_preq_queue {
u8 flags;
};
+struct mesh_tx_queue {
+ struct list_head list;
+ struct sk_buff *skb;
+};
+
struct ieee80211_roc_work {
struct list_head list;
@@ -670,6 +675,11 @@ struct ieee80211_if_mesh {
spinlock_t mesh_preq_queue_lock;
struct mesh_preq_queue preq_queue;
int preq_queue_len;
+ /* Spinlock for MPATH frame tx queue */
+ spinlock_t mesh_tx_queue_lock;
+ struct mesh_tx_queue tx_queue;
+ int tx_queue_len;
+
struct mesh_stats mshstats;
struct mesh_config mshcfg;
atomic_t estab_plinks;
@@ -919,6 +929,7 @@ struct ieee80211_sub_if_data {
struct work_struct work;
struct sk_buff_head skb_queue;
+ struct delayed_work tx_work;
u8 needed_rx_chains;
enum ieee80211_smps_mode smps_mode;
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 40813dd..51d5cfa 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -778,6 +778,59 @@ static int ieee80211_open(struct net_device *dev)
return ieee80211_do_open(&sdata->wdev, true);
}
+static void flush_tx_skbs(struct ieee80211_sub_if_data *sdata)
+{
+ struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+ struct mesh_tx_queue *tx_node;
+
+ spin_lock_bh(&ifmsh->mesh_tx_queue_lock);
+
+ /* Note that this check is important because of the two-stage
+ * way that ieee80211_if_mesh is initialized.
+ */
+ if (ifmsh->tx_queue_len > 0) {
+ mhwmp_dbg(sdata, "flushing %d skbs", ifmsh->tx_queue_len);
+
+ while (!list_empty(&ifmsh->tx_queue.list)) {
+ tx_node = list_last_entry(&ifmsh->tx_queue.list,
+ struct mesh_tx_queue, list);
+ kfree_skb(tx_node->skb);
+ list_del(&tx_node->list);
+ kfree(tx_node);
+ }
+ ifmsh->tx_queue_len = 0;
+ }
+
+ spin_unlock_bh(&ifmsh->mesh_tx_queue_lock);
+}
+
+static void mesh_jittered_tx(struct work_struct *wk)
+{
+ struct ieee80211_sub_if_data *sdata =
+ container_of(
+ wk, struct ieee80211_sub_if_data,
+ tx_work.work);
+
+ struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+ struct mesh_tx_queue *tx_node;
+
+ spin_lock_bh(&ifmsh->mesh_tx_queue_lock);
+
+ list_for_each_entry(tx_node, &ifmsh->tx_queue.list, list) {
+ ieee80211_tx_skb(sdata, tx_node->skb);
+ }
+
+ while (!list_empty(&ifmsh->tx_queue.list)) {
+ tx_node = list_last_entry(&ifmsh->tx_queue.list,
+ struct mesh_tx_queue, list);
+ list_del(&tx_node->list);
+ kfree(tx_node);
+ }
+ ifmsh->tx_queue_len = 0;
+
+ spin_unlock_bh(&ifmsh->mesh_tx_queue_lock);
+}
+
static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
bool going_down)
{
@@ -881,6 +934,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);
+ flush_tx_skbs(sdata);
+ cancel_delayed_work_sync(&sdata->tx_work);
+
if (sdata->wdev.cac_started) {
chandef = sdata->vif.bss_conf.chandef;
WARN_ON(local->suspended);
@@ -1846,6 +1902,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->tx_work,
+ mesh_jittered_tx);
for (i = 0; i < NUM_NL80211_BANDS; i++) {
struct ieee80211_supported_band *sband;
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index c28b0af..f0d3cd9 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -1381,6 +1381,8 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
ieee80211_mesh_path_root_timer,
(unsigned long) sdata);
INIT_LIST_HEAD(&ifmsh->preq_queue.list);
+ INIT_LIST_HEAD(&ifmsh->tx_queue.list);
+ spin_lock_init(&ifmsh->mesh_tx_queue_lock);
skb_queue_head_init(&ifmsh->ps.bc_buf);
spin_lock_init(&ifmsh->mesh_preq_queue_lock);
spin_lock_init(&ifmsh->sync_offset_lock);
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index b747c96..2f8ca4a 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -18,6 +18,7 @@
#define ARITH_SHIFT 8
#define MAX_PREQ_QUEUE_LEN 64
+#define MAX_TX_QUEUE_LEN 8
static void mesh_queue_preq(struct mesh_path *, u8);
@@ -98,13 +99,15 @@ enum mpath_frame_type {
static const u8 broadcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
- const u8 *orig_addr, u32 orig_sn,
- u8 target_flags, const u8 *target,
- u32 target_sn, const u8 *da,
- u8 hop_count, u8 ttl,
- u32 lifetime, u32 metric, u32 preq_id,
- struct ieee80211_sub_if_data *sdata)
+static struct sk_buff *alloc_mesh_path_sel_frame(enum mpath_frame_type action,
+ u8 flags, const u8 *orig_addr,
+ u32 orig_sn, u8 target_flags,
+ const u8 *target,
+ u32 target_sn, const u8 *da,
+ u8 hop_count, u8 ttl,
+ u32 lifetime, u32 metric,
+ u32 preq_id,
+ struct ieee80211_sub_if_data *sdata)
{
struct ieee80211_local *local = sdata->local;
struct sk_buff *skb;
@@ -117,7 +120,7 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
hdr_len +
2 + 37); /* max HWMP IE */
if (!skb)
- return -1;
+ return NULL;
skb_reserve(skb, local->tx_headroom);
mgmt = (struct ieee80211_mgmt *) skb_put(skb, hdr_len);
memset(mgmt, 0, hdr_len);
@@ -153,7 +156,7 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
break;
default:
kfree_skb(skb);
- return -ENOTSUPP;
+ return NULL;
}
*pos++ = ie_len;
*pos++ = flags;
@@ -192,10 +195,72 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
pos += 4;
}
- ieee80211_tx_skb(sdata, skb);
- return 0;
+ return skb;
+}
+
+static void mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
+ const u8 *orig_addr, u32 orig_sn,
+ u8 target_flags, const u8 *target,
+ u32 target_sn, const u8 *da,
+ u8 hop_count, u8 ttl,
+ u32 lifetime, u32 metric, u32 preq_id,
+ struct ieee80211_sub_if_data *sdata)
+{
+ struct sk_buff *skb = alloc_mesh_path_sel_frame(action, flags,
+ orig_addr, orig_sn, target_flags, target, target_sn,
+ da, hop_count, ttl, lifetime, metric, preq_id, sdata);
+ if (skb)
+ ieee80211_tx_skb(sdata, skb);
}
+static void mesh_path_sel_frame_tx_jittered(enum mpath_frame_type action,
+ u8 flags, const u8 *orig_addr,
+ u32 orig_sn, u8 target_flags,
+ const u8 *target, u32 target_sn,
+ const u8 *da, u8 hop_count, u8 ttl,
+ u32 lifetime, u32 metric,
+ u32 preq_id,
+ struct ieee80211_sub_if_data *sdata)
+{
+ u32 jitter;
+ struct sk_buff *skb = alloc_mesh_path_sel_frame(action, flags,
+ orig_addr, orig_sn,
+ target_flags, target,
+ target_sn, da,
+ hop_count, ttl,
+ lifetime, metric,
+ preq_id, sdata);
+ if (skb) {
+ struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+ struct mesh_tx_queue *tx_node = kmalloc(
+ sizeof(struct mesh_tx_queue), GFP_ATOMIC);
+ if (!tx_node) {
+ mhwmp_dbg(sdata, "could not allocate mesh_hwmp tx node");
+ return;
+ }
+
+ spin_lock_bh(&ifmsh->mesh_tx_queue_lock);
+ if (ifmsh->tx_queue_len == MAX_TX_QUEUE_LEN) {
+ spin_unlock_bh(&ifmsh->mesh_tx_queue_lock);
+ kfree(tx_node);
+ kfree_skb(skb);
+ if (printk_ratelimit())
+ mhwmp_dbg(sdata, "mesh_hwmp tx node queue full");
+ return;
+ }
+
+ tx_node->skb = skb;
+ list_add_tail(&tx_node->list, &ifmsh->tx_queue.list);
+ ++ifmsh->tx_queue_len;
+ spin_unlock_bh(&ifmsh->mesh_tx_queue_lock);
+
+ jitter = prandom_u32() % 25;
+
+ ieee80211_queue_delayed_work(
+ &sdata->local->hw,
+ &sdata->tx_work, msecs_to_jiffies(jitter));
+ }
+}
/* Headroom is not adjusted. Caller should ensure that skb has sufficient
* headroom in case the frame is encrypted. */
@@ -611,11 +676,13 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
ttl = ifmsh->mshcfg.element_ttl;
if (ttl != 0) {
mhwmp_dbg(sdata, "replying to the PREQ\n");
- mesh_path_sel_frame_tx(MPATH_PREP, 0, orig_addr,
- orig_sn, 0, target_addr,
- target_sn, mgmt->sa, 0, ttl,
- lifetime, target_metric, 0,
- sdata);
+ mesh_path_sel_frame_tx_jittered(MPATH_PREP, 0,
+ orig_addr, orig_sn,
+ 0, target_addr,
+ target_sn, mgmt->sa,
+ 0, ttl, lifetime,
+ target_metric, 0,
+ sdata);
} else {
ifmsh->mshstats.dropped_frames_ttl++;
}
@@ -643,10 +710,11 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
target_sn = PREQ_IE_TARGET_SN(preq_elem);
}
- mesh_path_sel_frame_tx(MPATH_PREQ, flags, orig_addr,
- orig_sn, target_flags, target_addr,
- target_sn, da, hopcount, ttl, lifetime,
- orig_metric, preq_id, sdata);
+ mesh_path_sel_frame_tx_jittered(MPATH_PREQ, flags, orig_addr,
+ orig_sn, target_flags,
+ target_addr, target_sn, da,
+ hopcount, ttl, lifetime,
+ orig_metric, preq_id, sdata);
if (!is_multicast_ether_addr(da))
ifmsh->mshstats.fwded_unicast++;
else
@@ -712,9 +780,10 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata,
target_sn = PREP_IE_TARGET_SN(prep_elem);
orig_sn = PREP_IE_ORIG_SN(prep_elem);
- mesh_path_sel_frame_tx(MPATH_PREP, flags, orig_addr, orig_sn, 0,
- target_addr, target_sn, next_hop, hopcount,
- ttl, lifetime, metric, 0, sdata);
+ mesh_path_sel_frame_tx_jittered(MPATH_PREP, flags, orig_addr, orig_sn,
+ 0, target_addr, target_sn, next_hop,
+ hopcount, ttl, lifetime, metric, 0,
+ sdata);
rcu_read_unlock();
sdata->u.mesh.mshstats.fwded_unicast++;
@@ -864,10 +933,11 @@ static void hwmp_rann_frame_process(struct ieee80211_sub_if_data *sdata,
ttl--;
if (ifmsh->mshcfg.dot11MeshForwarding) {
- mesh_path_sel_frame_tx(MPATH_RANN, flags, orig_addr,
- orig_sn, 0, NULL, 0, broadcast_addr,
- hopcount, ttl, interval,
- metric + metric_txsta, 0, sdata);
+ mesh_path_sel_frame_tx_jittered(MPATH_RANN, flags, orig_addr,
+ orig_sn, 0, NULL, 0,
+ broadcast_addr, hopcount, ttl,
+ interval, metric + metric_txsta,
+ 0, sdata);
}
rcu_read_unlock();
^ permalink raw reply related
* Re: [RFC 2/5] iwlwifi: fix request_module() use
From: Luis R. Rodriguez @ 2017-02-22 0:18 UTC (permalink / raw)
To: Luis R. Rodriguez
Cc: Grumbach, Emmanuel, Berg, Johannes, Coelho, Luciano,
tj@kernel.org, arjan@linux.intel.com, ming.lei@canonical.com,
zajec5@gmail.com, jeyu@redhat.com, rusty@rustcorp.com.au,
pmladek@suse.com, gregkh@linuxfoundation.org, linuxwifi,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20170221201715.GZ31264@wotan.suse.de>
On Tue, Feb 21, 2017 at 09:17:15PM +0100, Luis R. Rodriguez wrote:
> On Tue, Feb 21, 2017 at 07:15:41PM +0100, Luis R. Rodriguez wrote:
> > On Tue, Feb 21, 2017 at 07:16:16AM +0000, Grumbach, Emmanuel wrote:
> > > >
> > > > a) just remove the print and use instead request_module_nowait() (this is
> > > > more in alignment of what your code actually does today; or
> > > >
> > > > b) fix the request_module() use so that the error print matches the
> > > > expected and proper recommended use of request_module() (what this patch
> > > > does)
> > > >
> > > > I prefer a) actually but I had to show what b) looked like first :)
> > >
> > > Me too. Let's do the simple thing. After all, it's been working for 5 years
> > > now (maybe more?) and I don't see a huge need to verify that the opmode
> > > module has been loaded. It is very unlikely to fail anyway, and in the case
> > > it did fail, it's not that we can do much from iwlwifi point of view.
> >
> > I tend to agree with you on this, retries would be the only sensible thing to
> > do, but why do that -- the error should be logged right and addressed by any
> > upper layers. Its one reason to consider in the future adding verifiers
> > as built-in optional part of module loading.
>
> It would seem we still need to offload the opmode start as it is the one that
> really should be issuing the completion, otherwise we would end up sending a
> completion while the opmode module is being loaded asynchronously. The changes
> are for that are still very likely desirable as it should help with speeding
> boot up.
>
> So the sharing of the opcode start will go first.
>
> Will send v2.
Actually the completion was always being sent prior to request_module(), so this
would not change anything really. The sharing of the opcode then is optional,
and I can send separately in another series.
Luis
^ permalink raw reply
* [PATCH v2 0/2] iwlwifi: corner case fix and request module changes
From: Luis R. Rodriguez @ 2017-02-22 2:09 UTC (permalink / raw)
To: johannes.berg, luciano.coelho, emmanuel.grumbach
Cc: ming.lei, zajec5, linuxwifi, linux-wireless, linux-kernel,
Luis R. Rodriguez
In-Reply-To: <20170222001822.GE31264@wotan.suse.de>
This v2 addresses the preference to keep things simple on iwlwifi when
requesting modules and not implementing a verifier for loaing the opmode
module. We now know what a verifier looks like for both sync and async
approaches. The already established long standing practice of just doing
best effort to load suffices and keeps the driver cleaner.
There no change to the first patch. The second patch just embraces
request_module_nowait() instead of implementing a verifier for a sync
call. The remaining patches from the last series will be sent separately.
Luis R. Rodriguez (2):
iwlwifi: fix drv cleanup on opmode registration failure
iwlwifi: simplify requesting ops module
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
--
2.11.0
^ permalink raw reply
* [PATCH v2 1/2] iwlwifi: fix drv cleanup on opmode registration failure
From: Luis R. Rodriguez @ 2017-02-22 2:09 UTC (permalink / raw)
To: johannes.berg, luciano.coelho, emmanuel.grumbach
Cc: ming.lei, zajec5, linuxwifi, linux-wireless, linux-kernel,
Luis R. Rodriguez
In-Reply-To: <20170222020939.28140-1-mcgrof@kernel.org>
The firmware async callback handles the device's opmode start
call, but optionally also allows opmode registration to take
care of its opmode start. If the firmware callback handles it
its error path in case of opmode start failure has a few pieces
of code missing from the opmode registration. The opmode
registration hanlder has no cleanup at all. Sync both error
paths.
This should in theory fix a detangled drv from the drv list should
either of the opmode modules loaded and handled registration for the
drv.
The path of having the opmode registration deal with the drv
opmode start is actually the more common path. The other path,
from the async callback is rathe rare (1/8 or so times for me) --
it happens when the the opmode driver's init routine completed
prior to the driver's async callback opmode start call.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index be466a074c1d..e198d6f5fcea 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -1611,8 +1611,13 @@ int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops)
continue;
op->ops = ops;
/* TODO: need to handle exceptional case */
- list_for_each_entry(drv, &op->drv, list)
+ list_for_each_entry(drv, &op->drv, list) {
drv->op_mode = _iwl_op_mode_start(drv, op);
+ if (!drv->op_mode) {
+ complete(&drv->request_firmware_complete);
+ device_release_driver(drv->trans->dev);
+ }
+ }
mutex_unlock(&iwlwifi_opmode_table_mtx);
return 0;
--
2.11.0
^ permalink raw reply related
* [PATCH v2 2/2] iwlwifi: simplify requesting ops module
From: Luis R. Rodriguez @ 2017-02-22 2:09 UTC (permalink / raw)
To: johannes.berg, luciano.coelho, emmanuel.grumbach
Cc: ming.lei, zajec5, linuxwifi, linux-wireless, linux-kernel,
Luis R. Rodriguez
In-Reply-To: <20170222020939.28140-1-mcgrof@kernel.org>
The return value of request_module() being 0 does not mean that the
driver which was requested has loaded. To properly check that the driver
was loaded each driver can use internal mechanisms to vet the driver is
now present. The helper try_then_request_module() was added to help with
this, allowing drivers to specify their own validation as the first
argument for synchronous requests.
On iwlwifi the use case is a bit more complicated given that the value
we need to check for is protected with a mutex later used on the
module_init() of the module we are asking for. If we were to lock and
request_module() we'd deadlock. iwlwifi could use its own wrapper for
requesting its ops module synchronously so it can handle its special
locking requirements on its own but the given code has been in the
kernel for a long time and the preference is to keep its simplicity.
We can do two more things to simplify this even further:
a) just use the async request, request_module_nowait(), to acknowledge
we are using best effort -- we are not verifying the module is loaded
b) we can unconditionally call request_module_nowait() whether or not
we were built-in or not, if built-in this will return immediately
without failure.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index e198d6f5fcea..e96095c1824a 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -1250,7 +1250,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
size_t trigger_tlv_sz[FW_DBG_TRIGGER_MAX];
u32 api_ver;
int i;
- bool load_module = false;
bool usniffer_images = false;
fw->ucode_capa.max_probe_length = IWL_DEFAULT_MAX_PROBE_LENGTH;
@@ -1454,8 +1453,6 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
mutex_unlock(&iwlwifi_opmode_table_mtx);
goto out_unbind;
}
- } else {
- load_module = true;
}
mutex_unlock(&iwlwifi_opmode_table_mtx);
@@ -1466,20 +1463,10 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
*/
complete(&drv->request_firmware_complete);
- /*
- * Load the module last so we don't block anything
- * else from proceeding if the module fails to load
- * or hangs loading.
- */
- if (load_module) {
- err = request_module("%s", op->name);
-#ifdef CONFIG_IWLWIFI_OPMODE_MODULAR
- if (err)
- IWL_ERR(drv,
- "failed to load module %s (error %d), is dynamic loading enabled?\n",
- op->name, err);
-#endif
- }
+ err = request_module_nowait("%s", op->name);
+ if (err)
+ goto out_unbind;
+
goto free;
try_again:
--
2.11.0
^ permalink raw reply related
* [PATCH v2 0/2] iwlwifi: share opmode start code
From: Luis R. Rodriguez @ 2017-02-22 2:10 UTC (permalink / raw)
To: johannes.berg, luciano.coelho, emmanuel.grumbach
Cc: ming.lei, zajec5, linuxwifi, linux-wireless, linux-kernel,
Luis R. Rodriguez
In-Reply-To: <20170222001822.GE31264@wotan.suse.de>
This v2 split off the opmode handling sharing code into its
own series, it however depends on the request_module_nowait()
change.
The sharing of the opmode handling makes it easier to share fixes
when dealing with opmode handling on devices. It should also hopefully
make the code easier to grok. Lastly, since we are moving things to
a workqueue naturally the module_init() for iwlmvm is not offloaded,
and so this should reduce the boot time by a bit.
As per the average of systemd-analyze on 5 boots using next-20170221
as base:
next-20170221:
Startup finished in 2.6142s (kernel) + 5.1916s (initrd) + 10.8968s (userspace) = 18.7036s
After these patches:
Startup finished in 2.5468s (kernel) + 4.9536s (initrd) + 10.798s (userspace) = 18.2994s
Luis R. Rodriguez (2):
iwlwifi: share opmode start work code
iwlwifi: convert final opmode work into a workqueue
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 93 +++++++++++++++++++---------
1 file changed, 64 insertions(+), 29 deletions(-)
--
2.11.0
^ permalink raw reply
* [PATCH v2 2/2] iwlwifi: convert final opmode work into a workqueue
From: Luis R. Rodriguez @ 2017-02-22 2:10 UTC (permalink / raw)
To: johannes.berg, luciano.coelho, emmanuel.grumbach
Cc: ming.lei, zajec5, linuxwifi, linux-wireless, linux-kernel,
Luis R. Rodriguez
In-Reply-To: <20170222021039.28193-1-mcgrof@kernel.org>
This lets us offload and share all the final opmode related work
necessary for either an opmode driver or new device. This has the most
impact for opmode drivers as this now offloads opmode start for each
device onto the workqueue.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index ea88b5cec869..1db372e9c039 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -143,6 +143,8 @@ static struct iwlwifi_opmode_table {
[DVM_OP_MODE] = { .name = "iwldvm", .ops = NULL },
[MVM_OP_MODE] = { .name = "iwlmvm", .ops = NULL },
};
+static void iwlwifi_opmode_dowork(struct work_struct *work);
+static DECLARE_WORK(iwlwifi_opmode_work, iwlwifi_opmode_dowork);
#define IWL_DEFAULT_SCAN_CHANNELS 40
@@ -1261,7 +1263,7 @@ static void iwlwifi_opmode_start(struct iwlwifi_opmode_table *op)
iwlwifi_opmode_start_drv(op, drv);
}
-static void iwlwifi_opmode_dowork(void)
+static void iwlwifi_opmode_dowork(struct work_struct *unused_work)
{
unsigned int i;
struct iwlwifi_opmode_table *op;
@@ -1497,7 +1499,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
if (err)
goto out_unbind;
- iwlwifi_opmode_dowork();
+ schedule_work(&iwlwifi_opmode_work);
goto free;
try_again:
@@ -1581,6 +1583,7 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans)
void iwl_drv_stop(struct iwl_drv *drv)
{
wait_for_completion(&drv->request_firmware_complete);
+ cancel_work_sync(&iwlwifi_opmode_work);
_iwl_op_mode_stop(drv);
@@ -1634,7 +1637,7 @@ int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops)
mutex_unlock(&iwlwifi_opmode_table_mtx);
if (!ret)
- iwlwifi_opmode_dowork();
+ schedule_work(&iwlwifi_opmode_work);
return ret;
}
--
2.11.0
^ permalink raw reply related
* [PATCH v2 1/2] iwlwifi: share opmode start work code
From: Luis R. Rodriguez @ 2017-02-22 2:10 UTC (permalink / raw)
To: johannes.berg, luciano.coelho, emmanuel.grumbach
Cc: ming.lei, zajec5, linuxwifi, linux-wireless, linux-kernel,
Luis R. Rodriguez
In-Reply-To: <20170222021039.28193-1-mcgrof@kernel.org>
The firmware async callback and the opmode registration share
some functionality -- to start the drv's opmode. Move this work
into a helper which is shared. This should help us share fixes
should these diverging code paths change.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 90 +++++++++++++++++++---------
1 file changed, 61 insertions(+), 29 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index e96095c1824a..ea88b5cec869 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -102,6 +102,7 @@ static struct dentry *iwl_dbgfs_root;
* @op_mode: the running op_mode
* @trans: transport layer
* @dev: for debug prints only
+ * @start_requested: start op has been requested and is pending on this device
* @fw_index: firmware revision to try loading
* @firmware_name: composite filename of ucode file to load
* @request_firmware_complete: the firmware has been obtained from user space
@@ -113,6 +114,7 @@ struct iwl_drv {
struct iwl_op_mode *op_mode;
struct iwl_trans *trans;
struct device *dev;
+ bool start_requested;
int fw_index; /* firmware we're trying to load */
char firmware_name[64]; /* name of firmware file to load */
@@ -1231,6 +1233,48 @@ static void _iwl_op_mode_stop(struct iwl_drv *drv)
}
}
+static void iwlwifi_opmode_start_drv(struct iwlwifi_opmode_table *op,
+ struct iwl_drv *drv)
+{
+ if (!drv->start_requested)
+ return;
+
+ drv->op_mode = _iwl_op_mode_start(drv, op);
+ drv->start_requested = false;
+
+ /*
+ * Complete the firmware request last so that
+ * a driver unbind (stop) doesn't run while we
+ * are doing the start() above.
+ */
+ complete(&drv->request_firmware_complete);
+
+ if (!drv->op_mode)
+ device_release_driver(drv->trans->dev);
+}
+
+static void iwlwifi_opmode_start(struct iwlwifi_opmode_table *op)
+{
+ struct iwl_drv *drv;
+
+ list_for_each_entry(drv, &op->drv, list)
+ iwlwifi_opmode_start_drv(op, drv);
+}
+
+static void iwlwifi_opmode_dowork(void)
+{
+ unsigned int i;
+ struct iwlwifi_opmode_table *op;
+
+ mutex_lock(&iwlwifi_opmode_table_mtx);
+ for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++) {
+ op = &iwlwifi_opmode_table[i];
+ if (op->ops)
+ iwlwifi_opmode_start(op);
+ }
+ mutex_unlock(&iwlwifi_opmode_table_mtx);
+}
+
/**
* iwl_req_fw_callback - callback when firmware was loaded
*
@@ -1443,30 +1487,17 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
IWL_INFO(drv, "loaded firmware version %s op_mode %s\n",
drv->fw.fw_version, op->name);
+ drv->start_requested = true;
/* add this device to the list of devices using this op_mode */
list_add_tail(&drv->list, &op->drv);
- if (op->ops) {
- drv->op_mode = _iwl_op_mode_start(drv, op);
-
- if (!drv->op_mode) {
- mutex_unlock(&iwlwifi_opmode_table_mtx);
- goto out_unbind;
- }
- }
mutex_unlock(&iwlwifi_opmode_table_mtx);
- /*
- * Complete the firmware request last so that
- * a driver unbind (stop) doesn't run while we
- * are doing the start() above.
- */
- complete(&drv->request_firmware_complete);
-
err = request_module_nowait("%s", op->name);
if (err)
goto out_unbind;
+ iwlwifi_opmode_dowork();
goto free;
try_again:
@@ -1588,8 +1619,8 @@ IWL_EXPORT_SYMBOL(iwlwifi_mod_params);
int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops)
{
int i;
- struct iwl_drv *drv;
struct iwlwifi_opmode_table *op;
+ int ret = -EIO;
mutex_lock(&iwlwifi_opmode_table_mtx);
for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++) {
@@ -1597,20 +1628,15 @@ int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops)
if (strcmp(op->name, name))
continue;
op->ops = ops;
- /* TODO: need to handle exceptional case */
- list_for_each_entry(drv, &op->drv, list) {
- drv->op_mode = _iwl_op_mode_start(drv, op);
- if (!drv->op_mode) {
- complete(&drv->request_firmware_complete);
- device_release_driver(drv->trans->dev);
- }
- }
-
- mutex_unlock(&iwlwifi_opmode_table_mtx);
- return 0;
+ ret = 0;
+ break;
}
mutex_unlock(&iwlwifi_opmode_table_mtx);
- return -EIO;
+
+ if (!ret)
+ iwlwifi_opmode_dowork();
+
+ return ret;
}
IWL_EXPORT_SYMBOL(iwl_opmode_register);
@@ -1626,8 +1652,14 @@ void iwl_opmode_deregister(const char *name)
iwlwifi_opmode_table[i].ops = NULL;
/* call the stop routine for all devices */
- list_for_each_entry(drv, &iwlwifi_opmode_table[i].drv, list)
+ list_for_each_entry(drv, &iwlwifi_opmode_table[i].drv, list) {
_iwl_op_mode_stop(drv);
+ /*
+ * So that if iwlmvm gets unloaded alone, but then
+ * loaded again we can kick the old registered devices
+ */
+ drv->start_requested = true;
+ }
mutex_unlock(&iwlwifi_opmode_table_mtx);
return;
--
2.11.0
^ permalink raw reply related
* [PATCH] staging: wilc1000: renames struct tstrRSSI and its members u8Index, u8Full
From: Tahia Khan @ 2017-02-22 4:55 UTC (permalink / raw)
To: outreachy-kernel, aditya.shankar, ganesh.krishna, gregkh,
linux-wireless, devel, linux-kernel
Fixes multiple camel case checks on struct tstrRSSI from checkpatch.pl:
Avoid CamelCase: <tstrRSSI>
Avoid CamelCase: <u8Full>
Avoid CamelCase: <u8Index>
Signed-off-by: Tahia Khan <tahia.khan@gmail.com>
---
drivers/staging/wilc1000/coreconfigurator.h | 8 ++++----
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index cff1698..c9cf23b 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -70,9 +70,9 @@ enum connect_status {
CONNECT_STS_FORCE_16_BIT = 0xFFFF
};
-struct tstrRSSI {
- u8 u8Full;
- u8 u8Index;
+struct tstr_RSSI {
+ u8 u8_full;
+ u8 u8_index;
s8 as8RSSI[NUM_RSSI];
};
@@ -93,7 +93,7 @@ struct network_info {
u8 *ies;
u16 ies_len;
void *join_params;
- struct tstrRSSI str_rssi;
+ struct tstr_RSSI str_rssi;
u64 tsf_hi;
};
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index f7ce47c..30285b9 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -205,8 +205,8 @@ static u32 get_rssi_avg(struct network_info *network_info)
{
u8 i;
int rssi_v = 0;
- u8 num_rssi = (network_info->str_rssi.u8Full) ?
- NUM_RSSI : (network_info->str_rssi.u8Index);
+ u8 num_rssi = (network_info->str_rssi.u8_full) ?
+ NUM_RSSI : (network_info->str_rssi.u8_index);
for (i = 0; i < num_rssi; i++)
rssi_v += network_info->str_rssi.as8RSSI[i];
@@ -346,13 +346,13 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
} else {
ap_index = ap_found;
}
- rssi_index = last_scanned_shadow[ap_index].str_rssi.u8Index;
+ rssi_index = last_scanned_shadow[ap_index].str_rssi.u8_index;
last_scanned_shadow[ap_index].str_rssi.as8RSSI[rssi_index++] = pstrNetworkInfo->rssi;
if (rssi_index == NUM_RSSI) {
rssi_index = 0;
- last_scanned_shadow[ap_index].str_rssi.u8Full = 1;
+ last_scanned_shadow[ap_index].str_rssi.u8_full = 1;
}
- last_scanned_shadow[ap_index].str_rssi.u8Index = rssi_index;
+ last_scanned_shadow[ap_index].str_rssi.u8_index = rssi_index;
last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi;
last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info;
last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len;
--
2.7.4
^ permalink raw reply related
* Re: [Outreachy kernel] [PATCH] staging: wilc1000: renames struct tstrRSSI and its members u8Index, u8Full
From: Julia Lawall @ 2017-02-22 7:19 UTC (permalink / raw)
To: Tahia Khan
Cc: outreachy-kernel, aditya.shankar, ganesh.krishna, gregkh,
linux-wireless, devel, linux-kernel
In-Reply-To: <20170222045543.GA27847@coolbox>
On Tue, 21 Feb 2017, Tahia Khan wrote:
> Fixes multiple camel case checks on struct tstrRSSI from checkpatch.pl:
>
> Avoid CamelCase: <tstrRSSI>
> Avoid CamelCase: <u8Full>
> Avoid CamelCase: <u8Index>
>
> Signed-off-by: Tahia Khan <tahia.khan@gmail.com>
> ---
> drivers/staging/wilc1000/coreconfigurator.h | 8 ++++----
> drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 10 +++++-----
> 2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
> index cff1698..c9cf23b 100644
> --- a/drivers/staging/wilc1000/coreconfigurator.h
> +++ b/drivers/staging/wilc1000/coreconfigurator.h
> @@ -70,9 +70,9 @@ enum connect_status {
> CONNECT_STS_FORCE_16_BIT = 0xFFFF
> };
>
> -struct tstrRSSI {
> - u8 u8Full;
> - u8 u8Index;
> +struct tstr_RSSI {
> + u8 u8_full;
> + u8 u8_index;
The kernel doesn't use variable names that incorporate types. These could
just be full and index.
julia
> s8 as8RSSI[NUM_RSSI];
> };
>
> @@ -93,7 +93,7 @@ struct network_info {
> u8 *ies;
> u16 ies_len;
> void *join_params;
> - struct tstrRSSI str_rssi;
> + struct tstr_RSSI str_rssi;
> u64 tsf_hi;
> };
>
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> index f7ce47c..30285b9 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> @@ -205,8 +205,8 @@ static u32 get_rssi_avg(struct network_info *network_info)
> {
> u8 i;
> int rssi_v = 0;
> - u8 num_rssi = (network_info->str_rssi.u8Full) ?
> - NUM_RSSI : (network_info->str_rssi.u8Index);
> + u8 num_rssi = (network_info->str_rssi.u8_full) ?
> + NUM_RSSI : (network_info->str_rssi.u8_index);
>
> for (i = 0; i < num_rssi; i++)
> rssi_v += network_info->str_rssi.as8RSSI[i];
> @@ -346,13 +346,13 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
> } else {
> ap_index = ap_found;
> }
> - rssi_index = last_scanned_shadow[ap_index].str_rssi.u8Index;
> + rssi_index = last_scanned_shadow[ap_index].str_rssi.u8_index;
> last_scanned_shadow[ap_index].str_rssi.as8RSSI[rssi_index++] = pstrNetworkInfo->rssi;
> if (rssi_index == NUM_RSSI) {
> rssi_index = 0;
> - last_scanned_shadow[ap_index].str_rssi.u8Full = 1;
> + last_scanned_shadow[ap_index].str_rssi.u8_full = 1;
> }
> - last_scanned_shadow[ap_index].str_rssi.u8Index = rssi_index;
> + last_scanned_shadow[ap_index].str_rssi.u8_index = rssi_index;
> last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi;
> last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info;
> last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len;
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170222045543.GA27847%40coolbox.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply
* [PATCH] ath10k: Modify macros to fix style issues
From: Marcin Rokicki @ 2017-02-22 8:15 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
Both macros are used internally to convert incomming parameters
to strings in a switch case statement.
Current implementation gives following output from checkpatch.pl:
- ERROR: Macros with complex values should be enclosed in parentheses
- WARNING: Macros with flow control statements should be avoided
Fix them by modify local variable in the middle and just return at the end.
Btw add const to function that return string literals
Signed-off-by: Marcin Rokicki <marcin.rokicki@tieto.com>
---
drivers/net/wireless/ath/ath10k/wmi.h | 36 +++++++++++++++++++++++++----------
1 file changed, 26 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 427220c..0bf578f 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -312,9 +312,16 @@ enum wmi_10_4_service {
WMI_10_4_SERVICE_TX_MODE_DYNAMIC,
};
-static inline char *wmi_service_name(int service_id)
+#define SVCSTR(x) \
+{ \
+ case x: \
+ str = #x; \
+ break; \
+}
+
+static inline const char *wmi_service_name(int service_id)
{
-#define SVCSTR(x) case x: return #x
+ const char *str = NULL;
switch (service_id) {
SVCSTR(WMI_SERVICE_BEACON_OFFLOAD);
@@ -408,13 +415,13 @@ static inline char *wmi_service_name(int service_id)
SVCSTR(WMI_SERVICE_TX_MODE_PUSH_ONLY);
SVCSTR(WMI_SERVICE_TX_MODE_PUSH_PULL);
SVCSTR(WMI_SERVICE_TX_MODE_DYNAMIC);
- default:
- return NULL;
}
-#undef SVCSTR
+ return str;
}
+#undef SVCSTR
+
#define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
((svc_id) < (len) && \
__le32_to_cpu((wmi_svc_bmap)[(svc_id) / (sizeof(u32))]) & \
@@ -6412,10 +6419,17 @@ enum wmi_wow_wakeup_event {
WOW_EVENT_MAX,
};
-#define C2S(x) case x: return #x
+#define C2S(x) \
+{ \
+ case x: \
+ str = #x; \
+ break; \
+}
static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
{
+ const char *str = NULL;
+
switch (ev) {
C2S(WOW_BMISS_EVENT);
C2S(WOW_BETTER_AP_EVENT);
@@ -6442,9 +6456,9 @@ static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
C2S(WOW_BEACON_EVENT);
C2S(WOW_CLIENT_KICKOUT_EVENT);
C2S(WOW_EVENT_MAX);
- default:
- return NULL;
}
+
+ return str;
}
enum wmi_wow_wake_reason {
@@ -6482,6 +6496,8 @@ enum wmi_wow_wake_reason {
static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
{
+ const char *str = NULL;
+
switch (reason) {
C2S(WOW_REASON_UNSPECIFIED);
C2S(WOW_REASON_NLOD);
@@ -6513,9 +6529,9 @@ static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
C2S(WOW_REASON_BEACON_RECV);
C2S(WOW_REASON_CLIENT_KICKOUT_EVENT);
C2S(WOW_REASON_DEBUG_TEST);
- default:
- return NULL;
}
+
+ return str;
}
#undef C2S
--
2.7.4
^ permalink raw reply related
* Re: [rtl8xxxu] rtl8192cu (0bda:8176) on linux-4.9.11 (arm) high sirq rate
From: Christian Hilberg @ 2017-02-22 9:54 UTC (permalink / raw)
To: linux-wireless
In-Reply-To: <1581189.s4o7FEpKoz@vbox>
[-- Attachment #1: Type: text/plain, Size: 2134 bytes --]
Hi again,
Am Montag, 20. Februar 2017, 14:51:54 CET schrieb Christian Hilberg:
> Hi all,
>
> currently I'm testing rtl8xxxu on an ARM device (i.mx28, armv5te) under
> linux-4.9.11 with a RealTek 8192cu (0bda:8176) wifi dongle. Since
> I had to set CONFIG_RTL8XXXU_UNTESTED, I'm prepared to see some
> rough edges here and there. :-)
The rtl8xxxu driver identifies the device as "8188CU", and so does lsusb.
> The driver actually works and I'm getting a stable connection on
> a WPA2 secured wifi network. As a firmware blob, the driver loads
> the "rtl8192cufw_TMSC.bin", which I extracted from [0].
>
> However, the sirg rate is rather high (between 20% to 50% in top),
> as soon as the device is getting upped, that is, as soon as IFF_UP
> gets written to the device via ioctl().
I've dug further into this.
It shows that if in the driver's rtl8xxxu_identify_chip() routine for the
RTL8188C variant I set priv->usb_interrupts = 0, then the sirq load vanishes
and the driver apparently still works:
---8<---
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/
net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
index 82d949ede294..2daacfd059b8 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
@@ -1687,7 +1687,7 @@ static int rtl8xxxu_identify_chip(struct rtl8xxxu_priv
*priv)
priv->rx_paths = 1;
priv->tx_paths = 1;
priv->rtl_chip = RTL8188C;
- priv->usb_interrupts = 1;
+ priv->usb_interrupts = 0;
priv->has_wifi = 1;
}
---8<---
Seems to me that rtl8xxxu_int_complete() does nothing with the URB data but to
re-submit it (just to satisfy hardware which wants its interrupts to be
handled maybe?).
I'm not at all clear whether the above change would be the Right Thing to do.
Jes, do you have any thoughts on this? Are there 8188CU variants which need
interrupts to be handled?
Regards,
Christian
> [0]
> http://ftp.de.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-r
> ealtek_20161130-2_all.deb
--
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply related
* Re: [PATCH] ath10k: Modify macros to fix style issues
From: Joe Perches @ 2017-02-22 11:34 UTC (permalink / raw)
To: Marcin Rokicki, ath10k; +Cc: linux-wireless
In-Reply-To: <1487751327-2917-1-git-send-email-marcin.rokicki@tieto.com>
On Wed, 2017-02-22 at 09:15 +0100, Marcin Rokicki wrote:
> Both macros are used internally to convert incomming parameters
> to strings in a switch case statement.
>
> Current implementation gives following output from checkpatch.pl:
> - ERROR: Macros with complex values should be enclosed in parentheses
> - WARNING: Macros with flow control statements should be avoided
>
> Fix them by modify local variable in the middle and just return at the end.
>
> Btw add const to function that return string literals
[]
> diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
[]
> @@ -312,9 +312,16 @@ enum wmi_10_4_service {
> WMI_10_4_SERVICE_TX_MODE_DYNAMIC,
> };
>
> -static inline char *wmi_service_name(int service_id)
> +#define SVCSTR(x) \
> +{ \
> + case x: \
> + str = #x; \
> + break; \
> +}
> +
> +static inline const char *wmi_service_name(int service_id)
> {
> -#define SVCSTR(x) case x: return #x
> + const char *str = NULL;
>
> switch (service_id) {
> SVCSTR(WMI_SERVICE_BEACON_OFFLOAD);
> @@ -408,13 +415,13 @@ static inline char *wmi_service_name(int service_id)
> SVCSTR(WMI_SERVICE_TX_MODE_PUSH_ONLY);
> SVCSTR(WMI_SERVICE_TX_MODE_PUSH_PULL);
> SVCSTR(WMI_SERVICE_TX_MODE_DYNAMIC);
> - default:
> - return NULL;
> }
>
> -#undef SVCSTR
> + return str;
> }
>
> +#undef SVCSTR
> +
> #define WMI_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
> ((svc_id) < (len) && \
> __le32_to_cpu((wmi_svc_bmap)[(svc_id) / (sizeof(u32))]) & \
> @@ -6412,10 +6419,17 @@ enum wmi_wow_wakeup_event {
> WOW_EVENT_MAX,
> };
>
> -#define C2S(x) case x: return #x
> +#define C2S(x) \
> +{ \
> + case x: \
> + str = #x; \
> + break; \
> +}
>
> static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
> {
> + const char *str = NULL;
> +
> switch (ev) {
> C2S(WOW_BMISS_EVENT);
> C2S(WOW_BETTER_AP_EVENT);
> @@ -6442,9 +6456,9 @@ static inline const char *wow_wakeup_event(enum wmi_wow_wakeup_event ev)
> C2S(WOW_BEACON_EVENT);
> C2S(WOW_CLIENT_KICKOUT_EVENT);
> C2S(WOW_EVENT_MAX);
> - default:
> - return NULL;
> }
> +
> + return str;
> }
>
> enum wmi_wow_wake_reason {
> @@ -6482,6 +6496,8 @@ enum wmi_wow_wake_reason {
>
> static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
> {
> + const char *str = NULL;
> +
> switch (reason) {
> C2S(WOW_REASON_UNSPECIFIED);
> C2S(WOW_REASON_NLOD);
> @@ -6513,9 +6529,9 @@ static inline const char *wow_reason(enum wmi_wow_wake_reason reason)
> C2S(WOW_REASON_BEACON_RECV);
> C2S(WOW_REASON_CLIENT_KICKOUT_EVENT);
> C2S(WOW_REASON_DEBUG_TEST);
> - default:
> - return NULL;
> }
> +
> + return str;
> }
>
> #undef C2S
Here is an alternate style used a few times in the kernel
Maybe it'd be nicer to change the macros to something like
#define CASE_STR(x) case x: return #x
and just return NULL after the switch/case block
Maybe make that a global macro and consolidate the various
uses to a single style
drivers/net/wireless/ath/ath9k/ath9k.h:#define case_rtn_string(val) case val: return #val
drivers/net/wireless/ath/ath10k/wmi.h:#define SVCSTR(x) case x: return #x
drivers/net/wireless/ath/ath10k/wmi.h:#define C2S(x) case x: return #x
drivers/net/wireless/intel/iwlegacy/common.h:#define IL_CMD(x) case x: return #x
drivers/net/wireless/intel/iwlwifi/iwl-io.c:#define IWL_CMD(x) case x: return #x
drivers/net/wireless/intel/iwlwifi/pcie/trans.c:#define IWL_CMD(x) case x: return #x
drivers/net/wireless/atmel/at76c50x-usb.c:#define MAKE_CMD_CASE(c) case (c): return #c
drivers/net/wireless/atmel/at76c50x-usb.c:#define MAKE_CMD_STATUS_CASE(c) case (c): return #c
drivers/net/ethernet/intel/fm10k/fm10k_pci.c:#define FM10K_ERR_MSG(type) case (type): error = #type; break
drivers/staging/lustre/lnet/selftest/selftest.h:#define STATE2STR(x) case x: return #x
include/linux/genl_magic_func.h: case op_num: return #op_name;
t_case_default.c:#define FOO(BAR) { case BAR: return #BAR; }
^ permalink raw reply
* Re: [PATCH] cfg80211: support 4-way handshake offloading for WPA/WPA2-PSK
From: Jithu Jance @ 2017-02-22 12:24 UTC (permalink / raw)
To: Arend Van Spriel
Cc: Johannes Berg, linux-wireless, Eliad Peller, Jouni Malinen
In-Reply-To: <3fa1e3ac-5722-c46d-acc1-62407f4eef07@broadcom.com>
Hi Jouni, Johannes et al.,
On Wed, Feb 22, 2017 at 1:27 AM, Arend Van Spriel
<arend.vanspriel@broadcom.com> wrote:
> On 21-2-2017 13:37, Johannes Berg wrote:
>>
>>> What I am also missing is how to deal with NL80211_CMD_CONNECTED
>>> event signalling. Should that be given after (un)successful
>>> completion of the 4-way handshake or should we have a separate event
>>> for that?
>>
>> That's a good point. I don't think a new event really works well, but
>> perhaps we should extend the NL80211_TIMEOUT_* values with this? It's
>> not strictly a timeout, I guess, but it's not a direct rejection of the
>> association either.
>>
>> Any thoughts?
>
> I discussed about the event mechanism with Jithu which is who asked me
> to look at their patches for this feature. His suggestion was to have a
> "port authorized" event after successful handshake as it will help in
> key mgmt offload cases. He gave the following example: Suppose you are
> doing a fresh 8021x followed by 4way handshake offload. Right now there
> is no event to indicate to the upper layer that the 4way handshake have
> been completed successfully. So the only thing to do in wpa_supplicant
> is to consider it completed and if not be hit with deauth.
In wpa_supplicant terms, I was looking for an event notification to move the
wpa_state from WPA_ASSOCIATED to WPA_COMPLETED. :)
Thanks,
--
Jithu Jance
^ permalink raw reply
* RE: [OpenWrt-Devel] ATH10K VLAN firmware issue
From: voncken @ 2017-02-22 13:55 UTC (permalink / raw)
To: 'Valo, Kalle'
Cc: 'OpenWrt Development List', 'linux-wireless',
ath10k
In-Reply-To: <87efyrd6lv.fsf@kamboji.qca.qualcomm.com>
Thanks for your answer,
How I can know when this issue will be fixed in ath10k firmware
mainline?
Do you know if Qualcomm publish a release note for this firmware?
> -----Message d'origine-----
> De : linux-wireless-owner@vger.kernel.org [mailto:linux-wireless-
> owner@vger.kernel.org] De la part de Valo, Kalle
> Envoyé : mardi 21 février 2017 14:19
> À : voncken
> Cc : 'OpenWrt Development List'; 'linux-wireless';
> ath10k@lists.infradead.org
> Objet : Re: [OpenWrt-Devel] ATH10K VLAN firmware issue
>
> voncken <cedric.voncken@acksys.fr> writes:
>
> > Do you know if the firmware team planned to fix the VLAN issue on
> > ath10k firmware?
>
> I reported it forward only this week.
>
> --
> Kalle Valo
^ permalink raw reply
* [PATCH] mac80211: don't handle filtered frames within a BA session
From: Felix Fietkau @ 2017-02-22 15:16 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes
When running a BA session, the driver (or the hardware) already takes
care of retransmitting failed frames, since it has to keep the receiver
reorder window in sync.
Adding another layer of retransmit around that does not improve
anything. In fact, it can only lead to some strong reordering with huge
latency.
Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
net/mac80211/status.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index b6a5394fa4c4..9d19d8698ac0 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -51,7 +51,8 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local,
struct ieee80211_hdr *hdr = (void *)skb->data;
int ac;
- if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER) {
+ if (info->flags & (IEEE80211_TX_CTL_NO_PS_BUFFER |
+ IEEE80211_TX_CTL_AMPDU)) {
ieee80211_free_txskb(&local->hw, skb);
return;
}
--
2.11.0
^ permalink raw reply related
* [PATCH] ath10k: Disallow DFS simulation if DFS channel is not enabled
From: Mohammed Shafi Shajakhan @ 2017-02-22 15:33 UTC (permalink / raw)
To: ath10k; +Cc: mohammed, linux-wireless, Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
If DFS is not enabled in hostapd (ieee80211h=0) DFS channels shall
not be available for use even though the hardware may have the capability
to support DFS. With this configuration (DFS disabled in hostapd) trying to
bring up ath10k device in DFS channel for AP mode fails and trying to
simulate DFS in ath10k debugfs results in a warning in cfg80211 complaining
invalid channel and this should be avoided in the driver itself rather than
false propogating RADAR detection to mac80211/cfg80211. Fix this by
checking for the first vif 'is_started' state(should work for client mode
as well) as all the vifs shall be configured for the same channel
sys/kernel/debug/ieee80211/phy1/ath10k# echo 1 > dfs_simulate_radar
WARNING: at net/wireless/chan.c:265 cfg80211_radar_event+0x24/0x60
Workqueue: phy0 ieee80211_dfs_radar_detected_work [mac80211]
[<c022f2d4>] (warn_slowpath_null) from
[<bf72dab8>] (cfg80211_radar_event+0x24/0x60 [cfg80211])
[<bf72dab8>] (cfg80211_radar_event [cfg80211]) from
[<bf7813e0>] (ieee80211_dfs_radar_detected_work+0x94/0xa0 [mac80211])
[<bf7813e0>] (ieee80211_dfs_radar_detected_work [mac80211]) from
[<c0242320>] (process_one_work+0x20c/0x32c)
WARNING: at net/wireless/nl80211.c:2488 nl80211_get_mpath+0x13c/0x4cc
Workqueue: phy0 ieee80211_dfs_radar_detected_work [mac80211]
[<c022f2d4>] (warn_slowpath_null) from
[<bf72dab8>] (cfg80211_radar_event+0x24/0x60 [cfg80211])
[<bf72dab8>] (cfg80211_radar_event [cfg80211]) from
[<bf7813e0>] (ieee80211_dfs_radar_detected_work+0x94/0xa0 [mac80211])
[<bf7813e0>] (ieee80211_dfs_radar_detected_work [mac80211]) from
[<c0242320>] (process_one_work+0x20c/0x32c)
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
---
[thanks Kalle, Jouni and Tamizh for the first level review]
drivers/net/wireless/ath/ath10k/debug.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index fb0ade3..ac9090b 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -1997,6 +1997,15 @@ static ssize_t ath10k_write_simulate_radar(struct file *file,
size_t count, loff_t *ppos)
{
struct ath10k *ar = file->private_data;
+ struct ath10k_vif *arvif;
+
+ /* Just check for for the first vif alone, as all the vifs will be
+ * sharing the same channel and if the channel is disabled, all the
+ * vifs will share the same 'is_started' state.
+ */
+ arvif = list_first_entry(&ar->arvifs, typeof(*arvif), list);
+ if (!arvif->is_started)
+ return -EINVAL;
ieee80211_radar_detected(ar->hw);
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] ath10k: Modify macros to fix style issues
From: Joe Perches @ 2017-02-22 16:19 UTC (permalink / raw)
To: Marcin Rokicki, ath10k; +Cc: linux-wireless
In-Reply-To: <CAN6SofZJjMmdkwqtD-amUTHzFJyQAYEKJUgOeHPKJEX7w0fD=g@mail.gmail.com>
(fyi Marcin, the reason this isn't getting on the list
is because your 3 tries have all included text and html)
On Wed, 2017-02-22 at 14:31 +0100, Marcin Rokicki wrote:
> >
> > Here is an alternate style used a few times in the kernel
> >
> > Maybe it'd be nicer to change the macros to something like
> >
> > #define CASE_STR(x) case x: return #x
> >
> > and just return NULL after the switch/case block
> >
> > Maybe make that a global macro and consolidate the various
> > uses to a single style
[]
> This alternate style used few times in the kernel cause that
> checkpatch.pl prints
> such messages:
> - ERROR: Macros with complex values should be enclosed in parentheses
> - WARNING: Macros with flow control statements should be avoided
>
> for "all" of your examples - except fm10k which is implemented (almost) in
> the same way like above patch
> but still prints:
> - ERROR: Macros with multiple statements should be enclosed in a do -
> while loop
Yes, checkpatch is and will always be imperfect.
It's just a bunch of regex tests.
Anyway, the point of my email was to highlight a
possible line count reduction and an opportunity
to standardize a style.
cheers, Joe
^ permalink raw reply
* [PATCH v2] staging: wilc1000: renames struct tstrRSSI and its members u8Index, u8Full
From: Tahia Khan @ 2017-02-22 17:14 UTC (permalink / raw)
To: outreachy-kernel, aditya.shankar, ganesh.krishna, gregkh,
linux-wireless, devel, linux-kernel
Fixes multiple camel case checks on struct tstrRSSI from checkpatch.pl:
Avoid CamelCase: <tstrRSSI>
Avoid CamelCase: <u8Full>
Avoid CamelCase: <u8Index>
Signed-off-by: Tahia Khan <tahia.khan@gmail.com>
---
drivers/staging/wilc1000/coreconfigurator.h | 8 ++++----
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 10 +++++-----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/wilc1000/coreconfigurator.h b/drivers/staging/wilc1000/coreconfigurator.h
index cff1698..5b65c4f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -70,9 +70,9 @@ enum connect_status {
CONNECT_STS_FORCE_16_BIT = 0xFFFF
};
-struct tstrRSSI {
- u8 u8Full;
- u8 u8Index;
+struct tstr_RSSI {
+ u8 full;
+ u8 index;
s8 as8RSSI[NUM_RSSI];
};
@@ -93,7 +93,7 @@ struct network_info {
u8 *ies;
u16 ies_len;
void *join_params;
- struct tstrRSSI str_rssi;
+ struct tstr_RSSI str_rssi;
u64 tsf_hi;
};
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index f7ce47c..56f133e 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -205,8 +205,8 @@ static u32 get_rssi_avg(struct network_info *network_info)
{
u8 i;
int rssi_v = 0;
- u8 num_rssi = (network_info->str_rssi.u8Full) ?
- NUM_RSSI : (network_info->str_rssi.u8Index);
+ u8 num_rssi = (network_info->str_rssi.full) ?
+ NUM_RSSI : (network_info->str_rssi.index);
for (i = 0; i < num_rssi; i++)
rssi_v += network_info->str_rssi.as8RSSI[i];
@@ -346,13 +346,13 @@ static void add_network_to_shadow(struct network_info *pstrNetworkInfo,
} else {
ap_index = ap_found;
}
- rssi_index = last_scanned_shadow[ap_index].str_rssi.u8Index;
+ rssi_index = last_scanned_shadow[ap_index].str_rssi.index;
last_scanned_shadow[ap_index].str_rssi.as8RSSI[rssi_index++] = pstrNetworkInfo->rssi;
if (rssi_index == NUM_RSSI) {
rssi_index = 0;
- last_scanned_shadow[ap_index].str_rssi.u8Full = 1;
+ last_scanned_shadow[ap_index].str_rssi.full = 1;
}
- last_scanned_shadow[ap_index].str_rssi.u8Index = rssi_index;
+ last_scanned_shadow[ap_index].str_rssi.index = rssi_index;
last_scanned_shadow[ap_index].rssi = pstrNetworkInfo->rssi;
last_scanned_shadow[ap_index].cap_info = pstrNetworkInfo->cap_info;
last_scanned_shadow[ap_index].ssid_len = pstrNetworkInfo->ssid_len;
--
2.7.4
^ 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