From: Stanislaw Gruszka Date: Tue, 19 Mar 2019 10:37:42 +0000 (+0100) Subject: mt76x02: disable HW encryption for group frames X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b98558e25299860f2428eff2e7636510c6d8fba0;p=openwrt%2Fstaging%2Fblogic.git mt76x02: disable HW encryption for group frames This is required to sent multicast/broadcast frames in USB AP mode just after beacon. Signed-off-by: Stanislaw Gruszka Signed-off-by: Felix Fietkau --- diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c index 168c62a90361..ed6463c9166e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c @@ -424,6 +424,16 @@ int mt76x02_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) return -EOPNOTSUPP; + /* + * In USB AP mode, broadcast/multicast frames are setup in beacon + * data registers and sent via HW beacons engine, they require to + * be already encrypted. + */ + if (mt76_is_usb(dev) && + vif->type == NL80211_IFTYPE_AP && + !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) + return -EOPNOTSUPP; + msta = sta ? (struct mt76x02_sta *) sta->drv_priv : NULL; wcid = msta ? &msta->wcid : &mvif->group_wcid;