From nobody  Tue Jun 23 06:58:47 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id GAA16625;
          Tue, 23 Jun 1998 06:58:47 -0700 (PDT)
          (envelope-from nobody)
Message-Id: <199806231358.GAA16625@hub.freebsd.org>
Date: Tue, 23 Jun 1998 06:58:47 -0700 (PDT)
From: steveg@comtrol.com
To: freebsd-gnats-submit@freebsd.org
Subject: Our RocketPort port does not support DEVFS file system on FreeBSD 3.0 current
X-Send-Pr-Version: www-1.0

>Number:         7031
>Category:       i386
>Synopsis:       Our RocketPort port does not support DEVFS file system on FreeBSD 3.0 current
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 23 07:00:01 PDT 1998
>Closed-Date:    Mon Mar 12 16:21:06 PST 2001
>Last-Modified:  Mon Mar 12 16:21:54 PST 2001
>Originator:     steve gericke
>Release:        3.0 current
>Organization:
Comtrol
>Environment:
FreeBSD steveg1.comtrol.com 3.0 CURRENT ...#316 Sun May 21 12:49:12 CDT 2000
>Description:
COmtrol's RocketPort driver does not provide support for DEVFS file
  system.
>How-To-Repeat:
On /sys/i386/conf/LOCAL config add DEVFS define .
  After installing RocketPort (rp) driver, no /dev/ttyR* defines
  would be present.
>Fix:
Added RocketPort support for DEVFS file system.
  used diff -U 2 to show changes.
  Tested with DEVFS defined for ttyR* and cuaR* devices and
   well as standard device defines using MAKEDEV.
changes to rp.c are :

--- rpc612.c	Mon Jun 22 15:00:42 1998
+++ rpcorig.c	Mon Jun 22 15:00:53 1998
@@ -36,5 +36,4 @@
 
 #include "opt_compat.h"
-#include "opt_devfs.h"
 
 #include <sys/param.h>
@@ -47,8 +46,4 @@
 #include <sys/kernel.h>
 
-#if DEVFS
-#include <sys/devfsext.h>
-#endif DEVFS
-
 #include <i386/isa/isa_device.h>
 
@@ -817,7 +812,4 @@
 static int	ndevs = 0;
 static int	minor_to_unit[128];
-#ifdef DEVFS
-static int	mtou_count = 0;
-#endif DEVFS
 static	struct	tty	rp_tty[128];
 
@@ -1020,5 +1012,4 @@
 
 	vendor_id = type & 0xffff;
-   /* PCI vendor_id=0x11fe for Comtrol's RocketPort cards      */
 	switch(vendor_id)
 	case 0x11fe:
@@ -1113,5 +1104,5 @@
 		malloc(sizeof(struct rp_port) * num_ports, M_TTYS, M_NOWAIT);
 	if(rp == 0) {
-		printf("rp_pciattach: Could not malloc rp_ports structures\n");
+		printf("rp_attach: Could not malloc rp_ports structures\n");
 		return;
 	}
@@ -1119,7 +1110,5 @@
 	count = unit * 32;      /* board times max ports per card SG */
 	for(i=count;i < (count + rp_num_ports[unit]);i++)
-   {
 		minor_to_unit[i] = unit;
-   }
 
 	bzero(rp, sizeof(struct rp_port) * num_ports);
@@ -1127,5 +1116,5 @@
 		malloc(sizeof(struct tty) * num_ports, M_TTYS, M_NOWAIT);
 	if(tty == 0) {
-		printf("rp_pciattach: Could not malloc tty structures\n");
+		printf("rp_attach: Could not malloc tty structures\n");
 		return;
 	}
@@ -1176,32 +1165,13 @@
 			line = (unit << 5) | (aiop << 3) | chan;
 			rp_table(line) = rp;
-
-#ifdef DEVFS
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000), DV_CHR, UID_ROOT, 
-            GID_WHEEL, 0600, "ttyR%d", (mtou_count + port));
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CONTROL_INIT_STATE, DV_CHR, UID_ROOT,
-            GID_WHEEL, 0600, "ttyiR%d", (mtou_count + port));
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CONTROL_LOCK_STATE, DV_CHR, UID_ROOT,
-            GID_WHEEL, 0600, "ttylR%d", (mtou_count + port));
+/*			devfs_add_devswf(&rp_cdevsw,
+				port, DV_CHR, UID_ROOT, GID_WHEEL, 0600,
+				"ttyR%n", port);
 			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CALLOUT_MASK, DV_CHR, UID_UUCP, 
-            GID_DIALER, 0660, "cuaR%d", (mtou_count + port));
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CALLOUT_MASK | CONTROL_INIT_STATE,
-				DV_CHR, UID_UUCP, GID_DIALER, 0660, "cuaiR%d", 
-				(mtou_count + port));
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CALLOUT_MASK | CONTROL_INIT_STATE, 
-   			DV_CHR, UID_UUCP, GID_DIALER, 0660, "cualR%d", 
-				(mtou_count + port));
-#endif DEVFS
+				port | CONTROL_INIT_STATE, DV_CHR, UID_ROOT,
+				GID_WHEEL, 0600, "ttyRi%n", port);
+*/
 		}
 	}
