aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2011-08-22 17:50:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-24 14:57:20 -0400
commit8e35337731abb901f3ae20ebc3f44a50ba6953e9 (patch)
tree5a3430d88142477fe10c6c91045dde9e9dacfcd2
parent2b67e88f648f3b16783feb09178719380150e51f (diff)
rtlwifi: rtl8192se: Convert to use the new rate-mapping routine in rtlwifi
This patch also deletes the now unused parts of rtl8192se/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>
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/def.h39
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/sw.c30
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.c124
3 files changed, 32 insertions, 161 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/def.h b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
index 69828f2b3fab..68204ea175dd 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/def.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/def.h
@@ -33,37 +33,6 @@
33#define RX_CMD_QUEUE 1 33#define RX_CMD_QUEUE 1
34#define RX_MAX_QUEUE 2 34#define RX_MAX_QUEUE 2
35 35
36#define DESC92S_RATE1M 0x00
37#define DESC92S_RATE2M 0x01
38#define DESC92S_RATE5_5M 0x02
39#define DESC92S_RATE11M 0x03
40#define DESC92S_RATE6M 0x04
41#define DESC92S_RATE9M 0x05
42#define DESC92S_RATE12M 0x06
43#define DESC92S_RATE18M 0x07
44#define DESC92S_RATE24M 0x08
45#define DESC92S_RATE36M 0x09
46#define DESC92S_RATE48M 0x0a
47#define DESC92S_RATE54M 0x0b
48#define DESC92S_RATEMCS0 0x0c
49#define DESC92S_RATEMCS1 0x0d
50#define DESC92S_RATEMCS2 0x0e
51#define DESC92S_RATEMCS3 0x0f
52#define DESC92S_RATEMCS4 0x10
53#define DESC92S_RATEMCS5 0x11
54#define DESC92S_RATEMCS6 0x12
55#define DESC92S_RATEMCS7 0x13
56#define DESC92S_RATEMCS8 0x14
57#define DESC92S_RATEMCS9 0x15
58#define DESC92S_RATEMCS10 0x16
59#define DESC92S_RATEMCS11 0x17
60#define DESC92S_RATEMCS12 0x18
61#define DESC92S_RATEMCS13 0x19
62#define DESC92S_RATEMCS14 0x1a
63#define DESC92S_RATEMCS15 0x1b
64#define DESC92S_RATEMCS15_SG 0x1c
65#define DESC92S_RATEMCS32 0x20
66
67#define SHORT_SLOT_TIME 9 36#define SHORT_SLOT_TIME 9
68#define NON_SHORT_SLOT_TIME 20 37#define NON_SHORT_SLOT_TIME 20
69 38
@@ -491,10 +460,10 @@ do { \
491 SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val) 460 SET_BITS_OFFSET_LE(__pdesc + 24, 0, 32, __val)
492 461
493#define RX_HAL_IS_CCK_RATE(_pdesc)\ 462#define RX_HAL_IS_CCK_RATE(_pdesc)\
494 (GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92S_RATE1M || \ 463 (GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE1M || \
495 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92S_RATE2M || \ 464 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE2M || \
496 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92S_RATE5_5M ||\ 465 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE5_5M ||\
497 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92S_RATE11M) 466 GET_RX_STATUS_DESC_RX_MCS(_pdesc) == DESC92_RATE11M)
498 467
499enum rf_optype { 468enum rf_optype {
500 RF_OP_BY_SW_3WIRE = 0, 469 RF_OP_BY_SW_3WIRE = 0,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index 3876078a63de..0055a1c845a2 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -348,21 +348,21 @@ static struct rtl_hal_cfg rtl92se_hal_cfg = {
348 .maps[RTL_IMR_ROK] = IMR_ROK, 348 .maps[RTL_IMR_ROK] = IMR_ROK,
349 .maps[RTL_IBSS_INT_MASKS] = (IMR_BCNINT | IMR_TBDOK | IMR_TBDER), 349 .maps[RTL_IBSS_INT_MASKS] = (IMR_BCNINT | IMR_TBDOK | IMR_TBDER),
350 350
351 .maps[RTL_RC_CCK_RATE1M] = DESC92S_RATE1M, 351 .maps[RTL_RC_CCK_RATE1M] = DESC92_RATE1M,
352 .maps[RTL_RC_CCK_RATE2M] = DESC92S_RATE2M, 352 .maps[RTL_RC_CCK_RATE2M] = DESC92_RATE2M,
353 .maps[RTL_RC_CCK_RATE5_5M] = DESC92S_RATE5_5M, 353 .maps[RTL_RC_CCK_RATE5_5M] = DESC92_RATE5_5M,
354 .maps[RTL_RC_CCK_RATE11M] = DESC92S_RATE11M, 354 .maps[RTL_RC_CCK_RATE11M] = DESC92_RATE11M,
355 .maps[RTL_RC_OFDM_RATE6M] = DESC92S_RATE6M, 355 .maps[RTL_RC_OFDM_RATE6M] = DESC92_RATE6M,
356 .maps[RTL_RC_OFDM_RATE9M] = DESC92S_RATE9M, 356 .maps[RTL_RC_OFDM_RATE9M] = DESC92_RATE9M,
357 .maps[RTL_RC_OFDM_RATE12M] = DESC92S_RATE12M, 357 .maps[RTL_RC_OFDM_RATE12M] = DESC92_RATE12M,
358 .maps[RTL_RC_OFDM_RATE18M] = DESC92S_RATE18M, 358 .maps[RTL_RC_OFDM_RATE18M] = DESC92_RATE18M,
359 .maps[RTL_RC_OFDM_RATE24M] = DESC92S_RATE24M, 359 .maps[RTL_RC_OFDM_RATE24M] = DESC92_RATE24M,
360 .maps[RTL_RC_OFDM_RATE36M] = DESC92S_RATE36M, 360 .maps[RTL_RC_OFDM_RATE36M] = DESC92_RATE36M,
361 .maps[RTL_RC_OFDM_RATE48M] = DESC92S_RATE48M, 361 .maps[RTL_RC_OFDM_RATE48M] = DESC92_RATE48M,
362 .maps[RTL_RC_OFDM_RATE54M] = DESC92S_RATE54M, 362 .maps[RTL_RC_OFDM_RATE54M] = DESC92_RATE54M,
363 363
364 .maps[RTL_RC_HT_RATEMCS7] = DESC92S_RATEMCS7, 364 .maps[RTL_RC_HT_RATEMCS7] = DESC92_RATEMCS7,
365 .maps[RTL_RC_HT_RATEMCS15] = DESC92S_RATEMCS15, 365 .maps[RTL_RC_HT_RATEMCS15] = DESC92_RATEMCS15,
366}; 366};
367 367
368static struct pci_device_id rtl92se_pci_ids[] __devinitdata = { 368static struct pci_device_id rtl92se_pci_ids[] __devinitdata = {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index cffe30851f79..d9aeae7f8bdb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -51,104 +51,6 @@ static u8 _rtl92se_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 skb_queue)
51 return skb->priority; 51 return skb->priority;
52} 52}
53 53
54static int _rtl92se_rate_mapping(bool isht, u8 desc_rate, bool first_ampdu)
55{
56 int rate_idx = 0;
57
58 if (first_ampdu) {
59 if (false == isht) {
60 switch (desc_rate) {
61 case DESC92S_RATE1M:
62 rate_idx = 0;
63 break;
64 case DESC92S_RATE2M:
65 rate_idx = 1;
66 break;
67 case DESC92S_RATE5_5M:
68 rate_idx = 2;
69 break;
70 case DESC92S_RATE11M:
71 rate_idx = 3;
72 break;
73 case DESC92S_RATE6M:
74 rate_idx = 4;
75 break;
76 case DESC92S_RATE9M:
77 rate_idx = 5;
78 break;
79 case DESC92S_RATE12M:
80 rate_idx = 6;
81 break;
82 case DESC92S_RATE18M:
83 rate_idx = 7;
84 break;
85 case DESC92S_RATE24M:
86 rate_idx = 8;
87 break;
88 case DESC92S_RATE36M:
89 rate_idx = 9;
90 break;
91 case DESC92S_RATE48M:
92 rate_idx = 10;
93 break;
94 case DESC92S_RATE54M:
95 rate_idx = 11;
96 break;
97 default:
98 rate_idx = 0;
99 break;
100 }
101 } else {
102 rate_idx = 11;
103 }
104
105 return rate_idx;
106 }
107
108 switch (desc_rate) {
109 case DESC92S_RATE1M:
110 rate_idx = 0;
111 break;
112 case DESC92S_RATE2M:
113 rate_idx = 1;
114 break;
115 case DESC92S_RATE5_5M:
116 rate_idx = 2;
117 break;
118 case DESC92S_RATE11M:
119 rate_idx = 3;
120 break;
121 case DESC92S_RATE6M:
122 rate_idx = 4;
123 break;
124 case DESC92S_RATE9M:
125 rate_idx = 5;
126 break;
127 case DESC92S_RATE12M:
128 rate_idx = 6;
129 break;
130 case DESC92S_RATE18M:
131 rate_idx = 7;
132 break;
133 case DESC92S_RATE24M:
134 rate_idx = 8;
135 break;
136 case DESC92S_RATE36M:
137 rate_idx = 9;
138 break;
139 case DESC92S_RATE48M:
140 rate_idx = 10;
141 break;
142 case DESC92S_RATE54M:
143 rate_idx = 11;
144 break;
145 default:
146 rate_idx = 11;
147 break;
148 }
149 return rate_idx;
150}
151
152static u8 _rtl92s_query_rxpwrpercentage(char antpower) 54static u8 _rtl92s_query_rxpwrpercentage(char antpower)
153{ 55{
154 if ((antpower <= -100) || (antpower >= 20)) 56 if ((antpower <= -100) || (antpower >= 20))
@@ -345,8 +247,8 @@ static void _rtl92se_query_rxphystatus(struct ieee80211_hw *hw,
345 pstats->recvsignalpower = rx_pwr_all; 247 pstats->recvsignalpower = rx_pwr_all;
346 248
347 if (GET_RX_STATUS_DESC_RX_HT(pdesc) && 249 if (GET_RX_STATUS_DESC_RX_HT(pdesc) &&
348 GET_RX_STATUS_DESC_RX_MCS(pdesc) >= DESC92S_RATEMCS8 && 250 GET_RX_STATUS_DESC_RX_MCS(pdesc) >= DESC92_RATEMCS8 &&
349 GET_RX_STATUS_DESC_RX_MCS(pdesc) <= DESC92S_RATEMCS15) 251 GET_RX_STATUS_DESC_RX_MCS(pdesc) <= DESC92_RATEMCS15)
350 max_spatial_stream = 2; 252 max_spatial_stream = 2;
351 else 253 else
352 max_spatial_stream = 1; 254 max_spatial_stream = 1;
@@ -654,10 +556,10 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
654 if (stats->decrypted) 556 if (stats->decrypted)
655 rx_status->flag |= RX_FLAG_DECRYPTED; 557 rx_status->flag |= RX_FLAG_DECRYPTED;
656 558
657 rx_status->rate_idx = _rtl92se_rate_mapping((bool) 559 rx_status->rate_idx = rtlwifi_rate_mapping(hw,
658 GET_RX_STATUS_DESC_RX_HT(pdesc), 560 (bool)GET_RX_STATUS_DESC_RX_HT(pdesc),
659 (u8)GET_RX_STATUS_DESC_RX_MCS(pdesc), 561 (u8)GET_RX_STATUS_DESC_RX_MCS(pdesc),
660 (bool)GET_RX_STATUS_DESC_PAGGR(pdesc)); 562 (bool)GET_RX_STATUS_DESC_PAGGR(pdesc));
661 563
662 564
663 rx_status->mactime = GET_RX_STATUS_DESC_TSFL(pdesc); 565 rx_status->mactime = GET_RX_STATUS_DESC_TSFL(pdesc);
@@ -723,14 +625,14 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
723 SET_TX_DESC_RSVD_MACID(pdesc, reserved_macid); 625 SET_TX_DESC_RSVD_MACID(pdesc, reserved_macid);
724 626
725 SET_TX_DESC_TXHT(pdesc, ((ptcb_desc->hw_rate >= 627 SET_TX_DESC_TXHT(pdesc, ((ptcb_desc->hw_rate >=
726 DESC92S_RATEMCS0) ? 1 : 0)); 628 DESC92_RATEMCS0) ? 1 : 0));
727 629
728 if (rtlhal->version == VERSION_8192S_ACUT) { 630 if (rtlhal->version == VERSION_8192S_ACUT) {
729 if (ptcb_desc->hw_rate == DESC92S_RATE1M || 631 if (ptcb_desc->hw_rate == DESC92_RATE1M ||
730 ptcb_desc->hw_rate == DESC92S_RATE2M || 632 ptcb_desc->hw_rate == DESC92_RATE2M ||
731 ptcb_desc->hw_rate == DESC92S_RATE5_5M || 633 ptcb_desc->hw_rate == DESC92_RATE5_5M ||
732 ptcb_desc->hw_rate == DESC92S_RATE11M) { 634 ptcb_desc->hw_rate == DESC92_RATE11M) {
733 ptcb_desc->hw_rate = DESC92S_RATE12M; 635 ptcb_desc->hw_rate = DESC92_RATE12M;
734 } 636 }
735 } 637 }
736 638
@@ -759,7 +661,7 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
759 SET_TX_DESC_RTS_BANDWIDTH(pdesc, 0); 661 SET_TX_DESC_RTS_BANDWIDTH(pdesc, 0);
760 SET_TX_DESC_RTS_SUB_CARRIER(pdesc, ptcb_desc->rts_sc); 662 SET_TX_DESC_RTS_SUB_CARRIER(pdesc, ptcb_desc->rts_sc);
761 SET_TX_DESC_RTS_SHORT(pdesc, ((ptcb_desc->rts_rate <= 663 SET_TX_DESC_RTS_SHORT(pdesc, ((ptcb_desc->rts_rate <=
762 DESC92S_RATE54M) ? 664 DESC92_RATE54M) ?
763 (ptcb_desc->rts_use_shortpreamble ? 1 : 0) 665 (ptcb_desc->rts_use_shortpreamble ? 1 : 0)
764 : (ptcb_desc->rts_use_shortgi ? 1 : 0))); 666 : (ptcb_desc->rts_use_shortgi ? 1 : 0)));
765 667