Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Feb 1998 12:26:16 -0600
From:      Steve Gericke <steveg@comtrol.com>
To:        freebsd-bugs@FreeBSD.ORG
Cc:        steveg@rocket.comtrol.com, stevee@rocket.comtrol.com
Subject:   freebsd snapshot 3.0 current: rp.c & makefile changes
Message-ID:  <2.2.32.19980216182616.0069ed70@comtrol.com>

next in thread | raw e-mail | index | archive | help
Hello FreeBSD:
  I problem was reported to me that our Comtrol's RocketPort product only
  supports 32 ports.  I have found this to be true and have changed pre
FreeBSD 3.0
  to correct this.

  I have also made changes to our FreeBSD 3.0 code to reflect this. Our product
  now supports up to 128 RocketPort ports with 4 controller cards.

  1. I have include the diff for rp.c that is needed.  The rp.c I took off
     of the 3.0 current dated 2/9/98 (size 55391)

1110,1112c1110
< 	count = 0;
< 	for(i=0;i<unit;i++)
< 		count += rp_num_ports[i];
---
> 	count = unit * 32;      /* board times max ports per card SG */
1226,1228c1224
< 	count = 0;
< 	for(i=0;i<unit;i++)
< 		count += rp_num_ports[i];
---
> 	count = unit * 32;    /* board # times max ports per card  SG */
1309c1305
< 	int	unit, i, port, mynor, flags;
---
> 	int	unit, i, port, mynor, umynor, flags;  /* SG */
1314c1310,1313
< 	mynor = MINOR_MAGIC(dev);
---
> 
>    umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
> 	port  = (minor(dev) & 0x1f);                /* SG */
> 	mynor = (port + umynor);                    /* SG */
1318,1320d1316
< 	port = mynor;
< 	for(i=0;i<unit;i++)
< 		port -= rp_num_ports[i];
1458c1454
< 	int	oldspl, unit, mynor, port, status, i;
---
> 	int	oldspl, unit, mynor, umynor, port, status, i; /* SG */
1463,1466c1459,1463
< 	mynor = MINOR_MAGIC(dev);
< 	unit = 0;
< 	unit = minor_to_unit[mynor];
< 	port = mynor;
---
>    umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
> 	port  = (minor(dev) & 0x1f);                /* SG */
> 	mynor = (port + umynor);                    /* SG */
>    unit = minor_to_unit[mynor];                /* SG */
> 
1469,1470d1465
< 	for(i=0;i<unit;i++)
< 		port -= rp_num_ports[i];
1534c1529,1534
< 	int	unit, i, mynor, port, error = 0;
---
> 	int	unit, i, mynor, umynor, port, error = 0; /* SG */
> 
>    umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
> 	port  = (minor(dev) & 0x1f);                /* SG */
> 	mynor = (port + umynor);                    /* SG */
>    unit = minor_to_unit[mynor];                /* SG */
1536d1535
< 	mynor = MINOR_MAGIC(dev);
1539,1543d1537
< 	unit = 0;
< 	unit = minor_to_unit[mynor];
< 	port = mynor;
< 	for(i=0;i<unit;i++)
< 		port -= rp_num_ports[i];
1559c1553,1558
< 	int	unit, i, mynor, port, error = 0;
---
> 	int	unit, i, mynor, port, umynor, error = 0; /* SG */
> 
>    umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
> 	port  = (minor(dev) & 0x1f);                /* SG */
> 	mynor = (port + umynor);                    /* SG */
>    unit = minor_to_unit[mynor];                /* SG */
1561d1559
< 	mynor = MINOR_MAGIC(dev);
1564,1568d1561
< 	unit = 0;
< 	unit = minor_to_unit[mynor];
< 	port = mynor;
< 	for(i=0;i<unit;i++)
< 		port -= rp_num_ports[i];
1604c1597
< 	int	unit, mynor, port;
---
> 	int	unit, mynor, port, umynor;            /* SG */
1612c1605,1607
< 	mynor = MINOR_MAGIC(dev);
---
>    umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
> 	port  = (minor(dev) & 0x1f);                /* SG */
> 	mynor = (port + umynor);                    /* SG */
1614,1616d1608
< 	port = mynor;
< 	for(i=0;i<unit;i++)
< 		port -= rp_num_ports[i];
1816c1808
< 	int	unit, i, mynor, port;
---
> 	int	unit, i, mynor, port, umynor;               /* SG */
1820c1812,1816
< 	mynor = MINOR_MAGIC(tp->t_dev);
---
> 
>    umynor = (((minor(tp->t_dev) >> 16) -1) * 32);    /* SG */
> 	port  = (minor(tp->t_dev) & 0x1f);                /* SG */
> 	mynor = (port + umynor);                          /* SG */
> 
1822,1824d1817
< 	port = mynor;
< 	for(i=0;i<unit;i++)
< 		port -= rp_num_ports[i];
1953c1946
< 	int	unit, i, mynor, port;
---
> 	int	unit, i, mynor, port, umynor;               /* SG */
1958c1951,1954
< 	mynor = MINOR_MAGIC(tp->t_dev);
---
> 
>    umynor = (((minor(tp->t_dev) >> 16) -1) * 32);    /* SG */
> 	port  = (minor(tp->t_dev) & 0x1f);                /* SG */
> 	mynor = (port + umynor);                          /* SG */
1960,1962d1955
< 	port = mynor;
< 	for(i=0;i<unit;i++)
< 		port -= rp_num_ports[i];
2014c2007
< 	int	unit, mynor, port;
---
> 	int	unit, mynor, port, umynor;                  /* SG */
2019c2012,2014
< 	mynor = MINOR_MAGIC(tp->t_dev);
---
>    umynor = (((minor(tp->t_dev) >> 16) -1) * 32);    /* SG */
> 	port  = (minor(tp->t_dev) & 0x1f);                /* SG */
> 	mynor = (port + umynor);                          /* SG */
2021,2023d2015
< 	port = mynor;
< 	for(i=0;i<unit;i++)
< 		port -= rp_num_ports[i];
2056c2048,2053
< 	int	unit, i, port, mynor;
---
> 	int	unit, i, port, mynor, umynor;         /* SG */
> 
>    umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
> 	port  = (minor(dev) & 0x1f);                /* SG */
> 	mynor = (port + umynor);                    /* SG */
>    unit = minor_to_unit[mynor];                /* SG */
2058d2054
< 	mynor = MINOR_MAGIC(dev);
2061,2064d2056
< 	unit = minor_to_unit[mynor];
< 	port = mynor;
< 	for(i=0;i<unit;i++)
< 		port -= rp_num_ports[i];


  2.  I have changed the MAKEDEV file for ttyR and cuaR.
      The following code is a replacement:

