mt76x02: use commmon add interface for mt76x2u
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 30 Jan 2019 16:02:14 +0000 (17:02 +0100)
committerFelix Fietkau <nbd@nbd.name>
Mon, 18 Feb 2019 18:54:32 +0000 (19:54 +0100)
Since we now support mt76x2u feature to allow set mac address
when creating interface in common code we can use it for
mt76x2u.

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

index be07744..6d9d9dd 100644 (file)
@@ -130,8 +130,7 @@ void mt76x02_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
                        struct ieee80211_sta *sta);
 
 void mt76x02_config_mac_addr_list(struct mt76x02_dev *dev);
-void mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif,
-                     unsigned int idx);
+
 int mt76x02_add_interface(struct ieee80211_hw *hw,
                         struct ieee80211_vif *vif);
 void mt76x02_remove_interface(struct ieee80211_hw *hw,
index c934009..18434b0 100644 (file)
@@ -268,8 +268,9 @@ void mt76x02_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
 }
 EXPORT_SYMBOL_GPL(mt76x02_sta_remove);
 
-void mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif,
-                     unsigned int idx)
+static void
+mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif,
+                unsigned int idx)
 {
        struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
        struct mt76_txq *mtxq;
@@ -282,7 +283,6 @@ void mt76x02_vif_init(struct mt76x02_dev *dev, struct ieee80211_vif *vif,
 
        mt76_txq_init(&dev->mt76, vif->txq);
 }
-EXPORT_SYMBOL_GPL(mt76x02_vif_init);
 
 int
 mt76x02_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
index 286c7f4..5256c6f 100644 (file)
@@ -46,19 +46,6 @@ static void mt76x2u_stop(struct ieee80211_hw *hw)
        mutex_unlock(&dev->mt76.mutex);
 }
 
-static int mt76x2u_add_interface(struct ieee80211_hw *hw,
-                                struct ieee80211_vif *vif)
-{
-       struct mt76x02_dev *dev = hw->priv;
-       unsigned int idx = 8;
-
-       if (!ether_addr_equal(dev->mt76.macaddr, vif->addr))
-               mt76x02_mac_setaddr(dev, vif->addr);
-
-       mt76x02_vif_init(dev, vif, idx);
-       return 0;
-}
-
 static int
 mt76x2u_set_channel(struct mt76x02_dev *dev,
                    struct cfg80211_chan_def *chandef)
@@ -125,7 +112,7 @@ const struct ieee80211_ops mt76x2u_ops = {
        .tx = mt76x02_tx,
        .start = mt76x2u_start,
        .stop = mt76x2u_stop,
-       .add_interface = mt76x2u_add_interface,
+       .add_interface = mt76x02_add_interface,
        .remove_interface = mt76x02_remove_interface,
        .sta_state = mt76_sta_state,
        .set_key = mt76x02_set_key,