-/* $OpenBSD: cn30xxgmx.c,v 1.12 2014/05/07 14:44:54 pirofti Exp $ */
+/* $OpenBSD: cn30xxgmx.c,v 1.13 2014/08/11 18:08:17 miod Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
int (*port_ops_set_filter)(struct cn30xxgmx_port_softc *);
};
-static int cn30xxgmx_match(struct device *, void *, void *);
-static void cn30xxgmx_attach(struct device *, struct device *, void *);
-static int cn30xxgmx_print(void *, const char *);
-static int cn30xxgmx_submatch(struct device *, void *, void *);
-static int cn30xxgmx_init(struct cn30xxgmx_softc *);
-static int cn30xxgmx_rx_frm_ctl_xable(struct cn30xxgmx_port_softc *,
- uint64_t, int);
-static int cn30xxgmx_rgmii_enable(struct cn30xxgmx_port_softc *, int);
-static int cn30xxgmx_rgmii_speed(struct cn30xxgmx_port_softc *);
-static int cn30xxgmx_rgmii_speed_newlink(struct cn30xxgmx_port_softc *,
- uint64_t *);
-static int cn30xxgmx_rgmii_speed_speed(struct cn30xxgmx_port_softc *);
-static int cn30xxgmx_rgmii_timing(struct cn30xxgmx_port_softc *);
-static int cn30xxgmx_rgmii_set_mac_addr(struct cn30xxgmx_port_softc *,
- uint8_t *, uint64_t);
-static int cn30xxgmx_rgmii_set_filter(struct cn30xxgmx_port_softc *);
+int cn30xxgmx_match(struct device *, void *, void *);
+void cn30xxgmx_attach(struct device *, struct device *, void *);
+int cn30xxgmx_print(void *, const char *);
+int cn30xxgmx_submatch(struct device *, void *, void *);
+int cn30xxgmx_init(struct cn30xxgmx_softc *);
+int cn30xxgmx_rx_frm_ctl_xable(struct cn30xxgmx_port_softc *,
+ uint64_t, int);
+int cn30xxgmx_rgmii_enable(struct cn30xxgmx_port_softc *, int);
+int cn30xxgmx_rgmii_speed(struct cn30xxgmx_port_softc *);
+int cn30xxgmx_rgmii_speed_newlink(struct cn30xxgmx_port_softc *,
+ uint64_t *);
+int cn30xxgmx_rgmii_speed_speed(struct cn30xxgmx_port_softc *);
+int cn30xxgmx_rgmii_timing(struct cn30xxgmx_port_softc *);
+int cn30xxgmx_rgmii_set_mac_addr(struct cn30xxgmx_port_softc *,
+ uint8_t *, uint64_t);
+int cn30xxgmx_rgmii_set_filter(struct cn30xxgmx_port_softc *);
#ifdef OCTEON_ETH_DEBUG
-void cn30xxgmx_intr_evcnt_attach(struct cn30xxgmx_softc *);
-void cn30xxgmx_dump(void);
-void cn30xxgmx_debug_reset(void);
-int cn30xxgmx_intr_drop(void *);
-static int cn30xxgmx_rgmii_speed_newlink_log(
- struct cn30xxgmx_port_softc *, uint64_t);
+void cn30xxgmx_intr_evcnt_attach(struct cn30xxgmx_softc *);
+void cn30xxgmx_dump(void);
+void cn30xxgmx_debug_reset(void);
+int cn30xxgmx_intr_drop(void *);
+int cn30xxgmx_rgmii_speed_newlink_log(struct cn30xxgmx_port_softc *,
+ uint64_t);
#endif
static const int cn30xxgmx_rx_adr_cam_regs[] = {
struct cfdriver cn30xxgmx_cd = {NULL, "cn30xxgmx", DV_DULL};
-static int
+int
cn30xxgmx_match(struct device *parent, void *match, void *aux)
{
struct cfdata *cf = (struct cfdata *)match;
return 1;
}
-static int
+int
cn30xxgmx_port_phy_addr(int port)
{
extern struct boot_info *octeon_boot_info;
}
}
-static void
+void
cn30xxgmx_attach(struct device *parent, struct device *self, void *aux)
{
struct cn30xxgmx_softc *sc = (void *)self;
#endif
}
-static int
+int
cn30xxgmx_print(void *aux, const char *pnp)
{
struct cn30xxgmx_attach_args *ga = aux;
return UNCONF;
}
-static int
+int
cn30xxgmx_submatch(struct device *parent, void *vcf, void *aux)
{
struct cfdata *cf = vcf;
return (*cf->cf_attach->ca_match)(parent, vcf, aux);
}
-static int
+int
cn30xxgmx_init(struct cn30xxgmx_softc *sc)
{
int result = 0;
_GMX_PORT_WR8(sc, GMX0_RX0_STATS_PKTS_BAD, tmp - 1);
}
-static int
+int
cn30xxgmx_tx_ovr_bp_enable(struct cn30xxgmx_port_softc *sc, int enable)
{
uint64_t ovr_bp;
return 0;
}
-static int
+int
cn30xxgmx_rx_pause_enable(struct cn30xxgmx_port_softc *sc, int enable)
{
if (enable) {
return cn30xxgmx_rx_frm_ctl_xable(sc, rx_frm_ctl, 0);
}
-static int
+int
cn30xxgmx_rx_frm_ctl_xable(struct cn30xxgmx_port_softc *sc,
uint64_t rx_frm_ctl, int enable)
{
return 0;
}
-static int
+int
cn30xxgmx_rgmii_enable(struct cn30xxgmx_port_softc *sc, int enable)
{
uint64_t mode;
return 0;
}
-static int
+int
cn30xxgmx_rgmii_speed(struct cn30xxgmx_port_softc *sc)
{
struct ifnet *ifp = &sc->sc_port_ac->ac_if;
return 0;
}
-static int
+int
cn30xxgmx_rgmii_speed_newlink(struct cn30xxgmx_port_softc *sc,
uint64_t *rnewlink)
{
}
#ifdef OCTEON_ETH_DEBUG
-static int
+int
cn30xxgmx_rgmii_speed_newlink_log(struct cn30xxgmx_port_softc *sc,
uint64_t newlink)
{
}
#endif
-static int
+int
cn30xxgmx_rgmii_speed_speed(struct cn30xxgmx_port_softc *sc)
{
uint64_t prt_cfg;
return 0;
}
-static int
+int
cn30xxgmx_rgmii_timing(struct cn30xxgmx_port_softc *sc)
{
extern struct boot_info *octeon_boot_info;
return 0;
}
-static int
+int
cn30xxgmx_rgmii_set_mac_addr(struct cn30xxgmx_port_softc *sc, uint8_t *addr,
uint64_t mac)
{
#define OCTEON_ETH_USE_GMX_CAM
-static int
+int
cn30xxgmx_rgmii_set_filter(struct cn30xxgmx_port_softc *sc)
{
struct ifnet *ifp = &sc->sc_port_ac->ac_if;
#define _POLICY_REJECT CN30XXGMX_FILTER_POLICY_REJECT
#define _POLICY_REJECT_ALL CN30XXGMX_FILTER_POLICY_REJECT_ALL
-static int cn30xxgmx_setfilt_addrs(struct cn30xxgmx_port_softc *,
- size_t, uint8_t **);
+int cn30xxgmx_setfilt_addrs(struct cn30xxgmx_port_softc *,
+ size_t, uint8_t **);
int
cn30xxgmx_setfilt(struct cn30xxgmx_port_softc *sc, enum _POLICY policy,
return 0;
}
-static int
+int
cn30xxgmx_setfilt_addrs(struct cn30xxgmx_port_softc *sc, size_t naddrs,
uint8_t **addrs)
{
/* ---- interrupt */
#ifdef OCTEON_ETH_DEBUG
-void cn30xxgmx_intr_rml_gmx0(void);
+void cn30xxgmx_intr_rml_gmx0(void);
-int cn30xxgmx_intr_rml_verbose;
+int cn30xxgmx_intr_rml_verbose;
/* tx - per unit (gmx0, gmx1, ...) */
static const struct octeon_evcnt_entry cn30xxgmx_intr_evcnt_tx_entries[] = {
-/* $OpenBSD: cn30xxpow.c,v 1.4 2014/03/29 18:09:30 guenther Exp $ */
+/* $OpenBSD: cn30xxpow.c,v 1.5 2014/08/11 18:08:17 miod Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
#endif
};
-void cn30xxpow_bootstrap(struct octeon_config *);
+void cn30xxpow_bootstrap(struct octeon_config *);
#ifdef OCTEON_ETH_DEBUG
-void cn30xxpow_intr_evcnt_attach(struct cn30xxpow_softc *);
-void cn30xxpow_intr_rml(void *);
-
-static void cn30xxpow_intr_debug_init(
- struct cn30xxpow_intr_handle *, int);
-static void cn30xxpow_intr_work_debug_ival(struct cn30xxpow_softc *,
- struct cn30xxpow_intr_handle *);
-static void cn30xxpow_intr_work_debug_per(struct cn30xxpow_softc *,
- struct cn30xxpow_intr_handle *, int);
+void cn30xxpow_intr_evcnt_attach(struct cn30xxpow_softc *);
+void cn30xxpow_intr_rml(void *);
+
+void cn30xxpow_intr_debug_init(struct cn30xxpow_intr_handle *, int);
+void cn30xxpow_intr_work_debug_ival(struct cn30xxpow_softc *,
+ struct cn30xxpow_intr_handle *);
+void cn30xxpow_intr_work_debug_per(struct cn30xxpow_softc *,
+ struct cn30xxpow_intr_handle *, int);
#endif
-static void cn30xxpow_init(struct cn30xxpow_softc *);
-static void cn30xxpow_init_regs(struct cn30xxpow_softc *);
-static int cn30xxpow_tag_sw_poll(void);
-static void cn30xxpow_tag_sw_wait(void);
-static void cn30xxpow_config_int_pc(struct cn30xxpow_softc *, int);
-static void cn30xxpow_config_int(struct cn30xxpow_softc *, int,
- uint64_t, uint64_t, uint64_t);
-static void cn30xxpow_intr_work(struct cn30xxpow_softc *,
- struct cn30xxpow_intr_handle *, int);
-static int cn30xxpow_intr(void *);
+void cn30xxpow_init(struct cn30xxpow_softc *);
+void cn30xxpow_init_regs(struct cn30xxpow_softc *);
+int cn30xxpow_tag_sw_poll(void);
+void cn30xxpow_tag_sw_wait(void);
+void cn30xxpow_config_int_pc(struct cn30xxpow_softc *, int);
+void cn30xxpow_config_int(struct cn30xxpow_softc *, int,
+ uint64_t, uint64_t, uint64_t);
+void cn30xxpow_intr_work(struct cn30xxpow_softc *,
+ struct cn30xxpow_intr_handle *, int);
+int cn30xxpow_intr(void *);
#ifdef OCTEON_ETH_DEBUG
-void cn30xxpow_dump(void);
+void cn30xxpow_dump(void);
#endif
/* XXX */
*/
/* return 1 if pending bit is clear (ready) */
-static int
+int
cn30xxpow_tag_sw_poll(void)
{
uint64_t result;
return (int)result;
}
-static void
+void
cn30xxpow_tag_sw_wait(void)
{
}
-static void
+void
cn30xxpow_config_int(struct cn30xxpow_softc *sc, int group,
uint64_t tc_thr, uint64_t ds_thr, uint64_t iq_thr)
{
#define _NAMELEN 8
#define _DESCRLEN 40
-static void
+void
cn30xxpow_intr_debug_init(struct cn30xxpow_intr_handle *pow_ih, int group)
{
pow_ih->pi_first = 1;
/* ---- interrupt handling */
#ifdef OCTEON_ETH_DEBUG
-static void
+void
cn30xxpow_intr_work_debug_ival(struct cn30xxpow_softc *sc,
struct cn30xxpow_intr_handle *pow_ih)
{
pow_ih->pi_last = now; /* struct copy */
}
-static void
+void
cn30xxpow_intr_work_debug_per(struct cn30xxpow_softc *sc,
struct cn30xxpow_intr_handle *pow_ih, int count)
{
*/
#define MAX_RX_CNT 0x7fffffff
-static void
+void
cn30xxpow_intr_work(struct cn30xxpow_softc *sc,
struct cn30xxpow_intr_handle *pow_ih, int max_recv_cnt)
{
/* splx(s); */
}
-static int
+int
cn30xxpow_intr(void *data)
{
struct cn30xxpow_intr_handle *pow_ih = data;
-/* $OpenBSD: if_cnmac.c,v 1.15 2014/07/22 10:35:35 mpi Exp $ */
+/* $OpenBSD: if_cnmac.c,v 1.16 2014/08/11 18:08:17 miod Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
#define OCTEON_ETH_TAP(ifp, m, dir)
#endif /* NBPFILTER > 0 */
-static void octeon_eth_buf_init(struct octeon_eth_softc *);
-
-static int octeon_eth_match(struct device *, void *, void *);
-static void octeon_eth_attach(struct device *, struct device *, 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 void octeon_eth_board_mac_addr(uint8_t *);
-
-static int octeon_eth_mii_readreg(struct device *, int, int);
-static void octeon_eth_mii_writereg(struct device *, int, int, int);
-static void octeon_eth_mii_statchg(struct device *);
-
-static int octeon_eth_mediainit(struct octeon_eth_softc *);
-static void octeon_eth_mediastatus(struct ifnet *, struct ifmediareq *);
-static int octeon_eth_mediachange(struct ifnet *);
-
-static void octeon_eth_send_queue_flush_prefetch(struct octeon_eth_softc *);
-static void octeon_eth_send_queue_flush_fetch(struct octeon_eth_softc *);
-static void octeon_eth_send_queue_flush(struct octeon_eth_softc *);
-static void octeon_eth_send_queue_flush_sync(struct octeon_eth_softc *);
-static int octeon_eth_send_queue_is_full(struct octeon_eth_softc *);
-static void octeon_eth_send_queue_add(struct octeon_eth_softc *,
- struct mbuf *, uint64_t *);
-static void octeon_eth_send_queue_del(struct octeon_eth_softc *,
- struct mbuf **, uint64_t **);
-static int octeon_eth_buf_free_work(struct octeon_eth_softc *,
- uint64_t *, uint64_t);
-static void octeon_eth_buf_ext_free_m(caddr_t, u_int, void *);
-static void octeon_eth_buf_ext_free_ext(caddr_t, u_int, void *);
-
-static int octeon_eth_ioctl(struct ifnet *, u_long, caddr_t);
-static void octeon_eth_watchdog(struct ifnet *);
-static int octeon_eth_init(struct ifnet *);
-static int octeon_eth_stop(struct ifnet *, int);
-static void octeon_eth_start(struct ifnet *);
-
-static int octeon_eth_send_cmd(struct octeon_eth_softc *, uint64_t,
- uint64_t);
-static uint64_t octeon_eth_send_makecmd_w1(int, paddr_t);
-static uint64_t octeon_eth_send_makecmd_w0(uint64_t, uint64_t, size_t,
- int);
-static int octeon_eth_send_makecmd_gbuf(struct octeon_eth_softc *,
- struct mbuf *, uint64_t *, int *);
-static int octeon_eth_send_makecmd(struct octeon_eth_softc *,
- struct mbuf *, uint64_t *, uint64_t *, uint64_t *);
-static int octeon_eth_send_buf(struct octeon_eth_softc *,
- struct mbuf *, uint64_t *);
-static int octeon_eth_send(struct octeon_eth_softc *,
- struct mbuf *);
-
-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 *arg);
-static void octeon_eth_tick_misc(void *);
-
-static int octeon_eth_recv_mbuf(struct octeon_eth_softc *,
- uint64_t *, struct mbuf **);
-static int octeon_eth_recv_check_code(struct octeon_eth_softc *,
- uint64_t);
+void octeon_eth_buf_init(struct octeon_eth_softc *);
+
+int octeon_eth_match(struct device *, void *, void *);
+void octeon_eth_attach(struct device *, struct device *, void *);
+void octeon_eth_pip_init(struct octeon_eth_softc *);
+void octeon_eth_ipd_init(struct octeon_eth_softc *);
+void octeon_eth_pko_init(struct octeon_eth_softc *);
+void octeon_eth_asx_init(struct octeon_eth_softc *);
+void octeon_eth_smi_init(struct octeon_eth_softc *);
+
+void octeon_eth_board_mac_addr(uint8_t *);
+
+int octeon_eth_mii_readreg(struct device *, int, int);
+void octeon_eth_mii_writereg(struct device *, int, int, int);
+void octeon_eth_mii_statchg(struct device *);
+
+int octeon_eth_mediainit(struct octeon_eth_softc *);
+void octeon_eth_mediastatus(struct ifnet *, struct ifmediareq *);
+int octeon_eth_mediachange(struct ifnet *);
+
+void octeon_eth_send_queue_flush_prefetch(struct octeon_eth_softc *);
+void octeon_eth_send_queue_flush_fetch(struct octeon_eth_softc *);
+void octeon_eth_send_queue_flush(struct octeon_eth_softc *);
+void octeon_eth_send_queue_flush_sync(struct octeon_eth_softc *);
+int octeon_eth_send_queue_is_full(struct octeon_eth_softc *);
+void octeon_eth_send_queue_add(struct octeon_eth_softc *,
+ struct mbuf *, uint64_t *);
+void octeon_eth_send_queue_del(struct octeon_eth_softc *,
+ struct mbuf **, uint64_t **);
+int octeon_eth_buf_free_work(struct octeon_eth_softc *,
+ uint64_t *, uint64_t);
+void octeon_eth_buf_ext_free_m(caddr_t, u_int, void *);
+void octeon_eth_buf_ext_free_ext(caddr_t, u_int, void *);
+
+int octeon_eth_ioctl(struct ifnet *, u_long, caddr_t);
+void octeon_eth_watchdog(struct ifnet *);
+int octeon_eth_init(struct ifnet *);
+int octeon_eth_stop(struct ifnet *, int);
+void octeon_eth_start(struct ifnet *);
+
+int octeon_eth_send_cmd(struct octeon_eth_softc *, uint64_t, uint64_t);
+uint64_t octeon_eth_send_makecmd_w1(int, paddr_t);
+uint64_t octeon_eth_send_makecmd_w0(uint64_t, uint64_t, size_t, int);
+int octeon_eth_send_makecmd_gbuf(struct octeon_eth_softc *,
+ struct mbuf *, uint64_t *, int *);
+int octeon_eth_send_makecmd(struct octeon_eth_softc *,
+ struct mbuf *, uint64_t *, uint64_t *, uint64_t *);
+int octeon_eth_send_buf(struct octeon_eth_softc *,
+ struct mbuf *, uint64_t *);
+int octeon_eth_send(struct octeon_eth_softc *, struct mbuf *);
+
+int octeon_eth_reset(struct octeon_eth_softc *);
+int octeon_eth_configure(struct octeon_eth_softc *);
+int octeon_eth_configure_common(struct octeon_eth_softc *);
+
+void octeon_eth_tick_free(void *arg);
+void octeon_eth_tick_misc(void *);
+
+int octeon_eth_recv_mbuf(struct octeon_eth_softc *,
+ uint64_t *, struct mbuf **);
+int octeon_eth_recv_check_code(struct octeon_eth_softc *, uint64_t);
#if 0 /* not used */
-static int octeon_eth_recv_check_jumbo(struct octeon_eth_softc *,
- uint64_t);
+int octeon_eth_recv_check_jumbo(struct octeon_eth_softc *, uint64_t);
#endif
-static int octeon_eth_recv_check_link(struct octeon_eth_softc *,
- uint64_t);
-static int octeon_eth_recv_check(struct octeon_eth_softc *,
- uint64_t);
-static int octeon_eth_recv(struct octeon_eth_softc *, uint64_t *);
-static void octeon_eth_recv_intr(void *, uint64_t *);
+int octeon_eth_recv_check_link(struct octeon_eth_softc *, uint64_t);
+int octeon_eth_recv_check(struct octeon_eth_softc *, uint64_t);
+int octeon_eth_recv(struct octeon_eth_softc *, uint64_t *);
+void octeon_eth_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;
+struct octeon_eth_softc *octeon_eth_gsc[GMX_PORT_NUNITS];
+void *octeon_eth_pow_recv_ih;
/* sysctl'able parameters */
int octeon_eth_param_pko_cmd_w0_n2 = 1;
/* ---- buffer management */
-static const struct octeon_eth_pool_param {
+const struct octeon_eth_pool_param {
int poolno;
size_t size;
size_t nelems;
uint64_t octeon_eth_mac_addr = 0;
uint32_t octeon_eth_mac_addr_offset = 0;
-static void
+void
octeon_eth_buf_init(struct octeon_eth_softc *sc)
{
static int once;
/* ---- autoconf */
-static int
+int
octeon_eth_match(struct device *parent, void *match, void *aux)
{
struct cfdata *cf = (struct cfdata *)match;
return 1;
}
-static void
+void
octeon_eth_attach(struct device *parent, struct device *self, void *aux)
{
struct octeon_eth_softc *sc = (void *)self;
/* ---- submodules */
/* XXX */
-static void
+void
octeon_eth_pip_init(struct octeon_eth_softc *sc)
{
struct cn30xxpip_attach_args pip_aa;
}
/* XXX */
-static void
+void
octeon_eth_ipd_init(struct octeon_eth_softc *sc)
{
struct cn30xxipd_attach_args ipd_aa;
}
/* XXX */
-static void
+void
octeon_eth_pko_init(struct octeon_eth_softc *sc)
{
struct cn30xxpko_attach_args pko_aa;
}
/* XXX */
-static void
+void
octeon_eth_asx_init(struct octeon_eth_softc *sc)
{
struct cn30xxasx_attach_args asx_aa;
cn30xxasx_init(&asx_aa, &sc->sc_asx);
}
-static void
+void
octeon_eth_smi_init(struct octeon_eth_softc *sc)
{
struct cn30xxsmi_attach_args smi_aa;
/* ---- XXX */
-static void
+void
octeon_eth_board_mac_addr(uint8_t *enaddr)
{
extern struct boot_info *octeon_boot_info;
/* ---- media */
-static int
+int
octeon_eth_mii_readreg(struct device *self, int phy_no, int reg)
{
struct octeon_eth_softc *sc = (struct octeon_eth_softc *)self;
return cn30xxsmi_read(sc->sc_smi, phy_no, reg);
}
-static void
+void
octeon_eth_mii_writereg(struct device *self, int phy_no, int reg, int value)
{
struct octeon_eth_softc *sc = (struct octeon_eth_softc *)self;
cn30xxsmi_write(sc->sc_smi, phy_no, reg, value);
}
-static void
+void
octeon_eth_mii_statchg(struct device *self)
{
struct octeon_eth_softc *sc = (struct octeon_eth_softc *)self;
cn30xxgmx_port_enable(sc->sc_gmx_port, 1);
}
-static int
+int
octeon_eth_mediainit(struct octeon_eth_softc *sc)
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
return 0;
}
-static void
+void
octeon_eth_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
{
struct octeon_eth_softc *sc = ifp->if_softc;
sc->sc_gmx_port->sc_port_flowflags;
}
-static int
+int
octeon_eth_mediachange(struct ifnet *ifp)
{
struct octeon_eth_softc *sc = ifp->if_softc;
/* ---- send buffer garbage collection */
-static void
+void
octeon_eth_send_queue_flush_prefetch(struct octeon_eth_softc *sc)
{
OCTEON_ETH_KASSERT(sc->sc_prefetch == 0);
sc->sc_prefetch = 1;
}
-static void
+void
octeon_eth_send_queue_flush_fetch(struct octeon_eth_softc *sc)
{
#ifndef OCTEON_ETH_DEBUG
sc->sc_prefetch = 0;
}
-static void
+void
octeon_eth_send_queue_flush(struct octeon_eth_softc *sc)
{
const int64_t sent_count = sc->sc_hard_done_cnt;
sc->sc_flush = i;
}
-static void
+void
octeon_eth_send_queue_flush_sync(struct octeon_eth_softc *sc)
{
if (sc->sc_flush == 0)
sc->sc_flush = 0;
}
-static int
+int
octeon_eth_send_queue_is_full(struct octeon_eth_softc *sc)
{
#ifdef OCTEON_ETH_SEND_QUEUE_CHECK
#define _sqe_gbuf _sqe_u._sqe_s_gbuf._sqe_s_gbuf_gbuf
};
-static void
+void
octeon_eth_send_queue_add(struct octeon_eth_softc *sc, struct mbuf *m,
uint64_t *gbuf)
{
OCTEON_EVCNT_INC(sc, txadd);
}
-static void
+void
octeon_eth_send_queue_del(struct octeon_eth_softc *sc, struct mbuf **rm,
uint64_t **rgbuf)
{
OCTEON_EVCNT_INC(sc, txdel);
}
-static int
+int
octeon_eth_buf_free_work(struct octeon_eth_softc *sc, uint64_t *work,
uint64_t word2)
{
return 0;
}
-static void
+void
octeon_eth_buf_ext_free_m(caddr_t buf, u_int size, void *arg)
{
uint64_t *work = (void *)arg;
splx(s);
}
-static void
+void
octeon_eth_buf_ext_free_ext(caddr_t buf, u_int size,
void *arg)
{
/* ---- ifnet interfaces */
-static int
+int
octeon_eth_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct octeon_eth_softc *sc = ifp->if_softc;
/* ---- send (output) */
-static uint64_t
+uint64_t
octeon_eth_send_makecmd_w0(uint64_t fau0, uint64_t fau1, size_t len, int segs)
{
return cn30xxpko_cmd_word0(
segs, (int)len); /* segs, totalbytes */
}
-static uint64_t
+uint64_t
octeon_eth_send_makecmd_w1(int size, paddr_t addr)
{
return cn30xxpko_cmd_word1(
panic("if_cnmac_kvtophys");
}
-static int
+int
octeon_eth_send_makecmd_gbuf(struct octeon_eth_softc *sc, struct mbuf *m0,
uint64_t *gbuf, int *rsegs)
{
return 0;
}
-static int
+int
octeon_eth_send_makecmd(struct octeon_eth_softc *sc, struct mbuf *m,
uint64_t *gbuf, uint64_t *rpko_cmd_w0, uint64_t *rpko_cmd_w1)
{
return result;
}
-static int
+int
octeon_eth_send_cmd(struct octeon_eth_softc *sc, uint64_t pko_cmd_w0,
uint64_t pko_cmd_w1)
{
return result;
}
-static int
+int
octeon_eth_send_buf(struct octeon_eth_softc *sc, struct mbuf *m,
uint64_t *gbuf)
{
return result;
}
-static int
+int
octeon_eth_send(struct octeon_eth_softc *sc, struct mbuf *m)
{
paddr_t gaddr = 0;
return result;
}
-static void
+void
octeon_eth_start(struct ifnet *ifp)
{
struct octeon_eth_softc *sc = ifp->if_softc;
octeon_eth_send_queue_flush_fetch(sc);
}
-static void
+void
octeon_eth_watchdog(struct ifnet *ifp)
{
struct octeon_eth_softc *sc = ifp->if_softc;
octeon_eth_start(ifp);
}
-static int
+int
octeon_eth_init(struct ifnet *ifp)
{
struct octeon_eth_softc *sc = ifp->if_softc;
return 0;
}
-static int
+int
octeon_eth_stop(struct ifnet *ifp, int disable)
{
struct octeon_eth_softc *sc = ifp->if_softc;
#define PKO_INDEX_MASK ((1ULL << 12/* XXX */) - 1)
-static int
+int
octeon_eth_reset(struct octeon_eth_softc *sc)
{
cn30xxgmx_reset_speed(sc->sc_gmx_port);
return 0;
}
-static int
+int
octeon_eth_configure(struct octeon_eth_softc *sc)
{
cn30xxgmx_port_enable(sc->sc_gmx_port, 0);
return 0;
}
-static int
+int
octeon_eth_configure_common(struct octeon_eth_softc *sc)
{
static int once;
return 0;
}
-static int
+int
octeon_eth_recv_mbuf(struct octeon_eth_softc *sc, uint64_t *work,
struct mbuf **rm)
{
return 0;
}
-static int
+int
octeon_eth_recv_check_code(struct octeon_eth_softc *sc, uint64_t word2)
{
uint64_t opecode = word2 & PIP_WQE_WORD2_NOIP_OPECODE;
}
#if 0 /* not used */
-static int
+int
octeon_eth_recv_check_jumbo(struct octeon_eth_softc *sc, uint64_t word2)
{
if (__predict_false((word2 & PIP_WQE_WORD2_IP_BUFS) > (1ULL << 56)))
}
#endif
-static int
+int
octeon_eth_recv_check_link(struct octeon_eth_softc *sc, uint64_t word2)
{
if (__predict_false(!cn30xxgmx_link_status(sc->sc_gmx_port)))
return 0;
}
-static int
+int
octeon_eth_recv_check(struct octeon_eth_softc *sc, uint64_t word2)
{
if (__predict_false(octeon_eth_recv_check_link(sc, word2)) != 0) {
return 0;
}
-static int
+int
octeon_eth_recv(struct octeon_eth_softc *sc, uint64_t *work)
{
int result = 0;
return result;
}
-static void
+void
octeon_eth_recv_intr(void *data, uint64_t *work)
{
struct octeon_eth_softc *sc;
* => garbage collect send gather buffer / mbuf
* => called at softclock
*/
-static void
+void
octeon_eth_tick_free(void *arg)
{
struct octeon_eth_softc *sc = arg;
* => check link status
* => called at softclock
*/
-static void
+void
octeon_eth_tick_misc(void *arg)
{
struct octeon_eth_softc *sc = arg;