diff mbox series

[v4,7/7] wifi: rtw88: Enable the new RTL8821AU/RTL8812AU drivers

Message ID 0b8e8093-8103-4999-86bf-0055ec52ea64@gmail.com (mailing list archive)
State Accepted
Delegated to: Ping-Ke Shih
Headers show
Series wifi: rtw88: Add support for RTL8821AU and RTL8812AU | expand

Commit Message

Bitterblue Smith Oct. 30, 2024, 6:31 p.m. UTC
These are older Wifi 5 chips. RTL8821AU is 1x1, with or without
Bluetooth. RTL8812AU is 2x2, without Bluetooth.

Beamforming is not implemented. It looks like these chips need a
different implementation than what is in bf.c.

Speed tests with RTL8821AU: 137 Mbps download, 144 Mbps upload.
Speed tests with RTL8812AU: 344 Mbps download, 387 Mbps upload.

Station mode and AP mode were tested.

Bluetooth coexistence works. I used my Bluetooth headphones for
several days, listening to music and watching videos. There is only
a problem with the wifi speeds with one router:

With ISP's HG6544C router:
Official driver: 3/5 Mbps.
rtw88: a bit more, but not steady at all. Not enough to watch a 1080p
Youtube video.

With my D-Link Eagle R32 router running Openwrt, on the same channel:
Official driver: 6/10 Mbps.
rtw88: download starts around 30, climbs to 50 / upload is 10 Mbps.
I can watch a 1080p Youtube video.

The music doesn't cut out during any speed tests.

I also tested transferring files to and from my phone. I don't have
other types of Bluetooth devices to test.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
v2:
 - Add more information to the commit message.
 - Add the new rtw88_88xxa and rtw88_8812a modules.

v3:
 - Mention 8811AU in Kconfig.

v4:
 - No change.
---
 drivers/net/wireless/realtek/rtw88/Kconfig  | 33 +++++++++++++++++++++
 drivers/net/wireless/realtek/rtw88/Makefile | 15 ++++++++++
 2 files changed, 48 insertions(+)

Comments

kernel test robot Nov. 1, 2024, 12:35 a.m. UTC | #1
Hi Bitterblue,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v6.12-rc5 next-20241031]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bitterblue-Smith/wifi-rtw88-Add-rtw8812a_table-c-h/20241031-023323
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/0b8e8093-8103-4999-86bf-0055ec52ea64%40gmail.com
patch subject: [PATCH v4 7/7] wifi: rtw88: Enable the new RTL8821AU/RTL8812AU drivers
config: um-allyesconfig (https://download.01.org/0day-ci/archive/20241101/202411010825.Kzdw5VeV-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241101/202411010825.Kzdw5VeV-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411010825.Kzdw5VeV-lkp@intel.com/

All errors (new ones prefixed by >>):

         |                             REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:338:37: error: 'REG_IQK_COM64' undeclared (first use in this function)
     338 |                 rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:346:61: error: 'REG_IQKA_END' undeclared (first use in this function)
     346 |                         iqk_ready = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(10));
         |                                                             ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:377:50: error: 'REG_RX_IQC_AB_A' undeclared (first use in this function)
     377 |                         rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A,
         |                                                  ^~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:415:42: error: 'REG_CCASEL' undeclared (first use in this function)
     415 |                 rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0);
         |                                          ^~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:419:37: error: 'REG_AFE_PWR1_A' undeclared (first use in this function); did you mean 'REG_AFE_CTRL_4'?
     419 |                 rtw_write32(rtwdev, REG_AFE_PWR1_A, 0x77777777);
         |                                     ^~~~~~~~~~~~~~
         |                                     REG_AFE_CTRL_4
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:420:37: error: 'REG_AFE_PWR2_A' undeclared (first use in this function); did you mean 'REG_AFE_CTRL_4'?
     420 |                 rtw_write32(rtwdev, REG_AFE_PWR2_A, 0x77777777);
         |                                     ^~~~~~~~~~~~~~
         |                                     REG_AFE_CTRL_4
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:422:37: error: 'REG_RX_WAIT_CCA_TX_CCK_RFON_A' undeclared (first use in this function)
     422 |                 rtw_write32(rtwdev, REG_RX_WAIT_CCA_TX_CCK_RFON_A, 0x19791979);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:425:42: error: 'REG_3WIRE_SWA' undeclared (first use in this function)
     425 |                 rtw_write32_mask(rtwdev, REG_3WIRE_SWA, 0xf, 0x4);
         |                                          ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:430:42: error: 'REG_CK_MONHA' undeclared (first use in this function)
     430 |                 rtw_write32_mask(rtwdev, REG_CK_MONHA, GENMASK(26, 24), 0x7);
         |                                          ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:435:49: error: 'RF_MODE_TABLE_ADDR' undeclared (first use in this function)
     435 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_ADDR, RFREG_MASK,
         |                                                 ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:437:49: error: 'RF_MODE_TABLE_DATA0' undeclared (first use in this function)
     437 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA0, RFREG_MASK,
         |                                                 ^~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:439:49: error: 'RF_MODE_TABLE_DATA1' undeclared (first use in this function)
     439 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA1, RFREG_MASK,
         |                                                 ^~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:442:49: error: 'RF_TXA_PREPAD' undeclared (first use in this function)
     442 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_TXA_PREPAD, RFREG_MASK,
         |                                                 ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:444:49: error: 'RF_RXBB2' undeclared (first use in this function)
     444 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_RXBB2, RFREG_MASK, 0x8a001);
         |                                                 ^~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:445:37: error: 'REG_DAC_RSTB' undeclared (first use in this function)
     445 |                 rtw_write32(rtwdev, REG_DAC_RSTB, 0x00008000);
         |                                     ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:446:42: error: 'REG_TXAGCIDX' undeclared (first use in this function)
     446 |                 rtw_write32_mask(rtwdev, REG_TXAGCIDX, BIT(0), 0x1);
         |                                          ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:448:37: error: 'REG_IQK_COM00' undeclared (first use in this function)
     448 |                 rtw_write32(rtwdev, REG_IQK_COM00, 0x29002000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:450:37: error: 'REG_IQK_COM32' undeclared (first use in this function)
     450 |                 rtw_write32(rtwdev, REG_IQK_COM32, 0xa9002000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:452:37: error: 'REG_IQK_COM96' undeclared (first use in this function)
     452 |                 rtw_write32(rtwdev, REG_IQK_COM96, 0x00462910);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:458:45: error: 'REG_OFDM0_XB_TX_IQ_IMBALANCE' undeclared (first use in this function)
     458 |                         rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE,
         |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:465:45: error: 'REG_TSSI_TRK_SW' undeclared (first use in this function)
     465 |                         rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x68163e96);
         |                                             ^~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:470:37: error: 'REG_OFDM0_XA_TX_IQ_IMBALANCE' undeclared (first use in this function)
     470 |                 rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x18008c10);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:472:37: error: 'REG_OFDM0_A_TX_AFE' undeclared (first use in this function)
     472 |                 rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c10);
         |                                     ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:473:37: error: 'REG_RFECTL_A' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     473 |                 rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000);
         |                                     ^~~~~~~~~~~~
         |                                     REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:474:37: error: 'REG_IQK_COM64' undeclared (first use in this function)
     474 |                 rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:482:49: error: 'RF_TXMOD' undeclared (first use in this function)
     482 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_TXMOD, 0x7fe00,
         |                                                 ^~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_coex_cfg_ant_switch':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:751:40: error: 'REG_GNT_BT' undeclared (first use in this function)
     751 |                 rtw_write8_set(rtwdev, REG_GNT_BT, BIT_PTA_SW_CTL);
         |                                        ^~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:751:52: error: 'BIT_PTA_SW_CTL' undeclared (first use in this function)
     751 |                 rtw_write8_set(rtwdev, REG_GNT_BT, BIT_PTA_SW_CTL);
         |                                                    ^~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:754:40: error: 'PTA_CTRL_PIN' undeclared (first use in this function)
     754 |                            share_ant ? PTA_CTRL_PIN : DPDT_CTRL_PIN);
         |                                        ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:754:55: error: 'DPDT_CTRL_PIN' undeclared (first use in this function)
     754 |                            share_ant ? PTA_CTRL_PIN : DPDT_CTRL_PIN);
         |                                                       ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: At top level:
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:836:10: error: 'const struct rtw_chip_ops' has no member named 'power_on'
     836 |         .power_on               = rtw88xxa_power_on,
         |          ^~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:836:35: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
     836 |         .power_on               = rtw88xxa_power_on,
         |                                   ^~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:836:35: note: (near initialization for 'rtw8821a_ops')
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:836:35: error: invalid initializer
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:836:35: note: (near initialization for 'rtw8821a_ops.<anonymous>')
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:837:10: error: 'const struct rtw_chip_ops' has no member named 'power_off'
     837 |         .power_off              = rtw8821a_power_off,
         |          ^~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:837:35: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
     837 |         .power_off              = rtw8821a_power_off,
         |                                   ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:837:35: note: (near initialization for 'rtw8821a_ops')
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:914:25: error: 'REG_RXIGI_A' undeclared here (not in a function); did you mean 'REG_RX_GAIN_EN'?
     914 |         [0] = { .addr = REG_RXIGI_A, .mask = 0x7f },
         |                         ^~~~~~~~~~~
         |                         REG_RX_GAIN_EN
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:920:18: error: 'const struct rtw_rfe_def' has no member named 'pwr_track_tbl'
     920 |                 .pwr_track_tbl  = &rtw8821a_rtw_pwr_track_tbl, },
         |                  ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:920:35: error: initialization of 'const struct rtw_table *' from incompatible pointer type 'const struct rtw_pwr_track_tbl *' [-Werror=incompatible-pointer-types]
     920 |                 .pwr_track_tbl  = &rtw8821a_rtw_pwr_track_tbl, },
         |                                   ^
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:920:35: note: (near initialization for 'rtw8821a_rfe_defs[0].agc_btg_tbl')
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1112:15: error: 'RTW_CHIP_TYPE_8821A' undeclared here (not in a function); did you mean 'RTW_CHIP_TYPE_8821C'?
    1112 |         .id = RTW_CHIP_TYPE_8821A,
         |               ^~~~~~~~~~~~~~~~~~~
         |               RTW_CHIP_TYPE_8821C
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1130:22: warning: unsigned conversion from 'int' to 'unsigned char' changes value from '256' to '0' [-Woverflow]
    1130 |         .page_size = 256,
         |                      ^~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1143:26: error: 'REG_LSSI_WRITE_A' undeclared here (not in a function)
    1143 |         .rf_sipi_addr = {REG_LSSI_WRITE_A, REG_LSSI_WRITE_B},
         |                          ^~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1143:44: error: 'REG_LSSI_WRITE_B' undeclared here (not in a function)
    1143 |         .rf_sipi_addr = {REG_LSSI_WRITE_A, REG_LSSI_WRITE_B},
         |                                            ^~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1152:10: error: 'const struct rtw_chip_info' has no member named 'hw_feature_report'
    1152 |         .hw_feature_report = false,
         |          ^~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1153:10: error: 'const struct rtw_chip_info' has no member named 'c2h_ra_report_size'
    1153 |         .c2h_ra_report_size = 4,
         |          ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1153:31: warning: initialized field overwritten [-Woverride-init]
    1153 |         .c2h_ra_report_size = 4,
         |                               ^
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1153:31: note: (near initialization for 'rtw8821a_hw_spec.max_power_index')
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1154:10: error: 'const struct rtw_chip_info' has no member named 'old_datarate_fb_limit'
    1154 |         .old_datarate_fb_limit = true,
         |          ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1157:26: warning: initialized field overwritten [-Woverride-init]
    1157 |         .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
         |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:1157:26: note: (near initialization for 'rtw8821a_hw_spec.ampdu_density')
   cc1: some warnings being treated as errors
