40 #include "../rtl8192c/fw_common.h"
68 tmp1byte &= ~(
BIT(0));
72 static void _rtl92ce_resume_tx_beacon(
struct ieee80211_hw *hw)
85 static void _rtl92ce_enable_bcn_sub_func(
struct ieee80211_hw *hw)
87 _rtl92ce_set_bcn_ctrl_reg(hw, 0,
BIT(1));
90 static void _rtl92ce_disable_bcn_sub_func(
struct ieee80211_hw *hw)
92 _rtl92ce_set_bcn_ctrl_reg(hw,
BIT(1), 0);
112 rtlpriv->
cfg->ops->get_hw_reg(hw,
116 *((
bool *) (val)) =
true;
118 val_rcr = rtl_read_dword(rtlpriv,
REG_RCR);
119 val_rcr &= 0x00070000;
121 *((
bool *) (val)) =
false;
123 *((
bool *) (val)) =
true;
135 *ptsf_high = rtl_read_dword(rtlpriv, (
REG_TSFTR + 4));
136 *ptsf_low = rtl_read_dword(rtlpriv,
REG_TSFTR);
144 "switch case not processed\n");
162 for (idx = 0; idx <
ETH_ALEN; idx++) {
163 rtl_write_byte(rtlpriv, (
REG_MACID + idx),
169 u16 rate_cfg = ((
u16 *) val)[0];
173 rtl_write_byte(rtlpriv,
REG_RRSR, rate_cfg & 0xff);
174 rtl_write_byte(rtlpriv,
REG_RRSR + 1,
175 (rate_cfg >> 8) & 0xff);
176 while (rate_cfg > 0x1) {
177 rate_cfg = (rate_cfg >> 1);
185 for (idx = 0; idx <
ETH_ALEN; idx++) {
186 rtl_write_byte(rtlpriv, (
REG_BSSID + idx),
210 "HW_VAR_SLOT_TIME %x\n", val[0]);
212 rtl_write_byte(rtlpriv,
REG_SLOT, val[0]);
214 for (e_aci = 0; e_aci <
AC_MAX; e_aci++) {
215 rtlpriv->
cfg->ops->set_hw_reg(hw,
223 u8 short_preamble = (
bool)*val;
228 rtl_write_byte(rtlpriv,
REG_RRSR + 2, reg_tmp);
232 u8 min_spacing_to_set;
235 min_spacing_to_set = *
val;
236 if (min_spacing_to_set <= 7) {
239 if (min_spacing_to_set < sec_min_space)
240 min_spacing_to_set = sec_min_space;
246 *val = min_spacing_to_set;
249 "Set HW_VAR_AMPDU_MIN_SPACE: %#x\n",
260 density_to_set = *
val;
264 "Set HW_VAR_SHORTGI_DENSITY: %#x\n",
273 u8 regtoset_normal[4] = {0x41, 0xa8, 0x72, 0xb9};
274 u8 regtoset_bt[4] = {0x31, 0x74, 0x42, 0x97};
280 if ((rtlpcipriv->
bt_coexist.bt_coexistence) &&
283 p_regtoset = regtoset_bt;
285 p_regtoset = regtoset_normal;
287 factor_toset = *(
val);
288 if (factor_toset <= 3) {
289 factor_toset = (1 << (factor_toset + 2));
290 if (factor_toset > 0xf)
293 for (index = 0; index < 4; index++) {
294 if ((p_regtoset[index] & 0xf0) >
297 (p_regtoset[
index] & 0x0f) |
300 if ((p_regtoset[index] & 0x0f) >
303 (p_regtoset[index] & 0xf0) |
306 rtl_write_byte(rtlpriv,
313 "Set HW_VAR_AMPDU_FACTOR: %#x\n",
323 rtlpriv->
cfg->ops->set_hw_reg(hw,
332 u8 acm = p_aci_aifsn->
f.acm;
336 acm_ctrl | ((rtlpci->
acm_method == 2) ? 0x0 : 0x1);
351 "HW_VAR_ACM_CTRL acm set failed: eACI is %d\n",
368 "switch case not processed\n");
374 "SetHwReg8190pci(): [HW_VAR_ACM_CTRL] Write 0x%X\n",
380 rtl_write_dword(rtlpriv,
REG_RCR, ((
u32 *) (val))[0]);
385 u8 retry_limit = val[0];
387 rtl_write_word(rtlpriv,
REG_RL,
413 if (rpwm_val &
BIT(7)) {
438 u8 tmp_regcr, tmp_reg422;
439 bool recover =
false;
445 tmp_regcr = rtl_read_byte(rtlpriv,
REG_CR + 1);
446 rtl_write_byte(rtlpriv,
REG_CR + 1,
447 (tmp_regcr |
BIT(0)));
449 _rtl92ce_set_bcn_ctrl_reg(hw, 0,
BIT(3));
450 _rtl92ce_set_bcn_ctrl_reg(hw,
BIT(4), 0);
453 rtl_read_byte(rtlpriv,
455 if (tmp_reg422 &
BIT(6))
458 tmp_reg422 & (~
BIT(6)));
462 _rtl92ce_set_bcn_ctrl_reg(hw,
BIT(3), 0);
463 _rtl92ce_set_bcn_ctrl_reg(hw, 0,
BIT(4));
466 rtl_write_byte(rtlpriv,
471 rtl_write_byte(rtlpriv,
REG_CR + 1,
472 (tmp_regcr & ~(
BIT(0))));
488 u8 btype_ibss = val[0];
491 _rtl92ce_stop_tx_beacon(hw);
493 _rtl92ce_set_bcn_ctrl_reg(hw, 0,
BIT(3));
496 (
u32) (mac->
tsf & 0xffffffff));
498 (
u32) ((mac->
tsf >> 32) & 0xffffffff));
500 _rtl92ce_set_bcn_ctrl_reg(hw,
BIT(3), 0);
503 _rtl92ce_resume_tx_beacon(hw);
510 "switch case not processed\n");
532 "Failed to polling write LLT done at address %d!\n",
542 static bool _rtl92ce_llt_table_init(
struct ieee80211_hw *hw)
553 #elif LLT_CONFIG == 2
556 #elif LLT_CONFIG == 3
559 #elif LLT_CONFIG == 4
562 #elif LLT_CONFIG == 5
569 rtl_write_dword(rtlpriv,
REG_RQPN, 0x80a71c1c);
570 #elif LLT_CONFIG == 2
571 rtl_write_dword(rtlpriv,
REG_RQPN, 0x845B1010);
572 #elif LLT_CONFIG == 3
573 rtl_write_dword(rtlpriv,
REG_RQPN, 0x84838484);
574 #elif LLT_CONFIG == 4
575 rtl_write_dword(rtlpriv,
REG_RQPN, 0x80bd1c1c);
576 #elif LLT_CONFIG == 5
579 rtl_write_dword(rtlpriv,
REG_RQPN, 0x80b01c29);
582 rtl_write_dword(rtlpriv,
REG_TRXFF_BNDY, (0x27FF0000 | txpktbuf_bndy));
583 rtl_write_byte(rtlpriv,
REG_TDECTRL + 1, txpktbuf_bndy);
588 rtl_write_byte(rtlpriv, 0x45D, txpktbuf_bndy);
589 rtl_write_byte(rtlpriv,
REG_PBP, 0x11);
592 for (i = 0; i < (txpktbuf_bndy - 1); i++) {
593 status = _rtl92ce_llt_write(hw, i, i + 1);
598 status = _rtl92ce_llt_write(hw, (txpktbuf_bndy - 1), 0xFF);
602 for (i = txpktbuf_bndy; i < maxPage; i++) {
603 status = _rtl92ce_llt_write(hw, i, (i + 1));
608 status = _rtl92ce_llt_write(hw, maxPage, txpktbuf_bndy);
615 static void _rtl92ce_gen_refresh_led_state(
struct ieee80211_hw *hw)
640 unsigned char bytetmp;
641 unsigned short wordtmp;
657 u4b_tmp &= (~0x00024800);
672 rtl_read_dword(rtlpriv, 0xEC), bytetmp);
674 while ((bytetmp &
BIT(0)) && retry < 1000) {
679 rtl_read_dword(rtlpriv, 0xEC), bytetmp);
693 rtl_write_word(rtlpriv,
REG_CR, 0x2ff);
695 if (!_rtl92ce_llt_table_init(hw))
698 rtl_write_dword(rtlpriv,
REG_HISR, 0xffffffff);
699 rtl_write_byte(rtlpriv,
REG_HISRE, 0xff);
712 rtl_write_byte(rtlpriv, 0x4d0, 0x0);
747 }
while ((retry < 200) && (bytetmp &
BIT(7)));
749 _rtl92ce_gen_refresh_led_state(hw);
756 static void _rtl92ce_hw_configure(
struct ieee80211_hw *hw)
771 rtl_write_dword(rtlpriv,
REG_RRSR, reg_prsr);
773 rtl_write_byte(rtlpriv,
REG_SLOT, 0x09);
779 rtl_write_word(rtlpriv,
REG_RL, 0x0707);
785 rtl_write_dword(rtlpriv,
REG_DARFRC, 0x01000000);
786 rtl_write_dword(rtlpriv,
REG_DARFRC + 4, 0x07060504);
787 rtl_write_dword(rtlpriv,
REG_RARFRC, 0x01000000);
788 rtl_write_dword(rtlpriv,
REG_RARFRC + 4, 0x07060504);
790 if ((rtlpcipriv->
bt_coexist.bt_coexistence) &&
807 rtl_write_byte(rtlpriv,
REG_PIFS, 0x1C);
810 if ((rtlpcipriv->
bt_coexist.bt_coexistence) &&
819 if ((rtlpcipriv->
bt_coexist.bt_coexistence) &&
825 rtl_write_byte(rtlpriv,
REG_ACKTO, 0x40);
834 rtl_write_dword(rtlpriv,
REG_MAR, 0xffffffff);
835 rtl_write_dword(rtlpriv,
REG_MAR + 4, 0xffffffff);
839 static void _rtl92ce_enable_aspm_back_door(
struct ieee80211_hw *hw)
844 rtl_write_byte(rtlpriv, 0x34b, 0x93);
845 rtl_write_word(rtlpriv, 0x350, 0x870c);
846 rtl_write_byte(rtlpriv, 0x352, 0x1);
849 rtl_write_byte(rtlpriv, 0x349, 0x1b);
851 rtl_write_byte(rtlpriv, 0x349, 0x03);
853 rtl_write_word(rtlpriv, 0x350, 0x2718);
854 rtl_write_byte(rtlpriv, 0x352, 0x1);
863 "PairwiseEncAlgorithm = %d GroupEncAlgorithm = %d\n",
864 rtlpriv->
sec.pairwise_enc_algorithm,
865 rtlpriv->
sec.group_enc_algorithm);
867 if (rtlpriv->
cfg->mod_params->sw_crypto || rtlpriv->
sec.use_sw_sec) {
869 "not open hw encryption\n");
875 if (rtlpriv->
sec.use_defaultkey) {
882 rtl_write_byte(rtlpriv,
REG_CR + 1, 0x02);
885 "The SECR-value %x\n", sec_reg_value);
899 static bool iqk_initialized;
900 bool rtstatus =
true;
906 rtlpriv->
intf_ops->disable_aspm(hw);
907 rtstatus = _rtl92ce_init_mac(hw);
917 "Failed to download FW. Init HW without FW now..\n");
934 _rtl92ce_hw_configure(hw);
941 _rtl92ce_enable_aspm_back_door(hw);
948 if (iqk_initialized) {
952 iqk_initialized =
true;
961 if (!(tmp_u1b &
BIT(0))) {
966 if (!(tmp_u1b &
BIT(1)) && is92c) {
971 if (!(tmp_u1b &
BIT(4))) {
972 tmp_u1b = rtl_read_byte(rtlpriv, 0x16);
974 rtl_write_byte(rtlpriv, 0x16, tmp_u1b | 0x80);
976 rtl_write_byte(rtlpriv, 0x16, tmp_u1b | 0x90);
990 const char *versionid;
1003 ((((value32 & CHIP_VER_RTL_MASK) ==
BIT(12))
1011 versionid =
"B_CHIP_92C";
1014 versionid =
"B_CHIP_88C";
1017 versionid =
"A_CHIP_92C";
1020 versionid =
"A_CHIP_88C";
1023 versionid =
"Unknown. Bug?";
1028 "Chip Version ID: %s\n", versionid);
1030 switch (version & 0x3) {
1043 "ERROR RF_Type is set!!\n");
1053 static int _rtl92ce_set_media_status(
struct ieee80211_hw *hw,
1057 u8 bt_msr = rtl_read_byte(rtlpriv,
MSR);
1063 _rtl92ce_stop_tx_beacon(hw);
1064 _rtl92ce_enable_bcn_sub_func(hw);
1066 _rtl92ce_resume_tx_beacon(hw);
1067 _rtl92ce_disable_bcn_sub_func(hw);
1070 "Set HW_VAR_MEDIA_STATUS: No such media status(%x)\n",
1079 "Set Network type to NO LINK!\n");
1084 "Set Network type to Ad Hoc!\n");
1090 "Set Network type to STA!\n");
1095 "Set Network type to AP!\n");
1099 "Network type %d not supported!\n", type);
1105 rtl_write_byte(rtlpriv, (
MSR), bt_msr);
1106 rtlpriv->
cfg->ops->led_control(hw, ledaction);
1107 if ((bt_msr & 0xfc) ==
MSR_AP)
1117 u32 reg_rcr = rtl_read_dword(rtlpriv,
REG_RCR);
1119 if (rtlpriv->
psc.rfpwr_state !=
ERFON)
1126 _rtl92ce_set_bcn_ctrl_reg(hw, 0,
BIT(4));
1127 }
else if (!check_bssid) {
1129 _rtl92ce_set_bcn_ctrl_reg(hw,
BIT(4), 0);
1130 rtlpriv->
cfg->ops->set_hw_reg(hw,
1140 if (_rtl92ce_set_media_status(hw, type))
1172 RT_ASSERT(
false,
"invalid aci: %d !\n", aci);
1196 static void _rtl92ce_poweroff_adapter(
struct ieee80211_hw *hw)
1203 rtlpriv->
intf_ops->enable_aspm(hw);
1216 if ((rtlpcipriv->
bt_coexist.bt_coexistence) &&
1231 u4b_tmp |= 0x03824800;
1251 _rtl92ce_set_media_status(hw, opmode);
1256 _rtl92ce_poweroff_adapter(hw);
1260 u32 *p_inta,
u32 *p_intb)
1265 *p_inta = rtl_read_dword(rtlpriv,
ISR) & rtlpci->
irq_mask[0];
1266 rtl_write_dword(rtlpriv,
ISR, *p_inta);
1279 u16 bcn_interval, atim_window;
1284 rtl_write_word(rtlpriv,
REG_ATIMWND, atim_window);
1289 rtl_write_byte(rtlpriv, 0x606, 0x30);
1300 "beacon_interval:%d\n", bcn_interval);
1323 static void _rtl92ce_read_txpower_info_from_hwpg(
struct ieee80211_hw *hw,
1332 for (rf_path = 0; rf_path < 2; rf_path++) {
1333 for (i = 0; i < 3; i++) {
1334 if (!autoload_fail) {
1353 for (i = 0; i < 3; i++) {
1361 ((tempval & 0xf0) >> 4);
1364 for (rf_path = 0; rf_path < 2; rf_path++)
1365 for (i = 0; i < 3; i++)
1367 "RF(%d) EEPROM CCK Area(%d) = 0x%x\n",
1371 for (rf_path = 0; rf_path < 2; rf_path++)
1372 for (i = 0; i < 3; i++)
1374 "RF(%d) EEPROM HT40 1S Area(%d) = 0x%x\n",
1378 for (rf_path = 0; rf_path < 2; rf_path++)
1379 for (i = 0; i < 3; i++)
1381 "RF(%d) EEPROM HT40 2S Diff Area(%d) = 0x%x\n",
1386 for (rf_path = 0; rf_path < 2; rf_path++) {
1387 for (i = 0; i < 14; i++) {
1388 index = _rtl92c_get_chnl_group((
u8) i);
1413 for (i = 0; i < 14; i++) {
1415 "RF(%d)-Ch(%d) [CCK / HT40_1S / HT40_2S] = [0x%x / 0x%x / 0x%x]\n",
1423 for (i = 0; i < 3; i++) {
1424 if (!autoload_fail) {
1435 for (rf_path = 0; rf_path < 2; rf_path++) {
1436 for (i = 0; i < 14; i++) {
1437 index = _rtl92c_get_chnl_group((
u8) i);
1456 "RF-%d pwrgroup_ht20[%d] = 0x%x\n",
1460 "RF-%d pwrgroup_ht40[%d] = 0x%x\n",
1466 for (i = 0; i < 14; i++) {
1467 index = _rtl92c_get_chnl_group((
u8) i);
1476 ((tempval >> 4) & 0xF);
1484 index = _rtl92c_get_chnl_group((
u8)
i);
1493 ((tempval >> 4) & 0xF);
1499 for (i = 0; i < 14; i++)
1501 "RF-A Ht20 to HT40 Diff[%d] = 0x%x\n",
1503 for (i = 0; i < 14; i++)
1505 "RF-A Legacy to Ht40 Diff[%d] = 0x%x\n",
1507 for (i = 0; i < 14; i++)
1509 "RF-B Ht20 to HT40 Diff[%d] = 0x%x\n",
1511 for (i = 0; i < 14; i++)
1513 "RF-B Legacy to HT40 Diff[%d] = 0x%x\n",
1523 if (!autoload_fail) {
1548 static void _rtl92ce_read_adapter_info(
struct ieee80211_hw *hw)
1565 "RTL819X Not boot from eeprom, check it !!");
1571 eeprom_id = *((
u16 *)&hwinfo[0]);
1574 "EEPROM ID(%#x) is invalid!!\n", eeprom_id);
1584 for (i = 0; i < 6; i += 2) {
1591 _rtl92ce_read_txpower_info_from_hwpg(hw,
1605 "EEPROM Customer ID: 0x%2x\n", rtlefuse->
eeprom_oemid);
1639 static void _rtl92ce_hal_customized_behavior(
struct ieee80211_hw *hw)
1645 switch (rtlhal->
oem_id) {
1647 pcipriv->
ledctl.led_opendrain =
true;
1659 "RT Customized ID: 0x%02X\n", rtlhal->
oem_id);
1670 rtlhal->
version = _rtl92ce_read_chip_version(hw);
1671 if (get_rf_type(rtlphy) ==
RF_1T1R)
1672 rtlpriv->
dm.rfpath_rxenable[0] =
true;
1674 rtlpriv->
dm.rfpath_rxenable[0] =
1675 rtlpriv->
dm.rfpath_rxenable[1] =
true;
1678 tmp_u1b = rtl_read_byte(rtlpriv,
REG_9346CR);
1679 if (tmp_u1b &
BIT(4)) {
1686 if (tmp_u1b &
BIT(5)) {
1689 _rtl92ce_read_adapter_info(hw);
1693 _rtl92ce_hal_customized_behavior(hw);
1696 static void rtl92ce_update_hal_rate_table(
struct ieee80211_hw *hw,
1710 u8 curtxbw_40mhz = mac->
bw_40;
1721 ratr_value |= (sta->
ht_cap.mcs.rx_mask[1] << 20 |
1722 sta->
ht_cap.mcs.rx_mask[0] << 12);
1723 switch (wirelessmode) {
1725 if (ratr_value & 0x0000000c)
1726 ratr_value &= 0x0000000d;
1728 ratr_value &= 0x0000000f;
1731 ratr_value &= 0x00000FF5;
1737 ratr_value &= 0x0007F005;
1741 if (get_rf_type(rtlphy) ==
RF_1T2R ||
1742 get_rf_type(rtlphy) ==
RF_1T1R)
1743 ratr_mask = 0x000ff005;
1745 ratr_mask = 0x0f0ff005;
1747 ratr_value &= ratr_mask;
1752 ratr_value &= 0x000ff0ff;
1754 ratr_value &= 0x0f0ff0ff;
1759 if ((rtlpcipriv->
bt_coexist.bt_coexistence) &&
1765 ratr_value &= 0x0fffcfc0;
1767 ratr_value &= 0x0FFFFFFF;
1769 if (nmode && ((curtxbw_40mhz &&
1770 curshortgi_40mhz) || (!curtxbw_40mhz &&
1771 curshortgi_20mhz))) {
1773 ratr_value |= 0x10000000;
1774 tmp_ratr_value = (ratr_value >> 12);
1776 for (shortgi_rate = 15; shortgi_rate > 0; shortgi_rate--) {
1777 if ((1 << shortgi_rate) & tmp_ratr_value)
1781 shortgi_rate = (shortgi_rate << 12) | (shortgi_rate << 8) |
1782 (shortgi_rate << 4) | (shortgi_rate);
1785 rtl_write_dword(rtlpriv,
REG_ARFR0 + ratr_index * 4, ratr_value);
1791 static void rtl92ce_update_hal_rate_mask(
struct ieee80211_hw *hw,
1808 bool shortgi =
false;
1816 curtxbw_40mhz = mac->
bw_40;
1819 macid = sta->
aid + 1;
1825 ratr_bitmap |= (sta->
ht_cap.mcs.rx_mask[1] << 20 |
1826 sta->
ht_cap.mcs.rx_mask[0] << 12);
1827 switch (wirelessmode) {
1830 if (ratr_bitmap & 0x0000000c)
1831 ratr_bitmap &= 0x0000000d;
1833 ratr_bitmap &= 0x0000000f;
1838 if (rssi_level == 1)
1839 ratr_bitmap &= 0x00000f00;
1840 else if (rssi_level == 2)
1841 ratr_bitmap &= 0x00000ff0;
1843 ratr_bitmap &= 0x00000ff5;
1847 ratr_bitmap &= 0x00000ff0;
1854 if (rssi_level == 1)
1855 ratr_bitmap &= 0x00070000;
1856 else if (rssi_level == 2)
1857 ratr_bitmap &= 0x0007f000;
1859 ratr_bitmap &= 0x0007f005;
1863 if (curtxbw_40mhz) {
1864 if (rssi_level == 1)
1865 ratr_bitmap &= 0x000f0000;
1866 else if (rssi_level == 2)
1867 ratr_bitmap &= 0x000ff000;
1869 ratr_bitmap &= 0x000ff015;
1871 if (rssi_level == 1)
1872 ratr_bitmap &= 0x000f0000;
1873 else if (rssi_level == 2)
1874 ratr_bitmap &= 0x000ff000;
1876 ratr_bitmap &= 0x000ff005;
1879 if (curtxbw_40mhz) {
1880 if (rssi_level == 1)
1881 ratr_bitmap &= 0x0f0f0000;
1882 else if (rssi_level == 2)
1883 ratr_bitmap &= 0x0f0ff000;
1885 ratr_bitmap &= 0x0f0ff015;
1887 if (rssi_level == 1)
1888 ratr_bitmap &= 0x0f0f0000;
1889 else if (rssi_level == 2)
1890 ratr_bitmap &= 0x0f0ff000;
1892 ratr_bitmap &= 0x0f0ff005;
1897 if ((curtxbw_40mhz && curshortgi_40mhz) ||
1898 (!curtxbw_40mhz && curshortgi_20mhz)) {
1902 else if (macid == 1)
1910 ratr_bitmap &= 0x000ff0ff;
1912 ratr_bitmap &= 0x0f0ff0ff;
1916 "ratr_bitmap :%x\n", ratr_bitmap);
1917 *(
u32 *)&rate_mask = (ratr_bitmap & 0x0fffffff) |
1919 rate_mask[4] = macid | (shortgi ? 0x20 : 0x00) | 0x80;
1921 "Rate_index:%x, ratr_val:%x, %x:%x:%x:%x:%x\n",
1922 ratr_index, ratr_bitmap,
1923 rate_mask[0], rate_mask[1], rate_mask[2], rate_mask[3],
1936 if (rtlpriv->
dm.useramask)
1937 rtl92ce_update_hal_rate_mask(hw, sta, rssi_level);
1939 rtl92ce_update_hal_rate_table(hw, sta);
1951 sifs_timer = 0x0a0a;
1953 sifs_timer = 0x1010;
1964 bool actuallyset =
false;
1975 spin_unlock_irqrestore(&rtlpriv->
locks.rf_ps_lock, flag);
1979 spin_unlock_irqrestore(&rtlpriv->
locks.rf_ps_lock, flag);
1990 "GPIOChangeRF - HW Radio ON, RF ON\n");
1992 e_rfpowerstate_toset =
ERFON;
1997 "GPIOChangeRF - HW Radio OFF, RF OFF\n");
1999 e_rfpowerstate_toset =
ERFOFF;
2007 spin_unlock_irqrestore(&rtlpriv->
locks.rf_ps_lock, flag);
2014 spin_unlock_irqrestore(&rtlpriv->
locks.rf_ps_lock, flag);
2023 u8 *p_macaddr,
bool is_group,
u8 enc_algo,
2024 bool is_wepkey,
bool clear_all)
2031 bool is_pairwise =
false;
2033 static u8 cam_const_addr[4][6] = {
2034 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
2035 {0x00, 0x00, 0x00, 0x00, 0x00, 0x01},
2036 {0x00, 0x00, 0x00, 0x00, 0x00, 0x02},
2037 {0x00, 0x00, 0x00, 0x00, 0x00, 0x03}
2039 static u8 cam_const_broad[] = {
2040 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
2046 u8 clear_number = 5;
2050 for (idx = 0; idx < clear_number; idx++) {
2057 rtlpriv->
sec.key_len[
idx] = 0;
2077 "switch case not processed\n");
2082 if (is_wepkey || rtlpriv->
sec.use_defaultkey) {
2087 macaddr = cam_const_broad;
2096 "Can not find free hw security cam entry\n");
2108 if (rtlpriv->
sec.key_len[key_index] == 0) {
2110 "delete one entry, entry_id is %d\n",
2117 "The insert KEY length is %d\n",
2120 "The insert KEY is %x %x\n",
2121 rtlpriv->
sec.key_buf[0][0],
2122 rtlpriv->
sec.key_buf[0][1]);
2128 "Pairwise Key content",
2129 rtlpriv->
sec.pairwise_key,
2134 "set Pairwise key\n");
2152 rtlpriv->
sec.key_buf
2159 rtlpriv->
sec.key_buf[entry_id]);
2166 static void rtl8192ce_bt_var_init(
struct ieee80211_hw *hw)
2179 rtlpcipriv->
bt_coexist.eeprom_bt_ant_isolation;
2184 rtlpcipriv->
bt_coexist.bt_radio_shared_type =
2185 rtlpcipriv->
bt_coexist.eeprom_bt_radio_shared;
2191 else if (rtlpcipriv->
bt_coexist.reg_bt_sco == 2)
2193 else if (rtlpcipriv->
bt_coexist.reg_bt_sco == 4)
2195 else if (rtlpcipriv->
bt_coexist.reg_bt_sco == 5)
2207 bool auto_load_fail,
u8 *hwinfo)
2212 if (!auto_load_fail) {
2216 rtlpcipriv->
bt_coexist.eeprom_bt_type = ((value & 0xe) >> 1);
2217 rtlpcipriv->
bt_coexist.eeprom_bt_ant_num = (value & 0x1);
2218 rtlpcipriv->
bt_coexist.eeprom_bt_ant_isolation =
2219 ((value & 0x10) >> 4);
2220 rtlpcipriv->
bt_coexist.eeprom_bt_radio_shared =
2221 ((value & 0x20) >> 5);
2223 rtlpcipriv->
bt_coexist.eeprom_bt_coexist = 0;
2226 rtlpcipriv->
bt_coexist.eeprom_bt_ant_isolation = 0;
2230 rtl8192ce_bt_var_init(hw);
2261 u1_tmp = rtl_read_byte(rtlpriv, 0x4fd) &
2264 ((rtlpcipriv->
bt_coexist.bt_ant_isolation == 1) ?
2268 rtl_write_byte(rtlpriv, 0x4fd, u1_tmp);