Lines Matching defs:rxq

319 		aprint_error(": failed to init rxq: %d\n", error);
615 struct bcmeth_rxqueue * const rxq = &sc->sc_rxq;
623 bcmeth_write_4(sc, rxq->rxq_reg_rcvctl,
624 bcmeth_read_4(sc, rxq->rxq_reg_rcvctl) & ~RCVCTL_ENABLE);
635 uint32_t rx0 = bcmeth_read_4(sc, rxq->rxq_reg_rcvsts0);
701 struct bcmeth_rxqueue *rxq,
705 bus_dmamap_sync(sc->sc_dmat, rxq->rxq_descmap,
706 (rxdb - rxq->rxq_first) * sizeof(*rxdb), count * sizeof(*rxdb),
713 struct bcmeth_rxqueue *rxq,
717 bus_dmamap_sync(sc->sc_dmat, rxq->rxq_descmap,
718 (rxdb - rxq->rxq_first) * sizeof(*rxdb), count * sizeof(*rxdb),
949 struct bcmeth_rxqueue *rxq)
951 struct gmac_rxdb *producer = rxq->rxq_producer;
954 while (rxq->rxq_inuse < rxq->rxq_threshold) {
971 *rxq->rxq_mtail = m;
972 rxq->rxq_mtail = &m->m_next;
975 rxq->rxq_inuse++;
976 if (++producer == rxq->rxq_last) {
978 bcmeth_rxq_desc_presync(sc, rxq, rxq->rxq_producer,
979 rxq->rxq_last - rxq->rxq_producer);
980 producer = rxq->rxq_producer = rxq->rxq_first;
986 if (producer != rxq->rxq_producer) {
987 bcmeth_rxq_desc_presync(sc, rxq, rxq->rxq_producer,
988 producer - rxq->rxq_producer);
989 rxq->rxq_producer = producer;
991 bcmeth_write_4(sc, rxq->rxq_reg_rcvptr,
992 rxq->rxq_descmap->dm_segs[0].ds_addr
1040 struct bcmeth_rxqueue *rxq,
1044 struct gmac_rxdb *consumer = rxq->rxq_consumer;
1049 if (consumer == rxq->rxq_producer) {
1050 KASSERT(rxq->rxq_inuse == 0);
1054 uint32_t rcvsts0 = bcmeth_read_4(sc, rxq->rxq_reg_rcvsts0);
1056 if (consumer == rxq->rxq_first + currdscr) {
1059 bcmeth_rxq_desc_postsync(sc, rxq, consumer, 1);
1067 KASSERT(rxq->rxq_mhead != NULL);
1068 bus_dmamap_t map = M_GETCTX(rxq->rxq_mhead, bus_dmamap_t);
1071 memcpy(&rxsts, rxq->rxq_mhead->m_data, 4);
1075 currdscr, consumer - rxq->rxq_first);
1088 struct mbuf *m = rxq->rxq_mhead;
1091 if (++consumer == rxq->rxq_last) {
1092 consumer = rxq->rxq_first;
1094 KASSERTMSG(consumer != rxq->rxq_first + currdscr,
1097 consumer - rxq->rxq_first);
1104 if ((rxq->rxq_mhead = m_last->m_next) == NULL)
1105 rxq->rxq_mtail = &rxq->rxq_mhead;
1123 consumer - rxq->rxq_first, desc_count, rxsts);
1150 if (++consumer == rxq->rxq_last) {
1153 rxq->rxq_consumer = rxq->rxq_first;
1155 rxq->rxq_consumer = consumer;
1157 rxq->rxq_inuse -= rxconsumed;
1170 consumer = rxq->rxq_consumer;
1179 if (++consumer == rxq->rxq_last) {
1181 consumer = rxq->rxq_first;
1188 rxq->rxq_consumer = consumer;
1189 rxq->rxq_inuse -= rxconsumed;
1200 struct bcmeth_rxqueue *rxq,
1205 if ((m = rxq->rxq_mhead) != NULL) {
1219 rxq->rxq_mhead = NULL;
1220 rxq->rxq_mtail = &rxq->rxq_mhead;
1221 rxq->rxq_inuse = 0;
1227 struct bcmeth_rxqueue *rxq)
1232 bcmeth_rxq_desc_postsync(sc, rxq, rxq->rxq_first,
1233 rxq->rxq_last - rxq->rxq_first);
1239 for (rxdb = rxq->rxq_first; rxdb < rxq->rxq_last - 1; rxdb++) {
1251 rxq->rxq_consumer = rxq->rxq_first;
1252 rxq->rxq_producer = rxq->rxq_first;
1253 rxq->rxq_inuse = 0;
1254 if (rxq->rxq_threshold < BCMETH_MINRXMBUFS)
1255 rxq->rxq_threshold = BCMETH_MINRXMBUFS;
1262 bcmeth_write_4(sc, rxq->rxq_reg_rcvaddrlo,
1263 rxq->rxq_descmap->dm_segs[0].ds_addr);
1269 struct bcmeth_rxqueue *rxq,
1272 size_t desc_count = BCMETH_RINGSIZE / sizeof(rxq->rxq_first[0]);
1279 &rxq->rxq_descmap_seg, &rxq->rxq_descmap, &descs);
1284 rxq->rxq_first = descs;
1285 rxq->rxq_last = rxq->rxq_first + desc_count;
1286 rxq->rxq_consumer = descs;
1287 rxq->rxq_producer = descs;
1289 bcmeth_rxq_purge(sc, rxq, true);
1290 bcmeth_rxq_reset(sc, rxq);
1292 rxq->rxq_reg_rcvaddrlo = GMAC_RCVADDR_LOW;
1293 rxq->rxq_reg_rcvctl = GMAC_RCVCONTROL;
1294 rxq->rxq_reg_rcvptr = GMAC_RCVPTR;
1295 rxq->rxq_reg_rcvsts0 = GMAC_RCVSTATUS0;
1296 rxq->rxq_reg_rcvsts1 = GMAC_RCVSTATUS1;
1798 struct bcmeth_rxqueue * const rxq = &sc->sc_rxq;
1801 uint32_t rcvsts0 = bcmeth_read_4(sc, rxq->rxq_reg_rcvsts0);
1803 if (descs < rxq->rxq_consumer - rxq->rxq_first) {
1808 descs += rxq->rxq_last - rxq->rxq_consumer;
1810 descs -= rxq->rxq_consumer - rxq->rxq_first;
1982 struct bcmeth_rxqueue * const rxq = &sc->sc_rxq;
1983 size_t threshold = 5 * rxq->rxq_threshold / 4;
1984 if (threshold >= rxq->rxq_last - rxq->rxq_first) {
1985 threshold = rxq->rxq_last - rxq->rxq_first - 1;
1991 rxq->rxq_threshold, threshold);
1992 rxq->rxq_threshold = threshold;