Commit 48c76588 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76x0: init: use mt76x02_mac_shared_key_setup in mt76x0_init_hardware

Use mt76x02_mac_shared_key_setup utility routine for shared key
initialization and remove duplicated code
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 0464cbfc
...@@ -176,13 +176,6 @@ static int mt76x0_init_wcid_mem(struct mt76x02_dev *dev) ...@@ -176,13 +176,6 @@ static int mt76x0_init_wcid_mem(struct mt76x02_dev *dev)
return 0; 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) static int mt76x0_init_wcid_attr_mem(struct mt76x02_dev *dev)
{ {
u32 *vals; u32 *vals;
...@@ -260,7 +253,7 @@ EXPORT_SYMBOL_GPL(mt76x0_mac_stop); ...@@ -260,7 +253,7 @@ EXPORT_SYMBOL_GPL(mt76x0_mac_stop);
int mt76x0_init_hardware(struct mt76x02_dev *dev) int mt76x0_init_hardware(struct mt76x02_dev *dev)
{ {
int ret; int ret, i, k;
if (!mt76x02_wait_for_wpdma(&dev->mt76, 1000)) if (!mt76x02_wait_for_wpdma(&dev->mt76, 1000))
return -EIO; return -EIO;
...@@ -289,7 +282,9 @@ int mt76x0_init_hardware(struct mt76x02_dev *dev) ...@@ -289,7 +282,9 @@ int mt76x0_init_hardware(struct mt76x02_dev *dev)
if (ret) if (ret)
return 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); ret = mt76x0_init_wcid_attr_mem(dev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment