TPMC860-SW-82. Linux Device Driver. 4 Channel Isolated Serial Interface RS232 Version 1.4.x. User Manual. Issue 1.4.

Similar documents
TDRV002-SW-82. Linux Device Driver. Multi-Channel Serial Interface Version 1.8.x. User Manual. Issue November 2017

TPMC917-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. 4 MB SRAM with Battery Backup and 4 Channel Serial Interface Version 1.0.

The Embedded I/O Company TIP700-SW-82 Linux Device Driver User Manual TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC

TIP675-SW-82. Linux Device Driver. 48 TTL I/O Lines with Interrupts Version 1.2.x. User Manual. Issue November 2013

TCP866-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. 8 Channel Serial PMC Version 1.0.x. Issue 1.

TDRV011-SW-82. Linux Device Driver. Extended CAN Bus Version 1.0.x. User Manual. Issue April 2018

CARRIER-SW-82. Linux Device Driver. IPAC Carrier Version 2.2.x. User Manual. Issue November 2017

TPMC680-SW-82. Linux Device Driver. 64 Digital Input/Output Version 1.1.x. User Manual. Issue April 2010

TPMC810-SW-82. Linux Device Driver. User Manual. The Embedded I/O Company. Isolated 2x CAN Bus Version 1.2.x. Issue 1.2.

TPMC901-SW-95. QNX4 - Neutrino Device Driver. User Manual. The Embedded I/O Company. 6/4/2 Channel Extended CAN-Bus PMC

TDRV010-SW-95. QNX6 - Neutrino Device Driver. Isolated 2x CAN Bus. Version 1.0.x. User Manual. Issue September 2016

TDRV006-SW-42. VxWorks Device Driver. 64 Digital Inputs/Outputs (Bit I/O) Version 4.0.x. User Manual. Issue December 2017

TIP570-SW-95 QNX-Neutrino Device Driver TIP570 16/8 Channel 12 Bit ADC and 8 Channel 12 Bit DAC on SBS PCI40 Carrier

TIP670-SW-95. QNX-Neutrino Device Driver. User Manual. The Embedded I/O Company. Digital I/O. Version 1.0.x. Issue August 2008.

TIP866-SW-95. QNX-Neutrino Device Driver. 8 Channel Serial Interface IP. Version 2.1.x. User Manual. Issue October 2009

TPMC500-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. 32 Channel 12 Bit ADC. Version 2.0.x. Issue 2.0.

TIP700-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. Digital Output 24V DC. Version 2.0.x. Issue June 2008.

TIP610-SW-95 QNX-Neutrino Device Driver TIP610 16/20 Channel Digital I/O on SBS PCI40 Carrier

TPMC868-SW-42. VxWorks Device Driver. 16 Channel Serial PMC. Version 2.1.x. User Manual. Issue December 2011

TIP114-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. 10 Channel Absolute Encoder Interface (SSI) Version 1.0.

TIP120-SW-42. VxWorks Device Driver. Motion Controller with Incremental Encoder Interface. Version 2.1.x. User Manual. Issue 2.1.

TPMC Channel Isolated Serial Interface RS232. Version 1.0. User Manual. Issue August 2017

TPMC815-SW-72. LynxOS Device Driver. User Manual. The Embedded I/O Company. ARCNET Controller. Version 1.0.x. Issue 1.0 May 2004

TPMC821-SW-42. VxWorks Device Driver. User Manual. The Embedded I/O Company. INTERBUS Master G4 PMC. Version 1.4. Issue 1.

TCP Channel Serial Interface RS232 / RS422 cpci Module. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.

TPMC Channel Isolated Serial Interface RS422/RS485. Version 1.0. User Manual. Issue July 2009

TPMC851-SW-42. VxWorks Device Driver. Multifunction I/O (16 bit ADC/DAC, TTL I/O, Counter) Version 2.0.x. User Manual. Issue 2.0.

TPMC Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

TPMC550-SW-12 OS-9 for PPC Device Driver 8 (4) Channels Isolated 12-bit D/A

