Path: blob/main/sys/contrib/ncsw/inc/Peripherals/mii_acc_ext.h
48375 views
/*1* Copyright 2008-2012 Freescale Semiconductor Inc.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/31323334#ifndef __MII_ACC_EXT_H35#define __MII_ACC_EXT_H363738/**************************************************************************//**39@Function MII_ReadPhyReg4041@Description This routine is called to read a specified PHY42register value.4344@Param[in] h_MiiAccess - Handle to MII configuration access registers45@Param[in] phyAddr - PHY address (0-31).46@Param[in] reg - PHY register to read47@Param[out] p_Data - Gets the register value.4849@Return Always zero (success).50*//***************************************************************************/51int MII_ReadPhyReg(t_Handle h_MiiAccess,52uint8_t phyAddr,53uint8_t reg,54uint16_t *p_Data);5556/**************************************************************************//**57@Function MII_WritePhyReg5859@Description This routine is called to write data to a specified PHY60register.6162@Param[in] h_MiiAccess - Handle to MII configuration access registers63@Param[in] phyAddr - PHY address (0-31).64@Param[in] reg - PHY register to write65@Param[in] data - Data to write in register.6667@Return Always zero (success).68*//***************************************************************************/69int MII_WritePhyReg(t_Handle h_MiiAccess,70uint8_t phyAddr,71uint8_t reg,72uint16_t data);737475#endif /* __MII_ACC_EXT_H */767778