Você está na página 1de 101

XALYO SYSTEMS,

SARL

SOFTWARE-UM

SOFTWARE USERS MANUAL

Users Manual
Version 0.95
July 2005

Xalyo Systems - Ch. Le Grenier 9 - 1291 Commugny - Switzerland


Tel +41 22 776 6177 - Fax +41 22 776 6175 - Mobile +41 79 411 0919 - xalyo@xalyo.com - www.xalyo.com

Generic Software for XS PMCs

Information in this document is subject to change without notice


2003-2005 Xalyo Systems. All rights reserved.
Reproduction of this manual is only allowed for internal use if the user has purchased the Xalyo
Systems product described herein. In other cases no part of this publication may be copied in any
form without the prior written permission of Xalyo Systems.
Trademarks used in this manual: VxWorks is a trademark of Wind River, WinPath is a trademark of
Wintegra, Pentium is a trademark of Intel Corporation, and PowerSpanII is a trademark of Tundra
Semiconductor Corp.
Other trademarks and trade names may be used in this document to refer to either the entities
claiming the marks and names of their product. Xalyo Systems disclaims any proprietary interest in
trademarks and trade names other than its own.
For any enquiry, please contact
Xalyo Systems
Grenier 9
1291 Commugny
Switzerland
Phone: +41 22 776 61 75
Fax: +41 22 776 61 75
www.xalyo.com
support@xalyo.com

XALYO SYSTEMS

Generic Software for XS PMCs


END-USER LICENSE AGREEMENT
FOR XALYO SYSTEMS SOFTWARE

License Agreement ("Agreement")


This license agreement governs Xalyo Systems software ("Software"). Installation of the Software
constitutes acceptance of the terms of this License Agreement.
Grant of License: Subject to the terms and conditions of this Agreement, Xalyo Systems hereby
grants you a limited, nonexclusive license to install and use the source and object code version of the
Software for use only on equipment containing a Xalyo Systems product.
Limitations: The Software is licensed, not sold, to you. You must retain all copyright and related
notices of XALYO SYSTEMS' ownership and other rights in the Software in the product, labeling and
documentation provided. Furthermore, you may not: (a) modify, translate, de-compile, reverse
engineer, disassemble or otherwise decode the Software; (b) copy any of the Software other than as
reasonably required for your company use of the Software in accordance with this Agreement; or (c)
sublicense, sell, rent, lend, transfer, post, transmit, distribute or otherwise make the Software available
to anyone else, except that you may permanently transfer the Software and accompanying materials
provided you retain no copies and the recipient agrees to the terms of this Agreement.
Support: Xalyo Systems reserves the right to modify the Software from time to time without obligation
to notify you, or any other person or organization of such revision or change.
Third Party Licenses: Certain components of this software are provided under license from third
party companies. These components may be copied, modified and incorporated into materials for
internal company use and in advertising and promotional materials for you or your clients. You are not
permitted to use the components, or any portions of the components, in any other way. Furthermore,
you may not use the components in any manner which is defamatory or otherwise violates any
applicable laws. You may not make copies, either digital or printed, of the components for the purpose
of re-licensing or reselling the components (whether separately or in combination with other
components) or for any other purpose except those expressly set forth above.
Limitation of Liability: IN NO EVENT WILL XALYO SYSTEMS BE LIABLE FOR ANY DAMAGES,
INCLUDING LOSS OF DATA, LOST OPPORTUNITY OR PROFITS, COST OF COVER OR ANY
SPECIAL, INCIDENTAL, CONSEQUENTIAL, DIRECT OR INDIRECT DAMAGES ARISING FROM
OR RELATING TO THE USE OF THE SOFTWARE, HOWEVER CAUSED ON ANY THEORY OF
LIABILITY. THIS LIMITATION WILL APPLY EVEN IF XALYO SYSTEMS HAS BEEN ADVISED OR
GIVEN NOTICE OF THE POSSIBILITY OF SUCH DAMAGE. THE ENTIRE RISK AS TO THE USE
OF THE SOFTWARE IS ASSUMED BY THE USER. BECAUSE SOME STATES DO NOT ALLOW
THE EXCLUSION OR LIMITATION OF LIABILITY FOR CERTAIN INCIDENTAL, CONSEQUENTIAL
OR OTHER DAMAGES, THIS LIMITATION MAY NOT APPLY TO YOU.
Disclaimer of Warranty: TO THE EXTENT PERMITTED BY APPLICABLE LAW ALL XALYO
SYSTEMS SOFTWARE, INCLUDING THE COMPONENTS, IS PROVIDED "AS IS" AND WITHOUT
EXPRESS OR IMPLIED WARRANTY OF ANY KIND BY EITHER XALYO SYSTEMS OR ANYONE
ELSE WHO HAS BEEN INVOLVED IN THE CREATION, PRODUCTION OR DELIVERY OF SUCH
SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTY OF
MERCHANTABILITY, NONINFRINGEMENT OR FITNESS FOR A PARTICULAR PURPOSE. NO
COVENANTS, WARRANTIES OR INDEMNITIES OF ANY KIND ARE GRANTED BY XALYO
SYSTEMS TO THE USER.
Termination: Without prejudice to any other rights, Xalyo Systems may terminate this Agreement if
you fail to comply with any term or condition of the agreement. In this case, or if you do not accept the
terms of this license, you agree to destroy all copies of the Software in your possession and control.
Export Control Obligations: You will not export or re-export any Licensed Software in violation of
any law, regulation, order or other governmental requirement.

XALYO SYSTEMS

Generic Software for XS PMCs

Table of contents
1

Using this manual............................................................................................. 12

1.1 Purpose ......................................................................................................... 12


1.2 Audience........................................................................................................ 12
1.3 Icon conventions ............................................................................................ 12
1.4 Typographical convention .............................................................................. 12
1.5 Downloading new firmware, software and documentation ............................. 13
2 Revision history................................................................................................ 14
3

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

Building the driver ............................................................................................ 19

Accessing and booting XS cards .................................................................... 20


5.1 Verifying that the card is seen on the PCI bus ............................................... 20
5.1.1
5.1.2

VxWorks........................................................................................................................... 20
Linux ................................................................................................................................ 21

5.2 Loading the driver .......................................................................................... 22


5.2.1
5.2.2

VxWorks........................................................................................................................... 22
Linux ................................................................................................................................ 23

WinMon: WinPath Boot Monitor ...................................................................... 25

6.1 Overview........................................................................................................ 25
Software description ........................................................................................ 26
7.1 Software model .............................................................................................. 26
7.1.1
7.1.2
7.1.3

Standalone Software Model............................................................................................. 26


Split Software Model........................................................................................................ 26
NIC Software Model......................................................................................................... 27

7.2 Tools .............................................................................................................. 28


7.2.1
7.2.2
7.2.3

Standalone....................................................................................................................... 28
VxWorks........................................................................................................................... 28
Linux ................................................................................................................................ 28

7.3 Building and executing Hello World on XS cards ........................................ 28


7.3.1
Overwi.............................................................................................................................. 28
7.3.2
The source code .............................................................................................................. 28
7.3.3
The Makefile .................................................................................................................... 28
7.3.4
Compiling and linking....................................................................................................... 29
7.3.5
Loading the binary object into XS cards host memory .................................................... 30
7.3.5.1
VxWorks.................................................................................................................. 30
7.3.5.2
Linux........................................................................................................................ 31
7.3.6
Running the code............................................................................................................. 32

Drivers ............................................................................................................... 34

XALYO SYSTEMS

Generic Software for XS PMCs

8.1 Driver Overview ............................................................................................. 34


