1 #include "mp_precomp.h"
5 ex_hal8723b_wifi_only_hw_config(
6 IN struct wifi_only_cfg *pwifionlycfg
9 struct wifi_only_haldata *pwifionly_haldata = &pwifionlycfg->haldata_info;
12 halwifionly_write1byte(pwifionlycfg, 0x778, 0x3); /* Set pta for wifi first priority, 0x1 need to reference pta table to determine wifi and bt priority */
13 halwifionly_bitmaskwrite1byte(pwifionlycfg, 0x40, 0x20, 0x1);
15 /* Set Antenna path to Wifi */
16 halwifionly_write2byte(pwifionlycfg, 0x0765, 0x8); /* Set pta for wifi first priority, 0x0 need to reference pta table to determine wifi and bt priority */
17 halwifionly_write2byte(pwifionlycfg, 0x076e, 0xc);
19 halwifionly_write4byte(pwifionlycfg, 0x000006c0, 0xaaaaaaaa); /* pta table, 0xaaaaaaaa means wifi is higher priority than bt */
20 halwifionly_write4byte(pwifionlycfg, 0x000006c4, 0xaaaaaaaa);
22 halwifionly_bitmaskwrite1byte(pwifionlycfg, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
25 if (pwifionlycfg->chip_interface == WIFIONLY_INTF_PCI) {
26 /* HP Foxconn NGFF at S0
27 not sure HP pg correct or not(EEPROMBluetoothSingleAntPath), so here we just write
28 0x948=0x280 for HP HW id NIC. */
29 if (pwifionly_haldata->customer_id == CUSTOMER_HP_1) {
30 halwifionly_write4byte(pwifionlycfg, 0x948, 0x280);
31 halwifionly_phy_set_rf_reg(pwifionlycfg, 0, 0x1, 0xfffff, 0x0); /* WiFi TRx Mask off */
36 if (pwifionly_haldata->efuse_pg_antnum == 2) {
37 halwifionly_write4byte(pwifionlycfg, 0x948, 0x0);
39 /* 3Attention !!! For 8723BU !!!!
40 For 8723BU single ant case: jira [USB-1237]
41 Because of 8723BU S1 has HW problem, we only can use S0 instead.
42 Whether Efuse 0xc3 [6] is 0 or 1, we should always use S0 and write 0x948 to 80/280
44 --------------------------------------------------
46 When in Single Ant case, Reg[0x948] has two case : 0x80 or 0x200
47 When in Two Ant case, Reg[0x948] has two case : 0x280 or 0x0
48 Efuse 0xc3 [6] Antenna Path
49 0xc3 [6] = 0 ==> S1 ==> 0x948 = 0/40/200
50 0xc3 [6] = 1 ==> S0 ==> 0x948 = 80/240/280 */
52 if (pwifionlycfg->chip_interface == WIFIONLY_INTF_USB)
53 halwifionly_write4byte(pwifionlycfg, 0x948, 0x80);
55 if (pwifionly_haldata->efuse_pg_antpath == 0)
56 halwifionly_write4byte(pwifionlycfg, 0x948, 0x0);
58 halwifionly_write4byte(pwifionlycfg, 0x948, 0x280);
64 /* after 8723B F-cut, TRx Mask should be set when 0x948=0x0 or 0x280
65 PHY_SetRFReg(Adapter, 0, 0x1, 0xfffff, 0x780); WiFi TRx Mask on */
66 halwifionly_phy_set_rf_reg(pwifionlycfg, 0, 0x1, 0xfffff, 0x0); /*WiFi TRx Mask off */