Re: ath10k failing with firmware RM.4.4-00022-QCARMSWPZ-2 on QCA6174 (Killer 1535)

2017-01-17 Thread Bartosz Markowski
On 16 January 2017 at 20:24, Chris Le Sueur  wrote:
> Dear all,
>
> (per request by kvalo on #ath10k)
>
> I was trying out the firmware-5 from git to see if it would fix
> throughput issues, but instead the driver just failed to work. I am
> using kernel 4.8.15 on Fedora 25, and the following was printed to the
> kernel log:
>
> ath10k_pci :3a:00.0: pci irq msi oper_irq_mode 2 irq_mode 0
> reset_mode 0
> ath10k_pci :3a:00.0: Direct firmware load for ath10k/pre-cal-pci-
> :3a:00.0 .bin failed with error -2
> ath10k_pci :3a:00.0: Direct firmware load for ath10k/cal-pci-
> :3a:00.0.bin failed with error -2
> ath10k_pci :3a:00.0: qca6174 hw3.2 target 0x0503 chip_id
> 0x00340aff sub 1a56:1535
> ath10k_pci :3a:00.0: kconfig debug 0 debugfs 1 tracing 0 dfs 0
> testmode 0
> ath10k_pci :3a:00.0: firmware ver WLAN.RM.4.4-00022-QCARMSWPZ-2 api
> 5 features wowlan,ignore-otp crc32 4d458559
> ath10k_pci :3a:00.0: failed to fetch board data for bus=pci,bmi-
> chip-id=0,bmi-board-id=0 from ath10k/QCA6174/hw3.0/board-2.bin
> ath10k_pci :3a:00.0: board_file api 1 bmi_id 0:0 crc32 ed5f849a

Please try to apply this patch -
https://patchwork.kernel.org/patch/9486941/ and retry.

-Bartosz

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


[PATCH 5/5] ath10k: add debug trace to rts/cts set function

2016-12-07 Thread Bartosz Markowski
Align it with the cts protection call.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/mac.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 6f1825964177..508366f139f1 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1275,6 +1275,9 @@ static int ath10k_recalc_rtscts_prot(struct ath10k_vif 
*arvif)
rts_cts |= SM(WMI_RTSCTS_FOR_SECOND_RATESERIES,
  WMI_RTSCTS_PROFILE);
 
+   ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d recalc rts/cts prot %d\n",
+  arvif->vdev_id, rts_cts);
+
return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
 rts_cts);
 }
-- 
2.1.2


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


[PATCH 3/5] ath10k: decrease num of peers support

2016-12-07 Thread Bartosz Markowski
The correct number for QCA9377 chip is 33 VDEVs.
This impacts also QCA6174 chip and it's max VDEV number.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/hw.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 883547f3347c..7feffec531cc 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -512,7 +512,7 @@ ath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw,
 /* Target specific defines for WMI-TLV firmware */
 #define TARGET_TLV_NUM_VDEVS   4
 #define TARGET_TLV_NUM_STATIONS32
-#define TARGET_TLV_NUM_PEERS   35
+#define TARGET_TLV_NUM_PEERS   33
 #define TARGET_TLV_NUM_TDLS_VDEVS  1
 #define TARGET_TLV_NUM_TIDS((TARGET_TLV_NUM_PEERS) * 2)
 #define TARGET_TLV_NUM_MSDU_DESC   (1024 + 32)
-- 
2.1.2


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


[PATCH 4/5] ath10k: set CTS protection VDEV param only if VDEV is up

2016-12-07 Thread Bartosz Markowski
The cts protection vdev parameter, in new QCA9377 TF2.0 firmware,
requires bss peer to be created for the STATION vdev type.
bss peer is being allocated by the firmware after vdev_start/_up commands.
mac80211 may call the cts protection setup at any time, so the
we needs to track the situation and defer the cts configuration
to prevent firmware asserts, like below:

[00]: 0x05020001 0x15B3 0x0099ACE2 0x00955B31
[04]: 0x0099ACE2 0x00060730 0x0004 0x
[08]: 0x0044C754 0x00412C10 0x 0x00409C54
[12]: 0x0009 0x 0x00952F6C 0x00952F77
[16]: 0x00952CC4 0x00910712 0x 0x
[20]: 0x4099ACE2 0x0040E858 0x00421254 0x004127F4
[24]: 0x8099B9B2 0x0040E8B8 0x 0xC099ACE2
[28]: 0x800B75CB 0x0040E8F8 0x0007 0x5008
[32]: 0x809B048A 0x0040E958 0x0010 0x00433B10
[36]: 0x809AFBBC 0x0040E9A8 0x0042BB74 0x0042BBBC
[40]: 0x8091D252 0x0040E9C8 0x0042BBBC 0x0001
[44]: 0x809FFA45 0x0040EA78 0x0043D3E4 0x0042C2C8
[48]: 0x809FCEF4 0x0040EA98 0x0043D3E4 0x0001
[52]: 0x80911210 0x0040EAE8 0x0010 0x004041D0
[56]: 0x80911154 0x0040EB28 0x0040 0x

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/mac.c | 51 +--
 1 file changed, 43 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index d06a12d548fd..6f1825964177 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1227,6 +1227,36 @@ static int ath10k_monitor_recalc(struct ath10k *ar)
return ath10k_monitor_stop(ar);
 }
 
+static bool ath10k_mac_can_set_cts_prot(struct ath10k_vif *arvif)
+{
+   struct ath10k *ar = arvif->ar;
+
+   lockdep_assert_held(&ar->conf_mutex);
+
+   if (!arvif->is_started) {
+   ath10k_dbg(ar, ATH10K_DBG_MAC, "defer cts setup, vdev is not 
ready yet\n");
+   return false;
+   }
+
+   return true;
+}
+
+static int ath10k_mac_set_cts_prot(struct ath10k_vif *arvif)
+{
+   struct ath10k *ar = arvif->ar;
+   u32 vdev_param;
+
+   lockdep_assert_held(&ar->conf_mutex);
+
+   vdev_param = ar->wmi.vdev_param->protection_mode;
+
+   ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d cts_protection %d\n",
+  arvif->vdev_id, arvif->use_cts_prot);
+
+   return ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
+arvif->use_cts_prot ? 1 : 0);
+}
+
 static int ath10k_recalc_rtscts_prot(struct ath10k_vif *arvif)
 {
struct ath10k *ar = arvif->ar;
@@ -5329,20 +5359,18 @@ static void ath10k_bss_info_changed(struct ieee80211_hw 
*hw,
 
if (changed & BSS_CHANGED_ERP_CTS_PROT) {
arvif->use_cts_prot = info->use_cts_prot;
-   ath10k_dbg(ar, ATH10K_DBG_MAC, "mac vdev %d cts_prot %d\n",
-  arvif->vdev_id, info->use_cts_prot);
 
ret = ath10k_recalc_rtscts_prot(arvif);
if (ret)
ath10k_warn(ar, "failed to recalculate rts/cts prot for 
vdev %d: %d\n",
arvif->vdev_id, ret);
 
-   vdev_param = ar->wmi.vdev_param->protection_mode;
-   ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
-   info->use_cts_prot ? 1 : 0);
-   if (ret)
-   ath10k_warn(ar, "failed to set protection mode %d on 
vdev %i: %d\n",
-   info->use_cts_prot, arvif->vdev_id, ret);
+   if (ath10k_mac_can_set_cts_prot(arvif)) {
+   ret = ath10k_mac_set_cts_prot(arvif);
+   if (ret)
+   ath10k_warn(ar, "failed to set cts protection 
for vdev %d: %d\n",
+   arvif->vdev_id, ret);
+   }
}
 
if (changed & BSS_CHANGED_ERP_SLOT) {
@@ -7365,6 +7393,13 @@ ath10k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
arvif->is_up = true;
}
 
+   if (ath10k_mac_can_set_cts_prot(arvif)) {
+   ret = ath10k_mac_set_cts_prot(arvif);
+   if (ret)
+   ath10k_warn(ar, "failed to set cts protection for vdev 
%d: %d\n",
+   arvif->vdev_id, ret);
+   }
+
mutex_unlock(&ar->conf_mutex);
return 0;
 
-- 
2.1.2


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


[PATCH 2/5] ath10k: override CE5 config for QCA9377

2016-12-07 Thread Bartosz Markowski
Similarly to QCA6174, QCA9377 requires the CE5 configuration to be
available for other feature. Use the ath10k_pci_override_ce_config()
for it as well.

This is required for TF2.0 firmware. Previous FW revisions were
working fine without this patch.

Fixes: a70587b3389a ("ath10k: configure copy engine 5 for HTT messages")
Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 983f65bbb7fb..85367006a80a 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -3132,7 +3132,7 @@ int ath10k_pci_setup_resource(struct ath10k *ar)
setup_timer(&ar_pci->rx_post_retry, ath10k_pci_rx_replenish_retry,
(unsigned long)ar);
 
-   if (QCA_REV_6174(ar))
+   if (QCA_REV_6174(ar) || QCA_REV_9377(ar))
ath10k_pci_override_ce_config(ar);
 
ret = ath10k_pci_alloc_pipes(ar);
-- 
2.1.2


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


[PATCH 1/5] ath10k: fix IRAM banks number for QCA9377

2016-12-07 Thread Bartosz Markowski
QCA9377 firmware shall alloc 4 IRAM banks

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 0457e315d336..983f65bbb7fb 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1973,7 +1973,7 @@ static int ath10k_pci_get_num_banks(struct ath10k *ar)
}
break;
case QCA9377_1_0_DEVICE_ID:
-   return 2;
+   return 4;
}
 
ath10k_warn(ar, "unknown number of banks, assuming 1\n");
-- 
2.1.2


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


Re: [PATCH 2/2] ath10k: add platform regulatory domain support

