Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/pci/bktr Pull up revision 1.11 (requested by wiz):



details:   https://anonhg.NetBSD.org/src/rev/0a883534aeb7
branches:  netbsd-1-5
changeset: 488362:0a883534aeb7
user:      wiz <wiz%NetBSD.org@localhost>
date:      Mon Jul 03 02:20:19 2000 +0000

description:
Pull up revision 1.11 (requested by wiz):
Sync with release 2.14 of the bktr driver. Changes: mostly integration
of NetBSD changes; support for new Hauppauge tuner types.

Approved by thorpej.

diffstat:

 sys/dev/pci/bktr/bktr_os.c |  145 ++++++++++++++++++++++++++------------------
 1 files changed, 86 insertions(+), 59 deletions(-)

diffs (211 lines):

diff -r 2f3819e583e0 -r 0a883534aeb7 sys/dev/pci/bktr/bktr_os.c
--- a/sys/dev/pci/bktr/bktr_os.c        Mon Jul 03 02:19:34 2000 +0000
+++ b/sys/dev/pci/bktr/bktr_os.c        Mon Jul 03 02:20:19 2000 +0000
@@ -1,6 +1,6 @@
-/*     $NetBSD: bktr_os.c,v 1.5.4.1 2000/06/30 16:27:51 simonb Exp $   */
+/*     $NetBSD: bktr_os.c,v 1.5.4.2 2000/07/03 02:20:19 wiz Exp $      */
 
-/* FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.7 2000/04/16 07:50:09 roger Exp */
+/* FreeBSD: src/sys/dev/bktr/bktr_os.c,v 1.10 2000/06/28 15:09:12 roger Exp */
 
 /*
  * This is part of the Driver for Video Capture Cards (Frame grabbers)
@@ -60,6 +60,12 @@
 #define FIFO_RISC_DISABLED      0
 #define ALL_INTS_DISABLED       0
 
+
+/*******************/
+/* *** FreeBSD *** */
+/*******************/
+#ifdef __FreeBSD__
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/conf.h>
@@ -76,11 +82,6 @@
 #include <vm/pmap.h>
 #include <vm/vm_extern.h>
 
-/*******************/
-/* *** FreeBSD *** */
-/*******************/
-#ifdef __FreeBSD__
-
 #if (__FreeBSD_version < 400000)
 #ifdef DEVFS
 #include <sys/devfsext.h>
@@ -106,8 +107,78 @@
 #include <machine/clock.h>      /* for DELAY */
 #include <pci/pcivar.h>
 #include <pci/pcireg.h>
+
+#if (NSMBUS > 0)
+#include <dev/bktr/bktr_i2c.h>
 #endif
 
+#include <sys/sysctl.h>
+int bt848_card = -1; 
+int bt848_tuner = -1;
+int bt848_reverse_mute = -1; 
+int bt848_format = -1;
+int bt848_slow_msp_audio = -1;
+
+SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW, 0, "Bt848 Driver mgmt");
+SYSCTL_INT(_hw_bt848, OID_AUTO, card, CTLFLAG_RW, &bt848_card, -1, "");
+SYSCTL_INT(_hw_bt848, OID_AUTO, tuner, CTLFLAG_RW, &bt848_tuner, -1, "");
+SYSCTL_INT(_hw_bt848, OID_AUTO, reverse_mute, CTLFLAG_RW, &bt848_reverse_mute, -1, "");
+SYSCTL_INT(_hw_bt848, OID_AUTO, format, CTLFLAG_RW, &bt848_format, -1, "");
+SYSCTL_INT(_hw_bt848, OID_AUTO, slow_msp_audio, CTLFLAG_RW, &bt848_slow_msp_audio, -1, "");
+
+#if (__FreeBSD__ == 2)
+#define PCIR_REVID     PCI_CLASS_REG
+#endif
+
+#endif /* end freebsd section */
+
+
+
+/****************/
+/* *** BSDI *** */
+/****************/
+#ifdef __bsdi__
+#endif /* __bsdi__ */
+
+
+/**************************/
+/* *** OpenBSD/NetBSD *** */
+/**************************/
+#if defined(__NetBSD__) || defined(__OpenBSD__)
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/conf.h>
+#include <sys/uio.h>
+#include <sys/kernel.h>
+#include <sys/signalvar.h>
+#include <sys/mman.h>
+#include <sys/poll.h>
+#include <sys/select.h>
+#include <sys/vnode.h>
+
+#ifndef __NetBSD__
+#include <vm/vm.h>
+#include <vm/vm_kern.h>
+#include <vm/pmap.h>
+#include <vm/vm_extern.h>
+#endif
+
+#include <sys/device.h>
+#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcidevs.h>
+
+#define BKTR_DEBUG
+#ifdef BKTR_DEBUG
+int bktr_debug = 0;
+#define DPR(x) (bktr_debug ? printf x : 0)
+#else
+#define DPR(x)
+#endif
+#endif /* __NetBSD__ || __OpenBSD__ */
+
+
 #ifdef __NetBSD__
 #include <dev/ic/bt8xx.h>      /* NetBSD location for .h files */
 #include <dev/pci/bktr/bktr_reg.h>
