Subject: Motorola SM56 Internal modem success report
From: Rok Hecl <kutulu@volja.net>
Date: Sat, 1 May 2004 12:44:28 +0200

OS: Linux Slackware 9.1 (2.4.22)
Modem: Motorolla SM56 Speakerphone PCI II
Driver: official Motorola package for rh9 + www.sm56.tk-gcc3 package

Installation (in Slackware): 
1. rpm2tgz  
2. install package with you favorite package manager (KPackage?)
3. uncompress sm56-gcc3.tar.gz (tar -zxvf sm...)
4. copy the install script from ./sm56-gcc3/sminst.sh to /usr/tmp (that's 
where the rpm defaults to)
5. edit the install script (or just copy this): (NOTE: this script was 
rewritten to suit my needs...)

	echo "Select A Country Code From The List"
	zcat ./country.dat
	echo -n "Enter Country Code (If Country Code does not Exists Just Enter): "
	read COUNTRYCODE
	grep "$COUNTRYCODE" sm56.4 >/dev/null
	if [ $? != 0 ]
	then	
		echo "Country Code Does not exists!!!"	
		COUNTRYCODE=1
		exit
	fi	
	if [ -z $COUNTRYCODE  ]
	then
		COUNTRYCODE=1
	fi
	if [ -d /lib/modules/`uname -r`/kernel/drivers/char ]; then
		mkdir -p /lib/modules/`uname -r`/kernel/drivers/char;
		echo "Writing Version.c"
	        echo "#define UTS_RELEASE \""`uname -r`"\"" >version.c
        	echo "const char __module_kernel_version[] 
__attribute__((section(\".modinfo\" ))) = \"kernel_version=
\"UTS_RELEASE;">>version.c
        	echo "#ifdef MODVERSIONS" >>version.c
        	echo "const char __module_using_checksums[] 
__attribute__((section(\".modinfo\"))) = \"using_checksums=1\";" >>version.c
        	echo "#endif">>version.c
		gcc -DLINUX -D__KERNEL__ -DMODULE -Wall -O -fomit-frame-pointer -o version.a 
-c version.c
		ld -r -o sm56.a  version.a sm56.lib
		ld -r -o sm56.o sm56.a wrp2.4.18.o 
		# the above line does the trick
		cp -fv ./sm56.o /lib/modules/`uname -r`/kernel/drivers/char/sm56.o;
	fi
	echo 'Creating device /dev/sm56...'
	if [ -e /dev/sm56 ]; then
		rm -f /dev/sm56
	fi
	mknod /dev/sm56 c 24 0
	if [ -e /dev/motomem ]; then
		rm -f /dev/motomem
	fi
	mknod /dev/motomem c 28 0
	chmod a+w /dev/motomem
	echo 'Pointing /dev/modem to /dev/sm56...'
	rm -f /dev/modem 2>/dev/null
	rm -f /dev/input/modem 2>/dev/null
	rm -f /dev/ttyS14 2>/dev/null
	ln -s /dev/sm56 /dev/modem
	ln -s /dev/sm56 /dev/input/modem
	ln -s /dev/sm56 /dev/ttyS14
	
	if [ -e /etc/modules.conf ]; then
	    MODFILE="/etc/modules.conf"
	else
	    MODFILE="/etc/conf.modules"
	fi
	echo "Adding SM56 to $MODFILE..."
	grep -v sm56 $MODFILE > /etc/modules.tmp
	grep -v ppp  /etc/modules.tmp >/etc/modules.temp
	mv -f /etc/modules.temp /etc/modules.tmp 2>/dev/null
	echo 'alias char-major-24 sm56' >> /etc/modules.tmp
	echo "options sm56 country=$COUNTRYCODE" >> /etc/modules.tmp
	echo "alias char-major-108 ppp_generic " >>/etc/modules.temp
	echo "alias /dev/ppp ppp_generic " >>/etc/modules.tmp
	echo "alias tty-ldisc-3 ppp_async " >>/etc/modules.tmp
	echo "alias tty-ldisc-14 ppp_synctty " >>/etc/modules.tmp
	echo "alias ppp-compress-21 bsd_comp " >>/etc/modules.tmp
	echo "alias ppp-compress-26 ppp_deflate " >>/etc/modules.tmp
	echo "alias ppp-compress-24 ppp_deflate " >>/etc/modules.tmp
	mv -f $MODFILE $MODFILE~
	mv -f /etc/modules.tmp $MODFILE
	insmod sm56 
	depmod -a
	echo ' '
	echo "Installing sm56 man file ....."
	cp ./sm56.4 /usr/share/man/man4
	echo "Self Cleaning ..... "
	rm *.a

	echo "Installation of SM56 Internal Modem completed."

6. remove any unneccessary files if you wish and try to query your modem
7. upon request I can upload a tarball containing the ingredients