#!/bin/sh

#
#	mkdevnods - a script to create the device nodes for the Stallion
#	            Linux driver.
#
#	Copyright (C) 1994,1995  Greg Ungerer (gerg@stallion.oz.au).
#
#	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.
#

#
#	Define the Stallion drivers major numbers. These are the driver
#	defaults, if you change them in the driver don't forget to change
#	them here too. These major device numbers allocated as per the
#	Linux Device Registery.
#
STL_SIOMEMMAJOR=28
STL_SERIALMAJOR=24
STL_CALLOUTMAJOR=25

MINOR=0

echo "Making Stallion driver device nodes"

#
#	Create all the device nodes for 4 boards.
#
echo -n "Stallion IO Memory Devices:"
for BRDNR in 0 1 2 3
do
	echo -n "."
	rm -f /dev/staliomem${BRDNR}
	mknod /dev/staliomem${BRDNR} c $STL_SIOMEMMAJOR $BRDNR
	chmod 600 /dev/staliomem${BRDNR}
done
echo

echo -n "Stallion port devices:"
MINOR=0
while [ $MINOR -le 255 ]
do
	echo -n "."
	rm -f /dev/ttyE${MINOR} /dev/cue${MINOR}
	mknod /dev/ttyE${MINOR} c $STL_SERIALMAJOR $MINOR
	mknod /dev/cue${MINOR} c $STL_CALLOUTMAJOR $MINOR
	#chgrp tty /dev/ttyE${MINOR}
	#chgrp uucp /dev/cue${MINOR}
	MINOR=`expr $MINOR + 1`
done
echo

exit 0
