Lines Matching full:sdio

18 #include "sdio.h"
37 struct mt76_sdio *sdio = &dev->sdio; in mt76s_refill_sched_quota() local
48 sdio->sched.pse_mcu_quota += pse_mcu_quota; in mt76s_refill_sched_quota()
49 sdio->sched.pse_data_quota += pse_data_quota; in mt76s_refill_sched_quota()
50 sdio->sched.ple_data_quota += ple_data_quota; in mt76s_refill_sched_quota()
85 struct mt76_sdio *sdio = &dev->sdio; in mt76s_rx_run_queue() local
96 if (len > sdio->func->cur_blksize) in mt76s_rx_run_queue()
97 len = roundup(len, sdio->func->cur_blksize); in mt76s_rx_run_queue()
105 sdio_claim_host(sdio->func); in mt76s_rx_run_queue()
106 err = sdio_readsb(sdio->func, buf, MCR_WRDR(qid), len); in mt76s_rx_run_queue()
107 sdio_release_host(sdio->func); in mt76s_rx_run_queue()
110 dev_err(dev->dev, "sdio read data failed:%d\n", err); in mt76s_rx_run_queue()
151 struct mt76_sdio *sdio = &dev->sdio; in mt76s_rx_handler() local
155 ret = sdio->parse_irq(dev, &intr); in mt76s_rx_handler()
164 mt76_worker_schedule(&sdio->net_worker); in mt76s_rx_handler()
172 mt76_worker_schedule(&sdio->net_worker); in mt76s_rx_handler()
183 mt76s_tx_pick_quota(struct mt76_sdio *sdio, bool mcu, int buf_sz, in mt76s_tx_pick_quota() argument
188 pse_sz = DIV_ROUND_UP(buf_sz + sdio->sched.deficit, in mt76s_tx_pick_quota()
189 sdio->sched.pse_page_size); in mt76s_tx_pick_quota()
191 if (mcu && sdio->hw_ver == MT76_CONNAC2_SDIO) in mt76s_tx_pick_quota()
195 if (sdio->sched.pse_mcu_quota < *pse_size + pse_sz) in mt76s_tx_pick_quota()
198 if (sdio->sched.pse_data_quota < *pse_size + pse_sz || in mt76s_tx_pick_quota()
199 sdio->sched.ple_data_quota < *ple_size + 1) in mt76s_tx_pick_quota()
210 mt76s_tx_update_quota(struct mt76_sdio *sdio, bool mcu, int pse_size, in mt76s_tx_update_quota() argument
214 sdio->sched.pse_mcu_quota -= pse_size; in mt76s_tx_update_quota()
216 sdio->sched.pse_data_quota -= pse_size; in mt76s_tx_update_quota()
217 sdio->sched.ple_data_quota -= ple_size; in mt76s_tx_update_quota()
223 struct mt76_sdio *sdio = &dev->sdio; in __mt76s_xmit_queue() local
226 if (len > sdio->func->cur_blksize) in __mt76s_xmit_queue()
227 len = roundup(len, sdio->func->cur_blksize); in __mt76s_xmit_queue()
229 sdio_claim_host(sdio->func); in __mt76s_xmit_queue()
230 err = sdio_writesb(sdio->func, MCR_WTDR1, data, len); in __mt76s_xmit_queue()
231 sdio_release_host(sdio->func); in __mt76s_xmit_queue()
234 dev_err(dev->dev, "sdio write failed: %d\n", err); in __mt76s_xmit_queue()
243 struct mt76_sdio *sdio = &dev->sdio; in mt76s_tx_run_queue() local
258 sdio->func->cur_blksize)); in mt76s_tx_run_queue()
270 if (len + e->skb->len + pad + 4 > dev->sdio.xmit_buf_sz) in mt76s_tx_run_queue()
273 if (mt76s_tx_pick_quota(sdio, mcu, e->buf_sz, &pse_sz, in mt76s_tx_run_queue()
277 memcpy(sdio->xmit_buf + len, e->skb->data, skb_headlen(e->skb)); in mt76s_tx_run_queue()
282 memcpy(sdio->xmit_buf + len, iter->data, iter->len); in mt76s_tx_run_queue()
288 memset(sdio->xmit_buf + len, 0, pad); in mt76s_tx_run_queue()
297 memset(sdio->xmit_buf + len, 0, 4); in mt76s_tx_run_queue()
298 err = __mt76s_xmit_queue(dev, sdio->xmit_buf, len + 4); in mt76s_tx_run_queue()
302 mt76s_tx_update_quota(sdio, mcu, pse_sz, ple_sz); in mt76s_tx_run_queue()
304 mt76_worker_schedule(&sdio->status_worker); in mt76s_tx_run_queue()
309 void mt76s_txrx_worker(struct mt76_sdio *sdio) in mt76s_txrx_worker() argument
311 struct mt76_dev *dev = container_of(sdio, struct mt76_dev, sdio); in mt76s_txrx_worker()
315 sdio_claim_host(sdio->func); in mt76s_txrx_worker()
316 sdio_writel(sdio->func, WHLPCR_INT_EN_CLR, MCR_WHLPCR, NULL); in mt76s_txrx_worker()
317 sdio_release_host(sdio->func); in mt76s_txrx_worker()
342 wake_up(&sdio->wait); in mt76s_txrx_worker()
347 sdio_claim_host(sdio->func); in mt76s_txrx_worker()
348 sdio_writel(sdio->func, WHLPCR_INT_EN_SET, MCR_WHLPCR, NULL); in mt76s_txrx_worker()
349 sdio_release_host(sdio->func); in mt76s_txrx_worker()
356 struct mt76_sdio *sdio = &dev->sdio; in mt76s_sdio_irq() local
362 sdio_writel(sdio->func, WHLPCR_INT_EN_CLR, MCR_WHLPCR, NULL); in mt76s_sdio_irq()
363 mt76_worker_schedule(&sdio->txrx_worker); in mt76s_sdio_irq()