aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2011-08-22 17:50:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-24 14:57:19 -0400
commit2b67e88f648f3b16783feb09178719380150e51f (patch)
tree41a39c8ab3cf161247d3dfb76af5b024e31f3b43 /drivers/net
parent78851b66b1f4c00fe324d53ae55dbf5bf9a02e27 (diff)
rtlwifi: rtl8192cu: Convert to use the new rate-mapping routine in rtlwifi
This patch also removes the now unused code from rtl8192ce/def.h. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Chaoming Li <chaoming_li@realsil.com.cn> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/def.h139
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/mac.c4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/mac.h8
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/rf.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/sw.c28
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/trx.c23
6 files changed, 32 insertions, 172 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
index 35ff7df41a1d..11f43196e61d 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/def.h
@@ -220,41 +220,6 @@ enum rtl_desc_qsel {
220 QSLT_CMD = 0x13, 220 QSLT_CMD = 0x13,
221}; 221};
222 222
223enum rtl_desc92c_rate {
224 DESC92C_RATE1M = 0x00,
225 DESC92C_RATE2M = 0x01,
226 DESC92C_RATE5_5M = 0x02,
227 DESC92C_RATE11M = 0x03,
228
229 DESC92C_RATE6M = 0x04,
230 DESC92C_RATE9M = 0x05,
231 DESC92C_RATE12M = 0x06,
232 DESC92C_RATE18M = 0x07,
233 DESC92C_RATE24M = 0x08,
234 DESC92C_RATE36M = 0x09,
235 DESC92C_RATE48M = 0x0a,
236 DESC92C_RATE54M = 0x0b,
237
238 DESC92C_RATEMCS0 = 0x0c,
239 DESC92C_RATEMCS1 = 0x0d,
240 DESC92C_RATEMCS2 = 0x0e,
241 DESC92C_RATEMCS3 = 0x0f,
242 DESC92C_RATEMCS4 = 0x10,
243 DESC92C_RATEMCS5 = 0x11,
244 DESC92C_RATEMCS6 = 0x12,
245 DESC92C_RATEMCS7 = 0x13,
246 DESC92C_RATEMCS8 = 0x14,
247 DESC92C_RATEMCS9 = 0x15,
248 DESC92C_RATEMCS10 = 0x16,
249 DESC92C_RATEMCS11 = 0x17,
250 DESC92C_RATEMCS12 = 0x18,
251 DESC92C_RATEMCS13 = 0x19,
252 DESC92C_RATEMCS14 = 0x1a,
253 DESC92C_RATEMCS15 = 0x1b,
254 DESC92C_RATEMCS15_SG = 0x1c,
255 DESC92C_RATEMCS32 = 0x20,
256};
257
258struct phy_sts_cck_8192s_t { 223struct phy_sts_cck_8192s_t {
259 u8 adc_pwdb_X[4]; 224 u8 adc_pwdb_X[4];
260 u8 sq_rpt; 225 u8 sq_rpt;
@@ -267,108 +232,4 @@ struct h2c_cmd_8192c {
267 u8 *p_cmdbuffer; 232 u8 *p_cmdbuffer;
268}; 233};
269 234
270/* NOTE: reference to rtl8192c_rates struct */
271static inline int _rtl92c_rate_mapping(struct ieee80211_hw *hw, bool isHT,
272 u8 desc_rate, bool first_ampdu)
273{
274 struct rtl_priv *rtlpriv = rtl_priv(hw);
275 int rate_idx = 0;
276
277 if (first_ampdu) {
278 if (false == isHT) {
279 switch (desc_rate) {
280 case DESC92C_RATE1M:
281 rate_idx = 0;
282 break;
283 case DESC92C_RATE2M:
284 rate_idx = 1;
285 break;
286 case DESC92C_RATE5_5M:
287 rate_idx = 2;
288 break;
289 case DESC92C_RATE11M:
290 rate_idx = 3;
291 break;
292 case DESC92C_RATE6M:
293 rate_idx = 4;
294 break;
295 case DESC92C_RATE9M:
296 rate_idx = 5;
297 break;
298 case DESC92C_RATE12M:
299 rate_idx = 6;
300 break;
301 case DESC92C_RATE18M:
302 rate_idx = 7;
303 break;
304 case DESC92C_RATE24M:
305 rate_idx = 8;
306 break;
307 case DESC92C_RATE36M:
308 rate_idx = 9;
309 break;
310 case DESC92C_RATE48M:
311 rate_idx = 10;
312 break;
313 case DESC92C_RATE54M:
314 rate_idx = 11;
315 break;
316 default:
317 RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG,
318 ("Rate %d is not support, set to "
319 "1M rate.\n", desc_rate));
320 rate_idx = 0;
321 break;
322 }
323 } else {
324 rate_idx = 11;
325 }
326 return rate_idx;
327 }
328 switch (desc_rate) {
329 case DESC92C_RATE1M:
330 rate_idx = 0;
331 break;
332 case DESC92C_RATE2M:
333 rate_idx = 1;
334 break;
335 case DESC92C_RATE5_5M:
336 rate_idx = 2;
337 break;
338 case DESC92C_RATE11M:
339 rate_idx = 3;
340 break;
341 case DESC92C_RATE6M:
342 rate_idx = 4;
343 break;
344 case DESC92C_RATE9M:
345 rate_idx = 5;
346 break;
347 case DESC92C_RATE12M:
348 rate_idx = 6;
349 break;
350 case DESC92C_RATE18M:
351 rate_idx = 7;
352 break;
353 case DESC92C_RATE24M:
354 rate_idx = 8;
355 break;
356 case DESC92C_RATE36M:
357 rate_idx = 9;
358 break;
359 case DESC92C_RATE48M:
360 rate_idx = 10;
361 break;
362 case DESC92C_RATE54M:
363 rate_idx = 11;
364 break;
365 /* TODO: How to mapping MCS rate? */
366 /* NOTE: referenc to __ieee80211_rx */
367 default:
368 rate_idx = 11;
369 break;
370 }
371 return rate_idx;
372}
373
374#endif 235#endif
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
index 194fc693c1fa..060a06f4a885 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.c
@@ -892,8 +892,8 @@ static void _rtl92c_query_rxphystatus(struct ieee80211_hw *hw,
892 pstats->rxpower = rx_pwr_all; 892 pstats->rxpower = rx_pwr_all;
893 pstats->recvsignalpower = rx_pwr_all; 893 pstats->recvsignalpower = rx_pwr_all;
894 if (GET_RX_DESC_RX_MCS(pdesc) && 894 if (GET_RX_DESC_RX_MCS(pdesc) &&
895 GET_RX_DESC_RX_MCS(pdesc) >= DESC92C_RATEMCS8 && 895 GET_RX_DESC_RX_MCS(pdesc) >= DESC92_RATEMCS8 &&
896 GET_RX_DESC_RX_MCS(pdesc) <= DESC92C_RATEMCS15) 896 GET_RX_DESC_RX_MCS(pdesc) <= DESC92_RATEMCS15)
897 max_spatial_stream = 2; 897 max_spatial_stream = 2;
898 else 898 else
899 max_spatial_stream = 1; 899 max_spatial_stream = 1;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.h b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.h
index 298fdb724aa5..35529f701fc0 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/mac.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/mac.h
@@ -88,10 +88,10 @@ void rtl92c_set_data_filter(struct ieee80211_hw *hw, u16 filter);
88u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw); 88u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);
89 89
90#define RX_HAL_IS_CCK_RATE(_pdesc)\ 90#define RX_HAL_IS_CCK_RATE(_pdesc)\
91 (GET_RX_DESC_RX_MCS(_pdesc) == DESC92C_RATE1M ||\ 91 (GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE1M ||\
92 GET_RX_DESC_RX_MCS(_pdesc) == DESC92C_RATE2M ||\ 92 GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE2M ||\
93 GET_RX_DESC_RX_MCS(_pdesc) == DESC92C_RATE5_5M ||\ 93 GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\
94 GET_RX_DESC_RX_MCS(_pdesc) == DESC92C_RATE11M) 94 GET_RX_DESC_RX_MCS(_pdesc) == DESC92_RATE11M)
95 95
96struct rx_fwinfo_92c { 96struct rx_fwinfo_92c {
97 u8 gain_trsw[4]; 97 u8 gain_trsw[4];
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
index 17a8e9628512..1e851aae58db 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/rf.c
@@ -104,7 +104,7 @@ void rtl92cu_phy_rf6052_set_cck_txpower(struct ieee80211_hw *hw,
104 tx_agc[RF90_PATH_A] = 0x10101010; 104 tx_agc[RF90_PATH_A] = 0x10101010;
105 tx_agc[RF90_PATH_B] = 0x10101010; 105 tx_agc[RF90_PATH_B] = 0x10101010;
106 } else if (rtlpriv->dm.dynamic_txhighpower_lvl == 106 } else if (rtlpriv->dm.dynamic_txhighpower_lvl ==
107 TXHIGHPWRLEVEL_LEVEL2) { 107 TXHIGHPWRLEVEL_LEVEL1) {
108 tx_agc[RF90_PATH_A] = 0x00000000; 108 tx_agc[RF90_PATH_A] = 0x00000000;
109 tx_agc[RF90_PATH_B] = 0x00000000; 109 tx_agc[RF90_PATH_B] = 0x00000000;
110 } else{ 110 } else{
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index 942f7a3969a7..195666a0c854 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -241,20 +241,20 @@ static struct rtl_hal_cfg rtl92cu_hal_cfg = {
241 .maps[RTL_IMR_ROK] = IMR_ROK, 241 .maps[RTL_IMR_ROK] = IMR_ROK,
242 .maps[RTL_IBSS_INT_MASKS] = (IMR_BCNINT | IMR_TBDOK | IMR_TBDER), 242 .maps[RTL_IBSS_INT_MASKS] = (IMR_BCNINT | IMR_TBDOK | IMR_TBDER),
243 243
244 .maps[RTL_RC_CCK_RATE1M] = DESC92C_RATE1M, 244 .maps[RTL_RC_CCK_RATE1M] = DESC92_RATE1M,
245 .maps[RTL_RC_CCK_RATE2M] = DESC92C_RATE2M, 245 .maps[RTL_RC_CCK_RATE2M] = DESC92_RATE2M,
246 .maps[RTL_RC_CCK_RATE5_5M] = DESC92C_RATE5_5M, 246 .maps[RTL_RC_CCK_RATE5_5M] = DESC92_RATE5_5M,
247 .maps[RTL_RC_CCK_RATE11M] = DESC92C_RATE11M, 247 .maps[RTL_RC_CCK_RATE11M] = DESC92_RATE11M,
248 .maps[RTL_RC_OFDM_RATE6M] = DESC92C_RATE6M, 248 .maps[RTL_RC_OFDM_RATE6M] = DESC92_RATE6M,
249 .maps[RTL_RC_OFDM_RATE9M] = DESC92C_RATE9M, 249 .maps[RTL_RC_OFDM_RATE9M] = DESC92_RATE9M,
250 .maps[RTL_RC_OFDM_RATE12M] = DESC92C_RATE12M, 250 .maps[RTL_RC_OFDM_RATE12M] = DESC92_RATE12M,
251 .maps[RTL_RC_OFDM_RATE18M] = DESC92C_RATE18M, 251 .maps[RTL_RC_OFDM_RATE18M] = DESC92_RATE18M,
252 .maps[RTL_RC_OFDM_RATE24M] = DESC92C_RATE24M, 252 .maps[RTL_RC_OFDM_RATE24M] = DESC92_RATE24M,
253 .maps[RTL_RC_OFDM_RATE36M] = DESC92C_RATE36M, 253 .maps[RTL_RC_OFDM_RATE36M] = DESC92_RATE36M,
254 .maps[RTL_RC_OFDM_RATE48M] = DESC92C_RATE48M, 254 .maps[RTL_RC_OFDM_RATE48M] = DESC92_RATE48M,
255 .maps[RTL_RC_OFDM_RATE54M] = DESC92C_RATE54M, 255 .maps[RTL_RC_OFDM_RATE54M] = DESC92_RATE54M,
256 .maps[RTL_RC_HT_RATEMCS7] = DESC92C_RATEMCS7, 256 .maps[RTL_RC_HT_RATEMCS7] = DESC92_RATEMCS7,
257 .maps[RTL_RC_HT_RATEMCS15] = DESC92C_RATEMCS15, 257 .maps[RTL_RC_HT_RATEMCS15] = DESC92_RATEMCS15,
258}; 258};
259 259
260#define USB_VENDER_ID_REALTEK 0x0bda 260#define USB_VENDER_ID_REALTEK 0x0bda
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index 906e7aa55bc3..c4161148e0d8 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -337,10 +337,10 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw,
337 rx_status->flag |= RX_FLAG_MACTIME_MPDU; 337 rx_status->flag |= RX_FLAG_MACTIME_MPDU;
338 if (stats->decrypted) 338 if (stats->decrypted)
339 rx_status->flag |= RX_FLAG_DECRYPTED; 339 rx_status->flag |= RX_FLAG_DECRYPTED;
340 rx_status->rate_idx = _rtl92c_rate_mapping(hw, 340 rx_status->rate_idx = rtlwifi_rate_mapping(hw,
341 (bool)GET_RX_DESC_RX_HT(pdesc), 341 (bool)GET_RX_DESC_RX_HT(pdesc),
342 (u8)GET_RX_DESC_RX_MCS(pdesc), 342 (u8)GET_RX_DESC_RX_MCS(pdesc),
343 (bool)GET_RX_DESC_PAGGR(pdesc)); 343 (bool)GET_RX_DESC_PAGGR(pdesc));
344 rx_status->mactime = GET_RX_DESC_TSFL(pdesc); 344 rx_status->mactime = GET_RX_DESC_TSFL(pdesc);
345 if (phystatus) { 345 if (phystatus) {
346 p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE); 346 p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE);
@@ -406,11 +406,10 @@ static void _rtl_rx_process(struct ieee80211_hw *hw, struct sk_buff *skb)
406 if (GET_RX_DESC_RX_HT(rxdesc)) 406 if (GET_RX_DESC_RX_HT(rxdesc))
407 rx_status->flag |= RX_FLAG_HT; 407 rx_status->flag |= RX_FLAG_HT;
408 /* Data rate */ 408 /* Data rate */
409 rx_status->rate_idx = _rtl92c_rate_mapping(hw, 409 rx_status->rate_idx = rtlwifi_rate_mapping(hw,
410 (bool)GET_RX_DESC_RX_HT(rxdesc), 410 (bool)GET_RX_DESC_RX_HT(rxdesc),
411 (u8)GET_RX_DESC_RX_MCS(rxdesc), 411 (u8)GET_RX_DESC_RX_MCS(rxdesc),
412 (bool)GET_RX_DESC_PAGGR(rxdesc) 412 (bool)GET_RX_DESC_PAGGR(rxdesc));
413 );
414 /* There is a phy status after this rx descriptor. */ 413 /* There is a phy status after this rx descriptor. */
415 if (GET_RX_DESC_PHY_STATUS(rxdesc)) { 414 if (GET_RX_DESC_PHY_STATUS(rxdesc)) {
416 p_drvinfo = (struct rx_fwinfo_92c *)(rxdesc + RTL_RX_DESC_SIZE); 415 p_drvinfo = (struct rx_fwinfo_92c *)(rxdesc + RTL_RX_DESC_SIZE);
@@ -545,7 +544,7 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
545 SET_TX_DESC_RTS_BW(txdesc, 0); 544 SET_TX_DESC_RTS_BW(txdesc, 0);
546 SET_TX_DESC_RTS_SC(txdesc, tcb_desc->rts_sc); 545 SET_TX_DESC_RTS_SC(txdesc, tcb_desc->rts_sc);
547 SET_TX_DESC_RTS_SHORT(txdesc, 546 SET_TX_DESC_RTS_SHORT(txdesc,
548 ((tcb_desc->rts_rate <= DESC92C_RATE54M) ? 547 ((tcb_desc->rts_rate <= DESC92_RATE54M) ?
549 (tcb_desc->rts_use_shortpreamble ? 1 : 0) 548 (tcb_desc->rts_use_shortpreamble ? 1 : 0)
550 : (tcb_desc->rts_use_shortgi ? 1 : 0))); 549 : (tcb_desc->rts_use_shortgi ? 1 : 0)));
551 if (mac->bw_40) { 550 if (mac->bw_40) {
@@ -643,7 +642,7 @@ void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 * pDesc,
643 } 642 }
644 SET_TX_DESC_USE_RATE(pDesc, 1); /* use data rate which is set by Sw */ 643 SET_TX_DESC_USE_RATE(pDesc, 1); /* use data rate which is set by Sw */
645 SET_TX_DESC_OWN(pDesc, 1); 644 SET_TX_DESC_OWN(pDesc, 1);
646 SET_TX_DESC_TX_RATE(pDesc, DESC92C_RATE1M); 645 SET_TX_DESC_TX_RATE(pDesc, DESC92_RATE1M);
647 _rtl_tx_desc_checksum(pDesc); 646 _rtl_tx_desc_checksum(pDesc);
648} 647}
649 648
@@ -659,7 +658,7 @@ void rtl92cu_tx_fill_cmddesc(struct ieee80211_hw *hw,
659 memset((void *)pdesc, 0, RTL_TX_HEADER_SIZE); 658 memset((void *)pdesc, 0, RTL_TX_HEADER_SIZE);
660 if (firstseg) 659 if (firstseg)
661 SET_TX_DESC_OFFSET(pdesc, RTL_TX_HEADER_SIZE); 660 SET_TX_DESC_OFFSET(pdesc, RTL_TX_HEADER_SIZE);
662 SET_TX_DESC_TX_RATE(pdesc, DESC92C_RATE1M); 661 SET_TX_DESC_TX_RATE(pdesc, DESC92_RATE1M);
663 SET_TX_DESC_SEQ(pdesc, 0); 662 SET_TX_DESC_SEQ(pdesc, 0);
664 SET_TX_DESC_LINIP(pdesc, 0); 663 SET_TX_DESC_LINIP(pdesc, 0);
665 SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue); 664 SET_TX_DESC_QUEUE_SEL(pdesc, fw_queue);