2016-10-03 Thread Bartosz Markowski
On 14 September 2016 at 09:06, Valo, Kalle  wrote:
>
> Bartosz Markowski  writes:
>
> > On 12 September 2016 at 17:35, Valo, Kalle  wrote:
> >
> >> > +#ifdef CONFIG_ACPI
> >> > +#define WRD_METHOD "WRDD"
> >> > +#define WRDD_WIFI  (0x07)
> >> > +
> >> > +static u32 ath10k_mac_wrdd_get_mcc(struct ath10k *ar, union acpi_object 
> >> > *wrdd)
> >> > +{
> >>
> >> I don't think the ifdef is really necessary, acpi.h should handle that
> >> (hopefully). Also I changed the error handling to use standard error
> >> values and changed the info messages to dbg, they are too spammy in my
> >> opinion. Please check carefully my changes in the pending branch:
> >>
> >> https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=fe91745381ec3999d8de6dedb07b396c82539717
> >
> > I'm OK with the changes, I have not tried that though, except of
> > reviewing and compiling it (do not have access to the chromebook for
> > next few days). If you want to wait with it until I test it, it's fine
> > too.
>
> Ok, I'll wait for few days in case you have time to test it.


Sorry, it took so long. I've final check this and can confirm the patch.

Bartosz

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


Re: [PATCH 2/2] ath10k: add platform regulatory domain support

2016-09-13 Thread Bartosz Markowski
On 12 September 2016 at 17:35, Valo, Kalle  wrote:

[...]

> > +#ifdef CONFIG_ACPI
> > +#define WRD_METHOD "WRDD"
> > +#define WRDD_WIFI  (0x07)
> > +
> > +static u32 ath10k_mac_wrdd_get_mcc(struct ath10k *ar, union acpi_object 
> > *wrdd)
> > +{
>
> I don't think the ifdef is really necessary, acpi.h should handle that
> (hopefully). Also I changed the error handling to use standard error
> values and changed the info messages to dbg, they are too spammy in my
> opinion. Please check carefully my changes in the pending branch:
>
> https://git.kernel.org/cgit/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=fe91745381ec3999d8de6dedb07b396c82539717

I'm OK with the changes, I have not tried that though, except of
reviewing and compiling it (do not have access to the chromebook for
next few days). If you want to wait with it until I test it, it's fine
too.

Bartosz

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


[PATCH 2/2] ath10k: add platform regulatory domain support

2016-08-02 Thread Bartosz Markowski
This overrides whatever regulatory the device
EEPROM contains and uses what the platform says
instead - in this implementation the ACPI driver.

In case the hint is not programmed or corrupted (0x)
the device falls back to the eeprom programmed settings.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.h |   1 +
 drivers/net/wireless/ath/ath10k/mac.c  | 117 +
 drivers/net/wireless/ath/ath10k/wmi.c  |   2 +-
 3 files changed, 119 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index 30ae5bf81611..1df7c600a2bb 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -692,6 +692,7 @@ struct ath10k {
u32 phy_capability;
u32 hw_min_tx_power;
u32 hw_max_tx_power;
+   u32 hw_eeprom_rd;
u32 ht_cap_info;
u32 vht_cap_info;
u32 num_rf_chains;
diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index fb8e38df9446..b6b8a0b2046b 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 
 #include "hif.h"
 #include "core.h"
@@ -7751,6 +7752,116 @@ struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, 
u32 vdev_id)
return arvif_iter.arvif;
 }
 
+#ifdef CONFIG_ACPI
+#define WRD_METHOD "WRDD"
+#define WRDD_WIFI  (0x07)
+
+static u32 ath10k_mac_wrdd_get_mcc(struct ath10k *ar, union acpi_object *wrdd)
+{
+   union acpi_object *mcc_pkg;
+   union acpi_object *domain_type;
+   union acpi_object *mcc_value;
+   u32 i;
+
+   if (wrdd->type != ACPI_TYPE_PACKAGE ||
+   wrdd->package.count < 2 ||
+   wrdd->package.elements[0].type != ACPI_TYPE_INTEGER ||
+   wrdd->package.elements[0].integer.value != 0) {
+   ath10k_warn(ar, "ignoring malformed/unsupported wrdd 
structure\n");
+   return 0;
+   }
+
+   for (i = 1; i < wrdd->package.count; ++i) {
+   mcc_pkg = &wrdd->package.elements[i];
+
+   if (mcc_pkg->type != ACPI_TYPE_PACKAGE)
+   continue;
+   if (mcc_pkg->package.count < 2)
+   continue;
+   if (mcc_pkg->package.elements[0].type != ACPI_TYPE_INTEGER ||
+   mcc_pkg->package.elements[1].type != ACPI_TYPE_INTEGER)
+   continue;
+
+   domain_type = &mcc_pkg->package.elements[0];
+   if (domain_type->integer.value != WRDD_WIFI)
+   continue;
+
+   mcc_value = &mcc_pkg->package.elements[1];
+   return mcc_value->integer.value;
+   }
+   return 0;
+}
+
+static u16 ath10k_mac_get_wrdd_regulatory(struct ath10k *ar)
+{
+   u16 rd;
+   acpi_handle root_handle;
+   acpi_handle handle;
+   struct acpi_buffer wrdd = {ACPI_ALLOCATE_BUFFER, NULL};
+   acpi_status status;
+   u32 alpha2_code;
+   char alpha2[3];
+   struct pci_dev *pdev = to_pci_dev(ar->dev);
+
+   root_handle = ACPI_HANDLE(&pdev->dev);
+   if (!root_handle) {
+   ath10k_warn(ar, "failed to get root port acpi handle\n");
+   return -1;
+   }
+
+   status = acpi_get_handle(root_handle, (acpi_string)WRD_METHOD, &handle);
+   if (ACPI_FAILURE(status)) {
+   ath10k_warn(ar, "failed to get wrd method %d\n", status);
+   return -1;
+   }
+
+   status = acpi_evaluate_object(handle, NULL, NULL, &wrdd);
+   if (ACPI_FAILURE(status)) {
+   ath10k_warn(ar, "failed to call wrdc %d\n", status);
+   return -1;
+   }
+
+   alpha2_code = ath10k_mac_wrdd_get_mcc(ar, wrdd.pointer);
+   kfree(wrdd.pointer);
+   if (!alpha2_code)
+   return -1;
+
+   alpha2[0] = (alpha2_code >> 8) & 0xff;
+   alpha2[1] = (alpha2_code >> 0) & 0xff;
+   alpha2[2] = '\0';
+
+   ath10k_info(ar, "regulatory hint from WRDD (alpha2-code): %s\n", 
alpha2);
+
+   rd = ath_regd_find_country_by_name(alpha2);
+   if (rd == 0x)
+   return rd;
+
+   rd |= COUNTRY_ERD_FLAG;
+   return rd;
+}
+
+#else
+static u16 ath10k_mac_get_wrdd_regulatory(struct ath10k *ar)
+{
+   /* fallback to default eeprom settings */
+   return -1;
+}
+#endif
+
+static int ath10k_mac_init_rd(struct ath10k *ar)
+{
+   u16 rd;
+
+   rd = ath10k_mac_get_wrdd_regulatory(ar);
+   if (rd == 0x) {
+   ath10k_info(ar, "fallback to eeprom programmed regulatory 
settings\n");
+   rd = ar->hw_eeprom_rd;
+   }
+
+   ar->ath_common.regulatory.current_rd = rd

[PATCH 1/2] ath: export alpha2 helper

2016-08-02 Thread Bartosz Markowski
From: Michal Kazior 

This will be helpful for drivers that can acquire
alpha2 regulatory codes.

Signed-off-by: Michal Kazior 
Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/regd.c | 3 ++-
 drivers/net/wireless/ath/regd.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 7e15ed9ed31f..820bf880ada3 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -449,7 +449,7 @@ static void ath_reg_apply_world_flags(struct wiphy *wiphy,
}
 }
 
-static u16 ath_regd_find_country_by_name(char *alpha2)
+u16 ath_regd_find_country_by_name(char *alpha2)
 {
unsigned int i;
 
@@ -460,6 +460,7 @@ static u16 ath_regd_find_country_by_name(char *alpha2)
 
return -1;
 }
+EXPORT_SYMBOL(ath_regd_find_country_by_name);
 
 static int __ath_reg_dyn_country(struct wiphy *wiphy,
 struct ath_regulatory *reg,
diff --git a/drivers/net/wireless/ath/regd.h b/drivers/net/wireless/ath/regd.h
index 565d3075f06e..5d80be213fac 100644
--- a/drivers/net/wireless/ath/regd.h
+++ b/drivers/net/wireless/ath/regd.h
@@ -251,6 +251,7 @@ enum CountryCode {
 
 bool ath_is_world_regd(struct ath_regulatory *reg);
 bool ath_is_49ghz_allowed(u16 redomain);
+u16 ath_regd_find_country_by_name(char *alpha2);
 int ath_regd_init(struct ath_regulatory *reg, struct wiphy *wiphy,
  void (*reg_notifier)(struct wiphy *wiphy,
   struct regulatory_request *request));
-- 
2.1.2


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


[PATCH 0/2] platform regulatory support

2016-08-02 Thread Bartosz Markowski
Hardware or platform manufacturers may want to use a persistent
memory storage to program ragulatory settings via e.g. bios, uefi, acpi.

This patch set implements methods to retrieve the platform regulatory
settings (via ACPI calls) and use them to override the wifi chip
eeprom default settings.

This has been developed and tested on Skylake (Chromebook) platform, where the
persistent area containing "region" value is called VPD.

Bartosz Markowski (1):
  ath10k: add platform regulatory domain support

Michal Kazior (1):
  ath: export alpha2 helper

 drivers/net/wireless/ath/ath10k/core.h |   1 +
 drivers/net/wireless/ath/ath10k/mac.c  | 117 +
 drivers/net/wireless/ath/ath10k/wmi.c  |   2 +-
 drivers/net/wireless/ath/regd.c|   3 +-
 drivers/net/wireless/ath/regd.h|   1 +
 5 files changed, 122 insertions(+), 2 deletions(-)

-- 
2.1.2


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


Re: QCA6174 hw2.1 Firmware crash when connecting to a 5GHz network

2015-11-19 Thread Bartosz Markowski
On 18 November 2015 at 16:28, Roman Bange  wrote:
> Hey,
>
> im getting a firmware crash when i try to connect to a 5GHz network.
> I tested the older firmware WLAN.RM.1.1-00141, which is now provided in 
> linux-firmware, and SW_RM.1.1.1-00157-QCARMSWPZ-1, which is provided by you 
> in ath10k-firmware.
>
> SW_RM.1.1.1-00157-QCARMSWPZ-1 didn't crash but i wasn't able to connect 
> either.
>
> In addition i tested a solution that worked for me with the 4.1 Kernel where 
> i extracted the firmware out of the windows driver (and can be found here 
> (https://github.com/sumdog/ath10k-firmware). This solution didn't worked for 
> me too.
>
> I tested the firmware with 4.2.0-16 under Ubuntu, but experienced the same 
> problem with the stable releases 4.2.6 and 4.3 too. I have not tested the 
> 4.4-rc1 Kernel yet because its not compilable with the Ubuntu packages.

The firmware crash you experience with "older" firmwares got fixed in
the 000157.
It's most likely related with wrong txbf capability advertisement,
which your card (and firmware for it) does not support.

May I ask what AP you test with?

> I attached the related dmesg logs to this mail.

When you use the 000157 firmware you can see there's a successful
auth/assoc seq. but later on for some reason there's a local deauth
triggered.

[   58.966382] wlp3s0: authenticate with f0:7f:06:2a:44:2d
[   59.008957] wlp3s0: send auth to f0:7f:06:2a:44:2d (try 1/3)
[   59.009546] wlp3s0: authenticated
[   59.014268] wlp3s0: associate with f0:7f:06:2a:44:2d (try 1/3)
[   59.019139] wlp3s0: RX AssocResp from f0:7f:06:2a:44:2d (capab=0x11
status=0 aid=6)
[   59.022291] wlp3s0: associated
[   59.022324] IPv6: ADDRCONF(NETDEV_CHANGE): wlp3s0: link becomes ready
...
[   62.130412] wlp3s0: deauthenticating from f0:7f:06:2a:44:2d by
local choice (Reason: 3=DEAUTH_LEAVING)

And these steps repeat in your log.

Could you try to connect with the AP w/o the network manager (using
wpa_supplicant / wpa_cli directly)?

> Best regards,
> Roman
> ___
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k
>

-- 
Bartosz

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


Re: [PATCH v2 0/4] update ath10k support for QCA9377 chips

2015-11-09 Thread Bartosz Markowski
On 5 November 2015 at 09:50, Bartosz Markowski
 wrote:
> * Clarifying the naming scheme for QCA9377 targets
> * Adding the dev_id mathod (RFC) as a HW identification helper
> * updating missing hw_params for 1.1 target

Linking the ubuntu forum thread and some good news from the Acer E15
owners: http://ubuntuforums.org/showthread.php?t=2300861

> ---
>
> Notes:
>   v2:
>* rebase
>* fix the whitespace mess in patch 4/4 [Kalle]
>
> Bartosz Markowski (4):
>   ath10k: fix the currently supported QCA9377 target version name
>   ath10k: update missing hw_params of QCA9377 hw1.1
>   ath10k: introduce dev_id to hw_params
>   ath10k: add QCA9377 hw1.0 support
>
>  drivers/net/wireless/ath/ath10k/core.c | 49 
> --
>  drivers/net/wireless/ath/ath10k/core.h |  1 +
>  drivers/net/wireless/ath/ath10k/hw.h   | 17 ++--
>  drivers/net/wireless/ath/ath10k/pci.c  |  8 ++
>  4 files changed, 65 insertions(+), 10 deletions(-)
>
> --
> 2.1.2
>



-- 
Bartosz Markowski, Software Architect

Tieto Poland Sp. z o.o., Product Development Services
Swobodna 1 st., 50-088 Wroclaw, Poland
email bartosz.markow...@tieto.com, mobile +48 668 168 256,
www.tieto.com

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


Re: [PATCH 4/4] ath10k: add QCA9377 hw1.0 support

2015-11-05 Thread Bartosz Markowski
On 4 November 2015 at 18:53, Kalle Valo  wrote:
> Bartosz Markowski  writes:
>
>> Add new BMI target version and chip id revision. Register it
>> on supported chips list.
>>
>> Signed-off-by: Bartosz Markowski 
>
> This one has whitespace issues:
>
> drivers/net/wireless/ath/ath10k/core.c:163: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:163: please, no spaces at the start of 
> a line
> drivers/net/wireless/ath/ath10k/core.c:164: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:164: please, no spaces at the start of 
> a line
> drivers/net/wireless/ath/ath10k/core.c:165: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:165: please, no spaces at the start of 
> a line
> drivers/net/wireless/ath/ath10k/core.c:166: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:166: please, no spaces at the start of 
> a line
> drivers/net/wireless/ath/ath10k/core.c:167: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:167: please, no spaces at the start of 
> a line
> drivers/net/wireless/ath/ath10k/core.c:168: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:168: please, no spaces at the start of 
> a line
> drivers/net/wireless/ath/ath10k/core.c:169: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:169: please, no spaces at the start of 
> a line
> drivers/net/wireless/ath/ath10k/core.c:170: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:170: please, no spaces at the start of 
> a line
> drivers/net/wireless/ath/ath10k/core.c:171: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:171: please, no spaces at the start of 
> a line
> drivers/net/wireless/ath/ath10k/core.c:172: code indent should use tabs where 
> possible
> drivers/net/wireless/ath/ath10k/core.c:172: please, no spaces at the start of 
> a line

Sorry about that. I've resend it now.



-- 
Bartosz

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


[PATCH v2 2/4] ath10k: update missing hw_params of QCA9377 hw1.1

2015-11-05 Thread Bartosz Markowski
The uart_pin was incorrectly configured for QCA9377
and the recently added hw_params were omitted.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index 11e42720035b..345770f1625a 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -141,8 +141,10 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
.id = QCA9377_HW_1_1_DEV_VERSION,
.name = "qca9377 hw1.1",
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
-   .uart_pin = 7,
+   .uart_pin = 6,
.otp_exe_param = 0,
+   .channel_counters_freq_hz = 88000,
+   .max_probe_resp_desc_thres = 0,
.fw = {
.dir = QCA9377_HW_1_0_FW_DIR,
.fw = QCA9377_HW_1_0_FW_FILE,
-- 
2.1.2


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


[PATCH v2 1/4] ath10k: fix the currently supported QCA9377 target version name

2015-11-05 Thread Bartosz Markowski
When introducing the original QCA9377 support, the chip target
version was wrongly picked. The chip advertising itself with
bmi target value equal to 0x05020001 is in fact a 1.1 revision.
I realized this once I got a real 1.1 hw to play with.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.c | 4 ++--
 drivers/net/wireless/ath/ath10k/hw.h   | 8 ++--
 drivers/net/wireless/ath/ath10k/pci.c  | 2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index dc4fc4e8d5ef..11e42720035b 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -138,8 +138,8 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
},
{
-   .id = QCA9377_HW_1_0_DEV_VERSION,
-   .name = "qca9377 hw1.0",
+   .id = QCA9377_HW_1_1_DEV_VERSION,
+   .name = "qca9377 hw1.1",
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.otp_exe_param = 0,
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 557d8d2d06aa..62d6dd569090 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -42,6 +42,8 @@
 #define QCA6174_HW_3_0_VERSION 0x0502
 #define QCA6174_HW_3_2_VERSION 0x0503
 
+#define QCA9377_HW_1_1_DEV_VERSION 0x05020001
+
 enum qca6174_pci_rev {
QCA6174_PCI_REV_1_1 = 0x11,
QCA6174_PCI_REV_1_3 = 0x13,
@@ -60,6 +62,10 @@ enum qca6174_chip_id_rev {
QCA6174_HW_3_2_CHIP_ID_REV = 10,
 };
 
+enum qca9377_chip_id_rev {
+   QCA9377_HW_1_1_CHIP_ID_REV = 0x1,
+};
+
 #define QCA6174_HW_2_1_FW_DIR  "ath10k/QCA6174/hw2.1"
 #define QCA6174_HW_2_1_FW_FILE "firmware.bin"
 #define QCA6174_HW_2_1_OTP_FILE"otp.bin"
@@ -85,8 +91,6 @@ enum qca6174_chip_id_rev {
 #define QCA99X0_HW_2_0_PATCH_LOAD_ADDR 0x1234
 
 /* QCA9377 1.0 definitions */
-#define QCA9377_HW_1_0_DEV_VERSION 0x05020001
-#define QCA9377_HW_1_0_CHIP_ID_REV 0x1
 #define QCA9377_HW_1_0_FW_DIR  ATH10K_FW_DIR "/QCA9377/hw1.0"
 #define QCA9377_HW_1_0_FW_FILE "firmware.bin"
 #define QCA9377_HW_1_0_OTP_FILE"otp.bin"
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 5c91a673cf80..b3ab44c6fd18 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -92,7 +92,7 @@ static const struct ath10k_pci_supp_chip 
ath10k_pci_supp_chips[] = {
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
 
{ QCA99X0_2_0_DEVICE_ID, QCA99X0_HW_2_0_CHIP_ID_REV },
-   { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_0_CHIP_ID_REV },
+   { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_1_CHIP_ID_REV },
 };
 
 static void ath10k_pci_buffer_cleanup(struct ath10k *ar);
-- 
2.1.2


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


[PATCH v2 3/4] ath10k: introduce dev_id to hw_params

2015-11-05 Thread Bartosz Markowski
A follow up patch introducing a QCA9377 hw1.0 support will need
this device identification helper for an explicit distinction of
HWs, as apparently both QCA6174 hw3.0 and QCA9377 share the same BMI
target version (0x0502000x). For the QCA9377 hw1.1 previously
added we were just lucky we did not overlap with the same chip_id_rev.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.c | 27 ++-
 drivers/net/wireless/ath/ath10k/core.h |  1 +
 drivers/net/wireless/ath/ath10k/hw.h   |  6 ++
 drivers/net/wireless/ath/ath10k/pci.c  |  6 --
 4 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index 345770f1625a..9b32cb38eb45 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -51,6 +51,7 @@ MODULE_PARM_DESC(rawmode, "Use raw 802.11 frame datapath");
 static const struct ath10k_hw_params ath10k_hw_params_list[] = {
{
.id = QCA988X_HW_2_0_VERSION,
+   .dev_id = QCA988X_2_0_DEVICE_ID,
.name = "qca988x hw2.0",
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
@@ -69,6 +70,25 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] 
= {
},
{
.id = QCA6174_HW_2_1_VERSION,
+   .dev_id = QCA6164_2_1_DEVICE_ID,
+   .name = "qca6164 hw2.1",
+   .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
+   .uart_pin = 6,
+   .otp_exe_param = 0,
+   .channel_counters_freq_hz = 88000,
+   .max_probe_resp_desc_thres = 0,
+   .fw = {
+   .dir = QCA6174_HW_2_1_FW_DIR,
+   .fw = QCA6174_HW_2_1_FW_FILE,
+   .otp = QCA6174_HW_2_1_OTP_FILE,
+   .board = QCA6174_HW_2_1_BOARD_DATA_FILE,
+   .board_size = QCA6174_BOARD_DATA_SZ,
+   .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
+   },
+   },
+   {
+   .id = QCA6174_HW_2_1_VERSION,
+   .dev_id = QCA6174_2_1_DEVICE_ID,
.name = "qca6174 hw2.1",
.patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
.uart_pin = 6,
@@ -86,6 +106,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] 
= {
},
{
.id = QCA6174_HW_3_0_VERSION,
+   .dev_id = QCA6174_2_1_DEVICE_ID,
.name = "qca6174 hw3.0",
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
.uart_pin = 6,
@@ -103,6 +124,7 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
{
.id = QCA6174_HW_3_2_VERSION,
+   .dev_id = QCA6174_2_1_DEVICE_ID,
.name = "qca6174 hw3.2",
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
.uart_pin = 6,
@@ -121,6 +143,7 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
{
.id = QCA99X0_HW_2_0_DEV_VERSION,
+   .dev_id = QCA99X0_2_0_DEVICE_ID,
.name = "qca99x0 hw2.0",
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
@@ -139,6 +162,7 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
{
.id = QCA9377_HW_1_1_DEV_VERSION,
+   .dev_id = QCA9377_1_0_DEVICE_ID,
.name = "qca9377 hw1.1",
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 6,
@@ -1266,7 +1290,8 @@ static int ath10k_init_hw_params(struct ath10k *ar)
for (i = 0; i < ARRAY_SIZE(ath10k_hw_params_list); i++) {
hw_params = &ath10k_hw_params_list[i];
 
-   if (hw_params->id == ar->target_version)
+   if (hw_params->id == ar->target_version &&
+   hw_params->dev_id == ar->dev_id)
break;
}
 
diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index c16f3484dc8a..938431ffed4d 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -643,6 +643,7 @@ struct ath10k {
 
struct ath10k_hw_params {
u32 id;
+   u16 dev_id;
const char *name;
u32 patch_load_addr;
int uart_pin;
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 62d6dd569090..3a5c68ac5d34 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -22,6 +22,12 @@
 
 #define ATH10K_FW_D

[PATCH v2 0/4] update ath10k support for QCA9377 chips

2015-11-05 Thread Bartosz Markowski
* Clarifying the naming scheme for QCA9377 targets
* Adding the dev_id mathod (RFC) as a HW identification helper
* updating missing hw_params for 1.1 target

---

Notes:
  v2:
   * rebase
   * fix the whitespace mess in patch 4/4 [Kalle]

Bartosz Markowski (4):
  ath10k: fix the currently supported QCA9377 target version name
  ath10k: update missing hw_params of QCA9377 hw1.1
  ath10k: introduce dev_id to hw_params
  ath10k: add QCA9377 hw1.0 support

 drivers/net/wireless/ath/ath10k/core.c | 49 --
 drivers/net/wireless/ath/ath10k/core.h |  1 +
 drivers/net/wireless/ath/ath10k/hw.h   | 17 ++--
 drivers/net/wireless/ath/ath10k/pci.c  |  8 ++
 4 files changed, 65 insertions(+), 10 deletions(-)

-- 
2.1.2


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


[PATCH v2 4/4] ath10k: add QCA9377 hw1.0 support

2015-11-05 Thread Bartosz Markowski
Add new BMI target version and chip id revision. Register it
on supported chips list.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.c | 18 ++
 drivers/net/wireless/ath/ath10k/hw.h   |  3 +++
 drivers/net/wireless/ath/ath10k/pci.c  |  2 ++
 3 files changed, 23 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index 9b32cb38eb45..c02e7038a1e6 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -161,6 +161,24 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
},
{
+   .id = QCA9377_HW_1_0_DEV_VERSION,
+   .dev_id = QCA9377_1_0_DEVICE_ID,
+   .name = "qca9377 hw1.0",
+   .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+   .uart_pin = 6,
+   .otp_exe_param = 0,
+   .channel_counters_freq_hz = 88000,
+   .max_probe_resp_desc_thres = 0,
+   .fw = {
+   .dir = QCA9377_HW_1_0_FW_DIR,
+   .fw = QCA9377_HW_1_0_FW_FILE,
+   .otp = QCA9377_HW_1_0_OTP_FILE,
+   .board = QCA9377_HW_1_0_BOARD_DATA_FILE,
+   .board_size = QCA9377_BOARD_DATA_SZ,
+   .board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
+   },
+   },
+   {
.id = QCA9377_HW_1_1_DEV_VERSION,
.dev_id = QCA9377_1_0_DEVICE_ID,
.name = "qca9377 hw1.1",
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 3a5c68ac5d34..8ef3c0e487b8 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -48,6 +48,8 @@
 #define QCA6174_HW_3_0_VERSION 0x0502
 #define QCA6174_HW_3_2_VERSION 0x0503
 
+/* QCA9377 target BMI version signatures */
+#define QCA9377_HW_1_0_DEV_VERSION 0x0502
 #define QCA9377_HW_1_1_DEV_VERSION 0x05020001
 
 enum qca6174_pci_rev {
@@ -69,6 +71,7 @@ enum qca6174_chip_id_rev {
 };
 
 enum qca9377_chip_id_rev {
+   QCA9377_HW_1_0_CHIP_ID_REV = 0x0,
QCA9377_HW_1_1_CHIP_ID_REV = 0x1,
 };
 
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 0be43b80a9a4..6c46814012ef 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -86,6 +86,8 @@ static const struct ath10k_pci_supp_chip 
ath10k_pci_supp_chips[] = {
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
 
{ QCA99X0_2_0_DEVICE_ID, QCA99X0_HW_2_0_CHIP_ID_REV },
+
+   { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_0_CHIP_ID_REV },
{ QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_1_CHIP_ID_REV },
 };
 
-- 
2.1.2


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


[PATCH 2/4] ath10k: update missing hw_params of QCA9377 hw1.1

2015-11-04 Thread Bartosz Markowski
The uart_pin was incorrectly configured for QCA9377
and the recently added hw_params were omitted.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index c8f6ca284b9d..a30d41559134 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -141,8 +141,10 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
.id = QCA9377_HW_1_1_DEV_VERSION,
.name = "qca9377 hw1.1",
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
-   .uart_pin = 7,
+   .uart_pin = 6,
.otp_exe_param = 0,
+   .channel_counters_freq_hz = 88000,
+   .max_probe_resp_desc_thres = 0,
.fw = {
.dir = QCA9377_HW_1_0_FW_DIR,
.fw = QCA9377_HW_1_0_FW_FILE,
-- 
2.1.2


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


[PATCH 4/4] ath10k: add QCA9377 hw1.0 support

2015-11-04 Thread Bartosz Markowski
Add new BMI target version and chip id revision. Register it
on supported chips list.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.c | 18 ++
 drivers/net/wireless/ath/ath10k/hw.h   |  3 +++
 drivers/net/wireless/ath/ath10k/pci.c  |  2 ++
 3 files changed, 23 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index b80b8f372354..f41329617ae4 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -160,6 +160,24 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
},
},
+{
+.id = QCA9377_HW_1_0_DEV_VERSION,
+.dev_id = QCA9377_1_0_DEVICE_ID,
+.name = "qca9377 hw1.0",
+.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+.uart_pin = 6,
+.otp_exe_param = 0,
+.channel_counters_freq_hz = 88000,
+.max_probe_resp_desc_thres = 0,
+.fw = {
+.dir = QCA9377_HW_1_0_FW_DIR,
+.fw = QCA9377_HW_1_0_FW_FILE,
+.otp = QCA9377_HW_1_0_OTP_FILE,
+.board = QCA9377_HW_1_0_BOARD_DATA_FILE,
+.board_size = QCA9377_BOARD_DATA_SZ,
+.board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
+},
+},
{
.id = QCA9377_HW_1_1_DEV_VERSION,
.dev_id = QCA9377_1_0_DEVICE_ID,
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 13aacbdc98e6..713c2bcea178 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -48,6 +48,8 @@
 #define QCA6174_HW_3_0_VERSION 0x0502
 #define QCA6174_HW_3_2_VERSION 0x0503
 
+/* QCA9377 target BMI version signatures */
+#define QCA9377_HW_1_0_DEV_VERSION 0x0502
 #define QCA9377_HW_1_1_DEV_VERSION 0x05020001
 
 enum qca6174_pci_rev {
@@ -69,6 +71,7 @@ enum qca6174_chip_id_rev {
 };
 
 enum qca9377_chip_id_rev {
+   QCA9377_HW_1_0_CHIP_ID_REV = 0x0,
QCA9377_HW_1_1_CHIP_ID_REV = 0x1,
 };
 
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 14dce2a1b39f..679a3ebb34af 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -86,6 +86,8 @@ static const struct ath10k_pci_supp_chip 
ath10k_pci_supp_chips[] = {
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
 
{ QCA99X0_2_0_DEVICE_ID, QCA99X0_HW_2_0_CHIP_ID_REV },
+
+   { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_0_CHIP_ID_REV },
{ QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_1_CHIP_ID_REV },
 };
 
-- 
2.1.2


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


[PATCH 3/4] ath10k: introduce dev_id to hw_params

2015-11-04 Thread Bartosz Markowski
A follow up patch introducing a QCA9377 hw1.0 support will need
this device identification helper for an explicit distinction of
HWs, as apparently both QCA6174 hw3.0 and QCA9377 share the same BMI
target version (0x0502000x). For the QCA9377 hw1.1 previously
added we were just lucky we did not overlap with the same chip_id_rev.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.c | 27 ++-
 drivers/net/wireless/ath/ath10k/core.h |  1 +
 drivers/net/wireless/ath/ath10k/hw.h   |  6 ++
 drivers/net/wireless/ath/ath10k/pci.c  |  6 --
 4 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index a30d41559134..b80b8f372354 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -51,6 +51,7 @@ MODULE_PARM_DESC(rawmode, "Use raw 802.11 frame datapath");
 static const struct ath10k_hw_params ath10k_hw_params_list[] = {
{
.id = QCA988X_HW_2_0_VERSION,
+   .dev_id = QCA988X_2_0_DEVICE_ID,
.name = "qca988x hw2.0",
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
@@ -69,6 +70,25 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] 
= {
},
{
.id = QCA6174_HW_2_1_VERSION,
+   .dev_id = QCA6164_2_1_DEVICE_ID,
+   .name = "qca6164 hw2.1",
+   .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
+   .uart_pin = 6,
+   .otp_exe_param = 0,
+   .channel_counters_freq_hz = 88000,
+   .max_probe_resp_desc_thres = 0,
+   .fw = {
+   .dir = QCA6174_HW_2_1_FW_DIR,
+   .fw = QCA6174_HW_2_1_FW_FILE,
+   .otp = QCA6174_HW_2_1_OTP_FILE,
+   .board = QCA6174_HW_2_1_BOARD_DATA_FILE,
+   .board_size = QCA6174_BOARD_DATA_SZ,
+   .board_ext_size = QCA6174_BOARD_EXT_DATA_SZ,
+   },
+   },
+   {
+   .id = QCA6174_HW_2_1_VERSION,
+   .dev_id = QCA6174_2_1_DEVICE_ID,
.name = "qca6174 hw2.1",
.patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
.uart_pin = 6,
@@ -86,6 +106,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] 
= {
},
{
.id = QCA6174_HW_3_0_VERSION,
+   .dev_id = QCA6174_2_1_DEVICE_ID,
.name = "qca6174 hw3.0",
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
.uart_pin = 6,
@@ -103,6 +124,7 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
{
.id = QCA6174_HW_3_2_VERSION,
+   .dev_id = QCA6174_2_1_DEVICE_ID,
.name = "qca6174 hw3.2",
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
.uart_pin = 6,
@@ -121,6 +143,7 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
{
.id = QCA99X0_HW_2_0_DEV_VERSION,
+   .dev_id = QCA99X0_2_0_DEVICE_ID,
.name = "qca99x0 hw2.0",
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
@@ -139,6 +162,7 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
{
.id = QCA9377_HW_1_1_DEV_VERSION,
+   .dev_id = QCA9377_1_0_DEVICE_ID,
.name = "qca9377 hw1.1",
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 6,
@@ -1265,7 +1289,8 @@ static int ath10k_init_hw_params(struct ath10k *ar)
for (i = 0; i < ARRAY_SIZE(ath10k_hw_params_list); i++) {
hw_params = &ath10k_hw_params_list[i];
 
-   if (hw_params->id == ar->target_version)
+   if (hw_params->id == ar->target_version &&
+   hw_params->dev_id == ar->dev_id)
break;
}
 
diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index 4a2301589902..622d3816eaf4 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -636,6 +636,7 @@ struct ath10k {
 
struct ath10k_hw_params {
u32 id;
+   u16 dev_id;
const char *name;
u32 patch_load_addr;
int uart_pin;
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 01bf2244f54c..13aacbdc98e6 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -22,6 +22,12 @@
 
 #define ATH10K_FW_D

[PATCH 0/4] update ath10k support for QCA9377 chips

2015-11-04 Thread Bartosz Markowski
* Clarifying the naming scheme for QCA9377 targets
* Adding the dev_id mathod (RFC) as a HW identification helper
* updating missing hw_params for 1.1 target

Bartosz Markowski (4):
  ath10k: fix the currently supported QCA9377 target version name
  ath10k: update missing hw_params of QCA9377 hw1.1
  ath10k: introduce dev_id to hw_params
  ath10k: add QCA9377 hw1.0 support

 drivers/net/wireless/ath/ath10k/core.c | 53 +++---
 drivers/net/wireless/ath/ath10k/core.h |  1 +
 drivers/net/wireless/ath/ath10k/hw.h   | 17 +--
 drivers/net/wireless/ath/ath10k/pci.c  |  8 ++---
 4 files changed, 67 insertions(+), 12 deletions(-)

-- 
2.1.2


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


[PATCH 1/4] ath10k: fix the currently supported QCA9377 target version name

2015-11-04 Thread Bartosz Markowski
When introducing the original QCA9377 support, the chip target
version was wrongly picked. The chip advertising itself with
bmi target value equal to 0x05020001 is in fact a 1.1 revision.
I realized this once I got a real 1.1 hw to play with.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.c | 4 ++--
 drivers/net/wireless/ath/ath10k/hw.h   | 8 ++--
 drivers/net/wireless/ath/ath10k/pci.c  | 2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index aa9bd92ac4ed..c8f6ca284b9d 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -138,8 +138,8 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
},
},
{
-   .id = QCA9377_HW_1_0_DEV_VERSION,
-   .name = "qca9377 hw1.0",
+   .id = QCA9377_HW_1_1_DEV_VERSION,
+   .name = "qca9377 hw1.1",
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.otp_exe_param = 0,
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 39966a05c1cc..01bf2244f54c 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -42,6 +42,8 @@
 #define QCA6174_HW_3_0_VERSION 0x0502
 #define QCA6174_HW_3_2_VERSION 0x0503
 
+#define QCA9377_HW_1_1_DEV_VERSION 0x05020001
+
 enum qca6174_pci_rev {
QCA6174_PCI_REV_1_1 = 0x11,
QCA6174_PCI_REV_1_3 = 0x13,
@@ -60,6 +62,10 @@ enum qca6174_chip_id_rev {
QCA6174_HW_3_2_CHIP_ID_REV = 10,
 };
 
+enum qca9377_chip_id_rev {
+   QCA9377_HW_1_1_CHIP_ID_REV = 0x1,
+};
+
 #define QCA6174_HW_2_1_FW_DIR  "ath10k/QCA6174/hw2.1"
 #define QCA6174_HW_2_1_FW_FILE "firmware.bin"
 #define QCA6174_HW_2_1_OTP_FILE"otp.bin"
@@ -85,8 +91,6 @@ enum qca6174_chip_id_rev {
 #define QCA99X0_HW_2_0_PATCH_LOAD_ADDR 0x1234
 
 /* QCA9377 1.0 definitions */
-#define QCA9377_HW_1_0_DEV_VERSION 0x05020001
-#define QCA9377_HW_1_0_CHIP_ID_REV 0x1
 #define QCA9377_HW_1_0_FW_DIR  ATH10K_FW_DIR "/QCA9377/hw1.0"
 #define QCA9377_HW_1_0_FW_FILE "firmware.bin"
 #define QCA9377_HW_1_0_OTP_FILE"otp.bin"
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 3fca200b986c..c444b43f183d 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -92,7 +92,7 @@ static const struct ath10k_pci_supp_chip 
ath10k_pci_supp_chips[] = {
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
 
{ QCA99X0_2_0_DEVICE_ID, QCA99X0_HW_2_0_CHIP_ID_REV },
-   { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_0_CHIP_ID_REV },
+   { QCA9377_1_0_DEVICE_ID, QCA9377_HW_1_1_CHIP_ID_REV },
 };
 
 static void ath10k_pci_buffer_cleanup(struct ath10k *ar);
-- 
2.1.2


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


[PATCH v2] ath10k: add QCA9377 chipset support

2015-10-28 Thread Bartosz Markowski
Add the hardware name, revision and update the pci_id table.

Currently there're two HW ref. designs available I'm aware of,
with 1.0.2 and 1.1 chip revisions. I've access and been using
the first one so far and this patch cover only it.

QCA9377 inherits most of the stuff (e.g. fw interfaces)
from QCA61x4 design, so the integration was pretty straightforward.

Signed-off-by: Bartosz Markowski 
---

Notes:
v2:
 * fix the missig pci_ps initialization in probe function [kbuild]

 drivers/net/wireless/ath/ath10k/core.c  | 16 
 drivers/net/wireless/ath/ath10k/hw.h| 11 +++
 drivers/net/wireless/ath/ath10k/pci.c   | 18 ++
 drivers/net/wireless/ath/ath10k/targaddrs.h |  3 +++
 4 files changed, 48 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index 13de3617d5ab..828aefce8a7a 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -137,6 +137,21 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
},
},
+   {
+   .id = QCA9377_HW_1_0_DEV_VERSION,
+   .name = "qca9377 hw1.0",
+   .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+   .uart_pin = 7,
+   .otp_exe_param = 0,
+   .fw = {
+   .dir = QCA9377_HW_1_0_FW_DIR,
+   .fw = QCA9377_HW_1_0_FW_FILE,
+   .otp = QCA9377_HW_1_0_OTP_FILE,
+   .board = QCA9377_HW_1_0_BOARD_DATA_FILE,
+   .board_size = QCA9377_BOARD_DATA_SZ,
+   .board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
+   },
+   },
 };
 
 static const char *const ath10k_core_fw_feature_str[] = {
@@ -1900,6 +1915,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, 
struct device *dev,
ar->hw_values = &qca988x_values;
break;
case ATH10K_HW_QCA6174:
+   case ATH10K_HW_QCA9377:
ar->regs = &qca6174_regs;
ar->hw_values = &qca6174_values;
break;
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 2d87737e35ff..b70f167200ef 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -84,6 +84,15 @@ enum qca6174_chip_id_rev {
 #define QCA99X0_HW_2_0_BOARD_DATA_FILE "board.bin"
 #define QCA99X0_HW_2_0_PATCH_LOAD_ADDR 0x1234
 
+/* QCA9377 1.0 definitions */
+#define QCA9377_HW_1_0_DEV_VERSION 0x05020001
+#define QCA9377_HW_1_0_CHIP_ID_REV 0x1
+#define QCA9377_HW_1_0_FW_DIR  ATH10K_FW_DIR "/QCA9377/hw1.0"
+#define QCA9377_HW_1_0_FW_FILE "firmware.bin"
+#define QCA9377_HW_1_0_OTP_FILE"otp.bin"
+#define QCA9377_HW_1_0_BOARD_DATA_FILE "board.bin"
+#define QCA9377_HW_1_0_PATCH_LOAD_ADDR 0x1234
+
 #define ATH10K_FW_API2_FILE"firmware-2.bin"
 #define ATH10K_FW_API3_FILE"firmware-3.bin"
 
@@ -176,6 +185,7 @@ enum ath10k_hw_rev {
ATH10K_HW_QCA988X,
ATH10K_HW_QCA6174,
ATH10K_HW_QCA99X0,
+   ATH10K_HW_QCA9377,
 };
 
 struct ath10k_hw_regs {
@@ -228,6 +238,7 @@ void ath10k_hw_fill_survey_time(struct ath10k *ar, struct 
survey_info *survey,
 #define QCA_REV_988X(ar) ((ar)->hw_rev == ATH10K_HW_QCA988X)
 #define QCA_REV_6174(ar) ((ar)->hw_rev == ATH10K_HW_QCA6174)
 #define QCA_REV_99X0(ar) ((ar)->hw_rev == ATH10K_HW_QCA99X0)
+#define QCA_REV_9377(ar) ((ar)->hw_rev == ATH10K_HW_QCA9377)
 
 /* Known pecularities:
  *  - raw appears in nwifi decap, raw and nwifi appear in ethernet decap
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 5c05b0cf54a1..f7ad69be6c44 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -61,12 +61,14 @@ MODULE_PARM_DESC(reset_mode, "0: auto, 1: warm only 
(default: 0)");
 #define QCA6164_2_1_DEVICE_ID  (0x0041)
 #define QCA6174_2_1_DEVICE_ID  (0x003e)
 #define QCA99X0_2_0_DEVICE_ID  (0x0040)
+#define QCA9377_1_0_DEVICE_ID  (0x0042)
 
 static const struct pci_device_id ath10k_pci_id_table[] = {
{ PCI_VDEVICE(ATHEROS, QCA988X_2_0_DEVICE_ID) }, /* PCI-E QCA988X V2 */
{ PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 
*/
{ PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 
*/
{ PCI_VDEVICE(ATHEROS, QCA99X0_2_0_DEVICE_ID) }, /* PCI-E QCA99X0 V2 */
+   { PCI_VDEVICE(ATHEROS, QCA9377_1_0_DEVICE_ID) }, /* PCI-E QCA9377 V1 */
{0}
 };
 
@@ -90,6 +92,7 @@ static const struct ath10k_pci_supp_chip 
ath10k_pci_supp_chips[] = {
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_2_C

Re: [PATCH] ath10k: add QCA9377 chipset support

2015-10-28 Thread Bartosz Markowski
On 28 October 2015 at 12:51, kbuild test robot  wrote:
> Hi Bartosz,
>
> [auto build test WARNING on next-20151022 -- if it's inappropriate base, 
> please suggest rules for selecting the more suitable base]
>
> url:
> https://github.com/0day-ci/linux/commits/Bartosz-Markowski/ath10k-add-QCA9377-chipset-support/20151028-192708
> config: i386-randconfig-x004-201543 (attached as .config)
> reproduce:
> # save the attached .config to linux build tree
> make ARCH=i386
>
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>
> All warnings (new ones prefixed by >>):
>
>drivers/net/wireless/ath/ath10k/pci.c: In function 'ath10k_pci_probe':
>>> drivers/net/wireless/ath/ath10k/pci.c:3040:17: warning: 'pci_ps' may be 
>>> used uninitialized in this function [-Wmaybe-uninitialized]
>  ar_pci->pci_ps = pci_ps;
> ^

I will send a v2 then :-)

Bartosz

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


[PATCH] ath10k: add QCA9377 chipset support

2015-10-28 Thread Bartosz Markowski
Add the hardware name, revision and update the pci_id table.

Currently there're two HW ref. designs available I'm aware of,
with 1.0.2 and 1.1 chip revisions. I've access and been using
the first one so far and this patch cover only it.

QCA9377 inherits most of the stuff (e.g. fw interfaces)
from QCA61x4 design, so the integration was pretty straightforward.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/core.c  | 16 
 drivers/net/wireless/ath/ath10k/hw.h| 12 
 drivers/net/wireless/ath/ath10k/pci.c   | 17 +
 drivers/net/wireless/ath/ath10k/targaddrs.h |  3 +++
 4 files changed, 48 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index 13de3617d5ab..828aefce8a7a 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -137,6 +137,21 @@ static const struct ath10k_hw_params 
ath10k_hw_params_list[] = {
.board_ext_size = QCA99X0_BOARD_EXT_DATA_SZ,
},
},
+   {
+   .id = QCA9377_HW_1_0_DEV_VERSION,
+   .name = "qca9377 hw1.0",
+   .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+   .uart_pin = 7,
+   .otp_exe_param = 0,
+   .fw = {
+   .dir = QCA9377_HW_1_0_FW_DIR,
+   .fw = QCA9377_HW_1_0_FW_FILE,
+   .otp = QCA9377_HW_1_0_OTP_FILE,
+   .board = QCA9377_HW_1_0_BOARD_DATA_FILE,
+   .board_size = QCA9377_BOARD_DATA_SZ,
+   .board_ext_size = QCA9377_BOARD_EXT_DATA_SZ,
+   },
+   },
 };
 
 static const char *const ath10k_core_fw_feature_str[] = {
@@ -1900,6 +1915,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, 
struct device *dev,
ar->hw_values = &qca988x_values;
break;
case ATH10K_HW_QCA6174:
+   case ATH10K_HW_QCA9377:
ar->regs = &qca6174_regs;
ar->hw_values = &qca6174_values;
break;
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 2d87737e35ff..31734298d305 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -84,6 +84,16 @@ enum qca6174_chip_id_rev {
 #define QCA99X0_HW_2_0_BOARD_DATA_FILE "board.bin"
 #define QCA99X0_HW_2_0_PATCH_LOAD_ADDR 0x1234
 
+/* QCA9377 1.0 definitions */
+#define QCA9377_HW_1_0_DEV_VERSION 0x05020001
+#define QCA9377_HW_1_0_CHIP_ID_REV 0x1
+#define QCA9377_HW_1_0_FW_DIR  ATH10K_FW_DIR "/QCA9377/hw1.0"
+#define QCA9377_HW_1_0_FW_FILE "firmware.bin"
+#define QCA9377_HW_1_0_OTP_FILE"otp.bin"
+#define QCA9377_HW_1_0_BOARD_DATA_FILE "board.bin"
+#define QCA9377_HW_1_0_PATCH_LOAD_ADDR 0x1234
+
+
 #define ATH10K_FW_API2_FILE"firmware-2.bin"
 #define ATH10K_FW_API3_FILE"firmware-3.bin"
 
@@ -176,6 +186,7 @@ enum ath10k_hw_rev {
ATH10K_HW_QCA988X,
ATH10K_HW_QCA6174,
ATH10K_HW_QCA99X0,
+   ATH10K_HW_QCA9377,
 };
 
 struct ath10k_hw_regs {
@@ -228,6 +239,7 @@ void ath10k_hw_fill_survey_time(struct ath10k *ar, struct 
survey_info *survey,
 #define QCA_REV_988X(ar) ((ar)->hw_rev == ATH10K_HW_QCA988X)
 #define QCA_REV_6174(ar) ((ar)->hw_rev == ATH10K_HW_QCA6174)
 #define QCA_REV_99X0(ar) ((ar)->hw_rev == ATH10K_HW_QCA99X0)
+#define QCA_REV_9377(ar) ((ar)->hw_rev == ATH10K_HW_QCA9377)
 
 /* Known pecularities:
  *  - raw appears in nwifi decap, raw and nwifi appear in ethernet decap
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 5c05b0cf54a1..63de50c52a5f 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -61,12 +61,14 @@ MODULE_PARM_DESC(reset_mode, "0: auto, 1: warm only 
(default: 0)");
 #define QCA6164_2_1_DEVICE_ID  (0x0041)
 #define QCA6174_2_1_DEVICE_ID  (0x003e)
 #define QCA99X0_2_0_DEVICE_ID  (0x0040)
+#define QCA9377_1_0_DEVICE_ID  (0x0042)
 
 static const struct pci_device_id ath10k_pci_id_table[] = {
{ PCI_VDEVICE(ATHEROS, QCA988X_2_0_DEVICE_ID) }, /* PCI-E QCA988X V2 */
{ PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 
*/
{ PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 
*/
{ PCI_VDEVICE(ATHEROS, QCA99X0_2_0_DEVICE_ID) }, /* PCI-E QCA99X0 V2 */
+   { PCI_VDEVICE(ATHEROS, QCA9377_1_0_DEVICE_ID) }, /* PCI-E QCA9377 V1 */
{0}
 };
 
@@ -90,6 +92,7 @@ static const struct ath10k_pci_supp_chip 
ath10k_pci_supp_chips[] = {
{ QCA6174_2_1_DEVICE_ID, QCA6174_HW_3_2_CHIP_ID_REV },
 
{ QCA99X0_2_0_DEVICE_ID, QCA99X0_HW_2_0_CHIP_ID_REV },
+ 

Re: [PATCH 1/2] ath10k: change beamformee VHT STS capability

2015-09-02 Thread Bartosz Markowski
On 2 September 2015 at 15:55, Kalle Valo  wrote:
> Bartosz Markowski  writes:
>
>> On 28 August 2015 at 14:56, Bartosz Markowski
>>  wrote:
>>> On 27 August 2015 at 14:47, Michal Kazior  wrote:
>>>> From: Bartosz Markowski 
>>>>
>>>> All beamformee supporting chips have the ability to support
>>>> VHT NDP in up to 4 STSs. Change the published beamformee
>>>> STS cap accordingly to 3 as it should be Nsts-1.
>>>>
>>>> This makes it possible to actually make full use
>>>> of. e.g. a 4SS MU-MIMO capable AP.
>>>>
>>>> Signed-off-by: Bartosz Markowski 
>>>> Signed-off-by: Michal Kazior 
>>>> ---
>>>
>>> Kalle, please drop this one for now. It looks like we need to discuss
>>> about this a bit more still.
>>
>> I have sent a follow up on this, splitting it into 2 patches (vht nsts
>> and sounding dimensions), addressing the concerns raised about the
>> lack of firmware passing the needed bits in vht_cap_info.
>
> Ok, patch 1 dropped. I assume patch 2 is still valid.

correct.

-- 
Bartosz

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


Re: [PATCH 1/2] ath10k: change beamformee VHT STS capability

2015-09-02 Thread Bartosz Markowski
On 28 August 2015 at 14:56, Bartosz Markowski
 wrote:
> On 27 August 2015 at 14:47, Michal Kazior  wrote:
>> From: Bartosz Markowski 
>>
>> All beamformee supporting chips have the ability to support
>> VHT NDP in up to 4 STSs. Change the published beamformee
>> STS cap accordingly to 3 as it should be Nsts-1.
>>
>> This makes it possible to actually make full use
>> of. e.g. a 4SS MU-MIMO capable AP.
>>
>> Signed-off-by: Bartosz Markowski 
>> Signed-off-by: Michal Kazior 
>> ---
>
> Kalle, please drop this one for now. It looks like we need to discuss
> about this a bit more still.

I have sent a follow up on this, splitting it into 2 patches (vht nsts
and sounding dimensions), addressing the concerns raised about the
lack of firmware passing the needed bits in vht_cap_info.

Bartosz

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


[PATCH 2/2] ath10k: fix beamformer VHT sounding dimensions capability

2015-09-02 Thread Bartosz Markowski
Similarly to the VHT STS, this is supposed to be propagated by firmware.
In case it's not, use the default value, but as last resort.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/mac.c | 21 +++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 25c20d18021a..db3be8f794e4 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4080,11 +4080,27 @@ static int ath10k_mac_get_vht_cap_bf_sts(struct ath10k 
*ar)
return nsts;
 }
 
+static int ath10k_mac_get_vht_cap_bf_sound_dim(struct ath10k *ar)
+{
+   int sound_dim = ar->vht_cap_info;
+   sound_dim &= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK;
+   sound_dim >>=IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT;
+
+   /* If the sounding dimension is not advertised by the firmware,
+* let's use a default value of 1
+*/
+   if (sound_dim == 0)
+   return 1;
+
+   return sound_dim;
+}
+
 static int ath10k_mac_set_txbf_conf(struct ath10k_vif *arvif)
 {
u32 value = 0;
struct ath10k *ar = arvif->ar;
int nsts;
+   int sound_dim;
 
if (ath10k_wmi_get_txbf_conf_scheme(ar) != WMI_TXBF_CONF_BEFORE_ASSOC)
return 0;
@@ -4094,9 +4110,10 @@ static int ath10k_mac_set_txbf_conf(struct ath10k_vif 
*arvif)
IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE))
value |= SM(nsts, WMI_TXBF_STS_CAP_OFFSET);
 
+   sound_dim = ath10k_mac_get_vht_cap_bf_sound_dim(ar);
if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE))
-   value |= SM((ar->num_rf_chains - 1), WMI_BF_SOUND_DIM_OFFSET);
+   value |= SM(sound_dim, WMI_BF_SOUND_DIM_OFFSET);
 
if (!value)
return 0;
@@ -6830,7 +6847,7 @@ static struct ieee80211_sta_vht_cap 
ath10k_create_vht_cap(struct ath10k *ar)
 
if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE)) {
-   val = ar->num_rf_chains - 1;
+   val = ath10k_mac_get_vht_cap_bf_sound_dim(ar);
val <<= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT;
val &= IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK;
 
-- 
2.1.2


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


[PATCH 1/2] ath10k: fix beamformee VHT STS capability

2015-09-02 Thread Bartosz Markowski
The VHT STS CAP shall be reported by firmware to host, like in case of
QCA99x0. For QCA6174 hw family this isn't set for some reason.
So for this particular chips, let's assume it has the ability to
support VHT NDP in up to 4 STSs (which is true by the way).

Change the published beamformee STS cap accordingly to 3 or to what
the firmware reports.

Assumption so far, it suppose to be the num_rf_chains-1, was
completely wrong.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/mac.c | 22 --
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 9bca37820848..25c20d18021a 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4064,17 +4064,35 @@ static u32 get_nss_from_chainmask(u16 chain_mask)
return 1;
 }
 
+static int ath10k_mac_get_vht_cap_bf_sts(struct ath10k *ar)
+{
+   int nsts = ar->vht_cap_info;
+   nsts &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
+   nsts >>= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT;
+
+   /* If firmware does not deliver to host number of space-time
+* streams supported, assume it support up to 4 BF STS and return
+* the value for VHT CAP: nsts-1)
+* */
+   if (nsts == 0)
+   return 3;
+
+   return nsts;
+}
+
 static int ath10k_mac_set_txbf_conf(struct ath10k_vif *arvif)
 {
u32 value = 0;
struct ath10k *ar = arvif->ar;
+   int nsts;
 
if (ath10k_wmi_get_txbf_conf_scheme(ar) != WMI_TXBF_CONF_BEFORE_ASSOC)
return 0;
 
+   nsts = ath10k_mac_get_vht_cap_bf_sts(ar);
if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE))
-   value |= SM((ar->num_rf_chains - 1), WMI_TXBF_STS_CAP_OFFSET);
+   value |= SM(nsts, WMI_TXBF_STS_CAP_OFFSET);
 
if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE))
@@ -6803,7 +6821,7 @@ static struct ieee80211_sta_vht_cap 
ath10k_create_vht_cap(struct ath10k *ar)
 
if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE)) {
-   val = ar->num_rf_chains - 1;
+   val = ath10k_mac_get_vht_cap_bf_sts(ar);
val <<= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT;
val &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
 
-- 
2.1.2


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


Re: [PATCH 1/2] ath10k: change beamformee VHT STS capability

2015-08-28 Thread Bartosz Markowski
On 27 August 2015 at 14:47, Michal Kazior  wrote:
> From: Bartosz Markowski 
>
> All beamformee supporting chips have the ability to support
> VHT NDP in up to 4 STSs. Change the published beamformee
> STS cap accordingly to 3 as it should be Nsts-1.
>
> This makes it possible to actually make full use
> of. e.g. a 4SS MU-MIMO capable AP.
>
> Signed-off-by: Bartosz Markowski 
> Signed-off-by: Michal Kazior 
> ---

Kalle, please drop this one for now. It looks like we need to discuss
about this a bit more still.

>  drivers/net/wireless/ath/ath10k/mac.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
> b/drivers/net/wireless/ath/ath10k/mac.c
> index 64674c955d44..54ced30f5364 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -4074,7 +4074,7 @@ static int ath10k_mac_set_txbf_conf(struct ath10k_vif 
> *arvif)
>
> if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
> IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE))
> -   value |= SM((ar->num_rf_chains - 1), WMI_TXBF_STS_CAP_OFFSET);
> +   value |= SM(3, WMI_TXBF_STS_CAP_OFFSET);
>
> if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE |
> IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE))
> @@ -6804,7 +6804,7 @@ static struct ieee80211_sta_vht_cap 
> ath10k_create_vht_cap(struct ath10k *ar)
>
> if (ar->vht_cap_info & (IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE |
> IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE)) {
> -   val = ar->num_rf_chains - 1;
> +   val = 3;
> val <<= IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT;
> val &= IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK;
>
> --
> 2.1.4
>



-- 
Bartosz

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


Re: Support for qca9377 ??

2015-08-24 Thread Bartosz Markowski
On 24 August 2015 at 16:21, Jacek Kikiewicz  wrote:
> Hello,
>
> I was wondering if support for QCA9377 is planned/possible with ath10k?

Yes, it's possible and there is a plan to add support for QCA9377 in
ath10k soon.

> It seems it's getting more popular with lower end devices / laptops and it 
> would be nice to have.
>
> Kind regards,
> Jacek Kikiewicz

-Bartosz

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


[PATCH] ath10k: fix QCA61X4 boot up

2015-07-03 Thread Bartosz Markowski
commit "a521ee983d312db7 ath10k: Add new reg_address/mask to hw register
table" commit has broken the QCA61x4 support, by providing wrong
fw_indicator_address, which shall be 0x0003a028 instead of 0x9028.

User experience was a failing boot up sequence (crashing device during
initialization)

[  181.663874] ath10k_pci :02:00.0: enabling device ( -> 0002)
[  181.664787] ath10k_pci :02:00.0: pci irq msi-x interrupts 8 irq_mode 0 
reset_mode 0
[  181.66] ath10k_pci :02:00.0: device has crashed during init
[  181.688897] ath10k_pci :02:00.0: failed to wait for target after cold 
reset: -70
[  181.688902] ath10k_pci :02:00.0: failed to reset chip: -70
[  181.689774] ath10k_pci: probe of :02:00.0 failed with error -70

Fix it by updating the address with correct value.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/hw.c 
b/drivers/net/wireless/ath/ath10k/hw.c
index 1414e1f3c7ac..fef7ccf6e185 100644
--- a/drivers/net/wireless/ath/ath10k/hw.c
+++ b/drivers/net/wireless/ath/ath10k/hw.c
@@ -63,7 +63,7 @@ const struct ath10k_hw_regs qca6174_regs = {
.soc_reset_control_ce_rst_mask  = 0x0001,
.soc_chip_id_address= 0x00f0,
.scratch_3_address  = 0x0028,
-   .fw_indicator_address   = 0x9028,
+   .fw_indicator_address   = 0x0003a028,
.pcie_local_base_address= 0x0008,
.ce_wrap_intr_sum_host_msi_lsb  = 0x0008,
.ce_wrap_intr_sum_host_msi_mask = 0xff00,
-- 
2.1.2


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


Re: attempting mesh on ath10k

2015-05-27 Thread Bartosz Markowski
On 27 May 2015 at 13:12, Bob Copeland  wrote:
> On Wed, May 27, 2015 at 08:51:05AM +0200, Bartosz Markowski wrote:

[...]

>> Are there any plans to push this work upstream?
>
> Hi Bartosz,
>
> Yes, I plan to upstream it.  I'm waiting on a hardware to arrive so I can
> implement VHT mesh with two ath10k chips; once that's in and working I'll
> clean it up and submit.

Great! Thanks for your effort.

-- 
Bartosz

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


Re: attempting mesh on ath10k

2015-05-26 Thread Bartosz Markowski
On 28 April 2015 at 14:25, Bob Copeland  wrote:
> On Tue, Apr 28, 2015 at 07:47:40AM +0200, Michal Kazior wrote:
>> > Perhaps there is a BSSID filter enabled or something like that (in mesh
>> > there's no BSSID, just individual addresses on group addressed frames).
>>
>> In that case try creating a monitor interface and bring it up. This
>> should prompt ath10k to create monitor vdev and subsequently disable
>> most Rx filters in firmware.

Are there any plans to push this work upstream?

Regards,
Bartosz

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


Re: [PATCH 2/2] ath10k: fix static wep with more than 1 key in client mode

2015-03-27 Thread Bartosz Markowski
On 27 March 2015 at 09:21, Michal Kazior  wrote:
> The default keyidx callback may be called after
> more than 1 key is installed. This led to only 1
> WEP key being reinstalled only. This caused Rxed
> traffic encrypted with other WEP keys to be
> dropped in client mode.
>
> Signed-off-by: Michal Kazior 

Tested-by: Bartosz Markowski 

> ---
>  drivers/net/wireless/ath/ath10k/mac.c | 45 
> +++
>  1 file changed, 24 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
> b/drivers/net/wireless/ath/ath10k/mac.c
> index 9d873900257d..3baea2b671dd 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -259,41 +259,44 @@ static int ath10k_clear_vdev_key(struct ath10k_vif 
> *arvif,
> return first_errno;
>  }
>
> -static int ath10k_mac_vif_sta_fix_wep_key(struct ath10k_vif *arvif)
> +static int ath10k_mac_vif_sta_fix_wep_key(struct ath10k_vif *arvif, int 
> keyidx)
>  {
> struct ath10k *ar = arvif->ar;
> enum nl80211_iftype iftype = arvif->vif->type;
> struct ieee80211_key_conf *key;
> -   u32 flags = 0;
> -   int num = 0;
> -   int i;
> +   u32 flags;
> int ret;
> +   int i;
>
> lockdep_assert_held(&ar->conf_mutex);
>
> if (iftype != NL80211_IFTYPE_STATION)
> return 0;
>
> +   if (keyidx < 0)
> +   return 0;
> +
> for (i = 0; i < ARRAY_SIZE(arvif->wep_keys); i++) {
> -   if (arvif->wep_keys[i]) {
> -   key = arvif->wep_keys[i];
> -   ++num;
> +   if (!arvif->wep_keys[i])
> +   continue;
> +
> +   key = arvif->wep_keys[i];
> +
> +   flags = 0;
> +   flags |= WMI_KEY_PAIRWISE;
> +
> +   if (key->keyidx == keyidx)
> +   flags |= WMI_KEY_TX_USAGE;
> +
> +   ret = ath10k_install_key(arvif, key, SET_KEY, arvif->bssid,
> +flags);
> +   if (ret) {
> +   ath10k_warn(ar, "failed to install key %i on vdev %i: 
> %d\n",
> +   key->keyidx, arvif->vdev_id, ret);
> +   return ret;
> }
> }
>
> -   if (num != 1)
> -   return 0;
> -
> -   flags |= WMI_KEY_PAIRWISE;
> -   flags |= WMI_KEY_TX_USAGE;
> -
> -   ret = ath10k_install_key(arvif, key, SET_KEY, arvif->bssid, flags);
> -   if (ret) {
> -   ath10k_warn(ar, "failed to install key %i on vdev %i: %d\n",
> -   key->keyidx, arvif->vdev_id, ret);
> -   return ret;
> -   }
> -
> return 0;
>  }
>
> @@ -4227,7 +4230,7 @@ static void ath10k_set_default_unicast_key(struct 
> ieee80211_hw *hw,
>
> arvif->def_wep_key_idx = keyidx;
>
> -   ret = ath10k_mac_vif_sta_fix_wep_key(arvif);
> +   ret = ath10k_mac_vif_sta_fix_wep_key(arvif, keyidx);
> if (ret) {
> ath10k_warn(ar, "failed to fix sta wep key on vdev %i: %d\n",
> arvif->vdev_id, ret);
> --
> 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



-- 
Bartosz

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


Re: [PATCH 1/2] ath10k: fix arvif->wep_keys clearing

2015-03-27 Thread Bartosz Markowski
On 27 March 2015 at 09:21, Michal Kazior  wrote:
> The variable should be cleared regardless of
> whether there's a peer associated with the key or
> not.
>
> This fixes case when user first associates with 2
> WEP keys and then disconnects and connects with 1
> WEP key. This resulted in WEP key count being 2 in
> the driver leading to default keyidx fixup
> failure.
>
> Signed-off-by: Michal Kazior 

Tested-by: Bartosz Markowski 

> ---
>  drivers/net/wireless/ath/ath10k/mac.c | 12 +++-
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
> b/drivers/net/wireless/ath/ath10k/mac.c
> index 9b8313dcb888..9d873900257d 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -4101,6 +4101,13 @@ static int ath10k_set_key(struct ieee80211_hw *hw, 
> enum set_key_cmd cmd,
>
> key->hw_key_idx = key->keyidx;
>
> +   if (is_wep) {
> +   if (cmd == SET_KEY)
> +   arvif->wep_keys[key->keyidx] = key;
> +   else
> +   arvif->wep_keys[key->keyidx] = NULL;
> +   }
> +
> /* the peer should not disappear in mid-way (unless FW goes awry) 
> since
>  * we already hold conf_mutex. we just make sure its there now. */
> spin_lock_bh(&ar->data_lock);
> @@ -4126,11 +4133,6 @@ static int ath10k_set_key(struct ieee80211_hw *hw, 
> enum set_key_cmd cmd,
> flags |= WMI_KEY_GROUP;
>
> if (is_wep) {
> -   if (cmd == SET_KEY)
> -   arvif->wep_keys[key->keyidx] = key;
> -   else
> -   arvif->wep_keys[key->keyidx] = NULL;
> -
> if (cmd == DISABLE_KEY)
> ath10k_clear_vdev_key(arvif, key);
>
> --
> 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



-- 
Bartosz

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


Re: [PATCH v2] ath10k: fix PMG by using AES-CMAC/IGTK software crypto

2015-03-11 Thread Bartosz Markowski
On 10 March 2015 at 17:02, Ben Greear  wrote:
> On 03/10/2015 06:32 AM, Bartosz Markowski wrote:
>> While testing with older supplicant, .drv_set_key() was failing due to
>> higher than ath10k firmware could handle key_index (WMI_MAX_KEY_INDEX == 3).
>>
>> --
>> wpa_driver_nl80211_set_key: ifindex=15 alg=4 addr=0x7f02b129fbe3 key_idx=4 
>> set_tx=0 seq_len=6 key_len=16
>> broadcast key
>> nl80211: set_key failed; err=-22 Invalid argument)
>> wlan0: WPA: Failed to configure IGTK to the driver
>> wlan0: RSN: Failed to configure IGTK
>> --
>>
>> In order to fix this case (PMF: AES-CMAC/IGTK) force the AES_CMAC cipher to
>> be handled by software.
>
> How did you get firmware to allow the host to do the encryption?
:
> Every time I've tried such a thing I end up with either nothing or garbage on
> the air.
>
> Or this this particular type of encryption treated differently by the
> firmware?

I would suspect so, but it's just my gut feeling. I did not check this
on a firmware level, as the PMF (AES_CMAC) encryption was done this
way from the very beggining in ath10k.
This patch only address the key_idx exceeded case, where
ath10k_set_key() was returning -ENOSPC, so we could inform mac80211
explicitly (by returning '1') it shall do the encryption in software.

-Bartosz

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


Re: [PATCH] ath10k: fix PMG by using AES-CMAC/IGTK software crypto

2015-03-10 Thread Bartosz Markowski
On 10 March 2015 at 14:29, Bartosz Markowski
 wrote:
> While testing with older supplicant, .drv_set_key() was failing due to
> higher than ath10k firmware could handle key_index (WMI_MAX_KEY_INDEX == 3).

I've sent a v2 (I forgot the ammend the missing semicolon).

> --
> wpa_driver_nl80211_set_key: ifindex=15 alg=4 addr=0x7f02b129fbe3 key_idx=4 
> set_tx=0 seq_len=6 key_len=16
> broadcast key
> nl80211: set_key failed; err=-22 Invalid argument)
> wlan0: WPA: Failed to configure IGTK to the driver
> wlan0: RSN: Failed to configure IGTK
> --
>
> In order to fix this case (PMF: AES-CMAC/IGTK) force the AES_CMAC cipher to
> be handled by software.
>
> Signed-off-by: Bartosz Markowski 
> ---
>  drivers/net/wireless/ath/ath10k/mac.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
> b/drivers/net/wireless/ath/ath10k/mac.c
> index 1138f4f8923f..2264c06361b1 100644
> --- a/drivers/net/wireless/ath/ath10k/mac.c
> +++ b/drivers/net/wireless/ath/ath10k/mac.c
> @@ -66,8 +66,8 @@ static int ath10k_send_key(struct ath10k_vif *arvif,
> arg.key_cipher = WMI_CIPHER_WEP;
> break;
> case WLAN_CIPHER_SUITE_AES_CMAC:
> -   /* this one needs to be done in software */
> -   return 1;
> +   WARN_ON(1)
> +   return -EINVAL;
> default:
> ath10k_warn(ar, "cipher %d is not supported\n", key->cipher);
> return -EOPNOTSUPP;
> @@ -3995,6 +3995,10 @@ static int ath10k_set_key(struct ieee80211_hw *hw, 
> enum set_key_cmd cmd,
> int ret = 0;
> u32 flags = 0;
>
> +   /* this one needs to be done in software */
> +   if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC)
> +   return 1;
> +
> if (key->keyidx > WMI_MAX_KEY_INDEX)
> return -ENOSPC;
>
> --
> 2.1.2
>



-- 
Bartosz

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


[PATCH v2] ath10k: fix PMG by using AES-CMAC/IGTK software crypto

2015-03-10 Thread Bartosz Markowski
While testing with older supplicant, .drv_set_key() was failing due to
higher than ath10k firmware could handle key_index (WMI_MAX_KEY_INDEX == 3).

--
wpa_driver_nl80211_set_key: ifindex=15 alg=4 addr=0x7f02b129fbe3 key_idx=4 
set_tx=0 seq_len=6 key_len=16
broadcast key
nl80211: set_key failed; err=-22 Invalid argument)
wlan0: WPA: Failed to configure IGTK to the driver
wlan0: RSN: Failed to configure IGTK
--

In order to fix this case (PMF: AES-CMAC/IGTK) force the AES_CMAC cipher to
be handled by software.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/mac.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 1138f4f8923f..5a3129010951 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -66,8 +66,8 @@ static int ath10k_send_key(struct ath10k_vif *arvif,
arg.key_cipher = WMI_CIPHER_WEP;
break;
case WLAN_CIPHER_SUITE_AES_CMAC:
-   /* this one needs to be done in software */
-   return 1;
+   WARN_ON(1);
+   return -EINVAL;
default:
ath10k_warn(ar, "cipher %d is not supported\n", key->cipher);
return -EOPNOTSUPP;
@@ -3995,6 +3995,10 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum 
set_key_cmd cmd,
int ret = 0;
u32 flags = 0;
 
+   /* this one needs to be done in software */
+   if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC)
+   return 1;
+
if (key->keyidx > WMI_MAX_KEY_INDEX)
return -ENOSPC;
 
-- 
2.1.2


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


[PATCH] ath10k: fix PMG by using AES-CMAC/IGTK software crypto

2015-03-10 Thread Bartosz Markowski
While testing with older supplicant, .drv_set_key() was failing due to
higher than ath10k firmware could handle key_index (WMI_MAX_KEY_INDEX == 3).

--
wpa_driver_nl80211_set_key: ifindex=15 alg=4 addr=0x7f02b129fbe3 key_idx=4 
set_tx=0 seq_len=6 key_len=16
broadcast key
nl80211: set_key failed; err=-22 Invalid argument)
wlan0: WPA: Failed to configure IGTK to the driver
wlan0: RSN: Failed to configure IGTK
--

In order to fix this case (PMF: AES-CMAC/IGTK) force the AES_CMAC cipher to
be handled by software.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/mac.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 1138f4f8923f..2264c06361b1 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -66,8 +66,8 @@ static int ath10k_send_key(struct ath10k_vif *arvif,
arg.key_cipher = WMI_CIPHER_WEP;
break;
case WLAN_CIPHER_SUITE_AES_CMAC:
-   /* this one needs to be done in software */
-   return 1;
+   WARN_ON(1)
+   return -EINVAL;
default:
ath10k_warn(ar, "cipher %d is not supported\n", key->cipher);
return -EOPNOTSUPP;
@@ -3995,6 +3995,10 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum 
set_key_cmd cmd,
int ret = 0;
u32 flags = 0;
 
+   /* this one needs to be done in software */
+   if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC)
+   return 1;
+
if (key->keyidx > WMI_MAX_KEY_INDEX)
return -ENOSPC;
 
-- 
2.1.2


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


[PATCH] ath10k: update MODULE_FIRMWARE definitions for QCA6174

2015-02-18 Thread Bartosz Markowski
This has been missed while adding the QCA6174 support.
As in the last time, without advertising the firmware files
as needed (or optional) for ath10k, these won't be built into
ram disk for instance.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/pci.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 631b026a487b..a238a141b22a 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2770,7 +2770,18 @@ module_exit(ath10k_pci_exit);
 MODULE_AUTHOR("Qualcomm Atheros");
 MODULE_DESCRIPTION("Driver support for Atheros QCA988X PCIe devices");
 MODULE_LICENSE("Dual BSD/GPL");
+
+/* QCA988x 2.0 firmware files */
 MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_FW_FILE);
 MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API2_FILE);
 MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API3_FILE);
+MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API4_FILE);
 MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_BOARD_DATA_FILE);
+
+/* QCA6174 2.1 firmware files */
+MODULE_FIRMWARE(QCA6174_HW_2_1_FW_DIR "/" ATH10K_FW_API4_FILE);
+MODULE_FIRMWARE(QCA6174_HW_2_1_FW_DIR "/" QCA6174_HW_2_1_BOARD_DATA_FILE);
+
+/* QCA6174 3.1 firmware files */
+MODULE_FIRMWARE(QCA6174_HW_3_0_FW_DIR "/" ATH10K_FW_API4_FILE);
+MODULE_FIRMWARE(QCA6174_HW_3_0_FW_DIR "/" QCA6174_HW_3_0_BOARD_DATA_FILE);
-- 
2.1.2


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


[PATCH 5/5] ath10k: implement support for ap beacon offloading

2014-12-17 Thread Bartosz Markowski
From: Michal Kazior 

New firmware revisions support beacon and probe
response templates instead. This means SWBA events
are no longer delivered for these firmware
revisions.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/mac.c | 158 ++
 1 file changed, 158 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 42f6a4d..0141b5b 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -964,6 +964,139 @@ static int ath10k_vdev_stop(struct ath10k_vif *arvif)
return ret;
 }
 
+static int ath10k_mac_setup_bcn_p2p_ie(struct ath10k_vif *arvif,
+  struct sk_buff *bcn)
+{
+   struct ath10k *ar = arvif->ar;
+   struct ieee80211_mgmt *mgmt;
+   const u8 *p2p_ie;
+   int ret;
+
+   if (arvif->vdev_type != WMI_VDEV_TYPE_AP)
+   return 0;
+
+   if (arvif->vdev_subtype != WMI_VDEV_SUBTYPE_P2P_GO)
+   return 0;
+
+   mgmt = (void *)bcn->data;
+   p2p_ie = cfg80211_find_vendor_ie(WLAN_OUI_WFA, WLAN_OUI_TYPE_WFA_P2P,
+mgmt->u.beacon.variable,
+bcn->len - (mgmt->u.beacon.variable -
+bcn->data));
+   if (!p2p_ie)
+   return -ENOENT;
+
+   ret = ath10k_wmi_p2p_go_bcn_ie(ar, arvif->vdev_id, p2p_ie);
+   if (ret) {
+   ath10k_warn(ar, "failed to submit p2p go bcn ie for vdev %i: 
%d\n",
+   arvif->vdev_id, ret);
+   return ret;
+   }
+
+   return 0;
+}
+
+static int ath10k_mac_remove_vendor_ie(struct sk_buff *skb, unsigned int oui,
+  u8 oui_type, size_t ie_offset)
+{
+   size_t len;
+   const u8 *next;
+   const u8 *end;
+   u8 *ie;
+
+   if (WARN_ON(skb->len < ie_offset))
+   return -EINVAL;
+
+   ie = (u8 *)cfg80211_find_vendor_ie(oui, oui_type,
+  skb->data + ie_offset,
+  skb->len - ie_offset);
+   if (!ie)
+   return -ENOENT;
+
+   len = ie[1] + 2;
+   end = skb->data + skb->len;
+   next = ie + len;
+
+   if (WARN_ON(next > end))
+   return -EINVAL;
+
+   memmove(ie, next, end - next);
+   skb_trim(skb, skb->len - len);
+
+   return 0;
+}
+
+static int ath10k_mac_setup_bcn_tmpl(struct ath10k_vif *arvif)
+{
+   struct ath10k *ar = arvif->ar;
+   struct ieee80211_hw *hw = ar->hw;
+   struct ieee80211_vif *vif = arvif->vif;
+   struct ieee80211_mutable_offsets offs = {};
+   struct sk_buff *bcn;
+   int ret;
+
+   if (!test_bit(WMI_SERVICE_BEACON_OFFLOAD, ar->wmi.svc_map))
+   return 0;
+
+   bcn = ieee80211_beacon_get_template(hw, vif, &offs);
+   if (!bcn) {
+   ath10k_warn(ar, "failed to get beacon template from 
mac80211\n");
+   return -EPERM;
+   }
+
+   ret = ath10k_mac_setup_bcn_p2p_ie(arvif, bcn);
+   if (ret) {
+   ath10k_warn(ar, "failed to setup p2p go bcn ie: %d\n", ret);
+   kfree_skb(bcn);
+   return ret;
+   }
+
+   ath10k_mac_remove_vendor_ie(bcn, WLAN_OUI_WFA, WLAN_OUI_TYPE_WFA_P2P,
+   offsetof(struct ieee80211_mgmt,
+u.beacon.variable));
+
+   ret = ath10k_wmi_bcn_tmpl(ar, arvif->vdev_id, offs.tim_offset, bcn, 0,
+ 0, NULL, 0);
+   kfree_skb(bcn);
+
+   if (ret) {
+   ath10k_warn(ar, "failed to submit beacon template command: 
%d\n",
+   ret);
+   return ret;
+   }
+
+   return 0;
+}
+
+static int ath10k_mac_setup_prb_tmpl(struct ath10k_vif *arvif)
+{
+   struct ath10k *ar = arvif->ar;
+   struct ieee80211_hw *hw = ar->hw;
+   struct ieee80211_vif *vif = arvif->vif;
+   struct sk_buff *prb;
+   int ret;
+
+   if (!test_bit(WMI_SERVICE_BEACON_OFFLOAD, ar->wmi.svc_map))
+   return 0;
+
+   prb = ieee80211_proberesp_get(hw, vif);
+   if (!prb) {
+   ath10k_warn(ar, "failed to get probe resp template from 
mac80211\n");
+   return -EPERM;
+   }
+
+   ret = ath10k_wmi_prb_tmpl(ar, arvif->vdev_id, prb);
+   kfree_skb(prb);
+
+   if (ret) {
+   ath10k_warn(ar, "failed to submit probe resp template command: 
%d\n",
+   ret);
+   return ret;
+   }
+
+   return 0;
+}
+
 static void ath10k_control_beaconing(struct ath10k_vif *arvif,
 struct ieee80211_bss_conf *info)
 {
@@ -3273,6 +3406,18 @@ static void ath10k_bss_info_changed(struct ieee80211_hw 
*hw,
if (ret)
 

[PATCH 1/5] ath10k: implement new beacon tx status event

2014-12-17 Thread Bartosz Markowski
From: Michal Kazior 

This event is delivered to host by firmware if it
supports beacon templates only.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 50 +++
 drivers/net/wireless/ath/ath10k/wmi-tlv.h | 12 
 2 files changed, 62 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 1627ec5..0f7a3ae 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -58,6 +58,8 @@ static const struct wmi_tlv_policy wmi_tlv_policies[] = {
= { .min_len = sizeof(struct wlan_host_mem_req) },
[WMI_TLV_TAG_STRUCT_READY_EVENT]
= { .min_len = sizeof(struct wmi_tlv_rdy_ev) },
+   [WMI_TLV_TAG_STRUCT_OFFLOAD_BCN_TX_STATUS_EVENT]
+   = { .min_len = sizeof(struct wmi_tlv_bcn_tx_status_ev) },
 };
 
 static int
@@ -156,6 +158,51 @@ static u16 ath10k_wmi_tlv_len(const void *ptr)
return __le16_to_cpuconst struct wmi_tlv *)ptr) - 1)->len);
 }
 
+/**/
+/* TLV events */
+/**/
+static int ath10k_wmi_tlv_event_bcn_tx_status(struct ath10k *ar,
+ struct sk_buff *skb)
+{
+   const void **tb;
+   const struct wmi_tlv_bcn_tx_status_ev *ev;
+   u32 vdev_id, tx_status;
+   int ret;
+
+   tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
+   if (IS_ERR(tb)) {
+   ret = PTR_ERR(tb);
+   ath10k_warn(ar, "failed to parse tlv: %d\n", ret);
+   return ret;
+   }
+
+   ev = tb[WMI_TLV_TAG_STRUCT_OFFLOAD_BCN_TX_STATUS_EVENT];
+   if (!ev) {
+   kfree(tb);
+   return -EPROTO;
+   }
+
+   tx_status = __le32_to_cpu(ev->tx_status);
+   vdev_id = __le32_to_cpu(ev->vdev_id);
+
+   switch (tx_status) {
+   case WMI_TLV_BCN_TX_STATUS_OK:
+   break;
+   case WMI_TLV_BCN_TX_STATUS_XRETRY:
+   case WMI_TLV_BCN_TX_STATUS_DROP:
+   case WMI_TLV_BCN_TX_STATUS_FILTERED:
+   /* FIXME: It's probably worth telling mac80211 to stop the
+* interface as it is crippled.
+*/
+   ath10k_warn(ar, "received bcn tmpl tx status on vdev %i: %d",
+   vdev_id, tx_status);
+   break;
+   }
+
+   kfree(tb);
+   return 0;
+}
+
 /***/
 /* TLV ops */
 /***/
@@ -268,6 +315,9 @@ static void ath10k_wmi_tlv_op_rx(struct ath10k *ar, struct 
sk_buff *skb)
case WMI_TLV_READY_EVENTID:
ath10k_wmi_event_ready(ar, skb);
break;
+   case WMI_TLV_OFFLOAD_BCN_TX_STATUS_EVENTID:
+   ath10k_wmi_tlv_event_bcn_tx_status(ar, skb);
+   break;
default:
ath10k_warn(ar, "Unknown eventid: %d\n", id);
break;
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index 54ffa12..ee19353 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -1375,6 +1375,18 @@ struct wmi_tlv_pktlog_disable {
__le32 reserved;
 } __packed;
 
+enum wmi_tlv_bcn_tx_status {
+   WMI_TLV_BCN_TX_STATUS_OK,
+   WMI_TLV_BCN_TX_STATUS_XRETRY,
+   WMI_TLV_BCN_TX_STATUS_DROP,
+   WMI_TLV_BCN_TX_STATUS_FILTERED,
+};
+
+struct wmi_tlv_bcn_tx_status_ev {
+   __le32 vdev_id;
+   __le32 tx_status;
+} __packed;
+
 void ath10k_wmi_tlv_attach(struct ath10k *ar);
 
 #endif
-- 
1.8.2


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


[PATCH 0/5] ath10k: new beaconning methods for AP/GO/IBSS

2014-12-17 Thread Bartosz Markowski
This is a continuation of the new wmi-tlv backed series from Michal,
preparing for a new hardware support for ath10k.

I'm sending this for a first review round, since Michal has started
his holiday break already.

Michal Kazior (5):
  ath10k: implement new beacon tx status event
  ath10k: implement beacon template command
  ath10k: implement prb tmpl wmi command
  ath10k: implement p2p bcn ie command
  ath10k: implement support for ap beacon offloading

 drivers/net/wireless/ath/ath10k/mac.c | 158 +++
 drivers/net/wireless/ath/ath10k/wmi-ops.h |  57 +
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 206 ++
 drivers/net/wireless/ath/ath10k/wmi-tlv.h |  34 +
 drivers/net/wireless/ath/ath10k/wmi.c |   9 ++
 5 files changed, 464 insertions(+)

-- 
1.8.2


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


[PATCH 2/5] ath10k: implement beacon template command

2014-12-17 Thread Bartosz Markowski
From: Michal Kazior 

New firmware revisions may support setting beacon
template. Implement wmi interface for it.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/wmi-ops.h | 23 +++
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 65 +++
 drivers/net/wireless/ath/ath10k/wmi-tlv.h | 12 ++
 drivers/net/wireless/ath/ath10k/wmi.c |  3 ++
 4 files changed, 103 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h 
b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index 1fbc520..fb12666 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -114,6 +114,10 @@ struct wmi_ops {
struct sk_buff *(*gen_dbglog_cfg)(struct ath10k *ar, u32 module_enable);
struct sk_buff *(*gen_pktlog_enable)(struct ath10k *ar, u32 filter);
struct sk_buff *(*gen_pktlog_disable)(struct ath10k *ar);
+   struct sk_buff *(*gen_bcn_tmpl)(struct ath10k *ar, u32 vdev_id,
+   u32 tim_ie_offset, struct sk_buff *bcn,
+   u32 prb_caps, u32 prb_erp,
+   void *prb_ies, size_t prb_ies_len);
 };
 
 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -818,4 +822,23 @@ ath10k_wmi_pdev_pktlog_disable(struct ath10k *ar)
   ar->wmi.cmd->pdev_pktlog_disable_cmdid);
 }
 
+static inline int
+ath10k_wmi_bcn_tmpl(struct ath10k *ar, u32 vdev_id, u32 tim_ie_offset,
+   struct sk_buff *bcn, u32 prb_caps, u32 prb_erp,
+   void *prb_ies, size_t prb_ies_len)
+{
+   struct sk_buff *skb;
+
+   if (!ar->wmi.ops->gen_bcn_tmpl)
+   return -EOPNOTSUPP;
+
+   skb = ar->wmi.ops->gen_bcn_tmpl(ar, vdev_id, tim_ie_offset, bcn,
+   prb_caps, prb_erp, prb_ies,
+   prb_ies_len);
+   if (IS_ERR(skb))
+   return PTR_ERR(skb);
+
+   return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->bcn_tmpl_cmdid);
+}
+
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 0f7a3ae..f6ea938 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -1972,6 +1972,70 @@ ath10k_wmi_tlv_op_gen_pktlog_disable(struct ath10k *ar)
return skb;
 }
 
+static struct sk_buff *
+ath10k_wmi_tlv_op_gen_bcn_tmpl(struct ath10k *ar, u32 vdev_id,
+  u32 tim_ie_offset, struct sk_buff *bcn,
+  u32 prb_caps, u32 prb_erp, void *prb_ies,
+  size_t prb_ies_len)
+{
+   struct wmi_tlv_bcn_tmpl_cmd *cmd;
+   struct wmi_tlv_bcn_prb_info *info;
+   struct wmi_tlv *tlv;
+   struct sk_buff *skb;
+   void *ptr;
+   size_t len;
+
+   if (WARN_ON(prb_ies_len > 0 && !prb_ies))
+   return ERR_PTR(-EINVAL);
+
+   len = sizeof(*tlv) + sizeof(*cmd) +
+ sizeof(*tlv) + sizeof(*info) + prb_ies_len +
+ sizeof(*tlv) + roundup(bcn->len, 4);
+   skb = ath10k_wmi_alloc_skb(ar, len);
+   if (!skb)
+   return ERR_PTR(-ENOMEM);
+
+   ptr = (void *)skb->data;
+   tlv = ptr;
+   tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_BCN_TMPL_CMD);
+   tlv->len = __cpu_to_le16(sizeof(*cmd));
+   cmd = (void *)tlv->value;
+   cmd->vdev_id = __cpu_to_le32(vdev_id);
+   cmd->tim_ie_offset = __cpu_to_le32(tim_ie_offset);
+   cmd->buf_len = __cpu_to_le32(bcn->len);
+
+   ptr += sizeof(*tlv);
+   ptr += sizeof(*cmd);
+
+   /* FIXME: prb_ies_len should be probably aligned to 4byte boundary but
+* then it is then impossible to pass original ie len.
+* This chunk is not used yet so if setting probe resp template yields
+* problems with beaconing or crashes firmware look here.
+*/
+   tlv = ptr;
+   tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_BCN_PRB_INFO);
+   tlv->len = __cpu_to_le16(sizeof(*info) + prb_ies_len);
+   info = (void *)tlv->value;
+   info->caps = __cpu_to_le32(prb_caps);
+   info->erp = __cpu_to_le32(prb_erp);
+   memcpy(info->ies, prb_ies, prb_ies_len);
+
+   ptr += sizeof(*tlv);
+   ptr += sizeof(*info);
+   ptr += prb_ies_len;
+
+   tlv = ptr;
+   tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_BYTE);
+   tlv->len = __cpu_to_le16(roundup(bcn->len, 4));
+   memcpy(tlv->value, bcn->data, bcn->len);
+
+   /* FIXME: Adjust TSF? */
+
+   ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv bcn tmpl vdev_id %i\n",
+  vdev_id);
+   return skb;
+}
+
 //
 /* TLV mappings */
 //
@@ -2254,6 +2318,7 @@ static const struct wmi_ops wmi_tlv_ops = {
.gen_dbglog_cfg = ath10k_wmi_tlv_op_gen_dbglog_cfg,
.gen_pktlog_enable = ath10k_wmi_tlv_op_gen_pktlog_ena

[PATCH 3/5] ath10k: implement prb tmpl wmi command

2014-12-17 Thread Bartosz Markowski
From: Michal Kazior 

New firmware revisions with beacon templates need
probe templates as well because they don't forward
probe requests to host at all.

This is required for new firmware to work with
direct probe requests (notably required by hidden
ssid AP).

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/wmi-ops.h | 17 +++
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 50 +++
 drivers/net/wireless/ath/ath10k/wmi-tlv.h |  5 
 drivers/net/wireless/ath/ath10k/wmi.c |  3 ++
 4 files changed, 75 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h 
b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index fb12666..5eff204 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -118,6 +118,8 @@ struct wmi_ops {
u32 tim_ie_offset, struct sk_buff *bcn,
u32 prb_caps, u32 prb_erp,
void *prb_ies, size_t prb_ies_len);
+   struct sk_buff *(*gen_prb_tmpl)(struct ath10k *ar, u32 vdev_id,
+   struct sk_buff *bcn);
 };
 
 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -841,4 +843,19 @@ ath10k_wmi_bcn_tmpl(struct ath10k *ar, u32 vdev_id, u32 
tim_ie_offset,
return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->bcn_tmpl_cmdid);
 }
 
+static inline int
+ath10k_wmi_prb_tmpl(struct ath10k *ar, u32 vdev_id, struct sk_buff *prb)
+{
+   struct sk_buff *skb;
+
+   if (!ar->wmi.ops->gen_prb_tmpl)
+   return -EOPNOTSUPP;
+
+   skb = ar->wmi.ops->gen_prb_tmpl(ar, vdev_id, prb);
+   if (IS_ERR(skb))
+   return PTR_ERR(skb);
+
+   return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->prb_tmpl_cmdid);
+}
+
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index f6ea938..096407c 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -2036,6 +2036,55 @@ ath10k_wmi_tlv_op_gen_bcn_tmpl(struct ath10k *ar, u32 
vdev_id,
return skb;
 }
 
+static struct sk_buff *
+ath10k_wmi_tlv_op_gen_prb_tmpl(struct ath10k *ar, u32 vdev_id,
+  struct sk_buff *prb)
+{
+   struct wmi_tlv_prb_tmpl_cmd *cmd;
+   struct wmi_tlv_bcn_prb_info *info;
+   struct wmi_tlv *tlv;
+   struct sk_buff *skb;
+   void *ptr;
+   size_t len;
+
+   len = sizeof(*tlv) + sizeof(*cmd) +
+ sizeof(*tlv) + sizeof(*info) +
+ sizeof(*tlv) + roundup(prb->len, 4);
+   skb = ath10k_wmi_alloc_skb(ar, len);
+   if (!skb)
+   return ERR_PTR(-ENOMEM);
+
+   ptr = (void *)skb->data;
+   tlv = ptr;
+   tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_PRB_TMPL_CMD);
+   tlv->len = __cpu_to_le16(sizeof(*cmd));
+   cmd = (void *)tlv->value;
+   cmd->vdev_id = __cpu_to_le32(vdev_id);
+   cmd->buf_len = __cpu_to_le32(prb->len);
+
+   ptr += sizeof(*tlv);
+   ptr += sizeof(*cmd);
+
+   tlv = ptr;
+   tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_BCN_PRB_INFO);
+   tlv->len = __cpu_to_le16(sizeof(*info));
+   info = (void *)tlv->value;
+   info->caps = 0;
+   info->erp = 0;
+
+   ptr += sizeof(*tlv);
+   ptr += sizeof(*info);
+
+   tlv = ptr;
+   tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_BYTE);
+   tlv->len = __cpu_to_le16(roundup(prb->len, 4));
+   memcpy(tlv->value, prb->data, prb->len);
+
+   ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv prb tmpl vdev_id %i\n",
+  vdev_id);
+   return skb;
+}
+
 //
 /* TLV mappings */
 //
@@ -2319,6 +2368,7 @@ static const struct wmi_ops wmi_tlv_ops = {
.gen_pktlog_enable = ath10k_wmi_tlv_op_gen_pktlog_enable,
.gen_pktlog_disable = ath10k_wmi_tlv_op_gen_pktlog_disable,
.gen_bcn_tmpl = ath10k_wmi_tlv_op_gen_bcn_tmpl,
+   .gen_prb_tmpl = ath10k_wmi_tlv_op_gen_prb_tmpl,
 };
 
 //
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index c477365..5772519 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -1399,6 +1399,11 @@ struct wmi_tlv_bcn_tmpl_cmd {
__le32 buf_len;
 } __packed;
 
+struct wmi_tlv_prb_tmpl_cmd {
+   __le32 vdev_id;
+   __le32 buf_len;
+} __packed;
+
 void ath10k_wmi_tlv_attach(struct ath10k *ar);
 
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index f75a1a3..dc76ff8 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4639,6 +4639,7 @@ static const struct wmi_ops wmi_ops = {
.gen_pktlog_enable = ath10k_wmi_op_gen_pktlog_enable,
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
/

[PATCH 4/5] ath10k: implement p2p bcn ie command

2014-12-17 Thread Bartosz Markowski
From: Michal Kazior 

Along beacon template host is expected to setup
p2p information elements as well. Implement wmi
interface for it.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/wmi-ops.h | 17 +
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 41 +++
 drivers/net/wireless/ath/ath10k/wmi-tlv.h |  5 
 drivers/net/wireless/ath/ath10k/wmi.c |  3 +++
 4 files changed, 66 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h 
b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index 5eff204..8b783c0 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -120,6 +120,8 @@ struct wmi_ops {
void *prb_ies, size_t prb_ies_len);
struct sk_buff *(*gen_prb_tmpl)(struct ath10k *ar, u32 vdev_id,
struct sk_buff *bcn);
+   struct sk_buff *(*gen_p2p_go_bcn_ie)(struct ath10k *ar, u32 vdev_id,
+const u8 *p2p_ie);
 };
 
 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -858,4 +860,19 @@ ath10k_wmi_prb_tmpl(struct ath10k *ar, u32 vdev_id, struct 
sk_buff *prb)
return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->prb_tmpl_cmdid);
 }
 
+static inline int
+ath10k_wmi_p2p_go_bcn_ie(struct ath10k *ar, u32 vdev_id, const u8 *p2p_ie)
+{
+   struct sk_buff *skb;
+
+   if (!ar->wmi.ops->gen_p2p_go_bcn_ie)
+   return -EOPNOTSUPP;
+
+   skb = ar->wmi.ops->gen_p2p_go_bcn_ie(ar, vdev_id, p2p_ie);
+   if (IS_ERR(skb))
+   return PTR_ERR(skb);
+
+   return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->p2p_go_set_beacon_ie);
+}
+
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 096407c..f1b4b79 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -2085,6 +2085,46 @@ ath10k_wmi_tlv_op_gen_prb_tmpl(struct ath10k *ar, u32 
vdev_id,
return skb;
 }
 
+static struct sk_buff *
+ath10k_wmi_tlv_op_gen_p2p_go_bcn_ie(struct ath10k *ar, u32 vdev_id,
+   const u8 *p2p_ie)
+{
+   struct wmi_tlv_p2p_go_bcn_ie *cmd;
+   struct wmi_tlv *tlv;
+   struct sk_buff *skb;
+   void *ptr;
+   size_t len;
+
+   len = sizeof(*tlv) + sizeof(*cmd) +
+ sizeof(*tlv) + roundup(p2p_ie[1] + 2, 4);
+   skb = ath10k_wmi_alloc_skb(ar, len);
+   if (!skb)
+   return ERR_PTR(-ENOMEM);
+
+   ptr = (void *)skb->data;
+   tlv = ptr;
+   tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_P2P_GO_SET_BEACON_IE);
+   tlv->len = __cpu_to_le16(sizeof(*cmd));
+   cmd = (void *)tlv->value;
+   cmd->vdev_id = __cpu_to_le32(vdev_id);
+   cmd->ie_len = __cpu_to_le32(p2p_ie[1] + 2);
+
+   ptr += sizeof(*tlv);
+   ptr += sizeof(*cmd);
+
+   tlv = ptr;
+   tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_BYTE);
+   tlv->len = __cpu_to_le16(roundup(p2p_ie[1] + 2, 4));
+   memcpy(tlv->value, p2p_ie, p2p_ie[1] + 2);
+
+   ptr += sizeof(*tlv);
+   ptr += roundup(p2p_ie[1] + 2, 4);
+
+   ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv p2p go bcn ie for vdev %i\n",
+  vdev_id);
+   return skb;
+}
+
 //
 /* TLV mappings */
 //