# Rocketport multiport serial card.
# Creates devices for all cards at one time.
#
ttyR?)
	major=81
	BOARD=1; MINOR=65536; Rnum=0
	MINOR=`expr $BOARD \* 65536`
	dmesg | grep ^RocketPort[0-4] > /tmp/rp_list
	controllers=`awk '{print $1}' < /tmp/rp_list`
	rm -f /dev/ttyR*; rm -f /dev/ttyiR*; rm -f /dev/ttylR*
	for i in $controllers;do
 	   ndevices=`grep ^$i /tmp/rp_list | sed -e 's/.* \([0-9]*\) ports/\1/'`
	   echo -n "Creating $ndevices devices for $i: "
	   for dev in `jot $ndevices 0`;do
		   mknod /dev/ttyR$Rnum c $major $MINOR 
		   mknod /dev/ttylR$Rnum c $major `expr $MINOR + 32`
		   mknod /dev/ttyiR$Rnum c $major `expr $MINOR + 64` 
		   Rnum=`expr $Rnum + 1`
		   MINOR=`expr $MINOR + 1`
	   done
		BOARD=`expr $BOARD + 1`
		MINOR=`expr $BOARD \* 65536`
	   echo " "
	done
	chown root.wheel /dev/ttyR*
   ls /dev/ttyR*
	;;

cuaR?)
	major=81
	BOARD=1; MINOR=65536; Rnum=0
	MINOR=`expr $BOARD \* 65536`
	dmesg | grep ^RocketPort[0-4] > /tmp/rp_list
	controllers=`awk '{print $1}' < /tmp/rp_list`
	rm -f /dev/cuaR*; rm -f /dev/cuaiR*; rm -f /dev/cualR*
	for i in $controllers;do
 	   ndevices=`grep ^$i /tmp/rp_list | sed -e 's/.* \([0-9]*\) ports/\1/'`
	   echo -n "Creating $ndevices devices for $i: "
	   for dev in `jot $ndevices 0`;do
		   mknod /dev/cuaR$Rnum c  $major `expr $MINOR + 128`
		   mknod /dev/cualR$Rnum c $major `expr $MINOR + 128 + 32`
		   mknod /dev/cuaiR$Rnum c $major `expr $MINOR + 128 + 64` 
		   Rnum=`expr $Rnum + 1`
		   MINOR=`expr $MINOR + 1`
	   done
		BOARD=`expr $BOARD + 1`
		MINOR=`expr $BOARD \* 65536`
	   echo " "
	done
	chown uucp.dialer /dev/cuaR*
   ls /dev/cuaR*
	umask 77
	;;


I have tested these changes with up to 4 RocketPort cards PCI and ISA.

If you need any follow up help pleae contact me at:  steveg@comtrol.com


Thanks for all of your help  !!!



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2.2.32.19980216182616.0069ed70>