Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/sfxge/common/efx_port.c
Show All 33 Lines | |||||
#include "efx.h" | #include "efx.h" | ||||
#include "efx_impl.h" | #include "efx_impl.h" | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_port_init( | efx_port_init( | ||||
__in efx_nic_t *enp) | __in efx_nic_t *enp) | ||||
{ | { | ||||
efx_port_t *epp = &(enp->en_port); | efx_port_t *epp = &(enp->en_port); | ||||
efx_phy_ops_t *epop = epp->ep_epop; | const efx_phy_ops_t *epop = epp->ep_epop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); | ||||
if (enp->en_mod_flags & EFX_MOD_PORT) { | if (enp->en_mod_flags & EFX_MOD_PORT) { | ||||
rc = EINVAL; | rc = EINVAL; | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_port_poll( | efx_port_poll( | ||||
__in efx_nic_t *enp, | __in efx_nic_t *enp, | ||||
__out_opt efx_link_mode_t *link_modep) | __out_opt efx_link_mode_t *link_modep) | ||||
{ | { | ||||
efx_port_t *epp = &(enp->en_port); | efx_port_t *epp = &(enp->en_port); | ||||
efx_mac_ops_t *emop = epp->ep_emop; | const efx_mac_ops_t *emop = epp->ep_emop; | ||||
efx_link_mode_t ignore_link_mode; | efx_link_mode_t ignore_link_mode; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); | ||||
EFSYS_ASSERT(emop != NULL); | EFSYS_ASSERT(emop != NULL); | ||||
EFSYS_ASSERT(!epp->ep_mac_stats_pending); | EFSYS_ASSERT(!epp->ep_mac_stats_pending); | ||||
Show All 17 Lines | #if EFSYS_OPT_LOOPBACK | ||||
__checkReturn efx_rc_t | __checkReturn efx_rc_t | ||||
efx_port_loopback_set( | efx_port_loopback_set( | ||||
__in efx_nic_t *enp, | __in efx_nic_t *enp, | ||||
__in efx_link_mode_t link_mode, | __in efx_link_mode_t link_mode, | ||||
__in efx_loopback_type_t loopback_type) | __in efx_loopback_type_t loopback_type) | ||||
{ | { | ||||
efx_port_t *epp = &(enp->en_port); | efx_port_t *epp = &(enp->en_port); | ||||
efx_nic_cfg_t *encp = &(enp->en_nic_cfg); | efx_nic_cfg_t *encp = &(enp->en_nic_cfg); | ||||
efx_mac_ops_t *emop = epp->ep_emop; | const efx_mac_ops_t *emop = epp->ep_emop; | ||||
efx_rc_t rc; | efx_rc_t rc; | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); | ||||
EFSYS_ASSERT(emop != NULL); | EFSYS_ASSERT(emop != NULL); | ||||
EFSYS_ASSERT(link_mode < EFX_LINK_NMODES); | EFSYS_ASSERT(link_mode < EFX_LINK_NMODES); | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | |||||
#endif /* EFSYS_OPT_LOOPBACK */ | #endif /* EFSYS_OPT_LOOPBACK */ | ||||
void | void | ||||
efx_port_fini( | efx_port_fini( | ||||
__in efx_nic_t *enp) | __in efx_nic_t *enp) | ||||
{ | { | ||||
efx_port_t *epp = &(enp->en_port); | efx_port_t *epp = &(enp->en_port); | ||||
efx_phy_ops_t *epop = epp->ep_epop; | const efx_phy_ops_t *epop = epp->ep_epop; | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC); | ||||
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); | EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); | ||||
EFSYS_ASSERT(epp->ep_mac_drain); | EFSYS_ASSERT(epp->ep_mac_drain); | ||||
Show All 10 Lines |