mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-27 16:39:08 +00:00
Update drivers to use isa_dma_acquire() and isa_dma_release()
Reviewed by: bde
This commit is contained in:
parent
1dce4e5d60
commit
100f78bbe0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15148
@ -43,7 +43,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id: fd.c,v 1.85 1996/04/07 14:46:42 bde Exp $
|
||||
* $Id: fd.c,v 1.86 1996/04/07 17:32:12 bde Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -575,6 +575,8 @@ fdattach(struct isa_device *dev)
|
||||
fdc->fdcu = fdcu;
|
||||
fdc->flags |= FDC_ATTACHED;
|
||||
fdc->dmachan = dev->id_drq;
|
||||
/* Acquire the DMA channel forever, The driver will do the rest */
|
||||
isa_dma_acquire(fdc->dmachan);
|
||||
isa_dmainit(fdc->dmachan, 128 << 3 /* XXX max secsize */);
|
||||
fdc->state = DEVIDLE;
|
||||
/* reset controller, turn motor off, clear fdout mirror reg */
|
||||
|
@ -34,7 +34,7 @@
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/*
|
||||
* $Id: asc.c,v 1.16 1996/01/27 00:53:55 bde Exp $
|
||||
* $Id: asc.c,v 1.17 1996/03/28 14:28:35 scrappy Exp $
|
||||
*/
|
||||
|
||||
#include "asc.h"
|
||||
@ -604,6 +604,9 @@ ascopen(dev_t dev, int flags, int fmt, struct proc *p)
|
||||
lprintf("asc%d.open: already open", unit);
|
||||
return EBUSY;
|
||||
}
|
||||
if (isa_dma_acquire(scu->dma_num))
|
||||
return(EBUSY);
|
||||
|
||||
scu->flags = ATTACHED | OPEN;
|
||||
|
||||
asc_reset(scu);
|
||||
@ -668,6 +671,7 @@ ascclose(dev_t dev, int flags, int fmt, struct proc *p)
|
||||
scu->cfg_byte &= ~ scu->int_byte ; /* disable scanner int */
|
||||
outb(ASC_CFG, scu->cfg_byte);
|
||||
/* --- disable dma controller ? --- */
|
||||
isa_dma_release(scu->dma_num);
|
||||
/* --- disable interrupts on the controller (sub_24) --- */
|
||||
|
||||
scu->sbuf.base = NULL;
|
||||
|
@ -43,7 +43,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id: fd.c,v 1.85 1996/04/07 14:46:42 bde Exp $
|
||||
* $Id: fd.c,v 1.86 1996/04/07 17:32:12 bde Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -575,6 +575,8 @@ fdattach(struct isa_device *dev)
|
||||
fdc->fdcu = fdcu;
|
||||
fdc->flags |= FDC_ATTACHED;
|
||||
fdc->dmachan = dev->id_drq;
|
||||
/* Acquire the DMA channel forever, The driver will do the rest */
|
||||
isa_dma_acquire(fdc->dmachan);
|
||||
isa_dmainit(fdc->dmachan, 128 << 3 /* XXX max secsize */);
|
||||
fdc->state = DEVIDLE;
|
||||
/* reset controller, turn motor off, clear fdout mirror reg */
|
||||
|
@ -600,6 +600,9 @@ gscopen (dev_t dev, int flags, int fmt, struct proc *p)
|
||||
return EBUSY;
|
||||
}
|
||||
|
||||
if (isa_dma_acquire(scu->channel))
|
||||
return(EBUSY);
|
||||
|
||||
scu->flags |= OPEN;
|
||||
|
||||
return SUCCESS;
|
||||
@ -635,6 +638,8 @@ gscclose (dev_t dev, int flags, int fmt, struct proc *p)
|
||||
scu->sbuf.size = INVALID;
|
||||
scu->sbuf.poi = INVALID;
|
||||
|
||||
isa_dma_release(scu->channel);
|
||||
|
||||
scu->flags &= ~(FLAG_DEBUG | OPEN | READING);
|
||||
|
||||
return SUCCESS;
|
||||
|
@ -20,7 +20,7 @@
|
||||
* the original CMU copyright notice.
|
||||
*
|
||||
* Version 1.3, Thu Nov 11 12:09:13 MSK 1993
|
||||
* $Id: wt.c,v 1.30 1996/02/22 00:31:48 joerg Exp $
|
||||
* $Id: wt.c,v 1.31 1996/03/28 14:28:55 scrappy Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -392,6 +392,9 @@ wtopen (dev_t dev, int flag, int fmt, struct proc *p)
|
||||
if (! t->buf)
|
||||
return (EAGAIN);
|
||||
|
||||
if (isa_dma_acquire(t->chan))
|
||||
return(EBUSY);
|
||||
|
||||
t->flags = TPINUSE;
|
||||
kdc_wt[u].kdc_state = DC_BUSY;
|
||||
|
||||
@ -445,6 +448,7 @@ wtclose (dev_t dev, int flags, int fmt, struct proc *p)
|
||||
t->flags &= TPREW | TPRMARK | TPSTART | TPTIMER;
|
||||
kdc_wt[u].kdc_state = DC_IDLE;
|
||||
free (t->buf, M_TEMP);
|
||||
isa_dma_release(t->chan);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id: fd.c,v 1.85 1996/04/07 14:46:42 bde Exp $
|
||||
* $Id: fd.c,v 1.86 1996/04/07 17:32:12 bde Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -575,6 +575,8 @@ fdattach(struct isa_device *dev)
|
||||
fdc->fdcu = fdcu;
|
||||
fdc->flags |= FDC_ATTACHED;
|
||||
fdc->dmachan = dev->id_drq;
|
||||
/* Acquire the DMA channel forever, The driver will do the rest */
|
||||
isa_dma_acquire(fdc->dmachan);
|
||||
isa_dmainit(fdc->dmachan, 128 << 3 /* XXX max secsize */);
|
||||
fdc->state = DEVIDLE;
|
||||
/* reset controller, turn motor off, clear fdout mirror reg */
|
||||
|
Loading…
Reference in New Issue
Block a user