@@ -2369,6 +2409,7 @@ static const struct wmi_ops wmi_tlv_ops = {
.gen_pktlog_disable = ath10k_wmi_tlv_op_gen_pktlog_disable,
.gen_bcn_tmpl = ath10k_wmi_tlv_op_gen_bcn_tmpl,
.gen_prb_tmpl = ath10k_wmi_tlv_op_gen_prb_tmpl,
+   .gen_p2p_go_bcn_ie = ath10k_wmi_tlv_op_gen_p2p_go_bcn_ie,
 };
 
 //
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index 5772519..eb02290 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -1404,6 +1404,11 @@ struct wmi_tlv_prb_tmpl_cmd {
__le32 buf_len;
 } __packed;
 
+struct wmi_tlv_p2p_go_bcn_ie {
+   __le32 vdev_id;
+   __le32 ie_len;
+} __packed;
+
 void ath10k_wmi_tlv_attach(struct ath10k *ar);
 
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index dc76ff8..3a055fd 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4640,6 +4640,7 @@ static const struct wmi_ops wmi_ops = {
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
+   /* .gen_p2p_go_bcn_ie not implemented */
 };
 
 static const struct wmi_ops wmi_10_1_ops = {
@@ -4694,6 +4695,7 @@ static const struct wmi_ops wmi_10_1_ops = {
.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
+   /* .gen_p2p_go_bcn

[PATCH v3] ath10k: fix pm resume after suspend

2014-10-31 Thread Bartosz Markowski
Firmware was crashing when we were trying to warm reset it
after suspend. This was due to the fact that target registeres
can be accessed only if the hardware is awaken.

This patch makes sure to awake the device also on the hif up,
not only in case of probe call.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/pci.c | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index f5e426e..3a6b8a5 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1875,6 +1875,12 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
 
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power up\n");
 
+   ret = ath10k_pci_wake(ar);
+   if (ret) {
+   ath10k_err(ar, "failed to wake up target: %d\n", ret);
+   return ret;
+   }
+
/*
 * Bring the target up cleanly.
 *
@@ -1888,13 +1894,13 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
ret = ath10k_pci_chip_reset(ar);
if (ret) {
ath10k_err(ar, "failed to reset chip: %d\n", ret);
-   goto err;
+   goto err_sleep;
}
 
ret = ath10k_pci_init_pipes(ar);
if (ret) {
ath10k_err(ar, "failed to initialize CE: %d\n", ret);
-   goto err;
+   goto err_sleep;
}
 
ret = ath10k_pci_init_config(ar);
@@ -1914,7 +1920,8 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
 err_ce:
ath10k_pci_ce_deinit(ar);
 
-err:
+err_sleep:
+   ath10k_pci_sleep(ar);
return ret;
 }
 
@@ -1925,6 +1932,8 @@ static void ath10k_pci_hif_power_down(struct ath10k *ar)
/* Currently hif_power_up performs effectively a reset and hif_stop
 * resets the chip as well so there's no point in resetting here.
 */
+
+   ath10k_pci_sleep(ar);
 }
 
 #ifdef CONFIG_PM
@@ -2526,6 +2535,8 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
goto err_deinit_irq;
}
 
