After upgrading to 4.11.1, wifi driver refuses to load after being unloaded once.

2017-05-25 Thread Marc MERLIN
Howdy,

First I tried i...@linux.intel.com which is now dead
Then linuxw...@intel.com, but no reply.
So I'm trying here next.

Any ideas?
Sadly before that I was on 4.4 due to bugs in the NVME ACPI suspend
support that only got fixed in 4.11, so it's a big jump, my apologies
for that.
That said, I've used this wireless driver for 1.5 years with that
firmware without issues before that (kernel 4.4).


When it works, it loads with
iwlwifi :04:00.0: Falling back to user helper
iwlwifi :04:00.0: loaded firmware version 19.277230.0 op_mode iwlmvm
iwlwifi :04:00.0: Detected Intel(R) Dual Band Wireless AC 8260, REV=0x208
iwlwifi :04:00.0: L1 Enabled - LTR Enabled
iwlwifi :04:00.0: L1 Enabled - LTR Enabled


3 different ways it's failing now:
1) CPU: 3 PID: 9349 at drivers/net/wireless/intel/iwlwifi/pcie/trans.c:1913 
iwl_trans_pcie_grab_nic_access+0xcc/0xe1 [iwlwifi]
Timeout waiting for hardware access (CSR_GP_CNTRL 0x)

2) 
iwlwifi :04:00.0: loaded firmware version 19.277230.0 op_mode iwlmvm
iwlwifi :04:00.0: Detected Intel(R) Dual Band Wireless AC 8260, REV=0xFFFC
iwlwifi :04:00.0: L1 Enabled - LTR Enabled
iwlwifi :04:00.0: L1 Enabled - LTR Enabled
iwlwifi :04:00.0: Could not load the [0] uCode section
iwlwifi :04:00.0: Failed to start INIT ucode: -5
iwlwifi :04:00.0: Failed to run INIT ucode: -5   this

3) iwlwifi :04:00.0: Refused to change power state, currently in D3



Long details below:

I noted that https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi
says I should use iwlwifi-8000-ucode-16.242414.0.tgz
which only ships iwlwifi-8000C-16.ucode while I have iwlwifi-8000C-19.ucode

Either way, I just had to reboot my system as the only way for the driver
to work again. Once it's loaded, it works, but it's not ok that I have
to reboot to get it working again after a suspend/resume module
load/unload.

Is it a known problem, and is there a fix?

Before the reboot, trying to load the module, gave this:
Intel(R) Wireless WiFi driver for Linux
Copyright(c) 2003- 2015 Intel Corporation
[ cut here ]
WARNING: CPU: 3 PID: 9349 at 
drivers/net/wireless/intel/iwlwifi/pcie/trans.c:1913 
iwl_trans_pcie_grab_nic_access+0xcc/0xe1 [iwlwifi]
Timeout waiting for hardware access (CSR_GP_CNTRL 0x)
Modules linked in: iwlwifi(+) cfg80211 hfs ntfs msdos jfs 
reiserfs e1000e msr cmac rpcsec_gss_krb5 nfsv4 dns_resolver ccm ipt_MASQUERADE 
nf_nat_masquerade_ipv4 ipt_REJECT nf_reject_ipv4 xt_tcpudp xt_conntrack 
nf_log_ipv4 nf_log_common xt_LOG iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 
nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle rfcomm ebtable_filter ebtables 
ip6table_filter ip6_tables iptable_filter ip_tables x_tables bnep pci_stub 
vboxpci(OE) vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) autofs4 binfmt_misc 
uinput nfsd auth_rpcgss nfs_acl nfs lockd grace fscache sunrpc nls_utf8 
nls_cp437 vfat fat configs input_polldev loop firewire_sbp2 firewire_core 
crc_itu_t cuse ecryptfs ppdev parport_pc lp parport uvcvideo hid_generic 
videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core
 btusb videodev btrtl btbcm btintel media bluetooth usbhid hid joydev 
arc4 coretemp snd_hda_codec_realtek snd_hda_codec_generic x86_pkg_temp_thermal 
intel_powerclamp kvm_intel kvm snd_hda_intel irqbypass snd_hda_codec 
crct10dif_pclmul crc32_pclmul snd_hda_core iTCO_wdt snd_hwdep rtsx_pci_ms 
snd_pcm ghash_clmulni_intel efi_pstore mei_wdt memstick rtsx_pci_sdmmc 
iTCO_vendor_support intel_cstate snd_seq nouveau snd_seq_device mxm_wmi 
intel_rapl_perf thinkpad_acpi efivars xhci_pci snd_timer psmouse pcspkr ttm 
nvram xhci_hcd nvidiafb i2c_i801 rtsx_pci vgastate snd sg usbcore fb_ddc 
soundcore mei_me intel_pch_thermal rfkill hwmon ac battery tpm_crb tpm_tis wmi 
tpm_tis_core tpm sata_sil24 r8169 mii fuse fan raid456 multipath mmc_block 
mmc_core dm_snapshot dm_bufio dm_mirror dm_region_hash dm_log
 dm_crypt dm_mod async_raid6_recov async_pq async_xor async_memcpy 
async_tx blowfish_x86_64 blowfish_common crc32c_intel bcache aesni_intel 
aes_x86_64 crypto_simd ptp input_leds cryptd i915 glue_helper serio_raw 
pps_core shpchp thermal evdev [last unloaded: cfg80211]
CPU: 3 PID: 9349 Comm: modprobe Tainted: GW  OE   
4.11.1-amd64-preempt-sysrq-20170406 #4
Hardware name: LENOVO 20ERCTO1WW/20ERCTO1WW, BIOS N1DET41W 
(1.15 ) 12/31/2015
Call Trace:
 dump_stack+0x61/0x7d
 __warn+0xc2/0xdd
 warn_slowpath_fmt+0x5a/0x76
 ? iwl_read32+0x1f/0x7f [iwlwifi]
 iwl_trans_pcie_grab_nic_access+0xcc/0xe1 [iwlwifi]
 iwl_trans_pcie_alloc+0x2fb/0x7d4 [iwlwifi]
 iwl_pci_probe+0x30/0x301 [iwlwifi]
 ? _raw_spin_unlock_irqrestore+0x14/0x24
 ? __pm_runtime_resume+0x4d/0x58
 

[PATCH] mwifiex: simplify the code around ra_list

