📄 ans_driver.h
字号:
/******************************************************************************* 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_driver.h ** ** Abstract: driver defines specific to the linux HVA driver ** ** Environment: This file is intended to be specific to the Linux ** operating system. ** ***********************************************************************/#ifndef _ANS_DRIVER_H#define _ANS_DRIVER_H#include <linux/types.h>/* Forward declerations */#ifndef _RFD_T_#define _RFD_T_typedef struct _rfd_t rfd_t;#endif#ifndef _TCB_T_#define _TCB_T_typedef struct _tcb_t tcb_t;#endifstruct e100_private;#define BOARD_PRIVATE_STRUCT void /* hardware specfic defines *//* you may need to include your driver's header file which** defines your descriptors right here */#define HW_RX_DESCRIPTOR rfd_t#define HW_TX_DESCRIPTOR tcb_t#define FRAME_DATA unsigned char/* you must include this after you define above stuff */#include "ans.h"/* e100.h has to come after ans.h is included */#include "e100.h"#define ANS_PRIVATE_DATA_FIELD(bps) (((struct e100_private *)(bps))->iANSdata)#define DRIVER_DEV_FIELD(bps) (((struct e100_private *)(bps))->device)/* how we will be defining the duplex field values for this driver */#define BD_ANS_DUPLEX_FULL 2#define BD_ANS_DUPLEX_HALF 1/* macros for accessing some driver structures */#define BD_ANS_DRV_PHY_ID(bps) (((struct e100_private *)(bps))->PhyId) #define BD_ANS_DRV_REVID(bps) (((struct e100_private *)(bps))->rev_id)#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)#define BD_ANS_DRV_SUBSYSTEMID(bps) (((struct e100_private *)(bps))->sub_dev_id)#define BD_ANS_DRV_SUBVENDORID(bps) (((struct e100_private *)(bps))->sub_dev_id)#else#define BD_ANS_DRV_SUBSYSTEMID(bps) (((struct e100_private *)(bps))->pdev->subsystem_vendor)#define BD_ANS_DRV_SUBVENDORID(bps) (((struct e100_private *)(bps))->pdev->subsystem_device)#endif#define RXD_T_BIT(rxd) \ (((cb_header_status_word)((rxd)->rfd_header.cb_status)).underrun)#define RXD_VLANID(rxd) ((rxd)->vlanid)#define IPCB_IP_ACTIVATION(txd) \ (((ipcb_bits)((txd)->tcbu.ipcb)).ipcb_activation)#define IPCB_VLANID(txd) \ (((ipcb_bits)((txd)->tcbu.ipcb)).vlanid)#define RXD_STATUS(rxd) ((rxd)->rfd_header.cb_status)#define EXT_TCB_START(txd) ((txd)->tcbu.tcb_ext)#define READ_EEPROM(bps, reg) e100_eeprom_read(bps, reg)#define BD_ANS_DRV_STATUS_SUPPORT_FLAGS (BD_ANS_LINK_STATUS_SUPPORTED | BD_ANS_SPEED_STATUS_SUPPORTED |BD_ANS_DUPLEX_STATUS_SUPPORTED )#define BD_ANS_DRV_MAX_VLAN_ID(bps) 4096 #define BD_ANS_DRV_MAX_VLAN_TABLE_SIZE(bps) 0#define BD_ANS_DRV_ISL_TAG_SUPPORT(bps) BD_ANS_FALSE#define BD_ANS_DRV_IEEE_TAG_SUPPORT(bps) \ ((BD_ANS_DRV_REVID(bps) >= I82558_REV_ID)?BD_ANS_TRUE:BD_ANS_FALSE)#define BD_ANS_DRV_VLAN_SUPPORT(bps) (BD_ANS_DRV_IEEE_TAG_SUPPORT(bps) | BD_ANS_DRV_ISL_TAG_SUPPORT(bps))#define BD_ANS_DRV_VLAN_FILTER_SUPPORT(bps) BD_ANS_FALSE#define BD_ANS_DRV_VLAN_OFFLOAD_SUPPORT(bps) \ (bd_ans_hw_SupportsVlanOffload(bps, BD_ANS_DRV_REVID(bps)))#ifndef MAX_ETHERNET_PACKET_SIZE#define MAX_ETHERNET_PACKET_SIZE 1514#endif#ifndef BYTE_SWAP_WORD#define BYTE_SWAP_WORD(word) ((((word) & 0x00ff) << 8) \ | (((word) & 0xff00) >> 8))#endif/* function prototypes */extern void bd_ans_drv_InitANS(BOARD_PRIVATE_STRUCT *bps, iANSsupport_t *iANSdata);extern void bd_ans_drv_UpdateStatus(BOARD_PRIVATE_STRUCT *bps);extern BD_ANS_STATUS bd_ans_drv_ConfigureTagging(BOARD_PRIVATE_STRUCT *bdp);extern BD_ANS_STATUS bd_ans_drv_ConfigureVlanTable(BOARD_PRIVATE_STRUCT *bps);extern BD_ANS_STATUS bd_ans_drv_ConfigureVlan(BOARD_PRIVATE_STRUCT *bps);extern VOID bd_ans_drv_StopWatchdog(BOARD_PRIVATE_STRUCT *bps);extern BD_ANS_STATUS bd_ans_drv_StopPromiscuousMode(BOARD_PRIVATE_STRUCT *bps);extern UINT32 bd_ans_drv_StartWatchdog(BOARD_PRIVATE_STRUCT *bps);extern BD_ANS_BOOLEAN bd_ans_hw_SupportsVlanOffload(BOARD_PRIVATE_STRUCT *bps, UINT16 rev_id);#ifdef IANS_BASE_VLAN_TAGGINGextern BD_ANS_BOOLEAN bd_ans_hw_IsQtagPacket(BOARD_PRIVATE_STRUCT *bps, HW_RX_DESCRIPTOR *rxd);extern BD_ANS_STATUS bd_ans_hw_InsertQtagHW(BOARD_PRIVATE_STRUCT *bps, HW_TX_DESCRIPTOR *txd, UINT16 *vlanid);extern UINT16 bd_ans_hw_GetVlanId(BOARD_PRIVATE_STRUCT *bps, HW_RX_DESCRIPTOR *rxd);#endif/* you may want to include some other driver include file here, if it will be * needed by any of the other ans modules. The ans_driver.h is included by * all the .c files, so if you want this include in all the ans .c files, * stick it right here. */#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -