/[linux-patches]/genpatches-2.6/tags/2.6.14-5/4900_speakup-20051028.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.14-5/4900_speakup-20051028.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 226 - (show annotations) (download)
Fri Dec 2 12:14:55 2005 UTC (12 years, 2 months ago) by dsd
File size: 380362 byte(s)
2.6.14-5 release
1 diff -urNpXdontdiff linux-2.6.14/arch/arm/Kconfig linux-dsd/arch/arm/Kconfig
2 --- linux-2.6.14/arch/arm/Kconfig 2005-10-28 12:35:25.000000000 +0100
3 +++ linux-dsd/arch/arm/Kconfig 2005-10-28 12:24:46.000000000 +0100
4 @@ -724,6 +724,7 @@ source "drivers/mfd/Kconfig"
5 source "drivers/media/Kconfig"
6
7 source "drivers/video/Kconfig"
8 +source "drivers/char/speakup/Kconfig"
9
10 source "sound/Kconfig"
11
12 diff -urNpXdontdiff linux-2.6.14/arch/mips/Kconfig linux-dsd/arch/mips/Kconfig
13 --- linux-2.6.14/arch/mips/Kconfig 2005-10-28 12:35:46.000000000 +0100
14 +++ linux-dsd/arch/mips/Kconfig 2005-10-28 12:24:46.000000000 +0100
15 @@ -931,6 +931,8 @@ config SIBYTE_STANDALONE
16 depends on SIBYTE_SB1xxx_SOC && !SIBYTE_CFE
17 default y
18
19 +source "drivers/char/speakup/Kconfig"
20 +
21 config SIBYTE_STANDALONE_RAM_SIZE
22 int "Memory size (in megabytes)"
23 depends on SIBYTE_STANDALONE
24 diff -urNpXdontdiff linux-2.6.14/Documentation/speakup/DefaultKeyAssignments linux-dsd/Documentation/speakup/DefaultKeyAssignments
25 --- linux-2.6.14/Documentation/speakup/DefaultKeyAssignments 1970-01-01 01:00:00.000000000 +0100
26 +++ linux-dsd/Documentation/speakup/DefaultKeyAssignments 2005-10-28 12:24:46.000000000 +0100
27 @@ -0,0 +1,46 @@
28 +This file is intended to give you an overview of the default keys used
29 +by speakup for it's review functions. You may change them to be
30 +anything you want but that will take some familiarity with key
31 +mapping.
32 +
33 +We have remapped the insert or zero key on the keypad to act as a
34 +shift key. Well, actually as an altgr key. So in the following list
35 +InsKeyPad-period means hold down the insert key like a shift key and
36 +hit the keypad period.
37 +
38 +KeyPad-8 Say current Line
39 +InsKeyPad-8 say from top of screen to reading cursor.
40 +KeyPad-7 Say Previous Line (UP one line)
41 +KeyPad-9 Say Next Line (down one line)
42 +KeyPad-5 Say Current Word
43 +InsKeyPad-5 Spell Current Word
44 +KeyPad-4 Say Previous Word (left one word)
45 +InsKeyPad-4 say from left edge of line to reading cursor.
46 +KeyPad-6 Say Next Word (right one word)
47 +InsKeyPad-6 Say from reading cursor to right edge of line.
48 +KeyPad-2 Say Current Letter
49 +InsKeyPad-2 say current letter phonetically
50 +KeyPad-1 Say Previous Character (left one letter)
51 +KeyPad-3 Say Next Character (right one letter)
52 +KeyPad-plus Say Entire Screen
53 +InsKeyPad-plus Say from reading cursor line to bottom of screen.
54 +KeyPad-Minus Park reading cursor (toggle)
55 +InsKeyPad-minus Say character hex and decimal value.
56 +KeyPad-period Say Position (current line, position and console)
57 +InsKeyPad-period say colour attributes of current position.
58 +InsKeyPad-9 Move reading cursor to top of screen (insert pgup)
59 +InsKeyPad-3 Move reading cursor to bottom of screen (insert pgdn)
60 +InsKeyPad-7 Move reading cursor to left edge of screen (insert home)
61 +InsKeyPad-1 Move reading cursor to right edge of screen (insert end)
62 +ControlKeyPad-1 Move reading cursor to last character on current line.
63 +KeyPad-Enter Shut Up (until another key is hit) and sync reading cursor
64 +InsKeyPad-Enter Shut Up (until toggled back on).
65 +InsKeyPad-star n<x|y> go to line (y) or column (x). Where 'n' is any
66 + allowed value for the row or column for your current screen.
67 +KeyPad-/ Mark and Cut screen region.
68 +InsKeyPad-/ Paste screen region into any console.
69 +
70 +Hitting any key while speakup is outputting speech will quiet the
71 +synth until it has caught up with what is being printed on the
72 +console.
73 +
74 diff -urNpXdontdiff linux-2.6.14/Documentation/speakup/INSTALLATION linux-dsd/Documentation/speakup/INSTALLATION
75 --- linux-2.6.14/Documentation/speakup/INSTALLATION 1970-01-01 01:00:00.000000000 +0100
76 +++ linux-dsd/Documentation/speakup/INSTALLATION 2005-10-28 12:24:46.000000000 +0100
77 @@ -0,0 +1,108 @@
78 +This document assumes you have had some experience with kernel
79 +compilation and installation. If you have not, I recommend you get
80 +the kernel source and read the README and various documents in the
81 +linux/Documentation directory. In particular the Changes file to make
82 +sure you have the appropriate utilities needed for installing a 2.2.xx
83 +or 2.4xx kernel. It isn't as difficult as you might think. The
84 +kernel README is intimidating the first time but once you get the
85 +steps down, it's really pretty easy. Getting through the "make
86 +config" is the tedious bit.
87 +
88 +The first thing to do is to place a copy of the tarball in the /usr/src
89 +directory which is the directory the linux tree is located in as well.
90 +Next untar speakup by typing:
91 +
92 +tar zxf speakup-1.00.tar.gz
93 +cd speakup-1.00
94 +./install
95 +
96 +Note the dot-slash before the install. This will copy the speakup
97 +directory to the kernel tree and apply the various patches and
98 +components to the appropriate kernel files. Depending on how
99 +experienced you are with kernel compiling and hacking will determine
100 +whether you should bother looking at any failed patches. If this
101 +happens, you should probably write to the speakup mailing list for
102 +help or myself.
103 +
104 +If all of the patch hunks apply successfully then just continue with
105 +the standard steps to compile the kernel with:
106 +
107 +make mrproper
108 +make config
109 +
110 +When you get to the section console speech output, answer 'y' to the
111 +CONFIG_SPEAKUP prompt. You will be given a submenu with the list of
112 +synthesizers which are currently supported. You can include as many
113 +synths in the kernel as you wish but remember each one takes up kernel
114 +space. You can only choose one of the synths as the default or none,
115 +so just type dtlk or whatever is the correct string for the
116 +synthesizer you have. You will also be asked if you wish to build-in
117 +a speakup key map. If you do not say 'y' to this option you will need
118 +to load a speakup map at boot time with whichever mechanism your
119 +distribution uses for loading key maps.
120 +
121 +We have placed the speakup configuration options in make config just
122 +after the vga console choice. For the DoubleTalk PC driver included
123 +by Jim Van Zandt. I recommend you say no to that option. I have not
124 +tried configuring them both in, but I wouldn't be at all surprised if
125 +it didn't work.
126 +
127 +If all goes well up to this point you can continue with the compiling
128 +process by doing:
129 +
130 +make dep >dep.file 2>&1 &
131 +make bzImage >cc.file 2>&1 &
132 +make modules >mod.file 2>&1 &
133 +
134 +I always redirect output to the files dep.file and cc.file so I can
135 +look over the compilation record to make sure there are no errors and
136 +warnings.
137 +
138 +Okay, you are ready to install the newly compiled kernel. Make sure
139 +you make an linux.old entry in your lilo.conf file so you can recover
140 +if it blows up. next as root run "make modules_install" to install
141 +whatever modules you compiled and move the bzImage from
142 +/usr/src/linux/arch/i386/boot to wherever your kernel lives. Also
143 +move the System.map from /usr/src/linux to where your System.map
144 +lives. On our systems we use debian so we create an vmlinuz-speakup
145 +and System.map-speakup in our /boot directory and set the symbolic
146 +links vmlinuz and System.map in the root (/) directory to point to the
147 +images. Now type lilo to tell lilo to build the new booter file and
148 +install it.
149 +
150 +As of version 0.07, the keymap for speakup is automatically built in
151 +at compile time. If you have other keymaps installed at boot time,
152 +you might want to consider removing them before you reboot the system.
153 +
154 +If everything has gone OK up until now, cross your fingers and type:
155 +
156 +shutdown -r now
157 +
158 +Your system should start talking to you as soon as it starts booting.
159 +It will talk and talk and ... well, you might want to hit the
160 +keypad-enter key to tell it to shut up. You should also read the
161 +DefaultKeyAssignments file to learn the various review functions
162 +available.
163 +
164 +As of v-0.10 the speakup configuration options are in the
165 +/proc/speakup subtree. The individual options should be fairly
166 +obvious by their names such as rate, volume, punc_level and so forth.
167 +You can manipulate them by cat'ing or echoing new values to them such
168 +as:
169 +
170 +echo 9 >/proc/speakup/rate
171 +
172 +You can see what the current values are by cat'ing those files to the console:
173 +
174 +cat /proc/speakup/rate
175 +
176 +I have probably managed to overlook a whole whack of things because
177 +this is the, enter version number here, draft. Don't worry we'll get
178 +it right eventually. If you like the package you really should get on
179 +the mailing list and start participating in it's development.
180 +
181 + Kirk
182 +
183 +email: kirk@braille.uwo.ca
184 +phone: (519) 679-6845 (home)
185 +
186 diff -urNpXdontdiff linux-2.6.14/Documentation/speakup/keymap-tutorial linux-dsd/Documentation/speakup/keymap-tutorial
187 --- linux-2.6.14/Documentation/speakup/keymap-tutorial 1970-01-01 01:00:00.000000000 +0100
188 +++ linux-dsd/Documentation/speakup/keymap-tutorial 2005-10-28 12:24:46.000000000 +0100
189 @@ -0,0 +1,140 @@
190 + Speakup Keymap Tutorial
191 +
192 +This is meant to be a basic tutorial on how to change the Linux keymap
193 +file to assign speakup review functions to desired keys. It is not
194 +intended to be a replacement for the loadkeys(8) or keymap(5) man
195 +pages.
196 +
197 +The basic lay-out of the keymap file is a series of lines with the
198 +following fields. The keyword keycode indicates this is the start of
199 +a new key assignment. It is then followed by a number which
200 +represents the actual key on the keyboard. That number is followed by
201 +the equals '=' operator and finally a list of keywords representing
202 +key names such as keypad5. Each line can have quite a few key
203 +functions on it. They are interpreted by loadkeys in order and
204 +assigned to key shift states depending on the order they are
205 +encountered. So for example, the first value after the equals is the
206 +keys unshifted state, while the second is the keys shifted state. If
207 +you wish to learn the order they are interpreted in read the
208 +loadkeys(8) and keymap(5) man pages.
209 +
210 +You can have subsequent lines which are indented and start with
211 +another keyword for the various shifted states. This way you can
212 +assign some of the states without having to specify them all in order
213 +up until you get to the one you want to assign.
214 +
215 +In speakup, we have assigned the insert key on the number pad to the
216 +altgr keyword. This is not required; you could choose any other
217 +shifted state keyword. We used altgr because it typically represents
218 +the right hand alt key. In Linux each shift key is separate and
219 +independent, so the left shift and the right shift keys are not
220 +necessarily the same. The altgr key is not really used for anything
221 +important, so we steel it.
222 +
223 +Here are the default key assignments for the number eight on the
224 +keypad:
225 +
226 +keycode 72 = KP_8
227 + alt keycode 72 = Ascii_8
228 +
229 +As you can see, the first line starts with keycode followed by 72
230 +which is the actual number assigned to the key when the keyboard port
231 +is read. The KP_8 after the equal sign, is the symbolic representation
232 +of the function called when that key is hit.
233 +
234 +The second line is the same format except it starts with the keyword
235 +alt which is indented. That means that the function at the end of
236 +that line Ascii_8 is applied to the alt-shifted eight key.
237 +
238 +Now here are the speakup assignments for that key:
239 +
240 +keycode 72 = 0x0d0a
241 + altgr keycode 72 = 0x0d20
242 +#keycode 72 = KP_8
243 + alt keycode 72 = Ascii_8
244 +
245 +Notice that the only thing which has changed on the first line is the
246 +function called when the key is struck. It is a hexadecimal number
247 +identifying the function called in a look up table. It is not a
248 +symbolic representation yet because that means we need to change the
249 +loadkeys program to understand our symbolic names. We will do this in
250 +the future but for now it is more expedient to just use the table
251 +indices. You will find a table at the bottom of this document
252 +listing the review functions and their corresponding hex lookups.
253 +
254 +The 0x0d0a in the first line above is speakup's say line function.
255 +The second line ends with 0x0d20 which is speakup's read from top of
256 +screen to reading cursor line.
257 +
258 +The third line is the original key assignment commented out with a
259 +number-sign '#' at the beginning. I do that so I can easily find the
260 +keys I want to affect by symbolic name. Otherwise I would need to
261 +keep a look up table for all the keycodes. I recommend you do this as
262 +well or you'll be very sorry at some point in the future.
263 +
264 +The forth line is just the standard key assignment for the left hand
265 +alt key.
266 +
267 +Now let's say we want to design a different keyboard layout. I'll use
268 +an example for the JAWS style keypad because I've specifically been
269 +asked to help with that. JAWS uses the eight on the keypad to move up
270 +a line or the speakup function to read previous line. JAWS also uses
271 +the keypad_8 key in a shifted mode to read the current line. I
272 +apologize if these are not quite right. It has been a long time since
273 +I used JAWS. So we would have the following two lines:
274 +
275 +keycode 72 = 0x0d0b
276 + altgr keycode 72 = 0x0d0a
277 +
278 +The hex value 0x0d0b in the first line is speakup's SAY_PREVIOUS_LINE
279 +function. The 0x0d0a in the second line is the same say_line function
280 +as we had earlier. So when the number eight is hit on the keypad
281 +speakup will read the previous line and when the number eight is
282 +shifted with the insert key on the keypad it will read the current
283 +line.
284 +
285 +As you can tell, it is not really very difficult to reassign the keys
286 +to different review functions.
287 +
288 +Once you have carefully edited the keymap file, called default.map in
289 +the speakup distribution, you copy it into the /etc/kbd directory.
290 +Make sure you back up the original default.map from that directory
291 +first, if there is one. Then you run loadkeys to load the new map
292 +into the kernel:
293 +
294 +loadkeys /etc/kbd/default.map
295 +
296 +If you wish to build your new keyboard lay-out into the kernel, after
297 +testing it, copy the default.map file into the drivers/char directory,
298 +with the name defkeymap.map, of your Linux source tree. Then rm the
299 +defkeymap.c file and recompile the kernel. Because there is no
300 +defkeymap.c `make' will rebuild it on the next compile.
301 +
302 +Here is a list of the available speakup review functions at this point
303 +in time.
304 +
305 +SAY_CHAR 0x0d04 /* say this character */
306 +SAY_PREV_CHAR 0x0d05 /* say character left of this char */
307 +SAY_NEXT_CHAR 0x0d06 /* say char right of this char */
308 +SAY_WORD 0x0d07 /* say this word under reading cursor */
309 +SAY_PREV_WORD 0x0d08
310 +SAY_NEXT_WORD 0x0d09
311 +SAY_LINE 0x0d0a /* say this line */
312 +SAY_PREV_LINE 0x0d0b /* say line above this line */
313 +SAY_NEXT_LINE 0x0d0c
314 +TOP_EDGE 0x0d0d /* move to top edge of screen */
315 +BOTTOM_EDGE 0x0d0e
316 +LEFT_EDGE 0x0d0f
317 +RIGHT_EDGE 0x0d10
318 +SAY_PHONETIC_CHAR 0x0d11 /* say this character phonetically */
319 +SPELL_WORD 0x0d12 /* spell this word letter by letter */
320 +SAY_SCREEN 0x0d14
321 +SAY_POSITION 0x0d1b
322 +SPEECH_OFF 0x0d1c
323 +SAY_ATTRIBUTES 0x0d1d
324 +SPEAKUP_PARKED 0x0d1e
325 +SAY_FROM_TOP 0x0d20
326 +SAY_TO_BOTTOM 0x0d21
327 +SAY_FROM_LEFT 0x0d22
328 +SAY_TO_RIGHT 0x0d23
329 +
330 diff -urNpXdontdiff linux-2.6.14/Documentation/speakup/README linux-dsd/Documentation/speakup/README
331 --- linux-2.6.14/Documentation/speakup/README 1970-01-01 01:00:00.000000000 +0100
332 +++ linux-dsd/Documentation/speakup/README 2005-10-28 12:24:46.000000000 +0100
333 @@ -0,0 +1,98 @@
334 +Welcome to the speakup project for the Speakup speech package for Linux.
335 +
336 +Speakup is written by Kirk Reiser and Andy Berdan. It is licensed
337 +under the GPL. If you don't already know, the GPL stands for the GNU
338 +General Public License. Which basically states that this code is free to
339 +copy, modify and distribute to anyone interested in playing with it.
340 +The one thing you may not do is turn any part of it into proprietary
341 +or commercial code without the permission of the author. That's me.
342 +
343 +If you are interested in being involved with the development of speech
344 +output for Linux you can subscribe to the Speakup mailing list by
345 +sending a message to speakup-request@braille.uwo.ca with the line: subscribe. You can also subscribe by going to the speakup web page and following the links at http://www.linux-speakup.org.
346 +
347 +We are at a very early stage in the development of this package.
348 +Hopefully changes will happen often and many. The current files in
349 +this directory are:
350 +
351 +DefaultKeyAssignments # speakup's default review keys
352 +INSTALLATION # for installing speakup from the tar ball.
353 +README # this file
354 +keymap-tutorial # a tutorial on how to layout the keyboard
355 +
356 +Read the INSTALLATION file to learn how to apply the patches and the
357 +default.map for the keyboard. You should also read the Changes file.
358 +It really has any new things I've added since last time.
359 +
360 +There is no documentation in any of these files to instruct you what
361 +to do if something goes wrong with the patching or compilation. If
362 +you would like that information you will need to subscribe to the
363 +mailing list and ask for help, or write me kirk@braille.uwo.ca for
364 +help. I suggest the mailing list because I will probably tire quickly
365 +of answering the same questions over and over. You could always
366 +decide to dig-in and take on the task, and write documentation to help
367 +others.
368 +
369 +There also is a speakup reflector for the Speak Freely package, which
370 +many of us hang out on and discuss all sorts of topics from speakup
371 +problems to ALSA driver installation and just about anything else
372 +you'd like to talk about. The reflector is at lwl.braille.uwo.ca:4074
373 +with it's lwl page at lwl.braille.uwo.ca/speakup.html. Come and join
374 +us, it's fun!
375 +
376 +Acknowledgements:
377 +
378 +I am really very new at kernel hacking and screen review package
379 +writing, so I have depended heavily on other folks kindness to help me
380 +a long. No doubt I will continue to abuse them freely and others
381 +before this is a really good speech solution for Linux. (Oh Well!,
382 +somebody's got to do it.)
383 +
384 +Theodore Ts'o. He gave me a good discussion of unicode and UTF and
385 +the like. He doesn't even remember writing me about it.
386 +
387 +Alan Cox. He has answered many questions about scheduling and wait
388 +queues and timers along with code fragments and so on. I just wish I
389 +understood it all totally. He has also helped immensely in moving
390 +this package toward inclusion in the standard kernel tree. (Maybe next
391 +release!)
392 +
393 +Martin Mares. He pointed me in the right direction to figuring out
394 +the colour attributes and other useful tidbits.
395 +
396 +Paul McDermott. He really is the catalyst for me to actually get
397 +this all working. Besides I like seeing him bounce around and get all
398 +excited every time I have something new working.
399 +
400 +John Covici, He was the first person to actually attempt writing
401 +another synthesizer driver for speakup. It was the Speakout driver so
402 +it was also the first serial driver.
403 +
404 +Brian Borowski, he was the first person to actually write a speakup
405 +function other than Andy and I.
406 +
407 +Jim Danley, he has more or less become my main man in helping test
408 +code, add new features, bounce ideas off and generally become a good
409 +friend.
410 +
411 +Matt Campbell, he basically rewrote the drivers to be able to include
412 +all synths in the kernel at the same time. The distribution
413 +maintainers appreciate him a lot as well.
414 +
415 +Gene Collins, he was very helpful debugging the current release prior
416 +to its public showing. He has also worked hard educating others on
417 +the list and writing the ALSA mini howto.
418 +
419 +I would also like to really thank the folks that handle the
420 +distribution packages. I and many other people would not find access
421 +to speakup nearly so convenient without their efforts. They include
422 +Bill Acker, Tom Moore, Matt Campbell, Joe Norton and Joshua Lambert.
423 +
424 +There are probably many more I am forgetting right now. I guess I'll
425 +just have to add you all later.
426 +
427 +
428 +Happy Hacking!
429 +
430 + Kirk
431 +
432 diff -urNpXdontdiff linux-2.6.14/Documentation/speakup/spkguide.txt linux-dsd/Documentation/speakup/spkguide.txt
433 --- linux-2.6.14/Documentation/speakup/spkguide.txt 1970-01-01 01:00:00.000000000 +0100
434 +++ linux-dsd/Documentation/speakup/spkguide.txt 2005-10-28 12:24:46.000000000 +0100
435 @@ -0,0 +1,1279 @@
436 +
437 +The Speakup User's Guide
438 +For Speakup 2.0 and Later
439 +By Gene Collins
440 +Last modified on Tue Mar 29 10:54:19 2005
441 +Document version 1.0
442 +
443 +Copyright (c) 2005 Gene Collins
444 +
445 +Permission is granted to copy, distribute and/or modify this document
446 +under the terms of the GNU Free Documentation License, Version 1.2 or
447 +any later version published by the Free Software Foundation; with no
448 +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
449 +copy of the license is included in the section entitled "GNU Free
450 +Documentation License".
451 +
452 +Preface
453 +
454 +The purpose of this document is to familiarize users with the user
455 +interface to Speakup, a Linux Screen Reader. If you need instructions
456 +for installing or obtaining Speakup, visit the web site at
457 +http://linux-speakup.org/. Speakup is a set of patches to the standard
458 +Linux kernel source tree. It can be built as a series of modules, or as
459 +a part of a monolithic kernel. These details are beyond the scope of
460 +this manual, but the user may need to be aware of the module
461 +capabilities, depending on how your system administrator has installed
462 +Speakup. If Speakup is built as a part of a monolithic kernel, and the
463 +user is using a hardware synthesizer, then Speakup will be able to
464 +provide speech access from the time the kernel is loaded, until the time
465 +the system is shutdown. This means that if you have obtained Linux
466 +installation media for a distribution which includes Speakup as a part
467 +of its kernel, you will be able, as a blind person, to install Linux
468 +with speech access unaided by a sighted person. Again, these details
469 +are beyond the scope of this manual, but the user should be aware of
470 +them. See the web site mentioned above for further details.
471 +
472 +1. Starting Speakup
473 +
474 +If your system administrator has installed Speakup to work with your
475 +specific synthesizer by default, then all you need to do to use Speakup
476 +is to boot your system, and Speakup should come up talking. This
477 +assumes of course that your synthesizer is a supported hardware
478 +synthesizer, and that it is either installed in or connected to your
479 +system, and is if necessary powered on.
480 +
481 +It is possible, however, that Speakup may have been compiled into the
482 +kernel with no default synthesizer. It is even possible that your
483 +kernel has been compiled with support for some of the supported
484 +synthesizers and not others. If you find that this is the case, and
485 +your synthesizer is supported but not available, complain to the person
486 +who compiled and installed your kernel. Or better yet, go to the web
487 +site, and learn how to patch Speakup into your own kernel source, and
488 +build and install your own kernel.
489 +
490 +If your kernel has been compiled with Speakup, and has no default
491 +synthesizer set, or you would like to use a different synthesizer than
492 +the default one, then you may issue the following command at the boot
493 +prompt of your boot loader.
494 +
495 +linux speakup_synth=ltlk
496 +
497 +This command would tell Speakup to look for and use a LiteTalk or
498 +DoubleTalk LT at boot up. You may replace the ltlk synthesizer keyword
499 +with the keyword for whatever synthesizer you wish to use. The
500 +speakup_synth parameter will accept the following keywords, provided
501 +that support for the related synthesizers has been built into the
502 +kernel.
503 +
504 +acntsa -- Accent SA
505 +acntpc -- Accent PC
506 +apolo -- Apolo
507 +audptr -- Audapter
508 +bns -- Braille 'n Speak
509 +dectlk -- DecTalk Express (old and new, db9 serial only)
510 +decext -- DecTalk (old) External
511 +dtlk -- DoubleTalk PC
512 +keypc -- Keynote Gold PC
513 +ltlk -- DoubleTalk LT, LiteTalk, or external Tripletalk (db9 serial only)
514 +spkout -- Speak Out
515 +txprt -- Transport
516 +
517 +Note: Speakup does * NOT * support usb connections! Speakup also does *
518 +NOT * support the internal Tripletalk!
519 +
520 +Speakup does support two other synthesizers, but because they work in
521 +conjunction with other software, they must be loaded as modules after
522 +their related software is loaded, and so are not available at boot up.
523 +These are as follows:
524 +
525 +decpc -- DecTalk PC (not available at boot up)
526 +sftsyn -- One of several software synthesizers (not available at boot up)
527 +
528 +See the sections on loading modules and software synthesizers later in
529 +this manual for further details. It should be noted here that the
530 +speakup_synth boot parameter will have no effect if Speakup has been
531 +compiled as modules. In order for Speakup modules to be loaded during
532 +the boot process, such action must be configured by your system
533 +administrator. This will mean that you will hear some, but not all, of
534 +the bootup messages.
535 +
536 +2. Basic operation
537 +
538 +Once you have booted the system, and if necessary, have supplied the
539 +proper bootup parameter for your synthesizer, Speakup will begin
540 +talking as soon as the kernel is loaded. In fact, it will talk a lot!
541 +It will speak all the boot up messages that the kernel prints on the
542 +screen during the boot process. This is because Speakup is not a
543 +separate screen reader, but is actually built into the operating
544 +system. Since almost all console applications must print text on the
545 +screen using the kernel, and must get their keyboard input through the
546 +kernel, they are automatically handled properly by Speakup. There are a
547 +few exceptions, but we'll come to those later.
548 +
549 +Note: In this guide I will refer to the numeric keypad as the keypad.
550 +This is done because the speakupmap.map file referred to later in this
551 +manual uses the term keypad instead of numeric keypad. Also I'm lazy
552 +and would rather only type one word. So keypad it is. Got it? Good.
553 +
554 +Most of the Speakup review keys are located on the keypad at the far
555 +right of the keyboard. The numlock key should be off, in order for these
556 +to work. If you toggle the numlock on, the keypad will produce numbers,
557 +which is exactly what you want for spreadsheets and such. For the
558 +purposes of this guide, you should have the numlock turned off, which is
559 +its default state at bootup.
560 +
561 +You probably won't want to listen to all the bootup messages every time
562 +you start your system, though it's a good idea to listen to them at
563 +least once, just so you'll know what kind of information is available to
564 +you during the boot process. You can always review these messages after
565 +bootup with the command:
566 +
567 +dmesg | more
568 +
569 +In order to speed the boot process, and to silence the speaking of the
570 +bootup messages, just press the keypad enter key. This key is located
571 +in the bottom right corner of the keypad. Speakup will shut up and stay
572 +that way, until you press another key.
573 +
574 +You can check to see if the boot process has completed by pressing the 8
575 +key on the keypad, which reads the current line. This also has the
576 +effect of starting Speakup talking again, so you can press keypad enter
577 +to silence it again if the boot process has not completed.
578 +
579 +When the boot process is complete, you will arrive at a "login" prompt.
580 +At this point, you'll need to type in your user id and password, as
581 +provided by your system administrator. You will hear Speakup speak the
582 +letters of your user id as you type it, but not the password. This is
583 +because the password is not displayed on the screen for security
584 +reasons. This has nothing to do with Speakup, it's a Linux security
585 +feature.
586 +
587 +Once you've logged in, you can run any Linux command or program which is
588 +allowed by your user id. Normal users will not be able to run programs
589 +which require root privileges.
590 +
591 +When you are running a program or command, Speakup will automatically
592 +speak new text as it arrives on the screen. You can at any time silence
593 +the speech with keypad enter, or use any of the Speakup review keys.
594 +
595 +Here are some basic Speakup review keys, and a short description of what
596 +they do.
597 +
598 +keypad 1 -- read previous character
599 +keypad 2 -- read current character (pressing keypad 2 twice rapidly will speak
600 + the current character phonetically)
601 +keypad 3 -- read next character
602 +keypad 4 -- read previous word
603 +keypad 5 -- read current word (press twice rapidly to spell the current word)
604 +keypad 6 -- read next word
605 +keypad 7 -- read previous line
606 +keypad 8 -- read current line (press twice rapidly to hear how much the
607 + text on the current line is indented)
608 +keypad 9 -- read next line
609 +keypad period -- speak current cursor position and announce current
610 + virtual console
611 +
612 +It's also worth noting that the insert key on the keypad is mapped
613 +as the speakup key. Instead of pressing and releasing this key, as you
614 +do under DOS or Windows, you hold it like a shift key, and press other
615 +keys in combination with it. For example, repeatedly holding keypad
616 +insert, from now on called speakup, and keypad enter will toggle the
617 +speaking of new text on the screen on and off. This is not the same as
618 +just pressing keypad enter by itself, which just silences the speech
619 +until you hit another key. When you hit speakup plus keypad enter,
620 +Speakup will say, "You turned me off.", or "Hey, that's better." When
621 +Speakup is turned off, no new text on the screen will be spoken. You
622 +can still use the reading controls to review the screen however.
623 +
624 +3. Using the Speakup Help System
625 +
626 +Speakup has a help system, which is compiled as a module. It is loaded
627 +automatically whenever the Speakup help system is invoked for the first
628 +time, and remains loaded after that, until speakup is unloaded. Note
629 +that if speakup was compiled into a monolithic kernel on your system,
630 +you will not be able to unload Speakup from your kernel. If you try to
631 +use the help system, and find that it is unavailable, then your system
632 +administrator has not installed the Speakup help module, which is called
633 +speakup_help. Complain to your system administrator about this.
634 +
635 +In order to enter the Speakup help system, press and hold the speakup
636 +key (remember that this is the keypad insert key), and press the f1 key.
637 +You will hear the message:
638 +
639 +"Press space to leave help, cursor up or down to scroll, or a letter to
640 +go to commands in list."
641 +
642 +When you press the spacebar to leave the help system, you will hear:
643 +
644 +"Leaving help."
645 +
646 +While you are in the Speakup help system, you can scroll up or down
647 +through the list of available commands using the cursor keys. The list
648 +of commands is arranged in alphabetical order. If you wish to jump to
649 +commands in a specific part of the alphabet, you may press the letter of
650 +the alphabet you wish to jump to.
651 +
652 +You can also just explore by typing keyboard keys. Pressing keys will
653 +cause Speakup to speak the command associated with that key. For
654 +example, if you press the keypad 8 key, you will hear:
655 +
656 +"Keypad 8 is line, say current."
657 +
658 +You'll notice that some commands do not have keys assigned to them.
659 +This is because they are very infrequently used commands, and are also
660 +accessible through the proc system. We'll discuss the proc system later
661 +in this manual.
662 +
663 +You'll also notice that some commands have two keys assigned to them.
664 +This is because Speakup has a built in set of alternative key bindings
665 +for laptop users. The alternate speakup key is the caps lock key. You
666 +can press and hold the caps lock key, while pressing an alternate
667 +speakup command key to activate the command. On most laptops, the
668 +numeric keypad is defined as the keys in the j k l area of the keyboard.
669 +
670 +There is usually a function key which turns this keypad function on and
671 +off, and some other key which controls the numlock state. Toggling the
672 +keypad functionality on and off can become a royal pain. So, Speakup
673 +gives you a simple way to get at an alternative set of key mappings for
674 +your laptop. These are also available by default on desktop systems,
675 +because Speakup does not know whether it is running on a desktop or
676 +laptop. So you may choose which set of Speakup keys to use. Some
677 +system administrators may have chosen to compile Speakup for a desktop
678 +system without this set of alternate key bindings, but these details are
679 +beyond the scope of this manual. To use the caps lock for its normal
680 +purpose, hold the shift key while toggling the caps lock on and off. We
681 +should note here, that holding the caps lock key and pressing the z key
682 +will toggle the alternate j k l keypad on and off.
683 +
684 +4. Keys and Their Assigned Commands
685 +
686 +In this section, we'll go through a list of all the speakup keys and
687 +commands. You can also get a list of commands and assigned keys from
688 +the help system.
689 +
690 +The following list was taken from the speakupmap.map file. Key
691 +assignments are on the left of the equal sign, and the associated
692 +Speakup commands are on the right. The designation "spk" means to press
693 +and hold the speakup key, a.k.a. keypad insert, a.k.a. caps lock, while
694 +pressing the other specified key.
695 +
696 +spk key_f9 = punc_level_dec
697 +spk key_f10 = punc_level_inc
698 +spk key_f11 = reading_punc_dec
699 +spk key_f12 = reading_punc_inc
700 +spk key_1 = vol_dec
701 +spk key_2 = vol_inc
702 +spk key_3 = pitch_dec
703 +spk key_4 = pitch_inc
704 +spk key_5 = rate_dec
705 +spk key_6 = rate_inc
706 +key_kpasterisk = toggle_cursoring
707 +spk key_kpasterisk = speakup_goto
708 +spk key_f1 = speakup_help
709 +spk key_f2 = set_win
710 +spk key_f3 = clear_win
711 +spk key_f4 = enable_win
712 +spk key_f5 = edit_some
713 +spk key_f6 = edit_most
714 +spk key_f7 = edit_delim
715 +spk key_f8 = edit_repeat
716 +shift spk key_f9 = edit_exnum
717 + key_kp7 = say_prev_line
718 +spk key_kp7 = left_edge
719 + key_kp8 = say_line
720 +double key_kp8 = say_line_indent
721 +spk key_kp8 = say_from_top
722 + key_kp9 = say_next_line
723 +spk key_kp9 = top_edge
724 + key_kpminus = speakup_parked
725 +spk key_kpminus = say_char_num
726 + key_kp4 = say_prev_word
727 +spk key_kp4 = say_from_left
728 + key_kp5 = say_word
729 +double key_kp5 = spell_word
730 +spk key_kp5 = spell_phonetic
731 + key_kp6 = say_next_word
732 +spk key_kp6 = say_to_right
733 + key_kpplus = say_screen
734 +spk key_kpplus = say_win
735 + key_kp1 = say_prev_char
736 +spk key_kp1 = right_edge
737 + key_kp2 = say_char
738 +spk key_kp2 = say_to_bottom
739 +double key_kp2 = say_phonetic_char
740 + key_kp3 = say_next_char
741 +spk key_kp3 = bottom_edge
742 + key_kp0 = spk_key
743 + key_kpdot = say_position
744 +spk key_kpdot = say_attributes
745 +key_kpenter = speakup_quiet
746 +spk key_kpenter = speakup_off
747 +key_sysrq = speech_kill
748 + key_kpslash = speakup_cut
749 +spk key_kpslash = speakup_paste
750 +spk key_pageup = say_first_char
751 +spk key_pagedown = say_last_char
752 +key_capslock = spk_key
753 + spk key_z = spk_lock
754 +key_leftmeta = spk_key
755 +ctrl spk key_0 = speakup_goto
756 +spk key_u = say_prev_line
757 +spk key_i = say_line
758 +double spk key_i = say_line_indent
759 +spk key_o = say_next_line
760 +spk key_minus = speakup_parked
761 +shift spk key_minus = say_char_num
762 +spk key_j = say_prev_word
763 +spk key_k = say_word
764 +double spk key_k = spell_word
765 +spk key_l = say_next_word
766 +spk key_m = say_prev_char
767 +spk key_comma = say_char
768 +double spk key_comma = say_phonetic_char
769 +spk key_dot = say_next_char
770 +spk key_n = say_position
771 + ctrl spk key_m = left_edge
772 + ctrl spk key_y = top_edge
773 + ctrl spk key_dot = right_edge
774 +ctrl spk key_p = bottom_edge
775 +spk key_apostrophe = say_screen
776 +spk key_h = say_from_left
777 +spk key_y = say_from_top
778 +spk key_semicolon = say_to_right
779 +spk key_p = say_to_bottom
780 +spk key_slash = say_attributes
781 + spk key_enter = speakup_quiet
782 + ctrl spk key_enter = speakup_off
783 + spk key_9 = speakup_cut
784 +spk key_8 = speakup_paste
785 +shift spk key_m = say_first_char
786 + ctrl spk key_semicolon = say_last_char
787 +
788 +5. The Speakup Proc System
789 +
790 +The Speakup screen reader also creates a speakup subdirectory as a part
791 +of the proc system. You can see these entries by typing the command:
792 +
793 +ls -1 /proc/speakup/*
794 +
795 +If you issue the above ls command, you will get back something like
796 +this:
797 +
798 +/proc/speakup/attrib_bleep
799 +/proc/speakup/bell_pos
800 +/proc/speakup/bleep_time
801 +/proc/speakup/bleeps
802 +/proc/speakup/caps_start
803 +/proc/speakup/caps_stop
804 +/proc/speakup/characters
805 +/proc/speakup/cursor_time
806 +/proc/speakup/delay_time
807 +/proc/speakup/delimiters
808 +/proc/speakup/ex_num
809 +/proc/speakup/freq
810 +/proc/speakup/full_time
811 +/proc/speakup/jiffy_delta
812 +/proc/speakup/key_echo
813 +/proc/speakup/keymap
814 +/proc/speakup/no_interrupt
815 +/proc/speakup/pitch
816 +/proc/speakup/punc_all
817 +/proc/speakup/punc_level
818 +/proc/speakup/punc_most
819 +/proc/speakup/punc_some
820 +/proc/speakup/punct
821 +/proc/speakup/rate
822 +/proc/speakup/reading_punc
823 +/proc/speakup/repeats
824 +/proc/speakup/say_control
825 +/proc/speakup/say_word_ctl
826 +/proc/speakup/silent
827 +/proc/speakup/spell_delay
828 +/proc/speakup/synth_direct
829 +/proc/speakup/synth_name
830 +/proc/speakup/tone
831 +/proc/speakup/trigger_time
832 +/proc/speakup/version
833 +/proc/speakup/voice
834 +/proc/speakup/vol
835 +
836 +In addition to using the Speakup hot keys to change such things as
837 +volume, pitch, and rate, you can also echo values to the appropriate
838 +entry in the /proc/speakup directory. This is very useful, since it
839 +lets you control Speakup parameters from within a script. How you
840 +would write such scripts is somewhat beyond the scope of this manual,
841 +but I will include a couple of simple examples here to give you a
842 +general idea of what such scripts can do.
843 +
844 +Suppose for example, that you wanted to control both the punctuation
845 +level and the reading punctuation level at the same time. For
846 +simplicity, we'll call them punc0, punc1, punc2, and punc3. The scripts
847 +might look something like this:
848 +
849 +#!/bin/bash
850 +# punc0
851 +# set punc and reading punc levels to 0
852 +echo 0 >/proc/speakup/punc_level
853 +echo 0 >/proc/speakup/reading_punc
854 +echo Punctuation level set to 0.
855 +
856 +#!/bin/bash
857 +# punc1
858 +# set punc and reading punc levels to 1
859 +echo 1 >/proc/speakup/punc_level
860 +echo 1 >/proc/speakup/reading_punc
861 +echo Punctuation level set to 1.
862 +
863 +#!/bin/bash
864 +# punc2
865 +# set punc and reading punc levels to 2
866 +echo 2 >/proc/speakup/punc_level
867 +echo 2 >/proc/speakup/reading_punc
868 +echo Punctuation level set to 2.
869 +
870 +#!/bin/bash
871 +# punc3
872 +# set punc and reading punc levels to 3
873 +echo 3 >/proc/speakup/punc_level
874 +echo 3 >/proc/speakup/reading_punc
875 +echo Punctuation level set to 3.
876 +
877 +If you were to store these four small scripts in a directory in your
878 +path, perhaps /usr/local/bin, and set the permissions to 755 with the
879 +chmod command, then you could change the default reading punc and
880 +punctuation levels at the same time by issuing just one command. For
881 +example, if you were to execute the punc3 command at your shell prompt,
882 +then the reading punc and punc level would both get set to 3.
883 +
884 +I should note that the above scripts were written to work with bash, but
885 +regardless of which shell you use, you should be able to do something
886 +similar.
887 +
888 +The Speakup proc system also has another interesting use. You can echo
889 +Speakup parameters into the proc system in a script during system
890 +startup, and speakup will return to your preferred parameters every time
891 +the system is rebooted.
892 +
893 +Most of the Speakup proc parameters can be manipulated by a regular user
894 +on the system. However, there are a few parameters that are dangerous
895 +enough that they should only be manipulated by the root user on your
896 +system. There are even some parameters that are read only, and cannot
897 +be written to at all. For example, the version entry in the Speakup
898 +proc system is read only. This is because there is no reason for a user
899 +to tamper with the version number which is reported by Speakup. Doing
900 +an ls -l on /proc/speakup/version will return this:
901 +
902 +-r--r--r-- 1 root root 0 Mar 21 13:46 /proc/speakup/version
903 +
904 +As you can see, the version entry in the Speakup proc system is read
905 +only, is owned by root, and belongs to the root group. Doing a cat of
906 +/proc/speakup/version will display the Speakup version number, like
907 +this:
908 +
909 +cat /proc/speakup/version
910 +Speakup v-2.00 CVS: Thu Oct 21 10:38:21 EDT 2004
911 +synth dtlk version 1.1
912 +
913 +The display shows the Speakup version number, along with the version
914 +number of the driver for the current synthesizer.
915 +
916 +Looking at entries in the Speakup proc system can be useful in many
917 +ways. For example, you might wish to know what level your volume is set
918 +at. You could type:
919 +
920 +cat /proc/speakup/vol
921 +5
922 +
923 +The number five which comes back is the level at which the synthesizer
924 +volume is set at.
925 +
926 +All the entries in the Speakup proc system are readable, some are
927 +writable by root only, and some are writable by everyone. Unless you
928 +know what you are doing, you should probably leave the ones that are
929 +writable by root only alone. Most of the names are self explanatory.
930 +Vol for controlling volume, pitch for pitch, rate for controlling speaking
931 +rate, etc. If you find one you aren't sure about, you can post a query
932 +on the Speakup list.
933 +
934 +6. Changing Synthesizers
935 +
936 +It is possible to change to a different synthesizer while speakup is
937 +running. In other words, it is not necessary to reboot the system
938 +in order to use a different synthesizer. You can simply echo the
939 +synthesizer keyword to the /proc/speakup/synth_name proc entry.
940 +Depending on your situation, you may wish to echo none to the synth_name
941 +proc entry, to disable speech while one synthesizer is disconnected and
942 +a second one is connected in its place. Then echo the keyword for the
943 +new synthesizer into the synth_name proc entry in order to start speech
944 +with the newly connected synthesizer. See the list of synthesizer
945 +keywords in section 1 to find the keyword which matches your synth.
946 +
947 +7. Loading modules
948 +
949 +As mentioned earlier, Speakup can either be completely compiled into the
950 +kernel, with the exception of the help module, or it can be compiled as
951 +a series of modules. When compiled as modules, Speakup will only be
952 +able to speak some of the bootup messages if your system administrator
953 +has configured the system to load the modules at boo time. The modules
954 +can be loaded after the file systems have been checked and mounted, or
955 +from an initrd. There is a third possibility. Speakup can be compiled
956 +with some components built into the kernel, and others as modules. As
957 +we'll see in the next section, this is particularly useful when you are
958 +working with software synthesizers.
959 +
960 +If Speakup is completely compiled as modules, then you must use the
961 +modprobe command to load Speakup. You do this by loading the module for
962 +the synthesizer driver you wish to use. The driver modules are all
963 +named speakup_<keyword>, where <keyword> is the keyword for the
964 +synthesizer you want. So, in order to load the driver for the DecTalk
965 +Express, you would type the following command:
966 +
967 +modprobe speakup_dectlk
968 +
969 +Issuing this command would load the DecTalk Express driver and all other
970 +related Speakup modules necessary to get Speakup up and running.
971 +
972 +To completely unload Speakup, again presuming that it is entirely built
973 +as modules, you would give the command:
974 +
975 +modprobe -r speakup_dectlk
976 +
977 +The above command assumes you were running a DecTalk Express. If you
978 +were using a different synth, then you would substitute its keyword in
979 +place of dectlk.
980 +
981 +But now, suppose we have a situation where the main Speakup component
982 +is built into the kernel, and some or all of the drivers are built as
983 +modules. Since the main part of Speakup is compiled into the kernel, a
984 +partial Speakup proc system has been created which we can take advantage
985 +of by simply echoing the synthesizer keyword into the
986 +/proc/speakup/synth_name proc entry. This will cause the kernel to
987 +automatically load the appropriate driver module, and start Speakup
988 +talking. To switch to another synth, just echo a new keyword to the
989 +synth_name proc entry. For example, to load the DoubleTalk LT driver,
990 +you would type:
991 +
992 +echo ltlk >/proc/speakup/synth_name
993 +
994 +You can use the modprobe -r command to unload driver modules, regardless
995 +of whether the main part of Speakup has been built into the kernel or
996 +not.
997 +
998 +8. Using Software Synthesizers
999 +
1000 +Using a software synthesizer requires that some other software be
1001 +installed and running on your system. For this reason, software
1002 +synthesizers are not available for use at bootup, or during a system
1003 +installation process.
1004 +
1005 +In order to use a software synthesizer, you must have a package called
1006 +Speech Dispatcher running on your system, and it must be configured to
1007 +work with one of its supported software synthesizers.
1008 +
1009 +Two open source synthesizers you might use are Flite and Festival. You
1010 +might also choose to purchase the Software DecTalk from Fonix Sales Inc.
1011 +If you run a google search for Fonix, you'll find their web site.
1012 +
1013 +You can obtain a copy of Speech Dispatcher from free(b)soft at
1014 +http://www.freebsoft.org/. Follow the installation instructions that
1015 +come with Speech Dispatcher in order to install and configure Speech
1016 +Dispatcher. You can check out the web site for your Linux distribution
1017 +in order to get a copy of either Flite or Festival. Your Linux
1018 +distribution may also have a precompiled Speech Dispatcher package.
1019 +
1020 +Once you've installed, configured, and tested Speech Dispatcher with your
1021 +chosen software synthesizer, you still need one more piece of software
1022 +in order to make things work. You need a package called speechd-up.
1023 +You get it from the free(b)soft web site mentioned above. After you've
1024 +compiled and installed speechd-up, you are almost ready to begin using
1025 +your software synthesizer.
1026 +
1027 +Before you can use a software synthesizer, you must have created the
1028 +/dev/softsynth device. If you have not already done so, issue the
1029 +following commands as root:
1030 +
1031 +cd /dev
1032 +mknod softsynth c 10 26
1033 +
1034 +While we are at it, we might just as well create the /dev/synth device,
1035 +which can be used to let user space programs send information to your
1036 +synthesizer. To create /dev/synth, change to the /dev directory, and
1037 +issue the following command as root:
1038 +
1039 +mknod synth c 10 25
1040 +
1041 +Now you can begin using your software synthesizer. In order to do so,
1042 +echo the sftsyn keyword to the synth_name proc entry like this:
1043 +
1044 +echo sftsyn >/proc/speakup/synth_name
1045 +
1046 +Next run the speechd_up command like this:
1047 +
1048 +speechd_up &
1049 +
1050 +Your synth should now start talking, and you should be able to adjust
1051 +the pitch, rate, etc.
1052 +
1053 +In this section, we have assumed that your copy of Speakup was compiled
1054 +with the speakup_sftsyn component either built into the kernel, or
1055 +compiled as a module.
1056 +
1057 +9. Using The DecTalk PC Card
1058 +
1059 +The DecTalk PC card is an ISA card that is inserted into one of the ISA
1060 +slots in your computer. It requires that the DecTalk PC software be
1061 +installed on your computer, and that the software be loaded onto the
1062 +Dectalk PC card before it can be used.
1063 +
1064 +You can get the dec_pc.tgz file from the linux-speakup.org site. The
1065 +dec_pc.tgz file is in the ~ftp/pub/linux/speakup directory.
1066 +
1067 +After you have downloaded the dec_pc.tgz file, untar it in your home
1068 +directory, and read the Readme file in the newly created dec_pc
1069 +directory.
1070 +
1071 +The easiest way to get the software working is to copy the entire dec_pc
1072 +directory into /user/local/lib. To do this, su to root in your home
1073 +directory, and issue the command:
1074 +
1075 +cp dec_pc /usr/local/lib
1076 +
1077 +You will need to copy the dtload command from the dec_pc directory to a
1078 +directory in your path. Either /usr/bin or /usr/local/bin is a good
1079 +choice.
1080 +
1081 +You can now run the dtload command in order to load the DecTalk PC
1082 +software onto the card. After you have done this, echo the decpc
1083 +keyword to the synth_name entry in the proc system like this:
1084 +
1085 +echo decpc >/proc/speakup/synth_name
1086 +
1087 +Your DecTalk PC should start talking, and then you can adjust the pitch,
1088 +rate, volume, voice, etc. The voice entry in the Speakup proc system
1089 +will accept a number from 0 through 7 for the DecTalk PC synthesizer,
1090 +which will give you access to some of the DecTalk voices.
1091 +
1092 +10. Using Cursor Tracking
1093 +
1094 +In Speakup version 2.0 and later, cursor tracking is turned on by
1095 +default. This means that when you are using an editor, Speakup will
1096 +automatically speak characters as you move left and right with the
1097 +cursor keys, and lines as you move up and down with the cursor keys.
1098 +
1099 +This is extremely useful, and makes editing files a snap. But there are
1100 +times when cursor tracking can get in your way. So Speakup provides a
1101 +toggle to turn cursor tracking on and off. You do this with the keypad
1102 +asterisk key. Pressing this key repeatedly will toggle the cursor
1103 +tracking on and off, and you will hear Speakup say, "cursoring off", and
1104 +"cursoring on".
1105 +
1106 +Some folks like to turn cursor tracking off while they are using the
1107 +lynx web browser. You definitely want to turn cursor tracking off when
1108 +you are using the alsamixer application. Otherwise, you won't be able
1109 +to hear your mixer settings while you are using the arrow keys.
1110 +
1111 +11. Cut and Paste
1112 +
1113 +One of Speakup's more useful features is the ability to cut and paste
1114 +text on the screen. This means that you can capture information from a
1115 +program, and paste that captured text into a different place in the
1116 +program, or into an entirely different program, which may even be
1117 +running on a different console.
1118 +
1119 +For example, in this manual, we have made references to several web
1120 +sites. It would be nice if you could cut and paste these urls into your
1121 +web browser. Speakup does this quite nicely. Suppose you wanted to
1122 +past the following url into your browser:
1123 +
1124 +http://linux-speakup.org/
1125 +
1126 +Use the speakup review keys to position the reading cursor on the first
1127 +character of the above url. When the reading cursor is in position,
1128 +press the keypad slash key once. Speakup will say, "mark". Next,
1129 +position the reading cursor on the rightmost character of the above
1130 +url. Press the keypad slash key once again to actually cut the text
1131 +from the screen. Speakup will say, "cut". Although we call this
1132 +cutting, Speakup does not actually delete the cut text from the screen.
1133 +It makes a copy of the text in a special buffer for later pasting.
1134 +
1135 +Now that you have the url cut from the screen, you can paste it into
1136 +your browser, or even paste the url on a command line as an argument to
1137 +your browser.
1138 +
1139 +Suppose you want to start lynx and go to the Speakup site.
1140 +
1141 +You can switch to a different console with the alt left and right
1142 +arrows, or you can switch to a specific console by typing alt and a
1143 +function key. These are not Speakup commands, just standard Linux
1144 +console capabilities.
1145 +
1146 +Once you've changed to an appropriate console, and are at a shell prompt,
1147 +type the word lynx, followed by a space. Now press and hold the speakup
1148 +key, while you type the keypad slash character. The url will be pasted
1149 +onto the command line, just as though you had typed it in. Press the
1150 +enter key to execute the command.
1151 +
1152 +The paste buffer will continue to hold the cut information, until a new
1153 +mark and cut operation is carried out. This means you can paste the cut
1154 +information as many times as you like before doing another cut
1155 +operation.
1156 +
1157 +You are not limited to cutting and pasting only one line on the screen.
1158 +You can also cut and paste rectangular regions of the screen. Just
1159 +position the reading cursor at the top left corner of the text to be
1160 +cut, mark it with the keypad slash key, then position the reading cursor
1161 +at the bottom right corner of the region to be cut, and cut it with the
1162 +keypad slash key.
1163 +
1164 +12. Changing the Pronunciation of Characters
1165 +
1166 +Through the /proc/speakup/chars proc entry, Speakup gives you the
1167 +ability to change how Speakup pronounces a given character. You could,
1168 +for example, change how some punctuation characters are spoken. You can
1169 +even change how Speakup will pronounce certain letters.
1170 +
1171 +You may, for example, wish to change how Speakup pronounces the z
1172 +character. The author of Speakup, Kirk Reiser, is Canadian, and thus
1173 +believes that the z should be pronounced zed. If you are an American,
1174 +you might wish to use the zee pronunciation instead of zed. You can
1175 +change the pronunciation of both the upper and lower case z with the
1176 +following two commands:
1177 +
1178 +echo 90 zee >/proc/speakup/characters
1179 +echo 122 zee >/proc/speakup/characters
1180 +
1181 +Let's examine the parts of the two previous commands. They are issued
1182 +at the shell prompt, and could be placed in a startup script.
1183 +
1184 +The word echo tells the shell that you want to have it display the
1185 +string of characters that follow the word echo. If you were to just
1186 +type:
1187 +
1188 +echo hello.
1189 +
1190 +You would get the word hello printed on your screen as soon as you
1191 +pressed the enter key. In this case, we are echoing strings that we
1192 +want to be redirected into the proc system.
1193 +
1194 +The numbers 90 and 122 in the above echo commands are the ascii numeric
1195 +values for the upper and lower case z, the characters we wish to change.
1196 +
1197 +The string zee is the pronunciation that we want Speakup to use for the
1198 +upper and lower case z.
1199 +
1200 +The > symbol redirects the output of the echo command to a file, just
1201 +like in DOS, or at the Windows command prompt.
1202 +
1203 +And finally, /proc/speakup/chars is the file entry in the proc system
1204 +where we want the output to be directed. Speakup looks at the numeric
1205 +value of the character we want to change, and inserts the pronunciation
1206 +string into an internal table.
1207 +
1208 +You can look at the whole table with the following command:
1209 +
1210 +cat /proc/speakup/chars
1211 +
1212 +Speakup will then print out the entire character pronunciation table. I
1213 +won't display it here, but leave you to look at it at your convenience.
1214 +
1215 +13. Mapping Keys
1216 +
1217 +Speakup has the capability of allowing you to assign or "map" keys to
1218 +internal Speakup commands. This section necessarily assumes you have a
1219 +Linux kernel source tree installed, and that it has been patched and
1220 +configured with Speakup. How you do this is beyond the scope of this
1221 +manual. For this information, visit the Speakup web site at
1222 +http://linux-speakup.org/. The reason you'll need the kernel source
1223 +tree patched with Speakup is that the genmap utility you'll need for
1224 +processing keymaps is in the
1225 +/usr/src/linux-<version_number>/drivers/char/speakup directory. The
1226 +<version_number> in the above directory path is the version number of
1227 +the Linux source tree you are working with.
1228 +
1229 +So ok, you've gone off and gotten your kernel source tree, and patched
1230 +and configured it. Now you can start manipulating keymaps.
1231 +
1232 +You can either use the
1233 +/usr/src/linux-<version_number>/drivers/char/speakup/speakupmap.map file
1234 +included with the Speakup source, or you can cut and paste the copy in
1235 +section 4 into a separate file. If you use the one in the Speakup
1236 +source tree, make sure you make a backup of it before you start making
1237 +changes. You have been warned!
1238 +
1239 +Suppose that you want to swap the key assignments for the Speakup
1240 +say_last_char and the Speakup say_first_char commands. The
1241 +speakupmap.map lists the key mappings for these two commands as follows:
1242 +
1243 +spk key_pageup = say_first_char
1244 +spk key_pagedown = say_last_char
1245 +
1246 +You can edit your copy of the speakupmap.map file and swap the command
1247 +names on the right side of the = (equals) sign. You did make a backup,
1248 +right? The new keymap lines would look like this:
1249 +
1250 +spk key_pageup = say_last_char
1251 +spk key_pagedown = say_first_char
1252 +
1253 +After you edit your copy of the speakupmap.map file, save it under a new
1254 +file name, perhaps newmap.map. Then exit your editor and return to the
1255 +shell prompt.
1256 +
1257 +You are now ready to load your keymap with your swapped key assignments.
1258 + Assuming that you saved your new keymap as the file newmap.map, you
1259 +would load your keymap into the proc system like this:
1260 +
1261 +/usr/src/linux-<version_number>/drivers/char/speakup/genmap newmap.map
1262 +>/proc/speakup/keymap
1263 +
1264 +Remember to substitute your kernel version number for the
1265 +<version_number> in the above command. Also note that although the
1266 +above command wrapped onto two lines in this document, you should type
1267 +it all on one line.
1268 +
1269 +Your say first and say last characters should now be swapped. Pressing
1270 +speakup pagedown should read you the first non-whitespace character on
1271 +the line your reading cursor is in, and pressing speakup pageup should
1272 +read you the last character on the line your reading cursor is in.
1273 +
1274 +You should note that these new mappings will only stay in effect until
1275 +you reboot, or until you load another keymap.
1276 +
1277 +One final warning. If you try to load a partial map, you will quickly
1278 +find that all the mappings you didn't include in your file got deleted
1279 +from the working map. Be extremely careful, and always make a backup!
1280 +You have been warned!
1281 +
1282 +14. Using Speakup's Windowing Capability
1283 +
1284 +Speakup has the capability of defining and manipulating windows on the
1285 +screen. Speakup uses the term "Window", to mean a user defined area of
1286 +the screen. The key strokes for defining and manipulating Speakup
1287 +windows are as follows:
1288 +
1289 +speakup + f2 -- Set the bounds of the window.
1290 +Speakup + f3 -- clear the current window definition.
1291 +speakup + f4 -- Toggle window silence on and off.
1292 +speakup + keypad plus -- Say the currently defined window.
1293 +
1294 +These capabilities are useful for tracking a certain part of the screen
1295 +without rereading the whole screen, or for silencing a part of the
1296 +screen that is constantly changing, such as a clock or status line.
1297 +
1298 +There is no way to save these window settings, and you can only have one
1299 +window defined for each virtual console. There is also no way to have
1300 +windows automaticly defined for specific applications.
1301 +
1302 +In order to define a window, use the review keys to move your reading
1303 +cursor to the beginning of the area you want to define. Then press
1304 +speakup + f2. Speakup will tell you that the window starts at the
1305 +indicated row and column position. Then move the reading cursor to the
1306 +end of the area to be defined as a window, and press speakup + f2 again.
1307 + If there is more than one line in the window, Speakup will tell you
1308 +that the window ends at the indicated row and column position. If there
1309 +is only one line in the window, then Speakup will tell you that the
1310 +window is the specified line on the screen. If you are only defining a
1311 +one line window, you can just press speakup + f2 twice after placing the
1312 +reading cursor on the line you want to define as a window. It is not
1313 +necessary to position the reading cursor at the end of the line in order
1314 +to define the whole line as a window.
1315 +
1316 + GNU Free Documentation License
1317 + Version 1.2, November 2002
1318 +
1319 +
1320 + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
1321 + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1322 + Everyone is permitted to copy and distribute verbatim copies
1323 + of this license document, but changing it is not allowed.
1324 +
1325 +
1326 +0. PREAMBLE
1327 +
1328 +The purpose of this License is to make a manual, textbook, or other
1329 +functional and useful document "free" in the sense of freedom: to
1330 +assure everyone the effective freedom to copy and redistribute it,
1331 +with or without modifying it, either commercially or noncommercially.
1332 +Secondarily, this License preserves for the author and publisher a way
1333 +to get credit for their work, while not being considered responsible
1334 +for modifications made by others.
1335 +
1336 +This License is a kind of "copyleft", which means that derivative
1337 +works of the document must themselves be free in the same sense. It
1338 +complements the GNU General Public License, which is a copyleft
1339 +license designed for free software.
1340 +
1341 +We have designed this License in order to use it for manuals for free
1342 +software, because free software needs free documentation: a free
1343 +program should come with manuals providing the same freedoms that the
1344 +software does. But this License is not limited to software manuals;
1345 +it can be used for any textual work, regardless of subject matter or
1346 +whether it is published as a printed book. We recommend this License
1347 +principally for works whose purpose is instruction or reference.
1348 +
1349 +
1350 +1. APPLICABILITY AND DEFINITIONS
1351 +
1352 +This License applies to any manual or other work, in any medium, that
1353 +contains a notice placed by the copyright holder saying it can be
1354 +distributed under the terms of this License. Such a notice grants a
1355 +world-wide, royalty-free license, unlimited in duration, to use that
1356 +work under the conditions stated herein. The "Document", below,
1357 +refers to any such manual or work. Any member of the public is a
1358 +licensee, and is addressed as "you". You accept the license if you
1359 +copy, modify or distribute the work in a way requiring permission
1360 +under copyright law.
1361 +
1362 +A "Modified Version" of the Document means any work containing the
1363 +Document or a portion of it, either copied verbatim, or with
1364 +modifications and/or translated into another language.
1365 +
1366 +A "Secondary Section" is a named appendix or a front-matter section of
1367 +the Document that deals exclusively with the relationship of the
1368 +publishers or authors of the Document to the Document's overall subject
1369 +(or to related matters) and contains nothing that could fall directly
1370 +within that overall subject. (Thus, if the Document is in part a
1371 +textbook of mathematics, a Secondary Section may not explain any
1372 +mathematics.) The relationship could be a matter of historical
1373 +connection with the subject or with related matters, or of legal,
1374 +commercial, philosophical, ethical or political position regarding
1375 +them.
1376 +
1377 +The "Invariant Sections" are certain Secondary Sections whose titles
1378 +are designated, as being those of Invariant Sections, in the notice
1379 +that says that the Document is released under this License. If a
1380 +section does not fit the above definition of Secondary then it is not
1381 +allowed to be designated as Invariant. The Document may contain zero
1382 +Invariant Sections. If the Document does not identify any Invariant
1383 +Sections then there are none.
1384 +
1385 +The "Cover Texts" are certain short passages of text that are listed,
1386 +as Front-Cover Texts or Back-Cover Texts, in the notice that says that
1387 +the Document is released under this License. A Front-Cover Text may
1388 +be at most 5 words, and a Back-Cover Text may be at most 25 words.
1389 +
1390 +A "Transparent" copy of the Document means a machine-readable copy,
1391 +represented in a format whose specification is available to the
1392 +general public, that is suitable for revising the document
1393 +straightforwardly with generic text editors or (for images composed of
1394 +pixels) generic paint programs or (for drawings) some widely available
1395 +drawing editor, and that is suitable for input to text formatters or
1396 +for automatic translation to a variety of formats suitable for input
1397 +to text formatters. A copy made in an otherwise Transparent file
1398 +format whose markup, or absence of markup, has been arranged to thwart
1399 +or discourage subsequent modification by readers is not Transparent.
1400 +An image format is not Transparent if used for any substantial amount
1401 +of text. A copy that is not "Transparent" is called "Opaque".
1402 +
1403 +Examples of suitable formats for Transparent copies include plain
1404 +ASCII without markup, Texinfo input format, LaTeX input format, SGML
1405 +or XML using a publicly available DTD, and standard-conforming simple
1406 +HTML, PostScript or PDF designed for human modification. Examples of
1407 +transparent image formats include PNG, XCF and JPG. Opaque formats
1408 +include proprietary formats that can be read and edited only by
1409 +proprietary word processors, SGML or XML for which the DTD and/or
1410 +processing tools are not generally available, and the
1411 +machine-generated HTML, PostScript or PDF produced by some word
1412 +processors for output purposes only.
1413 +
1414 +The "Title Page" means, for a printed book, the title page itself,
1415 +plus such following pages as are needed to hold, legibly, the material
1416 +this License requires to appear in the title page. For works in
1417 +formats which do not have any title page as such, "Title Page" means
1418 +the text near the most prominent appearance of the work's title,
1419 +preceding the beginning of the body of the text.
1420 +
1421 +A section "Entitled XYZ" means a named subunit of the Document whose
1422 +title either is precisely XYZ or contains XYZ in parentheses following
1423 +text that translates XYZ in another language. (Here XYZ stands for a
1424 +specific section name mentioned below, such as "Acknowledgements",
1425 +"Dedications", "Endorsements", or "History".) To "Preserve the Title"
1426 +of such a section when you modify the Document means that it remains a
1427 +section "Entitled XYZ" according to this definition.
1428 +
1429 +The Document may include Warranty Disclaimers next to the notice which
1430 +states that this License applies to the Document. These Warranty
1431 +Disclaimers are considered to be included by reference in this
1432 +License, but only as regards disclaiming warranties: any other
1433 +implication that these Warranty Disclaimers may have is void and has
1434 +no effect on the meaning of this License.
1435 +
1436 +
1437 +2. VERBATIM COPYING
1438 +
1439 +You may copy and distribute the Document in any medium, either
1440 +commercially or noncommercially, provided that this License, the
1441 +copyright notices, and the license notice saying this License applies
1442 +to the Document are reproduced in all copies, and that you add no other
1443 +conditions whatsoever to those of this License. You may not use
1444 +technical measures to obstruct or control the reading or further
1445 +copying of the copies you make or distribute. However, you may accept
1446 +compensation in exchange for copies. If you distribute a large enough
1447 +number of copies you must also follow the conditions in section 3.
1448 +
1449 +You may also lend copies, under the same conditions stated above, and
1450 +you may publicly display copies.
1451 +
1452 +
1453 +3. COPYING IN QUANTITY
1454 +
1455 +If you publish printed copies (or copies in media that commonly have
1456 +printed covers) of the Document, numbering more than 100, and the
1457 +Document's license notice requires Cover Texts, you must enclose the
1458 +copies in covers that carry, clearly and legibly, all these Cover
1459 +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
1460 +the back cover. Both covers must also clearly and legibly identify
1461 +you as the publisher of these copies. The front cover must present
1462 +the full title with all words of the title equally prominent and
1463 +visible. You may add other material on the covers in addition.
1464 +Copying with changes limited to the covers, as long as they preserve
1465 +the title of the Document and satisfy these conditions, can be treated
1466 +as verbatim copying in other respects.
1467 +
1468 +If the required texts for either cover are too voluminous to fit
1469 +legibly, you should put the first ones listed (as many as fit
1470 +reasonably) on the actual cover, and continue the rest onto adjacent
1471 +pages.
1472 +
1473 +If you publish or distribute Opaque copies of the Document numbering
1474 +more than 100, you must either include a machine-readable Transparent
1475 +copy along with each Opaque copy, or state in or with each Opaque copy
1476 +a computer-network location from which the general network-using
1477 +public has access to download using public-standard network protocols
1478 +a complete Transparent copy of the Document, free of added material.
1479 +If you use the latter option, you must take reasonably prudent steps,
1480 +when you begin distribution of Opaque copies in quantity, to ensure
1481 +that this Transparent copy will remain thus accessible at the stated
1482 +location until at least one year after the last time you distribute an
1483 +Opaque copy (directly or through your agents or retailers) of that
1484 +edition to the public.
1485 +
1486 +It is requested, but not required, that you contact the authors of the
1487 +Document well before redistributing any large number of copies, to give
1488 +them a chance to provide you with an updated version of the Document.
1489 +
1490 +
1491 +4. MODIFICATIONS
1492 +
1493 +You may copy and distribute a Modified Version of the Document under
1494 +the conditions of sections 2 and 3 above, provided that you release
1495 +the Modified Version under precisely this License, with the Modified
1496 +Version filling the role of the Document, thus licensing distribution
1497 +and modification of the Modified Version to whoever possesses a copy
1498 +of it. In addition, you must do these things in the Modified Version:
1499 +
1500 +A. Use in the Title Page (and on the covers, if any) a title distinct
1501 + from that of the Document, and from those of previous versions
1502 + (which should, if there were any, be listed in the History section
1503 + of the Document). You may use the same title as a previous version
1504 + if the original publisher of that version gives permission.
1505 +B. List on the Title Page, as authors, one or more persons or entities
1506 + responsible for authorship of the modifications in the Modified
1507 + Version, together with at least five of the principal authors of the
1508 + Document (all of its principal authors, if it has fewer than five),
1509 + unless they release you from this requirement.
1510 +C. State on the Title page the name of the publisher of the
1511 + Modified Version, as the publisher.
1512 +D. Preserve all the copyright notices of the Document.
1513 +E. Add an appropriate copyright notice for your modifications
1514 + adjacent to the other copyright notices.
1515 +F. Include, immediately after the copyright notices, a license notice
1516 + giving the public permission to use the Modified Version under the
1517 + terms of this License, in the form shown in the Addendum below.
1518 +G. Preserve in that license notice the full lists of Invariant Sections
1519 + and required Cover Texts given in the Document's license notice.
1520 +H. Include an unaltered copy of this License.
1521 +I. Preserve the section Entitled "History", Preserve its Title, and add
1522 + to it an item stating at least the title, year, new authors, and
1523 + publisher of the Modified Version as given on the Title Page. If
1524 + there is no section Entitled "History" in the Document, create one
1525 + stating the title, year, authors, and publisher of the Document as
1526 + given on its Title Page, then add an item describing the Modified
1527 + Version as stated in the previous sentence.
1528 +J. Preserve the network location, if any, given in the Document for
1529 + public access to a Transparent copy of the Document, and likewise
1530 + the network locations given in the Document for previous versions
1531 + it was based on. These may be placed in the "History" section.
1532 + You may omit a network location for a work that was published at
1533 + least four years before the Document itself, or if the original
1534 + publisher of the version it refers to gives permission.
1535 +K. For any section Entitled "Acknowledgements" or "Dedications",
1536 + Preserve the Title of the section, and preserve in the section all
1537 + the substance and tone of each of the contributor acknowledgements
1538 + and/or dedications given therein.
1539 +L. Preserve all the Invariant Sections of the Document,
1540 + unaltered in their text and in their titles. Section numbers
1541 + or the equivalent are not considered part of the section titles.
1542 +M. Delete any section Entitled "Endorsements". Such a section
1543 + may not be included in the Modified Version.
1544 +N. Do not retitle any existing section to be Entitled "Endorsements"
1545 + or to conflict in title with any Invariant Section.
1546 +O. Preserve any Warranty Disclaimers.
1547 +
1548 +If the Modified Version includes new front-matter sections or
1549 +appendices that qualify as Secondary Sections and contain no material
1550 +copied from the Document, you may at your option designate some or all
1551 +of these sections as invariant. To do this, add their titles to the
1552 +list of Invariant Sections in the Modified Version's license notice.
1553 +These titles must be distinct from any other section titles.
1554 +
1555 +You may add a section Entitled "Endorsements", provided it contains
1556 +nothing but endorsements of your Modified Version by various
1557 +parties--for example, statements of peer review or that the text has
1558 +been approved by an organization as the authoritative definition of a
1559 +standard.
1560 +
1561 +You may add a passage of up to five words as a Front-Cover Text, and a
1562 +passage of up to 25 words as a Back-Cover Text, to the end of the list
1563 +of Cover Texts in the Modified Version. Only one passage of
1564 +Front-Cover Text and one of Back-Cover Text may be added by (or
1565 +through arrangements made by) any one entity. If the Document already
1566 +includes a cover text for the same cover, previously added by you or
1567 +by arrangement made by the same entity you are acting on behalf of,
1568 +you may not add another; but you may replace the old one, on explicit
1569 +permission from the previous publisher that added the old one.
1570 +
1571 +The author(s) and publisher(s) of the Document do not by this License
1572 +give permission to use their names for publicity for or to assert or
1573 +imply endorsement of any Modified Version.
1574 +
1575 +
1576 +5. COMBINING DOCUMENTS
1577 +
1578 +You may combine the Document with other documents released under this
1579 +License, under the terms defined in section 4 above for modified
1580 +versions, provided that you include in the combination all of the
1581 +Invariant Sections of all of the original documents, unmodified, and
1582 +list them all as Invariant Sections of your combined work in its
1583 +license notice, and that you preserve all their Warranty Disclaimers.
1584 +
1585 +The combined work need only contain one copy of this License, and
1586 +multiple identical Invariant Sections may be replaced with a single
1587 +copy. If there are multiple Invariant Sections with the same name but
1588 +different contents, make the title of each such section unique by
1589 +adding at the end of it, in parentheses, the name of the original
1590 +author or publisher of that section if known, or else a unique number.
1591 +Make the same adjustment to the section titles in the list of
1592 +Invariant Sections in the license notice of the combined work.
1593 +
1594 +In the combination, you must combine any sections Entitled "History"
1595 +in the various original documents, forming one section Entitled
1596 +"History"; likewise combine any sections Entitled "Acknowledgements",
1597 +and any sections Entitled "Dedications". You must delete all sections
1598 +Entitled "Endorsements".
1599 +
1600 +
1601 +6. COLLECTIONS OF DOCUMENTS
1602 +
1603 +You may make a collection consisting of the Document and other documents
1604 +released under this License, and replace the individual copies of this
1605 +License in the various documents with a single copy that is included in
1606 +the collection, provided that you follow the rules of this License for
1607 +verbatim copying of each of the documents in all other respects.
1608 +
1609 +You may extract a single document from such a collection, and distribute
1610 +it individually under this License, provided you insert a copy of this
1611 +License into the extracted document, and follow this License in all
1612 +other respects regarding verbatim copying of that document.
1613 +
1614 +
1615 +7. AGGREGATION WITH INDEPENDENT WORKS
1616 +
1617 +A compilation of the Document or its derivatives with other separate
1618 +and independent documents or works, in or on a volume of a storage or
1619 +distribution medium, is called an "aggregate" if the copyright
1620 +resulting from the compilation is not used to limit the legal rights
1621 +of the compilation's users beyond what the individual works permit.
1622 +When the Document is included in an aggregate, this License does not
1623 +apply to the other works in the aggregate which are not themselves
1624 +derivative works of the Document.
1625 +
1626 +If the Cover Text requirement of section 3 is applicable to these
1627 +copies of the Document, then if the Document is less than one half of
1628 +the entire aggregate, the Document's Cover Texts may be placed on
1629 +covers that bracket the Document within the aggregate, or the
1630 +electronic equivalent of covers if the Document is in electronic form.
1631 +Otherwise they must appear on printed covers that bracket the whole
1632 +aggregate.
1633 +
1634 +
1635 +8. TRANSLATION
1636 +
1637 +Translation is considered a kind of modification, so you may
1638 +distribute translations of the Document under the terms of section 4.
1639 +Replacing Invariant Sections with translations requires special
1640 +permission from their copyright holders, but you may include
1641 +translations of some or all Invariant Sections in addition to the
1642 +original versions of these Invariant Sections. You may include a
1643 +translation of this License, and all the license notices in the
1644 +Document, and any Warranty Disclaimers, provided that you also include
1645 +the original English version of this License and the original versions
1646 +of those notices and disclaimers. In case of a disagreement between
1647 +the translation and the original version of this License or a notice
1648 +or disclaimer, the original version will prevail.
1649 +
1650 +If a section in the Document is Entitled "Acknowledgements",
1651 +"Dedications", or "History", the requirement (section 4) to Preserve
1652 +its Title (section 1) will typically require changing the actual
1653 +title.
1654 +
1655 +
1656 +9. TERMINATION
1657 +
1658 +You may not copy, modify, sublicense, or distribute the Document except
1659 +as expressly provided for under this License. Any other attempt to
1660 +copy, modify, sublicense or distribute the Document is void, and will
1661 +automatically terminate your rights under this License. However,
1662 +parties who have received copies, or rights, from you under this
1663 +License will not have their licenses terminated so long as such
1664 +parties remain in full compliance.
1665 +
1666 +
1667 +10. FUTURE REVISIONS OF THIS LICENSE
1668 +
1669 +The Free Software Foundation may publish new, revised versions
1670 +of the GNU Free Documentation License from time to time. Such new
1671 +versions will be similar in spirit to the present version, but may
1672 +differ in detail to address new problems or concerns. See
1673 +http://www.gnu.org/copyleft/.
1674 +
1675 +Each version of the License is given a distinguishing version number.
1676 +If the Document specifies that a particular numbered version of this
1677 +License "or any later version" applies to it, you have the option of
1678 +following the terms and conditions either of that specified version or
1679 +of any later version that has been published (not as a draft) by the
1680 +Free Software Foundation. If the Document does not specify a version
1681 +number of this License, you may choose any version ever published (not
1682 +as a draft) by the Free Software Foundation.
1683 +
1684 +
1685 +ADDENDUM: How to use this License for your documents
1686 +
1687 +To use this License in a document you have written, include a copy of
1688 +the License in the document and put the following copyright and
1689 +license notices just after the title page:
1690 +
1691 + Copyright (c) YEAR YOUR NAME.
1692 + Permission is granted to copy, distribute and/or modify this document
1693 + under the terms of the GNU Free Documentation License, Version 1.2
1694 + or any later version published by the Free Software Foundation;
1695 + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
1696 + A copy of the license is included in the section entitled "GNU
1697 + Free Documentation License".
1698 +
1699 +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
1700 +replace the "with...Texts." line with this:
1701 +
1702 + with the Invariant Sections being LIST THEIR TITLES, with the
1703 + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
1704 +
1705 +If you have Invariant Sections without Cover Texts, or some other
1706 +combination of the three, merge those two alternatives to suit the
1707 +situation.
1708 +
1709 +If your document contains nontrivial examples of program code, we
1710 +recommend releasing these examples in parallel under your choice of
1711 +free software license, such as the GNU General Public License,
1712 +to permit their use in free software.
1713 +
1714 +The End.
1715 diff -urNpXdontdiff linux-2.6.14/drivers/char/consolemap.c linux-dsd/drivers/char/consolemap.c
1716 --- linux-2.6.14/drivers/char/consolemap.c 2005-08-29 00:41:01.000000000 +0100
1717 +++ linux-dsd/drivers/char/consolemap.c 2005-10-28 12:24:46.000000000 +0100
1718 @@ -670,3 +670,4 @@ console_map_init(void)
1719 }
1720
1721 EXPORT_SYMBOL(con_copy_unimap);
1722 +EXPORT_SYMBOL(inverse_translate);
1723 diff -urNpXdontdiff linux-2.6.14/drivers/char/keyboard.c linux-dsd/drivers/char/keyboard.c
1724 --- linux-2.6.14/drivers/char/keyboard.c 2005-10-28 12:36:00.000000000 +0100
1725 +++ linux-dsd/drivers/char/keyboard.c 2005-10-28 12:24:46.000000000 +0100
1726 @@ -40,6 +40,13 @@
1727 #include <linux/sysrq.h>
1728 #include <linux/input.h>
1729
1730 +
1731 +#include <linux/speakup.h>
1732 +
1733 +#ifdef CONFIG_SPEAKUP_MODULE
1734 +spk_key_func addr_spk_key = NULL;
1735 +#endif
1736 +
1737 static void kbd_disconnect(struct input_handle *handle);
1738 extern void ctrl_alt_del(void);
1739
1740 @@ -64,6 +71,10 @@ extern void ctrl_alt_del(void);
1741
1742 #define KBD_DEFLOCK 0
1743
1744 +/* Key types processed even in raw modes */
1745 +
1746 +#define TYPES_ALLOWED_IN_RAW_MODE ((1 << KT_SPEC) | (1 << KT_SHIFT) | (1 << KT_SPKUP))
1747 +
1748 void compute_shiftstate(void);
1749
1750 /*
1751 @@ -79,7 +90,7 @@ void compute_shiftstate(void);
1752 typedef void (k_handler_fn)(struct vc_data *vc, unsigned char value,
1753 char up_flag, struct pt_regs *regs);
1754 static k_handler_fn K_HANDLERS;
1755 -static k_handler_fn *k_handler[16] = { K_HANDLERS };
1756 +k_handler_fn *k_handler[16] = { K_HANDLERS };
1757
1758 #define FN_HANDLERS\
1759 fn_null, fn_enter, fn_show_ptregs, fn_show_mem,\
1760 @@ -100,15 +111,18 @@ static fn_handler_fn *fn_handler[] = { F
1761 const int max_vals[] = {
1762 255, ARRAY_SIZE(func_table) - 1, ARRAY_SIZE(fn_handler) - 1, NR_PAD - 1,
1763 NR_DEAD - 1, 255, 3, NR_SHIFT - 1, 255, NR_ASCII - 1, NR_LOCK - 1,
1764 - 255, NR_LOCK - 1, 255
1765 + 255, NR_LOCK - 1, 255, 255
1766 };
1767
1768 const int NR_TYPES = ARRAY_SIZE(max_vals);
1769
1770 struct kbd_struct kbd_table[MAX_NR_CONSOLES];
1771 -static struct kbd_struct *kbd = kbd_table;
1772 +struct kbd_struct *kbd = kbd_table;
1773 static struct kbd_struct kbd0;
1774
1775 +EXPORT_SYMBOL(kbd);
1776 +EXPORT_SYMBOL(k_handler);
1777 +
1778 int spawnpid, spawnsig;
1779
1780 /*
1781 @@ -255,12 +269,14 @@ void kd_mksound(unsigned int hz, unsigne
1782 }
1783 }
1784 }
1785 - if (ticks)
1786 - mod_timer(&kd_mksound_timer, jiffies + ticks);
1787 + if (ticks)
1788 + mod_timer(&kd_mksound_timer, jiffies + ticks);
1789 } else
1790 kd_nosound(0);
1791 }
1792
1793 +EXPORT_SYMBOL(kd_mksound);
1794 +
1795 /*
1796 * Setting the keyboard rate.
1797 */
1798 @@ -602,6 +618,7 @@ static void k_spec(struct vc_data *vc, u
1799 if (up_flag)
1800 return;
1801 if (value >= ARRAY_SIZE(fn_handler))
1802 + if (up_flag || (value >= ARRAY_SIZE(fn_handler)))
1803 return;
1804 if ((kbd->kbdmode == VC_RAW ||
1805 kbd->kbdmode == VC_MEDIUMRAW) &&
1806 @@ -1119,6 +1136,13 @@ static void kbd_keycode(unsigned int key
1807 key_map = key_maps[shift_final];
1808
1809 if (!key_map) {
1810 +#ifdef CONFIG_SPEAKUP
1811 + if (speakup_key(vc, shift_final, keycode, K(KT_SHIFT,0), !down, regs ))
1812 + return;
1813 +#elif defined(CONFIG_SPEAKUP_MODULE)
1814 + if ( addr_spk_key && (*addr_spk_key)(vc, shift_final,
1815 + keycode, K(KT_SHIFT,0), !down, regs) ) return;
1816 +#endif
1817 compute_shiftstate();
1818 kbd->slockstate = 0;
1819 return;
1820 @@ -1137,10 +1161,17 @@ static void kbd_keycode(unsigned int key
1821 }
1822
1823 type -= 0xf0;
1824 -
1825 - if (raw_mode && type != KT_SPEC && type != KT_SHIFT)
1826 +#ifdef CONFIG_SPEAKUP
1827 + if (speakup_key(vc, shift_final, keycode, keysym, !down, regs ))
1828 return;
1829 +#elif defined(CONFIG_SPEAKUP_MODULE)
1830 + if ( addr_spk_key && (*addr_spk_key)(vc, shift_final,
1831 + keycode, keysym, !down, regs) ) return;
1832 +#endif
1833
1834 + if (raw_mode && type != KT_SPEC && type != KT_SHIFT )
1835 + return;
1836 +
1837 if (type == KT_LETTER) {
1838 type = KT_LATIN;
1839 if (vc_kbd_led(kbd, VC_CAPSLOCK)) {
1840 @@ -1149,13 +1180,28 @@ static void kbd_keycode(unsigned int key
1841 keysym = key_map[keycode];
1842 }
1843 }
1844 -
1845 (*k_handler[type])(vc, keysym & 0xff, !down, regs);
1846
1847 if (type != KT_SLOCK)
1848 kbd->slockstate = 0;
1849 }
1850
1851 +struct input_dev *fakekeydev=NULL;
1852 +
1853 +void kbd_fakekey(unsigned int keycode)
1854 +{
1855 + if (fakekeydev==NULL)
1856 + return;
1857 + kbd_keycode(keycode, 0, HW_RAW(fakekeydev), fakekeydev->regs);
1858 + kbd_keycode(keycode, 1, HW_RAW(fakekeydev), fakekeydev->regs);
1859 +
1860 + tasklet_schedule(&keyboard_tasklet);
1861 + do_poke_blanked_console = 1;
1862 + schedule_console_callback();
1863 +}
1864 +
1865 +EXPORT_SYMBOL(kbd_fakekey);
1866 +
1867 static void kbd_event(struct input_handle *handle, unsigned int event_type,
1868 unsigned int event_code, int value)
1869 {
1870 @@ -1193,6 +1239,7 @@ static struct input_handle *kbd_connect(
1871 memset(handle, 0, sizeof(struct input_handle));
1872
1873 handle->dev = dev;
1874 + fakekeydev=dev;
1875 handle->handler = handler;
1876 handle->name = "kbd";
1877
1878 diff -urNpXdontdiff linux-2.6.14/drivers/char/Makefile linux-dsd/drivers/char/Makefile
1879 --- linux-2.6.14/drivers/char/Makefile 2005-08-29 00:41:01.000000000 +0100
1880 +++ linux-dsd/drivers/char/Makefile 2005-10-28 12:24:46.000000000 +0100
1881 @@ -83,6 +83,7 @@ obj-$(CONFIG_SCx200_GPIO) += scx200_gpio
1882 obj-$(CONFIG_GPIO_VR41XX) += vr41xx_giu.o
1883 obj-$(CONFIG_TANBAC_TB0219) += tb0219.o
1884
1885 +obj-$(CONFIG_SPEAKUP) += speakup/
1886 obj-$(CONFIG_WATCHDOG) += watchdog/
1887 obj-$(CONFIG_MWAVE) += mwave/
1888 obj-$(CONFIG_AGP) += agp/
1889 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/BUGS linux-dsd/drivers/char/speakup/BUGS
1890 --- linux-2.6.14/drivers/char/speakup/BUGS 1970-01-01 01:00:00.000000000 +0100
1891 +++ linux-dsd/drivers/char/speakup/BUGS 2005-10-28 12:24:46.000000000 +0100
1892 @@ -0,0 +1,10 @@
1893 +Well, there are probably just thousands to squash, but these are the
1894 +ones I think of as bugs.
1895 +
1896 +There is a problem with speakup interrogating LiteTalks with rom
1897 +versions of at least 3.22 and earlier. (kirk)
1898 +
1899 +I define bugs as things which aren't working correctly although
1900 +they've been implemented. NOT features which haven't been added yet.
1901 +
1902 + Kirk
1903 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/Config.in linux-dsd/drivers/char/speakup/Config.in
1904 --- linux-2.6.14/drivers/char/speakup/Config.in 1970-01-01 01:00:00.000000000 +0100
1905 +++ linux-dsd/drivers/char/speakup/Config.in 2005-10-28 12:24:46.000000000 +0100
1906 @@ -0,0 +1,26 @@
1907 +tristate 'Speakup console speech' CONFIG_SPEAKUP
1908 +if [ "$CONFIG_SPEAKUP" != "n" ]; then
1909 + comment 'Type "y" for each synthesizer you want built into the kernel.'
1910 + dep_tristate "Accent SA, acntsa" CONFIG_SPEAKUP_ACNTSA $CONFIG_SPEAKUP
1911 + dep_tristate "Accent PC, acntpc" CONFIG_SPEAKUP_ACNTPC $CONFIG_SPEAKUP
1912 + dep_tristate "Apollo, apollo" CONFIG_SPEAKUP_APOLLO $CONFIG_SPEAKUP
1913 + dep_tristate "Audapter, audptr" CONFIG_SPEAKUP_AUDPTR $CONFIG_SPEAKUP
1914 + dep_tristate "Braille 'n' Speak, bns" CONFIG_SPEAKUP_BNS $CONFIG_SPEAKUP
1915 + dep_tristate "DECtalk Express, dectlk" CONFIG_SPEAKUP_DECTLK $CONFIG_SPEAKUP
1916 + dep_tristate "DECtalk External (old), decext" CONFIG_SPEAKUP_DECEXT $CONFIG_SPEAKUP
1917 + dep_tristate "DECtalk PC (big ISA card), decpc" CONFIG_SPEAKUP_DECPC $CONFIG_SPEAKUP
1918 + if [ "$CONFIG_SPEAKUP_DECPC" = "y" ] ;then
1919 + comment 'warning: decpc can only be built as a module'
1920 + fi
1921 + comment 'In order to use this you will need'
1922 + comment 'the dtload program and DECPC software files '
1923 + comment 'Read the accompanying DECPC documentation for more details'
1924 + dep_tristate "DoubleTalk PC, dtlk" CONFIG_SPEAKUP_DTLK $CONFIG_SPEAKUP
1925 + dep_tristate "Keynote Gold PC, keypc" CONFIG_SPEAKUP_KEYPC $CONFIG_SPEAKUP
1926 + dep_tristate "DoubleTalk LT or LiteTalk, ltlk" CONFIG_SPEAKUP_LTLK $CONFIG_SPEAKUP
1927 + dep_tristate "Software synthesizers /dev/sftsyn, sftsyn" CONFIG_SPEAKUP_SFTSYN $CONFIG_SPEAKUP
1928 + dep_tristate "Speak Out, spkout" CONFIG_SPEAKUP_SPKOUT $CONFIG_SPEAKUP
1929 + dep_tristate "Transport, txprt" CONFIG_SPEAKUP_TXPRT $CONFIG_SPEAKUP
1930 + comment 'Enter the three to six character synth string from above or none.'
1931 + string "Default synthesizer for Speakup" CONFIG_SPEAKUP_DEFAULT "none"
1932 +fi
1933 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/COPYING linux-dsd/drivers/char/speakup/COPYING
1934 --- linux-2.6.14/drivers/char/speakup/COPYING 1970-01-01 01:00:00.000000000 +0100
1935 +++ linux-dsd/drivers/char/speakup/COPYING 2005-10-28 12:24:46.000000000 +0100
1936 @@ -0,0 +1,358 @@
1937 +
1938 + NOTE! This copyright does *not* cover user programs that use kernel
1939 + services by normal system calls - this is merely considered normal use
1940 + of the kernel, and does *not* fall under the heading of "derived work".
1941 + Also note that the GPL below is copyrighted by the Free Software
1942 + Foundation, but the instance of code that it refers to (the Linux
1943 + kernel) is copyrighted by me and others who actually wrote it.
1944 +
1945 + Linus Torvalds
1946 +
1947 +----------------------------------------
1948 +
1949 +This is included for completeness of GPL for the speakup project.
1950 +Speakup is a screen review and speech synthesizer set of drivers and
1951 +patches for the Linux kernel. (Kirk Reiser)
1952 +
1953 +------------------------------------------------------------------------
1954 +
1955 + GNU GENERAL PUBLIC LICENSE
1956 + Version 2, June 1991
1957 +
1958 + Copyright (C) 1989, 1991 Free Software Foundation, Inc.
1959 + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1960 + Everyone is permitted to copy and distribute verbatim copies
1961 + of this license document, but changing it is not allowed.
1962 +
1963 + Preamble
1964 +
1965 + The licenses for most software are designed to take away your
1966 +freedom to share and change it. By contrast, the GNU General Public
1967 +License is intended to guarantee your freedom to share and change free
1968 +software--to make sure the software is free for all its users. This
1969 +General Public License applies to most of the Free Software
1970 +Foundation's software and to any other program whose authors commit to
1971 +using it. (Some other Free Software Foundation software is covered by
1972 +the GNU Library General Public License instead.) You can apply it to
1973 +your programs, too.
1974 +
1975 + When we speak of free software, we are referring to freedom, not
1976 +price. Our General Public Licenses are designed to make sure that you
1977 +have the freedom to distribute copies of free software (and charge for
1978 +this service if you wish), that you receive source code or can get it
1979 +if you want it, that you can change the software or use pieces of it
1980 +in new free programs; and that you know you can do these things.
1981 +
1982 + To protect your rights, we need to make restrictions that forbid
1983 +anyone to deny you these rights or to ask you to surrender the rights.
1984 +These restrictions translate to certain responsibilities for you if you
1985 +distribute copies of the software, or if you modify it.
1986 +
1987 + For example, if you distribute copies of such a program, whether
1988 +gratis or for a fee, you must give the recipients all the rights that
1989 +you have. You must make sure that they, too, receive or can get the
1990 +source code. And you must show them these terms so they know their
1991 +rights.
1992 +
1993 + We protect your rights with two steps: (1) copyright the software, and
1994 +(2) offer you this license which gives you legal permission to copy,
1995 +distribute and/or modify the software.
1996 +
1997 + Also, for each author's protection and ours, we want to make certain
1998 +that everyone understands that there is no warranty for this free
1999 +software. If the software is modified by someone else and passed on, we
2000 +want its recipients to know that what they have is not the original, so
2001 +that any problems introduced by others will not reflect on the original
2002 +authors' reputations.
2003 +
2004 + Finally, any free program is threatened constantly by software
2005 +patents. We wish to avoid the danger that redistributors of a free
2006 +program will individually obtain patent licenses, in effect making the
2007 +program proprietary. To prevent this, we have made it clear that any
2008 +patent must be licensed for everyone's free use or not licensed at all.
2009 +
2010 + The precise terms and conditions for copying, distribution and
2011 +modification follow.
2012 +
2013 + GNU GENERAL PUBLIC LICENSE
2014 + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
2015 +
2016 + 0. This License applies to any program or other work which contains
2017 +a notice placed by the copyright holder saying it may be distributed
2018 +under the terms of this General Public License. The "Program", below,
2019 +refers to any such program or work, and a "work based on the Program"
2020 +means either the Program or any derivative work under copyright law:
2021 +that is to say, a work containing the Program or a portion of it,
2022 +either verbatim or with modifications and/or translated into another
2023 +language. (Hereinafter, translation is included without limitation in
2024 +the term "modification".) Each licensee is addressed as "you".
2025 +
2026 +Activities other than copying, distribution and modification are not
2027 +covered by this License; they are outside its scope. The act of
2028 +running the Program is not restricted, and the output from the Program
2029 +is covered only if its contents constitute a work based on the
2030 +Program (independent of having been made by running the Program).
2031 +Whether that is true depends on what the Program does.
2032 +
2033 + 1. You may copy and distribute verbatim copies of the Program's
2034 +source code as you receive it, in any medium, provided that you
2035 +conspicuously and appropriately publish on each copy an appropriate
2036 +copyright notice and disclaimer of warranty; keep intact all the
2037 +notices that refer to this License and to the absence of any warranty;
2038 +and give any other recipients of the Program a copy of this License
2039 +along with the Program.
2040 +
2041 +You may charge a fee for the physical act of transferring a copy, and
2042 +you may at your option offer warranty protection in exchange for a fee.
2043 +
2044 + 2. You may modify your copy or copies of the Program or any portion
2045 +of it, thus forming a work based on the Program, and copy and
2046 +distribute such modifications or work under the terms of Section 1
2047 +above, provided that you also meet all of these conditions:
2048 +
2049 + a) You must cause the modified files to carry prominent notices
2050 + stating that you changed the files and the date of any change.
2051 +
2052 + b) You must cause any work that you distribute or publish, that in
2053 + whole or in part contains or is derived from the Program or any
2054 + part thereof, to be licensed as a whole at no charge to all third
2055 + parties under the terms of this License.
2056 +
2057 + c) If the modified program normally reads commands interactively
2058 + when run, you must cause it, when started running for such
2059 + interactive use in the most ordinary way, to print or display an
2060 + announcement including an appropriate copyright notice and a
2061 + notice that there is no warranty (or else, saying that you provide
2062 + a warranty) and that users may redistribute the program under
2063 + these conditions, and telling the user how to view a copy of this
2064 + License. (Exception: if the Program itself is interactive but
2065 + does not normally print such an announcement, your work based on
2066 + the Program is not required to print an announcement.)
2067 +
2068 +These requirements apply to the modified work as a whole. If
2069 +identifiable sections of that work are not derived from the Program,
2070 +and can be reasonably considered independent and separate works in
2071 +themselves, then this License, and its terms, do not apply to those
2072 +sections when you distribute them as separate works. But when you
2073 +distribute the same sections as part of a whole which is a work based
2074 +on the Program, the distribution of the whole must be on the terms of
2075 +this License, whose permissions for other licensees extend to the
2076 +entire whole, and thus to each and every part regardless of who wrote it.
2077 +
2078 +Thus, it is not the intent of this section to claim rights or contest
2079 +your rights to work written entirely by you; rather, the intent is to
2080 +exercise the right to control the distribution of derivative or
2081 +collective works based on the Program.
2082 +
2083 +In addition, mere aggregation of another work not based on the Program
2084 +with the Program (or with a work based on the Program) on a volume of
2085 +a storage or distribution medium does not bring the other work under
2086 +the scope of this License.
2087 +
2088 + 3. You may copy and distribute the Program (or a work based on it,
2089 +under Section 2) in object code or executable form under the terms of
2090 +Sections 1 and 2 above provided that you also do one of the following:
2091 +
2092 + a) Accompany it with the complete corresponding machine-readable
2093 + source code, which must be distributed under the terms of Sections
2094 + 1 and 2 above on a medium customarily used for software interchange; or,
2095 +
2096 + b) Accompany it with a written offer, valid for at least three
2097 + years, to give any third party, for a charge no more than your
2098 + cost of physically performing source distribution, a complete
2099 + machine-readable copy of the corresponding source code, to be
2100 + distributed under the terms of Sections 1 and 2 above on a medium
2101 + customarily used for software interchange; or,
2102 +
2103 + c) Accompany it with the information you received as to the offer
2104 + to distribute corresponding source code. (This alternative is
2105 + allowed only for noncommercial distribution and only if you
2106 + received the program in object code or executable form with such
2107 + an offer, in accord with Subsection b above.)
2108 +
2109 +The source code for a work means the preferred form of the work for
2110 +making modifications to it. For an executable work, complete source
2111 +code means all the source code for all modules it contains, plus any
2112 +associated interface definition files, plus the scripts used to
2113 +control compilation and installation of the executable. However, as a
2114 +special exception, the source code distributed need not include
2115 +anything that is normally distributed (in either source or binary
2116 +form) with the major components (compiler, kernel, and so on) of the
2117 +operating system on which the executable runs, unless that component
2118 +itself accompanies the executable.
2119 +
2120 +If distribution of executable or object code is made by offering
2121 +access to copy from a designated place, then offering equivalent
2122 +access to copy the source code from the same place counts as
2123 +distribution of the source code, even though third parties are not
2124 +compelled to copy the source along with the object code.
2125 +
2126 + 4. You may not copy, modify, sublicense, or distribute the Program
2127 +except as expressly provided under this License. Any attempt
2128 +otherwise to copy, modify, sublicense or distribute the Program is
2129 +void, and will automatically terminate your rights under this License.
2130 +However, parties who have received copies, or rights, from you under
2131 +this License will not have their licenses terminated so long as such
2132 +parties remain in full compliance.
2133 +
2134 + 5. You are not required to accept this License, since you have not
2135 +signed it. However, nothing else grants you permission to modify or
2136 +distribute the Program or its derivative works. These actions are
2137 +prohibited by law if you do not accept this License. Therefore, by
2138 +modifying or distributing the Program (or any work based on the
2139 +Program), you indicate your acceptance of this License to do so, and
2140 +all its terms and conditions for copying, distributing or modifying
2141 +the Program or works based on it.
2142 +
2143 + 6. Each time you redistribute the Program (or any work based on the
2144 +Program), the recipient automatically receives a license from the
2145 +original licensor to copy, distribute or modify the Program subject to
2146 +these terms and conditions. You may not impose any further
2147 +restrictions on the recipients' exercise of the rights granted herein.
2148 +You are not responsible for enforcing compliance by third parties to
2149 +this License.
2150 +
2151 + 7. If, as a consequence of a court judgment or allegation of patent
2152 +infringement or for any other reason (not limited to patent issues),
2153 +conditions are imposed on you (whether by court order, agreement or
2154 +otherwise) that contradict the conditions of this License, they do not
2155 +excuse you from the conditions of this License. If you cannot
2156 +distribute so as to satisfy simultaneously your obligations under this
2157 +License and any other pertinent obligations, then as a consequence you
2158 +may not distribute the Program at all. For example, if a patent
2159 +license would not permit royalty-free redistribution of the Program by
2160 +all those who receive copies directly or indirectly through you, then
2161 +the only way you could satisfy both it and this License would be to
2162 +refrain entirely from distribution of the Program.
2163 +
2164 +If any portion of this section is held invalid or unenforceable under
2165 +any particular circumstance, the balance of the section is intended to
2166 +apply and the section as a whole is intended to apply in other
2167 +circumstances.
2168 +
2169 +It is not the purpose of this section to induce you to infringe any
2170 +patents or other property right claims or to contest validity of any
2171 +such claims; this section has the sole purpose of protecting the
2172 +integrity of the free software distribution system, which is
2173 +implemented by public license practices. Many people have made
2174 +generous contributions to the wide range of software distributed
2175 +through that system in reliance on consistent application of that
2176 +system; it is up to the author/donor to decide if he or she is willing
2177 +to distribute software through any other system and a licensee cannot
2178 +impose that choice.
2179 +
2180 +This section is intended to make thoroughly clear what is believed to
2181 +be a consequence of the rest of this License.
2182 +
2183 + 8. If the distribution and/or use of the Program is restricted in
2184 +certain countries either by patents or by copyrighted interfaces, the
2185 +original copyright holder who places the Program under this License
2186 +may add an explicit geographical distribution limitation excluding
2187 +those countries, so that distribution is permitted only in or among
2188 +countries not thus excluded. In such case, this License incorporates
2189 +the limitation as if written in the body of this License.
2190 +
2191 + 9. The Free Software Foundation may publish revised and/or new versions
2192 +of the General Public License from time to time. Such new versions will
2193 +be similar in spirit to the present version, but may differ in detail to
2194 +address new problems or concerns.
2195 +
2196 +Each version is given a distinguishing version number. If the Program
2197 +specifies a version number of this License which applies to it and "any
2198 +later version", you have the option of following the terms and conditions
2199 +either of that version or of any later version published by the Free
2200 +Software Foundation. If the Program does not specify a version number of
2201 +this License, you may choose any version ever published by the Free Software
2202 +Foundation.
2203 +
2204 + 10. If you wish to incorporate parts of the Program into other free
2205 +programs whose distribution conditions are different, write to the author
2206 +to ask for permission. For software which is copyrighted by the Free
2207 +Software Foundation, write to the Free Software Foundation; we sometimes
2208 +make exceptions for this. Our decision will be guided by the two goals
2209 +of preserving the free status of all derivatives of our free software and
2210 +of promoting the sharing and reuse of software generally.
2211 +
2212 + NO WARRANTY
2213 +
2214 + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
2215 +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
2216 +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
2217 +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
2218 +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
2219 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
2220 +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
2221 +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
2222 +REPAIR OR CORRECTION.
2223 +
2224 + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
2225 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
2226 +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
2227 +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
2228 +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
2229 +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
2230 +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
2231 +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
2232 +POSSIBILITY OF SUCH DAMAGES.
2233 +
2234 + END OF TERMS AND CONDITIONS
2235 +
2236 + How to Apply These Terms to Your New Programs
2237 +
2238 + If you develop a new program, and you want it to be of the greatest
2239 +possible use to the public, the best way to achieve this is to make it
2240 +free software which everyone can redistribute and change under these terms.
2241 +
2242 + To do so, attach the following notices to the program. It is safest
2243 +to attach them to the start of each source file to most effectively
2244 +convey the exclusion of warranty; and each file should have at least
2245 +the "copyright" line and a pointer to where the full notice is found.
2246 +
2247 + <one line to give the program's name and a brief idea of what it does.>
2248 + Copyright (C) 19yy <name of author>
2249 +
2250 + This program is free software; you can redistribute it and/or modify
2251 + it under the terms of the GNU General Public License as published by
2252 + the Free Software Foundation; either version 2 of the License, or
2253 + (at your option) any later version.
2254 +
2255 + This program is distributed in the hope that it will be useful,
2256 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2257 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2258 + GNU General Public License for more details.
2259 +
2260 + You should have received a copy of the GNU General Public License
2261 + along with this program; if not, write to the Free Software
2262 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2263 +
2264 +
2265 +Also add information on how to contact you by electronic and paper mail.
2266 +
2267 +If the program is interactive, make it output a short notice like this
2268 +when it starts in an interactive mode:
2269 +
2270 + Gnomovision version 69, Copyright (C) 19yy name of author
2271 + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
2272 + This is free software, and you are welcome to redistribute it
2273 + under certain conditions; type `show c' for details.
2274 +
2275 +The hypothetical commands `show w' and `show c' should show the appropriate
2276 +parts of the General Public License. Of course, the commands you use may
2277 +be called something other than `show w' and `show c'; they could even be
2278 +mouse-clicks or menu items--whatever suits your program.
2279 +
2280 +You should also get your employer (if you work as a programmer) or your
2281 +school, if any, to sign a "copyright disclaimer" for the program, if
2282 +necessary. Here is a sample; alter the names:
2283 +
2284 + Yoyodyne, Inc., hereby disclaims all copyright interest in the program
2285 + `Gnomovision' (which makes passes at compilers) written by James Hacker.
2286 +
2287 + <signature of Ty Coon>, 1 April 1989
2288 + Ty Coon, President of Vice
2289 +
2290 +This General Public License does not permit incorporating your program into
2291 +proprietary programs. If your program is a subroutine library, you may
2292 +consider it more useful to permit linking proprietary applications with the
2293 +library. If this is what you want to do, use the GNU Library General
2294 +Public License instead of this License.
2295 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/cvsversion.h linux-dsd/drivers/char/speakup/cvsversion.h
2296 --- linux-2.6.14/drivers/char/speakup/cvsversion.h 1970-01-01 01:00:00.000000000 +0100
2297 +++ linux-dsd/drivers/char/speakup/cvsversion.h 2005-10-28 12:24:46.000000000 +0100
2298 @@ -0,0 +1 @@
2299 +#define CVSVERSION " CVS: Wed Oct 26 15:13:02 EDT 2005 "
2300 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/dtload.c linux-dsd/drivers/char/speakup/dtload.c
2301 --- linux-2.6.14/drivers/char/speakup/dtload.c 1970-01-01 01:00:00.000000000 +0100
2302 +++ linux-dsd/drivers/char/speakup/dtload.c 2005-10-28 12:24:46.000000000 +0100
2303 @@ -0,0 +1,554 @@
2304 +/*
2305 + * This is the DECtalk PC firmware loader for the Linux kernel, version 1.0
2306 + *
2307 + * Original 386BSD source:
2308 + * Copyright ( c ) 1996 Brian Buhrow <buhrow@lothlorien.nfbcal.org>
2309 + *
2310 + * Adapted for Linux:
2311 + * Copyright ( c ) 1997 Nicolas Pitre <nico@cam.org>
2312 + *
2313 + * Adapted for speakup:
2314 + * Copyright ( c ) 2003 David Borowski <david575@golden.net>
2315 + *
2316 + * All rights reserved.
2317 + *
2318 + * This program is free software; you can redistribute it and/or modify
2319 + * it under the terms of the GNU General Public License as published by
2320 + * the Free Software Foundation; either version 2 of the License, or
2321 + * ( at your option ) any later version.
2322 + *
2323 + * This program is distributed in the hope that it will be useful,
2324 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2325 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2326 + * GNU General Public License for more details.
2327 + *
2328 + * You should have received a copy of the GNU General Public License
2329 + * along with this program; if not, write to the Free Software
2330 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2331 + *
2332 + */
2333 +
2334 +#include <stdio.h>
2335 +#include <stdlib.h>
2336 +#include <unistd.h>
2337 +#include <string.h>
2338 +#include <sys/types.h>
2339 +#include <sys/stat.h>
2340 +#include <fcntl.h>
2341 +#include <malloc.h>
2342 +#include <sys/errno.h>
2343 +#include <asm/io.h>
2344 +#include "dtload.h"
2345 +#include "dtpc_reg.h"
2346 +
2347 +#define dt_delay(x) usleep(x)
2348 +int verbose = 0, intest = 0,infd = -1;
2349 +int image_len, total_paras;
2350 +int dt_stat, dma_state = 0, has_kernel = 0;
2351 +struct dos_reloc fixups[512];
2352 +char *read_buff = NULL;
2353 +struct dos_exe_header header;
2354 +u_short iobase = 0x350;
2355 +
2356 +static inline int dt_getstatus( )
2357 +{
2358 + dt_stat = inb_p( iobase )|(inb_p( iobase+1 )<<8);
2359 + return dt_stat;
2360 +}
2361 +
2362 +static void dt_sendcmd( u_int cmd )
2363 +{
2364 + outb_p( cmd & 0xFF, iobase );
2365 + outb_p( (cmd>>8) & 0xFF, iobase+1 );
2366 +}
2367 +
2368 +static int dt_waitbit( int bit )
2369 +{
2370 + int timeout = 100;
2371 + while ( --timeout > 0 ) {
2372 + if( (dt_getstatus( ) & bit ) == bit ) return 1;
2373 + usleep( 1000 );
2374 + }
2375 + return 0;
2376 +}
2377 +
2378 +static int dt_sendcmd_wait( u_int cmd, int bit )
2379 +{
2380 + int timeout = 1000;
2381 + outb_p( cmd & 0xFF, iobase );
2382 + outb_p( (cmd>>8) & 0xFF, iobase+1 );
2383 + while ( --timeout > 0 ) {
2384 + if( (dt_getstatus( ) & bit ) == bit ) return 1;
2385 + usleep( 1000 );
2386 + }
2387 + return 0;
2388 +}
2389 +
2390 +static int dt_waitmode( int pattern )
2391 +{
2392 + int timeout = 1000;
2393 + while ( --timeout > 0 ) {
2394 + if( dt_getstatus( ) == pattern ) return 1;
2395 + usleep( 1000 );
2396 + }
2397 + fprintf( stderr, "waitmode p=%x s = %x\n", pattern, dt_stat );
2398 + return 0;
2399 +}
2400 +
2401 +static int dt_wait_dma( )
2402 +{
2403 + int timeout = 1000, state = dma_state;
2404 + if( !has_kernel ){
2405 + dt_delay( 500 );
2406 + return( dt_waitbit( STAT_dma_ready ) );
2407 + }
2408 + if( ! dt_waitbit( STAT_dma_ready ) ) return 0;
2409 + while ( --timeout > 0 ) {
2410 + if( (dt_getstatus()&STAT_dma_state) == state ) return 1;
2411 + usleep( 1000 );
2412 + }
2413 + dma_state = dt_getstatus( ) & STAT_dma_state;
2414 + return 1;
2415 +}
2416 +
2417 +dt_ctrl( u_int cmd )
2418 +{
2419 + while ( ! dt_waitbit( STAT_cmd_ready ) ) dt_delay( 100 );
2420 + outb_p( 0, iobase+2 );
2421 + outb_p( 0, iobase+3 );
2422 + dt_getstatus( );
2423 + dt_sendcmd( CMD_control|cmd );
2424 + outb_p( 0, iobase+6 );
2425 + dt_delay( 100 );
2426 + dt_sendcmd( CMD_null );
2427 + while ( ! dt_waitbit( STAT_cmd_ready ) ) dt_delay( 100 );
2428 +}
2429 +
2430 +int dt_flush( void )
2431 +{
2432 + dt_ctrl( CTRL_flush );
2433 + dt_waitbit( STAT_dma_ready );
2434 + outb_p( DMA_sync, iobase+4 );
2435 + outb_p( 0, iobase+4 );
2436 + dma_state ^= STAT_dma_state;
2437 + while( dt_getstatus( ) & STAT_flushing ) dt_delay( 100 );
2438 + return 0;
2439 +}
2440 +
2441 +static int dt_sendbuff( char *src, int len )
2442 +{
2443 + while( len-- ){
2444 + if( ! dt_wait_dma( ) ) return -1;
2445 + if( ! (dt_getstatus( ) & STAT_rr_char) ) break;
2446 + outb_p( DMA_single_in, iobase+4 );
2447 + outb_p( *src++, iobase+4 );
2448 + dma_state ^= STAT_dma_state;
2449 + }
2450 + return 0;
2451 +}
2452 +
2453 +unsigned long dt_allocmem( unsigned long paras )
2454 +{
2455 + unsigned long addr;
2456 + if( ! dt_wait_dma( ) ) return 0;
2457 + outb_p( DMA_control, iobase+4 );
2458 + outb_p( DT_MEM_ALLOC, iobase+4 );
2459 + dma_state ^= STAT_dma_state;
2460 + if( ! dt_wait_dma( ) ) return 0;
2461 + outb_p( paras & 0xFF, iobase+4 );
2462 + outb_p( (paras>>8) & 0xFF, iobase+4 );
2463 + dma_state ^= STAT_dma_state;
2464 + if( ! dt_wait_dma( ) ) return 0;
2465 + addr = inb_p( iobase+4 );
2466 + addr |= (inb_p( iobase+4 )<<8);
2467 + addr += (inb_p( iobase+4 )<<4);
2468 + addr += (inb_p( iobase+4 )<<12);
2469 + dma_state ^= STAT_dma_state;
2470 + return addr;
2471 +}
2472 +
2473 +static int testkernel( void )
2474 +{
2475 + dt_sendcmd( CMD_sync );
2476 + if( ! dt_waitbit( STAT_cmd_ready ) ) return -10;
2477 + has_kernel = ( dt_stat&0x8000 ) ? 1 : 0;
2478 + if ( verbose ) printf( "testkernel got %x\n", dt_stat );
2479 + if ( has_kernel ) return 0;
2480 + dt_delay( 100 );
2481 + return 1;
2482 +}
2483 +
2484 +static int dt_loadmem( int addr, int len, char *src )
2485 +{
2486 + char c;
2487 + int l;
2488 + if ( verbose ) printf( "dt_loadmem: addr = %08X size = %d\n", addr, len );
2489 + do {
2490 + l = len;
2491 + if ( l >= 0xc000 ) l = 0xc000;
2492 + len -= l;
2493 + if( ! dt_wait_dma( ) ) return -1;
2494 + outb_p( DMA_control, iobase+4 );
2495 + outb_p( DT_LOAD_MEM, iobase+4 );
2496 + dma_state ^= STAT_dma_state;
2497 + if( ! dt_wait_dma( ) ) return -2;
2498 + outb_p( addr & 0xFF, iobase+4 );
2499 + outb_p( (addr>>8) & 0xFF, iobase+4 );
2500 + outb_p( (addr>>16) & 0xFF, iobase+4 );
2501 + outb_p( (addr>>24) & 0xFF, iobase+4 );
2502 + outb_p( l & 0xFF, iobase+4 );
2503 + outb_p( (l>>8) & 0xFF, iobase+4 );
2504 + dma_state ^= STAT_dma_state;
2505 + if( ! dt_wait_dma( ) ) return -3;
2506 + addr += l;
2507 + while( l-- ){
2508 + c = *src++;
2509 + outb_p( c, iobase+4 );
2510 + }
2511 + dma_state ^= STAT_dma_state;
2512 + } while ( len > 0 );
2513 + return 0;
2514 +}
2515 +
2516 +unsigned int loadfile ( char *filename )
2517 +{
2518 + int i, header_size;
2519 + unsigned int total_paras;
2520 + long fix;
2521 + infd = open ( filename, O_RDONLY );
2522 + if ( infd == -1 ) {
2523 + perror ( "Opening file: " );
2524 + return 0;
2525 + }
2526 + read ( infd, &header, sizeof ( struct dos_exe_header ) );
2527 + if ( header.id != 0x5a4d ) {
2528 + fprintf ( stderr, "Invalid header file format\n" );
2529 + fprintf ( stderr, "Want 0x5a4d, got 0x%x\n", header.id );
2530 + return 0;
2531 + }
2532 + if ( header.relen > MAX_FIXUPS ) {
2533 + fprintf ( stderr, "Too many fixups\n" );
2534 + return 0;
2535 + }
2536 + lseek ( infd, ( long ) header.reloc, SEEK_SET );
2537 + read ( infd, fixups, sizeof ( struct dos_reloc ) * header.relen );
2538 + header_size = header.hsize * 16;
2539 + lseek ( infd, ( long )header_size, SEEK_SET );
2540 + image_len = ( ( header.pages-1 )*512 ) + ( header.rem- header_size );
2541 + total_paras = ( image_len >> 4 ) + header.hmin + 16;
2542 + read ( infd, read_buff, image_len );
2543 + close( infd );
2544 + return total_paras;
2545 +}
2546 +
2547 +static int loadkernel( char *filename )
2548 +{
2549 + int segfix = 0x40, fix, i;
2550 + int ipval, csval;
2551 + if ( has_kernel ) return 0;
2552 + if ( !loadfile( filename ) ) return -1;
2553 + header.csval += segfix;
2554 + header.ssval += segfix;
2555 + if ( verbose ) {
2556 + printf ( "Loading kernel of %ld bytes ( %d relocs )\n",
2557 + image_len, header.relen );
2558 + printf ( " cs:ip == %04x:%04x ss:sp == %04x:%04x\n",
2559 + header.csval, header.ipval, header.ssval, header.spval );
2560 + }
2561 + for ( i = 0; i < header.relen; i++ ) {
2562 + fix = ( fixups[i].segment << 4 ) + fixups[i].offset;
2563 + ( *( unsigned int * ) &read_buff[fix] ) += segfix;
2564 + }
2565 + csval = header.csval;
2566 + ipval = header.ipval;
2567 + dt_sendcmd_wait( MODULE_reset, MODULE_init );
2568 + dt_sendcmd( CMD_reset );
2569 + if( dt_getstatus( ) == MODULE_self_test ){
2570 + if( ! dt_waitmode( MODULE_init ) ) return -1;
2571 + }
2572 + if ( !dt_sendcmd_wait( CMD_reset, MODE_status ) ) return -2;
2573 + if ( !dt_sendcmd_wait( CMD_sync, MODE_error ) ) return -3;
2574 + if ( !dt_sendcmd_wait( CMD_reset, MODE_status ) ) return -4;
2575 + if ( verbose ) printf( "card is ready\n" );
2576 + dt_sendcmd( CMD_dma );
2577 + if( ! dt_waitbit( STAT_dma_ready ) ) return -5;
2578 + if( ( i = dt_loadmem( 0x00000400, image_len, read_buff ) ) ) {
2579 + fprintf( stderr, "kernel load failed, status %d\n", i );
2580 + return -6;
2581 + }
2582 + dt_delay( 100 );
2583 + /* the kernel is loaded, start it */
2584 + if ( !dt_sendcmd_wait( CMD_reset, MODE_status ) ) return -7;
2585 + dt_sendcmd( CMD_dma+1 ); /**xxx**/
2586 + dt_delay( 100 );
2587 + if( ! dt_waitbit( STAT_dma_ready ) ) return-8;
2588 + outb_p( DMA_control, iobase+4 );
2589 + outb_p( DT_START_TASK, iobase+4 );
2590 + dt_delay( 100 );
2591 + outb_p( ipval & 0xFF, iobase+4 );
2592 + outb_p( (ipval>>8) & 0xFF, iobase+4 );
2593 + outb_p( csval & 0xFF, iobase+4 );
2594 + outb_p( (csval>>8) & 0xFF, iobase+4 );
2595 + if( ! dt_waitmode( 0xc001 ) ) return -9;
2596 + if ( verbose ) {
2597 + printf( "done loading kernel\n" );
2598 + }
2599 + return testkernel( );
2600 +}
2601 +
2602 +int loaddict ( char *filename, char *name, int type )
2603 +{
2604 + int i, read_index, read_size, act_size;
2605 + unsigned short *index_fix, seg_fix;
2606 + unsigned long entries, index, dic_bytes, dic_addr;
2607 + unsigned int total_paras;
2608 + unsigned long param, l;
2609 + infd = open ( filename, O_RDONLY );
2610 + if ( infd == -1 ) {
2611 + perror ( filename );
2612 + return -1;
2613 + }
2614 +/* read in the entry count and the actual entry size excluding the
2615 + * index table ( which is entries * 4 ) ... */
2616 + read ( infd, &entries, 4 );
2617 + read ( infd, &dic_bytes, 4 );
2618 + if ( verbose )
2619 + printf ( "Loading %s dictionary of %lu entries, %lu bytes.\n",
2620 + name, entries, dic_bytes );
2621 + total_paras = ( ( ( entries * 4 ) + dic_bytes ) >> 4 ) + 2;
2622 + if ( verbose )
2623 + printf ( "Allocating %d paragraphs of free ram ...\n", total_paras );
2624 + l = dt_allocmem( total_paras );
2625 + if ( l == 0 ) {
2626 + perror ( "Error requesting memory from speech device" );
2627 + return -1;
2628 + }
2629 + seg_fix = ( l >> 4 ) & 0xffff;
2630 + dic_addr = l;
2631 + index = entries;
2632 + index_fix = ( unsigned short * ) &read_buff[0];
2633 + if ( verbose )
2634 + printf ( "Index table starts at %lx\n", l );
2635 + read_index = index*4;
2636 + act_size = read ( infd, read_buff, read_index );
2637 + if ( act_size != read_index ) {
2638 + fprintf ( stderr, "\nError reading indexes\n" );
2639 + fprintf ( stderr, " exp : %d act : %d\n", read_index * 4, act_size );
2640 + return -1;
2641 + }
2642 + for ( i = 1; i < index * 2; i += 2 )
2643 + index_fix[i] += seg_fix;
2644 + if( ( i = dt_loadmem( l, read_index, read_buff ) ) ) {
2645 + fprintf ( stderr, "\nError loading indexes at 0x%lX: i %d\n",
2646 + l, i );
2647 + return -1;
2648 + }
2649 + l += read_index;
2650 +/* now, load up the dictionary bytes ... */
2651 + if ( verbose )
2652 + printf ( "Dictionary text starts at %lx\n", l );
2653 + read_size = dic_bytes;
2654 + if ( ( act_size = read ( infd, read_buff, read_size ) ) != read_size ) {
2655 + fprintf ( stderr, "\nError reading dictionary text!\n" );
2656 + fprintf ( stderr, "asked : %d actual : %d\n", act_size, read_size );
2657 + return -1;
2658 + }
2659 + if( ( i = dt_loadmem( l, read_size, read_buff ) ) ) {
2660 + fprintf ( stderr, "\nError loading dictionary at 0x%lX: status %d\n",
2661 + l, i );
2662 + return -1;
2663 + }
2664 + if( ! dt_wait_dma( ) ) return -1;
2665 + outb_p( DMA_control, iobase+4 );
2666 + outb_p( DT_SET_DIC, iobase+4 );
2667 + dma_state ^= STAT_dma_state;
2668 + if( ! dt_wait_dma( ) ) return -1;
2669 + l = dic_addr;
2670 + l = ((l << 12) & 0xFFFF0000) + (l & 0x0000000F);
2671 + outb_p( l & 0xFF, iobase+4 );
2672 + outb_p( (l>>8) & 0xFF, iobase+4 );
2673 + outb_p( (l>>16) & 0xFF, iobase+4 );
2674 + outb_p( (l>>24) & 0xFF, iobase+4 );
2675 + l = entries;
2676 + outb_p( l & 0xFF, iobase+4 );
2677 + outb_p( (l>>8) & 0xFF, iobase+4 );
2678 + outb_p( (l>>16) & 0xFF, iobase+4 );
2679 + outb_p( (l>>24) & 0xFF, iobase+4 );
2680 + l = type;
2681 + outb_p( l & 0xFF, iobase+4 );
2682 + outb_p( (l>>8) & 0xFF, iobase+4 );
2683 + dma_state ^= STAT_dma_state;
2684 + close ( infd );
2685 + if ( verbose ) printf( "dictionary load complete\n" );
2686 + return 0;
2687 +}
2688 +
2689 +int loadexe ( char *filename )
2690 +{
2691 + unsigned int load_addr = 0, seg_fix;
2692 + int i, read_size;
2693 + int ipval, csval;
2694 + long fix;
2695 + unsigned long total_paras;
2696 + total_paras = loadfile ( filename );
2697 + if ( total_paras == 0 ) return -1;
2698 + load_addr = dt_allocmem( total_paras );
2699 + if ( load_addr == 0 ) {
2700 + fprintf ( stderr, "Error allocating memory on card: " );
2701 + return -1;
2702 + }
2703 + seg_fix = ( load_addr >> 4 ) & 0xffff;
2704 + if ( verbose ) {
2705 + printf ( "Loading %s %ld bytes ( %d relocs )\n",
2706 + filename, image_len, header.relen );
2707 + printf ( "Allocating %ld bytes of free ram at %05x\n",
2708 + ( long ) header.hmin * 16, load_addr );
2709 + printf ( "Total memory taken is %ld bytes\n", ( long ) total_paras * 16 );
2710 + printf ( " cs:ip == %04x:%04x ss:sp == %04x:%04x\n",
2711 + header.csval + seg_fix, header.ipval, header.ssval + seg_fix, header.spval );
2712 + }
2713 + for ( i = 0; i < header.relen; i++ ) {
2714 + fix = ( ( long ) fixups[i].segment << 4 ) + ( long ) fixups[i].offset;
2715 + ( *( unsigned int * ) &read_buff[fix] ) += seg_fix;
2716 + }
2717 + if( ( i = dt_loadmem( load_addr, image_len, read_buff ) ) ) {
2718 + fprintf ( stderr, "Error loading speech device at 0x%lX: status %d\n",
2719 + load_addr, i );
2720 + return -1;
2721 + }
2722 + csval = header.csval + seg_fix;
2723 + ipval = header.ipval;
2724 + if( ! dt_wait_dma( ) ) return -1;
2725 + outb_p( DMA_control, iobase+4 );
2726 + outb_p( DT_START_TASK, iobase+4 );
2727 + dma_state ^= STAT_dma_state;
2728 + if( ! dt_wait_dma( ) ) return -1;
2729 + outb_p( ipval & 0xFF, iobase+4 );
2730 + outb_p( (ipval>>8) & 0xFF, iobase+4 );
2731 + outb_p( csval & 0xFF, iobase+4 );
2732 + outb_p( (csval>>8) & 0xFF, iobase+4 );
2733 + dma_state ^= STAT_dma_state;
2734 + return 0;
2735 +}
2736 +
2737 +void release_io( void )
2738 +{
2739 + ioperm( (long)iobase, 8, 0 );
2740 + ioperm( (long)0x0080, 1, 0 );
2741 + if ( read_buff ) free( read_buff );
2742 +}
2743 +
2744 +parseparm( char *parm, char *value )
2745 +{
2746 + char *cp = parm+strlen( parm );
2747 + while ( --cp > parm ) if ( *cp > ' ' ) break;
2748 + cp[1] = '\0';
2749 + if ( !strcmp( parm, "io" ) ) {
2750 + long io = strtol( value, 0, 0 );
2751 + if ( io >= 0x100 && io <= 0x350 ) {
2752 + iobase = (u_short)io;
2753 + return;
2754 + }
2755 + fprintf( stderr, "invalid io value %s\n", value );
2756 + exit( 1 );
2757 + } else if ( !strcmp( parm,"verbose" ) ) {
2758 + verbose = atoi( value );
2759 + }
2760 +}
2761 +
2762 +do_test( void )
2763 +{
2764 + char buffer[512];
2765 + int len;
2766 + dma_state = dt_getstatus( ) & STAT_dma_state;
2767 + while ( fgets( buffer, 510, stdin ) ) {
2768 + len = strlen( buffer );
2769 + if ( len == 1 ) dt_flush( );
2770 + else {
2771 + if ( buffer[len-1] == '\n' ) buffer[len-1] = '\013';
2772 + dt_sendbuff( buffer, len );
2773 + }
2774 + }
2775 + *buffer = '\013';
2776 + dt_sendbuff( buffer, 1 );
2777 +}
2778 +
2779 +int main ( int argc, char **argv )
2780 +{
2781 + char name[80], *cp;
2782 + char *dirname = 0, *confname = "dec_pc.conf";
2783 + char *init_msg = "[:ra 360] dec pc initialized\011";
2784 + FILE *confile;
2785 + struct stat statbuf;
2786 + int maxsize = 0, status = 0;
2787 + while ( --argc > 0 ) {
2788 + argv++;
2789 + if ( !strcmp( *argv, "-v" ) ) verbose = 1;
2790 + else if ( !strcmp( *argv, "-t" ) ) intest = 1;
2791 + else dirname = *argv;
2792 + }
2793 + if ( !dirname ) dirname = "/usr/local/lib/dec_pc";
2794 + if ( chdir( dirname ) != 0 ) {
2795 + fprintf( stderr, "cannot chdir to %s\n", dirname );
2796 + exit( 1 );
2797 + }
2798 + if ( !( confile = fopen( confname, "r" ) ) ) {
2799 + fprintf( stderr, "could not open %s", confname );
2800 + exit( 1 );
2801 + }
2802 + while ( fgets( name, 80, confile ) ) {
2803 + cp = strchr( name, '\n' );
2804 + if ( cp ) *cp = '\0';
2805 + if ( ( cp = strchr( name, '=' ) ) ) {
2806 + *cp++ = '\0';
2807 + parseparm( name, cp );
2808 + continue;
2809 + }
2810 + if ( stat( name, &statbuf ) != 0 ) {
2811 + fprintf( stderr, "cannot stat %s\n", name );
2812 + exit( 1 );
2813 + }
2814 + if ( statbuf.st_size > maxsize ) maxsize = statbuf.st_size;
2815 + }
2816 + rewind( confile );
2817 + if ( ioperm( (long)0x0080, 1, 1 ) || ioperm( (long)iobase, 8, 1 ) ) {
2818 + fprintf( stderr, "could not get ioperm\n" );
2819 + exit( 1 );
2820 + }
2821 + atexit( release_io );
2822 + if ( testkernel( ) == 0 ) {
2823 + if ( intest ) do_test( );
2824 + else fprintf( stderr, "kernel already loaded\n" );
2825 + exit( 0 );
2826 + }
2827 + read_buff = malloc( maxsize );
2828 + if ( !read_buff ) {
2829 + fprintf( stderr, "cannot malloc %d bytes\n", maxsize );
2830 + exit( 1 );
2831 + }
2832 + while ( fgets( name, 80, confile ) && !status ) {
2833 + cp = strchr( name, '\n' );
2834 + if ( cp ) *cp = '\0';
2835 + if ( strchr( name, '=' ) ) continue; /* a parameter */
2836 + if ( !( cp = strchr( name, '.' ) ) ) continue;
2837 + cp++;
2838 + if ( !strcmp ( cp, "dic" ) ) {
2839 + status = loaddict ( name, "primary", PRIMARY_DIC );
2840 + } else if ( !strcmp ( cp, "dtu" ) ) {
2841 + status = loaddict ( name, "user", USER_DIC );
2842 + } else if ( !strcmp ( cp, "dta" ) ) {
2843 + status = loaddict ( name, "abbreviation file", ABBREV_DIC );
2844 + } else if ( !strcmp ( cp, "exe" ) ) {
2845 + status = loadexe ( name );
2846 + } else if ( !strcmp ( cp, "sys" ) ) {
2847 + status = loadkernel ( name );
2848 + }
2849 + }
2850 + if ( status ) fprintf( stderr, "status %d\n", status );
2851 + fclose( confile );
2852 + if ( status ) exit( status );
2853 + dt_sendbuff( init_msg, strlen( init_msg ) );
2854 + sleep( 1 );
2855 + if ( intest ) do_test( );
2856 + exit( 0 );
2857 +}
2858 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/dtload.h linux-dsd/drivers/char/speakup/dtload.h
2859 --- linux-2.6.14/drivers/char/speakup/dtload.h 1970-01-01 01:00:00.000000000 +0100
2860 +++ linux-dsd/drivers/char/speakup/dtload.h 2005-10-28 12:24:46.000000000 +0100
2861 @@ -0,0 +1,57 @@
2862 +/*
2863 + * This is the DECtalk PC firmware loader for the Linux kernel, version 1.0
2864 + *
2865 + * Original 386BSD source:
2866 + * Copyright (c) 1996 Brian Buhrow <buhrow@lothlorien.nfbcal.org>
2867 + *
2868 + * Adapted for Linux:
2869 + * Copyright (c) 1997 Nicolas Pitre <nico@cam.org>
2870 + *
2871 + * Adapted for speakup:
2872 + * Copyright (c) 2003 David Borowski <david575@golden.net>
2873 + *
2874 + * All rights reserved.
2875 + *
2876 + * This program is free software; you can redistribute it and/or modify
2877 + * it under the terms of the GNU General Public License as published by
2878 + * the Free Software Foundation; either version 2 of the License, or
2879 + * (at your option) any later version.
2880 + *
2881 + * This program is distributed in the hope that it will be useful,
2882 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2883 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2884 + * GNU General Public License for more details.
2885 + *
2886 + * You should have received a copy of the GNU General Public License
2887 + * along with this program; if not, write to the Free Software
2888 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2889 + *
2890 + */
2891 +
2892 +#define MAX_FIXUPS 512 /* maximum fixups per exe */
2893 +/*
2894 + * msdos .exe files will look like ...
2895 + */
2896 +
2897 +struct dos_exe_header {
2898 + unsigned short id; /* Linker's signature, must be 0x5a4d */
2899 + unsigned short rem; /* length of image mod 512 */
2900 + unsigned short pages; /* length of image in pages of 512 bytes */
2901 + unsigned short relen; /* number of relocation items */
2902 + unsigned short hsize; /* header size in paragraphs of 16 bytes */
2903 + unsigned short hmin; /* min # of paragraphs above prog end */
2904 + unsigned short hmax;
2905 + unsigned short ssval;
2906 + unsigned short spval; /* to be loaded in sp */
2907 + unsigned short checksum;
2908 + unsigned short ipval; /* to be loaded in ip */
2909 + unsigned short csval; /* segment offset to code */
2910 + unsigned short reloc; /* location of relocation items */
2911 + unsigned short ovrlay; /* overlay number */
2912 +};
2913 +
2914 +/* a dos relocation element looks like */
2915 +
2916 +struct dos_reloc {
2917 + short int offset, segment;
2918 +};
2919 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/dtpc_reg.h linux-dsd/drivers/char/speakup/dtpc_reg.h
2920 --- linux-2.6.14/drivers/char/speakup/dtpc_reg.h 1970-01-01 01:00:00.000000000 +0100
2921 +++ linux-dsd/drivers/char/speakup/dtpc_reg.h 2005-10-28 12:24:46.000000000 +0100
2922 @@ -0,0 +1,132 @@
2923 +/*
2924 + * This is the DECtalk PC register constants (from DEC's DOS driver)
2925 + *
2926 + * Original code:
2927 + * Copyright (c) by Digital Equipment Corp.
2928 + *
2929 + * 386BSD DECtalk PC driver:
2930 + * Copyright (c) 1996 Brian Buhrow <buhrow@lothlorien.nfbcal.org>
2931 + *
2932 + * Linux DECtalk PC driver:
2933 + * Copyright (c) 1997 Nicolas Pitre <nico@cam.org>
2934 + *
2935 + * speakup DECtalk PC driver:
2936 + * Copyright (c) 2003 David Borowski <david575@golden.net>
2937 + *
2938 + * All rights reserved.
2939 + *
2940 + * This program is free software; you can redistribute it and/or modify
2941 + * it under the terms of the GNU General Public License as published by
2942 + * the Free Software Foundation; either version 2 of the License, or
2943 + * (at your option) any later version.
2944 + *
2945 + * This program is distributed in the hope that it will be useful,
2946 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2947 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2948 + * GNU General Public License for more details.
2949 + *
2950 + * You should have received a copy of the GNU General Public License
2951 + * along with this program; if not, write to the Free Software
2952 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2953 + *
2954 + */
2955 +
2956 +/*
2957 + * port interface defs ... used by dtpc.c
2958 + */
2959 +
2960 +#define MODULE_init 0x0dec /* module in boot code */
2961 +#define MODULE_self_test 0x8800 /* module in self-test */
2962 +#define MODULE_reset 0xffff /* reinit the whole module */
2963 +
2964 +#define MODE_mask 0xf000 /* mode bits in high nibble */
2965 +#define MODE_null 0x0000
2966 +#define MODE_test 0x2000 /* in testing mode */
2967 +#define MODE_status 0x8000
2968 +#define STAT_int 0x0001 /* running in interrupt mode */
2969 +#define STAT_tr_char 0x0002 /* character data to transmit */
2970 +#define STAT_rr_char 0x0004 /* ready to receive char data */
2971 +#define STAT_cmd_ready 0x0008 /* ready to accept commands */
2972 +#define STAT_dma_ready 0x0010 /* dma command ready */
2973 +#define STAT_digitized 0x0020 /* spc in digitized mode */
2974 +#define STAT_new_index 0x0040 /* new last index ready */
2975 +#define STAT_new_status 0x0080 /* new status posted */
2976 +#define STAT_dma_state 0x0100 /* dma state toggle */
2977 +#define STAT_index_valid 0x0200 /* indexs are valid */
2978 +#define STAT_flushing 0x0400 /* flush in progress */
2979 +#define STAT_self_test 0x0800 /* module in self test */
2980 +#define MODE_ready 0xc000 /* module ready for next phase */
2981 +#define READY_boot 0x0000
2982 +#define READY_kernel 0x0001
2983 +#define MODE_error 0xf000
2984 +
2985 +#define CMD_mask 0xf000 /* mask for command nibble */
2986 +#define CMD_null 0x0000 /* post status */
2987 +#define CMD_control 0x1000 /* hard control command */
2988 +#define CTRL_mask 0x0F00 /* mask off control nibble */
2989 +#define CTRL_data 0x00FF /* madk to get data byte */
2990 +#define CTRL_null 0x0000 /* null control */
2991 +#define CTRL_vol_up 0x0100 /* increase volume */
2992 +#define CTRL_vol_down 0x0200 /* decrease volume */
2993 +#define CTRL_vol_set 0x0300 /* set volume */
2994 +#define CTRL_pause 0x0400 /* pause spc */
2995 +#define CTRL_resume 0x0500 /* resume spc clock */
2996 +#define CTRL_resume_spc 0x0001 /* resume spc soft pause */
2997 +#define CTRL_flush 0x0600 /* flush all buffers */
2998 +#define CTRL_int_enable 0x0700 /* enable status change ints */
2999 +#define CTRL_buff_free 0x0800 /* buffer remain count */
3000 +#define CTRL_buff_used 0x0900 /* buffer in use */
3001 +#define CTRL_speech 0x0a00 /* immediate speech change */
3002 +#define CTRL_SP_voice 0x0001 /* voice change */
3003 +#define CTRL_SP_rate 0x0002 /* rate change */
3004 +#define CTRL_SP_comma 0x0003 /* comma pause change */
3005 +#define CTRL_SP_period 0x0004 /* period pause change */
3006 +#define CTRL_SP_rate_delta 0x0005 /* delta rate change */
3007 +#define CTRL_SP_get_param 0x0006 /* return the desired parameter */
3008 +#define CTRL_last_index 0x0b00 /* get last index spoken */
3009 +#define CTRL_io_priority 0x0c00 /* change i/o priority */
3010 +#define CTRL_free_mem 0x0d00 /* get free paragraphs on module */
3011 +#define CTRL_get_lang 0x0e00 /* return bit mask of loaded languages */
3012 +#define CMD_test 0x2000 /* self-test request */
3013 +#define TEST_mask 0x0F00 /* isolate test field */
3014 +#define TEST_null 0x0000 /* no test requested */
3015 +#define TEST_isa_int 0x0100 /* assert isa irq */
3016 +#define TEST_echo 0x0200 /* make data in == data out */
3017 +#define TEST_seg 0x0300 /* set peek/poke segment */
3018 +#define TEST_off 0x0400 /* set peek/poke offset */
3019 +#define TEST_peek 0x0500 /* data out == *peek */
3020 +#define TEST_poke 0x0600 /* *peek == data in */
3021 +#define TEST_sub_code 0x00FF /* user defined test sub codes */
3022 +#define CMD_id 0x3000 /* return software id */
3023 +#define ID_null 0x0000 /* null id */
3024 +#define ID_kernel 0x0100 /* kernel code executing */
3025 +#define ID_boot 0x0200 /* boot code executing */
3026 +#define CMD_dma 0x4000 /* force a dma start */
3027 +#define CMD_reset 0x5000 /* reset module status */
3028 +#define CMD_sync 0x6000 /* kernel sync command */
3029 +#define CMD_char_in 0x7000 /* single character send */
3030 +#define CMD_char_out 0x8000 /* single character get */
3031 +#define CHAR_count_1 0x0100 /* one char in cmd_low */
3032 +#define CHAR_count_2 0x0200 /* the second in data_low */
3033 +#define CHAR_count_3 0x0300 /* the third in data_high */
3034 +#define CMD_spc_mode 0x9000 /* change spc mode */
3035 +#define CMD_spc_to_text 0x0100 /* set to text mode */
3036 +#define CMD_spc_to_digit 0x0200 /* set to digital mode */
3037 +#define CMD_spc_rate 0x0400 /* change spc data rate */
3038 +#define CMD_error 0xf000 /* severe error */
3039 +
3040 +enum { PRIMARY_DIC = 0, USER_DIC, COMMAND_DIC, ABBREV_DIC };
3041 +
3042 +#define DMA_single_in 0x01
3043 +#define DMA_single_out 0x02
3044 +#define DMA_buff_in 0x03
3045 +#define DMA_buff_out 0x04
3046 +#define DMA_control 0x05
3047 +#define DT_MEM_ALLOC 0x03
3048 +#define DT_SET_DIC 0x04
3049 +#define DT_START_TASK 0x05
3050 +#define DT_LOAD_MEM 0x06
3051 +#define DT_READ_MEM 0x07
3052 +#define DT_DIGITAL_IN 0x08
3053 +#define DMA_sync 0x06
3054 +#define DMA_sync_char 0x07
3055 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/genmap.c linux-dsd/drivers/char/speakup/genmap.c
3056 --- linux-2.6.14/drivers/char/speakup/genmap.c 1970-01-01 01:00:00.000000000 +0100
3057 +++ linux-dsd/drivers/char/speakup/genmap.c 2005-10-28 12:24:46.000000000 +0100
3058 @@ -0,0 +1,204 @@
3059 +#include <stdlib.h>
3060 +#include <stdio.h>
3061 +#include <libgen.h>
3062 +#include <string.h>
3063 +#include <linux/version.h>
3064 +#include <ctype.h>
3065 +
3066 +int get_define(void);
3067 +
3068 +#define MAXKEYS 512
3069 +#define MAXKEYVAL 160
3070 +#define HASHSIZE 101
3071 +#define is_shift -3
3072 +#define is_spk -2
3073 +#define is_input -1
3074 +typedef struct st_key_init t_key_init;
3075 +struct st_key_init {
3076 + char *name;
3077 + int value, shift;
3078 +};
3079 +typedef struct st_key t_key;
3080 +struct st_key {
3081 + char *name;
3082 + t_key *next;
3083 + int value, shift;
3084 +};
3085 +unsigned char key_data[MAXKEYVAL][16], *kp;
3086 +
3087 +#include "mapdata.h"
3088 +t_key key_table[MAXKEYS];
3089 +t_key *extra_keys = key_table+HASHSIZE;
3090 +char buffer[256], filename[256];
3091 +FILE *infile;
3092 +char delims[] = "\t\n ";
3093 +char *def_name, *def_val, *cp;
3094 +int map_ver = 119; /* an arbitrary number so speakup can check */
3095 +int lc, shift_table[17];
3096 +int max_states = 1, flags = 0;
3097 +/* flags reserved for later, maybe for individual console maps */
3098 +
3099 +void open_input( char *name )
3100 +{
3101 + strcpy( filename, name );
3102 + if ( ( infile = fopen( filename, "r" ) ) == 0 ) {
3103 + fprintf( stderr, "can't open %s, version %d\n", filename, LINUX_VERSION_CODE );
3104 + exit( 1 );
3105 + }
3106 + lc = 0;
3107 +}
3108 +
3109 +int
3110 +oops( char *msg, char *info )
3111 +{
3112 + if ( info == NULL ) info = " ";
3113 + fprintf( stderr, "error: file %s line %d\n", filename, lc );
3114 + fprintf( stderr, "%s %s\n", msg, info );
3115 + exit( 1 );
3116 +}
3117 +
3118 +t_key *hash_name( char *name )
3119 +{
3120 + u_char *pn = (u_char *)name;
3121 + int hash = 0;
3122 + while ( *pn ) {
3123 + hash = ( hash * 17 ) & 0xfffffff;
3124 + if ( isupper( *pn ) ) *pn = tolower( *pn );
3125 + hash += ( int )*pn;
3126 + pn++;
3127 + }
3128 + hash %= HASHSIZE;
3129 + return &key_table[hash];
3130 +}
3131 +
3132 +t_key *find_key( char *name )
3133 +{
3134 + t_key *this = hash_name( name );
3135 + while ( this ) {
3136 + if ( !strcmp( name, this->name ) ) return this;
3137 + this = this->next;
3138 + }
3139 + return this;
3140 +}
3141 +
3142 +t_key *add_key( char *name, int value, int shift )
3143 +{
3144 + t_key *this = hash_name( name );
3145 + if ( extra_keys-key_table >= MAXKEYS )
3146 + oops( "out of key table space, enlarge MAXKEYS", NULL );
3147 + if ( this->name != NULL ) {
3148 + while ( this->next ) {
3149 + if ( !strcmp( name, this->name ) )
3150 + oops( "attempt to add duplicate key", name );
3151 + this = this->next;
3152 + }
3153 + this->next = extra_keys++;
3154 + this = this->next;
3155 + }
3156 + this->name = strdup( name );
3157 + this->value = value;
3158 + this->shift = shift;
3159 + return this;
3160 +}
3161 +
3162 +int get_shift_value( int state )
3163 +{
3164 + int i;
3165 + for ( i = 0; shift_table[i] != state; i++ ) {
3166 + if ( shift_table[i] == -1 ) {
3167 + if ( i >= 16 )
3168 + oops( "too many shift states", NULL );
3169 + shift_table[i] = state;
3170 + max_states = i+1;
3171 + break;
3172 + }
3173 + }
3174 + return i;
3175 +}
3176 +
3177 +int
3178 +main( int argc, char *argv[] )
3179 +{
3180 + int value, shift_state, i, spk_val = 0, lock_val = 0;
3181 + int max_key_used = 0, num_keys_used = 0;
3182 + t_key *this;
3183 + t_key_init *p_init;
3184 +char *argpath, *argname, *argcopy;
3185 +
3186 + bzero( key_table, sizeof( key_table ) );
3187 + bzero( key_data, sizeof( key_data ) );
3188 + shift_table[0] = 0;
3189 + for ( i = 1; i <= 16; i++ ) shift_table[i] = -1;
3190 + if ( argc < 2 ) {
3191 + fputs( "usage: genmap filename\n", stderr );
3192 + exit( 1 );
3193 + }
3194 + for ( p_init = init_key_data; p_init->name[0] != '.'; p_init++ )
3195 + add_key( p_init->name, p_init->value, p_init->shift );
3196 + open_input( argv[1] );
3197 + while ( fgets( buffer, 250, infile ) ) {
3198 + lc++;
3199 + value = shift_state = 0;
3200 + cp = strtok( buffer, delims );
3201 + if ( *cp == '#' ) continue;
3202 + while ( cp ) {
3203 + if ( *cp == '=' ) break;
3204 + this = find_key( cp );
3205 + if ( this == NULL )
3206 + oops( "unknown key/modifier", cp );
3207 + if ( this->shift == is_shift ) {
3208 + if ( value )
3209 + oops( "modifiers must come first", cp );
3210 + shift_state += this->value;
3211 + } else if ( this->shift == is_input )
3212 + value = this->value;
3213 + else oops( "bad modifier or key", cp );
3214 + cp = strtok( 0, delims );
3215 + }
3216 + if ( !cp ) oops( "no = found", NULL );
3217 + cp = strtok( 0, delims );
3218 + if ( !cp ) oops( "no speakup function after =", NULL );
3219 + this = find_key( cp );
3220 + if ( this == NULL || this->shift != is_spk )
3221 + oops( "invalid speakup function", cp );
3222 + i = get_shift_value( shift_state );
3223 + if ( key_data[value][i] ) {
3224 + while ( --cp > buffer )
3225 + if ( !*cp ) *cp = ' ';
3226 + oops( "two functions on same key combination", cp );
3227 + }
3228 + key_data[value][i] = (char)this->value;
3229 + if ( value > max_key_used ) max_key_used = value;
3230 + }
3231 + fclose( infile );
3232 + this = find_key( "spk_key" );
3233 + if ( this ) spk_val = this->value;
3234 + this = find_key( "spk_lock" );
3235 + if ( this ) lock_val = this->value;
3236 + for ( lc = 1; lc <= max_key_used; lc++ ) {
3237 + kp = key_data[lc];
3238 + if ( !memcmp( key_data[0], kp, 16 ) ) continue;
3239 + num_keys_used++;
3240 + for ( i = 0; i < max_states; i++ ) {
3241 + if ( kp[i] != spk_val&& kp[i] != lock_val ) continue;
3242 + shift_state = shift_table[i];
3243 + if ( ( shift_state&16 ) ) continue;
3244 + shift_state = get_shift_value( shift_state+16 );
3245 + kp[shift_state] = kp[i];
3246 +/* fill in so we can process the key up, as spk bit will be set */
3247 + }
3248 + }
3249 + printf( "\t%d, %d, %d,\n\t", map_ver, num_keys_used, max_states );
3250 + for ( i = 0; i < max_states; i++ )
3251 + printf( "%d, ", shift_table[i] );
3252 + printf( "%d,", flags );
3253 + for ( lc = 1; lc <= max_key_used; lc++ ) {
3254 + kp = key_data[lc];
3255 + if ( !memcmp( key_data[0], kp, 16 ) ) continue;
3256 + printf( "\n\t%d,", lc );
3257 + for ( i = 0; i < max_states; i++ )
3258 + printf( " %d,", (unsigned int)kp[i] );
3259 + }
3260 + printf( "\n\t0, %d\n", map_ver );
3261 + exit( 0 );
3262 +}
3263 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/install linux-dsd/drivers/char/speakup/install
3264 --- linux-2.6.14/drivers/char/speakup/install 1970-01-01 01:00:00.000000000 +0100
3265 +++ linux-dsd/drivers/char/speakup/install 2005-10-28 12:24:46.000000000 +0100
3266 @@ -0,0 +1,57 @@
3267 +#!/bin/bash
3268 +
3269 +VERSION=v`head -2 /usr/src/linux/Makefile | \
3270 + awk '{ printf "%s",$3 }'`
3271 +
3272 +DIR=/usr/src/linux/drivers/char/speakup
3273 +
3274 +echo "Patching version $VERSION"
3275 +
3276 +if [ "$1" != "--debug" ]; then
3277 + SILENT=--silent
3278 +fi
3279 +
3280 +cp -R speakup /usr/src/linux/drivers/char/
3281 +cd /usr/src/linux
3282 +
3283 +# make .orig files
3284 +echo -n 'Creating .orig files ['
3285 +for i in `cat ${DIR}/patchlist-${VERSION}`; do
3286 + patch=`echo $i | cut -f 1 -d ,`
3287 + filebase=`echo $i | cut -f 2 -d ,`
3288 +
3289 + mkdir -p `dirname $filebase`
3290 + if [ "$patch" == "1" ]; then
3291 + if [ ! -e $filebase.orig ]; then
3292 + echo -n .
3293 + cp $filebase $filebase.orig
3294 + fi
3295 + fi
3296 +done
3297 +echo '] done.'
3298 +
3299 +# apply patches
3300 +echo -n 'Patching files ['
3301 +for i in ${DIR}/diff-${VERSION}/*.patch; do
3302 + # skip dirs
3303 + [ -d $i ] && continue
3304 + echo -n p
3305 + writeloc=${i##$DIR\/diff-${VERSION}\/}
3306 + writeloc=${writeloc%.patch}
3307 + writeloc=${writeloc//^/\/}
3308 + patch $SILENT -f -p0 -o $writeloc $writeloc.orig $i
3309 +done
3310 +echo '] done.'
3311 +
3312 +# copy files
3313 +echo -n 'Copying files ['
3314 +for i in ${DIR}/diff-${VERSION}/*.copy; do
3315 + # skip dirs
3316 + [ -d $i ] && continue
3317 + echo -n c
3318 + writeloc=${i##$DIR\/diff-${VERSION}\/}
3319 + writeloc=${writeloc%.copy}
3320 + writeloc=${writeloc//^/\/}
3321 + cp $i $writeloc
3322 +done
3323 +echo '] done.'
3324 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/Kconfig linux-dsd/drivers/char/speakup/Kconfig
3325 --- linux-2.6.14/drivers/char/speakup/Kconfig 1970-01-01 01:00:00.000000000 +0100
3326 +++ linux-dsd/drivers/char/speakup/Kconfig 2005-10-28 12:24:46.000000000 +0100
3327 @@ -0,0 +1,210 @@
3328 +menu "Speakup console speech"
3329 +config SPEAKUP
3330 + tristate "Build speakup console speech"
3331 + ---help---
3332 +
3333 + This is the Speakup screen reader. Think of it as a
3334 + video console for blind people. If built in to the
3335 + kernel, it can speak evrything on the text console from
3336 + boot up to shutdown. For more information on Speakup,
3337 + point your browser at http://www.linux-speakup.org/.
3338 + There is also a mailing list at the above url that you
3339 + can subscribe to.
3340 +
3341 + Supported synthesizers are accent sa, accent pc, appollo
3342 + II., Auddapter, Braille 'n Speak, Dectalk external
3343 + (old), Dectalk PC (full length isa board), Dectalk
3344 + express, Doubletalk, Doubletalk LT or Litetalk,
3345 + Keynote
3346 + Gold internal PC, software synthesizers, Speakout, and transport.
3347 +
3348 + Speakup can either be built in or compiled as a module
3349 + by answering y or m. If you answer y here, then you
3350 + must answer either y or m to at least one of the
3351 + synthesizer drivers below. If you answer m here, then
3352 + the synthesizer drivers below can only be built as
3353 + modules.
3354 +
3355 + These drivers are not standalone drivers, but must be
3356 + used in conjunction with Speakup. Think of them as
3357 + video cards for blind people.
3358 +
3359 +
3360 + The Dectalk pc driver can only be built as a module, and
3361 + requires software to be pre-loaded on to the card before
3362 + the module can be loaded. See the decpc choice below
3363 + for more details.
3364 +
3365 + If you are not a blind person, or don't have access to
3366 + one of the listed synthesizers, you should say n.
3367 +
3368 +config SPEAKUP_ACNTSA
3369 + depends on SPEAKUP
3370 + tristate "Accent SA, acntsa"
3371 + ---help---
3372 +
3373 + This is the Speakup driver for the accent sa
3374 + synthesizer. You can say y to build it into the kernel,
3375 + or m to build it as a module. See the configuration
3376 + help on the Speakup choice above for more info.
3377 +
3378 +config SPEAKUP_ACNTPC
3379 + depends on SPEAKUP
3380 + tristate "Accent PC, acntpc"
3381 + ---help---
3382 +
3383 + This is the Speakup driver for the accent pc
3384 + synthesizer. You can say y to build it into the kernel,
3385 + or m to build it as a module. See the configuration
3386 + help on the Speakup choice above for more info.
3387 +
3388 +config SPEAKUP_APOLLO
3389 + depends on SPEAKUP
3390 + tristate "Apollo, apollo"
3391 + ---help---
3392 +
3393 + This is the Speakup driver for the Apollo II
3394 + synthesizer. You can say y to build it into the kernel,
3395 + or m to build it as a module. See the configuration
3396 + help on the Speakup choice above for more info.
3397 +
3398 +config SPEAKUP_AUDPTR
3399 + depends on SPEAKUP
3400 + tristate "Audapter, audptr"
3401 + ---help---
3402 +
3403 + This is the Speakup driver for the Audapter synthesizer.
3404 + You can say y to build it into the kernel, or m to
3405 + build it as a module. See the configuration help on the
3406 + Speakup choice above for more info.
3407 +
3408 +config SPEAKUP_BNS
3409 + depends on SPEAKUP
3410 + tristate "Braille 'n' Speak, bns"
3411 + ---help---
3412 +
3413 + This is the Speakup driver for the Braille 'n' Speak
3414 + synthesizer. You can say y to build it into the kernel,
3415 + or m to build it as a module. See the configuration
3416 + help on the Speakup choice above for more info.
3417 +
3418 +config SPEAKUP_DECTLK
3419 + depends on SPEAKUP
3420 + tristate "DECtalk Express, dectlk"
3421 + ---help---
3422 +
3423 + This is the Speakup driver for the DecTalk Express
3424 + synthesizer. You can say y to build it into the kernel,
3425 + or m to build it as a module. See the configuration
3426 + help on the Speakup choice above for more info.
3427 +
3428 +config SPEAKUP_DECEXT
3429 + depends on SPEAKUP
3430 + tristate "DECtalk External (old), decext"
3431 + ---help---
3432 +
3433 + This is the Speakup driver for the DecTalk External
3434 + (old) synthesizer. You can say y to build it into the
3435 + kernel, or m to build it as a module. See the
3436 + configuration help on the Speakup choice above for more
3437 + info.
3438 +
3439 +config SPEAKUP_DECPC
3440 + depends on SPEAKUP
3441 + tristate "DECtalk PC (big ISA card), decpc"
3442 + ---help---
3443 +
3444 + This is the Speakup driver for the DecTalk PC (full
3445 + length ISA) synthesizer. You can say m to build it as
3446 + a module. See the configuration help on the Speakup
3447 + choice above for more info.
3448 +
3449 + In order to use the DecTalk PC driver, you must download
3450 + the dec_pc.tgz file from linux-speakup.org. It is in
3451 + the pub/linux/goodies directory. The dec_pc.tgz file
3452 + contains the software which must be pre-loaded on to the
3453 + DecTalk PC board in order to use it with this driver.
3454 + This driver must be built as a module, and can not be
3455 + loaded until the file system is mounted and the DecTalk
3456 + PC software has been pre-loaded on to the board.
3457 +
3458 + See the README file in the dec_pc.tgz file for more
3459 + details.
3460 +
3461 +config SPEAKUP_DTLK
3462 + depends on SPEAKUP
3463 + tristate "DoubleTalk PC, dtlk"
3464 + ---help---
3465 +
3466 + This is the Speakup driver for the internal DoubleTalk
3467 + PC synthesizer. You can say y to build it into the
3468 + kernel, or m to build it as a module. See the
3469 + configuration help on the Speakup choice above for more
3470 + info.
3471 +
3472 +config SPEAKUP_KEYPC
3473 + depends on SPEAKUP
3474 + tristate "Keynote Gold PC, keypc"
3475 + ---help---
3476 +
3477 + This is the Speakup driver for the Keynote Gold
3478 + PC synthesizer. You can say y to build it into the
3479 + kernel, or m to build it as a module. See the
3480 + configuration help on the Speakup choice above for more
3481 + info.
3482 +
3483 +config SPEAKUP_LTLK
3484 + depends on SPEAKUP
3485 + tristate "DoubleTalk LT or LiteTalk, ltlk"
3486 +---help---
3487 +
3488 + This is the Speakup driver for the LiteTalk/DoubleTalk
3489 + LT synthesizer. You can say y to build it into the
3490 + kernel, or m to build it as a module. See the
3491 + configuration help on the Speakup choice above for more
3492 + info.
3493 +
3494 +config SPEAKUP_SFTSYN
3495 + depends on SPEAKUP
3496 + tristate "Software synthesizers, sftsyn"
3497 +---help---
3498 +
3499 + This is the software synthesizer device node. It will
3500 + register a device /dev/sftsyn which midware programs
3501 + and speech
3502 + daemons may open and read to provide kernel output to
3503 + software synths
3504 + such as festival, flite, tuxtalk and so forth. You
3505 + can select 'y' or
3506 + 'm' to have it built-in to the kernel or loaded as a module.
3507 +
3508 +config SPEAKUP_SPKOUT
3509 + depends on SPEAKUP
3510 + tristate "Speak Out, spkout"
3511 + ---help---
3512 +
3513 + This is the Speakup driver for the Speakout synthesizer.
3514 + You can say y to build it into the kernel, or m to
3515 + build it as a module. See the configuration help on the
3516 + Speakup choice above for more info.
3517 +
3518 +config SPEAKUP_TXPRT
3519 + depends on SPEAKUP
3520 + tristate "Transport, txprt"
3521 + ---help---
3522 +
3523 + This is the Speakup driver for the Transport
3524 + synthesizer. You can say y to build it into the kernel,
3525 + or m to build it as a module. See the configuration
3526 + help on the Speakup choice above for more info.
3527 +
3528 +if SPEAKUP != n
3529 + comment 'Enter the 3 to 6 character keyword from the list above, or none for no default synthesizer on boot up.'
3530 + depends on SPEAKUP
3531 +endif
3532 +
3533 +config SPEAKUP_DEFAULT
3534 + string "Choose Default synthesizer for Speakup"
3535 + default "none"
3536 +
3537 +endmenu
3538 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/keyinfo.h linux-dsd/drivers/char/speakup/keyinfo.h
3539 --- linux-2.6.14/drivers/char/speakup/keyinfo.h 1970-01-01 01:00:00.000000000 +0100
3540 +++ linux-dsd/drivers/char/speakup/keyinfo.h 2005-10-28 12:24:46.000000000 +0100
3541 @@ -0,0 +1,120 @@
3542 +/* spk_priv.h
3543 + review functions for the speakup screen review package.
3544 + originally written by: Kirk Reiser and Andy Berdan.
3545 +
3546 + extensively modified by David Borowski.
3547 +
3548 + Copyright (C ) 1998 Kirk Reiser.
3549 + Copyright (C ) 2003 David Borowski.
3550 +
3551 + This program is free software; you can redistribute it and/or modify
3552 + it under the terms of the GNU General Public License as published by
3553 + the Free Software Foundation; either version 2 of the License, or
3554 + (at your option ) any later version.
3555 +
3556 + This program is distributed in the hope that it will be useful,
3557 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3558 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3559 + GNU General Public License for more details.
3560 +
3561 + You should have received a copy of the GNU General Public License
3562 + along with this program; if not, write to the Free Software
3563 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3564 +*/
3565 +
3566 +enum { /* var_ids */
3567 + VERSION = 0, SYNTH, SILENT, SYNTH_DIRECT,
3568 + KEYMAP, CHARS,
3569 + PUNC_SOME, PUNC_MOST, PUNC_ALL,
3570 + DELIM, REPEATS, EXNUMBER,
3571 + DELAY, TRIGGER, JIFFY, FULL, /* all timers must be together */
3572 + BLEEP_TIME, CURSOR_TIME, BELL_POS,
3573 +SAY_CONTROL, SAY_WORD_CTL, NO_INTERRUPT, KEY_ECHO,
3574 + SPELL_DELAY, PUNC_LEVEL, READING_PUNC,
3575 + ATTRIB_BLEEP, BLEEPS,
3576 + RATE, PITCH, VOL, TONE, PUNCT, VOICE, FREQ, LANG,
3577 + CAPS_START, CAPS_STOP,
3578 + MAXVARS
3579 +};
3580 +
3581 +#define FIRST_SYNTH_VAR RATE
3582 +/* 0 is reserved for no remap */
3583 +#define SPEAKUP_GOTO 0x01
3584 +#define SPEECH_KILL 0x02
3585 +#define SPEAKUP_QUIET 0x03
3586 +#define SPEAKUP_CUT 0x04
3587 +#define SPEAKUP_PASTE 0x05
3588 +#define SAY_FIRST_CHAR 0x06
3589 +#define SAY_LAST_CHAR 0x07
3590 +#define SAY_CHAR 0x08
3591 +#define SAY_PREV_CHAR 0x09
3592 +#define SAY_NEXT_CHAR 0x0a
3593 +#define SAY_WORD 0x0b
3594 +#define SAY_PREV_WORD 0x0c
3595 +#define SAY_NEXT_WORD 0x0d
3596 +#define SAY_LINE 0x0e
3597 +#define SAY_PREV_LINE 0x0f
3598 +#define SAY_NEXT_LINE 0x10
3599 +#define TOP_EDGE 0x11
3600 +#define BOTTOM_EDGE 0x12
3601 +#define LEFT_EDGE 0x13
3602 +#define RIGHT_EDGE 0x14
3603 +#define SPELL_PHONETIC 0x15
3604 +#define SPELL_WORD 0x16
3605 +#define SAY_SCREEN 0x17
3606 +#define SAY_POSITION 0x18
3607 +#define SAY_ATTRIBUTES 0x19
3608 +#define SPEAKUP_OFF 0x1a
3609 +#define SPEAKUP_PARKED 0x1b
3610 +#define SAY_LINE_INDENT 0x1c
3611 +#define SAY_FROM_TOP 0x1d
3612 +#define SAY_TO_BOTTOM 0x1e
3613 +#define SAY_FROM_LEFT 0x1f
3614 +#define SAY_TO_RIGHT 0x20
3615 +#define SAY_CHAR_NUM 0x21
3616 +#define EDIT_SOME 0x22
3617 +#define EDIT_MOST 0x23
3618 +#define SAY_PHONETIC_CHAR 0x24
3619 +#define EDIT_DELIM 0x25
3620 +#define EDIT_REPEAT 0x26
3621 +#define EDIT_EXNUM 0x27
3622 +#define SET_WIN 0x28
3623 +#define CLEAR_WIN 0x29
3624 +#define ENABLE_WIN 0x2a
3625 +#define SAY_WIN 0x2b
3626 +#define SPK_LOCK 0x2c
3627 +#define SPEAKUP_HELP 0x2d
3628 +#define TOGGLE_CURSORING 0x2e
3629 +#define READ_ALL_DOC 0x2f
3630 +#define SPKUP_MAX_FUNC 0x30 /* one greater than the last func handler */
3631 +
3632 +#define SPK_KEY 0x80
3633 +#define FIRST_EDIT_BITS 0x22
3634 +
3635 +#define FIRST_SET_VAR SPELL_DELAY
3636 +#define VAR_START 0x40 /* increase if adding more than 0x3f functions */
3637 +
3638 +/* keys for setting variables, must be ordered same as the enum for var_ids */
3639 +/* with dec being even and inc being 1 greater */
3640 +#define SPELL_DELAY_DEC VAR_START+0
3641 +#define SPELL_DELAY_INC SPELL_DELAY_DEC+1
3642 +#define PUNC_LEVEL_DEC SPELL_DELAY_DEC+2
3643 +#define PUNC_LEVEL_INC PUNC_LEVEL_DEC+1
3644 +#define READING_PUNC_DEC PUNC_LEVEL_DEC+2
3645 +#define READING_PUNC_INC READING_PUNC_DEC+1
3646 +#define ATTRIB_BLEEP_DEC READING_PUNC_DEC+2
3647 +#define ATTRIB_BLEEP_INC ATTRIB_BLEEP_DEC+1
3648 +#define BLEEPS_DEC ATTRIB_BLEEP_DEC+2
3649 +#define BLEEPS_INC BLEEPS_DEC+1
3650 +#define RATE_DEC BLEEPS_DEC+2
3651 +#define RATE_INC RATE_DEC+1
3652 +#define PITCH_DEC RATE_DEC+2
3653 +#define PITCH_INC PITCH_DEC+1
3654 +#define VOL_DEC PITCH_DEC+2
3655 +#define VOL_INC VOL_DEC+1
3656 +#define TONE_DEC VOL_DEC+2
3657 +#define TONE_INC TONE_DEC+1
3658 +#define PUNCT_DEC TONE_DEC+2
3659 +#define PUNCT_INC PUNCT_DEC+1
3660 +#define VOICE_DEC PUNCT_DEC+2
3661 +#define VOICE_INC VOICE_DEC+1
3662 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/Makefile linux-dsd/drivers/char/speakup/Makefile
3663 --- linux-2.6.14/drivers/char/speakup/Makefile 1970-01-01 01:00:00.000000000 +0100
3664 +++ linux-dsd/drivers/char/speakup/Makefile 2005-10-28 12:24:46.000000000 +0100
3665 @@ -0,0 +1,61 @@
3666 +#
3667 +# Makefile for the speakup speech output system.
3668 +#
3669 +
3670 +V := $(shell awk '/UTS_RELEASE/ {print substr($$3,2,3)}' $(TOPDIR)/include/linux/version.h)
3671 +ifeq ($V,2.4)
3672 +# Note! Dependencies are done automagically by 'make dep', which also
3673 +# removes any old dependencies. DON'T put your own dependencies here
3674 +# unless it's something special (ie not a .c file).
3675 +#
3676 +# Note 2! The CFLAGS definitions are now inherited from the
3677 +# parent makes..
3678 +#
3679 +O_TARGET := spk.o
3680 +export-objs := speakup_drvcommon.o speakup.o
3681 +endif
3682 +obj-m = speakup_keyhelp.o
3683 +speakupmain-objs := speakup.o speakup_drvcommon.o
3684 +obj-$(CONFIG_SPEAKUP) += speakupmain.o
3685 +obj-$(CONFIG_SPEAKUP_ACNTPC) += speakup_acntpc.o
3686 +obj-$(CONFIG_SPEAKUP_ACNTSA) += speakup_acntsa.o
3687 +obj-$(CONFIG_SPEAKUP_APOLLO) += speakup_apollo.o
3688 +obj-$(CONFIG_SPEAKUP_AUDPTR) += speakup_audptr.o
3689 +obj-$(CONFIG_SPEAKUP_BNS) += speakup_bns.o
3690 +obj-$(CONFIG_SPEAKUP_DECEXT) += speakup_decext.o
3691 +obj-$(CONFIG_SPEAKUP_DECPC) += speakup_decpc.o
3692 +obj-$(CONFIG_SPEAKUP_DECTLK) += speakup_dectlk.o
3693 +obj-$(CONFIG_SPEAKUP_DTLK) += speakup_dtlk.o
3694 +obj-$(CONFIG_SPEAKUP_KEYPC) += speakup_keypc.o
3695 +obj-$(CONFIG_SPEAKUP_LTLK) += speakup_ltlk.o
3696 +obj-$(CONFIG_SPEAKUP_SFTSYN) += speakup_sftsyn.o
3697 +obj-$(CONFIG_SPEAKUP_SPKOUT) += speakup_spkout.o
3698 +obj-$(CONFIG_SPEAKUP_TXPRT) += speakup_txprt.o
3699 +
3700 +ifeq ($V,2.4)
3701 + include $(TOPDIR)/Rules.make
3702 +
3703 +speakupmap.h: speakupmap.map genmap
3704 + ./genmap speakupmap.map >$@
3705 +
3706 +genmap: genmap.c mapdata.h
3707 + cc -o genmap genmap.c
3708 +
3709 +mapdata.h: makemapdata.c keyinfo.h
3710 + cc -o makemapdata makemapdata.c
3711 + ./makemapdata >mapdata.h
3712 +
3713 +endif
3714 +speakupmain.o:speakup.o speakup_drvcommon.o
3715 + ld -r -o speakupmain.o speakup.o speakup_drvcommon.o
3716 +
3717 +$(obj)/speakupmap.h: $(src)/speakupmap.map $(src)/genmap
3718 + $(src)/genmap $(src)/speakupmap.map >$@
3719 +
3720 +$(obj)/mapdata.h: $(src)/keyinfo.h $(src)/makemapdata
3721 + $(src)/makemapdata >$@
3722 +
3723 +$(obj)/genmap: $(obj)/mapdata.h
3724 +
3725 +HOSTCFLAGS := -Iinclude -I/usr/include
3726 +hostprogs-y := makemapdata genmap
3727 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/makemapdata.c linux-dsd/drivers/char/speakup/makemapdata.c
3728 --- linux-2.6.14/drivers/char/speakup/makemapdata.c 1970-01-01 01:00:00.000000000 +0100
3729 +++ linux-dsd/drivers/char/speakup/makemapdata.c 2005-10-28 12:24:46.000000000 +0100
3730 @@ -0,0 +1,156 @@
3731 +#include <stdlib.h>
3732 +#include <stdio.h>
3733 +#include <libgen.h>
3734 +#include <string.h>
3735 +#include <linux/version.h>
3736 +#include <ctype.h>
3737 +
3738 +int get_define(void);
3739 +
3740 +#define MAXKEYS 512
3741 +#define MAXKEYVAL 160
3742 +#define HASHSIZE 101
3743 +#define is_shift -3
3744 +#define is_spk -2
3745 +#define is_input -1
3746 +typedef struct st_key t_key;
3747 +struct st_key {
3748 + char *name;
3749 + t_key *next;
3750 + int value, shift;
3751 +};
3752 +
3753 +t_key key_table[MAXKEYS];
3754 +t_key *extra_keys = key_table+HASHSIZE;
3755 +char buffer[256], filename[256];
3756 +FILE *infile;
3757 +char delims[] = "\t\n ";
3758 +char *dir_name, *def_name, *def_val, *cp;
3759 +int lc;
3760 +
3761 +void open_input( char *name )
3762 +{
3763 + sprintf( filename, "%s/%s", dir_name, name );
3764 + if ( ( infile = fopen( filename, "r" ) ) == 0 ) {
3765 + fprintf( stderr, "can't open %s\n", filename );
3766 + exit( 1 );
3767 + }
3768 + lc = 0;
3769 +}
3770 +
3771 +int
3772 +oops( char *msg, char *info )
3773 +{
3774 + if ( info == NULL ) info = " ";
3775 + fprintf( stderr, "error: file %s line %d\n", filename, lc );
3776 + fprintf( stderr, "%s %s\n", msg, info );
3777 + exit( 1 );
3778 +}
3779 +
3780 +int get_define( )
3781 +{
3782 + while ( fgets( buffer, 250, infile ) ) {
3783 + lc++;
3784 + if ( strncmp( buffer, "#define", 7 ) ) continue;
3785 + strtok( buffer, delims );
3786 + def_name = strtok( 0, delims );
3787 + def_val = strtok( 0, delims );
3788 + if ( def_val != NULL ) return 1;
3789 + }
3790 + fclose( infile );
3791 + infile = 0;
3792 + return 0;
3793 +}
3794 +
3795 +t_key *hash_name( char *name )
3796 +{
3797 + u_char *pn = (u_char *)name;
3798 + int hash = 0;
3799 + while ( *pn ) {
3800 + hash = ( hash * 17 ) & 0xfffffff;
3801 + if ( isupper( *pn ) ) *pn = tolower( *pn );
3802 + hash += ( int )*pn;
3803 + pn++;
3804 + }
3805 + hash %= HASHSIZE;
3806 + return &key_table[hash];
3807 +}
3808 +
3809 +t_key *find_key( char *name )
3810 +{
3811 + t_key *this = hash_name( name );
3812 + while ( this ) {
3813 + if ( !strcmp( name, this->name ) ) return this;
3814 + this = this->next;
3815 + }
3816 + return this;
3817 +}
3818 +
3819 +t_key *add_key( char *name, int value, int shift )
3820 +{
3821 + t_key *this = hash_name( name );
3822 + if ( extra_keys-key_table >= MAXKEYS )
3823 + oops( "out of key table space, enlarge MAXKEYS", NULL );
3824 + if ( this->name != NULL ) {
3825 + while ( this->next ) {
3826 + if ( !strcmp( name, this->name ) )
3827 + oops( "attempt to add duplicate key", name );
3828 + this = this->next;
3829 + }
3830 + this->next = extra_keys++;
3831 + this = this->next;
3832 + }
3833 + this->name = strdup( name );
3834 + this->value = value;
3835 + this->shift = shift;
3836 + return this;
3837 +}
3838 +
3839 +int
3840 +main( int argc, char *argv[] )
3841 +{
3842 + int value, i;
3843 + t_key *this;
3844 + dir_name = getenv( "TOPDIR" );
3845 + if ( !dir_name ) dir_name = "/usr/src/linux";
3846 + bzero( key_table, sizeof( key_table ) );
3847 + add_key( "shift", 1, is_shift );
3848 + add_key( "altgr", 2, is_shift );
3849 + add_key( "ctrl", 4, is_shift );
3850 + add_key( "alt", 8, is_shift );
3851 + add_key( "spk", 16, is_shift );
3852 + add_key( "double", 32, is_shift );
3853 + open_input( "include/linux/input.h" );
3854 + while ( get_define( ) ) {
3855 + if ( strncmp( def_name, "KEY_", 4 ) ) continue;
3856 + value = atoi( def_val );
3857 + if ( value > 0 && value < MAXKEYVAL )
3858 + add_key( def_name, value, is_input );
3859 + }
3860 + open_input( "drivers/char/speakup/keyinfo.h" );
3861 + while ( get_define( ) ) {
3862 + if ( strlen( def_val ) > 5 ) {
3863 + if ( !( cp = strchr( def_val, '+' ) ) ) continue;
3864 + *cp++ = '\0';
3865 + this = find_key( def_val );
3866 + if ( !this || *cp < '0' || *cp > '9' ) continue;
3867 + value = this->value+atoi( cp );
3868 + } else if ( !strncmp( def_val, "0x", 2 ) )
3869 + sscanf( def_val+2, "%x", &value );
3870 + else if ( *def_val >= '0' && *def_val <= '9' )
3871 + value = atoi( def_val );
3872 + else continue;
3873 + add_key( def_name, value, is_spk );
3874 + }
3875 + printf( "t_key_init init_key_data[] = {\n" );
3876 + for ( i = 0; i < HASHSIZE; i++ ) {
3877 + this = &key_table[i];
3878 + if ( !this->name ) continue;
3879 + do {
3880 + printf( "\t\"%s\", %d, %d,\n", this->name, this->value, this->shift );
3881 + this = this->next;
3882 + } while ( this );
3883 + }
3884 + printf( "\t\".\", 0, 0\n};\n" );
3885 + exit( 0 );
3886 +}
3887 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/mod_code.c linux-dsd/drivers/char/speakup/mod_code.c
3888 --- linux-2.6.14/drivers/char/speakup/mod_code.c 1970-01-01 01:00:00.000000000 +0100
3889 +++ linux-dsd/drivers/char/speakup/mod_code.c 2005-10-28 12:24:46.000000000 +0100
3890 @@ -0,0 +1,22 @@
3891 +/* this code is to modularize a synth specific file, included at the end */
3892 +
3893 +static void __exit mod_synth_exit( void )
3894 +{
3895 + if ( synth == &MY_SYNTH )
3896 + synth_release( );
3897 + synth_remove( &MY_SYNTH );
3898 +}
3899 +
3900 +static int __init mod_synth_init( void )
3901 +{
3902 + int status = do_synth_init( &MY_SYNTH );
3903 + if ( status != 0 ) return status;
3904 + synth_add( &MY_SYNTH );
3905 + return 0;
3906 +}
3907 +
3908 +module_init( mod_synth_init );
3909 +module_exit( mod_synth_exit );
3910 +MODULE_AUTHOR("Kirk Reiser <kirk@braille.uwo.ca>");
3911 +MODULE_DESCRIPTION("Synthesizer driver module for speakup for the synth->long_name");
3912 +MODULE_LICENSE( "GPL" );
3913 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/serialio.h linux-dsd/drivers/char/speakup/serialio.h
3914 --- linux-2.6.14/drivers/char/speakup/serialio.h 1970-01-01 01:00:00.000000000 +0100
3915 +++ linux-dsd/drivers/char/speakup/serialio.h 2005-10-28 12:24:46.000000000 +0100
3916 @@ -0,0 +1,18 @@
3917 +#ifndef SSPK_SERIAL
3918 +#define SSPK_SERIAL
3919 +
3920 +#include <linux/serial.h> /* for rs_table, serial constants &
3921 + serial_uart_config */
3922 +#include <linux/serial_reg.h> /* for more serial constants */
3923 +#include <linux/serialP.h> /* for struct serial_state */
3924 +#include <asm/serial.h>
3925 +
3926 +#define SPK_SERIAL_TIMEOUT 1000000 /* countdown values for serial timeouts */
3927 +#define SPK_XMITR_TIMEOUT 1000000 /* countdown values transmitter/dsr timeouts */
3928 +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */
3929 +#define SPK_HI_TTY 3
3930 +#define NUM_DISABLE_TIMEOUTS 3 /* # of timeouts permitted before disable */
3931 +#define SPK_TIMEOUT 100 /* buffer timeout in ms */
3932 +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
3933 +
3934 +#endif
3935 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/speakup_acnt.h linux-dsd/drivers/char/speakup/speakup_acnt.h
3936 --- linux-2.6.14/drivers/char/speakup/speakup_acnt.h 1970-01-01 01:00:00.000000000 +0100
3937 +++ linux-dsd/drivers/char/speakup/speakup_acnt.h 2005-10-28 12:24:46.000000000 +0100
3938 @@ -0,0 +1,16 @@
3939 +/* speakup_acntpc.h - header file for speakups Accent-PC driver. */
3940 +
3941 +#define SYNTH_IO_EXTENT 0x02
3942 +
3943 +#define SYNTH_CLEAR 0x18 /* stops speech */
3944 +
3945 + /* Port Status Flags */
3946 +#define SYNTH_READABLE 0x01 /* mask for bit which is nonzero if a
3947 + byte can be read from the data port */
3948 +#define SYNTH_WRITABLE 0x02 /* mask for RDY bit, which when set to
3949 + 1, indicates the data port is ready
3950 + to accept a byte of data. */
3951 +#define SYNTH_QUIET 'S' /* synth is not speaking */
3952 +#define SYNTH_FULL 'F' /* synth is full. */
3953 +#define SYNTH_ALMOST_EMPTY 'M' /* synth has les than 2 seconds of text left */
3954 +#define SYNTH_SPEAKING 's' /* synth is speaking and has a fare way to go */
3955 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/speakup_acntpc.c linux-dsd/drivers/char/speakup/speakup_acntpc.c
3956 --- linux-2.6.14/drivers/char/speakup/speakup_acntpc.c 1970-01-01 01:00:00.000000000 +0100
3957 +++ linux-dsd/drivers/char/speakup/speakup_acntpc.c 2005-10-28 12:24:46.000000000 +0100
3958 @@ -0,0 +1,161 @@
3959 +/*
3960 + * originially written by: Kirk Reiser <kirk@braille.uwo.ca>
3961 +* this version considerably modified by David Borowski, david575@rogers.com
3962 +
3963 + Copyright (C) 1998-99 Kirk Reiser.
3964 + Copyright (C) 2003 David Borowski.
3965 +
3966 + This program is free software; you can redistribute it and/or modify
3967 + it under the terms of the GNU General Public License as published by
3968 + the Free Software Foundation; either version 2 of the License, or
3969 + (at your option) any later version.
3970 +
3971 + This program is distributed in the hope that it will be useful,
3972 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3973 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3974 + GNU General Public License for more details.
3975 +
3976 + You should have received a copy of the GNU General Public License
3977 + along with this program; if not, write to the Free Software
3978 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3979 +
3980 + * this code is specificly written as a driver for the speakup screenreview
3981 + * package and is not a general device driver.
3982 + */
3983 +#include "spk_priv.h"
3984 +#include "speakup_acnt.h" /* local header file for Accent values */
3985 +
3986 +#define MY_SYNTH synth_acntpc
3987 +#define synth_readable( ) ( inb_p( synth_port_control ) & SYNTH_READABLE )
3988 +#define synth_writable( ) ( inb_p( synth_port_control ) & SYNTH_WRITABLE )
3989 +#define synth_full( ) ( inb_p( synth_port_tts ) == 'F' )
3990 +#define PROCSPEECH '\r'
3991 +
3992 +
3993 +static int synth_port_control;
3994 +static unsigned int synth_portlist[] =
3995 + { 0x2a8, 0 };
3996 +
3997 +static char *synth_immediate ( char *buf )
3998 +{
3999 + u_char ch;
4000 + while ( ( ch = *buf ) ) {
4001 + if ( ch == 0x0a ) ch = PROCSPEECH;
4002 + if ( synth_full( ) )
4003 + return buf;
4004 + while ( synth_writable( ) );
4005 + outb_p( ch, synth_port_tts );
4006 + buf++;
4007 + }
4008 + return 0;
4009 +}
4010 +
4011 +static void do_catch_up( unsigned long data )
4012 +{
4013 + unsigned long jiff_max = jiffies+synth_jiffy_delta;
4014 + u_char ch;
4015 + synth_stop_timer( );
4016 + while ( synth_buff_out < synth_buff_in ) {
4017 + if ( synth_full( ) ) {
4018 + synth_delay( synth_full_time );
4019 + return;
4020 + }
4021 + while ( synth_writable( ) );
4022 + ch = *synth_buff_out++;
4023 + if ( ch == 0x0a ) ch = PROCSPEECH;
4024 + outb_p( ch, synth_port_tts );
4025 + if ( jiffies >= jiff_max && ch == SPACE ) {
4026 + while ( synth_writable( ) );
4027 + outb_p( PROCSPEECH, synth_port_tts );
4028 + synth_delay( synth_delay_time );
4029 + return;
4030 + }
4031 + }
4032 + while ( synth_writable( ) );
4033 + outb_p( PROCSPEECH, synth_port_tts );
4034 + synth_done( );
4035 +}
4036 +
4037 +static void synth_flush( void )
4038 +{
4039 + outb_p( SYNTH_CLEAR, synth_port_tts );
4040 +}
4041 +
4042 +static int synth_probe( void )
4043 +{
4044 + unsigned int port_val = 0;
4045 + int i = 0;
4046 + pr_info( "Probing for %s.\n", synth->long_name );
4047 + if ( synth_port_forced ) {
4048 + synth_port_tts = synth_port_forced;
4049 + pr_info( "probe forced to %x by kernel command line\n", synth_port_tts );
4050 + if ( synth_request_region( synth_port_tts-1, SYNTH_IO_EXTENT ) ) {
4051 + pr_warn( "sorry, port already reserved\n" );
4052 + return -EBUSY;
4053 + }
4054 + port_val = inw( synth_port_tts-1 );
4055 + synth_port_control = synth_port_tts-1;
4056 + } else {
4057 + for( i=0; synth_portlist[i]; i++ ) {
4058 + if ( synth_request_region( synth_portlist[i], SYNTH_IO_EXTENT ) ) {
4059 + pr_warn( "request_region: failed with 0x%x, %d\n",
4060 + synth_portlist[i], SYNTH_IO_EXTENT );
4061 + continue;
4062 + }
4063 + port_val = inw( synth_portlist[i] );
4064 + if ( ( port_val &= 0xfffc ) == 0x53fc ) { /* 'S' and out&input bits */
4065 + synth_port_control = synth_portlist[i];
4066 + synth_port_tts = synth_port_control+1;
4067 + break;
4068 + }
4069 + }
4070 + }
4071 + if ( ( port_val &= 0xfffc ) != 0x53fc ) { /* 'S' and out&input bits */
4072 + pr_info( "%s: not found\n", synth->long_name );
4073 + synth_release_region( synth_portlist[i], SYNTH_IO_EXTENT );
4074 + synth_port_control = 0;
4075 + return -ENODEV;
4076 + }
4077 + pr_info( "%s: %03x-%03x, driver version %s,\n", synth->long_name,
4078 + synth_port_control, synth_port_control+SYNTH_IO_EXTENT-1,
4079 + synth->version );
4080 + return 0;
4081 +}
4082 +
4083 +static void accent_release( void )
4084 +{
4085 + if ( synth_port_tts )
4086 + synth_release_region( synth_port_tts-1, SYNTH_IO_EXTENT );
4087 + synth_port_tts = 0;
4088 +}
4089 +
4090 +static int synth_is_alive( void )
4091 +{
4092 + synth_alive = 1;
4093 + return 1;
4094 +}
4095 +
4096 +static const char init_string[] = "\033=X \033Oi\033T2\033=M\033N1\n";
4097 +
4098 +static string_var stringvars[] = {
4099 + { CAPS_START, "\033P8" },
4100 + { CAPS_STOP, "\033P5" },
4101 + V_LAST_STRING
4102 +};
4103 +static num_var numvars[] = {
4104 + { RATE, "\033R%c", 9, 0, 17, 0, 0, "0123456789abcdefgh" },
4105 + { PITCH, "\033P%d", 5, 0, 9, 0, 0, 0 },
4106 + { VOL, "\033A%d", 5, 0, 9, 0, 0, 0 },
4107 + { TONE, "\033V%d", 5, 0, 9, 0, 0, 0 },
4108 + V_LAST_NUM
4109 +};
4110 +
4111 +struct spk_synth synth_acntpc = {"acntpc", "1.1", "Accent PC",
4112 + init_string, 500, 50, 50, 1000, 0, 0, SYNTH_CHECK,
4113 + stringvars, numvars, synth_probe, accent_release, synth_immediate,
4114 + do_catch_up, NULL, synth_flush, synth_is_alive, NULL, NULL,
4115 + {NULL,0,0,0} };
4116 +
4117 +#ifdef MODULE
4118 +#include "mod_code.c"
4119 +#endif
4120 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/speakup_acntsa.c linux-dsd/drivers/char/speakup/speakup_acntsa.c
4121 --- linux-2.6.14/drivers/char/speakup/speakup_acntsa.c 1970-01-01 01:00:00.000000000 +0100
4122 +++ linux-dsd/drivers/char/speakup/speakup_acntsa.c 2005-10-28 12:24:46.000000000 +0100
4123 @@ -0,0 +1,185 @@
4124 +/*
4125 + * originially written by: Kirk Reiser <kirk@braille.uwo.ca>
4126 +* this version considerably modified by David Borowski, david575@rogers.com
4127 +
4128 + Copyright (C) 1998-99 Kirk Reiser.
4129 + Copyright (C) 2003 David Borowski.
4130 +
4131 + This program is free software; you can redistribute it and/or modify
4132 + it under the terms of the GNU General Public License as published by
4133 + the Free Software Foundation; either version 2 of the License, or
4134 + (at your option) any later version.
4135 +
4136 + This program is distributed in the hope that it will be useful,
4137 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4138 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4139 + GNU General Public License for more details.
4140 +
4141 + You should have received a copy of the GNU General Public License
4142 + along with this program; if not, write to the Free Software
4143 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4144 +
4145 + * this code is specificly written as a driver for the speakup screenreview
4146 + * package and is not a general device driver.
4147 + */
4148 +#include "spk_priv.h"
4149 +#include "serialio.h"
4150 +#include "speakup_acnt.h" /* local header file for Accent values */
4151 +
4152 +#define MY_SYNTH synth_acntsa
4153 +#define synth_full( ) ( inb_p( synth_port_tts ) == 'F' )
4154 +#define PROCSPEECH '\r'
4155 +
4156 +static int timeouts = 0; /* sequential number of timeouts */
4157 +
4158 +static int
4159 +wait_for_xmitr ( void )
4160 +{
4161 + int check, tmout = SPK_XMITR_TIMEOUT;
4162 + if ( ( synth_alive ) && ( timeouts >= NUM_DISABLE_TIMEOUTS ) ) {
4163 + synth_alive = 0;
4164 + return 0;
4165 + }
4166 + do { /* holding register empty? */
4167 + check = inb_p ( synth_port_tts + UART_LSR );
4168 + if ( --tmout == 0 ) {
4169 + pr_warn ( "%s: timed out\n", synth->long_name );
4170 + timeouts++;
4171 + return 0;
4172 + }
4173 + } while ( ( check & BOTH_EMPTY ) != BOTH_EMPTY );
4174 + tmout = SPK_XMITR_TIMEOUT;
4175 + do { /* CTS */
4176 + check = inb_p ( synth_port_tts + UART_MSR );
4177 + if ( --tmout == 0 ) {
4178 + timeouts++;
4179 + return 0;
4180 + }
4181 + } while ( ( check & UART_MSR_CTS ) != UART_MSR_CTS );
4182 + timeouts = 0;
4183 + return 1;
4184 +}
4185 +
4186 +static inline int
4187 +spk_serial_out ( const char ch )
4188 +{
4189 + if ( synth_alive && wait_for_xmitr ( ) ) {
4190 + outb_p ( ch, synth_port_tts );
4191 + return 1;
4192 + }
4193 + return 0;
4194 +}
4195 +
4196 +static void
4197 +do_catch_up ( unsigned long data )
4198 +{
4199 + unsigned long jiff_max = jiffies+synth_jiffy_delta;
4200 + u_char ch;
4201 + synth_stop_timer ( );
4202 + while ( synth_buff_out < synth_buff_in ) {
4203 + ch = *synth_buff_out;
4204 + if ( ch == 0x0a ) ch = 0x0D;
4205 + if ( !spk_serial_out ( ch ) ) {
4206 + synth_delay ( synth_full_time );
4207 + return;
4208 + }
4209 + synth_buff_out++;
4210 + if ( jiffies >= jiff_max && ch == ' ' ) {
4211 + spk_serial_out ( PROCSPEECH );
4212 + synth_delay ( synth_delay_time );
4213 + return;
4214 + }
4215 + }
4216 + spk_serial_out ( PROCSPEECH );
4217 + synth_done( );
4218 +}
4219 +
4220 +static char *synth_immediate ( char *buff )
4221 +{
4222 + u_char ch;
4223 + while ( ( ch = *buff ) ) {
4224 + if ( ch == 0x0a ) ch = PROCSPEECH;
4225 + if ( wait_for_xmitr( ) )
4226 + outb( ch, synth_port_tts );
4227 + else return buff;
4228 + buff++;
4229 + }
4230 + return 0;
4231 +}
4232 +
4233 +static void synth_flush ( void )
4234 +{
4235 + spk_serial_out ( SYNTH_CLEAR );
4236 +}
4237 +
4238 +static int serprobe ( int index )
4239 +{
4240 + struct serial_state *ser = spk_serial_init( index );
4241 + if ( ser == NULL ) return -1;
4242 + outb ( 0x0d, ser->port );
4243 + // mdelay ( 1 );
4244 + /* ignore any error results, if port was forced */
4245 + if ( synth_port_forced ) return 0;
4246 + /* check for accent s.a now... */
4247 + if ( !synth_immediate( "\x18" ) )
4248 + return 0;
4249 + spk_serial_release( );
4250 + timeouts = synth_alive = 0; /* not ignoring */
4251 + return -1;
4252 +}
4253 +
4254 +static int synth_probe ( void )
4255 +{
4256 + int i = 0, failed=0;
4257 + pr_info ( "Probing for %s.\n", synth->long_name );
4258 + for ( i = SPK_LO_TTY; i <= SPK_HI_TTY; i++ ) {
4259 + if (( failed = serprobe( i )) == 0 ) break; /* found it */
4260 + }
4261 + if ( failed ) {
4262 + pr_info ( "%s: not found\n", synth->long_name );
4263 + return -ENODEV;
4264 + }
4265 + pr_info ( "%s: %03x-%03x, Driver Version %s,\n", synth->long_name,
4266 + synth_port_tts, synth_port_tts + 7, synth->version );
4267 + synth_immediate( "\033=R\r" );
4268 + mdelay( 100 );
4269 + return 0;
4270 +}
4271 +
4272 +static int
4273 +synth_is_alive ( void )
4274 +{
4275 + if ( synth_alive ) return 1;
4276 + if ( !synth_alive && wait_for_xmitr ( ) > 0 ) { /* restart */
4277 + synth_alive = 1;
4278 + synth_write_string ( synth->init );
4279 + return 2;
4280 + }
4281 + pr_warn ( "%s: can't restart synth\n", synth->long_name );
4282 + return 0;
4283 +}
4284 +
4285 +static const char init_string[] = "\033T2\033=M\033Oi\033N1\n";
4286 +
4287 +static string_var stringvars[] = {
4288 + { CAPS_START, "\033P8" },
4289 + { CAPS_STOP, "\033P5" },
4290 + V_LAST_STRING
4291 +};
4292 +static num_var numvars[] = {
4293 + { RATE, "\033R%c", 9, 0, 17, 0, 0, "0123456789abcdefgh" },
4294 + { PITCH, "\033P%d", 5, 0, 9, 0, 0, 0 },
4295 + { VOL, "\033A%d", 9, 0, 9, 0, 0, 0 },
4296 + { TONE, "\033V%d", 5, 0, 9, 0, 0, 0 },
4297 + V_LAST_NUM
4298 +};
4299 +
4300 +struct spk_synth synth_acntsa = { "acntsa", "1.1", "Accent-SA",
4301 + init_string, 400, 5, 30, 1000, 0, 0, SYNTH_CHECK,
4302 + stringvars, numvars, synth_probe, spk_serial_release, synth_immediate,
4303 + do_catch_up, NULL, synth_flush, synth_is_alive, NULL, NULL,
4304 + {NULL,0,0,0} };
4305 +
4306 +#ifdef MODULE
4307 +#include "mod_code.c"
4308 +#endif
4309 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/speakup_apollo.c linux-dsd/drivers/char/speakup/speakup_apollo.c
4310 --- linux-2.6.14/drivers/char/speakup/speakup_apollo.c 1970-01-01 01:00:00.000000000 +0100
4311 +++ linux-dsd/drivers/char/speakup/speakup_apollo.c 2005-10-28 12:24:46.000000000 +0100
4312 @@ -0,0 +1,196 @@
4313 +/*
4314 + * originially written by: Kirk Reiser <kirk@braille.uwo.ca>
4315 +* this version considerably modified by David Borowski, david575@rogers.com
4316 +
4317 + Copyright (C) 1998-99 Kirk Reiser.
4318 + Copyright (C) 2003 David Borowski.
4319 +
4320 + This program is free software; you can redistribute it and/or modify
4321 + it under the terms of the GNU General Public License as published by
4322 + the Free Software Foundation; either version 2 of the License, or
4323 + (at your option) any later version.
4324 +
4325 + This program is distributed in the hope that it will be useful,
4326 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4327 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4328 + GNU General Public License for more details.
4329 +
4330 + You should have received a copy of the GNU General Public License
4331 + along with this program; if not, write to the Free Software
4332 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4333 +
4334 + * this code is specificly written as a driver for the speakup screenreview
4335 + * package and is not a general device driver.
4336 + */
4337 +#include "spk_priv.h"
4338 +#include "serialio.h"
4339 +
4340 +#define MY_SYNTH synth_apollo
4341 +#define SYNTH_CLEAR 0x18
4342 +#define PROCSPEECH '\r'
4343 +
4344 +static int timeouts = 0; /* sequential number of timeouts */
4345 +
4346 +static int wait_for_xmitr( void )
4347 +{
4348 + int check, tmout = SPK_XMITR_TIMEOUT;
4349 + if ( ( synth_alive ) && ( timeouts >= NUM_DISABLE_TIMEOUTS ) ) {
4350 + synth_alive = 0;
4351 + timeouts = 0;
4352 + return 0;
4353 + }
4354 + do {
4355 + check = inb( synth_port_tts + UART_LSR );
4356 + if ( --tmout == 0 ) {
4357 + pr_warn( "APOLLO: timed out\n" );
4358 + timeouts++;
4359 + return 0;
4360 + }
4361 + } while ( ( check & BOTH_EMPTY ) != BOTH_EMPTY );
4362 + tmout = SPK_XMITR_TIMEOUT;
4363 + do {
4364 + check = inb( synth_port_tts + UART_MSR );
4365 + if ( --tmout == 0 ) {
4366 + timeouts++;
4367 + return 0;
4368 + }
4369 + } while ( ( check & UART_MSR_CTS ) != UART_MSR_CTS );
4370 + timeouts = 0;
4371 + return 1;
4372 +}
4373 +
4374 +static inline int spk_serial_out( const char ch )
4375 +{
4376 + // int timer = 9000000;
4377 + if ( synth_alive && wait_for_xmitr( ) ) {
4378 + outb( ch, synth_port_tts );
4379 + /*while ( inb( synth_port_tts+UART_MSR ) & UART_MSR_CTS ) if ( --timer == 0 ) break;*/
4380 + /* outb( UART_MCR_DTR, synth_port_tts + UART_MCR );*/
4381 + return 1;
4382 + }
4383 + return 0;
4384 +}
4385 +
4386 +/*
4387 +static unsigned char spk_serial_in( void )
4388 +{
4389 + int c, lsr, tmout = SPK_SERIAL_TIMEOUT;
4390 + do {
4391 + lsr = inb( synth_port_tts + UART_LSR );
4392 + if ( --tmout == 0 ) return 0xff;
4393 + } while ( !( lsr & UART_LSR_DR ) );
4394 + c = inb( synth_port_tts + UART_RX );
4395 + return ( unsigned char ) c;
4396 +}
4397 +*/
4398 +
4399 +static void do_catch_up( unsigned long data )
4400 +{
4401 + unsigned long jiff_max = jiffies+synth_jiffy_delta;
4402 + u_char ch;
4403 +synth_stop_timer( );
4404 + while ( synth_buff_out < synth_buff_in ) {
4405 + ch = *synth_buff_out;
4406 + if ( !spk_serial_out( ch ) ) {
4407 + outb( UART_MCR_DTR, synth_port_tts + UART_MCR );
4408 + outb( UART_MCR_DTR | UART_MCR_RTS, synth_port_tts + UART_MCR );
4409 + synth_delay( synth_full_time );
4410 + return;
4411 + }
4412 + synth_buff_out++;
4413 + if ( jiffies >= jiff_max && synth_buff_out-synth_buffer > 10 ) {
4414 + spk_serial_out( PROCSPEECH );
4415 + synth_delay( synth_delay_time );
4416 + return;
4417 + }
4418 + }
4419 + spk_serial_out( PROCSPEECH );
4420 + synth_done( );
4421 +}
4422 +
4423 +static char *synth_immediate ( char *buf )
4424 +{
4425 + u_char ch;
4426 + while ( ( ch = *buf ) ) {
4427 + if ( ch == 0x0a ) ch = PROCSPEECH;
4428 + if ( wait_for_xmitr( ) )
4429 + outb( ch, synth_port_tts );
4430 + else return buf;
4431 + buf++;
4432 + }
4433 + return 0;
4434 +}
4435 +
4436 +static void synth_flush ( void )
4437 +{
4438 + spk_serial_out ( SYNTH_CLEAR );
4439 +}
4440 +
4441 +static int serprobe( int index )
4442 +{
4443 + struct serial_state *ser = spk_serial_init( index );
4444 + if ( ser == NULL ) return -1;
4445 + outb( 0x0d, ser->port ); /* wake it up if older BIOS */
4446 + mdelay( 1 );
4447 + synth_port_tts = ser->port;
4448 + if ( synth_port_forced ) return 0;
4449 + /* check for apollo now... */
4450 + if ( !synth_immediate( "\x18" ) ) return 0;
4451 + pr_warn( "port %x failed\n", synth_port_tts );
4452 + spk_serial_release( );
4453 + timeouts = synth_alive = synth_port_tts = 0;
4454 + return -1;
4455 +}
4456 +
4457 +static int synth_probe( void )
4458 +{
4459 +int i, failed=0;
4460 + pr_info( "Probing for %s.\n", synth->long_name );
4461 + for ( i=SPK_LO_TTY; i <= SPK_HI_TTY; i++ ) {
4462 + if (( failed = serprobe( i )) == 0 ) break; /* found it */
4463 + }
4464 + if ( failed ) {
4465 + pr_info( "%s: not found\n", synth->long_name );
4466 + return -ENODEV;
4467 + }
4468 + pr_info( "%s: %03x-%03x, Driver version %s,\n", synth->long_name,
4469 + synth_port_tts, synth_port_tts + 7, synth->version );
4470 + return 0;
4471 +}
4472 +
4473 +static int synth_is_alive( void )
4474 +{
4475 + if ( synth_alive ) return 1;
4476 + if ( !synth_alive && wait_for_xmitr( ) > 0 ) { /* restart */
4477 + synth_alive = 1;
4478 + synth_write_string( synth->init );
4479 + return 2; /* reenabled */
4480 + } else pr_warn( "%s: can't restart synth\n", synth->long_name );
4481 + return 0;
4482 +}
4483 +
4484 +static const char init_string[] = "@R3@D0@K1\r";
4485 +
4486 +static string_var stringvars[] = {
4487 + { CAPS_START, "cap, " },
4488 + { CAPS_STOP, "" },
4489 + V_LAST_STRING
4490 +};
4491 +static num_var numvars[] = {
4492 + { RATE, "@W%d", 6, 1, 9, 0, 0, 0 },
4493 + { PITCH, "@F%x", 10, 0, 15, 0, 0, 0 },
4494 + { VOL, "@A%x", 10, 0, 15, 0, 0, 0 },
4495 + { VOICE, "@V%d", 1, 1, 6, 0, 0, 0 },
4496 + { LANG, "@=%d,", 1, 1, 4, 0, 0, 0 },
4497 + V_LAST_NUM
4498 +};
4499 +
4500 +struct spk_synth synth_apollo = {"apollo", "1.2", "Apollo",
4501 + init_string, 500, 50, 50, 5000, 0, 0, SYNTH_CHECK,
4502 + stringvars, numvars, synth_probe, spk_serial_release, synth_immediate,
4503 + do_catch_up, NULL, synth_flush, synth_is_alive, NULL, NULL,
4504 + {NULL,0,0,0} };
4505 +
4506 +#ifdef MODULE
4507 +#include "mod_code.c"
4508 +#endif
4509 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/speakup_audptr.c linux-dsd/drivers/char/speakup/speakup_audptr.c
4510 --- linux-2.6.14/drivers/char/speakup/speakup_audptr.c 1970-01-01 01:00:00.000000000 +0100
4511 +++ linux-dsd/drivers/char/speakup/speakup_audptr.c 2005-10-28 12:24:46.000000000 +0100
4512 @@ -0,0 +1,202 @@
4513 +/*
4514 + * originially written by: Kirk Reiser <kirk@braille.uwo.ca>
4515 +* this version considerably modified by David Borowski, david575@rogers.com
4516 +
4517 + Copyright (C) 1998-99 Kirk Reiser.
4518 + Copyright (C) 2003 David Borowski.
4519 +
4520 + This program is free software; you can redistribute it and/or modify
4521 + it under the terms of the GNU General Public License as published by
4522 + the Free Software Foundation; either version 2 of the License, or
4523 + (at your option) any later version.
4524 +
4525 + This program is distributed in the hope that it will be useful,
4526 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4527 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4528 + GNU General Public License for more details.
4529 +
4530 + You should have received a copy of the GNU General Public License
4531 + along with this program; if not, write to the Free Software
4532 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4533 +
4534 + * this code is specificly written as a driver for the speakup screenreview
4535 + * package and is not a general device driver.
4536 + */
4537 +#include "spk_priv.h"
4538 +#include "serialio.h"
4539 +
4540 +#define MY_SYNTH synth_audptr
4541 +#define SYNTH_CLEAR 0x18 /* flush synth buffer */
4542 +#define PROCSPEECH '\r' /* start synth processing speech char */
4543 +
4544 +static int timeouts = 0; /* sequential number of timeouts */
4545 +
4546 +static int wait_for_xmitr( void )
4547 +{
4548 + int check, tmout = SPK_XMITR_TIMEOUT;
4549 + if ( ( synth_alive ) && ( timeouts >= NUM_DISABLE_TIMEOUTS ) ) {
4550 + synth_alive = 0;
4551 + timeouts = 0;
4552 + return 0;
4553 + }
4554 + do { /* holding register empty? */
4555 + check = inb( synth_port_tts + UART_LSR );
4556 + if ( --tmout == 0 ) {
4557 + pr_warn( "%s: timed out\n", synth->long_name );
4558 + timeouts++;
4559 + return 0;
4560 + }
4561 + } while ( ( check & BOTH_EMPTY ) != BOTH_EMPTY );
4562 + tmout = SPK_XMITR_TIMEOUT;
4563 + do { /* CTS */
4564 + check = inb( synth_port_tts + UART_MSR );
4565 + if ( --tmout == 0 ) {
4566 + timeouts++;
4567 + return 0;
4568 + }
4569 + } while ( ( check & UART_MSR_CTS ) != UART_MSR_CTS );
4570 + timeouts = 0;
4571 + return 1;
4572 +}
4573 +
4574 +static inline int spk_serial_out( const char ch )
4575 +{
4576 + if ( synth_alive && wait_for_xmitr( ) ) {
4577 + outb( ch, synth_port_tts );
4578 + return 1;
4579 + }
4580 + return 0;
4581 +}
4582 +
4583 +static unsigned char spk_serial_in( void )
4584 +{
4585 + int c, lsr, tmout = SPK_SERIAL_TIMEOUT;
4586 + do {
4587 + lsr = inb( synth_port_tts + UART_LSR );
4588 + if ( --tmout == 0 ) return 0xff;
4589 + } while ( !( lsr & UART_LSR_DR ) );
4590 + c = inb( synth_port_tts + UART_RX );
4591 + return ( unsigned char ) c;
4592 +}
4593 +
4594 +static void do_catch_up( unsigned long data )
4595 +{
4596 + unsigned long jiff_max = jiffies+synth_jiffy_delta;
4597 + u_char ch;
4598 +synth_stop_timer( );
4599 + while ( synth_buff_out < synth_buff_in ) {
4600 + ch = *synth_buff_out;
4601 + if ( ch == 0x0a ) ch = PROCSPEECH;
4602 + if ( !spk_serial_out( ch ) ) {
4603 + synth_delay( synth_full_time );
4604 + return;
4605 + }
4606 + synth_buff_out++;
4607 + if ( jiffies >= jiff_max && ch == SPACE ) {
4608 + spk_serial_out( PROCSPEECH );
4609 + synth_delay( synth_delay_time );
4610 + return;
4611 + }
4612 + }
4613 + spk_serial_out( PROCSPEECH );
4614 + synth_done( );
4615 +}
4616 +
4617 +static char *synth_immediate ( char *buf )
4618 +{
4619 + u_char ch;
4620 + while ( ( ch = *buf ) ) {
4621 + if ( ch == 0x0a ) ch = PROCSPEECH;
4622 + if ( wait_for_xmitr( ) )
4623 + outb( ch, synth_port_tts );
4624 + else return buf;
4625 + buf++;
4626 + }
4627 + return 0;
4628 +}
4629 +
4630 +static void synth_flush( void )
4631 +{
4632 + while ( ( inb( synth_port_tts + UART_LSR ) & BOTH_EMPTY ) != BOTH_EMPTY );
4633 + outb( SYNTH_CLEAR, synth_port_tts );
4634 + spk_serial_out( PROCSPEECH );
4635 + }
4636 +
4637 +static char synth_id[40] = "";
4638 +
4639 +static int serprobe( int index )
4640 +{
4641 + u_char test = 0;
4642 + struct serial_state *ser = spk_serial_init( index );
4643 + if ( ser == NULL ) return -1;
4644 + /* ignore any error results, if port was forced */
4645 + if ( synth_port_forced )
4646 + return 0;
4647 + synth_immediate( "\x05[Q]" );
4648 + if ( ( synth_id[test] = spk_serial_in( ) ) == 'A' ) {
4649 + do { /* read version string from synth */
4650 + synth_id[++test] = spk_serial_in( );
4651 + } while ( synth_id[test] != '\n' && test < 32 );
4652 + synth_id[++test] = 0x00;
4653 + if ( test != 32 )
4654 + return 0;
4655 + }
4656 + spk_serial_release( );
4657 + timeouts = synth_alive = 0; /* not ignoring */
4658 + return -1;
4659 +}
4660 +
4661 +static int synth_probe( void )
4662 +{
4663 +int i=0, failed=0;
4664 + pr_info( "Probing for %s.\n", synth->long_name );
4665 + for ( i=SPK_LO_TTY; i <= SPK_HI_TTY; i++ ) {
4666 + if (( failed = serprobe( i )) == 0 ) break; /* found it */
4667 + }
4668 + if ( failed ) {
4669 + pr_info( "%s: not found\n", synth->long_name );
4670 + return -ENODEV;
4671 + }
4672 + pr_info( "%s: %03x-%03x, Driver %s,\n", synth->long_name,
4673 + synth_port_tts, synth_port_tts + 7, synth->version );
4674 + if ( synth_id[0] == 'A' )
4675 + pr_info( "%s version: %s", synth->long_name, synth_id );
4676 + return 0;
4677 +}
4678 +
4679 +static int synth_is_alive( void )
4680 +{
4681 + if ( synth_alive ) return 1;
4682 + if ( !synth_alive && wait_for_xmitr( ) > 0 ) { /* restart */
4683 + synth_alive = 1;
4684 + synth_write_string( synth->init );
4685 + return 2;
4686 + }
4687 + return 0;
4688 +}
4689 +
4690 +static const char init_string[] = "\x05[D1]\x05[Ol]";
4691 +
4692 +static string_var stringvars[] = {
4693 + { CAPS_START, "\x05[f99]" },
4694 + { CAPS_STOP, "\x05[f80]" },
4695 + V_LAST_STRING
4696 +};
4697 +static num_var numvars[] = {
4698 + { RATE, "\x05[r%d]", 10, 0, 20, -100, 10, 0 },
4699 + { PITCH, "\x05[f%d]", 80, 39, 4500, 0, 0, 0 },
4700 + { VOL, "\x05[g%d]", 21, 0, 40, 0, 0, 0 },
4701 + { TONE, "\x05[s%d]", 9, 0,63, 0, 0, 0 },
4702 + { PUNCT, "\x05[A%c]", 0, 0, 3, 0, 0, "nmsa" },
4703 + V_LAST_NUM
4704 +};
4705 +
4706 +struct spk_synth synth_audptr = {"audptr", "1.1", "Audapter",
4707 + init_string, 400, 5, 30, 5000, 0, 0, SYNTH_CHECK,
4708 + stringvars, numvars, synth_probe, spk_serial_release, synth_immediate,
4709 + do_catch_up, NULL, synth_flush, synth_is_alive, NULL, NULL,
4710 + {NULL,0,0,0} };
4711 +
4712 +#ifdef MODULE
4713 +#include "mod_code.c"
4714 +#endif
4715 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/speakup_bns.c linux-dsd/drivers/char/speakup/speakup_bns.c
4716 --- linux-2.6.14/drivers/char/speakup/speakup_bns.c 1970-01-01 01:00:00.000000000 +0100
4717 +++ linux-dsd/drivers/char/speakup/speakup_bns.c 2005-10-28 12:24:46.000000000 +0100
4718 @@ -0,0 +1,175 @@
4719 +/*
4720 + * originially written by: Kirk Reiser <kirk@braille.uwo.ca>
4721 +* this version considerably modified by David Borowski, david575@rogers.com
4722 +
4723 + Copyright (C) 1998-99 Kirk Reiser.
4724 + Copyright (C) 2003 David Borowski.
4725 +
4726 + This program is free software; you can redistribute it and/or modify
4727 + it under the terms of the GNU General Public License as published by
4728 + the Free Software Foundation; either version 2 of the License, or
4729 + (at your option) any later version.
4730 +
4731 + This program is distributed in the hope that it will be useful,
4732 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4733 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4734 + GNU General Public License for more details.
4735 +
4736 + You should have received a copy of the GNU General Public License
4737 + along with this program; if not, write to the Free Software
4738 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4739 +
4740 + * this code is specificly written as a driver for the speakup screenreview
4741 + * package and is not a general device driver.
4742 + */
4743 +#include "spk_priv.h"
4744 +#include "serialio.h"
4745 +
4746 +#define MY_SYNTH synth_bns
4747 +#define SYNTH_CLEAR 0x18
4748 +#define PROCSPEECH '\r'
4749 +
4750 +static int wait_for_xmitr( void )
4751 +{
4752 + static int timeouts = 0; /* sequential number of timeouts */
4753 + int check, tmout = SPK_XMITR_TIMEOUT;
4754 + if ( ( synth_alive ) && ( timeouts >= NUM_DISABLE_TIMEOUTS ) ) {
4755 + synth_alive = 0;
4756 + timeouts = 0;
4757 + return 0;
4758 + }
4759 + do {
4760 + check = inb( synth_port_tts + UART_LSR );
4761 + if ( --tmout == 0 ) {
4762 + pr_warn( "BNS: timed out\n" );
4763 + timeouts++;
4764 + return 0;
4765 + }
4766 + } while ( ( check & BOTH_EMPTY ) != BOTH_EMPTY );
4767 + tmout = SPK_XMITR_TIMEOUT;
4768 + do {
4769 + check = inb( synth_port_tts + UART_MSR );
4770 + if ( --tmout == 0 ) {
4771 + timeouts++;
4772 + return 0;
4773 + }
4774 + } while ( ( check & UART_MSR_CTS ) != UART_MSR_CTS );
4775 + timeouts = 0;
4776 + return 1;
4777 +}
4778 +
4779 +static inline int spk_serial_out( const char ch )
4780 +{
4781 + if ( synth_alive && wait_for_xmitr( ) ) {
4782 + outb( ch, synth_port_tts );
4783 + return 1;
4784 + }
4785 + return 0;
4786 +}
4787 +
4788 +static void do_catch_up( unsigned long data )
4789 +{
4790 + unsigned long jiff_max = jiffies+synth_jiffy_delta;
4791 + u_char ch;
4792 + synth_stop_timer( );
4793 + while ( synth_buff_out < synth_buff_in ) {
4794 + ch = *synth_buff_out;
4795 + if ( ch == '\n' ) ch = PROCSPEECH;
4796 + if ( !spk_serial_out( ch ) ) {
4797 + synth_delay( synth_full_time );
4798 + return;
4799 + }
4800 + synth_buff_out++;
4801 + if ( jiffies >= jiff_max && ch == ' ' ) {
4802 + spk_serial_out( PROCSPEECH );
4803 + synth_delay( synth_delay_time );
4804 + return;
4805 + }
4806 + }
4807 + spk_serial_out( PROCSPEECH );
4808 + synth_done( );
4809 +}
4810 +
4811 +static char *synth_immediate ( char *buf )
4812 +{
4813 + u_char ch;
4814 + while ( ( ch = *buf ) ) {
4815 + if ( ch == 0x0a ) ch = PROCSPEECH;
4816 + if ( wait_for_xmitr( ) )
4817 + outb( ch, synth_port_tts );
4818 + else return buf;
4819 + buf++;
4820 + }
4821 + return 0;
4822 +}
4823 +
4824 +static void synth_flush ( void )
4825 +{
4826 + spk_serial_out ( SYNTH_CLEAR );
4827 +}
4828 +
4829 +static int serprobe( int index )
4830 +{
4831 + struct serial_state *ser = spk_serial_init( index );
4832 + if ( ser == NULL ) return -1;
4833 + outb( '\r', ser->port );
4834 + if ( synth_port_forced ) return 0;
4835 + /* check for bns now... */
4836 + if ( !synth_immediate( "\x18" ) ) return 0;
4837 + spk_serial_release( );
4838 + synth_alive = 0;
4839 + return -1;
4840 +}
4841 +
4842 +static int synth_probe( void )
4843 +{
4844 +int i=0, failed=0;
4845 + pr_info( "Probing for %s.\n", synth->long_name );
4846 + for ( i=SPK_LO_TTY; i <= SPK_HI_TTY; i++ ) {
4847 + if (( failed = serprobe( i )) == 0 ) break; /* found it */
4848 + }
4849 + if ( failed ) {
4850 + pr_info( "%s: not found\n", synth->long_name );
4851 + return -ENODEV;
4852 + }
4853 + pr_info( "%s: %03x-%03x, Driver version %s,\n", synth->long_name,
4854 + synth_port_tts, synth_port_tts + 7, synth->version );
4855 + return 0;
4856 +}
4857 +
4858 +static int synth_is_alive( void )
4859 +{
4860 + if ( synth_alive ) return 1;
4861 + if ( !synth_alive && wait_for_xmitr( ) > 0 ) { /* restart */
4862 + synth_alive = 1;
4863 + synth_write_string( synth->init );
4864 + return 2;
4865 + }
4866 + pr_warn( "%s: can't restart synth\n", synth->long_name );
4867 + return 0;
4868 +}
4869 +
4870 +static const char init_string[] = "\x05Z\x05\x43";
4871 +
4872 +static string_var stringvars[] = {
4873 + { CAPS_START, "\x05\x31\x32P" },
4874 + { CAPS_STOP, "\x05\x38P" },
4875 + V_LAST_STRING
4876 +};
4877 +static num_var numvars[] = {
4878 + { RATE, "\x05%dE", 8, 1, 16, 0, 0, 0 },
4879 + { PITCH, "\x05%dP", 8, 0, 16, 0, 0, 0 },
4880 + { VOL, "\x05%dV", 8, 0, 16, 0, 0, 0 },
4881 + { TONE, "\x05%dT", 8, 0, 16, 0, 0, 0 },
4882 + V_LAST_NUM
4883 +};
4884 +
4885 +struct spk_synth synth_bns = {"bns", "1.1", "Braille 'N Speak",
4886 + init_string, 500, 50, 50, 5000, 0, 0, SYNTH_CHECK,
4887 + stringvars, numvars, synth_probe, spk_serial_release, synth_immediate,
4888 + do_catch_up, NULL, synth_flush, synth_is_alive, NULL, NULL,
4889 + {NULL,0,0,0} };
4890 +
4891 +#ifdef MODULE
4892 +#include "mod_code.c"
4893 +#endif
4894 diff -urNpXdontdiff linux-2.6.14/drivers/char/speakup/speakup.c linux-dsd/drivers/char/speakup/speakup.c
4895 --- linux-2.6.14/drivers/char/speakup/speakup.c 1970-01-01 01:00:00.000000000 +0100
4896 +++ linux-dsd/drivers/char/speakup/speakup.c 2005-10-28 12:30:03.000000000 +0100
4897 @@ -0,0 +1,2555 @@
4898 +/* speakup.c
4899 + review functions for the speakup screen review package.
4900 + originally written by: Kirk Reiser and Andy Berdan.
4901 +
4902 + extensively modified by David Borowski.
4903 +
4904 + Copyright (C ) 1998 Kirk Reiser.
4905 + Copyright (C ) 2003 David Borowski.
4906 +
4907 + This program is free software; you can redistribute it and/or modify
4908 + it under the terms of the GNU General Public License as published by
4909 + the Free Software Foundation; either version 2 of the License, or
4910 + (at your option ) any later version.
4911 +
4912 + This program is distributed in the hope that it will be useful,
4913 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4914 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4915 + GNU General Public License for more details.
4916 +
4917 + You should have received a copy of the GNU General Public License
4918 + along with this program; if not, write to the Free Software
4919 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4920 +*/
4921 +
4922 +#define __KERNEL_SYSCALLS__
4923 +
4924 +#include <linux/kernel.h>
4925 +#include <linux/version.h>
4926 +#include <linux/vt.h>
4927 +#include <linux/tty.h>
4928 +#include <linux/mm.h> /* __get_free_page( ) and friends */
4929 +#include <linux/vt_kern.h>
4930 +#include <linux/ctype.h>
4931 +#include <linux/selection.h>
4932 +#include <asm/uaccess.h> /* copy_from|to|user( ) and others */
4933 +#include <linux/unistd.h>
4934 +
4935 +#include <linux/keyboard.h> /* for KT_SHIFT */
4936 +#include <linux/kbd_kern.h> /* for vc_kbd_* and friends */
4937 +#include <linux/vt_kern.h>
4938 +#include <linux/input.h>
4939 +#include <linux/kmod.h>
4940 +#include <linux/speakup.h>
4941 +
4942 +#include "cvsversion.h"
4943 +#include "spk_priv.h"
4944 +#include <linux/bootmem.h> /* for alloc_bootmem */
4945 +
4946 +/* speakup_*_selection */
4947 +#include <linux/module.h>
4948 +#include <linux/sched.h>
4949 +#include <linux/slab.h>
4950 +#include <linux/types.h>
4951 +#include <asm/uaccess.h>
4952 +#include <linux/consolemap.h>
4953 +
4954 +#define SPEAKUP_VERSION "Speakup v-2.00" CVSVERSION
4955 +#define MAX_DELAY ( (500 * HZ ) / 1000 )
4956 +#define KEY_MAP_VER 119
4957 +#define MINECHOCHAR SPACE
4958 +
4959 +/* these are globals from the kernel code */
4960 +extern void *kmalloc (size_t, unsigned int );
4961 +extern void kfree (const void * );
4962 +extern struct kbd_struct * kbd;
4963 +extern int fg_console;
4964 +extern short punc_masks[];
4965 +
4966 +static special_func special_handler = NULL;
4967 +special_func help_handler = NULL;
4968 +
4969 +int synth_file_inuse = 0;
4970 +short pitch_shift = 0, synth_flags = 0;
4971 +static char buf[256];
4972 +short attrib_bleep = 0, bleeps = 0, bleep_time = 1;
4973 +short no_intr = 0, spell_delay = 0;
4974 +short key_echo = 0, cursor_timeout = 120, say_word_ctl = 0;
4975 +short say_ctrl = 0, bell_pos = 0;
4976 +short punc_mask = 0, punc_level = 0, reading_punc = 0;
4977 +char str_caps_start[MAXVARLEN+1] = "\0", str_caps_stop[MAXVARLEN+1] = "\0";
4978 +bits_data punc_info[] = {
4979 + { "none", "", 0 },
4980 + { "some", "/$%&@", SOME },
4981 + { "most", "$%&#()=+*/@^<>|\\", MOST },
4982 + { "all", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", PUNC },
4983 + { "delimiters", "", B_WDLM },
4984 + { "repeats", "()", CH_RPT },
4985 + { "extended numeric", "", B_EXNUM },
4986 + { "symbols", "", B_SYM },
4987 + { 0, 0 }
4988 +};
4989 +char mark_cut_flag = 0;
4990 +u_short mark_x = 0, mark_y = 0;
4991 +static char synth_name[10] = CONFIG_SPEAKUP_DEFAULT;
4992 +#define MAX_KEY 160
4993 +u_char *our_keys[MAX_KEY], *shift_table;
4994 +static u_char key_buf[600];
4995 +static u_char key_defaults[] = {
4996 +#include "speakupmap.h"
4997 +};
4998 +
4999 +// Speakup Cursor Track Variables
5000 +#define MAXCURSORTRACK 2
5001 +static int cursor_track = 1;
5002 +static int prev_cursor_track=1;
5003 +static int read_all_mode=MAXCURSORTRACK+1;
5004 +
5005 +struct tty_struct *tty;
5006 +#define key_handler k_handler
5007 +typedef void (*k_handler_fn)(struct vc_data *vc, unsigned char value,
5008 + char up_flag, struct pt_regs *regs);
5009 +#define KBD_PROTO struct vc_data *vc, u_char value, char up_flag, struct pt_regs *regs
5010 +#define KBD_ARGS vc, value, up_flag, regs
5011 +extern k_handler_fn key_handler[16];
5012 +static k_handler_fn do_shift, do_spec, do_latin, do_cursor;
5013 +EXPORT_SYMBOL( help_handler );
5014 +EXPORT_SYMBOL( special_handler );
5015 +EXPORT_SYMBOL( our_keys );
5016 +
5017 +static void speakup_date (struct vc_data *vc );
5018 +static void spkup_write (const char *in_buf, int count );
5019 +int set_mask_bits( const char *input, const int which, const int how );
5020 +
5021 +char str_ctl[] = "control-";
5022 +char *colors[] = {
5023 + "black", "blue", "green", "cyan", "red", "magenta", "yellow", "white",
5024 + "grey"
5025 +};
5026 +
5027 +char *phonetic[] = {
5028 + "alpha", "beta", "charley", "delta", "echo", "fox", "gamma", "hotel",
5029 + "india", "juleiet", "keelo", "leema", "mike", "november", "oscar",
5030 + "papa",
5031 + "quebec", "romeo", "seeara", "tango", "uniform", "victer", "wiskey",
5032 + "x ray", "yankee", "zooloo"
5033 +};
5034 +
5035 +// array of 256 char pointers (one for each ASCII character description )
5036 +// initialized to default_chars and user selectable via /proc/speakup/characters
5037 +char *characters[256];
5038 +
5039 +char *default_chars[256] = {
5040 + "null", "^a", "^b", "^c", "^d", "^e", "^f", "^g",
5041 + "^h", "^i", "^j", "^k", "^l", "^m", "^n", "^o",
5042 + "^p", "^q", "^r", "^s", "^t", "^u", "^v", "^w",
5043 + "^x", "^y", "^z", NULL, NULL, NULL, NULL, NULL,
5044 + "space", "bang!", "quote", "number", "dollar", "percent", "and",
5045 + "tick",
5046 + "left paren", "right paren", "star", "plus", "comma", "dash", "dot",
5047 + "slash",
5048 + "zero", "one", "two", "three", "four", "five", "six", "seven",
5049 + "eight", "nine",
5050 + "colon", "semmy", "less", "equals", "greater", "question", "at",
5051 + "eigh", "b", "c", "d", "e", "f", "g",
5052 + "h", "i", "j", "k", "l", "m", "n", "o",
5053 + "p", "q", "r", "s", "t", "u", "v", "w", "x",
5054 + "y", "zehd", "left bracket", "backslash", "right bracket", "caret",
5055 + "line",
5056 + "accent", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
5057 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
5058 + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
5059 + NULL, NULL, NULL, "left brace", "bar", "right brace", "tihlduh",
5060 + "delta", "see cedilla", "u oomlout", "e acute", /* 128 */
5061 + "eigh circumflex", "eigh oomlout", "eigh grave", "eigh ring", /* 132 */
5062 + "see cedilla", "e circumflex", "e oomlout", "e grave", /* 136 */
5063 + "i oomlout", "i circumflex", "i grave", "eigh oomlout", /* 140 */
5064 + "eigh ring", "e acute", "eigh e dipthong", "eigh e dipthong", /* 144 */
5065 + "o circumflex", "o oomlout", "o grave", "u circumflex", /* 148 */
5066 + "u grave", "y oomlout", "o oomlout", "u oomlout", /* 152 */
5067 + "cents", "pounds", "yen", "peseta", /* 156 */
5068 + "florin", "eigh acute", "i acute", "o acute", /* 160 */
5069 + "u acute", "n tilde", "n tilde", "feminine ordinal", /* 164 */
5070 + "masculin ordinal", "inverted question", "reversed not", "not", /* 168 */
5071 + "half", "quarter", "inverted bang", "much less than", /* 172 */
5072 + "much greater than", "dark shading", "medium shading", /* 176 */
5073 + "light shading", "verticle line", "left tee", /* 179 */
5074 + "double left tee", "left double tee", "double top right", /* 182 */
5075 + "top double right", "double left double tee", /* 185 */
5076 + "double vertical line", "double top double right", /* 187 */
5077 + "double bottom double right", "double bottom right", /* 189 */
5078 + "bottom double right", "top right", "left bottom", /* 191 */
5079 + "up tee", "tee down", "tee right", "horizontal line", /* 194 */
5080 + "cross bars", "tee double right", "double tee right", /* 198 */
5081 + "double left double bottom", "double left double top", /* 201 */
5082 + "double up double tee", "double tee double down", /* 203 */
5083 + "double tee double right", "double horizontal line", /* 205 */
5084 + "double cross bars", "up double tee", "double up tee", /* 207 */
5085 + "double tee down", "tee double down", /* 210 */
5086 + "double left bottom", "left double bottom", /* 212 */
5087 + "double left top", "left double top", /* 214 */
5088 + "double vertical cross", "double horizontal cross", /* 216 */
5089 + "bottom right", "left top", "solid square", /* 218 */
5090 + "solid lower half", "solid left half", "solid right half", /* 221 */
5091 + "solid upper half", "alpha", "beta", "gamma", /* 224 */
5092 + "pie", "sigma", "sigma", "mu", /* 228 */
5093 + "tou", "phigh", "thayta", "ohmega", /* 232 */
5094 + "delta", "infinity", "phigh", "epsilaun", /* 236 */
5095 +"intersection", "identical to", "plus or minus", "equal grater than", /* 240 */
5096 + "less than equal", "upper integral", "lower integral", /* 244 */
5097 + "divided by", "almost equal", "degrees", /* 247 */
5098 + "centre dot", "bullet", "square root", /* 250 */
5099 + "power", "squared", "black square", "white space" /* 252 */
5100 +};
5101 +
5102 +u_short spk_chartab[256] = {
5103 + B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, /* 0-7 */
5104 + B_CTL, B_CTL, A_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, /* 8-15 */
5105 + B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, /*16-23 */
5106 + B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, B_CTL, /* 24-31 */
5107 +WDLM, A_PUNC, PUNC, PUNC, PUNC, PUNC, PUNC, A_PUNC, /* !"#$%&' */
5108 +PUNC, PUNC, PUNC, PUNC, A_PUNC, A_PUNC, A_PUNC, PUNC, /* ( )*+, -./ */
5109 +NUM, NUM, NUM, NUM, NUM, NUM, NUM, NUM, /* 01234567 */
5110 +NUM, NUM, A_PUNC, PUNC, PUNC, PUNC, PUNC, A_PUNC, /* 89:;<=>? */
5111 +PUNC, A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, /* @ABCDEFG */
5112 +A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, /* HIJKLMNO */
5113 +A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, A_CAP, /* PQRSTUVW */
5114 +A_CAP, A_CAP, A_CAP, PUNC, PUNC, PUNC, PUNC, PUNC, /* XYZ[\]^_ */
5115 +PUNC, ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, /* `abcdefg */
5116 +ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, /* hijklmno */
5117 +ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, ALPHA, /* pqrstuvw */
5118 +ALPHA, ALPHA, ALPHA, PUNC, PUNC, PUNC, PUNC, 0, /* xyz{|}~ */
5119 +B_CAPSYM, B_CAPSYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 128-135 */
5120 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_CAPSYM, /* 136-143 */
5121 +B_CAPSYM, B_CAPSYM, B_SYM, B_CAPSYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 144-151 */
5122 +B_SYM, B_SYM, B_CAPSYM, B_CAPSYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 152-159 */
5123 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_CAPSYM, B_SYM, /* 160-167 */
5124 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 168-175 */
5125 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 176-183 */
5126 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 184-191 */
5127 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 192-199 */
5128 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 200-207 */
5129 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 208-215 */
5130 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 216-223 */
5131 +B_SYM, B_SYM, B_SYM, B_CAPSYM, B_SYM, B_CAPSYM, B_SYM, B_SYM, /* 224-231 */
5132 +B_SYM, B_CAPSYM, B_CAPSYM, B_CAPSYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 232-239 */
5133 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, /* 240-247 */
5134 +B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM, B_SYM /* 248-255 */
5135 +};
5136 +
5137 +int spk_keydown = 0;
5138 +static u_char spk_lastkey = 0, spk_close_press = 0, keymap_flags = 0;
5139 +static u_char last_keycode = 0, this_speakup_key = 0;
5140 +static u_long last_spk_jiffy = 0;
5141 +
5142 +spk_t *speakup_console[MAX_NR_CONSOLES];
5143 +
5144 +int spk_setup (char *str )
5145 +{
5146 + int ints[4];
5147 + str = get_options (str, ARRAY_SIZE (ints ), ints );
5148 + if (ints[0] > 0 && ints[1] >= 0 )
5149 + synth_port_forced = ints[1];
5150 + return 1;
5151 +}
5152 +
5153 +int spk_ser_setup (char *str )
5154 +{
5155 + int lookup[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
5156 + int ints[4];
5157 + str = get_options (str, ARRAY_SIZE (ints ), ints );
5158 + if (ints[0] > 0 && ints[1] >= 0 )
5159 + synth_port_forced = lookup[ints[1]];
5160 + return 1;
5161 +}
5162 +
5163 +int spk_synth_setup (char *str )
5164 +{
5165 + size_t len = MIN (strlen (str ), 9 );
5166 + memcpy (synth_name, str, len );
5167 + synth_name[len] = '\0';
5168 + return 1;
5169 +}
5170 +
5171 +__setup ("speakup_port=", spk_setup );
5172 +__setup ("speakup_ser=", spk_ser_setup );
5173 +__setup ("speakup_synth=", spk_synth_setup );
5174 +
5175 +char *
5176 +strlwr (char *s )
5177 +{
5178 + char *p;
5179 + for (p = s; *p; p++ ) {
5180 + if (*p >= CAP_A && *p <= CAP_Z ) *p |= 32;
5181 + }
5182 + return s;
5183 +}
5184 +
5185 +static void
5186 +bleep (u_short val )
5187 +{
5188 + static short vals[] = { 350, 370, 392, 414, 440, 466, 491, 523,
5189 +554, 587, 619, 659 };
5190 + short freq;
5191 + int time = bleep_time;
5192 + freq = vals[val%12];
5193 + if (val > 11 )
5194 + freq *= (1<<(val/12 ) );
5195 + kd_mksound (freq, time );
5196 +}
5197 +
5198 +void
5199 +speakup_shut_up (struct vc_data *vc )
5200 +{
5201 + if (spk_killed ) return;
5202 + spk_shut_up |= 0x01;
5203 + spk_parked &= 0xfe;
5204 + speakup_date (vc );
5205 + if (synth == NULL ) return;
5206 + do_flush( );
5207 +}
5208 +
5209 +void
5210 +speech_kill (struct vc_data *vc )
5211 +{
5212 + char val = synth->is_alive ( );
5213 + if (val == 0 ) return;
5214 + /* re-enables synth, if disabled */
5215 + if (val == 2 || spk_killed ) { /* dead */
5216 + spk_shut_up &= ~0x40;
5217 + synth_write_msg ("Eyem a Lighve!" );
5218 + } else {
5219 + synth_write_msg ("You killed speak up!" );
5220 + spk_shut_up |= 0x40;
5221 + }
5222 +}
5223 +
5224 +static void
5225 +speakup_off (struct vc_data *vc )
5226 +{
5227 + if (spk_shut_up & 0x80 ) {
5228 + spk_shut_up &= 0x7f;
5229 + synth_write_msg ("hey. That's better!" );
5230 + } else {
5231 + spk_shut_up |= 0x80;
5232 + synth_write_msg ("You turned me off!" );
5233 + }
5234 + speakup_date (vc );
5235 +}
5236 +
5237 +static void
5238 +speakup_parked (struct vc_data *vc )
5239 +{
5240 + if (spk_parked & 0x80 ) {
5241 + spk_parked = 0;
5242 + synth_write_msg ("unparked!" );
5243 + } else {
5244 + spk_parked |= 0x80;
5245 + synth_write_msg ("parked!" );
5246 + }
5247 +}
5248 +
5249 +/* ------ cut and paste ----- */
5250 +/* Don't take this from <ctype.h>: 011-015 on the screen aren't spaces */
5251 +#undef isspace
5252 +#define isspace(c) ((c) == ' ')
5253 +/* Variables for selection control. */
5254 +struct vc_data *spk_sel_cons; /* defined in selection.c must not be disallocated */
5255 +static volatile int sel_start = -1; /* cleared by clear_selection */
5256 +static int sel_end;
5257 +static int sel_buffer_lth;
5258 +static char *sel_buffer;
5259 +
5260 +static unsigned char
5261 +sel_pos(int n)
5262 +{
5263 + return inverse_translate(spk_sel_cons, screen_glyph(spk_sel_cons, n));
5264 +}
5265 +
5266 +static void
5267 +speakup_clear_selection(void)
5268 +{
5269 + sel_start = -1;
5270 +}
5271 +
5272 +/* does screen address p correspond to character at LH/RH edge of screen? */
5273 +static inline int atedge(const int p, int size_row)
5274 +{
5275 + return (!(p % size_row) || !((p + 2) % size_row));
5276 +}
5277 +
5278 +/* constrain v such that v <= u */
5279 +static inline unsigned short limit(const unsigned short v, const unsigned short u)
5280 +{
5281 + return (v > u) ? u : v;
5282 +}
5283 +
5284