* [PATCH 07/20] iwlwifi: nvm-parse: advertise IEEE80211_VHT_EXT_NSS_BW_CAPABLE in VHT
From: Luca Coelho @ 2019-02-15 11:49 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Johannes Berg, Luca Coelho
In-Reply-To: <20190215114924.2545-1-luca@coelho.fi>
From: Johannes Berg <johannes.berg@intel.com>
We support this, so we should advertise it. In fact, if we don't,
mac80211 will do it for us (as we advertise SUPPORTS_VHT_EXT_NSS_BW
to it), but that requires a memory reallocation which is wasteful:
ieee80211 phy0: copying sband (band 1) due to VHT EXT NSS BW flag
Set the flag here to avoid that.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index ca6a243d704b..65228a092bd6 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -8,7 +8,7 @@
* Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018 - 2019 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018 - 2019 Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -463,6 +463,9 @@ static void iwl_init_vht_hw_capab(const struct iwl_cfg *cfg,
}
vht_cap->vht_mcs.tx_mcs_map = vht_cap->vht_mcs.rx_mcs_map;
+
+ vht_cap->vht_mcs.tx_highest |=
+ cpu_to_le16(IEEE80211_VHT_EXT_NSS_BW_CAPABLE);
}
static struct ieee80211_sband_iftype_data iwl_he_capa[] = {
--
2.20.1
^ permalink raw reply related
* [PATCH 06/20] iwlwifi: mvm: fix error path in iwl_mvm_mac_setup_register()
From: Luca Coelho @ 2019-02-15 11:49 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Johannes Berg, Luca Coelho
In-Reply-To: <20190215114924.2545-1-luca@coelho.fi>
From: Johannes Berg <johannes.berg@intel.com>
The IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE bit shouldn't be set,
and realistically we should complete all setup before we call the
ieee80211_register_hw() function. Fix this.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index a3bbf2ce571f..a585ee509987 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -796,16 +796,19 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
hw->netdev_features |= IWL_TX_CSUM_NETIF_FLAGS;
}
- ret = ieee80211_register_hw(mvm->hw);
- if (ret)
- iwl_mvm_leds_exit(mvm);
- mvm->init_status |= IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE;
-
if (mvm->cfg->vht_mu_mimo_supported)
wiphy_ext_feature_set(hw->wiphy,
NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER);
- return ret;
+ ret = ieee80211_register_hw(mvm->hw);
+ if (ret) {
+ iwl_mvm_leds_exit(mvm);
+ return ret;
+ }
+
+ mvm->init_status |= IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE;
+
+ return 0;
}
static bool iwl_mvm_defer_tx(struct iwl_mvm *mvm,
--
2.20.1
^ permalink raw reply related
* [PATCH 05/20] iwlwifi: nvm-parse: use struct_size() in kzalloc()
From: Luca Coelho @ 2019-02-15 11:49 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Gustavo A. R. Silva, Luca Coelho
In-Reply-To: <20190215114924.2545-1-luca@coelho.fi>
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
One of the more common cases of allocation size calculations is finding the
size of a structure that has a zero-sized array at the end, along with memory
for some number of elements for that array. For example:
struct foo {
int stuff;
void *entry[];
};
instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL);
Instead of leaving these open-coded and prone to type mistakes, we can now
use the new struct_size() helper:
instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL);
This code was detected with the help of Coccinelle.
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index 503860a2b36d..ca6a243d704b 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -946,15 +946,13 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
const __le16 *ch_section;
if (cfg->nvm_type != IWL_NVM_EXT)
- data = kzalloc(sizeof(*data) +
- sizeof(struct ieee80211_channel) *
- IWL_NVM_NUM_CHANNELS,
- GFP_KERNEL);
+ data = kzalloc(struct_size(data, channels,
+ IWL_NVM_NUM_CHANNELS),
+ GFP_KERNEL);
else
- data = kzalloc(sizeof(*data) +
- sizeof(struct ieee80211_channel) *
- IWL_NVM_NUM_CHANNELS_EXT,
- GFP_KERNEL);
+ data = kzalloc(struct_size(data, channels,
+ IWL_NVM_NUM_CHANNELS_EXT),
+ GFP_KERNEL);
if (!data)
return NULL;
@@ -1441,9 +1439,7 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans,
if (empty_otp)
IWL_INFO(trans, "OTP is empty\n");
- nvm = kzalloc(sizeof(*nvm) +
- sizeof(struct ieee80211_channel) * IWL_NUM_CHANNELS,
- GFP_KERNEL);
+ nvm = kzalloc(struct_size(nvm, channels, IWL_NUM_CHANNELS), GFP_KERNEL);
if (!nvm) {
ret = -ENOMEM;
goto out;
--
2.20.1
^ permalink raw reply related
* [PATCH 02/20] iwlwifi: mvm: Don't request HW restart if already requested
From: Luca Coelho @ 2019-02-15 11:49 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Ilan Peer, Luca Coelho
In-Reply-To: <20190215114924.2545-1-luca@coelho.fi>
From: Ilan Peer <ilan.peer@intel.com>
In case mac80211 was requested to perform an HW restart, but the HW
restart has not started yet, there is no need to request another one.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 33053d136a8c..0996c97c4b94 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -1320,6 +1320,9 @@ void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error)
reprobe->dev = mvm->trans->dev;
INIT_WORK(&reprobe->work, iwl_mvm_reprobe_wk);
schedule_work(&reprobe->work);
+ } else if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED,
+ &mvm->status)) {
+ IWL_ERR(mvm, "HW restart already requested, but not started\n");
} else if (mvm->fwrt.cur_fw_img == IWL_UCODE_REGULAR &&
mvm->hw_registered &&
!test_bit(STATUS_TRANS_DEAD, &mvm->trans->status)) {
--
2.20.1
^ permalink raw reply related
* [PATCH 01/20] iwlwifi: pcie: allocate rb_stts's for all queues in one place
From: Luca Coelho @ 2019-02-15 11:49 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Triebitz, Luca Coelho
In-Reply-To: <20190215114924.2545-1-luca@coelho.fi>
From: Triebitz <shaul.triebitz@intel.com>
AX210 devices assume that the (DRAM) addresses of the rb_stts's for
the different queues are continuous.
So allocate the rb_stts's for all the Rx queues in one place.
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../wireless/intel/iwlwifi/pcie/internal.h | 9 ++-
drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 66 ++++++++++++++-----
2 files changed, 57 insertions(+), 18 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
index 0ecd90d050e6..bf8b61a476c5 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h
@@ -8,7 +8,7 @@
* Copyright(c) 2003 - 2015 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018 - 2019 Intel Corporation
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
@@ -31,7 +31,7 @@
* Copyright(c) 2003 - 2015 Intel Corporation. All rights reserved.
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018 - 2019 Intel Corporation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -526,6 +526,8 @@ struct cont_rec {
* @fh_mask: current unmasked fh causes
* @hw_mask: current unmasked hw causes
* @in_rescan: true if we have triggered a device rescan
+ * @base_rb_stts: base virtual address of receive buffer status for all queues
+ * @base_rb_stts_dma: base physical address of receive buffer status
*/
struct iwl_trans_pcie {
struct iwl_rxq *rxq;
@@ -617,6 +619,9 @@ struct iwl_trans_pcie {
cpumask_t affinity_mask[IWL_MAX_RX_HW_QUEUES];
u16 tx_cmd_queue_size;
bool in_rescan;
+
+ void *base_rb_stts;
+ dma_addr_t base_rb_stts_dma;
};
static inline struct iwl_trans_pcie *
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
index 38844215a58e..8d4f0628622b 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c
@@ -702,11 +702,6 @@ static void iwl_pcie_free_rxq_dma(struct iwl_trans *trans,
rxq->bd_dma = 0;
rxq->bd = NULL;
- if (rxq->rb_stts)
- dma_free_coherent(trans->dev,
- use_rx_td ? sizeof(__le16) :
- sizeof(struct iwl_rb_status),
- rxq->rb_stts, rxq->rb_stts_dma);
rxq->rb_stts_dma = 0;
rxq->rb_stts = NULL;
@@ -743,6 +738,8 @@ static int iwl_pcie_alloc_rxq_dma(struct iwl_trans *trans,
int free_size;
bool use_rx_td = (trans->cfg->device_family >=
IWL_DEVICE_FAMILY_22560);
+ size_t rb_stts_size = use_rx_td ? sizeof(__le16) :
+ sizeof(struct iwl_rb_status);
spin_lock_init(&rxq->lock);
if (trans->cfg->mq_rx_supported)
@@ -770,12 +767,9 @@ static int iwl_pcie_alloc_rxq_dma(struct iwl_trans *trans,
goto err;
}
- /* Allocate the driver's pointer to receive buffer status */
- rxq->rb_stts = dma_alloc_coherent(dev,
- use_rx_td ? sizeof(__le16) : sizeof(struct iwl_rb_status),
- &rxq->rb_stts_dma, GFP_KERNEL);
- if (!rxq->rb_stts)
- goto err;
+ rxq->rb_stts = trans_pcie->base_rb_stts + rxq->id * rb_stts_size;
+ rxq->rb_stts_dma =
+ trans_pcie->base_rb_stts_dma + rxq->id * rb_stts_size;
if (!use_rx_td)
return 0;
@@ -805,7 +799,6 @@ static int iwl_pcie_alloc_rxq_dma(struct iwl_trans *trans,
iwl_pcie_free_rxq_dma(trans, rxq);
}
- kfree(trans_pcie->rxq);
return -ENOMEM;
}
@@ -815,6 +808,9 @@ int iwl_pcie_rx_alloc(struct iwl_trans *trans)
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
struct iwl_rb_allocator *rba = &trans_pcie->rba;
int i, ret;
+ size_t rb_stts_size = trans->cfg->device_family >=
+ IWL_DEVICE_FAMILY_22560 ?
+ sizeof(__le16) : sizeof(struct iwl_rb_status);
if (WARN_ON(trans_pcie->rxq))
return -EINVAL;
@@ -822,18 +818,46 @@ int iwl_pcie_rx_alloc(struct iwl_trans *trans)
trans_pcie->rxq = kcalloc(trans->num_rx_queues, sizeof(struct iwl_rxq),
GFP_KERNEL);
if (!trans_pcie->rxq)
- return -EINVAL;
+ return -ENOMEM;
spin_lock_init(&rba->lock);
+ /*
+ * Allocate the driver's pointer to receive buffer status.
+ * Allocate for all queues continuously (HW requirement).
+ */
+ trans_pcie->base_rb_stts =
+ dma_alloc_coherent(trans->dev,
+ rb_stts_size * trans->num_rx_queues,
+ &trans_pcie->base_rb_stts_dma,
+ GFP_KERNEL);
+ if (!trans_pcie->base_rb_stts) {
+ ret = -ENOMEM;
+ goto err;
+ }
+
for (i = 0; i < trans->num_rx_queues; i++) {
struct iwl_rxq *rxq = &trans_pcie->rxq[i];
+ rxq->id = i;
ret = iwl_pcie_alloc_rxq_dma(trans, rxq);
if (ret)
- return ret;
+ goto err;
}
return 0;
+
+err:
+ if (trans_pcie->base_rb_stts) {
+ dma_free_coherent(trans->dev,
+ rb_stts_size * trans->num_rx_queues,
+ trans_pcie->base_rb_stts,
+ trans_pcie->base_rb_stts_dma);
+ trans_pcie->base_rb_stts = NULL;
+ trans_pcie->base_rb_stts_dma = 0;
+ }
+ kfree(trans_pcie->rxq);
+
+ return ret;
}
static void iwl_pcie_rx_hw_init(struct iwl_trans *trans, struct iwl_rxq *rxq)
@@ -1042,8 +1066,6 @@ int _iwl_pcie_rx_init(struct iwl_trans *trans)
for (i = 0; i < trans->num_rx_queues; i++) {
struct iwl_rxq *rxq = &trans_pcie->rxq[i];
- rxq->id = i;
-
spin_lock(&rxq->lock);
/*
* Set read write pointer to reflect that we have processed
@@ -1130,6 +1152,9 @@ void iwl_pcie_rx_free(struct iwl_trans *trans)
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
struct iwl_rb_allocator *rba = &trans_pcie->rba;
int i;
+ size_t rb_stts_size = trans->cfg->device_family >=
+ IWL_DEVICE_FAMILY_22560 ?
+ sizeof(__le16) : sizeof(struct iwl_rb_status);
/*
* if rxq is NULL, it means that nothing has been allocated,
@@ -1144,6 +1169,15 @@ void iwl_pcie_rx_free(struct iwl_trans *trans)
iwl_pcie_free_rbs_pool(trans);
+ if (trans_pcie->base_rb_stts) {
+ dma_free_coherent(trans->dev,
+ rb_stts_size * trans->num_rx_queues,
+ trans_pcie->base_rb_stts,
+ trans_pcie->base_rb_stts_dma);
+ trans_pcie->base_rb_stts = NULL;
+ trans_pcie->base_rb_stts_dma = 0;
+ }
+
for (i = 0; i < trans->num_rx_queues; i++) {
struct iwl_rxq *rxq = &trans_pcie->rxq[i];
--
2.20.1
^ permalink raw reply related
* [PATCH 00/20] iwlwifi: updates intended for v5.1 2019-02-15
From: Luca Coelho @ 2019-02-15 11:49 UTC (permalink / raw)
To: kvalo; +Cc: linux-wireless, Luca Coelho
From: Luca Coelho <luciano.coelho@intel.com>
Hi,
Here's the nineth set of patches intended for v5.1. It's the usual
development, new features, cleanups and bugfixes.
The changes are:
* Some small fixes in the new debugging infrastructure;
* Greg's debugfs clean-ups;
* Some janitorial patches from the community;
* Fix to one false-positive compiler warning;
* NSS suuport;
* Other general bugfixes and cleanups;
As usual, I'm pushing this to a pending branch, for kbuild bot, and
will send a pull-request later.
Please review.
Cheers,
Luca.
Andrei Otcheretianski (1):
iwlwifi: mvm: Set TX_CMD_FLG_PROT_REQUIRE correctly
Arnd Bergmann (1):
iwlwifi: fix false-positive maybe-uninitialized warning
Greg Kroah-Hartman (3):
iwlwifi: dvm: no need to check return value of debugfs_create
functions
iwlwifi: fw: no need to check return value of debugfs_create functions
iwlwifi: iwl-drv: no need to check return value of debugfs_create
functions
Gustavo A. R. Silva (2):
iwlwifi: eeprom-parse: use struct_size() in kzalloc()
iwlwifi: nvm-parse: use struct_size() in kzalloc()
Ilan Peer (2):
iwlwifi: mvm: Don't request HW restart if already requested
iwlwifi: mvm: Allow retries for probe responses
Johannes Berg (4):
iwlwifi: mvm: fix error path in iwl_mvm_mac_setup_register()
iwlwifi: nvm-parse: advertise IEEE80211_VHT_EXT_NSS_BW_CAPABLE in VHT
iwlwifi: mvm: remove IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE
iwlwifi: mvm: implement VHT extended NSS support in rs.c
Liad Kaufman (1):
iwlwifi: mvm: add read debugfs for he_sniffer_params
Sara Sharon (3):
iwlwifi: mvm: reject new beacons when in inject mode
iwlwifi: mvm: support non-transmitting AP
iwlwifi: mvm: add some debug data to TX path
Shahar S Matityahu (2):
iwlwifi: remove redundant condition from prior alive dump flow
iwlwifi: dbg_ini: fix infinite time ignore consecutive dumps
Triebitz (1):
iwlwifi: pcie: allocate rb_stts's for all queues in one place
drivers/net/wireless/intel/iwlwifi/dvm/agn.h | 9 +--
.../net/wireless/intel/iwlwifi/dvm/debugfs.c | 44 ++-----------
drivers/net/wireless/intel/iwlwifi/dvm/main.c | 5 +-
drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 18 -----
.../net/wireless/intel/iwlwifi/fw/debugfs.c | 11 +---
.../net/wireless/intel/iwlwifi/fw/debugfs.h | 9 +--
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 22 -------
.../wireless/intel/iwlwifi/iwl-eeprom-parse.c | 3 +-
.../wireless/intel/iwlwifi/iwl-nvm-parse.c | 25 ++++---
.../wireless/intel/iwlwifi/mvm/constants.h | 1 +
.../net/wireless/intel/iwlwifi/mvm/debugfs.c | 32 +++++++--
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 +--
.../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 8 +++
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 18 +++--
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 +-
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 8 +--
drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 23 ++++++-
drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 27 +++++---
.../wireless/intel/iwlwifi/pcie/internal.h | 9 ++-
drivers/net/wireless/intel/iwlwifi/pcie/rx.c | 66 ++++++++++++++-----
20 files changed, 183 insertions(+), 166 deletions(-)
--
2.20.1
^ permalink raw reply
* Re: [RFC PATCH v3 00/12] Draft for Extended Key ID support
From: Johannes Berg @ 2019-02-15 11:10 UTC (permalink / raw)
To: Alexander Wetzel; +Cc: linux-wireless
In-Reply-To: <20190210210620.31181-1-alexander@wetzel-home.de>
On Sun, 2019-02-10 at 22:06 +0100, Alexander Wetzel wrote:
>
> The driver patches are - with the exception of the hwsim patch -
> definitely not ready for merge and mostly here to illustrate how the
> different APIs can be used and to start some discussions how to handle HW
> specific challenges. Of course if someone wants to play with Extended Key
> ID they also should be useful... (I can provide updated mostly working
> hostapd/wpa_supplicant patches if someone is interested.
Of course :-)
Some tests for the hwsim tests there would also be nice, that's the
easiest way to see something working - if you have them.
johannes
^ permalink raw reply
* Re: [RFC PATCH v3 04/12] mac80211: Compatibility Extended Key ID support
From: Johannes Berg @ 2019-02-15 11:09 UTC (permalink / raw)
To: Alexander Wetzel; +Cc: linux-wireless
In-Reply-To: <20190210210620.31181-5-alexander@wetzel-home.de>
> + if (!ext_native && key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
> + key->flags |= KEY_FLAG_RX_SW_CRYPTO;
> + /* Activate Rx crypto offload after max 10s when idle */
> + ieee80211_queue_delayed_work(&local->hw, &sta->ext_key_compat_wk,
> + round_jiffies_relative(HZ * 10));
> + }
Is there much point in this?
> + if (unlikely(rx->key->flags & KEY_FLAG_RX_SW_CRYPTO)) {
> + rx->key->flags &= ~KEY_FLAG_RX_SW_CRYPTO;
> + cancel_delayed_work(&rx->sta->ext_key_compat_wk);
> + ieee80211_queue_delayed_work(&rx->local->hw,
> + &rx->sta->ext_key_compat_wk, 0);
> + }
We'll almost certainly do it from here, so never exercise the other
path?
johannes
^ permalink raw reply
* Re: [RFC PATCH v3 03/12] mac80211: IEEE 802.11 Extended Key ID support
From: Johannes Berg @ 2019-02-15 11:06 UTC (permalink / raw)
To: Alexander Wetzel; +Cc: linux-wireless
In-Reply-To: <20190210210620.31181-4-alexander@wetzel-home.de>
On Sun, 2019-02-10 at 22:06 +0100, Alexander Wetzel wrote:
>
> - Enforce cipher does not change when replacing a key.
is that actually required somehow?
> + * @EXT_SET_KEY: a new key must be set but is only valid for decryption
> + * @EXT_KEY_RX_TX: a key installed with @EXT_SET_KEY is becoming the
> + * designated Rx/Tx key for the station
Not sure I like the EXT_SET_KEY. There's also no "designated Rx key", is
there? It's always selected by key ID.
How about SET_KEY_RXONLY and SET_KEY_TX or something like that?
> +static int ieee80211_set_tx_key(struct ieee80211_sub_if_data *sdata,
> + const u8 *mac_addr, u8 key_idx)
> +{
> + struct ieee80211_local *local = sdata->local;
> + struct ieee80211_key *key;
> + struct sta_info *sta;
> + int ret;
> +
> + if (!wiphy_ext_feature_isset(local->hw.wiphy,
> + NL80211_EXT_FEATURE_EXT_KEY_ID))
> + return -EINVAL;
You set this, wouldn't it make more sense to check EXT_KEY_ID_NATIVE?
Or maybe this is because of the next patch?
> + sta = sta_info_get_bss(sdata, mac_addr);
> +
> + if (!sta)
> + return -EINVAL;
> +
> + if (sta->ptk_idx == key_idx)
> + return 0;
> +
> + mutex_lock(&local->key_mtx);
> + key = key_mtx_dereference(local, sta->ptk[key_idx]);
> +
> + if (key && key->flags & KEY_FLAG_RX_ONLY)
do you even need the flag? Isn't it equivalent to checking
sta->ptk_idx != key->idx
or so?
Less data to maintain would be better.
> + bool ext_native = ieee80211_hw_check(&local->hw, EXT_KEY_ID_NATIVE);
you sort of only need this in the next patch, but I guess it doesn't
matter that much
> +int ieee80211_key_activate_tx(struct ieee80211_key *key)
> +{
> + struct ieee80211_sub_if_data *sdata = key->sdata;
> + struct sta_info *sta = key->sta;
> + struct ieee80211_local *local = key->local;
> + struct ieee80211_key *old;
> + int ret;
> +
> + assert_key_lock(local);
> +
> + key->flags &= ~KEY_FLAG_RX_ONLY;
> +
> + if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) ||
> + key->conf.flags & (IEEE80211_KEY_FLAG_GENERATE_MMIC |
> + IEEE80211_KEY_FLAG_PUT_MIC_SPACE |
> + IEEE80211_KEY_FLAG_RESERVE_TAILROOM))
> + increment_tailroom_need_count(sdata);
> +
> + if (key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) {
> + ret = drv_set_key(local, EXT_KEY_RX_TX, sdata,
> + &sta->sta, &key->conf);
> + if (ret) {
> + sdata_err(sdata,
> + "failed to activate key for Tx (%d, %pM)\n",
> + key->conf.keyidx, sta->sta.addr);
> + return ret;
You've already cleared the RX_ONLY flag, which gets you inconsistent
data now.
> + }
> + }
> +
> + old = key_mtx_dereference(local, sta->ptk[sta->ptk_idx]);
> + sta->ptk_idx = key->conf.keyidx;
but you set this only here.
> - /* Stop TX till we are on the new key */
> + /* Stop Tx till we are on the new key */
Uh, I had to read that three times ... please don't make changes like
that? :)
> old_key->flags |= KEY_FLAG_TAINTED;
> ieee80211_clear_fast_xmit(sta);
>
> - /* Aggregation sessions during rekey are complicated due to the
> + /* Aggregation sessions during rekey are complicated by the
similarly here, please don't make drive-by comment wording issues (also,
I'm not sure I agree - the old version just treats "complicated" as an
adjective, you treat it as a verb, but ultimately doesn't really matter?
> #define NUM_DEFAULT_KEYS 4
> #define NUM_DEFAULT_MGMT_KEYS 2
> +#define INVALID_PTK_KEYIDX 2 /* Existing key slot never used by PTK keys */
We could also use something obviously wrong like 0xff?
> +++ b/net/mac80211/tx.c
> @@ -3000,23 +3000,15 @@ void ieee80211_check_fast_xmit(struct sta_info *sta)
> switch (build.key->conf.cipher) {
> case WLAN_CIPHER_SUITE_CCMP:
> case WLAN_CIPHER_SUITE_CCMP_256:
> - /* add fixed key ID */
> - if (gen_iv) {
> - (build.hdr + build.hdr_len)[3] =
> - 0x20 | (build.key->conf.keyidx << 6);
> + if (gen_iv)
> build.pn_offs = build.hdr_len;
> - }
> if (gen_iv || iv_spc)
> build.hdr_len += IEEE80211_CCMP_HDR_LEN;
> break;
> case WLAN_CIPHER_SUITE_GCMP:
> case WLAN_CIPHER_SUITE_GCMP_256:
> - /* add fixed key ID */
> - if (gen_iv) {
> - (build.hdr + build.hdr_len)[3] =
> - 0x20 | (build.key->conf.keyidx << 6);
> + if (gen_iv)
> build.pn_offs = build.hdr_len;
> - }
> if (gen_iv || iv_spc)
> build.hdr_len += IEEE80211_GCMP_HDR_LEN;
> break;
> @@ -3383,6 +3375,7 @@ static void ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
> pn = atomic64_inc_return(&key->conf.tx_pn);
> crypto_hdr[0] = pn;
> crypto_hdr[1] = pn >> 8;
> + crypto_hdr[3] = 0x20 | (key->conf.keyidx << 6);
> crypto_hdr[4] = pn >> 16;
> crypto_hdr[5] = pn >> 24;
> crypto_hdr[6] = pn >> 32;
This shouldn't be needed, you do update the fast TX cache when changing
the key?
johannes
^ permalink raw reply
* Re: [PATCH 0/8] rtlwifi: Remove CamelCase variables from all drivers
From: Kalle Valo @ 2019-02-15 10:54 UTC (permalink / raw)
To: Larry Finger; +Cc: linux-wireless, pkshih
In-Reply-To: <20190214223644.8035-1-Larry.Finger@lwfinger.net>
Larry Finger <Larry.Finger@lwfinger.net> writes:
> This set of patches fix all instances of CamelCase for all the drivers.
> When the symbol refers to a macro, it is converted to upper case. If a
> variable or a function, then it is converted to lower case.
>
> As noted in the comments, some of the other checkpatch exceptions are
> addressed.
I wish you had separated the camel case fixes from other cleanups, and
otherwise tried to simplify the patches, now you made the patchset
painful to review as all the changes are mixed and the size of patches
is just too large. Remember that the rule of thumb is one logical change
per patch. Of course that's not a hard rule, and can be ignored with
small and trivial patches, but most of the patches here are not small.
No need to resend because of this but please take care with the size of
patches and patchsets in the future.
--
Kalle Valo
^ permalink raw reply
* Re: [RFC PATCH v3 02/12] nl80211/cfg80211: Extended Key ID support
From: Johannes Berg @ 2019-02-15 10:52 UTC (permalink / raw)
To: Alexander Wetzel; +Cc: linux-wireless
In-Reply-To: <20190210210620.31181-3-alexander@wetzel-home.de>
On Sun, 2019-02-10 at 22:06 +0100, Alexander Wetzel wrote:
> +/**
> + * enum nl80211_key_install_mode - Key install mode
> + *
> + * @NL80211_KEY_RX_TX: Key must be installed for Rx and Tx
> + * @NL80211_KEY_RX_ONLY: Allowed in combination with @NL80211_CMD_NEW_KEY:
> + * Unicast key has to be installed for Rx only.
> + * @NL80211_KEY_SWITCH_TX: Allowed in combination with @NL80211_CMD_SET_KEY:
> + * Switch Tx to a Rx only, referenced by sta mac and idx.
Don't you mean the other way around? Or, well, what you say is true for
the *other* keys?
> * by the %NL80211_SCAN_FLAG_MIN_PREQ_CONTENT flag.
> * @NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER: Driver supports enabling fine
> * timing measurement responder role.
> - *
no need to remove that :)
> - /* only support setting default key */
> - if (!key.def && !key.defmgmt)
> + /* Only support setting default key and
> + * Extended Key ID action @NL80211_KEY_SWITCH_TX.
> + */
you can remove the @, it's not a kernel-doc formatted comment
> - }
> + } else if (key.p.install_mode == NL80211_KEY_SWITCH_TX &&
> + wiphy_ext_feature_isset(&rdev->wiphy,
> + NL80211_EXT_FEATURE_EXT_KEY_ID)) {
> + u8 *mac_addr = NULL;
>
> + if (info->attrs[NL80211_ATTR_MAC])
> + mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]);
> +
> + if (!mac_addr || key.idx < 0 || key.idx > 1) {
> + err = -EINVAL;
> + goto out;
> + }
Really only 0 and 1 are allowed? Not 0-3?
> +++ b/net/wireless/util.c
> @@ -236,14 +236,22 @@ int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev,
> case WLAN_CIPHER_SUITE_CCMP_256:
> case WLAN_CIPHER_SUITE_GCMP:
> case WLAN_CIPHER_SUITE_GCMP_256:
> - /* Disallow pairwise keys with non-zero index unless it's WEP
> - * or a vendor specific cipher (because current deployments use
> - * pairwise WEP keys with non-zero indices and for vendor
> - * specific ciphers this should be validated in the driver or
> - * hardware level - but 802.11i clearly specifies to use zero)
> + /* IEEE802.11-2016 allows only 0 and - when using Extended Key
> + * ID - 1 as index for pairwise keys.
> + * @NL80211_KEY_RX_ONLY is only allowed for pairwise keys when
> + * the driver supports Extended Key ID.
> + * @NL80211_KEY_SWITCH_TX must not be set when validating a key.
> */
> - if (pairwise && key_idx)
> + if (params->install_mode == NL80211_KEY_RX_ONLY) {
> + if (!wiphy_ext_feature_isset(&rdev->wiphy,
> + NL80211_EXT_FEATURE_EXT_KEY_ID))
> + return -EINVAL;
> + else if (!pairwise || key_idx < 0 || key_idx > 1)
> + return -EINVAL;
same question here
johannes
^ permalink raw reply
* Re: [PATCH 1/2] cfg80211: add support to probe unexercised mesh link
From: Johannes Berg @ 2019-02-15 10:45 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: linux-wireless, kevinhayes, julanhsu
In-Reply-To: <1550152570-13051-2-git-send-email-rmanohar@codeaurora.org>
> + * @NL80211_CMD_PROBE_MESH_LINK: The requirement for mesh link metric
> + * refreshing, is that from one mesh point we be able to send some data
> + * frames to other mesh points which are not currently selected as a
> + * primary traffic path, but which are only 1 hop away. The absence of
> + * the primary path to the chosen node makes it necessary to apply some
> + * form of marking on a chosen packet stream so that the packets can be
> + * properly steered to the selected node for testing, and not by the
> + * regular mesh path lookup. Further, the packets must be of type data
> + * so that the rate control (often embedded in firmware) is used for
> + * rate selection.
> + *
> + * Uses %NL80211_ATTR_MAC and %NL80211_ATTR_FRAME attributes. The frame
> + * content here is ethernet data.
Please document the address requirements as well.
johannes
^ permalink raw reply
* Re: [PATCH] brcmfmac: use bphy_err() in all wiphy-related code
From: Kalle Valo @ 2019-02-15 10:44 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Dan Carpenter, kbuild, kbuild-all, Arend van Spriel,
linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER <brcm80211-dev-list.pdl@broadcom.com>,,
Rafał Miłecki
In-Reply-To: <CACna6ryji=s3CNc4DHrcQnUKjTV1Dt2rGUyYM+1AVG67Hu4Jag@mail.gmail.com>
Rafał Miłecki <zajec5@gmail.com> writes:
> On Fri, 15 Feb 2019 at 11:04, Kalle Valo <kvalo@codeaurora.org> wrote:
>> Dan Carpenter <dan.carpenter@oracle.com> writes:
>>
>> > Hi Rafał,
>> >
>> > url:
>> > https://github.com/0day-ci/linux/commits/Rafa-Mi-ecki/brcmfmac-use-bphy_err-in-all-wiphy-related-code/20190214-140004
>> > base:
>> > https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
>> > master
>> >
>> > smatch warnings:
>> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:114
>> > brcmf_fweh_call_event_handler() warn: variable dereferenced before
>> > check 'ifp' (see line 110)
>> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:187
>> > brcmf_fweh_handle_if_event() error: we previously assumed 'ifp' could
>> > be null (see line 184)
>> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:189
>> > brcmf_fweh_handle_if_event() warn: variable dereferenced before check
>> > 'ifp' (see line 187)
>> >
>> > # https://github.com/0day-ci/linux/commit/e12dba9f5ed77216c5984a4b57ddc31ba23376c9
>> > git remote add linux-review https://github.com/0day-ci/linux
>> > git remote update linux-review
>> > git checkout e12dba9f5ed77216c5984a4b57ddc31ba23376c9
>> > vim +/ifp +114 drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
>> >
>> > 5c36b99a drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>> > Spriel 2012-11-14 104
>> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>> > Spriel 2012-11-14 105 static int brcmf_fweh_call_event_handler(struct
>> > brcmf_if *ifp,
>> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>> > Spriel 2012-11-14 106 enum brcmf_fweh_event_code code,
>> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>> > Spriel 2012-11-14 107 struct brcmf_event_msg *emsg,
>> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>> > Spriel 2012-11-14 108 void *data)
>> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>>
>> This report is very hard to read as the lines seem to be wrapped.
>
> I think it's your client playing tricks on you. I got the report
> correctly formatted and so did patchwork:
> https://patchwork.kernel.org/comment/22483031/
Now that's weird, Gnus has never failed me like this before. And I
remember I didn't have this problem with Dan's previous report few days
ago and all the other reports before that. Oh well, no time to
investigate so have to hope that this line wrapping magically disappears
as it appeared :)
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH 2/2] mac80211: probe unexercised mesh links
From: Johannes Berg @ 2019-02-15 10:44 UTC (permalink / raw)
To: Rajkumar Manoharan; +Cc: linux-wireless, kevinhayes, julanhsu
In-Reply-To: <1550152570-13051-3-git-send-email-rmanohar@codeaurora.org>
> void __ieee80211_subif_start_xmit(struct sk_buff *skb,
> struct net_device *dev,
> - u32 info_flags);
> + u32 info_flags,
> + u32 ctrl_flags);
I'd feel better if we could avoid all this, but if you really can't then
I guess we should split this out to a separate patch.
>
> + /* Allow injected packets to bypass mesh routing */
> + if (info->control.flags & IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP)
unlikely?
> +int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
> + const u8 *dest, const u8 *buf, size_t len)
> +{
> + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> + struct ieee80211_local *local = sdata->local;
> + struct sta_info *sta;
> + struct sk_buff *skb;
> + struct ethhdr *ehdr;
> +
> + if (len < sizeof(*ehdr))
> + return -EINVAL;
> +
> + mutex_lock(&local->sta_mtx);
> + sta = sta_info_get_bss(sdata, dest);
> + mutex_unlock(&local->sta_mtx);
> +
> + if (!sta)
> + return -ENOENT;
better add a comment here that the locking is fine because you only
check *existence* and don't use the sta pointer for anything else
> + ehdr = (struct ethhdr *)buf;
> + if (!ether_addr_equal(ehdr->h_dest, dest) ||
that check could be in cfg80211, but then why even bother passing the
"dest" separately?
> + !ether_addr_equal(ehdr->h_source, sdata->vif.addr) ||
probably this one too
> + is_multicast_ether_addr(ehdr->h_dest))
this one too
But also, ehdr isn't packed I think, you might have alignment issues
here as you don't know how the netlink message looks like? I think?
> + if (ehdr->h_proto != htons(ETH_P_802_3))
> + return -EINVAL;
same here
> + skb = dev_alloc_skb(local->hw.extra_tx_headroom + len);
you should make it a bit bigger so header conversion will fit, I guess?
johannes
^ permalink raw reply
* Re: [PATCH] brcmfmac: use bphy_err() in all wiphy-related code
From: Arend Van Spriel @ 2019-02-15 10:40 UTC (permalink / raw)
To: Dan Carpenter, Kalle Valo, kbuild, kbuild-all
Cc: Rafał Miłecki, linux-wireless, brcm80211-dev-list.pdl,
brcm80211-dev-list, Rafał Miłecki
In-Reply-To: <20190215103803.GF2304@kadam>
On 2/15/2019 11:38 AM, Dan Carpenter wrote:
> On Fri, Feb 15, 2019 at 12:04:31PM +0200, Kalle Valo wrote:
>> Dan Carpenter <dan.carpenter@oracle.com> writes:
>>
>>> Hi Rafał,
>>>
>>> url:
>>> https://github.com/0day-ci/linux/commits/Rafa-Mi-ecki/brcmfmac-use-bphy_err-in-all-wiphy-related-code/20190214-140004
>>> base:
>>> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
>>> master
>>>
>>> smatch warnings:
>>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:114
>>> brcmf_fweh_call_event_handler() warn: variable dereferenced before
>>> check 'ifp' (see line 110)
>>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:187
>>> brcmf_fweh_handle_if_event() error: we previously assumed 'ifp' could
>>> be null (see line 184)
>>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:189
>>> brcmf_fweh_handle_if_event() warn: variable dereferenced before check
>>> 'ifp' (see line 187)
>>>
>>> # https://github.com/0day-ci/linux/commit/e12dba9f5ed77216c5984a4b57ddc31ba23376c9
>>> git remote add linux-review https://github.com/0day-ci/linux
>>> git remote update linux-review
>>> git checkout e12dba9f5ed77216c5984a4b57ddc31ba23376c9
>>> vim +/ifp +114 drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
>>>
>>> 5c36b99a drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>>> Spriel 2012-11-14 104
>>> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>>> Spriel 2012-11-14 105 static int brcmf_fweh_call_event_handler(struct
>>> brcmf_if *ifp,
>>> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>>> Spriel 2012-11-14 106 enum brcmf_fweh_event_code code,
>>> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>>> Spriel 2012-11-14 107 struct brcmf_event_msg *emsg,
>>> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>>> Spriel 2012-11-14 108 void *data)
>>> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>>
>> This report is very hard to read as the lines seem to be wrapped.
>>
>
> I feel like removing the filenames would make the reports more legible.
> We can get that information from the git hash if we really need it.
>
> Maybe just put the filename at the start:
>
> drivers/net/wireless/brcm80211/brcmfmac/fweh.c
> 5c36b99a Arend van Spriel 2012-11-14 104
> 3e0a97e1 Arend van Spriel 2012-11-14 105 static int brcmf_fweh_call_event_handler(struct brcmf_if *ifp,
Looks good to me.
Regards,
Arend
^ permalink raw reply
* Re: [PATCH] brcmfmac: use bphy_err() in all wiphy-related code
From: Dan Carpenter @ 2019-02-15 10:38 UTC (permalink / raw)
To: Kalle Valo, kbuild, kbuild-all
Cc: Rafał Miłecki, Arend van Spriel, linux-wireless,
brcm80211-dev-list.pdl, brcm80211-dev-list,
Rafał Miłecki
In-Reply-To: <87bm3dz7tc.fsf@kamboji.qca.qualcomm.com>
On Fri, Feb 15, 2019 at 12:04:31PM +0200, Kalle Valo wrote:
> Dan Carpenter <dan.carpenter@oracle.com> writes:
>
> > Hi Rafał,
> >
> > url:
> > https://github.com/0day-ci/linux/commits/Rafa-Mi-ecki/brcmfmac-use-bphy_err-in-all-wiphy-related-code/20190214-140004
> > base:
> > https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> > master
> >
> > smatch warnings:
> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:114
> > brcmf_fweh_call_event_handler() warn: variable dereferenced before
> > check 'ifp' (see line 110)
> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:187
> > brcmf_fweh_handle_if_event() error: we previously assumed 'ifp' could
> > be null (see line 184)
> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:189
> > brcmf_fweh_handle_if_event() warn: variable dereferenced before check
> > 'ifp' (see line 187)
> >
> > # https://github.com/0day-ci/linux/commit/e12dba9f5ed77216c5984a4b57ddc31ba23376c9
> > git remote add linux-review https://github.com/0day-ci/linux
> > git remote update linux-review
> > git checkout e12dba9f5ed77216c5984a4b57ddc31ba23376c9
> > vim +/ifp +114 drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
> >
> > 5c36b99a drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 104
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 105 static int brcmf_fweh_call_event_handler(struct
> > brcmf_if *ifp,
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 106 enum brcmf_fweh_event_code code,
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 107 struct brcmf_event_msg *emsg,
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 108 void *data)
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>
> This report is very hard to read as the lines seem to be wrapped.
>
I feel like removing the filenames would make the reports more legible.
We can get that information from the git hash if we really need it.
Maybe just put the filename at the start:
drivers/net/wireless/brcm80211/brcmfmac/fweh.c
5c36b99a Arend van Spriel 2012-11-14 104
3e0a97e1 Arend van Spriel 2012-11-14 105 static int brcmf_fweh_call_event_handler(struct brcmf_if *ifp,
regards,
dan carpenter
^ permalink raw reply
* Re: [PATCH V3] brcmfmac: use bphy_err() in all wiphy-related code
From: Kalle Valo @ 2019-02-15 10:37 UTC (permalink / raw)
To: Rafał Miłecki
Cc: Arend van Spriel, linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER <brcm80211-dev-list.pdl@broadcom.com>,,
Rafał Miłecki
In-Reply-To: <CACna6ry=mPipNw0u16Um6vij_DV5A-M0G++16WAAO3bZh_qjuA@mail.gmail.com>
Rafał Miłecki <zajec5@gmail.com> writes:
> On Fri, 15 Feb 2019 at 07:43, Rafał Miłecki <zajec5@gmail.com> wrote:
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> This recently added macro provides more meaningful error messages thanks
>> to identifying a specific wiphy. It's especially important on systems
>> with few cards supported by the same (brcmfmac) driver.
>>
>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
>> ---
>> V2: Fix one line over 80 chars
>> V3: Pass drvr to the brcmf_fweh_call_event_handler() to make getting
>> wiphy 100% reliable
>
> Kalle: please kindly hold on with this patch until we're done
> discussing bphy_err(). Mark it as deferred maybe?
Ok, I marked it as deferred. But please do remind me when it's ready to
be applied :)
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH V3] brcmfmac: use bphy_err() in all wiphy-related code
From: Rafał Miłecki @ 2019-02-15 10:10 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER <brcm80211-dev-list.pdl@broadcom.com>,,
Rafał Miłecki
In-Reply-To: <20190215064345.11946-1-zajec5@gmail.com>
On Fri, 15 Feb 2019 at 07:43, Rafał Miłecki <zajec5@gmail.com> wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> This recently added macro provides more meaningful error messages thanks
> to identifying a specific wiphy. It's especially important on systems
> with few cards supported by the same (brcmfmac) driver.
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> ---
> V2: Fix one line over 80 chars
> V3: Pass drvr to the brcmf_fweh_call_event_handler() to make getting
> wiphy 100% reliable
Kalle: please kindly hold on with this patch until we're done
discussing bphy_err(). Mark it as deferred maybe?
^ permalink raw reply
* Re: [PATCH] brcmfmac: use bphy_err() in all wiphy-related code
From: Rafał Miłecki @ 2019-02-15 10:08 UTC (permalink / raw)
To: Kalle Valo
Cc: Dan Carpenter, kbuild, kbuild-all, Arend van Spriel,
linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER <brcm80211-dev-list.pdl@broadcom.com>,,
Rafał Miłecki
In-Reply-To: <87bm3dz7tc.fsf@kamboji.qca.qualcomm.com>
On Fri, 15 Feb 2019 at 11:04, Kalle Valo <kvalo@codeaurora.org> wrote:
> Dan Carpenter <dan.carpenter@oracle.com> writes:
>
> > Hi Rafał,
> >
> > url:
> > https://github.com/0day-ci/linux/commits/Rafa-Mi-ecki/brcmfmac-use-bphy_err-in-all-wiphy-related-code/20190214-140004
> > base:
> > https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> > master
> >
> > smatch warnings:
> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:114
> > brcmf_fweh_call_event_handler() warn: variable dereferenced before
> > check 'ifp' (see line 110)
> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:187
> > brcmf_fweh_handle_if_event() error: we previously assumed 'ifp' could
> > be null (see line 184)
> > drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:189
> > brcmf_fweh_handle_if_event() warn: variable dereferenced before check
> > 'ifp' (see line 187)
> >
> > # https://github.com/0day-ci/linux/commit/e12dba9f5ed77216c5984a4b57ddc31ba23376c9
> > git remote add linux-review https://github.com/0day-ci/linux
> > git remote update linux-review
> > git checkout e12dba9f5ed77216c5984a4b57ddc31ba23376c9
> > vim +/ifp +114 drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
> >
> > 5c36b99a drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 104
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 105 static int brcmf_fweh_call_event_handler(struct
> > brcmf_if *ifp,
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 106 enum brcmf_fweh_event_code code,
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 107 struct brcmf_event_msg *emsg,
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> > Spriel 2012-11-14 108 void *data)
> > 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
>
> This report is very hard to read as the lines seem to be wrapped.
I think it's your client playing tricks on you. I got the report
correctly formatted and so did patchwork:
https://patchwork.kernel.org/comment/22483031/
--
Rafał
^ permalink raw reply
* Re: [PATCH] brcmfmac: use bphy_err() in all wiphy-related code
From: Kalle Valo @ 2019-02-15 10:04 UTC (permalink / raw)
To: Dan Carpenter
Cc: kbuild, Rafał Miłecki, kbuild-all, Arend van Spriel,
linux-wireless, brcm80211-dev-list.pdl, brcm80211-dev-list,
Rafał Miłecki
In-Reply-To: <20190215061601.GE2304@kadam>
Dan Carpenter <dan.carpenter@oracle.com> writes:
> Hi Rafał,
>
> url:
> https://github.com/0day-ci/linux/commits/Rafa-Mi-ecki/brcmfmac-use-bphy_err-in-all-wiphy-related-code/20190214-140004
> base:
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git
> master
>
> smatch warnings:
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:114
> brcmf_fweh_call_event_handler() warn: variable dereferenced before
> check 'ifp' (see line 110)
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:187
> brcmf_fweh_handle_if_event() error: we previously assumed 'ifp' could
> be null (see line 184)
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c:189
> brcmf_fweh_handle_if_event() warn: variable dereferenced before check
> 'ifp' (see line 187)
>
> # https://github.com/0day-ci/linux/commit/e12dba9f5ed77216c5984a4b57ddc31ba23376c9
> git remote add linux-review https://github.com/0day-ci/linux
> git remote update linux-review
> git checkout e12dba9f5ed77216c5984a4b57ddc31ba23376c9
> vim +/ifp +114 drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
>
> 5c36b99a drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> Spriel 2012-11-14 104
> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> Spriel 2012-11-14 105 static int brcmf_fweh_call_event_handler(struct
> brcmf_if *ifp,
> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> Spriel 2012-11-14 106 enum brcmf_fweh_event_code code,
> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> Spriel 2012-11-14 107 struct brcmf_event_msg *emsg,
> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
> Spriel 2012-11-14 108 void *data)
> 3e0a97e1 drivers/net/wireless/brcm80211/brcmfmac/fweh.c Arend van
This report is very hard to read as the lines seem to be wrapped.
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH V3] brcmfmac: use bphy_err() in all wiphy-related code
From: Rafał Miłecki @ 2019-02-15 9:47 UTC (permalink / raw)
To: Arend Van Spriel
Cc: Kalle Valo, linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER <brcm80211-dev-list.pdl@broadcom.com>,,
Rafał Miłecki
In-Reply-To: <5cb6383e-2e4c-8586-61a2-3f47de2743dd@broadcom.com>
On Fri, 15 Feb 2019 at 10:40, Arend Van Spriel
<arend.vanspriel@broadcom.com> wrote:
> On 2/15/2019 9:37 AM, Rafał Miłecki wrote:
> > On Fri, 15 Feb 2019 at 07:43, Rafał Miłecki <zajec5@gmail.com> wrote:
> >> From: Rafał Miłecki <rafal@milecki.pl>
> >>
> >> This recently added macro provides more meaningful error messages thanks
> >> to identifying a specific wiphy. It's especially important on systems
> >> with few cards supported by the same (brcmfmac) driver.
> >>
> >> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> >> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> >
> > Arend, let me ask one more question before getting this patch pushed.
> > It's quite late (I spent quite some time on this), but maybe still
> > better than fixing it later.
> >
> > It seems the most common struct that is:
> > 1) Often passed as argument
> > 2) Often having it's own variable in functions
> > 3) Used when calling functions from different file
> > is struct brcmf_pub.
>
> That is true for the function above the bus layer. In sdio/usb/pcie we
> can probably get it, but it is less straight forward. Maybe there we
> just want to use dev_err() as the struct device is short at hand there.
Correct. For the bus level I mean to continue using dev_err() just
like started with the commits:
5cc898fbcb35 ("brcmfmac: modify __brcmf_err() to take bus as a parameter")
8602e62441ab ("brcmfmac: pass bus to the __brcmf_err() in pcie.c")
> > Now I started wondering if we really want to have bphy_err() accept
> > wiphy. Maybe it would match brcmfmac's design better to have
> > bphy_err(struct brcmf_pub, fmt, ...)?
>
> Just might, but you still want to expand that to wiphy_err() right?
Correct!
--
Rafał
^ permalink raw reply
* [PATCH] mac80211: Restore vif beacon interval if start ap fails
From: Rakesh Pillai @ 2019-02-15 8:46 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rakesh Pillai
The starting of AP interface can fail due to invalid
beacon interval, which does not match the minimum gcd
requirement set by the wifi driver. In such case, the
beacon interval of that interface gets updated with
that invalid beacon interval.
The next time that interface is brought up in AP mode,
an interface combination check is performed and the
beacon interval is taken from the previously set value.
In a case where an invalid beacon interval, i.e. a beacon
interval value which does not satisfy the minimum gcd criteria
set by the driver, is set, all the subsequent trials to
bring that interface in AP mode will fail, even if the
subsequent trials have a valid beacon interval.
To avoid this, in case of a failure in bringing up an
interface in AP mode due to interface combination error,
the interface beacon interval which is stored in bss
conf, needs to be restored with the last working value
of beacon interval.
Tested on ath10k using WCN3990.
Fixes: 0c317a02ca98 ("cfg80211: support virtual interfaces with different beacon intervals")
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
---
net/mac80211/cfg.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index d65aa01..09dd1c2 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -941,6 +941,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
BSS_CHANGED_P2P_PS |
BSS_CHANGED_TXPOWER;
int err;
+ int prev_beacon_int;
old = sdata_dereference(sdata->u.ap.beacon, sdata);
if (old)
@@ -963,6 +964,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
sdata->needed_rx_chains = sdata->local->rx_chains;
+ prev_beacon_int = sdata->vif.bss_conf.beacon_int;
sdata->vif.bss_conf.beacon_int = params->beacon_interval;
if (params->he_cap)
@@ -974,8 +976,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
if (!err)
ieee80211_vif_copy_chanctx_to_vlans(sdata, false);
mutex_unlock(&local->mtx);
- if (err)
+ if (err) {
+ sdata->vif.bss_conf.beacon_int = prev_beacon_int;
return err;
+ }
/*
* Apply control port protocol, this allows us to
--
2.7.4
^ permalink raw reply related
* Re: [PATCH V3] brcmfmac: use bphy_err() in all wiphy-related code
From: Rafał Miłecki @ 2019-02-15 8:37 UTC (permalink / raw)
To: Kalle Valo
Cc: Arend van Spriel, linux-wireless@vger.kernel.org,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER,
open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER <brcm80211-dev-list.pdl@broadcom.com>,,
Rafał Miłecki
In-Reply-To: <20190215064345.11946-1-zajec5@gmail.com>
On Fri, 15 Feb 2019 at 07:43, Rafał Miłecki <zajec5@gmail.com> wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
>
> This recently added macro provides more meaningful error messages thanks
> to identifying a specific wiphy. It's especially important on systems
> with few cards supported by the same (brcmfmac) driver.
>
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Arend, let me ask one more question before getting this patch pushed.
It's quite late (I spent quite some time on this), but maybe still
better than fixing it later.
It seems the most common struct that is:
1) Often passed as argument
2) Often having it's own variable in functions
3) Used when calling functions from different file
is struct brcmf_pub.
Now I started wondering if we really want to have bphy_err() accept
wiphy. Maybe it would match brcmfmac's design better to have
bphy_err(struct brcmf_pub, fmt, ...)?
^ permalink raw reply
* [PATCH] ath10k: Enhance logging for vdev pdev & peer set param
From: Rakesh Pillai @ 2019-02-15 7:48 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rakesh Pillai
Currently after enabling the WMI debug logging,
there is no detail printed about the param id
and the param value for the pdev, vdev and
peer params which are set.
Enhance the WMI logging to print the param id
and the param value for pdev, vdev and peer set
param wmi commands.
Tested HW: WCN3990
Tested FW: WLAN.HL.2.0-01387-QCAHLSWMTPLZ-1
WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
---
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 90617e1..98d8992 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -1576,7 +1576,8 @@ ath10k_wmi_tlv_op_gen_pdev_set_param(struct ath10k *ar, u32 param_id,
cmd->param_id = __cpu_to_le32(param_id);
cmd->param_value = __cpu_to_le32(param_value);
- ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv pdev set param\n");
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv pdev set param %d value 0x%x\n",
+ param_id, param_value);
return skb;
}
@@ -2046,7 +2047,8 @@ ath10k_wmi_tlv_op_gen_vdev_set_param(struct ath10k *ar, u32 vdev_id,
cmd->param_id = __cpu_to_le32(param_id);
cmd->param_value = __cpu_to_le32(param_value);
- ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv vdev set param\n");
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv vdev %d set param %d value 0x%x\n",
+ vdev_id, param_id, param_value);
return skb;
}
@@ -2360,7 +2362,9 @@ ath10k_wmi_tlv_op_gen_peer_set_param(struct ath10k *ar, u32 vdev_id,
cmd->param_value = __cpu_to_le32(param_value);
ether_addr_copy(cmd->peer_macaddr.addr, peer_addr);
- ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv peer set param\n");
+ ath10k_dbg(ar, ATH10K_DBG_WMI,
+ "wmi tlv vdev %d peer %pM set param %d value 0x%x\n",
+ vdev_id, peer_addr, param_id, param_value);
return skb;
}
--
2.7.4
^ permalink raw reply related
* [PATCH] ath10k: wait for vdev delete response from firmware
From: Rakesh Pillai @ 2019-02-15 7:45 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Rakesh Pillai
When we add an interface immediately after removing
the interface the vdev deletion in firmware might not
have been completed. We need to synchronize the vdev creation
with the firmware.
Wait for vdev delete response from firmware when we
remove an interface.
Tested HW: WCN3990
Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
---
drivers/net/wireless/ath/ath10k/core.c | 4 +++-
drivers/net/wireless/ath/ath10k/core.h | 6 ++++--
drivers/net/wireless/ath/ath10k/mac.c | 14 ++++++++++++++
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 12 +++++++++++-
drivers/net/wireless/ath/ath10k/wmi-tlv.h | 6 +++++-
drivers/net/wireless/ath/ath10k/wmi.h | 4 +++-
6 files changed, 40 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 327a74c0..16d2d04 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2005-2011 Atheros Communications Inc.
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -2137,6 +2137,7 @@ static void ath10k_core_restart(struct work_struct *work)
complete(&ar->offchan_tx_completed);
complete(&ar->install_key_done);
complete(&ar->vdev_setup_done);
+ complete(&ar->vdev_delete_done);
complete(&ar->thermal.wmi_sync);
complete(&ar->bss_survey_done);
wake_up(&ar->htt.empty_tx_wq);
@@ -3093,6 +3094,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev,
init_completion(&ar->install_key_done);
init_completion(&ar->vdev_setup_done);
+ init_completion(&ar->vdev_delete_done);
init_completion(&ar->thermal.wmi_sync);
init_completion(&ar->bss_survey_done);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 46e9c8c..ad1da95 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2005-2011 Atheros Communications Inc.
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -511,7 +511,8 @@ struct ath10k_sta {
u32 peer_ps_state;
};
-#define ATH10K_VDEV_SETUP_TIMEOUT_HZ (5 * HZ)
+#define ATH10K_VDEV_SETUP_TIMEOUT_HZ (5 * HZ)
+#define ATH10K_VDEV_DELETE_TIMEOUT_HZ (5 * HZ)
enum ath10k_beacon_state {
ATH10K_BEACON_SCHEDULED = 0,
@@ -1058,6 +1059,7 @@ struct ath10k {
int last_wmi_vdev_start_status;
struct completion vdev_setup_done;
+ struct completion vdev_delete_done;
struct workqueue_struct *workqueue;
/* Auxiliary workqueue */
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 4dd64f3..c4cdd6e 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1022,6 +1022,7 @@ static int ath10k_monitor_vdev_start(struct ath10k *ar, int vdev_id)
arg.channel.max_antenna_gain = channel->max_antenna_gain * 2;
reinit_completion(&ar->vdev_setup_done);
+ reinit_completion(&ar->vdev_delete_done);
ret = ath10k_wmi_vdev_start(ar, &arg);
if (ret) {
@@ -1071,6 +1072,7 @@ static int ath10k_monitor_vdev_stop(struct ath10k *ar)
ar->monitor_vdev_id, ret);
reinit_completion(&ar->vdev_setup_done);
+ reinit_completion(&ar->vdev_delete_done);
ret = ath10k_wmi_vdev_stop(ar, ar->monitor_vdev_id);
if (ret)
@@ -1412,6 +1414,7 @@ static int ath10k_vdev_stop(struct ath10k_vif *arvif)
lockdep_assert_held(&ar->conf_mutex);
reinit_completion(&ar->vdev_setup_done);
+ reinit_completion(&ar->vdev_delete_done);
ret = ath10k_wmi_vdev_stop(ar, arvif->vdev_id);
if (ret) {
@@ -1448,6 +1451,7 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif,
lockdep_assert_held(&ar->conf_mutex);
reinit_completion(&ar->vdev_setup_done);
+ reinit_completion(&ar->vdev_delete_done);
arg.vdev_id = arvif->vdev_id;
arg.dtim_period = arvif->dtim_period;
@@ -5397,6 +5401,7 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw,
struct ath10k *ar = hw->priv;
struct ath10k_vif *arvif = (void *)vif->drv_priv;
struct ath10k_peer *peer;
+ unsigned long time_left;
int ret;
int i;
@@ -5438,6 +5443,15 @@ static void ath10k_remove_interface(struct ieee80211_hw *hw,
ath10k_warn(ar, "failed to delete WMI vdev %i: %d\n",
arvif->vdev_id, ret);
+ if (test_bit(WMI_SERVICE_SYNC_DELETE_CMDS, ar->wmi.svc_map)) {
+ time_left = wait_for_completion_timeout(&ar->vdev_delete_done,
+ ATH10K_VDEV_DELETE_TIMEOUT_HZ);
+ if (time_left == 0) {
+ ath10k_warn(ar, "Timeout in receiving vdev delete response\n");
+ return;
+ }
+ }
+
/* Some firmware revisions don't notify host about self-peer removal
* until after associated vdev is deleted.
*/
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 90617e1..642d770 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2005-2011 Atheros Communications Inc.
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -222,6 +222,13 @@ static int ath10k_wmi_tlv_event_bcn_tx_status(struct ath10k *ar,
return 0;
}
+static void ath10k_wmi_tlv_event_vdev_delete_resp(struct ath10k *ar,
+ struct sk_buff *skb)
+{
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_VDEV_DELETE_RESP_EVENTID\n");
+ complete(&ar->vdev_delete_done);
+}
+
static int ath10k_wmi_tlv_event_diag_data(struct ath10k *ar,
struct sk_buff *skb)
{
@@ -524,6 +531,9 @@ static void ath10k_wmi_tlv_op_rx(struct ath10k *ar, struct sk_buff *skb)
case WMI_TLV_VDEV_STOPPED_EVENTID:
ath10k_wmi_event_vdev_stopped(ar, skb);
break;
+ case WMI_TLV_VDEV_DELETE_RESP_EVENTID:
+ ath10k_wmi_tlv_event_vdev_delete_resp(ar, skb);
+ break;
case WMI_TLV_PEER_STA_KICKOUT_EVENTID:
ath10k_wmi_event_peer_sta_kickout(ar, skb);
break;
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index 298d917..872da8e 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2005-2011 Atheros Communications Inc.
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -310,6 +310,8 @@ enum wmi_tlv_event_id {
WMI_TLV_VDEV_STOPPED_EVENTID,
WMI_TLV_VDEV_INSTALL_KEY_COMPLETE_EVENTID,
WMI_TLV_VDEV_MCC_BCN_INTERVAL_CHANGE_REQ_EVENTID,
+ WMI_TLV_VDEV_TSF_REPORT_EVENTID,
+ WMI_TLV_VDEV_DELETE_RESP_EVENTID,
WMI_TLV_PEER_STA_KICKOUT_EVENTID = WMI_TLV_EV(WMI_TLV_GRP_PEER),
WMI_TLV_PEER_INFO_EVENTID,
WMI_TLV_PEER_TX_FAIL_CNT_THR_EVENTID,
@@ -1557,6 +1559,8 @@ wmi_tlv_svc_map(const __le32 *in, unsigned long *out, size_t len)
WMI_SERVICE_SAP_AUTH_OFFLOAD, len);
SVCMAP(WMI_TLV_SERVICE_MGMT_TX_WMI,
WMI_SERVICE_MGMT_TX_WMI, len);
+ SVCMAP(WMI_TLV_SERVICE_SYNC_DELETE_CMDS,
+ WMI_SERVICE_SYNC_DELETE_CMDS, len);
}
static inline void
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 1f82f10..b941240 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2005-2011 Atheros Communications Inc.
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
- * Copyright (c) 2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -208,6 +208,7 @@ enum wmi_service {
WMI_SERVICE_VDEV_DISABLE_4_ADDR_SRC_LRN_SUPPORT,
WMI_SERVICE_BB_TIMING_CONFIG_SUPPORT,
WMI_SERVICE_THERM_THROT,
+ WMI_SERVICE_SYNC_DELETE_CMDS,
/* keep last */
WMI_SERVICE_MAX,
@@ -483,6 +484,7 @@ static inline char *wmi_service_name(int service_id)
SVCSTR(WMI_SERVICE_RESET_CHIP);
SVCSTR(WMI_SERVICE_TX_DATA_ACK_RSSI);
SVCSTR(WMI_SERVICE_VDEV_DIFFERENT_BEACON_INTERVAL_SUPPORT);
+ SVCSTR(WMI_SERVICE_SYNC_DELETE_CMDS);
default:
return NULL;
}
--
2.7.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox