mt76x02: enable support for IBSS and MESH
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 30 Jan 2019 16:02:19 +0000 (17:02 +0100)
committerFelix Fietkau <nbd@nbd.name>
Mon, 18 Feb 2019 18:54:32 +0000 (19:54 +0100)
Since we implement beconing on USB now, similar interfaces should be
supported for USB as are for MMIO. Tested only on IBSS mode and
AP mode (not enabled due to lack of PS buffering).

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x02_util.c

index 724b13d..87ed007 100644 (file)
@@ -140,10 +140,16 @@ void mt76x02_init_device(struct mt76x02_dev *dev)
        hw->max_rate_tries = 1;
        hw->extra_tx_headroom = 2;
 
+       wiphy->interface_modes =
+               BIT(NL80211_IFTYPE_STATION) |
+#ifdef CONFIG_MAC80211_MESH
+               BIT(NL80211_IFTYPE_MESH_POINT) |
+#endif
+               BIT(NL80211_IFTYPE_ADHOC);
+
        if (mt76_is_usb(dev)) {
                hw->extra_tx_headroom += sizeof(struct mt76x02_txwi) +
                                         MT_DMA_HDR_LEN;
-               wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
        } else {
                INIT_DELAYED_WORK(&dev->wdt_work, mt76x02_wdt_work);
 
@@ -152,18 +158,9 @@ void mt76x02_init_device(struct mt76x02_dev *dev)
                wiphy->reg_notifier = mt76x02_regd_notifier;
                wiphy->iface_combinations = mt76x02_if_comb;
                wiphy->n_iface_combinations = ARRAY_SIZE(mt76x02_if_comb);
-               wiphy->interface_modes =
-                       BIT(NL80211_IFTYPE_STATION) |
-                       BIT(NL80211_IFTYPE_AP) |
-#ifdef CONFIG_MAC80211_MESH
-                       BIT(NL80211_IFTYPE_MESH_POINT) |
-#endif
-                       BIT(NL80211_IFTYPE_ADHOC);
-
+               wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP);
                wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
 
-               wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
-
                /* init led callbacks */
                if (IS_ENABLED(CONFIG_MT76_LEDS)) {
                        dev->mt76.led_cdev.brightness_set =
@@ -172,6 +169,8 @@ void mt76x02_init_device(struct mt76x02_dev *dev)
                }
        }
 
+       wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
+
        hw->sta_data_size = sizeof(struct mt76x02_sta);
        hw->vif_data_size = sizeof(struct mt76x02_vif);