* [PATCH 3.2 REQUEST] b43: HT-PHY: report signal to mac80211
@ 2011-10-16 21:30 Rafał Miłecki
2011-10-17 14:27 ` Michael Büsch
0 siblings, 1 reply; 4+ messages in thread
From: Rafał Miłecki @ 2011-10-16 21:30 UTC (permalink / raw)
To: linux-wireless, John W. Linville
Cc: b43-dev, David Woodhouse, Rafał Miłecki
Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
---
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(-)
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index 390c234..ed54f7d 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -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
diff --git a/drivers/net/wireless/b43/xmit.h b/drivers/net/wireless/b43/xmit.h
index 16c514d..98d9074 100644
--- a/drivers/net/wireless/b43/xmit.h
+++ b/drivers/net/wireless/b43/xmit.h
@@ -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 {
--
1.7.3.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 3.2 REQUEST] b43: HT-PHY: report signal to mac80211
2011-10-16 21:30 [PATCH 3.2 REQUEST] b43: HT-PHY: report signal to mac80211 Rafał Miłecki
@ 2011-10-17 14:27 ` Michael Büsch
2011-10-17 14:35 ` Rafał Miłecki
2011-10-17 14:36 ` Johannes Berg
0 siblings, 2 replies; 4+ messages in thread
From: Michael Büsch @ 2011-10-17 14:27 UTC (permalink / raw)
To: Rafał Miłecki
Cc: linux-wireless, John W. Linville, David Woodhouse, b43-dev
On Sun, 16 Oct 2011 23:30:49 +0200
Rafa? Mi?ecki <zajec5@gmail.com> 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?
--
Greetings, Michael.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3.2 REQUEST] b43: HT-PHY: report signal to mac80211
2011-10-17 14:27 ` Michael Büsch
@ 2011-10-17 14:35 ` Rafał Miłecki
2011-10-17 14:36 ` Johannes Berg
1 sibling, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2011-10-17 14:35 UTC (permalink / raw)
To: Michael Büsch
Cc: linux-wireless, John W. Linville, David Woodhouse, b43-dev
W dniu 17 pa?dziernika 2011 16:27 u?ytkownik Michael B?sch <m@bues.ch> napisa?:
> On Sun, 16 Oct 2011 23:30:49 +0200
> Rafa? Mi?ecki <zajec5@gmail.com> 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
--
Rafa?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 3.2 REQUEST] b43: HT-PHY: report signal to mac80211
2011-10-17 14:27 ` Michael Büsch
2011-10-17 14:35 ` Rafał Miłecki
@ 2011-10-17 14:36 ` Johannes Berg
1 sibling, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2011-10-17 14:36 UTC (permalink / raw)
To: Michael Büsch
Cc: Rafał Miłecki, linux-wireless, John W. Linville,
David Woodhouse, b43-dev
On Mon, 2011-10-17 at 16:27 +0200, Michael B?sch wrote:
> On Sun, 16 Oct 2011 23:30:49 +0200
> Rafa? Mi?ecki <zajec5@gmail.com> 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?
The cast should probably be a max_t() instead.
johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-17 14:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-16 21:30 [PATCH 3.2 REQUEST] b43: HT-PHY: report signal to mac80211 Rafał Miłecki
2011-10-17 14:27 ` Michael Büsch
2011-10-17 14:35 ` Rafał Miłecki
2011-10-17 14:36 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox