Lines Matching defs:rp

974 	efe_ring_t *rp;
978 rp = efep->efe_rx_ring;
980 for (int i = 0; i < DESCLEN(rp); ++i) {
981 efe_desc_t *dp = GETDESC(rp, i);
982 efe_buf_t *bp = GETBUF(rp, i);
984 PUTDESC16(rp, &dp->d_status, RXSTAT_OWNER);
985 PUTDESC16(rp, &dp->d_len, 0);
986 PUTDESC32(rp, &dp->d_bufaddr, BUFADDR(bp));
987 PUTDESC16(rp, &dp->d_buflen, BUFLEN(bp));
988 PUTDESC16(rp, &dp->d_control, 0);
989 PUTDESC32(rp, &dp->d_next, NEXTDESCADDR(rp, i));
991 SYNCDESC(rp, i, DDI_DMA_SYNC_FORDEV);
996 PUTCSR(efep, CSR_PRCDAR, DESCADDR(rp, 0));
1002 efe_ring_t *rp;
1006 rp = efep->efe_tx_ring;
1008 for (int i = 0; i < DESCLEN(rp); ++i) {
1009 efe_desc_t *dp = GETDESC(rp, i);
1010 efe_buf_t *bp = GETBUF(rp, i);
1012 PUTDESC16(rp, &dp->d_status, 0);
1013 PUTDESC16(rp, &dp->d_len, 0);
1014 PUTDESC32(rp, &dp->d_bufaddr, BUFADDR(bp));
1015 PUTDESC16(rp, &dp->d_buflen, BUFLEN(bp));
1016 PUTDESC16(rp, &dp->d_control, 0);
1017 PUTDESC32(rp, &dp->d_next, NEXTDESCADDR(rp, i));
1019 SYNCDESC(rp, i, DDI_DMA_SYNC_FORDEV);
1025 PUTCSR(efep, CSR_PTCDAR, DESCADDR(rp, 0));
1149 efe_ring_t *rp;
1155 rp = kmem_zalloc(sizeof (efe_ring_t), KM_SLEEP);
1156 rp->r_len = len;
1159 &rp->r_dmah) != DDI_SUCCESS) {
1164 if (ddi_dma_mem_alloc(rp->r_dmah, DESCSZ(len), &efe_buf_acc_attr,
1165 DDI_DMA_CONSISTENT, DDI_DMA_SLEEP, NULL, (caddr_t *)&rp->r_descp,
1166 &rlen, &rp->r_acch) != DDI_SUCCESS) {
1171 if (ddi_dma_addr_bind_handle(rp->r_dmah, NULL, (caddr_t)rp->r_descp,
1173 NULL, &rp->r_dmac, &ccount) != DDI_DMA_MAPPED) {
1178 rp->r_bufpp = kmem_zalloc(BUFPSZ(len), KM_SLEEP);
1185 rp->r_bufpp[i] = bp;
1188 return (rp);
1191 efe_ring_free(&rp);
1199 efe_ring_t *rp = *rpp;
1201 ASSERT(rp != NULL);
1203 for (int i = 0; i < DESCLEN(rp); ++i) {
1204 efe_buf_t *bp = GETBUF(rp, i);
1209 kmem_free(rp->r_bufpp, BUFPSZ(DESCLEN(rp)));
1211 if (rp->r_descp != NULL) {
1212 (void) ddi_dma_unbind_handle(rp->r_dmah);
1214 if (rp->r_acch != NULL) {
1215 ddi_dma_mem_free(&rp->r_acch);
1217 if (rp->r_dmah != NULL) {
1218 ddi_dma_free_handle(&rp->r_dmah);
1220 kmem_free(rp, sizeof (efe_ring_t));
1304 efe_ring_t *rp;
1310 rp = efep->efe_rx_ring;
1316 dp = GETDESC(rp, efep->efe_rx_desc);
1317 SYNCDESC(rp, efep->efe_rx_desc, DDI_DMA_SYNC_FORKERNEL);
1319 status = GETDESC16(rp, &dp->d_status);
1348 PUTDESC16(rp, &dp->d_status, RXSTAT_OWNER);
1350 SYNCDESC(rp, efep->efe_rx_desc, DDI_DMA_SYNC_FORDEV);
1352 efep->efe_rx_desc = NEXTDESC(rp, efep->efe_rx_desc);
1361 efe_ring_t *rp;
1369 rp = efep->efe_rx_ring;
1371 len = GETDESC16(rp, &dp->d_len) - ETHERFCSL;
1393 bp = GETBUF(rp, efep->efe_rx_desc);
1401 status = GETDESC16(rp, &dp->d_status);
1416 efe_ring_t *rp;
1424 rp = efep->efe_tx_ring;
1435 dp = GETDESC(rp, efep->efe_tx_desc);
1436 SYNCDESC(rp, efep->efe_tx_desc, DDI_DMA_SYNC_FORKERNEL);
1445 bp = GETBUF(rp, efep->efe_tx_desc);
1460 PUTDESC16(rp, &dp->d_status, TXSTAT_OWNER);
1461 PUTDESC16(rp, &dp->d_len, len);
1462 PUTDESC16(rp, &dp->d_control, TXCTL_LASTDESCR);
1464 SYNCDESC(rp, efep->efe_tx_desc, DDI_DMA_SYNC_FORDEV);
1477 efep->efe_tx_desc = NEXTDESC(rp, efep->efe_tx_desc);
1485 efe_ring_t *rp;
1489 rp = efep->efe_tx_ring;
1495 dp = GETDESC(rp, efep->efe_tx_sent);
1496 SYNCDESC(rp, efep->efe_tx_sent, DDI_DMA_SYNC_FORKERNEL);
1498 status = GETDESC16(rp, &dp->d_status);
1536 efep->efe_tx_sent = NEXTDESC(rp, efep->efe_tx_sent);