aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2014-12-18 04:05:34 -0500
committerKalle Valo <kvalo@codeaurora.org>2014-12-24 11:31:52 -0500
commit8d3fc3a64ba34d859d6bb0de76bd1860b234cd1c (patch)
treeca1158a95d4a052e0ee3c64909b32ce1e38524ed /drivers/net
parent5b243feff35ab6050893741bc1a7016fa3ae5a8b (diff)
rtlwifi: rtl8723ae: Modify driver to use rate-mapping routine in core
This driver is also converted to use the rate-mapping code in the core. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8723ae/trx.c162
1 files changed, 2 insertions, 160 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
index d372ccaf3465..662a09461a6b 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/trx.c
@@ -45,164 +45,6 @@ static u8 _rtl8723e_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue)
45 return skb->priority; 45 return skb->priority;
46} 46}
47 47
48/* mac80211's rate_idx is like this:
49 *
50 * 2.4G band:rx_status->band == IEEE80211_BAND_2GHZ
51 *
52 * B/G rate:
53 * (rx_status->flag & RX_FLAG_HT) = 0,
54 * DESC92C_RATE1M-->DESC92C_RATE54M ==> idx is 0-->11,
55 *
56 * N rate:
57 * (rx_status->flag & RX_FLAG_HT) = 1,
58 * DESC92C_RATEMCS0-->DESC92C_RATEMCS15 ==> idx is 0-->15
59 *
60 * 5G band:rx_status->band == IEEE80211_BAND_5GHZ
61 * A rate:
62 * (rx_status->flag & RX_FLAG_HT) = 0,
63 * DESC92C_RATE6M-->DESC92C_RATE54M ==> idx is 0-->7,
64 *
65 * N rate:
66 * (rx_status->flag & RX_FLAG_HT) = 1,
67 * DESC92C_RATEMCS0-->DESC92C_RATEMCS15 ==> idx is 0-->15
68 */
69static int _rtl8723e_rate_mapping(struct ieee80211_hw *hw,
70 bool isht, u8 desc_rate)
71{
72 int rate_idx;
73
74 if (!isht) {
75 if (IEEE80211_BAND_2GHZ == hw->conf.chandef.chan->band) {
76 switch (desc_rate) {
77 case DESC92C_RATE1M:
78 rate_idx = 0;
79 break;
80 case DESC92C_RATE2M:
81 rate_idx = 1;
82 break;
83 case DESC92C_RATE5_5M:
84 rate_idx = 2;
85 break;
86 case DESC92C_RATE11M:
87 rate_idx = 3;
88 break;
89 case DESC92C_RATE6M:
90 rate_idx = 4;
91 break;
92 case DESC92C_RATE9M:
93 rate_idx = 5;
94 break;
95 case DESC92C_RATE12M:
96 rate_idx = 6;
97 break;
98 case DESC92C_RATE18M:
99 rate_idx = 7;
100 break;
101 case DESC92C_RATE24M:
102 rate_idx = 8;
103 break;
104 case DESC92C_RATE36M:
105 rate_idx = 9;
106 break;
107 case DESC92C_RATE48M:
108 rate_idx = 10;
109 break;
110 case DESC92C_RATE54M:
111 rate_idx = 11;
112 break;
113 default:
114 rate_idx = 0;
115 break;
116 }
117 } else {
118 switch (desc_rate) {
119 case DESC92C_RATE6M:
120 rate_idx = 0;
121 break;
122 case DESC92C_RATE9M:
123 rate_idx = 1;
124 break;
125 case DESC92C_RATE12M:
126 rate_idx = 2;
127 break;
128 case DESC92C_RATE18M:
129 rate_idx = 3;
130 break;
131 case DESC92C_RATE24M:
132 rate_idx = 4;
133 break;
134 case DESC92C_RATE36M:
135 rate_idx = 5;
136 break;
137 case DESC92C_RATE48M:
138 rate_idx = 6;
139 break;
140 case DESC92C_RATE54M:
141 rate_idx = 7;
142 break;
143 default:
144 rate_idx = 0;
145 break;
146 }
147 }
148 } else {
149 switch (desc_rate) {
150 case DESC92C_RATEMCS0:
151 rate_idx = 0;
152 break;
153 case DESC92C_RATEMCS1:
154 rate_idx = 1;
155 break;
156 case DESC92C_RATEMCS2:
157 rate_idx = 2;
158 break;
159 case DESC92C_RATEMCS3:
160 rate_idx = 3;
161 break;
162 case DESC92C_RATEMCS4:
163 rate_idx = 4;
164 break;
165 case DESC92C_RATEMCS5:
166 rate_idx = 5;
167 break;
168 case DESC92C_RATEMCS6:
169 rate_idx = 6;
170 break;
171 case DESC92C_RATEMCS7:
172 rate_idx = 7;
173 break;
174 case DESC92C_RATEMCS8:
175 rate_idx = 8;
176 break;
177 case DESC92C_RATEMCS9:
178 rate_idx = 9;
179 break;
180 case DESC92C_RATEMCS10:
181 rate_idx = 10;
182 break;
183 case DESC92C_RATEMCS11:
184 rate_idx = 11;
185 break;
186 case DESC92C_RATEMCS12:
187 rate_idx = 12;
188 break;
189 case DESC92C_RATEMCS13:
190 rate_idx = 13;
191 break;
192 case DESC92C_RATEMCS14:
193 rate_idx = 14;
194 break;
195 case DESC92C_RATEMCS15:
196 rate_idx = 15;
197 break;
198 default:
199 rate_idx = 0;
200 break;
201 }
202 }
203 return rate_idx;
204}
205
206static void _rtl8723e_query_rxphystatus(struct ieee80211_hw *hw, 48static void _rtl8723e_query_rxphystatus(struct ieee80211_hw *hw,
207 struct rtl_stats *pstatus, u8 *pdesc, 49 struct rtl_stats *pstatus, u8 *pdesc,
208 struct rx_fwinfo_8723e *p_drvinfo, 50 struct rx_fwinfo_8723e *p_drvinfo,
@@ -503,8 +345,8 @@ bool rtl8723e_rx_query_desc(struct ieee80211_hw *hw,
503 * are use (RX_FLAG_HT) 345 * are use (RX_FLAG_HT)
504 * Notice: this is diff with windows define 346 * Notice: this is diff with windows define
505 */ 347 */
506 rx_status->rate_idx = _rtl8723e_rate_mapping(hw, 348 rx_status->rate_idx = rtlwifi_rate_mapping(hw, status->is_ht,
507 status->is_ht, status->rate); 349 status->rate);
508 350
509 rx_status->mactime = status->timestamp_low; 351 rx_status->mactime = status->timestamp_low;
510 if (phystatus == true) { 352 if (phystatus == true) {