aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChaoming Li <chaoming_li@realsil.com.cn>2011-10-12 16:59:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-10-14 14:48:15 -0400
commit5c079d8848740278e70100797265a2965197c84f (patch)
treec7ff1a3567dde82e04aa62a2c0c1214dc859e0cc
parentdb7599391385f9837ac8a35b8f9d202b85409992 (diff)
rtlwifi: rtl8192se: Updates from latest Realtek driver version - Part II
This patch incorporate the differences between the 06/20/2011 and 08/16/2011 Realtek releases of the rtl8192se driver. The changes include: 1. Fixing some typos in register usage. 2. A change in the handling of decryption status for 802.11w packets. 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>
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/hw.c22
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/reg.h1
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/sw.c1
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.c55
-rw-r--r--drivers/net/wireless/rtlwifi/wifi.h2
5 files changed, 48 insertions, 33 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
index d59f66cb7768..c474486e3911 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
@@ -1382,7 +1382,7 @@ static void _rtl92se_power_domain_init(struct ieee80211_hw *hw)
1382 rtl_write_byte(rtlpriv, LDOA15_CTRL, 0x34); 1382 rtl_write_byte(rtlpriv, LDOA15_CTRL, 0x34);
1383 1383
1384 /* Reset MAC-IO and CPU and Core Digital BIT10/11/15 */ 1384 /* Reset MAC-IO and CPU and Core Digital BIT10/11/15 */
1385 tmpu1b = rtl_read_byte(rtlpriv, SYS_FUNC_EN + 1); 1385 tmpu1b = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN + 1);
1386 1386
1387 /* If IPS we need to turn LED on. So we not 1387 /* If IPS we need to turn LED on. So we not
1388 * not disable BIT 3/7 of reg3. */ 1388 * not disable BIT 3/7 of reg3. */
@@ -1391,7 +1391,7 @@ static void _rtl92se_power_domain_init(struct ieee80211_hw *hw)
1391 else 1391 else
1392 tmpu1b &= 0x73; 1392 tmpu1b &= 0x73;
1393 1393
1394 rtl_write_byte(rtlpriv, SYS_FUNC_EN + 1, tmpu1b); 1394 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN + 1, tmpu1b);
1395 /* wait for BIT 10/11/15 to pull high automatically!! */ 1395 /* wait for BIT 10/11/15 to pull high automatically!! */
1396 mdelay(1); 1396 mdelay(1);
1397 1397
@@ -1428,15 +1428,15 @@ static void _rtl92se_power_domain_init(struct ieee80211_hw *hw)
1428 rtl_write_byte(rtlpriv, LDOA15_CTRL, (tmpu1b | BIT(0))); 1428 rtl_write_byte(rtlpriv, LDOA15_CTRL, (tmpu1b | BIT(0)));
1429 1429
1430 /* Set Digital Vdd to Retention isolation Path. */ 1430 /* Set Digital Vdd to Retention isolation Path. */
1431 tmpu2b = rtl_read_word(rtlpriv, SYS_ISO_CTRL); 1431 tmpu2b = rtl_read_word(rtlpriv, REG_SYS_ISO_CTRL);
1432 rtl_write_word(rtlpriv, SYS_ISO_CTRL, (tmpu2b | BIT(11))); 1432 rtl_write_word(rtlpriv, REG_SYS_ISO_CTRL, (tmpu2b | BIT(11)));
1433 1433
1434 1434
1435 /* For warm reboot NIC disappera bug. */ 1435 /* For warm reboot NIC disappera bug. */
1436 tmpu2b = rtl_read_word(rtlpriv, SYS_FUNC_EN); 1436 tmpu2b = rtl_read_word(rtlpriv, REG_SYS_FUNC_EN);
1437 rtl_write_word(rtlpriv, SYS_FUNC_EN, (tmpu2b | BIT(13))); 1437 rtl_write_word(rtlpriv, REG_SYS_FUNC_EN, (tmpu2b | BIT(13)));
1438 1438
1439 rtl_write_byte(rtlpriv, SYS_ISO_CTRL + 1, 0x68); 1439 rtl_write_byte(rtlpriv, REG_SYS_ISO_CTRL + 1, 0x68);
1440 1440
1441 /* Enable AFE PLL Macro Block */ 1441 /* Enable AFE PLL Macro Block */
1442 tmpu1b = rtl_read_byte(rtlpriv, AFE_PLL_CTRL); 1442 tmpu1b = rtl_read_byte(rtlpriv, AFE_PLL_CTRL);
@@ -1447,17 +1447,17 @@ static void _rtl92se_power_domain_init(struct ieee80211_hw *hw)
1447 mdelay(1); 1447 mdelay(1);
1448 1448
1449 /* Release isolation AFE PLL & MD */ 1449 /* Release isolation AFE PLL & MD */
1450 rtl_write_byte(rtlpriv, SYS_ISO_CTRL, 0xA6); 1450 rtl_write_byte(rtlpriv, REG_SYS_ISO_CTRL, 0xA6);
1451 1451
1452 /* Enable MAC clock */ 1452 /* Enable MAC clock */
1453 tmpu2b = rtl_read_word(rtlpriv, SYS_CLKR); 1453 tmpu2b = rtl_read_word(rtlpriv, SYS_CLKR);
1454 rtl_write_word(rtlpriv, SYS_CLKR, (tmpu2b | BIT(12) | BIT(11))); 1454 rtl_write_word(rtlpriv, SYS_CLKR, (tmpu2b | BIT(12) | BIT(11)));
1455 1455
1456 /* Enable Core digital and enable IOREG R/W */ 1456 /* Enable Core digital and enable IOREG R/W */
1457 tmpu2b = rtl_read_word(rtlpriv, SYS_FUNC_EN); 1457 tmpu2b = rtl_read_word(rtlpriv, REG_SYS_FUNC_EN);
1458 rtl_write_word(rtlpriv, SYS_FUNC_EN, (tmpu2b | BIT(11))); 1458 rtl_write_word(rtlpriv, REG_SYS_FUNC_EN, (tmpu2b | BIT(11)));
1459 /* enable REG_EN */ 1459 /* enable REG_EN */
1460 rtl_write_word(rtlpriv, SYS_FUNC_EN, (tmpu2b | BIT(11) | BIT(15))); 1460 rtl_write_word(rtlpriv, REG_SYS_FUNC_EN, (tmpu2b | BIT(11) | BIT(15)));
1461 1461
1462 /* Switch the control path. */ 1462 /* Switch the control path. */
1463 tmpu2b = rtl_read_word(rtlpriv, SYS_CLKR); 1463 tmpu2b = rtl_read_word(rtlpriv, SYS_CLKR);
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/reg.h b/drivers/net/wireless/rtlwifi/rtl8192se/reg.h
index ea32ef2d4098..11f125c030ce 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/reg.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/reg.h
@@ -735,6 +735,7 @@
735#define HWSET_MAX_SIZE_92S 128 735#define HWSET_MAX_SIZE_92S 128
736#define EFUSE_MAX_SECTION 16 736#define EFUSE_MAX_SECTION 16
737#define EFUSE_REAL_CONTENT_LEN 512 737#define EFUSE_REAL_CONTENT_LEN 512
738#define EFUSE_OOB_PROTECT_BYTES 15
738 739
739#define RTL8190_EEPROM_ID 0x8129 740#define RTL8190_EEPROM_ID 0x8129
740#define EEPROM_HPON 0x02 741#define EEPROM_HPON 0x02
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
index d2dad538bb26..3ec9a0d41baf 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -307,6 +307,7 @@ static struct rtl_hal_cfg rtl92se_hal_cfg = {
307 .maps[EFUSE_HWSET_MAX_SIZE] = HWSET_MAX_SIZE_92S, 307 .maps[EFUSE_HWSET_MAX_SIZE] = HWSET_MAX_SIZE_92S,
308 .maps[EFUSE_MAX_SECTION_MAP] = EFUSE_MAX_SECTION, 308 .maps[EFUSE_MAX_SECTION_MAP] = EFUSE_MAX_SECTION,
309 .maps[EFUSE_REAL_CONTENT_SIZE] = EFUSE_REAL_CONTENT_LEN, 309 .maps[EFUSE_REAL_CONTENT_SIZE] = EFUSE_REAL_CONTENT_LEN,
310 .maps[EFUSE_OOB_PROTECT_BYTES_LEN] = EFUSE_OOB_PROTECT_BYTES,
310 311
311 .maps[RWCAM] = REG_RWCAM, 312 .maps[RWCAM] = REG_RWCAM,
312 .maps[WCAMI] = REG_WCAMI, 313 .maps[WCAMI] = REG_WCAMI,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index ba137da082b5..fbebe3ea0a22 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -124,18 +124,15 @@ static void _rtl92se_query_rxphystatus(struct ieee80211_hw *hw,
124 u8 i, max_spatial_stream; 124 u8 i, max_spatial_stream;
125 u32 rssi, total_rssi = 0; 125 u32 rssi, total_rssi = 0;
126 bool in_powersavemode = false; 126 bool in_powersavemode = false;
127 bool is_cck_rate; 127 bool is_cck = pstats->is_cck;
128 128
129 is_cck_rate = SE_RX_HAL_IS_CCK_RATE(pdesc);
130 pstats->packet_matchbssid = packet_match_bssid; 129 pstats->packet_matchbssid = packet_match_bssid;
131 pstats->packet_toself = packet_toself; 130 pstats->packet_toself = packet_toself;
132 pstats->is_cck = is_cck_rate;
133 pstats->packet_beacon = packet_beacon; 131 pstats->packet_beacon = packet_beacon;
134 pstats->is_cck = is_cck_rate;
135 pstats->rx_mimo_signalquality[0] = -1; 132 pstats->rx_mimo_signalquality[0] = -1;
136 pstats->rx_mimo_signalquality[1] = -1; 133 pstats->rx_mimo_signalquality[1] = -1;
137 134
138 if (is_cck_rate) { 135 if (is_cck) {
139 u8 report, cck_highpwr; 136 u8 report, cck_highpwr;
140 cck_buf = (struct phy_sts_cck_8192s_t *)p_drvinfo; 137 cck_buf = (struct phy_sts_cck_8192s_t *)p_drvinfo;
141 138
@@ -246,9 +243,8 @@ static void _rtl92se_query_rxphystatus(struct ieee80211_hw *hw,
246 pstats->rxpower = rx_pwr_all; 243 pstats->rxpower = rx_pwr_all;
247 pstats->recvsignalpower = rx_pwr_all; 244 pstats->recvsignalpower = rx_pwr_all;
248 245
249 if (GET_RX_STATUS_DESC_RX_HT(pdesc) && 246 if (pstats->is_ht && pstats->rate >= DESC92_RATEMCS8 &&
250 GET_RX_STATUS_DESC_RX_MCS(pdesc) >= DESC92_RATEMCS8 && 247 pstats->rate <= DESC92_RATEMCS15)
251 GET_RX_STATUS_DESC_RX_MCS(pdesc) <= DESC92_RATEMCS15)
252 max_spatial_stream = 2; 248 max_spatial_stream = 2;
253 else 249 else
254 max_spatial_stream = 1; 250 max_spatial_stream = 1;
@@ -266,7 +262,7 @@ static void _rtl92se_query_rxphystatus(struct ieee80211_hw *hw,
266 } 262 }
267 } 263 }
268 264
269 if (is_cck_rate) 265 if (is_cck)
270 pstats->signalstrength = (u8)(_rtl92se_signal_scale_mapping(hw, 266 pstats->signalstrength = (u8)(_rtl92se_signal_scale_mapping(hw,
271 pwdb_all)); 267 pwdb_all));
272 else if (rf_rx_num != 0) 268 else if (rf_rx_num != 0)
@@ -518,6 +514,8 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
518{ 514{
519 struct rx_fwinfo *p_drvinfo; 515 struct rx_fwinfo *p_drvinfo;
520 u32 phystatus = (u32)GET_RX_STATUS_DESC_PHY_STATUS(pdesc); 516 u32 phystatus = (u32)GET_RX_STATUS_DESC_PHY_STATUS(pdesc);
517 struct ieee80211_hdr *hdr;
518 bool first_ampdu = false;
521 519
522 stats->length = (u16)GET_RX_STATUS_DESC_PKT_LEN(pdesc); 520 stats->length = (u16)GET_RX_STATUS_DESC_PKT_LEN(pdesc);
523 stats->rx_drvinfo_size = (u8)GET_RX_STATUS_DESC_DRVINFO_SIZE(pdesc) * 8; 521 stats->rx_drvinfo_size = (u8)GET_RX_STATUS_DESC_DRVINFO_SIZE(pdesc) * 8;
@@ -530,8 +528,12 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
530 stats->rate = (u8)GET_RX_STATUS_DESC_RX_MCS(pdesc); 528 stats->rate = (u8)GET_RX_STATUS_DESC_RX_MCS(pdesc);
531 stats->shortpreamble = (u16)GET_RX_STATUS_DESC_SPLCP(pdesc); 529 stats->shortpreamble = (u16)GET_RX_STATUS_DESC_SPLCP(pdesc);
532 stats->isampdu = (bool)(GET_RX_STATUS_DESC_PAGGR(pdesc) == 1); 530 stats->isampdu = (bool)(GET_RX_STATUS_DESC_PAGGR(pdesc) == 1);
531 stats->isfirst_ampdu = (bool) ((GET_RX_STATUS_DESC_PAGGR(pdesc) == 1)
532 && (GET_RX_STATUS_DESC_FAGGR(pdesc) == 1));
533 stats->timestamp_low = GET_RX_STATUS_DESC_TSFL(pdesc); 533 stats->timestamp_low = GET_RX_STATUS_DESC_TSFL(pdesc);
534 stats->rx_is40Mhzpacket = (bool)GET_RX_STATUS_DESC_BW(pdesc); 534 stats->rx_is40Mhzpacket = (bool)GET_RX_STATUS_DESC_BW(pdesc);
535 stats->is_ht = (bool)GET_RX_STATUS_DESC_RX_HT(pdesc);
536 stats->is_cck = SE_RX_HAL_IS_CCK_RATE(pdesc);
535 537
536 if (stats->hwerror) 538 if (stats->hwerror)
537 return false; 539 return false;
@@ -539,30 +541,39 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
539 rx_status->freq = hw->conf.channel->center_freq; 541 rx_status->freq = hw->conf.channel->center_freq;
540 rx_status->band = hw->conf.channel->band; 542 rx_status->band = hw->conf.channel->band;
541 543
542 if (GET_RX_STATUS_DESC_CRC32(pdesc)) 544 hdr = (struct ieee80211_hdr *)(skb->data + stats->rx_drvinfo_size
543 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; 545 + stats->rx_bufshift);
544 546
545 if (!GET_RX_STATUS_DESC_SWDEC(pdesc)) 547 if (stats->crc)
546 rx_status->flag |= RX_FLAG_DECRYPTED; 548 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
547 549
548 if (GET_RX_STATUS_DESC_BW(pdesc)) 550 if (stats->rx_is40Mhzpacket)
549 rx_status->flag |= RX_FLAG_40MHZ; 551 rx_status->flag |= RX_FLAG_40MHZ;
550 552
551 if (GET_RX_STATUS_DESC_RX_HT(pdesc)) 553 if (stats->is_ht)
552 rx_status->flag |= RX_FLAG_HT; 554 rx_status->flag |= RX_FLAG_HT;
553 555
554 rx_status->flag |= RX_FLAG_MACTIME_MPDU; 556 rx_status->flag |= RX_FLAG_MACTIME_MPDU;
555 557
556 if (stats->decrypted) 558 /* hw will set stats->decrypted true, if it finds the
557 rx_status->flag |= RX_FLAG_DECRYPTED; 559 * frame is open data frame or mgmt frame,
560 * hw will not decrypt robust managment frame
561 * for IEEE80211w but still set stats->decrypted
562 * true, so here we should set it back to undecrypted
563 * for IEEE80211w frame, and mac80211 sw will help
564 * to decrypt it */
565 if (stats->decrypted) {
566 if ((ieee80211_is_robust_mgmt_frame(hdr)) &&
567 (ieee80211_has_protected(hdr->frame_control)))
568 rx_status->flag &= ~RX_FLAG_DECRYPTED;
569 else
570 rx_status->flag |= RX_FLAG_DECRYPTED;
571 }
558 572
559 rx_status->rate_idx = rtlwifi_rate_mapping(hw, 573 rx_status->rate_idx = rtlwifi_rate_mapping(hw,
560 (bool)GET_RX_STATUS_DESC_RX_HT(pdesc), 574 stats->is_ht, stats->rate, first_ampdu);
561 (u8)GET_RX_STATUS_DESC_RX_MCS(pdesc),
562 (bool)GET_RX_STATUS_DESC_PAGGR(pdesc));
563
564 575
565 rx_status->mactime = GET_RX_STATUS_DESC_TSFL(pdesc); 576 rx_status->mactime = stats->timestamp_low;
566 if (phystatus) { 577 if (phystatus) {
567 p_drvinfo = (struct rx_fwinfo *)(skb->data + 578 p_drvinfo = (struct rx_fwinfo *)(skb->data +
568 stats->rx_bufshift); 579 stats->rx_bufshift);
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index ae42cf8c2abf..713c7ddba8eb 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -450,6 +450,7 @@ enum rtl_var_map {
450 EFUSE_HWSET_MAX_SIZE, 450 EFUSE_HWSET_MAX_SIZE,
451 EFUSE_MAX_SECTION_MAP, 451 EFUSE_MAX_SECTION_MAP,
452 EFUSE_REAL_CONTENT_SIZE, 452 EFUSE_REAL_CONTENT_SIZE,
453 EFUSE_OOB_PROTECT_BYTES_LEN,
453 454
454 /*CAM map */ 455 /*CAM map */
455 RWCAM, 456 RWCAM,
@@ -1324,6 +1325,7 @@ struct rtl_stats {
1324 s8 rx_mimo_signalquality[2]; 1325 s8 rx_mimo_signalquality[2];
1325 bool packet_matchbssid; 1326 bool packet_matchbssid;
1326 bool is_cck; 1327 bool is_cck;
1328 bool is_ht;
1327 bool packet_toself; 1329 bool packet_toself;
1328 bool packet_beacon; /*for rssi */ 1330 bool packet_beacon; /*for rssi */
1329 char cck_adc_pwdb[4]; /*for rx path selection */ 1331 char cck_adc_pwdb[4]; /*for rx path selection */