Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2 06/10] rt2x00: fixup fill_tx_status for nomatch case
From: Stanislaw Gruszka @ 2017-02-15  9:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Helmut Schaa, Felix Fietkau
In-Reply-To: <1487150713-3510-1-git-send-email-sgruszka@redhat.com>

Add bits rt2x00lib_fill_tx_status() when filling status in nomatch
case and hopefully do not break the function for existing cases.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c   | 6 +++++-
 drivers/net/wireless/ralink/rt2x00/rt2x00queue.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
index 90fc259..e95d2aa 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
@@ -357,6 +357,9 @@ static void rt2x00lib_fill_tx_status(struct rt2x00_dev *rt2x00dev,
 	if (i < (IEEE80211_TX_MAX_RATES - 1))
 		tx_info->status.rates[i].idx = -1; /* terminate */
 
+	if (test_bit(TXDONE_NO_ACK_REQ, &txdesc->flags))
+		tx_info->flags |= IEEE80211_TX_CTL_NO_ACK;
+
 	if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) {
 		if (success)
 			tx_info->flags |= IEEE80211_TX_STAT_ACK;
@@ -375,7 +378,8 @@ static void rt2x00lib_fill_tx_status(struct rt2x00_dev *rt2x00dev,
 	 */
 	if (test_bit(TXDONE_AMPDU, &txdesc->flags) ||
 	    tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
-		tx_info->flags |= IEEE80211_TX_STAT_AMPDU;
+		tx_info->flags |= IEEE80211_TX_STAT_AMPDU |
+				  IEEE80211_TX_CTL_AMPDU;
 		tx_info->status.ampdu_len = 1;
 		tx_info->status.ampdu_ack_len = success ? 1 : 0;
 
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
index 9b297fc..c78fb8c 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
@@ -215,6 +215,7 @@ enum txdone_entry_desc_flags {
 	TXDONE_FAILURE,
 	TXDONE_EXCESSIVE_RETRY,
 	TXDONE_AMPDU,
+	TXDONE_NO_ACK_REQ,
 };
 
 /**
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH v2 05/10] rt2x00: add txdone nomatch function
From: Stanislaw Gruszka @ 2017-02-15  9:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Helmut Schaa, Felix Fietkau
In-Reply-To: <1487150713-3510-1-git-send-email-sgruszka@redhat.com>

This txdone nomatch function will be used when we get status from the HW,
but we could not match it with any sent skb.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2x00.h    |  2 ++
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 50 ++++++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
index 26869b3..efd6914 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
@@ -1425,6 +1425,8 @@ u32 rt2x00lib_get_bssidx(struct rt2x00_dev *rt2x00dev,
 void rt2x00lib_dmadone(struct queue_entry *entry);
 void rt2x00lib_txdone(struct queue_entry *entry,
 		      struct txdone_entry_desc *txdesc);
+void rt2x00lib_txdone_nomatch(struct queue_entry *entry,
+			      struct txdone_entry_desc *txdesc);
 void rt2x00lib_txdone_noinfo(struct queue_entry *entry, u32 status);
 void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp);
 
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
index 03b368a..90fc259 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
@@ -417,6 +417,56 @@ static void rt2x00lib_clear_entry(struct rt2x00_dev *rt2x00dev,
 	spin_unlock_bh(&entry->queue->tx_lock);
 }
 
+void rt2x00lib_txdone_nomatch(struct queue_entry *entry,
+			      struct txdone_entry_desc *txdesc)
+{
+	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
+	struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
+	struct ieee80211_tx_info txinfo = {};
+	bool success;
+
+	/*
+	 * Unmap the skb.
+	 */
+	rt2x00queue_unmap_skb(entry);
+
+	/*
+	 * Signal that the TX descriptor is no longer in the skb.
+	 */
+	skbdesc->flags &= ~SKBDESC_DESC_IN_SKB;
+
+	/*
+	 * Send frame to debugfs immediately, after this call is completed
+	 * we are going to overwrite the skb->cb array.
+	 */
+	rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry);
+
+	/*
+	 * Determine if the frame has been successfully transmitted and
+	 * remove BARs from our check list while checking for their
+	 * TX status.
+	 */
+	success =
+	    rt2x00lib_txdone_bar_status(entry) ||
+	    test_bit(TXDONE_SUCCESS, &txdesc->flags);
+
+	if (!test_bit(TXDONE_UNKNOWN, &txdesc->flags)) {
+		/*
+		 * Update TX statistics.
+		 */
+		rt2x00dev->link.qual.tx_success += success;
+		rt2x00dev->link.qual.tx_failed += !success;
+
+		rt2x00lib_fill_tx_status(rt2x00dev, &txinfo, skbdesc, txdesc,
+					 success);
+		ieee80211_tx_status_noskb(rt2x00dev->hw, skbdesc->sta, &txinfo);
+	}
+
+	dev_kfree_skb_any(entry->skb);
+	rt2x00lib_clear_entry(rt2x00dev, entry);
+}
+EXPORT_SYMBOL_GPL(rt2x00lib_txdone_nomatch);
+
 void rt2x00lib_txdone(struct queue_entry *entry,
 		      struct txdone_entry_desc *txdesc)
 {
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH v2 04/10] rt2x00: separte clearing entry from rt2x00lib_txdone
From: Stanislaw Gruszka @ 2017-02-15  9:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Helmut Schaa, Felix Fietkau
In-Reply-To: <1487150713-3510-1-git-send-email-sgruszka@redhat.com>

This makes rt2x00lib_txdone a bit simpler and will allow to reuse
code in different variant of txdone which I'm preparing.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 51 +++++++++++++++-----------
 1 file changed, 29 insertions(+), 22 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
index b5d90fe..03b368a 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
@@ -391,6 +391,32 @@ static void rt2x00lib_fill_tx_status(struct rt2x00_dev *rt2x00dev,
 	}
 }
 
+static void rt2x00lib_clear_entry(struct rt2x00_dev *rt2x00dev,
+				  struct queue_entry *entry)
+{
+	/*
+	 * Make this entry available for reuse.
+	 */
+	entry->skb = NULL;
+	entry->flags = 0;
+
+	rt2x00dev->ops->lib->clear_entry(entry);
+
+	rt2x00queue_index_inc(entry, Q_INDEX_DONE);
+
+	/*
+	 * If the data queue was below the threshold before the txdone
+	 * handler we must make sure the packet queue in the mac80211 stack
+	 * is reenabled when the txdone handler has finished. This has to be
+	 * serialized with rt2x00mac_tx(), otherwise we can wake up queue
+	 * before it was stopped.
+	 */
+	spin_lock_bh(&entry->queue->tx_lock);
+	if (!rt2x00queue_threshold(entry->queue))
+		rt2x00queue_unpause_queue(entry->queue);
+	spin_unlock_bh(&entry->queue->tx_lock);
+}
+
 void rt2x00lib_txdone(struct queue_entry *entry,
 		      struct txdone_entry_desc *txdesc)
 {
@@ -471,30 +497,11 @@ void rt2x00lib_txdone(struct queue_entry *entry,
 			ieee80211_tx_status(rt2x00dev->hw, entry->skb);
 		else
 			ieee80211_tx_status_ni(rt2x00dev->hw, entry->skb);
-	} else
+	} else {
 		dev_kfree_skb_any(entry->skb);
+	}
 
