Teridian Semiconductor Corporati on makes no warranty for the us e of its p r oduct s, other than expressly
contained in the Comp any’s warranty d etailed in the Terid ian S emiconductor Corporation st andar d Terms
and C onditions. The company assumes no responsibility for any errors which may appear in this
document, reserves th e r i ght to change devic es or sp ecifications detailed herein at any time withou t
notice and does n ot make any commitment to update the in formati on contained herein. Accordingl y, the
reader is cautioned to verify that t his document is current by comparing it to the latest vers ion on
http://www.teridian .com or by checking with your sales represen tative.
Teridian Semiconductor Corp., 6440 Oak Canyon, Sui te 100, I r vine, CA 92618
TEL (714) 508-8800, FAX (714) 508-8877, http://www.teridian.com
2 Rev. 2.2
Page 3
UG_1x66B_021 73M1866B/73M1966B TAPI High-Level Driver User Guide
5 Related Documentation ............................................................................................................... 34
6 Contact Information ..................................................................................................................... 34
Revision H istory .................................................................................................................................. 35
Rev. 2.2 3
Page 4
73M1866B/73M1966B TAPI High-Level Driver User Guide UG_1x66B_021
UG_1x66B_021 73M1866B/73M1966B TAPI High-Level Driver User Guide
Application
TAPI Driver
Teridian 73M1x66B Reference Driver
FXOCTL
(Command Line Interface)
TSC IOCTL
TAPI IOCTL
TSC IOCTL
1 Introduction
This document describes the functionalities of th e 73M1866B/73M1966B TAPI Driver. This driver
software is provided as part of the Infineon BSP package for Danube, Vinax and AR9 platforms. Its
design and implementation is tightly integ rated with Infin eon TAPI architecture, therefore, its sole purpose
is to be used in Infineon TAPI environment. In addition to this TAPI driver, the Teredian
73 M1 866B/73M1966B Reference Driver is also required as for interface to the 73M1x66 chip set.
The 73M1x66B TAPI driver is bu ilt as a l oadabl e mod ule. It will b e brought into operation by a user
application or by an operating system startup script. For Linux, the “insmod” command is used to insert
the driver into the kernel. The “ insmod” command invokes the module_init() macro, which in turn runs the
one-tim e in itialization funct ion of th e d river.
1.1 Purpose and Scope
IFX TAPI is the API l ayer used by In fineon. This vers ion of the Teridian TA PI driver i s comp l iant to IFX
TAPI Version 3.8.3. This specification is avai lable from Infineon.
The 73M1x66B TAPI Driver provides the necessary system interfac es for t he control and management of
the 73M1x66B. The driver supports ioctl calls from the appl ication and translates these to and from the
device vi a the Reference Driver layer .
The scope of this document will includes only the TAPI driver’s user interface. Detail of intern al d river
architecture can be found in the 73M1x66 B R eference Dri ver User Guide document.
Figure 1 illustrates the basic architecture model for the driver. The model is i ntended to be independent
of processor and operati ng s ys tem. Layers above the r eference driver addres s software interfaces which
may pre-exist for a given appl ication (e.g. Asterisk ®) and the layer below addresses hard ware related
interfaces between the pr ocessor and th e 73M1 x66B devices .
Figure 1: Driver Architecture
Rev. 2.2 5
Page 6
73M1866B/73M1966B TAPI High-Level Driver User Guide UG_1x66B_021
1.2 Conventions Used in this Guide
This document uses the following conventions:
• Software code, I OCTL names and data types are presented i n Cou r ier font.
• A table with a blue header i s a summary tabl e. A table with a gray header is a det ail table.
1.3 Acronyms
APOH – An other Phone O ff Hook
BSP – Board Support Package
DAA – Data A ccess Arran gem ent
FXO – Foreign eXchange Offic e
IOCTL – I/O Control
NOPOH – N o Phone Off Hook
POH – Phone Off Hook
6 Rev. 2.2
Page 7
UG_1x66B_021 73M1866B/73M1966B TAPI High-Level Driver User Guide
2 Driver Service Interface
The Driver Ser vice provid es th e link between the FXO device and the us er application. Firs t, th e driver
must be loaded and bonded into the operating syst em envir onment before this ser vice can be provided.
Acc ess to the driver i s done via two file d escriptors – the d evice and channel file d escriptors. The device
file descri ptor provides access to devi ce level management interface while the channel descriptor is used
to m anage at the channel level interface. The driver supports multiple FXO channels through separated
channel descriptors; however, only one d evice d escriptor is used.
The following sections describe how the driver is brought into action based on the operating system
environment.
2.1 Linux Operating System
This description is valid for Linux 2.4 and 2.6. The 73M1x66 B driver takes the form of a Linux standard
character device driver. It is brought i nto operation by a user application or by Linux startup script using
insmod command. This comm and inserts the driver module into the kernel which in turn registers with
the kernel using the default m aj or num ber of 221. Multiple FXO channels are supported vi a the use of
minor number which can varies from 0 to 16. This minor n um ber ass ociated with the devic e and ch annel
descriptors cr eated using mknod command. The driver expects the minor number 0 t o be associated with
the device descriptor and the number from 1 to 16 with the channel descriptors. Device maj or and min or
numbers are configurabl e at build time as descr i bed in the Reference Driver document.
The dev i ce and channel d escriptors must be created in the “/dev” direct ory at t he same time when the
driver is ins mod i nto the kernel. The mknod command is used to c r eate those descript or s as illust r ated
below:
mknod -m 660 /de v/ter10 c 221 0
mknod -m 660 /de v/ter11 c 221 1
In this example above one device d escriptor (ter10) is c r eated wit h major number 221, minor number 0,
and one channel descr i ptor (ter11) is created with maj or number 221, mi nor nu m ber 1.
Once the driver is installed and the device/channel descriptors are created, the dri ver service can be
accessed via standard C library
The foll owing illustrates how the device and chann el are opened, closed, and the ioctl access:
devfd = open("/dev/ter10",O_RDONLY|O_WRONLY);
chanfd = open (“/ dev /ter11”,O_RDONLY|O_WRONLY);
ioctl (devfd, M1 966 _EV ENT _GE T, &event_st ruc tur e);
ioctl (chanfd, M1966_ATH1, NULL);
close (devfd);
close (chanfd);
Acc essing the dr iver using ioctl must be done via an opened des criptor. There are two t ypes of i octl
command – the devic e level comm ands which can be acces sed by an opened devic e descr iptor and
channel l evel commands, whic h can be accessed using an opened channel descriptor. S ection 3
describes the ioctl command.
2.2 Other Operating Systems
open(), close(),and ioctl()functions.
To be provided.
Rev. 2.2 7
Page 8
73M1866B/73M1966B TAPI High-Level Driver User Guide UG_1x66B_021
IFX_TAPI_CH_INIT
IFX_TAPI_PCM_IF_CFG_SET
IFX_TAPI_PCM_CFG_SET
IFX_TAPI_PCM_CFG_GET
IFX_TAPI_PCM_ACTIVATION_SET
IFX_TAPI_PCM_ACTIVATION_GET
IFX_TAPI_EVENT_ENABLE
IFX_TAPI_EVENT_DISABLE
IFX_TAPI_EVENT_GET
IFX_TAPI_VERSION_GET
IFX_TAPI_DEBUG_REPORT_SET
IFX_TAPI_LINE_TYPE_SET
IFX_TAPI_PHONE_VOLUME_SET
IFX_TAPI_FXO_HOOK_SET
IFX_TAPI_FXO_FLASH_SET
IFX_TAPI_FXO_FLASH_CFG_SET
IFX_TAPI_FXO_BAT_ GET
IFX_TAP I_F XO_ APO H_ GET
IFX_TAP I_F XO_ RIN G_ GET
IFX_TAPI_FXO_POLARITY_ GET
IFX_TAPI_LASTERR
IFX_TAPI_FXO_LINE_MODE_SET
3 IFX TAPI IOCTL Commands Description
Once the driver is successfully opened the application can control the oper ation of the device and the
FXO channel . The application in user space communicates with the driver via standard Linux driver
interface IOCTL calls. The following sections describe the d etail of each IO C TL command.
Some commands pertain to device l evel config urati on such as PCM inter face parameters; these must be
called usi ng devic e descr iptor, while others are channel level commands and must be called using
specific channel descriptor, if more than one channel is active. Table 1 provides a s um m ary of the
IOCTLs.
Table 1: Summary of IFX TAP I IOCTLs
IOCTL Name DescriptionDescriptor
Initializing FXO ch annel for operation. Channel
Set PCM interface configuration. Device
Set PCM configuration. Channel
Retrieve PCM configurat ion. Channel
Activate/Deactivate PCM channel. Channel
Retrieve PCM activation state. Channel
En able FXO event d etection. Channel
Disable FXO event detec tion. Channel
Retrieve FXO event. Device
Retrieve driver version number. Device
Set driver debug message t r ace mas k. Device
Set l ine type – must be FXO only. Channel
Set speaker phone/micro phone volume. Channel
Iss ue on/off hook. Channel
Iss ue flash hook. Channel
Configure FXO hook flas h par ameter. Channel
Retrieve bat tery status. Channel
Retrieve APOH status. Channel
Retrieve ring status. Channel
Retrieve line pol ar ity s tatus. Channel
Retrieve driver last error code. Device
En able/D isabl e FXO channel. Channel
8 Rev. 2.2
Page 9
UG_1x66B_021 73M1866B/73M1966B TAPI High-Level Dr iv er User Guide
int
chan_fd
int
IFX_TAPI_CH_INIT
int
3.1 IFX_TAPI_CH_INIT
Description
Perfo r m all 73M1x66 channel initialization. This includes init ialize all defau lt registers and c ountry specific
threshold parameters.
int ioctl (
int dev_fd ,
int IFX_TAPI_LASTERR,
unsigned long param );
Parameters
Data T ype Name Description
Device descr iptor .
I/O control identifier for this operation.
unsigned long param
Return Values
The parameter poin ts to a
structure.
Data T ype Description
int
IFX_ERROR – F ailed to read last error code.
IFX_SUCCESS – Successful.
24 Rev. 2.2
Page 25
UG_1x66B_021 73M1866B/73M1966B TAPI High-Level Dr iv er User Guide
int
chan_fd
int
IFX_TAPI_FXO_LINE_MODE_SET
unsigned long
param
IFX_TAPI_FXO_LINE_MODES_t
3.22 IFX_TAPI_FXO_LINE_MODE_SET
Description
This service is used to manage (enable/d isabl e) the FXO chan nel. When disabl e d, the FXO channel is
inoperative and it does not monit or the physical l i ne for chan nel events, nor will it detect an y incoming ring
sig nal. H owever, it can be put back in op er ation using this ioctl with the “enable” parameter.
73M1866B/73M1966B TAPI High-Level Driver User Guide UG_1x66B_021
5 Related Documentation
The following 73M1x6 6B document s are available from Teri dian Semi conductor C orp or ation:
73M1866B/73M1966B Reference Driver User Manual
73M1866B/73M1966B D ata Sheet
73M1866B /73M1966B Demo Board User Manual
73M1866B /73M1966B GUI Use r Guide
73M1866B/73M1966B Layout Guidelines
73M1x 6 6 Wor ldwide Desi g n G uide
TAPI V3 User’s Manual (available from Infineon)
6 Contact Information
For m or e i nform ation about Teridian Semiconductor pr oduct s or to check the availability of the 73M1866B
and 73M1966B, contact us at:
644 0 Oak Canyon Road
Suite 100
Irvin e, CA 92618-5201