PREREQUISITES

HOPE
----------------------------------------------
This kit will  provide support for many
modems with Lucent chipsets, under a variety
of modem brand names. Much usefull information is at:
http://walbran.org/sean/linux/linmodem-howto-all.html
http://www.linmodems.org wherefrom there can be 
accessed the List: discuss@linmodems.org

Hopeless
--------------------------------------------------------
This kit will FAIL to support currently known winmodems 
with chipsets produced by 
  Conexant ( with former Rockwell technology)
  Motorola ( is still developing a driver for Linux)
  US Robotics ( has not as yet announced intentions)
  Recent (1200 series) IBM Thinkpads contain
an Agere (nee Lucent) soft modem which is not supported
by this driver; it is apparently possible to indentify it
by an "Intel" manufacturer ID in the output of the
(see below) command
#	 lspci-vv


For Returnees
-----------------------------------------------------
If the previous D version kit worked for you,
it is OK to just do it again. Browse CREDITS.TXT
for a quick update, with more details in the inner kit.
BEWARE, that the inner kit is overwritten with each use
of the commands below. Thus copy any working notes out

With version matching to your current kernel,
a symbolic link is needed:
       /usr/src/linux --> /kernel-headers/
or alternatively if kernel sources are installed 
       /usr/src/linux --> /kernel-sources/
in which  "make dep" has already been done
to build the kernel headers.  Verify the headers version
by the first line in the output from:
#	 cat /usr/src/linux/include/linux/version.h
   #define UTS_RELEASE "2.4.1"
That is my kernel-headers are version 2.4.1

The command:
#     ./build_module
replaces the former D kit ltmodem.o compile.

For installations with rpm package managers
it is preferable to:
#    rpm --initdb (if not already done)
#    ./build_rpm
and follow through.  Thus standard registration of the ltmodem
package is provided for.
However because of kernel-source nomenclature used by Suse
build_rpm may fail.  The  build_module is the fallback.

Copy out the CAPITALIZED text files from the inner folder
for some more details.  If you run build_rpm, 
they will be installed in the usual DOC tree. 

Report problems through: discuss@linmodems.org
Send bug fixes  through: discuss@linmodems.org
Gratitude too,  through: discuss@linmodems.org


First time users
-----------------------------------------------------
If your PC is now under a DOS or Microsoft Windows
operating system, STOP !!!
Scripts (action files) herein are corrupted by DOSsy stops.
Reboot your PC under Linux.  Copy the kit into a Linux
workspace, say within /root or some /home/User folder.
     tar zxvf ltmodem-5.78e.tar.gz
opens it. Move in with:
     cd ltmodem-5.78e/

Use your favorite viewer to continue into this   1ST-READ.
Apologies for being a bit pedantic herein. But the
guidance below incorporates LESSONS LEARNED with the
predecessor "D" kit. The more experienced Linux users
did FINE without this Lengthy blurb. 
BUT  discuss@linmodems.org   was kept too busy dealing with 
simpler issues/errors, while there are some still
outstanding compatibiity issues needing attention.
Read CREDITS.TXT for a quick summary.

Most of this long file can be SKIPped through. Some large
sections are merely records of the few command outputs.
While you are reading further, as Root do freshen
your locate database in the background ( the &) with:
#	updatedb &

The kit contains specific ltmodem "driver" code, to be
combining with external resources, producing a "ltmodem.o"
matched with your current kernel version. Your acting kernel
version is displayed by:
#	uname -r
First the external resources must be arranged and checked.
Examples of expected diagnostic responses are given below.
Your's will differ somewhat, depending upon version
differences in utilities and hardware.  There is NO use in
unpacking further prior to a few hardware and resource
checks.

Checks for modem identity
--------------------------------------------------------
Hopefully there is a documentation assuring you that your
modem is of the Lucent chipset variety.  If you are 
guessing/hoping, there are some effective diagnostic tests
for the PCI class of hardware, including some modems. The supporting
software is quite likely present as part of a "pcituils" installation package.
Diagnostics replies including "Lucent" or "Xircom" may be returned by:
#	lspci -v
00:0a.0 Communication controller: Lucent Microelectronics 56k WinModem (rev 01)
        Subsystem: Lucent Microelectronics LT WinModem 56k Data+Fax+Voice+Dsvd
        Flags: bus master, medium devsel, latency 0, IRQ 12
        Memory at da800000 (32-bit, non-prefetchable) [size=256]
        I/O ports at b800 [size=8]
        I/O ports at b400 [size=256]
        Capabilities: [f8] Power Management version 2  

