/* This file is provided under a dual BSD/GPLv2 license. When using or redistributing this file, you may do so under either license. GPL LICENSE SUMMARY Copyright(c) 2016 Intel Corporation. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. The full GNU General Public License is included in this distribution in the file called LICENSE.GPL. Contact Information: Intel Corporation 2200 Mission College Blvd. Santa Clara, CA 97052 BSD LICENSE Copyright(c) 2014 Intel Corporation. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 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. */ /*------------------------------------------------------------------------------ * File Name: modphy_mrpc_api.h * Description: * modphy mrpc client driver api *------------------------------------------------------------------------------ */ #ifndef MODPHY_MRPC_API_H #define MODPHY_MRPC_API_H /**************************************************************************/ /* INCLUDES: */ /**************************************************************************/ /**************************************************************************/ /* INTERFACE DEFINES AND STRUCTS */ /**************************************************************************/ #define MODPHY_OK (0) #define MODPHY_FAIL (-1) #define MODPHY_DEV_NAME "/dev/modphy_drv" #define MODPHY_NAME "modphy_drv" typedef enum modphyController_e { MODPHY_MOCA_CLIENT_ID, MODPHY_DOCSIS_QAM_25MHZ_CLIENT_ID, MODPHY_DOCSIS_OFDM_25MHZ_CLIENT_ID, MODPHY_SGMII0_1G_CLIENT_ID, MODPHY_SGMII1_1G_CLIENT_ID, MODPHY_SGMII0_2_5G_CLIENT_ID, MODPHY_SGMII1_2_5G_CLIENT_ID, MODPHY_MOCA_50MHZ_CLIENT_ID, MODPHY_DOCSIS_QAM_50MHZ_CLIENT_ID, MODPHY_DOCSIS_OFDM_50MHZ_CLIENT_ID, MODPHY_NUM_OF_CLIENTS }ModphyController_e; typedef enum modphyLanes_e { MODPHY_LANE_0, MODPHY_LANE_1, MODPHY_LANE_2, MODPHY_MAX_NUM_OF_LANES }ModphyLanes_e; typedef struct modphyClient_t { ModphyController_e clientId; ModphyLanes_e laneId; }ModphyClient_t; #define MODPHY_DRIVER_DEV_NAME MODPHY_DEV_NAME #define MODPHY_DRIVER_ID (0xBE) #define MODPHY_INIT _IOW(MODPHY_DRIVER_ID, 1, ModphyController_e) #define MODPHY_CFG _IOW(MODPHY_DRIVER_ID, 2, ModphyClient_t) #define MODPHY_DISABLE_TX _IOW(MODPHY_DRIVER_ID, 3, ModphyClient_t) #define MODPHY_RESET_K_ALIGN _IOW(MODPHY_DRIVER_ID, 4, ModphyController_e) #define MODPHY_RESET_LANE _IOW(MODPHY_DRIVER_ID, 5, ModphyController_e) #define MODPHY_GO2_FAST_RECOVERY _IOW(MODPHY_DRIVER_ID, 6, ModphyClient_t) #define MODPHY_GO2_FULL_FUNCTIONAL _IOW(MODPHY_DRIVER_ID, 7, ModphyClient_t) #define MODPHY_COMMON_LANE_RESET _IOW(MODPHY_DRIVER_ID, 8, ModphyController_e) #define MODPHY_COMMON_LANE_INIT _IOW(MODPHY_DRIVER_ID, 9, ModphyController_e) #define MODPHY_SET_KGREGS _IOW(MODPHY_DRIVER_ID, 10, modphyClientKgregs_t) #define MODPHY_LANE_POWER_STATE_TRANSITION _IOW(MODPHY_DRIVER_ID, 11, ModphyClientPowerGate_t) #define MODPHY_ASSERT_RESET _IOW(MODPHY_DRIVER_ID, 12, ModphyController_e) /*********************************************************************************************************/ /*! \fn int modphy_assert_reset_client(ModphyController_e modphyClientId) ********************************************************************************************************* * \brief This function inits the modphy for a specific client. * \param[in] modphyClientId : Client ID * \return MODPHY_OK if writing succeed otherwise MODPHY_FAIL ********************************************************************************************************/ int modphy_assert_reset_client(ModphyController_e modphyClientId); /*********************************************************************************************************/ /*! \fn int modphy_init(ModphyController_e modphyClientId) ********************************************************************************************************* * \brief This function inits the modphy for a specific client. * \param[in] modphyClientId : Client ID * \return MODPHY_OK if writing succeed otherwise MODPHY_FAIL ********************************************************************************************************/ int modphy_init(ModphyController_e modphyClientId); /*********************************************************************************************************/ /*! \fn int modphy_configure(ModphyController_e modphyClientId) ********************************************************************************************************* * \brief This function configure the modphy for a specific client. * \param[in] modphyClientId : Client ID * \return MODPHY_OK if writing succeed otherwise MODPHY_FAIL ********************************************************************************************************/ int modphy_lane_configure(ModphyLanes_e lane, ModphyController_e modphyClientId); /*********************************************************************************************************/ /*! \fn int modphy_tx_disable(ModphyLanes_e lane, ModphyController_e modphyClientId) ********************************************************************************************************* * \brief This function disable TX lanes * \param[in] modphyClientId : Client ID * \return MODPHY_OK if writing succeed otherwise MODPHY_FAIL ********************************************************************************************************/ int modphy_tx_disable(ModphyLanes_e lane, ModphyController_e modphyClientId); /*********************************************************************************************************/ /*! \fn int modphy_reset_k_align(ModphyController_e modphyClientId) ********************************************************************************************************* * \brief This function reset K alignment in modphy * \param[in] modphyClientId : Client ID * \return MODPHY_OK if writing succeed otherwise MODPHY_FAIL ********************************************************************************************************/ int modphy_reset_k_align(ModphyController_e modphyClientId); /*********************************************************************************************************/ /*! \fn void modphy_reset_client(ModphyController_e modphyClientId) ********************************************************************************************************* * \brief This function resets ModPhy client. Used for ext.switches WA. Can be scheduled out. * \param[in] modphyClientId : Client ID * \return void ********************************************************************************************************/ void modphy_reset_client(ModphyController_e modphyClientId); #endif