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

📄 pismac.c

📁 vt6528芯片交换机API函数和文档运行程序
💻 C
字号:
/*
 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
 * All rights reserved.
 *
 * This software is copyrighted by and is the sole property of
 * VIA Networking Technologies, Inc. This software may only be used
 * in accordance with the corresponding license agreement. Any unauthorized
 * use, duplication, transmission, distribution, or disclosure of this
 * software is expressly forbidden.
 *
 * This software is provided by VIA Networking Technologies, Inc. "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 VIA Networking Technologies, Inc.
 * be liable for any direct, indirect, incidental, special, exemplary, or
 * consequential damages.
 *
 *
 * File:    pismac.c
 *
 * Purpose: Static mac table module UI definitions
 *
 * Author:  Freeya Lin
 *
 * Date:    Feb 24, 2004
 *
 * Functions:
 *
 * Revision History:
 *
 */


#include "str.h"
#include "swsys.h"
#include "piportmp.h"
#include "pismac.h"
#include "pismacep.h"

/*---------------------  Static Definitions -------------------------*/

/*---------------------  Static Classes  ----------------------------*/

/*---------------------  Static Variables  --------------------------*/

/*---------------------  Static Functions  --------------------------*/

/*---------------------  Static Macros  -----------------------------*/

/*---------------------  Export Variables  --------------------------*/

/*---------------------  Export Functions  --------------------------*/

// Get config from EEPROM and set into page buf
void PISMAC_vInitPage (SSMacPageCfg *pSPageBuf)
{
    STR_pvMemset(pSPageBuf, 0, sizeof(SSMacPageCfg));

    PISMACEP_vStatisTblInfo(pSPageBuf);
}


// Get config from EEPROM and set into hardware
void PISMAC_vSetHwFromEep (SSMacPageCfg *pSPageBuf)
{
    UINT16          si;
    SMacEntry       sTblEntry; //TOCHECK
    UINT8            abyMacBuff[MAC_ADDR_SIZE];   
    
    // Initialize page and set gmrp mode into hardware
    PISMAC_vInitPage(pSPageBuf);

    // If gmrp enabled, add groups into hardware
    for (si = 0; si < pSPageBuf->wValidEntryNum; si++) {
        STR_pvMemset(&sTblEntry, 0, sizeof(SMacEntry)); //TOCHECK
        abyMacBuff[0] = 0;
        STR_vCvtMacStrtoVal(pSPageBuf->astrGrpMacList+si*(MAC_STRING_LEN+1), (char*)abyMacBuff);
        PISMACEP_vGetEntry( PISMACEP_wSearchEntry(abyMacBuff, pSPageBuf->awValidGrpFidList[si]), &sTblEntry);
        SWMACTB_bInsEntry(&sTblEntry, 1);   
    }
}

// Set default into EEPROM
void PISMAC_vSetEepDefault (SSMacPageCfg *pSPageBuf, BOOL bWriteDefault)
{
    // Set value to nvram software cache
    STR_pvMemset(g_pu8NVRSwCache + (EEP_ADDR_PROV_SMAC_CFG - NVR_ADDR_DATA_AREA_START), 0, EEP_SIZE_PROV_SMAC_CFG);       
    if (!bWriteDefault) {
        // Not write default operation     
        // Write cache data into flash             
        NVRAM_bWriteBlock(EEP_ADDR_PROV_SMAC_CFG, g_pu8NVRSwCache + (EEP_ADDR_PROV_SMAC_CFG - NVR_ADDR_DATA_AREA_START), EEP_SIZE_PROV_SMAC_CFG, FALSE);
        // Update checksum and return
        NVRAM_vUpdateChecksum(EEP_SIZE_DATA_AREA);
    }
}



⌨️ 快捷键说明

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