| From 151293f0bd5e891e65c139fdde5ea71cf6237307 Mon Sep 17 00:00:00 2001 |
| From: Shayne Chen <shayne.chen@mediatek.com> |
| Date: Tue, 5 Dec 2023 17:20:02 +0800 |
| Subject: [PATCH 119/120] mlo debug print |
| |
| --- |
| mt76_connac_mcu.c | 1 + |
| mt7996/main.c | 14 ++++++++++++++ |
| mt7996/mcu.c | 14 ++++++++++++++ |
| mt7996/mt7996.h | 2 ++ |
| 4 files changed, 31 insertions(+) |
| |
| diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c |
| index 5d76a088f..082e2379f 100644 |
| --- a/mt76_connac_mcu.c |
| +++ b/mt76_connac_mcu.c |
| @@ -433,6 +433,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb, |
| } |
| |
| memcpy(basic->peer_addr, link_sta->addr, ETH_ALEN); |
| + pr_info("%s: link %u addr [%pM]\n", __func__, link_sta->link_id, basic->peer_addr); |
| basic->qos = sta->wme; |
| } |
| EXPORT_SYMBOL_GPL(mt76_connac_mcu_sta_basic_tlv); |
| diff --git a/mt7996/main.c b/mt7996/main.c |
| index bbe9b9524..785f67503 100644 |
| --- a/mt7996/main.c |
| +++ b/mt7996/main.c |
| @@ -424,6 +424,9 @@ static int mt7996_add_bss_conf(struct mt7996_phy *phy, |
| rcu_assign_pointer(mvif->link[link_id], mconf); |
| rcu_assign_pointer(mvif->sta.link[link_id], mlink); |
| |
| + mlo_dbg(phy, "bss_idx=%u, link_id=%u, wcid=%u\n", |
| + mconf->mt76.idx, mconf->link_id, mlink->wcid.idx); |
| + |
| return 0; |
| error: |
| mt7996_remove_bss_conf(vif, conf, mconf); |
| @@ -592,6 +595,11 @@ static int mt7996_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
| add = vif->valid_links ?: BIT(0); |
| } |
| |
| + mlo_dbg(mt7996_hw_phy(hw), "cipher = 0x%x, icv_len = %u, iv_len = %u, hw_key_idx = %u, keyidx = %d, flags = 0x%x, link_id = %d, keylen = %u\n", |
| + key->cipher, key->icv_len, key->iv_len, key->hw_key_idx, key->keyidx, key->flags, key->link_id, key->keylen); |
| + // print_hex_dump(KERN_INFO , "", DUMP_PREFIX_OFFSET, 16, 1, key->key, key->keylen, false); |
| + mlo_dbg(mt7996_hw_phy(hw), "add=%lx, valid_links=%x, active_links=%x\n", add, vif->valid_links, vif->active_links); |
| + |
| mutex_lock(&dev->mt76.mutex); |
| |
| for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) { |
| @@ -1103,6 +1111,8 @@ static int mt7996_add_link_sta(struct mt7996_dev *dev, |
| mt76_wcid_mask_set(dev->mt76.wcid_phy_mask, idx); |
| rcu_assign_pointer(dev->mt76.wcid[idx], &mlink->wcid); |
| mt76_wcid_init(&mlink->wcid); |
| + |
| + mlo_dbg(mconf->phy, "wcid=%u, link_id=%u, link_addr=%pM, pri_link=%u, sec_link=%u\n", mlink->wcid.idx, link_id, link_sta->addr, msta->pri_link, msta->sec_link); |
| } |
| |
| if (!assoc) |
| @@ -1137,6 +1147,7 @@ mt7996_mac_sta_remove_links(struct mt7996_dev *dev, struct ieee80211_vif *vif, |
| struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv; |
| unsigned int link_id; |
| |
| + mlo_dbg(mt7996_hw_phy(mvif->hw), "rem=%lu\n", rem); |
| for_each_set_bit(link_id, &rem, IEEE80211_MLD_MAX_NUM_LINKS) { |
| struct mt7996_bss_conf *mconf = |
| mconf_dereference_protected(mvif, link_id); |
| @@ -1162,6 +1173,7 @@ mt7996_mac_sta_add_links(struct mt7996_dev *dev, struct ieee80211_vif *vif, |
| unsigned int link_id; |
| int i, ret; |
| |
| + mlo_dbg(mt7996_hw_phy(mvif->hw), "add=%lu, assoc=%d\n", add, assoc); |
| for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) { |
| struct mt7996_bss_conf *mconf = |
| mconf_dereference_protected(mvif, link_id); |
| @@ -2460,6 +2472,7 @@ mt7996_change_vif_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| unsigned int link_id; |
| int ret = 0; |
| |
| + mlo_dbg(phy, "old=%u, new=%u\n", old_links, new_links); |
| if (old_links == new_links) |
| return 0; |
| |
| @@ -2508,6 +2521,7 @@ mt7996_change_sta_links(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| unsigned long rem = old_links & ~new_links; |
| int ret = 0; |
| |
| + mlo_dbg(mt7996_hw_phy(hw), "old=%u, new=%u\n", old_links, new_links); |
| mutex_lock(&dev->mt76.mutex); |
| |
| if (rem) |
| diff --git a/mt7996/mcu.c b/mt7996/mcu.c |
| index 3e7d48ee8..e4d840599 100644 |
| --- a/mt7996/mcu.c |
| +++ b/mt7996/mcu.c |
| @@ -1062,6 +1062,8 @@ mt7996_mcu_bss_mld_tlv(struct sk_buff *skb, struct ieee80211_vif *vif, |
| } |
| |
| mld->own_mld_id = mconf->own_mld_id; |
| + pr_info("%s: group_mld_id=%d own_mld_id=%d remap_idx=%d mld->addr[%pM]\n", |
| + __func__, mld->group_mld_id, mld->own_mld_id, mld->remap_idx, mld->mac_addr); |
| } |
| |
| static void |
| @@ -1213,6 +1215,10 @@ mt7996_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *conf, |
| } |
| |
| memcpy(bss->bssid, conf->bssid, ETH_ALEN); |
| + |
| + mlo_dbg(mconf->phy, "omac_idx=%d band_idx=%d wmm_idx=%d bss->bssid=%pM enable=%d\n", |
| + bss->omac_idx, bss->band_idx, bss->wmm_idx, bss->bssid, enable); |
| + |
| bss->bcn_interval = cpu_to_le16(conf->beacon_int); |
| bss->dtim_period = conf->dtim_period; |
| bss->phymode = mt76_connac_get_phy_mode(phy, vif, |
| @@ -2408,6 +2414,8 @@ int mt7996_mcu_add_sta(struct mt7996_dev *dev, struct ieee80211_bss_conf *conf, |
| |
| /* starec basic */ |
| mt76_connac_mcu_sta_basic_tlv(&dev->mt76, skb, conf, link_sta, enable, newly); |
| + mlo_dbg(mconf->phy, "link=%u, newly=%d, en=%d\n", |
| + mlink->wcid.link_id, newly, enable); |
| |
| if (!enable) |
| goto out; |
| @@ -2488,12 +2496,16 @@ mt7996_mcu_sta_mld_setup_tlv(struct mt7996_dev *dev, struct sk_buff *skb, |
| mld_setup->link_num = hweight16(sta->valid_links); |
| |
| mld_setup_link = (struct mld_setup_link *)mld_setup->link_info; |
| + mlo_dbg(mt7996_hw_phy(mlink->sta->vif->hw), "pri_link(%u) primary_id(%d) seconed_id(%d) wcid(%d), link_num(%d), mld_addr[%pM]\n", |
| + msta->pri_link, mld_setup->primary_id, mld_setup->seconed_id, mld_setup->setup_wcid, mld_setup->link_num, mld_setup->mld_addr); |
| for_each_set_bit(link_id, &valid_links, IEEE80211_MLD_MAX_NUM_LINKS) { |
| mlink = mlink_dereference_protected(msta, link_id); |
| mconf = mconf_dereference_protected(msta->vif, link_id); |
| |
| mld_setup_link->wcid = cpu_to_le16(mlink->wcid.idx); |
| mld_setup_link->bss_idx = mconf->mt76.idx; |
| + mlo_dbg(mt7996_hw_phy(mlink->sta->vif->hw), "link_id(%d) wcid(%d) bss_idx(%d)\n", |
| + link_id, mld_setup_link->wcid, mld_setup_link->bss_idx); |
| mld_setup_link++; |
| } |
| } |
| @@ -2757,6 +2769,8 @@ int mt7996_mcu_add_dev_info(struct mt7996_phy *phy, |
| return mt7996_mcu_muar_config(phy, conf, mconf, false, enable); |
| |
| memcpy(data.tlv.omac_addr, conf->addr, ETH_ALEN); |
| + mlo_dbg(phy, "omac=%u, band=%u, addr=%pM, en=%d\n", |
| + data.hdr.omac_idx,data.hdr.band_idx, data.tlv.omac_addr, enable); |
| return mt76_mcu_send_msg(&dev->mt76, MCU_WMWA_UNI_CMD(DEV_INFO_UPDATE), |
| &data, sizeof(data), true); |
| } |
| diff --git a/mt7996/mt7996.h b/mt7996/mt7996.h |
| index 691d2bc83..20a2aeb89 100644 |
| --- a/mt7996/mt7996.h |
| +++ b/mt7996/mt7996.h |
| @@ -864,6 +864,8 @@ mt7996_get_link_wcid(struct mt7996_dev *dev, u16 idx, u8 band_idx) |
| return &mlink->wcid; |
| } |
| |
| +#define mlo_dbg(phy, fmt, ...) wiphy_info(phy->mt76->hw->wiphy, "%s: " fmt, __func__, ##__VA_ARGS__) |
| + |
| extern const struct ieee80211_ops mt7996_ops; |
| extern struct pci_driver mt7996_pci_driver; |
| extern struct pci_driver mt7996_hif_driver; |
| -- |
| 2.39.2 |
| |