diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2018-09-04 16:40:54 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-09-19 12:28:45 +0200 |
commit | 36404c065ac310c042aa3334ecd6fa12cd3400eb (patch) | |
tree | f49d6bd2c2ad213cbf50ab854cb35e75140a11aa /drivers/net/wireless/mediatek/mt76/mt76x0/init.c | |
parent | 43e2f2904160b9a95aad77df9cbc1622910b8598 (diff) | |
download | lwn-36404c065ac310c042aa3334ecd6fa12cd3400eb.tar.gz lwn-36404c065ac310c042aa3334ecd6fa12cd3400eb.zip |
mt76: move wcid fields to common mt76_dev struct
All current MT devices including new MT7603 type chips support 128
WCIDs, we can unify wcid data in common mt76_dev structure.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x0/init.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76x0/init.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/init.c b/drivers/net/wireless/mediatek/mt76/mt76x0/init.c index 80783edd9ca5..b5bf22184a69 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/init.c @@ -230,17 +230,17 @@ static int mt76x0_init_wcid_mem(struct mt76x0_dev *dev) u32 *vals; int i, ret; - vals = kmalloc(sizeof(*vals) * N_WCIDS * 2, GFP_KERNEL); + vals = kmalloc(sizeof(*vals) * MT76_N_WCIDS * 2, GFP_KERNEL); if (!vals) return -ENOMEM; - for (i = 0; i < N_WCIDS; i++) { + for (i = 0; i < MT76_N_WCIDS; i++) { vals[i * 2] = 0xffffffff; vals[i * 2 + 1] = 0x00ffffff; } ret = mt76x0_burst_write_regs(dev, MT_WCID_ADDR_BASE, - vals, N_WCIDS * 2); + vals, MT76_N_WCIDS * 2); kfree(vals); return ret; @@ -259,15 +259,15 @@ static int mt76x0_init_wcid_attr_mem(struct mt76x0_dev *dev) u32 *vals; int i, ret; - vals = kmalloc(sizeof(*vals) * N_WCIDS * 2, GFP_KERNEL); + vals = kmalloc(sizeof(*vals) * MT76_N_WCIDS * 2, GFP_KERNEL); if (!vals) return -ENOMEM; - for (i = 0; i < N_WCIDS * 2; i++) + for (i = 0; i < MT76_N_WCIDS * 2; i++) vals[i] = 1; ret = mt76x0_burst_write_regs(dev, MT_WCID_ATTR_BASE, - vals, N_WCIDS * 2); + vals, MT76_N_WCIDS * 2); kfree(vals); return ret; @@ -667,15 +667,11 @@ int mt76x0_register_device(struct mt76x0_dev *dev) /* Reserve WCID 0 for mcast - thanks to this APs WCID will go to * entry no. 1 like it does in the vendor driver. */ - dev->wcid_mask[0] |= 1; + dev->mt76.wcid_mask[0] |= 1; /* init fake wcid for monitor interfaces */ - dev->mon_wcid = devm_kmalloc(dev->mt76.dev, sizeof(*dev->mon_wcid), - GFP_KERNEL); - if (!dev->mon_wcid) - return -ENOMEM; - dev->mon_wcid->idx = 0xff; - dev->mon_wcid->hw_key_idx = -1; + dev->mt76.global_wcid.idx = 0xff; + dev->mt76.global_wcid.hw_key_idx = -1; SET_IEEE80211_DEV(hw, dev->mt76.dev); |