Index: head/sys/dev/sfxge/common/efx_phy.c =================================================================== --- head/sys/dev/sfxge/common/efx_phy.c +++ head/sys/dev/sfxge/common/efx_phy.c @@ -265,33 +265,34 @@ }; #endif /* EFSYS_OPT_SIENA */ -#if EFSYS_OPT_HUNTINGTON -static efx_phy_ops_t __efx_phy_hunt_ops = { - hunt_phy_power, /* epo_power */ +#if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD +static efx_phy_ops_t __efx_phy_ef10_ops = { + ef10_phy_power, /* epo_power */ NULL, /* epo_reset */ - hunt_phy_reconfigure, /* epo_reconfigure */ - hunt_phy_verify, /* epo_verify */ + ef10_phy_reconfigure, /* epo_reconfigure */ + ef10_phy_verify, /* epo_verify */ NULL, /* epo_uplink_check */ NULL, /* epo_downlink_check */ - hunt_phy_oui_get, /* epo_oui_get */ + ef10_phy_oui_get, /* epo_oui_get */ #if EFSYS_OPT_PHY_STATS - hunt_phy_stats_update, /* epo_stats_update */ + ef10_phy_stats_update, /* epo_stats_update */ #endif /* EFSYS_OPT_PHY_STATS */ #if EFSYS_OPT_PHY_PROPS #if EFSYS_OPT_NAMES - hunt_phy_prop_name, /* epo_prop_name */ + ef10_phy_prop_name, /* epo_prop_name */ #endif - hunt_phy_prop_get, /* epo_prop_get */ - hunt_phy_prop_set, /* epo_prop_set */ + ef10_phy_prop_get, /* epo_prop_get */ + ef10_phy_prop_set, /* epo_prop_set */ #endif /* EFSYS_OPT_PHY_PROPS */ #if EFSYS_OPT_BIST + /* FIXME: Are these BIST methods appropriate for Medford? */ hunt_bist_enable_offline, /* epo_bist_enable_offline */ hunt_bist_start, /* epo_bist_start */ hunt_bist_poll, /* epo_bist_poll */ hunt_bist_stop, /* epo_bist_stop */ #endif /* EFSYS_OPT_BIST */ }; -#endif /* EFSYS_OPT_HUNTINGTON */ +#endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ __checkReturn efx_rc_t efx_phy_probe( @@ -356,9 +357,14 @@ #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - epop = (efx_phy_ops_t *)&__efx_phy_hunt_ops; + epop = (efx_phy_ops_t *)&__efx_phy_ef10_ops; break; #endif /* EFSYS_OPT_HUNTINGTON */ +#if EFSYS_OPT_MEDFORD + case EFX_FAMILY_MEDFORD: + epop = (efx_phy_ops_t *)&__efx_phy_ef10_ops; + break; +#endif /* EFSYS_OPT_MEDFORD */ default: rc = ENOTSUP; goto fail1; Index: head/sys/dev/sfxge/common/hunt_ev.c =================================================================== --- head/sys/dev/sfxge/common/hunt_ev.c +++ head/sys/dev/sfxge/common/hunt_ev.c @@ -835,7 +835,7 @@ case MCDI_EVENT_CODE_LINKCHANGE: { efx_link_mode_t link_mode; - hunt_phy_link_ev(enp, eqp, &link_mode); + ef10_phy_link_ev(enp, eqp, &link_mode); should_abort = eecp->eec_link_change(arg, link_mode); break; } Index: head/sys/dev/sfxge/common/hunt_impl.h =================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h +++ head/sys/dev/sfxge/common/hunt_impl.h @@ -489,38 +489,38 @@ } ef10_link_state_t; extern void -hunt_phy_link_ev( +ef10_phy_link_ev( __in efx_nic_t *enp, __in efx_qword_t *eqp, __out efx_link_mode_t *link_modep); extern __checkReturn efx_rc_t -hunt_phy_get_link( +ef10_phy_get_link( __in efx_nic_t *enp, __out ef10_link_state_t *elsp); extern __checkReturn efx_rc_t -hunt_phy_power( +ef10_phy_power( __in efx_nic_t *enp, __in boolean_t on); extern __checkReturn efx_rc_t -hunt_phy_reconfigure( +ef10_phy_reconfigure( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_phy_verify( +ef10_phy_verify( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_phy_oui_get( +ef10_phy_oui_get( __in efx_nic_t *enp, __out uint32_t *ouip); #if EFSYS_OPT_PHY_STATS extern __checkReturn efx_rc_t -hunt_phy_stats_update( +ef10_phy_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat); @@ -532,21 +532,21 @@ #if EFSYS_OPT_NAMES extern const char * -hunt_phy_prop_name( +ef10_phy_prop_name( __in efx_nic_t *enp, __in unsigned int id); #endif /* EFSYS_OPT_NAMES */ extern __checkReturn efx_rc_t -hunt_phy_prop_get( +ef10_phy_prop_get( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t flags, __out uint32_t *valp); extern __checkReturn efx_rc_t -hunt_phy_prop_set( +ef10_phy_prop_set( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t val); Index: head/sys/dev/sfxge/common/hunt_mac.c =================================================================== --- head/sys/dev/sfxge/common/hunt_mac.c +++ head/sys/dev/sfxge/common/hunt_mac.c @@ -51,7 +51,7 @@ ef10_link_state_t els; efx_rc_t rc; - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; epp->ep_adv_cap_mask = els.els_adv_cap_mask; @@ -86,7 +86,7 @@ * Because Huntington doesn't *require* polling, we can't rely on * hunt_mac_poll() being executed to populate epp->ep_mac_up. */ - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail1; *mac_upp = els.els_mac_up; Index: head/sys/dev/sfxge/common/hunt_nic.c =================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c +++ head/sys/dev/sfxge/common/hunt_nic.c @@ -1190,7 +1190,7 @@ goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail7; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask; Index: head/sys/dev/sfxge/common/hunt_phy.c =================================================================== --- head/sys/dev/sfxge/common/hunt_phy.c +++ head/sys/dev/sfxge/common/hunt_phy.c @@ -37,15 +37,10 @@ #if EFSYS_OPT_HUNTINGTON static void -hunt_phy_decode_cap( +mcdi_phy_decode_cap( __in uint32_t mcdi_cap, __out uint32_t *maskp) { - /* - * TBD: consider common Siena/Hunt function: Hunt is a superset of - * Siena here (adds 40G) - */ - uint32_t mask; mask = 0; @@ -76,7 +71,7 @@ } static void -hunt_phy_decode_link_mode( +mcdi_phy_decode_link_mode( __in efx_nic_t *enp, __in uint32_t link_flags, __in unsigned int speed, @@ -84,11 +79,6 @@ __out efx_link_mode_t *link_modep, __out unsigned int *fcntlp) { - /* - * TBD: consider common Siena/Hunt function: Hunt is a superset of - * Siena here (adds 40G and generate-only flow control) - */ - boolean_t fd = !!(link_flags & (1 << MC_CMD_GET_LINK_OUT_FULL_DUPLEX_LBN)); boolean_t up = !!(link_flags & @@ -127,16 +117,11 @@ void -hunt_phy_link_ev( +ef10_phy_link_ev( __in efx_nic_t *enp, __in efx_qword_t *eqp, __out efx_link_mode_t *link_modep) { - /* - * TBD: consider common Siena/Hunt function: Hunt is a superset of - * Siena here (adds 40G) - */ - efx_port_t *epp = &(enp->en_port); unsigned int link_flags; unsigned int speed; @@ -167,10 +152,10 @@ } link_flags = MCDI_EV_FIELD(eqp, LINKCHANGE_LINK_FLAGS); - hunt_phy_decode_link_mode(enp, link_flags, speed, + mcdi_phy_decode_link_mode(enp, link_flags, speed, MCDI_EV_FIELD(eqp, LINKCHANGE_FCNTL), &link_mode, &fcntl); - hunt_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), + mcdi_phy_decode_cap(MCDI_EV_FIELD(eqp, LINKCHANGE_LP_CAP), &lp_cap_mask); /* @@ -191,19 +176,17 @@ } __checkReturn efx_rc_t -hunt_phy_power( +ef10_phy_power( __in efx_nic_t *enp, __in boolean_t power) { - /* TBD: consider common Siena/Hunt function: essentially identical */ - efx_rc_t rc; if (!power) return (0); /* Check if the PHY is a zombie */ - if ((rc = hunt_phy_verify(enp)) != 0) + if ((rc = ef10_phy_verify(enp)) != 0) goto fail1; enp->en_reset_flags |= EFX_RESET_PHY; @@ -217,16 +200,10 @@ } __checkReturn efx_rc_t -hunt_phy_get_link( +ef10_phy_get_link( __in efx_nic_t *enp, __out ef10_link_state_t *elsp) { - /* - * TBD: consider common Siena/Hunt function: Hunt is very similar - * (at least for now; not clear that the loopbacks should necessarily - * be quite the same...) - */ - efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN, MC_CMD_GET_LINK_OUT_LEN)]; @@ -251,12 +228,12 @@ goto fail2; } - hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), + mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_CAP), &elsp->els_adv_cap_mask); - hunt_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), + mcdi_phy_decode_cap(MCDI_OUT_DWORD(req, GET_LINK_OUT_LP_CAP), &elsp->els_lp_cap_mask); - hunt_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), + mcdi_phy_decode_link_mode(enp, MCDI_OUT_DWORD(req, GET_LINK_OUT_FLAGS), MCDI_OUT_DWORD(req, GET_LINK_OUT_LINK_SPEED), MCDI_OUT_DWORD(req, GET_LINK_OUT_FCNTL), &elsp->els_link_mode, &elsp->els_fcntl); @@ -298,15 +275,9 @@ } __checkReturn efx_rc_t -hunt_phy_reconfigure( +ef10_phy_reconfigure( __in efx_nic_t *enp) { - /* - * TBD: this is a little different for now (no LED support for Hunt - * yet), but ultimately should consider common Siena/Hunt function: - * Hunt should be a superset of Siena here (adds 40G) - */ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; @@ -428,11 +399,9 @@ } __checkReturn efx_rc_t -hunt_phy_verify( +ef10_phy_verify( __in efx_nic_t *enp) { - /* TBD: consider common Siena/Hunt function: essentially identical */ - efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN, MC_CMD_GET_PHY_STATE_OUT_LEN)]; @@ -479,7 +448,7 @@ } __checkReturn efx_rc_t -hunt_phy_oui_get( +ef10_phy_oui_get( __in efx_nic_t *enp, __out uint32_t *ouip) { @@ -491,7 +460,7 @@ #if EFSYS_OPT_PHY_STATS __checkReturn efx_rc_t -hunt_phy_stats_update( +ef10_phy_stats_update( __in efx_nic_t *enp, __in efsys_mem_t *esmp, __inout_ecount(EFX_PHY_NSTATS) uint32_t *stat) @@ -509,8 +478,8 @@ #if EFSYS_OPT_NAMES -extern const char * -hunt_phy_prop_name( + const char * +ef10_phy_prop_name( __in efx_nic_t *enp, __in unsigned int id) { @@ -521,8 +490,8 @@ #endif /* EFSYS_OPT_NAMES */ -extern __checkReturn efx_rc_t -hunt_phy_prop_get( + __checkReturn efx_rc_t +ef10_phy_prop_get( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t flags, @@ -533,8 +502,8 @@ return (ENOTSUP); } -extern __checkReturn efx_rc_t -hunt_phy_prop_set( + __checkReturn efx_rc_t +ef10_phy_prop_set( __in efx_nic_t *enp, __in unsigned int id, __in uint32_t val) Index: head/sys/dev/sfxge/common/medford_nic.c =================================================================== --- head/sys/dev/sfxge/common/medford_nic.c +++ head/sys/dev/sfxge/common/medford_nic.c @@ -126,7 +126,7 @@ goto fail6; /* Obtain the default PHY advertised capabilities */ - if ((rc = hunt_phy_get_link(enp, &els)) != 0) + if ((rc = ef10_phy_get_link(enp, &els)) != 0) goto fail7; epp->ep_default_adv_cap_mask = els.els_adv_cap_mask; epp->ep_adv_cap_mask = els.els_adv_cap_mask;