1
0
mirror of https://github.com/sjlongland/adv950.git synced 2025-09-13 10:43:14 +10:00
adv950/advmknod
Stuart Longland 98f879a253
Initial check-in, Advantech ADV950 serial driver v3.33.
This is a check-in of the Advantech ADV950 serial driver, used with the
UNO-1150 series of industrial computers, as sourced from:

http://support.advantech.com/support/DownloadSRDetail_New.aspx?SR_ID=1-GLBRCD&Doc_Source=Download

This builds with kernel 3.0.1, but does not build with contemporary
kernels (i.e. ones that are still in support).

I suspect this is a hacked up version of Russel King's 8250 serial
driver from 2001.  First step, let's get it building against the current
kernel (v4.10.1) and then we'll look at integrating this into 8250
proper.
2017-03-05 10:29:50 +10:00

64 lines
1.3 KiB
Bash

#!/bin/sh
#
# Advantech IAG eAutomation PCI-954/16C950 device node utility
#
TTYNAME="$1"
MAJOR="$2"
TTYNUM="$3"
if [ "$1" = "" ] ; then
echo "Invalid TTYNAME"
exit 1
fi
if [ "$2" = "" ] ; then
echo "Invalid MAJOR number"
exit 2
fi
if [ "$3" = "" ] ; then
echo "Invalid tty number"
exit 3
fi
#echo "TTYNAME is $TTYNAME"
if [ $TTYNAME = "ttap" ] ; then
[ -d /dev/$TTYNAME ] && rm -rf /dev/$TTYNAME
mkdir /dev/$TTYNAME
fi
if [ $TTYNAME = "ttac" ] ; then
[ -d /dev/$TTYNAME ] && rm -rf /dev/$TTYNAME
mkdir /dev/$TTYNAME
fi
port=0
minor=0
while [ $port -lt $TTYNUM ]
do
mport=`expr $port`
if [ $TTYNAME = "ttap" ] ; then
#[ -d /dev/$TTYNAME ] && rm -rf /dev/$TTYNAME
#mkdir /dev/$TTYNAME
ttydev=/dev/$TTYNAME/$mport
fi
if [ $TTYNAME = "ttyAP" ] ; then
[ -c /dev/$TTYNAME$mport ] && rm -rf /dev/$TTYNAME$mport
ttydev=/dev/$TTYNAME$mport
fi
if [ $TTYNAME = "ttac" ] ; then
#[ -d /dev/$TTYNAME ] && rm -rf /dev/$TTYNAME
#mkdir /dev/$TTYNAME
ttydev=/dev/$TTYNAME/$mport
fi
if [ $TTYNAME = "ttyAC" ] ; then
[ -c /dev/$TTYNAME$mport ] && rm -rf /dev/$TTYNAME$mport
ttydev=/dev/$TTYNAME$mport
fi
mknod $ttydev c $MAJOR $minor
chmod a+wx $ttydev
port=`expr $port + 1`
minor=`expr $minor + 1`
done