⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phymap.c

📁 Vitesse 24port gigabit Switch Source Code
💻 C
字号:
/*

    Copyright (c) 2002-2005 Vitesse Semiconductor Corporation "Vitesse".  
    All Rights Reserved.  Unpublished rights reserved under the copyright laws
    of the United States of America, other countries and international treaties.
    The software is provided without a fee. Permission to use, copy, store and 
    modify, the software and its source code is granted. Permission to integrate
    into other products, disclose, transmit and distribute the software in an
    absolute machine readable format (e.g. HEX file) is also granted. 

    The source code of the software may not be disclosed, transmitted or
    distributed without the written permission of Vitesse. The software and its
    source code may only be used in products utilizing a Vitesse VSC73xx product.
 
    This copyright notice must appear in any copy, modification, disclosure,
    transmission or distribution of the software. Vitesse retains all ownership,
    copyright, trade secret and proprietary rights in the software.  

    THIS SOFTWARE HAS BEEN PROVIDED "AS IS," WITHOUT EXPRESS OR IMPLIED WARRANTY
    INCLUDING, WITHOUT LIMITATION, IMPLIED WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR USE AND NON-INFRINGEMENT.

*/
#include "common.h"
#include "main.h"
#include "phyconf.h"

/* ************************************************************************ **
 *
 *
 * Defines
 *
 *
 *
 * ************************************************************************ */

#define MIIM_0 0
#define MIIM_1 1

/* ************************************************************************ **
 *
 *
 * Typedefs and enums
 *
 *
 *
 * ************************************************************************ */


/* ************************************************************************ **
 *
 *
 * Prototypes for local functions
 *
 *
 *
 * ************************************************************************ */


/* ************************************************************************ **
 *
 *
 * Local data
 *
 *
 *
 * ************************************************************************ */

/*
** Mapping of PHYs on ports. Define for each port, the MIIM (0 or 1) to which
** the PHY is connected, and the PHY number.
*/
static code uchar port_to_phy  [MAX_PORT] = PHY_MAP_PHY_NO;
static code uchar port_to_miim [MAX_PORT] = PHY_MAP_MIIM_NO;


/* ************************************************************************ */
uchar phy_map_miim_no (uchar port_no) small
/* ------------------------------------------------------------------------ --
 * Purpose     : Get MIIM number of the PHY attached to specified port.
 * Remarks     : Returns MIIM number.
 * Restrictions:
 * See also    :
 * Example     :
 * ************************************************************************ */
{
    return port_to_miim[port_no];
}

/* ************************************************************************ */
uchar phy_map_phy_no (uchar port_no) small
/* ------------------------------------------------------------------------ --
 * Purpose     : Get PHY number of the PHY attached to specified port.
 * Remarks     : Returns PHY number.
 * Restrictions:
 * See also    :
 * Example     :
 * ************************************************************************ */
{
    return port_to_phy[port_no];
}



/* ************************************************************************ */
bool phy_map (uchar port_no) small
/* ------------------------------------------------------------------------ --
 * Purpose     : Check if a PHY is attached to an MIIM for the specified port.
 * Remarks     : Returns TRUE if so, otherwise FALSE
 * Restrictions:
 * See also    :
 * Example     :
 * ************************************************************************ */
{
    return (port_to_miim[port_no] <= 1);
}




















⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -