Lines Matching +full:txrx +full:-
1 // SPDX-License-Identifier: ISC
32 if (!mt76_connac_pm_ref(&dev->mphy, &dev->pm)) { in mt7921s_txrx_worker()
33 queue_work(mdev->wq, &dev->pm.wake_work); in mt7921s_txrx_worker()
38 mt76_connac_pm_unref(&dev->mphy, &dev->pm); in mt7921s_txrx_worker()
43 struct mt76_connac_pm *pm = &dev->pm; in mt7921s_unregister_device()
45 cancel_work_sync(&dev->init_work); in mt7921s_unregister_device()
46 mt76_unregister_device(&dev->mt76); in mt7921s_unregister_device()
47 cancel_delayed_work_sync(&pm->ps_work); in mt7921s_unregister_device()
48 cancel_work_sync(&pm->wake_work); in mt7921s_unregister_device()
50 mt76s_deinit(&dev->mt76); in mt7921s_unregister_device()
52 skb_queue_purge(&dev->mt76.mcu.res_q); in mt7921s_unregister_device()
54 mt76_free_device(&dev->mt76); in mt7921s_unregister_device()
59 struct mt76_sdio *sdio = &dev->sdio; in mt7921s_parse_intr()
60 struct mt7921_sdio_intr *irq_data = sdio->intr_data; in mt7921s_parse_intr()
63 sdio_claim_host(sdio->func); in mt7921s_parse_intr()
64 err = sdio_readsb(sdio->func, irq_data, MCR_WHISR, sizeof(*irq_data)); in mt7921s_parse_intr()
65 sdio_release_host(sdio->func); in mt7921s_parse_intr()
70 if (irq_data->rx.num[0] > 16 || in mt7921s_parse_intr()
71 irq_data->rx.num[1] > 128) in mt7921s_parse_intr()
72 return -EINVAL; in mt7921s_parse_intr()
74 intr->isr = irq_data->isr; in mt7921s_parse_intr()
75 intr->rec_mb = irq_data->rec_mb; in mt7921s_parse_intr()
76 intr->tx.wtqcr = irq_data->tx.wtqcr; in mt7921s_parse_intr()
77 intr->rx.num = irq_data->rx.num; in mt7921s_parse_intr()
80 intr->rx.len[0] = irq_data->rx.len0; in mt7921s_parse_intr()
82 intr->rx.len[1] = irq_data->rx.len1; in mt7921s_parse_intr()
130 ops = mt792x_get_mac80211_ops(&func->dev, &mt7921_ops, in mt7921s_probe()
131 (void *)id->driver_data, &features); in mt7921s_probe()
133 return -ENOMEM; in mt7921s_probe()
135 mdev = mt76_alloc_device(&func->dev, sizeof(*dev), ops, &drv_ops); in mt7921s_probe()
137 return -ENOMEM; in mt7921s_probe()
140 dev->fw_features = features; in mt7921s_probe()
141 dev->hif_ops = &mt7921_sdio_ops; in mt7921s_probe()
152 mdev->rev = (mt76_rr(dev, MT_HW_CHIPID) << 16) | in mt7921s_probe()
154 dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev); in mt7921s_probe()
156 mdev->sdio.parse_irq = mt7921s_parse_intr; in mt7921s_probe()
157 mdev->sdio.intr_data = devm_kmalloc(mdev->dev, in mt7921s_probe()
160 if (!mdev->sdio.intr_data) { in mt7921s_probe()
161 ret = -ENOMEM; in mt7921s_probe()
177 ret = mt76_worker_setup(mt76_hw(dev), &mdev->sdio.txrx_worker, in mt7921s_probe()
178 mt7921s_txrx_worker, "sdio-txrx"); in mt7921s_probe()
182 sched_set_fifo_low(mdev->sdio.txrx_worker.task); in mt7921s_probe()
191 mt76s_deinit(&dev->mt76); in mt7921s_probe()
192 mt76_free_device(&dev->mt76); in mt7921s_probe()
208 struct mt76_connac_pm *pm = &dev->pm; in mt7921s_suspend()
209 struct mt76_dev *mdev = &dev->mt76; in mt7921s_suspend()
212 pm->suspended = true; in mt7921s_suspend()
213 set_bit(MT76_STATE_SUSPEND, &mdev->phy.state); in mt7921s_suspend()
215 flush_work(&dev->reset_work); in mt7921s_suspend()
216 cancel_delayed_work_sync(&pm->ps_work); in mt7921s_suspend()
217 cancel_work_sync(&pm->wake_work); in mt7921s_suspend()
228 mt76_txq_schedule_all(&dev->mphy); in mt7921s_suspend()
229 mt76_worker_disable(&mdev->tx_worker); in mt7921s_suspend()
230 mt76_worker_disable(&mdev->sdio.status_worker); in mt7921s_suspend()
231 cancel_work_sync(&mdev->sdio.stat_work); in mt7921s_suspend()
232 clear_bit(MT76_READING_STATS, &dev->mphy.state); in mt7921s_suspend()
235 mt76_worker_schedule(&mdev->sdio.txrx_worker); in mt7921s_suspend()
236 wait_event_timeout(dev->mt76.sdio.wait, in mt7921s_suspend()
237 mt76s_txqs_empty(&dev->mt76), 5 * HZ); in mt7921s_suspend()
244 mt76_worker_disable(&mdev->sdio.txrx_worker); in mt7921s_suspend()
245 mt76_worker_disable(&mdev->sdio.net_worker); in mt7921s_suspend()
256 mt76_worker_enable(&mdev->sdio.net_worker); in mt7921s_suspend()
257 mt76_worker_enable(&mdev->sdio.txrx_worker); in mt7921s_suspend()
261 mt76_worker_enable(&mdev->tx_worker); in mt7921s_suspend()
262 mt76_worker_enable(&mdev->sdio.status_worker); in mt7921s_suspend()
264 if (!pm->ds_enable) in mt7921s_suspend()
268 clear_bit(MT76_STATE_SUSPEND, &mdev->phy.state); in mt7921s_suspend()
269 pm->suspended = false; in mt7921s_suspend()
272 mt792x_reset(&dev->mt76); in mt7921s_suspend()
281 struct mt76_connac_pm *pm = &dev->pm; in mt7921s_resume()
282 struct mt76_dev *mdev = &dev->mt76; in mt7921s_resume()
285 clear_bit(MT76_STATE_SUSPEND, &mdev->phy.state); in mt7921s_resume()
291 mt76_worker_enable(&mdev->tx_worker); in mt7921s_resume()
292 mt76_worker_enable(&mdev->sdio.txrx_worker); in mt7921s_resume()
293 mt76_worker_enable(&mdev->sdio.status_worker); in mt7921s_resume()
294 mt76_worker_enable(&mdev->sdio.net_worker); in mt7921s_resume()
297 if (!pm->ds_enable) in mt7921s_resume()
302 pm->suspended = false; in mt7921s_resume()
305 mt792x_reset(&dev->mt76); in mt7921s_resume()