All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
To: linux-wireless@vger.kernel.org
Cc: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>,
	Avinash Patil <avinashp@quantenna.com>,
	Vasily Ulyanov <vulyanov@quantenna.com>,
	Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Subject: [PATCH 06/10] qtnfmac: fix rssi data passed to wireless core
Date: Mon, 13 Nov 2017 13:28:11 +0300	[thread overview]
Message-ID: <20171113102815.11254-7-sergey.matyukevich.os@quantenna.com> (raw)
In-Reply-To: <20171113102815.11254-1-sergey.matyukevich.os@quantenna.com>

Fix RSSI values passed to wireless core by qtnfmac driver:
- fix RSSI values in scan results:
  driver registers wiphy with CFG80211_SIGNAL_TYPE_MBM signal type,
  so mBm should be passed using DBM_TO_MBM macro
- accompany firmware changes fixing RSSI values in received mgmt frames
  update qlink message format and pass correct signed values to core

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/event.c |  7 +++----
 drivers/net/wireless/quantenna/qtnfmac/qlink.h | 11 ++++++-----
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c
index 9843ca36b74b..b3489b5b5d9e 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/event.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c
@@ -237,9 +237,8 @@ qtnf_event_handle_mgmt_received(struct qtnf_vif *vif,
 	pr_debug("%s LEN:%u FC:%.4X SA:%pM\n", vif->netdev->name, frame_len,
 		 le16_to_cpu(frame->frame_control), frame->addr2);
 
-	cfg80211_rx_mgmt(&vif->wdev, le32_to_cpu(rxmgmt->freq),
-			 le32_to_cpu(rxmgmt->sig_dbm), rxmgmt->frame_data,
-			 frame_len, flags);
+	cfg80211_rx_mgmt(&vif->wdev, le32_to_cpu(rxmgmt->freq), rxmgmt->sig_dbm,
+			 rxmgmt->frame_data, frame_len, flags);
 
 	return 0;
 }
@@ -324,7 +323,7 @@ qtnf_event_handle_scan_results(struct qtnf_vif *vif,
 				  sr->bssid, get_unaligned_le64(&sr->tsf),
 				  le16_to_cpu(sr->capab),
 				  le16_to_cpu(sr->bintval), ies, ies_len,
-				  sr->signal, GFP_KERNEL);
+				  DBM_TO_MBM(sr->sig_dbm), GFP_KERNEL);
 	if (!bss)
 		return -ENOMEM;
 
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index 3e3de4629a53..1f150be98820 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -19,7 +19,7 @@
 
 #include <linux/ieee80211.h>
 
-#define QLINK_PROTO_VER		7
+#define QLINK_PROTO_VER		8
 
 #define QLINK_MACID_RSVD		0xFF
 #define QLINK_VIFID_RSVD		0xFF
@@ -916,15 +916,16 @@ enum qlink_rxmgmt_flags {
  * struct qlink_event_rxmgmt - data for QLINK_EVENT_MGMT_RECEIVED event
  *
  * @freq: Frequency on which the frame was received in MHz.
- * @sig_dbm: signal strength in dBm.
  * @flags: bitmap of &enum qlink_rxmgmt_flags.
+ * @sig_dbm: signal strength in dBm.
  * @frame_data: data of Rx'd frame itself.
  */
 struct qlink_event_rxmgmt {
 	struct qlink_event ehdr;
 	__le32 freq;
-	__le32 sig_dbm;
 	__le32 flags;
+	s8 sig_dbm;
+	u8 rsvd[3];
 	u8 frame_data[0];
 } __packed;
 
@@ -936,7 +937,7 @@ struct qlink_event_rxmgmt {
  *	event was generated was discovered.
  * @capab: capabilities field.
  * @bintval: beacon interval announced by discovered BSS.
- * @signal: signal strength.
+ * @sig_dbm: signal strength in dBm.
  * @bssid: BSSID announced by discovered BSS.
  * @ssid_len: length of SSID announced by BSS.
  * @ssid: SSID announced by discovered BSS.
@@ -948,7 +949,7 @@ struct qlink_event_scan_result {
 	__le16 freq;
 	__le16 capab;
 	__le16 bintval;
-	s8 signal;
+	s8 sig_dbm;
 	u8 ssid_len;
 	u8 ssid[IEEE80211_MAX_SSID_LEN];
 	u8 bssid[ETH_ALEN];
-- 
2.11.0

  parent reply	other threads:[~2017-11-13 10:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 10:28 [PATCH 0/10] qtnfmac: regular portion of features and fixes Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 01/10] qtnfmac: check that MAC exists in regulatory notifier Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 02/10] qtnfmac: pass complete channel data between driver and firmware Sergey Matyukevich
2017-12-04 14:46   ` Kalle Valo
2017-12-05 16:24     ` Sergey Matyukevich
2018-01-12 11:23       ` Kalle Valo
2018-01-15  9:56         ` Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 03/10] qtnfmac: add support for radar detection and CAC Sergey Matyukevich
2017-12-04 14:49   ` Kalle Valo
2017-12-04 14:52     ` Kalle Valo
2017-12-05 16:27       ` Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 04/10] qtnfmac: change default interface mode from AP to STA Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 05/10] qtnfmac: check for passed channel being NULL in MGMT_TX command Sergey Matyukevich
2017-11-13 10:28 ` Sergey Matyukevich [this message]
2017-11-13 10:28 ` [PATCH 07/10] qtnfmac: fill wiphy's extended capabilities Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 08/10] qtnfmac: modify GET_STA_STATS cmd format for back/forward compatibility Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 09/10] qtnfmac: keeping track of "generation" for STA info Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 10/10] qtnfmac: support MAC address based access control Sergey Matyukevich
2017-12-04 15:01   ` Kalle Valo
2017-12-05 16:00     ` Sergey Matyukevich
2017-12-18 12:43       ` Sergey Matyukevich
2017-12-18 14:01       ` Kalle Valo
2017-12-18 16:18         ` Sergey Matyukevich
2017-12-19  9:38           ` Johannes Berg
2017-12-19 10:29             ` Sergey Matyukevich
2017-12-19 10:35               ` Johannes Berg
2017-12-19 10:42                 ` Sergey Matyukevich
2017-12-19 10:59                   ` Johannes Berg
2017-12-19 11:19                     ` Sergey Matyukevich
2017-12-19 12:37                       ` Arend van Spriel
2017-12-19 16:58                         ` Johannes Berg
2017-12-19 22:13                           ` Arend Van Spriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171113102815.11254-7-sergey.matyukevich.os@quantenna.com \
    --to=sergey.matyukevich.os@quantenna.com \
    --cc=avinashp@quantenna.com \
    --cc=igor.mitsyanko.os@quantenna.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=vulyanov@quantenna.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.