wifi: rtw89: phy: rename to RTW89_PHY_NUM as proper naming
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 17 Jan 2025 07:28:21 +0000 (15:28 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Mon, 3 Feb 2025 01:41:19 +0000 (09:41 +0800)
The meaning is number of PHY, not maximum ID of PHY. Change to proper
naming.

No change logic at all.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20250117072828.16728-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/coex.c
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/fw.h
drivers/net/wireless/realtek/rtw89/mac.c
drivers/net/wireless/realtek/rtw89/mac_be.c

index 7e43ba0c4098b34c8eedaa6ab798e6cb78d36214..755c157c815d4d9e84a6d3f722ea623e87573991 100644 (file)
@@ -1602,7 +1602,7 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
                        wl->ver_info.fw = le32_to_cpu(prpt->v4.wl_fw_info.fw_ver);
                        dm->wl_fw_cx_offload = !!le32_to_cpu(prpt->v4.wl_fw_info.cx_offload);
 
-                       for (i = RTW89_PHY_0; i < RTW89_PHY_MAX; i++)
+                       for (i = RTW89_PHY_0; i < RTW89_PHY_NUM; i++)
                                memcpy(&dm->gnt.band[i], &prpt->v4.gnt_val[i],
                                       sizeof(dm->gnt.band[i]));
 
@@ -1634,7 +1634,7 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
                        wl->ver_info.fw = le32_to_cpu(prpt->v5.rpt_info.fw_ver);
                        dm->wl_fw_cx_offload = 0;
 
-                       for (i = RTW89_PHY_0; i < RTW89_PHY_MAX; i++)
+                       for (i = RTW89_PHY_0; i < RTW89_PHY_NUM; i++)
                                memcpy(&dm->gnt.band[i], &prpt->v5.gnt_val[i][0],
                                       sizeof(dm->gnt.band[i]));
 
@@ -1661,7 +1661,7 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
                        wl->ver_info.fw = le32_to_cpu(prpt->v105.rpt_info.fw_ver);
                        dm->wl_fw_cx_offload = 0;
 
-                       for (i = RTW89_PHY_0; i < RTW89_PHY_MAX; i++)
+                       for (i = RTW89_PHY_0; i < RTW89_PHY_NUM; i++)
                                memcpy(&dm->gnt.band[i], &prpt->v105.gnt_val[i][0],
                                       sizeof(dm->gnt.band[i]));
 
@@ -1687,7 +1687,7 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
                        wl->ver_info.fw_coex = le32_to_cpu(prpt->v7.rpt_info.cx_ver);
                        wl->ver_info.fw = le32_to_cpu(prpt->v7.rpt_info.fw_ver);
 
-                       for (i = RTW89_PHY_0; i < RTW89_PHY_MAX; i++)
+                       for (i = RTW89_PHY_0; i < RTW89_PHY_NUM; i++)
                                memcpy(&dm->gnt.band[i], &prpt->v7.gnt_val[i][0],
                                       sizeof(dm->gnt.band[i]));
 
@@ -1719,7 +1719,7 @@ static u32 _chk_btc_report(struct rtw89_dev *rtwdev,
                        wl->ver_info.fw_coex = le32_to_cpu(prpt->v8.rpt_info.cx_ver);
                        wl->ver_info.fw = le32_to_cpu(prpt->v8.rpt_info.fw_ver);
 
-                       for (i = RTW89_PHY_0; i < RTW89_PHY_MAX; i++)
+                       for (i = RTW89_PHY_0; i < RTW89_PHY_NUM; i++)
                                memcpy(&dm->gnt.band[i], &prpt->v8.gnt_val[i][0],
                                       sizeof(dm->gnt.band[i]));
 
@@ -2706,7 +2706,7 @@ static void _set_gnt(struct rtw89_dev *rtwdev, u8 phy_map, u8 wl_state, u8 bt_st
        if (phy_map > BTC_PHY_ALL)
                return;
 
-       for (i = 0; i < RTW89_PHY_MAX; i++) {
+       for (i = 0; i < RTW89_PHY_NUM; i++) {
                if (!(phy_map & BIT(i)))
                        continue;
 
@@ -2755,7 +2755,7 @@ static void _set_gnt_v1(struct rtw89_dev *rtwdev, u8 phy_map,
        if (phy_map > BTC_PHY_ALL)
                return;
 
-       for (i = 0; i < RTW89_PHY_MAX; i++) {
+       for (i = 0; i < RTW89_PHY_NUM; i++) {
                if (!(phy_map & BIT(i)))
                        continue;
 
@@ -2955,7 +2955,7 @@ static void _set_rf_trx_para(struct rtw89_dev *rtwdev)
 
        if (ver->fwlrole == 0) {
                link_mode = wl->role_info.link_mode;
-               for (i = 0; i < RTW89_PHY_MAX; i++) {
+               for (i = 0; i < RTW89_PHY_NUM; i++) {
                        if (wl->dbcc_info.real_band[i] == RTW89_BAND_2G)
                                dbcc_2g_phy = i;
                }
@@ -4240,7 +4240,7 @@ static void _set_ant_v0(struct rtw89_dev *rtwdev, bool force_exec,
        case BTC_ANT_W2G:
                rtw89_chip_cfg_ctrl_path(rtwdev, BTC_CTRL_BY_WL);
                if (rtwdev->dbcc_en) {
-                       for (i = 0; i < RTW89_PHY_MAX; i++) {
+                       for (i = 0; i < RTW89_PHY_NUM; i++) {
                                b2g = (wl_dinfo->real_band[i] == RTW89_BAND_2G);
 
                                gnt_wl_ctrl = b2g ? BTC_GNT_HW : BTC_GNT_SW_HI;
@@ -4896,9 +4896,9 @@ static void _set_btg_ctrl(struct rtw89_dev *rtwdev)
 
        if (rtwdev->dbcc_en) {
                if (ver->fwlrole == 0) {
-                       wl_rinfo.dbcc_2g_phy = RTW89_PHY_MAX;
+                       wl_rinfo.dbcc_2g_phy = RTW89_PHY_NUM;
 
-                       for (i = 0; i < RTW89_PHY_MAX; i++) {
+                       for (i = 0; i < RTW89_PHY_NUM; i++) {
                                if (wl_dinfo->real_band[i] == RTW89_BAND_2G)
                                        wl_rinfo.dbcc_2g_phy = i;
                        }
@@ -5790,7 +5790,7 @@ static void _update_wl_info(struct rtw89_dev *rtwdev)
                phy = wl_linfo[i].phy;
 
                /* check dbcc role */
-               if (rtwdev->dbcc_en && phy < RTW89_PHY_MAX) {
+               if (rtwdev->dbcc_en && phy < RTW89_PHY_NUM) {
                        wl_dinfo->role[phy] = wl_linfo[i].role;
                        wl_dinfo->op_band[phy] = wl_linfo[i].band;
                        _update_dbcc_band(rtwdev, phy);
@@ -5940,7 +5940,7 @@ static void _update_wl_info_v1(struct rtw89_dev *rtwdev)
 
                phy = wl_linfo[i].phy;
 
-               if (rtwdev->dbcc_en && phy < RTW89_PHY_MAX) {
+               if (rtwdev->dbcc_en && phy < RTW89_PHY_NUM) {
                        wl_dinfo->role[phy] = wl_linfo[i].role;
                        wl_dinfo->op_band[phy] = wl_linfo[i].band;
                        _update_dbcc_band(rtwdev, phy);
@@ -6090,7 +6090,7 @@ static void _update_wl_info_v2(struct rtw89_dev *rtwdev)
 
                phy = wl_linfo[i].phy;
 
-               if (rtwdev->dbcc_en && phy < RTW89_PHY_MAX) {
+               if (rtwdev->dbcc_en && phy < RTW89_PHY_NUM) {
                        wl_dinfo->role[phy] = wl_linfo[i].role;
                        wl_dinfo->op_band[phy] = wl_linfo[i].band;
                        _update_dbcc_band(rtwdev, phy);
@@ -6381,7 +6381,7 @@ static void _update_wl_info_v7(struct rtw89_dev *rtwdev, u8 rid)
        struct rtw89_btc_wl_dbcc_info *wl_dinfo = &wl->dbcc_info;
        struct rtw89_btc_wl_link_info *wl_linfo = wl->link_info;
        struct rtw89_btc_wl_active_role_v7 *act_role = NULL;
-       u8 i, mode, cnt = 0, cnt_2g = 0, cnt_5g = 0, phy_now = RTW89_PHY_MAX, phy_dbcc;
+       u8 i, mode, cnt = 0, cnt_2g = 0, cnt_5g = 0, phy_now = RTW89_PHY_NUM, phy_dbcc;
        bool b2g = false, b5g = false, client_joined = false, client_inc_2g = false;
        u8 client_cnt_last[RTW89_BE_BTC_WL_MAX_ROLE_NUMBER] = {};
        u8 cid_role[RTW89_BE_BTC_WL_MAX_ROLE_NUMBER] = {};
@@ -6392,7 +6392,7 @@ static void _update_wl_info_v7(struct rtw89_dev *rtwdev, u8 rid)
        memset(wl_rinfo, 0, sizeof(*wl_rinfo));
 
        for (i = 0; i < RTW89_PORT_NUM; i++) {
-               if (!wl_linfo[i].active || wl_linfo[i].phy >= RTW89_PHY_MAX)
+               if (!wl_linfo[i].active || wl_linfo[i].phy >= RTW89_PHY_NUM)
                        continue;
 
                act_role = &wl_rinfo->active_role[i];
@@ -6486,7 +6486,7 @@ static void _update_wl_info_v7(struct rtw89_dev *rtwdev, u8 rid)
                mode = _chk_dbcc(rtwdev, cid_ch, cid_phy, cid_role, &dbcc_2g_phy);
 
                /* correct 2G-located PHY band for gnt ctrl */
-               if (dbcc_2g_phy < RTW89_PHY_MAX)
+               if (dbcc_2g_phy < RTW89_PHY_NUM)
                        wl_dinfo->op_band[dbcc_2g_phy] = RTW89_BAND_2G;
        } else if (b2g && b5g && cnt == 2) {
                mode = BTC_WLINK_25G_MCC;
@@ -7179,7 +7179,7 @@ void rtw89_btc_ntfy_scan_start(struct rtw89_dev *rtwdev, u8 phy_idx, u8 band)
                    "[BTC], %s(): phy_idx=%d, band=%d\n",
                    __func__, phy_idx, band);
 
-       if (phy_idx >= RTW89_PHY_MAX)
+       if (phy_idx >= RTW89_PHY_NUM)
                return;
 
        btc->dm.cnt_notify[BTC_NCNT_SCAN_START]++;
@@ -7229,7 +7229,7 @@ void rtw89_btc_ntfy_switch_band(struct rtw89_dev *rtwdev, u8 phy_idx, u8 band)
                    "[BTC], %s(): phy_idx=%d, band=%d\n",
                    __func__, phy_idx, band);
 
-       if (phy_idx >= RTW89_PHY_MAX)
+       if (phy_idx >= RTW89_PHY_NUM)
                return;
 
        btc->dm.cnt_notify[BTC_NCNT_SWITCH_BAND]++;
index 85f739f1173d8d1607362800b58291404cbfd7fc..b7987c6b1cd5261c8e9b97126cecae07d4d8be03 100644 (file)
@@ -4432,9 +4432,9 @@ static void rtw89_core_ppdu_sts_init(struct rtw89_dev *rtwdev)
 {
        int i;
 
-       for (i = 0; i < RTW89_PHY_MAX; i++)
+       for (i = 0; i < RTW89_PHY_NUM; i++)
                skb_queue_head_init(&rtwdev->ppdu_sts.rx_queue[i]);
-       for (i = 0; i < RTW89_PHY_MAX; i++)
+       for (i = 0; i < RTW89_PHY_NUM; i++)
                rtwdev->ppdu_sts.curr_rx_ppdu_cnt[i] = U8_MAX;
 }
 
index 0f2a46e36b0423eb5523f582856b33f0f7dbbd79..4e5949516a7589239bb5902682fcd84324cc0153 100644 (file)
@@ -826,7 +826,7 @@ enum rtw89_mac_idx {
 enum rtw89_phy_idx {
        RTW89_PHY_0 = 0,
        RTW89_PHY_1 = 1,
-       RTW89_PHY_MAX
+       RTW89_PHY_NUM,
 };
 
 #define __RTW89_MLD_MAX_LINK_NUM 2
@@ -1540,16 +1540,16 @@ struct rtw89_btc_u8_sta_chg {
 };
 
 struct rtw89_btc_wl_scan_info {
-       u8 band[RTW89_PHY_MAX];
+       u8 band[RTW89_PHY_NUM];
        u8 phy_map;
        u8 rsvd;
 };
 
 struct rtw89_btc_wl_dbcc_info {
-       u8 op_band[RTW89_PHY_MAX]; /* op band in each phy */
-       u8 scan_band[RTW89_PHY_MAX]; /* scan band in  each phy */
-       u8 real_band[RTW89_PHY_MAX];
-       u8 role[RTW89_PHY_MAX]; /* role in each phy */
+       u8 op_band[RTW89_PHY_NUM]; /* op band in each phy */
+       u8 scan_band[RTW89_PHY_NUM]; /* scan band in  each phy */
+       u8 real_band[RTW89_PHY_NUM];
+       u8 role[RTW89_PHY_NUM]; /* role in each phy */
 };
 
 struct rtw89_btc_wl_active_role {
@@ -1899,7 +1899,7 @@ struct rtw89_btc_wl_info {
        u8 cn_report;
        u8 coex_mode;
        u8 pta_req_mac;
-       u8 bt_polut_type[RTW89_PHY_MAX]; /* BT polluted WL-Tx type for phy0/1  */
+       u8 bt_polut_type[RTW89_PHY_NUM]; /* BT polluted WL-Tx type for phy0/1  */
 
        bool is_5g_hi_channel;
        bool pta_reg_mac_chg;
@@ -2231,7 +2231,7 @@ struct rtw89_btc_fbtc_rpt_ctrl_v4 {
        struct rtw89_btc_fbtc_rpt_ctrl_wl_fw_info wl_fw_info;
        struct rtw89_btc_fbtc_rpt_ctrl_bt_mailbox bt_mbx_info;
        __le32 bt_cnt[BTC_BCNT_STA_MAX];
-       struct rtw89_mac_ax_gnt gnt_val[RTW89_PHY_MAX];
+       struct rtw89_mac_ax_gnt gnt_val[RTW89_PHY_NUM];
 } __packed;
 
 struct rtw89_btc_fbtc_rpt_ctrl_v5 {
@@ -2239,7 +2239,7 @@ struct rtw89_btc_fbtc_rpt_ctrl_v5 {
        u8 rsvd;
        __le16 rsvd1;
 
-       u8 gnt_val[RTW89_PHY_MAX][4];
+       u8 gnt_val[RTW89_PHY_NUM][4];
        __le16 bt_cnt[BTC_BCNT_STA_MAX];
 
        struct rtw89_btc_fbtc_rpt_ctrl_info_v5 rpt_info;
@@ -2251,7 +2251,7 @@ struct rtw89_btc_fbtc_rpt_ctrl_v105 {
        u8 rsvd;
        __le16 rsvd1;
 
-       u8 gnt_val[RTW89_PHY_MAX][4];
+       u8 gnt_val[RTW89_PHY_NUM][4];
        __le16 bt_cnt[BTC_BCNT_STA_MAX_V105];
 
        struct rtw89_btc_fbtc_rpt_ctrl_info_v5 rpt_info;
@@ -2264,7 +2264,7 @@ struct rtw89_btc_fbtc_rpt_ctrl_v7 {
        u8 rsvd1;
        u8 rsvd2;
 
-       u8 gnt_val[RTW89_PHY_MAX][4];
+       u8 gnt_val[RTW89_PHY_NUM][4];
        __le16 bt_cnt[BTC_BCNT_STA_MAX_V105];
 
        struct rtw89_btc_fbtc_rpt_ctrl_info_v8 rpt_info;
@@ -2277,7 +2277,7 @@ struct rtw89_btc_fbtc_rpt_ctrl_v8 {
        u8 rpt_len_max_l; /* BTC_RPT_MAX bit0~7 */
        u8 rpt_len_max_h; /* BTC_RPT_MAX bit8~15 */
 
-       u8 gnt_val[RTW89_PHY_MAX][4];
+       u8 gnt_val[RTW89_PHY_NUM][4];
        __le16 bt_cnt[BTC_BCNT_STA_MAX_V105];
 
        struct rtw89_btc_fbtc_rpt_ctrl_info_v8 rpt_info;
@@ -4763,7 +4763,7 @@ struct rtw89_hal {
        struct rtw89_chanctx chanctx[NUM_OF_RTW89_CHANCTX];
        struct cfg80211_chan_def roc_chandef;
 
-       bool entity_active[RTW89_PHY_MAX];
+       bool entity_active[RTW89_PHY_NUM];
        bool entity_pause;
        enum rtw89_entity_mode entity_mode;
        struct rtw89_entity_mgnt entity_mgnt;
@@ -4974,7 +4974,7 @@ struct rtw89_dpk_bkup_para {
 struct rtw89_dpk_info {
        bool is_dpk_enable;
        bool is_dpk_reload_en;
-       u8 dpk_gs[RTW89_PHY_MAX];
+       u8 dpk_gs[RTW89_PHY_NUM];
        u16 dc_i[RTW89_DPK_RF_PATH][RTW89_DPK_BKUP_NUM];
        u16 dc_q[RTW89_DPK_RF_PATH][RTW89_DPK_BKUP_NUM];
        u8 corr_val[RTW89_DPK_RF_PATH][RTW89_DPK_BKUP_NUM];
@@ -5300,8 +5300,8 @@ struct rtw89_lps_parm {
 };
 
 struct rtw89_ppdu_sts_info {
-       struct sk_buff_head rx_queue[RTW89_PHY_MAX];
-       u8 curr_rx_ppdu_cnt[RTW89_PHY_MAX];
+       struct sk_buff_head rx_queue[RTW89_PHY_NUM];
+       u8 curr_rx_ppdu_cnt[RTW89_PHY_NUM];
 };
 
 struct rtw89_early_h2c {
@@ -5420,8 +5420,8 @@ struct rtw89_phy_efuse_gain {
        bool offset_valid;
        bool comp_valid;
        s8 offset[RF_PATH_MAX][RTW89_GAIN_OFFSET_NR]; /* S(8, 0) */
-       s8 offset_base[RTW89_PHY_MAX]; /* S(8, 4) */
-       s8 rssi_base[RTW89_PHY_MAX]; /* S(8, 4) */
+       s8 offset_base[RTW89_PHY_NUM]; /* S(8, 4) */
+       s8 rssi_base[RTW89_PHY_NUM]; /* S(8, 4) */
        s8 comp[RF_PATH_MAX][RTW89_SUBBAND_NR]; /* S(8, 0) */
 };
 
index 2026bc2fd2acd43aa4f8ccf71a2d3bb58f57a846..3cc514de073abd90572cad9a1e3cdc2c49527af4 100644 (file)
@@ -1803,14 +1803,14 @@ struct rtw89_h2c_lps_ml_cmn_info {
        u8 fmt_id;
        u8 rsvd0[3];
        __le32 mlo_dbcc_mode;
-       u8 central_ch[RTW89_PHY_MAX];
-       u8 pri_ch[RTW89_PHY_MAX];
-       u8 bw[RTW89_PHY_MAX];
-       u8 band[RTW89_PHY_MAX];
-       u8 bcn_rate_type[RTW89_PHY_MAX];
+       u8 central_ch[RTW89_PHY_NUM];
+       u8 pri_ch[RTW89_PHY_NUM];
+       u8 bw[RTW89_PHY_NUM];
+       u8 band[RTW89_PHY_NUM];
+       u8 bcn_rate_type[RTW89_PHY_NUM];
        u8 rsvd1[2];
-       __le16 tia_gain[RTW89_PHY_MAX][TIA_GAIN_NUM];
-       u8 lna_gain[RTW89_PHY_MAX][LNA_GAIN_NUM];
+       __le16 tia_gain[RTW89_PHY_NUM][TIA_GAIN_NUM];
+       u8 lna_gain[RTW89_PHY_NUM][LNA_GAIN_NUM];
        u8 rsvd2[2];
 } __packed;
 
index a37c6d525d6f0a895a0ad5095648f18075de6cf5..f698807790ffc34b0bce655208e4f39bcae2ec2c 100644 (file)
@@ -6031,7 +6031,7 @@ int rtw89_mac_cfg_ctrl_path_v1(struct rtw89_dev *rtwdev, bool wl)
        if (wl)
                return 0;
 
-       for (i = 0; i < RTW89_PHY_MAX; i++) {
+       for (i = 0; i < RTW89_PHY_NUM; i++) {
                g[i].gnt_bt_sw_en = 1;
                g[i].gnt_bt = 1;
                g[i].gnt_wl_sw_en = 1;
index 2dbdeae904adedf294b318fe50ebb66c88d1af1e..16ee378c54187ed01c7b9e30f2a0b41b53930c1e 100644 (file)
@@ -1865,7 +1865,7 @@ int rtw89_mac_cfg_ctrl_path_v2(struct rtw89_dev *rtwdev, bool wl)
        if (wl)
                return 0;
 
-       for (i = 0; i < RTW89_PHY_MAX; i++) {
+       for (i = 0; i < RTW89_PHY_NUM; i++) {
                g[i].gnt_bt_sw_en = 1;
                g[i].gnt_bt = 1;
                g[i].gnt_wl_sw_en = 1;