From: Alan Cox Date: Fri, 23 Nov 2007 20:11:49 +0000 (-0500) Subject: Import 2.0.35pre5 X-Git-Tag: 2.0.35pre5 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=336047f99d5bc27c58c3a0bfdb2bd2adb8dae002;p=history.git Import 2.0.35pre5 --- diff --git a/Documentation/Configure.help b/Documentation/Configure.help index cf1f6813f8b5..e836ee8c7676 100644 --- a/Documentation/Configure.help +++ b/Documentation/Configure.help @@ -2296,72 +2296,100 @@ CONFIG_BAYCOM inserted in and removed from the running kernel whenever you want), say M here and read Documentation/modules.txt. This is recommended. -Soundcard modem driver for AX.25 +Sound card modem driver for AX.25 CONFIG_SOUNDMODEM - This experimental driver allows a standard SoundBlaster or - WindowsSoundSystem compatible soundcard to be used as a packet radio - modem. To configure the driver, use the sethdlc, smdiag and smmixer + This experimental driver allows a standard SoundBlaster or + WindowsSoundSystem compatible sound card to be used as a packet radio + modem (NOT as a telephone modem!), to send digital traffic over + amateur radio. + + To configure the driver, use the sethdlc, smdiag and smmixer utilities available in the standard ax25 utilities package. For - informations on how to key the transmitter, see - http://www.ife.ee.ethz.ch/~sailer/pcf/ptt_circ/ptt.html and - drivers/net/README.soundmodem. If you want to compile this as a - module ( = code which can be inserted in and removed from the - running kernel whenever you want), say M here and read - Documentation/modules.txt. This is recommended. + information on how to key the transmitter, see + http://www.ife.ee.ethz.ch/~sailer/pcf/ptt_circ/ptt.html (to browse + the WWW, you need to have access to a machine on the Internet that + has a program like lynx or netscape) and + Documentation/networking/soundmodem.txt. -Soundcard modem support for SoundBlaster and compatible cards -CONFIG_SOUNDMODEM_SBC - This option enables the soundmodem driver to use SoundBlaster - and compatible cards. Dual mode cards (i.e. WSS cards with a - SoundBlaster emulation) should be used in WSS mode because - this results in usually better performance. + If you want to compile this driver as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read Documentation/modules.txt. This is recommended. + The module will be called soundmodem.o. -Soundcard modem support for WSS and Crystal cards +Sound card modem support for SoundBlaster and compatible cards +CONFIG_SOUNDMODEM_SBC + This option enables the soundmodem driver to use SoundBlaster and + compatible cards. If you have a dual mode card (i.e. a WSS cards + with a SoundBlaster emulation) you should say N here and Y to + "Sound card modem support for WSS and Crystal cards", below, because + this usually results in better performance. This option also supports + SB16/32/64 in full duplex mode. + +Sound card modem support for WSS and Crystal cards CONFIG_SOUNDMODEM_WSS This option enables the soundmodem driver to use WindowsSoundSystem compatible cards. These cards feature a codec chip from either - Analog Devices (such as AD1848, AD1845, AD1812) or Crystal Semiconductors - (such as CS4248, CS423x). This option also supports the WSS full duplex - operation which currently works with Crystal CS423x chips. If you don't - need full duplex operation, do not enable it to save performance. + Analog Devices (such as AD1848, AD1845, AD1812) or Crystal + Semiconductors (such as CS4248, CS423x). This option also supports + the WSS full duplex operation which currently works with Crystal + CS423x chips. If you don't need full duplex operation, do not enable + it to save performance. -Soundcard modem support for 1200 baud AFSK modulation +Sound card modem support for 1200 baud AFSK modulation CONFIG_SOUNDMODEM_AFSK1200 This option enables the soundmodem driver 1200 baud AFSK modem, compatible to popular modems using TCM3105 or AM7911. The demodulator requires about 12% of the CPU power of a Pentium 75 CPU per channel. -Soundcard modem support for 4800 baud HAPN-1 modulation +Sound card modem support for 2400 baud AFSK modulation (7.3728MHz crystal) +CONFIG_SOUNDMODEM_AFSK2400_7 + This option enables the soundmodem driver 2400 baud AFSK modem, + compatible to TCM3105 modems (over-)clocked with a 7.3728MHz + crystal. Note that the availability of this driver does _not_ imply + that I recommend building such links. It is only here since users + especially in eastern Europe have asked me to do so. In fact this + modulation scheme has many disadvantages, mainly its incompatibility + with many transceiver designs and the fact that the TCM3105 (if + used) is operated widely outside its specifications. + +Sound card modem support for 2400 baud AFSK modulation (8MHz crystal) +CONFIG_SOUNDMODEM_AFSK2400_8 + This option enables the soundmodem driver 2400 baud AFSK modem, + compatible to TCM3105 modems (over-)clocked with an 8MHz crystal. + Note that the availability of this driver does _not_ imply that I + recommend building such links. It is only here since users + especially in eastern Europe have asked me to do so. In fact this + modulation scheme has many disadvantages, mainly its incompatibility + with many transceiver designs and the fact that the TCM3105 (if + used) is operated widely outside its specifications. + +Sound card modem support for 2666 baud AFSK modulation +CONFIG_SOUNDMODEM_AFSK2666 + This option enables the soundmodem driver 2666 baud AFSK modem. + This modem is experimental, and not compatible to anything + else I know of. + +Sound card modem support for 4800 baud 8PSK modulation +CONFIG_SOUNDMODEM_PSK4800 + This option enables the soundmodem driver 4800 baud 8PSK modem. + This modem is experimental, and not compatible to anything + else I know of. + +Sound card modem support for 4800 baud HAPN-1 modulation CONFIG_SOUNDMODEM_HAPN4800 - This option enables the soundmodem driver 4800 baud HAPN-1 compatible - modem. This modulation seems to be widely used 'down under' and in - the netherlands. Here, nobody uses it, so I could not test if it works. - It is compatible to itself, however :-) + This option enables the soundmodem driver 4800 baud HAPN-1 + compatible modem. This modulation seems to be widely used 'down + under' and in the Netherlands. Here, nobody uses it, so I could not + test if it works. It is compatible to itself, however :-) -Soundcard modem support for 9600 baud FSK G3RUH modulation +Sound card modem support for 9600 baud FSK G3RUH modulation CONFIG_SOUNDMODEM_FSK9600 This option enables the soundmodem driver 9600 baud FSK modem, compatible to the G3RUH standard. The demodulator requires about 4% - of the CPU power of a Pentium 75 CPU per channel. - -Soundcard modem support using floating point arithmetic -CONFIG_SOUNDMODEM_FLOAT - This option enables floating point calculations to be used for the - AFSK1200 baud modem. The Intel Pentium is a perverted chip because - integer multiplications are, altough easier to implement in silicon, - an order of a magnitude slower than floating point calculations. - Enabling this option uses a highly optimized assembler routine for - correlations, modelled after the one published by Phil Karn, KA9Q. - This reduces the computing power needed on Intel Pentium chips to about - 50%. On the other hand, Pentium clones with faster integer multiply and - slower floating point multiply will probably take longer with this - option turned on. As a rule of thumb, enable it for Intel Pentium and - Pentium Pro processors, and disable it for anything else. - I (sailer@ife.ee.ethz.ch) am very interested in figures. If you are - willing to give me a feedback, please compile the driver once with this - option enabled and once with it disabled, and send me the cycle counter - numbers obtained with both compilations, and your exact chip. The cycle - counter numbers can be optained by a recent sethdlc utility. + of the CPU power of a Pentium 75 CPU per channel. You can say Y to + both 1200 baud AFSK and 9600 baud FSK if you want (but obviously you + can only use one protocol at a time, depending on what the other end + can understand). PLIP (parallel port) support CONFIG_PLIP diff --git a/Documentation/baycom.txt b/Documentation/baycom.txt deleted file mode 100644 index 56886040dbd2..000000000000 --- a/Documentation/baycom.txt +++ /dev/null @@ -1,131 +0,0 @@ - LINUX DRIVER FOR BAYCOM MODEMS - - Thomas M. Sailer, HB9JNX/AE4WA, - -This document describes the Linux Kernel Driver for simple Baycom style -amateur radio modems. The driver supports the following modems: - -ser12: This is a very simple 1200 baud AFSK modem. The modem consists only - of a modulator/demodulator chip, usually a TI TCM3105. The computer - is responsible for regenerating the receiver bit clock, as well as - for handling the HDLC protocol. The modem connects to a serial port, - hence the name. Since the serial port is not used as an async serial - port, the kernel driver for serial ports cannot be used, and this - driver only supports standard serial hardware (8250, 16450, 16550) - -par96: This is a modem for 9600 baud FSK compatible to the G3RUH standard. - The modem does all the filtering and regenerates the receiver clock. - Data is transferred from and to the PC via a shift register. - The shift register is filled with 16 bits and an interrupt is signalled. - The PC then empties the shift register in a burst. This modem connects - to the parallel port, hence the name. The modem leaves the - implementation of the HDLC protocol and the scrambler polynomial to - the PC. - -picpar: This is a redesign of the par96 modem by Henning Rech, DF9IC. The modem - is protocol compatible to par96, but uses only three low power ICs - and can therefore be fed from the parallel port and does not require - an additional power supply. Furthermore, it incorporates a carrier - detect circuitry. - -All of the above modems only support half duplex communications. However, -the driver supports the KISS (see below) fullduplex command. It then simply -starts to send as soon as there's a packet to transmit and does not care -about DCD, i.e. it starts to send even if there's someone else on the channel. -This command is required by some implementations of the DAMA channel -access protocol. - - -The Interface of the driver - -Unlike previous drivers, the driver is no longer a character device, -but it is now a true kernel network interface. Installation is therefore -simple. Once installed, four interfaces named bc[0-3] are available. -sethdlc from the ax25 utilities may be used to set driver states etc. -Users of userland AX.25 stacks may use the net2kiss utility (also available -in the ax25 utilities package) to converts packets of a network interface -to a KISS stream on a pseudo tty. There's also a patch available from -me for WAMPES which allows attaching a kernel network interface directly. - - -Configuring the driver - -Every time the driver is inserted into the kernel, it has to know which -modems it should access at which ports. This can be done with the setbaycom -utility. If you are only using one modem, you can also configure the -driver from the insmod command line (or by means of an option line in -/etc/conf.modules). - -Examples: (use either method, not both) - insmod baycom mode="ser12*" iobase=0x3f8 irq=4 - sethdlc -i bc0 -p type "ser12*" io 0x3f8 irq 4 - -Both lines configure the first port to drive a ser12 modem at the first -serial port (COM1 under DOS). The star ('*') instructs the driver to use -the software DCD algorithm (see below). - - insmod baycom mode="par96*" iobase=0x378 irq=7 - sethdlc -i bc0 -p type "par96*" io 0x378 irq 7 - -Both lines configure the first port to drive a par96 or par97 modem at the -first parallel port (LPT1 under DOS). options=1 instructs the driver to use -the software DCD algorithm (see below). - - insmod baycom mode="par96" iobase=0x278 irq=5 - sethdlc -i bc0 -p type "par96" io 0x278 irq 5 - -Both lines configure the first port to drive a picpar modem at the -second parallel port (LPT2 under DOS). The driver uses the hardware DCD -signalled by the picpar modem (see below). - -The channel access parameters can be set with sethdlc -a or kissparms. -Note that both utilities interpret the values slightly different. - - - -Hardware DCD versus Software DCD - -To avoid collisions on the air, the driver must know when the channel is -busy. This is the task of the DCD circuitry/software. The driver may either -utilise a software DCD algorithm (a star after the mode string) or use a DCD -signal from the hardware (no star). - -ser12: if software DCD is utilised, the radio's squelch should always be - open. It is highly recommended to use the software DCD algorithm, - as it is much faster than most hardware squelch circuitry. The - disadvantage is a slightly higher load on the system. - -par96: the software DCD algorithm for this type of modem is rather poor. - The modem simply does not provide enough information to implement - a reasonable DCD algorithm in software. Therefore, if your radio - feeds the DCD input of the par96 modem, the use of the hardware - DCD circuitry is recommended. - -picpar: the picpar modem features a builtin DCD hardware, which is highly - recommended. - - - -Compatibility with the rest of the Linux kernel - -The serial driver, the line printer (lp) driver and the baycom driver compete -for the same hardware resources. Of course only one driver can access a given -interface at a time. The serial driver grabs all interfaces it can find at -startup time. Therefore the baycom driver subsequently won't be able to -access a serial port. You might therefore find it necessary to release -a port owned by the serial driver with 'setserial /dev/ttyS# uart none', where -# is the number of the interface. The baycom driver does not reserve any -port at startup, unless one is specified on the 'insmod' command line. Another -method to solve the problem is to compile all three drivers as modules and -leave it to kerneld to load the correct driver depending on the application. - - -Further reading - -Please take a look at http://www.ife.ee.ethz.ch/~sailer/ham/linux/hdlc.html -for further informations on the driver. - - -vy 73s de -Tom Sailer, sailer@ife.ee.ethz.ch -Packet Radio: hb9jnx@hb9w.che.eu diff --git a/Documentation/networking/baycom.txt b/Documentation/networking/baycom.txt new file mode 100644 index 000000000000..56886040dbd2 --- /dev/null +++ b/Documentation/networking/baycom.txt @@ -0,0 +1,131 @@ + LINUX DRIVER FOR BAYCOM MODEMS + + Thomas M. Sailer, HB9JNX/AE4WA, + +This document describes the Linux Kernel Driver for simple Baycom style +amateur radio modems. The driver supports the following modems: + +ser12: This is a very simple 1200 baud AFSK modem. The modem consists only + of a modulator/demodulator chip, usually a TI TCM3105. The computer + is responsible for regenerating the receiver bit clock, as well as + for handling the HDLC protocol. The modem connects to a serial port, + hence the name. Since the serial port is not used as an async serial + port, the kernel driver for serial ports cannot be used, and this + driver only supports standard serial hardware (8250, 16450, 16550) + +par96: This is a modem for 9600 baud FSK compatible to the G3RUH standard. + The modem does all the filtering and regenerates the receiver clock. + Data is transferred from and to the PC via a shift register. + The shift register is filled with 16 bits and an interrupt is signalled. + The PC then empties the shift register in a burst. This modem connects + to the parallel port, hence the name. The modem leaves the + implementation of the HDLC protocol and the scrambler polynomial to + the PC. + +picpar: This is a redesign of the par96 modem by Henning Rech, DF9IC. The modem + is protocol compatible to par96, but uses only three low power ICs + and can therefore be fed from the parallel port and does not require + an additional power supply. Furthermore, it incorporates a carrier + detect circuitry. + +All of the above modems only support half duplex communications. However, +the driver supports the KISS (see below) fullduplex command. It then simply +starts to send as soon as there's a packet to transmit and does not care +about DCD, i.e. it starts to send even if there's someone else on the channel. +This command is required by some implementations of the DAMA channel +access protocol. + + +The Interface of the driver + +Unlike previous drivers, the driver is no longer a character device, +but it is now a true kernel network interface. Installation is therefore +simple. Once installed, four interfaces named bc[0-3] are available. +sethdlc from the ax25 utilities may be used to set driver states etc. +Users of userland AX.25 stacks may use the net2kiss utility (also available +in the ax25 utilities package) to converts packets of a network interface +to a KISS stream on a pseudo tty. There's also a patch available from +me for WAMPES which allows attaching a kernel network interface directly. + + +Configuring the driver + +Every time the driver is inserted into the kernel, it has to know which +modems it should access at which ports. This can be done with the setbaycom +utility. If you are only using one modem, you can also configure the +driver from the insmod command line (or by means of an option line in +/etc/conf.modules). + +Examples: (use either method, not both) + insmod baycom mode="ser12*" iobase=0x3f8 irq=4 + sethdlc -i bc0 -p type "ser12*" io 0x3f8 irq 4 + +Both lines configure the first port to drive a ser12 modem at the first +serial port (COM1 under DOS). The star ('*') instructs the driver to use +the software DCD algorithm (see below). + + insmod baycom mode="par96*" iobase=0x378 irq=7 + sethdlc -i bc0 -p type "par96*" io 0x378 irq 7 + +Both lines configure the first port to drive a par96 or par97 modem at the +first parallel port (LPT1 under DOS). options=1 instructs the driver to use +the software DCD algorithm (see below). + + insmod baycom mode="par96" iobase=0x278 irq=5 + sethdlc -i bc0 -p type "par96" io 0x278 irq 5 + +Both lines configure the first port to drive a picpar modem at the +second parallel port (LPT2 under DOS). The driver uses the hardware DCD +signalled by the picpar modem (see below). + +The channel access parameters can be set with sethdlc -a or kissparms. +Note that both utilities interpret the values slightly different. + + + +Hardware DCD versus Software DCD + +To avoid collisions on the air, the driver must know when the channel is +busy. This is the task of the DCD circuitry/software. The driver may either +utilise a software DCD algorithm (a star after the mode string) or use a DCD +signal from the hardware (no star). + +ser12: if software DCD is utilised, the radio's squelch should always be + open. It is highly recommended to use the software DCD algorithm, + as it is much faster than most hardware squelch circuitry. The + disadvantage is a slightly higher load on the system. + +par96: the software DCD algorithm for this type of modem is rather poor. + The modem simply does not provide enough information to implement + a reasonable DCD algorithm in software. Therefore, if your radio + feeds the DCD input of the par96 modem, the use of the hardware + DCD circuitry is recommended. + +picpar: the picpar modem features a builtin DCD hardware, which is highly + recommended. + + + +Compatibility with the rest of the Linux kernel + +The serial driver, the line printer (lp) driver and the baycom driver compete +for the same hardware resources. Of course only one driver can access a given +interface at a time. The serial driver grabs all interfaces it can find at +startup time. Therefore the baycom driver subsequently won't be able to +access a serial port. You might therefore find it necessary to release +a port owned by the serial driver with 'setserial /dev/ttyS# uart none', where +# is the number of the interface. The baycom driver does not reserve any +port at startup, unless one is specified on the 'insmod' command line. Another +method to solve the problem is to compile all three drivers as modules and +leave it to kerneld to load the correct driver depending on the application. + + +Further reading + +Please take a look at http://www.ife.ee.ethz.ch/~sailer/ham/linux/hdlc.html +for further informations on the driver. + + +vy 73s de +Tom Sailer, sailer@ife.ee.ethz.ch +Packet Radio: hb9jnx@hb9w.che.eu diff --git a/Documentation/networking/soundmodem.txt b/Documentation/networking/soundmodem.txt new file mode 100644 index 000000000000..b8230bedf4c4 --- /dev/null +++ b/Documentation/networking/soundmodem.txt @@ -0,0 +1,96 @@ + LINUX DRIVER FOR SOUNDCARDS AS AX.25 MODEMS + + Thomas M. Sailer, HB9JNX/AE4WA, + +This driver allows either SoundBlaster (sbc) or WindowsSoundSystem (wss) +compatible soundcards to be used as either 1200 baud AFSK or 9600 baud FSK +AX.25 packet radio modems. Only half duplex operation is supported by +the SoundBlaster driver. Fullduplex is supported for WSS chipsets capable +of addressing two DMA channels. The driver needs some processing power! +A 486DX/2 66MHz is a minimum requirement, otherwise interactive performance +of the computer may become sluggish. + + +The Interface of the driver + +The driver provides a kernel network drivers named sm[0-3]. sethdlc +from the ax25 utilities may be used to set driver states etc. Users +of userland AX.25 stacks may use the net2kiss utility (also available +in the ax25 utilities package) to converts packets of a network interface +to a KISS stream on a pseudo tty. There's also a patch available from +me for WAMPES which allows attaching a kernel network interface directly. + + +Configuring the driver + +Some sound cards need to be initialized before they operate in either +SoundBlaster or WSS compatibility mode. The driver does _NOT_ do this; +you may use the standard linux sound driver to initialize the soundcard; +compile it as a module, and do + insmod sound + rmmod sound +The soundcard should then be initialized correctly. isapnptools is another +package that can configure PnP soundcards. If your soundcard contains +a Crystal CS423x chip, you may also try the setcrystal utility in the +ax25-utilities package. + +Every time the driver is inserted into the kernel, it has to know which +modems it should access at which ports. This can be done with the sethdlc +utility. If you are only using one modem, you can also configure the +driver from the insmod command line (or by means of an option line in +/etc/conf.modules). + +Examples: (use either method, not both) + insmod soundmodem mode="sbc:afsk1200" iobase=0x220 irq=5 dma=1 + sethdlc -i sm0 -p hw sbc type afsk1200 io 0x220 irq 5 dma 1 + +Both lines configure the first port to drive a soundblaster card +in 1200 baud AFSK mode. + +The channel access parameters can be set with sethdlc -a or kissparms. +Note that both utilities interpret the values slightly different. + + +Input and output levels + +It is important that the input and output levels are adjusted properly. +There are two utilities, available in the ax25 utilities distribution, +to facilitate this: smmixer and smdiag. smdiag allows you to display +the input signal in an oscilloscope like display or an eye diagram. +smmixer allows you to adjust input/output levels. See the respective +man pages. These two utilities have two counterparts: xfsmmixer and +xfsmdiag. They both require the FORMS to compile, and provide a nicer +user interface. Functionality is the same, though. + + +Transmitter keying + +Since soundcards do not have a DC coupled output; PTT keying options include +the following: +* VOX circuitry +* Serial port pin +* Parallel port pin +* MPU401 MIDI output via a retriggerable monoflop. +Circuit schematics may be found at +http://www.ife.ee.ethz.ch/~sailer/pcf/ptt_circ/ptt.html. + + +Compatibility with the rest of the Linux kernel + +The sound driver and the soundcard modem driver compete for the same +hardware resources. Of course only one driver can access a given +interface at a time. Worse yet, the sound driver grabs the soundcard +at startup time. Therefore the soundcard modem driver subsequently won't +be able to access the soundcard. You might therefore find it necessary to +unload the sound driver before using the soundcard modem driver. + + +Further reading + +Please take a look at http://www.ife.ee.ethz.ch/~sailer/ham/linux/hdlc.html +for further informations on the driver. + + +vy 73s de +Tom Sailer, sailer@ife.ee.ethz.ch +Packet Radio: hb9jnx@hb9w.che.eu diff --git a/Documentation/soundmodem.txt b/Documentation/soundmodem.txt deleted file mode 100644 index b8230bedf4c4..000000000000 --- a/Documentation/soundmodem.txt +++ /dev/null @@ -1,96 +0,0 @@ - LINUX DRIVER FOR SOUNDCARDS AS AX.25 MODEMS - - Thomas M. Sailer, HB9JNX/AE4WA, - -This driver allows either SoundBlaster (sbc) or WindowsSoundSystem (wss) -compatible soundcards to be used as either 1200 baud AFSK or 9600 baud FSK -AX.25 packet radio modems. Only half duplex operation is supported by -the SoundBlaster driver. Fullduplex is supported for WSS chipsets capable -of addressing two DMA channels. The driver needs some processing power! -A 486DX/2 66MHz is a minimum requirement, otherwise interactive performance -of the computer may become sluggish. - - -The Interface of the driver - -The driver provides a kernel network drivers named sm[0-3]. sethdlc -from the ax25 utilities may be used to set driver states etc. Users -of userland AX.25 stacks may use the net2kiss utility (also available -in the ax25 utilities package) to converts packets of a network interface -to a KISS stream on a pseudo tty. There's also a patch available from -me for WAMPES which allows attaching a kernel network interface directly. - - -Configuring the driver - -Some sound cards need to be initialized before they operate in either -SoundBlaster or WSS compatibility mode. The driver does _NOT_ do this; -you may use the standard linux sound driver to initialize the soundcard; -compile it as a module, and do - insmod sound - rmmod sound -The soundcard should then be initialized correctly. isapnptools is another -package that can configure PnP soundcards. If your soundcard contains -a Crystal CS423x chip, you may also try the setcrystal utility in the -ax25-utilities package. - -Every time the driver is inserted into the kernel, it has to know which -modems it should access at which ports. This can be done with the sethdlc -utility. If you are only using one modem, you can also configure the -driver from the insmod command line (or by means of an option line in -/etc/conf.modules). - -Examples: (use either method, not both) - insmod soundmodem mode="sbc:afsk1200" iobase=0x220 irq=5 dma=1 - sethdlc -i sm0 -p hw sbc type afsk1200 io 0x220 irq 5 dma 1 - -Both lines configure the first port to drive a soundblaster card -in 1200 baud AFSK mode. - -The channel access parameters can be set with sethdlc -a or kissparms. -Note that both utilities interpret the values slightly different. - - -Input and output levels - -It is important that the input and output levels are adjusted properly. -There are two utilities, available in the ax25 utilities distribution, -to facilitate this: smmixer and smdiag. smdiag allows you to display -the input signal in an oscilloscope like display or an eye diagram. -smmixer allows you to adjust input/output levels. See the respective -man pages. These two utilities have two counterparts: xfsmmixer and -xfsmdiag. They both require the FORMS to compile, and provide a nicer -user interface. Functionality is the same, though. - - -Transmitter keying - -Since soundcards do not have a DC coupled output; PTT keying options include -the following: -* VOX circuitry -* Serial port pin -* Parallel port pin -* MPU401 MIDI output via a retriggerable monoflop. -Circuit schematics may be found at -http://www.ife.ee.ethz.ch/~sailer/pcf/ptt_circ/ptt.html. - - -Compatibility with the rest of the Linux kernel - -The sound driver and the soundcard modem driver compete for the same -hardware resources. Of course only one driver can access a given -interface at a time. Worse yet, the sound driver grabs the soundcard -at startup time. Therefore the soundcard modem driver subsequently won't -be able to access the soundcard. You might therefore find it necessary to -unload the sound driver before using the soundcard modem driver. - - -Further reading - -Please take a look at http://www.ife.ee.ethz.ch/~sailer/ham/linux/hdlc.html -for further informations on the driver. - - -vy 73s de -Tom Sailer, sailer@ife.ee.ethz.ch -Packet Radio: hb9jnx@hb9w.che.eu diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index e592d757b5b4..d22d4df26cf9 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -322,7 +322,7 @@ static const char * AMDmodel(void) if (x86_model < 16) for (i=0; ichipset = ide_promise_udma; init_triton_dma(hwif0, bmiba); init_triton_dma(hwif1, bmiba + 0x08); + return; abort: printk("ide: Promise/33 not configured correctly (BIOS)\n"); } diff --git a/drivers/net/Config.in b/drivers/net/Config.in index e279df45ca76..e2ee768b40d3 100644 --- a/drivers/net/Config.in +++ b/drivers/net/Config.in @@ -33,14 +33,10 @@ if [ "$CONFIG_NET_RADIO" != "n" ]; then bool 'Soundmodem support for 1200 baud AFSK modulation' CONFIG_SOUNDMODEM_AFSK1200 bool 'Soundmodem support for 2400 baud AFSK modulation (7.3728MHz crystal)' CONFIG_SOUNDMODEM_AFSK2400_7 bool 'Soundmodem support for 2400 baud AFSK modulation (8MHz crystal)' CONFIG_SOUNDMODEM_AFSK2400_8 + bool 'Soundmodem support for 2666 baud AFSK modulation' CONFIG_SOUNDMODEM_AFSK2666 bool 'Soundmodem support for 4800 baud HAPN-1 modulation' CONFIG_SOUNDMODEM_HAPN4800 + bool 'Soundmodem support for 4800 baud PSK modulation' CONFIG_SOUNDMODEM_PSK4800 bool 'Soundmodem support for 9600 baud FSK G3RUH modulation' CONFIG_SOUNDMODEM_FSK9600 - if [ -f drivers/net/soundmodem/sm_afsk2666.c ]; then - bool 'Soundmodem support for 2666 baud AFSK modulation' CONFIG_SOUNDMODEM_AFSK2666 - fi - if [ -f drivers/net/soundmodem/sm_psk4800.c ]; then - bool 'Soundmodem support for 4800 baud PSK modulation' CONFIG_SOUNDMODEM_PSK4800 - fi fi fi tristate 'Serial port KISS driver for AX.25' CONFIG_MKISS diff --git a/drivers/net/soundmodem/gentbl.c b/drivers/net/soundmodem/gentbl.c index cb8cb246ff8a..e67733831256 100644 --- a/drivers/net/soundmodem/gentbl.c +++ b/drivers/net/soundmodem/gentbl.c @@ -81,7 +81,6 @@ static void gentbl_costab(FILE *f, unsigned int nbits) static void gentbl_afsk1200(FILE *f) { int i, v, sum; - float fv, fsum; #define ARGLO(x) 2.0*M_PI*(double)x*(double)AFSK12_TX_FREQ_LO/(double)AFSK12_SAMPLE_RATE #define ARGHI(x) 2.0*M_PI*(double)x*(double)AFSK12_TX_FREQ_HI/(double)AFSK12_SAMPLE_RATE @@ -93,34 +92,7 @@ static void gentbl_afsk1200(FILE *f) "#define AFSK12_CORRLEN %u\n\n", AFSK12_SAMPLE_RATE, AFSK12_TX_FREQ_LO, AFSK12_TX_FREQ_HI, AFSK12_CORRLEN); - fprintf(f, "#if defined(CONFIG_SOUNDMODEM_FLOAT) && " - "(defined(CONFIG_M586) || defined(CONFIG_M686))\n\n" - "static const float afsk12_tx_lo_i_f[] = {\n\t"); - for(fsum = i = 0; i < AFSK12_CORRLEN; i++) { - fsum += (fv = cos(ARGLO(i))); - fprintf(f, " %7f%c", fv, (i < AFSK12_CORRLEN-1) ? ',' : ' '); - } - fprintf(f, "\n};\n#define SUM_AFSK12_TX_LO_Q %7f\n\n" - "static const float afsk12_tx_lo_q_f[] = {\n\t", fsum); - for(fsum = i = 0; i < AFSK12_CORRLEN; i++) { - fsum += (fv = sin(ARGLO(i))); - fprintf(f, " %7f%c", fv, (i < AFSK12_CORRLEN-1) ? ',' : ' '); - } - fprintf(f, "\n};\n#define SUM_AFSK12_TX_LO_Q %7f\n\n" - "static const float afsk12_tx_hi_i_f[] = {\n\t", fsum); - for(fsum = i = 0; i < AFSK12_CORRLEN; i++) { - fsum += (fv = cos(ARGHI(i))); - fprintf(f, " %7f%c", fv, (i < AFSK12_CORRLEN-1) ? ',' : ' '); - } - fprintf(f, "\n};\n#define SUM_AFSK12_TX_HI_I %7f\n\n" - "static const float afsk12_tx_hi_q_f[] = {\n\t", fsum); - for(fsum = i = 0; i < AFSK12_CORRLEN; i++) { - fsum += (fv = sin(ARGHI(i))); - fprintf(f, " %7f%c", fv, (i < AFSK12_CORRLEN-1) ? ',' : ' '); - } - fprintf(f, "\n};\n#define SUM_AFSK12_TX_HI_Q %7f\n\n" - "#else /* CONFIG_SOUNDMODEM_FLOAT */\n\n" - "static const int afsk12_tx_lo_i[] = {\n\t", fsum); + fprintf(f, "static const int afsk12_tx_lo_i[] = {\n\t"); for(sum = i = 0; i < AFSK12_CORRLEN; i++) { sum += (v = 127.0*cos(ARGLO(i))); fprintf(f, " %4i%c", v, (i < AFSK12_CORRLEN-1) ? ',' : ' '); @@ -143,8 +115,7 @@ static void gentbl_afsk1200(FILE *f) sum += (v = 127.0*sin(ARGHI(i))); fprintf(f, " %4i%c", v, (i < AFSK12_CORRLEN-1) ? ',' : ' '); } - fprintf(f, "\n};\n#define SUM_AFSK12_TX_HI_Q %d\n\n" - "#endif /* CONFIG_SOUNDMODEM_FLOAT */\n\n", sum); + fprintf(f, "\n};\n#define SUM_AFSK12_TX_HI_Q %d\n\n", sum); #undef ARGLO #undef ARGHI } @@ -229,7 +200,9 @@ static void gentbl_fsk9600(FILE *f) ? "\n\t" : ""); } } +#ifdef VERBOSE fprintf(stderr, "fsk9600: txfilt4: min = %f; max = %f\n", min, max); +#endif fprintf(f, "\n};\n\n"); min = max = 0; memset(c, 0, sizeof(c)); @@ -262,7 +235,9 @@ static void gentbl_fsk9600(FILE *f) ? "\n\t" : ""); } } +#ifdef VERBOSE fprintf(stderr, "fsk9600: txfilt5: min = %f; max = %f\n", min, max); +#endif fprintf(f, "\n};\n\n"); } @@ -495,7 +470,9 @@ static void gentbl_hapn4800(FILE *f) ? "\n\t" : ""); } } +#ifdef VERBOSE fprintf(stderr, "hapn4800: txfilt8: min = %f; max = %f\n", min, max); +#endif fprintf(f, "\n};\n\n"); min = max = 0; memset(c, 0, sizeof(c)); @@ -522,7 +499,9 @@ static void gentbl_hapn4800(FILE *f) ? "\n\t" : ""); } } +#ifdef VERBOSE fprintf(stderr, "hapn4800: txfilt10: min = %f; max = %f\n", min, max); +#endif fprintf(f, "\n};\n\n"); /* * secondly generate tables for the PM transmitter modulator @@ -553,7 +532,9 @@ static void gentbl_hapn4800(FILE *f) ? "\n\t" : ""); } } +#ifdef VERBOSE fprintf(stderr, "hapn4800: txfiltpm8: min = %f; max = %f\n", min, max); +#endif fprintf(f, "\n};\n\n"); min = max = 0; memset(c, 0, sizeof(c)); @@ -581,7 +562,9 @@ static void gentbl_hapn4800(FILE *f) ? "\n\t" : ""); } } +#ifdef VERBOSE fprintf(stderr, "hapn4800: txfiltpm10: min = %f; max = %f\n", min, max); +#endif fprintf(f, "\n};\n\n"); } @@ -594,7 +577,6 @@ static void gentbl_hapn4800(FILE *f) static void gentbl_afsk2400(FILE *f, float tcm3105clk) { int i, sum, v; - float fsum, fv; fprintf(f, "\n/*\n * afsk2400 specific tables (tcm3105 clk %7fHz)\n */\n" "#define AFSK24_TX_FREQ_LO %d\n" @@ -608,34 +590,7 @@ static void gentbl_afsk2400(FILE *f, float tcm3105clk) #define ARGHI(x) 2.0*M_PI*(double)x*(tcm3105clk/2015.0)/(double)AFSK24_SAMPLERATE #define WINDOW(x) hamming((float)(x)/(AFSK24_CORRLEN-1.0)) - fprintf(f, "#if defined(CONFIG_SOUNDMODEM_FLOAT) && " - "(defined(CONFIG_M586) || defined(CONFIG_M686))\n\n" - "static const float afsk24_tx_lo_i_f[] = {\n\t"); - for(fsum = i = 0; i < AFSK24_CORRLEN; i++) { - fsum += (fv = cos(ARGLO(i))*WINDOW(i)); - fprintf(f, " %7f%c", fv, (i < AFSK24_CORRLEN-1) ? ',' : ' '); - } - fprintf(f, "\n};\n#define SUM_AFSK24_TX_LO_Q %7f\n\n" - "static const float afsk24_tx_lo_q_f[] = {\n\t", fsum); - for(fsum = i = 0; i < AFSK24_CORRLEN; i++) { - fsum += (fv = sin(ARGLO(i))*WINDOW(i)); - fprintf(f, " %7f%c", fv, (i < AFSK24_CORRLEN-1) ? ',' : ' '); - } - fprintf(f, "\n};\n#define SUM_AFSK24_TX_LO_Q %7f\n\n" - "static const float afsk24_tx_hi_i_f[] = {\n\t", fsum); - for(fsum = i = 0; i < AFSK24_CORRLEN; i++) { - fsum += (fv = cos(ARGHI(i))*WINDOW(i)); - fprintf(f, " %7f%c", fv, (i < AFSK24_CORRLEN-1) ? ',' : ' '); - } - fprintf(f, "\n};\n#define SUM_AFSK24_TX_HI_I %7f\n\n" - "static const float afsk24_tx_hi_q_f[] = {\n\t", fsum); - for(fsum = i = 0; i < AFSK24_CORRLEN; i++) { - fsum += (fv = sin(ARGHI(i))*WINDOW(i)); - fprintf(f, " %7f%c", fv, (i < AFSK24_CORRLEN-1) ? ',' : ' '); - } - fprintf(f, "\n};\n#define SUM_AFSK24_TX_HI_Q %7f\n\n" - "#else /* CONFIG_SOUNDMODEM_FLOAT */\n\n" - "static const int afsk24_tx_lo_i[] = {\n\t", fsum); + fprintf(f, "static const int afsk24_tx_lo_i[] = {\n\t"); for(sum = i = 0; i < AFSK24_CORRLEN; i++) { sum += (v = 127.0*cos(ARGLO(i))*WINDOW(i)); fprintf(f, " %4i%c", v, (i < AFSK24_CORRLEN-1) ? ',' : ' '); @@ -658,8 +613,7 @@ static void gentbl_afsk2400(FILE *f, float tcm3105clk) sum += (v = 127.0*sin(ARGHI(i))*WINDOW(i)); fprintf(f, " %4i%c", v, (i < AFSK24_CORRLEN-1) ? ',' : ' '); } - fprintf(f, "\n};\n#define SUM_AFSK24_TX_HI_Q %d\n\n" - "#endif /* CONFIG_SOUNDMODEM_FLOAT */\n\n", sum); + fprintf(f, "\n};\n#define SUM_AFSK24_TX_HI_Q %d\n\n", sum); #undef ARGLO #undef ARGHI #undef WINDOW @@ -675,14 +629,9 @@ static void gentbl_banner(FILE *f) "DO NOT EDIT!\n */\n\n", progname); } -static void gentbl_needs_config(FILE *f) -{ - fprintf(f, "\n#include \n\n"); -} - /* -------------------------------------------------------------------- */ -void main(int argc, char *argv[]) +int main(int argc, char *argv[]) { FILE *f; @@ -690,7 +639,6 @@ void main(int argc, char *argv[]) if (!(f = fopen("sm_tbl_afsk1200.h", "w"))) exit(1); gentbl_banner(f); - gentbl_needs_config(f); gentbl_offscostab(f, 6); gentbl_costab(f, 6); gentbl_afsk1200(f); @@ -722,7 +670,6 @@ void main(int argc, char *argv[]) if (!(f = fopen("sm_tbl_afsk2400_8.h", "w"))) exit(1); gentbl_banner(f); - gentbl_needs_config(f); gentbl_offscostab(f, 6); gentbl_costab(f, 6); gentbl_afsk2400(f, 8000000); @@ -730,7 +677,6 @@ void main(int argc, char *argv[]) if (!(f = fopen("sm_tbl_afsk2400_7.h", "w"))) exit(1); gentbl_banner(f); - gentbl_needs_config(f); gentbl_offscostab(f, 6); gentbl_costab(f, 6); gentbl_afsk2400(f, 7372800); diff --git a/drivers/net/soundmodem/sm.c b/drivers/net/soundmodem/sm.c index ac1fbac48cf1..5ecb14c2dbba 100644 --- a/drivers/net/soundmodem/sm.c +++ b/drivers/net/soundmodem/sm.c @@ -3,7 +3,7 @@ /* * sm.c -- soundcard radio modem driver. * - * Copyright (C) 1996 Thomas Sailer (sailer@ife.ee.ethz.ch) + * Copyright (C) 1996-1998 Thomas Sailer (sailer@ife.ee.ethz.ch) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,6 +39,8 @@ * 0.4 21.01.97 Separately compileable soundcard/modem modules * 0.5 03.03.97 fixed LPT probing (check_lpt result was interpreted the wrong way round) * 0.6 16.04.97 init code/data tagged + * 0.7 30.07.97 fixed halfduplex interrupt handlers/hotfix for CS423X + * 0.8 14.04.98 cleanups */ /*****************************************************************************/ @@ -112,8 +114,8 @@ extern inline int copy_to_user(void *to, const void *from, unsigned long n) /* --------------------------------------------------------------------- */ /*static*/ const char sm_drvname[] = "soundmodem"; -static const char sm_drvinfo[] = KERN_INFO "soundmodem: (C) 1996-1997 Thomas Sailer, HB9JNX/AE4WA\n" -KERN_INFO "soundmodem: version 0.6 compiled " __TIME__ " " __DATE__ "\n"; +static const char sm_drvinfo[] = KERN_INFO "soundmodem: (C) 1996-1998 Thomas Sailer, HB9JNX/AE4WA\n" +KERN_INFO "soundmodem: version 0.8 compiled " __TIME__ " " __DATE__ "\n"; /* --------------------------------------------------------------------- */ @@ -591,7 +593,7 @@ static int sm_ioctl(struct device *dev, struct ifreq *ifr, return 0; case HDLCDRVCTL_SETMODE: - if (!suser() || dev->start) + if (dev->start || !suser()) return -EACCES; hi->data.modename[sizeof(hi->data.modename)-1] = '\0'; return sethw(dev, sm, hi->data.modename); @@ -690,42 +692,42 @@ int sm_x86_capability = 0; __initfunc(static void i386_capability(void)) { - unsigned long flags; - unsigned long fl1; - union { - struct { - unsigned int ebx, edx, ecx; - } r; - unsigned char s[13]; - } id; - unsigned int eax; - - save_flags(flags); - flags |= 0x200000; - restore_flags(flags); - save_flags(flags); - fl1 = flags; - flags &= ~0x200000; - restore_flags(flags); - save_flags(flags); - if (!(fl1 & 0x200000) || (flags & 0x200000)) { - printk(KERN_WARNING "%s: cpu does not support CPUID\n", sm_drvname); - return; - } - __asm__ ("cpuid" : "=a" (eax), "=b" (id.r.ebx), "=c" (id.r.ecx), "=d" (id.r.edx) : - "0" (0)); - id.s[12] = 0; - if (eax < 1) { - printk(KERN_WARNING "%s: cpu (vendor string %s) does not support capability " - "list\n", sm_drvname, id.s); - return; - } - printk(KERN_INFO "%s: cpu: vendor string %s ", sm_drvname, id.s); - __asm__ ("cpuid" : "=a" (eax), "=d" (sm_x86_capability) : "0" (1) : "ebx", "ecx"); - printk("fam %d mdl %d step %d cap 0x%x\n", (eax >> 8) & 15, (eax >> 4) & 15, - eax & 15, sm_x86_capability); -} -#endif /* __i386__ */ + unsigned long flags; + unsigned long fl1; + union { + struct { + unsigned int ebx, edx, ecx; + } r; + unsigned char s[13]; + } id; + unsigned int eax; + + save_flags(flags); + flags |= 0x200000; + restore_flags(flags); + save_flags(flags); + fl1 = flags; + flags &= ~0x200000; + restore_flags(flags); + save_flags(flags); + if (!(fl1 & 0x200000) || (flags & 0x200000)) { + printk(KERN_WARNING "%s: cpu does not support CPUID\n", sm_drvname); + return; + } + __asm__ ("cpuid" : "=a" (eax), "=b" (id.r.ebx), "=c" (id.r.ecx), "=d" (id.r.edx) : + "0" (0)); + id.s[12] = 0; + if (eax < 1) { + printk(KERN_WARNING "%s: cpu (vendor string %s) does not support capability " + "list\n", sm_drvname, id.s); + return; + } + printk(KERN_INFO "%s: cpu: vendor string %s ", sm_drvname, id.s); + __asm__ ("cpuid" : "=a" (eax), "=d" (sm_x86_capability) : "0" (1) : "ebx", "ecx"); + printk("fam %d mdl %d step %d cap 0x%x\n", (eax >> 8) & 15, (eax >> 4) & 15, + eax & 15, sm_x86_capability); +} +#endif /* __i386__ */ /* --------------------------------------------------------------------- */ @@ -742,8 +744,8 @@ __initfunc(int sm_init(void)) printk(sm_drvinfo); #ifdef __i386__ - i386_capability(); -#endif /* __i386__ */ + i386_capability(); +#endif /* __i386__ */ /* * register net devices */ diff --git a/drivers/net/soundmodem/sm.h b/drivers/net/soundmodem/sm.h index 1b53075900f4..6ff39e7dec2a 100644 --- a/drivers/net/soundmodem/sm.h +++ b/drivers/net/soundmodem/sm.h @@ -3,7 +3,7 @@ /* * sm.h -- soundcard radio modem driver internal header. * - * Copyright (C) 1996 Thomas Sailer (sailer@ife.ee.ethz.ch) + * Copyright (C) 1996-1998 Thomas Sailer (sailer@ife.ee.ethz.ch) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -296,8 +296,8 @@ extern int sm_x86_capability; #define HAS_RDTSC (sm_x86_capability & 0x10) /* - * only do 32bit cycle counter arithmetic; we hope we won't overflow :-) - * in fact, overflowing modems would require over 2THz clock speeds :-) + * only do 32bit cycle counter arithmetic; we hope we won't overflow. + * in fact, overflowing modems would require over 2THz CPU clock speeds :-) */ #define time_exec(var,cmd) \ diff --git a/drivers/net/soundmodem/sm_afsk2400_7.c b/drivers/net/soundmodem/sm_afsk2400_7.c index 36e0f328f10c..d217936abdbd 100644 --- a/drivers/net/soundmodem/sm_afsk2400_7.c +++ b/drivers/net/soundmodem/sm_afsk2400_7.c @@ -34,7 +34,6 @@ * a "legacy" link. */ -#include #include "sm.h" #include "sm_tbl_afsk2400_7.h" diff --git a/drivers/net/soundmodem/sm_afsk2400_8.c b/drivers/net/soundmodem/sm_afsk2400_8.c index 8234815d6373..23d2337464b3 100644 --- a/drivers/net/soundmodem/sm_afsk2400_8.c +++ b/drivers/net/soundmodem/sm_afsk2400_8.c @@ -34,7 +34,6 @@ * a "legacy" link. */ -#include #include "sm.h" #include "sm_tbl_afsk2400_8.h" diff --git a/drivers/net/soundmodem/sm_afsk2666.c b/drivers/net/soundmodem/sm_afsk2666.c new file mode 100644 index 000000000000..2aa2972e47d8 --- /dev/null +++ b/drivers/net/soundmodem/sm_afsk2666.c @@ -0,0 +1,356 @@ +/*****************************************************************************/ + +/* + * sm_afsk2666.c -- soundcard radio modem driver, 2666 baud AFSK modem + * + * Copyright (C) 1997 Thomas Sailer (sailer@ife.ee.ethz.ch) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Please note that the GPL allows you to use the driver, NOT the radio. + * In order to use the radio, you need a license from the communications + * authority of your country. + * + */ + +#include "sm.h" +#include "sm_tbl_afsk2666.h" + +/* --------------------------------------------------------------------- */ + +struct demod_state_afsk26 { + unsigned int shreg; + unsigned long descram; + int dem_sum[8]; + int dem_sum_mean; + int dem_cnt; + unsigned int bit_pll; + unsigned char last_sample; + unsigned int dcd_shreg; + int dcd_sum0, dcd_sum1, dcd_sum2; + unsigned int dcd_time; +}; + +struct mod_state_afsk26 { + unsigned int shreg; + unsigned long scram; + unsigned int bit_pll; + unsigned int phinc; + unsigned int tx_seq; +}; + +/* --------------------------------------------------------------------- */ + +#define DESCRAM_TAP1 0x20000 +#define DESCRAM_TAP2 0x01000 +#define DESCRAM_TAP3 0x00001 + +#define DESCRAM_TAPSH1 17 +#define DESCRAM_TAPSH2 12 +#define DESCRAM_TAPSH3 0 + +#define SCRAM_TAP1 0x20000 /* X^17 */ +#define SCRAM_TAPN 0x00021 /* X^0+X^5 */ + +/* --------------------------------------------------------------------- */ + +static void modulator_2666_u8(struct sm_state *sm, unsigned char *buf, unsigned int buflen) +{ + struct mod_state_afsk26 *st = (struct mod_state_afsk26 *)(&sm->m); + + for (; buflen > 0; buflen--, buf++) { + if (!st->tx_seq++) { + if (st->shreg <= 1) + st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; + st->scram = ((st->scram << 1) | (st->scram & 1)); + st->scram ^= (!(st->shreg & 1)); + st->shreg >>= 1; + if (st->scram & (SCRAM_TAP1 << 1)) + st->scram ^= SCRAM_TAPN << 1; + st->phinc = afsk26_carfreq[!(st->scram & (SCRAM_TAP1 << 2))]; + } + if (st->tx_seq >= 6) + st->tx_seq = 0; + *buf = OFFSCOS(st->bit_pll); + st->bit_pll += st->phinc; + } +} + +/* --------------------------------------------------------------------- */ + +static void modulator_2666_s16(struct sm_state *sm, short *buf, unsigned int buflen) +{ + struct mod_state_afsk26 *st = (struct mod_state_afsk26 *)(&sm->m); + + for (; buflen > 0; buflen--, buf++) { + if (!st->tx_seq++) { + if (st->shreg <= 1) + st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; + st->scram = ((st->scram << 1) | (st->scram & 1)); + st->scram ^= (!(st->shreg & 1)); + st->shreg >>= 1; + if (st->scram & (SCRAM_TAP1 << 1)) + st->scram ^= SCRAM_TAPN << 1; + st->phinc = afsk26_carfreq[!(st->scram & (SCRAM_TAP1 << 2))]; + } + if (st->tx_seq >= 6) + st->tx_seq = 0; + *buf = COS(st->bit_pll); + st->bit_pll += st->phinc; + } +} + +/* --------------------------------------------------------------------- */ + +extern __inline__ int convolution12_u8(const unsigned char *st, const int *coeff, int csum) +{ + int sum = -0x80 * csum; + + sum += (st[0] * coeff[0]); + sum += (st[-1] * coeff[1]); + sum += (st[-2] * coeff[2]); + sum += (st[-3] * coeff[3]); + sum += (st[-4] * coeff[4]); + sum += (st[-5] * coeff[5]); + sum += (st[-6] * coeff[6]); + sum += (st[-7] * coeff[7]); + sum += (st[-8] * coeff[8]); + sum += (st[-9] * coeff[9]); + sum += (st[-10] * coeff[10]); + sum += (st[-11] * coeff[11]); + + return sum; +} + +extern __inline__ int convolution12_s16(const short *st, const int *coeff, int csum) +{ + int sum = 0; + + sum += (st[0] * coeff[0]); + sum += (st[-1] * coeff[1]); + sum += (st[-2] * coeff[2]); + sum += (st[-3] * coeff[3]); + sum += (st[-4] * coeff[4]); + sum += (st[-5] * coeff[5]); + sum += (st[-6] * coeff[6]); + sum += (st[-7] * coeff[7]); + sum += (st[-8] * coeff[8]); + sum += (st[-9] * coeff[9]); + sum += (st[-10] * coeff[10]); + sum += (st[-11] * coeff[11]); + + sum >>= 8; + return sum; +} + +/* ---------------------------------------------------------------------- */ + +#if 0 +static int binexp(unsigned int i) +{ + int ret = 31; + + if (!i) + return 0; + if (i < 0x10000LU) { + i <<= 16; + ret -= 16; + } + if (i < 0x1000000LU) { + i <<= 8; + ret -= 8; + } + if (i < 0x10000000LU) { + i <<= 4; + ret -= 4; + } + if (i < 0x40000000LU) { + i <<= 2; + ret -= 2; + } + if (i < 0x80000000LU) + ret -= 1; + return ret; +} + +static const sqrt_tab[16] = { + 00000, 16384, 23170, 28378, 32768, 36636, 40132, 43348, + 46341, 49152, 51811, 54340, 56756, 59073, 61303, 63455 +}; + + +static unsigned int int_sqrt_approx(unsigned int i) +{ + unsigned int j; + + if (i < 16) + return sqrt_tab[i] >> 14; + j = binexp(i) >> 1; + i >>= (j * 2 - 2); + return (sqrt_tab[i & 0xf] << j) >> 15; +} +#endif + +/* --------------------------------------------------------------------- */ + +extern unsigned int est_pwr(int i, int q) +{ + unsigned int ui = abs(i); + unsigned int uq = abs(q); + + if (uq > ui) { + unsigned int tmp; + tmp = ui; + ui = uq; + uq = tmp; + } + if (uq > (ui >> 1)) + return 7*(ui>>3) + 9*(uq>>4); + else + return ui + (uq>>2); +} + +/* --------------------------------------------------------------------- */ + +static void demod_one_sample(struct sm_state *sm, struct demod_state_afsk26 *st, int curval, + int loi, int loq, int hii, int hiq) +{ + static const int pll_corr[2] = { -0xa00, 0xa00 }; + unsigned char curbit; + unsigned int descx; + int val; + + /* + * estimate power + */ + val = est_pwr(hii, hiq) - est_pwr(loi, loq); + /* + * estimate center value + */ + st->dem_sum[0] += val >> 8; + if ((++st->dem_cnt) >= 256) { + st->dem_cnt = 0; + st->dem_sum_mean = (st->dem_sum[0]+st->dem_sum[1]+ + st->dem_sum[2]+st->dem_sum[3]+ + st->dem_sum[4]+st->dem_sum[5]+ + st->dem_sum[6]+st->dem_sum[7]) >> 3; + memmove(st->dem_sum+1, st->dem_sum, + sizeof(st->dem_sum)-sizeof(st->dem_sum[0])); + st->dem_sum[0] = 0; + } + /* + * decision and bit clock regen + */ + val -= st->dem_sum_mean; + diag_add(sm, curval, val); + + st->dcd_shreg <<= 1; + st->bit_pll += 0x1555; + curbit = (val > 0); + if (st->last_sample ^ curbit) { + st->dcd_shreg |= 1; + st->bit_pll += pll_corr[st->bit_pll < (0x8000+0x1555)]; + st->dcd_sum0 += 4*hweight8(st->dcd_shreg & 0x1e) - + hweight16(st->dcd_shreg & 0xfe00); + } + st->last_sample = curbit; + hdlcdrv_channelbit(&sm->hdrv, curbit); + if ((--st->dcd_time) <= 0) { + hdlcdrv_setdcd(&sm->hdrv, (st->dcd_sum0 + st->dcd_sum1 + + st->dcd_sum2) < 0); + st->dcd_sum2 = st->dcd_sum1; + st->dcd_sum1 = st->dcd_sum0; + st->dcd_sum0 = 2; /* slight bias */ + st->dcd_time = 400; + } + if (st->bit_pll >= 0x10000) { + st->bit_pll &= 0xffffu; + st->descram = (st->descram << 1) | curbit; + descx = st->descram ^ (st->descram >> 1); + descx ^= ((descx >> DESCRAM_TAPSH1) ^ + (descx >> DESCRAM_TAPSH2)); + st->shreg >>= 1; + st->shreg |= (!(descx & 1)) << 16; + if (st->shreg & 1) { + hdlcdrv_putbits(&sm->hdrv, st->shreg >> 1); + st->shreg = 0x10000; + } + diag_trigger(sm); + } +} + +/* --------------------------------------------------------------------- */ + +static void demodulator_2666_u8(struct sm_state *sm, const unsigned char *buf, unsigned int buflen) +{ + struct demod_state_afsk26 *st = (struct demod_state_afsk26 *)(&sm->d); + + for (; buflen > 0; buflen--, buf++) { + demod_one_sample(sm, st, (*buf-0x80)<<8, + convolution12_u8(buf, afsk26_dem_tables[0][0].i, AFSK26_DEM_SUM_I_0_0), + convolution12_u8(buf, afsk26_dem_tables[0][0].q, AFSK26_DEM_SUM_Q_0_0), + convolution12_u8(buf, afsk26_dem_tables[0][1].i, AFSK26_DEM_SUM_I_0_1), + convolution12_u8(buf, afsk26_dem_tables[0][1].q, AFSK26_DEM_SUM_Q_0_1)); + demod_one_sample(sm, st, (*buf-0x80)<<8, + convolution12_u8(buf, afsk26_dem_tables[1][0].i, AFSK26_DEM_SUM_I_1_0), + convolution12_u8(buf, afsk26_dem_tables[1][0].q, AFSK26_DEM_SUM_Q_1_0), + convolution12_u8(buf, afsk26_dem_tables[1][1].i, AFSK26_DEM_SUM_I_1_1), + convolution12_u8(buf, afsk26_dem_tables[1][1].q, AFSK26_DEM_SUM_Q_1_1)); + } +} + +/* --------------------------------------------------------------------- */ + +static void demodulator_2666_s16(struct sm_state *sm, const short *buf, unsigned int buflen) +{ + struct demod_state_afsk26 *st = (struct demod_state_afsk26 *)(&sm->d); + + for (; buflen > 0; buflen--, buf++) { + demod_one_sample(sm, st, *buf, + convolution12_s16(buf, afsk26_dem_tables[0][0].i, AFSK26_DEM_SUM_I_0_0), + convolution12_s16(buf, afsk26_dem_tables[0][0].q, AFSK26_DEM_SUM_Q_0_0), + convolution12_s16(buf, afsk26_dem_tables[0][1].i, AFSK26_DEM_SUM_I_0_1), + convolution12_s16(buf, afsk26_dem_tables[0][1].q, AFSK26_DEM_SUM_Q_0_1)); + demod_one_sample(sm, st, *buf, + convolution12_s16(buf, afsk26_dem_tables[1][0].i, AFSK26_DEM_SUM_I_1_0), + convolution12_s16(buf, afsk26_dem_tables[1][0].q, AFSK26_DEM_SUM_Q_1_0), + convolution12_s16(buf, afsk26_dem_tables[1][1].i, AFSK26_DEM_SUM_I_1_1), + convolution12_s16(buf, afsk26_dem_tables[1][1].q, AFSK26_DEM_SUM_Q_1_1)); + } +} + +/* --------------------------------------------------------------------- */ + +static void demod_init_2666(struct sm_state *sm) +{ + struct demod_state_afsk26 *st = (struct demod_state_afsk26 *)(&sm->d); + + st->dcd_time = 400; + st->dcd_sum0 = 2; +} + +/* --------------------------------------------------------------------- */ + +const struct modem_tx_info sm_afsk2666_tx = { + "afsk2666", sizeof(struct mod_state_afsk26), AFSK26_SAMPLERATE, 2666, + modulator_2666_u8, modulator_2666_s16, NULL +}; + +const struct modem_rx_info sm_afsk2666_rx = { + "afsk2666", sizeof(struct demod_state_afsk26), AFSK26_SAMPLERATE, 2666, 12, 6, + demodulator_2666_u8, demodulator_2666_s16, demod_init_2666 +}; + +/* --------------------------------------------------------------------- */ diff --git a/drivers/net/soundmodem/sm_psk4800.c b/drivers/net/soundmodem/sm_psk4800.c new file mode 100644 index 000000000000..cbb49042b508 --- /dev/null +++ b/drivers/net/soundmodem/sm_psk4800.c @@ -0,0 +1,418 @@ +/*****************************************************************************/ + +/* + * sm_psk4800.c -- soundcard radio modem driver, 4800 baud 8PSK modem + * + * Copyright (C) 1997 Thomas Sailer (sailer@ife.ee.ethz.ch) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Please note that the GPL allows you to use the driver, NOT the radio. + * In order to use the radio, you need a license from the communications + * authority of your country. + * + */ + +#include "sm.h" +#include "sm_tbl_psk4800.h" + +/* --------------------------------------------------------------------- */ + +#define DESCRAM_TAP1 0x20000 +#define DESCRAM_TAP2 0x01000 +#define DESCRAM_TAP3 0x00001 + +#define DESCRAM_TAPSH1 17 +#define DESCRAM_TAPSH2 12 +#define DESCRAM_TAPSH3 0 + +#define SCRAM_TAP1 0x20000 /* X^17 */ +#define SCRAM_TAPN 0x00021 /* X^0+X^5 */ + +#define SCRAM_SHIFT 17 + +/* --------------------------------------------------------------------- */ + +struct demod_state_psk48 { + /* + * input mixer and lowpass + */ + short infi[PSK48_RXF_LEN/2], infq[PSK48_RXF_LEN/2]; + unsigned int downmixer; + int ovrphase; + short magi, magq; + /* + * sampling instant recovery + */ + int pwrhist[5]; + unsigned int s_phase; + int cur_sync; + /* + * phase recovery + */ + short cur_phase_dev; + short last_ph_err; + unsigned short pskph; + unsigned int phase; + unsigned short last_pskph; + unsigned char cur_raw, last_raw, rawbits; + /* + * decoding + */ + unsigned int shreg; + unsigned long descram; + unsigned int bit_pll; + unsigned char last_sample; + unsigned int dcd_shreg; + int dcd_sum0, dcd_sum1, dcd_sum2; + unsigned int dcd_time; +}; + +struct mod_state_psk48 { + unsigned char txbits[PSK48_TXF_NUMSAMPLES]; + unsigned short txphase; + unsigned int shreg; + unsigned long scram; + const short *tbl; + unsigned int txseq; +}; + +/* --------------------------------------------------------------------- */ + +static void modulator_4800_u8(struct sm_state *sm, unsigned char *buf, unsigned int buflen) +{ + struct mod_state_psk48 *st = (struct mod_state_psk48 *)(&sm->m); + int i, j; + int si, sq; + + for (; buflen > 0; buflen--, buf++) { + if (!st->txseq++) { + memmove(st->txbits+1, st->txbits, + sizeof(st->txbits)-sizeof(st->txbits[0])); + for (i = 0; i < 3; i++) { + if (st->shreg <= 1) + st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; + st->scram = (st->scram << 1) | + (st->shreg & 1); + st->shreg >>= 1; + if (st->scram & SCRAM_TAP1) + st->scram ^= SCRAM_TAPN; + } + j = (st->scram >> (SCRAM_SHIFT+3)) & 7; + st->txbits[0] -= (j ^ (j >> 1)); + st->txbits[0] &= 7; + st->tbl = psk48_tx_table; + } + if (st->txseq >= PSK48_TXF_OVERSAMPLING) + st->txseq = 0; + for (j = si = sq = 0; j < PSK48_TXF_NUMSAMPLES; j++, st->tbl += 16) { + si += st->tbl[st->txbits[j]]; + sq += st->tbl[st->txbits[j]+8]; + } + *buf = ((si*COS(st->txphase)+ sq*SIN(st->txphase)) >> 23) + 0x80; + st->txphase = (st->txphase + PSK48_PHASEINC) & 0xffffu; + } +} + +/* --------------------------------------------------------------------- */ + +static void modulator_4800_s16(struct sm_state *sm, short *buf, unsigned int buflen) +{ + struct mod_state_psk48 *st = (struct mod_state_psk48 *)(&sm->m); + int i, j; + int si, sq; + + for (; buflen > 0; buflen--, buf++) { + if (!st->txseq++) { + memmove(st->txbits+1, st->txbits, + sizeof(st->txbits)-sizeof(st->txbits[0])); + for (i = 0; i < 3; i++) { + if (st->shreg <= 1) + st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; + st->scram = (st->scram << 1) | + (st->shreg & 1); + st->shreg >>= 1; + if (st->scram & SCRAM_TAP1) + st->scram ^= SCRAM_TAPN; + } + j = (st->scram >> (SCRAM_SHIFT+3)) & 7; + st->txbits[0] -= (j ^ (j >> 1)); + st->txbits[0] &= 7; + st->tbl = psk48_tx_table; + } + if (st->txseq >= PSK48_TXF_OVERSAMPLING) + st->txseq = 0; + for (j = si = sq = 0; j < PSK48_TXF_NUMSAMPLES; j++, st->tbl += 16) { + si += st->tbl[st->txbits[j]]; + sq += st->tbl[st->txbits[j]+8]; + } + *buf = (si*COS(st->txphase)+ sq*SIN(st->txphase)) >> 15; + st->txphase = (st->txphase + PSK48_PHASEINC) & 0xffffu; + } +} + +/* --------------------------------------------------------------------- */ + +static __inline__ unsigned short tbl_atan(short q, short i) +{ + short tmp; + unsigned short argoffs = 0; + + if (i == 0 && q == 0) + return 0; + switch (((q < 0) << 1) | (i < 0)) { + case 0: + break; + case 1: + tmp = q; + q = -i; + i = tmp; + argoffs = 0x4000; + break; + case 3: + q = -q; + i = -i; + argoffs = 0x8000; + break; + case 2: + tmp = -q; + q = i; + i = tmp; + argoffs = 0xc000; + break; + } + if (q > i) { + tmp = i / q * ATAN_TABLEN; + return (argoffs+0x4000-atan_tab[((i<<15)/q*ATAN_TABLEN>>15)]) + &0xffffu; + } + return (argoffs+atan_tab[((q<<15)/i*ATAN_TABLEN)>>15])&0xffffu; +} + +#define ATAN(q,i) tbl_atan(q, i) + +/* --------------------------------------------------------------------- */ + +static void demod_psk48_baseband(struct sm_state *sm, struct demod_state_psk48 *st, + short vali, short valq) +{ + int i, j; + + st->magi = vali; + st->magq = valq; + memmove(st->pwrhist+1, st->pwrhist, + sizeof(st->pwrhist)-sizeof(st->pwrhist[0])); + st->pwrhist[0] = st->magi * st->magi + + st->magq * st->magq; + st->cur_sync = ((st->pwrhist[4] >> 2) > st->pwrhist[2] && + (st->pwrhist[0] >> 2) > st->pwrhist[2] && + st-> pwrhist[3] > st->pwrhist[2] && + st->pwrhist[1] > st->pwrhist[2]); + st->s_phase &= 0xffff; + st->s_phase += PSK48_SPHASEINC; + st->dcd_shreg <<= 1; + if (st->cur_sync) { + if (st->s_phase >= (0x8000 + 5*PSK48_SPHASEINC/2)) + st->s_phase -= PSK48_SPHASEINC/6; + else + st->s_phase += PSK48_SPHASEINC/6; + st->dcd_sum0 = 4*hweight8(st->dcd_shreg & 0xf8)- + hweight16(st->dcd_shreg & 0x1f00); + } + if ((--st->dcd_time) <= 0) { + hdlcdrv_setdcd(&sm->hdrv, (st->dcd_sum0 + st->dcd_sum1 + + st->dcd_sum2) < 0); + st->dcd_sum2 = st->dcd_sum1; + st->dcd_sum1 = st->dcd_sum0; + st->dcd_sum0 = 2; /* slight bias */ + st->dcd_time = 240; + } + if (st->s_phase < 0x10000) + return; + /* + * sample one constellation + */ + st->last_pskph = st->pskph; + st->pskph = (ATAN(st->magq, st->magi)- + st->phase) & 0xffffu; + st->last_ph_err = (st->pskph & 0x1fffu) - 0x1000; + st->phase += st->last_ph_err/16; + st->last_raw = st->cur_raw; + st->cur_raw = ((st->pskph >> 13) & 7); + i = (st->cur_raw - st->last_raw) & 7; + st->rawbits = i ^ (i >> 1) ^ (i >> 2); + st->descram = (st->descram << 3) | (st->rawbits); + hdlcdrv_channelbit(&sm->hdrv, st->descram & 4); + hdlcdrv_channelbit(&sm->hdrv, st->descram & 2); + hdlcdrv_channelbit(&sm->hdrv, st->descram & 1); + i = (((st->descram >> DESCRAM_TAPSH1) & 7) ^ + ((st->descram >> DESCRAM_TAPSH2) & 7) ^ + ((st->descram >> DESCRAM_TAPSH3) & 7)); + for (j = 4; j; j >>= 1) { + st->shreg >>= 1; + st->shreg |= (!!(i & j)) << 16; + if (st->shreg & 1) { + hdlcdrv_putbits(&sm->hdrv, st->shreg >> 1); + st->shreg = 0x10000; + } + } + +#if 0 + st->dcd_shreg <<= 1; + st->bit_pll += 0x4000; + curbit = (*buf >= 0x80); + if (st->last_sample ^ curbit) { + st->dcd_shreg |= 1; + st->bit_pll += pll_corr + [st->bit_pll < 0xa000]; + st->dcd_sum0 += 8 * + hweight8(st->dcd_shreg & 0x0c) - + !!(st->dcd_shreg & 0x10); + } + st->last_sample = curbit; + hdlcdrv_channelbit(&sm->hdrv, st->last_sample); + if ((--st->dcd_time) <= 0) { + hdlcdrv_setdcd(&sm->hdrv, (st->dcd_sum0 + + st->dcd_sum1 + + st->dcd_sum2) < 0); + st->dcd_sum2 = st->dcd_sum1; + st->dcd_sum1 = st->dcd_sum0; + st->dcd_sum0 = 2; /* slight bias */ + st->dcd_time = 240; + } + if (st->bit_pll >= 0x10000) { + st->bit_pll &= 0xffffu; + st->descram = (st->descram << 1) | curbit; + descx = st->descram ^ (st->descram >> 1); + descx ^= ((descx >> DESCRAM_TAPSH1) ^ + (descx >> DESCRAM_TAPSH2)); + st->shreg >>= 1; + st->shreg |= (!(descx & 1)) << 16; + if (st->shreg & 1) { + hdlcdrv_putbits(&sm->hdrv, st->shreg >> 1); + st->shreg = 0x10000; + } + diag_trigger(sm); + } + diag_add_one(sm, ((short)(*buf - 0x80)) << 8); +#endif + + diag_trigger(sm); + diag_add_constellation(sm, (vali*COS(st->phase)+ valq*SIN(st->phase)) >> 13, + (valq*COS(st->phase) - vali*SIN(st->phase)) >> 13); +} + +/* --------------------------------------------------------------------- */ + +static void demodulator_4800_u8(struct sm_state *sm, const unsigned char *buf, unsigned int buflen) +{ + struct demod_state_psk48 *st = (struct demod_state_psk48 *)(&sm->d); + int i, si, sq; + const short *coeff; + + for (; buflen > 0; buflen--, buf++) { + memmove(st->infi+1, st->infi, + sizeof(st->infi)-sizeof(st->infi[0])); + memmove(st->infq+1, st->infq, + sizeof(st->infq)-sizeof(st->infq[0])); + si = *buf; + si &= 0xff; + si -= 128; + diag_add_one(sm, si << 8); + st->infi[0] = (si * COS(st->downmixer))>>7; + st->infq[0] = (si * SIN(st->downmixer))>>7; + st->downmixer = (st->downmixer-PSK48_PHASEINC)&0xffffu; + for (i = si = sq = 0, coeff = psk48_rx_coeff; i < (PSK48_RXF_LEN/2); + i++, coeff += 2) { + si += st->infi[i] * (*coeff); + sq += st->infq[i] * (*coeff); + } + demod_psk48_baseband(sm, st, si >> 15, sq >> 15); + for (i = si = sq = 0, coeff = psk48_rx_coeff + 1; i < (PSK48_RXF_LEN/2); + i++, coeff += 2) { + si += st->infi[i] * (*coeff); + sq += st->infq[i] * (*coeff); + } + demod_psk48_baseband(sm, st, si >> 15, sq >> 15); + } +} + +/* --------------------------------------------------------------------- */ + +static void demodulator_4800_s16(struct sm_state *sm, const short *buf, unsigned int buflen) +{ + struct demod_state_psk48 *st = (struct demod_state_psk48 *)(&sm->d); + int i, si, sq; + const short *coeff; + + for (; buflen > 0; buflen--, buf++) { + memmove(st->infi+1, st->infi, + sizeof(st->infi)-sizeof(st->infi[0])); + memmove(st->infq+1, st->infq, + sizeof(st->infq)-sizeof(st->infq[0])); + si = *buf; + diag_add_one(sm, si); + st->infi[0] = (si * COS(st->downmixer))>>15; + st->infq[0] = (si * SIN(st->downmixer))>>15; + st->downmixer = (st->downmixer-PSK48_PHASEINC)&0xffffu; + for (i = si = sq = 0, coeff = psk48_rx_coeff; i < (PSK48_RXF_LEN/2); + i++, coeff += 2) { + si += st->infi[i] * (*coeff); + sq += st->infq[i] * (*coeff); + } + demod_psk48_baseband(sm, st, si >> 15, sq >> 15); + for (i = si = sq = 0, coeff = psk48_rx_coeff + 1; i < (PSK48_RXF_LEN/2); + i++, coeff += 2) { + si += st->infi[i] * (*coeff); + sq += st->infq[i] * (*coeff); + } + demod_psk48_baseband(sm, st, si >> 15, sq >> 15); + } +} + +/* --------------------------------------------------------------------- */ + +static void mod_init_4800(struct sm_state *sm) +{ + struct mod_state_psk48 *st = (struct mod_state_psk48 *)(&sm->m); + + st->scram = 1; +} + +/* --------------------------------------------------------------------- */ + +static void demod_init_4800(struct sm_state *sm) +{ + struct demod_state_psk48 *st = (struct demod_state_psk48 *)(&sm->d); + + st->dcd_time = 120; + st->dcd_sum0 = 2; +} + +/* --------------------------------------------------------------------- */ + +const struct modem_tx_info sm_psk4800_tx = { + "psk4800", sizeof(struct mod_state_psk48), + PSK48_SAMPLERATE, 4800, + modulator_4800_u8, modulator_4800_s16, mod_init_4800 +}; + +const struct modem_rx_info sm_psk4800_rx = { + "psk4800", sizeof(struct demod_state_psk48), + PSK48_SAMPLERATE, 4800, 1, PSK48_TXF_OVERSAMPLING, + demodulator_4800_u8, demodulator_4800_s16, demod_init_4800 +}; + +/* --------------------------------------------------------------------- */ diff --git a/drivers/net/soundmodem/sm_sbc.c b/drivers/net/soundmodem/sm_sbc.c index fc26b57bff30..e66a2e5cb2b3 100644 --- a/drivers/net/soundmodem/sm_sbc.c +++ b/drivers/net/soundmodem/sm_sbc.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "sm.h" #include "smdma.h" @@ -144,8 +145,7 @@ static int inline reset_dsp(struct device *dev) int i; outb(1, DSP_RESET(dev->base_addr)); - for (i = 0; i < 0x100; i++) - SLOW_DOWN_IO; + udelay(300); outb(0, DSP_RESET(dev->base_addr)); for (i = 0; i < 0xffff; i++) if (inb(DSP_DATA_AVAIL(dev->base_addr)) & 0x80) @@ -343,6 +343,7 @@ static void sbc_interrupt(int irq, void *dev_id, struct pt_regs *regs) if (hdlcdrv_ptt(&sm->hdrv)) { /* starting to transmit */ disable_dma(dev->dma); + hdlcdrv_transmitter(dev, &sm->hdrv); /* prefill HDLC buffer */ dma_start_transmit(sm); setup_dma_dsp(dev, sm, 1); dma_transmit(sm); @@ -416,11 +417,7 @@ static int sbc_open(struct device *dev, struct sm_state *sm) */ dma_init_receive(sm); dmasz = (NUM_FRAGMENTS + 1) * sm->dma.ifragsz; - if (sm->dma.i16bit) - dmasz <<= 1; u = NUM_FRAGMENTS * sm->dma.ofragsz; - if (sm->dma.o16bit) - u <<= 1; if (u > dmasz) dmasz = u; if (!(sm->dma.ibuf = sm->dma.obuf = kmalloc(dmasz, GFP_KERNEL | GFP_DMA))) diff --git a/drivers/net/soundmodem/sm_tbl_afsk1200.h b/drivers/net/soundmodem/sm_tbl_afsk1200.h deleted file mode 100644 index 3d5e2406b245..000000000000 --- a/drivers/net/soundmodem/sm_tbl_afsk1200.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * THIS FILE IS GENERATED AUTOMATICALLY BY ./gentbl, DO NOT EDIT! - */ - - -#include - - -/* - * small cosine table in U8 format - */ -#define OFFSCOSTABBITS 6 -#define OFFSCOSTABSIZE (1<>10)&0x3f] - - -/* - * more accurate cosine table - */ - -static const short costab[64] = { - 32767, 32609, 32137, 31356, 30272, 28897, 27244, 25329, - 23169, 20787, 18204, 15446, 12539, 9511, 6392, 3211, - 0, -3211, -6392, -9511, -12539, -15446, -18204, -20787, - -23169, -25329, -27244, -28897, -30272, -31356, -32137, -32609, - -32767, -32609, -32137, -31356, -30272, -28897, -27244, -25329, - -23169, -20787, -18204, -15446, -12539, -9511, -6392, -3211, - 0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, - 23169, 25329, 27244, 28897, 30272, 31356, 32137, 32609 -}; - -#define COS(x) costab[((x)>>10)&0x3f] -#define SIN(x) COS((x)+0xc000) - - -/* - * afsk1200 specific tables - */ -#define AFSK12_SAMPLE_RATE 9600 -#define AFSK12_TX_FREQ_LO 1200 -#define AFSK12_TX_FREQ_HI 2200 -#define AFSK12_CORRLEN 8 - -#if defined(CONFIG_SOUNDMODEM_FLOAT) && (defined(CONFIG_M586) || defined(CONFIG_M686)) - -static const float afsk12_tx_lo_i_f[] = { - 1.000000, 0.707107, 0.000000, -0.707107, -1.000000, -0.707107, -0.000000, 0.707107 -}; -#define SUM_AFSK12_TX_LO_Q 0.000000 - -static const float afsk12_tx_lo_q_f[] = { - 0.000000, 0.707107, 1.000000, 0.707107, 0.000000, -0.707107, -1.000000, -0.707107 -}; -#define SUM_AFSK12_TX_LO_Q 0.000000 - -static const float afsk12_tx_hi_i_f[] = { - 1.000000, 0.130526, -0.965926, -0.382683, 0.866025, 0.608761, -0.707107, -0.793353 -}; -#define SUM_AFSK12_TX_HI_I -0.243756 - -static const float afsk12_tx_hi_q_f[] = { - 0.000000, 0.991445, 0.258819, -0.923880, -0.500000, 0.793353, 0.707107, -0.608761 -}; -#define SUM_AFSK12_TX_HI_Q 0.718083 - -#else /* CONFIG_SOUNDMODEM_FLOAT */ - -static const int afsk12_tx_lo_i[] = { - 127, 89, 0, -89, -127, -89, 0, 89 -}; -#define SUM_AFSK12_TX_LO_I 0 - -static const int afsk12_tx_lo_q[] = { - 0, 89, 127, 89, 0, -89, -127, -89 -}; -#define SUM_AFSK12_TX_LO_Q 0 - -static const int afsk12_tx_hi_i[] = { - 127, 16, -122, -48, 109, 77, -89, -100 -}; -#define SUM_AFSK12_TX_HI_I -30 - -static const int afsk12_tx_hi_q[] = { - 0, 125, 32, -117, -63, 100, 89, -77 -}; -#define SUM_AFSK12_TX_HI_Q 89 - -#endif /* CONFIG_SOUNDMODEM_FLOAT */ - diff --git a/drivers/net/soundmodem/sm_tbl_afsk2400_7.h b/drivers/net/soundmodem/sm_tbl_afsk2400_7.h deleted file mode 100644 index e997515c66bf..000000000000 --- a/drivers/net/soundmodem/sm_tbl_afsk2400_7.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * THIS FILE IS GENERATED AUTOMATICALLY BY ./gentbl, DO NOT EDIT! - */ - - -#include - - -/* - * small cosine table in U8 format - */ -#define OFFSCOSTABBITS 6 -#define OFFSCOSTABSIZE (1<>10)&0x3f] - - -/* - * more accurate cosine table - */ - -static const short costab[64] = { - 32767, 32609, 32137, 31356, 30272, 28897, 27244, 25329, - 23169, 20787, 18204, 15446, 12539, 9511, 6392, 3211, - 0, -3211, -6392, -9511, -12539, -15446, -18204, -20787, - -23169, -25329, -27244, -28897, -30272, -31356, -32137, -32609, - -32767, -32609, -32137, -31356, -30272, -28897, -27244, -25329, - -23169, -20787, -18204, -15446, -12539, -9511, -6392, -3211, - 0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, - 23169, 25329, 27244, 28897, 30272, 31356, 32137, 32609 -}; - -#define COS(x) costab[((x)>>10)&0x3f] -#define SIN(x) COS((x)+0xc000) - - -/* - * afsk2400 specific tables (tcm3105 clk 7372800.000000Hz) - */ -#define AFSK24_TX_FREQ_LO 1995 -#define AFSK24_TX_FREQ_HI 3658 -#define AFSK24_BITPLL_INC 9830 -#define AFSK24_SAMPLERATE 16000 - -#if defined(CONFIG_SOUNDMODEM_FLOAT) && (defined(CONFIG_M586) || defined(CONFIG_M686)) - -static const float afsk24_tx_lo_i_f[] = { - 0.080000, 0.093978, 0.000901, -0.340966, -0.703104, -0.630337, -0.009565, 0.689719, 0.884241, 0.504357, 0.007829, -0.193530, -0.132665, -0.057744 -}; -#define SUM_AFSK24_TX_LO_Q 0.193114 - -static const float afsk24_tx_lo_q_f[] = { - 0.000000, 0.093674, 0.278689, 0.344288, 0.004545, -0.620233, -0.986587, -0.705501, -0.011431, 0.489897, 0.484490, 0.200535, 0.002573, -0.055368 -}; -#define SUM_AFSK24_TX_LO_Q -0.480430 - -static const float afsk24_tx_hi_i_f[] = { - 0.080000, 0.017718, -0.268752, -0.189488, 0.604617, 0.548894, -0.684869, -0.795300, 0.423482, 0.656685, -0.111187, -0.277364, -0.004819, 0.078843 -}; -#define SUM_AFSK24_TX_HI_I 0.078460 - -static const float afsk24_tx_hi_q_f[] = { - 0.000000, 0.131502, 0.073759, -0.445966, -0.358907, 0.693346, 0.710211, -0.583904, -0.776322, 0.251276, 0.471624, -0.027157, -0.132603, -0.013555 -}; -#define SUM_AFSK24_TX_HI_Q -0.006695 - -#else /* CONFIG_SOUNDMODEM_FLOAT */ - -static const int afsk24_tx_lo_i[] = { - 10, 11, 0, -43, -89, -80, -1, 87, 112, 64, 0, -24, -16, -7 -}; -#define SUM_AFSK24_TX_LO_I 24 - -static const int afsk24_tx_lo_q[] = { - 0, 11, 35, 43, 0, -78, -125, -89, -1, 62, 61, 25, 0, -7 -}; -#define SUM_AFSK24_TX_LO_Q -63 - -static const int afsk24_tx_hi_i[] = { - 10, 2, -34, -24, 76, 69, -86, -101, 53, 83, -14, -35, 0, 10 -}; -#define SUM_AFSK24_TX_HI_I 9 - -static const int afsk24_tx_hi_q[] = { - 0, 16, 9, -56, -45, 88, 90, -74, -98, 31, 59, -3, -16, -1 -}; -#define SUM_AFSK24_TX_HI_Q 0 - -#endif /* CONFIG_SOUNDMODEM_FLOAT */ - diff --git a/drivers/net/soundmodem/sm_tbl_afsk2400_8.h b/drivers/net/soundmodem/sm_tbl_afsk2400_8.h deleted file mode 100644 index f37be7c22657..000000000000 --- a/drivers/net/soundmodem/sm_tbl_afsk2400_8.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * THIS FILE IS GENERATED AUTOMATICALLY BY ./gentbl, DO NOT EDIT! - */ - - -#include - - -/* - * small cosine table in U8 format - */ -#define OFFSCOSTABBITS 6 -#define OFFSCOSTABSIZE (1<>10)&0x3f] - - -/* - * more accurate cosine table - */ - -static const short costab[64] = { - 32767, 32609, 32137, 31356, 30272, 28897, 27244, 25329, - 23169, 20787, 18204, 15446, 12539, 9511, 6392, 3211, - 0, -3211, -6392, -9511, -12539, -15446, -18204, -20787, - -23169, -25329, -27244, -28897, -30272, -31356, -32137, -32609, - -32767, -32609, -32137, -31356, -30272, -28897, -27244, -25329, - -23169, -20787, -18204, -15446, -12539, -9511, -6392, -3211, - 0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, - 23169, 25329, 27244, 28897, 30272, 31356, 32137, 32609 -}; - -#define COS(x) costab[((x)>>10)&0x3f] -#define SIN(x) COS((x)+0xc000) - - -/* - * afsk2400 specific tables (tcm3105 clk 8000000.000000Hz) - */ -#define AFSK24_TX_FREQ_LO 2165 -#define AFSK24_TX_FREQ_HI 3970 -#define AFSK24_BITPLL_INC 9830 -#define AFSK24_SAMPLERATE 16000 - -#if defined(CONFIG_SOUNDMODEM_FLOAT) && (defined(CONFIG_M586) || defined(CONFIG_M686)) - -static const float afsk24_tx_lo_i_f[] = { - 0.080000, 0.087528, -0.036161, -0.402576, -0.679443, -0.392668, 0.375435, 0.933404, 0.767214, 0.139590, -0.293477, -0.278013, -0.094264, 0.004828 -}; -#define SUM_AFSK24_TX_LO_Q 0.211398 - -static const float afsk24_tx_lo_q_f[] = { - 0.000000, 0.099728, 0.276334, 0.269674, -0.180921, -0.792354, -0.912411, -0.319691, 0.439767, 0.689122, 0.385569, 0.019419, -0.093386, -0.079854 -}; -#define SUM_AFSK24_TX_LO_Q -0.199004 - -static const float afsk24_tx_hi_i_f[] = { - 0.080000, 0.001552, -0.278614, -0.016995, 0.702349, 0.051673, -0.984206, -0.080669, 0.880448, 0.073859, -0.481244, -0.035748, 0.131386, 0.012114 -}; -#define SUM_AFSK24_TX_HI_I 0.055907 - -static const float afsk24_tx_hi_q_f[] = { - 0.000000, 0.132681, 0.006517, -0.484255, -0.032875, 0.882804, 0.069165, -0.983330, -0.082604, 0.699228, 0.056531, -0.276388, -0.018558, 0.079077 -}; -#define SUM_AFSK24_TX_HI_Q 0.047994 - -#else /* CONFIG_SOUNDMODEM_FLOAT */ - -static const int afsk24_tx_lo_i[] = { - 10, 11, -4, -51, -86, -49, 47, 118, 97, 17, -37, -35, -11, 0 -}; -#define SUM_AFSK24_TX_LO_I 27 - -static const int afsk24_tx_lo_q[] = { - 0, 12, 35, 34, -22, -100, -115, -40, 55, 87, 48, 2, -11, -10 -}; -#define SUM_AFSK24_TX_LO_Q -25 - -static const int afsk24_tx_hi_i[] = { - 10, 0, -35, -2, 89, 6, -124, -10, 111, 9, -61, -4, 16, 1 -}; -#define SUM_AFSK24_TX_HI_I 6 - -static const int afsk24_tx_hi_q[] = { - 0, 16, 0, -61, -4, 112, 8, -124, -10, 88, 7, -35, -2, 10 -}; -#define SUM_AFSK24_TX_HI_Q 5 - -#endif /* CONFIG_SOUNDMODEM_FLOAT */ - diff --git a/drivers/net/soundmodem/sm_tbl_afsk2666.h b/drivers/net/soundmodem/sm_tbl_afsk2666.h deleted file mode 100644 index 839c7b1f95cc..000000000000 --- a/drivers/net/soundmodem/sm_tbl_afsk2666.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * THIS FILE IS GENERATED AUTOMATICALLY BY ./gentbl, DO NOT EDIT! - */ - - -/* - * small cosine table in U8 format - */ -#define OFFSCOSTABBITS 6 -#define OFFSCOSTABSIZE (1<>10)&0x3f] - - -/* - * more accurate cosine table - */ - -static const short costab[64] = { - 32767, 32609, 32137, 31356, 30272, 28897, 27244, 25329, - 23169, 20787, 18204, 15446, 12539, 9511, 6392, 3211, - 0, -3211, -6392, -9511, -12539, -15446, -18204, -20787, - -23169, -25329, -27244, -28897, -30272, -31356, -32137, -32609, - -32767, -32609, -32137, -31356, -30272, -28897, -27244, -25329, - -23169, -20787, -18204, -15446, -12539, -9511, -6392, -3211, - 0, 3211, 6392, 9511, 12539, 15446, 18204, 20787, - 23169, 25329, 27244, 28897, 30272, 31356, 32137, 32609 -}; - -#define COS(x) costab[((x)>>10)&0x3f] -#define SIN(x) COS((x)+0xc000) - - -/* - * afsk2666 specific tables - */ -#define AFSK26_DEMCORRLEN 12 -#define AFSK26_SAMPLERATE 16000 - -static const unsigned int afsk26_carfreq[2] = { 0x2000, 0x3555 }; - - -static const struct { - int i[12]; - int q[12]; -} afsk26_dem_tables[2][2] = { - { - {{ 1, 7, -18, -73, -100, -47, 47, 100, 73, 18, -7, -1 }, { 0, 17, 43, 30, -41, -115, -115, -41, 30, 43, 17, 0 }}, -#define AFSK26_DEM_SUM_I_0_0 0 -#define AFSK26_DEM_SUM_Q_0_0 -132 - {{ 1, -7, -46, -10, 100, 76, -75, -100, 10, 46, 7, -1 }, { 1, 17, -6, -79, -41, 99, 99, -41, -79, -6, 17, 1 }} -#define AFSK26_DEM_SUM_I_0_1 1 -#define AFSK26_DEM_SUM_Q_0_1 -18 - }, - { - {{ 8, 22, 0, -67, -118, -89, 0, 67, 63, 22, 0, 0 }, { 0, 22, 63, 67, 0, -89, -118, -67, 0, 22, 8, 0 }}, -#define AFSK26_DEM_SUM_I_1_0 -92 -#define AFSK26_DEM_SUM_Q_1_0 -92 - {{ 8, 8, -54, -67, 59, 122, 0, -91, -31, 22, 7, 0 }, { 0, 30, 31, -67, -102, 32, 118, 24, -54, -22, 4, 0 }} -#define AFSK26_DEM_SUM_I_1_1 -17 -#define AFSK26_DEM_SUM_Q_1_1 -6 - } -}; - diff --git a/drivers/net/soundmodem/sm_tbl_fsk9600.h b/drivers/net/soundmodem/sm_tbl_fsk9600.h deleted file mode 100644 index c3384a97edbd..000000000000 --- a/drivers/net/soundmodem/sm_tbl_fsk9600.h +++ /dev/null @@ -1,302 +0,0 @@ -/* - * THIS FILE IS GENERATED AUTOMATICALLY BY ./gentbl, DO NOT EDIT! - */ - - -/* - * fsk9600 specific tables - */ -static unsigned char fsk96_txfilt_4[] = { - 37, 37, 35, 36, 39, 40, 38, 38, - 53, 53, 51, 52, 55, 56, 54, 54, - 210, 210, 208, 209, 212, 213, 211, 211, - 226, 226, 224, 225, 228, 229, 227, 227, - 23, 23, 22, 22, 26, 26, 24, 24, - 39, 39, 38, 38, 42, 42, 40, 40, - 196, 196, 195, 195, 199, 199, 197, 197, - 212, 212, 211, 211, 215, 215, 213, 213, - 43, 43, 42, 42, 46, 46, 44, 44, - 59, 59, 58, 58, 62, 62, 60, 60, - 216, 216, 215, 215, 219, 219, 217, 217, - 232, 232, 231, 231, 235, 235, 233, 233, - 29, 29, 28, 28, 32, 32, 30, 30, - 45, 45, 44, 44, 48, 48, 46, 46, - 202, 202, 201, 201, 205, 205, 203, 203, - 218, 218, 217, 217, 221, 221, 219, 219, - 36, 36, 34, 34, 38, 38, 37, 37, - 52, 52, 50, 50, 54, 54, 53, 53, - 209, 209, 207, 207, 211, 211, 210, 210, - 225, 225, 223, 223, 227, 227, 226, 226, - 22, 22, 20, 20, 24, 24, 23, 23, - 38, 38, 36, 36, 40, 40, 39, 39, - 195, 195, 193, 193, 197, 197, 196, 196, - 211, 211, 209, 209, 213, 213, 212, 212, - 42, 42, 40, 40, 44, 44, 43, 43, - 58, 58, 56, 56, 60, 60, 59, 59, - 215, 215, 213, 213, 217, 217, 216, 216, - 231, 231, 229, 229, 233, 233, 232, 232, - 28, 28, 26, 27, 30, 31, 29, 29, - 44, 44, 42, 43, 46, 47, 45, 45, - 201, 201, 199, 200, 203, 204, 202, 202, - 217, 217, 215, 216, 219, 220, 218, 218, - 37, 37, 37, 37, 29, 29, 29, 30, - 108, 108, 108, 108, 100, 100, 100, 100, - 169, 169, 169, 170, 161, 161, 162, 162, - 240, 240, 240, 240, 232, 232, 232, 232, - 19, 19, 19, 20, 11, 11, 12, 12, - 90, 90, 90, 90, 82, 82, 82, 82, - 151, 151, 152, 152, 143, 143, 144, 144, - 222, 222, 222, 222, 214, 214, 215, 215, - 41, 41, 41, 41, 33, 33, 33, 34, - 112, 112, 112, 112, 104, 104, 104, 104, - 173, 173, 173, 174, 165, 165, 166, 166, - 244, 244, 244, 244, 236, 236, 236, 236, - 23, 23, 23, 24, 15, 15, 16, 16, - 94, 94, 94, 94, 86, 86, 86, 86, - 155, 155, 156, 156, 147, 147, 148, 148, - 226, 226, 226, 226, 218, 218, 219, 219, - 36, 36, 37, 37, 29, 29, 29, 29, - 107, 107, 108, 108, 99, 99, 100, 100, - 169, 169, 169, 169, 161, 161, 161, 161, - 239, 239, 240, 240, 231, 232, 232, 232, - 19, 19, 19, 19, 11, 11, 11, 11, - 89, 89, 90, 90, 81, 82, 82, 82, - 151, 151, 151, 151, 143, 143, 143, 143, - 221, 222, 222, 222, 214, 214, 214, 214, - 40, 40, 41, 41, 33, 33, 33, 33, - 111, 111, 112, 112, 103, 103, 104, 104, - 173, 173, 173, 173, 165, 165, 165, 165, - 243, 243, 244, 244, 235, 236, 236, 236, - 23, 23, 23, 23, 15, 15, 15, 15, - 93, 93, 94, 94, 85, 86, 86, 86, - 155, 155, 155, 155, 147, 147, 147, 147, - 225, 226, 226, 226, 218, 218, 218, 218, - 37, 36, 41, 40, 19, 19, 23, 23, - 169, 169, 173, 173, 151, 151, 155, 155, - 108, 107, 112, 111, 90, 89, 94, 93, - 240, 239, 244, 243, 222, 221, 226, 225, - 29, 29, 33, 33, 11, 11, 15, 15, - 161, 161, 165, 165, 143, 143, 147, 147, - 100, 99, 104, 103, 82, 81, 86, 85, - 232, 231, 236, 235, 214, 214, 218, 218, - 37, 37, 41, 41, 19, 19, 23, 23, - 169, 169, 173, 173, 152, 151, 156, 155, - 108, 108, 112, 112, 90, 90, 94, 94, - 240, 240, 244, 244, 222, 222, 226, 226, - 29, 29, 33, 33, 12, 11, 16, 15, - 162, 161, 166, 165, 144, 143, 148, 147, - 100, 100, 104, 104, 82, 82, 86, 86, - 232, 232, 236, 236, 215, 214, 219, 218, - 37, 36, 41, 40, 19, 19, 23, 23, - 169, 169, 173, 173, 151, 151, 155, 155, - 108, 107, 112, 111, 90, 89, 94, 93, - 240, 239, 244, 243, 222, 222, 226, 226, - 29, 29, 33, 33, 11, 11, 15, 15, - 161, 161, 165, 165, 143, 143, 147, 147, - 100, 99, 104, 103, 82, 82, 86, 86, - 232, 232, 236, 236, 214, 214, 218, 218, - 37, 37, 41, 41, 20, 19, 24, 23, - 170, 169, 174, 173, 152, 151, 156, 155, - 108, 108, 112, 112, 90, 90, 94, 94, - 240, 240, 244, 244, 222, 222, 226, 226, - 30, 29, 34, 33, 12, 11, 16, 15, - 162, 161, 166, 165, 144, 143, 148, 147, - 100, 100, 104, 104, 82, 82, 86, 86, - 232, 232, 236, 236, 215, 214, 219, 218, - 37, 36, 43, 42, 23, 22, 29, 28, - 210, 209, 216, 215, 196, 195, 202, 201, - 53, 52, 59, 58, 39, 38, 45, 44, - 226, 225, 232, 231, 212, 211, 218, 217, - 39, 38, 46, 44, 26, 24, 32, 30, - 212, 211, 219, 217, 199, 197, 205, 203, - 55, 54, 62, 60, 42, 40, 48, 46, - 228, 227, 235, 233, 215, 213, 221, 219, - 35, 34, 42, 40, 22, 20, 28, 26, - 208, 207, 215, 213, 195, 193, 201, 199, - 51, 50, 58, 56, 38, 36, 44, 42, - 224, 223, 231, 229, 211, 209, 217, 215, - 38, 37, 44, 43, 24, 23, 30, 29, - 211, 210, 217, 216, 197, 196, 203, 202, - 54, 53, 60, 59, 40, 39, 46, 45, - 227, 226, 233, 232, 213, 212, 219, 218, - 37, 36, 43, 42, 23, 22, 29, 28, - 210, 209, 216, 215, 196, 195, 202, 201, - 53, 52, 59, 58, 39, 38, 45, 44, - 226, 225, 232, 231, 212, 211, 218, 217, - 40, 38, 46, 44, 26, 24, 32, 31, - 213, 211, 219, 217, 199, 197, 205, 204, - 56, 54, 62, 60, 42, 40, 48, 47, - 229, 227, 235, 233, 215, 213, 221, 220, - 36, 34, 42, 40, 22, 20, 28, 27, - 209, 207, 215, 213, 195, 193, 201, 200, - 52, 50, 58, 56, 38, 36, 44, 43, - 225, 223, 231, 229, 211, 209, 217, 216, - 38, 37, 44, 43, 24, 23, 30, 29, - 211, 210, 217, 216, 197, 196, 203, 202, - 54, 53, 60, 59, 40, 39, 46, 45, - 227, 226, 233, 232, 213, 212, 219, 218 -}; - -static unsigned char fsk96_txfilt_5[] = { - 39, 40, 38, 38, 42, 43, 41, 41, - 51, 51, 50, 50, 54, 54, 53, 53, - 209, 209, 207, 208, 212, 212, 210, 211, - 221, 221, 219, 219, 224, 224, 222, 222, - 28, 28, 27, 27, 31, 31, 30, 30, - 40, 40, 38, 39, 43, 43, 41, 42, - 198, 198, 196, 196, 201, 201, 199, 199, - 209, 210, 208, 208, 212, 213, 211, 211, - 45, 45, 44, 44, 48, 48, 47, 47, - 57, 57, 56, 56, 60, 60, 59, 59, - 215, 215, 213, 213, 218, 218, 216, 216, - 227, 227, 225, 225, 230, 230, 228, 228, - 34, 34, 32, 33, 37, 37, 35, 36, - 46, 46, 44, 44, 49, 49, 47, 47, - 203, 204, 202, 202, 206, 207, 205, 205, - 215, 215, 214, 214, 218, 218, 217, 217, - 38, 38, 37, 37, 41, 41, 40, 40, - 50, 50, 48, 49, 53, 53, 51, 52, - 208, 208, 206, 206, 211, 211, 209, 209, - 219, 220, 218, 218, 222, 223, 221, 221, - 27, 27, 25, 25, 30, 30, 28, 28, - 39, 39, 37, 37, 42, 42, 40, 40, - 196, 196, 195, 195, 199, 199, 198, 198, - 208, 208, 207, 207, 211, 211, 210, 210, - 44, 44, 42, 43, 47, 47, 45, 46, - 56, 56, 54, 54, 59, 59, 57, 57, - 213, 214, 212, 212, 216, 217, 215, 215, - 225, 225, 224, 224, 228, 228, 227, 227, - 33, 33, 31, 31, 36, 36, 34, 34, - 44, 45, 43, 43, 47, 48, 46, 46, - 202, 202, 201, 201, 205, 205, 204, 204, - 214, 214, 212, 213, 217, 217, 215, 216, - 39, 40, 39, 39, 35, 35, 35, 35, - 91, 91, 90, 90, 86, 87, 86, 86, - 183, 183, 182, 182, 178, 179, 178, 178, - 234, 234, 234, 234, 230, 230, 229, 230, - 21, 22, 21, 21, 17, 17, 17, 17, - 73, 73, 72, 72, 68, 69, 68, 68, - 165, 165, 164, 164, 161, 161, 160, 160, - 216, 216, 216, 216, 212, 212, 211, 212, - 44, 44, 44, 44, 40, 40, 40, 40, - 95, 96, 95, 95, 91, 91, 91, 91, - 187, 188, 187, 187, 183, 183, 183, 183, - 239, 239, 238, 239, 235, 235, 234, 234, - 26, 26, 26, 26, 22, 22, 22, 22, - 77, 78, 77, 77, 73, 73, 73, 73, - 170, 170, 169, 169, 165, 165, 165, 165, - 221, 221, 220, 221, 217, 217, 216, 216, - 39, 39, 38, 38, 34, 35, 34, 34, - 90, 90, 90, 90, 86, 86, 85, 85, - 182, 182, 182, 182, 178, 178, 177, 178, - 233, 233, 233, 233, 229, 229, 229, 229, - 21, 21, 20, 20, 16, 17, 16, 16, - 72, 72, 72, 72, 68, 68, 67, 68, - 164, 164, 164, 164, 160, 160, 159, 160, - 215, 215, 215, 215, 211, 211, 211, 211, - 43, 44, 43, 43, 39, 39, 39, 39, - 95, 95, 94, 94, 91, 91, 90, 90, - 187, 187, 186, 187, 183, 183, 182, 182, - 238, 238, 238, 238, 234, 234, 233, 234, - 25, 26, 25, 25, 21, 21, 21, 21, - 77, 77, 76, 77, 73, 73, 72, 72, - 169, 169, 168, 169, 165, 165, 164, 164, - 220, 220, 220, 220, 216, 216, 215, 216, - 39, 39, 41, 41, 26, 26, 28, 28, - 139, 139, 141, 141, 126, 125, 128, 128, - 139, 139, 141, 141, 126, 125, 128, 127, - 238, 238, 240, 240, 225, 225, 227, 227, - 26, 26, 28, 28, 13, 13, 15, 15, - 126, 125, 128, 128, 112, 112, 115, 114, - 126, 125, 128, 127, 112, 112, 115, 114, - 225, 225, 227, 227, 212, 212, 214, 214, - 41, 41, 44, 43, 28, 28, 30, 30, - 141, 141, 143, 143, 128, 128, 130, 130, - 141, 141, 143, 143, 128, 127, 130, 130, - 240, 240, 242, 242, 227, 227, 229, 229, - 28, 28, 30, 30, 15, 15, 17, 17, - 128, 128, 130, 130, 115, 114, 117, 116, - 128, 127, 130, 130, 115, 114, 117, 116, - 227, 227, 229, 229, 214, 214, 216, 216, - 39, 39, 41, 41, 26, 26, 28, 28, - 139, 138, 141, 140, 125, 125, 128, 127, - 139, 138, 141, 140, 125, 125, 127, 127, - 238, 238, 240, 240, 225, 225, 227, 227, - 26, 26, 28, 28, 13, 13, 15, 15, - 125, 125, 128, 127, 112, 112, 114, 114, - 125, 125, 127, 127, 112, 112, 114, 114, - 225, 225, 227, 227, 212, 211, 214, 214, - 41, 41, 43, 43, 28, 28, 30, 30, - 141, 140, 143, 143, 128, 127, 130, 129, - 141, 140, 143, 143, 127, 127, 130, 129, - 240, 240, 242, 242, 227, 227, 229, 229, - 28, 28, 30, 30, 15, 15, 17, 17, - 128, 127, 130, 129, 114, 114, 116, 116, - 127, 127, 130, 129, 114, 114, 116, 116, - 227, 227, 229, 229, 214, 214, 216, 216, - 39, 39, 44, 43, 21, 21, 26, 25, - 183, 182, 187, 187, 165, 164, 170, 169, - 91, 90, 95, 95, 73, 72, 77, 77, - 234, 233, 239, 238, 216, 215, 221, 220, - 35, 34, 40, 39, 17, 16, 22, 21, - 178, 178, 183, 183, 161, 160, 165, 165, - 86, 86, 91, 91, 68, 68, 73, 73, - 230, 229, 235, 234, 212, 211, 217, 216, - 39, 38, 44, 43, 21, 20, 26, 25, - 182, 182, 187, 186, 164, 164, 169, 168, - 90, 90, 95, 94, 72, 72, 77, 76, - 234, 233, 238, 238, 216, 215, 220, 220, - 35, 34, 40, 39, 17, 16, 22, 21, - 178, 177, 183, 182, 160, 159, 165, 164, - 86, 85, 91, 90, 68, 67, 73, 72, - 229, 229, 234, 233, 211, 211, 216, 215, - 40, 39, 44, 44, 22, 21, 26, 26, - 183, 182, 188, 187, 165, 164, 170, 169, - 91, 90, 96, 95, 73, 72, 78, 77, - 234, 233, 239, 238, 216, 215, 221, 220, - 35, 35, 40, 39, 17, 17, 22, 21, - 179, 178, 183, 183, 161, 160, 165, 165, - 87, 86, 91, 91, 69, 68, 73, 73, - 230, 229, 235, 234, 212, 211, 217, 216, - 39, 38, 44, 43, 21, 20, 26, 25, - 182, 182, 187, 187, 164, 164, 169, 169, - 90, 90, 95, 94, 72, 72, 77, 77, - 234, 233, 239, 238, 216, 215, 221, 220, - 35, 34, 40, 39, 17, 16, 22, 21, - 178, 178, 183, 182, 160, 160, 165, 164, - 86, 85, 91, 90, 68, 68, 73, 72, - 230, 229, 234, 234, 212, 211, 216, 216, - 39, 38, 45, 44, 28, 27, 34, 33, - 209, 208, 215, 213, 198, 196, 203, 202, - 51, 50, 57, 56, 40, 39, 46, 44, - 221, 219, 227, 225, 209, 208, 215, 214, - 42, 41, 48, 47, 31, 30, 37, 36, - 212, 211, 218, 216, 201, 199, 206, 205, - 54, 53, 60, 59, 43, 42, 49, 47, - 224, 222, 230, 228, 212, 211, 218, 217, - 38, 37, 44, 42, 27, 25, 32, 31, - 207, 206, 213, 212, 196, 195, 202, 201, - 50, 48, 56, 54, 38, 37, 44, 43, - 219, 218, 225, 224, 208, 207, 214, 212, - 41, 40, 47, 45, 30, 28, 35, 34, - 210, 209, 216, 215, 199, 198, 205, 204, - 53, 51, 59, 57, 41, 40, 47, 46, - 222, 221, 228, 227, 211, 210, 217, 215, - 40, 38, 45, 44, 28, 27, 34, 33, - 209, 208, 215, 214, 198, 196, 204, 202, - 51, 50, 57, 56, 40, 39, 46, 45, - 221, 220, 227, 225, 210, 208, 215, 214, - 43, 41, 48, 47, 31, 30, 37, 36, - 212, 211, 218, 217, 201, 199, 207, 205, - 54, 53, 60, 59, 43, 42, 49, 48, - 224, 223, 230, 228, 213, 211, 218, 217, - 38, 37, 44, 43, 27, 25, 33, 31, - 208, 206, 213, 212, 196, 195, 202, 201, - 50, 49, 56, 54, 39, 37, 44, 43, - 219, 218, 225, 224, 208, 207, 214, 213, - 41, 40, 47, 46, 30, 28, 36, 34, - 211, 209, 216, 215, 199, 198, 205, 204, - 53, 52, 59, 57, 42, 40, 47, 46, - 222, 221, 228, 227, 211, 210, 217, 216 -}; - diff --git a/drivers/net/soundmodem/sm_tbl_hapn4800.h b/drivers/net/soundmodem/sm_tbl_hapn4800.h deleted file mode 100644 index 39de6d941984..000000000000 --- a/drivers/net/soundmodem/sm_tbl_hapn4800.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * THIS FILE IS GENERATED AUTOMATICALLY BY ./gentbl, DO NOT EDIT! - */ - - -/* - * hapn4800 specific tables - */ - -static unsigned char hapn48_txfilt_8[] = { - 128, 127, 92, 91, 151, 150, 115, 114, - 141, 140, 105, 104, 164, 163, 128, 128, - 127, 128, 63, 63, 193, 194, 129, 129, - 126, 126, 61, 62, 192, 192, 127, 128, - 128, 129, 37, 38, 224, 226, 134, 135, - 120, 121, 29, 31, 217, 218, 126, 127, - 128, 132, 19, 24, 239, 243, 130, 135, - 120, 125, 12, 16, 231, 236, 123, 127, - 128, 135, 16, 24, 236, 243, 125, 132, - 123, 130, 12, 19, 231, 239, 120, 127, - 128, 135, 31, 38, 218, 226, 121, 129, - 126, 134, 29, 37, 217, 224, 120, 127, - 127, 129, 62, 63, 192, 194, 126, 128, - 127, 129, 61, 63, 192, 193, 126, 128, - 128, 114, 104, 91, 163, 150, 140, 127, - 128, 115, 105, 92, 164, 151, 141, 127 -}; - -static unsigned char hapn48_txfilt_10[] = { - 128, 127, 94, 94, 146, 146, 113, 112, - 143, 142, 109, 109, 161, 161, 128, 128, - 128, 127, 72, 72, 182, 182, 126, 126, - 129, 129, 73, 73, 183, 183, 128, 127, - 127, 128, 49, 50, 211, 212, 133, 133, - 122, 122, 43, 44, 205, 206, 127, 128, - 127, 130, 30, 33, 231, 233, 133, 136, - 119, 122, 22, 24, 222, 225, 125, 128, - 127, 133, 18, 23, 240, 245, 130, 135, - 120, 125, 10, 15, 232, 237, 122, 128, - 128, 135, 15, 23, 237, 245, 125, 133, - 122, 130, 10, 18, 232, 240, 120, 128, - 127, 136, 24, 33, 225, 233, 122, 130, - 125, 133, 22, 30, 222, 231, 119, 128, - 128, 133, 44, 50, 206, 212, 122, 128, - 127, 133, 43, 49, 205, 211, 122, 127, - 127, 126, 73, 72, 183, 182, 129, 127, - 128, 126, 73, 72, 183, 182, 129, 128, - 128, 112, 109, 94, 161, 146, 142, 127, - 128, 113, 109, 94, 161, 146, 143, 127 -}; - -static unsigned char hapn48_txfilt_pm8[] = { - 12, 6, 242, 237, 18, 12, 248, 243, - 12, 7, 243, 237, 18, 13, 249, 243, - 12, 18, 243, 248, 7, 12, 237, 243, - 12, 18, 243, 248, 7, 12, 237, 243, - 12, 39, 225, 252, 3, 30, 216, 243, - 12, 39, 225, 252, 3, 30, 216, 243, - 11, 70, 193, 252, 3, 62, 185, 244, - 11, 70, 193, 252, 3, 62, 185, 244, - 11, 109, 152, 250, 5, 103, 146, 244, - 11, 109, 152, 250, 5, 103, 146, 244, - 9, 150, 107, 248, 7, 148, 105, 246, - 9, 150, 107, 248, 7, 148, 105, 246, - 8, 189, 66, 248, 7, 189, 66, 247, - 8, 189, 66, 248, 7, 189, 66, 247, - 7, 221, 34, 248, 7, 221, 34, 248, - 7, 221, 34, 248, 7, 221, 34, 248 -}; - -static unsigned char hapn48_txfilt_pm10[] = { - 12, 12, 8, 8, 243, 243, 238, 238, - 17, 17, 12, 12, 247, 247, 243, 243, - 8, 8, 12, 13, 238, 239, 243, 243, - 12, 12, 16, 17, 242, 243, 247, 247, - 8, 8, 28, 28, 227, 227, 247, 247, - 8, 8, 28, 28, 227, 227, 247, 247, - 9, 8, 50, 50, 207, 206, 248, 248, - 7, 7, 49, 48, 205, 205, 247, 246, - 10, 9, 79, 78, 179, 178, 249, 248, - 7, 6, 77, 76, 177, 176, 246, 245, - 11, 8, 113, 110, 147, 144, 249, 246, - 9, 6, 111, 108, 145, 142, 247, 244, - 12, 7, 148, 143, 114, 109, 250, 245, - 10, 5, 146, 141, 112, 107, 248, 243, - 12, 5, 181, 174, 82, 74, 251, 244, - 11, 4, 181, 173, 81, 74, 250, 243, - 12, 3, 210, 201, 54, 45, 252, 243, - 12, 3, 210, 201, 54, 45, 252, 243, - 12, 4, 231, 223, 32, 24, 251, 243, - 12, 4, 231, 223, 32, 24, 251, 243 -}; - diff --git a/drivers/net/soundmodem/sm_tbl_psk4800.h b/drivers/net/soundmodem/sm_tbl_psk4800.h deleted file mode 100644 index e3d57ba59450..000000000000 --- a/drivers/net/soundmodem/sm_tbl_psk4800.h +++ /dev/null @@ -1,373 +0,0 @@ -/* - * THIS FILE IS GENERATED AUTOMATICALLY BY ./gentbl, DO NOT EDIT! - */ - - -/* - * psk4800 specific tables - */ -#define PSK48_TXF_OVERSAMPLING 5 -#define PSK48_TXF_NUMSAMPLES 16 - -#define PSK48_SAMPLERATE 8000 -#define PSK48_CAR_FREQ 2000 -#define PSK48_PSK_LEN 5 -#define PSK48_RXF_LEN 64 -#define PSK48_PHASEINC (0x10000*PSK48_CAR_FREQ/PSK48_SAMPLERATE) -#define PSK48_SPHASEINC (0x10000/(2*PSK48_PSK_LEN)) - -static const short psk48_tx_table[PSK48_TXF_OVERSAMPLING*PSK48_TXF_NUMSAMPLES*8*2] = { - -12, -8, 0, 8, 12, 8, 0, -8, - 0, -8, -12, -8, 0, 8, 12, 8, - -20, -14, 0, 14, 20, 14, 0, -14, - 0, -14, -20, -14, 0, 14, 20, 14, - -45, -32, 0, 32, 45, 32, 0, -32, - 0, -32, -45, -32, 0, 32, 45, 32, - -92, -65, 0, 65, 92, 65, 0, -65, - 0, -65, -92, -65, 0, 65, 92, 65, - -172, -122, 0, 122, 172, 122, 0, -122, - 0, -122, -172, -122, 0, 122, 172, 122, - -307, -217, 0, 217, 307, 217, 0, -217, - 0, -217, -307, -217, 0, 217, 307, 217, - -564, -399, 0, 399, 564, 399, 0, -399, - 0, -399, -564, -399, 0, 399, 564, 399, - -1322, -935, 0, 935, 1322, 935, 0, -935, - 0, -935, -1322, -935, 0, 935, 1322, 935, - 12256, 8666, 0, -8666, -12256, -8666, 0, 8666, - 0, 8666, 12256, 8666, 0, -8666, -12256, -8666, - 1066, 754, 0, -754, -1066, -754, 0, 754, - 0, 754, 1066, 754, 0, -754, -1066, -754, - 495, 350, 0, -350, -495, -350, 0, 350, - 0, 350, 495, 350, 0, -350, -495, -350, - 273, 193, 0, -193, -273, -193, 0, 193, - 0, 193, 273, 193, 0, -193, -273, -193, - 153, 108, 0, -108, -153, -108, 0, 108, - 0, 108, 153, 108, 0, -108, -153, -108, - 81, 57, 0, -57, -81, -57, 0, 57, - 0, 57, 81, 57, 0, -57, -81, -57, - 38, 27, 0, -27, -38, -27, 0, 27, - 0, 27, 38, 27, 0, -27, -38, -27, - 17, 12, 0, -12, -17, -12, 0, 12, - 0, 12, 17, 12, 0, -12, -17, -12, - -20, -14, 0, 14, 20, 14, 0, -14, - 0, -14, -20, -14, 0, 14, 20, 14, - -38, -27, 0, 27, 38, 27, 0, -27, - 0, -27, -38, -27, 0, 27, 38, 27, - -85, -60, 0, 60, 85, 60, 0, -60, - 0, -60, -85, -60, 0, 60, 85, 60, - -170, -120, 0, 120, 170, 120, 0, -120, - 0, -120, -170, -120, 0, 120, 170, 120, - -314, -222, 0, 222, 314, 222, 0, -222, - 0, -222, -314, -222, 0, 222, 314, 222, - -557, -394, 0, 394, 557, 394, 0, -394, - 0, -394, -557, -394, 0, 394, 557, 394, - -1048, -741, 0, 741, 1048, 741, 0, -741, - 0, -741, -1048, -741, 0, 741, 1048, 741, - -2783, -1968, 0, 1968, 2783, 1968, 0, -1968, - 0, -1968, -2783, -1968, 0, 1968, 2783, 1968, - 6591, 4660, 0, -4660, -6591, -4660, 0, 4660, - 0, 4660, 6591, 4660, 0, -4660, -6591, -4660, - 1434, 1014, 0, -1014, -1434, -1014, 0, 1014, - 0, 1014, 1434, 1014, 0, -1014, -1434, -1014, - 707, 500, 0, -500, -707, -500, 0, 500, - 0, 500, 707, 500, 0, -500, -707, -500, - 395, 279, 0, -279, -395, -279, 0, 279, - 0, 279, 395, 279, 0, -279, -395, -279, - 219, 155, 0, -155, -219, -155, 0, 155, - 0, 155, 219, 155, 0, -155, -219, -155, - 114, 80, 0, -80, -114, -80, 0, 80, - 0, 80, 114, 80, 0, -80, -114, -80, - 53, 37, 0, -37, -53, -37, 0, 37, - 0, 37, 53, 37, 0, -37, -53, -37, - 25, 17, 0, -17, -25, -17, 0, 17, - 0, 17, 25, 17, 0, -17, -25, -17, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 25, 17, 0, -17, -25, -17, 0, 17, - 0, 17, 25, 17, 0, -17, -25, -17, - 53, 37, 0, -37, -53, -37, 0, 37, - 0, 37, 53, 37, 0, -37, -53, -37, - 114, 80, 0, -80, -114, -80, 0, 80, - 0, 80, 114, 80, 0, -80, -114, -80, - 219, 155, 0, -155, -219, -155, 0, 155, - 0, 155, 219, 155, 0, -155, -219, -155, - 395, 279, 0, -279, -395, -279, 0, 279, - 0, 279, 395, 279, 0, -279, -395, -279, - 707, 500, 0, -500, -707, -500, 0, 500, - 0, 500, 707, 500, 0, -500, -707, -500, - 1434, 1014, 0, -1014, -1434, -1014, 0, 1014, - 0, 1014, 1434, 1014, 0, -1014, -1434, -1014, - 6591, 4660, 0, -4660, -6591, -4660, 0, 4660, - 0, 4660, 6591, 4660, 0, -4660, -6591, -4660, - -2783, -1968, 0, 1968, 2783, 1968, 0, -1968, - 0, -1968, -2783, -1968, 0, 1968, 2783, 1968, - -1048, -741, 0, 741, 1048, 741, 0, -741, - 0, -741, -1048, -741, 0, 741, 1048, 741, - -557, -394, 0, 394, 557, 394, 0, -394, - 0, -394, -557, -394, 0, 394, 557, 394, - -314, -222, 0, 222, 314, 222, 0, -222, - 0, -222, -314, -222, 0, 222, 314, 222, - -170, -120, 0, 120, 170, 120, 0, -120, - 0, -120, -170, -120, 0, 120, 170, 120, - -85, -60, 0, 60, 85, 60, 0, -60, - 0, -60, -85, -60, 0, 60, 85, 60, - -38, -27, 0, 27, 38, 27, 0, -27, - 0, -27, -38, -27, 0, 27, 38, 27, - -20, -14, 0, 14, 20, 14, 0, -14, - 0, -14, -20, -14, 0, 14, 20, 14, - 17, 12, 0, -12, -17, -12, 0, 12, - 0, 12, 17, 12, 0, -12, -17, -12, - 38, 27, 0, -27, -38, -27, 0, 27, - 0, 27, 38, 27, 0, -27, -38, -27, - 81, 57, 0, -57, -81, -57, 0, 57, - 0, 57, 81, 57, 0, -57, -81, -57, - 153, 108, 0, -108, -153, -108, 0, 108, - 0, 108, 153, 108, 0, -108, -153, -108, - 273, 193, 0, -193, -273, -193, 0, 193, - 0, 193, 273, 193, 0, -193, -273, -193, - 495, 350, 0, -350, -495, -350, 0, 350, - 0, 350, 495, 350, 0, -350, -495, -350, - 1066, 754, 0, -754, -1066, -754, 0, 754, - 0, 754, 1066, 754, 0, -754, -1066, -754, - 12256, 8666, 0, -8666, -12256, -8666, 0, 8666, - 0, 8666, 12256, 8666, 0, -8666, -12256, -8666, - -1322, -935, 0, 935, 1322, 935, 0, -935, - 0, -935, -1322, -935, 0, 935, 1322, 935, - -564, -399, 0, 399, 564, 399, 0, -399, - 0, -399, -564, -399, 0, 399, 564, 399, - -307, -217, 0, 217, 307, 217, 0, -217, - 0, -217, -307, -217, 0, 217, 307, 217, - -172, -122, 0, 122, 172, 122, 0, -122, - 0, -122, -172, -122, 0, 122, 172, 122, - -92, -65, 0, 65, 92, 65, 0, -65, - 0, -65, -92, -65, 0, 65, 92, 65, - -45, -32, 0, 32, 45, 32, 0, -32, - 0, -32, -45, -32, 0, 32, 45, 32, - -20, -14, 0, 14, 20, 14, 0, -14, - 0, -14, -20, -14, 0, 14, 20, 14, - -12, -8, 0, 8, 12, 8, 0, -8, - 0, -8, -12, -8, 0, 8, 12, 8 -}; - -static const short psk48_rx_coeff[PSK48_RXF_LEN] = { - -7, 11, 28, 35, 24, -6, -48, -79, - -76, -22, 68, 157, 186, 114, -53, -250, - -370, -315, -58, 318, 636, 694, 371, -281, - -1014, -1444, -1200, -86, 1793, 4033, 6035, 7215, - 7215, 6035, 4033, 1793, -86, -1200, -1444, -1014, - -281, 371, 694, 636, 318, -58, -315, -370, - -250, -53, 114, 186, 157, 68, -22, -76, - -79, -48, -6, 24, 35, 28, 11, -7 -}; - - -/* - * more accurate cosine table - */ - -static const short costab[256] = { - 32767, 32757, 32727, 32678, 32609, 32520, 32412, 32284, - 32137, 31970, 31785, 31580, 31356, 31113, 30851, 30571, - 30272, 29955, 29621, 29268, 28897, 28510, 28105, 27683, - 27244, 26789, 26318, 25831, 25329, 24811, 24278, 23731, - 23169, 22594, 22004, 21402, 20787, 20159, 19519, 18867, - 18204, 17530, 16845, 16150, 15446, 14732, 14009, 13278, - 12539, 11792, 11038, 10278, 9511, 8739, 7961, 7179, - 6392, 5601, 4807, 4011, 3211, 2410, 1607, 804, - 0, -804, -1607, -2410, -3211, -4011, -4807, -5601, - -6392, -7179, -7961, -8739, -9511, -10278, -11038, -11792, - -12539, -13278, -14009, -14732, -15446, -16150, -16845, -17530, - -18204, -18867, -19519, -20159, -20787, -21402, -22004, -22594, - -23169, -23731, -24278, -24811, -25329, -25831, -26318, -26789, - -27244, -27683, -28105, -28510, -28897, -29268, -29621, -29955, - -30272, -30571, -30851, -31113, -31356, -31580, -31785, -31970, - -32137, -32284, -32412, -32520, -32609, -32678, -32727, -32757, - -32767, -32757, -32727, -32678, -32609, -32520, -32412, -32284, - -32137, -31970, -31785, -31580, -31356, -31113, -30851, -30571, - -30272, -29955, -29621, -29268, -28897, -28510, -28105, -27683, - -27244, -26789, -26318, -25831, -25329, -24811, -24278, -23731, - -23169, -22594, -22004, -21402, -20787, -20159, -19519, -18867, - -18204, -17530, -16845, -16150, -15446, -14732, -14009, -13278, - -12539, -11792, -11038, -10278, -9511, -8739, -7961, -7179, - -6392, -5601, -4807, -4011, -3211, -2410, -1607, -804, - 0, 804, 1607, 2410, 3211, 4011, 4807, 5601, - 6392, 7179, 7961, 8739, 9511, 10278, 11038, 11792, - 12539, 13278, 14009, 14732, 15446, 16150, 16845, 17530, - 18204, 18867, 19519, 20159, 20787, 21402, 22004, 22594, - 23169, 23731, 24278, 24811, 25329, 25831, 26318, 26789, - 27244, 27683, 28105, 28510, 28897, 29268, 29621, 29955, - 30272, 30571, 30851, 31113, 31356, 31580, 31785, 31970, - 32137, 32284, 32412, 32520, 32609, 32678, 32727, 32757 -}; - -#define COS(x) costab[((x)>>8)&0xff] -#define SIN(x) COS((x)+0xc000) - - -/* - * arctan table (indexed by i/q; should really be indexed by i/(i+q) - */ -#define ATAN_TABLEN 1024 - -static const unsigned short atan_tab[ATAN_TABLEN+2] = { - 0, 10, 20, 30, 40, 50, 61, 71, - 81, 91, 101, 112, 122, 132, 142, 152, - 162, 173, 183, 193, 203, 213, 224, 234, - 244, 254, 264, 274, 285, 295, 305, 315, - 325, 336, 346, 356, 366, 376, 386, 397, - 407, 417, 427, 437, 447, 458, 468, 478, - 488, 498, 508, 519, 529, 539, 549, 559, - 569, 579, 590, 600, 610, 620, 630, 640, - 651, 661, 671, 681, 691, 701, 711, 722, - 732, 742, 752, 762, 772, 782, 792, 803, - 813, 823, 833, 843, 853, 863, 873, 884, - 894, 904, 914, 924, 934, 944, 954, 964, - 974, 985, 995, 1005, 1015, 1025, 1035, 1045, - 1055, 1065, 1075, 1085, 1096, 1106, 1116, 1126, - 1136, 1146, 1156, 1166, 1176, 1186, 1196, 1206, - 1216, 1226, 1236, 1246, 1256, 1266, 1277, 1287, - 1297, 1307, 1317, 1327, 1337, 1347, 1357, 1367, - 1377, 1387, 1397, 1407, 1417, 1427, 1437, 1447, - 1457, 1467, 1477, 1487, 1497, 1507, 1517, 1527, - 1537, 1547, 1556, 1566, 1576, 1586, 1596, 1606, - 1616, 1626, 1636, 1646, 1656, 1666, 1676, 1686, - 1696, 1706, 1715, 1725, 1735, 1745, 1755, 1765, - 1775, 1785, 1795, 1805, 1814, 1824, 1834, 1844, - 1854, 1864, 1874, 1884, 1893, 1903, 1913, 1923, - 1933, 1943, 1952, 1962, 1972, 1982, 1992, 2002, - 2011, 2021, 2031, 2041, 2051, 2060, 2070, 2080, - 2090, 2100, 2109, 2119, 2129, 2139, 2148, 2158, - 2168, 2178, 2187, 2197, 2207, 2217, 2226, 2236, - 2246, 2255, 2265, 2275, 2285, 2294, 2304, 2314, - 2323, 2333, 2343, 2352, 2362, 2372, 2381, 2391, - 2401, 2410, 2420, 2430, 2439, 2449, 2459, 2468, - 2478, 2488, 2497, 2507, 2516, 2526, 2536, 2545, - 2555, 2564, 2574, 2583, 2593, 2603, 2612, 2622, - 2631, 2641, 2650, 2660, 2669, 2679, 2688, 2698, - 2708, 2717, 2727, 2736, 2746, 2755, 2765, 2774, - 2784, 2793, 2802, 2812, 2821, 2831, 2840, 2850, - 2859, 2869, 2878, 2887, 2897, 2906, 2916, 2925, - 2935, 2944, 2953, 2963, 2972, 2981, 2991, 3000, - 3010, 3019, 3028, 3038, 3047, 3056, 3066, 3075, - 3084, 3094, 3103, 3112, 3122, 3131, 3140, 3149, - 3159, 3168, 3177, 3187, 3196, 3205, 3214, 3224, - 3233, 3242, 3251, 3260, 3270, 3279, 3288, 3297, - 3307, 3316, 3325, 3334, 3343, 3352, 3362, 3371, - 3380, 3389, 3398, 3407, 3416, 3426, 3435, 3444, - 3453, 3462, 3471, 3480, 3489, 3498, 3508, 3517, - 3526, 3535, 3544, 3553, 3562, 3571, 3580, 3589, - 3598, 3607, 3616, 3625, 3634, 3643, 3652, 3661, - 3670, 3679, 3688, 3697, 3706, 3715, 3724, 3733, - 3742, 3751, 3759, 3768, 3777, 3786, 3795, 3804, - 3813, 3822, 3831, 3839, 3848, 3857, 3866, 3875, - 3884, 3893, 3901, 3910, 3919, 3928, 3937, 3945, - 3954, 3963, 3972, 3981, 3989, 3998, 4007, 4016, - 4024, 4033, 4042, 4051, 4059, 4068, 4077, 4085, - 4094, 4103, 4112, 4120, 4129, 4138, 4146, 4155, - 4164, 4172, 4181, 4189, 4198, 4207, 4215, 4224, - 4233, 4241, 4250, 4258, 4267, 4275, 4284, 4293, - 4301, 4310, 4318, 4327, 4335, 4344, 4352, 4361, - 4369, 4378, 4386, 4395, 4403, 4412, 4420, 4429, - 4437, 4446, 4454, 4462, 4471, 4479, 4488, 4496, - 4505, 4513, 4521, 4530, 4538, 4546, 4555, 4563, - 4572, 4580, 4588, 4597, 4605, 4613, 4622, 4630, - 4638, 4646, 4655, 4663, 4671, 4680, 4688, 4696, - 4704, 4713, 4721, 4729, 4737, 4745, 4754, 4762, - 4770, 4778, 4787, 4795, 4803, 4811, 4819, 4827, - 4836, 4844, 4852, 4860, 4868, 4876, 4884, 4892, - 4901, 4909, 4917, 4925, 4933, 4941, 4949, 4957, - 4965, 4973, 4981, 4989, 4997, 5005, 5013, 5021, - 5029, 5037, 5045, 5053, 5061, 5069, 5077, 5085, - 5093, 5101, 5109, 5117, 5125, 5133, 5141, 5148, - 5156, 5164, 5172, 5180, 5188, 5196, 5204, 5211, - 5219, 5227, 5235, 5243, 5251, 5258, 5266, 5274, - 5282, 5290, 5297, 5305, 5313, 5321, 5328, 5336, - 5344, 5352, 5359, 5367, 5375, 5383, 5390, 5398, - 5406, 5413, 5421, 5429, 5436, 5444, 5452, 5459, - 5467, 5475, 5482, 5490, 5497, 5505, 5513, 5520, - 5528, 5535, 5543, 5550, 5558, 5566, 5573, 5581, - 5588, 5596, 5603, 5611, 5618, 5626, 5633, 5641, - 5648, 5656, 5663, 5671, 5678, 5686, 5693, 5700, - 5708, 5715, 5723, 5730, 5738, 5745, 5752, 5760, - 5767, 5774, 5782, 5789, 5797, 5804, 5811, 5819, - 5826, 5833, 5841, 5848, 5855, 5862, 5870, 5877, - 5884, 5892, 5899, 5906, 5913, 5921, 5928, 5935, - 5942, 5949, 5957, 5964, 5971, 5978, 5985, 5993, - 6000, 6007, 6014, 6021, 6028, 6036, 6043, 6050, - 6057, 6064, 6071, 6078, 6085, 6093, 6100, 6107, - 6114, 6121, 6128, 6135, 6142, 6149, 6156, 6163, - 6170, 6177, 6184, 6191, 6198, 6205, 6212, 6219, - 6226, 6233, 6240, 6247, 6254, 6261, 6268, 6275, - 6282, 6288, 6295, 6302, 6309, 6316, 6323, 6330, - 6337, 6344, 6350, 6357, 6364, 6371, 6378, 6385, - 6391, 6398, 6405, 6412, 6419, 6425, 6432, 6439, - 6446, 6453, 6459, 6466, 6473, 6480, 6486, 6493, - 6500, 6506, 6513, 6520, 6527, 6533, 6540, 6547, - 6553, 6560, 6567, 6573, 6580, 6586, 6593, 6600, - 6606, 6613, 6620, 6626, 6633, 6639, 6646, 6653, - 6659, 6666, 6672, 6679, 6685, 6692, 6698, 6705, - 6711, 6718, 6724, 6731, 6737, 6744, 6750, 6757, - 6763, 6770, 6776, 6783, 6789, 6796, 6802, 6809, - 6815, 6821, 6828, 6834, 6841, 6847, 6853, 6860, - 6866, 6873, 6879, 6885, 6892, 6898, 6904, 6911, - 6917, 6923, 6930, 6936, 6942, 6949, 6955, 6961, - 6967, 6974, 6980, 6986, 6992, 6999, 7005, 7011, - 7017, 7024, 7030, 7036, 7042, 7048, 7055, 7061, - 7067, 7073, 7079, 7086, 7092, 7098, 7104, 7110, - 7116, 7122, 7129, 7135, 7141, 7147, 7153, 7159, - 7165, 7171, 7177, 7183, 7190, 7196, 7202, 7208, - 7214, 7220, 7226, 7232, 7238, 7244, 7250, 7256, - 7262, 7268, 7274, 7280, 7286, 7292, 7298, 7304, - 7310, 7316, 7322, 7328, 7333, 7339, 7345, 7351, - 7357, 7363, 7369, 7375, 7381, 7387, 7392, 7398, - 7404, 7410, 7416, 7422, 7428, 7433, 7439, 7445, - 7451, 7457, 7462, 7468, 7474, 7480, 7486, 7491, - 7497, 7503, 7509, 7514, 7520, 7526, 7532, 7537, - 7543, 7549, 7555, 7560, 7566, 7572, 7577, 7583, - 7589, 7594, 7600, 7606, 7611, 7617, 7623, 7628, - 7634, 7640, 7645, 7651, 7657, 7662, 7668, 7673, - 7679, 7685, 7690, 7696, 7701, 7707, 7712, 7718, - 7724, 7729, 7735, 7740, 7746, 7751, 7757, 7762, - 7768, 7773, 7779, 7784, 7790, 7795, 7801, 7806, - 7812, 7817, 7823, 7828, 7833, 7839, 7844, 7850, - 7855, 7861, 7866, 7871, 7877, 7882, 7888, 7893, - 7898, 7904, 7909, 7914, 7920, 7925, 7931, 7936, - 7941, 7947, 7952, 7957, 7963, 7968, 7973, 7978, - 7984, 7989, 7994, 8000, 8005, 8010, 8015, 8021, - 8026, 8031, 8036, 8042, 8047, 8052, 8057, 8063, - 8068, 8073, 8078, 8083, 8089, 8094, 8099, 8104, - 8109, 8115, 8120, 8125, 8130, 8135, 8140, 8145, - 8151, 8156, 8161, 8166, 8171, 8176, 8181, 8186, - 8192, 8192 -}; - diff --git a/drivers/net/soundmodem/sm_wss.c b/drivers/net/soundmodem/sm_wss.c index ef129930a85f..a089544d2467 100644 --- a/drivers/net/soundmodem/sm_wss.c +++ b/drivers/net/soundmodem/sm_wss.c @@ -98,6 +98,8 @@ struct sc_state_wss { #define WSS_EXTENT 8 +#define CS423X_HOTFIX + /* --------------------------------------------------------------------- */ static void write_codec(struct device *dev, unsigned char idx, @@ -170,6 +172,8 @@ static int wss_set_codec_fmt(struct device *dev, struct sm_state *sm, unsigned c /* MCE and interface config reg */ write_codec(dev, 0x49, fdx ? 0x8 : 0xc); outb(0xb, WSS_CODEC_IA(dev->base_addr)); /* leave MCE */ + if (SCSTATE->crystal && !fullcalib) + return 0; /* * wait for ACI start */ @@ -361,15 +365,16 @@ static void setup_dma_wss(struct device *dev, struct sm_state *sm, int send) abrt = 0; while ((read_codec(dev, 11) & 0x10) || ((++abrt) >= 0x10000)); } +#ifdef CS423X_HOTFIX + if (read_codec(dev, 0x8) != fmt || SCSTATE->crystal) + wss_set_codec_fmt(dev, sm, fmt, fmt, 0, 0); +#else /* CS423X_HOTFIX */ if (read_codec(dev, 0x8) != fmt) wss_set_codec_fmt(dev, sm, fmt, fmt, 0, 0); +#endif /* CS423X_HOTFIX */ numsamps = dma_setup(sm, send, dev->dma) - 1; write_codec(dev, 15, numsamps & 0xff); write_codec(dev, 14, numsamps >> 8); - if (SCSTATE->crystal) { - write_codec(dev, 31, numsamps & 0xff); - write_codec(dev, 30, numsamps >> 8); - } write_codec(dev, 9, codecmode[send]); restore_flags(flags); } @@ -393,10 +398,6 @@ static void wss_interrupt(int irq, void *dev_id, struct pt_regs *regs) nums = dma_ptr(sm, sm->dma.ptt_cnt > 0, dev->dma, &curfrag) - 1; write_codec(dev, 15, nums & 0xff); write_codec(dev, 14, nums >> 8); - if (SCSTATE->crystal) { - write_codec(dev, 31, nums & 0xff); - write_codec(dev, 30, nums >> 8); - } enable_dma(dev->dma); sm_int_freq(sm); sti(); @@ -406,6 +407,7 @@ static void wss_interrupt(int irq, void *dev_id, struct pt_regs *regs) if (hdlcdrv_ptt(&sm->hdrv)) { /* starting to transmit */ disable_dma(dev->dma); + hdlcdrv_transmitter(dev, &sm->hdrv); /* prefill HDLC buffer */ dma_start_transmit(sm); setup_dma_wss(dev, sm, 1); dma_transmit(sm); @@ -413,7 +415,6 @@ static void wss_interrupt(int irq, void *dev_id, struct pt_regs *regs) } else if (dma_end_transmit(sm, curfrag)) { /* stopping transmission */ disable_dma(dev->dma); - sti(); dma_init_receive(sm); setup_dma_wss(dev, sm, 0); } else @@ -451,11 +452,7 @@ static int wss_open(struct device *dev, struct sm_state *sm) */ dma_init_receive(sm); dmasz = (NUM_FRAGMENTS + 1) * sm->dma.ifragsz; - if (sm->dma.i16bit) - dmasz <<= 1; u = NUM_FRAGMENTS * sm->dma.ofragsz; - if (sm->dma.o16bit) - u <<= 1; if (u > dmasz) dmasz = u; if (!(sm->dma.ibuf = sm->dma.obuf = kmalloc(dmasz, GFP_KERNEL | GFP_DMA))) diff --git a/drivers/net/soundmodem/smdma.h b/drivers/net/soundmodem/smdma.h index 27cea09e768c..44e457a7a170 100644 --- a/drivers/net/soundmodem/smdma.h +++ b/drivers/net/soundmodem/smdma.h @@ -37,6 +37,13 @@ #define DMA_MODE_AUTOINIT 0x10 #define NUM_FRAGMENTS 4 +/* + * NOTE: make sure that hdlcdrv_hdlcbuffer contains enough space + * for the modulator to fill the whole DMA buffer without underrun + * at the highest possible baud rate, otherwise the TX state machine will + * not work correctly. That is (9k6 FSK): HDLCDRV_HDLCBUFFER > 6*NUM_FRAGMENTS + */ + /* --------------------------------------------------------------------- */ /* * ===================== DMA buffer management =========================== diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 902d011dfa9d..d7e2fc621c8b 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -597,7 +597,7 @@ int isofs_bmap(struct inode * inode,int block) * If we are beyond the end of this file, don't give out any * blocks. */ - if( b_off >= inode->i_size ) + if( b_off > inode->i_size ) { off_t max_legal_read_offset; diff --git a/fs/proc/array.c b/fs/proc/array.c index 514adfdef032..000cc5e6a46f 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -28,6 +28,8 @@ * * Yves Arrouye : remove removal of trailing spaces in get_array. * + * + * Alan Cox : security fixes. a */ #include @@ -1056,6 +1058,28 @@ static int get_root_array(char * page, int type, char **start, off_t offset, int return -EBADF; } +static int process_unauthorized(int type, int pid) +{ + struct task_struct ** p = get_task(pid); + + if (!p || !*p || !(*p)->mm) + return 1; + + switch(type) + { + case PROC_PID_STATUS: + case PROC_PID_STATM: + case PROC_PID_STAT: + case PROC_PID_MAPS: + case PROC_PID_CMDLINE: + return 0; + } + if(current->fsuid == (*p)->euid) + return 0; + return 1; +} + + static int get_process_array(char * page, int pid, int type) { switch (type) { @@ -1103,6 +1127,13 @@ static int array_read(struct inode * inode, struct file * file,char * buf, int c type &= 0x0000ffff; start = NULL; dp = (struct proc_dir_entry *) inode->u.generic_ip; + + if (pid && process_unauthorized(type, pid)) + { + free_page(page); + return -EIO; + } + if (dp->get_info) length = dp->get_info((char *)page, &start, file->f_pos, count, 0); diff --git a/net/netsyms.c b/net/netsyms.c index f49a5112d085..6729ff135fe4 100644 --- a/net/netsyms.c +++ b/net/netsyms.c @@ -41,7 +41,7 @@ defined(CONFIG_EL2) || defined(CONFIG_NE2000) || \ defined(CONFIG_E2100) || defined(CONFIG_HPLAN_PLUS) || \ defined(CONFIG_HPLAN) || defined(CONFIG_AC3200) || \ - defined(CONFIG_ULTRA32) + defined(CONFIG_ULTRA32) || defined(CONFIG_NE2K_PCI) #include "../drivers/net/8390.h" #endif diff --git a/net/socket.c b/net/socket.c index ce40e9af4349..9225e10315f8 100644 --- a/net/socket.c +++ b/net/socket.c @@ -532,12 +532,6 @@ asmlinkage int sys_socket(int family, int type, int protocol) struct socket *sock; struct proto_ops *ops; - if(family==AF_PACKET) - { - family=AF_INET; - type=SOCK_PACKET; - } - /* Locate the correct protocol family. */ i = find_protocol_family(family);