8.2 Generic Driver................................................................................................ 34
8.2.1
Overview .......................................................................................................................... 34
8.2.2
API ................................................................................................................................... 34
8.2.2.1
Driver API................................................................................................................ 34
8.2.2.2
Library API .............................................................................................................. 36
8.2.2.2.1
xs_phy_init()................................................................................................................... 36
8.2.2.2.2
xs_phy_info().................................................................................................................. 37
8.2.2.2.3
xs_phy_loop() ................................................................................................................. 37
8.2.2.2.4
xs_phy_is_loop()............................................................................................................. 38
8.2.2.2.5
xs_phy_enable().............................................................................................................. 38
8.2.2.2.6
xs_phy_is_enabled() ....................................................................................................... 38
8.2.2.2.7
xs_phy_disable() ............................................................................................................. 39
8.2.2.2.8
xs_phy_status() ............................................................................................................... 39
8.2.2.2.9
xs_phy_alarm() ............................................................................................................... 39
8.2.2.2.10
xs_phy_set_error() .......................................................................................................... 40
8.2.2.2.11
xs_phy_is_error()............................................................................................................ 40
8.2.2.2.12
xs_phy_clocking()........................................................................................................... 41
8.2.2.2.13
xs_phy_framing()............................................................................................................ 41
8.2.2.2.14
xs_phy_scramble().......................................................................................................... 41
8.2.2.2.15
xs_phy_is_scrambled() ................................................................................................... 42
8.2.2.2.16
xs_phy_write() ................................................................................................................ 42
8.2.2.2.17
xs_phy_read() ................................................................................................................. 42
8.2.2.2.18
Data structures ................................................................................................................ 43
8.2.3
Summary of driver options............................................................................................... 45
8.2.4
Examples and Utilities ..................................................................................................... 45
8.2.4.1
xsmipsreset ............................................................................................................. 45
8.2.4.2
xsconsole ................................................................................................................ 46
8.2.4.3
xseepromdump ....................................................................................................... 46
8.2.4.4
xseepromread ......................................................................................................... 47
8.2.4.5
xseepromwrite......................................................................................................... 47
8.2.4.6
xsload ...................................................................................................................... 48
8.2.4.7
xsusectimerget ........................................................................................................ 48
8.2.4.8
xsphymonitor........................................................................................................... 48

8.3 ATM & Ethernet driver ................................................................................... 50


8.3.1
Overview .......................................................................................................................... 50
8.3.2
Buffer Partitioning ............................................................................................................ 50
8.3.3
Quality of Service............................................................................................................. 52
8.3.4
Interworking ..................................................................................................................... 52
8.3.5
ARP.................................................................................................................................. 54
8.3.6
API ................................................................................................................................... 55
8.3.6.1
xsAtmBind()............................................................................................................. 55
8.3.6.2
xsAtmUnbind() ........................................................................................................ 55
8.3.6.3
xsAtmSend() ........................................................................................................... 55
8.3.6.4
xsAtmSendBlock()................................................................................................... 56
8.3.6.5
xsAtmCallBack()...................................................................................................... 56
8.3.6.6
xsAtmVcStats() ....................................................................................................... 57
8.3.6.7
xsAtmDevStats() ..................................................................................................... 57
8.3.6.8
xsAtmVersion()........................................................................................................ 57
8.3.6.9
xsAtmError()............................................................................................................ 58
8.3.6.10
xsAtmOamVPCreate() ............................................................................................ 58
8.3.6.11
xsAtmOamVPDelete()............................................................................................. 58
8.3.6.12
xsAtmOamSend().................................................................................................... 59
8.3.6.13
xsAtmOamCallBack().............................................................................................. 59
8.3.6.14
xsGetHwInfo() ......................................................................................................... 60
8.3.6.15
xsIwCreate()............................................................................................................ 60
8.3.6.16
xsIwDelete() ............................................................................................................ 61
8.3.6.17
xsGenetEnablePort()............................................................................................... 61
8.3.6.18
xsGenetSend() ........................................................................................................ 61
8.3.6.19
xsGenetBlock()........................................................................................................ 62

XALYO SYSTEMS

Generic Software for XS PMCs


8.3.6.20
xsGenetCallBack() .................................................................................................. 62
8.3.6.21
xsGenetStats() ........................................................................................................ 63
8.3.6.22
xsGenetError() ........................................................................................................ 64
8.3.6.23
xsGenetMacAdrs() .................................................................................................. 64
8.3.6.24
xsGenetReadPhy().................................................................................................. 64
8.3.6.25
xsGenetWritePhy().................................................................................................. 65
8.3.6.26
xsArpRequest() ....................................................................................................... 65
8.3.6.27
xsArpTableGet()...................................................................................................... 66
8.3.6.28
xsArpEntryAdd()...................................................................................................... 66
8.3.6.29
xsArpEntryDelete().................................................................................................. 66
8.3.6.30
Definitions ............................................................................................................... 67
8.3.6.31
Data Structures ....................................................................................................... 68
8.3.6.32
Globals .................................................................................................................... 75
8.3.7
Summary of driver options............................................................................................... 75
8.3.8
Examples and utilities ...................................................................................................... 76
8.3.8.1
send_aal1................................................................................................................ 76
8.3.8.2
send_aal2................................................................................................................ 76
8.3.8.3
send_aal5................................................................................................................ 77
8.3.8.4
send_raw................................................................................................................. 77
8.3.8.5
send_oam ............................................................................................................... 78
8.3.8.6
receive_aal1............................................................................................................ 79
8.3.8.7
receive_aal2............................................................................................................ 79
8.3.8.8
receive_aal5............................................................................................................ 80
8.3.8.9
receive_raw............................................................................................................. 80
8.3.8.10
receive_oam............................................................................................................ 81
8.3.8.11
xsatmmonitor........................................................................................................... 81
8.3.8.12
perf_aal2 ................................................................................................................. 81
8.3.8.13
get_hw_info............................................................................................................. 82
8.3.8.14
genet_send ............................................................................................................. 82
8.3.8.15
genet_receive.......................................................................................................... 83
8.3.8.16
genet_monitor ......................................................................................................... 83
8.3.8.17
genet_tap ................................................................................................................ 84
8.3.8.18
xsarpmonitor ........................................................................................................... 84
8.3.8.19
xsiwcreate ............................................................................................................... 84

8.4 POS driver ..................................................................................................... 85


8.4.1
Overview .......................................................................................................................... 85
8.4.2
API ................................................................................................................................... 85
8.4.2.1
xsPosEnablePmc().................................................................................................. 85
8.4.2.2
xsPosEnablePort() .................................................................................................. 85
8.4.2.3
xsPosSend()............................................................................................................ 86
8.4.2.4
xsPosBlock() ........................................................................................................... 86
8.4.2.5
xsPosCallBack()...................................................................................................... 87
8.4.2.6
xsPosStats()............................................................................................................ 87
8.4.2.7
xsPosError() ............................................................................................................ 88
8.4.2.8
POS structures........................................................................................................ 88
8.4.2.9
POS globals ............................................................................................................ 89
8.4.3
Summary of driver options............................................................................................... 89
8.4.4
Examples and utilities ...................................................................................................... 89
8.4.4.1
pos_send................................................................................................................. 89
8.4.4.2
pos_receive............................................................................................................. 89
8.4.4.3
pos_monitor ............................................................................................................ 90

8.5 AGA driver ..................................................................................................... 91


8.5.1
Overview .......................................................................................................................... 91
8.5.2
API ................................................................................................................................... 91
8.5.2.1
xsAgaEnablePmc() ................................................................................................. 91
8.5.2.2
xsAgaEnablePort() .................................................................................................. 91
8.5.2.3
xsAgaSend() ........................................................................................................... 92
8.5.2.4
xsAgaBlock() ........................................................................................................... 92
8.5.2.5
xsAgaCallBack()...................................................................................................... 93
8.5.2.6
xsAgaStats()............................................................................................................ 94

XALYO SYSTEMS

Generic Software for XS PMCs


8.5.2.7
xsAgaError()............................................................................................................ 94
8.5.2.8
Structures................................................................................................................ 94
8.5.2.9
Globals .................................................................................................................... 95
8.5.3
Summary of driver options............................................................................................... 95
8.5.4
Examples and utilities ...................................................................................................... 95
8.5.4.1
aga_send ................................................................................................................ 95
8.5.4.2
aga_receive............................................................................................................. 95
8.5.4.3
aga_monitor ............................................................................................................ 96
8.5.4.4
aga_send_from_file................................................................................................. 96
8.5.4.5
aga_analyze............................................................................................................ 97

9
10

Bibliography...................................................................................................... 98
Glossary ......................................................................................................... 99

XALYO SYSTEMS

Generic Software for XS PMCs

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

Generic Software for XS PMCs


Figure 8-54:xsArpRequest .................................................................................................................................... 65
Figure 8-55:xsArpTableGet .................................................................................................................................. 66
Figure 8-56:xsArpEntryAdd ................................................................................................................................. 66
Figure 8-57:xsArpEntryDelete.............................................................................................................................. 67
Figure 8-58: ATM API Definitions....................................................................................................................... 68
Figure 8-59: xsAtmPvc_t ...................................................................................................................................... 68
Figure 8-60: xsIPFlow_t ....................................................................................................................................... 69
Figure 8-61: xsArpTableENtry_t .......................................................................................................................... 69
Figure 8-62: xsAal0Stats_t.................................................................................................................................... 69
Figure 8-63: xsAal1Stats_t.................................................................................................................................... 69
Figure 8-64: xsAal2Stats_t.................................................................................................................................... 69
Figure 8-65: xsAal34Stats_t.................................................................................................................................. 70
Figure 8-66: xsAal5Stats_t.................................................................................................................................... 70
Figure 8-67: xsRawStats_t .................................................................................................................................... 70
Figure 8-68: xsOamStats_t.................................................................................................................................... 70
Figure 8-69: xsIwStats_t ....................................................................................................................................... 71
Figure 8-70: xsAalStats_t...................................................................................................................................... 71
Figure 8-71: xsAtmVcStats_t................................................................................................................................ 71
Figure 8-72: xsNicStats_t...................................................................................................................................... 71
Figure 8-73: xsAtmDevStats_t.............................................................................................................................. 72
Figure 8-74: xsGenetStats_t.................................................................................................................................. 73
Figure 8-75: xsHwInfo_t....................................................................................................................................... 73
Figure 8-76: xsOamType_t ................................................................................................................................... 75
Figure 8-77: Globals ............................................................................................................................................. 75
Figure 8-78: send_aal1.......................................................................................................................................... 76
Figure 8-79: send_aal2.......................................................................................................................................... 77
Figure 8-80: send_aal5.......................................................................................................................................... 77
Figure 8-81: send_raw .......................................................................................................................................... 78
Figure 8-82: send_oam.......................................................................................................................................... 79
Figure 8-83:receive_aal1....................................................................................................................................... 79
Figure 8-84: receive_aal2...................................................................................................................................... 80
Figure 8-85: receive_aal5...................................................................................................................................... 80
Figure 8-86: receive_raw ...................................................................................................................................... 80
Figure 8-87: receive_oam ..................................................................................................................................... 81
Figure 8-88: xsatmmonitor.................................................................................................................................... 81
Figure 8-89: perf_aal2........................................................................................................................................... 82
Figure 8-90: get_hw_info...................................................................................................................................... 82
Figure 8-91: genet_send........................................................................................................................................ 83
Figure 8-92: genet_receive.................................................................................................................................... 83
Figure 8-93: genet_monitor .................................................................................................................................. 83
Figure 8-94: genet_tap .......................................................................................................................................... 84
Figure 8-95: xsarpmonitor .................................................................................................................................... 84
Figure 8-96: xsiwcreate......................................................................................................................................... 84
Figure 8-97:xsPosEnablePmc ............................................................................................................................... 85
Figure 8-98:xsPosEnablePort................................................................................................................................ 86
Figure 8-99:xsPosSend ......................................................................................................................................... 86
Figure 8-100:xsPosBlock...................................................................................................................................... 87
Figure 8-101:xsPosCallBack................................................................................................................................. 87
Figure 8-102:xsPosStats........................................................................................................................................ 88
Figure 8-103:xsPosError ....................................................................................................................................... 88
Figure 8-104:Structures......................................................................................................................................... 89
Figure 8-105:Globals ............................................................................................................................................ 89
Figure 8-106: pos_send......................................................................................................................................... 89
Figure 8-107: pos_receive..................................................................................................................................... 90
Figure 8-108: pos_monitor.................................................................................................................................... 90
Figure 8-109:xsAgaEnablePmc ............................................................................................................................ 91
Figure 8-110:xsAgaEnablePort............................................................................................................................. 92
Figure 8-111:xsAgaSend....................................................................................................................................... 92
Figure 8-112:xsAgaBlock ..................................................................................................................................... 93
Figure 8-113:xsAgaCallBack................................................................................................................................ 94

XALYO SYSTEMS

Generic Software for XS PMCs


Figure 8-114:xsAgaStats....................................................................................................................................... 94
Figure 8-115:xsAgaError ...................................................................................................................................... 94
Figure 8-116:Structures......................................................................................................................................... 95
Figure 8-117:Globals ............................................................................................................................................ 95
Figure 8-118: aga_send......................................................................................................................................... 95
Figure 8-119: aga_receive..................................................................................................................................... 96
Figure 8-120: aga_monitor.................................................................................................................................... 96
Figure 8-121: aga_send_from_file ........................................................................................................................ 96
Figure 8-122: aga_analyze .................................................................................................................................... 97

10

XALYO SYSTEMS

Generic Software for XS PMCs

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

Generic Software for XS PMCs

1 Using this manual


1.1 Purpose
The purpose of this document is to describe Xalyo Systems software for developers who intend to
develop applications based on XS PMC family.

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.

1.3 Icon conventions

Warnings: indicates procedures that could be hazardous to your health or cause


unpredictable results on the surrounding environment

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

1.4 Typographical convention


The following conventions are used throughout this manual:

Program outputs are printed in the Courier New font.


Example: The following message appears on your terminal:

No boot device available

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

Generic Software for XS PMCs

Commands you have to enter are printed in Courier New Bold font.
Example: You may be instructed to type the following command:

tar xvf file.tar


Note that the carriage return at the end of the command is implied and not shown.

Placeholders for which you substitute a value are presented in italics:


Example:
Plug the fiber in port x (where x represents the port number designation)

1.5 Downloading new firmware, software and documentation


To download the latest firmware software or documentation, please send an e-mail to
support@xalyo.com
And we will send you a password and instructions to access our protected FTP site.
The version of the latest validated software is always mentioned on:
www.xalyo.com/support.htm

XALYO SYSTEMS

13

Generic Software for XS PMCs

2 Revision history
VERSION
0.95

14

DATE
July 18, 2005

CHANGES
Initial version, merged all previous software manuals

XALYO SYSTEMS

Generic Software for XS PMCs

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.

3.1.2 Elementary Precautions


Any electronic device must be handled with caution:

Protect it from mechanical shocks.


Protect it from electrostatic discharge (ESD).
Do not insert or remove it while the system is powered-on.
Plug it on carrier board with care.
Dont operate the board when the temperature is below 0C or above 50C.

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.

3.1.3 Supported Features

AAL0 (Raw ATM cells) termination


AAL1 termination
AAL2 termination
o
o
o

CPS
SSSAR
SSTED

AAL5 termination
OAM traffic termination

XALYO SYSTEMS

15

Generic Software for XS PMCs

Gigabit Ethernet termination


Packet over SONET/SDH (POS) termination
ATM to IP interworking
PHY monitoring and control

3.1.4 Features to be implemented

ATM switching
AAL2 switching
Bridging
IMA
SS7
Solaris support

3.1.5 Driver Implementation


The driver is available on VxWorks and Linux platform and is composed of:

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

AGA (ATM Generator and Analyzer).

These drivers are described in greater details later in this document.

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.

XSIO (Xalyo Systems I/O)


XSIO is a mechanism used to transfer control path commands and data path traffic between
the host CPU and the MIPS CPU on the PMC.
XSIO is part of the generic driver and is used for all modules (ATM, POS, Ethernet, )

16

XALYO SYSTEMS

Generic Software for XS PMCs

XSIO is explained in more details in the next section.

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

Generic Software for XS PMCs

3.1.6.4

Getting PHY alarms

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.

3.1.7 Performance consideration


The XSIO mechanism totally offloads the host CPU, meaning that even for high throughput, the CPU
load is very low on the host CPU.
Another benefit of XSIO is that the processing on the host is the same for any kind of traffic (AAL2,
AAL5).
For example, full duplex traffic at OC-3 line rate wont utilize more than 30% of the host CPU, even for
AAL2 traffic, leaving more than 70% of the processing power for the user application.
The drawback of this solution is that most of the processing is done on the MIPS CPU on the PMC. As
the MIPS CPU runs at 200 MHz only, it becomes the bottleneck of the system.

18

XALYO SYSTEMS

Generic Software for XS PMCs

4 Building the driver


The first step in building the driver is to choose your configuration. This is done through the
configure utility in the top level directory. There is a choice of drivers, operating systems and some
parameters must be set. Do not rebuild the MIPS software as the MIPS source code is not included in
the standard distribution (requires an NDA). This utility generates a .config file.

#./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

Generic Software for XS PMCs

5 Accessing and booting XS cards


5.1 Verifying that the card is seen on the PCI bus
XS cards export six windows on the PCI:

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

Figure 5-1: PCI Windows


Note that not all Host, Parameter and Packet memory range is exported. In normal applications, all
data movements are done with the help of the DMA engines which do not require any mapping on the
PCI. The memory banks are mapped for debugging purpose only.

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

of each PCI device on bus 0


mechanism 1
function vendorID deviceID
00000000 00008086 000071a0
00000000 00008086 000071a1
00000000 00008086 00007110
00000000 000010e3 00008261
00000000 00001011 00000046
00000000 00008086 00001229
00000000 00008086 00001229

-> pciHeaderShow 0,0x10,0


vendor ID =
device ID =
command register =
status register =
revision ID =
class code =
sub class code =

20

class
00000600
00040600
00010600
00800600
00800600
00000200
00000200

0x10e3
0x8261
0x0106
0x0230
0x01
0x06
0x80

XALYO SYSTEMS

Generic Software for XS PMCs

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

Example 5-1: Verifying XS1000 Presence on PCI


Note that the XS card can be on a different bus than zero (Try pciDeviceShow x, with x different from
0). The mapping will most likely be different on your system.

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

Generic Software for XS PMCs

5.2 Loading the driver


The next step is to load the driver.

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;
}

sysMmuMapAdd ((void *)((int)adrs & 0xfffffff0), size,


VM_STATE_MASK_FOR_ALL, VM_STATE_FOR_IO);
}
}
}

Figure 5-2: PCI window mapping code for sysLib.c


When this is done and that your BSP has been rebuilt, you can load the driver object:

22

XALYO SYSTEMS

Generic Software for XS PMCs

-> 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

At this point the driver is installed:

-> 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

Generic Software for XS PMCs

# 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

Generic Software for XS PMCs

6 WinMon: WinPath Boot Monitor


6.1 Overview
WinMon is the WinPath monitor running on the MIPS.
WinMon has been developed by Wintegra and was ported to XS cards by Xalyo Systems.

Here is a list of addition made by Xalyo Systems:

Support of Intel StrataFlash devices

PCI emulated console


The PT4MC standards defines a physical console on the PT4MC connector, but in case the
user doesnt have a PT4CC carrier card with a physical console connected to the PT4MC,
there is a xsconsole utility which 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 WinMons BOARD_CONSOLE environment variable to UART.
To revert to the PCI console, set BOARD_CONSOLE to PCI.
The physical console baud rate is 115200 mbps, 8 bit, no parity, 1 stop bit, no flow control.

Please refer to the WinMon documentation for more details.

XALYO SYSTEMS

25

Generic Software for XS PMCs

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.

7.1.1 Standalone Software Model


In the standalone software model, the user runs his application on the onboard MIPS processor.
The host processor is not required and the PMC can be plugged on a simple PMC carrier card.
An example of application using this model is an ATM to Ethernet bridge with management done inband on the Ethernet port.

Figure 7-1: Standalone Software Model

7.1.2 Split Software Model


In the split software model, the user can split his application across the MIPS and Host CPU.
An example of application using this software model is an ATM to Ethernet bridge with management
done out-band via the PCI bus.

26

XALYO SYSTEMS

Generic Software for XS PMCs

Figure 7-2: Split Software Model

7.1.3 NIC Software Model


In the NIC (Network Interface Card) software model, the user uses one of Xalyo Systems high-level
driver and sees the PMC as a NIC. There is no need to develop code for the MIPS in this model.
Currently Xalyo Systems can provide the following modules running on VxWorks and Linux (on the
Host CPU):
-

ATM & Ethernet termination and interworking module


POS termination module
AGA module for ATM Generation and Analysis (test tool)

See the specific sections below for more details on these modules.

Figure 7-3: NIC Software Model

XALYO SYSTEMS

27

Generic Software for XS PMCs

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

7.3 Building and executing Hello World on XS cards


7.3.1 Overview
7.3.2 The source code
Here is the Hello World example:

#include <stdio.h>
int main(int argc, char **argv)
{
printf("Hello World !\n\r");
return 0;
}
Example 7-1: Hello World Example

7.3.3 The Makefile


Here is an example Makefile which compiles and links the Hello World application:

28

XALYO SYSTEMS

Generic Software for XS PMCs

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

= -c -mips32 -nostdinc -fno-builtin -Wall -Wno-main


= -c -mips32
= -mips32 -nostdlib -nostartfiles

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

7.3.4 Compiling and linking


Here is the output of the make command:

#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

Generic Software for XS PMCs

PATH=/cygdrive/h/SDELite/sde5.03/bin:/bin; sde-gcc -mips32 -nostdlib nostartfiles -o hello.exe T/cygdrive/w/projects/XS/winmon/target/mips/


appl/link.xn hello.o start.o/cygdrive/w/projects/XS/winmon/lib/mips/
libcsde.a

Example 7-3: Compiling and linking Hello World

7.3.5 Loading the binary object into XS cards host memory

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

WinMon version 2.2.1T May 26 2005 15:24:47


All rights reserved (c) 2000-2004 Wintegra
Core
: WinPath 787-Rev-B0 Wintegra mips5kc Opal Rev 2
Board Id: Xalyo Systems XS-1000 Rev 2 Serial No: 401

30

XALYO SYSTEMS

Generic Software for XS PMCs

Detecting flash memory... INTEL STRATAFLASH 28F128


Board parameters: PLL: 400.0Mhz
Internal: 0x1f020000, 32 Kbytes
Parameter: 0x08000000, 128 Mbytes
Packet:
0x20000000, 128 Mbytes
Host:
0x00000000, 128 Mbytes

@
@
@
@

200.0Mhz
100.0Mhz
100.0Mhz
66.666Mhz

MAC addresses: [eth0] 00:0F:42:00:01:91


[eth1] (null)
IP address:
192.168.1.251
Subnet mask:
255.255.255.0
Default gateway: 0.0.0.0
First free address: 0x8004ee28
WinMon>~<CR>
value = 0 = 0x0
->
Example 7-6: Connecting to the PCI console
Now load the file into XS1000 host memory. Note that the ld command that will install the ELF file
expects to find the file at the first free address plus offset 0x800000.

-> xsload 0, "<PATH>/hello.exe", 0x84ee28)


loading file XS/objects/winmon/examples/hello.exe [0x1753 bytes] at offset
0x84ee28
value = 0 = 0x0
Example 7-7: Loading hello.exe in XS card host memory

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

Generic Software for XS PMCs

WinMon version 2.2.1T May 26 2005 15:24:47


All rights reserved (c) 2000-2004 Wintegra
Core
: WinPath 787-Rev-B0 Wintegra mips5kc Opal Rev 2
Board Id: Xalyo Systems XS-1000 Rev 2 Serial No: 401

Detecting flash memory... INTEL STRATAFLASH 28F128


Board parameters: PLL: 400.0Mhz
Internal: 0x1f020000, 32 Kbytes
Parameter: 0x08000000, 128 Mbytes
Packet:
0x20000000, 128 Mbytes
Host:
0x00000000, 128 Mbytes

@
@
@
@

200.0Mhz
100.0Mhz
100.0Mhz
66.666Mhz

MAC addresses: [eth0] 00:0F:42:00:01:91


[eth1] (null)
IP address:
192.168.1.251
Subnet mask:
255.255.255.0
Default gateway: 0.0.0.0
First free address: 0x8004ee28
WinMon>~<CR>
value = 0 = 0x0
->

Example 7-9: Connecting to the PCI console


Now load the file into XS1000 host memory. Note that the ld command that will install the ELF or
SREC file expects to find the file at the first free address plus offset 0x800000.

# XS/objects/linux/x86/bin/xsload 0, "<PATH>/hello.exe", 0x84ee28)


loading file XS/objects/winmon/examples/hello.exe [0x1753 bytes] at offset
0x84ee28
value = 0 = 0x0
Example 7-10: Loading hello.exe in XS card host memory

7.3.6 Running the code


Reconnect to the PCI console and load the file. WinMon will recognize and ELF object and will install
the segments in memory.

-> xsconsole
WinMon>ld
Hit Cntl-C to exit
Found ELF header

32

XALYO SYSTEMS

Generic Software for XS PMCs

Loading
Loading
Copying
Loading
Copying
Padding

ELF file from 0xa084ee28


Segment 0 from 0xa084ee5c
0xf30 bytes from 0xa084eea0 to 0x80200000
Segment 1 from 0xa084ee7c
0x100 bytes from 0xa084fdd0 to 0x80200f30
0x1000 bytes from 0x80201030

Start = 0x80200000, End = 0x80202030


WinMon>

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

Generic Software for XS PMCs

8 Drivers
8.1 Driver Overview
There are several driver modules available for VxWorks and Linux:

ATM & Ethernet termination and interworking


POS termination
ATM generator and Analyzer (AGA)

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 Generic Driver


8.2.1 Overview
There is a set of functionalities which is common to all driver modules. Some of these functionalities
doesnt need the MIPS CPU to run at all and some others needs the MIPS CPU to run one of the
drivers, but are implemented in all the drivers. Some of these functionalities are listed below:

Reset the MIPS CPU on the PMC


Write a string to the PCI console
Read a string from the PCI console
Load a file into the PMCs memory
Read the EEPROMs
Write the EEPROMs
Enable the SFP optical transceivers
Query for SFP optical transceiver presence
Read the SFP optical transceiver signature
Query for SFP optical transceiver status
Select the source of the reference clock
Set or read a General Purpose I/O (GPIO) pin on the Wintegra device
Read a timer with microsecond resolution on the PMC

All the examples in XS/examples/utils are using these generic functionalities.


The API is described in the next section and some examples and utilities using this API are described
below.
Additionally the generic driver provides physical layer configuration and monitoring. The API is also
described below.

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

Generic Software for XS PMCs

ioctl(xs_fd, IOCTL_COMMAND, &command_specific_structure)


Below is the list of supported commands and related structures. See XS/include/xsapi.h for up-to-date
definitions.
The device number argument is the PMC number. If there is only one PMC on your card, this
argument shall be set to 0.
IOCTL COMMAND
XS_MIPS_RESET

VAL
UE
1

ARGUMENT

DESCRIPTION

XS_VAL_DESC

Resets the MIPS processor

devNo: Device number


value: Reset type
0: send a reset pulse
1: keep MIPS in reset
XS_CONSOLE_BUF_DESC

devNo: Device Number


buf: string to write
bufLen: length of string
XS_CONSOLE_BUF_DESC

devNo: Device Number


buf: buffer for string
bufLen: max string length
XS_FILE_BUF_DESC

XS_EXEC_CMD

devNo: Device Number


offset: address in PMC mem
buf: buffer
len: buffer size
(internal, not for user)

XS_EEPROM_READ

XS_EEPROM_BUF_DESC

devNo: Device Number


eeprom: eeprom device
0: WinPath EEPROM
1: PowerSpan EEPROM
addr: EEPROM address
val: pointer to read value
XS_EEPROM_BUF_DESC

XS_DMA_OP

devNo: Device Number


eeprom: eeprom device
0: WinPath EEPROM
1: PowerSpan EEPROM
addr: EEPROM address
val: pointer to value to write
(internal, not for user)

XS_ENABLE_PHY_EVT
XS_GET_PHY_EVT
XS_GET_SERIAL_EVT

9
10
11

(internal, not for user)


(internal, not for user)
(internal, not for user)

XS_PCIBOOT_FILE

12

(internal, not for user)

XS_CONSOLE_WRITE

XS_CONSOLE_READ

XS_LOAD_FILE

XS_EEPROM_WRITE

XALYO SYSTEMS

Write a string to the PCI console


(blocking)

Read a string from the PCI


console (blocking)

Load a file into XS1000 host


memory

Send a command for execution to


the MIPS processor
Read a value from an I2C serial
Eeprom location

Write a value to an I2C serial


Eeprom location

Does a DMA to or from XS card


host, packet or parameter
memory
Enables PHY interrupts
Wait for a PHY interrupt
Wait for a serial event from
WinPath
Boots the MIPS over PCI

35

Generic Software for XS PMCs

XS_SFP_ENABLE_TX

XS_SFP_PRESENT

13

XS_VAL_DESC

14

devNo: Device number


port: Port number
value : 0 disable, 1 enable
XS_VAL_DESC
devNo: Device number
port: Port number
value: Result returned here

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

devNo: Device number


port: Port number
value: Byte number when
calling the ioctl, result on
return.
XS_VAL_DESC
devNo: Device number
port: Port number
value: Result returned here

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

(internal, not for user)

Enables or disables the


transceiver Tx optical signal

The value field is set to 1 if the


SFP transceiver is present and is
set to 0 if the SFP can not be
detected. There is a
xs_sfp_present() call available in
the PHY library (see xsPhy.h)
Configures a WinPath GPIO pin
The value field contains the value
of the specified 8-bit register.
There is a xs_sfp_byte_value()
and a xs_sfp_field_value() call
available in the PHY library (see
xsPhy.h)
The value field is set to 1 if the
SFP transceiver detects an
internal fault and is set to 0 if the
SFP is in good condition. There is
a xs_sfp_fault() call available in
the PHY library (see xsPhy.h)
The value field is set to 1 if the
SFP transceiver detects a Loss of
Signal and is set to 0 if the signal
is OK. There is an xs_sfp_los()
call available in the PHY library
(see xsPhy.h)
Returns the value of a 32-bit
microsecond timer on the PMC
-

Figure 8-1: Supported ioctls

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

Doesnt perform any hardware initialization, but


initializes the PHY library.

XALYO SYSTEMS

Generic Software for XS PMCs

PHY_MODE_ATM
PHY_MODE_POS

1
2

Initializes port in ATM mode


Initializes port in POS mode

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

Figure 8-3: xs_phy_info

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

Figure 8-7: xs_phy_is_enabled

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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

*/

Figure 8-19: XS_PHY_CLOCKING

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,

Figure 8-20: XS_PHY_FRAMING

typedef enum {
ATM_FRACTIONAL_FULL = 0,
ATM_FRACTIONAL_HALF,
ATM_FRACTIONAL_THREE_QUARTER
} XS_PHY_FRACTION;

/* default

*/

Figure 8-21: XS_PHY_FRACTION

typedef struct {
unsigned int TX;

XALYO SYSTEMS

/* sent cells

*/

43

Generic Software for XS PMCs

unsigned int RX;


unsigned int CHCS;
unsigned int UHCS;
unsigned int SBIP;
unsigned int LBIP;
unsigned int PBIP;
unsigned int LFEBE;
unsigned int PFEBE;
unsigned int TXB;
unsigned int RXB;
unsigned int RXABORT;
unsigned int FCS;
unsigned int MINLEN;
unsigned int MAXLEN;
unsigned int TXABORT;
unsigned int TXUNDER;
} XS_SONET_SDH_STATS;

/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*

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

*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/

Figure 8-22: XS_SONET_SDH_STATS

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

*/
*/
*/
*/
*/
*/
*/
*/
*/

Figure 8-23: XS_TDM_STATS

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

*/
*/

Figure 8-24: XS_PHY_STATS

typedef enum {
PAIS=0,
PRDI,
PFEBE,
BER3,

44

/*
/*
/*
/*

Path
Path
path
Path

Alarm Indication Signal


Remote Defect Indication
FEBE
BIP 3 Error

*/
*/
*/
*/

XALYO SYSTEMS

Generic Software for XS PMCs

LAIS,
LRDI,
LFEBE,
BER2,

/*
/*
/*
/*

Line
Line
line
Line

Alarm Indication Signal


Remote Defect Indication
FEBE
BIP 2 Error

*/
*/
*/
*/

BER1,

/* Section BIP 1 Error

*/

AIS,
RAI,
RED,

/* Alarm Indication
/* Remote Alarm Indication
/* RED alarm

*/
*/
*/

LOCD,
LOP,
LOF,
LOS,
OOF,
OCD,
HEC,
FCS = HEC,
SDEG,
CRC = SDEG,

/*
/*
/*
/*
/*
/*
/*
/*
/*

Loss of Cell Delineation


Loss of Pointer
Loss of Frame
Loss of Signal
Out of Frame
Out of Cell Delineation
HEC
FCS
Signal degrade

*/
*/
*/
*/
*/
*/
*/
*/
*/

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

*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/

Figure 8-25: XS_PHY_STATUS

8.2.3 Summary of driver options


The only option of the Generic Driver is the level of debug messages:

xsDebugLevel: debug level

Set the debug level to 4 to see driver installation messages.

8.2.4 Examples and Utilities

8.2.4.1

xsmipsreset

XALYO SYSTEMS

45

Generic Software for XS PMCs

DESCRIPTION:
xsmipsreset resets the MIPS CPU.

USAGE:
xsmipsreset [keep [devNo]]
devNo:

Device number (default = 0)

keep:

If keep is 0, the MIPS is reset and brought out of


reset. If different from 0, the MIPS stays in reset.
(default = 0)

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

Generic Software for XS PMCs

xseepromdump devNo eeprom_type offset length


devNo:

Device number

eeprom_type:

Eeprom type
EEPROM_WPATH
EEPROM_PSPAN

0:
1:

WinPath EEPROM
PowerSpanII EEPROM

offset:

Offset in EEPROM where the dump shall start

length:

Number of bytes to dump

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

Offset in EEPROM where the dump shall start

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

Generic Software for XS PMCs

EEPROM_PSPAN

1:

PowerSpanII EEPROM

offset:

Offset in EEPROM where the dump shall start

value:

value to write into the EEPROM

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:

Name of the file to load

offset:

Offset in PMC memory

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

Generic Software for XS PMCs

XALYO SYSTEMS

49

Generic Software for XS PMCs

8.3 ATM & Ethernet driver


8.3.1 Overview
The ATM & Ethernet driver supports:

ATM termination:
o ATM Raw cells (AAL0)
o AAL1
o AAL2
o AAL5
o OAM

Gigabit Ethernet termination

ATM to Ethernet/IP interworking

There are two options for the driver:

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.

8.3.2 Buffer Partitioning


The network processor assigns a buffer pool for each channel (VC or CID). This means that the user
shall make a trade-off between the number of simultaneously open channels and the number of buffer
per channel. Obviously if a channel is assigned more buffers, there are less chances that frames will
be discarded while receiving bursts.

50

XALYO SYSTEMS

Generic Software for XS PMCs

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:

Buffer pool for transmission


Buffer pool for interworking
Buffer pool for "short SDU" ring buffers
Buffer pool for "large SDU" ring buffers

One ring buffer is needed per channel (VC or CID).


In order to be able to receive frames larger than 4 Kbytes, thus spanning several buffers, on a certain
channel, this channel must be associated to a "large SDU" ring buffer, which has 17 buffers.
For channels receiving small frames (e.g. voice channels), they can be associated them with "short
SDU" ring buffer. The number of buffers in this ring depends on the remaining buffers in the system.
This needs to be configured at two levels:
1) Specify the maximum SDU in the xsAtmPvc_t structure when the channel is created. If the
maximum SDU is less than 4K, the channel will be automatically associated with a "short PDU" ring
buffer, otherwise it will be associated with a "large PDU" ring buffer.
2) The driver needs to be told the number of transmit buffers, interworking buffers, short rings, large
rings. This can be done via 4 global variables. With VxWorks, the variables can be set before starting
the driver. With Linux, these variables need to be set on the command line while installing the module.

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

// 27K buffers remaining


// 23K buffers remaining
// 128 * 17 = 2176 buffers, ca. 21K buffers remaining
// 21 K / 2500 = 8 buffers per short ring.

*************************************
*
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

Generic Software for XS PMCs

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).

8.3.3 Quality of Service


The following traffic classes are supported on ATM channels:
UBR: Unspecified Bit Rate (Best effort)
CBR: Constant Bit Rate
VBR: Variable Bit Rate
AAL2 channels require having CBR or VBR traffic class. Otherwise any traffic class can be used with
any AAL type.
The hardware restricts an AAL2 channel to handle more than around 115,000 cells per second. Trying
to bind an AAL2 channel with a higher rate will result in an error.
On AAL2 channels, the QoS is per VC and not per CID. This means that some parameters of the
xsAtmPvc_t structure are only used when binding the first CID on a VC:

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

Generic Software for XS PMCs

Figure 8-26: AAL5 to IP/UDP interworking example


Figure 8-27 shows which fields of the Ethernet/IP/UDP headers are statically defined when creating
the interworking flow and which fields are dynamically updated while traffic is going through the
interworking unit.

Figure 8-27: Dynamic Ethernet/IP/UDP field update


The following interworking types are implemented:

ATM Raw cells over IP/UDP


Mapping: VPI/VCI to Ethernet/IP/UDP port and Ethernet/IP/UDP port to VPI/VCI
There are two option for this interworking mode. If the iwOptions in the xsAtmPvc_t structure
is set to XS_IW_OPTIONS_NONE (0), the ATM cell header is carried over UDP along with the
ATM cell payload. This allows to carry all the information contained in the ATM header (end of
AAL5 PDU, CLP, ). In this case the VPI and VCI fields of the xsAtmPvc_t structure is not
used in the Ethernet to ATM direction. If the iwOptions in the xsAtmPvc_t structure is set to
XS_IW_OPTIONS_RAW_HEADER_REPLACE (1), the ATM cell header is not carried in the
UDP packet and is built from the VPI and VCI fields of the xsAtmPvc_t structure. In this case
the 4 LSB bits of the ATM header are all set to 0.

AAL2 CPS and SSSAR over IP/UDP

XALYO SYSTEMS

53

Generic Software for XS PMCs


Mapping: VPI/VCI/CID to Ethernet/IP/UDP port and Ethernet/IP/UDP port to VPI/VCI/CID

AAL5 over IP/UDP


Mapping: VPI/VCI to Ethernet/IP/UDP port and Ethernet/IP/UDP port to VPI/VCI

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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.

Figure 8-38: xsAtmOamVPCreate

8.3.6.11 xsAtmOamVPDelete()

58

XALYO SYSTEMS

Generic Software for XS PMCs

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.

Figure 8-39: xsAtmOamVPDelete

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.

Figure 8-40: xsAtmOamSend

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

Generic Software for XS PMCs

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.

Figure 8-41: xsAtmOamCallBack

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.

Figure 8-42: xsGetHwInfo

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.

Figure 8-43: xsIwCreate

60

XALYO SYSTEMS

Generic Software for XS PMCs

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.

Figure 8-44: xsIwCreate

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

Generic Software for XS PMCs

unsigned char *buf,


int len );
Description:
xsGenetSend() sends an Ethernet packet on the selected port of the selected device. The
device and port shall be enabled prior to calling xsGenetEnablePort().
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-46:xsGenetSend

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

Generic Software for XS PMCs

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:

Pointer to the packet


Packet length
User argument specified when installing the callback

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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 the first entry in the table


returns the next entry in the table

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

Generic Software for XS PMCs

int xsArpEntryDelete ( unsigned int itf, unsigned int port,


unsigned int ip );
Description:
xsArpEntryDelete() deletes an entry from the ARP table.
Returns:
0 on success,
-XS_ENOARP if there is no entry to return,
Figure 8-57:xsArpEntryDelete

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

/*
/*
/*
/*

Use AAL2 SSTED


Use AAL2 SSSAR
Use AAL2 CPS
Or with any of the three above

*/
*/
*/
*/

#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

Generic Software for XS PMCs

#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)

// Not supported yet


// Not supported yet
// Not supported yet
// Not supported yet

#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

8.3.6.31 Data Structures


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
} xsAtmPvc_t;

xsAtmPvc_t {
aal;
itf;
port;
vpi;
vci;
aal5MaxSdu;
aal2SubLayer;
aal2CpsCid;
aal2CpsMaxCid;
aal2CpsMaxSdu;
aal2CpsTimerCu;
aal2SssarMaxSdu;
aal2SssarRasTimer;
tclass;
pcr;
scr;
mbs;
cdvt;
rclass;
aal1RxBufferSize;
iwOptions;

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

AAL type (ATM_AALx)


Interface number
Port number
VPI
VCI
Max AAL5 frame size
AAL2_CPS, SSSAR or SSTED
AAL2 CID number
Value of highest CID
Max CPS SDU (45 or 64)
Timer CU in microseconds
Max SSSAR SDU
AAL2 RAS Timer in milliseconds
Tx traffic class (ATM_CBR, )
Peak Cell Rate in cps
Sustainable Cell Rate
Max Burst Size in bytes
Cell delay variation in cps
Rx traffic class
Size of the Rx buffer
Options for interworking VCs

Figure 8-59: xsAtmPvc_t

typedef struct xsIPFlow_t {


unsigned int
itf;
unsigned int
port;
unsigned int
iwtype;
unsigned char ethsrc[6];
unsigned char ethdst[6];

68

//
//
//
//
//

Interface number
Port number
IW type (XS_IW_ATM_OVER_UDP)
Src ETH MAC address
Dst ETH MAC address

XALYO SYSTEMS

Generic Software for XS PMCs

unsigned short
unsigned int
unsigned int
unsigned char
unsigned short
unsigned short
} xsIPFlow_t;

ethprotocol;
ipsrc;
ipdst;
ipprotocol;
udpsrc;
udpdst;

//
//
//
//
//
//
//

Uses ARP if all zeroes


ETH protocol (0x0800)
IP source address
IP destination address
IP protocol (UDP = 0x11)
UDP port (source)
UDP port (destination)

Figure 8-60: xsIPFlow_t

typedef struct xsArpTableEntry_t {


unsigned int itf;
unsigned int port;
unsigned int ip;
unsigned char ha[6];
unsigned int flag;
unsigned int valid;
} xsArpTableEntry_t;

//
//
//
//
//
//

Interface number
Port number
IP address
ETH MAC address
ARP_OWN or ARP_RESOLVED
Valid if non zero

Figure 8-61: xsArpTableENtry_t

typedef struct xsAal0Stats_t{


int tx;
int rx;
int rxSoftDrop;
int rxLenErr;
} xsAal0Stats_t;
Figure 8-62: xsAal0Stats_t

typedef struct xsAal1Stats_t{


int tx;
int rx;
int rxSoftDrop;
int rxLenErr;
int rxSeqErr;
int rxSnpErr;
int rxOverrunErr;
} xsAal1Stats_t;
Figure 8-63: xsAal1Stats_t

typedef struct xsAal2Stats_t{


int tx;
int rx;
int rxSoftDrop;
int error[23];
} xsAal2Stats_t;
Figure 8-64: xsAal2Stats_t

XALYO SYSTEMS

69

Generic Software for XS PMCs

typedef struct xsAal34Stats_t{


int tx;
int rx;
int rxSoftDrop;
int rxLenErr;
} xsAal34Stats_t;
Figure 8-65: xsAal34Stats_t

typedef struct xsAal5Stats_t{


int tx;
int rx;
int rxSoftDrop;
int rxCrcErr;
int rxLenErr;
} xsAal5Stats_t;
Figure 8-66: xsAal5Stats_t

typedef struct xsRawStats_t{


int tx;
int rx;
int rxSoftDrop;
} xsRawStats_t;
Figure 8-67: xsRawStats_t

typedef struct xsOamStats_t{


int tx;
int rx;
int rxSoftDrop;
int ais;
int loop;
} xsOamStats_t;
Figure 8-68: xsOamStats_t

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

Generic Software for XS PMCs

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;

Figure 8-69: xsIwStats_t

typedef struct xsAalStats_t{


xsAal0Stats_t aal0;
xsAal1Stats_t aal1;
xsAal2Stats_t aal2;
xsAal34Stats_t aal34;
xsAal5Stats_t aal5;
xsRawStats_t
raw;
xsOamStats_t
oam;
xsIwStats_t
iw ;
} xsAalStats_t;
Figure 8-70: xsAalStats_t

typedef struct xsAtmVcStats_t {


xsAtmPvc_t
pvcInfo;
xsAalStats_t aalStats;
unsigned int iwType;
xsIPFlow_t
ipFlow;
} xsAtmVcStats_t;
Figure 8-71: xsAtmVcStats_t

typedef struct xsNicStats_t{


unsigned int tx;
unsigned int txAck;
unsigned int rx;
unsigned int rxErr;
unsigned int rxSoftDrop;
unsigned int rxHardDrop;
unsigned int rxUnknown;
unsigned int uptime;
unsigned int atmAddrErr;
unsigned int atmLastAddrErr;
} xsNicStats_t;

//
//
//
//
//
//
//
//
//
//

Frames scheduled for tranmit


Frames sent on media
Received frames
Errored frames
Frames dropped by software
Frames dropped by hardware
Unknown errors
Minutes since driver started
Number of unknown cells received
Last unknown ATM header (w/o HEC)

Figure 8-72: xsNicStats_t

typedef struct xsAtmDevStats_t {


char
name[32];

XALYO SYSTEMS

// Device name

71

Generic Software for XS PMCs

unsigned int ports;


xsNicStats_t nicStats;
xsAalStats_t aalStats;
} xsAtmDevStats_t;

// Number of ports

Figure 8-73: xsAtmDevStats_t

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

Generic Software for XS PMCs

unsigned int tx_err_underrun;


unsigned int rx_err_overrun;
unsigned int tx_frames;
unsigned int rx_hard_drops;
unsigned int rx_soft_drops;
} xsGenetStats_t;
Figure 8-74: xsGenetStats_t

typedef struct xsHwInfo_t {


char hwName[16];
char hwSerial[8];
char hwRevision[8];
char hwDateCode[8];
} xsHwInfo_t;
Figure 8-75: xsHwInfo_t

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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;

extern int xsAtmErrno;


extern int xsGenetErrno;

// Driver options, see next section

// Holds the last error code for ATM calls


// Holds the last error code for Genet calls

Figure 8-77: Globals

8.3.7 Summary of driver options


There are several options to the ATM & Gigabit Ethernet driver. There are summarized below.

atmUUIValueAAL2:

Value of UUI field for AAL2 frames.

atmUUIValueAAL5:

Value of UUI field for AAL5 frames.

atmTxBufferNum:

Number of 4 Kbytes buffers allocated for frame


transmission.

atmShortRingLen:

Number of buffers per VC with short ring


buffer.

atmLargeRingLen:

Number of buffers per VC with large ring


buffer.

atmIwBufferNum:

Number of 4 Kbytes buffers allocated for


interworking.

XALYO SYSTEMS

75

Generic Software for XS PMCs

ethMedia:

Type of Ethenet media. Can be copper or


fiber.

atmAAL1Driver:

Force the selection of the AAL1 driver.

8.3.8 Examples and utilities

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:

Number of time the packet is sent

rate:

CBR peak cell rate in cells per second.


Figure 8-78: send_aal1

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

Generic Software for XS PMCs

vpi:

VPI

vci:

VCI

size:

packet size

iter:

Number of time the packet is sent

rate:

CBR peak cell rate in cells per second.

tCU:

timerCU in microseconds

subLayer:

AAL2_CPS (0), AAL2_SSSAR (1) or AAL_SSTED (2).


If ored with 0x10, uses AAL2_PF.
Figure 8-79: send_aal2

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:

Number of time the packet is sent

rate:

CBR peak cell rate in cells per second.


Figure 8-80: send_aal5

8.3.8.4

send_raw

DESCRIPTION:
send_raw sends raw ATM cells

USAGE:

XALYO SYSTEMS

77

Generic Software for XS PMCs

send_raw itf port header iter [rate]


itf:

Device number

port:

port number

header:

ATM header w/o HEC

iter:

Number of time the packet is sent

rate:

CBR peak cell rate in cells per second.


Figure 8-81: send_raw

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:

Number of time the packet is sent

createVP:

Set to one if the VP must be created. Clear to


zero if the VP is already created.

createVC:

Set to one if the VC must be created. Clear to


zero if the VC is already created.

XALYO SYSTEMS

Generic Software for XS PMCs

Figure 8-82: send_oam

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:

Number of expected frames.

rxBufferSize:

Size of the Rx buffer. PDUs are delivered only


when rxBufferSize bytes are received. The
default is 47 bytes.
Figure 8-83:receive_aal1

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:

Number of expected frames

subLayer:

AAL2_CPS (0), AAL2_SSSAR (1) or AAL_SSTED (2).

XALYO SYSTEMS

79

Generic Software for XS PMCs

If ored with 0x10, uses AAL2_PF. The default


is AAL2_CPS.
Figure 8-84: receive_aal2

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:

Number of expected frames


Figure 8-85: receive_aal5

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:

Number of expected ATM cells


Figure 8-86: receive_raw

80

XALYO SYSTEMS

Generic Software for XS PMCs

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:

Number of expected OAM cells

createVP:

Set to one if the VP must be created. Clear to


zero if the VP is already created.

createVC:

Set to one if the VC must be created. Clear to


zero if the VC is already created.

Figure 8-87: receive_oam

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:

If menu option is set to one of the menu


options, xsatmmonitor executes directly this
option without prompting the user for the
option.
Figure 8-88: xsatmmonitor

8.3.8.12 perf_aal2
DESCRIPTION:
XALYO SYSTEMS

81

Generic Software for XS PMCs

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:

Device number (eg 0)

port:

port number (eg 0)

vpi:

VPI (eg 1)

vci:

VCI (eg 55)

size:

frame size (eg 36)

iter:

Number of frames to send and receive (eg 100)

rate:

CBR peak cell rate. (eg 45000)

timerCU:

TimerCU in microseconds (eg 1000)

channels:

Number of VCs (eg 2000)

cid_per_vc:

Number of CIDs per VC (eg 200)

subLayer:

AAL2_CPS (0), AAL2_SSSAR (1) or AAL_SSTED (2).


If ored with 0x10, uses AAL2_PF. The default
is AAL2_CPS. (eg 2)
Figure 8-89: perf_aal2

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:

Device number (eg 0)


Figure 8-90: get_hw_info

8.3.8.14 genet_send

82

XALYO SYSTEMS

Generic Software for XS PMCs

DESCRIPTION:
genet_send sends Ethernet frames

USAGE:
send_aal2 itf port size iter
itf:

Device number

port:

port number

size:

packet size

iter:

Number of time the packet is sent


Figure 8-91: genet_send

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:

Number of expected frames


Figure 8-92: genet_receive

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

8.4 POS driver


8.4.1 Overview
The POS driver supports POS (Packet over SONET/SDH) termination.

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

Generic Software for XS PMCs

-XS_ENODEV if device is invalid,


-XS_EINVAL if port is invalid
Figure 8-98:xsPosEnablePort

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

Generic Software for XS PMCs

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-100:xsPosBlock

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:

Pointer to the packet


Packet length
User argument specified when installing the callback

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

buffer)
// Number of cells dropped by
the software (lack of CPU
time)

unsigned int rx_soft_drops;

} xsPosStats_t;
Figure 8-104:Structures

8.4.2.9

POS globals

int xsPosErrno;

// Holds the last error code


Figure 8-105:Globals

8.4.3 Summary of driver options


There are no options for the POS driver at the moment.

8.4.4 Examples and utilities

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:

Number of time the packet is sent


Figure 8-106: pos_send

8.4.4.2

pos_receive

DESCRIPTION:
pos_receive waits and receives POS packets

XALYO SYSTEMS

89

Generic Software for XS PMCs

USAGE:
pos_receive device port iterations
device:

Device number

port:

port number

iterations:

Number of time the packet is sent


Figure 8-107: pos_receive

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

Generic Software for XS PMCs

8.5 AGA driver


8.5.1 Overview
The AGA driver is a simple but powerful driver who can send and receive ATM raw cells at OC-3 rate.
The driver sends and receives all the ATM cells, regardless of their ATM header.
All cells are sent on the same channel without traffic shaping.
All received cells are time-stamped.

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

Generic Software for XS PMCs

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-110:xsAgaEnablePort

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

Generic Software for XS PMCs

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:

Pointer to the 48 byte cell payload


Cell header
User argument specified when installing the callback
Timestamp in microsecond

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

Generic Software for XS PMCs

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

typedef struct xsAgaStats_t {


unsigned int rx_frames;
unsigned int tx_frames;
unsigned int rx_hard_drops;
unsigned int rx_soft_drops;

94

// Number of received cells


// Number of send cells
// Number of cells dropped by the
hardware (lack of buffer)
// Number of cells dropped by the

XALYO SYSTEMS

Generic Software for XS PMCs

software (lack of CPU time)


} xsAgaStats_t;
Figure 8-116:Structures

8.5.2.9

Globals

int xsAgaErrno;

// Holds the last error code


Figure 8-117:Globals

8.5.3 Summary of driver options


There are no options for the AGA driver at the moment.

8.5.4 Examples and utilities

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:

ATM cell header (without HEC)

iterations:

Number of time the packet is sent


Figure 8-118: aga_send

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

Generic Software for XS PMCs

aga_receive device port iterations filename


device:

Device number

port:

port number

iterations:

Number of time the packet is sent

filename:

Name of file where to store ATM cells


Figure 8-119: aga_receive

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 :

File from which to send traffic


Figure 8-121: aga_send_from_file

96

XALYO SYSTEMS

Generic Software for XS PMCs

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

Generic Software for XS PMCs

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

Generic Software for XS PMCs

10 Glossary
A
AALx
AGA
AIS
APS
ATM

ATM Adaptation Layer x


ATM Generator and Analyzer
Alarm Indication Signal
Automatic Protection Switching
Asynchronous Transfer Mode

B
BER1
BER2
BER3

Section BIP 1 Error


Line BIP 2 Error
Path BIP 3 Error

C
CID
CPCI
CPSB

Channel Identifier
Compat PCI
Compact PCI Packet Switched Backplane

E
ESD
EJTAG

Electrostatic Discharge
Enhanced JTAG

G
GPRS

General Packet Radio Service

H
HDLC

High-Level Data Link Control

I
I2O
IEEE
IP

Intelligent I/O
Institute of Electrical and Electronics Engineers
Internet Protocol

J
JTAG

Joint Test Action Group

K
KB

Kilo Bytes

L
LAIS
LED
LFEBE
LOCD
LOF
LOP
LOS

Line Alarm Indication Signal


Light Emitting Diode
Line Far End Block Error
Loss of Cell Delineation
Loss of Frame
Loss of Pointer
Loss of signal

XALYO SYSTEMS

99

Generic Software for XS PMCs


LRDI

Line Remote Defect Indication

O
OC-3
OCD
OOF

Optical Carrier level 3 signal (SONET 155 Mbps)


Out of Cell Delineation
Out of Frame

M
MB
MPLS
MSA
MSC

Mega Bytes
Multi Protocol Label Switching
Multi Source Agreement
Mobile Switch Center

N
NNI

Network Node Interface and Network-to-Network Interface

P
PAIS
PCI
PFEBE
PICMG
PLL
PMC
POS
PPC
PPP
PPS
PRDI
PT1CC
PT1MC
PT4CC
PT4MC
PTMC

Path Alarm Indication Signal


Peripheral Component Interconnect
Path Far End Error Block
PCI Industrial Computer Manufactures Group
Phase Locked Loop
PCI Mezzanine Card
Packet over SONET
PowerPC
Point to Point Protocol
Packets per Seconds
Path Remote Defect Indication
PCI Telecom Carrier Card Option 1
PCI Telecom Mezzanine Card Option 1
PCI Telecom Carrier Card Option 4
PCI Telecom Carrier Card Option 4
PCI Telecom Carrier Card

R
RAI
RED
RNC
RSOC

Remote Alarm Indication


Red Alarm
Radio Network Controller
Receive Start of Cell

S
SDH
SDRAM
SFP
SGSN
SONET
SS7
STM-1
STS-3c

Synchronous Digital Hierarchy


Synchronous Dynamic Random Access Memory
Small Form Pluggable
Serving GPRS Support Node
Synchronous Optical Network
Signaling System 7
Synchronous Transport Mode 1
Synchronous Transport Signal level 3 Concatenated

T
TSOC

100

Transmit Start of Cell

XALYO SYSTEMS

Generic Software for XS PMCs

U
UNI

User Network Interface

UTOPIA

Universal Test & Operations PHY Interface for ATM

V
VC
VCI
VoIP
VPI
VME

Virtual Channel (Virtual Circuit)


Virtual Channel Identifier
Voice over IP
Virtual Path Identifier
Versa Module Eurocard

XALYO SYSTEMS

101

Você também pode gostar