/* 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 <thomas@winischhofer.net> *
*/
/* Size of the sisusb input/output buffers */ #define SISUSB_IBUF_SIZE 0x01000 #define SISUSB_OBUF_SIZE 0x10000 /* fixed */
#define NUMOBUFS 8 /* max number of output buffers/output URBs */
/* 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. *
*/
struct sisusb_urb_context { /* urb->context for outbound bulk URBs */ struct sisusb_usb_data *sisusb; int urbindex; int *actual_length;
};
struct sisusb_usb_data { struct usb_device *sisusb_dev; struct usb_interface *interface; struct kref kref;
wait_queue_head_t wait_q; /* for syncind and timeouts */ struct mutex lock; /* general race avoidance */ unsignedint ifnum; /* interface number of the USB device */ int minor; /* minor (for logging clarity) */ int isopen; /* !=0 if open */ int present; /* !=0 if device is present on the bus */ int ready; /* !=0 if device is ready for userland */ int numobufs; /* number of obufs = number of out urbs */ char *obuf[NUMOBUFS], *ibuf; /* transfer buffers */ int obufsize, ibufsize; struct urb *sisurbout[NUMOBUFS]; struct urb *sisurbin; unsignedchar urbstatus[NUMOBUFS]; unsignedchar completein; struct sisusb_urb_context urbout_context[NUMOBUFS]; unsignedlong flagb0; unsignedlong vrambase; /* framebuffer base */ unsignedint vramsize; /* framebuffer size (bytes) */ unsignedlong mmiobase; unsignedint mmiosize; unsignedlong ioportbase; unsignedchar devinit; /* device initialized? */ unsignedchar gfxinit; /* graphics core initialized? */ unsignedshort chipid, chipvendor; unsignedshort chiprevision;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.