From 8f1673a34b32c466a65649ce9414f2ee3b4f79ba Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 15 Nov 2017 17:47:49 +0100 Subject: [PATCH] mt76x2: limit client WCID entries to 0-127 The rx WCID lookup table and the per-WCID rate table only have 128 entries. All further WCID entries are tx-only. Signed-off-by: Felix Fietkau --- mt76x2.h | 4 ++-- mt76x2_mac.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mt76x2.h b/mt76x2.h index 0bcf405d..f040a222 100644 --- a/mt76x2.h +++ b/mt76x2.h @@ -85,7 +85,7 @@ struct mt76x2_dev { struct mutex mutex; const u16 *beacon_offsets; - unsigned long wcid_mask[256 / BITS_PER_LONG]; + unsigned long wcid_mask[128 / BITS_PER_LONG]; int txpower_conf; int txpower_cur; @@ -104,7 +104,7 @@ struct mt76x2_dev { u32 aggr_stats[32]; struct mt76_wcid global_wcid; - struct mt76_wcid __rcu *wcid[254 - 8]; + struct mt76_wcid __rcu *wcid[128]; spinlock_t irq_lock; u32 irqmask; diff --git a/mt76x2_mac.c b/mt76x2_mac.c index 12364cc0..9e6e02aa 100644 --- a/mt76x2_mac.c +++ b/mt76x2_mac.c @@ -536,6 +536,9 @@ void mt76x2_mac_wcid_setup(struct mt76x2_dev *dev, u8 idx, u8 vif_idx, u8 *mac) mt76_wr(dev, MT_WCID_ATTR(idx), attr); + if (idx >= 128) + return; + if (mac) memcpy(addr.macaddr, mac, ETH_ALEN);