Lines Matching defs:txq

652 		aprint_error(": failed to init txq: %d\n", error);
1261 struct pq3etsec_txqueue *txq,
1265 bus_dmamap_sync(sc->sc_dmat, txq->txq_descmap,
1266 (txbd - txq->txq_first) * sizeof(*txbd), count * sizeof(*txbd),
1273 struct pq3etsec_txqueue *txq,
1277 bus_dmamap_sync(sc->sc_dmat, txq->txq_descmap,
1278 (txbd - txq->txq_first) * sizeof(*txbd), count * sizeof(*txbd),
1820 struct pq3etsec_txqueue *txq)
1822 return !IF_IS_EMPTY(&txq->txq_mbufs);
1828 struct pq3etsec_txqueue *txq)
1830 return txq->txq_free >= txq->txq_threshold;
1836 struct pq3etsec_txqueue *txq,
1845 &txq->txq_descmap_seg, &txq->txq_descmap, &descs);
1850 txq->txq_first = descs;
1851 txq->txq_last = txq->txq_first + desc_count;
1852 txq->txq_consumer = descs;
1853 txq->txq_producer = descs;
1855 IFQ_SET_MAXLEN(&txq->txq_mbufs, ETSEC_MAXTXMBUFS);
1857 txq->txq_reg_tbase = TBASEn(qno);
1858 txq->txq_qmask = TSTAT_THLTn(qno) | TSTAT_TXFn(qno);
1860 pq3etsec_txq_reset(sc, txq);
1868 struct pq3etsec_txqueue *txq,
1896 struct pq3etsec_txqueue *txq,
1910 struct pq3etsec_txqueue *txq,
1915 if (map->dm_nsegs > txq->txq_free)
1921 volatile struct txbd *producer = txq->txq_producer;
1930 txq->txq_lastintr += map->dm_nsegs;
1932 || txq->txq_lastintr >= txq->txq_threshold
1933 || txq->txq_mbufs.ifq_len + 1 == txq->txq_mbufs.ifq_maxlen) {
1934 txq->txq_lastintr = 0;
1939 KASSERT(txq->txq_lmbufs[producer - txq->txq_first] == NULL);
1941 KASSERT(producer != txq->txq_last);
1949 if (__predict_false(++producer == txq->txq_last)) {
1950 producer = txq->txq_first;
1951 if (start < txq->txq_last) {
1952 pq3etsec_txq_desc_presync(sc, txq,
1953 start, txq->txq_last - start);
1954 count -= txq->txq_last - start;
1956 start = txq->txq_first;
1959 KASSERT(txq->txq_lmbufs[producer - txq->txq_first] == NULL);
1967 printf("%s: txbd[%u]=%#x/%u/%#x\n", __func__, producer - txq->txq_first,
1971 pq3etsec_txq_desc_presync(sc, txq, start, count);
1977 txq->txq_producer->txbd_flags =
1978 first_flags | (txq->txq_producer->txbd_flags & TXBD_W);
1981 txq->txq_producer - txq->txq_first, txq->txq_producer->txbd_flags,
1982 txq->txq_producer->txbd_len, txq->txq_producer->txbd_bufptr);
1984 pq3etsec_txq_desc_presync(sc, txq, txq->txq_producer, 1);
1989 txq->txq_free -= map->dm_nsegs;
1990 KASSERT(map->dm_nsegs == 1 || txq->txq_producer != producer);
1991 KASSERT(map->dm_nsegs == 1 || (txq->txq_producer->txbd_flags & TXBD_L) == 0);
1994 txq->txq_lmbufs[producer - txq->txq_first] = m;
2000 txq->txq_producer - txq->txq_first, producer - txq->txq_first);
2003 if (++producer == txq->txq_last)
2004 txq->txq_producer = txq->txq_first;
2006 txq->txq_producer = producer;
2007 IF_ENQUEUE(&txq->txq_mbufs, m);
2012 etsec_write(sc, TSTAT, txq->txq_qmask & TSTAT_THLT); /* W1C */
2020 struct pq3etsec_txqueue *txq,
2123 struct pq3etsec_txqueue *txq)
2126 if (IF_QFULL(&txq->txq_mbufs))
2128 struct mbuf *m = txq->txq_next;
2136 pq3etsec_tx_offload(sc, txq, &m);
2138 txq->txq_next = NULL;
2140 int error = pq3etsec_txq_map_load(sc, txq, m);
2148 KASSERT(txq->txq_next == NULL);
2149 if (!pq3etsec_txq_produce(sc, txq, m)) {
2150 txq->txq_next = m;
2153 KASSERT(txq->txq_next == NULL);
2160 struct pq3etsec_txqueue *txq)
2163 volatile struct txbd *consumer = txq->txq_consumer;
2168 printf("%s: entry: free=%zu\n", __func__, txq->txq_free);
2170 etsec_write(sc, TSTAT, TSTAT_TXF & txq->txq_qmask);
2173 if (consumer == txq->txq_producer) {
2174 txq->txq_consumer = consumer;
2175 txq->txq_free += txfree;
2176 txq->txq_lastintr -= uimin(txq->txq_lastintr, txfree);
2177 KASSERT(txq->txq_lastintr == 0);
2178 KASSERT(txq->txq_free ==
2179 txq->txq_last - txq->txq_first - 1);
2183 pq3etsec_txq_desc_postsync(sc, txq, consumer, 1);
2186 txq->txq_consumer = consumer;
2187 txq->txq_free += txfree;
2188 txq->txq_lastintr -= uimin(txq->txq_lastintr, txfree);
2189 ret = pq3etsec_txq_fillable_p(sc, txq);
2200 IF_DEQUEUE(&txq->txq_mbufs, m);
2203 m == txq->txq_lmbufs[consumer-txq->txq_first],
2205 __func__, consumer, consumer - txq->txq_first,
2207 &txq->txq_lmbufs[consumer-txq->txq_first],
2208 txq->txq_lmbufs[consumer-txq->txq_first]);
2211 pq3etsec_txq_map_unload(sc, txq, m);
2229 txq->txq_lmbufs[consumer - txq->txq_first] = NULL;
2233 KASSERT(txq->txq_lmbufs[consumer-txq->txq_first] == NULL);
2247 KASSERT(consumer + 1 == txq->txq_last);
2248 consumer = txq->txq_first;
2251 KASSERT(consumer < txq->txq_last);
2263 struct pq3etsec_txqueue *txq)
2269 IF_DEQUEUE(&txq->txq_mbufs, m);
2272 pq3etsec_txq_map_unload(sc, txq, m);
2275 if ((m = txq->txq_next) != NULL) {
2276 txq->txq_next = NULL;
2277 pq3etsec_txq_map_unload(sc, txq, m);
2281 memset(txq->txq_lmbufs, 0, sizeof(txq->txq_lmbufs));
2288 struct pq3etsec_txqueue *txq)
2293 pq3etsec_txq_desc_postsync(sc, txq, txq->txq_first,
2294 txq->txq_last - txq->txq_first);
2300 for (txbd = txq->txq_first; txbd < txq->txq_last - 1; txbd++) {
2312 txq->txq_consumer = txq->txq_first;
2313 txq->txq_producer = txq->txq_first;
2314 txq->txq_free = txq->txq_last - txq->txq_first - 1;
2315 txq->txq_threshold = txq->txq_free / 2;
2316 txq->txq_lastintr = 0;
2326 etsec_write(sc, txq->txq_reg_tbase, txq->txq_descmap->dm_segs->ds_addr);
2346 struct pq3etsec_txqueue * const txq = &sc->sc_txq;
2348 pq3etsec_txq_consume(sc, txq);
2355 if (pq3etsec_txq_active_p(sc, txq))
2356 etsec_write(sc, TSTAT, TSTAT_THLT & txq->txq_qmask);
2357 if (!pq3etsec_txq_enqueue(sc, txq)) {