diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2014-09-22 10:39:24 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-09-26 17:22:28 -0400 |
commit | f3a97e93814aeac3f13e857a0071726acc9bd626 (patch) | |
tree | d40ca34385855d9fd9a14af52ec1f699111d13ef | |
parent | d3feae41a3473a0f7b431d6af4e092865d586e52 (diff) |
rtlwifi: Finish modifying core routines for new drivers
Addition of the new drivers and the update to a new version for the others
lead to changes in all the core routines.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/rtlwifi/debug.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/debug.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rc.c | 97 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rc.h | 9 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/regd.c | 108 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/regd.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/stats.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/stats.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/wifi.h | 5 |
9 files changed, 174 insertions, 133 deletions
diff --git a/drivers/net/wireless/rtlwifi/debug.c b/drivers/net/wireless/rtlwifi/debug.c index 76e2086e137e..fd25abad2b9e 100644 --- a/drivers/net/wireless/rtlwifi/debug.c +++ b/drivers/net/wireless/rtlwifi/debug.c | |||
@@ -2,20 +2,16 @@ | |||
2 | * | 2 | * |
3 | * Copyright(c) 2009-2012 Realtek Corporation. | 3 | * Copyright(c) 2009-2012 Realtek Corporation. |
4 | * | 4 | * |
5 | * Tmis program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of version 2 of the GNU General Public License as | 6 | * under the terms of version 2 of the GNU General Public License as |
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | * | 8 | * |
9 | * Tmis program is distributed in the hope that it will be useful, but WITHOUT | 9 | * This program is distributed in the hope that it will be useful, but WITHOUT |
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License along with | 14 | * The full GNU General Public License is included in this distribution in the |
15 | * tmis program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * Tme full GNU General Public License is included in this distribution in the | ||
19 | * file called LICENSE. | 15 | * file called LICENSE. |
20 | * | 16 | * |
21 | * Contact Information: | 17 | * Contact Information: |
diff --git a/drivers/net/wireless/rtlwifi/debug.h b/drivers/net/wireless/rtlwifi/debug.h index 6d669364e3d9..534c224440e1 100644 --- a/drivers/net/wireless/rtlwifi/debug.h +++ b/drivers/net/wireless/rtlwifi/debug.h | |||
@@ -2,20 +2,16 @@ | |||
2 | * | 2 | * |
3 | * Copyright(c) 2009-2012 Realtek Corporation. | 3 | * Copyright(c) 2009-2012 Realtek Corporation. |
4 | * | 4 | * |
5 | * Tmis program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of version 2 of the GNU General Public License as | 6 | * under the terms of version 2 of the GNU General Public License as |
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | * | 8 | * |
9 | * Tmis program is distributed in the hope that it will be useful, but WITHOUT | 9 | * This program is distributed in the hope that it will be useful, but WITHOUT |
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License along with | 14 | * The full GNU General Public License is included in this distribution in the |
15 | * tmis program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * Tme full GNU General Public License is included in this distribution in the | ||
19 | * file called LICENSE. | 15 | * file called LICENSE. |
20 | * | 16 | * |
21 | * Contact Information: | 17 | * Contact Information: |
diff --git a/drivers/net/wireless/rtlwifi/rc.c b/drivers/net/wireless/rtlwifi/rc.c index ee28a1a3d010..7863bd278b22 100644 --- a/drivers/net/wireless/rtlwifi/rc.c +++ b/drivers/net/wireless/rtlwifi/rc.c | |||
@@ -11,10 +11,6 @@ | |||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | 14 | * The full GNU General Public License is included in this distribution in the |
19 | * file called LICENSE. | 15 | * file called LICENSE. |
20 | * | 16 | * |
@@ -35,13 +31,13 @@ | |||
35 | *Finds the highest rate index we can use | 31 | *Finds the highest rate index we can use |
36 | *if skb is special data like DHCP/EAPOL, we set should | 32 | *if skb is special data like DHCP/EAPOL, we set should |
37 | *it to lowest rate CCK_1M, otherwise we set rate to | 33 | *it to lowest rate CCK_1M, otherwise we set rate to |
38 | *CCK11M or OFDM_54M based on wireless mode. | 34 | *highest rate based on wireless mode used for iwconfig |
35 | *show Tx rate. | ||
39 | */ | 36 | */ |
40 | static u8 _rtl_rc_get_highest_rix(struct rtl_priv *rtlpriv, | 37 | static u8 _rtl_rc_get_highest_rix(struct rtl_priv *rtlpriv, |
41 | struct ieee80211_sta *sta, | 38 | struct ieee80211_sta *sta, |
42 | struct sk_buff *skb, bool not_data) | 39 | struct sk_buff *skb, bool not_data) |
43 | { | 40 | { |
44 | struct rtl_mac *rtlmac = rtl_mac(rtlpriv); | ||
45 | struct rtl_hal *rtlhal = rtl_hal(rtlpriv); | 41 | struct rtl_hal *rtlhal = rtl_hal(rtlpriv); |
46 | struct rtl_phy *rtlphy = &(rtlpriv->phy); | 42 | struct rtl_phy *rtlphy = &(rtlpriv->phy); |
47 | struct rtl_sta_info *sta_entry = NULL; | 43 | struct rtl_sta_info *sta_entry = NULL; |
@@ -54,21 +50,13 @@ static u8 _rtl_rc_get_highest_rix(struct rtl_priv *rtlpriv, | |||
54 | *2.in rtl_get_tcb_desc when we check rate is | 50 | *2.in rtl_get_tcb_desc when we check rate is |
55 | * 1M we will not use FW rate but user rate. | 51 | * 1M we will not use FW rate but user rate. |
56 | */ | 52 | */ |
57 | if (rtlmac->opmode == NL80211_IFTYPE_AP || | 53 | |
58 | rtlmac->opmode == NL80211_IFTYPE_ADHOC || | 54 | if (sta) { |
59 | rtlmac->opmode == NL80211_IFTYPE_MESH_POINT) { | 55 | sta_entry = (struct rtl_sta_info *)sta->drv_priv; |
60 | if (sta) { | 56 | wireless_mode = sta_entry->wireless_mode; |
61 | sta_entry = (struct rtl_sta_info *) sta->drv_priv; | ||
62 | wireless_mode = sta_entry->wireless_mode; | ||
63 | } else { | ||
64 | return 0; | ||
65 | } | ||
66 | } else { | ||
67 | wireless_mode = rtlmac->mode; | ||
68 | } | 57 | } |
69 | 58 | ||
70 | if (rtl_is_special_data(rtlpriv->mac80211.hw, skb, true) || | 59 | if (rtl_is_special_data(rtlpriv->mac80211.hw, skb, true) || not_data) { |
71 | not_data) { | ||
72 | return 0; | 60 | return 0; |
73 | } else { | 61 | } else { |
74 | if (rtlhal->current_bandtype == BAND_ON_2_4G) { | 62 | if (rtlhal->current_bandtype == BAND_ON_2_4G) { |
@@ -76,21 +64,27 @@ static u8 _rtl_rc_get_highest_rix(struct rtl_priv *rtlpriv, | |||
76 | return B_MODE_MAX_RIX; | 64 | return B_MODE_MAX_RIX; |
77 | } else if (wireless_mode == WIRELESS_MODE_G) { | 65 | } else if (wireless_mode == WIRELESS_MODE_G) { |
78 | return G_MODE_MAX_RIX; | 66 | return G_MODE_MAX_RIX; |
79 | } else { | 67 | } else if (wireless_mode == WIRELESS_MODE_N_24G) { |
80 | if (get_rf_type(rtlphy) != RF_2T2R) | 68 | if (get_rf_type(rtlphy) != RF_2T2R) |
81 | return N_MODE_MCS7_RIX; | 69 | return N_MODE_MCS7_RIX; |
82 | else | 70 | else |
83 | return N_MODE_MCS15_RIX; | 71 | return N_MODE_MCS15_RIX; |
72 | } else if (wireless_mode == WIRELESS_MODE_AC_24G) { | ||
73 | return AC_MODE_MCS9_RIX; | ||
84 | } | 74 | } |
75 | return 0; | ||
85 | } else { | 76 | } else { |
86 | if (wireless_mode == WIRELESS_MODE_A) { | 77 | if (wireless_mode == WIRELESS_MODE_A) { |
87 | return A_MODE_MAX_RIX; | 78 | return A_MODE_MAX_RIX; |
88 | } else { | 79 | } else if (wireless_mode == WIRELESS_MODE_N_5G) { |
89 | if (get_rf_type(rtlphy) != RF_2T2R) | 80 | if (get_rf_type(rtlphy) != RF_2T2R) |
90 | return N_MODE_MCS7_RIX; | 81 | return N_MODE_MCS7_RIX; |
91 | else | 82 | else |
92 | return N_MODE_MCS15_RIX; | 83 | return N_MODE_MCS15_RIX; |
84 | } else if (wireless_mode == WIRELESS_MODE_AC_5G) { | ||
85 | return AC_MODE_MCS9_RIX; | ||
93 | } | 86 | } |
87 | return 0; | ||
94 | } | 88 | } |
95 | } | 89 | } |
96 | } | 90 | } |
@@ -103,35 +97,52 @@ static void _rtl_rc_rate_set_series(struct rtl_priv *rtlpriv, | |||
103 | bool not_data) | 97 | bool not_data) |
104 | { | 98 | { |
105 | struct rtl_mac *mac = rtl_mac(rtlpriv); | 99 | struct rtl_mac *mac = rtl_mac(rtlpriv); |
106 | u8 sgi_20 = 0, sgi_40 = 0; | 100 | struct rtl_sta_info *sta_entry = NULL; |
101 | u8 wireless_mode = 0; | ||
102 | u8 sgi_20 = 0, sgi_40 = 0, sgi_80 = 0; | ||
107 | 103 | ||
108 | if (sta) { | 104 | if (sta) { |
109 | sgi_20 = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20; | 105 | sgi_20 = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20; |
110 | sgi_40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40; | 106 | sgi_40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40; |
107 | sgi_80 = sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80; | ||
108 | sta_entry = (struct rtl_sta_info *)sta->drv_priv; | ||
109 | wireless_mode = sta_entry->wireless_mode; | ||
111 | } | 110 | } |
112 | rate->count = tries; | 111 | rate->count = tries; |
113 | rate->idx = rix >= 0x00 ? rix : 0x00; | 112 | rate->idx = rix >= 0x00 ? rix : 0x00; |
113 | if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8812AE && | ||
114 | wireless_mode == WIRELESS_MODE_AC_5G) | ||
115 | rate->idx += 0x10;/*2NSS for 8812AE*/ | ||
114 | 116 | ||
115 | if (!not_data) { | 117 | if (!not_data) { |
116 | if (txrc->short_preamble) | 118 | if (txrc->short_preamble) |
117 | rate->flags |= IEEE80211_TX_RC_USE_SHORT_PREAMBLE; | 119 | rate->flags |= IEEE80211_TX_RC_USE_SHORT_PREAMBLE; |
118 | if (mac->opmode == NL80211_IFTYPE_AP || | 120 | if (mac->opmode == NL80211_IFTYPE_AP || |
119 | mac->opmode == NL80211_IFTYPE_ADHOC) { | 121 | mac->opmode == NL80211_IFTYPE_ADHOC) { |
120 | if (sta && (sta->bandwidth >= IEEE80211_STA_RX_BW_40)) | 122 | if (sta && (sta->ht_cap.cap & |
123 | IEEE80211_HT_CAP_SUP_WIDTH_20_40)) | ||
121 | rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; | 124 | rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; |
125 | if (sta && (sta->vht_cap.vht_supported)) | ||
126 | rate->flags |= IEEE80211_TX_RC_80_MHZ_WIDTH; | ||
122 | } else { | 127 | } else { |
123 | if (mac->bw_40) | 128 | if (mac->bw_40) |
124 | rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; | 129 | rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH; |
130 | if (mac->bw_80) | ||
131 | rate->flags |= IEEE80211_TX_RC_80_MHZ_WIDTH; | ||
125 | } | 132 | } |
126 | if (sgi_20 || sgi_40) | 133 | |
134 | if (sgi_20 || sgi_40 || sgi_80) | ||
127 | rate->flags |= IEEE80211_TX_RC_SHORT_GI; | 135 | rate->flags |= IEEE80211_TX_RC_SHORT_GI; |
128 | if (sta && sta->ht_cap.ht_supported) | 136 | if (sta && sta->ht_cap.ht_supported && |
137 | ((wireless_mode == WIRELESS_MODE_N_5G) || | ||
138 | (wireless_mode == WIRELESS_MODE_N_24G))) | ||
129 | rate->flags |= IEEE80211_TX_RC_MCS; | 139 | rate->flags |= IEEE80211_TX_RC_MCS; |
130 | } | 140 | } |
131 | } | 141 | } |
132 | 142 | ||
133 | static void rtl_get_rate(void *ppriv, struct ieee80211_sta *sta, | 143 | static void rtl_get_rate(void *ppriv, struct ieee80211_sta *sta, |
134 | void *priv_sta, struct ieee80211_tx_rate_control *txrc) | 144 | void *priv_sta, |
145 | struct ieee80211_tx_rate_control *txrc) | ||
135 | { | 146 | { |
136 | struct rtl_priv *rtlpriv = ppriv; | 147 | struct rtl_priv *rtlpriv = ppriv; |
137 | struct sk_buff *skb = txrc->skb; | 148 | struct sk_buff *skb = txrc->skb; |
@@ -158,7 +169,7 @@ static void rtl_get_rate(void *ppriv, struct ieee80211_sta *sta, | |||
158 | } | 169 | } |
159 | 170 | ||
160 | static bool _rtl_tx_aggr_check(struct rtl_priv *rtlpriv, | 171 | static bool _rtl_tx_aggr_check(struct rtl_priv *rtlpriv, |
161 | struct rtl_sta_info *sta_entry, u16 tid) | 172 | struct rtl_sta_info *sta_entry, u16 tid) |
162 | { | 173 | { |
163 | struct rtl_mac *mac = rtl_mac(rtlpriv); | 174 | struct rtl_mac *mac = rtl_mac(rtlpriv); |
164 | 175 | ||
@@ -166,7 +177,7 @@ static bool _rtl_tx_aggr_check(struct rtl_priv *rtlpriv, | |||
166 | return false; | 177 | return false; |
167 | 178 | ||
168 | if (mac->opmode == NL80211_IFTYPE_STATION && | 179 | if (mac->opmode == NL80211_IFTYPE_STATION && |
169 | mac->cnt_after_linked < 3) | 180 | mac->cnt_after_linked < 3) |
170 | return false; | 181 | return false; |
171 | 182 | ||
172 | if (sta_entry->tids[tid].agg.agg_state == RTL_AGG_STOP) | 183 | if (sta_entry->tids[tid].agg.agg_state == RTL_AGG_STOP) |
@@ -193,23 +204,23 @@ static void rtl_tx_status(void *ppriv, | |||
193 | if (rtl_is_special_data(mac->hw, skb, true)) | 204 | if (rtl_is_special_data(mac->hw, skb, true)) |
194 | return; | 205 | return; |
195 | 206 | ||
196 | if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) | 207 | if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) || |
197 | || is_broadcast_ether_addr(ieee80211_get_DA(hdr))) | 208 | is_broadcast_ether_addr(ieee80211_get_DA(hdr))) |
198 | return; | 209 | return; |
199 | 210 | ||
200 | if (sta) { | 211 | if (sta) { |
201 | /* Check if aggregation has to be enabled for this tid */ | 212 | /* Check if aggregation has to be enabled for this tid */ |
202 | sta_entry = (struct rtl_sta_info *) sta->drv_priv; | 213 | sta_entry = (struct rtl_sta_info *) sta->drv_priv; |
203 | if ((sta->ht_cap.ht_supported) && | 214 | if ((sta->ht_cap.ht_supported) && |
204 | !(skb->protocol == cpu_to_be16(ETH_P_PAE))) { | 215 | !(skb->protocol == cpu_to_be16(ETH_P_PAE))) { |
205 | if (ieee80211_is_data_qos(fc)) { | 216 | if (ieee80211_is_data_qos(fc)) { |
206 | u8 tid = rtl_get_tid(skb); | 217 | u8 tid = rtl_get_tid(skb); |
207 | if (_rtl_tx_aggr_check(rtlpriv, sta_entry, | 218 | if (_rtl_tx_aggr_check(rtlpriv, sta_entry, |
208 | tid)) { | 219 | tid)) { |
209 | sta_entry->tids[tid].agg.agg_state = | 220 | sta_entry->tids[tid].agg.agg_state = |
210 | RTL_AGG_PROGRESS; | 221 | RTL_AGG_PROGRESS; |
211 | ieee80211_start_tx_ba_session(sta, | 222 | ieee80211_start_tx_ba_session(sta, tid, |
212 | tid, 5000); | 223 | 5000); |
213 | } | 224 | } |
214 | } | 225 | } |
215 | } | 226 | } |
@@ -223,8 +234,15 @@ static void rtl_rate_init(void *ppriv, | |||
223 | { | 234 | { |
224 | } | 235 | } |
225 | 236 | ||
226 | static void *rtl_rate_alloc(struct ieee80211_hw *hw, | 237 | static void rtl_rate_update(void *ppriv, |
227 | struct dentry *debugfsdir) | 238 | struct ieee80211_supported_band *sband, |
239 | struct cfg80211_chan_def *chandef, | ||
240 | struct ieee80211_sta *sta, void *priv_sta, | ||
241 | u32 changed) | ||
242 | { | ||
243 | } | ||
244 | |||
245 | static void *rtl_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) | ||
228 | { | 246 | { |
229 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 247 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
230 | return rtlpriv; | 248 | return rtlpriv; |
@@ -260,13 +278,14 @@ static void rtl_rate_free_sta(void *rtlpriv, | |||
260 | kfree(rate_priv); | 278 | kfree(rate_priv); |
261 | } | 279 | } |
262 | 280 | ||
263 | static const struct rate_control_ops rtl_rate_ops = { | 281 | static struct rate_control_ops rtl_rate_ops = { |
264 | .name = "rtl_rc", | 282 | .name = "rtl_rc", |
265 | .alloc = rtl_rate_alloc, | 283 | .alloc = rtl_rate_alloc, |
266 | .free = rtl_rate_free, | 284 | .free = rtl_rate_free, |
267 | .alloc_sta = rtl_rate_alloc_sta, | 285 | .alloc_sta = rtl_rate_alloc_sta, |
268 | .free_sta = rtl_rate_free_sta, | 286 | .free_sta = rtl_rate_free_sta, |
269 | .rate_init = rtl_rate_init, | 287 | .rate_init = rtl_rate_init, |
288 | .rate_update = rtl_rate_update, | ||
270 | .tx_status = rtl_tx_status, | 289 | .tx_status = rtl_tx_status, |
271 | .get_rate = rtl_get_rate, | 290 | .get_rate = rtl_get_rate, |
272 | }; | 291 | }; |
diff --git a/drivers/net/wireless/rtlwifi/rc.h b/drivers/net/wireless/rtlwifi/rc.h index 4d6176160610..f29643d60d6b 100644 --- a/drivers/net/wireless/rtlwifi/rc.h +++ b/drivers/net/wireless/rtlwifi/rc.h | |||
@@ -11,10 +11,6 @@ | |||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | 14 | * The full GNU General Public License is included in this distribution in the |
19 | * file called LICENSE. | 15 | * file called LICENSE. |
20 | * | 16 | * |
@@ -38,10 +34,15 @@ | |||
38 | #define N_MODE_MCS7_RIX 7 | 34 | #define N_MODE_MCS7_RIX 7 |
39 | #define N_MODE_MCS15_RIX 15 | 35 | #define N_MODE_MCS15_RIX 15 |
40 | 36 | ||
37 | #define AC_MODE_MCS7_RIX 7 | ||
38 | #define AC_MODE_MCS8_RIX 8 | ||
39 | #define AC_MODE_MCS9_RIX 9 | ||
40 | |||
41 | struct rtl_rate_priv { | 41 | struct rtl_rate_priv { |
42 | u8 ht_cap; | 42 | u8 ht_cap; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | int rtl_rate_control_register(void); | 45 | int rtl_rate_control_register(void); |
46 | void rtl_rate_control_unregister(void); | 46 | void rtl_rate_control_unregister(void); |
47 | |||
47 | #endif | 48 | #endif |
diff --git a/drivers/net/wireless/rtlwifi/regd.c b/drivers/net/wireless/rtlwifi/regd.c index a4eb9b271438..1893d01b9e78 100644 --- a/drivers/net/wireless/rtlwifi/regd.c +++ b/drivers/net/wireless/rtlwifi/regd.c | |||
@@ -11,10 +11,6 @@ | |||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | 14 | * The full GNU General Public License is included in this distribution in the |
19 | * file called LICENSE. | 15 | * file called LICENSE. |
20 | * | 16 | * |
@@ -59,26 +55,23 @@ static struct country_code_to_enum_rd allCountries[] = { | |||
59 | */ | 55 | */ |
60 | #define RTL819x_2GHZ_CH12_13 \ | 56 | #define RTL819x_2GHZ_CH12_13 \ |
61 | REG_RULE(2467-10, 2472+10, 40, 0, 20,\ | 57 | REG_RULE(2467-10, 2472+10, 40, 0, 20,\ |
62 | NL80211_RRF_NO_IR) | 58 | NL80211_RRF_PASSIVE_SCAN) |
63 | 59 | ||
64 | #define RTL819x_2GHZ_CH14 \ | 60 | #define RTL819x_2GHZ_CH14 \ |
65 | REG_RULE(2484-10, 2484+10, 40, 0, 20, \ | 61 | REG_RULE(2484-10, 2484+10, 40, 0, 20, \ |
66 | NL80211_RRF_NO_IR | NL80211_RRF_NO_OFDM) | 62 | NL80211_RRF_PASSIVE_SCAN | \ |
63 | NL80211_RRF_NO_OFDM) | ||
64 | |||
67 | 65 | ||
68 | /* 5G chan 36 - chan 64*/ | 66 | /* 5G chan 36 - chan 64*/ |
69 | #define RTL819x_5GHZ_5150_5350 \ | 67 | #define RTL819x_5GHZ_5150_5350 \ |
70 | REG_RULE(5150-10, 5350+10, 40, 0, 30, \ | 68 | REG_RULE(5150-10, 5350+10, 80, 0, 30, 0) |
71 | NL80211_RRF_NO_IR) | ||
72 | |||
73 | /* 5G chan 100 - chan 165*/ | 69 | /* 5G chan 100 - chan 165*/ |
74 | #define RTL819x_5GHZ_5470_5850 \ | 70 | #define RTL819x_5GHZ_5470_5850 \ |
75 | REG_RULE(5470-10, 5850+10, 40, 0, 30, \ | 71 | REG_RULE(5470-10, 5850+10, 80, 0, 30, 0) |
76 | NL80211_RRF_NO_IR) | ||
77 | |||
78 | /* 5G chan 149 - chan 165*/ | 72 | /* 5G chan 149 - chan 165*/ |
79 | #define RTL819x_5GHZ_5725_5850 \ | 73 | #define RTL819x_5GHZ_5725_5850 \ |
80 | REG_RULE(5725-10, 5850+10, 40, 0, 30, \ | 74 | REG_RULE(5725-10, 5850+10, 80, 0, 30, 0) |
81 | NL80211_RRF_NO_IR) | ||
82 | 75 | ||
83 | #define RTL819x_5GHZ_ALL \ | 76 | #define RTL819x_5GHZ_ALL \ |
84 | (RTL819x_5GHZ_5150_5350, RTL819x_5GHZ_5470_5850) | 77 | (RTL819x_5GHZ_5150_5350, RTL819x_5GHZ_5470_5850) |
@@ -143,7 +136,7 @@ static const struct ieee80211_regdomain rtl_regdom_14 = { | |||
143 | 136 | ||
144 | static bool _rtl_is_radar_freq(u16 center_freq) | 137 | static bool _rtl_is_radar_freq(u16 center_freq) |
145 | { | 138 | { |
146 | return (center_freq >= 5260 && center_freq <= 5700); | 139 | return center_freq >= 5260 && center_freq <= 5700; |
147 | } | 140 | } |
148 | 141 | ||
149 | static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy, | 142 | static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy, |
@@ -169,10 +162,9 @@ static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy, | |||
169 | continue; | 162 | continue; |
170 | if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { | 163 | if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE) { |
171 | reg_rule = freq_reg_info(wiphy, | 164 | reg_rule = freq_reg_info(wiphy, |
172 | MHZ_TO_KHZ(ch->center_freq)); | 165 | ch->center_freq); |
173 | if (IS_ERR(reg_rule)) | 166 | if (IS_ERR(reg_rule)) |
174 | continue; | 167 | continue; |
175 | |||
176 | /* | 168 | /* |
177 | *If 11d had a rule for this channel ensure | 169 | *If 11d had a rule for this channel ensure |
178 | *we enable adhoc/beaconing if it allows us to | 170 | *we enable adhoc/beaconing if it allows us to |
@@ -182,11 +174,16 @@ static void _rtl_reg_apply_beaconing_flags(struct wiphy *wiphy, | |||
182 | *regulatory_hint(). | 174 | *regulatory_hint(). |
183 | */ | 175 | */ |
184 | 176 | ||
185 | if (!(reg_rule->flags & NL80211_RRF_NO_IR)) | 177 | if (!(reg_rule->flags & NL80211_RRF_NO_IBSS)) |
186 | ch->flags &= ~IEEE80211_CHAN_NO_IR; | 178 | ch->flags &= ~IEEE80211_CHAN_NO_IBSS; |
179 | if (!(reg_rule->flags & | ||
180 | NL80211_RRF_PASSIVE_SCAN)) | ||
181 | ch->flags &= | ||
182 | ~IEEE80211_CHAN_PASSIVE_SCAN; | ||
187 | } else { | 183 | } else { |
188 | if (ch->beacon_found) | 184 | if (ch->beacon_found) |
189 | ch->flags &= ~IEEE80211_CHAN_NO_IR; | 185 | ch->flags &= ~(IEEE80211_CHAN_NO_IBSS | |
186 | IEEE80211_CHAN_PASSIVE_SCAN); | ||
190 | } | 187 | } |
191 | } | 188 | } |
192 | } | 189 | } |
@@ -211,35 +208,35 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy, | |||
211 | */ | 208 | */ |
212 | if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) { | 209 | if (initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) { |
213 | ch = &sband->channels[11]; /* CH 12 */ | 210 | ch = &sband->channels[11]; /* CH 12 */ |
214 | if (ch->flags & IEEE80211_CHAN_NO_IR) | 211 | if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) |
215 | ch->flags &= ~IEEE80211_CHAN_NO_IR; | 212 | ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; |
216 | ch = &sband->channels[12]; /* CH 13 */ | 213 | ch = &sband->channels[12]; /* CH 13 */ |
217 | if (ch->flags & IEEE80211_CHAN_NO_IR) | 214 | if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) |
218 | ch->flags &= ~IEEE80211_CHAN_NO_IR; | 215 | ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; |
219 | return; | 216 | return; |
220 | } | 217 | } |
221 | 218 | ||
222 | /* | 219 | /* |
223 | *If a country IE has been received check its rule for this | 220 | *If a country IE has been recieved check its rule for this |
224 | *channel first before enabling active scan. The passive scan | 221 | *channel first before enabling active scan. The passive scan |
225 | *would have been enforced by the initial processing of our | 222 | *would have been enforced by the initial processing of our |
226 | *custom regulatory domain. | 223 | *custom regulatory domain. |
227 | */ | 224 | */ |
228 | 225 | ||
229 | ch = &sband->channels[11]; /* CH 12 */ | 226 | ch = &sband->channels[11]; /* CH 12 */ |
230 | reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq)); | 227 | reg_rule = freq_reg_info(wiphy, ch->center_freq); |
231 | if (!IS_ERR(reg_rule)) { | 228 | if (!IS_ERR(reg_rule)) { |
232 | if (!(reg_rule->flags & NL80211_RRF_NO_IR)) | 229 | if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) |
233 | if (ch->flags & IEEE80211_CHAN_NO_IR) | 230 | if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) |
234 | ch->flags &= ~IEEE80211_CHAN_NO_IR; | 231 | ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; |
235 | } | 232 | } |
236 | 233 | ||
237 | ch = &sband->channels[12]; /* CH 13 */ | 234 | ch = &sband->channels[12]; /* CH 13 */ |
238 | reg_rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq)); | 235 | reg_rule = freq_reg_info(wiphy, ch->center_freq); |
239 | if (!IS_ERR(reg_rule)) { | 236 | if (!IS_ERR(reg_rule)) { |
240 | if (!(reg_rule->flags & NL80211_RRF_NO_IR)) | 237 | if (!(reg_rule->flags & NL80211_RRF_PASSIVE_SCAN)) |
241 | if (ch->flags & IEEE80211_CHAN_NO_IR) | 238 | if (ch->flags & IEEE80211_CHAN_PASSIVE_SCAN) |
242 | ch->flags &= ~IEEE80211_CHAN_NO_IR; | 239 | ch->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; |
243 | } | 240 | } |
244 | } | 241 | } |
245 | 242 | ||
@@ -276,7 +273,8 @@ static void _rtl_reg_apply_radar_flags(struct wiphy *wiphy) | |||
276 | */ | 273 | */ |
277 | if (!(ch->flags & IEEE80211_CHAN_DISABLED)) | 274 | if (!(ch->flags & IEEE80211_CHAN_DISABLED)) |
278 | ch->flags |= IEEE80211_CHAN_RADAR | | 275 | ch->flags |= IEEE80211_CHAN_RADAR | |
279 | IEEE80211_CHAN_NO_IR; | 276 | IEEE80211_CHAN_NO_IBSS | |
277 | IEEE80211_CHAN_PASSIVE_SCAN; | ||
280 | } | 278 | } |
281 | } | 279 | } |
282 | 280 | ||
@@ -289,9 +287,25 @@ static void _rtl_reg_apply_world_flags(struct wiphy *wiphy, | |||
289 | return; | 287 | return; |
290 | } | 288 | } |
291 | 289 | ||
292 | static void _rtl_reg_notifier_apply(struct wiphy *wiphy, | 290 | static void _rtl_dump_channel_map(struct wiphy *wiphy) |
293 | struct regulatory_request *request, | 291 | { |
294 | struct rtl_regulatory *reg) | 292 | enum ieee80211_band band; |
293 | struct ieee80211_supported_band *sband; | ||
294 | struct ieee80211_channel *ch; | ||
295 | unsigned int i; | ||
296 | |||
297 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | ||
298 | if (!wiphy->bands[band]) | ||
299 | continue; | ||
300 | sband = wiphy->bands[band]; | ||
301 | for (i = 0; i < sband->n_channels; i++) | ||
302 | ch = &sband->channels[i]; | ||
303 | } | ||
304 | } | ||
305 | |||
306 | static int _rtl_reg_notifier_apply(struct wiphy *wiphy, | ||
307 | struct regulatory_request *request, | ||
308 | struct rtl_regulatory *reg) | ||
295 | { | 309 | { |
296 | /* We always apply this */ | 310 | /* We always apply this */ |
297 | _rtl_reg_apply_radar_flags(wiphy); | 311 | _rtl_reg_apply_radar_flags(wiphy); |
@@ -305,10 +319,14 @@ static void _rtl_reg_notifier_apply(struct wiphy *wiphy, | |||
305 | _rtl_reg_apply_world_flags(wiphy, request->initiator, reg); | 319 | _rtl_reg_apply_world_flags(wiphy, request->initiator, reg); |
306 | break; | 320 | break; |
307 | } | 321 | } |
322 | |||
323 | _rtl_dump_channel_map(wiphy); | ||
324 | |||
325 | return 0; | ||
308 | } | 326 | } |
309 | 327 | ||
310 | static const struct ieee80211_regdomain *_rtl_regdomain_select( | 328 | static const struct ieee80211_regdomain *_rtl_regdomain_select( |
311 | struct rtl_regulatory *reg) | 329 | struct rtl_regulatory *reg) |
312 | { | 330 | { |
313 | switch (reg->country_code) { | 331 | switch (reg->country_code) { |
314 | case COUNTRY_CODE_FCC: | 332 | case COUNTRY_CODE_FCC: |
@@ -337,9 +355,9 @@ static const struct ieee80211_regdomain *_rtl_regdomain_select( | |||
337 | 355 | ||
338 | static int _rtl_regd_init_wiphy(struct rtl_regulatory *reg, | 356 | static int _rtl_regd_init_wiphy(struct rtl_regulatory *reg, |
339 | struct wiphy *wiphy, | 357 | struct wiphy *wiphy, |
340 | void (*reg_notifier) (struct wiphy *wiphy, | 358 | void (*reg_notifier)(struct wiphy *wiphy, |
341 | struct regulatory_request * | 359 | struct regulatory_request * |
342 | request)) | 360 | request)) |
343 | { | 361 | { |
344 | const struct ieee80211_regdomain *regd; | 362 | const struct ieee80211_regdomain *regd; |
345 | 363 | ||
@@ -348,7 +366,6 @@ static int _rtl_regd_init_wiphy(struct rtl_regulatory *reg, | |||
348 | wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; | 366 | wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG; |
349 | wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG; | 367 | wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG; |
350 | wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; | 368 | wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS; |
351 | |||
352 | regd = _rtl_regdomain_select(reg); | 369 | regd = _rtl_regdomain_select(reg); |
353 | wiphy_apply_custom_regulatory(wiphy, regd); | 370 | wiphy_apply_custom_regulatory(wiphy, regd); |
354 | _rtl_reg_apply_radar_flags(wiphy); | 371 | _rtl_reg_apply_radar_flags(wiphy); |
@@ -368,7 +385,7 @@ static struct country_code_to_enum_rd *_rtl_regd_find_country(u16 countrycode) | |||
368 | } | 385 | } |
369 | 386 | ||
370 | int rtl_regd_init(struct ieee80211_hw *hw, | 387 | int rtl_regd_init(struct ieee80211_hw *hw, |
371 | void (*reg_notifier) (struct wiphy *wiphy, | 388 | void (*reg_notifier)(struct wiphy *wiphy, |
372 | struct regulatory_request *request)) | 389 | struct regulatory_request *request)) |
373 | { | 390 | { |
374 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 391 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
@@ -382,7 +399,8 @@ int rtl_regd_init(struct ieee80211_hw *hw, | |||
382 | rtlpriv->regd.country_code = rtlpriv->efuse.channel_plan; | 399 | rtlpriv->regd.country_code = rtlpriv->efuse.channel_plan; |
383 | 400 | ||
384 | RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE, | 401 | RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE, |
385 | "rtl: EEPROM regdomain: 0x%0x\n", rtlpriv->regd.country_code); | 402 | "rtl: EEPROM regdomain: 0x%0x\n", |
403 | rtlpriv->regd.country_code); | ||
386 | 404 | ||
387 | if (rtlpriv->regd.country_code >= COUNTRY_CODE_MAX) { | 405 | if (rtlpriv->regd.country_code >= COUNTRY_CODE_MAX) { |
388 | RT_TRACE(rtlpriv, COMP_REGD, DBG_DMESG, | 406 | RT_TRACE(rtlpriv, COMP_REGD, DBG_DMESG, |
@@ -403,7 +421,7 @@ int rtl_regd_init(struct ieee80211_hw *hw, | |||
403 | 421 | ||
404 | RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE, | 422 | RT_TRACE(rtlpriv, COMP_REGD, DBG_TRACE, |
405 | "rtl: Country alpha2 being used: %c%c\n", | 423 | "rtl: Country alpha2 being used: %c%c\n", |
406 | rtlpriv->regd.alpha2[0], rtlpriv->regd.alpha2[1]); | 424 | rtlpriv->regd.alpha2[0], rtlpriv->regd.alpha2[1]); |
407 | 425 | ||
408 | _rtl_regd_init_wiphy(&rtlpriv->regd, wiphy, reg_notifier); | 426 | _rtl_regd_init_wiphy(&rtlpriv->regd, wiphy, reg_notifier); |
409 | 427 | ||
diff --git a/drivers/net/wireless/rtlwifi/regd.h b/drivers/net/wireless/rtlwifi/regd.h index 4e1f4f00e6e9..3bbbaaa68530 100644 --- a/drivers/net/wireless/rtlwifi/regd.h +++ b/drivers/net/wireless/rtlwifi/regd.h | |||
@@ -11,10 +11,6 @@ | |||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | 14 | * The full GNU General Public License is included in this distribution in the |
19 | * file called LICENSE. | 15 | * file called LICENSE. |
20 | * | 16 | * |
@@ -30,6 +26,10 @@ | |||
30 | #ifndef __RTL_REGD_H__ | 26 | #ifndef __RTL_REGD_H__ |
31 | #define __RTL_REGD_H__ | 27 | #define __RTL_REGD_H__ |
32 | 28 | ||
29 | /* for kernel 3.14 , both value are changed to IEEE80211_CHAN_NO_IR*/ | ||
30 | #define IEEE80211_CHAN_NO_IBSS IEEE80211_CHAN_NO_IR | ||
31 | #define IEEE80211_CHAN_PASSIVE_SCAN IEEE80211_CHAN_NO_IR | ||
32 | |||
33 | struct country_code_to_enum_rd { | 33 | struct country_code_to_enum_rd { |
34 | u16 countrycode; | 34 | u16 countrycode; |
35 | const char *iso_name; | 35 | const char *iso_name; |
@@ -56,6 +56,7 @@ enum country_code_type_t { | |||
56 | 56 | ||
57 | int rtl_regd_init(struct ieee80211_hw *hw, | 57 | int rtl_regd_init(struct ieee80211_hw *hw, |
58 | void (*reg_notifier) (struct wiphy *wiphy, | 58 | void (*reg_notifier) (struct wiphy *wiphy, |
59 | struct regulatory_request *request)); | 59 | struct regulatory_request *request)); |
60 | void rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); | 60 | void rtl_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request); |
61 | |||
61 | #endif | 62 | #endif |
diff --git a/drivers/net/wireless/rtlwifi/stats.c b/drivers/net/wireless/rtlwifi/stats.c index 4f083fc1d360..2d0736a09fc0 100644 --- a/drivers/net/wireless/rtlwifi/stats.c +++ b/drivers/net/wireless/rtlwifi/stats.c | |||
@@ -11,10 +11,6 @@ | |||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | 14 | * The full GNU General Public License is included in this distribution in the |
19 | * file called LICENSE. | 15 | * file called LICENSE. |
20 | * | 16 | * |
@@ -59,8 +55,23 @@ u8 rtl_evm_db_to_percentage(char value) | |||
59 | } | 55 | } |
60 | EXPORT_SYMBOL(rtl_evm_db_to_percentage); | 56 | EXPORT_SYMBOL(rtl_evm_db_to_percentage); |
61 | 57 | ||
58 | u8 rtl_evm_dbm_jaguar(char value) | ||
59 | { | ||
60 | char ret_val = value; | ||
61 | |||
62 | /* -33dB~0dB to 33dB ~ 0dB*/ | ||
63 | if (ret_val == -128) | ||
64 | ret_val = 127; | ||
65 | else if (ret_val < 0) | ||
66 | ret_val = 0 - ret_val; | ||
67 | |||
68 | ret_val = ret_val >> 1; | ||
69 | return ret_val; | ||
70 | } | ||
71 | EXPORT_SYMBOL(rtl_evm_dbm_jaguar); | ||
72 | |||
62 | static long rtl_translate_todbm(struct ieee80211_hw *hw, | 73 | static long rtl_translate_todbm(struct ieee80211_hw *hw, |
63 | u8 signal_strength_index) | 74 | u8 signal_strength_index) |
64 | { | 75 | { |
65 | long signal_power; | 76 | long signal_power; |
66 | 77 | ||
@@ -106,6 +117,10 @@ static void rtl_process_ui_rssi(struct ieee80211_hw *hw, | |||
106 | u8 rfpath; | 117 | u8 rfpath; |
107 | u32 last_rssi, tmpval; | 118 | u32 last_rssi, tmpval; |
108 | 119 | ||
120 | if (!pstatus->packet_toself && !pstatus->packet_beacon) | ||
121 | return; | ||
122 | |||
123 | rtlpriv->stats.pwdb_all_cnt += pstatus->rx_pwdb_all; | ||
109 | rtlpriv->stats.rssi_calculate_cnt++; | 124 | rtlpriv->stats.rssi_calculate_cnt++; |
110 | 125 | ||
111 | if (rtlpriv->stats.ui_rssi.total_num++ >= PHY_RSSI_SLID_WIN_MAX) { | 126 | if (rtlpriv->stats.ui_rssi.total_num++ >= PHY_RSSI_SLID_WIN_MAX) { |
@@ -151,6 +166,12 @@ static void rtl_process_ui_rssi(struct ieee80211_hw *hw, | |||
151 | (pstatus->rx_mimo_signalstrength[rfpath])) / | 166 | (pstatus->rx_mimo_signalstrength[rfpath])) / |
152 | (RX_SMOOTH_FACTOR); | 167 | (RX_SMOOTH_FACTOR); |
153 | } | 168 | } |
169 | rtlpriv->stats.rx_snr_db[rfpath] = pstatus->rx_snr[rfpath]; | ||
170 | rtlpriv->stats.rx_evm_dbm[rfpath] = | ||
171 | pstatus->rx_mimo_evm_dbm[rfpath]; | ||
172 | rtlpriv->stats.rx_cfo_short[rfpath] = | ||
173 | pstatus->cfo_short[rfpath]; | ||
174 | rtlpriv->stats.rx_cfo_tail[rfpath] = pstatus->cfo_tail[rfpath]; | ||
154 | } | 175 | } |
155 | } | 176 | } |
156 | 177 | ||
@@ -176,7 +197,6 @@ static void rtl_process_pwdb(struct ieee80211_hw *hw, struct rtl_stats *pstatus) | |||
176 | struct rtl_sta_info *drv_priv = NULL; | 197 | struct rtl_sta_info *drv_priv = NULL; |
177 | struct ieee80211_sta *sta = NULL; | 198 | struct ieee80211_sta *sta = NULL; |
178 | long undec_sm_pwdb; | 199 | long undec_sm_pwdb; |
179 | long undec_sm_cck; | ||
180 | 200 | ||
181 | rcu_read_lock(); | 201 | rcu_read_lock(); |
182 | if (rtlpriv->mac80211.opmode != NL80211_IFTYPE_STATION) | 202 | if (rtlpriv->mac80211.opmode != NL80211_IFTYPE_STATION) |
@@ -186,33 +206,21 @@ static void rtl_process_pwdb(struct ieee80211_hw *hw, struct rtl_stats *pstatus) | |||
186 | if (sta) { | 206 | if (sta) { |
187 | drv_priv = (struct rtl_sta_info *) sta->drv_priv; | 207 | drv_priv = (struct rtl_sta_info *) sta->drv_priv; |
188 | undec_sm_pwdb = drv_priv->rssi_stat.undec_sm_pwdb; | 208 | undec_sm_pwdb = drv_priv->rssi_stat.undec_sm_pwdb; |
189 | undec_sm_cck = drv_priv->rssi_stat.undec_sm_cck; | ||
190 | } else { | 209 | } else { |
191 | undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb; | 210 | undec_sm_pwdb = rtlpriv->dm.undec_sm_pwdb; |
192 | undec_sm_cck = rtlpriv->dm.undec_sm_cck; | ||
193 | } | 211 | } |
194 | 212 | ||
195 | if (undec_sm_pwdb < 0) | 213 | if (undec_sm_pwdb < 0) |
196 | undec_sm_pwdb = pstatus->rx_pwdb_all; | 214 | undec_sm_pwdb = pstatus->rx_pwdb_all; |
197 | if (undec_sm_cck < 0) | ||
198 | undec_sm_cck = pstatus->rx_pwdb_all; | ||
199 | if (pstatus->rx_pwdb_all > (u32) undec_sm_pwdb) { | 215 | if (pstatus->rx_pwdb_all > (u32) undec_sm_pwdb) { |
200 | undec_sm_pwdb = (((undec_sm_pwdb) * | 216 | undec_sm_pwdb = (((undec_sm_pwdb) * |
201 | (RX_SMOOTH_FACTOR - 1)) + | 217 | (RX_SMOOTH_FACTOR - 1)) + |
202 | (pstatus->rx_pwdb_all)) / (RX_SMOOTH_FACTOR); | 218 | (pstatus->rx_pwdb_all)) / (RX_SMOOTH_FACTOR); |
203 | undec_sm_pwdb = undec_sm_pwdb + 1; | 219 | undec_sm_pwdb = undec_sm_pwdb + 1; |
204 | } else { | 220 | } else { |
205 | undec_sm_pwdb = (((undec_sm_pwdb) * (RX_SMOOTH_FACTOR - 1)) + | 221 | undec_sm_pwdb = (((undec_sm_pwdb) * |
206 | (pstatus->rx_pwdb_all)) / (RX_SMOOTH_FACTOR); | ||
207 | } | ||
208 | if (pstatus->rx_pwdb_all > (u32) undec_sm_cck) { | ||
209 | undec_sm_cck = (((undec_sm_pwdb) * | ||
210 | (RX_SMOOTH_FACTOR - 1)) + | 222 | (RX_SMOOTH_FACTOR - 1)) + |
211 | (pstatus->rx_pwdb_all)) / (RX_SMOOTH_FACTOR); | 223 | (pstatus->rx_pwdb_all)) / (RX_SMOOTH_FACTOR); |
212 | undec_sm_cck = undec_sm_cck + 1; | ||
213 | } else { | ||
214 | undec_sm_pwdb = (((undec_sm_cck) * (RX_SMOOTH_FACTOR - 1)) + | ||
215 | (pstatus->rx_pwdb_all)) / (RX_SMOOTH_FACTOR); | ||
216 | } | 224 | } |
217 | 225 | ||
218 | if (sta) { | 226 | if (sta) { |
@@ -245,7 +253,7 @@ static void rtl_process_ui_link_quality(struct ieee80211_hw *hw, | |||
245 | rtlpriv->stats.ui_link_quality.total_val += pstatus->signalquality; | 253 | rtlpriv->stats.ui_link_quality.total_val += pstatus->signalquality; |
246 | rtlpriv->stats.ui_link_quality.elements[ | 254 | rtlpriv->stats.ui_link_quality.elements[ |
247 | rtlpriv->stats.ui_link_quality.index++] = | 255 | rtlpriv->stats.ui_link_quality.index++] = |
248 | pstatus->signalquality; | 256 | pstatus->signalquality; |
249 | if (rtlpriv->stats.ui_link_quality.index >= | 257 | if (rtlpriv->stats.ui_link_quality.index >= |
250 | PHY_LINKQUALITY_SLID_WIN_MAX) | 258 | PHY_LINKQUALITY_SLID_WIN_MAX) |
251 | rtlpriv->stats.ui_link_quality.index = 0; | 259 | rtlpriv->stats.ui_link_quality.index = 0; |
@@ -269,7 +277,7 @@ static void rtl_process_ui_link_quality(struct ieee80211_hw *hw, | |||
269 | } | 277 | } |
270 | 278 | ||
271 | void rtl_process_phyinfo(struct ieee80211_hw *hw, u8 *buffer, | 279 | void rtl_process_phyinfo(struct ieee80211_hw *hw, u8 *buffer, |
272 | struct rtl_stats *pstatus) | 280 | struct rtl_stats *pstatus) |
273 | { | 281 | { |
274 | 282 | ||
275 | if (!pstatus->packet_matchbssid) | 283 | if (!pstatus->packet_matchbssid) |
diff --git a/drivers/net/wireless/rtlwifi/stats.h b/drivers/net/wireless/rtlwifi/stats.h index 0dbdc5203830..aa4eec80ccf7 100644 --- a/drivers/net/wireless/rtlwifi/stats.h +++ b/drivers/net/wireless/rtlwifi/stats.h | |||
@@ -11,10 +11,6 @@ | |||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | 14 | * The full GNU General Public License is included in this distribution in the |
19 | * file called LICENSE. | 15 | * file called LICENSE. |
20 | * | 16 | * |
@@ -39,8 +35,9 @@ | |||
39 | 35 | ||
40 | u8 rtl_query_rxpwrpercentage(char antpower); | 36 | u8 rtl_query_rxpwrpercentage(char antpower); |
41 | u8 rtl_evm_db_to_percentage(char value); | 37 | u8 rtl_evm_db_to_percentage(char value); |
38 | u8 rtl_evm_dbm_jaguar(char value); | ||
42 | long rtl_signal_scale_mapping(struct ieee80211_hw *hw, long currsig); | 39 | long rtl_signal_scale_mapping(struct ieee80211_hw *hw, long currsig); |
43 | void rtl_process_phyinfo(struct ieee80211_hw *hw, u8 *buffer, | 40 | void rtl_process_phyinfo(struct ieee80211_hw *hw, u8 *buffer, |
44 | struct rtl_stats *pstatus); | 41 | struct rtl_stats *pstatus); |
45 | 42 | ||
46 | #endif | 43 | #endif |
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index 1d5852830102..af7c6f22aaea 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
@@ -951,6 +951,7 @@ struct wireless_stats { | |||
951 | long last_sigstrength_inpercent; | 951 | long last_sigstrength_inpercent; |
952 | 952 | ||
953 | u32 rssi_calculate_cnt; | 953 | u32 rssi_calculate_cnt; |
954 | u32 pwdb_all_cnt; | ||
954 | 955 | ||
955 | /*Transformed, in dbm. Beautified signal | 956 | /*Transformed, in dbm. Beautified signal |
956 | strength for UI, not correct. */ | 957 | strength for UI, not correct. */ |
@@ -1889,6 +1890,10 @@ struct rtl_stats { | |||
1889 | bool rx_is40Mhzpacket; | 1890 | bool rx_is40Mhzpacket; |
1890 | u32 rx_pwdb_all; | 1891 | u32 rx_pwdb_all; |
1891 | u8 rx_mimo_signalstrength[4]; /*in 0~100 index */ | 1892 | u8 rx_mimo_signalstrength[4]; /*in 0~100 index */ |
1893 | u8 rx_mimo_evm_dbm[4]; | ||
1894 | u16 cfo_short[4]; /* per-path's Cfo_short */ | ||
1895 | u16 cfo_tail[4]; | ||
1896 | |||
1892 | s8 rx_mimo_sig_qual[4]; | 1897 | s8 rx_mimo_sig_qual[4]; |
1893 | u8 rx_pwr[4]; /* per-path's pwdb */ | 1898 | u8 rx_pwr[4]; /* per-path's pwdb */ |
1894 | u8 rx_snr[4]; /* per-path's SNR */ | 1899 | u8 rx_snr[4]; /* per-path's SNR */ |