rsi: optimize virtual interfaces
authorSiva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Thu, 5 Jul 2018 12:38:22 +0000 (18:08 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 31 Jul 2018 07:14:47 +0000 (10:14 +0300)
Due to multiple calls of add interface routine, vif is getting duplicated
and at certain instance, we are out of vifs, causing the driver to behave
abnormal.

Fix: Every vif has a unique mac-id, when we got a vif with same mac-id as
the previous id's, we will override the respective vif.

Signed-off-by: Siva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Signed-off-by: Sushant Kumar Mishra <sushant.mishra@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rsi/rsi_91x_mac80211.c

index 2ca7464..4e510cb 100644 (file)
@@ -416,7 +416,8 @@ static int rsi_mac80211_add_interface(struct ieee80211_hw *hw,
 
        /* Get free vap index */
        for (i = 0; i < RSI_MAX_VIFS; i++) {
-               if (!adapter->vifs[i]) {
+               if (!adapter->vifs[i] ||
+                   !memcmp(vif->addr, adapter->vifs[i]->addr, ETH_ALEN)) {
                        vap_idx = i;
                        break;
                }