-	/*
-	 * Make this entry available for reuse.
-	 */
-	entry->skb = NULL;
-	entry->flags = 0;
-
-	rt2x00dev->ops->lib->clear_entry(entry);
-
-	rt2x00queue_index_inc(entry, Q_INDEX_DONE);
-
-	/*
-	 * If the data queue was below the threshold before the txdone
-	 * handler we must make sure the packet queue in the mac80211 stack
-	 * is reenabled when the txdone handler has finished. This has to be
-	 * serialized with rt2x00mac_tx(), otherwise we can wake up queue
-	 * before it was stopped.
-	 */
-	spin_lock_bh(&entry->queue->tx_lock);
-	if (!rt2x00queue_threshold(entry->queue))
-		rt2x00queue_unpause_queue(entry->queue);
-	spin_unlock_bh(&entry->queue->tx_lock);
+	rt2x00lib_clear_entry(rt2x00dev, entry);
 }
 EXPORT_SYMBOL_GPL(rt2x00lib_txdone);
 
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH v2 03/10] rt2x00: separte filling tx status from rt2x00lib_txdone
From: Stanislaw Gruszka @ 2017-02-15  9:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Helmut Schaa, Felix Fietkau
In-Reply-To: <1487150713-3510-1-git-send-email-sgruszka@redhat.com>

This makes rt2x00lib_txdone a bit simpler and will allow to reuse code
in different variant of txdone which I'm preparing.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 141 +++++++++++++------------
 1 file changed, 76 insertions(+), 65 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
index dd66781..b5d90fe 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
@@ -313,73 +313,14 @@ static inline int rt2x00lib_txdone_bar_status(struct queue_entry *entry)
 	return ret;
 }
 
-void rt2x00lib_txdone(struct queue_entry *entry,
-		      struct txdone_entry_desc *txdesc)
+static void rt2x00lib_fill_tx_status(struct rt2x00_dev *rt2x00dev,
+				     struct ieee80211_tx_info *tx_info,
+				     struct skb_frame_desc *skbdesc,
+				     struct txdone_entry_desc *txdesc,
+				     bool success)
 {
-	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
-	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
-	struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
-	unsigned int header_length, i;
 	u8 rate_idx, rate_flags, retry_rates;
-	u8 skbdesc_flags = skbdesc->flags;
-	bool success;
-
-	/*
-	 * Unmap the skb.
-	 */
-	rt2x00queue_unmap_skb(entry);
-
-	/*
-	 * Remove the extra tx headroom from the skb.
-	 */
-	skb_pull(entry->skb, rt2x00dev->extra_tx_headroom);
-
-	/*
-	 * Signal that the TX descriptor is no longer in the skb.
-	 */
-	skbdesc->flags &= ~SKBDESC_DESC_IN_SKB;
-
-	/*
-	 * Determine the length of 802.11 header.
-	 */
-	header_length = ieee80211_get_hdrlen_from_skb(entry->skb);
-
-	/*
-	 * Remove L2 padding which was added during
-	 */
-	if (rt2x00_has_cap_flag(rt2x00dev, REQUIRE_L2PAD))
-		rt2x00queue_remove_l2pad(entry->skb, header_length);
-
-	/*
-	 * If the IV/EIV data was stripped from the frame before it was
-	 * passed to the hardware, we should now reinsert it again because
-	 * mac80211 will expect the same data to be present it the
-	 * frame as it was passed to us.
-	 */
-	if (rt2x00_has_cap_hw_crypto(rt2x00dev))
-		rt2x00crypto_tx_insert_iv(entry->skb, header_length);
-
-	/*
-	 * Send frame to debugfs immediately, after this call is completed
-	 * we are going to overwrite the skb->cb array.
-	 */
-	rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry);
-
-	/*
-	 * Determine if the frame has been successfully transmitted and
-	 * remove BARs from our check list while checking for their
-	 * TX status.
-	 */
-	success =
-	    rt2x00lib_txdone_bar_status(entry) ||
-	    test_bit(TXDONE_SUCCESS, &txdesc->flags) ||
-	    test_bit(TXDONE_UNKNOWN, &txdesc->flags);
-
-	/*
-	 * Update TX statistics.
-	 */
-	rt2x00dev->link.qual.tx_success += success;
-	rt2x00dev->link.qual.tx_failed += !success;
+	int i;
 
 	rate_idx = skbdesc->tx_rate_idx;
 	rate_flags = skbdesc->tx_rate_flags;
@@ -448,6 +389,76 @@ void rt2x00lib_txdone(struct queue_entry *entry,
 		else
 			rt2x00dev->low_level_stats.dot11RTSFailureCount++;
 	}
+}
+
+void rt2x00lib_txdone(struct queue_entry *entry,
+		      struct txdone_entry_desc *txdesc)
+{
+	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
+	struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
+	struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
+	u8 skbdesc_flags = skbdesc->flags;
+	unsigned int header_length;
+	bool success;
+
+	/*
+	 * Unmap the skb.
+	 */
+	rt2x00queue_unmap_skb(entry);
+
+	/*
+	 * Remove the extra tx headroom from the skb.
+	 */
+	skb_pull(entry->skb, rt2x00dev->extra_tx_headroom);
+
+	/*
+	 * Signal that the TX descriptor is no longer in the skb.
+	 */
+	skbdesc->flags &= ~SKBDESC_DESC_IN_SKB;
+
+	/*
+	 * Determine the length of 802.11 header.
+	 */
+	header_length = ieee80211_get_hdrlen_from_skb(entry->skb);
+
+	/*
+	 * Remove L2 padding which was added during
+	 */
+	if (rt2x00_has_cap_flag(rt2x00dev, REQUIRE_L2PAD))
+		rt2x00queue_remove_l2pad(entry->skb, header_length);
+
+	/*
+	 * If the IV/EIV data was stripped from the frame before it was
+	 * passed to the hardware, we should now reinsert it again because
+	 * mac80211 will expect the same data to be present it the
+	 * frame as it was passed to us.
+	 */
+	if (rt2x00_has_cap_hw_crypto(rt2x00dev))
+		rt2x00crypto_tx_insert_iv(entry->skb, header_length);
+
+	/*
+	 * Send frame to debugfs immediately, after this call is completed
+	 * we are going to overwrite the skb->cb array.
+	 */
+	rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TXDONE, entry);
+
+	/*
+	 * Determine if the frame has been successfully transmitted and
+	 * remove BARs from our check list while checking for their
+	 * TX status.
+	 */
+	success =
+	    rt2x00lib_txdone_bar_status(entry) ||
+	    test_bit(TXDONE_SUCCESS, &txdesc->flags) ||
+	    test_bit(TXDONE_UNKNOWN, &txdesc->flags);
+
+	/*
+	 * Update TX statistics.
+	 */
+	rt2x00dev->link.qual.tx_success += success;
+	rt2x00dev->link.qual.tx_failed += !success;
+
+	rt2x00lib_fill_tx_status(rt2x00dev, tx_info, skbdesc, txdesc, success);
 
 	/*
 	 * Only send the status report to mac80211 when it's a frame
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH v2 02/10] rt2800: identify station based on status WCID
From: Stanislaw Gruszka @ 2017-02-15  9:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Helmut Schaa, Felix Fietkau
In-Reply-To: <1487150713-3510-1-git-send-email-sgruszka@redhat.com>

Add framework to identify sta based on tx status WCID. This is currently
not used, will start be utilized in the future patch.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c   | 5 +++++
 drivers/net/wireless/ralink/rt2x00/rt2800lib.h   | 1 +
 drivers/net/wireless/ralink/rt2x00/rt2x00queue.h | 3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 8223a15..46405cc 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -855,11 +855,13 @@ void rt2800_process_rxwi(struct queue_entry *entry,
 void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi)
 {
 	struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
+	struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
 	struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb);
 	struct txdone_entry_desc txdesc;
 	u32 word;
 	u16 mcs, real_mcs;
 	int aggr, ampdu;
+	int wcid;
 
 	/*
 	 * Obtain the status about this packet.
@@ -872,6 +874,7 @@ void rt2800_txdone_entry(struct queue_entry *entry, u32 status, __le32 *txwi)
 
 	real_mcs = rt2x00_get_field32(status, TX_STA_FIFO_MCS);
 	aggr = rt2x00_get_field32(status, TX_STA_FIFO_TX_AGGRE);
+	wcid = rt2x00_get_field32(status, TX_STA_FIFO_WCID);
 
 	/*
 	 * If a frame was meant to be sent as a single non-aggregated MPDU
@@ -1468,6 +1471,7 @@ int rt2800_sta_add(struct rt2x00_dev *rt2x00dev, struct ieee80211_vif *vif,
 		return 0;
 
 	__set_bit(wcid - WCID_START, drv_data->sta_ids);
+	drv_data->wcid_to_sta[wcid - WCID_START] = sta;
 
 	/*
 	 * Clean up WCID attributes and write STA address to the device.
@@ -1498,6 +1502,7 @@ int rt2800_sta_remove(struct rt2x00_dev *rt2x00dev, struct ieee80211_sta *sta)
 	 * get renewed when the WCID is reused.
 	 */
 	rt2800_config_wcid(rt2x00dev, NULL, wcid);
+	drv_data->wcid_to_sta[wcid - WCID_START] = NULL;
 	__clear_bit(wcid - WCID_START, drv_data->sta_ids);
 
 	return 0;
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
index 8e1ae13..6811d67 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
@@ -41,6 +41,7 @@ struct rt2800_drv_data {
 	unsigned int tbtt_tick;
 	unsigned int ampdu_factor_cnt[4];
 	DECLARE_BITMAP(sta_ids, STA_IDS_SIZE);
+	struct ieee80211_sta *wcid_to_sta[STA_IDS_SIZE];
 };
 
 struct rt2800_ops {
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
index 22d1881..9b297fc 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00queue.h
@@ -102,7 +102,7 @@ enum skb_frame_desc_flags {
  *	of the scope of the skb->data pointer.
  * @iv: IV/EIV data used during encryption/decryption.
  * @skb_dma: (PCI-only) the DMA address associated with the sk buffer.
- * @entry: The entry to which this sk buffer belongs.
+ * @sta: The station where sk buffer was sent.
  */
 struct skb_frame_desc {
 	u8 flags;
@@ -116,6 +116,7 @@ struct skb_frame_desc {
 	__le32 iv[2];
 
 	dma_addr_t skb_dma;
+	struct ieee80211_sta *sta;
 };
 
 /**
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH v2 01/10] rt2x00: rt2800lib: move rt2800_drv_data declaration into rt2800lib.h
From: Stanislaw Gruszka @ 2017-02-15  9:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Helmut Schaa, Felix Fietkau, Gabor Juhos, Daniel Golle
In-Reply-To: <1487150713-3510-1-git-send-email-sgruszka@redhat.com>

From: Gabor Juhos <juhosg@openwrt.org>

The rt2800_drv_data structure contains driver specific
information. Move the declaration into the rt2800lib.h
header which is a more logical place for it. Also fix
the comment style to avoid checkpatch warning.

The patch contains no functional changes, it is in
preparation for the next patch.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800.h    | 25 -------------------------
 drivers/net/wireless/ralink/rt2x00/rt2800lib.h | 23 +++++++++++++++++++++++
 2 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800.h b/drivers/net/wireless/ralink/rt2x00/rt2800.h
index 256496b..0e7051d 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800.h
@@ -2987,29 +2987,4 @@ enum rt2800_eeprom_word {
  */
 #define BCN_TBTT_OFFSET 64
 
-/*
- * Hardware has 255 WCID table entries. First 32 entries are reserved for
- * shared keys. Since parts of the pairwise key table might be shared with
- * the beacon frame buffers 6 & 7 we could only use the first 222 entries.
- */
-#define WCID_START	33
-#define WCID_END	222
-#define STA_IDS_SIZE	(WCID_END - WCID_START + 2)
-
-/*
- * RT2800 driver data structure
- */
-struct rt2800_drv_data {
-	u8 calibration_bw20;
-	u8 calibration_bw40;
-	u8 bbp25;
-	u8 bbp26;
-	u8 txmixer_gain_24g;
-	u8 txmixer_gain_5g;
-	u8 max_psdu;
-	unsigned int tbtt_tick;
-	unsigned int ampdu_factor_cnt[4];
-	DECLARE_BITMAP(sta_ids, STA_IDS_SIZE);
-};
-
 #endif /* RT2800_H */
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
index 0a8b4df..8e1ae13 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
@@ -20,6 +20,29 @@
 #ifndef RT2800LIB_H
 #define RT2800LIB_H
 
+/*
+ * Hardware has 255 WCID table entries. First 32 entries are reserved for
+ * shared keys. Since parts of the pairwise key table might be shared with
+ * the beacon frame buffers 6 & 7 we could only use the first 222 entries.
+ */
+#define WCID_START	33
+#define WCID_END	222
+#define STA_IDS_SIZE	(WCID_END - WCID_START + 2)
+
+/* RT2800 driver data structure */
+struct rt2800_drv_data {
+	u8 calibration_bw20;
+	u8 calibration_bw40;
+	u8 bbp25;
+	u8 bbp26;
+	u8 txmixer_gain_24g;
+	u8 txmixer_gain_5g;
+	u8 max_psdu;
+	unsigned int tbtt_tick;
+	unsigned int ampdu_factor_cnt[4];
+	DECLARE_BITMAP(sta_ids, STA_IDS_SIZE);
+};
+
 struct rt2800_ops {
 	void (*register_read)(struct rt2x00_dev *rt2x00dev,
 			      const unsigned int offset, u32 *value);
-- 
1.8.3.1

^ permalink raw reply related

* [PATCH v2 00/10] rt2x00 patches 14.02.2017
From: Stanislaw Gruszka @ 2017-02-15  9:25 UTC (permalink / raw)
  To: linux-wireless; +Cc: Helmut Schaa, Felix Fietkau

Patches for rt2x00. Most important is txdone functions rework to use
ieee80211_tx_status_noskb() if can not match sent skb with status
from TX_STAT_FIFO. Currently used only for rt2800usb.

v1 -> v2:
Fix skbdesc->sta and TXDONE_ACK_REQ issues pointed by Felix.
Add changelog to patch 6, pointed by Kalle.

Gabor Juhos (1):
  rt2x00: rt2800lib: move rt2800_drv_data declaration into rt2800lib.h

Stanislaw Gruszka (9):
  rt2800: identify station based on status WCID
  rt2x00: separte filling tx status from rt2x00lib_txdone
  rt2x00: separte clearing entry from rt2x00lib_txdone
  rt2x00: add txdone nomatch function
  rt2x00: fixup fill_tx_status for nomatch case
  rt2x00: use txdone_nomatch on rt2800usb
  rt2800: status based rate flags for nomatch case
  rt2800: use TXOP_BACKOFF for probe frames
  rt2x00: fix rt2x00debug_dump_frame comment

 drivers/net/wireless/ralink/rt2x00/rt2800.h      |  27 +--
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c   |  67 ++++++-
 drivers/net/wireless/ralink/rt2x00/rt2800lib.h   |  27 ++-
 drivers/net/wireless/ralink/rt2x00/rt2800mmio.c  |   2 +-
 drivers/net/wireless/ralink/rt2x00/rt2800usb.c   |  18 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00.h      |   4 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c   | 232 +++++++++++++++--------
 drivers/net/wireless/ralink/rt2x00/rt2x00queue.c |   7 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00queue.h |   4 +-
 9 files changed, 260 insertions(+), 128 deletions(-)

-- 
1.8.3.1

^ permalink raw reply

* [PATCH v2 00/10] rt2x00 patches 14.02.2017
From: Stanislaw Gruszka @ 2017-02-15  9:24 UTC (permalink / raw)
  To: linux-wireless; +Cc: Helmut Schaa, Felix Fietkau

Patches for rt2x00. Most important is txdone functions rework to use
ieee80211_tx_status_noskb() if can not match sent skb with status
from TX_STAT_FIFO. Currently used only for rt2800usb.

v1 -> v2:
Fix skbdesc->sta and TXDONE_ACK_REQ issues pointed by Felix.
Add changelog to patch 6, pointed by Kalle.

Gabor Juhos (1):
  rt2x00: rt2800lib: move rt2800_drv_data declaration into rt2800lib.h

Stanislaw Gruszka (9):
  rt2800: identify station based on status WCID
  rt2x00: separte filling tx status from rt2x00lib_txdone
  rt2x00: separte clearing entry from rt2x00lib_txdone
  rt2x00: add txdone nomatch function
  rt2x00: fixup fill_tx_status for nomatch case
  rt2x00: use txdone_nomatch on rt2800usb
  rt2800: status based rate flags for nomatch case
  rt2800: use TXOP_BACKOFF for probe frames
  rt2x00: fix rt2x00debug_dump_frame comment

 drivers/net/wireless/ralink/rt2x00/rt2800.h      |  27 +--
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c   |  67 ++++++-
 drivers/net/wireless/ralink/rt2x00/rt2800lib.h   |  27 ++-
 drivers/net/wireless/ralink/rt2x00/rt2800mmio.c  |   2 +-
 drivers/net/wireless/ralink/rt2x00/rt2800usb.c   |  18 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00.h      |   4 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c   | 232 +++++++++++++++--------
 drivers/net/wireless/ralink/rt2x00/rt2x00queue.c |   7 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00queue.h |   4 +-
 9 files changed, 260 insertions(+), 128 deletions(-)

-- 
1.8.3.1

^ permalink raw reply

* Re: ath10k: Configure rxnss_override for 10.4 firmware.
From: Kalle Valo @ 2017-02-15  9:26 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless, Ben Greear, ath10k
In-Reply-To: <1486771745-15150-1-git-send-email-greearb@candelatech.com>

Ben Greear <greearb@candelatech.com> wrote:
> From: Ben Greear <greearb@candelatech.com>
> 
> QCA9984 hardware can do 4x4 at 80Mhz, but only 2x2 at 160Mhz.
> 
> First, report this to user-space by setting the max-tx-speed
> and max-rx-speed vht capabilities.
> 
> Second, if the peer rx-speed is configured, and if we
> are in 160 or 80+80 mode, and the peer rx-speed matches
> the max speed for 2x2 or 1x1 at 160Mhz (long guard interval),
> then use that info to set the peer_bw_rxnss_override appropriately.
> 
> Without this, a 9984 firmware will not use 2x2 ratesets when
> transmitting to peer (it will be stuck at 1x1), because
> the firmware would not have configured the rxnss_override.
> 
> This could use some testing....
> 
> Signed-off-by: Ben Greear <greearb@candelatech.com>

Does not apply:

error: patch failed: drivers/net/wireless/ath/ath10k/mac.c:2760
error: drivers/net/wireless/ath/ath10k/mac.c: patch does not apply
error: patch failed: drivers/net/wireless/ath/ath10k/wmi.h:6173
error: drivers/net/wireless/ath/ath10k/wmi.h: patch does not apply
stg import: Diff does not apply cleanly

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/patch/9567655/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: ath9k: use correct OTP register offsets for the AR9340 and AR9550
From: Kalle Valo @ 2017-02-15  9:22 UTC (permalink / raw)
  To: Christian Lamparter
  Cc: linux-wireless, Kalle Valo, QCA ath9k Development, Chris Blake,
	Gabor Juhos, stable
In-Reply-To: <20170214191030.31070-1-chunkeey@googlemail.com>

Christian Lamparter <chunkeey@googlemail.com> wrote:
> This patch fixes the OTP register definitions for the AR934x and AR9550
> WMAC SoC.
> 
> Previously, the ath9k driver was unable to initialize the integrated
> WMAC on an Aerohive AP121:
> 
> | ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
> | ath: phy0: timeout (1000 us) on reg 0x30018: 0xbadc0ffe & 0x00000007 != 0x00000004
> | ath: phy0: Unable to initialize hardware; initialization status: -5
> | ath9k ar934x_wmac: failed to initialize device
> | ath9k: probe of ar934x_wmac failed with error -5
> 
> It turns out that the AR9300_OTP_STATUS and AR9300_OTP_DATA
> definitions contain a typo.
> 
> Cc: Gabor Juhos <juhosg@openwrt.org>
> Cc: stable@vger.kernel.org
> Fixes: add295a4afbdf5852d0 "ath9k: use correct OTP register offsets for AR9550"
> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
> Signed-off-by: Chris Blake <chrisrblake93@gmail.com>

Patch applied to ath-next branch of ath.git, thanks.

c9f1e3260081 ath9k: use correct OTP register offsets for the AR9340 and AR9550

-- 
https://patchwork.kernel.org/patch/9572541/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [RFC v2 3/7] ieee80211: add new VHT capability fields/parsing
From: Johannes Berg @ 2017-02-15  9:16 UTC (permalink / raw)
  To: Arend Van Spriel, linux-wireless; +Cc: j, greearb
In-Reply-To: <281180d5-2a7e-00b5-f12b-13bf568812da@broadcom.com>

On Wed, 2017-02-15 at 10:08 +0100, Arend Van Spriel wrote:
> [snip]
> 
> Looks good to me.

Thanks for checking :)

> > +	/* not covered or invalid combination received */
> 
> Do you want to inform about the invalid/reserved combination.

I'm not really sure what to do - we don't really want to print a
message on something that might have been received from the peer, I
think? Though I suppose we should return 0 for the invalid
combinations, indicating that they're not supported.

johannes

^ permalink raw reply

* Re: rt2500usb: don't mark register accesses as inline
From: Kalle Valo @ 2017-02-15  9:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Stanislaw Gruszka, Helmut Schaa, Arnd Bergmann, Mathias Kresin,
	linux-wireless, netdev, linux-kernel
In-Reply-To: <20170214212846.2809141-1-arnd@arndb.de>

Arnd Bergmann <arnd@arndb.de> wrote:
> When CONFIG_KASAN is set, we get a rather large stack here:
> 
> drivers/net/wireless/ralink/rt2x00/rt2500usb.c: In function 'rt2500usb_set_device_state':
> drivers/net/wireless/ralink/rt2x00/rt2500usb.c:1074:1: error: the frame size of 3032 bytes is larger than 100 bytes [-Werror=frame-larger-than=]
> 
> If we don't force those functions to be inline, the compiler can figure this
> out better itself and not inline the functions when doing so would be harmful,
> reducing the stack size to a merge 256 bytes.
> 
> Note that there is another problem that manifests in this driver, as a result
> of the typecheck() macro causing even larger stack frames.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Patch applied to wireless-drivers-next.git, thanks.

727241660912 rt2500usb: don't mark register accesses as inline

-- 
https://patchwork.kernel.org/patch/9572947/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: brcmfmac: Use net_device_stats from struct net_device
From: Kalle Valo @ 2017-02-15  9:15 UTC (permalink / raw)
  To: Tobias Klauser
  Cc: arend.vanspriel, franky.lin, hante.meuleman, linux-wireless,
	brcm80211-dev-list.pdl, netdev
In-Reply-To: <20170213101409.8205-1-tklauser@distanz.ch>

Tobias Klauser <tklauser@distanz.ch> wrote:
> Instead of using a private copy of struct net_device_stats in struct
> brcm_if, use stats from struct net_device.  Also remove the now
> unnecessary .ndo_get_stats function.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>

Patch applied to wireless-drivers-next.git, thanks.

91b632803ee4 brcmfmac: Use net_device_stats from struct net_device

-- 
https://patchwork.kernel.org/patch/9569271/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [1/3] rtlwifi: btcoexist: Fix if == else warnings in halbtc8821a2ant.c
From: Kalle Valo @ 2017-02-15  9:15 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless, Larry Finger, Julia Lawall
In-Reply-To: <20170212004605.1308-2-Larry.Finger@lwfinger.net>

Larry Finger <Larry.Finger@lwfinger.net> wrote:
> The 0-DAY kernel test infrastructure reports the following:
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3023:1-3: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3035:2-4: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3037:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3047:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3075:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3085:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3129:1-3: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3141:2-4: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3143:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3153:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3179:2-4: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3181:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:3192:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2677:1-3: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2833:1-3: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2847:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2857:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2885:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2895:3-5: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2940:1-3: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2788:2-4: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2391:2-4: WARNING: possible condition with no effect (if == else)
> drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8821a2ant.c:2417:2-4: WARNING: possible condition with no effect (if == else)
> 
> Reported-by: kbuild-all@01.org
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> Cc: Julia Lawall <julia.lawall@lip6.fr>

3 patches applied to wireless-drivers-next.git, thanks.

ac0ca72c6f53 rtlwifi: btcoexist: Fix if == else warnings in halbtc8821a2ant.c
42e74946f016 rtlwifi: btcoexist: Fix if == else warnings in halbtc8821a1ant.c
b686784d03e6 rtlwifi: btcoexist: Fix if == else warnings in halbtc8723b1ant.c

-- 
https://patchwork.kernel.org/patch/9568225/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [-, REGRESSION] mwifiex: don't enable/disable IRQ 0 during suspend/resume
From: Kalle Valo @ 2017-02-15  9:14 UTC (permalink / raw)
  To: Brian Norris
  Cc: Amitkumar Karwar, Nishant Sarmukadam, linux-kernel,
	linux-wireless, Rajat Jain, Brian Norris
In-Reply-To: <20170210215525.139701-1-briannorris@chromium.org>

Brian Norris <briannorris@chromium.org> wrote:
> If we don't have an out-of-band wakeup IRQ configured through DT (as
> most platforms don't), then we fall out of this function with
> 'irq_wakeup == 0'. Other code (e.g., mwifiex_disable_wake() and
> mwifiex_enable_wake()) treats 'irq_wakeup >= 0' as a valid IRQ, and so
> we end up calling {enable,disable}_irq() on IRQ 0.
> 
> That seems bad, so let's not do that.
> 
> Same problem as fixed in this patch:
> 
> https://patchwork.kernel.org/patch/9531693/
> [PATCH v2 2/3] btmrvl: set irq_bt to -1 when failed to parse it
> 
> with the difference that:
> (a) this one is actually a regression and
> (b) this affects both device tree and non-device-tree systems
> 
> While fixing the regression, also drop the verbosity on the parse
> failure, so we don't see this when a DT node is present but doesn't have
> an interrupt property (this is perfectly legal):
> 
> [   21.999000] mwifiex_pcie 0000:01:00.0: fail to parse irq_wakeup from device tree
> 
> Fixes: 853402a00823 ("mwifiex: Enable WoWLAN for both sdio and pcie")
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Acked-by: Rajat Jain <rajatja@google.com>

Patch applied to wireless-drivers-next.git, thanks.

2447e2cad752 mwifiex: don't enable/disable IRQ 0 during suspend/resume

-- 
https://patchwork.kernel.org/patch/9567543/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: orinoco: Use net_device_stats from struct net_device
From: Kalle Valo @ 2017-02-15  9:13 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: linux-wireless, netdev
In-Reply-To: <20170210130313.27821-1-tklauser@distanz.ch>

Tobias Klauser <tklauser@distanz.ch> wrote:
> Instead of using a private copy of struct net_device_stats in
> struct orinoco_private, use stats from struct net_device. Also remove
> the now unnecessary .ndo_get_stats function.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Patch applied to wireless-drivers-next.git, thanks.

3a6282045b22 orinoco: Use net_device_stats from struct net_device

-- 
https://patchwork.kernel.org/patch/9566717/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: rtlwifi: btcoexist: fix semicolon.cocci warnings
From: Kalle Valo @ 2017-02-15  9:12 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Larry Finger, Chaoming Li, Joe Perches, netdev, linux-wireless,
	linux-kernel, kbuild-all
In-Reply-To: <alpine.DEB.2.20.1702092111340.1985@hadrien>

Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> Remove unneeded semicolon.
> 
> Generated by: scripts/coccinelle/misc/semicolon.cocci
> 
> CC: Larry Finger <Larry.Finger@lwfinger.net>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Patch applied to wireless-drivers-next.git, thanks.

7546bba385b4 rtlwifi: btcoexist: fix semicolon.cocci warnings

-- 
https://patchwork.kernel.org/patch/9565451/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [v5] wlcore: disable multicast filter in AP mode
From: Kalle Valo @ 2017-02-15  9:12 UTC (permalink / raw)
  To: Iain Hunter; +Cc: linux-wireless, kvalo, Iain Hunter
In-Reply-To: <20170209143728.22831-1-i-hunter1@ti.com>

Iain Hunter <drhunter95@gmail.com> wrote:
> Enable AP support for allmulticast for MDNS. It can be enabled by bringing
> up the interface with ip command with argument allmulticast on
> 
> Signed-off-by: Iain Hunter <i-hunter1@ti.com>

Patch applied to wireless-drivers-next.git, thanks.

1f8665320fa1 wlcore: disable multicast filter in AP mode

-- 
https://patchwork.kernel.org/patch/9564711/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [RFC v2 3/7] ieee80211: add new VHT capability fields/parsing
From: Arend Van Spriel @ 2017-02-15  9:08 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: j, greearb, Johannes Berg
In-Reply-To: <20170214132208.8715-4-johannes@sipsolutions.net>

On 14-2-2017 14:22, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> IEEE 802.11-2016 extended the VHT capability fields to allow
> indicating the number of spatial streams depending on the
> actually used bandwidth, add support for decoding this.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  include/linux/ieee80211.h | 105 +++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 103 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
> index 4a7200c6c9ea..c51d309a45e7 100644
> --- a/include/linux/ieee80211.h
> +++ b/include/linux/ieee80211.h
> @@ -1457,13 +1457,16 @@ struct ieee80211_ht_operation {
>   *	STA can receive. Rate expressed in units of 1 Mbps.
>   *	If this field is 0 this value should not be used to
>   *	consider the highest RX data rate supported.
> - *	The top 3 bits of this field are reserved.
> + *	The top 3 bits of this field indicate the Maximum NSTS,total
> + *	(a beamformee capability.)
>   * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
>   * @tx_highest: Indicates highest long GI VHT PPDU data rate
>   *	STA can transmit. Rate expressed in units of 1 Mbps.
>   *	If this field is 0 this value should not be used to
>   *	consider the highest TX data rate supported.
> - *	The top 3 bits of this field are reserved.
> + *	The top 2 bits of this field are reserved, the
> + *	3rd bit from the top indiciates VHT Extended NSS BW
> + *	Capability.
>   */
>  struct ieee80211_vht_mcs_info {
>  	__le16 rx_mcs_map;
> @@ -1472,6 +1475,13 @@ struct ieee80211_vht_mcs_info {
>  	__le16 tx_highest;
>  } __packed;
>  
> +/* for rx_highest */
> +#define IEEE80211_VHT_MAX_NSTS_TOTAL_SHIFT	13
> +#define IEEE80211_VHT_MAX_NSTS_TOTAL_MASK	(7 << IEEE80211_VHT_MAX_NSTS_TOTAL_SHIFT)
> +
> +/* for tx_highest */
> +#define IEEE80211_VHT_EXT_NSS_BW_CAPABLE	(1 << 13)
> +
>  /**
>   * enum ieee80211_vht_mcs_support - VHT MCS support definitions
>   * @IEEE80211_VHT_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the
> @@ -1547,6 +1557,7 @@ struct ieee80211_vht_operation {
>  #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ		0x00000004
>  #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ	0x00000008
>  #define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK			0x0000000C
> +#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_SHIFT			2
>  #define IEEE80211_VHT_CAP_RXLDPC				0x00000010
>  #define IEEE80211_VHT_CAP_SHORT_GI_80				0x00000020
>  #define IEEE80211_VHT_CAP_SHORT_GI_160				0x00000040
> @@ -1575,6 +1586,96 @@ struct ieee80211_vht_operation {
>  #define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB	0x0c000000
>  #define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN			0x10000000
>  #define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN			0x20000000
> +#define IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT			30
> +#define IEEE80211_VHT_CAP_EXT_NSS_BW_MASK			0xc0000000
> +
> +static int __maybe_unused
> +ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *cap,
> +			  enum ieee80211_vht_chanwidth bw,
> +			  int mcs)
> +{
> +	u16 map = le16_to_cpu(cap->supp_mcs.rx_mcs_map);
> +	int max_vht_nss;
> +	int ext_nss_bw;
> +	int supp_width;
> +	int i, mcs_encoding;
> +
> +	if (map == 0xffff)
> +		return 0;
> +
> +	if (WARN_ON(mcs > 9))
> +		return 0;
> +	if (mcs <= 7)
> +		mcs_encoding = 0;
> +	else if (mcs == 8)
> +		mcs_encoding = 1;
> +	else
> +		mcs_encoding = 2;
> +
> +	/* find max_vht_nss for the given MCS */
> +	for (i = 7; i >= 0; i--) {
> +		int supp = (map >> (2*i)) & 3;
> +
> +		if (supp == 3)
> +			continue;
> +
> +		if (supp >= mcs_encoding) {
> +			max_vht_nss = i;
> +			break;
> +		}
> +	}
> +
> +	if (!(cap->supp_mcs.tx_mcs_map & cpu_to_le16(IEEE80211_VHT_EXT_NSS_BW_CAPABLE)))
> +		return max_vht_nss;
> +
> +	ext_nss_bw = (le32_to_cpu(cap->vht_cap_info) &
> +					IEEE80211_VHT_CAP_EXT_NSS_BW_MASK)
> +			>> IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT;
> +	supp_width = (le32_to_cpu(cap->vht_cap_info) &
> +					IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK)
> +			>> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_SHIFT;
> +
> +	/*
> +	 * Cover all the special cases according to IEEE 802.11-2016 Table 9-250.
> +	 * All other cases are either factor of 1 or not valid/supported.
> +	 */
> +	switch (bw) {
> +	case IEEE80211_VHT_CHANWIDTH_USE_HT:
> +	case IEEE80211_VHT_CHANWIDTH_80MHZ:
> +		if ((supp_width == 1 || supp_width == 2) &&
> +		    ext_nss_bw == 3)
> +			return 2 * max_vht_nss;
> +		break;
> +	case IEEE80211_VHT_CHANWIDTH_160MHZ:
> +		if (supp_width == 0 &&
> +		    (ext_nss_bw == 1 || ext_nss_bw == 2))
> +			return DIV_ROUND_UP(max_vht_nss, 2);
> +		if (supp_width == 0 &&
> +		    ext_nss_bw == 3)
> +			return DIV_ROUND_UP(3 * max_vht_nss, 4);
> +		if (supp_width == 1 &&
> +		    ext_nss_bw == 3)
> +			return 2 * max_vht_nss;
> +		break;
> +	case IEEE80211_VHT_CHANWIDTH_80P80MHZ:
> +		if (supp_width == 0 &&
> +		    ext_nss_bw == 2)
> +			return DIV_ROUND_UP(max_vht_nss, 2);
> +		if (supp_width == 0 &&
> +		    ext_nss_bw == 3)
> +			return DIV_ROUND_UP(3 * max_vht_nss, 4);
> +		if (supp_width == 1 &&
> +		    ext_nss_bw == 1)
> +			return DIV_ROUND_UP(max_vht_nss, 2);
> +		if (supp_width == 1 &&
> +		    ext_nss_bw == 2)
> +			return DIV_ROUND_UP(3 * max_vht_nss, 4);
> +		break;
> +	}

Looks good to me.

> +	/* not covered or invalid combination received */

Do you want to inform about the invalid/reserved combination.

Regards,
Arend

> +	return max_vht_nss;
> +}
>  
>  /* Authentication algorithms */
>  #define WLAN_AUTH_OPEN 0
> 

^ permalink raw reply

* Re: [RFC-PATCH] ath9k_htc: Adjust beacon timers for Power Save
From: Kalle Valo @ 2017-02-15  9:02 UTC (permalink / raw)
  To: Doru
  Cc: linux-wireless, ath9k_htc_fw, andra.paraschiv7, costin.raiciu,
	dragos.niculescu
In-Reply-To: <1487100985-4194-1-git-send-email-gucea.doru@gmail.com>

Doru <gucea.doru@gmail.com> writes:

> From: Doru Gucea <gucea.doru@gmail.com>
>
> Each time we receive a beacon we need to adjust the hardware
> timers for next DTIM and next TBTT.
>
> Before this commit, the Power Save behaviour was incorrect.
> The scenario was:
> - STA receives a beacon from AP with TIM unset;
> - mac80211 layers puts the chip to sleep;
> - chip is woken up by mac80211's software timer reponsible for
> beacon miss after 7 * beacon_interval period.
>
> Normally the chip should sleep at most DTIM period. This commit
> configures hardware timers for waking up the chip correctly.
>
> More details on the wiki:
> https://github.com/doru91/linux-stable/wiki/Single-Interface-Power-Save
>
> Signed-off-by: Doru Gucea <gucea.doru@gmail.com>
> ---
>  drivers/net/wireless/ath/ath9k/htc_drv_main.c | 4 ++++
>  net/mac80211/mlme.c                           | 6 ++++++
>  2 files changed, 10 insertions(+)

[...]

> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -3536,6 +3536,12 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
>  			sdata->vif.bss_conf.sync_dtim_count = 0;
>  	}
>  
> +	/* trigger hardware timers adjustment
> +	 * this needs to be done before beacon filtering
> +	 */
> +	changed |= BSS_CHANGED_BEACON_INFO;
> +	ieee80211_bss_info_change_notify(sdata, changed);

You shouldn't mix driver and mac80211 changes in the same patch, I
suspect Johannes didn't even notice this change because of that. Create
a new patchset with two patches, one for ath9k and another for mac80211.

-- 
Kalle Valo

^ permalink raw reply

* Re: [PATCH v6 1/3] cfg80211: Accept multiple RSSI thresholds for CQM
From: Kalle Valo @ 2017-02-15  8:58 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Andrew Zaborowski, linux-wireless
In-Reply-To: <1487147264.4026.13.camel@sipsolutions.net>

Johannes Berg <johannes@sipsolutions.net> writes:

> On Fri, 2017-02-10 at 10:02 +0100, Andrew Zaborowski wrote:
>> Change the SET CQM command's RSSI threshold attribute to accept any
>> number of thresholds as a sorted array.=C2=A0=C2=A0The API should be bac=
kwards
>> compatible so that if one s32 threshold value is passed, the old
>> mechanism is enabled.=C2=A0=C2=A0The netlink event generated is the same=
 in
>> both cases.
>
> I've applied this now, thanks for your patience :)
>
> I got a bit confused - and then fixed it up - patchwork has giving your
> name as "Andrzej Zaborowski" which apparently you didn't really want
> (any more). I've fixed it for these patches to be as the patches you
> sent, but no guarantees I've done this before or will remember to do
> that in the future - if you can somehow change your name in patchwork
> (patchwork.kernel.org) that would be good.

IIRC if you haven't registered to patchwork.kernel.org it's possible to
change the name easily. But after registration the user needs to contact
helpdesk to change the name.

Please let me know if there's an easier way to change the name. This is
not the first time this comes up.

--=20
Kalle Valo

^ permalink raw reply

* [PATCH] average: change to declare precision, not factor
From: Johannes Berg @ 2017-02-15  8:49 UTC (permalink / raw)
  To: linux-wireless
  Cc: netdev, Michael S . Tsirkin, Jason Wang, virtualization,
	Marek Lindner, Simon Wunderlich, Antonio Quartulli,
	Stanislaw Gruszka, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Declaring the factor is counter-intuitive, and people are prone
to using small(-ish) values even when that makes no sense.

Change the DECLARE_EWMA() macro to take the fractional precision,
in bits, rather than a factor, and update all users.

While at it, add some more documentation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
Unless I hear any objections, I will take this through my tree.
---
 drivers/net/virtio_net.c                    |  2 +-
 drivers/net/wireless/ath/ath5k/ath5k.h      |  2 +-
 drivers/net/wireless/ralink/rt2x00/rt2x00.h |  2 +-
 include/linux/average.h                     | 61 +++++++++++++++++++----------
 net/batman-adv/types.h                      |  2 +-
 net/mac80211/ieee80211_i.h                  |  2 +-
 net/mac80211/sta_info.h                     |  6 +--
 7 files changed, 49 insertions(+), 28 deletions(-)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 11e28530c83c..5e0cc9ec0f81 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -49,7 +49,7 @@ module_param(gso, bool, 0444);
  * at once, the weight is chosen so that the EWMA will be insensitive to short-
  * term, transient changes in packet size.
  */
-DECLARE_EWMA(pkt_len, 1, 64)
+DECLARE_EWMA(pkt_len, 0, 64)
 
 /* With mergeable buffers we align buffer address and use the low bits to
  * encode its true size. Buffer size is up to 1 page so we need to align to
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 67fedb61fcc0..979800c6f57f 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1252,7 +1252,7 @@ struct ath5k_statistics {
 #define ATH5K_TXQ_LEN_MAX	(ATH_TXBUF / 4)		/* bufs per queue */
 #define ATH5K_TXQ_LEN_LOW	(ATH5K_TXQ_LEN_MAX / 2)	/* low mark */
 
-DECLARE_EWMA(beacon_rssi, 1024, 8)
+DECLARE_EWMA(beacon_rssi, 10, 8)
 
 /* Driver state associated with an instance of a device */
 struct ath5k_hw {
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
index 26869b3bef45..340787894c69 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
@@ -257,7 +257,7 @@ struct link_qual {
 	int tx_failed;
 };
 
-DECLARE_EWMA(rssi, 1024, 8)
+DECLARE_EWMA(rssi, 10, 8)
 
 /*
  * Antenna settings about the currently active link.
diff --git a/include/linux/average.h b/include/linux/average.h
index d04aa58280de..7ddaf340d2ac 100644
--- a/include/linux/average.h
+++ b/include/linux/average.h
@@ -1,45 +1,66 @@
 #ifndef _LINUX_AVERAGE_H
 #define _LINUX_AVERAGE_H
 
-/* Exponentially weighted moving average (EWMA) */
+/*
+ * Exponentially weighted moving average (EWMA)
+ *
+ * This implements a fixed-precision EWMA algorithm, with both the
+ * precision and fall-off coefficient determined at compile-time
+ * and built into the generated helper funtions.
+ *
+ * The first argument to the macro is the name that will be used
+ * for the struct and helper functions.
+ *
+ * The second argument, the precision, expresses how many bits are
+ * used for the fractional part of the fixed-precision values.
+ *
+ * The third argument, the weight reciprocal, determines how the
+ * new values will be weighed vs. the old state, new values will
+ * get weight 1/weight_rcp and old values 1-1/weight_rcp. Note
+ * that this parameter must be a power of two for efficiency.
+ */
 
-#define DECLARE_EWMA(name, _factor, _weight)				\
+#define DECLARE_EWMA(name, _precision, _weight_rcp)			\
 	struct ewma_##name {						\
 		unsigned long internal;					\
 	};								\
 	static inline void ewma_##name##_init(struct ewma_##name *e)	\
 	{								\
-		BUILD_BUG_ON(!__builtin_constant_p(_factor));		\
-		BUILD_BUG_ON(!__builtin_constant_p(_weight));		\
-		BUILD_BUG_ON_NOT_POWER_OF_2(_factor);			\
-		BUILD_BUG_ON_NOT_POWER_OF_2(_weight);			\
+		BUILD_BUG_ON(!__builtin_constant_p(_precision));	\
+		BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp));	\
+		/*							\
+		 * Even if you want to feed it just 0/1 you should have	\
+		 * some bits for the non-fractional part...		\
+		 */							\
+		BUILD_BUG_ON((_precision) > 30);			\
+		BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp);		\
 		e->internal = 0;					\
 	}								\
 	static inline unsigned long					\
 	ewma_##name##_read(struct ewma_##name *e)			\
 	{								\
-		BUILD_BUG_ON(!__builtin_constant_p(_factor));		\
-		BUILD_BUG_ON(!__builtin_constant_p(_weight));		\
-		BUILD_BUG_ON_NOT_POWER_OF_2(_factor);			\
-		BUILD_BUG_ON_NOT_POWER_OF_2(_weight);			\
-		return e->internal >> ilog2(_factor);			\
+		BUILD_BUG_ON(!__builtin_constant_p(_precision));	\
+		BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp));	\
+		BUILD_BUG_ON((_precision) > 30);			\
+		BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp);		\
+		return e->internal >> (_precision);			\
 	}								\
 	static inline void ewma_##name##_add(struct ewma_##name *e,	\
 					     unsigned long val)		\
 	{								\
 		unsigned long internal = ACCESS_ONCE(e->internal);	\
-		unsigned long weight = ilog2(_weight);			\
-		unsigned long factor = ilog2(_factor);			\
+		unsigned long weight_rcp = ilog2(_weight_rcp);		\
+		unsigned long precision = _precision;			\
 									\
-		BUILD_BUG_ON(!__builtin_constant_p(_factor));		\
-		BUILD_BUG_ON(!__builtin_constant_p(_weight));		\
-		BUILD_BUG_ON_NOT_POWER_OF_2(_factor);			\
-		BUILD_BUG_ON_NOT_POWER_OF_2(_weight);			\
+		BUILD_BUG_ON(!__builtin_constant_p(_precision));	\
+		BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp));	\
+		BUILD_BUG_ON((_precision) > 30);			\
+		BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp);		\
 									\
 		ACCESS_ONCE(e->internal) = internal ?			\
-			(((internal << weight) - internal) +		\
-				(val << factor)) >> weight :		\
-			(val << factor);				\
+			(((internal << weight_rcp) - internal) +	\
+				(val << precision)) >> weight_rcp :	\
+			(val << precision);				\
 	}
 
 #endif /* _LINUX_AVERAGE_H */
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 8f64a5c01345..66b25e410a41 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -402,7 +402,7 @@ struct batadv_gw_node {
 	struct rcu_head rcu;
 };
 
-DECLARE_EWMA(throughput, 1024, 8)
+DECLARE_EWMA(throughput, 10, 8)
 
 /**
  * struct batadv_hardif_neigh_node_bat_v - B.A.T.M.A.N. V private neighbor
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 159a1a733725..0e718437d080 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -428,7 +428,7 @@ struct ieee80211_sta_tx_tspec {
 	bool downgraded;
 };
 
-DECLARE_EWMA(beacon_signal, 16, 4)
+DECLARE_EWMA(beacon_signal, 4, 4)
 
 struct ieee80211_if_managed {
 	struct timer_list timer;
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 71fa41a1368a..90a2c4deb00c 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -322,8 +322,8 @@ struct ieee80211_fast_rx {
 	struct rcu_head rcu_head;
 };
 
-/* we use only values in the range 0-100, so pick a large factor */
-DECLARE_EWMA(mesh_fail_avg, 1048576, 8)
+/* we use only values in the range 0-100, so pick a large precision */
+DECLARE_EWMA(mesh_fail_avg, 20, 8)
 
 /**
  * struct mesh_sta - mesh STA information
@@ -373,7 +373,7 @@ struct mesh_sta {
 	struct ewma_mesh_fail_avg fail_avg;
 };
 
-DECLARE_EWMA(signal, 1024, 8)
+DECLARE_EWMA(signal, 10, 8)
 
 struct ieee80211_sta_rx_stats {
 	unsigned long packets;
-- 
2.9.3

^ permalink raw reply related

* Re: [PATCH v5 3/3] wireless: Set NL80211_EXT_FEATURE_CQM_RSSI_LIST in multiple drivers
From: Johannes Berg @ 2017-02-15  8:28 UTC (permalink / raw)
  To: Andrew Zaborowski, linux-wireless
In-Reply-To: <20170210035023.11471-3-andrew.zaborowski@intel.com>

On Fri, 2017-02-10 at 04:50 +0100, Andrew Zaborowski wrote:
> Set the NL80211_EXT_FEATURE_CQM_RSSI_LIST wiphy extended feature
> wholesale in all mac80211-based drivers that do not set the
> IEEE80211_VIF_BEACON_FILTER flags on their interfaces.  mac80211 will
> be processing supplied RSSI values in ieee80211_rx_mgmt_beacon and
> will detect when the thresholds set by
> ieee80211_set_cqm_rssi_range_config are crossed.  Remaining (few)
> drivers need code to enable the firmware to monitor the thresholds.
> This is mostly only compile-tested.
> 

Also applied 2 & 3 of this set, but I removed the staging driver
changes since I don't really want to deal with those. If you care much
send them to Greg separately, I guess.

johannes

^ permalink raw reply

* Re: [PATCH v6 1/3] cfg80211: Accept multiple RSSI thresholds for CQM
From: Johannes Berg @ 2017-02-15  8:27 UTC (permalink / raw)
  To: Andrew Zaborowski, linux-wireless
In-Reply-To: <20170210090231.14696-1-andrew.zaborowski@intel.com>

On Fri, 2017-02-10 at 10:02 +0100, Andrew Zaborowski wrote:
> Change the SET CQM command's RSSI threshold attribute to accept any
> number of thresholds as a sorted array.  The API should be backwards
> compatible so that if one s32 threshold value is passed, the old
> mechanism is enabled.  The netlink event generated is the same in
> both cases.

I've applied this now, thanks for your patience :)

I got a bit confused - and then fixed it up - patchwork has giving your
name as "Andrzej Zaborowski" which apparently you didn't really want
(any more). I've fixed it for these patches to be as the patches you
sent, but no guarantees I've done this before or will remember to do
that in the future - if you can somehow change your name in patchwork
(patchwork.kernel.org) that would be good.

johannes

^ permalink raw reply

* Re: [PATCH 2/2] mac80211: fix mesh fail_avg check
From: Johannes Berg @ 2017-02-15  8:14 UTC (permalink / raw)
  To: Rajkumar Manoharan; +Cc: linux-wireless, rmanohar
In-Reply-To: <1487104037-24941-2-git-send-email-rmanohar@qca.qualcomm.com>

On Tue, 2017-02-14 at 12:27 -0800, Rajkumar Manoharan wrote:
> Mesh failure average never be more than 100. Only in case of
> fixed path, average will be more than threshold limit (95%).
> With recent EWMA changes it may go upto 99 as it is scaled to
> 100. It make sense to return maximum metric when average is
> greater than threshold limit.
> 
> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
> ---
>  net/mac80211/mesh_hwmp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
> index d07ee3ca07ee..02c30a21eb66 100644
> --- a/net/mac80211/mesh_hwmp.c
> +++ b/net/mac80211/mesh_hwmp.c
> @@ -339,7 +339,7 @@ static u32 airtime_link_metric_get(struct
> ieee80211_local *local,
>  	if (rate) {
>  		err = 0;
>  	} else {
> -		if (fail_avg >= 100)
> +		if (fail_avg >= 95)
>  			return MAX_METRIC;

Why is this >= and the other place is >?

Also, I think it'd be good to introduce a #define for this value now,
perhaps something like "LINK_FAIL_THRESH".

johannes

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox