diff options
author | Chaoming_Li <chaoming_li@realsil.com.cn> | 2011-04-25 13:52:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-26 16:13:31 -0400 |
commit | e25f51d4f9f8c45382a33b6283418be46425195c (patch) | |
tree | a51fe868df7404a0b50f6ca1ccef9560b07db275 /drivers/net | |
parent | 0915cba394268e68b6a8242b15f8c7283453df43 (diff) |
rtlwifi: Change efuse routines addition of RTL8192SE and RTL8192DE
Change efuse routines for addition of RTL8192SE and RTL8192DE code
Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/rtlwifi/efuse.c | 99 | ||||
-rw-r--r-- | drivers/net/wireless/rtlwifi/efuse.h | 5 |
2 files changed, 66 insertions, 38 deletions
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c index 5d73c0f7012c..664703ce9da8 100644 --- a/drivers/net/wireless/rtlwifi/efuse.c +++ b/drivers/net/wireless/rtlwifi/efuse.c | |||
@@ -52,8 +52,6 @@ static const struct efuse_map RTL8712_SDIO_EFUSE_TABLE[] = { | |||
52 | {11, 0, 0, 28} | 52 | {11, 0, 0, 28} |
53 | }; | 53 | }; |
54 | 54 | ||
55 | static void read_efuse_byte(struct ieee80211_hw *hw, u16 _offset, | ||
56 | u8 *pbuf); | ||
57 | static void efuse_shadow_read_1byte(struct ieee80211_hw *hw, u16 offset, | 55 | static void efuse_shadow_read_1byte(struct ieee80211_hw *hw, u16 offset, |
58 | u8 *value); | 56 | u8 *value); |
59 | static void efuse_shadow_read_2byte(struct ieee80211_hw *hw, u16 offset, | 57 | static void efuse_shadow_read_2byte(struct ieee80211_hw *hw, u16 offset, |
@@ -79,7 +77,7 @@ static void efuse_word_enable_data_read(u8 word_en, u8 *sourdata, | |||
79 | u8 *targetdata); | 77 | u8 *targetdata); |
80 | static u8 efuse_word_enable_data_write(struct ieee80211_hw *hw, | 78 | static u8 efuse_word_enable_data_write(struct ieee80211_hw *hw, |
81 | u16 efuse_addr, u8 word_en, u8 *data); | 79 | u16 efuse_addr, u8 word_en, u8 *data); |
82 | static void efuse_power_switch(struct ieee80211_hw *hw, u8 bwrite, | 80 | static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, |
83 | u8 pwrstate); | 81 | u8 pwrstate); |
84 | static u16 efuse_get_current_size(struct ieee80211_hw *hw); | 82 | static u16 efuse_get_current_size(struct ieee80211_hw *hw); |
85 | static u8 efuse_calculate_word_cnts(u8 word_en); | 83 | static u8 efuse_calculate_word_cnts(u8 word_en); |
@@ -115,8 +113,10 @@ u8 efuse_read_1byte(struct ieee80211_hw *hw, u16 address) | |||
115 | u8 bytetemp; | 113 | u8 bytetemp; |
116 | u8 temp; | 114 | u8 temp; |
117 | u32 k = 0; | 115 | u32 k = 0; |
116 | const u32 efuse_len = | ||
117 | rtlpriv->cfg->maps[EFUSE_REAL_CONTENT_SIZE]; | ||
118 | 118 | ||
119 | if (address < EFUSE_REAL_CONTENT_LEN) { | 119 | if (address < efuse_len) { |
120 | temp = address & 0xFF; | 120 | temp = address & 0xFF; |
121 | rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_CTRL] + 1, | 121 | rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_CTRL] + 1, |
122 | temp); | 122 | temp); |
@@ -158,11 +158,13 @@ void efuse_write_1byte(struct ieee80211_hw *hw, u16 address, u8 value) | |||
158 | u8 bytetemp; | 158 | u8 bytetemp; |
159 | u8 temp; | 159 | u8 temp; |
160 | u32 k = 0; | 160 | u32 k = 0; |
161 | const u32 efuse_len = | ||
162 | rtlpriv->cfg->maps[EFUSE_REAL_CONTENT_SIZE]; | ||
161 | 163 | ||
162 | RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, | 164 | RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, |
163 | ("Addr=%x Data =%x\n", address, value)); | 165 | ("Addr=%x Data =%x\n", address, value)); |
164 | 166 | ||
165 | if (address < EFUSE_REAL_CONTENT_LEN) { | 167 | if (address < efuse_len) { |
166 | rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_CTRL], value); | 168 | rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_CTRL], value); |
167 | 169 | ||
168 | temp = address & 0xFF; | 170 | temp = address & 0xFF; |
@@ -198,7 +200,7 @@ void efuse_write_1byte(struct ieee80211_hw *hw, u16 address, u8 value) | |||
198 | 200 | ||
199 | } | 201 | } |
200 | 202 | ||
201 | static void read_efuse_byte(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf) | 203 | void read_efuse_byte(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf) |
202 | { | 204 | { |
203 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 205 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
204 | u32 value32; | 206 | u32 value32; |
@@ -233,24 +235,28 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) | |||
233 | { | 235 | { |
234 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 236 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
235 | struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); | 237 | struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); |
236 | u8 efuse_tbl[EFUSE_MAP_LEN]; | 238 | u8 efuse_tbl[rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]]; |
237 | u8 rtemp8[1]; | 239 | u8 rtemp8[1]; |
238 | u16 efuse_addr = 0; | 240 | u16 efuse_addr = 0; |
239 | u8 offset, wren; | 241 | u8 offset, wren; |
240 | u16 i; | 242 | u16 i; |
241 | u16 j; | 243 | u16 j; |
242 | u16 efuse_word[EFUSE_MAX_SECTION][EFUSE_MAX_WORD_UNIT]; | 244 | const u16 efuse_max_section = |
245 | rtlpriv->cfg->maps[EFUSE_MAX_SECTION_MAP]; | ||
246 | const u32 efuse_len = | ||
247 | rtlpriv->cfg->maps[EFUSE_REAL_CONTENT_SIZE]; | ||
248 | u16 efuse_word[efuse_max_section][EFUSE_MAX_WORD_UNIT]; | ||
243 | u16 efuse_utilized = 0; | 249 | u16 efuse_utilized = 0; |
244 | u8 efuse_usage; | 250 | u8 efuse_usage; |
245 | 251 | ||
246 | if ((_offset + _size_byte) > EFUSE_MAP_LEN) { | 252 | if ((_offset + _size_byte) > rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]) { |
247 | RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, | 253 | RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, |
248 | ("read_efuse(): Invalid offset(%#x) with read " | 254 | ("read_efuse(): Invalid offset(%#x) with read " |
249 | "bytes(%#x)!!\n", _offset, _size_byte)); | 255 | "bytes(%#x)!!\n", _offset, _size_byte)); |
250 | return; | 256 | return; |
251 | } | 257 | } |
252 | 258 | ||
253 | for (i = 0; i < EFUSE_MAX_SECTION; i++) | 259 | for (i = 0; i < efuse_max_section; i++) |
254 | for (j = 0; j < EFUSE_MAX_WORD_UNIT; j++) | 260 | for (j = 0; j < EFUSE_MAX_WORD_UNIT; j++) |
255 | efuse_word[i][j] = 0xFFFF; | 261 | efuse_word[i][j] = 0xFFFF; |
256 | 262 | ||
@@ -262,10 +268,10 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) | |||
262 | efuse_addr++; | 268 | efuse_addr++; |
263 | } | 269 | } |
264 | 270 | ||
265 | while ((*rtemp8 != 0xFF) && (efuse_addr < EFUSE_REAL_CONTENT_LEN)) { | 271 | while ((*rtemp8 != 0xFF) && (efuse_addr < efuse_len)) { |
266 | offset = ((*rtemp8 >> 4) & 0x0f); | 272 | offset = ((*rtemp8 >> 4) & 0x0f); |
267 | 273 | ||
268 | if (offset < EFUSE_MAX_SECTION) { | 274 | if (offset < efuse_max_section) { |
269 | wren = (*rtemp8 & 0x0f); | 275 | wren = (*rtemp8 & 0x0f); |
270 | RTPRINT(rtlpriv, FEEPROM, EFUSE_READ_ALL, | 276 | RTPRINT(rtlpriv, FEEPROM, EFUSE_READ_ALL, |
271 | ("offset-%d Worden=%x\n", offset, wren)); | 277 | ("offset-%d Worden=%x\n", offset, wren)); |
@@ -281,7 +287,7 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) | |||
281 | efuse_utilized++; | 287 | efuse_utilized++; |
282 | efuse_word[offset][i] = (*rtemp8 & 0xff); | 288 | efuse_word[offset][i] = (*rtemp8 & 0xff); |
283 | 289 | ||
284 | if (efuse_addr >= EFUSE_REAL_CONTENT_LEN) | 290 | if (efuse_addr >= efuse_len) |
285 | break; | 291 | break; |
286 | 292 | ||
287 | RTPRINT(rtlpriv, FEEPROM, | 293 | RTPRINT(rtlpriv, FEEPROM, |
@@ -294,7 +300,7 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) | |||
294 | efuse_word[offset][i] |= | 300 | efuse_word[offset][i] |= |
295 | (((u16)*rtemp8 << 8) & 0xff00); | 301 | (((u16)*rtemp8 << 8) & 0xff00); |
296 | 302 | ||
297 | if (efuse_addr >= EFUSE_REAL_CONTENT_LEN) | 303 | if (efuse_addr >= efuse_len) |
298 | break; | 304 | break; |
299 | } | 305 | } |
300 | 306 | ||
@@ -305,13 +311,13 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) | |||
305 | RTPRINT(rtlpriv, FEEPROM, EFUSE_READ_ALL, | 311 | RTPRINT(rtlpriv, FEEPROM, EFUSE_READ_ALL, |
306 | ("Addr=%d\n", efuse_addr)); | 312 | ("Addr=%d\n", efuse_addr)); |
307 | read_efuse_byte(hw, efuse_addr, rtemp8); | 313 | read_efuse_byte(hw, efuse_addr, rtemp8); |
308 | if (*rtemp8 != 0xFF && (efuse_addr < 512)) { | 314 | if (*rtemp8 != 0xFF && (efuse_addr < efuse_len)) { |
309 | efuse_utilized++; | 315 | efuse_utilized++; |
310 | efuse_addr++; | 316 | efuse_addr++; |
311 | } | 317 | } |
312 | } | 318 | } |
313 | 319 | ||
314 | for (i = 0; i < EFUSE_MAX_SECTION; i++) { | 320 | for (i = 0; i < efuse_max_section; i++) { |
315 | for (j = 0; j < EFUSE_MAX_WORD_UNIT; j++) { | 321 | for (j = 0; j < EFUSE_MAX_WORD_UNIT; j++) { |
316 | efuse_tbl[(i * 8) + (j * 2)] = | 322 | efuse_tbl[(i * 8) + (j * 2)] = |
317 | (efuse_word[i][j] & 0xff); | 323 | (efuse_word[i][j] & 0xff); |
@@ -324,7 +330,7 @@ void read_efuse(struct ieee80211_hw *hw, u16 _offset, u16 _size_byte, u8 *pbuf) | |||
324 | pbuf[i] = efuse_tbl[_offset + i]; | 330 | pbuf[i] = efuse_tbl[_offset + i]; |
325 | 331 | ||
326 | rtlefuse->efuse_usedbytes = efuse_utilized; | 332 | rtlefuse->efuse_usedbytes = efuse_utilized; |
327 | efuse_usage = (u8)((efuse_utilized * 100) / EFUSE_REAL_CONTENT_LEN); | 333 | efuse_usage = (u8) ((efuse_utilized * 100) / efuse_len); |
328 | rtlefuse->efuse_usedpercentage = efuse_usage; | 334 | rtlefuse->efuse_usedpercentage = efuse_usage; |
329 | rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_EFUSE_BYTES, | 335 | rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_EFUSE_BYTES, |
330 | (u8 *)&efuse_utilized); | 336 | (u8 *)&efuse_utilized); |
@@ -478,9 +484,10 @@ void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw) | |||
478 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 484 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
479 | struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); | 485 | struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); |
480 | 486 | ||
481 | if (rtlefuse->autoload_failflag == true) { | 487 | if (rtlefuse->autoload_failflag == true) |
482 | memset(&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], 0xFF, 128); | 488 | memset(&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], 0xFF, |
483 | } else | 489 | rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); |
490 | else | ||
484 | efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]); | 491 | efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]); |
485 | 492 | ||
486 | memcpy(&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0], | 493 | memcpy(&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0], |
@@ -632,8 +639,9 @@ static int efuse_one_byte_write(struct ieee80211_hw *hw, u16 addr, u8 data) | |||
632 | 639 | ||
633 | static void efuse_read_all_map(struct ieee80211_hw *hw, u8 * efuse) | 640 | static void efuse_read_all_map(struct ieee80211_hw *hw, u8 * efuse) |
634 | { | 641 | { |
642 | struct rtl_priv *rtlpriv = rtl_priv(hw); | ||
635 | efuse_power_switch(hw, false, true); | 643 | efuse_power_switch(hw, false, true); |
636 | read_efuse(hw, 0, 128, efuse); | 644 | read_efuse(hw, 0, rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE], efuse); |
637 | efuse_power_switch(hw, false, false); | 645 | efuse_power_switch(hw, false, false); |
638 | } | 646 | } |
639 | 647 | ||
@@ -641,7 +649,7 @@ static void efuse_read_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
641 | u8 efuse_data, u8 offset, u8 *tmpdata, | 649 | u8 efuse_data, u8 offset, u8 *tmpdata, |
642 | u8 *readstate) | 650 | u8 *readstate) |
643 | { | 651 | { |
644 | bool bdataempty = true; | 652 | bool dataempty = true; |
645 | u8 hoffset; | 653 | u8 hoffset; |
646 | u8 tmpidx; | 654 | u8 tmpidx; |
647 | u8 hworden; | 655 | u8 hworden; |
@@ -657,13 +665,13 @@ static void efuse_read_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
657 | &efuse_data)) { | 665 | &efuse_data)) { |
658 | tmpdata[tmpidx] = efuse_data; | 666 | tmpdata[tmpidx] = efuse_data; |
659 | if (efuse_data != 0xff) | 667 | if (efuse_data != 0xff) |
660 | bdataempty = true; | 668 | dataempty = true; |
661 | } | 669 | } |
662 | } | 670 | } |
663 | 671 | ||
664 | if (bdataempty == true) | 672 | if (dataempty == true) { |
665 | *readstate = PG_STATE_DATA; | 673 | *readstate = PG_STATE_DATA; |
666 | else { | 674 | } else { |
667 | *efuse_addr = *efuse_addr + (word_cnts * 2) + 1; | 675 | *efuse_addr = *efuse_addr + (word_cnts * 2) + 1; |
668 | *readstate = PG_STATE_HEADER; | 676 | *readstate = PG_STATE_HEADER; |
669 | } | 677 | } |
@@ -677,9 +685,7 @@ static void efuse_read_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
677 | static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data) | 685 | static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data) |
678 | { | 686 | { |
679 | u8 readstate = PG_STATE_HEADER; | 687 | u8 readstate = PG_STATE_HEADER; |
680 | |||
681 | bool continual = true; | 688 | bool continual = true; |
682 | |||
683 | u8 efuse_data, word_cnts = 0; | 689 | u8 efuse_data, word_cnts = 0; |
684 | u16 efuse_addr = 0; | 690 | u16 efuse_addr = 0; |
685 | u8 tmpdata[8]; | 691 | u8 tmpdata[8]; |
@@ -795,19 +801,20 @@ static void efuse_write_data_case1(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
795 | tmp_word_en &= (~BIT(1)); | 801 | tmp_word_en &= (~BIT(1)); |
796 | 802 | ||
797 | if ((target_pkt->word_en & BIT(2)) ^ | 803 | if ((target_pkt->word_en & BIT(2)) ^ |
798 | (match_word_en & BIT(2))) | 804 | (match_word_en & BIT(2))) |
799 | tmp_word_en &= (~BIT(2)); | 805 | tmp_word_en &= (~BIT(2)); |
800 | 806 | ||
801 | if ((target_pkt->word_en & BIT(3)) ^ | 807 | if ((target_pkt->word_en & BIT(3)) ^ |
802 | (match_word_en & BIT(3))) | 808 | (match_word_en & BIT(3))) |
803 | tmp_word_en &= (~BIT(3)); | 809 | tmp_word_en &= (~BIT(3)); |
804 | 810 | ||
805 | if ((tmp_word_en & 0x0F) != 0x0F) { | 811 | if ((tmp_word_en & 0x0F) != 0x0F) { |
806 | *efuse_addr = efuse_get_current_size(hw); | 812 | *efuse_addr = efuse_get_current_size(hw); |
807 | target_pkt->offset = offset; | 813 | target_pkt->offset = offset; |
808 | target_pkt->word_en = tmp_word_en; | 814 | target_pkt->word_en = tmp_word_en; |
809 | } else | 815 | } else { |
810 | *continual = false; | 816 | *continual = false; |
817 | } | ||
811 | *write_state = PG_STATE_HEADER; | 818 | *write_state = PG_STATE_HEADER; |
812 | *repeat_times += 1; | 819 | *repeat_times += 1; |
813 | if (*repeat_times > EFUSE_REPEAT_THRESHOLD_) { | 820 | if (*repeat_times > EFUSE_REPEAT_THRESHOLD_) { |
@@ -842,9 +849,9 @@ static void efuse_write_data_case2(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
842 | efuse_one_byte_write(hw, *efuse_addr, pg_header); | 849 | efuse_one_byte_write(hw, *efuse_addr, pg_header); |
843 | efuse_one_byte_read(hw, *efuse_addr, &tmp_header); | 850 | efuse_one_byte_read(hw, *efuse_addr, &tmp_header); |
844 | 851 | ||
845 | if (tmp_header == pg_header) | 852 | if (tmp_header == pg_header) { |
846 | *write_state = PG_STATE_DATA; | 853 | *write_state = PG_STATE_DATA; |
847 | else if (tmp_header == 0xFF) { | 854 | } else if (tmp_header == 0xFF) { |
848 | *write_state = PG_STATE_HEADER; | 855 | *write_state = PG_STATE_HEADER; |
849 | *repeat_times += 1; | 856 | *repeat_times += 1; |
850 | if (*repeat_times > EFUSE_REPEAT_THRESHOLD_) { | 857 | if (*repeat_times > EFUSE_REPEAT_THRESHOLD_) { |
@@ -871,11 +878,13 @@ static void efuse_write_data_case2(struct ieee80211_hw *hw, u16 *efuse_addr, | |||
871 | reorg_worden, | 878 | reorg_worden, |
872 | originaldata); | 879 | originaldata); |
873 | *efuse_addr = efuse_get_current_size(hw); | 880 | *efuse_addr = efuse_get_current_size(hw); |
874 | } else | 881 | } else { |
875 | *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) | 882 | *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) |
876 | + 1; | 883 | + 1; |
877 | } else | 884 | } |
885 | } else { | ||
878 | *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1; | 886 | *efuse_addr = *efuse_addr + (tmp_word_cnts * 2) + 1; |
887 | } | ||
879 | 888 | ||
880 | *write_state = PG_STATE_HEADER; | 889 | *write_state = PG_STATE_HEADER; |
881 | *repeat_times += 1; | 890 | *repeat_times += 1; |
@@ -1069,10 +1078,12 @@ static u8 efuse_word_enable_data_write(struct ieee80211_hw *hw, | |||
1069 | static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate) | 1078 | static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate) |
1070 | { | 1079 | { |
1071 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 1080 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
1081 | struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); | ||
1072 | u8 tempval; | 1082 | u8 tempval; |
1073 | u16 tmpV16; | 1083 | u16 tmpV16; |
1074 | 1084 | ||
1075 | if (pwrstate) { | 1085 | if (pwrstate && (rtlhal->hw_type != |
1086 | HARDWARE_TYPE_RTL8192SE)) { | ||
1076 | tmpV16 = rtl_read_word(rtlpriv, | 1087 | tmpV16 = rtl_read_word(rtlpriv, |
1077 | rtlpriv->cfg->maps[SYS_ISO_CTRL]); | 1088 | rtlpriv->cfg->maps[SYS_ISO_CTRL]); |
1078 | if (!(tmpV16 & rtlpriv->cfg->maps[EFUSE_PWC_EV12V])) { | 1089 | if (!(tmpV16 & rtlpriv->cfg->maps[EFUSE_PWC_EV12V])) { |
@@ -1105,13 +1116,22 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate) | |||
1105 | tempval = rtl_read_byte(rtlpriv, | 1116 | tempval = rtl_read_byte(rtlpriv, |
1106 | rtlpriv->cfg->maps[EFUSE_TEST] + | 1117 | rtlpriv->cfg->maps[EFUSE_TEST] + |
1107 | 3); | 1118 | 3); |
1108 | tempval &= 0x0F; | 1119 | |
1109 | tempval |= (VOLTAGE_V25 << 4); | 1120 | if (rtlhal->hw_type != HARDWARE_TYPE_RTL8192SE) { |
1121 | tempval &= 0x0F; | ||
1122 | tempval |= (VOLTAGE_V25 << 4); | ||
1123 | } | ||
1124 | |||
1110 | rtl_write_byte(rtlpriv, | 1125 | rtl_write_byte(rtlpriv, |
1111 | rtlpriv->cfg->maps[EFUSE_TEST] + 3, | 1126 | rtlpriv->cfg->maps[EFUSE_TEST] + 3, |
1112 | (tempval | 0x80)); | 1127 | (tempval | 0x80)); |
1113 | } | 1128 | } |
1114 | 1129 | ||
1130 | if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE) { | ||
1131 | rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_CLK], | ||
1132 | 0x03); | ||
1133 | } | ||
1134 | |||
1115 | } else { | 1135 | } else { |
1116 | if (write) { | 1136 | if (write) { |
1117 | tempval = rtl_read_byte(rtlpriv, | 1137 | tempval = rtl_read_byte(rtlpriv, |
@@ -1122,6 +1142,11 @@ static void efuse_power_switch(struct ieee80211_hw *hw, u8 write, u8 pwrstate) | |||
1122 | (tempval & 0x7F)); | 1142 | (tempval & 0x7F)); |
1123 | } | 1143 | } |
1124 | 1144 | ||
1145 | if (rtlhal->hw_type == HARDWARE_TYPE_RTL8192SE) { | ||
1146 | rtl_write_byte(rtlpriv, rtlpriv->cfg->maps[EFUSE_CLK], | ||
1147 | 0x02); | ||
1148 | } | ||
1149 | |||
1125 | } | 1150 | } |
1126 | 1151 | ||
1127 | } | 1152 | } |
diff --git a/drivers/net/wireless/rtlwifi/efuse.h b/drivers/net/wireless/rtlwifi/efuse.h index 47774dd4c2a6..164dabaa7615 100644 --- a/drivers/net/wireless/rtlwifi/efuse.h +++ b/drivers/net/wireless/rtlwifi/efuse.h | |||
@@ -30,9 +30,10 @@ | |||
30 | #ifndef __RTL_EFUSE_H_ | 30 | #ifndef __RTL_EFUSE_H_ |
31 | #define __RTL_EFUSE_H_ | 31 | #define __RTL_EFUSE_H_ |
32 | 32 | ||
33 | #define EFUSE_IC_ID_OFFSET 506 | ||
34 | |||
33 | #define EFUSE_REAL_CONTENT_LEN 512 | 35 | #define EFUSE_REAL_CONTENT_LEN 512 |
34 | #define EFUSE_MAP_LEN 128 | 36 | #define EFUSE_MAP_LEN 128 |
35 | #define EFUSE_MAX_SECTION 16 | ||
36 | #define EFUSE_MAX_WORD_UNIT 4 | 37 | #define EFUSE_MAX_WORD_UNIT 4 |
37 | 38 | ||
38 | #define EFUSE_INIT_MAP 0 | 39 | #define EFUSE_INIT_MAP 0 |
@@ -52,6 +53,7 @@ | |||
52 | #define _PRE_EXECUTE_READ_CMD_ | 53 | #define _PRE_EXECUTE_READ_CMD_ |
53 | 54 | ||
54 | #define EFUSE_REPEAT_THRESHOLD_ 3 | 55 | #define EFUSE_REPEAT_THRESHOLD_ 3 |
56 | #define EFUSE_ERROE_HANDLE 1 | ||
55 | 57 | ||
56 | struct efuse_map { | 58 | struct efuse_map { |
57 | u8 offset; | 59 | u8 offset; |
@@ -103,6 +105,7 @@ struct efuse_priv { | |||
103 | u8 tx_power_g[14]; | 105 | u8 tx_power_g[14]; |
104 | }; | 106 | }; |
105 | 107 | ||
108 | extern void read_efuse_byte(struct ieee80211_hw *hw, u16 _offset, u8 *pbuf); | ||
106 | extern void efuse_initialize(struct ieee80211_hw *hw); | 109 | extern void efuse_initialize(struct ieee80211_hw *hw); |
107 | extern u8 efuse_read_1byte(struct ieee80211_hw *hw, u16 address); | 110 | extern u8 efuse_read_1byte(struct ieee80211_hw *hw, u16 address); |
108 | extern void efuse_write_1byte(struct ieee80211_hw *hw, u16 address, u8 value); | 111 | extern void efuse_write_1byte(struct ieee80211_hw *hw, u16 address, u8 value); |