Lines Matching refs:dev
18 mt792x_mutex_acquire(phy->dev); in mt792x_mac_work()
27 mt792x_mutex_release(phy->dev); in mt792x_mac_work()
29 mt76_tx_status_check(mphy->dev, false); in mt792x_mac_work()
38 struct mt792x_dev *dev = phy->dev; in mt792x_mac_set_timeing() local
50 mt76_set(dev, MT_ARB_SCR(0), in mt792x_mac_set_timeing()
58 mt76_wr(dev, MT_TMAC_CDTR(0), cck + reg_offset); in mt792x_mac_set_timeing()
59 mt76_wr(dev, MT_TMAC_ODTR(0), ofdm + reg_offset); in mt792x_mac_set_timeing()
60 mt76_wr(dev, MT_TMAC_ICR0(0), in mt792x_mac_set_timeing()
71 mt76_rmw_field(dev, MT_AGG_ACR0(0), MT_AGG_ACR_CFEND_RATE, val); in mt792x_mac_set_timeing()
72 mt76_clear(dev, MT_ARB_SCR(0), in mt792x_mac_set_timeing()
80 struct mt792x_dev *dev = phy->dev; in mt792x_mac_update_mib_stats() local
84 mib->fcs_err_cnt += mt76_get_field(dev, MT_MIB_SDR3(0), in mt792x_mac_update_mib_stats()
86 mib->ack_fail_cnt += mt76_get_field(dev, MT_MIB_MB_BSDR3(0), in mt792x_mac_update_mib_stats()
88 mib->ba_miss_cnt += mt76_get_field(dev, MT_MIB_MB_BSDR2(0), in mt792x_mac_update_mib_stats()
90 mib->rts_cnt += mt76_get_field(dev, MT_MIB_MB_BSDR0(0), in mt792x_mac_update_mib_stats()
92 mib->rts_retries_cnt += mt76_get_field(dev, MT_MIB_MB_BSDR1(0), in mt792x_mac_update_mib_stats()
95 mib->tx_ampdu_cnt += mt76_rr(dev, MT_MIB_SDR12(0)); in mt792x_mac_update_mib_stats()
96 mib->tx_mpdu_attempts_cnt += mt76_rr(dev, MT_MIB_SDR14(0)); in mt792x_mac_update_mib_stats()
97 mib->tx_mpdu_success_cnt += mt76_rr(dev, MT_MIB_SDR15(0)); in mt792x_mac_update_mib_stats()
99 val = mt76_rr(dev, MT_MIB_SDR32(0)); in mt792x_mac_update_mib_stats()
103 val = mt76_rr(dev, MT_ETBF_TX_APP_CNT(0)); in mt792x_mac_update_mib_stats()
107 val = mt76_rr(dev, MT_ETBF_RX_FB_CNT(0)); in mt792x_mac_update_mib_stats()
113 mib->rx_mpdu_cnt += mt76_rr(dev, MT_MIB_SDR5(0)); in mt792x_mac_update_mib_stats()
114 mib->rx_ampdu_cnt += mt76_rr(dev, MT_MIB_SDR22(0)); in mt792x_mac_update_mib_stats()
115 mib->rx_ampdu_bytes_cnt += mt76_rr(dev, MT_MIB_SDR23(0)); in mt792x_mac_update_mib_stats()
116 mib->rx_ba_cnt += mt76_rr(dev, MT_MIB_SDR31(0)); in mt792x_mac_update_mib_stats()
119 val = mt76_rr(dev, MT_PLE_AMSDU_PACK_MSDU_CNT(i)); in mt792x_mac_update_mib_stats()
127 val = mt76_rr(dev, MT_TX_AGG_CNT(0, i)); in mt792x_mac_update_mib_stats()
128 val2 = mt76_rr(dev, MT_TX_AGG_CNT2(0, i)); in mt792x_mac_update_mib_stats()
138 struct mt76_wcid *mt792x_rx_get_wcid(struct mt792x_dev *dev, u16 idx, in mt792x_rx_get_wcid() argument
144 if (idx >= ARRAY_SIZE(dev->mt76.wcid)) in mt792x_rx_get_wcid()
147 wcid = rcu_dereference(dev->mt76.wcid[idx]); in mt792x_rx_get_wcid()
179 void mt792x_mac_assoc_rssi(struct mt792x_dev *dev, struct sk_buff *skb) in mt792x_mac_assoc_rssi() argument
187 ieee80211_iterate_active_interfaces_atomic(mt76_hw(dev), in mt792x_mac_assoc_rssi()
195 struct mt792x_dev *dev = phy->dev; in mt792x_mac_reset_counters() local
199 mt76_rr(dev, MT_TX_AGG_CNT(0, i)); in mt792x_mac_reset_counters()
200 mt76_rr(dev, MT_TX_AGG_CNT2(0, i)); in mt792x_mac_reset_counters()
203 dev->mt76.phy.survey_time = ktime_get_boottime(); in mt792x_mac_reset_counters()
207 mt76_rr(dev, MT_MIB_SDR9(0)); in mt792x_mac_reset_counters()
208 mt76_rr(dev, MT_MIB_SDR36(0)); in mt792x_mac_reset_counters()
209 mt76_rr(dev, MT_MIB_SDR37(0)); in mt792x_mac_reset_counters()
211 mt76_set(dev, MT_WF_RMAC_MIB_TIME0(0), MT_WF_RMAC_MIB_RXTIME_CLR); in mt792x_mac_reset_counters()
212 mt76_set(dev, MT_WF_RMAC_MIB_AIRTIME0(0), MT_WF_RMAC_MIB_RXTIME_CLR); in mt792x_mac_reset_counters()
225 struct mt792x_dev *dev = container_of(mphy->dev, struct mt792x_dev, mt76); in mt792x_phy_update_channel() local
231 busy_time = mt76_get_field(dev, MT_MIB_SDR9(idx), in mt792x_phy_update_channel()
233 tx_time = mt76_get_field(dev, MT_MIB_SDR36(idx), in mt792x_phy_update_channel()
235 rx_time = mt76_get_field(dev, MT_MIB_SDR37(idx), in mt792x_phy_update_channel()
237 obss_time = mt76_get_field(dev, MT_WF_RMAC_MIB_AIRTIME14(idx), in mt792x_phy_update_channel()
256 struct mt792x_dev *dev = container_of(mphy->dev, struct mt792x_dev, mt76); in mt792x_update_channel() local
258 if (mt76_connac_pm_wake(mphy, &dev->pm)) in mt792x_update_channel()
263 mt76_set(dev, MT_WF_RMAC_MIB_TIME0(0), MT_WF_RMAC_MIB_RXTIME_CLR); in mt792x_update_channel()
264 mt76_connac_power_save_sched(mphy, &dev->pm); in mt792x_update_channel()
270 struct mt792x_dev *dev = container_of(mdev, struct mt792x_dev, mt76); in mt792x_reset() local
271 struct mt76_connac_pm *pm = &dev->pm; in mt792x_reset()
273 if (!dev->hw_init_done) in mt792x_reset()
276 if (dev->hw_full_reset) in mt792x_reset()
282 queue_work(dev->mt76.wq, &dev->reset_work); in mt792x_reset()
286 void mt792x_mac_init_band(struct mt792x_dev *dev, u8 band) in mt792x_mac_init_band() argument
290 mt76_rmw_field(dev, MT_TMAC_CTCR0(band), in mt792x_mac_init_band()
292 mt76_set(dev, MT_TMAC_CTCR0(band), in mt792x_mac_init_band()
296 mt76_set(dev, MT_WF_RMAC_MIB_TIME0(band), MT_WF_RMAC_MIB_RXTIME_EN); in mt792x_mac_init_band()
297 mt76_set(dev, MT_WF_RMAC_MIB_AIRTIME0(band), MT_WF_RMAC_MIB_RXTIME_EN); in mt792x_mac_init_band()
300 mt76_set(dev, MT_MIB_SCR1(band), MT_MIB_TXDUR_EN); in mt792x_mac_init_band()
301 mt76_set(dev, MT_MIB_SCR1(band), MT_MIB_RXDUR_EN); in mt792x_mac_init_band()
303 mt76_rmw_field(dev, MT_DMA_DCR0(band), MT_DMA_DCR0_MAX_RX_LEN, 1536); in mt792x_mac_init_band()
305 mt76_clear(dev, MT_DMA_DCR0(band), MT_DMA_DCR0_RXD_G5_EN); in mt792x_mac_init_band()
311 mt76_rmw(dev, MT_WTBLOFF_TOP_RSCR(band), mask, set); in mt792x_mac_init_band()
317 struct mt792x_dev *dev; in mt792x_pm_wake_work() local
320 dev = (struct mt792x_dev *)container_of(work, struct mt792x_dev, in mt792x_pm_wake_work()
322 mphy = dev->phy.mt76; in mt792x_pm_wake_work()
324 if (!mt792x_mcu_drv_pmctrl(dev)) { in mt792x_pm_wake_work()
325 struct mt76_dev *mdev = &dev->mt76; in mt792x_pm_wake_work()
329 mt76_connac_pm_dequeue_skbs(mphy, &dev->pm); in mt792x_pm_wake_work()
336 mt76_connac_pm_dequeue_skbs(mphy, &dev->pm); in mt792x_pm_wake_work()
345 wake_up(&dev->pm.wait); in mt792x_pm_wake_work()
351 struct mt792x_dev *dev; in mt792x_pm_power_save_work() local
355 dev = (struct mt792x_dev *)container_of(work, struct mt792x_dev, in mt792x_pm_power_save_work()
357 mphy = dev->phy.mt76; in mt792x_pm_power_save_work()
359 delta = dev->pm.idle_timeout; in mt792x_pm_power_save_work()
362 dev->fw_assert) in mt792x_pm_power_save_work()
365 if (mutex_is_locked(&dev->mt76.mutex)) in mt792x_pm_power_save_work()
373 if (time_is_after_jiffies(dev->pm.last_activity + delta)) { in mt792x_pm_power_save_work()
374 delta = dev->pm.last_activity + delta - jiffies; in mt792x_pm_power_save_work()
378 if (!mt792x_mcu_fw_pmctrl(dev)) { in mt792x_pm_power_save_work()
383 queue_delayed_work(dev->mt76.wq, &dev->pm.ps_work, delta); in mt792x_pm_power_save_work()