@@ -127,56 +198,6 @@
 #include <dev/bktr/bktr_os.h>
 #endif
 
-#if defined(__FreeBSD__)
-#if (NSMBUS > 0)
-#include <dev/bktr/bktr_i2c.h>
-#endif
-
-#include <sys/sysctl.h>
-int bt848_card = -1; 
-int bt848_tuner = -1;
-int bt848_reverse_mute = -1; 
-int bt848_format = -1;
-int bt848_slow_msp_audio = -1;
-
-SYSCTL_NODE(_hw, OID_AUTO, bt848, CTLFLAG_RW, 0, "Bt848 Driver mgmt");
-SYSCTL_INT(_hw_bt848, OID_AUTO, card, CTLFLAG_RW, &bt848_card, -1, "");
-SYSCTL_INT(_hw_bt848, OID_AUTO, tuner, CTLFLAG_RW, &bt848_tuner, -1, "");
-SYSCTL_INT(_hw_bt848, OID_AUTO, reverse_mute, CTLFLAG_RW, &bt848_reverse_mute, -1, "");
-SYSCTL_INT(_hw_bt848, OID_AUTO, format, CTLFLAG_RW, &bt848_format, -1, "");
-SYSCTL_INT(_hw_bt848, OID_AUTO, slow_msp_audio, CTLFLAG_RW, &bt848_slow_msp_audio, -1, "");
-#endif
-
-#if (__FreeBSD__ == 2)
-#define PCIR_REVID     PCI_CLASS_REG
-#endif
-
-
-/****************/
-/* *** BSDI *** */
-/****************/
-#ifdef __bsdi__
-#endif /* __bsdi__ */
-
-
-/**************************/
-/* *** OpenBSD/NetBSD *** */
-/**************************/
-#if defined(__NetBSD__) || defined(__OpenBSD__)
-#include <sys/device.h>
-#include <dev/pci/pcivar.h>
-#include <dev/pci/pcireg.h>
-#include <dev/pci/pcidevs.h>
-
-#define BKTR_DEBUG
-#ifdef BKTR_DEBUG
-int bktr_debug = 0;
-#define DPR(x) (bktr_debug ? printf x : 0)
-#else
-#define DPR(x)
-#endif
-#endif /* __NetBSD__ || __OpenBSD__ */
-
 
 
 /****************************/
@@ -287,6 +308,9 @@
 
        unit = device_get_unit(dev);
 
+       /* build the device name for bktr_name() */
+       snprintf(bktr->bktr_xname, sizeof(bktr->bktr_xname), "bktr%d",unit);
+
        /*
         * Enable bus mastering and Memory Mapped device
         */
@@ -297,7 +321,7 @@
        /*
         * Map control/status registers.
         */
-       rid = PCI_MAP_REG_START;
+       rid = PCIR_MAPS;
        bktr->res_mem = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
                                   0, ~0, 1, RF_ACTIVE);
 
@@ -432,7 +456,7 @@
         */
        bus_teardown_intr(dev, bktr->res_irq, bktr->res_ih);
        bus_release_resource(dev, SYS_RES_IRQ, 0, bktr->res_irq);
-       bus_release_resource(dev, SYS_RES_MEMORY, PCI_MAP_REG_START, bktr->res_mem);
+       bus_release_resource(dev, SYS_RES_MEMORY, PCIR_MAPS, bktr->res_mem);
 
        return 0;
 }
@@ -849,6 +873,9 @@
                return;
        }
 
+       /* build the device name for bktr_name() */
+       snprintf(bktr->bktr_xname, sizeof(bktr->bktr_xname), "bktr%d",unit);
+
        /* Enable Memory Mapping */
        fun = pci_conf_read(tag, PCI_COMMAND_STATUS_REG);
        pci_conf_write(tag, PCI_COMMAND_STATUS_REG, fun | 2);



Home | Main Index | Thread Index | Old Index