main.c (bd1e3e7b693c17a04e7d2bd9119daa482b7c7720) main.c (8910a4e5ba342ad661acb6f99fa14e0dd809465e)
1// SPDX-License-Identifier: ISC
2/* Copyright (C) 2020 MediaTek Inc. */
3
4#include <linux/etherdevice.h>
5#include <linux/platform_device.h>
6#include <linux/pci.h>
7#include <linux/module.h>
8#include "mt7921.h"

--- 223 unchanged lines hidden (view full) ---

232 mt7921_mac_reset_counters(phy);
233 set_bit(MT76_STATE_RUNNING, &mphy->state);
234
235 ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
236 MT7921_WATCHDOG_TIME);
237
238 return 0;
239}
1// SPDX-License-Identifier: ISC
2/* Copyright (C) 2020 MediaTek Inc. */
3
4#include <linux/etherdevice.h>
5#include <linux/platform_device.h>
6#include <linux/pci.h>
7#include <linux/module.h>
8#include "mt7921.h"

--- 223 unchanged lines hidden (view full) ---

232 mt7921_mac_reset_counters(phy);
233 set_bit(MT76_STATE_RUNNING, &mphy->state);
234
235 ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
236 MT7921_WATCHDOG_TIME);
237
238 return 0;
239}
240EXPORT_SYMBOL_GPL(__mt7921_start);
240
241static int mt7921_start(struct ieee80211_hw *hw)
242{
243 struct mt7921_phy *phy = mt7921_hw_phy(hw);
244 int err;
245
246 mt7921_mutex_acquire(phy->dev);
247 err = __mt7921_start(phy);

--- 393 unchanged lines hidden (view full) ---

641 MT76_STA_INFO_STATE_NONE);
642 if (ret)
643 return ret;
644
645 mt76_connac_power_save_sched(&dev->mphy, &dev->pm);
646
647 return 0;
648}
241
242static int mt7921_start(struct ieee80211_hw *hw)
243{
244 struct mt7921_phy *phy = mt7921_hw_phy(hw);
245 int err;
246
247 mt7921_mutex_acquire(phy->dev);
248 err = __mt7921_start(phy);

--- 393 unchanged lines hidden (view full) ---

642 MT76_STA_INFO_STATE_NONE);
643 if (ret)
644 return ret;
645
646 mt76_connac_power_save_sched(&dev->mphy, &dev->pm);
647
648 return 0;
649}
650EXPORT_SYMBOL_GPL(mt7921_mac_sta_add);
649
650void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
651 struct ieee80211_sta *sta)
652{
653 struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
654 struct mt7921_sta *msta = (struct mt7921_sta *)sta->drv_priv;
655 struct mt7921_vif *mvif = (struct mt7921_vif *)vif->drv_priv;
656

--- 5 unchanged lines hidden (view full) ---

662
663 mt7921_mac_wtbl_update(dev, msta->wcid.idx,
664 MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
665
666 mt7921_mcu_sta_update(dev, sta, vif, true, MT76_STA_INFO_STATE_ASSOC);
667
668 mt7921_mutex_release(dev);
669}
651
652void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
653 struct ieee80211_sta *sta)
654{
655 struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
656 struct mt7921_sta *msta = (struct mt7921_sta *)sta->drv_priv;
657 struct mt7921_vif *mvif = (struct mt7921_vif *)vif->drv_priv;
658

--- 5 unchanged lines hidden (view full) ---

664
665 mt7921_mac_wtbl_update(dev, msta->wcid.idx,
666 MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
667
668 mt7921_mcu_sta_update(dev, sta, vif, true, MT76_STA_INFO_STATE_ASSOC);
669
670 mt7921_mutex_release(dev);
671}
672EXPORT_SYMBOL_GPL(mt7921_mac_sta_assoc);
670
671void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
672 struct ieee80211_sta *sta)
673{
674 struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
675 struct mt7921_sta *msta = (struct mt7921_sta *)sta->drv_priv;
676
677 mt76_connac_free_pending_tx_skbs(&dev->pm, &msta->wcid);

--- 15 unchanged lines hidden (view full) ---

693
694 spin_lock_bh(&dev->sta_poll_lock);
695 if (!list_empty(&msta->poll_list))
696 list_del_init(&msta->poll_list);
697 spin_unlock_bh(&dev->sta_poll_lock);
698
699 mt76_connac_power_save_sched(&dev->mphy, &dev->pm);
700}
673
674void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
675 struct ieee80211_sta *sta)
676{
677 struct mt7921_dev *dev = container_of(mdev, struct mt7921_dev, mt76);
678 struct mt7921_sta *msta = (struct mt7921_sta *)sta->drv_priv;
679
680 mt76_connac_free_pending_tx_skbs(&dev->pm, &msta->wcid);

--- 15 unchanged lines hidden (view full) ---

696
697 spin_lock_bh(&dev->sta_poll_lock);
698 if (!list_empty(&msta->poll_list))
699 list_del_init(&msta->poll_list);
700 spin_unlock_bh(&dev->sta_poll_lock);
701
702 mt76_connac_power_save_sched(&dev->mphy, &dev->pm);
703}
704EXPORT_SYMBOL_GPL(mt7921_mac_sta_remove);
701
702void mt7921_tx_worker(struct mt76_worker *w)
703{
704 struct mt7921_dev *dev = container_of(w, struct mt7921_dev,
705 mt76.tx_worker);
706
707 if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) {
708 queue_work(dev->mt76.wq, &dev->pm.wake_work);

--- 536 unchanged lines hidden (view full) ---

1245 .suspend = mt7921_suspend,
1246 .resume = mt7921_resume,
1247 .set_wakeup = mt7921_set_wakeup,
1248 .set_rekey_data = mt7921_set_rekey_data,
1249#endif /* CONFIG_PM */
1250 .flush = mt7921_flush,
1251 .set_sar_specs = mt7921_set_sar_specs,
1252};
705
706void mt7921_tx_worker(struct mt76_worker *w)
707{
708 struct mt7921_dev *dev = container_of(w, struct mt7921_dev,
709 mt76.tx_worker);
710
711 if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) {
712 queue_work(dev->mt76.wq, &dev->pm.wake_work);

--- 536 unchanged lines hidden (view full) ---

1249 .suspend = mt7921_suspend,
1250 .resume = mt7921_resume,
1251 .set_wakeup = mt7921_set_wakeup,
1252 .set_rekey_data = mt7921_set_rekey_data,
1253#endif /* CONFIG_PM */
1254 .flush = mt7921_flush,
1255 .set_sar_specs = mt7921_set_sar_specs,
1256};
1257EXPORT_SYMBOL_GPL(mt7921_ops);
1258
1259MODULE_LICENSE("Dual BSD/GPL");
1260MODULE_AUTHOR("Sean Wang <sean.wang@mediatek.com>");