OSDN Git Service

Ignore getting NL80211_STA_INFO_TX_FAILED failure android-x86-8.1-r1
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 16 Nov 2018 06:43:09 +0000 (14:43 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 16 Nov 2018 06:43:09 +0000 (14:43 +0800)
Some drivers don't support it. Just ignore the error to get correct
signal strength.

Tested-by: youling257 <youling257@gmail.com>
net/netlink_utils.cpp

index 18246f7..5766e14 100644 (file)
@@ -370,8 +370,12 @@ bool NetlinkUtils::GetStationInfo(uint32_t interface_index,
     return false;
   }
   if (!sta_info.GetAttributeValue(NL80211_STA_INFO_TX_FAILED, &tx_bad)) {
-    LOG(ERROR) << "Failed to get NL80211_STA_INFO_TX_FAILED";
-    return false;
+    static bool logged = false;
+    if (!logged) {
+      PLOG(ERROR) << "Failed to get NL80211_STA_INFO_TX_FAILED";
+      logged = true;
+    }
+    tx_bad = 0;
   }
   int8_t current_rssi;
   if (!sta_info.GetAttributeValue(NL80211_STA_INFO_SIGNAL, &current_rssi)) {