diff options
| author | maxv <maxv@NetBSD.org> | 2019-11-28 17:09:10 +0000 |
|---|---|---|
| committer | maxv <maxv@NetBSD.org> | 2019-11-28 17:09:10 +0000 |
| commit | 8cd22b985ef700f35854781be4d504e8acd5fa4e (patch) | |
| tree | dea876cd88c93e31af8c66df2b0c47180fa3c40d /sys/dev/pci | |
| parent | 3e54302c0fe24aa1f820e56e558aab968f2ac84c (diff) | |
localify
Diffstat (limited to 'sys/dev/pci')
| -rw-r--r-- | sys/dev/pci/if_et.c | 203 | ||||
| -rw-r--r-- | sys/dev/pci/if_msk.c | 152 | ||||
| -rw-r--r-- | sys/dev/pci/if_sk.c | 207 | ||||
| -rw-r--r-- | sys/dev/pci/mpii.c | 310 |
4 files changed, 436 insertions, 436 deletions
diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c index 50e6a7260c2..c20d6878d34 100644 --- a/sys/dev/pci/if_et.c +++ b/sys/dev/pci/if_et.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_et.c,v 1.27 2019/10/12 06:00:52 msaitoh Exp $ */ +/* $NetBSD: if_et.c,v 1.28 2019/11/28 17:09:10 maxv Exp $ */ /* $OpenBSD: if_et.c,v 1.12 2008/07/11 09:29:02 kevlo $ */ /* * Copyright (c) 2007 The DragonFly Project. All rights reserved. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.27 2019/10/12 06:00:52 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.28 2019/11/28 17:09:10 maxv Exp $"); #include "opt_inet.h" #include "vlan.h" @@ -81,63 +81,62 @@ __KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.27 2019/10/12 06:00:52 msaitoh Exp $"); #include <dev/pci/if_etreg.h> -int et_match(device_t, cfdata_t, void *); -void et_attach(device_t, device_t, void *); -int et_detach(device_t, int); -int et_shutdown(device_t); +static int et_match(device_t, cfdata_t, void *); +static void et_attach(device_t, device_t, void *); +static int et_detach(device_t, int); -int et_miibus_readreg(device_t, int, int, uint16_t *); -int et_miibus_writereg(device_t, int, int, uint16_t); -void et_miibus_statchg(struct ifnet *); +static int et_miibus_readreg(device_t, int, int, uint16_t *); +static int et_miibus_writereg(device_t, int, int, uint16_t); +static void et_miibus_statchg(struct ifnet *); -int et_init(struct ifnet *); -int et_ioctl(struct ifnet *, u_long, void *); -void et_start(struct ifnet *); -void et_watchdog(struct ifnet *); +static int et_init(struct ifnet *); +static int et_ioctl(struct ifnet *, u_long, void *); +static void et_start(struct ifnet *); +static void et_watchdog(struct ifnet *); static int et_ifmedia_upd(struct ifnet *); static void et_ifmedia_sts(struct ifnet *, struct ifmediareq *); -int et_intr(void *); -void et_enable_intrs(struct et_softc *, uint32_t); -void et_disable_intrs(struct et_softc *); -void et_rxeof(struct et_softc *); -void et_txeof(struct et_softc *); -void et_txtick(void *); +static int et_intr(void *); +static void et_enable_intrs(struct et_softc *, uint32_t); +static void et_disable_intrs(struct et_softc *); +static void et_rxeof(struct et_softc *); +static void et_txeof(struct et_softc *); +static void et_txtick(void *); -int et_dma_alloc(struct et_softc *); -void et_dma_free(struct et_softc *); -int et_dma_mem_create(struct et_softc *, bus_size_t, +static int et_dma_alloc(struct et_softc *); +static void et_dma_free(struct et_softc *); +static int et_dma_mem_create(struct et_softc *, bus_size_t, void **, bus_addr_t *, bus_dmamap_t *, bus_dma_segment_t *); -void et_dma_mem_destroy(struct et_softc *, void *, bus_dmamap_t); -int et_dma_mbuf_create(struct et_softc *); -void et_dma_mbuf_destroy(struct et_softc *, int, const int[]); - -int et_init_tx_ring(struct et_softc *); -int et_init_rx_ring(struct et_softc *); -void et_free_tx_ring(struct et_softc *); -void et_free_rx_ring(struct et_softc *); -int et_encap(struct et_softc *, struct mbuf **); -int et_newbuf(struct et_rxbuf_data *, int, int, int); -int et_newbuf_cluster(struct et_rxbuf_data *, int, int); -int et_newbuf_hdr(struct et_rxbuf_data *, int, int); - -void et_stop(struct et_softc *); -int et_chip_init(struct et_softc *); -void et_chip_attach(struct et_softc *); -void et_init_mac(struct et_softc *); -void et_init_rxmac(struct et_softc *); -void et_init_txmac(struct et_softc *); -int et_init_rxdma(struct et_softc *); -int et_init_txdma(struct et_softc *); -int et_start_rxdma(struct et_softc *); -int et_start_txdma(struct et_softc *); -int et_stop_rxdma(struct et_softc *); -int et_stop_txdma(struct et_softc *); -void et_reset(struct et_softc *); -int et_bus_config(struct et_softc *); -void et_get_eaddr(struct et_softc *, uint8_t[]); -void et_setmulti(struct et_softc *); -void et_tick(void *); +static void et_dma_mem_destroy(struct et_softc *, void *, bus_dmamap_t); +static int et_dma_mbuf_create(struct et_softc *); +static void et_dma_mbuf_destroy(struct et_softc *, int, const int[]); + +static int et_init_tx_ring(struct et_softc *); +static int et_init_rx_ring(struct et_softc *); +static void et_free_tx_ring(struct et_softc *); +static void et_free_rx_ring(struct et_softc *); +static int et_encap(struct et_softc *, struct mbuf **); +static int et_newbuf(struct et_rxbuf_data *, int, int, int); +static int et_newbuf_cluster(struct et_rxbuf_data *, int, int); +static int et_newbuf_hdr(struct et_rxbuf_data *, int, int); + +static void et_stop(struct et_softc *); +static int et_chip_init(struct et_softc *); +static void et_chip_attach(struct et_softc *); +static void et_init_mac(struct et_softc *); +static void et_init_rxmac(struct et_softc *); +static void et_init_txmac(struct et_softc *); +static int et_init_rxdma(struct et_softc *); +static int et_init_txdma(struct et_softc *); +static int et_start_rxdma(struct et_softc *); +static int et_start_txdma(struct et_softc *); +static int et_stop_rxdma(struct et_softc *); +static int et_stop_txdma(struct et_softc *); +static void et_reset(struct et_softc *); +static int et_bus_config(struct et_softc *); +static void et_get_eaddr(struct et_softc *, uint8_t[]); +static void et_setmulti(struct et_softc *); +static void et_tick(void *); static int et_rx_intr_npkts = 32; static int et_rx_intr_delay = 20; /* x10 usec */ @@ -154,7 +153,7 @@ static const struct et_bsize et_bufsize[ET_RX_NRING] = { { .bufsize = 0, .newbuf = et_newbuf_cluster }, }; -const struct et_product { +static const struct et_product { pci_vendor_id_t vendor; pci_product_id_t product; } et_devices[] = { @@ -165,7 +164,7 @@ const struct et_product { CFATTACH_DECL_NEW(et, sizeof(struct et_softc), et_match, et_attach, et_detach, NULL); -int +static int et_match(device_t dev, cfdata_t match, void *aux) { struct pci_attach_args *pa = aux; @@ -181,7 +180,7 @@ et_match(device_t dev, cfdata_t match, void *aux) return 0; } -void +static void et_attach(device_t parent, device_t self, void *aux) { struct et_softc *sc = device_private(self); @@ -319,7 +318,7 @@ fail: } } -int +static int et_detach(device_t self, int flags) { struct et_softc *sc = device_private(self); @@ -353,7 +352,8 @@ et_detach(device_t self, int flags) return 0; } -int +#if 0 /* XXX XXX XXX UNUSED */ +static int et_shutdown(device_t self) { struct et_softc *sc = device_private(self); @@ -365,8 +365,9 @@ et_shutdown(device_t self) return 0; } +#endif -int +static int et_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val) { struct et_softc *sc = device_private(dev); @@ -410,7 +411,7 @@ back: return ret; } -int +static int et_miibus_writereg(device_t dev, int phy, int reg, uint16_t val) { struct et_softc *sc = device_private(dev); @@ -452,7 +453,7 @@ et_miibus_writereg(device_t dev, int phy, int reg, uint16_t val) return rv; } -void +static void et_miibus_statchg(struct ifnet *ifp) { struct et_softc *sc = ifp->if_softc; @@ -570,7 +571,7 @@ et_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) ifmr->ifm_status = mii->mii_media_status; } -void +static void et_stop(struct et_softc *sc) { struct ifnet *ifp = &sc->sc_ethercom.ec_if; @@ -596,7 +597,7 @@ et_stop(struct et_softc *sc) ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE); } -int +static int et_bus_config(struct et_softc *sc) { uint32_t val; //, max_plsz; @@ -671,7 +672,7 @@ et_bus_config(struct et_softc *sc) return 0; } -void +static void et_get_eaddr(struct et_softc *sc, uint8_t eaddr[]) { uint32_t r; @@ -686,7 +687,7 @@ et_get_eaddr(struct et_softc *sc, uint8_t eaddr[]) eaddr[5] = (r >> 8) & 0xff; } -void +static void et_reset(struct et_softc *sc) { @@ -706,19 +707,19 @@ et_reset(struct et_softc *sc) CSR_WRITE_4(sc, ET_MAC_CFG1, 0); } -void +static void et_disable_intrs(struct et_softc *sc) { CSR_WRITE_4(sc, ET_INTR_MASK, 0xffffffff); } -void +static void et_enable_intrs(struct et_softc *sc, uint32_t intrs) { CSR_WRITE_4(sc, ET_INTR_MASK, ~intrs); } -int +static int et_dma_alloc(struct et_softc *sc) { struct et_txdesc_ring *tx_ring = &sc->sc_tx_ring; @@ -801,7 +802,7 @@ et_dma_alloc(struct et_softc *sc) return 0; } -void +static void et_dma_free(struct et_softc *sc) { struct et_txdesc_ring *tx_ring = &sc->sc_tx_ring; @@ -847,7 +848,7 @@ et_dma_free(struct et_softc *sc) et_dma_mbuf_destroy(sc, ET_TX_NDESC, rx_done); } -int +static int et_dma_mbuf_create(struct et_softc *sc) { struct et_txbuf_data *tbd = &sc->sc_tx_data; @@ -906,7 +907,7 @@ et_dma_mbuf_create(struct et_softc *sc) return 0; } -void +static void et_dma_mbuf_destroy(struct et_softc *sc, int tx_done, const int rx_done[]) { struct et_txbuf_data *tbd = &sc->sc_tx_data; @@ -944,7 +945,7 @@ et_dma_mbuf_destroy(struct et_softc *sc, int tx_done, const int rx_done[]) bus_dmamap_destroy(sc->sc_dmat, sc->sc_mbuf_tmp_dmap); } -int +static int et_dma_mem_create(struct et_softc *sc, bus_size_t size, void **addr, bus_addr_t *paddr, bus_dmamap_t *dmap, bus_dma_segment_t *seg) { @@ -986,14 +987,14 @@ et_dma_mem_create(struct et_softc *sc, bus_size_t size, return 0; } -void +static void et_dma_mem_destroy(struct et_softc *sc, void *addr, bus_dmamap_t dmap) { bus_dmamap_unload(sc->sc_dmat, dmap); bus_dmamem_free(sc->sc_dmat, (bus_dma_segment_t *)&addr, 1); } -void +static void et_chip_attach(struct et_softc *sc) { uint32_t val; @@ -1033,7 +1034,7 @@ et_chip_attach(struct et_softc *sc) CSR_WRITE_4(sc, ET_MMC_CTRL, ET_MMC_CTRL_ENABLE); } -int +static int et_intr(void *xsc) { struct et_softc *sc = xsc; @@ -1064,7 +1065,7 @@ back: return (1); } -int +static int et_init(struct ifnet *ifp) { struct et_softc *sc = ifp->if_softc; @@ -1124,7 +1125,7 @@ back: return (0); } -int +static int et_ioctl(struct ifnet *ifp, u_long cmd, void *data) { struct et_softc *sc = ifp->if_softc; @@ -1171,7 +1172,7 @@ et_ioctl(struct ifnet *ifp, u_long cmd, void *data) return error; } -void +static void et_start(struct ifnet *ifp) { struct et_softc *sc = ifp->if_softc; @@ -1212,7 +1213,7 @@ et_start(struct ifnet *ifp) } } -void +static void et_watchdog(struct ifnet *ifp) { struct et_softc *sc = ifp->if_softc; @@ -1223,7 +1224,7 @@ et_watchdog(struct ifnet *ifp) et_start(ifp); } -int +static int et_stop_rxdma(struct et_softc *sc) { @@ -1238,7 +1239,7 @@ et_stop_rxdma(struct et_softc *sc) return 0; } -int +static int et_stop_txdma(struct et_softc *sc) { @@ -1247,7 +1248,7 @@ et_stop_txdma(struct et_softc *sc) return 0; } -void +static void et_free_tx_ring(struct et_softc *sc) { struct et_txbuf_data *tbd = &sc->sc_tx_data; @@ -1269,7 +1270,7 @@ et_free_tx_ring(struct et_softc *sc) tx_ring->tr_dmap->dm_mapsize, BUS_DMASYNC_PREWRITE); } -void +static void et_free_rx_ring(struct et_softc *sc) { int n; @@ -1295,7 +1296,7 @@ et_free_rx_ring(struct et_softc *sc) } } -void +static void et_setmulti(struct et_softc *sc) { struct ethercom *ec = &sc->sc_ethercom; @@ -1353,7 +1354,7 @@ back: CSR_WRITE_4(sc, ET_RXMAC_CTRL, rxmac_ctrl); } -int +static int et_chip_init(struct et_softc *sc) { struct ifnet *ifp = &sc->sc_ethercom.ec_if; @@ -1408,7 +1409,7 @@ et_chip_init(struct et_softc *sc) return 0; } -int +static int et_init_tx_ring(struct et_softc *sc) { struct et_txdesc_ring *tx_ring = &sc->sc_tx_ring; @@ -1429,7 +1430,7 @@ et_init_tx_ring(struct et_softc *sc) return 0; } -int +static int et_init_rx_ring(struct et_softc *sc) { struct et_rxstatus_data *rxsd = &sc->sc_rx_status; @@ -1461,7 +1462,7 @@ et_init_rx_ring(struct et_softc *sc) return 0; } -int +static int et_init_rxdma(struct et_softc *sc) { struct et_rxstatus_data *rxsd = &sc->sc_rx_status; @@ -1531,7 +1532,7 @@ et_init_rxdma(struct et_softc *sc) return 0; } -int +static int et_init_txdma(struct et_softc *sc) { struct et_txdesc_ring *tx_ring = &sc->sc_tx_ring; @@ -1566,7 +1567,7 @@ et_init_txdma(struct et_softc *sc) return 0; } -void +static void et_init_mac(struct et_softc *sc) { struct ifnet *ifp = &sc->sc_ethercom.ec_if; @@ -1619,7 +1620,7 @@ et_init_mac(struct et_softc *sc) CSR_WRITE_4(sc, ET_MAC_CFG1, 0); } -void +static void et_init_rxmac(struct et_softc *sc) { struct ifnet *ifp = &sc->sc_ethercom.ec_if; @@ -1700,7 +1701,7 @@ et_init_rxmac(struct et_softc *sc) et_setmulti(sc); } -void +static void et_init_txmac(struct et_softc *sc) { @@ -1715,7 +1716,7 @@ et_init_txmac(struct et_softc *sc) ET_TXMAC_CTRL_ENABLE | ET_TXMAC_CTRL_FC_DISABLE); } -int +static int et_start_rxdma(struct et_softc *sc) { uint32_t val = 0; @@ -1738,7 +1739,7 @@ et_start_rxdma(struct et_softc *sc) return 0; } -int +static int et_start_txdma(struct et_softc *sc) { @@ -1746,7 +1747,7 @@ et_start_txdma(struct et_softc *sc) return 0; } -void +static void et_rxeof(struct et_softc *sc) { struct ifnet *ifp = &sc->sc_ethercom.ec_if; @@ -1848,7 +1849,7 @@ et_rxeof(struct et_softc *sc) } } -int +static int et_encap(struct et_softc *sc, struct mbuf **m0) { struct mbuf *m = *m0; @@ -1983,7 +1984,7 @@ back: return error; } -void +static void et_txeof(struct et_softc *sc) { struct ifnet *ifp = &sc->sc_ethercom.ec_if; @@ -2039,7 +2040,7 @@ et_txeof(struct et_softc *sc) if_schedule_deferred_start(ifp); } -void +static void et_txtick(void *xsc) { struct et_softc *sc = xsc; @@ -2050,7 +2051,7 @@ et_txtick(void *xsc) splx(s); } -void +static void et_tick(void *xsc) { struct et_softc *sc = xsc; @@ -2062,19 +2063,19 @@ et_tick(void *xsc) splx(s); } -int +static int et_newbuf_cluster(struct et_rxbuf_data *rbd, int buf_idx, int init) { return et_newbuf(rbd, buf_idx, init, MCLBYTES); } -int +static int et_newbuf_hdr(struct et_rxbuf_data *rbd, int buf_idx, int init) { return et_newbuf(rbd, buf_idx, init, MHLEN); } -int +static int et_newbuf(struct et_rxbuf_data *rbd, int buf_idx, int init, int len0) { struct et_softc *sc = rbd->rbd_softc; diff --git a/sys/dev/pci/if_msk.c b/sys/dev/pci/if_msk.c index 65f4e03b7f2..b00198ad849 100644 --- a/sys/dev/pci/if_msk.c +++ b/sys/dev/pci/if_msk.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_msk.c,v 1.94 2019/11/15 12:38:09 msaitoh Exp $ */ +/* $NetBSD: if_msk.c,v 1.95 2019/11/28 17:09:10 maxv 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.94 2019/11/15 12:38:09 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.95 2019/11/28 17:09:10 maxv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,45 +92,45 @@ __KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.94 2019/11/15 12:38:09 msaitoh Exp $"); #include <dev/pci/if_skreg.h> #include <dev/pci/if_mskvar.h> -int mskc_probe(device_t, cfdata_t, void *); -void mskc_attach(device_t, device_t, void *); -int mskc_detach(device_t, int); -void mskc_reset(struct sk_softc *); +static int mskc_probe(device_t, cfdata_t, void *); +static void mskc_attach(device_t, device_t, void *); +static int mskc_detach(device_t, int); +static void mskc_reset(struct sk_softc *); static bool mskc_suspend(device_t, const pmf_qual_t *); static bool mskc_resume(device_t, const pmf_qual_t *); -int msk_probe(device_t, cfdata_t, void *); -void msk_attach(device_t, device_t, void *); -int msk_detach(device_t, int); -void msk_reset(struct sk_if_softc *); -int mskcprint(void *, const char *); -int msk_intr(void *); -void msk_intr_yukon(struct sk_if_softc *); -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 *, uint32_t *); -void msk_start(struct ifnet *); -int msk_ioctl(struct ifnet *, u_long, void *); -int msk_init(struct ifnet *); -void msk_init_yukon(struct sk_if_softc *); -void msk_stop(struct ifnet *, int); -void msk_watchdog(struct ifnet *); -int msk_newbuf(struct sk_if_softc *, bus_dmamap_t); -int msk_alloc_jumbo_mem(struct sk_if_softc *); -void *msk_jalloc(struct sk_if_softc *); -void msk_jfree(struct mbuf *, void *, size_t, void *); -int msk_init_rx_ring(struct sk_if_softc *); -int msk_init_tx_ring(struct sk_if_softc *); -void msk_fill_rx_ring(struct sk_if_softc *); - -void msk_update_int_mod(struct sk_softc *, int); - -int msk_miibus_readreg(device_t, int, int, uint16_t *); -int msk_miibus_writereg(device_t, int, int, uint16_t); -void msk_miibus_statchg(struct ifnet *); - -void msk_setmulti(struct sk_if_softc *); -void msk_setpromisc(struct sk_if_softc *); -void msk_tick(void *); +static int msk_probe(device_t, cfdata_t, void *); +static void msk_attach(device_t, device_t, void *); +static int msk_detach(device_t, int); +static void msk_reset(struct sk_if_softc *); +static int mskcprint(void *, const char *); +static int msk_intr(void *); +static void msk_intr_yukon(struct sk_if_softc *); +static void msk_rxeof(struct sk_if_softc *, uint16_t, uint32_t); +static void msk_txeof(struct sk_if_softc *); +static int msk_encap(struct sk_if_softc *, struct mbuf *, uint32_t *); +static void msk_start(struct ifnet *); +static int msk_ioctl(struct ifnet *, u_long, void *); +static int msk_init(struct ifnet *); +static void msk_init_yukon(struct sk_if_softc *); +static void msk_stop(struct ifnet *, int); +static void msk_watchdog(struct ifnet *); +static int msk_newbuf(struct sk_if_softc *, bus_dmamap_t); +static int msk_alloc_jumbo_mem(struct sk_if_softc *); +static void *msk_jalloc(struct sk_if_softc *); +static void msk_jfree(struct mbuf *, void *, size_t, void *); +static int msk_init_rx_ring(struct sk_if_softc *); +static int msk_init_tx_ring(struct sk_if_softc *); +static void msk_fill_rx_ring(struct sk_if_softc *); + +static void msk_update_int_mod(struct sk_softc *, int); + +static int msk_miibus_readreg(device_t, int, int, uint16_t *); +static int msk_miibus_writereg(device_t, int, int, uint16_t); +static void msk_miibus_statchg(struct ifnet *); + +static void msk_setmulti(struct sk_if_softc *); +static void msk_setpromisc(struct sk_if_softc *); +static void msk_tick(void *); static void msk_fill_rx_tick(void *); /* #define MSK_DEBUG 1 */ @@ -238,7 +238,7 @@ sk_win_write_1(struct sk_softc *sc, uint32_t reg, uint8_t x) CSR_WRITE_1(sc, reg, x); } -int +static int msk_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val) { struct sk_if_softc *sc_if = device_private(dev); @@ -270,7 +270,7 @@ msk_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val) return 0; } -int +static int msk_miibus_writereg(device_t dev, int phy, int reg, uint16_t val) { struct sk_if_softc *sc_if = device_private(dev); @@ -297,7 +297,7 @@ msk_miibus_writereg(device_t dev, int phy, int reg, uint16_t val) return 0; } -void +static void msk_miibus_statchg(struct ifnet *ifp) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -340,7 +340,7 @@ msk_miibus_statchg(struct ifnet *ifp) SK_YU_READ_2(sc_if, YUKON_GPCR))); } -void +static void msk_setmulti(struct sk_if_softc *sc_if) { struct ifnet *ifp= &sc_if->sk_ethercom.ec_if; @@ -400,7 +400,7 @@ allmulti: SK_YU_WRITE_2(sc_if, YUKON_RCR, reg); } -void +static void msk_setpromisc(struct sk_if_softc *sc_if) { struct ifnet *ifp = &sc_if->sk_ethercom.ec_if; @@ -413,7 +413,7 @@ msk_setpromisc(struct sk_if_softc *sc_if) YU_RCR_UFLEN | YU_RCR_MUFLEN); } -int +static int msk_init_rx_ring(struct sk_if_softc *sc_if) { struct msk_chain_data *cd = &sc_if->sk_cdata; @@ -453,7 +453,7 @@ msk_init_rx_ring(struct sk_if_softc *sc_if) return 0; } -int +static int msk_init_tx_ring(struct sk_if_softc *sc_if) { struct sk_softc *sc = sc_if->sk_softc; @@ -508,7 +508,7 @@ msk_init_tx_ring(struct sk_if_softc *sc_if) return 0; } -int +static int msk_newbuf(struct sk_if_softc *sc_if, bus_dmamap_t dmamap) { struct mbuf *m_new = NULL; @@ -582,7 +582,7 @@ msk_newbuf(struct sk_if_softc *sc_if, bus_dmamap_t dmamap) * Memory management for jumbo frames. */ -int +static int msk_alloc_jumbo_mem(struct sk_if_softc *sc_if) { struct sk_softc *sc = sc_if->sk_softc; @@ -690,7 +690,7 @@ msk_free_jumbo_mem(struct sk_if_softc *sc_if) /* * Allocate a jumbo buffer. */ -void * +static void * msk_jalloc(struct sk_if_softc *sc_if) { struct sk_jpool_entry *entry; @@ -712,7 +712,7 @@ msk_jalloc(struct sk_if_softc *sc_if) /* * Release a jumbo buffer. */ -void +static void msk_jfree(struct mbuf *m, void *buf, size_t size, void *arg) { struct sk_jpool_entry *entry; @@ -750,7 +750,7 @@ msk_jfree(struct mbuf *m, void *buf, size_t size, void *arg) callout_schedule(&sc->sk_tick_rx, 0); } -int +static int msk_ioctl(struct ifnet *ifp, u_long cmd, void *data) { struct sk_if_softc *sc = ifp->if_softc; @@ -802,7 +802,7 @@ msk_ioctl(struct ifnet *ifp, u_long cmd, void *data) return error; } -void +static void msk_update_int_mod(struct sk_softc *sc, int verbose) { uint32_t imtimer_ticks; @@ -866,7 +866,7 @@ msk_lookup(const struct pci_attach_args *pa) * Probe for a SysKonnect GEnesis chip. Check the PCI vendor and device * IDs against our list and return a device name if we find a match. */ -int +static int mskc_probe(device_t parent, cfdata_t match, void *aux) { struct pci_attach_args *pa = (struct pci_attach_args *)aux; @@ -877,7 +877,7 @@ mskc_probe(device_t parent, cfdata_t match, void *aux) /* * Force the GEnesis into reset, then bring it out of reset. */ -void +static void mskc_reset(struct sk_softc *sc) { uint32_t imtimer_ticks, reg1; @@ -1078,7 +1078,7 @@ mskc_reset(struct sk_softc *sc) msk_update_int_mod(sc, 0); } -int +static int msk_probe(device_t parent, cfdata_t match, void *aux) { struct skc_attach_args *sa = aux; @@ -1104,7 +1104,7 @@ msk_probe(device_t parent, cfdata_t match, void *aux) return 0; } -void +static void msk_reset(struct sk_if_softc *sc_if) { /* GMAC and GPHY Reset */ @@ -1129,7 +1129,7 @@ msk_resume(device_t dv, const pmf_qual_t *qual) * Each XMAC chip is attached as a separate logical IP interface. * Single port cards will have only one logical interface of course. */ -void +static void msk_attach(device_t parent, device_t self, void *aux) { struct sk_if_softc *sc_if = device_private(self); @@ -1307,7 +1307,7 @@ fail: sc->sk_if[sa->skc_port] = NULL; } -int +static int msk_detach(device_t self, int flags) { struct sk_if_softc *sc_if = device_private(self); @@ -1352,7 +1352,7 @@ msk_detach(device_t self, int flags) return 0; } -int +static int mskcprint(void *aux, const char *pnp) { struct skc_attach_args *sa = aux; @@ -1370,7 +1370,7 @@ mskcprint(void *aux, const char *pnp) * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. */ -void +static void mskc_attach(device_t parent, device_t self, void *aux) { struct sk_softc *sc = device_private(self); @@ -1753,7 +1753,7 @@ fail_1: sc->sk_bsize = 0; } -int +static int mskc_detach(device_t self, int flags) { struct sk_softc *sc = device_private(self); @@ -1787,7 +1787,7 @@ mskc_detach(device_t self, int flags) return 0; } -int +static int msk_encap(struct sk_if_softc *sc_if, struct mbuf *m_head, uint32_t *txidx) { struct sk_softc *sc = sc_if->sk_softc; @@ -1925,7 +1925,7 @@ msk_encap(struct sk_if_softc *sc_if, struct mbuf *m_head, uint32_t *txidx) return 0; } -void +static void msk_start(struct ifnet *ifp) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -1973,7 +1973,7 @@ msk_start(struct ifnet *ifp) } } -void +static void msk_watchdog(struct ifnet *ifp) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -2034,7 +2034,7 @@ msk_rxvalid(struct sk_softc *sc, uint32_t stat, uint32_t len) return 1; } -void +static void msk_rxeof(struct sk_if_softc *sc_if, uint16_t len, uint32_t rxstat) { struct sk_softc *sc = sc_if->sk_softc; @@ -2089,7 +2089,7 @@ msk_rxeof(struct sk_if_softc *sc_if, uint16_t len, uint32_t rxstat) if_percpuq_enqueue(ifp->if_percpuq, m); } -void +static void msk_txeof(struct sk_if_softc *sc_if) { struct sk_softc *sc = sc_if->sk_softc; @@ -2149,7 +2149,7 @@ msk_txeof(struct sk_if_softc *sc_if) sc_if->sk_cdata.sk_tx_cons = idx; } -void +static void msk_fill_rx_ring(struct sk_if_softc *sc_if) { /* Make sure to not completely wrap around */ @@ -2185,7 +2185,7 @@ msk_fill_rx_tick(void *xsc_if) splx(s); } -void +static void msk_tick(void *xsc_if) { struct sk_if_softc *sc_if = xsc_if; @@ -2199,7 +2199,7 @@ msk_tick(void *xsc_if) callout_schedule(&sc_if->sk_tick_ch, hz); } -void +static void msk_intr_yukon(struct sk_if_softc *sc_if) { uint8_t status; @@ -2219,7 +2219,7 @@ msk_intr_yukon(struct sk_if_softc *sc_if) DPRINTFN(2, ("msk_intr_yukon status=%#x\n", status)); } -int +static int msk_intr(void *xsc) { struct sk_softc *sc = xsc; @@ -2310,7 +2310,7 @@ msk_intr(void *xsc) return claimed; } -void +static void msk_init_yukon(struct sk_if_softc *sc_if) { uint32_t v; @@ -2452,7 +2452,7 @@ msk_init_yukon(struct sk_if_softc *sc_if) * Note that to properly initialize any part of the GEnesis chip, * you first have to take it out of reset mode. */ -int +static int msk_init(struct ifnet *ifp) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -2615,7 +2615,7 @@ out: * Note: the logic of second parameter is inverted compared to OpenBSD * code, since this code uses the function as if_stop hook too. */ -void +static void msk_stop(struct ifnet *ifp, int disable) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -2705,7 +2705,7 @@ CFATTACH_DECL3_NEW(msk, sizeof(struct sk_if_softc), msk_probe, msk_attach, msk_detach, NULL, NULL, NULL, DVF_DETACH_SHUTDOWN); #ifdef MSK_DEBUG -void +static void msk_dump_txdesc(struct msk_tx_desc *le, int idx) { #define DESC_PRINT(X) \ @@ -2720,7 +2720,7 @@ msk_dump_txdesc(struct msk_tx_desc *le, int idx) #undef DESC_PRINT } -void +static void msk_dump_bytes(const char *data, int len) { int c, i, j; @@ -2752,7 +2752,7 @@ msk_dump_bytes(const char *data, int len) } } -void +static void msk_dump_mbuf(struct mbuf *m) { int count = m->m_pkthdr.len; diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index 6b26cbcebea..87732eec76c 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sk.c,v 1.101 2019/11/10 21:16:36 chs Exp $ */ +/* $NetBSD: if_sk.c,v 1.102 2019/11/28 17:09:10 maxv Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -115,7 +115,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.101 2019/11/10 21:16:36 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.102 2019/11/28 17:09:10 maxv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -153,57 +153,54 @@ __KERNEL_RCSID(0, "$NetBSD: if_sk.c,v 1.101 2019/11/10 21:16:36 chs Exp $"); #include <dev/pci/if_skreg.h> #include <dev/pci/if_skvar.h> -int skc_probe(device_t, cfdata_t, void *); -void skc_attach(device_t, device_t, void *); -int sk_probe(device_t, cfdata_t, void *); -void sk_attach(device_t, device_t, void *); -int skcprint(void *, const char *); -int sk_intr(void *); -void sk_intr_bcom(struct sk_if_softc *); -void sk_intr_xmac(struct sk_if_softc *); -void sk_intr_yukon(struct sk_if_softc *); -void sk_rxeof(struct sk_if_softc *); -void sk_txeof(struct sk_if_softc *); -int sk_encap(struct sk_if_softc *, struct mbuf *, uint32_t *); -void sk_start(struct ifnet *); -int sk_ioctl(struct ifnet *, u_long, void *); -int sk_init(struct ifnet *); -void sk_unreset_xmac(struct sk_if_softc *); -void sk_init_xmac(struct sk_if_softc *); -void sk_unreset_yukon(struct sk_if_softc *); -void sk_init_yukon(struct sk_if_softc *); -void sk_stop(struct ifnet *, int); -void sk_watchdog(struct ifnet *); -void sk_shutdown(void *); -int sk_ifmedia_upd(struct ifnet *); -void sk_reset(struct sk_softc *); -int sk_newbuf(struct sk_if_softc *, int, struct mbuf *, bus_dmamap_t); -int sk_alloc_jumbo_mem(struct sk_if_softc *); -void sk_free_jumbo_mem(struct sk_if_softc *); -void *sk_jalloc(struct sk_if_softc *); -void sk_jfree(struct mbuf *, void *, size_t, void *); -int sk_init_rx_ring(struct sk_if_softc *); -int sk_init_tx_ring(struct sk_if_softc *); -uint8_t sk_vpd_readbyte(struct sk_softc *, int); -void sk_vpd_read_res(struct sk_softc *, - struct vpd_res *, int); -void sk_vpd_read(struct sk_softc *); - -void sk_update_int_mod(struct sk_softc *); - -int sk_xmac_miibus_readreg(device_t, int, int, uint16_t *); -int sk_xmac_miibus_writereg(device_t, int, int, uint16_t); -void sk_xmac_miibus_statchg(struct ifnet *); - -int sk_marv_miibus_readreg(device_t, int, int, uint16_t *); -int sk_marv_miibus_writereg(device_t, int, int, uint16_t); -void sk_marv_miibus_statchg(struct ifnet *); - -uint32_t sk_xmac_hash(void *); -uint32_t sk_yukon_hash(void *); -void sk_setfilt(struct sk_if_softc *, void *, int); -void sk_setmulti(struct sk_if_softc *); -void sk_tick(void *); +static int skc_probe(device_t, cfdata_t, void *); +static void skc_attach(device_t, device_t, void *); +static int sk_probe(device_t, cfdata_t, void *); +static void sk_attach(device_t, device_t, void *); +static int skcprint(void *, const char *); +static int sk_intr(void *); +static void sk_intr_bcom(struct sk_if_softc *); +static void sk_intr_xmac(struct sk_if_softc *); +static void sk_intr_yukon(struct sk_if_softc *); +static void sk_rxeof(struct sk_if_softc *); +static void sk_txeof(struct sk_if_softc *); +static int sk_encap(struct sk_if_softc *, struct mbuf *, uint32_t *); +static void sk_start(struct ifnet *); +static int sk_ioctl(struct ifnet *, u_long, void *); +static int sk_init(struct ifnet *); +static void sk_unreset_xmac(struct sk_if_softc *); +static void sk_init_xmac(struct sk_if_softc *); +static void sk_unreset_yukon(struct sk_if_softc *); +static void sk_init_yukon(struct sk_if_softc *); +static void sk_stop(struct ifnet *, int); +static void sk_watchdog(struct ifnet *); +static int sk_ifmedia_upd(struct ifnet *); +static void sk_reset(struct sk_softc *); +static int sk_newbuf(struct sk_if_softc *, int, struct mbuf *, bus_dmamap_t); +static int sk_alloc_jumbo_mem(struct sk_if_softc *); +static void *sk_jalloc(struct sk_if_softc *); +static void sk_jfree(struct mbuf *, void *, size_t, void *); +static int sk_init_rx_ring(struct sk_if_softc *); +static int sk_init_tx_ring(struct sk_if_softc *); +static uint8_t sk_vpd_readbyte(struct sk_softc *, int); +static void sk_vpd_read_res(struct sk_softc *, struct vpd_res *, int); +static void sk_vpd_read(struct sk_softc *); + +static void sk_update_int_mod(struct sk_softc *); + +static int sk_xmac_miibus_readreg(device_t, int, int, uint16_t *); +static int sk_xmac_miibus_writereg(device_t, int, int, uint16_t); +static void sk_xmac_miibus_statchg(struct ifnet *); + +static int sk_marv_miibus_readreg(device_t, int, int, uint16_t *); +static int sk_marv_miibus_writereg(device_t, int, int, uint16_t); +static void sk_marv_miibus_statchg(struct ifnet *); + +static uint32_t sk_xmac_hash(void *); +static uint32_t sk_yukon_hash(void *); +static void sk_setfilt(struct sk_if_softc *, void *, int); +static void sk_setmulti(struct sk_if_softc *); +static void sk_tick(void *); static bool skc_suspend(device_t, const pmf_qual_t *); static bool skc_resume(device_t, const pmf_qual_t *); @@ -215,9 +212,9 @@ static bool sk_resume(device_t dv, const pmf_qual_t *); #define DPRINTFN(n, x) if (skdebug >= (n)) printf x int skdebug = SK_DEBUG; -void sk_dump_txdesc(struct sk_tx_desc *, int); -void sk_dump_mbuf(struct mbuf *); -void sk_dump_bytes(const char *, int); +static void sk_dump_txdesc(struct sk_tx_desc *, int); +static void sk_dump_mbuf(struct mbuf *); +static void sk_dump_bytes(const char *, int); #else #define DPRINTF(x) #define DPRINTFN(n, x) @@ -322,7 +319,7 @@ sk_win_write_1(struct sk_softc *sc, uint32_t reg, uint8_t x) * the controller softc structure for later use. At the moment, * we only use the ID string during sk_attach(). */ -uint8_t +static uint8_t sk_vpd_readbyte(struct sk_softc *sc, int addr) { int i; @@ -341,7 +338,7 @@ sk_vpd_readbyte(struct sk_softc *sc, int addr) return sk_win_read_1(sc, SK_PCI_REG(SK_PCI_VPD_DATA)); } -void +static void sk_vpd_read_res(struct sk_softc *sc, struct vpd_res *res, int addr) { int i; @@ -352,7 +349,7 @@ sk_vpd_read_res(struct sk_softc *sc, struct vpd_res *res, int addr) ptr[i] = sk_vpd_readbyte(sc, i + addr); } -void +static void sk_vpd_read(struct sk_softc *sc) { int pos = 0, i; @@ -396,7 +393,7 @@ sk_vpd_read(struct sk_softc *sc) sc->sk_vpd_readonly[i] = sk_vpd_readbyte(sc, i + pos); } -int +static int sk_xmac_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val) { struct sk_if_softc *sc_if = device_private(dev); @@ -428,7 +425,7 @@ sk_xmac_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val) return 0; } -int +static int sk_xmac_miibus_writereg(device_t dev, int phy, int reg, uint16_t val) { struct sk_if_softc *sc_if = device_private(dev); @@ -462,7 +459,7 @@ sk_xmac_miibus_writereg(device_t dev, int phy, int reg, uint16_t val) return 0; } -void +static void sk_xmac_miibus_statchg(struct ifnet *ifp) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -482,7 +479,7 @@ sk_xmac_miibus_statchg(struct ifnet *ifp) } } -int +static int sk_marv_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val) { struct sk_if_softc *sc_if = device_private(dev); @@ -523,7 +520,7 @@ sk_marv_miibus_readreg(device_t dev, int phy, int reg, uint16_t *val) return 0; } -int +static int sk_marv_miibus_writereg(device_t dev, int phy, int reg, uint16_t val) { struct sk_if_softc *sc_if = device_private(dev); @@ -551,7 +548,7 @@ sk_marv_miibus_writereg(device_t dev, int phy, int reg, uint16_t val) return 0; } -void +static void sk_marv_miibus_statchg(struct ifnet *ifp) { DPRINTFN(9, ("sk_marv_miibus_statchg: gpcr=%x\n", @@ -559,7 +556,7 @@ sk_marv_miibus_statchg(struct ifnet *ifp) YUKON_GPCR))); } -uint32_t +static uint32_t sk_xmac_hash(void *addr) { uint32_t crc; @@ -570,7 +567,7 @@ sk_xmac_hash(void *addr) return crc; } -uint32_t +static uint32_t sk_yukon_hash(void *addr) { uint32_t crc; @@ -581,7 +578,7 @@ sk_yukon_hash(void *addr) return crc; } -void +static void sk_setfilt(struct sk_if_softc *sc_if, void *addrv, int slot) { char *addr = addrv; @@ -592,7 +589,7 @@ sk_setfilt(struct sk_if_softc *sc_if, void *addrv, int slot) SK_XM_WRITE_2(sc_if, base + 4, *(uint16_t *)(&addr[4])); } -void +static void sk_setmulti(struct sk_if_softc *sc_if) { struct sk_softc *sc = sc_if->sk_softc; @@ -691,7 +688,7 @@ allmulti: } } -int +static int sk_init_rx_ring(struct sk_if_softc *sc_if) { struct sk_chain_data *cd = &sc_if->sk_cdata; @@ -728,7 +725,7 @@ sk_init_rx_ring(struct sk_if_softc *sc_if) return 0; } -int +static int sk_init_tx_ring(struct sk_if_softc *sc_if) { struct sk_chain_data *cd = &sc_if->sk_cdata; @@ -761,7 +758,7 @@ sk_init_tx_ring(struct sk_if_softc *sc_if) return 0; } -int +static int sk_newbuf(struct sk_if_softc *sc_if, int i, struct mbuf *m, bus_dmamap_t dmamap) { @@ -821,7 +818,7 @@ sk_newbuf(struct sk_if_softc *sc_if, int i, struct mbuf *m, * Memory management for jumbo frames. */ -int +static int sk_alloc_jumbo_mem(struct sk_if_softc *sc_if) { struct sk_softc *sc = sc_if->sk_softc; @@ -919,7 +916,7 @@ out: /* * Allocate a jumbo buffer. */ -void * +static void * sk_jalloc(struct sk_if_softc *sc_if) { struct sk_jpool_entry *entry; @@ -941,7 +938,7 @@ sk_jalloc(struct sk_if_softc *sc_if) /* * Release a jumbo buffer. */ -void +static void sk_jfree(struct mbuf *m, void *buf, size_t size, void *arg) { struct sk_jpool_entry *entry; @@ -978,7 +975,7 @@ sk_jfree(struct mbuf *m, void *buf, size_t size, void *arg) /* * Set media options. */ -int +static int sk_ifmedia_upd(struct ifnet *ifp) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -1018,7 +1015,7 @@ sk_promisc(struct sk_if_softc *sc_if, int on) } } -int +static int sk_ioctl(struct ifnet *ifp, u_long command, void *data) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -1073,7 +1070,7 @@ sk_ioctl(struct ifnet *ifp, u_long command, void *data) return error; } -void +static void sk_update_int_mod(struct sk_softc *sc) { uint32_t imtimer_ticks; @@ -1128,7 +1125,7 @@ sk_lookup(const struct pci_attach_args *pa) * Probe for a SysKonnect GEnesis chip. */ -int +static int skc_probe(device_t parent, cfdata_t match, void *aux) { struct pci_attach_args *pa = (struct pci_attach_args *)aux; @@ -1152,7 +1149,7 @@ skc_probe(device_t parent, cfdata_t match, void *aux) /* * Force the GEnesis into reset, then bring it out of reset. */ -void +static void sk_reset(struct sk_softc *sc) { DPRINTFN(2, ("sk_reset\n")); @@ -1188,7 +1185,7 @@ sk_reset(struct sk_softc *sc) sk_update_int_mod(sc); } -int +static int sk_probe(device_t parent, cfdata_t match, void *aux) { struct skc_attach_args *sa = aux; @@ -1203,7 +1200,7 @@ sk_probe(device_t parent, cfdata_t match, void *aux) * Each XMAC chip is attached as a separate logical IP interface. * Single port cards will have only one logical interface of course. */ -void +static void sk_attach(device_t parent, device_t self, void *aux) { struct sk_if_softc *sc_if = device_private(self); @@ -1477,7 +1474,7 @@ fail: sc->sk_if[sa->skc_port] = NULL; } -int +static int skcprint(void *aux, const char *pnp) { struct skc_attach_args *sa = aux; @@ -1495,7 +1492,7 @@ skcprint(void *aux, const char *pnp) * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. */ -void +static void skc_attach(device_t parent, device_t self, void *aux) { struct sk_softc *sc = device_private(self); @@ -1851,7 +1848,7 @@ fail: bus_space_unmap(sc->sk_btag, sc->sk_bhandle, iosize); } -int +static int sk_encap(struct sk_if_softc *sc_if, struct mbuf *m_head, uint32_t *txidx) { struct sk_softc *sc = sc_if->sk_softc; @@ -1950,7 +1947,7 @@ sk_encap(struct sk_if_softc *sc_if, struct mbuf *m_head, uint32_t *txidx) return 0; } -void +static void sk_start(struct ifnet *ifp) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -2001,7 +1998,7 @@ sk_start(struct ifnet *ifp) } -void +static void sk_watchdog(struct ifnet *ifp) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -2020,7 +2017,8 @@ sk_watchdog(struct ifnet *ifp) } } -void +#if 0 /* XXX XXX XXX UNUSED */ +static void sk_shutdown(void *v) { struct sk_if_softc *sc_if = (struct sk_if_softc *)v; @@ -2039,8 +2037,9 @@ sk_shutdown(void *v) */ sk_reset(sc); } +#endif -void +static void sk_rxeof(struct sk_if_softc *sc_if) { struct ifnet *ifp = &sc_if->sk_ethercom.ec_if; @@ -2122,7 +2121,7 @@ sk_rxeof(struct sk_if_softc *sc_if) } } -void +static void sk_txeof(struct sk_if_softc *sc_if) { struct sk_softc *sc = sc_if->sk_softc; @@ -2182,7 +2181,7 @@ sk_txeof(struct sk_if_softc *sc_if) sc_if->sk_cdata.sk_tx_cons = idx; } -void +static void sk_tick(void *xsc_if) { struct sk_if_softc *sc_if = xsc_if; @@ -2227,7 +2226,7 @@ sk_tick(void *xsc_if) callout_stop(&sc_if->sk_tick_ch); } -void +static void sk_intr_bcom(struct sk_if_softc *sc_if) { struct mii_data *mii = &sc_if->sk_mii; @@ -2281,7 +2280,7 @@ sk_intr_bcom(struct sk_if_softc *sc_if) SK_XM_SETBIT_2(sc_if, XM_MMUCMD, XM_MMUCMD_TX_ENB | XM_MMUCMD_RX_ENB); } -void +static void sk_intr_xmac(struct sk_if_softc *sc_if) { uint16_t status = SK_XM_READ_2(sc_if, XM_ISR); @@ -2306,7 +2305,7 @@ sk_intr_xmac(struct sk_if_softc *sc_if) SK_XM_SETBIT_4(sc_if, XM_MODE, XM_MODE_FLUSH_RXFIFO); } -void +static void sk_intr_yukon(struct sk_if_softc *sc_if) { #ifdef SK_DEBUG @@ -2319,7 +2318,7 @@ sk_intr_yukon(struct sk_if_softc *sc_if) DPRINTFN(3, ("sk_intr_yukon status=%#x\n", status)); } -int +static int sk_intr(void *xsc) { struct sk_softc *sc = xsc; @@ -2412,7 +2411,7 @@ sk_intr(void *xsc) return claimed; } -void +static void sk_unreset_xmac(struct sk_if_softc *sc_if) { struct sk_softc *sc = sc_if->sk_softc; @@ -2480,7 +2479,7 @@ sk_unreset_xmac(struct sk_if_softc *sc_if) } } -void +static void sk_init_xmac(struct sk_if_softc *sc_if) { struct sk_softc *sc = sc_if->sk_softc; @@ -2585,7 +2584,7 @@ sk_init_xmac(struct sk_if_softc *sc_if) sc_if->sk_link = 1; } -void +static void sk_unreset_yukon(struct sk_if_softc *sc_if) { uint32_t /*mac, */phy; @@ -2644,7 +2643,7 @@ sk_unreset_yukon(struct sk_if_softc *sc_if) SK_IF_READ_4(sc_if, 0, SK_GMAC_CTRL))); } -void +static void sk_init_yukon(struct sk_if_softc *sc_if) { uint16_t reg; @@ -2728,7 +2727,7 @@ sk_init_yukon(struct sk_if_softc *sc_if) * Note that to properly initialize any part of the GEnesis chip, * you first have to take it out of reset mode. */ -int +static int sk_init(struct ifnet *ifp) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -2901,7 +2900,7 @@ out: return rc; } -void +static void sk_stop(struct ifnet *ifp, int disable) { struct sk_if_softc *sc_if = ifp->if_softc; @@ -3024,7 +3023,7 @@ CFATTACH_DECL_NEW(sk, sizeof(struct sk_if_softc), sk_probe, sk_attach, NULL, NULL); #ifdef SK_DEBUG -void +static void sk_dump_txdesc(struct sk_tx_desc *desc, int idx) { #define DESC_PRINT(X) \ @@ -3045,7 +3044,7 @@ sk_dump_txdesc(struct sk_tx_desc *desc, int idx) #undef PRINT } -void +static void sk_dump_bytes(const char *data, int len) { int c, i, j; @@ -3077,7 +3076,7 @@ sk_dump_bytes(const char *data, int len) } } -void +static void sk_dump_mbuf(struct mbuf *m) { int count = m->m_pkthdr.len; diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c index a0fffc45aed..b763ab83b84 100644 --- a/sys/dev/pci/mpii.c +++ b/sys/dev/pci/mpii.c @@ -1,4 +1,4 @@ -/* $NetBSD: mpii.c,v 1.23 2019/11/10 21:16:36 chs Exp $ */ +/* $NetBSD: mpii.c,v 1.24 2019/11/28 17:09:10 maxv Exp $ */ /* $OpenBSD: mpii.c,v 1.115 2018/08/14 05:22:21 jmatthew Exp $ */ /* * Copyright (c) 2010, 2012 Mike Belopuhov @@ -20,7 +20,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.23 2019/11/10 21:16:36 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.24 2019/11/28 17:09:10 maxv Exp $"); #include "bio.h" @@ -248,101 +248,101 @@ struct mpii_softc { envsys_data_t *sc_sensors; }; -int mpii_match(device_t, cfdata_t, void *); -void mpii_attach(device_t, device_t, void *); -int mpii_detach(device_t, int); -void mpii_childdetached(device_t, device_t); -int mpii_rescan(device_t, const char *, const int *); +static int mpii_match(device_t, cfdata_t, void *); +static void mpii_attach(device_t, device_t, void *); +static int mpii_detach(device_t, int); +static void mpii_childdetached(device_t, device_t); +static int mpii_rescan(device_t, const char *, const int *); -int mpii_intr(void *); +static int mpii_intr(void *); CFATTACH_DECL3_NEW(mpii, sizeof(struct mpii_softc), mpii_match, mpii_attach, mpii_detach, NULL, mpii_rescan, mpii_childdetached, DVF_DETACH_SHUTDOWN); -void mpii_scsipi_request(struct scsipi_channel *, +static void mpii_scsipi_request(struct scsipi_channel *, scsipi_adapter_req_t, void *); -void mpii_scsi_cmd_done(struct mpii_ccb *); +static void mpii_scsi_cmd_done(struct mpii_ccb *); -struct mpii_dmamem * +static struct mpii_dmamem * mpii_dmamem_alloc(struct mpii_softc *, size_t); -void mpii_dmamem_free(struct mpii_softc *, +static void mpii_dmamem_free(struct mpii_softc *, struct mpii_dmamem *); -int mpii_alloc_ccbs(struct mpii_softc *); -struct mpii_ccb *mpii_get_ccb(struct mpii_softc *); -void mpii_put_ccb(struct mpii_softc *, struct mpii_ccb *); -int mpii_alloc_replies(struct mpii_softc *); -int mpii_alloc_queues(struct mpii_softc *); -void mpii_push_reply(struct mpii_softc *, struct mpii_rcb *); -void mpii_push_replies(struct mpii_softc *); - -void mpii_scsi_cmd_tmo(void *); -void mpii_scsi_cmd_tmo_handler(struct work *, void *); -void mpii_scsi_cmd_tmo_done(struct mpii_ccb *); - -int mpii_insert_dev(struct mpii_softc *, struct mpii_device *); -int mpii_remove_dev(struct mpii_softc *, struct mpii_device *); -struct mpii_device * +static int mpii_alloc_ccbs(struct mpii_softc *); +static struct mpii_ccb *mpii_get_ccb(struct mpii_softc *); +static void mpii_put_ccb(struct mpii_softc *, struct mpii_ccb *); +static int mpii_alloc_replies(struct mpii_softc *); +static int mpii_alloc_queues(struct mpii_softc *); +static void mpii_push_reply(struct mpii_softc *, struct mpii_rcb *); +static void mpii_push_replies(struct mpii_softc *); + +static void mpii_scsi_cmd_tmo(void *); +static void mpii_scsi_cmd_tmo_handler(struct work *, void *); +static void mpii_scsi_cmd_tmo_done(struct mpii_ccb *); + +static int mpii_insert_dev(struct mpii_softc *, struct mpii_device *); +static int mpii_remove_dev(struct mpii_softc *, struct mpii_device *); +static struct mpii_device * mpii_find_dev(struct mpii_softc *, u_int16_t); -void mpii_start(struct mpii_softc *, struct mpii_ccb *); -int mpii_poll(struct mpii_softc *, struct mpii_ccb *); -void mpii_poll_done(struct mpii_ccb *); -struct mpii_rcb * +static void mpii_start(struct mpii_softc *, struct mpii_ccb *); +static int mpii_poll(struct mpii_softc *, struct mpii_ccb *); +static void mpii_poll_done(struct mpii_ccb *); +static struct mpii_rcb * mpii_reply(struct mpii_softc *, struct mpii_reply_descr *); -void mpii_wait(struct mpii_softc *, struct mpii_ccb *); -void mpii_wait_done(struct mpii_ccb *); +static void mpii_wait(struct mpii_softc *, struct mpii_ccb *); +static void mpii_wait_done(struct mpii_ccb *); -void mpii_init_queues(struct mpii_softc *); +static void mpii_init_queues(struct mpii_softc *); -int mpii_load_xs(struct mpii_ccb *); -int mpii_load_xs_sas3(struct mpii_ccb *); +static int mpii_load_xs(struct mpii_ccb *); +static int mpii_load_xs_sas3(struct mpii_ccb *); -u_int32_t mpii_read(struct mpii_softc *, bus_size_t); -void mpii_write(struct mpii_softc *, bus_size_t, u_int32_t); -int mpii_wait_eq(struct mpii_softc *, bus_size_t, u_int32_t, +static u_int32_t mpii_read(struct mpii_softc *, bus_size_t); +static void mpii_write(struct mpii_softc *, bus_size_t, u_int32_t); +static int mpii_wait_eq(struct mpii_softc *, bus_size_t, u_int32_t, u_int32_t); -int mpii_wait_ne(struct mpii_softc *, bus_size_t, u_int32_t, +static int mpii_wait_ne(struct mpii_softc *, bus_size_t, u_int32_t, u_int32_t); -int mpii_init(struct mpii_softc *); -int mpii_reset_soft(struct mpii_softc *); -int mpii_reset_hard(struct mpii_softc *); +static int mpii_init(struct mpii_softc *); +static int mpii_reset_soft(struct mpii_softc *); +static int mpii_reset_hard(struct mpii_softc *); -int mpii_handshake_send(struct mpii_softc *, void *, size_t); -int mpii_handshake_recv_dword(struct mpii_softc *, +static int mpii_handshake_send(struct mpii_softc *, void *, size_t); +static int mpii_handshake_recv_dword(struct mpii_softc *, u_int32_t *); -int mpii_handshake_recv(struct mpii_softc *, void *, size_t); - -void mpii_empty_done(struct mpii_ccb *); - -int mpii_iocinit(struct mpii_softc *); -int mpii_iocfacts(struct mpii_softc *); -int mpii_portfacts(struct mpii_softc *); -int mpii_portenable(struct mpii_softc *); -int mpii_cfg_coalescing(struct mpii_softc *); -int mpii_board_info(struct mpii_softc *); -int mpii_target_map(struct mpii_softc *); - -int mpii_eventnotify(struct mpii_softc *); -void mpii_eventnotify_done(struct mpii_ccb *); -void mpii_eventack(struct work *, void *); -void mpii_eventack_done(struct mpii_ccb *); -void mpii_event_process(struct mpii_softc *, struct mpii_rcb *); -void mpii_event_done(struct mpii_softc *, struct mpii_rcb *); -void mpii_event_sas(struct mpii_softc *, struct mpii_rcb *); -void mpii_event_sas_work(struct work *, void *); -void mpii_event_raid(struct mpii_softc *, +static int mpii_handshake_recv(struct mpii_softc *, void *, size_t); + +static void mpii_empty_done(struct mpii_ccb *); + +static int mpii_iocinit(struct mpii_softc *); +static int mpii_iocfacts(struct mpii_softc *); +static int mpii_portfacts(struct mpii_softc *); +static int mpii_portenable(struct mpii_softc *); +static int mpii_cfg_coalescing(struct mpii_softc *); +static int mpii_board_info(struct mpii_softc *); +static int mpii_target_map(struct mpii_softc *); + +static int mpii_eventnotify(struct mpii_softc *); +static void mpii_eventnotify_done(struct mpii_ccb *); +static void mpii_eventack(struct work *, void *); +static void mpii_eventack_done(struct mpii_ccb *); +static void mpii_event_process(struct mpii_softc *, struct mpii_rcb *); +static void mpii_event_done(struct mpii_softc *, struct mpii_rcb *); +static void mpii_event_sas(struct mpii_softc *, struct mpii_rcb *); +static void mpii_event_sas_work(struct work *, void *); +static void mpii_event_raid(struct mpii_softc *, struct mpii_msg_event_reply *); -void mpii_event_discovery(struct mpii_softc *, +static void mpii_event_discovery(struct mpii_softc *, struct mpii_msg_event_reply *); -void mpii_sas_remove_device(struct mpii_softc *, u_int16_t); +static void mpii_sas_remove_device(struct mpii_softc *, u_int16_t); -int mpii_req_cfg_header(struct mpii_softc *, u_int8_t, +static int mpii_req_cfg_header(struct mpii_softc *, u_int8_t, u_int8_t, u_int32_t, int, void *); -int mpii_req_cfg_page(struct mpii_softc *, u_int32_t, int, +static int mpii_req_cfg_page(struct mpii_softc *, u_int32_t, int, void *, int, void *, size_t); #if 0 @@ -350,21 +350,21 @@ int mpii_ioctl_cache(struct scsi_link *, u_long, struct dk_cache *); #endif #if NBIO > 0 -int mpii_ioctl(device_t, u_long, void *); -int mpii_ioctl_inq(struct mpii_softc *, struct bioc_inq *); -int mpii_ioctl_vol(struct mpii_softc *, struct bioc_vol *); -int mpii_ioctl_disk(struct mpii_softc *, struct bioc_disk *); -int mpii_bio_hs(struct mpii_softc *, struct bioc_disk *, int, +static int mpii_ioctl(device_t, u_long, void *); +static int mpii_ioctl_inq(struct mpii_softc *, struct bioc_inq *); +static int mpii_ioctl_vol(struct mpii_softc *, struct bioc_vol *); +static int mpii_ioctl_disk(struct mpii_softc *, struct bioc_disk *); +static int mpii_bio_hs(struct mpii_softc *, struct bioc_disk *, int, int, int *); -int mpii_bio_disk(struct mpii_softc *, struct bioc_disk *, +static int mpii_bio_disk(struct mpii_softc *, struct bioc_disk *, u_int8_t); -struct mpii_device * +static struct mpii_device * mpii_find_vol(struct mpii_softc *, int); #ifndef SMALL_KERNEL - int mpii_bio_volstate(struct mpii_softc *, struct bioc_vol *); -int mpii_create_sensors(struct mpii_softc *); -void mpii_refresh_sensors(struct sysmon_envsys *, envsys_data_t *); -int mpii_destroy_sensors(struct mpii_softc *); +static int mpii_bio_volstate(struct mpii_softc *, struct bioc_vol *); +static int mpii_create_sensors(struct mpii_softc *); +static void mpii_refresh_sensors(struct sysmon_envsys *, envsys_data_t *); +static int mpii_destroy_sensors(struct mpii_softc *); #endif /* SMALL_KERNEL */ #endif /* NBIO > 0 */ @@ -437,7 +437,7 @@ static const struct mpii_pci_product { { 0, 0} }; -int +static int mpii_match(device_t parent, cfdata_t match, void *aux) { struct pci_attach_args *pa = aux; @@ -451,7 +451,7 @@ mpii_match(device_t parent, cfdata_t match, void *aux) return (0); } -void +static void mpii_attach(device_t parent, device_t self, void *aux) { struct mpii_softc *sc = device_private(self); @@ -669,7 +669,7 @@ unmap: sc->sc_ios = 0; } -int +static int mpii_detach(device_t self, int flags) { struct mpii_softc *sc = device_private(self); @@ -716,7 +716,7 @@ mpii_detach(device_t self, int flags) return (0); } -int +static int mpii_rescan(device_t self, const char *ifattr, const int *locators) { struct mpii_softc *sc = device_private(self); @@ -730,7 +730,7 @@ mpii_rescan(device_t self, const char *ifattr, const int *locators) return 0; } -void +static void mpii_childdetached(device_t self, device_t child) { struct mpii_softc *sc = device_private(self); @@ -743,7 +743,7 @@ mpii_childdetached(device_t self, device_t child) } -int +static int mpii_intr(void *arg) { struct mpii_rcb_list evts = SIMPLEQ_HEAD_INITIALIZER(evts); @@ -818,7 +818,7 @@ mpii_intr(void *arg) return (1); } -int +static int mpii_load_xs_sas3(struct mpii_ccb *ccb) { struct mpii_softc *sc = ccb->ccb_sc; @@ -876,7 +876,7 @@ mpii_load_xs_sas3(struct mpii_ccb *ccb) return (0); } -int +static int mpii_load_xs(struct mpii_ccb *ccb) { struct mpii_softc *sc = ccb->ccb_sc; @@ -942,7 +942,7 @@ mpii_load_xs(struct mpii_ccb *ccb) return (0); } -u_int32_t +static u_int32_t mpii_read(struct mpii_softc *sc, bus_size_t r) { u_int32_t rv; @@ -956,7 +956,7 @@ mpii_read(struct mpii_softc *sc, bus_size_t r) return (rv); } -void +static void mpii_write(struct mpii_softc *sc, bus_size_t r, u_int32_t v) { DNPRINTF(MPII_D_RW, "%s: mpii_write %#lx %#x\n", DEVNAME(sc), r, v); @@ -967,7 +967,7 @@ mpii_write(struct mpii_softc *sc, bus_size_t r, u_int32_t v) } -int +static int mpii_wait_eq(struct mpii_softc *sc, bus_size_t r, u_int32_t mask, u_int32_t target) { @@ -985,7 +985,7 @@ mpii_wait_eq(struct mpii_softc *sc, bus_size_t r, u_int32_t mask, return (1); } -int +static int mpii_wait_ne(struct mpii_softc *sc, bus_size_t r, u_int32_t mask, u_int32_t target) { @@ -1003,7 +1003,7 @@ mpii_wait_ne(struct mpii_softc *sc, bus_size_t r, u_int32_t mask, return (1); } -int +static int mpii_init(struct mpii_softc *sc) { u_int32_t db; @@ -1061,7 +1061,7 @@ mpii_init(struct mpii_softc *sc) return (1); } -int +static int mpii_reset_soft(struct mpii_softc *sc) { DNPRINTF(MPII_D_MISC, "%s: mpii_reset_soft\n", DEVNAME(sc)); @@ -1087,7 +1087,7 @@ mpii_reset_soft(struct mpii_softc *sc) return (0); } -int +static int mpii_reset_hard(struct mpii_softc *sc) { u_int16_t i; @@ -1140,7 +1140,7 @@ mpii_reset_hard(struct mpii_softc *sc) return(0); } -int +static int mpii_handshake_send(struct mpii_softc *sc, void *buf, size_t dwords) { u_int32_t *query = buf; @@ -1183,7 +1183,7 @@ mpii_handshake_send(struct mpii_softc *sc, void *buf, size_t dwords) return (0); } -int +static int mpii_handshake_recv_dword(struct mpii_softc *sc, u_int32_t *dword) { u_int16_t *words = (u_int16_t *)dword; @@ -1199,7 +1199,7 @@ mpii_handshake_recv_dword(struct mpii_softc *sc, u_int32_t *dword) return (0); } -int +static int mpii_handshake_recv(struct mpii_softc *sc, void *buf, size_t dwords) { struct mpii_msg_reply *reply = buf; @@ -1242,13 +1242,13 @@ mpii_handshake_recv(struct mpii_softc *sc, void *buf, size_t dwords) return (0); } -void +static void mpii_empty_done(struct mpii_ccb *ccb) { /* nothing to do */ } -int +static int mpii_iocfacts(struct mpii_softc *sc) { struct mpii_msg_iocfacts_request ifq; @@ -1385,7 +1385,7 @@ mpii_iocfacts(struct mpii_softc *sc) return (0); } -int +static int mpii_iocinit(struct mpii_softc *sc) { struct mpii_msg_iocinit_request iiq; @@ -1468,7 +1468,7 @@ mpii_iocinit(struct mpii_softc *sc) return (0); } -void +static void mpii_push_reply(struct mpii_softc *sc, struct mpii_rcb *rcb) { u_int32_t *rfp; @@ -1490,7 +1490,7 @@ mpii_push_reply(struct mpii_softc *sc, struct mpii_rcb *rcb) mutex_exit(&sc->sc_reply_free_mtx); } -int +static int mpii_portfacts(struct mpii_softc *sc) { struct mpii_msg_portfacts_request *pfq; @@ -1542,7 +1542,7 @@ err: return (rv); } -void +static void mpii_eventack(struct work *wk, void * cookie) { struct mpii_softc *sc = cookie; @@ -1577,7 +1577,7 @@ mpii_eventack(struct work *wk, void * cookie) } } -void +static void mpii_eventack_done(struct mpii_ccb *ccb) { struct mpii_softc *sc = ccb->ccb_sc; @@ -1588,7 +1588,7 @@ mpii_eventack_done(struct mpii_ccb *ccb) mpii_put_ccb(sc, ccb); } -int +static int mpii_portenable(struct mpii_softc *sc) { struct mpii_msg_portenable_request *peq; @@ -1627,7 +1627,7 @@ mpii_portenable(struct mpii_softc *sc) return (0); } -int +static int mpii_cfg_coalescing(struct mpii_softc *sc) { struct mpii_cfg_hdr hdr; @@ -1672,7 +1672,7 @@ mpii_cfg_coalescing(struct mpii_softc *sc) htole32(~(1 << (evt % 32))); \ } while (0) -int +static int mpii_eventnotify(struct mpii_softc *sc) { struct mpii_msg_event_request *enq; @@ -1741,7 +1741,7 @@ mpii_eventnotify(struct mpii_softc *sc) return (0); } -void +static void mpii_eventnotify_done(struct mpii_ccb *ccb) { struct mpii_softc *sc = ccb->ccb_sc; @@ -1753,7 +1753,7 @@ mpii_eventnotify_done(struct mpii_ccb *ccb) mpii_event_process(sc, rcb); } -void +static void mpii_event_raid(struct mpii_softc *sc, struct mpii_msg_event_reply *enp) { struct mpii_evt_ir_cfg_change_list *ccl; @@ -1857,7 +1857,7 @@ mpii_event_raid(struct mpii_softc *sc, struct mpii_msg_event_reply *enp) } } -void +static void mpii_event_sas(struct mpii_softc *sc, struct mpii_rcb *rcb) { struct mpii_msg_event_reply *enp; @@ -1937,7 +1937,7 @@ mpii_event_sas(struct mpii_softc *sc, struct mpii_rcb *rcb) mpii_event_done(sc, rcb); } -void +static void mpii_event_sas_work(struct work *wq, void *xsc) { struct mpii_softc *sc = xsc; @@ -2003,7 +2003,7 @@ mpii_event_sas_work(struct work *wq, void *xsc) } } -void +static void mpii_event_discovery(struct mpii_softc *sc, struct mpii_msg_event_reply *enp) { struct mpii_evt_sas_discovery *esd = @@ -2018,7 +2018,7 @@ mpii_event_discovery(struct mpii_softc *sc, struct mpii_msg_event_reply *enp) } } -void +static void mpii_event_process(struct mpii_softc *sc, struct mpii_rcb *rcb) { struct mpii_msg_event_reply *enp; @@ -2106,7 +2106,7 @@ mpii_event_process(struct mpii_softc *sc, struct mpii_rcb *rcb) mpii_event_done(sc, rcb); } -void +static void mpii_event_done(struct mpii_softc *sc, struct mpii_rcb *rcb) { struct mpii_msg_event_reply *enp = rcb->rcb_reply; @@ -2124,7 +2124,7 @@ mpii_event_done(struct mpii_softc *sc, struct mpii_rcb *rcb) mpii_push_reply(sc, rcb); } -void +static void mpii_sas_remove_device(struct mpii_softc *sc, u_int16_t handle) { struct mpii_msg_scsi_task_request *stq; @@ -2164,7 +2164,7 @@ mpii_sas_remove_device(struct mpii_softc *sc, u_int16_t handle) mpii_put_ccb(sc, ccb); } -int +static int mpii_board_info(struct mpii_softc *sc) { struct mpii_msg_iocfacts_request ifq; @@ -2210,7 +2210,7 @@ mpii_board_info(struct mpii_softc *sc) return (0); } -int +static int mpii_target_map(struct mpii_softc *sc) { struct mpii_cfg_hdr hdr; @@ -2248,7 +2248,7 @@ mpii_target_map(struct mpii_softc *sc) return (0); } -int +static int mpii_req_cfg_header(struct mpii_softc *sc, u_int8_t type, u_int8_t number, u_int32_t address, int flags, void *p) { @@ -2343,7 +2343,7 @@ mpii_req_cfg_header(struct mpii_softc *sc, u_int8_t type, u_int8_t number, return (rv); } -int +static int mpii_req_cfg_page(struct mpii_softc *sc, u_int32_t address, int flags, void *p, int read, void *page, size_t len) { @@ -2451,7 +2451,7 @@ mpii_req_cfg_page(struct mpii_softc *sc, u_int32_t address, int flags, return (rv); } -struct mpii_rcb * +static struct mpii_rcb * mpii_reply(struct mpii_softc *sc, struct mpii_reply_descr *rdp) { struct mpii_rcb *rcb = NULL; @@ -2482,7 +2482,7 @@ mpii_reply(struct mpii_softc *sc, struct mpii_reply_descr *rdp) return (rcb); } -struct mpii_dmamem * +static struct mpii_dmamem * mpii_dmamem_alloc(struct mpii_softc *sc, size_t size) { struct mpii_dmamem *mdm; @@ -2523,7 +2523,7 @@ mdmfree: return (NULL); } -void +static void mpii_dmamem_free(struct mpii_softc *sc, struct mpii_dmamem *mdm) { DNPRINTF(MPII_D_MEM, "%s: mpii_dmamem_free %p\n", DEVNAME(sc), mdm); @@ -2535,7 +2535,7 @@ mpii_dmamem_free(struct mpii_softc *sc, struct mpii_dmamem *mdm) free(mdm, M_DEVBUF); } -int +static int mpii_insert_dev(struct mpii_softc *sc, struct mpii_device *dev) { int slot; /* initial hint */ @@ -2562,7 +2562,7 @@ mpii_insert_dev(struct mpii_softc *sc, struct mpii_device *dev) return (0); } -int +static int mpii_remove_dev(struct mpii_softc *sc, struct mpii_device *dev) { int i; @@ -2584,7 +2584,7 @@ mpii_remove_dev(struct mpii_softc *sc, struct mpii_device *dev) return (1); } -struct mpii_device * +static struct mpii_device * mpii_find_dev(struct mpii_softc *sc, u_int16_t handle) { int i; @@ -2601,7 +2601,7 @@ mpii_find_dev(struct mpii_softc *sc, u_int16_t handle) return (NULL); } -int +static int mpii_alloc_ccbs(struct mpii_softc *sc) { struct mpii_ccb *ccb; @@ -2678,7 +2678,7 @@ free_ccbs: return (1); } -void +static void mpii_put_ccb(struct mpii_softc *sc, struct mpii_ccb *ccb) { DNPRINTF(MPII_D_CCB, "%s: mpii_put_ccb %p\n", DEVNAME(sc), ccb); @@ -2694,7 +2694,7 @@ mpii_put_ccb(struct mpii_softc *sc, struct mpii_ccb *ccb) mutex_exit(&sc->sc_ccb_free_mtx); } -struct mpii_ccb * +static struct mpii_ccb * mpii_get_ccb(struct mpii_softc *sc) { struct mpii_ccb *ccb; @@ -2713,7 +2713,7 @@ mpii_get_ccb(struct mpii_softc *sc) return (ccb); } -int +static int mpii_alloc_replies(struct mpii_softc *sc) { DNPRINTF(MPII_D_MISC, "%s: mpii_alloc_replies\n", DEVNAME(sc)); @@ -2731,7 +2731,7 @@ mpii_alloc_replies(struct mpii_softc *sc) return (0); } -void +static void mpii_push_replies(struct mpii_softc *sc) { struct mpii_rcb *rcb; @@ -2752,7 +2752,7 @@ mpii_push_replies(struct mpii_softc *sc) } } -void +static void mpii_start(struct mpii_softc *sc, struct mpii_ccb *ccb) { struct mpii_request_header *rhp; @@ -2817,7 +2817,7 @@ mpii_start(struct mpii_softc *sc, struct mpii_ccb *ccb) #endif } -int +static int mpii_poll(struct mpii_softc *sc, struct mpii_ccb *ccb) { void (*done)(struct mpii_ccb *); @@ -2848,7 +2848,7 @@ mpii_poll(struct mpii_softc *sc, struct mpii_ccb *ccb) return (0); } -void +static void mpii_poll_done(struct mpii_ccb *ccb) { int *rv = ccb->ccb_cookie; @@ -2856,7 +2856,7 @@ mpii_poll_done(struct mpii_ccb *ccb) *rv = 0; } -int +static int mpii_alloc_queues(struct mpii_softc *sc) { u_int32_t *rfp; @@ -2890,7 +2890,7 @@ free_reply_freeq: return (1); } -void +static void mpii_init_queues(struct mpii_softc *sc) { DNPRINTF(MPII_D_MISC, "%s: mpii_init_queues\n", DEVNAME(sc)); @@ -2901,7 +2901,7 @@ mpii_init_queues(struct mpii_softc *sc) mpii_write_reply_post(sc, sc->sc_reply_post_host_index); } -void +static void mpii_wait(struct mpii_softc *sc, struct mpii_ccb *ccb) { void (*done)(struct mpii_ccb *); @@ -2926,7 +2926,7 @@ mpii_wait(struct mpii_softc *sc, struct mpii_ccb *ccb) done(ccb); } -void +static void mpii_wait_done(struct mpii_ccb *ccb) { mutex_enter(&ccb->ccb_mtx); @@ -2935,7 +2935,7 @@ mpii_wait_done(struct mpii_ccb *ccb) mutex_exit(&ccb->ccb_mtx); } -void +static void mpii_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, void *arg) { @@ -3068,7 +3068,7 @@ done: scsipi_done(xs); } -void +static void mpii_scsi_cmd_tmo(void *xccb) { struct mpii_ccb *ccb = xccb; @@ -3090,7 +3090,7 @@ mpii_scsi_cmd_tmo(void *xccb) } } -void +static void mpii_scsi_cmd_tmo_handler(struct work *wk, void *cookie) { struct mpii_softc *sc = cookie; @@ -3120,7 +3120,7 @@ mpii_scsi_cmd_tmo_handler(struct work *wk, void *cookie) } } -void +static void mpii_scsi_cmd_tmo_done(struct mpii_ccb *tccb) { mpii_put_ccb(tccb->ccb_sc, tccb); @@ -3179,7 +3179,7 @@ map_scsi_status(u_int8_t mpii_scsi_status) return scsi_status; } -void +static void mpii_scsi_cmd_done(struct mpii_ccb *ccb) { struct mpii_msg_scsi_io_error *sie; @@ -3431,7 +3431,7 @@ done: #endif /* 0 */ #if NBIO > 0 -int +static int mpii_ioctl(device_t dev, u_long cmd, void *addr) { struct mpii_softc *sc = device_private(dev); @@ -3460,7 +3460,7 @@ mpii_ioctl(device_t dev, u_long cmd, void *addr) return (error); } -int +static int mpii_ioctl_inq(struct mpii_softc *sc, struct bioc_inq *bi) { int i; @@ -3477,7 +3477,7 @@ mpii_ioctl_inq(struct mpii_softc *sc, struct bioc_inq *bi) return (0); } -int +static int mpii_ioctl_vol(struct mpii_softc *sc, struct bioc_vol *bv) { struct mpii_cfg_raid_vol_pg0 *vpg; @@ -3576,7 +3576,7 @@ mpii_ioctl_vol(struct mpii_softc *sc, struct bioc_vol *bv) return (0); } -int +static int mpii_ioctl_disk(struct mpii_softc *sc, struct bioc_disk *bd) { struct mpii_cfg_raid_vol_pg0 *vpg; @@ -3637,7 +3637,7 @@ mpii_ioctl_disk(struct mpii_softc *sc, struct bioc_disk *bd) return (mpii_bio_disk(sc, bd, dn)); } -int +static int mpii_bio_hs(struct mpii_softc *sc, struct bioc_disk *bd, int nvdsk, int hsmap, int *hscnt) { @@ -3707,7 +3707,7 @@ mpii_bio_hs(struct mpii_softc *sc, struct bioc_disk *bd, int nvdsk, return (0); } -int +static int mpii_bio_disk(struct mpii_softc *sc, struct bioc_disk *bd, u_int8_t dn) { struct mpii_cfg_raid_physdisk_pg0 *ppg; @@ -3798,7 +3798,7 @@ mpii_bio_disk(struct mpii_softc *sc, struct bioc_disk *bd, u_int8_t dn) return (0); } -struct mpii_device * +static struct mpii_device * mpii_find_vol(struct mpii_softc *sc, int volid) { struct mpii_device *dev = NULL; @@ -3815,7 +3815,7 @@ mpii_find_vol(struct mpii_softc *sc, int volid) /* * Non-sleeping lightweight version of the mpii_ioctl_vol */ -int +static int mpii_bio_volstate(struct mpii_softc *sc, struct bioc_vol *bv) { struct mpii_cfg_raid_vol_pg0 *vpg; @@ -3877,7 +3877,7 @@ mpii_bio_volstate(struct mpii_softc *sc, struct bioc_vol *bv) return (0); } -int +static int mpii_create_sensors(struct mpii_softc *sc) { int i, rv; @@ -3924,7 +3924,7 @@ out: return 1; } -int +static int mpii_destroy_sensors(struct mpii_softc *sc) { if (sc->sc_sme == NULL) @@ -3936,7 +3936,7 @@ mpii_destroy_sensors(struct mpii_softc *sc) } -void +static void mpii_refresh_sensors(struct sysmon_envsys *sme, envsys_data_t *edata) { struct mpii_softc *sc = sme->sme_cookie; |
