wificond: Add debug logs

Unable to repro the corresponding bug. Adding logs to help debug the
issue.

Bug: 177936058
Test: Manual connection to wifi, toggle wifi off/on.
Change-Id: I88af48dbc6ee215cb6ff6c545297d434686c6c1b
This commit is contained in:
Roshan Pius 2021-01-19 15:11:05 -08:00
parent bb88c89bcb
commit fc03e50498
1 changed files with 23 additions and 3 deletions

View File

@ -128,7 +128,7 @@ Status Server::tearDownApInterface(const std::string& iface_name,
const auto iter_wi = iface_to_wiphy_index_map_.find(iface_name);
if (iter_wi != iface_to_wiphy_index_map_.end()) {
LOG(DEBUG) << "tearDownApInterface: erasing wiphy_index for iface_name " << iface_name;
LOG(INFO) << "tearDownApInterface: erasing wiphy_index for iface_name " << iface_name;
iface_to_wiphy_index_map_.erase(iter_wi);
}
@ -167,6 +167,8 @@ Status Server::createClientInterface(const std::string& iface_name,
client_interfaces_[iface_name] = std::move(client_interface);
if (hasNoIfaceForWiphyIndex(wiphy_index)) {
UpdateBandWiphyIndexMap(wiphy_index);
} else {
LOG(INFO) << "Band info for wiphy_index " << wiphy_index << " already available";
}
iface_to_wiphy_index_map_[iface_name] = wiphy_index;
@ -186,10 +188,12 @@ Status Server::tearDownClientInterface(const std::string& iface_name,
const auto iter_wi = iface_to_wiphy_index_map_.find(iface_name);
if (iter_wi != iface_to_wiphy_index_map_.end()) {
int wiphy_index = iter_wi->second;
LOG(DEBUG) << "tearDownClientInterface: erasing wiphy_index for iface_name " << iface_name;
LOG(INFO) << "tearDownClientInterface: erasing wiphy_index for iface_name " << iface_name;
iface_to_wiphy_index_map_.erase(iter_wi);
if (hasNoIfaceForWiphyIndex(wiphy_index)) {
EraseBandWiphyIndexMap(wiphy_index);
} else {
LOG(INFO) << "Band info for wiphy_index " << wiphy_index << " retained";
}
}
@ -558,6 +562,7 @@ int Server::GetWiphyIndexFromBand(int band) {
}
void Server::UpdateBandWiphyIndexMap(int wiphy_index) {
LOG(INFO) << "UpdateBandWiphyIndexMap for wiphy_index " << wiphy_index;
BandInfo band_info;
if (!GetBandInfo(wiphy_index, &band_info)) return;
@ -566,34 +571,50 @@ void Server::UpdateBandWiphyIndexMap(int wiphy_index) {
band_to_wiphy_index_map_[NL80211_BAND_2GHZ] = wiphy_index;
LOG(INFO) << "add channel type " << NL80211_BAND_2GHZ
<< " support at wiphy index: " << wiphy_index;
} else {
LOG(INFO) << "channel type " << NL80211_BAND_2GHZ
<< " not supported at wiphy index: " << wiphy_index;
}
if (band_info.band_5g.size() != 0
&& band_to_wiphy_index_map_.find(NL80211_BAND_5GHZ) == band_to_wiphy_index_map_.end()) {
band_to_wiphy_index_map_[NL80211_BAND_5GHZ] = wiphy_index;
LOG(INFO) << "add channel type " << NL80211_BAND_5GHZ
<< " support at wiphy index: " << wiphy_index;
} else {
LOG(INFO) << "channel type " << NL80211_BAND_5GHZ
<< " not supported at wiphy index: " << wiphy_index;
}
if (band_info.band_dfs.size() != 0
&& band_to_wiphy_index_map_.find(NL80211_BAND_5GHZ) == band_to_wiphy_index_map_.end()) {
band_to_wiphy_index_map_[NL80211_BAND_5GHZ] = wiphy_index;
LOG(INFO) << "add channel type " << NL80211_BAND_5GHZ
<< " support at wiphy index: " << wiphy_index;
} else {
LOG(INFO) << "channel type " << NL80211_BAND_5GHZ
<< " not supported at wiphy index: " << wiphy_index;
}
if (band_info.band_6g.size() != 0
&& band_to_wiphy_index_map_.find(NL80211_BAND_6GHZ) == band_to_wiphy_index_map_.end()) {
band_to_wiphy_index_map_[NL80211_BAND_6GHZ] = wiphy_index;
LOG(INFO) << "add channel type " << NL80211_BAND_6GHZ
<< " support at wiphy index: " << wiphy_index;
} else {
LOG(INFO) << "channel type " << NL80211_BAND_6GHZ
<< " not supported at wiphy index: " << wiphy_index;
}
if (band_info.band_60g.size() != 0
&& band_to_wiphy_index_map_.find(NL80211_BAND_60GHZ) == band_to_wiphy_index_map_.end()) {
band_to_wiphy_index_map_[NL80211_BAND_60GHZ] = wiphy_index;
LOG(INFO) << "add channel type " << NL80211_BAND_60GHZ
<< " support at wiphy index: " << wiphy_index;
} else {
LOG(INFO) << "channel type " << NL80211_BAND_60GHZ
<< " not supported at wiphy index: " << wiphy_index;
}
}
void Server::EraseBandWiphyIndexMap(int wiphy_index) {
LOG(INFO) << "EraseBandWiphyIndexMap for wiphy_index " << wiphy_index;
for (auto it = band_to_wiphy_index_map_.begin();
// end() is computed every iteration since erase() could invalidate it
it != band_to_wiphy_index_map_.end();
@ -609,6 +630,5 @@ void Server::EraseBandWiphyIndexMap(int wiphy_index) {
}
}
}
} // namespace wificond
} // namespace android