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

📄 ans_hw.c

📁 linux intel 网卡驱动,利用他可以让inel的pro 100 网卡进行网络配置和实用
💻 C
字号:
/*******************************************************************************    Copyright(c) 1999 - 2002 Intel Corporation. All rights reserved.    This program is free software; you can redistribute it and/or modify it   under the terms of the GNU General Public License as published by the Free   Software Foundation; either version 2 of the License, or (at your option)   any later version.    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., 59   Temple Place - Suite 330, Boston, MA  02111-1307, USA.    The full GNU General Public License is included in this distribution in the  file called LICENSE.    Contact Information:  Linux NICS <linux.nics@intel.com>  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497*******************************************************************************//***********************************************************************                                                                     ** INTEL CORPORATION                                                   **                                                                     ** This software is supplied under the terms of the license included   ** above.  All use of this driver must be in accordance with the terms ** of that license.                                                    **                                                                     ** Module Name:  ans_hw.c                                              **                                                                     ** Abstract: hardware specific files for the 8255x adapters            **                                                                     ** Environment:                                                        **                                                                     ***********************************************************************/#include "ans_driver.h"UINT32bd_ans_hw_AvailableSpeeds(UINT32 phy){    UINT32 speeds;    speeds =        IANS_STATUS_LINK_SPEED_10MBPS | IANS_STATUS_LINK_SPEED_100MBPS;        return (speeds);    }UINT32bd_ans_hw_flags(BOARD_PRIVATE_STRUCT *bps, UINT16 revid){                                            UINT16 CompatibilityFlagsReg;    UINT32 flags = 0;        if (revid < I82559_REV_ID) {        flags |= IANS_BD_FLAG4;            } else {        CompatibilityFlagsReg = READ_EEPROM(bps, EEPROM_COMPATIBILITY_FLAGS);                if ((HIGH_BYTE(CompatibilityFlagsReg) & EEPROM_COMPATIBILITY_BIT_4) &&            !(HIGH_BYTE(CompatibilityFlagsReg) & EEPROM_COMPATIBILITY_BIT_2)) {                        flags |= IANS_BD_FLAG4;        }    }        return flags;}          BD_ANS_BOOLEANbd_ans_hw_SupportsIEEETagging(BOARD_PRIVATE_STRUCT *bps, UINT16 revid){    /* we only support IEEE tagging if we are on a bachelor or better card. */    DEBUGLOG1("bd_ans_hw_SupportsIEEETagging: revid = %d\n", revid);    if (revid >= I82558_REV_ID) {        return BD_ANS_TRUE;    }    return BD_ANS_FALSE;}#ifdef IANS_BASE_VLAN_TAGGINGBD_ANS_BOOLEANbd_ans_hw_IsQtagPacket(BOARD_PRIVATE_STRUCT *bps, HW_RX_DESCRIPTOR *rxd){    /* check the T bit */     if (RXD_STATUS(rxd) & 0x1000) {  /* underrun */        return BD_ANS_TRUE;    }    return BD_ANS_FALSE;}BD_ANS_STATUSbd_ans_hw_InsertQtagHW(BOARD_PRIVATE_STRUCT *bps, HW_TX_DESCRIPTOR *txd, UINT16 *vlanid){      txd->tcbu.ipcb.ip_activation_high |= IPCB_INSERT_VLAN_ENABLE;    txd->tcbu.ipcb.vlan = BYTE_SWAP_WORD(*vlanid);    return BD_ANS_SUCCESS;}UINT16 bd_ans_hw_GetVlanId(BOARD_PRIVATE_STRUCT *bps,    HW_RX_DESCRIPTOR *rxd){    UINT16 VlanId = INVALID_VLAN_ID;    /* check the T bit */    if (RXD_STATUS(rxd) & 0x1000) { /* underrun */        VlanId = BYTE_SWAP_WORD(RXD_VLANID(rxd)) & VLAN_ID_MASK;        /* clear out the vlan id bits just to be safe */        RXD_STATUS(rxd) &= ~0x1000;        RXD_VLANID(rxd) = 0;    }    DEBUGLOG1("bd_ans_hw_GetVlanId: got %d\n", VlanId);    return VlanId;}     /* this function will setup the config bytes for the 8255x to enable * tagging.  The driver must call the this routine as part of it's normal * configure routine if it wants to enable 802.1q tagging.  To disable * tagging, the driver should just call configure without calling * this routine. */voidbd_ans_hw_ConfigEnableTagging(UINT8 *ConfigBytes, UINT16 rev_id){        // not in use for e100}#endifBD_ANS_BOOLEANbd_ans_hw_SupportsVlanOffload(BOARD_PRIVATE_STRUCT *bps, UINT16 rev_id){            if (rev_id >= GAMLA_REV_ID) {        DEBUGLOG("bd_ans_hw_SupportsVlanOffload: does support\n");        return BD_ANS_TRUE;    }    DEBUGLOG("bd_ans_hw_SupportsVlanOffload: does NOT support\n");    return BD_ANS_FALSE;}

⌨️ 快捷键说明

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