From: "Shayne Chen (陳軒丞)" <Shayne.Chen@mediatek.com>
To: Sean Wang <Sean.Wang@mediatek.com>, "nbd@nbd.name" <nbd@nbd.name>,
"lorenzo@kernel.org" <lorenzo@kernel.org>,
Ryder Lee <Ryder.Lee@mediatek.com>,
"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"Bo Jiao (焦波)" <Bo.Jiao@mediatek.com>,
"Chui-hao Chiu (邱垂浩)" <Chui-hao.Chiu@mediatek.com>
Subject: Re: [PATCH 02/21] wifi: mt76: mt7996: Add mt7996_mcu_sta_mld_setup_tlv() and mt7996_mcu_sta_eht_mld_tlv()
Date: Tue, 18 Mar 2025 08:51:23 +0000 [thread overview]
Message-ID: <9efb42f0948b23cc127dc5c5d9e31791f80219ef.camel@mediatek.com> (raw)
In-Reply-To: <20250312-b4-mt7996-mlo-p2-v1-2-015b3d6fd928@kernel.org>
On Wed, 2025-03-12 at 12:13 +0100, Lorenzo Bianconi wrote:
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> index
> 0cc822a8a6799a4552fa537cab2f13d6537bb1a8..ac01eb880e2a6f6ef3a81591bca
> cd2b90c48986a 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c
> @@ -2197,6 +2197,80 @@ mt7996_mcu_add_group(struct mt7996_dev *dev,
> struct ieee80211_vif *vif,
> sizeof(req), true);
> }
>
> +static void
> +mt7996_mcu_sta_mld_setup_tlv(struct mt7996_dev *dev, struct sk_buff
> *skb,
> + struct ieee80211_sta *sta)
> +{
> + struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv;
> + unsigned long links = sta->valid_links;
> + unsigned int nlinks = hweight16(links);
> + struct mld_setup_link *mld_setup_link;
> + struct sta_rec_mld_setup *mld_setup;
> + struct mt7996_sta_link *msta_link;
> + struct ieee80211_vif *vif;
> + unsigned int link_id;
> + struct tlv *tlv;
> +
> + msta_link = mt76_dereference(msta->link[msta->deflink_id],
> &dev->mt76);
> + if (!msta_link)
> + return;
> +
> + tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_MLD,
> + sizeof(struct
> sta_rec_mld_setup) +
> + sizeof(struct mld_setup_link) *
> nlinks);
> +
> + mld_setup = (struct sta_rec_mld_setup *)tlv;
> + memcpy(mld_setup->mld_addr, sta->addr, ETH_ALEN);
> + mld_setup->setup_wcid = cpu_to_le16(msta_link->wcid.idx);
> + mld_setup->primary_id = cpu_to_le16(msta_link->wcid.idx);
> +
> + if (nlinks > 1) {
> + link_id = __ffs(links & ~BIT(msta->deflink_id));
> + msta_link = mt76_dereference(msta->link[msta-
> >deflink_id],
> + &dev->mt76);
> + if (!msta_link)
> + return;
> + }
> + mld_setup->seconed_id = cpu_to_le16(msta_link->wcid.idx);
> + mld_setup->link_num = nlinks;
> +
> + vif = container_of((void *)msta->vif, struct ieee80211_vif,
> drv_priv);
> + mld_setup_link = (struct mld_setup_link *)mld_setup-
> >link_info;
> + for_each_set_bit(link_id, &links,
> IEEE80211_MLD_MAX_NUM_LINKS) {
> + struct mt7996_vif_link *link;
> +
> + msta_link = mt76_dereference(msta->link[link_id],
> &dev->mt76);
> + if (!msta_link)
> + continue;
> +
> + link = mt7996_vif_link(dev, vif, link_id);
> + if (!link)
> + continue;
> +
> + if (!msta_link)
> + continue;
> +
> + mld_setup_link->wcid = cpu_to_le16(msta_link-
> >wcid.idx);
> + mld_setup_link->bss_idx = link->mt76.idx;
> + mld_setup_link++;
> + }
> +}
> +
> +static void
> +mt7996_mcu_sta_eht_mld_tlv(struct mt7996_dev *dev, struct sk_buff
> *skb,
> + struct ieee80211_sta *sta)
> +{
> + struct sta_rec_eht_mld *eht_mld;
> + struct tlv *tlv;
> + int i;
> +
> + tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_EHT_MLD,
> sizeof(*eht_mld));
> + eht_mld = (struct sta_rec_eht_mld *)tlv;
> +
> + for (i = 0; i < ARRAY_SIZE(eht_mld->str_cap); i++)
> + eht_mld->str_cap[i] = 0x7;
> +}
> +
> int mt7996_mcu_add_sta(struct mt7996_dev *dev,
> struct ieee80211_bss_conf *link_conf,
> struct ieee80211_link_sta *link_sta,
> @@ -2255,6 +2329,11 @@ int mt7996_mcu_add_sta(struct mt7996_dev *dev,
> mt7996_mcu_sta_eht_tlv(skb, link_sta);
> /* starec muru */
> mt7996_mcu_sta_muru_tlv(dev, skb, link_conf,
> link_sta);
> +
> + if (sta->mlo && conn_state != CONN_STATE_DISCONNECT)
The latter check seems already to be handled by:
if (conn_state == CONN_STATE_DISCONNECT)
goto out;
> {
> + mt7996_mcu_sta_mld_setup_tlv(dev, skb, sta);
> + mt7996_mcu_sta_eht_mld_tlv(dev, skb, sta);
> + }
> }
>
> ret = mt7996_mcu_add_group(dev, link_conf->vif, sta);
>
next prev parent reply other threads:[~2025-03-18 8:58 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 11:13 [PATCH 00/21] wifi: mt76: mt7996: second preliminary work to support MLO Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 01/21] wifi: mt76: mt7996: Update mt7996_mcu_add_rate_ctrl to MLO Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 02/21] wifi: mt76: mt7996: Add mt7996_mcu_sta_mld_setup_tlv() and mt7996_mcu_sta_eht_mld_tlv() Lorenzo Bianconi
2025-03-18 8:51 ` Shayne Chen (陳軒丞) [this message]
2025-03-18 13:53 ` lorenzo
2025-03-12 11:13 ` [PATCH 03/21] wifi: mt76: mt7996: Add mt7996_mcu_teardown_mld_sta rouine Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 04/21] wifi: mt76: mt7996: rework mt7996_mac_write_txwi() for MLO support Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 05/21] wifi: mt76: mt7996: Rely on wcid_to_sta in mt7996_mac_add_txs_skb() Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 06/21] wifi: mt76: mt7996: rework mt7996_rx_get_wcid to support MLO Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 07/21] wifi: mt76: mt7996: rework mt7996_sta_set_4addr and mt7996_sta_set_decap_offload " Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 08/21] wifi: mt76: mt7996: Add mt7996_sta_link to mt7996_mcu_add_bss_info signature Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 09/21] wifi: mt76: mt7996: rework mt7996_set_hw_key to support MLO Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 10/21] wifi: mt76: mt7996: rework mt7996_sta_hw_queue_read " Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 11/21] wifi: mt76: mt7996: remove mt7996_mac_enable_rtscts() Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 12/21] wifi: mt76: mt7996: rework mt7996_mac_sta_rc_work to support MLO Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 13/21] wifi: mt76: mt7996: rework mt7996_mac_sta_poll " Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 14/21] wifi: mt76: mt7996: rework mt7996_update_mu_group " Lorenzo Bianconi
2025-03-12 11:13 ` [PATCH 15/21] wifi: mt76: mt7996: rework mt7996_net_fill_forward_path " Lorenzo Bianconi
2025-03-12 11:14 ` [PATCH 16/21] wifi: mt76: mt7996: rework mt7996_mcu_add_obss_spr " Lorenzo Bianconi
2025-03-12 11:14 ` [PATCH 17/21] wifi: mt76: mt7996: rework mt7996_mcu_beacon_inband_discov " Lorenzo Bianconi
2025-03-12 11:14 ` [PATCH 18/21] wifi: mt76: mt7996: set vif default link_id adding/removing vif links Lorenzo Bianconi
2025-03-12 11:14 ` [PATCH 19/21] wifi: mt76: mt7996: rework set/get_tsf callabcks to support MLO Lorenzo Bianconi
2025-03-12 11:14 ` [PATCH 20/21] wifi: mt76: mt7996: rework mt7996_ampdu_action " Lorenzo Bianconi
2025-03-18 6:28 ` Shayne Chen
2025-03-18 8:30 ` Shayne Chen
2025-03-18 13:53 ` Lorenzo Bianconi
2025-03-12 11:14 ` [PATCH 21/21] wifi: mt76: mt7996: Update mt7996_tx to MLO support Lorenzo Bianconi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9efb42f0948b23cc127dc5c5d9e31791f80219ef.camel@mediatek.com \
--to=shayne.chen@mediatek.com \
--cc=Bo.Jiao@mediatek.com \
--cc=Chui-hao.Chiu@mediatek.com \
--cc=Ryder.Lee@mediatek.com \
--cc=Sean.Wang@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=johannes@sipsolutions.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=nbd@nbd.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox