MT7915_MAX_INTERFACES is per-band declartion.
Signed-off-by: Evelyn Tsai <[email protected]>
Signed-off-by: Bo Jiao <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt76.h | 2 +-
drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
index 5e10fe156926..c60af144f611 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76.h
@@ -727,7 +727,7 @@ struct mt76_dev {
u32 wcid_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];
u32 wcid_phy_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];
- u32 vif_mask;
+ u64 vif_mask;
struct mt76_wcid global_wcid;
struct mt76_wcid __rcu *wcid[MT76_N_WCIDS];
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
index c3f44d801e7f..9eefc132d77a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -205,7 +205,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
phy->monitor_vif = vif;
mvif->mt76.idx = ffs(~dev->mt76.vif_mask) - 1;
- if (mvif->mt76.idx >= MT7915_MAX_INTERFACES) {
+ if (mvif->mt76.idx >= (MT7915_MAX_INTERFACES << dev->dbdc_support)) {
ret = -ENOSPC;
goto out;
}
--
2.18.0
On 09.03.22 15:02, Evelyn Tsai wrote:
> MT7915_MAX_INTERFACES is per-band declartion.
>
> Signed-off-by: Evelyn Tsai <[email protected]>
> Signed-off-by: Bo Jiao <[email protected]>
> ---
> drivers/net/wireless/mediatek/mt76/mt76.h | 2 +-
> drivers/net/wireless/mediatek/mt76/mt7915/main.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
> index 5e10fe156926..c60af144f611 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt76.h
> @@ -727,7 +727,7 @@ struct mt76_dev {
> u32 wcid_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];
> u32 wcid_phy_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];
>
> - u32 vif_mask;
> + u64 vif_mask;
>
> struct mt76_wcid global_wcid;
> struct mt76_wcid __rcu *wcid[MT76_N_WCIDS];
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
> index c3f44d801e7f..9eefc132d77a 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
> @@ -205,7 +205,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
> phy->monitor_vif = vif;
>
> mvif->mt76.idx = ffs(~dev->mt76.vif_mask) - 1;
> - if (mvif->mt76.idx >= MT7915_MAX_INTERFACES) {
> + if (mvif->mt76.idx >= (MT7915_MAX_INTERFACES << dev->dbdc_support)) {
This patch is incomplete. There are several other places in the code
that are not prepared for vif_mask being 64 bits wide, including the ffs
line above.
- Felix