Re: ath10k: device has crashed during init - qca6174 chipset

2015-12-07 Thread Rajkumar Manoharan
On Tue, Dec 01, 2015 at 11:28:25AM +0100, Bartlomiej Grzeskowiak wrote:
> I have tested borad-2.bin file with my module, by forcing
> ar->id.subsystem_vendor = 0x168c;
> ar->id.subsystem_device = 0x3363; (1,2,3)
> in ath/ath10k/pci.c file.
> 
> All the tests failed with:
> ath10k_pci :01:00.0: failed to receive initialized event from
> target: 
> ath10k_pci :01:00.0: firmware crashed! (uuid
> 5506e81c-d538-4492-91d7-dc899fed8d8c)
> 
> Does it mean, that this module is not supported?
> I will need to dump firmware from windows driver, when I get it from
> the vendor ?
> 
Can you please apply below changes in your rc2 backports.

https://github.com/kvalo/ath/commit/2727a743e9eeb3d4063d4077afee3fd2a5e198ca
https://github.com/kvalo/ath/commit/6419fdbb6f90e147690f8833cba59d289d613da5

or try with latest backports.

https://www.kernel.org/pub/linux/kernel/projects/backports/2015/11/20/backports-20151120.tar.gz

-Rajkumar
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] prism54: fix compare_const_fl.cocci warnings (fwd)

2015-12-07 Thread Julia Lawall
Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

Signed-off-by: Fengguang Wu 
Signed-off-by: Julia Lawall 
---

It looks a little nicer to me because n is the thing we care about.

 oid_mgt.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/drivers/net/wireless/intersil/prism54/oid_mgt.c
