diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-03-19 19:08:38 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-03-19 19:08:38 +0000 |
commit | 12f9da3a469de8b4c643600caa768a370a7c7e28 (patch) | |
tree | 3a2fb9f6f69223e46661c29761f3435d25cc64af /sys/arch | |
parent | a50cfb6a5d9300ad2b140e68a55800ddf01c71c1 (diff) |
Prevent the Ethernet driver to be opened twice when using a bootp() path;
some ARCBios don't like this.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sgi/stand/boot/arcbios.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/sgi/stand/boot/arcbios.c b/sys/arch/sgi/stand/boot/arcbios.c index ed7e32951c2..c86e70eab9f 100644 --- a/sys/arch/sgi/stand/boot/arcbios.c +++ b/sys/arch/sgi/stand/boot/arcbios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arcbios.c,v 1.15 2012/03/19 17:38:31 miod Exp $ */ +/* $OpenBSD: arcbios.c,v 1.16 2012/03/19 19:08:37 miod Exp $ */ /*- * Copyright (c) 1996 M. Warner Losh. All rights reserved. * Copyright (c) 1996-2004 Opsycon AB. All rights reserved. @@ -243,7 +243,7 @@ devopen(struct open_file *f, const char *fname, char **file) int partition = 0; char namebuf[256]; char devname[32]; - int rc, i, n; + int rc, i, n, noopen = 0; ecp = cp = fname; namebuf[0] = '\0'; @@ -254,6 +254,7 @@ devopen(struct open_file *f, const char *fname, char **file) if (strncmp(cp, "bootp()", 7) == 0) { strlcpy(devname, "bootp", sizeof(devname)); strlcpy(namebuf, cp, sizeof(namebuf)); + noopen = 1; } else if (strncmp(cp, "dksc(", 5) == 0) { strncpy(devname, "scsi", sizeof(devname)); cp += 5; @@ -298,7 +299,10 @@ devopen(struct open_file *f, const char *fname, char **file) n = ndevs; while (n--) { if (strcmp(devname, dp->dv_name) == 0) { - rc = (dp->dv_open)(f, namebuf, partition, 0); + if (noopen) + rc = 0; + else + rc = (dp->dv_open)(f, namebuf, partition, 0); if (rc == 0) { f->f_dev = dp; if (file && *cp != '\0') |