Commit 0af2b1b2 authored by Kalle Valo's avatar Kalle Valo
Browse files

Merge tag 'rtw-next-2024-09-05' of https://github.com/pkshih/rtw

rtw-next patches for v6.12

The rtw89 is continuously adjusting code to support MLO. The major changes
are listed below:

rtw88:

 * fix USB not transmitting beacon in AP mode

rtw89:

 * complete BT-coexistence code for RTL8852BT
 * fix throughput degrade of VHT rate for RTL8851B/8852A/8852B/8852BT
 * enable WoWLAN net-detect for more one chip, RTL8922A
parents 4f056849 ed2e4bb1
Loading
Loading
Loading
Loading
+10 −28
Original line number Diff line number Diff line
@@ -2194,7 +2194,6 @@ static void rtw_coex_action_bt_a2dp_pan(struct rtw_dev *rtwdev)
	struct rtw_coex_stat *coex_stat = &coex->stat;
	struct rtw_efuse *efuse = &rtwdev->efuse;
	u8 table_case, tdma_case;
	bool wl_cpt_test = false, bt_cpt_test = false;

	rtw_dbg(rtwdev, RTW_DBG_COEX, "[BTCoex], %s()\n", __func__);

@@ -2202,18 +2201,6 @@ static void rtw_coex_action_bt_a2dp_pan(struct rtw_dev *rtwdev)
	rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]);
	if (efuse->share_ant) {
		/* Shared-Ant */
		if (wl_cpt_test) {
			if (coex_stat->wl_gl_busy) {
				table_case = 20;
				tdma_case = 17;
			} else {
				table_case = 10;
				tdma_case = 15;
			}
		} else if (bt_cpt_test) {
			table_case = 26;
			tdma_case = 26;
		} else {
		if (coex_stat->wl_gl_busy &&
		    coex_stat->wl_noisy_level == 0)
			table_case = 14;
@@ -2224,7 +2211,6 @@ static void rtw_coex_action_bt_a2dp_pan(struct rtw_dev *rtwdev)
			tdma_case = 15;
		else
			tdma_case = 20;
		}
	} else {
		/* Non-Shared-Ant */
		table_case = 112;
@@ -2235,11 +2221,7 @@ static void rtw_coex_action_bt_a2dp_pan(struct rtw_dev *rtwdev)
			tdma_case = 120;
	}

	if (wl_cpt_test)
		rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[1]);
	else
	rtw_coex_set_rf_para(rtwdev, chip->wl_rf_para_rx[0]);

	rtw_coex_table(rtwdev, false, table_case);
	rtw_coex_tdma(rtwdev, false, tdma_case);
}
+8 −5
Original line number Diff line number Diff line
@@ -1468,10 +1468,12 @@ int rtw_fw_write_data_rsvd_page(struct rtw_dev *rtwdev, u16 pg_addr,
	val |= BIT_ENSWBCN >> 8;
	rtw_write8(rtwdev, REG_CR + 1, val);

	if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE) {
		val = rtw_read8(rtwdev, REG_FWHW_TXQ_CTRL + 2);
		bckp[1] = val;
		val &= ~(BIT_EN_BCNQ_DL >> 16);
		rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, val);
	}

	ret = rtw_hci_write_data_rsvd_page(rtwdev, buf, size);
	if (ret) {
@@ -1496,6 +1498,7 @@ int rtw_fw_write_data_rsvd_page(struct rtw_dev *rtwdev, u16 pg_addr,
	rsvd_pg_head = rtwdev->fifo.rsvd_boundary;
	rtw_write16(rtwdev, REG_FIFOPAGE_CTRL_2,
		    rsvd_pg_head | BIT_BCN_VALID_V1);
	if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE)
		rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 2, bckp[1]);
	rtw_write8(rtwdev, REG_CR + 1, bckp[0]);

+11 −2
Original line number Diff line number Diff line
@@ -167,6 +167,12 @@ static int rtw_ops_add_interface(struct ieee80211_hw *hw,

	mutex_lock(&rtwdev->mutex);

	rtwvif->mac_id = rtw_acquire_macid(rtwdev);
	if (rtwvif->mac_id >= RTW_MAX_MAC_ID_NUM) {
		mutex_unlock(&rtwdev->mutex);
		return -ENOSPC;
	}

	port = find_first_zero_bit(rtwdev->hw_port, RTW_PORT_NUM);
	if (port >= RTW_PORT_NUM) {
		mutex_unlock(&rtwdev->mutex);
@@ -214,7 +220,8 @@ static int rtw_ops_add_interface(struct ieee80211_hw *hw,

	mutex_unlock(&rtwdev->mutex);

	rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM on port %d\n", vif->addr, rtwvif->port);
	rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM mac_id %d on port %d\n",
		vif->addr, rtwvif->mac_id, rtwvif->port);
	return 0;
}

@@ -225,7 +232,8 @@ static void rtw_ops_remove_interface(struct ieee80211_hw *hw,
	struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
	u32 config = 0;

	rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM on port %d\n", vif->addr, rtwvif->port);
	rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM mac_id %d on port %d\n",
		vif->addr, rtwvif->mac_id, rtwvif->port);

	mutex_lock(&rtwdev->mutex);

@@ -242,6 +250,7 @@ static void rtw_ops_remove_interface(struct ieee80211_hw *hw,
	config |= PORT_SET_BCN_CTRL;
	rtw_vif_port_config(rtwdev, rtwvif, config);
	clear_bit(rtwvif->port, rtwdev->hw_port);
	rtw_release_macid(rtwdev, rtwvif->mac_id);
	rtw_recalc_lps(rtwdev, NULL);

	mutex_unlock(&rtwdev->mutex);
+12 −18
Original line number Diff line number Diff line
@@ -311,17 +311,6 @@ static void rtw_ips_work(struct work_struct *work)
	mutex_unlock(&rtwdev->mutex);
}

static u8 rtw_acquire_macid(struct rtw_dev *rtwdev)
{
	unsigned long mac_id;

	mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM);
	if (mac_id < RTW_MAX_MAC_ID_NUM)
		set_bit(mac_id, rtwdev->mac_id_map);

	return mac_id;
}

static void rtw_sta_rc_work(struct work_struct *work)
{
	struct rtw_sta_info *si = container_of(work, struct rtw_sta_info,
@@ -340,12 +329,14 @@ int rtw_sta_add(struct rtw_dev *rtwdev, struct ieee80211_sta *sta,
	struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
	int i;

	if (vif->type == NL80211_IFTYPE_STATION) {
		si->mac_id = rtwvif->mac_id;
	} else {
		si->mac_id = rtw_acquire_macid(rtwdev);
		if (si->mac_id >= RTW_MAX_MAC_ID_NUM)
			return -ENOSPC;
	}

	if (vif->type == NL80211_IFTYPE_STATION && vif->cfg.assoc == 0)
		rtwvif->mac_id = si->mac_id;
	si->rtwdev = rtwdev;
	si->sta = sta;
	si->vif = vif;
@@ -370,10 +361,12 @@ void rtw_sta_remove(struct rtw_dev *rtwdev, struct ieee80211_sta *sta,
		    bool fw_exist)
{
	struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv;
	struct ieee80211_vif *vif = si->vif;
	int i;

	cancel_work_sync(&si->rc_work);

	if (vif->type != NL80211_IFTYPE_STATION)
		rtw_release_macid(rtwdev, si->mac_id);
	if (fw_exist)
		rtw_fw_media_status_report(rtwdev, si->mac_id, false);
@@ -614,6 +607,8 @@ static void rtw_reset_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
	rtw_bf_disassoc(rtwdev, vif, NULL);
	rtw_vif_assoc_changed(rtwvif, NULL);
	rtw_txq_cleanup(rtwdev, vif->txq);

	rtw_release_macid(rtwdev, rtwvif->mac_id);
}

void rtw_fw_recovery(struct rtw_dev *rtwdev)
@@ -2139,7 +2134,6 @@ int rtw_core_init(struct rtw_dev *rtwdev)
	rtwdev->sec.total_cam_num = 32;
	rtwdev->hal.current_channel = 1;
	rtwdev->dm_info.fix_rate = U8_MAX;
	set_bit(RTW_BC_MC_MACID, rtwdev->mac_id_map);

	rtw_stats_init(rtwdev);

+12 −2
Original line number Diff line number Diff line
@@ -742,7 +742,6 @@ struct rtw_txq {
	unsigned long flags;
};

#define RTW_BC_MC_MACID 1
DECLARE_EWMA(rssi, 10, 16);

struct rtw_sta_info {
@@ -805,7 +804,7 @@ struct rtw_bf_info {
struct rtw_vif {
	enum rtw_net_type net_type;
	u16 aid;
	u8 mac_id; /* for STA mode only */
	u8 mac_id;
	u8 mac_addr[ETH_ALEN];
	u8 bssid[ETH_ALEN];
	u8 port;
@@ -2131,6 +2130,17 @@ static inline bool rtw_chip_has_tx_stbc(struct rtw_dev *rtwdev)
	return rtwdev->chip->tx_stbc;
}

static inline u8 rtw_acquire_macid(struct rtw_dev *rtwdev)
{
	unsigned long mac_id;

	mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM);
	if (mac_id < RTW_MAX_MAC_ID_NUM)
		set_bit(mac_id, rtwdev->mac_id_map);

	return mac_id;
}

static inline void rtw_release_macid(struct rtw_dev *rtwdev, u8 mac_id)
{
	clear_bit(mac_id, rtwdev->mac_id_map);
Loading