Lines Matching refs:jme_cdata
1140 &sc->jme_cdata.jme_ring_tag); in jme_dma_alloc()
1147 error = bus_dma_tag_create(sc->jme_cdata.jme_ring_tag,/* parent */ in jme_dma_alloc()
1157 &sc->jme_cdata.jme_tx_ring_tag); in jme_dma_alloc()
1165 error = bus_dma_tag_create(sc->jme_cdata.jme_ring_tag,/* parent */ in jme_dma_alloc()
1175 &sc->jme_cdata.jme_rx_ring_tag); in jme_dma_alloc()
1183 error = bus_dmamem_alloc(sc->jme_cdata.jme_tx_ring_tag, in jme_dma_alloc()
1186 &sc->jme_cdata.jme_tx_ring_map); in jme_dma_alloc()
1194 error = bus_dmamap_load(sc->jme_cdata.jme_tx_ring_tag, in jme_dma_alloc()
1195 sc->jme_cdata.jme_tx_ring_map, sc->jme_rdata.jme_tx_ring, in jme_dma_alloc()
1205 error = bus_dmamem_alloc(sc->jme_cdata.jme_rx_ring_tag, in jme_dma_alloc()
1208 &sc->jme_cdata.jme_rx_ring_map); in jme_dma_alloc()
1216 error = bus_dmamap_load(sc->jme_cdata.jme_rx_ring_tag, in jme_dma_alloc()
1217 sc->jme_cdata.jme_rx_ring_map, sc->jme_rdata.jme_rx_ring, in jme_dma_alloc()
1259 &sc->jme_cdata.jme_buffer_tag); in jme_dma_alloc()
1267 error = bus_dma_tag_create(sc->jme_cdata.jme_buffer_tag,/* parent */ in jme_dma_alloc()
1277 &sc->jme_cdata.jme_ssb_tag); in jme_dma_alloc()
1285 error = bus_dma_tag_create(sc->jme_cdata.jme_buffer_tag,/* parent */ in jme_dma_alloc()
1295 &sc->jme_cdata.jme_tx_tag); in jme_dma_alloc()
1302 error = bus_dma_tag_create(sc->jme_cdata.jme_buffer_tag,/* parent */ in jme_dma_alloc()
1312 &sc->jme_cdata.jme_rx_tag); in jme_dma_alloc()
1322 error = bus_dmamem_alloc(sc->jme_cdata.jme_ssb_tag, in jme_dma_alloc()
1325 &sc->jme_cdata.jme_ssb_map); in jme_dma_alloc()
1333 error = bus_dmamap_load(sc->jme_cdata.jme_ssb_tag, in jme_dma_alloc()
1334 sc->jme_cdata.jme_ssb_map, sc->jme_rdata.jme_ssb_block, in jme_dma_alloc()
1345 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_dma_alloc()
1348 error = bus_dmamap_create(sc->jme_cdata.jme_tx_tag, 0, in jme_dma_alloc()
1357 if ((error = bus_dmamap_create(sc->jme_cdata.jme_rx_tag, 0, in jme_dma_alloc()
1358 &sc->jme_cdata.jme_rx_sparemap)) != 0) { in jme_dma_alloc()
1364 rxd = &sc->jme_cdata.jme_rxdesc[i]; in jme_dma_alloc()
1367 error = bus_dmamap_create(sc->jme_cdata.jme_rx_tag, 0, in jme_dma_alloc()
1388 if (sc->jme_cdata.jme_tx_ring_tag != NULL) { in jme_dma_free()
1390 bus_dmamap_unload(sc->jme_cdata.jme_tx_ring_tag, in jme_dma_free()
1391 sc->jme_cdata.jme_tx_ring_map); in jme_dma_free()
1393 bus_dmamem_free(sc->jme_cdata.jme_tx_ring_tag, in jme_dma_free()
1395 sc->jme_cdata.jme_tx_ring_map); in jme_dma_free()
1398 bus_dma_tag_destroy(sc->jme_cdata.jme_tx_ring_tag); in jme_dma_free()
1399 sc->jme_cdata.jme_tx_ring_tag = NULL; in jme_dma_free()
1402 if (sc->jme_cdata.jme_rx_ring_tag != NULL) { in jme_dma_free()
1404 bus_dmamap_unload(sc->jme_cdata.jme_rx_ring_tag, in jme_dma_free()
1405 sc->jme_cdata.jme_rx_ring_map); in jme_dma_free()
1407 bus_dmamem_free(sc->jme_cdata.jme_rx_ring_tag, in jme_dma_free()
1409 sc->jme_cdata.jme_rx_ring_map); in jme_dma_free()
1412 bus_dma_tag_destroy(sc->jme_cdata.jme_rx_ring_tag); in jme_dma_free()
1413 sc->jme_cdata.jme_rx_ring_tag = NULL; in jme_dma_free()
1416 if (sc->jme_cdata.jme_tx_tag != NULL) { in jme_dma_free()
1418 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_dma_free()
1420 bus_dmamap_destroy(sc->jme_cdata.jme_tx_tag, in jme_dma_free()
1425 bus_dma_tag_destroy(sc->jme_cdata.jme_tx_tag); in jme_dma_free()
1426 sc->jme_cdata.jme_tx_tag = NULL; in jme_dma_free()
1429 if (sc->jme_cdata.jme_rx_tag != NULL) { in jme_dma_free()
1431 rxd = &sc->jme_cdata.jme_rxdesc[i]; in jme_dma_free()
1433 bus_dmamap_destroy(sc->jme_cdata.jme_rx_tag, in jme_dma_free()
1438 if (sc->jme_cdata.jme_rx_sparemap != NULL) { in jme_dma_free()
1439 bus_dmamap_destroy(sc->jme_cdata.jme_rx_tag, in jme_dma_free()
1440 sc->jme_cdata.jme_rx_sparemap); in jme_dma_free()
1441 sc->jme_cdata.jme_rx_sparemap = NULL; in jme_dma_free()
1443 bus_dma_tag_destroy(sc->jme_cdata.jme_rx_tag); in jme_dma_free()
1444 sc->jme_cdata.jme_rx_tag = NULL; in jme_dma_free()
1448 if (sc->jme_cdata.jme_ssb_tag != NULL) { in jme_dma_free()
1450 bus_dmamap_unload(sc->jme_cdata.jme_ssb_tag, in jme_dma_free()
1451 sc->jme_cdata.jme_ssb_map); in jme_dma_free()
1453 bus_dmamem_free(sc->jme_cdata.jme_ssb_tag, in jme_dma_free()
1455 sc->jme_cdata.jme_ssb_map); in jme_dma_free()
1458 bus_dma_tag_destroy(sc->jme_cdata.jme_ssb_tag); in jme_dma_free()
1459 sc->jme_cdata.jme_ssb_tag = NULL; in jme_dma_free()
1462 if (sc->jme_cdata.jme_buffer_tag != NULL) { in jme_dma_free()
1463 bus_dma_tag_destroy(sc->jme_cdata.jme_buffer_tag); in jme_dma_free()
1464 sc->jme_cdata.jme_buffer_tag = NULL; in jme_dma_free()
1466 if (sc->jme_cdata.jme_ring_tag != NULL) { in jme_dma_free()
1467 bus_dma_tag_destroy(sc->jme_cdata.jme_ring_tag); in jme_dma_free()
1468 sc->jme_cdata.jme_ring_tag = NULL; in jme_dma_free()
1733 prod = sc->jme_cdata.jme_tx_prod; in jme_encap()
1734 txd = &sc->jme_cdata.jme_txdesc[prod]; in jme_encap()
1736 error = bus_dmamap_load_mbuf_sg(sc->jme_cdata.jme_tx_tag, in jme_encap()
1746 error = bus_dmamap_load_mbuf_sg(sc->jme_cdata.jme_tx_tag, in jme_encap()
1766 if (sc->jme_cdata.jme_tx_cnt + nsegs + 1 > JME_TX_RING_CNT - 1) { in jme_encap()
1767 bus_dmamap_unload(sc->jme_cdata.jme_tx_tag, txd->tx_dmamap); in jme_encap()
1798 sc->jme_cdata.jme_tx_cnt++; in jme_encap()
1806 sc->jme_cdata.jme_tx_cnt++; in jme_encap()
1811 sc->jme_cdata.jme_tx_prod = prod; in jme_encap()
1823 bus_dmamap_sync(sc->jme_cdata.jme_tx_tag, txd->tx_dmamap, in jme_encap()
1825 bus_dmamap_sync(sc->jme_cdata.jme_tx_ring_tag, in jme_encap()
1826 sc->jme_cdata.jme_tx_ring_map, in jme_encap()
1854 if (sc->jme_cdata.jme_tx_cnt >= JME_TX_DESC_HIWAT) in jme_start_locked()
1919 if (sc->jme_cdata.jme_tx_cnt == 0) { in jme_watchdog()
2228 if (sc->jme_cdata.jme_rxhead != NULL) in jme_link_task()
2229 m_freem(sc->jme_cdata.jme_rxhead); in jme_link_task()
2232 if (sc->jme_cdata.jme_tx_cnt != 0) { in jme_link_task()
2235 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_link_task()
2238 sc->jme_cdata.jme_tx_tag, in jme_link_task()
2242 sc->jme_cdata.jme_tx_tag, in jme_link_task()
2256 sc->jme_cdata.jme_rx_cons = 0; in jme_link_task()
2396 cons = sc->jme_cdata.jme_tx_cons; in jme_txeof()
2397 if (cons == sc->jme_cdata.jme_tx_prod) in jme_txeof()
2400 bus_dmamap_sync(sc->jme_cdata.jme_tx_ring_tag, in jme_txeof()
2401 sc->jme_cdata.jme_tx_ring_map, in jme_txeof()
2408 for (; cons != sc->jme_cdata.jme_tx_prod;) { in jme_txeof()
2409 txd = &sc->jme_cdata.jme_txdesc[cons]; in jme_txeof()
2436 bus_dmamap_sync(sc->jme_cdata.jme_tx_tag, txd->tx_dmamap, in jme_txeof()
2438 bus_dmamap_unload(sc->jme_cdata.jme_tx_tag, txd->tx_dmamap); in jme_txeof()
2444 sc->jme_cdata.jme_tx_cnt -= txd->tx_ndesc; in jme_txeof()
2445 KASSERT(sc->jme_cdata.jme_tx_cnt >= 0, in jme_txeof()
2450 sc->jme_cdata.jme_tx_cons = cons; in jme_txeof()
2452 if (sc->jme_cdata.jme_tx_cnt == 0) in jme_txeof()
2455 bus_dmamap_sync(sc->jme_cdata.jme_tx_ring_tag, in jme_txeof()
2456 sc->jme_cdata.jme_tx_ring_map, in jme_txeof()
2485 cons = sc->jme_cdata.jme_rx_cons; in jme_rxeof()
2490 sc->jme_cdata.jme_rxlen = JME_RX_BYTES(status) - JME_RX_PAD_BYTES; in jme_rxeof()
2493 jme_discard_rxbuf(sc, sc->jme_cdata.jme_rx_cons); in jme_rxeof()
2498 sc->jme_cdata.jme_rx_cons += nsegs; in jme_rxeof()
2499 sc->jme_cdata.jme_rx_cons %= JME_RX_RING_CNT; in jme_rxeof()
2505 rxd = &sc->jme_cdata.jme_rxdesc[cons]; in jme_rxeof()
2515 if (sc->jme_cdata.jme_rxhead != NULL) { in jme_rxeof()
2516 m_freem(sc->jme_cdata.jme_rxhead); in jme_rxeof()
2530 if (sc->jme_cdata.jme_rxhead == NULL) { in jme_rxeof()
2531 sc->jme_cdata.jme_rxhead = mp; in jme_rxeof()
2532 sc->jme_cdata.jme_rxtail = mp; in jme_rxeof()
2539 sc->jme_cdata.jme_rxtail->m_next = mp; in jme_rxeof()
2540 sc->jme_cdata.jme_rxtail = mp; in jme_rxeof()
2545 m = sc->jme_cdata.jme_rxhead; in jme_rxeof()
2547 m->m_pkthdr.len = sc->jme_cdata.jme_rxlen; in jme_rxeof()
2552 mp->m_len = sc->jme_cdata.jme_rxlen - in jme_rxeof()
2556 m->m_len = sc->jme_cdata.jme_rxlen; in jme_rxeof()
2603 sc->jme_cdata.jme_rx_cons += nsegs; in jme_rxeof()
2604 sc->jme_cdata.jme_rx_cons %= JME_RX_RING_CNT; in jme_rxeof()
2613 bus_dmamap_sync(sc->jme_cdata.jme_rx_ring_tag, in jme_rxintr()
2614 sc->jme_cdata.jme_rx_ring_map, in jme_rxintr()
2618 desc = &sc->jme_rdata.jme_rx_ring[sc->jme_cdata.jme_rx_cons]; in jme_rxintr()
2640 bus_dmamap_sync(sc->jme_cdata.jme_rx_ring_tag, in jme_rxintr()
2641 sc->jme_cdata.jme_rx_ring_map, in jme_rxintr()
2999 if (sc->jme_cdata.jme_rxhead != NULL) in jme_stop()
3000 m_freem(sc->jme_cdata.jme_rxhead); in jme_stop()
3007 rxd = &sc->jme_cdata.jme_rxdesc[i]; in jme_stop()
3009 bus_dmamap_sync(sc->jme_cdata.jme_rx_tag, in jme_stop()
3011 bus_dmamap_unload(sc->jme_cdata.jme_rx_tag, in jme_stop()
3018 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_stop()
3020 bus_dmamap_sync(sc->jme_cdata.jme_tx_tag, in jme_stop()
3022 bus_dmamap_unload(sc->jme_cdata.jme_tx_tag, in jme_stop()
3080 sc->jme_cdata.jme_tx_prod = 0; in jme_init_tx_ring()
3081 sc->jme_cdata.jme_tx_cons = 0; in jme_init_tx_ring()
3082 sc->jme_cdata.jme_tx_cnt = 0; in jme_init_tx_ring()
3087 txd = &sc->jme_cdata.jme_txdesc[i]; in jme_init_tx_ring()
3093 bus_dmamap_sync(sc->jme_cdata.jme_tx_ring_tag, in jme_init_tx_ring()
3094 sc->jme_cdata.jme_tx_ring_map, in jme_init_tx_ring()
3105 bus_dmamap_sync(sc->jme_cdata.jme_ssb_tag, sc->jme_cdata.jme_ssb_map, in jme_init_ssb()
3116 sc->jme_cdata.jme_rx_cons = 0; in jme_init_rx_ring()
3123 rxd = &sc->jme_cdata.jme_rxdesc[i]; in jme_init_rx_ring()
3130 bus_dmamap_sync(sc->jme_cdata.jme_rx_ring_tag, in jme_init_rx_ring()
3131 sc->jme_cdata.jme_rx_ring_map, in jme_init_rx_ring()
3157 if (bus_dmamap_load_mbuf_sg(sc->jme_cdata.jme_rx_tag, in jme_newbuf()
3158 sc->jme_cdata.jme_rx_sparemap, m, segs, &nsegs, 0) != 0) { in jme_newbuf()
3165 bus_dmamap_sync(sc->jme_cdata.jme_rx_tag, rxd->rx_dmamap, in jme_newbuf()
3167 bus_dmamap_unload(sc->jme_cdata.jme_rx_tag, rxd->rx_dmamap); in jme_newbuf()
3170 rxd->rx_dmamap = sc->jme_cdata.jme_rx_sparemap; in jme_newbuf()
3171 sc->jme_cdata.jme_rx_sparemap = map; in jme_newbuf()
3172 bus_dmamap_sync(sc->jme_cdata.jme_rx_tag, rxd->rx_dmamap, in jme_newbuf()