carl9170: fix bad rssi reading
PATCH 1/1 carl9170: fix bad rssi reading
Fix rssi calculation error which was introduced in otus to ar9170 porting.
--- drivers/net/wireless/ath/carl9170/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/carl9170/rx.c +1 -1
@@ -453,7 +453,7 @@ static void carl9170_rx_phy_status(struct ar9170 *ar,/* post-process RSSI */ for (i =0 ; i <7 ; i++)if (phy->rssi[i] &0x80 ) - phy->rssi[i] = ((phy->rssi[i] &0x7f ) +1 ) &0x7f ; + phy->rssi[i] = ((~phy->rssi[i] &0x7f ) +1 ) &0x7f ;/* TODO: we could do something with phy_errors */ status->signal = ar->noise[0 ] + phy->rssi_combined;
Signature · 1 line
2.5.1
Quoted 4 lines · Hiroaki KAWAI
Fix rssi calculation error which was introduced in otus to ar9170 porting.
Signed-off-by Hiroaki KAWAI <[email protected]>
For reference: Here's the line in the original otus code:
<http://lxr.free-electrons.com/source/drivers/staging/otus/hal/hpusb.c?v=2.6.33#L818>
This value/result isn't used anywhere, so we could also remove it.
Quoted 18 lines
--- drivers/net/wireless/ath/carl9170/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/wireless/ath/carl9170/rx.c +1
-1@@ -453,7 +453,7 @@ static void carl9170_rx_phy_status(struct ar9170 *ar,/* post-process RSSI */ for (i =0 ; i <7 ; i++)if (phy->rssi[i] &0x80 ) - phy->rssi[i] = ((phy->rssi[i] &0x7f ) +1 ) &0x7f ; + phy->rssi[i] = ((~phy->rssi[i] &0x7f ) +1 ) &0x7f ;/* TODO: we could do something with phy_errors */ status->signal = ar->noise[0 ] + phy->rssi_combined;
That field is union and referenced as rssi_combined at two lines below.
The status->signal will show up in radiotap IEEE80211_RADIOTAP_DBM_ANTSIGNAL header field at userland finally.
2015-09-10 22:07 GMT+09:00 Christian Lamparter <[email protected]>:
Quoted 31 lines · Hiroaki KAWAI
Quoted 4 lines
Fix rssi calculation error which was introduced in otus to ar9170 porting.
Signed-off-by Hiroaki KAWAI <[email protected]>For reference: Here's the line in the original otus code:
<http://lxr.free-electrons.com/source/drivers/staging/otus/hal/hpusb.c?v=2.6.33#L818>This value/result isn't used anywhere, so we could also remove it.
Quoted 18 lines
--- drivers/net/wireless/ath/carl9170/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/wireless/ath/carl9170/rx.c +1
-1@@ -453,7 +453,7 @@ static void carl9170_rx_phy_status(struct ar9170 *ar,/* post-process RSSI */ for (i =0 ; i <7 ; i++)if (phy->rssi[i] &0x80 ) - phy->rssi[i] = ((phy->rssi[i] &0x7f ) +1 ) &0x7f ; + phy->rssi[i] = ((~phy->rssi[i] &0x7f ) +1 ) &0x7f ;/* TODO: we could do something with phy_errors */ status->signal = ar->noise[0 ] + phy->rssi_combined;
A message that is not in the archive (sent off-list or not yet received): CABD3darfGTc8gVgAo4j7S4M0uymoF2gy8ihLraN2qcXJFO9cWw@mail.gmail.com
Christian Lamparter
maintainerQuoted 1 line · Hiroaki Kawai
That field is union and referenced as
rssi_combinedat two lines below.
Correct
Quoted 3 lines
The
status->signalwill show up in radiotapIEEE80211_RADIOTAP_DBM_ANTSIGNAL
header field at userland finally.
so, this patch should go to -stable too.
Thanks
Quoted 21 lines
Quoted 21 lines
Review
Quoted 5 lines
--- drivers/net/wireless/ath/carl9170/rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/net/wireless/ath/carl9170/rx.cQuoted 13 lines
index 924135b..d66533c 100644
drivers/net/wireless/ath/carl9170/rx.c +1
-1@@ -453,7 +453,7 @@ static void carl9170_rx_phy_status(struct ar9170 *ar,/* post-process RSSI */ for (i =0 ; i <7 ; i++)if (phy->rssi[i] &0x80 ) - phy->rssi[i] = ((phy->rssi[i] &0x7f ) +1 ) &0x7f ; + phy->rssi[i] = ((~phy->rssi[i] &0x7f ) +1 ) &0x7f ;/* TODO: we could do something with phy_errors */ status->signal = ar->noise[0 ] + phy->rssi_combined;
Kalle Valo
AppliedQuoted 6 lines
Fix rssi calculation error which was introduced in otus to ar9170 porting.
Signed-off-by Hiroaki KAWAI <[email protected]>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo