Deleted Added
full compact
tdfx_pci.c (61987) tdfx_pci.c (61989)
1/*
2 * Copyright (c) 2000 by Coleman Kane <cokane@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
1/*
2 * Copyright (c) 2000 by Coleman Kane <cokane@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 * $FreeBSD: head/sys/dev/tdfx/tdfx_pci.c 61987 2000-06-23 04:41:28Z cokane $
31 * $FreeBSD: head/sys/dev/tdfx/tdfx_pci.c 61989 2000-06-23 05:54:01Z cokane $
32 */
33
34/* 3dfx driver for FreeBSD 4.x - Finished 11 May 2000, 12:25AM ET
35 *
36 * Copyright (C) 2000, by Coleman Kane <cokane@FreeBSD.org>,
37 * based upon the 3dfx driver written for linux, by Daryll Straus, Jon Taylor,
38 * and Jens Axboe, located at http://linux.3dfx.com.
39 */

--- 57 unchanged lines hidden (view full) ---

97 DEVMETHOD(device_detach, tdfx_detach),
98 DEVMETHOD(device_shutdown, tdfx_shutdown),
99 { 0, 0 }
100};
101
102MALLOC_DEFINE(M_TDFX,"TDFX Driver","3DFX Graphics[/2D]/3D Accelerator(s)");
103
104#ifdef TDFX_LINUX
32 */
33
34/* 3dfx driver for FreeBSD 4.x - Finished 11 May 2000, 12:25AM ET
35 *
36 * Copyright (C) 2000, by Coleman Kane <cokane@FreeBSD.org>,
37 * based upon the 3dfx driver written for linux, by Daryll Straus, Jon Taylor,
38 * and Jens Axboe, located at http://linux.3dfx.com.
39 */

--- 57 unchanged lines hidden (view full) ---

97 DEVMETHOD(device_detach, tdfx_detach),
98 DEVMETHOD(device_shutdown, tdfx_shutdown),
99 { 0, 0 }
100};
101
102MALLOC_DEFINE(M_TDFX,"TDFX Driver","3DFX Graphics[/2D]/3D Accelerator(s)");
103
104#ifdef TDFX_LINUX
105MODULE_DEPEND(tdfx, linux, 1, 1, 1);
105LINUX_IOCTL_SET(tdfx, LINUX_IOCTL_TDFX_MIN, LINUX_IOCTL_TDFX_MAX);
106#endif
107
108/* Char. Dev. file operations structure */
109static struct cdevsw tdfx_cdev = {
110 tdfx_open, /* open */
111 tdfx_close, /* close */
112 noread, /* read */

--- 117 unchanged lines hidden (view full) ---

230 }
231
232 /*
233 * make_dev registers the cdev to access the 3dfx card from /dev
234 * use hex here for the dev num, simply to provide better support if > 10
235 * voodoo cards, for the mad. The user must set the link, or use MAKEDEV.
236 * Why would we want that many voodoo cards anyhow?
237 */
106LINUX_IOCTL_SET(tdfx, LINUX_IOCTL_TDFX_MIN, LINUX_IOCTL_TDFX_MAX);
107#endif
108
109/* Char. Dev. file operations structure */
110static struct cdevsw tdfx_cdev = {
111 tdfx_open, /* open */
112 tdfx_close, /* close */
113 noread, /* read */

--- 117 unchanged lines hidden (view full) ---

231 }
232
233 /*
234 * make_dev registers the cdev to access the 3dfx card from /dev
235 * use hex here for the dev num, simply to provide better support if > 10
236 * voodoo cards, for the mad. The user must set the link, or use MAKEDEV.
237 * Why would we want that many voodoo cards anyhow?
238 */
238 make_dev(&tdfx_cdev, dev->unit, 0, 0, 02660, "3dfx%x", dev->unit);
239 tdfx_info->devt = make_dev(&tdfx_cdev, dev->unit, 0, 0, 02660,
240 "3dfx%x", dev->unit);
239
240 return 0;
241}
242
243static int
244tdfx_detach(device_t dev) {
245 struct tdfx_softc* tdfx_info;
246 int retval;

--- 6 unchanged lines hidden (view full) ---

253 /* Though it is safe to leave the WRCOMB support since the
254 mem driver checks for it, we should remove it in order
255 to free an MTRR for another device */
256 retval = tdfx_clrmtrr(dev);
257#ifdef DEBUG
258 if(retval != 0)
259 printf("tdfx: For some reason, I couldn't clear the mtrr\n");
260#endif
241
242 return 0;
243}
244
245static int
246tdfx_detach(device_t dev) {
247 struct tdfx_softc* tdfx_info;
248 int retval;

--- 6 unchanged lines hidden (view full) ---

255 /* Though it is safe to leave the WRCOMB support since the
256 mem driver checks for it, we should remove it in order
257 to free an MTRR for another device */
258 retval = tdfx_clrmtrr(dev);
259#ifdef DEBUG
260 if(retval != 0)
261 printf("tdfx: For some reason, I couldn't clear the mtrr\n");
262#endif
263 /* Remove device entry when it can no longer be accessed */
264 destroy_dev(tdfx_info->devt);
261 return(0);
262}
263
264static int
265tdfx_shutdown(device_t dev) {
266#ifdef DEBUG
267 device_printf(dev, "tdfx: Device Shutdown\n");
268#endif

--- 501 unchanged lines hidden ---
265 return(0);
266}
267
268static int
269tdfx_shutdown(device_t dev) {
270#ifdef DEBUG
271 device_printf(dev, "tdfx: Device Shutdown\n");
272#endif

--- 501 unchanged lines hidden ---