diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2011-08-22 17:50:18 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-24 14:57:21 -0400 |
commit | 5b62bb5cc1abe2a2c194833e9266cb78ae36fe61 (patch) | |
tree | 1bbc55f403604f0c3de104ddd9012e8567a6f18d /drivers/net | |
parent | 8e35337731abb901f3ae20ebc3f44a50ba6953e9 (diff) |
rtlwifi: rtl8192de: Convert to use the new rate-mapping routine in rtlwifi
This patch also deletes the now unused parts of rtl8192de/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/rtl8192de/def.h | 35 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/trx.c | 121 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/trx.h | 8 |
4 files changed, 33 insertions, 161 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/def.h b/drivers/net/wireless/rtlwifi/rtl8192de/def.h index f0f5f9bfbb7b..aff7e19714ff 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/def.h +++ b/drivers/net/wireless/rtlwifi/rtl8192de/def.h | |||
@@ -193,41 +193,6 @@ enum rtl_desc_qsel { | |||
193 | QSLT_CMD = 0x13, | 193 | QSLT_CMD = 0x13, |
194 | }; | 194 | }; |
195 | 195 | ||
196 | enum rtl_desc92d_rate { | ||
197 | DESC92D_RATE1M = 0x00, | ||
198 | DESC92D_RATE2M = 0x01, | ||
199 | DESC92D_RATE5_5M = 0x02, | ||
200 | DESC92D_RATE11M = 0x03, | ||
201 | |||
202 | DESC92D_RATE6M = 0x04, | ||
203 | DESC92D_RATE9M = 0x05, | ||
204 | DESC92D_RATE12M = 0x06, | ||
205 | DESC92D_RATE18M = 0x07, | ||
206 | DESC92D_RATE24M = 0x08, | ||
207 | DESC92D_RATE36M = 0x09, | ||
208 | DESC92D_RATE48M = 0x0a, | ||
209 | DESC92D_RATE54M = 0x0b, | ||
210 | |||
211 | DESC92D_RATEMCS0 = 0x0c, | ||
212 | DESC92D_RATEMCS1 = 0x0d, | ||
213 | DESC92D_RATEMCS2 = 0x0e, | ||
214 | DESC92D_RATEMCS3 = 0x0f, | ||
215 | DESC92D_RATEMCS4 = 0x10, | ||
216 | DESC92D_RATEMCS5 = 0x11, | ||
217 | DESC92D_RATEMCS6 = 0x12, | ||
218 | DESC92D_RATEMCS7 = 0x13, | ||
219 | DESC92D_RATEMCS8 = 0x14, | ||
220 | DESC92D_RATEMCS9 = 0x15, | ||
221 | DESC92D_RATEMCS10 = 0x16, | ||
222 | DESC92D_RATEMCS11 = 0x17, | ||
223 | DESC92D_RATEMCS12 = 0x18, | ||
224 | DESC92D_RATEMCS13 = 0x19, | ||
225 | DESC92D_RATEMCS14 = 0x1a, | ||
226 | DESC92D_RATEMCS15 = 0x1b, | ||
227 | DESC92D_RATEMCS15_SG = 0x1c, | ||
228 | DESC92D_RATEMCS32 = 0x20, | ||
229 | }; | ||
230 | |||
231 | enum channel_plan { | 196 | enum channel_plan { |
232 | CHPL_FCC = 0, | 197 | CHPL_FCC = 0, |
233 | CHPL_IC = 1, | 198 | CHPL_IC = 1, |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c index 351765df517d..f6419b7ed2f4 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c | |||
@@ -340,21 +340,21 @@ static struct rtl_hal_cfg rtl92de_hal_cfg = { | |||
340 | .maps[RTL_IMR_ROK] = IMR_ROK, | 340 | .maps[RTL_IMR_ROK] = IMR_ROK, |
341 | .maps[RTL_IBSS_INT_MASKS] = (IMR_BcnInt | IMR_TBDOK | IMR_TBDER), | 341 | .maps[RTL_IBSS_INT_MASKS] = (IMR_BcnInt | IMR_TBDOK | IMR_TBDER), |
342 | 342 | ||
343 | .maps[RTL_RC_CCK_RATE1M] = DESC92D_RATE1M, | 343 | .maps[RTL_RC_CCK_RATE1M] = DESC92_RATE1M, |
344 | .maps[RTL_RC_CCK_RATE2M] = DESC92D_RATE2M, | 344 | .maps[RTL_RC_CCK_RATE2M] = DESC92_RATE2M, |
345 | .maps[RTL_RC_CCK_RATE5_5M] = DESC92D_RATE5_5M, | 345 | .maps[RTL_RC_CCK_RATE5_5M] = DESC92_RATE5_5M, |
346 | .maps[RTL_RC_CCK_RATE11M] = DESC92D_RATE11M, | 346 | .maps[RTL_RC_CCK_RATE11M] = DESC92_RATE11M, |
347 | .maps[RTL_RC_OFDM_RATE6M] = DESC92D_RATE6M, | 347 | .maps[RTL_RC_OFDM_RATE6M] = DESC92_RATE6M, |
348 | .maps[RTL_RC_OFDM_RATE9M] = DESC92D_RATE9M, | 348 | .maps[RTL_RC_OFDM_RATE9M] = DESC92_RATE9M, |
349 | .maps[RTL_RC_OFDM_RATE12M] = DESC92D_RATE12M, | 349 | .maps[RTL_RC_OFDM_RATE12M] = DESC92_RATE12M, |
350 | .maps[RTL_RC_OFDM_RATE18M] = DESC92D_RATE18M, | 350 | .maps[RTL_RC_OFDM_RATE18M] = DESC92_RATE18M, |
351 | .maps[RTL_RC_OFDM_RATE24M] = DESC92D_RATE24M, | 351 | .maps[RTL_RC_OFDM_RATE24M] = DESC92_RATE24M, |
352 | .maps[RTL_RC_OFDM_RATE36M] = DESC92D_RATE36M, | 352 | .maps[RTL_RC_OFDM_RATE36M] = DESC92_RATE36M, |
353 | .maps[RTL_RC_OFDM_RATE48M] = DESC92D_RATE48M, | 353 | .maps[RTL_RC_OFDM_RATE48M] = DESC92_RATE48M, |
354 | .maps[RTL_RC_OFDM_RATE54M] = DESC92D_RATE54M, | 354 | .maps[RTL_RC_OFDM_RATE54M] = DESC92_RATE54M, |
355 | 355 | ||
356 | .maps[RTL_RC_HT_RATEMCS7] = DESC92D_RATEMCS7, | 356 | .maps[RTL_RC_HT_RATEMCS7] = DESC92_RATEMCS7, |
357 | .maps[RTL_RC_HT_RATEMCS15] = DESC92D_RATEMCS15, | 357 | .maps[RTL_RC_HT_RATEMCS15] = DESC92_RATEMCS15, |
358 | }; | 358 | }; |
359 | 359 | ||
360 | static struct pci_device_id rtl92de_pci_ids[] __devinitdata = { | 360 | static struct pci_device_id rtl92de_pci_ids[] __devinitdata = { |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c index dc86fcb0b3a3..3637c0c33525 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c | |||
@@ -48,99 +48,6 @@ static u8 _rtl92de_map_hwqueue_to_fwqueue(struct sk_buff *skb, u8 hw_queue) | |||
48 | return skb->priority; | 48 | return skb->priority; |
49 | } | 49 | } |
50 | 50 | ||
51 | static int _rtl92de_rate_mapping(bool isht, u8 desc_rate) | ||
52 | { | ||
53 | int rate_idx; | ||
54 | |||
55 | if (false == isht) { | ||
56 | switch (desc_rate) { | ||
57 | case DESC92D_RATE1M: | ||
58 | rate_idx = 0; | ||
59 | break; | ||
60 | case DESC92D_RATE2M: | ||
61 | rate_idx = 1; | ||
62 | break; | ||
63 | case DESC92D_RATE5_5M: | ||
64 | rate_idx = 2; | ||
65 | break; | ||
66 | case DESC92D_RATE11M: | ||
67 | rate_idx = 3; | ||
68 | break; | ||
69 | case DESC92D_RATE6M: | ||
70 | rate_idx = 4; | ||
71 | break; | ||
72 | case DESC92D_RATE9M: | ||
73 | rate_idx = 5; | ||
74 | break; | ||
75 | case DESC92D_RATE12M: | ||
76 | rate_idx = 6; | ||
77 | break; | ||
78 | case DESC92D_RATE18M: | ||
79 | rate_idx = 7; | ||
80 | break; | ||
81 | case DESC92D_RATE24M: | ||
82 | rate_idx = 8; | ||
83 | break; | ||
84 | case DESC92D_RATE36M: | ||
85 | rate_idx = 9; | ||
86 | break; | ||
87 | case DESC92D_RATE48M: | ||
88 | rate_idx = 10; | ||
89 | break; | ||
90 | case DESC92D_RATE54M: | ||
91 | rate_idx = 11; | ||
92 | break; | ||
93 | default: | ||
94 | rate_idx = 0; | ||
95 | break; | ||
96 | } | ||
97 | return rate_idx; | ||
98 | } else { | ||
99 | switch (desc_rate) { | ||
100 | case DESC92D_RATE1M: | ||
101 | rate_idx = 0; | ||
102 | break; | ||
103 | case DESC92D_RATE2M: | ||
104 | rate_idx = 1; | ||
105 | break; | ||
106 | case DESC92D_RATE5_5M: | ||
107 | rate_idx = 2; | ||
108 | break; | ||
109 | case DESC92D_RATE11M: | ||
110 | rate_idx = 3; | ||
111 | break; | ||
112 | case DESC92D_RATE6M: | ||
113 | rate_idx = 4; | ||
114 | break; | ||
115 | case DESC92D_RATE9M: | ||
116 | rate_idx = 5; | ||
117 | break; | ||
118 | case DESC92D_RATE12M: | ||
119 | rate_idx = 6; | ||
120 | break; | ||
121 | case DESC92D_RATE18M: | ||
122 | rate_idx = 7; | ||
123 | break; | ||
124 | case DESC92D_RATE24M: | ||
125 | rate_idx = 8; | ||
126 | break; | ||
127 | case DESC92D_RATE36M: | ||
128 | rate_idx = 9; | ||
129 | break; | ||
130 | case DESC92D_RATE48M: | ||
131 | rate_idx = 10; | ||
132 | break; | ||
133 | case DESC92D_RATE54M: | ||
134 | rate_idx = 11; | ||
135 | break; | ||
136 | default: | ||
137 | rate_idx = 11; | ||
138 | break; | ||
139 | } | ||
140 | return rate_idx; | ||
141 | } | ||
142 | } | ||
143 | |||
144 | static u8 _rtl92d_query_rxpwrpercentage(char antpower) | 51 | static u8 _rtl92d_query_rxpwrpercentage(char antpower) |
145 | { | 52 | { |
146 | if ((antpower <= -100) || (antpower >= 20)) | 53 | if ((antpower <= -100) || (antpower >= 20)) |
@@ -328,8 +235,8 @@ static void _rtl92de_query_rxphystatus(struct ieee80211_hw *hw, | |||
328 | pstats->rx_pwdb_all = pwdb_all; | 235 | pstats->rx_pwdb_all = pwdb_all; |
329 | pstats->rxpower = rx_pwr_all; | 236 | pstats->rxpower = rx_pwr_all; |
330 | pstats->recvsignalpower = rx_pwr_all; | 237 | pstats->recvsignalpower = rx_pwr_all; |
331 | if (pdesc->rxht && pdesc->rxmcs >= DESC92D_RATEMCS8 && | 238 | if (pdesc->rxht && pdesc->rxmcs >= DESC92_RATEMCS8 && |
332 | pdesc->rxmcs <= DESC92D_RATEMCS15) | 239 | pdesc->rxmcs <= DESC92_RATEMCS15) |
333 | max_spatial_stream = 2; | 240 | max_spatial_stream = 2; |
334 | else | 241 | else |
335 | max_spatial_stream = 1; | 242 | max_spatial_stream = 1; |
@@ -609,10 +516,10 @@ bool rtl92de_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats, | |||
609 | rx_status->flag |= RX_FLAG_MACTIME_MPDU; | 516 | rx_status->flag |= RX_FLAG_MACTIME_MPDU; |
610 | if (stats->decrypted) | 517 | if (stats->decrypted) |
611 | rx_status->flag |= RX_FLAG_DECRYPTED; | 518 | rx_status->flag |= RX_FLAG_DECRYPTED; |
612 | rx_status->rate_idx = _rtl92de_rate_mapping((bool) | 519 | rx_status->rate_idx = rtlwifi_rate_mapping(hw, |
613 | GET_RX_DESC_RXHT(pdesc), | 520 | (bool)GET_RX_DESC_RXHT(pdesc), |
614 | (u8) | 521 | (u8)GET_RX_DESC_RXMCS(pdesc), |
615 | GET_RX_DESC_RXMCS(pdesc)); | 522 | (bool)GET_RX_DESC_PAGGR(pdesc)); |
616 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); | 523 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); |
617 | if (phystatus) { | 524 | if (phystatus) { |
618 | p_drvinfo = (struct rx_fwinfo_92d *)(skb->data + | 525 | p_drvinfo = (struct rx_fwinfo_92d *)(skb->data + |
@@ -705,14 +612,14 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw, | |||
705 | } | 612 | } |
706 | /* 5G have no CCK rate */ | 613 | /* 5G have no CCK rate */ |
707 | if (rtlhal->current_bandtype == BAND_ON_5G) | 614 | if (rtlhal->current_bandtype == BAND_ON_5G) |
708 | if (ptcb_desc->hw_rate < DESC92D_RATE6M) | 615 | if (ptcb_desc->hw_rate < DESC92_RATE6M) |
709 | ptcb_desc->hw_rate = DESC92D_RATE6M; | 616 | ptcb_desc->hw_rate = DESC92_RATE6M; |
710 | SET_TX_DESC_TX_RATE(pdesc, ptcb_desc->hw_rate); | 617 | SET_TX_DESC_TX_RATE(pdesc, ptcb_desc->hw_rate); |
711 | if (ptcb_desc->use_shortgi || ptcb_desc->use_shortpreamble) | 618 | if (ptcb_desc->use_shortgi || ptcb_desc->use_shortpreamble) |
712 | SET_TX_DESC_DATA_SHORTGI(pdesc, 1); | 619 | SET_TX_DESC_DATA_SHORTGI(pdesc, 1); |
713 | 620 | ||
714 | if (rtlhal->macphymode == DUALMAC_DUALPHY && | 621 | if (rtlhal->macphymode == DUALMAC_DUALPHY && |
715 | ptcb_desc->hw_rate == DESC92D_RATEMCS7) | 622 | ptcb_desc->hw_rate == DESC92_RATEMCS7) |
716 | SET_TX_DESC_DATA_SHORTGI(pdesc, 1); | 623 | SET_TX_DESC_DATA_SHORTGI(pdesc, 1); |
717 | 624 | ||
718 | if (info->flags & IEEE80211_TX_CTL_AMPDU) { | 625 | if (info->flags & IEEE80211_TX_CTL_AMPDU) { |
@@ -728,13 +635,13 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw, | |||
728 | SET_TX_DESC_RTS_STBC(pdesc, ((ptcb_desc->rts_stbc) ? 1 : 0)); | 635 | SET_TX_DESC_RTS_STBC(pdesc, ((ptcb_desc->rts_stbc) ? 1 : 0)); |
729 | /* 5G have no CCK rate */ | 636 | /* 5G have no CCK rate */ |
730 | if (rtlhal->current_bandtype == BAND_ON_5G) | 637 | if (rtlhal->current_bandtype == BAND_ON_5G) |
731 | if (ptcb_desc->rts_rate < DESC92D_RATE6M) | 638 | if (ptcb_desc->rts_rate < DESC92_RATE6M) |
732 | ptcb_desc->rts_rate = DESC92D_RATE6M; | 639 | ptcb_desc->rts_rate = DESC92_RATE6M; |
733 | SET_TX_DESC_RTS_RATE(pdesc, ptcb_desc->rts_rate); | 640 | SET_TX_DESC_RTS_RATE(pdesc, ptcb_desc->rts_rate); |
734 | SET_TX_DESC_RTS_BW(pdesc, 0); | 641 | SET_TX_DESC_RTS_BW(pdesc, 0); |
735 | SET_TX_DESC_RTS_SC(pdesc, ptcb_desc->rts_sc); | 642 | SET_TX_DESC_RTS_SC(pdesc, ptcb_desc->rts_sc); |
736 | SET_TX_DESC_RTS_SHORT(pdesc, ((ptcb_desc->rts_rate <= | 643 | SET_TX_DESC_RTS_SHORT(pdesc, ((ptcb_desc->rts_rate <= |
737 | DESC92D_RATE54M) ? | 644 | DESC92_RATE54M) ? |
738 | (ptcb_desc->rts_use_shortpreamble ? 1 : 0) : | 645 | (ptcb_desc->rts_use_shortpreamble ? 1 : 0) : |
739 | (ptcb_desc->rts_use_shortgi ? 1 : 0))); | 646 | (ptcb_desc->rts_use_shortgi ? 1 : 0))); |
740 | if (bw_40) { | 647 | if (bw_40) { |
@@ -844,9 +751,9 @@ void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw, | |||
844 | * The braces are needed no matter what checkpatch says | 751 | * The braces are needed no matter what checkpatch says |
845 | */ | 752 | */ |
846 | if (rtlhal->current_bandtype == BAND_ON_5G) { | 753 | if (rtlhal->current_bandtype == BAND_ON_5G) { |
847 | SET_TX_DESC_TX_RATE(pdesc, DESC92D_RATE6M); | 754 | SET_TX_DESC_TX_RATE(pdesc, DESC92_RATE6M); |
848 | } else { | 755 | } else { |
849 | SET_TX_DESC_TX_RATE(pdesc, DESC92D_RATE1M); | 756 | SET_TX_DESC_TX_RATE(pdesc, DESC92_RATE1M); |
850 | } | 757 | } |
851 | SET_TX_DESC_SEQ(pdesc, 0); | 758 | SET_TX_DESC_SEQ(pdesc, 0); |
852 | SET_TX_DESC_LINIP(pdesc, 0); | 759 | SET_TX_DESC_LINIP(pdesc, 0); |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h index 992d6766e667..6c2236868c9a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h +++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h | |||
@@ -538,10 +538,10 @@ do { \ | |||
538 | } while (0); | 538 | } while (0); |
539 | 539 | ||
540 | #define RX_HAL_IS_CCK_RATE(_pdesc)\ | 540 | #define RX_HAL_IS_CCK_RATE(_pdesc)\ |
541 | (_pdesc->rxmcs == DESC92D_RATE1M || \ | 541 | (_pdesc->rxmcs == DESC92_RATE1M || \ |
542 | _pdesc->rxmcs == DESC92D_RATE2M || \ | 542 | _pdesc->rxmcs == DESC92_RATE2M || \ |
543 | _pdesc->rxmcs == DESC92D_RATE5_5M || \ | 543 | _pdesc->rxmcs == DESC92_RATE5_5M || \ |
544 | _pdesc->rxmcs == DESC92D_RATE11M) | 544 | _pdesc->rxmcs == DESC92_RATE11M) |
545 | 545 | ||
546 | /* For 92D early mode */ | 546 | /* For 92D early mode */ |
547 | #define SET_EARLYMODE_PKTNUM(__paddr, __value) \ | 547 | #define SET_EARLYMODE_PKTNUM(__paddr, __value) \ |