2000-06-22 05:37:17 +00:00
|
|
|
/*
|
2001-03-20 19:30:46 +00:00
|
|
|
* Copyright (c) 2000-2001 by Coleman Kane <cokane@FreeBSD.org>
|
2000-06-22 05:37:17 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by Gardner Buchanan.
|
|
|
|
* 4. The name of Gardner Buchanan may not be used to endorse or promote
|
|
|
|
* products derived from this software without specific prior written
|
|
|
|
* permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
2000-06-21 20:09:31 +00:00
|
|
|
/* tdfx_vars.h -- constants and structs used in the tdfx driver
|
2001-03-20 19:30:46 +00:00
|
|
|
Copyright (C) 2000-2001 by Coleman Kane <cokane@FreeBSD.org>
|
2000-06-21 20:09:31 +00:00
|
|
|
*/
|
|
|
|
#ifndef TDFX_VARS_H
|
|
|
|
#define TDFX_VARS_H
|
|
|
|
|
|
|
|
#include <sys/memrange.h>
|
2000-06-22 05:37:17 +00:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/bus.h>
|
|
|
|
#include <sys/cdefs.h>
|
2000-06-21 20:09:31 +00:00
|
|
|
|
|
|
|
#define CDEV_MAJOR 107
|
|
|
|
#define PCI_DEVICE_ALLIANCE_AT3D 0x643d1142
|
2001-03-20 19:30:46 +00:00
|
|
|
#define PCI_DEVICE_3DFX_VOODOO1 0x0001121a
|
2000-06-21 20:09:31 +00:00
|
|
|
#define PCI_DEVICE_3DFX_VOODOO2 0x0002121a
|
|
|
|
#define PCI_DEVICE_3DFX_BANSHEE 0x0003121a
|
|
|
|
#define PCI_DEVICE_3DFX_VOODOO3 0x0005121a
|
|
|
|
|
2000-08-28 04:28:53 +00:00
|
|
|
#define PCI_VENDOR_ID_FREEBSD 0x0
|
|
|
|
#define PCI_DEVICE_ID_FREEBSD 0x2
|
|
|
|
#define PCI_COMMAND_FREEBSD 0x4
|
|
|
|
#define PCI_REVISION_ID_FREEBSD 0x8
|
2000-06-21 20:09:31 +00:00
|
|
|
#define PCI_BASE_ADDRESS_0_FREEBSD 0x10
|
2000-08-28 04:28:53 +00:00
|
|
|
#define PCI_BASE_ADDRESS_1_FREEBSD 0x14
|
|
|
|
#define PCI_PRIBUS_FREEBSD 0x18
|
|
|
|
#define PCI_IOBASE_0_FREEBSD 0x2c
|
|
|
|
#define PCI_IOLIMIT_0_FREEBSD 0x30
|
|
|
|
#define SST1_PCI_SPECIAL1_FREEBSD 0x40
|
|
|
|
#define SST1_PCI_SPECIAL2_FREEBSD 0x44
|
|
|
|
#define SST1_PCI_SPECIAL3_FREEBSD 0x48
|
|
|
|
#define SST1_PCI_SPECIAL4_FREEBSD 0x54
|
2000-06-21 20:09:31 +00:00
|
|
|
|
|
|
|
#define VGA_INPUT_STATUS_1C 0x3DA
|
|
|
|
#define VGA_MISC_OUTPUT_READ 0x3cc
|
|
|
|
#define VGA_MISC_OUTPUT_WRITE 0x3c2
|
|
|
|
#define SC_INDEX 0x3c4
|
|
|
|
#define SC_DATA 0x3c5
|
|
|
|
|
|
|
|
#define PCI_MAP_REG_START 0x10
|
|
|
|
#define UNIT(m) (m & 0xf)
|
|
|
|
|
|
|
|
/* IOCTL Calls */
|
|
|
|
#define TDFX_IOC_TYPE_PIO 0
|
|
|
|
#define TDFX_IOC_TYPE_QUERY '3'
|
|
|
|
#define TDFX_IOC_QRY_BOARDS 2
|
|
|
|
#define TDFX_IOC_QRY_FETCH 3
|
|
|
|
#define TDFX_IOC_QRY_UPDATE 4
|
|
|
|
|
|
|
|
struct tdfx_softc {
|
|
|
|
int cardno;
|
2000-07-19 05:41:14 +00:00
|
|
|
vm_offset_t addr, addr2;
|
|
|
|
struct resource *memrange, *memrange2, *piorange;
|
|
|
|
int memrid, memrid2, piorid;
|
2000-06-21 20:09:31 +00:00
|
|
|
long range;
|
|
|
|
int vendor;
|
|
|
|
int type;
|
2000-07-19 05:41:14 +00:00
|
|
|
int addr0, addr1;
|
2000-08-28 04:28:53 +00:00
|
|
|
short pio0, pio0max;
|
2000-06-21 20:09:31 +00:00
|
|
|
unsigned char bus;
|
|
|
|
unsigned char dv;
|
|
|
|
struct file *curFile;
|
|
|
|
device_t dev;
|
2000-06-23 05:54:01 +00:00
|
|
|
dev_t devt;
|
2000-06-21 20:09:31 +00:00
|
|
|
struct mem_range_desc mrdesc;
|
|
|
|
int busy;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct tdfx_pio_data {
|
|
|
|
short port;
|
|
|
|
short size;
|
|
|
|
int device;
|
|
|
|
void *value;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* TDFX_VARS_H */
|