OPTO32A 24 Input Bit, 8 Output Bit Optical Isolator Board

TCP Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

TPMC810. Isolated 2x CAN Bus. Version 1.1. User Manual. Issue June 2009

Artisan Technology Group is your source for quality new and certified-used/pre-owned equipment

TPMC815 ARCNET PMC. User Manual. The Embedded I/O Company. Version 2.0. Issue 1.2 November 2002 D

TPMC310. Conduction Cooled PMC Isolated 2 x CAN Bus. Version 1.1. User Manual. Issue June 2014

TPMC Channel Serial Interface RS232/RS422. Version 1.0. User Manual. Issue August 2014

TPMC816. Two Independent Channels Extended CAN Bus PMC Module. Version 2.2. User Manual. Issue August 2014

TPMC Channel Motion Control. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 March 2003 D

TPMC Digital Inputs/Outputs (Bit I/O) Version 2.0. User Manual. Issue February 2014

TXMC885. Four Channel 10/100/1000 Mbit/s Ethernet Adapter. Version 1.0. User Manual. Issue October 2011

CARRIER-SW-42. VxWorks Device Driver. IPAC Carrier. Version 4.2.x. User Manual. Issue July 2018

TPMC /8 Digital Inputs (24V) 16/8 Digital Outputs (24V, 0.5A) Version 3.0. User Manual. Issue June 2014

PCI Express 4-Port Industrial Serial I/O Cards

Operating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line

User Manual VScom PCI Cards VScom Industrial Card

TIP550. Optically Isolated 8/4 Channel 12-bit D/A. Version 1.2. User Manual. Issue October 2009

PCI Express 16-Port Serial I/O Cards

spwr_base & spwr_chan

TIP120. Motion Controller with Incremental Encoder Interface. Version 1.0. User Manual. Issue August 2014

PCIe-400 USER S MANUAL

Korenix JetCard Series Multiport Serial Card/Ethernet Switch Card User s Manual

FlexCom104-GPS Manual

Low Profile 32-Bit PCI 4 Port Serial Card (16C FIFO)

ICS-121. VxWORKS DEVICE DRIVER MANUAL

TPCE260. PCI Express PMC Carrier. Version 1.0. User Manual. Issue August 2014

Xtreme/104. PC/104 Serial Communications. User Manual

TIP SERCOS IP with 2 Encoder Interfaces. User Manual. The Embedded I/O Company. Version 1.0. Issue 1.3 September 2006 D

TPMC500. Optically Isolated 32 Channel 12 Bit ADC. Version 1.1. User Manual. Issue January 2014

TIP815. ARCNET Controller. Version 1.0. User Manual. Issue September 2009

DYNAMIC ENGINEERING 150 DuBois St. Suite C, Santa Cruz, CA Fax Est.

TPMC x ADC, 16x/0x DAC and 8x Digital I/O. Version 1.0. User Manual. Issue May 2018

Lecture 3. Introduction to Unix Systems Programming: Unix File I/O System Calls

CPCI-ASIO4 CAN - RS-232, RS-422, RS-485

Release Notes CCURDSCC (WC-AD3224-DS)

PCI, PCIe, cpci, and PC104+ Plus Modules

MultiCom. for LabVIEW for Windows. Windows 95/98/NT Edition. Copyright , Viewpoint Software Solutions, Inc. All Rights Reserved

DYNAMIC ENGINEERING 150 DuBois, Suite C Santa Cruz, CA (831) Fax (831) Est

Experiment Number: 02. Title: PC-to-PC communication through RS-232 port

VXC/VEX Multi-Port Serial Card User Manual

EX & EX-45362IS 2S RS232/422/485 3-in-1 Serial PCIe Card

Communication. Serial port programming

Typical modules include interfaces to ARINC-429, ARINC-561, ARINC-629 and RS-422. Each module supports up to 8 Rx or 8Tx channels.

Janus-MM Basic CAN Driver For Linux 2.6.xx and Windows XP. User Manual Revision A

Lecture files in /home/hwang/cs375/lecture05 on csserver.

