| 1842 | } |
| 1843 | |
| 1844 | static int |
| 1845 | iflib_txq_setup(iflib_txq_t txq) |
| 1846 | { |
| 1847 | if_ctx_t ctx = txq->ift_ctx; |
| 1848 | if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; |
| 1849 | if_shared_ctx_t sctx = ctx->ifc_sctx; |
| 1850 | iflib_dma_info_t di; |
| 1851 | int i; |
| 1852 | |
| 1853 | /* Set number of descriptors available */ |
| 1854 | txq->ift_qstatus = IFLIB_QUEUE_IDLE; |
| 1855 | /* XXX make configurable */ |
| 1856 | txq->ift_update_freq = IFLIB_DEFAULT_TX_UPDATE_FREQ; |
| 1857 | |
| 1858 | /* Reset indices */ |
| 1859 | txq->ift_cidx_processed = 0; |
| 1860 | txq->ift_pidx = txq->ift_cidx = txq->ift_npending = 0; |
| 1861 | txq->ift_size = scctx->isc_ntxd[txq->ift_br_offset]; |
| 1862 | |
| 1863 | for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) |
| 1864 | bzero((void *)di->idi_vaddr, di->idi_size); |
| 1865 | |
| 1866 | IFDI_TXQ_SETUP(ctx, txq->ift_id); |
| 1867 | for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) |
| 1868 | bus_dmamap_sync(di->idi_tag, di->idi_map, |
| 1869 | BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); |
| 1870 | return (0); |
| 1871 | } |
| 1872 | |
| 1873 | /********************************************************************* |
| 1874 | * |
no test coverage detected