staging: rtl8723au: Fold struct wlan_phy_info into struct wlan_bssid_ex
authorJes Sorensen <Jes.Sorensen@redhat.com>
Fri, 10 Oct 2014 19:41:36 +0000 (21:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:30:14 +0000 (10:30 +0800)
Half the entries of struct wlan_phy_info weren't used and this makes
the code a little cleaner

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_mlme.c
drivers/staging/rtl8723au/core/rtw_mlme_ext.c
drivers/staging/rtl8723au/include/wlan_bssdef.h
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c

index 7b6a5a9dc9b4c22ebddb3d35882cda802e7d7e4d..92bf1e415a95c205cf2178f2c3dbc380fdfc6578 100644 (file)
@@ -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);
index 9298b382b6c689706809e7f12544232a26a53014..0dd7d22eba283d77863e30f56f9fd68330ed296e 100644 (file)
@@ -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:
index 96e8074a7c188856a2ce65766bcc590364d8e2ac..037942c27d9b53b9467b02ddc9457415f84c7e88 100644 (file)
@@ -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;
index de2a3f546cfb576c2759365bb712998b51f8b581..c567df6c63212fe1bd3d28d87c7479202a13dac8 100644 (file)
@@ -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,