Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips Rename all Cavium Octeon device driver functio...
details: https://anonhg.NetBSD.org/src/rev/309aef8ee4b6
branches: trunk
changeset: 933797:309aef8ee4b6
user: simonb <simonb%NetBSD.org@localhost>
date: Sun May 31 06:27:06 2020 +0000
description:
Rename all Cavium Octeon device driver functions, structs etc from
"octeon_foo" to "octfoo", except "octeon_eth" becomes "cnmac".
diffstat:
sys/arch/mips/cavium/dev/if_cnmac.c | 849 +++++++++++++++---------------
sys/arch/mips/cavium/dev/if_cnmacvar.h | 50 +-
sys/arch/mips/cavium/dev/octeon_asx.c | 93 +-
sys/arch/mips/cavium/dev/octeon_asxvar.h | 18 +-
sys/arch/mips/cavium/dev/octeon_ciu.c | 26 +-
sys/arch/mips/cavium/dev/octeon_fau.c | 50 +-
sys/arch/mips/cavium/dev/octeon_fauvar.h | 70 +-
sys/arch/mips/cavium/dev/octeon_fpa.c | 171 +++---
sys/arch/mips/cavium/dev/octeon_fpavar.h | 36 +-
sys/arch/mips/cavium/dev/octeon_gmx.c | 466 ++++++++--------
sys/arch/mips/cavium/dev/octeon_gmxvar.h | 84 +-
sys/arch/mips/cavium/dev/octeon_ipd.c | 107 +-
sys/arch/mips/cavium/dev/octeon_ipdvar.h | 37 +-
sys/arch/mips/cavium/dev/octeon_mpi.c | 116 ++--
sys/arch/mips/cavium/dev/octeon_mpivar.h | 8 +-
sys/arch/mips/cavium/dev/octeon_pci.c | 66 +-
sys/arch/mips/cavium/dev/octeon_pip.c | 110 +--
sys/arch/mips/cavium/dev/octeon_pipvar.h | 42 +-
sys/arch/mips/cavium/dev/octeon_pko.c | 73 +-
sys/arch/mips/cavium/dev/octeon_pkovar.h | 46 +-
sys/arch/mips/cavium/dev/octeon_pow.c | 424 +++++++-------
sys/arch/mips/cavium/dev/octeon_powvar.h | 88 +-
sys/arch/mips/cavium/dev/octeon_rnm.c | 92 +-
sys/arch/mips/cavium/dev/octeon_smi.c | 23 +-
sys/arch/mips/cavium/dev/octeon_smivar.h | 15 +-
sys/arch/mips/cavium/octeon_intr.c | 16 +-
sys/arch/mips/cavium/octeon_iobus.c | 12 +-
sys/arch/mips/cavium/octeonvar.h | 8 +-
sys/arch/mips/conf/files.octeon | 14 +-
29 files changed, 1584 insertions(+), 1626 deletions(-)
diffs (truncated from 7587 to 300 lines):
diff -r 4d2828f707c7 -r 309aef8ee4b6 sys/arch/mips/cavium/dev/if_cnmac.c
--- a/sys/arch/mips/cavium/dev/if_cnmac.c Sun May 31 06:23:49 2020 +0000
+++ b/sys/arch/mips/cavium/dev/if_cnmac.c Sun May 31 06:27:06 2020 +0000
@@ -1,13 +1,13 @@
-/* $NetBSD: if_cnmac.c,v 1.18 2020/04/24 09:29:26 mrg Exp $ */
+/* $NetBSD: if_cnmac.c,v 1.19 2020/05/31 06:27:06 simonb Exp $ */
#include <sys/cdefs.h>
#if 0
-__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.18 2020/04/24 09:29:26 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cnmac.c,v 1.19 2020/05/31 06:27:06 simonb Exp $");
#endif
#include "opt_octeon.h"
-#ifdef OCTEON_ETH_DEBUG
+#ifdef CNMAC_DEBUG
#ifndef DIAGNOSTIC
#define DIAGNOSTIC
@@ -22,7 +22,7 @@
/*
* If no free send buffer is available, free all the sent buffers and bail out.
*/
-#define OCTEON_ETH_SEND_QUEUE_CHECK
+#define CNMAC_SEND_QUEUE_CHECK
/* XXX XXX XXX XXX XXX XXX */
@@ -86,12 +86,12 @@
#include <mips/cavium/dev/octeon_smivar.h>
#include <mips/cavium/dev/if_cnmacvar.h>
-#ifdef OCTEON_ETH_DEBUG
-#define OCTEON_ETH_KASSERT(x) KASSERT(x)
-#define OCTEON_ETH_KDASSERT(x) KDASSERT(x)
+#ifdef CNMAC_DEBUG
+#define CNMAC_KASSERT(x) KASSERT(x)
+#define CNMAC_KDASSERT(x) KDASSERT(x)
#else
-#define OCTEON_ETH_KASSERT(x)
-#define OCTEON_ETH_KDASSERT(x)
+#define CNMAC_KASSERT(x)
+#define CNMAC_KDASSERT(x)
#endif
/*
@@ -102,103 +102,95 @@
(((uint32_t)OCTEON_POOL_SIZE_CMD / sizeof(uint64_t)) - 1)
#define FPA_COMMAND_BUFFER_POOL_NWORDS OCTEON_POOL_NWORDS_CMD /* XXX */
-static void octeon_eth_buf_init(struct octeon_eth_softc *);
+static void cnmac_buf_init(struct cnmac_softc *);
-static int octeon_eth_match(device_t, struct cfdata *, void *);
-static void octeon_eth_attach(device_t, device_t, void *);
-static void octeon_eth_pip_init(struct octeon_eth_softc *);
-static void octeon_eth_ipd_init(struct octeon_eth_softc *);
-static void octeon_eth_pko_init(struct octeon_eth_softc *);
-static void octeon_eth_asx_init(struct octeon_eth_softc *);
-static void octeon_eth_smi_init(struct octeon_eth_softc *);
+static int cnmac_match(device_t, struct cfdata *, void *);
+static void cnmac_attach(device_t, device_t, void *);
+static void cnmac_pip_init(struct cnmac_softc *);
+static void cnmac_ipd_init(struct cnmac_softc *);
+static void cnmac_pko_init(struct cnmac_softc *);
+static void cnmac_asx_init(struct cnmac_softc *);
+static void cnmac_smi_init(struct cnmac_softc *);
-static void octeon_eth_board_mac_addr(uint8_t *, size_t,
- struct octeon_eth_softc *);
+static void cnmac_board_mac_addr(uint8_t *, size_t, struct cnmac_softc *);
-static int octeon_eth_mii_readreg(device_t, int, int, uint16_t *);
-static int octeon_eth_mii_writereg(device_t, int, int, uint16_t);
-static void octeon_eth_mii_statchg(struct ifnet *);
+static int cnmac_mii_readreg(device_t, int, int, uint16_t *);
+static int cnmac_mii_writereg(device_t, int, int, uint16_t);
+static void cnmac_mii_statchg(struct ifnet *);
-static int octeon_eth_mediainit(struct octeon_eth_softc *);
-static void octeon_eth_mediastatus(struct ifnet *, struct ifmediareq *);
+static int cnmac_mediainit(struct cnmac_softc *);
+static void cnmac_mediastatus(struct ifnet *, struct ifmediareq *);
-static inline void octeon_eth_send_queue_flush_prefetch(struct octeon_eth_softc *);
-static inline void octeon_eth_send_queue_flush_fetch(struct octeon_eth_softc *);
-static inline void octeon_eth_send_queue_flush(struct octeon_eth_softc *);
-static inline void octeon_eth_send_queue_flush_sync(struct octeon_eth_softc *);
-static inline int octeon_eth_send_queue_is_full(struct octeon_eth_softc *);
-static inline void octeon_eth_send_queue_add(struct octeon_eth_softc *,
- struct mbuf *, uint64_t *);
-static inline void octeon_eth_send_queue_del(struct octeon_eth_softc *,
- struct mbuf **, uint64_t **);
-static inline int octeon_eth_buf_free_work(struct octeon_eth_softc *,
- uint64_t *, uint64_t);
-static inline void octeon_eth_buf_ext_free_m(struct mbuf *, void *, size_t,
- void *);
-static inline void octeon_eth_buf_ext_free_ext(struct mbuf *, void *, size_t,
+static inline void cnmac_send_queue_flush_prefetch(struct cnmac_softc *);
+static inline void cnmac_send_queue_flush_fetch(struct cnmac_softc *);
+static inline void cnmac_send_queue_flush(struct cnmac_softc *);
+static inline void cnmac_send_queue_flush_sync(struct cnmac_softc *);
+static inline int cnmac_send_queue_is_full(struct cnmac_softc *);
+static inline void cnmac_send_queue_add(struct cnmac_softc *, struct mbuf *,
+ uint64_t *);
+static inline void cnmac_send_queue_del(struct cnmac_softc *, struct mbuf **,
+ uint64_t **);
+static inline int cnmac_buf_free_work(struct cnmac_softc *, uint64_t *,
+ uint64_t);
+static inline void cnmac_buf_ext_free_m(struct mbuf *, void *, size_t, void *);
+static inline void cnmac_buf_ext_free_ext(struct mbuf *, void *, size_t,
void *);
-static int octeon_eth_ioctl(struct ifnet *, u_long, void *);
-static void octeon_eth_watchdog(struct ifnet *);
-static int octeon_eth_init(struct ifnet *);
-static void octeon_eth_stop(struct ifnet *, int);
-static void octeon_eth_start(struct ifnet *);
-
-static inline int octeon_eth_send_cmd(struct octeon_eth_softc *, uint64_t,
- uint64_t, int *);
-static inline uint64_t octeon_eth_send_makecmd_w1(int, paddr_t);
-static inline uint64_t octeon_eth_send_makecmd_w0(uint64_t, uint64_t, size_t,
- int);
-static inline int octeon_eth_send_makecmd_gbuf(struct octeon_eth_softc *,
- struct mbuf *, uint64_t *, int *);
-static inline int octeon_eth_send_makecmd(struct octeon_eth_softc *,
- struct mbuf *, uint64_t *, uint64_t *, uint64_t *);
-static inline int octeon_eth_send_buf(struct octeon_eth_softc *,
- struct mbuf *, uint64_t *, int *);
-static inline int octeon_eth_send(struct octeon_eth_softc *,
- struct mbuf *, int *);
+static int cnmac_ioctl(struct ifnet *, u_long, void *);
+static void cnmac_watchdog(struct ifnet *);
+static int cnmac_init(struct ifnet *);
+static void cnmac_stop(struct ifnet *, int);
+static void cnmac_start(struct ifnet *);
-static int octeon_eth_reset(struct octeon_eth_softc *);
-static int octeon_eth_configure(struct octeon_eth_softc *);
-static int octeon_eth_configure_common(struct octeon_eth_softc *);
-
-static void octeon_eth_tick_free(void *);
-static void octeon_eth_tick_misc(void *);
+static inline int cnmac_send_cmd(struct cnmac_softc *, uint64_t, uint64_t,
+ int *);
+static inline uint64_t cnmac_send_makecmd_w1(int, paddr_t);
+static inline uint64_t cnmac_send_makecmd_w0(uint64_t, uint64_t, size_t, int);
+static inline int cnmac_send_makecmd_gbuf(struct cnmac_softc *, struct mbuf *,
+ uint64_t *, int *);
+static inline int cnmac_send_makecmd(struct cnmac_softc *, struct mbuf *,
+ uint64_t *, uint64_t *, uint64_t *);
+static inline int cnmac_send_buf(struct cnmac_softc *, struct mbuf *,
+ uint64_t *, int *);
+static inline int cnmac_send(struct cnmac_softc *, struct mbuf *, int *);
-static inline int octeon_eth_recv_mbuf(struct octeon_eth_softc *,
- uint64_t *, struct mbuf **);
-static inline int octeon_eth_recv_check_code(struct octeon_eth_softc *,
- uint64_t);
-static inline int octeon_eth_recv_check_jumbo(struct octeon_eth_softc *,
- uint64_t);
-static inline int octeon_eth_recv_check_link(struct octeon_eth_softc *,
- uint64_t);
-static inline int octeon_eth_recv_check(struct octeon_eth_softc *,
- uint64_t);
-static inline int octeon_eth_recv(struct octeon_eth_softc *, uint64_t *);
-static void octeon_eth_recv_redir(struct ifnet *, struct mbuf *);
-static inline void octeon_eth_recv_intr(void *, uint64_t *);
+static int cnmac_reset(struct cnmac_softc *);
+static int cnmac_configure(struct cnmac_softc *);
+static int cnmac_configure_common(struct cnmac_softc *);
+
+static void cnmac_tick_free(void *);
+static void cnmac_tick_misc(void *);
+
+static inline int cnmac_recv_mbuf(struct cnmac_softc *, uint64_t *,
+ struct mbuf **);
+static inline int cnmac_recv_check_code(struct cnmac_softc *, uint64_t);
+static inline int cnmac_recv_check_jumbo(struct cnmac_softc *, uint64_t);
+static inline int cnmac_recv_check_link(struct cnmac_softc *, uint64_t);
+static inline int cnmac_recv_check(struct cnmac_softc *, uint64_t);
+static inline int cnmac_recv(struct cnmac_softc *, uint64_t *);
+static void cnmac_recv_redir(struct ifnet *, struct mbuf *);
+static inline void cnmac_recv_intr(void *, uint64_t *);
/* Device driver context */
-static struct octeon_eth_softc *octeon_eth_gsc[GMX_PORT_NUNITS];
-static void *octeon_eth_pow_recv_ih;
+static struct cnmac_softc *cnmac_gsc[GMX_PORT_NUNITS];
+static void *cnmac_pow_recv_ih;
/* sysctl'able parameters */
-int octeon_eth_param_pko_cmd_w0_n2 = 1;
-int octeon_eth_param_pip_dyn_rs = 1;
-int octeon_eth_param_redir = 0;
-int octeon_eth_param_pktbuf = 0;
-int octeon_eth_param_rate = 0;
-int octeon_eth_param_intr = 0;
+int cnmac_param_pko_cmd_w0_n2 = 1;
+int cnmac_param_pip_dyn_rs = 1;
+int cnmac_param_redir = 0;
+int cnmac_param_pktbuf = 0;
+int cnmac_param_rate = 0;
+int cnmac_param_intr = 0;
-CFATTACH_DECL_NEW(cnmac, sizeof(struct octeon_eth_softc),
- octeon_eth_match, octeon_eth_attach, NULL, NULL);
+CFATTACH_DECL_NEW(cnmac, sizeof(struct cnmac_softc),
+ cnmac_match, cnmac_attach, NULL, NULL);
-#ifdef OCTEON_ETH_DEBUG
+#ifdef CNMAC_DEBUG
static const struct octeon_evcnt_entry octeon_evcnt_entries[] = {
#define _ENTRY(name, type, parent, descr) \
- OCTEON_EVCNT_ENTRY(struct octeon_eth_softc, name, type, parent, descr)
+ OCTEON_EVCNT_ENTRY(struct cnmac_softc, name, type, parent, descr)
_ENTRY(rx, MISC, NULL, "rx"),
_ENTRY(rxint, INTR, NULL, "rx intr"),
_ENTRY(rxrs, MISC, NULL, "rx dynamic short"),
@@ -236,11 +228,11 @@
/* ---- buffer management */
-static const struct octeon_eth_pool_param {
+static const struct cnmac_pool_param {
int poolno;
size_t size;
size_t nelems;
-} octeon_eth_pool_params[] = {
+} cnmac_pool_params[] = {
#define _ENTRY(x) { OCTEON_POOL_NO_##x, OCTEON_POOL_SIZE_##x, OCTEON_POOL_NELEMS_##x }
_ENTRY(PKT),
_ENTRY(WQE),
@@ -248,37 +240,37 @@
_ENTRY(SG)
#undef _ENTRY
};
-struct octeon_fpa_buf *octeon_eth_pools[8/* XXX */];
-#define octeon_eth_fb_pkt octeon_eth_pools[OCTEON_POOL_NO_PKT]
-#define octeon_eth_fb_wqe octeon_eth_pools[OCTEON_POOL_NO_WQE]
-#define octeon_eth_fb_cmd octeon_eth_pools[OCTEON_POOL_NO_CMD]
-#define octeon_eth_fb_sg octeon_eth_pools[OCTEON_POOL_NO_SG]
+struct octfpa_buf *cnmac_pools[8/* XXX */];
+#define cnmac_fb_pkt cnmac_pools[OCTEON_POOL_NO_PKT]
+#define cnmac_fb_wqe cnmac_pools[OCTEON_POOL_NO_WQE]
+#define cnmac_fb_cmd cnmac_pools[OCTEON_POOL_NO_CMD]
+#define cnmac_fb_sg cnmac_pools[OCTEON_POOL_NO_SG]
static void
-octeon_eth_buf_init(struct octeon_eth_softc *sc)
+cnmac_buf_init(struct cnmac_softc *sc)
{
static int once;
int i;
- const struct octeon_eth_pool_param *pp;
- struct octeon_fpa_buf *fb;
+ const struct cnmac_pool_param *pp;
+ struct octfpa_buf *fb;
if (once == 1)
return;
once = 1;
- for (i = 0; i < (int)__arraycount(octeon_eth_pool_params); i++) {
- pp = &octeon_eth_pool_params[i];
- octeon_fpa_buf_init(pp->poolno, pp->size, pp->nelems, &fb);
- octeon_eth_pools[i] = fb;
+ for (i = 0; i < (int)__arraycount(cnmac_pool_params); i++) {
+ pp = &cnmac_pool_params[i];
+ octfpa_buf_init(pp->poolno, pp->size, pp->nelems, &fb);
+ cnmac_pools[i] = fb;
}
}
/* ---- autoconf */
static int
-octeon_eth_match(device_t parent, struct cfdata *match, void *aux)
+cnmac_match(device_t parent, struct cfdata *match, void *aux)
{
- struct octeon_gmx_attach_args *ga = aux;
+ struct octgmx_attach_args *ga = aux;
if (strcmp(match->cf_name, ga->ga_name) != 0) {
return 0;
@@ -287,10 +279,10 @@
}
static void
-octeon_eth_attach(device_t parent, device_t self, void *aux)
+cnmac_attach(device_t parent, device_t self, void *aux)
{
- struct octeon_eth_softc *sc = device_private(self);
- struct octeon_gmx_attach_args *ga = aux;
+ struct cnmac_softc *sc = device_private(self);
+ struct octgmx_attach_args *ga = aux;
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
Home |
Main Index |
Thread Index |
Old Index