📄 base_comm.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 software must be in accordance with the terms **** of that license. **** **** THIS FILE IS USED WHEN CREATING ians_core.o. HENCE, IT SHOULD NOT BE **** MODIFIED! **** **** Module Name: base_comm.h **** **** Abstract: This header file defines the communications between **** iANS module and the base driversbound below it. **** **** Environment: Kernel Mode (linux 2.2.x, 2.4.x) **** **** Written using Tab Size = 4, Indent Size = 4 **** **** Revision History: **** *************************************************************************************************************************************************************/#ifndef _BASE_COMM_H#define _BASE_COMM_H#define UINT16 __u16#define UINT32 __u32#define UCHAR __u8// Make sure all communications parties use the same packing mode// for the shared structures.#ifdef __ia64__ #pragma pack(8)#else #pragma pack(4)#endif/*------------------------------------------------------------------*| Communication version :| this is the version of the communication protocol described in| this header file.| This information will be passed in the IANS_BD_IDENTIFY ioctl*------------------------------------------------------------------*/// iANS's communications version#define IANS_COMM_VERSION_MAJOR (UINT16)1#define IANS_COMM_VERSION_MINOR (UINT16)0// Base driver's version#define IANS_BD_COMM_VERSION_MAJOR (UINT16)1#define IANS_BD_COMM_VERSION_MINOR (UINT16)0#define IANS_SIGNATURE_LENGTH 80#ifdef _IANS_MAIN_MODULE_C_char IntelCopyrightString[IANS_SIGNATURE_LENGTH] = "Intel Copyright 1999, all rights reserved\n";#else //_IANS_MAIN_MODULE_C_extern char IntelCopyrightString[IANS_SIGNATURE_LENGTH];#endif //_IANS_MAIN_MODULE_C_/*==========================================================================** ** IOCTLs ** **==========================================================================*//*--------------------------------------------------------------------* | Proprietary Opcodes *--------------------------------------------------------------------*/typedef enum _IANS_BASE_OPCODE { // ---------- Basic Extension Commands ---------- // IANS_OP_BD_IDENTIFY, // Identify BD to make sure it supports iANS comm. // BD fills Struct: IANS_BD_PARAM_IDENTIFY IANS_OP_BD_DISCONNECT, // Tell the BD that iANS is about to unload IANS_OP_EXT_GET_CAPABILITY, // Get extended capabilities // BD fills struct: _IANS_BD_PARAM_EXT_CAP IANS_OP_EXT_SET_MODE, // Set extended capabilities // iANS fills struct: _IANS_BD_PARAM_EXT_SET_MODE IANS_OP_EXT_GET_STATUS, // Get status from base driver // BD fills status struct: IANS_BD_IOC_PARAM_STATUS IANS_OP_ANS_SET_CB, // pass ans function's pointers to base // ---------- Adapter Teaming Commands ---------- // IANS_OP_IAT_FIRST=0x0100, // Skip over reserved area // There are no commands specific to adapter teaming // Capabilities are included in "Extended capabilities" // ---------- VLan Tagging Commands ---------- // IANS_OP_ITAG_FIRST=0x0200, // Skip over reserved area IANS_OP_ITAG_GET_CAPABILITY, // Get tagging capabilities // BD fills struct: IANS_BD_PARAM_ITAG_CAP IANS_OP_ITAG_SET_MODE, // None/ISL/802.3ac // IANS fills struct: IANS_BD_PARAM_ITAG_SET_MODE // ---------- VLan ID Commands ---------- // IANS_OP_IVLAN_ID_FIRST=0x0300, // Skip over reserved area IANS_OP_IVLAN_ID_GET_CAPABILITY, // Get VLan ID capabilities // BD fills struct: IANS_BD_PARAM_IVLAN_CAP IANS_OP_IVLAN_ID_SET_MODE, // Set Vlan ID mode // iANS fills struct: IANS_BD_PARAM_IVLAN_SET_MODE IANS_OP_IVLAN_ID_SET_TABLE, // ID list // iANS fills struct: IANS_BD_PARAM_IVLAN_TABLE IANS_OP_COMMA // Dummy to satisfy last ifdef'ed commma} IANS_BASE_OPCODE, *PIANS_BASE_OPCODE;/*--------------------------------------------------------------------* | Enumerated types for field values *--------------------------------------------------------------------*//*--------------------------------------------------------------------* | Enumerated types for Status struct field values *--------------------------------------------------------------------* | In every field, if a base driver doesn't support a valid indication | on that field it should set it to zero. This value was picked in | every enumerated type to denote "not supported" value. *--------------------------------------------------------------------*/// Used in IANS_BD_PARAM_STATUS.LinkStatustypedef enum _IANS_BD_LINK_STATUS { IANS_STATUS_LINK_NOT_SUPPORTED = 0, IANS_STATUS_LINK_OK, IANS_STATUS_LINK_FAIL} IANS_BD_LINK_STATUS, *PIANS_BD_LINK_STATUS;// Used in IANS_BD_PARAM_STATUS.Duplextypedef enum _IANS_BD_DUPLEX_STATUS { IANS_STATUS_DUPLEX_NOT_SUPPORTED = 0, IANS_STATUS_DUPLEX_HALF, IANS_STATUS_DUPLEX_FULL} IANS_BD_DUPLEX_STATUS, *PIANS_BD_DUPLEX_STATUS;// Used in IANS_BD_PARAM_STATUS.LinkSpeedtypedef enum _IANS_BD_LINK_SPEED { IANS_STATUS_LINK_SPEED_NOT_SUPPORTED = 0, IANS_STATUS_LINK_SPEED_1MBPS = 0x1, IANS_STATUS_LINK_SPEED_10MBPS = 0x2, IANS_STATUS_LINK_SPEED_100MBPS = 0x4, IANS_STATUS_LINK_SPEED_1000MBPS = 0x8, IANS_STATUS_LINK_SPEED_10000MBPS = 0x10}IANS_BD_LINK_SPEED, *PIANS_BD_LINK_SPEED;// Used in IANS_BD_PARAM_STATUS.HardwareFailuretypedef enum _IANS_BD_HW_STATUS { IANS_STATUS_HARDWARE_NOT_SUPPORTED = 0, IANS_STATUS_HARDWARE_OK, IANS_STATUS_HARDWARE_FAILURE} IANS_BD_HW_STATUS, *PIANS_BD_HW_STATUS;// Used in IANS_BD_PARAM_STATUS.DuringResetProcesstypedef enum _IANS_BD_RESET_STAGE { IANS_STATUS_RESET_NOT_SUPPORTED =0, IANS_STATUS_NOT_DURING_RESET, IANS_STATUS_DURING_RESET} IANS_BD_RESET_STAGE, *PIANS_BD_RESET_STAGE;// Used in IANS_BD_PARAM_STATUS.Suspendedtypedef enum _IANS_BD_SUSPENDED_STAGE { IANS_STATUS_SUSPENDED_NOT_SUPPORTED =0, IANS_STATUS_NOT_SUSPENDED, IANS_STATUS_SUSPENDED} IANS_BD_SUSPENDED_STAGE, *PIANS_BD_SUSPENDED_STAGE;// Rx and event notification routing mechanisms(bitmask ready)typedef enum _IANS_BD_ROUTING { IANS_ROUTING_NOT_SUPPORTED = 0x00, IANS_ROUTING_RX_PROTOCOL = 0x01,} IANS_BD_ROUTING, *PIANS_BD_ROUTING;typedef enum _IANS_BD_HOT_PLUG_STATUS { IANS_STATUS_HOT_PLUG_NOT_SUPPORTED = 0, IANS_STATUS_HOT_PLUG_NOT_DONE, IANS_STATUS_HOT_PLUG_WAS_DONE} IANS_BD_HOT_PLUG_STATUS, *PIANS_BD_HOT_PLUG_STATUS;/*--------------------------------------------------------------------* | Enumerated types for general structs field values *--------------------------------------------------------------------*/// general typedef for various features - whether BD supports a feature// or not. To be used on "capabilites" structstypedef enum _IANS_BD_SUPPORT { IANS_BD_DOES_NOT_SUPPORT = 0, IANS_BD_SUPPORTS} IANS_BD_SUPPORT, *PIANS_BD_SUPPORT;// general typedef for various features - whether iANS requests the BD// to support a feature or not. To be used on "set mode" structs.typedef enum _IANS_BD_REQUEST_SUPPORT { IANS_DONT_SUPPORT = 0, IANS_REQUEST_SUPPORT} IANS_BD_REQUEST_SUPPORT, *PIANS_BD_REQUEST_SUPPORT;/*--------------------------------------------------------------------* | Ioctl parameter structs | ======================= | The following structures are used by the different IOCTLs to pass | parameters between the Base driver and iANS. *--------------------------------------------------------------------*//*--------------------------------------------------------------------* | Common Command/Parameter Header | =============================== | The 1st field of every parameter struct. *--------------------------------------------------------------------*/typedef struct _IANS_BD_PARAM_HEADER { // Cast from IANS_BASE_OPCODE to insure forward size compatibility int Opcode;} IANS_BD_PARAM_HEADER, *PIANS_BD_PARAM_HEADER;/*--------------------------------------------------------------------* | Status result | ============= | This struct is sent with as a response to GET_STATUS request. | The status struct contains a version number : in case we will wish to | extend the status result, we will need a way to indicate which | version of the status struct we support. *--------------------------------------------------------------------*/#define IANS_STATUS_VERSION 0x00000001typedef struct _IANS_BD_PARAM_STATUS { UINT32 StatusVersion; // The version of this struct
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -