diff options
author | arr <arr@FreeBSD.org> | 2002-06-24 05:03:44 +0000 |
---|---|---|
committer | arr <arr@FreeBSD.org> | 2002-06-24 05:03:44 +0000 |
commit | a9c60c7d01d792a0c880fe7f17c555063ac6daf1 (patch) | |
tree | 0aedaccd194d1b31cf0a5f8fecc094e0552782f5 /sys/dev | |
parent | 5a5ffdbe70097e701e6e8fd144bedfbc6fa57009 (diff) | |
download | FreeBSD-src-a9c60c7d01d792a0c880fe7f17c555063ac6daf1.zip FreeBSD-src-a9c60c7d01d792a0c880fe7f17c555063ac6daf1.tar.gz |
- Remove DMA_* macros as only one, DMA_GET_ADDR, was used.
- Convert DMA_GET_ADDR() calls to vtophys() calls in order to finish
removing the DMA_* macros.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/hea/eni_transmit.c | 6 | ||||
-rw-r--r-- | sys/dev/hfa/fore_buffer.c | 34 | ||||
-rw-r--r-- | sys/dev/hfa/fore_command.c | 13 | ||||
-rw-r--r-- | sys/dev/hfa/fore_if.c | 2 | ||||
-rw-r--r-- | sys/dev/hfa/fore_init.c | 3 | ||||
-rw-r--r-- | sys/dev/hfa/fore_load.c | 4 | ||||
-rw-r--r-- | sys/dev/hfa/fore_output.c | 3 | ||||
-rw-r--r-- | sys/dev/hfa/fore_receive.c | 17 | ||||
-rw-r--r-- | sys/dev/hfa/fore_stats.c | 3 | ||||
-rw-r--r-- | sys/dev/hfa/fore_transmit.c | 15 | ||||
-rw-r--r-- | sys/dev/hfa/hfa_freebsd.c | 10 |
11 files changed, 15 insertions, 95 deletions
diff --git a/sys/dev/hea/eni_transmit.c b/sys/dev/hea/eni_transmit.c index fc34a76..914ef32 100644 --- a/sys/dev/hea/eni_transmit.c +++ b/sys/dev/hea/eni_transmit.c @@ -143,7 +143,7 @@ int size; if ( dsize ) { dma_list[(*idx)++] = ( dsize >> 3 ) << DMA_COUNT_SHIFT | val << DMA_VCC_SHIFT | DMA_8WORD; - dma_list[*idx] = (u_long)DMA_GET_ADDR ( addr, dsize, 0, 0 ); + dma_list[*idx] = (u_long)vtophys(addr); if ( dma_list[*idx] == 0 ) { if ( rx ) eup->eu_stats.eni_st_drv.drv_rv_segdma++; @@ -183,7 +183,7 @@ int size; if ( dsize ) { dma_list[(*idx)++] = ( dsize >> 2 ) << DMA_COUNT_SHIFT | val << DMA_VCC_SHIFT | DMA_4WORD; - dma_list[*idx] = (u_long)DMA_GET_ADDR ( addr, dsize, 0, 0 ); + dma_list[*idx] = (u_long)vtophys(addr); if ( dma_list[*idx] == 0 ) { if ( rx ) eup->eu_stats.eni_st_drv.drv_rv_segdma++; @@ -218,7 +218,7 @@ int size; if ( size ) { dma_list[(*idx)++] = ( size ) << DMA_COUNT_SHIFT | val << DMA_VCC_SHIFT | DMA_WORD; - dma_list[*idx] = (u_long)DMA_GET_ADDR ( addr, size, 0, 0 ); + dma_list[*idx] = (u_long)vtophys(addr); if ( dma_list[*idx] == 0 ) { if ( rx ) eup->eu_stats.eni_st_drv.drv_rv_segdma++; diff --git a/sys/dev/hfa/fore_buffer.c b/sys/dev/hfa/fore_buffer.c index 74fec2c..a2bd508 100644 --- a/sys/dev/hfa/fore_buffer.c +++ b/sys/dev/hfa/fore_buffer.c @@ -107,9 +107,7 @@ fore_buf_allocate(fup) fup->fu_buf1s_stat = (Q_status *) memp; fup->fu_buf1l_stat = ((Q_status *) memp) + BUF1_SM_QUELEN; - memp = DMA_GET_ADDR(fup->fu_buf1s_stat, - sizeof(Q_status) * (BUF1_SM_QUELEN + BUF1_LG_QUELEN), - QSTAT_ALIGN, ATM_DEV_NONCACHE); + memp = (caddr_t)vtophys(fup->fu_buf1s_stat); if (memp == NULL) { return (1); } @@ -130,10 +128,7 @@ fore_buf_allocate(fup) fup->fu_buf1l_desc = ((Buf_descr *) memp) + (BUF1_SM_QUELEN * BUF1_SM_ENTSIZE); - memp = DMA_GET_ADDR(fup->fu_buf1s_desc, sizeof(Buf_descr) * - ((BUF1_SM_QUELEN * BUF1_SM_ENTSIZE) + - (BUF1_LG_QUELEN * BUF1_LG_ENTSIZE)), - BUF_DESCR_ALIGN, 0); + memp = (caddr_t)vtophys(fup->fu_buf1s_desc); if (memp == NULL) { return (1); } @@ -410,8 +405,7 @@ fore_buf_supply_1s(fup) */ bdp->bsd_handle = bhp; KB_DATASTART(m, cp, caddr_t); - bhp->bh_dma = bdp->bsd_buffer = (H_dma) DMA_GET_ADDR( - cp, BUF1_SM_SIZE, BUF_DATA_ALIGN, 0); + bhp->bh_dma = bdp->bsd_buffer = vtophys(cp); if (bdp->bsd_buffer == NULL) { /* * Unable to assign dma address - free up @@ -448,7 +442,6 @@ fore_buf_supply_1s(fup) m = (KBuffer *) ((caddr_t)bhp - BUF1_SM_HOFF); KB_DATASTART(m, cp, caddr_t); - DMA_FREE_ADDR(cp, bhp->bh_dma, BUF1_SM_SIZE, 0); KB_FREEALL(m); } break; @@ -552,8 +545,7 @@ fore_buf_supply_1l(fup) */ bdp->bsd_handle = bhp; KB_DATASTART(m, cp, caddr_t); - bhp->bh_dma = bdp->bsd_buffer = (H_dma) DMA_GET_ADDR( - cp, BUF1_LG_SIZE, BUF_DATA_ALIGN, 0); + bhp->bh_dma = bdp->bsd_buffer = vtophys(cp); if (bdp->bsd_buffer == NULL) { /* * Unable to assign dma address - free up @@ -589,7 +581,6 @@ fore_buf_supply_1l(fup) m = (KBuffer *) ((caddr_t)bhp - BUF1_LG_HOFF); KB_DATASTART(m, cp, caddr_t); - DMA_FREE_ADDR(cp, bhp->bh_dma, BUF1_LG_SIZE, 0); KB_FREEALL(m); } break; @@ -736,8 +727,6 @@ fore_buf_free(fup) DEQUEUE(bhp, Buf_handle, bh_qelem, fup->fu_buf1s_bq); KB_DATASTART(m, cp, caddr_t); - DMA_FREE_ADDR(cp, bhp->bh_dma, BUF1_SM_SIZE, 0); - KB_FREEALL(m); } @@ -758,8 +747,6 @@ fore_buf_free(fup) DEQUEUE(bhp, Buf_handle, bh_qelem, fup->fu_buf1l_bq); KB_DATASTART(m, cp, caddr_t); - DMA_FREE_ADDR(cp, bhp->bh_dma, BUF1_LG_SIZE, 0); - KB_FREEALL(m); } } @@ -768,12 +755,6 @@ fore_buf_free(fup) * Free the status words */ if (fup->fu_buf1s_stat) { - if (fup->fu_buf1s_statd) { - DMA_FREE_ADDR(fup->fu_buf1s_stat, fup->fu_buf1s_statd, - sizeof(Q_status) * - (BUF1_SM_QUELEN + BUF1_LG_QUELEN), - ATM_DEV_NONCACHE); - } atm_dev_free((volatile void *)fup->fu_buf1s_stat); fup->fu_buf1s_stat = NULL; fup->fu_buf1s_statd = NULL; @@ -785,13 +766,6 @@ fore_buf_free(fup) * Free the transmit descriptors */ if (fup->fu_buf1s_desc) { - if (fup->fu_buf1s_descd) { - DMA_FREE_ADDR(fup->fu_buf1s_desc, fup->fu_buf1s_descd, - sizeof(Buf_descr) * - ((BUF1_SM_QUELEN * BUF1_SM_ENTSIZE) + - (BUF1_LG_QUELEN * BUF1_LG_ENTSIZE)), - 0); - } atm_dev_free(fup->fu_buf1s_desc); fup->fu_buf1s_desc = NULL; fup->fu_buf1s_descd = NULL; diff --git a/sys/dev/hfa/fore_command.c b/sys/dev/hfa/fore_command.c index d772c56..8616112 100644 --- a/sys/dev/hfa/fore_command.c +++ b/sys/dev/hfa/fore_command.c @@ -103,8 +103,7 @@ fore_cmd_allocate(fup) } fup->fu_cmd_stat = (Q_status *) memp; - memp = DMA_GET_ADDR(fup->fu_cmd_stat, sizeof(Q_status) * CMD_QUELEN, - QSTAT_ALIGN, ATM_DEV_NONCACHE); + memp = (caddr_t)vtophys(fup->fu_cmd_stat); if (memp == NULL) { return (1); } @@ -300,8 +299,6 @@ fore_cmd_drain(fup) */ fup->fu_stats_ret = 0; } - DMA_FREE_ADDR(fup->fu_stats, fup->fu_statsd, - sizeof(Fore_cp_stats), 0); fup->fu_flags &= ~FUF_STATCMD; /* @@ -371,9 +368,6 @@ fore_cmd_drain(fup) fp->pr_hwver & 0xff); fup->fu_config.ac_serial = fp->pr_serno; } - - DMA_FREE_ADDR(fup->fu_prom, fup->fu_promd, - sizeof(Fore_prom), 0); break; default: @@ -451,11 +445,6 @@ fore_cmd_free(fup) * Free the status words */ if (fup->fu_cmd_stat) { - if (fup->fu_cmd_statd) { - DMA_FREE_ADDR(fup->fu_cmd_stat, fup->fu_cmd_statd, - sizeof(Q_status) * CMD_QUELEN, - ATM_DEV_NONCACHE); - } atm_dev_free((volatile void *)fup->fu_cmd_stat); fup->fu_cmd_stat = NULL; fup->fu_cmd_statd = NULL; diff --git a/sys/dev/hfa/fore_if.c b/sys/dev/hfa/fore_if.c index cb43f7e..0859438 100644 --- a/sys/dev/hfa/fore_if.c +++ b/sys/dev/hfa/fore_if.c @@ -219,8 +219,6 @@ fore_interface_free(fup) } if (fup->fu_flags & FUF_STATCMD) { - DMA_FREE_ADDR(fup->fu_stats, fup->fu_statsd, - sizeof(Fore_cp_stats), 0); fup->fu_flags &= ~FUF_STATCMD; } return; diff --git a/sys/dev/hfa/fore_init.c b/sys/dev/hfa/fore_init.c index 35fe207..216ed32a 100644 --- a/sys/dev/hfa/fore_init.c +++ b/sys/dev/hfa/fore_init.c @@ -313,8 +313,7 @@ fore_get_prom(fup) cqp = hcp->hcq_cpelem; (*hcp->hcq_status) = QSTAT_PENDING; - fup->fu_promd = DMA_GET_ADDR(fup->fu_prom, sizeof(Fore_prom), - FORE_PROM_ALIGN, 0); + fup->fu_promd = (Fore_prom *)vtophys(fup->fu_prom); if (fup->fu_promd == NULL) { fup->fu_stats->st_drv.drv_cm_nodma++; return; diff --git a/sys/dev/hfa/fore_load.c b/sys/dev/hfa/fore_load.c index a50ec04..ab4de54 100644 --- a/sys/dev/hfa/fore_load.c +++ b/sys/dev/hfa/fore_load.c @@ -130,10 +130,6 @@ fore_start() ATM_VERS_MAJ(atm_version), ATM_VERS_MIN(atm_version)); return (EINVAL); } - /* - * Initialize DMA mapping - */ - DMA_INIT(); /* * Start up watchdog timer diff --git a/sys/dev/hfa/fore_output.c b/sys/dev/hfa/fore_output.c index a6e6b4d..80b53cb 100644 --- a/sys/dev/hfa/fore_output.c +++ b/sys/dev/hfa/fore_output.c @@ -404,7 +404,7 @@ retry: /* * Get a DMA address for the data */ - dma = DMA_GET_ADDR(bfr, xsp->xsd_len, XMIT_SEG_ALIGN, 0); + dma = (void *)vtophys(bfr); if (dma == NULL) { fup->fu_stats->st_drv.drv_xm_segdma++; fore_seg_dma_free(hxp, m0, nsegs); @@ -472,7 +472,6 @@ fore_seg_dma_free(hxp, m0, nsegs) for (i = 0; i < nsegs; i++) { KB_DATASTART(m, cp, caddr_t); - DMA_FREE_ADDR(cp, *sdmap, KB_LEN(m), 0); m = KB_NEXT(m); sdmap++; } diff --git a/sys/dev/hfa/fore_receive.c b/sys/dev/hfa/fore_receive.c index 0e089f4..4f14edd 100644 --- a/sys/dev/hfa/fore_receive.c +++ b/sys/dev/hfa/fore_receive.c @@ -100,8 +100,7 @@ fore_recv_allocate(fup) } fup->fu_recv_stat = (Q_status *) memp; - memp = DMA_GET_ADDR(fup->fu_recv_stat, sizeof(Q_status) * RECV_QUELEN, - QSTAT_ALIGN, ATM_DEV_NONCACHE); + memp = (caddr_t)vtophys(fup->fu_recv_stat); if (memp == NULL) { return (1); } @@ -117,8 +116,7 @@ fore_recv_allocate(fup) } fup->fu_recv_desc = (Recv_descr *) memp; - memp = DMA_GET_ADDR(fup->fu_recv_desc, - sizeof(Recv_descr) * RECV_QUELEN, RECV_DESCR_ALIGN, 0); + memp = (caddr_t)vtophys(fup->fu_recv_desc); if (memp == NULL) { return (1); } @@ -328,7 +326,6 @@ retry: fup->fu_buf1s_cnt--; m = (KBuffer *) ((caddr_t)bhp - BUF1_SM_HOFF); KB_DATASTART(m, cp, caddr_t); - DMA_FREE_ADDR(cp, bhp->bh_dma, BUF1_SM_SIZE, 0); break; case BHT_S1_LARGE: @@ -337,7 +334,6 @@ retry: fup->fu_buf1l_cnt--; m = (KBuffer *) ((caddr_t)bhp - BUF1_LG_HOFF); KB_DATASTART(m, cp, caddr_t); - DMA_FREE_ADDR(cp, bhp->bh_dma, BUF1_LG_SIZE, 0); break; default: @@ -581,11 +577,6 @@ fore_recv_free(fup) * Free the status words */ if (fup->fu_recv_stat) { - if (fup->fu_recv_statd) { - DMA_FREE_ADDR(fup->fu_recv_stat, fup->fu_recv_statd, - sizeof(Q_status) * RECV_QUELEN, - ATM_DEV_NONCACHE); - } atm_dev_free((volatile void *)fup->fu_recv_stat); fup->fu_recv_stat = NULL; fup->fu_recv_statd = NULL; @@ -595,10 +586,6 @@ fore_recv_free(fup) * Free the receive descriptors */ if (fup->fu_recv_desc) { - if (fup->fu_recv_descd) { - DMA_FREE_ADDR(fup->fu_recv_desc, fup->fu_recv_descd, - sizeof(Recv_descr) * RECV_QUELEN, 0); - } atm_dev_free(fup->fu_recv_desc); fup->fu_recv_desc = NULL; fup->fu_recv_descd = NULL; diff --git a/sys/dev/hfa/fore_stats.c b/sys/dev/hfa/fore_stats.c index 10c7b88..d8518af 100644 --- a/sys/dev/hfa/fore_stats.c +++ b/sys/dev/hfa/fore_stats.c @@ -148,8 +148,7 @@ fore_get_stats(fup) cqp = hcp->hcq_cpelem; (*hcp->hcq_status) = QSTAT_PENDING; - dma = DMA_GET_ADDR(fup->fu_stats, sizeof(Fore_cp_stats), - FORE_STATS_ALIGN, 0); + dma = (void *)vtophys(fup->fu_stats); if (dma == NULL) { fup->fu_stats->st_drv.drv_cm_nodma++; (void) splx(s); diff --git a/sys/dev/hfa/fore_transmit.c b/sys/dev/hfa/fore_transmit.c index e084ab3..006a580 100644 --- a/sys/dev/hfa/fore_transmit.c +++ b/sys/dev/hfa/fore_transmit.c @@ -94,8 +94,7 @@ fore_xmit_allocate(fup) } fup->fu_xmit_stat = (Q_status *) memp; - memp = DMA_GET_ADDR(fup->fu_xmit_stat, sizeof(Q_status) * XMIT_QUELEN, - QSTAT_ALIGN, ATM_DEV_NONCACHE); + memp = (void *)vtophys(fup->fu_xmit_stat); if (memp == NULL) { return (1); } @@ -121,8 +120,7 @@ fore_xmit_allocate(fup) return (1); } - hxp->hxq_descr_dma = DMA_GET_ADDR(hxp->hxq_descr, - sizeof(Xmit_descr), XMIT_DESCR_ALIGN, 0); + hxp->hxq_descr_dma = (Xmit_descr *)vtophys(hxp->hxq_descr); if (hxp->hxq_descr_dma == NULL) { return (1); } @@ -253,7 +251,6 @@ fore_xmit_drain(fup) caddr_t cp; KB_DATASTART(m, cp, caddr_t); - DMA_FREE_ADDR(cp, *sdmap, KB_LEN(m), 0); } KB_FREEALL(hxp->hxq_buf); @@ -346,7 +343,6 @@ fore_xmit_free(fup) caddr_t cp; KB_DATASTART(m, cp, caddr_t); - DMA_FREE_ADDR(cp, *sdmap, KB_LEN(m), 0); } KB_FREEALL(hxp->hxq_buf); @@ -359,11 +355,6 @@ fore_xmit_free(fup) * Free the status words */ if (fup->fu_xmit_stat) { - if (fup->fu_xmit_statd) { - DMA_FREE_ADDR(fup->fu_xmit_stat, fup->fu_xmit_statd, - sizeof(Q_status) * XMIT_QUELEN, - ATM_DEV_NONCACHE); - } atm_dev_free((volatile void *)fup->fu_xmit_stat); fup->fu_xmit_stat = NULL; fup->fu_xmit_statd = NULL; @@ -379,8 +370,6 @@ fore_xmit_free(fup) * Free the transmit descriptor for this queue entry */ if (hxp->hxq_descr_dma) { - DMA_FREE_ADDR(hxp->hxq_descr, hxp->hxq_descr_dma, - sizeof(Xmit_descr), 0); hxp->hxq_descr_dma = NULL; } diff --git a/sys/dev/hfa/hfa_freebsd.c b/sys/dev/hfa/hfa_freebsd.c index 6609072..40af3f8 100644 --- a/sys/dev/hfa/hfa_freebsd.c +++ b/sys/dev/hfa/hfa_freebsd.c @@ -391,11 +391,6 @@ hfa_modevent (module_t mod, int what, void *arg) uma_zone_set_max(fore_vcc_zone, 100); /* - * Initialize DMA mapping - */ - DMA_INIT(); - - /* * Start up watchdog timer */ atm_timeout(&fore_timer, ATM_HZ * FORE_TIME_TICK, fore_timeout); @@ -403,11 +398,6 @@ hfa_modevent (module_t mod, int what, void *arg) break; case MOD_UNLOAD: /* - * Release DMA mapping - */ - DMA_RELEASE(); - - /* * Stop watchdog timer */ atm_untimeout(&fore_timer); |