b43: HT-PHY: report signal to mac80211
PATCH 1/1 b43: HT-PHY: report signal to mac80211
---
John, this is new feature, not a bug fix. However I still think it'd be great to take this for 3.2. This is hopefully final b43 patch for 3.2 related to HT-PHY support. With this last one, basic support should be 100% implemented now.
This can be even more important, as there isn't any native Linux driver (open or closed source) for HT-PHY (BCM4331) other than b43.
This has been succesfully tested by David, reported signal looked sane for him. Unfortunately we still lack info about the noise, but having signal gives users some basic overview on the available networks.
--- drivers/net/wireless/b43/xmit.c | 7 +++++++ drivers/net/wireless/b43/xmit.h | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 1 deletions(-)
drivers/net/wireless/b43/xmit.c +7 -0
@@ -737,7 +737,14 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)/* Link quality statistics */ switch (chanstat &B43_RX_CHAN_PHYTYPE ) { +case B43_PHYTYPE_HT : +/* TODO: is max the right choice? */ + status.signal =max ( + (__s8 )max (rxhdr->phy_ht_power0, rxhdr->phy_ht_power1), + rxhdr->phy_ht_power2); +break ;case B43_PHYTYPE_N : +/* Broadcom has code for min and avg, but always uses max */ if (rxhdr->power0 ==16 || rxhdr->power0 ==32 ) status.signal =max (rxhdr->power1, rxhdr->power2);else
drivers/net/wireless/b43/xmit.h +15 -1
@@ -249,6 +249,12 @@ struct b43_rxhdr_fw4 { } __packed; } __packed;union { +/* HT-PHY */ +struct { + PAD_BYTES(1); +__s8 phy_ht_power0; + } __packed; +/* RSSI for N-PHYs */ struct {__s8 power2;
@@ -257,7 +263,15 @@ struct b43_rxhdr_fw4 {__le16 phy_status2;/* PHY RX Status 2 */ } __packed; -__le16 phy_status3;/* PHY RX Status 3 */ +union { +/* HT-PHY */ +struct { +__s8 phy_ht_power1; +__s8 phy_ht_power2; + } __packed; + +__le16 phy_status3;/* PHY RX Status 3 */ + } __packed; union { /* Tested with 598.314, 644.1001 and 666.2 */ struct {
Signature · 1 line
1.7.3.4
PATCH 1/1 b43: HT-PHY: report signal to mac80211
drivers/net/wireless/b43/xmit.c void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr) · line 743
Quoted 4 lines · On Sun, 16 Oct 2011 23:30:49 +0200 Rafa? Mi?ecki <[email protected]> wrote:
drivers/net/wireless/b43/xmit.c +4
-0+case B43_PHYTYPE_HT : +/* TODO: is max the right choice? */ + status.signal = max( + (__s8) max(rxhdr->phy_ht_power0, rxhdr->phy_ht_power1),
Hm, why is this cast needed? Does it throw a warning?
Signature · 1 line
Greetings, Michael.
PATCH 1/1 b43: HT-PHY: report signal to mac80211
W dniu 17 pa?dziernika 2011 16:27 u?ytkownik Michael B?sch <[email protected]> napisa?:
Quoted 8 lines
Quoted 4 lines · On Sun, 16 Oct 2011 23:30:49 +0200 Rafa? Mi?ecki <[email protected]> wrote:
+ ? ? case
B43_PHYTYPE_HT:
+ ? ? ? ? ? ? /* TODO: is max the right choice? */
+ ? ? ? ? ? ? status.signal = max(
+ ? ? ? ? ? ? ? ? ? ? (__s8)max(rxhdr->phy_ht_power0, rxhdr->phy_ht_power1),Hm, why is this cast needed? Does it throw a warning?
warning: comparison of distinct pointer types lacks a cast
gcc 4.5.1
Signature · 1 line
Rafa?
Johannes Berg
maintainerPATCH 1/1 b43: HT-PHY: report signal to mac80211
In reply to Michael BüschQuoted 8 lines · Michael B?sch
drivers/net/wireless/b43/xmit.c void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr) · line 743
Quoted 4 lines · On Sun, 16 Oct 2011 23:30:49 +0200 Rafa? Mi?ecki <[email protected]> wrote:
drivers/net/wireless/b43/xmit.c +4
-0+case B43_PHYTYPE_HT : +/* TODO: is max the right choice? */ + status.signal = max( + (__s8) max(rxhdr->phy_ht_power0, rxhdr->phy_ht_power1),Hm, why is this cast needed? Does it throw a warning?
The cast should probably be a max_t() instead.
johannes