PCIe Card Selection Guide. PCIe-CAN Card. PCIe-COM Card. Taiwan Pulse Motion Co.,Ltd. Bus Interface PCI Express x 1 LPE-C122 PCE-C122D PCE-C122T

24DSI32 24DSI12 24-bit, 32 Channel Delta-Sigma A/D Boards

TIP111. Motion Controller with Absolute Encoder Interface (SSI) User Manual. The Embedded I/O Company. Version 1.1. Issue 1.4 September 2005 D

EZL-200F Application Notes (003) Serial Interface (RS232/RS422/RS485)

PCIeBiSerial-L3com1 One-Channel Half Duplex Interface

DYNAMIC ENGINEERING 435 Park Dr., Ben Lomond, Calif Fax Est

MODEL P104-COM232-8 USER MANUAL

Application Note AN-225

COSC Operating Systems Design, Fall Lecture Note: Unnamed Pipe and Shared Memory. Unnamed Pipes

Device: MOD This document Version: 1.0. Matches module version: v3 [29 June 2016] Date: 23 October 2017

MEC-COM-M134. User s Manual

MultiCom/MV 1.0. Comtrol RocketPort Guide. Copyright , Viewpoint Systems, Inc. All Rights Reserved

Linux Kernel Modules & Device Drivers April 9, 2012

DSC-200/300. User's Manual

UART Application Kit for Digi Embedded Linux User's Manual

QSC-200/300. User's Manual

sllin TTY discipline for UART-LIN device implementation P. Píša, R. Lisový, M. Sojka Czech Technical University in Prague DRAFT

ESC(LP)-100. Eight Channel Low Profile RS-232 Asynchronous Communications Adapter. for PCI bus. User's Manual

INTERFACES TRADITIONAL PC ADAPTER CARD. DATA SHEET page 1/6. Description

Series PMC520 Octal EIA/TIA-232E Communication Module

1.8 V single UART, 5 Mbit/s (max.) with 128-byte FIFOs, infrared (IrDA), and XScale VLIO bus interface

COM(PCI/C-PCI)Linux/RT GPH Asynchronous Serial Comunications Driver Software for Linux/RTLinux. Help for Linux.

QSC(LP)-100. User's Manual

CMSC 216 Introduction to Computer Systems Lecture 17 Process Control and System-Level I/O

Release Notes CCURDSCC (WC-AD3224-DS)

DM6420 Driver for Linux User s Manual Version 2.01.xx

Transcription:

The Embedded I/O Company TPMC860-SW-82 Linux Device Driver 4 Channel Isolated Serial Interface RS232 Version 1.4.x User Manual Issue 1.4.4 December 2011 TEWS TECHNOLOGIES GmbH Am Bahnhof 7 25469 Halstenbek, Germany Phone: +49 (0) 4101 4058 0 Fax: +49 (0) 4101 4058 19 e-mail: info@tews.com www.tews.com

TPMC860-SW-82 Linux Device Driver 4 Channel Isolated Serial Interface RS232 This document contains information, which is proprietary to TEWS TECHNOLOGIES GmbH. Any reproduction without written permission is forbidden. TEWS TECHNOLOGIES GmbH has made any effort to ensure that this manual is accurate and complete. However TEWS TECHNOLOGIES GmbH reserves the right to change the product described in this document at any time without notice. TEWS TECHNOLOGIES GmbH is not liable for any damage arising out of the application or use of the device described herein. 2001-2011 by TEWS TECHNOLOGIES GmbH Issue Description Date 1.0 First Issue September 2001 1.1 General Revision March 2004 1.2.0 Kernel 2.6.x Support March 2005 1.3.0 Built-In-Self-Test added May 23, 2005 1.4.0 Introduction and installation section (file list) modified March 29, 2006 1.4.1 File list modified, New Address TEWS LLC, general revision November 6, 2006 1.4.2 File list corrected January 20, 2009 1.4.3 Address TEWS LLC removed April 14, 2010 1.4.4 General Revision December 21, 2011 TPMC860-SW-82 - Linux Device Driver Page 2 of 19

Table of Contents 1 INTRODUCTION... 4 2 INSTALLATION... 5 2.1 Build and install the Device Driver...6 2.2 Uninstall the Device Driver...6 2.3 Install Device Driver into the running Kernel...7 2.4 Remove Device Driver from the running Kernel...7 2.5 Change Major Device Number...8 2.6 FIFO Configuration...9 3 DEVICE INPUT/OUTPUT FUNCTIONS... 10 3.1 open...10 3.2 close...12 3.3 ioctl...13 3.3.1 TPMC860_IOCQ_BIST...15 4 DEVICE DRIVER PROGRAMMING... 18 5 DIAGNOSTIC... 19 TPMC860-SW-82 - Linux Device Driver Page 3 of 19

1 Introduction The TPMC860-SW-82 Linux device driver is a full-duplex serial driver which allows the operation of a TPMC860 module on Linux operating systems. The TPMC860-SW-82 device driver based on the standard Linux serial device driver and supports all standard terminal functions (TERMIOS). Supported features: Extended baudrates up to 460800 BAUD. Each channel has a 64 Byte transmit and receive hardware FIFO Programmable trigger level for transmit and receive FIFO. Hardware (RTS/CTS) and software flow control (XON/XOFF) direct controlled by the serial controller. The advantage of this feature is that the transmission of characters will immediately stop as soon as a complete character is transmitted and not when the transmit FIFO is empty for handshake under software control. This will greatly improve flow control reliability. Designed as Linux kernel module with dynamically loading. Supports shared IRQ s. Build on new style PCI driver layout Creates a TTY device and dialout device (Kernel 2.4.x) with dynamically allocated or fixed major device numbers. DEVFS and UDEV support for automatic device node creation IOCTL function for a Built-In-Self-Test The TPMC860-SW-82 device driver supports the modules listed below: TPMC860-10 4 Channel Isolated Serial Interface RS232 (PMC) To get more information about the features and use of TPMC860 device it is recommended to read the manuals listed below. TPMC860 User manual TPMC860 Engineering Manual ST16C554 UART Hardware Manual TPMC860-SW-82 - Linux Device Driver Page 4 of 19

2 Installation The directory TPMC860-SW-82 on the distribution media contains the following files: TPMC860-SW-82-1.4.4.pdf TPMC860-SW-82-SRC.tar.gz Release.txt ChangeLog.txt This manual in PDF format GZIP compressed archive with driver source code Release information Release history The GZIP compressed archive TPMC860-SW-82-SRC.tar.gz contains the following files and directories: example/makefile example/tpmc860example.c example/tpmc860setspeed.c example/tpmc860bist.c hal/ hal/makefile hal/tpmc860hal.c hal/tpmc860haldef.h include/tpmodule.c include/tpmodule.h include/config.h include/tpxxxhwdep.c include/tpxxxhwdep.h serial/ serial/makefile serial/tpmc860serial.c serial/tpmc860serialdef.h serial/2.4.x serial/2.4.x/makefile serial/2.4.x/tpmc860serial.c serial/2.4.x/tpmc860serialdef.h serial/makenode tpmc860def.h tpmc860.h Example application makefile Send and receive example application Speed configuration example application Example for using Built-In-Self-Test Hardware abstraction layer driver needed for all kernel versions HAL driver makefile HAL driver source file HAL driver private header file Driver independent library Driver independent library header file Driver independent library header file HAL low level WINNT style hardware access functions source file Access functions header file UART driver directory (for Kernels 2.6.x and newer) Serial driver makefile Serial driver source file Serial driver private header file Kernel 2.4.x sources directory Serial driver makefile Serial driver source file Serial driver private header file Shell script to create devices nodes manually Driver private header file User application header file In order to perform an installation, extract all files of the archive TPMC860-SW-82-SRC.tar.gz to the desired target directory. The command tar -xzvf TPMC860-SW-82-SRC.tar.gz will extract the files into the local directory. Login as root and change to the target directory Copy tpmc860.h to /lib/modules/<version>/build/include and /usr/include TPMC860-SW-82 - Linux Device Driver Page 5 of 19

2.1 Build and install the Device Driver Login as root Change to the TPMC860 target directory To create and install the HAL driver and SERIAL driver in the module directory /lib/modules/<version>/misc enter: # make install To update module dependencies enter: # depmod -aq 2.2 Uninstall the Device Driver Login as root Change to the target directory To remove the driver from the module directory /lib/modules/<version>/misc enter: # make uninstall TPMC860-SW-82 - Linux Device Driver Page 6 of 19

2.3 Install Device Driver into the running Kernel To load the device driver into the running kernel, login as root and execute the following commands: # modprobe tpmc860serialdrv After the first build or if you are using dynamic major device allocation it s necessary to create new device nodes on the file system. Please execute the script file makenode, which resides in serial/ directory, to do this. If your kernel has enabled the device file system (devfs, udev, ) then skip running the makenode script. Instead of creating device nodes from the script the driver itself takes creating and destroying of device nodes in its responsibility. # sh makenode On success the device driver will create a minor device for each compatible channel found. The first channel of the first PMC module can be accessed with device node /dev/ttystpmc860_0, the second channel with device node /dev/ttystpmc860_1 and so on. The assignment of device nodes to physical PMC modules depends on the search order of the PCI bus driver. 2.4 Remove Device Driver from the running Kernel To remove the device driver from the running kernel login as root and execute the following command: # modprobe r tpmc860serialdrv If your kernel has enabled a device file system (devfs, udev,...), all /dev/ttystpmc860_* nodes will be automatically removed from your file system after this. Be sure that the driver isn t opened by any application program. If opened you will get the response tpmc860serialdrv: Device or resource busy and the driver will still remain in the system until you close all opened files and execute modprobe r again. TPMC860-SW-82 - Linux Device Driver Page 7 of 19

2.5 Change Major Device Number This paragraph is only for Linux kernels without a device file system (devfs, udev,...) installed. The released TPMC860 driver uses dynamic allocation of major device numbers. If this isn t suitable for the application it s possible to define a major number separately for the TTY and CUA driver. To change the major number edit the file tpmc860serial.c, change the following symbols to appropriate values and enter make install to create a new driver. TPMC860_TTY_MAJOR TPMC860_CUA_MAJOR Defines the value for the terminal device. Valid numbers are in range between 0 and 255. A value of 0 means dynamic number allocation. Defines the value for the dialout device. Valid numbers are in range between 0 and 255. A value of 0 means dynamic number allocation. Example: #define TPMC860_TTY_MAJOR 122 #define TPMC860_CUA_MAJOR 123 Be sure that the desired major number isn t used by other drivers. Please check /proc/devices to see which numbers are free. Keep in mind that it is necessary to create new device nodes if the major number for the TPMC860 driver has changed and the makenode script isn t used. TPMC860-SW-82 - Linux Device Driver Page 8 of 19

2.6 FIFO Configuration After installation of the TPMC860 Device Driver the trigger level for the transmit and receive FIFO are set to their default values. Default values are: Receive FIFO Transmit FIFO 56 16 The configuration of the FIFO trigger level is used for all TPMC860 devices in common. To change the trigger levels edit the file HAL/tpmc860haldef.h, change the following symbols to appropriate values and enter make install to create a new driver. TPMC860_RX_TRG_DEF TPMC860_TX_TRG_DEF Define the trigger level for the receiver FIFO of a TPMC860 with ST16C654 controller. Valid trigger levels are: UART_FCR_R_TRIGGER_8 UART_FCR_R_TRIGGER_16 UART_FCR_R_TRIGGER_56 UART_FCR_R_TRIGGER_60 Define the trigger level for the transmitter FIFO of a TPMC860 with ST16C654 controller. Valid trigger levels are: UART_FCR_T_TRIGGER_8 UART_FCR_T_TRIGGER_16 UART_FCR_T_TRIGGER_32 UART_FCR_T_TRIGGER_56 Please refer to the User Manual of the ST16C654 controller to get more information how to customize suitable FIFO trigger level. TPMC860-SW-82 - Linux Device Driver Page 9 of 19

3 Device Input/Output Functions This chapter describes the interface to the device driver I/O system. 3.1 open NAME open() - open a file descriptor SYNOPSIS #include <fcntl.h> int open (const char *filename, int flags) DESCRIPTION The open function creates and returns a new file descriptor for the file named by filename. The flags argument controls how the file is to be opened. This is a bit mask; you create the value by the bitwise OR of the appropriate parameters (using the operator in C). See also the GNU C Library documentation for more information about the open function and open flags. EXAMPLE int fd; fd = open( /dev/ttystpmc860_0, O_RDWR); if (fd < 0) { /* handle open error conditions */ } RETURNS The normal return value from open is a non-negative integer file descriptor. In the case of an error, a value of 1 is returned. The global variable errno contains the detailed error code. TPMC860-SW-82 - Linux Device Driver Page 10 of 19

ERRORS Error Code ENODEV Description The requested minor device does not exist. This is the only error code returned by the driver, other codes may be returned by the I/O system during open. For more information about open error codes, see the GNU C Library description Low- Level Input/Output. SEE ALSO GNU C Library description Low-Level Input/Output TPMC860-SW-82 - Linux Device Driver Page 11 of 19

3.2 close NAME close() close a file descriptor SYNOPSIS #include <unistd.h> int close (int filedes) DESCRIPTION The close function closes the file descriptor filedes. EXAMPLE int fd; if (close(fd)!= 0) { /* handle close error conditions */ } RETURNS The normal return value from close is 0. In the case of an error, a value of 1 is returned. The global variable errno contains the detailed error code. ERRORS Error Code ENODEV Description The requested minor device does not exist. This is the only error code returned by the driver, other codes may be returned by the I/O system during close. For more information about close error codes, see the GNU C Library description Low- Level Input/Output. SEE ALSO GNU C Library description Low-Level Input/Output TPMC860-SW-82 - Linux Device Driver Page 12 of 19

3.3 ioctl NAME ioctl() device control functions SYNOPSIS #include <sys/ioctl.h> #include <tpmc860.h> int ioctl(int filedes, int request [, void *argp]) DESCRIPTION The ioctl function sends a control code directly to a device, specified by filedes, causing the corresponding device to perform the requested operation. The argument request specifies the control code for the operation. The optional argument argp depends on the selected request and is described for each request in detail later in this chapter. The following ioctl codes are defined in tpmc860.h: Value TPMC860_IOCQ_BIST Meaning Start Built-In-Self-Test See below for more detailed information on each control code. To use these TPMC860 specific control codes the header file tpmc860.h must be included in the application. RETURNS On success, zero is returned. In case of an error, a value of 1 is returned. The global variable errno contains the detailed error code. TPMC860-SW-82 - Linux Device Driver Page 13 of 19

ERRORS Error Code EINVAL Description Invalid argument. This error code is returned if the requested ioctl function is unknown. Please check the argument request. Other function dependant error codes will be described for each ioctl code separately. Note, the TPMC860 driver always returns standard Linux error codes. SEE ALSO ioctl man pages TPMC860-SW-82 - Linux Device Driver Page 14 of 19

3.3.1 TPMC860_IOCQ_BIST NAME TPMC860_IOCQ_BIST Start Built-In-Self-Test DESCRIPTION The TPMC860 driver supports a special IOCTL function for testing module hardware and for system diagnostic. The optional argument can be omitted for this ioctl function. The functionality is called Built-In-Self-Test or BIST. With BIST you can test each channel of all your modules separately. There are three different test classes. First is a line test, second an interrupt test and the last a data integrity test. All tests run with local channel loopback enabled, so you don t need an external cable connection. The line test contains a test of all modem lines, as you can see RTS and CTS, DTR and DSR, OP1 and RI and finally OP2 and CD. Only the static states for both electrical levels are tested on each sender receiver line pair. TPMC860-SW-82 - Linux Device Driver Page 15 of 19

For testing interrupts the BIST transmits a test buffer with known data and size. All data should be received on same channel during internal loopback. If not, there is an interrupt error. The buffer size is 1024 BYTE. The baudrate has to be set through the standard terminal IOCTL functions. The last test verifies received data to assert data integrity. EXAMPLE #include <tpmc860.h> int tty1; int result; /* Start Built-In Selftest, */ result = ioctl(tty1, TPMC860_IOCQ_BIST, NULL); if (result) printf("error during Built-In Selftest <%d, 0x%08X>!\n", result, result); if (result < 0) { printf("errno %d - %s\n", errno, strerror(errno)); } else if (result > 0) { if (result & TPMC860_ERTSCTS) printf("rts/cts line broken!\n"); if (result & TPMC860_EDTRDSR) printf("dtr/dsr line broken!\n"); if (result & TPMC860_ERI) printf("op1/ri line broken!\n"); if (result & TPMC860_ECD) printf("op2/dcd line broken!\n"); if (result & TPMC860_EDATA) printf("data integrity test failed!\n"); } else printf("info: Port successfully tested.\n"); TPMC860-SW-82 - Linux Device Driver Page 16 of 19

RETURNS If return value is >0 one of three tests failed. Use the following flags to get a detailed error description. Value TPMC860_ERTSCTS TPMC860_EDTRDSR TPMC860_ERI TPMC860_ECD TPMC860_EDATA Description If set RTS/CTS line broken. If set DTR/DSR line broken. If set OP1/RI line broken. If set OP2/CD line broken. Data integrity test failed. No correct transmission possible. ERRORS Error Code ETIME EAGAIN ERESTARTSYS Description A timeout occurred during wait, interrupts do not work correctly. Your task should never been blocked. Change it to use the Built-In-Self-Test. Interrupted by external signal. TPMC860-SW-82 - Linux Device Driver Page 17 of 19

4 Device Driver Programming The TPMC860-SW-82 driver loosely bases on the standard Linux terminal driver. Due to this way of implementation the driver interface and functionality is compatible to the standard Linux terminal driver. Please refer to the TERMIOS man page and driver programming related man pages for more information about serial driver programming. TPMC860-SW-82 - Linux Device Driver Page 18 of 19

5 Diagnostic If the TPMC860 driver does not work properly it is helpful to get some status information from the driver respective kernel. The Linux /proc file system provides information about kernel, resources, driver, devices and so on. The following screen dumps displays information of a correct running TPMC860 driver (see also the proc man pages). # cat /proc/tty/driver/tpmc860serial 0: uart:st16c654 mmio:d08eff40 irq:17 tx:0 rx:0 1: uart:st16c654 mmio:d08eff48 irq:17 tx:0 rx:0 2: uart:st16c654 mmio:d08eff50 irq:17 tx:0 rx:0 3: uart:st16c654 mmio:d08eff58 irq:17 tx:0 rx:0 # cat /proc/tty/drivers /dev/tty /dev/tty 5 0 system:/dev/tty /dev/console /dev/console 5 1 system:console /dev/ptmx /dev/ptmx 5 2 system /dev/vc/0 /dev/vc/0 4 0 system:vtmaster tpmc860serial /dev/ttystpmc860_ 251 0-127 serial rfcomm /dev/rfcomm 216 0-255 serial ttyprintk /dev/ttyprintk 5 3 console serial /dev/ttys 4 64-111 serial pty_slave /dev/pts 136 0-1048575 pty:slave pty_master /dev/ptm 128 0-1048575 pty:master unknown /dev/tty 4 1-63 console # lspci v... 04:02.0 Multiport serial controller: TEWS Technologies GmbH Device 035c (rev 0a) Subsystem: TEWS Technologies GmbH Device 000a Flags: medium devsel, IRQ 17 Memory at feb9fc00 (32-bit, non-prefetchable) [size=128] I/O ports at e880 [size=128] Memory at feb9f800 (32-bit, non-prefetchable) [size=64] Kernel driver in use: TEWS TECHNOLOGIES - TPMC860HAL Driver Kernel modules: tpmc860haldrv... TPMC860-SW-82 - Linux Device Driver Page 19 of 19