2017-05-25 Thread Shawn Lin
We don't need to check if the list is empty separately
as we could use list_first_entry_or_null to cover it.

Signed-off-by: Shawn Lin 
---

 drivers/net/wireless/marvell/mwifiex/tdls.c | 7 ++-
 drivers/net/wireless/marvell/mwifiex/wmm.c  | 8 ++--
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/tdls.c 
b/drivers/net/wireless/marvell/mwifiex/tdls.c
index 7d0d3ff..d76ce87 100644
--- a/drivers/net/wireless/marvell/mwifiex/tdls.c
+++ b/drivers/net/wireless/marvell/mwifiex/tdls.c
@@ -55,11 +55,8 @@ static void mwifiex_restore_tdls_packets(struct 
mwifiex_private *priv,
tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT;
} else {
tid_list = >wmm.tid_tbl_ptr[tid_down].ra_list;
-   if (!list_empty(tid_list))
-   ra_list = list_first_entry(tid_list,
- struct mwifiex_ra_list_tbl, list);
-   else
-   ra_list = NULL;
+   ra_list = list_first_entry_or_null(tid_list,
+   struct mwifiex_ra_list_tbl, list);
tx_info->flags &= ~MWIFIEX_BUF_FLAG_TDLS_PKT;
}
 
diff --git a/drivers/net/wireless/marvell/mwifiex/wmm.c 
b/drivers/net/wireless/marvell/mwifiex/wmm.c
index e4ff3b9..744b014 100644
--- a/drivers/net/wireless/marvell/mwifiex/wmm.c
+++ b/drivers/net/wireless/marvell/mwifiex/wmm.c
@@ -868,12 +868,8 @@ struct mwifiex_ra_list_tbl *
return;
default:
list_head = priv->wmm.tid_tbl_ptr[tid_down].ra_list;
-   if (!list_empty(_head))
-   ra_list = list_first_entry(
-   _head, struct mwifiex_ra_list_tbl,
-   list);
-   else
-   ra_list = NULL;
+   ra_list = list_first_entry_or_null(_head,
+   struct mwifiex_ra_list_tbl, list);
break;
}
} else {
-- 
1.9.1




[PATCH 2/7] rtlwifi: btcoex: fix compiler warnings for unused functions

2017-05-25 Thread Larry Finger
From: Yan-Hsuan Chuang 

Delete unused is_wifi_status_changed for 21a 1 ant

Signed-off-by: Yan-Hsuan Chuang 
Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
Cc: Birming Chiu 
Cc: Shaofu 
Cc: Steven Ting 
---
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c| 33 --
 .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.c|  2 +-
 2 files changed, 1 insertion(+), 34 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
index 4efac5fe9982..2740129a86cd 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
@@ -426,39 +426,6 @@ static void btc8821a1ant_query_bt_info(struct btc_coexist 
*btcoexist)
btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter);
 }
 
-bool btc8821a1ant_is_wifi_status_changed(struct btc_coexist *btcoexist)
-{
-   static bool pre_wifi_busy = true;
-   static bool pre_under_4way = true;
-   static bool pre_bt_hs_on = true;
-   bool wifi_busy = false, under_4way = false, bt_hs_on = false;
-   bool wifi_connected = false;
-
-   btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_CONNECTED,
-  _connected);
-   btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_BUSY, _busy);
-   btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, _hs_on);
-   btcoexist->btc_get(btcoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS,
-  _4way);
-
-   if (wifi_connected) {
-   if (wifi_busy != pre_wifi_busy) {
-   pre_wifi_busy = wifi_busy;
-   return true;
-   }
-   if (under_4way != pre_under_4way) {
-   pre_under_4way = under_4way;
-   return true;
-   }
-   if (bt_hs_on != pre_bt_hs_on) {
-   pre_bt_hs_on = bt_hs_on;
-   return true;
-   }
-   }
-
-   return false;
-}
-
 static void btc8821a1ant_update_bt_link_info(struct btc_coexist *btcoexist)
 {
struct btc_bt_link_info *bt_link_info = >bt_link_info;
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
index 41943c34edff..c27488f77573 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
@@ -359,7 +359,7 @@ static void btc8821a2ant_query_bt_info(struct btc_coexist 
*btcoexist)
btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter);
 }
 
