Skip to contentSkip to conversation

mt76x0: init: use mt76x02_mac_shared_key_setup in mt76x0_init_hardware

PATCH Applied Lorenzo Bianconi 2 participants 2 messages Oct 28, 2018 – Nov 5, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 mt76x0: init: use mt76x02_mac_shared_key_setup in mt76x0_init_hardware

In reply to a message not in the archive

Use mt76x02_mac_shared_key_setup utility routine for shared key initialization and remove duplicated code

---
 drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76x0/init.c +4 -9
index 64eb6f451541..23ff29990ff7 100644
@@ -176,13 +176,6 @@ static int mt76x0_init_wcid_mem(struct mt76x02_dev *dev)
 	return 0;
 }
 
-static void mt76x0_init_key_mem(struct mt76x02_dev *dev)
-{
-	u32 vals[4] = {};
-
-	mt76_wr_copy(dev, MT_SKEY_MODE_BASE_0, vals, ARRAY_SIZE(vals));
-}
-
 static int mt76x0_init_wcid_attr_mem(struct mt76x02_dev *dev)
 {
 	u32 *vals;
@@ -260,7 +253,7 @@ EXPORT_SYMBOL_GPL(mt76x0_mac_stop);
 
 int mt76x0_init_hardware(struct mt76x02_dev *dev)
 {
-	int ret;
+	int ret, i, k;
 
 	if (!mt76x02_wait_for_wpdma(&dev->mt76, 1000))
 		return -EIO;
@@ -289,7 +282,9 @@ int mt76x0_init_hardware(struct mt76x02_dev *dev)
 	if (ret)
 		return ret;
 
-	mt76x0_init_key_mem(dev);
+	for (i = 0; i < 16; i++)
+		for (k = 0; k < 4; k++)
+			mt76x02_mac_shared_key_setup(dev, i, k, NULL);
 
 	ret = mt76x0_init_wcid_attr_mem(dev);
 	if (ret)
Signature · 1 line
2.19.1