Commit 60b152ce authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman

staging: rtl8723au: Fold struct wlan_phy_info into struct wlan_bssid_ex

Half the entries of struct wlan_phy_info weren't used and this makes
the code a little cleaner
Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f8cfb86e
......@@ -354,12 +354,12 @@ rtw_get_oldest_wlan_network23a(struct rtw_queue *scanned_queue)
void update_network23a(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
struct rtw_adapter *padapter, bool update_ie)
{
u8 ss_ori = dst->PhyInfo.SignalStrength;
u8 sq_ori = dst->PhyInfo.SignalQuality;
u8 ss_ori = dst->SignalStrength;
u8 sq_ori = dst->SignalQuality;
long rssi_ori = dst->Rssi;
u8 ss_smp = src->PhyInfo.SignalStrength;
u8 sq_smp = src->PhyInfo.SignalQuality;
u8 ss_smp = src->SignalStrength;
u8 sq_smp = src->SignalQuality;
long rssi_smp = src->Rssi;
u8 ss_final;
......@@ -387,16 +387,16 @@ void update_network23a(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
rssi_final = rssi_ori;
} else {
if (sq_smp != 101) { /* from the right channel */
ss_final = ((u32)src->PhyInfo.SignalStrength +
(u32)dst->PhyInfo.SignalStrength * 4) / 5;
sq_final = ((u32)src->PhyInfo.SignalQuality +
(u32)dst->PhyInfo.SignalQuality * 4) / 5;
ss_final = ((u32)src->SignalStrength +
(u32)dst->SignalStrength * 4) / 5;
sq_final = ((u32)src->SignalQuality +
(u32)dst->SignalQuality * 4) / 5;
rssi_final = src->Rssi+dst->Rssi * 4 / 5;
} else {
/* bss info not receiving from the right channel, use
the original RX signal infos */
ss_final = dst->PhyInfo.SignalStrength;
sq_final = dst->PhyInfo.SignalQuality;
ss_final = dst->SignalStrength;
sq_final = dst->SignalQuality;
rssi_final = dst->Rssi;
}
......@@ -405,14 +405,13 @@ void update_network23a(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
if (update_ie)
memcpy(dst, src, get_wlan_bssid_ex_sz(src));
dst->PhyInfo.SignalStrength = ss_final;
dst->PhyInfo.SignalQuality = sq_final;
dst->SignalStrength = ss_final;
dst->SignalQuality = sq_final;
dst->Rssi = rssi_final;
DBG_8723A("%s %s(%pM), SignalStrength:%u, SignalQuality:%u, "
"RawRSSI:%ld\n", __func__, dst->Ssid.ssid, dst->MacAddress,
dst->PhyInfo.SignalStrength,
dst->PhyInfo.SignalQuality, dst->Rssi);
dst->SignalStrength, dst->SignalQuality, dst->Rssi);
}
static void update_current_network(struct rtw_adapter *adapter,
......@@ -489,8 +488,8 @@ static void rtw_update_scanned_network(struct rtw_adapter *adapter,
pnetwork->join_res = 0;
/* bss info not receiving from the right channel */
if (pnetwork->network.PhyInfo.SignalQuality == 101)
pnetwork->network.PhyInfo.SignalQuality = 0;
if (pnetwork->network.SignalQuality == 101)
pnetwork->network.SignalQuality = 0;
} else {
/*
* we have an entry and we are going to update it. But
......@@ -1026,15 +1025,14 @@ rtw_joinbss_update_network23a(struct rtw_adapter *padapter,
rtw_set_signal_stat_timer(&padapter->recvpriv);
padapter->recvpriv.signal_strength =
ptarget_wlan->network.PhyInfo.SignalStrength;
padapter->recvpriv.signal_qual =
ptarget_wlan->network.PhyInfo.SignalQuality;
ptarget_wlan->network.SignalStrength;
padapter->recvpriv.signal_qual = ptarget_wlan->network.SignalQuality;
/*
* the ptarget_wlan->network.Rssi is raw data, we use
* ptarget_wlan->network.PhyInfo.SignalStrength instead (has scaled)
* ptarget_wlan->network.SignalStrength instead (has scaled)
*/
padapter->recvpriv.rssi = translate_percentage_to_dbm(
ptarget_wlan->network.PhyInfo.SignalStrength);
ptarget_wlan->network.SignalStrength);
DBG_8723A("%s signal_strength:%3u, rssi:%3d, signal_qual:%3u\n",
__func__, padapter->recvpriv.signal_strength,
padapter->recvpriv.rssi, padapter->recvpriv.signal_qual);
......
......@@ -4204,9 +4204,9 @@ static struct wlan_bssid_ex *collect_bss_info(struct rtw_adapter *padapter,
/* get the signal strength */
/* in dBM.raw data */
bssid->Rssi = precv_frame->attrib.phy_info.RecvSignalPower;
bssid->PhyInfo.SignalQuality =
bssid->SignalQuality =
precv_frame->attrib.phy_info.SignalQuality;/* in percentage */
bssid->PhyInfo.SignalStrength =
bssid->SignalStrength =
precv_frame->attrib.phy_info.SignalStrength;/* in percentage */
/* checking SSID */
......@@ -4313,7 +4313,7 @@ static struct wlan_bssid_ex *collect_bss_info(struct rtw_adapter *padapter,
/* mark bss info receiving from nearby channel as SignalQuality 101 */
if (bssid->DSConfig != rtw_get_oper_ch23a(padapter))
bssid->PhyInfo.SignalQuality = 101;
bssid->SignalQuality = 101;
return bssid;
fail:
......
......@@ -67,13 +67,6 @@ struct ndis_802_11_key {
u8 KeyMaterial[32]; /* variable length depending on above field */
};
struct wlan_phy_info {
u8 SignalStrength;/* in percentage) */
u8 SignalQuality;/* in percentage) */
u8 Optimum_antenna; /* for Antenna diversity */
u8 Reserved_0;
};
struct wlan_bcn_info {
/* these infor get from rtw_get_encrypt_info when
* * translate scan to UI */
......@@ -99,7 +92,8 @@ struct wlan_bssid_ex {
u32 DSConfig; /* Frequency, units are kHz */
enum nl80211_iftype ifmode;
unsigned char SupportedRates[NDIS_802_11_LENGTH_RATES_EX];
struct wlan_phy_info PhyInfo;
u8 SignalStrength;/* in percentage */
u8 SignalQuality;/* in percentage */
u32 IELength;
u8 IEs[MAX_IE_SZ]; /* timestamp, beacon interval, and capability info*/
} __packed;
......
......@@ -275,7 +275,8 @@ static int rtw_cfg80211_inform_bss(struct rtw_adapter *padapter,
&pnetwork->network)) {
notify_signal = 100 * translate_percentage_to_dbm(padapter->recvpriv.signal_strength); /* dbm */
} else {
notify_signal = 100 * translate_percentage_to_dbm(pnetwork->network.PhyInfo.SignalStrength); /* dbm */
notify_signal = 100 * translate_percentage_to_dbm(
pnetwork->network.SignalStrength); /* dbm */
}
bss = cfg80211_inform_bss(wiphy, notify_channel,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment