]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mt76: move mt76x02_sta_ps in mt76x02-lib module
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Sat, 20 Oct 2018 10:13:30 +0000 (12:13 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 30 Nov 2018 11:21:41 +0000 (12:21 +0100)
Move mt76x02_sta_ps utility routine in mt76x02_util.c
in order to be reused by mt76x0 driver adding AP support

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
drivers/net/wireless/mediatek/mt76/mt76x02.h
drivers/net/wireless/mediatek/mt76/mt76x02_util.c
drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h
drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c

index 4d4800d09da6eceeead0a6517879ce262b8379af..4deaf7f7c4f74e1cd420ba7156765d2516dbf5db 100644 (file)
@@ -142,6 +142,7 @@ mt76x0e_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                .tx_complete_skb = mt76x02_tx_complete_skb,
                .rx_skb = mt76x02_queue_rx_skb,
                .rx_poll_complete = mt76x02_rx_poll_complete,
+               .sta_ps = mt76x02_sta_ps,
        };
        struct mt76x02_dev *dev;
        int ret;
index f830e39b58e74205db179ca2b4d7a4ac749027ea..1733226b657d50abe31ba7a03353dce06e1b50ef 100644 (file)
@@ -153,6 +153,7 @@ void mt76x02_sw_scan_complete(struct ieee80211_hw *hw,
                              struct ieee80211_vif *vif);
 int mt76x02_get_txpower(struct ieee80211_hw *hw,
                        struct ieee80211_vif *vif, int *dbm);
+void mt76x02_sta_ps(struct mt76_dev *dev, struct ieee80211_sta *sta, bool ps);
 
 extern const u16 mt76x02_beacon_offsets[16];
 void mt76x02_set_beacon_offsets(struct mt76x02_dev *dev);
index 25f36e333b9bb8a662e0bd3ba96a62ecbb27bd4a..4e358066bf9b5259a484ad41c10cee37e0b7c704 100644 (file)
@@ -526,6 +526,18 @@ int mt76x02_get_txpower(struct ieee80211_hw *hw,
 }
 EXPORT_SYMBOL_GPL(mt76x02_get_txpower);
 
+void mt76x02_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta,
+                   bool ps)
+{
+       struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76);
+       struct mt76x02_sta *msta = (struct mt76x02_sta *)sta->drv_priv;
+       int idx = msta->wcid.idx;
+
+       mt76_stop_tx_queues(&dev->mt76, sta, true);
+       mt76x02_mac_wcid_set_drop(dev, idx, ps);
+}
+EXPORT_SYMBOL_GPL(mt76x02_sta_ps);
+
 const u16 mt76x02_beacon_offsets[16] = {
        /* 1024 byte per beacon */
        0xc000,
index 2bae70c63ab0178fd00623cf7acae676be02f499..0c323a0762e817513a9a8787f0c315c418c23ae8 100644 (file)
@@ -77,8 +77,6 @@ void mt76x2_cleanup(struct mt76x02_dev *dev);
 
 void mt76x2_mac_set_tx_protection(struct mt76x02_dev *dev, u32 val);
 
-void mt76x2_sta_ps(struct mt76_dev *dev, struct ieee80211_sta *sta, bool ps);
-
 void mt76x2_reset_wlan(struct mt76x02_dev *dev, bool enable);
 void mt76x2_init_txpower(struct mt76x02_dev *dev,
                         struct ieee80211_supported_band *sband);
index c5d5fcbd9a5540f5b771e2498f396d643a9544cb..c3c2f4441777ce6afc11a33b99f4e2cbab260928 100644 (file)
@@ -356,7 +356,7 @@ struct mt76x02_dev *mt76x2_alloc_device(struct device *pdev)
                .tx_complete_skb = mt76x02_tx_complete_skb,
                .rx_skb = mt76x02_queue_rx_skb,
                .rx_poll_complete = mt76x02_rx_poll_complete,
-               .sta_ps = mt76x2_sta_ps,
+               .sta_ps = mt76x02_sta_ps,
        };
        struct mt76x02_dev *dev;
        struct mt76_dev *mdev;
index 5dfd06e56636f9f7b7ab55b7f1a62006a6cbfb34..b2c599d4d67095486557a3c45ed2b16286260330 100644 (file)
@@ -164,17 +164,6 @@ mt76x2_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        mutex_unlock(&dev->mt76.mutex);
 }
 
-void
-mt76x2_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps)
-{
-       struct mt76x02_sta *msta = (struct mt76x02_sta *) sta->drv_priv;
-       struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, mt76);
-       int idx = msta->wcid.idx;
-
-       mt76_stop_tx_queues(&dev->mt76, sta, true);
-       mt76x02_mac_wcid_set_drop(dev, idx, ps);
-}
-
 static void
 mt76x2_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
             u32 queues, bool drop)