Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/altq Saner glue into cdevsw.



details:   https://anonhg.NetBSD.org/src/rev/cb250a08eba7
branches:  trunk
changeset: 500652:cb250a08eba7
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Dec 14 23:50:43 2000 +0000

description:
Saner glue into cdevsw.

diffstat:

 sys/altq/altq_conf.c |  26 ++++++++++----------------
 sys/altq/altqconf.h  |  17 +++++++++++++++++
 sys/altq/if_altq.h   |   6 +++---
 3 files changed, 30 insertions(+), 19 deletions(-)

diffs (137 lines):

diff -r 8b63e520a8da -r cb250a08eba7 sys/altq/altq_conf.c
--- a/sys/altq/altq_conf.c      Thu Dec 14 23:48:16 2000 +0000
+++ b/sys/altq/altq_conf.c      Thu Dec 14 23:50:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: altq_conf.c,v 1.3 2000/12/14 18:07:30 thorpej Exp $    */
+/*     $NetBSD: altq_conf.c,v 1.4 2000/12/14 23:50:43 thorpej Exp $    */
 /*     $KAME: altq_conf.c,v 1.10 2000/12/14 08:12:45 thorpej Exp $     */
 
 /*
@@ -155,7 +155,7 @@
  */
 int    naltqsw = sizeof (altqsw) / sizeof (altqsw[0]);
 
-#ifndef __OpenBSD__
+#if !defined(__NetBSD__) && defined(__OpenBSD__)
 static d_open_t        altqopen;
 static d_close_t       altqclose;
 static d_ioctl_t       altqioctl;
@@ -168,14 +168,6 @@
 
 #if defined(__FreeBSD__)
 #define        CDEV_MAJOR 96           /* FreeBSD official number */
-#elif defined(__NetBSD__)
-#if defined(__i386__)
-#define        CDEV_MAJOR 75           /* NetBSD i386 (not official) */
-#elif defined(__alpha__)
-#define        CDEV_MAJOR 62           /* NetBSD alpha (not official) */
-#else
-#error arch not supported
-#endif
 #elif defined(__OpenBSD__)
 #if defined(__i386__)
 #define        CDEV_MAJOR 67           /* OpenBSD i386 (not official) */
@@ -198,15 +190,13 @@
          altqioctl,    seltrue,        nommap,         nostrategy,     
          "altq",       CDEV_MAJOR,     nodump,         nopsize,  0,  -1 };
 #endif
-#elif defined(__NetBSD__)
-static struct cdevsw altq_cdevsw = cdev__oci_init(1,altq);
 #elif defined(__OpenBSD__)
 static struct cdevsw altq_cdevsw = {
        altqopen, altqclose, 0, 0, altqioctl, 0,
        0, 0, 0, 0 };
 #endif
 
-#if !defined(__OpenBSD__)
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
 static
 #endif
 int
@@ -225,7 +215,7 @@
        return ENXIO;
 }
 
-#if !defined(__OpenBSD__)
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
 static
 #endif
 int
@@ -244,7 +234,7 @@
        return ENXIO;
 }
 
-#if !defined(__OpenBSD__)
+#if !defined(__NetBSD__) && !defined(__OpenBSD__)
 static
 #endif
 int
@@ -306,7 +296,9 @@
 }
 
 
+#if !defined(__NetBSD__)
 static int altq_devsw_installed = 0;
+#endif
 
 #ifdef __FreeBSD__
 #if (__FreeBSD_version < 400000)
@@ -359,7 +351,7 @@
 
 SYSINIT(altqdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,altq_drvinit,NULL)
 
-#elif defined(__NetBSD__)||defined(__OpenBSD__)
+#elif defined(__OpenBSD__)
 
 void
 altqattach(int unused)
@@ -372,6 +364,8 @@
                printf("altq: major number is %d\n", CDEV_MAJOR);
        }
 }
+#elif defined(__NetBSD__)
+/* NetBSD requires no altqattach() */
 #else
 #error altqattach()??
 #endif
diff -r 8b63e520a8da -r cb250a08eba7 sys/altq/altqconf.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/altq/altqconf.h       Thu Dec 14 23:50:43 2000 +0000
@@ -0,0 +1,17 @@
+/*     $NetBSD: altqconf.h,v 1.1 2000/12/14 23:50:43 thorpej Exp $     */
+
+#if defined(_KERNEL) && !defined(_LKM)
+#include "opt_altq_enabled.h"
+
+#include <sys/conf.h>
+
+#ifdef ALTQ
+#define        NALTQ   1
+#else
+#define        NALTQ   0
+#endif
+
+cdev_decl(altq);
+
+#define        cdev_altq_init(x,y)     cdev__oci_init(x,y)
+#endif /* _KERNEL && ! _LKM */
diff -r 8b63e520a8da -r cb250a08eba7 sys/altq/if_altq.h
--- a/sys/altq/if_altq.h        Thu Dec 14 23:48:16 2000 +0000
+++ b/sys/altq/if_altq.h        Thu Dec 14 23:50:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_altq.h,v 1.4 2000/12/14 22:36:48 thorpej Exp $      */
+/*     $NetBSD: if_altq.h,v 1.5 2000/12/14 23:50:43 thorpej Exp $      */
 /*     $KAME: if_altq.h,v 1.5 2000/12/14 08:12:47 thorpej Exp $        */
 
 /*
@@ -29,8 +29,8 @@
 #ifndef _ALTQ_IF_ALTQ_H_
 #define        _ALTQ_IF_ALTQ_H_
 
-#if defined(_KERNEL) && !defined(_LKM)
-#include "opt_altq_enabled.h"
+#ifdef _KERNEL
+#include <altq/altqconf.h>
 #endif
 
 struct altq_pktattr; struct tb_regulator; struct top_cdnr;



Home | Main Index | Thread Index | Old Index