From e24039cc45898c83b7e72969c6287ac74c94fe6f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 22 Feb 2016 23:48:53 +0100 Subject: [PATCH] mt7603: initialize group key (still uses sw crypto for rx) Signed-off-by: Felix Fietkau --- mt7603_main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mt7603_main.c b/mt7603_main.c index 1dcb7f79..5f1b961b 100644 --- a/mt7603_main.c +++ b/mt7603_main.c @@ -11,6 +11,7 @@ * GNU General Public License for more details. */ +#include #include "mt7603.h" #include "mt7603_eeprom.h" @@ -59,6 +60,7 @@ mt7603_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { struct mt7603_vif *mvif = (struct mt7603_vif *) vif->drv_priv; struct mt7603_dev *dev = hw->priv; + u8 bc_addr[ETH_ALEN]; int idx; int ret = 0; @@ -80,6 +82,10 @@ mt7603_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) dev->vif_mask |= BIT(mvif->idx); mvif->sta.wcid.idx = idx; mvif->sta.wcid.hw_key_idx = -1; + + eth_broadcast_addr(bc_addr); + mt7603_wtbl_init(dev, idx, bc_addr); + rcu_assign_pointer(dev->wcid[idx], &mvif->sta.wcid); mt7603_txq_init(dev, vif->txq); @@ -302,10 +308,7 @@ mt7603_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, key = NULL; } - if (!msta) - return -EINVAL; - - return mt7603_wtbl_set_key(dev, msta->wcid.idx, key); + return mt7603_wtbl_set_key(dev, wcid->idx, key); } static int