Prefix 'dma_data{in,out}_cmd' with 'scsi_', since that's what they're used

for. Also, remove the 'clk_freq' variable, since this value differs on a
per-platform (IP12 is 20MHz, others are 10MHz) basis.

NB: I have no idea what frequency the GIO SCSI cards use. We'll have to
    re-investigate this if we ever come across one.
This commit is contained in:
rumble 2006-12-22 23:36:42 +00:00
parent ee970eec94
commit 75aae500a9
3 changed files with 23 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpc.c,v 1.48 2006/12/22 23:25:28 rumble Exp $ */
/* $NetBSD: hpc.c,v 1.49 2006/12/22 23:36:42 rumble Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hpc.c,v 1.48 2006/12/22 23:25:28 rumble Exp $");
__KERNEL_RCSID(0, "$NetBSD: hpc.c,v 1.49 2006/12/22 23:36:42 rumble Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -261,9 +261,8 @@ static struct hpc_values hpc1_values = {
.scsi_max_xfer = MAX_SCSI_XFER,
.scsi_dma_segs = (MAX_SCSI_XFER / 4096),
.scsi_dma_segs_size = 4096,
.clk_freq = 100,
.dma_datain_cmd = (HPC1_SCSI_DMACTL_ACTIVE | HPC1_SCSI_DMACTL_DIR),
.dma_dataout_cmd = HPC1_SCSI_DMACTL_ACTIVE,
.scsi_dma_datain_cmd = (HPC1_SCSI_DMACTL_ACTIVE | HPC1_SCSI_DMACTL_DIR),
.scsi_dma_dataout_cmd = HPC1_SCSI_DMACTL_ACTIVE,
.scsi_dmactl_flush = HPC1_SCSI_DMACTL_FLUSH,
.scsi_dmactl_active = HPC1_SCSI_DMACTL_ACTIVE,
.scsi_dmactl_reset = HPC1_SCSI_DMACTL_RESET
@ -323,9 +322,8 @@ static struct hpc_values hpc3_values = {
.scsi_max_xfer = MAX_SCSI_XFER,
.scsi_dma_segs = (MAX_SCSI_XFER / 8192),
.scsi_dma_segs_size = 8192,
.clk_freq = 100,
.dma_datain_cmd = HPC3_SCSI_DMACTL_ACTIVE,
.dma_dataout_cmd = (HPC3_SCSI_DMACTL_ACTIVE | HPC3_SCSI_DMACTL_DIR),
.scsi_dma_datain_cmd = HPC3_SCSI_DMACTL_ACTIVE,
.scsi_dma_dataout_cmd =(HPC3_SCSI_DMACTL_ACTIVE | HPC3_SCSI_DMACTL_DIR),
.scsi_dmactl_flush = HPC3_SCSI_DMACTL_FLUSH,
.scsi_dmactl_active = HPC3_SCSI_DMACTL_ACTIVE,
.scsi_dmactl_reset = HPC3_SCSI_DMACTL_RESET

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpcvar.h,v 1.10 2006/12/22 23:25:28 rumble Exp $ */
/* $NetBSD: hpcvar.h,v 1.11 2006/12/22 23:36:42 rumble Exp $ */
/*
* Copyright (c) 2001 Rafal K. Boni
@ -91,9 +91,8 @@ struct hpc_values {
u_int32_t scsi_max_xfer;
u_int32_t scsi_dma_segs;
u_int32_t scsi_dma_segs_size;
u_int32_t clk_freq;
u_int32_t dma_datain_cmd;
u_int32_t dma_dataout_cmd;
u_int32_t scsi_dma_datain_cmd;
u_int32_t scsi_dma_dataout_cmd;
u_int32_t scsi_dmactl_flush;
u_int32_t scsi_dmactl_active;
u_int32_t scsi_dmactl_reset;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdsc.c,v 1.17 2006/10/01 22:02:55 bjh21 Exp $ */
/* $NetBSD: wdsc.c,v 1.18 2006/12/22 23:36:42 rumble Exp $ */
/*
* Copyright (c) 2001 Wayne Knowles
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wdsc.c,v 1.17 2006/10/01 22:02:55 bjh21 Exp $");
__KERNEL_RCSID(0, "$NetBSD: wdsc.c,v 1.18 2006/12/22 23:36:42 rumble Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: wdsc.c,v 1.17 2006/10/01 22:02:55 bjh21 Exp $");
#include <machine/cpu.h>
#include <machine/bus.h>
#include <machine/autoconf.h>
#include <machine/machtype.h>
#include <sgimips/hpc/hpcvar.h>
#include <sgimips/hpc/hpcreg.h>
@ -147,7 +148,13 @@ wdsc_attach(struct device *pdp, struct device *dp, void *auxp)
sc->sc_adapter.adapt_minphys = minphys;
sc->sc_id = 0; /* Host ID = 0 */
sc->sc_clkfreq = wsc->sc_hpcdma.hpc->clk_freq;
/* IP12 runs at 20mhz, all others at 10. XXX - GIO SCSI cards? */
if (mach_type == MACH_SGI_IP12)
sc->sc_clkfreq = 200;
else
sc->sc_clkfreq = 100;
sc->sc_dmamode = SBIC_CTL_DMA;
evcnt_attach_dynamic(&wsc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
@ -196,10 +203,12 @@ wdsc_dmasetup(struct wd33c93_softc *dev, caddr_t *addr, size_t *len, int datain,
wsc->sc_flags |= WDSC_DMA_MAPLOADED;
if (datain) {
dsc->sc_dmacmd = wsc->sc_hpcdma.hpc->dma_datain_cmd;
dsc->sc_dmacmd =
wsc->sc_hpcdma.hpc->scsi_dma_datain_cmd;
dsc->sc_flags |= HPCDMA_READ;
} else {
dsc->sc_dmacmd = wsc->sc_hpcdma.hpc->dma_dataout_cmd;
dsc->sc_dmacmd =
wsc->sc_hpcdma.hpc->scsi_dma_dataout_cmd;
dsc->sc_flags &= ~HPCDMA_READ;
}
}