Module Name:src
Committed By: msaitoh
Date: Thu May 23 10:34:44 UTC 2019
Modified Files:
src/sys/dev/bi: if_ni.c
Log Message:
- Use aprint_*().
- KNF
- u_int*_t -> uint*_t
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/bi/if_ni.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/bi/if_ni.c
diff -u src/sys/dev/bi/if_ni.c:1.46 src/sys/dev/bi/if_ni.c:1.47
--- src/sys/dev/bi/if_ni.c:1.46 Tue Jun 26 06:48:00 2018
+++ src/sys/dev/bi/if_ni.c Thu May 23 10:34:44 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ni.c,v 1.46 2018/06/26 06:48:00 msaitoh Exp $ */
+/* $NetBSD: if_ni.c,v 1.47 2019/05/23 10:34:44 msaitoh Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
*
@@ -36,7 +36,7 @@
*/
#include
-__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.46 2018/06/26 06:48:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ni.c,v 1.47 2019/05/23 10:34:44 msaitoh Exp $");
#include "opt_inet.h"
@@ -130,7 +130,7 @@ struct ni_softc {
struct ni_gvppqb *sc_pgvppqb; /* Phys address of PQB */
struct ni_fqb *sc_fqb; /* Free Queue block */
struct ni_bbd *sc_bbd; /* Buffer descriptors */
- u_int8_t sc_enaddr[ETHER_ADDR_LEN];
+ uint8_t sc_enaddr[ETHER_ADDR_LEN];
};
static int nimatch(device_t, cfdata_t, void *);
@@ -143,8 +143,8 @@ static int ni_add_rxbuf(struct ni_softc
static void ni_setup(struct ni_softc *);
static void nitimeout(struct ifnet *);
static void ni_shutdown(void *);
-static void ni_getpgs(struct ni_softc *sc, int size, void **v, paddr_t *p);
-static int failtest(struct ni_softc *, int, int, int, const char *);
+static void ni_getpgs(struct ni_softc *, int, void **, paddr_t *);
+static int failtest(struct ni_softc *, int, int, int, const char *);
volatile int endwait, retry; /* Used during autoconfig */
@@ -192,7 +192,7 @@ ni_getpgs(struct ni_softc *sc, int size,
panic(" unable to allocate memory: error %d", error);
if ((error = bus_dmamem_map(sc->sc_dmat, , nsegs, size, v,
- BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) != 0)
+ BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) != 0)
panic(" unable to map memory: error %d", error);
if (p)
@@ -237,8 +237,8 @@ niattach(device_t parent, device_t self,
sc->sc_dev = self;
type = bus_space_read_2(ba->ba_iot, ba->ba_ioh, BIREG_DTYPE);
- printf(": DEBN%c\n", type == BIDT_DEBNA ? 'A' : type == BIDT_DEBNT ?
- 'T' : 'K');
+ aprint_normal(": DEBN%c\n", type == BIDT_DEBNA ? 'A'
+ : type == BIDT_DEBNT ? 'T' : 'K');
sc->sc_iot = ba->ba_iot;
sc->sc_ioh = ba->ba_ioh;
sc->sc_dmat = ba->ba_dmat;
@@ -259,7 +259,7 @@ niattach(device_t parent, device_t self,
nipqb->np_veclvl = (ba->ba_ivec << 2) + 2;
nipqb->np_node = ba->ba_intcpu;
- nipqb->np_vpqb = (u_int32_t)gvp;
+ nipqb->np_vpqb = (uint32_t)gvp;
#ifdef __vax__
nipqb->np_spt = nipqb->np_gpt = mfpr(PR_SBR);
nipqb->np_sptlen = nipqb->np_gptlen = mfpr(PR_SLR);
@@ -267,8 +267,8 @@ niattach(device_t parent, device_t self,
#error Must fix support for non-vax.
#endif
nipqb->np_bvplvl = 1;
- nipqb->np_vfqb = (u_int32_t)fqb;
- nipqb->np_vbdt = (u_int32_t)bbd;
+ nipqb->np_vfqb = (uint32_t)fqb;
+ nipqb->np_vbdt = (uint32_t)bbd;
nipqb->np_nbdr = NBDESCS;
/* Free queue block */
@@ -296,7 +296,7 @@ niattach(device_t parent, device_t self,
while ((NI_RREG(BIREG_VAXBICSR) & BICSR_BROKE) && --i)
DELAY(50);
if (i == 0) {
- printf("%s: BROKE bit set after reset\n", device_xname(self));
+ aprint_error_dev(self, "BROKE bit set after reset\n");
return;
}
@@ -309,7 +309,7 @@ niattach(device_t parent, device_t self,
NI_WREG(NI_PCR, NI_RREG(NI_PCR) & ~PCR_OWN);
/* kick off init */
- NI_WREG(NI_PCR, (u_int32_t)sc->sc_pgvppqb | PCR_INIT | PCR_OWN);
+ NI_WREG(NI_PCR, (uint32_t)sc->sc_pgvppqb | PCR_INIT | PCR_OWN);
while (NI_RREG(NI_PCR) & PCR_OWN)
DELAY(10);
@@ -320,7 +320,7 @@ niattach(device_t parent, device_t self,
NI_WREG(NI_PSR, NI_RREG(NI_PSR) & ~PSR_OWN);
WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_OWN|PCR_ENABLE);
+ NI_WREG(NI_PCR, PCR_OWN | PCR_ENABLE);
WAITREG(NI_PCR, PCR_OWN);
WAITREG(NI_PSR, PSR_OWN);
@@ -347,7 +347,7 @@ niattach(device_t parent, device_t self,
INSQTI(msg, >nf_mforw);
}
WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_MFREEQ|PCR_OWN);
+ NI_WREG(NI_PCR, PCR_FREEQNE | PCR_MFREEQ | PCR_OWN);
WAITREG(NI_PCR, PCR_OWN);
/* Set up xmit queue */
@@ -370,7 +370,7 @@ niattach(device_t parent, device_t self,
INSQTI(data, >nf_dforw);
}
WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_DFREEQ|PCR_OWN);
+ NI_WREG(NI_PCR, PCR_FREEQNE | PCR_DFREEQ | PCR_OWN);
WAITREG(NI_PCR, PCR_OWN);
/* recv buffers */
@@ -392,7 +392,7 @@ niattach(device_t parent, device_t self,
INSQTI(data, >nf_rforw);
}
WAITREG(NI_PCR, PCR_OWN);
- NI_WREG(NI_PCR, PCR_FREEQNE|PCR_RFREEQ|PCR_OWN);
+ NI_WREG(NI_PCR, PCR_FREEQNE |