+++ b/drivers/net/wireless/intersil/prism54/oid_mgt.c
@@ -424,7 +424,7 @@ mgt_set_request(islpci_private *priv, en
void *cache, *_data = data;
u32 oid;

-   BUG_ON(OID_NUM_LAST <= n);
+   BUG_ON(n >= OID_NUM_LAST);
BUG_ON(extra > isl_oid[n].range);

if (!priv->mib)
@@ -485,7 +485,7 @@ mgt_set_varlen(islpci_private *priv, enu
int dlen;
u32 oid;

-   BUG_ON(OID_NUM_LAST <= n);
+   BUG_ON(n >= OID_NUM_LAST);

dlen = isl_oid[n].size;
oid = isl_oid[n].oid;
@@ -524,7 +524,7 @@ mgt_get_request(islpci_private *priv, en
void *cache, *_res = NULL;
u32 oid;

-   BUG_ON(OID_NUM_LAST <= n);
+   BUG_ON(n >= OID_NUM_LAST);
BUG_ON(extra > isl_oid[n].range);

res->ptr = NULL;
@@ -626,7 +626,7 @@ mgt_commit_list(islpci_private *priv, en
 void
 mgt_set(islpci_private *priv, enum oid_num_t n, void *data)
 {
-   BUG_ON(OID_NUM_LAST <= n);
+   BUG_ON(n >= OID_NUM_LAST);
BUG_ON(priv->mib[n] == NULL);

memcpy(priv->mib[n], data, isl_oid[n].size);
@@ -636,7 +636,7 @@ mgt_set(islpci_private *priv, enum oid_n
 void
 mgt_get(islpci_private *priv, enum oid_num_t n, void *res)
 {
-   BUG_ON(OID_NUM_LAST <= n);
+   BUG_ON(n >= OID_NUM_LAST);
BUG_ON(priv->mib[n] == NULL);
BUG_ON(res == NULL);

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] mac80211: handle HW ROC expired properly

2015-12-07 Thread Johannes Berg
From: Ilan Peer 

In case of HW ROC, when the driver reports that the ROC expired,
it is not sufficient to purge the ROCs based on the remaining
time, as it possible that the device finished the ROC session
before the actual requested duration.

To handle such cases, in case of ROC expired notification from
the driver, complete all the ROCs which are marked with hw_begun,
regardless of the remaining duration.

Signed-off-by: Ilan Peer 
Signed-off-by: Johannes Berg 
---
 net/mac80211/offchannel.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 6719b27aad66..8b2f4eaac2ba 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -224,7 +224,11 @@ static unsigned long ieee80211_end_finished_rocs(struct 
ieee80211_local *local,
msecs_to_jiffies(roc->duration) -
now;
 
-   if (roc->abort || remaining <= 0)
+   /* In case of HW ROC, it is possible that the HW finished the
+* ROC session before the actual requested time. In such a case
+* end the ROC session (disregarding the remaining time).
+*/
+   if (roc->abort || roc->hw_begun || remaining <= 0)
ieee80211_roc_notify_destroy(roc);
else
remaining_dur_min = min(remaining_dur_min, remaining);
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] wlcore/wl12xx: spi: fix oops on firmware load

2015-12-07 Thread Uri Mashiach
The maximum chunks used by the function is
(SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE + 1).
The original commands array had space for
(SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) commands.
When the last chunk is used (len > 4 * WSPI_MAX_CHUNK_SIZE), the last
command is stored outside the bounds of the commands array.

Oops 5 (page fault) is generated during current wl1271 firmware load
attempt:

root@debian-armhf:~# ifconfig wlan0 up
[  294.312399] Unable to handle kernel paging request at virtual address
00203fc4
[  294.320173] pgd = de528000
[  294.323028] [00203fc4] *pgd=
[  294.326916] Internal error: Oops: 5 [#1] SMP ARM
[  294.331789] Modules linked in: bnep rfcomm bluetooth ipv6 arc4 wl12xx
wlcore mac80211 musb_dsps cfg80211 musb_hdrc usbcore usb_common
wlcore_spi omap_rng rng_core musb_am335x omap_wdt cpufreq_dt thermal_sys
hwmon
[  294.351838] CPU: 0 PID: 1827 Comm: ifconfig Not tainted
4.2.0-2-g3e9ad27-dirty #78
[  294.360154] Hardware name: Generic AM33XX (Flattened Device Tree)
[  294.366557] task: dc9d6d40 ti: de55 task.ti: de55
[  294.372236] PC is at __spi_validate+0xa8/0x2ac
[  294.376902] LR is at __spi_sync+0x78/0x210
[  294.381200] pc : []lr : []psr: 6013
[  294.381200] sp : de551998  ip : de5519d8  fp : 0020
[  294.393242] r10: de551c8c  r9 : de5519d8  r8 : de3a9000
[  294.398730] r7 : de3a9258  r6 : de3a9400  r5 : de551a48  r4 :
00203fbc
[  294.405577] r3 :   r2 :   r1 :   r0 :
de3a9000
[  294.412420] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM
Segment user
[  294.419918] Control: 10c5387d  Table: 9e528019  DAC: 0015
[  294.425954] Process ifconfig (pid: 1827, stack limit = 0xde550218)
[  294.432437] Stack: (0xde551998 to 0xde552000)

...

[  294.883613] [] (__spi_validate) from []
(__spi_sync+0x78/0x210)
[  294.891670] [] (__spi_sync) from []
(wl12xx_spi_raw_write+0xfc/0x148 [wlcore_spi])
[  294.901661] [] (wl12xx_spi_raw_write [wlcore_spi]) from
[] (wlcore_boot_upload_firmware+0x1ec/0x458 [wlcore])
[  294.914038] [] (wlcore_boot_upload_firmware [wlcore]) from
[] (wl12xx_boot+0xc10/0xfac [wl12xx])
[  294.925161] [] (wl12xx_boot [wl12xx]) from []
(wl1271_op_add_interface+0x5b0/0x910 [wlcore])
[  294.936364] [] (wl1271_op_add_interface [wlcore]) from
[] (ieee80211_do_open+0x44c/0xf7c [mac80211])
[  294.947963] [] (ieee80211_do_open [mac80211]) from
[] (__dev_open+0xa8/0x110)
[  294.957307] [] (__dev_open) from []
(__dev_change_flags+0x88/0x148)
[  294.965713] [] (__dev_change_flags) from []
(dev_change_flags+0x18/0x48)
[  294.974576] [] (dev_change_flags) from []
(devinet_ioctl+0x6b4/0x7d0)
[  294.983191] [] (devinet_ioctl) from []
(sock_ioctl+0x1e4/0x2bc)
[  294.991244] [] (sock_ioctl) from []
(do_vfs_ioctl+0x420/0x6b0)
[  294.999208] [] (do_vfs_ioctl) from []
(SyS_ioctl+0x6c/0x7c)
[  295.006880] [] (SyS_ioctl) from []
(ret_fast_syscall+0x0/0x54)
[  295.014835] Code: e1550004 e2444034 0a7d e5953018 (e5942008)
[  295.021544] ---[ end trace 66ed188198f4e24e ]---

Signed-off-by: Uri Mashiach 
---
 drivers/net/wireless/ti/wlcore/spi.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ti/wlcore/spi.c 
b/drivers/net/wireless/ti/wlcore/spi.c
index f1ac283..720e4e4 100644
--- a/drivers/net/wireless/ti/wlcore/spi.c
+++ b/drivers/net/wireless/ti/wlcore/spi.c
@@ -73,7 +73,10 @@
  */
 #define SPI_AGGR_BUFFER_SIZE (4 * PAGE_SIZE)
 
-#define WSPI_MAX_NUM_OF_CHUNKS (SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE)
+/* Maximum number of SPI write chunks */
+#define WSPI_MAX_NUM_OF_CHUNKS \
+   ((SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) + 1)
+
 
 struct wl12xx_spi_glue {
struct device *dev;
@@ -268,9 +271,10 @@ static int __must_check wl12xx_spi_raw_write(struct device 
*child, int addr,
 void *buf, size_t len, bool fixed)
 {
struct wl12xx_spi_glue *glue = dev_get_drvdata(child->parent);
-   struct spi_transfer t[2 * (WSPI_MAX_NUM_OF_CHUNKS + 1)];
+   /* SPI write buffers - 2 for each chunk */
+   struct spi_transfer t[2 * WSPI_MAX_NUM_OF_CHUNKS];
struct spi_message m;
-   u32 commands[WSPI_MAX_NUM_OF_CHUNKS];
+   u32 commands[WSPI_MAX_NUM_OF_CHUNKS]; /* 1 command per chunk */
u32 *cmd;
u32 chunk_len;
int i;
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: linux-next: manual merge of the wireless-drivers-next tree with Linus' tree

2015-12-07 Thread Kalle Valo
Stephen Rothwell  writes:

> Today's linux-next merge of the wireless-drivers-next tree got a
> conflict in:
>
>   drivers/net/wireless/ath/ath10k/pci.c
>
> between commit:
>
>   6419fdbb6f90 ("ath10k: poll HTT send completion when CE 5 is unused")
>
> from Linus' tree and commit:
>
>   afb0bf7f530b ("ath10k: add support for pktlog in QCA99X0")
>
> from the wireless-drivers-next tree.
>
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

Thanks, the fix looks good to me.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] rtlwifi: fix gigantic memleak in rtl_usb

2015-12-07 Thread Kalle Valo
Peter Wu  writes:

> Originally I had the Cc: stable line added, but the SubmittingPatches
> document seems to discourage that for networking. Added it again.

Yeah, stable wireless patches are handled differently from rest of the
networking subsystem. It would be great if somebody could update the
documentation.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC] Documentation: Clarify wording regarding submission of wireless patches to stable

2015-12-07 Thread Larry Finger
The instructions for submitting patches state that changes destined for
networking should not be marked with a Cc to stable. This restriction does
not apply to the wireless portion of networking. The instructions are
updated to clarify this case.

Signed-off-by: Larry Finger 
---

Kalle,

Is this change clear, and strong enough?

Larry
---

 Documentation/SubmittingPatches | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index d603fa0..5457a18 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -306,7 +306,9 @@ file.
 Note, however, that some subsystem maintainers want to come to their own
 conclusions on which patches should go to the stable trees.  The networking
 maintainer, in particular, would rather not see individual developers
-adding lines like the above to their patches.
+adding lines like the above to their patches. Note: Patches for the wireless
+section of networking should include a recommendation for inclusion in stable
+whenever appropriate.
 
 If changes affect userland-kernel interfaces, please send the MAN-PAGES
 maintainer (as listed in the MAINTAINERS file) a man-pages patch, or at
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] rtlwifi: fix gigantic memleak in rtl_usb

2015-12-07 Thread Bruno Randolf
On 12/06/2015 09:39 PM, Peter Wu wrote:
>>> While using the rtl8192cu driver in monitor mode, somehow 5G of memory
>>> was permanently lost (observable via the Available column in `free -m`).
>>>
>>> This issue has existed since the introduction of this driver in v2.6.x,

One more reason to switch to rtl8xxxu as soon as possible...

bruno

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pull-request: wireless-drivers-next 2015-12-07

2015-12-07 Thread Kalle Valo
Hi Dave,

here's the first "real" pull request after the wireless directory
reorganisation. Nothing really out ordinary, new features and bugfixes
as usual. This time there's a regression in ath10k because of a bugfix
in wireless-drivers.git which conflicted with a patch in
wireless-drivers-next.git. But it should be easy to fix, just follow
what Stephen did in in linux-next:

http://article.gmane.org/gmane.linux.kernel.next/37391

Please let me know if you have any problems.

Kalle

The following changes since commit 6d808eba602b00f77f26191f45328774ff057cc0:

  mac80211_hwsim: move Kconfig entry for sorting alphabetically (2015-11-18 
15:23:36 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git 
tags/wireless-drivers-next-for-davem-2015-12-07

for you to fetch changes up to 2abcd3d40d2cae8d4698ba4b0f4d6c793dda6f8b:

  Merge tag 'iwlwifi-next-for-kalle-2015-12-01' of 
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next 
(2015-12-03 17:23:43 +0200)



brcfmac

* support bcm4359 which can operate in two bands concurrently
* disable runtime pm for USB avoiding issues
* use generic pm callback in PCIe driver
* support wowlan wake indication reporting
* add beamforming support
* unified handling of firmware files

ath10k

* support Manegement Frame Protection (MFP)
* add thermal throttling support for 10.4 firmware
* add support for pktlog in QCA99X0
* add debugfs file to enable Bluetooth coexistence feature
* use firmware's native mesh interface type instead of raw mode

iwlwifi

* BT coex improvements
* D3 operation bugfixes
* rate control improvements
* firmware debugging infra improvements
* ground work for multi Rx
* various security fixes


Andy Green (5):
  wcn36xx: introduce WCN36XX_HAL_AVOID_FREQ_RANGE_IND
  wcn36xx: swallow two wcn3620 IND messages
  wcn36xx: handle new hal response format
  wcn36xx: use new response format for wcn3620 trigger_ba
  wcn36xx: use new response format for wcn3620 remove_bsskey

Andy Shevchenko (2):
  rtlwifi: btcoexist: re-use %*ph specifier to hexdump
  wireless: airo: re-use mac_pton()

Arend van Spriel (1):
  brcmfmac: assure net_ratelimit() is declared before use

Avraham Stern (1):
  iwlwifi: mvm: Configure fragmented scan for scheduled scan

Avri Altman (2):
  iwlwifi: mvm: Enable MPLUT only on supported hw
  iwlwifi: mvm: Align bt-coex priority with requirements

Dan Carpenter (5):
  ath9k_htc: check for underflow in ath9k_htc_rx_msg()
  rt2x00: type bug in _rt2500usb_register_read()
  libertas: cleanup a variable name
  brcm80211: fix error code in brcmf_pcie_exit_download_state()
  iwlwifi: mvm: rs: fix a warning message

Derek Basehore (1):
  iwlwifi: mvm: report wakeup for wowlan

Dreyfuss, Haim (1):
  iwlwifi: Add new PCI IDs for 9260 and 5165 series

Eliad Peller (2):
  iwlwifi: mvm: refactor d3 key update functions
  iwlwifi: remove IWL_DL_LED

Emmanuel Grumbach (4):
  Merge remote-tracking branch 'iwlwifi-fixes/master' into next
  iwlwifi: add support for 12K Receive Buffers
  iwlwifi: mvm: change name of iwl_mvm_d3_update_gtk
  iwlwifi: change the Intel Wireless email address

Eyal Shapira (1):
  iwlwifi: mvm: drop low_latency_agg_frame_cnt_limit

Felix Fietkau (1):
  ath10k: stop abusing GFP_DMA

Franky Lin (1):
  brcmfmac: no retries on rxglom superframe errors

Golan Ben Ami (1):
  iwlwifi: mvm: Support setting continuous recording debug mode

Golan Ben-Ami (4):
  iwlwifi: mvm: add trigger for firmware dump upon TDLS events
  iwlwifi: export the _no_grab version of PRPH IO functions
  iwlwifi: dump prph registers in a common place for all transports
  iwlwifi: mvm: move fw-dbg code to separate file

Hante Meuleman (17):
  brcmfmac: Add support for the BCM4359 11ac RSDB PCIE device.
  brcmfmac: Simplify and fix usage of brcmf_ifname.
  brcmfmac: Remove unnecessary check from start_xmit.
  brcmfmac: Remove unncessary variable irq_requested.
  brcmfmac: Disable runtime pm for USB.
  brcmfmac: Add RSDB support.
  brcmfmac: Use consistent naming for bsscfgidx.
  brcmfmac: Use new methods for pcie Power Management.
  brcmfmac: Add wowl wake indication report.
  brcmfmac: Cleanup ssid storage.
  brcmfmac: Return actual error by fwil.
  brcmfmac: Change error print on wlan0 existence.
  brcmfmac: Remove redundant parameter action from scan.
  brcmfmac: Cleanup roaming configuration.
  brcmfmac: Add beamforming support.
  brcmfmac: Unify methods to define and map firmware files.
  brcmfmac: Fix double free on exception at module load.

Johannes Berg (11):
  iwlwifi: nvm: fix up phy section when reading it
  iwlwifi: dvm: remove Kconfig default

Re: linux-next: manual merge of the wireless-drivers-next tree with Linus' tree

2015-12-07 Thread Kalle Valo
Kalle Valo  writes:

> Stephen Rothwell  writes:
>
>> Today's linux-next merge of the wireless-drivers-next tree got a
>> conflict in:
>>
>>   drivers/net/wireless/ath/ath10k/pci.c
>>
>> between commit:
>>
>>   6419fdbb6f90 ("ath10k: poll HTT send completion when CE 5 is unused")
>>
>> from Linus' tree and commit:
>>
>>   afb0bf7f530b ("ath10k: add support for pktlog in QCA99X0")
>>
>> from the wireless-drivers-next tree.
>>
>> I fixed it up (see below) and can carry the fix as necessary (no action
>> is required).
>
> Thanks, the fix looks good to me.

BTW, this conflict should be fixed once Dave merges my
wireless-drivers-next pull request.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fixing full name in patchwork

2015-12-07 Thread Kalle Valo
Hi Sudip,

Sudip Mukherjee  writes:

> We were dereferencing cmd first and checking for NULL later. Lets first
> check for NULL.
>
> Signed-off-by: Sudip Mukherjee 

I noticed that your name in git log is not your full name:

commit 0a38c8e1b592c16d959da456f425053e323a5153
Author: sudip 
Date:   Tue Nov 24 13:51:38 2015 +0530

This is because for some reason in patchwork your fullname is just
"sudip":

https://patchwork.kernel.org/patch/7688171/

Could you please fix your name in patchwork so that in the future we can
use your correct full name? The problem is that I don't know exactly how
to do this but it should be possible because I remember someone else
having a similar problem and he was able to fix it.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


brcmsmac: signal lost after connecting to AP

2015-12-07 Thread Ivan Castellucci Vidal
Hi everyone!

This is my first post so if I forget about anything I hope you can
help me make this useful for everyone.
Currently I own a Laptop which comes with a Broadcom BCM4313 WLAN
card. I'm in a far place from the AP but I still have enough signal to
watch HD videos on YouTube most of the time, but from time to time
signal fades because of environment factors.

What I've observed is that if I keep pinging the AP it replies unthil
signal fades, then I reconnect to the network and ping shows replies
for at least one packet and it can work for a couple more sometimes.
That makes me think the WLAN card and the AP have enough power to keep
working between each other despite of the distance but something makes
the card go in a low-power mode or something because signal
immediately drops and stop replying.

Did it happened to anyone else? Is it a known bug or feature (maybe a
regulatory feature) ?

Anyhow, if you need any information just let me know, the AP is a
TP-LINK router and it works with my phone for even longer distances.
BTW: I have a decent C programming background and I can help with
anything you need with the only detail of time being a constraint
sometimes.

Thanks in advance

--
Iván Castellucci Vidal
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pull-request: mac80211-next 2015-12-07

2015-12-07 Thread David Miller
From: Johannes Berg 
Date: Mon, 07 Dec 2015 11:19:34 +0100

> This is the first pull request for 4.5 from me - apologies for taking
> so long and letting it grow, we had a bunch of issues to figure out,
> most of which ended up unrelated to this code.
> 
> I don't know what git is doing with the diffstat below, I tried the
> merge and ended up with a completely different and much saner diffstat,
> but let me know if there's some problem on your side.

The pull diffstat looked sane.

Pulled, thanks Johannes.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


wireless-testing rebased, new HEAD commit f5feec4244464225c03ccc9ddad615cb43a044cc

2015-12-07 Thread John W. Linville
All,

An earlier pull got a version of mac80211.git that was later reverted.
Unfortunately, the intervening merges got things so screwed-up I
couldn't reasonably unravel them.  So, I have taken the somewhat
unusual step of rebasing wireless-testing here in the middle of the
4.4 stream.

The current wireless-testing HEAD is commit
f5feec4244464225c03ccc9ddad615cb43a044cc.  Consumers of
wireless-testing, please make the necessary adjustment.

I apologize for the inconvenience...

John
-- 
John W. LinvilleSomeday the world will need a hero, and you
linvi...@tuxdriver.com  might be all we have.  Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/4] fine timing measurement

2015-12-07 Thread Johannes Berg
As we've discussed with a number of people already, here's our current
work to add fine timing measurement support. Most of the work is really
done by the firmware, so this just defines the API.

We've gone back and forth over this, and I guess one thing that might
need explaining is the decision to only allow aborting a measurement by
closing a socket. The reasoning behind this was that (a) it needs to be
supported anyway, if the application crashes, and forcing it that way
makes the code path more tested; (b) if you wanted to reuse a socket
for this and other things, eventually you'd make your code more complex
because you'd have to handle events while waiting for the ACK message
for a command - but in most testing it'll work if you forget, and then
randomly lose some events every once a while ... forcing a new socket
also prevents that issue.

Please send comments :)

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] nl80211: add fine timing measurement support

2015-12-07 Thread Johannes Berg
From: Assaf Krauss 

Add support for generic measurements that allow userspace to request a
measurement and receive the result. The result will be sent only to the
socket requesting the measurement, and the measurement can be aborted
by closing that socket.

The only supported measurement right now is fine timing measurement.

Signed-off-by: Assaf Krauss 
Signed-off-by: Beni Lev 
Signed-off-by: Emmanuel Grumbach 
Signed-off-by: Johannes Berg 
---
 include/net/cfg80211.h   | 189 ++
 include/uapi/linux/nl80211.h | 271 ++
 net/wireless/core.c  |  57 +-
 net/wireless/core.h  |  12 ++
 net/wireless/nl80211.c   | 452 +++
 net/wireless/rdev-ops.h  |  27 +++
 net/wireless/trace.h |  55 ++
 7 files changed, 1062 insertions(+), 1 deletion(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9bcaaf7cd15a..fce5c002ebbe 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -,6 +,161 @@ struct cfg80211_qos_map {
 };
 
 /**
+ * struct cfg80211_ftm_target - data for an FTM target (FTM responder)
+ *
+ * @cookie: Extra data for the use of the invoking component. This will be
+ * passed back to the caller in the response, along with the rest of the
+ * request.
+ * @chan_def: target's channel info
+ * @bssid: target's BSSID.
+ * @one_sided: whether to perform a one-sided (flag set) or two-sided (flag
+ * clear) measurement.
+ * @asap: Whether to perform the measurement in ASAP mode. Ignored if 
one-sided.
+ * @lci: Whether to query for LCI in the request. Ignored if one-sided.
+ * @civic: Whether to query for CIVIC in the request. Ignored if one-sided.
+ * @num_of_bursts: number of measurement iterations.
+ * @burst_period: Measurement periodicity in units of 100ms. Ignored if num of
+ * bursts is 1.
+ * @samples_per_burst: Number of measurement frames requested per burst.
+ * @retries: Number of retries per sample.
+ */
+struct cfg80211_ftm_target {
+   u64 cookie;
+   struct cfg80211_chan_def chan_def;
+   u8 bssid[ETH_ALEN];
+   bool one_sided;
+   bool asap;
+   bool lci;
+   bool civic;
+   u16 num_of_bursts;
+   u16 burst_period;
+   u8 samples_per_burst;
+   u8 retries;
+};
+
+/**
+ * struct cfg80211_ftm_request - data for FTM requests
+ *
+ * @report_tsf: if true, report the TSF of the AP to which the vif is
+ * associated. Not relevant if the vif is not associated.
+ * @timeout: Timespan within which measurement should complete. Given in units
+ * of 100ms.
+ * @macaddr_template: Sets the fixed part of a randomized mac address.
+ * @macaddr_mask: Bits set to 1 shall be copied from @macaddr_template. Bits 
set
+ * to 0 shall be randomized by the device.
+ * @num_of_targets: Number of targets (with which to perform a measurement)
+ * contained in this request (see @targets). &num_of_target will not
+ * exceed the value reported for the device in
+ * %NL80211_ATTR_MAX_TOTAL_FTM_TARGETS.
+ * @targets: List of targets with which to perform the measurement. This list 
is
+ * dynamically allocated when the request arrives, and should be released
+ * using kfree by the underlying driver when it is no longer required.
+ * Amongst these targets, the number of 2-sided requests will not exceed
+ * the value reported for the device in
+ * %NL80211_ATTR_MAX_TWO_SIDED_FTM_TARGETS.
+ */
+struct cfg80211_ftm_request {
+   bool report_tsf;
+   u8 timeout;
+   u8 macaddr_template[ETH_ALEN];
+   u8 macaddr_mask[ETH_ALEN];
+   u8 num_of_targets;
+   struct cfg80211_ftm_target *targets;
+};
+
+/**
+ * struct cfg80211_msrment_request - measurement request data
+ *
+ * @type: Type of measurement. Determines the actual type of the union field
+ * below.
+ * @nl_portid: the netlink port used for this request
+ * @u: Data for the specific required measurement type.
+ */
+struct cfg80211_msrment_request {
+   enum nl80211_msrment_type type;
+   u32 nl_portid;
+   union {
+   struct cfg80211_ftm_request ftm;
+   } u;
+};
+
+/**
+ * struct cfg80211_ftm_result - data for an FTM result of a single target
+ *
+ * @status: Status of measurement
+ * @complete: Whether this measurement is the last one expected for this 
target.
+ * This implies that resources associated with this target may be released.
+ * @target: Pointer to the corresponding FTM target given in the request.
+ * @host_time: Time in which:
+ * - in case of error - error was detected
+ * - in case of success - successful measurement started
+ * Given value is in nanoseconds elapsed since host boot time
+ * (referring to CLOCK_BOOTTIME).
+ * Note that this reported value is an estimation of the actual event time,
+ * with expected error of up to 20ms off the actual mark. Underlying
+ * devices must make sure they comply with this limit

[PATCH 4/4] mac80211: add FTM request/response/abort

2015-12-07 Thread Johannes Berg
From: Assaf Krauss 

Add support for requesting an FTM (Fine Timing Measurement),
receiving a notification with its results, and aborting it.
There's no actual implementation as it depends entirely on
low-level device/driver support.

Signed-off-by: Assaf Krauss 
Signed-off-by: Beni Lev 
Signed-off-by: Johannes Berg 
---
 include/net/mac80211.h | 10 +
 net/mac80211/cfg.c | 56 ++
 net/mac80211/ieee80211_i.h |  4 +++-
 net/mac80211/main.c|  3 +++
 4 files changed, 72 insertions(+), 1 deletion(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7c30faff245f..52c6ea752a4a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3269,6 +3269,11 @@ enum ieee80211_reconfig_type {
  * the function call.
  *
  * @wake_tx_queue: Called when new packets have been added to the queue.
+ *
+ * @perform_ftm: Perform a Fine Timing Measurement with the given request
+ * parameters. The given request can only be used within the function call.
+ * @abort_ftm: Abort a Fine Timing Measurement request. The given cookie must
+ * match that of the active FTM request.
  */
 struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -3508,6 +3513,11 @@ struct ieee80211_ops {
 
void (*wake_tx_queue)(struct ieee80211_hw *hw,
  struct ieee80211_txq *txq);
+
+   int (*perform_ftm)(struct ieee80211_hw *hw, u64 cookie,
+  struct ieee80211_vif *vif,
+  struct cfg80211_ftm_request *ftm_req);
+   int (*abort_ftm)(struct ieee80211_hw *hw, u64 cookie);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 2d1c4c35186d..2afaa761cb16 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3322,6 +3322,60 @@ static int ieee80211_del_tx_ts(struct wiphy *wiphy, 
struct net_device *dev,
return -ENOENT;
 }
 
+static u64 ieee80211_msrment_cookie(struct ieee80211_local *local,
+   enum nl80211_msrment_type type)
+{
+   ASSERT_RTNL();
+
+   local->msrment_cookie_counter++;
+   if (local->msrment_cookie_counter == (1ULL << 48))
+   local->msrment_cookie_counter = 1;
+
+   return ((u64)type << 48) | local->msrment_cookie_counter;
+}
+
+static int ieee80211_perform_msrment(struct wiphy *wiphy,
+struct wireless_dev *wdev,
+struct cfg80211_msrment_request *request,
+u64 *cookie)
+{
+   struct ieee80211_local *local = wiphy_priv(wiphy);
+   struct ieee80211_vif *vif = wdev_to_ieee80211_vif(wdev);
+
+   *cookie = ieee80211_msrment_cookie(local, request->type);
+
+   switch (request->type) {
+   case NL80211_MSRMENT_TYPE_FTM:
+   if (!local->ops->perform_ftm)
+   return -EOPNOTSUPP;
+   return local->ops->perform_ftm(&local->hw, *cookie, vif,
+  &request->u.ftm);
+   default:
+   break;
+   }
+
+   return -EOPNOTSUPP;
+}
+
+static int ieee80211_abort_msrment(struct wiphy *wiphy,
+  struct wireless_dev *wdev, u64 cookie)
+{
+   struct ieee80211_local *local = wiphy_priv(wiphy);
+
+   enum nl80211_msrment_type type = cookie >> 48;
+
+   switch (type) {
+   case NL80211_MSRMENT_TYPE_FTM:
+   if (!local->ops->abort_ftm)
+   return -EOPNOTSUPP;
+   return local->ops->abort_ftm(&local->hw, cookie);
+   default:
+   break;
+   }
+
+   return -EOPNOTSUPP;
+}
+
 const struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -3342,6 +3396,8 @@ const struct cfg80211_ops mac80211_config_ops = {
.get_station = ieee80211_get_station,
.dump_station = ieee80211_dump_station,
.dump_survey = ieee80211_dump_survey,
+   .perform_msrment = ieee80211_perform_msrment,
+   .abort_msrment = ieee80211_abort_msrment,
 #ifdef CONFIG_MAC80211_MESH
.add_mpath = ieee80211_add_mpath,
.del_mpath = ieee80211_del_mpath,
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c30b6842ed9f..294aec41fca7 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1347,11 +1347,13 @@ struct ieee80211_local {
struct cfg80211_chan_def monitor_chandef;
 
/* extended capabilities provided by mac80211 */
-   u8 ext_capa[8];
+   u8 ext_capa[9];
 
/* TDLS channel switch */
struct work_struct tdls_chsw_work;
struct sk_buff_head skb_queue_tdls_chsw;
+
+   u64 msrment_cookie_counter;
 };
 
 static inline struct ieee80211_sub_if_data *
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 6bcf0faa4a89..b7fbcecd40ef 100644
--- a/net/

[PATCH 1/4] nl80211: Use specific attributes in nl80211_parse_random_mac

2015-12-07 Thread Johannes Berg
From: Beni Lev 

Instead of passing the whole attributes array, pass specific attributes
for the mac address and the mask.

Signed-off-by: Beni Lev 
Signed-off-by: Johannes Berg 
---
 net/wireless/nl80211.c | 23 +--
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 72de6989dd12..243c6cbc99ab 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5753,12 +5753,13 @@ static int validate_scan_freqs(struct nlattr *freqs)
return n_channels;
 }
 
-static int nl80211_parse_random_mac(struct nlattr **attrs,
+static int nl80211_parse_random_mac(struct nlattr *mac_attr,
+   struct nlattr *mac_mask_attr,
u8 *mac_addr, u8 *mac_addr_mask)
 {
int i;
 
-   if (!attrs[NL80211_ATTR_MAC] && !attrs[NL80211_ATTR_MAC_MASK]) {
+   if (!mac_attr && !mac_mask_attr) {
eth_zero_addr(mac_addr);
eth_zero_addr(mac_addr_mask);
mac_addr[0] = 0x2;
@@ -5768,11 +5769,11 @@ static int nl80211_parse_random_mac(struct nlattr 
**attrs,
}
 
/* need both or none */
-   if (!attrs[NL80211_ATTR_MAC] || !attrs[NL80211_ATTR_MAC_MASK])
+   if (!mac_attr || !mac_mask_attr)
return -EINVAL;
 
-   memcpy(mac_addr, nla_data(attrs[NL80211_ATTR_MAC]), ETH_ALEN);
-   memcpy(mac_addr_mask, nla_data(attrs[NL80211_ATTR_MAC_MASK]), ETH_ALEN);
+   memcpy(mac_addr, nla_data(mac_attr), ETH_ALEN);
+   memcpy(mac_addr_mask, nla_data(mac_mask_attr), ETH_ALEN);
 
/* don't allow or configure an mcast address */
if (!is_multicast_ether_addr(mac_addr_mask) ||
@@ -5980,9 +5981,10 @@ static int nl80211_trigger_scan(struct sk_buff *skb, 
struct genl_info *info)
goto out_free;
}
 
-   err = nl80211_parse_random_mac(info->attrs,
-  request->mac_addr,
-  request->mac_addr_mask);
+   err = nl80211_parse_random_mac(
+   info->attrs[NL80211_ATTR_MAC],
+   info->attrs[NL80211_ATTR_MAC_MASK],
+   request->mac_addr, request->mac_addr_mask);
if (err)
goto out_free;
}
@@ -6416,8 +6418,9 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct 
wireless_dev *wdev,
goto out_free;
}
 
-   err = nl80211_parse_random_mac(attrs, request->mac_addr,
-  request->mac_addr_mask);
+   err = nl80211_parse_random_mac(attrs[NL80211_ATTR_MAC],
+   attrs[NL80211_ATTR_MAC_MASK], request->mac_addr,
+   request->mac_addr_mask);
if (err)
goto out_free;
}
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] ieee80211: add FTM Parameters IE and extended capability

2015-12-07 Thread Johannes Berg
From: Assaf Krauss 

For FTM usage, this patch adds values and definitions for the FTM
Parameters IE, see IEEE 802.11 8.4.2.166 Fine Timing Measurement
Parameters element (in mc Draft only right now.)

Also add the extended capability bit for it.

Signed-off-by: Assaf Krauss 
Signed-off-by: Johannes Berg 
---
 include/linux/ieee80211.h | 85 +++
 1 file changed, 85 insertions(+)

diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 452c0b0d2f32..8262dc2a90ab 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2079,6 +2079,12 @@ enum ieee80211_tdls_actioncode {
 #define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLEDBIT(5)
 #define WLAN_EXT_CAPA8_OPMODE_NOTIFBIT(6)
 
+/*
+ * Fine Timing Measurement Initiator - bit 71 of @WLAN_EID_EXT_CAPABILITY
+ * information element
+ */
+#define WLAN_EXT_CAPA9_FTM_INITIATOR   BIT(7)
+
 /* TDLS specific payload type in the LLC/SNAP header */
 #define WLAN_TDLS_SNAP_RFTYPE  0x2
 
@@ -2319,6 +2325,85 @@ struct ieee80211_tspec_ie {
__le16 medium_time;
 } __packed;
 
+enum ieee80211_ftm_status_indication {
+   IEEE80211_FTM_STATUS_IND_RESERVED = 0,
+   IEEE80211_FTM_STATUS_IND_SUCCESS,
+   IEEE80211_FTM_STATUS_IND_INCAPABLE,
+   IEEE80211_FTM_STATUS_IND_FAILED,
+};
+
+enum ieee80211_ftm_burst_duration {
+   IEEE80211_FTM_BURST_DUR_250_USEC = 2,
+   IEEE80211_FTM_BURST_DUR_500_USEC = 3,
+   IEEE80211_FTM_BURST_DUR_1_MSEC   = 4,
+   IEEE80211_FTM_BURST_DUR_2_MSEC   = 5,
+   IEEE80211_FTM_BURST_DUR_4_MSEC   = 6,
+   IEEE80211_FTM_BURST_DUR_8_MSEC   = 7,
+   IEEE80211_FTM_BURST_DUR_16_MSEC  = 8,
+   IEEE80211_FTM_BURST_DUR_32_MSEC  = 9,
+   IEEE80211_FTM_BURST_DUR_64_MSEC  = 10,
+   IEEE80211_FTM_BURST_DUR_128_MSEC = 11,
+   IEEE80211_FTM_BURST_DUR_NO_PREF  = 15,
+};
+
+enum ieee80211_ftm_format_and_bw {
+   IEEE80211_FTM_FORMAT_BW_NO_PREF   = 0,
+   IEEE80211_FTM_FORMAT_BW_NON_HT_5  = 4,
+   IEEE80211_FTM_FORMAT_BW_NON_HT_10 = 6,
+   IEEE80211_FTM_FORMAT_BW_NON_HT_20 = 8,
+   IEEE80211_FTM_FORMAT_BW_HT_20 = 9,
+   IEEE80211_FTM_FORMAT_BW_VHT_20= 10,
+   IEEE80211_FTM_FORMAT_BW_HT_40 = 11,
+   IEEE80211_FTM_FORMAT_BW_VHT_40= 12,
+   IEEE80211_FTM_FORMAT_BW_VHT_80= 13,
+   IEEE80211_FTM_FORMAT_BW_VHT_80_80 = 14,
+   IEEE80211_FTM_FORMAT_BW_VHT_TWO_RF_LO_160 = 15,
+   IEEE80211_FTM_FORMAT_BW_VHT_ONE_RF_LO_160 = 16,
+   IEEE80211_FTM_FORMAT_BW_DMG_2160  = 31,
+};
+
+/**
+ * struct ieee80211_ftm_params_ie - IEEE802.11 spec definition
+ *
+ * struct defined according to spec's Figure 8-569 - "Fine Timing
+ * Measurement Parameters element format", and Figure 8-570 - "Fine Timing
+ * Measurement Parameters field format"
+ * Note: Spec refers to Draft 802.11REVmc_D4.3 (Oct. 2015)
+ */
+struct ieee80211_ftm_params_ie {
+   u8 element_id;
+   u8 len;
+   u8 status_info;
+   u8 burst_info;
+   u8 min_delta_ftm;
+   __le16 partial_tsf_timer;
+   u8 data1;
+   u8 data2;
+   __le16 burst_period;
+} __packed;
+
+#define IEEE80211_FTM_PARAMS_STATUS_IND_MASK 0x03
+#define IEEE80211_FTM_PARAMS_STATUS_IND_SHIFT 0
+#define IEEE80211_FTM_PARAMS_STATUS_VALUE_MASK 0x7C
+#define IEEE80211_FTM_PARAMS_STATUS_VALUE_SHIFT 2
+
+#define IEEE80211_FTM_PARAMS_BURST_EXPONENT_MASK 0x0F
+#define IEEE80211_FTM_PARAMS_BURST_EXPONENT_SHIFT 0
+#define IEEE80211_FTM_PARAMS_BURST_DURATION_MASK 0xF0
+#define IEEE80211_FTM_PARAMS_BURST_DURATION_SHIFT 4
+
+#define IEEE80211_FTM_PARAMS_DATA1_PARTIAL_TSF_TIMER_NP_MASK 0x01
+#define IEEE80211_FTM_PARAMS_DATA1_PARTIAL_TSF_TIMER_NP_SHIFT 0
+#define IEEE80211_FTM_PARAMS_DATA1_ASAP_CAPABLE_MASK 0x02
+#define IEEE80211_FTM_PARAMS_DATA1_ASAP_CAPABLE_SHIFT 1
+#define IEEE80211_FTM_PARAMS_DATA1_ASAP_MASK 0x04
+#define IEEE80211_FTM_PARAMS_DATA1_ASAP_SHIFT 2
+#define IEEE80211_FTM_PARAMS_DATA1_FTMS_PER_BURST_MASK 0xF8
+#define IEEE80211_FTM_PARAMS_DATA1_FTMS_PER_BURST_SHIFT 3
+
+#define IEEE80211_FTM_PARAMS_DATA2_FORMAT_AND_BW_MASK 0xFC
+#define IEEE80211_FTM_PARAMS_DATA2_FORMAT_AND_BW_SHIFT 2
+
 /**
  * ieee80211_get_qos_ctl - get pointer to qos control bytes
  * @hdr: the frame
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] NFC: added the sysfs entry for nfcsim workqueue delay

2015-12-07 Thread Saurabh Sengar
ping again !!

On 1 December 2015 at 21:10, Saurabh Sengar  wrote:
> pinging for feedback.
> Please respond.
>
> On 20 November 2015 at 16:07, Saurabh Sengar  wrote:
>> I have also tested this module its successfully creating the tx_delay
>> entry in nfc
>>
>> root@saurabh:/home/saurabh# ls /sys/class/nfc/nfc0/tx_delay
>> /sys/class/nfc/nfc0/tx_delay
>>
>> its default value is set to 5
>> root@saurabh:/home/saurabh# cat /sys/class/nfc/nfc0/tx_delay
>> 5
>>
>> its changing the value correctly
>> root@saurabh:/home/saurabh# echo 15 > /sys/class/nfc/nfc0/tx_delay
>> root@saurabh:/home/saurabh# cat /sys/class/nfc/nfc0/tx_delay
>> 15
>>
>> and on removing the module its cleaning up without any oops
>>
>> Tested-by: Saurabh Sengar 
>>
>> On 13 November 2015 at 16:48, Saurabh Sengar  wrote:
>>> added the sysfs entry for nfcsim workqueue delay, as tx_delay
>>>
>>> Signed-off-by: Saurabh Sengar 
>>> ---
>>> implementing the TODO task
>>>
>>>  drivers/nfc/nfcsim.c | 38 +++---
>>>  1 file changed, 35 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/nfc/nfcsim.c b/drivers/nfc/nfcsim.c
>>> index 26ac9e5..e77be35 100644
>>> --- a/drivers/nfc/nfcsim.c
>>> +++ b/drivers/nfc/nfcsim.c
>>> @@ -32,6 +32,8 @@
>>>  #define NFCSIM_POLL_TARGET 2
>>>  #define NFCSIM_POLL_DUAL   (NFCSIM_POLL_INITIATOR | NFCSIM_POLL_TARGET)
>>>
>>> +#define TX_DEFAULT_DELAY   5
>>> +
>>>  struct nfcsim {
>>> struct nfc_dev *nfc_dev;
>>>
>>> @@ -62,12 +64,41 @@ static struct nfcsim *dev1;
>>>
>>>  static struct workqueue_struct *wq;
>>>
>>> +
>>> +static int tx_delay = TX_DEFAULT_DELAY;
>>> +
>>> +static ssize_t show_tx_delay(struct device *dev,
>>> +   struct device_attribute *attr,
>>> +   char *buf)
>>> +{
>>> +   int n;
>>> +
>>> +   n = scnprintf(buf, PAGE_SIZE, "%d\n", tx_delay);
>>> +   return n;
>>> +}
>>> +
>>> +static ssize_t store_tx_delay(struct device *dev,
>>> +   struct device_attribute *attr,
>>> +   const char *buf, size_t count)
>>> +{
>>> +   if (kstrtouint(buf, 0, &tx_delay) < 0)
>>> +   return -EINVAL;
>>> +
>>> +   if (tx_delay < 0)
>>> +   return -EINVAL;
>>> +
>>> +   return count;
>>> +}
>>> +
>>> +static DEVICE_ATTR(tx_delay, 0644, show_tx_delay, store_tx_delay);
>>> +
>>>  static void nfcsim_cleanup_dev(struct nfcsim *dev, u8 shutdown)
>>>  {
>>> DEV_DBG(dev, "shutdown=%d\n", shutdown);
>>>
>>> mutex_lock(&dev->lock);
>>>
>>> +   device_remove_file(&dev->nfc_dev->dev, &dev_attr_tx_delay);
>>> dev->polling_mode = NFCSIM_POLL_NONE;
>>> dev->shutting_down = shutdown;
>>> dev->cb = NULL;
>>> @@ -320,10 +351,8 @@ static int nfcsim_tx(struct nfc_dev *nfc_dev, struct 
>>> nfc_target *target,
>>>  * If packet transmission occurs immediately between them, we have a
>>>  * non-stop flow of several tens of thousands SYMM packets per 
>>> second
>>>  * and a burning cpu.
>>> -*
>>> -* TODO: Add support for a sysfs entry to control this delay.
>>>  */
>>> -   queue_delayed_work(wq, &peer->recv_work, msecs_to_jiffies(5));
>>> +   queue_delayed_work(wq, &peer->recv_work, 
>>> msecs_to_jiffies(tx_delay));
>>>
>>> mutex_unlock(&peer->lock);
>>>
>>> @@ -461,6 +490,9 @@ static struct nfcsim *nfcsim_init_dev(void)
>>> if (rc)
>>> goto free_nfc_dev;
>>>
>>> +   rc = device_create_file(&dev->nfc_dev->dev, &dev_attr_tx_delay);
>>> +   if (rc)
>>> +   pr_err("error creating sysfs entry\n");
>>> return dev;
>>>
>>>  free_nfc_dev:
>>> --
>>> 1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Fixing full name in patchwork

2015-12-07 Thread Sudip Mukherjee
On Mon, Dec 07, 2015 at 08:03:54PM +0200, Kalle Valo wrote:
> Hi Sudip,
> 
> Sudip Mukherjee  writes:
> 
> > We were dereferencing cmd first and checking for NULL later. Lets first
> > check for NULL.
> >
> > Signed-off-by: Sudip Mukherjee 
> 
> I noticed that your name in git log is not your full name:
> 
> commit 0a38c8e1b592c16d959da456f425053e323a5153
> Author: sudip 
> Date:   Tue Nov 24 13:51:38 2015 +0530
> 
> This is because for some reason in patchwork your fullname is just
> "sudip":
> 
> https://patchwork.kernel.org/patch/7688171/
> 
> Could you please fix your name in patchwork so that in the future we can
> use your correct full name? The problem is that I don't know exactly how
> to do this but it should be possible because I remember someone else
> having a similar problem and he was able to fix it.

Hi Kalle,
I have also noticed the patch. Anyway, I have created a profile in
patchwork and given full name. Hopefully that should solve the problem.


regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Fixing full name in patchwork

2015-12-07 Thread Kalle Valo
Sudip Mukherjee  writes:

> On Mon, Dec 07, 2015 at 08:03:54PM +0200, Kalle Valo wrote:
>> Hi Sudip,
>> 
>> Sudip Mukherjee  writes:
>> 
>> > We were dereferencing cmd first and checking for NULL later. Lets first
>> > check for NULL.
>> >
>> > Signed-off-by: Sudip Mukherjee 
>> 
>> I noticed that your name in git log is not your full name:
>> 
>> commit 0a38c8e1b592c16d959da456f425053e323a5153
>> Author: sudip 
>> Date:   Tue Nov 24 13:51:38 2015 +0530
>> 
>> This is because for some reason in patchwork your fullname is just
>> "sudip":
>> 
>> https://patchwork.kernel.org/patch/7688171/
>> 
>> Could you please fix your name in patchwork so that in the future we can
>> use your correct full name? The problem is that I don't know exactly how
>> to do this but it should be possible because I remember someone else
>> having a similar problem and he was able to fix it.
>
> I have also noticed the patch. Anyway, I have created a profile in
> patchwork and given full name. Hopefully that should solve the problem.

At least now your name in the patchwork link above looks correct:

Sudip Mukherjee - Nov. 24, 2015, 8:21 a.m.

Thanks for fixing this.

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC] Documentation: Clarify wording regarding submission of wireless patches to stable

2015-12-07 Thread Kalle Valo
Larry Finger  writes:

> The instructions for submitting patches state that changes destined for
> networking should not be marked with a Cc to stable. This restriction does
> not apply to the wireless portion of networking. The instructions are
> updated to clarify this case.
>
> Signed-off-by: Larry Finger 
> ---
>
> Kalle,
>
> Is this change clear, and strong enough?

Looks good to me, thanks!

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html