Lines Matching refs:sf_cdata
1018 &sc->sf_cdata.sf_parent_tag);
1024 error = bus_dma_tag_create(sc->sf_cdata.sf_parent_tag,/* parent */
1034 &sc->sf_cdata.sf_tx_ring_tag);
1041 error = bus_dma_tag_create(sc->sf_cdata.sf_parent_tag,/* parent */
1051 &sc->sf_cdata.sf_tx_cring_tag);
1059 error = bus_dma_tag_create(sc->sf_cdata.sf_parent_tag,/* parent */
1069 &sc->sf_cdata.sf_rx_ring_tag);
1077 error = bus_dma_tag_create(sc->sf_cdata.sf_parent_tag,/* parent */
1087 &sc->sf_cdata.sf_rx_cring_tag);
1095 error = bus_dma_tag_create(sc->sf_cdata.sf_parent_tag,/* parent */
1105 &sc->sf_cdata.sf_tx_tag);
1112 error = bus_dma_tag_create(sc->sf_cdata.sf_parent_tag,/* parent */
1122 &sc->sf_cdata.sf_rx_tag);
1129 error = bus_dmamem_alloc(sc->sf_cdata.sf_tx_ring_tag,
1131 BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->sf_cdata.sf_tx_ring_map);
1139 error = bus_dmamap_load(sc->sf_cdata.sf_tx_ring_tag,
1140 sc->sf_cdata.sf_tx_ring_map, sc->sf_rdata.sf_tx_ring,
1152 error = bus_dmamem_alloc(sc->sf_cdata.sf_tx_cring_tag,
1154 BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->sf_cdata.sf_tx_cring_map);
1163 error = bus_dmamap_load(sc->sf_cdata.sf_tx_cring_tag,
1164 sc->sf_cdata.sf_tx_cring_map, sc->sf_rdata.sf_tx_cring,
1174 error = bus_dmamem_alloc(sc->sf_cdata.sf_rx_ring_tag,
1176 BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->sf_cdata.sf_rx_ring_map);
1184 error = bus_dmamap_load(sc->sf_cdata.sf_rx_ring_tag,
1185 sc->sf_cdata.sf_rx_ring_map, sc->sf_rdata.sf_rx_ring,
1197 error = bus_dmamem_alloc(sc->sf_cdata.sf_rx_cring_tag,
1199 BUS_DMA_COHERENT | BUS_DMA_ZERO, &sc->sf_cdata.sf_rx_cring_map);
1208 error = bus_dmamap_load(sc->sf_cdata.sf_rx_cring_tag,
1209 sc->sf_cdata.sf_rx_cring_map, sc->sf_rdata.sf_rx_cring,
1249 txd = &sc->sf_cdata.sf_txdesc[i];
1253 error = bus_dmamap_create(sc->sf_cdata.sf_tx_tag, 0,
1262 if ((error = bus_dmamap_create(sc->sf_cdata.sf_rx_tag, 0,
1263 &sc->sf_cdata.sf_rx_sparemap)) != 0) {
1269 rxd = &sc->sf_cdata.sf_rxdesc[i];
1272 error = bus_dmamap_create(sc->sf_cdata.sf_rx_tag, 0,
1293 if (sc->sf_cdata.sf_tx_ring_tag) {
1294 if (sc->sf_cdata.sf_tx_ring_map)
1295 bus_dmamap_unload(sc->sf_cdata.sf_tx_ring_tag,
1296 sc->sf_cdata.sf_tx_ring_map);
1297 if (sc->sf_cdata.sf_tx_ring_map &&
1299 bus_dmamem_free(sc->sf_cdata.sf_tx_ring_tag,
1301 sc->sf_cdata.sf_tx_ring_map);
1303 sc->sf_cdata.sf_tx_ring_map = NULL;
1304 bus_dma_tag_destroy(sc->sf_cdata.sf_tx_ring_tag);
1305 sc->sf_cdata.sf_tx_ring_tag = NULL;
1308 if (sc->sf_cdata.sf_tx_cring_tag) {
1309 if (sc->sf_cdata.sf_tx_cring_map)
1310 bus_dmamap_unload(sc->sf_cdata.sf_tx_cring_tag,
1311 sc->sf_cdata.sf_tx_cring_map);
1312 if (sc->sf_cdata.sf_tx_cring_map &&
1314 bus_dmamem_free(sc->sf_cdata.sf_tx_cring_tag,
1316 sc->sf_cdata.sf_tx_cring_map);
1318 sc->sf_cdata.sf_tx_cring_map = NULL;
1319 bus_dma_tag_destroy(sc->sf_cdata.sf_tx_cring_tag);
1320 sc->sf_cdata.sf_tx_cring_tag = NULL;
1323 if (sc->sf_cdata.sf_rx_ring_tag) {
1324 if (sc->sf_cdata.sf_rx_ring_map)
1325 bus_dmamap_unload(sc->sf_cdata.sf_rx_ring_tag,
1326 sc->sf_cdata.sf_rx_ring_map);
1327 if (sc->sf_cdata.sf_rx_ring_map &&
1329 bus_dmamem_free(sc->sf_cdata.sf_rx_ring_tag,
1331 sc->sf_cdata.sf_rx_ring_map);
1333 sc->sf_cdata.sf_rx_ring_map = NULL;
1334 bus_dma_tag_destroy(sc->sf_cdata.sf_rx_ring_tag);
1335 sc->sf_cdata.sf_rx_ring_tag = NULL;
1338 if (sc->sf_cdata.sf_rx_cring_tag) {
1339 if (sc->sf_cdata.sf_rx_cring_map)
1340 bus_dmamap_unload(sc->sf_cdata.sf_rx_cring_tag,
1341 sc->sf_cdata.sf_rx_cring_map);
1342 if (sc->sf_cdata.sf_rx_cring_map &&
1344 bus_dmamem_free(sc->sf_cdata.sf_rx_cring_tag,
1346 sc->sf_cdata.sf_rx_cring_map);
1348 sc->sf_cdata.sf_rx_cring_map = NULL;
1349 bus_dma_tag_destroy(sc->sf_cdata.sf_rx_cring_tag);
1350 sc->sf_cdata.sf_rx_cring_tag = NULL;
1353 if (sc->sf_cdata.sf_tx_tag) {
1355 txd = &sc->sf_cdata.sf_txdesc[i];
1357 bus_dmamap_destroy(sc->sf_cdata.sf_tx_tag,
1362 bus_dma_tag_destroy(sc->sf_cdata.sf_tx_tag);
1363 sc->sf_cdata.sf_tx_tag = NULL;
1366 if (sc->sf_cdata.sf_rx_tag) {
1368 rxd = &sc->sf_cdata.sf_rxdesc[i];
1370 bus_dmamap_destroy(sc->sf_cdata.sf_rx_tag,
1375 if (sc->sf_cdata.sf_rx_sparemap) {
1376 bus_dmamap_destroy(sc->sf_cdata.sf_rx_tag,
1377 sc->sf_cdata.sf_rx_sparemap);
1378 sc->sf_cdata.sf_rx_sparemap = 0;
1380 bus_dma_tag_destroy(sc->sf_cdata.sf_rx_tag);
1381 sc->sf_cdata.sf_rx_tag = NULL;
1384 if (sc->sf_cdata.sf_parent_tag) {
1385 bus_dma_tag_destroy(sc->sf_cdata.sf_parent_tag);
1386 sc->sf_cdata.sf_parent_tag = NULL;
1396 sc->sf_cdata.sf_rxc_cons = 0;
1407 bus_dmamap_sync(sc->sf_cdata.sf_rx_cring_tag,
1408 sc->sf_cdata.sf_rx_cring_map,
1410 bus_dmamap_sync(sc->sf_cdata.sf_rx_ring_tag,
1411 sc->sf_cdata.sf_rx_ring_map,
1423 sc->sf_cdata.sf_tx_prod = 0;
1424 sc->sf_cdata.sf_tx_cnt = 0;
1425 sc->sf_cdata.sf_txc_cons = 0;
1432 sc->sf_cdata.sf_txdesc[i].tx_m = NULL;
1433 sc->sf_cdata.sf_txdesc[i].ndesc = 0;
1437 bus_dmamap_sync(sc->sf_cdata.sf_tx_ring_tag,
1438 sc->sf_cdata.sf_tx_ring_map,
1440 bus_dmamap_sync(sc->sf_cdata.sf_tx_cring_tag,
1441 sc->sf_cdata.sf_tx_cring_map,
1464 if (bus_dmamap_load_mbuf_sg(sc->sf_cdata.sf_rx_tag,
1465 sc->sf_cdata.sf_rx_sparemap, m, segs, &nsegs, 0) != 0) {
1471 rxd = &sc->sf_cdata.sf_rxdesc[idx];
1473 bus_dmamap_sync(sc->sf_cdata.sf_rx_tag, rxd->rx_dmamap,
1475 bus_dmamap_unload(sc->sf_cdata.sf_rx_tag, rxd->rx_dmamap);
1478 rxd->rx_dmamap = sc->sf_cdata.sf_rx_sparemap;
1479 sc->sf_cdata.sf_rx_sparemap = map;
1480 bus_dmamap_sync(sc->sf_cdata.sf_rx_tag, rxd->rx_dmamap,
1539 bus_dmamap_sync(sc->sf_cdata.sf_rx_ring_tag,
1540 sc->sf_cdata.sf_rx_ring_map,
1542 bus_dmamap_sync(sc->sf_cdata.sf_rx_cring_tag,
1543 sc->sf_cdata.sf_rx_cring_map,
1552 for (cons = sc->sf_cdata.sf_rxc_cons;
1568 rxd = &sc->sf_cdata.sf_rxdesc[eidx];
1660 sc->sf_cdata.sf_rxc_cons = cons;
1661 bus_dmamap_sync(sc->sf_cdata.sf_rx_ring_tag,
1662 sc->sf_cdata.sf_rx_ring_map,
1664 bus_dmamap_sync(sc->sf_cdata.sf_rx_cring_tag,
1665 sc->sf_cdata.sf_rx_cring_map,
1701 bus_dmamap_sync(sc->sf_cdata.sf_tx_cring_tag,
1702 sc->sf_cdata.sf_tx_cring_map,
1705 cons = sc->sf_cdata.sf_txc_cons;
1729 txd = &sc->sf_cdata.sf_txdesc[idx];
1731 bus_dmamap_sync(sc->sf_cdata.sf_tx_tag,
1734 bus_dmamap_unload(sc->sf_cdata.sf_tx_tag,
1739 sc->sf_cdata.sf_tx_cnt -= txd->ndesc;
1740 KASSERT(sc->sf_cdata.sf_tx_cnt >= 0,
1756 sc->sf_cdata.sf_txc_cons = cons;
1757 bus_dmamap_sync(sc->sf_cdata.sf_tx_cring_tag,
1758 sc->sf_cdata.sf_tx_cring_map,
1761 if (sc->sf_cdata.sf_tx_cnt == 0)
2168 prod = sc->sf_cdata.sf_tx_prod;
2169 txd = &sc->sf_cdata.sf_txdesc[prod];
2171 error = bus_dmamap_load_mbuf_sg(sc->sf_cdata.sf_tx_tag, map,
2181 error = bus_dmamap_load_mbuf_sg(sc->sf_cdata.sf_tx_tag,
2197 avail = (SF_TX_DLIST_CNT - 1) - sc->sf_cdata.sf_tx_cnt;
2199 bus_dmamap_unload(sc->sf_cdata.sf_tx_tag, map);
2206 bus_dmamap_unload(sc->sf_cdata.sf_tx_tag, map);
2211 bus_dmamap_sync(sc->sf_cdata.sf_tx_tag, map, BUS_DMASYNC_PREWRITE);
2228 sc->sf_cdata.sf_tx_prod = prod;
2229 sc->sf_cdata.sf_tx_cnt += nsegs + nskip;
2276 sc->sf_cdata.sf_tx_cnt < SF_TX_DLIST_CNT - SF_MAXTXSEGS; ) {
2302 bus_dmamap_sync(sc->sf_cdata.sf_tx_ring_tag,
2303 sc->sf_cdata.sf_tx_ring_map,
2307 sc->sf_cdata.sf_tx_prod * (sizeof(struct sf_tx_rdesc) / 8));
2355 rxd = &sc->sf_cdata.sf_rxdesc[i];
2357 bus_dmamap_sync(sc->sf_cdata.sf_rx_tag,
2359 bus_dmamap_unload(sc->sf_cdata.sf_rx_tag,
2366 txd = &sc->sf_cdata.sf_txdesc[i];
2368 bus_dmamap_sync(sc->sf_cdata.sf_tx_tag,
2370 bus_dmamap_unload(sc->sf_cdata.sf_tx_tag,
2559 sc->sf_cdata.sf_tx_cnt);