Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/sfxge/common/efx_phy.c
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
/*- | /*- | ||||
* Copyright 2007-2009 Solarflare Communications Inc. All rights reserved. | * Copyright (c) 2007-2015 Solarflare Communications Inc. | ||||
* All rights reserved. | |||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions are met: | ||||
* are met: | |||||
* 1. Redistributions of source code must retain the above copyright | |||||
* notice, this list of conditions and the following disclaimer. | |||||
* 2. Redistributions in binary form must reproduce the above copyright | |||||
* notice, this list of conditions and the following disclaimer in the | |||||
* documentation and/or other materials provided with the distribution. | |||||
* | * | ||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS AND | * 1. Redistributions of source code must retain the above copyright notice, | ||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | * this list of conditions and the following disclaimer. | ||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | * 2. Redistributions in binary form must reproduce the above copyright notice, | ||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | * this list of conditions and the following disclaimer in the documentation | ||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | * and/or other materials provided with the distribution. | ||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | * | ||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||||
* SUCH DAMAGE. | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | |||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
* | |||||
* The views and conclusions contained in the software and documentation are | |||||
* those of the authors and should not be interpreted as representing official | |||||
* policies, either expressed or implied, of the FreeBSD Project. | |||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "efsys.h" | #include "efsys.h" | ||||
#include "efx.h" | #include "efx.h" | ||||
#include "efx_types.h" | #include "efx_types.h" | ||||
Show All 31 Lines | |||||
#include "sft9001.h" | #include "sft9001.h" | ||||
#endif | #endif | ||||
#if EFSYS_OPT_PHY_QT2025C | #if EFSYS_OPT_PHY_QT2025C | ||||
#include "qt2025c.h" | #include "qt2025c.h" | ||||
#endif | #endif | ||||
#if EFSYS_OPT_PHY_NULL | #if EFSYS_OPT_PHY_NULL | ||||
static efx_phy_ops_t __cs __efx_phy_null_ops = { | static efx_phy_ops_t __efx_phy_null_ops = { | ||||
NULL, /* epo_power */ | NULL, /* epo_power */ | ||||
nullphy_reset, /* epo_reset */ | nullphy_reset, /* epo_reset */ | ||||
nullphy_reconfigure, /* epo_reconfigure */ | nullphy_reconfigure, /* epo_reconfigure */ | ||||
nullphy_verify, /* epo_verify */ | nullphy_verify, /* epo_verify */ | ||||
NULL, /* epo_uplink_check */ | NULL, /* epo_uplink_check */ | ||||
nullphy_downlink_check, /* epo_downlink_check */ | nullphy_downlink_check, /* epo_downlink_check */ | ||||
nullphy_oui_get, /* epo_oui_get */ | nullphy_oui_get, /* epo_oui_get */ | ||||
#if EFSYS_OPT_PHY_STATS | #if EFSYS_OPT_PHY_STATS | ||||
nullphy_stats_update, /* epo_stats_update */ | nullphy_stats_update, /* epo_stats_update */ | ||||
#endif /* EFSYS_OPT_PHY_STATS */ | #endif /* EFSYS_OPT_PHY_STATS */ | ||||
#if EFSYS_OPT_PHY_PROPS | #if EFSYS_OPT_PHY_PROPS | ||||
#if EFSYS_OPT_NAMES | #if EFSYS_OPT_NAMES | ||||
nullphy_prop_name, /* epo_prop_name */ | nullphy_prop_name, /* epo_prop_name */ | ||||
#endif | #endif | ||||
nullphy_prop_get, /* epo_prop_get */ | nullphy_prop_get, /* epo_prop_get */ | ||||
nullphy_prop_set, /* epo_prop_set */ | nullphy_prop_set, /* epo_prop_set */ | ||||
#endif /* EFSYS_OPT_PHY_PROPS */ | #endif /* EFSYS_OPT_PHY_PROPS */ | ||||
#if EFSYS_OPT_PHY_BIST | #if EFSYS_OPT_BIST | ||||
NULL, /* epo_bist_enable_offline */ | |||||
NULL, /* epo_bist_start */ | NULL, /* epo_bist_start */ | ||||
NULL, /* epo_bist_poll */ | NULL, /* epo_bist_poll */ | ||||
NULL, /* epo_bist_stop */ | NULL, /* epo_bist_stop */ | ||||
#endif /* EFSYS_OPT_PHY_BIST */ | #endif /* EFSYS_OPT_BIST */ | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_PHY_NULL */ | #endif /* EFSYS_OPT_PHY_NULL */ | ||||
#if EFSYS_OPT_PHY_QT2022C2 | #if EFSYS_OPT_PHY_QT2022C2 | ||||
static efx_phy_ops_t __cs __efx_phy_qt2022c2_ops = { | static efx_phy_ops_t __efx_phy_qt2022c2_ops = { | ||||
NULL, /* epo_power */ | NULL, /* epo_power */ | ||||
qt2022c2_reset, /* epo_reset */ | qt2022c2_reset, /* epo_reset */ | ||||
qt2022c2_reconfigure, /* epo_reconfigure */ | qt2022c2_reconfigure, /* epo_reconfigure */ | ||||
qt2022c2_verify, /* epo_verify */ | qt2022c2_verify, /* epo_verify */ | ||||
qt2022c2_uplink_check, /* epo_uplink_check */ | qt2022c2_uplink_check, /* epo_uplink_check */ | ||||
qt2022c2_downlink_check, /* epo_downlink_check */ | qt2022c2_downlink_check, /* epo_downlink_check */ | ||||
qt2022c2_oui_get, /* epo_oui_get */ | qt2022c2_oui_get, /* epo_oui_get */ | ||||
#if EFSYS_OPT_PHY_STATS | #if EFSYS_OPT_PHY_STATS | ||||
qt2022c2_stats_update, /* epo_stats_update */ | qt2022c2_stats_update, /* epo_stats_update */ | ||||
#endif /* EFSYS_OPT_PHY_STATS */ | #endif /* EFSYS_OPT_PHY_STATS */ | ||||
#if EFSYS_OPT_PHY_PROPS | #if EFSYS_OPT_PHY_PROPS | ||||
#if EFSYS_OPT_NAMES | #if EFSYS_OPT_NAMES | ||||
qt2022c2_prop_name, /* epo_prop_name */ | qt2022c2_prop_name, /* epo_prop_name */ | ||||
#endif | #endif | ||||
qt2022c2_prop_get, /* epo_prop_get */ | qt2022c2_prop_get, /* epo_prop_get */ | ||||
qt2022c2_prop_set, /* epo_prop_set */ | qt2022c2_prop_set, /* epo_prop_set */ | ||||
#endif /* EFSYS_OPT_PHY_PROPS */ | #endif /* EFSYS_OPT_PHY_PROPS */ | ||||
#if EFSYS_OPT_PHY_BIST | #if EFSYS_OPT_BIST | ||||
NULL, /* epo_bist_enable_offline */ | |||||
NULL, /* epo_bist_start */ | NULL, /* epo_bist_start */ | ||||
NULL, /* epo_bist_poll */ | NULL, /* epo_bist_poll */ | ||||
NULL, /* epo_bist_stop */ | NULL, /* epo_bist_stop */ | ||||
#endif /* EFSYS_OPT_PHY_BIST */ | #endif /* EFSYS_OPT_BIST */ | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_PHY_QT2022C2 */ | #endif /* EFSYS_OPT_PHY_QT2022C2 */ | ||||
#if EFSYS_OPT_PHY_SFX7101 | #if EFSYS_OPT_PHY_SFX7101 | ||||
static efx_phy_ops_t __cs __efx_phy_sfx7101_ops = { | static efx_phy_ops_t __efx_phy_sfx7101_ops = { | ||||
sfx7101_power, /* epo_power */ | sfx7101_power, /* epo_power */ | ||||
sfx7101_reset, /* epo_reset */ | sfx7101_reset, /* epo_reset */ | ||||
sfx7101_reconfigure, /* epo_reconfigure */ | sfx7101_reconfigure, /* epo_reconfigure */ | ||||
sfx7101_verify, /* epo_verify */ | sfx7101_verify, /* epo_verify */ | ||||
sfx7101_uplink_check, /* epo_uplink_check */ | sfx7101_uplink_check, /* epo_uplink_check */ | ||||
sfx7101_downlink_check, /* epo_downlink_check */ | sfx7101_downlink_check, /* epo_downlink_check */ | ||||
sfx7101_oui_get, /* epo_oui_get */ | sfx7101_oui_get, /* epo_oui_get */ | ||||
#if EFSYS_OPT_PHY_STATS | #if EFSYS_OPT_PHY_STATS | ||||
sfx7101_stats_update, /* epo_stats_update */ | sfx7101_stats_update, /* epo_stats_update */ | ||||
#endif /* EFSYS_OPT_PHY_STATS */ | #endif /* EFSYS_OPT_PHY_STATS */ | ||||
#if EFSYS_OPT_PHY_PROPS | #if EFSYS_OPT_PHY_PROPS | ||||
#if EFSYS_OPT_NAMES | #if EFSYS_OPT_NAMES | ||||
sfx7101_prop_name, /* epo_prop_name */ | sfx7101_prop_name, /* epo_prop_name */ | ||||
#endif | #endif | ||||
sfx7101_prop_get, /* epo_prop_get */ | sfx7101_prop_get, /* epo_prop_get */ | ||||
sfx7101_prop_set, /* epo_prop_set */ | sfx7101_prop_set, /* epo_prop_set */ | ||||
#endif /* EFSYS_OPT_PHY_PROPS */ | #endif /* EFSYS_OPT_PHY_PROPS */ | ||||
#if EFSYS_OPT_PHY_BIST | #if EFSYS_OPT_BIST | ||||
NULL, /* epo_bist_enable_offline */ | |||||
NULL, /* epo_bist_start */ | NULL, /* epo_bist_start */ | ||||
NULL, /* epo_bist_poll */ | NULL, /* epo_bist_poll */ | ||||
NULL, /* epo_bist_stop */ | NULL, /* epo_bist_stop */ | ||||
#endif /* EFSYS_OPT_PHY_BIST */ | #endif /* EFSYS_OPT_BIST */ | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_PHY_SFX7101 */ | #endif /* EFSYS_OPT_PHY_SFX7101 */ | ||||
#if EFSYS_OPT_PHY_TXC43128 | #if EFSYS_OPT_PHY_TXC43128 | ||||
static efx_phy_ops_t __cs __efx_phy_txc43128_ops = { | static efx_phy_ops_t __efx_phy_txc43128_ops = { | ||||
NULL, /* epo_power */ | NULL, /* epo_power */ | ||||
txc43128_reset, /* epo_reset */ | txc43128_reset, /* epo_reset */ | ||||
txc43128_reconfigure, /* epo_reconfigure */ | txc43128_reconfigure, /* epo_reconfigure */ | ||||
txc43128_verify, /* epo_verify */ | txc43128_verify, /* epo_verify */ | ||||
txc43128_uplink_check, /* epo_uplink_check */ | txc43128_uplink_check, /* epo_uplink_check */ | ||||
txc43128_downlink_check, /* epo_downlink_check */ | txc43128_downlink_check, /* epo_downlink_check */ | ||||
txc43128_oui_get, /* epo_oui_get */ | txc43128_oui_get, /* epo_oui_get */ | ||||
#if EFSYS_OPT_PHY_STATS | #if EFSYS_OPT_PHY_STATS | ||||
txc43128_stats_update, /* epo_stats_update */ | txc43128_stats_update, /* epo_stats_update */ | ||||
#endif /* EFSYS_OPT_PHY_STATS */ | #endif /* EFSYS_OPT_PHY_STATS */ | ||||
#if EFSYS_OPT_PHY_PROPS | #if EFSYS_OPT_PHY_PROPS | ||||
#if EFSYS_OPT_NAMES | #if EFSYS_OPT_NAMES | ||||
txc43128_prop_name, /* epo_prop_name */ | txc43128_prop_name, /* epo_prop_name */ | ||||
#endif | #endif | ||||
txc43128_prop_get, /* epo_prop_get */ | txc43128_prop_get, /* epo_prop_get */ | ||||
txc43128_prop_set, /* epo_prop_set */ | txc43128_prop_set, /* epo_prop_set */ | ||||
#endif /* EFSYS_OPT_PHY_PROPS */ | #endif /* EFSYS_OPT_PHY_PROPS */ | ||||
#if EFSYS_OPT_PHY_BIST | #if EFSYS_OPT_BIST | ||||
NULL, /* epo_bist_enable_offline */ | |||||
NULL, /* epo_bist_start */ | NULL, /* epo_bist_start */ | ||||
NULL, /* epo_bist_poll */ | NULL, /* epo_bist_poll */ | ||||
NULL, /* epo_bist_stop */ | NULL, /* epo_bist_stop */ | ||||
#endif /* EFSYS_OPT_PHY_BIST */ | #endif /* EFSYS_OPT_BIST */ | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_PHY_TXC43128 */ | #endif /* EFSYS_OPT_PHY_TXC43128 */ | ||||
#if EFSYS_OPT_PHY_SFT9001 | #if EFSYS_OPT_PHY_SFT9001 | ||||
static efx_phy_ops_t __cs __efx_phy_sft9001_ops = { | static efx_phy_ops_t __efx_phy_sft9001_ops = { | ||||
NULL, /* epo_power */ | NULL, /* epo_power */ | ||||
sft9001_reset, /* epo_reset */ | sft9001_reset, /* epo_reset */ | ||||
sft9001_reconfigure, /* epo_reconfigure */ | sft9001_reconfigure, /* epo_reconfigure */ | ||||
sft9001_verify, /* epo_verify */ | sft9001_verify, /* epo_verify */ | ||||
sft9001_uplink_check, /* epo_uplink_check */ | sft9001_uplink_check, /* epo_uplink_check */ | ||||
sft9001_downlink_check, /* epo_downlink_check */ | sft9001_downlink_check, /* epo_downlink_check */ | ||||
sft9001_oui_get, /* epo_oui_get */ | sft9001_oui_get, /* epo_oui_get */ | ||||
#if EFSYS_OPT_PHY_STATS | #if EFSYS_OPT_PHY_STATS | ||||
sft9001_stats_update, /* epo_stats_update */ | sft9001_stats_update, /* epo_stats_update */ | ||||
#endif /* EFSYS_OPT_PHY_STATS */ | #endif /* EFSYS_OPT_PHY_STATS */ | ||||
#if EFSYS_OPT_PHY_PROPS | #if EFSYS_OPT_PHY_PROPS | ||||
#if EFSYS_OPT_NAMES | #if EFSYS_OPT_NAMES | ||||
sft9001_prop_name, /* epo_prop_name */ | sft9001_prop_name, /* epo_prop_name */ | ||||
#endif | #endif | ||||
sft9001_prop_get, /* epo_prop_get */ | sft9001_prop_get, /* epo_prop_get */ | ||||
sft9001_prop_set, /* epo_prop_set */ | sft9001_prop_set, /* epo_prop_set */ | ||||
#endif /* EFSYS_OPT_PHY_PROPS */ | #endif /* EFSYS_OPT_PHY_PROPS */ | ||||
#if EFSYS_OPT_PHY_BIST | #if EFSYS_OPT_BIST | ||||
NULL, /* epo_bist_enable_offline */ | |||||
sft9001_bist_start, /* epo_bist_start */ | sft9001_bist_start, /* epo_bist_start */ | ||||
sft9001_bist_poll, /* epo_bist_poll */ | sft9001_bist_poll, /* epo_bist_poll */ | ||||
sft9001_bist_stop, /* epo_bist_stop */ | sft9001_bist_stop, /* epo_bist_stop */ | ||||
#endif /* EFSYS_OPT_PHY_BIST */ | #endif /* EFSYS_OPT_BIST */ | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_PHY_SFT9001 */ | #endif /* EFSYS_OPT_PHY_SFT9001 */ | ||||
#if EFSYS_OPT_PHY_QT2025C | #if EFSYS_OPT_PHY_QT2025C | ||||
static efx_phy_ops_t __cs __efx_phy_qt2025c_ops = { | static efx_phy_ops_t __efx_phy_qt2025c_ops = { | ||||
NULL, /* epo_power */ | NULL, /* epo_power */ | ||||
qt2025c_reset, /* epo_reset */ | qt2025c_reset, /* epo_reset */ | ||||
qt2025c_reconfigure, /* epo_reconfigure */ | qt2025c_reconfigure, /* epo_reconfigure */ | ||||
qt2025c_verify, /* epo_verify */ | qt2025c_verify, /* epo_verify */ | ||||
qt2025c_uplink_check, /* epo_uplink_check */ | qt2025c_uplink_check, /* epo_uplink_check */ | ||||
qt2025c_downlink_check, /* epo_downlink_check */ | qt2025c_downlink_check, /* epo_downlink_check */ | ||||
qt2025c_oui_get, /* epo_oui_get */ | qt2025c_oui_get, /* epo_oui_get */ | ||||
#if EFSYS_OPT_PHY_STATS | #if EFSYS_OPT_PHY_STATS | ||||
qt2025c_stats_update, /* epo_stats_update */ | qt2025c_stats_update, /* epo_stats_update */ | ||||
#endif /* EFSYS_OPT_PHY_STATS */ | #endif /* EFSYS_OPT_PHY_STATS */ | ||||
#if EFSYS_OPT_PHY_PROPS | #if EFSYS_OPT_PHY_PROPS | ||||
#if EFSYS_OPT_NAMES | #if EFSYS_OPT_NAMES | ||||
qt2025c_prop_name, /* epo_prop_name */ | qt2025c_prop_name, /* epo_prop_name */ | ||||
#endif | #endif | ||||
qt2025c_prop_get, /* epo_prop_get */ | qt2025c_prop_get, /* epo_prop_get */ | ||||
qt2025c_prop_set, /* epo_prop_set */ | qt2025c_prop_set, /* epo_prop_set */ | ||||
#endif /* EFSYS_OPT_PHY_PROPS */ | #endif /* EFSYS_OPT_PHY_PROPS */ | ||||
#if EFSYS_OPT_PHY_BIST | #if EFSYS_OPT_BIST | ||||
NULL, /* epo_bist_enable_offline */ | |||||
NULL, /* epo_bist_start */ | NULL, /* epo_bist_start */ | ||||
NULL, /* epo_bist_poll */ | NULL, /* epo_bist_poll */ | ||||
NULL, /* epo_bist_stop */ | NULL, /* epo_bist_stop */ | ||||
#endif /* EFSYS_OPT_PHY_BIST */ | #endif /* EFSYS_OPT_BIST */ | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_PHY_QT2025C */ | #endif /* EFSYS_OPT_PHY_QT2025C */ | ||||
#if EFSYS_OPT_SIENA | #if EFSYS_OPT_SIENA | ||||
static efx_phy_ops_t __cs __efx_phy_siena_ops = { | static efx_phy_ops_t __efx_phy_siena_ops = { | ||||
siena_phy_power, /* epo_power */ | siena_phy_power, /* epo_power */ | ||||
NULL, /* epo_reset */ | NULL, /* epo_reset */ | ||||
siena_phy_reconfigure, /* epo_reconfigure */ | siena_phy_reconfigure, /* epo_reconfigure */ | ||||
siena_phy_verify, /* epo_verify */ | siena_phy_verify, /* epo_verify */ | ||||
NULL, /* epo_uplink_check */ | NULL, /* epo_uplink_check */ | ||||
NULL, /* epo_downlink_check */ | NULL, /* epo_downlink_check */ | ||||
siena_phy_oui_get, /* epo_oui_get */ | siena_phy_oui_get, /* epo_oui_get */ | ||||
#if EFSYS_OPT_PHY_STATS | #if EFSYS_OPT_PHY_STATS | ||||
siena_phy_stats_update, /* epo_stats_update */ | siena_phy_stats_update, /* epo_stats_update */ | ||||
#endif /* EFSYS_OPT_PHY_STATS */ | #endif /* EFSYS_OPT_PHY_STATS */ | ||||
#if EFSYS_OPT_PHY_PROPS | #if EFSYS_OPT_PHY_PROPS | ||||
#if EFSYS_OPT_NAMES | #if EFSYS_OPT_NAMES | ||||
siena_phy_prop_name, /* epo_prop_name */ | siena_phy_prop_name, /* epo_prop_name */ | ||||
#endif | #endif | ||||
siena_phy_prop_get, /* epo_prop_get */ | siena_phy_prop_get, /* epo_prop_get */ | ||||
siena_phy_prop_set, /* epo_prop_set */ | siena_phy_prop_set, /* epo_prop_set */ | ||||
#endif /* EFSYS_OPT_PHY_PROPS */ | #endif /* EFSYS_OPT_PHY_PROPS */ | ||||
#if EFSYS_OPT_PHY_BIST | #if EFSYS_OPT_BIST | ||||
NULL, /* epo_bist_enable_offline */ | |||||
siena_phy_bist_start, /* epo_bist_start */ | siena_phy_bist_start, /* epo_bist_start */ | ||||
siena_phy_bist_poll, /* epo_bist_poll */ | siena_phy_bist_poll, /* epo_bist_poll */ | ||||
siena_phy_bist_stop, /* epo_bist_stop */ | siena_phy_bist_stop, /* epo_bist_stop */ | ||||
#endif /* EFSYS_OPT_PHY_BIST */ | #endif /* EFSYS_OPT_BIST */ | ||||
}; | }; | ||||
#endif /* EFSYS_OPT_SIENA */ | #endif /* EFSYS_OPT_SIENA */ | ||||
#if EFSYS_OPT_HUNTINGTON | |||||
static efx_phy_ops_t __efx_phy_hunt_ops = { | |||||
hunt_phy_power, /* epo_power */ | |||||
NULL, /* epo_reset */ | |||||
hunt_phy_reconfigure, /* epo_reconfigure */ | |||||
hunt_phy_verify, /* epo_verify */ | |||||
NULL, /* epo_uplink_check */ | |||||
NULL, /* epo_downlink_check */ | |||||
hunt_phy_oui_get, /* epo_oui_get */ | |||||
#if EFSYS_OPT_PHY_STATS | |||||
hunt_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 */ | |||||
#endif | |||||
hunt_phy_prop_get, /* epo_prop_get */ | |||||
hunt_phy_prop_set, /* epo_prop_set */ | |||||
#endif /* EFSYS_OPT_PHY_PROPS */ | |||||
#if EFSYS_OPT_BIST | |||||
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 */ | |||||
__checkReturn int | __checkReturn int | ||||
efx_phy_probe( | efx_phy_probe( | ||||
__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_nic_cfg_t *encp = &(enp->en_nic_cfg); | efx_nic_cfg_t *encp = &(enp->en_nic_cfg); | ||||
efx_phy_ops_t *epop; | efx_phy_ops_t *epop; | ||||
int rc; | int rc; | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
break; | break; | ||||
#endif /* EFSYS_OPT_FALCON */ | #endif /* EFSYS_OPT_FALCON */ | ||||
#if EFSYS_OPT_SIENA | #if EFSYS_OPT_SIENA | ||||
case EFX_FAMILY_SIENA: | case EFX_FAMILY_SIENA: | ||||
epop = (efx_phy_ops_t *)&__efx_phy_siena_ops; | epop = (efx_phy_ops_t *)&__efx_phy_siena_ops; | ||||
break; | break; | ||||
#endif /* EFSYS_OPT_SIENA */ | #endif /* EFSYS_OPT_SIENA */ | ||||
#if EFSYS_OPT_HUNTINGTON | |||||
case EFX_FAMILY_HUNTINGTON: | |||||
epop = (efx_phy_ops_t *)&__efx_phy_hunt_ops; | |||||
break; | |||||
#endif /* EFSYS_OPT_HUNTINGTON */ | |||||
default: | default: | ||||
rc = ENOTSUP; | rc = ENOTSUP; | ||||
goto fail1; | goto fail1; | ||||
} | } | ||||
epp->ep_epop = epop; | epp->ep_epop = epop; | ||||
return (0); | return (0); | ||||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | efx_phy_media_type_get( | ||||
else | else | ||||
*typep = epp->ep_fixed_port_type; | *typep = epp->ep_fixed_port_type; | ||||
} | } | ||||
#if EFSYS_OPT_PHY_STATS | #if EFSYS_OPT_PHY_STATS | ||||
#if EFSYS_OPT_NAMES | #if EFSYS_OPT_NAMES | ||||
/* START MKCONFIG GENERATED PhyStatNamesBlock 271268f3da0e804f */ | /* START MKCONFIG GENERATED PhyStatNamesBlock d5f79b4bc2c050fe */ | ||||
static const char __cs * __cs __efx_phy_stat_name[] = { | static const char *__efx_phy_stat_name[] = { | ||||
"oui", | "oui", | ||||
"pma_pmd_link_up", | "pma_pmd_link_up", | ||||
"pma_pmd_rx_fault", | "pma_pmd_rx_fault", | ||||
"pma_pmd_tx_fault", | "pma_pmd_tx_fault", | ||||
"pma_pmd_rev_a", | "pma_pmd_rev_a", | ||||
"pma_pmd_rev_b", | "pma_pmd_rev_b", | ||||
"pma_pmd_rev_c", | "pma_pmd_rev_c", | ||||
"pma_pmd_rev_d", | "pma_pmd_rev_d", | ||||
Show All 34 Lines | static const char *__efx_phy_stat_name[] = { | ||||
"pcs_fw_build_yy", | "pcs_fw_build_yy", | ||||
"pcs_fw_build_mm", | "pcs_fw_build_mm", | ||||
"pcs_fw_build_dd", | "pcs_fw_build_dd", | ||||
"pcs_op_mode", | "pcs_op_mode", | ||||
}; | }; | ||||
/* END MKCONFIG GENERATED PhyStatNamesBlock */ | /* END MKCONFIG GENERATED PhyStatNamesBlock */ | ||||
const char __cs * | const char * | ||||
efx_phy_stat_name( | efx_phy_stat_name( | ||||
__in efx_nic_t *enp, | __in efx_nic_t *enp, | ||||
__in efx_phy_stat_t type) | __in efx_phy_stat_t type) | ||||
{ | { | ||||
_NOTE(ARGUNUSED(enp)) | _NOTE(ARGUNUSED(enp)) | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
EFSYS_ASSERT3U(type, <, EFX_PHY_NSTATS); | EFSYS_ASSERT3U(type, <, EFX_PHY_NSTATS); | ||||
Show All 17 Lines | efx_phy_stats_update( | ||||
return (epop->epo_stats_update(enp, esmp, stat)); | return (epop->epo_stats_update(enp, esmp, stat)); | ||||
} | } | ||||
#endif /* EFSYS_OPT_PHY_STATS */ | #endif /* EFSYS_OPT_PHY_STATS */ | ||||
#if EFSYS_OPT_PHY_PROPS | #if EFSYS_OPT_PHY_PROPS | ||||
#if EFSYS_OPT_NAMES | #if EFSYS_OPT_NAMES | ||||
const char __cs * | const char * | ||||
efx_phy_prop_name( | efx_phy_prop_name( | ||||
__in efx_nic_t *enp, | __in efx_nic_t *enp, | ||||
__in unsigned int id) | __in unsigned int id) | ||||
{ | { | ||||
efx_port_t *epp = &(enp->en_port); | efx_port_t *epp = &(enp->en_port); | ||||
efx_phy_ops_t *epop = epp->ep_epop; | efx_phy_ops_t *epop = epp->ep_epop; | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
Show All 30 Lines | efx_phy_prop_set( | ||||
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); | ||||
return (epop->epo_prop_set(enp, id, val)); | return (epop->epo_prop_set(enp, id, val)); | ||||
} | } | ||||
#endif /* EFSYS_OPT_PHY_STATS */ | #endif /* EFSYS_OPT_PHY_STATS */ | ||||
#if EFSYS_OPT_PHY_BIST | #if EFSYS_OPT_BIST | ||||
__checkReturn int | __checkReturn int | ||||
efx_phy_bist_start( | efx_bist_enable_offline( | ||||
__in efx_nic_t *enp) | |||||
{ | |||||
efx_port_t *epp = &(enp->en_port); | |||||
efx_phy_ops_t *epop = epp->ep_epop; | |||||
int rc; | |||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | |||||
if (epop->epo_bist_enable_offline == NULL) { | |||||
rc = ENOTSUP; | |||||
goto fail1; | |||||
} | |||||
if ((rc = epop->epo_bist_enable_offline(enp)) != 0) | |||||
goto fail2; | |||||
return (0); | |||||
fail2: | |||||
EFSYS_PROBE(fail2); | |||||
fail1: | |||||
EFSYS_PROBE1(fail1, int, rc); | |||||
return (rc); | |||||
} | |||||
__checkReturn int | |||||
efx_bist_start( | |||||
__in efx_nic_t *enp, | __in efx_nic_t *enp, | ||||
__in efx_phy_bist_type_t type) | __in efx_bist_type_t type) | ||||
{ | { | ||||
efx_port_t *epp = &(enp->en_port); | efx_port_t *epp = &(enp->en_port); | ||||
efx_phy_ops_t *epop = epp->ep_epop; | efx_phy_ops_t *epop = epp->ep_epop; | ||||
int rc; | int 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(type, !=, EFX_PHY_BIST_TYPE_UNKNOWN); | EFSYS_ASSERT3U(type, !=, EFX_BIST_TYPE_UNKNOWN); | ||||
EFSYS_ASSERT3U(type, <, EFX_PHY_BIST_TYPE_NTYPES); | EFSYS_ASSERT3U(type, <, EFX_BIST_TYPE_NTYPES); | ||||
EFSYS_ASSERT3U(epp->ep_current_bist, ==, EFX_PHY_BIST_TYPE_UNKNOWN); | EFSYS_ASSERT3U(epp->ep_current_bist, ==, EFX_BIST_TYPE_UNKNOWN); | ||||
if (epop->epo_bist_start == NULL) { | if (epop->epo_bist_start == NULL) { | ||||
rc = ENOTSUP; | rc = ENOTSUP; | ||||
goto fail1; | goto fail1; | ||||
} | } | ||||
if ((rc = epop->epo_bist_start(enp, type)) != 0) | if ((rc = epop->epo_bist_start(enp, type)) != 0) | ||||
goto fail2; | goto fail2; | ||||
epp->ep_current_bist = type; | epp->ep_current_bist = type; | ||||
return (0); | return (0); | ||||
fail2: | fail2: | ||||
EFSYS_PROBE(fail2); | EFSYS_PROBE(fail2); | ||||
fail1: | fail1: | ||||
EFSYS_PROBE1(fail1, int, rc); | EFSYS_PROBE1(fail1, int, rc); | ||||
return (rc); | return (rc); | ||||
} | } | ||||
__checkReturn int | __checkReturn int | ||||
efx_phy_bist_poll( | efx_bist_poll( | ||||
__in efx_nic_t *enp, | __in efx_nic_t *enp, | ||||
__in efx_phy_bist_type_t type, | __in efx_bist_type_t type, | ||||
__out efx_phy_bist_result_t *resultp, | __out efx_bist_result_t *resultp, | ||||
__out_opt uint32_t *value_maskp, | __out_opt uint32_t *value_maskp, | ||||
__out_ecount_opt(count) unsigned long *valuesp, | __out_ecount_opt(count) unsigned long *valuesp, | ||||
__in size_t count) | __in size_t count) | ||||
{ | { | ||||
efx_port_t *epp = &(enp->en_port); | efx_port_t *epp = &(enp->en_port); | ||||
efx_phy_ops_t *epop = epp->ep_epop; | efx_phy_ops_t *epop = epp->ep_epop; | ||||
int rc; | int 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(type, !=, EFX_PHY_BIST_TYPE_UNKNOWN); | EFSYS_ASSERT3U(type, !=, EFX_BIST_TYPE_UNKNOWN); | ||||
EFSYS_ASSERT3U(type, <, EFX_PHY_BIST_TYPE_NTYPES); | EFSYS_ASSERT3U(type, <, EFX_BIST_TYPE_NTYPES); | ||||
EFSYS_ASSERT3U(epp->ep_current_bist, ==, type); | EFSYS_ASSERT3U(epp->ep_current_bist, ==, type); | ||||
EFSYS_ASSERT(epop->epo_bist_poll != NULL); | EFSYS_ASSERT(epop->epo_bist_poll != NULL); | ||||
if (epop->epo_bist_poll == NULL) { | if (epop->epo_bist_poll == NULL) { | ||||
rc = ENOTSUP; | rc = ENOTSUP; | ||||
goto fail1; | goto fail1; | ||||
} | } | ||||
if ((rc = epop->epo_bist_poll(enp, type, resultp, value_maskp, | if ((rc = epop->epo_bist_poll(enp, type, resultp, value_maskp, | ||||
valuesp, count)) != 0) | valuesp, count)) != 0) | ||||
goto fail2; | goto fail2; | ||||
return (0); | return (0); | ||||
fail2: | fail2: | ||||
EFSYS_PROBE(fail2); | EFSYS_PROBE(fail2); | ||||
fail1: | fail1: | ||||
EFSYS_PROBE1(fail1, int, rc); | EFSYS_PROBE1(fail1, int, rc); | ||||
return (rc); | return (rc); | ||||
} | } | ||||
void | void | ||||
efx_phy_bist_stop( | efx_bist_stop( | ||||
__in efx_nic_t *enp, | __in efx_nic_t *enp, | ||||
__in efx_phy_bist_type_t type) | __in efx_bist_type_t type) | ||||
{ | { | ||||
efx_port_t *epp = &(enp->en_port); | efx_port_t *epp = &(enp->en_port); | ||||
efx_phy_ops_t *epop = epp->ep_epop; | 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_PORT); | |||||
EFSYS_ASSERT3U(type, !=, EFX_PHY_BIST_TYPE_UNKNOWN); | EFSYS_ASSERT3U(type, !=, EFX_BIST_TYPE_UNKNOWN); | ||||
EFSYS_ASSERT3U(type, <, EFX_PHY_BIST_TYPE_NTYPES); | EFSYS_ASSERT3U(type, <, EFX_BIST_TYPE_NTYPES); | ||||
EFSYS_ASSERT3U(epp->ep_current_bist, ==, type); | EFSYS_ASSERT3U(epp->ep_current_bist, ==, type); | ||||
EFSYS_ASSERT(epop->epo_bist_stop != NULL); | EFSYS_ASSERT(epop->epo_bist_stop != NULL); | ||||
if (epop->epo_bist_stop != NULL) | if (epop->epo_bist_stop != NULL) | ||||
epop->epo_bist_stop(enp, type); | epop->epo_bist_stop(enp, type); | ||||
epp->ep_current_bist = EFX_PHY_BIST_TYPE_UNKNOWN; | epp->ep_current_bist = EFX_BIST_TYPE_UNKNOWN; | ||||
} | } | ||||
#endif /* EFSYS_OPT_PHY_BIST */ | #endif /* EFSYS_OPT_BIST */ | ||||
void | void | ||||
efx_phy_unprobe( | efx_phy_unprobe( | ||||
__in efx_nic_t *enp) | __in efx_nic_t *enp) | ||||
{ | { | ||||
efx_port_t *epp = &(enp->en_port); | efx_port_t *epp = &(enp->en_port); | ||||
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); | ||||
epp->ep_epop = NULL; | epp->ep_epop = NULL; | ||||
epp->ep_adv_cap_mask = 0; | epp->ep_adv_cap_mask = 0; | ||||
epp->ep_port = 0; | epp->ep_port = 0; | ||||
epp->ep_phy_type = 0; | epp->ep_phy_type = 0; | ||||
} | } |