summaryrefslogtreecommitdiffstats
path: root/sys/dev/si
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-12-16 14:03:02 +0000
committerpeter <peter@FreeBSD.org>1995-12-16 14:03:02 +0000
commit37c2fb711b793ebdad018c53e41ed34a6cabcf48 (patch)
tree6bf875a77e18bb82181f019cbbe5aaa99a016b09 /sys/dev/si
parentd4004feaeed42483a6da5927ebbc1890e107355f (diff)
downloadFreeBSD-src-37c2fb711b793ebdad018c53e41ed34a6cabcf48.zip
FreeBSD-src-37c2fb711b793ebdad018c53e41ed34a6cabcf48.tar.gz
Another shot at getting working si DEVFS entries.. Apparently, it didn't
understand %02d in it's format string...
Diffstat (limited to 'sys/dev/si')
-rw-r--r--sys/dev/si/si.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index e2daa06..d43cd1d 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
- * $Id: si.c,v 1.28 1995/12/10 20:54:35 bde Exp $
+ * $Id: si.c,v 1.29 1995/12/14 14:29:10 peter Exp $
*/
#ifndef lint
@@ -147,6 +147,10 @@ static struct tty *si_tty;
extern int si_dsize;
extern unsigned char si_download[];
+#ifdef DEVFS
+static char chardev[] = "0123456789abcdef";
+#endif
+
struct si_softc {
int sc_type; /* adapter type */
char *sc_typename; /* adapter type string */
@@ -486,7 +490,9 @@ siattach(id)
struct speedtab *spt;
int nmodule, nport, x, y;
int uart_type;
+#ifdef DEVFS
char name[32];
+#endif
DPRINT((0, DBG_AUTOBOOT, "si%d: siattach\n", id->id_unit));
@@ -692,22 +698,22 @@ mem_fail:
#ifdef DEVFS
/* path name devsw minor type uid gid perm*/
- for ( x = 0; x < nport; x++ ) {
- sprintf(name,"ttyA%02d", x + 1);
+ for ( x = 1; x <= nport; x++ ) {
+ sprintf(name,"ttyA%c%c", chardev[x / 10], chardev[x % 10]);
sc->devfs_token[x].ttyd = devfs_add_devsw(
- "/", name, &si_cdevsw, unit,
+ "/", name, &si_cdevsw, x,
DV_CHR, 0, 0, 0600);
- sprintf(name,"cuaA%02d", x + 1);
+ sprintf(name,"cuaA%c%c", chardev[x / 10], chardev[x % 10]);
sc->devfs_token[x].cuaa = devfs_add_devsw(
- "/", name, &si_cdevsw, unit + 128,
+ "/", name, &si_cdevsw, x + 128,
DV_CHR, 0, 0, 0600);
- sprintf(name,"ttyiA%02d", x + 1);
+ sprintf(name,"ttyiA%c%c", chardev[x / 10], chardev[x % 10]);
sc->devfs_token[x].ttyi = devfs_add_devsw(
- "/", name, &si_cdevsw, unit + 0x10000,
+ "/", name, &si_cdevsw, x + 0x10000,
DV_CHR, 0, 0, 0600);
- sprintf(name,"ttylA%02d", x + 1);
+ sprintf(name,"ttylA%c%c", chardev[x / 10], chardev[x % 10]);
sc->devfs_token[x].ttyl = devfs_add_devsw(
- "/", name, &si_cdevsw, unit + 0x20000,
+ "/", name, &si_cdevsw, x + 0x20000,
DV_CHR, 0, 0, 0600);
}
/* XXX: no global yet */
OpenPOWER on IntegriCloud