Note the lead designation like " 00:0a.0 ".
Next look for the information block beginning with  00:0a.0 ,
when querying again with:
#	lspci -nv
00:0a.0 Class 0780: 11c1:0440 (rev 01)
        Subsystem: 11c1:0440
        Flags: bus master, medium devsel, latency 0, IRQ 12
        Memory at da800000 (32-bit, non-prefetchable) [size=256]
        I/O ports at b800 [size=8]
        I/O ports at b400 [size=256]
        Capabilities: [f8] Power Management version 2  
 
The modems known to be supported by the ltmodem.o driver have
ID number pairs shown in the following Table. Ignore the leading 0x. 
The id pair          11c1:0440 
is within the range: 11c1:0440-045c
and hence should be supported by ltmodem.o.

Name 		vendor_id	device id range
-----------------------------------------------
LUCENT		0x11c1		0x0440-0x045c	
XIRCOM		0x115d		0x0000-0x000F	
XIRCOM		0x115d		0x0440-0x045c	
XIRCOM  	0x115d          0x0010-0x03ff  some/all? ids	

This information indicates that my  modem has the Lucent
DSP (digital sound processing) chipset and predicts that
a driver compiled with this kit should serve well.
SKIP to the section "Utilities Versions".
 	
However there are ISA type Lucent modems, such as
that in some Compaq 1500 series (and many other) laptops,
which will not in general provide such explicit information. 

While under a 2.2.nn kernel, there is a test that can be done.
The ltmodem568.o here included is the driver version 5.68.
It the first Linux ltmodem driver compiled with 2.2.2
kernel sources. If it can be "inserted" into a 2.2.nn kernel,
your modem hardware will be better supported by newer
versions compiled with this kit.

To do this test, display your currently loaded modules as
Root with:
#	lsmod
To minimize potential conflicts remove non-essential modules
with sequential:
#	rmmod ModuleName
Check with:
#	lsmod
Pcmcia support can be shut down with:
#	/etc/init.d/pcmcia stop
Finally test a forced ( -f ) insertion with:
#	insmod -f ltmodem568.o
which will be accompanied by version mismatch complaints.
If ltmodem568 is displayed by:
#	lsmod
Module                  Size  Used by
ltmodem               360912   0  (unused)
the drivers of this kit will almost certainly serve you too.
So:
#	rmmod ltmodem586
SKIP down to the section: Utilities Versions.

If insertion failed, read up on identifying modem hardware
at: http://walbran.org/sean/linux/linmodem-howto-all.html,
Note that a success in compiling the driver is 
NOT at all diagnostic. The compiling itself 
has no dependence at all on your modem hardware.

Utilities Versions.
---------------------------------------------------------
If you are using a 2.2.nn version kernel, SKIPping this
section is OK on your first trial. SKIP down to section:
  REQUIRED kernel-headers or kernel-source
But read and check carefully if you encounter problems, 
or will use a 2.4.nn series kernel.

The version requirements table below are for kernel-version
2.2.16 or lower, but should suffice through the 2.2.nn kernels:

Utility    lowest Version suggested    version test
+++++++++++++++++++++++++++++++++++++++++++++++++
Kernel modutils        2.1.121    ; insmod -V
Gnu C                  2.7.2.3    ; gcc --version
Gnu make               3.79.1     ; make --version
Binutils               2.8.1.0.23 ; ld -v
patch                  2.54       ; patch --version
Linux libc6 C Library  2.0.7pre6  ; ls -l /lib/libc*
Dynamic Linker (ld.so) 1.9.9      ; ldd --version
Linux C++ Library      2.7.2.8    ; ls -l /usr/lib/libg++.so.*
Procps                 2.0.3      ; ps --version
Psmisc                 17         ; pstree -V
Net-tools              1.52       ; hostname -Vld
Sh-utils               1.16       ; basename --v
Bash                   1.14.7     ; bash -version
PPP                    2.3.10     ; pppd --version
Util-linux             2.9z       ; mkfs --version
Pcmcia-cs              3.0.14     ; cardmgr -V
    The last is needed only for pcmcia card modems.

