Lines Matching refs:jme_cdata

1149 	    &sc->jme_cdata.jme_ring_tag);  in jme_dma_alloc()
1156 error = bus_dma_tag_create(sc->jme_cdata.jme_ring_tag,/* parent */ in jme_dma_alloc()
1166 &sc->jme_cdata.jme_tx_ring_tag); in jme_dma_alloc()
1174 error = bus_dma_tag_create(sc->jme_cdata.jme_ring_tag,/* parent */ in jme_dma_alloc()
1184 &sc->jme_cdata.jme_rx_ring_tag); in jme_dma_alloc()
1192 error = bus_dmamem_alloc(sc->jme_cdata.jme_tx_ring_tag, in jme_dma_alloc()
1195 &sc->jme_cdata.jme_tx_ring_map); in jme_dma_alloc()
1203 error = bus_dmamap_load(sc->jme_cdata.jme_tx_ring_tag, in jme_dma_alloc()
1204 sc->jme_cdata.jme_tx_ring_map, sc->jme_rdata.jme_tx_ring, in jme_dma_alloc()
1214 error = bus_dmamem_alloc(sc->jme_cdata.jme_rx_ring_tag, in jme_dma_alloc()
1217 &sc->jme_cdata.jme_rx_ring_map); in jme_dma_alloc()
1225 error = bus_dmamap_load(sc->jme_cdata.jme_rx_ring_tag, in jme_dma_alloc()
1226 sc->jme_cdata.jme_rx_ring_map, sc->jme_rdata.jme_rx_ring, in jme_dma_alloc()
1268 &sc->jme_cdata.jme_buffer_tag); in jme_dma_alloc()
1276 error = bus_dma_tag_create(sc->jme_cdata.jme_buffer_tag,/* parent */ in jme_dma_alloc()
1286 &sc->jme_cdata.jme_ssb_tag); in jme_dma_alloc()
1294 error = bus_dma_tag_create(sc->jme_cdata.jme_buffer_tag,/* parent */ in jme_dma_alloc()
1304 &sc->jme_cdata.jme_tx_tag); in jme_dma_alloc()
1311 error = bus_dma_tag_create(sc->jme_cdata.jme_buffer_tag,/* parent */ in jme_dma_alloc()
1321 &sc->jme_cdata.jme_rx_tag); in jme_dma_alloc()
1331 error = bus_dmamem_alloc(sc->jme_cdata.jme_ssb_tag, in jme_dma_alloc()
1334 &sc->jme_cdata.jme_ssb_map); in jme_dma_alloc()
1342 error = bus_dmamap_load(sc->jme_cdata.jme_ssb_tag, in jme_dma_alloc()
1343 sc->jme_cdata.jme_ssb_map, sc->jme_rdata.jme_ssb_block, in jme_dma_alloc()
1354 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_dma_alloc()
1357 error = bus_dmamap_create(sc->jme_cdata.jme_tx_tag, 0, in jme_dma_alloc()
1366 if ((error = bus_dmamap_create(sc->jme_cdata.jme_rx_tag, 0, in jme_dma_alloc()
1367 &sc->jme_cdata.jme_rx_sparemap)) != 0) { in jme_dma_alloc()
1373 rxd = &sc->jme_cdata.jme_rxdesc[i]; in jme_dma_alloc()
1376 error = bus_dmamap_create(sc->jme_cdata.jme_rx_tag, 0, in jme_dma_alloc()
1397 if (sc->jme_cdata.jme_tx_ring_tag != NULL) { in jme_dma_free()
1399 bus_dmamap_unload(sc->jme_cdata.jme_tx_ring_tag, in jme_dma_free()
1400 sc->jme_cdata.jme_tx_ring_map); in jme_dma_free()
1402 bus_dmamem_free(sc->jme_cdata.jme_tx_ring_tag, in jme_dma_free()
1404 sc->jme_cdata.jme_tx_ring_map); in jme_dma_free()
1407 bus_dma_tag_destroy(sc->jme_cdata.jme_tx_ring_tag); in jme_dma_free()
1408 sc->jme_cdata.jme_tx_ring_tag = NULL; in jme_dma_free()
1411 if (sc->jme_cdata.jme_rx_ring_tag != NULL) { in jme_dma_free()
1413 bus_dmamap_unload(sc->jme_cdata.jme_rx_ring_tag, in jme_dma_free()
1414 sc->jme_cdata.jme_rx_ring_map); in jme_dma_free()
1416 bus_dmamem_free(sc->jme_cdata.jme_rx_ring_tag, in jme_dma_free()
1418 sc->jme_cdata.jme_rx_ring_map); in jme_dma_free()
1421 bus_dma_tag_destroy(sc->jme_cdata.jme_rx_ring_tag); in jme_dma_free()
1422 sc->jme_cdata.jme_rx_ring_tag = NULL; in jme_dma_free()
1425 if (sc->jme_cdata.jme_tx_tag != NULL) { in jme_dma_free()
1427 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_dma_free()
1429 bus_dmamap_destroy(sc->jme_cdata.jme_tx_tag, in jme_dma_free()
1434 bus_dma_tag_destroy(sc->jme_cdata.jme_tx_tag); in jme_dma_free()
1435 sc->jme_cdata.jme_tx_tag = NULL; in jme_dma_free()
1438 if (sc->jme_cdata.jme_rx_tag != NULL) { in jme_dma_free()
1440 rxd = &sc->jme_cdata.jme_rxdesc[i]; in jme_dma_free()
1442 bus_dmamap_destroy(sc->jme_cdata.jme_rx_tag, in jme_dma_free()
1447 if (sc->jme_cdata.jme_rx_sparemap != NULL) { in jme_dma_free()
1448 bus_dmamap_destroy(sc->jme_cdata.jme_rx_tag, in jme_dma_free()
1449 sc->jme_cdata.jme_rx_sparemap); in jme_dma_free()
1450 sc->jme_cdata.jme_rx_sparemap = NULL; in jme_dma_free()
1452 bus_dma_tag_destroy(sc->jme_cdata.jme_rx_tag); in jme_dma_free()
1453 sc->jme_cdata.jme_rx_tag = NULL; in jme_dma_free()
1457 if (sc->jme_cdata.jme_ssb_tag != NULL) { in jme_dma_free()
1459 bus_dmamap_unload(sc->jme_cdata.jme_ssb_tag, in jme_dma_free()
1460 sc->jme_cdata.jme_ssb_map); in jme_dma_free()
1462 bus_dmamem_free(sc->jme_cdata.jme_ssb_tag, in jme_dma_free()
1464 sc->jme_cdata.jme_ssb_map); in jme_dma_free()
1467 bus_dma_tag_destroy(sc->jme_cdata.jme_ssb_tag); in jme_dma_free()
1468 sc->jme_cdata.jme_ssb_tag = NULL; in jme_dma_free()
1471 if (sc->jme_cdata.jme_buffer_tag != NULL) { in jme_dma_free()
1472 bus_dma_tag_destroy(sc->jme_cdata.jme_buffer_tag); in jme_dma_free()
1473 sc->jme_cdata.jme_buffer_tag = NULL; in jme_dma_free()
1475 if (sc->jme_cdata.jme_ring_tag != NULL) { in jme_dma_free()
1476 bus_dma_tag_destroy(sc->jme_cdata.jme_ring_tag); in jme_dma_free()
1477 sc->jme_cdata.jme_ring_tag = NULL; in jme_dma_free()
1757 prod = sc->jme_cdata.jme_tx_prod; in jme_encap()
1758 txd = &sc->jme_cdata.jme_txdesc[prod]; in jme_encap()
1760 error = bus_dmamap_load_mbuf_sg(sc->jme_cdata.jme_tx_tag, in jme_encap()
1770 error = bus_dmamap_load_mbuf_sg(sc->jme_cdata.jme_tx_tag, in jme_encap()
1790 if (sc->jme_cdata.jme_tx_cnt + nsegs + 1 > JME_TX_RING_CNT - 1) { in jme_encap()
1791 bus_dmamap_unload(sc->jme_cdata.jme_tx_tag, txd->tx_dmamap); in jme_encap()
1822 sc->jme_cdata.jme_tx_cnt++; in jme_encap()
1830 sc->jme_cdata.jme_tx_cnt++; in jme_encap()
1835 sc->jme_cdata.jme_tx_prod = prod; in jme_encap()
1847 bus_dmamap_sync(sc->jme_cdata.jme_tx_tag, txd->tx_dmamap, in jme_encap()
1849 bus_dmamap_sync(sc->jme_cdata.jme_tx_ring_tag, in jme_encap()
1850 sc->jme_cdata.jme_tx_ring_map, in jme_encap()
1878 if (sc->jme_cdata.jme_tx_cnt >= JME_TX_DESC_HIWAT) in jme_start_locked()
1943 if (sc->jme_cdata.jme_tx_cnt == 0) { in jme_watchdog()
2252 if (sc->jme_cdata.jme_rxhead != NULL) in jme_link_task()
2253 m_freem(sc->jme_cdata.jme_rxhead); in jme_link_task()
2256 if (sc->jme_cdata.jme_tx_cnt != 0) { in jme_link_task()
2259 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_link_task()
2262 sc->jme_cdata.jme_tx_tag, in jme_link_task()
2266 sc->jme_cdata.jme_tx_tag, in jme_link_task()
2280 sc->jme_cdata.jme_rx_cons = 0; in jme_link_task()
2420 cons = sc->jme_cdata.jme_tx_cons; in jme_txeof()
2421 if (cons == sc->jme_cdata.jme_tx_prod) in jme_txeof()
2424 bus_dmamap_sync(sc->jme_cdata.jme_tx_ring_tag, in jme_txeof()
2425 sc->jme_cdata.jme_tx_ring_map, in jme_txeof()
2432 for (; cons != sc->jme_cdata.jme_tx_prod;) { in jme_txeof()
2433 txd = &sc->jme_cdata.jme_txdesc[cons]; in jme_txeof()
2460 bus_dmamap_sync(sc->jme_cdata.jme_tx_tag, txd->tx_dmamap, in jme_txeof()
2462 bus_dmamap_unload(sc->jme_cdata.jme_tx_tag, txd->tx_dmamap); in jme_txeof()
2468 sc->jme_cdata.jme_tx_cnt -= txd->tx_ndesc; in jme_txeof()
2469 KASSERT(sc->jme_cdata.jme_tx_cnt >= 0, in jme_txeof()
2474 sc->jme_cdata.jme_tx_cons = cons; in jme_txeof()
2476 if (sc->jme_cdata.jme_tx_cnt == 0) in jme_txeof()
2479 bus_dmamap_sync(sc->jme_cdata.jme_tx_ring_tag, in jme_txeof()
2480 sc->jme_cdata.jme_tx_ring_map, in jme_txeof()
2509 cons = sc->jme_cdata.jme_rx_cons; in jme_rxeof()
2514 sc->jme_cdata.jme_rxlen = JME_RX_BYTES(status) - JME_RX_PAD_BYTES; in jme_rxeof()
2517 jme_discard_rxbuf(sc, sc->jme_cdata.jme_rx_cons); in jme_rxeof()
2522 sc->jme_cdata.jme_rx_cons += nsegs; in jme_rxeof()
2523 sc->jme_cdata.jme_rx_cons %= JME_RX_RING_CNT; in jme_rxeof()
2529 rxd = &sc->jme_cdata.jme_rxdesc[cons]; in jme_rxeof()
2539 if (sc->jme_cdata.jme_rxhead != NULL) { in jme_rxeof()
2540 m_freem(sc->jme_cdata.jme_rxhead); in jme_rxeof()
2554 if (sc->jme_cdata.jme_rxhead == NULL) { in jme_rxeof()
2555 sc->jme_cdata.jme_rxhead = mp; in jme_rxeof()
2556 sc->jme_cdata.jme_rxtail = mp; in jme_rxeof()
2563 sc->jme_cdata.jme_rxtail->m_next = mp; in jme_rxeof()
2564 sc->jme_cdata.jme_rxtail = mp; in jme_rxeof()
2569 m = sc->jme_cdata.jme_rxhead; in jme_rxeof()
2571 m->m_pkthdr.len = sc->jme_cdata.jme_rxlen; in jme_rxeof()
2576 mp->m_len = sc->jme_cdata.jme_rxlen - in jme_rxeof()
2580 m->m_len = sc->jme_cdata.jme_rxlen; in jme_rxeof()
2627 sc->jme_cdata.jme_rx_cons += nsegs; in jme_rxeof()
2628 sc->jme_cdata.jme_rx_cons %= JME_RX_RING_CNT; in jme_rxeof()
2637 bus_dmamap_sync(sc->jme_cdata.jme_rx_ring_tag, in jme_rxintr()
2638 sc->jme_cdata.jme_rx_ring_map, in jme_rxintr()
2642 desc = &sc->jme_rdata.jme_rx_ring[sc->jme_cdata.jme_rx_cons]; in jme_rxintr()
2664 bus_dmamap_sync(sc->jme_cdata.jme_rx_ring_tag, in jme_rxintr()
2665 sc->jme_cdata.jme_rx_ring_map, in jme_rxintr()
3023 if (sc->jme_cdata.jme_rxhead != NULL) in jme_stop()
3024 m_freem(sc->jme_cdata.jme_rxhead); in jme_stop()
3031 rxd = &sc->jme_cdata.jme_rxdesc[i]; in jme_stop()
3033 bus_dmamap_sync(sc->jme_cdata.jme_rx_tag, in jme_stop()
3035 bus_dmamap_unload(sc->jme_cdata.jme_rx_tag, in jme_stop()
3042 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_stop()
3044 bus_dmamap_sync(sc->jme_cdata.jme_tx_tag, in jme_stop()
3046 bus_dmamap_unload(sc->jme_cdata.jme_tx_tag, in jme_stop()
3104 sc->jme_cdata.jme_tx_prod = 0; in jme_init_tx_ring()
3105 sc->jme_cdata.jme_tx_cons = 0; in jme_init_tx_ring()
3106 sc->jme_cdata.jme_tx_cnt = 0; in jme_init_tx_ring()
3111 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_init_tx_ring()
3117 bus_dmamap_sync(sc->jme_cdata.jme_tx_ring_tag, in jme_init_tx_ring()
3118 sc->jme_cdata.jme_tx_ring_map, in jme_init_tx_ring()
3129 bus_dmamap_sync(sc->jme_cdata.jme_ssb_tag, sc->jme_cdata.jme_ssb_map, in jme_init_ssb()
3140 sc->jme_cdata.jme_rx_cons = 0; in jme_init_rx_ring()
3147 rxd = &sc->jme_cdata.jme_rxdesc[i]; in jme_init_rx_ring()
3154 bus_dmamap_sync(sc->jme_cdata.jme_rx_ring_tag, in jme_init_rx_ring()
3155 sc->jme_cdata.jme_rx_ring_map, in jme_init_rx_ring()
3181 if (bus_dmamap_load_mbuf_sg(sc->jme_cdata.jme_rx_tag, in jme_newbuf()
3182 sc->jme_cdata.jme_rx_sparemap, m, segs, &nsegs, 0) != 0) { in jme_newbuf()
3189 bus_dmamap_sync(sc->jme_cdata.jme_rx_tag, rxd->rx_dmamap, in jme_newbuf()
3191 bus_dmamap_unload(sc->jme_cdata.jme_rx_tag, rxd->rx_dmamap); in jme_newbuf()
3194 rxd->rx_dmamap = sc->jme_cdata.jme_rx_sparemap; in jme_newbuf()
3195 sc->jme_cdata.jme_rx_sparemap = map; in jme_newbuf()
3196 bus_dmamap_sync(sc->jme_cdata.jme_rx_tag, rxd->rx_dmamap, in jme_newbuf()