Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs: serial: convert docs to ReST and rename to *.rst

The converted files are focused at the Kernel internal API,
so, this is a good candidate for the kernel API set of books.

The conversion is actually:
- add blank lines and identation in order to identify paragraphs;
- fix tables markups;
- add some lists markups;
- mark literal blocks;
- adjust title markups.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mauro Carvalho Chehab and committed by
Greg Kroah-Hartman
f1374017 3e51ceea

+1011 -788
+4 -1
Documentation/serial/README.cycladesZ Documentation/serial/cyclades_z.rst
··· 1 + ================ 2 + Cyclades-Z notes 3 + ================ 1 4 2 5 The Cyclades-Z must have firmware loaded onto the card before it will 3 6 operate. This operation should be performed during system startup, 4 7 5 8 The firmware, loader program and the latest device driver code are 6 9 available from Cyclades at 7 - ftp://ftp.cyclades.com/pub/cyclades/cyclades-z/linux/ 8 10 11 + ftp://ftp.cyclades.com/pub/cyclades/cyclades-z/linux/
+89 -26
Documentation/serial/driver Documentation/serial/driver.rst
··· 1 - 2 - Low Level Serial API 3 - -------------------- 1 + ==================== 2 + Low Level Serial API 3 + ==================== 4 4 5 5 6 6 This document is meant as a brief overview of some aspects of the new serial ··· 44 44 There are two locks. A per-port spinlock, and an overall semaphore. 45 45 46 46 From the core driver perspective, the port->lock locks the following 47 - data: 47 + data:: 48 48 49 49 port->mctrl 50 50 port->icount ··· 75 75 return TIOCSER_TEMT. 76 76 77 77 Locking: none. 78 + 78 79 Interrupts: caller dependent. 80 + 79 81 This call must not sleep 80 82 81 83 set_mctrl(port, mctrl) 82 84 This function sets the modem control lines for port described 83 85 by 'port' to the state described by mctrl. The relevant bits 84 86 of mctrl are: 87 + 85 88 - TIOCM_RTS RTS signal. 86 89 - TIOCM_DTR DTR signal. 87 90 - TIOCM_OUT1 OUT1 signal. 88 91 - TIOCM_OUT2 OUT2 signal. 89 92 - TIOCM_LOOP Set the port into loopback mode. 93 + 90 94 If the appropriate bit is set, the signal should be driven 91 95 active. If the bit is clear, the signal should be driven 92 96 inactive. 93 97 94 98 Locking: port->lock taken. 99 + 95 100 Interrupts: locally disabled. 101 + 96 102 This call must not sleep 97 103 98 104 get_mctrl(port) 99 105 Returns the current state of modem control inputs. The state 100 106 of the outputs should not be returned, since the core keeps 101 107 track of their state. The state information should include: 108 + 102 109 - TIOCM_CAR state of DCD signal 103 110 - TIOCM_CTS state of CTS signal 104 111 - TIOCM_DSR state of DSR signal 105 112 - TIOCM_RI state of RI signal 113 + 106 114 The bit is set if the signal is currently driven active. If 107 115 the port does not support CTS, DCD or DSR, the driver should 108 116 indicate that the signal is permanently active. If RI is 109 117 not available, the signal should not be indicated as active. 110 118 111 119 Locking: port->lock taken. 120 + 112 121 Interrupts: locally disabled. 122 + 113 123 This call must not sleep 114 124 115 125 stop_tx(port) ··· 131 121 possible. 132 122 133 123 Locking: port->lock taken. 124 + 134 125 Interrupts: locally disabled. 126 + 135 127 This call must not sleep 136 128 137 129 start_tx(port) 138 130 Start transmitting characters. 139 131 140 132 Locking: port->lock taken. 133 + 141 134 Interrupts: locally disabled. 135 + 142 136 This call must not sleep 143 137 144 138 throttle(port) ··· 152 138 This will be called only if hardware assisted flow control is enabled. 153 139 154 140 Locking: serialized with .unthrottle() and termios modification by the 155 - tty layer. 141 + tty layer. 156 142 157 143 unthrottle(port) 158 144 Notify the serial driver that characters can now be sent to the serial 159 145 port without fear of overrunning the input buffers of the line 160 146 disciplines. 147 + 161 148 This will be called only if hardware assisted flow control is enabled. 162 149 163 150 Locking: serialized with .throttle() and termios modification by the 164 - tty layer. 151 + tty layer. 165 152 166 153 send_xchar(port,ch) 167 154 Transmit a high priority character, even if the port is stopped. ··· 174 159 Do not transmit if ch == '\0' (__DISABLED_CHAR). 175 160 176 161 Locking: none. 162 + 177 163 Interrupts: caller dependent. 178 164 179 165 stop_rx(port) ··· 182 166 being closed. 183 167 184 168 Locking: port->lock taken. 169 + 185 170 Interrupts: locally disabled. 171 + 186 172 This call must not sleep 187 173 188 174 enable_ms(port) ··· 195 177 called. 196 178 197 179 Locking: port->lock taken. 180 + 198 181 Interrupts: locally disabled. 182 + 199 183 This call must not sleep 200 184 201 185 break_ctl(port,ctl) ··· 216 196 This method will only be called when the port is initially opened. 217 197 218 198 Locking: port_sem taken. 199 + 219 200 Interrupts: globally disabled. 220 201 221 202 shutdown(port) ··· 231 210 this port. 232 211 233 212 Locking: port_sem taken. 213 + 234 214 Interrupts: caller dependent. 235 215 236 216 flush_buffer(port) ··· 242 220 buffer is cleared. 243 221 244 222 Locking: port->lock taken. 223 + 245 224 Interrupts: locally disabled. 225 + 246 226 This call must not sleep 247 227 248 228 set_termios(port,termios,oldtermios) ··· 252 228 bits. Update read_status_mask and ignore_status_mask to indicate 253 229 the types of events we are interested in receiving. Relevant 254 230 termios->c_cflag bits are: 255 - CSIZE - word size 256 - CSTOPB - 2 stop bits 257 - PARENB - parity enable 258 - PARODD - odd parity (when PARENB is in force) 259 - CREAD - enable reception of characters (if not set, 231 + 232 + CSIZE 233 + - word size 234 + CSTOPB 235 + - 2 stop bits 236 + PARENB 237 + - parity enable 238 + PARODD 239 + - odd parity (when PARENB is in force) 240 + CREAD 241 + - enable reception of characters (if not set, 260 242 still receive characters from the port, but 261 243 throw them away. 262 - CRTSCTS - if set, enable CTS status change reporting 263 - CLOCAL - if not set, enable modem status change 244 + CRTSCTS 245 + - if set, enable CTS status change reporting 246 + CLOCAL 247 + - if not set, enable modem status change 264 248 reporting. 249 + 265 250 Relevant termios->c_iflag bits are: 266 - INPCK - enable frame and parity error events to be 251 + 252 + INPCK 253 + - enable frame and parity error events to be 267 254 passed to the TTY layer. 268 - BRKINT 269 - PARMRK - both of these enable break events to be 255 + BRKINT / PARMRK 256 + - both of these enable break events to be 270 257 passed to the TTY layer. 271 258 272 - IGNPAR - ignore parity and framing errors 273 - IGNBRK - ignore break errors, If IGNPAR is also 259 + IGNPAR 260 + - ignore parity and framing errors 261 + IGNBRK 262 + - ignore break errors, If IGNPAR is also 274 263 set, ignore overrun errors as well. 264 + 275 265 The interaction of the iflag bits is as follows (parity error 276 266 given as an example): 267 + 268 + =============== ======= ====== ============================= 277 269 Parity error INPCK IGNPAR 270 + =============== ======= ====== ============================= 278 271 n/a 0 n/a character received, marked as 279 272 TTY_NORMAL 280 273 None 1 n/a character received, marked as ··· 299 258 Yes 1 0 character received, marked as 300 259 TTY_PARITY 301 260 Yes 1 1 character discarded 261 + =============== ======= ====== ============================= 302 262 303 263 Other flags may be used (eg, xon/xoff characters) if your 304 264 hardware supports hardware "soft" flow control. 305 265 306 266 Locking: caller holds tty_port->mutex 267 + 307 268 Interrupts: caller dependent. 269 + 308 270 This call must not sleep 309 271 310 272 set_ldisc(port,termios) 311 - Notifier for discipline change. See Documentation/serial/tty.txt. 273 + Notifier for discipline change. See Documentation/serial/tty.rst. 312 274 313 275 Locking: caller holds tty_port->mutex 314 276 ··· 327 283 will occur even if CONFIG_PM is not set. 328 284 329 285 Locking: none. 286 + 330 287 Interrupts: caller dependent. 331 288 332 289 type(port) ··· 336 291 substituted. 337 292 338 293 Locking: none. 294 + 339 295 Interrupts: caller dependent. 340 296 341 297 release_port(port) ··· 344 298 the port. 345 299 346 300 Locking: none. 301 + 347 302 Interrupts: caller dependent. 348 303 349 304 request_port(port) ··· 353 306 returns, and it should return -EBUSY on failure. 354 307 355 308 Locking: none. 309 + 356 310 Interrupts: caller dependent. 357 311 358 312 config_port(port,type) ··· 369 321 internally hard wired (eg, system on a chip implementations). 370 322 371 323 Locking: none. 324 + 372 325 Interrupts: caller dependent. 373 326 374 327 verify_port(port,serinfo) ··· 377 328 suitable for this port type. 378 329 379 330 Locking: none. 331 + 380 332 Interrupts: caller dependent. 381 333 382 334 ioctl(port,cmd,arg) ··· 385 335 using the standard numbering system found in <asm/ioctl.h> 386 336 387 337 Locking: none. 338 + 388 339 Interrupts: caller dependent. 389 340 390 341 poll_init(port) ··· 394 343 this should not request interrupts. 395 344 396 345 Locking: tty_mutex and tty_port->mutex taken. 346 + 397 347 Interrupts: n/a. 398 348 399 349 poll_put_char(port,ch) ··· 402 350 port. It can and should block until there is space in the TX FIFO. 403 351 404 352 Locking: none. 353 + 405 354 Interrupts: caller dependent. 355 + 406 356 This call must not sleep 407 357 408 358 poll_get_char(port) ··· 413 359 the function should return NO_POLL_CHAR immediately. 414 360 415 361 Locking: none. 362 + 416 363 Interrupts: caller dependent. 364 + 417 365 This call must not sleep 418 366 419 367 Other functions ··· 426 370 number of bits, parity, stop bits and baud rate. 427 371 428 372 Locking: caller is expected to take port->lock 373 + 429 374 Interrupts: n/a 430 375 431 376 uart_get_baud_rate(port,termios,old,min,max) ··· 442 385 Note: min..max must always allow 9600 baud to be selected. 443 386 444 387 Locking: caller dependent. 388 + 445 389 Interrupts: n/a 446 390 447 391 uart_get_divisor(port,baud) ··· 453 395 custom divisor instead. 454 396 455 397 Locking: caller dependent. 398 + 456 399 Interrupts: n/a 457 400 458 401 uart_match_port(port1,port2) ··· 461 402 uart_port structures describe the same port. 462 403 463 404 Locking: n/a 405 + 464 406 Interrupts: n/a 465 407 466 408 uart_write_wakeup(port) ··· 469 409 characters in the transmit buffer have dropped below a threshold. 470 410 471 411 Locking: port->lock should be held. 412 + 472 413 Interrupts: n/a 473 414 474 415 uart_register_driver(drv) ··· 480 419 registered using uart_add_one_port after this call has succeeded. 481 420 482 421 Locking: none 422 + 483 423 Interrupts: enabled 484 424 485 425 uart_unregister_driver() ··· 489 427 uart_remove_one_port() if it registered them with uart_add_one_port(). 490 428 491 429 Locking: none 430 + 492 431 Interrupts: enabled 493 432 494 - uart_suspend_port() 433 + **uart_suspend_port()** 495 434 496 - uart_resume_port() 435 + **uart_resume_port()** 497 436 498 - uart_add_one_port() 437 + **uart_add_one_port()** 499 438 500 - uart_remove_one_port() 439 + **uart_remove_one_port()** 501 440 502 441 Other notes 503 442 ----------- ··· 507 444 allow low level drivers to register their own individual uart_port's with 508 445 the core. This will allow drivers to use uart_port as a pointer to a 509 446 structure containing both the uart_port entry with their own extensions, 510 - thus: 447 + thus:: 511 448 512 449 struct my_port { 513 450 struct uart_port port; ··· 522 459 mctrl_gpio_init(port, idx): 523 460 This will get the {cts,rts,...}-gpios from device tree if they are 524 461 present and request them, set direction etc, and return an 525 - allocated structure. devm_* functions are used, so there's no need 462 + allocated structure. `devm_*` functions are used, so there's no need 526 463 to call mctrl_gpio_free(). 527 464 As this sets up the irq handling make sure to not handle changes to the 528 465 gpio input lines in your driver, too. 529 466 530 467 mctrl_gpio_free(dev, gpios): 531 468 This will free the requested gpios in mctrl_gpio_init(). 532 - As devm_* functions are used, there's generally no need to call 469 + As `devm_*` functions are used, there's generally no need to call 533 470 this function. 534 471 535 472 mctrl_gpio_to_gpiod(gpios, gidx)
+32
Documentation/serial/index.rst
··· 1 + :orphan: 2 + 3 + ========================== 4 + Support for Serial devices 5 + ========================== 6 + 7 + .. toctree:: 8 + :maxdepth: 1 9 + 10 + 11 + driver 12 + tty 13 + 14 + Serial drivers 15 + ============== 16 + 17 + .. toctree:: 18 + :maxdepth: 1 19 + 20 + cyclades_z 21 + moxa-smartio 22 + n_gsm 23 + rocket 24 + serial-iso7816 25 + serial-rs485 26 + 27 + .. only:: subproject and html 28 + 29 + Indices 30 + ======= 31 + 32 + * :ref:`genindex`
-523
Documentation/serial/moxa-smartio
··· 1 - ============================================================================= 2 - MOXA Smartio/Industio Family Device Driver Installation Guide 3 - for Linux Kernel 2.4.x, 2.6.x 4 - Copyright (C) 2008, Moxa Inc. 5 - ============================================================================= 6 - Date: 01/21/2008 7 - 8 - Content 9 - 10 - 1. Introduction 11 - 2. System Requirement 12 - 3. Installation 13 - 3.1 Hardware installation 14 - 3.2 Driver files 15 - 3.3 Device naming convention 16 - 3.4 Module driver configuration 17 - 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x. 18 - 3.6 Custom configuration 19 - 3.7 Verify driver installation 20 - 4. Utilities 21 - 5. Setserial 22 - 6. Troubleshooting 23 - 24 - ----------------------------------------------------------------------------- 25 - 1. Introduction 26 - 27 - The Smartio/Industio/UPCI family Linux driver supports following multiport 28 - boards. 29 - 30 - - 2 ports multiport board 31 - CP-102U, CP-102UL, CP-102UF 32 - CP-132U-I, CP-132UL, 33 - CP-132, CP-132I, CP132S, CP-132IS, 34 - CI-132, CI-132I, CI-132IS, 35 - (C102H, C102HI, C102HIS, C102P, CP-102, CP-102S) 36 - 37 - - 4 ports multiport board 38 - CP-104EL, 39 - CP-104UL, CP-104JU, 40 - CP-134U, CP-134U-I, 41 - C104H/PCI, C104HS/PCI, 42 - CP-114, CP-114I, CP-114S, CP-114IS, CP-114UL, 43 - C104H, C104HS, 44 - CI-104J, CI-104JS, 45 - CI-134, CI-134I, CI-134IS, 46 - (C114HI, CT-114I, C104P) 47 - POS-104UL, 48 - CB-114, 49 - CB-134I 50 - 51 - - 8 ports multiport board 52 - CP-118EL, CP-168EL, 53 - CP-118U, CP-168U, 54 - C168H/PCI, 55 - C168H, C168HS, 56 - (C168P), 57 - CB-108 58 - 59 - This driver and installation procedure have been developed upon Linux Kernel 60 - 2.4.x and 2.6.x. This driver supports Intel x86 hardware platform. In order 61 - to maintain compatibility, this version has also been properly tested with 62 - RedHat, Mandrake, Fedora and S.u.S.E Linux. However, if compatibility problem 63 - occurs, please contact Moxa at support@moxa.com.tw. 64 - 65 - In addition to device driver, useful utilities are also provided in this 66 - version. They are 67 - - msdiag Diagnostic program for displaying installed Moxa 68 - Smartio/Industio boards. 69 - - msmon Monitor program to observe data count and line status signals. 70 - - msterm A simple terminal program which is useful in testing serial 71 - ports. 72 - - io-irq.exe Configuration program to setup ISA boards. Please note that 73 - this program can only be executed under DOS. 74 - 75 - All the drivers and utilities are published in form of source code under 76 - GNU General Public License in this version. Please refer to GNU General 77 - Public License announcement in each source code file for more detail. 78 - 79 - In Moxa's Web sites, you may always find latest driver at http://www.moxa.com/. 80 - 81 - This version of driver can be installed as Loadable Module (Module driver) 82 - or built-in into kernel (Static driver). You may refer to following 83 - installation procedure for suitable one. Before you install the driver, 84 - please refer to hardware installation procedure in the User's Manual. 85 - 86 - We assume the user should be familiar with following documents. 87 - - Serial-HOWTO 88 - - Kernel-HOWTO 89 - 90 - ----------------------------------------------------------------------------- 91 - 2. System Requirement 92 - - Hardware platform: Intel x86 machine 93 - - Kernel version: 2.4.x or 2.6.x 94 - - gcc version 2.72 or later 95 - - Maximum 4 boards can be installed in combination 96 - 97 - ----------------------------------------------------------------------------- 98 - 3. Installation 99 - 100 - 3.1 Hardware installation 101 - 3.2 Driver files 102 - 3.3 Device naming convention 103 - 3.4 Module driver configuration 104 - 3.5 Static driver configuration for Linux kernel 2.4.x, 2.6.x. 105 - 3.6 Custom configuration 106 - 3.7 Verify driver installation 107 - 108 - 109 - 3.1 Hardware installation 110 - 111 - There are two types of buses, ISA and PCI, for Smartio/Industio 112 - family multiport board. 113 - 114 - ISA board 115 - --------- 116 - You'll have to configure CAP address, I/O address, Interrupt Vector 117 - as well as IRQ before installing this driver. Please refer to hardware 118 - installation procedure in User's Manual before proceed any further. 119 - Please make sure the JP1 is open after the ISA board is set properly. 120 - 121 - PCI/UPCI board 122 - -------------- 123 - You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict 124 - with other ISA devices. Please refer to hardware installation 125 - procedure in User's Manual in advance. 126 - 127 - PCI IRQ Sharing 128 - ----------- 129 - Each port within the same multiport board shares the same IRQ. Up to 130 - 4 Moxa Smartio/Industio PCI Family multiport boards can be installed 131 - together on one system and they can share the same IRQ. 132 - 133 - 134 - 3.2 Driver files 135 - 136 - The driver file may be obtained from ftp, CD-ROM or floppy disk. The 137 - first step, anyway, is to copy driver file "mxser.tgz" into specified 138 - directory. e.g. /moxa. The execute commands as below. 139 - 140 - # cd / 141 - # mkdir moxa 142 - # cd /moxa 143 - # tar xvf /dev/fd0 144 - 145 - or 146 - 147 - # cd / 148 - # mkdir moxa 149 - # cd /moxa 150 - # cp /mnt/cdrom/<driver directory>/mxser.tgz . 151 - # tar xvfz mxser.tgz 152 - 153 - 154 - 3.3 Device naming convention 155 - 156 - You may find all the driver and utilities files in /moxa/mxser. 157 - Following installation procedure depends on the model you'd like to 158 - run the driver. If you prefer module driver, please refer to 3.4. 159 - If static driver is required, please refer to 3.5. 160 - 161 - Dialin and callout port 162 - ----------------------- 163 - This driver remains traditional serial device properties. There are 164 - two special file name for each serial port. One is dial-in port 165 - which is named "ttyMxx". For callout port, the naming convention 166 - is "cumxx". 167 - 168 - Device naming when more than 2 boards installed 169 - ----------------------------------------------- 170 - Naming convention for each Smartio/Industio multiport board is 171 - pre-defined as below. 172 - 173 - Board Num. Dial-in Port Callout port 174 - 1st board ttyM0 - ttyM7 cum0 - cum7 175 - 2nd board ttyM8 - ttyM15 cum8 - cum15 176 - 3rd board ttyM16 - ttyM23 cum16 - cum23 177 - 4th board ttyM24 - ttym31 cum24 - cum31 178 - 179 - 180 - !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 181 - Under Kernel 2.6 the cum Device is Obsolete. So use ttyM* 182 - device instead. 183 - !!!!!!!!!!!!!!!!!!!! NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 184 - 185 - Board sequence 186 - -------------- 187 - This driver will activate ISA boards according to the parameter set 188 - in the driver. After all specified ISA board activated, PCI board 189 - will be installed in the system automatically driven. 190 - Therefore the board number is sorted by the CAP address of ISA boards. 191 - For PCI boards, their sequence will be after ISA boards and C168H/PCI 192 - has higher priority than C104H/PCI boards. 193 - 194 - 3.4 Module driver configuration 195 - Module driver is easiest way to install. If you prefer static driver 196 - installation, please skip this paragraph. 197 - 198 - 199 - ------------- Prepare to use the MOXA driver-------------------- 200 - 3.4.1 Create tty device with correct major number 201 - Before using MOXA driver, your system must have the tty devices 202 - which are created with driver's major number. We offer one shell 203 - script "msmknod" to simplify the procedure. 204 - This step is only needed to be executed once. But you still 205 - need to do this procedure when: 206 - a. You change the driver's major number. Please refer the "3.7" 207 - section. 208 - b. Your total installed MOXA boards number is changed. Maybe you 209 - add/delete one MOXA board. 210 - c. You want to change the tty name. This needs to modify the 211 - shell script "msmknod" 212 - 213 - The procedure is: 214 - # cd /moxa/mxser/driver 215 - # ./msmknod 216 - 217 - This shell script will require the major number for dial-in 218 - device and callout device to create tty device. You also need 219 - to specify the total installed MOXA board number. Default major 220 - numbers for dial-in device and callout device are 30, 35. If 221 - you need to change to other number, please refer section "3.7" 222 - for more detailed procedure. 223 - Msmknod will delete any special files occupying the same device 224 - naming. 225 - 226 - 3.4.2 Build the MOXA driver and utilities 227 - Before using the MOXA driver and utilities, you need compile the 228 - all the source code. This step is only need to be executed once. 229 - But you still re-compile the source code if you modify the source 230 - code. For example, if you change the driver's major number (see 231 - "3.7" section), then you need to do this step again. 232 - 233 - Find "Makefile" in /moxa/mxser, then run 234 - 235 - # make clean; make install 236 - 237 - !!!!!!!!!! NOTE !!!!!!!!!!!!!!!!! 238 - For Red Hat 9, Red Hat Enterprise Linux AS3/ES3/WS3 & Fedora Core1: 239 - # make clean; make installsp1 240 - 241 - For Red Hat Enterprise Linux AS4/ES4/WS4: 242 - # make clean; make installsp2 243 - !!!!!!!!!! NOTE !!!!!!!!!!!!!!!!! 244 - 245 - The driver files "mxser.o" and utilities will be properly compiled 246 - and copied to system directories respectively. 247 - 248 - ------------- Load MOXA driver-------------------- 249 - 3.4.3 Load the MOXA driver 250 - 251 - # modprobe mxser <argument> 252 - 253 - will activate the module driver. You may run "lsmod" to check 254 - if "mxser" is activated. If the MOXA board is ISA board, the 255 - <argument> is needed. Please refer to section "3.4.5" for more 256 - information. 257 - 258 - 259 - ------------- Load MOXA driver on boot -------------------- 260 - 3.4.4 For the above description, you may manually execute 261 - "modprobe mxser" to activate this driver and run 262 - "rmmod mxser" to remove it. 263 - However, it's better to have a boot time configuration to 264 - eliminate manual operation. Boot time configuration can be 265 - achieved by rc file. We offer one "rc.mxser" file to simplify 266 - the procedure under "moxa/mxser/driver". 267 - 268 - But if you use ISA board, please modify the "modprobe ..." command 269 - to add the argument (see "3.4.5" section). After modifying the 270 - rc.mxser, please try to execute "/moxa/mxser/driver/rc.mxser" 271 - manually to make sure the modification is ok. If any error 272 - encountered, please try to modify again. If the modification is 273 - completed, follow the below step. 274 - 275 - Run following command for setting rc files. 276 - 277 - # cd /moxa/mxser/driver 278 - # cp ./rc.mxser /etc/rc.d 279 - # cd /etc/rc.d 280 - 281 - Check "rc.serial" is existed or not. If "rc.serial" doesn't exist, 282 - create it by vi, run "chmod 755 rc.serial" to change the permission. 283 - Add "/etc/rc.d/rc.mxser" in last line, 284 - 285 - Reboot and check if moxa.o activated by "lsmod" command. 286 - 287 - 3.4.5. If you'd like to drive Smartio/Industio ISA boards in the system, 288 - you'll have to add parameter to specify CAP address of given 289 - board while activating "mxser.o". The format for parameters are 290 - as follows. 291 - 292 - modprobe mxser ioaddr=0x???,0x???,0x???,0x??? 293 - | | | | 294 - | | | +- 4th ISA board 295 - | | +------ 3rd ISA board 296 - | +------------ 2nd ISA board 297 - +------------------- 1st ISA board 298 - 299 - 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x 300 - 301 - Note: To use static driver, you must install the linux kernel 302 - source package. 303 - 304 - 3.5.1 Backup the built-in driver in the kernel. 305 - # cd /usr/src/linux/drivers/char 306 - # mv mxser.c mxser.c.old 307 - 308 - For Red Hat 7.x user, you need to create link: 309 - # cd /usr/src 310 - # ln -s linux-2.4 linux 311 - 312 - 3.5.2 Create link 313 - # cd /usr/src/linux/drivers/char 314 - # ln -s /moxa/mxser/driver/mxser.c mxser.c 315 - 316 - 3.5.3 Add CAP address list for ISA boards. For PCI boards user, 317 - please skip this step. 318 - 319 - In module mode, the CAP address for ISA board is given by 320 - parameter. In static driver configuration, you'll have to 321 - assign it within driver's source code. If you will not 322 - install any ISA boards, you may skip to next portion. 323 - The instructions to modify driver source code are as 324 - below. 325 - a. # cd /moxa/mxser/driver 326 - # vi mxser.c 327 - b. Find the array mxserBoardCAP[] as below. 328 - 329 - static int mxserBoardCAP[] 330 - = {0x00, 0x00, 0x00, 0x00}; 331 - 332 - c. Change the address within this array using vi. For 333 - example, to driver 2 ISA boards with CAP address 334 - 0x280 and 0x180 as 1st and 2nd board. Just to change 335 - the source code as follows. 336 - 337 - static int mxserBoardCAP[] 338 - = {0x280, 0x180, 0x00, 0x00}; 339 - 340 - 3.5.4 Setup kernel configuration 341 - 342 - Configure the kernel: 343 - 344 - # cd /usr/src/linux 345 - # make menuconfig 346 - 347 - You will go into a menu-driven system. Please select [Character 348 - devices][Non-standard serial port support], enable the [Moxa 349 - SmartIO support] driver with "[*]" for built-in (not "[M]"), then 350 - select [Exit] to exit this program. 351 - 352 - 3.5.5 Rebuild kernel 353 - The following are for Linux kernel rebuilding, for your 354 - reference only. 355 - For appropriate details, please refer to the Linux document. 356 - 357 - a. cd /usr/src/linux 358 - b. make clean /* take a few minutes */ 359 - c. make dep /* take a few minutes */ 360 - d. make bzImage /* take probably 10-20 minutes */ 361 - e. make install /* copy boot image to correct position */ 362 - f. Please make sure the boot kernel (vmlinuz) is in the 363 - correct position. 364 - g. If you use 'lilo' utility, you should check /etc/lilo.conf 365 - 'image' item specified the path which is the 'vmlinuz' path, 366 - or you will load wrong (or old) boot kernel image (vmlinuz). 367 - After checking /etc/lilo.conf, please run "lilo". 368 - 369 - Note that if the result of "make bzImage" is ERROR, then you have to 370 - go back to Linux configuration Setup. Type "make menuconfig" in 371 - directory /usr/src/linux. 372 - 373 - 374 - 3.5.6 Make tty device and special file 375 - # cd /moxa/mxser/driver 376 - # ./msmknod 377 - 378 - 3.5.7 Make utility 379 - # cd /moxa/mxser/utility 380 - # make clean; make install 381 - 382 - 3.5.8 Reboot 383 - 384 - 385 - 386 - 3.6 Custom configuration 387 - Although this driver already provides you default configuration, you 388 - still can change the device name and major number. The instruction to 389 - change these parameters are shown as below. 390 - 391 - Change Device name 392 - ------------------ 393 - If you'd like to use other device names instead of default naming 394 - convention, all you have to do is to modify the internal code 395 - within the shell script "msmknod". First, you have to open "msmknod" 396 - by vi. Locate each line contains "ttyM" and "cum" and change them 397 - to the device name you desired. "msmknod" creates the device names 398 - you need next time executed. 399 - 400 - Change Major number 401 - ------------------- 402 - If major number 30 and 35 had been occupied, you may have to select 403 - 2 free major numbers for this driver. There are 3 steps to change 404 - major numbers. 405 - 406 - 3.6.1 Find free major numbers 407 - In /proc/devices, you may find all the major numbers occupied 408 - in the system. Please select 2 major numbers that are available. 409 - e.g. 40, 45. 410 - 3.6.2 Create special files 411 - Run /moxa/mxser/driver/msmknod to create special files with 412 - specified major numbers. 413 - 3.6.3 Modify driver with new major number 414 - Run vi to open /moxa/mxser/driver/mxser.c. Locate the line 415 - contains "MXSERMAJOR". Change the content as below. 416 - #define MXSERMAJOR 40 417 - #define MXSERCUMAJOR 45 418 - 3.6.4 Run "make clean; make install" in /moxa/mxser/driver. 419 - 420 - 3.7 Verify driver installation 421 - You may refer to /var/log/messages to check the latest status 422 - log reported by this driver whenever it's activated. 423 - 424 - ----------------------------------------------------------------------------- 425 - 4. Utilities 426 - There are 3 utilities contained in this driver. They are msdiag, msmon and 427 - msterm. These 3 utilities are released in form of source code. They should 428 - be compiled into executable file and copied into /usr/bin. 429 - 430 - Before using these utilities, please load driver (refer 3.4 & 3.5) and 431 - make sure you had run the "msmknod" utility. 432 - 433 - msdiag - Diagnostic 434 - -------------------- 435 - This utility provides the function to display what Moxa Smartio/Industio 436 - board found by driver in the system. 437 - 438 - msmon - Port Monitoring 439 - ----------------------- 440 - This utility gives the user a quick view about all the MOXA ports' 441 - activities. One can easily learn each port's total received/transmitted 442 - (Rx/Tx) character count since the time when the monitoring is started. 443 - Rx/Tx throughputs per second are also reported in interval basis (e.g. 444 - the last 5 seconds) and in average basis (since the time the monitoring 445 - is started). You can reset all ports' count by <HOME> key. <+> <-> 446 - (plus/minus) keys to change the displaying time interval. Press <ENTER> 447 - on the port, that cursor stay, to view the port's communication 448 - parameters, signal status, and input/output queue. 449 - 450 - msterm - Terminal Emulation 451 - --------------------------- 452 - This utility provides data sending and receiving ability of all tty ports, 453 - especially for MOXA ports. It is quite useful for testing simple 454 - application, for example, sending AT command to a modem connected to the 455 - port or used as a terminal for login purpose. Note that this is only a 456 - dumb terminal emulation without handling full screen operation. 457 - 458 - ----------------------------------------------------------------------------- 459 - 5. Setserial 460 - 461 - Supported Setserial parameters are listed as below. 462 - 463 - uart set UART type(16450-->disable FIFO, 16550A-->enable FIFO) 464 - close_delay set the amount of time(in 1/100 of a second) that DTR 465 - should be kept low while being closed. 466 - closing_wait set the amount of time(in 1/100 of a second) that the 467 - serial port should wait for data to be drained while 468 - being closed, before the receiver is disable. 469 - spd_hi Use 57.6kb when the application requests 38.4kb. 470 - spd_vhi Use 115.2kb when the application requests 38.4kb. 471 - spd_shi Use 230.4kb when the application requests 38.4kb. 472 - spd_warp Use 460.8kb when the application requests 38.4kb. 473 - spd_normal Use 38.4kb when the application requests 38.4kb. 474 - spd_cust Use the custom divisor to set the speed when the 475 - application requests 38.4kb. 476 - divisor This option set the custom division. 477 - baud_base This option set the base baud rate. 478 - 479 - ----------------------------------------------------------------------------- 480 - 6. Troubleshooting 481 - 482 - The boot time error messages and solutions are stated as clearly as 483 - possible. If all the possible solutions fail, please contact our technical 484 - support team to get more help. 485 - 486 - 487 - Error msg: More than 4 Moxa Smartio/Industio family boards found. Fifth board 488 - and after are ignored. 489 - Solution: 490 - To avoid this problem, please unplug fifth and after board, because Moxa 491 - driver supports up to 4 boards. 492 - 493 - Error msg: Request_irq fail, IRQ(?) may be conflict with another device. 494 - Solution: 495 - Other PCI or ISA devices occupy the assigned IRQ. If you are not sure 496 - which device causes the situation, please check /proc/interrupts to find 497 - free IRQ and simply change another free IRQ for Moxa board. 498 - 499 - Error msg: Board #: C1xx Series(CAP=xxx) interrupt number invalid. 500 - Solution: 501 - Each port within the same multiport board shares the same IRQ. Please set 502 - one IRQ (IRQ doesn't equal to zero) for one Moxa board. 503 - 504 - Error msg: No interrupt vector be set for Moxa ISA board(CAP=xxx). 505 - Solution: 506 - Moxa ISA board needs an interrupt vector.Please refer to user's manual 507 - "Hardware Installation" chapter to set interrupt vector. 508 - 509 - Error msg: Couldn't install MOXA Smartio/Industio family driver! 510 - Solution: 511 - Load Moxa driver fail, the major number may conflict with other devices. 512 - Please refer to previous section 3.7 to change a free major number for 513 - Moxa driver. 514 - 515 - Error msg: Couldn't install MOXA Smartio/Industio family callout driver! 516 - Solution: 517 - Load Moxa callout driver fail, the callout device major number may 518 - conflict with other devices. Please refer to previous section 3.7 to 519 - change a free callout device major number for Moxa driver. 520 - 521 - 522 - ----------------------------------------------------------------------------- 523 -
+615
Documentation/serial/moxa-smartio.rst
··· 1 + ============================================================= 2 + MOXA Smartio/Industio Family Device Driver Installation Guide 3 + ============================================================= 4 + 5 + .. note:: 6 + 7 + This file is outdated. It needs some care in order to make it 8 + updated to Kernel 5.0 and upper 9 + 10 + Copyright (C) 2008, Moxa Inc. 11 + 12 + Date: 01/21/2008 13 + 14 + .. Content 15 + 16 + 1. Introduction 17 + 2. System Requirement 18 + 3. Installation 19 + 3.1 Hardware installation 20 + 3.2 Driver files 21 + 3.3 Device naming convention 22 + 3.4 Module driver configuration 23 + 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x. 24 + 3.6 Custom configuration 25 + 3.7 Verify driver installation 26 + 4. Utilities 27 + 5. Setserial 28 + 6. Troubleshooting 29 + 30 + 1. Introduction 31 + ^^^^^^^^^^^^^^^ 32 + 33 + The Smartio/Industio/UPCI family Linux driver supports following multiport 34 + boards. 35 + 36 + - 2 ports multiport board 37 + CP-102U, CP-102UL, CP-102UF 38 + CP-132U-I, CP-132UL, 39 + CP-132, CP-132I, CP132S, CP-132IS, 40 + CI-132, CI-132I, CI-132IS, 41 + (C102H, C102HI, C102HIS, C102P, CP-102, CP-102S) 42 + 43 + - 4 ports multiport board 44 + CP-104EL, 45 + CP-104UL, CP-104JU, 46 + CP-134U, CP-134U-I, 47 + C104H/PCI, C104HS/PCI, 48 + CP-114, CP-114I, CP-114S, CP-114IS, CP-114UL, 49 + C104H, C104HS, 50 + CI-104J, CI-104JS, 51 + CI-134, CI-134I, CI-134IS, 52 + (C114HI, CT-114I, C104P), 53 + POS-104UL, 54 + CB-114, 55 + CB-134I 56 + 57 + - 8 ports multiport board 58 + CP-118EL, CP-168EL, 59 + CP-118U, CP-168U, 60 + C168H/PCI, 61 + C168H, C168HS, 62 + (C168P), 63 + CB-108 64 + 65 + This driver and installation procedure have been developed upon Linux Kernel 66 + 2.4.x and 2.6.x. This driver supports Intel x86 hardware platform. In order 67 + to maintain compatibility, this version has also been properly tested with 68 + RedHat, Mandrake, Fedora and S.u.S.E Linux. However, if compatibility problem 69 + occurs, please contact Moxa at support@moxa.com.tw. 70 + 71 + In addition to device driver, useful utilities are also provided in this 72 + version. They are: 73 + 74 + - msdiag 75 + Diagnostic program for displaying installed Moxa 76 + Smartio/Industio boards. 77 + - msmon 78 + Monitor program to observe data count and line status signals. 79 + - msterm A simple terminal program which is useful in testing serial 80 + ports. 81 + - io-irq.exe 82 + Configuration program to setup ISA boards. Please note that 83 + this program can only be executed under DOS. 84 + 85 + All the drivers and utilities are published in form of source code under 86 + GNU General Public License in this version. Please refer to GNU General 87 + Public License announcement in each source code file for more detail. 88 + 89 + In Moxa's Web sites, you may always find latest driver at http://www.moxa.com/. 90 + 91 + This version of driver can be installed as Loadable Module (Module driver) 92 + or built-in into kernel (Static driver). You may refer to following 93 + installation procedure for suitable one. Before you install the driver, 94 + please refer to hardware installation procedure in the User's Manual. 95 + 96 + We assume the user should be familiar with following documents. 97 + 98 + - Serial-HOWTO 99 + - Kernel-HOWTO 100 + 101 + 2. System Requirement 102 + ^^^^^^^^^^^^^^^^^^^^^ 103 + 104 + - Hardware platform: Intel x86 machine 105 + - Kernel version: 2.4.x or 2.6.x 106 + - gcc version 2.72 or later 107 + - Maximum 4 boards can be installed in combination 108 + 109 + 3. Installation 110 + ^^^^^^^^^^^^^^^ 111 + 112 + 3.1 Hardware installation 113 + ========================= 114 + 115 + There are two types of buses, ISA and PCI, for Smartio/Industio 116 + family multiport board. 117 + 118 + ISA board 119 + --------- 120 + 121 + You'll have to configure CAP address, I/O address, Interrupt Vector 122 + as well as IRQ before installing this driver. Please refer to hardware 123 + installation procedure in User's Manual before proceed any further. 124 + Please make sure the JP1 is open after the ISA board is set properly. 125 + 126 + PCI/UPCI board 127 + -------------- 128 + 129 + You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict 130 + with other ISA devices. Please refer to hardware installation 131 + procedure in User's Manual in advance. 132 + 133 + PCI IRQ Sharing 134 + --------------- 135 + 136 + Each port within the same multiport board shares the same IRQ. Up to 137 + 4 Moxa Smartio/Industio PCI Family multiport boards can be installed 138 + together on one system and they can share the same IRQ. 139 + 140 + 141 + 3.2 Driver files 142 + ================ 143 + 144 + The driver file may be obtained from ftp, CD-ROM or floppy disk. The 145 + first step, anyway, is to copy driver file "mxser.tgz" into specified 146 + directory. e.g. /moxa. The execute commands as below:: 147 + 148 + # cd / 149 + # mkdir moxa 150 + # cd /moxa 151 + # tar xvf /dev/fd0 152 + 153 + or:: 154 + 155 + # cd / 156 + # mkdir moxa 157 + # cd /moxa 158 + # cp /mnt/cdrom/<driver directory>/mxser.tgz . 159 + # tar xvfz mxser.tgz 160 + 161 + 162 + 3.3 Device naming convention 163 + ============================ 164 + 165 + You may find all the driver and utilities files in /moxa/mxser. 166 + Following installation procedure depends on the model you'd like to 167 + run the driver. If you prefer module driver, please refer to 3.4. 168 + If static driver is required, please refer to 3.5. 169 + 170 + Dialin and callout port 171 + ----------------------- 172 + 173 + This driver remains traditional serial device properties. There are 174 + two special file name for each serial port. One is dial-in port 175 + which is named "ttyMxx". For callout port, the naming convention 176 + is "cumxx". 177 + 178 + Device naming when more than 2 boards installed 179 + ----------------------------------------------- 180 + 181 + Naming convention for each Smartio/Industio multiport board is 182 + pre-defined as below. 183 + 184 + ============ =============== ============== 185 + Board Num. Dial-in Port Callout port 186 + 1st board ttyM0 - ttyM7 cum0 - cum7 187 + 2nd board ttyM8 - ttyM15 cum8 - cum15 188 + 3rd board ttyM16 - ttyM23 cum16 - cum23 189 + 4th board ttyM24 - ttym31 cum24 - cum31 190 + ============ =============== ============== 191 + 192 + .. note:: 193 + 194 + Under Kernel 2.6 and upper, the cum Device is Obsolete. So use ttyM* 195 + device instead. 196 + 197 + Board sequence 198 + -------------- 199 + 200 + This driver will activate ISA boards according to the parameter set 201 + in the driver. After all specified ISA board activated, PCI board 202 + will be installed in the system automatically driven. 203 + Therefore the board number is sorted by the CAP address of ISA boards. 204 + For PCI boards, their sequence will be after ISA boards and C168H/PCI 205 + has higher priority than C104H/PCI boards. 206 + 207 + 3.4 Module driver configuration 208 + =============================== 209 + 210 + Module driver is easiest way to install. If you prefer static driver 211 + installation, please skip this paragraph. 212 + 213 + 214 + ------------- Prepare to use the MOXA driver -------------------- 215 + 216 + 3.4.1 Create tty device with correct major number 217 + ------------------------------------------------- 218 + 219 + Before using MOXA driver, your system must have the tty devices 220 + which are created with driver's major number. We offer one shell 221 + script "msmknod" to simplify the procedure. 222 + This step is only needed to be executed once. But you still 223 + need to do this procedure when: 224 + 225 + a. You change the driver's major number. Please refer the "3.7" 226 + section. 227 + b. Your total installed MOXA boards number is changed. Maybe you 228 + add/delete one MOXA board. 229 + c. You want to change the tty name. This needs to modify the 230 + shell script "msmknod" 231 + 232 + The procedure is:: 233 + 234 + # cd /moxa/mxser/driver 235 + # ./msmknod 236 + 237 + This shell script will require the major number for dial-in 238 + device and callout device to create tty device. You also need 239 + to specify the total installed MOXA board number. Default major 240 + numbers for dial-in device and callout device are 30, 35. If 241 + you need to change to other number, please refer section "3.7" 242 + for more detailed procedure. 243 + Msmknod will delete any special files occupying the same device 244 + naming. 245 + 246 + 3.4.2 Build the MOXA driver and utilities 247 + ----------------------------------------- 248 + 249 + Before using the MOXA driver and utilities, you need compile the 250 + all the source code. This step is only need to be executed once. 251 + But you still re-compile the source code if you modify the source 252 + code. For example, if you change the driver's major number (see 253 + "3.7" section), then you need to do this step again. 254 + 255 + Find "Makefile" in /moxa/mxser, then run 256 + 257 + # make clean; make install 258 + 259 + ..note:: 260 + 261 + For Red Hat 9, Red Hat Enterprise Linux AS3/ES3/WS3 & Fedora Core1: 262 + # make clean; make installsp1 263 + 264 + For Red Hat Enterprise Linux AS4/ES4/WS4: 265 + # make clean; make installsp2 266 + 267 + The driver files "mxser.o" and utilities will be properly compiled 268 + and copied to system directories respectively. 269 + 270 + ------------- Load MOXA driver-------------------- 271 + 272 + 3.4.3 Load the MOXA driver 273 + -------------------------- 274 + 275 + :: 276 + 277 + # modprobe mxser <argument> 278 + 279 + will activate the module driver. You may run "lsmod" to check 280 + if "mxser" is activated. If the MOXA board is ISA board, the 281 + <argument> is needed. Please refer to section "3.4.5" for more 282 + information. 283 + 284 + ------------- Load MOXA driver on boot -------------------- 285 + 286 + 3.4.4 Load the mxser driver 287 + --------------------------- 288 + 289 + 290 + For the above description, you may manually execute 291 + "modprobe mxser" to activate this driver and run 292 + "rmmod mxser" to remove it. 293 + 294 + However, it's better to have a boot time configuration to 295 + eliminate manual operation. Boot time configuration can be 296 + achieved by rc file. We offer one "rc.mxser" file to simplify 297 + the procedure under "moxa/mxser/driver". 298 + 299 + But if you use ISA board, please modify the "modprobe ..." command 300 + to add the argument (see "3.4.5" section). After modifying the 301 + rc.mxser, please try to execute "/moxa/mxser/driver/rc.mxser" 302 + manually to make sure the modification is ok. If any error 303 + encountered, please try to modify again. If the modification is 304 + completed, follow the below step. 305 + 306 + Run following command for setting rc files:: 307 + 308 + # cd /moxa/mxser/driver 309 + # cp ./rc.mxser /etc/rc.d 310 + # cd /etc/rc.d 311 + 312 + Check "rc.serial" is existed or not. If "rc.serial" doesn't exist, 313 + create it by vi, run "chmod 755 rc.serial" to change the permission. 314 + 315 + Add "/etc/rc.d/rc.mxser" in last line. 316 + 317 + Reboot and check if moxa.o activated by "lsmod" command. 318 + 319 + 3.4.5. specify CAP address 320 + -------------------------- 321 + 322 + If you'd like to drive Smartio/Industio ISA boards in the system, 323 + you'll have to add parameter to specify CAP address of given 324 + board while activating "mxser.o". The format for parameters are 325 + as follows.:: 326 + 327 + modprobe mxser ioaddr=0x???,0x???,0x???,0x??? 328 + | | | | 329 + | | | +- 4th ISA board 330 + | | +------ 3rd ISA board 331 + | +------------ 2nd ISA board 332 + +-------------------1st ISA board 333 + 334 + 3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x 335 + ================================================================ 336 + 337 + Note: 338 + To use static driver, you must install the linux kernel 339 + source package. 340 + 341 + 3.5.1 Backup the built-in driver in the kernel 342 + ---------------------------------------------- 343 + 344 + :: 345 + 346 + # cd /usr/src/linux/drivers/char 347 + # mv mxser.c mxser.c.old 348 + 349 + For Red Hat 7.x user, you need to create link: 350 + # cd /usr/src 351 + # ln -s linux-2.4 linux 352 + 353 + 3.5.2 Create link 354 + ----------------- 355 + :: 356 + 357 + # cd /usr/src/linux/drivers/char 358 + # ln -s /moxa/mxser/driver/mxser.c mxser.c 359 + 360 + 3.5.3 Add CAP address list for ISA boards. 361 + ------------------------------------------ 362 + 363 + For PCI boards user, please skip this step. 364 + 365 + In module mode, the CAP address for ISA board is given by 366 + parameter. In static driver configuration, you'll have to 367 + assign it within driver's source code. If you will not 368 + install any ISA boards, you may skip to next portion. 369 + The instructions to modify driver source code are as 370 + below. 371 + 372 + a. run:: 373 + 374 + # cd /moxa/mxser/driver 375 + # vi mxser.c 376 + 377 + b. Find the array mxserBoardCAP[] as below:: 378 + 379 + static int mxserBoardCAP[] = {0x00, 0x00, 0x00, 0x00}; 380 + 381 + c. Change the address within this array using vi. For 382 + example, to driver 2 ISA boards with CAP address 383 + 0x280 and 0x180 as 1st and 2nd board. Just to change 384 + the source code as follows:: 385 + 386 + static int mxserBoardCAP[] = {0x280, 0x180, 0x00, 0x00}; 387 + 388 + 3.5.4 Setup kernel configuration 389 + -------------------------------- 390 + 391 + Configure the kernel:: 392 + 393 + # cd /usr/src/linux 394 + # make menuconfig 395 + 396 + You will go into a menu-driven system. Please select [Character 397 + devices][Non-standard serial port support], enable the [Moxa 398 + SmartIO support] driver with "[*]" for built-in (not "[M]"), then 399 + select [Exit] to exit this program. 400 + 401 + 3.5.5 Rebuild kernel 402 + -------------------- 403 + 404 + The following are for Linux kernel rebuilding, for your 405 + reference only. 406 + 407 + For appropriate details, please refer to the Linux document: 408 + 409 + a. Run the following commands:: 410 + 411 + cd /usr/src/linux 412 + make clean # take a few minutes 413 + make dep # take a few minutes 414 + make bzImage # take probably 10-20 minutes 415 + make install # copy boot image to correct position 416 + 417 + f. Please make sure the boot kernel (vmlinuz) is in the 418 + correct position. 419 + g. If you use 'lilo' utility, you should check /etc/lilo.conf 420 + 'image' item specified the path which is the 'vmlinuz' path, 421 + or you will load wrong (or old) boot kernel image (vmlinuz). 422 + After checking /etc/lilo.conf, please run "lilo". 423 + 424 + Note that if the result of "make bzImage" is ERROR, then you have to 425 + go back to Linux configuration Setup. Type "make menuconfig" in 426 + directory /usr/src/linux. 427 + 428 + 429 + 3.5.6 Make tty device and special file 430 + -------------------------------------- 431 + 432 + :: 433 + # cd /moxa/mxser/driver 434 + # ./msmknod 435 + 436 + 3.5.7 Make utility 437 + ------------------ 438 + 439 + :: 440 + 441 + # cd /moxa/mxser/utility 442 + # make clean; make install 443 + 444 + 3.5.8 Reboot 445 + ------------ 446 + 447 + 448 + 449 + 3.6 Custom configuration 450 + ======================== 451 + 452 + Although this driver already provides you default configuration, you 453 + still can change the device name and major number. The instruction to 454 + change these parameters are shown as below. 455 + 456 + a. Change Device name 457 + 458 + If you'd like to use other device names instead of default naming 459 + convention, all you have to do is to modify the internal code 460 + within the shell script "msmknod". First, you have to open "msmknod" 461 + by vi. Locate each line contains "ttyM" and "cum" and change them 462 + to the device name you desired. "msmknod" creates the device names 463 + you need next time executed. 464 + 465 + b. Change Major number 466 + 467 + If major number 30 and 35 had been occupied, you may have to select 468 + 2 free major numbers for this driver. There are 3 steps to change 469 + major numbers. 470 + 471 + 3.6.1 Find free major numbers 472 + ----------------------------- 473 + 474 + In /proc/devices, you may find all the major numbers occupied 475 + in the system. Please select 2 major numbers that are available. 476 + e.g. 40, 45. 477 + 478 + 3.6.2 Create special files 479 + -------------------------- 480 + 481 + Run /moxa/mxser/driver/msmknod to create special files with 482 + specified major numbers. 483 + 484 + 3.6.3 Modify driver with new major number 485 + ----------------------------------------- 486 + 487 + Run vi to open /moxa/mxser/driver/mxser.c. Locate the line 488 + contains "MXSERMAJOR". Change the content as below:: 489 + 490 + #define MXSERMAJOR 40 491 + #define MXSERCUMAJOR 45 492 + 493 + 3.6.4 Run "make clean; make install" in /moxa/mxser/driver. 494 + 495 + 3.7 Verify driver installation 496 + ============================== 497 + 498 + You may refer to /var/log/messages to check the latest status 499 + log reported by this driver whenever it's activated. 500 + 501 + 4. Utilities 502 + ^^^^^^^^^^^^ 503 + 504 + There are 3 utilities contained in this driver. They are msdiag, msmon and 505 + msterm. These 3 utilities are released in form of source code. They should 506 + be compiled into executable file and copied into /usr/bin. 507 + 508 + Before using these utilities, please load driver (refer 3.4 & 3.5) and 509 + make sure you had run the "msmknod" utility. 510 + 511 + msdiag - Diagnostic 512 + =================== 513 + 514 + This utility provides the function to display what Moxa Smartio/Industio 515 + board found by driver in the system. 516 + 517 + msmon - Port Monitoring 518 + ======================= 519 + 520 + This utility gives the user a quick view about all the MOXA ports' 521 + activities. One can easily learn each port's total received/transmitted 522 + (Rx/Tx) character count since the time when the monitoring is started. 523 + 524 + Rx/Tx throughputs per second are also reported in interval basis (e.g. 525 + the last 5 seconds) and in average basis (since the time the monitoring 526 + is started). You can reset all ports' count by <HOME> key. <+> <-> 527 + (plus/minus) keys to change the displaying time interval. Press <ENTER> 528 + on the port, that cursor stay, to view the port's communication 529 + parameters, signal status, and input/output queue. 530 + 531 + msterm - Terminal Emulation 532 + =========================== 533 + 534 + This utility provides data sending and receiving ability of all tty ports, 535 + especially for MOXA ports. It is quite useful for testing simple 536 + application, for example, sending AT command to a modem connected to the 537 + port or used as a terminal for login purpose. Note that this is only a 538 + dumb terminal emulation without handling full screen operation. 539 + 540 + 5. Setserial 541 + ^^^^^^^^^^^^ 542 + 543 + Supported Setserial parameters are listed as below. 544 + 545 + ============== ========================================================= 546 + uart set UART type(16450-->disable FIFO, 16550A-->enable FIFO) 547 + close_delay set the amount of time(in 1/100 of a second) that DTR 548 + should be kept low while being closed. 549 + closing_wait set the amount of time(in 1/100 of a second) that the 550 + serial port should wait for data to be drained while 551 + being closed, before the receiver is disable. 552 + spd_hi Use 57.6kb when the application requests 38.4kb. 553 + spd_vhi Use 115.2kb when the application requests 38.4kb. 554 + spd_shi Use 230.4kb when the application requests 38.4kb. 555 + spd_warp Use 460.8kb when the application requests 38.4kb. 556 + spd_normal Use 38.4kb when the application requests 38.4kb. 557 + spd_cust Use the custom divisor to set the speed when the 558 + application requests 38.4kb. 559 + divisor This option set the custom division. 560 + baud_base This option set the base baud rate. 561 + ============== ========================================================= 562 + 563 + 6. Troubleshooting 564 + ^^^^^^^^^^^^^^^^^^ 565 + 566 + The boot time error messages and solutions are stated as clearly as 567 + possible. If all the possible solutions fail, please contact our technical 568 + support team to get more help. 569 + 570 + 571 + Error msg: 572 + More than 4 Moxa Smartio/Industio family boards found. Fifth board 573 + and after are ignored. 574 + 575 + Solution: 576 + To avoid this problem, please unplug fifth and after board, because Moxa 577 + driver supports up to 4 boards. 578 + 579 + Error msg: 580 + Request_irq fail, IRQ(?) may be conflict with another device. 581 + 582 + Solution: 583 + Other PCI or ISA devices occupy the assigned IRQ. If you are not sure 584 + which device causes the situation, please check /proc/interrupts to find 585 + free IRQ and simply change another free IRQ for Moxa board. 586 + 587 + Error msg: 588 + Board #: C1xx Series(CAP=xxx) interrupt number invalid. 589 + 590 + Solution: 591 + Each port within the same multiport board shares the same IRQ. Please set 592 + one IRQ (IRQ doesn't equal to zero) for one Moxa board. 593 + 594 + Error msg: 595 + No interrupt vector be set for Moxa ISA board(CAP=xxx). 596 + 597 + Solution: 598 + Moxa ISA board needs an interrupt vector.Please refer to user's manual 599 + "Hardware Installation" chapter to set interrupt vector. 600 + 601 + Error msg: 602 + Couldn't install MOXA Smartio/Industio family driver! 603 + 604 + Solution: 605 + Load Moxa driver fail, the major number may conflict with other devices. 606 + Please refer to previous section 3.7 to change a free major number for 607 + Moxa driver. 608 + 609 + Error msg: 610 + Couldn't install MOXA Smartio/Industio family callout driver! 611 + 612 + Solution: 613 + Load Moxa callout driver fail, the callout device major number may 614 + conflict with other devices. Please refer to previous section 3.7 to 615 + change a free callout device major number for Moxa driver.
+103
Documentation/serial/n_gsm.rst
··· 1 + ============================== 2 + GSM 0710 tty multiplexor HOWTO 3 + ============================== 4 + 5 + This line discipline implements the GSM 07.10 multiplexing protocol 6 + detailed in the following 3GPP document: 7 + 8 + http://www.3gpp.org/ftp/Specs/archive/07_series/07.10/0710-720.zip 9 + 10 + This document give some hints on how to use this driver with GPRS and 3G 11 + modems connected to a physical serial port. 12 + 13 + How to use it 14 + ------------- 15 + 1. initialize the modem in 0710 mux mode (usually AT+CMUX= command) through 16 + its serial port. Depending on the modem used, you can pass more or less 17 + parameters to this command, 18 + 2. switch the serial line to using the n_gsm line discipline by using 19 + TIOCSETD ioctl, 20 + 3. configure the mux using GSMIOC_GETCONF / GSMIOC_SETCONF ioctl, 21 + 22 + Major parts of the initialization program : 23 + (a good starting point is util-linux-ng/sys-utils/ldattach.c):: 24 + 25 + #include <linux/gsmmux.h> 26 + #define N_GSM0710 21 /* GSM 0710 Mux */ 27 + #define DEFAULT_SPEED B115200 28 + #define SERIAL_PORT /dev/ttyS0 29 + 30 + int ldisc = N_GSM0710; 31 + struct gsm_config c; 32 + struct termios configuration; 33 + 34 + /* open the serial port connected to the modem */ 35 + fd = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NDELAY); 36 + 37 + /* configure the serial port : speed, flow control ... */ 38 + 39 + /* send the AT commands to switch the modem to CMUX mode 40 + and check that it's successful (should return OK) */ 41 + write(fd, "AT+CMUX=0\r", 10); 42 + 43 + /* experience showed that some modems need some time before 44 + being able to answer to the first MUX packet so a delay 45 + may be needed here in some case */ 46 + sleep(3); 47 + 48 + /* use n_gsm line discipline */ 49 + ioctl(fd, TIOCSETD, &ldisc); 50 + 51 + /* get n_gsm configuration */ 52 + ioctl(fd, GSMIOC_GETCONF, &c); 53 + /* we are initiator and need encoding 0 (basic) */ 54 + c.initiator = 1; 55 + c.encapsulation = 0; 56 + /* our modem defaults to a maximum size of 127 bytes */ 57 + c.mru = 127; 58 + c.mtu = 127; 59 + /* set the new configuration */ 60 + ioctl(fd, GSMIOC_SETCONF, &c); 61 + 62 + /* and wait for ever to keep the line discipline enabled */ 63 + daemon(0,0); 64 + pause(); 65 + 66 + 4. create the devices corresponding to the "virtual" serial ports (take care, 67 + each modem has its configuration and some DLC have dedicated functions, 68 + for example GPS), starting with minor 1 (DLC0 is reserved for the management 69 + of the mux):: 70 + 71 + MAJOR=`cat /proc/devices |grep gsmtty | awk '{print $1}` 72 + for i in `seq 1 4`; do 73 + mknod /dev/ttygsm$i c $MAJOR $i 74 + done 75 + 76 + 5. use these devices as plain serial ports. 77 + 78 + for example, it's possible: 79 + 80 + - and to use gnokii to send / receive SMS on ttygsm1 81 + - to use ppp to establish a datalink on ttygsm2 82 + 83 + 6. first close all virtual ports before closing the physical port. 84 + 85 + Note that after closing the physical port the modem is still in multiplexing 86 + mode. This may prevent a successful re-opening of the port later. To avoid 87 + this situation either reset the modem if your hardware allows that or send 88 + a disconnect command frame manually before initializing the multiplexing mode 89 + for the second time. The byte sequence for the disconnect command frame is:: 90 + 91 + 0xf9, 0x03, 0xef, 0x03, 0xc3, 0x16, 0xf9. 92 + 93 + Additional Documentation 94 + ------------------------ 95 + More practical details on the protocol and how it's supported by industrial 96 + modems can be found in the following documents : 97 + 98 + - http://www.telit.com/module/infopool/download.php?id=616 99 + - http://www.u-blox.com/images/downloads/Product_Docs/LEON-G100-G200-MuxImplementation_ApplicationNote_%28GSM%20G1-CS-10002%29.pdf 100 + - http://www.sierrawireless.com/Support/Downloads/AirPrime/WMP_Series/~/media/Support_Downloads/AirPrime/Application_notes/CMUX_Feature_Application_Note-Rev004.ashx 101 + - http://wm.sim.com/sim/News/photo/2010721161442.pdf 102 + 103 + 11-03-08 - Eric Bénard - <eric@eukrea.com>
-96
Documentation/serial/n_gsm.txt
··· 1 - n_gsm.c GSM 0710 tty multiplexor HOWTO 2 - =================================================== 3 - 4 - This line discipline implements the GSM 07.10 multiplexing protocol 5 - detailed in the following 3GPP document : 6 - http://www.3gpp.org/ftp/Specs/archive/07_series/07.10/0710-720.zip 7 - 8 - This document give some hints on how to use this driver with GPRS and 3G 9 - modems connected to a physical serial port. 10 - 11 - How to use it 12 - ------------- 13 - 1- initialize the modem in 0710 mux mode (usually AT+CMUX= command) through 14 - its serial port. Depending on the modem used, you can pass more or less 15 - parameters to this command, 16 - 2- switch the serial line to using the n_gsm line discipline by using 17 - TIOCSETD ioctl, 18 - 3- configure the mux using GSMIOC_GETCONF / GSMIOC_SETCONF ioctl, 19 - 20 - Major parts of the initialization program : 21 - (a good starting point is util-linux-ng/sys-utils/ldattach.c) 22 - #include <linux/gsmmux.h> 23 - #define N_GSM0710 21 /* GSM 0710 Mux */ 24 - #define DEFAULT_SPEED B115200 25 - #define SERIAL_PORT /dev/ttyS0 26 - 27 - int ldisc = N_GSM0710; 28 - struct gsm_config c; 29 - struct termios configuration; 30 - 31 - /* open the serial port connected to the modem */ 32 - fd = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NDELAY); 33 - 34 - /* configure the serial port : speed, flow control ... */ 35 - 36 - /* send the AT commands to switch the modem to CMUX mode 37 - and check that it's successful (should return OK) */ 38 - write(fd, "AT+CMUX=0\r", 10); 39 - 40 - /* experience showed that some modems need some time before 41 - being able to answer to the first MUX packet so a delay 42 - may be needed here in some case */ 43 - sleep(3); 44 - 45 - /* use n_gsm line discipline */ 46 - ioctl(fd, TIOCSETD, &ldisc); 47 - 48 - /* get n_gsm configuration */ 49 - ioctl(fd, GSMIOC_GETCONF, &c); 50 - /* we are initiator and need encoding 0 (basic) */ 51 - c.initiator = 1; 52 - c.encapsulation = 0; 53 - /* our modem defaults to a maximum size of 127 bytes */ 54 - c.mru = 127; 55 - c.mtu = 127; 56 - /* set the new configuration */ 57 - ioctl(fd, GSMIOC_SETCONF, &c); 58 - 59 - /* and wait for ever to keep the line discipline enabled */ 60 - daemon(0,0); 61 - pause(); 62 - 63 - 4- create the devices corresponding to the "virtual" serial ports (take care, 64 - each modem has its configuration and some DLC have dedicated functions, 65 - for example GPS), starting with minor 1 (DLC0 is reserved for the management 66 - of the mux) 67 - 68 - MAJOR=`cat /proc/devices |grep gsmtty | awk '{print $1}` 69 - for i in `seq 1 4`; do 70 - mknod /dev/ttygsm$i c $MAJOR $i 71 - done 72 - 73 - 5- use these devices as plain serial ports. 74 - for example, it's possible : 75 - - and to use gnokii to send / receive SMS on ttygsm1 76 - - to use ppp to establish a datalink on ttygsm2 77 - 78 - 6- first close all virtual ports before closing the physical port. 79 - 80 - Note that after closing the physical port the modem is still in multiplexing 81 - mode. This may prevent a successful re-opening of the port later. To avoid 82 - this situation either reset the modem if your hardware allows that or send 83 - a disconnect command frame manually before initializing the multiplexing mode 84 - for the second time. The byte sequence for the disconnect command frame is: 85 - 0xf9, 0x03, 0xef, 0x03, 0xc3, 0x16, 0xf9. 86 - 87 - Additional Documentation 88 - ------------------------ 89 - More practical details on the protocol and how it's supported by industrial 90 - modems can be found in the following documents : 91 - http://www.telit.com/module/infopool/download.php?id=616 92 - http://www.u-blox.com/images/downloads/Product_Docs/LEON-G100-G200-MuxImplementation_ApplicationNote_%28GSM%20G1-CS-10002%29.pdf 93 - http://www.sierrawireless.com/Support/Downloads/AirPrime/WMP_Series/~/media/Support_Downloads/AirPrime/Application_notes/CMUX_Feature_Application_Note-Rev004.ashx 94 - http://wm.sim.com/sim/News/photo/2010721161442.pdf 95 - 96 - 11-03-08 - Eric Bénard - <eric@eukrea.com>
+70 -74
Documentation/serial/rocket.txt Documentation/serial/rocket.rst
··· 1 - Comtrol(tm) RocketPort(R)/RocketModem(TM) Series 1 + ================================================ 2 + Comtrol(tm) RocketPort(R)/RocketModem(TM) Series 3 + ================================================ 4 + 2 5 Device Driver for the Linux Operating System 6 + ============================================ 3 7 4 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 5 - 6 - PRODUCT OVERVIEW 8 + Product overview 7 9 ---------------- 8 10 9 11 This driver provides a loadable kernel driver for the Comtrol RocketPort 10 - and RocketModem PCI boards. These boards provide, 2, 4, 8, 16, or 32 12 + and RocketModem PCI boards. These boards provide, 2, 4, 8, 16, or 32 11 13 high-speed serial ports or modems. This driver supports up to a combination 12 14 of four RocketPort or RocketModems boards in one machine simultaneously. 13 15 This file assumes that you are using the RocketPort driver which is 14 - integrated into the kernel sources. 16 + integrated into the kernel sources. 15 17 16 - The driver can also be installed as an external module using the usual 17 - "make;make install" routine. This external module driver, obtainable 18 + The driver can also be installed as an external module using the usual 19 + "make;make install" routine. This external module driver, obtainable 18 20 from the Comtrol website listed below, is useful for updating the driver 19 21 or installing it into kernels which do not have the driver configured 20 22 into them. Installations instructions for the external module ··· 31 29 32 30 You pass the I/O port to the driver using the following module parameters: 33 31 34 - board1 : I/O port for the first ISA board 35 - board2 : I/O port for the second ISA board 36 - board3 : I/O port for the third ISA board 37 - board4 : I/O port for the fourth ISA board 32 + board1: 33 + I/O port for the first ISA board 34 + board2: 35 + I/O port for the second ISA board 36 + board3: 37 + I/O port for the third ISA board 38 + board4: 39 + I/O port for the fourth ISA board 38 40 39 41 There is a set of utilities and scripts provided with the external driver 40 - ( downloadable from http://www.comtrol.com ) that ease the configuration and 42 + (downloadable from http://www.comtrol.com) that ease the configuration and 41 43 setup of the ISA cards. 42 44 43 45 The RocketModem II PCI boards require firmware to be loaded into the card 44 46 before it will function. The driver has only been tested as a module for this 45 47 board. 46 48 47 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 48 - 49 - INSTALLATION PROCEDURES 49 + Installation Procedures 50 50 ----------------------- 51 51 52 - RocketPort/RocketModem PCI cards require no driver configuration, they are 52 + RocketPort/RocketModem PCI cards require no driver configuration, they are 53 53 automatically detected and configured. 54 54 55 - The RocketPort driver can be installed as a module (recommended) or built 55 + The RocketPort driver can be installed as a module (recommended) or built 56 56 into the kernel. This is selected, as for other drivers, through the `make config` 57 - command from the root of the Linux source tree during the kernel build process. 57 + command from the root of the Linux source tree during the kernel build process. 58 58 59 59 The RocketPort/RocketModem serial ports installed by this driver are assigned 60 - device major number 46, and will be named /dev/ttyRx, where x is the port number 60 + device major number 46, and will be named /dev/ttyRx, where x is the port number 61 61 starting at zero (ex. /dev/ttyR0, /devttyR1, ...). If you have multiple cards 62 62 installed in the system, the mapping of port names to serial ports is displayed 63 63 in the system log at /var/log/messages. 64 64 65 65 If installed as a module, the module must be loaded. This can be done 66 66 manually by entering "modprobe rocket". To have the module loaded automatically 67 - upon system boot, edit a /etc/modprobe.d/*.conf file and add the line 67 + upon system boot, edit a `/etc/modprobe.d/*.conf` file and add the line 68 68 "alias char-major-46 rocket". 69 69 70 70 In order to use the ports, their device names (nodes) must be created with mknod. 71 - This is only required once, the system will retain the names once created. To 72 - create the RocketPort/RocketModem device names, use the command 73 - "mknod /dev/ttyRx c 46 x" where x is the port number starting at zero. For example: 71 + This is only required once, the system will retain the names once created. To 72 + create the RocketPort/RocketModem device names, use the command 73 + "mknod /dev/ttyRx c 46 x" where x is the port number starting at zero. 74 74 75 - >mknod /dev/ttyR0 c 46 0 76 - >mknod /dev/ttyR1 c 46 1 77 - >mknod /dev/ttyR2 c 46 2 75 + For example:: 76 + 77 + > mknod /dev/ttyR0 c 46 0 78 + > mknod /dev/ttyR1 c 46 1 79 + > mknod /dev/ttyR2 c 46 2 78 80 79 81 The Linux script MAKEDEV will create the first 16 ttyRx device names (nodes) 80 - for you: 82 + for you:: 81 83 82 - >/dev/MAKEDEV ttyR 83 - 84 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 84 + >/dev/MAKEDEV ttyR 85 85 86 86 ISA Rocketport Boards 87 87 --------------------- ··· 93 89 switches on the Rocketport board. 94 90 95 91 96 - SETTING THE I/O ADDRESS 92 + Setting the I/O address 97 93 ----------------------- 98 94 99 95 Before installing RocketPort(R) or RocketPort RA boards, you must find ··· 134 130 need to set the second, third, or fourth board to one of the next available 135 131 blocks such as 0x180. 136 132 137 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 133 + RocketPort and RocketPort RA SW1 Settings:: 138 134 139 - RocketPort and RocketPort RA SW1 Settings: 135 + +-------------------------------+ 136 + | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 137 + +-------+-------+---------------+ 138 + | Unused| Card | I/O Port Block| 139 + +-------------------------------+ 140 140 141 - +-------------------------------+ 142 - | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 143 - +-------+-------+---------------+ 144 - | Unused| Card | I/O Port Block| 145 - +-------------------------------+ 141 + DIP Switches DIP Switches 142 + 7 8 6 5 143 + =================== =================== 144 + On On UNUSED, MUST BE ON. On On First Card <==== Default 145 + On Off Second Card 146 + Off On Third Card 147 + Off Off Fourth Card 146 148 147 - DIP Switches DIP Switches 148 - 7 8 6 5 149 - =================== =================== 150 - On On UNUSED, MUST BE ON. On On First Card <==== Default 151 - On Off Second Card 152 - Off On Third Card 153 - Off Off Fourth Card 149 + DIP Switches I/O Address Range 150 + 4 3 2 1 Used by the First Card 151 + ===================================== 152 + On Off On Off 100-143 153 + On Off Off On 140-183 154 + On Off Off Off 180-1C3 <==== Default 155 + Off On On Off 200-243 156 + Off On Off On 240-283 157 + Off On Off Off 280-2C3 158 + Off Off On Off 300-343 159 + Off Off Off On 340-383 160 + Off Off Off Off 380-3C3 154 161 155 - DIP Switches I/O Address Range 156 - 4 3 2 1 Used by the First Card 157 - ===================================== 158 - On Off On Off 100-143 159 - On Off Off On 140-183 160 - On Off Off Off 180-1C3 <==== Default 161 - Off On On Off 200-243 162 - Off On Off On 240-283 163 - Off On Off Off 280-2C3 164 - Off Off On Off 300-343 165 - Off Off Off On 340-383 166 - Off Off Off Off 380-3C3 167 - 168 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 169 - 170 - REPORTING BUGS 162 + Reporting Bugs 171 163 -------------- 172 164 173 165 For technical support, please provide the following ··· 171 171 kernel, and type of board you are using. Error messages and log 172 172 printouts port configuration details are especially helpful. 173 173 174 - USA 175 - Phone: (612) 494-4100 176 - FAX: (612) 494-4199 177 - email: support@comtrol.com 174 + USA: 175 + :Phone: (612) 494-4100 176 + :FAX: (612) 494-4199 177 + :email: support@comtrol.com 178 178 179 - Comtrol Europe 180 - Phone: +44 (0) 1 869 323-220 181 - FAX: +44 (0) 1 869 323-211 182 - email: support@comtrol.co.uk 179 + Comtrol Europe: 180 + :Phone: +44 (0) 1 869 323-220 181 + :FAX: +44 (0) 1 869 323-211 182 + :email: support@comtrol.co.uk 183 183 184 184 Web: http://www.comtrol.com 185 185 FTP: ftp.comtrol.com 186 - 187 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 188 - 189 -
+14 -7
Documentation/serial/serial-iso7816.txt Documentation/serial/serial-iso7816.rst
··· 1 - ISO7816 SERIAL COMMUNICATIONS 1 + ============================= 2 + ISO7816 Serial Communications 3 + ============================= 2 4 3 - 1. INTRODUCTION 5 + 1. Introduction 6 + =============== 4 7 5 8 ISO/IEC7816 is a series of standards specifying integrated circuit cards (ICC) 6 9 also known as smart cards. 7 10 8 - 2. HARDWARE-RELATED CONSIDERATIONS 11 + 2. Hardware-related considerations 12 + ================================== 9 13 10 14 Some CPUs/UARTs (e.g., Microchip AT91) contain a built-in mode capable of 11 15 handling communication with a smart card. ··· 19 15 available at user-level to allow switching from one mode to the other, and 20 16 vice versa. 21 17 22 - 3. DATA STRUCTURES ALREADY AVAILABLE IN THE KERNEL 18 + 3. Data Structures Already Available in the Kernel 19 + ================================================== 23 20 24 21 The Linux kernel provides the serial_iso7816 structure (see [1]) to handle 25 22 ISO7816 communications. This data structure is used to set and configure ··· 32 27 to TIOCGISO7816 and TIOCSISO7816 ioctls (see below). The iso7816_config 33 28 callback receives a pointer to struct serial_iso7816. 34 29 35 - 4. USAGE FROM USER-LEVEL 30 + 4. Usage from user-level 31 + ======================== 36 32 37 33 From user-level, ISO7816 configuration can be get/set using the previous 38 - ioctls. For instance, to set ISO7816 you can use the following code: 34 + ioctls. For instance, to set ISO7816 you can use the following code:: 39 35 40 36 #include <linux/serial.h> 41 37 ··· 84 78 /* Error handling. See errno. */ 85 79 } 86 80 87 - 5. REFERENCES 81 + 5. References 82 + ============= 88 83 89 84 [1] include/uapi/linux/serial.h
+15 -7
Documentation/serial/serial-rs485.txt Documentation/serial/serial-rs485.rst
··· 1 - RS485 SERIAL COMMUNICATIONS 1 + =========================== 2 + RS485 Serial Communications 3 + =========================== 2 4 3 - 1. INTRODUCTION 5 + 1. Introduction 6 + =============== 4 7 5 8 EIA-485, also known as TIA/EIA-485 or RS-485, is a standard defining the 6 9 electrical characteristics of drivers and receivers for use in balanced ··· 12 9 because it can be used effectively over long distances and in electrically 13 10 noisy environments. 14 11 15 - 2. HARDWARE-RELATED CONSIDERATIONS 12 + 2. Hardware-related Considerations 13 + ================================== 16 14 17 15 Some CPUs/UARTs (e.g., Atmel AT91 or 16C950 UART) contain a built-in 18 16 half-duplex mode capable of automatically controlling line direction by ··· 26 22 available at user-level to allow switching from one mode to the other, and 27 23 vice versa. 28 24 29 - 3. DATA STRUCTURES ALREADY AVAILABLE IN THE KERNEL 25 + 3. Data Structures Already Available in the Kernel 26 + ================================================== 30 27 31 28 The Linux kernel provides the serial_rs485 structure (see [1]) to handle 32 29 RS485 communications. This data structure is used to set and configure RS485 ··· 43 38 to TIOCSRS485 and TIOCGRS485 ioctls (see below). The rs485_config callback 44 39 receives a pointer to struct serial_rs485. 45 40 46 - 4. USAGE FROM USER-LEVEL 41 + 4. Usage from user-level 42 + ======================== 47 43 48 44 From user-level, RS485 configuration can be get/set using the previous 49 - ioctls. For instance, to set RS485 you can use the following code: 45 + ioctls. For instance, to set RS485 you can use the following code:: 50 46 51 47 #include <linux/serial.h> 52 48 ··· 95 89 /* Error handling. See errno. */ 96 90 } 97 91 98 - 5. REFERENCES 92 + 5. References 93 + ============= 99 94 100 95 [1] include/uapi/linux/serial.h 96 + 101 97 [2] Documentation/devicetree/bindings/serial/rs485.txt
+63 -48
Documentation/serial/tty.txt Documentation/serial/tty.rst
··· 1 - 2 - The Lockronomicon 1 + ================= 2 + The Lockronomicon 3 + ================= 3 4 4 5 Your guide to the ancient and twisted locking policies of the tty layer and 5 6 the warped logic behind them. Beware all ye who read on. ··· 10 9 --------------- 11 10 12 11 Line disciplines are registered with tty_register_ldisc() passing the 13 - discipline number and the ldisc structure. At the point of registration the 12 + discipline number and the ldisc structure. At the point of registration the 14 13 discipline must be ready to use and it is possible it will get used before 15 14 the call returns success. If the call returns an error then it won't get 16 15 called. Do not re-use ldisc numbers as they are part of the userspace ABI 17 16 and writing over an existing ldisc will cause demons to eat your computer. 18 - After the return the ldisc data has been copied so you may free your own 17 + After the return the ldisc data has been copied so you may free your own 19 18 copy of the structure. You must not re-register over the top of the line 20 19 discipline even with the same data or your computer again will be eaten by 21 20 demons. ··· 27 26 28 27 Heed this warning: the reference count field of the registered copies of the 29 28 tty_ldisc structure in the ldisc table counts the number of lines using this 30 - discipline. The reference count of the tty_ldisc structure within a tty 29 + discipline. The reference count of the tty_ldisc structure within a tty 31 30 counts the number of active users of the ldisc at this instant. In effect it 32 31 counts the number of threads of execution within an ldisc method (plus those 33 32 about to enter and exit although this detail matters not). ··· 35 34 Line Discipline Methods 36 35 ----------------------- 37 36 38 - TTY side interfaces: 37 + TTY side interfaces 38 + ^^^^^^^^^^^^^^^^^^^ 39 39 40 - open() - Called when the line discipline is attached to 40 + ======================= ======================================================= 41 + open() Called when the line discipline is attached to 41 42 the terminal. No other call into the line 42 43 discipline for this tty will occur until it 43 44 completes successfully. Should initialize any ··· 50 47 Returning an error will prevent the ldisc from 51 48 being attached. Can sleep. 52 49 53 - close() - This is called on a terminal when the line 50 + close() This is called on a terminal when the line 54 51 discipline is being unplugged. At the point of 55 52 execution no further users will enter the 56 53 ldisc code for this tty. Can sleep. 57 54 58 - hangup() - Called when the tty line is hung up. 55 + hangup() Called when the tty line is hung up. 59 56 The line discipline should cease I/O to the tty. 60 57 No further calls into the ldisc code will occur. 61 58 The return value is ignored. Can sleep. 62 59 63 - read() - (optional) A process requests reading data from 60 + read() (optional) A process requests reading data from 64 61 the line. Multiple read calls may occur in parallel 65 62 and the ldisc must deal with serialization issues. 66 63 If not defined, the process will receive an EIO 67 64 error. May sleep. 68 65 69 - write() - (optional) A process requests writing data to the 66 + write() (optional) A process requests writing data to the 70 67 line. Multiple write calls are serialized by the 71 68 tty layer for the ldisc. If not defined, the 72 69 process will receive an EIO error. May sleep. 73 70 74 - flush_buffer() - (optional) May be called at any point between 71 + flush_buffer() (optional) May be called at any point between 75 72 open and close, and instructs the line discipline 76 73 to empty its input buffer. 77 74 78 - set_termios() - (optional) Called on termios structure changes. 75 + set_termios() (optional) Called on termios structure changes. 79 76 The caller passes the old termios data and the 80 77 current data is in the tty. Called under the 81 78 termios semaphore so allowed to sleep. Serialized 82 79 against itself only. 83 80 84 - poll() - (optional) Check the status for the poll/select 81 + poll() (optional) Check the status for the poll/select 85 82 calls. Multiple poll calls may occur in parallel. 86 83 May sleep. 87 84 88 - ioctl() - (optional) Called when an ioctl is handed to the 85 + ioctl() (optional) Called when an ioctl is handed to the 89 86 tty layer that might be for the ldisc. Multiple 90 87 ioctl calls may occur in parallel. May sleep. 91 88 92 - compat_ioctl() - (optional) Called when a 32 bit ioctl is handed 89 + compat_ioctl() (optional) Called when a 32 bit ioctl is handed 93 90 to the tty layer that might be for the ldisc. 94 91 Multiple ioctl calls may occur in parallel. 95 92 May sleep. 93 + ======================= ======================================================= 96 94 97 - Driver Side Interfaces: 95 + Driver Side Interfaces 96 + ^^^^^^^^^^^^^^^^^^^^^^ 98 97 99 - receive_buf() - (optional) Called by the low-level driver to hand 98 + ======================= ======================================================= 99 + receive_buf() (optional) Called by the low-level driver to hand 100 100 a buffer of received bytes to the ldisc for 101 101 processing. The number of bytes is guaranteed not 102 102 to exceed the current value of tty->receive_room. 103 103 All bytes must be processed. 104 104 105 - receive_buf2() - (optional) Called by the low-level driver to hand 105 + receive_buf2() (optional) Called by the low-level driver to hand 106 106 a buffer of received bytes to the ldisc for 107 107 processing. Returns the number of bytes processed. 108 108 109 109 If both receive_buf() and receive_buf2() are 110 110 defined, receive_buf2() should be preferred. 111 111 112 - write_wakeup() - May be called at any point between open and close. 112 + write_wakeup() May be called at any point between open and close. 113 113 The TTY_DO_WRITE_WAKEUP flag indicates if a call 114 114 is needed but always races versus calls. Thus the 115 115 ldisc must be careful about setting order and to ··· 123 117 is permitted to call the driver write method from 124 118 this function. In such a situation defer it. 125 119 126 - dcd_change() - Report to the tty line the current DCD pin status 120 + dcd_change() Report to the tty line the current DCD pin status 127 121 changes and the relative timestamp. The timestamp 128 122 cannot be NULL. 123 + ======================= ======================================================= 129 124 130 125 131 126 Driver Access 127 + ^^^^^^^^^^^^^ 132 128 133 129 Line discipline methods can call the following methods of the underlying 134 130 hardware driver through the function pointers within the tty->driver 135 131 structure: 136 132 133 + ======================= ======================================================= 137 134 write() Write a block of characters to the tty device. 138 135 Returns the number of characters accepted. The 139 136 character buffer passed to this method is already ··· 198 189 characters in its transmitter FIFO. 199 190 200 191 send_xchar() Send a high-priority XON/XOFF character to the device. 192 + ======================= ======================================================= 201 193 202 194 203 195 Flags 196 + ^^^^^ 204 197 205 198 Line discipline methods have access to tty->flags field containing the 206 199 following interesting flags: 207 200 201 + ======================= ======================================================= 208 202 TTY_THROTTLED Driver input is throttled. The ldisc should call 209 203 tty->driver->unthrottle() in order to resume 210 204 reception when it is ready to process more data. ··· 224 212 225 213 TTY_NO_WRITE_SPLIT Prevent driver from splitting up writes into 226 214 smaller chunks. 215 + ======================= ======================================================= 227 216 228 217 229 218 Locking 219 + ^^^^^^^ 230 220 231 221 Callers to the line discipline functions from the tty layer are required to 232 222 take line discipline locks. The same is true of calls from the driver side 233 223 but not yet enforced. 234 224 235 - Three calls are now provided 225 + Three calls are now provided:: 236 226 237 227 ldisc = tty_ldisc_ref(tty); 238 228 239 229 takes a handle to the line discipline in the tty and returns it. If no ldisc 240 230 is currently attached or the ldisc is being closed and re-opened at this 241 231 point then NULL is returned. While this handle is held the ldisc will not 242 - change or go away. 232 + change or go away:: 243 233 244 234 tty_ldisc_deref(ldisc) 245 235 246 236 Returns the ldisc reference and allows the ldisc to be closed. Returning the 247 237 reference takes away your right to call the ldisc functions until you take 248 - a new reference. 238 + a new reference:: 249 239 250 240 ldisc = tty_ldisc_ref_wait(tty); 251 241 252 242 Performs the same function as tty_ldisc_ref except that it will wait for an 253 - ldisc change to complete and then return a reference to the new ldisc. 243 + ldisc change to complete and then return a reference to the new ldisc. 254 244 255 245 While these functions are slightly slower than the old code they should have 256 246 minimal impact as most receive logic uses the flip buffers and they only 257 247 need to take a reference when they push bits up through the driver. 258 248 259 - A caution: The ldisc->open(), ldisc->close() and driver->set_ldisc 249 + A caution: The ldisc->open(), ldisc->close() and driver->set_ldisc 260 250 functions are called with the ldisc unavailable. Thus tty_ldisc_ref will 261 251 fail in this situation if used within these functions. Ldisc and driver 262 - code calling its own functions must be careful in this case. 252 + code calling its own functions must be careful in this case. 263 253 264 254 265 255 Driver Interface 266 256 ---------------- 267 257 268 - open() - Called when a device is opened. May sleep 258 + ======================= ======================================================= 259 + open() Called when a device is opened. May sleep 269 260 270 - close() - Called when a device is closed. At the point of 271 - return from this call the driver must make no 261 + close() Called when a device is closed. At the point of 262 + return from this call the driver must make no 272 263 further ldisc calls of any kind. May sleep 273 264 274 - write() - Called to write bytes to the device. May not 275 - sleep. May occur in parallel in special cases. 265 + write() Called to write bytes to the device. May not 266 + sleep. May occur in parallel in special cases. 276 267 Because this includes panic paths drivers generally 277 268 shouldn't try and do clever locking here. 278 269 279 - put_char() - Stuff a single character onto the queue. The 270 + put_char() Stuff a single character onto the queue. The 280 271 driver is guaranteed following up calls to 281 272 flush_chars. 282 273 283 - flush_chars() - Ask the kernel to write put_char queue 274 + flush_chars() Ask the kernel to write put_char queue 284 275 285 - write_room() - Return the number of characters that can be stuffed 276 + write_room() Return the number of characters that can be stuffed 286 277 into the port buffers without overflow (or less). 287 278 The ldisc is responsible for being intelligent 288 - about multi-threading of write_room/write calls 279 + about multi-threading of write_room/write calls 289 280 290 - ioctl() - Called when an ioctl may be for the driver 281 + ioctl() Called when an ioctl may be for the driver 291 282 292 - set_termios() - Called on termios change, serialized against 283 + set_termios() Called on termios change, serialized against 293 284 itself by a semaphore. May sleep. 294 285 295 - set_ldisc() - Notifier for discipline change. At the point this 286 + set_ldisc() Notifier for discipline change. At the point this 296 287 is done the discipline is not yet usable. Can now 297 288 sleep (I think) 298 289 299 - throttle() - Called by the ldisc to ask the driver to do flow 290 + throttle() Called by the ldisc to ask the driver to do flow 300 291 control. Serialization including with unthrottle 301 292 is the job of the ldisc layer. 302 293 303 - unthrottle() - Called by the ldisc to ask the driver to stop flow 294 + unthrottle() Called by the ldisc to ask the driver to stop flow 304 295 control. 305 296 306 - stop() - Ldisc notifier to the driver to stop output. As with 297 + stop() Ldisc notifier to the driver to stop output. As with 307 298 throttle the serializations with start() are down 308 299 to the ldisc layer. 309 300 310 - start() - Ldisc notifier to the driver to start output. 301 + start() Ldisc notifier to the driver to start output. 311 302 312 - hangup() - Ask the tty driver to cause a hangup initiated 303 + hangup() Ask the tty driver to cause a hangup initiated 313 304 from the host side. [Can sleep ??] 314 305 315 - break_ctl() - Send RS232 break. Can sleep. Can get called in 306 + break_ctl() Send RS232 break. Can sleep. Can get called in 316 307 parallel, driver must serialize (for now), and 317 308 with write calls. 318 309 319 - wait_until_sent() - Wait for characters to exit the hardware queue 310 + wait_until_sent() Wait for characters to exit the hardware queue 320 311 of the driver. Can sleep 321 312 322 - send_xchar() - Send XON/XOFF and if possible jump the queue with 313 + send_xchar() Send XON/XOFF and if possible jump the queue with 323 314 it in order to get fast flow control responses. 324 315 Cannot sleep ?? 325 - 316 + ======================= =======================================================
+2 -2
MAINTAINERS
··· 10433 10433 MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD 10434 10434 M: Jiri Slaby <jirislaby@gmail.com> 10435 10435 S: Maintained 10436 - F: Documentation/serial/moxa-smartio 10436 + F: Documentation/serial/moxa-smartio.rst 10437 10437 F: drivers/tty/mxser.* 10438 10438 10439 10439 MR800 AVERMEDIA USB FM RADIO DRIVER ··· 13317 13317 P: Comtrol Corp. 13318 13318 W: http://www.comtrol.com 13319 13319 S: Maintained 13320 - F: Documentation/serial/rocket.txt 13320 + F: Documentation/serial/rocket.rst 13321 13321 F: drivers/tty/rocket* 13322 13322 13323 13323 ROCKETPORT EXPRESS/INFINITY DRIVER
+2 -2
drivers/tty/Kconfig
··· 175 175 This driver supports Comtrol RocketPort and RocketModem PCI boards. 176 176 These boards provide 2, 4, 8, 16, or 32 high-speed serial ports or 177 177 modems. For information about the RocketPort/RocketModem boards 178 - and this driver read <file:Documentation/serial/rocket.txt>. 178 + and this driver read <file:Documentation/serial/rocket.rst>. 179 179 180 180 To compile this driver as a module, choose M here: the 181 181 module will be called rocket. ··· 193 193 your Linux box, for instance in order to become a dial-in server. 194 194 195 195 For information about the Cyclades-Z card, read 196 - <file:Documentation/serial/README.cycladesZ>. 196 + <file:Documentation/serial/cyclades_z.rst>. 197 197 198 198 To compile this driver as a module, choose M here: the 199 199 module will be called cyclades.
+1 -1
drivers/tty/serial/ucc_uart.c
··· 1081 1081 } 1082 1082 /* UART operations 1083 1083 * 1084 - * Details on these functions can be found in Documentation/serial/driver 1084 + * Details on these functions can be found in Documentation/serial/driver.rst 1085 1085 */ 1086 1086 static const struct uart_ops qe_uart_pops = { 1087 1087 .tx_empty = qe_uart_tx_empty,
+1 -1
include/linux/serial_core.h
··· 45 45 46 46 /* 47 47 * This structure describes all the operations that can be done on the 48 - * physical hardware. See Documentation/serial/driver for details. 48 + * physical hardware. See Documentation/serial/driver.rst for details. 49 49 */ 50 50 struct uart_ops { 51 51 unsigned int (*tx_empty)(struct uart_port *);