aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-10-12 17:18:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-10-14 14:48:20 -0400
commit207ae4a3733686df2aabd2dd6feefbde4e69cdd5 (patch)
tree0149815dcaac4a21b814ddc2b8775381261ba3bf /drivers
parent5b346f3eb4b59e00fbaca51637f2cf1df3f47f9d (diff)
b43: N-PHY: report signal to mac80211
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/xmit.c18
-rw-r--r--drivers/net/wireless/b43/xmit.h10
2 files changed, 21 insertions, 7 deletions
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index b8de62c22479..c73e8600d218 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -735,16 +735,22 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
735 } 735 }
736 736
737 /* Link quality statistics */ 737 /* Link quality statistics */
738 if ((chanstat & B43_RX_CHAN_PHYTYPE) == B43_PHYTYPE_N) { 738 switch (chanstat & B43_RX_CHAN_PHYTYPE) {
739// s8 rssi = max(rxhdr->power0, rxhdr->power1); 739 case B43_PHYTYPE_N:
740 //TODO: Find out what the rssi value is (dBm or percentage?) 740 if (rxhdr->power0 == 16 || rxhdr->power0 == 32)
741 // and also find out what the maximum possible value is. 741 status.signal = max(rxhdr->power1, rxhdr->power2);
742 // Fill status.ssi and status.signal fields. 742 else
743 } else { 743 status.signal = max(rxhdr->power0, rxhdr->power1);
744 break;
745 case B43_PHYTYPE_A:
746 case B43_PHYTYPE_B:
747 case B43_PHYTYPE_G:
748 case B43_PHYTYPE_LP:
744 status.signal = b43_rssi_postprocess(dev, rxhdr->jssi, 749 status.signal = b43_rssi_postprocess(dev, rxhdr->jssi,
745 (phystat0 & B43_RX_PHYST0_OFDM), 750 (phystat0 & B43_RX_PHYST0_OFDM),
746 (phystat0 & B43_RX_PHYST0_GAINCTL), 751 (phystat0 & B43_RX_PHYST0_GAINCTL),
747 (phystat3 & B43_RX_PHYST3_TRSTATE)); 752 (phystat3 & B43_RX_PHYST3_TRSTATE));
753 break;
748 } 754 }
749 755
750 if (phystat0 & B43_RX_PHYST0_OFDM) 756 if (phystat0 & B43_RX_PHYST0_OFDM)
diff --git a/drivers/net/wireless/b43/xmit.h b/drivers/net/wireless/b43/xmit.h
index f6e8bc436d5a..16c514d54afa 100644
--- a/drivers/net/wireless/b43/xmit.h
+++ b/drivers/net/wireless/b43/xmit.h
@@ -248,7 +248,15 @@ struct b43_rxhdr_fw4 {
248 __s8 power1; /* PHY RX Status 1: Power 1 */ 248 __s8 power1; /* PHY RX Status 1: Power 1 */
249 } __packed; 249 } __packed;
250 } __packed; 250 } __packed;
251 __le16 phy_status2; /* PHY RX Status 2 */ 251 union {
252 /* RSSI for N-PHYs */
253 struct {
254 __s8 power2;
255 PAD_BYTES(1);
256 } __packed;
257
258 __le16 phy_status2; /* PHY RX Status 2 */
259 } __packed;
252 __le16 phy_status3; /* PHY RX Status 3 */ 260 __le16 phy_status3; /* PHY RX Status 3 */
253 union { 261 union {
254 /* Tested with 598.314, 644.1001 and 666.2 */ 262 /* Tested with 598.314, 644.1001 and 666.2 */