To compile under kernel 2.4.0 version sources,
the following additional requirements are recommended:
Gnu C                  2.91.66    # gcc --version
Gnu make               3.77       # make --version
binutils               2.9.1.0.25 # ld -v
patch                  2.5        # patch --version
util-linux             2.10o      # mkfs --version
modutils               2.4.0      # insmod -V
e2fsprogs              1.19       # tune2fs --version
pcmcia-cs              3.1.21     # cardmgr -V
PPP                    2.3.11     # pppd --version

REQUIRED kernel-headers or kernel-sources
----------------------------------------------------
The easiest and smallest satisfactory resource is a
kernel-header package with download size of about 1.5 Mb.
Its version must match that of the your current kernel 
as displayed by:
#	uname -r
if you choose this route, get the package  from your install CD 
or download from your distributions Linux repository. 
Install it with whatever tools your distribution provides.  
The common installation folder is:
   /usr/src/kernel-headers-version#/
a symbolic link is necessary, made with:
  ln -s /usr/src/kernel-headers-version /usr/src/linux
Test with:
#	 cat /usr/src/linux/include/linux/version.h
for which the 2.4.1 below is the version of the headers:
#define UTS_RELEASE "2.4.1"
#define LINUX_VERSION_CODE 132097
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

To display all the headers:
#       ls /usr/src/linux/include/linux
802_11.h           fd1772.h                loop.h
a.out.h            fddidevice.h            lp.h  
ac97_codec.h       fdreg.h                 lvm.h 
acct.h             file.h                  major.h
acpi.h             filter.h                malloc.h
adb.h              fs.h                    matroxfb.h
adb_mouse.h        fs_struct.h             mc146818rtc.h
and MANY more.  
Some will compiled with the modem specific codes in this packages
SKIP to FINALLY

For the More Experienced planning to compile kernels, the
sources download size will be some 15 Mb. 
Be sure that your Linux PC installation includes files needed
for Intel processors and similar PC processors: 	
	/usr/bin/nm86
	/usr/bin/size86
	/usr/bin/objdump86
which are commonly part of bin86 package of Linux distibutors.

After installation of the sources folder somewhere, set the
following MANDATORY symbolic link as Root, and with the
text on one line:
#	ln -sf /PATHtoFolderWith/kernel-sources-version/
		/usr/src/linux
This linkage is Necessary both for compiling ltmodem.o
through its own Makefile, and for compiling custom kernels.
Check with:
#	 ls -l /usr/src/linux
lrwxrwxrwx    1 root   src   17 Jan 25 21:24 /usr/src/linux
-> /Some//Folder/linux-2.2.16 and further with:
# 	ls  /usr/src/linux
COPYING        Makefile        arch     include  lib      scripts
CREDITS        README          debian   init     mm       stamp-configure
Documentation  REPORTING-BUGS  drivers  ipc      modules  stamp-debian
MAINTAINERS    Rules.make      fs       kernel   net      stamp-image
(ignore my Debian specific: stamp-* and debian files.)

If you have not yet run a configuration, the command:
#	ls /usr/src/linux/include/linux
will NOT yet return a Monster list of *.h header files.
These are produced after a few steps. Move to the sources
folder:
#	cd /usr/src/linux
Clean up of old debris:
#	make clean
Please check that building of modversions.h is enabled:
# 	grep MODVERSIONS /usr/src/linux/.config
should output:
		CONFIG_MODVERSIONS=y
If not, set up the configuration appropriate to your PC
within /usr/src/linux, with:
#	make menuconfig OR make xconfig
Lastly, get some coffee, while setting the dependencies
which build the header files:
#	make dep
When "make dep" is completed, double check the persion 
per above with:
#	cat /usr/src/linux/include/linux/version.h


FINALLY
----------------------------------------------------
WITHOUT opening the inner ltmodem-5.78e.tar.gz
     ./build_module
will compile a ltmodem.o  matching your current kernel, and
    ./ltinst
will install it, and further prepare your system.

Report problems through: discuss@linmodems.org
Send bug fixes  through: discuss@linmodems.org
Gratitude too,  through: discuss@linmodems.org   


