[PATCH] mac80211: check PN correctly for GCMP-encrypted fragmented MPDUs

2016-02-26 Thread Johannes Berg
From: Johannes Berg 

Just like for CCMP we need to check that for GCMP the fragments
have PNs that increment by one; the spec was updated to fix this
security issue and now has the following text:

The receiver shall discard MSDUs and MMPDUs whose constituent
MPDU PN values are not incrementing in steps of 1.

Adapt the code for CCMP to work for GCMP as well, luckily the
relevant fields already alias each other so no code duplication
is needed (just check the aliasing with BUILD_BUG_ON.)

Cc: sta...@vger.kernel.org
Signed-off-by: Johannes Berg 
---
 net/mac80211/ieee80211_i.h |  2 +-
 net/mac80211/rx.c  | 36 +++-
 2 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 1630975c89f1..804575ff7af5 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -92,7 +92,7 @@ struct ieee80211_fragment_entry {
u16 extra_len;
u16 last_frag;
u8 rx_queue;
-   bool ccmp; /* Whether fragments were encrypted with CCMP */
+   bool check_sequential_pn; /* needed for CCMP/GCMP */
u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
 };
 
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 91279576f4a7..853c71766241 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1777,7 +1777,7 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data 
*sdata,
entry->seq = seq;
entry->rx_queue = rx_queue;
entry->last_frag = frag;
-   entry->ccmp = 0;
+   entry->check_sequential_pn = false;
entry->extra_len = 0;
 
return entry;
@@ -1873,15 +1873,27 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
 rx->seqno_idx, &(rx->skb));
if (rx->key &&
(rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP ||
-rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256) &&
+rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 ||
+rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP ||
+rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) &&
ieee80211_has_protected(fc)) {
int queue = rx->security_idx;
-   /* Store CCMP PN so that we can verify that the next
-* fragment has a sequential PN value. */
-   entry->ccmp = 1;
+
+   /* Store CCMP/GCMP PN so that we can verify that the
+* next fragment has a sequential PN value.
+*/
+   entry->check_sequential_pn = true;
memcpy(entry->last_pn,
   rx->key->u.ccmp.rx_pn[queue],
   IEEE80211_CCMP_PN_LEN);
+   BUILD_BUG_ON(offsetof(struct ieee80211_key,
+ u.ccmp.rx_pn) !=
+offsetof(struct ieee80211_key,
+ u.gcmp.rx_pn));
+   BUILD_BUG_ON(sizeof(rx->key->u.ccmp.rx_pn[queue]) !=
+sizeof(rx->key->u.gcmp.rx_pn[queue]));
+   BUILD_BUG_ON(IEEE80211_CCMP_PN_LEN !=
+IEEE80211_GCMP_PN_LEN);
}
return RX_QUEUED;
}
@@ -1896,15 +1908,21 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
return RX_DROP_MONITOR;
}
 
-   /* Verify that MPDUs within one MSDU have sequential PN values.
-* (IEEE 802.11i, 8.3.3.4.5) */
-   if (entry->ccmp) {
+   /* "The receiver shall discard MSDUs and MMPDUs whose constituent
+*  MPDU PN values are not incrementing in steps of 1."
+* see IEEE P802.11-REVmc/D5.0, 12.5.3.4.4, item d (for CCMP)
+* and IEEE P802.11-REVmc/D5.0, 12.5.5.4.4, item d (for GCMP)
+*/
+   if (entry->check_sequential_pn) {
int i;
u8 pn[IEEE80211_CCMP_PN_LEN], *rpn;
int queue;
+
if (!rx->key ||
(rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP &&
-rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP_256))
+rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP_256 &&
+rx->key->conf.cipher != WLAN_CIPHER_SUITE_GCMP &&
+rx->key->conf.cipher != WLAN_CIPHER_SUITE_GCMP_256))
return RX_DROP_UNUSABLE;
memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN);
for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) {
-- 
2.7.0

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

[PATCH] mac80211: remove wdev/vif conversion functions

2016-02-26 Thread Felix Fietkau
Nothing uses them

Signed-off-by: Felix Fietkau 
---
 include/net/mac80211.h | 26 --
 net/mac80211/util.c| 28 
 2 files changed, 54 deletions(-)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0c09da3..e11d751 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1439,32 +1439,6 @@ static inline bool ieee80211_vif_is_mesh(struct 
ieee80211_vif *vif)
 }
 
 /**
- * wdev_to_ieee80211_vif - return a vif struct from a wdev
- * @wdev: the wdev to get the vif for
- *
- * This can be used by mac80211 drivers with direct cfg80211 APIs
- * (like the vendor commands) that get a wdev.
- *
- * Note that this function may return %NULL if the given wdev isn't
- * associated with a vif that the driver knows about (e.g. monitor
- * or AP_VLAN interfaces.)
- */
-struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
-
-/**
- * ieee80211_vif_to_wdev - return a wdev struct from a vif
- * @vif: the vif to get the wdev for
- *
- * This can be used by mac80211 drivers with direct cfg80211 APIs
- * (like the vendor commands) that needs to get the wdev for a vif.
- *
- * Note that this function may return %NULL if the given wdev isn't
- * associated with a vif that the driver knows about (e.g. monitor
- * or AP_VLAN interfaces.)
- */
-struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif);
-
-/**
  * enum ieee80211_key_flags - key flags
  *
  * These flags are used for communication about keys between the driver
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 89f7179..4482625 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -694,34 +694,6 @@ void ieee80211_iterate_stations_atomic(struct ieee80211_hw 
*hw,
 }
 EXPORT_SYMBOL_GPL(ieee80211_iterate_stations_atomic);
 
-struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev)
-{
-   struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
-
-   if (!ieee80211_sdata_running(sdata) ||
-   !(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
-   return NULL;
-   return >vif;
-}
-EXPORT_SYMBOL_GPL(wdev_to_ieee80211_vif);
-
-struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif)
-{
-   struct ieee80211_sub_if_data *sdata;
-
-   if (!vif)
-   return NULL;
-
-   sdata = vif_to_sdata(vif);
-
-   if (!ieee80211_sdata_running(sdata) ||
-   !(sdata->flags & IEEE80211_SDATA_IN_DRIVER))
-   return NULL;
-
-   return >wdev;
-}
-EXPORT_SYMBOL_GPL(ieee80211_vif_to_wdev);
-
 /*
  * Nothing should have been stuffed into the workqueue during
  * the suspend->resume cycle. Since we can't check each caller
-- 
2.2.2

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


[PATCH V9 1/2] nl80211: add feature for BSS selection support

2016-02-26 Thread Arend van Spriel
Introducing a new feature that the driver can use to
indicate the driver/firmware supports configuration of BSS
selection criteria upon CONNECT command. This can be useful
when multiple BSS-es are found belonging to the same ESS,
ie. Infra-BSS with same SSID. The criteria can then be used to
offload selection of a preferred BSS.

Reviewed-by: Hante Meuleman 
Reviewed-by: Franky (Zhenhui) Lin 
Reviewed-by: Pieter-Paul Giesberts 
Reviewed-by: Lei Zhang 
Signed-off-by: Arend van Spriel 
---
V7:
 - add validatioin using nla_ok().
V8:
 - use IEEE80211_NUM_BANDS.
 - add NESTED policy for NL80211_ATTR_BSS_SELECT.
 - add braces in for loop.
V9:
 - use ieee80211_band iso nl80211_band.
---
 include/net/cfg80211.h   |  34 ++
 include/uapi/linux/nl80211.h |  51 +
 net/wireless/core.c  |   4 ++
 net/wireless/nl80211.c   | 106 +++
 4 files changed, 195 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9e1b24c..c6ddb69 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1857,6 +1857,33 @@ struct cfg80211_ibss_params {
 };
 
 /**
+ * struct cfg80211_bss_select_adjust - BSS selection with RSSI adjustment.
+ *
+ * @band: band of BSS which should match for RSSI level adjustment.
+ * @delta: value of RSSI level adjustment.
+ */
+struct cfg80211_bss_select_adjust {
+   enum ieee80211_band band;
+   s8 delta;
+};
+
+/**
+ * struct cfg80211_bss_selection - connection parameters for BSS selection.
+ *
+ * @behaviour: requested BSS selection behaviour.
+ * @param: parameters for requestion behaviour.
+ * @band_pref: preferred band for %NL80211_BSS_SELECT_ATTR_BAND_PREF.
+ * @adjust: parameters for %NL80211_BSS_SELECT_ATTR_RSSI_ADJUST.
+ */
+struct cfg80211_bss_selection {
+   enum nl80211_bss_select_attr behaviour;
+   union {
+   enum ieee80211_band band_pref;
+   struct cfg80211_bss_select_adjust adjust;
+   } param;
+};
+
+/**
  * struct cfg80211_connect_params - Connection parameters
  *
  * This structure provides information needed to complete IEEE 802.11
@@ -1893,6 +1920,7 @@ struct cfg80211_ibss_params {
  * @vht_capa_mask: The bits of vht_capa which are to be used.
  * @pbss: if set, connect to a PCP instead of AP. Valid for DMG
  * networks.
+ * @bss_select: criteria to be used for BSS selection.
  */
 struct cfg80211_connect_params {
struct ieee80211_channel *channel;
@@ -1916,6 +1944,7 @@ struct cfg80211_connect_params {
struct ieee80211_vht_cap vht_capa;
struct ieee80211_vht_cap vht_capa_mask;
bool pbss;
+   struct cfg80211_bss_selection bss_select;
 };
 
 /**
@@ -3184,6 +3213,9 @@ struct wiphy_vendor_command {
  * low rssi when a frame is heard on different channel, then it should set
  * this variable to the maximal offset for which it can compensate.
  * This value should be set in MHz.
+ * @bss_select_support: bitmask indicating the BSS selection criteria supported
+ * by the driver in the .connect() callback. The bit position maps to the
+ * attribute indices defined in  nl80211_bss_select_attr.
  */
 struct wiphy {
/* assign these fields before you register the wiphy */
@@ -3306,6 +3338,8 @@ struct wiphy {
u8 max_num_csa_counters;
u8 max_adj_channel_rssi_comp;
 
+   u32 bss_select_support;
+
char priv[0] __aligned(NETDEV_ALIGN);
 };
 
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 5a30a75..ee55440 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1795,6 +1795,12 @@ enum nl80211_commands {
  * in a PBSS. Specified in %NL80211_CMD_CONNECT to request
  * connecting to a PCP, and in %NL80211_CMD_START_AP to start
  * a PCP instead of AP. Relevant for DMG networks only.
+ * @NL80211_ATTR_BSS_SELECT: nested attribute for driver supporting the
+ * BSS selection feature. When used with %NL80211_CMD_GET_WIPHY it contains
+ * attributes according  nl80211_bss_select_attr to indicate what
+ * BSS selection behaviours are supported. When used with 
%NL80211_CMD_CONNECT
+ * it contains the behaviour-specific attribute containing the parameters 
for
+ * BSS selection to be done by driver and/or firmware.
  *
  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
  * @NL80211_ATTR_MAX: highest attribute number currently defined
@@ -2171,6 +2177,7 @@ enum nl80211_attrs {
NL80211_ATTR_SCHED_SCAN_PLANS,
 
NL80211_ATTR_PBSS,
+   NL80211_ATTR_BSS_SELECT,
 
/* add attributes here, update the policy in nl80211.c */
 
@@ -4665,4 +4672,48 @@ enum nl80211_sched_scan_plan {
__NL80211_SCHED_SCAN_PLAN_AFTER_LAST - 1
 };
 
+/**
+ * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters.
+ *
+ * @band: band 

[PATCH V9 2/2] brcmfmac: add support for nl80211 BSS_SELECT feature

2016-02-26 Thread Arend van Spriel
Announce support for nl80211 feature BSS_SELECT and process
BSS selection behaviour provided in .connect() callback.

Reviewed-by: Hante Meuleman 
Reviewed-by: Franky (Zhenhui) Lin 
Reviewed-by: Pieter-Paul Giesberts 
Reviewed-by: Lei Zhang 
Signed-off-by: Arend van Spriel 
---
 .../broadcom/brcm80211/brcmfmac/cfg80211.c | 70 +-
 .../wireless/broadcom/brcm80211/brcmfmac/common.c  | 38 +++-
 .../wireless/broadcom/brcm80211/brcmfmac/core.h|  1 +
 .../wireless/broadcom/brcm80211/brcmfmac/fwil.h|  1 +
 4 files changed, 92 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c 
b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 7b01e4d..3e02168 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -238,6 +238,20 @@ struct parsed_vndr_ies {
struct parsed_vndr_ie_info ie_info[VNDR_IE_PARSE_LIMIT];
 };
 
+static u8 nl80211_band_to_fwil(enum nl80211_band band)
+{
+   switch (band) {
+   case NL80211_BAND_2GHZ:
+   return WLC_BAND_2G;
+   case NL80211_BAND_5GHZ:
+   return WLC_BAND_5G;
+   default:
+   WARN_ON(1);
+   break;
+   }
+   return 0;
+}
+
 static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf,
   struct cfg80211_chan_def *ch)
 {
@@ -1737,6 +1751,50 @@ enum nl80211_auth_type brcmf_war_auth_type(struct 
brcmf_if *ifp,
return type;
 }
 
+static void brcmf_set_join_pref(struct brcmf_if *ifp,
+   struct cfg80211_bss_selection *bss_select)
+{
+   struct brcmf_join_pref_params join_pref_params[2];
+   enum nl80211_band band;
+   int err, i = 0;
+
+   join_pref_params[i].len = 2;
+   join_pref_params[i].rssi_gain = 0;
+
+   if (bss_select->behaviour != NL80211_BSS_SELECT_ATTR_BAND_PREF)
+   brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_ASSOC_PREFER, 
WLC_BAND_AUTO);
+
+   switch (bss_select->behaviour) {
+   case __NL80211_BSS_SELECT_ATTR_INVALID:
+   brcmf_c_set_joinpref_default(ifp);
+   return;
+   case NL80211_BSS_SELECT_ATTR_BAND_PREF:
+   join_pref_params[i].type = BRCMF_JOIN_PREF_BAND;
+   band = bss_select->param.band_pref;
+   join_pref_params[i].band = nl80211_band_to_fwil(band);
+   i++;
+   break;
+   case NL80211_BSS_SELECT_ATTR_RSSI_ADJUST:
+   join_pref_params[i].type = BRCMF_JOIN_PREF_RSSI_DELTA;
+   band = bss_select->param.adjust.band;
+   join_pref_params[i].band = nl80211_band_to_fwil(band);
+   join_pref_params[i].rssi_gain = bss_select->param.adjust.delta;
+   i++;
+   break;
+   case NL80211_BSS_SELECT_ATTR_RSSI:
+   default:
+   break;
+   }
+   join_pref_params[i].type = BRCMF_JOIN_PREF_RSSI;
+   join_pref_params[i].len = 2;
+   join_pref_params[i].rssi_gain = 0;
+   join_pref_params[i].band = 0;
+   err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params,
+  sizeof(join_pref_params));
+   if (err)
+   brcmf_err("Set join_pref error (%d)\n", err);
+}
+
 static s32
 brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev,
   struct cfg80211_connect_params *sme)
@@ -1862,11 +1920,11 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct 
net_device *ndev,
ext_join_params->scan_le.scan_type = -1;
ext_join_params->scan_le.home_time = cpu_to_le32(-1);
 
-   if (sme->bssid)
+   if (sme->bssid) {
memcpy(_join_params->assoc_le.bssid, sme->bssid, ETH_ALEN);
-   else
+   } else {
eth_broadcast_addr(ext_join_params->assoc_le.bssid);
-
+   }
if (cfg->channel) {
ext_join_params->assoc_le.chanspec_num = cpu_to_le32(1);
 
@@ -1893,6 +1951,8 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct 
net_device *ndev,
ext_join_params->scan_le.nprobes = cpu_to_le32(-1);
}
 
+   brcmf_set_join_pref(ifp, >bss_select);
+
err  = brcmf_fil_bsscfg_data_set(ifp, "join", ext_join_params,
 join_params_size);
kfree(ext_join_params);
@@ -6179,6 +6239,10 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct 
brcmf_if *ifp)
wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
wiphy->cipher_suites = __wl_cipher_suites;
wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites);
+   wiphy->bss_select_support = BIT(NL80211_BSS_SELECT_ATTR_RSSI) |
+   BIT(NL80211_BSS_SELECT_ATTR_BAND_PREF) |
+   

pull-request: mac80211-next 2016-02-26

2016-02-26 Thread Johannes Berg
Hi Dave,

Let's try this again. I backed out some of the rfkill changes
that are buggy and fixed some of that too. I also left out the
one that generated the big discussion, but I still think it's
the saner thing to do rather than requiring userspace to poke
around that much with sysfs when all it wants to do is tell
us what it thinks should be "airplane mode". Anyway, wanted to
get these things in before sorting that out.

Still the ARM patch in here - acked by the relevant people to
fit into the series (rfkill -> ARM -> rfkill with dependencies
that way); and, as Emmanuel reminded me, an iwlwifi patch that
has similar dependency issues and we decided to take through
my tree.

Let me know if there's any problem.

Thanks,
johannes



The following changes since commit 725da8dee445662beea77d3f42c3f4c79f7a7a0e:

  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (2016-01-13 
00:22:13 -0500)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git 
tags/mac80211-next-for-davem-2016-02-26

for you to fetch changes up to 50ee738d7271fe825e4024cdfa5c5301a871e2c2:

  rfkill: Add documentation about LED triggers (2016-02-24 09:13:12 +0100)


Here's another round of updates for -next:
 * big A-MSDU RX performance improvement (avoid linearize of paged RX)
 * rfkill changes: cleanups, documentation, platform properties
 * basic PBSS support in cfg80211
 * MU-MIMO action frame processing support
 * BlockAck reordering & duplicate detection offload support
 * various cleanups & little fixes


Arnd Bergmann (1):
  mac80211: avoid excessive stack usage in sta_info

Beni Lev (1):
  cfg80211: Add global RRM capability

Bjorn Andersson (1):
  mac80211: Make addr const in SET_IEEE80211_PERM_ADDR()

Bob Copeland (1):
  mac80211: mesh: drop constant field mean_chain_len

Eliad Peller (3):
  mac80211: move TKIP TX IVs to public part of key struct
  iwlwifi: mvm: move TX PN assignment for TKIP to the driver
  mac80211: remove ieee80211_get_key_tx_seq/ieee80211_set_key_tx_seq

Emmanuel Grumbach (1):
  mac80211: limit the A-MSDU Tx based on peer's capabilities

Felix Fietkau (5):
  mac80211: move A-MSDU skb_linearize call to ieee80211_amsdu_to_8023s
  cfg80211: add function for 802.3 conversion with separate output buffer
  cfg80211: add support for non-linear skbs in ieee80211_amsdu_to_8023s
  cfg80211: fix faulty variable initialization in ieee80211_amsdu_to_8023s
  cfg80211: reuse existing page fragments in A-MSDU rx

Geliang Tang (1):
  cfg80211/mac80211: use to_delayed_work

Grzegorz Bajorski (1):
  mac80211: allow drivers to report (non-)monitor frames

Heikki Krogerus (4):
  net: rfkill: add rfkill_find_type function
  net: rfkill: gpio: get the name and type from device property
  ARM: tegra: use build-in device properties with rfkill_gpio
  net: rfkill: gpio: remove rfkill_gpio_platform_data

Henning Rogge (3):
  mac80211: Remove MPP table entries with MPath
  mac80211: let unused MPP table entries timeout
  mac80211: Unify mesh and mpp path removal function

Ilan Peer (1):
  mac80211: Recalc min chandef when station is associated

Johannes Berg (8):
  cfg80211: remove CFG80211_REG_DEBUG
  mac80211: document status.freq restrictions
  mac80211: refactor HT/VHT to chandef code
  mac80211_hwsim: remove shadowing variable
  rfkill: disentangle polling pause and suspend
  mac80211: add RX_FLAG_MACTIME_PLCP_START
  mac80211: always print a message when disconnecting
  mac80211: change ieee80211_rx_reorder_ready() arguments

Jouni Malinen (1):
  mac80211: Interoperability workaround for 80+80 and 160 MHz channels

João Paulo Rechi Vita (10):
  rfkill: use variable instead of duplicating the expression
  rfkill: remove/inline __rfkill_set_hw_state
  rfkill: Remove obsolete "claim" sysfs interface
  rfkill: Update userspace API documentation
  rfkill: Improve documentation language
  rfkill: Remove extra blank line
  rfkill: Point to the correct deprecated doc location
  rfkill: Move "state" sysfs file back to stable
  rfkill: Factor rfkill_global_states[].cur assignments
  rfkill: Add documentation about LED triggers

Lior David (1):
  cfg80211: basic support for PBSS network type

Lorenzo Bianconi (2):
  mac80211: fix wiphy supported_band access
  cfg80211: add radiotap VHT info to rtap_namespace_sizes

Michal Kazior (3):
  mac80211: fix txq queue related crashes
  mac80211: fix unnecessary frame drops in mesh fwding
  mac80211: expose txq queue depth and size to drivers

Ola Olsson (2):
  cfg80211: add more warnings for inconsistent ops
  cfg80211: Fix some linguistics in Kconfig

Sara Sharon (10):
  mac80211: process and save VHT 

[PATCH v2 3/3] mac80211_hwsim: Support a hw scan request for a specific BSSID

2016-02-26 Thread Jouni Malinen
If the hw scan request specifies a single BSSID, use that value instead
of the wildcard BSSID in the Probe Request frames.

Signed-off-by: Jouni Malinen 
---
 drivers/net/wireless/mac80211_hwsim.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index a723a85..281c6b7 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1909,6 +1909,7 @@ static void hw_scan_work(struct work_struct *work)
/* send probes */
for (i = 0; i < req->n_ssids; i++) {
struct sk_buff *probe;
+   struct ieee80211_mgmt *mgmt;
 
probe = ieee80211_probereq_get(hwsim->hw,
   hwsim->scan_addr,
@@ -1918,6 +1919,10 @@ static void hw_scan_work(struct work_struct *work)
if (!probe)
continue;
 
+   mgmt = (struct ieee80211_mgmt *) probe->data;
+   memcpy(mgmt->da, req->bssid, ETH_ALEN);
+   memcpy(mgmt->bssid, req->bssid, ETH_ALEN);
+
if (req->ie_len)
memcpy(skb_put(probe, req->ie_len), req->ie,
   req->ie_len);
-- 
1.9.1

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


[PATCH v2 1/3] cfg80211: Allow a scan request for a specific BSSID

2016-02-26 Thread Jouni Malinen
This allows scans for a specific BSSID to be optimized by the user space
application by requesting the driver to set the Probe Request frame
BSSID field (Address 3) to the specified BSSID instead of the wildcard
BSSID. This prevents other APs from replying which reduces airtime need
and latency in getting the response from the target AP through.

This is an optimization and as such, it is acceptable for some of the
drivers not to support the mechanism. If not supported, the wildcard
BSSID will be used and more responses may be received.

Signed-off-by: Jouni Malinen 
---

Notes:
v2: Updated two forgotten rdev_scan() callers

 include/net/cfg80211.h   | 2 ++
 include/uapi/linux/nl80211.h | 4 +++-
 net/wireless/nl80211.c   | 6 ++
 net/wireless/scan.c  | 2 ++
 net/wireless/sme.c   | 2 ++
 5 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9e1b24c..14c0c43 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1455,6 +1455,7 @@ struct cfg80211_ssid {
  * @mac_addr_mask: MAC address mask used with randomisation, bits that
  * are 0 in the mask should be randomised, bits that are 1 should
  * be taken from the @mac_addr
+ * @bssid: BSSID to scan for (most commonly, the wildcard BSSID)
  */
 struct cfg80211_scan_request {
struct cfg80211_ssid *ssids;
@@ -1471,6 +1472,7 @@ struct cfg80211_scan_request {
 
u8 mac_addr[ETH_ALEN] __aligned(2);
u8 mac_addr_mask[ETH_ALEN] __aligned(2);
+   u8 bssid[ETH_ALEN] __aligned(2);
 
/* internal */
struct wiphy *wiphy;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 5a30a75..23bf066 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -322,7 +322,9 @@
  * @NL80211_CMD_GET_SCAN: get scan results
  * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
  * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
- * probe requests at CCK rate or not.
+ * probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to
+ * specify a BSSID to scan for; if not included, the wildcard BSSID will
+ * be used.
  * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
  * NL80211_CMD_GET_SCAN and on the "scan" multicast group)
  * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 98c9242..1b43f78 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5996,6 +5996,12 @@ static int nl80211_trigger_scan(struct sk_buff *skb, 
struct genl_info *info)
request->no_cck =
nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]);
 
+   if (info->attrs[NL80211_ATTR_MAC])
+   memcpy(request->bssid, nla_data(info->attrs[NL80211_ATTR_MAC]),
+  ETH_ALEN);
+   else
+   eth_broadcast_addr(request->bssid);
+
request->wdev = wdev;
request->wiphy = >wiphy;
request->scan_start = jiffies;
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 14d5369..50ea8e3 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -1293,6 +1293,8 @@ int cfg80211_wext_siwscan(struct net_device *dev,
if (wiphy->bands[i])
creq->rates[i] = (1 << wiphy->bands[i]->n_bitrates) - 1;
 
+   eth_broadcast_addr(creq->bssid);
+
rdev->scan_req = creq;
err = rdev_scan(rdev, creq);
if (err) {
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 5445581..65882d2 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -119,6 +119,8 @@ static int cfg80211_conn_scan(struct wireless_dev *wdev)
wdev->conn->params.ssid_len);
request->ssids[0].ssid_len = wdev->conn->params.ssid_len;
 
+   eth_broadcast_addr(request->bssid);
+
request->wdev = wdev;
request->wiphy = >wiphy;
request->scan_start = jiffies;
-- 
1.9.1

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


[PATCH v2 2/3] mac80211: Support a scan request for a specific BSSID

2016-02-26 Thread Jouni Malinen
If the cfg80211 scan trigger operation specifies a single BSSID, use
that value instead of the wildcard BSSID in the Probe Request frames.

Signed-off-by: Jouni Malinen 
---

Notes:
v2: Fix bssid setting for hw_scan

 net/mac80211/scan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index ae980ce..70f9d5a 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -303,6 +303,7 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local 
*local)
ether_addr_copy(local->hw_scan_req->req.mac_addr, req->mac_addr);
ether_addr_copy(local->hw_scan_req->req.mac_addr_mask,
req->mac_addr_mask);
+   ether_addr_copy(local->hw_scan_req->req.bssid, req->bssid);
 
return true;
 }
@@ -497,7 +498,7 @@ static void ieee80211_scan_state_send_probe(struct 
ieee80211_local *local,
 
for (i = 0; i < scan_req->n_ssids; i++)
ieee80211_send_probe_req(
-   sdata, local->scan_addr, NULL,
+   sdata, local->scan_addr, scan_req->bssid,
scan_req->ssids[i].ssid, scan_req->ssids[i].ssid_len,
scan_req->ie, scan_req->ie_len,
scan_req->rates[band], false,
@@ -562,6 +563,7 @@ static int __ieee80211_start_scan(struct 
ieee80211_sub_if_data *sdata,
req->n_channels * sizeof(req->channels[0]);
local->hw_scan_req->req.ie = ies;
local->hw_scan_req->req.flags = req->flags;
+   eth_broadcast_addr(local->hw_scan_req->req.bssid);
 
local->hw_scan_band = 0;
 
-- 
1.9.1

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


Re: [PATCH] ath10k: parse Rx MAC timestamp in mgmt frame for FW 10.4

2016-02-26 Thread kbuild test robot
Hi Peter,

[auto build test ERROR on wireless-drivers-next/master]
[also build test ERROR on v4.5-rc5 next-20160226]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/Peter-Oh/ath10k-parse-Rx-MAC-timestamp-in-mgmt-frame-for-FW-10-4/20160227-031048
base:   
https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git 
master
config: sparc64-allyesconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=sparc64 

All errors (new ones prefixed by >>):

   drivers/net/wireless/ath/ath10k/wmi.c: In function 
'ath10k_wmi_10_4_op_pull_mgmt_rx_ev':
>> drivers/net/wireless/ath/ath10k/wmi.c:2236:33: error: 
>> 'WMI_RX_STATUS_EXT_INFO' undeclared (first use in this function)
 if (le32_to_cpu(arg->status) & WMI_RX_STATUS_EXT_INFO) {
^
   drivers/net/wireless/ath/ath10k/wmi.c:2236:33: note: each undeclared 
identifier is reported only once for each function it appears in
   In file included from arch/sparc/include/asm/string.h:4:0,
from include/linux/string.h:18,
from include/linux/bitmap.h:8,
from include/linux/cpumask.h:11,
from include/linux/rcupdate.h:40,
from include/linux/rbtree.h:34,
from include/linux/mm_types.h:9,
from include/linux/kmemcheck.h:4,
from include/linux/skbuff.h:18,
from drivers/net/wireless/ath/ath10k/wmi.c:18:
>> drivers/net/wireless/ath/ath10k/wmi.c:2239:14: error: 'struct 
>> wmi_mgmt_rx_ev_arg' has no member named 'ext_info'
  memcpy(>ext_info, ext_info,
 ^
   arch/sparc/include/asm/string_64.h:25:42: note: in definition of macro 
'memcpy'
#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
 ^
>> drivers/net/wireless/ath/ath10k/wmi.c:2240:17: error: invalid application of 
>> 'sizeof' to incomplete type 'struct wmi_mgmt_rx_ext_info'
 sizeof(struct wmi_mgmt_rx_ext_info));
^
   arch/sparc/include/asm/string_64.h:25:48: note: in definition of macro 
'memcpy'
#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
   ^

vim +/WMI_RX_STATUS_EXT_INFO +2236 drivers/net/wireless/ath/ath10k/wmi.c

  2230  arg->rate = ev_hdr->rate;
  2231  
  2232  msdu_len = __le32_to_cpu(arg->buf_len);
  2233  if (skb->len < msdu_len)
  2234  return -EPROTO;
  2235  
> 2236  if (le32_to_cpu(arg->status) & WMI_RX_STATUS_EXT_INFO) {
  2237  len = ALIGN(le32_to_cpu(arg->buf_len), 4);
  2238  ext_info = (struct wmi_mgmt_rx_ext_info *)(skb->data + 
len);
> 2239  memcpy(>ext_info, ext_info,
> 2240 sizeof(struct wmi_mgmt_rx_ext_info));
  2241  }
  2242  
  2243  /* Make sure bytes added for padding are removed. */

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[PATCH] ath10k: parse Rx MAC timestamp in mgmt frame for FW 10.4

2016-02-26 Thread Peter Oh
Check and parse Rx MAC timestamp when firmware sets its flag
to status variable.
10.4 firmware adds it in Rx beacon frame only at this moment.
Drivers and mac80211 may utilize it to detect such clockdrift
or beacon collision and use the result for beacon collision
avoidance.

Signed-off-by: Peter Oh 
---
 drivers/net/wireless/ath/ath10k/wmi.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index 1ce6742..94968d6 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2211,6 +2211,8 @@ static int ath10k_wmi_10_4_op_pull_mgmt_rx_ev(struct 
ath10k *ar,
struct wmi_10_4_mgmt_rx_hdr *ev_hdr;
size_t pull_len;
u32 msdu_len;
+   struct wmi_mgmt_rx_ext_info *ext_info;
+   u32 len;
 
ev = (struct wmi_10_4_mgmt_rx_event *)skb->data;
ev_hdr = >hdr;
@@ -2231,6 +2233,13 @@ static int ath10k_wmi_10_4_op_pull_mgmt_rx_ev(struct 
ath10k *ar,
if (skb->len < msdu_len)
return -EPROTO;
 
+   if (le32_to_cpu(arg->status) & WMI_RX_STATUS_EXT_INFO) {
+   len = ALIGN(le32_to_cpu(arg->buf_len), 4);
+   ext_info = (struct wmi_mgmt_rx_ext_info *)(skb->data + len);
+   memcpy(>ext_info, ext_info,
+  sizeof(struct wmi_mgmt_rx_ext_info));
+   }
+
/* Make sure bytes added for padding are removed. */
skb_trim(skb, msdu_len);
 
-- 
1.9.1

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


[PATCH v5] ath10k: set MAC timestamp in management Rx frame

2016-02-26 Thread Peter Oh
Check and set Rx MAC timestamp when firmware indicates it.
Firmware adds it in Rx beacon frame only at this moment.
Driver and mac80211 may utilize it to detect such clockdrift
or beacon collision and use the result for beacon collision
avoidance.

Signed-off-by: Peter Oh 
---

v2:
 - fix kbuild test robot warning, left shift count >= width of type,
   at __le32_to_cpu(arg.ext_info.rx_mac_timestamp_u32) << 32
v3:
 - correct ext_info to start 4-byte aligned
 - make struct wmi_mgmt_rx_ext_info 4-byte aligned to comply FW's intention
v4:
 - fix endianness warnings, restricted __le32 degrades to integer
v5:
 - use ALIGN for better read

 drivers/net/wireless/ath/ath10k/wmi.c | 15 +++
 drivers/net/wireless/ath/ath10k/wmi.h |  8 
 2 files changed, 23 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index 1ce6742..a343e74 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2167,8 +2167,10 @@ static int ath10k_wmi_op_pull_mgmt_rx_ev(struct ath10k 
*ar, struct sk_buff *skb,
struct wmi_mgmt_rx_event_v1 *ev_v1;
struct wmi_mgmt_rx_event_v2 *ev_v2;
struct wmi_mgmt_rx_hdr_v1 *ev_hdr;
+   struct wmi_mgmt_rx_ext_info *ext_info;
size_t pull_len;
u32 msdu_len;
+   u32 len;
 
if (test_bit(ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX, ar->fw_features)) {
ev_v2 = (struct wmi_mgmt_rx_event_v2 *)skb->data;
@@ -2195,6 +2197,12 @@ static int ath10k_wmi_op_pull_mgmt_rx_ev(struct ath10k 
*ar, struct sk_buff *skb,
if (skb->len < msdu_len)
return -EPROTO;
 
+   if (le32_to_cpu(arg->status) & WMI_RX_STATUS_EXT_INFO) {
+   len = ALIGN(le32_to_cpu(arg->buf_len), 4);
+   ext_info = (struct wmi_mgmt_rx_ext_info *)(skb->data + len);
+   memcpy(>ext_info, ext_info,
+  sizeof(struct wmi_mgmt_rx_ext_info));
+   }
/* the WMI buffer might've ended up being padded to 4 bytes due to HTC
 * trailer with credit update. Trim the excess garbage.
 */
@@ -2281,6 +2289,13 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct 
sk_buff *skb)
if (rx_status & WMI_RX_STATUS_ERR_MIC)
status->flag |= RX_FLAG_MMIC_ERROR;
 
+   if (rx_status & WMI_RX_STATUS_EXT_INFO) {
+   status->mactime =
+   __le32_to_cpu(arg.ext_info.rx_mac_timestamp_l32) |
+   (u64)__le32_to_cpu(arg.ext_info.rx_mac_timestamp_u32)
+   << 32;
+   status->flag |= RX_FLAG_MACTIME_END;
+   }
/* Hardware can Rx CCK rates on 5GHz. In that case phy_mode is set to
 * MODE_11B. This means phy_mode is not a reliable source for the band
 * of mgmt rx.
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h 
b/drivers/net/wireless/ath/ath10k/wmi.h
index 4d3cbc4..f209d51 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -3037,11 +3037,18 @@ struct wmi_10_4_mgmt_rx_event {
u8 buf[0];
 } __packed;
 
+struct wmi_mgmt_rx_ext_info {
+   __le32 rx_mac_timestamp_l32;
+   __le32 rx_mac_timestamp_u32;
+} __packed __aligned(4);
+
 #define WMI_RX_STATUS_OK   0x00
 #define WMI_RX_STATUS_ERR_CRC  0x01
 #define WMI_RX_STATUS_ERR_DECRYPT  0x08
 #define WMI_RX_STATUS_ERR_MIC  0x10
 #define WMI_RX_STATUS_ERR_KEY_CACHE_MISS   0x20
+/* Extension data at the end of mgmt frame */
+#define WMI_RX_STATUS_EXT_INFO 0x40
 
 #define PHY_ERROR_GEN_SPECTRAL_SCAN0x26
 #define PHY_ERROR_GEN_FALSE_RADAR_EXT  0x24
@@ -6116,6 +6123,7 @@ struct wmi_mgmt_rx_ev_arg {
__le32 phy_mode;
__le32 buf_len;
__le32 status; /* %WMI_RX_STATUS_ */
+   struct wmi_mgmt_rx_ext_info ext_info;
 };
 
 struct wmi_ch_info_ev_arg {
-- 
1.9.1

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


Re: [RFC/RFT] mac80211: implement fq_codel for software queuing

2016-02-26 Thread Michal Kazior
On 26 February 2016 at 17:48, Felix Fietkau  wrote:
[...]
>> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
>> index af584f7cdd63..f42f898cb8b5 100644
>> --- a/net/mac80211/tx.c
>> +++ b/net/mac80211/tx.c
>> + [...]
>> +static void ieee80211_txq_enqueue(struct ieee80211_local *local,
>> +   struct txq_info *txqi,
>> +   struct sk_buff *skb)
>> +{
>> + struct ieee80211_fq *fq = >fq;
>> + struct ieee80211_hw *hw = >hw;
>> + struct txq_flow *flow;
>> + struct txq_flow *i;
>> + size_t idx = fq_hash(fq, skb);
>> +
>> + flow = >flows[idx];
>> +
>> + if (flow->txqi)
>> + flow = >flow;
> I'm not sure I understand this part correctly, but shouldn't that be:
> if (flow->txqi && flow->txqi != txqi)

You're correct. Good catch, thanks!


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


Re: [PATCH 1/3] cfg80211: Allow a scan request for a specific BSSID

2016-02-26 Thread Jouni Malinen
On Fri, Feb 26, 2016 at 04:06:04PM +0200, Jouni Malinen wrote:
> This allows scans for a specific BSSID to be optimized by the user space
> application by requesting the driver to set the Probe Request frame
> BSSID field (Address 3) to the specified BSSID instead of the wildcard
> BSSID. This prevents other APs from replying which reduces airtime need
> and latency in getting the response from the target AP through.
> 
> This is an optimization and as such, it is acceptable for some of the
> drivers not to support the mechanism. If not supported, the wildcard
> BSSID will be used and more responses may be received.

>  include/net/cfg80211.h   | 2 ++
>  include/uapi/linux/nl80211.h | 4 +++-
>  net/wireless/nl80211.c   | 6 ++

> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
> @@ -1471,6 +1472,7 @@ struct cfg80211_scan_request {
> + u8 bssid[ETH_ALEN] __aligned(2);


You should know better to run all hwsim test cases before sending
patches out.. nl80211 one is not enough when we have WEXT. :)

Johannes, please drop this. I'll need to talk to myself to get a fixed
version with the two other rdev_scan() callers updated to fill in the
bssid field.

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


Re: [PATCHv2 08/10] rfkill: Use switch to demux userspace operations

2016-02-26 Thread Jouni Malinen
On Mon, Feb 22, 2016 at 11:36:39AM -0500, João Paulo Rechi Vita wrote:
> Using a switch to handle different ev.op values in rfkill_fop_write()
> makes the code easier to extend, as out-of-range values can always be
> handled by the default case.

This breaks rfkill.. There are automated test scripts for testing this
area (and most of Wi-Fi for that matter. It would be nice if these were
used for changes before they get contributed upstream..

http://buildbot.w1.fi/hwsim/

This specific commit broke all the rfkill_* test cases because of
following:

> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
> @@ -1199,29 +1200,32 @@ static ssize_t rfkill_fop_write(struct file *file, 
> const char __user *buf,
> - list_for_each_entry(rfkill, _list, node) {
> - if (rfkill->idx != ev.idx && ev.op != RFKILL_OP_CHANGE_ALL)
> - continue;
> -
> - if (rfkill->type != ev.type && ev.type != RFKILL_TYPE_ALL)
> - continue;

Note that RFKILL_TYPE_ALL here..

> + list_for_each_entry(rfkill, _list, node)
> + if (rfkill->type == ev.type ||
> + ev.type == RFKILL_TYPE_ALL)
> + rfkill_set_block(rfkill, ev.soft);

It was included for RFKILL_OP_CHANGE_ALL.

> + case RFKILL_OP_CHANGE:
> + list_for_each_entry(rfkill, _list, node)
> + if (rfkill->idx == ev.idx && rfkill->type == ev.type)
> + rfkill_set_block(rfkill, ev.soft);

but not for RFKILL_OP_CHANGE..

This needs following to work:


diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 59ff92d..c4bbd19 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -1239,7 +1239,9 @@ static ssize_t rfkill_fop_write(struct file *file, const 
char __user *buf,
break;
case RFKILL_OP_CHANGE:
list_for_each_entry(rfkill, _list, node)
-   if (rfkill->idx == ev.idx && rfkill->type == ev.type)
+   if (rfkill->idx == ev.idx &&
+   (rfkill->type == ev.type ||
+ev.type == RFKILL_TYPE_ALL))
rfkill_set_block(rfkill, ev.soft);
ret = 0;
break;
 
-- 
Jouni MalinenPGP id EFC895FA
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/RFT] mac80211: implement fq_codel for software queuing

2016-02-26 Thread Felix Fietkau
On 2016-02-26 14:09, Michal Kazior wrote:
> Since 11n aggregation become important to get the
> best out of txops. However aggregation inherently
> requires buffering and queuing. Once variable
> medium conditions to different associated stations
> is considered it became apparent that bufferbloat
> can't be simply fought with qdiscs for wireless
> drivers. 11ac with MU-MIMO makes the problem
> worse because the bandwidth-delay product becomes
> even greater.
> 
> This bases on codel5 and sch_fq_codel.c. It may
> not be the Right Thing yet but it should at least
> provide a framework for more improvements.
Nice work!

> I guess dropping rate could factor in per-station
> rate control info but I don't know how this should
> exactly be done. HW rate control drivers would
> need extra work to take advantage of this.
> 
> This obviously works only with drivers that use
> wake_tx_queue op.
> 
> Note: This uses IFF_NO_QUEUE to get rid of qdiscs
> for wireless drivers that use mac80211 and
> implement wake_tx_queue op.
> 
> Moreover the current txq_limit and latency setting
> might need tweaking. Either from userspace or be
> dynamically scaled with regard to, e.g. number of
> associated stations.
> 
> FWIW This already works nicely with ath10k's (not
> yey merged) pull-push congestion control for
> MU-MIMO as far as throughput is concerned.
> 
> Evaluating latency improvements is a little tricky
> at this point if a driver is using more queue
> layering and/or its firmware controls tx
> scheduling - hence I don't have any solid data on
> this. I'm open for suggestions though.
> 
> It might also be a good idea to do the following
> in the future:
> 
>  - make generic tx scheduling which does some RR
>over per-sta-tid queues and dequeues bursts of
>packets to form a PPDU to fit into designated
>txop timeframe and bytelimit
> 
>This could in theory be shared and used by
>ath9k and (future) mt76.
> 
>Moreover tx scheduling could factor in rate
>control info and keep per-station number of
>queued packets at a sufficient low threshold to
>avoid queue buildup for slow stations. Emmanuel
>already did similar experiment for iwlwifi's
>station mode and got promising results.
> 
>  - make software queueing default internally in
>mac80211. This could help other drivers to get
>at least some benefit from mac80211 smarter
>queueing.
> 
> Signed-off-by: Michal Kazior 
> ---
>  include/net/mac80211.h |  36 -
>  net/mac80211/agg-tx.c  |   8 +-
>  net/mac80211/codel.h   | 260 +++
>  net/mac80211/codel_i.h |  89 +++
>  net/mac80211/ieee80211_i.h |  27 +++-
>  net/mac80211/iface.c   |  25 ++-
>  net/mac80211/main.c|   9 +-
>  net/mac80211/rx.c  |   2 +-
>  net/mac80211/sta_info.c|  10 +-
>  net/mac80211/sta_info.h|  27 
>  net/mac80211/tx.c  | 370 
> -
>  net/mac80211/util.c|  20 ++-
>  12 files changed, 805 insertions(+), 78 deletions(-)
>  create mode 100644 net/mac80211/codel.h
>  create mode 100644 net/mac80211/codel_i.h
> 

> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
> index af584f7cdd63..f42f898cb8b5 100644
> --- a/net/mac80211/tx.c
> +++ b/net/mac80211/tx.c
> + [...]
> +static void ieee80211_txq_enqueue(struct ieee80211_local *local,
> +   struct txq_info *txqi,
> +   struct sk_buff *skb)
> +{
> + struct ieee80211_fq *fq = >fq;
> + struct ieee80211_hw *hw = >hw;
> + struct txq_flow *flow;
> + struct txq_flow *i;
> + size_t idx = fq_hash(fq, skb);
> +
> + flow = >flows[idx];
> +
> + if (flow->txqi)
> + flow = >flow;
I'm not sure I understand this part correctly, but shouldn't that be:
if (flow->txqi && flow->txqi != txqi)

> +
> + /* The following overwrites `vif` pointer effectively. It is later
> +  * restored using txq structure.
> +  */
> + IEEE80211_SKB_CB(skb)->control.enqueue_time = codel_get_time();
> +
> + flow->txqi = txqi;
> + flow->backlog += skb->len;
> + txqi->backlog_bytes += skb->len;
> + txqi->backlog_packets++;
> + fq->backlog++;
> +
> + if (list_empty(>backlogchain))
> + i = list_last_entry(>backlogs, struct txq_flow, 
> backlogchain);
> + else
> + i = flow;
> +
> + list_for_each_entry_continue_reverse(i, >backlogs, backlogchain)
> + if (i->backlog > flow->backlog)
> + break;
> +
> + list_move(>backlogchain, >backlogchain);
> +
> + if (list_empty(>flowchain)) {
> + flow->deficit = fq->quantum;
> + list_add_tail(>flowchain, >new_flows);
> + }
> +
> + __skb_queue_tail(>queue, skb);
> +
> + if (fq->backlog > hw->txq_limit)
> + fq_drop(local);
> +}
--
To unsubscribe from this list: send the line "unsubscribe 

[PATCH v5] ath10k: Enable debugfs provision to enable Peer Stats feature

2016-02-26 Thread Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan 

Provide a debugfs entry to enable/ disable Peer Stats feature.
Peer Stats feature is for developers/users who are more interested
in studying in Rx/Tx stats with multiple clients connected, hence
disable this by default. Enabling this feature by default results
in unneccessary processing of Peer Stats event for every 500ms
and updating peer_stats list (allocating memory) and cleaning it up
ifexceeds the higher limit and this can be an unnecessary overhead
during long run stress testing.

Signed-off-by: Mohammed Shafi Shajakhan 
---
Dependencies:-

[PATCH] ath10k: Reduce number of peers to support peer stats feature
(in upstream review)

  ath10k: Fix updating peer stats rx duration (in upstream review)
  ath10k: Fix pointless update of peer stats list (in upstream review)

 drivers/net/wireless/ath/ath10k/core.c  |2 +-
 drivers/net/wireless/ath/ath10k/core.h  |   12 +
 drivers/net/wireless/ath/ath10k/debug.c |   80 +--
 drivers/net/wireless/ath/ath10k/mac.c   |2 +-
 drivers/net/wireless/ath/ath10k/wmi.c   |   12 ++---
 5 files changed, 94 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index c84c2d3..c4c31b2 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1509,7 +1509,7 @@ static int ath10k_core_init_firmware_features(struct 
ath10k *ar)
case ATH10K_FW_WMI_OP_VERSION_10_1:
case ATH10K_FW_WMI_OP_VERSION_10_2:
case ATH10K_FW_WMI_OP_VERSION_10_2_4:
-   if (test_bit(WMI_SERVICE_PEER_STATS, ar->wmi.svc_map)) {
+   if (ath10k_peer_stats_enabled(ar)) {
ar->max_num_peers = TARGET_10X_TX_STATS_NUM_PEERS;
ar->max_num_stations = TARGET_10X_TX_STATS_NUM_STATIONS;
} else {
diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index a62b62a..cebf22c 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -549,6 +549,9 @@ enum ath10k_dev_flags {
 
/* Bluetooth coexistance enabled */
ATH10K_FLAG_BTCOEX,
+
+   /* Per Station statistics service */
+   ATH10K_FLAG_PEER_STATS,
 };
 
 enum ath10k_cal_mode {
@@ -876,6 +879,15 @@ struct ath10k {
u8 drv_priv[0] __aligned(sizeof(void *));
 };
 
+static inline bool ath10k_peer_stats_enabled(struct ath10k *ar)
+{
+   if (test_bit(ATH10K_FLAG_PEER_STATS, >dev_flags) &&
+   test_bit(WMI_SERVICE_PEER_STATS, ar->wmi.svc_map))
+   return true;
+
+   return false;
+}
+
 struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
  enum ath10k_bus bus,
  enum ath10k_hw_rev hw_rev,
diff --git a/drivers/net/wireless/ath/ath10k/debug.c 
b/drivers/net/wireless/ath/ath10k/debug.c
index 06581fa..406e8bc 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -319,7 +319,7 @@ static void ath10k_debug_fw_stats_reset(struct ath10k *ar)
 void ath10k_debug_fw_stats_process(struct ath10k *ar, struct sk_buff *skb)
 {
struct ath10k_fw_stats stats = {};
-   bool is_start, is_started, is_end, peer_stats_svc;
+   bool is_start, is_started, is_end;
size_t num_peers;
size_t num_vdevs;
int ret;
@@ -346,13 +346,11 @@ void ath10k_debug_fw_stats_process(struct ath10k *ar, 
struct sk_buff *skb)
 *  b) consume stat update events until another one with pdev stats is
 * delivered which is treated as end-of-data and is itself discarded
 */
-
-   peer_stats_svc = test_bit(WMI_SERVICE_PEER_STATS, ar->wmi.svc_map);
-   if (peer_stats_svc)
+   if (ath10k_peer_stats_enabled(ar))
ath10k_sta_update_rx_duration(ar, );
 
if (ar->debug.fw_stats_done) {
-   if (!peer_stats_svc)
+   if (!ath10k_peer_stats_enabled(ar))
ath10k_warn(ar, "received unsolicited stats update 
event\n");
 
goto free;
@@ -2169,6 +2167,73 @@ static const struct file_operations fops_btcoex = {
.open = simple_open
 };
 
+static ssize_t ath10k_write_peer_stats(struct file *file,
+  const char __user *ubuf,
+  size_t count, loff_t *ppos)
+{
+   struct ath10k *ar = file->private_data;
+   char buf[32];
+   size_t buf_size;
+   int ret = 0;
+   bool val;
+
+   buf_size = min(count, (sizeof(buf) - 1));
+   if (copy_from_user(buf, ubuf, buf_size))
+   return -EFAULT;
+
+   buf[buf_size] = '\0';
+
+   if (strtobool(buf, ) != 0)
+   return -EINVAL;
+
+   mutex_lock(>conf_mutex);
+
+   if (ar->state != ATH10K_STATE_ON &&
+  

[PATCH 3/3] mac80211_hwsim: Support a hw scan request for a specific BSSID

2016-02-26 Thread Jouni Malinen
If the hw scan request specifies a single BSSID, use that value instead
of the wildcard BSSID in the Probe Request frames.

Signed-off-by: Jouni Malinen 
---
 drivers/net/wireless/mac80211_hwsim.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index a723a85..281c6b7 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -1909,6 +1909,7 @@ static void hw_scan_work(struct work_struct *work)
/* send probes */
for (i = 0; i < req->n_ssids; i++) {
struct sk_buff *probe;
+   struct ieee80211_mgmt *mgmt;
 
probe = ieee80211_probereq_get(hwsim->hw,
   hwsim->scan_addr,
@@ -1918,6 +1919,10 @@ static void hw_scan_work(struct work_struct *work)
if (!probe)
continue;
 
+   mgmt = (struct ieee80211_mgmt *) probe->data;
+   memcpy(mgmt->da, req->bssid, ETH_ALEN);
+   memcpy(mgmt->bssid, req->bssid, ETH_ALEN);
+
if (req->ie_len)
memcpy(skb_put(probe, req->ie_len), req->ie,
   req->ie_len);
-- 
1.9.1

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


[PATCH 1/3] cfg80211: Allow a scan request for a specific BSSID

2016-02-26 Thread Jouni Malinen
This allows scans for a specific BSSID to be optimized by the user space
application by requesting the driver to set the Probe Request frame
BSSID field (Address 3) to the specified BSSID instead of the wildcard
BSSID. This prevents other APs from replying which reduces airtime need
and latency in getting the response from the target AP through.

This is an optimization and as such, it is acceptable for some of the
drivers not to support the mechanism. If not supported, the wildcard
BSSID will be used and more responses may be received.

Signed-off-by: Jouni Malinen 
---
 include/net/cfg80211.h   | 2 ++
 include/uapi/linux/nl80211.h | 4 +++-
 net/wireless/nl80211.c   | 6 ++
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9e1b24c..14c0c43 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1455,6 +1455,7 @@ struct cfg80211_ssid {
  * @mac_addr_mask: MAC address mask used with randomisation, bits that
  * are 0 in the mask should be randomised, bits that are 1 should
  * be taken from the @mac_addr
+ * @bssid: BSSID to scan for (most commonly, the wildcard BSSID)
  */
 struct cfg80211_scan_request {
struct cfg80211_ssid *ssids;
@@ -1471,6 +1472,7 @@ struct cfg80211_scan_request {
 
u8 mac_addr[ETH_ALEN] __aligned(2);
u8 mac_addr_mask[ETH_ALEN] __aligned(2);
+   u8 bssid[ETH_ALEN] __aligned(2);
 
/* internal */
struct wiphy *wiphy;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 5a30a75..23bf066 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -322,7 +322,9 @@
  * @NL80211_CMD_GET_SCAN: get scan results
  * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
  * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
- * probe requests at CCK rate or not.
+ * probe requests at CCK rate or not. %NL80211_ATTR_MAC can be used to
+ * specify a BSSID to scan for; if not included, the wildcard BSSID will
+ * be used.
  * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
  * NL80211_CMD_GET_SCAN and on the "scan" multicast group)
  * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 98c9242..1b43f78 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5996,6 +5996,12 @@ static int nl80211_trigger_scan(struct sk_buff *skb, 
struct genl_info *info)
request->no_cck =
nla_get_flag(info->attrs[NL80211_ATTR_TX_NO_CCK_RATE]);
 
+   if (info->attrs[NL80211_ATTR_MAC])
+   memcpy(request->bssid, nla_data(info->attrs[NL80211_ATTR_MAC]),
+  ETH_ALEN);
+   else
+   eth_broadcast_addr(request->bssid);
+
request->wdev = wdev;
request->wiphy = >wiphy;
request->scan_start = jiffies;
-- 
1.9.1

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


[PATCH 2/3] mac80211: Support a scan request for a specific BSSID

2016-02-26 Thread Jouni Malinen
If the cfg80211 scan trigger operation specifies a single BSSID, use
that value instead of the wildcard BSSID in the Probe Request frames.

Signed-off-by: Jouni Malinen 
---
 net/mac80211/scan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
index ae980ce..b025a82 100644
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
@@ -497,7 +497,7 @@ static void ieee80211_scan_state_send_probe(struct 
ieee80211_local *local,
 
for (i = 0; i < scan_req->n_ssids; i++)
ieee80211_send_probe_req(
-   sdata, local->scan_addr, NULL,
+   sdata, local->scan_addr, scan_req->bssid,
scan_req->ssids[i].ssid, scan_req->ssids[i].ssid_len,
scan_req->ie, scan_req->ie_len,
scan_req->rates[band], false,
-- 
1.9.1

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


[RFC/RFT] mac80211: implement fq_codel for software queuing

2016-02-26 Thread Michal Kazior
Since 11n aggregation become important to get the
best out of txops. However aggregation inherently
requires buffering and queuing. Once variable
medium conditions to different associated stations
is considered it became apparent that bufferbloat
can't be simply fought with qdiscs for wireless
drivers. 11ac with MU-MIMO makes the problem
worse because the bandwidth-delay product becomes
even greater.

This bases on codel5 and sch_fq_codel.c. It may
not be the Right Thing yet but it should at least
provide a framework for more improvements.

I guess dropping rate could factor in per-station
rate control info but I don't know how this should
exactly be done. HW rate control drivers would
need extra work to take advantage of this.

This obviously works only with drivers that use
wake_tx_queue op.

Note: This uses IFF_NO_QUEUE to get rid of qdiscs
for wireless drivers that use mac80211 and
implement wake_tx_queue op.

Moreover the current txq_limit and latency setting
might need tweaking. Either from userspace or be
dynamically scaled with regard to, e.g. number of
associated stations.

FWIW This already works nicely with ath10k's (not
yey merged) pull-push congestion control for
MU-MIMO as far as throughput is concerned.

Evaluating latency improvements is a little tricky
at this point if a driver is using more queue
layering and/or its firmware controls tx
scheduling - hence I don't have any solid data on
this. I'm open for suggestions though.

It might also be a good idea to do the following
in the future:

 - make generic tx scheduling which does some RR
   over per-sta-tid queues and dequeues bursts of
   packets to form a PPDU to fit into designated
   txop timeframe and bytelimit

   This could in theory be shared and used by
   ath9k and (future) mt76.

   Moreover tx scheduling could factor in rate
   control info and keep per-station number of
   queued packets at a sufficient low threshold to
   avoid queue buildup for slow stations. Emmanuel
   already did similar experiment for iwlwifi's
   station mode and got promising results.

 - make software queueing default internally in
   mac80211. This could help other drivers to get
   at least some benefit from mac80211 smarter
   queueing.

Signed-off-by: Michal Kazior 
---
 include/net/mac80211.h |  36 -
 net/mac80211/agg-tx.c  |   8 +-
 net/mac80211/codel.h   | 260 +++
 net/mac80211/codel_i.h |  89 +++
 net/mac80211/ieee80211_i.h |  27 +++-
 net/mac80211/iface.c   |  25 ++-
 net/mac80211/main.c|   9 +-
 net/mac80211/rx.c  |   2 +-
 net/mac80211/sta_info.c|  10 +-
 net/mac80211/sta_info.h|  27 
 net/mac80211/tx.c  | 370 -
 net/mac80211/util.c|  20 ++-
 12 files changed, 805 insertions(+), 78 deletions(-)
 create mode 100644 net/mac80211/codel.h
 create mode 100644 net/mac80211/codel_i.h

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 6617516a276f..4667d2bad356 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -565,6 +565,18 @@ struct ieee80211_bss_conf {
struct ieee80211_p2p_noa_attr p2p_noa_attr;
 };
 
+typedef u64 codel_time_t;
+
+/*
+ * struct codel_params - contains codel parameters
+ * @interval:  initial drop rate
+ * @target: maximum persistent sojourn time
+ */
+struct codel_params {
+   codel_time_tinterval;
+   codel_time_ttarget;
+};
+
 /**
  * enum mac80211_tx_info_flags - flags to describe transmission 
information/status
  *
@@ -886,8 +898,18 @@ struct ieee80211_tx_info {
/* only needed before rate control */
unsigned long jiffies;
};
-   /* NB: vif can be NULL for injected frames */
-   struct ieee80211_vif *vif;
+   union {
+   /* NB: vif can be NULL for injected frames */
+   struct ieee80211_vif *vif;
+
+   /* When packets are enqueued on txq it's easy
+* to re-construct the vif pointer. There's no
+* more space in tx_info so it can be used to
+* store the necessary enqueue time for packet
+* sojourn time computation.
+*/
+   codel_time_t enqueue_time;
+   };
struct ieee80211_key_conf *hw_key;
u32 flags;
/* 4 bytes free */
@@ -2102,8 +2124,8 @@ enum ieee80211_hw_flags {
  * @cipher_schemes: a pointer to an array of cipher scheme definitions
  * supported by HW.
  *
- * @txq_ac_max_pending: maximum number of frames per AC pending in all txq
- * entries for a vif.
+ * @txq_cparams: codel 

Re: [PATCH] mac80211_hwsim: treat as part of mac80211 for MAINTAINERS

2016-02-26 Thread Kalle Valo
Johannes Berg  writes:

> From: Johannes Berg 
>
> Since I maintain this driver as part of mac80211, add it to
> the file list for mac80211; this helps submitters send it to
> me instead of Kalle and also makes the build robot apply the
> patches for it on the right tree for build attempts.
>
> Signed-off-by: Johannes Berg 

FWIW:

Acked-by: Kalle Valo 

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


Re: [RESEND] ssb: host_soc depends on sprom

2016-02-26 Thread Kalle Valo

> Drivers that use the SSB sprom functionality typically 'select SSB_SPROM'
> from Kconfig, but CONFIG_SSB_HOST_SOC misses this, which results in
> a build failure unless at least one of the other drivers that selects
> it is enabled:
> 
> drivers/built-in.o: In function `ssb_host_soc_get_invariants':
> (.text+0x459494): undefined reference to `ssb_fill_sprom_with_fallback'
> 
> This adds the same select statement that is used elsewhere.
> 
> Signed-off-by: Arnd Bergmann 
> Fixes: 541c9a84cd85 ("ssb: pick SoC invariants code from MIPS BCM47xx arch")

Thanks, applied to wireless-drivers.git.

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


Re: pull request: iwlwifi 2016-02-25

2016-02-26 Thread Kalle Valo
"Grumbach, Emmanuel"  writes:

> This is a pull request for 4.5 still. Two small fixes. One of them has a 
> really visible impact when we remove stations.
> Let me know if you have issues! Thanks.
>
> The following changes since commit 20aa99bbddae74bded68338f9ba200ccae02858b:
>
>   iwlwifi: pcie: fix erroneous return value (2016-02-15 13:38:31 +0200)
>
> are available in the git repository at:
>
>   https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git 
> tags/iwlwifi-for-kalle-2016-02-25

Pulled, thanks.

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


Re: [PATCH] mac80211_hwsim: Set global RRM capability

2016-02-26 Thread Johannes Berg
On Fri, 2016-02-26 at 16:18 +0800, Fengguang Wu wrote:
> 
> > I think this build failure is because mac80211_hwsim is an
> > exception to
> > other wireless drivers and is applied via mac80211-next. Should we
> > add
> > an entry for mac80211_hwsim to MAINTAINERS with the correct git
> > tree? I
> > think kbuild test robot follows MAINTAINERS file nowdays (or at
> > least I
> > understood that's the plan).
> 
> That's right. The robot parses MAINTAINERS when judging which tree
> to apply LKML patches to.
> 

Great. I'll add a commit to make mac80211_hwsim just part of the
MAC80211 entry.

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


Re: [PATCH] mac80211_hwsim: Set global RRM capability

2016-02-26 Thread Fengguang Wu
On Fri, Feb 26, 2016 at 09:17:15AM +0200, Kalle Valo wrote:
> kbuild test robot  writes:
> 
> > Hi David,
> >
> > [auto build test ERROR on wireless-drivers-next/master]
> > [also build test ERROR on v4.5-rc5 next-20160224]
> > [if your patch is applied to the wrong git tree, please drop us a note to 
> > help improving the system]
> >
> > url:
> > https://github.com/0day-ci/linux/commits/Emmanuel-Grumbach/mac80211_hwsim-Set-global-RRM-capability/20160225-172733
> > base:   
> > https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> >  master
> > config: sparc64-allyesconfig (attached as .config)
> > reproduce:
> > wget 
> > https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
> >  -O ~/bin/make.cross
> > chmod +x ~/bin/make.cross
> > # save the attached .config to linux build tree
> > make.cross ARCH=sparc64 
> >
> > All errors (new ones prefixed by >>):
> >
> >drivers/net/wireless/mac80211_hwsim.c: In function 
> > 'mac80211_hwsim_new_radio':
> >>> drivers/net/wireless/mac80211_hwsim.c:2462:35: error: 
> >>> 'NL80211_EXT_FEATURE_RRM' undeclared (first use in this function)
> >  wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_RRM);
> >   ^
> >drivers/net/wireless/mac80211_hwsim.c:2462:35: note: each undeclared 
> > identifier is reported only once for each function it appears in
> 
> I think this build failure is because mac80211_hwsim is an exception to
> other wireless drivers and is applied via mac80211-next. Should we add
> an entry for mac80211_hwsim to MAINTAINERS with the correct git tree? I
> think kbuild test robot follows MAINTAINERS file nowdays (or at least I
> understood that's the plan).

That's right. The robot parses MAINTAINERS when judging which tree
to apply LKML patches to.

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


[PATCH 09/13] ath9k: Update QCA956x initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar956x_initvals.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar956x_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar956x_initvals.h
index c3a47ea..db05107 100644
--- a/drivers/net/wireless/ath/ath9k/ar956x_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar956x_initvals.h
@@ -220,7 +220,7 @@ static const u32 qca956x_1p0_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03b5, 0x03b5, 0x03a6, 0x03a6},
{0x9e2c, 0x001c, 0x001c, 0x0021, 0x0021},
-   {0x9e3c, 0xcfa10820, 0xcfa10820, 0xcf946222, 0xcf946222},
+   {0x9e3c, 0xcfa10820, 0xcfa10820, 0xcf946220, 0xcf946220},
{0x9e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
-- 
1.9.1

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


[PATCH 12/13] ath9k: use AR_SREV_9003_PCOEM to identify PCOEM chips

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

commit f49c90db4d23 ("ath9k: Add a macro to identify PCOEM chips")
defined AR_SREV_9003_PCOEM macro, its more clear to use the macro
instead of checking one by one. Also removed PCOEM chips checking
in the callback of ar9003_hw_do_pcoem_manual_peak_cal() which only
for PCOEM chips.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9003_calib.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c 
b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 99bc1a6..e1573ab 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -1311,9 +1311,6 @@ static void ar9003_hw_do_pcoem_manual_peak_cal(struct 
ath_hw *ah,
struct ath9k_hw_cal_data *caldata = ah->caldata;
int i;
 
-   if (!AR_SREV_9462(ah) && !AR_SREV_9565(ah) && !AR_SREV_9485(ah))
-   return;
-
if ((ah->caps.hw_caps & ATH9K_HW_CAP_RTT) && !run_rtt_cal)
return;
 
@@ -1707,7 +1704,7 @@ void ar9003_hw_attach_calib_ops(struct ath_hw *ah)
struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
struct ath_hw_ops *ops = ath9k_hw_ops(ah);
 
-   if (AR_SREV_9485(ah) || AR_SREV_9462(ah) || AR_SREV_9565(ah))
+   if (AR_SREV_9003_PCOEM(ah))
priv_ops->init_cal = ar9003_hw_init_cal_pcoem;
else
priv_ops->init_cal = ar9003_hw_init_cal_soc;
-- 
1.9.1

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


[PATCH 13/13] ath9k: set correct peak detect threshold

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

Set QCA9561 peak detect threshold to 11.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9003_calib.c | 25 +++--
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c 
b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index e1573ab..518e649 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -1203,12 +1203,12 @@ static void ar9003_hw_tx_iq_cal_reload(struct ath_hw 
*ah)
 static void ar9003_hw_manual_peak_cal(struct ath_hw *ah, u8 chain, bool is_2g)
 {
int offset[8] = {0}, total = 0, test;
-   int agc_out, i, peak_detect_threshold;
+   int agc_out, i, peak_detect_threshold = 0;
 
if (AR_SREV_9550(ah) || AR_SREV_9531(ah))
peak_detect_threshold = 8;
-   else
-   peak_detect_threshold = 0;
+   else if (AR_SREV_9561(ah))
+   peak_detect_threshold = 11;
 
/*
 * Turn off LNA/SW.
@@ -1249,17 +1249,14 @@ static void ar9003_hw_manual_peak_cal(struct ath_hw 
*ah, u8 chain, bool is_2g)
REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
  AR_PHY_65NM_RXRF_AGC_AGC2G_CALDAC_OVR, 0x0);
 
-   if (AR_SREV_9003_PCOEM(ah) || AR_SREV_9550(ah) || AR_SREV_9531(ah) ||
-   AR_SREV_9561(ah)) {
-   if (is_2g)
-   REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
- AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR,
- peak_detect_threshold);
-   else
-   REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
- AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR,
- peak_detect_threshold);
-   }
+   if (is_2g)
+   REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
+ AR_PHY_65NM_RXRF_AGC_AGC2G_DBDAC_OVR,
+ peak_detect_threshold);
+   else
+   REG_RMW_FIELD(ah, AR_PHY_65NM_RXRF_AGC(chain),
+ AR_PHY_65NM_RXRF_AGC_AGC5G_DBDAC_OVR,
+ peak_detect_threshold);
 
for (i = 6; i > 0; i--) {
offset[i] = BIT(i - 1);
-- 
1.9.1

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


[PATCH 10/13] ath9k: Update AR9580 initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
index 5d4629f..f4c9bef 100644
--- a/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9580_1p0_initvals.h
@@ -1290,7 +1290,7 @@ static const u32 ar9580_1p0_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03b5, 0x03b5, 0x03ce, 0x03ce},
{0x9e2c, 0x001c, 0x001c, 0x0021, 0x0021},
-   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946222, 0xcf946222},
+   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946220, 0xcf946220},
{0x9e44, 0x02321e27, 0x02321e27, 0x02291e27, 0x02291e27},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
@@ -1310,7 +1310,7 @@ static const u32 ar9580_1p0_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x0150, 0x0150},
{0xa288, 0x0110, 0x0110, 0x0110, 0x0110},
{0xa28c, 0x0002, 0x0002, 0x0002, 0x0002},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+   {0xa2c4, 0x00058d18, 0x00058d18, 0x00058d18, 0x00058d18},
{0xa2d0, 0x00041983, 0x00041983, 0x00041981, 0x00041982},
{0xa2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
{0xa358, 0x, 0x, 0x, 0x},
-- 
1.9.1

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


[PATCH 11/13] ath9k: enable manual peak cal for all ar9300 chips

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail, enable all ar9300
chips manual peak calibration instead.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9003_calib.c | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c 
b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 0c39199..99bc1a6 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -1641,14 +1641,12 @@ static bool ar9003_hw_init_cal_soc(struct ath_hw *ah,
 
 skip_tx_iqcal:
if (run_agc_cal || !(ah->ah_flags & AH_FASTCC)) {
-   if (AR_SREV_9330_11(ah) || AR_SREV_9531(ah) || AR_SREV_9550(ah) 
||
-   AR_SREV_9561(ah)) {
-   for (i = 0; i < AR9300_MAX_CHAINS; i++) {
-   if (!(ah->rxchainmask & (1 << i)))
-   continue;
-   ar9003_hw_manual_peak_cal(ah, i,
- IS_CHAN_2GHZ(chan));
-   }
+   for (i = 0; i < AR9300_MAX_CHAINS; i++) {
+   if (!(ah->rxchainmask & (1 << i)))
+   continue;
+
+   ar9003_hw_manual_peak_cal(ah, i,
+ IS_CHAN_2GHZ(chan));
}
 
/*
-- 
1.9.1

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


[PATCH 08/13] ath9k: Update AR9565 initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
index 10d4a6c..35c1bbb 100644
--- a/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h
@@ -347,7 +347,7 @@ static const u32 ar9565_1p0_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03b5, 0x03b5, 0x03a4, 0x03a4},
{0x9e2c, 0x001c, 0x001c, 0x0021, 0x0021},
-   {0x9e3c, 0xcf946222, 0xcf946222, 0xcf946220, 0xcf946220},
+   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946220, 0xcf946220},
{0x9e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
-- 
1.9.1

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


[PATCH 07/13] ath9k: Update AR955x initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
index 148562a..67edf34 100644
--- a/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar955x_1p0_initvals.h
@@ -83,7 +83,7 @@ static const u32 ar955x_1p0_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x0010, 0x0010},
{0xa288, 0x0110, 0x0110, 0x0110, 0x0110},
{0xa28c, 0x0002, 0x0002, 0x0002, 0x0002},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00058d18, 0x00058d18},
+   {0xa2c4, 0x00058d18, 0x00058d18, 0x00058d18, 0x00058d18},
{0xa2cc, 0x18c50033, 0x18c43433, 0x18c41033, 0x18c44c33},
{0xa2d0, 0x00041982, 0x00041982, 0x00041982, 0x00041982},
{0xa2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
-- 
1.9.1

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


[PATCH 03/13] ath9k: Update AR933x initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h | 4 ++--
 drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
index 2c42ff0..29479af 100644
--- a/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9330_1p1_initvals.h
@@ -40,7 +40,7 @@ static const u32 ar9331_1p1_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03b5, 0x03b5, 0x03ce, 0x03ce},
{0x9e2c, 0x001c, 0x001c, 0x3221, 0x3221},
-   {0x9e3c, 0xcf946222, 0xcf946222, 0xcf946222, 0xcf946222},
+   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946220, 0xcf946220},
{0x9e44, 0x02321e27, 0x02321e27, 0x02282324, 0x02282324},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302010, 0x50302010},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
@@ -59,7 +59,7 @@ static const u32 ar9331_1p1_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x, 0x},
{0xa288, 0x, 0x, 0x, 0x},
{0xa28c, 0x, 0x, 0x, 0x},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00058d18, 0x00058d18},
+   {0xa2c4, 0x00058d18, 0x00058d18, 0x00058d18, 0x00058d18},
{0xa2d0, 0x00071982, 0x00071982, 0x00071982, 0x00071982},
{0xa2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
{0xa358, 0x, 0x, 0x, 0x},
diff --git a/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
index 2154efc..c4a6ffa 100644
--- a/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9330_1p2_initvals.h
@@ -345,7 +345,7 @@ static const u32 ar9331_1p2_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03b5, 0x03b5, 0x03ce, 0x03ce},
{0x9e2c, 0x001c, 0x001c, 0x3221, 0x3221},
-   {0x9e3c, 0xcf946222, 0xcf946222, 0xcf946222, 0xcf946222},
+   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946220, 0xcf946220},
{0x9e44, 0x02321e27, 0x02321e27, 0x02282324, 0x02282324},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302010, 0x50302010},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
@@ -364,7 +364,7 @@ static const u32 ar9331_1p2_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x, 0x},
{0xa288, 0x, 0x, 0x, 0x},
{0xa28c, 0x, 0x, 0x, 0x},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+   {0xa2c4, 0x00058d18, 0x00058d18, 0x00058d18, 0x00058d18},
{0xa2d0, 0x00071981, 0x00071981, 0x00071981, 0x00071981},
{0xa2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
{0xa358, 0x, 0x, 0x, 0x},
-- 
1.9.1

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


[PATCH 06/13] ath9k: Update AR9485 initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9485_initvals.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
index ce83ce4..bdf6f10 100644
--- a/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9485_initvals.h
@@ -1026,7 +1026,7 @@ static const u32 ar9485_1_1_baseband_postamble[][5] = {
{0x9e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec80d2e, 0x7ec80d2e},
{0x9e14, 0x31395d53, 0x31396053, 0x312e6053, 0x312e5d53},
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
-   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946222, 0xcf946222},
+   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946220, 0xcf946220},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302010, 0x50302010},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
{0xa204, 0x01303fc0, 0x01303fc4, 0x01303fc4, 0x01303fc0},
@@ -1044,7 +1044,7 @@ static const u32 ar9485_1_1_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x02a0, 0x02a0},
{0xa288, 0x, 0x, 0x, 0x},
{0xa28c, 0x, 0x, 0x, 0x},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+   {0xa2c4, 0x00058d18, 0x00058d18, 0x00058d18, 0x00058d18},
{0xa2d0, 0x00071981, 0x00071981, 0x00071982, 0x00071982},
{0xa2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a},
{0xa358, 0x, 0x, 0x, 0x},
-- 
1.9.1

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


[PATCH 01/13] ath9k: Update QCA953x initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

commit 14c5932805eb ("ath9k: Update QCA953x initvals")
disabled HW peak detect calibartion on QCA953x 1.0, which
should also be applied on 2.0.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar953x_initvals.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar953x_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar953x_initvals.h
index 6fc0d07..eb42fb2 100644
--- a/drivers/net/wireless/ath/ath9k/ar953x_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar953x_initvals.h
@@ -923,7 +923,7 @@ static const u32 qca953x_2p0_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03b5, 0x03b5, 0x03ce, 0x03ce},
{0x9e2c, 0x001c, 0x001c, 0x0021, 0x0021},
-   {0x9e3c, 0xcfa10820, 0xcfa10820, 0xcf946222, 0xcf946222},
+   {0x9e3c, 0xcfa10820, 0xcfa10820, 0xcf946220, 0xcf946220},
{0x9e44, 0xfe321e27, 0xfe321e27, 0xfe291e27, 0xfe291e27},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
@@ -943,7 +943,7 @@ static const u32 qca953x_2p0_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x0010, 0x0010},
{0xa288, 0x0110, 0x0110, 0x0110, 0x0110},
{0xa28c, 0x0002, 0x0002, 0x0002, 0x0002},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+   {0xa2c4, 0x00158d18, 0x00158d18, 0x00058d18, 0x00058d18},
{0xa2cc, 0x18c50033, 0x18c43433, 0x18c41033, 0x18c44c33},
{0xa2d0, 0x00041982, 0x00041982, 0x00041982, 0x00041982},
{0xa2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
-- 
1.9.1

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


[PATCH 05/13] ath9k: Update AR9462 initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h | 4 ++--
 drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
index 1b6b4d0..b00dd64 100644
--- a/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
@@ -59,7 +59,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03a5, 0x03a5, 0x03a5, 0x03a5},
{0x9e2c, 0x001c, 0x001c, 0x0021, 0x0021},
-   {0x9e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
+   {0x9e3c, 0xcf946220, 0xcf946220, 0xcfd5c780, 0xcfd5c280},
{0x9e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
@@ -79,7 +79,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x0150, 0x0150},
{0xa288, 0x0110, 0x0110, 0x0110, 0x0110},
{0xa28c, 0x0002, 0x0002, 0x0002, 0x0002},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+   {0xa2c4, 0x00058d18, 0x00058d18, 0x00058d18, 0x00058d18},
{0xa2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
{0xa2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
{0xa358, 0x, 0x, 0x, 0x},
diff --git a/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h
index dc3adda..0f8745e 100644
--- a/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9462_2p1_initvals.h
@@ -239,7 +239,7 @@ static const u32 ar9462_2p1_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03a5, 0x03a5, 0x03a5, 0x03a5},
{0x9e2c, 0x001c, 0x001c, 0x0021, 0x0021},
-   {0x9e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
+   {0x9e3c, 0xcf946220, 0xcf946220, 0xcfd5c780, 0xcfd5c280},
{0x9e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
@@ -259,7 +259,7 @@ static const u32 ar9462_2p1_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x0150, 0x0150},
{0xa288, 0x0110, 0x0110, 0x0110, 0x0110},
{0xa28c, 0x0002, 0x0002, 0x0002, 0x0002},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+   {0xa2c4, 0x00058d18, 0x00058d18, 0x00058d18, 0x00058d18},
{0xa2d0, 0x00041981, 0x00041981, 0x00041981, 0x00041982},
{0xa2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
{0xa358, 0x, 0x, 0x, 0x},
-- 
1.9.1

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


[PATCH 02/13] ath9k: Update AR9003 2.2 initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
index c38399b..c07866a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
@@ -331,7 +331,7 @@ static const u32 ar9300_2p2_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03b5, 0x03b5, 0x03ce, 0x03ce},
{0x9e2c, 0x001c, 0x001c, 0x0021, 0x0021},
-   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946222, 0xcf946222},
+   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946220, 0xcf946220},
{0x9e44, 0x02321e27, 0x02321e27, 0x02291e27, 0x02291e27},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
@@ -351,7 +351,7 @@ static const u32 ar9300_2p2_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x0150, 0x0150},
{0xa288, 0x0110, 0x0110, 0x0110, 0x0110},
{0xa28c, 0x0002, 0x0002, 0x0002, 0x0002},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+   {0xa2c4, 0x00058d18, 0x00058d18, 0x00058d18, 0x00058d18},
{0xa2d0, 0x00041983, 0x00041983, 0x00041981, 0x00041982},
{0xa2d8, 0x7999a83b, 0x7999a83b, 0x7999a83b, 0x7999a83b},
{0xa358, 0x, 0x, 0x, 0x},
-- 
1.9.1

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


[PATCH 04/13] ath9k: Update AR9340 initvals

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Signed-off-by: Miaoqing Pan 
---
 drivers/net/wireless/ath/ath9k/ar9340_initvals.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9340_initvals.h 
b/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
index b995ffe..2eb163f 100644
--- a/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9340_initvals.h
@@ -245,7 +245,7 @@ static const u32 ar9340_1p0_baseband_postamble[][5] = {
{0x9e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x9e20, 0x03b5, 0x03b5, 0x03ce, 0x03ce},
{0x9e2c, 0x001c, 0x001c, 0x0021, 0x0021},
-   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946222, 0xcf946222},
+   {0x9e3c, 0xcf946220, 0xcf946220, 0xcf946220, 0xcf946220},
{0x9e44, 0x02321e27, 0x02321e27, 0x02291e27, 0x02291e27},
{0x9e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012},
{0x9fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000},
@@ -265,7 +265,7 @@ static const u32 ar9340_1p0_baseband_postamble[][5] = {
{0xa284, 0x, 0x, 0x0150, 0x0150},
{0xa288, 0x0220, 0x0220, 0x0110, 0x0110},
{0xa28c, 0x0001, 0x0001, 0x0002, 0x0002},
-   {0xa2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18},
+   {0xa2c4, 0x00058d18, 0x00058d18, 0x00058d18, 0x00058d18},
{0xa2d0, 0x00041983, 0x00041983, 0x00041982, 0x00041982},
{0xa2d8, 0x7999a83a, 0x7999a83a, 0x7999a83a, 0x7999a83a},
{0xa358, 0x, 0x, 0x, 0x},
-- 
1.9.1

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


[PATCH 00/13] disable hw peak cal for all ar9300 chips

2016-02-26 Thread miaoqing
From: Miaoqing Pan 

HW peak detect calibration would fail for AR9300 chips and
we went for implementing the SW way of doing it instead of
HW doing the peak detect calibration.

Miaoqing Pan (13):
  ath9k: Update QCA953x initvals
  ath9k: Update AR9003 2.2 initvals
  ath9k: Update AR933x initvals
  ath9k: Update AR9340 initvals
  ath9k: Update AR9462 initvals
  ath9k: Update AR9485 initvals
  ath9k: Update AR955x initvals
  ath9k: Update AR9565 initvals
  ath9k: Update QCA956x initvals
  ath9k: Update AR9580 initvals
  ath9k: enable manual peak cal for all ar9300 chips
  ath9k: use AR_SREV_9003_PCOEM to identify PCOEM chips
  ath9k: set correct peak detect threshold

 .../net/wireless/ath/ath9k/ar9003_2p2_initvals.h   |  4 +-
 drivers/net/wireless/ath/ath9k/ar9003_calib.c  | 44 +-
 .../net/wireless/ath/ath9k/ar9330_1p1_initvals.h   |  4 +-
 .../net/wireless/ath/ath9k/ar9330_1p2_initvals.h   |  4 +-
 drivers/net/wireless/ath/ath9k/ar9340_initvals.h   |  4 +-
 .../net/wireless/ath/ath9k/ar9462_2p0_initvals.h   |  4 +-
 .../net/wireless/ath/ath9k/ar9462_2p1_initvals.h   |  4 +-
 drivers/net/wireless/ath/ath9k/ar9485_initvals.h   |  4 +-
 drivers/net/wireless/ath/ath9k/ar953x_initvals.h   |  4 +-
 .../net/wireless/ath/ath9k/ar955x_1p0_initvals.h   |  2 +-
 .../net/wireless/ath/ath9k/ar9565_1p0_initvals.h   |  2 +-
 drivers/net/wireless/ath/ath9k/ar956x_initvals.h   |  2 +-
 .../net/wireless/ath/ath9k/ar9580_1p0_initvals.h   |  4 +-
 13 files changed, 39 insertions(+), 47 deletions(-)

-- 
1.9.1

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