-#ifdef DEVFS
-		mtou_count = mtou_count+port;
-#endif DEVFS
 }
 
@@ -1248,5 +1218,5 @@
 		malloc(sizeof(struct rp_port) * num_ports, M_TTYS, M_NOWAIT);
 	if(rp == 0) {
-		printf("rpattach: Could not malloc rp_ports structures\n");
+		printf("rp_attach: Could not malloc rp_ports structures\n");
 		return(0);
 	}
@@ -1254,7 +1224,5 @@
 	count = unit * 32;    /* board # times max ports per card  SG */
 	for(i=count;i < (count + rp_num_ports[unit]);i++)
-   {
 		minor_to_unit[i] = unit;
-   }
 
 	bzero(rp, sizeof(struct rp_port) * num_ports);
@@ -1262,5 +1230,5 @@
 		malloc(sizeof(struct tty) * num_ports, M_TTYS, M_NOWAIT);
 	if(tty == 0) {
-		printf("rpattach: Could not malloc tty structures\n");
+		printf("rp_attach: Could not malloc tty structures\n");
 		return(0);
 	}
@@ -1311,28 +1279,7 @@
 			line = (unit << 5) | (aiop << 3) | chan;
 			rp_table(line) = rp;
-
-#ifdef DEVFS
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000), DV_CHR, UID_ROOT, 
-            GID_WHEEL, 0600, "ttyR%d", (mtou_count + port));
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CONTROL_INIT_STATE, DV_CHR, UID_ROOT,
-            GID_WHEEL, 0600, "ttyiR%d", (mtou_count + port));
- 			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CONTROL_LOCK_STATE, DV_CHR, UID_ROOT,
-            GID_WHEEL, 0600, "ttylR%d", (mtou_count + port));
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CALLOUT_MASK, DV_CHR, UID_UUCP, 
-            GID_DIALER, 0660, "cuaR%d", (mtou_count + port));
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CALLOUT_MASK | CONTROL_INIT_STATE,
-				DV_CHR, UID_UUCP, GID_DIALER, 0660, "cuaiR%d", 
-				(mtou_count + port));
-			devfs_add_devswf(&rp_cdevsw,
-				port | ((unit+1) * 0x10000) | CALLOUT_MASK | CONTROL_INIT_STATE, 
-   			DV_CHR, UID_UUCP, GID_DIALER, 0660, "cualR%d", 
-				(mtou_count + port));
-#endif DEVFS
 		}
+	}
+
 		idev = find_isadev(isa_devtab_tty, &rpdriver,
 				RP_MPMASTER(dev) + rp_pcicount);
@@ -1341,9 +1288,4 @@
 				dev->id_unit, RP_MPMASTER(dev));
 		}
-	}
-#ifdef DEVFS
-	mtou_count = mtou_count+port;
-#endif DEVFS
-
 /*		printf("COOL!! Device is found!!\n");
 	for(rpmajor=0;rpmajor<nchrdev;rpmajor++)
@@ -1366,9 +1308,9 @@
 	unsigned int	IntMask, ChanStatus;
 
+
    umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
 	port  = (minor(dev) & 0x1f);                /* SG */
 	mynor = (port + umynor);                    /* SG */
 	unit = minor_to_unit[mynor];
-
 	if(IS_CONTROL(dev))
 		return(0);
@@ -1610,4 +1552,5 @@
 	struct	tty	*tp;
 	int	unit, i, mynor, port, umynor, error = 0; /* SG */
+
    umynor = (((minor(dev) >> 16) -1) * 32);    /* SG */
 	port  = (minor(dev) & 0x1f);                /* SG */
@@ -2037,5 +1980,4 @@
 	xmit_fifo_room = TXFIFO_SIZE - sGetTxCnt(cp);
 	qp = &tp->t_outq;
-
 	count = 0;
 	if(xmit_fifo_room > 0 && qp->c_cc > 0) {
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: phk 
State-Changed-When: Wed Jun 24 00:41:14 PDT 1998 
State-Changed-Why:  

It seems to me that the patch does a great deal more than just add devfs 
support, could you explain a bit about that ? 



Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: phk 
Responsible-Changed-When: Wed Jun 24 00:41:14 PDT 1998 
Responsible-Changed-Why:  
State-Changed-From-To: feedback->closed 
State-Changed-By: des 
State-Changed-When: Mon Mar 12 16:21:06 PST 2001 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=7031 
>Unformatted:
