Commit 96fcecd9 authored by Felix Fietkau's avatar Felix Fietkau
Browse files

wifi: mt76: connac: prepare mt76_connac_mcu_sta_basic_tlv for MLO support

Pass in struct ieee80211_bss_conf in order to use link specific data.

Link: https://patch.msgid.link/20250102163508.52945-19-nbd@nbd.name


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 97a1beb8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -865,8 +865,8 @@ mt7615_mcu_wtbl_sta_add(struct mt7615_phy *phy, struct ieee80211_vif *vif,
			mvif->sta_added = true;
	}
	conn_state = enable ? CONN_STATE_PORT_SECURE : CONN_STATE_DISCONNECT;
	mt76_connac_mcu_sta_basic_tlv(&dev->mt76, sskb, vif, link_sta,
				      conn_state, new_entry);
	mt76_connac_mcu_sta_basic_tlv(&dev->mt76, sskb, &vif->bss_conf,
				      link_sta, conn_state, new_entry);
	if (enable && sta)
		mt76_connac_mcu_sta_tlv(phy->mt76, sskb, sta, vif, 0,
					MT76_STA_INFO_STATE_ASSOC);
+8 −4
Original line number Diff line number Diff line
@@ -369,10 +369,11 @@ void mt76_connac_mcu_bss_omac_tlv(struct sk_buff *skb,
EXPORT_SYMBOL_GPL(mt76_connac_mcu_bss_omac_tlv);

void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
				   struct ieee80211_vif *vif,
				   struct ieee80211_bss_conf *link_conf,
				   struct ieee80211_link_sta *link_sta,
				   int conn_state, bool newly)
{
	struct ieee80211_vif *vif = link_conf->vif;
	struct sta_rec_basic *basic;
	struct tlv *tlv;
	int conn_type;
@@ -390,8 +391,8 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
		basic->conn_type = cpu_to_le32(CONNECTION_INFRA_BC);

		if (vif->type == NL80211_IFTYPE_STATION &&
		    !is_zero_ether_addr(vif->bss_conf.bssid)) {
			memcpy(basic->peer_addr, vif->bss_conf.bssid, ETH_ALEN);
		    !is_zero_ether_addr(link_conf->bssid)) {
			memcpy(basic->peer_addr, link_conf->bssid, ETH_ALEN);
			basic->aid = cpu_to_le16(vif->cfg.aid);
		} else {
			eth_broadcast_addr(basic->peer_addr);
@@ -1049,6 +1050,9 @@ int mt76_connac_mcu_sta_cmd(struct mt76_phy *phy,
	struct sk_buff *skb;
	int conn_state;

	if (!info->link_conf)
		info->link_conf = &info->vif->bss_conf;

	skb = mt76_connac_mcu_alloc_sta_req(dev, mvif, info->wcid);
	if (IS_ERR(skb))
		return PTR_ERR(skb);
@@ -1057,7 +1061,7 @@ int mt76_connac_mcu_sta_cmd(struct mt76_phy *phy,
				    CONN_STATE_DISCONNECT;
	link_sta = info->sta ? &info->sta->deflink : NULL;
	if (info->sta || !info->offload_fw)
		mt76_connac_mcu_sta_basic_tlv(dev, skb, info->vif,
		mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
					      link_sta, conn_state,
					      info->newly);
	if (info->sta && info->enable)
+2 −1
Original line number Diff line number Diff line
@@ -1758,6 +1758,7 @@ struct mt76_sta_cmd_info {
	struct mt76_wcid *wcid;

	struct ieee80211_vif *vif;
	struct ieee80211_bss_conf *link_conf;

	bool offload_fw;
	bool enable;
@@ -1903,7 +1904,7 @@ mt76_connac_mcu_add_tlv(struct sk_buff *skb, int tag, int len)
int mt76_connac_mcu_set_channel_domain(struct mt76_phy *phy);
int mt76_connac_mcu_set_vif_ps(struct mt76_dev *dev, struct ieee80211_vif *vif);
void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
				   struct ieee80211_vif *vif,
				   struct ieee80211_bss_conf *link_conf,
				   struct ieee80211_link_sta *link_sta,
				   int state, bool newly);
void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
+1 −1
Original line number Diff line number Diff line
@@ -1699,7 +1699,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
		return PTR_ERR(skb);

	/* starec basic */
	mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, vif, link_sta,
	mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, &vif->bss_conf, link_sta,
				      conn_state, newly);
	/* tag order is in accordance with firmware dependency. */
	if (sta && conn_state != CONN_STATE_DISCONNECT) {
+3 −2
Original line number Diff line number Diff line
@@ -1820,7 +1820,7 @@ mt7925_mcu_sta_cmd(struct mt76_phy *phy,
	conn_state = info->enable ? CONN_STATE_PORT_SECURE :
				    CONN_STATE_DISCONNECT;
	if (info->link_sta)
		mt76_connac_mcu_sta_basic_tlv(dev, skb, info->vif,
		mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
					      info->link_sta,
					      conn_state, info->newly);
	if (info->link_sta && info->enable) {
@@ -1874,7 +1874,7 @@ mt7925_mcu_mlo_sta_cmd(struct mt76_phy *phy,
		return PTR_ERR(skb);

	if (info->enable)
		mt76_connac_mcu_sta_basic_tlv(dev, skb, info->vif,
		mt76_connac_mcu_sta_basic_tlv(dev, skb, info->link_conf,
					      info->link_sta,
					      info->enable, info->newly);

@@ -1920,6 +1920,7 @@ int mt7925_mcu_sta_update(struct mt792x_dev *dev,
	struct mt76_sta_cmd_info info = {
		.link_sta = link_sta,
		.vif = vif,
		.link_conf = &vif->bss_conf,
		.enable = enable,
		.cmd = MCU_UNI_CMD(STA_REC_UPDATE),
		.state = state,
Loading