1 /* tdfx_drv.c -- tdfx driver -*- linux-c -*-
2 * Created: Thu Oct 7 10:38:32 1999 by faith@precisioninsight.com
4 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
5 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice (including the next
16 * paragraph) shall be included in all copies or substantial portions of the
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
28 * Rickard E. (Rik) Faith <faith@valinux.com>
29 * Daryll Strauss <daryll@valinux.com>
30 * Gareth Hughes <gareth@valinux.com>
36 #include "drm_pciids.h"
38 /* drv_PCI_IDs comes from drm_pciids.h, generated from drm_pciids.txt. */
39 static drm_pci_id_list_t tdfx_pciidlist[] = {
43 extern drm_ioctl_desc_t tdfx_ioctls[];
44 extern int tdfx_max_ioctl;
46 static void tdfx_configure(drm_device_t *dev)
48 dev->dev_priv_size = 1; /* No dev_priv */
50 dev->max_driver_ioctl = 0;
52 dev->driver_name = DRIVER_NAME;
53 dev->driver_desc = DRIVER_DESC;
54 dev->driver_date = DRIVER_DATE;
55 dev->driver_major = DRIVER_MAJOR;
56 dev->driver_minor = DRIVER_MINOR;
57 dev->driver_patchlevel = DRIVER_PATCHLEVEL;
64 tdfx_probe(device_t dev)
66 return drm_probe(dev, tdfx_pciidlist);
70 tdfx_attach(device_t nbdev)
72 drm_device_t *dev = device_get_softc(nbdev);
74 bzero(dev, sizeof(drm_device_t));
76 return drm_attach(nbdev, tdfx_pciidlist);
79 static device_method_t tdfx_methods[] = {
80 /* Device interface */
81 DEVMETHOD(device_probe, tdfx_probe),
82 DEVMETHOD(device_attach, tdfx_attach),
83 DEVMETHOD(device_detach, drm_detach),
88 static driver_t tdfx_driver = {
94 extern devclass_t drm_devclass;
95 DRIVER_MODULE(tdfx, pci, tdfx_driver, drm_devclass, 0, 0);
96 MODULE_DEPEND(tdfx, drm, 1, 1, 1);
98 #elif defined(__NetBSD__) || defined(__OpenBSD__)
99 CFDRIVER_DECL(tdfx, DV_TTY, NULL);