static void CFG80211_UpdateBssTableRssi( IN VOID *pAdCB) { PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdCB; CFG80211_CB *pCfg80211_CB = (CFG80211_CB *)pAd->pCfg80211_CB; struct wiphy *pWiphy = pCfg80211_CB->pCfg80211_Wdev->wiphy; struct ieee80211_channel *chan; struct cfg80211_bss *bss; BSS_ENTRY *pBssEntry; UINT index; UINT32 CenFreq; for (index = 0; index < pAd->ScanTab.BssNr; index++) { pBssEntry = &pAd->ScanTab.BssEntry[index]; #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) if (pAd->ScanTab.BssEntry[index].Channel > 14) CenFreq = ieee80211_channel_to_frequency(pAd->ScanTab.BssEntry[index].Channel , IEEE80211_BAND_5GHZ); else CenFreq = ieee80211_channel_to_frequency(pAd->ScanTab.BssEntry[index].Channel , IEEE80211_BAND_2GHZ); #else CenFreq = ieee80211_channel_to_frequency(pAd->ScanTab.BssEntry[index].Channel); #endif chan = ieee80211_get_channel(pWiphy, CenFreq); bss = cfg80211_get_bss(pWiphy, chan, pBssEntry->Bssid, pBssEntry->Ssid, pBssEntry->SsidLen, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); if (bss == NULL) { /* ScanTable Entry not exist in kernel buffer */ } else { /* HIT */ CFG80211_CalBssAvgRssi(pBssEntry); bss->signal = pBssEntry->AvgRssi * 100; //UNIT: MdBm #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) cfg80211_put_bss(pWiphy, bss); #else cfg80211_put_bss(bss); #endif /* LINUX_VERSION_CODE: 3.9.0 */ } } }
static void CFG80211_UpdateBssTableRssi( IN struct rtmp_adapter *pAd) { struct mt7612u_cfg80211_cb *pCfg80211_CB = (struct mt7612u_cfg80211_cb *)pAd->pCfg80211_CB; struct wiphy *pWiphy = pCfg80211_CB->pCfg80211_Wdev->wiphy; struct ieee80211_channel *chan; struct cfg80211_bss *bss; BSS_ENTRY *pBssEntry; UINT index; uint32_t CenFreq; for (index = 0; index < pAd->ScanTab.BssNr; index++) { pBssEntry = &pAd->ScanTab.BssEntry[index]; if (pAd->ScanTab.BssEntry[index].Channel > 14) CenFreq = ieee80211_channel_to_frequency(pAd->ScanTab.BssEntry[index].Channel , NL80211_BAND_5GHZ); else CenFreq = ieee80211_channel_to_frequency(pAd->ScanTab.BssEntry[index].Channel , NL80211_BAND_2GHZ); chan = ieee80211_get_channel(pWiphy, CenFreq); bss = cfg80211_get_bss(pWiphy, chan, pBssEntry->Bssid, pBssEntry->Ssid, pBssEntry->SsidLen, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS); if (bss == NULL) { /* ScanTable Entry not exist in kernel buffer */ } else { /* HIT */ CFG80211_CalBssAvgRssi(pBssEntry); bss->signal = pBssEntry->AvgRssi * 100; //UNIT: MdBm cfg80211_put_bss(pWiphy, bss); } } }