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. No functional change.
details: https://anonhg.NetBSD.org/src/rev/f1a165484b4c
branches: trunk
changeset: 447349:f1a165484b4c
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Tue Jan 08 06:29:35 2019 +0000
description:
KNF. No functional change.
diffstat:
sys/dev/pci/if_msk.c | 97 +++++++++++++++++++++++++++------------------------
1 files changed, 52 insertions(+), 45 deletions(-)
diffs (truncated from 347 to 300 lines):
diff -r 10cfcc4144c5 -r f1a165484b4c sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c Tue Jan 08 06:17:40 2019 +0000
+++ b/sys/dev/pci/if_msk.c Tue Jan 08 06:29:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.82 2018/12/27 08:13:50 mrg Exp $ */
+/* $NetBSD: if_msk.c,v 1.83 2019/01/08 06:29:35 msaitoh Exp $ */
/* $OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $ */
/*
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.82 2018/12/27 08:13:50 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.83 2019/01/08 06:29:35 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -105,9 +105,9 @@
int mskcprint(void *, const char *);
int msk_intr(void *);
void msk_intr_yukon(struct sk_if_softc *);
-void msk_rxeof(struct sk_if_softc *, u_int16_t, u_int32_t);
+void msk_rxeof(struct sk_if_softc *, uint16_t, uint32_t);
void msk_txeof(struct sk_if_softc *);
-int msk_encap(struct sk_if_softc *, struct mbuf *, u_int32_t *);
+int msk_encap(struct sk_if_softc *, struct mbuf *, uint32_t *);
void msk_start(struct ifnet *);
int msk_ioctl(struct ifnet *, u_long, void *);
int msk_init(struct ifnet *);
@@ -202,38 +202,38 @@
{ 0, 0 }
};
-static inline u_int32_t
-sk_win_read_4(struct sk_softc *sc, u_int32_t reg)
+static inline uint32_t
+sk_win_read_4(struct sk_softc *sc, uint32_t reg)
{
return CSR_READ_4(sc, reg);
}
-static inline u_int16_t
-sk_win_read_2(struct sk_softc *sc, u_int32_t reg)
+static inline uint16_t
+sk_win_read_2(struct sk_softc *sc, uint32_t reg)
{
return CSR_READ_2(sc, reg);
}
-static inline u_int8_t
-sk_win_read_1(struct sk_softc *sc, u_int32_t reg)
+static inline uint8_t
+sk_win_read_1(struct sk_softc *sc, uint32_t reg)
{
return CSR_READ_1(sc, reg);
}
static inline void
-sk_win_write_4(struct sk_softc *sc, u_int32_t reg, u_int32_t x)
+sk_win_write_4(struct sk_softc *sc, uint32_t reg, uint32_t x)
{
CSR_WRITE_4(sc, reg, x);
}
static inline void
-sk_win_write_2(struct sk_softc *sc, u_int32_t reg, u_int16_t x)
+sk_win_write_2(struct sk_softc *sc, uint32_t reg, uint16_t x)
{
CSR_WRITE_2(sc, reg, x);
}
static inline void
-sk_win_write_1(struct sk_softc *sc, u_int32_t reg, u_int8_t x)
+sk_win_write_1(struct sk_softc *sc, uint32_t reg, uint8_t x)
{
CSR_WRITE_1(sc, reg, x);
}
@@ -242,7 +242,7 @@
msk_miibus_readreg(device_t dev, int phy, int reg)
{
struct sk_if_softc *sc_if = device_private(dev);
- u_int16_t val;
+ uint16_t val;
int i;
SK_YU_WRITE_2(sc_if, YUKON_SMICR, YU_SMICR_PHYAD(phy) |
@@ -341,12 +341,12 @@
msk_setmulti(struct sk_if_softc *sc_if)
{
struct ifnet *ifp= &sc_if->sk_ethercom.ec_if;
- u_int32_t hashes[2] = { 0, 0 };
+ uint32_t hashes[2] = { 0, 0 };
int h;
struct ethercom *ec = &sc_if->sk_ethercom;
struct ether_multi *enm;
struct ether_multistep step;
- u_int16_t reg;
+ uint16_t reg;
/* First, zot all the existing filters. */
SK_YU_WRITE_2(sc_if, YUKON_MCAH1, 0);
@@ -551,7 +551,8 @@
sc_if->sk_cdata.sk_rx_cnt++;
DPRINTFN(10, ("%s: rx ADDR64: %#x\n",
- sc_if->sk_ethercom.ec_if.if_xname, (unsigned)MSK_ADDR_HI(addr)));
+ sc_if->sk_ethercom.ec_if.if_xname,
+ (unsigned)MSK_ADDR_HI(addr)));
}
c = &sc_if->sk_cdata.sk_rx_chain[sc_if->sk_cdata.sk_rx_prod];
@@ -620,7 +621,8 @@
state = 4;
sc_if->sk_cdata.sk_jumbo_buf = (void *)kva;
- DPRINTFN(1,("msk_jumbo_buf = %p\n", (void *)sc_if->sk_cdata.sk_jumbo_buf));
+ DPRINTFN(1,("msk_jumbo_buf = %p\n",
+ (void *)sc_if->sk_cdata.sk_jumbo_buf));
LIST_INIT(&sc_if->sk_jfree_listhead);
LIST_INIT(&sc_if->sk_jinuse_listhead);
@@ -800,7 +802,7 @@
void
msk_update_int_mod(struct sk_softc *sc, int verbose)
{
- u_int32_t imtimer_ticks;
+ uint32_t imtimer_ticks;
/*
* Configure interrupt moderation. The moderation timer
@@ -875,7 +877,7 @@
void
mskc_reset(struct sk_softc *sc)
{
- u_int32_t imtimer_ticks, reg1;
+ uint32_t imtimer_ticks, reg1;
int reg;
DPRINTFN(2, ("mskc_reset\n"));
@@ -1030,7 +1032,8 @@
if (sc->sk_type == SK_YUKON_EC &&
sc->sk_rev == SK_YUKON_EC_REV_A1) {
/* WA for dev. #4.3 */
- sk_win_write_2(sc, SK_STAT_BMU_TX_THRESH, SK_STAT_BMU_TXTHIDX_MSK);
+ sk_win_write_2(sc, SK_STAT_BMU_TX_THRESH,
+ SK_STAT_BMU_TXTHIDX_MSK);
/* WA for dev. #4.18 */
sk_win_write_1(sc, SK_STAT_BMU_FIFOWM, 0x21);
sk_win_write_1(sc, SK_STAT_BMU_FIFOIWM, 0x07);
@@ -1119,7 +1122,7 @@
struct ifnet *ifp;
void *kva;
int i;
- u_int32_t chunk;
+ uint32_t chunk;
int mii_flags;
sc_if->sk_dev = self;
@@ -1153,10 +1156,10 @@
* transmitter whatever remains.
*/
if (sc->sk_ramsize) {
- chunk = (2 * (sc->sk_ramsize / sizeof(u_int64_t)) / 3) & ~0xff;
+ chunk = (2 * (sc->sk_ramsize / sizeof(uint64_t)) / 3) & ~0xff;
sc_if->sk_rx_ramstart = 0;
sc_if->sk_rx_ramend = sc_if->sk_rx_ramstart + chunk - 1;
- chunk = (sc->sk_ramsize / sizeof(u_int64_t)) - chunk;
+ chunk = (sc->sk_ramsize / sizeof(uint64_t)) - chunk;
sc_if->sk_tx_ramstart = sc_if->sk_rx_ramend + 1;
sc_if->sk_tx_ramend = sc_if->sk_tx_ramstart + chunk - 1;
@@ -1345,7 +1348,8 @@
aprint_normal("msk port %c at %s",
(sa->skc_port == SK_PORT_A) ? 'A' : 'B', pnp);
else
- aprint_normal(" port %c", (sa->skc_port == SK_PORT_A) ? 'A' : 'B');
+ aprint_normal(" port %c",
+ (sa->skc_port == SK_PORT_A) ? 'A' : 'B');
return (UNCONF);
}
@@ -1363,7 +1367,7 @@
pcireg_t command, memtype;
const char *intrstr = NULL;
int rc, sk_nodenum;
- u_int8_t hw, pmd;
+ uint8_t hw, pmd;
const char *revstr = NULL;
const struct sysctlnode *node;
void *kva;
@@ -1380,7 +1384,7 @@
if (command == 0x01) {
command = pci_conf_read(pc, pa->pa_tag, SK_PCI_PWRMGMTCTRL);
if (command & SK_PSTATE_MASK) {
- u_int32_t iobase, membase, irq;
+ uint32_t iobase, membase, irq;
/* Save important PCI config data. */
iobase = pci_conf_read(pc, pa->pa_tag, SK_PCI_LOIO);
@@ -1707,7 +1711,8 @@
msk_sysctl_handler, 0, (void *)sc,
0, CTL_HW, msk_root_num, sk_nodenum, CTL_CREATE,
CTL_EOL)) != 0) {
- aprint_normal_dev(sc->sk_dev, "couldn't create int_mod sysctl node\n");
+ aprint_normal_dev(sc->sk_dev,
+ "couldn't create int_mod sysctl node\n");
goto fail_6;
}
@@ -1770,12 +1775,12 @@
}
int
-msk_encap(struct sk_if_softc *sc_if, struct mbuf *m_head, u_int32_t *txidx)
+msk_encap(struct sk_if_softc *sc_if, struct mbuf *m_head, uint32_t *txidx)
{
struct sk_softc *sc = sc_if->sk_softc;
struct msk_tx_desc *f = NULL;
- u_int32_t frag, cur, hiaddr, old_hiaddr, total;
- u_int32_t entries = 0;
+ uint32_t frag, cur, hiaddr, old_hiaddr, total;
+ uint32_t entries = 0;
size_t i;
struct sk_txmap_entry *entry;
bus_dmamap_t txmap;
@@ -1892,7 +1897,7 @@
#ifdef MSK_DEBUG
if (mskdebug >= 2) {
struct msk_tx_desc *le;
- u_int32_t idx;
+ uint32_t idx;
for (idx = *txidx; idx != frag; SK_INC(idx, MSK_TX_RING_CNT)) {
le = &sc_if->sk_rdata->sk_tx_ring[idx];
msk_dump_txdesc(le, idx);
@@ -1912,7 +1917,7 @@
{
struct sk_if_softc *sc_if = ifp->if_softc;
struct mbuf *m_head = NULL;
- u_int32_t idx = sc_if->sk_cdata.sk_tx_prod;
+ uint32_t idx = sc_if->sk_cdata.sk_tx_prod;
int pkts = 0;
DPRINTFN(2, ("msk_start\n"));
@@ -2004,7 +2009,7 @@
}
static __inline int
-msk_rxvalid(struct sk_softc *sc, u_int32_t stat, u_int32_t len)
+msk_rxvalid(struct sk_softc *sc, uint32_t stat, uint32_t len)
{
if ((stat & (YU_RXSTAT_CRCERR | YU_RXSTAT_LONGERR |
YU_RXSTAT_MIIERR | YU_RXSTAT_BADFC | YU_RXSTAT_GOODFC |
@@ -2017,7 +2022,7 @@
}
void
-msk_rxeof(struct sk_if_softc *sc_if, u_int16_t len, u_int32_t rxstat)
+msk_rxeof(struct sk_if_softc *sc_if, uint16_t len, uint32_t rxstat)
{
struct sk_softc *sc = sc_if->sk_softc;
struct ifnet *ifp = &sc_if->sk_ethercom.ec_if;
@@ -2031,7 +2036,8 @@
/* Sync the descriptor */
MSK_CDRXSYNC(sc_if, cur, BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
- DPRINTFN(2, ("msk_rxeof: cur %u prod %u rx_cnt %u\n", cur, prod, sc_if->sk_cdata.sk_rx_cnt));
+ DPRINTFN(2, ("msk_rxeof: cur %u prod %u rx_cnt %u\n", cur, prod,
+ sc_if->sk_cdata.sk_rx_cnt));
while (prod != cur) {
tail = cur;
@@ -2044,7 +2050,8 @@
break; /* found it */
}
sc_if->sk_cdata.sk_rx_cons = cur;
- DPRINTFN(2, ("msk_rxeof: cur %u rx_cnt %u m %p\n", cur, sc_if->sk_cdata.sk_rx_cnt, m));
+ DPRINTFN(2, ("msk_rxeof: cur %u rx_cnt %u m %p\n", cur,
+ sc_if->sk_cdata.sk_rx_cnt, m));
if (m == NULL)
return;
@@ -2075,7 +2082,7 @@
struct sk_softc *sc = sc_if->sk_softc;
struct msk_tx_desc *cur_tx;
struct ifnet *ifp = &sc_if->sk_ethercom.ec_if;
- u_int32_t idx, reg, sk_ctl;
+ uint32_t idx, reg, sk_ctl;
struct sk_txmap_entry *entry;
DPRINTFN(2, ("msk_txeof\n"));
@@ -2183,7 +2190,7 @@
void
msk_intr_yukon(struct sk_if_softc *sc_if)
{
- u_int8_t status;
+ uint8_t status;
status = SK_IF_READ_1(sc_if, 0, SK_GMAC_ISR);
/* RX overrun */
Home |
Main Index |
Thread Index |
Old Index