freebsd-skq/sys/dev/tdfx/tdfx_vars.h
Coleman Kane 48f6bffc18 Studied the tech docs for the Voodoo3 and Banshee, and hopefully fixed the
errors that plagued those cards with XFree86 4.0. They have two memory
ranges as well as an IO port range to them. Also cleaned up the three
warning messages that I got, from inb(), outb() and linuxulator. Also, I
noticed that the DRI and Glide support for the Voodoo4 and 5 has been
placed upon linux.3dfx.com, too bad they haven't released the tech docs
yet. Apparently, they are still pushing glide for all of us, so I will try
and add support once those tech docs are up.
2000-07-19 05:41:14 +00:00

105 lines
3.3 KiB
C

/*
* Copyright (c) 2000 by Coleman Kane <cokane@FreeBSD.org>
* 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$
*/
/* tdfx_vars.h -- constants and structs used in the tdfx driver
Copyright (C) 2000 by Coleman Kane <cokane@FreeBSD.org>
*/
#ifndef TDFX_VARS_H
#define TDFX_VARS_H
#include <sys/memrange.h>
#include <sys/param.h>
#include <sys/bus_private.h>
#include <sys/bus.h>
#include <sys/cdefs.h>
#define CDEV_MAJOR 107
#define PCI_DEVICE_ALLIANCE_AT3D 0x643d1142
#define PCI_DEVICE_3DFX_VOODOO1 0x0000121a
#define PCI_DEVICE_3DFX_VOODOO2 0x0002121a
#define PCI_DEVICE_3DFX_BANSHEE 0x0003121a
#define PCI_DEVICE_3DFX_VOODOO3 0x0005121a
#define PCI_VENDOR_ID_FREEBSD 0x0
#define PCI_DEVICE_ID_FREEBSD 0x2
#define PCI_COMMAND_FREEBSD 0x4
#define PCI_REVISION_ID_FREEBSD 0x8
#define PCI_BASE_ADDRESS_0_FREEBSD 0x10
#define SST1_PCI_SPECIAL1_FREEBSD 0x40
#define SST1_PCI_SPECIAL2_FREEBSD 0x44
#define SST1_PCI_SPECIAL3_FREEBSD 0x48
#define SST1_PCI_SPECIAL4_FREEBSD 0x54
#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;
vm_offset_t addr, addr2;
struct resource *memrange, *memrange2, *piorange;
int memrid, memrid2, piorid;
long range;
int vendor;
int type;
int addr0, addr1;
unsigned char bus;
unsigned char dv;
struct file *curFile;
device_t dev;
dev_t devt;
struct mem_range_desc mrdesc;
int busy;
};
struct tdfx_pio_data {
short port;
short size;
int device;
void *value;
};
#endif /* TDFX_VARS_H */