From owner-freebsd-bugs Mon Feb 16 10:28:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA10216 for freebsd-bugs-outgoing; Mon, 16 Feb 1998 10:28:38 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from rocket.comtrol.com (rocket.comtrol.com [204.73.219.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id KAA10103 for ; Mon, 16 Feb 1998 10:28:31 -0800 (PST) (envelope-from steveg@comtrol.com) Received: from steveg.comtrol.com ([204.73.219.207]) by rocket.comtrol.com (8.6.9/8.6.9) with SMTP id MAA13598; Mon, 16 Feb 1998 12:27:52 -0600 Message-Id: <2.2.32.19980216182616.0069ed70@comtrol.com> X-Sender: steveg@comtrol.com X-Mailer: Windows Eudora Pro Version 2.2 (32) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Mon, 16 Feb 1998 12:26:16 -0600 To: freebsd-bugs@FreeBSD.ORG From: Steve Gericke Subject: freebsd snapshot 3.0 current: rp.c & makefile changes Cc: steveg@rocket.comtrol.com, stevee@rocket.comtrol.com Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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 count = unit * 32; /* board times max ports per card SG */ 1226,1228c1224 < count = 0; < for(i=0;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 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 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 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 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 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 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 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 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 /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