-/* $OpenBSD: if_cnmac.c,v 1.55 2016/08/04 13:10:31 visa Exp $ */
+/* $OpenBSD: if_cnmac.c,v 1.56 2016/08/05 13:18:27 visa Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
int octeon_eth_recv_mbuf(struct octeon_eth_softc *,
uint64_t *, struct mbuf **, int *);
int octeon_eth_recv_check_code(struct octeon_eth_softc *, 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 *);
ether_ifattach(ifp);
/* XXX */
- sc->sc_rate_recv_check_link_cap.tv_sec = 1;
sc->sc_rate_recv_check_code_cap.tv_sec = 1;
#if 1
return 1;
}
-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 1;
- return 0;
-}
-
int
octeon_eth_recv_check(struct octeon_eth_softc *sc, uint64_t word2)
{
- if (__predict_false(octeon_eth_recv_check_link(sc, word2)) != 0) {
- if (ratecheck(&sc->sc_rate_recv_check_link_last,
- &sc->sc_rate_recv_check_link_cap))
- log(LOG_DEBUG,
- "%s: link is not up, the packet was dropped\n",
- sc->sc_dev.dv_xname);
- return 1;
- }
-
if (__predict_false(octeon_eth_recv_check_code(sc, word2)) != 0) {
if ((word2 & PIP_WQE_WORD2_NOIP_OPECODE) == PIP_WQE_WORD2_RE_OPCODE_LENGTH) {
/* no logging */
-/* $OpenBSD: if_cnmacvar.h,v 1.14 2016/08/04 13:10:31 visa Exp $ */
+/* $OpenBSD: if_cnmacvar.h,v 1.15 2016/08/05 13:18:27 visa Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
size_t sc_ip_offset;
- struct timeval sc_rate_recv_check_link_last;
- struct timeval sc_rate_recv_check_link_cap;
struct timeval sc_rate_recv_check_code_last;
struct timeval sc_rate_recv_check_code_cap;
};