Commit 207ae4a3 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville

b43: N-PHY: report signal to mac80211

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5b346f3e
...@@ -735,16 +735,22 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr) ...@@ -735,16 +735,22 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
} }
/* Link quality statistics */ /* Link quality statistics */
if ((chanstat & B43_RX_CHAN_PHYTYPE) == B43_PHYTYPE_N) { switch (chanstat & B43_RX_CHAN_PHYTYPE) {
// s8 rssi = max(rxhdr->power0, rxhdr->power1); case B43_PHYTYPE_N:
//TODO: Find out what the rssi value is (dBm or percentage?) if (rxhdr->power0 == 16 || rxhdr->power0 == 32)
// and also find out what the maximum possible value is. status.signal = max(rxhdr->power1, rxhdr->power2);
// Fill status.ssi and status.signal fields. else
} else { status.signal = max(rxhdr->power0, rxhdr->power1);
break;
case B43_PHYTYPE_A:
case B43_PHYTYPE_B:
case B43_PHYTYPE_G:
case B43_PHYTYPE_LP:
status.signal = b43_rssi_postprocess(dev, rxhdr->jssi, status.signal = b43_rssi_postprocess(dev, rxhdr->jssi,
(phystat0 & B43_RX_PHYST0_OFDM), (phystat0 & B43_RX_PHYST0_OFDM),
(phystat0 & B43_RX_PHYST0_GAINCTL), (phystat0 & B43_RX_PHYST0_GAINCTL),
(phystat3 & B43_RX_PHYST3_TRSTATE)); (phystat3 & B43_RX_PHYST3_TRSTATE));
break;
} }
if (phystat0 & B43_RX_PHYST0_OFDM) if (phystat0 & B43_RX_PHYST0_OFDM)
......
...@@ -248,7 +248,15 @@ struct b43_rxhdr_fw4 { ...@@ -248,7 +248,15 @@ struct b43_rxhdr_fw4 {
__s8 power1; /* PHY RX Status 1: Power 1 */ __s8 power1; /* PHY RX Status 1: Power 1 */
} __packed; } __packed;
} __packed; } __packed;
union {
/* RSSI for N-PHYs */
struct {
__s8 power2;
PAD_BYTES(1);
} __packed;
__le16 phy_status2; /* PHY RX Status 2 */ __le16 phy_status2; /* PHY RX Status 2 */
} __packed;
__le16 phy_status3; /* PHY RX Status 3 */ __le16 phy_status3; /* PHY RX Status 3 */
union { union {
/* Tested with 598.314, 644.1001 and 666.2 */ /* Tested with 598.314, 644.1001 and 666.2 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment