[PATCH 4/5] Add RSSI values to received packets

Olof Johansson dev at skyshaper.net
Thu May 23 07:49:50 EDT 2013


Extract the rssi value from the metadata and forward it to upper
layers.

Signed-off-by: Olof Johansson <dev at skyshaper.net>
---
 txrx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/txrx.c b/txrx.c
index 873cc6a..c469e68 100644
--- a/txrx.c
+++ b/txrx.c
@@ -16,6 +16,9 @@

 #include "txrx.h"
 #include <linux/ieee80211.h>
+
+#define RSSI0(x) (100 - ((x->phy_stat0 >> 24) & 0xff))
+
 int  wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)
 {
 	struct sk_buff *skb2 ;
@@ -33,7 +36,7 @@ int  wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)
 	status.mactime = 10;
 	status.freq = wcn->current_channel->center_freq;
 	status.band = wcn->current_channel->band;
-	status.signal = 1;
+	status.signal = -RSSI0(bd);
 	status.antenna = 1;
 	status.rate_idx = 1;
 	status.flag = 0;
-- 
1.8.2.2



More information about the wcn36xx mailing list