Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci KNF & fix typo in comment.
details: https://anonhg.NetBSD.org/src/rev/2697ad693b0f
branches: trunk
changeset: 751083:2697ad693b0f
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Sun Jan 24 14:10:00 2010 +0000
description:
KNF & fix typo in comment.
No functional change.
diffstat:
sys/dev/pci/if_bge.c | 245 +++++++++++++++++++++++++-------------------------
1 files changed, 122 insertions(+), 123 deletions(-)
diffs (truncated from 867 to 300 lines):
diff -r a80424edf0af -r 2697ad693b0f sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c Sun Jan 24 12:58:37 2010 +0000
+++ b/sys/dev/pci/if_bge.c Sun Jan 24 14:10:00 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bge.c,v 1.169 2010/01/19 22:07:00 pooka Exp $ */
+/* $NetBSD: if_bge.c,v 1.170 2010/01/24 14:10:00 msaitoh Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.169 2010/01/19 22:07:00 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.170 2010/01/24 14:10:00 msaitoh Exp $");
#include "vlan.h"
#include "rnd.h"
@@ -185,7 +185,7 @@
static int bge_rxthresh_nodenum;
-typedef int (*bge_eaddr_fcn_t)(struct bge_softc *, u_int8_t[]);
+typedef int (*bge_eaddr_fcn_t)(struct bge_softc *, uint8_t[]);
static int bge_probe(device_t, cfdata_t, void *);
static void bge_attach(device_t, device_t, void *);
@@ -193,14 +193,14 @@
static void bge_txeof(struct bge_softc *);
static void bge_rxeof(struct bge_softc *);
-static int bge_get_eaddr_mem(struct bge_softc *, u_int8_t[]);
-static int bge_get_eaddr_nvram(struct bge_softc *, u_int8_t[]);
-static int bge_get_eaddr_eeprom(struct bge_softc *, u_int8_t[]);
-static int bge_get_eaddr(struct bge_softc *, u_int8_t[]);
+static int bge_get_eaddr_mem(struct bge_softc *, uint8_t[]);
+static int bge_get_eaddr_nvram(struct bge_softc *, uint8_t[]);
+static int bge_get_eaddr_eeprom(struct bge_softc *, uint8_t[]);
+static int bge_get_eaddr(struct bge_softc *, uint8_t[]);
static void bge_tick(void *);
static void bge_stats_update(struct bge_softc *);
-static int bge_encap(struct bge_softc *, struct mbuf *, u_int32_t *);
+static int bge_encap(struct bge_softc *, struct mbuf *, uint32_t *);
static int bge_intr(void *);
static void bge_start(struct ifnet *);
@@ -588,7 +588,7 @@
CFATTACH_DECL_NEW(bge, sizeof(struct bge_softc),
bge_probe, bge_attach, NULL, NULL);
-static u_int32_t
+static uint32_t
bge_readmem_ind(struct bge_softc *sc, int off)
{
pcireg_t val;
@@ -606,7 +606,7 @@
}
#ifdef notdef
-static u_int32_t
+static uint32_t
bge_readreg_ind(struct bge_softc *sc, int off)
{
pci_conf_write(sc->sc_pc, sc->sc_pcitag, BGE_PCI_REG_BASEADDR, off);
@@ -636,10 +636,10 @@
CSR_WRITE_4(sc, off, val);
}
-static u_int8_t
-bge_nvram_getbyte(struct bge_softc *sc, int addr, u_int8_t *dest)
+static uint8_t
+bge_nvram_getbyte(struct bge_softc *sc, int addr, uint8_t *dest)
{
- u_int32_t access, byte = 0;
+ uint32_t access, byte = 0;
int i;
/* Lock. */
@@ -650,7 +650,7 @@
DELAY(20);
}
if (i == 8000)
- return (1);
+ return 1;
/* Enable access. */
access = CSR_READ_4(sc, BGE_NVRAM_ACCESS);
@@ -668,7 +668,7 @@
if (i == BGE_TIMEOUT * 10) {
aprint_error_dev(sc->bge_dev, "nvram read timed out\n");
- return (1);
+ return 1;
}
/* Get result. */
@@ -683,20 +683,20 @@
CSR_WRITE_4(sc, BGE_NVRAM_SWARB, BGE_NVRAMSWARB_CLR1);
CSR_READ_4(sc, BGE_NVRAM_SWARB);
- return (0);
+ return 0;
}
/*
* Read a sequence of bytes from NVRAM.
*/
static int
-bge_read_nvram(struct bge_softc *sc, u_int8_t *dest, int off, int cnt)
+bge_read_nvram(struct bge_softc *sc, uint8_t *dest, int off, int cnt)
{
int err = 0, i;
- u_int8_t byte = 0;
+ uint8_t byte = 0;
if (BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5906)
- return (1);
+ return 1;
for (i = 0; i < cnt; i++) {
err = bge_nvram_getbyte(sc, off + i, &byte);
@@ -714,11 +714,11 @@
* auto access interface for reading the EEPROM. We use the auto
* access method.
*/
-static u_int8_t
-bge_eeprom_getbyte(struct bge_softc *sc, int addr, u_int8_t *dest)
+static uint8_t
+bge_eeprom_getbyte(struct bge_softc *sc, int addr, uint8_t *dest)
{
int i;
- u_int32_t byte = 0;
+ uint32_t byte = 0;
/*
* Enable use of auto EEPROM access so we can avoid
@@ -735,7 +735,7 @@
CSR_WRITE_4(sc, BGE_EE_ADDR, BGE_EE_READCMD | addr);
/* Wait for completion */
- for(i = 0; i < BGE_TIMEOUT * 10; i++) {
+ for (i = 0; i < BGE_TIMEOUT * 10; i++) {
DELAY(10);
if (CSR_READ_4(sc, BGE_EE_ADDR) & BGE_EEADDR_DONE)
break;
@@ -743,7 +743,7 @@
if (i == BGE_TIMEOUT) {
aprint_error_dev(sc->bge_dev, "eeprom read timed out\n");
- return (0);
+ return 0;
}
/* Get result. */
@@ -751,7 +751,7 @@
*dest = (byte >> ((addr % 4) * 8)) & 0xFF;
- return (0);
+ return 0;
}
/*
@@ -761,7 +761,7 @@
bge_read_eeprom(struct bge_softc *sc, void *destv, int off, int cnt)
{
int err = 0, i;
- u_int8_t byte = 0;
+ uint8_t byte = 0;
char *dest = destv;
for (i = 0; i < cnt; i++) {
@@ -778,8 +778,8 @@
bge_miibus_readreg(device_t dev, int phy, int reg)
{
struct bge_softc *sc = device_private(dev);
- u_int32_t val;
- u_int32_t saved_autopoll;
+ uint32_t val;
+ uint32_t saved_autopoll;
int i;
/*
@@ -792,7 +792,7 @@
* special-cased.
*/
if (phy != 1)
- return (0);
+ return 0;
/* Reading with autopolling on may trigger PCI errors */
saved_autopoll = CSR_READ_4(sc, BGE_MI_MODE);
@@ -829,7 +829,7 @@
}
if (val & BGE_MICOMM_READFAIL)
- return (0);
+ return 0;
return (val & 0xFFFF);
}
@@ -838,7 +838,7 @@
bge_miibus_writereg(device_t dev, int phy, int reg, int val)
{
struct bge_softc *sc = device_private(dev);
- u_int32_t saved_autopoll;
+ uint32_t saved_autopoll;
int i;
if (phy!=1) {
@@ -961,7 +961,7 @@
if (lvl < 0)
lvl = 0;
- else if( lvl >= NBGE_RX_THRESH)
+ else if (lvl >= NBGE_RX_THRESH)
lvl = NBGE_RX_THRESH - 1;
namelen = strlen(namebuf);
@@ -1094,7 +1094,7 @@
if (entry == NULL) {
aprint_error_dev(sc->bge_dev, "no free jumbo buffers\n");
- return (NULL);
+ return NULL;
}
SLIST_REMOVE_HEAD(&sc->bge_jfree_listhead, jpool_entries);
@@ -1162,12 +1162,12 @@
if (m == NULL) {
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
if (m_new == NULL)
- return (ENOBUFS);
+ return ENOBUFS;
MCLGET(m_new, M_DONTWAIT);
if (!(m_new->m_flags & M_EXT)) {
m_freem(m_new);
- return (ENOBUFS);
+ return ENOBUFS;
}
m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
@@ -1180,7 +1180,7 @@
m_adj(m_new, ETHER_ALIGN);
if (bus_dmamap_load_mbuf(sc->bge_dmatag, dmamap, m_new,
BUS_DMA_READ|BUS_DMA_NOWAIT))
- return (ENOBUFS);
+ return ENOBUFS;
bus_dmamap_sync(sc->bge_dmatag, dmamap, 0, dmamap->dm_mapsize,
BUS_DMASYNC_PREREAD);
@@ -1198,7 +1198,7 @@
sizeof (struct bge_rx_bd),
BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
- return (0);
+ return 0;
}
/*
@@ -1217,7 +1217,7 @@
/* Allocate the mbuf. */
MGETHDR(m_new, M_DONTWAIT, MT_DATA);
if (m_new == NULL)
- return (ENOBUFS);
+ return ENOBUFS;
/* Allocate the jumbo buffer */
buf = bge_jalloc(sc);
@@ -1225,7 +1225,7 @@
m_freem(m_new);
aprint_error_dev(sc->bge_dev,
"jumbo allocation failed -- packet dropped!\n");
- return (ENOBUFS);
+ return ENOBUFS;
}
/* Attach the buffer to the mbuf. */
@@ -1257,7 +1257,7 @@
sizeof (struct bge_rx_bd),
BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);
- return (0);
+ return 0;
}
/*
@@ -1276,7 +1276,7 @@
for (i = 0; i < BGE_SSLOTS; i++) {
if (bge_newbuf_std(sc, i, NULL, 0) == ENOBUFS)
- return (ENOBUFS);
+ return ENOBUFS;
}
sc->bge_std = i - 1;
@@ -1284,7 +1284,7 @@
Home |
Main Index |
Thread Index |
Old Index