--
     337 |         rtw_write32(rtwdev, REG_DAC_RSTB, 0x00008000);
         |                             ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:338:34: error: 'REG_TXAGCIDX' undeclared (first use in this function)
     338 |         rtw_write32_mask(rtwdev, REG_TXAGCIDX, BIT(0), 0x1);
         |                                  ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:339:34: error: 'REG_INIDLYB' undeclared (first use in this function)
     339 |         rtw_write32_mask(rtwdev, REG_INIDLYB, BIT(0), 0x1);
         |                                  ^~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:340:29: error: 'REG_IQK_COM00' undeclared (first use in this function)
     340 |         rtw_write32(rtwdev, REG_IQK_COM00, 0x29002000); /* TX (X,Y) */
         |                             ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:341:29: error: 'REG_IQK_COM32' undeclared (first use in this function)
     341 |         rtw_write32(rtwdev, REG_IQK_COM32, 0xa9002000); /* RX (X,Y) */
         |                             ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:342:29: error: 'REG_IQK_COM96' undeclared (first use in this function)
     342 |         rtw_write32(rtwdev, REG_IQK_COM96, 0x00462910); /* [0]:AGC_en, [15]:idac_K_Mask */
         |                             ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:348:45: error: 'REG_OFDM0_XB_TX_IQ_IMBALANCE' undeclared (first use in this function)
     348 |                         rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x821403e3);
         |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:349:45: error: 'REG_TXPITMB' undeclared (first use in this function)
     349 |                         rtw_write32(rtwdev, REG_TXPITMB, 0x821403e3);
         |                                             ^~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:360:37: error: 'REG_TSSI_TRK_SW' undeclared (first use in this function)
     360 |                 rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x68163e96);
         |                                     ^~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:361:37: error: 'REG_RXPITMB' undeclared (first use in this function); did you mean 'REG_RXPKTNUM'?
     361 |                 rtw_write32(rtwdev, REG_RXPITMB, 0x68163e96);
         |                                     ^~~~~~~~~~~
         |                                     REG_RXPKTNUM
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:377:29: error: 'REG_OFDM0_XA_TX_IQ_IMBALANCE' undeclared (first use in this function)
     377 |         rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x18008c10);
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:379:29: error: 'REG_OFDM0_A_TX_AFE' undeclared (first use in this function)
     379 |         rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c10);
         |                             ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:380:29: error: 'REG_INTPO_SETA' undeclared (first use in this function)
     380 |         rtw_write32(rtwdev, REG_INTPO_SETA, 0x00000000);
         |                             ^~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:382:29: error: 'REG_TXTONEB' undeclared (first use in this function)
     382 |         rtw_write32(rtwdev, REG_TXTONEB, 0x18008c10);
         |                             ^~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:384:29: error: 'REG_RXTONEB' undeclared (first use in this function)
     384 |         rtw_write32(rtwdev, REG_RXTONEB, 0x38008c10);
         |                             ^~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:385:29: error: 'REG_INTPO_SETB' undeclared (first use in this function)
     385 |         rtw_write32(rtwdev, REG_INTPO_SETB, 0x00000000);
         |                             ^~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:391:37: error: 'REG_RFECTL_A' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     391 |                 rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000);
         |                                     ^~~~~~~~~~~~
         |                                     REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:392:37: error: 'REG_RFECTL_B' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     392 |                 rtw_write32(rtwdev, REG_RFECTL_B, 0x00100000);
         |                                     ^~~~~~~~~~~~
         |                                     REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:393:37: error: 'REG_IQK_COM64' undeclared (first use in this function)
     393 |                 rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:404:62: error: 'REG_IQKA_END' undeclared (first use in this function)
     404 |                                                              REG_IQKA_END,
         |                                                              ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:408:62: error: 'REG_IQKB_END' undeclared (first use in this function)
     408 |                                                              REG_IQKB_END,
         |                                                              ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:515:41: error: 'RF_TXMOD' undeclared (first use in this function)
     515 |         rtw_write_rf(rtwdev, RF_PATH_A, RF_TXMOD, 0x7fe00,
         |                                         ^~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:561:37: error: 'REG_RFE_PINMUX_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     561 |                 rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77777717);
         |                                     ^~~~~~~~~~~~~~~~
         |                                     REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:562:37: error: 'REG_RFE_INV_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     562 |                 rtw_write32(rtwdev, REG_RFE_INV_A, 0x00000077);
         |                                     ^~~~~~~~~~~~~
         |                                     REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:563:37: error: 'REG_RFE_PINMUX_B' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     563 |                 rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77777717);
         |                                     ^~~~~~~~~~~~~~~~
         |                                     REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:564:37: error: 'REG_RFE_INV_B' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     564 |                 rtw_write32(rtwdev, REG_RFE_INV_B, 0x00000077);
         |                                     ^~~~~~~~~~~~~
         |                                     REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw8812a.c: In function 'rtw8812a_do_iqk':
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:809:33: error: 'REG_CCASEL' undeclared (first use in this function)
     809 |         rtw_write32_set(rtwdev, REG_CCASEL, BIT(31));
         |                                 ^~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:810:38: error: 'REG_RFECTL_A' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     810 |         reg_cb8 = rtw_read32(rtwdev, REG_RFECTL_A);
         |                                      ^~~~~~~~~~~~
         |                                      REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:811:38: error: 'REG_RFECTL_B' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     811 |         reg_eb8 = rtw_read32(rtwdev, REG_RFECTL_B);
         |                                      ^~~~~~~~~~~~
         |                                      REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8812a.c: At top level:
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:899:10: error: 'const struct rtw_chip_ops' has no member named 'power_on'
     899 |         .power_on               = rtw88xxa_power_on,
         |          ^~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8812a.c:899:35: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
     899 |         .power_on               = rtw88xxa_power_on,
         |                                   ^~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:899:35: note: (near initialization for 'rtw8812a_ops')
>> drivers/net/wireless/realtek/rtw88/rtw8812a.c:899:35: error: invalid initializer
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:899:35: note: (near initialization for 'rtw8812a_ops.<anonymous>')
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:900:10: error: 'const struct rtw_chip_ops' has no member named 'power_off'
     900 |         .power_off              = rtw8812a_power_off,
         |          ^~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:900:35: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
     900 |         .power_off              = rtw8812a_power_off,
         |                                   ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:900:35: note: (near initialization for 'rtw8812a_ops')
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:977:25: error: 'REG_RXIGI_A' undeclared here (not in a function); did you mean 'REG_RX_GAIN_EN'?
     977 |         [0] = { .addr = REG_RXIGI_A, .mask = 0x7f },
         |                         ^~~~~~~~~~~
         |                         REG_RX_GAIN_EN
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:978:25: error: 'REG_RXIGI_B' undeclared here (not in a function); did you mean 'REG_RX_GAIN_EN'?
     978 |         [1] = { .addr = REG_RXIGI_B, .mask = 0x7f },
         |                         ^~~~~~~~~~~
         |                         REG_RX_GAIN_EN
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:984:18: error: 'const struct rtw_rfe_def' has no member named 'pwr_track_tbl'
     984 |                 .pwr_track_tbl  = &rtw8812a_rtw_pwr_track_tbl, },
         |                  ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:984:35: error: initialization of 'const struct rtw_table *' from incompatible pointer type 'const struct rtw_pwr_track_tbl *' [-Werror=incompatible-pointer-types]
     984 |                 .pwr_track_tbl  = &rtw8812a_rtw_pwr_track_tbl, },
         |                                   ^
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:984:35: note: (near initialization for 'rtw8812a_rfe_defs[0].agc_btg_tbl')
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:987:18: error: 'const struct rtw_rfe_def' has no member named 'pwr_track_tbl'
     987 |                 .pwr_track_tbl  = &rtw8812a_rtw_pwr_track_tbl, },
         |                  ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:987:35: error: initialization of 'const struct rtw_table *' from incompatible pointer type 'const struct rtw_pwr_track_tbl *' [-Werror=incompatible-pointer-types]
     987 |                 .pwr_track_tbl  = &rtw8812a_rtw_pwr_track_tbl, },
         |                                   ^
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:987:35: note: (near initialization for 'rtw8812a_rfe_defs[1].agc_btg_tbl')
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:990:18: error: 'const struct rtw_rfe_def' has no member named 'pwr_track_tbl'
     990 |                 .pwr_track_tbl  = &rtw8812a_rtw_pwr_track_rfe3_tbl, },
         |                  ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:990:35: error: initialization of 'const struct rtw_table *' from incompatible pointer type 'const struct rtw_pwr_track_tbl *' [-Werror=incompatible-pointer-types]
     990 |                 .pwr_track_tbl  = &rtw8812a_rtw_pwr_track_rfe3_tbl, },
         |                                   ^
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:990:35: note: (near initialization for 'rtw8812a_rfe_defs[3].agc_btg_tbl')
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1018:15: error: 'RTW_CHIP_TYPE_8812A' undeclared here (not in a function); did you mean 'RTW_CHIP_TYPE_8821C'?
    1018 |         .id = RTW_CHIP_TYPE_8812A,
         |               ^~~~~~~~~~~~~~~~~~~
         |               RTW_CHIP_TYPE_8821C
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1036:22: warning: unsigned conversion from 'int' to 'unsigned char' changes value from '512' to '0' [-Woverflow]
    1036 |         .page_size = 512,
         |                      ^~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1049:26: error: 'REG_LSSI_WRITE_A' undeclared here (not in a function)
    1049 |         .rf_sipi_addr = {REG_LSSI_WRITE_A, REG_LSSI_WRITE_B},
         |                          ^~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1049:44: error: 'REG_LSSI_WRITE_B' undeclared here (not in a function)
    1049 |         .rf_sipi_addr = {REG_LSSI_WRITE_A, REG_LSSI_WRITE_B},
         |                                            ^~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1058:10: error: 'const struct rtw_chip_info' has no member named 'hw_feature_report'
    1058 |         .hw_feature_report = false,
         |          ^~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1059:10: error: 'const struct rtw_chip_info' has no member named 'c2h_ra_report_size'
    1059 |         .c2h_ra_report_size = 4,
         |          ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1059:31: warning: initialized field overwritten [-Woverride-init]
    1059 |         .c2h_ra_report_size = 4,
         |                               ^
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1059:31: note: (near initialization for 'rtw8812a_hw_spec.max_power_index')
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1060:10: error: 'const struct rtw_chip_info' has no member named 'old_datarate_fb_limit'
    1060 |         .old_datarate_fb_limit = true,
         |          ^~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1063:26: warning: initialized field overwritten [-Woverride-init]
    1063 |         .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
         |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8812a.c:1063:26: note: (near initialization for 'rtw8812a_hw_spec.ampdu_density')
   cc1: some warnings being treated as errors

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for GET_FREE_REGION
   Depends on [n]: SPARSEMEM [=n]
   Selected by [y]:
   - RESOURCE_KUNIT_TEST [=y] && RUNTIME_TESTING_MENU [=y] && KUNIT [=y]


vim +836 drivers/net/wireless/realtek/rtw88/rtw8821a.c

