* Re: [PATCH v3] rfkill: Add rfkill-any LED trigger
From: Johannes Berg @ 2017-01-02 11:12 UTC (permalink / raw)
To: Michał Kępień, David S . Miller
Cc: Михаил Кринкин,
linux-wireless, netdev, linux-kernel
In-Reply-To: <20161221084533.27006-1-kernel@kempniu.pl>
> - Handle the global mutex properly when rfkill_set_{hw,sw}_state()
> or
> rfkill_set_states() is called from within an rfkill callback. v2
> always tried to lock the global mutex in such a case, which led
> to a
> deadlock when an rfkill driver called one of the above functions
> from its query or set_block callback. This is solved by defining
> a
> new bitfield, RFKILL_BLOCK_SW_HASLOCK, which is set before the
> above
> callbacks are invoked and cleared afterwards; the functions
> listed
> above use this bitfield to tell rfkill_any_led_trigger_event()
> whether the global mutex is currently held or not.
> RFKILL_BLOCK_SW_SETCALL cannot be reused for this purpose as
> setting
> it before invoking the query callback would cause any calls to
> rfkill_set_sw_state() made from within that callback to work on
> RFKILL_BLOCK_SW_PREV instead of RFKILL_BLOCK_SW and thus change
> the
> way rfkill_set_block() behaves.
I'm not super happy with this conditional locking - can't we instead
defer the necessary work to a workqueue, or so, for purposes of the
LED?
johannes
^ permalink raw reply
* Re: [PATCH 1/2] cfg80211: update wireless-regdb repo url in Documentation
From: Johannes Berg @ 2017-01-02 11:01 UTC (permalink / raw)
To: Rafał Miłecki, linux-wireless
Cc: linux-doc, Rafał Miłecki, Seth Forshee
In-Reply-To: <20170102072829.9766-1-zajec5@gmail.com>
On Mon, 2017-01-02 at 08:28 +0100, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> It's maintained by Seth Forshe for a long time now.
>
Both applied, thanks.
johannes
^ permalink raw reply
* Re: [PATCH] mac80211: Fix addition of mesh configuration element
From: Johannes Berg @ 2017-01-02 10:59 UTC (permalink / raw)
To: Ilan Peer; +Cc: linux-wireless, masashi.honma
In-Reply-To: <1482769056-28577-1-git-send-email-ilan.peer@intel.com>
On Mon, 2016-12-26 at 18:17 +0200, Ilan Peer wrote:
> The code was setting the capabilities byte to zero,
> after it was already properly set previously. Fix it.
>
> The bug was found while debugging hwsim mesh tests failures
> that happened in commit 76f43b4 (mac80211: Remove invalid flag
> operations in mesh TSF synchronization).
>
Applied, thanks.
When you have the commit already, please add a Fixes tag, and also use
12 hex digits to abbreviate SHA1s please. (I've done that now)
johannes
^ permalink raw reply
* Re: [PATCH 2/4] cfg80211: Add new NL80211_CMD_SET_BTCOEX_PRIORITY to support BTCOEX
From: Johannes Berg @ 2017-01-02 10:48 UTC (permalink / raw)
To: Tamizh chelvam; +Cc: c_traja, linux-wireless, ath10k
In-Reply-To: <ae82112880d55451342e7a6e5a47c33f@codeaurora.org>
> > 1) does it even make sense to split it out per AC? wouldn't it be
> > weird
> > if you supported this only for VO and BK, and not the others, or
> > something like that?
> >
>
> It has support for BE, VI, management and beacon frames also.
> Or do you meant to say like support only for VO and BK?
I mean - does it make sense for a piece of hardware to support only
VO/BK, without the others? I don't really see how that would make
sense, but maybe I'm missing something?
IOW - why have all these bits rather than just one?
> > 2) Wouldn't it make more sense to define this in nl80211 and just
> > pass the bitmap through to userspace? That would save quite a bit
> > of netlink mangling complexity.
> >
>
> Please let me know if the below design/thought is fine to you.
>
> iw phyX set btcoex_priority <[vi, vo, be, bk, mgmt, beacon]>
That seems fine, but I don't see how the iw command line is relevant to
the question of whether we pass flag attributes or a bitmap??
> By this command user should give one or more than one frame types
> for
> this btcoex priority,
> we will parse that in "iw" and send as a single bitmap(less than
> 0x64) to the driver?
Right, and also to nl80211. Why not?
johannes
^ permalink raw reply
* Re: cfg80211: add set/get link loss profile
From: Johannes Berg @ 2017-01-02 10:45 UTC (permalink / raw)
To: Lazar, Alexei Avshalom; +Cc: linux-wireless, wil6210
In-Reply-To: <58a1b983-6688-8b3e-81cb-83c62b46abbf@codeaurora.org>
On Mon, 2016-12-19 at 12:58 +0200, Lazar, Alexei Avshalom wrote:
> > What you're doing here is *extremely* vague. No definitions of what
> > this means, no description of how it's intended to be implemented,
> > no note even on whether or not this is for full-MAC chips or not,
> > etc.
> >
>
> The patch is intended for full-MAC chips and I will update the commit
> message to include more details.
>
> > At least for mac80211, we can define signals to userspace regarding
> > "link quality" and make decisions in wpa_s then?
> >
>
> The policy is offloaded today to the FW and the decision being made
> by the FW.
> We are only modifying the behavior and not making the decision.
Fair enough, but I stand by saying that it's extremely vague - how
could userspace possibly know what "level" to pick, if you don't give
it any information about what the levels really mean?
johannes
^ permalink raw reply
* Re: [RFC] nl80211: allow multiple active scheduled scan requests
From: Johannes Berg @ 2017-01-02 10:44 UTC (permalink / raw)
To: Arend van Spriel; +Cc: linux-wireless, Dmitry Shmidt
In-Reply-To: <1482315616-4721-1-git-send-email-arend.vanspriel@broadcom.com>
> + /*
> + * allow only one legacy scheduled scan if user-space
> + * does not indicate multiple scheduled scan support.
> + */
> + if (!info->attrs[NL80211_ATTR_SCHED_SCAN_MULTI] &&
> + cfg80211_legacy_sched_scan_active(rdev))
> return -EINPROGRESS;
That probably doesn't go far enough - if legacy one is active then we
probably shouldn't allow a new MULTI one either (or abandon the legacy
one) so that older userspace doesn't get confused with multiple
notifications from sched scans it didn't start.
> + if (rdev->sched_scan_req_count == rdev->wiphy.max_sched_scan_reqs)
> + return -ENOSPC;
Do we really want to do the double-accounting, just to avoid counting
the list length here?
> + /* leave request id zero for legacy request */
why? The ID would be ignored, so why special-case it?
> +static void cfg80211_del_sched_scan_req(struct
> cfg80211_registered_device *rdev,
> + struct
> cfg80211_sched_scan_request *req)
> +{
> + list_del_rcu(&req->list);
> + kfree_rcu(req, rcu_head);
> + synchronize_rcu();
> + rdev->sched_scan_req_count--;
> +}
That's bogus - either you use kfree_rcu() or synchronize_rcu() (the
former is much better); combining both makes no sense.
> +bool cfg80211_legacy_sched_scan_active(struct
> cfg80211_registered_device *rdev)
> +{
> + struct cfg80211_sched_scan_request *req;
> +
> + req = list_first_or_null_rcu(&rdev->sched_scan_req_list,
> + struct
> cfg80211_sched_scan_request, list);
> + /* request id 0 indicates legacy request in progress */
> + return req && !req->reqid;
> +}
Ok, fair enough.
johannes
^ permalink raw reply
* [PATCH] mac80211: initialize fast-xmit 'info' later
From: Johannes Berg @ 2017-01-02 10:24 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear, Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
In ieee80211_xmit_fast(), 'info' is initialized to point to the skb
that's passed in, but that skb may later be replaced by a clone (if
it was shared), leading to an invalid pointer.
This can lead to use-after-free and also later crashes since the
real SKB's info->hw_queue doesn't get initialized properly.
Fix this by assigning info only later, when it's needed, after the
skb replacement (may have) happened.
Cc: stable@vger.kernel.org
Reported-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/tx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 4dea18be385c..3182e0c4e157 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3288,7 +3288,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2);
int hw_headroom = sdata->local->hw.extra_tx_headroom;
struct ethhdr eth;
- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ struct ieee80211_tx_info *info;
struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
struct ieee80211_tx_data tx;
ieee80211_tx_result r;
@@ -3352,6 +3352,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
memcpy(skb->data + fast_tx->da_offs, eth.h_dest, ETH_ALEN);
memcpy(skb->data + fast_tx->sa_offs, eth.h_source, ETH_ALEN);
+ info = IEEE80211_SKB_CB(skb);
memset(info, 0, sizeof(*info));
info->band = fast_tx->band;
info->control.vif = &sdata->vif;
--
2.9.3
^ permalink raw reply related
* Re: [PATCH] mac80211: Fix invalid 'info' access in xmit-fast.
From: Johannes Berg @ 2017-01-02 10:24 UTC (permalink / raw)
To: greearb, linux-wireless
In-Reply-To: <1483123790-14412-1-git-send-email-greearb@candelatech.com>
On Fri, 2016-12-30 at 10:49 -0800, greearb@candelatech.com wrote:
> From: Ben Greear <greearb@candelatech.com>
>
> ieee80211_xmit_fast assigns info from the passed-in
> skb, but then later it also checks for skb_shared(skb),
> and may create a new skb based on that check.
>
> But, the code did not re-assign 'info', so it pointed into
> the old shared skb. This leads to all sorts of problems,
> most obviously crashes since the new skb's info->hw_queue is not
> properly initialized.
>
> Bug was seen by sending pktgen packets on a bridge that
> had an AP network interface in it. hw-queue was out of
> range, which made it crash like this:
>
> BUG: unable to handle kernel NULL pointer dereference
> at (null)
> IP: [<ffffffffa0ad4672>] ieee80211_tx_frags+0x232/0x4c0 [mac80211]
> PGD 0
> Oops: 0002 [#1] PREEMPT SMP
> CPU: 0 PID: 1512 Comm: kpktgend_0 Tainted: G O 4.7.10+
> #24
> Hardware name: To be filled by O.E.M. To be filled by
> O.E.M./ChiefRiver, BIOS 4.6.5 06/07/2013
> task: ffff8802132f3a00 ti: ffff8800362ac000 task.ti: ffff8800362ac000
> RIP: 0010:[<ffffffffa0ad4672>] [<ffffffffa0ad4672>]
> ieee80211_tx_frags+0x232/0x4c0 [mac80211]
> RSP: 0018:ffff8800362afa28 EFLAGS: 00010086
> RAX: ffff8802130a22c0 RBX: ffff8802130a13a0 RCX: ffff880035ef2200
> RDX: ffff880035ef2200 RSI: 0000000000000292 RDI: 0000000000000000
> RBP: ffff8800362afa90 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000088 R11: 0000000000000001 R12: ffff880035ef2200
> R13: ffff880035dabb90 R14: ffff8800362afb18 R15: 0000000000000cc0
> FS: 0000000000000000(0000) GS:ffff88021e200000(0000)
> knlGS:0000000000000000
> CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 0000000000000000 CR3: 0000000001e06000 CR4: 00000000001406f0
> Stack:
> 0000000000000292 ffff880035daa880 ffff8802130a0b20 ffff8800d4f01808
> 00ff8800362afaa0 ffff8800362afb18 ffff8802130a13c0 ffff88021e20db68
> ffff880035daa880 ffff8800362afb18 ffff880035ef2200 ffff88020f6ca300
> Call Trace:
> [<ffffffffa0ad9f63>] __ieee80211_subif_start_xmit+0xc13/0xc30
> [mac80211]
> [<ffffffff8113d2c5>] ? find_busiest_group+0x35/0x4a0
> [<ffffffffa0ad9f8b>] ieee80211_subif_start_xmit+0xb/0x10 [mac80211]
> [<ffffffff8177d40b>] dev_hard_start_xmit+0x9b/0x220
> [<ffffffff817a3716>] sch_direct_xmit+0xd6/0x1a0
> [<ffffffff8177da8e>] __dev_queue_xmit+0x3be/0x6c0
> [<ffffffff81127f43>] ? finish_task_switch+0x73/0x1f0
> [<ffffffff8177dd9d>] dev_queue_xmit+0xd/0x10
> [<ffffffffa0b5fe85>] br_dev_queue_push_xmit+0x75/0x140 [bridge]
> [<ffffffffa0b5ffc9>] br_forward_finish+0x29/0xa0 [bridge]
> [<ffffffff8116db83>] ? del_timer_sync+0x43/0x50
> [<ffffffffa0b600a2>] __br_deliver+0x62/0x130 [bridge]
> [<ffffffff81175937>] ? __getnstimeofday64+0x37/0xd0
> [<ffffffff811759d9>] ? getnstimeofday64+0x9/0x30
> [<ffffffffa0b605b6>] br_deliver+0x56/0x60 [bridge]
> [<ffffffffa0b5d472>] br_dev_xmit+0x1c2/0x250 [bridge]
> [<ffffffffa137aa1c>] pktgen_thread_worker+0x174c/0x2471 [pktgen]
> [<ffffffff8185087a>] ? __schedule+0x30a/0x7c0
> [<ffffffff811446e0>] ? wake_atomic_t_function+0x60/0x60
> [<ffffffffa13792d0>] ? pktgen_rem_all_ifs+0x80/0x80 [pktgen]
> [<ffffffff81121c14>] kthread+0xc4/0xe0
> [<ffffffff818551df>] ret_from_fork+0x1f/0x40
> [<ffffffff81121b50>] ? kthread_worker_fn+0x180/0x180
>
> Fix this by re-assigning info after creating new one.
>
> Signed-off-by: Ben Greear <greearb@candelatech.com>
> ---
>
> This patch is against 4.7.10+
And thus didn't apply - I've replaced it with my own patch which I'll
send out in a moment
johannes
^ permalink raw reply
* kernel 4.9 iwlwifi startup error
From: Fabio Coatti @ 2017-01-02 10:12 UTC (permalink / raw)
To: LKML, linux-wireless@vger.kernel.org
Hi all,
I'm using kernel 4.9 and maybe half of the times I boot my laptop I get the
error reported below, and the wifi does not work. I have to remove iwlwifi (like
modprobe -r iwldvm iwlwifi) and insert it again to get things workig again.
This seems a bit random, it does not happens all the times so it could be a
timing issue or even a flaky hardware (unlikely, as I see only this issue with
wifi, once it starts it works just fine)
I'm pretty sure to have seen the same behaviour at some point in 4.8.X
release, but right now I lost the related notes.
Environment:
Distro: gentoo
gcc 5.4.0
HW: Hewlett-Packard HP EliteBook Folio 9470m/18DF, BIOS 68IBD Ver. F.63
04/26/2016
Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz
Network controller: Intel Corporation Centrino Advanced-N 6235 (rev 24)
Of course if more info is needed, just drop me a note.
I'm not subscribed to mailing lists, so please keep me in CC: for any
information request.
Many thanks.
Dmesg relevant output:
[lun gen 2 10:41:48 2017] IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
[lun gen 2 10:41:48 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:48 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:48 2017] iwlwifi 0000:03:00.0: Radio type=0x2-0x1-0x0
[lun gen 2 10:41:49 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:49 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:49 2017] iwlwifi 0000:03:00.0: Radio type=0x2-0x1-0x0
[lun gen 2 10:41:49 2017] IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
[lun gen 2 10:41:49 2017] IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Error sending
REPLY_SCAN_ABORT_CMD: time out after 2000ms.
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Current CMD queue read_ptr 34
write_ptr 35
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Loaded firmware version:
18.168.6.1
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Start IWL Error Log Dump:
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Status: 0x000003CC, count: 6
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000084 |
NMI_INTERRUPT_UNKNOWN
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00010564 | uPc
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x0001054E | branchlink1
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00010580 | branchlink2
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x0000DBEA | interruptlink1
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Microcode SW error detected.
Restarting 0x2000000.
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR values:
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x000005A0 | interruptlink2
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000081 | data1
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x07030000 | data2
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x000260A4 | line
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: (2nd byte of
CSR_INT_COALESCING is CSR_INT_PERIODIC_REG)
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x0D000A41 | beacon time
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x0052C5BF | tsf low
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000000 | tsf hi
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000000 | time gp1
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x005B69CC | time gp2
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000000 | time gp3
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x754312A8 | uCode version
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x000000B0 | hw version
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00484B00 | board version
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x0000001C | hcmd
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x27863040 | isr0
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x0181E000 | isr1
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000E02 | isr2
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x0147FC43 | isr3
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000000 | isr4
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000000 | isr_pref
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x000260A4 | wait_event
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000050 | l2p_control
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000032 | l2p_duration
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x0000003F | l2p_mhvalid
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_HW_IF_CONFIG_REG:
0X00484b00
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00101040 | l2p_addr_match
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000005 | lmpm_pmg_sel
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x13011136 | timestamp
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: 0x00000818 | flow_handler
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_INT_COALESCING:
0X00000040
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_INT:
0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_INT_MASK:
0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_FH_INT_STATUS:
0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_GPIO_IN:
0X00000030
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_RESET:
0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_GP_CNTRL:
0X080403cd
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_HW_REV:
0X000000b0
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_EEPROM_REG:
0X60f10ffd
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_EEPROM_GP:
0X90000801
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_OTP_GP_REG:
0X00030001
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_GIO_REG:
0X00080042
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_GP_UCODE_REG:
0X000004bf
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_GP_DRIVER_REG:
0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_UCODE_DRV_GP1:
0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_UCODE_DRV_GP2:
0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Start IWL Event Log Dump:
display last 1 entries
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_LED_REG:
0X00000040
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_DRAM_INT_TBL_REG:
0X880fffff
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_GIO_CHICKEN_BITS:
0X27800200
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_ANA_PLL_CFG:
0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_MONITOR_STATUS_REG:
0X43f7f757
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: EVT_LOGT:
0005990856:0x0000010c:0123
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_HW_REV_WA_REG:
0X0001001a
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Command REPLY_RXON failed: FW
Error
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Error clearing ASSOC_MSK on
BSS (-5)
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: CSR_DBG_HPET_MEM_REG:
0Xffff0000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: FH register values:
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0:
FH_RSCSR_CHNL0_STTS_WPTR_REG: 0X0ffffd00
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0:
FH_RSCSR_CHNL0_RBDCB_BASE_REG: 0X00ffffe0
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0:
FH_RSCSR_CHNL0_WPTR: 0X00000008
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0:
FH_MEM_RCSR_CHNL0_CONFIG_REG: 0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0:
FH_MEM_RSSR_SHARED_CTRL_REG: 0X000000fc
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0:
FH_MEM_RSSR_RX_STATUS_REG: 0X07030000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0:
FH_MEM_RSSR_RX_ENABLE_ERR_IRQ2DRV: 0X00000000
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0:
FH_TSSR_TX_STATUS_REG: 0X07ff0001
[lun gen 2 10:41:55 2017] ------------[ cut here ]------------
[lun gen 2 10:41:55 2017] WARNING: CPU: 3 PID: 2275 at drivers/net/wireless/
intel/iwlwifi/pcie/trans.c:1864 iwl_trans_pcie_grab_nic_access+0xe6/0xf0
[iwlwifi]
[lun gen 2 10:41:55 2017] Timeout waiting for hardware access (CSR_GP_CNTRL
0x080003d8)
[lun gen 2 10:41:55 2017] Modules linked in: bnep btusb btintel bluetooth
uvcvideo videobuf2_vmalloc videobuf2_memops joydev videobuf2_v4l2 hp_wmi
sparse_keymap videodev cdc_wdm cdc_acm videobuf2_core snd_usb_audio
snd_usbmidi_lib snd_rawmidi snd_seq_device uas intel_rapl x86_pkg_temp_thermal
algif_skcipher intel_powerclamp coretemp kvm_intel kvm irqbypass
crct10dif_pclmul crc32_pclmul snd_hda_codec_hdmi snd_hda_codec_generic
snd_hda_intel snd_hda_codec psmouse snd_hwdep iwldvm snd_hda_core iwlwifi
snd_pcm snd_timer snd soundcore mei_me mei hp_accel wmi hp_wireless lis3lv02d
sch_fq_codel vboxpci(OE) vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) dm_zero
dm_thin_pool dm_persistent_data dm_bio_prison dm_service_time dm_round_robin
dm_queue_length dm_multipath dm_delay virtio_pci virtio_blk virtio_balloon
vxlan ip6_udp_tunnel
[lun gen 2 10:41:55 2017] udp_tunnel macvlan virtio_net virtio_ring virtio
fuse overlay linear raid0 dm_raid dm_snapshot dm_bufio dm_mirror dm_region_hash
dm_log hid_apple ohci_pci ohci_hcd uhci_hcd
[lun gen 2 10:41:55 2017] CPU: 3 PID: 2275 Comm: irq/34-iwlwifi Tainted: G
OE 4.9.0-cova #2
[lun gen 2 10:41:55 2017] Hardware name: Hewlett-Packard HP EliteBook Folio
9470m/18DF, BIOS 68IBD Ver. F.63 04/26/2016
[lun gen 2 10:41:55 2017] 0000000000000000 ffffffffa84cd5fd ffffba42002bfcf8
0000000000000000
[lun gen 2 10:41:55 2017] ffffffffa80d2ee4 ffff9ac674138018 ffffba42002bfd50
ffff9ac67413fe80
[lun gen 2 10:41:55 2017] ffffba42002bfd88 0000000002000000 ffff9ac66fd26600
ffffffffa80d2f5a
[lun gen 2 10:41:55 2017] Call Trace:
[lun gen 2 10:41:55 2017] [<ffffffffa84cd5fd>] ? dump_stack+0x46/0x59
[lun gen 2 10:41:55 2017] [<ffffffffa80d2ee4>] ? __warn+0xb4/0xd0
[lun gen 2 10:41:55 2017] [<ffffffffa80d2f5a>] ? warn_slowpath_fmt+0x5a/0x80
[lun gen 2 10:41:55 2017] [<ffffffffc045f0fa>] ? iwl_poll_bit+0x2a/0x70
[iwlwifi]
[lun gen 2 10:41:55 2017] [<ffffffffc046d4a6>] ?
iwl_trans_pcie_grab_nic_access+0xe6/0xf0 [iwlwifi]
[lun gen 2 10:41:55 2017] [<ffffffffc045f167>] ? iwl_read_direct32+0x27/0x70
[iwlwifi]
[lun gen 2 10:41:55 2017] [<ffffffffc045f7a7>] ? iwl_dump_fh+0xa7/0x220
[iwlwifi]
[lun gen 2 10:41:55 2017] [<ffffffffc0464cdf>] ? iwl_pcie_irq_handle_error
+0x2f/0x130 [iwlwifi]
[lun gen 2 10:41:55 2017] [<ffffffffc0466fa9>] ? iwl_pcie_irq_handler
+0x539/0x730 [iwlwifi]
[lun gen 2 10:41:55 2017] [<ffffffffa8117af0>] ? irq_forced_thread_fn
+0x60/0x60
[lun gen 2 10:41:55 2017] [<ffffffffa8117b06>] ? irq_thread_fn+0x16/0x40
[lun gen 2 10:41:55 2017] [<ffffffffa8117db9>] ? irq_thread+0x139/0x1c0
[lun gen 2 10:41:55 2017] [<ffffffffa8117be0>] ? wake_threads_waitq
+0x30/0x30
[lun gen 2 10:41:55 2017] [<ffffffffa8117c80>] ? irq_thread_dtor+0xa0/0xa0
[lun gen 2 10:41:55 2017] [<ffffffffa80ee2f9>] ? kthread+0xc9/0xe0
[lun gen 2 10:41:55 2017] [<ffffffffa80ee230>] ? kthread_park+0x50/0x50
[lun gen 2 10:41:55 2017] [<ffffffffa8a20ac2>] ? ret_from_fork+0x22/0x30
[lun gen 2 10:41:55 2017] ---[ end trace f47879f89784c9ca ]---
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0:
FH_TSSR_TX_ERROR_REG: 0X5a5a5a5a
[lun gen 2 10:41:55 2017] ieee80211 phy0: Hardware restart was requested
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Radio type=0x2-0x1-0x0
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Radio type=0x2-0x1-0x0
[lun gen 2 10:41:55 2017] IPv6: ADDRCONF(NETDEV_UP): wlo1: link is not ready
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: L1 Enabled - LTR Disabled
[lun gen 2 10:41:55 2017] iwlwifi 0000:03:00.0: Radio type=0x2-0x1-0x0
[lun gen 2 10:42:00 2017] iwlwifi 0000:03:00.0: Failed to load firmware chunk!
[lun gen 2 10:42:00 2017] iwlwifi 0000:03:00.0: Could not load the [0] uCode
section
[lun gen 2 10:42:00 2017] iwlwifi 0000:03:00.0: Failed to run INIT ucode: -110
[lun gen 2 10:42:00 2017] iwlwifi 0000:03:00.0: Unable to initialize device.
[lun gen 2 10:42:00 2017] ------------[ cut here ]------------
[lun gen 2 10:42:00 2017] WARNING: CPU: 2 PID: 307 at net/mac80211/util.c:
1863 ieee80211_reconfig+0x231/0xc30
[lun gen 2 10:42:00 2017] Hardware became unavailable during restart.
[lun gen 2 10:42:00 2017] Modules linked in: bnep btusb btintel bluetooth
uvcvideo videobuf2_vmalloc videobuf2_memops joydev videobuf2_v4l2 hp_wmi
sparse_keymap videodev cdc_wdm cdc_acm videobuf2_core snd_usb_audio
snd_usbmidi_lib snd_rawmidi snd_seq_device uas intel_rapl x86_pkg_temp_thermal
algif_skcipher intel_powerclamp coretemp kvm_intel kvm irqbypass
crct10dif_pclmul crc32_pclmul snd_hda_codec_hdmi snd_hda_codec_generic
snd_hda_intel snd_hda_codec psmouse snd_hwdep iwldvm snd_hda_core iwlwifi
snd_pcm snd_timer snd soundcore mei_me mei hp_accel wmi hp_wireless lis3lv02d
sch_fq_codel vboxpci(OE) vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) dm_zero
dm_thin_pool dm_persistent_data dm_bio_prison dm_service_time dm_round_robin
dm_queue_length dm_multipath dm_delay virtio_pci virtio_blk virtio_balloon
vxlan ip6_udp_tunnel
[lun gen 2 10:42:00 2017] udp_tunnel macvlan virtio_net virtio_ring virtio
fuse overlay linear raid0 dm_raid dm_snapshot dm_bufio dm_mirror dm_region_hash
dm_log hid_apple ohci_pci ohci_hcd uhci_hcd
[lun gen 2 10:42:00 2017] CPU: 2 PID: 307 Comm: kworker/2:3 Tainted: G
W OE 4.9.0-cova #2
[lun gen 2 10:42:00 2017] Hardware name: Hewlett-Packard HP EliteBook Folio
9470m/18DF, BIOS 68IBD Ver. F.63 04/26/2016
[lun gen 2 10:42:00 2017] Workqueue: events_freezable ieee80211_restart_work
[lun gen 2 10:42:00 2017] 0000000000000000 ffffffffa84cd5fd ffffba4200f0fd38
0000000000000000
[lun gen 2 10:42:00 2017] ffffffffa80d2ee4 ffff9ac674198700 ffffba4200f0fd90
ffff9ac6741993f0
[lun gen 2 10:42:00 2017] ffff9ac674198700 0000000000000000 0000000000000000
ffffffffa80d2f5a
[lun gen 2 10:42:00 2017] Call Trace:
[lun gen 2 10:42:00 2017] [<ffffffffa84cd5fd>] ? dump_stack+0x46/0x59
[lun gen 2 10:42:00 2017] [<ffffffffa80d2ee4>] ? __warn+0xb4/0xd0
[lun gen 2 10:42:00 2017] [<ffffffffa80d2f5a>] ? warn_slowpath_fmt+0x5a/0x80
[lun gen 2 10:42:00 2017] [<ffffffffa8a02ee1>] ? ieee80211_reconfig
+0x231/0xc30
[lun gen 2 10:42:00 2017] [<ffffffffa8124fbf>] ? try_to_del_timer_sync+0x4f/
0x80
[lun gen 2 10:42:00 2017] [<ffffffffa89d3638>] ? ieee80211_restart_work
+0x88/0xc0
[lun gen 2 10:42:00 2017] [<ffffffffa80e8d4f>] ? process_one_work+0x11f/
0x3a0
[lun gen 2 10:42:00 2017] [<ffffffffa80e9012>] ? worker_thread+0x42/0x4c0
[lun gen 2 10:42:00 2017] [<ffffffffa80e8fd0>] ? process_one_work
+0x3a0/0x3a0
[lun gen 2 10:42:00 2017] [<ffffffffa80ee2f9>] ? kthread+0xc9/0xe0
[lun gen 2 10:42:00 2017] [<ffffffffa80ee230>] ? kthread_park+0x50/0x50
[lun gen 2 10:42:00 2017] [<ffffffffa8a20ac2>] ? ret_from_fork+0x22/0x30
[lun gen 2 10:42:00 2017] ---[ end trace f47879f89784c9cb ]---
[lun gen 2 10:42:00 2017] ------------[ cut here ]------------
[lun gen 2 10:42:00 2017] WARNING: CPU: 2 PID: 307 at net/mac80211/driver-
ops.h:17 ieee80211_do_stop+0x577/0x880
[lun gen 2 10:42:00 2017] wlo1: Failed check-sdata-in-driver check, flags:
0x0
[lun gen 2 10:42:00 2017] Modules linked in: bnep btusb btintel bluetooth
uvcvideo videobuf2_vmalloc videobuf2_memops joydev videobuf2_v4l2 hp_wmi
sparse_keymap videodev cdc_wdm cdc_acm videobuf2_core snd_usb_audio
snd_usbmidi_lib snd_rawmidi snd_seq_device uas intel_rapl x86_pkg_temp_thermal
algif_skcipher intel_powerclamp coretemp kvm_intel kvm irqbypass
crct10dif_pclmul crc32_pclmul snd_hda_codec_hdmi snd_hda_codec_generic
snd_hda_intel snd_hda_codec psmouse snd_hwdep iwldvm snd_hda_core iwlwifi
snd_pcm snd_timer snd soundcore mei_me mei hp_accel wmi hp_wireless lis3lv02d
sch_fq_codel vboxpci(OE) vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) dm_zero
dm_thin_pool dm_persistent_data dm_bio_prison dm_service_time dm_round_robin
dm_queue_length dm_multipath dm_delay virtio_pci virtio_blk virtio_balloon
vxlan ip6_udp_tunnel
[lun gen 2 10:42:00 2017] udp_tunnel macvlan virtio_net virtio_ring virtio
fuse overlay linear raid0 dm_raid dm_snapshot dm_bufio dm_mirror dm_region_hash
dm_log hid_apple ohci_pci ohci_hcd uhci_hcd
[lun gen 2 10:42:00 2017] CPU: 2 PID: 307 Comm: kworker/2:3 Tainted: G
W OE 4.9.0-cova #2
[lun gen 2 10:42:00 2017] Hardware name: Hewlett-Packard HP EliteBook Folio
9470m/18DF, BIOS 68IBD Ver. F.63 04/26/2016
[lun gen 2 10:42:00 2017] Workqueue: events_freezable ieee80211_restart_work
[lun gen 2 10:42:00 2017] 0000000000000000 ffffffffa84cd5fd ffffba4200f0fc00
0000000000000000
[lun gen 2 10:42:00 2017] ffffffffa80d2ee4 ffff9ac6742128c0 ffffba4200f0fc58
0000000000000000
[lun gen 2 10:42:00 2017] ffff9ac674198700 ffff9ac674198ee8 ffff9ac674213218
ffffffffa80d2f5a
[lun gen 2 10:42:00 2017] Call Trace:
[lun gen 2 10:42:00 2017] [<ffffffffa84cd5fd>] ? dump_stack+0x46/0x59
[lun gen 2 10:42:00 2017] [<ffffffffa80d2ee4>] ? __warn+0xb4/0xd0
[lun gen 2 10:42:00 2017] [<ffffffffa80d2f5a>] ? warn_slowpath_fmt+0x5a/0x80
[lun gen 2 10:42:00 2017] [<ffffffffa89e8177>] ? ieee80211_do_stop
+0x577/0x880
[lun gen 2 10:42:00 2017] [<ffffffffa88b00c5>] ? dev_deactivate_many
+0x1f5/0x230
[lun gen 2 10:42:00 2017] [<ffffffffa89e8491>] ? ieee80211_stop+0x11/0x20
[lun gen 2 10:42:00 2017] [<ffffffffa8886502>] ? __dev_close_many+0x82/0xe0
[lun gen 2 10:42:00 2017] [<ffffffffa88865e8>] ? dev_close_many+0x88/0x130
[lun gen 2 10:42:00 2017] [<ffffffffa888b29f>] ? dev_close.part.17+0x3f/0x70
[lun gen 2 10:42:00 2017] [<ffffffffa888b2de>] ? dev_close+0xe/0x20
[lun gen 2 10:42:00 2017] [<ffffffffa89acbae>] ?
cfg80211_shutdown_all_interfaces+0x3e/0xb0
[lun gen 2 10:42:00 2017] [<ffffffffa8a02d54>] ? ieee80211_reconfig
+0xa4/0xc30
[lun gen 2 10:42:00 2017] [<ffffffffa8124fbf>] ? try_to_del_timer_sync+0x4f/
0x80
[lun gen 2 10:42:00 2017] [<ffffffffa89d3638>] ? ieee80211_restart_work
+0x88/0xc0
[lun gen 2 10:42:00 2017] [<ffffffffa80e8d4f>] ? process_one_work+0x11f/
0x3a0
[lun gen 2 10:42:00 2017] [<ffffffffa80e9012>] ? worker_thread+0x42/0x4c0
[lun gen 2 10:42:00 2017] [<ffffffffa80e8fd0>] ? process_one_work
+0x3a0/0x3a0
[lun gen 2 10:42:00 2017] [<ffffffffa80ee2f9>] ? kthread+0xc9/0xe0
[lun gen 2 10:42:00 2017] [<ffffffffa80ee230>] ? kthread_park+0x50/0x50
[lun gen 2 10:42:00 2017] [<ffffffffa8a20ac2>] ? ret_from_fork+0x22/0x30
[lun gen 2 10:42:00 2017] ---[ end trace f47879f89784c9cc ]---
[lun gen 2 10:42:00 2017] ------------[ cut here ]------------
[lun gen 2 10:42:00 2017] WARNING: CPU: 2 PID: 307 at net/mac80211/driver-
ops.c:39 ieee80211_do_stop+0x560/0x880
[lun gen 2 10:42:00 2017] Modules linked in: bnep btusb btintel bluetooth
uvcvideo videobuf2_vmalloc videobuf2_memops joydev videobuf2_v4l2 hp_wmi
sparse_keymap videodev cdc_wdm cdc_acm videobuf2_core snd_usb_audio
snd_usbmidi_lib snd_rawmidi snd_seq_device uas intel_rapl x86_pkg_temp_thermal
algif_skcipher intel_powerclamp coretemp kvm_intel kvm irqbypass
crct10dif_pclmul crc32_pclmul snd_hda_codec_hdmi snd_hda_codec_generic
snd_hda_intel snd_hda_codec psmouse snd_hwdep iwldvm snd_hda_core iwlwifi
snd_pcm snd_timer snd soundcore mei_me mei hp_accel wmi hp_wireless lis3lv02d
sch_fq_codel vboxpci(OE) vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) dm_zero
dm_thin_pool dm_persistent_data dm_bio_prison dm_service_time dm_round_robin
dm_queue_length dm_multipath dm_delay virtio_pci virtio_blk virtio_balloon
vxlan ip6_udp_tunnel
[lun gen 2 10:42:00 2017] udp_tunnel macvlan virtio_net virtio_ring virtio
fuse overlay linear raid0 dm_raid dm_snapshot dm_bufio dm_mirror dm_region_hash
dm_log hid_apple ohci_pci ohci_hcd uhci_hcd
[lun gen 2 10:42:00 2017] CPU: 2 PID: 307 Comm: kworker/2:3 Tainted: G
W OE 4.9.0-cova #2
[lun gen 2 10:42:00 2017] Hardware name: Hewlett-Packard HP EliteBook Folio
9470m/18DF, BIOS 68IBD Ver. F.63 04/26/2016
[lun gen 2 10:42:00 2017] Workqueue: events_freezable ieee80211_restart_work
[lun gen 2 10:42:00 2017] 0000000000000000 ffffffffa84cd5fd 0000000000000000
0000000000000000
[lun gen 2 10:42:00 2017] ffffffffa80d2ee4 ffff9ac6742128c0 ffff9ac674198ff0
0000000000000000
[lun gen 2 10:42:00 2017] ffff9ac674198700 ffff9ac674198ee8 ffff9ac674213218
ffffffffa89e8160
[lun gen 2 10:42:00 2017] Call Trace:
[lun gen 2 10:42:00 2017] [<ffffffffa84cd5fd>] ? dump_stack+0x46/0x59
[lun gen 2 10:42:00 2017] [<ffffffffa80d2ee4>] ? __warn+0xb4/0xd0
[lun gen 2 10:42:00 2017] [<ffffffffa89e8160>] ? ieee80211_do_stop
+0x560/0x880
[lun gen 2 10:42:00 2017] [<ffffffffa88b00c5>] ? dev_deactivate_many
+0x1f5/0x230
[lun gen 2 10:42:00 2017] [<ffffffffa89e8491>] ? ieee80211_stop+0x11/0x20
[lun gen 2 10:42:00 2017] [<ffffffffa8886502>] ? __dev_close_many+0x82/0xe0
[lun gen 2 10:42:00 2017] [<ffffffffa88865e8>] ? dev_close_many+0x88/0x130
[lun gen 2 10:42:00 2017] [<ffffffffa888b29f>] ? dev_close.part.17+0x3f/0x70
[lun gen 2 10:42:00 2017] [<ffffffffa888b2de>] ? dev_close+0xe/0x20
[lun gen 2 10:42:00 2017] [<ffffffffa89acbae>] ?
cfg80211_shutdown_all_interfaces+0x3e/0xb0
[lun gen 2 10:42:00 2017] [<ffffffffa8a02d54>] ? ieee80211_reconfig
+0xa4/0xc30
[lun gen 2 10:42:00 2017] [<ffffffffa8124fbf>] ? try_to_del_timer_sync+0x4f/
0x80
[lun gen 2 10:42:00 2017] [<ffffffffa89d3638>] ? ieee80211_restart_work
+0x88/0xc0
[lun gen 2 10:42:00 2017] [<ffffffffa80e8d4f>] ? process_one_work+0x11f/
0x3a0
[lun gen 2 10:42:00 2017] [<ffffffffa80e9012>] ? worker_thread+0x42/0x4c0
[lun gen 2 10:42:00 2017] [<ffffffffa80e8fd0>] ? process_one_work
+0x3a0/0x3a0
[lun gen 2 10:42:00 2017] [<ffffffffa80ee2f9>] ? kthread+0xc9/0xe0
[lun gen 2 10:42:00 2017] [<ffffffffa80ee230>] ? kthread_park+0x50/0x50
[lun gen 2 10:42:00 2017] [<ffffffffa8a20ac2>] ? ret_from_fork+0x22/0x30
[lun gen 2 10:42:00 2017] ---[ end trace f47879f89784c9cd ]---
--
Fabio
^ permalink raw reply
* [PATCH 2/2] cfg80211: fix example REG_RULE usage in Documentation
From: Rafał Miłecki @ 2017-01-02 7:28 UTC (permalink / raw)
To: Johannes Berg, linux-wireless; +Cc: linux-doc, Rafał Miłecki
In-Reply-To: <20170102072829.9766-1-zajec5@gmail.com>
From: Rafał Miłecki <rafal@milecki.pl>
It's just an example, but lets make it look more real to don't confuse
people about possible REG_RULE usage. Channels are 20 MHz wide, so start
and end frequencies are 10 MHz away from the center one.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
Documentation/networking/regulatory.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/networking/regulatory.txt b/Documentation/networking/regulatory.txt
index b4af93f..7818b5f 100644
--- a/Documentation/networking/regulatory.txt
+++ b/Documentation/networking/regulatory.txt
@@ -156,12 +156,12 @@ struct ieee80211_regdomain mydriver_jp_regdom = {
//.alpha2 = "99", /* If I have no alpha2 to map it to */
.reg_rules = {
/* IEEE 802.11b/g, channels 1..14 */
- REG_RULE(2412-20, 2484+20, 40, 6, 20, 0),
+ REG_RULE(2412-10, 2484+10, 40, 6, 20, 0),
/* IEEE 802.11a, channels 34..48 */
- REG_RULE(5170-20, 5240+20, 40, 6, 20,
+ REG_RULE(5170-10, 5240+10, 40, 6, 20,
NL80211_RRF_NO_IR),
/* IEEE 802.11a, channels 52..64 */
- REG_RULE(5260-20, 5320+20, 40, 6, 20,
+ REG_RULE(5260-10, 5320+10, 40, 6, 20,
NL80211_RRF_NO_IR|
NL80211_RRF_DFS),
}
--
2.10.1
^ permalink raw reply related
* [PATCH 1/2] cfg80211: update wireless-regdb repo url in Documentation
From: Rafał Miłecki @ 2017-01-02 7:28 UTC (permalink / raw)
To: Johannes Berg, linux-wireless
Cc: linux-doc, Rafał Miłecki, Seth Forshee
From: Rafał Miłecki <rafal@milecki.pl>
It's maintained by Seth Forshe for a long time now.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Cc: Seth Forshee <seth.forshee@canonical.com>
---
Documentation/networking/regulatory.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/networking/regulatory.txt b/Documentation/networking/regulatory.txt
index 356f791..b4af93f 100644
--- a/Documentation/networking/regulatory.txt
+++ b/Documentation/networking/regulatory.txt
@@ -205,7 +205,7 @@ the data in regdb.c as an alternative to using CRDA.
The file net/wireless/db.txt should be kept up-to-date with the db.txt
file available in the git repository here:
- git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-regdb.git
+ git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git
Again, most users in most situations should be using the CRDA package
provided with their distribution, and in most other situations users
--
2.10.1
^ permalink raw reply related
* cw1200: Looking to add support for a new chip.
From: Daniel Palmer @ 2017-01-02 4:33 UTC (permalink / raw)
To: linux-wireless
Hi all,
While hacking away[1] on the vendor sources for the Allwinner XR819
WiFi chip found on the OrangePi Zero board[2] I've worked out that the
driver is basically the existing cw1200 driver that is in the kernel
with support for the two stage firmware loading (alluded to for the
probably unreleased CW1X60 chips but not implemented in the kernel
driver) and some hacks for WiFi compliance tests and P2P support.
Does anyone use the cw1200 driver that could test that any changes
needed to make the XR819 work don't break it?
Please CC me as I'm not subscribed.
Cheers,
Daniel
[1] https://github.com/fifteenhex/xradio/tree/original
[2] http://linux-sunxi.org/Xunlong_Orange_Pi_Zero
^ permalink raw reply
* Re: [V3] rtlwifi: fix spelling mistake: "encrypiton" -> "encryption"
From: Kalle Valo @ 2017-01-01 18:54 UTC (permalink / raw)
To: Colin Ian King
Cc: Larry Finger, Chaoming Li, linux-wireless, netdev, linux-kernel
In-Reply-To: <20161230145027.14090-1-colin.king@canonical.com>
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> trivial fix to spelling mistake in RT_TRACE message
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Patch applied to wireless-drivers-next.git, thanks.
e16e558e83ed rtlwifi: fix spelling mistake: "encrypiton" -> "encryption"
--
https://patchwork.kernel.org/patch/9492215/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* Re: wlcore: fix spelling mistake in wl1271_warning
From: Kalle Valo @ 2017-01-01 18:54 UTC (permalink / raw)
To: Colin Ian King
Cc: Shahar Patury, Guy Mishol, linux-wireless, netdev, linux-kernel
In-Reply-To: <20161229201400.26830-1-colin.king@canonical.com>
Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> trivial fix to spelling mistake of function name in wl1271_warning,
> should be dynamic_ps_timeout instead of dyanmic_ps_timeout.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Patch applied to wireless-drivers-next.git, thanks.
a60db8e70313 wlcore: fix spelling mistake in wl1271_warning
--
https://patchwork.kernel.org/patch/9491377/
Documentation about submitting wireless patches and checking status
from patchwork:
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply
* [PATCH 3/3] rtlwifi: Enable debug mask to be set from sysfs
From: Larry Finger @ 2017-01-01 1:07 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, Ping-Ke Shih
In-Reply-To: <20170101010706.13234-1-Larry.Finger@lwfinger.net>
The previous commit changes the debug system to use a mask to select
which components are to be debugged. Now, we add the necessary code
to change the mask from sysfs.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtlwifi/base.c | 43 +++++++++++++++++++++++-----
drivers/net/wireless/realtek/rtlwifi/debug.c | 6 ++--
drivers/net/wireless/realtek/rtlwifi/debug.h | 6 ++--
3 files changed, 42 insertions(+), 13 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/base.c b/drivers/net/wireless/realtek/rtlwifi/base.c
index fa27d29..c275166 100644
--- a/drivers/net/wireless/realtek/rtlwifi/base.c
+++ b/drivers/net/wireless/realtek/rtlwifi/base.c
@@ -2107,12 +2107,40 @@ static ssize_t rtl_store_debug_level(struct device *d,
ret = kstrtoul(buf, 0, &val);
if (ret) {
- RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG,
- "%s is not in hex or decimal form.\n", buf);
+ pr_err("%s is not in hex or decimal form.\n", buf);
} else {
rtlpriv->dbg.global_debuglevel = val;
- RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG,
- "debuglevel:%x\n",
+ pr_debug("debuglevel:%x\n",
+ rtlpriv->dbg.global_debuglevel);
+ }
+
+ return strnlen(buf, count);
+}
+
+static ssize_t rtl_show_debug_mask(struct device *d,
+ struct device_attribute *attr, char *buf)
+{
+ struct ieee80211_hw *hw = dev_get_drvdata(d);
+ struct rtl_priv *rtlpriv = rtl_priv(hw);
+
+ return sprintf(buf, "0x%x\n",rtlpriv->dbg.global_debuglevel);
+}
+
+static ssize_t rtl_store_debug_mask(struct device *d,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct ieee80211_hw *hw = dev_get_drvdata(d);
+ struct rtl_priv *rtlpriv = rtl_priv(hw);
+ u64 val;
+ int ret;
+
+ ret = kstrtou64(buf, 0, &val);
+ if (ret) {
+ pr_err("%s is not in hex or decimal form.\n", buf);
+ } else {
+ rtlpriv->dbg.global_debuglevel = val;
+ pr_debug("debuglevel:%x\n",
rtlpriv->dbg.global_debuglevel);
}
@@ -2121,16 +2149,17 @@ static ssize_t rtl_store_debug_level(struct device *d,
static DEVICE_ATTR(debug_level, S_IWUSR | S_IRUGO,
rtl_show_debug_level, rtl_store_debug_level);
+static DEVICE_ATTR(debug_mask, S_IWUSR | S_IRUGO,
+ rtl_show_debug_mask, rtl_store_debug_mask);
static struct attribute *rtl_sysfs_entries[] = {
-
&dev_attr_debug_level.attr,
-
+ &dev_attr_debug_mask.attr,
NULL
};
/*
- * "name" is folder name witch will be
+ * "name" is folder name which will be
* put in device directory like :
* sys/devices/pci0000:00/0000:00:1c.4/
* 0000:06:00.0/rtl_sysfs
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.c b/drivers/net/wireless/realtek/rtlwifi/debug.c
index 23a54be..55c91ee 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.c
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.c
@@ -40,7 +40,7 @@ EXPORT_SYMBOL_GPL(rtl_dbgp_flag_init);
#ifdef CONFIG_RTLWIFI_DEBUG
void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
- const char *fmt, ...)
+ const char *func, const char *fmt, ...)
{
if (unlikely((comp & rtlpriv->dbg.global_debug_mask) &&
(level <= rtlpriv->dbg.global_debuglevel))) {
@@ -52,7 +52,7 @@ void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
vaf.fmt = fmt;
vaf.va = &args;
- pr_debug(":<%lx> %pV", in_interrupt(), &vaf);
+ pr_debug("%s %pV", func, &vaf);
va_end(args);
}
@@ -85,7 +85,7 @@ void _rtl_dbg_print_data(struct rtl_priv *rtlpriv, u64 comp, int level,
{
if (unlikely(((comp) & rtlpriv->dbg.global_debug_mask) &&
((level) <= rtlpriv->dbg.global_debuglevel))) {
- pr_debug("In process \"%s\" (pid %i): %s\n",
+ pr_info("In process \"%s\" (pid %i): %s\n",
current->comm, current->pid, titlestring);
print_hex_dump_bytes("", DUMP_PREFIX_NONE,
hexdata, hexdatalen);
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.h b/drivers/net/wireless/realtek/rtlwifi/debug.h
index 90c670b..dc0b9c3 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.h
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.h
@@ -168,9 +168,9 @@ enum dbgp_flag_e {
struct rtl_priv;
-__printf(4, 5)
+__printf(5, 6)
void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
- const char *fmt, ...);
+ const char *func, const char *fmt, ...);
__printf(4, 5)
void _rtl_dbg_print(struct rtl_priv *rtlpriv, u64 comp, int level,
@@ -182,7 +182,7 @@ void _rtl_dbg_print_data(struct rtl_priv *rtlpriv, u64 comp, int level,
#define RT_TRACE(rtlpriv, comp, level, fmt, ...) \
_rtl_dbg_trace(rtlpriv, comp, level, \
- fmt, ##__VA_ARGS__)
+ __func__, fmt, ##__VA_ARGS__)
#define RTPRINT(rtlpriv, dbgtype, dbgflag, fmt, ...) \
_rtl_dbg_print(rtlpriv, dbgtype, dbgflag, fmt, ##__VA_ARGS__)
--
2.10.2
^ permalink raw reply related
* [PATCH 2/3] rtlwifi: Convert COMP_XX entries into a proper debugging mask
From: Larry Finger @ 2017-01-01 1:07 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, Ping-Ke Shih
In-Reply-To: <20170101010706.13234-1-Larry.Finger@lwfinger.net>
The debugging macros contain a parameter COMP_XX that could be used as a
mask; however, the code turns all these various bits on at the same time.
This change implements them as a proper mask, and adds module parameters
to set the mask at load time.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtlwifi/debug.c | 17 +++--------------
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c | 5 +++++
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c | 5 +++++
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c | 5 +++++
drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c | 5 +++++
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c | 5 +++++
drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c | 5 +++++
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c | 5 +++++
drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c | 5 +++++
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c | 5 +++++
drivers/net/wireless/realtek/rtlwifi/wifi.h | 4 +++-
11 files changed, 51 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.c b/drivers/net/wireless/realtek/rtlwifi/debug.c
index cd2efac..23a54be 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.c
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.c
@@ -31,17 +31,6 @@ void rtl_dbgp_flag_init(struct ieee80211_hw *hw)
struct rtl_priv *rtlpriv = rtl_priv(hw);
u8 i;
- rtlpriv->dbg.global_debugcomponents =
- COMP_ERR | COMP_FW | COMP_INIT | COMP_RECV | COMP_SEND |
- COMP_MLME | COMP_SCAN | COMP_INTR | COMP_LED | COMP_SEC |
- COMP_BEACON | COMP_RATE | COMP_RXDESC | COMP_DIG | COMP_TXAGC |
- COMP_POWER | COMP_POWER_TRACKING | COMP_BB_POWERSAVING | COMP_SWAS |
- COMP_RF | COMP_TURBO | COMP_RATR | COMP_CMD |
- COMP_EFUSE | COMP_QOS | COMP_MAC80211 | COMP_REGD | COMP_CHAN |
- COMP_EASY_CONCURRENT | COMP_EFUSE | COMP_QOS | COMP_MAC80211 |
- COMP_REGD | COMP_CHAN | COMP_BT_COEXIST;
-
-
for (i = 0; i < DBGP_TYPE_MAX; i++)
rtlpriv->dbg.dbgp_type[i] = 0;
@@ -53,7 +42,7 @@ EXPORT_SYMBOL_GPL(rtl_dbgp_flag_init);
void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
const char *fmt, ...)
{
- if (unlikely((comp & rtlpriv->dbg.global_debugcomponents) &&
+ if (unlikely((comp & rtlpriv->dbg.global_debug_mask) &&
(level <= rtlpriv->dbg.global_debuglevel))) {
struct va_format vaf;
va_list args;
@@ -73,7 +62,7 @@ EXPORT_SYMBOL_GPL(_rtl_dbg_trace);
void _rtl_dbg_print(struct rtl_priv *rtlpriv, u64 comp, int level,
const char *fmt, ...)
{
- if (unlikely((comp & rtlpriv->dbg.global_debugcomponents) &&
+ if (unlikely((comp & rtlpriv->dbg.global_debug_mask) &&
(level <= rtlpriv->dbg.global_debuglevel))) {
struct va_format vaf;
va_list args;
@@ -94,7 +83,7 @@ void _rtl_dbg_print_data(struct rtl_priv *rtlpriv, u64 comp, int level,
const char *titlestring,
const void *hexdata, int hexdatalen)
{
- if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) &&
+ if (unlikely(((comp) & rtlpriv->dbg.global_debug_mask) &&
((level) <= rtlpriv->dbg.global_debuglevel))) {
pr_debug("In process \"%s\" (pid %i): %s\n",
current->comm, current->pid, titlestring);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c
index 1bf2993..75d8f75 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/sw.c
@@ -133,6 +133,8 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw)
/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ /* for debug mask */
+ rtlpriv->dbg.global_debug_mask = rtlpriv->cfg->mod_params->debug_mask;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
@@ -277,6 +279,7 @@ static struct rtl_mod_params rtl88ee_mod_params = {
.fwctrl_lps = false,
.msi_support = true,
.debug = 0,
+ .debug_mask = 0,
};
static const struct rtl_hal_cfg rtl88ee_hal_cfg = {
@@ -393,6 +396,7 @@ MODULE_FIRMWARE("rtlwifi/rtl8188efw.bin");
module_param_named(swenc, rtl88ee_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl88ee_mod_params.debug, int, 0444);
+module_param_named(debug_mask, rtl88ee_mod_params.debug_mask, ullong, 0444);
module_param_named(ips, rtl88ee_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl88ee_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl88ee_mod_params.fwctrl_lps, bool, 0444);
@@ -405,6 +409,7 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
+MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c
index 1fd8818..93ef2a5 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/sw.c
@@ -132,6 +132,8 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ /* for debug mask */
+ rtlpriv->dbg.global_debug_mask = rtlpriv->cfg->mod_params->debug_mask;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
@@ -248,6 +250,7 @@ static struct rtl_mod_params rtl92ce_mod_params = {
.swctrl_lps = false,
.fwctrl_lps = true,
.debug = 0,
+ .debug_mask = 0,
};
static const struct rtl_hal_cfg rtl92ce_hal_cfg = {
@@ -365,6 +368,7 @@ MODULE_FIRMWARE("rtlwifi/rtl8192cfwU_B.bin");
module_param_named(swenc, rtl92ce_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl92ce_mod_params.debug, int, 0444);
+module_param_named(debug_mask, rtl92ce_mod_params.debug_mask, ullong, 0444);
module_param_named(ips, rtl92ce_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl92ce_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl92ce_mod_params.fwctrl_lps, bool, 0444);
@@ -373,6 +377,7 @@ MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
+MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
index 935e830..bca46ed 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/sw.c
@@ -62,6 +62,8 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->dm.disable_framebursting = false;
rtlpriv->dm.thermalvalue = 0;
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ /* for debug mask */
+ rtlpriv->dbg.global_debug_mask = rtlpriv->cfg->mod_params->debug_mask;
rtlpriv->cfg->mod_params->sw_crypto =
rtlpriv->cfg->mod_params->sw_crypto;
@@ -158,12 +160,15 @@ static struct rtl_hal_ops rtl8192cu_hal_ops = {
static struct rtl_mod_params rtl92cu_mod_params = {
.sw_crypto = 0,
.debug = 0,
+ .debug_mask = 0,
};
module_param_named(swenc, rtl92cu_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl92cu_mod_params.debug, int, 0444);
+module_param_named(debug_mask, rtl92cu_mod_params.debug_mask, ullong, 0444);
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
+MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
static struct rtl_hal_usbint_cfg rtl92cu_interface_cfg = {
/* rx */
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
index 680217f..e214761 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
@@ -142,6 +142,8 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw)
/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ /* for debug mask */
+ rtlpriv->dbg.global_debug_mask = rtlpriv->cfg->mod_params->debug_mask;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
@@ -255,6 +257,7 @@ static struct rtl_mod_params rtl92de_mod_params = {
.swctrl_lps = true,
.fwctrl_lps = false,
.debug = 0,
+ .debug_mask = 0,
};
static const struct rtl_hal_cfg rtl92de_hal_cfg = {
@@ -368,11 +371,13 @@ module_param_named(debug, rtl92de_mod_params.debug, int, 0444);
module_param_named(ips, rtl92de_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl92de_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl92de_mod_params.fwctrl_lps, bool, 0444);
+module_param_named(debug_mask, rtl92de_mod_params.debug_mask, ullong, 0444);
MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 1)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 0)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
+MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c
index 17e675d..91387ed 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192ee/sw.c
@@ -135,6 +135,8 @@ int rtl92ee_init_sw_vars(struct ieee80211_hw *hw)
/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ /* for debug mask */
+ rtlpriv->dbg.global_debug_mask = rtlpriv->cfg->mod_params->debug_mask;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
@@ -259,6 +261,7 @@ static struct rtl_mod_params rtl92ee_mod_params = {
.fwctrl_lps = true,
.msi_support = true,
.debug = 0,
+ .debug_mask = 0,
};
static const struct rtl_hal_cfg rtl92ee_hal_cfg = {
@@ -369,6 +372,7 @@ MODULE_FIRMWARE("rtlwifi/rtl8192eefw.bin");
module_param_named(swenc, rtl92ee_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl92ee_mod_params.debug, int, 0444);
+module_param_named(debug_mask, rtl92ee_mod_params.debug_mask, ullong, 0444);
module_param_named(ips, rtl92ee_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl92ee_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl92ee_mod_params.fwctrl_lps, bool, 0444);
@@ -381,6 +385,7 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
+MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
index a19d1ec..a6db38e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
@@ -180,6 +180,8 @@ static int rtl92s_init_sw_vars(struct ieee80211_hw *hw)
/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ /* for debug mask */
+ rtlpriv->dbg.global_debug_mask = rtlpriv->cfg->mod_params->debug_mask;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
@@ -298,6 +300,7 @@ static struct rtl_mod_params rtl92se_mod_params = {
.swctrl_lps = true,
.fwctrl_lps = false,
.debug = 0,
+ .debug_mask = 0,
};
/* Because memory R/W bursting will cause system hang/crash
@@ -417,6 +420,7 @@ MODULE_FIRMWARE("rtlwifi/rtl8192sefw.bin");
module_param_named(swenc, rtl92se_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl92se_mod_params.debug, int, 0444);
+module_param_named(debug_mask, rtl92se_mod_params.debug_mask, ullong, 0444);
module_param_named(ips, rtl92se_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl92se_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl92se_mod_params.fwctrl_lps, bool, 0444);
@@ -425,6 +429,7 @@ MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 1)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 0)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
+MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c
index 833ef8a..e42c5b1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c
@@ -147,6 +147,8 @@ int rtl8723e_init_sw_vars(struct ieee80211_hw *hw)
/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ /* for debug mask */
+ rtlpriv->dbg.global_debug_mask = rtlpriv->cfg->mod_params->debug_mask;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
@@ -269,6 +271,7 @@ static struct rtl_mod_params rtl8723e_mod_params = {
.swctrl_lps = false,
.fwctrl_lps = true,
.debug = 0,
+ .debug_mask = 0,
.msi_support = false,
.disable_watchdog = false,
};
@@ -383,6 +386,7 @@ MODULE_FIRMWARE("rtlwifi/rtl8723efw.bin");
module_param_named(swenc, rtl8723e_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl8723e_mod_params.debug, int, 0444);
+module_param_named(debug_mask, rtl8723e_mod_params.debug_mask, ullong, 0444);
module_param_named(ips, rtl8723e_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl8723e_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl8723e_mod_params.fwctrl_lps, bool, 0444);
@@ -395,6 +399,7 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
+MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
index f8322fc..c02300d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c
@@ -146,6 +146,8 @@ int rtl8723be_init_sw_vars(struct ieee80211_hw *hw)
/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ /* for debug mask */
+ rtlpriv->dbg.global_debug_mask = rtlpriv->cfg->mod_params->debug_mask;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
@@ -272,6 +274,7 @@ static struct rtl_mod_params rtl8723be_mod_params = {
.msi_support = false,
.disable_watchdog = false,
.debug = 0,
+ .debug_mask = 0,
.ant_sel = 0,
};
@@ -387,6 +390,7 @@ MODULE_FIRMWARE("rtlwifi/rtl8723befw.bin");
module_param_named(swenc, rtl8723be_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl8723be_mod_params.debug, int, 0444);
+module_param_named(debug_mask, rtl8723be_mod_params.debug_mask, ullong, 0444);
module_param_named(ips, rtl8723be_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl8723be_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl8723be_mod_params.fwctrl_lps, bool, 0444);
@@ -400,6 +404,7 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
+MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
MODULE_PARM_DESC(disable_watchdog,
"Set to 1 to disable the watchdog (default 0)\n");
MODULE_PARM_DESC(ant_sel, "Set to 1 or 2 to force antenna number (default 0)\n");
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
index 6ecaf94..28d778e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c
@@ -162,6 +162,8 @@ int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
/* for debug level */
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
+ /* for debug mask */
+ rtlpriv->dbg.global_debug_mask = rtlpriv->cfg->mod_params->debug_mask;
/* for LPS & IPS */
rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
@@ -310,6 +312,7 @@ static struct rtl_mod_params rtl8821ae_mod_params = {
.msi_support = true,
.int_clear = true,
.debug = 0,
+ .debug_mask = 0,
.disable_watchdog = 0,
};
@@ -431,6 +434,7 @@ MODULE_FIRMWARE("rtlwifi/rtl8821aefw.bin");
module_param_named(swenc, rtl8821ae_mod_params.sw_crypto, bool, 0444);
module_param_named(debug, rtl8821ae_mod_params.debug, int, 0444);
+module_param_named(debug_mask, rtl8821ae_mod_params.debug_mask, ullong, 0444);
module_param_named(ips, rtl8821ae_mod_params.inactiveps, bool, 0444);
module_param_named(swlps, rtl8821ae_mod_params.swctrl_lps, bool, 0444);
module_param_named(fwlps, rtl8821ae_mod_params.fwctrl_lps, bool, 0444);
@@ -444,6 +448,7 @@ MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n");
MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)");
+MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
MODULE_PARM_DESC(int_clear, "Set to 0 to disable interrupt clear before set (default 1)\n");
diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h
index dafe486..419d512 100644
--- a/drivers/net/wireless/realtek/rtlwifi/wifi.h
+++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h
@@ -2221,6 +2221,8 @@ struct rtl_intf_ops {
};
struct rtl_mod_params {
+ /* default: 0,0 */
+ u64 debug_mask;
/* default: 0 = using hardware encryption */
bool sw_crypto;
@@ -2348,7 +2350,7 @@ struct rtl_works {
struct rtl_debug {
u32 dbgp_type[DBGP_TYPE_MAX];
int global_debuglevel;
- u64 global_debugcomponents;
+ u64 global_debug_mask;
/* add for proc debug */
struct proc_dir_entry *proc_dir;
--
2.10.2
^ permalink raw reply related
* [PATCH 1/3] rtlwifi: Redo debugging macros RTPRINT and RT_PRINT_DATA
From: Larry Finger @ 2017-01-01 1:07 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, Ping-Ke Shih
In-Reply-To: <20170101010706.13234-1-Larry.Finger@lwfinger.net>
These two debugging formss implement debugging using rather complicated
macro constructions. These are replaced with compiled code that is easier
to understand.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
drivers/net/wireless/realtek/rtlwifi/debug.c | 42 ++++++++++++++++++++++++----
drivers/net/wireless/realtek/rtlwifi/debug.h | 33 ++++++++++------------
2 files changed, 51 insertions(+), 24 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.c b/drivers/net/wireless/realtek/rtlwifi/debug.c
index 33905bb..cd2efac 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.c
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.c
@@ -51,7 +51,7 @@ EXPORT_SYMBOL_GPL(rtl_dbgp_flag_init);
#ifdef CONFIG_RTLWIFI_DEBUG
void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
- const char *modname, const char *fmt, ...)
+ const char *fmt, ...)
{
if (unlikely((comp & rtlpriv->dbg.global_debugcomponents) &&
(level <= rtlpriv->dbg.global_debuglevel))) {
@@ -63,13 +63,45 @@ void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
vaf.fmt = fmt;
vaf.va = &args;
- printk(KERN_DEBUG "%s:%ps:<%lx-%x> %pV",
- modname, __builtin_return_address(0),
- in_interrupt(), in_atomic(),
- &vaf);
+ pr_debug(":<%lx> %pV", in_interrupt(), &vaf);
va_end(args);
}
}
EXPORT_SYMBOL_GPL(_rtl_dbg_trace);
+
+void _rtl_dbg_print(struct rtl_priv *rtlpriv, u64 comp, int level,
+ const char *fmt, ...)
+{
+ if (unlikely((comp & rtlpriv->dbg.global_debugcomponents) &&
+ (level <= rtlpriv->dbg.global_debuglevel))) {
+ struct va_format vaf;
+ va_list args;
+
+ va_start(args, fmt);
+
+ vaf.fmt = fmt;
+ vaf.va = &args;
+
+ pr_debug("%pV", &vaf);
+
+ va_end(args);
+ }
+}
+EXPORT_SYMBOL_GPL(_rtl_dbg_print);
+
+void _rtl_dbg_print_data(struct rtl_priv *rtlpriv, u64 comp, int level,
+ const char *titlestring,
+ const void *hexdata, int hexdatalen)
+{
+ if (unlikely(((comp) & rtlpriv->dbg.global_debugcomponents) &&
+ ((level) <= rtlpriv->dbg.global_debuglevel))) {
+ pr_debug("In process \"%s\" (pid %i): %s\n",
+ current->comm, current->pid, titlestring);
+ print_hex_dump_bytes("", DUMP_PREFIX_NONE,
+ hexdata, hexdatalen);
+ }
+}
+EXPORT_SYMBOL_GPL(_rtl_dbg_print_data);
+
#endif
diff --git a/drivers/net/wireless/realtek/rtlwifi/debug.h b/drivers/net/wireless/realtek/rtlwifi/debug.h
index a6cc3ca..90c670b 100644
--- a/drivers/net/wireless/realtek/rtlwifi/debug.h
+++ b/drivers/net/wireless/realtek/rtlwifi/debug.h
@@ -168,34 +168,29 @@ enum dbgp_flag_e {
struct rtl_priv;
-__printf(5, 6)
+__printf(4, 5)
void _rtl_dbg_trace(struct rtl_priv *rtlpriv, int comp, int level,
- const char *modname, const char *fmt, ...);
+ const char *fmt, ...);
+
+__printf(4, 5)
+void _rtl_dbg_print(struct rtl_priv *rtlpriv, u64 comp, int level,
+ const char *fmt, ...);
+
+void _rtl_dbg_print_data(struct rtl_priv *rtlpriv, u64 comp, int level,
+ const char *titlestring,
+ const void *hexdata, int hexdatalen);
#define RT_TRACE(rtlpriv, comp, level, fmt, ...) \
_rtl_dbg_trace(rtlpriv, comp, level, \
- KBUILD_MODNAME, fmt, ##__VA_ARGS__)
+ fmt, ##__VA_ARGS__)
#define RTPRINT(rtlpriv, dbgtype, dbgflag, fmt, ...) \
-do { \
- if (unlikely(rtlpriv->dbg.dbgp_type[dbgtype] & dbgflag)) { \
- printk(KERN_DEBUG KBUILD_MODNAME ": " fmt, \
- ##__VA_ARGS__); \
- } \
-} while (0)
+ _rtl_dbg_print(rtlpriv, dbgtype, dbgflag, fmt, ##__VA_ARGS__)
#define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \
_hexdatalen) \
-do { \
- if (unlikely(((_comp) & rtlpriv->dbg.global_debugcomponents) && \
- (_level <= rtlpriv->dbg.global_debuglevel))) { \
- printk(KERN_DEBUG "%s: In process \"%s\" (pid %i): %s\n", \
- KBUILD_MODNAME, current->comm, current->pid, \
- _titlestring); \
- print_hex_dump_bytes("", DUMP_PREFIX_NONE, \
- _hexdata, _hexdatalen); \
- } \
-} while (0)
+ _rtl_dbg_print_data(rtlpriv, _comp, _level, \
+ _titlestring, _hexdata, _hexdatalen)
#else
--
2.10.2
^ permalink raw reply related
* [PATCH 0/3] rtlwifi: Rework debug system
From: Larry Finger @ 2017-01-01 1:07 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Larry Finger, Ping-Ke Shih
This set of patches modifies the debug system by replacing some
complicated macros with the equivalent operations in C. Then, the
COMP_XX component debugging is converted into a debug mask. Finally,
code is added to permit setting the debug mask from sysfs.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Larry Finger (3):
rtlwifi: Redo debugging macros RTPRINT and RT_PRINT_DATA
rtlwifi: Convert COMP_XX entries into a proper debugging mask
rtlwifi: Enable debug mask to be set from sysfs
drivers/net/wireless/realtek/rtlwifi/base.c | 43 ++++++++++++++---
drivers/net/wireless/realtek/rtlwifi/debug.c | 55 +++++++++++++++-------
drivers/net/wireless/realtek/rtlwifi/debug.h | 31 +++++-------
.../net/wireless/realtek/rtlwifi/rtl8188ee/sw.c | 5 ++
.../net/wireless/realtek/rtlwifi/rtl8192ce/sw.c | 5 ++
.../net/wireless/realtek/rtlwifi/rtl8192cu/sw.c | 5 ++
.../net/wireless/realtek/rtlwifi/rtl8192de/sw.c | 5 ++
.../net/wireless/realtek/rtlwifi/rtl8192ee/sw.c | 5 ++
.../net/wireless/realtek/rtlwifi/rtl8192se/sw.c | 5 ++
.../net/wireless/realtek/rtlwifi/rtl8723ae/sw.c | 5 ++
.../net/wireless/realtek/rtlwifi/rtl8723be/sw.c | 5 ++
.../net/wireless/realtek/rtlwifi/rtl8821ae/sw.c | 5 ++
drivers/net/wireless/realtek/rtlwifi/wifi.h | 4 +-
13 files changed, 135 insertions(+), 43 deletions(-)
--
2.10.2
^ permalink raw reply
* [PATCH 3/3] nfc: Fix RC-S380* needs zero-length packet
From: OGAWA Hirofumi @ 2016-12-31 11:42 UTC (permalink / raw)
To: Samuel Ortiz
Cc: Aloisio Almeida Jr, Lauro Ramos Venancio, linux-wireless,
Andrew Morton
In-Reply-To: <87y3ywmikp.fsf@mail.parknet.co.jp>
If sent packet size is wMaxPacketSize boundary, this device doesn't
answer. To fix this, we have to send zero-length packet in usb spec.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---
drivers/nfc/port100.c | 1 +
1 file changed, 1 insertion(+)
diff -puN drivers/nfc/port100.c~nfc-need-zero-packet drivers/nfc/port100.c
--- linux/drivers/nfc/port100.c~nfc-need-zero-packet 2016-12-31 19:11:03.893974993 +0900
+++ linux-hirofumi/drivers/nfc/port100.c 2016-12-31 19:11:03.895975004 +0900
@@ -1540,6 +1540,7 @@ static int port100_probe(struct usb_inte
usb_fill_bulk_urb(dev->out_urb, dev->udev,
usb_sndbulkpipe(dev->udev, out_endpoint),
NULL, 0, port100_send_complete, dev);
+ dev->out_urb->transfer_flags = URB_ZERO_PACKET;
dev->skb_headroom = PORT100_FRAME_HEADER_LEN +
PORT100_COMM_RF_HEAD_MAX_LEN;
_
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
^ permalink raw reply
* [PATCH resend 2/3] nfc: Send same info for both of NFC_CMD_GET_DEVICE and NFC_EVENT_DEVICE_ADDED
From: OGAWA Hirofumi @ 2016-12-31 11:41 UTC (permalink / raw)
To: Samuel Ortiz
Cc: Aloisio Almeida Jr, Lauro Ramos Venancio, linux-wireless,
Andrew Morton
In-Reply-To: <8737h4nx6b.fsf@mail.parknet.co.jp>
Now, NFC_EVENT_DEVICE_ADDED doesn't send NFC_ATTR_RF_MODE. But
NFC_CMD_GET_DEVICE send.
To get NFC_ATTR_RF_MODE, we have to call NFC_CMD_GET_DEVICE just for
NFC_ATTR_RF_MODE when get NFC_EVENT_DEVICE_ADDED.
This fixes those inconsistent.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---
net/nfc/netlink.c | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff -puN net/nfc/netlink.c~nfc-send-same-info net/nfc/netlink.c
--- linux/net/nfc/netlink.c~nfc-send-same-info 2016-12-18 22:16:55.805686290 +0900
+++ linux-hirofumi/net/nfc/netlink.c 2016-12-18 22:16:55.806686296 +0900
@@ -311,6 +311,17 @@ free_msg:
return -EMSGSIZE;
}
+static int nfc_genl_setup_device_added(struct nfc_dev *dev, struct sk_buff *msg)
+{
+ if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) ||
+ nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) ||
+ nla_put_u32(msg, NFC_ATTR_PROTOCOLS, dev->supported_protocols) ||
+ nla_put_u8(msg, NFC_ATTR_DEVICE_POWERED, dev->dev_up) ||
+ nla_put_u8(msg, NFC_ATTR_RF_MODE, dev->rf_mode))
+ return -1;
+ return 0;
+}
+
int nfc_genl_device_added(struct nfc_dev *dev)
{
struct sk_buff *msg;
@@ -325,10 +336,7 @@ int nfc_genl_device_added(struct nfc_dev
if (!hdr)
goto free_msg;
- if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) ||
- nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) ||
- nla_put_u32(msg, NFC_ATTR_PROTOCOLS, dev->supported_protocols) ||
- nla_put_u8(msg, NFC_ATTR_DEVICE_POWERED, dev->dev_up))
+ if (nfc_genl_setup_device_added(dev, msg))
goto nla_put_failure;
genlmsg_end(msg, hdr);
@@ -604,11 +612,7 @@ static int nfc_genl_send_device(struct s
if (cb)
genl_dump_check_consistent(cb, hdr, &nfc_genl_family);
- if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) ||
- nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) ||
- nla_put_u32(msg, NFC_ATTR_PROTOCOLS, dev->supported_protocols) ||
- nla_put_u8(msg, NFC_ATTR_DEVICE_POWERED, dev->dev_up) ||
- nla_put_u8(msg, NFC_ATTR_RF_MODE, dev->rf_mode))
+ if (nfc_genl_setup_device_added(dev, msg))
goto nla_put_failure;
genlmsg_end(msg, hdr);
_
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
^ permalink raw reply
* [PATCH resend 1/3] nfc: Add support RC-S380P to port100
From: OGAWA Hirofumi @ 2016-12-31 11:41 UTC (permalink / raw)
To: Samuel Ortiz
Cc: Aloisio Almeida Jr, Lauro Ramos Venancio, linux-wireless,
Andrew Morton
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---
drivers/nfc/port100.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff -puN drivers/nfc/port100.c~nfc-add-rcs380p drivers/nfc/port100.c
--- linux/drivers/nfc/port100.c~nfc-add-rcs380p 2016-12-18 22:16:53.503673411 +0900
+++ linux-hirofumi/drivers/nfc/port100.c 2016-12-18 22:16:53.504673416 +0900
@@ -21,8 +21,9 @@
#define VERSION "0.1"
-#define SONY_VENDOR_ID 0x054c
-#define RCS380_PRODUCT_ID 0x06c1
+#define SONY_VENDOR_ID 0x054c
+#define RCS380S_PRODUCT_ID 0x06c1
+#define RCS380P_PRODUCT_ID 0x06c3
#define PORT100_PROTOCOLS (NFC_PROTO_JEWEL_MASK | \
NFC_PROTO_MIFARE_MASK | \
@@ -1477,7 +1478,8 @@ static struct nfc_digital_ops port100_di
};
static const struct usb_device_id port100_table[] = {
- { USB_DEVICE(SONY_VENDOR_ID, RCS380_PRODUCT_ID), },
+ { USB_DEVICE(SONY_VENDOR_ID, RCS380S_PRODUCT_ID), },
+ { USB_DEVICE(SONY_VENDOR_ID, RCS380P_PRODUCT_ID), },
{ }
};
MODULE_DEVICE_TABLE(usb, port100_table);
_
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
^ permalink raw reply
* Re: [PATCH 2/2] cfg80211: reg: support ieee80211-(min|max)-center-freq DT properties
From: Rafał Miłecki @ 2016-12-30 21:37 UTC (permalink / raw)
To: Arend van Spriel
Cc: Kalle Valo, linux-wireless@vger.kernel.org, Martin Blumenstingl,
Felix Fietkau, Arnd Bergmann, devicetree@vger.kernel.org,
Rafał Miłecki
In-Reply-To: <86a22b00-1a04-25e7-9d31-2c1fd9d04e48@broadcom.com>
On 30 December 2016 at 21:20, Arend van Spriel
<arend.vanspriel@broadcom.com> wrote:
> On 29-12-16 10:43, Rafa=C5=82 Mi=C5=82ecki wrote:
>> On 29 December 2016 at 09:57, Arend van Spriel
>> <arend.vanspriel@broadcom.com> wrote:
>>> On 28-12-16 22:30, Rafa=C5=82 Mi=C5=82ecki wrote:
>>>> On 28 December 2016 at 22:28, Rafa=C5=82 Mi=C5=82ecki <zajec5@gmail.co=
m> wrote:
>>>>> On 28 December 2016 at 22:07, Arend van Spriel
>>>>> <arend.vanspriel@broadcom.com> wrote:
>>>>>> On 28-12-16 16:59, Rafa=C5=82 Mi=C5=82ecki wrote:
>>>>>>> From: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
>>>>>>>
>>>>>>> They allow specifying hardware limitations of supported channels. T=
his
>>>>>>> may be useful for specifying single band devices or devices that su=
pport
>>>>>>> only some part of the whole band.
>>>>>>> E.g. some tri-band routers have separated radios for lower and high=
er
>>>>>>> part of 5 GHz band.
>>>>>>>
>>>>>>> Signed-off-by: Rafa=C5=82 Mi=C5=82ecki <rafal@milecki.pl>
>>>>>>> ---
>>>>>>> net/wireless/reg.c | 34 ++++++++++++++++++++++++++++++++++
>>>>>>> 1 file changed, 34 insertions(+)
>>>>>>>
>>>>>>> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
>>>>>>> index 5dbac37..35ba5c7 100644
>>>>>>> --- a/net/wireless/reg.c
>>>>>>> +++ b/net/wireless/reg.c
>>>>>>> @@ -1123,6 +1123,26 @@ const char *reg_initiator_name(enum nl80211_=
reg_initiator initiator)
>>>>>>> }
>>>>>>> EXPORT_SYMBOL(reg_initiator_name);
>>>>>>>
>>>>>>> +static bool reg_center_freq_of_valid(struct wiphy *wiphy,
>>>>>>> + struct ieee80211_channel *chan)
>>>>>>> +{
>>>>>>> + struct device_node *np =3D wiphy_dev(wiphy)->of_node;
>>>>>>> + u32 val;
>>>>>>> +
>>>>>>> + if (!np)
>>>>>>> + return true;
>>>>>>> +
>>>>>>> + if (!of_property_read_u32(np, "ieee80211-min-center-freq", &v=
al) &&
>>>>>>> + chan->center_freq < KHZ_TO_MHZ(val))
>>>>>>> + return false;
>>>>>>> +
>>>>>>> + if (!of_property_read_u32(np, "ieee80211-max-center-freq", &v=
al) &&
>>>>>>> + chan->center_freq > KHZ_TO_MHZ(val))
>>>>>>> + return false;
>>>>>>
>>>>>> I suspect these functions rely on CONFIG_OF. So might not build for
>>>>>> !CONFIG_OF.
>>>>>
>>>>> I compiled it with
>>>>> # CONFIG_OF is not set
>>>>>
>>>>> Can you test it and provide a non-working config if you see a
>>>>> compilation error, please?
>>>>
>>>> include/linux/of.h provides a lot of dummy static inline functions if
>>>> CONFIG_OF is not used (they also allow compiler to drop most of the
>>>> code).
>>>
>>> of_propeirty_read_u32 is static inline in of.h calling
>>> of_property_read_u32_array, which has a dummy variant in of.h returning
>>> -ENOSYS so -38. Pretty sure that is not what you want. At least it does
>>> not allow the compiler to drop any code so probably better to do:
>>>
>>> if (!IS_ENABLED(CONFIG_OF) || !np)
>>> return true;
>>
>> Please verify that using a compiler. If there is a problem I'll be
>> happy to work on it, but I need a proof it exists.
>
> I am on vacation right now so not having much more than email and web
> browser to use as review reference.
>
>> If compilers sees a:
>> if (!-ENOSYS && chan->center_freq < KHZ_TO_MHZ(val))
>> condition, it's pretty clear it can be dropped. With both conditional
>> blocks dropped function always returns "true" and... can be dropped.
>>
>> Let me see if I can convince you with the following test:
>
> No need to convince me. I made a mistake reviewing the code. Thanks for
> clarifying it.
>
>> $ grep -m 1 CONFIG_OF .config
>> # CONFIG_OF is not set
>> $ objdump --syms net/wireless/reg.o | grep -c reg_center_freq_of_valid
>> 0
>>
>> $ grep -m 1 CONFIG_OF .config
>> CONFIG_OF=3Dy
>> $ objdump --syms net/wireless/reg.o | grep -c reg_center_freq_of_valid
>> 1
>>
>>
>>> So with this patch you change the channel to DISABLED. I am not very
>>> familiar with reg.c so do you know if this is done before or after
>>> calling regulatory notifier in the driver. brcmfmac will enable channel=
s
>>> querying the device upon regulatory notifier call, which may undo the
>>> behavior introduced by your patch.
>>
>> I'm not regulatory export, so I hope someone will review this patch.
>> So far I can say it works for me after trying it on SR400ac with
>> BCM43602.
>
> But you probably do not have a mapping table for mapping country code
> received in notifier to firmware regulatory code/revision. Only if you
> have that, brcmfmac will update the channels in the bands.
Thanks, I'll redo my tests.
> Giving this some more consideration I am not sure if this is the proper
> place to handle this. ieee80211-(min|max)-center-freq is platform
> specific configuration allowing multiple cards to be used in different
> (sub)bands. This has nothing to do with regulatory. So probably better
> to move it to core.c or chan.c.
I can see point in this, I'll see if I can put this code in a more
proper place. Thanks for your comment!
--=20
Rafa=C5=82
^ permalink raw reply
* Re: [PATCH 2/2] cfg80211: reg: support ieee80211-(min|max)-center-freq DT properties
From: Arend van Spriel @ 2016-12-30 20:20 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Kalle Valo, linux-wireless@vger.kernel.org, Martin Blumenstingl,
Felix Fietkau, Arnd Bergmann, devicetree@vger.kernel.org,
Rafał Miłecki
In-Reply-To: <CACna6rwaUWEjpBdfXS6uJSxKXH_mCP7YMGd1KaJropNQgVS7PA@mail.gmail.com>
On 29-12-16 10:43, Rafał Miłecki wrote:
> On 29 December 2016 at 09:57, Arend van Spriel
> <arend.vanspriel@broadcom.com> wrote:
>> On 28-12-16 22:30, Rafał Miłecki wrote:
>>> On 28 December 2016 at 22:28, Rafał Miłecki <zajec5@gmail.com> wrote:
>>>> On 28 December 2016 at 22:07, Arend van Spriel
>>>> <arend.vanspriel@broadcom.com> wrote:
>>>>> On 28-12-16 16:59, Rafał Miłecki wrote:
>>>>>> From: Rafał Miłecki <rafal@milecki.pl>
>>>>>>
>>>>>> They allow specifying hardware limitations of supported channels. This
>>>>>> may be useful for specifying single band devices or devices that support
>>>>>> only some part of the whole band.
>>>>>> E.g. some tri-band routers have separated radios for lower and higher
>>>>>> part of 5 GHz band.
>>>>>>
>>>>>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>>>>>> ---
>>>>>> net/wireless/reg.c | 34 ++++++++++++++++++++++++++++++++++
>>>>>> 1 file changed, 34 insertions(+)
>>>>>>
>>>>>> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
>>>>>> index 5dbac37..35ba5c7 100644
>>>>>> --- a/net/wireless/reg.c
>>>>>> +++ b/net/wireless/reg.c
>>>>>> @@ -1123,6 +1123,26 @@ const char *reg_initiator_name(enum nl80211_reg_initiator initiator)
>>>>>> }
>>>>>> EXPORT_SYMBOL(reg_initiator_name);
>>>>>>
>>>>>> +static bool reg_center_freq_of_valid(struct wiphy *wiphy,
>>>>>> + struct ieee80211_channel *chan)
>>>>>> +{
>>>>>> + struct device_node *np = wiphy_dev(wiphy)->of_node;
>>>>>> + u32 val;
>>>>>> +
>>>>>> + if (!np)
>>>>>> + return true;
>>>>>> +
>>>>>> + if (!of_property_read_u32(np, "ieee80211-min-center-freq", &val) &&
>>>>>> + chan->center_freq < KHZ_TO_MHZ(val))
>>>>>> + return false;
>>>>>> +
>>>>>> + if (!of_property_read_u32(np, "ieee80211-max-center-freq", &val) &&
>>>>>> + chan->center_freq > KHZ_TO_MHZ(val))
>>>>>> + return false;
>>>>>
>>>>> I suspect these functions rely on CONFIG_OF. So might not build for
>>>>> !CONFIG_OF.
>>>>
>>>> I compiled it with
>>>> # CONFIG_OF is not set
>>>>
>>>> Can you test it and provide a non-working config if you see a
>>>> compilation error, please?
>>>
>>> include/linux/of.h provides a lot of dummy static inline functions if
>>> CONFIG_OF is not used (they also allow compiler to drop most of the
>>> code).
>>
>> of_propeirty_read_u32 is static inline in of.h calling
>> of_property_read_u32_array, which has a dummy variant in of.h returning
>> -ENOSYS so -38. Pretty sure that is not what you want. At least it does
>> not allow the compiler to drop any code so probably better to do:
>>
>> if (!IS_ENABLED(CONFIG_OF) || !np)
>> return true;
>
> Please verify that using a compiler. If there is a problem I'll be
> happy to work on it, but I need a proof it exists.
I am on vacation right now so not having much more than email and web
browser to use as review reference.
> If compilers sees a:
> if (!-ENOSYS && chan->center_freq < KHZ_TO_MHZ(val))
> condition, it's pretty clear it can be dropped. With both conditional
> blocks dropped function always returns "true" and... can be dropped.
>
> Let me see if I can convince you with the following test:
No need to convince me. I made a mistake reviewing the code. Thanks for
clarifying it.
> $ grep -m 1 CONFIG_OF .config
> # CONFIG_OF is not set
> $ objdump --syms net/wireless/reg.o | grep -c reg_center_freq_of_valid
> 0
>
> $ grep -m 1 CONFIG_OF .config
> CONFIG_OF=y
> $ objdump --syms net/wireless/reg.o | grep -c reg_center_freq_of_valid
> 1
>
>
>> So with this patch you change the channel to DISABLED. I am not very
>> familiar with reg.c so do you know if this is done before or after
>> calling regulatory notifier in the driver. brcmfmac will enable channels
>> querying the device upon regulatory notifier call, which may undo the
>> behavior introduced by your patch.
>
> I'm not regulatory export, so I hope someone will review this patch.
> So far I can say it works for me after trying it on SR400ac with
> BCM43602.
But you probably do not have a mapping table for mapping country code
received in notifier to firmware regulatory code/revision. Only if you
have that, brcmfmac will update the channels in the bands.
Giving this some more consideration I am not sure if this is the proper
place to handle this. ieee80211-(min|max)-center-freq is platform
specific configuration allowing multiple cards to be used in different
(sub)bands. This has nothing to do with regulatory. So probably better
to move it to core.c or chan.c.
Regards,
Arend
^ permalink raw reply
* Re: [PATCH] cfg80211: Random local address for Public Action frame exchange
From: IgorMitsyanko @ 2016-12-30 19:55 UTC (permalink / raw)
To: jouni, Johannes Berg; +Cc: linux-wireless, vamsin
In-Reply-To: <1482266379-9723-1-git-send-email-jouni@qca.qualcomm.com>
On 12/20/2016 11:39 PM, Jouni Malinen wrote:
> From: vamsi krishna <vamsin-Rm6X0d1/PG5y9aJCnZT0Uw@public.gmane.org>
>
> Add support to use random local address (Address 2 = SA in transmit and
> the same address in receive functionality) for Public Action frames in
> order to improve privacy of WLAN clients. Applications fill the random
> source address in the frame buffer along with setting the
> NL80211_ATTR_RANDOM_SA flag when using the NL80211_CMD_FRAME command.
> This can be used only with the drivers that indicate support for random
> local address by setting the new NL80211_EXT_FEATURE_MGMT_TX_RANDOM_SA
> and/or NL80211_EXT_FEATURE_MGMT_TX_RANDOM_SA_CONNECTED in ext_features.
>
> The driver needs to configure receive behavior to accept frames to the
> specified random address during the time the frame exchange is pending
> and such frames need to be acknowledged similarly to frames sent to the
> local permanent address when this random address functionality is not
> used.
A (probably) silly question: how wireless drivers are supposed to use SA
in a frame? I think drivers are not concerned about source address, they
simply pass whatever there is already set by userspace in
cfg80211_mgmt_tx_params::buf into air on Tx.
And on Rx, they filter frames based on receiver address/BSSID, pass it
to upper layers and do not care what address is in DA (it is handled by
upper layers).
What can we use random_sa flag introduced in this patch for then?
>
> Signed-off-by: vamsi krishna <vamsin-Rm6X0d1/PG5y9aJCnZT0Uw@public.gmane.org>
> Signed-off-by: Jouni Malinen <jouni-A+ZNKFmMK5xy9aJCnZT0Uw@public.gmane.org>
> ---
> include/net/cfg80211.h | 6 ++++++
> include/uapi/linux/nl80211.h | 16 ++++++++++++++++
> net/wireless/mlme.c | 5 ++++-
> net/wireless/nl80211.c | 14 ++++++++++++++
> 4 files changed, 40 insertions(+), 1 deletion(-)
>
> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> index ca2ac1c..c442e4c 100644
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -2303,6 +2303,11 @@ struct cfg80211_update_ft_ies_params {
> * @dont_wait_for_ack: tells the low level not to wait for an ack
> * @n_csa_offsets: length of csa_offsets array
> * @csa_offsets: array of all the csa offsets in the frame
> + * @random_sa: indicates whether the source address is randomized. When this is
> + * true, the driver needs to transmit the management frame using the
> + * address specified in the SA field (Address 2) in the buffer and the
> + * driver needs to receive and acknowledge the response frame to this
> + * address instead of its permanent MAC address.
> */
> struct cfg80211_mgmt_tx_params {
> struct ieee80211_channel *chan;
> @@ -2314,6 +2319,7 @@ struct cfg80211_mgmt_tx_params {
> bool dont_wait_for_ack;
> int n_csa_offsets;
> const u16 *csa_offsets;
> + bool random_sa;
> };
>
> /**
> diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
> index d74e10b..cffc117 100644
> --- a/include/uapi/linux/nl80211.h
> +++ b/include/uapi/linux/nl80211.h
> @@ -567,6 +567,9 @@
> * %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
> * counters which will be updated to the current value. This attribute
> * is used during CSA period.
> + * When sending a Public Action frame, %NL80211_ATTR_MGMT_TX_RANDOM_SA can
> + * be used to indicate that random local address (SA) is used for the
> + * exchange.
> * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
> * command may be used with the corresponding cookie to cancel the wait
> * time if it is known that it is no longer necessary.
> @@ -1915,6 +1918,11 @@ enum nl80211_commands {
> * %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA,
> * %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities per
> * interface type.
> + * @NL80211_ATTR_MGMT_TX_RANDOM_SA: A flag attribute indicating whether the
> + * source address is randomized in frames sent using %NL80211_CMD_FRAME.
> + * If this flag is not set, the source address field is verified to match
> + * local MAC address. Random SA can be used only with Public Action frames
> + * (e.g., GAS/ANQP).
> *
> * @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO
> * groupID for monitor mode.
> @@ -2386,6 +2394,8 @@ enum nl80211_attrs {
>
> NL80211_ATTR_BSSID,
>
> + NL80211_ATTR_MGMT_TX_RANDOM_SA,
> +
> /* add attributes here, update the policy in nl80211.c */
>
> __NL80211_ATTR_AFTER_LAST,
> @@ -4697,6 +4707,10 @@ enum nl80211_feature_flags {
> * configuration (AP/mesh) with VHT rates.
> * @NL80211_EXT_FEATURE_FILS_STA: This driver supports Fast Initial Link Setup
> * with user space SME (NL80211_CMD_AUTHENTICATE) in station mode.
> + * @NL80211_EXT_FEATURE_MGMT_TX_RANDOM_SA: This driver supports randomized SA
> + * in @NL80211_CMD_FRAME while not associated.
> + * @NL80211_EXT_FEATURE_MGMT_TX_RANDOM_SA_CONNECTED: This driver supports
> + * randomized SA in @NL80211_CMD_FRAME while associated.
> *
> * @NUM_NL80211_EXT_FEATURES: number of extended features.
> * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
> @@ -4712,6 +4726,8 @@ enum nl80211_ext_feature_index {
> NL80211_EXT_FEATURE_BEACON_RATE_HT,
> NL80211_EXT_FEATURE_BEACON_RATE_VHT,
> NL80211_EXT_FEATURE_FILS_STA,
> + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_SA,
> + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_SA_CONNECTED,
>
> /* add new features before the definition below */
> NUM_NL80211_EXT_FEATURES,
> diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
> index 4646cf5..9568a72 100644
> --- a/net/wireless/mlme.c
> +++ b/net/wireless/mlme.c
> @@ -657,7 +657,10 @@ int cfg80211_mlme_mgmt_tx(struct cfg80211_registered_device *rdev,
> return err;
> }
>
> - if (!ether_addr_equal(mgmt->sa, wdev_address(wdev)))
> + if (!(params->random_sa &&
> + (ieee80211_is_action(mgmt->frame_control) &&
> + mgmt->u.action.category == WLAN_CATEGORY_PUBLIC)) &&
> + !ether_addr_equal(mgmt->sa, wdev_address(wdev)))
> return -EINVAL;
>
> /* Transmit the Action frame as requested by user space */
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 2369265..efced76 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -405,6 +405,7 @@ enum nl80211_multicast_groups {
> [NL80211_ATTR_FILS_NONCES] = { .len = 2 * FILS_NONCE_LEN },
> [NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED] = { .type = NLA_FLAG, },
> [NL80211_ATTR_BSSID] = { .len = ETH_ALEN },
> + [NL80211_ATTR_MGMT_TX_RANDOM_SA] = { .type = NLA_FLAG },
> };
>
> /* policy for the key attributes */
> @@ -9209,6 +9210,19 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
> }
> }
>
> + params.random_sa = nla_get_flag(
> + info->attrs[NL80211_ATTR_MGMT_TX_RANDOM_SA]);
> + if (params.random_sa &&
> + ((!wdev->current_bss &&
> + !wiphy_ext_feature_isset(
> + &rdev->wiphy,
> + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_SA)) ||
> + (wdev->current_bss &&
> + !wiphy_ext_feature_isset(
> + &rdev->wiphy,
> + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_SA_CONNECTED))))
> + return -EINVAL;
> +
> if (!params.dont_wait_for_ack) {
> msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
> if (!msg)
>
^ permalink raw reply
* [PATCH] mac80211: Fix invalid 'info' access in xmit-fast.
From: greearb @ 2016-12-30 18:49 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes, Ben Greear
From: Ben Greear <greearb@candelatech.com>
ieee80211_xmit_fast assigns info from the passed-in
skb, but then later it also checks for skb_shared(skb),
and may create a new skb based on that check.
But, the code did not re-assign 'info', so it pointed into
the old shared skb. This leads to all sorts of problems,
most obviously crashes since the new skb's info->hw_queue is not
properly initialized.
Bug was seen by sending pktgen packets on a bridge that
had an AP network interface in it. hw-queue was out of
range, which made it crash like this:
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<ffffffffa0ad4672>] ieee80211_tx_frags+0x232/0x4c0 [mac80211]
PGD 0
Oops: 0002 [#1] PREEMPT SMP
CPU: 0 PID: 1512 Comm: kpktgend_0 Tainted: G O 4.7.10+ #24
Hardware name: To be filled by O.E.M. To be filled by O.E.M./ChiefRiver, BIOS 4.6.5 06/07/2013
task: ffff8802132f3a00 ti: ffff8800362ac000 task.ti: ffff8800362ac000
RIP: 0010:[<ffffffffa0ad4672>] [<ffffffffa0ad4672>] ieee80211_tx_frags+0x232/0x4c0 [mac80211]
RSP: 0018:ffff8800362afa28 EFLAGS: 00010086
RAX: ffff8802130a22c0 RBX: ffff8802130a13a0 RCX: ffff880035ef2200
RDX: ffff880035ef2200 RSI: 0000000000000292 RDI: 0000000000000000
RBP: ffff8800362afa90 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000088 R11: 0000000000000001 R12: ffff880035ef2200
R13: ffff880035dabb90 R14: ffff8800362afb18 R15: 0000000000000cc0
FS: 0000000000000000(0000) GS:ffff88021e200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000001e06000 CR4: 00000000001406f0
Stack:
0000000000000292 ffff880035daa880 ffff8802130a0b20 ffff8800d4f01808
00ff8800362afaa0 ffff8800362afb18 ffff8802130a13c0 ffff88021e20db68
ffff880035daa880 ffff8800362afb18 ffff880035ef2200 ffff88020f6ca300
Call Trace:
[<ffffffffa0ad9f63>] __ieee80211_subif_start_xmit+0xc13/0xc30 [mac80211]
[<ffffffff8113d2c5>] ? find_busiest_group+0x35/0x4a0
[<ffffffffa0ad9f8b>] ieee80211_subif_start_xmit+0xb/0x10 [mac80211]
[<ffffffff8177d40b>] dev_hard_start_xmit+0x9b/0x220
[<ffffffff817a3716>] sch_direct_xmit+0xd6/0x1a0
[<ffffffff8177da8e>] __dev_queue_xmit+0x3be/0x6c0
[<ffffffff81127f43>] ? finish_task_switch+0x73/0x1f0
[<ffffffff8177dd9d>] dev_queue_xmit+0xd/0x10
[<ffffffffa0b5fe85>] br_dev_queue_push_xmit+0x75/0x140 [bridge]
[<ffffffffa0b5ffc9>] br_forward_finish+0x29/0xa0 [bridge]
[<ffffffff8116db83>] ? del_timer_sync+0x43/0x50
[<ffffffffa0b600a2>] __br_deliver+0x62/0x130 [bridge]
[<ffffffff81175937>] ? __getnstimeofday64+0x37/0xd0
[<ffffffff811759d9>] ? getnstimeofday64+0x9/0x30
[<ffffffffa0b605b6>] br_deliver+0x56/0x60 [bridge]
[<ffffffffa0b5d472>] br_dev_xmit+0x1c2/0x250 [bridge]
[<ffffffffa137aa1c>] pktgen_thread_worker+0x174c/0x2471 [pktgen]
[<ffffffff8185087a>] ? __schedule+0x30a/0x7c0
[<ffffffff811446e0>] ? wake_atomic_t_function+0x60/0x60
[<ffffffffa13792d0>] ? pktgen_rem_all_ifs+0x80/0x80 [pktgen]
[<ffffffff81121c14>] kthread+0xc4/0xe0
[<ffffffff818551df>] ret_from_fork+0x1f/0x40
[<ffffffff81121b50>] ? kthread_worker_fn+0x180/0x180
Fix this by re-assigning info after creating new one.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
This patch is against 4.7.10+
net/mac80211/tx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 0573ab9..3da5f94 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -3081,6 +3081,7 @@ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
if (!skb)
return true;
+ info = IEEE80211_SKB_CB(skb);
}
ieee80211_tx_stats(dev, skb->len + extra_head);
--
2.4.11
^ 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