Professional Documents
Culture Documents
SARL
SOFTWARE-UM
Users Manual
Version 0.95
July 2005
XALYO SYSTEMS
XALYO SYSTEMS
Table of contents
1
Overview............................................................................................................ 15
3.1 General description........................................................................................ 15
3.1.1
Highlights ......................................................................................................................... 15
3.1.2
Elementary Precautions................................................................................................... 15
3.1.3
Supported Features ......................................................................................................... 15
3.1.4
Features to be implemented ............................................................................................ 16
3.1.5
Driver Implementation...................................................................................................... 16
3.1.6
XSIO ................................................................................................................................ 17
3.1.6.1
Sending commands ................................................................................................ 17
3.1.6.2
Send data................................................................................................................ 17
3.1.6.3
Getting data............................................................................................................. 17
3.1.6.4
Getting PHY alarms ................................................................................................ 18
3.1.7
Performance consideration.............................................................................................. 18
VxWorks........................................................................................................................... 20
Linux ................................................................................................................................ 21
VxWorks........................................................................................................................... 22
Linux ................................................................................................................................ 23
6.1 Overview........................................................................................................ 25
Software description ........................................................................................ 26
7.1 Software model .............................................................................................. 26
7.1.1
7.1.2
7.1.3
Standalone....................................................................................................................... 28
VxWorks........................................................................................................................... 28
Linux ................................................................................................................................ 28
Drivers ............................................................................................................... 34
XALYO SYSTEMS
XALYO SYSTEMS
XALYO SYSTEMS
9
10
Bibliography...................................................................................................... 98
Glossary ......................................................................................................... 99
XALYO SYSTEMS
List of Tables
Figure 5-1: PCI Windows ..................................................................................................................................... 20
Figure 5-2: PCI window mapping code for sysLib.c ............................................................................................ 22
Figure 7-1: Standalone Software Model ............................................................................................................... 26
Figure 7-2: Split Software Model ......................................................................................................................... 27
Figure 7-3: NIC Software Model .......................................................................................................................... 27
Figure 8-1: Supported ioctls.................................................................................................................................. 36
Figure 8-2: xs_phy_init......................................................................................................................................... 37
Figure 8-3: xs_phy_info........................................................................................................................................ 37
Figure 8-4: xs_phy_loop ....................................................................................................................................... 37
Figure 8-5: xs_phy_is_loop................................................................................................................................... 38
Figure 8-6: xs_phy_enable.................................................................................................................................... 38
Figure 8-7: xs_phy_is_enabled ............................................................................................................................. 39
Figure 8-8: xs_phy_disable ................................................................................................................................... 39
Figure 8-9: xs_phy_status ..................................................................................................................................... 39
Figure 8-10: xs_phy_alarm ................................................................................................................................... 40
Figure 8-11: xs_phy_set_error .............................................................................................................................. 40
Figure 8-12: xs_phy_is_error................................................................................................................................ 41
Figure 8-13: xs_phy_clocking............................................................................................................................... 41
Figure 8-14: xs_phy_framing................................................................................................................................ 41
Figure 8-15: xs_phy_scramble.............................................................................................................................. 42
Figure 8-16: xs_phy_is_scrambled ....................................................................................................................... 42
Figure 8-17: xs_phy_write .................................................................................................................................... 42
Figure 8-18: xs_phy_read ..................................................................................................................................... 43
Figure 8-19: XS_PHY_CLOCKING .................................................................................................................... 43
Figure 8-20: XS_PHY_FRAMING ...................................................................................................................... 43
Figure 8-21: XS_PHY_FRACTION..................................................................................................................... 43
Figure 8-22: XS_SONET_SDH_STATS.............................................................................................................. 44
Figure 8-23: XS_TDM_STATS............................................................................................................................ 44
Figure 8-24: XS_PHY_STATS............................................................................................................................. 44
Figure 8-25: XS_PHY_STATUS.......................................................................................................................... 45
Figure 8-26: AAL5 to IP/UDP interworking example .......................................................................................... 53
Figure 8-27: Dynamic Ethernet/IP/UDP field update ........................................................................................... 53
Figure 8-28:ARP table example............................................................................................................................ 54
Figure 8-29: xsAtmBind ....................................................................................................................................... 55
Figure 8-30: xsAtmUnbind ................................................................................................................................... 55
Figure 8-31: xsAtmSend ....................................................................................................................................... 56
Figure 8-32: xsAtmSendBlock.............................................................................................................................. 56
Figure 8-33: xsAtmCallBack ................................................................................................................................ 57
Figure 8-34: xsAtmVcStats................................................................................................................................... 57
Figure 8-35: xsAtmDevStats................................................................................................................................. 57
Figure 8-36: xsAtmVersion................................................................................................................................... 58
Figure 8-37: xsAtmVersion................................................................................................................................... 58
Figure 8-38: xsAtmOamVPCreate ........................................................................................................................ 58
Figure 8-39: xsAtmOamVPDelete ........................................................................................................................ 59
Figure 8-40: xsAtmOamSend ............................................................................................................................... 59
Figure 8-41: xsAtmOamCallBack......................................................................................................................... 60
Figure 8-42: xsGetHwInfo .................................................................................................................................... 60
Figure 8-43: xsIwCreate........................................................................................................................................ 60
Figure 8-44: xsIwCreate........................................................................................................................................ 61
Figure 8-45: xsGenetEnablePort ........................................................................................................................... 61
Figure 8-46:xsGenetSend...................................................................................................................................... 62
Figure 8-47:xsGenetBlock .................................................................................................................................... 62
Figure 8-48:xsGenetCallBack............................................................................................................................... 63
Figure 8-49:xsPosStats.......................................................................................................................................... 64
Figure 8-50:xsGenetError ..................................................................................................................................... 64
Figure 8-51:xsGenetMacAdrs............................................................................................................................... 64
Figure 8-52:xsGenetReadPhy ............................................................................................................................... 65
Figure 8-53:xsGenetWritePhy .............................................................................................................................. 65
XALYO SYSTEMS
XALYO SYSTEMS
10
XALYO SYSTEMS
List of Examples
Example 5-1: Verifying XS1000 Presence on PCI ............................................................................................... 21
Example 5-2: Verifying XS1000 Presence on PCI ............................................................................................... 21
Example 5-3: Loading the driver object................................................................................................................ 23
Example 5-4: Starting the driver ........................................................................................................................... 23
Example 5-5: Verifying the creation of the device ............................................................................................... 23
Example 5-6: Loading the driver .......................................................................................................................... 23
Example 5-7: Loading the driver .......................................................................................................................... 24
Example 5-8: Verifying the module installation ................................................................................................... 24
Example 5-9: Verifying the driver installation with dmesg .................................................................................. 24
Example 7-1: Hello World Example..................................................................................................................... 28
Example 7-2: Hello World Makefile..................................................................................................................... 29
Example 7-3: Compiling and linking Hello World ............................................................................................... 30
Example 7-4: Loading all utilities to run Hello World.......................................................................................... 30
Example 7-5: Starting the driver and creating the device ..................................................................................... 30
Example 7-6: Connecting to the PCI console ....................................................................................................... 31
Example 7-7: Loading hello.exe in XS card host memory ................................................................................... 31
Example 7-8: Starting the driver ........................................................................................................................... 31
Example 7-9: Connecting to the PCI console ....................................................................................................... 32
Example 7-10: Loading hello.exe in XS card host memory ................................................................................. 32
Example 7-11: Running Hello World on XS card ................................................................................................ 33
XALYO SYSTEMS
11
1.2 Audience
It is assumed that the reader of this document is familiar with the C programming language and is
experimented installing new hardware and associated device drivers.
Cautions: indicates either potential damage to hardware or loss of data and tells you
how to avoid the problem.
Notes, hints and tips: indicates important information that helps you make better use
of your system
Program outputs of special interest are highlighted in green or red Courier New Bold
font.
Example:
-> xsDrv
xsInit: Found 1 XS1000 devices
Or
-> xsDrv
XS DRIVER ALREADY INSTALLED
12
XALYO SYSTEMS
Commands you have to enter are printed in Courier New Bold font.
Example: You may be instructed to type the following command:
XALYO SYSTEMS
13
2 Revision history
VERSION
0.95
14
DATE
July 18, 2005
CHANGES
Initial version, merged all previous software manuals
XALYO SYSTEMS
3 Overview
3.1 General description
3.1.1 Highlights
XS cards form a family of PCI Telecom Mezzanine Card (PTMC) which offers high-end ATM and IP
services. XS cards provide termination, switching and interworking capabilities.
As opposed to traditional Network Interface Cards (NIC), XS PMCs have on-board processing which
enable them to segment and reassemble ATM & IP traffic in the PMC memory rather than in host
memory.
Segmenting and reassembling data in host memory often causes the NIC to transfer very short
chunks of data (typically 48 bytes for ATM) on the PCI bus. This causes the PCI bus to be fully loaded
at relatively low rates (400 mbps).
Xalyo Systems has developed a mechanism to transfer data between the PMC and host CPU in a
very efficient way, even for minimal packet size.
This is explained later in this chapter.
We tried to keep the API as simple as possible to shorten the development time for our customers. If
you need more functionality, please contact Xalyo Systems.
This manual applies to driver version 1.54 and higher.
Xalyo Systems accepts no responsibility for failure, should these conditions not be respected.
Refer to the hardware manual corresponding to the card you are using for more details.
CPS
SSSAR
SSTED
AAL5 termination
OAM traffic termination
XALYO SYSTEMS
15
ATM switching
AAL2 switching
Bridging
IMA
SS7
Solaris support
libraries
The libraries run on the host CPU and provide the various APIs to the user. It is the interface
to the driver.
On VxWorks, the libraries are linked with the driver. On Linux, the libraries must be linked with
the user application.
driver
The driver runs in kernel space on the host CPU.
The driver packs and sends all commands to the PMC. The driver also gets and processes
events issued from the PMC. There are several driver flavors:
ATM
o Generic (AAL0, AAL2, AAL5, Gigabit Ethernet & Interworking)
o AAL1 (AAL0, AAL1, AAL2, AAL5)
POS
command server
The command server runs on the MIPS CPU on the PMC.
It gets command from the host CPU and executes them. The command server is linked with
WDDI and interfaces with the Network Processor.
16
XALYO SYSTEMS
3.1.6 XSIO
3.1.6.1
Sending commands
On the host:
When a command is issued (xsAtmBind(), xsAtmVcStats(), ), a buffer encoding the command type
and its argument is built and DMAed on the PMC.
The host then waits for a mailbox to be written by the PMC. This mailbox contains the result code of
the command. Optionally, the host will have to issue a DMA to get some parameter (like the
xsAtmVcStats_t structure) from the PMC. Eventually the call will end and the routine will return.
On the PMC:
The PMC is waiting for the end of the DMA containing the command. Then it executes the command
and writes the result in a mailbox.
The PMC is checking for command every millisecond.
3.1.6.2
Send data
On the host:
xsAtmSend() will copy the user buffer in a 1 Mbytes transmit buffer.
A 16 byte header is prepended to the buffer itself. This header encodes the channel id, the buffer size
and some internal parameters.
The call returns immediately and the user can re-use the buffer directly.
On the PMC:
Every millisecond the PMC will generate an interrupt to the host. This will cause the host to DMA the
transmit buffer in the PMC memory.
When the end of DMA is detected by the PMC, it will start and send all the frames in the buffer.
3.1.6.3
Getting data
On the PMC:
When frames are received by the PMC, they are copied and stored in a 1 Mbytes receive buffer on the
PMC. Every millisecond the PMC will transfer the received buffer in host memory with a DMA
transaction. If the receive buffer on the host is not yet available, the DMA is skipped and will be retried
at the next millisecond. If the receive buffer on the host is not free, and the receive buffer on the PMC
is full, all data in the PMC receive buffer will be discarded. A counter, rxSoftDrop, is incremented.
On the Host:
When the end of receive buffer DMA is detected by the host (interrupt), the host signals a semaphore.
A background task will take over and will call the user provided callback routine for each frame in the
buffer.
XALYO SYSTEMS
17
3.1.6.4
On the PMC:
When a PHY event occurs, the PMC writes a mailbox.
On the Host:
An interrupt is generated when the mailbox is written by the MIPS on the PMC. The interrupt signals a
semaphore and wakes up a thread in the driver. This thread will then execute and send commands to
read/write the PHY in order to find out the cause of the event and clear it.
18
XALYO SYSTEMS
#./configure
Which driver?
[atm/pos/aga] (pos):atm
Which OS?
[vxworks/linux] (vxworks):
Which Tornado host? [x86-win32/sun4-solaris2] (x86-win32):
Do you want to rebuild MIPS software [y/n] (n):
finished.
Now you can type `make`
The next step is to compile the driver which is simply done by typing make.
No warnings should be generated. Generally the Makefiles use the Werror flag which causes the
compiler to consider warnings as errors.
The driver is generated in the objects/<os>/x86/drv directory and is called xsDrv.
XALYO SYSTEMS
19
BASE
ADDRESS
REGISTER
0
1
2
3
4
5
OFFSET
WINDOW
0x10
0x14
0x18
0x1c
0x20
0x24
I2O
PowerSpanII
Host memory
WinPath
Parameter Memory
Packet Memory
DEFAULT
SIZE
256 KB
4 KB
16 MB
256 KB
16 MB
16 MB
Xalyo Systems was not member of PCI-SIG at the time when this manual was written. This
means that the PCI Vendor and Device ID are from Tundra Semiconductor. Xalyo Systems is in the
process of getting its own PCI Vendor and Device ID.
5.1.1 VxWorks
Example 5-1 shows how to verify that the card is seen on the PCI bus and how to get more
information about the PCI registers on a CPU running VxWorks:
-> pciDeviceShow 0
Scanning function 0
Using configuration
bus
device
00000000 00000000
00000000 00000001
00000000 00000007
00000000 00000010
00000000 00000011
00000000 00000012
00000000 00000013
value = 0 = 0x0
20
class
00000600
00040600
00010600
00800600
00800600
00000200
00000200
0x10e3
0x8261
0x0106
0x0230
0x01
0x06
0x80
XALYO SYSTEMS
programming interface =
cache line =
latency time =
header type =
BIST =
base address 0 =
base address 1 =
base address 2 =
base address 3 =
base address 4 =
base address 5 =
cardBus CIS pointer =
sub system vendor ID =
sub system ID =
expansion ROM base address =
interrupt line =
interrupt pin =
min Grant =
max Latency =
value = 0 = 0x0
0x00
0x08
0xff
0x00
0x00
0x50000008
0x41000000
0x42000008
0x43000000
0x44000008
0x45000008
0x00000000
0x4567
0x0001
0x00000000
0x05
0x01
0x00
0x00
5.1.2 Linux
Example 5-2 shows how to verify that the card is seen on the PCI bus and how to get more
information about the PCI registers on a CPU running Linux:
# cat /proc/pci
PCI devices found:
.
.
.
Bus 3, device
1, function 0:
Bridge: PCI device 10e3:8261 (Tundra Semiconductor Corp.) (rev 1).
IRQ 17.
Master Capable. Latency=32.
Prefetchable 32 bit memory at 0xdfec0000 [0xdfefffff].
Non-prefetchable 32 bit memory at 0xff9ff000 [0xff9fffff].
Prefetchable 32 bit memory at 0xde000000 [0xdeffffff].
Non-prefetchable 32 bit memory at 0xff980000 [0xff9bffff].
Prefetchable 32 bit memory at 0xdd000000 [0xddffffff].
Prefetchable 32 bit memory at 0xdc000000 [0xdcffffff].
.
.
.
Example 5-2: Verifying XS1000 Presence on PCI
Note that the mapping will be most likely different on your system.
XALYO SYSTEMS
21
5.2.1 VxWorks
VxWorks is not mapping the PCI windows and thus must be done early in the boot process. For this
purpose, the user shall copy/paste the following code at the end of the sysHwInit() function in sysLib.c
(in your boards BSP).
{
unsigned int i, bar, busNo, devNo, funcNo, adrs, size, tmp;
if(pciFindDevice(0x10E3, 0x8261, 0, &busNo, &devNo, &funcNo) != ERROR) {
for(bar=0; bar<6; bar++) {
pciConfigInLong(busNo,
devNo,
funcNo,
0x10 + 4 * bar,
&adrs);
/* Find size */
pciConfigOutLong(busNo,
devNo,
funcNo,
0x10 + 4 * bar,
0xffffffff);
pciConfigInLong(busNo,
devNo,
funcNo,
0x10 + 4 * bar,
&tmp);
pciConfigOutLong(busNo,
devNo,
funcNo,
0x10 + 4 * bar,
adrs);
size = 16;
for(i=4; i<32; i++)
{
if(tmp>>i & 0x000000001)
{
break;
}
size *= 2;
}
22
XALYO SYSTEMS
-> ld<PATH/XS/objects/vxworks/arch/drv/xsDrv
value = 534159208 = 0x1fd69f68
Example 5-3: Loading the driver object
Where PATH is the path where the XS directory lies on your server and arch is one of x86 or ppc.
Then launch the driver:
-> xsDrv
xsInit: Found XS-1000 device (device 0)
value = 0 = 0x0
Example 5-4: Starting the driver
-> iosDevShow
drv name
0 /null
1 /tyCo/0
1 /tyCo/1
2 /pcConsole/0
2 /pcConsole/1
7 host:
8 /pty/rlogin.S
9 /pty/rlogin.M
8 /pty/telnet.S
9 /pty/telnet.M
11 /vio
12 /dev/xs
value = 25 = 0x19
Example 5-5: Verifying the creation of the device
5.2.2 Linux
First go to the right directory and load the driver with the provided script:
# cd PATH/XS/objects/linux/arch/drv
# sh xsload.sh
Example 5-6: Loading the driver
where PATH is the path where the XS directory lies on your server and arch is one of x86 or ppc. You
can specify several options when starting the driver, for example set the debug level with:
XALYO SYSTEMS
23
# sh xsload.sh xsDebugLevel=4
Example 5-7: Loading the driver
The script installs the module and creates the device. This can be verified with:
# cat /proc/modules
xsDrv
soundcore
fglrx
.
.
.
246740
7044
188392
0 (unused)
0 (autoclean)
0
# cat /proc/devices
Character devices:
1 mem
2 pty
3 ttyp
4 ttyS
.
.
.
180 usb
226 drm
254 xs
.
.
.
Example 5-8: Verifying the module installation
and also by looking in /var/log/messages:
# dmsg
.
.
.
xsInit: Found XS-1000 device (device 0)
.
.
.
Example 5-9: Verifying the driver installation with dmesg
24
XALYO SYSTEMS
XALYO SYSTEMS
25
7 Software description
7.1 Software model
There are three software models for XS cards. We will present and discuss each software model in the
following sections.
26
XALYO SYSTEMS
See the specific sections below for more details on these modules.
XALYO SYSTEMS
27
7.2 Tools
7.2.1 Standalone
A complete suite of tools is available from MIPS to build applications for the on-board MIPS 5Kc.
WinMon and standalone applications can be built with these tools.
The tools can be downloaded at no charge from www.mips.com.
7.2.2 VxWorks
The supported version is be Tornado 2.2 / VxWorks 5.5.
Please contact Wind River for more details about Tornado and VxWorks:
www.wrs.com
7.2.3 Linux
Xalyo Systems is using Linux Montavista 2.1.
A Montavista Linux Preview kit is available at no charge at:
www.mvista.com/previewkit/index.html
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello World !\n\r");
return 0;
}
Example 7-1: Hello World Example
28
XALYO SYSTEMS
SET_PATH
XS_PATH
= PATH=/cygdrive/h/SDELite/sde5.03/bin:/bin;
= /cygdrive/w/projects/XS
CC
AS
CPP
= $(SET_PATH) sde-gcc
= $(SET_PATH) sde-as
= $(SET_PATH) sde-cpp
CFLAGS
AFLAGS
LDFLAGS
LINK_FILE
= $(XS_PATH)/winmon/target/mips/appl/link.xn
INCS
= -I$(XS_PATH)/winmon/include
C_OBJS
A_OBJS
OBJS
LIBS
=
=
=
=
HELLO
= hello.exe
hello.o
start.o
$(C_OBJS) $(A_OBJS)
$(XS_PATH)/winmon/lib/mips/libcsde.a
all: $(HELLO)
$(HELLO): $(OBJS)
$(CC) $(LDFLAGS) -o $(HELLO) -T $(LINK_FILE) $(OBJS) $(LIBS)
$(C_OBJS): %.o : %.c
$(CC) $(INCS) $(CFLAGS) -o $@ $<
$(A_OBJS): %.o : $(XS_PATH)/winmon/target/mips/appl/%.s
$(CPP) $(INCS) $< > $<.i
$(AS) -mips32 -o $@ $<.i
clean:
$(RM) *~ *.o $(OBJS)
clobber: clean
$(RM) $(HELLO)
Example 7-2: Hello World Makefile
#make
PATH=/cygdrive/h/SDELite/sde5.03/bin:/bin; sde-gcc -I/cygdrive/w/projects/
XS/winmon/include -c -mips32 -nostdinc -fno-builtin -Wall -Wno-main -o
hello.o hello.c
PATH=/cygdrive/h/SDELite/sde5.03/bin:/bin; sde-cpp -I/cygdrive/w/projects/
XS/winmon/include /cygdrive/w/projects/XS/winmon/target/mips/appl/start.s
> /cygdrive/w/projects/XS/winmon/target/mips/appl/start.s.i
PATH=/cygdrive/h/SDELite/sde5.03/bin:/bin; sde-as -mips32 -o start.o
/cygdrive/w/projects/XS/winmon/target/mips/appl/start.s.i
XALYO SYSTEMS
29
7.3.5.1 VxWorks
First load the driver and all the executables we will use:
-> ld<XS/objects/vxworks/x86/drv/xsDrv
value = 534159740 = 0x1fd6a17c
-> ld<XS/objects/vxworks/x86/bin/xsload
value = 534458364 = 0x1fdb2ffc = xsload_bss + 0x8
-> ld<XS/objects/vxworks/x86/bin/xsconsole
value = 534425980 = 0x1fdab17c = xsconsole_bss + 0xed8
Example 7-4: Loading all utilities to run Hello World
Then start the driver and create the device
-> xsDrv
xsInit: Found XS-1000 device (device 0)
value = 0 = 0x0
Example 7-5: Starting the driver and creating the device
Connect the PCI console to get the first free address. Note that the first free address wont change
until a new WinMon is loaded into Flash.
-> xsconsole
MIPS rebooted
30
XALYO SYSTEMS
@
@
@
@
200.0Mhz
100.0Mhz
100.0Mhz
66.666Mhz
7.3.5.2 Linux
Start the driver and create the device
# cd XS/objects/linux/x86/drv
# sh xsload.sh
Example 7-8: Starting the driver
Connect the PCI console to get the first free address. Note that the first free address wont change
until a new WinMon is loaded into Flash.
# XS/objects/linux/x86/bin/xsconsole
MIPS rebooted
XALYO SYSTEMS
31
@
@
@
@
200.0Mhz
100.0Mhz
100.0Mhz
66.666Mhz
-> xsconsole
WinMon>ld
Hit Cntl-C to exit
Found ELF header
32
XALYO SYSTEMS
Loading
Loading
Copying
Loading
Copying
Padding
Now jump and execute the loaded code. Note that by default go jumps to the start address of the code
weve just loaded, in this case 0x80200000.
WinMon>go
Hello World !
WinMon>
Example 7-11: Running Hello World on XS card
XALYO SYSTEMS
33
8 Drivers
8.1 Driver Overview
There are several driver modules available for VxWorks and Linux:
A set of functions is common to all drivers and these functions are described in the Generic Driver
section below.
The driver is split between the host processor and the MIPS processor on the PMC. Therefore, when
the driver is installing, it must load the software on the PMC memory and then instruct the MIPS
processor to start its execution. All the process produces some debug display if the driver is started
with a debug level higher than 3.
8.2.2 API
8.2.2.1
Driver API
All the commands to the driver are done through I/O Control (ioctl) commands:
34
XALYO SYSTEMS
VAL
UE
1
ARGUMENT
DESCRIPTION
XS_VAL_DESC
XS_EXEC_CMD
XS_EEPROM_READ
XS_EEPROM_BUF_DESC
XS_DMA_OP
XS_ENABLE_PHY_EVT
XS_GET_PHY_EVT
XS_GET_SERIAL_EVT
9
10
11
XS_PCIBOOT_FILE
12
XS_CONSOLE_WRITE
XS_CONSOLE_READ
XS_LOAD_FILE
XS_EEPROM_WRITE
XALYO SYSTEMS
35
XS_SFP_ENABLE_TX
XS_SFP_PRESENT
13
XS_VAL_DESC
14
XS_WPATH_GPIO
XS_TEST
XS_REFCLK_PRESENT
XS_SFP_READ
XS_SFP_FAULT
17
18
19
20
XS_WPATH_GPIO_DESC
(internal, not for user)
(internal, not for user)
XS_VAL_DESC
21
XS_SFP_LOS
22
XS_VAL_DESC
devNo: Device number
port: Port number
value: Result returned here
XS_US_TIMER
23
XS_NET_TIMER
24
8.2.2.2
Library API
8.2.2.2.1 xs_phy_init()
Name:
xs_phy_init
Synopsis:
#include <xsphy.h>
int xs_phy_init ( int devNo, int mode );
Description:
xs_phy_init initializes all physical ports on the specified PMC. Valid modes are:
PHY_MODE_NONE
36
XALYO SYSTEMS
PHY_MODE_ATM
PHY_MODE_POS
1
2
Returns:
N/A
Figure 8-2: xs_phy_init
8.2.2.2.2 xs_phy_info()
Name:
xs_phy_info
Synopsis:
#include <xsphy.h>
int xs_phy_info ( XS_PHY_STATS
int
int
int
*stats,
clear,
devno,
port );
Description:
xs_phy_info returns physical layer statistics for the specified port in the stats field.
If clear is set, statistics counters are cleared.
Returns:
0 on success, -1 on failure
8.2.2.2.3 xs_phy_loop()
Name:
xs_phy_loop
Synopsis:
#include <xsphy.h>
int xs_phy_loop ( int on,
int devno,
int port );
Description:
xs_phy_loop puts the specified PHY port in loopback mode if on is set. Valid values for on are:
LOOPBACK_DISABLED
DIAGNOSTIC_LOOPBACK
LINE_LOOPBACK
PARALLEL_DIAGNOSTIC_LOOPBACK
0
1
2
4
Returns:
0 on success, -1 on failure
Figure 8-4: xs_phy_loop
XALYO SYSTEMS
37
8.2.2.2.4 xs_phy_is_loop()
Name:
xs_phy_is_loop
Synopsis:
#include <xsphy.h>
int xs_phy_is_loop ( int devno,
int port );
Description:
xs_phy_is_loop tells if the port is in loopback mode or not.
Returns:
0 if loopback is disabled, 1 if loopback is enabled, -1 on failure.
Figure 8-5: xs_phy_is_loop
8.2.2.2.5 xs_phy_enable()
Name:
xs_phy_enable
Synopsis:
#include <xsphy.h>
int xs_phy_enable ( XS_PHY_STATUS id,
int
devno,
int
port );
Description:
xs_phy_enable enables the specified interrupt for the specified port.
Returns:
0 on success, -1 on failure
Figure 8-6: xs_phy_enable
8.2.2.2.6 xs_phy_is_enabled()
Name:
xs_phy_is_enabled
Synopsis:
#include <xsphy.h>
int xs_phy_is_enabled ( XS_PHY_STATUS id,
int
devno,
int
port );
Description:
xs_phy_is_enabled tells if the an interrupt is enabled on the specified port.
Returns:
0 if the interrupt is disabled, 1if the interrupt is enabled, -1 on failure.
38
XALYO SYSTEMS
8.2.2.2.7 xs_phy_disable()
Name:
xs_phy_disable
Synopsis:
#include <xsphy.h>
int xs_phy_disable ( XS_PHY_STATUS id,
int
devno,
int
port );
Description:
xs_phy_disable disables the specified interrupt for the specified port.
Returns:
0 on success, -1 on failure
Figure 8-8: xs_phy_disable
8.2.2.2.8 xs_phy_status()
Name:
xs_phy_status
Synopsis:
#include <xsphy.h>
int xs_phy_status ( XS_PHY_STATUS id,
int
devno,
int
port );
Description:
xs_phy_status returns the status of the specified port.
Returns:
0 if the status is OK, 1 if the status is NOT OK, -1 on failure
Figure 8-9: xs_phy_status
8.2.2.2.9 xs_phy_alarm()
Name:
xs_phy_alarm
Synopsis:
#include <xsphy.h>
int xs_phy_alarm ( void (*rtn)( XS_PHY_STATUS
XS_PHY_STATUS
int
int
XALYO SYSTEMS
id,
mask,
no,
port),
39
int
devno);
Description:
atmPhyAlarm registers a routine to be called on alarms.
- id encodes which sources are OK (0) or NOT OK (1).
- mask encodes which sources have caused the alarm to be raised.
- no indicates the device which caused the alarm to be raised.
- port indicates the port which caused the alarm to be raised.
The callback is called in the context of a thread which is started by the library when
xs_phy_init is called. When no callback is installed, the default handler does some printf to
show the PHY events.
Returns:
0 on success, -1 on failure
Figure 8-10: xs_phy_alarm
8.2.2.2.10
xs_phy_set_error()
Name:
xs_phy_set_error
Synopsis:
#include <xsphy.h>
int xs_phy_set_error ( XS_PHY_STATUS
int
int
int
id,
on,
devno,
port);
Description:
xs_phy_set_errors causes the specified error to be injected on the specified port
Returns:
0 on success, -1 on failure
Figure 8-11: xs_phy_set_error
8.2.2.2.11
xs_phy_is_error()
Name:
xs_phy_is_error
Synopsis:
#include <xsphy.h>
int xs_phy_is_error ( XS_PHY_STATUS id,
int
devno,
int
port );
Description:
xs_phy_is_error tells if an error is currently being injected on the specified port
40
XALYO SYSTEMS
Returns:
0 if the error is not injected, 1 if the error is injected, -1 on failure
Figure 8-12: xs_phy_is_error
8.2.2.2.12
xs_phy_clocking()
Name:
xs_phy_clocking
Synopsis:
#include <xsphy.h>
int xs_phy_clocking ( XS_PHY_CLOCKING clocking,
int
devno,
int
port );
Description:
xs_phy_clocking sets the port in the specified clocking mode.
Returns:
0 on success, -1 on failure
Figure 8-13: xs_phy_clocking
8.2.2.2.13
xs_phy_framing()
Name:
xs_phy_framing
Synopsis:
#include <xsphy.h>
int xs_phy_framing ( XS_PHY_FRAMING framing,
int
devno,
int
port );
Description:
xs_phy_framing sets the port in the specified framing mode.
Returns:
0 on success, -1 on failure
Figure 8-14: xs_phy_framing
8.2.2.2.14
xs_phy_scramble()
Name:
xs_phy_scramble
Synopsis:
#include <xsphy.h>
int xs_phy_scramble ( int on,
XALYO SYSTEMS
41
int devno,
int port );
Description:
xs_phy_scramble enables (on = 1) or disables (on = 0) cell payload scrambling (x^43 + 1) as
per ITU-T I.432 cell scrambling. By default cell payload scrambling is enabled.
Returns:
0 on success, -1 on failure
Figure 8-15: xs_phy_scramble
8.2.2.2.15
xs_phy_is_scrambled()
Name:
xs_phy_is_scrambled
Synopsis:
#include <xsphy.h>
int xs_phy_is_scrambled ( int devno,
int port );
Description:
xs_phy_is_scrambled tells if cell payload scrambling is enabled on the specified port.
Returns:
0 if scrambling is disabled, 1 if scrambling is enabled, -1 on failure.
Figure 8-16: xs_phy_is_scrambled
8.2.2.2.16
xs_phy_write()
Name:
xs_phy_write
Synopsis:
#include <xsphy.h>
int xs_phy_write ( int no,
int reg,
int val );
Description:
xs_phy_write writes the specified value in the specified PHY device register.
Returns:
0 on success, -1 on failure
Figure 8-17: xs_phy_write
8.2.2.2.17
xs_phy_read()
Name:
xs_phy_read
42
XALYO SYSTEMS
Synopsis:
#include <xsphy.h>
int xs_phy_read ( int no,
int reg,
int *val );
Description:
xs_phy_read returns the value of the specified PHY device register in val.
Returns:
0 on success, -1 on failure
Figure 8-18: xs_phy_read
8.2.2.2.18
Data structures
typedef enum {
CLOCK_LOCAL = 0,
CLOCK_FROM_SIGNAL
} XS_PHY_CLOCKING;
/* default
*/
typedef enum {
/* OC3 */
FRAMING_SDH
=
FRAMING_STM1
=
FRAMING_STM44C =
FRAMING_SONET,
FRAMING_STS3C =
FRAMING_STS12C =
FRAMING_E1,
FRAMING_T1,
FRAMING_J1
} XS_PHY_FRAMING;
0,
FRAMING_SDH,
FRAMING_SDH,
/* default
*/
FRAMING_SONET,
FRAMING_SONET,
typedef enum {
ATM_FRACTIONAL_FULL = 0,
ATM_FRACTIONAL_HALF,
ATM_FRACTIONAL_THREE_QUARTER
} XS_PHY_FRACTION;
/* default
*/
typedef struct {
unsigned int TX;
XALYO SYSTEMS
/* sent cells
*/
43
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
received cells
correctable header errors
uncorrectable header errors
section BIP errors (B1)
line overhead BIP errors (B2)
path overhead errors (B3)
line FEBE errors
path FEBE errors
POS Tx byte count
POS Rx byte count
POS Rx aborted frames
POS FCS errors
POS RX min length errors
POS RX max length errors
POS Tx user aborted frames
POS Tx underrun errors
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
typedef struct {
unsigned int TX;
unsigned int RX;
unsigned int CHCS;
unsigned int UHCS;
unsigned int LCV;
unsigned int EXZ;
unsigned int BER;
unsigned int PER;
unsigned int FEBE;
} XS_TDM_STATS;
/*
/*
/*
/*
/*
/*
/*
/*
/*
sent cells
received cells
correctable header errors
uncorrectable header errors
Line Code Violation count
Excessive Zeros count
Bit Error count
Parity Error count
FEBE errors
*/
*/
*/
*/
*/
*/
*/
*/
*/
typedef struct {
char
name[16];
int
ports;
XS_PHY_CLOCKING clocking;
XS_PHY_FRAMING framing;
XS_PHY_FRACTION fraction;
int
scrambled;
union {
XS_SONET_SDH_STATS sonet;
XS_TDM_STATS
tdm;
} link;
} XS_PHY_STATS;
/*
/*
/*
/*
/*
/*
Link name
Number of ports
Clocking type
Clocking type
Fraction of time slots
Scrambling
*/
*/
*/
*/
*/
*/
/* SONET/SDH statistics
/* TDM statistics
*/
*/
typedef enum {
PAIS=0,
PRDI,
PFEBE,
BER3,
44
/*
/*
/*
/*
Path
Path
path
Path
*/
*/
*/
*/
XALYO SYSTEMS
LAIS,
LRDI,
LFEBE,
BER2,
/*
/*
/*
/*
Line
Line
line
Line
*/
*/
*/
*/
BER1,
*/
AIS,
RAI,
RED,
/* Alarm Indication
/* Remote Alarm Indication
/* RED alarm
*/
*/
*/
LOCD,
LOP,
LOF,
LOS,
OOF,
OCD,
HEC,
FCS = HEC,
SDEG,
CRC = SDEG,
/*
/*
/*
/*
/*
/*
/*
/*
/*
*/
*/
*/
*/
*/
*/
*/
*/
*/
ROOL,
TOOL,
OVF,
OVR,
PAR,
TSOC,
MINLEN = TSOC,
MAXLEN,
RXABORT,
UDR,
FIFO
} XS_PHY_STATUS;
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
Rx Out of Lock
Tx Out of Lock
Rx FIFO Overflow
Tx FIFO Overrun
Parity Error
Transmit Start Of Cell
Minimum Length Error
Maximum Length Error
Rx Aborted Frame
Underrun Error
FIFO Error
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
8.2.4.1
xsmipsreset
XALYO SYSTEMS
45
DESCRIPTION:
xsmipsreset resets the MIPS CPU.
USAGE:
xsmipsreset [keep [devNo]]
devNo:
keep:
8.2.4.2
xsconsole
DESCRIPTION:
xsconsole is a utility which allows the user to have a console on the XS PMC on-board MIPS
through the PCI bus.
The PT4MC standards defines a physical console on the PT4MC connector, but in case the
user dont have a PT4CC carrier card with a physical console connected to the PT4MC,
xsconsole is a way to emulate the console over the PCI bus.
For this purpose, PowerSpanII mailboxes 7 and 6 are used to exchange characters from the
MIPS to the host CPU and from the host CPU to the MIPS respectively.
If the user has a PT4CC carrier card and want to use the real console instead of the PCI
emulated console, he must set the BOARD_CONSOLE WinMon environment variable to
UART. To revert to the PCI console, BOARD_CONSOLE should be set to PCI (default).
The console baud rate is 115200 bps.
Once in the xsconsole, the user shall type ~<CR> to exit.
USAGE:
xsconsole devNo
devNo:
8.2.4.3
Device number
xseepromdump
DESCRIPTION:
xseepromdump dumps a region of the WinPath or PowerSpanII I2C serial EEPROM.
USAGE:
46
XALYO SYSTEMS
Device number
eeprom_type:
Eeprom type
EEPROM_WPATH
EEPROM_PSPAN
0:
1:
WinPath EEPROM
PowerSpanII EEPROM
offset:
length:
8.2.4.4
xseepromread
DESCRIPTION:
xseepromread reads a byte from the WinPath or PowerSpanII I2C serial Eeprom.
USAGE:
xseepromread devNo eeprom_type offset
devNo:
Device number
eeprom_type:
Eeprom type
EEPROM_WPATH
EEPROM_PSPAN
offset:
8.2.4.5
0:
1:
WinPath EEPROM
PowerSpanII EEPROM
xseepromwrite
DESCRIPTION:
xseepromwrite writes a byte to the WinPath or PowerSpanII I2C serial Eeprom.
USAGE:
xseepromwrite devNo eeprom_type offset value
devNo:
Device number
eeprom_type:
Eeprom type
EEPROM_WPATH
XALYO SYSTEMS
0:
WinPath EEPROM
47
EEPROM_PSPAN
1:
PowerSpanII EEPROM
offset:
value:
8.2.4.6
xsload
DESCRIPTION:
xsload loads a file from to the XS card host memory. xsload doesnt interpret the file content
and the user can load any object type and even text files. xsload displays the size of the file it
has loaded.
USAGE:
xsload devNo filename offset
devNo:
Device number
filename:
offset:
8.2.4.7
xsusectimerget
DESCRIPTION:
xsusectimerget resturns the value of a 32 bit counter located on the PMC. The resolution of
the timer is 1 microsecond.
USAGE:
xsusectimerget
8.2.4.8
xsphymonitor
DESCRIPTION:
xsphymonitor is a menu driven application which inform the user
about the status of the physical links.
USAGE:
xsphymonitor
48
XALYO SYSTEMS
XALYO SYSTEMS
49
ATM termination:
o ATM Raw cells (AAL0)
o AAL1
o AAL2
o AAL5
o OAM
Standard driver
The standard driver has all the features excepted AAL1 capabilities. The standard driver is
based on the latest low level software from Wintegra, the network processor vendor.
AAL1 driver
The AAL1 driver supports AAL1, but doesnt support Gigabit Ethernet capabilities and
therefore doesnt support interworking. The AAL1 driver is based on a frozen release of the
low level software from Wintegra, the network processor vendor, and no updates are
available.
The AAL1 driver must be used on some old XS-155 cards as the network processor version
(WIN777HBC-200A1) doesnt support the newer software. The cards with this device have a
2004-078.2 PCB revision which can be read on the back of the cards.
To build the AAL1 driver, the user shall edit the .config file in the top level directory AFTER
executing the configure utility and uncomment the XS_AAL1=true line.
It is also possible to build a driver which contain both standard and AAL1 driver by uncommenting the XS_AAL1_COMBO=true line in .config. This is particularly useful for
customers having both old and new version of XS-155 cards. In this case the AAL1 driver will
be used for old cards and the standard driver will be used on regular (not old) cards. If the
user has a regular card and still wants to use the AAL1 driver, he must set
atmAAL1Driver = 1
either on the command line when installing the driver on Linux, or by setting the variable after
loading the driver but before calling xsDrv.
50
XALYO SYSTEMS
The packet memory has a capacity of 128 MB and is divided it in 31 K buffers of a little bit more than 4
KBytes.
These 31K buffers are divided in four pools as follows:
Number of Tx buffers:
Number of interworking buffers:
Number of short rings:
Number of large rings:
atmTxBufferNum
atmIwBufferNum
atmShortRingLen
atmLargeRingLen
If xsDebugLevel is set to a level higher than 3, the driver will display the buffer map when it installs.
Anyway the partitioning is checked at install time and the driver will complain and not install if the
values are not correct.
Here is an example:
atmTxBufferNum = 4096
atmIwBufferNum=4096
atmLargeRingLen = 128
atmShortRingLen = 2500
*************************************
*
ATM DRIVER Version 1.53
*
*
Jul 13 2005 15:12:09
*
* 2004 (c) Copyright Xalyo Systems *
*************************************
Short Ring: 2500 rings * 8 buffers =
Large Ring:
128 rings * 17 buffers =
Tx Bufers :
=
Iw Bufers :
=
Total
XALYO SYSTEMS
20000 buffers
2176 buffers
4096 buffers
4096 buffers
-------------30368 buffers
51
This setting will allow to have 2500 VC sending and receiving small PDUs (e.g. voice channels) and
128 channels sending and receiving any sized PDUs (e.g. signaling channels).
aal2CpsMaxCid
aal2CpsMaxSdu
aal2CpsTimerCu
tclass
pcr
scr
mbs
cdvt
rclass
8.3.4 Interworking
WinPath, the Network Processor, provides a rich and flexible interworking functionality, including
routing, MPLS, bridging, and direct mapping. This interworking functionality offers the capability to
convert layer 2 protocols to other layer 2 protocols based on layer 2/3/4 information, updating the layer
2 and layer 3 header information as required.
The interworking implementation in this driver supports the encapsulation of ATM frames and cells in
layer 4 packets (UDP/IP packets) over Gigabit Ethernet.
This type of interworking is especially useful to switch ATM traffic over an Ethernet backplane and
forward the ATM traffic to the appropriate line card, packet processor or DSP in the chassis (Typical
application: Radio Network Controller (RNC) for 3G networks)
Figure 8-26 shows the structure of the packet in the case of AAL5 to IP/UDP interworking:
52
XALYO SYSTEMS
XALYO SYSTEMS
53
Other types of interworking systems (L3 routing, L2 bridging) can be implemented on request. Please
refer to the WinPath documentation (www.wintegra.com) for an overview of the Network Processor
interworking capabilities.
8.3.5 ARP
An ARP server and ARP client have been implemented, mostly to be used when doing interworking.
When the user doesnt use interworking and connects the Ethernet port to the Operating Systems IP
stack, the Operating Systems ARP mechanism is used instead.
When doing interworking, it is requested to specify the destination Ethernet address on which the ATM
traffic has to be sent. In order to be more flexible, ARP can be used to get the Ethernet MAC address
corresponding to the provided IP address. Even in the case when the destination MAC address is
provided by the user (simple static configuration), it is necessary to use ARP if there is an Ethernet
switch between the send and the receiver, in order for the switch to learn the layer 2 addresses.
The user shall configure its ARP server and must populate the ARP entry with its own address.
Basically all IP addresses to which the interworking unit has to send ARP replies must be entered in
the ARP table with xsArpEntryAdd() along with the source interface, port and MAC address. These
added entries show up in the ARP table with the ARP_OWN flag. The resolved addresses are flagged
with the ARP_RESOLVED flag.
Note that at least one callback routine for packet reception must be installed for the ARP server to
work.
Here is an example of ARP table:
----------------------------------------------------------------dev
port
ip
mac
flag
----------------------------------------------------------------0
0 192.168.1.118 00:00:00:11:22:33
OWN
0
0 192.168.1.34 00:11:09:24:55:96
RESOLVED
----------------------------------------------------------------Figure 8-28:ARP table example
In this example, it is expected that the interworking unit will send ATM traffic over IP with the IP
address 192.168.1.118 and the MAC address 00:00:00:11:22:33. The user has added this entry in the
ARP table and shows up with the OWN flag.
Then an ARP request has been sent to 192.168.1.34, and the ARP table has been populated with the
target MAC address, 00:11:09:24:55:96. This entry shows up with the RESOLVED flag.
54
XALYO SYSTEMS
8.3.6 API
8.3.6.1
xsAtmBind()
Name:
xsAtmBind
Synopsis:
#include <xsAtm.h>
int xsAtmBind (xsAtmPvc_t *pvc);
Description:
xsAtmBind creates a virtual channel with the parameter specified in the xsAtmPvc_t structure.
Returns:
A channel identifier on success, a value < 0 on failure.
Figure 8-29: xsAtmBind
8.3.6.2
xsAtmUnbind()
Name:
xsAtmUnbind
Synopsis:
#include <xsAtm.h>
int xsAtmUnbind (int id);
Description:
xsAtmUnbind() deletes the virtual channel specified by its identifier id. xsAtmUnbind waits for
all frames transmitted on this channel to be sent on the media before closing the channel.
Returns:
0 on success, a value < 0 on failure.
Figure 8-30: xsAtmUnbind
8.3.6.3
xsAtmSend()
Name:
xsAtmSend
Synopsis:
#include <xsAtm.h>
int xsAtmSend (int id, char *buf, int len);
Description:
xsAtmSend() sends a buffer of the specified length on the virtual channel specified channel.
XALYO SYSTEMS
55
For ATM_RAW channels, the len parameters must contain the ATM cell header (without HEC)
as the length is implicitly set to 48 bytes.
Returns:
Number of bytes sent on success, a value < 0 on failure.
Figure 8-31: xsAtmSend
8.3.6.4
xsAtmSendBlock()
Name:
xsAtmSendBlock
Synopsis:
#include <xsAtm.h>
int xsAtmSendBlock (int id, int yesno);
Description:
xsAtmSendBlock() sets the channel in blocking or non-blocking mode for transmission. In
blocking mode, the driver does a sleeping wait on xsAtmSend() when there is no space in the
transmit buffer. In non-blocking mode, XsAtmSend() returns immediately with an error code
set to -XS_EWOULDBLOCK.
Returns:
0 on success, a value < 0 on failure.
Figure 8-32: xsAtmSendBlock
8.3.6.5
xsAtmCallBack()
Name:
xsAtmCallBack
Synopsis:
#include <xsAtm.h>
int xsAtmCallBack (int id,
int (*rxcb_rtn) (char *buf,
int len,
void *userArg,
unsigned int timestamp),
void *userArg);
Description:
xsAtmCallBack() installs a callback routine that will be called when a frame is received.
The callback routine is called with a pointer to the received buffer, the buffer length, a user
argument that is specified when xsAtmCallBack() is called and a timestamp. The timestamp is
in micresecond.
56
XALYO SYSTEMS
The callback routine shall return 0 and doesnt need to free the buffer. However the buffer is
freed by the driver when the callback routine returns. If the user needs the buffer content after
the callback routine returns, a copy shall be made.
Returns:
0 on success, a value < 0 on failure.
Figure 8-33: xsAtmCallBack
8.3.6.6
xsAtmVcStats()
Name:
xsAtmVcStats
Synopsis:
#include <xsAtm.h>
int xsAtmVcStats (int id, xsAtmVcStats_t *stats);
Description:
xsAtmVcStats() returns statistics about the specified channel in the xsAtmVcStats_t structure.
Returns:
0 on success, a value < 0 on failure.
Figure 8-34: xsAtmVcStats
8.3.6.7
xsAtmDevStats()
Name:
xsAtmDevStats
Synopsis:
#include <xsAtm.h>
int xsAtmDevStats (int device, xsAtmDevStats_t *stats);
Description:
xsAtmDevStats() returns statistics about the specified device in the xsAtmDevStats_t
structure.
Returns:
0 on success, a value < 0 on failure.
Figure 8-35: xsAtmDevStats
8.3.6.8
xsAtmVersion()
Name:
xsAtmVersion
XALYO SYSTEMS
57
Synopsis:
#include <xsAtm.h>
int xsAtmVersion (char *version);
Description:
xsAtmVersion() returns the version of the driver in the buffer pointed by version.
Returns:
0
Figure 8-36: xsAtmVersion
8.3.6.9
xsAtmError()
Name:
xsAtmError
Synopsis:
#include <xsAtm.h>
int xsAtmError (char *msg);
Description:
xsAtmError() displays the error type of the last error which occurred in the ATM driver. The
string msg is prefixed to the error message.
Returns:
0
Figure 8-37: xsAtmVersion
8.3.6.10 xsAtmOamVPCreate()
Name:
xsAtmOamVPCreate
Synopsis:
#include <xsAtm.h>
int xsAtmOamVPCreate (int device, int port, int vpi);
Description:
xsAtmOamVPCreate() must be called on a per VPI basis in order to send and receive OAM
F4 traffic. VCIs 3 and 4 are created on the specified VPI.
Returns:
0 on success, a value < 0 on failure.
8.3.6.11 xsAtmOamVPDelete()
58
XALYO SYSTEMS
Name:
xsAtmOamVPDelete
Synopsis:
#include <xsAtm.h>
int xsAtmOamVPDelete (int device, int port, int vpi);
Description:
xsAtmOamVPDelete() removes VCIs 3 and 4 from the specified VPI. OAM F4 traffic cant be
sent and received anymore.
Returns:
0 on success, a value < 0 on failure.
8.3.6.12 xsAtmOamSend()
Name:
xsAtmOamSend
Synopsis:
#include <xsAtm.h>
int xsAtmOamSend (xsOamType_t type,
int device,
int port,
int vpi,
int vci);
Description:
xsAtmOamSend() send an OAM cell of the specified type. Note that for OAM F4 flow, the VCI
is unused and will automatically be set to 3 or 4 according to the OAM cell type.
Returns:
0 on success, a value < 0 on failure.
8.3.6.13 xsAtmOamCallBack()
Name:
xsAtmOamCallBack
Synopsis:
#include <xsAtm.h>
int xsAtmOamCallBack (int (*rx) (xsOamType_t type,
int device,
int port,
int vpi,
XALYO SYSTEMS
59
int vci,
char *buf,
unsigned int tstamp);
Description:
xsAtmOamCallBack() install a callback routine which will be called upon OAM cell reception.
The OAM cell type, device, port, VPI, VCI and timestamp are provided. The entire cell is also
provided in a buffer. The callback shall return 0 and doesnt need to free any buffer.
Returns:
0 on success, a value < 0 on failure.
8.3.6.14 xsGetHwInfo()
Name:
xsGetHwInfo
Synopsis:
#include <xsAtm.h>
int xsGetHwInfo (int device, xsHwInfo_t *info);
Description:
xsGetHwInfo() returns some information about the hardware in the info structure.
Returns:
0 on success, a value < 0 on failure.
8.3.6.15 xsIwCreate()
Name:
xsIwCreate
Synopsis:
#include <xsAtm.h>
int xsIwCreate (xsAtmPvc_t *pvc, xsIPFlow_t *ipFlow);
Description:
xsIwCreate() creates an interworking channel.
Returns:
A channel id on success, a value < 0 on failure.
60
XALYO SYSTEMS
8.3.6.16 xsIwDelete()
Name:
xsIwDelete
Synopsis:
#include <xsAtm.h>
int xsIwDelete (int id);
Description:
xsIwDelete() deletes an interworking channel.
Returns:
0 on success, a value < 0 on failure.
8.3.6.17 xsGenetEnablePort()
Name: xsGenetEnablePort
Synopsis:
#include <xsGenet.h>
int xsGenetEnablePort ( int device, int port, int yesno );
Description:
xsGenetEnablePort() enables the traffic on the selected port of the selected PMC.
If yesno is set, the traffic can be sent and received.
If yesno is cleared, no traffic can be sent or received.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid
Figure 8-45: xsGenetEnablePort
8.3.6.18 xsGenetSend()
Name: xsGenetSend
Synopsis:
#include <xsGenet.h>
int xsGenetSend ( int device,
int port,
XALYO SYSTEMS
61
8.3.6.19 xsGenetBlock()
Name: xsGenetBlock
Synopsis:
#include <xsGenet.h>
int xsGenetBlock ( int device, int port, int yesno );
Description:
xsgenetBlock() sets the transmission on the selected port of the selected PMC in blocking or
non-blocking mode.
If yesno is set, the port is in blocking mode and the xsGenetSend() call will block until there is
enough space in the transmit queue.
If yesno is cleared, the port is set in non-blocking mode and the xsGenetSend() call will return
immediately with an error code if the transmit queue is full.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid
Figure 8-47:xsGenetBlock
8.3.6.20 xsGenetCallBack()
Name: xsGenetCallBack
62
XALYO SYSTEMS
Synopsis:
#include <xsPos.h>
int xsGenetCallBack ( int device,
int port,
int (*rxcb_rtn) ( unsigned char *buf,
int len,
void *userArg,
unsigned int tstamp ),
void *userArg );
Description:
xsGenetCallBack() installs a callback routine for the selected port of the selected PMC.
When the first callback is installed, a thread is created and blocks on a ioctl() to the driver until
One or more cells are received. Then the thread will call the user provided callback routine for
every received cell.
The user can specify a userArg when installing the callback.
The callback calls the user provided routine with the following arguments:
buf:
len:
userArg:
The callback routine shall return 0. The buffer is freed by the driver when the callback routine
Returns, meaning that the user shall copy the buffer if it is needed for further processing.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid,
-XS_ENOMEM if the thread fails to start
Figure 8-48:xsGenetCallBack
8.3.6.21 xsGenetStats()
Name: xsGenetStats
Synopsis:
#include <xsGenet.h>
int xsGenetStats ( int device, int port, xsGenetStats_t *stats );
Description:
xsGenetStats() returns statistics related to the selected port of the selected device.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid
XALYO SYSTEMS
63
Figure 8-49:xsPosStats
8.3.6.22 xsGenetError()
Name: xsGenetError
Synopsis:
#include <xsGenet.h>
int xsGenetError ( char *msg );
Description:
xsGenetError() displays a message regarding the last error. The msg string is prepended.
Returns:
0 on success,
-XS_EUNKNOWN if the last error cant be defined
Figure 8-50:xsGenetError
8.3.6.23 xsGenetMacAdrs()
Name: xsGenetMacAdrs
Synopsis:
#include <xsGenet.h>
int xsGenetMacAdrs ( int device, char *adrs );
Description:
xsGenetMacAdrs() returns the 6 byte Ethernet MAC address in the buffer pointed to by adrs.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
Figure 8-51:xsGenetMacAdrs
8.3.6.24 xsGenetReadPhy()
Name: xsGenetReadPhy
Synopsis:
#include <xsGenet.h>
int xsGenetReadPhy ( int device, int reg, unsigned int *pval );
64
XALYO SYSTEMS
Description:
xsGenetReadPhy() reads a register in the Ethernet PHY and returns its value in pval. Please
refer to the appropriate hardware manual from Marvell for a register description.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
Figure 8-52:xsGenetReadPhy
8.3.6.25 xsGenetWritePhy()
Name: xsGenetWritePhy
Synopsis:
#include <xsGenet.h>
int xsGenetWritePhy ( int device, int reg, unsigned int val );
Description:
xsGenetWritePhy() writes a register to the Ethernet PHY. Please refer to the appropriate
hardware manual from Marvell for a register description.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
Figure 8-53:xsGenetWritePhy
8.3.6.26 xsArpRequest()
Name: xsArpRequest
Synopsis:
#include <xsGenet.h>
int xsArpRequest ( unsigned int ipsrc, char *ethsrc,
unsigned int ipdst, char *ethdst );
Description:
xsArpRequest() sends an ARP request. The IP source, IP destination and Ethernet source
shall be provided. The Ethernet destination is returned in the ethdst field.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
Figure 8-54:xsArpRequest
XALYO SYSTEMS
65
8.3.6.27 xsArpTableGet()
Name: xsArpTableGet
Synopsis:
#include <xsGenet.h>
int xsArpTableGet ( xsArpTableEntry_t *entry, unsigned int flag );
Description:
xsArpTableGet() returns an entry from the ARP table in the xsArpTableEntry_t structure. The
table is accesses with two flags:
ARP_FIRST:
ARP_NEXT:
Returns:
0 on success,
-XS_ENOARP if there is no entry to return,
Figure 8-55:xsArpTableGet
8.3.6.28 xsArpEntryAdd()
Name: xsArpEntryAdd
Synopsis:
#include <xsGenet.h>
int xsArpEntryAdd ( unsigned int itf, unsigned int port, unsigned int ip,
unsigned char *eth );
Description:
xsArpEntryAdd() adds an entry in the ARP table. This entries added with xsArpEntryAdd()
specifies IP address to which the ARP server will reply and are flagged ARP_OWN in the ARP
table. Resolved entries are flagged ARP_RESOLVED.
Returns:
0 on success,
-XS_ENOARP if there is no entry to return,
Figure 8-56:xsArpEntryAdd
8.3.6.29 xsArpEntryDelete()
Name: xsArpEntryDelete
Synopsis:
#include <xsGenet.h>
66
XALYO SYSTEMS
8.3.6.30 Definitions
#define
#define
#define
#define
#define
#define
#define
#define
#define
ATM_AAL0
ATM_AAL1
ATM_AAL2
ATM_AAL4
ATM_AAL3
ATM_AAL34
ATM_AAL5
ATM_RAW
ATM_OAM
0
1
2
3
3
3
5
6
7
/*
/*
/*
/*
/*
/*
/*
/*
/*
AAL0
*/
AAL1 (CBR)
*/
AAL2 (VBR)
*/
AAL3/4 (data) -- Not available -- */
AAL3/4 (data) -- Not available -- */
AAL3/4 (data) -- Not available -- */
AAL5 (data)
*/
Raw ATM
*/
OAM cells
*/
#define
#define
#define
#define
AAL2_SSTED
AAL2_SSSAR
AAL2_CPS
AAL2_PF
2
1
0
0x8000
/*
/*
/*
/*
*/
*/
*/
*/
#define
#define
#define
#define
#define
ATM_NONE
ATM_UBR
ATM_CBR
ATM_VBR
ATM_ABR
0
1
2
3
4
/*
/*
/*
/*
/*
no traffic
Unspecified Bit Rate
Constant Bit Rate
Variable Bit Rate
Available Bit Rate
*/
*/
*/
*/
*/
#define
#define
#define
#define
ATM_MAX_AAL5_PDU
ATM_MAX_AAL2_PDU
ATM_MAX_AAL2_SSSAR_PDU
ATM_MAX_AAL2_CPS_PDU
#define
#define
#define
#define
#define
#define
#define
#define
#define
OC12_TS_PER_FRAME
OC3_TS_PER_FRAME
DS3_TS_PER_FRAME
E3_TS_PER_FRAME
J2_TS_PER_FRAME
E1_TS_PER_FRAME
T1_TS_PER_FRAME
J1_TS_PER_FRAME
DS0_TS_PER_FRAME
#define
#define
#define
#define
#define
OC12_MAX_CPS
OC3_MAX_CPS
DS3_MAX_CPS
E3_MAX_CPS
J2_MAX_CPS
XALYO SYSTEMS
65535
65535
65568
64
9360
2340
636
530
96
30
24
24
1
((8000
((8000
((8000
((8000
((8000
*
*
*
*
*
OC12_TS_PER_FRAME)
OC3_TS_PER_FRAME )
DS3_TS_PER_FRAME )
E3_TS_PER_FRAME )
J2_TS_PER_FRAME )
/
/
/
/
/
53)
53)
53)
53)
53)
67
#define
#define
#define
#define
E1_MAX_CPS
T1_MAX_CPS
J1_MAX_CPS
DS0_MAX_CPS
((8000
((8000
((8000
((8000
#define
#define
#define
#define
#define
XS_IW_ATM_OVER_ETH
XS_IW_ATM_OVER_IP
XS_IW_ATM_OVER_UDP
XS_IW_ETH_OVER_ATM
XS_IW_IP_OVER_ATM
0x01
0x02
0x03
0x04
0x05
*
*
*
*
E1_TS_PER_FRAME
T1_TS_PER_FRAME
J1_TS_PER_FRAME
DS0_TS_PER_FRAME
)
)
)
)
/
/
/
/
53)
53)
53)
53)
#define XS_IW_OPTIONS_NONE
0x00
#define XS_IW_OPTIONS_RAW_HEADER_REPLACE 0x01
#define
#define
#define
#define
ARP_FIRST
ARP_NEXT
ARP_RESOLVED
ARP_OWN
0x1212
0x1313
0xabab
0xbaba
Figure 8-58: ATM API Definitions
xsAtmPvc_t {
aal;
itf;
port;
vpi;
vci;
aal5MaxSdu;
aal2SubLayer;
aal2CpsCid;
aal2CpsMaxCid;
aal2CpsMaxSdu;
aal2CpsTimerCu;
aal2SssarMaxSdu;
aal2SssarRasTimer;
tclass;
pcr;
scr;
mbs;
cdvt;
rclass;
aal1RxBufferSize;
iwOptions;
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
68
//
//
//
//
//
Interface number
Port number
IW type (XS_IW_ATM_OVER_UDP)
Src ETH MAC address
Dst ETH MAC address
XALYO SYSTEMS
unsigned short
unsigned int
unsigned int
unsigned char
unsigned short
unsigned short
} xsIPFlow_t;
ethprotocol;
ipsrc;
ipdst;
ipprotocol;
udpsrc;
udpdst;
//
//
//
//
//
//
//
//
//
//
//
//
//
Interface number
Port number
IP address
ETH MAC address
ARP_OWN or ARP_RESOLVED
Valid if non zero
XALYO SYSTEMS
69
typedef struct
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
70
xsIwStats_t{
a2e_forward_packet;
a2e_fbp_drop_packets;
a2e_mtu_drop_packets;
a2e_ttl_drop_packets;
a2e_tx_queue_drop_packets;
a2e_mpls_drop;
a2e_denied_packets;
a2e_group_filtered_packets;
a2e_forwarded_bytes;
a2e_gtp_bad_headers;
a2e_policer_non_conforming_packets;
e2a_forward_packet;
e2a_fbp_drop_packets;
XALYO SYSTEMS
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
} xsIwStats_t;
e2a_mtu_drop_packets;
e2a_ttl_drop_packets;
e2a_tx_queue_drop_packets;
e2a_mpls_drop;
e2a_denied_packets;
e2a_group_filtered_packets;
e2a_forwarded_bytes;
e2a_gtp_bad_headers;
e2a_policer_non_conforming_packets;
//
//
//
//
//
//
//
//
//
//
XALYO SYSTEMS
// Device name
71
// Number of ports
typedef struct
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
unsigned int
72
xsGenetStats_t {
txrx_frames_64;
txrx_frames_127;
txrx_frames_255;
txrx_frames_511;
txrx_frames_1023;
txrx_frames_1518;
txrx_frames_1522;
rx_bytes;
rx_packets;
rx_err_fcs;
rx_multicast;
rx_broadcast;
rx_mac_control;
rx_mac_pause;
rx_mac_unknown;
rx_err_alignment;
rx_err_length;
rx_err_code;
rx_false_carrier;
rx_undersize;
rx_oversize;
rx_fragments;
rx_jabber;
rx_dropped;
tx_bytes;
tx_packets;
tx_multicast;
tx_broadcast;
tx_mac_pause;
tx_defer;
tx_excess_defer;
tx_single_collision;
tx_multi_collision;
tx_late_collision;
tx_excess_collision;
tx_no_collision;
tx_mac_pause_honored;
tx_dropped;
tx_jabber;
tx_err_fcs;
tx_control;
tx_oversize;
tx_undersize;
tx_fragments;
rx_host_frames;
rx_iw_frames;
rx_err_host_full;
rx_err_fbp_underrun;
rx_err_nonvalid_mac;
rx_err_mru;
rx_err_sdu;
XALYO SYSTEMS
typedef enum {
OAM_F4_EOE_AIS = 0,
OAM_F4_EOE_RDI,
OAM_F4_EOE_LOOP,
OAM_F4_EOE_PM_ACT_128,
OAM_F4_EOE_PM_ACT_256,
OAM_F4_EOE_PM_ACT_512,
OAM_F4_EOE_PM_ACT_1024,
OAM_F4_EOE_PM_ACTCONF_128,
OAM_F4_EOE_PM_ACTCONF_256,
OAM_F4_EOE_PM_ACTCONF_512,
OAM_F4_EOE_PM_ACTCONF_1024,
OAM_F4_EOE_PM_ACTDENY,
OAM_F4_EOE_PM_DEACT,
OAM_F4_EOE_PM_DEACTCONF,
OAM_F4_EOE_PM_DEACTDENY,
OAM_F4_EOE_CC_ACT,
OAM_F4_EOE_CC_ACTCONF,
OAM_F4_EOE_CC_ACTDENY,
OAM_F4_EOE_CC_DEACT,
OAM_F4_EOE_CC_DEACTCONF,
OAM_F4_EOE_CC_DEACTDENY,
OAM_F4_SEG_AIS, /* 0x15 */
OAM_F4_SEG_RDI,
OAM_F4_SEG_LOOP,
OAM_F4_SEG_PM_ACT_128,
OAM_F4_SEG_PM_ACT_256,
OAM_F4_SEG_PM_ACT_512,
OAM_F4_SEG_PM_ACT_1024,
OAM_F4_SEG_PM_ACTCONF_128,
OAM_F4_SEG_PM_ACTCONF_256,
OAM_F4_SEG_PM_ACTCONF_512,
OAM_F4_SEG_PM_ACTCONF_1024,
OAM_F4_SEG_PM_ACTDENY,
OAM_F4_SEG_PM_DEACT,
OAM_F4_SEG_PM_DEACTCONF,
OAM_F4_SEG_PM_DEACTDENY,
XALYO SYSTEMS
73
OAM_F4_SEG_CC_ACT,
OAM_F4_SEG_CC_ACTCONF,
OAM_F4_SEG_CC_ACTDENY,
OAM_F4_SEG_CC_DEACT,
OAM_F4_SEG_CC_DEACTCONF,
OAM_F4_SEG_CC_DEACTDENY,
OAM_F5_EOE_AIS, /* 0x2a */
OAM_F5_EOE_RDI,
OAM_F5_EOE_LOOP,
OAM_F5_EOE_PM_ACT_128,
OAM_F5_EOE_PM_ACT_256,
OAM_F5_EOE_PM_ACT_512,
OAM_F5_EOE_PM_ACT_1024,
OAM_F5_EOE_PM_ACTCONF_128,
OAM_F5_EOE_PM_ACTCONF_256,
OAM_F5_EOE_PM_ACTCONF_512,
OAM_F5_EOE_PM_ACTCONF_1024,
OAM_F5_EOE_PM_ACTDENY,
OAM_F5_EOE_PM_DEACT,
OAM_F5_EOE_PM_DEACTCONF,
OAM_F5_EOE_PM_DEACTDENY,
OAM_F5_EOE_CC_ACT,
OAM_F5_EOE_CC_ACTCONF,
OAM_F5_EOE_CC_ACTDENY,
OAM_F5_EOE_CC_DEACT,
OAM_F5_EOE_CC_DEACTCONF,
OAM_F5_EOE_CC_DEACTDENY,
OAM_F5_SEG_AIS, /* 0x3f */
OAM_F5_SEG_RDI,
OAM_F5_SEG_LOOP,
OAM_F5_SEG_PM_ACT_128,
OAM_F5_SEG_PM_ACT_256,
OAM_F5_SEG_PM_ACT_512,
OAM_F5_SEG_PM_ACT_1024,
OAM_F5_SEG_PM_ACTCONF_128,
OAM_F5_SEG_PM_ACTCONF_256,
OAM_F5_SEG_PM_ACTCONF_512,
OAM_F5_SEG_PM_ACTCONF_1024,
OAM_F5_SEG_PM_ACTDENY,
OAM_F5_SEG_PM_DEACT,
OAM_F5_SEG_PM_DEACTCONF,
OAM_F5_SEG_PM_DEACTDENY,
OAM_F5_SEG_CC_ACT,
OAM_F5_SEG_CC_ACTCONF,
OAM_F5_SEG_CC_ACTDENY,
OAM_F5_SEG_CC_DEACT,
OAM_F5_SEG_CC_DEACTCONF,
OAM_F5_SEG_CC_DEACTDENY,
OAM_USER,
OAM_UNKNOWN, /* 0x55 */
OAM_F4_SEG_FM_CC,
OAM_F4_SEG_PM_FM,
OAM_F4_SEG_PM_BR,
OAM_F4_SEG_PM_MR,
OAM_F4_SEG_AD_PM,
OAM_F4_SEG_AD_CC,
OAM_F4_EOE_FM_CC,
OAM_F4_EOE_PM_FM,
OAM_F4_EOE_PM_BR,
OAM_F4_EOE_PM_MR,
OAM_F4_EOE_AD_PM,
74
XALYO SYSTEMS
OAM_F4_EOE_AD_CC,
OAM_F5_SEG_FM_CC,
OAM_F5_SEG_PM_FM,
OAM_F5_SEG_PM_BR,
OAM_F5_SEG_PM_MR,
OAM_F5_SEG_AD_PM,
OAM_F5_SEG_AD_CC,
OAM_F5_EOE_FM_CC,
OAM_F5_EOE_PM_FM,
OAM_F5_EOE_PM_BR,
OAM_F5_EOE_PM_MR,
OAM_F5_EOE_AD_PM,
OAM_F5_EOE_AD_CC
} xsOamType_t;
Figure 8-76: xsOamType_t
8.3.6.32 Globals
extern
extern
extern
extern
extern
extern
extern
extern
int atmUUIValueAAL2;
int atmUUIValueAAL5;
int atmTxBufferNum;
int atmShortRingLen;
int atmLargeRingLen;
int atmIwBufferNum;
int atmAAL1Driver;
char *ethMedia;
atmUUIValueAAL2:
atmUUIValueAAL5:
atmTxBufferNum:
atmShortRingLen:
atmLargeRingLen:
atmIwBufferNum:
XALYO SYSTEMS
75
ethMedia:
atmAAL1Driver:
8.3.8.1
send_aal1
DESCRIPTION:
send_aal1 sends AAL1 frames
USAGE:
send_aal1 itf port vpi vci size iter [rate]
itf:
Device number
port:
port number
vpi:
VPI
vci:
VCI
size:
packet size
iter:
rate:
8.3.8.2
send_aal2
DESCRIPTION:
send_aal2 sends AAL2 frames.
USAGE:
send_aal2 itf port vpi vci size iter [rate [tCU [subLayer]]]
76
itf:
Device number
port:
port number
XALYO SYSTEMS
vpi:
VPI
vci:
VCI
size:
packet size
iter:
rate:
tCU:
timerCU in microseconds
subLayer:
8.3.8.3
send_aal5
DESCRIPTION:
send_aal5 sends AAL5 frames.
USAGE:
send_aal5 itf port vpi vci size iter [rate]
itf:
Device number
port:
port number
vpi:
VPI
vci:
VCI
size:
packet size
iter:
rate:
8.3.8.4
send_raw
DESCRIPTION:
send_raw sends raw ATM cells
USAGE:
XALYO SYSTEMS
77
Device number
port:
port number
header:
iter:
rate:
8.3.8.5
send_oam
DESCRIPTION:
send_oam sends raw ATM cells
USAGE:
send_oam itf port vpi vci type iter createVP createVC
78
itf:
Device number
port:
port number
vpi:
VPI
vci:
VCI
type:
OAM type:
0 :
1 :
2 :
3 :
4 :
5 :
6 :
7 :
8 :
9 :
10 :
11 :
F4
F4
F4
F4
F4
F4
F5
F5
F5
F5
F5
F5
OAM
OAM
OAM
OAM
OAM
OAM
OAM
OAM
OAM
OAM
OAM
OAM
SEGMENT AIS
SEGMENT RDI
SEGMENT LOOP
END_TO_END AIS
END_TO_END RDI
END_TO_END LOOP
SEGMENT AIS
SEGMENT RDI
SEGMENT LOOP
END_TO_END AIS
END_TO_END RDI
END_TO_END LOOP
iter:
createVP:
createVC:
XALYO SYSTEMS
8.3.8.6
receive_aal1
DESCRIPTION:
receive_aal1 receives AAL1 frames
USAGE:
receive_aal1 itf port vpi vci iter [rxBufferSize]
itf:
Device number
port:
port number
vpi:
VPI
vci:
VCI
iter:
rxBufferSize:
8.3.8.7
receive_aal2
DESCRIPTION:
receive_aal2 receives AAL2 frames.
USAGE:
receive_aal2 itf port vpi vci iter [subLayer]
itf:
Device number
port:
port number
vpi:
VPI
vci:
VCI
iter:
subLayer:
XALYO SYSTEMS
79
8.3.8.8
receive_aal5
DESCRIPTION:
receive_aal5 receives AAL5 frames.
USAGE:
receive_aal5 itf port vpi vci iter
itf:
Device number
port:
port number
vpi:
VPI
vci:
VCI
iter:
8.3.8.9
receive_raw
DESCRIPTION:
receive_raw receives raw ATM cells
USAGE:
receive_raw itf port vpi vci iter
itf:
Device number
port:
port number
vpi:
VPI
vci:
VCI
iter:
80
XALYO SYSTEMS
8.3.8.10 receive_oam
DESCRIPTION:
receive_oam receives OAM cells
USAGE:
receive_oam itf port vpi vci type iter createVP createVC
itf:
Device number
port:
port number
vpi:
VPI
vci:
VCI
iter:
createVP:
createVC:
8.3.8.11 xsatmmonitor
DESCRIPTION:
xsatmmonitor is a menu driven utility who reports various statistics about interfaces and
chanels.
USAGE:
xsatmmonitor [menu_option]
menu_option:
8.3.8.12 perf_aal2
DESCRIPTION:
XALYO SYSTEMS
81
perf_aal2 sends and receives traffic on several VCs and CIDs and measures the full duplex
rate.
USAGE:
perf_aal2 itf port vpi vci size iter rate timerCU channels
cid_per_vc [sublayer]
itf:
port:
vpi:
VPI (eg 1)
vci:
size:
iter:
rate:
timerCU:
channels:
cid_per_vc:
subLayer:
8.3.8.13 get_hw_info
DESCRIPTION:
get_hw_info retrieves some info about the hardware (name, serial, revision, date code) and
displays it.
USAGE:
get_hw_info itf
itf:
8.3.8.14 genet_send
82
XALYO SYSTEMS
DESCRIPTION:
genet_send sends Ethernet frames
USAGE:
send_aal2 itf port size iter
itf:
Device number
port:
port number
size:
packet size
iter:
8.3.8.15 genet_receive
DESCRIPTION:
genet_receive receives Ethernet frames
USAGE:
genet_receive itf port iter
itf:
Device number
port:
port number
iter:
8.3.8.16 genet_monitor
DESCRIPTION:
genet_monitor is a menu driver utility which reports statistics and link status
USAGE:
genet_monitor
Figure 8-93: genet_monitor
XALYO SYSTEMS
83
8.3.8.17 genet_tap
DESCRIPTION:
LINUX ONLY
genet_tap is a TAP driver which connects the Ethernet port to the Linux IP stack. Once the
port is connected, dont use the Ethernet port directly (xsGenetSend(), Genet callback), but
only use Linux IP stack.
USAGE:
genet_tap device
device:
Device number
Figure 8-94: genet_tap
8.3.8.18 xsarpmonitor
DESCRIPTION:
xsarpmonitor is a menu driven utility which sends ARP request,
queries the ARP table and adds/deletes ARP entries.
USAGE:
xsarpmonitor
Figure 8-95: xsarpmonitor
8.3.8.19 xsiwcreate
DESCRIPTION:
xsiwcreate is a menu driven utility which creates interworking
channels.
USAGE:
xsiwcreate
Figure 8-96: xsiwcreate
84
XALYO SYSTEMS
8.4.2 API
8.4.2.1
xsPosEnablePmc()
Name: xsPosEnablePmc
Synopsis:
#include <xsPos.h>
int xsPosEnablePmc ( int device, int yesno );
Description:
xsPosEnablePmc() enables the traffic on the selected PMC.
If yesno is set, the traffic can be sent and received.
If yesno is cleared, no traffic can be sent or received.
Returns:
0 on success or -XS_ENODEV if device is invalid
Figure 8-97:xsPosEnablePmc
8.4.2.2
xsPosEnablePort()
Name: xsPosEnablePort
Synopsis:
#include <xsPos.h>
int xsPosEnablePort ( int device, int port, int yesno );
Description:
xsPosEnablePort() enables the traffic on the selected port of the selected PMC.
If yesno is set, the traffic can be sent and received.
If yesno is cleared, no traffic can be sent or received.
Returns:
0 on success,
XALYO SYSTEMS
85
8.4.2.3
xsPosSend()
Name: xsPosSend
Synopsis:
#include <xsPos.h>
int xsPosSend ( int device,
int port,
unsigned char *buf,
int len );
Description:
xsPosSend() sends a POS packet on the selected port of the selected device. The device
and port shall be enabled prior to calling xsPosEnablePort().
buf is a pointer to the packet
len is the size of the packet
Returns:
48 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid,
-XS_ENOTCONN if the PMC and/or port is not enabled,
-XS_EWOULDBLOCK if the transmit queue is full and the port is send in non-blocking mode
-XS_EFAULT if the address of the buffer causes an address violation
Figure 8-99:xsPosSend
8.4.2.4
xsPosBlock()
Name: xsPosBlock
Synopsis:
#include <xsPos.h>
int xsPosBlock ( int device, int port, int yesno );
Description:
xsPosBlock() sets the transmission on the selected port of the selected PMC in blocking or
non-blocking mode.
If yesno is set, the port is in blocking mode and the xsPosSend() call will block until there is
enough space in the transmit queue.
If yesno is cleared, the port is set in non-blocking mode and the xsPosSend() call will return
86
XALYO SYSTEMS
8.4.2.5
xsPosCallBack()
Name: xsPosCallBack
Synopsis:
#include <xsPos.h>
int xsPosCallBack ( int device,
int port,
int (*rxcb_rtn) ( unsigned char *buf,
int len,
void *userArg ),
void *userArg );
Description:
xsPosCallBack() installs a callback routine for the selected port of the selected PMC.
When the first callback is installed, a thread is created and blocks on a ioctl() to the driver until
One or more cells are received. Then the thread will call the user provided callback routine for
every received cell.
The user can specify a userArg when installing the callback.
The callback calls the user provided routine with the following arguments:
buf:
len:
userArg:
The callback routine shall return 0. The buffer is freed by the driver when the callback routine
Returns, meaning that the user shall copy the buffer if it is needed for further processing.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid,
-XS_ENOMEM if the thread fails to start
Figure 8-101:xsPosCallBack
8.4.2.6
xsPosStats()
Name: xsPosStats
XALYO SYSTEMS
87
Synopsis:
#include <xsPos.h>
int xsPosStats ( int device, int port, xsPosStats_t *stats );
Description:
xsPosStats() returns statistics related to the selected port of the selected device.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid
Figure 8-102:xsPosStats
8.4.2.7
xsPosError()
Name: xsPosError
Synopsis:
#include <xsPos.h>
int xsPosError ( char *msg );
Description:
xsPosError() displays a message regarding the last error. The msg string is prepended.
Returns:
0 on success,
-XS_EUNKNOWN if the last error cant be defined
Figure 8-103:xsPosError
8.4.2.8
POS structures
typedef struct
unsigned
unsigned
unsigned
unsigned
unsigned
unsigned
unsigned
unsigned
unsigned
unsigned
unsigned
unsigned
88
xsPosStats_t {
int rx_frames;
int tx_frames;
int rx_err_crc;
int rx_err_phy;
int rx_err_addr_mismatch;
int rx_err_buffer_overrun;
int rx_err_overrun;
int
int
int
int
int
//
//
//
//
//
//
//
rx_err_sop_eop;
//
rx_err_parity;
//
rx_err_iw_buffer_underrun;//
rx_err_iw_mru;
//
rx_hard_drops;
//
Received frames
Transmitted frames
CRC errors
POS-PHY protocol violations
HDLC address mismatch
Buffer overruns
Frames discarded due to
buffer overrun
Start/End of packet errors
Parity errors
Not used yet
Not used yet
Number of cells dropped by
the hardware (lack of
XALYO SYSTEMS
buffer)
// Number of cells dropped by
the software (lack of CPU
time)
} xsPosStats_t;
Figure 8-104:Structures
8.4.2.9
POS globals
int xsPosErrno;
8.4.4.1
pos_send
DESCRIPTION:
pos_send sends POS packets
USAGE:
pos_send device port size iterations
device:
Device number
port:
port number
size:
packet size
iterations:
8.4.4.2
pos_receive
DESCRIPTION:
pos_receive waits and receives POS packets
XALYO SYSTEMS
89
USAGE:
pos_receive device port iterations
device:
Device number
port:
port number
iterations:
8.4.4.3
pos_monitor
DESCRIPTION:
pos_monitor displays statistics about a POS port
USAGE:
pos_monitor device port
device:
Device number
port:
port number
Figure 8-108: pos_monitor
90
XALYO SYSTEMS
8.5.2 API
8.5.2.1
xsAgaEnablePmc()
Name: xsAgaEnablePmc
Synopsis:
#include <xsAga.h>
int xsAgaEnablePmc ( int device, int yesno );
Description:
xsAgaEnablePmc() enables the traffic on the selected PMC.
If yesno is set, the traffic can be sent and received.
If yesno is cleared, no traffic can be sent or received.
Returns:
0 on success or -XS_ENODEV if device is invalid
Figure 8-109:xsAgaEnablePmc
8.5.2.2
xsAgaEnablePort()
Name: xsAgaEnablePort
Synopsis:
#include <xsAga.h>
int xsAgaEnablePort ( int device, int port, int yesno );
Description:
xsAgaEnablePort() enables the traffic on the selected port of the selected PMC.
If yesno is set, the traffic can be sent and received.
XALYO SYSTEMS
91
8.5.2.3
xsAgaSend()
Name: xsAgaSend
Synopsis:
#include <xsAga.h>
int xsAgaSend ( int device,
int port,
unsigned char *buf,
int header );
Description:
xsAgaSend() sends an ATM cell on the selected port of the selected device. The device and
port shall be enabled prior to calling xsAgaEnablePort().
buf is a pointer to a 48 byte cell payload
header must contains the ATM cell header (without HEC).
Returns:
48 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid,
-XS_ENOTCONN if the PMC and/or port is not enabled,
-XS_EWOULDBLOCK if the transmit queue is full and the port is send in non-blocking mode
-XS_EFAULT if the address of the buffer causes an address violation
Figure 8-111:xsAgaSend
8.5.2.4
xsAgaBlock()
Name: xsAgaBlock
Synopsis:
#include <xsAga.h>
int xsAgaBlock ( int device, int port, int yesno );
Description:
xsAgaBlock() sets the transmission on the selected port of the selected PMC in blocking or
92
XALYO SYSTEMS
non-blocking mode.
If yesno is set, the port is in blocking mode and the xsAgaSend() call will block until there is
enough space in the transmit queue.
If yesno is cleared, the port is set in non-blocking mode and the xsAgaSend() call will return
immediately with an error code if the transmit queue is full.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid
Figure 8-112:xsAgaBlock
8.5.2.5
xsAgaCallBack()
Name: xsAgaCallBack
Synopsis:
#include <xsAga.h>
int xsAgaCallBack ( int device,
int port,
int (*rxcb_rtn) ( unsigned char *buf,
int header,
void *userArg,
unsigned int tstamp ),
void *userArg );
Description:
xsAgaCallBack() installs a callback routine for the selected port of the selected PMC.
When the first callback is installed, a thread is created and blocks on a ioctl() to the driver until
One or more cells are received. Then the thread will call the user provided callback routine for
every received cell.
The user can specify a userArg when installing the callback.
The callback calls the user provided routine with the following arguments:
buf:
header:
userArg:
tstamp:
The callback routine shall return 0. The buffer is freed by the driver when the callback routine
Returns, meaning that the user shall copy the buffer if it is needed for further processing.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid,
-XS_ENOMEM if the thread fails to start
XALYO SYSTEMS
93
Figure 8-113:xsAgaCallBack
8.5.2.6
xsAgaStats()
Name: xsAgaStats
Synopsis:
#include <xsAga.h>
int xsAgaStats ( int device, int port, xsAgaStats_t *stats );
Description:
xsAgaStats() returns statistics related to the selected port of the selected device.
Returns:
0 on success,
-XS_ENODEV if device is invalid,
-XS_EINVAL if port is invalid
Figure 8-114:xsAgaStats
8.5.2.7
xsAgaError()
Name: xsAgaError
Synopsis:
#include <xsAga.h>
int xsAgaError ( char *msg );
Description:
xsAgaError() displays a message regarding the last error. The msg string is prepended.
Returns:
0 on success,
-XS_EUNKNOWN if the last error cant be defined
Figure 8-115:xsAgaError
8.5.2.8
Structures
94
XALYO SYSTEMS
8.5.2.9
Globals
int xsAgaErrno;
8.5.4.1
aga_send
DESCRIPTION:
aga_send sends ATM cells
USAGE:
aga_send device port header iterations
device:
Device number
port:
port number
header:
iterations:
8.5.4.2
aga_receive
DESCRIPTION:
aga_receive waits and receives ATM cells. By default aga_receive stores ATM cells in a
binary files. The behavior can be changed to store to an ascii file, to display on the terminal,
to check cell inter-arrival time.
USAGE:
XALYO SYSTEMS
95
Device number
port:
port number
iterations:
filename:
8.5.4.3
aga_monitor
DESCRIPTION:
aga_monitor displays statistics about an ATM port
USAGE:
aga_monitor device port
device:
Device number
port:
port number
Figure 8-120: aga_monitor
8.5.4.4
aga_send_from_file
DESCRIPTION:
aga_send_from_file sends the traffic contained in a binary file created by aga_receive. The
timing of the transmission will reflect the timing of the incoming cells while doing the capture.
This utility is useful to replay a given traffic pattern.
USAGE:
aga_send_from_file device port filename
device:
Device number
port:
Port number
filename :
96
XALYO SYSTEMS
8.5.4.5
aga_analyze
DESCRIPTION:
aga_analyze is analyzing the data contained in a binary file obtained while capturing traffic
with aga_receive.
This utility doesnt need to run on the target, but on any computer.
At the moment the analyzer is only displaying the packets with the time of arrival. Further
enhancements will be added in the future. Any suggestion is welcome.
USAGE:
aga_analyze filename
filename :
File to analyze
Figure 8-122: aga_analyze
XALYO SYSTEMS
97
9 Bibliography
[1]
Wintegra
WinPath Access Packet Processor: Hardware Developers Guide
0.92
[2]
Wintegra
WinPath Device Driver Interface
V1.1
[3]
Wintegra
WinPath Access Packet Processor: WinComm & DPS Specifications
0.63
[4]
Wintegra
WinPath Access Packet Processor: Routing and Interworking Specification
0.68
[5]
Wintegra
WinMon WinPath On-board resident monitor
V1.0
[6]
PMC-Sierra
PM5384 S/UNI-1x155: Saturn Network Interface (1x155) telecom Standard Product
Data Sheet
7
[7]
PMC-Sierra
POS-PHY Saturn Compatible Packet over SONET Interface Specification L2
Issue No.4: April 2002
[8]
Tundra
PowerSpanII PowerPC-to-PCI Bus Switch User Manual
April 03
[9]
Tundra
Interfacing the Wintegra WinPath with the Tundra PowerSpan II
April 03
[10]
ATM-Forum af-phy-0039.000:
Utopia Level 2
1.0
[11]
IEEE
P1386: Draft Standard for a Common Mezzanine Card Family: CMC
2.4a
[12]
IEEE
P1386.1: Draft Standard Physical and Environmental Layers for PCI Mezzanine Cards: PMC
2.4
[13]
PICMG
PICMG 2.15: PCI Telecom Mezzanine/Carrier Card Specification
1.0
98
XALYO SYSTEMS
10 Glossary
A
AALx
AGA
AIS
APS
ATM
B
BER1
BER2
BER3
C
CID
CPCI
CPSB
Channel Identifier
Compat PCI
Compact PCI Packet Switched Backplane
E
ESD
EJTAG
Electrostatic Discharge
Enhanced JTAG
G
GPRS
H
HDLC
I
I2O
IEEE
IP
Intelligent I/O
Institute of Electrical and Electronics Engineers
Internet Protocol
J
JTAG
K
KB
Kilo Bytes
L
LAIS
LED
LFEBE
LOCD
LOF
LOP
LOS
XALYO SYSTEMS
99
O
OC-3
OCD
OOF
M
MB
MPLS
MSA
MSC
Mega Bytes
Multi Protocol Label Switching
Multi Source Agreement
Mobile Switch Center
N
NNI
P
PAIS
PCI
PFEBE
PICMG
PLL
PMC
POS
PPC
PPP
PPS
PRDI
PT1CC
PT1MC
PT4CC
PT4MC
PTMC
R
RAI
RED
RNC
RSOC
S
SDH
SDRAM
SFP
SGSN
SONET
SS7
STM-1
STS-3c
T
TSOC
100
XALYO SYSTEMS
U
UNI
UTOPIA
V
VC
VCI
VoIP
VPI
VME
XALYO SYSTEMS
101