113f5244025fcf Bitterblue Smith 2024-10-30  834  
113f5244025fcf Bitterblue Smith 2024-10-30  835  static const struct rtw_chip_ops rtw8821a_ops = {
113f5244025fcf Bitterblue Smith 2024-10-30 @836  	.power_on		= rtw88xxa_power_on,
113f5244025fcf Bitterblue Smith 2024-10-30  837  	.power_off		= rtw8821a_power_off,
113f5244025fcf Bitterblue Smith 2024-10-30  838  	.phy_set_param		= NULL,
113f5244025fcf Bitterblue Smith 2024-10-30  839  	.read_efuse		= rtw88xxa_read_efuse,
113f5244025fcf Bitterblue Smith 2024-10-30  840  	.query_phy_status	= rtw8821a_query_phy_status,
113f5244025fcf Bitterblue Smith 2024-10-30  841  	.set_channel		= rtw88xxa_set_channel,
113f5244025fcf Bitterblue Smith 2024-10-30  842  	.mac_init		= NULL,
113f5244025fcf Bitterblue Smith 2024-10-30  843  	.read_rf		= rtw88xxa_phy_read_rf,
113f5244025fcf Bitterblue Smith 2024-10-30  844  	.write_rf		= rtw_phy_write_rf_reg_sipi,
113f5244025fcf Bitterblue Smith 2024-10-30  845  	.set_antenna		= NULL,
113f5244025fcf Bitterblue Smith 2024-10-30  846  	.set_tx_power_index	= rtw88xxa_set_tx_power_index,
113f5244025fcf Bitterblue Smith 2024-10-30  847  	.cfg_ldo25		= rtw8821a_cfg_ldo25,
113f5244025fcf Bitterblue Smith 2024-10-30  848  	.efuse_grant		= rtw88xxa_efuse_grant,
113f5244025fcf Bitterblue Smith 2024-10-30  849  	.false_alarm_statistics	= rtw88xxa_false_alarm_statistics,
113f5244025fcf Bitterblue Smith 2024-10-30  850  	.phy_calibration	= rtw8821a_phy_calibration,
113f5244025fcf Bitterblue Smith 2024-10-30  851  	.cck_pd_set		= rtw88xxa_phy_cck_pd_set,
113f5244025fcf Bitterblue Smith 2024-10-30  852  	.pwr_track		= rtw8821a_pwr_track,
113f5244025fcf Bitterblue Smith 2024-10-30  853  	.config_bfee		= NULL,
113f5244025fcf Bitterblue Smith 2024-10-30  854  	.set_gid_table		= NULL,
113f5244025fcf Bitterblue Smith 2024-10-30  855  	.cfg_csi_rate		= NULL,
113f5244025fcf Bitterblue Smith 2024-10-30  856  	.fill_txdesc_checksum	= rtw8821a_fill_txdesc_checksum,
113f5244025fcf Bitterblue Smith 2024-10-30  857  	.coex_set_init		= rtw8821a_coex_cfg_init,
113f5244025fcf Bitterblue Smith 2024-10-30  858  	.coex_set_ant_switch	= rtw8821a_coex_cfg_ant_switch,
113f5244025fcf Bitterblue Smith 2024-10-30  859  	.coex_set_gnt_fix	= rtw8821a_coex_cfg_gnt_fix,
113f5244025fcf Bitterblue Smith 2024-10-30  860  	.coex_set_gnt_debug	= rtw8821a_coex_cfg_gnt_debug,
113f5244025fcf Bitterblue Smith 2024-10-30  861  	.coex_set_rfe_type	= rtw8821a_coex_cfg_rfe_type,
113f5244025fcf Bitterblue Smith 2024-10-30  862  	.coex_set_wl_tx_power	= rtw8821a_coex_cfg_wl_tx_power,
113f5244025fcf Bitterblue Smith 2024-10-30  863  	.coex_set_wl_rx_gain	= rtw8821a_coex_cfg_wl_rx_gain,
113f5244025fcf Bitterblue Smith 2024-10-30  864  };
113f5244025fcf Bitterblue Smith 2024-10-30  865
kernel test robot Nov. 1, 2024, 12:56 a.m. UTC | #2
Hi Bitterblue,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v6.12-rc5 next-20241031]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Bitterblue-Smith/wifi-rtw88-Add-rtw8812a_table-c-h/20241031-023323
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/0b8e8093-8103-4999-86bf-0055ec52ea64%40gmail.com
patch subject: [PATCH v4 7/7] wifi: rtw88: Enable the new RTL8821AU/RTL8812AU drivers
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20241101/202411010808.yxK25k9f-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241101/202411010808.yxK25k9f-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411010808.yxK25k9f-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxa_read_usb_type':
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:137:33: error: 'RTW_CHIP_TYPE_8821A' undeclared (first use in this function); did you mean 'RTW_CHIP_TYPE_8821C'?
     137 |         if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A)
         |                                 ^~~~~~~~~~~~~~~~~~~
         |                                 RTW_CHIP_TYPE_8821C
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:137:33: note: each undeclared identifier is reported only once for each function it appears in
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxa_read_efuse':
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:207:25: error: 'RTW_CHIP_TYPE_8812A' undeclared (first use in this function); did you mean 'RTW_CHIP_TYPE_8821C'?
     207 |         if (chip->id == RTW_CHIP_TYPE_8812A)
         |                         ^~~~~~~~~~~~~~~~~~~
         |                         RTW_CHIP_TYPE_8821C
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:243:25: error: 'RTW_CHIP_TYPE_8821A' undeclared (first use in this function); did you mean 'RTW_CHIP_TYPE_8821C'?
     243 |         if (chip->id == RTW_CHIP_TYPE_8821A)
         |                         ^~~~~~~~~~~~~~~~~~~
         |                         RTW_CHIP_TYPE_8821C
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxa_reset_8051':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:285:25: error: 'RTW_CHIP_TYPE_8812A' undeclared (first use in this function); did you mean 'RTW_CHIP_TYPE_8821C'?
     285 |         if (chip->id == RTW_CHIP_TYPE_8812A)
         |                         ^~~~~~~~~~~~~~~~~~~
         |                         RTW_CHIP_TYPE_8821C
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxau_hw_reset':
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:315:33: error: 'REG_FPGA0_XCD_RF_PARA' undeclared (first use in this function)
     315 |         rtw_write32_set(rtwdev, REG_FPGA0_XCD_RF_PARA, BIT(6));
         |                                 ^~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:327:32: error: 'REG_APS_FSMCO' undeclared (first use in this function)
     327 |         rtw_write8_set(rtwdev, REG_APS_FSMCO + 1, APS_FSMCO_MAC_OFF >> 8);
         |                                ^~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:327:51: error: 'APS_FSMCO_MAC_OFF' undeclared (first use in this function)
     327 |         rtw_write8_set(rtwdev, REG_APS_FSMCO + 1, APS_FSMCO_MAC_OFF >> 8);
         |                                                   ^~~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:337:17: error: 'APS_FSMCO_MAC_ENABLE' undeclared (first use in this function)
     337 |         val8 |= APS_FSMCO_MAC_ENABLE >> 8;
         |                 ^~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxau_init_power_on':
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:350:15: error: implicit declaration of function 'rtw_pwr_seq_parser' [-Werror=implicit-function-declaration]
     350 |         ret = rtw_pwr_seq_parser(rtwdev, chip->pwr_on_seq);
         |               ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:362:25: error: 'RTW_CHIP_TYPE_8821A' undeclared (first use in this function); did you mean 'RTW_CHIP_TYPE_8821C'?
     362 |         if (chip->id == RTW_CHIP_TYPE_8821A) {
         |                         ^~~~~~~~~~~~~~~~~~~
         |                         RTW_CHIP_TYPE_8821C
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxa_llt_write':
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:372:21: error: 'BIT_LLT_WRITE_ACCESS' undeclared (first use in this function)
     372 |         u32 value = BIT_LLT_WRITE_ACCESS | (address << 8) | data;
         |                     ^~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:375:29: error: 'REG_LLT_INIT' undeclared (first use in this function)
     375 |         rtw_write32(rtwdev, REG_LLT_INIT, value);
         |                             ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxau_tx_aggregation':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:552:25: error: 'RTW_CHIP_TYPE_8821A' undeclared (first use in this function); did you mean 'RTW_CHIP_TYPE_8821C'?
     552 |         if (chip->id == RTW_CHIP_TYPE_8821A)
         |                         ^~~~~~~~~~~~~~~~~~~
         |                         RTW_CHIP_TYPE_8821C
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:553:36: error: 'REG_DWBCN1_CTRL' undeclared (first use in this function); did you mean 'REG_DWBCN0_CTRL'?
     553 |                 rtw_write8(rtwdev, REG_DWBCN1_CTRL,
         |                                    ^~~~~~~~~~~~~~~
         |                                    REG_DWBCN0_CTRL
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxa_init_beacon_parameters':
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:569:29: error: 'REG_BCNTCFG' undeclared (first use in this function)
     569 |         rtw_write16(rtwdev, REG_BCNTCFG, 0x4413);
         |                             ^~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxa_phy_bb_config':
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:578:17: error: 'BIT_FEN_USBA' undeclared (first use in this function); did you mean 'BIT_FEN_ELDR'?
     578 |         val8 |= BIT_FEN_USBA;
         |                 ^~~~~~~~~~~~
         |                 BIT_FEN_ELDR
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:587:28: error: 'REG_RF_B_CTRL' undeclared (first use in this function); did you mean 'REG_RF_CTRL'?
     587 |         rtw_write8(rtwdev, REG_RF_B_CTRL,
         |                            ^~~~~~~~~~~~~
         |                            REG_RF_CTRL
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:594:33: error: 'RTW_CHIP_TYPE_8812A' undeclared (first use in this function); did you mean 'RTW_CHIP_TYPE_8821C'?
     594 |         if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A)
         |                                 ^~~~~~~~~~~~~~~~~~~
         |                                 RTW_CHIP_TYPE_8821C
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw8812a_config_1t':
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:613:34: error: 'REG_RXPSEL' undeclared (first use in this function); did you mean 'REG_RQPN'?
     613 |         rtw_write32_mask(rtwdev, REG_RXPSEL, 0xff, 0x11);
         |                                  ^~~~~~~~~~
         |                                  REG_RQPN
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:616:34: error: 'REG_TXPSEL' undeclared (first use in this function); did you mean 'REG_TXPAUSE'?
     616 |         rtw_write32_mask(rtwdev, REG_TXPSEL, MASKLWORD, 0x1111);
         |                                  ^~~~~~~~~~
         |                                  REG_TXPAUSE
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:619:34: error: 'REG_CCK_RX' undeclared (first use in this function)
     619 |         rtw_write32_mask(rtwdev, REG_CCK_RX, 0x0c000000, 0x0);
         |                                  ^~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:622:34: error: 'REG_RX_MCS_LIMIT' undeclared (first use in this function); did you mean 'REG_RX_PKT_LIMIT'?
     622 |         rtw_write32_mask(rtwdev, REG_RX_MCS_LIMIT, 0xc0000060, 0x4);
         |                                  ^~~~~~~~~~~~~~~~
         |                                  REG_RX_PKT_LIMIT
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:625:34: error: 'REG_3WIRE_SWB' undeclared (first use in this function)
     625 |         rtw_write32_mask(rtwdev, REG_3WIRE_SWB, 0xf, 0x4);
         |                                  ^~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:628:34: error: 'REG_LSSI_WRITE_B' undeclared (first use in this function)
     628 |         rtw_write32_mask(rtwdev, REG_LSSI_WRITE_B, MASKDWORD, 0);
         |                                  ^~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw88xxa.c:631:34: error: 'REG_AFE_PWR1_B' undeclared (first use in this function); did you mean 'REG_AFE_CTRL_4'?
     631 |         rtw_write32_mask(rtwdev, REG_AFE_PWR1_B, MASKDWORD, 0);
         |                                  ^~~~~~~~~~~~~~
         |                                  REG_AFE_CTRL_4
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:632:34: error: 'REG_AFE_PWR2_B' undeclared (first use in this function); did you mean 'REG_AFE_CTRL_4'?
     632 |         rtw_write32_mask(rtwdev, REG_AFE_PWR2_B, MASKDWORD, 0);
         |                                  ^~~~~~~~~~~~~~
         |                                  REG_AFE_CTRL_4
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxa_pwrtrack_init':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:684:33: error: 'RTW_CHIP_TYPE_8821A' undeclared (first use in this function); did you mean 'RTW_CHIP_TYPE_8821C'?
     684 |         if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A)
         |                                 ^~~~~~~~~~~~~~~~~~~
         |                                 RTW_CHIP_TYPE_8821C
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxa_power_off':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:721:40: error: 'REG_USB_MOD' undeclared (first use in this function)
     721 |                 rtw_write8_set(rtwdev, REG_USB_MOD, 0x18);
         |                                        ^~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:723:29: error: 'REG_HISR0' undeclared (first use in this function); did you mean 'REG_ARFR0'?
     723 |         rtw_write32(rtwdev, REG_HISR0, 0xffffffff);
         |                             ^~~~~~~~~
         |                             REG_ARFR0
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:724:29: error: 'REG_HISR1' undeclared (first use in this function); did you mean 'REG_FWISR'?
     724 |         rtw_write32(rtwdev, REG_HISR1, 0xffffffff);
         |                             ^~~~~~~~~
         |                             REG_FWISR
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:725:29: error: 'REG_HIMR0' undeclared (first use in this function); did you mean 'REG_FWIMR'?
     725 |         rtw_write32(rtwdev, REG_HIMR0, 0);
         |                             ^~~~~~~~~
         |                             REG_FWIMR
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:726:29: error: 'REG_HIMR1' undeclared (first use in this function); did you mean 'REG_FWIMR'?
     726 |         rtw_write32(rtwdev, REG_HIMR1, 0);
         |                             ^~~~~~~~~
         |                             REG_FWIMR
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:731:40: error: 'REG_APS_FSMCO' undeclared (first use in this function)
     731 |         ori_fsmc0 = rtw_read16(rtwdev, REG_APS_FSMCO);
         |                                        ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:732:57: error: 'APS_FSMCO_HW_POWERDOWN' undeclared (first use in this function)
     732 |         rtw_write16(rtwdev, REG_APS_FSMCO, ori_fsmc0 & ~APS_FSMCO_HW_POWERDOWN);
         |                                                         ^~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:735:32: error: 'REG_TX_RPT_CTRL' undeclared (first use in this function); did you mean 'REG_TX_PTCL_CTRL'?
     735 |         rtw_write8_clr(rtwdev, REG_TX_RPT_CTRL, BIT(1));
         |                                ^~~~~~~~~~~~~~~
         |                                REG_TX_PTCL_CTRL
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw88xxa_set_channel_bb_swing':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:759:34: error: 'REG_TXSCALE_A' undeclared (first use in this function)
     759 |         rtw_write32_mask(rtwdev, REG_TXSCALE_A, BB_SWING_MASK,
         |                                  ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:759:49: error: 'BB_SWING_MASK' undeclared (first use in this function)
     759 |         rtw_write32_mask(rtwdev, REG_TXSCALE_A, BB_SWING_MASK,
         |                                                 ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:761:34: error: 'REG_TXSCALE_B' undeclared (first use in this function)
     761 |         rtw_write32_mask(rtwdev, REG_TXSCALE_B, BB_SWING_MASK,
         |                                  ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw8821a_set_ext_band_switch':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:770:34: error: 'REG_RFE_INV_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     770 |         rtw_write32_mask(rtwdev, REG_RFE_INV_A, 0xf, 7);
         |                                  ^~~~~~~~~~~~~
         |                                  REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw8821a_phy_set_rfe_reg_24g':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:786:34: error: 'REG_RFE_PINMUX_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     786 |         rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, 0xF000, 0x7);
         |                                  ^~~~~~~~~~~~~~~~
         |                                  REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:792:42: error: 'REG_RFE_INV_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     792 |                 rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(20), 1);
         |                                          ^~~~~~~~~~~~~
         |                                          REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw8821a_phy_set_rfe_reg_5g':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:810:34: error: 'REG_RFE_PINMUX_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     810 |         rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, 0xF000, 0x5);
         |                                  ^~~~~~~~~~~~~~~~
         |                                  REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:815:34: error: 'REG_RFE_INV_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     815 |         rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(20), 0);
         |                                  ^~~~~~~~~~~~~
         |                                  REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw8812a_phy_set_rfe_reg_24g':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:826:37: error: 'REG_RFE_PINMUX_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     826 |                 rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77777777);
         |                                     ^~~~~~~~~~~~~~~~
         |                                     REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:827:37: error: 'REG_RFE_PINMUX_B' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     827 |                 rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77777777);
         |                                     ^~~~~~~~~~~~~~~~
         |                                     REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:828:42: error: 'REG_RFE_INV_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     828 |                 rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x000);
         |                                          ^~~~~~~~~~~~~
         |                                          REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:828:57: error: 'RFE_INV_MASK' undeclared (first use in this function)
     828 |                 rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x000);
         |                                                         ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:829:42: error: 'REG_RFE_INV_B' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
     829 |                 rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x000);
         |                                          ^~~~~~~~~~~~~
         |                                          REG_RFE_INV16
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:849:42: error: 'REG_ANTSEL_SW' undeclared (first use in this function)
     849 |                 rtw_write32_mask(rtwdev, REG_ANTSEL_SW, 0x00000303, 0x1);
         |                                          ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c: In function 'rtw8812a_phy_set_rfe_reg_5g':
   drivers/net/wireless/realtek/rtw88/rtw88xxa.c:878:37: error: 'REG_RFE_PINMUX_A' undeclared (first use in this function); did you mean 'REG_RFE_INV16'?
--
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk_backup_rf':
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:63:34: error: 'REG_CCASEL' undeclared (first use in this function)
      63 |         rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0);
         |                                  ^~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:63:34: note: each undeclared identifier is reported only once for each function it appears in
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk_restore_rf':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:78:34: error: 'REG_CCASEL' undeclared (first use in this function)
      78 |         rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0);
         |                                  ^~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk_restore_afe':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:91:34: error: 'REG_CCASEL' undeclared (first use in this function)
      91 |         rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0);
         |                                  ^~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:100:29: error: 'REG_OFDM0_XA_TX_IQ_IMBALANCE' undeclared (first use in this function)
     100 |         rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x0);
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:101:29: error: 'REG_OFDM0_A_TX_AFE' undeclared (first use in this function)
     101 |         rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x0);
         |                             ^~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:102:29: error: 'REG_OFDM0_XB_TX_IQ_IMBALANCE' undeclared (first use in this function)
     102 |         rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x0);
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:103:29: error: 'REG_TSSI_TRK_SW' undeclared (first use in this function)
     103 |         rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x3c000000);
         |                             ^~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:104:29: error: 'REG_LSSI_WRITE_A' undeclared (first use in this function)
     104 |         rtw_write32(rtwdev, REG_LSSI_WRITE_A, 0x00000080);
         |                             ^~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:105:29: error: 'REG_TXAGCIDX' undeclared (first use in this function)
     105 |         rtw_write32(rtwdev, REG_TXAGCIDX, 0x00000000);
         |                             ^~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:106:29: error: 'REG_IQK_DPD_CFG' undeclared (first use in this function)
     106 |         rtw_write32(rtwdev, REG_IQK_DPD_CFG, 0x20040000);
         |                             ^~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:107:29: error: 'REG_CFG_PMPD' undeclared (first use in this function)
     107 |         rtw_write32(rtwdev, REG_CFG_PMPD, 0x20000000);
         |                             ^~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:108:29: error: 'REG_RFECTL_A' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     108 |         rtw_write32(rtwdev, REG_RFECTL_A, 0x0);
         |                             ^~~~~~~~~~~~
         |                             REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk_rx_fill':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:115:34: error: 'REG_CCASEL' undeclared (first use in this function)
     115 |         rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0);
         |                                  ^~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:117:34: error: 'REG_RX_IQC_AB_A' undeclared (first use in this function)
     117 |         rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A,
         |                                  ^~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk_tx_fill':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:127:34: error: 'REG_CCASEL' undeclared (first use in this function)
     127 |         rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1);
         |                                  ^~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:129:29: error: 'REG_LSSI_WRITE_A' undeclared (first use in this function)
     129 |         rtw_write32(rtwdev, REG_LSSI_WRITE_A, 0x00000080);
         |                             ^~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:130:29: error: 'REG_IQK_DPD_CFG' undeclared (first use in this function)
     130 |         rtw_write32(rtwdev, REG_IQK_DPD_CFG, 0x20040000);
         |                             ^~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:131:29: error: 'REG_CFG_PMPD' undeclared (first use in this function)
     131 |         rtw_write32(rtwdev, REG_CFG_PMPD, 0x20000000);
         |                             ^~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:132:34: error: 'REG_IQC_Y' undeclared (first use in this function)
     132 |         rtw_write32_mask(rtwdev, REG_IQC_Y, 0x000007ff, tx_y);
         |                                  ^~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:133:34: error: 'REG_IQC_X' undeclared (first use in this function)
     133 |         rtw_write32_mask(rtwdev, REG_IQC_X, 0x000007ff, tx_x);
         |                                  ^~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk_tx_vdf_true':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:149:45: error: 'REG_OFDM0_XA_TX_IQ_IMBALANCE' undeclared (first use in this function)
     149 |                         rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE,
         |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:152:45: error: 'REG_OFDM0_A_TX_AFE' undeclared (first use in this function)
     152 |                         rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c38);
         |                                             ^~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:153:50: error: 'REG_INTPO_SETA' undeclared (first use in this function)
     153 |                         rtw_write32_mask(rtwdev, REG_INTPO_SETA, BIT(31), 0x0);
         |                                                  ^~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:188:37: error: 'REG_RFECTL_A' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     188 |                 rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000);
         |                                     ^~~~~~~~~~~~
         |                                     REG_RFE_CTRL_E
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:192:45: error: 'REG_IQK_COM64' undeclared (first use in this function)
     192 |                         rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000);
         |                                             ^~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:201:61: error: 'REG_IQKA_END' undeclared (first use in this function)
     201 |                                                             REG_IQKA_END,
         |                                                             ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:245:58: error: 'REG_IQC_Y' undeclared (first use in this function)
     245 |                                 rtw_write32_mask(rtwdev, REG_IQC_Y,
         |                                                          ^~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:247:58: error: 'REG_IQC_X' undeclared (first use in this function)
     247 |                                 rtw_write32_mask(rtwdev, REG_IQC_X,
         |                                                          ^~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk_tx_vdf_false':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:269:29: error: 'REG_OFDM0_XA_TX_IQ_IMBALANCE' undeclared (first use in this function)
     269 |         rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x18008c10);
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:271:29: error: 'REG_OFDM0_A_TX_AFE' undeclared (first use in this function)
     271 |         rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c10);
         |                             ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:272:29: error: 'REG_RFECTL_A' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     272 |         rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000);
         |                             ^~~~~~~~~~~~
         |                             REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:276:37: error: 'REG_IQK_COM64' undeclared (first use in this function)
     276 |                 rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:283:61: error: 'REG_IQKA_END' undeclared (first use in this function)
     283 |                         iqk_ready = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(10));
         |                                                             ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:320:50: error: 'REG_IQC_Y' undeclared (first use in this function)
     320 |                         rtw_write32_mask(rtwdev, REG_IQC_Y, 0x000007ff, 0x0);
         |                                                  ^~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:321:50: error: 'REG_IQC_X' undeclared (first use in this function)
     321 |                         rtw_write32_mask(rtwdev, REG_IQC_X, 0x000007ff, 0x200);
         |                                                  ^~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk_rx':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:334:29: error: 'REG_RFECTL_A' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     334 |         rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000);
         |                             ^~~~~~~~~~~~
         |                             REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:338:37: error: 'REG_IQK_COM64' undeclared (first use in this function)
     338 |                 rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:346:61: error: 'REG_IQKA_END' undeclared (first use in this function)
     346 |                         iqk_ready = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(10));
         |                                                             ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:377:50: error: 'REG_RX_IQC_AB_A' undeclared (first use in this function)
     377 |                         rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A,
         |                                                  ^~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_iqk':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:415:42: error: 'REG_CCASEL' undeclared (first use in this function)
     415 |                 rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0);
         |                                          ^~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:419:37: error: 'REG_AFE_PWR1_A' undeclared (first use in this function); did you mean 'REG_AFE_CTRL_4'?
     419 |                 rtw_write32(rtwdev, REG_AFE_PWR1_A, 0x77777777);
         |                                     ^~~~~~~~~~~~~~
         |                                     REG_AFE_CTRL_4
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:420:37: error: 'REG_AFE_PWR2_A' undeclared (first use in this function); did you mean 'REG_AFE_CTRL_4'?
     420 |                 rtw_write32(rtwdev, REG_AFE_PWR2_A, 0x77777777);
         |                                     ^~~~~~~~~~~~~~
         |                                     REG_AFE_CTRL_4
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:422:37: error: 'REG_RX_WAIT_CCA_TX_CCK_RFON_A' undeclared (first use in this function)
     422 |                 rtw_write32(rtwdev, REG_RX_WAIT_CCA_TX_CCK_RFON_A, 0x19791979);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/rtw8821a.c:425:42: error: 'REG_3WIRE_SWA' undeclared (first use in this function)
     425 |                 rtw_write32_mask(rtwdev, REG_3WIRE_SWA, 0xf, 0x4);
         |                                          ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:430:42: error: 'REG_CK_MONHA' undeclared (first use in this function)
     430 |                 rtw_write32_mask(rtwdev, REG_CK_MONHA, GENMASK(26, 24), 0x7);
         |                                          ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:435:49: error: 'RF_MODE_TABLE_ADDR' undeclared (first use in this function)
     435 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_ADDR, RFREG_MASK,
         |                                                 ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:437:49: error: 'RF_MODE_TABLE_DATA0' undeclared (first use in this function)
     437 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA0, RFREG_MASK,
         |                                                 ^~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:439:49: error: 'RF_MODE_TABLE_DATA1' undeclared (first use in this function)
     439 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA1, RFREG_MASK,
         |                                                 ^~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:442:49: error: 'RF_TXA_PREPAD' undeclared (first use in this function)
     442 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_TXA_PREPAD, RFREG_MASK,
         |                                                 ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:444:49: error: 'RF_RXBB2' undeclared (first use in this function)
     444 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_RXBB2, RFREG_MASK, 0x8a001);
         |                                                 ^~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:445:37: error: 'REG_DAC_RSTB' undeclared (first use in this function)
     445 |                 rtw_write32(rtwdev, REG_DAC_RSTB, 0x00008000);
         |                                     ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:446:42: error: 'REG_TXAGCIDX' undeclared (first use in this function)
     446 |                 rtw_write32_mask(rtwdev, REG_TXAGCIDX, BIT(0), 0x1);
         |                                          ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:448:37: error: 'REG_IQK_COM00' undeclared (first use in this function)
     448 |                 rtw_write32(rtwdev, REG_IQK_COM00, 0x29002000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:450:37: error: 'REG_IQK_COM32' undeclared (first use in this function)
     450 |                 rtw_write32(rtwdev, REG_IQK_COM32, 0xa9002000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:452:37: error: 'REG_IQK_COM96' undeclared (first use in this function)
     452 |                 rtw_write32(rtwdev, REG_IQK_COM96, 0x00462910);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:458:45: error: 'REG_OFDM0_XB_TX_IQ_IMBALANCE' undeclared (first use in this function)
     458 |                         rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE,
         |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:465:45: error: 'REG_TSSI_TRK_SW' undeclared (first use in this function)
     465 |                         rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x68163e96);
         |                                             ^~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:470:37: error: 'REG_OFDM0_XA_TX_IQ_IMBALANCE' undeclared (first use in this function)
     470 |                 rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x18008c10);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:472:37: error: 'REG_OFDM0_A_TX_AFE' undeclared (first use in this function)
     472 |                 rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c10);
         |                                     ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:473:37: error: 'REG_RFECTL_A' undeclared (first use in this function); did you mean 'REG_RFE_CTRL_E'?
     473 |                 rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000);
         |                                     ^~~~~~~~~~~~
         |                                     REG_RFE_CTRL_E
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:474:37: error: 'REG_IQK_COM64' undeclared (first use in this function)
     474 |                 rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000);
         |                                     ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:482:49: error: 'RF_TXMOD' undeclared (first use in this function)
     482 |                 rtw_write_rf(rtwdev, RF_PATH_A, RF_TXMOD, 0x7fe00,
         |                                                 ^~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: In function 'rtw8821a_coex_cfg_ant_switch':
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:751:40: error: 'REG_GNT_BT' undeclared (first use in this function)
     751 |                 rtw_write8_set(rtwdev, REG_GNT_BT, BIT_PTA_SW_CTL);
         |                                        ^~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:751:52: error: 'BIT_PTA_SW_CTL' undeclared (first use in this function)
     751 |                 rtw_write8_set(rtwdev, REG_GNT_BT, BIT_PTA_SW_CTL);
         |                                                    ^~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:754:40: error: 'PTA_CTRL_PIN' undeclared (first use in this function)
     754 |                            share_ant ? PTA_CTRL_PIN : DPDT_CTRL_PIN);
         |                                        ^~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:754:55: error: 'DPDT_CTRL_PIN' undeclared (first use in this function)
     754 |                            share_ant ? PTA_CTRL_PIN : DPDT_CTRL_PIN);
         |                                                       ^~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c: At top level:
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:836:10: error: 'const struct rtw_chip_ops' has no member named 'power_on'
     836 |         .power_on               = rtw88xxa_power_on,
         |          ^~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:837:10: error: 'const struct rtw_chip_ops' has no member named 'power_off'
     837 |         .power_off              = rtw8821a_power_off,
         |          ^~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:837:35: error: initialization of 'int (*)(struct rtw_dev *)' from incompatible pointer type 'void (*)(struct rtw_dev *)' [-Werror=incompatible-pointer-types]
     837 |         .power_off              = rtw8821a_power_off,
         |                                   ^~~~~~~~~~~~~~~~~~
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:837:35: note: (near initialization for 'rtw8821a_ops.dump_fw_crash')
   In file included from include/uapi/linux/posix_types.h:5,
                    from include/uapi/linux/types.h:14,
                    from include/linux/types.h:6,
                    from include/linux/kcsan-checks.h:14,
                    from include/asm-generic/barrier.h:17,
                    from arch/alpha/include/asm/barrier.h:21,
                    from arch/alpha/include/asm/rwonce.h:10,
                    from include/linux/compiler.h:317,
                    from include/linux/export.h:5,
                    from include/linux/linkage.h:7,
                    from arch/alpha/include/asm/bug.h:5,
                    from include/linux/bug.h:5,
                    from include/net/mac80211.h:16,
                    from drivers/net/wireless/realtek/rtw88/main.h:8,
                    from drivers/net/wireless/realtek/rtw88/rtw8821a.c:5:
   include/linux/stddef.h:8:14: warning: initialized field overwritten [-Woverride-init]
       8 | #define NULL ((void *)0)
         |              ^
   drivers/net/wireless/realtek/rtw88/rtw8821a.c:842:35: note: in expansion of macro 'NULL'
..


vim +137 drivers/net/wireless/realtek/rtw88/rtw88xxa.c

0810de4fd8fcd8 Bitterblue Smith 2024-10-30  123  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  124  static void rtw88xxa_read_usb_type(struct rtw_dev *rtwdev)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  125  {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  126  	struct rtw_efuse *efuse = &rtwdev->efuse;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  127  	struct rtw_hal *hal = &rtwdev->hal;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  128  	u8 antenna = 0;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  129  	u8 wmode = 0;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  130  	u8 val8, i;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  131  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  132  	efuse->hw_cap.bw = BIT(RTW_CHANNEL_WIDTH_20) |
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  133  			   BIT(RTW_CHANNEL_WIDTH_40) |
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  134  			   BIT(RTW_CHANNEL_WIDTH_80);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  135  	efuse->hw_cap.ptcl = EFUSE_HW_CAP_PTCL_VHT;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  136  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30 @137  	if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  138  		efuse->hw_cap.nss = 1;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  139  	else
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  140  		efuse->hw_cap.nss = 2;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  141  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  142  	if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  143  		goto print_hw_cap;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  144  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  145  	for (i = 0; i < 2; i++) {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  146  		rtw_read8_physical_efuse(rtwdev, 1019 - i, &val8);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  147  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  148  		antenna = u8_get_bits(val8, GENMASK(7, 5));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  149  		if (antenna)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  150  			break;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  151  		antenna = u8_get_bits(val8, GENMASK(3, 1));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  152  		if (antenna)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  153  			break;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  154  	}
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  155  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  156  	for (i = 0; i < 2; i++) {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  157  		rtw_read8_physical_efuse(rtwdev, 1021 - i, &val8);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  158  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  159  		wmode = u8_get_bits(val8, GENMASK(3, 2));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  160  		if (wmode)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  161  			break;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  162  	}
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  163  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  164  	if (antenna == 1) {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  165  		rtw_info(rtwdev, "This RTL8812AU says it is 1T1R.\n");
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  166  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  167  		efuse->hw_cap.nss = 1;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  168  		hal->rf_type = RF_1T1R;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  169  		hal->rf_path_num = 1;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  170  		hal->rf_phy_num = 1;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  171  		hal->antenna_tx = BB_PATH_A;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  172  		hal->antenna_rx = BB_PATH_A;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  173  	} else {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  174  		/* Override rtw_chip_parameter_setup(). It detects 8812au as 1T1R. */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  175  		efuse->hw_cap.nss = 2;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  176  		hal->rf_type = RF_2T2R;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  177  		hal->rf_path_num = 2;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  178  		hal->rf_phy_num = 2;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  179  		hal->antenna_tx = BB_PATH_AB;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  180  		hal->antenna_rx = BB_PATH_AB;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  181  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  182  		if (antenna == 2 && wmode == 2) {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  183  			rtw_info(rtwdev, "This RTL8812AU says it can't do VHT.\n");
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  184  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  185  			/* Can't be EFUSE_HW_CAP_IGNORE and can't be
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  186  			 * EFUSE_HW_CAP_PTCL_VHT, so make it 1.
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  187  			 */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  188  			efuse->hw_cap.ptcl = 1;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  189  			efuse->hw_cap.bw &= ~BIT(RTW_CHANNEL_WIDTH_80);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  190  		}
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  191  	}
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  192  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  193  print_hw_cap:
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  194  	rtw_dbg(rtwdev, RTW_DBG_EFUSE,
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  195  		"hw cap: hci=0x%02x, bw=0x%02x, ptcl=0x%02x, ant_num=%d, nss=%d\n",
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  196  		efuse->hw_cap.hci, efuse->hw_cap.bw, efuse->hw_cap.ptcl,
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  197  		efuse->hw_cap.ant_num, efuse->hw_cap.nss);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  198  }
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  199  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  200  int rtw88xxa_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  201  {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  202  	const struct rtw_chip_info *chip = rtwdev->chip;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  203  	struct rtw_efuse *efuse = &rtwdev->efuse;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  204  	struct rtw88xxa_efuse *map;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  205  	int i;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  206  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30 @207  	if (chip->id == RTW_CHIP_TYPE_8812A)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  208  		rtwdev->hal.cut_version += 1;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  209  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  210  	if (rtw_dbg_is_enabled(rtwdev, RTW_DBG_EFUSE))
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  211  		print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1,
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  212  			       log_map, chip->log_efuse_size, true);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  213  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  214  	map = (struct rtw88xxa_efuse *)log_map;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  215  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  216  	efuse->rf_board_option = map->rf_board_option;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  217  	efuse->crystal_cap = map->xtal_k;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  218  	if (efuse->crystal_cap == 0xff)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  219  		efuse->crystal_cap = 0x20;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  220  	efuse->pa_type_2g = map->pa_type;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  221  	efuse->pa_type_5g = map->pa_type;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  222  	efuse->lna_type_2g = map->lna_type_2g;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  223  	efuse->lna_type_5g = map->lna_type_5g;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  224  	if (chip->id == RTW_CHIP_TYPE_8812A) {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  225  		rtw8812a_read_amplifier_type(rtwdev);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  226  		rtw8812a_read_rfe_type(rtwdev, map);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  227  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  228  		efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(1));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  229  	}
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  230  	efuse->channel_plan = map->channel_plan;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  231  	efuse->country_code[0] = map->country_code[0];
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  232  	efuse->country_code[1] = map->country_code[1];
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  233  	efuse->bt_setting = map->rf_bt_setting;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  234  	efuse->regd = map->rf_board_option & 0x7;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  235  	efuse->thermal_meter[0] = map->thermal_meter;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  236  	efuse->thermal_meter[1] = map->thermal_meter;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  237  	efuse->thermal_meter_k = map->thermal_meter;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  238  	efuse->tx_bb_swing_setting_2g = map->tx_bb_swing_setting_2g;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  239  	efuse->tx_bb_swing_setting_5g = map->tx_bb_swing_setting_5g;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  240  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  241  	rtw88xxa_read_usb_type(rtwdev);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  242  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  243  	if (chip->id == RTW_CHIP_TYPE_8821A)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  244  		efuse->btcoex = rtw_read32_mask(rtwdev, REG_WL_BT_PWR_CTRL,
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  245  						BIT_BT_FUNC_EN);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  246  	else
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  247  		efuse->btcoex = (map->rf_board_option & 0xe0) == 0x20;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  248  	efuse->share_ant = !!(efuse->bt_setting & BIT(0));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  249  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  250  	/* No antenna diversity because it's disabled in the vendor driver */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  251  	efuse->ant_div_cfg = 0;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  252  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  253  	efuse->ant_div_type = map->rf_antenna_option;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  254  	if (efuse->ant_div_type == 0xff)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  255  		efuse->ant_div_type = 0x3;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  256  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  257  	for (i = 0; i < 4; i++)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  258  		efuse->txpwr_idx_table[i] = map->txpwr_idx_table[i];
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  259  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  260  	switch (rtw_hci_type(rtwdev)) {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  261  	case RTW_HCI_TYPE_USB:
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  262  		if (chip->id == RTW_CHIP_TYPE_8821A)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  263  			ether_addr_copy(efuse->addr, map->rtw8821au.mac_addr);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  264  		else
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  265  			ether_addr_copy(efuse->addr, map->rtw8812au.mac_addr);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  266  		break;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  267  	case RTW_HCI_TYPE_PCIE:
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  268  	case RTW_HCI_TYPE_SDIO:
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  269  	default:
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  270  		/* unsupported now */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  271  		return -EOPNOTSUPP;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  272  	}
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  273  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  274  	return 0;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  275  }
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  276  EXPORT_SYMBOL(rtw88xxa_read_efuse);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  277  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  278  static void rtw88xxa_reset_8051(struct rtw_dev *rtwdev)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  279  {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  280  	const struct rtw_chip_info *chip = rtwdev->chip;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  281  	u8 val8;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  282  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  283  	/* Reset MCU IO Wrapper */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  284  	rtw_write8_clr(rtwdev, REG_RSV_CTRL, BIT(1));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  285  	if (chip->id == RTW_CHIP_TYPE_8812A)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  286  		rtw_write8_clr(rtwdev, REG_RSV_CTRL + 1, BIT(3));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  287  	else
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  288  		rtw_write8_clr(rtwdev, REG_RSV_CTRL + 1, BIT(0));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  289  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  290  	val8 = rtw_read8(rtwdev, REG_SYS_FUNC_EN + 1);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  291  	rtw_write8(rtwdev, REG_SYS_FUNC_EN + 1, val8 & ~BIT(2));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  292  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  293  	/* Enable MCU IO Wrapper */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  294  	rtw_write8_clr(rtwdev, REG_RSV_CTRL, BIT(1));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  295  	if (chip->id == RTW_CHIP_TYPE_8812A)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  296  		rtw_write8_set(rtwdev, REG_RSV_CTRL + 1, BIT(3));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  297  	else
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  298  		rtw_write8_set(rtwdev, REG_RSV_CTRL + 1, BIT(0));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  299  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  300  	rtw_write8(rtwdev, REG_SYS_FUNC_EN + 1, val8 | BIT(2));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  301  }
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  302  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  303  /* A lightweight deinit function */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  304  static void rtw88xxau_hw_reset(struct rtw_dev *rtwdev)
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  305  {
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  306  	u8 val8;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  307  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  308  	if (!(rtw_read8(rtwdev, REG_MCUFW_CTRL) & BIT_RAM_DL_SEL))
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  309  		return;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  310  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  311  	rtw88xxa_reset_8051(rtwdev);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  312  	rtw_write8(rtwdev, REG_MCUFW_CTRL, 0x00);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  313  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  314  	/* before BB reset should do clock gated */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30 @315  	rtw_write32_set(rtwdev, REG_FPGA0_XCD_RF_PARA, BIT(6));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  316  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  317  	/* reset BB */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  318  	rtw_write8_clr(rtwdev, REG_SYS_FUNC_EN, BIT(0) | BIT(1));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  319  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  320  	/* reset RF */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  321  	rtw_write8(rtwdev, REG_RF_CTRL, 0);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  322  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  323  	/* reset TRX path */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  324  	rtw_write16(rtwdev, REG_CR, 0);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  325  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  326  	/* reset MAC, reg0x5[1], auto FSM off */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30 @327  	rtw_write8_set(rtwdev, REG_APS_FSMCO + 1, APS_FSMCO_MAC_OFF >> 8);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  328  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  329  	/* check if reg0x5[1] auto cleared */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  330  	if (read_poll_timeout_atomic(rtw_read8, val8,
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  331  				     !(val8 & (APS_FSMCO_MAC_OFF >> 8)),
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  332  				     1, 5000, false,
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  333  				     rtwdev, REG_APS_FSMCO + 1))
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  334  		rtw_err(rtwdev, "%s: timed out waiting for 0x5[1]\n", __func__);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  335  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  336  	/* reg0x5[0], auto FSM on */
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  337  	val8 |= APS_FSMCO_MAC_ENABLE >> 8;
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  338  	rtw_write8(rtwdev, REG_APS_FSMCO + 1, val8);
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  339  
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  340  	rtw_write8_clr(rtwdev, REG_SYS_FUNC_EN + 1, BIT(4) | BIT(7));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  341  	rtw_write8_set(rtwdev, REG_SYS_FUNC_EN + 1, BIT(4) | BIT(7));
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  342  }
0810de4fd8fcd8 Bitterblue Smith 2024-10-30  343
Bitterblue Smith Nov. 1, 2024, 12:14 p.m. UTC | #3
On 01/11/2024 02:35, kernel test robot wrote:
> Hi Bitterblue,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on wireless-next/main]
> [also build test ERROR on wireless/main linus/master v6.12-rc5 next-20241031]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Bitterblue-Smith/wifi-rtw88-Add-rtw8812a_table-c-h/20241031-023323
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
> patch link:    https://lore.kernel.org/r/0b8e8093-8103-4999-86bf-0055ec52ea64%40gmail.com
> patch subject: [PATCH v4 7/7] wifi: rtw88: Enable the new RTL8821AU/RTL8812AU drivers
> config: um-allyesconfig (https://download.01.org/0day-ci/archive/20241101/202411010825.Kzdw5VeV-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241101/202411010825.Kzdw5VeV-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202411010825.Kzdw5VeV-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>          |                             REG_RFE_CTRL_E
>    drivers/net/wireless/realtek/rtw88/rtw8821a.c:338:37: error: 'REG_IQK_COM64' undeclared (first use in this function)
>      338 |                 rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000);
>          |                                     ^~~~~~~~~~~~~

Ah, sorry, I didn't use --base. This series is supposed to be
applied on top of rtw-next, not wireless-next.
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw88/Kconfig b/drivers/net/wireless/realtek/rtw88/Kconfig
index 02b0d698413b..733b3e58da51 100644
--- a/drivers/net/wireless/realtek/rtw88/Kconfig
+++ b/drivers/net/wireless/realtek/rtw88/Kconfig
@@ -43,6 +43,17 @@  config RTW88_8723D
 config RTW88_8821C
 	tristate
 
+config RTW88_88XXA
+	tristate
+
+config RTW88_8821A
+	tristate
+	select RTW88_88XXA
+
+config RTW88_8812A
+	tristate
+	select RTW88_88XXA
+
 config RTW88_8822BE
 	tristate "Realtek 8822BE PCI wireless network adapter"
 	depends on PCI
@@ -189,6 +200,28 @@  config RTW88_8821CU
 
 	  802.11ac USB wireless network adapter
 
+config RTW88_8821AU
+	tristate "Realtek 8821AU/8811AU USB wireless network adapter"
+	depends on USB
+	select RTW88_CORE
+	select RTW88_USB
+	select RTW88_8821A
+	help
+	  Select this option will enable support for 8821AU and 8811AU chipset
+
+	  802.11ac USB wireless network adapter
+
+config RTW88_8812AU
+	tristate "Realtek 8812AU USB wireless network adapter"
+	depends on USB
+	select RTW88_CORE
+	select RTW88_USB
+	select RTW88_8812A
+	help
+	  Select this option will enable support for 8812AU chipset
+
+	  802.11ac USB wireless network adapter
+
 config RTW88_DEBUG
 	bool "Realtek rtw88 debug support"
 	depends on RTW88_CORE