+   ath10k_pci_sleep(ar);
+
ret = ath10k_core_register(ar, chip_id);
if (ret) {
ath10k_err(ar, "failed to register driver core: %d\n", ret);
@@ -2577,7 +2588,6 @@ static void ath10k_pci_remove(struct pci_dev *pdev)
ath10k_pci_deinit_irq(ar);
ath10k_pci_ce_deinit(ar);
ath10k_pci_free_pipes(ar);
-   ath10k_pci_sleep(ar);
ath10k_pci_release(ar);
ath10k_core_destroy(ar);
 }
-- 
1.8.2


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


Re: [PATCH] ath10k: fix pm resume after suspend

2014-10-27 Thread Bartosz Markowski
On 23 October 2014 17:10, Kalle Valo  wrote:
> Bartosz Markowski  writes:
>
>> Firmware was crashing when we were trying to warm reset it
>> after suspend. This was due to the fact that target registeres
>> can be accessed only if the hardware is awaken.
>>
>> This patch makes sure to awake the device also on the hif up,
>> not only in case of probe call path.
>>
>> Signed-off-by: Bartosz Markowski 
>
> This one has non-trivial conflicts. Can you rebase, please?

Sure, I've sent a PATCH v2.

-- 
Bartosz

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


[PATCH v2] ath10k: fix pm resume after suspend

2014-10-27 Thread Bartosz Markowski
Firmware was crashing when we were trying to warm reset it
after suspend. This was due to the fact that target registeres
can be accessed only if the hardware is awaken.

This patch makes sure to awake the device also on the hif up,
not only in case of probe call.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/pci.c | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 4a4740b..d31488b 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1877,10 +1877,16 @@ static int ath10k_pci_hif_power_up_warm(struct ath10k 
*ar)
 
 static int ath10k_pci_hif_power_up(struct ath10k *ar)
 {
-   int ret;
+   int ret = 0;
 
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power up\n");
 
+   ret = ath10k_pci_wake(ar);
+   if (ret) {
+   ath10k_err(ar, "failed to wake up target: %d\n", ret);
+   return ret;
+   }
+
/*
 * Hardware CUS232 version 2 has some issues with cold reset and the
 * preferred (and safer) way to perform a device reset is through a
@@ -1895,7 +1901,7 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
ret);
 
if (ath10k_pci_reset_mode == ATH10K_PCI_RESET_WARM_ONLY)
-   return ret;
+   goto err_sleep;
 
ath10k_warn(ar, "trying cold reset\n");
 
@@ -1903,11 +1909,15 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
if (ret) {
ath10k_err(ar, "failed to power up target using cold 
reset too (%d)\n",
   ret);
-   return ret;
+   goto err_sleep;
}
}
 
-   return 0;
+   return ret;
+
+err_sleep:
+   ath10k_pci_sleep(ar);
+   return ret;
 }
 
 static void ath10k_pci_hif_power_down(struct ath10k *ar)
@@ -1915,6 +1925,7 @@ static void ath10k_pci_hif_power_down(struct ath10k *ar)
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power down\n");
 
ath10k_pci_warm_reset(ar);
+   ath10k_pci_sleep(ar);
 }
 
 #ifdef CONFIG_PM
@@ -2516,6 +2527,8 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
goto err_deinit_irq;
}
 
+   ath10k_pci_sleep(ar);
+
ret = ath10k_core_register(ar, chip_id);
if (ret) {
ath10k_err(ar, "failed to register driver core: %d\n", ret);
@@ -2567,7 +2580,6 @@ static void ath10k_pci_remove(struct pci_dev *pdev)
ath10k_pci_deinit_irq(ar);
ath10k_pci_ce_deinit(ar);
ath10k_pci_free_pipes(ar);
-   ath10k_pci_sleep(ar);
ath10k_pci_release(ar);
ath10k_core_destroy(ar);
 }
-- 
1.8.2


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


[PATCH] ath10k: fix pm resume after suspend

2014-10-23 Thread Bartosz Markowski
Firmware was crashing when we were trying to warm reset it
after suspend. This was due to the fact that target registeres
can be accessed only if the hardware is awaken.

This patch makes sure to awake the device also on the hif up,
not only in case of probe call path.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/pci.c | 22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 86f734e..4dee319 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -1858,10 +1858,16 @@ static int ath10k_pci_hif_power_up_warm(struct ath10k 
*ar)
 
 static int ath10k_pci_hif_power_up(struct ath10k *ar)
 {
-   int ret;
+   int ret = 0;
 
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power up\n");
 
+   ret = ath10k_pci_wake(ar);
+   if (ret) {
+   ath10k_err(ar, "failed to wake up target: %d\n", ret);
+   return ret;
+   }
+
/*
 * Hardware CUS232 version 2 has some issues with cold reset and the
 * preferred (and safer) way to perform a device reset is through a
@@ -1876,7 +1882,7 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
ret);
 
if (ath10k_pci_reset_mode == ATH10K_PCI_RESET_WARM_ONLY)
-   return ret;
+   goto err_sleep;
 
ath10k_warn(ar, "trying cold reset\n");
 
@@ -1884,11 +1890,15 @@ static int ath10k_pci_hif_power_up(struct ath10k *ar)
if (ret) {
ath10k_err(ar, "failed to power up target using cold 
reset too (%d)\n",
   ret);
-   return ret;
+   goto err_sleep;
}
}
 
-   return 0;
+   return ret;
+
+err_sleep:
+   ath10k_pci_sleep(ar);
+   return ret;
 }
 
 static void ath10k_pci_hif_power_down(struct ath10k *ar)
@@ -1896,6 +1906,7 @@ static void ath10k_pci_hif_power_down(struct ath10k *ar)
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power down\n");
 
ath10k_pci_warm_reset(ar);
+   ath10k_pci_sleep(ar);
 }
 
 #ifdef CONFIG_PM
@@ -2513,6 +2524,8 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
/* This shouldn't race as the device has been reset above. */
ath10k_pci_irq_disable(ar);
 
+   ath10k_pci_sleep(ar);
+
ret = ath10k_core_register(ar, chip_id);
if (ret) {
ath10k_err(ar, "failed to register driver core: %d\n", ret);
@@ -2564,7 +2577,6 @@ static void ath10k_pci_remove(struct pci_dev *pdev)
ath10k_pci_deinit_irq(ar);
ath10k_pci_ce_deinit(ar);
ath10k_pci_free_ce(ar);
-   ath10k_pci_sleep(ar);
ath10k_pci_release(ar);
ath10k_core_destroy(ar);
 }
-- 
1.8.2


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


Re: ath10k firmware crash

2014-10-15 Thread Bartosz Markowski
On 13 October 2014 14:06, voncken  wrote:
>> >
>> > Have you a benchmark reference with ATH10K ? at this time we can send
>> around 700 Mbit/s, is it the maximum or we can expected better ?
>>
>> If this is OTA then this is pretty good. If this is cabled RF w/ attentuator
>> it should be possible to get ~900mbps of UDP traffic with multiple streams on
>> iperf. At least that's what I was getting on 10.1 firmware (on both AP and
>> STA) last time I checked.
>>
>> Getting more than 700mbps OTA requires AP and STA antenna alignment voodoo.
>>
> I did some tests with a linksys WRT1900AC and I have ~950 mbps OTA easily.

