📄 ixethacccodelet.h
字号:
/** * @file IxEthAccCodelet.h * * @date 22 April 2002 * * @brief This file contains the interface for the Ethernet Access Codelet. * * * @par * IXP400 SW Release version 2.3 * * -- Copyright Notice -- * * @par * Copyright (c) 2001-2005, Intel Corporation. * All rights reserved. * * @par * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the Intel Corporation nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * * @par * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``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 THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * @par * -- End of Copyright Notice -- */#ifndef IXETHACCCODELET_H#define IXETHACCCODELET_H/** * @defgroup Codelets Intel (R) IXP400 Software Codelets * * @brief Intel (R) IXP400 Software EthAcc Codelet * * @{ *//** * @ingroup Codelets * * @defgroup IxEthAccCodelet Intel (R) IXP400 Software Ethernet Access Codelet (IxEthAccCodelet) API * * @brief Intel (R) IXP400 Software Ethernet Access Codelet API * * This codelet demonstrates both Ethernet Data and Control plane services and * Ethernet Management services. * <UL> * <LI> A) Ethernet Data and Control plane services: * <UL> * <LI> Configuring both ports as a receiver sink from an external source (such * as Smartbits). * <LI> Configuring Port-1 to automatically transmit frames and receive frames on Port-2. * Frames generated and transmitted in Port-1 are loopbacked into Port-2 by using cross cable. * <LI> Configuring and performing a software loopback on each of the two ethernet ports. * <LI> Configuring both ports to act as a bridge so that frames received on one port are retransmitted on the other. * </UL> * </UL> * * <UL> * <LI> B) Ethernet Management services: * <UL> * <LI> Adding and removing static/dynamic entries. * <LI> Calling the maintenance interface (shall be run as a separate background task) * <LI> Calling the show routine to display the MAC address filtering tables. * </UL> * </UL> * * <b> Definition </b><br> * In the context of this codelet, the following definitions are applicable.<br> * Port 1 = ixe0 = Ethernet port associated with NPE-B Ethernet Coprocessor.<br> * Port 2 = ixe1 = Ethernet port associated with NPE-C Ethernet Coprocessor.<br> * Port 3 = ixe2 = Ethernet port associated with NPE-A Ethernet Coprocessor.<br> * * <b> Design constraints </b><br> * This codelet assumes that the underlying Intel(R) IXP4XX Product Line of Network Processors * have two Ethernet NPEs. For silicon with single Ethernet NPE, operation will be only * functional in the particular Ethernet port that corresponds to the available Ethernet NPE. * Particularly, bridge operation will not work as two Ethernet ports are needed in this operation. * * <b> Assumptions </b><br> * This codelet illustrates the use EthAcc APIs. The operations provided may not be * working on the best performance as the target of this codelet is just to show the * functionality of APIs. In order to get better performance, #undef * IX_ETHACC_CODELET_TXGENRXSINK_VERIFY to disable traffic verification. <br> * * Please note that this codelet is not optimized for production quality. * * For performance testing, please use the operations below: * <UL> * <LI> Rx Sink Operation. * <LI> TxGenRxSink Operation. * <LI> Bridge Operation with Ethernet frames sent into either one of the Ethernet Ports. * </UL> * * The operations below need special tuning to optimize them. Tuning can be done by either * using a lower traffic(frames/second), reducing the value of IX_ETHACC_CODELET_TXGEN_PCKS * or #undef IX_ETHACC_CODELET_TXGENRXSINK_VERIFY. * <UL> * <LI> Software Loopback Operation. * <LI> PHY Loopback Operation. * <LI> Bridge Operation with Ethernet frames sent into both Ethernet Ports. * </UL> * * <b> VxWorks* User Guide </b><br> * ixEthAccCodeletMain() function is used as a single point of execution for * EthAcc Codelet. It allows user to enter selection for different type * of supported operations described below: * * <pre> * <i> Usage : * >ixEthAccCodeletMain (operationType,inPort,outPort) * Where operationType: * 1 = To sink received frames as fast as possible for available ports. * 2 = To software loopback received frames to the same port for available ports. * 3 = To generate and transmit frames from outPort, remote loopback by using * an external cross cable to inPort, and received on inPort (TxGenRxSink). * 4 = To generate frames and perform PHY loopback on the same port for available ports. * 5 = To transmit any frame received on inPort through outPort (Bridge). * 6 = To transmit any 802.1Q-tagged frame received on inPort through outPort, * using QoS (QoS Bridge) * 7 = To transmit frames received on inPort through outPort, provided * they meet the MAC address firewall criteria (Firewall Bridge) * 8 = To activate Ethernet MAC learning facility. * 9 = To transmit frames received on inPort through outPort, using * 802.3 <=> 802.11 frame header conversions for frames matching certain * MAC addresses * </i> * </pre> * * <b> Linux* User Guide </b><br> * The idea of using the ixEthAccCodeletMain() as a single point of execution for * EthAcc codelet. The operation selected will be executed when user issue 'insmod' * in command prompt. * * <pre> * <i> Usage : * >insmod ixp400_codelets_ethAcc.o operationType=<x> inPort=<y> outPort=<z> * Where x: * 1 = To sink received frames as fast as possible for available ports. * 2 = To software loopback received frames to the same port for available ports. * 3 = To generate and transmit frames from outPort (z), remote loopback by using * an external cross cable to inPort (y), and received on inPort (y) (TxGenRxSink). * 4 = To generate frames and perform PHY loopback on the same port for available ports. * 5 = To transmit any frame received on inPort (y) through outPort (z) (Bridge). * 6 = To transmit any 802.1Q-tagged frame received on inPort (y) through outPort (z), * using QoS (QoS Bridge) * 7 = To transmit frames received on inPort (y) through outPort (z), provided * they meet the MAC address firewall criteria (Firewall Bridge) * 8 = To activate Ethernet MAC learning facility. * 9 = To transmit frames received on inPort (y) through outPort (z), using * 802.3 <=> 802.11 frame header conversions for frames matching certain * MAC addresses * </i> * </pre> * * <b> WinCE User Guide </b><br> * The Ethernet Access Codelet uses serial console to print out menus and accept input from * users. Users need to choose and enter which operation to be executed from the menus. * * <pre> * <i> Usage : * Menu: Choose type of test you want to execute. * Options: * 1 = To sink received frames as fast as possible for available ports. * 2 = To software loopback received frames to the same port for available ports. * 3 = To generate and transmit frames from port 1, remote loopback by using * an external cross cable to port 2, and received on port 2 (TxGenRxSink). * 4 = To generate frames and perform PHY loopback on the same port for available ports. * 5 = To transmit any frame received on one port through the other one (Bridge). * 6 = To transmit any 802.1Q-tagged frame received on one port through the other * one, using QoS (QoS Bridge) * 7 = To transmit frames received on one port through the other port, provided * they meet the MAC address firewall criteria (Firewall Bridge) * 8 = To activate Ethernet MAC learning facility. * 9 = To transmit frames received on one port through the other port, using * 802.3 <=> 802.11 frame header conversions for frames matching certain * MAC addresses * 100 = Exit Ethernet Access codelet. * * </i> * </pre> * * <P> * <B>MAC Setup</B> * <P> * The default MAC setup will be: * <UL> * <LI>Promiscuous mode enabled (for learning example) * <LI>Frame Check Sequence appended for all frames generated on the XScale * </UL> * * <P> * <B>PHY Setup</B> * <P> * This codelet uses two PHYs as defined by IX_ETHACC_CODELET_MAX_PHY * The default PHY setup will be: * <UL> * <LI>100Mbits, * <LI>full duplex, * <LI>auto-negotiation on. * </UL> * * <P> * <B>Jumbo frames</B> * <P> * This codelet setup enable Jumbo frame reception * The default setup will be: * <UL> * <LI>frames up to a msdu size of 9018 are supported. * </UL> * * <P> * <B>Test Equipment</B> * <P> * The test harness will consist of external test equipment capable of * generating Ethernet packets (e.g. SmartBits). * <P> * The test equipment must be capable of performing at least the following * actions to support the scenarios outlined for the Codelet: * <UL> * <LI> Send/receive an Ethernet data stream. * <LI> Send/receive frames of different length. * <LI> Detect CRC errors. * <LI> Append FCS. * <LI> Support 100Mbit full duplex mode. * </UL> * * @{ */#include "IxOsal.h"#include "IxEthAcc.h"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -