staging: rtl8723au: Move rtw_get_cur_max_rate23a() to ioctl_cfg80211.c
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 9 Jun 2014 13:17:03 +0000 (15:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 21:07:08 +0000 (14:07 -0700)
This function has only one caller, so move it home and declare it static

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

index e2c40a6faf0b5832020d2fe05651eb466538f3cf..b58cd9e99958b0e459ba20e07d9ca6f88103a181 100644 (file)
@@ -78,66 +78,3 @@ int rtw_set_802_11_bssid23a_list_scan(struct rtw_adapter *padapter,
 exit:
        return res;
 }
-
-/*
-* rtw_get_cur_max_rate23a -
-* @adapter: pointer to _adapter structure
-*
-* Return 0 or 100Kbps
-*/
-u16 rtw_get_cur_max_rate23a(struct rtw_adapter *adapter)
-{
-       int i = 0;
-       const u8 *p;
-       u16 rate = 0, max_rate = 0;
-       struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
-       struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-       struct registry_priv *pregistrypriv = &adapter->registrypriv;
-       struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
-       struct wlan_bssid_ex  *pcur_bss = &pmlmepriv->cur_network.network;
-       struct ieee80211_ht_cap *pht_capie;
-       u8 rf_type = 0;
-       u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0;
-       u16 mcs_rate = 0;
-
-       p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, &pcur_bss->IEs[12],
-                            pcur_bss->IELength - 12);
-       if (p && p[1] > 0) {
-               pht_capie = (struct ieee80211_ht_cap *)(p + 2);
-
-               memcpy(&mcs_rate, &pht_capie->mcs, 2);
-
-               /* bw_40MHz = (pht_capie->cap_info&
-                  IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; */
-               /* cur_bwmod is updated by beacon, pmlmeinfo is
-                  updated by association response */
-               bw_40MHz = (pmlmeext->cur_bwmode &&
-                           (pmlmeinfo->HT_info.ht_param &
-                            IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0;
-
-               /* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP
-                  _SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */
-               short_GI_20 = (pmlmeinfo->ht_cap.cap_info &
-                              cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) ? 1:0;
-               short_GI_40 = (pmlmeinfo->ht_cap.cap_info &
-                              cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) ? 1:0;
-
-               rf_type = rtl8723a_get_rf_type(adapter);
-               max_rate = rtw_mcs_rate23a(rf_type, bw_40MHz &
-                                          pregistrypriv->cbw40_enable,
-                                          short_GI_20, short_GI_40,
-                                          &pmlmeinfo->ht_cap.mcs);
-       } else {
-               while (pcur_bss->SupportedRates[i] != 0 &&
-                      pcur_bss->SupportedRates[i] != 0xFF) {
-                       rate = pcur_bss->SupportedRates[i] & 0x7F;
-                       if (rate>max_rate)
-                               max_rate = rate;
-                       i++;
-               }
-
-               max_rate = max_rate * 10 / 2;
-       }
-
-       return max_rate;
-}
index e84a422864007595f74929472e7b32e8d47ed42f..855fc40bae253510f0e370d8036d5f31895d598f 100644 (file)
@@ -21,7 +21,6 @@ int rtw_set_802_11_bssid23a_list_scan(struct rtw_adapter *padapter,
                                      struct cfg80211_ssid *pssid,
                                      int ssid_max_num);
 
-u16 rtw_get_cur_max_rate23a(struct rtw_adapter *adapter);
 s32 FillH2CCmd(struct rtw_adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
 
 #endif
index e75e078425c7aefc5d4336accb83966e5d71eff1..a29718db68aa6a9a4eb43fd1287fcb6c35795d6f 100644 (file)
@@ -1223,6 +1223,63 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
        return 0;
 }
 
+static u16 rtw_get_cur_max_rate(struct rtw_adapter *adapter)
+{
+       int i = 0;
+       const u8 *p;
+       u16 rate = 0, max_rate = 0;
+       struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
+       struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
+       struct registry_priv *pregistrypriv = &adapter->registrypriv;
+       struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
+       struct wlan_bssid_ex  *pcur_bss = &pmlmepriv->cur_network.network;
+       struct ieee80211_ht_cap *pht_capie;
+       u8 rf_type = 0;
+       u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0;
+       u16 mcs_rate = 0;
+
+       p = cfg80211_find_ie(WLAN_EID_HT_CAPABILITY, &pcur_bss->IEs[12],
+                            pcur_bss->IELength - 12);
+       if (p && p[1] > 0) {
+               pht_capie = (struct ieee80211_ht_cap *)(p + 2);
+
+               memcpy(&mcs_rate, &pht_capie->mcs, 2);
+
+               /* bw_40MHz = (pht_capie->cap_info&
+                  IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; */
+               /* cur_bwmod is updated by beacon, pmlmeinfo is
+                  updated by association response */
+               bw_40MHz = (pmlmeext->cur_bwmode &&
+                           (pmlmeinfo->HT_info.ht_param &
+                            IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) ? 1:0;
+
+               /* short_GI = (pht_capie->cap_info & (IEEE80211_HT_CAP
+                  _SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1 : 0; */
+               short_GI_20 = (pmlmeinfo->ht_cap.cap_info &
+                              cpu_to_le16(IEEE80211_HT_CAP_SGI_20)) ? 1:0;
+               short_GI_40 = (pmlmeinfo->ht_cap.cap_info &
+                              cpu_to_le16(IEEE80211_HT_CAP_SGI_40)) ? 1:0;
+
+               rf_type = rtl8723a_get_rf_type(adapter);
+               max_rate = rtw_mcs_rate23a(rf_type, bw_40MHz &
+                                          pregistrypriv->cbw40_enable,
+                                          short_GI_20, short_GI_40,
+                                          &pmlmeinfo->ht_cap.mcs);
+       } else {
+               while (pcur_bss->SupportedRates[i] != 0 &&
+                      pcur_bss->SupportedRates[i] != 0xFF) {
+                       rate = pcur_bss->SupportedRates[i] & 0x7F;
+                       if (rate>max_rate)
+                               max_rate = rate;
+                       i++;
+               }
+
+               max_rate = max_rate * 10 / 2;
+       }
+
+       return max_rate;
+}
+
 static int cfg80211_rtw_get_station(struct wiphy *wiphy,
                                    struct net_device *ndev,
                                    const u8 *mac, struct station_info *sinfo)
@@ -1267,7 +1324,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
                                                            signal_strength);
 
                sinfo->filled |= STATION_INFO_TX_BITRATE;
-               sinfo->txrate.legacy = rtw_get_cur_max_rate23a(padapter);
+               sinfo->txrate.legacy = rtw_get_cur_max_rate(padapter);
 
                sinfo->filled |= STATION_INFO_RX_PACKETS;
                sinfo->rx_packets = sta_rx_data_pkts(psta);