diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 18:34:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 18:34:40 -0500 |
commit | 0f4974c439dd7826c85bae4e6a8088ce2db0f498 (patch) | |
tree | fdabc7d9bb7d7bc49aad547c0aac3a633ce01f09 /Documentation | |
parent | 3126c136bc30225d7a43af741778aa50e95e467a (diff) | |
parent | 36ba782e9674cdc29ec7003757df0b375e99fa96 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (58 commits)
tty: split the lock up a bit further
tty: Move the leader test in disassociate
tty: Push the bkl down a bit in the hangup code
tty: Push the lock down further into the ldisc code
tty: push the BKL down into the handlers a bit
tty: moxa: split open lock
tty: moxa: Kill the use of lock_kernel
tty: moxa: Fix modem op locking
tty: moxa: Kill off the throttle method
tty: moxa: Locking clean up
tty: moxa: rework the locking a bit
tty: moxa: Use more tty_port ops
tty: isicom: fix deadlock on shutdown
tty: mxser: Use the new locking rules to fix setserial properly
tty: mxser: use the tty_port_open method
tty: isicom: sort out the board init logic
tty: isicom: switch to the new tty_port_open helper
tty: tty_port: Add a kref object to the tty port
tty: istallion: tty port open/close methods
tty: stallion: Convert to the tty_port_open/close methods
...
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/serial/hayes-esp.txt | 154 | ||||
-rw-r--r-- | Documentation/serial/tty.txt | 9 |
2 files changed, 7 insertions, 156 deletions
diff --git a/Documentation/serial/hayes-esp.txt b/Documentation/serial/hayes-esp.txt deleted file mode 100644 index 09b5d5856758..000000000000 --- a/Documentation/serial/hayes-esp.txt +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
1 | HAYES ESP DRIVER VERSION 2.1 | ||
2 | |||
3 | A big thanks to the people at Hayes, especially Alan Adamson. Their support | ||
4 | has enabled me to provide enhancements to the driver. | ||
5 | |||
6 | Please report your experiences with this driver to me (arobinso@nyx.net). I | ||
7 | am looking for both positive and negative feedback. | ||
8 | |||
9 | *** IMPORTANT CHANGES FOR 2.1 *** | ||
10 | Support for PIO mode. Five situations will cause PIO mode to be used: | ||
11 | 1) A multiport card is detected. PIO mode will always be used. (8 port cards | ||
12 | do not support DMA). | ||
13 | 2) The DMA channel is set to an invalid value (anything other than 1 or 3). | ||
14 | 3) The DMA buffer/channel could not be allocated. The port will revert to PIO | ||
15 | mode until it is reopened. | ||
16 | 4) Less than a specified number of bytes need to be transferred to/from the | ||
17 | FIFOs. PIO mode will be used for that transfer only. | ||
18 | 5) A port needs to do a DMA transfer and another port is already using the | ||
19 | DMA channel. PIO mode will be used for that transfer only. | ||
20 | |||
21 | Since the Hayes ESP seems to conflict with other cards (notably sound cards) | ||
22 | when using DMA, DMA is turned off by default. To use DMA, it must be turned | ||
23 | on explicitly, either with the "dma=" option described below or with | ||
24 | setserial. A multiport card can be forced into DMA mode by using setserial; | ||
25 | however, most multiport cards don't support DMA. | ||
26 | |||
27 | The latest version of setserial allows the enhanced configuration of the ESP | ||
28 | card to be viewed and modified. | ||
29 | *** | ||
30 | |||
31 | This package contains the files needed to compile a module to support the Hayes | ||
32 | ESP card. The drivers are basically a modified version of the serial drivers. | ||
33 | |||
34 | Features: | ||
35 | |||
36 | - Uses the enhanced mode of the ESP card, allowing a wider range of | ||
37 | interrupts and features than compatibility mode | ||
38 | - Uses DMA and 16 bit PIO mode to transfer data to and from the ESP's FIFOs, | ||
39 | reducing CPU load | ||
40 | - Supports primary and secondary ports | ||
41 | |||
42 | |||
43 | If the driver is compiled as a module, the IRQs to use can be specified by | ||
44 | using the irq= option. The format is: | ||
45 | |||
46 | irq=[0x100],[0x140],[0x180],[0x200],[0x240],[0x280],[0x300],[0x380] | ||
47 | |||
48 | The address in brackets is the base address of the card. The IRQ of | ||
49 | nonexistent cards can be set to 0. If an IRQ of a card that does exist is set | ||
50 | to 0, the driver will attempt to guess at the correct IRQ. For example, to set | ||
51 | the IRQ of the card at address 0x300 to 12, the insmod command would be: | ||
52 | |||
53 | insmod esp irq=0,0,0,0,0,0,12,0 | ||
54 | |||
55 | The custom divisor can be set by using the divisor= option. The format is the | ||
56 | same as for the irq= option. Each divisor value is a series of hex digits, | ||
57 | with each digit representing the divisor to use for a corresponding port. The | ||
58 | divisor value is constructed RIGHT TO LEFT. Specifying a nonzero divisor value | ||
59 | will automatically set the spd_cust flag. To calculate the divisor to use for | ||
60 | a certain baud rate, divide the port's base baud (generally 921600) by the | ||
61 | desired rate. For example, to set the divisor of the primary port at 0x300 to | ||
62 | 4 and the divisor of the secondary port at 0x308 to 8, the insmod command would | ||
63 | be: | ||
64 | |||
65 | insmod esp divisor=0,0,0,0,0,0,0x84,0 | ||
66 | |||
67 | The dma= option can be used to set the DMA channel. The channel can be either | ||
68 | 1 or 3. Specifying any other value will force the driver to use PIO mode. | ||
69 | For example, to set the DMA channel to 3, the insmod command would be: | ||
70 | |||
71 | insmod esp dma=3 | ||
72 | |||
73 | The rx_trigger= and tx_trigger= options can be used to set the FIFO trigger | ||
74 | levels. They specify when the ESP card should send an interrupt. Larger | ||
75 | values will decrease the number of interrupts; however, a value too high may | ||
76 | result in data loss. Valid values are 1 through 1023, with 768 being the | ||
77 | default. For example, to set the receive trigger level to 512 bytes and the | ||
78 | transmit trigger level to 700 bytes, the insmod command would be: | ||
79 | |||
80 | insmod esp rx_trigger=512 tx_trigger=700 | ||
81 | |||
82 | The flow_off= and flow_on= options can be used to set the hardware flow off/ | ||
83 | flow on levels. The flow on level must be lower than the flow off level, and | ||
84 | the flow off level should be higher than rx_trigger. Valid values are 1 | ||
85 | through 1023, with 1016 being the default flow off level and 944 being the | ||
86 | default flow on level. For example, to set the flow off level to 1000 bytes | ||
87 | and the flow on level to 935 bytes, the insmod command would be: | ||
88 | |||
89 | insmod esp flow_off=1000 flow_on=935 | ||
90 | |||
91 | The rx_timeout= option can be used to set the receive timeout value. This | ||
92 | value indicates how long after receiving the last character that the ESP card | ||
93 | should wait before signalling an interrupt. Valid values are 0 though 255, | ||
94 | with 128 being the default. A value too high will increase latency, and a | ||
95 | value too low will cause unnecessary interrupts. For example, to set the | ||
96 | receive timeout to 255, the insmod command would be: | ||
97 | |||
98 | insmod esp rx_timeout=255 | ||
99 | |||
100 | The pio_threshold= option sets the threshold (in number of characters) for | ||
101 | using PIO mode instead of DMA mode. For example, if this value is 32, | ||
102 | transfers of 32 bytes or less will always use PIO mode. | ||
103 | |||
104 | insmod esp pio_threshold=32 | ||
105 | |||
106 | Multiple options can be listed on the insmod command line by separating each | ||
107 | option with a space. For example: | ||
108 | |||
109 | insmod esp dma=3 trigger=512 | ||
110 | |||
111 | The esp module can be automatically loaded when needed. To cause this to | ||
112 | happen, add the following lines to /etc/modprobe.conf (replacing the last line | ||
113 | with options for your configuration): | ||
114 | |||
115 | alias char-major-57 esp | ||
116 | alias char-major-58 esp | ||
117 | options esp irq=0,0,0,0,0,0,3,0 divisor=0,0,0,0,0,0,0x4,0 | ||
118 | |||
119 | You may also need to run 'depmod -a'. | ||
120 | |||
121 | Devices must be created manually. To create the devices, note the output from | ||
122 | the module after it is inserted. The output will appear in the location where | ||
123 | kernel messages usually appear (usually /var/adm/messages). Create two devices | ||
124 | for each 'tty' mentioned, one with major of 57 and the other with major of 58. | ||
125 | The minor number should be the same as the tty number reported. The commands | ||
126 | would be (replace ? with the tty number): | ||
127 | |||
128 | mknod /dev/ttyP? c 57 ? | ||
129 | mknod /dev/cup? c 58 ? | ||
130 | |||
131 | For example, if the following line appears: | ||
132 | |||
133 | Oct 24 18:17:23 techno kernel: ttyP8 at 0x0140 (irq = 3) is an ESP primary port | ||
134 | |||
135 | ...two devices should be created: | ||
136 | |||
137 | mknod /dev/ttyP8 c 57 8 | ||
138 | mknod /dev/cup8 c 58 8 | ||
139 | |||
140 | You may need to set the permissions on the devices: | ||
141 | |||
142 | chmod 666 /dev/ttyP* | ||
143 | chmod 666 /dev/cup* | ||
144 | |||
145 | The ESP module and the serial module should not conflict (they can be used at | ||
146 | the same time). After the ESP module has been loaded the ports on the ESP card | ||
147 | will no longer be accessible by the serial driver. | ||
148 | |||
149 | If I/O errors are experienced when accessing the port, check for IRQ and DMA | ||
150 | conflicts ('cat /proc/interrupts' and 'cat /proc/dma' for a list of IRQs and | ||
151 | DMAs currently in use). | ||
152 | |||
153 | Enjoy! | ||
154 | Andrew J. Robinson <arobinso@nyx.net> | ||
diff --git a/Documentation/serial/tty.txt b/Documentation/serial/tty.txt index 8e65c4498c52..5e5349a4fcd2 100644 --- a/Documentation/serial/tty.txt +++ b/Documentation/serial/tty.txt | |||
@@ -42,7 +42,8 @@ TTY side interfaces: | |||
42 | open() - Called when the line discipline is attached to | 42 | open() - Called when the line discipline is attached to |
43 | the terminal. No other call into the line | 43 | the terminal. No other call into the line |
44 | discipline for this tty will occur until it | 44 | discipline for this tty will occur until it |
45 | completes successfully. Can sleep. | 45 | completes successfully. Returning an error will |
46 | prevent the ldisc from being attached. Can sleep. | ||
46 | 47 | ||
47 | close() - This is called on a terminal when the line | 48 | close() - This is called on a terminal when the line |
48 | discipline is being unplugged. At the point of | 49 | discipline is being unplugged. At the point of |
@@ -52,7 +53,7 @@ close() - This is called on a terminal when the line | |||
52 | hangup() - Called when the tty line is hung up. | 53 | hangup() - Called when the tty line is hung up. |
53 | The line discipline should cease I/O to the tty. | 54 | The line discipline should cease I/O to the tty. |
54 | No further calls into the ldisc code will occur. | 55 | No further calls into the ldisc code will occur. |
55 | Can sleep. | 56 | The return value is ignored. Can sleep. |
56 | 57 | ||
57 | write() - A process is writing data through the line | 58 | write() - A process is writing data through the line |
58 | discipline. Multiple write calls are serialized | 59 | discipline. Multiple write calls are serialized |
@@ -83,6 +84,10 @@ ioctl() - Called when an ioctl is handed to the tty layer | |||
83 | that might be for the ldisc. Multiple ioctl calls | 84 | that might be for the ldisc. Multiple ioctl calls |
84 | may occur in parallel. May sleep. | 85 | may occur in parallel. May sleep. |
85 | 86 | ||
87 | compat_ioctl() - Called when a 32 bit ioctl is handed to the tty layer | ||
88 | that might be for the ldisc. Multiple ioctl calls | ||
89 | may occur in parallel. May sleep. | ||
90 | |||
86 | Driver Side Interfaces: | 91 | Driver Side Interfaces: |
87 | 92 | ||
88 | receive_buf() - Hand buffers of bytes from the driver to the ldisc | 93 | receive_buf() - Hand buffers of bytes from the driver to the ldisc |