diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2021-01-26 12:13:56 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2021-01-29 15:18:26 +0100 |
commit | 1755f6ad0fe0f04a958039b05f8fb38c5217f01b (patch) | |
tree | d88c893b5f016c26a9cb1cfa425062089f5e7ed9 /drivers/net/wireless/mediatek/mt76/mt76_connac.h | |
parent | b7dd3c2e58e674b03c7fd820024bc228e383c56e (diff) | |
download | linux-1755f6ad0fe0f04a958039b05f8fb38c5217f01b.tar.bz2 |
mt76: mt76_connac: move pm utility routines in mt76_connac_lib module
Move power_save common code shared between mt7663 and mt7921 in
mt76_connac module
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76_connac.h')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt76_connac.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac.h b/drivers/net/wireless/mediatek/mt76/mt76_connac.h index a20dc558e8f5..15a7b0a06053 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac.h @@ -59,4 +59,33 @@ struct mt76_connac_pm { extern const struct wiphy_wowlan_support mt76_connac_wowlan_support; +int mt76_connac_pm_wake(struct mt76_phy *phy, struct mt76_connac_pm *pm); +void mt76_connac_power_save_sched(struct mt76_phy *phy, + struct mt76_connac_pm *pm); +void mt76_connac_free_pending_tx_skbs(struct mt76_connac_pm *pm, + struct mt76_wcid *wcid); + +static inline void +mt76_connac_mutex_acquire(struct mt76_dev *dev, struct mt76_connac_pm *pm) + __acquires(&dev->mutex) +{ + mutex_lock(&dev->mutex); + mt76_connac_pm_wake(&dev->phy, pm); +} + +static inline void +mt76_connac_mutex_release(struct mt76_dev *dev, struct mt76_connac_pm *pm) + __releases(&dev->mutex) +{ + mt76_connac_power_save_sched(&dev->phy, pm); + mutex_unlock(&dev->mutex); +} + +void mt76_connac_pm_queue_skb(struct ieee80211_hw *hw, + struct mt76_connac_pm *pm, + struct mt76_wcid *wcid, + struct sk_buff *skb); +void mt76_connac_pm_dequeue_skbs(struct mt76_phy *phy, + struct mt76_connac_pm *pm); + #endif /* __MT76_CONNAC_H */ |