]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mt76: unify mt76x02_vif struct
authorStanislaw Gruszka <sgruszka@redhat.com>
Wed, 29 Aug 2018 11:16:43 +0000 (13:16 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 4 Sep 2018 08:03:14 +0000 (11:03 +0300)
Private vif structures definitions are the same for mt76x2 and mt76x0.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
13 files changed:
drivers/net/wireless/mediatek/mt76/mt76x0/init.c
drivers/net/wireless/mediatek/mt76/mt76x0/main.c
drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h
drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
drivers/net/wireless/mediatek/mt76/mt76x2.h
drivers/net/wireless/mediatek/mt76/mt76x2_common.c
drivers/net/wireless/mediatek/mt76/mt76x2_init_common.c
drivers/net/wireless/mediatek/mt76/mt76x2_mac.h
drivers/net/wireless/mediatek/mt76/mt76x2_main.c
drivers/net/wireless/mediatek/mt76/mt76x2_tx.c
drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c
drivers/net/wireless/mediatek/mt76/mt76x2u_main.c

index 33924643946de34fd49514e7d43258f73433a4e2..41c9c7b5deea0aad638d2422b7e799b91f823b89 100644 (file)
@@ -689,7 +689,7 @@ int mt76x0_register_device(struct mt76x0_dev *dev)
        hw->max_rate_tries = 1;
 
        hw->sta_data_size = sizeof(struct mt76_sta);
-       hw->vif_data_size = sizeof(struct mt76_vif);
+       hw->vif_data_size = sizeof(struct mt76x02_vif);
 
        SET_IEEE80211_PERM_ADDR(hw, dev->macaddr);
 
index 66e8389d489f71289f25e73400733646e70767e9..1cf06bffaa717bba9057a04260217f6052a103bc 100644 (file)
@@ -56,7 +56,7 @@ static int mt76x0_add_interface(struct ieee80211_hw *hw,
                                 struct ieee80211_vif *vif)
 {
        struct mt76x0_dev *dev = hw->priv;
-       struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
        unsigned int idx;
 
        idx = ffs(~dev->vif_mask);
@@ -77,7 +77,7 @@ static void mt76x0_remove_interface(struct ieee80211_hw *hw,
                                     struct ieee80211_vif *vif)
 {
        struct mt76x0_dev *dev = hw->priv;
-       struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
        unsigned int wcid = mvif->group_wcid.idx;
 
        dev->wcid_mask[wcid / BITS_PER_LONG] &= ~BIT(wcid % BITS_PER_LONG);
@@ -160,7 +160,7 @@ mt76x0_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 {
        struct mt76x0_dev *dev = hw->priv;
        struct mt76_sta *msta = (struct mt76_sta *) sta->drv_priv;
-       struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
        int ret = 0;
        int idx = 0;
 
@@ -242,7 +242,7 @@ mt76x0_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                struct ieee80211_key_conf *key)
 {
        struct mt76x0_dev *dev = hw->priv;
-       struct mt76_vif *mvif = (struct mt76_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
        struct mt76_sta *msta = sta ? (struct mt76_sta *) sta->drv_priv : NULL;
        struct mt76_wcid *wcid = msta ? &msta->wcid : &mvif->group_wcid;
        int idx = key->keyidx;
index 7ad68dc2df303462dbeaa9dff537cafbaf0440c6..a1b9a705b1737354e49b76f78545978b9ef23df8 100644 (file)
@@ -219,12 +219,6 @@ struct mt76x0_wcid {
        u8 tx_rate_nss;
 };
 
-struct mt76_vif {
-       u8 idx;
-
-       struct mt76_wcid group_wcid;
-};
-
 struct mt76_tx_status {
        u8 valid:1;
        u8 success:1;
index c45d05d5aab1d207fb319d6bc43da72e36a2a134..0c0ac2283c35c53ab3e665e8c65fb1d26a825aed 100644 (file)
@@ -167,7 +167,7 @@ void mt76x0_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
                msta = (struct mt76_sta *) sta->drv_priv;
                wcid = &msta->wcid;
        } else if (vif && (!info->control.hw_key && wcid->hw_key_idx != 0xff)) {
-               struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
+               struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
 
                wcid = &mvif->group_wcid;
        }
index 7dc11cf70f7e089f53f1e84ed440af6d7c195c13..fa9532cdf6b754173f98ba922ac2c0bd998922da 100644 (file)
 #ifndef __MT76X02_MAC_H
 #define __MT76X02_MAC_H
 
+struct mt76x02_vif {
+       u8 idx;
+
+       struct mt76_wcid group_wcid;
+};
+
 static inline bool mt76x02_wait_for_mac(struct mt76_dev *dev)
 {
        const u32 MAC_CSR0 = 0x1000;
index e9b57fce968518bc4d261f2882fbae5e90507c68..703d5c041b2a1a241c2639cdd1fba72768ddcb55 100644 (file)
@@ -144,16 +144,10 @@ struct mt76x2_dev {
        struct mt76x2_dfs_pattern_detector dfs_pd;
 };
 
-struct mt76x2_vif {
-       u8 idx;
-
-       struct mt76_wcid group_wcid;
-};
-
 struct mt76x2_sta {
        struct mt76_wcid wcid; /* must be first */
 
-       struct mt76x2_vif *vif;
+       struct mt76x02_vif *vif;
        struct mt76x2_tx_status status;
        int n_frames;
 
index 9ef692930d89d9aa55a902db0551f4ae03d8cfac..93e6e57f1ba35fbb8013e0360a8ca313f9b5511d 100644 (file)
@@ -32,9 +32,9 @@ void mt76x2_txq_init(struct mt76x2_dev *dev, struct ieee80211_txq *txq)
                sta = (struct mt76x2_sta *) txq->sta->drv_priv;
                mtxq->wcid = &sta->wcid;
        } else {
-               struct mt76x2_vif *mvif;
+               struct mt76x02_vif *mvif;
 
-               mvif = (struct mt76x2_vif *) txq->vif->drv_priv;
+               mvif = (struct mt76x02_vif *) txq->vif->drv_priv;
                mtxq->wcid = &mvif->group_wcid;
        }
 
@@ -98,7 +98,7 @@ int mt76x2_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 {
        struct mt76x2_dev *dev = hw->priv;
        struct mt76x2_sta *msta = (struct mt76x2_sta *) sta->drv_priv;
-       struct mt76x2_vif *mvif = (struct mt76x2_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
        int ret = 0;
        int idx = 0;
        int i;
@@ -169,7 +169,7 @@ int mt76x2_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                   struct ieee80211_key_conf *key)
 {
        struct mt76x2_dev *dev = hw->priv;
-       struct mt76x2_vif *mvif = (struct mt76x2_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
        struct mt76x2_sta *msta;
        struct mt76_wcid *wcid;
        int idx = key->keyidx;
index 324b2a4b8b67cf3bec9c4006a37063f2bad75a31..5885c4fff4c69b4b7a989927219ed4a5e88f6aeb 100644 (file)
@@ -209,7 +209,7 @@ void mt76x2_init_device(struct mt76x2_dev *dev)
        hw->extra_tx_headroom = 2;
 
        hw->sta_data_size = sizeof(struct mt76x2_sta);
-       hw->vif_data_size = sizeof(struct mt76x2_vif);
+       hw->vif_data_size = sizeof(struct mt76x02_vif);
 
        ieee80211_hw_set(hw, SUPPORTS_HT_CCK_RATES);
        ieee80211_hw_set(hw, SUPPORTS_REORDERING_BUFFER);
index ad22d375c847a88602aae92f4070a6930ea32dd3..5e29887e443b2b39fb9bb26d5d7abe40a1b67b55 100644 (file)
@@ -22,7 +22,7 @@
 
 struct mt76x2_dev;
 struct mt76x2_sta;
-struct mt76x2_vif;
+struct mt76x02_vif;
 struct mt76x2_txwi;
 
 struct mt76x2_tx_status {
index 7d2b4a4195664dba739e6f2867530fa1ee807ca8..80d33bca7f9060a62e5afbdd4c77d6f79a51a6b4 100644 (file)
@@ -58,7 +58,7 @@ static int
 mt76x2_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 {
        struct mt76x2_dev *dev = hw->priv;
-       struct mt76x2_vif *mvif = (struct mt76x2_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
        unsigned int idx = 0;
 
        if (vif->addr[0] & BIT(1))
@@ -167,7 +167,7 @@ mt76x2_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
                        struct ieee80211_bss_conf *info, u32 changed)
 {
        struct mt76x2_dev *dev = hw->priv;
-       struct mt76x2_vif *mvif = (struct mt76x2_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
 
        mutex_lock(&dev->mt76.mutex);
 
index 6874db52b846940290750a66277160275d8a87fb..5338e8efa6064a9b567f0e70e34dfc1115dd16c5 100644 (file)
@@ -58,7 +58,7 @@ static void
 mt76x2_update_beacon_iter(void *priv, u8 *mac, struct ieee80211_vif *vif)
 {
        struct mt76x2_dev *dev = (struct mt76x2_dev *) priv;
-       struct mt76x2_vif *mvif = (struct mt76x2_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
        struct sk_buff *skb = NULL;
 
        if (!(dev->beacon_mask & BIT(mvif->idx)))
@@ -76,7 +76,7 @@ mt76x2_add_buffered_bc(void *priv, u8 *mac, struct ieee80211_vif *vif)
 {
        struct beacon_bc_data *data = priv;
        struct mt76x2_dev *dev = data->dev;
-       struct mt76x2_vif *mvif = (struct mt76x2_vif *) vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
        struct ieee80211_tx_info *info;
        struct sk_buff *skb;
 
@@ -164,7 +164,7 @@ void mt76x2_pre_tbtt_tasklet(unsigned long arg)
        while ((skb = __skb_dequeue(&data.q)) != NULL) {
                struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
                struct ieee80211_vif *vif = info->control.vif;
-               struct mt76x2_vif *mvif = (struct mt76x2_vif *) vif->drv_priv;
+               struct mt76x02_vif *mvif = (struct mt76x02_vif *) vif->drv_priv;
 
                mt76_dma_tx_queue_skb(&dev->mt76, q, skb, &mvif->group_wcid,
                                      NULL);
index c0ca0df84ed8b86aa029c5edbe554f53888fe4cd..16086ad12320d8b4e791f0eb2a666a953e35b7b4 100644 (file)
@@ -37,9 +37,9 @@ void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
        }
 
        if (vif && !control->sta) {
-               struct mt76x2_vif *mvif;
+               struct mt76x02_vif *mvif;
 
-               mvif = (struct mt76x2_vif *)vif->drv_priv;
+               mvif = (struct mt76x02_vif *)vif->drv_priv;
                wcid = &mvif->group_wcid;
        }
 
index 9180debc09465f31305716d82ced73d66af21610..fde334877bc598a0ff5d83b0d69a122505b3b29c 100644 (file)
@@ -49,7 +49,7 @@ static int mt76x2u_add_interface(struct ieee80211_hw *hw,
                                 struct ieee80211_vif *vif)
 {
        struct mt76x2_dev *dev = hw->priv;
-       struct mt76x2_vif *mvif = (struct mt76x2_vif *)vif->drv_priv;
+       struct mt76x02_vif *mvif = (struct mt76x02_vif *)vif->drv_priv;
        unsigned int idx = 0;
 
        if (!ether_addr_equal(dev->mt76.macaddr, vif->addr))