Example
------------------------------------------------------
The output of ./build_module should be like:

# ./build_module
cp -f linuxif.h linuxif-2.4.h
cp -f ltmodem.c ltmodem-2.4.c
patch -N -b -p0 < ltmodem-2.4.patch
patching file `linuxif-2.4.h'
patching file `ltmodem-2.4.c'
cp -f serial.c.240 serial-lt-2.4.c
patch -N -b -p0 < serial-2.4.patch
patching file `serial-lt-2.4.c'
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586 -DMODULE -DLT_VERSION=5.78e  -c -o serial-lt-2.4.a serial-lt-2.4.c
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586 -DMODULE -DLT_VERSION=5.78e  -c -o ltmodem-2.4.a ltmodem-2.4.c
objcopy --redefine-sym=rs_interrupt_single=rs_interrupt_lucent ltmdmobj.o ltmdmobj.a
ld -r -o ltmodem.o serial-lt-2.4.a ltmodem-2.4.a  ltmdmobj.a 
run ltinst to install the ltmodem driver 

If run a second time, there will be a few additional harmless lines:  

ln: ./ltmodem.o: File exists
ln: ./ltinst: File exists
ln: ./ltuninst: File exists 


Failure signature
---------------------------------------------------------
The most common cause of ./build_module failure is incorrect
establishment of the symbolic link:  /usr/src/linux-> . This
will result in 100s of lines with "warning:"
like those below. Double check your
kernel-header/sources resources per instructions above:
========================
T# ./build_module
cp -f linuxif.h linuxif-2.4.h
cp -f ltmodem.c ltmodem-2.4.c
patch -N -b -p0 < ltmodem-2.4.patch
patching file `linuxif-2.4.h'
patching file `ltmodem-2.4.c'
cp -f serial.c.240 serial-lt-2.4.c
patch -N -b -p0 < serial-2.4.patch
patching file `serial-lt-2.4.c'
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -fomit-
frame-pointer -fno-strict-aliasing -pipe -fno-strength-reduce -m486 -malign-loo
ps=2 -malign-jumps=2 -malign-functions=2 -DCPU=586 -DMODULE -DLT_VERSION=5.78e
  -c -o serial-lt-2.4.a serial-lt-2.4.c
In file included from /usr/include/linux/signal.h:4,
                 from serial-lt-2.4.c:184:
/usr/include/asm/signal.h:174: parse error before `size_t'
/usr/include/asm/signal.h:174: warning: no semicolon at end of struct or union
/usr/include/asm/signal.h:175: warning: data definition has no type or storage
class
In file included from /usr/include/linux/signal.h:5,
                 from serial-lt-2.4.c:184:
/usr/include/asm/siginfo.h:26: parse error before `pid_t'
/usr/include/asm/siginfo.h:26: warning: no semicolon at end of struct or union
/usr/include/asm/siginfo.h:26: warning: no semicolon at end of struct or union
AND MUCH MORE


Install the ltmodem.o module
-----------------------------------------------------
Some details below will vary with your Linux installation
and kernel version.  It can be rerun for fun without harm.
With 5-10 second pauses between sections.
#	./ltinst
The report will be something like:

  This ./ltinst command should be executed only by Root.
  Your login name is: root.
  Please stop any current PPP session.
  Abort if necessary with: Ctrl-C
  
	
	Made /dev/ttyLT0 and two symbolic links:
crw-rw-rw-    1 root     uucp      62,  64 Feb  6 21:20 /dev/ttyLT0
lrwxrwxrwx    1 root     root           11 Feb  6 21:20 /dev/modem -> /dev/ttyLT0
lrwxrwxrwx    1 root     root           11 Feb  6 21:20 /dev/ttyS14 -> /dev/ttyLT0
	to support dialup configuration utilities.

     Copying ltmodem.o into the modules tree.  	
	The current kernel version is: 2.4.0
	Within the modules path: /lib/modules/2.4.0/ ,ltmodem.o should now be displayed:
-rw-r--r--    1 root     root       425814 Feb  6 21:20 ltmodem.o
	
  Modules dependencies have been updated.
  Demand loading is enabled by:
alias char-major-62 ltmodem
  within /etc/modules.conf
  
  Preparing for ltmodem.o insertion test
  Removing any currently inserted module: ltmodem
  
  The ltmodem with any dependent modules should now be displayed by the test:
  modprobe ltmodem
  ltmodem               360888   0  (unused) 

  A reserve ltmodem.o backup is being copied out:
  Current reserve copies are:
../ltmodem.o_2.4.0
  
	Installation of ltmodem support is now completed.
	But to enable dialout, Editing /dev/ttyLT0 into a dialout script
	may be necessary. For ppp initated by pon, it would be among:
/etc/ppp/peers/provider:/dev/ttyLT0       #pppconfig_dev
/etc/ppp/peers/provider~:/dev/ttyS1    #pppconfig_dev
  
   ===================== End ./ltinst, ENJOY ==============================





Build_rpm
------------------------------------------------------
The ./build_modules followed by ./ltinst will (except for
dial up scripts ) will make your modem installation
functional. Once you have confirmed functionality, a final
step is to properly register the software, to gaurantee easy
upgrade and/or removal with your particular Linux
distributions package management tools.  For distributions
using a rpm package maintenance system.  This is aided  by
the command:

#   ./build_rpm
which if System requirements are met, will output a
    ltmodem-2.4.0-5.78e-1.i386.rpm
The whole installation will then be redone with the command
#  rpm -i ltmodem-2.4.0-5.78e-1.i386.rpm  
but this time, WITH Proper Registration of the package.

Below is what the report of a: 
# ./build_rpm
Build an rpm for ltmodem
Executing: %prep
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD
+ rm -rf ltmodem-5.78e
+ /bin/gzip -dc /root/ltmodem-5.78e/ltmodem-5.78e.tar.gz
+ tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd ltmodem-5.78e
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chown -Rhf root .
++ /usr/bin/id -u
+ '[' 0 = 0 ']'
+ /bin/chgrp -Rhf root .
+ /bin/chmod -Rf a+rX,g-w,o-w .
+ exit 0
Executing: %build
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd ltmodem-5.78e
+ make
make: Nothing to be done for `all'.
+ exit 0
Executing: %install
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd ltmodem-5.78e
+ rm -rf /var/tmp/ltmodem-root
+ mkdir -p /var/tmp/ltmodem-root/lib/modules/2.4.0/kernel/drivers/char
+ cp ltmodem.o /var/tmp/ltmodem-root/lib/modules/2.4.0/kernel/drivers/char
+ exit 0
Processing files: ltmodem-2.4.0-5.78e-1
Executing: %doc
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd ltmodem-5.78e
+ DOCDIR=/var/tmp/ltmodem-root/usr/doc/ltmodem-2.4.0-5.78e
+ export DOCDIR
+ rm -rf /var/tmp/ltmodem-root/usr/doc/ltmodem-2.4.0-5.78e
+ /bin/mkdir -p /var/tmp/ltmodem-root/usr/doc/ltmodem-2.4.0-5.78e
+ cp -pr README COMPLAINTS MAKE-RECORD XIRCOM-FIX CONFIG LTMODEM_PCI_IDS 1ST-READ CREDITS PCI-ID-TESTS RPM-HOW UPDATES-BUGS /var/tmp/ltmodem-root/usr/doc/ltmodem-2.4.0-5.78e
+ exit 0
Finding  Provides: (using /usr/lib/rpm/find-provides)...
Finding  Requires: (using /usr/lib/rpm/find-requires)...
warning: Could not canonicalize hostname: stodolsk
PreReq: /bin/sh
Requires: kernel = 2.4.0 kernel-headers = 2.4.0
Wrote: /usr/src/redhat/SRPMS/ltmodem-5.78e-1.src.rpm
Wrote: /usr/src/redhat/RPMS/i386/ltmodem-2.4.0-5.78e-1.i386.rpm
Executing: %clean
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd ltmodem-5.78e
+ rm -rf /var/tmp/ltmodem-root
+ exit 0
Executing: --clean
+ umask 022
+ cd /usr/src/redhat/BUILD
+ rm -rf ltmodem-5.78e
+ exit 0
 
Install the generated rpm with the command
 
rpm -i ltmodem-2.4.0-5.78e-1.i386.rpm  







