2 driver service interface, 1 linux operating system, 2 other operating systems – Maxim Integrated 73M1866B/73M1966B Infineon TAPI High-Level Driver User Manual

Page 7: Driver service interface, Linux operating system, Other operating systems

Advertising
background image

UG_1x66B_021

73M1866B/73M1966B TAPI High-Level Driver User Guide

Rev. 2.2

7

2 Driver Service Interface

The Driver Service provides the link between the FXO device and the user application. First, the driver
must be loaded and bonded into the operating system environment before this service can be provided.
Access to the driver is done via two file descriptors – the device and channel file descriptors. The device
file descriptor provides access to device level management interface while the channel descriptor is used
to manage at the channel level interface. The driver supports multiple FXO channels through separated
channel descriptors; however, only one device descriptor 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 73M1x66B driver takes the form of a Linux standard
character device driver. It is brought into operation by a user application or by Linux startup script using

insmod

command. This command inserts the driver module into the kernel which in turn registers with

the kernel using the default major number of 221. Multiple FXO channels are supported via the use of
minor number which can varies from 0 to 16. This minor number associated with the device and channel
descriptors created using mknod command. The driver expects the minor number 0 to be associated with
the device descriptor and the number from 1 to 16 with the channel descriptors. Device major and minor
numbers are configurable at build time as described in the Reference Driver document.

The device and channel descriptors must be created in the “/dev” directory at the same time when the
driver is insmod into the kernel. The mknod command is used to create those descriptors as illustrated
below:

mknod -m 660 /dev/ter10 c 221 0
mknod -m 660 /dev/ter11 c 221 1

In this example above one device descriptor (ter10) is created with major number 221, minor number 0,
and one channel descriptor (ter11) is created with major number 221, minor number 1.

Once the driver is installed and the device/channel descriptors are created, the driver service can be
accessed via standard C library

open()

, close(),

and

ioctl()

functions.


The following illustrates how the device and channel 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, M1966_EVENT_GET, &event_structure);
ioctl (chanfd, M1966_ATH1, NULL);
close (devfd);
close (chanfd);

Accessing the driver using ioctl must be done via an opened descriptor. There are two types of ioctl
command – the device level commands which can be accessed by an opened device descriptor and
channel level commands, which can be accessed using an opened channel descriptor.

Section 3

describes the ioctl command.

2.2 Other Operating Systems

To be provided.

Advertising