linux/drivers/usb/misc/sisusbvga/sisusb.h

/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
/*
 * sisusb - usb kernel driver for Net2280/SiS315 based USB2VGA dongles
 *
 * Copyright (C) 2005 by Thomas Winischhofer, Vienna, Austria
 *
 * If distributed as part of the Linux kernel, this code is licensed under the
 * terms of the GPL v2.
 *
 * Otherwise, the following license terms apply:
 *
 * 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) The name of the author 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 EXPRESSED 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.
 *
 * Author:	Thomas Winischhofer <[email protected]>
 *
 */

#ifndef _SISUSB_H_
#define _SISUSB_H_

#include <linux/mutex.h>

/* Version Information */

#define SISUSB_VERSION
#define SISUSB_REVISION
#define SISUSB_PATCHLEVEL

/* Include console and mode switching code? */

#include <linux/vt_kern.h>
#include "sisusb_struct.h"

/* USB related */

#define SISUSB_MINOR

/* Size of the sisusb input/output buffers */
#define SISUSB_IBUF_SIZE
#define SISUSB_OBUF_SIZE

#define NUMOBUFS

/* About endianness:
 *
 * 1) I/O ports, PCI config registers. The read/write()
 *    calls emulate inX/outX. Hence, the data is
 *    expected/delivered in machine endiannes by this
 *    driver.
 * 2) Video memory. The data is copied 1:1. There is
 *    no swapping. Ever. This means for userland that
 *    the data has to be prepared properly. (Hint:
 *    think graphics data format, command queue,
 *    hardware cursor.)
 * 3) MMIO. Data is copied 1:1. MMIO must be swapped
 *    properly by userland.
 *
 */

#ifdef __BIG_ENDIAN
#define SISUSB_CORRECT_ENDIANNESS_PACKET
#else
#define SISUSB_CORRECT_ENDIANNESS_PACKET(p)
#endif

struct sisusb_usb_data;

struct sisusb_urb_context {};

struct sisusb_usb_data {};

#define to_sisusb_dev(d)

/* USB transport related */

/* urbstatus */
#define SU_URB_BUSY
#define SU_URB_ALLOC

/* Endpoints */

#define SISUSB_EP_GFX_IN
#define SISUSB_EP_GFX_OUT

#define SISUSB_EP_GFX_BULK_OUT
#define SISUSB_EP_GFX_BULK_IN

#define SISUSB_EP_GFX_LBULK_OUT

#define SISUSB_EP_UNKNOWN_04

#define SISUSB_EP_BRIDGE_IN
#define SISUSB_EP_BRIDGE_OUT

#define SISUSB_TYPE_MEM
#define SISUSB_TYPE_IO

struct sisusb_packet {} __attribute__ ((packed));

#define CLEARPACKET(packet)

/* PCI bridge related */

#define SISUSB_PCI_MEMBASE
#define SISUSB_PCI_MMIOBASE
#define SISUSB_PCI_IOPORTBASE

#define SISUSB_PCI_PSEUDO_MEMBASE
#define SISUSB_PCI_PSEUDO_MMIOBASE
#define SISUSB_PCI_PSEUDO_IOPORTBASE
#define SISUSB_PCI_PSEUDO_PCIBASE

#define SISUSB_PCI_MMIOSIZE
#define SISUSB_PCI_PCONFSIZE

/* graphics core related */

#define AROFFSET
#define ARROFFSET
#define GROFFSET
#define SROFFSET
#define CROFFSET
#define MISCROFFSET
#define MISCWOFFSET
#define INPUTSTATOFFSET
#define PART1OFFSET
#define PART2OFFSET
#define PART3OFFSET
#define PART4OFFSET
#define PART5OFFSET
#define CAPTUREOFFSET
#define VIDEOOFFSET
#define COLREGOFFSET
#define PELMASKOFFSET
#define VGAENABLE

#define SISAR
#define SISARR
#define SISGR
#define SISSR
#define SISCR
#define SISMISCR
#define SISMISCW
#define SISINPSTAT
#define SISPART1
#define SISPART2
#define SISPART3
#define SISPART4
#define SISPART5
#define SISCAP
#define SISVID
#define SISCOLIDXR
#define SISCOLIDX
#define SISCOLDATA
#define SISCOL2IDX
#define SISCOL2DATA
#define SISPEL
#define SISVGAEN
#define SISDACA
#define SISDACD

/* ioctl related */

/* Structure argument for SISUSB_GET_INFO ioctl  */
struct sisusb_info {};

struct sisusb_command {};

#define SUCMD_GET
#define SUCMD_SET
#define SUCMD_SETOR
#define SUCMD_SETAND
#define SUCMD_SETANDOR
#define SUCMD_SETMASK

#define SUCMD_CLRSCR

#define SUCMD_HANDLETEXTMODE

#define SUCMD_SETMODE
#define SUCMD_SETVESAMODE

#define SISUSB_COMMAND
#define SISUSB_GET_CONFIG_SIZE
#define SISUSB_GET_CONFIG

#endif /* SISUSB_H */