Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) =============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) MOXA Smartio/Industio Family Device Driver Installation Guide
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) =============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) .. note::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)    This file is outdated. It needs some care in order to make it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)    updated to Kernel 5.0 and upper
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) Copyright (C) 2008, Moxa Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) Date: 01/21/2008
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) .. Content
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)    1. Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)    2. System Requirement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)    3. Installation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)       3.1 Hardware installation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)       3.2 Driver files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)       3.3 Device naming convention
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)       3.4 Module driver configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)       3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)       3.6 Custom configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)       3.7 Verify driver installation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)    4. Utilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)    5. Setserial
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)    6. Troubleshooting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 1. Introduction
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) ^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)    The Smartio/Industio/UPCI family Linux driver supports following multiport
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)    boards.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)     - 2 ports multiport board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	CP-102U, CP-102UL, CP-102UF
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	CP-132U-I, CP-132UL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	CP-132, CP-132I, CP132S, CP-132IS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	CI-132, CI-132I, CI-132IS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	(C102H, C102HI, C102HIS, C102P, CP-102, CP-102S)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)     - 4 ports multiport board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	CP-104EL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	CP-104UL, CP-104JU,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	CP-134U, CP-134U-I,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	C104H/PCI, C104HS/PCI,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	CP-114, CP-114I, CP-114S, CP-114IS, CP-114UL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	C104H, C104HS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	CI-104J, CI-104JS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	CI-134, CI-134I, CI-134IS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	(C114HI, CT-114I, C104P),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	POS-104UL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	CB-114,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	CB-134I
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)     - 8 ports multiport board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	CP-118EL, CP-168EL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	CP-118U, CP-168U,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	C168H/PCI,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	C168H, C168HS,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	(C168P),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	CB-108
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)    This driver and installation procedure have been developed upon Linux Kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)    2.4.x and 2.6.x. This driver supports Intel x86 hardware platform. In order
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)    to maintain compatibility, this version has also been properly tested with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)    RedHat, Mandrake, Fedora and S.u.S.E Linux. However, if compatibility problem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)    occurs, please contact Moxa at support@moxa.com.tw.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)    In addition to device driver, useful utilities are also provided in this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)    version. They are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)     - msdiag
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		 Diagnostic program for displaying installed Moxa
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)                  Smartio/Industio boards.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)     - msmon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 		 Monitor program to observe data count and line status signals.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)     - msterm     A simple terminal program which is useful in testing serial
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	         ports.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)     - io-irq.exe
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		 Configuration program to setup ISA boards. Please note that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)                  this program can only be executed under DOS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)    All the drivers and utilities are published in form of source code under
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86)    GNU General Public License in this version. Please refer to GNU General
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87)    Public License announcement in each source code file for more detail.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89)    In Moxa's Web sites, you may always find latest driver at http://www.moxa.com/.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)    This version of driver can be installed as Loadable Module (Module driver)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)    or built-in into kernel (Static driver). You may refer to following
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)    installation procedure for suitable one. Before you install the driver,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)    please refer to hardware installation procedure in the User's Manual.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)    We assume the user should be familiar with following documents.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)    - Serial-HOWTO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)    - Kernel-HOWTO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 2. System Requirement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) ^^^^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)    - Hardware platform: Intel x86 machine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)    - Kernel version: 2.4.x or 2.6.x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)    - gcc version 2.72 or later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)    - Maximum 4 boards can be installed in combination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 3. Installation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) ^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 3.1 Hardware installation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) =========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)    There are two types of buses, ISA and PCI, for Smartio/Industio
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)    family multiport board.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) ISA board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) ---------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)    You'll have to configure CAP address, I/O address, Interrupt Vector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)    as well as IRQ before installing this driver. Please refer to hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)    installation procedure in User's Manual before proceed any further.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)    Please make sure the JP1 is open after the ISA board is set properly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) PCI/UPCI board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) --------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)    You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)    with other ISA devices. Please refer to hardware installation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)    procedure in User's Manual in advance.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) PCI IRQ Sharing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) ---------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)    Each port within the same multiport board shares the same IRQ. Up to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)    4 Moxa Smartio/Industio PCI Family multiport boards can be installed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)    together on one system and they can share the same IRQ.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 3.2 Driver files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) ================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)    The driver file may be obtained from ftp, CD-ROM or floppy disk. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)    first step, anyway, is to copy driver file "mxser.tgz" into specified
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)    directory. e.g. /moxa. The execute commands as below::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)        # cd /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)        # mkdir moxa
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)        # cd /moxa
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)        # tar xvf /dev/fd0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) or::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)        # cd /
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)        # mkdir moxa
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)        # cd /moxa
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)        # cp /mnt/cdrom/<driver directory>/mxser.tgz .
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)        # tar xvfz mxser.tgz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 3.3 Device naming convention
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) ============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)    You may find all the driver and utilities files in /moxa/mxser.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)    Following installation procedure depends on the model you'd like to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)    run the driver. If you prefer module driver, please refer to 3.4.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)    If static driver is required, please refer to 3.5.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) Dialin and callout port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) -----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)    This driver remains traditional serial device properties. There are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)    two special file name for each serial port. One is dial-in port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)    which is named "ttyMxx". For callout port, the naming convention
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)    is "cumxx".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) Device naming when more than 2 boards installed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) -----------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)    Naming convention for each Smartio/Industio multiport board is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182)    pre-defined as below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)    ============ ===============       ==============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)    Board Num.	 Dial-in Port	      Callout port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)    1st board	ttyM0  - ttyM7	      cum0  - cum7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)    2nd board	ttyM8  - ttyM15       cum8  - cum15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)    3rd board	ttyM16 - ttyM23       cum16 - cum23
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)    4th board	ttyM24 - ttym31       cum24 - cum31
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)    ============ ===============       ==============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) .. note::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)    Under Kernel 2.6 and upper, the cum Device is Obsolete. So use ttyM*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)    device instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) Board sequence
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) --------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)    This driver will activate ISA boards according to the parameter set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)    in the driver. After all specified ISA board activated, PCI board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202)    will be installed in the system automatically driven.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)    Therefore the board number is sorted by the CAP address of ISA boards.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204)    For PCI boards, their sequence will be after ISA boards and C168H/PCI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)    has higher priority than C104H/PCI boards.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 3.4 Module driver configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)    Module driver is easiest way to install. If you prefer static driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)    installation, please skip this paragraph.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)    ------------- Prepare to use the MOXA driver --------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 3.4.1 Create tty device with correct major number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) -------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219)    Before using MOXA driver, your system must have the tty devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)    which are created with driver's major number. We offer one shell
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221)    script "msmknod" to simplify the procedure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)    This step is only needed to be executed once. But you still
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)    need to do this procedure when:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)    a. You change the driver's major number. Please refer the "3.7"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226)       section.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227)    b. Your total installed MOXA boards number is changed. Maybe you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)       add/delete one MOXA board.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229)    c. You want to change the tty name. This needs to modify the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)       shell script "msmknod"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)    The procedure is::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	 # cd /moxa/mxser/driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	 # ./msmknod
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)    This shell script will require the major number for dial-in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)    device and callout device to create tty device. You also need
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239)    to specify the total installed MOXA board number. Default major
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)    numbers for dial-in device and callout device are 30, 35. If
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)    you need to change to other number, please refer section "3.7"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)    for more detailed procedure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)    Msmknod will delete any special files occupying the same device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)    naming.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 3.4.2 Build the MOXA driver and utilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) -----------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)    Before using the MOXA driver and utilities, you need compile the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)    all the source code. This step is only need to be executed once.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)    But you still re-compile the source code if you modify the source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)    code. For example, if you change the driver's major number (see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253)    "3.7" section), then you need to do this step again.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)    Find "Makefile" in /moxa/mxser, then run
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	 # make clean; make install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)    ..note::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 	 For Red Hat 9, Red Hat Enterprise Linux AS3/ES3/WS3 & Fedora Core1:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 	 # make clean; make installsp1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	 For Red Hat Enterprise Linux AS4/ES4/WS4:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 	 # make clean; make installsp2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)    The driver files "mxser.o" and utilities will be properly compiled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)    and copied to system directories respectively.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) ------------- Load MOXA driver--------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 3.4.3 Load the MOXA driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) --------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)    ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 	 # modprobe mxser <argument>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)    will activate the module driver. You may run "lsmod" to check
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)    if "mxser" is activated. If the MOXA board is ISA board, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)    <argument> is needed. Please refer to section "3.4.5" for more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)    information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) ------------- Load MOXA driver on boot --------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 3.4.4 Load the mxser driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) ---------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290)    For the above description, you may manually execute
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)    "modprobe mxser" to activate this driver and run
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292)    "rmmod mxser" to remove it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294)    However, it's better to have a boot time configuration to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)    eliminate manual operation. Boot time configuration can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296)    achieved by rc file. We offer one "rc.mxser" file to simplify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)    the procedure under "moxa/mxser/driver".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299)    But if you use ISA board, please modify the "modprobe ..." command
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)    to add the argument (see "3.4.5" section). After modifying the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)    rc.mxser, please try to execute "/moxa/mxser/driver/rc.mxser"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302)    manually to make sure the modification is ok. If any error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)    encountered, please try to modify again. If the modification is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304)    completed, follow the below step.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306)    Run following command for setting rc files::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 	 # cd /moxa/mxser/driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 	 # cp ./rc.mxser /etc/rc.d
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 	 # cd /etc/rc.d
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312)    Check "rc.serial" is existed or not. If "rc.serial" doesn't exist,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313)    create it by vi, run "chmod 755 rc.serial" to change the permission.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315)    Add "/etc/rc.d/rc.mxser" in last line.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)    Reboot and check if moxa.o activated by "lsmod" command.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 3.4.5. specify CAP address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) --------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)    If you'd like to drive Smartio/Industio ISA boards in the system,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323)    you'll have to add parameter to specify CAP address of given
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)    board while activating "mxser.o". The format for parameters are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325)    as follows.::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 	   modprobe mxser ioaddr=0x???,0x???,0x???,0x???
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 				  |  |  |    |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 				  |  |  |    +- 4th ISA board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 				  |  |  +------ 3rd ISA board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 				  |  +------------ 2nd ISA board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 				  +-------------------1st ISA board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) ================================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337)     Note:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)           To use static driver, you must install the linux kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339)           source package.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 3.5.1 Backup the built-in driver in the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) ----------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344)     ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346)        # cd /usr/src/linux/drivers/char
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347)        # mv mxser.c mxser.c.old
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349)        For Red Hat 7.x user, you need to create link:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)        # cd /usr/src
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351)        # ln -s linux-2.4 linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 3.5.2 Create link
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) -----------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355)     ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 	  # cd /usr/src/linux/drivers/char
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 	  # ln -s /moxa/mxser/driver/mxser.c mxser.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 3.5.3 Add CAP address list for ISA boards.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) ------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363)     For PCI boards user, please skip this step.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365)     In module mode, the CAP address for ISA board is given by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366)     parameter. In static driver configuration, you'll have to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367)     assign it within driver's source code. If you will not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368)     install any ISA boards, you may skip to next portion.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369)     The instructions to modify driver source code are as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)     below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372)     a. run::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) 	# cd /moxa/mxser/driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) 	# vi mxser.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)     b. Find the array mxserBoardCAP[] as below::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) 	  static int mxserBoardCAP[] = {0x00, 0x00, 0x00, 0x00};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)     c. Change the address within this array using vi. For
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)        example, to driver 2 ISA boards with CAP address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383)        0x280 and 0x180 as 1st and 2nd board. Just to change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)        the source code as follows::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 	  static int mxserBoardCAP[] = {0x280, 0x180, 0x00, 0x00};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) 3.5.4 Setup kernel configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) --------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)     Configure the kernel::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)       # cd /usr/src/linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394)       # make menuconfig
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396)     You will go into a menu-driven system. Please select [Character
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397)     devices][Non-standard serial port support], enable the [Moxa
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)     SmartIO support] driver with "[*]" for built-in (not "[M]"), then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399)     select [Exit] to exit this program.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) 3.5.5 Rebuild kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) --------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404)     The following are for Linux kernel rebuilding, for your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)     reference only.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407)     For appropriate details, please refer to the Linux document:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409)         a. Run the following commands::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) 	     cd /usr/src/linux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) 	     make clean		     # take a few minutes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) 	     make dep		     # take a few minutes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) 	     make bzImage	     # take probably 10-20 minutes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 	     make install	     # copy boot image to correct position
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) 	f. Please make sure the boot kernel (vmlinuz) is in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 	   correct position.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) 	g. If you use 'lilo' utility, you should check /etc/lilo.conf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 	   'image' item specified the path which is the 'vmlinuz' path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 	   or you will load wrong (or old) boot kernel image (vmlinuz).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 	   After checking /etc/lilo.conf, please run "lilo".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 	  Note that if the result of "make bzImage" is ERROR, then you have to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) 	  go back to Linux configuration Setup. Type "make menuconfig" in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426)           directory /usr/src/linux.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) 3.5.6 Make tty device and special file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) --------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)     ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433)        # cd /moxa/mxser/driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)        # ./msmknod
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) 3.5.7 Make utility
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) ------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439)     ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) 	  # cd /moxa/mxser/utility
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 	  # make clean; make install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 3.5.8 Reboot
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) ------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 3.6 Custom configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) ========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452)     Although this driver already provides you default configuration, you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453)     still can change the device name and major number. The instruction to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454)     change these parameters are shown as below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) a. Change Device name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458)     If you'd like to use other device names instead of default naming
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459)     convention, all you have to do is to modify the internal code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460)     within the shell script "msmknod". First, you have to open "msmknod"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461)     by vi. Locate each line contains "ttyM" and "cum" and change them
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462)     to the device name you desired. "msmknod" creates the device names
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463)     you need next time executed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) b. Change Major number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467)     If major number 30 and 35 had been occupied, you may have to select
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468)     2 free major numbers for this driver. There are 3 steps to change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469)     major numbers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 3.6.1 Find free major numbers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) -----------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474)     In /proc/devices, you may find all the major numbers occupied
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475)     in the system. Please select 2 major numbers that are available.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476)     e.g. 40, 45.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) 3.6.2 Create special files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) --------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481)    Run /moxa/mxser/driver/msmknod to create special files with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482)    specified major numbers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) 3.6.3 Modify driver with new major number
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) -----------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487)    Run vi to open /moxa/mxser/driver/mxser.c. Locate the line
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488)    contains "MXSERMAJOR". Change the content as below::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) 	  #define	  MXSERMAJOR		  40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 	  #define	  MXSERCUMAJOR		  45
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493)     3.6.4 Run "make clean; make install" in /moxa/mxser/driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 3.7 Verify driver installation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) ==============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498)     You may refer to /var/log/messages to check the latest status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499)     log reported by this driver whenever it's activated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) 4. Utilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504)    There are 3 utilities contained in this driver. They are msdiag, msmon and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505)    msterm. These 3 utilities are released in form of source code. They should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506)    be compiled into executable file and copied into /usr/bin.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508)    Before using these utilities, please load driver (refer 3.4 & 3.5) and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509)    make sure you had run the "msmknod" utility.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) msdiag - Diagnostic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514)    This utility provides the function to display what Moxa Smartio/Industio
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515)    board found by driver in the system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) msmon - Port Monitoring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520)    This utility gives the user a quick view about all the MOXA ports'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521)    activities. One can easily learn each port's total received/transmitted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522)    (Rx/Tx) character count since the time when the monitoring is started.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524)    Rx/Tx throughputs per second are also reported in interval basis (e.g.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525)    the last 5 seconds) and in average basis (since the time the monitoring
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526)    is started). You can reset all ports' count by <HOME> key. <+> <->
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527)    (plus/minus) keys to change the displaying time interval. Press <ENTER>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528)    on the port, that cursor stay, to view the port's communication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529)    parameters, signal status, and input/output queue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) msterm - Terminal Emulation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) ===========================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534)    This utility provides data sending and receiving ability of all tty ports,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535)    especially for MOXA ports. It is quite useful for testing simple
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536)    application, for example, sending AT command to a modem connected to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537)    port or used as a terminal for login purpose. Note that this is only a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538)    dumb terminal emulation without handling full screen operation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) 5. Setserial
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) ^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543)    Supported Setserial parameters are listed as below.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545)    ============== =========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546)    uart		  set UART type(16450-->disable FIFO, 16550A-->enable FIFO)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547)    close_delay	  set the amount of time(in 1/100 of a second) that DTR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) 		  should be kept low while being closed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549)    closing_wait   set the amount of time(in 1/100 of a second) that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) 		  serial port should wait for data to be drained while
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) 		  being closed, before the receiver is disable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552)    spd_hi	  Use  57.6kb  when  the application requests 38.4kb.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553)    spd_vhi	  Use  115.2kb	when  the application requests 38.4kb.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554)    spd_shi	  Use  230.4kb	when  the application requests 38.4kb.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555)    spd_warp	  Use  460.8kb	when  the application requests 38.4kb.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556)    spd_normal	  Use  38.4kb  when  the application requests 38.4kb.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557)    spd_cust	  Use  the custom divisor to set the speed when  the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) 		  application requests 38.4kb.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559)    divisor	  This option set the custom division.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560)    baud_base	  This option set the base baud rate.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561)    ============== =========================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) 6. Troubleshooting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) ^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566)    The boot time error messages and solutions are stated as clearly as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567)    possible. If all the possible solutions fail, please contact our technical
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568)    support team to get more help.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571)    Error msg:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) 	      More than 4 Moxa Smartio/Industio family boards found. Fifth board
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573)               and after are ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575)    Solution:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576)    To avoid this problem, please unplug fifth and after board, because Moxa
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577)    driver supports up to 4 boards.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579)    Error msg:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) 	      Request_irq fail, IRQ(?) may be conflict with another device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582)    Solution:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583)    Other PCI or ISA devices occupy the assigned IRQ. If you are not sure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584)    which device causes the situation, please check /proc/interrupts to find
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585)    free IRQ and simply change another free IRQ for Moxa board.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587)    Error msg:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) 	      Board #: C1xx Series(CAP=xxx) interrupt number invalid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590)    Solution:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591)    Each port within the same multiport board shares the same IRQ. Please set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592)    one IRQ (IRQ doesn't equal to zero) for one Moxa board.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594)    Error msg:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) 	      No interrupt vector be set for Moxa ISA board(CAP=xxx).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597)    Solution:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598)    Moxa ISA board needs an interrupt vector.Please refer to user's manual
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599)    "Hardware Installation" chapter to set interrupt vector.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601)    Error msg:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602)               Couldn't install MOXA Smartio/Industio family driver!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604)    Solution:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605)    Load Moxa driver fail, the major number may conflict with other devices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606)    Please refer to previous section 3.7 to change a free major number for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607)    Moxa driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609)    Error msg:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610)               Couldn't install MOXA Smartio/Industio family callout driver!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612)    Solution:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613)    Load Moxa callout driver fail, the callout device major number may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614)    conflict with other devices. Please refer to previous section 3.7 to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615)    change a free callout device major number for Moxa driver.