You mean ath10k (STA) VS WRT1900AC get up ~950mbps?
If so, could you say what's the HW, FW version you use?

-- 
Bartosz

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


[PATCH] ath10k: advertise all possible firmware(-api) files

2014-10-06 Thread Bartosz Markowski
This is required if we take into account possibility to load the driver
from initrd (RAM disk), so in other words: very early in the boot process,
before the file system is visible.

In such case we need to have the firmware files accessible from ram disk too,
and this patch guarantee this.

Signed-off-by: Bartosz Markowski 
---
 drivers/net/wireless/ath/ath10k/hw.h  | 1 -
 drivers/net/wireless/ath/ath10k/pci.c | 4 +++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 006a9cb..6dca960 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -28,7 +28,6 @@
 #define QCA988X_HW_2_0_CHIP_ID_REV 0x2
 #define QCA988X_HW_2_0_FW_DIR  "ath10k/QCA988X/hw2.0"
 #define QCA988X_HW_2_0_FW_FILE "firmware.bin"
-#define QCA988X_HW_2_0_FW_3_FILE   "firmware-3.bin"
 #define QCA988X_HW_2_0_OTP_FILE"otp.bin"
 #define QCA988X_HW_2_0_BOARD_DATA_FILE "board.bin"
 #define QCA988X_HW_2_0_PATCH_LOAD_ADDR 0x1234
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 8a04904..730bb18 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2600,5 +2600,7 @@ module_exit(ath10k_pci_exit);
 MODULE_AUTHOR("Qualcomm Atheros");
 MODULE_DESCRIPTION("Driver support for Atheros QCA988X PCIe devices");
 MODULE_LICENSE("Dual BSD/GPL");
-MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_FW_3_FILE);
+MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_FW_FILE);
+MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API2_FILE);
+MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" ATH10K_FW_API3_FILE);
 MODULE_FIRMWARE(QCA988X_HW_2_0_FW_DIR "/" QCA988X_HW_2_0_BOARD_DATA_FILE);
-- 
1.8.2


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


Re: RE : RE : Trouble shooting low rate MCS9 in 802.11ac

2014-08-26 Thread Bartosz Markowski
On 26 August 2014 10:32, Vu Hai NGUYEN  wrote:
>>So probably the air condition you have forces the rate control to pick
>>MCS7 as the most suitable rates.
>
In open AP mode (bridge), CUS223 HW (not WLE900VX however) and on
AP135 platform (customized openwrt SW + bleeding edge of
ath10k/wireless subsystem souces - private backports tarball).. for
UDP (last time I measured) I have around 820Mpbs for UCP both ways and
720Mbps TCP.
>>>
>>> This is in NSS3 -MCS9? Did you get better or worse rate if you clear the 
>>> mask
>>> (iw wlanX set bitrates) cause if I don't config rate, from AP to STA I have 
>>> the best rate
>>> (ie same as MCS7) but from STA to AP my rate is much lower than MCS7 (240 
>>> Mbps
>>> vs 370 Mbps in TCP).
>
>>Yes, NSS-3; Over the RF-cables I'm easily able to get MCS9 rates
>>transmitions without any forced settings (the rate control is picking
>>the highest rates).
>
> Hi Bartosz,
> I connect 2 antennas on my 2 devices together by a RF-cables with an 
> attenuator around -60dBm, config
> each device to use one antenna and force rate to NSS1. But the TCP through 
> put of MCS7 (230 Mbps) is
> always slightly higher than MCS8 (210Mbps) and 9 (190Mbps).
> Can you give me some detail about your RF-cables test-bed? (for example which 
> attenuator did you use?,etc...)
> Thank you in advance.

I have a custom made QCA programmable attenuator and besides this
nothing facy: 2.4GHz and 5GHz RF cables (Nm connectors, u.fl cables +
adaptors etc.)

-Bartosz

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


Re: Performance v/s signal quality graph.

2014-08-05 Thread Bartosz Markowski
On 5 August 2014 17:15, Bart Jooris  wrote:
> Hi Ben,
>
> I enjoyed watching your graph already a few times now ;-)
>
> I have a few questions related to your experiment:
> -about the setup, the cards have 3x3 MIMO so the attenuator has probably
> also three channels which are attenuated in parallel?
> -based on the datasheet of the QCA9880 VHT80_MCS9 reception should break
> around -68dBm. On your graph it breaks around -52dBm, which is not within
> the described tolerances. Do you have any idea what could be causing this?
> Is the noise level higher than expected? Or did I made the wrong
> conclusions? I will try to verify on our setup.
> -my million dollar question to you is related to the approx. 810Mbps UDP
> goodput :-) I already did some experiments over 3 coax cables, I noticed the
> same UDP goodput as over the air, which is around 640Mbps. Watching the
> sniffer I've noticed MCS=9, Data rate=1299.9 Mbps and block ACKs every (in
> avg.) 10 frames. So what is the key to the higher goodput?

Did you platform not suffer from lack of resources? On less powerfull
devices (e.g. ARM based routers) the main blocker for higher
throughput were the host CPU.. On high end x86 laptops I was getting
around 900Mbps UDP in cabled environment some time ago.

Also what mode are you testing AP / STA? Is your DUT bridged or has to
generate the traffic also?

> -related to the hot signal, without having proof I've noticed that  it is
> easier to have higher goodputs with a low tx-power set, like 1 dBm. But
> probably more related to our setup... Which tx-power did you use during your
> experiments? Would you be able to get the same results (point break around
> -52dBm) with another tx-power set?
>
> Thanks,
>
> Bart
>
>
>
> On 07/26/2014 01:15 AM, Ben Greear wrote:
>>
>> Some time back, I ran some tests, and someone (sorry, can't remember or
>> find the email)
>> suggested my signal might be too hot.  I was using a 30 db fixed
>> attenuator inline with the SMA
>> cables.
>>
>> I set up a test today with E5 processor system as station, and a fast i7
>> processor
>> system as AP, with the two systems cabled through our variable attenuator.
>> Open authentication,
>> channel 149, other wifi equipment in area on 5ghz was (mostly) idle or
>> powered down.
>> Kernel is 3.14.13+, latest ath10k CT (10.1.467 based) firmware on both
>> systems
>> (though I don't think that matters much for throughput tests).  10 virtual
>> stations
>> configured on station machine, but only one was actively doing traffic.
>>
>> Here is a udp download v/s rx-signal graph as the attenuator is stepped
>> from 0 to 95.5
>> db attenuation in .5 db steps.
>>
>> http://www.candelatech.com/pdfs/ath10k_atten_vs_throughput.pdf
>>
>> The rx-signal axis is the left hand side.  The green graph is the
>> station's (ie netdev)
>> rx bps, the black is UDP goodput.
>>
>> It seems ath10k (WLE900VX) has no real trouble with hot signals, and runs
>> best between
>> -15 and -52 rx signal level (as reported by the station device).
>>
>> Our systems are not perfectly isolated, so the maximum attenuation is
>> around -85.
>>
>> Enjoy,
>> Ben
>>
>
>
> --
> Bart Jooris
> Department of Information Technology
> Internet Based Communication Networks and Services (IBCN)
> Ghent University - iMinds
> Gaston Crommenlaan 8 (Bus 201), B-9050 Gent, Belgium
> E-mail: bart.joo...@intec.ugent.be
> M: +32 474 59 53 42
> Tel. +32 9 33 14900
> Fax +32 9 33 14899
>
>
>
> ___
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k



-- 
Bartosz

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


Re: ath10k with hostapd

2014-08-05 Thread Bartosz Markowski
On 5 August 2014 15:47, Hayat, Samira  wrote:

[...]

> This is my .config file:
>
> CONFIG_DRIVER_HOSTAP=y
> CONFIG_DRIVER_NL80211=y
>
> CONFIG_IAPP=y
> CONFIG_RSN_PREAUTH=y
> CONFIG_PEERKEY=y
> CONFIG_IEEE80211W=y
> CONFIG_EAP=y
> CONFIG_EAP_MD5=y
> CONFIG_EAP_TLS=y
> CONFIG_EAP_MSCHAPV2=y
> CONFIG_EAP_PEAP=y
> CONFIG_EAP_GTC=y
> CONFIG_EAP_TTLS=y
> CONFIG_IPV6=y
>
> CONFIG_IEEE80211N=y
> CONFIG_IEEE80211AC=y
>
> CONFIG_ACS=y

Then are you sure you are executing the hostapd exec you have actually
compiled, not the distro one?

-Bartosz

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