Commit 20d9fc88 authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo
Browse files

rtw89: remove duplicate definition of hardware port number



RTW89_MAX_HW_PORT_NUM and RTW89_PORT_NUM refer to the same thing, so remove
the one of them.

Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211227083134.35248-1-pkshih@realtek.com
parent 861e58c8
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -594,7 +594,7 @@ static void _reset_btc_var(struct rtw89_dev *rtwdev, u8 type)
		memset(&btc->dm, 0, sizeof(btc->dm));
		memset(bt_linfo->rssi_state, 0, sizeof(bt_linfo->rssi_state));

		for (i = 0; i < RTW89_MAX_HW_PORT_NUM; i++)
		for (i = 0; i < RTW89_PORT_NUM; i++)
			memset(wl_linfo[i].rssi_state, 0,
			       sizeof(wl_linfo[i].rssi_state));

@@ -1698,7 +1698,7 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev)
		   wl_rinfo->link_mode == BTC_WLINK_2G_SCC) {
		en = true;
		/* get p2p channel */
		for (i = 0; i < RTW89_MAX_HW_PORT_NUM; i++) {
		for (i = 0; i < RTW89_PORT_NUM; i++) {
			if (wl_rinfo->active_role[i].role ==
			    RTW89_WIFI_ROLE_P2P_GO ||
			    wl_rinfo->active_role[i].role ==
@@ -1711,7 +1711,7 @@ static void _set_bt_afh_info(struct rtw89_dev *rtwdev)
	} else {
		en = true;
		/* get 2g channel  */
		for (i = 0; i < RTW89_MAX_HW_PORT_NUM; i++) {
		for (i = 0; i < RTW89_PORT_NUM; i++) {
			if (wl_rinfo->active_role[i].connected &&
			    wl_rinfo->active_role[i].band == RTW89_BAND_2G) {
				ch = wl_rinfo->active_role[i].ch;
@@ -3287,7 +3287,7 @@ static void _update_wl_info(struct rtw89_dev *rtwdev)

	memset(wl_rinfo, 0, sizeof(*wl_rinfo));

	for (i = 0; i < RTW89_MAX_HW_PORT_NUM; i++) {
	for (i = 0; i < RTW89_PORT_NUM; i++) {
		/* check if role active? */
		if (!wl_linfo[i].active)
			continue;
@@ -4677,7 +4677,7 @@ static void _show_wl_role_info(struct rtw89_dev *rtwdev, struct seq_file *m)
			   wl_dinfo->real_band[RTW89_PHY_1]);
	}

	for (i = 0; i < RTW89_MAX_HW_PORT_NUM; i++) {
	for (i = 0; i < RTW89_PORT_NUM; i++) {
		plink = &btc->cx.wl.link_info[i];

		if (!plink->active)
+3 −4
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ extern const struct ieee80211_ops rtw89_ops;
#define MAX_RSSI 110
#define RSSI_FACTOR 1
#define RTW89_RSSI_RAW_TO_DBM(rssi) ((s8)((rssi) >> RSSI_FACTOR) - MAX_RSSI)
#define RTW89_MAX_HW_PORT_NUM 5

#define RTW89_HTC_MASK_VARIANT GENMASK(1, 0)
#define RTW89_HTC_VARIANT_HE 3
@@ -1044,7 +1043,7 @@ struct rtw89_btc_wl_role_info { /* struct size must be n*4 bytes */
	u8 connect_cnt;
	u8 link_mode;
	union rtw89_btc_wl_role_info_map role_map;
	struct rtw89_btc_wl_active_role active_role[RTW89_MAX_HW_PORT_NUM];
	struct rtw89_btc_wl_active_role active_role[RTW89_PORT_NUM];
};

struct rtw89_btc_wl_ver_info {
@@ -1147,7 +1146,7 @@ struct rtw89_btc_rf_para {
};

struct rtw89_btc_wl_info {
	struct rtw89_btc_wl_link_info link_info[RTW89_MAX_HW_PORT_NUM];
	struct rtw89_btc_wl_link_info link_info[RTW89_PORT_NUM];
	struct rtw89_btc_wl_rfk_info rfk_info;
	struct rtw89_btc_wl_ver_info  ver_info;
	struct rtw89_btc_wl_afh_info afh_info;
@@ -2805,7 +2804,7 @@ struct rtw89_dev {

	struct rtw89_ser ser;

	DECLARE_BITMAP(hw_port, RTW89_MAX_HW_PORT_NUM);
	DECLARE_BITMAP(hw_port, RTW89_PORT_NUM);
	DECLARE_BITMAP(mac_id_map, RTW89_MAX_MAC_ID_NUM);
	DECLARE_BITMAP(flags, NUM_OF_RTW89_FLAGS);

+2 −2
Original line number Diff line number Diff line
@@ -1212,7 +1212,7 @@ int rtw89_fw_h2c_cxdrv_init(struct rtw89_dev *rtwdev)
	return -EBUSY;
}

#define H2C_LEN_CXDRVINFO_ROLE (4 + 12 * RTW89_MAX_HW_PORT_NUM + H2C_LEN_CXDRVHDR)
#define H2C_LEN_CXDRVINFO_ROLE (4 + 12 * RTW89_PORT_NUM + H2C_LEN_CXDRVHDR)
int rtw89_fw_h2c_cxdrv_role(struct rtw89_dev *rtwdev)
{
	struct rtw89_btc *btc = &rtwdev->btc;
@@ -1251,7 +1251,7 @@ int rtw89_fw_h2c_cxdrv_role(struct rtw89_dev *rtwdev)
	RTW89_SET_FWCMD_CXROLE_ROLE_P2P_GO(cmd, bpos->p2p_go);
	RTW89_SET_FWCMD_CXROLE_ROLE_NAN(cmd, bpos->nan);

	for (i = 0; i < RTW89_MAX_HW_PORT_NUM; i++, active++) {
	for (i = 0; i < RTW89_PORT_NUM; i++, active++) {
		RTW89_SET_FWCMD_CXROLE_ACT_CONNECTED(cmd, active->connected, i);
		RTW89_SET_FWCMD_CXROLE_ACT_PID(cmd, active->pid, i);
		RTW89_SET_FWCMD_CXROLE_ACT_PHY(cmd, active->phy, i);
+2 −2
Original line number Diff line number Diff line
@@ -108,8 +108,8 @@ static int rtw89_ops_add_interface(struct ieee80211_hw *hw,
	rtw89_traffic_stats_init(rtwdev, &rtwvif->stats);
	rtw89_vif_type_mapping(vif, false);
	rtwvif->port = rtw89_core_acquire_bit_map(rtwdev->hw_port,
						  RTW89_MAX_HW_PORT_NUM);
	if (rtwvif->port == RTW89_MAX_HW_PORT_NUM) {
						  RTW89_PORT_NUM);
	if (rtwvif->port == RTW89_PORT_NUM) {
		ret = -ENOSPC;
		goto out;
	}