-bool btc8821a2ant_is_wifi_status_changed(struct btc_coexist *btcoexist)
+static bool btc8821a2ant_is_wifi_status_changed(struct btc_coexist *btcoexist)
 {
static bool pre_wifi_busy = true;
static bool pre_under_4way = true;
-- 
2.12.0



[PATCH 7/7] rtlwifi: btcoex: Fix another edit mistake in 21a 1ant

2017-05-25 Thread Larry Finger
In routine btc8821a1ant_action_wifi_multi_port(), an edit that removed
several lines was missed.

Signed-off-by: Larry Finger 
Cc: Yan-Hsuan Chuang 
Cc: Ping-Ke Shih 
Cc: Birming Chiu 
Cc: Shaofu 
Cc: Steven Ting 
---
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c| 27 --
 1 file changed, 27 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
index 30364966b938..6a1d0dece485 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
@@ -44,8 +44,6 @@ static struct coex_dm_8821a_1ant glcoex_dm_8821a_1ant;
 static struct coex_dm_8821a_1ant *coex_dm = _dm_8821a_1ant;
 static struct coex_sta_8821a_1ant glcoex_sta_8821a_1ant;
 static struct coex_sta_8821a_1ant *coex_sta = _sta_8821a_1ant;
-static void btc8821a1ant_act_bt_sco_hid_only_busy(struct btc_coexist 
*btcoexist,
- u8 wifi_status);
 
 static const char *const glbt_info_src_8821a_1ant[] = {
  "BT Info[wifi fw]",
@@ -1472,35 +1470,10 @@ static void btc8821a1ant_action_hid_a2dp(struct 
btc_coexist *btcoexist)
 static
 void btc8821a1ant_action_wifi_multi_port(struct btc_coexist *btcoexist)
 {
-   struct btc_bt_link_info *bt_link_info = >bt_link_info;
-
btc8821a1ant_power_save_state(btcoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
-   /* tdma and coex table */
-   if (coex_dm->bt_status == BT_8821A_1ANT_BT_STATUS_ACL_BUSY) {
-   if (bt_link_info->a2dp_exist) {
-   btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 14);
-   btc8821a1ant_coex_table_with_type(btcoexist,
- NORMAL_EXEC, 1);
-   } else if (bt_link_info->a2dp_exist &&
-  bt_link_info->pan_exist) {
-   btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8);
-   btc8821a1ant_coex_table_with_type(btcoexist,
- NORMAL_EXEC, 4);
-   } else {
-   btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 20);
-   btc8821a1ant_coex_table_with_type(btcoexist,
- NORMAL_EXEC, 4);
-   }
-   } else if ((coex_dm->bt_status == BT_8821A_1ANT_BT_STATUS_SCO_BUSY) ||
-  (BT_8821A_1ANT_BT_STATUS_ACL_SCO_BUSY ==
-   coex_dm->bt_status)) {
-   btc8821a1ant_act_bt_sco_hid_only_busy(btcoexist,
-   BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SCAN);
-   } else {
btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 8);
btc8821a1ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 2);
}
-}
 
 static
 void btc8821a1ant_action_wifi_not_connected_asso_auth(
-- 
2.12.0



[PATCH 1/7] rtlwifi: btcoex: update new btcoex version

2017-05-25 Thread Larry Finger
From: Yan-Hsuan Chuang 

This patch updates the btcoexist to a newer version with some callbacks.

Specific issues fixed are
pre_load_firmware()
fix the unstable issues before FW is ready
power_on_seting()
fix the unstable issues before HW is ready
Some notify finctions, check hardware type and call corresponding
functions to specific chip

Signed-off-by: Yan-Hsuan Chuang 
Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
Cc: Birming Chiu 
Cc: Shaofu 
Cc: Steven Ting 
---
 .../realtek/rtlwifi/btcoexist/halbt_precomp.h  |  22 +
 .../realtek/rtlwifi/btcoexist/halbtc8192e2ant.h|  32 +-
 .../realtek/rtlwifi/btcoexist/halbtc8723b1ant.c|  52 +-
 .../realtek/rtlwifi/btcoexist/halbtc8723b1ant.h|  41 +-
 .../realtek/rtlwifi/btcoexist/halbtc8723b2ant.h|   3 +
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.h|  38 +-
 .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.h|  26 +-
 .../realtek/rtlwifi/btcoexist/halbtcoutsrc.c   | 838 -
 .../realtek/rtlwifi/btcoexist/halbtcoutsrc.h   |  42 +-
 .../wireless/realtek/rtlwifi/btcoexist/rtl_btc.c   |  35 +-
 10 files changed, 813 insertions(+), 316 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h
index 39b9a3309cfd..2ac989a4b2bb 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbt_precomp.h
@@ -37,6 +37,28 @@
 
 #include "halbtcoutsrc.h"
 
+/* Interface type */
+#define RT_PCI_INTERFACE   1
+#define RT_USB_INTERFACE   2
+#define RT_SDIO_INTERFACE  3
+#define DEV_BUS_TYPE   RT_PCI_INTERFACE
+
+/* IC type */
+#define RTL_HW_TYPE(adapter)   (rtl_hal((struct rtl_priv *)adapter)->hw_type)
+
+#define IS_NEW_GENERATION_IC(adapter)  \
+   (RTL_HW_TYPE(adapter) >= HARDWARE_TYPE_RTL8192EE)
+#define IS_HARDWARE_TYPE_8812(adapter) \
+   (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8812AE)
+#define IS_HARDWARE_TYPE_8821(adapter) \
+   (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8821AE)
+#define IS_HARDWARE_TYPE_8723A(adapter)\
+   (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8723AE)
+#define IS_HARDWARE_TYPE_8723B(adapter)\
+   (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8723BE)
+#define IS_HARDWARE_TYPE_8192E(adapter)\
+   (RTL_HW_TYPE(adapter) == HARDWARE_TYPE_RTL8192EE)
+
 #include "halbtc8192e2ant.h"
 #include "halbtc8723b1ant.h"
 #include "halbtc8723b2ant.h"
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.h 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.h
index a57d6947eaf7..65502acee52c 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.h
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.h
@@ -164,20 +164,20 @@ struct coex_sta_8192e_2ant {
 /
  *The following is interface which will notify coex module.
  /
-void ex_halbtc8192e2ant_init_hwconfig(struct btc_coexist *btcoexist);
-void ex_halbtc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist);
-void ex_halbtc8192e2ant_ips_notify(struct btc_coexist *btcoexist, u8 type);
-void ex_halbtc8192e2ant_lps_notify(struct btc_coexist *btcoexist, u8 type);
-void ex_halbtc8192e2ant_scan_notify(struct btc_coexist *btcoexist, u8 type);
-void ex_halbtc8192e2ant_connect_notify(struct btc_coexist *btcoexist, u8 type);
-void ex_halbtc8192e2ant_media_status_notify(struct btc_coexist *btcoexist,
+void ex_btc8192e2ant_init_hwconfig(struct btc_coexist *btcoexist);
+void ex_btc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist);
+void ex_btc8192e2ant_ips_notify(struct btc_coexist *btcoexist, u8 type);
+void ex_btc8192e2ant_lps_notify(struct btc_coexist *btcoexist, u8 type);
+void ex_btc8192e2ant_scan_notify(struct btc_coexist *btcoexist, u8 type);
+void ex_btc8192e2ant_connect_notify(struct btc_coexist *btcoexist, u8 type);
+void ex_btc8192e2ant_media_status_notify(struct btc_coexist *btcoexist,
+u8 type);
+void ex_btc8192e2ant_special_packet_notify(struct btc_coexist *btcoexist,
+  u8 type);
+void ex_btc8192e2ant_bt_info_notify(struct btc_coexist *btcoexist,
+   u8 *tmpbuf, u8 length);
+void ex_btc8192e2ant_stack_operation_notify(struct btc_coexist *btcoexist,
u8 type);
-void ex_halbtc8192e2ant_special_packet_notify(struct btc_coexist *btcoexist,
- u8 type);

[PATCH 5/7] rtlwifi: btcoex: Fix Sparse messages for undeclared symbols

2017-05-25 Thread Larry Finger
A number of functions can be set to static.

Signed-off-by: Larry Finger 
Cc: Yan-Hsuan Chuang 
Cc: Ping-Ke Shih 
Cc: Birming Chiu 
Cc: Shaofu 
Cc: Steven Ting 
---
 .../realtek/rtlwifi/btcoexist/halbtc8723b1ant.c|  1 +
 .../realtek/rtlwifi/btcoexist/halbtc8723b2ant.c|  1 +
 .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.c|  1 +
 .../realtek/rtlwifi/btcoexist/halbtcoutsrc.c   | 84 ++
 4 files changed, 8 insertions(+), 79 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c
index 03998d2e9eb8..6bc42d5b9207 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c
@@ -1442,6 +1442,7 @@ static void halbtc8723b1ant_ps_tdma(struct btc_coexist 
*btcoexist,
coex_dm->pre_ps_tdma = coex_dm->cur_ps_tdma;
 }
 
+static
 void btc8723b1ant_tdma_dur_adj_for_acl(struct btc_coexist *btcoexist,
   u8 wifi_status)
 {
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
index 31965f0ef69d..014df3f8020f 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b2ant.c
@@ -833,6 +833,7 @@ static void btc8723b2ant_set_sw_fulltime_dac_swing(struct 
btc_coexist *btcoex,
btc8723b2ant_set_dac_swing_reg(btcoex, 0x18);
 }
 
+static
 void btc8723b2ant_dac_swing(struct btc_coexist *btcoexist,
bool force_exec, bool dac_swing_on,
u32 dac_swing_lvl)
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
index c27488f77573..4c7df8860f4d 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c
@@ -1517,6 +1517,7 @@ static void btc8821a2ant_action_bt_inquiry(struct 
btc_coexist *btcoexist)
btc8821a2ant_sw_mechanism2(btcoexist, false, false, false, 0x18);
 }
 
+static
 void btc8821a2ant_action_wifi_link_process(struct btc_coexist *btcoexist)
 {
struct rtl_priv *rtlpriv = btcoexist->adapter;
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
index f00d6e6ab69b..4d3e9b920d69 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -24,6 +24,7 @@
  
**/
 
 #include "halbt_precomp.h"
+#include "rtl_btc.h"
 
 /***
  * Global variables
@@ -37,19 +38,6 @@ u32 btc_dbg_type[BTC_MSG_MAX];
  * Debug related function
  ***/
 
-const char *const gl_btc_wifi_bw_string[] = {
-   "11bg",
-   "HT20",
-   "HT40",
-   "HT80",
-   "HT160"
-};
-
-const char *const gl_btc_wifi_freq_string[] = {
-   "2.4G",
-   "5G"
-};
-
 static bool halbtc_is_bt_coexist_available(struct btc_coexist *btcoexist)
 {
if (!btcoexist->binded || NULL == btcoexist->adapter)
@@ -313,7 +301,7 @@ static u32 halbtc_get_bt_patch_version(struct btc_coexist 
*btcoexist)
return 0;
 }
 
-u32 halbtc_get_wifi_link_status(struct btc_coexist *btcoexist)
+static u32 halbtc_get_wifi_link_status(struct btc_coexist *btcoexist)
 {
/* return value:
 * [31:16] => connected port number
@@ -671,6 +659,7 @@ static void halbtc_write_4byte(void *bt_context, u32 
reg_addr, u32 data)
rtl_write_dword(rtlpriv, reg_addr, data);
 }
 
+static
 void halbtc_write_local_reg_1byte(void *btc_context, u32 reg_addr, u8 data)
 {
struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context;
@@ -684,22 +673,6 @@ void halbtc_write_local_reg_1byte(void *btc_context, u32 
reg_addr, u8 data)
rtl_write_byte(rtlpriv, reg_addr, data);
 }
 
-void halbtc_set_macreg(void *btc_context, u32 reg_addr, u32 bit_mask, u32 data)
-{
-   struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context;
-   struct rtl_priv *rtlpriv = btcoexist->adapter;
-
-   rtl_set_bbreg(rtlpriv->mac80211.hw, reg_addr, bit_mask, data);
-}
-
-u32 halbtc_get_macreg(void *btc_context, u32 reg_addr, u32 bit_mask)
-{
-   struct btc_coexist *btcoexist = (struct btc_coexist *)btc_context;
-   struct rtl_priv *rtlpriv = btcoexist->adapter;
-
-   return rtl_get_bbreg(rtlpriv->mac80211.hw, reg_addr, bit_mask);
-}
-
 static void halbtc_set_bbreg(void 

[PATCH 4/7] rtlwifi: btcoex: 92e: rename function that was missing to be consistent

2017-05-25 Thread Larry Finger
From: Yan-Hsuan Chuang 

rename the function name to be consistent with other btcoex functions

Signed-off-by: Yan-Hsuan Chuang 
Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
Cc: Birming Chiu 
Cc: Shaofu 
Cc: Steven Ting 
---
 drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c
index 9015512ed647..44c25724529e 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8192e2ant.c
@@ -3194,7 +3194,7 @@ void ex_btc8192e2ant_bt_info_notify(struct btc_coexist 
*btcoexist,
btc8192e2ant_run_coexist_mechanism(btcoexist);
 }
 
-void ex_halbtc8192e2ant_halt_notify(struct btc_coexist *btcoexist)
+void ex_btc8192e2ant_halt_notify(struct btc_coexist *btcoexist)
 {
struct rtl_priv *rtlpriv = btcoexist->adapter;
 
-- 
2.12.0



[PATCH 3/7] rtlwifi: btcoex: bind bt to the adapter when initialization

2017-05-25 Thread Larry Finger
From: Yan-Hsuan Chuang 

the bt need the information of the adapter, hook it on the callback for
bt to operate and get properly initialized

Signed-off-by: Yan-Hsuan Chuang 
Signed-off-by: Larry Finger 
Cc: Ping-Ke Shih 
Cc: Birming Chiu 
Cc: Shaofu 
Cc: Steven Ting 
---
 drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h | 1 +
 drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
index 32cbbd0595ed..21d39973feab 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.h
@@ -600,6 +600,7 @@ bool halbtc_is_wifi_uplink(struct rtl_priv *adapter);
 extern struct btc_coexist gl_bt_coexist;
 
 bool exhalbtc_initlize_variables(void);
+bool exhalbtc_bind_bt_coex_withadapter(void *adapter);
 void exhalbtc_init_hw_config(struct btc_coexist *btcoexist);
 void exhalbtc_init_coex_dm(struct btc_coexist *btcoexist);
 void exhalbtc_ips_notify(struct btc_coexist *btcoexist, u8 type);
diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
index 3ab0cfe26513..7d4a94efe260 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/rtl_btc.c
@@ -50,6 +50,7 @@ static struct rtl_btc_ops rtl_btc_operation = {
 void rtl_btc_init_variables(struct rtl_priv *rtlpriv)
 {
exhalbtc_initlize_variables();
+   exhalbtc_bind_bt_coex_withadapter(rtlpriv);
 }
 
 void rtl_btc_init_hal_vars(struct rtl_priv *rtlpriv)
-- 
2.12.0



[PATCH 6/7] rtlwifi: btcoex: Fix logic error in 21a 1ant

2017-05-25 Thread Larry Finger
An edit mistake introduced a logic error.

Signed-off-by: Larry Finger 
Cc: Yan-Hsuan Chuang 
Cc: Ping-Ke Shih 
Cc: Birming Chiu 
Cc: Shaofu 
Cc: Steven Ting 
---
 drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c 
b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
index 2740129a86cd..30364966b938 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a1ant.c
@@ -1613,7 +1613,7 @@ static void btc8821a1ant_act_wifi_con_bt_acl_busy(struct 
btc_coexist *btcoexist,
btc8821a1ant_coex_table_with_type(btcoexist,
  NORMAL_EXEC, 1);
coex_dm->auto_tdma_adjust = false;
-   } else if ((bt_rssi_state != BTC_RSSI_STATE_HIGH) &&
+   } else if ((bt_rssi_state == BTC_RSSI_STATE_HIGH) ||
   (bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH)) {
btc8821a1ant_ps_tdma(btcoexist, NORMAL_EXEC, true, 14);
btc8821a1ant_coex_table_with_type(btcoexist,
-- 
2.12.0



[PATCH 0/7] rtlwifi: btcoex: Final round of fixes

2017-05-25 Thread Larry Finger
These 7 patches finish this round of fixes for the various components
of btcoex.

Signed-off-by: Larry Finger 
Cc: Yan-Hsuan Chuang 
Cc: Ping-Ke Shih 
Cc: Birming Chiu 
Cc: Shaofu 
Cc: Steven Ting 

Larry Finger (3):
  rtlwifi: btcoex: Fix Sparse messages for undeclared symbols
  rtlwifi: btcoex: Fix logic error in 21a 1ant
  rtlwifi: btcoex: Fix another edit mistake in 21a 1ant

Yan-Hsuan Chuang (4):
  rtlwifi: btcoex: update new btcoex version
  rtlwifi: btcoex: fix compiler warnings for unused functions
  rtlwifi: btcoex: bind bt to the adapter when initialization
  rtlwifi: btcoex: 92e: rename function that was missing to be
consistent

 .../realtek/rtlwifi/btcoexist/halbt_precomp.h  |  22 +
 .../realtek/rtlwifi/btcoexist/halbtc8192e2ant.c|   2 +-
 .../realtek/rtlwifi/btcoexist/halbtc8192e2ant.h|  32 +-
 .../realtek/rtlwifi/btcoexist/halbtc8723b1ant.c|  53 +-
 .../realtek/rtlwifi/btcoexist/halbtc8723b1ant.h|  41 +-
 .../realtek/rtlwifi/btcoexist/halbtc8723b2ant.c|   1 +
 .../realtek/rtlwifi/btcoexist/halbtc8723b2ant.h|   3 +
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.c|  62 +-
 .../realtek/rtlwifi/btcoexist/halbtc8821a1ant.h|  38 +-
 .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.c|   3 +-
 .../realtek/rtlwifi/btcoexist/halbtc8821a2ant.h|  26 +-
 .../realtek/rtlwifi/btcoexist/halbtcoutsrc.c   | 764 +++--
 .../realtek/rtlwifi/btcoexist/halbtcoutsrc.h   |  43 +-
 .../wireless/realtek/rtlwifi/btcoexist/rtl_btc.c   |  36 +-
 14 files changed, 747 insertions(+), 379 deletions(-)

-- 
2.12.0



Re: WPA and WPA2

2017-05-25 Thread Dan Williams
On Thu, 2017-05-25 at 08:40 +1000, Tobin C. Harding wrote:
> On Wed, May 24, 2017 at 08:06:40PM +0200, Johannes Berg wrote:
> > Just a small correction:
> > 
> > On Wed, 2017-05-24 at 11:44 -0500, Dan Williams wrote:
> > > 
> > > For RSN, they are 1 = PMK, 2 = GMK, 3 = GMK2, 4 seems unused.
> > 
> > PTK and GTK, and in theory you could have more than two GTKs but
> > that's
> > not usually done.
> 
> Excuse my ignorance but why do you say PTK and GTK here? Who
> generates
> the transient keys, hardware, firmware or software? Is this device
> specific or is there a *normal* way?
> 
> From the nomenclature in the WEXT driver I thought the driver
> supplied the
> master keys to the firmware and transient keys were generated at the
> firmware layer or lower.

Usually the supplicant supplies only the PTK/GTK to the driver at the
right times (like during the 4-way handshake).  It looks like the
driver only refers to PMK/GMK when using the rx_seq[] bits, while the
actual WPA keys are probably the PTK/GTK.

While it's not the best example, see
drivers/net/wireless/marvell/libertas/cfg.c and lbs_cfg_connect() and
lbs_cfg_add_key().  That should translate fairly well to the ks7010
driver.  The important parts you'll get from nl80211 are
add_key/del_key and set_default_key.  The connect hook gets called
first to tell the driver to start the auth/assoc process to a given AP,
 and that's where you'd set up the general stuff like whether or not
you'll use WEP or WPA, what the SSID/BSSID are, whether PSK or
EAPOL/802.1x, rates, etc.  Then after that you'll get the add_key hook
that actually sends the real keys to the driver when the supplicant has
calculated them.


Dan


[PATCH 2/2] staging: wilc1000: add missing blank line after struct declaration

2017-05-25 Thread Marko Stankovic
Fix a missing blank line issue reported by checkpatch.pl

Signed-off-by: Marko Stankovic 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 98316a45abd1..cae9c8ff80d8 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -167,6 +167,7 @@ struct add_key_params {
bool pairwise;
u8 *mac_addr;
 };
+
 static struct add_key_params g_add_gtk_key_params;
 static struct wilc_wfi_key g_key_gtk_params;
 static struct add_key_params g_add_ptk_key_params;
-- 
2.11.0



[PATCH 1/2] staging: wilc1000: remove excessive blank lines

2017-05-25 Thread Marko Stankovic
Fix the multiple blank lines issue reported by checkpatch.pl

Signed-off-by: Marko Stankovic 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 807aada308e3..98316a45abd1 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -84,7 +84,6 @@ static const struct wiphy_wowlan_support wowlan_support = {
 #define TCP_ACK_FILTER_LINK_SPEED_THRESH   54
 #define DEFAULT_LINK_SPEED 72
 
-
 #define IS_MANAGMEMENT 0x100
 #define IS_MANAGMEMENT_CALLBACK0x080
 #define IS_MGMT_STATUS_SUCCES  0x040
@@ -163,7 +162,6 @@ static struct ieee80211_supported_band WILC_WFI_band_2ghz = 
{
.n_bitrates = ARRAY_SIZE(ieee80211_bitrates),
 };
 
-
 struct add_key_params {
u8 key_idx;
bool pairwise;
@@ -281,7 +279,6 @@ static void remove_network_from_shadow(unsigned long arg)
unsigned long now = jiffies;
int i, j;
 
-
for (i = 0; i < last_scanned_cnt; i++) {
if (time_after(now, last_scanned_shadow[i].time_scan +
   (unsigned long)(SCAN_RESULT_EXPIRE))) {
@@ -526,7 +523,6 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
 
memcpy(priv->au8AssociatedBss, pstrConnectInfo->bssid, 
ETH_ALEN);
 
-
for (i = 0; i < last_scanned_cnt; i++) {
if (memcmp(last_scanned_shadow[i].bssid,
   pstrConnectInfo->bssid,
@@ -626,7 +622,6 @@ static int scan(struct wiphy *wiphy, struct 
cfg80211_scan_request *request)
return -ENOMEM;
strHiddenNetwork.n_ssids = request->n_ssids;
 
-
for (i = 0; i < request->n_ssids; i++) {
if (request->ssids[i].ssid_len != 0) {
strHiddenNetwork.net_info[i].ssid = 
kmalloc(request->ssids[i].ssid_len, GFP_KERNEL);
@@ -927,8 +922,6 @@ static int add_key(struct wiphy *wiphy, struct net_device 
*netdev, u8 key_index,
priv->wilc_ptk[key_index]->seq = NULL;
}
 
-
-
if (!pairwise) {
if (params->cipher == WLAN_CIPHER_SUITE_TKIP)
u8gmode = ENCRYPT_ENABLED | WPA | TKIP;
@@ -968,7 +961,6 @@ static int add_key(struct wiphy *wiphy, struct net_device 
*netdev, u8 key_index,
else
u8pmode = priv->wilc_groupkey | AES;
 
-
if (params->key_len > 16 && params->cipher == 
WLAN_CIPHER_SUITE_TKIP) {
pu8TxMic = params->key + 24;
pu8RxMic = params->key + 16;
@@ -1153,7 +1145,6 @@ static int get_key(struct wiphy *wiphy, struct net_device 
*netdev, u8 key_index,
 
priv = wiphy_priv(wiphy);
 
-
if (!pairwise) {
key_params.key = priv->wilc_gtk[key_index]->key;
key_params.cipher = priv->wilc_gtk[key_index]->cipher;
@@ -1298,7 +1289,6 @@ static int set_pmksa(struct wiphy *wiphy, struct 
net_device *netdev,
 
vif = netdev_priv(priv->dev);
 
-
for (i = 0; i < priv->pmkid_list.numpmkid; i++) {
if (!memcmp(pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid,
ETH_ALEN)) {
@@ -1511,7 +1501,6 @@ void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, 
u32 size)
}
}
 
-
if ((buff[P2P_PUB_ACTION_SUBTYPE] == 
GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_RSP) && (wilc_ie)){
cfg80211_rx_mgmt(priv->wdev, 
s32Freq, 0, buff, size - 7, 0);
return;
@@ -1533,7 +1522,6 @@ static void WILC_WFI_mgmt_tx_complete(void *priv, int 
status)
 {
struct p2p_mgmt_data *pv_data = priv;
 
-
kfree(pv_data->buff);
kfree(pv_data);
 }
@@ -1653,7 +1641,6 @@ static int mgmt_tx(struct wiphy *wiphy,
memcpy(mgmt_tx->buff, buf, len);
mgmt_tx->size = len;
 
-
if (ieee80211_is_probe_resp(mgmt->frame_control)) {
wilc_set_mac_chnl_num(vif, chan->hw_value);
curr_channel = chan->hw_value;
@@ -1832,7 +1819,6 @@ static int set_power_mgmt(struct wiphy *wiphy, struct 
net_device *dev,
if (wilc_enable_ps)
wilc_set_power_mgmt(vif, enabled, timeout);
 
-
return 0;
 }
 
@@ 

[no subject]

2017-05-25 Thread Marko Stankovic
Subject: [PATCH 2/2] staging: wilc1000: add missing blank line after struct
 declaration

Fix a missing blank line issue reported by checkpatch.pl

Signed-off-by: Marko Stankovic 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 98316a45abd1..cae9c8ff80d8 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -167,6 +167,7 @@ struct add_key_params {
bool pairwise;
u8 *mac_addr;
 };
+
 static struct add_key_params g_add_gtk_key_params;
 static struct wilc_wfi_key g_key_gtk_params;
 static struct add_key_params g_add_ptk_key_params;
-- 
2.11.0



[no subject]

2017-05-25 Thread Marko Stankovic
Date: Thu, 25 May 2017 18:44:25 +0200
Subject: [PATCH 1/2] staging: wilc1000: remove excessive blank lines

Fix the multiple blank lines issue reported by checkpatch.pl

Signed-off-by: Marko Stankovic 
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 807aada308e3..98316a45abd1 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -84,7 +84,6 @@ static const struct wiphy_wowlan_support wowlan_support = {
 #define TCP_ACK_FILTER_LINK_SPEED_THRESH   54
 #define DEFAULT_LINK_SPEED 72
 
-
 #define IS_MANAGMEMENT 0x100
 #define IS_MANAGMEMENT_CALLBACK0x080
 #define IS_MGMT_STATUS_SUCCES  0x040
@@ -163,7 +162,6 @@ static struct ieee80211_supported_band WILC_WFI_band_2ghz = 
{
.n_bitrates = ARRAY_SIZE(ieee80211_bitrates),
 };
 
-
 struct add_key_params {
u8 key_idx;
bool pairwise;
@@ -281,7 +279,6 @@ static void remove_network_from_shadow(unsigned long arg)
unsigned long now = jiffies;
int i, j;
 
-
for (i = 0; i < last_scanned_cnt; i++) {
if (time_after(now, last_scanned_shadow[i].time_scan +
   (unsigned long)(SCAN_RESULT_EXPIRE))) {
@@ -526,7 +523,6 @@ static void CfgConnectResult(enum conn_event 
enuConnDisconnEvent,
 
memcpy(priv->au8AssociatedBss, pstrConnectInfo->bssid, 
ETH_ALEN);
 
-
for (i = 0; i < last_scanned_cnt; i++) {
if (memcmp(last_scanned_shadow[i].bssid,
   pstrConnectInfo->bssid,
@@ -626,7 +622,6 @@ static int scan(struct wiphy *wiphy, struct 
cfg80211_scan_request *request)
return -ENOMEM;
strHiddenNetwork.n_ssids = request->n_ssids;
 
-
for (i = 0; i < request->n_ssids; i++) {
if (request->ssids[i].ssid_len != 0) {
strHiddenNetwork.net_info[i].ssid = 
kmalloc(request->ssids[i].ssid_len, GFP_KERNEL);
@@ -927,8 +922,6 @@ static int add_key(struct wiphy *wiphy, struct net_device 
*netdev, u8 key_index,
priv->wilc_ptk[key_index]->seq = NULL;
}
 
-
-
if (!pairwise) {
if (params->cipher == WLAN_CIPHER_SUITE_TKIP)
u8gmode = ENCRYPT_ENABLED | WPA | TKIP;
@@ -968,7 +961,6 @@ static int add_key(struct wiphy *wiphy, struct net_device 
*netdev, u8 key_index,
else
u8pmode = priv->wilc_groupkey | AES;
 
-
if (params->key_len > 16 && params->cipher == 
WLAN_CIPHER_SUITE_TKIP) {
pu8TxMic = params->key + 24;
pu8RxMic = params->key + 16;
@@ -1153,7 +1145,6 @@ static int get_key(struct wiphy *wiphy, struct net_device 
*netdev, u8 key_index,
 
priv = wiphy_priv(wiphy);
 
-
if (!pairwise) {
key_params.key = priv->wilc_gtk[key_index]->key;
key_params.cipher = priv->wilc_gtk[key_index]->cipher;
@@ -1298,7 +1289,6 @@ static int set_pmksa(struct wiphy *wiphy, struct 
net_device *netdev,
 
vif = netdev_priv(priv->dev);
 
-
for (i = 0; i < priv->pmkid_list.numpmkid; i++) {
if (!memcmp(pmksa->bssid, priv->pmkid_list.pmkidlist[i].bssid,
ETH_ALEN)) {
@@ -1511,7 +1501,6 @@ void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, 
u32 size)
}
}
 
-
if ((buff[P2P_PUB_ACTION_SUBTYPE] == 
GO_NEG_REQ || buff[P2P_PUB_ACTION_SUBTYPE] == GO_NEG_RSP) && (wilc_ie)){
cfg80211_rx_mgmt(priv->wdev, 
s32Freq, 0, buff, size - 7, 0);
return;
@@ -1533,7 +1522,6 @@ static void WILC_WFI_mgmt_tx_complete(void *priv, int 
status)
 {
struct p2p_mgmt_data *pv_data = priv;
 
-
kfree(pv_data->buff);
kfree(pv_data);
 }
@@ -1653,7 +1641,6 @@ static int mgmt_tx(struct wiphy *wiphy,
memcpy(mgmt_tx->buff, buf, len);
mgmt_tx->size = len;
 
-
if (ieee80211_is_probe_resp(mgmt->frame_control)) {
wilc_set_mac_chnl_num(vif, chan->hw_value);
curr_channel = chan->hw_value;
@@ -1832,7 +1819,6 @@ static int set_power_mgmt(struct wiphy *wiphy, struct 
net_device *dev,

Re: [RFC] skbuff: introduce skb_put_zero()

2017-05-25 Thread David Miller
From: Johannes Berg 
Date: Wed, 24 May 2017 09:07:47 +0200

> From: Johannes Berg 
> 
> This pattern was introduced a number of times in mac80211 just now,
> and since it's present in a number of other places it makes sense
> to add a little helper for it.
> 
> The transformations of all code were done with the following spatch:
> 
> @@
> identifier p;
> expression len;
> expression skb;
> @@
> -p = skb_put(skb, len);
> -memset(p, 0, len);
> +p = skb_put_zero(skb, len);
> 
> Signed-off-by: Johannes Berg 
> ---
> NB: the patch won't apply to net-next because a few of the mac80211
> users don't exist there yet

Acked-by: David S. Miller 

No objections, feel free to push this in via your mac80211 tree.


Occhiali da sole Ray Ban, 24.99euro

2017-05-25 Thread abgblc
Ciao
Benvenuto a Ray Ban negozio di occhiali da sole,
Nuovo e originale. Il prezzo è 24.99 euro durante l'attività di questa 
settimana, spedizione gratuita
site:rbewpt .com

Re: [PATCH][net-next] qtnfmac: remove duplicated assignment to mac

2017-05-25 Thread Sergey Matyukevich
> mac is being assigned twice, remove redundant 2nd assignment.
> 
> Detected by CoverityScan, CID#1437554 ("Incorrect expression")
> 
> Signed-off-by: Colin Ian King 
> ---
>  drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c 
> b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
> index fc0ce2c09097..e3c090008125 100644
> --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
> +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
> @@ -922,7 +922,7 @@ void qtnf_netdev_updown(struct net_device *ndev, bool up)
>  void qtnf_virtual_intf_cleanup(struct net_device *ndev)
>  {
> struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev);
> -   struct qtnf_wmac *mac = mac = wiphy_priv(vif->wdev.wiphy);
> +   struct qtnf_wmac *mac = wiphy_priv(vif->wdev.wiphy);

Thanks !

Acked-by: Sergey Matyukevich 


[PATCH][net-next] qtnfmac: remove duplicated assignment to mac

2017-05-25 Thread Colin King
From: Colin Ian King 

mac is being assigned twice, remove redundant 2nd assignment.

Detected by CoverityScan, CID#1437554 ("Incorrect expression")

Signed-off-by: Colin Ian King 
---
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c 
b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index fc0ce2c09097..e3c090008125 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -922,7 +922,7 @@ void qtnf_netdev_updown(struct net_device *ndev, bool up)
 void qtnf_virtual_intf_cleanup(struct net_device *ndev)
 {
struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev);
-   struct qtnf_wmac *mac = mac = wiphy_priv(vif->wdev.wiphy);
+   struct qtnf_wmac *mac = wiphy_priv(vif->wdev.wiphy);
 
if (vif->wdev.iftype == NL80211_IFTYPE_STATION) {
switch (vif->sta_state) {
-- 
2.11.0



[PATCH] ath10k: Add BMI parameters to fix calibration from DT/pre-cal

2017-05-25 Thread akolli
From: Anilkumar Kolli 

QCA99X0, QCA9888, QCA9984 supports calibration data in
either OTP or DT/pre-cal file. Current ath10k supports
Calibration data from OTP only.

If caldata is loaded from DT/pre-cal file, fetching board id
and applying calibration parameters like tx power gets failed.

error log:
[   15.733663] ath10k_pci :01:00.0: failed to fetch board file: -2
[   15.741474] ath10k_pci :01:00.0: could not probe fw (-2)

This patch adds calibration data support from DT/pre-cal
file.  Below parameters are used to get board id and
applying calibration parameters from cal data.

EEPROM[OTP] FLASH[DT/pre-cal file]
Cal param   0x700   0x1
Board id0x100x8000

Tested on QCA9888 with pre-cal file.

Signed-off-by: Anilkumar Kolli 
---
 drivers/net/wireless/ath/ath10k/bmi.h  |2 ++
 drivers/net/wireless/ath/ath10k/core.c |   16 +---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/bmi.h 
b/drivers/net/wireless/ath/ath10k/bmi.h
index 0342073ed397..9834f351807e 100644
--- a/drivers/net/wireless/ath/ath10k/bmi.h
+++ b/drivers/net/wireless/ath/ath10k/bmi.h
@@ -83,6 +83,8 @@ enum bmi_cmd_id {
 #define BMI_NVRAM_SEG_NAME_SZ 16
 
 #define BMI_PARAM_GET_EEPROM_BOARD_ID 0x10
+#define BMI_PARAM_GET_FLASH_BOARD_ID 0x8000
+#define BMI_PARAM_FLASH_SECTION_ALL 0x1
 
 #define ATH10K_BMI_BOARD_ID_FROM_OTP_MASK   0x7c00
 #define ATH10K_BMI_BOARD_ID_FROM_OTP_LSB10
diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index eea111d704c5..fb859a0c197a 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -691,7 +691,7 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k 
*ar)
 {
u32 result, address;
u8 board_id, chip_id;
-   int ret;
+   int ret, bmi_board_id_param;
 
address = ar->hw_params.patch_load_addr;
 
@@ -715,8 +715,13 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k 
*ar)
return ret;
}
 
-   ret = ath10k_bmi_execute(ar, address, BMI_PARAM_GET_EEPROM_BOARD_ID,
-);
+   if (ar->cal_mode == ATH10K_PRE_CAL_MODE_DT ||
+   ar->cal_mode == ATH10K_PRE_CAL_MODE_FILE)
+   bmi_board_id_param = BMI_PARAM_GET_FLASH_BOARD_ID;
+   else
+   bmi_board_id_param = BMI_PARAM_GET_EEPROM_BOARD_ID;
+
+   ret = ath10k_bmi_execute(ar, address, bmi_board_id_param, );
if (ret) {
ath10k_err(ar, "could not execute otp for board id check: %d\n",
   ret);
@@ -845,6 +850,11 @@ static int ath10k_download_and_run_otp(struct ath10k *ar)
return ret;
}
 
+   /* As of now pre-cal is valid for 10_4 variants */
+   if (ar->cal_mode == ATH10K_PRE_CAL_MODE_DT ||
+   ar->cal_mode == ATH10K_PRE_CAL_MODE_FILE)
+   bmi_otp_exe_param = BMI_PARAM_FLASH_SECTION_ALL;
+
ret = ath10k_bmi_execute(ar, address, bmi_otp_exe_param, );
if (ret) {
ath10k_err(ar, "could not execute otp (%d)\n", ret);
-- 
1.7.9.5



Re: drivers/staging/ks7010 hardware test

2017-05-25 Thread Wolfram Sang
Hi Tobin,

> I began testing the card you sent today. I'm getting a firmware load
> error like you mentioned.

Nice. Firstly, that means the card is alive and survived the mailing.

> I checked out code from when you originally merged into staging,
> however I built the module in a 4.9 kernel.

I think building a vanilla 4.9 kernel is a good choice. I did test the
card with v4.9. I am quite (but not perfectly) sure, I also tested it
with v4.10.

> To help me track down the issue could you please tell me what testing
> you managed to do successfully in the past, and if you can,
> approximately the date you were doing the tests or the git commit of
> the code you tested.

The tests I did are described here:

http://elinux.org/Tests:SDIO-KS7010

The branch I used is mentioned there

https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git/log/?h=renesas/topic/gen3-sdio

but it is based on a branch called renesas-drivers (which is some kind
of stripped down linux-next targeted for Renesas R-Car hardware), so I'd
think v4.9 is the better choice.

The tests were all done End of May 2016.

> Thanks. Oh, also could you please indicate your level of interest my
> continued efforts. I don't want to send you copious emails if you
> would rather me not.

I'm definately interested. I might not be able to review patches, but
for high level questions like this, please CC me. However, give me a few
days for a response.

> The error code is -EILSEQ (Illegal byte sequence). It is returned by
> sdio_memcpy_fromio(). I do not know what it signifies?

I use it rarely, but in this case, I'd think bisecting from v4.9 onwards
is a good choice to tackle this down (given that v4.9 works; otherwise
we'll have to check the MMC layer).

Thanks and all the best,

   Wolfram



signature.asc
Description: PGP signature