Commit 86c051f2 authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau
Browse files

wifi: mt76: mt7925: enabling MLO when the firmware supports it

parent 67e9847b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1402,6 +1402,7 @@ enum {
	MT_NIC_CAP_WFDMA_REALLOC,
	MT_NIC_CAP_6G,
	MT_NIC_CAP_CHIP_CAP = 0x20,
	MT_NIC_CAP_EML_CAP = 0x22,
};

#define UNI_WOW_DETECT_TYPE_MAGIC		BIT(0)
+6 −0
Original line number Diff line number Diff line
@@ -179,6 +179,12 @@ static void mt7925_init_work(struct work_struct *work)
	mt76_set_stream_caps(&dev->mphy, true);
	mt7925_set_stream_he_eht_caps(&dev->phy);

	ret = mt7925_init_mlo_caps(&dev->phy);
	if (ret) {
		dev_err(dev->mt76.dev, "MLO init failed\n");
		return;
	}

	ret = mt76_register_device(&dev->mt76, true, mt76_rates,
				   ARRAY_SIZE(mt76_rates));
	if (ret) {
+29 −0
Original line number Diff line number Diff line
@@ -236,6 +236,35 @@ mt7925_init_eht_caps(struct mt792x_phy *phy, enum nl80211_band band,
	eht_nss->bw._160.rx_tx_mcs13_max_nss = val;
}

int mt7925_init_mlo_caps(struct mt792x_phy *phy)
{
	struct wiphy *wiphy = phy->mt76->hw->wiphy;
	static const u8 ext_capa_sta[] = {
		[7] = WLAN_EXT_CAPA8_OPMODE_NOTIF,
	};
	static struct wiphy_iftype_ext_capab ext_capab[] = {
		{
			.iftype = NL80211_IFTYPE_STATION,
			.extended_capabilities = ext_capa_sta,
			.extended_capabilities_mask = ext_capa_sta,
			.extended_capabilities_len = sizeof(ext_capa_sta),
		},
	};

	if (!(phy->chip_cap & MT792x_CHIP_CAP_MLO_EVT_EN))
		return 0;

	ext_capab[0].eml_capabilities = phy->eml_cap;
	ext_capab[0].mld_capa_and_ops =
		u16_encode_bits(1, IEEE80211_MLD_CAP_OP_MAX_SIMUL_LINKS);

	wiphy->flags |= WIPHY_FLAG_SUPPORTS_MLO;
	wiphy->iftype_ext_capab = ext_capab;
	wiphy->num_iftype_ext_capab = ARRAY_SIZE(ext_capab);

	return 0;
}

static void
__mt7925_set_stream_he_eht_caps(struct mt792x_phy *phy,
				struct ieee80211_supported_band *sband,
+20 −0
Original line number Diff line number Diff line
@@ -751,6 +751,20 @@ mt7925_mcu_parse_phy_cap(struct mt792x_dev *dev, char *data)
	dev->has_eht = cap->eht;
}

static void
mt7925_mcu_parse_eml_cap(struct mt792x_dev *dev, char *data)
{
	struct mt7925_mcu_eml_cap {
		u8 rsv[4];
		__le16 eml_cap;
		u8 rsv2[6];
	} __packed * cap;

	cap = (struct mt7925_mcu_eml_cap *)data;

	dev->phy.eml_cap = le16_to_cpu(cap->eml_cap);
}

static int
mt7925_mcu_get_nic_capability(struct mt792x_dev *dev)
{
@@ -805,6 +819,12 @@ mt7925_mcu_get_nic_capability(struct mt792x_dev *dev)
		case MT_NIC_CAP_PHY:
			mt7925_mcu_parse_phy_cap(dev, tlv->data);
			break;
		case MT_NIC_CAP_CHIP_CAP:
			memcpy(&dev->phy.chip_cap, (void *)skb->data, sizeof(u64));
			break;
		case MT_NIC_CAP_EML_CAP:
			mt7925_mcu_parse_eml_cap(dev, tlv->data);
			break;
		default:
			break;
		}
+1 −0
Original line number Diff line number Diff line
@@ -235,6 +235,7 @@ void mt7925_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q,
			 struct sk_buff *skb, u32 *info);
void mt7925_stats_work(struct work_struct *work);
void mt7925_set_stream_he_eht_caps(struct mt792x_phy *phy);
int mt7925_init_mlo_caps(struct mt792x_phy *phy);
int mt7925_init_debugfs(struct mt792x_dev *dev);

int mt7925_mcu_set_beacon_filter(struct mt792x_dev *dev,
Loading