Re: Warnings/errors in use with a QCA989x card

2015-06-04 Thread Michal Kazior
On 5 June 2015 at 03:52, Matthew Robbetts  wrote:
> Hi all,
>
> I’m sorry if the answer to this question is well known; my Google-fu is 
> failing me in that case. My situation is as follows:
>
> 
>
> I recently bought a Doodle Labs ACE-DB-3 miniPCIe card for use as a wireless 
> access point in my linux router (A HP microserver, running Gentoo Linux, with 
> a 4.0.4-hardened kernel. No PaX/GrSecurity features are enabled in my build 
> of this kernel).
>
> Everything is set up and appears to work as expected. However, after a day or 
> two of hostapd uptime, I see the below sorts of stuff in my dmesg. If left, 
> this will happen a number of times, and eventually no wifi devices will be 
> able to connect anymore.
>
> Restarting hostapd appears to reinitialize everything satisfactorily — but of 
> course this happens again within another day or so.
>
> As I said, I am running the 4.0.4 kernel, along with 10.2.4.48 from kvalo’s 
> GitHub repo.
>
> Am I doing something stupid with this card?
>
>
> Thanks!
> Matt
>
> 
>
> [Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:04 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:04 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:04 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:04 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
> skipped old beacon
> [Thu Jun  4 11:07:06 2015] [ cut here ]
> [Thu Jun  4 11:07:06 2015] WARNING: CPU: 1 PID: 3517 at 
> net/mac80211/sta_info.c:917 __sta_info_destroy_part2+0xd6/0x13f()
> [Thu Jun  4 11:07:06 2015] Modules linked in: zfs(PO) zunicode(PO) 
> zcommon(PO) znvpair(PO) spl(O) zavl(PO)
> [Thu Jun  4 11:07:06 2015] CPU: 1 PID: 3517 Comm: hostapd Tainted: P  
>  O4.0.4-hardened-r1 #6
> [Thu Jun  4 11:07:06 2015] Hardware name: HP ProLiant MicroServer, BIOS O41   
>   07/29/2011
> [Thu Jun  4 11:07:06 2015]  0009 8803f878f578 
> 8177ab11 003c
> [Thu Jun  4 11:07:06 2015]   8803f878f5b8 
> 8103cd21 0001
> [Thu Jun  4 11:07:06 2015]  81732b5c 880344f0b000 
> 88040cb9c680 88040c1928c0
> [Thu Jun  4 11:07:06 2015] Call Trace:
> [Thu Jun  4 11:07:06 2015]  [] dump_stack+0x45/0x57
> [Thu Jun  4 11:07:06 2015]  [] 
> warn_slowpath_common+0x9c/0xb6
> [Thu Jun  4 11:07:06 2015]  [] ? 
> __sta_info_destroy_part2+0xd6/0x13f
> [Thu Jun  4 11:07:06 2015]  [] warn_slowpath_null+0x15/0x17
> [Thu Jun  4 11:07:06 2015]  [] 
> __sta_info_destroy_part2+0xd6/0x13f
> [Thu Jun  4 11:07:06 2015]  [] __sta_info_destroy+0x25/0x2f
> [Thu Jun  4 11:07:06 2015]  [] 
> sta_info_destroy_addr_bss+0x37/0x57
> [Thu Jun  4 11:07:06 2015]  [] 
> ieee80211_del_station+0x18/0x25
> [Thu Jun  4 11:07:06 2015]  [] 
> nl80211_del_station+0xd7/0x11f
> [Thu Jun  4 11:07:06 2015]  [] 
> genl_family_rcv_msg+0x246/0x2b8
> [Thu Jun  4 11:07:06 2015]  [] genl_rcv_msg+0x3d/0x60
> [Thu Jun  4 11:07:06 2015]  [] ? 
> genl_family_rcv_msg+0x2b8/0x2b8
> [Thu Jun  4 11:07:06 2015]  [] netlink_rcv_skb+0x45/0x88
> [Thu Jun  4 11:07:06 2015]  [] genl_rcv+0x24/0x34
> [Thu Jun  4 11:07:06 2015]  [] netlink_unicast+0x104/0x18b
> [Thu Jun  4 11:07:06 2015]  [] netlink_sendmsg+0x2fb/0x319
> [Thu Jun  4 11:07:06 2015]  [] ? copy_from_user+0xba/0xe2
> [Thu Jun  4 11:07:06 2015]  [] __sock_sendmsg+0x42/0x4d
> [Thu Jun  4 11:07:06 2015]  [] sock_sendmsg+0x37/0x49
> [Thu Jun  4 11:07:06 2015]  [] ___sys_sendmsg+0x1d9/0x268
> [Thu Jun  4 11:07:06 2015]  [] ? move_addr_to_user+0x51/0x67
> [Thu Jun  4 11:07:06 2015]  [] ? ___sys_recvmsg+0x14b/0x1be
> [Thu Jun  4 11:07:06 2015]  [] ? 
> sock_destroy_inode+0x2b/0x2f
> [Thu Jun  4 11:07:06 2015]  [] ? sockfs_dname+0x1c/0x1c
> [Thu Jun  4 11:07:06 2015]  [] ? destroy_inode+0x36/0x4f
> [Thu Jun  4 11:07:06 2015]  [] ? kmem_cache_free+0x49/0xd5
> [Thu Jun  4 11:07:06 2015]  [] ? __fget_light+0x27/0x48
> [Thu Jun  4 11:07:06 2015]  [] __sys_sendmsg+0x3d/0x5b
> [Thu Jun  4 11:07:06 2015]  [] SyS_sendmsg+0xd/0x17
> [Thu Jun  4 11:07:06 2015]  [] 
> system_call_fastpath+0x12/0x17
> [Thu Jun  4 11:07:0

Warnings/errors in use with a QCA989x card

2015-06-04 Thread Matthew Robbetts
Hi all,

I’m sorry if the answer to this question is well known; my Google-fu is failing 
me in that case. My situation is as follows:



I recently bought a Doodle Labs ACE-DB-3 miniPCIe card for use as a wireless 
access point in my linux router (A HP microserver, running Gentoo Linux, with a 
4.0.4-hardened kernel. No PaX/GrSecurity features are enabled in my build of 
this kernel).

Everything is set up and appears to work as expected. However, after a day or 
two of hostapd uptime, I see the below sorts of stuff in my dmesg. If left, 
this will happen a number of times, and eventually no wifi devices will be able 
to connect anymore.

Restarting hostapd appears to reinitialize everything satisfactorily — but of 
course this happens again within another day or so.

As I said, I am running the 4.0.4 kernel, along with 10.2.4.48 from kvalo’s 
GitHub repo.

Am I doing something stupid with this card?


Thanks!
Matt



[Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:03 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:04 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:04 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:04 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:04 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:06 2015] [ cut here ]
[Thu Jun  4 11:07:06 2015] WARNING: CPU: 1 PID: 3517 at 
net/mac80211/sta_info.c:917 __sta_info_destroy_part2+0xd6/0x13f()
[Thu Jun  4 11:07:06 2015] Modules linked in: zfs(PO) zunicode(PO) zcommon(PO) 
znvpair(PO) spl(O) zavl(PO)
[Thu Jun  4 11:07:06 2015] CPU: 1 PID: 3517 Comm: hostapd Tainted: P   
O4.0.4-hardened-r1 #6
[Thu Jun  4 11:07:06 2015] Hardware name: HP ProLiant MicroServer, BIOS O41 
07/29/2011
[Thu Jun  4 11:07:06 2015]  0009 8803f878f578 8177ab11 
003c
[Thu Jun  4 11:07:06 2015]   8803f878f5b8 8103cd21 
0001
[Thu Jun  4 11:07:06 2015]  81732b5c 880344f0b000 88040cb9c680 
88040c1928c0
[Thu Jun  4 11:07:06 2015] Call Trace:
[Thu Jun  4 11:07:06 2015]  [] dump_stack+0x45/0x57
[Thu Jun  4 11:07:06 2015]  [] warn_slowpath_common+0x9c/0xb6
[Thu Jun  4 11:07:06 2015]  [] ? 
__sta_info_destroy_part2+0xd6/0x13f
[Thu Jun  4 11:07:06 2015]  [] warn_slowpath_null+0x15/0x17
[Thu Jun  4 11:07:06 2015]  [] 
__sta_info_destroy_part2+0xd6/0x13f
[Thu Jun  4 11:07:06 2015]  [] __sta_info_destroy+0x25/0x2f
[Thu Jun  4 11:07:06 2015]  [] 
sta_info_destroy_addr_bss+0x37/0x57
[Thu Jun  4 11:07:06 2015]  [] ieee80211_del_station+0x18/0x25
[Thu Jun  4 11:07:06 2015]  [] nl80211_del_station+0xd7/0x11f
[Thu Jun  4 11:07:06 2015]  [] genl_family_rcv_msg+0x246/0x2b8
[Thu Jun  4 11:07:06 2015]  [] genl_rcv_msg+0x3d/0x60
[Thu Jun  4 11:07:06 2015]  [] ? 
genl_family_rcv_msg+0x2b8/0x2b8
[Thu Jun  4 11:07:06 2015]  [] netlink_rcv_skb+0x45/0x88
[Thu Jun  4 11:07:06 2015]  [] genl_rcv+0x24/0x34
[Thu Jun  4 11:07:06 2015]  [] netlink_unicast+0x104/0x18b
[Thu Jun  4 11:07:06 2015]  [] netlink_sendmsg+0x2fb/0x319
[Thu Jun  4 11:07:06 2015]  [] ? copy_from_user+0xba/0xe2
[Thu Jun  4 11:07:06 2015]  [] __sock_sendmsg+0x42/0x4d
[Thu Jun  4 11:07:06 2015]  [] sock_sendmsg+0x37/0x49
[Thu Jun  4 11:07:06 2015]  [] ___sys_sendmsg+0x1d9/0x268
[Thu Jun  4 11:07:06 2015]  [] ? move_addr_to_user+0x51/0x67
[Thu Jun  4 11:07:06 2015]  [] ? ___sys_recvmsg+0x14b/0x1be
[Thu Jun  4 11:07:06 2015]  [] ? sock_destroy_inode+0x2b/0x2f
[Thu Jun  4 11:07:06 2015]  [] ? sockfs_dname+0x1c/0x1c
[Thu Jun  4 11:07:06 2015]  [] ? destroy_inode+0x36/0x4f
[Thu Jun  4 11:07:06 2015]  [] ? kmem_cache_free+0x49/0xd5
[Thu Jun  4 11:07:06 2015]  [] ? __fget_light+0x27/0x48
[Thu Jun  4 11:07:06 2015]  [] __sys_sendmsg+0x3d/0x5b
[Thu Jun  4 11:07:06 2015]  [] SyS_sendmsg+0xd/0x17
[Thu Jun  4 11:07:06 2015]  [] system_call_fastpath+0x12/0x17
[Thu Jun  4 11:07:06 2015] ---[ end trace e4f43c81ea50a3f3 ]---
[Thu Jun  4 11:07:08 2015] ath10k_warn: 40 callbacks suppressed
[Thu Jun  4 11:07:08 2015] ath10k_pci :02:00.0: SWBA overrun on vdev 0, 
skipped old beacon
[Thu Jun  4 11:07:08 2015] ath10k_pci :02:00.0: SWBA

Re: [PATCH] ath10k: new debugfs interface to enable adaptive CCA

2015-06-04 Thread Ben Greear
Is there any way to make this work on a 10.1 firmware, even if that means
manually poking registers through debugfs?

I have a user of CT firmware that would really like Adaptive CCA to
work, so if I can just get some clues as to what needs setting,
I can write up an API that works with my 10.1 firmware...

Thanks,
Ben


On 05/10/2015 11:05 PM, Michal Kazior wrote:
> On 8 May 2015 at 16:01,   wrote:
>> From: Manikanta Pubbisetty 
>>
>> For devices working in 2.4 GHz to be ETSI compliant,
>> it is required to support adaptive CCA. Some firmwares
>> support adaptive CCA and is disabled by default.
>>
>> The patch is an attempt to add a new debugfs interface to enable
>> adaptive cca on supported firmwares. Support for this feature is
>> advertised with a new firmware feature flag.
> 
> I guess this should be configured automatically depending on DFS
> domain. You can't expect users to configure their devices via debugfs,
> can you? This should just work.


-- 
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com


___
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k


Re: QCA6174 hw2.1 firmware, take two?

2015-06-04 Thread Jason H
Glad to see I'm not the only one with this card!

What are the blockages to getting this properly supported? I figure he kernel 
patch has to work it's way though the maintainers, but are there any 
restrictions with publishing the firmware for the linux driver?


> Sent: Thursday, June 04, 2015 at 1:22 PM
> From: "Enrico Tagliavini" 
> To: ath10k@lists.infradead.org
> Subject: Re: QCA6174 hw2.1 firmware, take two?
>
> Hi again,
> 
> ok this was dumb I forgot to assemble back the firmware and I
> realized it just after sending out the previous email (that's why the
> driver was complaining about the invalid magic).
> 
> Sorry for the noise, I apologize.
> 
> Hope to see this fixed in upstream Linux kernel soon.
> 
> Best regards.
> 
> Enrico.
> 
> 
> P.S.: this is another Alienware 15 like Gabriele's. I think they all
> ship with such a WiFi. Just pointing it out since Dell now is even
> shyly suggesting to try out Linux
> https://twitter.com/DellCaresPRO/status/603780236531081216 (not on
> Alienware, but still...)
> 
> On 4 June 2015 at 19:03, Enrico Tagliavini  
> wrote:
> > Hi there,
> >
> > Just got the following device
> >
> > enrico@alientux ~ $ lspci -nn | grep QCA
> > 03:00.0 Network controller [0280]: Qualcomm Atheros QCA6174 802.11ac
> > Wireless Network Adapter [168c:003e] (rev 20)
> >
> > And discovered there is no firmware available for it. I looked already
> > at the April thread about it, but didn't managed to get it working.
> > This is on Fedora 22, kernel 4.0.4.
> >
> > I used dissect.py from here
> > https://gist.github.com/kazikcz/8e5845ad84ca251aa295 to generate the
> > firmware image from my Windows installation:
> > $ cat 
> > /windows/Windows/System32/DriverStore/FileRepository/netathrx.inf_amd64_481f6e2b133b287d/qca61x420.bin
> > | ./dissect.py
> >
> > but I have no clue if that is actually the correct file. For sure it's
> > the only one containing "qca" end ending in ".bin" alongside
> > eeprom_qca9377_1p0_NFA435_olpc.bin which I used as board.bin.
> >
> > Unfortunately when trying those I get
> > root@alientux ~ # dmesg | grep ath
> > [   18.518677] ath10k_pci :03:00.0: enabling device ( -> 0002)
> > [   18.519124] ath10k_pci :03:00.0: pci irq msi-x interrupts 8
> > irq_mode 0 reset_mode 0
> > [   18.667191] ath10k_pci :03:00.0: Direct firmware load for
> > ath10k/cal-pci-:03:00.0.bin failed with error -2
> > [   18.668652] ath10k_pci :03:00.0: invalid firmware magic
> > [   18.668791] ath10k_pci :03:00.0: invalid firmware magic
> > [   18.670086] ath10k_pci :03:00.0: invalid firmware magic
> > [   18.670265] ath10k_pci :03:00.0: Direct firmware load for
> > ath10k/QCA6174/hw2.1/firmware.bin failed with error -2
> > [   18.670267] ath10k_pci :03:00.0: could not fetch firmware (-2)
> > [   18.670269] ath10k_pci :03:00.0: could not fetch firmware files (-2)
> > [   18.670271] ath10k_pci :03:00.0: could not probe fw (-2)
> >
> > No idea where to go from here. I'm currently not sure if I want to try
> > kvalo sources. Don't get me wrong but if I have to apply a patch to
> > the official Linux source tree that's ok, but switching to the
> > development tree is not what I was looking forward for this machine.
> > Can 4.1 help instead? I'm afraid it might now since I can see the fix
> > for the firmware crash is still not included.
> >
> > Thank you for the help.
> > Best regards.
> >
> > Enrico
> 
> ___
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k
> 

___
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k


Re: [PATCH v2] ath10k: add cryptmode param to support sw crypto and raw tx injection.

2015-06-04 Thread Liu CF/TW
Kalle et al. Please ignore this patch and review the new email with
subject line changed with [PATCH V2] highlighted. Looks like only by
doing so would it start a new thread in the ML.
That patch is exactly the same as the last one in this thread. I
updated the commit message with more testing details.


On Wed, Jun 3, 2015 at 6:56 PM, David Liu  wrote:
> This change supports bypassing HW crypto engine by enabling raw Rx/Tx mode.
> This will enable use cases such as sw crypto and raw tx injection.
> This change introduces a new module param 'cryptmode'.
>
> cryptmode:
>
>  0Use HW crypto engine. Use native WiFi mode Tx/Rx encap
>
>  1Use SW crypto engine. Use raw mode Tx/Rx encap
>
>  2Supports both SW & HW crypto engine. Use raw mode Tx/Rx encap.
>
> Testing: used QCA988x hw 2.0 with 10.2.4.13-2 firmware with backports-20150424
>
>  ath10k
>  cryptmode
>  param  Testing Status
>  ----
> 0   HW CCMP tested ok.
> Note: HW crypto bypass not supported by ath10k hw in native WiFi
> mode.
>
> 1   - mac80211 SW crypto tested ok.
> - raw Tx frame injection tested ok.
>
> 2   HW CCMP tested ok.
> SW CCMP tested ok.
> Tested raw Tx encrypted frame injection ok.
>
> Signed-off-by: David Liu 
> ---
>  drivers/net/wireless/ath/ath10k/core.c   | 29 +
>  drivers/net/wireless/ath/ath10k/core.h   | 29 +++--
>  drivers/net/wireless/ath/ath10k/htt_rx.c |  5 ++-
>  drivers/net/wireless/ath/ath10k/htt_tx.c |  9 +-
>  drivers/net/wireless/ath/ath10k/mac.c| 53 
> +++-
>  drivers/net/wireless/ath/ath10k/wmi.c|  4 ++-
>  6 files changed, 114 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c 
> b/drivers/net/wireless/ath/ath10k/core.c
> index 59496a9..a81c7a7 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -31,16 +31,19 @@
>  #include "wmi-ops.h"
>
>  unsigned int ath10k_debug_mask;
> +unsigned int ath10k_cryptmode_param;
>  static bool uart_print;
>  static bool skip_otp;
>
>  module_param_named(debug_mask, ath10k_debug_mask, uint, 0644);
> +module_param_named(cryptmode, ath10k_cryptmode_param, uint, 0644);
>  module_param(uart_print, bool, 0644);
>  module_param(skip_otp, bool, 0644);
>
>  MODULE_PARM_DESC(debug_mask, "Debugging mask");
>  MODULE_PARM_DESC(uart_print, "Uart target debugging");
>  MODULE_PARM_DESC(skip_otp, "Skip otp failure for calibration in testmode");
> +MODULE_PARM_DESC(cryptmode, "Crypto mode - 0: HW only, 1: SW only, 2:Both");
>
>  static const struct ath10k_hw_params ath10k_hw_params_list[] = {
> {
> @@ -991,6 +994,32 @@ static int ath10k_core_init_firmware_features(struct 
> ath10k *ar)
> return -EINVAL;
> }
>
> +   switch (ath10k_cryptmode_param) {
> +   case ATH10K_CRYPT_MODE_HW:
> +   clear_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags);
> +   clear_bit(ATH10K_FLAG_HW_CRYPTO_DISABLED, &ar->dev_flags);
> +   break;
> +   case ATH10K_CRYPT_MODE_SW:
> +   case ATH10K_CRYPT_MODE_HW_SW:
> +   if (!test_bit(ATH10K_FW_FEATURE_RAW_MODE_SUPPORT,
> + ar->fw_features)) {
> +   ath10k_err(ar, "cryptmode > 0 requires raw mode 
> support from firmware");
> +   return -EINVAL;
> +   }
> +
> +   set_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags);
> +
> +   if (ath10k_cryptmode_param == ATH10K_CRYPT_MODE_SW) {
> +   set_bit(ATH10K_FLAG_HW_CRYPTO_DISABLED, 
> &ar->dev_flags);
> +   }
> +   break;
> +   default:
> +   ath10k_info(ar, "invalid cryptmode: %d\n",
> +   ath10k_cryptmode_param);
> +   return -EINVAL;
> +   }
> +   ath10k_info(ar, "cryptmode: %d\n", ath10k_cryptmode_param);
> +
> /* Backwards compatibility for firmwares without
>  * ATH10K_FW_IE_WMI_OP_VERSION.
>  */
> diff --git a/drivers/net/wireless/ath/ath10k/core.h 
> b/drivers/net/wireless/ath/ath10k/core.h
> index 45f9603..38606e7 100644
> --- a/drivers/net/wireless/ath/ath10k/core.h
> +++ b/drivers/net/wireless/ath/ath10k/core.h
> @@ -91,6 +91,7 @@ struct ath10k_skb_cb {
> u8 tid;
> u16 freq;
> bool is_offchan;
> +   bool nohwcrypt;
> struct ath10k_htt_txbuf *txbuf;
> u32 txbuf_paddr;
> } __packed htt;
> @@ -349,6 +350,7 @@ struct ath10k_vif {
> } u;
>
> bool use_cts_prot;
> +   bool nohwcrypt;
> int num_legacy_stations;
> int txpower;
> struct wmi_wmm_params_all_arg wmm_params;
> @@ -461,16 +463,21 @@ enum ath10k_fw_features {
> ATH10K_FW_FEATURE_WOWLAN_SUPPORT = 6,
>
> /* Don't trust

[PATCH V2] ath10k: add 'cryptmode' param to support raw tx injection and sw crypto.

2015-06-04 Thread Liu CF/TW
This change supports bypassing HW crypto engine by enabling raw Rx/Tx mode.
This will enable use cases such as sw crypto and raw tx injection.
This change introduces a new module param 'cryptmode'.

cryptmode:

 0Use HW crypto engine. Use native WiFi mode Tx/Rx encap

 1Use SW crypto engine. Use raw mode Tx/Rx encap

 2Supports both SW & HW crypto engine. Use raw mode Tx/Rx encap.

Testing: used QCA988x hw 2.0 with firmware-4.bin_10.2.4.48 with 
backports-20150424
(Skipped ATH10K_FW_FEATURE_RAW_MODE_SUPPORT check in core.c within this patch. 
 Since none of the existing QCA official firmware has the feature bit set yet)

 ath10k
 cryptmode
 param  Testing Status
 ----
0   HW CCMP/TKIP tested ok.
Note: HW crypto bypass not supported by ath10k hw in native WiFi
mode.

1   - mac80211 SW crypto tested ok.
- raw Tx frame injection tested ok.

2   HW CCMP/TKIP tested ok.
SW CCMP/TKIP tested ok.
Tested raw Tx encrypted frame injection ok.

Signed-off-by: Liu CF/TW 
---
 drivers/net/wireless/ath/ath10k/core.c   | 29 +
 drivers/net/wireless/ath/ath10k/core.h   | 29 +++--
 drivers/net/wireless/ath/ath10k/htt_rx.c |  5 ++-
 drivers/net/wireless/ath/ath10k/htt_tx.c |  9 +-
 drivers/net/wireless/ath/ath10k/mac.c| 53 +++-
 drivers/net/wireless/ath/ath10k/wmi.c|  4 ++-
 6 files changed, 114 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index 59496a9..a81c7a7 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -31,16 +31,19 @@
 #include "wmi-ops.h"
 
 unsigned int ath10k_debug_mask;
+unsigned int ath10k_cryptmode_param;
 static bool uart_print;
 static bool skip_otp;
 
 module_param_named(debug_mask, ath10k_debug_mask, uint, 0644);
+module_param_named(cryptmode, ath10k_cryptmode_param, uint, 0644);
 module_param(uart_print, bool, 0644);
 module_param(skip_otp, bool, 0644);
 
 MODULE_PARM_DESC(debug_mask, "Debugging mask");
 MODULE_PARM_DESC(uart_print, "Uart target debugging");
 MODULE_PARM_DESC(skip_otp, "Skip otp failure for calibration in testmode");
+MODULE_PARM_DESC(cryptmode, "Crypto mode - 0: HW only, 1: SW only, 2:Both");
 
 static const struct ath10k_hw_params ath10k_hw_params_list[] = {
{
@@ -991,6 +994,32 @@ static int ath10k_core_init_firmware_features(struct 
ath10k *ar)
return -EINVAL;
}
 
+   switch (ath10k_cryptmode_param) {
+   case ATH10K_CRYPT_MODE_HW:
+   clear_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags);
+   clear_bit(ATH10K_FLAG_HW_CRYPTO_DISABLED, &ar->dev_flags);
+   break;
+   case ATH10K_CRYPT_MODE_SW:
+   case ATH10K_CRYPT_MODE_HW_SW:
+   if (!test_bit(ATH10K_FW_FEATURE_RAW_MODE_SUPPORT,
+ ar->fw_features)) {
+   ath10k_err(ar, "cryptmode > 0 requires raw mode support 
from firmware");
+   return -EINVAL;
+   }
+
+   set_bit(ATH10K_FLAG_RAW_MODE, &ar->dev_flags);
+
+   if (ath10k_cryptmode_param == ATH10K_CRYPT_MODE_SW) {
+   set_bit(ATH10K_FLAG_HW_CRYPTO_DISABLED, &ar->dev_flags);
+   }
+   break;
+   default:
+   ath10k_info(ar, "invalid cryptmode: %d\n",
+   ath10k_cryptmode_param);
+   return -EINVAL;
+   }
+   ath10k_info(ar, "cryptmode: %d\n", ath10k_cryptmode_param);
+
/* Backwards compatibility for firmwares without
 * ATH10K_FW_IE_WMI_OP_VERSION.
 */
diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index 45f9603..38606e7 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -91,6 +91,7 @@ struct ath10k_skb_cb {
u8 tid;
u16 freq;
bool is_offchan;
+   bool nohwcrypt;
struct ath10k_htt_txbuf *txbuf;
u32 txbuf_paddr;
} __packed htt;
@@ -349,6 +350,7 @@ struct ath10k_vif {
} u;
 
bool use_cts_prot;
+   bool nohwcrypt;
int num_legacy_stations;
int txpower;
struct wmi_wmm_params_all_arg wmm_params;
@@ -461,16 +463,21 @@ enum ath10k_fw_features {
ATH10K_FW_FEATURE_WOWLAN_SUPPORT = 6,
 
/* Don't trust error code from otp.bin */
-   ATH10K_FW_FEATURE_IGNORE_OTP_RESULT,
+   ATH10K_FW_FEATURE_IGNORE_OTP_RESULT = 7,
 
/* Some firmware revisions pad 4th hw address to 4 byte boundary making
 * it 8 bytes long in Native Wifi Rx decap.
 */
-   ATH10K_FW_FEATURE_NO_NWIFI_DECAP_4ADDR_PADDING,
+   ATH10K_FW_FEATURE_NO_NWIFI_DECAP_4ADDR_PADDING = 8,
 
/* Firmware s

Re: QCA6174 hw2.1 firmware, take two?

2015-06-04 Thread Enrico Tagliavini
Hi again,

ok this was dumb I forgot to assemble back the firmware and I
realized it just after sending out the previous email (that's why the
driver was complaining about the invalid magic).

Sorry for the noise, I apologize.

Hope to see this fixed in upstream Linux kernel soon.

Best regards.

Enrico.


P.S.: this is another Alienware 15 like Gabriele's. I think they all
ship with such a WiFi. Just pointing it out since Dell now is even
shyly suggesting to try out Linux
https://twitter.com/DellCaresPRO/status/603780236531081216 (not on
Alienware, but still...)

On 4 June 2015 at 19:03, Enrico Tagliavini  wrote:
> Hi there,
>
> Just got the following device
>
> enrico@alientux ~ $ lspci -nn | grep QCA
> 03:00.0 Network controller [0280]: Qualcomm Atheros QCA6174 802.11ac
> Wireless Network Adapter [168c:003e] (rev 20)
>
> And discovered there is no firmware available for it. I looked already
> at the April thread about it, but didn't managed to get it working.
> This is on Fedora 22, kernel 4.0.4.
>
> I used dissect.py from here
> https://gist.github.com/kazikcz/8e5845ad84ca251aa295 to generate the
> firmware image from my Windows installation:
> $ cat 
> /windows/Windows/System32/DriverStore/FileRepository/netathrx.inf_amd64_481f6e2b133b287d/qca61x420.bin
> | ./dissect.py
>
> but I have no clue if that is actually the correct file. For sure it's
> the only one containing "qca" end ending in ".bin" alongside
> eeprom_qca9377_1p0_NFA435_olpc.bin which I used as board.bin.
>
> Unfortunately when trying those I get
> root@alientux ~ # dmesg | grep ath
> [   18.518677] ath10k_pci :03:00.0: enabling device ( -> 0002)
> [   18.519124] ath10k_pci :03:00.0: pci irq msi-x interrupts 8
> irq_mode 0 reset_mode 0
> [   18.667191] ath10k_pci :03:00.0: Direct firmware load for
> ath10k/cal-pci-:03:00.0.bin failed with error -2
> [   18.668652] ath10k_pci :03:00.0: invalid firmware magic
> [   18.668791] ath10k_pci :03:00.0: invalid firmware magic
> [   18.670086] ath10k_pci :03:00.0: invalid firmware magic
> [   18.670265] ath10k_pci :03:00.0: Direct firmware load for
> ath10k/QCA6174/hw2.1/firmware.bin failed with error -2
> [   18.670267] ath10k_pci :03:00.0: could not fetch firmware (-2)
> [   18.670269] ath10k_pci :03:00.0: could not fetch firmware files (-2)
> [   18.670271] ath10k_pci :03:00.0: could not probe fw (-2)
>
> No idea where to go from here. I'm currently not sure if I want to try
> kvalo sources. Don't get me wrong but if I have to apply a patch to
> the official Linux source tree that's ok, but switching to the
> development tree is not what I was looking forward for this machine.
> Can 4.1 help instead? I'm afraid it might now since I can see the fix
> for the firmware crash is still not included.
>
> Thank you for the help.
> Best regards.
>
> Enrico

___
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k


Re: QCA6174 hw2.1 firmware, take two?

2015-06-04 Thread Adrian Chadd
hi,

It's beeliner - they went and .. "changed" how they're doing firmware
releases and the firmware API. It's hopefully going to be more
structured and backwards-compatible. this time.

I don't know if/when there are plans for beeliner ath10k support. I'm
still trying to get the QCA988x firmware building for me so I can jump
back into development there.

Does anyone know more about plans for supporting beeliner and the
updated firmware APIs?




-adrian


On 4 June 2015 at 10:03, Enrico Tagliavini  wrote:
> Hi there,
>
> Just got the following device
>
> enrico@alientux ~ $ lspci -nn | grep QCA
> 03:00.0 Network controller [0280]: Qualcomm Atheros QCA6174 802.11ac
> Wireless Network Adapter [168c:003e] (rev 20)
>
> And discovered there is no firmware available for it. I looked already
> at the April thread about it, but didn't managed to get it working.
> This is on Fedora 22, kernel 4.0.4.
>
> I used dissect.py from here
> https://gist.github.com/kazikcz/8e5845ad84ca251aa295 to generate the
> firmware image from my Windows installation:
> $ cat 
> /windows/Windows/System32/DriverStore/FileRepository/netathrx.inf_amd64_481f6e2b133b287d/qca61x420.bin
> | ./dissect.py
>
> but I have no clue if that is actually the correct file. For sure it's
> the only one containing "qca" end ending in ".bin" alongside
> eeprom_qca9377_1p0_NFA435_olpc.bin which I used as board.bin.
>
> Unfortunately when trying those I get
> root@alientux ~ # dmesg | grep ath
> [   18.518677] ath10k_pci :03:00.0: enabling device ( -> 0002)
> [   18.519124] ath10k_pci :03:00.0: pci irq msi-x interrupts 8
> irq_mode 0 reset_mode 0
> [   18.667191] ath10k_pci :03:00.0: Direct firmware load for
> ath10k/cal-pci-:03:00.0.bin failed with error -2
> [   18.668652] ath10k_pci :03:00.0: invalid firmware magic
> [   18.668791] ath10k_pci :03:00.0: invalid firmware magic
> [   18.670086] ath10k_pci :03:00.0: invalid firmware magic
> [   18.670265] ath10k_pci :03:00.0: Direct firmware load for
> ath10k/QCA6174/hw2.1/firmware.bin failed with error -2
> [   18.670267] ath10k_pci :03:00.0: could not fetch firmware (-2)
> [   18.670269] ath10k_pci :03:00.0: could not fetch firmware files (-2)
> [   18.670271] ath10k_pci :03:00.0: could not probe fw (-2)
>
> No idea where to go from here. I'm currently not sure if I want to try
> kvalo sources. Don't get me wrong but if I have to apply a patch to
> the official Linux source tree that's ok, but switching to the
> development tree is not what I was looking forward for this machine.
> Can 4.1 help instead? I'm afraid it might now since I can see the fix
> for the firmware crash is still not included.
>
> Thank you for the help.
> Best regards.
>
> Enrico
>
> ___
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k

___
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k


QCA6174 hw2.1 firmware, take two?

2015-06-04 Thread Enrico Tagliavini
Hi there,

Just got the following device

enrico@alientux ~ $ lspci -nn | grep QCA
03:00.0 Network controller [0280]: Qualcomm Atheros QCA6174 802.11ac
Wireless Network Adapter [168c:003e] (rev 20)

And discovered there is no firmware available for it. I looked already
at the April thread about it, but didn't managed to get it working.
This is on Fedora 22, kernel 4.0.4.

I used dissect.py from here
https://gist.github.com/kazikcz/8e5845ad84ca251aa295 to generate the
firmware image from my Windows installation:
$ cat 
/windows/Windows/System32/DriverStore/FileRepository/netathrx.inf_amd64_481f6e2b133b287d/qca61x420.bin
| ./dissect.py

but I have no clue if that is actually the correct file. For sure it's
the only one containing "qca" end ending in ".bin" alongside
eeprom_qca9377_1p0_NFA435_olpc.bin which I used as board.bin.

Unfortunately when trying those I get
root@alientux ~ # dmesg | grep ath
[   18.518677] ath10k_pci :03:00.0: enabling device ( -> 0002)
[   18.519124] ath10k_pci :03:00.0: pci irq msi-x interrupts 8
irq_mode 0 reset_mode 0
[   18.667191] ath10k_pci :03:00.0: Direct firmware load for
ath10k/cal-pci-:03:00.0.bin failed with error -2
[   18.668652] ath10k_pci :03:00.0: invalid firmware magic
[   18.668791] ath10k_pci :03:00.0: invalid firmware magic
[   18.670086] ath10k_pci :03:00.0: invalid firmware magic
[   18.670265] ath10k_pci :03:00.0: Direct firmware load for
ath10k/QCA6174/hw2.1/firmware.bin failed with error -2
[   18.670267] ath10k_pci :03:00.0: could not fetch firmware (-2)
[   18.670269] ath10k_pci :03:00.0: could not fetch firmware files (-2)
[   18.670271] ath10k_pci :03:00.0: could not probe fw (-2)

No idea where to go from here. I'm currently not sure if I want to try
kvalo sources. Don't get me wrong but if I have to apply a patch to
the official Linux source tree that's ok, but switching to the
development tree is not what I was looking forward for this machine.
Can 4.1 help instead? I'm afraid it might now since I can see the fix
for the firmware crash is still not included.

Thank you for the help.
Best regards.

Enrico

___
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k