diff --git a/drivers/net/wireless/realtek/rtw88/Makefile b/drivers/net/wireless/realtek/rtw88/Makefile
index 8f47359b4380..f0b49f5a8a5a 100644
--- a/drivers/net/wireless/realtek/rtw88/Makefile
+++ b/drivers/net/wireless/realtek/rtw88/Makefile
@@ -77,6 +77,21 @@  rtw88_8821cs-objs		:= rtw8821cs.o
 obj-$(CONFIG_RTW88_8821CU)	+= rtw88_8821cu.o
 rtw88_8821cu-objs		:= rtw8821cu.o
 
+obj-$(CONFIG_RTW88_88XXA)	+= rtw88_88xxa.o
+rtw88_88xxa-objs		:= rtw88xxa.o
+
+obj-$(CONFIG_RTW88_8821A)	+= rtw88_8821a.o
+rtw88_8821a-objs		:= rtw8821a.o rtw8821a_table.o
+
+obj-$(CONFIG_RTW88_8812A)	+= rtw88_8812a.o
+rtw88_8812a-objs		:= rtw8812a.o rtw8812a_table.o
+
+obj-$(CONFIG_RTW88_8821AU)	+= rtw88_8821au.o
+rtw88_8821au-objs		:= rtw8821au.o
+
+obj-$(CONFIG_RTW88_8812AU)	+= rtw88_8812au.o
+rtw88_8812au-objs		:= rtw8812au.o
+
 obj-$(CONFIG_RTW88_PCI)		+= rtw88_pci.o
 rtw88_pci-objs			:= pci.o