Commit 73d51f38c736ae286372e90056a7f31519f555ac

Authored by Rafał Miłecki
Committed by John W. Linville
1 parent 694718d8ad

b43: HT-PHY: report signal to mac80211

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

Showing 2 changed files with 22 additions and 1 deletions Side-by-side Diff

drivers/net/wireless/b43/xmit.c
... ... @@ -740,7 +740,14 @@
740 740  
741 741 /* Link quality statistics */
742 742 switch (chanstat & B43_RX_CHAN_PHYTYPE) {
  743 + case B43_PHYTYPE_HT:
  744 + /* TODO: is max the right choice? */
  745 + status.signal = max_t(__s8,
  746 + max(rxhdr->phy_ht_power0, rxhdr->phy_ht_power1),
  747 + rxhdr->phy_ht_power2);
  748 + break;
743 749 case B43_PHYTYPE_N:
  750 + /* Broadcom has code for min and avg, but always uses max */
744 751 if (rxhdr->power0 == 16 || rxhdr->power0 == 32)
745 752 status.signal = max(rxhdr->power1, rxhdr->power2);
746 753 else
drivers/net/wireless/b43/xmit.h
... ... @@ -249,6 +249,12 @@
249 249 } __packed;
250 250 } __packed;
251 251 union {
  252 + /* HT-PHY */
  253 + struct {
  254 + PAD_BYTES(1);
  255 + __s8 phy_ht_power0;
  256 + } __packed;
  257 +
252 258 /* RSSI for N-PHYs */
253 259 struct {
254 260 __s8 power2;
... ... @@ -257,7 +263,15 @@
257 263  
258 264 __le16 phy_status2; /* PHY RX Status 2 */
259 265 } __packed;
260   - __le16 phy_status3; /* PHY RX Status 3 */
  266 + union {
  267 + /* HT-PHY */
  268 + struct {
  269 + __s8 phy_ht_power1;
  270 + __s8 phy_ht_power2;
  271 + } __packed;
  272 +
  273 + __le16 phy_status3; /* PHY RX Status 3 */
  274 + } __packed;
261 275 union {
262 276 /* Tested with 598.314, 644.1001 and 666.2 */
263 277 struct {