COMDRVLNX-283 Driver Rev 2.0
Installation on RedHawk 6.0-6.3
for Contec Serial board
Release Notes
July 8, 2020

1. Introduction:
This document assists the user in installing the Contec Co., Ltd Linux COM Driver driver and test
programs on a RedHawk 6.0.x,6.3.x for use with the Contec’s board.

2. Requirements:
The COM-xxxx, an EIA RS-232(TIA/EIA-232)/RS-485 (TIA/EIA-485)/RS-422 (TIA/EIA-422)
compliant asynchronous serial communications product for PCI-based computers. It must be physicallyinstalled in the system.
••RedHawk Revision 6.0,6.3
Contec Serial board installed<PCI board>COM-2(PCI)H
COM-4(PCI)H
COM-8(PCI)H
COM-2P(PCI)H
COM-4P(PCI)H
COM-2PD(PCI)H
COM-4PD(PCI)H
COM-1(LPCI)H
COM-2(LPCI)H
COM-4(LPCI)H
COM-1PD(LPCI)H
COM-2PD(LPCI)H
COM-2CL-PCI
COM-4CL-PCI
COM-2DL-PCI
COM-4DL-PCI
COM-8C-LPCI<PCIe board>COM-2C-PE
COM-4C-PE
COM-8C-PE
COM-2PC-PE
COM-4PC-PE
COM-2PD-PE
COM-4PD-PE
COM-1C-LPE
COM-2C-LPE
COM-4C-LPE
COM-8C-LPE

3. Installation:
The COMDRVLNX283 driver is designed to support IRQ sharing. If this devices IRQ is being shared byanother device then this driver’s performance could be compromised. Hence, as far as possible, movethis board into a PCI slot whose IRQ is not being shared with other devices. A ‘lspci -v’ command can beused to determine the IRQs of various devices in the system.
The COMDRVLNX283 driver is supplied in a RPM format on a CDROM/DVD. It is a dynamically loadable
driver that must be loaded with the modprobe comdrv.ko command once it has been installed. It can be
unloaded by issuing the modprobe –r comdrv command.
To extract the driver from a CDROM, typical command is as follows:> === as root ===> mount /mnt/cdrom(an entry must exist in /etc/fstab - most likely, mount point is/mnt/cdrom)> cd /mnt/cdrom> rpm -ivh COMDRVLNX-283-2.i686.rpm (install the package)or> rpm -ivh COMDRVLNX-283-2.x86_64.rpm (install the package)########################################### [100%]
1:COMDRVLNX########################################### [100%]
Please wait a minute.
Compile Drivers
Load Drivers
220: uart:16550A port:CCE0 irq:30 tx:0 rx:0
221: uart:16550A port:CCE8 irq:30 tx:0 rx:0
comdrv

2387090All the source for this product has been installed.
To build and install the objects manually:
the following steps. Then:
To build the driver:
cd /usr/src/contec/comdrv/driver
make clean; make> umount /mnt/cdrom
The COMDRVLNX283 driver files will be installed into the /usr/src/contec directory from the CDROMdrive.
If you will need to rebuild the driver:> === log in as root ===> cd /usr/src/contec/comdrv/driver> make;make install (build the driver & install the driver software )NOTE!! If the make fails with some module version related error, then you will need to follow
the directions (see below) “Building driver on a currently running RedHawk kernel”.
Once done, you will then need to re-make the driver as described above.
> cat /proc/tty/driver/ContecSio> serinfo:1.0 driver revision:> find /lib/modules -print |grep comdrv.ko/lib/modules/2.6.36-RedHawk-6.0.2/extra/comdrv.ko.gz/lib/modules/2.6.36-RedHawk-6.0.2-debug/extra/comdrv.ko.gz/lib/modules/2.6.36-RedHawk-6.0.2-trace/extra/comdrv.ko.gz

4. Removal of the Package.
The COMDRVLNX218 driver is a dynamically loadable driver that can be unloaded as follows:> === as root ===> rpm -e COMDRVLNX-283-2.i686 (remove the package)or> rpm -e COMDRVLNX-283-2.x86_64 (remove the package)

==== Cleaning ...
Now In /usr/src/contec, to remove source
Now In /usr/lobal/CNC/drivers/comdrvlnx, to remove source
NOTE!! If any changes have been made to the driver package, they need to be backed upprior to removing /usr/src/contec directory else all changes will be lost.
特記事項 1
現象：
COM-4PD/COM2-PD の全２重通信を Linux で行う場合、comtest の CRTSCTS フラグを OFF に設定しても、RTS-CTS 線を接続、あるいは DIP-SW で接続しないと、送信が行えない。
ドライバのソースコードでは、正しくif (up->capabilities & UART_CAP_EFR) {unsigned char efr = 0;/** TI16C752/Startech hardware flow control. FIXME:* - TI16C752 requires control thresholds to be set.
* - UART_MCR_RTS is ineffective if auto-RTS mode is enabled.
*/
if (termios->c_cflag & CRTSCTS)
efr |= UART_EFR_CTS;
serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B);
if (port->flags & UPF_EXAR_EFR)
serial_port_out(port, UART_XR_EFR, efr);
else
serial_port_out(port, UART_EFR, efr);}を呼び出していることを確認した。
また、HW マニュアルの出力ポート（ENHANCED REGISTTERS)のオフセット２の上位２ビット(AUTOCTS|AUTO-RTS)のビットが０で出力されていることも確認した。
つまり、Contec 社のデバイスドライバは、まったく正しい記述であるにも関わらず、HW 的な処理を行う必要がある。
また、 同一チップセットを利用した COM-2C-PE(RS232C)では、同一プログラム(comtest の CRTSCTSフラグを OFF に設定したもの）で、RTS-CTS ケーブル接続無しに通信が成立する、この時、ターミネータは、ON でも OFF でも同じ動作である。
Contec 社からの回答：
ご指摘いただきました COM-2PD-PE および COM-4PD-PE にて CRTSCTS フラグを OFF に設定しても、RTS-CTS 線を接続、あるいは DIP-SW で接続しないと、送信が行えない状況ですが、これは仕様となっております。
送信のゲート制御を RTS 信号で行っているため、RTS 信号が未接続の状態ですと送信のゲート制御が行えないため送信が行えません。
CRTSCTS フラグを OFF にとされた場合でも RTS-CTS 線の接続、または DIP-SW で接続する必要がございます。
お手数ではございますが、RTS-CTS 線の接続、もしくは DIP-SW 設定をされた状態で運用いただけますでしょうか。
なお、RS-232C の COM-2C-PE ではこの仕様としておりませんので RTS 信号が接未続の状態でも送信が可能となっております。