From: Sascha Wildner Date: Thu, 21 Jul 2011 08:19:04 +0000 (+0200) Subject: kernel: Remove some old ISA only drivers. X-Git-Tag: v2.12.0~304 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/ad9f8794f2f018b4187756bfd362eed57d8498ea kernel: Remove some old ISA only drivers. This commits removes the following old ISA specific drivers, most of which have been removed in FreeBSD, too: aha(4) - Adaptec 154xA, 154xB, 154xC, 154xCF and 154xCP SCSI cards asc(4) - GI1904-based hand scanner ctx - ImageNation CORTEX-I Frame Grabber dgb(4) - DigiBoard serial cards (digi(4) driver remains) el(4) - 3Com Etherlink 3C501 NIC gpib - National Instruments AT-GPIB and AT-GPIB/TNT boards gsc(4) - Genius GS-4500 hand scanner ie(4) - Intel i82586 based 8 and 16 bit ISA ethernet cards labpc(4) - National Instruments LABPC and LABPC+ driver le(4) - DEC EtherWORKS II/III ethernet cards mse(4) - Bus and InPort mouse driver rc(4) - RISCom/8 multiport serial cards rdp(4) - RealTek RTL8002 based pocket ethernet adapters spigot - Creative Labs Spigot video acquisition board tw(4) - TW-523 X-10 interface wl(4) - T1 speed ISA/radio LAN card wt(4) - Archive/Wangtek cartridge tape driver Along with those, a number of associated programs are removed, too: sasc(1) sgsc(1) wlconfig(8) xten(1) xtend(8) --- diff --git a/Makefile_upgrade.inc b/Makefile_upgrade.inc index 6310e1ff32..c14cef1431 100644 --- a/Makefile_upgrade.inc +++ b/Makefile_upgrade.inc @@ -1683,15 +1683,55 @@ TO_REMOVE+=/usr/share/man/cat1/strip217.1.gz TO_REMOVE+=/usr/share/man/man1/strip217.1.gz TO_REMOVE+=/usr/share/man/cat4/i386/est.4.gz TO_REMOVE+=/usr/share/man/man4/i386/est.4.gz - -.if ${MACHINE_ARCH} == "x86_64" -TO_REMOVE+=/usr/sbin/sgsc -TO_REMOVE+=/usr/share/man/cat1/sgsc.1.gz -TO_REMOVE+=/usr/share/man/man1/sgsc.1.gz +TO_REMOVE+=/boot/kernel/aha.ko +TO_REMOVE+=/usr/bin/sasc +TO_REMOVE+=/usr/include/machine/asc_ioctl.h TO_REMOVE+=/usr/include/machine/gsc.h +TO_REMOVE+=/usr/include/machine/spigot.h +TO_REMOVE+=/usr/libexec/xtend +TO_REMOVE+=/usr/sbin/sgsc +TO_REMOVE+=/usr/sbin/wlconfig TO_REMOVE+=/usr/sbin/xten +TO_REMOVE+=/usr/share/man/cat1/sasc.1.gz +TO_REMOVE+=/usr/share/man/cat1/sgsc.1.gz TO_REMOVE+=/usr/share/man/cat1/xten.1.gz +TO_REMOVE+=/usr/share/man/cat4/aha.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386.asc.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386.dgb.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386/el.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386/gsc.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386/ie.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386/labpc.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386/le.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386/mse.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386.rc.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386/rdp.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386.tw.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386/wl.4.gz +TO_REMOVE+=/usr/share/man/cat4/i386/wt.4.gz +TO_REMOVE+=/usr/share/man/cat8/wlconfig.8.gz +TO_REMOVE+=/usr/share/man/cat8/xtend.8.gz +TO_REMOVE+=/usr/share/man/man1/sasc.1.gz +TO_REMOVE+=/usr/share/man/man1/sgsc.1.gz TO_REMOVE+=/usr/share/man/man1/xten.1.gz +TO_REMOVE+=/usr/share/man/man4/aha.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/asc.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/dgb.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/el.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/gsc.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/ie.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/labpc.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/le.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/mse.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/rc.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/rdp.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/tw.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/wl.4.gz +TO_REMOVE+=/usr/share/man/man4/i386/wt.4.gz +TO_REMOVE+=/usr/share/man/man8/wlconfig.8.gz +TO_REMOVE+=/usr/share/man/man8/xten.8.gz + +.if ${MACHINE_ARCH} == "x86_64" TO_REMOVE+=/usr/libdata/stallion/2681.sys TO_REMOVE+=/usr/libdata/stallion/cdk.sys TO_REMOVE+=/usr/sbin/stlload diff --git a/etc/devd.conf b/etc/devd.conf index f8b5464c6f..327f37e638 100644 --- a/etc/devd.conf +++ b/etc/devd.conf @@ -18,7 +18,7 @@ options { # Setup some shorthand for regex that we use later in the file. #XXX Yes, these are gross -- imp set scsi-controller-regex - "(aac|adv|adw|aha|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\ + "(aac|adv|adw|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\ esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\ [0-9]+"; }; diff --git a/lib/libc/net/if_indextoname.3 b/lib/libc/net/if_indextoname.3 index a4d133e27a..5c28f3dfbf 100644 --- a/lib/libc/net/if_indextoname.3 +++ b/lib/libc/net/if_indextoname.3 @@ -23,7 +23,6 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/lib/libc/net/if_indextoname.3,v 1.11 2005/11/23 10:49:07 ru Exp $ -.\" $DragonFly: src/lib/libc/net/if_indextoname.3,v 1.5 2007/08/18 20:48:47 swildner Exp $ .\" .Dd November 23, 2005 .Dt IF_NAMETOINDEX 3 @@ -84,7 +83,7 @@ The structure contains at least the following entries: .Bd -literal unsigned int if_index; /* 1, 2, ... */ - char *if_name; /* null terminated name: "le0", ... */ + char *if_name; /* null terminated name: "lnc0", ... */ .Ed .Pp The end of the array of structures is indicated by a structure with an diff --git a/lib/libc/net/linkaddr.3 b/lib/libc/net/linkaddr.3 index ffe942e2f9..23f55e09e6 100644 --- a/lib/libc/net/linkaddr.3 +++ b/lib/libc/net/linkaddr.3 @@ -30,7 +30,6 @@ .\" .\" From: @(#)linkaddr.3 8.1 (Berkeley) 7/28/93 .\" $FreeBSD: src/lib/libc/net/linkaddr.3,v 1.16 2007/02/28 21:18:38 bms Exp $ -.\" $DragonFly: src/lib/libc/net/linkaddr.3,v 1.3 2008/11/23 21:55:52 swildner Exp $ .\" .Dd February 28, 2007 .Dt LINK_ADDR 3 @@ -90,7 +89,7 @@ low order bytes through high order bytes. .\" .Ed .\" .Pp Thus -.Li le0:8.0.9.13.d.30 +.Li lnc0:8.0.9.13.d.30 represents an ethernet address to be transmitted on the first Lance ethernet interface. .Sh RETURN VALUES diff --git a/lib/libstand/globals.c b/lib/libstand/globals.c index c35021c9e2..711a028871 100644 --- a/lib/libstand/globals.c +++ b/lib/libstand/globals.c @@ -22,7 +22,7 @@ char hostname[FNAME_SIZE]; /* our hostname */ int hostnamelen; char domainname[FNAME_SIZE]; /* our DNS domain */ int domainnamelen; -char ifname[IFNAME_SIZE]; /* name of interface (e.g. "le0") */ +char ifname[IFNAME_SIZE]; /* name of interface (e.g. "lnc0") */ struct in_addr myip; /* my ip address */ struct in_addr nameip; /* DNS server ip address */ struct in_addr rootip; /* root ip address */ diff --git a/libexec/Makefile b/libexec/Makefile index 4b158f1459..035232761a 100644 --- a/libexec/Makefile +++ b/libexec/Makefile @@ -1,6 +1,5 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD: src/libexec/Makefile,v 1.42.2.5 2002/11/12 17:32:48 obrien Exp $ -# $DragonFly: src/libexec/Makefile,v 1.13 2008/02/02 18:20:51 matthias Exp $ # Present but disabled: kpasswdd SUBDIR= atrun \ @@ -30,7 +29,6 @@ SUBDIR= atrun \ telnetd \ tftpd \ utmp_update \ - xtend \ ypxfr .if !defined(NO_SENDMAIL) diff --git a/libexec/xtend/Makefile b/libexec/xtend/Makefile deleted file mode 100644 index dc4a763d7b..0000000000 --- a/libexec/xtend/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# Makefile for xtend (Stark) 10/30/93 -# $FreeBSD: src/libexec/xtend/Makefile,v 1.7.2.1 2001/04/25 10:41:03 ru Exp $ - -BINMODE= 555 - -PROG= xtend -SRCS= xtend.c status.c packet.c user.c -WARNS?= 1 - -CFLAGS+= -DXTENUNAME=\"xten\" -DXTENGNAME=\"xten\" -DPADD= ${LIBUTIL} -LDADD= -lutil - -MAN= xtend.8 - -.include diff --git a/libexec/xtend/packet.c b/libexec/xtend/packet.c deleted file mode 100644 index 7783f15b7c..0000000000 --- a/libexec/xtend/packet.c +++ /dev/null @@ -1,322 +0,0 @@ -/*- - * Copyright (c) 1992, 1993, 1995 Eugene W. Stark - * 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 Eugene W. Stark. - * 4. 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 EUGENE W. STARK (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: src/libexec/xtend/packet.c,v 1.8 1999/08/28 00:10:30 peter Exp $ - * $DragonFly: src/libexec/xtend/packet.c,v 1.2 2003/06/17 04:27:08 dillon Exp $ - */ - -#include -#include -#include "xtend.h" -#include "xten.h" - -char *X10housenames[] = { - "A", "B", "C", "D", "E", "F", "G", "H", - "I", "J", "K", "L", "M", "N", "O", "P", - NULL -}; - -char *X10cmdnames[] = { - "1", "2", "3", "4", "5", "6", "7", "8", - "9", "10", "11", "12", "13", "14", "15", "16", - "AllUnitsOff", "AllLightsOn", "On", "Off", "Dim", "Bright", "AllLightsOff", - "ExtendedCode", "HailRequest", "HailAcknowledge", "PreSetDim0", "PreSetDim1", - "ExtendedData", "StatusOn", "StatusOff", "StatusRequest", - NULL -}; - -/* - * Log a packet and update device status accordingly - */ - -void -logpacket(p) -unsigned char *p; -{ - fprintf(Log, "%s: %s %s ", thedate(), - X10housenames[p[1]], X10cmdnames[p[2]]); - if(p[0] & TW_RCV_LOCAL) fprintf(Log, "(loc,"); - else fprintf(Log, "(rem,"); - if(p[0] & TW_RCV_ERROR) fprintf(Log, "err)"); - else fprintf(Log, " ok)"); - fprintf(Log, "\n"); -} - -/* - * Process a received packet p, updating device status information both - * in core and on disk. - */ - -void -processpacket(p) -unsigned char *p; -{ - int i, j, h, k; - STATUS *s; - - /* - * If the packet had the error flag set, there is no other useful info. - */ - if(p[0] & TW_RCV_ERROR) return; - /* - * First update in-core status information for the device. - */ - h = p[1]; k = p[2]; - if(k < 16) { /* We received a unit code, to select a particular device */ - s = &Status[h][k]; - s->selected = SELECTED; - s->lastchange = time(NULL); - s->changed = 1; - } else { /* We received a key code, to execute some function */ - /* - * Change in status depends on the key code received - */ - if(k == DIM) { - /* - * We can't really track DIM/BRIGHT properly the way things are right - * now. The TW523 reports the first, fourth, seventh, etc. Dim packet. - * We don't really have any way to tell when gaps occur, to cancel - * selection. For now, we'll assume that successive sequences of - * Dim/Bright commands are never transmitted without some other - * intervening command, and we make a good guess about how many units of - * dim/bright are represented by each packet actually reported by the - * TW523. - */ - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - switch(s->selected) { - case SELECTED: /* Selected, but not being dimmed or brightened */ - if(s->onoff == 0) { - s->onoff = 1; - s->brightness = 15; - } - s->brightness -= 2; - if(s->brightness < 0) s->brightness = 0; - s->selected = DIMMING; - s->lastchange = time(NULL); - s->changed = 1; - break; - case DIMMING: /* Selected and being dimmed */ - s->brightness -=3; - if(s->brightness < 0) s->brightness = 0; - s->lastchange = time(NULL); - s->changed = 1; - break; - case BRIGHTENING: /* Selected and being brightened (an error) */ - s->selected = IDLE; - s->lastchange = time(NULL); - s->changed = 1; - break; - default: - break; - } - } - } else if(k == BRIGHT) { - /* - * Same problem here... - */ - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - switch(s->selected) { - case SELECTED: /* Selected, but not being dimmed or brightened */ - if(s->onoff == 0) { - s->onoff = 1; - s->brightness = 15; - } - s->brightness += 2; - if(s->brightness > 15) s->brightness = 15; - s->selected = BRIGHTENING; - s->lastchange = time(NULL); - s->changed = 1; - break; - case DIMMING: /* Selected and being dimmed (an error) */ - s->selected = IDLE; - s->lastchange = time(NULL); - s->changed = 1; - break; - case BRIGHTENING: /* Selected and being brightened */ - s->brightness +=3; - if(s->brightness > 15) s->brightness = 15; - s->lastchange = time(NULL); - s->changed = 1; - break; - default: - break; - } - } - } else { /* Other key codes besides Bright and Dim */ - /* - * We cancel brightening and dimming on ALL units on ALL house codes, - * because the arrival of a different packet indicates a gap that - * terminates any prior sequence of brightening and dimming - */ - for(j = 0; j < 16; j++) { - for(i = 0; i < 16; i++) { - s = &Status[j][i]; - if(s->selected == BRIGHTENING || s->selected == DIMMING) { - s->selected = IDLE; - s->lastchange = time(NULL); - s->changed = 1; - } - } - } - switch(k) { - case ALLUNITSOFF: - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - s->onoff = 0; - s->selected = IDLE; - s->brightness = 0; - s->lastchange = time(NULL); - s->changed = 1; - } - break; - case ALLLIGHTSON: - /* Does AllLightsOn cancel selectedness of non-lights? */ - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - if(s->devcap & ISLIGHT) { - s->onoff = 1; - s->selected = IDLE; - s->brightness = 15; - s->lastchange = time(NULL); - s->changed = 1; - } - } - break; - case UNITON: - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - if(s->selected == SELECTED) { - s->onoff = 1; - s->selected = IDLE; - s->brightness = 15; - s->lastchange = time(NULL); - s->changed = 1; - } - } - break; - case UNITOFF: - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - if(s->selected == SELECTED) { - s->onoff = 0; - s->selected = IDLE; - s->lastchange = time(NULL); - s->changed = 1; - } - } - break; - case ALLLIGHTSOFF: - /* Does AllLightsOff cancel selectedness of non-lights? */ - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - if(s->devcap & ISLIGHT) { - s->onoff = 0; - s->selected = IDLE; - s->lastchange = time(NULL); - s->changed = 1; - } - } - break; - case EXTENDEDCODE: - break; - case HAILREQUEST: - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - if(s->selected == SELECTED) { - s->selected = HAILED; - s->lastchange = time(NULL); - s->changed = 1; - } - } - break; - case HAILACKNOWLEDGE: - /* Do these commands cancel selection of devices not affected? */ - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - if(s->selected == HAILED) { - s->selected = IDLE; - s->lastchange = time(NULL); - s->changed = 1; - } - } - break; - case PRESETDIM0: - case PRESETDIM1: - /* I don't really understand these */ - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - if(s->selected == SELECTED) { - s->selected = IDLE; - s->lastchange = time(NULL); - s->changed = 1; - } - } - break; - case EXTENDEDDATA: - /* Who knows? The TW523 can't receive these anyway. */ - break; - case STATUSON: - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - if(s->selected == REQUESTED) { - s->onoff = 1; - s->selected = IDLE; - s->lastchange = time(NULL); - s->changed = 1; - } - } - break; - case STATUSOFF: - for(i = 0; i < 16; i++) { - if(s->selected == REQUESTED) { - s = &Status[h][i]; - s->onoff = 0; - s->selected = IDLE; - s->brightness = 0; - s->lastchange = time(NULL); - s->changed = 1; - } - } - case STATUSREQUEST: - for(i = 0; i < 16; i++) { - s = &Status[h][i]; - if(s->selected) { - s->selected = REQUESTED; - s->lastchange = time(NULL); - s->changed = 1; - } - } - break; - } - } - } -} diff --git a/libexec/xtend/paths.h b/libexec/xtend/paths.h deleted file mode 100644 index 152126ec86..0000000000 --- a/libexec/xtend/paths.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Pathnames for files used by xtend - * - * $FreeBSD: src/libexec/xtend/paths.h,v 1.6 1999/08/28 00:10:30 peter Exp $ - * $DragonFly: src/libexec/xtend/paths.h,v 1.2 2003/06/17 04:27:08 dillon Exp $ - */ - -#define X10DIR "/var/spool/xten" -#define X10LOGNAME "Log" -#define X10STATNAME "Status" -#define X10DUMPNAME "status.out" -#define TWPATH "/dev/tw0" -#define SOCKPATH "/var/run/tw523" -#define PIDPATH "/var/run/xtend.pid" diff --git a/libexec/xtend/status.c b/libexec/xtend/status.c deleted file mode 100644 index d28df434ae..0000000000 --- a/libexec/xtend/status.c +++ /dev/null @@ -1,114 +0,0 @@ -/*- - * Copyright (c) 1992, 1993, 1995 Eugene W. Stark - * 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 Eugene W. Stark. - * 4. 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 EUGENE W. STARK (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: src/libexec/xtend/status.c,v 1.8 1999/08/28 00:10:30 peter Exp $ - * $DragonFly: src/libexec/xtend/status.c,v 1.3 2003/11/14 03:54:32 dillon Exp $ - */ - -#include -#include -#include -#include -#include "xtend.h" -#include "xten.h" -#include "paths.h" - -void printstatus (FILE *, STATUS *); - -/* - * Initialize the status table from the status files - */ - -void -initstatus() -{ - if(lseek(status, 0, SEEK_SET) != 0) { - fprintf(Log, "%s: Seek error on status file\n", thedate()); - return; - } - if(read(status, Status, 16*16*sizeof(STATUS)) != 16*16*sizeof(STATUS)) { - fprintf(Log, "%s: Read error on status file\n", thedate()); - return; - } -} - -/* - * Checkpoint status of any devices whose status has changed - * and notify anyone monitoring those devices. - */ - -void -checkpoint_status() -{ - int h, i, k, offset; - - offset = 0; - for(h = 0; h < 16; h++) { - for(i = 0; i < 16; i++) { - if(Status[h][i].changed) { - if(lseek(status, offset, SEEK_SET) != offset) { - fprintf(Log, "%s: Seek error on status file\n", thedate()); - } else { - if(write(status, &Status[h][i], sizeof(STATUS)) != sizeof(STATUS)) { - fprintf(Log, "%s: Write error on status file\n", thedate()); - } - } - Status[h][i].changed = 0; - for(k = 0; k < MAXMON; k++) { - if(Monitor[k].inuse - && Monitor[k].house == h && Monitor[k].unit == i) { - /* - * Arrange to catch SIGPIPE in case client has gone away. - */ - extern int client; - extern void clientgone(); - void (*prev)(); - - client = k; - prev = signal(SIGPIPE, clientgone); - printstatus(Monitor[k].user, &Status[h][i]); - fflush(Monitor[k].user); - signal(SIGPIPE, prev); - } - } - } - offset += sizeof(STATUS); - } - } -} - -int client; - -void clientgone() -{ - fprintf(Log, "%s: Deleting monitor table entry %d, client gone\n", thedate(), client); - fclose(Monitor[client].user); - Monitor[client].inuse = 0; -} diff --git a/libexec/xtend/user.c b/libexec/xtend/user.c deleted file mode 100644 index cc8cd1ebe8..0000000000 --- a/libexec/xtend/user.c +++ /dev/null @@ -1,186 +0,0 @@ -/*- - * Copyright (c) 1992, 1993, 1995 Eugene W. Stark - * 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 Eugene W. Stark. - * 4. 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 EUGENE W. STARK (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: src/libexec/xtend/user.c,v 1.9 1999/08/28 00:10:30 peter Exp $ - * $DragonFly: src/libexec/xtend/user.c,v 1.3 2003/11/14 03:54:32 dillon Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include "xtend.h" -#include "xten.h" -#include "paths.h" - -MONENTRY Monitor[MAXMON]; - -int find (char *, char *[]); -void printstatus (FILE *, STATUS *); - -/* - * Process a user command - */ - -int -user_command() -{ - char h; - char *m; - int i, k, n, error; - char cmd[512], dumppath[MAXPATHLEN+1], pkt[3]; - FILE *dumpf; - - error = 0; - if(fgets(cmd, 512, User) != NULL) { - m = cmd; - while ( *m != '\0' ) { - if(isupper(*m)) - *m = tolower(*m); - m++; - } - if(sscanf(cmd, "status %c %d", &h, &i) == 2 - && h >= 'a' && h <= 'p' && i >= 1 && i <= 16) { - h -= 'a'; - i--; - printstatus(User, &Status[h][i]); - } else if(sscanf(cmd, "send %c %s %d", &h, cmd, &n) == 3 - && h >= 'a' && h <= 'p' && (i = find(cmd, X10cmdnames)) >= 0) { - h -= 'a'; - pkt[0] = h; - pkt[1] = i; - pkt[2] = n; - if(write(tw523, pkt, 3) != 3) { - fprintf(Log, "%s: Transmission error (packet [%s %s]:%d).\n", - thedate(), X10housenames[h], X10cmdnames[i], n); - error++; - } else { - fprintf(User, "OK\n"); - } - } else if(!strcmp("dump\n", cmd)) { - strcpy(dumppath, X10DIR); - strcat(dumppath, "/"); - strcat(dumppath, X10DUMPNAME); - if((dumpf = fopen(dumppath, "w")) != NULL) { - for(h = 0; h < 16; h++) { - for(i = 0; i < 16; i++) { - if(Status[h][i].lastchange) { - fprintf(dumpf, "%s%d\t", X10housenames[h], i+1); - printstatus(dumpf, &Status[h][i]); - } - } - } - fclose(dumpf); - fprintf(User, "OK\n"); - } else { - error++; - } - } else if(sscanf(cmd, "monitor %c %d", &h, &i) == 2 - && h >= 'a' && h <= 'p' && i >= 1 && i <= 16) { - h -= 'a'; - i--; - for(k = 0; k < MAXMON; k++) { - if(!Monitor[k].inuse) break; - } - if(k == MAXMON) { - error++; - } else { - Monitor[k].house = h; - Monitor[k].unit = i; - Monitor[k].user = User; - Monitor[k].inuse = 1; - fprintf(Log, "%s: Adding %c %d to monitor list (entry %d)\n", - thedate(), h+'A', i+1, k); - fprintf(User, "OK\n"); - fflush(User); - User = NULL; - return(0); /* We don't want caller to close stream */ - } - } else if(!strcmp("done\n", cmd)) { - fprintf(User, "OK\n"); - fflush(User); - return(1); - } else { - if(feof(User)) { - return(1); - } else { - error++; - } - } - } else { - error++; - } - if(error) { - fprintf(User, "ERROR\n"); - } - fflush(User); - return(0); -} - -int -find(s, tab) -char *s; -char *tab[]; -{ - int i; - - for(i = 0; tab[i] != NULL; i++) { - if(strcasecmp(s, tab[i]) == 0) return(i); - } - return(-1); -} - -void -printstatus(f, s) -FILE *f; -STATUS *s; -{ - fprintf(f, "%s:%d", s->onoff ? "On" : "Off", s->brightness); - switch(s->selected) { - case IDLE: - fprintf(f, " (normal) "); break; - case SELECTED: - fprintf(f, " (selected) "); break; - case DIMMING: - fprintf(f, " (dimming) "); break; - case BRIGHTENING: - fprintf(f, " (brightening) "); break; - case REQUESTED: - fprintf(f, " (requested) "); break; - case HAILED: - fprintf(f, " (hailed) "); break; - default: - fprintf(f, " (bogus) "); break; - } - fprintf(f, "%s", ctime(&s->lastchange)); -} - diff --git a/libexec/xtend/xten.h b/libexec/xtend/xten.h deleted file mode 100644 index 0d9d5d92ac..0000000000 --- a/libexec/xtend/xten.h +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * Copyright (c) 1992, 1993, 1995 Eugene W. Stark - * 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 Eugene W. Stark. - * 4. 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 EUGENE W. STARK (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: src/libexec/xtend/xten.h,v 1.6 1999/08/28 00:10:31 peter Exp $ - * $DragonFly: src/libexec/xtend/xten.h,v 1.2 2003/06/17 04:27:08 dillon Exp $ - */ - -extern char *X10housenames[]; -extern char *X10cmdnames[]; - -#define ALLUNITSOFF 16 -#define ALLLIGHTSON 17 -#define UNITON 18 -#define UNITOFF 19 -#define DIM 20 -#define BRIGHT 21 -#define ALLLIGHTSOFF 22 -#define EXTENDEDCODE 23 -#define HAILREQUEST 24 -#define HAILACKNOWLEDGE 25 -#define PRESETDIM0 26 -#define PRESETDIM1 27 -#define EXTENDEDDATA 28 -#define STATUSON 29 -#define STATUSOFF 30 -#define STATUSREQUEST 31 - -/* - * Flags for first byte of received packet - */ - -#define TW_RCV_LOCAL 1 /* The packet arrived during a local transmission */ -#define TW_RCV_ERROR 2 /* An invalid/corrupted packet was received */ - diff --git a/libexec/xtend/xtend.8 b/libexec/xtend/xtend.8 deleted file mode 100644 index 4c4f095854..0000000000 --- a/libexec/xtend/xtend.8 +++ /dev/null @@ -1,174 +0,0 @@ -.\" Copyright (c) 1992, 1993 Eugene W. Stark -.\" 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 Eugene W. Stark. -.\" 4. 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 EUGENE W. STARK (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: src/libexec/xtend/xtend.8,v 1.11.2.4 2001/08/16 10:44:22 ru Exp $ -.\" $DragonFly: src/libexec/xtend/xtend.8,v 1.4 2007/12/16 02:55:38 thomas Exp $ -.\" -.Dd October 30, 1993 -.Dt XTEND 8 -.Os -.Sh NAME -.Nm xtend -.Nd X-10 daemon -.Sh SYNOPSIS -.Nm /usr/libexec/xtend -.Sh DESCRIPTION -.Nm Xtend -interfaces between user-level programs and the TW523 X-10 controller. -It logs all packets received from the TW523, attempts to track the -status of all X-10 devices, and accepts socket connections from user-level -client programs that need to manipulate X-10 devices. -.Pp -When -.Nm -is started, it forks, releases the controlling terminal, then opens -its log file, where it subsequently records all X-10 activity and -diagnostic messages. It then begins processing packets received from -the TW523 and accepting connections one at a time from clients -wishing to issue X-10 commands. -.Pp -Sending -.Nm -a -.Dv SIGHUP -causes it to close and reopen its log file. This is useful -in shell scripts that rotate the log files to keep them from growing -indefinitely. -If -.Nm -receives a -.Dv SIGTERM , -it shuts down gracefully and exits. -A -.Dv SIGPIPE -causes -.Nm -to abort the current client connection. -.Pp -.Nm Xtend -communicates with client processes by a simple protocol in which a one-line -command is sent by the client, and is acknowledged by a one-line response -from the daemon. -.Pp -.Nm Xtend -understands four types of commands: -.Bl -tag -width "monitor H U" -.It Ic status Ar H U -where -.Ar H -is a single letter house code, and -.Ar U -is a numeric unit code, -causes -.Nm -to respond with one line of status information about the specified device. -.It Ic send Ar H U N -where -.Ar H -is a single-letter house code, -.Ar U -is either a numeric unit code -or a function code (see source file -.Pa xtend/packet.c ) -for a list, and -.Ar N -is a number indicating the number of times (usually 2) -the packet is to be transmitted without gaps, -causes -.Nm -to perform the specified X-10 transmission. If the transmission was apparently -successful, a single-line response containing -.Sy OK -is issued, otherwise a single-line response containing -.Sy ERROR -is produced. -.It Ic dump -causes -.Nm -to dump the current status of all devices to an -.Tn ASCII -file in the spool -directory. The response -.Sy OK -is issued, regardless of whether the status dump was successful. -.It Ic monitor Ar H U -causes -.Nm -to add the current client socket connection to a list of clients that are to -be notified about activity concerning the specified X-10 device. -The single-line acknowledgement -.Sy OK -is returned if the maximum (currently 5) number of such clients was not -exceeded, otherwise -.Sy ERROR -is returned. -.Nm Xtend -then returns to its normal mode of accepting connections from clients. -However, each subsequent change in the status of the specified device will -cause -.Nm -to write one line of status information for the device (in the same -format as produced by the -.Ic status -command) to the saved socket. This feature is useful for writing programs -that need to monitor the activity of devices, like motion detectors, that can -perform X-10 transmissions. -.El -.Sh OPTIONS -None. -.Sh FILES -.Bl -tag -width /var/spool/xten/status.out -compact -.It Pa /dev/tw0 -the TW523 special file -.It Pa /var/run/tw523 -socket for client connections -.It Pa /var/run/xtend.pid -pid file -.It Pa /var/spool/xten/Log -log file -.It Pa /var/spool/xten/Status -device status file (binary) -.It Pa /var/spool/xten/status.out -.Tn ASCII -dump of device status -.El -.Sh SEE ALSO -.Xr xten 1 , -.Xr tw 4 -.Sh AUTHORS -.An Eugene W. Stark Aq stark@cs.sunysb.edu -.Sh BUGS -There is currently no timeout on client socket connections, so a hung -client program can prevent other clients from accessing the daemon. -.Pp -.Nm Xtend -does the best it can at trying to track device status, but there is -usually no way it can tell when a device has been operated manually. -This is due to the fact that most X-10 devices are not able to -respond to queries about their status. diff --git a/libexec/xtend/xtend.c b/libexec/xtend/xtend.c deleted file mode 100644 index 70ba91c101..0000000000 --- a/libexec/xtend/xtend.c +++ /dev/null @@ -1,366 +0,0 @@ -/*- - * Copyright (c) 1992, 1993, 1995 Eugene W. Stark - * 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 Eugene W. Stark. - * 4. 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 EUGENE W. STARK (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: src/libexec/xtend/xtend.c,v 1.9 1999/08/28 00:10:31 peter Exp $ - * $DragonFly: src/libexec/xtend/xtend.c,v 1.3 2003/11/14 03:54:32 dillon Exp $ - */ - -/* - * xtend - X-10 daemon - * Eugene W. Stark (stark@cs.sunysb.edu) - * January 14, 1993 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "xtend.h" -#include "xten.h" -#include "paths.h" - -FILE *Log; /* Log file */ -FILE *User; /* User connection */ -STATUS Status[16][16]; /* Device status table */ -int status; /* Status file descriptor */ -int tw523; /* tw523 controller */ -int sock; /* socket for user */ -jmp_buf mainloop; /* longjmp point after SIGHUP */ -void onhup(); /* SIGHUP handler */ -void onterm(); /* SIGTERM handler */ -void onpipe(); /* SIGPIPE handler */ - -void checkpoint_status (void); -void initstatus (void); -void logpacket (unsigned char *); -void processpacket (unsigned char *); -int user_command (void); - -int -main(argc, argv) -int argc; -char *argv[]; -{ - char *twpath = TWPATH; - char *sockpath = SOCKPATH; - char logpath[MAXPATHLEN+1]; - char statpath[MAXPATHLEN+1]; - struct sockaddr_un sa; - struct timeval tv; - struct passwd *pw; - struct group *gr; - struct stat sb; - int user; - FILE *pidf; - - /* - * Make sure we start out running as root - */ - if(geteuid() != 0) - errx(1, "you must be root"); - - /* - * Find out what UID/GID we are to run as - */ - if((pw = getpwnam(XTENUNAME)) == NULL) - errx(1, "no such user '%s'", XTENUNAME); - if((gr = getgrnam(XTENGNAME)) == NULL) - errx(1, "no such group '%s'", XTENGNAME); - - /* - * Open the log file before doing anything else - */ - strcpy(logpath, X10DIR); - if(stat(logpath, &sb) == -1 && errno == ENOENT) { - if(mkdir(logpath, 0755) != -1) { - chown(logpath, pw->pw_uid, gr->gr_gid); - } else { - errx(1, "can't create directory '%s'", logpath); - } - } - strcat(logpath, "/"); - strcat(logpath, X10LOGNAME); - if((Log = fopen(logpath, "a")) == NULL) - errx(1, "can't open log file '%s'", logpath); - chown(logpath, pw->pw_uid, gr->gr_gid); - - /* - * Become a daemon - */ - if(daemon(0, 0) == -1) { - fprintf(Log, "%s: Unable to become a daemon\n", thedate()); - fclose(Log); - exit(1); - } - fprintf(Log, "%s: %s [%d] started\n", thedate(), argv[0], getpid()); - - /* - * Get ahold of the TW523 device - */ - if((tw523 = open(twpath, O_RDWR)) < 0) { - fprintf(Log, "%s: Can't open %s\n", thedate(), twpath); - fclose(Log); - exit(1); - } - fprintf(Log, "%s: %s successfully opened\n", thedate(), twpath); - - /* - * Put our pid in a file so we can be signalled by shell scripts - */ - if((pidf = fopen(PIDPATH, "w")) == NULL) { - fprintf(Log, "%s: Error writing pid file: %s\n", thedate(), PIDPATH); - fclose(Log); - exit(1); - } - fprintf(pidf, "%d\n", getpid()); - fclose(pidf); - - /* - * Set up socket to accept user commands - */ - if((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) { - fprintf(Log, "%s: Can't create socket\n", thedate()); - fclose(Log); - exit(1); - } - strcpy(sa.sun_path, sockpath); - sa.sun_family = AF_UNIX; - unlink(sockpath); - if(bind(sock, (struct sockaddr *)(&sa), strlen(sa.sun_path) + 2) < 0) { - fprintf(Log, "%s: Can't bind socket to %s\n", thedate(), sockpath); - fclose(Log); - exit(1); - } - if(listen(sock, 5) < 0) { - fprintf(Log, "%s: Can't listen on socket\n", thedate()); - fclose(Log); - exit(1); - } - - /* - * Set proper ownership and permissions on the socket - */ - if(chown(sockpath, pw->pw_uid, gr->gr_gid) == -1 || - chmod(sockpath, 0660) == -1) { - fprintf(Log, "%s: Can't set owner/permissions on socket\n", thedate()); - fclose(Log); - exit(1); - } - - /* - * Give up root privileges - */ - setgid(pw->pw_gid); - setuid(pw->pw_uid); - - /* - * Initialize the status table - */ - strcpy(statpath, X10DIR); - strcat(statpath, "/"); - strcat(statpath, X10STATNAME); - if((status = open(statpath, O_RDWR)) < 0) { - if((status = open(statpath, O_RDWR | O_CREAT, 0666)) < 0) { - fprintf(Log, "%s: Can't open %s\n", thedate(), statpath); - fclose(Log); - exit(1); - } - if(write(status, Status, 16 * 16 * sizeof(STATUS)) - != 16 * 16 * sizeof(STATUS)) { - fprintf(Log, "%s: Error initializing status file\n", thedate()); - fclose(Log); - exit(1); - } - } - initstatus(); - - /* - * Return here on SIGHUP after closing and reopening log file. - * Also on SIGPIPE after closing user connection. - */ - signal(SIGTERM, onterm); - signal(SIGHUP, onhup); - signal(SIGPIPE, onpipe); - setjmp(mainloop); - - /* - * Now start the main processing loop. - */ - tv.tv_sec = 0; - tv.tv_usec = 250000; - while(1) { - fd_set fs; - unsigned char rpkt[3]; - int sel, h, k; - STATUS *s; - - FD_ZERO(&fs); - FD_SET(tw523, &fs); - if(User != NULL) FD_SET(user, &fs); - else FD_SET(sock, &fs); - sel = select(FD_SETSIZE, &fs, 0, 0, &tv); - if(sel == 0) { - /* - * Cancel brightening and dimming on ALL units on ALL house codes, - * because the fact that we haven't gotten a packet for awhile means - * that there was a gap in transmission. - */ - for(h = 0; h < 16; h++) { - for(k = 0; k < 16; k++) { - s = &Status[h][k]; - if(s->selected == BRIGHTENING || s->selected == DIMMING) { - s->selected = IDLE; - s->lastchange = time(NULL); - s->changed = 1; - } - } - } - fflush(Log); - checkpoint_status(); - /* - * Now that we've done this stuff, we'll set the timeout a little - * longer, so we don't keep looping too frequently. - */ - tv.tv_sec = 60; - tv.tv_usec = 0; - continue; - } - /* - * While there is stuff happening, we keep a short timeout, so we - * don't get stuck for some unknown reason, and so we can keep the - * brightening and dimming data up-to-date. - */ - tv.tv_sec = 0; - tv.tv_usec = 250000; - if(FD_ISSET(tw523, &fs)) { /* X10 data arriving from TW523 */ - if(read(tw523, rpkt, 3) < 3) { - fprintf(Log, "%s: Error reading from TW523\n", thedate()); - } else { - logpacket(rpkt); - processpacket(rpkt); - } - } else if(FD_ISSET(user, &fs) && User != NULL) { - if(user_command()) { - fprintf(Log, "%s: Closing user connection\n", thedate()); - fclose(User); - User = NULL; - } - } else if(FD_ISSET(sock, &fs)) { /* Accept a connection */ - if (User == NULL) { - int len = sizeof(struct sockaddr_un); - if((user = accept(sock, (struct sockaddr *)(&sa), &len)) >= 0) { - fprintf(Log, "%s: Accepting user connection\n", thedate()); - if((User = fdopen(user, "w+")) == NULL) { - fprintf(Log, "%s: Can't attach socket to stream\n", thedate()); - } - } else { - fprintf(Log, "%s: Failure in attempt to accept connection\n", thedate()); - } - } else { - /* "Can't happen */ - } - } - } - /* Not reached */ -} - -char *thedate() -{ - char *cp, *cp1; - time_t tod; - - tod = time(NULL); - cp = cp1 = ctime(&tod); - while(*cp1 != '\n') cp1++; - *cp1 = '\0'; - return(cp); -} - -/* - * When SIGHUP received, close and reopen the Log file - */ - -void onhup() -{ - char logpath[MAXPATHLEN+1]; - - fprintf(Log, "%s: SIGHUP received, reopening Log\n", thedate()); - fclose(Log); - strcpy(logpath, X10DIR); - strcat(logpath, "/"); - strcat(logpath, X10LOGNAME); - if((Log = fopen(logpath, "a")) == NULL) - errx(1, "can't open log file '%s'", logpath); - longjmp(mainloop, 1); - /* No return */ -} - -/* - * When SIGTERM received, just exit normally - */ - -void onterm() -{ - fprintf(Log, "%s: SIGTERM received, shutting down\n", thedate()); - fclose(Log); - exit(0); -} - -/* - * When SIGPIPE received, reset user connection - */ - -void onpipe() -{ - fprintf(Log, "%s: SIGPIPE received, resetting user connection\n", - thedate()); - if(User != NULL) { - fclose(User); - User = NULL; - } - longjmp(mainloop, 1); - /* No return */ -} diff --git a/libexec/xtend/xtend.h b/libexec/xtend/xtend.h deleted file mode 100644 index 88f7625974..0000000000 --- a/libexec/xtend/xtend.h +++ /dev/null @@ -1,80 +0,0 @@ -/*- - * Copyright (c) 1992, 1993, 1995 Eugene W. Stark - * 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 Eugene W. Stark. - * 4. 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 EUGENE W. STARK (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: src/libexec/xtend/xtend.h,v 1.6 1999/08/28 00:10:31 peter Exp $ - * $DragonFly: src/libexec/xtend/xtend.h,v 1.2 2003/06/17 04:27:08 dillon Exp $ - */ - -/* - * Device capabilities - */ - -#define ISLIGHT 1 /* Is device a light? */ -#define CANQUERY 2 /* Responds to status query */ - -/* - * Device status - */ - -typedef enum { - IDLE, - SELECTED, - DIMMING, - BRIGHTENING, - REQUESTED, - HAILED - } SELECT; - -typedef struct { - unsigned int devcap; /* device capabilities */ - unsigned int changed; /* status changed since last checkpoint? */ - time_t lastchange; /* time status last changed */ - SELECT selected; /* select status of device */ - unsigned int onoff; /* nonzero if on */ - unsigned int brightness; /* value in range 0-15 */ -} STATUS; - -typedef struct { - int inuse; /* Is entry in use? */ - FILE *user; /* Socket to notify user */ - int house; /* House code of device to monitor */ - int unit; /* Unit code of device to monitor */ -} MONENTRY; - -#define MAXMON 5 /* Maximum number of monitor entries */ - -extern FILE *Log; /* Log file */ -extern FILE *User; /* User connection */ -extern STATUS Status[16][16]; /* Device status table */ -extern int status; /* Status file descriptor */ -extern int tw523; /* tw523 controller */ -extern MONENTRY Monitor[MAXMON];/* Monitor table */ - -extern char *thedate(); diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index f967e9a7e6..488cdfa09a 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -18,7 +18,6 @@ MAN= aac.4 \ aesni.4 \ age.4 \ agp.4 \ - aha.4 \ ahc.4 \ ahci.4 \ ahd.4 \ diff --git a/share/man/man4/adv.4 b/share/man/man4/adv.4 index 915f70f9a9..99510ca98a 100644 --- a/share/man/man4/adv.4 +++ b/share/man/man4/adv.4 @@ -146,7 +146,6 @@ the maximum number of tags a device can receive as well as guarantee fair resource allocation among devices. .Sh SEE ALSO .Xr adw 4 , -.Xr aha 4 , .Xr ahc 4 , .Xr cd 4 , .Xr da 4 , diff --git a/share/man/man4/aha.4 b/share/man/man4/aha.4 deleted file mode 100644 index e5df7d9e9c..0000000000 --- a/share/man/man4/aha.4 +++ /dev/null @@ -1,72 +0,0 @@ -.\" -.\" Copyright (c) 1994 Wilko Bulte -.\" 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. 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 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: src/share/man/man4/aha.4,v 1.11.4.6 2001/10/01 13:07:22 dd Exp $ -.\" -.Dd October 15, 1998 -.Dt AHA 4 -.Os -.Sh NAME -.Nm aha -.Nd Adaptec SCSI host adapter driver -.Sh SYNOPSIS -.Cd device "aha0 at isa? port ? irq ? drq 5" -.Cd device scbus0 at aha0 -.Sh DESCRIPTION -This driver provides access to the -.Tn SCSI -bus connected to an Adaptec 154xA, 154xB, 154xC, 154xCF, or 154xCP -host adapter. Host adapters supporting a 154X compatible interface, -such as some Tekram controllers and the Adaptec 174x in 154x -emulation mode can also be attached with this driver. -.Pp -One kernel config entry for every card to be attached by the system is -required. Specific values for the port address, irq, and drq may be -specified. If wildcard values are used, the driver will query the -device for its current settings and use those. If the port address -is a wildcard, the driver consults an internal table of possible port address -locations and attaches to the first unattached card it finds. The possible -port addresses for this card are 0x330, 0x334, 0x230, 0x234, 0x130, and -0x134. -.Sh SEE ALSO -.Xr ahc 4 , -.Xr cd 4 , -.Xr da 4 , -.Xr sa 4 , -.Xr scsi 4 -.\" -.\" .Sh DIAGNOSTICS -.\" -.Sh AUTHORS -.An -nosplit -The -.Nm -driver was ported by -.An M. Warner Losh -from the -.Nm bt -driver written by -.An Justin T. Gibbs . diff --git a/share/man/man4/ahc.4 b/share/man/man4/ahc.4 index be9372fe44..62d829bca9 100644 --- a/share/man/man4/ahc.4 +++ b/share/man/man4/ahc.4 @@ -401,7 +401,6 @@ local SCB space serves as a cache for disconnected transactions, the more SCB space available, the less host bus traffic consumed saving and restoring SCB data. .Sh SEE ALSO -.Xr aha 4 , .Xr cd 4 , .Xr da 4 , .Xr sa 4 , diff --git a/share/man/man4/isa.4 b/share/man/man4/isa.4 index 14402370b7..895f1500c6 100644 --- a/share/man/man4/isa.4 +++ b/share/man/man4/isa.4 @@ -60,8 +60,6 @@ Note that not all architectures support all devices. .Bl -tag -width 12n -offset indent -compact .It Xr adv 4 Advansys SCSI host adapter driver -.It Xr aha 4 -Adaptec SCSI host adapter driver .It Xr aic 4 Adaptec AIC-6260 and AIC-6360 SCSI driver .It Xr bt 4 @@ -75,8 +73,6 @@ Future Domain based SCSI controller driver PC architecture floppy disk controller driver .It Xr nata 4 Generic ATA/ATAPI disk controller driver -.It Xr wt 4 -Archive/Wangtek cartridge tape driver .It Xr ata 4 Generic ATA/ATAPI disk controller driver (deprecated) .El @@ -88,8 +84,6 @@ Cyclades Cyclom-Y serial driver DigiBoard intelligent serial cards driver .It Xr lpt 4 Generic printer device driver -.It Xr rc 4 -RISCom/8 multiport serial card driver .It Xr rp 4 Comtrol RocketPort serial card driver .It Xr si 4 @@ -100,8 +94,6 @@ Generic serial controller driver Stallion Technologies multiport serial controller driver .It Xr stli 4 Stallion Technologies multiport serial controller driver -.It Xr dgb 4 -DigiBoard intelligent serial cards driver (deprecated) .El .Ss Network interfaces .Bl -tag -width 12n -offset indent -compact @@ -113,28 +105,18 @@ Digi/Arnet SYNC/570i device driver Crystal Semiconductor CS8900 and CS8920 ethernet adapter driver .It Xr ed 4 Novell NE1000/NE2000 and WD-80x3 ethenet adapter driver -.It Xr el 4 -3Com Etherlink 3C501 ethernet adapter driver .It Xr ep 4 3Com Etherlink III (3C5x9) ethernet adapter driver .It Xr ex 4 Intel EtherExpress Pro/10 and Pro/10+ ethernet adapter driver .It Xr fe 4 Fujitsu MB86960A and MB86965A ethernet adapter driver -.It Xr ie 4 -Intel i82586 ethernet adapter driver -.It Xr le 4 -DEC EtherWORKS II/III ethernet adapter driver .It Xr lnc 4 AMD Am7900 LANCE and Am79C9xx PCnet ethernet adapter driver -.It Xr rdp 4 -RealTek RTL 8002 pocket ethernet adapter driver .It Xr sn 4 SMC91Cxx ethernet adapter driver .It Xr sr 4 RISCom/N2 device driver -.It Xr wl 4 -T1 speed radio lan card driver .El .Ss Sound cards .Bl -tag -width 12n -offset indent -compact @@ -167,14 +149,8 @@ Winbond LPC Super I/O .Bl -tag -width 12n -offset indent -compact .It Xr atkbdc 4 AT keyboard controller interface -.\".It Xr gpib 4 -.\"No manpage. .It Xr joy 4 Joystick device driver -.It Xr labpc 4 -National Instruments LABPC and LABPC+ driver -.It Xr mse 4 -Bus and InPort mice driver .It Xr npx 4 Numeric Processing Extension coprocessor and emulator .It Xr orm 4 @@ -183,12 +159,8 @@ ISA I/O space option ROM(s) driver Parallel Port Chipset driver .It Xr spic 4 Sony Programmable I/O Controller device driver -.\".It Xr spigot 4 -.\"No manpage. .It Xr syscons 4 System Console driver -.It Xr tw 4 -TW-523 X-10 device driver .It Xr vga 4 VGA graphics driver .El diff --git a/share/man/man4/man4.i386/Makefile b/share/man/man4/man4.i386/Makefile index 367f58d16f..b107620882 100644 --- a/share/man/man4/man4.i386/Makefile +++ b/share/man/man4/man4.i386/Makefile @@ -1,15 +1,14 @@ # $FreeBSD: src/share/man/man4/man4.i386/Makefile,v 1.122.2.12 2003/04/15 17:23:32 fjoe Exp $ -MAN= aic.4 apm.4 ar.4 asc.4 asr.4 \ +MAN= aic.4 apm.4 ar.4 asr.4 \ cs.4 cy.4 \ - dgb.4 digi.4 el.4 en.4 ep.4 ex.4 fe.4 glxsb.4 gsc.4 \ - ie.4 io.4 labpc.4 le.4 linux.4 lnc.4 longrun.4 \ - mse.4 npx.4 \ + digi.4 en.4 ep.4 ex.4 fe.4 glxsb.4 \ + io.4 linux.4 lnc.4 longrun.4 \ + npx.4 \ pcf.4 perfmon.4 pnp.4 pnpbios.4 \ - rc.4 rdp.4 sb.4 sbni.4 \ - spkr.4 sr.4 stl.4 tw.4 \ - tx.4 viapm.4 vx.4 \ - wl.4 wt.4 + sb.4 sbni.4 \ + spkr.4 sr.4 stl.4 \ + tx.4 viapm.4 vx.4 # XXX re-add when adjusted to the new 802.11 framework #MAN+= ndis.4 \ diff --git a/share/man/man4/man4.i386/aic.4 b/share/man/man4/man4.i386/aic.4 index 39d5cbc1be..eff9df3d49 100644 --- a/share/man/man4/man4.i386/aic.4 +++ b/share/man/man4/man4.i386/aic.4 @@ -64,7 +64,6 @@ Adaptec AHA-1030B, AHA-1030P (PC98) NEC PC-9801-100 (PC98) .El .Sh SEE ALSO -.Xr aha 4 , .Xr ahc 4 , .Xr cd 4 , .Xr ch 4 , diff --git a/share/man/man4/man4.i386/asc.4 b/share/man/man4/man4.i386/asc.4 deleted file mode 100644 index e43a5808b0..0000000000 --- a/share/man/man4/man4.i386/asc.4 +++ /dev/null @@ -1,194 +0,0 @@ -.\" asc(4) - manual page for the scanner device driver `asc' -.\" -.\" -.\" Copyright (c) 1995 Gunther Schadow, Luigi Rizzo. 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 acknowledgements: -.\" This product includes software developed by Gunther Schadow. -.\" This product includes software developed by Luigi Rizzo. -.\" 4. 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 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: src/share/man/man4/man4.i386/asc.4,v 1.14.2.2 2001/08/17 13:08:45 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/asc.4,v 1.5 2008/01/26 15:14:41 swildner Exp $ -.Dd January 19, 1995 -.Dt ASC 4 i386 -.Os -.Sh NAME -.Nm asc -.Nd device driver for a GI1904-based hand scanner -.Sh SYNOPSIS -.Cd "device asc0 at isa? port IO_ASC1 drq 3 irq 10" -.Sh DESCRIPTION -The -.Nm -character device driver currently handles the -.Tn GI1904 Ns -based -hand scanner (e.g. Trust Amiscan Grey). -It uses DMA and interrupts. -Up to 50 lines of scanned input data are buffered in the driver. -.Pp -The device can operate at four different resolutions: 100, 200, 300 -and 400 dots per inch. -It produces a simple bitmap with the most -significant bit at the left side. The driver can optionally output -the simple portable bitmap file format -.Xr pbm 5 ; -thus the scans can easily processed by most graphics packages. -.Pp -The width of the output bitmap is fixed as given by the -resolution value. However, the height of the bitmap must be -supplied when in -.Xr pbm 5 -mode, since the driver must know at what time the -`end-of-file' shall be reached. The default is to produce a -square image; i.e., height equals width. -With this feature one is able to -directly copy the scanner output into a -.Xr pbm 5 -file using -.Xr cat 1 . -One can obtain a similar effect by using -.Xr dd 1 -with the driver -in raw mode. -.Sh IOCTLS -The -.Xr ioctl 2 -commands applicable to -.Nm -are listed below. -The -.Xr sasc 1 -provides user-level access to these commands. -.Bl -tag -width ".Dv ASC_GHEIGHT" -.It Dv ASC_GRES -.Pq Li int -Get current resolution in dots per inch (dpi). -.It Dv ASC_GWIDTH -.Pq Li int -Get current width of the bitmap in pixels. -.It Dv ASC_SHEIGHT -.Pq Li int -Set the height of the bitmap in -.Xr pbm 5 -mode. This is actually -a limit on the amount of lines scannable after the first read -operation. When the limit is reached, read will return 0. However, the -device is turned off only when the last open file descriptor is closed. -.It Dv ASC_GHEIGHT -.Pq Li int -Get the current height of the bitmap. -.It Dv ASC_SBLEN -.Pq Li int -Set the length of the buffer used internally to do the DMA transfer. -The buffer length is supplied in lines of the bitmap. -Since the buffer -size limit is (currently) 0x3000 bytes, the maximum number of lines -allowed will vary with the width of each line. An -.Er ENOMEM -error is returned if the requested length would exceed this limit. -.It Dv ASC_GBLEN -.Pq Li int -Get the current buffer length in lines. -.It Dv ASC_SBTIME -.Pq Li int -Set the timeout for the completion of reading one buffer. -Since a -handy scanner is a human/computer interface timeout values are usually -higher than those of a flat scanner; the default is 15 seconds. After -timeout is reached the read operation will fail with -.Er EBUSY . -Note that -the timeout timer starts anew for each buffer to be read and thus -reducing it does not result in faster scans for longer images. -.It Dv ASC_GBTIME -.Pq Li int -Get the current buffer timeout. -.El -.Pp -All -.Fn ioctl -requests that modify a parameter except -.Dv ASC_SBTIME -do not have an effect on an ongoing scan process. The user must close -the device and open it again for the new selections to take effect. -Consequently, the selections are -.Em not -reset when the device is opened or closed. -.Pp -Similarly, requests that read a value do not report the value that is -used for the ongoing scan process. The values needed during the scan -process are saved when it starts and thus are not accessed by -.Fn ioctl -requests. -.Pp -The -.Dv ASC_SBTIME -value does, however, have an immediate effect on the ongoing scan. -Thus the timeout can, for example, be set to a large value until the -user starts scanning, and then set to a small value to react -(nearly) immediately when the user stops. -.Pp -Note that the -.Xr pbm 5 -versus raw mode selection is done by the -minor number, not by -.Fn ioctl -requests. In raw mode, the selected -height of the bitmap will have no effect. -.Sh FILES -.Bl -tag -width /dev/asc0pd -compact -.It Pa /dev/asc0 -device node for raw output -.It Pa /dev/asc0d -device node for raw output, emitting debug messages if the -.Dv ASCDEBUG -option was given in the kernel configuration file -.It Pa /dev/asc0p -device node for output in -.Xr pbm 5 -file format -.It Pa /dev/asc0pd -device node for -.Xr pbm 5 -and debug mode -.El -.\" -.\" .Sh DIAGNOSTICS -.\" -.Sh SEE ALSO -.Xr sasc 1 , -.Xr pbm 5 Pq Pa pkgsrc/graphics/netpbm -.Sh HISTORY -The -.Nm -driver first appeared in -.Fx 2.1 . -.Sh AUTHORS -The -.Nm -driver was written by -.An Luigi Rizzo . -.Sh BUGS -Ioctl support is not working yet. diff --git a/share/man/man4/man4.i386/dgb.4 b/share/man/man4/man4.i386/dgb.4 deleted file mode 100644 index f31d8364d9..0000000000 --- a/share/man/man4/man4.i386/dgb.4 +++ /dev/null @@ -1,388 +0,0 @@ -.\" Copyright (c) 1990, 1991 The Regents of the University of California. -.\" All rights reserved. -.\" -.\" This code is derived from software contributed to Berkeley by -.\" the Systems Programming Group of the University of Utah Computer -.\" Science Department. -.\" 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 the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. -.\" -.\" from: @(#)dca.4 5.2 (Berkeley) 3/27/91 -.\" from: com.4,v 1.1 1993/08/06 11:19:07 cgd Exp -.\" from: sio.4,v 1.15 1994/12/06 20:14:30 bde Exp -.\" $FreeBSD: src/share/man/man4/man4.i386/dgb.4,v 1.13.2.6 2001/08/17 13:08:45 ru Exp $ -.\" -.Dd August 6, 2009 -.Dt DGB 4 i386 -.Os -.Sh NAME -.Nm dgb -.Nd DigiBoard intelligent serial cards driver -.Sh SYNOPSIS -.Cd "options NDGBPORTS=8" -.Cd "device dgb0 at isa? port 0x220 iomem 0xfc0000 iosiz ? flags 0x0" -All values are just examples. -.Pp -The -.Dv NDGBPORTS -option defines the total number of ports on all cards -installed in the system. -When not defined the number is computed: -.Bd -ragged -offset 4n -default -.Dv NDGBPORTS -= number_of_described_DigiBoard_cards * 16 -.Ed -.Pp -If it is less than the actual number of ports -the system will be able to use only the -first -.Dv NDGBPORTS -ports. -If it is greater than all ports will be usable -but some memory will be wasted. -.Pp -Meaning of -.Cm flags : -.Bl -tag -width indent -compact -.It 0x0001 -use alternate pinout (exchange DCD and DSR lines) -.It 0x0002 -don't use 8K window mode of PC/Xe -.El -.Pp -Device numbering: -.Bd -literal -compact -0b\fICC\fPmmmmmmmm\fIOLIPPPPP\fP - \fBCC\fPard number - \fRmmmmmmmm\fPajor number - call\fBO\fPut - \fBL\fPock - \fBI\fPnitial - \fBPPPPP\fPort number -.Ed -.Sh DESCRIPTION -The -.Nm -driver provides support for DigiBoard PC/Xe and PC/Xi series intelligent -serial multiport cards with asynchronous interfaces based on the -.Tn EIA -.Tn RS-232C -.Pf ( Tn CCITT -.Tn V.24 ) -standard. -.Pp -Input and output for each line may set to one of following baud rates; -50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2400, 4800, 9600, -19200, 38400, 57600, or for newer versions of cards 115200. -.Pp -The driver doesn't use any interrupts, it is -.Dq polling\-based . -This means that -it uses clock interrupts instead of interrupts generated by DigiBoard cards and -checks the state of cards 25 times per second. -This is practical because the -DigiBoard cards have large input and output buffers (more than 1Kbyte per -port) and hardware that allows efficiently finding the port that needs -attention. -The only problem seen with this policy is slower -SLIP and PPP response. -.Pp -Each line in the kernel configuration file describes one card, not one port -as in the -.Xr sio 4 -driver. -.Pp -The -.Cm flags -keyword may be used on each -.Dq Li "device dgb" -line in the kernel configuration file -to change the pinout of the interface or to use new PC/Xe cards -which can work with an 8K memory window in compatibility mode -(with a 64K memory window). -Note -that using 8K memory window doesn't mean shorter input/output buffers, it means -only that all buffers will be mapped to the same memory address and switched as -needed. -.Pp -The -.Cm port -value must be the same -as the -port -set on the card by jumpers. -For PC/Xi cards the same rule is applicable to the -.Cm iomem -value. -It must be the same as the memory address set on the card -by jumpers. -.\"Some documentation gives the address as a ``paragraph'' or ``segment''; -.\"you can get the value of address by adding the digit "0" at end of -.\"paragraph value, e.g., 0xfc000 -> 0xfc0000. -For PC/Xe cards there is no need to use jumpers for this purpose. -In fact there are no jumpers to do it. -Just -write the address you want as the -.Cm iomem -value in kernel config file and the card will be programmed -to use this address. -.Pp -The same range of memory addresses may be used -for all the DigiBoards installed -(but not for any other card or real memory). -DigiBoards -with a large amount of memory (256K or 512K and perhaps -even 128K) must be mapped -to memory addresses outside of the first megabyte. -If the computer -has more than 15 megabytes of memory then there is no free address space -outside of the first megabyte where such DigiBoards can be mapped. -In this case you -may need to reduce the amount of memory in the computer. -But many machines provide a better solution. -They have the ability to -.Dq "turn off" -the memory in the 16th megabyte (addresses 0xF00000 - 0xFFFFFF) -using the -BIOS setup. -Then the DigiBoard's address space can be set to this -.Dq hole . -.\" XXX the following should be true for all serial drivers and -.\" should not be repeated in the man pages for all serial drivers. -.\" It was copied from sio.4. The only changes were s/sio/dgb/g. -.Pp -Serial ports controlled by the -.Nm -driver can be used for both -.Dq callin -and -.Dq callout . -For each port there is a callin device and a callout device. -The minor number of the callout device is 128 higher -than that of the corresponding callin port. -The callin device is general purpose. -Processes opening it normally wait for carrier -and for the callout device to become inactive. -The callout device is used to steal the port from -processes waiting for carrier on the callin device. -Processes opening it do not wait for carrier -and put any processes waiting for carrier on the callin device into -a deeper sleep so that they do not conflict with the callout session. -The callout device is abused for handling programs that are supposed -to work on general ports and need to open the port without waiting -but are too stupid to do so. -.Pp -The -.Nm -driver also supports an initial-state and a lock-state control -device for each of the callin and the callout -.Dq data -devices. -The minor number of the initial-state device is 32 higher -than that of the corresponding data device. -The minor number of the lock-state device is 64 higher -than that of the corresponding data device. -The termios settings of a data device are copied -from those of the corresponding initial-state device -on first opens and are not inherited from previous opens. -Use -.Xr stty 1 -in the normal way on the initial-state devices to program -initial termios states suitable for your setup. -.Pp -The lock termios state acts as flags to disable changing -the termios state. -E.g., to lock a flag variable such as -.Dv CRTSCTS , -use -.Dq Li "stty crtscts" -on the lock-state device. -Speeds and special characters -may be locked by setting the corresponding value in the lock-state -device to any nonzero value. -.Pp -Correct programs talking to correctly wired external devices -.\" XXX change next line in other man pages too, and rewrite this paragraph. -work with almost arbitrary initial states and no locking, -but other setups may benefit from changing some of the default -initial state and locking the state. -In particular, the initial states for non (POSIX) standard flags -should be set to suit the devices attached and may need to be -locked to prevent buggy programs from changing them. -E.g., -.Dv CRTSCTS -should be locked on for devices that support -RTS/CTS handshaking at all times and off for devices that don't -support it at all. -.Dv CLOCAL -should be locked on for devices -that don't support carrier. -.Dv HUPCL -may be locked off if you don't -want to hang up for some reason. -In general, very bad things happen -if something is locked to the wrong state, and things should not -be locked for devices that support more than one setting. -The -.Dv CLOCAL -flag on callin ports should be locked off for logins -to avoid certain security holes, but this needs to be done by -getty if the callin port is used for anything else. -.Sh FILES -.Bl -tag -width /dev/ttyiD?? -compact -.It Pa /dev/ttyD?? -for callin ports -.It Pa /dev/ttyiD?? -.It Pa /dev/ttylD?? -corresponding callin initial-state and lock-state devices -.Pp -.It Pa /dev/cuaD?? -for callout ports -.It Pa /dev/cuaiD?? -.It Pa /dev/cualD?? -corresponding callout initial-state and lock-state devices -.El -.Pp -.Bl -tag -width /etc/rc.d/serial -compact -.It Pa /etc/rc.d/serial -examples of setting the initial-state and lock-state devices -.El -.Pp -The first question mark in these device names is short for the -card number -(a decimal number between 0 and 65535 inclusive). -The second question mark is short for the port number -(a letter in the range [0-9a-v]). -.Sh DIAGNOSTICS -You may enable extended diagnostics by defining DEBUG at the -start of the source file -.Pa dgb.c . -.Bl -diag -.It dgb\fIX\fP: warning: address \fIN\fP truncated to \fIM\fP -The memory address for the PC/Xe's 8K window is misaligned (it should be -on an 8K boundary) or outside of the first megabyte. -.It dgb\fIX\fP: 1st reset failed -Problems with accessing I/O port of the card, probably -the wrong -.Cm port -value is specified in the kernel config file. -.It dgb\fIX\fP: 2nd reset failed -Problems with hardware. -.It dgb\fIX\fP: \fIN\fP[st,nd,rd,th] memory test failed -Problems with accessing the memory of the card, probably -the wrong -.Cm iomem -value is specified in the kernel config file. -.It dgb\fIX\fP: BIOS start failed -Problems with starting the on-board BIOS. -Probably the memory addresses of the -DigiBoard overlap with some other device or with RAM. -.It dgb\fIX\fP: BIOS download failed -Problems with the on-board BIOS. -Probably the memory addresses of the -DigiBoard overlap with some other device or with RAM. -.It dgb\fIX\fP: FEP code download failed -Problems with downloading of the Front-End Processor's micro-OS. -Probably the memory addresses of the -DigiBoard overlap with some other device or with RAM. -.It dgb\fIX\fP: FEP/OS start failed -Problems with starting of the Front-End Processor's micro-OS. -Probably the memory addresses of the -DigiBoard overlap with some other device or with RAM. -.It dgb\fIX\fP: too many ports -This DigiBoard reports that it has more than 32 ports. -Perhaps a hardware problem or -the memory addresses of the -DigiBoard overlap with some other device or with RAM. -.It dgb\fIX\fP: only \fIN\fP ports are usable -The -.Dv NDGBPORTS -parameter is too small and there is only enough space allocated -for -.Ar N -ports on this card. -.It dgb\fIX\fP: port \fIY\fP is broken -The on-board diagnostic has reported that the specified port has hardware -problems. -.It dgb\fIX\fP: polling of disabled board stopped -Internal problems in the polling logic of driver. -.It dgb\fIX\fP: event queue's head or tail is wrong! -Internal problems in the driver or hardware. -.It dgb\fIX\fP: port \fIY\fP: got event on nonexisting port -Some status changed on a port that is physically present but is -unusable due to misconfiguration. -.It dgb\fIX\fP: port \fIY\fP: event \fIN\fP mstat \fIM\fP lstat \fIK\fP -The driver got a strange event from card. -Probably this means that you have a -newer card with an extended list of events or some other hardware problem. -.It dgb\fIX\fP: port \fIY\fP: overrun -Input buffer has filled up. -Problems in polling logic of driver. -.It dgb\fIX\fP: port \fIY\fP: FEP command on disabled port -Internal problems in driver. -.It dgb\fIX\fP: port \fIY\fP: timeout on FEP command -Problems in hardware. -.El -.Sh SEE ALSO -.Xr stty 1 , -.Xr termios 4 , -.Xr tty 4 , -.Xr comcontrol 8 -.Sh HISTORY -The -.Nm -driver is derived from the -.Xr sio 4 -driver and the DigiBoard driver from -.Tn Linux -and is -.Ud -.Sh BUGS -The implementation of sending -.Dv BREAK -is broken. -.Dv BREAK -of fixed length of \(14 s -is sent anyway. -.Pp -There was a bug in implementation of -.Xr select 2 . -It is fixed now but not widely tested yet. -.Pp -There is no ditty command. -Most of its functions (alternate pinout, -speed up to 115200 baud, etc.) are implemented in the driver itself. -Some -other functions are missing. -.Pp -The -.Nm -driver is deprecated, please consider the -.Xr digi 4 -driver. diff --git a/share/man/man4/man4.i386/el.4 b/share/man/man4/man4.i386/el.4 deleted file mode 100644 index a6b0ec71be..0000000000 --- a/share/man/man4/man4.i386/el.4 +++ /dev/null @@ -1,58 +0,0 @@ -.\" -.\" Copyright (c) 1994 James A. Jegers -.\" 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. 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 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: src/share/man/man4/man4.i386/el.4,v 1.11.2.3 2001/08/17 13:08:45 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/el.4,v 1.3 2006/02/17 19:37:10 swildner Exp $ -.\" -.Dd July 10, 1995 -.Dt EL 4 i386 -.Os -.Sh NAME -.Nm el -.Nd Ethernet driver for 3Com Etherlink 3C501 device driver -.Sh SYNOPSIS -.Cd "device el0 at isa? port 0x300 irq 9" -.Sh DESCRIPTION -The -.Nm -interface provides support for the 3Com 3c501 8bit ISA ethernet card. -The 3c501 card is known to be quite slow, and a different ethernet card -should be used if possible. -However, they allow inexpensive access to 10 Mb/s Ethernet networks. -.Pp -The valid I/O ports are in the range 0x280-0x3f0. -.Sh SEE ALSO -.Xr ed 4 , -.Xr ep 4 , -.Xr ie 4 , -.Xr intro 4 , -.Xr le 4 , -.Xr ng_ether 4 , -.Xr ifconfig 8 -.Sh BUGS -The driver assumes the card is configured for the same IRQ as the kernel. -No probing or checking is done to determine if this is the case. -.Pp -Does not currently support DMA. -.Pp -Does not currently support multicasts. diff --git a/share/man/man4/man4.i386/ep.4 b/share/man/man4/man4.i386/ep.4 index f8229df7fb..1edf659f50 100644 --- a/share/man/man4/man4.i386/ep.4 +++ b/share/man/man4/man4.i386/ep.4 @@ -28,7 +28,6 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/man4.i386/ep.4,v 1.16.2.6 2001/08/17 13:08:45 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/ep.4,v 1.4 2008/05/02 02:05:06 swildner Exp $ .\" .Dd February 4, 1993 .Dt EP 4 i386 @@ -96,11 +95,8 @@ Erase the pencil mark and reboot. .El .Sh SEE ALSO .Xr ed 4 , -.Xr el 4 , -.Xr ie 4 , .Xr ifmedia 4 , .Xr intro 4 , -.Xr le 4 , .Xr ng_ether 4 , .Xr vx 4 , .Xr ifconfig 8 diff --git a/share/man/man4/man4.i386/gsc.4 b/share/man/man4/man4.i386/gsc.4 deleted file mode 100644 index c01ae84516..0000000000 --- a/share/man/man4/man4.i386/gsc.4 +++ /dev/null @@ -1,343 +0,0 @@ -.\" gsc.4 - manual page for the scanner device driver `gsc' -.\" -.\" -.\" Copyright (c) 1995 Gunther Schadow. 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 Gunther Schadow. -.\" 4. 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 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: src/share/man/man4/man4.i386/gsc.4,v 1.12.2.7 2001/12/17 11:30:13 ru Exp $ -.\" -.Dd January 9, 1995 -.Dt GSC 4 i386 -.Os -.Sh NAME -.Nm gsc -.Nd a device driver for a handy scanner -.Sh SYNOPSIS -.In machine/gsc.h -.Pp -.Cd Minor number bits: Ar uu d g p ... -.Bl -tag -width "uu " -compact -offset indent -.It Ar uu -unit gsc0 .. gsc3 -.It Ar d -selects logging of -.Em debug -messages -.It Ar g -selects -.Em bitmap -vs. -.Em graymap -output -.It Ar p -selects -.Em raw -vs. portable -.Em pnm -output -.El -.Sh DESCRIPTION -The -.Nm -character device driver currently handles only the -Genius GS-4500 handy scanner. -It operates in pure DMA modes, although -the hardware could be set up to work with irq. -I had neither enough -documentation nor experience in writing interrupt driven device -drivers. -.Pp -The device can operate at four different -.Em resolutions : -100, 200, -300 and 400dpi. -It produces a simple bitmap with the most significant -bit at the left side. -The driver can optionally output the famous and -likely simple portable bitmap file format -.Xr pbm 5 -by Jef Poskanzer. -Thus the scans can easily processed by any graphic package around -.Xr ( xpaint 1 , -.Xr xv 1 , -.Xr xli 1 -only to name some of them ...). In -.Em raw -mode a -bit which is set means a black pixel because the scanner detects black -points on white paper. -On the other hand, because pnm format describes -intensities of electron beams in video screens a set bit in -.Em pbm -mode means a white pixel. -.Pp -The -.Em width -of the output bitmap is fixed as given by the -resolution value. -However, the -.Em height -of the bitmap must be -supplied in -.Em pnm -mode since the driver must know at what time the -.Sq end-of-file -shall be reached. -With this feature you are able to -directly copy the scanner output into a pbm file with -.Xr cat 1 . -Of course you can obtain a similar effect by using -.Xr dd 1 -with the driver in -.Em raw -mode. -.Pp -The -.Em graymap -output mode is not yet implemented into the driver. -It is even questionable if external programs would not do this job -better thereby not counting to the size of the kernel. -Even though, I -do not know of tools which produce a graymap from a halftone bitmap. -.Pp -The ioctl requests that are served by -.Nm -are listed below. -There is a utility, called -.Xr sgsc 1 , -that provides access to these -requests from within shell. -.Bl -tag -width Ds -.It Dv GSC_SRES Vt int -Set the -.Em resolution -value. -If this call is made after the first -read access to the device there will be no effect unless the device is -closed and opened again. -.It Dv GSC_GRES Vt int -Get current resolution in dots per inch (dpi). -.It Dv GSC_SRESSW Vt void -Set resolution value from selector switch. -The driver must be in an -open though untouched state otherwise the request will fail and -.Xr errno 2 -is set to -.Er EBUSY . -.It Dv GSC_SWIDTH Vt int -Set the -.Em width -of the bitmap. -Actually, this is an alternative -way of setting the resolution, since any allowed resolution matches -exactly one width. -Allowed are listed in the table below. -.Bl -tag -width resolution -compact -offset indent -.It resolution -width -.It 100 dpi -424 pixels -.It 200 dpi -840 pixels -.It 300 dpi -1264 pixels -.It 400 dpi -1648 pixels -.It ? -1696 pixels -.It ? -2544 pixels -.It ? -3648 pixels -.El -.Pp -Values which are not reported in the above table will cause the ioctl -call to fail with -.Xr errno 2 -set to -.Er EINVAL . -.Pp -As you can see, there are width values > 1696. -This does, however, not -mean that you can obtain scanned lines longer than the width of your -scanner or by higher resolutions. -Actually, the resolution is selected -by only by the hardware switch. -Any line that is longer than what is -defined for the actual resolution will be undefined (usually white) on -the right part that is exceeding the standard line. -.It Dv GSC_GWIDTH Vt int -Get current width of the bitmap in pixels. -.It Dv GSC_SHEIGHT Vt int -Set the -.Em height -of the bitmap in -.Em pnm -mode. -This is actually -a limit on the amount of lines scannable after the first read -operation. -When the limit is reached read will return 0. However, the -device is turned off only when a close is performed (either -explicitly or implicitly on exit of the calling process). -.It Dv GSC_GHEIGHT Vt int -Get the current height of the bitmap. -.It Dv GSC_SBLEN Vt int -Set the length of the buffer used internally to do the DMA transfer. -The buffer length is supplied in lines of the bitmap. -Since the buffer -size limit is (currently) 0x3000 bytes the maximum number of lines -allowed will vary with the width of each line. -This upper limit is -checked before it overwrites the current value and passes an -.Er ENOMEM -in the -.Xr errno 2 -variable. -However, since the bitmap width can change -after a buffer length was selected a read request may fail with -.Er ENOMEM -if the buffer length turns out too high. -It is generally wise to -choose long buffers rather than go save in order to obtain better -output. -.It Dv GSC_GBLEN Vt int -Get the current buffer length in lines. -.It Dv GSC_SBTIME Vt int -Set the timeout for the completion of reading one buffer. -Since a -handy scanner is a human/computer interface timeout values are usually -higher than those of a flat scanner. -Default is 15 seconds. -After -timeout is reached the read operation will fail with -.Er EBUSY . -Note that -the timeout timer starts anew for each buffer to be read and thus does -not cause you to scan faster for longer images. -BLEN/BTIME is similar -as MIN/TIME in -.Xr termios 4 . -.It Dv GSC_GBTIME Vt int -Get the current buffer timeout. -.El -.Pp -All ioctl requests that modify a parameter except -.Dv GSC_SBTIME -do not -have an effect on an ongoing scan process, i.e. after the first read -request that follows open. -You must close the device and open it again -for the new selections to take effect. -Consequently, the selections -are not reset when you close or open the device. -.Pp -Similarly, requests that read a value do not report the value that is -used for the ongoing scan process. -The values needed during the scan -process are saved when it starts and thus are not accessed by ioctl -requests. -.Pp -The BTIME value does, however, have an immediate effect on the ongoing -scan. -Thus the timeout can for example be set to long until the user -starts scanning. It can then be set to a short amount to react -(nearly) immediately when the user stops. -Note that the user should be -left time to at least fill one buffer without having to haste. -.Pp -Note that the -.Em pbm -versus -.Em raw -mode selection is done by the -minor number not by ioctl requests. -In -.Em raw -mode the selected -height of the bitmap will have no effect. -.Sh FILES -.Bl -tag -width /dev/gsc0pd -.It Pa /dev/gsc0 -device node for -.Em raw -output, has minor number 0. -.It Pa /dev/gsc0d -device node for -.Em raw -output emitting -.Em debug -messages if the -GSCDEBUG option was given at compile time, has minor number 32. -.It Pa /dev/gsc0p -device node for output in -.Em pbm -file format, has minor number 8. -.It Pa /dev/gsc0pd -device node for -.Em pbm -and -.Em debug -mode, has minor number 40. -.El -.Sh EXAMPLES -.Bd -literal -offset indent -dd if=/dev/gsc0 of=rawfile bs=(width/8) count=(height) - -cat /dev/gsc0p > pbmfile -.Ed -.Sh DIAGNOSTICS -.Bl -tag -width Cd -.It GSCDEBUG -When you define this name as an `option' in the kernel configuration -you can get debug output if you access the driver with a minor number -whose debug bit (i.e. bit 5 out of 7) is set. -.El -.Sh SEE ALSO -.Xr cat 1 , -.Xr dd 1 , -.Xr pbmtopgm 1 Pq Pa pkgsrc/graphics/netpbm , -.Xr sgsc 1 , -.Xr close 2 , -.Xr intro 2 , -.Xr ioctl 2 , -.Xr open 2 , -.Xr read 2 , -.Xr termios 4 , -.Xr pbm 5 Pq Pa pkgsrc/graphics/netpbm , -.Xr pnm 5 Pq Pa pkgsrc/graphics/netpbm -.Sh AUTHORS -.An Gunther Schadow Aq gusw@fub46.zedat.fu-berlin.de -.Sh BUGS -Even though the scanner device has a little switch by which you should -be able to select one of the four resolution modes, I could not yet -determine how to read its status. -Unless this is not fixed the driver -depends on the value passed by means of -.Xr ioctl 2 -which need not match -what is selected by the hardware. diff --git a/share/man/man4/man4.i386/ie.4 b/share/man/man4/man4.i386/ie.4 deleted file mode 100644 index 5ef778896f..0000000000 --- a/share/man/man4/man4.i386/ie.4 +++ /dev/null @@ -1,92 +0,0 @@ -.\" -.\" Copyright (c) 1994, Wilko Bulte -.\" All rights reserved. -.\" -.\" $FreeBSD: src/share/man/man4/man4.i386/ie.4,v 1.11.2.5 2001/08/17 13:08:45 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/ie.4,v 1.3 2006/12/29 18:20:11 swildner Exp $ -.\" -.Dd September 23, 1994 -.Dt IE 4 i386 -.Os -.Sh NAME -.Nm ie -.Nd Intel i82586 ethernet device driver -.Sh SYNOPSIS -.Cd "device ie0 at isa? port 0x360 irq 7 iomem 0xd0000" -.Sh DESCRIPTION -The -.Nm -driver provides support for 8 and 16bit ISA ethernet cards that are based on -the Intel i82586 chip. -It supports the AT&T Starlan 10 and Starlan Fiber, -the EN100, the Intel EtherExpress 16, the 3COM 3C507 and the RACAL Interlan -NI5210. -.Sh DIAGNOSTICS -.Bl -diag -.It "ie%d: unknown board type code %d" -An i82586 chip was found, but the driver was unable to determine the actual -board type during the probe. -.It "ie%d: kernel configured maddr %x doesn't match board configured maddr %x" -The device probe detected a different maddr than the one specified in the -kernel configuration file. -.It "ie%d: can't find shared memory" -The device probe could not access the shared memory to determine its size. -.It "ie%d: kernel configured msize %d doesn't match board configured msize %d" -The device probe found a different size for the shared memory than the one -specified in the kernel configuration file. -.It "ie%d: kernel configured irq %d doesn't match board configured irq %d" -The device probe detected that the board is configured for a different -interrupt than the one specified in the kernel configuration file. -.It "ie%d: reset" -The Intel i82586 had to be reset by the driver. -.It "ie%d: transceiver problem" -The driver has detected a problem with the ethernet transceiver. -This is -usually due to a loose or broken transceiver cable when using an external -transceiver. -When you experience this problem with an on-card transceiver -your card may be incorrectly jumpered for to use an external transceiver. -Worst case your on-board transceiver may be broken. -.It "ie%d: TDR detected an open %d clocks away" -The driver detected an open circuit in the ethernet cable. -Check your -coax cable and terminator resistors. -.It "ie%d: TDR detected a short %d clocks away" -The driver detected a short circuit in the ethernet cable. -Check your -coax cable and terminator resistors. -.It "ie%d: TDR returned unknown status %x" -The driver got an unknown status from the card during the ethernet cable -test. -.It "ie%d: multicast address setup command failed" -The card could not be put into multicast mode. -.It "ie%d: configure command failed" -The card refused to respond correctly during configuration. -.It "ie%d: individual address setup command failed" -The programming of the Ethernet (MAC) address failed. -.El -.Sh CAVEATS -The Racal Interlan NI5210 comes in variants with 8 and 16 kbytes of -shared memory. -It is strongly advisable to use the 16 kbyte variant. -You can upgrade your 8 kbyte card to 16 kbyte by adding an additional -RAM chip. -.Sh SEE ALSO -.Xr arp 4 , -.Xr netintro 4 , -.Xr ng_ether 4 , -.Xr ifconfig 8 -.Sh AUTHORS -.An -nosplit -The -.Nm -device driver was written by -.An Garrett A. Wollman , -based on code by -.An William F. Jolitz -and Lawrence Berkeley Laboratories. -.Tn 3C507 -support was written by -.An Charles M. Hannum . -This manual page was written by -.An Wilko C. Bulte . diff --git a/share/man/man4/man4.i386/labpc.4 b/share/man/man4/man4.i386/labpc.4 deleted file mode 100644 index adc901d362..0000000000 --- a/share/man/man4/man4.i386/labpc.4 +++ /dev/null @@ -1,152 +0,0 @@ -.\" -.\" Copyright (c) 1995 HD Associates, Inc. -.\" 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 Christopher G. Demetriou. -.\" 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 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: src/share/man/man4/man4.i386/labpc.4,v 1.8.2.2 2001/08/17 13:08:45 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/labpc.4,v 1.4 2007/03/22 23:02:31 swildner Exp $ -.\" -.Dd April 26, 1995 -.Dt LABPC 4 i386 -.Os -.Sh NAME -.Nm labpc -.Nd National Instruments LABPC and LABPC+ driver -.Sh SYNOPSIS -.Cd "device labpc0 at isa? port 260 irq 5" -.Sh DESCRIPTION -This supports the National Instruments LABPC and LABPC+ \fILow-Cost -Multifunction I/O Board\fP. -.Pp -This board provides 8 12 bit A-D input channels, 2 12 bit D-A output -channels, and 3 8 bit digital I/O ports. It also supports setting -up the National Instruments SCXI bus off the digital I/O ports, -although that software is currently present in an external program -and not as part of the driver. -.Pp -The selection of the input or output device, mode, and channel is -through the minor number: -.Bd -literal -offset indent -The 8 bit minor number format is UUSIDCCC, with - UU: Board unit. - S: SCAN bit for scan enable. - I: INTERVAL for interval support - D: 1: Digital I/O, 0: Analog I/O -CCC: The channel selector: - ANALOG: - input: channel must be 0 to 7 for AD0 ... AD7 - output: channel must be 0 to 2 - 0: D-A 0 - 1: D-A 1 - 2: Alternate channel 0 then 1 - - DIGITAL: - input: Channel must be 0 to 2. - output: Channel must be 0 to 2. -.Ed -.Pp -The /dev/MAKEDEV script will make the basic analog and digital -devices if you do "sh MAKEDEV labpcaio" and "sh MAKEDEV labpcdio", -however, it won't make device entries for INTERVAL and SCAN devices. -SCAN devices automatically scan over all channels from the channel -number down to 0 (for example, a SCAN for /dev/ad7 will read channels -AD7 ... AD0) while the INTERVAL device will wait for an external -signal and then read all the channels from the selected channel -number down to 0 as fast as it can. This is done by the hardware -and not the driver (other than turning it on); See the \fILabPC+ -User's Manual\fP and the source code if this doesn't make sense to -you. -.Pp -The driver supports several general analog I/O ioctl calls. These -are defined in -.In sys/dataacq.h -and are intended to be implemented in -other data acquisition board device drivers. -.Pp -.Dv AD_MICRO_PERIOD_SET -takes a pointer to a long argument specifying -the number of microseconds between samples. -.Pp -.Dv AD_MICRO_PERIOD_GET -takes a pointer to a long argument and returns -the current number of microseconds between samples. -.Pp -.Dv AD_NGAINS_GET -takes a pointer to an integer and returns the number -of different gain settings the board supports. This is 8 for the -LabPC board. -.Pp -.Dv AD_NCHANS_GET -takes a pointer to an integer and returns the number -of channels the board supports. This is 8 for the LabPC board. -.Pp -.Dv AD_SUPPORTED_GAINS -returns an array of NGAINS (the number obtained -by -.Dv AD_NGAINS_GET ) -doubles. These are the gains the board supports. -.Pp -.Dv AD_GAINS_SET -takes an array of NCHANS (the number obtained by -.Dv AD_NCHANS_GET ) -integers and sets the board gains. These are indices -into the supported gain array, with one gain for each channel. -.Pp -.Dv AD_GAINS_GET -takes an array of NCHANS (returned by -.Dv AD_NCHANS_GET ) -integers and returns the current board gains. -.Sh BUGS -In general, only those capabilities that I needed are present. In -particular the following notable restrictions are present. -.Pp -The analog input is only supported in a clocked conversion mode. -.Pp -You can only set the sample clock down to 15 Hz. Anything slower -needs a modification to the driver to support TCINTEN in order to -chain together the counters to get a lower clock rate. -.Pp -There is no support for clocked D-A output. -.Pp -The 8255 providing the digital I/O ports is supported only in mode -0 (three 8 bit ports). -.Pp -There is support for the SCXI bus off the LABPC board. It is not -in the driver but is a separate user process that accesses the -digital I/O devices. Ask dufault@hda.com for it. -.Pp -MAKEDEV only makes the "basic" devices. You must make the INTERVAL -or SCAN devices by hand. -.Pp -The INTERVAL device sets the clock rate as high as possible so that -it samples all the channels as quickly as it can after the external -signal. This is a silly restriction; it should simply use the -clock setting. -.Sh CAVEATS -National Instrument's (like most other laboratory grade board -vendors) definition of Low-Cost differs dramatically from many on -the net. diff --git a/share/man/man4/man4.i386/le.4 b/share/man/man4/man4.i386/le.4 deleted file mode 100644 index 9c5a04942b..0000000000 --- a/share/man/man4/man4.i386/le.4 +++ /dev/null @@ -1,96 +0,0 @@ -.\" -.\" Copyright (c) 1997 David E. O'Brien -.\" -.\" 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. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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: src/share/man/man4/man4.i386/le.4,v 1.10.2.5 2001/08/17 13:08:45 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/le.4,v 1.2 2003/06/17 04:36:59 dillon Exp $ -.\" -.Dd January 19, 1997 -.Dt LE 4 i386 -.Os -.Sh NAME -.Nm le -.Nd DEC EtherWORKS II/III Ethernet device driver -.Sh SYNOPSIS -.Cd "device le0 at isa? port 0x300 irq 5 iomem 0xd0000" -.Sh DESCRIPTION -The -.Nm -driver provides support for the later Digital Equipment EtherWORKS II -(DE200, DE201, DE202, DE422), and the DEC EtherWORKS III NICs (DE203, DE204, -and DE205) NICs. -.Pp -The valid IRQ settings for the -.Nm -driver are 5, 10, 11, and 15. -.Sh DIAGNOSTICS -.Bl -diag -.It "le%d: not configured -- too many devices" -There is a limit of the number of -.Nm -devices allowed in a single machine. -.It "le%d: lemac configuration error: expected IRQ 0x%x actual 0x%x" -The probed IRQ value did not match the value specified in the kernel -configuration file. Either the card should be changed, or a new kernel -should be built. -.It "le%d: lemac configuration error: expected iomem 0x%x actual 0x%x" -The probed iomem value did not match the value specified in the kernel -configuration file. Either the card should be changed, or a new kernel -should be built. -.It "le%d: reset: EEPROM checksum failed (0x%x)" -The -.Nm -driver depends on the information in the EEPROM being correct. -If this error occurs, please reconfigure the card. -.It "le%d: fatal RXD error, attempting recovery" -.It "le%d: recovery failed -- board disabled" -A receive error occurred. The driver will attempt to recover from this -error. However if it cannot, the driver will shut the card down. -.It "le%d: lance: warning: excessive collisions: TDR%dns (%d-%dm)" -An overly high number of Ethernet collisions were detected. It may be the -case that the network is overly busy. Or this may suggest a problem with -the EtherWORKS card. -.El -.Sh SEE ALSO -.Xr arp 4 , -.Xr netintro 4 , -.Xr ng_ether 4 , -.Xr config 8 , -.Xr ifconfig 8 -.Rs -.%T "Building 4.3 BSD UNIX System with Config" -.Re -.Sh HISTORY -The -.Nm -device driver was present in -.Fx 2.0 . -.Sh AUTHORS -.An -nosplit -The -.Nm -device driver was written by -.An Matt Thomas . -This manual page was written by -.An David E. O'Brien . diff --git a/share/man/man4/man4.i386/mse.4 b/share/man/man4/man4.i386/mse.4 deleted file mode 100644 index b9821364bd..0000000000 --- a/share/man/man4/man4.i386/mse.4 +++ /dev/null @@ -1,363 +0,0 @@ -.\" Copyright 1992 by the University of Guelph -.\" -.\" Permission to use, copy and modify this -.\" software and its documentation for any purpose and without -.\" fee is hereby granted, provided that the above copyright -.\" notice appear in all copies and that both that copyright -.\" notice and this permission notice appear in supporting -.\" documentation. -.\" University of Guelph makes no representations about the suitability of -.\" this software for any purpose. It is provided "as is" -.\" without express or implied warranty. -.\" -.\" $FreeBSD: src/share/man/man4/man4.i386/mse.4,v 1.10.2.4 2001/08/17 13:08:45 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/mse.4,v 1.4 2008/05/02 02:05:06 swildner Exp $ -.\" -.Dd December 3, 1997 -.Dt MSE 4 i386 -.Os -.Sh NAME -.Nm mse -.Nd bus and InPort mice driver -.Sh SYNOPSIS -.\" .Cd "options MSE_XXX=N" -.Cd "device mse0 at isa? port 0x23c irq 5" -.Sh DESCRIPTION -The -.Nm -driver provides support for the bus mouse and the InPort mouse, which -are often collectively called ``bus'' mice, as these mice are sold with -an interface card which needs to be installed in an expansion bus slot. -The interface circuit may come on an integrated I/O card or as an option -on video cards. -.Pp -The bus and InPort mice have two or three buttons, -and a D-sub 9-pin male connector or a round DIN 9-pin -male connector. -.Pp -The primary port address of the bus and InPort mouse interface cards -is usually 0x23c. -Some cards may also be set to use the secondary port -address at 0x238. -The interface cards require a single IRQ, which may be -2, 3, 4 or 5. Some cards may offer additional IRQs. -The port number and the IRQ number are configured by jumpers on the cards -or by software provided with the card. -.Pp -Frequency, or report rate, at which the device sends movement -and button state reports to the host system, may also be configurable on -some interface cards. -It may be 15, 30, 60 or 120Hz. -.Pp -The difference between the two types of the mice is not in mouse devices -(in fact they are exactly the same). But in the circuit on the interface -cards. -This means that the device from a bus mouse package can be -connected to the interface card from an InPort mouse package, or vice -versa, provided that their connectors match. -.Ss Operation Levels -The -.Nm -driver has two levels of operation. -The current operation level can be set via an ioctl call. -.Pp -At the level zero the basic support is provided; the device driver will report -horizontal and vertical movement of the attached device -and state of up to three buttons in the format described below. -It is a subset of the MouseSystems protocol. -.Pp -.Bl -tag -width Byte_1 -compact -.It Byte 1 -.Bl -tag -width bit_7 -compact -.It bit 7 -Always one. -.It bit 6..3 -Always zero. -.It bit 2 -Left button status; cleared if pressed, otherwise set. -.It bit 1 -Middle button status; cleared if pressed, otherwise set. -Always one, -if the device does not have the middle button. -.It bit 0 -Right button status; cleared if pressed, otherwise set. -.El -.It Byte 2 -Horizontal movement count in two's complement; -128 through 127. -.It Byte 3 -Vertical movement count in two's complement; -128 through 127. -.It Byte 4 -Always zero. -.It Byte 5 -Always zero. -.El -.Pp -This is the default level of operation and the driver is initially -at this level when opened by the user program. -.Pp -At the operation level one (extended level), a data packet is encoded -in the standard format -.Dv MOUSE_PROTO_SYSMOUSE -as defined in -.Xr mouse 4 . -.Ss Acceleration -The -.Nm -driver can somewhat `accelerate' the movement of the pointing device. -The faster you move the device, the further the pointer -travels on the screen. -The driver has an internal variable which governs the effect of -the acceleration. -Its value can be modified via the driver flag -or via an ioctl call. -.Ss Device Number -The minor device number of the -.Nm -is made up of: -.Bd -literal -offset indent -minor = (`unit' << 1) | `non-blocking' -.Ed -.Pp -where `unit' is the device number (usually 0) and the `non-blocking' bit -is set to indicate ``don't block waiting for mouse input, -return immediately''. -The `non-blocking' bit should be set for \fIXFree86\fP, -therefore the minor device number usually used for \fIXFree86\fP is 1. -See -.Sx FILES -for device node names. -.Sh DRIVER CONFIGURATION -.\" .Ss Kernel Configuration Options -.Ss Driver Flags -The -.Nm -driver accepts the following driver flag. -Set it in the -kernel configuration file -(see -.Xr config 8 ) -or in the User Configuration Menu at -the boot time -(see -.Xr boot 8 ) . -.Bl -tag -width MOUSE -.It bit 4..7 ACCELERATION -This flag controls the amount of acceleration effect. -The smaller the value of this flag is, more sensitive the movement becomes. -The minimum value allowed, thus the value for the most sensitive setting, -is one. -Setting this flag to zero will completely disables the -acceleration effect. -.El -.Sh IOCTLS -There are a few -.Xr ioctl 2 -commands for mouse drivers. -These commands and related structures and constants are defined in -.In sys/mouse.h . -General description of the commands is given in -.Xr mouse 4 . -This section explains the features specific to the -.Nm -driver. -.Pp -.Bl -tag -width MOUSE -compact -.It Dv MOUSE_GETLEVEL Ar int *level -.It Dv MOUSE_SETLEVEL Ar int *level -These commands manipulate the operation level of the -.Nm -driver. -.Pp -.It Dv MOUSE_GETHWINFO Ar mousehw_t *hw -Returns the hardware information of the attached device in the following -structure. -Only the -.Dv iftype -field is guaranteed to be filled with the correct value by the current -version of the -.Nm -driver. -.Bd -literal -typedef struct mousehw { - int buttons; /* number of buttons */ - int iftype; /* I/F type */ - int type; /* mouse/track ball/pad... */ - int model; /* I/F dependent model ID */ - int hwid; /* I/F dependent hardware ID */ -} mousehw_t; -.Ed -.Pp -The -.Dv buttons -field holds the number of buttons on the device. -.Pp -The -.Dv iftype -is either -.Dv MOUSE_IF_BUS -or -.Dv MOUSE_IF_INPORT . -.Pp -The -.Dv type -may be -.Dv MOUSE_MOUSE , -.Dv MOUSE_TRACKBALL , -.Dv MOUSE_STICK , -.Dv MOUSE_PAD , -or -.Dv MOUSE_UNKNOWN . -.Pp -The -.Dv model -is always -.Dv MOUSE_MODEL_GENERIC -at the operation level 0. -It may be -.Dv MOUSE_MODEL_GENERIC -or one of -.Dv MOUSE_MODEL_XXX -constants at higher operation levels. -.Pp -The -.Dv hwid -is always 0. -.Pp -.It Dv MOUSE_GETMODE Ar mousemode_t *mode -The command gets the current operation parameters of the mouse -driver. -.Bd -literal -typedef struct mousemode { - int protocol; /* MOUSE_PROTO_XXX */ - int rate; /* report rate (per sec), -1 if unknown */ - int resolution; /* MOUSE_RES_XXX, -1 if unknown */ - int accelfactor; /* acceleration factor */ - int level; /* driver operation level */ - int packetsize; /* the length of the data packet */ - unsigned char syncmask[2]; /* sync. bits */ -} mousemode_t; -.Ed -.Pp -The -.Dv protocol -is either -.Dv MOUSE_PROTO_BUS -or -.Dv MOUSE_PROTO_INPORT -at the operation level zero. -.Dv MOUSE_PROTO_SYSMOUSE -at the operation level one. -.Pp -The -.Dv rate -is the status report rate (reports/sec) at which the device will send -movement report to the host computer. -As there is no standard to detect the current setting, -this field is always set to -1. -.Pp -The -.Dv resolution -is always set to -1. -.Pp -The -.Dv accelfactor -field holds a value to control acceleration feature -(see -.Sx Acceleration ) . -It is zero or greater. -If it is zero, acceleration is disabled. -.Pp -The -.Dv packetsize -field specifies the length of the data packet. -It depends on the -operation level. -.Pp -.Bl -tag -width level_0__ -compact -.It Em level 0 -5 bytes -.It Em level 1 -8 bytes -.El -.Pp -The array -.Dv syncmask -holds a bit mask and pattern to detect the first byte of the -data packet. -.Dv syncmask[0] -is the bit mask to be ANDed with a byte. -If the result is equal to -.Dv syncmask[1] , -the byte is likely to be the first byte of the data packet. -Note that this detection method is not 100% reliable, -thus, should be taken only as an advisory measure. -.Pp -Only -.Dv level -and -.Dv accelfactor -are modifiable by the -.Dv MOUSE_SETMODE -command. -Changing the other field doesn't cause error, but has no effect. -.Pp -.It Dv MOUSE_SETMODE Ar mousemode_t *mode -The command changes the current operation parameters of the mouse driver -as specified in -.Ar mode . -Only -.Dv level -and -.Dv accelfactor -may be modifiable. -Setting values in the other field does not generate -error and has no effect. -.\" .Pp -.\" .It Dv MOUSE_GETVARS Ar mousevar_t *vars -.\" .It Dv MOUSE_SETVARS Ar mousevar_t *vars -.\" These commands are not supported by the -.\" .Nm -.\" driver. -.Pp -.It Dv MOUSE_READDATA Ar mousedata_t *data -.It Dv MOUSE_READSTATE Ar mousedata_t *state -These commands are not supported by the -.Nm -driver. -.Pp -.It Dv MOUSE_GETSTATUS Ar mousestatus_t *status -The command returns the current state of buttons and -movement counts as described in -.Xr mouse 4 . -.El -.Sh FILES -.Bl -tag -width /dev/nmse0 -compact -.It Pa /dev/mse0 -`non-blocking' device node -.It Pa /dev/nmse0 -`non-blocking' device node -.El -.Sh EXAMPLES -.Dl "device mse0 at isa? port 0x23c irq 5" -.Pp -Add the -.Nm -driver at the primary port address with the IRQ 5. -.Pp -.Dl "device mse1 at isa? port 0x238 flags 0x30 irq 4" -.Pp -Define the -.Nm -driver at the secondary port address with the IRQ 4 and the acceleration -factor of 3. -.Sh CAVEAT -Some bus mouse interface cards generate interrupts at the fixed report rate -when enabled, whether or not the mouse state is changing. -The others generate interrupts only when the state is changing. -.Sh SEE ALSO -.Xr ioctl 2 , -.Xr mouse 4 , -.Xr psm 4 , -.Xr sysmouse 4 , -.Xr moused 8 -.\".Sh HISTORY diff --git a/share/man/man4/man4.i386/rc.4 b/share/man/man4/man4.i386/rc.4 deleted file mode 100644 index 28688f4296..0000000000 --- a/share/man/man4/man4.i386/rc.4 +++ /dev/null @@ -1,104 +0,0 @@ -.\" -.\" Copyright (c) 2004 Tom Rhodes -.\" 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. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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: src/share/man/man4/rc.4,v 1.5 2005/03/18 02:38:03 brueffer Exp $ -.\" -.Dd March 18, 2005 -.Dt RC 4 -.Os -.Sh NAME -.Nm rc -.Nd RISCom/8 multiport card -.Sh SYNOPSIS -.Cd device isa -.Cd device rc -.Sh DESCRIPTION -The -.Tn RISCom/8 -is an eight port -.Tn ISA -.Tn RS-232C -communications multiplexer with a built in -.Tn RISC -processor. -It uses a block of sixteen -.Tn I/O -ports in the range 0x200 to 0x3f0 selectable by on-board -switches or jumpers. -The block must be aligned on a sixteen port boundary. -.Pp -This driver is mostly based on the Cirrus Logic CL-CD180 driver. -.Sh HARDWARE -The -.Nm -driver provides support for the -.Tn SDL -Communications -.Tn RISCom/8 -boards. -.Sh DIAGNOSTICS -The following driver specific error messages -may be reported: -.Bl -diag -.It "rc%d channel%d: interrupt-level buffer overflow" -An internal buffer overflow error has occurred on -the listed channel. -The -.Nm -driver will need to be reloaded to correct this. -.It "rc%d: Bad char chan %d" -The channel has obtained a bad set of characters. -.It "rc%d: Got extra chars chan %d" -The -.Nm -driver got more characters than expected on the channel shown. -.It "rc%d: data mismatch chan %d ptr %d (%d != %d)" -Data sent from channel -.Ar %d -to the rx buffer was different then expected. -.It "rc%d: channel %d command timeout, rc.c line: %d" -A command timeout has occurred on the channel, the -.Pa src/sys/dev/serial/rc/rc.c -file can be consulted for more information. -.El -.Sh SEE ALSO -.Xr tty 1 , -.Xr ttyname 3 , -.Xr sio 4 , -.Xr tty 4 , -.Xr comcontrol 8 , -.Xr getty 8 -.Pp -.Pa http://www.sdlcomm.com -.Sh HISTORY -The -.Nm -driver first appeared in -.Fx 2.0.5 . -This manual page first appeared in -.Fx 5.3 . -.Sh AUTHORS -This manual page was written by -.An Tom Rhodes Aq trhodes@FreeBSD.org . diff --git a/share/man/man4/man4.i386/rdp.4 b/share/man/man4/man4.i386/rdp.4 deleted file mode 100644 index b642f49cf1..0000000000 --- a/share/man/man4/man4.i386/rdp.4 +++ /dev/null @@ -1,180 +0,0 @@ -.\" -.\" -.\" Copyright (c) 1997 Joerg Wunsch -.\" -.\" 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. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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: src/share/man/man4/man4.i386/rdp.4,v 1.5.2.4 2001/08/17 13:08:46 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/rdp.4,v 1.4 2007/05/17 08:19:01 swildner Exp $ -.\" -.\" -.\" " (emacs disconfusion) -.Dd December 21, 1998 -.Dt RDP 4 i386 -.Os -.Sh NAME -.Nm rdp -.Nd Ethernet driver for RealTek RTL 8002 pocket ethernet -.Sh SYNOPSIS -.Cd "device rdp0 at isa? port 0x378 irq 7" -.Cd "device rdp0 at isa? port 0x378 irq 7 flags 0x2" -.Sh DESCRIPTION -The -.Nm -device driver supports RealTek RTL 8002-based pocket ethernet adapters, -connected to a standard parallel port. -.Pp -These adapters seem to belong to the cheaper choices among pocket -ethernet adapters. The RTL 8002 is the central part, containing an -interface to BNC and UTP (10 Mbit/s) media, as well as a host -interface that is designed to talk to standard parallel printer -adapters. For the full ethernet adapter to work, it is completed by -an external RAM used as the Tx and Rx packet buffer (16 K x 4 for the -RTL 8002), and an EEPROM to hold the assigned ethernet hardware -address. For the RTL 8002, the EEPROM can be either a standard 93C46 -serial EEPROM (which seems to be a common choice), or a 74S288 -parallel one. The latter variant needs the device configuration flag -0x1 in order to work. -.Pp -Since standard printer adapters seem to vary wildly among their timing -requirements, there are currently two possible choices for the way -data are being exchanged between the pocket ethernet adapter and the -printer interface. The default is the fastest mode the RTL 8002 -supports. If the printer adapter to use is particularly slow (which -can be noticed by watching the ethernet wire for crippled packets, or -by not seeing correctly received packets), the configuration flag 0x2 -can be set in order to throttle down the -.Nm -driver. Note that in fast mode, the data rate is asymmetric, sending -is a little faster (up to two times) than receiving. Rates like 150 -KB/s for sending and 80 KB/s for receiving are common. For slow mode, -both rates are about the same, and in the range of 50 KB/s through 70 -KB/s. As always, your mileage may vary. -.Pp -In case the adapter isn't recognized at boot-time, setting the -.Em bootverbose -flag -.Pq Ql \-v -might help in diagnosing the reason. Since the RTL 8002 requires -the availability of a working interrupt for the printer adapter (unlike -the -.Xr ppc 4 -driver), the -.Nm -driver fails to attach if the ethernet adapter cannot assert an -interrupt at probe time. -.Pp -The RTL 8002 doesn't support (hardware) multicast. -.Pp -The -.Nm -driver internally sets a flag so it gets probed very early. This way, -it is possible to configure both, an -.Nm -driver as well as a -.Xr ppc 4 -driver into the same kernel. If no RTL 8002 hardware is present, probing -will eventually detect the printer driver. -.Sh DIAGNOSTICS -.Dl "rdp0: configured IRQ (7) cannot be asserted by device" -.Pp -The probe routine was unable to get the RTL 8002 asserting an interrupt -request through the printer adapter. -.Pp -.Dl "rdp0: failed to find a valid hardware address in EEPROM" -.Pp -Since there doesn't seem to be a standard place for storing the hardware -ethernet address within the EEPROM, the -.Nm -driver walks the entire (serial) EEPROM contents until it finds something -that looks like a valid ethernet hardware address, based on the IEEE's -OUI assignments. This diagnostic tells the driver was unable to find -one. Note: it might as well be the current adapter is one of the rare -examples with a 74S288 EEPROM, so -.Ql flags 0x1 -should be tried. -.Pp -.Dl "rdp0: Device timeout" -.Pp -After initiating a packet transmission, the ethernet adapter didn't -return a notification of the (successful or failed) transmission. The -hardware is likely to be wedged, and is being reset. -.Sh SEE ALSO -.Xr ng_ether 4 , -.Xr ppc 4 , -.Xr ifconfig 8 -.Sh AUTHORS -This driver was written by -.An J\(:org Wunsch , -based on RealTek's packet driver for the RTL 8002, as well as on some -description of the successor chip, RTL 8012, gracefully provided by -RealTek. -.Sh BUGS -There are certainly many of them. -.Pp -Since the -.Nm -driver wants to probe its hardware at boot-time, the adapter needs -to be present then in order to be detected. -.Pp -Only two out of the eight different speed modes RealTek's packet -driver could handle are implemented. Thus there might be hardware -where even the current slow mode is too fast. -.Pp -There should be a DMA transfer test in the probe routine that figures -out the usable mode automatically. -.Pp -Abusing a standard printer interface for data exchange is error-prone. -Occasional stuck hardware shouldn't surprise too much, hopefully the -timeout routine will catch these cases. Flood-pinging is a good -example of triggering this problem. Likewise, albeit BPF is of course -supported, it's certainly a bad idea attempting to watch a crowded -ethernet wire using promiscuous mode. -.Pp -Since the RTL 8002 has only 4 KB of Rx buffer space (2 x 2 KB are used -as Tx buffers), the usual NFS deadlock with large packets arriving too -quickly could happen if a machine using the -.Nm -driver NFS-mounts some fast server with the standard NFS blocksize of -8 KB. (Since NFS can only retransmit entire NFS packets, the same -packet will be retransmitted over and over again.) -.Pp -The heuristic to find out the ethernet hardware address from the -EEPROM sucks, but seems to be the only sensible generic way that -doesn't depend on the actual location in EEPROM. RealTek's sample -driver placed it directly at address 0, other vendors picked something -like 15, with other junk in front of it that must not be confused with -a valid ethernet address. -.Pp -The driver should support the successor chip RTL 8012, which seems to -be available and used these days. (The RTL 8002 is already somewhat -aged, around 1992/93.) The RTL 8012 offers support for advanced -printer adapter hardware, like bidirectional SPP, or EPP, which could -speed up the transfers substantially. The RTL 8012 also supports -hardware multicast, and has the ability to address 64 K x 4 packet -buffer RAM. -.Pp -The driver should be layered upon the ppc driver, instead of working -standalone, and should be available as a loadable module, so the -device probing can be deferred until the pocket ethernet adapter has -actually been attached. diff --git a/share/man/man4/man4.i386/tw.4 b/share/man/man4/man4.i386/tw.4 deleted file mode 100644 index 5ec3ca1576..0000000000 --- a/share/man/man4/man4.i386/tw.4 +++ /dev/null @@ -1,108 +0,0 @@ -.\" Copyright (c) 1992, 1993 Eugene W. Stark -.\" 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 Eugene W. Stark. -.\" 4. 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 EUGENE W. STARK (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: src/share/man/man4/man4.i386/tw.4,v 1.9.2.3 2001/08/17 13:08:46 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/tw.4,v 1.3 2006/08/18 01:42:58 swildner Exp $ -.\" -.Dd October 30, 1993 -.Dt TW 4 i386 -.Os -.Sh NAME -.Nm tw -.Nd TW-523 X-10 device driver -.Sh DESCRIPTION -.Nm Tw -is the driver for the TW-523 power line interface, for use with X-10 home -control products. The X-10 protocol is compatible with a number of home -control systems, including Radio Shack ``Plug 'n Power(tm)'' and -Stanley ``Lightmaker(tm).'' -.Pp -The driver supports -.Fn read -.Fn write -and -.Fn select -system calls. -The driver allows multiple processes to read and write simultaneously, -but there is probably not much sense in having more than one reader or more -than one writer at a time, and in fact there may currently be a race -condition in the driver if two processes try to transmit simultaneously -(due to unsynchronized access to the sc_pkt structure in tw_sc). -.Pp -Transmission is done by calling -.Fn write -to send three byte packets of data. -The first byte contains a four bit house code (0=A to 15=P). The second byte -contains a five bit unit/key code (0=unit 1 to 15=unit 16, 16=All Units Off -to 31 = Status Request). The third byte specifies the number of times the -packet is to be transmitted without any gaps between successive transmissions. -Normally this is 2, as per the X-10 documentation, but sometimes (e.g. for -bright and dim codes) it can be another value. Each call to -.Fn write -can specify -an arbitrary number of data bytes, but at most one packet will actually be -processed in any call. Any incomplete packet is buffered until a subsequent -call to -.Fn write -provides data to complete it. Successive calls to -.Fn write -leave a three-cycle gap between transmissions, per the X-10 documentation. -The driver transmits each bit only once per half cycle, not three times as -the X-10 documentation states, because the TW523 only provides sync on -each power line zero crossing. So, the driver will probably not work -properly if you have three-phase service. Most residences use a two-wire -system, for which the driver does work. -.Pp -Reception is done using -.Fn read -The driver produces a series of three -character packets. In each packet, the first character consists of flags, -the second character is a four bit house code (0-15), and the third character -is a five bit key/function code (0-31). The flags are the following: -.Bd -literal -#define TW_RCV_LOCAL 1 /* The packet arrived during a local transmission */ -#define TW_RCV_ERROR 2 /* An invalid/corrupted packet was received */ -.Ed -.Pp -The -.Fn select -system call can be used in the usual way to determine if there -is data ready for reading. -.Sh FILES -.Bl -tag -width /dev/tw -.It Pa /dev/tw? -the TW523 special file -.El -.Sh SEE ALSO -.Xr xten 1 , -.Xr xtend 8 -.Pp -TW-523 documentation from X-10 Inc. -.Sh AUTHORS -.An Eugene W. Stark Aq stark@cs.sunysb.edu diff --git a/share/man/man4/man4.i386/wl.4 b/share/man/man4/man4.i386/wl.4 deleted file mode 100644 index 2b4b73443b..0000000000 --- a/share/man/man4/man4.i386/wl.4 +++ /dev/null @@ -1,163 +0,0 @@ -.\" -.\" Copyright (c) 1997, Jim Binkley -.\" 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 Jim Binkley -.\" 4. 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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: src/share/man/man4/man4.i386/wl.4,v 1.10.2.5 2002/03/19 18:24:15 schweikh Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/wl.4,v 1.5 2008/04/15 19:19:49 swildner Exp $ -.Dd July 7, 1997 -.Dt WL 4 i386 -.Os -.Sh NAME -.Nm wl -.Nd T1 speed ISA/radio lan card -.Sh SYNOPSIS -.Cd "device wl0 at isa? port 0x300 irq 5" -.Sh DESCRIPTION -The -.Nm -driver controls a radio lan card system made originally by -NCR, then ATT, now Lucent. The system is spread-spectrum radio -at around 915 MHz (or 2.4 GHz). With the supplied omni-directional antennae, -about 400 feet (indoors, more outdoors) can be covered in circumference. -This card can talk to the companion (wlp0) pccard. Speeds vary -from 1 megabit to theoretically 2 megabits (roughly T1 in speed). -.Pp -The card has three fundamental hardware -units, a so-called PSA or programmable storage area, a radio modem, -and an ethernet lan controller. The latter component is the -ancient (and not very honorable) Intel 82586 ethernet chip. -Fundamentally it appears to the operating system as an ethernet system, -and speaks IEEE MAC addresses. The radio modem simply translates -ethernet packets to/from radio packets, that are either at 2.4 GHz -or 915 MHz depending on the radio modem. It supports a collision -avoidance scheme. The lan controller -supports promiscuous mode, broadcast, and multicasting -(although there is a glitch -in the latter). "It thinks it is ethernet". -.Pp -How it is used -depends on the kind of antennae deployed with it. Point to point -applications are possible as are ethernet-like lan use. The vendor -ships an omni-directional antennae that works in the -vicinity of 400 feet (indoors). -Point to point antennae can be purchased that will go miles. -.Sh SETUP -The card can either be initialized with the vendor supplied DOS setup software. -Typically minimally an IRQ, port, and Network ID must be supplied. -Michael Smith's -.Xr wlconfig 8 -utility can now be used to do this work from the -.Ux -side. The card is "not" plug and play. -The network id controls whether one set of cards can hear another. -If different, cards will read physical packets, but they will be discarded -by the radio modem. -.Sh CONTROL -In addition to the config utility, there are several sysctl -switches that can be used to modify runtime parameters. -The -.Xr sysctl 8 -variables are as follows: -.Bl -diag -.It "machdep.wl_xmit_delay " -This variable will cause the driver to insert a delay on transmit. -250 is the default. The delay should probably be a bit longer -on faster cpus and less on slower cpus. It exists because the 82586 -was not designed to work with pentium-speed cpu systems and if overdriven -will have copious xmit side errors. -.It machdep.wl_ignore_nwid <0 | 1> -This switch defaults to 0; i.e., the nwid is not ignored. It can -be set to 1 to cause the nwid to not be used. This may be useful -when the device is in promiscuous mode as one can watch for all -packets and ignore nwid differences. -.It machdep.wl_xmit_watch -This switch is not currently useful. -.It machdep.wl_gather_snr -This switch is not currently useful. -.Pp -There is also a signal strength cache in the driver. It may be interrogated -with -.Xr wlconfig 8 . -Incoming packets -are checked for certain hardware radio-modem values including signal -strength, silence, and quality, which range fro 0..63, 0..63, and 0..15 -respectively. Thus one can read out signal strenth values to see -how close/far peer nodes are. The signal strength cache is indexed by -sender MAC address. -There are two sysctls that change how it filters packets. Both are on -by default. -.It machdep.wl_wlcache_mcastonly <0 | 1> -By default this switch is on. -It forces the cache to filter out -unicast packets. Only broadcast or multicast packets are accepted. -.It machdep.wl_wlcache_iponly <0 | 1> -By default this switch is on. It forces the driver to discard non-IP -packets and also stores the IP src address. ARP packets are ignored, -as are any other network protocol barring IPv4 packets. -.El -.Sh CAVEATS -The 82586 has numerous defects. It may experience transmit-side -errors when modern faster cpus send packets at it faster than it can handle. -The driver (and probably the chip) does not support an all multicast mode. -As a result, it can be used with applications like -.Xr mrouted 8 , -but it must go into promiscuous mode for that to work. The driver -is slow to change modes from "normal" to promiscuous mode, presumably -due to delays in the configuration code. -.Sh SEE ALSO -.Xr sysctl 8 , -.Xr wlconfig 8 -.Pp -.Pa http://web.archive.org/web/*/http://www.wavelan.com -.Sh HISTORY -The -.Nm -driver was written by -.An Anders Klemets -(thousands of years ago?) and -appears to be based on an even older Intel 82586 driver. The 82586 -controller was one of the first (if not the first?) integrated lan -controller on the block. That does not mean it was the best either. -Anders ported and or created a driver for the ISA wavelan and PCCARD -wavelan system too (wlp). -.An Robert T. Morris, Jr. -ported the Mach drivers to BSDI. -.An Jim Binkley -ported them to -.Fx 2.1 . -.An Michael Smith -ported the wl driver only to 2.2.2. Jim and Michael have been -maintaining them. The current state of the driver is NOT ANYONE'S -FAULT. Thanks to -.An Bernie Doehner -and -.An Robert Buaas -for contributions. -.Sh AUTHORS -Too numerous to mention. See above. diff --git a/share/man/man4/man4.i386/wt.4 b/share/man/man4/man4.i386/wt.4 deleted file mode 100644 index f25a663508..0000000000 --- a/share/man/man4/man4.i386/wt.4 +++ /dev/null @@ -1,47 +0,0 @@ -.\" -.\" Copyright (c) 1994 James A. Jegers -.\" 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. 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 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: src/share/man/man4/man4.i386/wt.4,v 1.6.2.5 2001/08/17 13:08:46 ru Exp $ -.\" $DragonFly: src/share/man/man4/man4.i386/wt.4,v 1.2 2003/06/17 04:37:00 dillon Exp $ -.\" -.Dd July 10, 1995 -.Dt WT 4 i386 -.Os -.Sh NAME -.Nm wt -.Nd Archive/Wangtek cartridge tape driver -.Sh SYNOPSIS -.Cd "device wt0 at isa? port 0x300 irq 5 drq 1" -.Sh DESCRIPTION -The -.Nm -driver provides support for the following Archive and Wangtek boards: -.Pp -.Bl -item -offset indent -compact -.It -QIC-02 -.It -QIC-36 -.El -.Sh SEE ALSO -.Xr intro 4 diff --git a/share/man/man4/mouse.4 b/share/man/man4/mouse.4 index f2f86c43fe..4294e41655 100644 --- a/share/man/man4/mouse.4 +++ b/share/man/man4/mouse.4 @@ -25,7 +25,6 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/mouse.4,v 1.8.2.3 2001/12/17 11:30:12 ru Exp $ -.\" $DragonFly: src/share/man/man4/mouse.4,v 1.2 2003/06/17 04:36:59 dillon Exp $ .\" .Dd December 3, 1997 .Dt MOUSE 4 @@ -37,7 +36,6 @@ .In sys/mouse.h .Sh DESCRIPTION The mouse drivers -.Xr mse 4 , .Xr psm 4 , .Xr ums 4 and @@ -379,8 +377,6 @@ command. .Bl -tag -width /dev/sysmouseXX -compact .It Pa /dev/cuaa%d serial ports -.It Pa /dev/mse%d -bus and InPort mouse device .It Pa /dev/psm%d PS/2 mouse device .It Pa /dev/sysmouse @@ -390,7 +386,6 @@ USB mouse device .El .Sh SEE ALSO .Xr ioctl 2 , -.Xr mse 4 , .Xr psm 4 , .Xr sysmouse 4 , .Xr ums 4 , diff --git a/share/man/man4/psm.4 b/share/man/man4/psm.4 index 29a5d8c2fe..ad564a4f59 100644 --- a/share/man/man4/psm.4 +++ b/share/man/man4/psm.4 @@ -25,7 +25,6 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/psm.4,v 1.24.2.9 2002/12/29 16:35:38 schweikh Exp $ -.\" $DragonFly: src/share/man/man4/psm.4,v 1.7 2008/05/02 02:05:05 swildner Exp $ .\" .Dd October 15, 2010 .Dt PSM 4 @@ -826,7 +825,6 @@ Clicking any button without moving the mouse may also work. .Xr syslog 3 , .Xr atkbdc 4 , .Xr mouse 4 , -.Xr mse 4 , .Xr sysmouse 4 , .Xr moused 8 , .Xr syslogd 8 diff --git a/share/man/man4/scsi.4 b/share/man/man4/scsi.4 index f3539ce8dd..918f0c184a 100644 --- a/share/man/man4/scsi.4 +++ b/share/man/man4/scsi.4 @@ -258,7 +258,6 @@ utility. See .Xr camcontrol 8 for details. .Sh SEE ALSO -.Xr aha 4 , .Xr ahc 4 , .Xr bt 4 , .Xr cd 4 , diff --git a/share/man/man4/sn.4 b/share/man/man4/sn.4 index 56dbcadda2..12a0d68e4a 100644 --- a/share/man/man4/sn.4 +++ b/share/man/man4/sn.4 @@ -23,7 +23,6 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/sn.4,v 1.4.2.1 2002/11/19 22:05:47 bmah Exp $ -.\" $DragonFly: src/share/man/man4/sn.4,v 1.2 2003/06/17 04:36:59 dillon Exp $ .\" .Dd November 7, 2000 .Dt SN 4 @@ -39,11 +38,8 @@ The device driver supports SMC9xxx based ISA and PCMCIA cards. .Sh SEE ALSO .Xr ed 4 , -.Xr el 4 , .Xr ep 4 , -.Xr ie 4 , .Xr intro 4 , -.Xr le 4 , .Xr ng_ether 4 , .Xr vx 4 , .Xr ifconfig 8 diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 321716aac9..7030394f12 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -1955,11 +1955,9 @@ is set to this is the actual port the mouse is on. It might be .Pa /dev/cuaa0 -for a COM1 serial mouse, +for a COM1 serial mouse or .Pa /dev/psm0 -for a PS/2 mouse or -.Pa /dev/mse0 -for a bus mouse, for example. +for a PS/2 mouse, for example. .It Va moused_flags .Pq Vt str If diff --git a/sys/boot/common/pnpdata b/sys/boot/common/pnpdata index 70a261e75c..4c7da3347f 100644 --- a/sys/boot/common/pnpdata +++ b/sys/boot/common/pnpdata @@ -1,6 +1,5 @@ # # $FreeBSD: src/sys/boot/common/pnpdata,v 1.2 1999/08/28 00:39:51 peter Exp $ -# $DragonFly: src/sys/boot/common/pnpdata,v 1.4 2007/05/17 19:26:05 swildner Exp $ # # This file contains the system default Plug-and-Play data. It is # derived from a number of sources, including: @@ -91,9 +90,6 @@ ident=PNP80d4 module=ed # Novell/Anthem NE2000 ident=PNP80d5 module=ed # NE1000 Compatible ident=PNP80d6 module=ed # NE2000 Compatible ident=PNP80d8 module=lnc # Novell/Anthem NE2100 -ident=PNP80e9 module=le # DEC (DE200) EtherWorks Turbo -ident=PNP80eb module=le # DEC (DE201) EtherWorks Turbo/TP -ident=PNP80ec module=le # DEC (DE202) EtherWorks Turbo/TP_BNC ident=PNP80f1 module=eg # 3Com EtherLink Plus ident=PNP80f3 module=ed # 3Com EtherLink II or IITP (8 or 16-bit) ident=PNP80f6 module=ed # 3Com EtherLink 16 @@ -106,7 +102,6 @@ ident=PNP8126 module=ed # SMC EtherCard PLUS With Boot ROM Socket (W ident=PNP8127 module=ed # SMC EtherCard PLUS With Boot ROM Socket (WD/8003EB) ident=PNP8128 module=ed # SMC EtherCard PLUS TP (WD/8003WT) ident=PNP812a module=ed # SMC EtherCard PLUS 16 With Boot ROM Socket (WD/8013EBT) -ident=PNP812d module=ie # Intel EtherExpress 16 or 16TP ident=PNP8137 module=ed # Artisoft AE-1 ident=PNP8138 module=ed # Artisoft AE-2 or AE-3 ident=PNP8158 module=ed # HP PC LAN Adapter/16 TP Plus (HP27247B) diff --git a/sys/bus/isa/i386/isa_compat.h b/sys/bus/isa/i386/isa_compat.h index 032205624d..f1f282c456 100644 --- a/sys/bus/isa/i386/isa_compat.h +++ b/sys/bus/isa/i386/isa_compat.h @@ -26,20 +26,7 @@ * $FreeBSD: src/sys/i386/isa/isa_compat.h,v 1.27.2.11 2002/10/05 18:31:48 scottl Exp $ */ -#include "use_el.h" -#include "use_le.h" -#include "use_rdp.h" -#include "use_wt.h" -#include "use_ctx.h" -#include "use_spigot.h" -#include "use_gp.h" -#include "use_gsc.h" #include "use_cy.h" -#include "use_dgb.h" -#include "use_labpc.h" -#include "use_rc.h" -#include "use_tw.h" -#include "use_asc.h" #include "use_stl.h" #include "use_stli.h" @@ -48,20 +35,7 @@ struct old_isa_driver { struct isa_driver *driver; }; -extern struct isa_driver eldriver; -extern struct isa_driver ledriver; -extern struct isa_driver rdpdriver; -extern struct isa_driver wtdriver; -extern struct isa_driver ctxdriver; -extern struct isa_driver spigotdriver; -extern struct isa_driver gpdriver; -extern struct isa_driver gscdriver; -extern struct isa_driver cydriver; -extern struct isa_driver dgbdriver; -extern struct isa_driver labpcdriver; -extern struct isa_driver rcdriver; -extern struct isa_driver twdriver; -extern struct isa_driver ascdriver; +extern struct isa_driver cydriver; extern struct isa_driver stldriver; extern struct isa_driver stlidriver; @@ -73,38 +47,14 @@ static struct old_isa_driver old_drivers[] = { /* Sensitive BIO */ /* Sensitive NET */ -#if NRDP > 0 - { 0, &rdpdriver }, -#endif /* Sensitive CAM */ /* TTY */ -#if NGP > 0 - { 0, &gpdriver }, -#endif -#if NGSC > 0 - { 0, &gscdriver }, -#endif #if NCY > 0 { 0, &cydriver }, #endif -#if NDGB > 0 - { 0, &dgbdriver }, -#endif -#if NLABPC > 0 - { 0, &labpcdriver }, -#endif -#if NRC > 0 - { 0, &rcdriver }, -#endif -#if NTW > 0 - { 0, &twdriver }, -#endif -#if NASC > 0 - { 0, &ascdriver }, -#endif #if NSTL > 0 { 0, &stldriver }, #endif @@ -114,28 +64,10 @@ static struct old_isa_driver old_drivers[] = { /* BIO */ -#if NWT > 0 - { 0, &wtdriver }, -#endif - /* NET */ -#if NLE > 0 - { 0, &ledriver }, -#endif -#if NEL > 0 - { 0, &eldriver }, -#endif - /* MISC */ -#if NCTX > 0 - { 0, &ctxdriver }, -#endif -#if NSPIGOT > 0 - { 0, &spigotdriver }, -#endif - }; #define old_drivers_count NELEM(old_drivers) diff --git a/sys/conf/files b/sys/conf/files index 50a10fcae2..3bc4c7d04e 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -188,8 +188,6 @@ dev/raid/amr/amr_cam.c optional amrp amr dev/raid/amr/amr_disk.c optional amr #dev/raid/amr/amr_linux.c optional amr compat_linux dev/raid/amr/amr_pci.c optional amr pci -dev/disk/aha/aha.c optional aha -dev/disk/aha/aha_isa.c optional aha isa dev/disk/aic/aic.c optional aic dev/disk/aic/aic_pccard.c optional aic pccard dev/disk/aic7xxx/ahc_pci.c optional ahc pci @@ -376,7 +374,6 @@ dev/raid/hptmv/mv.c optional hptmv dev/raid/hptmv/gui_lib.c optional hptmv dev/raid/hptmv/hptproc.c optional hptmv dev/raid/hptmv/ioctl.c optional hptmv -dev/netif/ie/if_ie.c optional nowerror ie isa dev/powermng/ichsmb/ichsmb.c optional ichsmb dev/powermng/ichsmb/ichsmb_pci.c optional ichsmb pci dev/powermng/coretemp/coretemp.c optional coretemp diff --git a/sys/config/GENERIC b/sys/config/GENERIC index f4c6b2799d..632abe321f 100644 --- a/sys/config/GENERIC +++ b/sys/config/GENERIC @@ -135,7 +135,6 @@ options SYM_SETUP_LP_PROBE_MAP=0x40 device adv0 at isa? device adw device bt0 at isa? -device aha0 at isa? device aic0 at isa? device ncv # NCR 53C500 @@ -304,8 +303,6 @@ device ral # Ralink Technology 802.11 wireless NIC device wi # The probe order of these is presently determined by i386/isa/isa_compat.c. -device ie0 at isa? disable port 0x300 irq 10 iomem 0xd0000 -#device le0 at isa? disable port 0x300 irq 5 iomem 0xd0000 device lnc0 at isa? disable port 0x280 irq 10 drq 0 device cs0 at isa? disable port 0x300 device sn0 at isa? disable port 0x300 irq 10 diff --git a/sys/config/LINT b/sys/config/LINT index 318e97377e..413f86d863 100644 --- a/sys/config/LINT +++ b/sys/config/LINT @@ -1194,11 +1194,10 @@ device npx0 at nexus? port IO_NPX flags 0x0 irq 13 # # -# SCSI host adapters: `aha', `aic', `bt' +# SCSI host adapters: `aic' and `bt' # # adv: All Narrow SCSI bus AdvanSys controllers. # adw: Second Generation AdvanSys controllers including the ADV940UW. -# aha: Adaptec 154x # ahc: Adaptec 274x/284x/294x # aic: Adaptec 152x # bt: Most Buslogic controllers @@ -1213,7 +1212,6 @@ device npx0 at nexus? port IO_NPX flags 0x0 irq 13 device bt0 at isa? port IO_BT0 device adv0 at isa? device adw -device aha0 at isa? device aic0 at isa? device ncv device nsp @@ -1328,13 +1326,8 @@ device fd0 at fdc0 drive 0 device fd1 at fdc0 drive 1 # -# Other standard PC hardware: `mse', `sio', etc. -# -# mse: Logitech and ATI InPort bus mouse ports # sio: serial ports (see sio(4)) -device mse0 at isa? port 0x23c irq 5 - device sio0 at isa? port IO_COM1 flags 0x10 irq 4 # @@ -1383,24 +1376,18 @@ options COM_MULTIPORT #code for some cards with shared IRQs device puc # -# Network interfaces: `ed', `el', `ep', `ie', `is', `le', `lnc' +# Network interfaces: `ed', `ep', `is', `lnc' # # ar: Arnet SYNC/570i hdlc sync 2/4 port V.35/X.21 serial driver (requires sppp) # cs: IBM Etherjet and other Crystal Semi CS89x0-based adapters # ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 -# el: 3Com 3C501 (slow!) # ep: 3Com 3C509 # ex: Intel EtherExpress Pro/10 and other i82595-based adapters # fe: Fujitsu MB86960A/MB86965A Ethernet -# ie: AT&T StarLAN 10 and EN100; 3Com 3C507; unknown NI5210; Intel EtherExpress -# le: Digital Equipment EtherWorks 2 and EtherWorks 3 (DEPCA, DE100, -# DE101, DE200, DE201, DE202, DE203, DE204, DE205, DE422) # lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 & Am79C960) -# rdp: RealTek RTL 8002-based pocket ethernet adapters # sbni: Granch SBNI12-xx adapters # sbsh: Granch SBNI16 SHDSL modem PCI adapters # sr: RISCom/N2 hdlc sync 1/2 port V.35/X.21 serial driver (requires sppp) -# wl: Lucent Wavelan (ISA card only). # wi: Lucent WaveLAN/IEEE 802.11 PCMCIA adapters. Note: this supports both # the PCMCIA and ISA cards: the ISA card is really a PCMCIA to ISA # bridge with a PCMCIA adapter plugged into it. @@ -1411,15 +1398,10 @@ device puc device ar0 at isa? port 0x300 irq 10 iomem 0xd0000 device cs0 at isa? port 0x300 device ed0 at isa? port 0x280 irq 5 iomem 0xd8000 -device el0 at isa? port 0x300 irq 9 device ep device ex device fe0 at isa? port 0x300 -device ie0 at isa? port 0x300 irq 5 iomem 0xd0000 -device ie1 at isa? port 0x360 irq 7 iomem 0xd0000 -device le0 at isa? port 0x300 irq 5 iomem 0xd0000 device lnc0 at isa? port 0x280 irq 10 drq 0 -device rdp0 at isa? port 0x378 irq 7 flags 2 device sbni0 at isa? port 0x210 irq 5 flags 0xefdead device sln device sr @@ -1437,8 +1419,6 @@ device wlan_tkip # 802.11 TKIP support device wlan_wep # 802.11 WEP support device wlan_xauth # 802.11 WPA or 802.1x authentication for AP device wlan_amrr # 802.11 AMRR TX rate control algorithm -options WLCACHE # enables the signal-strength cache -options WLDEBUG # enables verbose debugging output device an # Aironet Communications 4500/4800 device ath # Atheros AR521x options AH_SUPPORT_AR5416 @@ -1456,7 +1436,6 @@ device iwn # Intel WiFi Link 4965/1000/5000/5150/5300/6000/6050 device wi # WaveLAN/IEEE, PRISM-II, Spectrum24 802.11DS #device rtw # RealTek 8180 #device acx # TI ACX100/ACX111. -device wl0 at isa? port 0x300 # T1 speed ISA/radio lan device xe # Xircom PCMCIA device ral # Ralink Technology 802.11 wireless NIC device wpi @@ -1551,22 +1530,11 @@ device "snd_uaudio" # # Miscellaneous hardware: # -# wt: Wangtek and Archive QIC-02/QIC-36 tape drives -# ctx: Cortex-I frame grabber # apm: Laptop Advanced Power Management (experimental) -# spigot: The Creative Labs Video Spigot video-acquisition board # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board # cy: Cyclades serial driver -# dgb: Digiboard PC/Xi and PC/Xe series driver (ALPHA QUALITY!) -# dgm: Digiboard PC/Xem driver -# gp: National Instruments AT-GPIB and AT-GPIB/TNT board -# asc: GI1904-based hand scanners, e.g. the Trust Amiscan Grey -# gsc: Genius GS-4500 hand scanner. # joy: joystick -# labpc: National Instrument's Lab-PC and Lab-PC+ -# rc: RISCom/8 multiport card # rp: Comtrol Rocketport(ISA) - single card -# tw: TW-523 power line interface for use with X-10 home control products # si: Specialix SI/XIO 4-32 port terminal multiplexor # spic: Sony Programmable I/O controller (VAIO notebooks) # stl: Stallion EasyIO and EasyConnection 8/32 (ISA and PCI), EasyConnection 8/64 PCI @@ -1579,17 +1547,6 @@ device "snd_uaudio" # If apm is omitted, some systems require sysctl -w kern.timecounter.method=1 # for correct timekeeping. -# Notes on the spigot: -# The video spigot is at 0xad6. This port address can not be changed. -# The irq values may only be 10, 11, or 15 -# I/O memory is an 8kb region. Possible values are: -# 0a0000, 0a2000, ..., 0fffff, f00000, f02000, ..., ffffff -# The start address must be on an even boundary. -# Add the following option if you want to allow non-root users to be able -# to access the spigot. This option is not secure because it allows users -# direct access to the I/O page. -# options SPIGOT_UNSECURE - # Notes on the Comtrol Rocketport driver: # # The exact values used for rp0 depend on how many boards you have @@ -1616,12 +1573,6 @@ device "snd_uaudio" # # device rp -# Notes on the Digiboard driver: -# -# The following flag values have special meanings: -# 0x01 - alternate layout of pins (dgb & dgm) -# 0x02 - use the windowed PC/Xe in 64K mode (dgb only) - # Notes on the Specialix SI/XIO driver: # **This is NOT a Specialix supported Driver!** # The host card is memory, not IO mapped. @@ -1641,26 +1592,11 @@ device "snd_uaudio" # Stallion: flags 1 iosiz 0x10000 # For the PCI cards, "device stl" will suffice. -# for the SoundBlaster 16 multicd - up to 4 devices -device wt0 at isa? port 0x300 irq 5 drq 1 -device ctx0 at isa? port 0x230 iomem 0xd0000 -device spigot0 at isa? port 0xad6 irq 15 iomem 0xee000 device apm0 -device gp0 at isa? port 0x2c0 -device gsc0 at isa? port IO_GSC1 drq 3 device joy0 at isa? port IO_GAME device cy0 at isa? irq 10 iomem 0xd4000 iosiz 0x2000 -#device dgb0 at isa? port 0x220 iomem 0xfc000 -#options NDGBPORTS=16 # Defaults to 16*NDGB -device dgm0 at isa? port 0x104 iomem 0xd0000 -device labpc0 at isa? port 0x260 irq 5 -device rc0 at isa? port 0x220 irq 12 device nrp -#device rp0 at isa? port 0x280 -# the port and irq for tw0 are fictitious -device tw0 at isa? port 0x380 irq 11 device si0 at isa? iomem 0xd0000 irq 12 -device asc0 at isa? port IO_ASC1 drq 3 irq 10 device spic0 at isa? irq 0 port 0x10a0 device stl0 at isa? port 0x2a0 irq 10 device stli0 at isa? port 0x2a0 iomem 0xcc000 flags 23 iosiz 0x1000 diff --git a/sys/config/LINT64 b/sys/config/LINT64 index 0f1f44a7cc..6fb3943a3f 100644 --- a/sys/config/LINT64 +++ b/sys/config/LINT64 @@ -1022,11 +1022,10 @@ options SC_TWOBUTTON_MOUSE # # -# SCSI host adapters: `aha', `aic', `bt' +# SCSI host adapters: `aic' and `bt' # # adv: All Narrow SCSI bus AdvanSys controllers. # adw: Second Generation AdvanSys controllers including the ADV940UW. -# aha: Adaptec 154x # ahc: Adaptec 274x/284x/294x # aic: Adaptec 152x # bt: Most Buslogic controllers @@ -1041,7 +1040,6 @@ options SC_TWOBUTTON_MOUSE device bt0 at isa? port IO_BT0 device adv0 at isa? device adw -device aha0 at isa? device aic0 at isa? device ncv device nsp @@ -1202,14 +1200,13 @@ options COM_MULTIPORT #code for some cards with shared IRQs # ST16650A-compatible UARTs. # -# Network interfaces: `ed', `ep', `ie', `is', `lnc' +# Network interfaces: `ed', `ep', `is', `lnc' # # cs: IBM Etherjet and other Crystal Semi CS89x0-based adapters # ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 # ep: 3Com 3C509 # ex: Intel EtherExpress Pro/10 and other i82595-based adapters # fe: Fujitsu MB86960A/MB86965A Ethernet -# ie: AT&T StarLAN 10 and EN100; 3Com 3C507; unknown NI5210; Intel EtherExpress # lnc: Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL, AMD Am7990 & Am79C960) # sbsh: Granch SBNI16 SHDSL modem PCI adapters # wi: Lucent WaveLAN/IEEE 802.11 PCMCIA adapters. Note: this supports both @@ -1223,8 +1220,6 @@ device cs0 at isa? port 0x300 device ed0 at isa? port 0x280 irq 5 iomem 0xd8000 device ep device ex -device ie0 at isa? port 0x300 irq 5 iomem 0xd0000 -device ie1 at isa? port 0x360 irq 7 iomem 0xd0000 device lnc0 at isa? port 0x280 irq 10 drq 0 device sln device sn0 at isa? port 0x300 irq 10 diff --git a/sys/config/X86_64_GENERIC b/sys/config/X86_64_GENERIC index 703d909e86..19789875e5 100644 --- a/sys/config/X86_64_GENERIC +++ b/sys/config/X86_64_GENERIC @@ -121,7 +121,6 @@ options SYM_SETUP_LP_PROBE_MAP=0x40 device adv0 at isa? device adw device bt0 at isa? -device aha0 at isa? device aic0 at isa? device ncv # NCR 53C500 @@ -281,7 +280,6 @@ device ral # Ralink Technology 802.11 wireless NIC device wi # The probe order of these is presently determined by i386/isa/isa_compat.c. -#device le0 at isa? disable port 0x300 irq 5 iomem 0xd0000 device lnc0 at isa? disable port 0x280 irq 10 drq 0 device cs0 at isa? disable port 0x300 device sn0 at isa? disable port 0x300 irq 10 diff --git a/sys/dev/disk/Makefile b/sys/dev/disk/Makefile index d71b4d6e15..5aec1b7c6e 100644 --- a/sys/dev/disk/Makefile +++ b/sys/dev/disk/Makefile @@ -1,6 +1,6 @@ .include "${.CURDIR}/../../platform/${MACHINE_PLATFORM}/Makefile.inc" -SUBDIR= aha ahci aic aic7xxx ccd dm iscsi ispfw md mmcsd mps mpt ncv nsp +SUBDIR= ahci aic aic7xxx ccd dm iscsi ispfw md mmcsd mps mpt ncv nsp SUBDIR+= sbp sdhci sili stg trm vn vpo .for dir in ${SUBDIR} diff --git a/sys/dev/disk/aha/Makefile b/sys/dev/disk/aha/Makefile deleted file mode 100644 index a9df3ce23f..0000000000 --- a/sys/dev/disk/aha/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -# $FreeBSD: src/sys/modules/aha/Makefile,v 1.4 2000/01/28 11:26:23 bde Exp $ - -KMOD = aha -SRCS = aha.c aha_isa.c ahareg.h opt_cam.h device_if.h bus_if.h use_aha.h \ - opt_scsi.h isa_if.h -CLEANFILES = use_aha.h - -use_aha.h: - echo "#define NAHA 1" > use_aha.h - -.if !defined(BUILDING_WITH_KERNEL) -opt_scsi.h: - echo "#define SCSI_DELAY 15000" > opt_scsi.h -.endif - -.include diff --git a/sys/dev/disk/aha/aha.c b/sys/dev/disk/aha/aha.c deleted file mode 100644 index ca140fce43..0000000000 --- a/sys/dev/disk/aha/aha.c +++ /dev/null @@ -1,1962 +0,0 @@ -/* - * Generic register and struct definitions for the Adaptech 154x/164x - * SCSI host adapters. Product specific probe and attach routines can - * be found in: - * aha 1540/1542B/1542C/1542CF/1542CP aha_isa.c - * - * Copyright (c) 1998 M. Warner Losh. - * 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, - * without modification, immediately at the beginning of the file. - * 2. 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - * Derived from bt.c written by: - * - * Copyright (c) 1998 Justin T. Gibbs. - * 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, - * without modification, immediately at the beginning of the file. - * 2. 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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: src/sys/dev/aha/aha.c,v 1.34.2.1 2000/08/02 22:24:39 peter Exp $ - * $DragonFly: src/sys/dev/disk/aha/aha.c,v 1.20 2008/05/18 20:30:21 pavalos Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include "ahareg.h" - -struct aha_softc *aha_softcs[NAHATOT]; - -#define PRVERB(x) do { if (bootverbose) device_printf x; } while(0) - -/* Macro to determine that a rev is potentially a new valid one - * so that the driver doesn't keep breaking on new revs as it - * did for the CF and CP. - */ -#define PROBABLY_NEW_BOARD(REV) (REV > 0x43 && REV < 0x56) - -/* MailBox Management functions */ -static __inline void ahanextinbox(struct aha_softc *aha); -static __inline void ahanextoutbox(struct aha_softc *aha); - -#define aha_name(aha) device_get_nameunit(aha->dev) - -static __inline void -ahanextinbox(struct aha_softc *aha) -{ - if (aha->cur_inbox == aha->last_inbox) - aha->cur_inbox = aha->in_boxes; - else - aha->cur_inbox++; -} - -static __inline void -ahanextoutbox(struct aha_softc *aha) -{ - if (aha->cur_outbox == aha->last_outbox) - aha->cur_outbox = aha->out_boxes; - else - aha->cur_outbox++; -} - -#define ahautoa24(u,s3) \ - (s3)[0] = ((u) >> 16) & 0xff; \ - (s3)[1] = ((u) >> 8) & 0xff; \ - (s3)[2] = (u) & 0xff; - -#define aha_a24tou(s3) \ - (((s3)[0] << 16) | ((s3)[1] << 8) | (s3)[2]) - -/* CCB Mangement functions */ -static __inline u_int32_t ahaccbvtop(struct aha_softc *aha, - struct aha_ccb *accb); -static __inline struct aha_ccb* ahaccbptov(struct aha_softc *aha, - u_int32_t ccb_addr); - -static __inline u_int32_t -ahaccbvtop(struct aha_softc *aha, struct aha_ccb *accb) -{ - return (aha->aha_ccb_physbase - + (u_int32_t)((caddr_t)accb - (caddr_t)aha->aha_ccb_array)); -} -static __inline struct aha_ccb * -ahaccbptov(struct aha_softc *aha, u_int32_t ccb_addr) -{ - return (aha->aha_ccb_array + - + ((struct aha_ccb*)(intptr_t)ccb_addr - - (struct aha_ccb*)(intptr_t)aha->aha_ccb_physbase)); -} - -static struct aha_ccb* ahagetccb(struct aha_softc *aha); -static __inline void ahafreeccb(struct aha_softc *aha, struct aha_ccb *accb); -static void ahaallocccbs(struct aha_softc *aha); -static bus_dmamap_callback_t ahaexecuteccb; -static void ahadone(struct aha_softc *aha, struct aha_ccb *accb, - aha_mbi_comp_code_t comp_code); - -/* Host adapter command functions */ -static int ahareset(struct aha_softc* aha, int hard_reset); - -/* Initialization functions */ -static int ahainitmboxes(struct aha_softc *aha); -static bus_dmamap_callback_t ahamapmboxes; -static bus_dmamap_callback_t ahamapccbs; -static bus_dmamap_callback_t ahamapsgs; - -/* Transfer Negotiation Functions */ -static void ahafetchtransinfo(struct aha_softc *aha, - struct ccb_trans_settings *cts); - -/* CAM SIM entry points */ -#define ccb_accb_ptr spriv_ptr0 -#define ccb_aha_ptr spriv_ptr1 -static void ahaaction(struct cam_sim *sim, union ccb *ccb); -static void ahapoll(struct cam_sim *sim); - -/* Our timeout handler */ -static timeout_t ahatimeout; - -u_long aha_unit = 0; - -/* - * Do our own re-probe protection until a configuration - * manager can do it for us. This ensures that we don't - * reprobe a card already found by the EISA or PCI probes. - */ -static struct aha_isa_port aha_isa_ports[] = -{ - { 0x130, 4 }, - { 0x134, 5 }, - { 0x230, 2 }, - { 0x234, 3 }, - { 0x330, 0 }, - { 0x334, 1 } -}; - -/* - * I/O ports listed in the order enumerated by the - * card for certain op codes. - */ -static u_int16_t aha_board_ports[] = -{ - 0x330, - 0x334, - 0x230, - 0x234, - 0x130, - 0x134 -}; - -/* Exported functions */ -struct aha_softc * -aha_alloc(device_t dev, bus_space_tag_t tag, bus_space_handle_t bsh) -{ - struct aha_softc *aha; - - int unit = device_get_unit(dev); - if (unit != AHA_TEMP_UNIT) { - if (unit >= NAHATOT) { - device_printf(dev, "unit number (%d) too high\n", unit); - return NULL; - } - - /* - * Allocate a storage area for us - */ - if (aha_softcs[unit]) { - device_printf(dev, "memory already allocated\n"); - return NULL; - } - } - - aha = kmalloc(sizeof(struct aha_softc), M_DEVBUF, M_INTWAIT | M_ZERO); - SLIST_INIT(&aha->free_aha_ccbs); - LIST_INIT(&aha->pending_ccbs); - SLIST_INIT(&aha->sg_maps); - aha->dev = dev; - aha->tag = tag; - aha->bsh = bsh; - aha->ccb_sg_opcode = INITIATOR_SG_CCB_WRESID; - aha->ccb_ccb_opcode = INITIATOR_CCB_WRESID; - - if (unit != AHA_TEMP_UNIT) { - aha_softcs[unit] = aha; - } - return (aha); -} - -void -aha_free(struct aha_softc *aha) -{ - int unit = device_get_unit(aha->dev); - - switch (aha->init_level) { - default: - case 8: - { - struct sg_map_node *sg_map; - - while ((sg_map = SLIST_FIRST(&aha->sg_maps))!= NULL) { - SLIST_REMOVE_HEAD(&aha->sg_maps, links); - bus_dmamap_unload(aha->sg_dmat, - sg_map->sg_dmamap); - bus_dmamem_free(aha->sg_dmat, sg_map->sg_vaddr, - sg_map->sg_dmamap); - kfree(sg_map, M_DEVBUF); - } - bus_dma_tag_destroy(aha->sg_dmat); - } - /* fall through */ - case 7: - bus_dmamap_unload(aha->ccb_dmat, aha->ccb_dmamap); - /* fall through */ - case 6: - bus_dmamap_destroy(aha->ccb_dmat, aha->ccb_dmamap); - bus_dmamem_free(aha->ccb_dmat, aha->aha_ccb_array, - aha->ccb_dmamap); - /* fall through */ - case 5: - bus_dma_tag_destroy(aha->ccb_dmat); - /* fall through */ - case 4: - bus_dmamap_unload(aha->mailbox_dmat, aha->mailbox_dmamap); - /* fall through */ - case 3: - bus_dmamem_free(aha->mailbox_dmat, aha->in_boxes, - aha->mailbox_dmamap); - bus_dmamap_destroy(aha->mailbox_dmat, aha->mailbox_dmamap); - /* fall through */ - case 2: - bus_dma_tag_destroy(aha->buffer_dmat); - /* fall through */ - case 1: - bus_dma_tag_destroy(aha->mailbox_dmat); - /* fall through */ - case 0: - break; - } - if (unit != AHA_TEMP_UNIT) { - aha_softcs[unit] = NULL; - } - kfree(aha, M_DEVBUF); -} - -/* - * Probe the adapter and verify that the card is an Adaptec. - */ -int -aha_probe(struct aha_softc* aha) -{ - u_int status; - u_int intstat; - int error; - board_id_data_t board_id; - - /* - * See if the three I/O ports look reasonable. - * Touch the minimal number of registers in the - * failure case. - */ - status = aha_inb(aha, STATUS_REG); - if ((status == 0) - || (status & (DIAG_ACTIVE|CMD_REG_BUSY| - STATUS_REG_RSVD)) != 0) { - PRVERB((aha->dev, "status reg test failed %x\n", status)); - return (ENXIO); - } - - intstat = aha_inb(aha, INTSTAT_REG); - if ((intstat & INTSTAT_REG_RSVD) != 0) { - PRVERB((aha->dev, "Failed Intstat Reg Test\n")); - return (ENXIO); - } - - /* - * Looking good so far. Final test is to reset the - * adapter and fetch the board ID and ensure we aren't - * looking at a BusLogic. - */ - if ((error = ahareset(aha, /*hard_reset*/TRUE)) != 0) { - PRVERB((aha->dev, "Failed Reset\n")); - return (ENXIO); - } - - /* - * Get the board ID. We use this to see if we're dealing with - * a buslogic card or a aha card (or clone). - */ - error = aha_cmd(aha, AOP_INQUIRE_BOARD_ID, NULL, /*parmlen*/0, - (u_int8_t*)&board_id, sizeof(board_id), - DEFAULT_CMD_TIMEOUT); - if (error != 0) { - PRVERB((aha->dev, "INQUIRE failed %x\n", error)); - return (ENXIO); - } - aha->fw_major = board_id.firmware_rev_major; - aha->fw_minor = board_id.firmware_rev_minor; - aha->boardid = board_id.board_type; - - /* - * The Buslogic cards have an id of either 0x41 or 0x42. So - * if those come up in the probe, we test the geometry register - * of the board. Adaptec boards that are this old will not have - * this register, and return 0xff, while buslogic cards will return - * something different. - * - * It appears that for reasons unknow, for the for the - * aha-1542B cards, we need to wait a little bit before trying - * to read the geometry register. I picked 10ms since we have - * reports that a for loop to 1000 did the trick, and this - * errs on the side of conservatism. Besides, no one will - * notice a 10mS delay here, even the 1542B card users :-) - * - * Some compatible cards return 0 here. Some cards also - * seem to return 0x7f. - * - * XXX I'm not sure how this will impact other cloned cards - * - * This really should be replaced with the esetup command, since - * that appears to be more reliable. This becomes more and more - * true over time as we discover more cards that don't read the - * geometry register consistantly. - */ - if (aha->boardid <= 0x42) { - /* Wait 10ms before reading */ - DELAY(10000); - status = aha_inb(aha, GEOMETRY_REG); - if (status != 0xff && status != 0x00 && status != 0x7f) { - PRVERB((aha->dev, "Geometry Register test failed 0x%x\n", status)); - return (ENXIO); - } - } - - return (0); -} - -/* - * Pull the boards setup information and record it in our softc. - */ -int -aha_fetch_adapter_info(struct aha_softc *aha) -{ - setup_data_t setup_info; - config_data_t config_data; - u_int8_t length_param; - int error; - struct aha_extbios extbios; - - switch (aha->boardid) { - case BOARD_1540_16HEAD_BIOS: - ksnprintf(aha->model, sizeof(aha->model), "1540 16 head BIOS"); - break; - case BOARD_1540_64HEAD_BIOS: - ksnprintf(aha->model, sizeof(aha->model), "1540 64 head BIOS"); - break; - case BOARD_1542: - ksnprintf(aha->model, sizeof(aha->model), "1540/1542 64 head BIOS"); - break; - case BOARD_1640: - ksnprintf(aha->model, sizeof(aha->model), "1640"); - break; - case BOARD_1740: - ksnprintf(aha->model, sizeof(aha->model), "1740A/1742A/1744"); - break; - case BOARD_1542C: - ksnprintf(aha->model, sizeof(aha->model), "1542C"); - break; - case BOARD_1542CF: - ksnprintf(aha->model, sizeof(aha->model), "1542CF"); - break; - case BOARD_1542CP: - ksnprintf(aha->model, sizeof(aha->model), "1542CP"); - break; - default: - ksnprintf(aha->model, sizeof(aha->model), "Unknown"); - break; - } - /* - * If we are a new type of 1542 board (anything newer than a 1542C) - * then disable the extended bios so that the - * mailbox interface is unlocked. - * This is also true for the 1542B Version 3.20. First Adaptec - * board that supports >1Gb drives. - * No need to check the extended bios flags as some of the - * extensions that cause us problems are not flagged in that byte. - */ - if (PROBABLY_NEW_BOARD(aha->boardid) || - (aha->boardid == 0x41 - && aha->fw_major == 0x31 && - aha->fw_minor >= 0x34)) { - error = aha_cmd(aha, AOP_RETURN_EXT_BIOS_INFO, NULL, - /*paramlen*/0, (u_char *)&extbios, sizeof(extbios), - DEFAULT_CMD_TIMEOUT); - error = aha_cmd(aha, AOP_MBOX_IF_ENABLE, (u_int8_t *)&extbios, - /*paramlen*/2, NULL, 0, DEFAULT_CMD_TIMEOUT); - } - if (aha->boardid < 0x41) - device_printf(aha->dev, "Warning: aha-1542A won't likely work.\n"); - - aha->max_sg = 17; /* Need >= 17 to do 64k I/O */ - aha->diff_bus = 0; - aha->extended_lun = 0; - aha->extended_trans = 0; - aha->max_ccbs = 16; - /* Determine Sync/Wide/Disc settings */ - length_param = sizeof(setup_info); - error = aha_cmd(aha, AOP_INQUIRE_SETUP_INFO, &length_param, - /*paramlen*/1, (u_int8_t*)&setup_info, - sizeof(setup_info), DEFAULT_CMD_TIMEOUT); - if (error != 0) { - device_printf(aha->dev, "aha_fetch_adapter_info - Failed " - "Get Setup Info\n"); - return (error); - } - if (setup_info.initiate_sync != 0) { - aha->sync_permitted = ALL_TARGETS; - } - aha->disc_permitted = ALL_TARGETS; - - /* We need as many mailboxes as we can have ccbs */ - aha->num_boxes = aha->max_ccbs; - - /* Determine our SCSI ID */ - - error = aha_cmd(aha, AOP_INQUIRE_CONFIG, NULL, /*parmlen*/0, - (u_int8_t*)&config_data, sizeof(config_data), - DEFAULT_CMD_TIMEOUT); - if (error != 0) { - device_printf(aha->dev, "aha_fetch_adapter_info - Failed Get Config\n"); - return (error); - } - aha->scsi_id = config_data.scsi_id; - return (0); -} - -/* - * Start the board, ready for normal operation - */ -int -aha_init(struct aha_softc* aha) -{ - /* Announce the Adapter */ - device_printf(aha->dev, "AHA-%s FW Rev. %c.%c (ID=%x) ", - aha->model, aha->fw_major, aha->fw_minor, aha->boardid); - - if (aha->diff_bus != 0) - kprintf("Diff "); - kprintf("SCSI Host Adapter, SCSI ID %d, %d CCBs\n", aha->scsi_id, - aha->max_ccbs); - - /* - * Create our DMA tags. These tags define the kinds of device - * accessible memory allocations and memory mappings we will - * need to perform during normal operation. - * - * Unless we need to further restrict the allocation, we rely - * on the restrictions of the parent dmat, hence the common - * use of MAXADDR and MAXSIZE. - */ - - /* DMA tag for mapping buffers into device visible space. */ - if (bus_dma_tag_create(aha->parent_dmat, /*alignment*/1, /*boundary*/0, - /*lowaddr*/BUS_SPACE_MAXADDR, - /*highaddr*/BUS_SPACE_MAXADDR, - /*filter*/NULL, /*filterarg*/NULL, - /*maxsize*/MAXBSIZE, /*nsegments*/AHA_NSEG, - /*maxsegsz*/BUS_SPACE_MAXSIZE_24BIT, - /*flags*/BUS_DMA_ALLOCNOW, - &aha->buffer_dmat) != 0) { - goto error_exit; - } - - aha->init_level++; - /* DMA tag for our mailboxes */ - if (bus_dma_tag_create(aha->parent_dmat, /*alignment*/1, /*boundary*/0, - /*lowaddr*/BUS_SPACE_MAXADDR, - /*highaddr*/BUS_SPACE_MAXADDR, - /*filter*/NULL, /*filterarg*/NULL, - aha->num_boxes * (sizeof(aha_mbox_in_t) - + sizeof(aha_mbox_out_t)), - /*nsegments*/1, - /*maxsegsz*/BUS_SPACE_MAXSIZE_24BIT, - /*flags*/0, &aha->mailbox_dmat) != 0) { - goto error_exit; - } - - aha->init_level++; - - /* Allocation for our mailboxes */ - if (bus_dmamem_alloc(aha->mailbox_dmat, (void *)&aha->out_boxes, - BUS_DMA_NOWAIT, &aha->mailbox_dmamap) != 0) { - goto error_exit; - } - - aha->init_level++; - - /* And permanently map them */ - bus_dmamap_load(aha->mailbox_dmat, aha->mailbox_dmamap, - aha->out_boxes, - aha->num_boxes * (sizeof(aha_mbox_in_t) - + sizeof(aha_mbox_out_t)), - ahamapmboxes, aha, /*flags*/0); - - aha->init_level++; - - aha->in_boxes = (aha_mbox_in_t *)&aha->out_boxes[aha->num_boxes]; - - ahainitmboxes(aha); - - /* DMA tag for our ccb structures */ - if (bus_dma_tag_create(aha->parent_dmat, /*alignment*/1, /*boundary*/0, - /*lowaddr*/BUS_SPACE_MAXADDR, - /*highaddr*/BUS_SPACE_MAXADDR, - /*filter*/NULL, /*filterarg*/NULL, - aha->max_ccbs * sizeof(struct aha_ccb), - /*nsegments*/1, - /*maxsegsz*/BUS_SPACE_MAXSIZE_24BIT, - /*flags*/0, &aha->ccb_dmat) != 0) { - goto error_exit; - } - - aha->init_level++; - - /* Allocation for our ccbs */ - if (bus_dmamem_alloc(aha->ccb_dmat, (void *)&aha->aha_ccb_array, - BUS_DMA_NOWAIT, &aha->ccb_dmamap) != 0) { - goto error_exit; - } - - aha->init_level++; - - /* And permanently map them */ - bus_dmamap_load(aha->ccb_dmat, aha->ccb_dmamap, - aha->aha_ccb_array, - aha->max_ccbs * sizeof(struct aha_ccb), - ahamapccbs, aha, /*flags*/0); - - aha->init_level++; - - /* DMA tag for our S/G structures. We allocate in page sized chunks */ - if (bus_dma_tag_create(aha->parent_dmat, /*alignment*/1, /*boundary*/0, - /*lowaddr*/BUS_SPACE_MAXADDR, - /*highaddr*/BUS_SPACE_MAXADDR, - /*filter*/NULL, /*filterarg*/NULL, - PAGE_SIZE, /*nsegments*/1, - /*maxsegsz*/BUS_SPACE_MAXSIZE_24BIT, - /*flags*/0, &aha->sg_dmat) != 0) { - goto error_exit; - } - - aha->init_level++; - - /* Perform initial CCB allocation */ - bzero(aha->aha_ccb_array, aha->max_ccbs * sizeof(struct aha_ccb)); - ahaallocccbs(aha); - - if (aha->num_ccbs == 0) { - device_printf(aha->dev, - "aha_init - Unable to allocate initial ccbs\n"); - goto error_exit; - } - - /* - * Note that we are going and return (to probe) - */ - return 0; - -error_exit: - - return (ENXIO); -} - -int -aha_attach(struct aha_softc *aha) -{ - int tagged_dev_openings; - struct cam_devq *devq; - - /* - * We don't do tagged queueing, since the aha cards don't - * support it. - */ - tagged_dev_openings = 0; - - /* - * Create the device queue for our SIM. - */ - devq = cam_simq_alloc(aha->max_ccbs - 1); - if (devq == NULL) - return (ENOMEM); - - /* - * Construct our SIM entry - */ - aha->sim = cam_sim_alloc(ahaaction, ahapoll, "aha", aha, device_get_unit(aha->dev), - &sim_mplock, 2, tagged_dev_openings, devq); - cam_simq_release(devq); - if (aha->sim == NULL) { - return (ENOMEM); - } - - if (xpt_bus_register(aha->sim, 0) != CAM_SUCCESS) { - cam_sim_free(aha->sim); - return (ENXIO); - } - - if (xpt_create_path(&aha->path, /*periph*/NULL, - cam_sim_path(aha->sim), CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD) != CAM_REQ_CMP) { - xpt_bus_deregister(cam_sim_path(aha->sim)); - cam_sim_free(aha->sim); - return (ENXIO); - } - - return (0); -} - -void -aha_find_probe_range(int ioport, int *port_index, int *max_port_index) -{ - if (ioport > 0) { - int i; - - for (i = 0;i < AHA_NUM_ISAPORTS; i++) - if (ioport <= aha_isa_ports[i].addr) - break; - if ((i >= AHA_NUM_ISAPORTS) - || (ioport != aha_isa_ports[i].addr)) { - kprintf("\n" -"aha_isa_probe: Invalid baseport of 0x%x specified.\n" -"aha_isa_probe: Nearest valid baseport is 0x%x.\n" -"aha_isa_probe: Failing probe.\n", - ioport, - (i < AHA_NUM_ISAPORTS) - ? aha_isa_ports[i].addr - : aha_isa_ports[AHA_NUM_ISAPORTS - 1].addr); - *port_index = *max_port_index = -1; - return; - } - *port_index = *max_port_index = aha_isa_ports[i].bio; - } else { - *port_index = 0; - *max_port_index = AHA_NUM_ISAPORTS - 1; - } -} - -int -aha_iop_from_bio(isa_compat_io_t bio_index) -{ - if (bio_index >= 0 && bio_index < AHA_NUM_ISAPORTS) - return (aha_board_ports[bio_index]); - return (-1); -} - -static void -ahaallocccbs(struct aha_softc *aha) -{ - struct aha_ccb *next_ccb; - struct sg_map_node *sg_map; - bus_addr_t physaddr; - aha_sg_t *segs; - int newcount; - int i; - - next_ccb = &aha->aha_ccb_array[aha->num_ccbs]; - - sg_map = kmalloc(sizeof(*sg_map), M_DEVBUF, M_INTWAIT); - - /* Allocate S/G space for the next batch of CCBS */ - if (bus_dmamem_alloc(aha->sg_dmat, (void *)&sg_map->sg_vaddr, - BUS_DMA_NOWAIT, &sg_map->sg_dmamap) != 0) { - kfree(sg_map, M_DEVBUF); - return; - } - - SLIST_INSERT_HEAD(&aha->sg_maps, sg_map, links); - - bus_dmamap_load(aha->sg_dmat, sg_map->sg_dmamap, sg_map->sg_vaddr, - PAGE_SIZE, ahamapsgs, aha, /*flags*/0); - - segs = sg_map->sg_vaddr; - physaddr = sg_map->sg_physaddr; - - newcount = (PAGE_SIZE / (AHA_NSEG * sizeof(aha_sg_t))); - for (i = 0; aha->num_ccbs < aha->max_ccbs && i < newcount; i++) { - int error; - - next_ccb->sg_list = segs; - next_ccb->sg_list_phys = physaddr; - next_ccb->flags = ACCB_FREE; - error = bus_dmamap_create(aha->buffer_dmat, /*flags*/0, - &next_ccb->dmamap); - if (error != 0) - break; - SLIST_INSERT_HEAD(&aha->free_aha_ccbs, next_ccb, links); - segs += AHA_NSEG; - physaddr += (AHA_NSEG * sizeof(aha_sg_t)); - next_ccb++; - aha->num_ccbs++; - } - - /* Reserve a CCB for error recovery */ - if (aha->recovery_accb == NULL) { - aha->recovery_accb = SLIST_FIRST(&aha->free_aha_ccbs); - SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links); - } -} - -static __inline void -ahafreeccb(struct aha_softc *aha, struct aha_ccb *accb) -{ - crit_enter(); - if ((accb->flags & ACCB_ACTIVE) != 0) - LIST_REMOVE(&accb->ccb->ccb_h, sim_links.le); - if (aha->resource_shortage != 0 - && (accb->ccb->ccb_h.status & CAM_RELEASE_SIMQ) == 0) { - accb->ccb->ccb_h.status |= CAM_RELEASE_SIMQ; - aha->resource_shortage = FALSE; - } - accb->flags = ACCB_FREE; - SLIST_INSERT_HEAD(&aha->free_aha_ccbs, accb, links); - aha->active_ccbs--; - crit_exit(); -} - -static struct aha_ccb* -ahagetccb(struct aha_softc *aha) -{ - struct aha_ccb* accb; - - crit_enter(); - if ((accb = SLIST_FIRST(&aha->free_aha_ccbs)) != NULL) { - SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links); - aha->active_ccbs++; - } else if (aha->num_ccbs < aha->max_ccbs) { - ahaallocccbs(aha); - accb = SLIST_FIRST(&aha->free_aha_ccbs); - if (accb == NULL) - device_printf(aha->dev, "Can't malloc ACCB\n"); - else { - SLIST_REMOVE_HEAD(&aha->free_aha_ccbs, links); - aha->active_ccbs++; - } - } - crit_exit(); - - return (accb); -} - -static void -ahaaction(struct cam_sim *sim, union ccb *ccb) -{ - struct aha_softc *aha; - - CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ahaaction\n")); - - aha = (struct aha_softc *)cam_sim_softc(sim); - - switch (ccb->ccb_h.func_code) { - /* Common cases first */ - case XPT_SCSI_IO: /* Execute the requested I/O operation */ - case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */ - { - struct aha_ccb *accb; - struct aha_hccb *hccb; - - /* - * get a accb to use. - */ - if ((accb = ahagetccb(aha)) == NULL) { - crit_enter(); - aha->resource_shortage = TRUE; - crit_exit(); - xpt_freeze_simq(aha->sim, /*count*/1); - ccb->ccb_h.status = CAM_REQUEUE_REQ; - xpt_done(ccb); - return; - } - - hccb = &accb->hccb; - - /* - * So we can find the ACCB when an abort is requested - */ - accb->ccb = ccb; - ccb->ccb_h.ccb_accb_ptr = accb; - ccb->ccb_h.ccb_aha_ptr = aha; - - /* - * Put all the arguments for the xfer in the accb - */ - hccb->target = ccb->ccb_h.target_id; - hccb->lun = ccb->ccb_h.target_lun; - hccb->ahastat = 0; - hccb->sdstat = 0; - - if (ccb->ccb_h.func_code == XPT_SCSI_IO) { - struct ccb_scsiio *csio; - struct ccb_hdr *ccbh; - - csio = &ccb->csio; - ccbh = &csio->ccb_h; - hccb->opcode = aha->ccb_ccb_opcode; - hccb->datain = (ccb->ccb_h.flags & CAM_DIR_IN) != 0; - hccb->dataout = (ccb->ccb_h.flags & CAM_DIR_OUT) != 0; - hccb->cmd_len = csio->cdb_len; - if (hccb->cmd_len > sizeof(hccb->scsi_cdb)) { - ccb->ccb_h.status = CAM_REQ_INVALID; - ahafreeccb(aha, accb); - xpt_done(ccb); - return; - } - hccb->sense_len = csio->sense_len; - if ((ccbh->flags & CAM_CDB_POINTER) != 0) { - if ((ccbh->flags & CAM_CDB_PHYS) == 0) { - bcopy(csio->cdb_io.cdb_ptr, - hccb->scsi_cdb, hccb->cmd_len); - } else { - /* I guess I could map it in... */ - ccbh->status = CAM_REQ_INVALID; - ahafreeccb(aha, accb); - xpt_done(ccb); - return; - } - } else { - bcopy(csio->cdb_io.cdb_bytes, - hccb->scsi_cdb, hccb->cmd_len); - } - /* - * If we have any data to send with this command, - * map it into bus space. - */ - /* Only use S/G if there is a transfer */ - if ((ccbh->flags & CAM_DIR_MASK) != CAM_DIR_NONE) { - if ((ccbh->flags & CAM_SCATTER_VALID) == 0) { - /* - * We've been given a pointer - * to a single buffer. - */ - if ((ccbh->flags & CAM_DATA_PHYS)==0) { - int error; - - crit_enter(); - error = bus_dmamap_load( - aha->buffer_dmat, - accb->dmamap, - csio->data_ptr, - csio->dxfer_len, - ahaexecuteccb, - accb, - /*flags*/0); - if (error == EINPROGRESS) { - /* - * So as to maintain - * ordering, freeze the - * controller queue - * until our mapping is - * returned. - */ - xpt_freeze_simq(aha->sim, - 1); - csio->ccb_h.status |= - CAM_RELEASE_SIMQ; - } - crit_exit(); - } else { - struct bus_dma_segment seg; - - /* Pointer to physical buffer */ - seg.ds_addr = - (bus_addr_t)csio->data_ptr; - seg.ds_len = csio->dxfer_len; - ahaexecuteccb(accb, &seg, 1, 0); - } - } else { - struct bus_dma_segment *segs; - - if ((ccbh->flags & CAM_DATA_PHYS) != 0) - panic("ahaaction - Physical " - "segment pointers " - "unsupported"); - - if ((ccbh->flags&CAM_SG_LIST_PHYS)==0) - panic("ahaaction - Virtual " - "segment addresses " - "unsupported"); - - /* Just use the segments provided */ - segs = (struct bus_dma_segment *) - csio->data_ptr; - ahaexecuteccb(accb, segs, - csio->sglist_cnt, 0); - } - } else { - ahaexecuteccb(accb, NULL, 0, 0); - } - } else { - hccb->opcode = INITIATOR_BUS_DEV_RESET; - /* No data transfer */ - hccb->datain = TRUE; - hccb->dataout = TRUE; - hccb->cmd_len = 0; - hccb->sense_len = 0; - ahaexecuteccb(accb, NULL, 0, 0); - } - break; - } - case XPT_EN_LUN: /* Enable LUN as a target */ - case XPT_TARGET_IO: /* Execute target I/O request */ - case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */ - case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/ - case XPT_ABORT: /* Abort the specified CCB */ - /* XXX Implement */ - ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); - break; - case XPT_SET_TRAN_SETTINGS: - { - /* XXX Implement */ - ccb->ccb_h.status = CAM_PROVIDE_FAIL; - xpt_done(ccb); - break; - } - case XPT_GET_TRAN_SETTINGS: - /* Get default/user set transfer settings for the target */ - { - struct ccb_trans_settings *cts = &ccb->cts; - u_int target_mask = 0x01 << ccb->ccb_h.target_id; - struct ccb_trans_settings_scsi *scsi = - &cts->proto_specific.scsi; - struct ccb_trans_settings_spi *spi = - &cts->xport_specific.spi; - - cts->protocol = PROTO_SCSI; - cts->protocol_version = SCSI_REV_2; - cts->transport = XPORT_SPI; - cts->transport_version = 2; - if (cts->type == CTS_TYPE_USER_SETTINGS) { - spi->flags = 0; - if ((aha->disc_permitted & target_mask) != 0) - spi->flags |= CTS_SPI_FLAGS_DISC_ENB; - spi->bus_width = MSG_EXT_WDTR_BUS_8_BIT; - if ((aha->sync_permitted & target_mask) != 0) { - if (aha->boardid >= BOARD_1542CF) - spi->sync_period = 25; - else - spi->sync_period = 50; - } else { - spi->sync_period = 0; - } - - if (spi->sync_period != 0) - spi->sync_offset = 15; - - spi->valid = CTS_SPI_VALID_SYNC_RATE - | CTS_SPI_VALID_SYNC_OFFSET - | CTS_SPI_VALID_BUS_WIDTH - | CTS_SPI_VALID_DISC; - scsi->valid = CTS_SCSI_VALID_TQ; - } else { - ahafetchtransinfo(aha, cts); - } - - ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - break; - } - case XPT_CALC_GEOMETRY: - { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - - ccg = &ccb->ccg; - size_mb = ccg->volume_size - / ((1024L * 1024L) / ccg->block_size); - - if (size_mb >= 1024 && (aha->extended_trans != 0)) { - if (size_mb >= 2048) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 128; - ccg->secs_per_track = 32; - } - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - break; - } - case XPT_RESET_BUS: /* Reset the specified SCSI bus */ - { - ahareset(aha, /*hardreset*/TRUE); - ccb->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - break; - } - case XPT_TERM_IO: /* Terminate the I/O process */ - /* XXX Implement */ - ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); - break; - case XPT_PATH_INQ: /* Path routing inquiry */ - { - struct ccb_pathinq *cpi = &ccb->cpi; - - cpi->version_num = 1; /* XXX??? */ - cpi->hba_inquiry = PI_SDTR_ABLE; - cpi->target_sprt = 0; - cpi->hba_misc = 0; - cpi->hba_eng_cnt = 0; - cpi->max_target = 7; - cpi->max_lun = 7; - cpi->initiator_id = aha->scsi_id; - cpi->bus_id = cam_sim_bus(sim); - cpi->base_transfer_speed = 3300; - strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); - strncpy(cpi->hba_vid, "Adaptec", HBA_IDLEN); - strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); - cpi->unit_number = cam_sim_unit(sim); - cpi->transport = XPORT_SPI; - cpi->transport_version = 2; - cpi->protocol = PROTO_SCSI; - cpi->protocol_version = SCSI_REV_2; - cpi->ccb_h.status = CAM_REQ_CMP; - xpt_done(ccb); - break; - } - default: - ccb->ccb_h.status = CAM_REQ_INVALID; - xpt_done(ccb); - break; - } -} - -static void -ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) -{ - struct aha_ccb *accb; - union ccb *ccb; - struct aha_softc *aha; - u_int32_t paddr; - - accb = (struct aha_ccb *)arg; - ccb = accb->ccb; - aha = (struct aha_softc *)ccb->ccb_h.ccb_aha_ptr; - - if (error != 0) { - if (error != EFBIG) - device_printf(aha->dev, - "Unexpected error 0x%x returned from " - "bus_dmamap_load\n", error); - if (ccb->ccb_h.status == CAM_REQ_INPROG) { - xpt_freeze_devq(ccb->ccb_h.path, /*count*/1); - ccb->ccb_h.status = CAM_REQ_TOO_BIG|CAM_DEV_QFRZN; - } - ahafreeccb(aha, accb); - xpt_done(ccb); - return; - } - - if (nseg != 0) { - aha_sg_t *sg; - bus_dma_segment_t *end_seg; - bus_dmasync_op_t op; - - end_seg = dm_segs + nseg; - - /* Copy the segments into our SG list */ - sg = accb->sg_list; - while (dm_segs < end_seg) { - ahautoa24(dm_segs->ds_len, sg->len); - ahautoa24(dm_segs->ds_addr, sg->addr); - sg++; - dm_segs++; - } - - if (nseg > 1) { - accb->hccb.opcode = aha->ccb_sg_opcode; - ahautoa24((sizeof(aha_sg_t) * nseg), - accb->hccb.data_len); - ahautoa24(accb->sg_list_phys, accb->hccb.data_addr); - } else { - bcopy(accb->sg_list->len, accb->hccb.data_len, 3); - bcopy(accb->sg_list->addr, accb->hccb.data_addr, 3); - } - - if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) - op = BUS_DMASYNC_PREREAD; - else - op = BUS_DMASYNC_PREWRITE; - - bus_dmamap_sync(aha->buffer_dmat, accb->dmamap, op); - - } else { - accb->hccb.opcode = INITIATOR_CCB; - ahautoa24(0, accb->hccb.data_len); - ahautoa24(0, accb->hccb.data_addr); - } - - crit_enter(); - - /* - * Last time we need to check if this CCB needs to - * be aborted. - */ - if (ccb->ccb_h.status != CAM_REQ_INPROG) { - if (nseg != 0) - bus_dmamap_unload(aha->buffer_dmat, accb->dmamap); - ahafreeccb(aha, accb); - xpt_done(ccb); - crit_exit(); - return; - } - - accb->flags = ACCB_ACTIVE; - ccb->ccb_h.status |= CAM_SIM_QUEUED; - LIST_INSERT_HEAD(&aha->pending_ccbs, &ccb->ccb_h, sim_links.le); - - callout_reset(&ccb->ccb_h.timeout_ch, (ccb->ccb_h.timeout * hz) / 1000, - ahatimeout, accb); - - /* Tell the adapter about this command */ - if (aha->cur_outbox->action_code != AMBO_FREE) { - /* - * We should never encounter a busy mailbox. - * If we do, warn the user, and treat it as - * a resource shortage. If the controller is - * hung, one of the pending transactions will - * timeout causing us to start recovery operations. - */ - device_printf(aha->dev, - "Encountered busy mailbox with %d out of %d " - "commands active!!!", aha->active_ccbs, aha->max_ccbs); - callout_stop(&ccb->ccb_h.timeout_ch); - if (nseg != 0) - bus_dmamap_unload(aha->buffer_dmat, accb->dmamap); - ahafreeccb(aha, accb); - aha->resource_shortage = TRUE; - xpt_freeze_simq(aha->sim, /*count*/1); - ccb->ccb_h.status = CAM_REQUEUE_REQ; - xpt_done(ccb); - crit_exit(); - return; - } - paddr = ahaccbvtop(aha, accb); - ahautoa24(paddr, aha->cur_outbox->ccb_addr); - aha->cur_outbox->action_code = AMBO_START; - aha_outb(aha, COMMAND_REG, AOP_START_MBOX); - - ahanextoutbox(aha); - crit_exit(); -} - -void -aha_intr(void *arg) -{ - struct aha_softc *aha; - u_int intstat; - - aha = (struct aha_softc *)arg; - while (((intstat = aha_inb(aha, INTSTAT_REG)) & INTR_PENDING) != 0) { - if ((intstat & CMD_COMPLETE) != 0) { - aha->latched_status = aha_inb(aha, STATUS_REG); - aha->command_cmp = TRUE; - } - - aha_outb(aha, CONTROL_REG, RESET_INTR); - - if ((intstat & IMB_LOADED) != 0) { - while (aha->cur_inbox->comp_code != AMBI_FREE) { - u_int32_t paddr; - paddr = aha_a24tou(aha->cur_inbox->ccb_addr); - ahadone(aha, - ahaccbptov(aha, paddr), - aha->cur_inbox->comp_code); - aha->cur_inbox->comp_code = AMBI_FREE; - ahanextinbox(aha); - } - } - - if ((intstat & SCSI_BUS_RESET) != 0) { - ahareset(aha, /*hardreset*/FALSE); - } - } -} - -static void -ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_code) -{ - union ccb *ccb; - struct ccb_scsiio *csio; - - ccb = accb->ccb; - csio = &accb->ccb->csio; - - if ((accb->flags & ACCB_ACTIVE) == 0) { - device_printf(aha->dev, - "ahadone - Attempt to free non-active ACCB %p\n", - (void *)accb); - return; - } - - if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { - bus_dmasync_op_t op; - - if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) - op = BUS_DMASYNC_POSTREAD; - else - op = BUS_DMASYNC_POSTWRITE; - bus_dmamap_sync(aha->buffer_dmat, accb->dmamap, op); - bus_dmamap_unload(aha->buffer_dmat, accb->dmamap); - } - - if (accb == aha->recovery_accb) { - /* - * The recovery ACCB does not have a CCB associated - * with it, so short circuit the normal error handling. - * We now traverse our list of pending CCBs and process - * any that were terminated by the recovery CCBs action. - * We also reinstate timeouts for all remaining, pending, - * CCBs. - */ - struct cam_path *path; - struct ccb_hdr *ccb_h; - cam_status error; - - /* Notify all clients that a BDR occured */ - error = xpt_create_path(&path, /*periph*/NULL, - cam_sim_path(aha->sim), - accb->hccb.target, - CAM_LUN_WILDCARD); - - if (error == CAM_REQ_CMP) - xpt_async(AC_SENT_BDR, path, NULL); - - ccb_h = LIST_FIRST(&aha->pending_ccbs); - while (ccb_h != NULL) { - struct aha_ccb *pending_accb; - - pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr; - if (pending_accb->hccb.target == accb->hccb.target) { - pending_accb->hccb.ahastat = AHASTAT_HA_BDR; - ccb_h = LIST_NEXT(ccb_h, sim_links.le); - ahadone(aha, pending_accb, AMBI_ERROR); - } else { - callout_reset(&ccb_h->timeout_ch, - (ccb_h->timeout * hz) / 1000, - ahatimeout, pending_accb); - ccb_h = LIST_NEXT(ccb_h, sim_links.le); - } - } - device_printf(aha->dev, "No longer in timeout\n"); - return; - } - - callout_stop(&ccb->ccb_h.timeout_ch); - - switch (comp_code) { - case AMBI_FREE: - device_printf(aha->dev, - "ahadone - CCB completed with free status!\n"); - break; - case AMBI_NOT_FOUND: - device_printf(aha->dev, - "ahadone - CCB Abort failed to find CCB\n"); - break; - case AMBI_ABORT: - case AMBI_ERROR: - /* An error occured */ - if (accb->hccb.opcode < INITIATOR_CCB_WRESID) - csio->resid = 0; - else - csio->resid = aha_a24tou(accb->hccb.data_len); - switch(accb->hccb.ahastat) { - case AHASTAT_DATARUN_ERROR: - { - if (csio->resid <= 0) { - csio->ccb_h.status = CAM_DATA_RUN_ERR; - break; - } - /* FALLTHROUGH */ - } - case AHASTAT_NOERROR: - csio->scsi_status = accb->hccb.sdstat; - csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR; - switch(csio->scsi_status) { - case SCSI_STATUS_CHECK_COND: - case SCSI_STATUS_CMD_TERMINATED: - csio->ccb_h.status |= CAM_AUTOSNS_VALID; - /* - * The aha writes the sense data at different - * offsets based on the scsi cmd len - */ - bcopy((caddr_t) &accb->hccb.scsi_cdb + - accb->hccb.cmd_len, - (caddr_t) &csio->sense_data, - accb->hccb.sense_len); - break; - default: - break; - case SCSI_STATUS_OK: - csio->ccb_h.status = CAM_REQ_CMP; - break; - } - break; - case AHASTAT_SELTIMEOUT: - csio->ccb_h.status = CAM_SEL_TIMEOUT; - break; - case AHASTAT_UNEXPECTED_BUSFREE: - csio->ccb_h.status = CAM_UNEXP_BUSFREE; - break; - case AHASTAT_INVALID_PHASE: - csio->ccb_h.status = CAM_SEQUENCE_FAIL; - break; - case AHASTAT_INVALID_ACTION_CODE: - panic("%s: Inavlid Action code", aha_name(aha)); - break; - case AHASTAT_INVALID_OPCODE: - if (accb->hccb.opcode < INITIATOR_CCB_WRESID) - panic("%s: Invalid CCB Opcode %x hccb = %p", - aha_name(aha), accb->hccb.opcode, - &accb->hccb); - device_printf(aha->dev, - "AHA-1540A detected, compensating\n"); - aha->ccb_sg_opcode = INITIATOR_SG_CCB; - aha->ccb_ccb_opcode = INITIATOR_CCB; - xpt_freeze_devq(ccb->ccb_h.path, /*count*/1); - csio->ccb_h.status = CAM_REQUEUE_REQ; - break; - case AHASTAT_LINKED_CCB_LUN_MISMATCH: - /* We don't even support linked commands... */ - panic("%s: Linked CCB Lun Mismatch", aha_name(aha)); - break; - case AHASTAT_INVALID_CCB_OR_SG_PARAM: - panic("%s: Invalid CCB or SG list", aha_name(aha)); - break; - case AHASTAT_HA_SCSI_BUS_RESET: - if ((csio->ccb_h.status & CAM_STATUS_MASK) - != CAM_CMD_TIMEOUT) - csio->ccb_h.status = CAM_SCSI_BUS_RESET; - break; - case AHASTAT_HA_BDR: - if ((accb->flags & ACCB_DEVICE_RESET) == 0) - csio->ccb_h.status = CAM_BDR_SENT; - else - csio->ccb_h.status = CAM_CMD_TIMEOUT; - break; - } - if (csio->ccb_h.status != CAM_REQ_CMP) { - xpt_freeze_devq(csio->ccb_h.path, /*count*/1); - csio->ccb_h.status |= CAM_DEV_QFRZN; - } - if ((accb->flags & ACCB_RELEASE_SIMQ) != 0) - ccb->ccb_h.status |= CAM_RELEASE_SIMQ; - ahafreeccb(aha, accb); - xpt_done(ccb); - break; - case AMBI_OK: - /* All completed without incident */ - /* XXX DO WE NEED TO COPY SENSE BYTES HERE???? XXX */ - /* I don't think so since it works???? */ - ccb->ccb_h.status |= CAM_REQ_CMP; - if ((accb->flags & ACCB_RELEASE_SIMQ) != 0) - ccb->ccb_h.status |= CAM_RELEASE_SIMQ; - ahafreeccb(aha, accb); - xpt_done(ccb); - break; - } -} - -static int -ahareset(struct aha_softc* aha, int hard_reset) -{ - struct ccb_hdr *ccb_h; - u_int status; - u_int timeout; - u_int8_t reset_type; - - if (hard_reset != 0) - reset_type = HARD_RESET; - else - reset_type = SOFT_RESET; - aha_outb(aha, CONTROL_REG, reset_type); - - /* Wait 5sec. for Diagnostic start */ - timeout = 5 * 10000; - while (--timeout) { - status = aha_inb(aha, STATUS_REG); - if ((status & DIAG_ACTIVE) != 0) - break; - DELAY(100); - } - if (timeout == 0) { - PRVERB((aha->dev, "ahareset - Diagnostic Active failed to " - "assert. status = 0x%x\n", status)); - return (ETIMEDOUT); - } - - /* Wait 10sec. for Diagnostic end */ - timeout = 10 * 10000; - while (--timeout) { - status = aha_inb(aha, STATUS_REG); - if ((status & DIAG_ACTIVE) == 0) - break; - DELAY(100); - } - if (timeout == 0) { - panic("%s: ahareset - Diagnostic Active failed to drop. " - "status = 0x%x\n", aha_name(aha), status); - return (ETIMEDOUT); - } - - /* Wait for the host adapter to become ready or report a failure */ - timeout = 10000; - while (--timeout) { - status = aha_inb(aha, STATUS_REG); - if ((status & (DIAG_FAIL|HA_READY|DATAIN_REG_READY)) != 0) - break; - DELAY(100); - } - if (timeout == 0) { - device_printf(aha->dev, "ahareset - Host adapter failed to " - "come ready. status = 0x%x\n", status); - return (ETIMEDOUT); - } - - /* If the diagnostics failed, tell the user */ - if ((status & DIAG_FAIL) != 0 - || (status & HA_READY) == 0) { - device_printf(aha->dev, "ahareset - Adapter failed diagnostics\n"); - if ((status & DATAIN_REG_READY) != 0) - device_printf(aha->dev, "ahareset - Host Adapter " - "Error code = 0x%x\n", aha_inb(aha, DATAIN_REG)); - return (ENXIO); - } - - /* If we've allocated mailboxes, initialize them */ - if (aha->init_level > 4) - ahainitmboxes(aha); - - /* If we've attached to the XPT, tell it about the event */ - if (aha->path != NULL) - xpt_async(AC_BUS_RESET, aha->path, NULL); - - /* - * Perform completion processing for all outstanding CCBs. - */ - while ((ccb_h = LIST_FIRST(&aha->pending_ccbs)) != NULL) { - struct aha_ccb *pending_accb; - - pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr; - pending_accb->hccb.ahastat = AHASTAT_HA_SCSI_BUS_RESET; - ahadone(aha, pending_accb, AMBI_ERROR); - } - - return (0); -} - -/* - * Send a command to the adapter. - */ -int -aha_cmd(struct aha_softc *aha, aha_op_t opcode, u_int8_t *params, - u_int param_len, u_int8_t *reply_data, u_int reply_len, - u_int cmd_timeout) -{ - u_int timeout; - u_int status; - u_int saved_status; - u_int intstat; - u_int reply_buf_size; - int cmd_complete; - int error; - - /* No data returned to start */ - reply_buf_size = reply_len; - reply_len = 0; - intstat = 0; - cmd_complete = 0; - saved_status = 0; - error = 0; - - /* - * All commands except for the "start mailbox" and the "enable - * outgoing mailbox read interrupt" commands cannot be issued - * while there are pending transactions. Freeze our SIMQ - * and wait for all completions to occur if necessary. - */ - timeout = 100000; - crit_enter(); - while (LIST_FIRST(&aha->pending_ccbs) != NULL && --timeout) { - /* Fire the interrupt handler in case interrupts are blocked */ - aha_intr(aha); - crit_exit(); - DELAY(100); - crit_enter(); - } - crit_exit(); - - if (timeout == 0) { - device_printf(aha->dev, "aha_cmd: Timeout waiting for adapter idle\n"); - return (ETIMEDOUT); - } - aha->command_cmp = 0; - /* - * Wait up to 10 sec. for the adapter to become - * ready to accept commands. - */ - timeout = 100000; - while (--timeout) { - - status = aha_inb(aha, STATUS_REG); - if ((status & HA_READY) != 0 - && (status & CMD_REG_BUSY) == 0) - break; - /* - * Throw away any pending data which may be - * left over from earlier commands that we - * timedout on. - */ - if ((status & DATAIN_REG_READY) != 0) - (void)aha_inb(aha, DATAIN_REG); - DELAY(100); - } - if (timeout == 0) { - device_printf(aha->dev, "aha_cmd: Timeout waiting for adapter " - "ready, status = 0x%x\n", status); - return (ETIMEDOUT); - } - - /* - * Send the opcode followed by any necessary parameter bytes. - */ - aha_outb(aha, COMMAND_REG, opcode); - - /* - * Wait for up to 1sec to get the parameter list sent - */ - timeout = 10000; - while (param_len && --timeout) { - DELAY(100); - crit_enter(); - status = aha_inb(aha, STATUS_REG); - intstat = aha_inb(aha, INTSTAT_REG); - crit_exit(); - - if ((intstat & (INTR_PENDING|CMD_COMPLETE)) - == (INTR_PENDING|CMD_COMPLETE)) { - saved_status = status; - cmd_complete = 1; - break; - } - - if (aha->command_cmp != 0) { - saved_status = aha->latched_status; - cmd_complete = 1; - break; - } - if ((status & DATAIN_REG_READY) != 0) - break; - if ((status & CMD_REG_BUSY) == 0) { - aha_outb(aha, COMMAND_REG, *params++); - param_len--; - timeout = 10000; - } - } - if (timeout == 0) { - device_printf(aha->dev, "aha_cmd: Timeout sending parameters, " - "status = 0x%x\n", status); - error = ETIMEDOUT; - } - - /* - * For all other commands, we wait for any output data - * and the final comand completion interrupt. - */ - while (cmd_complete == 0 && --cmd_timeout) { - - crit_enter(); - status = aha_inb(aha, STATUS_REG); - intstat = aha_inb(aha, INTSTAT_REG); - crit_exit(); - - if (aha->command_cmp != 0) { - cmd_complete = 1; - saved_status = aha->latched_status; - } else if ((intstat & (INTR_PENDING|CMD_COMPLETE)) - == (INTR_PENDING|CMD_COMPLETE)) { - /* - * Our poll (in case interrupts are blocked) - * saw the CMD_COMPLETE interrupt. - */ - cmd_complete = 1; - saved_status = status; - } - if ((status & DATAIN_REG_READY) != 0) { - u_int8_t data; - - data = aha_inb(aha, DATAIN_REG); - if (reply_len < reply_buf_size) { - *reply_data++ = data; - } else { - device_printf(aha->dev, "aha_cmd - Discarded reply data " - "byte for opcode 0x%x\n", opcode); - } - /* - * Reset timeout to ensure at least a second - * between response bytes. - */ - cmd_timeout = MAX(cmd_timeout, 10000); - reply_len++; - } - DELAY(100); - } - if (cmd_timeout == 0) { - device_printf(aha->dev, "aha_cmd: Timeout: status = 0x%x, " - "intstat = 0x%x, reply_len = %d\n", status, intstat, - reply_len); - return (ETIMEDOUT); - } - - /* - * Clear any pending interrupts. Block interrupts so our - * interrupt handler is not re-entered. - */ - crit_enter(); - aha_intr(aha); - crit_exit(); - - if (error != 0) - return (error); - - /* - * If the command was rejected by the controller, tell the caller. - */ - if ((saved_status & CMD_INVALID) != 0) { - PRVERB((aha->dev, "Invalid Command 0x%x\n", opcode)); - /* - * Some early adapters may not recover properly from - * an invalid command. If it appears that the controller - * has wedged (i.e. status was not cleared by our interrupt - * reset above), perform a soft reset. - */ - DELAY(1000); - status = aha_inb(aha, STATUS_REG); - if ((status & (CMD_INVALID|STATUS_REG_RSVD|DATAIN_REG_READY| - CMD_REG_BUSY|DIAG_FAIL|DIAG_ACTIVE)) != 0 - || (status & (HA_READY|INIT_REQUIRED)) - != (HA_READY|INIT_REQUIRED)) { - ahareset(aha, /*hard_reset*/FALSE); - } - return (EINVAL); - } - - if (param_len > 0) { - /* The controller did not accept the full argument list */ - PRVERB((aha->dev, "Controller did not accept full argument " - "list (%d > 0)\n", param_len)); - return (E2BIG); - } - - if (reply_len != reply_buf_size) { - /* Too much or too little data received */ - PRVERB((aha->dev,"data received mistmatch (%d != %d)\n", - reply_len, reply_buf_size)); - return (EMSGSIZE); - } - - /* We were successful */ - return (0); -} - -static int -ahainitmboxes(struct aha_softc *aha) -{ - int error; - init_24b_mbox_params_t init_mbox; - - bzero(aha->in_boxes, sizeof(aha_mbox_in_t) * aha->num_boxes); - bzero(aha->out_boxes, sizeof(aha_mbox_out_t) * aha->num_boxes); - aha->cur_inbox = aha->in_boxes; - aha->last_inbox = aha->in_boxes + aha->num_boxes - 1; - aha->cur_outbox = aha->out_boxes; - aha->last_outbox = aha->out_boxes + aha->num_boxes - 1; - - /* Tell the adapter about them */ - init_mbox.num_mboxes = aha->num_boxes; - ahautoa24(aha->mailbox_physbase, init_mbox.base_addr); - error = aha_cmd(aha, AOP_INITIALIZE_MBOX, (u_int8_t *)&init_mbox, - /*parmlen*/sizeof(init_mbox), /*reply_buf*/NULL, - /*reply_len*/0, DEFAULT_CMD_TIMEOUT); - - if (error != 0) - device_printf(aha->dev, - "ahainitmboxes: Initialization command failed\n"); - return (error); -} - -/* - * Update the XPT's idea of the negotiated transfer - * parameters for a particular target. - */ -static void -ahafetchtransinfo(struct aha_softc *aha, struct ccb_trans_settings* cts) -{ - setup_data_t setup_info; - u_int target; - u_int targ_offset; - u_int sync_period; - int error; - u_int8_t param; - targ_syncinfo_t sync_info; - struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi; - - target = cts->ccb_h.target_id; - targ_offset = (target & 0x7); - - /* - * Inquire Setup Information. This command retreives - * the sync info for older models. - */ - param = sizeof(setup_info); - error = aha_cmd(aha, AOP_INQUIRE_SETUP_INFO, ¶m, /*paramlen*/1, - (u_int8_t*)&setup_info, sizeof(setup_info), - DEFAULT_CMD_TIMEOUT); - - if (error != 0) { - device_printf(aha->dev, - "ahafetchtransinfo - Inquire Setup Info Failed %d\n", - error); - return; - } - - sync_info = setup_info.syncinfo[targ_offset]; - - if (sync_info.sync == 0) - spi->sync_offset = 0; - else - spi->sync_offset = sync_info.offset; - - spi->bus_width = MSG_EXT_WDTR_BUS_8_BIT; - - if (aha->boardid >= BOARD_1542CF) - sync_period = 1000; - else - sync_period = 2000; - sync_period += 500 * sync_info.period; - - /* Convert ns value to standard SCSI sync rate */ - if (spi->sync_offset != 0) - spi->sync_period = scsi_calc_syncparam(sync_period); - else - spi->sync_period = 0; - - spi->valid = CTS_SPI_VALID_SYNC_RATE - | CTS_SPI_VALID_SYNC_OFFSET - | CTS_SPI_VALID_BUS_WIDTH; - xpt_async(AC_TRANSFER_NEG, cts->ccb_h.path, cts); -} - -static void -ahamapmboxes(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct aha_softc* aha; - - aha = (struct aha_softc*)arg; - aha->mailbox_physbase = segs->ds_addr; -} - -static void -ahamapccbs(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - struct aha_softc* aha; - - aha = (struct aha_softc*)arg; - aha->aha_ccb_physbase = segs->ds_addr; -} - -static void -ahamapsgs(void *arg, bus_dma_segment_t *segs, int nseg, int error) -{ - - struct aha_softc* aha; - - aha = (struct aha_softc*)arg; - SLIST_FIRST(&aha->sg_maps)->sg_physaddr = segs->ds_addr; -} - -static void -ahapoll(struct cam_sim *sim) -{ - aha_intr(cam_sim_softc(sim)); -} - -static void -ahatimeout(void *arg) -{ - struct aha_ccb *accb; - union ccb *ccb; - struct aha_softc *aha; - u_int32_t paddr; - - accb = (struct aha_ccb *)arg; - ccb = accb->ccb; - aha = (struct aha_softc *)ccb->ccb_h.ccb_aha_ptr; - xpt_print_path(ccb->ccb_h.path); - kprintf("CCB %p - timed out\n", (void *)accb); - - crit_enter(); - - if ((accb->flags & ACCB_ACTIVE) == 0) { - xpt_print_path(ccb->ccb_h.path); - kprintf("CCB %p - timed out CCB already completed\n", - (void *)accb); - crit_exit(); - return; - } - - /* - * In order to simplify the recovery process, we ask the XPT - * layer to halt the queue of new transactions and we traverse - * the list of pending CCBs and remove their timeouts. This - * means that the driver attempts to clear only one error - * condition at a time. In general, timeouts that occur - * close together are related anyway, so there is no benefit - * in attempting to handle errors in parrallel. Timeouts will - * be reinstated when the recovery process ends. - */ - if ((accb->flags & ACCB_DEVICE_RESET) == 0) { - struct ccb_hdr *ccb_h; - - if ((accb->flags & ACCB_RELEASE_SIMQ) == 0) { - xpt_freeze_simq(aha->sim, /*count*/1); - accb->flags |= ACCB_RELEASE_SIMQ; - } - - ccb_h = LIST_FIRST(&aha->pending_ccbs); - while (ccb_h != NULL) { - struct aha_ccb *pending_accb; - - pending_accb = (struct aha_ccb *)ccb_h->ccb_accb_ptr; - callout_stop(&ccb_h->timeout_ch); - ccb_h = LIST_NEXT(ccb_h, sim_links.le); - } - } - - if ((accb->flags & ACCB_DEVICE_RESET) != 0 - || aha->cur_outbox->action_code != AMBO_FREE) { - /* - * Try a full host adapter/SCSI bus reset. - * We do this only if we have already attempted - * to clear the condition with a BDR, or we cannot - * attempt a BDR for lack of mailbox resources. - */ - ccb->ccb_h.status = CAM_CMD_TIMEOUT; - ahareset(aha, /*hardreset*/TRUE); - device_printf(aha->dev, "No longer in timeout\n"); - } else { - /* - * Send a Bus Device Reset message: - * The target that is holding up the bus may not - * be the same as the one that triggered this timeout - * (different commands have different timeout lengths), - * but we have no way of determining this from our - * timeout handler. Our strategy here is to queue a - * BDR message to the target of the timed out command. - * If this fails, we'll get another timeout 2 seconds - * later which will attempt a bus reset. - */ - accb->flags |= ACCB_DEVICE_RESET; - callout_reset(&ccb->ccb_h.timeout_ch, 2 * hz, ahatimeout, accb); - aha->recovery_accb->hccb.opcode = INITIATOR_BUS_DEV_RESET; - - /* No Data Transfer */ - aha->recovery_accb->hccb.datain = TRUE; - aha->recovery_accb->hccb.dataout = TRUE; - aha->recovery_accb->hccb.ahastat = 0; - aha->recovery_accb->hccb.sdstat = 0; - aha->recovery_accb->hccb.target = ccb->ccb_h.target_id; - - /* Tell the adapter about this command */ - paddr = ahaccbvtop(aha, aha->recovery_accb); - ahautoa24(paddr, aha->cur_outbox->ccb_addr); - aha->cur_outbox->action_code = AMBO_START; - aha_outb(aha, COMMAND_REG, AOP_START_MBOX); - ahanextoutbox(aha); - } - - crit_exit(); -} - -int -aha_detach(struct aha_softc *aha) -{ - xpt_async(AC_LOST_DEVICE, aha->path, NULL); - xpt_free_path(aha->path); - xpt_bus_deregister(cam_sim_path(aha->sim)); - cam_sim_free(aha->sim); - return (0); -} diff --git a/sys/dev/disk/aha/aha_isa.c b/sys/dev/disk/aha/aha_isa.c deleted file mode 100644 index 0c9284a77a..0000000000 --- a/sys/dev/disk/aha/aha_isa.c +++ /dev/null @@ -1,332 +0,0 @@ -/* - * Product specific probe and attach routines for: - * Adaptec 154x. - * - * Derived from code written by: - * - * Copyright (c) 1998 Justin T. Gibbs - * 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, - * without modification, immediately at the beginning of the file. - * 2. 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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: src/sys/dev/aha/aha_isa.c,v 1.17.2.1 2000/08/02 22:24:40 peter Exp $ - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include "ahareg.h" - -#include - -static struct isa_pnp_id aha_ids[] = { - {ADP0100_PNP, "Adaptec 1540/1542 ISA SCSI"}, /* ADP0100 */ - {AHA1540_PNP, "Adaptec 1540/aha-1640/aha-1535"},/* ADP1542 */ - {AHA1542_PNP, "Adaptec 1542/aha-1535"}, /* ADP1542 */ - {AHA1542_PNPCOMPAT, "Adaptec 1542 compatible"}, /* PNP00A0 */ - {ICU0091_PNP, "Adaptec AHA-1540/1542 SCSI"}, /* ICU0091 */ - {0} -}; - -/* - * Check if the device can be found at the port given - * and if so, set it up ready for further work - * as an argument, takes the isa_device structure from - * autoconf.c - */ -static int -aha_isa_probe(device_t dev) -{ - /* - * find unit and check we have that many defined - */ - struct aha_softc **sc = device_get_softc(dev); - struct aha_softc *aha; - int port_index; - int max_port_index; - int error; - u_long port_start, port_count; - struct resource *port_res; - int port_rid; - int drq; - int irq; - - aha = NULL; - - /* Check isapnp ids */ - if (ISA_PNP_PROBE(device_get_parent(dev), dev, aha_ids) == ENXIO) - return (ENXIO); - - error = bus_get_resource(dev, SYS_RES_IOPORT, 0, - &port_start, &port_count); - if (error != 0) - port_start = 0; - - /* - * Bound our board search if the user has - * specified an exact port. - */ - aha_find_probe_range(port_start, &port_index, &max_port_index); - - if (port_index < 0) - return ENXIO; - - /* Attempt to find an adapter */ - for (;port_index <= max_port_index; port_index++) { - config_data_t config_data; - u_int ioport; - int error; - - ioport = aha_iop_from_bio(port_index); - - error = bus_set_resource(dev, SYS_RES_IOPORT, 0, - ioport, AHA_NREGS); - if (error) - return error; - - port_rid = 0; - port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &port_rid, - 0, ~0, AHA_NREGS, RF_ACTIVE); - if (!port_res) - continue; - - /* Allocate a softc for use during probing */ - aha = aha_alloc(dev, rman_get_bustag(port_res), - rman_get_bushandle(port_res)); - - if (aha == NULL) { - bus_release_resource(dev, SYS_RES_IOPORT, port_rid, - port_res); - break; - } - - /* See if there is really a card present */ - if (aha_probe(aha) || aha_fetch_adapter_info(aha)) { - aha_free(aha); - bus_release_resource(dev, SYS_RES_IOPORT, port_rid, - port_res); - continue; - } - - /* - * Determine our IRQ, and DMA settings and - * export them to the configuration system. - */ - error = aha_cmd(aha, AOP_INQUIRE_CONFIG, NULL, /*parmlen*/0, - (u_int8_t*)&config_data, sizeof(config_data), - DEFAULT_CMD_TIMEOUT); - - if (error != 0) { - kprintf("aha_isa_probe: Could not determine IRQ or DMA " - "settings for adapter at 0x%x. Failing probe\n", - ioport); - aha_free(aha); - bus_release_resource(dev, SYS_RES_IOPORT, port_rid, - port_res); - continue; - } - - bus_release_resource(dev, SYS_RES_IOPORT, port_rid, port_res); - - switch (config_data.dma_chan) { - case DMA_CHAN_5: - drq = 5; - break; - case DMA_CHAN_6: - drq = 6; - break; - case DMA_CHAN_7: - drq = 7; - break; - default: - kprintf("aha_isa_probe: Invalid DMA setting " - "detected for adapter at 0x%x. " - "Failing probe\n", ioport); - return (ENXIO); - } - error = bus_set_resource(dev, SYS_RES_DRQ, 0, drq, 1); - if (error) - return error; - - irq = ffs(config_data.irq) + 8; - error = bus_set_resource(dev, SYS_RES_IRQ, 0, irq, 1); - if (error) - return error; - - *sc = aha; - aha_unit++; - - return (0); - } - - return (ENXIO); -} - -/* - * Attach all the sub-devices we can find - */ -static int -aha_isa_attach(device_t dev) -{ - struct aha_softc **sc = device_get_softc(dev); - struct aha_softc *aha; - bus_dma_filter_t *filter; - void *filter_arg; - bus_addr_t lowaddr; - void *ih; - int error; - - aha = *sc; - aha->dev = dev; - aha->portrid = 0; - aha->port = bus_alloc_resource(dev, SYS_RES_IOPORT, &aha->portrid, - 0, ~0, AHA_NREGS, RF_ACTIVE); - if (!aha->port) { - device_printf(dev, "Unable to allocate I/O ports\n"); - return ENOMEM; - } - - aha->irqrid = 0; - aha->irq = bus_alloc_resource(dev, SYS_RES_IRQ, &aha->irqrid, 0, ~0, 1, - RF_ACTIVE); - if (!aha->irq) { - device_printf(dev, "Unable to allocate excluse use of irq\n"); - bus_release_resource(dev, SYS_RES_IOPORT, aha->portrid, aha->port); - return ENOMEM; - } - - aha->drqrid = 0; - aha->drq = bus_alloc_resource(dev, SYS_RES_DRQ, &aha->drqrid, 0, ~0, 1, - RF_ACTIVE); - if (!aha->drq) { - device_printf(dev, "Unable to allocate drq\n"); - bus_release_resource(dev, SYS_RES_IOPORT, aha->portrid, aha->port); - bus_release_resource(dev, SYS_RES_IRQ, aha->irqrid, aha->irq); - return ENOMEM; - } - -#if 0 /* is the drq ever unset? */ - if (dev->id_drq != -1) - isa_dmacascade(dev->id_drq); -#endif - isa_dmacascade(rman_get_start(aha->drq)); - - /* Allocate our parent dmatag */ - filter = NULL; - filter_arg = NULL; - lowaddr = BUS_SPACE_MAXADDR_24BIT; - - if (bus_dma_tag_create(/*parent*/NULL, /*alignemnt*/1, /*boundary*/0, - lowaddr, /*highaddr*/BUS_SPACE_MAXADDR, - filter, filter_arg, - /*maxsize*/BUS_SPACE_MAXSIZE_24BIT, - /*nsegments*/BUS_SPACE_UNRESTRICTED, - /*maxsegsz*/BUS_SPACE_MAXSIZE_24BIT, - /*flags*/0, &aha->parent_dmat) != 0) { - bus_release_resource(dev, SYS_RES_IOPORT, aha->portrid, aha->port); - bus_release_resource(dev, SYS_RES_IRQ, aha->irqrid, aha->irq); - bus_release_resource(dev, SYS_RES_DRQ, aha->drqrid, aha->drq); - aha_free(aha); - return (ENOMEM); - } - - if (aha_init(aha)) { - device_printf(dev, "init failed\n"); - bus_release_resource(dev, SYS_RES_IOPORT, aha->portrid, aha->port); - bus_release_resource(dev, SYS_RES_IRQ, aha->irqrid, aha->irq); - bus_release_resource(dev, SYS_RES_DRQ, aha->drqrid, aha->drq); - aha_free(aha); - return (ENOMEM); - } - - error = aha_attach(aha); - if (error) { - device_printf(dev, "attach failed\n"); - bus_release_resource(dev, SYS_RES_IOPORT, aha->portrid, aha->port); - bus_release_resource(dev, SYS_RES_IRQ, aha->irqrid, aha->irq); - bus_release_resource(dev, SYS_RES_DRQ, aha->drqrid, aha->drq); - aha_free(aha); - return (error); - } - - error = bus_setup_intr(dev, aha->irq, 0, aha_intr, aha, &ih, NULL); - if (error) { - device_printf(dev, "Unable to register interrupt handler\n"); - bus_release_resource(dev, SYS_RES_IOPORT, aha->portrid, aha->port); - bus_release_resource(dev, SYS_RES_IRQ, aha->irqrid, aha->irq); - bus_release_resource(dev, SYS_RES_DRQ, aha->drqrid, aha->drq); - aha_free(aha); - return (error); - } - - return (0); -} - -static int -aha_isa_detach(device_t dev) -{ - struct aha_softc *aha = *(struct aha_softc **) device_get_softc(dev); - int error; - - error = bus_teardown_intr(dev, aha->irq, aha->ih); - if (error) { - device_printf(dev, "failed to unregister interrupt handler\n"); - } - - bus_release_resource(dev, SYS_RES_IOPORT, aha->portrid, aha->port); - bus_release_resource(dev, SYS_RES_IRQ, aha->irqrid, aha->irq); - bus_release_resource(dev, SYS_RES_DRQ, aha->drqrid, aha->drq); - - error = aha_detach(aha); - if (error) { - device_printf(dev, "detach failed\n"); - return (error); - } - aha_free(aha); - - return (0); -} - -static device_method_t aha_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, aha_isa_probe), - DEVMETHOD(device_attach, aha_isa_attach), - DEVMETHOD(device_detach, aha_isa_detach), - - { 0, 0 } -}; - -static driver_t aha_isa_driver = { - "aha", - aha_isa_methods, - sizeof(struct aha_softc*), -}; - -static devclass_t aha_devclass; - -DRIVER_MODULE(aha, isa, aha_isa_driver, aha_devclass, NULL, NULL); diff --git a/sys/dev/disk/aha/ahareg.h b/sys/dev/disk/aha/ahareg.h deleted file mode 100644 index f4d77fe585..0000000000 --- a/sys/dev/disk/aha/ahareg.h +++ /dev/null @@ -1,440 +0,0 @@ -/* - * Generic register and struct definitions for the Adaptech 154x/164x - * SCSI host adapters. Product specific probe and attach routines can - * be found in: - * - * - * Derived from bt.c written by: - * - * Copyright (c) 1998 Justin T. Gibbs. - * 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, - * without modification, immediately at the beginning of the file. - * 2. 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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: src/sys/dev/aha/ahareg.h,v 1.8.2.1 2000/08/02 22:24:40 peter Exp $ - * $DragonFly: src/sys/dev/disk/aha/ahareg.h,v 1.4 2005/09/11 13:03:16 sephe Exp $ - */ - -#ifndef _AHAREG_H_ -#define _AHAREG_H_ - -#include "use_aha.h" - -#include -#include - -#define AHA_MAXTRANSFER_SIZE 0xffffff /* limited by 24bit counter */ -#define AHA_NSEG 17 /* The number of dma segments - * supported. */ -#define ALL_TARGETS (~0) - -/* - * Control Register pp. 1-8, 1-9 (Write Only) - */ -#define CONTROL_REG 0x00 -#define HARD_RESET 0x80 /* Hard Reset - return to POST state */ -#define SOFT_RESET 0x40 /* Soft Reset - Clears Adapter state */ -#define RESET_INTR 0x20 /* Reset/Ack Interrupt */ -#define RESET_SBUS 0x10 /* Drive SCSI bus reset signal */ - -/* - * Status Register pp. 1-9, 1-10 (Read Only) - */ -#define STATUS_REG 0x00 -#define DIAG_ACTIVE 0x80 /* Performing Internal Diags */ -#define DIAG_FAIL 0x40 /* Internal Diags failed */ -#define INIT_REQUIRED 0x20 /* MBOXes need initialization */ -#define HA_READY 0x10 /* HA ready for new commands */ -#define CMD_REG_BUSY 0x08 /* HA busy with last cmd byte */ -#define DATAIN_REG_READY 0x04 /* Data-in Byte available */ -#define STATUS_REG_RSVD 0x02 -#define CMD_INVALID 0x01 /* Invalid Command detected */ - -/* - * Command/Parameter Register pp. 1-10, 1-11 (Write Only) - */ -#define COMMAND_REG 0x01 - -/* - * Data in Register p. 1-11 (Read Only) - */ -#define DATAIN_REG 0x01 - -/* - * Interrupt Status Register pp. 1-12 -> 1-14 (Read Only) - */ -#define INTSTAT_REG 0x02 -#define INTR_PENDING 0x80 /* There is a pending INTR */ -#define INTSTAT_REG_RSVD 0x70 -#define SCSI_BUS_RESET 0x08 /* Bus Reset detected */ -#define CMD_COMPLETE 0x04 -#define OMB_READY 0x02 /* Outgoin Mailbox Ready */ -#define IMB_LOADED 0x01 /* Incoming Mailbox loaded */ - -/* - * Definitions for the "undocumented" geometry register, we just need - * its location. - */ -#define GEOMETRY_REG 0x03 - -#define AHA_NREGS (4) - -/* - * Opcodes for Adapter commands. - */ -typedef enum { - AOP_NOP = 0x00, - AOP_INITIALIZE_MBOX = 0x01, - AOP_START_MBOX = 0x02, - AOP_EXECUTE_BIOS_CMD = 0x03, - AOP_INQUIRE_BOARD_ID = 0x04, - AOP_ENABLE_OMBR_INT = 0x05, - AOP_SET_SEL_TIMOUT = 0x06, - AOP_SET_TIME_ON_BUS = 0x07, - AOP_SET_TIME_OFF_BUS = 0x08, - AOP_SET_BUS_TRANS_RATE = 0x09, - AOP_INQUIRE_INST_LDEVS = 0x0A, - AOP_INQUIRE_CONFIG = 0x0B, - AOP_ENABLE_TARGET_MODE = 0x0C, - AOP_INQUIRE_SETUP_INFO = 0x0D, - AOP_WRITE_LRAM = 0x1A, - AOP_READ_LRAM = 0x1B, - AOP_WRITE_CHIP_FIFO = 0x1C, - AOP_READ_CHIP_FIFO = 0x1D, - AOP_ECHO_DATA_BYTE = 0x1F, - AOP_ADAPTER_DIAGNOSTICS = 0x20, - AOP_SET_ADAPTER_OPTIONS = 0x21, - AOP_SET_EEPROM = 0x22, - AOP_RETURN_EEPROM = 0x23, - AOP_ENABLE_SHADOW_RAM = 0x24, - AOP_INIT_BIOS_MBOX = 0x25, - AOP_SET_BIOS_BANK_1 = 0x26, - AOP_SET_BIOS_BANK_2 = 0x27, - AOP_RETURN_EXT_BIOS_INFO= 0x28, - AOP_MBOX_IF_ENABLE = 0x29, - AOP_SCSI_TERM_STATUS = 0x2C, - AOP_INQUIRE_SCAM_DEV = 0x2D, - AOP_SCSI_DEV_TABLE = 0x2E, - AOP_SCAM_OP = 0x2F, - AOP_START_BIOS_CMD = 0x82, - AOP_INQUIRE_ESETUP_INFO = 0x8D -} aha_op_t; - -/************** Definitions of Multi-byte commands and responses ************/ - -struct aha_extbios -{ - u_int8_t flags; /* Bit 3 == 1 extended bios enabled */ - u_int8_t mailboxlock; /* mail box lock code to unlock it */ -}; - -typedef struct { - u_int8_t num_mboxes; - u_int8_t base_addr[3]; -} init_24b_mbox_params_t; - -typedef struct { - u_int8_t board_type; -/* These values are mostly from the aha-1540CP technical reference, but */ -/* with other values from the old aha1542.c driver. The values from the */ -/* aha-1540CP technical manual are used where conflicts arise */ -#define BOARD_1540_16HEAD_BIOS 0x00 -#define BOARD_1540_64HEAD_BIOS 0x30 -#define BOARD_1542 0x41 /* aha-1540/1542 w/64-h bios */ -#define BOARD_1640 0x42 /* aha-1640 */ -#define BOARD_1740 0x43 /* aha-1740A/1742A/1744 */ -#define BOARD_1542C 0x44 /* aha-1542C */ -#define BOARD_1542CF 0x45 /* aha-1542CF */ -#define BOARD_1542CP 0x46 /* aha-1542CP, plug and play */ - u_int8_t cust_features; -#define FEATURES_STANDARD 0x30 - u_int8_t firmware_rev_major; - u_int8_t firmware_rev_minor; -} board_id_data_t; - -typedef struct { - u_int8_t dma_chan; -#define DMA_CHAN_5 0x20 -#define DMA_CHAN_6 0x40 -#define DMA_CHAN_7 0x80 - u_int8_t irq; -#define IRQ_9 0x01 -#define IRQ_10 0x02 -#define IRQ_11 0x04 -#define IRQ_12 0x08 -#define IRQ_14 0x20 -#define IRQ_15 0x40 - u_int8_t scsi_id; -} config_data_t; - -typedef struct { - u_int8_t enable; -} target_mode_params_t; - -typedef struct { - u_int8_t offset : 4, - period : 3, - sync : 1; -} targ_syncinfo_t; - -typedef struct { - u_int8_t initiate_sync : 1, - parity_enable : 1, - : 6; - - u_int8_t bus_transfer_rate; - u_int8_t time_on_bus; - u_int8_t time_off_bus; - u_int8_t num_mboxes; - u_int8_t mbox_base_addr[3]; - targ_syncinfo_t syncinfo[8]; - u_int8_t discinfo; - u_int8_t customer_sig[20]; - u_int8_t auto_retry; - u_int8_t board_switches; - u_int8_t firmware_cksum[2]; - u_int8_t bios_mbox_addr[3]; -} setup_data_t; - -struct aha_isa_port { - u_int16_t addr; - u_int8_t bio; /* board IO offset */ -}; - -#define AHA_NUM_ISAPORTS 6 - -typedef enum { - BIO_330 = 0, - BIO_334 = 1, - BIO_230 = 2, - BIO_234 = 3, - BIO_130 = 4, - BIO_134 = 5, - BIO_DISABLED = 6, - BIO_DISABLED2 = 7 -} isa_compat_io_t; - -typedef struct { - u_int8_t sync_rate[16]; /* Sync in 10ns units */ -} target_sync_info_data_t; - -typedef struct { - u_int8_t len[3]; - u_int8_t addr[3]; -} aha_sg_t; - -/********************** Mail Box definitions *******************************/ - -typedef enum { - AMBO_FREE = 0x0, /* MBO intry is free */ - AMBO_START = 0x1, /* MBO activate entry */ - AMBO_ABORT = 0x2 /* MBO abort entry */ -} aha_mbo_action_code_t; - -typedef struct aha_mbox_out { - u_int8_t action_code; - u_int8_t ccb_addr[3]; -} aha_mbox_out_t; - -typedef enum { - AMBI_FREE = 0x0, /* MBI entry is free */ - AMBI_OK = 0x1, /* completed without error */ - AMBI_ABORT = 0x2, /* aborted ccb */ - AMBI_NOT_FOUND = 0x3, /* Tried to abort invalid CCB */ - AMBI_ERROR = 0x4 /* Completed with error */ -} aha_mbi_comp_code_t; - -typedef struct aha_mbox_in { - u_int8_t comp_code; - u_int8_t ccb_addr[3]; -} aha_mbox_in_t; - -/****************** Hardware CCB definition *********************************/ -typedef enum { - INITIATOR_CCB = 0x00, - INITIATOR_SG_CCB = 0x02, - INITIATOR_CCB_WRESID = 0x03, - INITIATOR_SG_CCB_WRESID = 0x04, - INITIATOR_BUS_DEV_RESET = 0x81 -} aha_ccb_opcode_t; - -typedef enum { - AHASTAT_NOERROR = 0x00, - AHASTAT_SELTIMEOUT = 0x11, - AHASTAT_DATARUN_ERROR = 0x12, - AHASTAT_UNEXPECTED_BUSFREE = 0x13, - AHASTAT_INVALID_PHASE = 0x14, - AHASTAT_INVALID_ACTION_CODE = 0x15, - AHASTAT_INVALID_OPCODE = 0x16, - AHASTAT_LINKED_CCB_LUN_MISMATCH = 0x17, - AHASTAT_INVALID_CCB_OR_SG_PARAM = 0x1A, - AHASTAT_HA_SCSI_BUS_RESET = 0x22, /* stolen from bt */ - AHASTAT_HA_BDR = 0x25 /* Stolen from bt */ -} ahastat_t; - -struct aha_hccb { - u_int8_t opcode; /* 0 */ - u_int8_t lun : 3, /* 1 */ - datain : 1, - dataout : 1, - target : 3; - u_int8_t cmd_len; /* 2 */ - u_int8_t sense_len; /* 3 */ - u_int8_t data_len[3]; /* 4 */ - u_int8_t data_addr[3]; /* 7 */ - u_int8_t link_ptr[3]; /* 10 */ - u_int8_t link_id; /* 13 */ - u_int8_t ahastat; /* 14 */ - u_int8_t sdstat; /* 15 */ - u_int8_t reserved1; /* 16 */ - u_int8_t reserved2; /* 17 */ - u_int8_t scsi_cdb[16]; /* 18 */ - u_int8_t sense_data[SSD_FULL_SIZE]; -}; - -typedef enum { - ACCB_FREE = 0x0, - ACCB_ACTIVE = 0x1, - ACCB_DEVICE_RESET = 0x2, - ACCB_RELEASE_SIMQ = 0x4 -} accb_flags_t; - -struct aha_ccb { - struct aha_hccb hccb; /* hccb assumed to be at 0 */ - SLIST_ENTRY(aha_ccb) links; - u_int32_t flags; - union ccb *ccb; - bus_dmamap_t dmamap; - aha_sg_t *sg_list; - u_int32_t sg_list_phys; -}; - -struct sg_map_node { - bus_dmamap_t sg_dmamap; - bus_addr_t sg_physaddr; - aha_sg_t* sg_vaddr; - SLIST_ENTRY(sg_map_node) links; -}; - -struct aha_softc { - bus_space_tag_t tag; - bus_space_handle_t bsh; - struct cam_sim *sim; - struct cam_path *path; - aha_mbox_out_t *cur_outbox; - aha_mbox_in_t *cur_inbox; - aha_mbox_out_t *last_outbox; - aha_mbox_in_t *last_inbox; - struct aha_ccb *aha_ccb_array; - SLIST_HEAD(,aha_ccb) free_aha_ccbs; - LIST_HEAD(,ccb_hdr) pending_ccbs; - u_int active_ccbs; - u_int32_t aha_ccb_physbase; - aha_ccb_opcode_t ccb_sg_opcode; - aha_ccb_opcode_t ccb_ccb_opcode; - aha_mbox_in_t *in_boxes; - aha_mbox_out_t *out_boxes; - struct scsi_sense_data *sense_buffers; - u_int32_t sense_buffers_physbase; - struct aha_ccb *recovery_accb; - u_int num_boxes; - bus_dma_tag_t parent_dmat; /* - * All dmat's derive from - * the dmat defined by our - * bus. - */ - bus_dma_tag_t buffer_dmat; /* dmat for buffer I/O */ - bus_dma_tag_t mailbox_dmat; /* dmat for our mailboxes */ - bus_dmamap_t mailbox_dmamap; - bus_dma_tag_t ccb_dmat; /* dmat for our ccb array */ - bus_dmamap_t ccb_dmamap; - bus_dma_tag_t sg_dmat; /* dmat for our sg maps */ - SLIST_HEAD(, sg_map_node) sg_maps; - bus_addr_t mailbox_physbase; - u_int num_ccbs; /* Number of CCBs malloc'd */ - u_int max_ccbs; /* Maximum allocatable CCBs */ - u_int max_sg; - u_int scsi_id; - u_int32_t extended_trans :1, - diff_bus :1, - extended_lun :1, - strict_rr :1, - tag_capable :1, - resource_shortage:1, - :26; - u_int16_t disc_permitted; - u_int16_t sync_permitted; - u_int8_t init_level; - volatile u_int8_t command_cmp; - volatile u_int8_t latched_status; - u_int32_t bios_addr; - u_int8_t fw_major; - u_int8_t fw_minor; - char model[32]; - u_int8_t boardid; - struct resource *irq; - int irqrid; - struct resource *port; - int portrid; - struct resource *drq; - int drqrid; - void **ih; - device_t dev; -}; - -extern struct aha_softc *aha_softcs[]; /* XXX Config should handle this */ -extern u_long aha_unit; - -#define AHA_TEMP_UNIT 0xFF /* Unit for probes */ -struct aha_softc* aha_alloc(device_t, bus_space_tag_t, bus_space_handle_t); -int aha_attach(struct aha_softc *); -int aha_cmd(struct aha_softc *, aha_op_t, u_int8_t *, - u_int, u_int8_t *, u_int, u_int); -int aha_detach(struct aha_softc *); -int aha_fetch_adapter_info(struct aha_softc *); -void aha_find_probe_range(int, int *, int *); -void aha_free(struct aha_softc *); -int aha_init(struct aha_softc *); -void aha_intr(void *); -int aha_iop_from_bio(isa_compat_io_t); -char * aha_name(struct aha_softc *); -int aha_probe(struct aha_softc *); - -#define DEFAULT_CMD_TIMEOUT 10000 /* 1 sec */ - -#define aha_inb(aha, port) \ - bus_space_read_1((aha)->tag, (aha)->bsh, port) - -#define aha_outb(aha, port, value) \ - bus_space_write_1((aha)->tag, (aha)->bsh, port, value) - -/* XXX BAD */ -#define EXTRA_AHA 4 -#define NAHATOT (NAHA + EXTRA_AHA) - -#define ADP0100_PNP 0x00019004 /* ADP0100 */ -#define AHA1540_PNP 0x40159004 /* ADP1540 */ -#define AHA1542_PNP 0x42159004 /* ADP1542 */ -#define AHA1542_PNPCOMPAT 0xA000D040 /* PNP00A0 */ -#define ICU0091_PNP 0X91005AA4 /* ICU0091 */ - -#endif /* _AHA_H_ */ diff --git a/sys/dev/disk/wt/wt.c b/sys/dev/disk/wt/wt.c deleted file mode 100644 index 230610f944..0000000000 --- a/sys/dev/disk/wt/wt.c +++ /dev/null @@ -1,975 +0,0 @@ - -/* - * Streamer tape driver for 386bsd and FreeBSD. - * Supports Archive and Wangtek compatible QIC-02/QIC-36 boards. - * - * Copyright (C) 1993 by: - * Sergey Ryzhkov - * Serge Vakulenko - * - * This software is distributed with NO WARRANTIES, not even the implied - * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Authors grant any other persons or organisations permission to use - * or modify this software as long as this message is kept with the software, - * all derivative works or modified versions. - * - * This driver is derived from the old 386bsd Wangtek streamer tape driver, - * made by Robert Baron at CMU, based on Intel sources. - * Authors thank Robert Baron, CMU and Intel and retain here - * the original CMU copyright notice. - * - * Version 1.3, Thu Nov 11 12:09:13 MSK 1993 - * $FreeBSD: src/sys/i386/isa/wt.c,v 1.57.2.1 2000/08/08 19:49:53 peter Exp $ - * - */ - -/* - * Code for MTERASE added by John Lind (john@starfire.mn.org) 95/09/02. - * This was very easy due to the excellent structure and clear coding - * of the original driver. - */ - -/* - * Copyright (c) 1989 Carnegie-Mellon University. - * All rights reserved. - * - * Authors: Robert Baron - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -#include "use_wt.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include "wtreg.h" - - -/* - * Uncomment this to enable internal device tracing. - */ -#define TRACE(s) /* kprintf s */ - -/* - * Wangtek controller ports - */ -#define WT_CTLPORT(base) ((base)+0) /* control, write only */ -#define WT_STATPORT(base) ((base)+0) /* status, read only */ -#define WT_CMDPORT(base) ((base)+1) /* command, write only */ -#define WT_DATAPORT(base) ((base)+1) /* data, read only */ -#define WT_NPORT 2 /* 2 i/o ports */ - -/* status port bits */ -#define WT_BUSY 0x01 /* not ready bit define */ -#define WT_NOEXCEP 0x02 /* no exception bit define */ -#define WT_RESETMASK 0x07 /* to check after reset */ -#define WT_RESETVAL 0x05 /* state after reset */ - -/* control port bits */ -#define WT_ONLINE 0x01 /* device selected */ -#define WT_RESET 0x02 /* reset command */ -#define WT_REQUEST 0x04 /* request command */ -#define WT_IEN 0x08 /* enable dma */ - -/* - * Archive controller ports - */ -#define AV_DATAPORT(base) ((base)+0) /* data, read only */ -#define AV_CMDPORT(base) ((base)+0) /* command, write only */ -#define AV_STATPORT(base) ((base)+1) /* status, read only */ -#define AV_CTLPORT(base) ((base)+1) /* control, write only */ -#define AV_SDMAPORT(base) ((base)+2) /* start dma */ -#define AV_RDMAPORT(base) ((base)+3) /* reset dma */ -#define AV_NPORT 4 /* 4 i/o ports */ - -/* status port bits */ -#define AV_BUSY 0x40 /* not ready bit define */ -#define AV_NOEXCEP 0x20 /* no exception bit define */ -#define AV_RESETMASK 0xf8 /* to check after reset */ -#define AV_RESETVAL 0x50 /* state after reset */ - -/* control port bits */ -#define AV_RESET 0x80 /* reset command */ -#define AV_REQUEST 0x40 /* request command */ -#define AV_IEN 0x20 /* enable interrupts */ - -enum wttype { - UNKNOWN = 0, /* unknown type, driver disabled */ - ARCHIVE, /* Archive Viper SC499, SC402 etc */ - WANGTEK /* Wangtek */ -}; - -typedef struct { - unsigned short err; /* code for error encountered */ - unsigned short ercnt; /* number of error blocks */ - unsigned short urcnt; /* number of underruns */ -} wtstatus_t; - -typedef struct { - enum wttype type; /* type of controller */ - unsigned unit; /* unit number */ - unsigned port; /* base i/o port */ - unsigned chan; /* dma channel number, 1..3 */ - unsigned flags; /* state of tape drive */ - unsigned dens; /* tape density */ - int bsize; /* tape block size */ - void *buf; /* internal i/o buffer */ - - void *dmavaddr; /* virtual address of dma i/o buffer */ - unsigned dmatotal; /* size of i/o buffer */ - unsigned dmaflags; /* i/o direction, ISADMA_READ or ISADMA_WRITE */ - unsigned dmacount; /* resulting length of dma i/o */ - - wtstatus_t error; /* status of controller */ - - unsigned short DATAPORT, CMDPORT, STATPORT, CTLPORT, SDMAPORT, RDMAPORT; - unsigned char BUSY, NOEXCEP, RESETMASK, RESETVAL; - unsigned char ONLINE, RESET, REQUEST, IEN; - struct callout timeout_ch; -} wtinfo_t; - -static wtinfo_t wttab[NWT]; /* tape info by unit number */ - -static int wtwait (wtinfo_t *t, int catch, char *msg); -static int wtcmd (wtinfo_t *t, int cmd); -static int wtstart (wtinfo_t *t, unsigned flags, void *vaddr, unsigned len); -static void wtdma (wtinfo_t *t); -static timeout_t wtimer; -static void wtclock (wtinfo_t *t); -static int wtreset (wtinfo_t *t); -static int wtsense (wtinfo_t *t, int verb, int ignor); -static int wtstatus (wtinfo_t *t); -static void wtintr(void *); -static void wtrewind (wtinfo_t *t); -static int wtreadfm (wtinfo_t *t); -static int wtwritefm (wtinfo_t *t); -static int wtpoll (wtinfo_t *t, int mask, int bits); - -static d_open_t wtopen; -static d_close_t wtclose; -static d_ioctl_t wtioctl; -static d_strategy_t wtstrategy; - -static struct dev_ops wt_ops = { - { "wt", 0, 0 }, - .d_open = wtopen, - .d_close = wtclose, - .d_read = physread, - .d_write = physwrite, - .d_ioctl = wtioctl, - .d_strategy = wtstrategy, -}; - - -/* - * Probe for the presence of the device. - */ -static int -wtprobe (struct isa_device *id) -{ - wtinfo_t *t = wttab + id->id_unit; - - callout_init(&t->timeout_ch); - t->unit = id->id_unit; - t->chan = id->id_drq; - t->port = id->id_iobase; - if (t->chan<1 || t->chan>3) { - kprintf ("wt%d: Bad drq=%d, should be 1..3\n", t->unit, t->chan); - return (0); - } - - /* Try Wangtek. */ - t->type = WANGTEK; - t->CTLPORT = WT_CTLPORT (t->port); t->STATPORT = WT_STATPORT (t->port); - t->CMDPORT = WT_CMDPORT (t->port); t->DATAPORT = WT_DATAPORT (t->port); - t->SDMAPORT = 0; t->RDMAPORT = 0; - t->BUSY = WT_BUSY; t->NOEXCEP = WT_NOEXCEP; - t->RESETMASK = WT_RESETMASK; t->RESETVAL = WT_RESETVAL; - t->ONLINE = WT_ONLINE; t->RESET = WT_RESET; - t->REQUEST = WT_REQUEST; t->IEN = WT_IEN; - if (wtreset (t)) - return (WT_NPORT); - - /* Try Archive. */ - t->type = ARCHIVE; - t->CTLPORT = AV_CTLPORT (t->port); t->STATPORT = AV_STATPORT (t->port); - t->CMDPORT = AV_CMDPORT (t->port); t->DATAPORT = AV_DATAPORT (t->port); - t->SDMAPORT = AV_SDMAPORT (t->port); t->RDMAPORT = AV_RDMAPORT (t->port); - t->BUSY = AV_BUSY; t->NOEXCEP = AV_NOEXCEP; - t->RESETMASK = AV_RESETMASK; t->RESETVAL = AV_RESETVAL; - t->ONLINE = 0; t->RESET = AV_RESET; - t->REQUEST = AV_REQUEST; t->IEN = AV_IEN; - if (wtreset (t)) - return (AV_NPORT); - - /* Tape controller not found. */ - t->type = UNKNOWN; - return (0); -} - -/* - * Device is found, configure it. - */ -static int -wtattach (struct isa_device *id) -{ - wtinfo_t *t = wttab + id->id_unit; - - id->id_intr = (inthand2_t *)wtintr; - if (t->type == ARCHIVE) { - kprintf ("wt%d: type \n", t->unit); - outb (t->RDMAPORT, 0); /* reset dma */ - } else - kprintf ("wt%d: type \n", t->unit); - t->flags = TPSTART; /* tape is rewound */ - t->dens = -1; /* unknown density */ - isa_dmainit(t->chan, 1024); - - make_dev(&wt_ops, id->id_unit, 0, 0, 0600, "rwt%d", id->id_unit); - return (1); -} - -struct isa_driver wtdriver = { wtprobe, wtattach, "wt", }; - -/* - * Open routine, called on every device open. - */ -static int -wtopen (struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - int u = minor (dev) & T_UNIT; - wtinfo_t *t = wttab + u; - int error; - - if (u >= NWT || t->type == UNKNOWN) - return (ENXIO); - - /* Check that device is not in use */ - if (t->flags & TPINUSE) - return (EBUSY); - - /* If the tape is in rewound state, check the status and set density. */ - if (t->flags & TPSTART) { - /* If rewind is going on, wait */ - error = wtwait (t, PCATCH, "wtrew"); - if (error) - return (error); - - /* Check the controller status */ - if (! wtsense (t, 0, (ap->a_oflags & FWRITE) ? 0 : TP_WRP)) { - /* Bad status, reset the controller */ - if (! wtreset (t)) - return (EIO); - if (! wtsense (t, 1, (ap->a_oflags & FWRITE) ? 0 : TP_WRP)) - return (EIO); - } - - /* Set up tape density. */ - if (t->dens != (minor (dev) & WT_DENSEL)) { - int d = 0; - - switch (minor (dev) & WT_DENSEL) { - case WT_DENSDFLT: default: break; /* default density */ - case WT_QIC11: d = QIC_FMT11; break; /* minor 010 */ - case WT_QIC24: d = QIC_FMT24; break; /* minor 020 */ - case WT_QIC120: d = QIC_FMT120; break; /* minor 030 */ - case WT_QIC150: d = QIC_FMT150; break; /* minor 040 */ - case WT_QIC300: d = QIC_FMT300; break; /* minor 050 */ - case WT_QIC600: d = QIC_FMT600; break; /* minor 060 */ - } - if (d) { - /* Change tape density. */ - if (! wtcmd (t, d)) - return (EIO); - if (! wtsense (t, 1, TP_WRP | TP_ILL)) - return (EIO); - - /* Check the status of the controller. */ - if (t->error.err & TP_ILL) { - kprintf ("wt%d: invalid tape density\n", t->unit); - return (ENODEV); - } - } - t->dens = minor (dev) & WT_DENSEL; - } - t->flags &= ~TPSTART; - } else if (t->dens != (minor (dev) & WT_DENSEL)) - return (ENXIO); - - t->bsize = (minor (dev) & WT_BSIZE) ? 1024 : 512; - t->buf = kmalloc (t->bsize, M_TEMP, M_WAITOK); - - if (isa_dma_acquire(t->chan)) - return(EBUSY); - - t->flags = TPINUSE; - - if (ap->a_oflags & FREAD) - t->flags |= TPREAD; - if (ap->a_oflags & FWRITE) - t->flags |= TPWRITE; - return (0); -} - -/* - * Close routine, called on last device close. - */ -static int -wtclose (struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - int u = minor (dev) & T_UNIT; - wtinfo_t *t = wttab + u; - - if (u >= NWT || t->type == UNKNOWN) - return (ENXIO); - - /* If rewind is pending, do nothing */ - if (t->flags & TPREW) - goto done; - - /* If seek forward is pending and no rewind on close, do nothing */ - if (t->flags & TPRMARK) { - if (minor (dev) & T_NOREWIND) - goto done; - - /* If read file mark is going on, wait */ - wtwait (t, 0, "wtrfm"); - } - - if (t->flags & TPWANY) - /* Tape was written. Write file mark. */ - wtwritefm (t); - - if (! (minor (dev) & T_NOREWIND)) { - /* Rewind tape to beginning of tape. */ - /* Don't wait until rewind, though. */ - wtrewind (t); - goto done; - } - if ((t->flags & TPRANY) && ! (t->flags & (TPVOL | TPWANY))) - /* Space forward to after next file mark if no writing done. */ - /* Don't wait for completion. */ - wtreadfm (t); -done: - t->flags &= TPREW | TPRMARK | TPSTART | TPTIMER; - kfree (t->buf, M_TEMP); - isa_dma_release(t->chan); - return (0); -} - -/* - * Ioctl routine. Compatible with BSD ioctls. - * There are two possible ioctls: - * ioctl (int fd, MTIOCGET, struct mtget *buf) -- get status - * ioctl (int fd, MTIOCTOP, struct mtop *buf) -- do BSD-like op - */ -static int -wtioctl (struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - caddr_t arg = ap->a_data; - int u = minor (dev) & T_UNIT; - wtinfo_t *t = wttab + u; - int error, count, op; - - if (u >= NWT || t->type == UNKNOWN) - return (ENXIO); - - switch (ap->a_cmd) { - default: - return (EINVAL); - case MTIOCIEOT: /* ignore EOT errors */ - case MTIOCEEOT: /* enable EOT errors */ - return (0); - case MTIOCGET: - ((struct mtget*)arg)->mt_type = - t->type == ARCHIVE ? MT_ISVIPER1 : 0x11; - ((struct mtget*)arg)->mt_dsreg = t->flags; /* status */ - ((struct mtget*)arg)->mt_erreg = t->error.err; /* errors */ - ((struct mtget*)arg)->mt_resid = 0; - ((struct mtget*)arg)->mt_fileno = 0; /* file */ - ((struct mtget*)arg)->mt_blkno = 0; /* block */ - return (0); - case MTIOCTOP: - break; - } - switch ((short) ((struct mtop*)arg)->mt_op) { - default: - case MTFSR: /* forward space record */ - case MTBSR: /* backward space record */ - case MTBSF: /* backward space file */ - break; - case MTNOP: /* no operation, sets status only */ - case MTCACHE: /* enable controller cache */ - case MTNOCACHE: /* disable controller cache */ - return (0); - case MTREW: /* rewind */ - case MTOFFL: /* rewind and put the drive offline */ - if (t->flags & TPREW) /* rewind is running */ - return (0); - error = wtwait (t, PCATCH, "wtorew"); - if (error) - return (error); - wtrewind (t); - return (0); - case MTFSF: /* forward space file */ - for (count=((struct mtop*)arg)->mt_count; count>0; --count) { - error = wtwait (t, PCATCH, "wtorfm"); - if (error) - return (error); - error = wtreadfm (t); - if (error) - return (error); - } - return (0); - case MTWEOF: /* write an end-of-file record */ - if (! (t->flags & TPWRITE) || (t->flags & TPWP)) - return (EACCES); - error = wtwait (t, PCATCH, "wtowfm"); - if (error) - return (error); - error = wtwritefm (t); - if (error) - return (error); - return (0); - case MTRETENS: /* re-tension tape */ - error = wtwait (t, PCATCH, "wtretens"); - if (error) - return (error); - op = QIC_RETENS; - goto erase_retens; - - case MTERASE: /* erase to EOM */ - if (! (t->flags & TPWRITE) || (t->flags & TPWP)) - return (EACCES); - error = wtwait (t, PCATCH, "wterase"); - if (error) - return (error); - op = QIC_ERASE; - erase_retens: - /* ERASE and RETENS operations work like REWIND. */ - /* Simulate the rewind operation here. */ - t->flags &= ~(TPRO | TPWO | TPVOL); - if (! wtcmd (t, op)) - return (EIO); - t->flags |= TPSTART | TPREW; - t->flags |= TPWANY; - wtclock (t); - return (0); - } - return (EINVAL); -} - -/* - * Strategy routine. - */ -static int -wtstrategy (struct dev_strategy_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct bio *bio = ap->a_bio; - struct buf *bp = bio->bio_buf; - int u = minor(dev) & T_UNIT; - wtinfo_t *t = wttab + u; - unsigned flags; - - bp->b_resid = bp->b_bcount; - if (u >= NWT || t->type == UNKNOWN) { - bp->b_error = ENXIO; - goto err2xit; - } - - /* at file marks and end of tape, we just return '0 bytes available' */ - if (t->flags & TPVOL) - goto xit; - - if (bp->b_bcount % t->bsize != 0) { - bp->b_error = EINVAL; - goto err2xit; - } - - if (bp->b_cmd == BUF_CMD_READ) { - /* Check read access and no previous write to this tape. */ - if (! (t->flags & TPREAD) || (t->flags & TPWANY)) - goto errxit; - - /* For now, we assume that all data will be copied out */ - /* If read command outstanding, just skip down */ - if (! (t->flags & TPRO)) { - if (! wtsense (t, 1, TP_WRP)) /* clear status */ - goto errxit; - if (! wtcmd (t, QIC_RDDATA)) { /* sed read mode */ - wtsense (t, 1, TP_WRP); - goto errxit; - } - t->flags |= TPRO | TPRANY; - } - flags = ISADMA_READ; - } else { - /* Check write access and write protection. */ - /* No previous read from this tape allowed. */ - if (! (t->flags & TPWRITE) || (t->flags & (TPWP | TPRANY))) - goto errxit; - - /* If write command outstanding, just skip down */ - if (! (t->flags & TPWO)) { - if (! wtsense (t, 1, 0)) /* clear status */ - goto errxit; - if (! wtcmd (t, QIC_WRTDATA)) { /* set write mode */ - wtsense (t, 1, 0); - goto errxit; - } - t->flags |= TPWO | TPWANY; - } - flags = ISADMA_WRITE; - } - - if (! bp->b_bcount) - goto xit; - - t->flags &= ~TPEXCEP; - crit_enter(); - if (wtstart (t, flags, bp->b_data, bp->b_bcount)) { - wtwait (t, 0, (flags & ISADMA_READ) ? "wtread" : "wtwrite"); - bp->b_resid -= t->dmacount; - } - crit_exit(); - - if (t->flags & TPEXCEP) { -errxit: bp->b_error = EIO; -err2xit: bp->b_flags |= B_ERROR; - } -xit: biodone (bio); - return(0); -} - -/* - * Interrupt routine. - */ -static void -wtintr (void *arg) -{ - int u = (int)arg; - wtinfo_t *t = wttab + u; - unsigned char s; - - if (u >= NWT || t->type == UNKNOWN) { - TRACE (("wtintr() -- device not configured\n")); - return; - } - - s = inb (t->STATPORT); /* get status */ - TRACE (("wtintr() status=0x%x -- ", s)); - if ((s & (t->BUSY | t->NOEXCEP)) == (t->BUSY | t->NOEXCEP)) { - TRACE (("busy\n")); - return; /* device is busy */ - } - - /* - * Check if rewind finished. - */ - if (t->flags & TPREW) { - TRACE (((s & (t->BUSY | t->NOEXCEP)) == (t->BUSY | t->NOEXCEP) ? - "rewind busy?\n" : "rewind finished\n")); - t->flags &= ~TPREW; /* Rewind finished. */ - wtsense (t, 1, TP_WRP); - wakeup ((caddr_t)t); - return; - } - - /* - * Check if writing/reading of file mark finished. - */ - if (t->flags & (TPRMARK | TPWMARK)) { - TRACE (((s & (t->BUSY | t->NOEXCEP)) == (t->BUSY | t->NOEXCEP) ? - "marker r/w busy?\n" : "marker r/w finished\n")); - if (! (s & t->NOEXCEP)) /* operation failed */ - wtsense (t, 1, (t->flags & TPRMARK) ? TP_WRP : 0); - t->flags &= ~(TPRMARK | TPWMARK); /* operation finished */ - wakeup ((caddr_t)t); - return; - } - - /* - * Do we started any i/o? If no, just return. - */ - if (! (t->flags & TPACTIVE)) { - TRACE (("unexpected interrupt\n")); - return; - } - - /* - * Clean up dma. - */ - if ((t->dmaflags & ISADMA_READ) && (t->dmatotal - t->dmacount) < t->bsize) { - /* If reading short block, copy the internal buffer - * to the user memory. */ - isa_dmadone (t->dmaflags, t->buf, t->bsize, t->chan); - bcopy (t->buf, t->dmavaddr, t->dmatotal - t->dmacount); - } else - isa_dmadone (t->dmaflags, t->dmavaddr, t->bsize, t->chan); - - t->flags &= ~TPACTIVE; - t->dmacount += t->bsize; - t->dmavaddr = (char *)t->dmavaddr + t->bsize; - - /* - * On exception, check for end of file and end of volume. - */ - if (! (s & t->NOEXCEP)) { - TRACE (("i/o exception\n")); - wtsense (t, 1, (t->dmaflags & ISADMA_READ) ? TP_WRP : 0); - if (t->error.err & (TP_EOM | TP_FIL)) - t->flags |= TPVOL; /* end of file */ - else - t->flags |= TPEXCEP; /* i/o error */ - wakeup ((caddr_t)t); - return; - } - - if (t->dmacount < t->dmatotal) { /* continue i/o */ - wtdma (t); - TRACE (("continue i/o, %d\n", t->dmacount)); - return; - } - if (t->dmacount > t->dmatotal) /* short last block */ - t->dmacount = t->dmatotal; - wakeup ((caddr_t)t); /* wake up user level */ - TRACE (("i/o finished, %d\n", t->dmacount)); -} - -/* start the rewind operation */ -static void -wtrewind (wtinfo_t *t) -{ - int rwmode = (t->flags & (TPRO | TPWO)); - - t->flags &= ~(TPRO | TPWO | TPVOL); - /* - * Wangtek strictly follows QIC-02 standard: - * clearing ONLINE in read/write modes causes rewind. - * REWIND command is not allowed in read/write mode - * and gives `illegal command' error. - */ - if (t->type==WANGTEK && rwmode) { - outb (t->CTLPORT, 0); - } else if (! wtcmd (t, QIC_REWIND)) - return; - t->flags |= TPSTART | TPREW; - wtclock (t); -} - -/* start the `read marker' operation */ -static int -wtreadfm (wtinfo_t *t) -{ - t->flags &= ~(TPRO | TPWO | TPVOL); - if (! wtcmd (t, QIC_READFM)) { - wtsense (t, 1, TP_WRP); - return (EIO); - } - t->flags |= TPRMARK | TPRANY; - wtclock (t); - /* Don't wait for completion here. */ - return (0); -} - -/* write marker to the tape */ -static int -wtwritefm (wtinfo_t *t) -{ - tsleep ((caddr_t)wtwritefm, 0, "wtwfm", hz); /* timeout: 1 second */ - t->flags &= ~(TPRO | TPWO); - if (! wtcmd (t, QIC_WRITEFM)) { - wtsense (t, 1, 0); - return (EIO); - } - t->flags |= TPWMARK | TPWANY; - wtclock (t); - return (wtwait (t, 0, "wtwfm")); -} - -/* while controller status & mask == bits continue waiting */ -static int -wtpoll (wtinfo_t *t, int mask, int bits) -{ - int s, i; - - /* Poll status port, waiting for specified bits. */ - for (i=0; i<1000; ++i) { /* up to 1 msec */ - s = inb (t->STATPORT); - if ((s & mask) != bits) - return (s); - DELAY (1); - } - for (i=0; i<100; ++i) { /* up to 10 msec */ - s = inb (t->STATPORT); - if ((s & mask) != bits) - return (s); - DELAY (100); - } - for (;;) { /* forever */ - s = inb (t->STATPORT); - if ((s & mask) != bits) - return (s); - tsleep ((caddr_t)wtpoll, 0, "wtpoll", 1); /* timeout: 1 tick */ - } -} - -/* execute QIC command */ -static int -wtcmd (wtinfo_t *t, int cmd) -{ - int s; - - TRACE (("wtcmd() cmd=0x%x\n", cmd)); - crit_enter(); - s = wtpoll (t, t->BUSY | t->NOEXCEP, t->BUSY | t->NOEXCEP); /* ready? */ - if (! (s & t->NOEXCEP)) { /* error */ - crit_exit(); - return (0); - } - - outb (t->CMDPORT, cmd); /* output the command */ - - outb (t->CTLPORT, t->REQUEST | t->ONLINE); /* set request */ - wtpoll (t, t->BUSY, t->BUSY); /* wait for ready */ - outb (t->CTLPORT, t->IEN | t->ONLINE); /* reset request */ - wtpoll (t, t->BUSY, 0); /* wait for not ready */ - crit_exit(); - return (1); -} - -/* wait for the end of i/o, seeking marker or rewind operation */ -static int -wtwait (wtinfo_t *t, int catch, char *msg) -{ - int error; - - TRACE (("wtwait() `%s'\n", msg)); - while (t->flags & (TPACTIVE | TPREW | TPRMARK | TPWMARK)) { - error = tsleep ((caddr_t)t, catch, msg, 0); - if (error) - return (error); - } - return (0); -} - -/* initialize dma for the i/o operation */ -static void -wtdma (wtinfo_t *t) -{ - t->flags |= TPACTIVE; - wtclock (t); - - if (t->type == ARCHIVE) - outb (t->SDMAPORT, 0); /* set dma */ - - if ((t->dmaflags & ISADMA_READ) && (t->dmatotal - t->dmacount) < t->bsize) - /* Reading short block. Do it through the internal buffer. */ - isa_dmastart (t->dmaflags, t->buf, t->bsize, t->chan); - else - isa_dmastart (t->dmaflags, t->dmavaddr, t->bsize, t->chan); -} - -/* start i/o operation */ -static int -wtstart (wtinfo_t *t, unsigned flags, void *vaddr, unsigned len) -{ - int s; - - TRACE (("wtstart()\n")); - crit_enter(); - s = wtpoll (t, t->BUSY | t->NOEXCEP, t->BUSY | t->NOEXCEP); /* ready? */ - if (! (s & t->NOEXCEP)) { - t->flags |= TPEXCEP; /* error */ - crit_exit(); - return (0); - } - t->flags &= ~TPEXCEP; /* clear exception flag */ - t->dmavaddr = vaddr; - t->dmatotal = len; - t->dmacount = 0; - t->dmaflags = flags; - wtdma (t); - crit_exit(); - return (1); -} - -/* start timer */ -static void -wtclock (wtinfo_t *t) -{ - if (! (t->flags & TPTIMER)) { - t->flags |= TPTIMER; - /* Some controllers seem to lose dma interrupts too often. - * To make the tape stream we need 1 tick timeout. */ - callout_reset(&t->timeout_ch, ((t->flags & TPACTIVE) ? 1 : hz), - wtimer, t); - } -} - -/* - * Simulate an interrupt periodically while i/o is going. - * This is necessary in case interrupts get eaten due to - * multiple devices on a single IRQ line. - */ -static void -wtimer (void *xt) -{ - wtinfo_t *t = (wtinfo_t *)xt; - - t->flags &= ~TPTIMER; - if (! (t->flags & (TPACTIVE | TPREW | TPRMARK | TPWMARK))) - return; - - /* If i/o going, simulate interrupt. */ - crit_enter(); - if ((inb (t->STATPORT) & (t->BUSY | t->NOEXCEP)) != (t->BUSY | t->NOEXCEP)) { - TRACE (("wtimer() -- ")); - wtintr ((void *)t->unit); - } - crit_exit(); - - /* Restart timer if i/o pending. */ - if (t->flags & (TPACTIVE | TPREW | TPRMARK | TPWMARK)) - wtclock (t); -} - -/* reset the controller */ -static int -wtreset (wtinfo_t *t) -{ - /* Perform QIC-02 and QIC-36 compatible reset sequence. */ - /* Thanks to Mikael Hybsch . */ - int s, i; - - outb (t->CTLPORT, t->RESET | t->ONLINE); /* send reset */ - DELAY (30); - outb (t->CTLPORT, t->ONLINE); /* turn off reset */ - DELAY (30); - - /* Read the controller status. */ - s = inb (t->STATPORT); - if (s == 0xff) /* no port at this address? */ - return (0); - - /* Wait 3 sec for reset to complete. Needed for QIC-36 boards? */ - for (i=0; i<3000; ++i) { - if (! (s & t->BUSY) || ! (s & t->NOEXCEP)) - break; - DELAY (1000); - s = inb (t->STATPORT); - } - return ((s & t->RESETMASK) == t->RESETVAL); -} - -/* get controller status information */ -/* return 0 if user i/o request should receive an i/o error code */ -static int -wtsense (wtinfo_t *t, int verb, int ignor) -{ - char *msg = 0; - int err; - - TRACE (("wtsense() ignor=0x%x\n", ignor)); - t->flags &= ~(TPRO | TPWO); - if (! wtstatus (t)) - return (0); - if (! (t->error.err & TP_ST0)) - t->error.err &= ~TP_ST0MASK; - if (! (t->error.err & TP_ST1)) - t->error.err &= ~TP_ST1MASK; - t->error.err &= ~ignor; /* ignore certain errors */ - err = t->error.err & (TP_FIL | TP_BNL | TP_UDA | TP_EOM | TP_WRP | - TP_USL | TP_CNI | TP_MBD | TP_NDT | TP_ILL); - if (! err) - return (1); - if (! verb) - return (0); - - /* lifted from tdriver.c from Wangtek */ - if (err & TP_USL) msg = "Drive not online"; - else if (err & TP_CNI) msg = "No cartridge"; - else if ((err & TP_WRP) && !(t->flags & TPWP)) { - msg = "Tape is write protected"; - t->flags |= TPWP; - } - else if (err & TP_FIL) msg = 0 /*"Filemark detected"*/; - else if (err & TP_EOM) msg = 0 /*"End of tape"*/; - else if (err & TP_BNL) msg = "Block not located"; - else if (err & TP_UDA) msg = "Unrecoverable data error"; - else if (err & TP_NDT) msg = "No data detected"; - else if (err & TP_ILL) msg = "Illegal command"; - if (msg) - kprintf ("wt%d: %s\n", t->unit, msg); - return (0); -} - -/* get controller status information */ -static int -wtstatus (wtinfo_t *t) -{ - char *p; - - crit_enter(); - wtpoll (t, t->BUSY | t->NOEXCEP, t->BUSY | t->NOEXCEP); /* ready? */ - outb (t->CMDPORT, QIC_RDSTAT); /* send `read status' command */ - - outb (t->CTLPORT, t->REQUEST | t->ONLINE); /* set request */ - wtpoll (t, t->BUSY, t->BUSY); /* wait for ready */ - outb (t->CTLPORT, t->ONLINE); /* reset request */ - wtpoll (t, t->BUSY, 0); /* wait for not ready */ - - p = (char*) &t->error; - while (p < (char*)&t->error + 6) { - int s = wtpoll (t, t->BUSY | t->NOEXCEP, t->BUSY | t->NOEXCEP); - if (! (s & t->NOEXCEP)) { /* error */ - crit_exit(); - return (0); - } - - *p++ = inb (t->DATAPORT); /* read status byte */ - - outb (t->CTLPORT, t->REQUEST | t->ONLINE); /* set request */ - wtpoll (t, t->BUSY, 0); /* wait for not ready */ - DELAY(20); - outb (t->CTLPORT, t->ONLINE); /* unset request */ - } - crit_exit(); - return (1); -} diff --git a/sys/dev/disk/wt/wtreg.h b/sys/dev/disk/wt/wtreg.h deleted file mode 100644 index 65d5535239..0000000000 --- a/sys/dev/disk/wt/wtreg.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Streamer tape driver for 386bsd and FreeBSD. - * Supports Archive and Wangtek compatible QIC-02/QIC-36 boards. - * - * Copyright (C) 1993 by: - * Sergey Ryzhkov - * Serge Vakulenko - * - * This software is distributed with NO WARRANTIES, not even the implied - * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Authors grant any other persons or organizations permission to use - * or modify this software as long as this message is kept with the software, - * all derivative works or modified versions. - * - * This driver is derived from the old 386bsd Wangtek streamer tape driver, - * made by Robert Baron at CMU, based on Intel sources. - * Authors thank Robert Baron, CMU and Intel and retain here - * the original CMU copyright notice. - * - * Version 1.3, Thu Nov 11 12:09:13 MSK 1993 - * $FreeBSD: src/sys/i386/isa/wtreg.h,v 1.11 1999/08/28 00:45:06 peter Exp $ - * $DragonFly: src/sys/dev/disk/wt/wtreg.h,v 1.2 2003/06/17 04:28:37 dillon Exp $ - * - */ - -/* - * Copyright (c) 1989 Carnegie-Mellon University. - * All rights reserved. - * - * Authors: Robert Baron - * - * Permission to use, copy, modify and distribute this software and - * its documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND - * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie the - * rights to redistribute these changes. - */ - -/* internal QIC-02 commands */ -#define QIC_ERASE 0x22 /* erase the tape */ -#define QIC_RETENS 0x24 /* retension the tape */ -#define QIC_RDDATA 0x80 /* read data */ -#define QIC_READFM 0xa0 /* read file mark */ -#define QIC_WRTDATA 0x40 /* write data */ -#define QIC_WRITEFM 0x60 /* write file mark */ -#define QIC_RDSTAT 0xc0 /* read status command */ -#define QIC_REWIND 0x21 /* rewind command (position+bot) */ -#define QIC_FMT11 0x26 /* set format QIC-11 */ -#define QIC_FMT24 0x27 /* set format QIC-24 */ -#define QIC_FMT120 0x28 /* set format QIC-120 */ -#define QIC_FMT150 0x29 /* set format QIC-150 */ -#define QIC_FMT300 0x2a /* set format QIC-300/QIC-2100 */ -#define QIC_FMT600 0x2b /* set format QIC-600/QIC-2200 */ - -/* tape driver flags */ -#define TPINUSE 0x0001 /* tape is already open */ -#define TPREAD 0x0002 /* tape is only open for reading */ -#define TPWRITE 0x0004 /* tape is only open for writing */ -#define TPSTART 0x0008 /* tape must be rewound and reset */ -#define TPRMARK 0x0010 /* read file mark command outstanding */ -#define TPWMARK 0x0020 /* write file mark command outstanding */ -#define TPREW 0x0040 /* rewind command outstanding */ -#define TPEXCEP 0x0080 /* i/o exception flag */ -#define TPVOL 0x0100 /* read file mark or hit end of tape */ -#define TPWO 0x0200 /* write command outstanding */ -#define TPRO 0x0400 /* read command outstanding */ -#define TPWANY 0x0800 /* write command requested */ -#define TPRANY 0x1000 /* read command requested */ -#define TPWP 0x2000 /* write protect error seen */ -#define TPTIMER 0x4000 /* timer() is active */ -#define TPACTIVE 0x8000 /* dma i/o active */ - -/* controller error register bits */ -#define TP_FIL 0x0001 /* File mark detected */ -#define TP_BNL 0x0002 /* Block not located */ -#define TP_UDA 0x0004 /* Unrecoverable data error */ -#define TP_EOM 0x0008 /* End of media */ -#define TP_WRP 0x0010 /* Write protected cartridge */ -#define TP_USL 0x0020 /* Unselected drive */ -#define TP_CNI 0x0040 /* Cartridge not in place */ -#define TP_ST0 0x0080 /* Status byte 0 bits */ -#define TP_ST0MASK 0x00ff /* Status byte 0 mask */ -#define TP_POR 0x0100 /* Power on/reset occurred */ -#define TP_ERM 0x0200 /* Reserved for end of recorded media */ -#define TP_BPE 0x0400 /* Reserved for bus parity error */ -#define TP_BOM 0x0800 /* Beginning of media */ -#define TP_MBD 0x1000 /* Marginal block detected */ -#define TP_NDT 0x2000 /* No data detected */ -#define TP_ILL 0x4000 /* Illegal command - should not happen! */ -#define TP_ST1 0x8000 /* Status byte 1 bits */ -#define TP_ST1MASK 0xff00 /* Status byte 1 mask */ - -/* device minor number */ -#define WT_BSIZE 0100 /* long block flag */ -#define WT_DENSEL 0070 /* density select mask */ -#define WT_DENSDFLT 0000 /* default density */ -#define WT_QIC11 0010 /* 11 megabytes? */ -#define WT_QIC24 0020 /* 60 megabytes */ -#define WT_QIC120 0030 /* 120 megabytes */ -#define WT_QIC150 0040 /* 150 megabytes */ -#define WT_QIC300 0050 /* 300 megabytes? */ -#define WT_QIC600 0060 /* 600 megabytes? */ diff --git a/sys/dev/misc/gpib/gpib.c b/sys/dev/misc/gpib/gpib.c deleted file mode 100644 index a90aebbcb8..0000000000 --- a/sys/dev/misc/gpib/gpib.c +++ /dev/null @@ -1,1132 +0,0 @@ - -/* - * GPIB driver for FreeBSD. - * Version 0.1 (No interrupts, no DMA) - * Supports National Instruments AT-GPIB and AT-GPIB/TNT boards. - * (AT-GPIB not tested, but it should work) - * - * Written by Fred Cawthorne (fcawth@delphi.umd.edu) - * Some sections were based partly on the lpt driver. - * (some remnants may remain) - * - * This software is distributed with NO WARRANTIES, not even the implied - * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * The author grants any other persons or organizations permission to use - * or modify this software as long as this message is kept with the software, - * all derivative works or modified versions. - * - * $FreeBSD: src/sys/i386/isa/gpib.c,v 1.29 2000/01/29 16:17:32 peter Exp $ - * - */ -/*Please read the README file for usage information*/ - -#include -#include -#include -#include -#include -#include -#include "gpibreg.h" -#include "gpib.h" -#include - -#define GPIBPRI PCATCH -#define SLEEP_MAX 1000 -#define SLEEP_MIN 4 - - - -static int initgpib(void); -static void closegpib(void); -static int sendgpibfifo(unsigned char device,char *data,int count); -static int sendrawgpibfifo(unsigned char device,char *data,int count); -static int readgpibfifo(unsigned char device,char *data,int count); -#if 0 -static void showregs(void); -#endif -static void enableremote(unsigned char device); -static void gotolocal(unsigned char device); -static void menableremote(unsigned char *device); -static void mgotolocal(unsigned char *device); -static void mtrigger(unsigned char *device); -static void trigger(unsigned char device); -static char spoll(unsigned char device); - -static int gpprobe(struct isa_device *dvp); -static int gpattach(struct isa_device *dvp); - -struct isa_driver gpdriver = {gpprobe, gpattach, "gp"}; - -static d_open_t gpopen; -static d_close_t gpclose; -static d_write_t gpwrite; -static d_ioctl_t gpioctl; - -static struct dev_ops gp_ops = { - { "gp", 0, 0 }, - .d_open = gpopen, - .d_close = gpclose, - .d_write = gpwrite, - .d_ioctl = gpioctl, -}; - -#define BUFSIZE 1024 -#define ATTACHED 0x08 -#define OPEN 0x04 -#define INIT 0x02 - - -static struct gpib_softc { - char *sc_cp; /* current data to send */ - int sc_count; /* bytes queued in sc_inbuf */ - int sc_type; /* Type of gpib controller */ - u_char sc_flags; /* flags (open and internal) */ - char sc_unit; /* gpib device number */ - char *sc_inbuf; /* buffer for data */ -} gpib_sc; /* only support one of these? */ -static int oldcount; -static char oldbytes[2]; -/*Probe routine*/ -/*This needs to be changed to be a bit more robust*/ -static int -gpprobe(struct isa_device *dvp) -{ - int status; - struct gpib_softc *sc = &gpib_sc; - - gpib_port = dvp->id_iobase; - status=1; - sc->sc_type=3; -if ((inb(KSR)&0xF7)==0x34) sc->sc_type=3; -else if ((inb(KSR)&0xF7)==0x24) sc->sc_type=2; -else if ((inb(KSR)&0xF7)==0x14) sc->sc_type=1; - else status=0; - - return (status); -} - -/* - * gpattach() - * Attach device and print the type of card to the screen. - */ -static int -gpattach(struct isa_device *isdp) -{ - struct gpib_softc *sc = &gpib_sc; - - sc->sc_unit = isdp->id_unit; - if (sc->sc_type==3) - kprintf ("gp%d: type AT-GPIB/TNT\n",sc->sc_unit); - if (sc->sc_type==2) - kprintf ("gp%d: type AT-GPIB chip NAT4882B\n",sc->sc_unit); - if (sc->sc_type==1) - kprintf ("gp%d: type AT-GPIB chip NAT4882A\n",sc->sc_unit); - sc->sc_flags |=ATTACHED; - - make_dev(&gp_ops, sc->sc_unit, 0, 0, 0600, "gp"); - return (1); -} - -/* - * gpopen() - * New open on device. - * - * More than 1 open is not allowed on the entire device. - * i.e. even if gpib5 is open, we can't open another minor device - */ -static int -gpopen(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct gpib_softc *sc = &gpib_sc; - u_char unit; - int status; - - unit= minor(dev); - - /* minor number out of limits ? */ - if (unit >= 32) - return (ENXIO); - - /* Attached ? */ - if (!(sc->sc_flags&ATTACHED)) { /* not attached */ - return(ENXIO); - } - - /* Already open */ - if (sc->sc_flags&OPEN) { /* too late .. */ - return(EBUSY); - } - - sc->sc_inbuf = kmalloc(BUFSIZE, M_DEVBUF, M_WAITOK); - - if (initgpib()) return(EBUSY); - sc->sc_flags |= OPEN; - sc->sc_count = 0; - oldcount=0; -if (unit!=0) { /*Someone is trying to access an actual device*/ - /*So.. we'll address it to listen*/ -enableremote(unit); - do { - status=inb(ISR2); - } - while (!(status&8)&&tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1)==EWOULDBLOCK); - - outb(CDOR,(unit&31)+32);/*address device to listen*/ - - do - status=inb(ISR2); - while (!(status&8)&&tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1)==EWOULDBLOCK); - outb (CDOR,64); /*Address controller (me) to talk*/ - do status=inb(ISR2); - - while (!(status&8)&&tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1)==EWOULDBLOCK); - outb(AUXMR,gts); /*Set to Standby (Controller)*/ - - - do - status=inb(ISR1); - while (!(status&2)&&tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1)==EWOULDBLOCK); -/*Set up the TURBO488 registers*/ - outb(IMR2,0x30); /*we have to enable DMA (0x30) for turbo488 to work*/ - outb(CNT0,0); /*NOTE this does not enable DMA to the host computer!!*/ - outb(CNT1,0); - outb(CNT2,0); - outb(CNT3,0); - outb(CMDR,0x20); - outb(CFG,0x47); /* 16 bit, write, fifo B first, TMOE TIM */ - outb(CMDR,0x10); /*RESET fifos*/ - outb(CMDR,0x04); /*Tell TURBO488 to GO*/ -} - return(0); -} - - -/* - * gpclose() - * Close gpib device. - */ -static int -gpclose(struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct gpib_softc *sc = &gpib_sc; - unsigned char unit; - unsigned char status; - - unit=minor(dev); -if (unit!=0) { /*Here we need to send the last character with EOS*/ - /*and unaddress the listening device*/ - - - status=EWOULDBLOCK; - - /*Wait for fifo to become empty*/ - do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while ((inb(ISR3)&0x04)&&status==EWOULDBLOCK); /*Fifo is not empty*/ - - outb(CMDR,0x08); /*Issue STOP to TURBO488*/ - - /*Wait for DONE and STOP*/ - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR3)&0x11)&&status==EWOULDBLOCK); /*not done and stop*/ - -/*Shut down TURBO488 */ - outb(IMR2,0x00); /*DISABLE DMA to turbo488*/ - outb(CMDR,0x20); /*soft reset turbo488*/ - outb(CMDR,0x10); /*reset fifos*/ - - -/*Send last byte with EOI set*/ -/*Send second to last byte if there are 2 bytes left*/ -if (status==EWOULDBLOCK) { - -do - if (!(inb(ISR1)&2)) status=tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1); -while (!(inb(ISR1)&2)&&(status==EWOULDBLOCK)); -if (oldcount==2){ - outb(CDOR,oldbytes[0]); /*Send second to last byte*/ - while (!(inb(ISR1)&2)&&(status==EWOULDBLOCK)); - status=tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1); - } - - outb(AUXMR,seoi); /*Set EOI for the last byte*/ - outb(AUXMR,0x5E); /*Clear SYNC*/ - if (oldcount==1) - outb(CDOR,oldbytes[0]); - else - if (oldcount==2) - outb(CDOR,oldbytes[1]); - else { - outb (CDOR,13); /*Send a CR.. we've got trouble*/ - kprintf("gpib: Warning: gpclose called with nothing left in buffer\n"); - } -} - -do - if (!(inb(ISR1)&2)) status=tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1); -while (!(inb(ISR1)&2)&&(status==EWOULDBLOCK)); - - - if (!(inb(ISR1)&2)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR1)&2)&&status==EWOULDBLOCK); - - - outb(AUXMR,tca); /* Regain full control of the bus*/ - - - do - status=inb(ISR2); - while (!(status&8)&&tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1)==EWOULDBLOCK); - outb(CDOR,63); /*unlisten*/ - do - status=inb(ISR2); - while (!(status&8)&&tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1)==EWOULDBLOCK); - outb(AUXMR,0x5E); /*Clear SYNC*/ - outb (CDOR,95);/*untalk*/ - do - status=inb(ISR2); - while (!(status&8)&&tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1)==EWOULDBLOCK); -/*gotolocal(minor(dev));*/ -} - closegpib(); - sc->sc_flags = ATTACHED; - kfree(sc->sc_inbuf, M_DEVBUF); - sc->sc_inbuf = 0; /* Sanity */ - return(0); -} - -/* - * gpwrite() - * Copy from user's buffer, then write to GPIB device referenced - * by minor(dev). - */ -static int -gpwrite(struct dev_write_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct uio *uio = ap->a_uio; - int err,count; - - /* main loop */ - while ((gpib_sc.sc_count = MIN(BUFSIZE-1, uio->uio_resid)) > 0) { - /* If there were >1 bytes left over, send them */ - if (oldcount==2) - sendrawgpibfifo(minor(dev),oldbytes,2); - - /*If there was 1 character left, put it at the beginning - of the new buffer*/ - if (oldcount==1){ - (gpib_sc.sc_inbuf)[0]=oldbytes[0]; - gpib_sc.sc_cp = gpib_sc.sc_inbuf; - /* get from user-space */ - uiomove(gpib_sc.sc_inbuf+1, gpib_sc.sc_count, uio); - gpib_sc.sc_count++; - } - else { - gpib_sc.sc_cp = gpib_sc.sc_inbuf; - /* get from user-space */ - uiomove(gpib_sc.sc_inbuf, gpib_sc.sc_count, uio); - } - -/*NOTE we always leave one byte in case this is the last write - so close can send EOI with the last byte There may be 2 bytes - since we are doing 16 bit transfers.(note the -1 in the count below)*/ - /*If count<=2 we'll either pick it up on the next write or on close*/ - if (gpib_sc.sc_count>2) { - count = sendrawgpibfifo(minor(dev),gpib_sc.sc_cp,gpib_sc.sc_count-1); - err=!count; - if (err) - return(1); - oldcount=gpib_sc.sc_count-count; /*Set # of remaining bytes*/ - gpib_sc.sc_count-=count; - gpib_sc.sc_cp+=count; /*point char pointer to remaining bytes*/ - } - else oldcount=gpib_sc.sc_count; - oldbytes[0]=gpib_sc.sc_cp[0]; - if (oldcount==2) - oldbytes[1]=gpib_sc.sc_cp[1]; - } - return(0); -} -/* Here is how you would usually access a GPIB device - An exception would be a plotter or printer that you can just - write to using a minor device = its GPIB address */ - -static int -gpioctl(struct dev_ioctl_args *ap) -{ - struct gpibdata *gd = (struct gpibdata *)ap->a_data; - int error,result; - error = 0; - - switch (ap->a_cmd) { - case GPIBWRITE: - sendgpibfifo(gd->address,gd->data,*(gd->count)); - error=0; - break; - case GPIBREAD: - result=readgpibfifo(gd->address,gd->data,*(gd->count)); - *(gd->count)=result; - error=0; - break; - case GPIBINIT: - initgpib(); - error=0; - break; - case GPIBTRIGGER: - trigger(gd->address); - error=0; - break; - case GPIBREMOTE: - enableremote(gd->address); - error=0; - break; - case GPIBLOCAL: - gotolocal(gd->address); - error=0; - break; - - case GPIBMTRIGGER: - mtrigger(gd->data); - error=0; - break; - case GPIBMREMOTE: - menableremote(gd->data); - error=0; - break; - case GPIBMLOCAL: - mgotolocal(gd->data); - error=0; - break; - case GPIBSPOLL: - *(gd->data)=spoll(gd->address); - error=0; - break; - default: - error = ENODEV; - } - - return(error); -} - - - - -#if 0 -/*Just in case you want a dump of the registers...*/ - -static void showregs() { - kprintf ("NAT4882:\n"); - kprintf ("ISR1=%X\t",inb(ISR1)); - kprintf ("ISR2=%X\t",inb(ISR2)); - kprintf ("SPSR=%X\t",inb(SPSR)); - kprintf ("KSR =%X\t",inb(KSR)); - kprintf ("ADSR=%X\t",inb(ADSR)); - kprintf ("CPTR=%X\t",inb(CPTR)); - kprintf ("SASR=%X\t",inb(SASR)); - kprintf ("ADR0=%X\t",inb(ADR0)); - kprintf ("ISR0=%X\t",inb(ISR0)); - kprintf ("ADR1=%X\t",inb(ADR1)); - kprintf ("BSR =%X\n",inb(BSR)); - - kprintf ("Turbo488\n"); - kprintf ("STS1=%X ",inb(STS1)); - kprintf ("STS2=%X ",inb(STS2)); - kprintf ("ISR3=%X ",inb(ISR3)); - kprintf ("CNT0=%X ",inb(CNT0)); - kprintf ("CNT1=%X ",inb(CNT1)); - kprintf ("CNT2=%X ",inb(CNT2)); - kprintf ("CNT3=%X ",inb(CNT3)); - kprintf ("IMR3=%X ",inb(IMR3)); - kprintf ("TIMER=%X\n",inb(TIMER)); - - - } -#endif -/*Set up the NAT4882 and TURBO488 registers */ -/*This will be nonsense to you unless you have a data sheet from - National Instruments. They should give you one if you call them*/ - -static int -initgpib(void) { - outb(CMDR,0x20); - outb(CFG,0x16); - outb(IMR3,0); - outb(CMDR,0x10); - outb(CNT0,0); - outb(CNT1,0); - outb(CNT2,0); - outb(CNT3,0); - outb(INTR,0); /* Put interrupt line in tri-state mode??*/ - outb(AUXMR,chip_reset); - - outb(IMR1,0x10); /* send interrupt to TURBO488 when END received*/ - outb(IMR2,0); - outb(IMR0,0x90); /* Do we want nba here too??? */ - outb(ADMR,1); - outb(ADR,0); - outb(ADR,128); - outb(AUXMR,0xE9); - outb(AUXMR,0x49); - outb(AUXMR,0x70); - outb(AUXMR,0xD0); - outb(AUXMR,0xA0); - - outb(EOSR,10); /*set EOS message to newline*/ - /*should I make the default to interpret END as EOS?*/ - /*It isn't now. The following changes this*/ - outb(AUXMR,0x80); /*No special EOS handling*/ - /*outb(AUXMR,0x88) */ /* Transmit END with EOS*/ - /*outb(AUXMR,0x84) */ /* Set END on EOS received*/ - /*outb(AUXMR,0x8C) */ /* Do both of the above*/ - - - /* outb(AUXMR,hldi); */ /*Perform RFD Holdoff for all data in*/ - /*Not currently supported*/ - - outb(AUXMR,pon); - outb(AUXMR,sic_rsc); - tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - - outb(AUXMR,sic_rsc_off); - -return(0); - - - } - -/*This is kind of Brute force.. But it works*/ - -static void -closegpib(void) -{ - outb(AUXMR,chip_reset); -} - -/*GPIB ROUTINES: - These will also make little sense unless you have a data sheet. - Note that the routines with an "m" in the beginning are for - accessing multiple devices in one call*/ - - -/*This is one thing I could not figure out how to do correctly. - I tried to use the auxilary command to enable remote, but it - never worked. Here, I bypass everything and write to the BSR - to enable the remote line. NOTE that these lines are effectively - "OR'ed" with the actual lines, so writing a 1 to the bit in the BSR - forces the GPIB line true, no matter what the fancy circuitry of the - NAT4882 wants to do with it*/ - -static void -enableremote(unsigned char device) -{ - int status; - -status=EWOULDBLOCK; - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - outb(BSR,1); /*Set REN bit on GPIB*/ - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb(CDOR,(device&31)+32); /*address device to listen*/ - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb (CDOR,63); /*Unaddress device*/ - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - } -/*This does not release the REM line on the gpib port, because if it did, - all the remote devices would go to local mode. This only sends the - gotolocal message to one device. Currently, REM is always held true - after enableremote is called, and is reset only on a close of the - gpib device */ - -static void -gotolocal(unsigned char device) -{ int status; - status=EWOULDBLOCK; - - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - -outb(CDOR,(device&31)+32); - - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - -outb(AUXMR,0x5E); /*Clear SYNC*/ - outb (CDOR,1); - - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - outb(AUXMR,0x5E); - outb (CDOR,63);/*unaddress device*/ - - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - } - - -static void -menableremote(unsigned char *device) -{ - int status, counter = 0; - -status=EWOULDBLOCK; - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - outb(BSR,1); /*Set REN bit on GPIB*/ - do - { - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb(CDOR,(device[counter]&31)+32); /*address device to listen*/ - counter++; - } - while (device[counter]<32); - - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - outb (CDOR,63); /*Unaddress device*/ - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - } - -static void -mgotolocal(unsigned char *device) -{ int status; - int counter=0; -status=EWOULDBLOCK; - if (device[counter]<32) do { - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb(CDOR,(device[counter]&31)+32); - counter++; - } while (device[counter]<32); - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - outb(AUXMR,0x5E); /*Clear SYNC*/ - outb (CDOR,1); - - - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb(AUXMR,0x5E); - outb (CDOR,63);/*unaddress device*/ - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",2); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - - } -/*Trigger a device. What happens depends on how the device is - configured. */ - -static void -trigger(unsigned char device) -{ int status; - -status=EWOULDBLOCK; - if (device<32) { - if (!(inb(ISR2)&0x08)) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb(CDOR,(device&31)+32); /*address device to listen*/ - if (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - outb (CDOR,8); /*send GET*/ - - if (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb (AUXMR,0x5E); - outb (CDOR,63);/*unaddress device*/ - if (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - - } -} - -/*Trigger multiple devices by addressing them all to listen, and then - sending GET*/ - -static void -mtrigger(unsigned char *device) -{ int status=EWOULDBLOCK; - int counter=0; - if(device[0]<32){ - do { - if (device[counter]<32) - if (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb(CDOR,(device[counter]&31)+32); /*address device to listen*/ - counter++; - } - while (device[counter]<32); - if (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb (CDOR,8); /*send GET*/ - - if (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - outb (AUXMR,0x5E); - outb (CDOR,63);/*unaddress device*/ - if (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR2)&0x08)&&status==EWOULDBLOCK); /*Wait to send next cmd*/ - - - } -} - -/*This is not used now, but it should work with NI's 8 bit gpib board - since it does not use the TURBO488 registers at all */ - - -/*Send data through the TURBO488 FIFOS to a device that is already - addressed to listen. This is used by the write call when someone is - writing to a printer or plotter, etc... */ -/*The last byte of each write is held off until either the next - write or close, so it can be sent with EOI set*/ - -static int -sendrawgpibfifo(unsigned char device,char *data,int count) - { - int status; - int counter; - int fifopos; - int sleeptime; - - - sleeptime=SLEEP_MIN; - counter=0; - - - fifopos=0; - -status=EWOULDBLOCK; - do { - /*Wait for fifo to become not full if it is full */ - sleeptime=SLEEP_MIN; - if (!(inb(ISR3)&0x08)) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",sleeptime); - if (sleeptime1)&&(inb(ISR3)&0x08)){ - outw(FIFOB,*(unsigned*)(data+counter)); - /* kprintf ("gpib: sent:%c,%c\n",data[counter],data[counter+1]);*/ - - counter+=2; - count-=2; - } - } - while ((count>1)&&(status==EWOULDBLOCK)); -/*The write routine and close routine must check if there is 1 - byte left and handle it accordingly*/ - - -/*Return the number of bytes written to the device*/ - return(counter); - - - -} - -static int -sendgpibfifo(unsigned char device,char *data,int count) - { - int status; - int counter; - int fifopos; - int sleeptime; - -outb(IMR2,0x30); /*we have to enable DMA (0x30) for turbo488 to work*/ - outb(CNT0,0); - outb(CNT1,0); - outb(CNT2,0); - outb(CNT3,0); -status=EWOULDBLOCK; - if (!(inb(ISR2)&8)) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - outb(CDOR,(device&31)+32);/*address device to listen*/ - - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - outb (CDOR,64); /*Address controller (me) to talk*/ - - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - outb(AUXMR,gts); /*Set to Standby (Controller)*/ - fifopos=0; - - sleeptime=SLEEP_MIN; - counter=0; - - - fifopos=0; - - outb(CMDR,0x20); - outb(CFG,0x47); /* 16 bit, write, fifo B first, TMOE TIM */ - outb(CMDR,0x10); /*RESET fifos*/ - outb(CCRG,seoi); /*program to send EOI at end*/ - outb(CMDR,0x04); /*Tell TURBO488 to GO*/ -status=EWOULDBLOCK; - do { - /*Wait for fifo to become not full if it is full */ - sleeptime=SLEEP_MIN; - if (!(inb(ISR3)&0x08)) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",sleeptime); - if (sleeptime1)&&(inb(ISR3)&0x08)){ - /*if(count==2) outb(CFG,15+0x40); *//*send eoi when done*/ - outw(FIFOB,*(unsigned*)(data+counter)); - - counter+=2; - count-=2; - } - } - while ((count>2)&&(status==EWOULDBLOCK)); - - if (count==2&&status==EWOULDBLOCK) { - /*Wait for fifo to become not full*/ - if(status==EWOULDBLOCK&&!(inb(ISR3)&0x08)) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",SLEEP_MIN); - } - while (!(inb(ISR3)&0x08)&&status==EWOULDBLOCK); /*Fifo is full*/ - /*outb(CFG,0x40+15);*//*send eoi when done*/ - outb(FIFOB,data[counter]); - counter++; - count--; - } - - - /*outb(CMDR,0x04);*/ - - /*Wait for fifo to become empty*/ - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while ((inb(ISR3)&0x04)&&status==EWOULDBLOCK); /*Fifo is not empty*/ - - outb(CMDR,0x08); /*Issue STOP to TURBO488*/ - - /*Wait for DONE and STOP*/ - if (status==EWOULDBLOCK) do { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while (!(inb(ISR3)&0x11)&&status==EWOULDBLOCK); /*not done and stop*/ - - outb(IMR2,0x00); /*we have to enable DMA (0x30) for turbo488 to work*/ - outb(CMDR,0x20); /*soft reset turbo488*/ - outb(CMDR,0x10); /*reset fifos*/ - - -/*Send last byte with EOI set*/ -/*Here EOI is handled correctly since the string to be sent */ -/*is actually all sent during the ioctl. (See above)*/ - -if (count==1&&status==EWOULDBLOCK) { /*Count should always=1 here*/ - -do - if (!(inb(ISR1)&2)) status=tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1); -while (!(inb(ISR1)&2)&&(status==EWOULDBLOCK)); - - outb(AUXMR,seoi); /*Set EOI for the last byte*/ - outb(AUXMR,0x5E); /*Clear SYNC*/ - outb(CDOR,data[counter]); - counter++; - count--; -} - -do - if (!(inb(ISR1)&2)) status=tsleep((caddr_t)&gpib_sc, GPIBPRI,"gpibpoll",1); -while (!(inb(ISR1)&2)&&(status==EWOULDBLOCK)); - - - if (!(inb(ISR1)&2)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR1)&2)&&status==EWOULDBLOCK); - outb(AUXMR,tca); /* Regain full control of the bus*/ - - - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - outb(CDOR,63); /*unlisten*/ - - - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - -outb(AUXMR,0x5E); /*Clear SYNC*/ - outb (CDOR,95);/*untalk*/ - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - - return(counter); - - - -} - -static int -readgpibfifo(unsigned char device,char *data,int count) -{ - int status; - int status2 = 0; - int status1; - int counter; - int fifopos; - unsigned inword; - - outb(IMR2,0x30); /*we have to enable DMA (0x30) for turbo488 to work*/ - /*outb(IMR3,0x1F); - outb(INTR,1); */ - outb(CMDR,0x20); - - outb(CFG,14+0x60+1); /* Halt on int,read, fifo B first, CCEN TMOE TIM */ - outb(CMDR,0x10); /*RESET fifos*/ - outb(CCRG,tcs); /*program to tcs at end*/ - outb(CMDR,0x08);/*STOP??*/ - - - -status=EWOULDBLOCK; -do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - outb (CDOR,32); /*Address controller (me) to listen*/ - - do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - outb(CDOR,(device&31)+64);/*address device to talk*/ - - - do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - outb(AUXMR,gts); /*Set to Standby (Controller)*/ - - counter=0; - fifopos=0; - - outb(CMDR,0x04); /*Tell TURBO488 to GO*/ - - - do { - status1=inb(ISR3); - if (!(status1&0x01)&&(status1&0x04)){ - status2=inb(STS2); - inword=inw(FIFOB); - *(unsigned*)(data+counter)=inword; - /* kprintf ("Read:%c,%c\n",data[counter],data[counter+1]);*/ - counter+=2; - } - else { - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",4); - } - } - while (!(status1&0x01)&&status==EWOULDBLOCK); - if(!(status2 & 0x04)){ /*Only 1 byte came in on last 16 bit transfer*/ - data[counter-1]=0; - counter--; } - else - data[counter]=0; - outb(CMDR,0x08); /*send STOP*/ - - do{ - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - } - while(!(inb(ISR3)&0x11)&&status==EWOULDBLOCK); /*wait for DONE and STOP*/ - outb(AUXMR,0x55); - - outb(IMR2,0x00); /*we have to enable DMA (0x30) for turbo488 to work*/ - outb(CMDR,0x20); /*soft reset turbo488*/ - outb(CMDR,0x10); /*reset fifos*/ - -/* do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR1)&2));*/ - outb(AUXMR,tca); /* Regain full control of the bus*/ - - - do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - outb(CDOR,63); /*unlisten*/ - - do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - -outb(AUXMR,0x5E); /*Clear SYNC*/ - outb (CDOR,95);/*untalk*/ - do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - return(counter); - - -} - - -/* Return the status byte from device */ -static char -spoll(unsigned char device) - { - int status=EWOULDBLOCK; - unsigned int statusbyte; - - if (!(inb(ISR2)&8)) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - outb(CDOR,(device&31)+64);/*address device to talk*/ - - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - outb (CDOR,32); /*Address controller (me) to listen*/ - - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - outb(AUXMR,0x5E); - outb (CDOR,0x18); /*Send SPE (serial poll enable)*/ - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - /*wait for bus to be synced*/ - if (!(inb(ISR0)&1)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR0)&1)&&status==EWOULDBLOCK); - - outb(AUXMR,gts); /*Set to Standby (Controller)*/ - - if (!(inb(ISR1)&1)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR1)&1)&&status==EWOULDBLOCK); - outb(AUXMR,0x5E); - outb(AUXMR,tcs); /* Take control after next read*/ - statusbyte=inb(DIR); - - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - outb(CDOR,0x19); /*SPD (serial poll disable)*/ - - /*wait for bus to be synced*/ - if (!(inb(ISR0)&1)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR0)&1)&&status==EWOULDBLOCK); - - - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - -outb(CDOR,95); /*untalk*/ - - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - outb(AUXMR,0x5E); - outb (CDOR,63);/*unlisten*/ - if (!(inb(ISR2)&8)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR2)&8)&&status==EWOULDBLOCK); - - /*wait for bus to be synced*/ - if (!(inb(ISR0)&1)&&status==EWOULDBLOCK) do - status=tsleep((caddr_t)&gpib_sc,GPIBPRI,"gpibpoll",1); - while (!(inb(ISR0)&1)&&status==EWOULDBLOCK); - - - return(statusbyte); - - -} diff --git a/sys/dev/misc/gpib/gpib.h b/sys/dev/misc/gpib/gpib.h deleted file mode 100644 index d66e1f4247..0000000000 --- a/sys/dev/misc/gpib/gpib.h +++ /dev/null @@ -1,28 +0,0 @@ -/* $FreeBSD: src/sys/i386/isa/gpib.h,v 1.3.10.1 2000/08/03 01:01:20 peter Exp $ */ -/* $DragonFly: src/sys/dev/misc/gpib/gpib.h,v 1.3 2006/10/23 21:50:31 dillon Exp $ */ - -#ifndef _DEV_MISC_GPIB_GPIB_H_ -#define _DEV_MISC_GPIB_GPIB_H_ - -#include - -/* gpib data structures */ -struct gpibdata { - char *data; /* data string for ins and outs */ - unsigned char address; /* gpib address */ - int *count; - } ; - -/* IOCTL commands */ -#define GPIBWRITE _IOW('g',1,struct gpibdata) -#define GPIBREAD _IOW('g',2,struct gpibdata) -#define GPIBINIT _IOW('g',3,struct gpibdata) -#define GPIBTRIGGER _IOW('g',4,struct gpibdata) -#define GPIBREMOTE _IOW('g',5,struct gpibdata) -#define GPIBLOCAL _IOW('g',6,struct gpibdata) -#define GPIBMTRIGGER _IOW('g',7,struct gpibdata) -#define GPIBMREMOTE _IOW('g',8,struct gpibdata) -#define GPIBMLOCAL _IOW('g',9,struct gpibdata) -#define GPIBSPOLL _IOW('g',10,struct gpibdata) - -#endif /* !_DEV_MISC_GPIB_GPIB_H_ */ diff --git a/sys/dev/misc/gpib/gpibreg.h b/sys/dev/misc/gpib/gpibreg.h deleted file mode 100644 index 63920a07b8..0000000000 --- a/sys/dev/misc/gpib/gpibreg.h +++ /dev/null @@ -1,89 +0,0 @@ -/* $FreeBSD: src/sys/i386/isa/gpibreg.h,v 1.3.10.1 2000/08/03 01:01:20 peter Exp $ */ -/* $DragonFly: src/sys/dev/misc/gpib/gpibreg.h,v 1.2 2003/06/17 04:28:37 dillon Exp $ */ - -static int gpib_port=0x2c0; -#define IEEE gpib_port - -/*NAT4882 Registers*/ - -#define DIR IEEE+0 -#define CDOR IEEE+0 -#define ISR1 IEEE+2 -#define IMR1 IEEE+2 -#define ISR2 IEEE+4 -#define IMR2 IEEE+4 -#define SPSR IEEE+6 -#define KSR IEEE+0x17 -#define KCR IEEE+0x17 -#define SPMR IEEE+6 -#define ADSR IEEE+8 -#define ADMR IEEE+8 -#define CPTR IEEE+0x0A -#define SASR IEEE+0x1B -#define AUXMR IEEE+0x0A -#define ADR0 IEEE+0x0c -#define ISR0 IEEE+0x1d -#define IMR0 IEEE+0x1d -#define ADR IEEE+0x0c -#define ADR1 IEEE+0x0e -#define BSR IEEE+0x1f -#define BCR IEEE+0x1f -#define EOSR IEEE+0x0e - - -/*Turbo 488 Registers*/ - -#define CNT2 IEEE+0x09 -#define CNT3 IEEE+0x0b -#define HSSEL IEEE+0x0d -#define STS1 IEEE+0x10 -#define CFG IEEE+0x10 -#define IMR3 IEEE+0x12 -#define CNT0 IEEE+0x14 -#define CNT1 IEEE+0x16 -#define FIFOB IEEE+0x18 -#define FIFOA IEEE+0x19 -#define ISR3 IEEE+0x1a -#define CCRG IEEE+0x1a -#define STS2 IEEE+0x1c -#define CMDR IEEE+0x1c -#define TIMER IEEE+0x1e -#define ACCWR IEEE+0x05 -#define INTR IEEE+0x07 - - - -#define pon 0 -#define chip_reset 2 -#define rhdf 3 -#define trig 4 -#define rtl_pulse 5 -#define rtl_off 5 -#define rtl_on 0x0d -#define seoi 6 -#define ist_off 1 -#define ist_on 9 -#define rlc 0x0a -#define rqc 8 -#define lut 0x0b -#define lul 0x0c -#define nbaf 0x0e -#define gts 0x10 -#define tca 0x11 -#define tcs 0x12 -#define tcse 0x1a -#define ltn 0x13 -#define ltn_cont 0x1b -#define lun 0x1c -#define rsc_off 0x14 -#define sic_rsc 0x1e -#define sic_rsc_off 0x16 -#define sre_rsc 0x1f -#define sre_rsc_off 0x17 -#define reqt 0x18 -#define reqf 0x19 -#define rppl 0x1d -#define hldi 0x51 - - - diff --git a/sys/dev/misc/labpc/labpc.c b/sys/dev/misc/labpc/labpc.c deleted file mode 100644 index f52849eb17..0000000000 --- a/sys/dev/misc/labpc/labpc.c +++ /dev/null @@ -1,1074 +0,0 @@ -/* - * Copyright (c) 1995 HD Associates, Inc. - * All rights reserved. - * - * HD Associates, Inc. - * PO Box 276 - * Pepperell, MA 01463-0276 - * dufault@hda.com - * - * 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 HD Associates, Inc. - * 4. The name of HD Associates, Inc. - * may not be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES ``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 REGENTS OR CONTRIBUTORS 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. - * - * Written by: - * Peter Dufault - * dufault@hda.com - * - * $FreeBSD: src/sys/i386/isa/labpc.c,v 1.35 1999/09/25 18:24:08 phk Exp $ - * - */ - -#include "use_labpc.h" -#include "opt_debug_outb.h" -#include - -#include - -#include -#include -#include -#define bio_actf bio_act.tqe_next -#include -#include -#include - -#ifdef LOUTB -#include -#endif - -#include - - - -/* Miniumum timeout: - */ -#ifndef LABPC_MIN_TMO -#define LABPC_MIN_TMO (hz) -#endif - -#ifndef LABPC_DEFAULT_HERTZ -#define LABPC_DEFAULT_HERTZ 500 -#endif - -/* Minor number: - * UUSIDCCC - * UU: Board unit. - * S: SCAN bit for scan enable. - * I: INTERVAL for interval support - * D: 1: Digital I/O, 0: Analog I/O - * CCC: Channel. - * Analog (D==0): - * input: channel must be 0 to 7. - * output: channel must be 0 to 2 - * 0: D-A 0 - * 1: D-A 1 - * 2: Alternate channel 0 then 1 - * - * Digital (D==1): - * input: Channel must be 0 to 2. - * output: Channel must be 0 to 2. - */ - -/* Up to four boards: - */ -#define MAX_UNITS 4 -#define UNIT(dev) (((minor(dev) & 0xB0) >> 6) & 0x3) - -#define SCAN(dev) ((minor(dev) & 0x20) >> 5) -#define INTERVAL(dev) ((minor(dev) & 0x10) >> 4) -#define DIGITAL(dev) ((minor(dev) & 0x08) >> 3) - -/* Eight channels: - */ - -#define CHAN(dev) (minor(dev) & 0x7) - -/* History: Derived from "dt2811.c" March 1995 - */ - -struct ctlr -{ - int err; -#define DROPPED_INPUT 0x100 - int base; - int unit; - unsigned long flags; -#define BUSY 0x00000001 - - u_char cr_image[4]; - - u_short sample_us; - - struct bio start_queue; /* Start queue */ - struct bio *last; /* End of start queue */ - int count; - u_char *data; - u_char *data_end; - long tmo; /* Timeout in Hertz */ - long min_tmo; /* Timeout in Hertz */ - int cleared_intr; - - int gains[8]; - - cdev_t dev; /* Copy of device */ - - void (*starter)(struct ctlr *ctlr, long count); - void (*stop)(struct ctlr *ctlr); - void (*intr)(struct ctlr *ctlr); - - /* Digital I/O support. Copy of Data Control Register for 8255: - */ - u_char dcr_val, dcr_is; - - /* - * Handle for canceling our timeout. - */ - struct callout ch; - - /* Device configuration structure: - */ -}; - -#ifdef LOUTB -/* loutb is a slow outb for debugging. The overrun test may fail - * with this for some slower processors. - */ -static void -loutb(int port, u_char val) -{ - outb(port, val); - DELAY(1); -} -#else -#define loutb(port, val) outb(port, val) -#endif - -static struct ctlr **labpcs; /* XXX: Should be dynamic */ - -/* CR_EXPR: A macro that sets the shadow register in addition to - * sending out the data. - */ -#define CR_EXPR(LABPC, CR, EXPR) do { \ - (LABPC)->cr_image[CR - 1] EXPR ; \ - loutb(((LABPC)->base + ( (CR == 4) ? (0x0F) : (CR - 1))), ((LABPC)->cr_image[(CR - 1)])); \ -} while (0) - -#define CR_CLR(LABPC, CR) CR_EXPR(LABPC, CR, &=0) -#define CR_REFRESH(LABPC, CR) CR_EXPR(LABPC, CR, &=0xff) -#define CR_SET(LABPC, CR, EXPR) CR_EXPR(LABPC, CR, = EXPR) - -/* Configuration and Status Register Group. - */ -#define CR1(LABPC) ((LABPC)->base + 0x00) /* Page 4-5 */ - #define SCANEN 0x80 - #define GAINMASK 0x70 - #define GAIN(LABPC, SEL) do { \ - (LABPC)->cr_image[1 - 1] &= ~GAINMASK; \ - (LABPC)->cr_image[1 - 1] |= (SEL << 4); \ - loutb((LABPC)->base + (1 - 1), (LABPC)->cr_image[(1 - 1)]); \ - } while (0) - - #define TWOSCMP 0x08 - #define MAMASK 0x07 - #define MA(LABPC, SEL) do { \ - (LABPC)->cr_image[1 - 1] &= ~MAMASK; \ - (LABPC)->cr_image[1 - 1] |= SEL; \ - loutb((LABPC)->base + (1 - 1), (LABPC)->cr_image[(1 - 1)]); \ - } while (0) - -#define STATUS(LABPC) ((LABPC)->base + 0x00) /* Page 4-7 */ - #define LABPCPLUS 0x80 - #define EXTGATA0 0x40 - #define GATA0 0x20 - #define DMATC 0x10 - #define CNTINT 0x08 - #define OVERFLOW 0x04 - #define OVERRUN 0x02 - #define DAVAIL 0x01 - -#define CR2(LABPC) ((LABPC)->base + 0x01) /* Page 4-9 */ - #define LDAC1 0x80 - #define LDAC0 0x40 - #define _2SDAC1 0x20 - #define _2SDAC0 0x10 - #define TBSEL 0x08 - #define SWTRIG 0x04 - #define HWTRIG 0x02 - #define PRETRIG 0x01 - #define SWTRIGGERRED(LABPC) ((LABPC->cr_image[1]) & SWTRIG) - -#define CR3(LABPC) ((LABPC)->base + 0x02) /* Page 4-11 */ - #define FIFOINTEN 0x20 - #define ERRINTEN 0x10 - #define CNTINTEN 0x08 - #define TCINTEN 0x04 - #define DIOINTEN 0x02 - #define DMAEN 0x01 - - #define ALLINTEN 0x3E - #define FIFOINTENABLED(LABPC) ((LABPC->cr_image[2]) & FIFOINTEN) - -#define CR4(LABPC) ((LABPC)->base + 0x0F) /* Page 4-13 */ - #define ECLKRCV 0x10 - #define SE_D 0x08 - #define ECKDRV 0x04 - #define EOIRCV 0x02 - #define INTSCAN 0x01 - -/* Analog Input Register Group - */ -#define ADFIFO(LABPC) ((LABPC)->base + 0x0A) /* Page 4-16 */ -#define ADCLEAR(LABPC) ((LABPC)->base + 0x08) /* Page 4-18 */ -#define ADSTART(LABPC) ((LABPC)->base + 0x03) /* Page 4-19 */ -#define DMATCICLR(LABPC) ((LABPC)->base + 0x0A) /* Page 4-20 */ - -/* Analog Output Register Group - */ -#define DAC0L(LABPC) ((LABPC)->base + 0x04) /* Page 4-22 */ -#define DAC0H(LABPC) ((LABPC)->base + 0x05) /* Page 4-22 */ -#define DAC1L(LABPC) ((LABPC)->base + 0x06) /* Page 4-22 */ -#define DAC1H(LABPC) ((LABPC)->base + 0x07) /* Page 4-22 */ - -/* 8253 registers: - */ -#define A0DATA(LABPC) ((LABPC)->base + 0x14) -#define A1DATA(LABPC) ((LABPC)->base + 0x15) -#define A2DATA(LABPC) ((LABPC)->base + 0x16) -#define AMODE(LABPC) ((LABPC)->base + 0x17) - -#define TICR(LABPC) ((LABPC)->base + 0x0c) - -#define B0DATA(LABPC) ((LABPC)->base + 0x18) -#define B1DATA(LABPC) ((LABPC)->base + 0x19) -#define B2DATA(LABPC) ((LABPC)->base + 0x1A) -#define BMODE(LABPC) ((LABPC)->base + 0x1B) - -/* 8255 registers: - */ - -#define PORTX(LABPC, X) ((LABPC)->base + 0x10 + X) - -#define PORTA(LABPC) PORTX(LABPC, 0) -#define PORTB(LABPC) PORTX(LABPC, 1) -#define PORTC(LABPC) PORTX(LABPC, 2) - -#define DCR(LABPC) ((LABPC)->base + 0x13) - -static int labpcattach(struct isa_device *dev); -static int labpcprobe(struct isa_device *dev); -struct isa_driver labpcdriver = - { labpcprobe, labpcattach, "labpc", 0 }; - -static d_open_t labpcopen; -static d_close_t labpcclose; -static d_ioctl_t labpcioctl; -static d_strategy_t labpcstrategy; - -static struct dev_ops labpc_ops = { - { "labpc", 0, 0 }, - .d_open = labpcopen, - .d_close = labpcclose, - .d_read = physread, - .d_write = physwrite, - .d_ioctl = labpcioctl, - .d_strategy = labpcstrategy, -}; - -static void labpcintr(void *); -static void start(struct ctlr *ctlr); - -static void -bp_done(struct bio *bio, int err) -{ - struct buf *bp = bio->bio_buf; - - if (err || bp->b_resid) - bp->b_flags |= B_ERROR; - biodone(bio); -} - -static void tmo_stop(void *p); - -static void -done_and_start_next(struct ctlr *ctlr, struct bio *bio, int err) -{ - struct buf *bp = bio->bio_buf; - - bp->b_resid = ctlr->data_end - ctlr->data; - - ctlr->data = 0; - - ctlr->start_queue.bio_actf = bio->bio_actf; - bp_done(bio, err); - - callout_stop(&ctlr->ch); - - start(ctlr); -} - -static void -ad_clear(struct ctlr *ctlr) -{ - int i; - loutb(ADCLEAR(ctlr), 0); - for (i = 0; i < 10000 && (inb(STATUS(ctlr)) & GATA0); i++) - ; - (void)inb(ADFIFO(ctlr)); - (void)inb(ADFIFO(ctlr)); -} - -/* reset: Reset the board following the sequence on page 5-1 - */ -static void -reset(struct ctlr *ctlr) -{ - crit_enter(); - CR_CLR(ctlr, 3); /* Turn off interrupts first */ - crit_exit(); - - CR_CLR(ctlr, 1); - CR_CLR(ctlr, 2); - CR_CLR(ctlr, 4); - - loutb(AMODE(ctlr), 0x34); - loutb(A0DATA(ctlr),0x0A); - loutb(A0DATA(ctlr),0x00); - - loutb(DMATCICLR(ctlr), 0x00); - loutb(TICR(ctlr), 0x00); - - ad_clear(ctlr); - - loutb(DAC0L(ctlr), 0); - loutb(DAC0H(ctlr), 0); - loutb(DAC1L(ctlr), 0); - loutb(DAC1H(ctlr), 0); - - ad_clear(ctlr); -} - -/* overrun: slam the start convert register and OVERRUN should get set: - */ -static u_char -overrun(struct ctlr *ctlr) -{ - int i; - - u_char status = inb(STATUS(ctlr)); - for (i = 0; ((status & OVERRUN) == 0) && i < 100; i++) - { - loutb(ADSTART(ctlr), 1); - status = inb(STATUS(ctlr)); - } - - return status; -} - -static int -labpcinit(void) -{ - if (NLABPC > MAX_UNITS) - return 0; - - labpcs = kmalloc(NLABPC * sizeof(struct ctlr *), M_DEVBUF, - M_WAITOK | M_ZERO); - return 1; -} - -static int -labpcprobe(struct isa_device *dev) -{ - static int unit; - struct ctlr scratch, *ctlr, *l; - u_char status; - - if (!labpcs) - { - if (labpcinit() == 0) - { - kprintf("labpcprobe: init failed\n"); - return 0; - } - } - - if (unit > NLABPC) - { - kprintf("Too many LAB-PCs. Reconfigure O/S.\n"); - return 0; - } - ctlr = &scratch; /* Need somebody with the right base for the macros */ - ctlr->base = dev->id_iobase; - - /* XXX: There really isn't a perfect way to probe this board. - * Here is my best attempt: - */ - reset(ctlr); - - /* After reset none of these bits should be set: - */ - status = inb(STATUS(ctlr)); - if (status & (GATA0 | OVERFLOW | DAVAIL | OVERRUN)) - return 0; - - /* Now try to overrun the board FIFO and get the overrun bit set: - */ - status = overrun(ctlr); - - if ((status & OVERRUN) == 0) /* No overrun bit set? */ - return 0; - - /* Assume we have a board. - */ - reset(ctlr); - - l = kmalloc(sizeof(struct ctlr), M_DEVBUF, M_WAITOK | M_ZERO); - l->base = ctlr->base; - l->unit = unit; - labpcs[unit] = l; - dev->id_unit = l->unit; - - unit++; - return 0x20; -} - -/* attach: Set things in a normal state. - */ -static int -labpcattach(struct isa_device *dev) -{ - struct ctlr *ctlr = labpcs[dev->id_unit]; - - dev->id_intr = (inthand2_t *)labpcintr; - callout_init(&ctlr->ch); - ctlr->sample_us = (1000000.0 / (double)LABPC_DEFAULT_HERTZ) + .50; - reset(ctlr); - - ctlr->min_tmo = LABPC_MIN_TMO; - - ctlr->dcr_val = 0x80; - ctlr->dcr_is = 0x80; - loutb(DCR(ctlr), ctlr->dcr_val); - - make_dev(&labpc_ops, dev->id_unit, 0, 0, 0600, - "labpc%d", dev->id_unit); - return 1; -} - -/* Null handlers: - */ -static void null_intr (struct ctlr *ctlr) { } -static void null_start(struct ctlr *ctlr, long count) { } -static void null_stop (struct ctlr *ctlr) { } - -static void -trigger(struct ctlr *ctlr) -{ - CR_EXPR(ctlr, 2, |= SWTRIG); -} - -static void -ad_start(struct ctlr *ctlr, long count) -{ - if (!SWTRIGGERRED(ctlr)) { - int chan = CHAN(ctlr->dev); - CR_EXPR(ctlr, 1, &= ~SCANEN); - CR_EXPR(ctlr, 2, &= ~TBSEL); - - MA(ctlr, chan); - GAIN(ctlr, ctlr->gains[chan]); - - if (SCAN(ctlr->dev)) - CR_EXPR(ctlr, 1, |= SCANEN); - - loutb(AMODE(ctlr), 0x34); - loutb(A0DATA(ctlr), (u_char)((ctlr->sample_us & 0xff))); - loutb(A0DATA(ctlr), (u_char)((ctlr->sample_us >> 8)&0xff)); - loutb(AMODE(ctlr), 0x70); - - ad_clear(ctlr); - trigger(ctlr); - } - - ctlr->tmo = ((count + 16) * (long)ctlr->sample_us * hz) / 1000000 + - ctlr->min_tmo; -} - -static void -ad_interval_start(struct ctlr *ctlr, long count) -{ - int chan = CHAN(ctlr->dev); - int n_frames = count / (chan + 1); - - if (!SWTRIGGERRED(ctlr)) { - CR_EXPR(ctlr, 1, &= ~SCANEN); - CR_EXPR(ctlr, 2, &= ~TBSEL); - - MA(ctlr, chan); - GAIN(ctlr, ctlr->gains[chan]); - - /* XXX: Is it really possible that you clear INTSCAN as - * the documentation says? That seems pretty unlikely. - */ - CR_EXPR(ctlr, 4, &= ~INTSCAN); /* XXX: Is this possible? */ - - /* Program the sample interval counter to run as fast as - * possible. - */ - loutb(AMODE(ctlr), 0x34); - loutb(A0DATA(ctlr), (u_char)(0x02)); - loutb(A0DATA(ctlr), (u_char)(0x00)); - loutb(AMODE(ctlr), 0x70); - - /* Program the interval scanning counter to run at the sample - * frequency. - */ - loutb(BMODE(ctlr), 0x74); - loutb(B1DATA(ctlr), (u_char)((ctlr->sample_us & 0xff))); - loutb(B1DATA(ctlr), (u_char)((ctlr->sample_us >> 8)&0xff)); - CR_EXPR(ctlr, 1, |= SCANEN); - - ad_clear(ctlr); - trigger(ctlr); - } - - /* Each frame time takes two microseconds per channel times - * the number of channels being sampled plus the sample period. - */ - ctlr->tmo = ((n_frames + 16) * - ((long)ctlr->sample_us + (chan + 1 ) * 2 ) * hz) / 1000000 + - ctlr->min_tmo; -} - -static void -all_stop(struct ctlr *ctlr) -{ - reset(ctlr); -} - -static void -tmo_stop(void *p) -{ - struct ctlr *ctlr = (struct ctlr *)p; - struct bio *bio; - - crit_enter(); - - if (ctlr == 0) - { - kprintf("labpc?: Null ctlr struct?\n"); - crit_exit(); - return; - } - - kprintf("labpc%d: timeout", ctlr->unit); - - (*ctlr->stop)(ctlr); - - bio = ctlr->start_queue.bio_actf; - - if (bio == NULL) { - kprintf(", Null bp.\n"); - crit_exit(); - return; - } - - kprintf("\n"); - - done_and_start_next(ctlr, bio, ETIMEDOUT); - - crit_exit(); -} - -static void ad_intr(struct ctlr *ctlr) -{ - u_char status; - - if (ctlr->cr_image[2] == 0) - { - if (ctlr->cleared_intr) - { - ctlr->cleared_intr = 0; - return; - } - - kprintf("ad_intr (should not happen) interrupt with interrupts off\n"); - kprintf("status %x, cr3 %x\n", inb(STATUS(ctlr)), ctlr->cr_image[2]); - return; - } - - while ( (status = (inb(STATUS(ctlr)) & (DAVAIL|OVERRUN|OVERFLOW)) ) ) - { - if ((status & (OVERRUN|OVERFLOW))) - { - struct bio *bio = ctlr->start_queue.bio_actf; - - kprintf("ad_intr: error: bp %p, data %p, status %x", - bio->bio_buf, ctlr->data, status); - - if (status & OVERRUN) - kprintf(" Conversion overrun (multiple A-D trigger)"); - - if (status & OVERFLOW) - kprintf(" FIFO overflow"); - - kprintf("\n"); - - if (bio) { - done_and_start_next(ctlr, bio, EIO); - return; - } else { - kprintf("ad_intr: (should not happen) error between records\n"); - ctlr->err = status; /* Set overrun condition */ - return; - } - } - else /* FIFO interrupt */ - { - struct bio *bio = ctlr->start_queue.bio_actf; - - if (ctlr->data) { - *ctlr->data++ = inb(ADFIFO(ctlr)); - if (ctlr->data == ctlr->data_end) { - /* Normal completion */ - done_and_start_next(ctlr, bio, 0); - return; - } - } else { - /* Interrupt with no where to put the data. */ - kprintf("ad_intr: (should not happen) dropped input.\n"); - (void)inb(ADFIFO(ctlr)); - - kprintf("bp %p, status %x, cr3 %x\n", - bio->bio_buf, status, ctlr->cr_image[2]); - ctlr->err = DROPPED_INPUT; - return; - } - } - } -} - -static void -labpcintr(void *arg) -{ - int unit = (int)arg; - struct ctlr *ctlr = labpcs[unit]; - (*ctlr->intr)(ctlr); -} - -/* lockout_multiple_opens: Return whether or not we can open again, or - * if the new mode is inconsistent with an already opened mode. - * We only permit multiple opens for digital I/O now. - */ - -static int -lockout_multiple_open(cdev_t current, cdev_t next) -{ - return ! (DIGITAL(current) && DIGITAL(next)); -} - -static int -labpcopen(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - u_short unit = UNIT(dev); - - struct ctlr *ctlr; - - if (unit >= MAX_UNITS) - return ENXIO; - - ctlr = labpcs[unit]; - - if (ctlr == 0) - return ENXIO; - - /* Don't allow another open if we have to change modes. - */ - - if ( (ctlr->flags & BUSY) == 0) - { - ctlr->flags |= BUSY; - - reset(ctlr); - - ctlr->err = 0; - ctlr->dev = dev; - - ctlr->intr = null_intr; - ctlr->starter = null_start; - ctlr->stop = null_stop; - } - else if (lockout_multiple_open(ctlr->dev, dev)) - return EBUSY; - - return 0; -} - -static int -labpcclose(struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct ctlr *ctlr = labpcs[UNIT(dev)]; - - (*ctlr->stop)(ctlr); - - ctlr->flags &= ~BUSY; - - return 0; -} - -/* - * Start: Start a frame going in or out. - */ -static void -start(struct ctlr *ctlr) -{ - struct bio *bio; - struct buf *bp; - - if ((bio = ctlr->start_queue.bio_actf) == NULL) { - /* We must turn off FIFO interrupts when there is no - * place to put the data. We have to get back to - * reading before the FIFO overflows. - */ - CR_EXPR(ctlr, 3, &= ~(FIFOINTEN|ERRINTEN)); - ctlr->cleared_intr = 1; - ctlr->count = 0; - return; - } - bp = bio->bio_buf; - - ctlr->data = (u_char *)bp->b_data; - ctlr->data_end = ctlr->data + bp->b_bcount; - - if (ctlr->err) - { - kprintf("labpc start: (should not happen) error between records.\n"); - done_and_start_next(ctlr, bio, EIO); - return; - } - - if (ctlr->data == 0) - { - kprintf("labpc start: (should not happen) NULL data pointer.\n"); - done_and_start_next(ctlr, bio, EIO); - return; - } - - (*ctlr->starter)(ctlr, bp->b_bcount); - - if (!FIFOINTENABLED(ctlr)) /* We can store the data again */ - { - CR_EXPR(ctlr, 3, |= (FIFOINTEN|ERRINTEN)); - - /* Don't wait for the interrupts to fill things up. - */ - (*ctlr->intr)(ctlr); - } - - callout_reset(&ctlr->ch, ctlr->tmo, tmo_stop, ctlr); -} - -static void -ad_strategy(struct bio *bio, struct ctlr *ctlr) -{ - crit_enter(); - bio->bio_actf = NULL; - - if (ctlr->count) { - ctlr->last->bio_actf = bio; - ctlr->last = bio; - } else { - ctlr->count = 1; - ctlr->start_queue.bio_actf = bio; - ctlr->last = bio; - start(ctlr); - } - crit_exit(); -} - -/* da_strategy: Send data to the D-A. The CHAN field should be - * 0: D-A port 0 - * 1: D-A port 1 - * 2: Alternate port 0 then port 1 - * - * XXX: - * - * 1. There is no state for CHAN field 2: - * the first sample in each buffer goes to channel 0. - * - * 2. No interrupt support yet. - */ -static void -da_strategy(struct bio *bio, struct ctlr *ctlr) -{ - struct buf *bp = bio->bio_buf; - cdev_t dev = bio->bio_driver_info; - int len; - u_char *data; - int port; - int i; - - switch(CHAN(dev)) - { - case 0: - port = DAC0L(ctlr); - break; - - case 1: - port = DAC1L(ctlr); - break; - - case 2: /* Device 2 handles both ports interleaved. */ - if (bp->b_bcount <= 2) - { - port = DAC0L(ctlr); - break; - } - - len = bp->b_bcount / 2; - data = (u_char *)bp->b_data; - - for (i = 0; i < len; i++) - { - loutb(DAC0H(ctlr), *data++); - loutb(DAC0L(ctlr), *data++); - loutb(DAC1H(ctlr), *data++); - loutb(DAC1L(ctlr), *data++); - } - - bp->b_resid = bp->b_bcount & 3; - bp_done(bio, 0); - return; - - default: - bp_done(bio, ENXIO); - return; - } - - /* Port 0 or 1 falls through to here. - */ - if (bp->b_bcount & 1) /* Odd transfers are illegal */ - bp_done(bio, EIO); - - len = bp->b_bcount; - data = (u_char *)bp->b_data; - - for (i = 0; i < len; i++) - { - loutb(port + 1, *data++); - loutb(port, *data++); - } - - bp->b_resid = 0; - - bp_done(bio, 0); -} - -/* Input masks for MODE 0 of the ports treating PC as a single - * 8 bit port. Set these bits to set the port to input. - */ - /* A B lowc highc combined */ -static u_char set_input[] = { 0x10, 0x02, 0x01, 0x08, 0x09 }; - -static void flush_dcr(struct ctlr *ctlr) -{ - if (ctlr->dcr_is != ctlr->dcr_val) - { - loutb(DCR(ctlr), ctlr->dcr_val); - ctlr->dcr_is = ctlr->dcr_val; - } -} - -/* do: Digital output - */ -static void -digital_out_strategy(struct bio *bio, struct ctlr *ctlr) -{ - struct buf *bp = bio->bio_buf; - cdev_t dev = bio->bio_driver_info; - int len; - u_char *data; - int port; - int i; - int chan = CHAN(dev); - - ctlr->dcr_val &= ~set_input[chan]; /* Digital out: Clear bit */ - flush_dcr(ctlr); - - port = PORTX(ctlr, chan); - - len = bp->b_bcount; - data = (u_char *)bp->b_data; - - for (i = 0; i < len; i++) - { - loutb(port, *data++); - } - - bp->b_resid = 0; - - bp_done(bio, 0); -} - -/* digital_in_strategy: Digital input - */ -static void -digital_in_strategy(struct bio *bio, struct ctlr *ctlr) -{ - struct buf *bp = bio->bio_buf; - cdev_t dev = bio->bio_driver_info; - int len; - u_char *data; - int port; - int i; - int chan = CHAN(dev); - - ctlr->dcr_val |= set_input[chan]; /* Digital in: Set bit */ - flush_dcr(ctlr); - port = PORTX(ctlr, chan); - - len = bp->b_bcount; - data = (u_char *)bp->b_data; - - for (i = 0; i < len; i++) - { - *data++ = inb(port); - } - - bp->b_resid = 0; - - bp_done(bio, 0); -} - - -static int -labpcstrategy(struct dev_strategy_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct bio *bio = ap->a_bio; - struct buf *bp = bio->bio_buf; - struct ctlr *ctlr = labpcs[UNIT(dev)]; - - bio->bio_driver_info = dev; - - if (DIGITAL(dev)) { - if (bp->b_cmd == BUF_CMD_READ) { - ctlr->starter = null_start; - ctlr->stop = all_stop; - ctlr->intr = null_intr; - digital_in_strategy(bio, ctlr); - } - else - { - ctlr->starter = null_start; - ctlr->stop = all_stop; - ctlr->intr = null_intr; - digital_out_strategy(bio, ctlr); - } - } - else { - if (bp->b_cmd == BUF_CMD_READ) { - - ctlr->starter = INTERVAL(ctlr->dev) ? ad_interval_start : ad_start; - ctlr->stop = all_stop; - ctlr->intr = ad_intr; - ad_strategy(bio, ctlr); - } - else - { - ctlr->starter = null_start; - ctlr->stop = all_stop; - ctlr->intr = null_intr; - da_strategy(bio, ctlr); - } - } - return(0); -} - -static int -labpcioctl(struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - caddr_t arg = ap->a_data; - struct ctlr *ctlr = labpcs[UNIT(dev)]; - - switch(ap->a_cmd) - { - case AD_MICRO_PERIOD_SET: - { - /* XXX I'm only supporting what I have to, which is - * no slow periods. You can't get any slower than 15 Hz - * with the current setup. To go slower you'll need to - * support TCINTEN in CR3. - */ - - long sample_us = *(long *)arg; - - if (sample_us > 65535) - return EIO; - - ctlr->sample_us = sample_us; - return 0; - } - - case AD_MICRO_PERIOD_GET: - *(long *)arg = ctlr->sample_us; - return 0; - - case AD_NGAINS_GET: - *(int *)arg = 8; - return 0; - - case AD_NCHANS_GET: - *(int *)arg = 8; - return 0; - - case AD_SUPPORTED_GAINS: - { - static double gains[] = {1., 1.25, 2., 5., 10., 20., 50., 100.}; - copyout(gains, *(caddr_t *)arg, sizeof(gains)); - - return 0; - } - - case AD_GAINS_SET: - { - copyin(*(caddr_t *)arg, ctlr->gains, sizeof(ctlr->gains)); - return 0; - } - - case AD_GAINS_GET: - { - copyout(ctlr->gains, *(caddr_t *)arg, sizeof(ctlr->gains)); - return 0; - } - - default: - return ENOTTY; - } -} diff --git a/sys/dev/misc/mse/mse.c b/sys/dev/misc/mse/mse.c deleted file mode 100644 index 61bcc5ea50..0000000000 --- a/sys/dev/misc/mse/mse.c +++ /dev/null @@ -1,896 +0,0 @@ -/* - * Copyright 1992 by the University of Guelph - * - * Permission to use, copy and modify this - * software and its documentation for any purpose and without - * fee is hereby granted, provided that the above copyright - * notice appear in all copies and that both that copyright - * notice and this permission notice appear in supporting - * documentation. - * University of Guelph makes no representations about the suitability of - * this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * $FreeBSD: src/sys/i386/isa/mse.c,v 1.49.2.1 2000/03/20 13:58:47 yokota Exp $ - */ -/* - * Driver for the Logitech and ATI Inport Bus mice for use with 386bsd and - * the X386 port, courtesy of - * Rick Macklem, rick@snowhite.cis.uoguelph.ca - * Caveats: The driver currently uses spltty(), but doesn't use any - * generic tty code. It could use splmse() (that only masks off the - * bus mouse interrupt, but that would require hacking in i386/isa/icu.s. - * (This may be worth the effort, since the Logitech generates 30/60 - * interrupts/sec continuously while it is open.) - * NB: The ATI has NOT been tested yet! - */ - -/* - * Modification history: - * Sep 6, 1994 -- Lars Fredriksen(fredriks@mcs.com) - * improved probe based on input from Logitech. - * - * Oct 19, 1992 -- E. Stark (stark@cs.sunysb.edu) - * fixes to make it work with Microsoft InPort busmouse - * - * Jan, 1993 -- E. Stark (stark@cs.sunysb.edu) - * added patches for new "select" interface - * - * May 4, 1993 -- E. Stark (stark@cs.sunysb.edu) - * changed position of some spl()'s in mseread - * - * October 8, 1993 -- E. Stark (stark@cs.sunysb.edu) - * limit maximum negative x/y value to -127 to work around XFree problem - * that causes spurious button pushes. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include - -/* driver configuration flags (config) */ -#define MSE_CONFIG_ACCEL 0x00f0 /* acceleration factor */ -#define MSE_CONFIG_FLAGS (MSE_CONFIG_ACCEL) - -/* - * Software control structure for mouse. The sc_enablemouse(), - * sc_disablemouse() and sc_getmouse() routines must be called spl'd(). - */ -typedef struct mse_softc { - int sc_flags; - int sc_mousetype; - struct kqinfo sc_kqp; - struct resource *sc_port; - struct resource *sc_intr; - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - void *sc_ih; - void (*sc_enablemouse) (bus_space_tag_t t, - bus_space_handle_t h); - void (*sc_disablemouse) (bus_space_tag_t t, - bus_space_handle_t h); - void (*sc_getmouse) (bus_space_tag_t t, - bus_space_handle_t h, - int *dx, int *dy, int *but); - int sc_deltax; - int sc_deltay; - int sc_obuttons; - int sc_buttons; - int sc_bytesread; - u_char sc_bytes[MOUSE_SYS_PACKETSIZE]; - struct callout sc_callout; - int sc_watchdog; - mousehw_t hw; - mousemode_t mode; - mousestatus_t status; -} mse_softc_t; - -static devclass_t mse_devclass; - -static int mse_probe (device_t dev); -static int mse_attach (device_t dev); -static int mse_detach (device_t dev); - -static device_method_t mse_methods[] = { - DEVMETHOD(device_probe, mse_probe), - DEVMETHOD(device_attach, mse_attach), - DEVMETHOD(device_detach, mse_detach), - { 0, 0 } -}; - -static driver_t mse_driver = { - "mse", - mse_methods, - sizeof(mse_softc_t), -}; - -DRIVER_MODULE(mse, isa, mse_driver, mse_devclass, NULL, NULL); - -static struct isa_pnp_id mse_ids[] = { - { 0x000fd041, "Bus mouse" }, /* PNP0F00 */ - { 0x020fd041, "InPort mouse" }, /* PNP0F02 */ - { 0x0d0fd041, "InPort mouse compatible" }, /* PNP0F0D */ - { 0x110fd041, "Bus mouse compatible" }, /* PNP0F11 */ - { 0x150fd041, "Logitech bus mouse" }, /* PNP0F15 */ - { 0x180fd041, "Logitech bus mouse compatible" },/* PNP0F18 */ - { 0 } -}; - -static d_open_t mseopen; -static d_close_t mseclose; -static d_read_t mseread; -static d_ioctl_t mseioctl; -static d_kqfilter_t msekqfilter; - -static void msefilter_detach(struct knote *); -static int msefilter(struct knote *, long); - -static struct dev_ops mse_ops = { - { "mse", 0, 0 }, - .d_open = mseopen, - .d_close = mseclose, - .d_read = mseread, - .d_ioctl = mseioctl, - .d_kqfilter = msekqfilter -}; - -static void mseintr (void *); -static timeout_t msetimeout; - -/* Flags */ -#define MSESC_OPEN 0x1 -#define MSESC_WANT 0x2 - -/* and Mouse Types */ -#define MSE_NONE 0 /* don't move this! */ -#define MSE_LOGITECH 0x1 -#define MSE_ATIINPORT 0x2 -#define MSE_LOGI_SIG 0xA5 - -#define MSE_PORTA 0 -#define MSE_PORTB 1 -#define MSE_PORTC 2 -#define MSE_PORTD 3 -#define MSE_IOSIZE 4 - -#define MSE_UNIT(dev) (minor(dev) >> 1) -#define MSE_NBLOCKIO(dev) (minor(dev) & 0x1) - -/* - * Logitech bus mouse definitions - */ -#define MSE_SETUP 0x91 /* What does this mean? */ - /* The definition for the control port */ - /* is as follows: */ - - /* D7 = Mode set flag (1 = active) */ - /* D6,D5 = Mode selection (port A) */ - /* 00 = Mode 0 = Basic I/O */ - /* 01 = Mode 1 = Strobed I/O */ - /* 10 = Mode 2 = Bi-dir bus */ - /* D4 = Port A direction (1 = input)*/ - /* D3 = Port C (upper 4 bits) */ - /* direction. (1 = input) */ - /* D2 = Mode selection (port B & C) */ - /* 0 = Mode 0 = Basic I/O */ - /* 1 = Mode 1 = Strobed I/O */ - /* D1 = Port B direction (1 = input)*/ - /* D0 = Port C (lower 4 bits) */ - /* direction. (1 = input) */ - - /* So 91 means Basic I/O on all 3 ports,*/ - /* Port A is an input port, B is an */ - /* output port, C is split with upper */ - /* 4 bits being an output port and lower*/ - /* 4 bits an input port, and enable the */ - /* sucker. */ - /* Courtesy Intel 8255 databook. Lars */ -#define MSE_HOLD 0x80 -#define MSE_RXLOW 0x00 -#define MSE_RXHIGH 0x20 -#define MSE_RYLOW 0x40 -#define MSE_RYHIGH 0x60 -#define MSE_DISINTR 0x10 -#define MSE_INTREN 0x00 - -static int mse_probelogi (device_t dev, mse_softc_t *sc); -static void mse_disablelogi (bus_space_tag_t t, - bus_space_handle_t h); -static void mse_getlogi (bus_space_tag_t t, - bus_space_handle_t h, - int *dx, int *dy, int *but); -static void mse_enablelogi (bus_space_tag_t t, - bus_space_handle_t h); - -/* - * ATI Inport mouse definitions - */ -#define MSE_INPORT_RESET 0x80 -#define MSE_INPORT_STATUS 0x00 -#define MSE_INPORT_DX 0x01 -#define MSE_INPORT_DY 0x02 -#define MSE_INPORT_MODE 0x07 -#define MSE_INPORT_HOLD 0x20 -#define MSE_INPORT_INTREN 0x09 - -static int mse_probeati (device_t dev, mse_softc_t *sc); -static void mse_enableati (bus_space_tag_t t, - bus_space_handle_t h); -static void mse_disableati (bus_space_tag_t t, - bus_space_handle_t h); -static void mse_getati (bus_space_tag_t t, - bus_space_handle_t h, - int *dx, int *dy, int *but); - -/* - * Table of mouse types. - * Keep the Logitech last, since I haven't figured out how to probe it - * properly yet. (Someday I'll have the documentation.) - */ -static struct mse_types { - int m_type; /* Type of bus mouse */ - int (*m_probe) (device_t dev, mse_softc_t *sc); - /* Probe routine to test for it */ - void (*m_enable) (bus_space_tag_t t, bus_space_handle_t h); - /* Start routine */ - void (*m_disable) (bus_space_tag_t t, bus_space_handle_t h); - /* Disable interrupts routine */ - void (*m_get) (bus_space_tag_t t, bus_space_handle_t h, - int *dx, int *dy, int *but); - /* and get mouse status */ - mousehw_t m_hw; /* buttons iftype type model hwid */ - mousemode_t m_mode; /* proto rate res accel level size mask */ -} mse_types[] = { - { MSE_ATIINPORT, - mse_probeati, mse_enableati, mse_disableati, mse_getati, - { 2, MOUSE_IF_INPORT, MOUSE_MOUSE, MOUSE_MODEL_GENERIC, 0, }, - { MOUSE_PROTO_INPORT, -1, -1, 0, 0, MOUSE_MSC_PACKETSIZE, - { MOUSE_MSC_SYNCMASK, MOUSE_MSC_SYNC, }, }, }, - { MSE_LOGITECH, - mse_probelogi, mse_enablelogi, mse_disablelogi, mse_getlogi, - { 2, MOUSE_IF_BUS, MOUSE_MOUSE, MOUSE_MODEL_GENERIC, 0, }, - { MOUSE_PROTO_BUS, -1, -1, 0, 0, MOUSE_MSC_PACKETSIZE, - { MOUSE_MSC_SYNCMASK, MOUSE_MSC_SYNC, }, }, }, - { 0, }, -}; - -static int -mse_probe(device_t dev) -{ - mse_softc_t *sc; - int error; - int rid; - int i; - - /* check PnP IDs */ - error = ISA_PNP_PROBE(device_get_parent(dev), dev, mse_ids); - if (error == ENXIO) - return ENXIO; - - sc = device_get_softc(dev); - rid = 0; - sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - MSE_IOSIZE, RF_ACTIVE); - if (sc->sc_port == NULL) - return ENXIO; - sc->sc_iot = rman_get_bustag(sc->sc_port); - sc->sc_ioh = rman_get_bushandle(sc->sc_port); - - /* - * Check for each mouse type in the table. - */ - i = 0; - while (mse_types[i].m_type) { - if ((*mse_types[i].m_probe)(dev, sc)) { - sc->sc_mousetype = mse_types[i].m_type; - sc->sc_enablemouse = mse_types[i].m_enable; - sc->sc_disablemouse = mse_types[i].m_disable; - sc->sc_getmouse = mse_types[i].m_get; - sc->hw = mse_types[i].m_hw; - sc->mode = mse_types[i].m_mode; - bus_release_resource(dev, SYS_RES_IOPORT, rid, - sc->sc_port); - device_set_desc(dev, "Bus/InPort Mouse"); - return 0; - } - i++; - } - bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port); - return ENXIO; -} - -static int -mse_attach(device_t dev) -{ - mse_softc_t *sc; - int flags; - int unit; - int rid; - - sc = device_get_softc(dev); - unit = device_get_unit(dev); - - rid = 0; - sc->sc_port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, - MSE_IOSIZE, RF_ACTIVE); - if (sc->sc_port == NULL) - return ENXIO; - sc->sc_intr = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_ACTIVE); - if (sc->sc_intr == NULL) { - bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port); - return ENXIO; - } - sc->sc_iot = rman_get_bustag(sc->sc_port); - sc->sc_ioh = rman_get_bushandle(sc->sc_port); - - if (BUS_SETUP_INTR(device_get_parent(dev), dev, sc->sc_intr, - 0, mseintr, sc, &sc->sc_ih, NULL)) { - bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port); - bus_release_resource(dev, SYS_RES_IRQ, rid, sc->sc_intr); - return ENXIO; - } - - flags = device_get_flags(dev); - sc->mode.accelfactor = (flags & MSE_CONFIG_ACCEL) >> 4; - callout_init(&sc->sc_callout); - - make_dev(&mse_ops, unit << 1, 0, 0, 0600, "mse%d", unit); - make_dev(&mse_ops, (unit<<1)+1, 0, 0, 0600, "nmse%d", unit); - - return 0; -} - -static int -mse_detach(device_t dev) -{ - mse_softc_t *sc; - int rid; - - sc = device_get_softc(dev); - if (sc->sc_flags & MSESC_OPEN) - return EBUSY; - - rid = 0; - BUS_TEARDOWN_INTR(device_get_parent(dev), dev, sc->sc_intr, sc->sc_ih); - bus_release_resource(dev, SYS_RES_IRQ, rid, sc->sc_intr); - bus_release_resource(dev, SYS_RES_IOPORT, rid, sc->sc_port); - dev_ops_remove_minor(&mse_ops, device_get_unit(dev) << 1); - - return 0; -} - -/* - * Exclusive open the mouse, initialize it and enable interrupts. - */ -static int -mseopen(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - mse_softc_t *sc; - - sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev)); - if (sc == NULL) - return (ENXIO); - if (sc->sc_mousetype == MSE_NONE) - return (ENXIO); - if (sc->sc_flags & MSESC_OPEN) - return (EBUSY); - sc->sc_flags |= MSESC_OPEN; - sc->sc_obuttons = sc->sc_buttons = MOUSE_MSC_BUTTONS; - sc->sc_deltax = sc->sc_deltay = 0; - sc->sc_bytesread = sc->mode.packetsize = MOUSE_MSC_PACKETSIZE; - sc->sc_watchdog = FALSE; - callout_reset(&sc->sc_callout, hz * 2, msetimeout, dev); - sc->mode.level = 0; - sc->status.flags = 0; - sc->status.button = sc->status.obutton = 0; - sc->status.dx = sc->status.dy = sc->status.dz = 0; - - /* - * Initialize mouse interface and enable interrupts. - */ - crit_enter(); - (*sc->sc_enablemouse)(sc->sc_iot, sc->sc_ioh); - crit_exit(); - return (0); -} - -/* - * mseclose: just turn off mouse innterrupts. - */ -static int -mseclose(struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev)); - - crit_enter(); - callout_stop(&sc->sc_callout); - (*sc->sc_disablemouse)(sc->sc_iot, sc->sc_ioh); - sc->sc_flags &= ~MSESC_OPEN; - crit_exit(); - return(0); -} - -/* - * mseread: return mouse info using the MSC serial protocol, but without - * using bytes 4 and 5. - * (Yes this is cheesy, but it makes the X386 server happy, so...) - */ -static int -mseread(struct dev_read_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct uio *uio = ap->a_uio; - mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev)); - int xfer, error; - - /* - * If there are no protocol bytes to be read, set up a new protocol - * packet. - */ - crit_enter(); /* XXX Should be its own spl, but where is imlXX() */ - if (sc->sc_bytesread >= sc->mode.packetsize) { - while (sc->sc_deltax == 0 && sc->sc_deltay == 0 && - (sc->sc_obuttons ^ sc->sc_buttons) == 0) { - if (MSE_NBLOCKIO(dev)) { - crit_exit(); - return (0); - } - sc->sc_flags |= MSESC_WANT; - error = tsleep((caddr_t)sc, PCATCH, "mseread", 0); - if (error) { - crit_exit(); - return (error); - } - } - - /* - * Generate protocol bytes. - * For some reason X386 expects 5 bytes but never uses - * the fourth or fifth? - */ - sc->sc_bytes[0] = sc->mode.syncmask[1] - | (sc->sc_buttons & ~sc->mode.syncmask[0]); - if (sc->sc_deltax > 127) - sc->sc_deltax = 127; - if (sc->sc_deltax < -127) - sc->sc_deltax = -127; - sc->sc_deltay = -sc->sc_deltay; /* Otherwise mousey goes wrong way */ - if (sc->sc_deltay > 127) - sc->sc_deltay = 127; - if (sc->sc_deltay < -127) - sc->sc_deltay = -127; - sc->sc_bytes[1] = sc->sc_deltax; - sc->sc_bytes[2] = sc->sc_deltay; - sc->sc_bytes[3] = sc->sc_bytes[4] = 0; - sc->sc_bytes[5] = sc->sc_bytes[6] = 0; - sc->sc_bytes[7] = MOUSE_SYS_EXTBUTTONS; - sc->sc_obuttons = sc->sc_buttons; - sc->sc_deltax = sc->sc_deltay = 0; - sc->sc_bytesread = 0; - } - crit_exit(); - xfer = (int)szmin(uio->uio_resid, - sc->mode.packetsize - sc->sc_bytesread); - error = uiomove(&sc->sc_bytes[sc->sc_bytesread], (size_t)xfer, uio); - if (error) - return (error); - sc->sc_bytesread += xfer; - return(0); -} - -/* - * mseioctl: process ioctl commands. - */ -static int -mseioctl(struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - caddr_t addr = ap->a_data; - mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev)); - mousestatus_t status; - int err = 0; - - switch (ap->a_cmd) { - case MOUSE_GETHWINFO: - crit_enter(); - *(mousehw_t *)addr = sc->hw; - if (sc->mode.level == 0) - ((mousehw_t *)addr)->model = MOUSE_MODEL_GENERIC; - crit_exit(); - break; - - case MOUSE_GETMODE: - crit_enter(); - *(mousemode_t *)addr = sc->mode; - switch (sc->mode.level) { - case 0: - break; - case 1: - ((mousemode_t *)addr)->protocol = MOUSE_PROTO_SYSMOUSE; - ((mousemode_t *)addr)->syncmask[0] = MOUSE_SYS_SYNCMASK; - ((mousemode_t *)addr)->syncmask[1] = MOUSE_SYS_SYNC; - break; - } - crit_exit(); - break; - - case MOUSE_SETMODE: - switch (((mousemode_t *)addr)->level) { - case 0: - case 1: - break; - default: - return (EINVAL); - } - if (((mousemode_t *)addr)->accelfactor < -1) - return (EINVAL); - else if (((mousemode_t *)addr)->accelfactor >= 0) - sc->mode.accelfactor = - ((mousemode_t *)addr)->accelfactor; - sc->mode.level = ((mousemode_t *)addr)->level; - switch (sc->mode.level) { - case 0: - sc->sc_bytesread = sc->mode.packetsize - = MOUSE_MSC_PACKETSIZE; - break; - case 1: - sc->sc_bytesread = sc->mode.packetsize - = MOUSE_SYS_PACKETSIZE; - break; - } - break; - - case MOUSE_GETLEVEL: - *(int *)addr = sc->mode.level; - break; - - case MOUSE_SETLEVEL: - switch (*(int *)addr) { - case 0: - sc->mode.level = *(int *)addr; - sc->sc_bytesread = sc->mode.packetsize - = MOUSE_MSC_PACKETSIZE; - break; - case 1: - sc->mode.level = *(int *)addr; - sc->sc_bytesread = sc->mode.packetsize - = MOUSE_SYS_PACKETSIZE; - break; - default: - return (EINVAL); - } - break; - - case MOUSE_GETSTATUS: - crit_enter(); - status = sc->status; - sc->status.flags = 0; - sc->status.obutton = sc->status.button; - sc->status.button = 0; - sc->status.dx = 0; - sc->status.dy = 0; - sc->status.dz = 0; - crit_exit(); - *(mousestatus_t *)addr = status; - break; - - case MOUSE_READSTATE: - case MOUSE_READDATA: - return (ENODEV); - -#if (defined(MOUSE_GETVARS)) - case MOUSE_GETVARS: - case MOUSE_SETVARS: - return (ENODEV); -#endif - - default: - return (ENOTTY); - } - return (err); -} - -static struct filterops msefiltops = - { FILTEROP_ISFD, NULL, msefilter_detach, msefilter }; - -static int -msekqfilter(struct dev_kqfilter_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - mse_softc_t *sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev)); - struct knote *kn = ap->a_kn; - struct klist *klist; - - ap->a_result = 0; - - switch (kn->kn_filter) { - case EVFILT_READ: - kn->kn_fop = &msefiltops; - kn->kn_hook = (caddr_t)sc; - break; - default: - ap->a_result = EOPNOTSUPP; - return (0); - } - - klist = &sc->sc_kqp.ki_note; - knote_insert(klist, kn); - - return (0); -} - -static void -msefilter_detach(struct knote *kn) -{ - mse_softc_t *sc = (mse_softc_t *)kn->kn_hook; - struct klist *klist; - - klist = &sc->sc_kqp.ki_note; - knote_remove(klist, kn); -} - -static int -msefilter(struct knote *kn, long hint) -{ - mse_softc_t *sc = (mse_softc_t *)kn->kn_hook; - int ready = 0; - - crit_enter(); - if (sc->sc_bytesread != sc->mode.packetsize || - sc->sc_deltax != 0 || sc->sc_deltay != 0 || - (sc->sc_obuttons ^ sc->sc_buttons) != 0) - ready = 1; - - crit_exit(); - - return (ready); -} - -/* - * msetimeout: watchdog timer routine. - */ -static void -msetimeout(void *arg) -{ - cdev_t dev; - mse_softc_t *sc; - - dev = (cdev_t)arg; - sc = devclass_get_softc(mse_devclass, MSE_UNIT(dev)); - if (sc->sc_watchdog) { - if (bootverbose) - kprintf("mse%d: lost interrupt?\n", MSE_UNIT(dev)); - mseintr(sc); - } - sc->sc_watchdog = TRUE; - callout_reset(&sc->sc_callout, hz, msetimeout, dev); -} - -/* - * mseintr: update mouse status. sc_deltax and sc_deltay are accumulative. - */ -static void -mseintr(void *arg) -{ - /* - * the table to turn MouseSystem button bits (MOUSE_MSC_BUTTON?UP) - * into `mousestatus' button bits (MOUSE_BUTTON?DOWN). - */ - static int butmap[8] = { - 0, - MOUSE_BUTTON3DOWN, - MOUSE_BUTTON2DOWN, - MOUSE_BUTTON2DOWN | MOUSE_BUTTON3DOWN, - MOUSE_BUTTON1DOWN, - MOUSE_BUTTON1DOWN | MOUSE_BUTTON3DOWN, - MOUSE_BUTTON1DOWN | MOUSE_BUTTON2DOWN, - MOUSE_BUTTON1DOWN | MOUSE_BUTTON2DOWN | MOUSE_BUTTON3DOWN - }; - mse_softc_t *sc = arg; - int dx, dy, but; - int sign; - -#ifdef DEBUG - static int mse_intrcnt = 0; - if((mse_intrcnt++ % 10000) == 0) - kprintf("mseintr\n"); -#endif /* DEBUG */ - if ((sc->sc_flags & MSESC_OPEN) == 0) - return; - - (*sc->sc_getmouse)(sc->sc_iot, sc->sc_ioh, &dx, &dy, &but); - if (sc->mode.accelfactor > 0) { - sign = (dx < 0); - dx = dx * dx / sc->mode.accelfactor; - if (dx == 0) - dx = 1; - if (sign) - dx = -dx; - sign = (dy < 0); - dy = dy * dy / sc->mode.accelfactor; - if (dy == 0) - dy = 1; - if (sign) - dy = -dy; - } - sc->sc_deltax += dx; - sc->sc_deltay += dy; - sc->sc_buttons = but; - - but = butmap[~but & MOUSE_MSC_BUTTONS]; - sc->status.dx += dx; - sc->status.dy += dy; - sc->status.flags |= ((dx || dy) ? MOUSE_POSCHANGED : 0) - | (sc->status.button ^ but); - sc->status.button = but; - - sc->sc_watchdog = FALSE; - - /* - * If mouse state has changed, wake up anyone wanting to know. - */ - if (sc->sc_deltax != 0 || sc->sc_deltay != 0 || - (sc->sc_obuttons ^ sc->sc_buttons) != 0) { - if (sc->sc_flags & MSESC_WANT) { - sc->sc_flags &= ~MSESC_WANT; - wakeup((caddr_t)sc); - } - KNOTE(&sc->sc_kqp.ki_note, 0); - } -} - -/* - * Routines for the Logitech mouse. - */ -/* - * Test for a Logitech bus mouse and return 1 if it is. - * (until I know how to use the signature port properly, just disable - * interrupts and return 1) - */ -static int -mse_probelogi(device_t dev, mse_softc_t *sc) -{ - - int sig; - - bus_space_write_1(sc->sc_iot, sc->sc_ioh, MSE_PORTD, MSE_SETUP); - /* set the signature port */ - bus_space_write_1(sc->sc_iot, sc->sc_ioh, MSE_PORTB, MSE_LOGI_SIG); - - DELAY(30000); /* 30 ms delay */ - sig = bus_space_read_1(sc->sc_iot, sc->sc_ioh, MSE_PORTB) & 0xFF; - if (sig == MSE_LOGI_SIG) { - bus_space_write_1(sc->sc_iot, sc->sc_ioh, MSE_PORTC, - MSE_DISINTR); - return(1); - } else { - if (bootverbose) - device_printf(dev, "wrong signature %x\n", sig); - return(0); - } -} - -/* - * Initialize Logitech mouse and enable interrupts. - */ -static void -mse_enablelogi(bus_space_tag_t tag, bus_space_handle_t handle) -{ - int dx, dy, but; - - bus_space_write_1(tag, handle, MSE_PORTD, MSE_SETUP); - mse_getlogi(tag, handle, &dx, &dy, &but); -} - -/* - * Disable interrupts for Logitech mouse. - */ -static void -mse_disablelogi(bus_space_tag_t tag, bus_space_handle_t handle) -{ - - bus_space_write_1(tag, handle, MSE_PORTC, MSE_DISINTR); -} - -/* - * Get the current dx, dy and button up/down state. - */ -static void -mse_getlogi(bus_space_tag_t tag, bus_space_handle_t handle, int *dx, int *dy, - int *but) -{ - char x, y; - - bus_space_write_1(tag, handle, MSE_PORTC, MSE_HOLD | MSE_RXLOW); - x = bus_space_read_1(tag, handle, MSE_PORTA); - *but = (x >> 5) & MOUSE_MSC_BUTTONS; - x &= 0xf; - bus_space_write_1(tag, handle, MSE_PORTC, MSE_HOLD | MSE_RXHIGH); - x |= (bus_space_read_1(tag, handle, MSE_PORTA) << 4); - bus_space_write_1(tag, handle, MSE_PORTC, MSE_HOLD | MSE_RYLOW); - y = (bus_space_read_1(tag, handle, MSE_PORTA) & 0xf); - bus_space_write_1(tag, handle, MSE_PORTC, MSE_HOLD | MSE_RYHIGH); - y |= (bus_space_read_1(tag, handle, MSE_PORTA) << 4); - *dx = x; - *dy = y; - bus_space_write_1(tag, handle, MSE_PORTC, MSE_INTREN); -} - -/* - * Routines for the ATI Inport bus mouse. - */ -/* - * Test for a ATI Inport bus mouse and return 1 if it is. - * (do not enable interrupts) - */ -static int -mse_probeati(device_t dev, mse_softc_t *sc) -{ - int i; - - for (i = 0; i < 2; i++) - if (bus_space_read_1(sc->sc_iot, sc->sc_ioh, MSE_PORTC) == 0xde) - return (1); - return (0); -} - -/* - * Initialize ATI Inport mouse and enable interrupts. - */ -static void -mse_enableati(bus_space_tag_t tag, bus_space_handle_t handle) -{ - - bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_RESET); - bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_MODE); - bus_space_write_1(tag, handle, MSE_PORTB, MSE_INPORT_INTREN); -} - -/* - * Disable interrupts for ATI Inport mouse. - */ -static void -mse_disableati(bus_space_tag_t tag, bus_space_handle_t handle) -{ - - bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_MODE); - bus_space_write_1(tag, handle, MSE_PORTB, 0); -} - -/* - * Get current dx, dy and up/down button state. - */ -static void -mse_getati(bus_space_tag_t tag, bus_space_handle_t handle, int *dx, int *dy, - int *but) -{ - char byte; - - bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_MODE); - bus_space_write_1(tag, handle, MSE_PORTB, MSE_INPORT_HOLD); - bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_STATUS); - *but = ~bus_space_read_1(tag, handle, MSE_PORTB) & MOUSE_MSC_BUTTONS; - bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_DX); - byte = bus_space_read_1(tag, handle, MSE_PORTB); - *dx = byte; - bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_DY); - byte = bus_space_read_1(tag, handle, MSE_PORTB); - *dy = byte; - bus_space_write_1(tag, handle, MSE_PORTA, MSE_INPORT_MODE); - bus_space_write_1(tag, handle, MSE_PORTB, MSE_INPORT_INTREN); -} diff --git a/sys/dev/misc/spigot/spigot.c b/sys/dev/misc/spigot/spigot.c deleted file mode 100644 index 59423fcde6..0000000000 --- a/sys/dev/misc/spigot/spigot.c +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Video spigot capture driver. - * - * Copyright (c) 1995, Jim Lowe. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - * This is the minimum driver code required to make a spigot work. - * Unfortunatly, I can't include a real driver since the information - * on the spigot is under non-disclosure. You can pick up a library - * that will work with this driver from - * ftp://ftp.cs.uwm.edu/pub/FreeBSD-UWM. The library contains the - * source that I can release as well as several object modules and - * functions that allows one to read spigot data. See the code for - * spigot_grab.c that is included with the library data. - * - * The vendor will not allow me to release the spigot library code. - * Please don't ask me for it. - * - * To use this driver you will need the spigot library. The library is - * available from: - * - * ftp.cs.uwm.edu://pub/FreeBSD-UWM/spigot/spigot.tar.gz - * - * Version 1.7, December 1995. - * - * $FreeBSD: src/sys/i386/isa/spigot.c,v 1.44 2000/01/29 16:17:36 peter Exp $ - * - */ - -#include "use_spigot.h" - -#if NSPIGOT > 1 -error "Can only have 1 spigot configured." -#endif - -#include "opt_spigot.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -static struct spigot_softc { - u_long flags; - u_long maddr; - struct proc *p; - u_long signal_num; - u_short irq; -} spigot_softc[NSPIGOT]; - -/* flags in softc */ -#define OPEN 0x01 -#define ALIVE 0x02 - -#define UNIT(dev) minor(dev) - -static int spigot_probe(struct isa_device *id); -static int spigot_attach(struct isa_device *id); - -struct isa_driver spigotdriver = {spigot_probe, spigot_attach, "spigot"}; - -static d_open_t spigot_open; -static d_close_t spigot_close; -static d_read_t spigot_read; -static d_write_t spigot_write; -static d_ioctl_t spigot_ioctl; -static d_mmap_t spigot_mmap; - -static struct dev_ops spigot_ops = { - { "spigot", 0, 0 }, - .d_open = spigot_open, - .d_close = spigot_close, - .d_read = spigot_read, - .d_write = spigot_write, - .d_ioctl = spigot_ioctl, - .d_mmap = spigot_mmap, -}; - -static void spigintr(void *); - -static int -spigot_probe(struct isa_device *devp) -{ - struct spigot_softc *ss; - int status; - - ss = (struct spigot_softc *)&spigot_softc[devp->id_unit]; - ss->flags = 0; - ss->maddr = 0; - ss->irq = 0; - - if(devp->id_iobase != 0xad6 || inb(0xad9) == 0xff) - status = 0; /* not found */ - else { - status = 1; /* found */ - ss->flags |= ALIVE; - } - - return(status); -} - -static int -spigot_attach(struct isa_device *devp) -{ - int unit; - struct spigot_softc *ss= &spigot_softc[unit = devp->id_unit]; - - devp->id_intr = (inthand2_t *)spigintr; - ss->maddr = kvtop(devp->id_maddr); - ss->irq = devp->id_irq; - make_dev(&spigot_ops, unit, 0, 0, 0644, "spigot%d", unit); - return 1; -} - -static int -spigot_open(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - int error; - struct spigot_softc *ss; - - ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; - - if((ss->flags & ALIVE) == 0) - return ENXIO; - - if(ss->flags & OPEN) - return EBUSY; - -#if !defined(SPIGOT_UNSECURE) - /* - * Don't allow open() unless the process has sufficient privileges, - * since mapping the i/o page and granting i/o privilege would - * require sufficient privilege soon and nothing much can be done - * without them. - */ - error = priv_check_cred(ap->a_cred, PRIV_ROOT, 0); - if (error != 0) - return error; - if (securelevel > 0) - return EPERM; -#endif - - ss->flags |= OPEN; - ss->p = 0; - ss->signal_num = 0; - - return 0; -} - -static int -spigot_close(struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct spigot_softc *ss; - - ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; - ss->flags &= ~OPEN; - ss->p = 0; - ss->signal_num = 0; - - outb(0xad6, 0); - - return 0; -} - -static int -spigot_write(struct dev_write_args *ap) -{ - return ENXIO; -} - -static int -spigot_read(struct dev_read_args *ap) -{ - return ENXIO; -} - - -static int -spigot_ioctl(struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - caddr_t data = ap->a_data; - int error; - struct spigot_softc *ss; - struct spigot_info *info; - - ss = (struct spigot_softc *)&spigot_softc[UNIT(dev)]; - if (data == NULL) - return(EINVAL); - - switch(ap->a_cmd){ - case SPIGOT_SETINT: - if (*(int *)data < 0 || *(int *)data > _SIG_MAXSIG) - return (EINVAL); - ss->p = curproc; - ss->signal_num = *((int *)data); - break; - case SPIGOT_IOPL_ON: /* allow access to the IO PAGE */ -#if !defined(SPIGOT_UNSECURE) - error = priv_check_cred(ap->a_cred, PRIV_ROOT, 0); - if (error != 0) - return error; - if (securelevel > 0) - return EPERM; -#endif - curthread->td_lwp->lwp_md.md_regs->tf_eflags |= PSL_IOPL; - break; - case SPIGOT_IOPL_OFF: /* deny access to the IO PAGE */ - curthread->td_lwp->lwp_md.md_regs->tf_eflags &= ~PSL_IOPL; - break; - case SPIGOT_GET_INFO: - info = (struct spigot_info *)data; - info->maddr = ss->maddr; - info->irq = ss->irq; - break; - default: - return ENOTTY; - } - - return 0; -} - -/* - * Interrupt procedure. - * Just call a user level interrupt routine. - */ -static void -spigintr(void *arg) -{ - int unit = (int)arg; - struct spigot_softc *ss; - - ss = (struct spigot_softc *)&spigot_softc[unit]; - if(ss->p && ss->signal_num) - ksignal(ss->p, ss->signal_num); -} - -static int -spigot_mmap(struct dev_mmap_args *ap) -{ - struct spigot_softc *ss; - - ss = (struct spigot_softc *)&spigot_softc[0]; - if (ap->a_offset != 0) - return EINVAL; - if (ap->a_nprot & PROT_EXEC) - return EINVAL; - ap->a_result = i386_btop(ss->maddr); - return(0); -} diff --git a/sys/dev/misc/tw/tw.c b/sys/dev/misc/tw/tw.c deleted file mode 100644 index ff5dec744d..0000000000 --- a/sys/dev/misc/tw/tw.c +++ /dev/null @@ -1,1183 +0,0 @@ -/*- - * Copyright (c) 1992, 1993, 1995 Eugene W. Stark - * 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 Eugene W. Stark. - * 4. 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 EUGENE W. STARK (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: src/sys/i386/isa/tw.c,v 1.38 2000/01/29 16:00:32 peter Exp $ - * - */ - -#include "use_tw.h" - -/* - * Driver configuration parameters - */ - -/* - * Time for 1/2 of a power line cycle, in microseconds. - * Change this to 10000 for 50Hz power. Phil Sampson - * (vk2jnt@gw.vk2jnt.ampr.org OR sampson@gidday.enet.dec.com) - * reports that this works (at least in Australia) using a - * TW7223 module (a local version of the TW523). - */ -#define HALFCYCLE 8333 /* 1/2 cycle = 8333us at 60Hz */ - -/* - * Undefine the following if you don't have the high-resolution "microtime" - * routines (leave defined for FreeBSD, which has them). - */ -#define HIRESTIME - -/* - * End of driver configuration parameters - */ - -/* - * FreeBSD Device Driver for X-10 POWERHOUSE (tm) - * Two-Way Power Line Interface, Model #TW523 - * - * written by Eugene W. Stark (stark@cs.sunysb.edu) - * December 2, 1992 - * - * NOTES: - * - * The TW523 is a carrier-current modem for home control/automation purposes. - * It is made by: - * - * X-10 Inc. - * 185A LeGrand Ave. - * Northvale, NJ 07647 - * USA - * (201) 784-9700 or 1-800-526-0027 - * - * X-10 Home Controls Inc. - * 1200 Aerowood Drive, Unit 20 - * Mississauga, Ontario - * (416) 624-4446 or 1-800-387-3346 - * - * The TW523 is designed for communications using the X-10 protocol, - * which is compatible with a number of home control systems, including - * Radio Shack "Plug 'n Power(tm)" and Stanley "Lightmaker(tm)." - * I bought my TW523 from: - * - * Home Control Concepts - * 9353-C Activity Road - * San Diego, CA 92126 - * (619) 693-8887 - * - * They supplied me with the TW523 (which has an RJ-11 four-wire modular - * telephone connector), a modular cable, an RJ-11 to DB-25 connector with - * internal wiring, documentation from X-10 on the TW523 (very good), - * an instruction manual by Home Control Concepts (not very informative), - * and a floppy disk containing binary object code of some demonstration/test - * programs and of a C function library suitable for controlling the TW523 - * by an IBM PC under MS-DOS (not useful to me other than to verify that - * the unit worked). I suggest saving money and buying the bare TW523 - * rather than the TW523 development kit (what I bought), because if you - * are running FreeBSD you don't really care about the DOS binaries. - * - * The interface to the TW-523 consists of four wires on the RJ-11 connector, - * which are jumpered to somewhat more wires on the DB-25 connector, which - * in turn is intended to plug into the PC parallel printer port. I dismantled - * the DB-25 connector to find out what they had done: - * - * Signal RJ-11 pin DB-25 pin(s) Parallel Port - * Transmit TX 4 (Y) 2, 4, 6, 8 Data out - * Receive RX 3 (G) 10, 14 -ACK, -AutoFeed - * Common 2 (R) 25 Common - * Zero crossing 1 (B) 17 or 12 -Select or +PaperEnd - * - * NOTE: In the original cable I have (which I am still using, May, 1997) - * the Zero crossing signal goes to pin 17 (-Select) on the parallel port. - * In retrospect, this doesn't make a whole lot of sense, given that the - * -Select signal propagates the other direction. Indeed, some people have - * reported problems with this, and have had success using pin 12 (+PaperEnd) - * instead. This driver searches for the zero crossing signal on either - * pin 17 or pin 12, so it should work with either cable configuration. - * My suggestion would be to start by making the cable so that the zero - * crossing signal goes to pin 12 on the parallel port. - * - * The zero crossing signal is used to synchronize transmission to the - * zero crossings of the AC line, as detailed in the X-10 documentation. - * It would be nice if one could generate interrupts with this signal, - * however one needs interrupts on both the rising and falling edges, - * and the -ACK signal to the parallel port interrupts only on the falling - * edge, so it can't be done without additional hardware. - * - * In this driver, the transmit function is performed in a non-interrupt-driven - * fashion, by polling the zero crossing signal to determine when a transition - * has occurred. This wastes CPU time during transmission, but it seems like - * the best that can be done without additional hardware. One problem with - * the scheme is that preemption of the CPU during transmission can cause loss - * of sync. The driver tries to catch this, by noticing that a long delay - * loop has somehow become foreshortened, and the transmission is aborted with - * an error return. It is up to the user level software to handle this - * situation (most likely by retrying the transmission). - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HIRESTIME -#include -#endif /* HIRESTIME */ - -#include - -/* - * Transmission is done by calling write() to send three byte packets of data. - * The first byte contains a four bit house code (0=A to 15=P). - * The second byte contains five bit unit/key code (0=unit 1 to 15=unit 16, - * 16=All Units Off to 31 = Status Request). The third byte specifies - * the number of times the packet is to be transmitted without any - * gaps between successive transmissions. Normally this is 2, as per - * the X-10 documentation, but sometimes (e.g. for bright and dim codes) - * it can be another value. Each call to write can specify an arbitrary - * number of data bytes. An incomplete packet is buffered until a subsequent - * call to write() provides data to complete it. At most one packet will - * actually be processed in any call to write(). Successive calls to write() - * leave a three-cycle gap between transmissions, per the X-10 documentation. - * - * Reception is done using read(). - * The driver produces a series of three-character packets. - * In each packet, the first character consists of flags, - * the second character is a four bit house code (0-15), - * and the third character is a five bit key/function code (0-31). - * The flags are the following: - */ - -#define TW_RCV_LOCAL 1 /* The packet arrived during a local transmission */ -#define TW_RCV_ERROR 2 /* An invalid/corrupted packet was received */ - -/* - * IBM PC parallel port definitions relevant to TW523 - */ - -#define tw_data 0 /* Data to tw523 (R/W) */ - -#define tw_status 1 /* Status of tw523 (R) */ -#define TWS_RDATA 0x40 /* tw523 receive data */ -#define TWS_OUT 0x20 /* pin 12, out of paper */ - -#define tw_control 2 /* Control tw523 (R/W) */ -#define TWC_SYNC 0x08 /* tw523 sync (pin 17) */ -#define TWC_ENA 0x10 /* tw523 interrupt enable */ - -/* - * Miscellaneous defines - */ - -#define TWUNIT(dev) (minor(dev)) /* Extract unit number from device */ - -static int twprobe(struct isa_device *idp); -static int twattach(struct isa_device *idp); - -struct isa_driver twdriver = { - twprobe, twattach, "tw" -}; - -static d_open_t twopen; -static d_close_t twclose; -static d_read_t twread; -static d_write_t twwrite; -static d_kqfilter_t twkqfilter; - -static void twfilter_detach(struct knote *); -static int twfilter_read(struct knote *, long); -static int twfilter_write(struct knote *, long); - -static struct dev_ops tw_ops = { - { "tw", 0, 0 }, - .d_open = twopen, - .d_close = twclose, - .d_read = twread, - .d_write = twwrite, - .d_kqfilter = twkqfilter -}; - -/* - * Software control structure for TW523 - */ - -#define TWS_XMITTING 1 /* Transmission in progress */ -#define TWS_RCVING 2 /* Reception in progress */ -#define TWS_WANT 4 /* A process wants received data */ -#define TWS_OPEN 8 /* Is it currently open? */ - -#define TW_SIZE 3*60 /* Enough for about 10 sec. of input */ -#define TW_MIN_DELAY 1500 /* Ignore interrupts of lesser latency */ - -static struct tw_sc { - u_int sc_port; /* I/O Port */ - u_int sc_state; /* Current software control state */ - struct kqinfo sc_kqp; /* Information for select()/poll()/kq() */ - u_char sc_xphase; /* Current state of sync (for transmitter) */ - u_char sc_rphase; /* Current state of sync (for receiver) */ - u_char sc_flags; /* Flags for current reception */ - short sc_rcount; /* Number of bits received so far */ - int sc_bits; /* Bits received so far */ - u_char sc_pkt[3]; /* Packet not yet transmitted */ - short sc_pktsize; /* How many bytes in the packet? */ - u_char sc_buf[TW_SIZE]; /* We buffer our own input */ - int sc_nextin; /* Next free slot in circular buffer */ - int sc_nextout; /* First used slot in circular buffer */ - /* Callout for canceling our abortrcv timeout */ - struct callout abortrcv_ch; -#ifdef HIRESTIME - int sc_xtimes[22]; /* Times for bits in current xmit packet */ - int sc_rtimes[22]; /* Times for bits in current rcv packet */ - int sc_no_rcv; /* number of interrupts received */ -#define SC_RCV_TIME_LEN 128 - int sc_rcv_time[SC_RCV_TIME_LEN]; /* usec time stamp on interrupt */ -#endif /* HIRESTIME */ -} tw_sc[NTW]; - -static int tw_zcport; /* offset of port for zero crossing signal */ -static int tw_zcmask; /* mask for the zero crossing signal */ - -static void twdelay25(void); -static void twdelayn(int n); -static void twsetuptimes(int *a); -static int wait_for_zero(struct tw_sc *sc); -static int twputpkt(struct tw_sc *sc, u_char *p); -static void twintr(void *); -static int twgetbytes(struct tw_sc *sc, u_char *p, int cnt); -static timeout_t twabortrcv; -static int twsend(struct tw_sc *sc, int h, int k, int cnt); -static int next_zero(struct tw_sc *sc); -static int twchecktime(int target, int tol); -static void twdebugtimes(struct tw_sc *sc); - -/* - * Counter value for delay loop. - * It is adjusted by twprobe so that the delay loop takes about 25us. - */ - -#define TWDELAYCOUNT 161 /* Works on my 486DX/33 */ -static int twdelaycount; - -/* - * Twdelay25 is used for very short delays of about 25us. - * It is implemented with a calibrated delay loop, and should be - * fairly accurate ... unless we are preempted by an interrupt. - * - * We use this to wait for zero crossings because the X-10 specs say we - * are supposed to assert carrier within 25us when one happens. - * I don't really believe we can do this, but the X-10 devices seem to be - * fairly forgiving. - */ - -static void -twdelay25(void) -{ - int cnt; - for(cnt = twdelaycount; cnt; cnt--); /* Should take about 25us */ -} - -/* - * Twdelayn is used to time the length of the 1ms carrier pulse. - * This is not very critical, but if we have high-resolution time-of-day - * we check it every apparent 200us to make sure we don't get too far off - * if we happen to be interrupted during the delay. - */ - -static void -twdelayn(int n) -{ -#ifdef HIRESTIME - int t, d; - struct timeval tv; - microtime(&tv); - t = tv.tv_usec; - t += n; -#endif /* HIRESTIME */ - while(n > 0) { - twdelay25(); - n -= 25; -#ifdef HIRESTIME - if((n & 0x7) == 0) { - microtime(&tv); - d = tv.tv_usec - t; - if(d >= 0 && d < 1000000) return; - } -#endif /* HIRESTIME */ - } -} - -static int -twprobe(struct isa_device *idp) -{ - struct tw_sc sc; - int d; - int tries; - - sc.sc_port = idp->id_iobase; - /* Search for the zero crossing signal at ports, bit combinations. */ - tw_zcport = tw_control; - tw_zcmask = TWC_SYNC; - sc.sc_xphase = inb(idp->id_iobase + tw_zcport) & tw_zcmask; - if(wait_for_zero(&sc) < 0) { - tw_zcport = tw_status; - tw_zcmask = TWS_OUT; - sc.sc_xphase = inb(idp->id_iobase + tw_zcport) & tw_zcmask; - } - if(wait_for_zero(&sc) < 0) - return(0); - /* - * Iteratively check the timing of a few sync transitions, and adjust - * the loop delay counter, if necessary, to bring the timing reported - * by wait_for_zero() close to HALFCYCLE. Give up if anything - * ridiculous happens. - */ - if(twdelaycount == 0) { /* Only adjust timing for first unit */ - twdelaycount = TWDELAYCOUNT; - for(tries = 0; tries < 10; tries++) { - sc.sc_xphase = inb(idp->id_iobase + tw_zcport) & tw_zcmask; - if(wait_for_zero(&sc) >= 0) { - d = wait_for_zero(&sc); - if(d <= HALFCYCLE/100 || d >= HALFCYCLE*100) { - twdelaycount = 0; - return(0); - } - twdelaycount = (twdelaycount * d)/HALFCYCLE; - } - } - } - /* - * Now do a final check, just to make sure - */ - sc.sc_xphase = inb(idp->id_iobase + tw_zcport) & tw_zcmask; - if(wait_for_zero(&sc) >= 0) { - d = wait_for_zero(&sc); - if(d <= (HALFCYCLE * 110)/100 && d >= (HALFCYCLE * 90)/100) return(8); - } - return(0); -} - -static int -twattach(struct isa_device *idp) -{ - struct tw_sc *sc; - int unit; - - idp->id_intr = (inthand2_t *)twintr; - sc = &tw_sc[unit = idp->id_unit]; - sc->sc_port = idp->id_iobase; - sc->sc_state = 0; - sc->sc_rcount = 0; - callout_init(&sc->abortrcv_ch); - make_dev(&tw_ops, unit, 0, 0, 0600, "tw%d", unit); - return (1); -} - -int -twopen(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct tw_sc *sc = &tw_sc[TWUNIT(dev)]; - - crit_enter(); - if(sc->sc_state == 0) { - sc->sc_state = TWS_OPEN; - sc->sc_nextin = sc->sc_nextout = 0; - sc->sc_pktsize = 0; - outb(sc->sc_port+tw_control, TWC_ENA); - } - crit_exit(); - return(0); -} - -int -twclose(struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct tw_sc *sc = &tw_sc[TWUNIT(dev)]; - - crit_enter(); - sc->sc_state = 0; - outb(sc->sc_port+tw_control, 0); - crit_exit(); - return(0); -} - -int -twread(struct dev_read_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct uio *uio = ap->a_uio; - u_char buf[3]; - struct tw_sc *sc = &tw_sc[TWUNIT(dev)]; - int error, cnt; - - crit_enter(); - cnt = MIN(uio->uio_resid, 3); - if((error = twgetbytes(sc, buf, cnt)) == 0) { - error = uiomove(buf, cnt, uio); - } - crit_exit(); - return(error); -} - -int -twwrite(struct dev_write_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct uio *uio = ap->a_uio; - struct tw_sc *sc; - int house, key, reps; - int error; - int cnt; - - sc = &tw_sc[TWUNIT(dev)]; - /* - * Note: Although I had intended to allow concurrent transmitters, - * there is a potential problem here if two processes both write - * into the sc_pkt buffer at the same time. The following code - * is an additional critical section that needs to be synchronized. - */ - crit_enter(); - cnt = MIN(3 - sc->sc_pktsize, uio->uio_resid); - error = uiomove(&(sc->sc_pkt[sc->sc_pktsize]), cnt, uio); - if(error) { - crit_exit(); - return(error); - } - sc->sc_pktsize += cnt; - if(sc->sc_pktsize < 3) { /* Only transmit 3-byte packets */ - crit_exit(); - return(0); - } - sc->sc_pktsize = 0; - /* - * Collect house code, key code, and rep count, and check for sanity. - */ - house = sc->sc_pkt[0]; - key = sc->sc_pkt[1]; - reps = sc->sc_pkt[2]; - if(house >= 16 || key >= 32) { - crit_exit(); - return(ENODEV); - } - /* - * Synchronize with the receiver operating in the bottom half, and - * also with concurrent transmitters. - * We don't want to interfere with a packet currently being received, - * and we would like the receiver to recognize when a packet has - * originated locally. - */ - while(sc->sc_state & (TWS_RCVING | TWS_XMITTING)) { - error = tsleep((caddr_t)sc, PCATCH, "twwrite", 0); - if(error) { - crit_exit(); - return(error); - } - } - sc->sc_state |= TWS_XMITTING; - /* - * Everything looks OK, let's do the transmission. - */ - crit_exit(); /* Enable interrupts because this takes a LONG time */ - error = twsend(sc, house, key, reps); - crit_enter(); - sc->sc_state &= ~TWS_XMITTING; - wakeup((caddr_t)sc); - crit_exit(); - if(error) return(EIO); - else return(0); -} - -/* - * Determine if there is data available for reading - */ - -static struct filterops twfiltops_read = - { FILTEROP_ISFD, NULL, twfilter_detach, twfilter_read }; -static struct filterops twfiltops_write = - { FILTEROP_ISFD, NULL, twfilter_detach, twfilter_write }; - -static int -twkqfilter(struct dev_kqfilter_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct knote *kn = ap->a_kn; - struct klist *klist; - struct tw_sc *sc; - - ap->a_result = 0; - - switch (kn->kn_filter) { - case EVFILT_READ: - sc = &tw_sc[TWUNIT(dev)]; - kn->kn_fop = &twfiltops_read; - kn->kn_hook = (caddr_t)sc; - break; - case EVFILT_WRITE: - sc = &tw_sc[TWUNIT(dev)]; - kn->kn_fop = &twfiltops_write; - kn->kn_hook = (caddr_t)sc; - break; - default: - ap->a_result = EOPNOTSUPP; - return (0); - } - - klist = &sc->sc_kqp.ki_note; - knote_insert(klist, kn); - - return (0); -} - -static void -twfilter_detach(struct knote *kn) -{ - struct tw_sc *sc = (struct tw_sc *)kn->kn_hook; - struct klist *klist; - - klist = &sc->sc_kqp.ki_note; - knote_remove(klist, kn); -} - -static int -twfilter_read(struct knote *kn, long hint) -{ - struct tw_sc *sc = (struct tw_sc *)kn->kn_hook; - int ready = 0; - - crit_enter(); - if(sc->sc_nextin != sc->sc_nextout) - ready = 1; - crit_exit(); - - return (ready); -} - -static int -twfilter_write(struct knote *kn, long hint) -{ - /* write() is always OK */ - return (1); -} - -/* - * X-10 Protocol - */ - -#define X10_START_LENGTH 4 -static char X10_START[] = { 1, 1, 1, 0 }; - -/* - * Each bit of the 4-bit house code and 5-bit key code - * is transmitted twice, once in true form, and then in - * complemented form. This is already taken into account - * in the following tables. - */ - -#define X10_HOUSE_LENGTH 8 -static char X10_HOUSE[16][8] = { - { 0, 1, 1, 0, 1, 0, 0, 1 }, /* A = 0110 */ - { 1, 0, 1, 0, 1, 0, 0, 1 }, /* B = 1110 */ - { 0, 1, 0, 1, 1, 0, 0, 1 }, /* C = 0010 */ - { 1, 0, 0, 1, 1, 0, 0, 1 }, /* D = 1010 */ - { 0, 1, 0, 1, 0, 1, 1, 0 }, /* E = 0001 */ - { 1, 0, 0, 1, 0, 1, 1, 0 }, /* F = 1001 */ - { 0, 1, 1, 0, 0, 1, 1, 0 }, /* G = 0101 */ - { 1, 0, 1, 0, 0, 1, 1, 0 }, /* H = 1101 */ - { 0, 1, 1, 0, 1, 0, 1, 0 }, /* I = 0111 */ - { 1, 0, 1, 0, 1, 0, 1, 0 }, /* J = 1111 */ - { 0, 1, 0, 1, 1, 0, 1, 0 }, /* K = 0011 */ - { 1, 0, 0, 1, 1, 0, 1, 0 }, /* L = 1011 */ - { 0, 1, 0, 1, 0, 1, 0, 1 }, /* M = 0000 */ - { 1, 0, 0, 1, 0, 1, 0, 1 }, /* N = 1000 */ - { 0, 1, 1, 0, 0, 1, 0, 1 }, /* O = 0100 */ - { 1, 0, 1, 0, 0, 1, 0, 1 } /* P = 1100 */ -}; - -#define X10_KEY_LENGTH 10 -static char X10_KEY[32][10] = { - { 0, 1, 1, 0, 1, 0, 0, 1, 0, 1 }, /* 01100 => 1 */ - { 1, 0, 1, 0, 1, 0, 0, 1, 0, 1 }, /* 11100 => 2 */ - { 0, 1, 0, 1, 1, 0, 0, 1, 0, 1 }, /* 00100 => 3 */ - { 1, 0, 0, 1, 1, 0, 0, 1, 0, 1 }, /* 10100 => 4 */ - { 0, 1, 0, 1, 0, 1, 1, 0, 0, 1 }, /* 00010 => 5 */ - { 1, 0, 0, 1, 0, 1, 1, 0, 0, 1 }, /* 10010 => 6 */ - { 0, 1, 1, 0, 0, 1, 1, 0, 0, 1 }, /* 01010 => 7 */ - { 1, 0, 1, 0, 0, 1, 1, 0, 0, 1 }, /* 11010 => 8 */ - { 0, 1, 1, 0, 1, 0, 1, 0, 0, 1 }, /* 01110 => 9 */ - { 1, 0, 1, 0, 1, 0, 1, 0, 0, 1 }, /* 11110 => 10 */ - { 0, 1, 0, 1, 1, 0, 1, 0, 0, 1 }, /* 00110 => 11 */ - { 1, 0, 0, 1, 1, 0, 1, 0, 0, 1 }, /* 10110 => 12 */ - { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 }, /* 00000 => 13 */ - { 1, 0, 0, 1, 0, 1, 0, 1, 0, 1 }, /* 10000 => 14 */ - { 0, 1, 1, 0, 0, 1, 0, 1, 0, 1 }, /* 01000 => 15 */ - { 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 }, /* 11000 => 16 */ - { 0, 1, 0, 1, 0, 1, 0, 1, 1, 0 }, /* 00001 => All Units Off */ - { 0, 1, 0, 1, 0, 1, 1, 0, 1, 0 }, /* 00011 => All Units On */ - { 0, 1, 0, 1, 1, 0, 0, 1, 1, 0 }, /* 00101 => On */ - { 0, 1, 0, 1, 1, 0, 1, 0, 1, 0 }, /* 00111 => Off */ - { 0, 1, 1, 0, 0, 1, 0, 1, 1, 0 }, /* 01001 => Dim */ - { 0, 1, 1, 0, 0, 1, 1, 0, 1, 0 }, /* 01011 => Bright */ - { 0, 1, 1, 0, 1, 0, 0, 1, 1, 0 }, /* 01101 => All LIGHTS Off */ - { 0, 1, 1, 0, 1, 0, 1, 0, 1, 0 }, /* 01111 => Extended Code */ - { 1, 0, 0, 1, 0, 1, 0, 1, 1, 0 }, /* 10001 => Hail Request */ - { 1, 0, 0, 1, 0, 1, 1, 0, 1, 0 }, /* 10011 => Hail Acknowledge */ - { 1, 0, 0, 1, 1, 0, 0, 1, 1, 0 }, /* 10101 => Preset Dim 0 */ - { 1, 0, 0, 1, 1, 0, 1, 0, 1, 0 }, /* 10111 => Preset Dim 1 */ - { 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 }, /* 11000 => Extended Data (analog) */ - { 1, 0, 1, 0, 0, 1, 1, 0, 1, 0 }, /* 11011 => Status = on */ - { 1, 0, 1, 0, 1, 0, 0, 1, 1, 0 }, /* 11101 => Status = off */ - { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 } /* 11111 => Status request */ -}; - -/* - * Tables for mapping received X-10 code back to house/key number. - */ - -static short X10_HOUSE_INV[16] = { - 12, 4, 2, 10, 14, 6, 0, 8, - 13, 5, 3, 11, 15, 7, 1, 9 -}; - -static short X10_KEY_INV[32] = { - 12, 16, 4, 17, 2, 18, 10, 19, - 14, 20, 6, 21, 0, 22, 8, 23, - 13, 24, 5, 25, 3, 26, 11, 27, - 15, 28, 7, 29, 1, 30, 9, 31 -}; - -static char *X10_KEY_LABEL[32] = { - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "All Units Off", - "All Units On", - "On", - "Off", - "Dim", - "Bright", - "All LIGHTS Off", - "Extended Code", - "Hail Request", - "Hail Acknowledge", - "Preset Dim 0", - "Preset Dim 1", - "Extended Data (analog)", - "Status = on", - "Status = off", - "Status request" -}; -/* - * Transmit a packet containing house code h and key code k - */ - -#define TWRETRY 10 /* Try 10 times to sync with AC line */ - -static int -twsend(struct tw_sc *sc, int h, int k, int cnt) -{ - int i; - int port = sc->sc_port; - - /* - * Make sure we get a reliable sync with a power line zero crossing - */ - for(i = 0; i < TWRETRY; i++) { - if(wait_for_zero(sc) > 100) goto insync; - } - log(LOG_ERR, "TWXMIT: failed to sync.\n"); - return(-1); - - insync: - /* - * Be sure to leave 3 cycles space between transmissions - */ - for(i = 6; i > 0; i--) - if(next_zero(sc) < 0) return(-1); - /* - * The packet is transmitted cnt times, with no gaps. - */ - while(cnt--) { - /* - * Transmit the start code - */ - for(i = 0; i < X10_START_LENGTH; i++) { - outb(port+tw_data, X10_START[i] ? 0xff : 0x00); /* Waste no time! */ -#ifdef HIRESTIME - if(i == 0) twsetuptimes(sc->sc_xtimes); - if(twchecktime(sc->sc_xtimes[i], HALFCYCLE/20) == 0) { - outb(port+tw_data, 0); - return(-1); - } -#endif /* HIRESTIME */ - twdelayn(1000); /* 1ms pulse width */ - outb(port+tw_data, 0); - if(next_zero(sc) < 0) return(-1); - } - /* - * Transmit the house code - */ - for(i = 0; i < X10_HOUSE_LENGTH; i++) { - outb(port+tw_data, X10_HOUSE[h][i] ? 0xff : 0x00); /* Waste no time! */ -#ifdef HIRESTIME - if(twchecktime(sc->sc_xtimes[i+X10_START_LENGTH], HALFCYCLE/20) == 0) { - outb(port+tw_data, 0); - return(-1); - } -#endif /* HIRESTIME */ - twdelayn(1000); /* 1ms pulse width */ - outb(port+tw_data, 0); - if(next_zero(sc) < 0) return(-1); - } - /* - * Transmit the unit/key code - */ - for(i = 0; i < X10_KEY_LENGTH; i++) { - outb(port+tw_data, X10_KEY[k][i] ? 0xff : 0x00); -#ifdef HIRESTIME - if(twchecktime(sc->sc_xtimes[i+X10_START_LENGTH+X10_HOUSE_LENGTH], - HALFCYCLE/20) == 0) { - outb(port+tw_data, 0); - return(-1); - } -#endif /* HIRESTIME */ - twdelayn(1000); /* 1ms pulse width */ - outb(port+tw_data, 0); - if(next_zero(sc) < 0) return(-1); - } - } - return(0); -} - -/* - * Waste CPU cycles to get in sync with a power line zero crossing. - * The value returned is roughly how many microseconds we wasted before - * seeing the transition. To avoid wasting time forever, we give up after - * waiting patiently for 1/4 sec (15 power line cycles at 60 Hz), - * which is more than the 11 cycles it takes to transmit a full - * X-10 packet. - */ - -static int -wait_for_zero(struct tw_sc *sc) -{ - int i, old, new, max; - int port = sc->sc_port + tw_zcport; - - old = sc->sc_xphase; - max = 10000; /* 10000 * 25us = 0.25 sec */ - i = 0; - while(max--) { - new = inb(port) & tw_zcmask; - if(new != old) { - sc->sc_xphase = new; - return(i*25); - } - i++; - twdelay25(); - } - return(-1); -} - -/* - * Wait for the next zero crossing transition, and if we don't have - * high-resolution time-of-day, check to see that the zero crossing - * appears to be arriving on schedule. - * We expect to be waiting almost a full half-cycle (8.333ms-1ms = 7.333ms). - * If we don't seem to wait very long, something is wrong (like we got - * preempted!) and we should abort the transmission because - * there's no telling how long it's really been since the - * last bit was transmitted. - */ - -static int -next_zero(struct tw_sc *sc) -{ - int d; -#ifdef HIRESTIME - if((d = wait_for_zero(sc)) < 0) { -#else - if((d = wait_for_zero(sc)) < 6000 || d > 8500) { - /* No less than 6.0ms, no more than 8.5ms */ -#endif /* HIRESTIME */ - log(LOG_ERR, "TWXMIT framing error: %d\n", d); - return(-1); - } - return(0); -} - -/* - * Put a three-byte packet into the circular buffer - * Should be called from a critical section. - */ - -static int -twputpkt(struct tw_sc *sc, u_char *p) -{ - int i, next; - - for(i = 0; i < 3; i++) { - next = sc->sc_nextin+1; - if(next >= TW_SIZE) next = 0; - if(next == sc->sc_nextout) { /* Buffer full */ -/* - log(LOG_ERR, "TWRCV: Buffer overrun\n"); - */ - return(1); - } - sc->sc_buf[sc->sc_nextin] = *p++; - sc->sc_nextin = next; - } - if(sc->sc_state & TWS_WANT) { - sc->sc_state &= ~TWS_WANT; - wakeup((caddr_t)(&sc->sc_buf)); - } - KNOTE(&sc->sc_kqp.ki_note, 0); - return(0); -} - -/* - * Get bytes from the circular buffer - * Should be called from a critical section. - */ - -static int -twgetbytes(struct tw_sc *sc, u_char *p, int cnt) -{ - int error; - - while(cnt--) { - while(sc->sc_nextin == sc->sc_nextout) { /* Buffer empty */ - sc->sc_state |= TWS_WANT; - error = tsleep((caddr_t)(&sc->sc_buf), PCATCH, "twread", 0); - if(error) { - return(error); - } - } - *p++ = sc->sc_buf[sc->sc_nextout++]; - if(sc->sc_nextout >= TW_SIZE) sc->sc_nextout = 0; - } - return(0); -} - -/* - * Abort reception that has failed to complete in the required time. - */ - -static void -twabortrcv(void *arg) -{ - struct tw_sc *sc = arg; - u_char pkt[3]; - - crit_enter(); - sc->sc_state &= ~TWS_RCVING; - /* simply ignore single isolated interrupts. */ - if (sc->sc_no_rcv > 1) { - sc->sc_flags |= TW_RCV_ERROR; - pkt[0] = sc->sc_flags; - pkt[1] = pkt[2] = 0; - twputpkt(sc, pkt); - log(LOG_ERR, "TWRCV: aborting (%x, %d)\n", sc->sc_bits, sc->sc_rcount); - twdebugtimes(sc); - } - wakeup((caddr_t)sc); - crit_exit(); -} - -static int -tw_is_within(int value, int expected, int tolerance) -{ - int diff; - diff = value - expected; - if (diff < 0) - diff *= -1; - if (diff < tolerance) - return 1; - return 0; -} - -/* - * This routine handles interrupts that occur when there is a falling - * transition on the RX input. There isn't going to be a transition - * on every bit (some are zero), but if we are smart and keep track of - * how long it's been since the last interrupt (via the zero crossing - * detect line and/or high-resolution time-of-day routine), we can - * reconstruct the transmission without having to poll. - */ - -static void -twintr(void *arg) -{ - int unit = (int)arg; - struct tw_sc *sc = &tw_sc[unit]; - int port; - int newphase; - u_char pkt[3]; - int delay = 0; - struct timeval tv; - - port = sc->sc_port; - /* - * Ignore any interrupts that occur if the device is not open. - */ - if(sc->sc_state == 0) return; - newphase = inb(port + tw_zcport) & tw_zcmask; - microtime(&tv); - - /* - * NEW PACKET: - * If we aren't currently receiving a packet, set up a new packet - * and put in the first "1" bit that has just arrived. - * Arrange for the reception to be aborted if too much time goes by. - */ - if((sc->sc_state & TWS_RCVING) == 0) { -#ifdef HIRESTIME - twsetuptimes(sc->sc_rtimes); -#endif /* HIRESTIME */ - sc->sc_state |= TWS_RCVING; - sc->sc_rcount = 1; - if(sc->sc_state & TWS_XMITTING) sc->sc_flags = TW_RCV_LOCAL; - else sc->sc_flags = 0; - sc->sc_bits = 0; - sc->sc_rphase = newphase; - /* 3 cycles of silence = 3/60 = 1/20 = 50 msec */ - callout_reset(&sc->abortrcv_ch, hz / 20, twabortrcv, sc); - sc->sc_rcv_time[0] = tv.tv_usec; - sc->sc_no_rcv = 1; - return; - } - callout_reset(&sc->abortrcv_ch, hz / 20, twabortrcv, sc); - newphase = inb(port + tw_zcport) & tw_zcmask; - - /* enforce a minimum delay since the last interrupt */ - delay = tv.tv_usec - sc->sc_rcv_time[sc->sc_no_rcv - 1]; - if (delay < 0) - delay += 1000000; - if (delay < TW_MIN_DELAY) - return; - - sc->sc_rcv_time[sc->sc_no_rcv] = tv.tv_usec; - if (sc->sc_rcv_time[sc->sc_no_rcv] < sc->sc_rcv_time[0]) - sc->sc_rcv_time[sc->sc_no_rcv] += 1000000; - sc->sc_no_rcv++; - - /* - * START CODE: - * The second and third bits are a special case. - */ - if (sc->sc_rcount < 3) { - if ( -#ifdef HIRESTIME - tw_is_within(delay, HALFCYCLE, HALFCYCLE / 6) -#else - newphase != sc->sc_rphase -#endif - ) { - sc->sc_rcount++; - } else { - /* - * Invalid start code -- abort reception. - */ - sc->sc_state &= ~TWS_RCVING; - sc->sc_flags |= TW_RCV_ERROR; - callout_stop(&sc->abortrcv_ch); - log(LOG_ERR, "TWRCV: Invalid start code\n"); - twdebugtimes(sc); - sc->sc_no_rcv = 0; - return; - } - if(sc->sc_rcount == 3) { - /* - * We've gotten three "1" bits in a row. The start code - * is really 1110, but this might be followed by a zero - * bit from the house code, so if we wait any longer we - * might be confused about the first house code bit. - * So, we guess that the start code is correct and insert - * the trailing zero without actually having seen it. - * We don't change sc_rphase in this case, because two - * bit arrivals in a row preserve parity. - */ - sc->sc_rcount++; - return; - } - /* - * Update sc_rphase to the current phase before returning. - */ - sc->sc_rphase = newphase; - return; - } - /* - * GENERAL CASE: - * Now figure out what the current bit is that just arrived. - * The X-10 protocol transmits each data bit twice: once in - * true form and once in complemented form on the next half - * cycle. So, there will be at least one interrupt per bit. - * By comparing the phase we see at the time of the interrupt - * with the saved sc_rphase, we can tell on which half cycle - * the interrupt occrred. This assumes, of course, that the - * packet is well-formed. We do the best we can at trying to - * catch errors by aborting if too much time has gone by, and - * by tossing out a packet if too many bits arrive, but the - * whole scheme is probably not as robust as if we had a nice - * interrupt on every half cycle of the power line. - * If we have high-resolution time-of-day routines, then we - * can do a bit more sanity checking. - */ - - /* - * A complete packet is 22 half cycles. - */ - if(sc->sc_rcount <= 20) { -#ifdef HIRESTIME - int bit = 0, last_bit; - if (sc->sc_rcount == 4) - last_bit = 1; /* Start (1110) ends in 10, a 'one' code. */ - else - last_bit = sc->sc_bits & 0x1; - if ( ( (last_bit == 1) - && (tw_is_within(delay, HALFCYCLE * 2, HALFCYCLE / 6))) - || ( (last_bit == 0) - && (tw_is_within(delay, HALFCYCLE * 1, HALFCYCLE / 6)))) - bit = 1; - else if ( ( (last_bit == 1) - && (tw_is_within(delay, HALFCYCLE * 3, HALFCYCLE / 6))) - || ( (last_bit == 0) - && (tw_is_within(delay, HALFCYCLE * 2, HALFCYCLE / 6)))) - bit = 0; - else { - sc->sc_flags |= TW_RCV_ERROR; - log(LOG_ERR, "TWRCV: %d cycle after %d bit, delay %d%%\n", - sc->sc_rcount, last_bit, 100 * delay / HALFCYCLE); - } - sc->sc_bits = (sc->sc_bits << 1) | bit; -#else - sc->sc_bits = (sc->sc_bits << 1) - | ((newphase == sc->sc_rphase) ? 0x0 : 0x1); -#endif /* HIRESTIME */ - sc->sc_rcount += 2; - } - if(sc->sc_rcount >= 22 || sc->sc_flags & TW_RCV_ERROR) { - if(sc->sc_rcount != 22) { - sc->sc_flags |= TW_RCV_ERROR; - pkt[0] = sc->sc_flags; - pkt[1] = pkt[2] = 0; - } else { - pkt[0] = sc->sc_flags; - pkt[1] = X10_HOUSE_INV[(sc->sc_bits & 0x1e0) >> 5]; - pkt[2] = X10_KEY_INV[sc->sc_bits & 0x1f]; - } - sc->sc_state &= ~TWS_RCVING; - twputpkt(sc, pkt); - callout_stop(&sc->abortrcv_ch); - if(sc->sc_flags & TW_RCV_ERROR) { - log(LOG_ERR, "TWRCV: invalid packet: (%d, %x) %c %s\n", - sc->sc_rcount, sc->sc_bits, 'A' + pkt[1], X10_KEY_LABEL[pkt[2]]); - twdebugtimes(sc); - } else { -/* log(LOG_ERR, "TWRCV: valid packet: (%d, %x) %c %s\n", - sc->sc_rcount, sc->sc_bits, 'A' + pkt[1], X10_KEY_LABEL[pkt[2]]); */ - } - sc->sc_rcount = 0; - wakeup((caddr_t)sc); - } -} - -static void -twdebugtimes(struct tw_sc *sc) -{ - int i; - for (i = 0; (i < sc->sc_no_rcv) && (i < SC_RCV_TIME_LEN); i++) - log(LOG_ERR, "TWRCV: interrupt %2d: %d\t%d%%\n", i, sc->sc_rcv_time[i], - (sc->sc_rcv_time[i] - sc->sc_rcv_time[(i?i-1:0)])*100/HALFCYCLE); -} - -#ifdef HIRESTIME -/* - * Initialize an array of 22 times, starting from the current - * microtime and continuing for the next 21 half cycles. - * We use the times as a reference to make sure transmission - * or reception is on schedule. - */ - -static void -twsetuptimes(int *a) -{ - struct timeval tv; - int i, t; - - microtime(&tv); - t = tv.tv_usec; - for(i = 0; i < 22; i++) { - *a++ = t; - t += HALFCYCLE; - if(t >= 1000000) t -= 1000000; - } -} - -/* - * Check the current time against a slot in a previously set up - * timing array, and make sure that it looks like we are still - * on schedule. - */ - -static int -twchecktime(int target, int tol) -{ - struct timeval tv; - int t, d; - - microtime(&tv); - t = tv.tv_usec; - d = (target - t) >= 0 ? (target - t) : (t - target); - if(d > 500000) d = 1000000-d; - if(d <= tol && d >= -tol) { - return(1); - } else { - return(0); - } -} -#endif /* HIRESTIME */ diff --git a/sys/dev/netif/el/if_el.c b/sys/dev/netif/el/if_el.c deleted file mode 100644 index 879bce24d0..0000000000 --- a/sys/dev/netif/el/if_el.c +++ /dev/null @@ -1,611 +0,0 @@ -/* Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted - * to use, copy, modify and distribute this software provided that both - * the copyright notice and this permission notice appear in all copies - * of the software, derivative works or modified versions, and any - * portions thereof. - * - * Questions, comments, bug reports and fixes to kimmel@cs.umass.edu. - * - * $FreeBSD: src/sys/i386/isa/if_el.c,v 1.47.2.2 2000/07/17 21:24:30 archie Exp $ - * $DragonFly: src/sys/dev/netif/el/if_el.c,v 1.24 2008/09/07 07:48:29 swildner Exp $ - */ -/* Except of course for the portions of code lifted from other FreeBSD - * drivers (mainly elread, elget and el_ioctl) - */ -/* 3COM Etherlink 3C501 device driver for FreeBSD */ -/* Yeah, I know these cards suck, but you can also get them for free - * really easily... - */ -/* Bugs/possible improvements: - * - Does not currently support DMA - * - Does not currently support multicasts - */ -#include "use_el.h" -#include "opt_inet.h" -#include "opt_ipx.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include - -#include - -#include -#include "if_elreg.h" - -DECLARE_DUMMY_MODULE(if_el); - -/* For debugging convenience */ -#ifdef EL_DEBUG -#define dprintf(x) kprintf x -#else -#define dprintf(x) -#endif - -/* el_softc: per line info and status */ -static struct el_softc { - struct arpcom arpcom; /* Ethernet common */ - u_short el_base; /* Base I/O addr */ - char el_pktbuf[EL_BUFSIZ]; /* Frame buffer */ -} el_softc[NEL]; - -/* Prototypes */ -static int el_attach(struct isa_device *); -static void el_init(void *); -static int el_ioctl(struct ifnet *, u_long, caddr_t, struct ucred *); -static int el_probe(struct isa_device *); -static void el_start(struct ifnet *); -static void el_reset(void *); -static void el_watchdog(struct ifnet *); - -static void el_stop(void *); -static int el_xmit(struct el_softc *,int); -static void elintr(void *); -static __inline void elread(struct el_softc *,caddr_t,int); -static struct mbuf *elget(caddr_t,int,struct ifnet *); -static __inline void el_hardreset(void *); - -/* isa_driver structure for autoconf */ -struct isa_driver eldriver = { - el_probe, el_attach, "el" -}; - -static struct lwkt_serialize el_serializer; - -/* Probe routine. See if the card is there and at the right place. */ -static int -el_probe(struct isa_device *idev) -{ - struct el_softc *sc; - u_short base; /* Just for convenience */ - u_char station_addr[ETHER_ADDR_LEN]; - int i; - - lwkt_serialize_init(&el_serializer); - - /* Grab some info for our structure */ - sc = &el_softc[idev->id_unit]; - sc->el_base = idev->id_iobase; - base = sc->el_base; - - /* First check the base */ - if((base < 0x280) || (base > 0x3f0)) { - kprintf("el%d: ioaddr must be between 0x280 and 0x3f0\n", - idev->id_unit); - return(0); - } - - /* Now attempt to grab the station address from the PROM - * and see if it contains the 3com vendor code. - */ - dprintf(("Probing 3c501 at 0x%x...\n",base)); - - /* Reset the board */ - dprintf(("Resetting board...\n")); - outb(base+EL_AC,EL_AC_RESET); - DELAY(5); - outb(base+EL_AC,0); - dprintf(("Reading station address...\n")); - /* Now read the address */ - for(i=0;iarpcom.ac_enaddr,ETHER_ADDR_LEN); - return(1); - } -} - -/* Do a hardware reset of the 3c501. Do not call until after el_probe()! */ -static __inline void -el_hardreset(void *xsc) -{ - struct el_softc *sc = xsc; - int base; - int j; - - base = sc->el_base; - - /* First reset the board */ - outb(base+EL_AC,EL_AC_RESET); - DELAY(5); - outb(base+EL_AC,0); - - /* Then give it back its ethernet address. Thanks to the mach - * source code for this undocumented goodie... - */ - for(j=0;jarpcom.ac_enaddr[j]); -} - -/* Attach the interface to the kernel data structures. By the time - * this is called, we know that the card exists at the given I/O address. - * We still assume that the IRQ given is correct. - */ -static int -el_attach(struct isa_device *idev) -{ - struct el_softc *sc; - struct ifnet *ifp; - - dprintf(("Attaching el%d...\n",idev->id_unit)); - - /* Get things pointing to the right places. */ - idev->id_intr = (inthand2_t *)elintr; - sc = &el_softc[idev->id_unit]; - ifp = &sc->arpcom.ac_if; - - /* Now reset the board */ - dprintf(("Resetting board...\n")); - el_hardreset(sc); - - /* Initialize ifnet structure */ - ifp->if_softc = sc; - if_initname(ifp, "el", idev->id_unit); - ifp->if_mtu = ETHERMTU; - ifp->if_start = el_start; - ifp->if_ioctl = el_ioctl; - ifp->if_watchdog = el_watchdog; - ifp->if_init = el_init; - ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX); - ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN); - ifq_set_ready(&ifp->if_snd); - - /* Now we can attach the interface */ - dprintf(("Attaching interface...\n")); - ether_ifattach(ifp, sc->arpcom.ac_enaddr, &el_serializer); - - dprintf(("el_attach() finished.\n")); - return(1); -} - -/* This routine resets the interface. */ -static void -el_reset(void *xsc) -{ - struct el_softc *sc = xsc; - - dprintf(("elreset()\n")); - el_stop(sc); - el_init(sc); -} - -static void -el_stop(void *xsc) -{ - struct el_softc *sc = xsc; - - outb(sc->el_base+EL_AC,0); -} - -/* Initialize interface. */ -static void -el_init(void *xsc) -{ - struct el_softc *sc = xsc; - struct ifnet *ifp = &sc->arpcom.ac_if; - u_short base = sc->el_base; - - - /* First, reset the board. */ - dprintf(("Resetting board...\n")); - el_hardreset(sc); - - /* Configure rx */ - dprintf(("Configuring rx...\n")); - if(ifp->if_flags & IFF_PROMISC) - outb(base+EL_RXC,(EL_RXC_PROMISC|EL_RXC_AGF|EL_RXC_DSHORT|EL_RXC_DDRIB|EL_RXC_DOFLOW)); - else - outb(base+EL_RXC,(EL_RXC_ABROAD|EL_RXC_AGF|EL_RXC_DSHORT|EL_RXC_DDRIB|EL_RXC_DOFLOW)); - outb(base+EL_RBC,0); - - /* Configure TX */ - dprintf(("Configuring tx...\n")); - outb(base+EL_TXC,0); - - /* Start reception */ - dprintf(("Starting reception...\n")); - outb(base+EL_AC,(EL_AC_IRQE|EL_AC_RX)); - - /* Set flags appropriately */ - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; - - /* And start output. */ - el_start(ifp); -} - -/* Start output on interface. Get datagrams from the queue and output - * them, giving the receiver a chance between datagrams. Call only - * from splimp or interrupt level! - */ -static void -el_start(struct ifnet *ifp) -{ - struct el_softc *sc; - u_short base; - struct mbuf *m, *m0; - int i, len, retries, done; - - /* Get things pointing in the right directions */ - sc = ifp->if_softc; - base = sc->el_base; - - dprintf(("el_start()...\n")); - - /* Don't do anything if output is active */ - if (ifp->if_flags & IFF_OACTIVE) - return; - ifp->if_flags |= IFF_OACTIVE; - - /* The main loop. They warned me against endless loops, but - * would I listen? NOOO.... - */ - while(1) { - /* Dequeue the next datagram */ - m0 = ifq_dequeue(&ifp->if_snd, NULL); - - /* If there's nothing to send, return. */ - if(m0 == NULL) { - sc->arpcom.ac_if.if_flags &= ~IFF_OACTIVE; - return; - } - - /* Disable the receiver */ - outb(base+EL_AC,EL_AC_HOST); - outb(base+EL_RBC,0); - - /* Copy the datagram to the buffer. */ - len = 0; - for(m = m0; m != NULL; m = m->m_next) { - if(m->m_len == 0) - continue; - bcopy(mtod(m,caddr_t),sc->el_pktbuf+len,m->m_len); - len += m->m_len; - } - m_freem(m0); - - len = max(len,ETHER_MIN_LEN); - - BPF_TAP(&sc->arpcom.ac_if, sc->el_pktbuf, len); - - /* Transfer datagram to board */ - dprintf(("el: xfr pkt length=%d...\n",len)); - i = EL_BUFSIZ - len; - outb(base+EL_GPBL,(i & 0xff)); - outb(base+EL_GPBH,((i>>8)&0xff)); - outsb(base+EL_BUF,sc->el_pktbuf,len); - - /* Now transmit the datagram */ - retries=0; - done=0; - while(!done) { - if(el_xmit(sc,len)) { /* Something went wrong */ - done = -1; - break; - } - /* Check out status */ - i = inb(base+EL_TXS); - dprintf(("tx status=0x%x\n",i)); - if(!(i & EL_TXS_READY)) { - dprintf(("el: err txs=%x\n",i)); - sc->arpcom.ac_if.if_oerrors++; - if(i & (EL_TXS_COLL|EL_TXS_COLL16)) { - if((!(i & EL_TXC_DCOLL16)) && retries < 15) { - retries++; - outb(base+EL_AC,EL_AC_HOST); - } - } - else - done = 1; - } - else { - sc->arpcom.ac_if.if_opackets++; - done = 1; - } - } - if(done == -1) /* Packet not transmitted */ - continue; - - /* Now give the card a chance to receive. - * Gotta love 3c501s... - */ - inb(base+EL_AS); - outb(base+EL_AC,(EL_AC_IRQE|EL_AC_RX)); - } -} - -/* This function actually attempts to transmit a datagram downloaded - * to the board. Call at splimp or interrupt, after downloading data! - * Returns 0 on success, non-0 on failure - */ -static int -el_xmit(struct el_softc *sc,int len) -{ - int gpl; - int i; - - gpl = EL_BUFSIZ - len; - dprintf(("el: xmit...")); - outb((sc->el_base)+EL_GPBL,(gpl & 0xff)); - outb((sc->el_base)+EL_GPBH,((gpl>>8)&0xff)); - outb((sc->el_base)+EL_AC,EL_AC_TXFRX); - i = 20000; - while((inb((sc->el_base)+EL_AS) & EL_AS_TXBUSY) && (i>0)) - i--; - if(i == 0) { - dprintf(("tx not ready\n")); - sc->arpcom.ac_if.if_oerrors++; - return(-1); - } - dprintf(("%d cycles.\n",(20000-i))); - return(0); -} - -/* Pass a packet up to the higher levels. */ -static __inline void -elread(struct el_softc *sc,caddr_t buf,int len) -{ - struct mbuf *m; - - /* - * Put packet into an mbuf chain - */ - m = elget(buf,len,&sc->arpcom.ac_if); - if(m) - sc->arpcom.ac_if.if_input(&sc->arpcom.ac_if, m); -} - -/* controller interrupt */ -static void -elintr(void *arg) -{ - int unit = (int)arg; - struct el_softc *sc; - int base; - int stat, rxstat, len, done; - - lwkt_serialize_enter(&el_serializer); - - /* Get things pointing properly */ - sc = &el_softc[unit]; - base = sc->el_base; - - dprintf(("elintr: ")); - - /* Check board status */ - stat = inb(base+EL_AS); - if(stat & EL_AS_RXBUSY) { - inb(base+EL_RXC); - outb(base+EL_AC,(EL_AC_IRQE|EL_AC_RX)); - lwkt_serialize_exit(&el_serializer); - return; - } - - done = 0; - while(!done) { - rxstat = inb(base+EL_RXS); - if(rxstat & EL_RXS_STALE) { - inb(base+EL_RXC); - outb(base+EL_AC,(EL_AC_IRQE|EL_AC_RX)); - lwkt_serialize_exit(&el_serializer); - return; - } - - /* If there's an overflow, reinit the board. */ - if(!(rxstat & EL_RXS_NOFLOW)) { - dprintf(("overflow.\n")); - el_hardreset(sc); - /* Put board back into receive mode */ - if(sc->arpcom.ac_if.if_flags & IFF_PROMISC) - outb(base+EL_RXC,(EL_RXC_PROMISC|EL_RXC_AGF|EL_RXC_DSHORT|EL_RXC_DDRIB|EL_RXC_DOFLOW)); - else - outb(base+EL_RXC,(EL_RXC_ABROAD|EL_RXC_AGF|EL_RXC_DSHORT|EL_RXC_DDRIB|EL_RXC_DOFLOW)); - inb(base+EL_AS); - outb(base+EL_RBC,0); - inb(base+EL_RXC); - outb(base+EL_AC,(EL_AC_IRQE|EL_AC_RX)); - lwkt_serialize_exit(&el_serializer); - return; - } - - /* Incoming packet */ - len = inb(base+EL_RBL); - len |= inb(base+EL_RBH) << 8; - dprintf(("receive len=%d rxstat=%x ",len,rxstat)); - outb(base+EL_AC,EL_AC_HOST); - - /* If packet too short or too long, restore rx mode and return - */ - if((len <= sizeof(struct ether_header)) || (len > ETHER_MAX_LEN)) { - if(sc->arpcom.ac_if.if_flags & IFF_PROMISC) - outb(base+EL_RXC,(EL_RXC_PROMISC|EL_RXC_AGF|EL_RXC_DSHORT|EL_RXC_DDRIB|EL_RXC_DOFLOW)); - else - outb(base+EL_RXC,(EL_RXC_ABROAD|EL_RXC_AGF|EL_RXC_DSHORT|EL_RXC_DDRIB|EL_RXC_DOFLOW)); - inb(base+EL_AS); - outb(base+EL_RBC,0); - inb(base+EL_RXC); - outb(base+EL_AC,(EL_AC_IRQE|EL_AC_RX)); - lwkt_serialize_exit(&el_serializer); - return; - } - - sc->arpcom.ac_if.if_ipackets++; - - /* Copy the data into our buffer */ - outb(base+EL_GPBL,0); - outb(base+EL_GPBH,0); - insb(base+EL_BUF,sc->el_pktbuf,len); - outb(base+EL_RBC,0); - outb(base+EL_AC,EL_AC_RX); - dprintf(("%6D-->",sc->el_pktbuf+6,":")); - dprintf(("%6D\n",sc->el_pktbuf,":")); - - /* Pass data up to upper levels */ - elread(sc,(caddr_t)(sc->el_pktbuf),len); - - /* Is there another packet? */ - stat = inb(base+EL_AS); - - /* If so, do it all again (i.e. don't set done to 1) */ - if(!(stat & EL_AS_RXBUSY)) - dprintf((" ")); - else - done = 1; - } - - inb(base+EL_RXC); - outb(base+EL_AC,(EL_AC_IRQE|EL_AC_RX)); - lwkt_serialize_exit(&el_serializer); -} - -/* - * Pull read data off a interface. - * Len is length of data, with local net header stripped. - */ -static struct mbuf * -elget(caddr_t buf, int totlen, struct ifnet *ifp) -{ - struct mbuf *top, **mp, *m; - int len; - caddr_t cp; - char *epkt; - - cp = buf; - epkt = cp + totlen; - - MGETHDR(m, MB_DONTWAIT, MT_DATA); - if (m == 0) - return (0); - m->m_pkthdr.len = totlen; - m->m_len = MHLEN; - top = 0; - mp = ⊤ - while (totlen > 0) { - if (top) { - MGET(m, MB_DONTWAIT, MT_DATA); - if (m == 0) { - m_freem(top); - return (0); - } - m->m_len = MLEN; - } - len = min(totlen, epkt - cp); - if (len >= MINCLSIZE) { - MCLGET(m, MB_DONTWAIT); - if (m->m_flags & M_EXT) - m->m_len = len = min(len, MCLBYTES); - else - len = m->m_len; - } else { - /* - * Place initial small packet/header at end of mbuf. - */ - if (len < m->m_len) { - if (top == 0 && len + max_linkhdr <= m->m_len) - m->m_data += max_linkhdr; - m->m_len = len; - } else - len = m->m_len; - } - bcopy(cp, mtod(m, caddr_t), (unsigned)len); - cp += len; - *mp = m; - mp = &m->m_next; - totlen -= len; - if (cp == epkt) - cp = buf; - } - return (top); -} - -/* - * Process an ioctl request. This code needs some work - it looks - * pretty ugly. - */ -static int -el_ioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) -{ - int error = 0; - - switch (command) { - case SIOCSIFFLAGS: - /* - * If interface is marked down and it is running, then stop it - */ - if (((ifp->if_flags & IFF_UP) == 0) && - (ifp->if_flags & IFF_RUNNING)) { - el_stop(ifp->if_softc); - ifp->if_flags &= ~IFF_RUNNING; - } else { - /* - * If interface is marked up and it is stopped, then start it - */ - if ((ifp->if_flags & IFF_UP) && - ((ifp->if_flags & IFF_RUNNING) == 0)) - el_init(ifp->if_softc); - } - break; - default: - error = ether_ioctl(ifp, command, data); - break; - } - return (error); -} - -/* Device timeout routine */ -static void -el_watchdog(struct ifnet *ifp) -{ - log(LOG_ERR,"%s: device timeout\n", ifp->if_xname); - ifp->if_oerrors++; - el_reset(ifp->if_softc); -} diff --git a/sys/dev/netif/el/if_elreg.h b/sys/dev/netif/el/if_elreg.h deleted file mode 100644 index e6e3575e01..0000000000 --- a/sys/dev/netif/el/if_elreg.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted - * to use, copy, modify and distribute this software provided that both - * the copyright notice and this permission notice appear in all copies - * of the software, derivative works or modified versions, and any - * portions thereof. - * - * $FreeBSD: src/sys/i386/isa/if_elreg.h,v 1.7 1999/08/28 00:44:45 peter Exp $ - * $DragonFly: src/sys/dev/netif/el/if_elreg.h,v 1.2 2003/06/17 04:28:37 dillon Exp $ - */ -/* 3COM Etherlink 3C501 Register Definitions */ - -/* I/O Ports */ -#define EL_RXS 0x6 /* Receive status register */ -#define EL_RXC 0x6 /* Receive command register */ -#define EL_TXS 0x7 /* Transmit status register */ -#define EL_TXC 0x7 /* Transmit command register */ -#define EL_GPBL 0x8 /* GP buffer ptr low byte */ -#define EL_GPBH 0x9 /* GP buffer ptr high byte */ -#define EL_RBL 0xa /* Receive buffer ptr low byte */ -#define EL_RBC 0xa /* Receive buffer clear */ -#define EL_RBH 0xb /* Receive buffer ptr high byte */ -#define EL_EAW 0xc /* Ethernet address window */ -#define EL_AS 0xe /* Auxiliary status register */ -#define EL_AC 0xe /* Auxiliary command register */ -#define EL_BUF 0xf /* Data buffer */ - -/* Receive status register bits */ -#define EL_RXS_OFLOW 0x01 /* Overflow error */ -#define EL_RXS_FCS 0x02 /* FCS error */ -#define EL_RXS_DRIB 0x04 /* Dribble error */ -#define EL_RXS_SHORT 0x08 /* Short frame */ -#define EL_RXS_NOFLOW 0x10 /* No overflow */ -#define EL_RXS_GOOD 0x20 /* Received good frame */ -#define EL_RXS_STALE 0x80 /* Stale receive status */ - -/* Receive command register bits */ -#define EL_RXC_DISABLE 0x00 /* Receiver disabled */ -#define EL_RXC_DOFLOW 0x01 /* Detect overflow */ -#define EL_RXC_DFCS 0x02 /* Detect FCS errs */ -#define EL_RXC_DDRIB 0x04 /* Detect dribble errors */ -#define EL_RXC_DSHORT 0x08 /* Detect short frames */ -#define EL_RXC_DNOFLOW 0x10 /* Detect frames w/o overflow ??? */ -#define EL_RXC_AGF 0x20 /* Accept Good Frames */ -#define EL_RXC_PROMISC 0x40 /* Promiscuous mode */ -#define EL_RXC_ABROAD 0x80 /* Accept address, broadcast */ -#define EL_RXC_AMULTI 0xc0 /* Accept address, multicast */ - -/* Transmit status register bits */ -#define EL_TXS_UFLOW 0x01 /* Underflow */ -#define EL_TXS_COLL 0x02 /* Collision */ -#define EL_TXS_COLL16 0x04 /* Collision 16 */ -#define EL_TXS_READY 0x08 /* Ready for new frame */ - -/* Transmit command register bits */ -#define EL_TXC_DUFLOW 0x01 /* Detect underflow */ -#define EL_TXC_DCOLL 0x02 /* Detect collisions */ -#define EL_TXC_DCOLL16 0x04 /* Detect collision 16 */ -#define EL_TXC_DSUCCESS 0x08 /* Detect success */ - -/* Auxiliary status register bits */ -#define EL_AS_RXBUSY 0x01 /* Receive busy */ -#define EL_AS_DMADONE 0x10 /* DMA finished */ -#define EL_AS_TXBUSY 0x80 /* Transmit busy */ - -/* Auxiliary command register bits */ -#define EL_AC_HOST 0x00 /* System bus can access buffer */ -#define EL_AC_IRQE 0x01 /* IRQ enable */ -#define EL_AC_TXBAD 0x02 /* Transmit frames with bad FCS */ -#define EL_AC_TXFRX 0x04 /* Transmit followed by receive */ -#define EL_AC_RX 0x08 /* Receive */ -#define EL_AC_LB 0x0c /* Loopback */ -#define EL_AC_DRQ 0x20 /* DMA request */ -#define EL_AC_RIDE 0x40 /* DRQ and IRQ enabled */ -#define EL_AC_RESET 0x80 /* Reset */ - -/* Packet buffer size */ -#define EL_BUFSIZ 2048 diff --git a/sys/dev/netif/ie/Makefile b/sys/dev/netif/ie/Makefile deleted file mode 100644 index 5f6d49dd5a..0000000000 --- a/sys/dev/netif/ie/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# $FreeBSD: src/sys/modules/rl/Makefile,v 1.6 2000/01/28 11:26:34 bde Exp $ -# $DragonFly: src/sys/dev/netif/ie/Makefile,v 1.4 2006/06/25 11:02:38 corecode Exp $ - -KMOD= if_ie -SRCS= if_ie.c -SRCS+= use_ie.h opt_inet.h opt_ipx.h - -use_ie.h: - echo "#define NIE 1" > ${.TARGET} - -.if !defined(BUILDING_WITH_KERNEL) -opt_inet.h: - echo "#define INET 1" > ${.TARGET} - -opt_ipx.h: - echo "" > ${.TARGET} -.endif - -.include - diff --git a/sys/dev/netif/ie/if_ie.c b/sys/dev/netif/ie/if_ie.c deleted file mode 100644 index 00bf1a34f5..0000000000 --- a/sys/dev/netif/ie/if_ie.c +++ /dev/null @@ -1,2171 +0,0 @@ -/*- - * Copyright (c) 1992, 1993, University of Vermont and State - * Agricultural College. - * Copyright (c) 1992, 1993, Garrett A. Wollman. - * - * Portions: - * Copyright (c) 1990, 1991, William F. Jolitz - * Copyright (c) 1990, The Regents of the University of California - * - * 3Com 3C507 support: - * Copyright (c) 1993, 1994, Charles M. Hannum - * - * EtherExpress 16 support: - * Copyright (c) 1993, 1994, 1995, Rodney W. Grimes - * Copyright (c) 1997, Aaron C. Smith - * - * 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 the University of - * Vermont and State Agricultural College and Garrett A. Wollman, by - * William F. Jolitz, by the University of California, Berkeley, - * Lawrence Berkeley Laboratory, and their contributors, by - * Charles M. Hannum, by Rodney W. Grimes, and by Aaron C. Smith. - * 4. Neither the names of the Universities nor the names of the authors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 UNIVERSITY OR AUTHORS 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: src/sys/dev/ie/if_ie.c,v 1.72.2.4 2003/03/27 21:01:49 mdodd Exp $ - */ - -/* - * Intel 82586 Ethernet chip - * Register, bit, and structure definitions. - * - * Written by GAW with reference to the Clarkson Packet Driver code for this - * chip written by Russ Nelson and others. - * - * Intel EtherExpress 16 support from if_ix.c, written by Rodney W. Grimes. - */ - -/* - * The i82586 is a very versatile chip, found in many implementations. - * Programming this chip is mostly the same, but certain details differ - * from card to card. This driver is written so that different cards - * can be automatically detected at run-time. - */ - -/* -Mode of operation: - -We run the 82586 in a standard Ethernet mode. We keep NFRAMES received -frame descriptors around for the receiver to use, and NRXBUFS associated -receive buffer descriptors, both in a circular list. Whenever a frame is -received, we rotate both lists as necessary. (The 586 treats both lists -as a simple queue.) We also keep a transmit command around so that packets -can be sent off quickly. - -We configure the adapter in AL-LOC = 1 mode, which means that the -Ethernet/802.3 MAC header is placed at the beginning of the receive buffer -rather than being split off into various fields in the RFD. This also -means that we must include this header in the transmit buffer as well. - -By convention, all transmit commands, and only transmit commands, shall -have the I (IE_CMD_INTR) bit set in the command. This way, when an -interrupt arrives at ieintr(), it is immediately possible to tell -what precisely caused it. ANY OTHER command-sending routines should -run at splimp(), and should post an acknowledgement to every interrupt -they generate. - -The 82586 has a 24-bit address space internally, and the adaptor's memory -is located at the top of this region. However, the value we are given in -configuration is normally the *bottom* of the adaptor RAM. So, we must go -through a few gyrations to come up with a kernel virtual address which -represents the actual beginning of the 586 address space. First, we -autosize the RAM by running through several possible sizes and trying to -initialize the adapter under the assumption that the selected size is -correct. Then, knowing the correct RAM size, we set up our pointers in -ie_softc[unit]. `iomem' represents the computed base of the 586 address -space. `iomembot' represents the actual configured base of adapter RAM. -Finally, `iosize' represents the calculated size of 586 RAM. Then, when -laying out commands, we use the interval [iomembot, iomembot + iosize); to -make 24-pointers, we subtract iomem, and to make 16-pointers, we subtract -iomem and and with 0xffff. - -*/ - -#include "use_ie.h" -#include "opt_inet.h" -#include "opt_ipx.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include "if_iereg.h" -#include "if_ie507.h" -#include "if_iee16.h" -#include "../elink_layer/elink.h" - -#include - -#ifdef DEBUG -#define IED_RINT 0x01 -#define IED_TINT 0x02 -#define IED_RNR 0x04 -#define IED_CNA 0x08 -#define IED_READFRAME 0x10 -static int ie_debug = IED_RNR; - -#endif - -DECLARE_DUMMY_MODULE(if_ie); - -#define IE_BUF_LEN ETHER_MAX_LEN /* length of transmit buffer */ - -/* Forward declaration */ -struct ie_softc; - -static int ieprobe(struct isa_device * dvp); -static int ieattach(struct isa_device * dvp); -static void ieintr(void *); -static int sl_probe(struct isa_device * dvp); -static int el_probe(struct isa_device * dvp); -static int ni_probe(struct isa_device * dvp); -static int ee16_probe(struct isa_device * dvp); - -static int check_ie_present(int unit, caddr_t where, unsigned size); -static void ieinit(void *); -static void ie_stop(int unit); -static int ieioctl(struct ifnet * ifp, u_long command, caddr_t data, - struct ucred *); -static void iestart(struct ifnet * ifp); - -static void el_reset_586(int unit); -static void el_chan_attn(int unit); - -static void sl_reset_586(int unit); -static void sl_chan_attn(int unit); - -static void ee16_reset_586(int unit); -static void ee16_chan_attn(int unit); -static __inline void ee16_interrupt_enable(struct ie_softc * ie); -static void ee16_eeprom_outbits(struct ie_softc * ie, int edata, int cnt); -static void ee16_eeprom_clock(struct ie_softc * ie, int state); -static u_short ee16_read_eeprom(struct ie_softc * ie, int location); -static int ee16_eeprom_inbits(struct ie_softc * ie); -static void ee16_shutdown(void *sc, int howto); - -static void iereset(int unit); -static void ie_readframe(int unit, struct ie_softc * ie, int bufno); -static void ie_drop_packet_buffer(int unit, struct ie_softc * ie); -static void sl_read_ether(int unit, unsigned char addr[6]); -static void find_ie_mem_size(int unit); -static int command_and_wait(int unit, int command, - void volatile * pcmd, int); -static void run_tdr(int unit, volatile struct ie_tdr_cmd * cmd); -static int ierint(int unit, struct ie_softc * ie); -static int ietint(int unit, struct ie_softc * ie); -static int iernr(int unit, struct ie_softc * ie); -static void start_receiver(int unit); -static __inline int ieget(int, struct ie_softc *, struct mbuf **); -static v_caddr_t setup_rfa(v_caddr_t ptr, struct ie_softc * ie); -static int mc_setup(int, v_caddr_t, volatile struct ie_sys_ctl_block *); -static void ie_mc_reset(int unit); - -#ifdef DEBUG -static void print_rbd(volatile struct ie_recv_buf_desc * rbd); - -static int in_ierint = 0; -static int in_ietint = 0; - -#endif - -/* - * This tells the autoconf code how to set us up. - */ -struct isa_driver iedriver = { - ieprobe, ieattach, "ie", -}; - -enum ie_hardware { - IE_STARLAN10, - IE_EN100, - IE_SLFIBER, - IE_3C507, - IE_NI5210, - IE_EE16, - IE_UNKNOWN -}; - -static const char *ie_hardware_names[] = { - "StarLAN 10", - "EN100", - "StarLAN Fiber", - "3C507", - "NI5210", - "EtherExpress 16", - "Unknown" -}; - -/* -sizeof(iscp) == 1+1+2+4 == 8 -sizeof(scb) == 2+2+2+2+2+2+2+2 == 16 -NFRAMES * sizeof(rfd) == NFRAMES*(2+2+2+2+6+6+2+2) == NFRAMES*24 == 384 -sizeof(xmit_cmd) == 2+2+2+2+6+2 == 18 -sizeof(transmit buffer) == 1512 -sizeof(transmit buffer desc) == 8 ------ -1946 - -NRXBUFS * sizeof(rbd) == NRXBUFS*(2+2+4+2+2) == NRXBUFS*12 -NRXBUFS * IE_RBUF_SIZE == NRXBUFS*256 - -NRXBUFS should be (16384 - 1946) / (256 + 12) == 14438 / 268 == 53 - -With NRXBUFS == 48, this leaves us 1574 bytes for another command or -more buffers. Another transmit command would be 18+8+1512 == 1538 ----just barely fits! - -Obviously all these would have to be reduced for smaller memory sizes. -With a larger memory, it would be possible to roughly double the number of -both transmit and receive buffers. -*/ - -#define NFRAMES 8 /* number of receive frames */ -#define NRXBUFS 48 /* number of buffers to allocate */ -#define IE_RBUF_SIZE 256 /* size of each buffer, MUST BE POWER OF TWO */ -#define NTXBUFS 2 /* number of transmit commands */ -#define IE_TBUF_SIZE ETHER_MAX_LEN /* size of transmit buffer */ - -/* - * Ethernet status, per interface. - */ -static struct ie_softc { - struct arpcom arpcom; - void (*ie_reset_586) (int); - void (*ie_chan_attn) (int); - enum ie_hardware hard_type; - int hard_vers; - int unit; - - u_short port; /* i/o base address for this interface */ - caddr_t iomem; /* memory size */ - caddr_t iomembot; /* memory base address */ - unsigned iosize; - int bus_use; /* 0 means 16bit, 1 means 8 bit adapter */ - - int want_mcsetup; - int promisc; - int nframes; - int nrxbufs; - int ntxbufs; - volatile struct ie_int_sys_conf_ptr *iscp; - volatile struct ie_sys_ctl_block *scb; - volatile struct ie_recv_frame_desc **rframes; /* nframes worth */ - volatile struct ie_recv_buf_desc **rbuffs; /* nrxbufs worth */ - volatile u_char **cbuffs; /* nrxbufs worth */ - int rfhead, rftail, rbhead, rbtail; - - volatile struct ie_xmit_cmd **xmit_cmds; /* ntxbufs worth */ - volatile struct ie_xmit_buf **xmit_buffs; /* ntxbufs worth */ - volatile u_char **xmit_cbuffs; /* ntxbufs worth */ - int xmit_count; - - struct ie_en_addr mcast_addrs[MAXMCAST + 1]; - int mcast_count; - - u_short irq_encoded; /* encoded interrupt on IEE16 */ -} ie_softc[NIE]; - -#define MK_24(base, ptr) ((caddr_t)((uintptr_t)ptr - (uintptr_t)base)) -#define MK_16(base, ptr) ((u_short)(uintptr_t)MK_24(base, ptr)) - -#define PORT ie_softc[unit].port -#define MEM ie_softc[unit].iomem - -int -ieprobe(struct isa_device *dvp) -{ - int ret; - - ret = sl_probe(dvp); - if (!ret) - ret = el_probe(dvp); - if (!ret) - ret = ni_probe(dvp); - if (!ret) - ret = ee16_probe(dvp); - - return (ret); -} - -static int -sl_probe(struct isa_device *dvp) -{ - int unit = dvp->id_unit; - u_char c; - - ie_softc[unit].port = dvp->id_iobase; - ie_softc[unit].iomembot = dvp->id_maddr; - ie_softc[unit].iomem = 0; - ie_softc[unit].bus_use = 0; - - c = inb(PORT + IEATT_REVISION); - switch (SL_BOARD(c)) { - case SL10_BOARD: - ie_softc[unit].hard_type = IE_STARLAN10; - ie_softc[unit].ie_reset_586 = sl_reset_586; - ie_softc[unit].ie_chan_attn = sl_chan_attn; - break; - case EN100_BOARD: - ie_softc[unit].hard_type = IE_EN100; - ie_softc[unit].ie_reset_586 = sl_reset_586; - ie_softc[unit].ie_chan_attn = sl_chan_attn; - break; - case SLFIBER_BOARD: - ie_softc[unit].hard_type = IE_SLFIBER; - ie_softc[unit].ie_reset_586 = sl_reset_586; - ie_softc[unit].ie_chan_attn = sl_chan_attn; - break; - - /* - * Anything else is not recognized or cannot be used. - */ - default: - return (0); - } - - ie_softc[unit].hard_vers = SL_REV(c); - - /* - * Divine memory size on-board the card. Ususally 16k. - */ - find_ie_mem_size(unit); - - if (!ie_softc[unit].iosize) { - return (0); - } - dvp->id_msize = ie_softc[unit].iosize; - - switch (ie_softc[unit].hard_type) { - case IE_EN100: - case IE_STARLAN10: - case IE_SLFIBER: - sl_read_ether(unit, ie_softc[unit].arpcom.ac_enaddr); - break; - - default: - if (bootverbose) - kprintf("ie%d: unknown AT&T board type code %d\n", unit, - ie_softc[unit].hard_type); - return (0); - } - - return (1); -} - - -static int -el_probe(struct isa_device *dvp) -{ - struct ie_softc *sc = &ie_softc[dvp->id_unit]; - u_char c; - int i; - u_char signature[] = "*3COM*"; - int unit = dvp->id_unit; - - sc->unit = unit; - sc->port = dvp->id_iobase; - sc->iomembot = dvp->id_maddr; - sc->bus_use = 0; - - /* Need this for part of the probe. */ - sc->ie_reset_586 = el_reset_586; - sc->ie_chan_attn = el_chan_attn; - - /* Reset and put card in CONFIG state without changing address. */ - elink_reset(); - outb(ELINK_ID_PORT, 0x00); - elink_idseq(ELINK_507_POLY); - elink_idseq(ELINK_507_POLY); - outb(ELINK_ID_PORT, 0xff); - - c = inb(PORT + IE507_MADDR); - if (c & 0x20) { -#ifdef DEBUG - kprintf("ie%d: can't map 3C507 RAM in high memory\n", unit); -#endif - return (0); - } - /* go to RUN state */ - outb(ELINK_ID_PORT, 0x00); - elink_idseq(ELINK_507_POLY); - outb(ELINK_ID_PORT, 0x00); - - outb(PORT + IE507_CTRL, EL_CTRL_NRST); - - for (i = 0; i < 6; i++) - if (inb(PORT + i) != signature[i]) - return (0); - - c = inb(PORT + IE507_IRQ) & 0x0f; - - if (dvp->id_irq != (1 << c)) { - kprintf("ie%d: kernel configured irq %d " - "doesn't match board configured irq %d\n", - unit, ffs(dvp->id_irq) - 1, c); - return (0); - } - c = (inb(PORT + IE507_MADDR) & 0x1c) + 0xc0; - - if (kvtop(dvp->id_maddr) != ((int) c << 12)) { - kprintf("ie%d: kernel configured maddr %"PRIx64" " - "doesn't match board configured maddr %x\n", - unit, kvtop(dvp->id_maddr), (int) c << 12); - return (0); - } - outb(PORT + IE507_CTRL, EL_CTRL_NORMAL); - - sc->hard_type = IE_3C507; - sc->hard_vers = 0; /* 3C507 has no version number. */ - - /* - * Divine memory size on-board the card. - */ - find_ie_mem_size(unit); - - if (!sc->iosize) { - kprintf("ie%d: can't find shared memory\n", unit); - outb(PORT + IE507_CTRL, EL_CTRL_NRST); - return (0); - } - if (!dvp->id_msize) - dvp->id_msize = sc->iosize; - else if (dvp->id_msize != sc->iosize) { - kprintf("ie%d: kernel configured msize %d " - "doesn't match board configured msize %d\n", - unit, dvp->id_msize, sc->iosize); - outb(PORT + IE507_CTRL, EL_CTRL_NRST); - return (0); - } - sl_read_ether(unit, ie_softc[unit].arpcom.ac_enaddr); - - /* Clear the interrupt latch just in case. */ - outb(PORT + IE507_ICTRL, 1); - - return (16); -} - - -static int -ni_probe(struct isa_device *dvp) -{ - int unit = dvp->id_unit; - int boardtype, c; - - ie_softc[unit].port = dvp->id_iobase; - ie_softc[unit].iomembot = dvp->id_maddr; - ie_softc[unit].iomem = 0; - ie_softc[unit].bus_use = 1; - - boardtype = inb(PORT + IEATT_REVISION); - c = inb(PORT + IEATT_REVISION + 1); - boardtype = boardtype + (c << 8); - switch (boardtype) { - case 0x5500: /* This is the magic cookie for the NI5210 */ - ie_softc[unit].hard_type = IE_NI5210; - ie_softc[unit].ie_reset_586 = sl_reset_586; - ie_softc[unit].ie_chan_attn = sl_chan_attn; - break; - - /* - * Anything else is not recognized or cannot be used. - */ - default: - return (0); - } - - ie_softc[unit].hard_vers = 0; - - /* - * Divine memory size on-board the card. Either 8 or 16k. - */ - find_ie_mem_size(unit); - - if (!ie_softc[unit].iosize) { - return (0); - } - if (!dvp->id_msize) - dvp->id_msize = ie_softc[unit].iosize; - else if (dvp->id_msize != ie_softc[unit].iosize) { - kprintf("ie%d: kernel configured msize %d " - "doesn't match board configured msize %d\n", - unit, dvp->id_msize, ie_softc[unit].iosize); - return (0); - } - sl_read_ether(unit, ie_softc[unit].arpcom.ac_enaddr); - - return (8); - -} - - -static void -ee16_shutdown(void *sc, int howto) -{ - struct ie_softc *ie = (struct ie_softc *)sc; - int unit = ie - &ie_softc[0]; - - ee16_reset_586(unit); - outb(PORT + IEE16_ECTRL, IEE16_RESET_ASIC); - outb(PORT + IEE16_ECTRL, 0); -} - - -/* Taken almost exactly from Rod's if_ix.c. */ - -int -ee16_probe(struct isa_device *dvp) -{ - struct ie_softc *sc = &ie_softc[dvp->id_unit]; - - int i; - int unit = dvp->id_unit; - u_short board_id, id_var1, id_var2, checksum = 0; - u_short eaddrtemp, irq; - u_short pg, adjust, decode, edecode; - u_char bart_config; - u_long bd_maddr; - - short irq_translate[] = {0, 1 << ICU_IRQ9, 1 << ICU_IRQ3, - 1 << ICU_IRQ4, 1 << ICU_IRQ5, - 1 << ICU_IRQ10, 1 << ICU_IRQ11, 0}; - char irq_encode[] = {0, 0, 0, 2, 3, 4, 0, 0, 0, 1, 5, 6, 0, 0, 0, 0}; - - /* Need this for part of the probe. */ - sc->ie_reset_586 = ee16_reset_586; - sc->ie_chan_attn = ee16_chan_attn; - - /* unsure if this is necessary */ - sc->bus_use = 0; - - /* reset any ee16 at the current iobase */ - outb(dvp->id_iobase + IEE16_ECTRL, IEE16_RESET_ASIC); - outb(dvp->id_iobase + IEE16_ECTRL, 0); - DELAY(240); - - /* now look for ee16. */ - board_id = id_var1 = id_var2 = 0; - for (i = 0; i < 4; i++) { - id_var1 = inb(dvp->id_iobase + IEE16_ID_PORT); - id_var2 = ((id_var1 & 0x03) << 2); - board_id |= ((id_var1 >> 4) << id_var2); - } - - if (board_id != IEE16_ID) { - if (bootverbose) - kprintf("ie%d: unknown board_id: %x\n", unit, board_id); - return (0); - } - /* need sc->port for ee16_read_eeprom */ - sc->port = dvp->id_iobase; - sc->hard_type = IE_EE16; - - /* - * The shared RAM location on the EE16 is encoded into bits 3-7 of - * EEPROM location 6. We zero the upper byte, and shift the 5 bits - * right 3. The resulting number tells us the RAM location. - * Because the EE16 supports either 16k or 32k of shared RAM, we - * only worry about the 32k locations. - * - * NOTE: if a 64k EE16 exists, it should be added to this switch. then - * the ia->ia_msize would need to be set per case statement. - * - * value msize location ===== ===== ======== 0x03 0x8000 - * 0xCC000 0x06 0x8000 0xD0000 0x0C 0x8000 0xD4000 0x18 - * 0x8000 0xD8000 - * - */ - - bd_maddr = 0; - i = (ee16_read_eeprom(sc, 6) & 0x00ff) >> 3; - switch (i) { - case 0x03: - bd_maddr = 0xCC000; - break; - case 0x06: - bd_maddr = 0xD0000; - break; - case 0x0c: - bd_maddr = 0xD4000; - break; - case 0x18: - bd_maddr = 0xD8000; - break; - default: - bd_maddr = 0; - break; - } - dvp->id_msize = 0x8000; - if (kvtop(dvp->id_maddr) != bd_maddr) { - kprintf("ie%d: kernel configured maddr %"PRIx64" " - "doesn't match board configured maddr %lx\n", - unit, kvtop(dvp->id_maddr), bd_maddr); - } - sc->iomembot = dvp->id_maddr; - sc->iomem = 0; /* XXX some probes set this and some don't */ - sc->iosize = dvp->id_msize; - - /* need to put the 586 in RESET while we access the eeprom. */ - outb(PORT + IEE16_ECTRL, IEE16_RESET_586); - - /* read the eeprom and checksum it, should == IEE16_ID */ - for (i = 0; i < 0x40; i++) - checksum += ee16_read_eeprom(sc, i); - - if (checksum != IEE16_ID) { - kprintf("ie%d: invalid eeprom checksum: %x\n", unit, checksum); - return (0); - } - /* - * Size and test the memory on the board. The size of the memory - * can be one of 16k, 32k, 48k or 64k. It can be located in the - * address range 0xC0000 to 0xEFFFF on 16k boundaries. - * - * If the size does not match the passed in memory allocation size - * issue a warning, but continue with the minimum of the two sizes. - */ - - switch (dvp->id_msize) { - case 65536: - case 32768: /* XXX Only support 32k and 64k right now */ - break; - case 16384: - case 49512: - default: - kprintf("ie%d: mapped memory size %d not supported\n", unit, - dvp->id_msize); - return (0); - break; /* NOTREACHED */ - } - - if ((kvtop(dvp->id_maddr) < 0xC0000) || - (kvtop(dvp->id_maddr) + sc->iosize > 0xF0000)) { - kprintf("ie%d: mapped memory location %p out of range\n", unit, - (void *)dvp->id_maddr); - return (0); - } - pg = (kvtop(dvp->id_maddr) & 0x3C000) >> 14; - adjust = IEE16_MCTRL_FMCS16 | (pg & 0x3) << 2; - decode = ((1 << (sc->iosize / 16384)) - 1) << pg; - edecode = ((~decode >> 4) & 0xF0) | (decode >> 8); - - /* ZZZ This should be checked against eeprom location 6, low byte */ - outb(PORT + IEE16_MEMDEC, decode & 0xFF); - /* ZZZ This should be checked against eeprom location 1, low byte */ - outb(PORT + IEE16_MCTRL, adjust); - /* ZZZ Now if I could find this one I would have it made */ - outb(PORT + IEE16_MPCTRL, (~decode & 0xFF)); - /* ZZZ I think this is location 6, high byte */ - outb(PORT + IEE16_MECTRL, edecode); /* XXX disable Exxx */ - - kvtop(dvp->id_maddr); - - /* - * first prime the stupid bart DRAM controller so that it works, - * then zero out all of memory. - */ - bzero(sc->iomembot, 32); - bzero(sc->iomembot, sc->iosize); - - /* - * Get the encoded interrupt number from the EEPROM, check it - * against the passed in IRQ. Issue a warning if they do not match. - * Always use the passed in IRQ, not the one in the EEPROM. - */ - irq = ee16_read_eeprom(sc, IEE16_EEPROM_CONFIG1); - irq = (irq & IEE16_EEPROM_IRQ) >> IEE16_EEPROM_IRQ_SHIFT; - irq = irq_translate[irq]; - if (dvp->id_irq > 0) { - if (irq != dvp->id_irq) { - kprintf("ie%d: WARNING: board configured " - "at irq %u, using %u\n", - dvp->id_unit, dvp->id_irq, irq); - irq = dvp->id_unit; - } - } else { - dvp->id_irq = irq; - } - sc->irq_encoded = irq_encode[ffs(irq) - 1]; - - /* - * Get the hardware ethernet address from the EEPROM and save it in - * the softc for use by the 586 setup code. - */ - eaddrtemp = ee16_read_eeprom(sc, IEE16_EEPROM_ENET_HIGH); - sc->arpcom.ac_enaddr[1] = eaddrtemp & 0xFF; - sc->arpcom.ac_enaddr[0] = eaddrtemp >> 8; - eaddrtemp = ee16_read_eeprom(sc, IEE16_EEPROM_ENET_MID); - sc->arpcom.ac_enaddr[3] = eaddrtemp & 0xFF; - sc->arpcom.ac_enaddr[2] = eaddrtemp >> 8; - eaddrtemp = ee16_read_eeprom(sc, IEE16_EEPROM_ENET_LOW); - sc->arpcom.ac_enaddr[5] = eaddrtemp & 0xFF; - sc->arpcom.ac_enaddr[4] = eaddrtemp >> 8; - - /* disable the board interrupts */ - outb(PORT + IEE16_IRQ, sc->irq_encoded); - - /* enable loopback to keep bad packets off the wire */ - if (sc->hard_type == IE_EE16) { - bart_config = inb(PORT + IEE16_CONFIG); - bart_config |= IEE16_BART_LOOPBACK; - bart_config |= IEE16_BART_MCS16_TEST;/* inb doesn't get bit! */ - outb(PORT + IEE16_CONFIG, bart_config); - bart_config = inb(PORT + IEE16_CONFIG); - } - /* take the board out of reset state */ - outb(PORT + IEE16_ECTRL, 0); - DELAY(100); - - if (!check_ie_present(unit, dvp->id_maddr, sc->iosize)) - return (0); - - return (16); /* return the number of I/O ports */ -} - -/* - * Taken almost exactly from Bill's if_is.c, then modified beyond recognition. - */ -int -ieattach(struct isa_device *dvp) -{ - int factor; - int unit = dvp->id_unit; - struct ie_softc *ie = &ie_softc[unit]; - struct ifnet *ifp = &ie->arpcom.ac_if; - size_t allocsize; - - dvp->id_intr = (inthand2_t *)ieintr; - - /* - * based on the amount of memory we have, allocate our tx and rx - * resources. - */ - factor = dvp->id_msize / 16384; - ie->nframes = factor * NFRAMES; - ie->nrxbufs = factor * NRXBUFS; - ie->ntxbufs = factor * NTXBUFS; - - /* - * Since all of these guys are arrays of pointers, allocate as one - * big chunk and dole out accordingly. - */ - allocsize = sizeof(void *) * (ie->nframes - + (ie->nrxbufs * 2) - + (ie->ntxbufs * 3)); - ie->rframes = kmalloc(allocsize, M_DEVBUF, M_WAITOK); - ie->rbuffs = - (volatile struct ie_recv_buf_desc **)&ie->rframes[ie->nframes]; - ie->cbuffs = (volatile u_char **)&ie->rbuffs[ie->nrxbufs]; - ie->xmit_cmds = - (volatile struct ie_xmit_cmd **)&ie->cbuffs[ie->nrxbufs]; - ie->xmit_buffs = - (volatile struct ie_xmit_buf **)&ie->xmit_cmds[ie->ntxbufs]; - ie->xmit_cbuffs = (volatile u_char **)&ie->xmit_buffs[ie->ntxbufs]; - - ifp->if_softc = ie; - if_initname(ifp, iedriver.name, unit); - ifp->if_mtu = ETHERMTU; - if_printf(ifp, "<%s R%d>", ie_hardware_names[ie->hard_type], - ie->hard_vers + 1); - - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_start = iestart; - ifp->if_ioctl = ieioctl; - ifp->if_init = ieinit; - ifp->if_type = IFT_ETHER; - ifp->if_addrlen = 6; - ifp->if_hdrlen = 14; - ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN); - ifq_set_ready(&ifp->if_snd); - - if (ie->hard_type == IE_EE16) - EVENTHANDLER_REGISTER(shutdown_post_sync, ee16_shutdown, - ie, SHUTDOWN_PRI_DRIVER); - - ether_ifattach(ifp, ie->arpcom.ac_enaddr, NULL); - return (1); -} - -/* - * What to do upon receipt of an interrupt. - */ -static void -ieintr(void *arg) -{ - int unit = (int)arg; - struct ie_softc *ie = &ie_softc[unit]; - u_short status; - - lwkt_serialize_enter(ie->arpcom.ac_if.if_serializer); - - /* Clear the interrupt latch on the 3C507. */ - if (ie->hard_type == IE_3C507 - && (inb(PORT + IE507_CTRL) & EL_CTRL_INTL)) - outb(PORT + IE507_ICTRL, 1); - - /* disable interrupts on the EE16. */ - if (ie->hard_type == IE_EE16) - outb(PORT + IEE16_IRQ, ie->irq_encoded); - - status = ie->scb->ie_status; - -loop: - - /* Don't ack interrupts which we didn't receive */ - ie_ack(ie->scb, IE_ST_WHENCE & status, unit, ie->ie_chan_attn); - - if (status & (IE_ST_RECV | IE_ST_RNR)) { -#ifdef DEBUG - in_ierint++; - if (ie_debug & IED_RINT) - kprintf("ie%d: rint\n", unit); -#endif - ierint(unit, ie); -#ifdef DEBUG - in_ierint--; -#endif - } - if (status & IE_ST_DONE) { -#ifdef DEBUG - in_ietint++; - if (ie_debug & IED_TINT) - kprintf("ie%d: tint\n", unit); -#endif - ietint(unit, ie); -#ifdef DEBUG - in_ietint--; -#endif - } - if (status & IE_ST_RNR) { -#ifdef DEBUG - if (ie_debug & IED_RNR) - kprintf("ie%d: rnr\n", unit); -#endif - iernr(unit, ie); - } -#ifdef DEBUG - if ((status & IE_ST_ALLDONE) - && (ie_debug & IED_CNA)) - kprintf("ie%d: cna\n", unit); -#endif - - if ((status = ie->scb->ie_status) & IE_ST_WHENCE) - goto loop; - - /* Clear the interrupt latch on the 3C507. */ - if (ie->hard_type == IE_3C507) - outb(PORT + IE507_ICTRL, 1); - - /* enable interrupts on the EE16. */ - if (ie->hard_type == IE_EE16) - outb(PORT + IEE16_IRQ, ie->irq_encoded | IEE16_IRQ_ENABLE); - - lwkt_serialize_exit(ie->arpcom.ac_if.if_serializer); -} - -/* - * Process a received-frame interrupt. - */ -static int -ierint(int unit, struct ie_softc *ie) -{ - int i, status; - static int timesthru = 1024; - - i = ie->rfhead; - while (1) { - status = ie->rframes[i]->ie_fd_status; - - if ((status & IE_FD_COMPLETE) && (status & IE_FD_OK)) { - ie->arpcom.ac_if.if_ipackets++; - if (!--timesthru) { - ie->arpcom.ac_if.if_ierrors += - ie->scb->ie_err_crc + - ie->scb->ie_err_align + - ie->scb->ie_err_resource + - ie->scb->ie_err_overrun; - ie->scb->ie_err_crc = 0; - ie->scb->ie_err_align = 0; - ie->scb->ie_err_resource = 0; - ie->scb->ie_err_overrun = 0; - timesthru = 1024; - } - ie_readframe(unit, ie, i); - } else { - if (status & IE_FD_RNR) { - if (!(ie->scb->ie_status & IE_RU_READY)) { - ie->rframes[0]->ie_fd_next = - MK_16(MEM, ie->rbuffs[0]); - ie->scb->ie_recv_list = - MK_16(MEM, ie->rframes[0]); - command_and_wait(unit, IE_RU_START, - 0, 0); - } - } - break; - } - i = (i + 1) % ie->nframes; - } - return (0); -} - -/* - * Process a command-complete interrupt. These are only generated by - * the transmission of frames. This routine is deceptively simple, since - * most of the real work is done by iestart(). - */ -static int -ietint(int unit, struct ie_softc *ie) -{ - int status; - int i; - - ie->arpcom.ac_if.if_timer = 0; - ie->arpcom.ac_if.if_flags &= ~IFF_OACTIVE; - - for (i = 0; i < ie->xmit_count; i++) { - status = ie->xmit_cmds[i]->ie_xmit_status; - - if (status & IE_XS_LATECOLL) { - kprintf("ie%d: late collision\n", unit); - ie->arpcom.ac_if.if_collisions++; - ie->arpcom.ac_if.if_oerrors++; - } else if (status & IE_XS_NOCARRIER) { - kprintf("ie%d: no carrier\n", unit); - ie->arpcom.ac_if.if_oerrors++; - } else if (status & IE_XS_LOSTCTS) { - kprintf("ie%d: lost CTS\n", unit); - ie->arpcom.ac_if.if_oerrors++; - } else if (status & IE_XS_UNDERRUN) { - kprintf("ie%d: DMA underrun\n", unit); - ie->arpcom.ac_if.if_oerrors++; - } else if (status & IE_XS_EXCMAX) { - kprintf("ie%d: too many collisions\n", unit); - ie->arpcom.ac_if.if_collisions += 16; - ie->arpcom.ac_if.if_oerrors++; - } else { - ie->arpcom.ac_if.if_opackets++; - ie->arpcom.ac_if.if_collisions += status & IE_XS_MAXCOLL; - } - } - ie->xmit_count = 0; - - /* - * If multicast addresses were added or deleted while we were - * transmitting, ie_mc_reset() set the want_mcsetup flag indicating - * that we should do it. - */ - if (ie->want_mcsetup) { - mc_setup(unit, (v_caddr_t) ie->xmit_cbuffs[0], ie->scb); - ie->want_mcsetup = 0; - } - /* Wish I knew why this seems to be necessary... */ - ie->xmit_cmds[0]->ie_xmit_status |= IE_STAT_COMPL; - - if_devstart(&ie->arpcom.ac_if); - return (0); /* shouldn't be necessary */ -} - -/* - * Process a receiver-not-ready interrupt. I believe that we get these - * when there aren't enough buffers to go around. For now (FIXME), we - * just restart the receiver, and hope everything's ok. - */ -static int -iernr(int unit, struct ie_softc *ie) -{ -#ifdef doesnt_work - setup_rfa((v_caddr_t) ie->rframes[0], ie); - - ie->scb->ie_recv_list = MK_16(MEM, ie_softc[unit].rframes[0]); - command_and_wait(unit, IE_RU_START, 0, 0); -#else - /* This doesn't work either, but it doesn't hang either. */ - command_and_wait(unit, IE_RU_DISABLE, 0, 0); /* just in case */ - setup_rfa((v_caddr_t) ie->rframes[0], ie); /* ignore cast-qual */ - - ie->scb->ie_recv_list = MK_16(MEM, ie_softc[unit].rframes[0]); - command_and_wait(unit, IE_RU_START, 0, 0); /* was ENABLE */ - -#endif - ie_ack(ie->scb, IE_ST_WHENCE, unit, ie->ie_chan_attn); - - ie->arpcom.ac_if.if_ierrors++; - return (0); -} - -/* - * Compare two Ether/802 addresses for equality, inlined and - * unrolled for speed. I'd love to have an inline assembler - * version of this... - */ -static __inline int -ether_equal(u_char * one, u_char * two) -{ - if (one[0] != two[0]) - return (0); - if (one[1] != two[1]) - return (0); - if (one[2] != two[2]) - return (0); - if (one[3] != two[3]) - return (0); - if (one[4] != two[4]) - return (0); - if (one[5] != two[5]) - return (0); - return 1; -} - -/* - * Determine quickly whether we should bother reading in this packet. - * This depends on whether BPF and/or bridging is enabled, whether we - * are receiving multicast address, and whether promiscuous mode is enabled. - * We assume that if IFF_PROMISC is set, then *somebody* wants to see - * all incoming packets. - */ -static __inline int -check_eh(struct ie_softc *ie, struct ether_header *eh) -{ - /* Optimize the common case: normal operation. We've received - either a unicast with our dest or a multicast packet. */ - if (ie->promisc == 0) { - int i; - - /* If not multicast, it's definitely for us */ - if ((eh->ether_dhost[0] & 1) == 0) - return (1); - - /* Accept broadcasts (loose but fast check) */ - if (eh->ether_dhost[0] == 0xff) - return (1); - - /* Compare against our multicast addresses */ - for (i = 0; i < ie->mcast_count; i++) { - if (ether_equal(eh->ether_dhost, - (u_char *)&ie->mcast_addrs[i])) - return (1); - } - return (0); - } - - /* Always accept packets when in promiscuous mode */ - if ((ie->promisc & IFF_PROMISC) != 0) - return (1); - - /* Always accept packets directed at us */ - if (ether_equal(eh->ether_dhost, ie->arpcom.ac_enaddr)) - return (1); - - /* Must have IFF_ALLMULTI but not IFF_PROMISC set. The chip is - actually in promiscuous mode, so discard unicast packets. */ - return((eh->ether_dhost[0] & 1) != 0); -} - -/* - * We want to isolate the bits that have meaning... This assumes that - * IE_RBUF_SIZE is an even power of two. If somehow the act_len exceeds - * the size of the buffer, then we are screwed anyway. - */ -static __inline int -ie_buflen(struct ie_softc * ie, int head) -{ - return (ie->rbuffs[head]->ie_rbd_actual - & (IE_RBUF_SIZE | (IE_RBUF_SIZE - 1))); -} - -static __inline int -ie_packet_len(int unit, struct ie_softc * ie) -{ - int i; - int head = ie->rbhead; - int acc = 0; - - do { - if (!(ie->rbuffs[ie->rbhead]->ie_rbd_actual & IE_RBD_USED)) { -#ifdef DEBUG - print_rbd(ie->rbuffs[ie->rbhead]); -#endif - log(LOG_ERR, - "ie%d: receive descriptors out of sync at %d\n", - unit, ie->rbhead); - iereset(unit); - return (-1); - } - i = ie->rbuffs[head]->ie_rbd_actual & IE_RBD_LAST; - - acc += ie_buflen(ie, head); - head = (head + 1) % ie->nrxbufs; - } while (!i); - - return (acc); -} - -/* - * Read data off the interface, and turn it into an mbuf chain. - * - * This code is DRAMATICALLY different from the previous version; this - * version tries to allocate the entire mbuf chain up front, given the - * length of the data available. This enables us to allocate mbuf - * clusters in many situations where before we would have had a long - * chain of partially-full mbufs. This should help to speed up the - * operation considerably. (Provided that it works, of course.) - */ -static __inline int -ieget(int unit, struct ie_softc *ie, struct mbuf **mp) -{ - struct mbuf *m, *top, **mymp; - struct ether_header eh; - int i; - int offset; - int totlen, resid; - int thismboff; - int head; - - totlen = ie_packet_len(unit, ie); - if (totlen <= 0) - return (-1); - - i = ie->rbhead; - - /* - * Snarf the Ethernet header. - */ - bcopy((v_caddr_t) ie->cbuffs[i], (caddr_t) &eh, sizeof eh); - /* ignore cast-qual warning here */ - - /* - * As quickly as possible, check if this packet is for us. If not, - * don't waste a single cycle copying the rest of the packet in. - * This is only a consideration when FILTER is defined; i.e., when - * we are either running BPF or doing multicasting. - */ - if (!check_eh(ie, &eh)) { - ie_drop_packet_buffer(unit, ie); - ie->arpcom.ac_if.if_ierrors--; /* just this case, it's not an - * error - */ - return (-1); - } - offset = 0; - - MGETHDR(*mp, MB_DONTWAIT, MT_DATA); - if (!*mp) { - ie_drop_packet_buffer(unit, ie); - return (-1); - } - m = *mp; - m->m_len = MHLEN; - resid = m->m_pkthdr.len = totlen; - top = 0; - mymp = ⊤ - - /* - * This loop goes through and allocates mbufs for all the data we - * will be copying in. It does not actually do the copying yet. - */ - do { /* while(resid > 0) */ - /* - * Try to allocate an mbuf to hold the data that we have. - * If we already allocated one, just get another one and - * stick it on the end (eventually). If we don't already - * have one, try to allocate an mbuf cluster big enough to - * hold the whole packet, if we think it's reasonable, or a - * single mbuf which may or may not be big enough. Got that? - */ - if (top) { - MGET(m, MB_DONTWAIT, MT_DATA); - if (!m) { - m_freem(top); - ie_drop_packet_buffer(unit, ie); - return (-1); - } - m->m_len = MLEN; - } - if (resid >= MINCLSIZE) { - MCLGET(m, MB_DONTWAIT); - if (m->m_flags & M_EXT) - m->m_len = min(resid, MCLBYTES); - } else { - if (resid < m->m_len) { - if (!top && resid + max_linkhdr <= m->m_len) - m->m_data += max_linkhdr; - m->m_len = resid; - } - } - resid -= m->m_len; - *mymp = m; - mymp = &m->m_next; - } while (resid > 0); - - resid = totlen; - m = top; - thismboff = 0; - head = ie->rbhead; - - /* - * Now we take the mbuf chain (hopefully only one mbuf most of the - * time) and stuff the data into it. There are no possible failures - * at or after this point. - */ - while (resid > 0) { /* while there's stuff left */ - int thislen = ie_buflen(ie, head) - offset; - - /* - * If too much data for the current mbuf, then fill the - * current one up, go to the next one, and try again. - */ - if (thislen > m->m_len - thismboff) { - int newlen = m->m_len - thismboff; - - bcopy((v_caddr_t) (ie->cbuffs[head] + offset), - mtod(m, v_caddr_t) +thismboff, (unsigned) newlen); - /* ignore cast-qual warning */ - m = m->m_next; - thismboff = 0; /* new mbuf, so no offset */ - offset += newlen; /* we are now this far into - * the packet */ - resid -= newlen; /* so there is this much left - * to get */ - continue; - } - /* - * If there is more than enough space in the mbuf to hold - * the contents of this buffer, copy everything in, advance - * pointers, and so on. - */ - if (thislen < m->m_len - thismboff) { - bcopy((v_caddr_t) (ie->cbuffs[head] + offset), - mtod(m, caddr_t) +thismboff, (unsigned) thislen); - thismboff += thislen; /* we are this far into the - * mbuf */ - resid -= thislen; /* and this much is left */ - goto nextbuf; - } - /* - * Otherwise, there is exactly enough space to put this - * buffer's contents into the current mbuf. Do the - * combination of the above actions. - */ - bcopy((v_caddr_t) (ie->cbuffs[head] + offset), - mtod(m, caddr_t) + thismboff, (unsigned) thislen); - m = m->m_next; - thismboff = 0; /* new mbuf, start at the beginning */ - resid -= thislen; /* and we are this far through */ - - /* - * Advance all the pointers. We can get here from either of - * the last two cases, but never the first. - */ -nextbuf: - offset = 0; - ie->rbuffs[head]->ie_rbd_actual = 0; - ie->rbuffs[head]->ie_rbd_length |= IE_RBD_LAST; - ie->rbhead = head = (head + 1) % ie->nrxbufs; - ie->rbuffs[ie->rbtail]->ie_rbd_length &= ~IE_RBD_LAST; - ie->rbtail = (ie->rbtail + 1) % ie->nrxbufs; - } - - /* - * Unless something changed strangely while we were doing the copy, - * we have now copied everything in from the shared memory. This - * means that we are done. - */ - return (0); -} - -/* - * Read frame NUM from unit UNIT (pre-cached as IE). - * - * This routine reads the RFD at NUM, and copies in the buffers from - * the list of RBD, then rotates the RBD and RFD lists so that the receiver - * doesn't start complaining. Trailers are DROPPED---there's no point - * in wasting time on confusing code to deal with them. Hopefully, - * this machine will never ARP for trailers anyway. - */ -static void -ie_readframe(int unit, struct ie_softc *ie, int num/* frame number to read */) -{ - struct ie_recv_frame_desc rfd; - struct mbuf *m = NULL; - - bcopy((v_caddr_t) (ie->rframes[num]), &rfd, - sizeof(struct ie_recv_frame_desc)); - - /* - * Immediately advance the RFD list, since we we have copied ours - * now. - */ - ie->rframes[num]->ie_fd_status = 0; - ie->rframes[num]->ie_fd_last |= IE_FD_LAST; - ie->rframes[ie->rftail]->ie_fd_last &= ~IE_FD_LAST; - ie->rftail = (ie->rftail + 1) % ie->nframes; - ie->rfhead = (ie->rfhead + 1) % ie->nframes; - - if (rfd.ie_fd_status & IE_FD_OK) { - if (ieget(unit, ie, &m)) { - ie->arpcom.ac_if.if_ierrors++; /* this counts as an - * error */ - return; - } - } - - if (!m) - return; - - /* - * Finally pass this packet up to higher layers. - */ - ie->arpcom.ac_if.if_input(&ie->arpcom.ac_if, m); -} - -static void -ie_drop_packet_buffer(int unit, struct ie_softc * ie) -{ - int i; - - do { - /* - * This means we are somehow out of sync. So, we reset the - * adapter. - */ - if (!(ie->rbuffs[ie->rbhead]->ie_rbd_actual & IE_RBD_USED)) { -#ifdef DEBUG - print_rbd(ie->rbuffs[ie->rbhead]); -#endif - log(LOG_ERR, "ie%d: receive descriptors out of sync at %d\n", - unit, ie->rbhead); - iereset(unit); - return; - } - i = ie->rbuffs[ie->rbhead]->ie_rbd_actual & IE_RBD_LAST; - - ie->rbuffs[ie->rbhead]->ie_rbd_length |= IE_RBD_LAST; - ie->rbuffs[ie->rbhead]->ie_rbd_actual = 0; - ie->rbhead = (ie->rbhead + 1) % ie->nrxbufs; - ie->rbuffs[ie->rbtail]->ie_rbd_length &= ~IE_RBD_LAST; - ie->rbtail = (ie->rbtail + 1) % ie->nrxbufs; - } while (!i); -} - - -/* - * Start transmission on an interface. - */ -static void -iestart(struct ifnet *ifp) -{ - struct ie_softc *ie = ifp->if_softc; - struct mbuf *m0, *m; - volatile unsigned char *buffer; - u_short len; - - /* - * This is not really volatile, in this routine, but it makes gcc - * happy. - */ - volatile u_short *bptr = &ie->scb->ie_command_list; - - if (!(ifp->if_flags & IFF_RUNNING)) - return; - if (ifp->if_flags & IFF_OACTIVE) - return; - - do { - m = ifq_dequeue(&ie->arpcom.ac_if.if_snd, NULL); - if (m == NULL) - break; - - buffer = ie->xmit_cbuffs[ie->xmit_count]; - len = 0; - - for (m0 = m; m && len < IE_BUF_LEN; m = m->m_next) { - bcopy(mtod(m, caddr_t), buffer, m->m_len); - buffer += m->m_len; - len += m->m_len; - } - - m_freem(m0); - len = max(len, ETHER_MIN_LEN); - - /* - * See if bpf is listening on this interface, let it see the - * packet before we commit it to the wire. - */ - BPF_TAP(&ie->arpcom.ac_if, - __DEVOLATILE(u_char *, ie->xmit_cbuffs[ie->xmit_count]), - len); - - ie->xmit_buffs[ie->xmit_count]->ie_xmit_flags = - IE_XMIT_LAST|len; - ie->xmit_buffs[ie->xmit_count]->ie_xmit_next = 0xffff; - ie->xmit_buffs[ie->xmit_count]->ie_xmit_buf = - MK_24(ie->iomem, ie->xmit_cbuffs[ie->xmit_count]); - - ie->xmit_cmds[ie->xmit_count]->com.ie_cmd_cmd = IE_CMD_XMIT; - ie->xmit_cmds[ie->xmit_count]->ie_xmit_status = 0; - ie->xmit_cmds[ie->xmit_count]->ie_xmit_desc = - MK_16(ie->iomem, ie->xmit_buffs[ie->xmit_count]); - - *bptr = MK_16(ie->iomem, ie->xmit_cmds[ie->xmit_count]); - bptr = &ie->xmit_cmds[ie->xmit_count]->com.ie_cmd_link; - ie->xmit_count++; - } while (ie->xmit_count < ie->ntxbufs); - - /* - * If we queued up anything for transmission, send it. - */ - if (ie->xmit_count) { - ie->xmit_cmds[ie->xmit_count - 1]->com.ie_cmd_cmd |= - IE_CMD_LAST | IE_CMD_INTR; - - /* - * By passing the command pointer as a null, we tell - * command_and_wait() to pretend that this isn't an action - * command. I wish I understood what was happening here. - */ - command_and_wait(ifp->if_dunit, IE_CU_START, 0, 0); - ifp->if_flags |= IFF_OACTIVE; - } - return; -} - -/* - * Check to see if there's an 82586 out there. - */ -static int -check_ie_present(int unit, caddr_t where, unsigned size) -{ - volatile struct ie_sys_conf_ptr *scp; - volatile struct ie_int_sys_conf_ptr *iscp; - volatile struct ie_sys_ctl_block *scb; - u_long realbase; - - realbase = (uintptr_t) where + size - (1 << 24); - - scp = (volatile struct ie_sys_conf_ptr *) (uintptr_t) - (realbase + IE_SCP_ADDR); - bzero((volatile char *) scp, sizeof *scp); - - /* - * First we put the ISCP at the bottom of memory; this tests to make - * sure that our idea of the size of memory is the same as the - * controller's. This is NOT where the ISCP will be in normal - * operation. - */ - iscp = (volatile struct ie_int_sys_conf_ptr *) where; - bzero((volatile char *)iscp, sizeof *iscp); - - scb = (volatile struct ie_sys_ctl_block *) where; - bzero((volatile char *)scb, sizeof *scb); - - scp->ie_bus_use = ie_softc[unit].bus_use; /* 8-bit or 16-bit */ - scp->ie_iscp_ptr = (caddr_t) (uintptr_t) - ((volatile char *) iscp - (volatile char *) (uintptr_t) realbase); - - iscp->ie_busy = 1; - iscp->ie_scb_offset = MK_16(realbase, scb) + 256; - - (*ie_softc[unit].ie_reset_586) (unit); - (*ie_softc[unit].ie_chan_attn) (unit); - - DELAY(100); /* wait a while... */ - - if (iscp->ie_busy) { - return (0); - } - /* - * Now relocate the ISCP to its real home, and reset the controller - * again. - */ - iscp = (void *) Align((caddr_t) (uintptr_t) - (realbase + IE_SCP_ADDR - - sizeof(struct ie_int_sys_conf_ptr))); - bzero((volatile char *) iscp, sizeof *iscp); /* ignore cast-qual */ - - scp->ie_iscp_ptr = (caddr_t) (uintptr_t) - ((volatile char *) iscp - (volatile char *) (uintptr_t) realbase); - - iscp->ie_busy = 1; - iscp->ie_scb_offset = MK_16(realbase, scb); - - (*ie_softc[unit].ie_reset_586) (unit); - (*ie_softc[unit].ie_chan_attn) (unit); - - DELAY(100); - - if (iscp->ie_busy) { - return (0); - } - ie_softc[unit].iosize = size; - ie_softc[unit].iomem = (caddr_t) (uintptr_t) realbase; - - ie_softc[unit].iscp = iscp; - ie_softc[unit].scb = scb; - - /* - * Acknowledge any interrupts we may have caused... - */ - ie_ack(scb, IE_ST_WHENCE, unit, ie_softc[unit].ie_chan_attn); - - return (1); -} - -/* - * Divine the memory size of ie board UNIT. - * Better hope there's nothing important hiding just below the ie card... - */ -static void -find_ie_mem_size(int unit) -{ - unsigned size; - - ie_softc[unit].iosize = 0; - - for (size = 65536; size >= 8192; size -= 8192) { - if (check_ie_present(unit, ie_softc[unit].iomembot, size)) { - return; - } - } - - return; -} - -void -el_reset_586(int unit) -{ - outb(PORT + IE507_CTRL, EL_CTRL_RESET); - DELAY(100); - outb(PORT + IE507_CTRL, EL_CTRL_NORMAL); - DELAY(100); -} - -void -sl_reset_586(int unit) -{ - outb(PORT + IEATT_RESET, 0); -} - -void -ee16_reset_586(int unit) -{ - outb(PORT + IEE16_ECTRL, IEE16_RESET_586); - DELAY(100); - outb(PORT + IEE16_ECTRL, 0); - DELAY(100); -} - -void -el_chan_attn(int unit) -{ - outb(PORT + IE507_ATTN, 1); -} - -void -sl_chan_attn(int unit) -{ - outb(PORT + IEATT_ATTN, 0); -} - -void -ee16_chan_attn(int unit) -{ - outb(PORT + IEE16_ATTN, 0); -} - -u_short -ee16_read_eeprom(struct ie_softc *sc, int location) -{ - int ectrl, edata; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= IEE16_ECTRL_MASK; - ectrl |= IEE16_ECTRL_EECS; - outb(sc->port + IEE16_ECTRL, ectrl); - - ee16_eeprom_outbits(sc, IEE16_EEPROM_READ, IEE16_EEPROM_OPSIZE1); - ee16_eeprom_outbits(sc, location, IEE16_EEPROM_ADDR_SIZE); - edata = ee16_eeprom_inbits(sc); - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~(IEE16_RESET_ASIC | IEE16_ECTRL_EEDI | IEE16_ECTRL_EECS); - outb(sc->port + IEE16_ECTRL, ectrl); - ee16_eeprom_clock(sc, 1); - ee16_eeprom_clock(sc, 0); - return edata; -} - -void -ee16_eeprom_outbits(struct ie_softc *sc, int edata, int count) -{ - int ectrl, i; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~IEE16_RESET_ASIC; - for (i = count - 1; i >= 0; i--) { - ectrl &= ~IEE16_ECTRL_EEDI; - if (edata & (1 << i)) { - ectrl |= IEE16_ECTRL_EEDI; - } - outb(sc->port + IEE16_ECTRL, ectrl); - DELAY(1); /* eeprom data must be setup for 0.4 uSec */ - ee16_eeprom_clock(sc, 1); - ee16_eeprom_clock(sc, 0); - } - ectrl &= ~IEE16_ECTRL_EEDI; - outb(sc->port + IEE16_ECTRL, ectrl); - DELAY(1); /* eeprom data must be held for 0.4 uSec */ -} - -int -ee16_eeprom_inbits(struct ie_softc *sc) -{ - int ectrl, edata, i; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~IEE16_RESET_ASIC; - for (edata = 0, i = 0; i < 16; i++) { - edata = edata << 1; - ee16_eeprom_clock(sc, 1); - ectrl = inb(sc->port + IEE16_ECTRL); - if (ectrl & IEE16_ECTRL_EEDO) { - edata |= 1; - } - ee16_eeprom_clock(sc, 0); - } - return (edata); -} - -void -ee16_eeprom_clock(struct ie_softc *sc, int state) -{ - int ectrl; - - ectrl = inb(sc->port + IEE16_ECTRL); - ectrl &= ~(IEE16_RESET_ASIC | IEE16_ECTRL_EESK); - if (state) { - ectrl |= IEE16_ECTRL_EESK; - } - outb(sc->port + IEE16_ECTRL, ectrl); - DELAY(9); /* EESK must be stable for 8.38 uSec */ -} - -static __inline void -ee16_interrupt_enable(struct ie_softc *sc) -{ - DELAY(100); - outb(sc->port + IEE16_IRQ, sc->irq_encoded | IEE16_IRQ_ENABLE); - DELAY(100); -} - -void -sl_read_ether(int unit, unsigned char addr[6]) -{ - int i; - - for (i = 0; i < 6; i++) - addr[i] = inb(PORT + i); -} - - -static void -iereset(int unit) -{ - if (unit >= NIE) { - return; - } - kprintf("ie%d: reset\n", unit); - ie_softc[unit].arpcom.ac_if.if_flags &= ~IFF_UP; - ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, NULL); - - /* - * Stop i82586 dead in its tracks. - */ - if (command_and_wait(unit, IE_RU_ABORT | IE_CU_ABORT, 0, 0)) - kprintf("ie%d: abort commands timed out\n", unit); - - if (command_and_wait(unit, IE_RU_DISABLE | IE_CU_STOP, 0, 0)) - kprintf("ie%d: disable commands timed out\n", unit); - -#ifdef notdef - if (!check_ie_present(unit, ie_softc[unit].iomembot, - e_softc[unit].iosize)) - panic("ie disappeared!"); -#endif - - ie_softc[unit].arpcom.ac_if.if_flags |= IFF_UP; - ieioctl(&ie_softc[unit].arpcom.ac_if, SIOCSIFFLAGS, 0, NULL); -} - -/* - * Send a command to the controller and wait for it to either - * complete or be accepted, depending on the command. If the - * command pointer is null, then pretend that the command is - * not an action command. If the command pointer is not null, - * and the command is an action command, wait for - * ((volatile struct ie_cmd_common *)pcmd)->ie_cmd_status & MASK - * to become true. - */ -static int -command_and_wait(int unit, int cmd, volatile void *pcmd, int mask) -{ - volatile struct ie_cmd_common *cc = pcmd; - - ie_softc[unit].scb->ie_command = (u_short) cmd; - - if (IE_ACTION_COMMAND(cmd) && pcmd) { - /* - * According to the packet driver, the minimum timeout - * should be .369 seconds. - */ - int timer = 370; - - (*ie_softc[unit].ie_chan_attn) (unit); - - /* - * Now spin-lock waiting for status. This is not a very - * nice thing to do, but I haven't figured out how, or - * indeed if, we can put the process waiting for action to - * sleep. (We may be getting called through some other - * timeout running in the kernel.) - */ - while (--timer > 0) { - if (cc->ie_cmd_status & mask) - break; - DELAY(1000); - } - if (timer == 0) - return(1); - else - return(0); - } else { - - /* - * Otherwise, just wait for the command to be accepted. - */ - (*ie_softc[unit].ie_chan_attn) (unit); - - while (ie_softc[unit].scb->ie_command); /* spin lock */ - - return (0); - } -} - -/* - * Run the time-domain reflectometer... - */ -static void -run_tdr(int unit, volatile struct ie_tdr_cmd *cmd) -{ - int result; - - cmd->com.ie_cmd_status = 0; - cmd->com.ie_cmd_cmd = IE_CMD_TDR | IE_CMD_LAST; - cmd->com.ie_cmd_link = 0xffff; - cmd->ie_tdr_time = 0; - - ie_softc[unit].scb->ie_command_list = MK_16(MEM, cmd); - cmd->ie_tdr_time = 0; - - if (command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL)) - result = 0x2000; - else - result = cmd->ie_tdr_time; - - ie_ack(ie_softc[unit].scb, IE_ST_WHENCE, unit, - ie_softc[unit].ie_chan_attn); - - if (result & IE_TDR_SUCCESS) - return; - - if (result & IE_TDR_XCVR) { - kprintf("ie%d: transceiver problem\n", unit); - } else if (result & IE_TDR_OPEN) { - kprintf("ie%d: TDR detected an open %d clocks away\n", unit, - result & IE_TDR_TIME); - } else if (result & IE_TDR_SHORT) { - kprintf("ie%d: TDR detected a short %d clocks away\n", unit, - result & IE_TDR_TIME); - } else { - kprintf("ie%d: TDR returned unknown status %x\n", unit, result); - } -} - -static void -start_receiver(int unit) -{ - ie_softc[unit].scb->ie_recv_list = MK_16(MEM, ie_softc[unit].rframes[0]); - command_and_wait(unit, IE_RU_START, 0, 0); - - ie_ack(ie_softc[unit].scb, IE_ST_WHENCE, unit, ie_softc[unit].ie_chan_attn); -} - -/* - * Here is a helper routine for iernr() and ieinit(). This sets up - * the RFA. - */ -static v_caddr_t -setup_rfa(v_caddr_t ptr, struct ie_softc * ie) -{ - volatile struct ie_recv_frame_desc *rfd = (volatile void *)ptr; - volatile struct ie_recv_buf_desc *rbd; - int i; - int unit = ie - &ie_softc[0]; - - /* First lay them out */ - for (i = 0; i < ie->nframes; i++) { - ie->rframes[i] = rfd; - bzero((volatile char *) rfd, sizeof *rfd); /* ignore cast-qual */ - rfd++; - } - - ptr = Alignvol(rfd); /* ignore cast-qual */ - - /* Now link them together */ - for (i = 0; i < ie->nframes; i++) { - ie->rframes[i]->ie_fd_next = - MK_16(MEM, ie->rframes[(i + 1) % ie->nframes]); - } - - /* Finally, set the EOL bit on the last one. */ - ie->rframes[ie->nframes - 1]->ie_fd_last |= IE_FD_LAST; - - /* - * Now lay out some buffers for the incoming frames. Note that we - * set aside a bit of slop in each buffer, to make sure that we have - * enough space to hold a single frame in every buffer. - */ - rbd = (volatile void *) ptr; - - for (i = 0; i < ie->nrxbufs; i++) { - ie->rbuffs[i] = rbd; - bzero((volatile char *)rbd, sizeof *rbd); - ptr = Alignvol(ptr + sizeof *rbd); - rbd->ie_rbd_length = IE_RBUF_SIZE; - rbd->ie_rbd_buffer = MK_24(MEM, ptr); - ie->cbuffs[i] = (volatile void *) ptr; - ptr += IE_RBUF_SIZE; - rbd = (volatile void *) ptr; - } - - /* Now link them together */ - for (i = 0; i < ie->nrxbufs; i++) { - ie->rbuffs[i]->ie_rbd_next = - MK_16(MEM, ie->rbuffs[(i + 1) % ie->nrxbufs]); - } - - /* Tag EOF on the last one */ - ie->rbuffs[ie->nrxbufs - 1]->ie_rbd_length |= IE_RBD_LAST; - - /* - * We use the head and tail pointers on receive to keep track of the - * order in which RFDs and RBDs are used. - */ - ie->rfhead = 0; - ie->rftail = ie->nframes - 1; - ie->rbhead = 0; - ie->rbtail = ie->nrxbufs - 1; - - ie->scb->ie_recv_list = MK_16(MEM, ie->rframes[0]); - ie->rframes[0]->ie_fd_buf_desc = MK_16(MEM, ie->rbuffs[0]); - - ptr = Alignvol(ptr); - return (ptr); -} - -/* - * Run the multicast setup command. - */ -static int -mc_setup(int unit, v_caddr_t ptr, - volatile struct ie_sys_ctl_block * scb) -{ - struct ie_softc *ie = &ie_softc[unit]; - volatile struct ie_mcast_cmd *cmd = (volatile void *) ptr; - - cmd->com.ie_cmd_status = 0; - cmd->com.ie_cmd_cmd = IE_CMD_MCAST | IE_CMD_LAST; - cmd->com.ie_cmd_link = 0xffff; - - /* ignore cast-qual */ - bcopy((v_caddr_t) ie->mcast_addrs, (v_caddr_t) cmd->ie_mcast_addrs, - ie->mcast_count * sizeof *ie->mcast_addrs); - - cmd->ie_mcast_bytes = ie->mcast_count * 6; /* grrr... */ - - scb->ie_command_list = MK_16(MEM, cmd); - if (command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL) - || !(cmd->com.ie_cmd_status & IE_STAT_OK)) { - kprintf("ie%d: multicast address setup command failed\n", unit); - return (0); - } - return (1); -} - -/* - * This routine takes the environment generated by check_ie_present() - * and adds to it all the other structures we need to operate the adapter. - * This includes executing the CONFIGURE, IA-SETUP, and MC-SETUP commands, - * starting the receiver unit, and clearing interrupts. - */ -static void -ieinit(void *xsc) -{ - struct ie_softc *ie = xsc; - volatile struct ie_sys_ctl_block *scb = ie->scb; - v_caddr_t ptr; - int i; - int unit = ie->unit; - - ptr = Alignvol((volatile char *) scb + sizeof *scb); - - /* - * Send the configure command first. - */ - { - volatile struct ie_config_cmd *cmd = (volatile void *) ptr; - - ie_setup_config(cmd, ie->promisc, - ie->hard_type == IE_STARLAN10); - cmd->com.ie_cmd_status = 0; - cmd->com.ie_cmd_cmd = IE_CMD_CONFIG | IE_CMD_LAST; - cmd->com.ie_cmd_link = 0xffff; - - scb->ie_command_list = MK_16(MEM, cmd); - - if (command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL) - || !(cmd->com.ie_cmd_status & IE_STAT_OK)) { - kprintf("ie%d: configure command failed\n", unit); - return; - } - } - /* - * Now send the Individual Address Setup command. - */ - { - volatile struct ie_iasetup_cmd *cmd = (volatile void *) ptr; - - cmd->com.ie_cmd_status = 0; - cmd->com.ie_cmd_cmd = IE_CMD_IASETUP | IE_CMD_LAST; - cmd->com.ie_cmd_link = 0xffff; - - bcopy((volatile char *)ie_softc[unit].arpcom.ac_enaddr, - (volatile char *)&cmd->ie_address, sizeof cmd->ie_address); - scb->ie_command_list = MK_16(MEM, cmd); - if (command_and_wait(unit, IE_CU_START, cmd, IE_STAT_COMPL) - || !(cmd->com.ie_cmd_status & IE_STAT_OK)) { - kprintf("ie%d: individual address " - "setup command failed\n", unit); - return; - } - } - - /* - * Now run the time-domain reflectometer. - */ - run_tdr(unit, (volatile void *) ptr); - - /* - * Acknowledge any interrupts we have generated thus far. - */ - ie_ack(ie->scb, IE_ST_WHENCE, unit, ie->ie_chan_attn); - - /* - * Set up the RFA. - */ - ptr = setup_rfa(ptr, ie); - - /* - * Finally, the transmit command and buffer are the last little bit - * of work. - */ - - /* transmit command buffers */ - for (i = 0; i < ie->ntxbufs; i++) { - ie->xmit_cmds[i] = (volatile void *) ptr; - ptr += sizeof *ie->xmit_cmds[i]; - ptr = Alignvol(ptr); - ie->xmit_buffs[i] = (volatile void *)ptr; - ptr += sizeof *ie->xmit_buffs[i]; - ptr = Alignvol(ptr); - } - - /* transmit buffers */ - for (i = 0; i < ie->ntxbufs - 1; i++) { - ie->xmit_cbuffs[i] = (volatile void *)ptr; - ptr += IE_BUF_LEN; - ptr = Alignvol(ptr); - } - ie->xmit_cbuffs[ie->ntxbufs - 1] = (volatile void *) ptr; - - for (i = 1; i < ie->ntxbufs; i++) { - bzero((v_caddr_t) ie->xmit_cmds[i], sizeof *ie->xmit_cmds[i]); - bzero((v_caddr_t) ie->xmit_buffs[i], sizeof *ie->xmit_buffs[i]); - } - - /* - * This must be coordinated with iestart() and ietint(). - */ - ie->xmit_cmds[0]->ie_xmit_status = IE_STAT_COMPL; - - /* take the ee16 out of loopback */ - if (ie->hard_type == IE_EE16) { - u_int8_t bart_config; - - bart_config = inb(PORT + IEE16_CONFIG); - bart_config &= ~IEE16_BART_LOOPBACK; - /* inb doesn't get bit! */ - bart_config |= IEE16_BART_MCS16_TEST; - outb(PORT + IEE16_CONFIG, bart_config); - ee16_interrupt_enable(ie); - ee16_chan_attn(unit); - } - ie->arpcom.ac_if.if_flags |= IFF_RUNNING; /* tell higher levels - * we're here */ - start_receiver(unit); -} - -static void -ie_stop(int unit) -{ - command_and_wait(unit, IE_RU_DISABLE, 0, 0); -} - -static int -ieioctl(struct ifnet *ifp, u_long command, caddr_t data, struct ucred *cr) -{ - int error = 0; - - switch (command) { - case SIOCSIFFLAGS: - /* - * Note that this device doesn't have an "all multicast" - * mode, so we must turn on promiscuous mode and do the - * filtering manually. - */ - if ((ifp->if_flags & IFF_UP) == 0 && - (ifp->if_flags & IFF_RUNNING)) { - ifp->if_flags &= ~IFF_RUNNING; - ie_stop(ifp->if_dunit); - } else if ((ifp->if_flags & IFF_UP) && - (ifp->if_flags & IFF_RUNNING) == 0) { - ie_softc[ifp->if_dunit].promisc = - ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI); - ieinit(ifp->if_softc); - } else if (ie_softc[ifp->if_dunit].promisc ^ - (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI))) { - ie_softc[ifp->if_dunit].promisc = - ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI); - ieinit(ifp->if_softc); - } - break; - - case SIOCADDMULTI: - case SIOCDELMULTI: - /* - * Update multicast listeners - */ - /* reset multicast filtering */ - ie_mc_reset(ifp->if_dunit); - error = 0; - break; - - default: - error = ether_ioctl(ifp, command, data); - break; - } - return (error); -} - -static void -ie_mc_reset(int unit) -{ - struct ie_softc *ie = &ie_softc[unit]; - struct ifmultiaddr *ifma; - - /* - * Step through the list of addresses. - */ - ie->mcast_count = 0; - TAILQ_FOREACH(ifma, &ie->arpcom.ac_if.if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - - /* XXX - this is broken... */ - if (ie->mcast_count >= MAXMCAST) { - ie->arpcom.ac_if.if_flags |= IFF_ALLMULTI; - ieioctl(&ie->arpcom.ac_if, SIOCSIFFLAGS, NULL, - NULL); - goto setflag; - } - bcopy(LLADDR((struct sockaddr_dl *) ifma->ifma_addr), - &(ie->mcast_addrs[ie->mcast_count]), 6); - ie->mcast_count++; - } - -setflag: - ie->want_mcsetup = 1; -} - - -#ifdef DEBUG -static void -print_rbd(volatile struct ie_recv_buf_desc * rbd) -{ - kprintf("RBD at %p:\n" - "actual %04x, next %04x, buffer %p\n" - "length %04x, mbz %04x\n", - (volatile void *) rbd, - rbd->ie_rbd_actual, rbd->ie_rbd_next, - (void *) rbd->ie_rbd_buffer, - rbd->ie_rbd_length, rbd->mbz); -} - -#endif /* DEBUG */ diff --git a/sys/dev/netif/ie/if_ie507.h b/sys/dev/netif/ie/if_ie507.h deleted file mode 100644 index 26f5ab1a78..0000000000 --- a/sys/dev/netif/ie/if_ie507.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * $FreeBSD: src/sys/dev/ie/if_ie507.h,v 1.4 1999/08/28 00:44:47 peter Exp $ - * $DragonFly: src/sys/dev/netif/ie/if_ie507.h,v 1.2 2003/06/17 04:28:27 dillon Exp $ - * Definitions for 3C507 - */ - -#define IE507_CTRL 6 /* control port */ -#define IE507_ICTRL 10 /* interrupt control */ -#define IE507_ATTN 11 /* any write here sends a chan attn */ -#define IE507_MADDR 14 /* shared memory configuration */ -#define IE507_IRQ 15 /* IRQ configuration */ - -#define EL_CTRL_BNK1 0x01 /* register bank 1 */ -#define EL_CTRL_IEN 0x04 /* interrupt enable */ -#define EL_CTRL_INTL 0x08 /* interrupt active latch */ -#define EL_CTRL_16BIT 0x10 /* bus width; clear = 8-bit, set = 16-bit */ -#define EL_CTRL_LOOP 0x20 /* loopback mode */ -#define EL_CTRL_NRST 0x80 /* turn off to reset */ -#define EL_CTRL_RESET (EL_CTRL_LOOP) -#define EL_CTRL_NORMAL (EL_CTRL_NRST | EL_CTRL_IEN | EL_CTRL_BNK1) diff --git a/sys/dev/netif/ie/if_iee16.h b/sys/dev/netif/ie/if_iee16.h deleted file mode 100644 index 89766cfe29..0000000000 --- a/sys/dev/netif/ie/if_iee16.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 1993, 1994, 1995 - * Rodney W. Grimes, Milwaukie, Oregon 97222. 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 as - * the first lines of this file unmodified. - * 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 Rodney W. Grimes. - * 4. 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 RODNEY W. GRIMES ``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 RODNEY W. GRIMES 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: src/sys/dev/ie/if_iee16.h,v 1.1.10.1 2000/08/02 22:36:29 peter Exp $ - * $DragonFly: src/sys/dev/netif/ie/if_iee16.h,v 1.2 2003/06/17 04:28:27 dillon Exp $ - */ - -/* - * Definitions for EtherExpress 16 - */ - -#define IEE16_ATTN 0x06 /* channel attention control */ -#define IEE16_IRQ 0x07 /* IRQ configuration */ -#define IEE16_IRQ_ENABLE 0x08 /* enable board interrupts */ - -#define IEE16_MEMDEC 0x0a /* memory decode */ -#define IEE16_MCTRL 0x0b /* memory control */ -#define IEE16_MCTRL_FMCS16 0x10 /* MEMCS16- for F000 */ - -#define IEE16_MPCTRL 0x0c /* memory page control */ -#define IEE16_CONFIG 0x0d /* config register */ -#define IEE16_BART_LOOPBACK 0x02 /* loopback, 0=none, 1=loopback */ -#define IEE16_BART_IOCHRDY_LATE 0x10 /* iochrdy late control bit */ -#define IEE16_BART_IO_TEST_EN 0x20 /* enable iochrdy timing test */ -#define IEE16_BART_IO_RESULT 0x40 /* result of the iochrdy test */ -#define IEE16_BART_MCS16_TEST 0x80 /* enable memcs16 select test */ - -#define IEE16_ECTRL 0x0e /* eeprom control */ -#define IEE16_ECTRL_EESK 0x01 /* EEPROM clock bit */ -#define IEE16_ECTRL_EECS 0x02 /* EEPROM chip select */ -#define IEE16_ECTRL_EEDI 0x04 /* EEPROM data in bit */ -#define IEE16_ECTRL_EEDO 0x08 /* EEPROM data out bit */ -#define IEE16_RESET_ASIC 0x40 /* reset ASIC (bart) pin */ -#define IEE16_RESET_586 0x80 /* reset 82586 pin */ -#define IEE16_ECTRL_MASK 0xb2 /* and'ed with ECTRL to enable read */ - -#define IEE16_MECTRL 0x0f /* memory control, 0xe000 seg 'W' */ -#define IEE16_ID_PORT 0x0f /* auto-id port 'R' */ - -#define IEE16_ID 0xbaba /* known id of EE16 */ - -#define IEE16_EEPROM_READ 0x06 /* EEPROM read opcode */ -#define IEE16_EEPROM_OPSIZE1 0x03 /* size of EEPROM opcodes */ -#define IEE16_EEPROM_ADDR_SIZE 0x06 /* size of EEPROM address */ - -/* Locations in the EEPROM */ -#define IEE16_EEPROM_CONFIG1 0x00 /* Configuration register 1 */ -#define IEE16_EEPROM_IRQ 0xE000 /* Encoded IRQ */ -#define IEE16_EEPROM_IRQ_SHIFT 13 /* To shift IRQ to lower bits */ -#define IEE16_EEPROM_LOCK_ADDR 0x01 /* contains the lock bit */ -#define IEE16_EEPROM_LOCKED 0x01 /* means that it is locked */ - -#define IEE16_EEPROM_ENET_LOW 0x02 /* Ethernet address, low word */ -#define IEE16_EEPROM_ENET_MID 0x03 /* Ethernet address, middle word */ -#define IEE16_EEPROM_ENET_HIGH 0x04 /* Ethernet address, high word */ diff --git a/sys/dev/netif/ie/if_iereg.h b/sys/dev/netif/ie/if_iereg.h deleted file mode 100644 index bc402180fc..0000000000 --- a/sys/dev/netif/ie/if_iereg.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * $FreeBSD: src/sys/dev/ie/if_iereg.h,v 1.4 1999/08/28 00:44:47 peter Exp $ - * $DragonFly: src/sys/dev/netif/ie/if_iereg.h,v 1.2 2003/06/17 04:28:27 dillon Exp $ - * definitions for AT&T StarLAN 10 etc... - */ - -#define IEATT_RESET 0 /* any write here resets the 586 */ -#define IEATT_ATTN 1 /* any write here sends a Chan attn */ -#define IEATT_REVISION 6 /* read here to figure out this board */ -#define IEATT_ATTRIB 7 /* more information about this board */ - -#define SL_BOARD(x) ((x) & 0x0f) -#define SL_REV(x) ((x) >> 4) - -#define SL1_BOARD 0 -#define SL10_BOARD 1 -#define EN100_BOARD 2 -#define SLFIBER_BOARD 3 - -#define SL_ATTR_WIDTH 0x04 /* bus width: clear -> 8-bit */ -#define SL_ATTR_SPEED 0x08 /* medium speed: clear -> 10 Mbps */ -#define SL_ATTR_CODING 0x10 /* encoding: clear -> Manchester */ -#define SL_ATTR_HBW 0x20 /* host bus width: clear -> 16-bit */ -#define SL_ATTR_TYPE 0x40 /* medium type: clear -> Ethernet */ -#define SL_ATTR_BOOTROM 0x80 /* set -> boot ROM present */ diff --git a/sys/dev/netif/le/if_le.c b/sys/dev/netif/le/if_le.c deleted file mode 100644 index d30d01e403..0000000000 --- a/sys/dev/netif/le/if_le.c +++ /dev/null @@ -1,1819 +0,0 @@ -/*- - * Copyright (c) 1994 Matt Thomas (thomas@lkg.dec.com) - * 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. 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 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: src/sys/i386/isa/if_le.c,v 1.56.2.4 2002/06/05 23:24:10 paul Exp $ - * $DragonFly: src/sys/dev/netif/le/if_le.c,v 1.39 2008/08/02 01:14:42 dillon Exp $ - */ - -/* - * DEC EtherWORKS 2 Ethernet Controllers - * DEC EtherWORKS 3 Ethernet Controllers - * - * Written by Matt Thomas - * BPF support code stolen directly from if_ec.c - * - * This driver supports the DEPCA, DE100, DE101, DE200, DE201, - * DE2002, DE203, DE204, DE205, and DE422 cards. - */ - -#include "use_le.h" -#include "opt_inet.h" -#include "opt_ipx.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include -#include - -#include - -typedef u_short le_mcbits_t; -#define LE_MC_NBPW_LOG2 4 -#define LE_MC_NBPW (1 << LE_MC_NBPW_LOG2) - -struct le_softc; - -struct le_board { - int (*bd_probe)(struct le_softc *sc, const struct le_board *bd, int *msize); -}; - -/* - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - * Start of DEC EtherWORKS III (LEMAC) dependent structures - * - */ -#include /* Include LEMAC definitions */ - -DECLARE_DUMMY_MODULE(if_le); - -static int lemac_probe(struct le_softc *sc, const struct le_board *bd, int *msize); - -struct le_lemac_info { - u_int lemac__lastpage; /* last 2K page */ - u_int lemac__memmode; /* Are we in 2K, 32K, or 64K mode */ - u_int lemac__membase; /* Physical address of start of RAM */ - u_int lemac__txctl; /* Transmit Control Byte */ - u_int lemac__txmax; /* Maximum # of outstanding transmits */ - le_mcbits_t lemac__mctbl[LEMAC_MCTBL_SIZE/sizeof(le_mcbits_t)]; - /* local copy of multicast table */ - u_char lemac__eeprom[LEMAC_EEP_SIZE]; /* local copy eeprom */ - char lemac__prodname[LEMAC_EEP_PRDNMSZ+1]; /* prodname name */ -#define lemac_lastpage le_un.un_lemac.lemac__lastpage -#define lemac_memmode le_un.un_lemac.lemac__memmode -#define lemac_membase le_un.un_lemac.lemac__membase -#define lemac_txctl le_un.un_lemac.lemac__txctl -#define lemac_txmax le_un.un_lemac.lemac__txmax -#define lemac_mctbl le_un.un_lemac.lemac__mctbl -#define lemac_eeprom le_un.un_lemac.lemac__eeprom -#define lemac_prodname le_un.un_lemac.lemac__prodname -}; - -/* - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - * Start of DEC EtherWORKS II (LANCE) dependent structures - * - */ - -#include - -#ifndef LN_DOSTATS -#define LN_DOSTATS 1 -#endif - -static int depca_probe(struct le_softc *sc, const struct le_board *bd, int *msize); - -typedef struct lance_descinfo lance_descinfo_t; -typedef struct lance_ring lance_ring_t; - -typedef unsigned lance_addr_t; - -struct lance_descinfo { - caddr_t di_addr; /* address of descriptor */ - lance_addr_t di_bufaddr; /* LANCE address of buffer owned by descriptor */ - unsigned di_buflen; /* size of buffer owned by descriptor */ - struct mbuf *di_mbuf; /* mbuf being transmitted/received */ -}; - -struct lance_ring { - lance_descinfo_t *ri_first; /* Pointer to first descriptor in ring */ - lance_descinfo_t *ri_last; /* Pointer to last + 1 descriptor in ring */ - lance_descinfo_t *ri_nextin; /* Pointer to next one to be given to HOST */ - lance_descinfo_t *ri_nextout; /* Pointer to next one to be given to LANCE */ - unsigned ri_max; /* Size of Ring - 1 */ - unsigned ri_free; /* Number of free rings entires (owned by HOST) */ - lance_addr_t ri_heap; /* Start of RAM for this ring */ - lance_addr_t ri_heapend; /* End + 1 of RAM for this ring */ - lance_addr_t ri_outptr; /* Pointer to first output byte */ - unsigned ri_outsize; /* Space remaining for output */ -}; - -struct le_lance_info { - unsigned lance__csr1; /* LANCE Address of init block (low 16) */ - unsigned lance__csr2; /* LANCE Address of init block (high 8) */ - unsigned lance__csr3; /* Copy of CSR3 */ - unsigned lance__rap; /* IO Port Offset of RAP */ - unsigned lance__rdp; /* IO Port Offset of RDP */ - unsigned lance__ramoffset; /* Offset to valid LANCE RAM */ - unsigned lance__ramsize; /* Amount of RAM shared by LANCE */ - unsigned lance__rxbufsize; /* Size of a receive buffer */ - ln_initb_t lance__initb; /* local copy of LANCE initblock */ - ln_initb_t *lance__raminitb; /* copy to board's LANCE initblock (debugging) */ - ln_desc_t *lance__ramdesc; /* copy to board's LANCE descriptors (debugging) */ - lance_ring_t lance__rxinfo; /* Receive ring information */ - lance_ring_t lance__txinfo; /* Transmit ring information */ -#define lance_csr1 le_un.un_lance.lance__csr1 -#define lance_csr2 le_un.un_lance.lance__csr2 -#define lance_csr3 le_un.un_lance.lance__csr3 -#define lance_rap le_un.un_lance.lance__rap -#define lance_rdp le_un.un_lance.lance__rdp -#define lance_ramoffset le_un.un_lance.lance__ramoffset -#define lance_ramsize le_un.un_lance.lance__ramsize -#define lance_rxbufsize le_un.un_lance.lance__rxbufsize -#define lance_initb le_un.un_lance.lance__initb -#define lance_raminitb le_un.un_lance.lance__raminitb -#define lance_ramdesc le_un.un_lance.lance__ramdesc -#define lance_rxinfo le_un.un_lance.lance__rxinfo -#define lance_txinfo le_un.un_lance.lance__txinfo -}; - -/* - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - * Start of Common Code - * - */ - -static void (*le_intrvec[NLE])(struct le_softc *sc); - -/* - * Ethernet status, per interface. - */ -struct le_softc { - struct arpcom le_ac; /* Common Ethernet/ARP Structure */ - void (*if_init) (void *);/* Interface init routine */ - void (*if_reset) (struct le_softc*);/* Interface reset routine */ - caddr_t le_membase; /* Starting memory address (virtual) */ - unsigned le_iobase; /* Starting I/O base address */ - unsigned le_irq; /* Interrupt Request Value */ - unsigned le_flags; /* local copy of if_flags */ -#define LE_BRDCSTONLY 0x01000000 /* If only broadcast is enabled */ - u_int le_mcmask; /* bit mask for CRC-32 for multicast hash */ - le_mcbits_t *le_mctbl; /* pointer to multicast table */ - const char *le_prodname; /* product name DE20x-xx */ - u_char le_hwaddr[6]; /* local copy of hwaddr */ - union { - struct le_lemac_info un_lemac; /* LEMAC specific information */ - struct le_lance_info un_lance; /* Am7990 specific information */ - } le_un; -}; -#define le_if le_ac.ac_if - - -static int le_probe(struct isa_device *dvp); -static int le_attach(struct isa_device *dvp); -static void le_intr(void *); -static int le_ioctl(struct ifnet *ifp, u_long command, caddr_t data, - struct ucred *cr); -static void le_input(struct le_softc *sc, caddr_t seg1, size_t total_len, - size_t len2, caddr_t seg2); -static void le_multi_filter(struct le_softc *sc); -static void le_multi_op(struct le_softc *sc, const u_char *mca, int oper_flg); -static int le_read_macaddr(struct le_softc *sc, int ioreg, int skippat); - -static struct le_softc le_softc[NLE]; - -static const struct le_board le_boards[] = { - { lemac_probe }, /* DE20[345] */ - { depca_probe }, /* DE{20[012],422} */ - { NULL } /* Must Be Last! */ -}; - -static struct lwkt_serialize le_serialize; - -/* - * This tells the autoconf code how to set us up. - */ -struct isa_driver ledriver = { - le_probe, le_attach, "le", -}; - -static unsigned le_intrs[NLE]; - -#define LE_INL(sc, reg) inl((sc)->le_iobase + (reg)) -#define LE_OUTL(sc, reg, data) outl((sc)->le_iobase + (reg), data) -#define LE_INW(sc, reg) inw((sc)->le_iobase + (reg)) -#define LE_OUTW(sc, reg, data) outw((sc)->le_iobase + (reg), data) -#define LE_INB(sc, reg) inb((sc)->le_iobase + (reg)) -#define LE_OUTB(sc, reg, data) outb((sc)->le_iobase + (reg), data) - -static int -le_probe(struct isa_device *dvp) -{ - struct le_softc *sc = &le_softc[dvp->id_unit]; - const struct le_board *bd; - int iospace; - - lwkt_serialize_init(&le_serialize); - - if (dvp->id_unit >= NLE) { - kprintf("%s%d not configured -- too many devices\n", - ledriver.name, dvp->id_unit); - return 0; - } - - sc->le_iobase = dvp->id_iobase; - sc->le_membase = (u_char *) dvp->id_maddr; - sc->le_irq = dvp->id_irq; - if_initname(&(sc->le_if), ledriver.name, dvp->id_unit); - - /* - * Find and Initialize board.. - */ - - sc->le_flags &= ~(IFF_UP|IFF_ALLMULTI); - - for (bd = le_boards; bd->bd_probe != NULL; bd++) { - if ((iospace = (*bd->bd_probe)(sc, bd, &dvp->id_msize)) != 0) { - return iospace; - } - } - - return 0; -} - -static int -le_attach(struct isa_device *dvp) -{ - struct le_softc *sc = &le_softc[dvp->id_unit]; - struct ifnet *ifp = &sc->le_if; - - dvp->id_intr = (inthand2_t *)le_intr; - ifp->if_softc = sc; - ifp->if_mtu = ETHERMTU; - - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_ioctl = le_ioctl; - ifp->if_type = IFT_ETHER; - ifp->if_addrlen = 6; - ifp->if_hdrlen = 14; - ifp->if_init = sc->if_init; - ifp->if_baudrate = 10000000; - ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN); - ifq_set_ready(&ifp->if_snd); - - ether_ifattach(ifp, sc->le_ac.ac_enaddr, &le_serialize); - - return 1; -} - -static void -le_intr(void *arg) -{ - int unit = (int)arg; - - lwkt_serialize_enter(&le_serialize); - le_intrs[unit]++; - (*le_intrvec[unit])(&le_softc[unit]); - lwkt_serialize_exit(&le_serialize); -} - -#define LE_XTRA 0 - -static void -le_input(struct le_softc *sc, caddr_t seg1, size_t total_len, - size_t len1, caddr_t seg2) -{ - struct mbuf *m; - - m = m_getl(total_len + LE_XTRA, MB_DONTWAIT, MT_DATA, M_PKTHDR, NULL); - if (m == NULL) { - sc->le_if.if_ierrors++; - return; - } - m->m_data += LE_XTRA; - m->m_len = m->m_pkthdr.len = total_len; - - bcopy(seg1, mtod(m, caddr_t), len1); - if (seg2 != NULL) - bcopy(seg2, mtod(m, caddr_t) + len1, total_len - len1); - sc->le_if.if_input(&sc->le_if, m); -} - -static int -le_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cr) -{ - struct le_softc *sc = ifp->if_softc; - int error = 0; - - if ((sc->le_flags & IFF_UP) == 0) - return EIO; - - switch (cmd) { - case SIOCSIFFLAGS: { - sc->if_init(sc); - break; - } - - case SIOCADDMULTI: - case SIOCDELMULTI: - /* - * Update multicast listeners - */ - sc->if_init(sc); - error = 0; - break; - - default: - error = ether_ioctl(ifp, cmd, data); - break; - } - return error; -} - -/* - * This is the standard method of reading the DEC Address ROMS. - * I don't understand it but it does work. - */ -static int -le_read_macaddr(struct le_softc *sc, int ioreg, int skippat) -{ - int cksum, rom_cksum; - - if (!skippat) { - int idx, idx2, found, octet; - static u_char testpat[] = { 0xFF, 0, 0x55, 0xAA, 0xFF, 0, 0x55, 0xAA }; - idx2 = found = 0; - - for (idx = 0; idx < 32; idx++) { - octet = LE_INB(sc, ioreg); - - if (octet == testpat[idx2]) { - if (++idx2 == sizeof testpat) { - ++found; - break; - } - } else { - idx2 = 0; - } - } - - if (!found) - return -1; - } - - cksum = 0; - sc->le_hwaddr[0] = LE_INB(sc, ioreg); - sc->le_hwaddr[1] = LE_INB(sc, ioreg); - - cksum = *(u_short *) &sc->le_hwaddr[0]; - - sc->le_hwaddr[2] = LE_INB(sc, ioreg); - sc->le_hwaddr[3] = LE_INB(sc, ioreg); - cksum *= 2; - if (cksum > 65535) cksum -= 65535; - cksum += *(u_short *) &sc->le_hwaddr[2]; - if (cksum > 65535) cksum -= 65535; - - sc->le_hwaddr[4] = LE_INB(sc, ioreg); - sc->le_hwaddr[5] = LE_INB(sc, ioreg); - cksum *= 2; - if (cksum > 65535) cksum -= 65535; - cksum += *(u_short *) &sc->le_hwaddr[4]; - if (cksum >= 65535) cksum -= 65535; - - rom_cksum = LE_INB(sc, ioreg); - rom_cksum |= LE_INB(sc, ioreg) << 8; - - if (cksum != rom_cksum) - return -1; - return 0; -} - -static void -le_multi_filter(struct le_softc *sc) -{ - struct ifnet *ifp = &sc->le_ac.ac_if; - struct ifmultiaddr *ifma; - - bzero(sc->le_mctbl, (sc->le_mcmask + 1) / 8); - - if (sc->le_if.if_flags & IFF_ALLMULTI) { - sc->le_flags |= IFF_MULTICAST|IFF_ALLMULTI; - return; - } - sc->le_flags &= ~IFF_MULTICAST; - /* if (interface has had an address assigned) { */ - le_multi_op(sc, ifp->if_broadcastaddr, TRUE); - sc->le_flags |= LE_BRDCSTONLY|IFF_MULTICAST; - /* } */ - - sc->le_flags |= IFF_MULTICAST; - - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - - le_multi_op(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr), 1); - sc->le_flags &= ~LE_BRDCSTONLY; - } -} - -static void -le_multi_op(struct le_softc *sc, const u_char *mca, int enable) -{ - uint32_t bit, idx, crc; - - crc = ether_crc32_le(mca, ETHER_ADDR_LEN); - - /* - * The following two line convert the N bit index into a longword index - * and a longword mask. - */ - crc &= sc->le_mcmask; - bit = 1 << (crc & (LE_MC_NBPW -1)); - idx = crc >> (LE_MC_NBPW_LOG2); - - /* - * Set or clear hash filter bit in our table. - */ - if (enable) { - sc->le_mctbl[idx] |= bit; /* Set Bit */ - } else { - sc->le_mctbl[idx] &= ~bit; /* Clear Bit */ - } -} - -/* - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - * Start of DEC EtherWORKS III (LEMAC) dependent code - * - */ - -#define LEMAC_INTR_ENABLE(sc) \ - LE_OUTB(sc, LEMAC_REG_IC, LE_INB(sc, LEMAC_REG_IC) | LEMAC_IC_ALL) - -#define LEMAC_INTR_DISABLE(sc) \ - LE_OUTB(sc, LEMAC_REG_IC, LE_INB(sc, LEMAC_REG_IC) & ~LEMAC_IC_ALL) - -#define LEMAC_64K_MODE(mbase) (((mbase) >= 0x0A) && ((mbase) <= 0x0F)) -#define LEMAC_32K_MODE(mbase) (((mbase) >= 0x14) && ((mbase) <= 0x1F)) -#define LEMAC_2K_MODE(mbase) ( (mbase) >= 0x40) - -static void lemac_init(void *xsc); -static void lemac_start(struct ifnet *ifp); -static void lemac_reset(struct le_softc *sc); -static void lemac_intr(struct le_softc *sc); -static void lemac_rne_intr(struct le_softc *sc); -static void lemac_tne_intr(struct le_softc *sc); -static void lemac_txd_intr(struct le_softc *sc, unsigned cs_value); -static void lemac_rxd_intr(struct le_softc *sc, unsigned cs_value); -static int lemac_read_eeprom(struct le_softc *sc); -static void lemac_init_adapmem(struct le_softc *sc); - -#define LE_MCBITS_ALL_1S ((le_mcbits_t)~(le_mcbits_t)0) - -static const le_mcbits_t lemac_allmulti_mctbl[16] = { - LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, - LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, - LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, - LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, LE_MCBITS_ALL_1S, -}; -/* - * An IRQ mapping table. Less space than switch statement. - */ -static const int lemac_irqs[] = { ICU_IRQ5, ICU_IRQ10, ICU_IRQ11, ICU_IRQ15 }; - -/* - * Some tuning/monitoring variables. - */ -static unsigned lemac_deftxmax = 16; /* see lemac_max above */ -static unsigned lemac_txnospc = 0; /* total # of tranmit starvations */ - -static unsigned lemac_tne_intrs = 0; /* total # of tranmit done intrs */ -static unsigned lemac_rne_intrs = 0; /* total # of receive done intrs */ -static unsigned lemac_txd_intrs = 0; /* total # of tranmit error intrs */ -static unsigned lemac_rxd_intrs = 0; /* total # of receive error intrs */ - -static int -lemac_probe(struct le_softc *sc, const struct le_board *bd, int *msize) -{ - int irq, portval; - - LE_OUTB(sc, LEMAC_REG_IOP, LEMAC_IOP_EEINIT); - DELAY(LEMAC_EEP_DELAY); - - /* - * Read Ethernet address if card is present. - */ - if (le_read_macaddr(sc, LEMAC_REG_APD, 0) < 0) - return 0; - - bcopy(sc->le_hwaddr, sc->le_ac.ac_enaddr, ETHER_ADDR_LEN); - /* - * Clear interrupts and set IRQ. - */ - - portval = LE_INB(sc, LEMAC_REG_IC) & LEMAC_IC_IRQMSK; - irq = lemac_irqs[portval >> 5]; - LE_OUTB(sc, LEMAC_REG_IC, portval); - - /* - * Make sure settings match. - */ - - if (irq != sc->le_irq) { - if_printf(&sc->le_if, "lemac configuration error: expected IRQ 0x%x actual 0x%x\n", - sc->le_irq, irq); - return 0; - } - - /* - * Try to reset the unit - */ - sc->if_init = lemac_init; - sc->le_if.if_start = lemac_start; - sc->if_reset = lemac_reset; - sc->lemac_memmode = 2; - sc->if_reset(sc); - if ((sc->le_flags & IFF_UP) == 0) - return 0; - - /* - * Check for correct memory base configuration. - */ - if (vtophys(sc->le_membase) != sc->lemac_membase) { - if_printf(&sc->le_if, "lemac configuration error: expected iomem 0x%llx actual 0x%x\n", - vtophys(sc->le_membase), sc->lemac_membase); - return 0; - } - - sc->le_prodname = sc->lemac_prodname; - sc->le_mctbl = sc->lemac_mctbl; - sc->le_mcmask = (1 << LEMAC_MCTBL_BITS) - 1; - sc->lemac_txmax = lemac_deftxmax; - *msize = 2048; - le_intrvec[sc->le_if.if_dunit] = lemac_intr; - - return LEMAC_IOSPACE; -} - -/* - * Do a hard reset of the board; - */ -static void -lemac_reset(struct le_softc *sc) -{ - struct ifnet *ifp = &sc->le_if; - int portval, cksum; - - /* - * Initialize board.. - */ - - sc->le_flags &= IFF_UP; - ifp->if_flags &= ~IFF_OACTIVE; - LEMAC_INTR_DISABLE(sc); - - LE_OUTB(sc, LEMAC_REG_IOP, LEMAC_IOP_EEINIT); - DELAY(LEMAC_EEP_DELAY); - - /* Disable Interrupts */ - /* LE_OUTB(sc, LEMAC_REG_IC, LE_INB(sc, LEMAC_REG_IC) & ICR_IRQ_SEL); */ - - /* - * Read EEPROM information. NOTE - the placement of this function - * is important because functions hereafter may rely on information - * read from the EEPROM. - */ - if ((cksum = lemac_read_eeprom(sc)) != LEMAC_EEP_CKSUM) { - if_printf(ifp, "reset: EEPROM checksum failed (0x%x)\n", cksum); - return; - } - - /* - * Force to 2K mode if not already configured. - */ - - portval = LE_INB(sc, LEMAC_REG_MBR); - if (!LEMAC_2K_MODE(portval)) { - if (LEMAC_64K_MODE(portval)) { - portval = (((portval * 2) & 0xF) << 4); - sc->lemac_memmode = 64; - } else if (LEMAC_32K_MODE(portval)) { - portval = ((portval & 0xF) << 4); - sc->lemac_memmode = 32; - } - LE_OUTB(sc, LEMAC_REG_MBR, portval); - } - sc->lemac_membase = portval * (2 * 1024) + (512 * 1024); - - /* - * Initialize Free Memory Queue, Init mcast table with broadcast. - */ - - lemac_init_adapmem(sc); - sc->le_flags |= IFF_UP; -} - -static void -lemac_init(void *xsc) -{ - struct le_softc *sc = (struct le_softc *)xsc; - - if ((sc->le_flags & IFF_UP) == 0) - return; - - /* - * If the interface has the up flag - */ - if (sc->le_if.if_flags & IFF_UP) { - int saved_cs = LE_INB(sc, LEMAC_REG_CS); - LE_OUTB(sc, LEMAC_REG_CS, saved_cs | (LEMAC_CS_TXD | LEMAC_CS_RXD)); - LE_OUTB(sc, LEMAC_REG_PA0, sc->le_ac.ac_enaddr[0]); - LE_OUTB(sc, LEMAC_REG_PA1, sc->le_ac.ac_enaddr[1]); - LE_OUTB(sc, LEMAC_REG_PA2, sc->le_ac.ac_enaddr[2]); - LE_OUTB(sc, LEMAC_REG_PA3, sc->le_ac.ac_enaddr[3]); - LE_OUTB(sc, LEMAC_REG_PA4, sc->le_ac.ac_enaddr[4]); - LE_OUTB(sc, LEMAC_REG_PA5, sc->le_ac.ac_enaddr[5]); - - LE_OUTB(sc, LEMAC_REG_IC, LE_INB(sc, LEMAC_REG_IC) | LEMAC_IC_IE); - - if (sc->le_if.if_flags & IFF_PROMISC) { - LE_OUTB(sc, LEMAC_REG_CS, LEMAC_CS_MCE | LEMAC_CS_PME); - } else { - LEMAC_INTR_DISABLE(sc); - le_multi_filter(sc); - LE_OUTB(sc, LEMAC_REG_MPN, 0); - if ((sc->le_flags | sc->le_if.if_flags) & IFF_ALLMULTI) { - bcopy(lemac_allmulti_mctbl, &sc->le_membase[LEMAC_MCTBL_OFF], sizeof(lemac_allmulti_mctbl)); - } else { - bcopy(sc->lemac_mctbl, &sc->le_membase[LEMAC_MCTBL_OFF], sizeof(sc->lemac_mctbl)); - } - LE_OUTB(sc, LEMAC_REG_CS, LEMAC_CS_MCE); - } - - LE_OUTB(sc, LEMAC_REG_CTL, LE_INB(sc, LEMAC_REG_CTL) ^ LEMAC_CTL_LED); - - LEMAC_INTR_ENABLE(sc); - sc->le_if.if_flags |= IFF_RUNNING; - } else { - LE_OUTB(sc, LEMAC_REG_CS, LEMAC_CS_RXD|LEMAC_CS_TXD); - - LEMAC_INTR_DISABLE(sc); - sc->le_if.if_flags &= ~IFF_RUNNING; - } -} - -/* - * What to do upon receipt of an interrupt. - */ -static void -lemac_intr(struct le_softc *sc) -{ - int cs_value; - - LEMAC_INTR_DISABLE(sc); /* Mask interrupts */ - - /* - * Determine cause of interrupt. Receive events take - * priority over Transmit. - */ - - cs_value = LE_INB(sc, LEMAC_REG_CS); - - /* - * Check for Receive Queue not being empty. - * Check for Transmit Done Queue not being empty. - */ - - if (cs_value & LEMAC_CS_RNE) - lemac_rne_intr(sc); - if (cs_value & LEMAC_CS_TNE) - lemac_tne_intr(sc); - - /* - * Check for Transmitter Disabled. - * Check for Receiver Disabled. - */ - - if (cs_value & LEMAC_CS_TXD) - lemac_txd_intr(sc, cs_value); - if (cs_value & LEMAC_CS_RXD) - lemac_rxd_intr(sc, cs_value); - - /* - * Toggle LED and unmask interrupts. - */ - - LE_OUTB(sc, LEMAC_REG_CTL, LE_INB(sc, LEMAC_REG_CTL) ^ LEMAC_CTL_LED); - LEMAC_INTR_ENABLE(sc); /* Unmask interrupts */ -} - -static void -lemac_rne_intr(struct le_softc *sc) -{ - int rxcount, rxlen, rxpg; - u_char *rxptr; - - lemac_rne_intrs++; - rxcount = LE_INB(sc, LEMAC_REG_RQC); - while (rxcount--) { - rxpg = LE_INB(sc, LEMAC_REG_RQ); - LE_OUTB(sc, LEMAC_REG_MPN, rxpg); - - rxptr = sc->le_membase; - sc->le_if.if_ipackets++; - if (*rxptr & LEMAC_RX_OK) { - - /* - * Get receive length - subtract out checksum. - */ - - rxlen = ((*(u_int *)rxptr >> 8) & 0x7FF) - 4; - le_input(sc, rxptr + sizeof(u_int), rxlen, rxlen, NULL); - } else { /* end if (*rxptr & LEMAC_RX_OK) */ - sc->le_if.if_ierrors++; - } - LE_OUTB(sc, LEMAC_REG_FMQ, rxpg); /* Return this page to Free Memory Queue */ - } /* end while (recv_count--) */ -} - -static void -lemac_rxd_intr(struct le_softc *sc, unsigned cs_value) -{ - /* - * Handle CS_RXD (Receiver disabled) here. - * - * Check Free Memory Queue Count. If not equal to zero - * then just turn Receiver back on. If it is equal to - * zero then check to see if transmitter is disabled. - * Process transmit TXD loop once more. If all else - * fails then do software init (0xC0 to EEPROM Init) - * and rebuild Free Memory Queue. - */ - - lemac_rxd_intrs++; - - /* - * Re-enable Receiver. - */ - - cs_value &= ~LEMAC_CS_RXD; - LE_OUTB(sc, LEMAC_REG_CS, cs_value); - - if (LE_INB(sc, LEMAC_REG_FMC) > 0) - return; - - if (cs_value & LEMAC_CS_TXD) - lemac_txd_intr(sc, cs_value); - - if ((LE_INB(sc, LEMAC_REG_CS) & LEMAC_CS_RXD) == 0) - return; - - if_printf(&sc->le_if, "fatal RXD error, attempting recovery\n"); - - sc->if_reset(sc); - if (sc->le_flags & IFF_UP) { - lemac_init(sc); - return; - } - - /* - * Error during initializion. Mark card as disabled. - */ - if_printf(&sc->le_if, "recovery failed -- board disabled\n"); -} - -static void -lemac_start(struct ifnet *ifp) -{ - struct le_softc *sc = (struct le_softc *) ifp; - - if ((ifp->if_flags & IFF_RUNNING) == 0) - return; - - LEMAC_INTR_DISABLE(sc); - - while (!ifq_is_empty(&ifp->if_snd)) { - struct mbuf *m; - int tx_pg; - u_int txhdr, txoff; - - if (LE_INB(sc, LEMAC_REG_TQC) >= sc->lemac_txmax) { - ifp->if_flags |= IFF_OACTIVE; - break; - } - - tx_pg = LE_INB(sc, LEMAC_REG_FMQ); /* get free memory page */ - /* - * Check for good transmit page. - */ - if (tx_pg == 0 || tx_pg > sc->lemac_lastpage) { - lemac_txnospc++; - ifp->if_flags |= IFF_OACTIVE; - break; - } - - m = ifq_dequeue(&ifp->if_snd, NULL); - if (m == NULL) - break; - LE_OUTB(sc, LEMAC_REG_MPN, tx_pg); /* Shift 2K window. */ - - /* - * The first four bytes of each transmit buffer are for - * control information. The first byte is the control - * byte, then the length (why not word aligned?), then - * the off to the buffer. - */ - - txoff = (mtod(m, u_int) & (sizeof(u_long) - 1)) + LEMAC_TX_HDRSZ; - txhdr = sc->lemac_txctl | (m->m_pkthdr.len << 8) | (txoff << 24); - *(u_int *) sc->le_membase = txhdr; - - /* - * Copy the packet to the board - */ - - m_copydata(m, 0, m->m_pkthdr.len, sc->le_membase + txoff); - - LE_OUTB(sc, LEMAC_REG_TQ, tx_pg); /* tell chip to transmit this packet */ - - BPF_MTAP(ifp, m); - - m_freem(m); /* free the mbuf */ - } - LEMAC_INTR_ENABLE(sc); -} - -static void -lemac_tne_intr(struct le_softc *sc) -{ - int txsts, txcount = LE_INB(sc, LEMAC_REG_TDC); - - lemac_tne_intrs++; - while (txcount--) { - txsts = LE_INB(sc, LEMAC_REG_TDQ); - sc->le_if.if_opackets++; /* another one done */ - if ((txsts & LEMAC_TDQ_COL) != LEMAC_TDQ_NOCOL) - sc->le_if.if_collisions++; - } - sc->le_if.if_flags &= ~IFF_OACTIVE; - if_devstart(&sc->le_if); -} - -static void -lemac_txd_intr(struct le_softc *sc, unsigned cs_value) -{ - /* - * Read transmit status, remove transmit buffer from - * transmit queue and place on free memory queue, - * then reset transmitter. - * Increment appropriate counters. - */ - - lemac_txd_intrs++; - sc->le_if.if_oerrors++; - if (LE_INB(sc, LEMAC_REG_TS) & LEMAC_TS_ECL) - sc->le_if.if_collisions++; - sc->le_if.if_flags &= ~IFF_OACTIVE; - - LE_OUTB(sc, LEMAC_REG_FMQ, LE_INB(sc, LEMAC_REG_TQ)); - /* Get Page number and write it back out */ - - LE_OUTB(sc, LEMAC_REG_CS, cs_value & ~LEMAC_CS_TXD); - /* Turn back on transmitter */ -} - -static int -lemac_read_eeprom(struct le_softc *sc) -{ - int word_off, cksum; - - u_char *ep; - - cksum = 0; - ep = sc->lemac_eeprom; - for (word_off = 0; word_off < LEMAC_EEP_SIZE / 2; word_off++) { - LE_OUTB(sc, LEMAC_REG_PI1, word_off); - LE_OUTB(sc, LEMAC_REG_IOP, LEMAC_IOP_EEREAD); - - DELAY(LEMAC_EEP_DELAY); - - *ep = LE_INB(sc, LEMAC_REG_EE1); cksum += *ep++; - *ep = LE_INB(sc, LEMAC_REG_EE2); cksum += *ep++; - } - - /* - * Set up Transmit Control Byte for use later during transmit. - */ - - sc->lemac_txctl |= LEMAC_TX_FLAGS; - - if ((sc->lemac_eeprom[LEMAC_EEP_SWFLAGS] & LEMAC_EEP_SW_SQE) == 0) - sc->lemac_txctl &= ~LEMAC_TX_SQE; - - if (sc->lemac_eeprom[LEMAC_EEP_SWFLAGS] & LEMAC_EEP_SW_LAB) - sc->lemac_txctl |= LEMAC_TX_LAB; - - bcopy(&sc->lemac_eeprom[LEMAC_EEP_PRDNM], sc->lemac_prodname, LEMAC_EEP_PRDNMSZ); - sc->lemac_prodname[LEMAC_EEP_PRDNMSZ] = '\0'; - - return cksum % 256; -} - -static void -lemac_init_adapmem(struct le_softc *sc) -{ - int pg, conf; - - conf = LE_INB(sc, LEMAC_REG_CNF); - - if ((sc->lemac_eeprom[LEMAC_EEP_SETUP] & LEMAC_EEP_ST_DRAM) == 0) { - sc->lemac_lastpage = 63; - conf &= ~LEMAC_CNF_DRAM; - } else { - sc->lemac_lastpage = 127; - conf |= LEMAC_CNF_DRAM; - } - - LE_OUTB(sc, LEMAC_REG_CNF, conf); - - for (pg = 1; pg <= sc->lemac_lastpage; pg++) - LE_OUTB(sc, LEMAC_REG_FMQ, pg); - - return; -} - -/* - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * - * Start of DEPCA (DE200/DE201/DE202/DE422 etal) support. - * - */ -static void depca_intr(struct le_softc *sc); -static int lance_init_adapmem(struct le_softc *sc); -static int lance_init_ring(struct le_softc *sc, ln_ring_t *rp, lance_ring_t *ri, - unsigned ndescs, unsigned bufoffset, - unsigned descoffset); -static void lance_init(void *xsc); -static void lance_reset(struct le_softc *sc); -static void lance_intr(struct le_softc *sc); -static int lance_rx_intr(struct le_softc *sc); -static void lance_start(struct ifnet *ifp); -static int lance_tx_intr(struct le_softc *sc); - -#define LN_BUFSIZE /* 380 */ 304 /* 1520 / 4 */ -#define LN_TXDESC_RATIO 2048 -#define LN_DESC_MAX 128 - -#if LN_DOSTATS -static struct { - unsigned lance_rx_misses; - unsigned lance_rx_badcrc; - unsigned lance_rx_badalign; - unsigned lance_rx_badframe; - unsigned lance_rx_buferror; - unsigned lance_tx_deferred; - unsigned lance_tx_single_collisions; - unsigned lance_tx_multiple_collisions; - unsigned lance_tx_excessive_collisions; - unsigned lance_tx_late_collisions; - - unsigned lance_memory_errors; - unsigned lance_inits; - unsigned lance_tx_intrs; - unsigned lance_tx_nospc[2]; - unsigned lance_tx_drains[2]; - unsigned lance_tx_orphaned; - unsigned lance_tx_adoptions; - unsigned lance_tx_emptied; - unsigned lance_tx_deftxint; - unsigned lance_tx_buferror; - unsigned lance_high_txoutptr; - unsigned lance_low_txheapsize; - unsigned lance_low_txfree; - unsigned lance_tx_intr_hidescs; - /* unsigned lance_tx_intr_descs[LN_DESC_MAX]; */ - - unsigned lance_rx_intrs; - unsigned lance_rx_badsop; - unsigned lance_rx_contig; - unsigned lance_rx_noncontig; - unsigned lance_rx_intr_hidescs; - unsigned lance_rx_ndescs[4096 / LN_BUFSIZE]; - /* unsigned lance_rx_intr_descs[LN_DESC_MAX]; */ -} lance_stats; - -#define LN_STAT(stat) (lance_stats.lance_ ## stat) -#define LN_MINSTAT(stat, val) (LN_STAT(stat > (val)) ? LN_STAT(stat = (val)) : 0) -#define LN_MAXSTAT(stat, val) (LN_STAT(stat < (val)) ? LN_STAT(stat = (val)) : 0) - -#else -#define LN_STAT(stat) 0 -#define LN_MINSTAT(stat, val) 0 -#define LN_MAXSTAT(stat, val) 0 -#endif - -#define LN_SELCSR(sc, csrno) (LE_OUTW(sc, sc->lance_rap, csrno)) -#define LN_INQCSR(sc) (LE_INW(sc, sc->lance_rap)) - -#define LN_WRCSR(sc, val) (LE_OUTW(sc, sc->lance_rdp, val)) -#define LN_RDCSR(sc) (LE_INW(sc, sc->lance_rdp)) - - -#define LN_ZERO(sc, vaddr, len) bzero(vaddr, len) -#define LN_COPYTO(sc, from, to, len) bcopy(from, to, len) - -#define LN_SETFLAG(sc, vaddr, val) \ - (((volatile u_char *) vaddr)[3] = (val)) - -#define LN_PUTDESC(sc, desc, vaddr) \ - (((volatile u_short *) vaddr)[0] = ((u_short *) desc)[0], \ - ((volatile u_short *) vaddr)[2] = ((u_short *) desc)[2], \ - ((volatile u_short *) vaddr)[1] = ((u_short *) desc)[1]) - -/* - * Only get the descriptor flags and length/status. All else - * read-only. - */ -#define LN_GETDESC(sc, desc, vaddr) \ - (((u_short *) desc)[1] = ((volatile u_short *) vaddr)[1], \ - ((u_short *) desc)[3] = ((volatile u_short *) vaddr)[3]) - -/* - * These definitions are specific to the DEC "DEPCA-style" NICs. - * (DEPCA, DE10x, DE20[012], DE422) - * - */ -#define DEPCA_REG_NICSR 0 /* (RW;16) NI Control / Status */ -#define DEPCA_REG_RDP 4 /* (RW:16) LANCE RDP (data) register */ -#define DEPCA_REG_RAP 6 /* (RW:16) LANCE RAP (address) register */ -#define DEPCA_REG_ADDRROM 12 /* (R : 8) DEPCA Ethernet Address ROM */ -#define DEPCA_IOSPACE 16 /* DEPCAs use 16 bytes of IO space */ - -#define DEPCA_NICSR_LED 0x0001 /* Light the LED on the back of the DEPCA */ -#define DEPCA_NICSR_ENABINTR 0x0002 /* Enable Interrupts */ -#define DEPCA_NICSR_MASKINTR 0x0004 /* Mask Interrupts */ -#define DEPCA_NICSR_AAC 0x0008 /* Address Counter Clear */ -#define DEPCA_NICSR_REMOTEBOOT 0x0010 /* Remote Boot Enabled (ignored) */ -#define DEPCA_NICSR_32KRAM 0x0020 /* DEPCA LANCE RAM size 64K (C) / 32K (S) */ -#define DEPCA_NICSR_LOW32K 0x0040 /* Bank Select (A15 = !This Bit) */ -#define DEPCA_NICSR_SHE 0x0080 /* Shared RAM Enabled (ie hide ROM) */ -#define DEPCA_NICSR_BOOTTMO 0x0100 /* Remote Boot Timeout (ignored) */ - -#define DEPCA_RDNICSR(sc) (LE_INW(sc, DEPCA_REG_NICSR)) -#define DEPCA_WRNICSR(sc, val) (LE_OUTW(sc, DEPCA_REG_NICSR, val)) - -#define DEPCA_IDSTR_OFFSET 0xC006 /* ID String Offset */ - -#define DEPCA_REG_EISAID 0x80 -#define DEPCA_EISAID_MASK 0xf0ffffff -#define DEPCA_EISAID_DE422 0x2042A310 - -typedef enum { - DEPCA_CLASSIC, - DEPCA_DE100, DEPCA_DE101, - DEPCA_EE100, - DEPCA_DE200, DEPCA_DE201, DEPCA_DE202, - DEPCA_DE422, - DEPCA_UNKNOWN -} depca_t; - -static const char *depca_signatures[] = { - "DEPCA", - "DE100", "DE101", - "EE100", - "DE200", "DE201", "DE202", - "DE422", - NULL -}; - -static int -depca_probe(struct le_softc *sc, const struct le_board *bd, int *msize) -{ - unsigned nicsr, idx, idstr_offset = DEPCA_IDSTR_OFFSET; - - /* - * Find out how memory we are dealing with. Adjust - * the ID string offset approriately if we are at - * 32K. Make sure the ROM is enabled. - */ - nicsr = DEPCA_RDNICSR(sc); - nicsr &= ~(DEPCA_NICSR_SHE|DEPCA_NICSR_LED|DEPCA_NICSR_ENABINTR); - - if (nicsr & DEPCA_NICSR_32KRAM) { - /* - * Make we are going to read the upper - * 32K so we do read the ROM. - */ - sc->lance_ramsize = 32 * 1024; - nicsr &= ~DEPCA_NICSR_LOW32K; - sc->lance_ramoffset = 32 * 1024; - idstr_offset -= sc->lance_ramsize; - } else { - sc->lance_ramsize = 64 * 1024; - sc->lance_ramoffset = 0; - } - DEPCA_WRNICSR(sc, nicsr); - - sc->le_prodname = NULL; - for (idx = 0; depca_signatures[idx] != NULL; idx++) { - if (bcmp(depca_signatures[idx], sc->le_membase + idstr_offset, 5) == 0) { - sc->le_prodname = depca_signatures[idx]; - break; - } - } - - if (sc->le_prodname == NULL) { - /* - * Try to get the EISA device if it's a DE422. - */ - if (sc->le_iobase > 0x1000 && (sc->le_iobase & 0x0F00) == 0x0C00 - && (LE_INL(sc, DEPCA_REG_EISAID) & DEPCA_EISAID_MASK) - == DEPCA_EISAID_DE422) { - sc->le_prodname = "DE422"; - } else { - return 0; - } - } - if (idx == DEPCA_CLASSIC) - sc->lance_ramsize -= 16384; /* Can't use the ROM area on a DEPCA */ - - /* - * Try to read the address ROM. - * Stop the LANCE, reset the Address ROM Counter (AAC), - * read the NICSR to "clock" in the reset, and then - * re-enable the Address ROM Counter. Now read the - * address ROM. - */ - sc->lance_rdp = DEPCA_REG_RDP; - sc->lance_rap = DEPCA_REG_RAP; - sc->lance_csr3 = LN_CSR3_ALE; - sc->le_mctbl = sc->lance_initb.ln_multi_mask; - sc->le_mcmask = LN_MC_MASK; - LN_SELCSR(sc, LN_CSR0); - LN_WRCSR(sc, LN_CSR0_STOP); - - if (idx < DEPCA_DE200) { - DEPCA_WRNICSR(sc, DEPCA_RDNICSR(sc) & ~DEPCA_NICSR_AAC); - DEPCA_WRNICSR(sc, DEPCA_RDNICSR(sc) | DEPCA_NICSR_AAC); - } - - if (le_read_macaddr(sc, DEPCA_REG_ADDRROM, idx == DEPCA_CLASSIC) < 0) - return 0; - - bcopy(sc->le_hwaddr, sc->le_ac.ac_enaddr, ETHER_ADDR_LEN); - /* - * Renable shared RAM. - */ - DEPCA_WRNICSR(sc, DEPCA_RDNICSR(sc) | DEPCA_NICSR_SHE); - - le_intrvec[sc->le_if.if_dunit] = depca_intr; - if (!lance_init_adapmem(sc)) - return 0; - - sc->if_reset = lance_reset; - sc->if_init = lance_init; - sc->le_if.if_start = lance_start; - DEPCA_WRNICSR(sc, DEPCA_NICSR_SHE | DEPCA_NICSR_ENABINTR); - sc->if_reset(sc); - - LN_STAT(low_txfree = sc->lance_txinfo.ri_max); - LN_STAT(low_txheapsize = 0xFFFFFFFF); - *msize = sc->lance_ramsize; - return DEPCA_IOSPACE; -} - -static void -depca_intr(struct le_softc *sc) -{ - DEPCA_WRNICSR(sc, DEPCA_RDNICSR(sc) ^ DEPCA_NICSR_LED); - lance_intr(sc); -} - -/* - * Here's as good a place to describe our paritioning of the - * LANCE shared RAM space. (NOTE: this driver does not yet support - * the concept of a LANCE being able to DMA). - * - * First is the 24 (00:23) bytes for LANCE Initialization Block - * Next are the recieve descriptors. The number is calculated from - * how many LN_BUFSIZE buffers we can allocate (this number must - * be a power of 2). Next are the transmit descriptors. The amount - * of transmit descriptors is derived from the size of the RAM - * divided by 1K. Now come the receive buffers (one for each receive - * descriptor). Finally is the transmit heap. (no fixed buffers are - * allocated so as to make the most use of the limited space). - */ -static int -lance_init_adapmem(struct le_softc *sc) -{ - lance_addr_t rxbufoffset; - lance_addr_t rxdescoffset, txdescoffset; - unsigned rxdescs, txdescs; - - /* - * First calculate how many descriptors we heap. - * Note this assumes the ramsize is a power of two. - */ - sc->lance_rxbufsize = LN_BUFSIZE; - rxdescs = 1; - while (rxdescs * sc->lance_rxbufsize < sc->lance_ramsize) - rxdescs *= 2; - rxdescs /= 2; - if (rxdescs > LN_DESC_MAX) { - sc->lance_rxbufsize *= rxdescs / LN_DESC_MAX; - rxdescs = LN_DESC_MAX; - } - txdescs = sc->lance_ramsize / LN_TXDESC_RATIO; - if (txdescs > LN_DESC_MAX) - txdescs = LN_DESC_MAX; - - /* - * Now calculate where everything goes in memory - */ - rxdescoffset = sizeof(ln_initb_t); - txdescoffset = rxdescoffset + sizeof(ln_desc_t) * rxdescs; - rxbufoffset = txdescoffset + sizeof(ln_desc_t) * txdescs; - - sc->le_mctbl = (le_mcbits_t *) sc->lance_initb.ln_multi_mask; - /* - * Remember these for debugging. - */ - sc->lance_raminitb = (ln_initb_t *) sc->le_membase; - sc->lance_ramdesc = (ln_desc_t *) (sc->le_membase + rxdescoffset); - - /* - * Initialize the rings. - */ - if (!lance_init_ring(sc, &sc->lance_initb.ln_rxring, &sc->lance_rxinfo, - rxdescs, rxbufoffset, rxdescoffset)) - return 0; - sc->lance_rxinfo.ri_heap = rxbufoffset; - sc->lance_rxinfo.ri_heapend = rxbufoffset + sc->lance_rxbufsize * rxdescs; - - if (!lance_init_ring(sc, &sc->lance_initb.ln_txring, &sc->lance_txinfo, - txdescs, 0, txdescoffset)) - return 0; - sc->lance_txinfo.ri_heap = sc->lance_rxinfo.ri_heapend; - sc->lance_txinfo.ri_heapend = sc->lance_ramsize; - - /* - * Set CSR1 and CSR2 to the address of the init block (which - * for us is always 0. - */ - sc->lance_csr1 = LN_ADDR_LO(0 + sc->lance_ramoffset); - sc->lance_csr2 = LN_ADDR_HI(0 + sc->lance_ramoffset); - return 1; -} - -static int -lance_init_ring(struct le_softc *sc, ln_ring_t *rp, lance_ring_t *ri, - unsigned ndescs, lance_addr_t bufoffset, lance_addr_t descoffset) -{ - lance_descinfo_t *di; - - /* - * Initialize the ring pointer in the LANCE InitBlock - */ - rp->r_addr_lo = LN_ADDR_LO(descoffset + sc->lance_ramoffset); - rp->r_addr_hi = LN_ADDR_HI(descoffset + sc->lance_ramoffset); - rp->r_log2_size = ffs(ndescs) - 1; - - /* - * Allocate the ring entry descriptors and initialize - * our ring information data structure. All these are - * our copies and do not live in the LANCE RAM. - */ - ri->ri_first = kmalloc(ndescs * sizeof(*di), M_DEVBUF, M_WAITOK); - ri->ri_free = ri->ri_max = ndescs; - ri->ri_last = ri->ri_first + ri->ri_max; - for (di = ri->ri_first; di < ri->ri_last; di++) { - di->di_addr = sc->le_membase + descoffset; - di->di_mbuf = NULL; - if (bufoffset) { - di->di_bufaddr = bufoffset; - di->di_buflen = sc->lance_rxbufsize; - bufoffset += sc->lance_rxbufsize; - } - descoffset += sizeof(ln_desc_t); - } - return 1; -} - -static void -lance_dumpcsrs(struct le_softc *sc, const char *id) -{ - if_printf(&sc->le_if, "%s: nicsr=%04x", id, DEPCA_RDNICSR(sc)); - LN_SELCSR(sc, LN_CSR0); - kprintf(" csr0=%04x", LN_RDCSR(sc)); - LN_SELCSR(sc, LN_CSR1); - kprintf(" csr1=%04x", LN_RDCSR(sc)); - LN_SELCSR(sc, LN_CSR2); - kprintf(" csr2=%04x", LN_RDCSR(sc)); - LN_SELCSR(sc, LN_CSR3); - kprintf(" csr3=%04x\n", LN_RDCSR(sc)); - LN_SELCSR(sc, LN_CSR0); -} - -static void -lance_reset(struct le_softc *sc) -{ - int cnt, csr; - - /* lance_dumpcsrs(sc, "lance_reset: start"); */ - - LN_WRCSR(sc, LN_RDCSR(sc) & ~LN_CSR0_ENABINTR); - LN_WRCSR(sc, LN_CSR0_STOP); - DELAY(100); - - sc->le_flags &= ~IFF_UP; - sc->le_if.if_flags &= ~(IFF_UP|IFF_RUNNING); - - le_multi_filter(sc); /* initialize the multicast table */ - if ((sc->le_flags | sc->le_if.if_flags) & IFF_ALLMULTI) { - sc->lance_initb.ln_multi_mask[0] = 0xFFFFU; - sc->lance_initb.ln_multi_mask[1] = 0xFFFFU; - sc->lance_initb.ln_multi_mask[2] = 0xFFFFU; - sc->lance_initb.ln_multi_mask[3] = 0xFFFFU; - } - sc->lance_initb.ln_physaddr[0] = ((u_short *) sc->le_ac.ac_enaddr)[0]; - sc->lance_initb.ln_physaddr[1] = ((u_short *) sc->le_ac.ac_enaddr)[1]; - sc->lance_initb.ln_physaddr[2] = ((u_short *) sc->le_ac.ac_enaddr)[2]; - if (sc->le_if.if_flags & IFF_PROMISC) { - sc->lance_initb.ln_mode |= LN_MODE_PROMISC; - } else { - sc->lance_initb.ln_mode &= ~LN_MODE_PROMISC; - } - /* - * We force the init block to be at the start - * of the LANCE's RAM buffer. - */ - LN_COPYTO(sc, &sc->lance_initb, sc->le_membase, sizeof(sc->lance_initb)); - LN_SELCSR(sc, LN_CSR1); LN_WRCSR(sc, sc->lance_csr1); - LN_SELCSR(sc, LN_CSR2); LN_WRCSR(sc, sc->lance_csr2); - LN_SELCSR(sc, LN_CSR3); LN_WRCSR(sc, sc->lance_csr3); - - /* lance_dumpcsrs(sc, "lance_reset: preinit"); */ - - /* - * clear INITDONE and INIT the chip - */ - LN_SELCSR(sc, LN_CSR0); - LN_WRCSR(sc, LN_CSR0_INIT|LN_CSR0_INITDONE); - - csr = 0; - cnt = 100; - while (cnt-- > 0) { - if (((csr = LN_RDCSR(sc)) & LN_CSR0_INITDONE) != 0) - break; - DELAY(10000); - } - - if ((csr & LN_CSR0_INITDONE) == 0) { /* make sure we got out okay */ - lance_dumpcsrs(sc, "lance_reset: reset failure"); - } else { - /* lance_dumpcsrs(sc, "lance_reset: end"); */ - sc->le_if.if_flags |= IFF_UP; - sc->le_flags |= IFF_UP; - } -} - -static void -lance_init(void *xsc) -{ - struct le_softc *sc = (struct le_softc *)xsc; - lance_ring_t *ri; - lance_descinfo_t *di; - ln_desc_t desc; - - LN_STAT(inits++); - if (sc->le_if.if_flags & IFF_RUNNING) { - sc->if_reset(sc); - lance_tx_intr(sc); - /* - * If we were running, abort any pending transmits. - */ - ri = &sc->lance_txinfo; - di = ri->ri_nextout; - while (ri->ri_free < ri->ri_max) { - if (--di == ri->ri_first) - di = ri->ri_nextout - 1; - if (di->di_mbuf == NULL) - break; - m_free(di->di_mbuf); - di->di_mbuf = NULL; - ri->ri_free++; - } - } else { - sc->if_reset(sc); - } - - /* - * Reset the transmit ring. Make sure we own all the buffers. - * Also reset the transmit heap. - */ - sc->le_if.if_flags &= ~IFF_OACTIVE; - ri = &sc->lance_txinfo; - for (di = ri->ri_first; di < ri->ri_last; di++) { - if (di->di_mbuf != NULL) { - m_freem(di->di_mbuf); - di->di_mbuf = NULL; - } - desc.d_flag = 0; - desc.d_addr_lo = LN_ADDR_LO(ri->ri_heap + sc->lance_ramoffset); - desc.d_addr_hi = LN_ADDR_HI(ri->ri_heap + sc->lance_ramoffset); - desc.d_buflen = 0; - LN_PUTDESC(sc, &desc, di->di_addr); - } - ri->ri_nextin = ri->ri_nextout = ri->ri_first; - ri->ri_free = ri->ri_max; - ri->ri_outptr = ri->ri_heap; - ri->ri_outsize = ri->ri_heapend - ri->ri_heap; - - ri = &sc->lance_rxinfo; - desc.d_flag = LN_DFLAG_OWNER; - desc.d_buflen = 0 - sc->lance_rxbufsize; - for (di = ri->ri_first; di < ri->ri_last; di++) { - desc.d_addr_lo = LN_ADDR_LO(di->di_bufaddr + sc->lance_ramoffset); - desc.d_addr_hi = LN_ADDR_HI(di->di_bufaddr + sc->lance_ramoffset); - LN_PUTDESC(sc, &desc, di->di_addr); - } - ri->ri_nextin = ri->ri_nextout = ri->ri_first; - ri->ri_outptr = ri->ri_heap; - ri->ri_outsize = ri->ri_heapend - ri->ri_heap; - ri->ri_free = 0; - - if (sc->le_if.if_flags & IFF_UP) { - sc->le_if.if_flags |= IFF_RUNNING; - LN_WRCSR(sc, LN_CSR0_START|LN_CSR0_INITDONE|LN_CSR0_ENABINTR); - /* lance_dumpcsrs(sc, "lance_init: up"); */ - if_devstart(&sc->le_if); - } else { - /* lance_dumpcsrs(sc, "lance_init: down"); */ - sc->le_if.if_flags &= ~IFF_RUNNING; - } -} - -static void -lance_intr(struct le_softc *sc) -{ - unsigned oldcsr; - - oldcsr = LN_RDCSR(sc); - oldcsr &= ~LN_CSR0_ENABINTR; - LN_WRCSR(sc, oldcsr); - LN_WRCSR(sc, LN_CSR0_ENABINTR); - - if (oldcsr & LN_CSR0_ERRSUM) { - if (oldcsr & LN_CSR0_MISS) { - /* - * LN_CSR0_MISS is signaled when the LANCE receiver - * loses a packet because it doesn't own a receive - * descriptor. Rev. D LANCE chips, which are no - * longer used, require a chip reset as described - * below. - */ - LN_STAT(rx_misses++); - } - if (oldcsr & LN_CSR0_MEMERROR) { - LN_STAT(memory_errors++); - if (oldcsr & (LN_CSR0_RXON|LN_CSR0_TXON)) { - lance_init(sc); - return; - } - } - } - - if ((oldcsr & LN_CSR0_RXINT) && lance_rx_intr(sc)) { - lance_init(sc); - return; - } - - if (oldcsr & LN_CSR0_TXINT) { - if (lance_tx_intr(sc)) - if_devstart(&sc->le_if); - } - - if (oldcsr == (LN_CSR0_PENDINTR|LN_CSR0_RXON|LN_CSR0_TXON)) - if_printf(&sc->le_if, "lance_intr: stray interrupt\n"); -} - -static int -lance_rx_intr(struct le_softc *sc) -{ - lance_ring_t *ri = &sc->lance_rxinfo; - lance_descinfo_t *eop; - ln_desc_t desc; - int ndescs, total_len, rxdescs; - - LN_STAT(rx_intrs++); - - for (rxdescs = 0;;) { - /* - * Now to try to find the end of this packet chain. - */ - for (ndescs = 1, eop = ri->ri_nextin;; ndescs++) { - /* - * If we don't own this descriptor, the packet ain't - * all here so return because we are done. - */ - LN_GETDESC(sc, &desc, eop->di_addr); - if (desc.d_flag & LN_DFLAG_OWNER) - return 0; - /* - * In case we have missed a packet and gotten the - * LANCE confused, make sure we are pointing at the - * start of a packet. If we aren't, something is really - * strange so reinit the LANCE. - */ - if (desc.d_flag & LN_DFLAG_RxBUFERROR) { - LN_STAT(rx_buferror++); - return 1; - } - if ((desc.d_flag & LN_DFLAG_SOP) && eop != ri->ri_nextin) { - LN_STAT(rx_badsop++); - return 1; - } - if (desc.d_flag & LN_DFLAG_EOP) - break; - if (++eop == ri->ri_last) - eop = ri->ri_first; - } - - total_len = (desc.d_status & LN_DSTS_RxLENMASK) - 4; - if ((desc.d_flag & LN_DFLAG_RxERRSUM) == 0) { - /* - * Valid Packet -- If the SOP is less than or equal to the EOP - * or the length is less than the receive buffer size, then the - * packet is contiguous in memory and can be copied in one shot. - * Otherwise we need to copy two segments to get the entire - * packet. - */ - if (ri->ri_nextin <= eop || total_len <= ri->ri_heapend - ri->ri_nextin->di_bufaddr) { - le_input(sc, sc->le_membase + ri->ri_nextin->di_bufaddr, - total_len, total_len, NULL); - LN_STAT(rx_contig++); - } else { - le_input(sc, sc->le_membase + ri->ri_nextin->di_bufaddr, - total_len, - ri->ri_heapend - ri->ri_nextin->di_bufaddr, - sc->le_membase + ri->ri_first->di_bufaddr); - LN_STAT(rx_noncontig++); - } - } else { - /* - * If the packet is bad, increment the - * counters. - */ - sc->le_if.if_ierrors++; - if (desc.d_flag & LN_DFLAG_RxBADCRC) - LN_STAT(rx_badcrc++); - if (desc.d_flag & LN_DFLAG_RxOVERFLOW) - LN_STAT(rx_badalign++); - if (desc.d_flag & LN_DFLAG_RxFRAMING) - LN_STAT(rx_badframe++); - } - sc->le_if.if_ipackets++; - LN_STAT(rx_ndescs[ndescs-1]++); - rxdescs += ndescs; - while (ndescs-- > 0) { - LN_SETFLAG(sc, ri->ri_nextin->di_addr, LN_DFLAG_OWNER); - if (++ri->ri_nextin == ri->ri_last) - ri->ri_nextin = ri->ri_first; - } - } - /* LN_STAT(rx_intr_descs[rxdescs]++); */ - LN_MAXSTAT(rx_intr_hidescs, rxdescs); - - return 0; -} - -static void -lance_start(struct ifnet *ifp) -{ - struct le_softc *sc = (struct le_softc *) ifp; - lance_ring_t *ri = &sc->lance_txinfo; - lance_descinfo_t *di; - ln_desc_t desc; - unsigned len, slop; - struct mbuf *m, *m0; - caddr_t bp; - - if ((ifp->if_flags & IFF_RUNNING) == 0) - return; - - for (;;) { - m = ifq_dequeue(&ifp->if_snd, NULL); - if (m == NULL) - break; - - /* - * Make the packet meets the minimum size for Ethernet. - * The slop is so that we also use an even number of longwards. - */ - len = ETHERMIN + sizeof(struct ether_header); - if (m->m_pkthdr.len > len) - len = m->m_pkthdr.len; - - slop = (8 - len) & 3; - /* - * If there are no free ring entries (there must be always - * one owned by the host), or there's not enough space for - * this packet, or this packet would wrap around the end - * of LANCE RAM then wait for the transmits to empty for - * space and ring entries to become available. - */ - if (ri->ri_free == 1 || len + slop > ri->ri_outsize) { - /* - * Try to see if we can free up anything off the transit ring. - */ - ifq_prepend(&ifp->if_snd, m); - if (lance_tx_intr(sc) > 0) { - LN_STAT(tx_drains[0]++); - continue; - } - LN_STAT(tx_nospc[0]++); - break; - } - - if (len + slop > ri->ri_heapend - ri->ri_outptr) { - /* - * Since the packet won't fit in the end of the transmit - * heap, see if there is space at the beginning of the transmit - * heap. If not, try again when there is space. - */ - LN_STAT(tx_orphaned++); - slop += ri->ri_heapend - ri->ri_outptr; - if (len + slop > ri->ri_outsize) { - LN_STAT(tx_nospc[1]++); - ifq_prepend(&ifp->if_snd, m); - break; - } - /* - * Point to the beginning of the heap - */ - ri->ri_outptr = ri->ri_heap; - LN_STAT(tx_adoptions++); - } - - /* - * Initialize the descriptor (saving the buffer address, - * buffer length, and mbuf) and write the packet out - * to the board. - */ - di = ri->ri_nextout; - di->di_bufaddr = ri->ri_outptr; - di->di_buflen = len + slop; - di->di_mbuf = m; - bp = sc->le_membase + di->di_bufaddr; - for (m0 = m; m0 != NULL; m0 = m0->m_next) { - LN_COPYTO(sc, mtod(m0, caddr_t), bp, m0->m_len); - bp += m0->m_len; - } - /* - * Zero out the remainder if needed (< ETHERMIN). - */ - if (m->m_pkthdr.len < len) - LN_ZERO(sc, bp, len - m->m_pkthdr.len); - - /* - * Finally, copy out the descriptor and tell the - * LANCE to transmit!. - */ - desc.d_buflen = 0 - len; - desc.d_addr_lo = LN_ADDR_LO(di->di_bufaddr + sc->lance_ramoffset); - desc.d_addr_hi = LN_ADDR_HI(di->di_bufaddr + sc->lance_ramoffset); - desc.d_flag = LN_DFLAG_SOP|LN_DFLAG_EOP|LN_DFLAG_OWNER; - LN_PUTDESC(sc, &desc, di->di_addr); - LN_WRCSR(sc, LN_CSR0_TXDEMAND|LN_CSR0_ENABINTR); - - /* - * Do our bookkeeping with our transmit heap. - * (if we wrap, point back to the beginning). - */ - ri->ri_outptr += di->di_buflen; - ri->ri_outsize -= di->di_buflen; - LN_MAXSTAT(high_txoutptr, ri->ri_outptr); - LN_MINSTAT(low_txheapsize, ri->ri_outsize); - - if (ri->ri_outptr == ri->ri_heapend) - ri->ri_outptr = ri->ri_heap; - - ri->ri_free--; - if (++ri->ri_nextout == ri->ri_last) - ri->ri_nextout = ri->ri_first; - LN_MINSTAT(low_txfree, ri->ri_free); - } - if (m != NULL) - ifp->if_flags |= IFF_OACTIVE; -} - -static int -lance_tx_intr(struct le_softc *sc) -{ - lance_ring_t *ri = &sc->lance_txinfo; - unsigned xmits; - - LN_STAT(tx_intrs++); - for (xmits = 0; ri->ri_free < ri->ri_max; ) { - ln_desc_t desc; - - LN_GETDESC(sc, &desc, ri->ri_nextin->di_addr); - if (desc.d_flag & LN_DFLAG_OWNER) - break; - - if (desc.d_flag & (LN_DFLAG_TxONECOLL|LN_DFLAG_TxMULTCOLL)) - sc->le_if.if_collisions++; - if (desc.d_flag & LN_DFLAG_TxDEFERRED) - LN_STAT(tx_deferred++); - if (desc.d_flag & LN_DFLAG_TxONECOLL) - LN_STAT(tx_single_collisions++); - if (desc.d_flag & LN_DFLAG_TxMULTCOLL) - LN_STAT(tx_multiple_collisions++); - - if (desc.d_flag & LN_DFLAG_TxERRSUM) { - if (desc.d_status & (LN_DSTS_TxUNDERFLOW|LN_DSTS_TxBUFERROR| - LN_DSTS_TxEXCCOLL|LN_DSTS_TxLATECOLL)) { - if (desc.d_status & LN_DSTS_TxEXCCOLL) { - unsigned tdr; - LN_STAT(tx_excessive_collisions++); - if ((tdr = (desc.d_status & LN_DSTS_TxTDRMASK)) > 0) { - tdr *= 100; - if_printf(&sc->le_if, "lance: warning: excessive collisions: TDR %dns (%d-%dm)\n", - tdr, (tdr*99)/1000, (tdr*117)/1000); - } - } - if (desc.d_status & LN_DSTS_TxBUFERROR) - LN_STAT(tx_buferror++); - sc->le_if.if_oerrors++; - if ((desc.d_status & LN_DSTS_TxLATECOLL) == 0) { - lance_init(sc); - return 0; - } else { - LN_STAT(tx_late_collisions++); - } - } - } - m_freem(ri->ri_nextin->di_mbuf); - ri->ri_nextin->di_mbuf = NULL; - sc->le_if.if_opackets++; - ri->ri_free++; - ri->ri_outsize += ri->ri_nextin->di_buflen; - if (++ri->ri_nextin == ri->ri_last) - ri->ri_nextin = ri->ri_first; - sc->le_if.if_flags &= ~IFF_OACTIVE; - xmits++; - } - if (ri->ri_free == ri->ri_max) - LN_STAT(tx_emptied++); - /* LN_STAT(tx_intr_descs[xmits]++); */ - LN_MAXSTAT(tx_intr_hidescs, xmits); - return xmits; -} diff --git a/sys/dev/netif/rdp/if_rdp.c b/sys/dev/netif/rdp/if_rdp.c deleted file mode 100644 index 9c80840a3f..0000000000 --- a/sys/dev/netif/rdp/if_rdp.c +++ /dev/null @@ -1,1396 +0,0 @@ -/* - * Copyright 1998, Joerg Wunsch - * 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 unmodified, 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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: src/sys/i386/isa/if_rdp.c,v 1.6.2.2 2000/07/17 21:24:32 archie Exp $ - * $DragonFly: src/sys/dev/netif/rdp/if_rdp.c,v 1.26 2008/08/02 01:14:42 dillon Exp $ - */ - -/* - * Device driver for RealTek RTL 8002 (`REDP') based pocket-ethernet - * adapters, hooked up to a printer port. `rdp' is a shorthand for - * REDP since some tools like netstat work best if the interface name - * has no more than three letters. - * - * Driver configuration flags so far: - * flags 0x1 -- assume 74S288 EEPROM (default 94C46) - * flags 0x2 -- use `slow' mode (mode 3 of the packet driver, default 0) - * - * Maybe this driver will some day also work with the successor, RTL - * 8012 (`AREDP'), which is unfortunately not fully register- - * compatible with the 8002. The 8012 offers support for faster - * transfer modi like bidirectional SPP and EPP, 64 K x 4 buffer - * memory as opposed to 16 K x 4 for the 8002, a multicast filter, and - * a builtin multiplexer that allows chaining a printer behind the - * ethernet adapter. - * - * About the only documentation i've been able to find about the RTL - * 8002 was the packet driver source code at ftp.realtek.com.tw, so - * this driver is somewhat based on the way the packet driver handles - * the chip. The exact author of the packet driver is unknown, the - * only name that i could find in the source was someone called Chiu, - * supposedly an employee of RealTek. So credits to them for that - * piece of code which has proven valuable to me. - * - * Later on, Leo kuo has been very helpful to me - * by sending me a readable (PDF) file documenting the RTL 8012, which - * helped me to also understand the 8002, as well as by providing me - * with the source code of the 8012 packet driver that i haven't been - * able to find on the FTP site. A big Thanks! goes here to RealTek - * for this kind of service. - */ - -#include "use_rdp.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifdef INET -#include -#include -#endif - -#include - -#include -#include - -#include -#include - -#include "if_rdpreg.h" - -#define IOCTL_CMD_T u_long - -/* - * Debug levels (ORed together): - * != 0 - general (bad packets etc.) - * 2 - debug EEPROM IO - * 4 - debug interrupt status - */ -#undef DEBUG -#define DEBUG 0 - -/* - * rdp_softc: per interface info and status - */ -struct rdp_softc { - struct arpcom arpcom; /* - * Ethernet common, always goes first so - * a rdp_softc * can be cast into an - * arpcom * or into an ifnet *. - */ - - /* - * local stuff, somewhat sorted by memory alignment class - */ - u_short baseaddr; /* IO port address */ - u_short txsize; /* tx size for next (buffered) packet, - * there's only one additional packet - * we can buffer, thus a single variable - * ought to be enough */ - int txbusy; /* tx is transmitting */ - int txbuffered; /* # of packets in tx buffer */ - int slow; /* use lpt_control to send data */ - u_char irqenbit; /* mirror of current Ctrl_IRQEN */ - /* - * type of parameter EEPROM; device flags 0x1 selects 74S288 - */ - enum { - EEPROM_93C46, EEPROM_74S288 /* or 82S123 */ - } eeprom; -}; - -DECLARE_DUMMY_MODULE(if_rdp); - -static struct rdp_softc rdp_softc[NRDP]; - -/* - * Since there's no fixed location in the EEPROM about where to find - * the ethernet hardware address, we drop a table of valid OUIs here, - * and search through the EEPROM until we find a possible valid - * Ethernet address. Only the first 16 bits of all possible OUIs are - * recorded in the table (as obtained from - * http://standards.ieee.org/regauth/oui/oui.txt). - */ - -static u_short allowed_ouis[] = { - 0x0000, 0x0001, 0x0002, 0x0004, 0x0005, 0x0006, 0x0007, - 0x0008, 0x0010, 0x001C, 0x0020, 0x0040, 0x0050, 0x0060, - 0x0070, 0x0080, 0x0090, 0x009D, 0x00A0, 0x00AA, 0x00BB, - 0x00C0, 0x00CF, 0x00DD, 0x00E0, 0x00E6, 0x0207, 0x021C, - 0x0260, 0x0270, 0x029D, 0x02AA, 0x02BB, 0x02C0, 0x02CF, - 0x02E6, 0x040A, 0x04E0, 0x0800, 0x08BB, 0x1000, 0x1100, - 0x8000, 0xAA00 -}; - -/* - * ISA bus support. - */ -static int rdp_probe (struct isa_device *); -static int rdp_attach (struct isa_device *); - -/* - * Required entry points. - */ -static void rdp_init(void *); -static int rdp_ioctl(struct ifnet *, IOCTL_CMD_T, caddr_t, struct ucred *); -static void rdp_start(struct ifnet *); -static void rdp_reset(struct ifnet *); -static void rdp_watchdog(struct ifnet *); -static void rdpintr(void *); - -/* - * REDP private functions. - */ - -static void rdp_stop(struct rdp_softc *); -static void rdp_rint(struct rdp_softc *); -static void rdp_get_packet(struct rdp_softc *, unsigned); -static u_short rdp_write_mbufs(struct rdp_softc *, struct mbuf *); -static int rdp_gethwaddr_93c46(struct rdp_softc *, u_char *); -static void rdp_gethwaddr_74s288(struct rdp_softc *, u_char *); -static void rdp_93c46_cmd(struct rdp_softc *, u_short, unsigned); -static u_short rdp_93c46_read(struct rdp_softc *); - -struct isa_driver rdpdriver = { - rdp_probe, - rdp_attach, - "rdp", - 1 /* we wanna get a chance before lptN */ -}; - -/* - * REDP-specific functions. - * - * They are inlined, thus go first in this file. Together with gcc's - * usual optimization, these functions probably come close to the - * packet driver's hand-optimized code. ;-) - * - * Comments are partially obtained from the packet driver as well. - * Some of the function names contain register names which don't make - * much sense for us, but i've kept them for easier reference in - * comparision to the packet driver. - * - * Some of the functions are currently not used by the driver; it's - * not quite clear whether we ever need them at all. They are - * supposedly even slower than what is currently implemented as `slow' - * mode. Right now, `fast' (default) mode is what the packet driver - * calls mode 0, slow mode is mode 3 (writing through lpt_control, - * reading twice). - * - * We should autoprobe the modi, as opposed to making them dependent - * on a kernel configuration flag. - */ - -/* - * read a nibble from rreg; end-of-data cmd is not issued; - * used for general register read. - * - * Unlike the packet driver's version, i'm shifting the result - * by 3 here (as opposed to within the caller's code) for clarity. - * -- Joerg - */ -static __inline u_char -RdNib(struct rdp_softc *sc, u_char rreg) -{ - - outb(sc->baseaddr + lpt_data, EOC + rreg); - outb(sc->baseaddr + lpt_data, RdAddr + rreg); /* write addr */ - inb(sc->baseaddr + lpt_status); - return (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f; -} - -#if 0 -/* - * read a byte from MAR register through lpt_data; the low nibble is - * read prior to the high one; end-of-read command is not issued; used - * for remote DMA in mode 4 + 5 - */ -static __inline u_char -RdByte(struct rdp_softc *sc) -{ - u_char hinib, lonib; - - outb(sc->baseaddr + lpt_data, RdAddr + MAR); /* cmd for low nibble */ - lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f; - outb(sc->baseaddr + lpt_data, RdAddr + MAR + HNib); - hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0; - return hinib + lonib; -} - - -/* - * read a byte from MAR register through lpt_data; the low nibble is - * read prior to the high one; end-of-read command is not issued; used - * for remote DMA in mode 6 + 7 - */ -static __inline u_char -RdByte1(struct rdp_softc *sc) -{ - u_char hinib, lonib; - - outb(sc->baseaddr + lpt_data, RdAddr + MAR); /* cmd for low nibble */ - inb(sc->baseaddr + lpt_status); - lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f; - outb(sc->baseaddr + lpt_data, RdAddr + MAR + HNib); - inb(sc->baseaddr + lpt_status); - hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0; - return hinib + lonib; -} -#endif - - -/* - * read a byte from MAR register through lpt_control; the low nibble is - * read prior to the high one; end-of-read command is not issued; used - * for remote DMA in mode 0 + 1 - */ -static __inline u_char -RdByteA1(struct rdp_softc *sc) -{ - u_char hinib, lonib; - - outb(sc->baseaddr + lpt_control, Ctrl_LNibRead); - lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f; - outb(sc->baseaddr + lpt_control, Ctrl_HNibRead); - hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0; - return hinib + lonib; -} - - -/* - * read a byte from MAR register through lpt_control; the low nibble is - * read prior to the high one; end-of-read command is not issued; used - * for remote DMA in mode 2 + 3 - */ -static __inline u_char -RdByteA2(struct rdp_softc *sc) -{ - u_char hinib, lonib; - - outb(sc->baseaddr + lpt_control, Ctrl_LNibRead); - inb(sc->baseaddr + lpt_status); - lonib = (inb(sc->baseaddr + lpt_status) >> 3) & 0x0f; - outb(sc->baseaddr + lpt_control, Ctrl_HNibRead); - inb(sc->baseaddr + lpt_status); - hinib = (inb(sc->baseaddr + lpt_status) << 1) & 0xf0; - return hinib + lonib; -} - -/* - * End-of-read cmd - */ -static __inline void -RdEnd(struct rdp_softc *sc, u_char rreg) -{ - - outb(sc->baseaddr + lpt_data, EOC + rreg); -} - -/* - * Write a nibble to a register; end-of-write is issued. - * Used for general register write. - */ -static __inline void -WrNib(struct rdp_softc *sc, u_char wreg, u_char wdata) -{ - - /* prepare and write address */ - outb(sc->baseaddr + lpt_data, EOC + wreg); - outb(sc->baseaddr + lpt_data, WrAddr + wreg); - outb(sc->baseaddr + lpt_data, WrAddr + wreg); - /* prepare and write data */ - outb(sc->baseaddr + lpt_data, WrAddr + wdata); - outb(sc->baseaddr + lpt_data, wdata); - outb(sc->baseaddr + lpt_data, wdata); - /* end-of-write */ - outb(sc->baseaddr + lpt_data, EOC + wdata); -} - -/* - * Write a byte to a register; end-of-write is issued. - * Used for general register write. - */ -static __inline void -WrByte(struct rdp_softc *sc, u_char wreg, u_char wdata) -{ - - /* prepare and write address */ - outb(sc->baseaddr + lpt_data, EOC + wreg); - outb(sc->baseaddr + lpt_data, WrAddr + wreg); - outb(sc->baseaddr + lpt_data, WrAddr + wreg); - /* prepare and write low nibble */ - outb(sc->baseaddr + lpt_data, WrAddr + (wdata & 0x0F)); - outb(sc->baseaddr + lpt_data, (wdata & 0x0F)); - outb(sc->baseaddr + lpt_data, (wdata & 0x0F)); - /* prepare and write high nibble */ - wdata >>= 4; - outb(sc->baseaddr + lpt_data, wdata); - outb(sc->baseaddr + lpt_data, wdata + HNib); - outb(sc->baseaddr + lpt_data, wdata + HNib); - /* end-of-write */ - outb(sc->baseaddr + lpt_data, EOC + wdata + HNib); -} - -/* - * Write the byte to DRAM via lpt_data; - * used for remote DMA write in mode 0 / 2 / 4 - */ -static __inline void -WrByteALToDRAM(struct rdp_softc *sc, u_char val) -{ - - outb(sc->baseaddr + lpt_data, val & 0x0F); - outb(sc->baseaddr + lpt_data, MkHi(val)); -} - -/* - * Write the byte to DRAM via lpt_control; - * used for remote DMA write in mode 1 / 3 / 5 - */ -static __inline void -WrByteALToDRAMA(struct rdp_softc *sc, u_char val) -{ - - outb(sc->baseaddr + lpt_data, val & 0x0F); - outb(sc->baseaddr + lpt_control, Ctrl_LNibRead | sc->irqenbit); - outb(sc->baseaddr + lpt_data, val >> 4); - outb(sc->baseaddr + lpt_control, Ctrl_HNibRead | sc->irqenbit); -} - -#if 0 /* they could be used for the RAM test */ -/* - * Write the u_short to DRAM via lpt_data; - * used for remote DMA write in mode 0 / 2 / 4 - */ -static __inline void -WrWordbxToDRAM(struct rdp_softc *sc, u_short val) -{ - - outb(sc->baseaddr + lpt_data, val & 0x0F); - val >>= 4; - outb(sc->baseaddr + lpt_data, (val & 0x0F) + HNib); - val >>= 4; - outb(sc->baseaddr + lpt_data, val & 0x0F); - val >>= 4; - outb(sc->baseaddr + lpt_data, val + HNib); -} - - -/* - * Write the u_short to DRAM via lpt_control; - * used for remote DMA write in mode 1 / 3 / 5 - */ -static __inline void -WrWordbxToDRAMA(struct rdp_softc *sc, u_short val) -{ - - outb(sc->baseaddr + lpt_data, val & 0x0F); - outb(sc->baseaddr + lpt_control, Ctrl_LNibRead | sc->irqenbit); - val >>= 4; - outb(sc->baseaddr + lpt_data, (val & 0x0F) + HNib); - outb(sc->baseaddr + lpt_control, Ctrl_HNibRead | sc->irqenbit); - val >>= 4; - outb(sc->baseaddr + lpt_data, val & 0x0F); - outb(sc->baseaddr + lpt_control, Ctrl_LNibRead | sc->irqenbit); - val >>= 4; - outb(sc->baseaddr + lpt_data, val + HNib); - outb(sc->baseaddr + lpt_control, Ctrl_HNibRead | sc->irqenbit); -} -#endif - - -/* - * Determine if the device is present - * - * on entry: - * a pointer to an isa_device struct - * on exit: - * 0 if device not found - * or # of i/o addresses used (if found) - */ -static int -rdp_probe(struct isa_device *isa_dev) -{ - int unit = isa_dev->id_unit; - struct rdp_softc *sc = &rdp_softc[unit]; - u_char b1, b2; - intrmask_t irqmap[3]; - u_char sval[3]; - - if (unit < 0 || unit >= NRDP) - return 0; - - sc->baseaddr = isa_dev->id_iobase; - if (isa_dev->id_flags & 1) - sc->eeprom = EEPROM_74S288; - /* else defaults to 93C46 */ - if (isa_dev->id_flags & 2) - sc->slow = 1; - - /* let R/WB = A/DB = CSB = high to be ready for next r/w cycle */ - outb(sc->baseaddr + lpt_data, 0xFF); - /* DIR = 0 for write mode, IRQEN=0, SLCT=INIT=AUTOFEED=STB=high */ - outb(sc->baseaddr + lpt_control, Ctrl_SelData); - /* software reset */ - WrNib(sc, CMR1 + HNib, MkHi(CMR1_RST)); - DELAY(2000); - /* is EPLC alive? */ - b1 = RdNib(sc, CMR1); - RdEnd(sc, CMR1); - b2 = RdNib(sc, CMR2) & 0x0f; - b2 |= RdNib(sc, CMR2 + HNib) << 4; - RdEnd(sc, CMR2 + HNib); - /* - * After the reset, we expect CMR1 & 7 to be 1 (rx buffer empty), - * and CMR2 & 0xf7 to be 0x20 (receive mode set to physical and - * broadcasts). - */ - if (bootverbose) - kprintf("rdp%d: CMR1 = %#x, CMR2 = %#x\n", unit, b1, b2); - - if ((b1 & (CMR1_BUFE | CMR1_IRQ | CMR1_TRA)) != CMR1_BUFE - || (b2 & ~CMR2_IRQINV) != CMR2_AM_PB) - return 0; - - /* - * We have found something that could be a RTL 80[01]2, now - * see whether we can generate an interrupt. - */ - cpu_disable_intr(); - - /* - * Test whether our configured IRQ is working. - * - * Set to no acception mode + IRQout, then enable RxE + TxE, - * then cause RBER (by advancing the read pointer although - * the read buffer is empty) to generate an interrupt. - */ - WrByte(sc, CMR2, CMR2_IRQOUT); - WrNib(sc, CMR1 + HNib, MkHi(CMR1_TE | CMR1_RE)); - WrNib(sc, CMR1, CMR1_RDPAC); - DELAY(1000); - - irqmap[0] = isa_irq_pending(); - sval[0] = inb(sc->baseaddr + lpt_status); - - /* allow IRQs to pass the parallel interface */ - outb(sc->baseaddr + lpt_control, Ctrl_IRQEN + Ctrl_SelData); - DELAY(1000); - /* generate interrupt */ - WrNib(sc, IMR + HNib, MkHi(ISR_RBER)); - DELAY(1000); - - irqmap[1] = isa_irq_pending(); - sval[1] = inb(sc->baseaddr + lpt_status); - - /* de-assert and disable IRQ */ - WrNib(sc, IMR + HNib, MkHi(0)); - inb(sc->baseaddr + lpt_status); /* might be necessary to clear IRQ */ - DELAY(1000); - irqmap[2] = isa_irq_pending(); - sval[2] = inb(sc->baseaddr + lpt_status); - - WrNib(sc, CMR1 + HNib, MkHi(0)); - outb(sc->baseaddr + lpt_control, Ctrl_SelData); - WrNib(sc, CMR2, CMR2_IRQINV); - - cpu_enable_intr(); - - if (bootverbose) - kprintf("rdp%d: irq maps / lpt status " - "%#x/%#x - %#x/%#x - %#x/%#x (id_irq %#x)\n", - unit, irqmap[0], sval[0], irqmap[1], sval[1], - irqmap[2], sval[2], isa_dev->id_irq); - - if ((irqmap[1] & isa_dev->id_irq) == 0) { - kprintf("rdp%d: configured IRQ (%d) cannot be asserted " - "by device", - unit, ffs(isa_dev->id_irq) - 1); - if (irqmap[1]) - kprintf(" (probable IRQ: %d)", ffs(irqmap[1]) - 1); - kprintf("\n"); - return 0; - } - - /* - * XXX should do RAMtest here - */ - - switch (sc->eeprom) { - case EEPROM_93C46: - if (rdp_gethwaddr_93c46(sc, sc->arpcom.ac_enaddr) == 0) { - kprintf("rdp%d: failed to find a valid hardware " - "address in EEPROM\n", - unit); - return 0; - } - break; - - case EEPROM_74S288: - rdp_gethwaddr_74s288(sc, sc->arpcom.ac_enaddr); - break; - } - - return lpt_control + 1; -} - -/* - * Install interface into kernel networking data structures - */ -static int -rdp_attach(struct isa_device *isa_dev) -{ - int unit = isa_dev->id_unit; - struct rdp_softc *sc = &rdp_softc[unit]; - struct ifnet *ifp = &sc->arpcom.ac_if; - - isa_dev->id_intr = (inthand2_t *)rdpintr; - - /* - * Reset interface - */ - rdp_stop(sc); - - /* - * Initialize ifnet structure - */ - ifp->if_softc = sc; - if_initname(ifp, "rdp", unit); - ifp->if_start = rdp_start; - ifp->if_ioctl = rdp_ioctl; - ifp->if_watchdog = rdp_watchdog; - ifp->if_init = rdp_init; - ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN); - ifq_set_ready(&ifp->if_snd); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; - - /* - * Attach the interface - */ - ether_ifattach(ifp, sc->arpcom.ac_enaddr, NULL); - - /* - * Print additional info when attached - */ - kprintf("%s: RealTek RTL%s pocket ethernet, EEPROM %s, %s mode\n", - ifp->if_xname, - "8002", /* hook for 8012 */ - sc->eeprom == EEPROM_93C46? "93C46": "74S288", - sc->slow? "slow": "fast"); - - return 1; -} - -/* - * Reset interface. - */ -static void -rdp_reset(struct ifnet *ifp) -{ - struct rdp_softc *sc = ifp->if_softc; - - crit_enter(); - - /* - * Stop interface and re-initialize. - */ - rdp_stop(sc); - rdp_init(sc); - - crit_exit(); -} - -/* - * Take interface offline. - */ -static void -rdp_stop(struct rdp_softc *sc) -{ - - sc->txbusy = sc->txbusy = 0; - - /* disable printer interface interrupts */ - sc->irqenbit = 0; - outb(sc->baseaddr + lpt_control, Ctrl_SelData); - outb(sc->baseaddr + lpt_data, 0xff); - - /* reset the RTL 8002 */ - WrNib(sc, CMR1 + HNib, MkHi(CMR1_RST)); - DELAY(100); -} - -/* - * Device timeout/watchdog routine. Entered if the device neglects to - * generate an interrupt after a transmit has been started on it. - */ -static void -rdp_watchdog(struct ifnet *ifp) -{ - - log(LOG_ERR, "%s: device timeout\n", ifp->if_xname); - ifp->if_oerrors++; - - rdp_reset(ifp); -} - -/* - * Initialize device. - */ -static void -rdp_init(void *xsc) -{ - struct rdp_softc *sc = xsc; - struct ifnet *ifp = &sc->arpcom.ac_if; - int i; - u_char reg; - - crit_enter(); - - ifp->if_timer = 0; - - /* program ethernet ID into the chip */ - for (i = 0, reg = IDR0; i < 6; i++, reg++) - WrByte(sc, reg, sc->arpcom.ac_enaddr[i]); - - /* set accept mode */ - WrNib(sc, CMR2 + HNib, - MkHi((ifp->if_flags & IFF_PROMISC)? CMR2_AM_ALL: CMR2_AM_PB)); - - /* enable tx and rx */ - WrNib(sc, CMR1 + HNib, MkHi(CMR1_TE | CMR1_RE)); - - /* allow interrupts to happen */ - WrNib(sc, CMR2, CMR2_IRQOUT | CMR2_IRQINV); - WrNib(sc, IMR, ISR_TOK | ISR_TER | ISR_ROK | ISR_RER); - WrNib(sc, IMR + HNib, MkHi(ISR_RBER)); - - /* allow IRQs to pass the parallel interface */ - sc->irqenbit = Ctrl_IRQEN; - outb(sc->baseaddr + lpt_control, sc->irqenbit + Ctrl_SelData); - - /* clear all flags */ - sc->txbusy = sc->txbuffered = 0; - - /* - * Set 'running' flag, and clear output active flag. - */ - ifp->if_flags |= IFF_RUNNING; - ifp->if_flags &= ~IFF_OACTIVE; - - /* - * ...and attempt to start output - */ - rdp_start(ifp); - - crit_exit(); -} - -/* - * Start output on interface. - * We make one assumption here: - * - that the IFF_OACTIVE flag is checked before this code is called - * (i.e. that the output part of the interface is idle) - */ -static void -rdp_start(struct ifnet *ifp) -{ - struct rdp_softc *sc = ifp->if_softc; - struct mbuf *m; - int len; - -outloop: - - /* - * See if there is room to put another packet in the buffer. - */ - if (sc->txbuffered) { - /* - * No room. Indicate this to the outside world and exit. - */ - ifp->if_flags |= IFF_OACTIVE; - return; - } - m = ifq_dequeue(&ifp->if_snd, NULL); - if (m == NULL) { - /* - * We are using the !OACTIVE flag to indicate to the outside - * world that we can accept an additional packet rather than - * that the transmitter is _actually_ active. Indeed, the - * transmitter may be active, but if we haven't filled all the - * buffers with data then we still want to accept more. - */ - ifp->if_flags &= ~IFF_OACTIVE; - return; - } - - /* - * Copy the mbuf chain into the transmit buffer - */ - - len = rdp_write_mbufs(sc, m); - if (len == 0) - goto outloop; - - /* ensure minimal valid ethernet length */ - len = max(len, (ETHER_MIN_LEN-ETHER_CRC_LEN)); - - /* - * Actually start the transceiver. Set a timeout in case the - * Tx interrupt never arrives. - */ - if (!sc->txbusy) { - WrNib(sc, TBCR1, len >> 8); - WrByte(sc, TBCR0, len & 0xff); - WrNib(sc, CMR1, CMR1_TRA); - sc->txbusy = 1; - ifp->if_timer = 2; - } else { - sc->txbuffered = 1; - sc->txsize = len; - } - - BPF_MTAP(ifp, m); - - m_freem(m); - - /* - * Loop back to the top to possibly buffer more packets - */ - goto outloop; -} - -/* - * Process an ioctl request. - */ -static int -rdp_ioctl(struct ifnet *ifp, IOCTL_CMD_T command, caddr_t data, - struct ucred *ur) -{ - struct rdp_softc *sc = ifp->if_softc; - int error = 0; - - crit_enter(); - - switch (command) { - case SIOCSIFFLAGS: - /* - * If the interface is marked up and stopped, then start it. - * If it is marked down and running, then stop it. - */ - if (ifp->if_flags & IFF_UP) { - if ((ifp->if_flags & IFF_RUNNING) == 0) - rdp_init(sc); - } else { - if (ifp->if_flags & IFF_RUNNING) { - rdp_stop(sc); - ifp->if_flags &= ~IFF_RUNNING; - } - } - - /* - * Promiscuous flag may have changed, propagage this - * to the NIC. - */ - if (ifp->if_flags & IFF_UP) - WrNib(sc, CMR2 + HNib, - MkHi((ifp->if_flags & IFF_PROMISC)? - CMR2_AM_ALL: CMR2_AM_PB)); - - break; - - case SIOCADDMULTI: - case SIOCDELMULTI: - /* - * Multicast list has changed; we don't support it. - */ - error = ENOTTY; - break; - - default: - error = ether_ioctl(ifp, command, data); - break; - } - - crit_exit(); - - return (error); -} - -/* - * External interrupt service routine. - */ -void -rdpintr(void *arg) -{ - int unit = (int)arg; - struct rdp_softc *sc = rdp_softc + unit; - struct ifnet *ifp = (struct ifnet *)sc; - u_char isr, tsr, rsr, colls; - - lwkt_serialize_enter(ifp->if_serializer); - - /* disable interrupts, so SD3 can be routed to the pin */ - sc->irqenbit = 0; - outb(sc->baseaddr + lpt_control, Ctrl_SelData); - WrNib(sc, CMR2, CMR2_IRQINV); - /* - * loop until there are no more new interrupts - */ - for (;;) { - isr = RdNib(sc, ISR); - isr |= RdNib(sc, ISR + HNib) << 4; - RdEnd(sc, ISR + HNib); - - if (isr == 0) - break; -#if DEBUG & 4 - kprintf("rdp%d: ISR = %#x\n", unit, isr); -#endif - - /* - * Clear the pending interrupt bits. - */ - WrNib(sc, ISR, isr & 0x0f); - if (isr & 0xf0) - WrNib(sc, ISR + HNib, MkHi(isr)); - - /* - * Handle transmitter interrupts. - */ - if (isr & (ISR_TOK | ISR_TER)) { - tsr = RdNib(sc, TSR); - RdEnd(sc, TSR); -#if DEBUG & 4 - if (isr & ISR_TER) - kprintf("rdp%d: tsr %#x\n", unit, tsr); -#endif - if (tsr & TSR_TABT) - ifp->if_oerrors++; - else - /* - * Update total number of successfully - * transmitted packets. - */ - ifp->if_opackets++; - - if (tsr & TSR_COL) { - colls = RdNib(sc, COLR); - RdEnd(sc, COLR); - ifp->if_collisions += colls; - } - - /* - * reset tx busy and output active flags - */ - sc->txbusy = 0; - ifp->if_flags &= ~IFF_OACTIVE; - - /* - * If we had already queued up another packet, - * start sending it now. - */ - if (sc->txbuffered) { - WrNib(sc, TBCR1, sc->txsize >> 8); - WrByte(sc, TBCR0, sc->txsize & 0xff); - WrNib(sc, CMR1, CMR1_TRA); - sc->txbusy = 1; - sc->txbuffered = 0; - ifp->if_timer = 2; - } else { - /* - * clear watchdog timer - */ - ifp->if_timer = 0; - } - - } - - /* - * Handle receiver interrupts - */ - if (isr & (ISR_ROK | ISR_RER | ISR_RBER)) { - rsr = RdNib(sc, RSR); - rsr |= RdNib(sc, RSR + HNib) << 4; - RdEnd(sc, RSR + HNib); -#if DEBUG & 4 - if (isr & (ISR_RER | ISR_RBER)) - kprintf("rdp%d: rsr %#x\n", unit, rsr); -#endif - - if (rsr & (RSR_PUN | RSR_POV)) { - kprintf("rdp%d: rsr %#x, resetting\n", - unit, rsr); - rdp_reset(ifp); - break; - } - - if (rsr & RSR_BUFO) - /* - * CRC and FA errors are recorded in - * rdp_rint() on a per-packet basis - */ - ifp->if_ierrors++; - if (isr & (ISR_ROK | ISR_RER)) - rdp_rint(sc); - } - - /* - * If it looks like the transmitter can take more data, - * attempt to start output on the interface. This is done - * after handling the receiver to give the receiver priority. - */ - if ((ifp->if_flags & IFF_OACTIVE) == 0) - rdp_start(ifp); - - } - /* re-enable interrupts */ - WrNib(sc, CMR2, CMR2_IRQOUT | CMR2_IRQINV); - sc->irqenbit = Ctrl_IRQEN; - outb(sc->baseaddr + lpt_control, Ctrl_SelData + sc->irqenbit); - lwkt_serialize_exit(ifp->if_serializer); -} - -/* - * Ethernet interface receiver interrupt. - */ -static void -rdp_rint(struct rdp_softc *sc) -{ - struct ifnet *ifp = &sc->arpcom.ac_if; - struct rdphdr rh; - u_short len; - size_t i; - u_char *packet_ptr, b, status; - int excessive_bad_pkts = 0; - - /* - * Fetch the packets from the NIC's buffer. - */ - for (;;) { - b = RdNib(sc, CMR1); - RdEnd(sc, CMR1); - - if (b & CMR1_BUFE) - /* no more packets */ - break; - - /* first, obtain the buffer header */ - - outb(sc->baseaddr + lpt_data, MAR + EOC); /* prepare addr */ - outb(sc->baseaddr + lpt_control, Ctrl_LNibRead); - outb(sc->baseaddr + lpt_data, MAR + RdAddr + HNib); - - packet_ptr = (u_char *)&rh; - if (sc->slow) - for (i = 0; i < sizeof rh; i++, packet_ptr++) - *packet_ptr = RdByteA2(sc); - else - for (i = 0; i < sizeof rh; i++, packet_ptr++) - *packet_ptr = RdByteA1(sc); - - RdEnd(sc, MAR + HNib); - outb(sc->baseaddr + lpt_control, Ctrl_SelData); - - len = rh.pktlen - ETHER_CRC_LEN; - status = rh.status; - - if ((status & (RSR_ROK | RSR_CRC | RSR_FA)) != RSR_ROK || - len > (ETHER_MAX_LEN - ETHER_CRC_LEN) || - len < (ETHER_MIN_LEN - ETHER_CRC_LEN) || - len > MCLBYTES) { -#if DEBUG - kprintf("%s: bad packet in buffer, " - "len %d, status %#x\n", - ifp->if_xname, (int)len, (int)status); -#endif - ifp->if_ierrors++; - /* rx jump packet */ - WrNib(sc, CMR1, CMR1_RDPAC); - if (++excessive_bad_pkts > 5) { - /* - * the chip seems to be stuck, we are - * probably seeing the same bad packet - * over and over again - */ -#if DEBUG - kprintf("%s: resetting due to an " - "excessive number of bad packets\n", - ifp->if_xname); -#endif - rdp_reset(ifp); - return; - } - continue; - } - - /* - * Go get packet. - */ - excessive_bad_pkts = 0; - rdp_get_packet(sc, len); - ifp->if_ipackets++; - } -} - -/* - * Retreive packet from NIC memory and send to the next level up via - * ether_input(). - */ -static void -rdp_get_packet(struct rdp_softc *sc, unsigned len) -{ - struct ifnet *ifp = &sc->arpcom.ac_if; - struct mbuf *m; - u_char *packet_ptr; - size_t s; - - /* Allocate a header mbuf */ - MGETHDR(m, MB_DONTWAIT, MT_DATA); - if (m == NULL) - return; - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = m->m_len = len; - - /* - * We always put the received packet in a single buffer - - * either with just an mbuf header or in a cluster attached - * to the header. The +2 is to compensate for the alignment - * fixup below. - */ - if ((len + 2) > MHLEN) { - /* Attach an mbuf cluster */ - MCLGET(m, MB_DONTWAIT); - - /* Insist on getting a cluster */ - if ((m->m_flags & M_EXT) == 0) { - m_freem(m); - return; - } - } - - /* - * The +2 is to longword align the start of the real packet. - * This is important for NFS. - */ - m->m_data += 2; - - /* - * Get packet, including link layer address, from interface. - */ - outb(sc->baseaddr + lpt_control, Ctrl_LNibRead); - outb(sc->baseaddr + lpt_data, RdAddr + MAR); - - packet_ptr = mtod(m, u_char *); - if (sc->slow) - for (s = 0; s < len; s++, packet_ptr++) - *packet_ptr = RdByteA2(sc); - else - for (s = 0; s < len; s++, packet_ptr++) - *packet_ptr = RdByteA1(sc); - - RdEnd(sc, MAR + HNib); - outb(sc->baseaddr + lpt_control, Ctrl_SelData); - WrNib(sc, CMR1, CMR1_RDPAC); - - ifp->if_input(ifp, m); -} - -/* - * Write an mbuf chain to the NIC's tx buffer. - */ -static u_short -rdp_write_mbufs(struct rdp_softc *sc, struct mbuf *m) -{ - u_short total_len; - struct mbuf *mp; - u_char *dp, b; - int i; - - /* First, count up the total number of bytes to copy */ - for (total_len = 0, mp = m; mp; mp = mp->m_next) - total_len += mp->m_len; - - if (total_len == 0) - return 0; - - outb(sc->baseaddr + lpt_data, MAR | EOC); - - /* - * Transfer the mbuf chain to the NIC memory. - */ - if (sc->slow) { - /* writing the first byte is complicated */ - outb(sc->baseaddr + lpt_control, - Ctrl_LNibRead | sc->irqenbit); - outb(sc->baseaddr + lpt_data, MAR | WrAddr); - b = *(u_char *)m->m_data; - outb(sc->baseaddr + lpt_data, (b & 0x0f) | 0x40); - outb(sc->baseaddr + lpt_data, b & 0x0f); - outb(sc->baseaddr + lpt_data, b >> 4); - outb(sc->baseaddr + lpt_control, - Ctrl_HNibRead | sc->irqenbit); - /* advance the mbuf pointer */ - mp = m; - m->m_len--; - m->m_data++; - /* write the remaining bytes */ - while (m) { - for (i = 0, dp = (u_char *)m->m_data; - i < m->m_len; - i++, dp++) - WrByteALToDRAMA(sc, *dp); - m = m->m_next; - } - /* - * restore old mbuf in case we have to hand it off to - * BPF again - */ - m = mp; - m->m_len++; - m->m_data--; - - /* the RTL 8002 requires an even byte-count remote DMA */ - if (total_len & 1) - WrByteALToDRAMA(sc, 0); - } else { - outb(sc->baseaddr + lpt_data, MAR | WrAddr); - while (m) { - for (i = 0, dp = (u_char *)m->m_data; - i < m->m_len; - i++, dp++) - WrByteALToDRAM(sc, *dp); - m = m->m_next; - } - - /* the RTL 8002 requires an even byte-count remote DMA */ - if (total_len & 1) - WrByteALToDRAM(sc, 0); - } - - outb(sc->baseaddr + lpt_data, 0xff); - outb(sc->baseaddr + lpt_control, - Ctrl_HNibRead | Ctrl_SelData | sc->irqenbit); - - return total_len; -} - -/* - * Read the designated ethernet hardware address out of a 93C46 - * (serial) EEPROM. - * Note that the 93C46 uses 16-bit words in big-endian notation. - */ -static int -rdp_gethwaddr_93c46(struct rdp_softc *sc, u_char *etheraddr) -{ - int i, magic; - size_t j = 0; - u_short w; - - WrNib(sc, CMR2, CMR2_PAGE | CMR2_IRQINV); /* select page 1 */ - - /* - * The original RealTek packet driver had the ethernet address - * starting at EEPROM address 0. Other vendors seem to have - * gone `creative' here -- while they didn't do anything else - * than changing a few strings in the entire driver, compared - * to the RealTek version, they also moved out the ethernet - * address to a different location in the EEPROM, so the - * original RealTek driver won't work correctly with them, and - * vice versa. Sounds pretty cool, eh? $@%&! - * - * Anyway, we walk through the EEPROM, until we find some - * allowable value based upon our table of IEEE OUI assignments. - */ - for (i = magic = 0; magic < 3 && i < 32; i++) { - /* read cmd (+ 6 bit address) */ - rdp_93c46_cmd(sc, 0x180 + i, 10); - w = rdp_93c46_read(sc); - switch (magic) { - case 0: - for (j = 0; - j < sizeof allowed_ouis / sizeof(u_short); - j++) - if (w == allowed_ouis[j]) { - etheraddr[0] = (w >> 8) & 0xff; - etheraddr[1] = w & 0xff; - magic++; - break; - } - break; - - case 1: - /* - * If the first two bytes have been 00:00, we - * discard the match iff the next two bytes - * are also 00:00, so we won't get fooled by - * an EEPROM that has been filled with zeros. - * This in theory would disallow 64 K of legal - * addresses assigned to Xerox, but it's - * almost certain that those addresses haven't - * been used for RTL80[01]2 chips anyway. - */ - if ((etheraddr[0] | etheraddr[1]) == 0 && w == 0) { - magic--; - break; - } - - etheraddr[2] = (w >> 8) & 0xff; - etheraddr[3] = w & 0xff; - magic++; - break; - - case 2: - etheraddr[4] = (w >> 8) & 0xff; - etheraddr[5] = w & 0xff; - magic++; - break; - } - } - - WrNib(sc, CMR2, CMR2_IRQINV); /* back to page 0 */ - - return magic == 3; -} - -/* - * Read the designated ethernet hardware address out of a 74S288 - * EEPROM. - * - * This is untested, since i haven't seen any adapter actually using - * a 74S288. In the RTL 8012, only the serial EEPROM (94C46) is - * supported anymore. - */ -static void -rdp_gethwaddr_74s288(struct rdp_softc *sc, u_char *etheraddr) -{ - int i; - u_char b; - - WrNib(sc, CMR2, CMR2_PAGE | CMR2_IRQINV); /* select page 1 */ - - for (i = 0; i < 6; i++) { - WrNib(sc, PCMR, i & 0x0f); /* lower 4 bit of addr */ - WrNib(sc, PCMR + HNib, HNib + 4); /* upper 2 bit addr + /CS */ - WrNib(sc, PCMR + HNib, HNib); /* latch data now */ - b = RdNib(sc, PDR) & 0x0f; - b |= (RdNib(sc, PDR + HNib) & 0x0f) << 4; - etheraddr[i] = b; - } - - RdEnd(sc, PDR + HNib); - WrNib(sc, CMR2, CMR2_IRQINV); /* reselect page 0 */ -} - -/* - * Send nbits of data (starting with MSB) out to the 93c46 as a - * command. Assumes register page 1 has already been selected. - */ -static void -rdp_93c46_cmd(struct rdp_softc *sc, u_short data, unsigned nbits) -{ - u_short mask = 1 << (nbits - 1); - unsigned i; - u_char b; - -#if DEBUG & 2 - kprintf("rdp_93c46_cmd(): "); -#endif - for (i = 0; i < nbits; i++, mask >>= 1) { - b = HNib + PCMR_SK + PCMR_CS; - if (data & mask) - b += PCMR_DO; -#if DEBUG & 2 - kprintf("%d", b & 1); -#endif - WrNib(sc, PCMR + HNib, b); - DELAY(1); - WrNib(sc, PCMR + HNib, b & ~PCMR_SK); - DELAY(1); - } -#if DEBUG & 2 - kprintf("\n"); -#endif -} - -/* - * Read one word of data from the 93c46. Actually, we have to read - * 17 bits, and discard the very first bit. Assumes register page 1 - * to be selected as well. - */ -static u_short -rdp_93c46_read(struct rdp_softc *sc) -{ - u_short data = 0; - u_char b; - int i; - -#if DEBUG & 2 - kprintf("rdp_93c46_read(): "); -#endif - for (i = 0; i < 17; i++) { - WrNib(sc, PCMR + HNib, PCMR_SK + PCMR_CS + HNib); - DELAY(1); - WrNib(sc, PCMR + HNib, PCMR_CS + HNib); - DELAY(1); - b = RdNib(sc, PDR); - data <<= 1; - if (b & 1) - data |= 1; -#if DEBUG & 2 - kprintf("%d", b & 1); -#endif - RdEnd(sc, PDR); - DELAY(1); - } - -#if DEBUG & 2 - kprintf("\n"); -#endif - /* end of cycle */ - WrNib(sc, PCMR + HNib, PCMR_SK + HNib); - DELAY(1); - - return data; -} diff --git a/sys/dev/netif/rdp/if_rdpreg.h b/sys/dev/netif/rdp/if_rdpreg.h deleted file mode 100644 index f8527f1af7..0000000000 --- a/sys/dev/netif/rdp/if_rdpreg.h +++ /dev/null @@ -1,188 +0,0 @@ -#ifndef IF_RDPREG_H -#define IF_RDPREG_H 1 -/* - * Copyright (c) 1998 Joerg Wunsch - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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: src/sys/i386/isa/if_rdpreg.h,v 1.2 1999/08/28 00:44:49 peter Exp $ - * $DragonFly: src/sys/dev/netif/rdp/if_rdpreg.h,v 1.4 2006/11/07 06:43:23 dillon Exp $ - */ - -/* - * Part of the definitions here has been copied over from the REDP - * packet driver's REDPPD.INC file. This provides us with the same - * set of acronyms as the packet driver is using. - * - * The packet driver had no copyright, and is believed to be in the - * public domain. The author seems to be someone who calls himself - * "Chiu", so that's the only acknowledgment i can give here. - * Supposedly the author was someone from RealTek. - */ - -/* - * We're hanging upon an LPT port, thus suck in the lpt defs as well. - */ -#include - -struct rdphdr { - /* RTL8002 header that is prepended to the actual packet */ - u_char unused2[2]; - u_short pktlen; - u_char status; /* copy of RSR for this packet */ - u_char unused3[3]; -}; - -/* - * - * 8 Data Modes are provided: - * - * +--------+---------------+-------------+ - * | Mode | Read | Write | - * +--------+---------------+-------------+ - * | 0 | LptCtrl | LptData | - * +--------+---------------+-------------+ - * | 1 | LptCtrl | LptCtrl | - * +--------+---------------+-------------+ - * | 2 | LptCtrl*2 | LptData | - * +--------+---------------+-------------+ - * | 3 | LptCtrl*2 | LptCtrl | - * +--------+---------------+-------------+ - * | 4 | LptData | LptData | - * +--------+---------------+-------------+ - * | 5 | LptData | LptCtrl | - * +--------+---------------+-------------+ - * | 6 | LptData*2 | LptData | - * +--------+---------------+-------------+ - * | 7 | LptData*2 | LptCtrl | - * +--------+---------------+-------------+ - * - * Right now, this driver only implements mode 0 (which ought to work - * on any standard parallel interface). - * - */ - -/* - * Page 0 of EPLC registers - */ -#define IDR0 0x00 /* Ethernet ID register (R/W) */ -#define IDR1 0x01 -#define IDR2 0x02 -#define IDR3 0x03 -#define IDR4 0x04 -#define IDR5 0x05 -#define TBCR0 0x06 /* transmit byte count (W), 11 bits valid */ -#define TBCR1 0x07 -#define TSR 0x08 /* transmit status (R), cleared upon next tx */ -# define TSR_TOK 1 /* transmit OK */ -# define TSR_TABT 2 /* transmit aborted (excessive collisions) */ -# define TSR_COL 4 /* collision detected */ -# define TSR_CDH 8 /* CD heartbeat detected */ -#define RSR 0x09 /* - * receiver status (R), cleared upon next - * received packet (but stored in rx buffer - * header anyway) - */ -# define RSR_ROK 1 /* receive OK */ -# define RSR_CRC 2 /* CRC error */ -# define RSR_FA 4 /* frame alignment error (not multiple of 8) */ -# define RSR_BUFO 0x10 /* rx buffer overflow, packet discarded */ -# define RSR_PUN 0x20 /* packet count underflow (jump command issued - * but rx buffer was empty) */ -# define RSR_POV 0x40 /* packet count overflow (more than 254 (?) - * packets still in buffer) */ -#define ISR 0x0A /* interrupt status register (R), writing - * clears the written bits */ -# define ISR_TOK 1 /* transmission OK (~ TSR_TOK) */ -# define ISR_TER 2 /* transmitter error (~ TSR_TABT) */ -# define ISR_ROK 4 /* receive OK (~ RSR_ROK) */ -# define ISR_RER 8 /* receiver error (~ RSR_CRC|RSR_FA) */ -# define ISR_RBER 0x10 /* rx buffer overflow (POV|PUN|BUFO) */ -#define IMR 0x0B /* interrupt mask register (R/W), bit as ISR */ -#define CMR1 0x0C /* command register 1 (R/W) */ -# define CMR1_BUFE 1 /* (R) rx buffer empty */ -# define CMR1_IRQ 2 /* (R) interrupt request */ -# define CMR1_TRA 4 /* (R) transmission in progress */ - /* (W) transmit start */ -# define CMR1_TE 0x10 /* (R/W) transmitter enable */ -# define CMR1_RE 0x20 /* (R/W) receiver enable */ -# define CMR1_RST 0x40 /* (R/W) reset; sticks until reset completed */ -# define CMR1_RDPAC 1 /* (W) `rx jump packet', prepare for reading - * next packet from ring buffer */ -# define CMR1_WRPAC 2 /* (W) `tx jump packet', packet in tx buffer - * is complete and can be sent */ -# define CMR1_RETX 8 /* (W) retransmit (must be accomp'ed by TRA) */ -# define CMR1_MUX 0x80 /* (W) RTL8012: tell the printer MUX to - * connect the output pins to the host */ -#define CMR2 0x0D /* command register 2 (R/W) */ -# define CMR2_IRQOUT 1 /* interrupt signal output enabled */ -# define CMR2_RAMTST 2 /* enable RAM test */ -# define CMR2_PAGE 4 /* select register page #1 */ -# define CMR2_IRQINV 8 /* make active IRQ `low' */ -# define CMR2_AMbits 0x30 /* address mode bits: */ -# define CMR2_AM_NONE 0x00 /* 0: accept nothing */ -# define CMR2_AM_PHYS 0x10 /* 1: only physical addr */ -# define CMR2_AM_PB 0x20 /* 2: phys + broadcast */ -# define CMR2_AM_ALL 0x30 /* 3: promiscuous */ -# define CMR2_LBK 0x40 /* enable loopback */ -# define CMR2_SER 0x80 /* save error packet */ -#define MAR 0x0E /* memory access register (?), used for - * remote DMA to the 8002's buffer */ -#define PNR TBCR0 /* received packet number (R) */ -#define COLR TBCR1 /* collision count (R) (4 bit valid) */ - -/* - * Page 1 of EPLC registers -- EEPROM control - */ -#define PCMR TBCR0 /* port command register */ -/* bits for 93C46 control -- add HNib */ -#define PCMR_SK 0x04 /* serial clock for EEPROM */ -#define PCMR_CS 0x02 /* chip select for EEPROM */ -#define PCMR_DO 0x01 /* DI to EEPROM */ - -/* EEPROM data, nibbles for 74S288, bits for 93C46 */ -#define PDR TBCR1 /* DO from EEPROM, only bit 0 valid for - * serial EEPROM */ - -/* - * The following definitionss define remote DMA command through LptCtrl - */ -#define ATFD 3 /* ATFD bit in Lpt's Control register */ - /* -> ATFD bit is added for Xircom's MUX */ -#define Ctrl_LNibRead (0x08+ATFD) /* specify low nibble */ -#define Ctrl_HNibRead (0+ATFD) /* specify high nibble */ -#define Ctrl_SelData (0x04+ATFD) /* not through LptCtrl but through */ - /* LptData */ -#define Ctrl_IRQEN 0x10 /* set IRQEN of lpt control register */ - -/* Here define constants to construct the required read/write commands */ -#define WrAddr 0x40 /* set address of EPLC write register */ -#define RdAddr 0x0C0 /* set address of EPLC read register */ -#define EOR 0x20 /* ORed to make 'end of read',set CSB=1 */ -#define EOW 0x0E0 /* end of write, R/WB=A/DB=CSB=1 */ -#define EOC 0x0E0 /* End Of r/w Command, R/WB=A/DB=CSB=1 */ -#define HNib 0x10 - -#define MkHi(value) (((value) >> 4) | HNib) - -#endif /* IF_RDPREG_H */ diff --git a/sys/dev/netif/wl/if_wl.c b/sys/dev/netif/wl/if_wl.c deleted file mode 100644 index b17926adbd..0000000000 --- a/sys/dev/netif/wl/if_wl.c +++ /dev/null @@ -1,2729 +0,0 @@ -/* $FreeBSD: src/sys/i386/isa/if_wl.c,v 1.27.2.2 2000/07/17 21:24:32 archie Exp $ */ -/* - * 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 all copyright - * notices, this list of conditions and the following disclaimer. - * 2. The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. - * - */ -/* - * if_wl.c - original MACH, then BSDI ISA wavelan driver - * ported to mach by Anders Klemets - * to BSDI by Robert Morris - * to FreeBSD by Jim Binkley - * to FreeBSD 2.2+ by Michael Smith - * - * 2.2 update: - * Changed interface to match 2.1-2.2 differences. - * Implement IRQ selection logic in wlprobe() - * Implement PSA updating. - * Pruned heading comments for relevance. - * Ripped out all the 'interface counters' cruft. - * Cut the missing-interrupt timer back to 100ms. - * 2.2.1 update: - * now supports all multicast mode (mrouted will work), - * but unfortunately must do that by going into promiscuous mode - * NWID sysctl added so that normally promiscuous mode is NWID-specific - * but can be made NWID-inspecific - * 7/14/97 jrb - * - * Work done: - * Ported to FreeBSD, got promiscuous mode working with bpfs, - * and rewired timer routine. The i82586 will hang occasionally on output - * and the watchdog timer will kick it if so and log an entry. - * 2 second timeout there. Apparently the chip loses an interrupt. - * Code borrowed from if_ie.c for watchdog timer. - * - * The wavelan card is a 2mbit radio modem that emulates ethernet; - * i.e., it uses MAC addresses. This should not be a surprise since - * it uses an ethernet controller as a major hw item. - * It can broadcast, unicast or apparently multicast in a base cell - * using a omni-directional antennae that is - * about 800 feet around the base cell barring walls and metal. - * With directional antennae, it can be used point to point over a mile - * or so apparently (haven't tried that). - * - * There are ISA and pcmcia versions (not supported by this code). - * The ISA card has an Intel 82586 lan controller on it. It consists - * of 2 pieces of hw, the lan controller (intel) and a radio-modem. - * The latter has an extra set of controller registers that has nothing - * to do with the i82586 and allows setting and monitoring of radio - * signal strength, etc. There is a nvram area called the PSA that - * contains a number of setup variables including the IRQ and so-called - * NWID or Network ID. The NWID must be set the same for all radio - * cards to communicate (unless you are using the ATT/NCR roaming feature - * with their access points. There is no support for that here. Roaming - * involves a link-layer beacon sent out from the access points. End - * stations monitor the signal strength and only use the strongest - * access point). This driver assumes that the base ISA port, IRQ, - * and NWID are first set in nvram via the dos-side "instconf.exe" utility - * supplied with the card. This driver takes the ISA port from - * the kernel configuration setup, and then determines the IRQ either - * from the kernel config (if an explicit IRQ is set) or from the - * PSA on the card if not. - * The hw also magically just uses the IRQ set in the nvram. - * The NWID is used magically as well by the radio-modem - * to determine which packets to keep or throw out. - * - * sample config: - * - * device wl0 at isa? port 0x300 net irq ? - * - * Ifdefs: - * 1. WLDEBUG. (off) - if turned on enables IFF_DEBUG set via ifconfig debug - * 2. MULTICAST (on) - turned on and works up to and including mrouted - * 3. WLCACHE (off) - define to turn on a signal strength - * (and other metric) cache that is indexed by sender MAC address. - * Apps can read this out to learn the remote signal strength of a - * sender. Note that it has a switch so that it only stores - * broadcast/multicast senders but it could be set to store unicast - * too only. Size is hardwired in if_wl_wavelan.h - * - * one further note: promiscuous mode is a curious thing. In this driver, - * promiscuous mode apparently CAN catch ALL packets and ignore the NWID - * setting. This is probably more useful in a sense (for snoopers) if - * you are interested in all traffic as opposed to if you are interested - * in just your own. There is a driver specific sysctl to turn promiscuous - * from just promiscuous to wildly promiscuous... - * - * This driver also knows how to load the synthesizers in the 2.4 Gz - * ISA Half-card, Product number 847647476 (USA/FCC IEEE Channel set). - * This product consists of a "mothercard" that contains the 82586, - * NVRAM that holds the PSA, and the ISA-buss interface custom ASIC. - * The radio transceiver is a "daughtercard" called the WaveMODEM which - * connects to the mothercard through two single-inline connectors: a - * 20-pin connector provides DC-power and modem signals, and a 3-pin - * connector which exports the antenna connection. The code herein - * loads the receive and transmit synthesizers and the corresponding - * transmitter output power value from an EEPROM controlled through - * additional registers via the MMC. The EEPROM address selected - * are those whose values are preset by the DOS utility programs - * provided with the product, and this provides compatible operation - * with the DOS Packet Driver software. A future modification will - * add the necessary functionality to this driver and to the wlconfig - * utility to completely replace the DOS Configuration Utilities. - * The 2.4 Gz WaveMODEM is described in document number 407-024692/E, - * and is available through Lucent Technologies OEM supply channels. - * --RAB 1997/06/08. - */ - -#define MULTICAST 1 - -/* - * Olivetti PC586 Mach Ethernet driver v1.0 - * Copyright Ing. C. Olivetti & C. S.p.A. 1988, 1989 - * All rights reserved. - * - */ - -/* - Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc., -Cupertino, California. - - All Rights Reserved - - Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appears in all -copies and that both the copyright notice and this permission notice -appear in supporting documentation, and that the name of Olivetti -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - - OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, -IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, -NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION -WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/* - Copyright 1988, 1989 by Intel Corporation, Santa Clara, California. - - All Rights Reserved - -Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appears in all -copies and that both the copyright notice and this permission notice -appear in supporting documentation, and that the name of Intel -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - -INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, -IN NO EVENT SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, -NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION -WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/* - * NOTE: - * by rvb: - * 1. The best book on the 82586 is: - * LAN Components User's Manual by Intel - * The copy I found was dated 1984. This really tells you - * what the state machines are doing - * 2. In the current design, we only do one write at a time, - * though the hardware is capable of chaining and possibly - * even batching. The problem is that we only make one - * transmit buffer available in sram space. - */ - -#include "opt_wavelan.h" -#include "opt_inet.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#ifdef INET -#include -#include -#include -#include -#endif - -#include - -#include -#include -#include "if_wl_i82586.h" /* Definitions for the Intel chip */ - -/* was 1000 in original, fed to DELAY(x) */ -#define DELAYCONST 1000 -#include "if_wl.h" -#include - -static char t_packet[ETHERMTU + sizeof(struct ether_header) + sizeof(long)]; - -struct wl_softc{ - struct arpcom wl_ac; /* Ethernet common part */ -#define wl_if wl_ac.ac_if /* network visible interface */ -#define wl_addr wl_ac.ac_enaddr /* hardware address */ - u_char psa[0x40]; - u_char nwid[2]; /* current radio modem nwid */ - short base; - int flags; - int tbusy; /* flag to determine if xmit is busy */ - u_short begin_fd; - u_short end_fd; - u_short end_rbd; - u_short hacr; /* latest host adapter CR command */ - short mode; - u_char chan24; /* 2.4 Gz: channel number/EEPROM Area # */ - u_short freq24; /* 2.4 Gz: resulting frequency */ - int rid_ioport; - int rid_irq; - struct resource *res_ioport; - struct resource *res_irq; - void *intr_handle; - struct callout watchdog_ch; -#ifdef WLCACHE - int w_sigitems; /* number of cached entries */ - /* array of cache entries */ - struct w_sigcache w_sigcache[ MAXCACHEITEMS ]; - int w_nextcache; /* next free cache entry */ - int w_wrapindex; /* next "free" cache entry */ -#endif -}; - -/* - * XXX The Wavelan appears to be prone to dropping stuff if you talk to - * it too fast. This disgusting hack inserts a delay after each packet - * is queued which helps avoid this behaviour on fast systems. - */ -static int wl_xmit_delay = 250; -SYSCTL_INT(_machdep, OID_AUTO, wl_xmit_delay, CTLFLAG_RW, &wl_xmit_delay, 0, ""); - -/* - * not XXX, but ZZZ (bizarre). - * promiscuous mode can be toggled to ignore NWIDs. By default, - * it does not. Caution should be exercised about combining - * this mode with IFF_ALLMULTI which puts this driver in - * promiscuous mode. - */ -static int wl_ignore_nwid = 0; -SYSCTL_INT(_machdep, OID_AUTO, wl_ignore_nwid, CTLFLAG_RW, &wl_ignore_nwid, 0, ""); - -/* - * Emit diagnostics about transmission problems - */ -static int xmt_watch = 0; -SYSCTL_INT(_machdep, OID_AUTO, wl_xmit_watch, CTLFLAG_RW, &xmt_watch, 0, ""); - -/* - * Collect SNR statistics - */ -static int gathersnr = 0; -SYSCTL_INT(_machdep, OID_AUTO, wl_gather_snr, CTLFLAG_RW, &gathersnr, 0, ""); - -static int wlprobe(device_t); -static int wlattach(device_t); -static int wldetach(device_t); -static int wl_alloc_resources(device_t); -static void wl_free_resources(device_t); -static void wlstart(struct ifnet *); -static void wlinit(void *); -static int wlioctl(struct ifnet *, u_long, caddr_t, struct ucred *); -static timeout_t wlwatchdog; -static void wlintr(void *); -static void wlxmt(struct wl_softc *, struct mbuf *); -static int wldiag(struct wl_softc *); -static int wlconfig(struct wl_softc *); -static int wlcmd(struct wl_softc *, const char *); -static void wlmmcstat(struct wl_softc *); -static u_short wlbldru(struct wl_softc *); -static u_short wlmmcread(u_int, u_short); -static void wlinitmmc(struct wl_softc *); -static int wlhwrst(struct wl_softc *); -static void wlrustrt(struct wl_softc *); -static void wlbldcu(struct wl_softc *); -static int wlack(struct wl_softc *); -static int wlread(struct wl_softc *, u_short); -static void getsnr(struct wl_softc *); -static void wlrcv(struct wl_softc *); -static int wlrequeue(struct wl_softc *, u_short); -static void wlsftwsleaze(u_short *, u_char **, struct mbuf **); -static void wlhdwsleaze(u_short *, u_char **, struct mbuf **); -static void wltbd(struct wl_softc *); -static void wlgetpsa(int, u_char *); -static void wlsetpsa(struct wl_softc *); -static u_short wlpsacrc(u_char *); -static void wldump(struct wl_softc *); -#ifdef WLCACHE -static void wl_cache_store(struct wl_softc *, int, struct ether_header *, - struct mbuf *); -static void wl_cache_zero(struct wl_softc *); -#endif -#ifdef MULTICAST -# if defined(__FreeBSD__) && __FreeBSD_version < 300000 -static int check_allmulti(struct wl_softc *); -# endif -#endif - -static device_method_t wl_methods[] = { - DEVMETHOD(device_probe, wlprobe), - DEVMETHOD(device_attach, wlattach), - DEVMETHOD(device_detach, wldetach), - { 0, 0 } -}; - -static driver_t wl_driver = { - "wl", - wl_methods, - sizeof(struct wl_softc) -}; - -devclass_t wl_devclass; -DECLARE_DUMMY_MODULE(if_wl); -DRIVER_MODULE(wl, isa, wl_driver, wl_devclass, NULL, NULL); -MODULE_DEPEND(wl, isa, 1, 1, 1); - -static struct isa_pnp_id wl_ids[] = { - { 0, NULL } -}; - -/* array for maping irq numbers to values for the irq parameter register */ -static int irqvals[16] = { - 0, 0, 0, 0x01, 0x02, 0x04, 0, 0x08, 0, 0, 0x10, 0x20, 0x40, 0, 0, 0x80 -}; - -/* - * wlprobe: - * - * This function "probes" or checks for the WaveLAN board on the bus to - * see if it is there. As far as I can tell, the best break between this - * routine and the attach code is to simply determine whether the board - * is configured in properly. Currently my approach to this is to write - * and read a word from the SRAM on the board being probed. If the word - * comes back properly then we assume the board is there. The config - * code expects to see a successful return from the probe routine before - * attach will be called. - */ -static int -wlprobe(device_t dev) -{ - struct wl_softc *sc; - short base; - const char *str = "wl%d: board out of range [0..%d]\n"; - u_char inbuf[100]; - int irq, error; - - error = ISA_PNP_PROBE(device_get_parent(dev), dev, wl_ids); - if (error == ENXIO || error == 0) - return (error); - - sc = device_get_softc(dev); - error = wl_alloc_resources(dev); - if (error) - return error; - - base = rman_get_start(sc->res_ioport); - - /* TBD. not true. - * regular CMD() will not work, since no softc yet - */ -#define PCMD(base, hacr) outw((base), (hacr)) - - PCMD(base, HACR_RESET); /* reset the board */ - DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */ - PCMD(base, HACR_RESET); /* reset the board */ - DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */ - - /* clear reset command and set PIO#1 in autoincrement mode */ - PCMD(base, HACR_DEFAULT); - PCMD(base, HACR_DEFAULT); - outw(PIOR1(base), 0); /* go to beginning of RAM */ - outsw(PIOP1(base), str, strlen(str)/2+1); /* write string */ - - outw(PIOR1(base), 0); /* rewind */ - insw(PIOP1(base), inbuf, strlen(str)/2+1); /* read result */ - - if (bcmp(str, inbuf, strlen(str))) { - error = ENXIO; - goto fail; - } - - sc->chan24 = 0; /* 2.4 Gz: config channel */ - sc->freq24 = 0; /* 2.4 Gz: frequency */ - - /* read the PSA from the board into temporary storage */ - wlgetpsa(base, inbuf); - - /* We read the IRQ value from the PSA on the board. */ - for (irq = 15; irq >= 0; irq--) - if (irqvals[irq] == inbuf[WLPSA_IRQNO]) - break; - if ((irq == 0) || (irqvals[irq] == 0)){ - device_printf(dev, "PSA corrupt (invalid IRQ value)\n"); - } else { - u_long sirq, dummy; - - /* - * If the IRQ requested by the PSA is already claimed by another - * device, the board won't work, but the user can still access the - * driver to change the IRQ. - */ - if (bus_get_resource(dev, SYS_RES_IRQ, 0, &sirq, &dummy)) - goto fail; - if (irq != (int)sirq) - device_printf(dev, "board is configured for interrupt %d\n", irq); - } - error = 0; - -fail: - wl_free_resources(dev); - return (error); -} - -/* - * wlattach: - * - * This function attaches a WaveLAN board to the "system". The rest of - * runtime structures are initialized here (this routine is called after - * a successful probe of the board). Once the ethernet address is read - * and stored, the board's ifnet structure is attached and readied. - */ -static int -wlattach(device_t dev) -{ - struct wl_softc *sc; - short base; - int i, j, error; - struct ifnet *ifp; - - sc = device_get_softc(dev); - - ifp = &sc->wl_if; - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - - error = wl_alloc_resources(dev); - if (error) - return error; - - base = rman_get_start(sc->res_ioport); - -#ifdef WLDEBUG - device_printf(dev, "%s: base %x, unit %d\n", - __func__, base, device_get_unit(dev)); -#endif - - sc->base = base; - sc->flags = 0; - sc->mode = 0; - sc->hacr = HACR_RESET; - callout_init(&sc->watchdog_ch); - CMD(sc); /* reset the board */ - DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */ - - /* clear reset command and set PIO#2 in parameter access mode */ - sc->hacr = (HACR_DEFAULT & ~HACR_16BITS); - CMD(sc); - - /* Read the PSA from the board for our later reference */ - wlgetpsa(base, sc->psa); - - /* fetch NWID */ - sc->nwid[0] = sc->psa[WLPSA_NWID]; - sc->nwid[1] = sc->psa[WLPSA_NWID+1]; - - /* fetch MAC address - decide which one first */ - if (sc->psa[WLPSA_MACSEL] & 1) { - j = WLPSA_LOCALMAC; - } else { - j = WLPSA_UNIMAC; - } - for(i=0; i < WAVELAN_ADDR_SIZE; ++i) { - sc->wl_addr[i] = sc->psa[j + i]; - } - - /* enter normal 16 bit mode operation */ - sc->hacr = HACR_DEFAULT; - CMD(sc); - - wlinitmmc(sc); - outw(PIOR1(base), OFFSET_SCB + 8); /* address of scb_crcerrs */ - outw(PIOP1(base), 0); /* clear scb_crcerrs */ - outw(PIOP1(base), 0); /* clear scb_alnerrs */ - outw(PIOP1(base), 0); /* clear scb_rscerrs */ - outw(PIOP1(base), 0); /* clear scb_ovrnerrs */ - - ifp->if_softc = sc; - ifp->if_mtu = WAVELAN_MTU; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; -#ifdef WLDEBUG - ifp->if_flags |= IFF_DEBUG; -#endif -#if MULTICAST - ifp->if_flags |= IFF_MULTICAST; -#endif /* MULTICAST */ - ifp->if_init = wlinit; - ifp->if_start = wlstart; - ifp->if_ioctl = wlioctl; - ifp->if_timer = 0; /* paranoia */ - /* no entries - ifp->if_watchdog - ifp->if_done - ifp->if_reset - */ - ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN); - ifq_set_ready(&ifp->if_snd); - ether_ifattach(ifp, sc->wl_ac.ac_enaddr, NULL); - - if (sc->freq24) - kprintf(", Freq %d MHz",sc->freq24); /* 2.4 Gz */ - kprintf("\n"); /* 2.4 Gz */ - - error = bus_setup_intr(dev, sc->res_irq, INTR_MPSAFE, - wlintr, sc, &sc->intr_handle, - ifp->if_serializer); - if (error) { - device_printf(dev, "setup irq fail!\n"); - ether_ifdetach(ifp); - wl_free_resources(dev); - return error; - } - - ifp->if_cpuid = ithread_cpuid(rman_get_start(sc->res_irq)); - KKASSERT(ifp->if_cpuid >= 0 && ifp->if_cpuid < ncpus); - - if (bootverbose) - wldump(sc); - return 0; -} - -static int -wldetach(device_t dev) -{ - struct wl_softc *sc = device_get_softc(dev); - device_t parent = device_get_parent(dev); - struct ifnet *ifp = &sc->wl_if; - - lwkt_serialize_enter(ifp->if_serializer); - - /* reset the board */ - sc->hacr = HACR_RESET; - CMD(sc); - sc->hacr = HACR_DEFAULT; - CMD(sc); - - if (sc->intr_handle != NULL) { - BUS_TEARDOWN_INTR(parent, dev, sc->res_irq, sc->intr_handle); - sc->intr_handle = NULL; - } - - lwkt_serialize_exit(ifp->if_serializer); - - ether_ifdetach(ifp); - bus_generic_detach(dev); - wl_free_resources(dev); - - return (0); -} - -static int -wl_alloc_resources(device_t dev) -{ - struct wl_softc *sc = device_get_softc(dev); - int ports = 16; /* Number of ports */ - - sc->res_ioport = bus_alloc_resource(dev, SYS_RES_IOPORT, - &sc->rid_ioport, 0ul, ~0ul, ports, RF_ACTIVE); - if (sc->res_ioport == NULL) - goto fail; - - sc->res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->rid_irq, RF_SHAREABLE | RF_ACTIVE); - if (sc->res_irq == NULL) - goto fail; - return (0); - -fail: - wl_free_resources(dev); - return (ENXIO); -} - -static void -wl_free_resources(device_t dev) -{ - struct wl_softc *sc = device_get_softc(dev); - - if (sc->res_irq != 0) { - bus_deactivate_resource(dev, SYS_RES_IRQ, sc->rid_irq, sc->res_irq); - bus_release_resource(dev, SYS_RES_IRQ, sc->rid_irq, sc->res_irq); - sc->res_irq = 0; - } - if (sc->res_ioport != 0) { - bus_deactivate_resource(dev, SYS_RES_IOPORT, - sc->rid_ioport, sc->res_ioport); - bus_release_resource(dev, SYS_RES_IOPORT, - sc->rid_ioport, sc->res_ioport); - sc->res_ioport = 0; - } -} - -/* - * Print out interesting information about the 82596. - */ -static void -wldump(struct wl_softc *sc) -{ - int base = sc->base; - int i; - - if_printf(&sc->wl_if, "hasr %04x\n", inw(HASR(base))); - - if_printf(&sc->wl_if, "scb at %04x:\n ", OFFSET_SCB); - outw(PIOR1(base), OFFSET_SCB); - for(i = 0; i < 8; i++) - kprintf("%04x ", inw(PIOP1(base))); - kprintf("\n"); - - if_printf(&sc->wl_if, "cu at %04x:\n ", OFFSET_CU); - outw(PIOR1(base), OFFSET_CU); - for(i = 0; i < 8; i++) - kprintf("%04x ", inw(PIOP1(base))); - kprintf("\n"); - - if_printf(&sc->wl_if, "tbd at %04x:\n ", OFFSET_TBD); - outw(PIOR1(base), OFFSET_TBD); - for(i = 0; i < 4; i++) - kprintf("%04x ", inw(PIOP1(base))); - kprintf("\n"); -} - -/* Initialize the Modem Management Controller */ -static void -wlinitmmc(struct wl_softc *sc) -{ - int base = sc->base; - int configured; - int mode = sc->mode; - int i; /* 2.4 Gz */ - - /* enter 8 bit operation */ - sc->hacr = (HACR_DEFAULT & ~HACR_16BITS); - CMD(sc); - - configured = sc->psa[WLPSA_CONFIGURED] & 1; - - /* - * Set default modem control parameters. Taken from NCR document - * 407-0024326 Rev. A - */ - MMC_WRITE(MMC_JABBER_ENABLE, 0x01); - MMC_WRITE(MMC_ANTEN_SEL, 0x02); - MMC_WRITE(MMC_IFS, 0x20); - MMC_WRITE(MMC_MOD_DELAY, 0x04); - MMC_WRITE(MMC_JAM_TIME, 0x38); - MMC_WRITE(MMC_DECAY_PRM, 0x00); /* obsolete ? */ - MMC_WRITE(MMC_DECAY_UPDAT_PRM, 0x00); - if (!configured) { - MMC_WRITE(MMC_LOOPT_SEL, 0x00); - if (sc->psa[WLPSA_COMPATNO] & 1) { - MMC_WRITE(MMC_THR_PRE_SET, 0x01); /* 0x04 for AT and 0x01 for MCA */ - } else { - MMC_WRITE(MMC_THR_PRE_SET, 0x04); /* 0x04 for AT and 0x01 for MCA */ - } - MMC_WRITE(MMC_QUALITY_THR, 0x03); - } else { - /* use configuration defaults from parameter storage area */ - if (sc->psa[WLPSA_NWIDENABLE] & 1) { - if ((mode & (MOD_PROM | MOD_ENAL)) && wl_ignore_nwid) { - MMC_WRITE(MMC_LOOPT_SEL, 0x40); - } else { - MMC_WRITE(MMC_LOOPT_SEL, 0x00); - } - } else { - MMC_WRITE(MMC_LOOPT_SEL, 0x40); /* disable network id check */ - } - MMC_WRITE(MMC_THR_PRE_SET, sc->psa[WLPSA_THRESH]); - MMC_WRITE(MMC_QUALITY_THR, sc->psa[WLPSA_QUALTHRESH]); - } - MMC_WRITE(MMC_FREEZE, 0x00); - MMC_WRITE(MMC_ENCR_ENABLE, 0x00); - - MMC_WRITE(MMC_NETW_ID_L,sc->nwid[1]); /* set NWID */ - MMC_WRITE(MMC_NETW_ID_H,sc->nwid[0]); - - /* enter normal 16 bit mode operation */ - sc->hacr = HACR_DEFAULT; - CMD(sc); - CMD(sc); /* virtualpc1 needs this! */ - - if (sc->psa[WLPSA_COMPATNO]== /* 2.4 Gz: half-card ver */ - WLPSA_COMPATNO_WL24B) { /* 2.4 Gz */ - i=sc->chan24<<4; /* 2.4 Gz: position ch # */ - MMC_WRITE(MMC_EEADDR,i+0x0f); /* 2.4 Gz: named ch, wc=16 */ - MMC_WRITE(MMC_EECTRL,MMC_EECTRL_DWLD+ /* 2.4 Gz: Download Synths */ - MMC_EECTRL_EEOP_READ); /* 2.4 Gz: Read EEPROM */ - for (i=0; i<1000; ++i) { /* 2.4 Gz: wait for download */ - DELAY(40); /* 2.4 Gz */ - if ((wlmmcread(base,MMC_EECTRLstat) /* 2.4 Gz: check DWLD and */ - &(MMC_EECTRLstat_DWLD /* 2.4 Gz: EEBUSY */ - +MMC_EECTRLstat_EEBUSY))==0) /* 2.4 Gz: */ - break; /* 2.4 Gz: download finished */ - } /* 2.4 Gz */ - if (i==1000) { - if_printf(&sc->wl_if, - "synth load failed\n"); /* 2.4 Gz */ - } - MMC_WRITE(MMC_EEADDR,0x61); /* 2.4 Gz: default pwr, wc=2 */ - MMC_WRITE(MMC_EECTRL,MMC_EECTRL_DWLD+ /* 2.4 Gz: Download Xmit Pwr */ - MMC_EECTRL_EEOP_READ); /* 2.4 Gz: Read EEPROM */ - for (i=0; i<1000; ++i) { /* 2.4 Gz: wait for download */ - DELAY(40); /* 2.4 Gz */ - if ((wlmmcread(base,MMC_EECTRLstat) /* 2.4 Gz: check DWLD and */ - &(MMC_EECTRLstat_DWLD /* 2.4 Gz: EEBUSY */ - +MMC_EECTRLstat_EEBUSY))==0) /* 2.4 Gz: */ - break; /* 2.4 Gz: download finished */ - } /* 2.4 Gz */ - if (i==1000) { - if_printf(&sc->wl_if, - "xmit pwr load failed\n");/* 2.4 Gz */ - } - MMC_WRITE(MMC_ANALCTRL, /* 2.4 Gz: EXT ant+polarity */ - MMC_ANALCTRL_ANTPOL + /* 2.4 Gz: */ - MMC_ANALCTRL_EXTANT); /* 2.4 Gz: */ - i=sc->chan24<<4; /* 2.4 Gz: position ch # */ - MMC_WRITE(MMC_EEADDR,i); /* 2.4 Gz: get frequency */ - MMC_WRITE(MMC_EECTRL, /* 2.4 Gz: EEPROM read */ - MMC_EECTRL_EEOP_READ); /* 2.4 Gz: */ - DELAY(40); /* 2.4 Gz */ - i = wlmmcread(base,MMC_EEDATALrv) /* 2.4 Gz: freq val */ - + (wlmmcread(base,MMC_EEDATAHrv)<<8); /* 2.4 Gz */ - sc->freq24 = (i>>6)+2400; /* 2.4 Gz: save real freq */ - } -} - -/* - * wlinit: - * - * Another routine that interfaces the "if" layer to this driver. - * Simply resets the structures that are used by "upper layers". - * As well as calling wlhwrst that does reset the WaveLAN board. - * - * input : softc pointer for this interface - * output : structures (if structs) and board are reset - * - */ -static void -wlinit(void *xsc) -{ - struct wl_softc *sc = xsc; - struct ifnet *ifp = &sc->wl_if; - -#ifdef WLDEBUG - if (ifp->if_flags & IFF_DEBUG) - if_printf(ifp, "entered wlinit()\n"); -#endif - if (wlhwrst(sc) == TRUE) { - ifp->if_flags |= IFF_RUNNING; /* same as DSF_RUNNING */ - /* - * OACTIVE is used by upper-level routines - * and must be set - */ - ifp->if_flags &= ~IFF_OACTIVE; /* same as tbusy below */ - - sc->flags |= DSF_RUNNING; - sc->tbusy = 0; - callout_stop(&sc->watchdog_ch); - - if_devstart(ifp); - } else { - if_printf(ifp, "init(): trouble resetting board.\n"); - } -} - -/* - * wlhwrst: - * - * This routine resets the WaveLAN board that corresponds to the - * board number passed in. - * - * input : softc pointer for this interface - * output : board is reset - * - */ -static int -wlhwrst(struct wl_softc *sc) -{ -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if_printf(&sc->wl_if, "entered wlhwrst()\n"); -#endif - sc->hacr = HACR_RESET; - CMD(sc); /* reset the board */ - - /* clear reset command and set PIO#1 in autoincrement mode */ - sc->hacr = HACR_DEFAULT; - CMD(sc); - -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - wlmmcstat(sc); /* Display MMC registers */ -#endif /* WLDEBUG */ - wlbldcu(sc); /* set up command unit structures */ - - if (wldiag(sc) == 0) - return(0); - - if (wlconfig(sc) == 0) - return(0); - /* - * insert code for loopback test here - */ - wlrustrt(sc); /* start receive unit */ - - /* enable interrupts */ - sc->hacr = (HACR_DEFAULT | HACR_INTRON); - CMD(sc); - - return(1); -} - -/* - * wlbldcu: - * - * This function builds up the command unit structures. It inits - * the scp, iscp, scb, cb, tbd, and tbuf. - * - */ -static void -wlbldcu(struct wl_softc *sc) -{ - short base = sc->base; - scp_t scp; - iscp_t iscp; - scb_t scb; - ac_t cb; - tbd_t tbd; - int i; - - bzero(&scp, sizeof(scp)); - scp.scp_sysbus = 0; - scp.scp_iscp = OFFSET_ISCP; - scp.scp_iscp_base = 0; - outw(PIOR1(base), OFFSET_SCP); - outsw(PIOP1(base), &scp, sizeof(scp_t)/2); - - bzero(&iscp, sizeof(iscp)); - iscp.iscp_busy = 1; - iscp.iscp_scb_offset = OFFSET_SCB; - iscp.iscp_scb = 0; - iscp.iscp_scb_base = 0; - outw(PIOR1(base), OFFSET_ISCP); - outsw(PIOP1(base), &iscp, sizeof(iscp_t)/2); - - scb.scb_status = 0; - scb.scb_command = SCB_RESET; - scb.scb_cbl_offset = OFFSET_CU; - scb.scb_rfa_offset = OFFSET_RU; - scb.scb_crcerrs = 0; - scb.scb_alnerrs = 0; - scb.scb_rscerrs = 0; - scb.scb_ovrnerrs = 0; - outw(PIOR1(base), OFFSET_SCB); - outsw(PIOP1(base), &scb, sizeof(scb_t)/2); - - SET_CHAN_ATTN(sc); - - outw(PIOR0(base), OFFSET_ISCP + 0); /* address of iscp_busy */ - for (i = 1000000; inw(PIOP0(base)) && (i-- > 0); ); - if (i <= 0) if_printf(&sc->wl_if, "bldcu(): iscp_busy timeout.\n"); - outw(PIOR0(base), OFFSET_SCB + 0); /* address of scb_status */ - for (i = STATUS_TRIES; i-- > 0; ) { - if (inw(PIOP0(base)) == (SCB_SW_CX|SCB_SW_CNA)) - break; - } - if (i <= 0) - if_printf(&sc->wl_if, "bldcu(): not ready after reset.\n"); - wlack(sc); - - cb.ac_status = 0; - cb.ac_command = AC_CW_EL; /* NOP */ - cb.ac_link_offset = OFFSET_CU; - outw(PIOR1(base), OFFSET_CU); - outsw(PIOP1(base), &cb, 6/2); - - tbd.act_count = 0; - tbd.next_tbd_offset = I82586NULL; - tbd.buffer_addr = 0; - tbd.buffer_base = 0; - outw(PIOR1(base), OFFSET_TBD); - outsw(PIOP1(base), &tbd, sizeof(tbd_t)/2); -} - -/* - * wlstart: - * - * send a packet - * - * input : pointer the appropriate "if" struct - * output : stuff sent to board if any there - * - */ -static void -wlstart(struct ifnet *ifp) -{ - struct mbuf *m; - struct wl_softc *sc = ifp->if_softc; - short base = sc->base; - int scb_status, cu_status, scb_command; - -#ifdef WLDEBUG - if (ifp->if_flags & IFF_DEBUG) - if_printf(ifp, "entered wlstart()\n"); -#endif - - outw(PIOR1(base), OFFSET_CU); - cu_status = inw(PIOP1(base)); - outw(PIOR0(base),OFFSET_SCB + 0); /* scb_status */ - scb_status = inw(PIOP0(base)); - outw(PIOR0(base), OFFSET_SCB + 2); - scb_command = inw(PIOP0(base)); - - /* - * don't need OACTIVE check as tbusy here checks to see - * if we are already busy - */ - if (sc->tbusy) { - if((scb_status & 0x0700) == SCB_CUS_IDLE && - (cu_status & AC_SW_B) == 0){ - sc->tbusy = 0; - callout_stop(&sc->watchdog_ch); - ifp->if_flags &= ~IFF_OACTIVE; - /* - * This is probably just a race. The xmt'r is just - * became idle but WE have masked interrupts so ... - */ -#ifdef WLDEBUG - if_printf(ifp, "CU idle, scb %04x %04x cu %04x\n", - scb_status, scb_command, cu_status); -#endif - if (xmt_watch) if_printf(ifp, "!!\n"); - } else { - return; /* genuinely still busy */ - } - } else if((scb_status & 0x0700) == SCB_CUS_ACTV || - (cu_status & AC_SW_B)){ -#ifdef WLDEBUG - if_printf(ifp, "CU unexpectedly busy; scb %04x cu %04x\n", - scb_status, cu_status); -#endif - if (xmt_watch) if_printf(ifp, "busy?!"); - return; /* hey, why are we busy? */ - } - - /* get ourselves some data */ - ifp = &(sc->wl_if); - m = ifq_dequeue(&ifp->if_snd, NULL); - if (m != NULL) { - BPF_MTAP(ifp, m); - sc->tbusy++; - /* set the watchdog timer so that if the board - * fails to interrupt we will restart - */ - /* try 10 ticks, not very long */ - callout_reset(&sc->watchdog_ch, 10, wlwatchdog, sc); - ifp->if_flags |= IFF_OACTIVE; - ifp->if_opackets++; - wlxmt(sc, m); - } else { - ifp->if_flags &= ~IFF_OACTIVE; - } -} - -/* - * wlread: - * - * This routine does the actual copy of data (including ethernet header - * structure) from the WaveLAN to an mbuf chain that will be passed up - * to the "if" (network interface) layer. NOTE: we currently - * don't handle trailer protocols, so if that is needed, it will - * (at least in part) be added here. For simplicities sake, this - * routine copies the receive buffers from the board into a local (stack) - * buffer until the frame has been copied from the board. Once in - * the local buffer, the contents are copied to an mbuf chain that - * is then enqueued onto the appropriate "if" queue. - * - * input : softc pointer for this interface and - * an frame descriptor address - * output : the packet is put into an mbuf chain, and passed up - * assumes : if any errors occur, packet is "dropped on the floor" - * - */ -static int -wlread(struct wl_softc *sc, u_short fd_p) -{ - struct ifnet *ifp = &sc->wl_if; - short base = sc->base; - fd_t fd; - struct ether_header eh; - struct mbuf *m, *tm; - rbd_t rbd; - u_char *mb_p; - u_short mlen, len, clen; - u_short bytes_in_msg, bytes_in_mbuf, bytes; - - -#ifdef WLDEBUG - if (ifp->if_flags & IFF_DEBUG) - if_printf(ifp, "entered wlread()\n"); -#endif - if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) { - if_printf(ifp, "read(): board is not running.\n"); - sc->hacr &= ~HACR_INTRON; - CMD(sc); /* turn off interrupts */ - } - /* read ether_header info out of device memory. doesn't - * go into mbuf. goes directly into eh structure - */ - len = sizeof(struct ether_header); /* 14 bytes */ - outw(PIOR1(base), fd_p); - insw(PIOP1(base), &fd, (sizeof(fd_t) - len)/2); - insw(PIOP1(base), &eh, (len-2)/2); - eh.ether_type = ntohs(inw(PIOP1(base))); -#ifdef WLDEBUG - if (ifp->if_flags & IFF_DEBUG) - if_printf(ifp, "wlread: rcv packet, type is %x\n", eh.ether_type); -#endif - /* - * WARNING. above is done now in ether_input, above may be - * useful for debug. jrb - */ - eh.ether_type = htons(eh.ether_type); - - if (fd.rbd_offset == I82586NULL) { - if_printf(ifp, "read(): Invalid buffer\n"); - if (wlhwrst(sc) != TRUE) - if_printf(ifp, "read(): hwrst trouble.\n"); - return 0; - } - - outw(PIOR1(base), fd.rbd_offset); - insw(PIOP1(base), &rbd, sizeof(rbd_t)/2); - bytes_in_msg = rbd.status & RBD_SW_COUNT; - MGETHDR(m, MB_DONTWAIT, MT_DATA); - tm = m; - if (m == NULL) { - /* - * not only do we want to return, we need to drop the packet on - * the floor to clear the interrupt. - * - */ - if (wlhwrst(sc) != TRUE) { - sc->hacr &= ~HACR_INTRON; - CMD(sc); /* turn off interrupts */ - if_printf(ifp, "read(): hwrst trouble.\n"); - } - return 0; - } - m->m_next = NULL; - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = 0; /* don't know this yet */ - m->m_len = MHLEN; - - /* always use a cluster. jrb - */ - MCLGET(m, MB_DONTWAIT); - if (m->m_flags & M_EXT) { - m->m_len = MCLBYTES; - } - else { - m_freem(m); - if (wlhwrst(sc) != TRUE) { - sc->hacr &= ~HACR_INTRON; - CMD(sc); /* turn off interrupts */ - if_printf(ifp, "read(): hwrst trouble.\n"); - } - return 0; - } - - mlen = 0; - clen = mlen; - bytes_in_mbuf = m->m_len - sizeof(eh); - mb_p = mtod(tm, u_char *); - bytes = min(bytes_in_mbuf, bytes_in_msg); - bcopy(&eh, mb_p, sizeof(eh)); - mb_p += sizeof(eh); - for (;;) { - if (bytes & 1) { - len = bytes + 1; - } else { - len = bytes; - } - outw(PIOR1(base), rbd.buffer_addr); - insw(PIOP1(base), mb_p, len/2); - clen += bytes; - mlen += bytes; - - if (!(bytes_in_mbuf -= bytes)) { - MGET(tm->m_next, MB_DONTWAIT, MT_DATA); - tm = tm->m_next; - if (tm == NULL) { - m_freem(m); - if_printf(ifp, "read(): No mbuf nth\n"); - if (wlhwrst(sc) != TRUE) { - sc->hacr &= ~HACR_INTRON; - CMD(sc); /* turn off interrupts */ - if_printf(ifp, "read(): hwrst trouble.\n"); - } - return 0; - } - mlen = 0; - tm->m_len = MLEN; - bytes_in_mbuf = MLEN; - mb_p = mtod(tm, u_char *); - } else { - mb_p += bytes; - } - - if (!(bytes_in_msg -= bytes)) { - if (rbd.status & RBD_SW_EOF || - rbd.next_rbd_offset == I82586NULL) { - tm->m_len = mlen; - break; - } else { - outw(PIOR1(base), rbd.next_rbd_offset); - insw(PIOP1(base), &rbd, sizeof(rbd_t)/2); - bytes_in_msg = rbd.status & RBD_SW_COUNT; - } - } else { - rbd.buffer_addr += bytes; - } - - bytes = min(bytes_in_mbuf, bytes_in_msg); - } - - m->m_pkthdr.len = clen; - - /* - * If hw is in promiscuous mode (note that I said hardware, not if - * IFF_PROMISC is set in ifnet flags), then if this is a unicast - * packet and the MAC dst is not us, drop it. This check in normally - * inside ether_input(), but IFF_MULTI causes hw promisc without - * a bpf listener, so this is wrong. - * Greg Troxel , 1998-08-07 - */ - /* - * TBD: also discard packets where NWID does not match. - * However, there does not appear to be a way to read the nwid - * for a received packet. -gdt 1998-08-07 - */ - if ( -#ifdef WL_USE_IFNET_PROMISC_CHECK /* not defined */ - (ifp->if_flags & (IFF_PROMISC|IFF_ALLMULTI)) -#else - /* hw is in promisc mode if this is true */ - (sc->mode & (MOD_PROM | MOD_ENAL)) -#endif - && - (eh.ether_dhost[0] & 1) == 0 && /* !mcast and !bcast */ - bcmp(eh.ether_dhost, sc->wl_ac.ac_enaddr, - sizeof(eh.ether_dhost)) != 0 ) { - m_freem(m); - return 1; - } - -#ifdef WLDEBUG - if (ifp->if_flags & IFF_DEBUG) - if_printf(ifp, "wlrecv %d bytes\n", clen); -#endif - -#ifdef WLCACHE - wl_cache_store(sc, base, &eh, m); -#endif - - /* - * received packet is now in a chain of mbuf's. next step is - * to pass the packet upwards. - * - */ - ifp->if_input(ifp, m); - return 1; -} - -/* - * wlioctl: - * - * This routine processes an ioctl request from the "if" layer - * above. - * - * input : pointer the appropriate "if" struct, command and data - * output : based on command appropriate action is taken on the - * WaveLAN board(s) or related structures - * return : error is returned containing exit conditions - * - */ -static int -wlioctl(struct ifnet *ifp, u_long cmd, caddr_t data, struct ucred *cred) -{ - struct ifreq *ifr = (struct ifreq *)data; - struct wl_softc *sc = ifp->if_softc; - short base = sc->base; - short mode = 0; - int error = 0; - int irq, irqval, i, isroot, size; - caddr_t up; - char * cpt; - struct thread *td = curthread; /* XXX */ - - -#ifdef WLDEBUG - if (ifp->if_flags & IFF_DEBUG) - if_printf(ifp, "entered wlioctl()\n"); -#endif - switch (cmd) { - case SIOCSIFFLAGS: - if (ifp->if_flags & IFF_ALLMULTI) { - mode |= MOD_ENAL; - } - if (ifp->if_flags & IFF_PROMISC) { - mode |= MOD_PROM; - } - if(ifp->if_flags & IFF_LINK0) { - mode |= MOD_PROM; - } - /* - * force a complete reset if the recieve multicast/ - * promiscuous mode changes so that these take - * effect immediately. - * - */ - if (sc->mode != mode) { - sc->mode = mode; - if (sc->flags & DSF_RUNNING) { - sc->flags &= ~DSF_RUNNING; - wlinit(sc); - } - } - /* if interface is marked DOWN and still running then - * stop it. - */ - if ((ifp->if_flags & IFF_UP) == 0 && sc->flags & DSF_RUNNING) { - if_printf(ifp, "ioctl(): board is not running\n"); - sc->flags &= ~DSF_RUNNING; - sc->hacr &= ~HACR_INTRON; - CMD(sc); /* turn off interrupts */ - } - /* else if interface is UP and RUNNING, start it - */ - else if (ifp->if_flags & IFF_UP && (sc->flags & DSF_RUNNING) == 0) { - wlinit(sc); - } - - /* if WLDEBUG set on interface, then kprintf rf-modem regs - */ - if(ifp->if_flags & IFF_DEBUG) - wlmmcstat(sc); - break; -#if MULTICAST - case SIOCADDMULTI: - case SIOCDELMULTI: - -#if defined(__FreeBSD__) && __FreeBSD_version < 300000 - if (cmd == SIOCADDMULTI) { - error = ether_addmulti(ifr, &sc->wl_ac); - } - else { - error = ether_delmulti(ifr, &sc->wl_ac); - } - - /* see if we should be in all multicast mode - * note that 82586 cannot do that, must simulate with - * promiscuous mode - */ - if (check_allmulti(sc)) { - ifp->if_flags |= IFF_ALLMULTI; - sc->mode |= MOD_ENAL; - sc->flags &= ~DSF_RUNNING; - wlinit(sc); - error = 0; - break; - } - - if (error == ENETRESET) { - if(sc->flags & DSF_RUNNING) { - sc->flags &= ~DSF_RUNNING; - wlinit(sc); - } - error = 0; - } -#else - wlinit(sc); -#endif - break; -#endif /* MULTICAST */ - - /* DEVICE SPECIFIC */ - - - /* copy the PSA out to the caller */ - case SIOCGWLPSA: - /* pointer to buffer in user space */ - up = (void *)ifr->ifr_data; - /* work out if they're root */ - isroot = (priv_check(td, PRIV_ROOT) == 0); - - for (i = 0; i < 0x40; i++) { - /* don't hand the DES key out to non-root users */ - if ((i > WLPSA_DESKEY) && (i < (WLPSA_DESKEY + 8)) && !isroot) - continue; - if (subyte((up + i), sc->psa[i])) - return(EFAULT); - } - break; - - - /* copy the PSA in from the caller; we only copy _some_ values */ - case SIOCSWLPSA: - /* root only */ - if ((error = priv_check(td, PRIV_ROOT))) - break; - error = EINVAL; /* assume the worst */ - /* pointer to buffer in user space containing data */ - up = (void *)ifr->ifr_data; - - /* check validity of input range */ - for (i = 0; i < 0x40; i++) - if (fubyte(up + i) < 0) - return(EFAULT); - - /* check IRQ value */ - irqval = fubyte(up+WLPSA_IRQNO); - for (irq = 15; irq >= 0; irq--) - if(irqvals[irq] == irqval) - break; - if (irq == 0) /* oops */ - break; - /* new IRQ */ - sc->psa[WLPSA_IRQNO] = irqval; - - /* local MAC */ - for (i = 0; i < 6; i++) - sc->psa[WLPSA_LOCALMAC+i] = fubyte(up+WLPSA_LOCALMAC+i); - - /* MAC select */ - sc->psa[WLPSA_MACSEL] = fubyte(up+WLPSA_MACSEL); - - /* default nwid */ - sc->psa[WLPSA_NWID] = fubyte(up+WLPSA_NWID); - sc->psa[WLPSA_NWID+1] = fubyte(up+WLPSA_NWID+1); - - error = 0; - wlsetpsa(sc); /* update the PSA */ - break; - - - /* get the current NWID out of the sc since we stored it there */ - case SIOCGWLCNWID: - ifr->ifr_data = (caddr_t) (sc->nwid[0] << 8 | sc->nwid[1]); - break; - - - /* - * change the nwid dynamically. This - * ONLY changes the radio modem and does not - * change the PSA. - * - * 2 steps: - * 1. save in softc "soft registers" - * 2. save in radio modem (MMC) - */ - case SIOCSWLCNWID: - /* root only */ - if ((error = priv_check(td, PRIV_ROOT))) - break; - if (!(ifp->if_flags & IFF_UP)) { - error = EIO; /* only allowed while up */ - } else { - /* - * soft c nwid shadows radio modem setting - */ - sc->nwid[0] = (int)ifr->ifr_data >> 8; - sc->nwid[1] = (int)ifr->ifr_data & 0xff; - MMC_WRITE(MMC_NETW_ID_L,sc->nwid[1]); - MMC_WRITE(MMC_NETW_ID_H,sc->nwid[0]); - } - break; - - /* copy the EEPROM in 2.4 Gz WaveMODEM out to the caller */ - case SIOCGWLEEPROM: - /* root only */ - if ((error = priv_check(td, PRIV_ROOT))) - break; - /* pointer to buffer in user space */ - up = (void *)ifr->ifr_data; - - for (i=0x00; i<0x80; ++i) { /* 2.4 Gz: size of EEPROM */ - MMC_WRITE(MMC_EEADDR,i); /* 2.4 Gz: get frequency */ - MMC_WRITE(MMC_EECTRL, /* 2.4 Gz: EEPROM read */ - MMC_EECTRL_EEOP_READ); /* 2.4 Gz: */ - DELAY(40); /* 2.4 Gz */ - if (subyte(up + 2*i , /* 2.4 Gz: pass low byte of */ - wlmmcread(base,MMC_EEDATALrv)) /* 2.4 Gz: EEPROM word */ - ) return(EFAULT); /* 2.4 Gz: */ - if (subyte(up + 2*i+1, /* 2.4 Gz: pass hi byte of */ - wlmmcread(base,MMC_EEDATALrv)) /* 2.4 Gz: EEPROM word */ - ) return(EFAULT); /* 2.4 Gz: */ - } - break; - -#ifdef WLCACHE - /* zero (Delete) the wl cache */ - case SIOCDWLCACHE: - /* root only */ - if ((error = priv_check(td, PRIV_ROOT))) - break; - wl_cache_zero(sc); - break; - - /* read out the number of used cache elements */ - case SIOCGWLCITEM: - ifr->ifr_data = (caddr_t) sc->w_sigitems; - break; - - /* read out the wl cache */ - case SIOCGWLCACHE: - /* pointer to buffer in user space */ - up = (void *)ifr->ifr_data; - cpt = (char *) &sc->w_sigcache[0]; - size = sc->w_sigitems * sizeof(struct w_sigcache); - - for (i = 0; i < size; i++) { - if (subyte((up + i), *cpt++)) - return(EFAULT); - } - break; -#endif - - default: - error = ether_ioctl(ifp, cmd, data); - break; - } - return (error); -} - -/* - * wlwatchdog(): - * - * Called if the timer set in wlstart expires before an interrupt is received - * from the wavelan. It seems to lose interrupts sometimes. - * The watchdog routine gets called if the transmitter failed to interrupt - * - * input : which board is timing out - * output : board reset - * - */ -static void -wlwatchdog(void *vsc) -{ - struct wl_softc *sc = vsc; - struct ifnet *ifp = &sc->wl_if; - - lwkt_serialize_enter(ifp->if_serializer); - log(LOG_ERR, "%s: wavelan device timeout on xmit\n", sc->wl_if.if_xname); - sc->wl_if.if_oerrors++; - wlinit(sc); - lwkt_serialize_exit(ifp->if_serializer); -} - -/* - * wlintr: - * - * This function is the interrupt handler for the WaveLAN - * board. This routine will be called whenever either a packet - * is received, or a packet has successfully been transfered and - * the unit is ready to transmit another packet. - * - * input : softc pointer for this interface - * output : either a packet is received, or a packet is transfered - * - */ -static void -wlintr(void *arg) -{ - struct wl_softc *sc = arg; - struct ifnet *ifp = &sc->wl_if; - short base = sc->base; - int ac_status; - u_short int_type, int_type1; - -#ifdef WLDEBUG - if (ifp->if_flags & IFF_DEBUG) - if_printf(ifp, "wlintr() called\n"); -#endif - - if((int_type = inw(HASR(base))) & HASR_MMC_INTR) { - /* handle interrupt from the modem management controler */ - /* This will clear the interrupt condition */ - wlmmcread(base,MMC_DCE_STATUS); /* ignored for now */ - } - - if(!(int_type & HASR_INTR)){ /* return if no interrupt from 82586 */ - /* commented out. jrb. it happens when reinit occurs - if_printf(ifp, "%s: int_type %x, dump follows\n", - __func__, int_type); - wldump(sc); - */ - return; - } - - if (gathersnr) - getsnr(sc); - for(;;) { - outw(PIOR0(base), OFFSET_SCB + 0); /* get scb status */ - int_type = (inw(PIOP0(base)) & SCB_SW_INT); - if (int_type == 0) /* no interrupts left */ - break; - - int_type1 = wlack(sc); /* acknowledge interrupt(s) */ - /* make sure no bits disappeared (others may appear) */ - if ((int_type & int_type1) != int_type) { - if_printf(ifp, "wlack() int bits disappeared: " - "%04x != int_type %04x\n", int_type1, int_type); - } - int_type = int_type1; /* go with the new status */ - /* - * incoming packet - */ - if (int_type & SCB_SW_FR) { - ifp->if_ipackets++; - wlrcv(sc); - } - /* - * receiver not ready - */ - if (int_type & SCB_SW_RNR) { - ifp->if_ierrors++; -#ifdef WLDEBUG - if (ifp->if_flags & IFF_DEBUG) { - if_printf(ifp, "intr(): receiver overrun! begin_fd = %x\n", - sc->begin_fd); - } -#endif - wlrustrt(sc); - } - /* - * CU not ready - */ - if (int_type & SCB_SW_CNA) { - /* - * At present, we don't care about CNA's. We - * believe they are a side effect of XMT. - */ - } - if (int_type & SCB_SW_CX) { - /* - * At present, we only request Interrupt for - * XMT. - */ - outw(PIOR1(base), OFFSET_CU); /* get command status */ - ac_status = inw(PIOP1(base)); - - if (xmt_watch) { /* report some anomalies */ - - if (sc->tbusy == 0) { - if_printf(ifp, "xmt intr but not busy, CU %04x\n", - ac_status); - } - if (ac_status == 0) { - if_printf(ifp, "xmt intr but ac_status == 0\n"); - } - if (ac_status & AC_SW_A) { - if_printf(ifp, "xmt aborted\n"); - } -#ifdef notdef - if (ac_status & TC_CARRIER) { - if_printf(ifp, "no carrier\n"); - } -#endif /* notdef */ - if (ac_status & TC_CLS) { - if_printf(ifp, "no CTS\n"); - } - if (ac_status & TC_DMA) { - if_printf(ifp, "DMA underrun\n"); - } - if (ac_status & TC_DEFER) { - if_printf(ifp, "xmt deferred\n"); - } - if (ac_status & TC_SQE) { - if_printf(ifp, "heart beat\n"); - } - if (ac_status & TC_COLLISION) { - if_printf(ifp, "too many collisions\n"); - } - } - /* if the transmit actually failed, or returned some status */ - if ((!(ac_status & AC_SW_OK)) || (ac_status & 0xfff)) { - if (ac_status & (TC_COLLISION | TC_CLS | TC_DMA)) { - ifp->if_oerrors++; - } - - /* count collisions */ - ifp->if_collisions += (ac_status & 0xf); - /* if TC_COLLISION set and collision count zero, 16 collisions */ - if ((ac_status & 0x20) == 0x20) { - ifp->if_collisions += 0x10; - } - } - sc->tbusy = 0; - callout_stop(&sc->watchdog_ch); - ifp->if_flags &= ~IFF_OACTIVE; - if_devstart(ifp); - } - } -} - -/* - * wlrcv: - * - * This routine is called by the interrupt handler to initiate a - * packet transfer from the board to the "if" layer above this - * driver. This routine checks if a buffer has been successfully - * received by the WaveLAN. If so, the routine wlread is called - * to do the actual transfer of the board data (including the - * ethernet header) into a packet (consisting of an mbuf chain). - * - * input : softc pointer for this interface - * output : if a packet is available, it is "sent up" - * - */ -static void -wlrcv(struct wl_softc *sc) -{ - short base = sc->base; - u_short fd_p, status, offset, link_offset; - -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if_printf(&sc->wl_if, "entered wlrcv()\n"); -#endif - for (fd_p = sc->begin_fd; fd_p != I82586NULL; fd_p = sc->begin_fd) { - - outw(PIOR0(base), fd_p + 0); /* address of status */ - status = inw(PIOP0(base)); - outw(PIOR1(base), fd_p + 4); /* address of link_offset */ - link_offset = inw(PIOP1(base)); - offset = inw(PIOP1(base)); /* rbd_offset */ - if (status == 0xffff || offset == 0xffff /*I82586NULL*/) { - if (wlhwrst(sc) != TRUE) - if_printf(&sc->wl_if, "rcv(): hwrst ffff trouble.\n"); - return; - } else if (status & AC_SW_C) { - if (status == (RFD_DONE|RFD_RSC)) { - /* lost one */ -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if_printf(&sc->wl_if, "RCV: RSC %x\n", status); -#endif - sc->wl_if.if_ierrors++; - } else if (!(status & RFD_OK)) { - if_printf(&sc->wl_if, "RCV: !OK %x\n", status); - sc->wl_if.if_ierrors++; - } else if (status & 0xfff) { /* can't happen */ - if_printf(&sc->wl_if, "RCV: ERRs %x\n", status); - sc->wl_if.if_ierrors++; - } else if (!wlread(sc, fd_p)) - return; - - if (!wlrequeue(sc, fd_p)) { - /* abort on chain error */ - if (wlhwrst(sc) != TRUE) - if_printf(&sc->wl_if, "rcv(): hwrst trouble.\n"); - return; - } - sc->begin_fd = link_offset; - } else { - break; - } - } -} - -/* - * wlrequeue: - * - * This routine puts rbd's used in the last receive back onto the - * free list for the next receive. - * - */ -static int -wlrequeue(struct wl_softc *sc, u_short fd_p) -{ - short base = sc->base; - fd_t fd; - u_short l_rbdp, f_rbdp, rbd_offset; - - outw(PIOR0(base), fd_p + 6); - rbd_offset = inw(PIOP0(base)); - if ((f_rbdp = rbd_offset) != I82586NULL) { - l_rbdp = f_rbdp; - for(;;) { - outw(PIOR0(base), l_rbdp + 0); /* address of status */ - if(inw(PIOP0(base)) & RBD_SW_EOF) - break; - outw(PIOP0(base), 0); - outw(PIOR0(base), l_rbdp + 2); /* next_rbd_offset */ - if((l_rbdp = inw(PIOP0(base))) == I82586NULL) - break; - } - outw(PIOP0(base), 0); - outw(PIOR0(base), l_rbdp + 2); /* next_rbd_offset */ - outw(PIOP0(base), I82586NULL); - outw(PIOR0(base), l_rbdp + 8); /* address of size */ - outw(PIOP0(base), inw(PIOP0(base)) | AC_CW_EL); - outw(PIOR0(base), sc->end_rbd + 2); - outw(PIOP0(base), f_rbdp); /* end_rbd->next_rbd_offset */ - outw(PIOR0(base), sc->end_rbd + 8); /* size */ - outw(PIOP0(base), inw(PIOP0(base)) & ~AC_CW_EL); - sc->end_rbd = l_rbdp; - } - - fd.status = 0; - fd.command = AC_CW_EL; - fd.link_offset = I82586NULL; - fd.rbd_offset = I82586NULL; - outw(PIOR1(base), fd_p); - outsw(PIOP1(base), &fd, 8/2); - - outw(PIOR1(base), sc->end_fd + 2); /* addr of command */ - outw(PIOP1(base), 0); /* command = 0 */ - outw(PIOP1(base), fd_p); /* end_fd->link_offset = fd_p */ - sc->end_fd = fd_p; - - return 1; -} - -#ifdef WLDEBUG -static int xmt_debug = 0; -#endif /* WLDEBUG */ - -/* - * wlxmt: - * - * This routine fills in the appropriate registers and memory - * locations on the WaveLAN board and starts the board off on - * the transmit. - * - * input : softc pointer for this interface, and a pointer to the mbuf - * output : board memory and registers are set for xfer and attention - * - */ -static void -wlxmt(struct wl_softc *sc, struct mbuf *m) -{ - u_short xmtdata_p = OFFSET_TBUF; - struct mbuf *tm_p = m; - struct ether_header *eh_p = mtod(m, struct ether_header *); - u_char *mb_p = mtod(m, u_char *) + sizeof(struct ether_header); - u_short count = m->m_len - sizeof(struct ether_header); - ac_t cb; - u_short tbd_p = OFFSET_TBD; - u_short len, clen = 0; - short base = sc->base; - int spin; - -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if_printf(&sc->wl_if, "entered wlxmt()\n"); -#endif - - cb.ac_status = 0; - cb.ac_command = (AC_CW_EL|AC_TRANSMIT|AC_CW_I); - cb.ac_link_offset = I82586NULL; - outw(PIOR1(base), OFFSET_CU); - outsw(PIOP1(base), &cb, 6/2); - outw(PIOP1(base), OFFSET_TBD); /* cb.cmd.transmit.tbd_offset */ - outsw(PIOP1(base), eh_p->ether_dhost, WAVELAN_ADDR_SIZE/2); - outw(PIOP1(base), eh_p->ether_type); - -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) { - if (xmt_debug) { - if_printf(&sc->wl_if, "XMT mbuf: L%d @%p ", count, (void *)mb_p); - kprintf("ether type %x\n", eh_p->ether_type); - } - } -#endif /* WLDEBUG */ - outw(PIOR0(base), OFFSET_TBD); - outw(PIOP0(base), 0); /* act_count */ - outw(PIOR1(base), OFFSET_TBD + 4); - outw(PIOP1(base), xmtdata_p); /* buffer_addr */ - outw(PIOP1(base), 0); /* buffer_base */ - for (;;) { - if (count) { - if (clen + count > WAVELAN_MTU) - break; - if (count & 1) - len = count + 1; - else - len = count; - outw(PIOR1(base), xmtdata_p); - outsw(PIOP1(base), mb_p, len/2); - clen += count; - outw(PIOR0(base), tbd_p); /* address of act_count */ - outw(PIOP0(base), inw(PIOP0(base)) + count); - xmtdata_p += len; - if ((tm_p = tm_p->m_next) == NULL) - break; - if (count & 1) { - /* go to the next descriptor */ - outw(PIOR0(base), tbd_p + 2); - tbd_p += sizeof (tbd_t); - outw(PIOP0(base), tbd_p); /* next_tbd_offset */ - outw(PIOR0(base), tbd_p); - outw(PIOP0(base), 0); /* act_count */ - outw(PIOR1(base), tbd_p + 4); - outw(PIOP1(base), xmtdata_p); /* buffer_addr */ - outw(PIOP1(base), 0); /* buffer_base */ - /* at the end -> coallesce remaining mbufs */ - if (tbd_p == OFFSET_TBD + (N_TBD-1) * sizeof (tbd_t)) { - wlsftwsleaze(&count, &mb_p, &tm_p); - continue; - } - /* next mbuf short -> coallesce as needed */ - if ( (tm_p->m_next == NULL) || -#define HDW_THRESHOLD 55 - tm_p->m_len > HDW_THRESHOLD) - /* ok */; - else { - wlhdwsleaze(&count, &mb_p, &tm_p); - continue; - } - } - } else if ((tm_p = tm_p->m_next) == NULL) - break; - count = tm_p->m_len; - mb_p = mtod(tm_p, u_char *); -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if (xmt_debug) - if_printf(&sc->wl_if, "mbuf+ L%d @%p ", count, (void *)mb_p); -#endif /* WLDEBUG */ - } -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if (xmt_debug) - if_printf(&sc->wl_if, "CLEN = %d\n", clen); -#endif /* WLDEBUG */ - outw(PIOR0(base), tbd_p); - if (clen < ETHERMIN) { - outw(PIOP0(base), inw(PIOP0(base)) + ETHERMIN - clen); - outw(PIOR1(base), xmtdata_p); - while (clen < ETHERMIN) { - outw(PIOP1(base), 0); - clen += 2; - } - } - outw(PIOP0(base), inw(PIOP0(base)) | TBD_SW_EOF); - outw(PIOR0(base), tbd_p + 2); - outw(PIOP0(base), I82586NULL); -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) { - if (xmt_debug) { - wltbd(sc); - kprintf("\n"); - } - } -#endif /* WLDEBUG */ - - outw(PIOR0(base), OFFSET_SCB + 2); /* address of scb_command */ - /* - * wait for 586 to clear previous command, complain if it takes - * too long - */ - for (spin = 1;;spin = (spin + 1) % 10000) { - if (inw(PIOP0(base)) == 0) { /* it's done, we can go */ - break; - } - if ((spin == 0) && xmt_watch) { /* not waking up, and we care */ - if_printf(&sc->wl_if, "slow accepting xmit\n"); - } - } - outw(PIOP0(base), SCB_CU_STRT); /* new command */ - SET_CHAN_ATTN(sc); - - m_freem(m); - - /* XXX - * Pause to avoid transmit overrun problems. - * The required delay tends to vary with platform type, and may be - * related to interrupt loss. - */ - if (wl_xmit_delay) { - DELAY(wl_xmit_delay); - } -} - -/* - * wlbldru: - * - * This function builds the linear linked lists of fd's and - * rbd's. Based on page 4-32 of 1986 Intel microcom handbook. - * - */ -static u_short -wlbldru(struct wl_softc *sc) -{ - short base = sc->base; - fd_t fd; - rbd_t rbd; - u_short fd_p = OFFSET_RU; - u_short rbd_p = OFFSET_RBD; - int i; - - sc->begin_fd = fd_p; - for(i = 0; i < N_FD; i++) { - fd.status = 0; - fd.command = 0; - fd.link_offset = fd_p + sizeof(fd_t); - fd.rbd_offset = I82586NULL; - outw(PIOR1(base), fd_p); - outsw(PIOP1(base), &fd, 8/2); - fd_p = fd.link_offset; - } - fd_p -= sizeof(fd_t); - sc->end_fd = fd_p; - outw(PIOR1(base), fd_p + 2); - outw(PIOP1(base), AC_CW_EL); /* command */ - outw(PIOP1(base), I82586NULL); /* link_offset */ - fd_p = OFFSET_RU; - - outw(PIOR0(base), fd_p + 6); /* address of rbd_offset */ - outw(PIOP0(base), rbd_p); - outw(PIOR1(base), rbd_p); - for(i = 0; i < N_RBD; i++) { - rbd.status = 0; - rbd.buffer_addr = rbd_p + sizeof(rbd_t) + 2; - rbd.buffer_base = 0; - rbd.size = RCVBUFSIZE; - if (i != N_RBD-1) { - rbd_p += sizeof(ru_t); - rbd.next_rbd_offset = rbd_p; - } else { - rbd.next_rbd_offset = I82586NULL; - rbd.size |= AC_CW_EL; - sc->end_rbd = rbd_p; - } - outsw(PIOP1(base), &rbd, sizeof(rbd_t)/2); - outw(PIOR1(base), rbd_p); - } - return sc->begin_fd; -} - -/* - * wlrustrt: - * - * This routine starts the receive unit running. First checks if the - * board is actually ready, then the board is instructed to receive - * packets again. - * - */ -static void -wlrustrt(struct wl_softc *sc) -{ - short base = sc->base; - u_short rfa; - -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if_printf(&sc->wl_if, "entered wlrustrt()\n"); -#endif - outw(PIOR0(base), OFFSET_SCB); - if (inw(PIOP0(base)) & SCB_RUS_READY){ - if_printf(&sc->wl_if, "wlrustrt: RUS_READY\n"); - return; - } - - outw(PIOR0(base), OFFSET_SCB + 2); - outw(PIOP0(base), SCB_RU_STRT); /* command */ - rfa = wlbldru(sc); - outw(PIOR0(base), OFFSET_SCB + 6); /* address of scb_rfa_offset */ - outw(PIOP0(base), rfa); - - SET_CHAN_ATTN(sc); -} - -/* - * wldiag: - * - * This routine does a 586 op-code number 7, and obtains the - * diagnose status for the WaveLAN. - * - */ -static int -wldiag(struct wl_softc *sc) -{ - short base = sc->base; - short status; - -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if_printf(&sc->wl_if, "entered wldiag()\n"); -#endif - outw(PIOR0(base), OFFSET_SCB); - status = inw(PIOP0(base)); - if (status & SCB_SW_INT) { - /* state is 2000 which seems ok - if_printf(&sc->wl_if, "diag(): unexpected initial state %\n", - inw(PIOP0(base))); - */ - wlack(sc); - } - outw(PIOR1(base), OFFSET_CU); - outw(PIOP1(base), 0); /* ac_status */ - outw(PIOP1(base), AC_DIAGNOSE|AC_CW_EL);/* ac_command */ - if(wlcmd(sc, "diag()") == 0) - return 0; - outw(PIOR0(base), OFFSET_CU); - if (inw(PIOP0(base)) & 0x0800) { - if_printf(&sc->wl_if, "i82586 Self Test failed!\n"); - return 0; - } - return TRUE; -} - -/* - * wlconfig: - * - * This routine does a standard config of the WaveLAN board. - * - */ -static int -wlconfig(struct wl_softc *sc) -{ - configure_t configure; - short base = sc->base; - -#if MULTICAST -#if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD_version >= 300000) - struct ifmultiaddr *ifma; - u_char *addrp; -#else - struct ether_multi *enm; - struct ether_multistep step; -#endif - int cnt = 0; -#endif /* MULTICAST */ - -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if_printf(&sc->wl_if, "entered wlconfig()\n"); -#endif - outw(PIOR0(base), OFFSET_SCB); - if (inw(PIOP0(base)) & SCB_SW_INT) { - /* - if_printf(&sc->wl_if, "config(): unexpected initial state %x\n", - inw(PIOP0(base))); - */ - } - wlack(sc); - - outw(PIOR1(base), OFFSET_CU); - outw(PIOP1(base), 0); /* ac_status */ - outw(PIOP1(base), AC_CONFIGURE|AC_CW_EL); /* ac_command */ - -/* jrb hack */ - configure.fifolim_bytecnt = 0x080c; - configure.addrlen_mode = 0x0600; - configure.linprio_interframe = 0x2060; - configure.slot_time = 0xf200; - configure.hardware = 0x0008; /* tx even w/o CD */ - configure.min_frame_len = 0x0040; -#if 0 - /* This is the configuration block suggested by Marc Meertens - * in an e-mail message to John - * Ioannidis on 10 Nov 92. - */ - configure.fifolim_bytecnt = 0x040c; - configure.addrlen_mode = 0x0600; - configure.linprio_interframe = 0x2060; - configure.slot_time = 0xf000; - configure.hardware = 0x0008; /* tx even w/o CD */ - configure.min_frame_len = 0x0040; -#else - /* - * below is the default board configuration from p2-28 from 586 book - */ - configure.fifolim_bytecnt = 0x080c; - configure.addrlen_mode = 0x2600; - configure.linprio_interframe = 0x7820; /* IFS=120, ACS=2 */ - configure.slot_time = 0xf00c; /* slottime=12 */ - configure.hardware = 0x0008; /* tx even w/o CD */ - configure.min_frame_len = 0x0040; -#endif - if(sc->mode & (MOD_PROM | MOD_ENAL)) { - configure.hardware |= 1; - } - outw(PIOR1(base), OFFSET_CU + 6); - outsw(PIOP1(base), &configure, sizeof(configure_t)/2); - - if(wlcmd(sc, "config()-configure") == 0) - return 0; -#if MULTICAST - outw(PIOR1(base), OFFSET_CU); - outw(PIOP1(base), 0); /* ac_status */ - outw(PIOP1(base), AC_MCSETUP|AC_CW_EL); /* ac_command */ - outw(PIOR1(base), OFFSET_CU + 8); -#if defined(__DragonFly__) || (defined(__FreeBSD__) && __FreeBSD_version >= 300000) - TAILQ_FOREACH(ifma, &sc->wl_if.if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - - addrp = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); - outw(PIOP1(base), addrp[0] + (addrp[1] << 8)); - outw(PIOP1(base), addrp[2] + (addrp[3] << 8)); - outw(PIOP1(base), addrp[4] + (addrp[5] << 8)); - ++cnt; - } -#else - ETHER_FIRST_MULTI(step, &sc->wl_ac, enm); - while (enm != NULL) { - unsigned int lo, hi; - /* break if setting a multicast range, else we would crash */ - if (bcmp(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) { - break; - } - lo = (enm->enm_addrlo[3] << 16) + (enm->enm_addrlo[4] << 8) - + enm->enm_addrlo[5]; - hi = (enm->enm_addrhi[3] << 16) + (enm->enm_addrhi[4] << 8) - + enm->enm_addrhi[5]; - while(lo <= hi) { - outw(PIOP1(base),enm->enm_addrlo[0] + - (enm->enm_addrlo[1] << 8)); - outw(PIOP1(base),enm->enm_addrlo[2] + - ((lo >> 8) & 0xff00)); - outw(PIOP1(base), ((lo >> 8) & 0xff) + - ((lo << 8) & 0xff00)); -/* #define MCASTDEBUG */ -#ifdef MCASTDEBUG -kprintf("mcast_addr[%d,%d,%d] %x %x %x %x %x %x\n", lo, hi, cnt, - enm->enm_addrlo[0], - enm->enm_addrlo[1], - enm->enm_addrlo[2], - enm->enm_addrlo[3], - enm->enm_addrlo[4], - enm->enm_addrlo[5]); -#endif - ++cnt; - ++lo; - } - ETHER_NEXT_MULTI(step, enm); - } -#endif - outw(PIOR1(base), OFFSET_CU + 6); /* mc-cnt */ - outw(PIOP1(base), cnt * WAVELAN_ADDR_SIZE); - if(wlcmd(sc, "config()-mcaddress") == 0) - return 0; -#endif /* MULTICAST */ - - outw(PIOR1(base), OFFSET_CU); - outw(PIOP1(base), 0); /* ac_status */ - outw(PIOP1(base), AC_IASETUP|AC_CW_EL); /* ac_command */ - outw(PIOR1(base), OFFSET_CU + 6); - outsw(PIOP1(base), sc->wl_addr, WAVELAN_ADDR_SIZE/2); - - if(wlcmd(sc, "config()-address") == 0) - return(0); - - wlinitmmc(sc); - - return(1); -} - -/* - * wlcmd: - * - * Set channel attention bit and busy wait until command has - * completed. Then acknowledge the command completion. - */ -static int -wlcmd(struct wl_softc *sc, const char *str) -{ - short base = sc->base; - int i; - - outw(PIOR0(base), OFFSET_SCB + 2); /* address of scb_command */ - outw(PIOP0(base), SCB_CU_STRT); - - SET_CHAN_ATTN(sc); - - outw(PIOR0(base), OFFSET_CU); - for(i = 0; i < 0xffff; i++) - if (inw(PIOP0(base)) & AC_SW_C) - break; - if (i == 0xffff || !(inw(PIOP0(base)) & AC_SW_OK)) { - if_printf(&sc->wl_if, "%s failed; status = %d, inw = %x, outw = %x\n", - str, inw(PIOP0(base)) & AC_SW_OK, inw(PIOP0(base)), - inw(PIOR0(base))); - outw(PIOR0(base), OFFSET_SCB); - kprintf("scb_status %x\n", inw(PIOP0(base))); - outw(PIOR0(base), OFFSET_SCB+2); - kprintf("scb_command %x\n", inw(PIOP0(base))); - outw(PIOR0(base), OFFSET_SCB+4); - kprintf("scb_cbl %x\n", inw(PIOP0(base))); - outw(PIOR0(base), OFFSET_CU+2); - kprintf("cu_cmd %x\n", inw(PIOP0(base))); - return(0); - } - - outw(PIOR0(base), OFFSET_SCB); - if ((inw(PIOP0(base)) & SCB_SW_INT) && (inw(PIOP0(base)) != SCB_SW_CNA)) { - /* - if_printf(&sc->wl_if, "%s: unexpected final state %x\n", - str, inw(PIOP0(base))); - */ - } - wlack(sc); - return(TRUE); -} - -/* - * wlack: if the 82596 wants attention because it has finished - * sending or receiving a packet, acknowledge its desire and - * return bits indicating the kind of attention. wlack() returns - * these bits so that the caller can service exactly the - * conditions that wlack() acknowledged. - */ -static int -wlack(struct wl_softc *sc) -{ - int i; - u_short cmd; - short base = sc->base; - - outw(PIOR1(base), OFFSET_SCB); - if(!(cmd = (inw(PIOP1(base)) & SCB_SW_INT))) - return(0); -#ifdef WLDEBUG - if (sc->wl_if.if_flags & IFF_DEBUG) - if_printf(&sc->wl_if, "doing a wlack()\n"); -#endif - outw(PIOP1(base), cmd); - SET_CHAN_ATTN(sc); - outw(PIOR0(base), OFFSET_SCB + 2); /* address of scb_command */ - for (i = 1000000; inw(PIOP0(base)) && (i-- > 0); ); - if (i < 1) - if_printf(&sc->wl_if, "wlack(): board not accepting command.\n"); - return(cmd); -} - -static void -wltbd(struct wl_softc *sc) -{ - short base = sc->base; - u_short tbd_p = OFFSET_TBD; - tbd_t tbd; - int i = 0; - int sum = 0; - - for (;;) { - outw(PIOR1(base), tbd_p); - insw(PIOP1(base), &tbd, sizeof(tbd_t)/2); - sum += (tbd.act_count & ~TBD_SW_EOF); - kprintf("%d: addr %x, count %d (%d), next %x, base %x\n", - i++, tbd.buffer_addr, - (tbd.act_count & ~TBD_SW_EOF), sum, - tbd.next_tbd_offset, tbd.buffer_base); - if (tbd.act_count & TBD_SW_EOF) - break; - tbd_p = tbd.next_tbd_offset; - } -} - -static void -wlhdwsleaze(u_short *countp, u_char **mb_pp, struct mbuf **tm_pp) -{ - struct mbuf *tm_p = *tm_pp; - u_char *mb_p; - u_short count = 0; - u_char *cp; - int len; - - /* - * can we get a run that will be coallesced or - * that terminates before breaking - */ - do { - count += tm_p->m_len; - if (tm_p->m_len & 1) - break; - } while ((tm_p = tm_p->m_next) != NULL); - if ( (tm_p == NULL) || - count > HDW_THRESHOLD) { - *countp = (*tm_pp)->m_len; - *mb_pp = mtod((*tm_pp), u_char *); - return; - } - - /* we need to copy */ - tm_p = *tm_pp; - mb_p = *mb_pp; - count = 0; - cp = (u_char *) t_packet; - for (;;) { - bcopy(mtod(tm_p, u_char *), cp, len = tm_p->m_len); - count += len; - if (count > HDW_THRESHOLD) - break; - cp += len; - if (tm_p->m_next == NULL) - break; - tm_p = tm_p->m_next; - } - *countp = count; - *mb_pp = (u_char *) t_packet; - *tm_pp = tm_p; -} - -static void -wlsftwsleaze(u_short *countp, u_char **mb_pp, struct mbuf **tm_pp) -{ - struct mbuf *tm_p = *tm_pp; - u_short count = 0; - u_char *cp = (u_char *) t_packet; - int len; - - /* we need to copy */ - for (;;) { - bcopy(mtod(tm_p, u_char *), cp, len = tm_p->m_len); - count += len; - cp += len; - if (tm_p->m_next == NULL) - break; - tm_p = tm_p->m_next; - } - - *countp = count; - *mb_pp = (u_char *) t_packet; - *tm_pp = tm_p; -} - -static void -wlmmcstat(struct wl_softc *sc) -{ - short base = sc->base; - u_short tmp; - - if_printf(&sc->wl_if, "DCE_STATUS: 0x%x, ", - wlmmcread(base,MMC_DCE_STATUS) & 0x0f); - tmp = wlmmcread(base,MMC_CORRECT_NWID_H) << 8; - tmp |= wlmmcread(base,MMC_CORRECT_NWID_L); - kprintf("Correct NWID's: %d, ", tmp); - tmp = wlmmcread(base,MMC_WRONG_NWID_H) << 8; - tmp |= wlmmcread(base,MMC_WRONG_NWID_L); - kprintf("Wrong NWID's: %d\n", tmp); - kprintf("THR_PRE_SET: 0x%x, ", wlmmcread(base,MMC_THR_PRE_SET)); - kprintf("SIGNAL_LVL: %d, SILENCE_LVL: %d\n", - wlmmcread(base,MMC_SIGNAL_LVL), - wlmmcread(base,MMC_SILENCE_LVL)); - kprintf("SIGN_QUAL: 0x%x, NETW_ID: %x:%x, DES: %d\n", - wlmmcread(base,MMC_SIGN_QUAL), - wlmmcread(base,MMC_NETW_ID_H), - wlmmcread(base,MMC_NETW_ID_L), - wlmmcread(base,MMC_DES_AVAIL)); -} - -static u_short -wlmmcread(u_int base, u_short reg) -{ - while(inw(HASR(base)) & HASR_MMC_BUSY) ; - outw(MMCR(base),reg << 1); - while(inw(HASR(base)) & HASR_MMC_BUSY) ; - return (u_short)inw(MMCR(base)) >> 8; -} - -static void -getsnr(struct wl_softc *sc) -{ - MMC_WRITE(MMC_FREEZE,1); - /* - * SNR retrieval procedure : - * - * read signal level : wlmmcread(base, MMC_SIGNAL_LVL); - * read silence level : wlmmcread(base, MMC_SILENCE_LVL); - */ - MMC_WRITE(MMC_FREEZE,0); - /* - * SNR is signal:silence ratio. - */ -} - -/* -** wlgetpsa -** -** Reads the psa for the wavelan at (base) into (buf) -*/ -static void -wlgetpsa(int base, u_char *buf) -{ - int i; - - PCMD(base, HACR_DEFAULT & ~HACR_16BITS); - PCMD(base, HACR_DEFAULT & ~HACR_16BITS); - - for (i = 0; i < 0x40; i++) { - outw(PIOR2(base), i); - buf[i] = inb(PIOP2(base)); - } - PCMD(base, HACR_DEFAULT); - PCMD(base, HACR_DEFAULT); -} - -/* -** wlsetpsa -** -** Writes the psa for wavelan (unit) from the softc back to the -** board. Updates the CRC and sets the CRC OK flag. -** -** Do not call this when the board is operating, as it doesn't -** preserve the hacr. -*/ -static void -wlsetpsa(struct wl_softc *sc) -{ - short base = sc->base; - int i; - u_short crc; - - crc = wlpsacrc(sc->psa); /* calculate CRC of PSA */ - sc->psa[WLPSA_CRCLOW] = crc & 0xff; - sc->psa[WLPSA_CRCHIGH] = (crc >> 8) & 0xff; - sc->psa[WLPSA_CRCOK] = 0x55; /* default to 'bad' until programming complete */ - - PCMD(base, HACR_DEFAULT & ~HACR_16BITS); - PCMD(base, HACR_DEFAULT & ~HACR_16BITS); - - for (i = 0; i < 0x40; i++) { - DELAY(DELAYCONST); - outw(PIOR2(base),i); /* write param memory */ - DELAY(DELAYCONST); - outb(PIOP2(base), sc->psa[i]); - } - DELAY(DELAYCONST); - outw(PIOR2(base),WLPSA_CRCOK); /* update CRC flag*/ - DELAY(DELAYCONST); - sc->psa[WLPSA_CRCOK] = 0xaa; /* OK now */ - outb(PIOP2(base), 0xaa); /* all OK */ - DELAY(DELAYCONST); - - PCMD(base, HACR_DEFAULT); - PCMD(base, HACR_DEFAULT); -} - -/* -** CRC routine provided by Christopher Giordano , -** from original code by Tomi Mikkonen (tomitm@remedy.fi) -*/ - -static u_int crc16_table[16] = { - 0x0000, 0xCC01, 0xD801, 0x1400, - 0xF001, 0x3C00, 0x2800, 0xE401, - 0xA001, 0x6C00, 0x7800, 0xB401, - 0x5000, 0x9C01, 0x8801, 0x4400 -}; - -static u_short -wlpsacrc(u_char *buf) -{ - u_short crc = 0; - int i, r1; - - for (i = 0; i < 0x3d; i++, buf++) { - /* lower 4 bits */ - r1 = crc16_table[crc & 0xF]; - crc = (crc >> 4) & 0x0FFF; - crc = crc ^ r1 ^ crc16_table[*buf & 0xF]; - - /* upper 4 bits */ - r1 = crc16_table[crc & 0xF]; - crc = (crc >> 4) & 0x0FFF; - crc = crc ^ r1 ^ crc16_table[(*buf >> 4) & 0xF]; - } - return(crc); -} -#ifdef WLCACHE - -/* - * wl_cache_store - * - * take input packet and cache various radio hw characteristics - * indexed by MAC address. - * - * Some things to think about: - * note that no space is malloced. - * We might hash the mac address if the cache were bigger. - * It is not clear that the cache is big enough. - * It is also not clear how big it should be. - * The cache is IP-specific. We don't care about that as - * we want it to be IP-specific. - * The last N recv. packets are saved. This will tend - * to reward agents and mobile hosts that beacon. - * That is probably fine for mobile ip. - */ - -/* globals for wavelan signal strength cache */ -/* this should go into softc structure above. -*/ - -/* set true if you want to limit cache items to broadcast/mcast - * only packets (not unicast) - */ -static int wl_cache_mcastonly = 1; -SYSCTL_INT(_machdep, OID_AUTO, wl_cache_mcastonly, CTLFLAG_RW, - &wl_cache_mcastonly, 0, ""); - -/* set true if you want to limit cache items to IP packets only -*/ -static int wl_cache_iponly = 1; -SYSCTL_INT(_machdep, OID_AUTO, wl_cache_iponly, CTLFLAG_RW, - &wl_cache_iponly, 0, ""); - -/* zero out the cache -*/ -static void -wl_cache_zero(struct wl_softc *sc) -{ - bzero(&sc->w_sigcache[0], sizeof(struct w_sigcache) * MAXCACHEITEMS); - sc->w_sigitems = 0; - sc->w_nextcache = 0; - sc->w_wrapindex = 0; -} - -/* store hw signal info in cache. - * index is MAC address, but an ip src gets stored too - * There are two filters here controllable via sysctl: - * throw out unicast (on by default, but can be turned off) - * throw out non-ip (on by default, but can be turned off) - */ -static void -wl_cache_store(struct wl_softc *sc, int base, struct ether_header *eh, - struct mbuf *m) -{ - struct ip *ip = NULL; /* Avoid GCC warning */ - int i; - int signal, silence; - int w_insertcache; /* computed index for cache entry storage */ - int ipflag = wl_cache_iponly; - - /* filters: - * 1. ip only - * 2. configurable filter to throw out unicast packets, - * keep multicast only. - */ - -#ifdef INET - /* reject if not IP packet - */ - if ( wl_cache_iponly && (ntohs(eh->ether_type) != 0x800)) { - return; - } - - /* check if broadcast or multicast packet. we toss - * unicast packets - */ - if (wl_cache_mcastonly && ((eh->ether_dhost[0] & 1) == 0)) { - return; - } - - /* find the ip header. we want to store the ip_src - * address. use the mtod macro(in mbuf.h) - * to typecast m to struct ip * - */ - if (ipflag) { - ip = mtod(m, struct ip *); - } - - /* do a linear search for a matching MAC address - * in the cache table - * . MAC address is 6 bytes, - * . var w_nextcache holds total number of entries already cached - */ - for(i = 0; i < sc->w_nextcache; i++) { - if (! bcmp(eh->ether_shost, sc->w_sigcache[i].macsrc, 6 )) { - /* Match!, - * so we already have this entry, - * update the data, and LRU age - */ - break; - } - } - - /* did we find a matching mac address? - * if yes, then overwrite a previously existing cache entry - */ - if (i < sc->w_nextcache ) { - w_insertcache = i; - } - /* else, have a new address entry,so - * add this new entry, - * if table full, then we need to replace entry - */ - else { - - /* check for space in cache table - * note: w_nextcache also holds number of entries - * added in the cache table - */ - if ( sc->w_nextcache < MAXCACHEITEMS ) { - w_insertcache = sc->w_nextcache; - sc->w_nextcache++; - sc->w_sigitems = sc->w_nextcache; - } - /* no space found, so simply wrap with wrap index - * and "zap" the next entry - */ - else { - if (sc->w_wrapindex == MAXCACHEITEMS) { - sc->w_wrapindex = 0; - } - w_insertcache = sc->w_wrapindex++; - } - } - - /* invariant: w_insertcache now points at some slot - * in cache. - */ - if (w_insertcache < 0 || w_insertcache >= MAXCACHEITEMS) { - log(LOG_ERR, - "wl_cache_store, bad index: %d of [0..%d], gross cache error\n", - w_insertcache, MAXCACHEITEMS); - return; - } - - /* store items in cache - * .ipsrc - * .macsrc - * .signal (0..63) ,silence (0..63) ,quality (0..15) - */ - if (ipflag) { - sc->w_sigcache[w_insertcache].ipsrc = ip->ip_src.s_addr; - } - bcopy( eh->ether_shost, sc->w_sigcache[w_insertcache].macsrc, 6); - signal = sc->w_sigcache[w_insertcache].signal = wlmmcread(base, MMC_SIGNAL_LVL) & 0x3f; - silence = sc->w_sigcache[w_insertcache].silence = wlmmcread(base, MMC_SILENCE_LVL) & 0x3f; - sc->w_sigcache[w_insertcache].quality = wlmmcread(base, MMC_SIGN_QUAL) & 0x0f; - if (signal > 0) - sc->w_sigcache[w_insertcache].snr = - signal - silence; - else - sc->w_sigcache[w_insertcache].snr = 0; -#endif /* INET */ - -} -#endif /* WLCACHE */ - -/* - * determine if in all multicast mode or not - * - * returns: 1 if IFF_ALLMULTI should be set - * else 0 - */ -#ifdef MULTICAST - -#if defined(__FreeBSD__) && __FreeBSD_version < 300000 /* not required */ -static int -check_allmulti(struct wl_softc *sc) -{ - short base = sc->base; - struct ether_multi *enm; - struct ether_multistep step; - - ETHER_FIRST_MULTI(step, &sc->wl_ac, enm); - while (enm != NULL) { - unsigned int lo, hi; -#ifdef MDEBUG - kprintf("enm_addrlo %x:%x:%x:%x:%x:%x\n", enm->enm_addrlo[0], enm->enm_addrlo[1], - enm->enm_addrlo[2], enm->enm_addrlo[3], enm->enm_addrlo[4], - enm->enm_addrlo[5]); - kprintf("enm_addrhi %x:%x:%x:%x:%x:%x\n", enm->enm_addrhi[0], enm->enm_addrhi[1], - enm->enm_addrhi[2], enm->enm_addrhi[3], enm->enm_addrhi[4], - enm->enm_addrhi[5]); -#endif - if (bcmp(enm->enm_addrlo, enm->enm_addrhi, 6) != 0) { - return(1); - } - ETHER_NEXT_MULTI(step, enm); - } - return(0); -} -#endif -#endif diff --git a/sys/dev/netif/wl/if_wl.h b/sys/dev/netif/wl/if_wl.h deleted file mode 100644 index 88c25b00f9..0000000000 --- a/sys/dev/netif/wl/if_wl.h +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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 all copyright - * notices, this list of conditions and the following disclaimer. - * 2. The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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: src/sys/i386/isa/if_wl.h,v 1.2.6.1 2000/08/03 01:01:20 peter Exp $ - * $DragonFly: src/sys/dev/netif/wl/if_wl.h,v 1.3 2005/07/07 15:15:24 joerg Exp $ - */ -/* Definitions for WaveLAN driver */ - -#ifndef _IF_WL_H -#define _IF_WL_H - -#define STATUS_TRIES 15000 - -#define N_FD 100 -#define N_RBD 100 -#define N_TBD 72 -#define RCVBUFSIZE 540 -#define I82586NULL 0xffff - -#define DSF_RUNNING 1 - -#define MOD_ENAL 1 -#define MOD_PROM 2 - -typedef struct { - rbd_t r; - char rbd_pad[2]; - char rbuffer[RCVBUFSIZE]; -} ru_t; - -/* Board 64k RAM layout. Offsets from 0x0000 */ - -#define OFFSET_RU 0x0000 /* 0x64 * fd_t = 0x898 */ -#define OFFSET_RBD 0x0900 /* 0x64 * ru_t = 0xd7a0 */ -#define OFFSET_CU 0xe0a0 /* 0x100 */ -#define OFFSET_TBD 0xe1a0 /* 0x48 * tbd_t = 0x240 */ -#define OFFSET_TBUF 0xe3e0 /* 0x1bfe */ -#define OFFSET_SCB 0xffde /* 0x1 * scb_t = 0x10 */ -#define OFFSET_ISCP 0xffee /* 0x1 * iscp_t = 0x8 */ -#define OFFSET_SCP 0xfff6 /* 0x1 * scp_t = 0xa */ - -/* WaveLAN host interface definitions */ - -#define HACR(base) (base) /* Host Adapter Command Register */ -#define HASR(base) (base) /* Host Adapter Status Register */ -#define MMCR(base) (base+0x2) /* Modem Management Ctrl Register */ -#define PIOR0(base) (base+0x4) /* Program I/O Address Register 0 */ -#define PIOP0(base) (base+0x6) /* Program I/O Port 0 */ -#define PIOR1(base) (base+0x8) /* Program I/O Address Register 1 */ -#define PIOP1(base) (base+0xa) /* Program I/O Port 1 */ -#define PIOR2(base) (base+0xc) /* Program I/O Address Register 2 */ -#define PIOP2(base) (base+0xe) /* Program I/O Port 2 */ - -/* Program I/O Mode Register values */ - -#define STATIC_PIO 0 /* Mode 1: static mode */ -#define AUTOINCR_PIO 1 /* Mode 2: auto increment mode */ -#define AUTODECR_PIO 2 /* Mode 3: auto decrement mode */ -#define PARAM_ACCESS_PIO 3 /* Mode 4: LAN parameter access mode */ -#define PIO_MASK 3 /* register mask */ -#define PIOM(cmd,piono) ((u_short)cmd << 10 << (piono * 2)) - -/* Host Adapter status register definitions */ - -#define HASR_INTR 0x0001 /* Interrupt request from 82586 */ -#define HASR_MMC_INTR 0x0002 /* Interrupt request from MMC */ -#define HASR_MMC_BUSY 0x0004 /* MMC busy indication */ -#define HASR_PARA_BUSY 0x0008 /* LAN parameter storage area busy */ - -/* Host Adapter command register definitions */ - -#define HACR_RESET 0x0001 /* Reset board */ -#define HACR_CA 0x0002 /* Set Channel Attention for 82586 */ -#define HACR_16BITS 0x0004 /* 1==16 bits operation, 0==8 bits */ -#define HACR_OUT1 0x0008 /* General purpose output pin */ -#define HACR_OUT2 0x0010 /* General purpose output pin */ -#define HACR_MASK_82586 0x0020 /* Mask 82586 interrupts, 1==unmask */ -#define HACR_MASK_MMC 0x0040 /* Mask MMC interrupts, 1==unmask */ -#define HACR_INTR_CLEN 0x0080 /* interrupt status clear enable */ - -#define HACR_DEFAULT (HACR_OUT1 | HACR_OUT2 | HACR_16BITS | PIOM(STATIC_PIO, 0) | PIOM(AUTOINCR_PIO, 1) | PIOM(PARAM_ACCESS_PIO, 2)) -#define HACR_INTRON (HACR_MASK_82586 | HACR_MASK_MMC | HACR_INTR_CLEN) -#define CMD(sc) \ - { \ - outw(HACR((sc)->base),(sc)->hacr); \ - /* delay for 50 us, might only be needed sometimes */ \ - DELAY(DELAYCONST); \ - } - -/* macro for setting the channel attention bit. No delays here since - * it is used in critical sections - */ -#define SET_CHAN_ATTN(sc) \ - { \ - outw(HACR((sc)->base),(sc)->hacr | HACR_CA); \ - } - - -#define MMC_WRITE(cmd,val) \ - while(inw(HASR((sc)->base)) & HASR_MMC_BUSY) ; \ - outw(MMCR((sc)->base), \ - (u_short)(((u_short)(val) << 8) | ((cmd) << 1) | 1)) - -#endif /* _IF_WL_H */ diff --git a/sys/dev/netif/wl/if_wl_i82586.h b/sys/dev/netif/wl/if_wl_i82586.h deleted file mode 100644 index c29be6afc4..0000000000 --- a/sys/dev/netif/wl/if_wl_i82586.h +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - * - * $FreeBSD: src/sys/i386/isa/ic/if_wl_i82586.h,v 1.1.10.1 2000/08/03 01:01:25 peter Exp $ - * $DragonFly: src/sys/dev/netif/wl/if_wl_i82586.h,v 1.2 2003/06/17 04:28:37 dillon Exp $ - */ -/* - Copyright 1988, 1989 by Olivetti Advanced Technology Center, Inc., -Cupertino, California. - - All Rights Reserved - - Permission to use, copy, modify, and distribute this software and -its documentation for any purpose and without fee is hereby -granted, provided that the above copyright notice appears in all -copies and that both the copyright notice and this permission notice -appear in supporting documentation, and that the name of Olivetti -not be used in advertising or publicity pertaining to distribution -of the software without specific, written prior permission. - - OLIVETTI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, -IN NO EVENT SHALL OLIVETTI BE LIABLE FOR ANY SPECIAL, INDIRECT, OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, -NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUR OF OR IN CONNECTION -WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -/* - * Defines for managing the status word of the 82586 cpu. For details see - * the Intel LAN Component User's Manual starting at p. 2-14. - * - */ - -#define SCB_SW_INT 0xf000 -#define SCB_SW_CX 0x8000 /* CU finished w/ int. bit set */ -#define SCB_SW_FR 0x4000 /* RU finished receiving a frame */ -#define SCB_SW_CNA 0x2000 /* CU left active state */ -#define SCB_SW_RNR 0x1000 /* RU left ready state */ - -/* - * Defines for managing the Command Unit Status portion of the 82586 - * System Control Block. - * - */ - -#define SCB_CUS_IDLE 0x0000 -#define SCB_CUS_SUSPND 0x0100 -#define SCB_CUS_ACTV 0x0200 - -/* - * Defines for managing the Receive Unit Status portion of the System - * Control Block. - * - */ - -#define SCB_RUS_IDLE 0x0000 -#define SCB_RUS_SUSPND 0x0010 -#define SCB_RUS_NORESRC 0x0020 -#define SCB_RUS_READY 0x0040 - -/* - * Defines that manage portions of the Command Word in the System Control - * Block of the 82586. Below are the Interrupt Acknowledge Bits and their - * appropriate masks. - * - */ - -#define SCB_ACK_CX 0x8000 -#define SCB_ACK_FR 0x4000 -#define SCB_ACK_CNA 0x2000 -#define SCB_ACK_RNR 0x1000 - -/* - * Defines for managing the Command Unit Control word, and the Receive - * Unit Control word. The software RESET bit is also defined. - * - */ - -#define SCB_CU_STRT 0x0100 -#define SCB_CU_RSUM 0x0200 -#define SCB_CU_SUSPND 0x0300 -#define SCB_CU_ABRT 0x0400 - -#define SCB_RESET 0x0080 - -#define SCB_RU_STRT 0x0010 -#define SCB_RU_RSUM 0x0020 -#define SCB_RU_SUSPND 0x0030 -#define SCB_RU_ABRT 0x0040 - - -/* - * The following define Action Commands for the 82586 chip. - * - */ - -#define AC_NOP 0x00 -#define AC_IASETUP 0x01 -#define AC_CONFIGURE 0x02 -#define AC_MCSETUP 0x03 -#define AC_TRANSMIT 0x04 -#define AC_TDR 0x05 -#define AC_DUMP 0x06 -#define AC_DIAGNOSE 0x07 - - -/* - * Defines for General Format for Action Commands, both Status Words, and - * Command Words. - * - */ - -#define AC_SW_C 0x8000 -#define AC_SW_B 0x4000 -#define AC_SW_OK 0x2000 -#define AC_SW_A 0x1000 -#define TC_CARRIER 0x0400 -#define TC_CLS 0x0200 -#define TC_DMA 0x0100 -#define TC_DEFER 0x0080 -#define TC_SQE 0x0040 -#define TC_COLLISION 0x0020 -#define AC_CW_EL 0x8000 -#define AC_CW_S 0x4000 -#define AC_CW_I 0x2000 - -/* - * Specific defines for the transmit action command. - * - */ - -#define TBD_SW_EOF 0x8000 -#define TBD_SW_COUNT 0x3fff - -/* - * Specific defines for the receive frame actions. - * - */ - -#define RBD_SW_EOF 0x8000 -#define RBD_SW_COUNT 0x3fff - -#define RFD_DONE 0x8000 -#define RFD_BUSY 0x4000 -#define RFD_OK 0x2000 -#define RFD_CRC 0x0800 -#define RFD_ALN 0x0400 -#define RFD_RSC 0x0200 -#define RFD_DMA 0x0100 -#define RFD_SHORT 0x0080 -#define RFD_EOF 0x0040 -#define RFD_EL 0x8000 -#define RFD_SUSP 0x4000 -/* - * 82586 chip specific structure definitions. For details, see the Intel - * LAN Components manual. - * - */ - - -typedef struct { - u_short scp_sysbus; - u_short scp_unused[2]; - u_short scp_iscp; - u_short scp_iscp_base; -} scp_t; - - -typedef struct { - u_short iscp_busy; - u_short iscp_scb_offset; - u_short iscp_scb; - u_short iscp_scb_base; -} iscp_t; - - -typedef struct { - u_short scb_status; - u_short scb_command; - u_short scb_cbl_offset; - u_short scb_rfa_offset; - u_short scb_crcerrs; - u_short scb_alnerrs; - u_short scb_rscerrs; - u_short scb_ovrnerrs; -} scb_t; - - -typedef struct { - u_short tbd_offset; - u_char dest_addr[6]; - u_short length; -} transmit_t; - - -typedef struct { - u_short fifolim_bytecnt; - u_short addrlen_mode; - u_short linprio_interframe; - u_short slot_time; - u_short hardware; - u_short min_frame_len; -} configure_t; - - -typedef struct { - u_short ac_status; - u_short ac_command; - u_short ac_link_offset; - union { - transmit_t transmit; - configure_t configure; - u_char iasetup[6]; - } cmd; -} ac_t; - - -typedef struct { - u_short act_count; - u_short next_tbd_offset; - u_short buffer_addr; - u_short buffer_base; -} tbd_t; - - -typedef struct { - u_short status; - u_short command; - u_short link_offset; - u_short rbd_offset; - u_char destination[6]; - u_char source[6]; - u_short length; -} fd_t; - - -typedef struct { - u_short status; - u_short next_rbd_offset; - u_short buffer_addr; - u_short buffer_base; - u_short size; -} rbd_t; diff --git a/sys/dev/serial/dgb/dgm.c b/sys/dev/serial/dgb/dgm.c deleted file mode 100644 index b9624fcd1a..0000000000 --- a/sys/dev/serial/dgb/dgm.c +++ /dev/null @@ -1,2301 +0,0 @@ -/*- - * $FreeBSD: src/sys/dev/dgb/dgm.c,v 1.31.2.3 2001/10/07 09:02:25 brian Exp $ - * - * This driver and the associated header files support the ISA PC/Xem - * Digiboards. Its evolutionary roots are described below. - * Jack O'Neill - * - * Digiboard driver. - * - * Stage 1. "Better than nothing". - * Stage 2. "Gee, it works!". - * - * 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, - * without modification, immediately at the beginning of the file. - * 2. Redistributions of binary code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, in the accompanying documentation. - * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - * Written by Sergey Babkin, - * Joint Stock Commercial Bank "Chelindbank" - * (Chelyabinsk, Russia) - * babkin@freebsd.org - * - * Assorted hacks to make it more functional and working under 3.0-current. - * Fixed broken routines to prevent processes hanging on closed (thanks - * to Bruce for his patience and assistance). Thanks also to Maxim Bolotin - * for his patches which did most of the work to get this - * running under 2.2/3.0-current. - * Implemented ioctls: TIOCMSDTRWAIT, TIOCMGDTRWAIT, TIOCTIMESTAMP & - * TIOCDCDTIMESTAMP. - * Sysctl debug flag is now a bitflag, to filter noise during debugging. - * David L. Nugent - * - * New-busification by Brian Somers - * - * There was a copyright confusion: I thought that having read the - * GLPed drivers makes me mentally contaminated but in fact it does - * not. Since the Linux driver by Troy De Jongh or - * was used only to learn the Digi's interface, - * I've returned this driver to a BSD-style license. I tried to contact - * all the contributors and those who replied agreed with license - * change. If you did any contribution when the driver was GPLed and do - * not agree with the BSD-style re-licensing please contact me. - * -SB - */ - -/* How often to run dgmpoll */ -#define POLLSPERSEC 25 - -/* How many charactes can we write to input tty rawq */ -#define DGB_IBUFSIZE (TTYHOG - 100) - -/* the overall number of ports controlled by this driver */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include "dgmfep.h" -#include "dgmbios.h" -#include "dgmreg.h" - -#define CALLOUT_MASK 0x40000 -#define CONTROL_MASK 0xC0 -#define CONTROL_INIT_STATE 0x40 -#define CONTROL_LOCK_STATE 0x80 -#define UNIT_MASK 0x30000 -#define PORT_MASK 0x3F -#define DEV_TO_UNIT(dev) (MINOR_TO_UNIT(minor(dev))) -#define MINOR_MAGIC_MASK (CALLOUT_MASK | CONTROL_MASK) -#define MINOR_TO_UNIT(mynor) (((mynor) & UNIT_MASK) >> 16) -#define MINOR_TO_PORT(mynor) ((mynor) & PORT_MASK) -#define IO_SIZE 0x04 -#define MEM_SIZE 0x8000 - -#define DGM_UNITMASK 0x30000 -#define DGM_UNIT(unit) ((unit) << 16) - -struct dgm_softc; - -/* digiboard port structure */ -struct dgm_p { - unsigned enabled : 1; - - struct dgm_softc *sc; /* parent softc */ - u_char pnum; /* port number */ - u_char omodem; /* FEP output modem status */ - u_char imodem; /* FEP input modem status */ - u_char modemfake; /* Modem values to be forced */ - u_char modem; /* Force values */ - u_char hflow; - u_char dsr; - u_char dcd; - u_char stopc; - u_char startc; - u_char stopca; - u_char startca; - u_char fepstopc; - u_char fepstartc; - u_char fepstopca; - u_char fepstartca; - u_char txwin; - u_char rxwin; - ushort fepiflag; - ushort fepcflag; - ushort fepoflag; - ushort txbufhead; - ushort txbufsize; - ushort rxbufhead; - ushort rxbufsize; - int close_delay; - u_char *txptr; - u_char *rxptr; - volatile struct board_chan *brdchan; - struct tty *tty; - - u_char active_out; /* nonzero if the callout device is open */ - u_int wopeners; /* # processes waiting for DCD in open() */ - - /* Initial state. */ - struct termios it_in; /* should be in struct tty */ - struct termios it_out; - - /* Lock state. */ - struct termios lt_in; /* should be in struct tty */ - struct termios lt_out; - - unsigned do_timestamp : 1; - unsigned do_dcd_timestamp : 1; - struct timeval timestamp; - struct timeval dcd_timestamp; - - /* flags of state, are used in sleep() too */ - u_char closing; /* port is being closed now */ - u_char draining; /* port is being drained now */ - u_char used; /* port is being used now */ - u_char mustdrain; /* data must be waited to drain in dgmparam() */ - - struct callout hc_timeout; - struct callout wf_timeout; -}; - -/* Digiboard per-board structure */ -struct dgm_softc { - /* struct board_info */ - unsigned enabled : 1; - u_char unit; /* unit number */ - u_char type; /* type of card: PCXE, PCXI, PCXEVE */ - u_char altpin; /* do we need alternate pin setting ? */ - int numports; /* number of ports on card */ - u_long port; /* I/O port */ - u_char *vmem; /* virtual memory address */ - u_long pmem; /* physical memory address */ - int mem_seg; /* internal memory segment */ - u_long msize; - struct dgm_p *ports; /* ptr to array of port descriptors */ - struct tty *ttys; /* ptr to array of TTY structures */ - volatile struct global_data *mailbox; - struct resource *io_res; - struct resource *mem_res; - int iorid; - int mrid; - struct callout toh; /* poll timeout handle */ -}; - -static void dgmpoll(void *); -static int dgmprobe(device_t); -static int dgmattach(device_t); -static int dgmdetach(device_t); -static int dgmshutdown(device_t); -static void fepcmd(struct dgm_p *, unsigned, unsigned, unsigned, unsigned, - unsigned); -static void dgmstart(struct tty *); -static void dgmstop(struct tty *, int); -static int dgmparam(struct tty *, struct termios *); -static void dgmhardclose(struct dgm_p *); -static void dgm_drain_or_flush(struct dgm_p *); -static int dgmdrain(struct dgm_p *); -static void dgm_pause(void *); -static void wakeflush(void *); -static void disc_optim(struct tty *, struct termios *); - -static d_open_t dgmopen; -static d_close_t dgmclose; -static d_ioctl_t dgmioctl; - -static device_method_t dgmmethods[] = { - /* Device interface */ - DEVMETHOD(device_probe, dgmprobe), - DEVMETHOD(device_attach, dgmattach), - DEVMETHOD(device_detach, dgmdetach), - DEVMETHOD(device_shutdown, dgmshutdown), - { 0, 0 } -}; - -static driver_t dgmdriver = { - "dgm", - dgmmethods, - sizeof (struct dgm_softc), -}; - -static devclass_t dgmdevclass; - -static struct dev_ops dgm_ops = { - { "dgm", 0, D_TTY }, - .d_open = dgmopen, - .d_close = dgmclose, - .d_read = ttyread, - .d_write = ttywrite, - .d_ioctl = dgmioctl, - .d_kqfilter = ttykqfilter, - .d_revoke = ttyrevoke -}; - -static int -dgmmodhandler(module_t mod, int event, void *arg) -{ - int res = 0; - - switch (event) { - case MOD_LOAD: - break; - case MOD_UNLOAD: - break; - } - - return res; -} - -DRIVER_MODULE(dgm, isa, dgmdriver, dgmdevclass, dgmmodhandler, NULL); - -static speed_t dgmdefaultrate = TTYDEF_SPEED; - -static struct speedtab dgmspeedtab[] = { - { 0, FEP_B0 }, /* old (sysV-like) Bx codes */ - { 50, FEP_B50 }, - { 75, FEP_B75 }, - { 110, FEP_B110 }, - { 134, FEP_B134 }, - { 150, FEP_B150 }, - { 200, FEP_B200 }, - { 300, FEP_B300 }, - { 600, FEP_B600 }, - { 1200, FEP_B1200 }, - { 1800, FEP_B1800 }, - { 2400, FEP_B2400 }, - { 4800, FEP_B4800 }, - { 9600, FEP_B9600 }, - { 19200, FEP_B19200 }, - { 38400, FEP_B38400 }, - { 57600, (FEP_FASTBAUD|FEP_B50) }, /* B50 & fast baud table */ - { 115200, (FEP_FASTBAUD|FEP_B110) }, /* B100 & fast baud table */ - { -1, -1 } -}; - -static struct dbgflagtbl { - tcflag_t in_mask; - tcflag_t in_val; - tcflag_t out_val; -} dgm_cflags[] = { - { PARODD, PARODD, FEP_PARODD }, - { PARENB, PARENB, FEP_PARENB }, - { CSTOPB, CSTOPB, FEP_CSTOPB }, - { CSIZE, CS5, FEP_CS6 }, - { CSIZE, CS6, FEP_CS6 }, - { CSIZE, CS7, FEP_CS7 }, - { CSIZE, CS8, FEP_CS8 }, - { CLOCAL, CLOCAL, FEP_CLOCAL }, - { (tcflag_t)-1 } -}, dgm_iflags[] = { - { IGNBRK, IGNBRK, FEP_IGNBRK }, - { BRKINT, BRKINT, FEP_BRKINT }, - { IGNPAR, IGNPAR, FEP_IGNPAR }, - { PARMRK, PARMRK, FEP_PARMRK }, - { INPCK, INPCK, FEP_INPCK }, - { ISTRIP, ISTRIP, FEP_ISTRIP }, - { IXON, IXON, FEP_IXON }, - { IXOFF, IXOFF, FEP_IXOFF }, - { IXANY, IXANY, FEP_IXANY }, - { (tcflag_t)-1 } -}, dgm_flow[] = { - { CRTSCTS, CRTSCTS, CTS|RTS }, - { CRTSCTS, CCTS_OFLOW, CTS }, - { CRTSCTS, CRTS_IFLOW, RTS }, - { (tcflag_t)-1 } -}; - -/* xlat bsd termios flags to dgm sys-v style */ -static tcflag_t -dgmflags(struct dbgflagtbl *tbl, tcflag_t input) -{ - tcflag_t output = 0; - int i; - - for (i = 0; tbl[i].in_mask != (tcflag_t)-1; i++) - if ((input & tbl[i].in_mask) == tbl[i].in_val) - output |= tbl[i].out_val; - - return output; -} - -static int dgmdebug = 0; -SYSCTL_INT(_debug, OID_AUTO, dgm_debug, CTLFLAG_RW, &dgmdebug, 0, ""); - -static __inline int setwin(struct dgm_softc *, unsigned); -static __inline void hidewin(struct dgm_softc *); -static __inline void towin(struct dgm_softc *, int); - -/*Helg: to allow recursive dgm...() calls */ -typedef struct { - /* If we were called and don't want to disturb we need: */ - int port; /* write to this port */ - u_char data; /* this data on exit */ - /* or DATA_WINOFF to close memory window on entry */ -} BoardMemWinState; /* so several channels and even boards can coexist */ - -#define DATA_WINOFF 0 -static BoardMemWinState bmws; - -static u_long validio[] = { 0x104, 0x114, 0x124, 0x204, 0x224, 0x304, 0x324 }; -static u_long validmem[] = { - 0x80000, 0x88000, 0x90000, 0x98000, 0xa0000, 0xa8000, 0xb0000, 0xb8000, - 0xc0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000, 0xe8000, 0xf0000, 0xf8000, - 0xf0000000, 0xf1000000, 0xf2000000, 0xf3000000, 0xf4000000, 0xf5000000, - 0xf6000000, 0xf7000000, 0xf8000000, 0xf9000000, 0xfa000000, 0xfb000000, - 0xfc000000, 0xfd000000, 0xfe000000, 0xff000000 -}; - -/* return current memory window state and close window */ -static BoardMemWinState -bmws_get(void) -{ - BoardMemWinState bmwsRet = bmws; - - if (bmws.data != DATA_WINOFF) - outb(bmws.port, bmws.data = DATA_WINOFF); - return bmwsRet; -} - -/* restore memory window state */ -static void -bmws_set(BoardMemWinState ws) -{ - if (ws.data != bmws.data || ws.port != bmws.port) { - if (bmws.data != DATA_WINOFF) - outb(bmws.port, DATA_WINOFF); - if (ws.data != DATA_WINOFF) - outb(ws.port, ws.data); - bmws = ws; - } -} - -static __inline int -setwin(struct dgm_softc *sc, unsigned int addr) -{ - outb(bmws.port = sc->port + 1, bmws.data = FEPWIN|(addr >> 15)); - return (addr & 0x7FFF); -} - -static __inline void -hidewin(struct dgm_softc *sc) -{ - bmws.data = 0; - outb(bmws.port = sc->port + 1, bmws.data); -} - -static __inline void -towin(struct dgm_softc *sc, int win) -{ - outb(bmws.port = sc->port + 1, bmws.data = win); -} - -static int -dgmprobe(device_t dev) -{ - struct dgm_softc *sc = device_get_softc(dev); - int i, v; - - /* - * Assign unit number. Due to bits we use in the minor number for - * the various tty types, only 4 units are supported. - */ - sc->unit = device_get_unit(dev); - if (sc->unit > 3) { - device_printf(dev, "Too many units, only 4 supported\n"); - return(ENXIO); - } - - /* Check that we've got a valid i/o address */ - if ((sc->port = bus_get_resource_start(dev, SYS_RES_IOPORT, 0)) == 0) - return (ENXIO); - for (i = sizeof (validio) / sizeof (validio[0]) - 1; i >= 0; i--) - if (sc->port == validio[i]) - break; - if (i == -1) { - device_printf(dev, "0x%03lx: Invalid i/o address\n", sc->port); - return (ENXIO); - } - - /* Ditto for our memory address */ - if ((sc->pmem = bus_get_resource_start(dev, SYS_RES_MEMORY, 0)) == 0) - return (ENXIO); - for (i = sizeof (validmem) / sizeof (validmem[0]) - 1; i >= 0; i--) - if (sc->pmem == validmem[i]) - break; - if (i == -1) { - device_printf(dev, "0x%lx: Invalid memory address\n", sc->pmem); - return (ENXIO); - } - if ((sc->pmem & 0xFFFFFFul) != sc->pmem) { - device_printf(dev, "0x%lx: Memory address not supported\n", - sc->pmem); - return (ENXIO); - } - sc->vmem = (u_char *)sc->pmem; - - DPRINT4(DB_INFO, "dgm%d: port 0x%lx mem 0x%lx\n", sc->unit, - sc->port, sc->pmem); - - /* Temporarily map our io ports */ - sc->iorid = 0; - sc->io_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->iorid, - 0ul, ~0ul, IO_SIZE, RF_ACTIVE); - if (sc->io_res == NULL) - return (ENXIO); - - lwkt_gettoken(&tty_token); - outb(sc->port, FEPRST); - sc->enabled = 0; - - for (i = 0; i < 1000; i++) { - DELAY(1); - if ((inb(sc->port) & FEPMASK) == FEPRST) { - sc->enabled = 1; - DPRINT3(DB_EXCEPT, "dgm%d: got reset after %d us\n", - sc->unit, i); - break; - } - } - - if (!sc->enabled) { - DPRINT2(DB_EXCEPT, "dgm%d: failed to respond\n", sc->unit); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - - /* check type of card and get internal memory characteristics */ - - v = inb(sc->port); - - if (!(v & 0x1)) { - int second; - - outb(sc->port, 1); - second = inb(sc->port); - kprintf("dgm%d: PC/Xem (type %d, %d)\n", sc->unit, v, second); - } else - kprintf("dgm%d: PC/Xem (type %d)\n", sc->unit, v); - - sc->type = PCXEM; - sc->mem_seg = 0x8000; - - /* Temporarily map our memory too */ - sc->mrid = 0; - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mrid, - 0ul, ~0ul, MEM_SIZE, RF_ALLOCATED); - if (sc->mem_res == NULL) { - device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - - outb(sc->port, FEPCLR); /* drop RESET */ - hidewin(sc); /* Helg: to set initial bmws state */ - - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - - bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->port, IO_SIZE); - bus_set_resource(dev, SYS_RES_MEMORY, 0, sc->pmem, MEM_SIZE); - - DPRINT2(DB_INFO, "dgm%d: Probe returns 0\n", sc->unit); - - lwkt_reltoken(&tty_token); - return (0); -} - -static int -dgmattach(device_t dev) -{ - struct dgm_softc *sc = device_get_softc(dev); - int i, t; - u_char *mem; - u_char *ptr; - int addr; - struct dgm_p *port; - volatile struct board_chan *bc; - int shrinkmem; - int lowwater; - u_long msize, iosize; - - DPRINT2(DB_INFO, "dbg%d: attaching\n", device_get_unit(dev)); - - lwkt_gettoken(&tty_token); - callout_init_mp(&sc->toh); - sc->unit = device_get_unit(dev); - bus_get_resource(dev, SYS_RES_IOPORT, 0, &sc->port, &iosize); - bus_get_resource(dev, SYS_RES_MEMORY, 0, &sc->pmem, &msize); - sc->altpin = !!(device_get_flags(dev) & DGBFLAG_ALTPIN); - sc->type = PCXEM; - sc->mem_seg = 0x8000; - sc->enabled = 1; - sc->type = PCXEM; - sc->mem_seg = 0x8000; - - /* Allocate resources (should have been verified in dgmprobe()) */ - sc->iorid = 0; - sc->io_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->iorid, - 0ul, ~0ul, iosize, RF_ACTIVE); - if (sc->io_res == NULL) { - lwkt_reltoken(&tty_token); - return (ENXIO); - } - sc->mrid = 0; - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->mrid, - 0ul, ~0ul, msize, RF_ACTIVE); - if (sc->mem_res == NULL) { - device_printf(dev, "0x%lx: Memory range is in use\n", sc->pmem); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - - /* map memory */ - mem = sc->vmem = pmap_mapdev(sc->pmem, msize); - sc->msize = msize; - - DPRINT3(DB_INFO, "dgm%d: internal memory segment 0x%x\n", sc->unit, - sc->mem_seg); - - outb(sc->port, FEPRST); - DELAY(1); - - for (i = 0; (inb(sc->port) & FEPMASK) != FEPRST; i++) { - if (i > 10000) { - device_printf(dev, "1st reset failed\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - DELAY(1); - } - - DPRINT3(DB_INFO, "dgm%d: got reset after %d us\n", sc->unit, i); - - t = sc->pmem >> 8; /* disable windowing */ - outb(sc->port + 2, t & 0xFF); - outb(sc->port + 3, t >> 8); - - mem = sc->vmem; - - /* very short memory test */ - DPRINT2(DB_INFO, "dbg%d: short memory test\n", sc->unit); - - addr = setwin(sc, BOTWIN); - *(u_long *)(mem + addr) = 0xA55A3CC3; - if (*(u_long *)(mem + addr) != 0xA55A3CC3) { - device_printf(dev, "1st memory test failed\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - - DPRINT2(DB_INFO, "dbg%d: 1st memory test ok\n", sc->unit); - - addr = setwin(sc, TOPWIN); - *(u_long *)(mem + addr) = 0x5AA5C33C; - if (*(u_long *)(mem + addr) != 0x5AA5C33C) { - device_printf(dev, "2nd memory test failed\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - - DPRINT2(DB_INFO, "dbg%d: 2nd memory test ok\n", sc->unit); - - addr = setwin(sc, BIOSCODE + ((0xF000 - sc->mem_seg) << 4)); - *(u_long *)(mem + addr) = 0x5AA5C33C; - if (*(u_long *)(mem + addr) != 0x5AA5C33C) - device_printf(dev, "3rd (BIOS) memory test failed\n"); - - DPRINT2(DB_INFO, "dbg%d: 3rd memory test ok\n", sc->unit); - - addr = setwin(sc, MISCGLOBAL); - for (i = 0; i < 16; i++) - mem[addr + i] = 0; - - addr = setwin(sc, BIOSOFFSET); - ptr = mem + addr; - for (i = 0; ptr < mem + msize; i++) - *ptr++ = pcem_bios[i]; - - ptr = mem + BIOSOFFSET; - for (i = 0; ptr < mem + msize; i++) { - if (*ptr++ != pcem_bios[i]) { - kprintf("Low BIOS load failed\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - } - DPRINT2(DB_INFO, "dbg%d: pcem_bios seg 1 loaded\n", sc->unit); - - addr = setwin(sc, msize); - ptr = mem + addr; - for (;i < pcem_nbios; i++) - *ptr++ = pcem_bios[i]; - - ptr = mem; - for (i = msize - BIOSOFFSET; i < pcem_nbios; i++) { - if (*ptr++ != pcem_bios[i]) { - kprintf("High BIOS load failed\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - } - DPRINT2(DB_INFO, "dbg%d: pcem_bios seg 2 loaded\n", sc->unit); - device_printf(dev, "DigiBIOS loaded, initializing"); - - addr = setwin(sc, 0); - - *(u_int *)(mem + addr) = 0x0bf00401; - *(u_int *)(mem + addr + 4) = 0; - *(ushort *)(mem + addr + 0xc00) = 0; - outb(sc->port, 0); - - for (i = 0; *(u_char *)(mem + addr + 0xc00) != 0x47; i++) { - DELAY(10000); - if (i > 3000) { - kprintf("\nBIOS initialize failed(1)\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - } - - if (*(u_char *)(mem + addr + 0xc01) != 0x44) { - kprintf("\nBIOS initialize failed(2)\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - kprintf(", DigiBIOS running\n"); - - DELAY(10000); - - addr = setwin(sc, BIOSOFFSET); - ptr = mem + addr; - for (i = 0; i < pcem_ncook; i++) - *ptr++ = pcem_cook[i]; - - ptr = mem + BIOSOFFSET; - for (i = 0; i < pcem_ncook; i++) { - if (*ptr++ != pcem_cook[i]) { - kprintf("FEP/OS load failed\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - } - device_printf(dev, "FEP/OS loaded, initializing"); - - addr = setwin(sc, 0); - *(ushort *)(mem + addr + 0xd20) = 0; - *(u_int *)(mem + addr + 0xc34) = 0xbfc01004; - *(u_int *)(mem + addr + 0xc30) = 0x3L; - outb(sc->port, 0); - - for (i = 0; *(u_char *)(mem + addr + 0xd20) != 'O'; i++) { - DELAY(10000); - if (i > 3000) { - kprintf("\nFEP/OS initialize failed(1)\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - } - - if (*(u_char *)(mem + addr + 0xd21) != 'S') { - kprintf("\nFEP/OS initialize failed(2)\n"); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - kprintf(", FEP/OS running\n"); - - sc->numports = *(ushort *)(mem + setwin(sc, NPORT)); - device_printf(dev, "%d ports attached\n", sc->numports); - - if (sc->numports > MAX_DGM_PORTS) { - kprintf("dgm%d: too many ports\n", sc->unit); - sc->enabled = 0; - hidewin(sc); - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - lwkt_reltoken(&tty_token); - return (ENXIO); - } - - MALLOC(sc->ports, struct dgm_p *, sizeof (*sc->ports) * sc->numports, - M_TTYS, M_WAITOK|M_ZERO); - MALLOC(sc->ttys, struct tty *, sizeof (*sc->ttys) * sc->numports, - M_TTYS, M_WAITOK|M_ZERO); - - DPRINT3(DB_INFO, "dgm%d: enable %d ports\n", sc->unit, sc->numports); - for (i = 0; i < sc->numports; i++) { - sc->ports[i].enabled = 1; - callout_init_mp(&sc->ports[i].hc_timeout); - callout_init_mp(&sc->ports[i].wf_timeout); - } - - /* We should now init per-port structures */ - setwin(sc, 0); - bc = (volatile struct board_chan *)(mem + CHANSTRUCT); - sc->mailbox = (volatile struct global_data *)(mem + FEP_GLOBAL); - - if (sc->numports < 3) - shrinkmem = 1; - else - shrinkmem = 0; - - for (i = 0; i < sc->numports; i++, bc++) { - DPRINT3(DB_INFO, "dgm%d: Set up port %d\n", sc->unit, i); - port = &sc->ports[i]; - port->sc = sc; - - port->tty = &sc->ttys[i]; - - port->brdchan = bc; - - port->dcd = CD; - port->dsr = DSR; - port->pnum = i; - - DPRINT3(DB_INFO, "dgm%d port %d: shrinkmem ?\n", sc->unit, i); - if (shrinkmem) { - DPRINT2(DB_INFO, "dgm%d: shrinking memory\n", sc->unit); - fepcmd(port, SETBUFFER, 32, 0, 0, 0); - shrinkmem = 0; - } - - DPRINT3(DB_INFO, "dgm%d port %d: assign ptrs\n", sc->unit, i); - port->txptr = mem + ((bc->tseg << 4) & 0x7FFF); - port->rxptr = mem + ((bc->rseg << 4) & 0x7FFF); - port->txwin = FEPWIN | (bc->tseg >> 11); - port->rxwin = FEPWIN | (bc->rseg >> 11); - - port->txbufhead = 0; - port->rxbufhead = 0; - port->txbufsize = bc->tmax + 1; - port->rxbufsize = bc->rmax + 1; - - lowwater = (port->txbufsize >= 2000) ? - 1024 : (port->txbufsize / 2); - - setwin(sc, 0); - DPRINT4(DB_INFO, "dgm%d port %d: fepcmd STXLWATER %d\n", - sc->unit, i, lowwater); - fepcmd(port, STXLWATER, lowwater, 0, 10, 0); - DPRINT4(DB_INFO, "dgm%d port %d: fepcmd SRXLWATER %d\n", - sc->unit, i, port->rxbufsize / 4); - fepcmd(port, SRXLWATER, port->rxbufsize / 4, 0, 10, 0); - DPRINT4(DB_INFO, "dgm%d port %d: fepcmd SRXHWATER %d\n", - sc->unit, i, 3 * port->rxbufsize / 4); - fepcmd(port, SRXHWATER, 3 * port->rxbufsize / 4, 0, 10, 0); - - bc->edelay = 100; - bc->idata = 1; - - port->startc = bc->startc; - port->startca = bc->startca; - port->stopc = bc->stopc; - port->stopca = bc->stopca; - - /* port->close_delay = 50; */ - port->close_delay = 3 * hz; - port->do_timestamp = 0; - port->do_dcd_timestamp = 0; - - DPRINT3(DB_INFO, "dgm%d port %d: setup flags\n", sc->unit, i); - /* - * We don't use all the flags from since - * they are only relevant for logins. It's important to have - * echo off initially so that the line doesn't start - * blathering before the echo flag can be turned off. - */ - port->it_in.c_iflag = TTYDEF_IFLAG; - port->it_in.c_oflag = TTYDEF_OFLAG; - port->it_in.c_cflag = TTYDEF_CFLAG; - port->it_in.c_lflag = TTYDEF_LFLAG; - termioschars(&port->it_in); - port->it_in.c_ispeed = port->it_in.c_ospeed = dgmdefaultrate; - port->it_out = port->it_in; - - DPRINT3(DB_INFO, "dgm%d port %d: make devices\n", sc->unit, i); - make_dev(&dgm_ops, (sc->unit*65536) + i, UID_ROOT, - GID_WHEEL, 0600, "ttyM%d%x", sc->unit, i + 0xa0); - make_dev(&dgm_ops, sc->unit * 65536 + i + 64, UID_ROOT, - GID_WHEEL, 0600, "ttyiM%d%x", sc->unit, i + 0xa0); - make_dev(&dgm_ops, sc->unit * 65536 + i + 128, UID_ROOT, - GID_WHEEL, 0600, "ttylM%d%x", sc->unit, i + 0xa0); - make_dev(&dgm_ops, sc->unit * 65536 + i + 262144, UID_UUCP, - GID_DIALER, 0660, "cuaM%d%x", sc->unit, i + 0xa0); - make_dev(&dgm_ops, sc->unit * 65536 + i + 262208, UID_UUCP, - GID_DIALER, 0660, "cuaiM%d%x", sc->unit, i + 0xa0); - make_dev(&dgm_ops, sc->unit * 65536 + i + 262272, UID_UUCP, - GID_DIALER, 0660, "cualM%d%x", sc->unit, i + 0xa0); - } - - DPRINT3(DB_INFO, "dgm%d: %d device nodes created\n", sc->unit, sc->numports); - - hidewin(sc); - - /* start the polling function */ - callout_reset(&sc->toh, hz / POLLSPERSEC, - dgmpoll, (void *)(int)sc->unit); - - DPRINT2(DB_INFO, "dgm%d: poll thread started\n", sc->unit); - - lwkt_reltoken(&tty_token); - return (0); -} - -static int -dgmdetach(device_t dev) -{ - struct dgm_softc *sc = device_get_softc(dev); - int i; - - lwkt_gettoken(&tty_token); - for (i = 0; i < sc->numports; i++) { - if (sc->ttys[i].t_state & TS_ISOPEN) { - lwkt_reltoken(&tty_token); - return (EBUSY); - } - } - - DPRINT2(DB_INFO, "dgm%d: detach\n", sc->unit); - - /* - * The dev_ops_remove() call will destroy all associated devices - * and dereference any ad-hoc-created devices, but does not - * dereference devices created via make_dev(). - */ - dev_ops_remove_minor(&dgm_ops/*, DGM_UNITMASK*/, DGM_UNIT(sc->unit)); - - callout_stop(&sc->toh); - - bus_release_resource(dev, SYS_RES_MEMORY, sc->mrid, sc->mem_res); - bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid, sc->io_res); - - FREE(sc->ports, M_TTYS); - FREE(sc->ttys, M_TTYS); - - if (sc->vmem) { - pmap_unmapdev((vm_offset_t)sc->vmem, sc->msize); - sc->vmem = NULL; - } - - lwkt_reltoken(&tty_token); - return (0); -} - -int -dgmshutdown(device_t dev) -{ -#ifdef DEBUG - struct dgm_softc *sc = device_get_softc(dev); - - DPRINT2(DB_INFO, "dgm%d: shutdown\n", sc->unit); -#endif - - return 0; -} - -/* ARGSUSED */ -static int -dgmopen(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct dgm_softc *sc; - struct tty *tp; - int unit; - int mynor; - int pnum; - struct dgm_p *port; - int error; - volatile struct board_chan *bc; - - lwkt_gettoken(&tty_token); - error = 0; - mynor = minor(dev); - unit = MINOR_TO_UNIT(mynor); - pnum = MINOR_TO_PORT(mynor); - - sc = devclass_get_softc(dgmdevclass, unit); - if (sc == NULL) { - DPRINT2(DB_EXCEPT, "dgm%d: try to open a nonexisting card\n", - unit); - lwkt_reltoken(&tty_token); - return ENXIO; - } - - DPRINT2(DB_INFO, "dgm%d: open\n", sc->unit); - - if (!sc->enabled) { - DPRINT2(DB_EXCEPT, "dgm%d: try to open a disabled card\n", - unit); - lwkt_reltoken(&tty_token); - return ENXIO; - } - - if (pnum >= sc->numports) { - DPRINT3(DB_EXCEPT, "dgm%d: try to open non-existing port %d\n", - unit, pnum); - lwkt_reltoken(&tty_token); - return ENXIO; - } - - if (mynor & CONTROL_MASK) { - lwkt_reltoken(&tty_token); - return 0; - } - - tp = &sc->ttys[pnum]; - dev->si_tty = tp; - port = &sc->ports[pnum]; - bc = port->brdchan; - -open_top: - crit_enter(); - - while (port->closing) { - error = tsleep(&port->closing, PCATCH, "dgocl", 0); - - if (error) { - DPRINT4(DB_OPEN, "dgm%d: port%d: tsleep(dgocl)" - " error = %d\n", unit, pnum, error); - goto out; - } - } - - if (tp->t_state & TS_ISOPEN) { - /* - * The device is open, so everything has been initialized. - * Handle conflicts. - */ - if (mynor & CALLOUT_MASK) { - if (!port->active_out) { - error = EBUSY; - DPRINT4(DB_OPEN, "dgm%d: port%d:" - " BUSY error = %d\n", unit, pnum, error); - goto out; - } - } else if (port->active_out) { - if (ap->a_oflags & O_NONBLOCK) { - error = EBUSY; - DPRINT4(DB_OPEN, "dgm%d: port%d:" - " BUSY error = %d\n", unit, pnum, error); - goto out; - } - error = tsleep(&port->active_out, PCATCH, "dgmi", 0); - if (error != 0) { - DPRINT4(DB_OPEN, "dgm%d: port%d: tsleep(dgmi)" - " error = %d\n", unit, pnum, error); - goto out; - } - crit_exit(); - goto open_top; - } - if (tp->t_state & TS_XCLUDE && priv_check_cred(ap->a_cred, PRIV_ROOT, 0)) { - error = EBUSY; - goto out; - } - } else { - /* - * The device isn't open, so there are no conflicts. - * Initialize it. Initialization is done twice in many - * cases: to preempt sleeping callin opens if we are - * callout, and to complete a callin open after DCD rises. - */ - tp->t_oproc = dgmstart; - tp->t_param = dgmparam; - tp->t_stop = dgmstop; - tp->t_dev = dev; - tp->t_termios= (mynor & CALLOUT_MASK) ? - port->it_out : - port->it_in; - - crit_enter(); - setwin(sc, 0); - port->imodem = bc->mstat; - bc->rout = bc->rin; /* clear input queue */ - bc->idata = 1; -#ifdef PRINT_BUFSIZE - kprintf("dgm buffers tx = %x:%x rx = %x:%x\n", - bc->tseg, bc->tmax, bc->rseg, bc->rmax); -#endif - - hidewin(sc); - crit_exit(); - - port->wopeners++; - error = dgmparam(tp, &tp->t_termios); - port->wopeners--; - - if (error != 0) { - DPRINT4(DB_OPEN, "dgm%d: port%d: dgmparam error = %d\n", - unit, pnum, error); - goto out; - } - - /* handle fake DCD for callout devices */ - /* and initial DCD */ - - if ((port->imodem & port->dcd) || mynor & CALLOUT_MASK) - linesw[tp->t_line].l_modem(tp, 1); - } - - /* - * Wait for DCD if necessary. - */ - if (!(tp->t_state & TS_CARR_ON) && !(mynor & CALLOUT_MASK) - && !(tp->t_cflag & CLOCAL) && !(ap->a_oflags & O_NONBLOCK)) { - ++port->wopeners; - error = tsleep(TSA_CARR_ON(tp), PCATCH, "dgdcd", 0); - --port->wopeners; - if (error != 0) { - DPRINT4(DB_OPEN, "dgm%d: port%d: tsleep(dgdcd)" - " error = %d\n", unit, pnum, error); - goto out; - } - crit_exit(); - goto open_top; - } - error = linesw[tp->t_line].l_open(dev, tp); - disc_optim(tp, &tp->t_termios); - DPRINT4(DB_OPEN, "dgm%d: port%d: l_open error = %d\n", - unit, pnum, error); - - if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK) - port->active_out = 1; - - port->used = 1; - - /* If any port is open (i.e. the open() call is completed for it) - * the device is busy - */ - -out: - disc_optim(tp, &tp->t_termios); - crit_exit(); - - if (!(tp->t_state & TS_ISOPEN) && port->wopeners == 0) - dgmhardclose(port); - - DPRINT4(DB_OPEN, "dgm%d: port%d: open() returns %d\n", - unit, pnum, error); - - lwkt_reltoken(&tty_token); - return error; -} - -/*ARGSUSED*/ -static int -dgmclose(struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - int mynor; - struct tty *tp; - int unit, pnum; - struct dgm_softc *sc; - struct dgm_p *port; - int i; - - mynor = minor(dev); - if (mynor & CONTROL_MASK) - return 0; - - lwkt_gettoken(&tty_token); - unit = MINOR_TO_UNIT(mynor); - pnum = MINOR_TO_PORT(mynor); - - sc = devclass_get_softc(dgmdevclass, unit); - tp = &sc->ttys[pnum]; - port = sc->ports + pnum; - - DPRINT3(DB_CLOSE, "dgm%d: port%d: closing\n", unit, pnum); - - DPRINT3(DB_CLOSE, "dgm%d: port%d: draining port\n", unit, pnum); - dgm_drain_or_flush(port); - - crit_enter(); - - port->closing = 1; - DPRINT3(DB_CLOSE, "dgm%d: port%d: closing line disc\n", unit, pnum); - linesw[tp->t_line].l_close(tp, ap->a_fflag); - disc_optim(tp, &tp->t_termios); - - DPRINT3(DB_CLOSE, "dgm%d: port%d: hard closing\n", unit, pnum); - dgmhardclose(port); - DPRINT3(DB_CLOSE, "dgm%d: port%d: closing tty\n", unit, pnum); - ttyclose(tp); - port->closing = 0; - wakeup(&port->closing); - port->used = 0; - - /* mark the card idle when all ports are closed */ - - for (i = 0; i < sc->numports; i++) - if (sc->ports[i].used) - break; - - crit_exit(); - - DPRINT3(DB_CLOSE, "dgm%d: port%d: closed\n", unit, pnum); - - wakeup(TSA_CARR_ON(tp)); - wakeup(&port->active_out); - port->active_out = 0; - - DPRINT3(DB_CLOSE, "dgm%d: port%d: close exit\n", unit, pnum); - - lwkt_reltoken(&tty_token); - return 0; -} - -/* - * NOTE: Must be called with tty_token held - */ -static void -dgmhardclose(struct dgm_p *port) -{ - volatile struct board_chan *bc = port->brdchan; - struct dgm_softc *sc; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - sc = devclass_get_softc(dgmdevclass, port->sc->unit); - DPRINT2(DB_INFO, "dgm%d: dgmhardclose\n", sc->unit); - crit_enter(); - port->do_timestamp = 0; - setwin(sc, 0); - - bc->idata = 0; - bc->iempty = 0; - bc->ilow = 0; - if (port->tty->t_cflag & HUPCL) { - port->omodem &= ~(RTS|DTR); - fepcmd(port, SETMODEM, 0, DTR|RTS, 0, 1); - } - - hidewin(sc); - crit_exit(); - - callout_reset(&port->hc_timeout, hz / 2, dgm_pause, &port->brdchan); - tsleep(&port->brdchan, PCATCH, "dgclo", 0); -} - -static void -dgm_pause(void *chan) -{ - lwkt_gettoken(&tty_token); - wakeup((caddr_t)chan); - lwkt_reltoken(&tty_token); -} - -static void -dgmpoll(void *unit_c) -{ - int unit = (int)unit_c; - int pnum; - struct dgm_p *port; - struct dgm_softc *sc; - int head, tail; - u_char *eventbuf; - int event, mstat, lstat; - volatile struct board_chan *bc; - struct tty *tp; - int rhead, rtail; - int whead, wtail; - int size; - u_char *ptr; - int ocount; - int ibuf_full, obuf_full; - BoardMemWinState ws = bmws_get(); - - lwkt_gettoken(&tty_token); - sc = devclass_get_softc(dgmdevclass, unit); - DPRINT2(DB_INFO, "dgm%d: poll\n", sc->unit); - - if (!sc->enabled) { - kprintf("dgm%d: polling of disabled board stopped\n", unit); - lwkt_reltoken(&tty_token); - return; - } - - setwin(sc, 0); - - head = sc->mailbox->ein; - tail = sc->mailbox->eout; - - while (head != tail) { - if (head >= FEP_IMAX - FEP_ISTART - || tail >= FEP_IMAX - FEP_ISTART - || (head|tail) & 03 ) { - kprintf("dgm%d: event queue's head or tail is wrong!" - " hd = %d, tl = %d\n", unit, head, tail); - break; - } - - eventbuf = sc->vmem + tail + FEP_ISTART; - pnum = eventbuf[0]; - event = eventbuf[1]; - mstat = eventbuf[2]; - lstat = eventbuf[3]; - - port = &sc->ports[pnum]; - bc = port->brdchan; - tp = &sc->ttys[pnum]; - - if (pnum >= sc->numports || !port->enabled) { - kprintf("dgm%d: port%d: got event on nonexisting port\n", - unit, pnum); - } else if (port->used || port->wopeners > 0 ) { - - int wrapmask = port->rxbufsize - 1; - - if (!(event & ALL_IND)) - kprintf("dgm%d: port%d: ? event 0x%x mstat 0x%x lstat 0x%x\n", - unit, pnum, event, mstat, lstat); - - if (event & DATA_IND) { - DPRINT3(DB_DATA, "dgm%d: port%d: DATA_IND\n", - unit, pnum); - - rhead = bc->rin & wrapmask; - rtail = bc->rout & wrapmask; - - if (!(tp->t_cflag & CREAD) || !port->used ) { - bc->rout = rhead; - goto end_of_data; - } - - if (bc->orun) { - kprintf("dgm%d: port%d: overrun\n", unit, pnum); - bc->orun = 0; - } - - if (!(tp->t_state & TS_ISOPEN)) - goto end_of_data; - - for (ibuf_full = FALSE; rhead != rtail && !ibuf_full;) { - DPRINT5(DB_RXDATA, "dgm%d: port%d:" - " p rx head = %d tail = %d\n", unit, - pnum, rhead, rtail); - - if (rhead > rtail) - size = rhead - rtail; - else - size = port->rxbufsize - rtail; - - ptr = port->rxptr + rtail; - -/* Helg: */ - if (tp->t_rawq.c_cc + size > DGB_IBUFSIZE ) { - size = DGB_IBUFSIZE - tp->t_rawq.c_cc; - DPRINT1(DB_RXDATA, "*"); - ibuf_full = TRUE; - } - - if (size) { - if (tp->t_state & TS_CAN_BYPASS_L_RINT) { - DPRINT1(DB_RXDATA, "!"); - towin(sc, port->rxwin); - tk_nin += size; - tk_rawcc += size; - tp->t_rawcc += size; - b_to_q(ptr, size, - &tp->t_rawq); - setwin(sc, 0); - } else { - int i = size; - unsigned char chr; - do { - towin(sc, port->rxwin); - chr = *ptr++; - hidewin(sc); - (*linesw[tp->t_line].l_rint)(chr, tp); - } while (--i > 0 ); - setwin(sc, 0); - } - } - rtail= (rtail + size) & wrapmask; - bc->rout = rtail; - rhead = bc->rin & wrapmask; - hidewin(sc); - ttwakeup(tp); - setwin(sc, 0); - } - end_of_data: ; - } - - if (event & MODEMCHG_IND) { - DPRINT3(DB_MODEM, "dgm%d: port%d: " - "MODEMCHG_IND\n", unit, pnum); - port->imodem = mstat; - if (mstat & port->dcd) { - hidewin(sc); - linesw[tp->t_line].l_modem(tp, 1); - setwin(sc, 0); - wakeup(TSA_CARR_ON(tp)); - } else { - hidewin(sc); - linesw[tp->t_line].l_modem(tp, 0); - setwin(sc, 0); - if (port->draining) { - port->draining = 0; - wakeup(&port->draining); - } - } - } - - if (event & BREAK_IND) { - if ((tp->t_state & TS_ISOPEN) && (tp->t_iflag & IGNBRK)) { - DPRINT3(DB_BREAK, "dgm%d: port%d:" - " BREAK_IND\n", unit, pnum); - hidewin(sc); - linesw[tp->t_line].l_rint(TTY_BI, tp); - setwin(sc, 0); - } - } - -/* Helg: with output flow control */ - - if (event & (LOWTX_IND | EMPTYTX_IND) ) { - DPRINT3(DB_TXDATA, "dgm%d: port%d:" - " LOWTX_IND or EMPTYTX_IND\n", unit, pnum); - - if ((event & EMPTYTX_IND ) && - tp->t_outq.c_cc == 0 && port->draining) { - port->draining = 0; - wakeup(&port->draining); - bc->ilow = 0; - bc->iempty = 0; - } else { - - int wrapmask = port->txbufsize - 1; - - for (obuf_full = FALSE; - tp->t_outq.c_cc != 0 && !obuf_full; - ) { - /* add "last-minute" data to write buffer */ - if (!(tp->t_state & TS_BUSY)) { - hidewin(sc); -#ifndef TS_ASLEEP /* post 2.0.5 FreeBSD */ - ttwwakeup(tp); /* Issues KNOTE() */ -#else - if (tp->t_outq.c_cc <= tp->t_lowat) { - if (tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup(TSA_OLOWAT(tp)); - } - } -#endif - setwin(sc, 0); - } - crit_enter(); - - whead = bc->tin & wrapmask; - wtail = bc->tout & wrapmask; - - if (whead < wtail) - size = wtail - whead - 1; - else { - size = port->txbufsize - whead; - if (wtail == 0) - size--; - } - - if (size == 0) { - DPRINT5(DB_WR, "dgm: head = %d tail = %d size = %d full = %d\n", - whead, wtail, size, obuf_full); - bc->iempty = 1; - bc->ilow = 1; - obuf_full = TRUE; - crit_exit(); - break; - } - - towin(sc, port->txwin); - - ocount = q_to_b(&tp->t_outq, port->txptr + whead, size); - whead += ocount; - - setwin(sc, 0); - bc->tin = whead; - bc->tin = whead & wrapmask; - crit_exit(); - } - - if (obuf_full) { - DPRINT1(DB_WR, " +BUSY\n"); - tp->t_state |= TS_BUSY; - } else { - DPRINT1(DB_WR, " -BUSY\n"); - hidewin(sc); -#ifndef TS_ASLEEP /* post 2.0.5 FreeBSD */ - /* should clear TS_BUSY before ttwwakeup */ - if (tp->t_state & TS_BUSY) { - tp->t_state &= ~TS_BUSY; - linesw[tp->t_line].l_start(tp); - ttwwakeup(tp); - } -#else - if (tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup(TSA_OLOWAT(tp)); - } - tp->t_state &= ~TS_BUSY; -#endif - setwin(sc, 0); - } - } - } - bc->idata = 1; /* require event on incoming data */ - - } else { - bc = port->brdchan; - DPRINT4(DB_EXCEPT, "dgm%d: port%d: got event 0x%x on closed port\n", - unit, pnum, event); - bc->rout = bc->rin; - bc->idata = bc->iempty = bc->ilow = 0; - } - - tail = (tail + 4) & (FEP_IMAX - FEP_ISTART - 4); - } - - sc->mailbox->eout = tail; - bmws_set(ws); - - callout_reset(&sc->toh, hz / POLLSPERSEC, dgmpoll, unit_c); - - DPRINT2(DB_INFO, "dgm%d: poll done\n", sc->unit); - lwkt_reltoken(&tty_token); -} - -static int -dgmioctl(struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - u_long cmd = ap->a_cmd; - caddr_t data = ap->a_data; - struct dgm_softc *sc; - int unit, pnum; - struct dgm_p *port; - int mynor; - struct tty *tp; - volatile struct board_chan *bc; - int error; - int tiocm_xxx; - - lwkt_gettoken(&tty_token); -#if defined(COMPAT_43) || defined(COMPAT_SUNOS) - u_long oldcmd; - struct termios term; -#endif - - BoardMemWinState ws = bmws_get(); - - mynor = minor(dev); - unit = MINOR_TO_UNIT(mynor); - pnum = MINOR_TO_PORT(mynor); - - sc = devclass_get_softc(dgmdevclass, unit); - port = &sc->ports[pnum]; - tp = &sc->ttys[pnum]; - bc = port->brdchan; - - if (mynor & CONTROL_MASK) { - struct termios *ct; - - switch (mynor & CONTROL_MASK) { - case CONTROL_INIT_STATE: - ct = mynor & CALLOUT_MASK ? &port->it_out : &port->it_in; - break; - case CONTROL_LOCK_STATE: - ct = mynor & CALLOUT_MASK ? &port->lt_out : &port->lt_in; - break; - default: - return (ENODEV); /* /dev/nodev */ - } - switch (cmd) { - case TIOCSETA: - error = priv_check_cred(ap->a_cred, PRIV_ROOT, 0); - if (error != 0) { - lwkt_reltoken(&tty_token); - return (error); - } - *ct = *(struct termios *)data; - lwkt_reltoken(&tty_token); - return (0); - case TIOCGETA: - *(struct termios *)data = *ct; - lwkt_reltoken(&tty_token); - return (0); - case TIOCGETD: - *(int *)data = TTYDISC; - lwkt_reltoken(&tty_token); - return (0); - case TIOCGWINSZ: - bzero(data, sizeof(struct winsize)); - lwkt_reltoken(&tty_token); - return (0); - default: - lwkt_reltoken(&tty_token); - return (ENOTTY); - } - } - -#if defined(COMPAT_43) || defined(COMPAT_SUNOS) - term = tp->t_termios; - if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { - DPRINT6(DB_PARAM, "dgm%d: port%d: dgmioctl-ISNOW c = 0x%x i = 0x%x l = 0x%x\n", unit, pnum, term.c_cflag, term.c_iflag, term.c_lflag); - } - oldcmd = cmd; - error = ttsetcompat(tp, &cmd, data, &term); - if (error != 0) { - lwkt_reltoken(&tty_token); - return (error); - } - if (cmd != oldcmd) - data = (caddr_t)&term; -#endif - - if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { - int cc; - struct termios *dt = (struct termios *)data; - struct termios *lt = mynor & CALLOUT_MASK - ? &port->lt_out : &port->lt_in; - - DPRINT6(DB_PARAM, "dgm%d: port%d: dgmioctl-TOSET c = 0x%x i = 0x%x l = 0x%x\n", unit, pnum, dt->c_cflag, dt->c_iflag, dt->c_lflag); - dt->c_iflag = (tp->t_iflag & lt->c_iflag) - | (dt->c_iflag & ~lt->c_iflag); - dt->c_oflag = (tp->t_oflag & lt->c_oflag) - | (dt->c_oflag & ~lt->c_oflag); - dt->c_cflag = (tp->t_cflag & lt->c_cflag) - | (dt->c_cflag & ~lt->c_cflag); - dt->c_lflag = (tp->t_lflag & lt->c_lflag) - | (dt->c_lflag & ~lt->c_lflag); - for (cc = 0; cc < NCCS; ++cc) - if (lt->c_cc[cc] != 0) - dt->c_cc[cc] = tp->t_cc[cc]; - if (lt->c_ispeed != 0) - dt->c_ispeed = tp->t_ispeed; - if (lt->c_ospeed != 0) - dt->c_ospeed = tp->t_ospeed; - } - - if (cmd == TIOCSTOP) { - crit_enter(); - setwin(sc, 0); - fepcmd(port, PAUSETX, 0, 0, 0, 0); - bmws_set(ws); - crit_exit(); - lwkt_reltoken(&tty_token); - return 0; - } else if (cmd == TIOCSTART) { - crit_enter(); - setwin(sc, 0); - fepcmd(port, RESUMETX, 0, 0, 0, 0); - bmws_set(ws); - crit_exit(); - lwkt_reltoken(&tty_token); - return 0; - } - - if (cmd == TIOCSETAW || cmd == TIOCSETAF) - port->mustdrain = 1; - - error = linesw[tp->t_line].l_ioctl(tp, cmd, data, - ap->a_fflag, ap->a_cred); - if (error != ENOIOCTL) { - lwkt_reltoken(&tty_token); - return error; - } - crit_enter(); - error = ttioctl(tp, cmd, data, ap->a_fflag); - disc_optim(tp, &tp->t_termios); - port->mustdrain = 0; - if (error != ENOIOCTL) { - crit_exit(); - if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { - DPRINT6(DB_PARAM, "dgm%d: port%d: dgmioctl-RES c = 0x%x i = 0x%x l = 0x%x\n", unit, pnum, tp->t_cflag, tp->t_iflag, tp->t_lflag); - } - lwkt_reltoken(&tty_token); - return error; - } - - switch (cmd) { - case TIOCSBRK: -#if 0 - error = dgmdrain(port); - - if (error != 0) { - crit_exit(); - lwkt_reltoken(&tty_token); - return error; - } -#endif - - crit_enter(); - setwin(sc, 0); - - /* now it sends 400 millisecond break because I don't know */ - /* how to send an infinite break */ - - fepcmd(port, SENDBREAK, 400, 0, 10, 0); - hidewin(sc); - crit_exit(); - break; - case TIOCCBRK: - /* now it's empty */ - break; - case TIOCSDTR: - DPRINT3(DB_MODEM, "dgm%d: port%d: set DTR\n", unit, pnum); - port->omodem |= DTR; - crit_enter(); - setwin(sc, 0); - fepcmd(port, SETMODEM, port->omodem, RTS, 0, 1); - - if (!(bc->mstat & DTR)) - DPRINT3(DB_MODEM, "dgm%d: port%d: DTR is off\n", unit, pnum); - - hidewin(sc); - crit_exit(); - break; - case TIOCCDTR: - DPRINT3(DB_MODEM, "dgm%d: port%d: reset DTR\n", unit, pnum); - port->omodem &= ~DTR; - crit_enter(); - setwin(sc, 0); - fepcmd(port, SETMODEM, port->omodem, RTS|DTR, 0, 1); - - if (bc->mstat & DTR) { - DPRINT3(DB_MODEM, "dgm%d: port%d: DTR is on\n", unit, pnum); - } - - hidewin(sc); - crit_exit(); - break; - case TIOCMSET: - if (*(int *)data & TIOCM_DTR) - port->omodem |= DTR; - else - port->omodem &= ~DTR; - - if (*(int *)data & TIOCM_RTS) - port->omodem |= RTS; - else - port->omodem &= ~RTS; - - crit_enter(); - setwin(sc, 0); - fepcmd(port, SETMODEM, port->omodem, RTS|DTR, 0, 1); - hidewin(sc); - crit_exit(); - break; - case TIOCMBIS: - if (*(int *)data & TIOCM_DTR) - port->omodem |= DTR; - - if (*(int *)data & TIOCM_RTS) - port->omodem |= RTS; - - crit_enter(); - setwin(sc, 0); - fepcmd(port, SETMODEM, port->omodem, RTS|DTR, 0, 1); - hidewin(sc); - crit_exit(); - break; - case TIOCMBIC: - if (*(int *)data & TIOCM_DTR) - port->omodem &= ~DTR; - - if (*(int *)data & TIOCM_RTS) - port->omodem &= ~RTS; - - crit_enter(); - setwin(sc, 0); - fepcmd(port, SETMODEM, port->omodem, RTS|DTR, 0, 1); - hidewin(sc); - crit_exit(); - break; - case TIOCMGET: - setwin(sc, 0); - port->imodem = bc->mstat; - hidewin(sc); - - tiocm_xxx = TIOCM_LE; /* XXX - always enabled while open */ - - DPRINT3(DB_MODEM, "dgm%d: port%d: modem stat -- ", unit, pnum); - - if (port->imodem & DTR) { - DPRINT1(DB_MODEM, "DTR "); - tiocm_xxx |= TIOCM_DTR; - } - if (port->imodem & RTS) { - DPRINT1(DB_MODEM, "RTS "); - tiocm_xxx |= TIOCM_RTS; - } - if (port->imodem & CTS) { - DPRINT1(DB_MODEM, "CTS "); - tiocm_xxx |= TIOCM_CTS; - } - if (port->imodem & port->dcd) { - DPRINT1(DB_MODEM, "DCD "); - tiocm_xxx |= TIOCM_CD; - } - if (port->imodem & port->dsr) { - DPRINT1(DB_MODEM, "DSR "); - tiocm_xxx |= TIOCM_DSR; - } - if (port->imodem & RI) { - DPRINT1(DB_MODEM, "RI "); - tiocm_xxx |= TIOCM_RI; - } - *(int *)data = tiocm_xxx; - DPRINT1(DB_MODEM, "--\n"); - break; - case TIOCMSDTRWAIT: - /* must be root since the wait applies to following logins */ - error = priv_check_cred(ap->a_cred, PRIV_ROOT, 0); - if (error != 0) { - crit_exit(); - lwkt_reltoken(&tty_token); - return (error); - } - port->close_delay = *(int *)data * hz / 100; - break; - case TIOCMGDTRWAIT: - *(int *)data = port->close_delay * 100 / hz; - break; - case TIOCTIMESTAMP: - port->do_timestamp = 1; - *(struct timeval *)data = port->timestamp; - break; - case TIOCDCDTIMESTAMP: - port->do_dcd_timestamp = 1; - *(struct timeval *)data = port->dcd_timestamp; - break; - default: - bmws_set(ws); - crit_exit(); - lwkt_reltoken(&tty_token); - return ENOTTY; - } - bmws_set(ws); - crit_exit(); - - lwkt_reltoken(&tty_token); - return 0; -} - -static void -wakeflush(void *p) -{ - struct dgm_p *port = p; - - lwkt_gettoken(&tty_token); - wakeup(&port->draining); - lwkt_reltoken(&tty_token); -} - -/* wait for the output to drain */ -/* - * NOTE: Must be called with tty_token held - */ -static int -dgmdrain(struct dgm_p *port) -{ - volatile struct board_chan *bc = port->brdchan; - struct dgm_softc *sc; - int error; - int head, tail; - BoardMemWinState ws = bmws_get(); - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - sc = devclass_get_softc(dgmdevclass, port->sc->unit); - - setwin(sc, 0); - - bc->iempty = 1; - tail = bc->tout; - head = bc->tin; - - while (tail != head) { - DPRINT5(DB_WR, "dgm%d: port%d: drain: head = %d tail = %d\n", - port->sc->unit, port->pnum, head, tail); - - hidewin(sc); - port->draining = 1; - callout_reset(&port->wf_timeout, hz, wakeflush, port); - error = tsleep(&port->draining, PCATCH, "dgdrn", 0); - port->draining = 0; - setwin(sc, 0); - - if (error != 0) { - DPRINT4(DB_WR, "dgm%d: port%d: tsleep(dgdrn) error = %d\n", - port->sc->unit, port->pnum, error); - - bc->iempty = 0; - bmws_set(ws); - return error; - } - - tail = bc->tout; - head = bc->tin; - } - DPRINT5(DB_WR, "dgm%d: port%d: drain: head = %d tail = %d\n", - port->sc->unit, port->pnum, head, tail); - bmws_set(ws); - return 0; -} - -/* wait for the output to drain */ -/* or simply clear the buffer it it's stopped */ -/* - * NOTE: Must be called with tty_token held - */ -static void -dgm_drain_or_flush(struct dgm_p *port) -{ - volatile struct board_chan *bc = port->brdchan; - struct tty *tp = port->tty; - struct dgm_softc *sc; - int error; - int lasttail; - int head, tail; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - sc = devclass_get_softc(dgmdevclass, port->sc->unit); - setwin(sc, 0); - - lasttail = -1; - bc->iempty = 1; - tail = bc->tout; - head = bc->tin; - - while (tail != head /* && tail != lasttail */ ) { - DPRINT5(DB_WR, "dgm%d: port%d: flush: head = %d tail = %d\n", - port->sc->unit, port->pnum, head, tail); - - /* if there is no carrier simply clean the buffer */ - if (!(tp->t_state & TS_CARR_ON)) { - bc->tout = bc->tin = 0; - bc->iempty = 0; - hidewin(sc); - return; - } - - hidewin(sc); - port->draining = 1; - callout_reset(&port->wf_timeout, hz, wakeflush, port); - error = tsleep(&port->draining, PCATCH, "dgfls", 0); - port->draining = 0; - setwin(sc, 0); - - if (error != 0) { - DPRINT4(DB_WR, "dgm%d: port%d: tsleep(dgfls)" - " error = %d\n", port->sc->unit, port->pnum, error); - - /* silently clean the buffer */ - - bc->tout = bc->tin = 0; - bc->iempty = 0; - hidewin(sc); - return; - } - - lasttail = tail; - tail = bc->tout; - head = bc->tin; - } - hidewin(sc); - DPRINT5(DB_WR, "dgm%d: port%d: flush: head = %d tail = %d\n", - port->sc->unit, port->pnum, head, tail); -} - -static int -dgmparam(struct tty *tp, struct termios *t) -{ - int unit = MINOR_TO_UNIT(minor(tp->t_dev)); - int pnum = MINOR_TO_PORT(minor(tp->t_dev)); - volatile struct board_chan *bc; - struct dgm_softc *sc; - struct dgm_p *port; - int cflag; - int head; - int mval; - int iflag; - int hflow; - BoardMemWinState ws = bmws_get(); - - lwkt_gettoken(&tty_token); - sc = devclass_get_softc(dgmdevclass, unit); - port = &sc->ports[pnum]; - bc = port->brdchan; - - DPRINT6(DB_PARAM, "dgm%d: port%d: dgmparm c = 0x%x i = 0x%x l = 0x%x\n", unit, pnum, t->c_cflag, t->c_iflag, t->c_lflag); - - if (port->mustdrain) { - DPRINT3(DB_PARAM, "dgm%d: port%d: must call dgmdrain()\n", unit, pnum); - dgmdrain(port); - } - - cflag = ttspeedtab(t->c_ospeed, dgmspeedtab); - - if (t->c_ispeed == 0) - t->c_ispeed = t->c_ospeed; - - if (cflag < 0 /* || cflag > 0 && t->c_ispeed != t->c_ospeed */) { - DPRINT4(DB_PARAM, "dgm%d: port%d: invalid cflag = 0%o\n", unit, pnum, cflag); - lwkt_reltoken(&tty_token); - return (EINVAL); - } - - crit_enter(); - setwin(sc, 0); - - if (cflag == 0) { /* hangup */ - DPRINT3(DB_PARAM, "dgm%d: port%d: hangup\n", unit, pnum); - head = bc->rin; - bc->rout = head; - head = bc->tin; - fepcmd(port, STOUT, (unsigned)head, 0, 0, 0); - mval= port->omodem & ~(DTR|RTS); - } else { - cflag |= dgmflags(dgm_cflags, t->c_cflag); - - if (cflag != port->fepcflag) { - port->fepcflag = cflag; - DPRINT5(DB_PARAM, "dgm%d: port%d: set cflag = 0x%x c = 0x%x\n", - unit, pnum, cflag, t->c_cflag&~CRTSCTS); - fepcmd(port, SETCTRLFLAGS, (unsigned)cflag, 0, 0, 0); - } - mval= port->omodem | (DTR|RTS); - } - - iflag = dgmflags(dgm_iflags, t->c_iflag); - if (iflag != port->fepiflag) { - port->fepiflag = iflag; - DPRINT5(DB_PARAM, "dgm%d: port%d: set iflag = 0x%x c = 0x%x\n", unit, pnum, iflag, t->c_iflag); - fepcmd(port, SETIFLAGS, (unsigned)iflag, 0, 0, 0); - } - - bc->mint = port->dcd; - - hflow = dgmflags(dgm_flow, t->c_cflag); - if (hflow != port->hflow) { - port->hflow = hflow; - DPRINT5(DB_PARAM, "dgm%d: port%d: set hflow = 0x%x f = 0x%x\n", unit, pnum, hflow, t->c_cflag&CRTSCTS); - fepcmd(port, SETHFLOW, (unsigned)hflow, 0xff, 0, 1); - } - - if (port->omodem != mval) { - DPRINT5(DB_PARAM, "dgm%d: port%d: setting modem parameters 0x%x was 0x%x\n", - unit, pnum, mval, port->omodem); - port->omodem = mval; - fepcmd(port, SETMODEM, (unsigned)mval, RTS|DTR, 0, 1); - } - - if (port->fepstartc != t->c_cc[VSTART] || - port->fepstopc != t->c_cc[VSTOP]) { - DPRINT5(DB_PARAM, "dgm%d: port%d: set startc = %d, stopc = %d\n", unit, pnum, t->c_cc[VSTART], t->c_cc[VSTOP]); - port->fepstartc = t->c_cc[VSTART]; - port->fepstopc = t->c_cc[VSTOP]; - fepcmd(port, SONOFFC, port->fepstartc, port->fepstopc, 0, 1); - } - - bmws_set(ws); - crit_exit(); - - lwkt_reltoken(&tty_token); - return 0; - -} - -static void -dgmstart(struct tty *tp) -{ - int unit; - int pnum; - struct dgm_p *port; - struct dgm_softc *sc; - volatile struct board_chan *bc; - int head, tail; - int size, ocount; - int wmask; - - lwkt_gettoken(&tty_token); - BoardMemWinState ws = bmws_get(); - - unit = MINOR_TO_UNIT(minor(tp->t_dev)); - pnum = MINOR_TO_PORT(minor(tp->t_dev)); - sc = devclass_get_softc(dgmdevclass, unit); - port = &sc->ports[pnum]; - bc = port->brdchan; - - wmask = port->txbufsize - 1; - - crit_enter(); - - while (tp->t_outq.c_cc != 0) { -#ifndef TS_ASLEEP /* post 2.0.5 FreeBSD */ - ttwwakeup(tp); /* Issues KNOTE() */ -#else - if (tp->t_outq.c_cc <= tp->t_lowat) { - if (tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup(TSA_OLOWAT(tp)); - } - } -#endif - crit_enter(); - setwin(sc, 0); - - head = bc->tin & wmask; - - do { tail = bc->tout; } while (tail != bc->tout); - tail = bc->tout & wmask; - - DPRINT5(DB_WR, "dgm%d: port%d: s tx head = %d tail = %d\n", unit, pnum, head, tail); - -#ifdef LEAVE_FREE_CHARS - if (tail > head) { - size = tail - head - LEAVE_FREE_CHARS; - if (size < 0) - size = 0; - else { - size = port->txbufsize - head; - if (tail + port->txbufsize < head) - size = 0; - } - } -#else - if (tail > head) - size = tail - head - 1; - else { - size = port->txbufsize - head; - if (tail == 0) - size--; - } -#endif - - if (size == 0) { - bc->iempty = 1; - bc->ilow = 1; - crit_exit(); - bmws_set(ws); - tp->t_state |= TS_BUSY; - crit_exit(); - lwkt_reltoken(&tty_token); - return; - } - - towin(sc, port->txwin); - - ocount = q_to_b(&tp->t_outq, port->txptr + head, size); - head += ocount; - if (head >= port->txbufsize) - head -= port->txbufsize; - - setwin(sc, 0); - bc->tin = head; - - DPRINT5(DB_WR, "dgm%d: port%d: tx avail = %d count = %d\n", - unit, pnum, size, ocount); - hidewin(sc); - crit_exit(); - } - - bmws_set(ws); - crit_exit(); - -#ifndef TS_ASLEEP /* post 2.0.5 FreeBSD */ - if (tp->t_state & TS_BUSY) { - tp->t_state &= ~TS_BUSY; - linesw[tp->t_line].l_start(tp); - ttwwakeup(tp); - } -#else - if (tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup(TSA_OLOWAT(tp)); - } - tp->t_state& = ~TS_BUSY; -#endif - lwkt_reltoken(&tty_token); -} - -void -dgmstop(struct tty *tp, int rw) -{ - int unit; - int pnum; - struct dgm_p *port; - struct dgm_softc *sc; - volatile struct board_chan *bc; - - lwkt_gettoken(&tty_token); - BoardMemWinState ws = bmws_get(); - - unit = MINOR_TO_UNIT(minor(tp->t_dev)); - pnum = MINOR_TO_PORT(minor(tp->t_dev)); - - sc = devclass_get_softc(dgmdevclass, unit); - port = &sc->ports[pnum]; - bc = port->brdchan; - - DPRINT3(DB_WR, "dgm%d: port%d: stop\n", port->sc->unit, port->pnum); - - crit_enter(); - setwin(sc, 0); - - if (rw & FWRITE) { - /* clear output queue */ - bc->tout = bc->tin = 0; - bc->ilow = 0; - bc->iempty = 0; - } - if (rw & FREAD) { - /* clear input queue */ - bc->rout = bc->rin; - bc->idata = 1; - } - hidewin(sc); - bmws_set(ws); - crit_exit(); - dgmstart(tp); - lwkt_reltoken(&tty_token); -} - -/* - * NOTE: Must be called with tty_token held - */ -static void -fepcmd(struct dgm_p *port, - unsigned cmd, - unsigned op1, - unsigned op2, - unsigned ncmds, - unsigned bytecmd) -{ - u_char *mem; - unsigned tail, head; - int count, n; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - KASSERT(port->sc, ("Couldn't (re)obtain driver softc")); - mem = port->sc->vmem; - - if (!port->enabled) { - kprintf("dgm%d: port%d: FEP command on disabled port\n", - port->sc->unit, port->pnum); - return; - } - - /* setwin(port->sc, 0); Require this to be set by caller */ - head = port->sc->mailbox->cin; - - if (head >= FEP_CMAX - FEP_CSTART || (head & 3)) { - kprintf("dgm%d: port%d: wrong pointer head of command queue : 0x%x\n", - port->sc->unit, port->pnum, head); - return; - } - - mem[head + FEP_CSTART] = cmd; - mem[head + FEP_CSTART + 1] = port->pnum; - if (bytecmd) { - mem[head + FEP_CSTART + 2] = op1; - mem[head + FEP_CSTART + 3] = op2; - } else { - mem[head + FEP_CSTART + 2] = op1 & 0xff; - mem[head + FEP_CSTART + 3] = (op1 >> 8) & 0xff; - } - - DPRINT7(DB_FEP, "dgm%d: port%d: %s cmd = 0x%x op1 = 0x%x op2 = 0x%x\n", port->sc->unit, port->pnum, - (bytecmd)?"byte":"word", cmd, mem[head + FEP_CSTART + 2], mem[head + FEP_CSTART + 3]); - - head = (head + 4) & (FEP_CMAX - FEP_CSTART - 4); - port->sc->mailbox->cin = head; - - count = FEPTIMEOUT; - - while (count-- != 0) { - head = port->sc->mailbox->cin; - tail = port->sc->mailbox->cout; - - n = (head - tail) & (FEP_CMAX - FEP_CSTART - 4); - if (n <= ncmds * (sizeof(ushort)*4)) - return; - } - kprintf("dgm%d(%d): timeout on FEP cmd = 0x%x\n", port->sc->unit, port->pnum, cmd); -} - -static void -disc_optim(struct tty *tp, struct termios *t) -{ - lwkt_gettoken(&tty_token); - if (!(t->c_iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP | IXON)) - && (!(t->c_iflag & BRKINT) || (t->c_iflag & IGNBRK)) - && (!(t->c_iflag & PARMRK) - || (t->c_iflag & (IGNPAR | IGNBRK)) == (IGNPAR | IGNBRK)) - && !(t->c_lflag & (ECHO | ICANON | IEXTEN | ISIG | PENDIN)) - && linesw[tp->t_line].l_rint == ttyinput) - tp->t_state |= TS_CAN_BYPASS_L_RINT; - else - tp->t_state &= ~TS_CAN_BYPASS_L_RINT; - lwkt_reltoken(&tty_token); -} diff --git a/sys/dev/serial/dgb/dgmbios.h b/sys/dev/serial/dgb/dgmbios.h deleted file mode 100644 index acbab4bd0e..0000000000 --- a/sys/dev/serial/dgb/dgmbios.h +++ /dev/null @@ -1,2510 +0,0 @@ -/* - * $FreeBSD: src/sys/dev/dgb/dgmbios.h,v 1.4.2.1 2001/09/23 19:54:53 brian Exp $ - * $DragonFly: src/sys/dev/serial/dgb/dgmbios.h,v 1.2 2003/06/17 04:28:23 dillon Exp $ - * - * This file is an ascii copy of the file sxbios.bin included in the - * Digiboard PC/Xem driver for Linux. It is copyright 1992, DIGI - * International. All Rights Reserved. - */ - -static unsigned char pcem_bios[] = { - 0x4f,0x53,0x75,0xd5,0x4e,0x00,0x00,0x10,0xad,0x00,0x1e,0x24, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x9c,0x72,0xb2,0xa8,0x00,0x00,0x00,0x00,0x40,0x28,0x23,0x29, - 0x73,0x78,0x62,0x69,0x6f,0x73,0x2e,0x62,0x69,0x6e,0x20,0x20, - 0x20,0x20,0x32,0x2e,0x31,0x20,0x30,0x38,0x2f,0x31,0x37,0x2f, - 0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x43,0x6f,0x70,0x79,0x72, - 0x69,0x67,0x68,0x74,0x20,0x28,0x43,0x29,0x20,0x31,0x39,0x39, - 0x32,0x2c,0x20,0x44,0x49,0x47,0x49,0x20,0x49,0x6e,0x74,0x65, - 0x72,0x6e,0x61,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x2e,0x20,0x41, - 0x6c,0x6c,0x20,0x52,0x69,0x67,0x68,0x74,0x73,0x20,0x52,0x65, - 0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x00,0x43,0x50,0x55,0x20, - 0x64,0x6f,0x65,0x73,0x6e,0x27,0x74,0x20,0x77,0x6f,0x72,0x6b, - 0x5b,0x00,0x1e,0x24,0x00,0x83,0x01,0x3c,0x00,0xa3,0x04,0x3c, - 0x10,0x00,0x3e,0xac,0x80,0x01,0x84,0x34,0x0c,0x00,0x88,0x8c, - 0xff,0x03,0x05,0x24,0x01,0x00,0x08,0x35,0x0c,0x00,0x88,0xac, - 0x01,0xa0,0x04,0x3c,0x80,0x80,0x84,0x24,0x24,0x20,0x85,0x00, - 0x00,0xa3,0x05,0x3c,0x00,0x10,0xa5,0x34,0x21,0x20,0x85,0x00, - 0x00,0x00,0x1e,0x24,0x67,0x00,0x05,0x24,0x00,0xa3,0x09,0x3c, - 0x10,0x00,0x08,0x24,0x00,0x02,0x29,0x25,0x00,0x00,0x8a,0x80, - 0x00,0x00,0x00,0x00,0x02,0x00,0x40,0x11,0x00,0x00,0x2a,0xa1, - 0x01,0x00,0x84,0x24,0xff,0xff,0x08,0x25,0xf9,0xff,0x00,0x1d, - 0x01,0x00,0x29,0x25,0x00,0xa3,0x01,0x3c,0x10,0x02,0x25,0xac, - 0x00,0xa3,0x01,0x3c,0x14,0x02,0x3f,0xac,0x00,0xa3,0x01,0x3c, - 0x18,0x02,0x3d,0xac,0x01,0x00,0x08,0x24,0x00,0xa3,0x01,0x3c, - 0x00,0xa3,0x1d,0x3c,0x10,0x0c,0x28,0xac,0x00,0x04,0xbd,0x27, - 0x14,0x28,0x00,0x0c,0x00,0x00,0x00,0x00,0xfd,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0xad,0x00,0x1e,0x24,0x00,0x83,0x01,0x3c, - 0x10,0x00,0x3e,0xac,0x00,0xa3,0x05,0x3c,0x00,0x00,0x1e,0x24, - 0x00,0xa3,0x04,0x3c,0x00,0x10,0xa5,0x34,0x04,0x00,0x84,0x24, - 0xfe,0xff,0x85,0x14,0xfc,0xff,0x80,0xac,0xb8,0x00,0x1e,0x24, - 0x00,0x83,0x01,0x3c,0x10,0x00,0x3e,0xac,0xff,0xff,0x08,0x24, - 0xb4,0x00,0x00,0x11,0x00,0x00,0x1e,0x24,0x01,0x00,0x08,0x25, - 0xb1,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0xff,0xff,0x08,0x24, - 0x21,0x08,0x00,0x01,0xad,0x00,0x28,0x14,0x01,0x00,0x21,0x24, - 0xab,0x00,0x20,0x14,0x00,0x00,0x00,0x00,0xff,0xff,0x02,0x24, - 0xa8,0x00,0x48,0x14,0x00,0x00,0x00,0x00,0x01,0x00,0x42,0x24, - 0xa5,0x00,0x40,0x14,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x24, - 0xa2,0x00,0x68,0x14,0x00,0x00,0x00,0x00,0x01,0x00,0x63,0x24, - 0x9f,0x00,0x60,0x14,0x00,0x00,0x00,0x00,0xff,0xff,0x04,0x24, - 0x9c,0x00,0x88,0x14,0x00,0x00,0x00,0x00,0x01,0x00,0x84,0x24, - 0x99,0x00,0x80,0x14,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x24, - 0x96,0x00,0xa8,0x14,0x00,0x00,0x00,0x00,0x01,0x00,0xa5,0x24, - 0x93,0x00,0xa0,0x14,0x00,0x00,0x00,0x00,0xff,0xff,0x06,0x24, - 0x90,0x00,0xc8,0x14,0x00,0x00,0x00,0x00,0x01,0x00,0xc6,0x24, - 0x8d,0x00,0xc0,0x14,0x00,0x00,0x00,0x00,0xff,0xff,0x07,0x24, - 0x8a,0x00,0xe8,0x14,0x00,0x00,0x00,0x00,0x01,0x00,0xe7,0x24, - 0x87,0x00,0xe0,0x14,0x00,0x00,0x00,0x00,0xff,0xff,0x09,0x24, - 0x84,0x00,0x28,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0x29,0x25, - 0x81,0x00,0x20,0x15,0x00,0x00,0x00,0x00,0xff,0xff,0x0a,0x24, - 0x7e,0x00,0x48,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0x4a,0x25, - 0x7b,0x00,0x40,0x15,0x00,0x00,0x00,0x00,0xff,0xff,0x0b,0x24, - 0x78,0x00,0x68,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0x6b,0x25, - 0x75,0x00,0x60,0x15,0x00,0x00,0x00,0x00,0xff,0xff,0x0c,0x24, - 0x72,0x00,0x88,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0x8c,0x25, - 0x6f,0x00,0x80,0x15,0x00,0x00,0x00,0x00,0xff,0xff,0x0d,0x24, - 0x6c,0x00,0xa8,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0xad,0x25, - 0x69,0x00,0xa0,0x15,0x00,0x00,0x00,0x00,0xff,0xff,0x0e,0x24, - 0x66,0x00,0xc8,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0xce,0x25, - 0x63,0x00,0xc0,0x15,0x00,0x00,0x00,0x00,0xff,0xff,0x0f,0x24, - 0x60,0x00,0xe8,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0xef,0x25, - 0x5d,0x00,0xe0,0x15,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0x24, - 0x5a,0x00,0x08,0x17,0x00,0x00,0x00,0x00,0x01,0x00,0x18,0x27, - 0x57,0x00,0x00,0x17,0x00,0x00,0x00,0x00,0xff,0xff,0x10,0x24, - 0x54,0x00,0x08,0x16,0x00,0x00,0x00,0x00,0x01,0x00,0x10,0x26, - 0x51,0x00,0x00,0x16,0x00,0x00,0x00,0x00,0xff,0xff,0x11,0x24, - 0x4e,0x00,0x28,0x16,0x00,0x00,0x00,0x00,0x01,0x00,0x31,0x26, - 0x4b,0x00,0x20,0x16,0x00,0x00,0x00,0x00,0xff,0xff,0x12,0x24, - 0x48,0x00,0x48,0x16,0x00,0x00,0x00,0x00,0x01,0x00,0x52,0x26, - 0x45,0x00,0x40,0x16,0x00,0x00,0x00,0x00,0xff,0xff,0x13,0x24, - 0x42,0x00,0x68,0x16,0x00,0x00,0x00,0x00,0x01,0x00,0x73,0x26, - 0x3f,0x00,0x60,0x16,0x00,0x00,0x00,0x00,0xff,0xff,0x14,0x24, - 0x3c,0x00,0x88,0x16,0x00,0x00,0x00,0x00,0x01,0x00,0x94,0x26, - 0x39,0x00,0x80,0x16,0x00,0x00,0x00,0x00,0xff,0xff,0x15,0x24, - 0x36,0x00,0xa8,0x16,0x00,0x00,0x00,0x00,0x01,0x00,0xb5,0x26, - 0x33,0x00,0xa0,0x16,0x00,0x00,0x00,0x00,0xff,0xff,0x16,0x24, - 0x30,0x00,0xc8,0x16,0x00,0x00,0x00,0x00,0x01,0x00,0xd6,0x26, - 0x2d,0x00,0xc0,0x16,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x24, - 0x2a,0x00,0xe8,0x16,0x00,0x00,0x00,0x00,0x01,0x00,0xf7,0x26, - 0x27,0x00,0xe0,0x16,0x00,0x00,0x00,0x00,0xff,0xff,0x1a,0x24, - 0x24,0x00,0x48,0x17,0x00,0x00,0x00,0x00,0x01,0x00,0x5a,0x27, - 0x21,0x00,0x40,0x17,0x00,0x00,0x00,0x00,0xff,0xff,0x1b,0x24, - 0x1e,0x00,0x68,0x17,0x00,0x00,0x00,0x00,0x01,0x00,0x7b,0x27, - 0x1b,0x00,0x60,0x17,0x00,0x00,0x00,0x00,0xff,0xff,0x1c,0x24, - 0x18,0x00,0x88,0x17,0x00,0x00,0x00,0x00,0x01,0x00,0x9c,0x27, - 0x15,0x00,0x80,0x17,0x00,0x00,0x00,0x00,0xff,0xff,0x1d,0x24, - 0x12,0x00,0xa8,0x17,0x00,0x00,0x00,0x00,0x01,0x00,0xbd,0x27, - 0x0f,0x00,0xa0,0x17,0x00,0x00,0x00,0x00,0xff,0xff,0x1e,0x24, - 0x0c,0x00,0xc8,0x17,0x00,0x00,0x00,0x00,0x01,0x00,0xde,0x27, - 0x09,0x00,0xc0,0x17,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0x24, - 0x06,0x00,0xe8,0x17,0x00,0x00,0x00,0x00,0x01,0x00,0xff,0x27, - 0x03,0x00,0xe0,0x17,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x10, - 0x6b,0x01,0x1e,0x24,0x01,0xa0,0x04,0x3c,0x90,0x80,0x84,0x24, - 0xff,0x03,0x05,0x24,0x24,0x20,0x85,0x00,0x00,0xa3,0x05,0x3c, - 0x5b,0x01,0x1e,0x24,0x00,0x83,0x01,0x3c,0x00,0x10,0xa5,0x34, - 0x10,0x00,0x3e,0xac,0x21,0x20,0x85,0x00,0x08,0x00,0x80,0x00, - 0x00,0x00,0x1e,0x24,0x6b,0x01,0x1e,0x24,0x00,0x83,0x01,0x3c, - 0x10,0x00,0x3e,0xac,0x00,0x00,0x1e,0x24,0x00,0x10,0x08,0x3c, - 0x00,0x60,0x88,0x40,0x74,0x01,0x1e,0x24,0x00,0x83,0x01,0x3c, - 0x01,0xa0,0x1c,0x3c,0x10,0x00,0x3e,0xac,0x90,0x5d,0x9c,0x27, - 0x00,0x00,0x1e,0x24,0x01,0x00,0x11,0x04,0x00,0x00,0x00,0x00, - 0x01,0xa0,0x04,0x3c,0x8f,0x01,0x1e,0x24,0x00,0x83,0x01,0x3c, - 0x01,0xa0,0x06,0x3c,0xb0,0x84,0x84,0x24,0x10,0x00,0x3e,0xac, - 0x01,0xa0,0x05,0x3c,0x70,0xf1,0xc6,0x24,0x23,0x20,0xe4,0x03, - 0x00,0x00,0x1e,0x24,0x00,0x80,0xa5,0x24,0x21,0x20,0x86,0x00, - 0xfc,0xff,0x88,0x8c,0xfc,0xff,0xc6,0x24,0x2b,0x08,0xa6,0x00, - 0xfc,0xff,0x84,0x24,0xfb,0xff,0x20,0x14,0x00,0x00,0xc8,0xac, - 0x9f,0x01,0x1e,0x24,0x00,0x83,0x01,0x3c,0x10,0x00,0x3e,0xac, - 0x00,0x00,0x1e,0x24,0xaa,0x01,0x1e,0x24,0x00,0x83,0x01,0x3c, - 0x10,0x00,0x3e,0xac,0x01,0xa0,0x04,0x3c,0x00,0x86,0x84,0x24, - 0x00,0xa0,0x01,0x3c,0x01,0xa0,0x1f,0x3c,0x25,0x20,0x81,0x00, - 0x00,0x00,0x1e,0x24,0x08,0x00,0x80,0x00,0x34,0x85,0xff,0x27, - 0x00,0xa0,0x0b,0x3c,0xb5,0x01,0x1e,0x24,0x00,0x83,0x01,0x3c, - 0x01,0xa0,0x09,0x3c,0x01,0xa0,0x0a,0x3c,0x00,0x80,0x6b,0x35, - 0x10,0x00,0x3e,0xac,0x00,0xa0,0x08,0x3c,0x88,0x85,0x29,0x25, - 0xd8,0x85,0x4a,0x25,0x00,0x00,0x1e,0x24,0x80,0x00,0x08,0x35, - 0x25,0x48,0x2b,0x01,0x25,0x50,0x4b,0x01,0x00,0x00,0x2b,0x8d, - 0x04,0x00,0x29,0x25,0x04,0x00,0x08,0x25,0xfc,0xff,0x2a,0x15, - 0xfc,0xff,0x0b,0xad,0x16,0x00,0x00,0x10,0xfc,0x01,0x1e,0x24, - 0x00,0xa3,0x1a,0x3c,0x80,0x01,0x5a,0x37,0x00,0x00,0x00,0x00, - 0x00,0x00,0x40,0xaf,0x00,0x00,0x00,0x00,0x00,0x60,0x1a,0x40, - 0x00,0x00,0x00,0x00,0xff,0xff,0x1b,0x3c,0xfe,0x00,0x7b,0x37, - 0x00,0x00,0x00,0x00,0x24,0xd0,0x5b,0x03,0x00,0x00,0x00,0x00, - 0x00,0x60,0x9a,0x40,0x00,0x00,0x00,0x00,0x00,0x70,0x1a,0x40, - 0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x42,0x00,0x00,0x00,0x00, - 0x08,0x00,0x40,0x03,0x00,0x00,0x00,0x00,0xfc,0x01,0x1e,0x24, - 0x00,0x83,0x01,0x3c,0x10,0x00,0x3e,0xac,0x00,0x00,0x1e,0x24, - 0x83,0x23,0x00,0x0c,0xc8,0x97,0x9d,0x27,0x4f,0x20,0x00,0x08, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x01,0xa0,0x08,0x3c,0x18,0x86,0x08,0x25,0x00,0xa0,0x01,0x3c, - 0x25,0x40,0x01,0x01,0x08,0x00,0x00,0x01,0x00,0x00,0x00,0x00, - 0x00,0x60,0x04,0x40,0x00,0x00,0x00,0x00,0x01,0x00,0x05,0x3c, - 0x00,0x60,0x85,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0xa0,0x09,0x3c,0x01,0x00,0x01,0x3c,0x23,0x40,0x21,0x01, - 0x03,0x00,0x00,0xa1,0x04,0x00,0x08,0x25,0xfd,0xff,0x09,0x15, - 0x00,0x00,0x00,0x00,0x03,0x00,0x05,0x3c,0x00,0x60,0x85,0x40, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x09,0x3c, - 0x01,0x00,0x01,0x3c,0x23,0x40,0x21,0x01,0x03,0x00,0x00,0xa1, - 0x04,0x00,0x08,0x25,0xfd,0xff,0x09,0x15,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x84,0x40, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x04,0x40, - 0xff,0xff,0x08,0x3c,0xff,0x3f,0x08,0x35,0x24,0x20,0x88,0x00, - 0x00,0x10,0x84,0x40,0x01,0xa0,0x08,0x3c,0xfc,0xff,0x01,0x24, - 0x01,0xa0,0x09,0x3c,0x70,0xf1,0x08,0x25,0x60,0xf5,0x29,0x25, - 0x24,0x40,0x01,0x01,0x24,0x48,0x21,0x01,0x04,0x00,0x08,0x25, - 0xfe,0xff,0x09,0x15,0xfc,0xff,0x00,0xad,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0x00,0x60,0x02,0x40,0xff,0xff,0x01,0x3c, - 0xfe,0x00,0x21,0x34,0x25,0x20,0x81,0x00,0x24,0x40,0x44,0x00, - 0x00,0x60,0x88,0x40,0x08,0x00,0xe0,0x03,0x01,0xff,0x42,0x30, - 0x00,0x60,0x02,0x40,0x00,0x00,0x00,0x00,0x26,0x40,0x44,0x00, - 0x01,0xff,0x08,0x31,0x26,0x40,0x02,0x01,0x00,0x60,0x88,0x40, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x60,0x08,0x40, - 0x00,0x00,0x00,0x00,0xfe,0xff,0x01,0x24,0x24,0x48,0x01,0x01, - 0x00,0x60,0x89,0x40,0x00,0x68,0x02,0x40,0x00,0x03,0x84,0x30, - 0x25,0x18,0x44,0x00,0x00,0x68,0x83,0x40,0x00,0x60,0x88,0x40, - 0x08,0x00,0xe0,0x03,0x24,0x10,0x44,0x00,0x00,0x60,0x08,0x40, - 0x00,0x03,0x84,0x30,0xfe,0xff,0x01,0x24,0x24,0x48,0x01,0x01, - 0x00,0x60,0x89,0x40,0x00,0x68,0x02,0x40,0x27,0x18,0x80,0x00, - 0x24,0x18,0x62,0x00,0x00,0x68,0x83,0x40,0x00,0x60,0x88,0x40, - 0x08,0x00,0xe0,0x03,0x24,0x10,0x44,0x00,0x40,0x10,0x08,0x3c, - 0x00,0x60,0x88,0x40,0xc0,0xbf,0x08,0x3c,0x08,0x00,0x00,0x01, - 0x00,0x00,0x00,0x00,0x00,0x60,0x08,0x40,0x00,0x00,0x00,0x00, - 0xff,0xff,0x09,0x3c,0xfe,0x00,0x29,0x35,0x00,0x00,0x00,0x00, - 0x24,0x40,0x09,0x01,0x00,0x00,0x00,0x00,0x25,0x40,0x04,0x01, - 0x00,0x00,0x00,0x00,0x00,0x60,0x88,0x40,0x00,0x00,0x00,0x00, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0xd0,0xff,0xbd,0x27,0x00,0xa3,0x0d,0x3c, - 0x30,0x31,0x0e,0x3c,0x04,0x01,0xad,0x35,0x2c,0x00,0xbf,0xaf, - 0x28,0x00,0xb2,0xaf,0x20,0x00,0xb0,0xaf,0x24,0x00,0xb1,0xaf, - 0x42,0x54,0xce,0x35,0x23,0x01,0x04,0x3c,0xdc,0xfe,0x06,0x3c, - 0xff,0xa2,0x07,0x3c,0xff,0xa2,0x08,0x3c,0xf0,0xf0,0x09,0x3c, - 0xff,0xa2,0x0a,0x3c,0x0f,0x0f,0x0b,0x3c,0x01,0x00,0x0c,0x3c, - 0x00,0x00,0xae,0xad,0x01,0x00,0x8c,0x35,0x0f,0x0f,0x6b,0x35, - 0xfc,0xff,0x4a,0x35,0xf0,0xf0,0x29,0x35,0xf8,0xff,0x08,0x35, - 0x00,0x80,0xe7,0x34,0x98,0xba,0xc6,0x34,0x67,0x45,0x84,0x34, - 0x10,0x00,0x05,0x3c,0x21,0x18,0xa7,0x00,0xf8,0x7f,0x64,0xac, - 0x42,0x10,0x05,0x00,0xfc,0x7f,0x66,0xac,0x21,0x78,0x48,0x00, - 0x00,0x00,0xe9,0xad,0x21,0xc0,0x4a,0x00,0x00,0x00,0x0b,0xaf, - 0xf8,0x7f,0x79,0x8c,0x00,0x00,0x00,0x00,0x05,0x00,0x99,0x14, - 0x00,0x00,0x00,0x00,0xfc,0x7f,0x6e,0x8c,0x00,0x00,0x00,0x00, - 0x06,0x00,0xce,0x10,0x00,0xa3,0x12,0x3c,0x42,0x28,0x05,0x00, - 0x2b,0x08,0xac,0x00,0xee,0xff,0x20,0x10,0x21,0x18,0xa7,0x00, - 0x00,0xa3,0x12,0x3c,0x80,0x01,0x52,0x36,0x31,0x30,0x0f,0x3c, - 0x10,0x00,0x45,0xae,0x42,0x54,0xef,0x35,0x00,0x00,0xaf,0xad, - 0x29,0x2a,0x00,0x0c,0x20,0x80,0x84,0x27,0x00,0xa3,0x11,0x3c, - 0x90,0x01,0x31,0x36,0x00,0x00,0x25,0x8e,0x29,0x2a,0x00,0x0c, - 0x3c,0x80,0x84,0x27,0x29,0x2a,0x00,0x0c,0x50,0x80,0x84,0x27, - 0x65,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00,0x02,0x00,0x18,0x24, - 0xc8,0x97,0x98,0xaf,0x02,0x00,0x19,0x24,0x01,0xa1,0x0e,0x3c, - 0x01,0xa0,0x04,0x3c,0x01,0xa0,0x05,0x3c,0x00,0x80,0xd9,0xa5, - 0x70,0xf1,0xa5,0x24,0x08,0x28,0x00,0x0c,0x00,0x80,0x84,0x24, - 0x00,0xa3,0x10,0x3c,0xa0,0x01,0x10,0x36,0x00,0x00,0x02,0xae, - 0x29,0x2a,0x00,0x0c,0x68,0x80,0x84,0x27,0x00,0x00,0x0f,0x8e, - 0xff,0xff,0x01,0x24,0x0c,0x00,0xe1,0x11,0x00,0x00,0x00,0x00, - 0x00,0xa3,0x02,0x3c,0x8c,0x01,0x42,0x34,0x00,0x00,0x58,0x8c, - 0x80,0x80,0x84,0x27,0x02,0x00,0x19,0x37,0x00,0x00,0x59,0xac, - 0x00,0x00,0x05,0x8e,0x29,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x03,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x65,0x2a,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c,0x9c,0x80,0x84,0x27, - 0x32,0x30,0x0e,0x3c,0x42,0x54,0xce,0x35,0x00,0xa3,0x0f,0x3c, - 0x04,0x01,0xee,0xad,0x29,0x2a,0x00,0x0c,0xa0,0x80,0x84,0x27, - 0x00,0xa3,0x10,0x3c,0x00,0x10,0x10,0x36,0x00,0xa3,0x05,0x3c, - 0x01,0x00,0x18,0x24,0x10,0x00,0xb8,0xaf,0x10,0x40,0xa5,0x34, - 0x21,0x20,0x00,0x02,0x01,0x00,0x06,0x24,0xfe,0x2b,0x00,0x0c, - 0x21,0x38,0x00,0x00,0x06,0x00,0x40,0x10,0x00,0x00,0x00,0x00, - 0x0c,0x00,0x59,0x8e,0x00,0x00,0x00,0x00,0x08,0x00,0x2e,0x37, - 0x03,0x00,0x00,0x10,0x0c,0x00,0x4e,0xae,0xc1,0x27,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x00,0x00,0x2f,0x8e,0x04,0x00,0x01,0x3c, - 0x01,0x00,0x21,0x34,0x2b,0x08,0xe1,0x01,0x1d,0x00,0x20,0x14, - 0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c,0xac,0x80,0x84,0x27, - 0x00,0x00,0x25,0x8e,0x00,0x03,0x01,0x3c,0x25,0x28,0xa1,0x00, - 0xff,0xff,0x01,0x3c,0x10,0x00,0x21,0x34,0x21,0x28,0xa1,0x00, - 0xff,0x1f,0x01,0x3c,0xff,0xff,0x21,0x34,0x24,0x28,0xa1,0x00, - 0x00,0xa0,0x01,0x3c,0x01,0x00,0x18,0x24,0x10,0x00,0xb8,0xaf, - 0x25,0x28,0xa1,0x00,0x04,0xa3,0x04,0x3c,0x01,0x00,0x06,0x24, - 0xfe,0x2b,0x00,0x0c,0x21,0x38,0x00,0x00,0x06,0x00,0x40,0x10, - 0x00,0x00,0x00,0x00,0x0c,0x00,0x59,0x8e,0x00,0x00,0x00,0x00, - 0x08,0x00,0x2e,0x37,0x03,0x00,0x00,0x10,0x0c,0x00,0x4e,0xae, - 0xc1,0x27,0x00,0x0c,0x0a,0x00,0x04,0x24,0x29,0x2a,0x00,0x0c, - 0xb4,0x80,0x84,0x27,0x00,0xa3,0x05,0x3c,0x00,0x20,0xa5,0x34, - 0x21,0x20,0x00,0x02,0x01,0x00,0x06,0x24,0x21,0x38,0x00,0x00, - 0xfe,0x2b,0x00,0x0c,0x10,0x00,0xa0,0xaf,0x06,0x00,0x40,0x10, - 0x00,0x00,0x00,0x00,0x0c,0x00,0x4f,0x8e,0x00,0x00,0x00,0x00, - 0x08,0x00,0xf8,0x35,0x03,0x00,0x00,0x10,0x0c,0x00,0x58,0xae, - 0xc1,0x27,0x00,0x0c,0x0a,0x00,0x04,0x24,0x82,0x00,0x19,0x24, - 0xc8,0x97,0x99,0xaf,0x82,0x00,0x0e,0x24,0x01,0xa1,0x0f,0x3c, - 0x00,0x80,0xee,0xa5,0x00,0xa3,0x18,0x3c,0xc9,0x01,0x19,0x93, - 0x00,0x00,0x00,0x00,0x55,0x00,0x20,0x17,0x2c,0x00,0xbf,0x8f, - 0x33,0x30,0x0e,0x3c,0x42,0x54,0xce,0x35,0x00,0xa3,0x0f,0x3c, - 0x04,0x01,0xee,0xad,0xc9,0x2a,0x00,0x0c,0x21,0x20,0x00,0x00, - 0x06,0x00,0x40,0x10,0x00,0x00,0x00,0x00,0x0c,0x00,0x58,0x8e, - 0x00,0x00,0x00,0x00,0x04,0x00,0x19,0x37,0x03,0x00,0x00,0x10, - 0x0c,0x00,0x59,0xae,0xc1,0x27,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0x00,0xa3,0x0e,0x3c,0xc9,0x01,0xcf,0x91,0x00,0x00,0x00,0x00, - 0x41,0x00,0xe0,0x15,0x2c,0x00,0xbf,0x8f,0x21,0x80,0x00,0x00, - 0x10,0x80,0x91,0x27,0x00,0x00,0x38,0x8e,0x00,0xa3,0x19,0x3c, - 0x04,0x01,0x38,0xaf,0x10,0x00,0xa0,0xaf,0x21,0x20,0x00,0x02, - 0x21,0x28,0x00,0x00,0x21,0x30,0x00,0x00,0x94,0x2e,0x00,0x0c, - 0x21,0x38,0x00,0x00,0x07,0x00,0x40,0x10,0x00,0x00,0x00,0x00, - 0x0c,0x00,0x4e,0x8e,0x10,0x00,0x0f,0x24,0x04,0xc0,0x0f,0x02, - 0x25,0xc8,0xd8,0x01,0x03,0x00,0x00,0x10,0x0c,0x00,0x59,0xae, - 0xc1,0x27,0x00,0x0c,0x0a,0x00,0x04,0x24,0x00,0xa3,0x0f,0x3c, - 0xc9,0x01,0xee,0x91,0x00,0x00,0x00,0x00,0x27,0x00,0xc0,0x15, - 0x2c,0x00,0xbf,0x8f,0x01,0x00,0x10,0x26,0x04,0x00,0x01,0x24, - 0xe5,0xff,0x01,0x16,0x04,0x00,0x31,0x26,0x2f,0x00,0x58,0x92, - 0xff,0x00,0x03,0x24,0x08,0x00,0x78,0x14,0x03,0x00,0x10,0x24, - 0x21,0x10,0x50,0x02,0x2b,0x00,0x59,0x90,0xff,0xff,0x10,0x26, - 0x03,0x00,0x79,0x14,0xff,0xff,0x42,0x24,0xfb,0xff,0x00,0x16, - 0x00,0x00,0x00,0x00,0x21,0x10,0x50,0x02,0x2c,0x00,0x4f,0x90, - 0x00,0x00,0x00,0x00,0x09,0x00,0x6f,0x10,0x00,0x00,0x00,0x00, - 0x07,0x00,0x00,0x1a,0x00,0x00,0x00,0x00,0x2b,0x00,0x4e,0x90, - 0xff,0xff,0x10,0x26,0x03,0x00,0x6e,0x10,0xff,0xff,0x42,0x24, - 0xfb,0xff,0x00,0x1e,0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x12, - 0x2c,0x00,0xbf,0x8f,0x29,0x2a,0x00,0x0c,0xc0,0x80,0x84,0x27, - 0x0c,0x00,0x58,0x8e,0x10,0x00,0x19,0x24,0x04,0x78,0x19,0x02, - 0x25,0x70,0x0f,0x03,0x0c,0x00,0x4e,0xae,0x2c,0x00,0xbf,0x8f, - 0x20,0x00,0xb0,0x8f,0x24,0x00,0xb1,0x8f,0x28,0x00,0xb2,0x8f, - 0x08,0x00,0xe0,0x03,0x30,0x00,0xbd,0x27,0xe8,0xff,0xbd,0x27, - 0x14,0x00,0xbf,0xaf,0xdc,0x80,0x84,0x27,0x35,0x20,0x00,0x0c, - 0xcf,0x00,0x05,0x24,0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xe8,0xff,0xbd,0x27, - 0x14,0x00,0xbf,0xaf,0xec,0x80,0x84,0x27,0x35,0x20,0x00,0x0c, - 0xd9,0x00,0x05,0x24,0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xc0,0xff,0xbd,0x27, - 0x2c,0x00,0xb5,0xaf,0x1c,0x00,0xb1,0xaf,0x38,0x00,0xbe,0xaf, - 0x30,0x00,0xb6,0xaf,0x34,0x00,0xb7,0xaf,0x28,0x00,0xb4,0xaf, - 0x20,0x00,0xb2,0xaf,0x24,0x00,0xb3,0xaf,0x00,0xa3,0x11,0x3c, - 0x00,0xa3,0x15,0x3c,0x21,0x98,0x80,0x00,0x3c,0x00,0xbf,0xaf, - 0x18,0x00,0xb0,0xaf,0xc8,0x01,0xb5,0x36,0xc9,0x01,0x31,0x36, - 0xff,0xff,0x12,0x24,0xff,0xff,0x14,0x24,0x0a,0x00,0x17,0x24, - 0x08,0x00,0x16,0x24,0x0d,0x00,0x1e,0x24,0x00,0x00,0x2e,0x92, - 0x00,0x00,0x00,0x00,0x05,0x00,0xc0,0x15,0x00,0x00,0x00,0x00, - 0x00,0x00,0x2f,0x92,0x00,0x00,0x00,0x00,0xfd,0xff,0xe0,0x11, - 0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x92,0x00,0x00,0x20,0xa2, - 0x07,0x00,0x16,0x12,0x00,0x00,0x00,0x00,0x03,0x00,0x17,0x12, - 0x00,0x00,0x00,0x00,0x19,0x00,0x1e,0x16,0x10,0x00,0x01,0x24, - 0x3d,0x00,0x00,0x10,0x21,0x10,0x40,0x02,0xed,0xff,0x54,0x12, - 0x00,0x00,0x00,0x00,0x5c,0x28,0x00,0x0c,0x08,0x00,0x04,0x24, - 0x5c,0x28,0x00,0x0c,0x20,0x00,0x04,0x24,0x5c,0x28,0x00,0x0c, - 0x08,0x00,0x04,0x24,0x1a,0x00,0x53,0x02,0x02,0x00,0x60,0x16, - 0x00,0x00,0x00,0x00,0x0d,0x00,0x07,0x00,0xff,0xff,0x01,0x24, - 0x04,0x00,0x61,0x16,0x00,0x80,0x01,0x3c,0x02,0x00,0x41,0x16, - 0x00,0x00,0x00,0x00,0x0d,0x00,0x06,0x00,0x12,0x90,0x00,0x00, - 0xdb,0xff,0x00,0x10,0x00,0x00,0x2e,0x92,0x10,0x00,0x01,0x24, - 0x15,0x00,0x61,0x16,0x61,0x00,0x01,0x2e,0x05,0x00,0x20,0x14, - 0x67,0x00,0x01,0x2e,0x04,0x00,0x20,0x10,0x41,0x00,0x01,0x2e, - 0xe0,0x00,0x10,0x26,0xff,0x00,0x10,0x32,0x41,0x00,0x01,0x2e, - 0x0c,0x00,0x20,0x14,0x47,0x00,0x01,0x2e,0x0b,0x00,0x20,0x10, - 0x30,0x00,0x01,0x2e,0x02,0x00,0x54,0x16,0x00,0x00,0x00,0x00, - 0x21,0x90,0x00,0x00,0x19,0x00,0x53,0x02,0x21,0x20,0x00,0x02, - 0x12,0xc0,0x00,0x00,0x21,0x90,0x10,0x03,0x5c,0x28,0x00,0x0c, - 0xc9,0xff,0x52,0x26,0x30,0x00,0x01,0x2e,0xc0,0xff,0x20,0x14, - 0x3a,0x00,0x01,0x2e,0xbe,0xff,0x20,0x10,0x00,0x00,0x00,0x00, - 0x02,0x00,0x54,0x16,0x00,0x00,0x00,0x00,0x21,0x90,0x00,0x00, - 0x19,0x00,0x53,0x02,0x21,0x20,0x00,0x02,0x12,0xc8,0x00,0x00, - 0x21,0x90,0x30,0x03,0x5c,0x28,0x00,0x0c,0xd0,0xff,0x52,0x26, - 0xb4,0xff,0x00,0x10,0x00,0x00,0x2e,0x92,0x3c,0x00,0xbf,0x8f, - 0x18,0x00,0xb0,0x8f,0x1c,0x00,0xb1,0x8f,0x20,0x00,0xb2,0x8f, - 0x24,0x00,0xb3,0x8f,0x28,0x00,0xb4,0x8f,0x2c,0x00,0xb5,0x8f, - 0x30,0x00,0xb6,0x8f,0x34,0x00,0xb7,0x8f,0x38,0x00,0xbe,0x8f, - 0x08,0x00,0xe0,0x03,0x40,0x00,0xbd,0x27,0xc8,0xfe,0xbd,0x27, - 0x24,0x00,0xbf,0xaf,0x1c,0x37,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x4f,0x53,0x0e,0x3c,0x4c,0x00,0xb0,0xaf,0x42,0x49,0xce,0x35, - 0x00,0xa3,0x0f,0x3c,0x4f,0x20,0x18,0x3c,0x00,0x01,0xee,0xad, - 0x20,0x47,0x18,0x37,0x00,0xa3,0x19,0x3c,0x4b,0x20,0x08,0x3c, - 0x04,0x01,0x38,0xaf,0x20,0x4f,0x08,0x35,0x00,0xa3,0x09,0x3c, - 0x08,0x01,0x28,0xad,0x20,0x20,0x0a,0x3c,0x20,0x20,0x4a,0x35, - 0x00,0xa3,0x0b,0x3c,0x0c,0x01,0x6a,0xad,0x03,0x00,0x0c,0x24, - 0x00,0xa3,0x0d,0x3c,0x14,0x01,0xac,0xad,0x00,0xa3,0x0e,0x3c, - 0xca,0x01,0xce,0x35,0x00,0xa3,0x0f,0x3c,0x00,0xa3,0x18,0x3c, - 0x18,0x01,0xee,0xad,0x30,0x0c,0x18,0x37,0x00,0xa3,0x19,0x3c, - 0x00,0xa3,0x08,0x3c,0x1c,0x01,0x38,0xaf,0x80,0x01,0x08,0x35, - 0x00,0xa3,0x09,0x3c,0x20,0x01,0x28,0xad,0x00,0xa3,0x0a,0x3c, - 0x84,0x01,0x40,0xad,0x00,0xa3,0x0b,0x3c,0x88,0x01,0x60,0xad, - 0x00,0xa3,0x0c,0x3c,0x94,0x01,0x80,0xad,0x00,0xa3,0x0d,0x3c, - 0x98,0x01,0xa0,0xad,0x01,0x00,0x0e,0x24,0x00,0xa3,0x0f,0x3c, - 0x9c,0x01,0xee,0xad,0x01,0x01,0x18,0x24,0x00,0xa3,0x19,0x3c, - 0xa4,0x01,0x38,0xaf,0x00,0xa3,0x08,0x3c,0xa8,0x01,0x00,0xa5, - 0x00,0xa3,0x09,0x3c,0xaa,0x01,0x20,0xa5,0x00,0xa3,0x0a,0x3c, - 0xca,0x01,0x40,0xa5,0x00,0xa3,0x0b,0x3c,0x00,0xa3,0x02,0x3c, - 0xcc,0x01,0x60,0xa5,0x00,0xa3,0x0d,0x3c,0xff,0x01,0x0c,0x24, - 0x10,0x01,0x42,0x34,0xce,0x01,0xac,0xa5,0x00,0x00,0x50,0x8c, - 0x00,0x00,0x00,0x00,0x01,0x00,0x10,0x2e,0x04,0x00,0x00,0x12, - 0x00,0x00,0x00,0x00,0x00,0x17,0x0e,0x3c,0x05,0x06,0xce,0x35, - 0x00,0x00,0x4e,0xac,0xf0,0x21,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x00,0xa3,0x02,0x3c,0x39,0x39,0x0f,0x3c,0x04,0x01,0x42,0x34, - 0x42,0x54,0xef,0x35,0x00,0x00,0x4f,0xac,0x47,0x00,0x18,0x24, - 0x00,0xa3,0x19,0x3c,0x00,0x0c,0x38,0xa3,0x44,0x00,0x08,0x24, - 0x00,0xa3,0x09,0x3c,0x01,0x0c,0x28,0xa1,0x00,0xa3,0x0a,0x3c, - 0x30,0x0c,0x40,0xa1,0x00,0xa3,0x0b,0x3c,0x32,0x0c,0x60,0xa1, - 0x00,0xa3,0x0c,0x3c,0x45,0x23,0x0d,0x3c,0x38,0x0c,0x80,0xa5, - 0x89,0x67,0xad,0x35,0x00,0xa3,0x0e,0x3c,0x05,0x00,0x00,0x12, - 0x10,0x00,0xcd,0xad,0x4e,0x45,0x0f,0x3c,0x44,0x4f,0xef,0x35, - 0x04,0x00,0x00,0x10,0x00,0x00,0x4f,0xac,0x49,0x54,0x18,0x3c, - 0x57,0x41,0x18,0x37,0x00,0x00,0x58,0xac,0x38,0x00,0xb4,0xaf, - 0x00,0xa3,0x14,0x3c,0x30,0x00,0xb6,0xaf,0x0a,0x00,0x16,0x24, - 0xc9,0x01,0x94,0x36,0x44,0x00,0xb1,0xaf,0x40,0x00,0xb2,0xaf, - 0x3c,0x00,0xb3,0xaf,0x34,0x00,0xb5,0xaf,0x2c,0x00,0xb7,0xaf, - 0x28,0x00,0xbe,0xaf,0x00,0xa3,0x02,0x3c,0x10,0x00,0x42,0x34, - 0x00,0x00,0x59,0x8c,0x00,0x00,0x00,0x00,0x01,0x00,0x28,0x27, - 0x14,0x28,0x00,0x0c,0x00,0x00,0x48,0xac,0x00,0xa3,0x09,0x3c, - 0x10,0x01,0x2a,0x8d,0x00,0x00,0x00,0x00,0x09,0x00,0x40,0x15, - 0x00,0x00,0x00,0x00,0x00,0x17,0x0b,0x3c,0x05,0x06,0x6b,0x35, - 0x00,0xa3,0x0c,0x3c,0x4e,0x45,0x0d,0x3c,0x10,0x01,0x8b,0xad, - 0x44,0x4f,0xad,0x35,0x00,0xa3,0x0e,0x3c,0x04,0x01,0xcd,0xad, - 0x00,0x00,0x8f,0x92,0x00,0x00,0x00,0x00,0xea,0xff,0xe0,0x11, - 0x00,0xa3,0x02,0x3c,0x00,0xa3,0x18,0x3c,0xc8,0x01,0x19,0x93, - 0x21,0x98,0x00,0x00,0x30,0x01,0xb9,0xa3,0x00,0x00,0x80,0xa2, - 0x74,0x00,0xa0,0xaf,0x60,0x00,0xa0,0xaf,0x01,0x00,0x1e,0x24, - 0x3c,0x01,0xb0,0x27,0x4c,0x01,0xa2,0x27,0x10,0x00,0x10,0x26, - 0x18,0xff,0x00,0xae,0x2c,0xff,0x00,0xae,0x1c,0xff,0x00,0xae, - 0x30,0xff,0x00,0xae,0x20,0xff,0x00,0xae,0x34,0xff,0x00,0xae, - 0x24,0xff,0x00,0xae,0xf7,0xff,0x02,0x16,0x38,0xff,0x00,0xae, - 0x09,0x03,0x00,0x10,0x30,0x01,0xac,0x93,0x29,0x2a,0x00,0x0c, - 0x4c,0x81,0x84,0x27,0x29,0x2a,0x00,0x0c,0x6c,0x81,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x7c,0x81,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x90,0x81,0x84,0x27,0x29,0x2a,0x00,0x0c,0xa4,0x81,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0xb4,0x81,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0xd8,0x81,0x84,0x27,0x29,0x2a,0x00,0x0c,0xfc,0x81,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x20,0x82,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x38,0x82,0x84,0x27,0x29,0x2a,0x00,0x0c,0x70,0x82,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x94,0x82,0x84,0x27,0xba,0xff,0x00,0x10, - 0x00,0xa3,0x02,0x3c,0x65,0x00,0x08,0x24,0x30,0x01,0xa8,0xa3, - 0x29,0x2a,0x00,0x0c,0xc4,0x82,0x84,0x27,0x14,0x23,0x00,0x0c, - 0x21,0x20,0xc0,0x02,0x21,0xb8,0x40,0x00,0x29,0x2a,0x00,0x0c, - 0xe8,0x82,0x84,0x27,0xaf,0xff,0xe0,0x12,0x00,0xa3,0x02,0x3c, - 0x01,0x00,0x09,0x24,0x10,0x00,0xa9,0xaf,0x21,0x20,0x00,0x00, - 0x02,0x00,0x05,0x24,0xb0,0x00,0xa6,0x27,0x94,0x2e,0x00,0x0c, - 0x21,0x38,0x00,0x00,0x01,0x00,0x0a,0x24,0x10,0x00,0xaa,0xaf, - 0x01,0x00,0x04,0x24,0x02,0x00,0x05,0x24,0xb0,0x00,0xa6,0x27, - 0x94,0x2e,0x00,0x0c,0x21,0x38,0x00,0x00,0x01,0x00,0x0b,0x24, - 0x10,0x00,0xab,0xaf,0x02,0x00,0x04,0x24,0x02,0x00,0x05,0x24, - 0xb0,0x00,0xa6,0x27,0x94,0x2e,0x00,0x0c,0x21,0x38,0x00,0x00, - 0x01,0x00,0x0c,0x24,0x10,0x00,0xac,0xaf,0x03,0x00,0x04,0x24, - 0x02,0x00,0x05,0x24,0xb0,0x00,0xa6,0x27,0x94,0x2e,0x00,0x0c, - 0x21,0x38,0x00,0x00,0x21,0x18,0xe0,0x02,0x67,0x00,0x60,0x10, - 0xff,0xff,0xf7,0x26,0x30,0x01,0xad,0x93,0x65,0x00,0x01,0x24, - 0x30,0x00,0xa1,0x11,0x01,0x00,0x73,0x26,0x21,0xa8,0x00,0x00, - 0xfc,0x80,0x84,0x8f,0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02, - 0xc9,0x2a,0x00,0x0c,0x21,0x20,0x00,0x00,0x07,0x00,0x40,0x10, - 0x60,0x00,0xb8,0x8f,0x74,0x00,0xae,0x8f,0x00,0x00,0x00,0x00, - 0x01,0x00,0xcf,0x25,0x05,0x00,0x00,0x10,0x74,0x00,0xaf,0xaf, - 0x60,0x00,0xb8,0x8f,0x00,0x00,0x00,0x00,0x01,0x00,0x19,0x27, - 0x60,0x00,0xb9,0xaf,0x00,0x00,0x88,0x92,0x00,0x00,0x00,0x00, - 0x4e,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0xb5,0x26, - 0x14,0x00,0x01,0x24,0xe9,0xff,0xa1,0x16,0x00,0x00,0x00,0x00, - 0xfc,0x80,0x84,0x8f,0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02, - 0x00,0xa3,0x04,0x3c,0x00,0xa3,0x05,0x3c,0xf0,0x7f,0xa5,0x34, - 0x10,0x7f,0x84,0x34,0x01,0x00,0x06,0x24,0x21,0x38,0x00,0x00, - 0xfe,0x2b,0x00,0x0c,0x10,0x00,0xa0,0xaf,0x07,0x00,0x40,0x10, - 0x64,0x00,0xab,0x8f,0x78,0x00,0xa9,0x8f,0x00,0x00,0x00,0x00, - 0x01,0x00,0x2a,0x25,0x05,0x00,0x00,0x10,0x78,0x00,0xaa,0xaf, - 0x64,0x00,0xab,0x8f,0x00,0x00,0x00,0x00,0x01,0x00,0x6c,0x25, - 0x64,0x00,0xac,0xaf,0x00,0x00,0x8d,0x92,0x00,0x00,0x00,0x00, - 0x30,0x00,0xa0,0x15,0x00,0x00,0x00,0x00,0x21,0x80,0x00,0x00, - 0x21,0x90,0x00,0x00,0x21,0x88,0x00,0x00,0xfc,0x80,0x84,0x8f, - 0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02,0x21,0x20,0x20,0x02, - 0x21,0x28,0x00,0x02,0xb0,0x00,0xa6,0x27,0x21,0x38,0x00,0x00, - 0x94,0x2e,0x00,0x0c,0x10,0x00,0xa0,0xaf,0x0a,0x00,0x40,0x10, - 0x80,0x40,0x10,0x00,0x80,0x70,0x10,0x00,0x38,0x01,0xaf,0x27, - 0x21,0x10,0xcf,0x01,0x44,0xff,0x58,0x8c,0x00,0x00,0x00,0x00, - 0x01,0x00,0x19,0x27,0x08,0x00,0x00,0x10,0x44,0xff,0x59,0xac, - 0x80,0x40,0x10,0x00,0x38,0x01,0xa9,0x27,0x21,0x10,0x09,0x01, - 0x30,0xff,0x4a,0x8c,0x00,0x00,0x00,0x00,0x01,0x00,0x4b,0x25, - 0x30,0xff,0x4b,0xac,0x00,0x00,0x8c,0x92,0x00,0x00,0x00,0x00, - 0x0f,0x00,0x80,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0x31,0x26, - 0x04,0x00,0x21,0x2a,0xdf,0xff,0x20,0x14,0x00,0x00,0x00,0x00, - 0x01,0x00,0x52,0x26,0xdc,0xff,0x56,0x16,0x21,0x88,0x00,0x00, - 0x01,0x00,0x10,0x26,0x02,0x00,0x01,0x24,0xd7,0xff,0x01,0x16, - 0x21,0x90,0x00,0x00,0x21,0x18,0xe0,0x02,0x9b,0xff,0x60,0x14, - 0xff,0xff,0xf7,0x26,0x29,0x2a,0x00,0x0c,0xec,0x82,0x84,0x27, - 0x00,0x83,0x84,0x27,0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02, - 0x21,0xf0,0x00,0x00,0x38,0x01,0xb0,0x27,0x01,0x00,0xd1,0x27, - 0x28,0xff,0x06,0x8e,0x3c,0xff,0x07,0x8e,0x21,0x28,0x20,0x02, - 0x29,0x2a,0x00,0x0c,0x14,0x83,0x84,0x27,0x21,0xf0,0x20,0x02, - 0x04,0x00,0x01,0x24,0xf7,0xff,0xc1,0x17,0x04,0x00,0x10,0x26, - 0x16,0xff,0x00,0x10,0x00,0x00,0x80,0xa2,0x29,0x2a,0x00,0x0c, - 0x38,0x83,0x84,0x27,0x01,0x00,0x73,0x26,0xfc,0x80,0x84,0x8f, - 0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02,0xc9,0x2a,0x00,0x0c, - 0x21,0x20,0x00,0x00,0x07,0x00,0x40,0x10,0x60,0x00,0xaf,0x8f, - 0x74,0x00,0xad,0x8f,0x00,0x00,0x00,0x00,0x01,0x00,0xae,0x25, - 0x05,0x00,0x00,0x10,0x74,0x00,0xae,0xaf,0x60,0x00,0xaf,0x8f, - 0x00,0x00,0x00,0x00,0x01,0x00,0xf8,0x25,0x60,0x00,0xb8,0xaf, - 0x00,0x00,0x99,0x92,0x00,0x00,0x00,0x00,0xec,0xff,0x20,0x13, - 0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c,0x54,0x83,0x84,0x27, - 0x70,0x83,0x84,0x27,0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02, - 0x60,0x00,0xa5,0x8f,0x74,0x00,0xa6,0x8f,0x29,0x2a,0x00,0x0c, - 0x84,0x83,0x84,0x27,0xf4,0xfe,0x00,0x10,0x00,0x00,0x80,0xa2, - 0x29,0x2a,0x00,0x0c,0xa4,0x83,0x84,0x27,0x14,0x23,0x00,0x0c, - 0x10,0x00,0x04,0x24,0xff,0xff,0x01,0x24,0x03,0x00,0x41,0x14, - 0x21,0x90,0x40,0x00,0x00,0xa3,0x12,0x3c,0x00,0x10,0x52,0x36, - 0x29,0x2a,0x00,0x0c,0xb4,0x83,0x84,0x27,0x14,0x23,0x00,0x0c, - 0x10,0x00,0x04,0x24,0xff,0xff,0x01,0x24,0x03,0x00,0x41,0x14, - 0x21,0x80,0x40,0x00,0x02,0xa3,0x10,0x3c,0xf0,0xff,0x10,0x36, - 0x29,0x2a,0x00,0x0c,0xc4,0x83,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0xc8,0x83,0x84,0x27,0x01,0x00,0x73,0x26,0xfc,0x80,0x84,0x8f, - 0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02,0x21,0x20,0x40,0x02, - 0x21,0x28,0x00,0x02,0x01,0x00,0x06,0x24,0x21,0x38,0x00,0x00, - 0xfe,0x2b,0x00,0x0c,0x10,0x00,0xa0,0xaf,0x07,0x00,0x40,0x10, - 0x64,0x00,0xaa,0x8f,0x78,0x00,0xa8,0x8f,0x00,0x00,0x00,0x00, - 0x01,0x00,0x09,0x25,0x05,0x00,0x00,0x10,0x78,0x00,0xa9,0xaf, - 0x64,0x00,0xaa,0x8f,0x00,0x00,0x00,0x00,0x01,0x00,0x4b,0x25, - 0x64,0x00,0xab,0xaf,0x00,0x00,0x8c,0x92,0x00,0x00,0x00,0x00, - 0xe8,0xff,0x80,0x11,0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c, - 0xe4,0x83,0x84,0x27,0xfc,0x83,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x28,0x60,0x02,0x64,0x00,0xa5,0x8f,0x78,0x00,0xa6,0x8f, - 0x29,0x2a,0x00,0x0c,0x10,0x84,0x84,0x27,0xba,0xfe,0x00,0x10, - 0x00,0x00,0x80,0xa2,0x29,0x2a,0x00,0x0c,0x30,0x84,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x58,0x84,0x84,0x27,0x00,0x00,0x8d,0x92, - 0x00,0x00,0x00,0x00,0x06,0x00,0xa0,0x15,0x00,0xa3,0x0f,0x3c, - 0x00,0x00,0x8e,0x92,0x00,0x00,0x00,0x00,0xfd,0xff,0xc0,0x11, - 0x00,0x00,0x00,0x00,0x00,0xa3,0x0f,0x3c,0xc8,0x01,0xf2,0x91, - 0x00,0x00,0x80,0xa2,0x29,0x2a,0x00,0x0c,0x7c,0x84,0x84,0x27, - 0x30,0x00,0x41,0x2a,0xa6,0xfe,0x20,0x14,0x34,0x00,0x41,0x2a, - 0xa5,0xfe,0x20,0x10,0x00,0xa3,0x02,0x3c,0xd0,0xff,0x42,0x26, - 0x21,0xa8,0x40,0x00,0x21,0xf0,0x40,0x00,0x29,0x2a,0x00,0x0c, - 0x80,0x84,0x84,0x27,0x14,0x23,0x00,0x0c,0x21,0x20,0xc0,0x02, - 0xff,0xff,0x52,0x24,0x0f,0x00,0x52,0x32,0x29,0x2a,0x00,0x0c, - 0xa0,0x84,0x84,0x27,0x21,0x88,0xc0,0x03,0x2a,0x08,0xbe,0x02, - 0xff,0xff,0x20,0x14,0x2a,0x08,0xbe,0x02,0xff,0xff,0x18,0x24, - 0x23,0x80,0x12,0x03,0x01,0x00,0x73,0x26,0xfc,0x80,0x84,0x8f, - 0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02,0x21,0x20,0x20,0x02, - 0x21,0x28,0x00,0x02,0x21,0x30,0x00,0x00,0x21,0x38,0x00,0x00, - 0x94,0x2e,0x00,0x0c,0x10,0x00,0xa0,0xaf,0x07,0x00,0x40,0x10, - 0x68,0x00,0xa9,0x8f,0x7c,0x00,0xb9,0x8f,0x00,0x00,0x00,0x00, - 0x01,0x00,0x28,0x27,0x05,0x00,0x00,0x10,0x7c,0x00,0xa8,0xaf, - 0x68,0x00,0xa9,0x8f,0x00,0x00,0x00,0x00,0x01,0x00,0x2a,0x25, - 0x68,0x00,0xaa,0xaf,0x00,0x00,0x8b,0x92,0x00,0x00,0x00,0x00, - 0x07,0x00,0x60,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0x31,0x26, - 0x2a,0x08,0xb1,0x02,0xe4,0xff,0x20,0x10,0x00,0x00,0x00,0x00, - 0xdd,0xff,0x00,0x10,0x21,0x88,0xc0,0x03,0x29,0x2a,0x00,0x0c, - 0xc0,0x84,0x84,0x27,0xd8,0x84,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x28,0x60,0x02,0x68,0x00,0xa6,0x8f,0x7c,0x00,0xa7,0x8f, - 0xec,0x84,0x84,0x27,0x29,0x2a,0x00,0x0c,0x33,0x00,0x05,0x24, - 0x68,0xfe,0x00,0x10,0x00,0x00,0x80,0xa2,0x29,0x2a,0x00,0x0c, - 0x10,0x85,0x84,0x27,0x30,0x01,0xb7,0x93,0x00,0x00,0x00,0x00, - 0xcd,0xff,0xf7,0x26,0x05,0x00,0xe0,0x12,0x00,0x00,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x18,0x85,0x84,0x27,0x03,0x00,0x00,0x10, - 0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c,0x1c,0x85,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x20,0x85,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x38,0x85,0x84,0x27,0x00,0x00,0x8c,0x92,0x00,0x00,0x00,0x00, - 0x06,0x00,0x80,0x15,0x00,0xa3,0x0e,0x3c,0x00,0x00,0x8d,0x92, - 0x00,0x00,0x00,0x00,0xfd,0xff,0xa0,0x11,0x00,0x00,0x00,0x00, - 0x00,0xa3,0x0e,0x3c,0xc8,0x01,0xd2,0x91,0x61,0x00,0x01,0x24, - 0x04,0x00,0x41,0x12,0x00,0x00,0x80,0xa2,0x41,0x00,0x01,0x24, - 0x05,0x00,0x41,0x16,0x30,0x00,0x41,0x2a,0x21,0xf0,0x00,0x00, - 0x09,0x00,0x00,0x10,0x03,0x00,0x15,0x24,0x30,0x00,0x41,0x2a, - 0x41,0xfe,0x20,0x14,0x34,0x00,0x41,0x2a,0x40,0xfe,0x20,0x10, - 0x00,0xa3,0x02,0x3c,0xd0,0xff,0x42,0x26,0x21,0xa8,0x40,0x00, - 0x21,0xf0,0x40,0x00,0x29,0x2a,0x00,0x0c,0x6c,0x85,0x84,0x27, - 0x01,0x00,0x01,0x24,0x0e,0x00,0xe1,0x16,0x2a,0x08,0xbe,0x02, - 0x0c,0x00,0x20,0x14,0x21,0x88,0xc0,0x03,0x01,0x00,0x0f,0x24, - 0x10,0x00,0xaf,0xaf,0x21,0x20,0x20,0x02,0x02,0x00,0x05,0x24, - 0xb0,0x00,0xa6,0x27,0x94,0x2e,0x00,0x0c,0x21,0x38,0x00,0x00, - 0x01,0x00,0x31,0x26,0x2a,0x08,0xb1,0x02,0xf7,0xff,0x20,0x10, - 0x01,0x00,0x0f,0x24,0x21,0x88,0xc0,0x03,0x2a,0x08,0xbe,0x02, - 0xff,0xff,0x20,0x14,0x2a,0x08,0xbe,0x02,0x01,0x00,0x73,0x26, - 0xfc,0x80,0x84,0x8f,0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02, - 0x21,0x20,0x20,0x02,0x21,0x28,0xe0,0x02,0xb0,0x00,0xa6,0x27, - 0x21,0x38,0x00,0x00,0x94,0x2e,0x00,0x0c,0x10,0x00,0xa0,0xaf, - 0x0b,0x00,0x40,0x10,0x30,0x01,0xab,0x93,0x30,0x01,0xb8,0x93, - 0x38,0x01,0xa8,0x27,0x80,0xc8,0x18,0x00,0x21,0x80,0x28,0x03, - 0x78,0xfe,0x09,0x8e,0x00,0x00,0x00,0x00,0x01,0x00,0x2a,0x25, - 0x09,0x00,0x00,0x10,0x78,0xfe,0x0a,0xae,0x30,0x01,0xab,0x93, - 0x38,0x01,0xad,0x27,0x80,0x60,0x0b,0x00,0x21,0x80,0x8d,0x01, - 0x64,0xfe,0x0e,0x8e,0x00,0x00,0x00,0x00,0x01,0x00,0xcf,0x25, - 0x64,0xfe,0x0f,0xae,0x00,0x00,0x98,0x92,0x00,0x00,0x00,0x00, - 0x07,0x00,0x00,0x17,0x00,0x00,0x00,0x00,0x01,0x00,0x31,0x26, - 0x2a,0x08,0xb1,0x02,0xdc,0xff,0x20,0x10,0x00,0x00,0x00,0x00, - 0xd7,0xff,0x00,0x10,0x21,0x88,0xc0,0x03,0x29,0x2a,0x00,0x0c, - 0x88,0x85,0x84,0x27,0xa0,0x85,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x28,0x60,0x02,0x30,0x01,0xa5,0x93,0x64,0xfe,0x06,0x8e, - 0x78,0xfe,0x07,0x8e,0x29,0x2a,0x00,0x0c,0xb4,0x85,0x84,0x27, - 0xf3,0xfd,0x00,0x10,0x00,0x00,0x80,0xa2,0x01,0xa0,0x04,0x3c, - 0x01,0xa0,0x05,0x3c,0xa0,0xdd,0xa5,0x24,0x08,0x28,0x00,0x0c, - 0x00,0x80,0x84,0x24,0x21,0x80,0x40,0x00,0x29,0x2a,0x00,0x0c, - 0xd8,0x85,0x84,0x27,0x01,0x00,0x73,0x26,0xfc,0x80,0x84,0x8f, - 0x29,0x2a,0x00,0x0c,0x21,0x28,0x60,0x02,0x29,0x2a,0x00,0x0c, - 0xf4,0x85,0x84,0x27,0x0f,0xa3,0x02,0x3c,0x23,0x01,0x03,0x3c, - 0x67,0x45,0x63,0x34,0xf8,0xff,0x42,0x34,0xdc,0xfe,0x19,0x3c, - 0x00,0x00,0x43,0xac,0x98,0xba,0x39,0x37,0x10,0xa3,0x08,0x3c, - 0xf0,0xf0,0x09,0x3c,0xfc,0xff,0x19,0xad,0xf0,0xf0,0x29,0x35, - 0x08,0xa3,0x0a,0x3c,0x0f,0x0f,0x0b,0x3c,0xf8,0xff,0x49,0xad, - 0x0f,0x0f,0x6b,0x35,0x08,0xa3,0x0c,0x3c,0xfc,0xff,0x8b,0xad, - 0x00,0x00,0x4d,0x8c,0x00,0x00,0x00,0x00,0x07,0x00,0x6d,0x14, - 0x00,0x00,0x00,0x00,0x10,0xa3,0x0e,0x3c,0xfc,0xff,0xcf,0x8d, - 0xdc,0xfe,0x01,0x3c,0x98,0xba,0x21,0x34,0x14,0x00,0xe1,0x11, - 0x00,0x00,0x00,0x00,0x01,0xa0,0x04,0x3c,0x01,0xa0,0x05,0x3c, - 0xa0,0xdd,0xa5,0x24,0x08,0x28,0x00,0x0c,0x00,0x80,0x84,0x24, - 0x05,0x00,0x02,0x16,0x00,0x00,0x00,0x00,0x65,0x2a,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x10,0x00,0x00,0x98,0x92, - 0x29,0x2a,0x00,0x0c,0x04,0x86,0x84,0x27,0x05,0x00,0x00,0x10, - 0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x92,0x00,0x00,0x00,0x00, - 0xcd,0xff,0x00,0x13,0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c, - 0x2c,0x86,0x84,0x27,0x44,0x86,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x28,0x60,0x02,0x70,0x00,0xa5,0x8f,0x84,0x00,0xa6,0x8f, - 0x29,0x2a,0x00,0x0c,0x58,0x86,0x84,0x27,0xac,0xfd,0x00,0x10, - 0x00,0x00,0x80,0xa2,0xc8,0x97,0x82,0x8f,0x00,0xa1,0x03,0x3c, - 0x00,0x80,0x63,0x34,0x01,0x00,0x59,0x38,0x00,0x00,0x79,0xa4, - 0x00,0xa3,0x08,0x3c,0x00,0x00,0x00,0x8d,0x78,0x86,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x00,0x00,0x62,0xa4,0xa1,0xfd,0x00,0x10, - 0x00,0xa3,0x02,0x3c,0x29,0x2a,0x00,0x0c,0x98,0x86,0x84,0x27, - 0x14,0x23,0x00,0x0c,0x10,0x00,0x04,0x24,0xff,0xff,0x01,0x24, - 0x99,0xfd,0x41,0x10,0x21,0x90,0x40,0x00,0x29,0x2a,0x00,0x0c, - 0xa8,0x86,0x84,0x27,0x30,0x01,0xa9,0x93,0x64,0x00,0x01,0x24, - 0x05,0x00,0x21,0x11,0x04,0x00,0x01,0x24,0x03,0x00,0x21,0x11, - 0x44,0x00,0x01,0x24,0x23,0x00,0x21,0x15,0x30,0x01,0xac,0x93, - 0x30,0x01,0xaa,0x93,0x64,0x00,0x01,0x24,0x03,0x00,0x41,0x15, - 0x21,0xf0,0x00,0x00,0x02,0x00,0x00,0x10,0x04,0x00,0x03,0x24, - 0x10,0x00,0x03,0x24,0x87,0xfd,0x60,0x18,0x00,0xa3,0x02,0x3c, - 0x00,0x89,0x1e,0x00,0x21,0x80,0x51,0x02,0x21,0x28,0x00,0x02, - 0x29,0x2a,0x00,0x0c,0xac,0x86,0x84,0x27,0x00,0xa0,0x01,0x3c, - 0x25,0x20,0x01,0x02,0x6d,0x2a,0x00,0x0c,0x10,0x00,0x05,0x24, - 0x29,0x2a,0x00,0x0c,0xb4,0x86,0x84,0x27,0x30,0x01,0xab,0x93, - 0x64,0x00,0x01,0x24,0x01,0x00,0xde,0x27,0x03,0x00,0x61,0x15, - 0x10,0x00,0x31,0x26,0x02,0x00,0x00,0x10,0x04,0x00,0x03,0x24, - 0x10,0x00,0x03,0x24,0x2a,0x08,0xc3,0x03,0xed,0xff,0x20,0x14, - 0x21,0x80,0x51,0x02,0x6f,0xfd,0x00,0x10,0x00,0xa3,0x02,0x3c, - 0x30,0x01,0xac,0x93,0x72,0x00,0x01,0x24,0x07,0x00,0x81,0x15, - 0x00,0xa0,0x01,0x3c,0x25,0x68,0x41,0x02,0x00,0x00,0xa5,0x91, - 0x29,0x2a,0x00,0x0c,0xb8,0x86,0x84,0x27,0x65,0xfd,0x00,0x10, - 0x00,0xa3,0x02,0x3c,0x30,0x01,0xae,0x93,0x12,0x00,0x01,0x24, - 0x07,0x00,0xc1,0x15,0x00,0xa0,0x01,0x3c,0x25,0x78,0x41,0x02, - 0x00,0x00,0xe5,0x95,0x29,0x2a,0x00,0x0c,0xc0,0x86,0x84,0x27, - 0x5b,0xfd,0x00,0x10,0x00,0xa3,0x02,0x3c,0x30,0x01,0xb8,0x93, - 0x52,0x00,0x01,0x24,0x07,0x00,0x01,0x17,0x00,0xa0,0x01,0x3c, - 0x25,0xc8,0x41,0x02,0x00,0x00,0x25,0x8f,0x29,0x2a,0x00,0x0c, - 0xc8,0x86,0x84,0x27,0x51,0xfd,0x00,0x10,0x00,0xa3,0x02,0x3c, - 0x30,0x01,0xa8,0x93,0x66,0x00,0x01,0x24,0x03,0x00,0x01,0x11, - 0x77,0x00,0x01,0x24,0x06,0x00,0x01,0x15,0x30,0x01,0xa9,0x93, - 0x29,0x2a,0x00,0x0c,0xd0,0x86,0x84,0x27,0x0d,0x00,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xa9,0x93,0x06,0x00,0x01,0x24, - 0x03,0x00,0x21,0x11,0x17,0x00,0x01,0x24,0x05,0x00,0x21,0x15, - 0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c,0xd4,0x86,0x84,0x27, - 0x03,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c, - 0xd8,0x86,0x84,0x27,0x29,0x2a,0x00,0x0c,0xdc,0x86,0x84,0x27, - 0x14,0x23,0x00,0x0c,0x10,0x00,0x04,0x24,0x21,0x80,0x40,0x00, - 0x29,0x2a,0x00,0x0c,0xf0,0x86,0x84,0x27,0x30,0x01,0xaa,0x93, - 0x66,0x00,0x01,0x24,0x05,0x00,0x41,0x11,0x06,0x00,0x01,0x24, - 0x03,0x00,0x41,0x11,0x46,0x00,0x01,0x24,0x0b,0x00,0x41,0x15, - 0x21,0xa8,0x00,0x00,0x29,0x2a,0x00,0x0c,0xf4,0x86,0x84,0x27, - 0x14,0x23,0x00,0x0c,0x10,0x00,0x04,0x24,0xff,0xff,0x55,0x24, - 0x29,0x2a,0x00,0x0c,0x04,0x87,0x84,0x27,0x03,0x00,0x00,0x10, - 0x00,0xa0,0x01,0x3c,0x21,0xa8,0x00,0x00,0x00,0xa0,0x01,0x3c, - 0x25,0x90,0x41,0x02,0x30,0x01,0xab,0x93,0x77,0x00,0x01,0x24, - 0x03,0x00,0x61,0x11,0x66,0x00,0x01,0x24,0x05,0x00,0x61,0x15, - 0x30,0x01,0xad,0x93,0x21,0x60,0x55,0x02,0x0e,0x00,0x00,0x10, - 0x00,0x00,0x90,0xa1,0x30,0x01,0xad,0x93,0x17,0x00,0x01,0x24, - 0x03,0x00,0xa1,0x11,0x06,0x00,0x01,0x24,0x06,0x00,0xa1,0x15, - 0x80,0xc0,0x15,0x00,0x40,0x70,0x15,0x00,0x21,0x78,0x4e,0x02, - 0x04,0x00,0x00,0x10,0x00,0x00,0xf0,0xa5,0x80,0xc0,0x15,0x00, - 0x21,0xc8,0x58,0x02,0x00,0x00,0x30,0xaf,0xff,0xff,0xb5,0x26, - 0xe9,0xff,0xa1,0x06,0x30,0x01,0xab,0x93,0x05,0xfd,0x00,0x10, - 0x00,0xa3,0x02,0x3c,0xc9,0x2a,0x00,0x0c,0x21,0x20,0x00,0x00, - 0x00,0xa3,0x08,0x3c,0x88,0x01,0x02,0xad,0x01,0x00,0x09,0x24, - 0x00,0xa3,0x0a,0x3c,0xfc,0xfc,0x00,0x10,0xc8,0x01,0x49,0xa1, - 0x00,0xa3,0x04,0x3c,0x00,0xa3,0x05,0x3c,0x10,0x40,0xa5,0x34, - 0x00,0x10,0x84,0x34,0x21,0x30,0x00,0x00,0x21,0x38,0x00,0x00, - 0xfe,0x2b,0x00,0x0c,0x10,0x00,0xa0,0xaf,0x00,0xa3,0x0b,0x3c, - 0x88,0x01,0x62,0xad,0x01,0x00,0x0c,0x24,0x00,0xa3,0x0d,0x3c, - 0xee,0xfc,0x00,0x10,0xc8,0x01,0xac,0xa1,0x00,0xa3,0x0e,0x3c, - 0x88,0x01,0xde,0x8d,0x10,0x00,0xa0,0xaf,0x21,0x28,0x00,0x00, - 0x21,0x30,0x00,0x00,0x21,0x38,0x00,0x00,0x94,0x2e,0x00,0x0c, - 0x21,0x20,0xc0,0x03,0x00,0xa3,0x0f,0x3c,0x88,0x01,0xe2,0xad, - 0x01,0x00,0x18,0x24,0x00,0xa3,0x19,0x3c,0xe0,0xfc,0x00,0x10, - 0xc8,0x01,0x38,0xa3,0x00,0xa3,0x02,0x3c,0x88,0x01,0x42,0x34, - 0x00,0x00,0x5e,0x8c,0x00,0x00,0x55,0x8c,0xff,0xff,0x08,0x24, - 0x02,0xaa,0x15,0x00,0xff,0x00,0xb5,0x32,0xff,0x00,0xde,0x33, - 0x21,0x20,0xc0,0x03,0x23,0x28,0x15,0x01,0x10,0x00,0xa0,0xaf, - 0x21,0x30,0x00,0x00,0x94,0x2e,0x00,0x0c,0x01,0x00,0x07,0x24, - 0x00,0xa3,0x09,0x3c,0x88,0x01,0x22,0xad,0x01,0x00,0x0a,0x24, - 0x00,0xa3,0x0b,0x3c,0xcc,0xfc,0x00,0x10,0xc8,0x01,0x6a,0xa1, - 0x30,0x01,0xac,0x93,0x49,0x00,0x01,0x24,0x1d,0xff,0x81,0x11, - 0x4a,0x00,0x81,0x2d,0x4d,0x00,0x20,0x10,0x33,0x00,0x01,0x24, - 0x5d,0xfe,0x81,0x11,0x34,0x00,0x81,0x2d,0x25,0x00,0x20,0x10, - 0x17,0x00,0x01,0x24,0x21,0xff,0x81,0x11,0x18,0x00,0x81,0x2d, - 0x11,0x00,0x20,0x10,0x06,0x00,0x01,0x24,0x1d,0xff,0x81,0x11, - 0x07,0x00,0x81,0x2d,0x05,0x00,0x20,0x10,0x04,0x00,0x01,0x24, - 0x19,0xff,0x81,0x11,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xad,0x93,0x12,0x00,0x01,0x24, - 0x13,0xff,0xa1,0x11,0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c, - 0x08,0x87,0x84,0x27,0xaf,0xfc,0x00,0x10,0x00,0xa3,0x02,0x3c, - 0x30,0x01,0xae,0x93,0x31,0x00,0x01,0x24,0x95,0xfd,0xc1,0x11, - 0x32,0x00,0xc1,0x2d,0x05,0x00,0x20,0x10,0x24,0x00,0x01,0x24, - 0xed,0xfd,0xc1,0x11,0x00,0x00,0x00,0x00,0xf3,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xaf,0x93,0x32,0x00,0x01,0x24, - 0xad,0xfd,0xe1,0x11,0x00,0x00,0x00,0x00,0xed,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xb8,0x93,0x41,0x00,0x01,0x24, - 0xe4,0xfc,0x01,0x13,0x42,0x00,0x01,0x2f,0x0f,0x00,0x20,0x10, - 0x35,0x00,0x01,0x24,0xa4,0xfe,0x01,0x13,0x36,0x00,0x01,0x2f, - 0x05,0x00,0x20,0x10,0x34,0x00,0x01,0x24,0x2b,0xfe,0x01,0x13, - 0x00,0x00,0x00,0x00,0xdf,0xff,0x00,0x10,0x00,0x00,0x00,0x00, - 0x30,0x01,0xb9,0x93,0x3f,0x00,0x01,0x24,0xba,0xfc,0x21,0x13, - 0x00,0x00,0x00,0x00,0xd9,0xff,0x00,0x10,0x00,0x00,0x00,0x00, - 0x30,0x01,0xa8,0x93,0x45,0x00,0x01,0x24,0xce,0xfc,0x01,0x11, - 0x46,0x00,0x01,0x2d,0x05,0x00,0x20,0x10,0x44,0x00,0x01,0x24, - 0xe3,0xfe,0x01,0x11,0x00,0x00,0x00,0x00,0xcf,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xa9,0x93,0x46,0x00,0x01,0x24, - 0xdd,0xfe,0x21,0x11,0x00,0x00,0x00,0x00,0xc9,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xaa,0x93,0x72,0x00,0x01,0x24, - 0xd7,0xfe,0x41,0x11,0x73,0x00,0x41,0x2d,0x23,0x00,0x20,0x10, - 0x64,0x00,0x01,0x24,0xd3,0xfe,0x41,0x11,0x65,0x00,0x41,0x2d, - 0x0f,0x00,0x20,0x10,0x57,0x00,0x01,0x24,0xcf,0xfe,0x41,0x11, - 0x58,0x00,0x41,0x2d,0x05,0x00,0x20,0x10,0x52,0x00,0x01,0x24, - 0xcb,0xfe,0x41,0x11,0x00,0x00,0x00,0x00,0xb7,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xab,0x93,0x61,0x00,0x01,0x24, - 0xae,0xfc,0x61,0x11,0x00,0x00,0x00,0x00,0xb1,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xac,0x93,0x66,0x00,0x01,0x24, - 0xbf,0xfe,0x81,0x11,0x67,0x00,0x81,0x2d,0x05,0x00,0x20,0x10, - 0x65,0x00,0x01,0x24,0xa4,0xfc,0x81,0x11,0x00,0x00,0x00,0x00, - 0xa7,0xff,0x00,0x10,0x00,0x00,0x00,0x00,0x30,0x01,0xad,0x93, - 0x69,0x00,0x01,0x24,0xa9,0xfe,0xa1,0x11,0x00,0x00,0x00,0x00, - 0xa1,0xff,0x00,0x10,0x00,0x00,0x00,0x00,0x30,0x01,0xae,0x93, - 0x83,0x00,0x01,0x24,0x61,0xff,0xc1,0x11,0x84,0x00,0xc1,0x2d, - 0x0f,0x00,0x20,0x10,0x81,0x00,0x01,0x24,0x47,0xff,0xc1,0x11, - 0x82,0x00,0xc1,0x2d,0x05,0x00,0x20,0x10,0x77,0x00,0x01,0x24, - 0xa7,0xfe,0xc1,0x11,0x00,0x00,0x00,0x00,0x93,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xaf,0x93,0x82,0x00,0x01,0x24, - 0x46,0xff,0xe1,0x11,0x00,0xa3,0x04,0x3c,0x8d,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x30,0x01,0xb8,0x93,0x84,0x00,0x01,0x24, - 0x5c,0xff,0x01,0x13,0x00,0xa3,0x02,0x3c,0x87,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x24,0x00,0xbf,0x8f,0x38,0x01,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0xa3,0x03,0x3c, - 0x80,0x01,0x63,0x34,0x4a,0x00,0x6e,0x94,0xff,0x00,0x84,0x30, - 0x21,0x78,0x6e,0x00,0x50,0x00,0xe4,0xa1,0x4a,0x00,0x78,0x94, - 0x4e,0x00,0x68,0x94,0x01,0x00,0x19,0x27,0x4c,0x00,0x69,0x94, - 0x24,0x10,0x28,0x03,0xff,0xff,0x42,0x30,0x02,0x00,0x49,0x10, - 0x00,0x00,0x00,0x00,0x4a,0x00,0x62,0xa4,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xe8,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf, - 0x00,0xa3,0x0e,0x3c,0x80,0x01,0xcf,0x8d,0x01,0x00,0x01,0x24, - 0x09,0x00,0xe1,0x15,0x00,0x00,0x00,0x00,0x30,0x87,0x83,0x97, - 0x00,0x00,0x00,0x00,0x21,0x10,0x60,0x00,0xff,0xff,0x63,0x24, - 0x03,0x00,0x40,0x10,0xff,0xff,0x63,0x30,0x0f,0x00,0x00,0x10, - 0x30,0x87,0x83,0xa7,0x2c,0x87,0x98,0x97,0x00,0xa1,0x08,0x3c, - 0x01,0x00,0x19,0x27,0x2c,0x87,0x99,0xa7,0xe8,0x03,0x03,0x24, - 0x00,0x40,0x00,0xa5,0x30,0x87,0x83,0xa7,0xe1,0x21,0x00,0x0c, - 0x21,0x20,0x00,0x00,0x01,0x00,0x09,0x24,0x00,0xa3,0x0a,0x3c, - 0x80,0x01,0x49,0xad,0xe1,0x21,0x00,0x0c,0x01,0x04,0x04,0x24, - 0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0x00,0xa3,0x02,0x3c,0xcc,0x01,0x42,0x34, - 0x00,0x00,0x4e,0x94,0x00,0x00,0x00,0x00,0x0d,0x00,0xc0,0x11, - 0x00,0x00,0x00,0x00,0x00,0xa3,0x03,0x3c,0xca,0x01,0x63,0x34, - 0x00,0x00,0x6f,0x94,0x00,0x00,0x58,0x94,0x00,0x00,0x00,0x00, - 0x06,0x00,0xf8,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x79,0x94, - 0x00,0x00,0x48,0x94,0x00,0x00,0x00,0x00,0xfc,0xff,0x28,0x17, - 0x00,0x00,0x00,0x00,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x2b,0x08,0x85,0x00,0x08,0x00,0x20,0x10, - 0x21,0x18,0x00,0x00,0x00,0x00,0x8e,0x8c,0x04,0x00,0x84,0x24, - 0x21,0x10,0x6e,0x00,0x2b,0x78,0x43,0x00,0x2b,0x08,0x85,0x00, - 0xfa,0xff,0x20,0x14,0x21,0x18,0x4f,0x00,0x08,0x00,0xe0,0x03, - 0x21,0x10,0x60,0x00,0xe8,0xff,0xbd,0x27,0x00,0xa3,0x07,0x3c, - 0x30,0x0c,0xe7,0x34,0x14,0x00,0xbf,0xaf,0x00,0x00,0xee,0x90, - 0x00,0x00,0x00,0x00,0x3c,0x00,0xc0,0x11,0x14,0x00,0xbf,0x8f, - 0x00,0xa3,0x0f,0x3c,0x32,0x0c,0xf8,0x91,0x00,0x00,0x00,0x00, - 0x37,0x00,0x00,0x17,0x14,0x00,0xbf,0x8f,0x00,0xa3,0x03,0x3c, - 0x34,0x0c,0x63,0x34,0x00,0x00,0x65,0x8c,0xff,0x3f,0x01,0x3c, - 0x00,0xa3,0x06,0x3c,0xff,0xff,0x21,0x34,0x38,0x0c,0xc6,0x34, - 0x24,0x28,0xa1,0x00,0x00,0x00,0xd9,0x94,0x00,0x80,0x01,0x3c, - 0x25,0x28,0xa1,0x00,0x81,0x00,0x21,0x2f,0x03,0x00,0x20,0x14, - 0x00,0x00,0x00,0x00,0x80,0x00,0x08,0x24,0x00,0x00,0xc8,0xa4, - 0x00,0x00,0xe2,0x90,0x1d,0x00,0x00,0x10,0x01,0x00,0x01,0x24, - 0x00,0xa3,0x04,0x3c,0x00,0x00,0xc2,0x94,0x21,0x18,0xa0,0x00, - 0x05,0x00,0x00,0x10,0x3a,0x0c,0x84,0x34,0x00,0xa3,0x03,0x3c, - 0x00,0x00,0xc2,0x94,0x3a,0x0c,0x63,0x34,0x21,0x20,0xa0,0x00, - 0xff,0xff,0x42,0x24,0x07,0x00,0x40,0x04,0x00,0x00,0x00,0x00, - 0x00,0x00,0x69,0x90,0xff,0xff,0x42,0x24,0x01,0x00,0x63,0x24, - 0x01,0x00,0x84,0x24,0xfb,0xff,0x41,0x04,0xff,0xff,0x89,0xa0, - 0x0f,0x00,0x00,0x10,0x00,0x00,0xe0,0xa0,0x00,0x00,0xe0,0xa0, - 0x00,0x00,0x6a,0x8c,0x00,0x00,0x00,0x00,0x09,0xf8,0x40,0x01, - 0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x10,0x14,0x00,0xbf,0x8f, - 0x01,0x00,0x01,0x24,0xe3,0xff,0x41,0x10,0x02,0x00,0x01,0x24, - 0xe6,0xff,0x41,0x10,0x03,0x00,0x01,0x24,0xf3,0xff,0x41,0x10, - 0x00,0x00,0x00,0x00,0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0xe8,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf, - 0x13,0x00,0x00,0x10,0xff,0x00,0x84,0x30,0x40,0x87,0x82,0x93, - 0x00,0x00,0x00,0x00,0x01,0x00,0x4e,0x30,0x1a,0x00,0xc0,0x15, - 0x14,0x00,0xbf,0x8f,0x01,0x00,0x42,0x34,0xff,0x00,0x42,0x30, - 0x11,0x00,0x00,0x10,0x40,0x87,0x82,0xa3,0x40,0x87,0x82,0x93, - 0x00,0x00,0x00,0x00,0x02,0x00,0x4f,0x30,0x11,0x00,0xe0,0x15, - 0x14,0x00,0xbf,0x8f,0x02,0x00,0x42,0x34,0xff,0x00,0x42,0x30, - 0x08,0x00,0x00,0x10,0x40,0x87,0x82,0xa3,0x0a,0x00,0x01,0x24, - 0xec,0xff,0x81,0x10,0x0d,0x00,0x01,0x24,0xf3,0xff,0x81,0x10, - 0x00,0x00,0x00,0x00,0x21,0x10,0x00,0x00,0x40,0x87,0x82,0xa3, - 0xc1,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0xf3,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xe8,0xff,0xbd,0x27, - 0x14,0x00,0xbf,0xaf,0x5c,0x28,0x00,0x0c,0xff,0x00,0x84,0x30, - 0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xa0,0xff,0xbd,0x27,0x18,0x00,0xb0,0xaf, - 0x1c,0x00,0xb1,0xaf,0x21,0x88,0xe0,0x00,0x24,0x00,0xbf,0xaf, - 0x20,0x00,0xb2,0xaf,0x68,0x00,0xa6,0xaf,0x04,0x00,0xa0,0x14, - 0x21,0x80,0x00,0x00,0x70,0x00,0xa2,0x8f,0x0a,0x00,0x00,0x10, - 0x5b,0x00,0xb2,0x27,0x70,0x00,0xa2,0x8f,0x00,0x00,0x00,0x00, - 0x06,0x00,0x41,0x04,0x5b,0x00,0xb2,0x27,0x2d,0x00,0x10,0x24, - 0x02,0x00,0x20,0x12,0x23,0x10,0x02,0x00,0xff,0xff,0x31,0x26, - 0x5b,0x00,0xb2,0x27,0x5b,0x00,0xa0,0xa3,0x44,0x87,0x83,0x27, - 0x1b,0x00,0x44,0x00,0xff,0xff,0x52,0x26,0x10,0x70,0x00,0x00, - 0x21,0x78,0x6e,0x00,0x00,0x00,0xf8,0x91,0x00,0x00,0x00,0x00, - 0x00,0x00,0x58,0xa2,0x02,0x00,0x80,0x14,0x00,0x00,0x00,0x00, - 0x0d,0x00,0x07,0x00,0x02,0x00,0x20,0x12,0x00,0x00,0x00,0x00, - 0xff,0xff,0x31,0x26,0x1b,0x00,0x44,0x00,0x12,0x10,0x00,0x00, - 0x02,0x00,0x80,0x14,0x00,0x00,0x00,0x00,0x0d,0x00,0x07,0x00, - 0xed,0xff,0x40,0x14,0x00,0x00,0x00,0x00,0x68,0x00,0xb9,0x93, - 0x01,0x00,0x01,0x24,0x09,0x00,0x21,0x17,0x00,0x00,0x00,0x00, - 0x21,0x10,0x20,0x02,0x06,0x00,0x40,0x10,0xff,0xff,0x31,0x26, - 0x81,0x28,0x00,0x0c,0x20,0x00,0x04,0x24,0x21,0x10,0x20,0x02, - 0xfc,0xff,0x40,0x14,0xff,0xff,0x31,0x26,0x04,0x00,0x00,0x12, - 0x68,0x00,0xa8,0x93,0x81,0x28,0x00,0x0c,0x21,0x20,0x00,0x02, - 0x68,0x00,0xa8,0x93,0x02,0x00,0x01,0x24,0x09,0x00,0x01,0x15, - 0x00,0x00,0x00,0x00,0x21,0x10,0x20,0x02,0x06,0x00,0x40,0x10, - 0xff,0xff,0x31,0x26,0x81,0x28,0x00,0x0c,0x30,0x00,0x04,0x24, - 0x21,0x10,0x20,0x02,0xfc,0xff,0x40,0x14,0xff,0xff,0x31,0x26, - 0x00,0x00,0x50,0x92,0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x12, - 0x68,0x00,0xa9,0x93,0x21,0x20,0x00,0x02,0x81,0x28,0x00,0x0c, - 0x01,0x00,0x52,0x26,0x00,0x00,0x50,0x92,0x00,0x00,0x00,0x00, - 0xfb,0xff,0x00,0x16,0x21,0x20,0x00,0x02,0x68,0x00,0xa9,0x93, - 0x03,0x00,0x01,0x24,0x0a,0x00,0x21,0x15,0x24,0x00,0xbf,0x8f, - 0x21,0x10,0x20,0x02,0x06,0x00,0x40,0x10,0xff,0xff,0x31,0x26, - 0x81,0x28,0x00,0x0c,0x20,0x00,0x04,0x24,0x21,0x10,0x20,0x02, - 0xfc,0xff,0x40,0x14,0xff,0xff,0x31,0x26,0x24,0x00,0xbf,0x8f, - 0x18,0x00,0xb0,0x8f,0x1c,0x00,0xb1,0x8f,0x20,0x00,0xb2,0x8f, - 0x08,0x00,0xe0,0x03,0x60,0x00,0xbd,0x27,0x00,0x00,0x82,0x90, - 0x21,0x18,0x00,0x00,0x05,0x00,0x40,0x10,0x01,0x00,0x84,0x24, - 0x00,0x00,0x82,0x90,0x01,0x00,0x63,0x24,0xfd,0xff,0x40,0x14, - 0x01,0x00,0x84,0x24,0x08,0x00,0xe0,0x03,0x21,0x10,0x60,0x00, - 0xd8,0xff,0xbd,0x27,0x20,0x00,0xb2,0xaf,0x21,0x90,0xc0,0x00, - 0x24,0x00,0xbf,0xaf,0x1c,0x00,0xb1,0xaf,0x28,0x00,0xa4,0xaf, - 0x21,0x88,0xa0,0x00,0x18,0x00,0xb0,0xaf,0xed,0x28,0x00,0x0c, - 0x21,0x20,0x40,0x02,0x2a,0x08,0x51,0x00,0x03,0x00,0x20,0x10, - 0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x10,0x23,0x88,0x22,0x02, - 0x21,0x88,0x00,0x00,0x28,0x00,0xae,0x93,0x01,0x00,0x01,0x24, - 0x0a,0x00,0xc1,0x15,0x28,0x00,0xaf,0x93,0x21,0x10,0x20,0x02, - 0x06,0x00,0x40,0x10,0xff,0xff,0x31,0x26,0x81,0x28,0x00,0x0c, - 0x20,0x00,0x04,0x24,0x21,0x10,0x20,0x02,0xfc,0xff,0x40,0x14, - 0xff,0xff,0x31,0x26,0x28,0x00,0xaf,0x93,0x02,0x00,0x01,0x24, - 0x09,0x00,0xe1,0x15,0x00,0x00,0x00,0x00,0x21,0x10,0x20,0x02, - 0x06,0x00,0x40,0x10,0xff,0xff,0x31,0x26,0x81,0x28,0x00,0x0c, - 0x30,0x00,0x04,0x24,0x21,0x10,0x20,0x02,0xfc,0xff,0x40,0x14, - 0xff,0xff,0x31,0x26,0x00,0x00,0x50,0x92,0x00,0x00,0x00,0x00, - 0x09,0x00,0x00,0x12,0x28,0x00,0xb8,0x93,0x21,0x20,0x00,0x02, - 0x81,0x28,0x00,0x0c,0x01,0x00,0x52,0x26,0x00,0x00,0x50,0x92, - 0x00,0x00,0x00,0x00,0xfb,0xff,0x00,0x16,0x21,0x20,0x00,0x02, - 0x28,0x00,0xb8,0x93,0x03,0x00,0x01,0x24,0x0a,0x00,0x01,0x17, - 0x24,0x00,0xbf,0x8f,0x21,0x10,0x20,0x02,0x06,0x00,0x40,0x10, - 0xff,0xff,0x31,0x26,0x81,0x28,0x00,0x0c,0x20,0x00,0x04,0x24, - 0x21,0x10,0x20,0x02,0xfc,0xff,0x40,0x14,0xff,0xff,0x31,0x26, - 0x24,0x00,0xbf,0x8f,0x18,0x00,0xb0,0x8f,0x1c,0x00,0xb1,0x8f, - 0x20,0x00,0xb2,0x8f,0x08,0x00,0xe0,0x03,0x28,0x00,0xbd,0x27, - 0xc0,0xff,0xbd,0x27,0x40,0x00,0xa4,0xaf,0x40,0x00,0xae,0x8f, - 0x24,0x00,0xbf,0xaf,0x44,0x00,0xa5,0xaf,0x01,0x00,0xcf,0x91, - 0x21,0x40,0x00,0x00,0x21,0x38,0x00,0x00,0xdd,0x00,0xe0,0x11, - 0x01,0x00,0x02,0x24,0x01,0x00,0xc9,0x25,0x00,0x00,0x23,0x91, - 0x62,0x00,0x04,0x24,0x35,0x00,0x05,0x24,0x31,0x00,0x06,0x24, - 0x2d,0x00,0x0a,0x24,0x30,0x00,0x0b,0x24,0x33,0x00,0x0c,0x24, - 0x32,0x00,0x0d,0x24,0x34,0x00,0x1f,0x24,0x6d,0x00,0x00,0x10, - 0x21,0x10,0x60,0x00,0x25,0x00,0x04,0x24,0x81,0x28,0x00,0x0c, - 0x2c,0x00,0xa9,0xaf,0x2c,0x00,0xa9,0x8f,0xce,0x00,0x00,0x10, - 0x01,0x00,0x22,0x25,0x21,0x20,0x00,0x00,0x21,0x28,0x00,0x00, - 0x58,0x87,0x86,0x27,0xf7,0x28,0x00,0x0c,0x2c,0x00,0xa9,0xaf, - 0x2c,0x00,0xa9,0x8f,0xc6,0x00,0x00,0x10,0x01,0x00,0x22,0x25, - 0x44,0x00,0xa4,0x93,0x81,0x28,0x00,0x0c,0x2c,0x00,0xa9,0xaf, - 0x2c,0x00,0xa9,0x8f,0xc0,0x00,0x00,0x10,0x01,0x00,0x22,0x25, - 0x44,0x00,0xb8,0x8f,0x02,0x00,0x04,0x24,0x21,0x28,0x00,0x00, - 0x21,0x30,0x00,0x01,0x2c,0x00,0xa9,0xaf,0x89,0x28,0x00,0x0c, - 0x10,0x00,0xb8,0xaf,0x2c,0x00,0xa9,0x8f,0x81,0x28,0x00,0x0c, - 0x42,0x00,0x04,0x24,0x2c,0x00,0xa9,0x8f,0xb3,0x00,0x00,0x10, - 0x01,0x00,0x22,0x25,0x44,0x00,0xb9,0x8f,0x08,0x00,0x04,0x24, - 0x21,0x28,0x00,0x00,0x21,0x30,0x00,0x01,0x2c,0x00,0xa9,0xaf, - 0x89,0x28,0x00,0x0c,0x10,0x00,0xb9,0xaf,0x2c,0x00,0xa9,0x8f, - 0x81,0x28,0x00,0x0c,0x51,0x00,0x04,0x24,0x2c,0x00,0xa9,0x8f, - 0xa6,0x00,0x00,0x10,0x01,0x00,0x22,0x25,0x44,0x00,0xaf,0x8f, - 0x0a,0x00,0x04,0x24,0x01,0x00,0x05,0x24,0x21,0x30,0x00,0x01, - 0x2c,0x00,0xa9,0xaf,0x89,0x28,0x00,0x0c,0x10,0x00,0xaf,0xaf, - 0x2c,0x00,0xa9,0x8f,0x9c,0x00,0x00,0x10,0x01,0x00,0x22,0x25, - 0x44,0x00,0xae,0x8f,0x0a,0x00,0x04,0x24,0x21,0x28,0x00,0x00, - 0x21,0x30,0x00,0x01,0x2c,0x00,0xa9,0xaf,0x89,0x28,0x00,0x0c, - 0x10,0x00,0xae,0xaf,0x2c,0x00,0xa9,0x8f,0x92,0x00,0x00,0x10, - 0x01,0x00,0x22,0x25,0x21,0x20,0x00,0x00,0x21,0x28,0x00,0x00, - 0x64,0x87,0x86,0x27,0x34,0x00,0xa7,0xaf,0x38,0x00,0xa8,0xa3, - 0xf7,0x28,0x00,0x0c,0x2c,0x00,0xa9,0xaf,0x34,0x00,0xa7,0x8f, - 0x38,0x00,0xa8,0x93,0x2c,0x00,0xa9,0x8f,0x00,0x00,0x00,0x00, - 0x44,0x00,0xb8,0x8f,0x10,0x00,0x04,0x24,0x21,0x28,0x00,0x00, - 0x21,0x30,0x00,0x01,0x2c,0x00,0xa9,0xaf,0x89,0x28,0x00,0x0c, - 0x10,0x00,0xb8,0xaf,0x2c,0x00,0xa9,0x8f,0x7d,0x00,0x00,0x10, - 0x01,0x00,0x22,0x25,0x44,0x00,0xa6,0x8f,0x21,0x20,0x00,0x01, - 0x21,0x28,0xe0,0x00,0xf7,0x28,0x00,0x0c,0x2c,0x00,0xa9,0xaf, - 0x2c,0x00,0xa9,0x8f,0x75,0x00,0x00,0x10,0x01,0x00,0x22,0x25, - 0x6c,0x00,0x00,0x10,0x03,0x00,0x08,0x24,0x03,0x00,0x00,0x15, - 0x80,0xc8,0x07,0x00,0x02,0x00,0x08,0x24,0x80,0xc8,0x07,0x00, - 0x21,0xc8,0x27,0x03,0x40,0xc8,0x19,0x00,0x21,0x38,0x23,0x03, - 0x63,0x00,0x00,0x15,0xd0,0xff,0xe7,0x24,0x61,0x00,0x00,0x10, - 0x01,0x00,0x08,0x24,0xa7,0xff,0x44,0x10,0x63,0x00,0x41,0x2c, - 0x3e,0x00,0x20,0x10,0x6f,0x00,0x01,0x24,0xf3,0xff,0x45,0x10, - 0x36,0x00,0x41,0x2c,0x1f,0x00,0x20,0x10,0x39,0x00,0x01,0x24, - 0xef,0xff,0x46,0x10,0x32,0x00,0x41,0x2c,0x0e,0x00,0x20,0x10, - 0x00,0x00,0x00,0x00,0xe6,0xff,0x4a,0x10,0x2e,0x00,0x41,0x2c, - 0x05,0x00,0x20,0x10,0x25,0x00,0x01,0x24,0x84,0xff,0x41,0x10, - 0x25,0x00,0x04,0x24,0x04,0x00,0x00,0x10,0x40,0x00,0xa2,0x8f, - 0xe0,0xff,0x4b,0x10,0x00,0x00,0x00,0x00,0x40,0x00,0xa2,0x8f, - 0x4f,0x00,0x00,0x10,0x01,0x00,0x42,0x24,0xde,0xff,0x4c,0x10, - 0x34,0x00,0x41,0x2c,0x05,0x00,0x20,0x10,0x00,0x00,0x00,0x00, - 0xdb,0xff,0x4d,0x10,0x80,0xc8,0x07,0x00,0xf7,0xff,0x00,0x10, - 0x40,0x00,0xa2,0x8f,0xd7,0xff,0x5f,0x10,0x80,0xc8,0x07,0x00, - 0xf3,0xff,0x00,0x10,0x40,0x00,0xa2,0x8f,0x39,0x00,0x01,0x24, - 0xd1,0xff,0x41,0x10,0x3a,0x00,0x41,0x2c,0x0e,0x00,0x20,0x10, - 0x37,0x00,0x01,0x24,0xcd,0xff,0x41,0x10,0x38,0x00,0x41,0x2c, - 0x05,0x00,0x20,0x10,0x36,0x00,0x01,0x24,0xca,0xff,0x41,0x10, - 0x80,0xc8,0x07,0x00,0xe6,0xff,0x00,0x10,0x40,0x00,0xa2,0x8f, - 0x38,0x00,0x01,0x24,0xc5,0xff,0x41,0x10,0x80,0xc8,0x07,0x00, - 0xe1,0xff,0x00,0x10,0x40,0x00,0xa2,0x8f,0x58,0x00,0x01,0x24, - 0xa8,0xff,0x41,0x10,0x59,0x00,0x41,0x2c,0xdb,0xff,0x20,0x10, - 0x45,0x00,0x01,0x24,0x5e,0xff,0x41,0x10,0x21,0x20,0x00,0x00, - 0xd8,0xff,0x00,0x10,0x40,0x00,0xa2,0x8f,0x6f,0x00,0x01,0x24, - 0x73,0xff,0x41,0x10,0x70,0x00,0x41,0x2c,0x0e,0x00,0x20,0x10, - 0x64,0x00,0x01,0x24,0x7c,0xff,0x41,0x10,0x65,0x00,0x41,0x2c, - 0x05,0x00,0x20,0x10,0x63,0x00,0x01,0x24,0x59,0xff,0x41,0x10, - 0x44,0x00,0xa4,0x93,0xcb,0xff,0x00,0x10,0x40,0x00,0xa2,0x8f, - 0x6c,0x00,0x01,0x24,0x11,0x00,0x41,0x10,0x00,0x00,0x00,0x00, - 0xc6,0xff,0x00,0x10,0x40,0x00,0xa2,0x8f,0x75,0x00,0x01,0x24, - 0x78,0xff,0x41,0x10,0x76,0x00,0x41,0x2c,0x05,0x00,0x20,0x10, - 0x73,0x00,0x01,0x24,0x94,0xff,0x41,0x10,0x44,0x00,0xa6,0x8f, - 0xbd,0xff,0x00,0x10,0x40,0x00,0xa2,0x8f,0x78,0x00,0x01,0x24, - 0x7a,0xff,0x41,0x10,0x21,0x20,0x00,0x00,0xb8,0xff,0x00,0x10, - 0x40,0x00,0xa2,0x8f,0x01,0x00,0x23,0x91,0x01,0x00,0x29,0x25, - 0x2f,0xff,0x60,0x14,0x00,0x00,0x00,0x00,0x40,0x00,0xa2,0x8f, - 0x00,0x00,0x00,0x00,0x01,0x00,0x42,0x24,0x24,0x00,0xbf,0x8f, - 0x40,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xb8,0xff,0xbd,0x27,0x20,0x00,0xb4,0xaf,0x48,0x00,0xae,0x27, - 0xfc,0xff,0x14,0x24,0x03,0x00,0xcf,0x25,0x24,0x00,0xbf,0xaf, - 0x18,0x00,0xb0,0xaf,0x1c,0x00,0xb1,0xaf,0x48,0x00,0xa4,0xaf, - 0x4c,0x00,0xa5,0xaf,0x50,0x00,0xa6,0xaf,0x54,0x00,0xa7,0xaf, - 0x24,0x10,0xf4,0x01,0x00,0x00,0x50,0x8c,0x04,0x00,0x42,0x24, - 0x00,0x00,0x04,0x92,0x21,0x88,0x40,0x00,0x25,0x00,0x80,0x10, - 0x24,0x00,0xbf,0x8f,0x30,0x00,0xb2,0xaf,0x2c,0x00,0xb3,0xaf, - 0x45,0x00,0x13,0x24,0x25,0x00,0x12,0x24,0x21,0x10,0x80,0x00, - 0x14,0x00,0x52,0x14,0x00,0x00,0x00,0x00,0x01,0x00,0x02,0x92, - 0x00,0x00,0x00,0x00,0x04,0x00,0x42,0x12,0x21,0x20,0x00,0x02, - 0x07,0x00,0x62,0x16,0x03,0x00,0x38,0x26,0x21,0x20,0x00,0x02, - 0x3c,0x29,0x00,0x0c,0x21,0x28,0x00,0x00,0x0b,0x00,0x00,0x10, - 0x21,0x80,0x40,0x00,0x03,0x00,0x38,0x26,0x24,0x88,0x14,0x03, - 0x00,0x00,0x25,0x8e,0x04,0x00,0x31,0x26,0x3c,0x29,0x00,0x0c, - 0x21,0x20,0x00,0x02,0x03,0x00,0x00,0x10,0x21,0x80,0x40,0x00, - 0x81,0x28,0x00,0x0c,0x01,0x00,0x10,0x26,0x00,0x00,0x04,0x92, - 0x00,0x00,0x00,0x00,0xe5,0xff,0x80,0x14,0x00,0x00,0x00,0x00, - 0x30,0x00,0xb2,0x8f,0x2c,0x00,0xb3,0x8f,0x00,0x00,0x00,0x00, - 0x24,0x00,0xbf,0x8f,0x18,0x00,0xb0,0x8f,0x1c,0x00,0xb1,0x8f, - 0x20,0x00,0xb4,0x8f,0x08,0x00,0xe0,0x03,0x48,0x00,0xbd,0x27, - 0xe8,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf,0x29,0x2a,0x00,0x0c, - 0x68,0x87,0x84,0x27,0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xc0,0xff,0xbd,0x27, - 0x14,0x00,0xb1,0xaf,0x21,0x88,0xa0,0x00,0x18,0x00,0xb2,0xaf, - 0x21,0x90,0x80,0x00,0x24,0x00,0xbf,0xaf,0x20,0x00,0xb4,0xaf, - 0x03,0x00,0x20,0x1e,0x1c,0x00,0xb3,0xaf,0x05,0x00,0x00,0x10, - 0x01,0x00,0x11,0x24,0x1a,0x00,0x21,0x2a,0x03,0x00,0x20,0x14, - 0x21,0x98,0x20,0x02,0x19,0x00,0x11,0x24,0x21,0x98,0x20,0x02, - 0x21,0x10,0x20,0x02,0x21,0xa0,0x40,0x02,0x0d,0x00,0x40,0x10, - 0xff,0xff,0x31,0x26,0x2c,0x00,0xb0,0xaf,0x70,0x87,0x90,0x27, - 0x00,0x00,0x45,0x92,0x21,0x20,0x00,0x02,0x29,0x2a,0x00,0x0c, - 0xff,0x00,0xa5,0x30,0x21,0x10,0x20,0x02,0x01,0x00,0x52,0x26, - 0xf9,0xff,0x40,0x14,0xff,0xff,0x31,0x26,0x2c,0x00,0xb0,0x8f, - 0x00,0x00,0x00,0x00,0x11,0x00,0x61,0x2a,0x18,0x00,0x20,0x10, - 0x24,0x00,0xbf,0x8f,0x5c,0x28,0x00,0x0c,0x20,0x00,0x04,0x24, - 0x21,0x10,0x60,0x02,0x12,0x00,0x40,0x10,0xff,0xff,0x73,0x26, - 0x00,0x00,0x84,0x92,0x00,0x00,0x00,0x00,0x20,0x00,0x81,0x2c, - 0x07,0x00,0x20,0x14,0x7f,0x00,0x81,0x2c,0x05,0x00,0x20,0x10, - 0x00,0x00,0x00,0x00,0x5c,0x28,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x04,0x00,0x00,0x10,0x21,0x10,0x60,0x02,0x5c,0x28,0x00,0x0c, - 0x2e,0x00,0x04,0x24,0x21,0x10,0x60,0x02,0x01,0x00,0x94,0x26, - 0xf0,0xff,0x40,0x14,0xff,0xff,0x73,0x26,0x24,0x00,0xbf,0x8f, - 0x14,0x00,0xb1,0x8f,0x18,0x00,0xb2,0x8f,0x1c,0x00,0xb3,0x8f, - 0x20,0x00,0xb4,0x8f,0x08,0x00,0xe0,0x03,0x40,0x00,0xbd,0x27, - 0xe0,0xff,0xbd,0x27,0x1c,0x00,0xbf,0xaf,0x18,0x00,0xb1,0xaf, - 0x14,0x00,0xb0,0xaf,0x5c,0x28,0x00,0x0c,0x0d,0x00,0x04,0x24, - 0x21,0x80,0x00,0x00,0x4e,0x00,0x11,0x24,0x5c,0x28,0x00,0x0c, - 0x20,0x00,0x04,0x24,0x01,0x00,0x10,0x26,0xfc,0xff,0x11,0x16, - 0x00,0x00,0x00,0x00,0x5c,0x28,0x00,0x0c,0x0d,0x00,0x04,0x24, - 0x1c,0x00,0xbf,0x8f,0x14,0x00,0xb0,0x8f,0x18,0x00,0xb1,0x8f, - 0x08,0x00,0xe0,0x03,0x20,0x00,0xbd,0x27,0x21,0x10,0x80,0x00, - 0x04,0x00,0x40,0x10,0xff,0xff,0x84,0x24,0x21,0x10,0x80,0x00, - 0xfe,0xff,0x40,0x14,0xff,0xff,0x84,0x24,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xc0,0xff,0xbd,0x27,0x2c,0x00,0xbf,0xaf, - 0x28,0x00,0xb4,0xaf,0x20,0x00,0xb2,0xaf,0x24,0x00,0xb3,0xaf, - 0x18,0x00,0xb0,0xaf,0x03,0x00,0x80,0x10,0x1c,0x00,0xb1,0xaf, - 0xad,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c, - 0x78,0x87,0x84,0x27,0x34,0x00,0xa0,0xaf,0x00,0xa1,0x0e,0x3c, - 0x00,0xa1,0x12,0x3c,0x00,0x40,0xc0,0xa5,0x0c,0x00,0x52,0x36, - 0x63,0x00,0x10,0x24,0x00,0xa1,0x11,0x3c,0xd2,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0x34,0x00,0x0f,0x24,0x00,0x00,0x4f,0xa2,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x10,0x00,0x18,0x24,0x00,0x00,0x38,0xa2, - 0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24,0x10,0x00,0x19,0x24, - 0x00,0x00,0x39,0xa2,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0xe2,0x00,0x08,0x24,0x00,0x00,0x48,0xa2,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x00,0x00,0x29,0x92,0x00,0x00,0x00,0x00, - 0x40,0x00,0x2a,0x31,0x05,0x00,0x40,0x11,0x2b,0x10,0x10,0x00, - 0xff,0xff,0x10,0x26,0xe5,0xff,0x00,0x16,0x00,0x00,0x00,0x00, - 0x2b,0x10,0x10,0x00,0x05,0x00,0x40,0x14,0x63,0x00,0x10,0x24, - 0x08,0x00,0x0b,0x24,0x34,0x00,0xab,0xaf,0x29,0x2a,0x00,0x0c, - 0x90,0x87,0x84,0x27,0x00,0xa1,0x13,0x3c,0x08,0x00,0x73,0x36, - 0xff,0x00,0x14,0x24,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24,0xb4,0x00,0x0c,0x24, - 0x00,0x00,0x4c,0xa2,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0x00,0x00,0x74,0xa2,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0x00,0x00,0x74,0xa2,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0xe8,0x00,0x0d,0x24,0x00,0x00,0x4d,0xa2,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x00,0x00,0x6e,0x92,0x00,0x00,0x00,0x00, - 0x40,0x00,0xcf,0x31,0x04,0x00,0xe0,0x11,0x00,0x00,0x00,0x00, - 0xff,0xff,0x10,0x26,0xe7,0xff,0x00,0x16,0x00,0x00,0x00,0x00, - 0x07,0x00,0x00,0x16,0x02,0x00,0x03,0x24,0x34,0x00,0xb8,0x8f, - 0xac,0x87,0x84,0x27,0x08,0x00,0x19,0x37,0x29,0x2a,0x00,0x0c, - 0x34,0x00,0xb9,0xaf,0x02,0x00,0x03,0x24,0xd2,0x27,0x00,0x0c, - 0x3c,0x00,0xa3,0xaf,0x3c,0x00,0xa3,0x8f,0x00,0x00,0x00,0x00, - 0x21,0x10,0x60,0x00,0xfa,0xff,0x40,0x14,0xff,0xff,0x63,0x24, - 0xd8,0x00,0x08,0x24,0x00,0x00,0x48,0xa2,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x00,0x00,0x70,0x92,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x00,0x00,0x69,0x92,0x00,0x00,0x00,0x00, - 0x05,0x00,0x89,0x16,0xff,0x00,0x01,0x24,0x04,0x00,0x01,0x16, - 0x00,0xa1,0x0a,0x3c,0x29,0x2a,0x00,0x0c,0xc8,0x87,0x84,0x27, - 0x00,0xa1,0x0a,0x3c,0x00,0x40,0x40,0xa5,0xe1,0x21,0x00,0x0c, - 0x21,0x20,0x00,0x00,0x01,0x00,0x0b,0x24,0x00,0xa3,0x0c,0x3c, - 0x80,0x01,0x8b,0xad,0xe1,0x21,0x00,0x0c,0x01,0x04,0x04,0x24, - 0x00,0xa3,0x0d,0x3c,0x80,0x01,0xae,0x8d,0x01,0x00,0x01,0x24, - 0x07,0x00,0xc1,0x11,0x06,0x00,0x03,0x3c,0x34,0x00,0xaf,0x8f, - 0xe0,0x87,0x84,0x27,0x01,0x00,0xf8,0x35,0x29,0x2a,0x00,0x0c, - 0x34,0x00,0xb8,0xaf,0x06,0x00,0x03,0x3c,0x7f,0x1a,0x63,0x34, - 0xd2,0x27,0x00,0x0c,0x3c,0x00,0xa3,0xaf,0x00,0xa3,0x19,0x3c, - 0x80,0x01,0x28,0x8f,0x3c,0x00,0xa3,0x8f,0x05,0x00,0x00,0x11, - 0x00,0xa3,0x09,0x3c,0x21,0x10,0x60,0x00,0xf7,0xff,0x40,0x14, - 0xff,0xff,0x63,0x24,0x00,0xa3,0x09,0x3c,0x80,0x01,0x2a,0x8d, - 0x00,0x00,0x00,0x00,0x07,0x00,0x40,0x11,0x00,0xa1,0x0d,0x3c, - 0x34,0x00,0xab,0x8f,0xfc,0x87,0x84,0x27,0x02,0x00,0x6c,0x35, - 0x29,0x2a,0x00,0x0c,0x34,0x00,0xac,0xaf,0x00,0xa1,0x0d,0x3c, - 0x00,0x40,0xa0,0xa5,0x63,0x00,0x10,0x24,0xd2,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0x34,0x00,0x0e,0x24,0x00,0x00,0x4e,0xa2,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x00,0x00,0x34,0xa2,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x00,0x00,0x34,0xa2,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0xe2,0x00,0x0f,0x24,0x00,0x00,0x4f,0xa2, - 0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24,0x00,0x00,0x38,0x92, - 0x00,0x00,0x00,0x00,0x40,0x00,0x19,0x33,0x05,0x00,0x20,0x13, - 0x2b,0x10,0x10,0x00,0xff,0xff,0x10,0x26,0xe7,0xff,0x00,0x16, - 0x00,0x00,0x00,0x00,0x2b,0x10,0x10,0x00,0x06,0x00,0x40,0x14, - 0x63,0x00,0x10,0x24,0x34,0x00,0xa8,0x8f,0x1c,0x88,0x84,0x27, - 0x08,0x00,0x09,0x35,0x29,0x2a,0x00,0x0c,0x34,0x00,0xa9,0xaf, - 0xe1,0x21,0x00,0x0c,0x21,0x20,0x00,0x00,0x01,0x00,0x0a,0x24, - 0x00,0xa3,0x0b,0x3c,0x80,0x01,0x6a,0xad,0xe1,0x21,0x00,0x0c, - 0x01,0x04,0x04,0x24,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0xa3,0x0c,0x3c, - 0x80,0x01,0x8d,0x8d,0x01,0x00,0x01,0x24,0x06,0x00,0xa1,0x11, - 0x00,0x00,0x00,0x00,0x34,0x00,0xae,0x8f,0x38,0x88,0x84,0x27, - 0x04,0x00,0xcf,0x35,0x29,0x2a,0x00,0x0c,0x34,0x00,0xaf,0xaf, - 0xe1,0x21,0x00,0x0c,0x21,0x20,0x00,0x00,0x00,0xa1,0x18,0x3c, - 0x00,0x40,0x00,0xa7,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24,0x34,0x00,0x19,0x24, - 0x00,0x00,0x59,0xa2,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0xcc,0x00,0x08,0x24,0x00,0x00,0x28,0xa2,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x1c,0x00,0x09,0x24,0x00,0x00,0x29,0xa2, - 0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24,0xe2,0x00,0x0a,0x24, - 0x00,0x00,0x4a,0xa2,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0x00,0x00,0x2b,0x92,0x00,0x00,0x00,0x00,0x40,0x00,0x6c,0x31, - 0x05,0x00,0x80,0x11,0x2b,0x10,0x10,0x00,0xff,0xff,0x10,0x26, - 0xe5,0xff,0x00,0x16,0x00,0x00,0x00,0x00,0x2b,0x10,0x10,0x00, - 0x06,0x00,0x40,0x14,0x63,0x00,0x10,0x24,0x34,0x00,0xad,0x8f, - 0x58,0x88,0x84,0x27,0x08,0x00,0xae,0x35,0x29,0x2a,0x00,0x0c, - 0x34,0x00,0xae,0xaf,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24,0xb4,0x00,0x0f,0x24, - 0x00,0x00,0x4f,0xa2,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0x00,0x00,0x74,0xa2,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0x00,0x00,0x74,0xa2,0xc1,0x2a,0x00,0x0c,0x0a,0x00,0x04,0x24, - 0xe8,0x00,0x18,0x24,0x00,0x00,0x58,0xa2,0xc1,0x2a,0x00,0x0c, - 0x0a,0x00,0x04,0x24,0x00,0x00,0x79,0x92,0x00,0x00,0x00,0x00, - 0x40,0x00,0x28,0x33,0x04,0x00,0x00,0x11,0x00,0x00,0x00,0x00, - 0xff,0xff,0x10,0x26,0xe7,0xff,0x00,0x16,0x00,0x00,0x00,0x00, - 0x07,0x00,0x00,0x16,0x00,0xa1,0x0b,0x3c,0x34,0x00,0xa9,0x8f, - 0x74,0x88,0x84,0x27,0x08,0x00,0x2a,0x35,0x29,0x2a,0x00,0x0c, - 0x34,0x00,0xaa,0xaf,0x00,0xa1,0x0b,0x3c,0x00,0x40,0x60,0xa5, - 0xe1,0x21,0x00,0x0c,0x21,0x20,0x00,0x00,0x01,0x00,0x0c,0x24, - 0x00,0xa3,0x0d,0x3c,0x80,0x01,0xac,0xad,0xe1,0x21,0x00,0x0c, - 0x01,0x04,0x04,0x24,0x34,0x00,0xae,0x8f,0x00,0x00,0x00,0x00, - 0x04,0x00,0xc0,0x15,0x2c,0x00,0xbf,0x8f,0x65,0x2a,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x2c,0x00,0xbf,0x8f,0x34,0x00,0xa2,0x8f, - 0x18,0x00,0xb0,0x8f,0x1c,0x00,0xb1,0x8f,0x20,0x00,0xb2,0x8f, - 0x24,0x00,0xb3,0x8f,0x28,0x00,0xb4,0x8f,0x08,0x00,0xe0,0x03, - 0x40,0x00,0xbd,0x27,0xb8,0xff,0xbd,0x27,0x50,0x00,0xa6,0xaf, - 0x50,0x00,0xae,0x8f,0x40,0x00,0xb6,0xaf,0x3c,0x00,0xb5,0xaf, - 0x21,0xa8,0xa0,0x00,0x21,0xb0,0x80,0x00,0x44,0x00,0xbf,0xaf, - 0x38,0x00,0xb4,0xaf,0x30,0x00,0xb2,0xaf,0x34,0x00,0xb3,0xaf, - 0x28,0x00,0xb0,0xaf,0x09,0x00,0xc0,0x11,0x2c,0x00,0xb1,0xaf, - 0x03,0x00,0xe0,0x10,0x00,0x00,0x00,0x00,0xad,0x2a,0x00,0x0c, - 0x00,0x00,0x00,0x00,0xbc,0x88,0x84,0x27,0x21,0x28,0xc0,0x02, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xa0,0x02,0x2b,0x08,0xb6,0x02, - 0x21,0xa0,0x00,0x00,0x05,0x00,0x20,0x14,0x21,0x80,0xc0,0x02, - 0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02,0xfd,0xff,0x20,0x10, - 0xfc,0xff,0x00,0xae,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x58,0x00,0xaf,0x8f,0x00,0x00,0x00,0x00,0xa3,0x00,0xe0,0x11, - 0x2b,0x08,0xb6,0x02,0x08,0x00,0x20,0x10,0x21,0x80,0xc0,0x02, - 0x77,0x77,0x13,0x3c,0x33,0x33,0x12,0x3c,0x11,0x11,0x11,0x3c, - 0x11,0x11,0x31,0x36,0x33,0x33,0x52,0x36,0x4e,0x00,0x00,0x10, - 0x77,0x77,0x73,0x36,0x11,0x11,0x11,0x3c,0x33,0x33,0x12,0x3c, - 0x77,0x77,0x13,0x3c,0x77,0x77,0x73,0x36,0x33,0x33,0x52,0x36, - 0x11,0x11,0x31,0x36,0x00,0x00,0x18,0x8e,0x00,0x00,0x00,0x00, - 0x08,0x00,0x00,0x13,0x00,0x00,0x00,0x00,0x90,0x88,0x84,0x8f, - 0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf,0x01,0x00,0x05,0x24, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0x00,0x00,0x01,0x00,0x94,0x36, - 0x00,0x00,0x11,0xae,0x00,0x00,0x19,0x8e,0x00,0x00,0x00,0x00, - 0x09,0x00,0x39,0x12,0x00,0x00,0x00,0x00,0x90,0x88,0x84,0x8f, - 0x11,0x11,0x06,0x3c,0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf, - 0x11,0x11,0xc6,0x34,0x29,0x2a,0x00,0x0c,0x02,0x00,0x05,0x24, - 0x02,0x00,0x94,0x36,0x00,0x00,0x12,0xae,0x00,0x00,0x08,0x8e, - 0x00,0x00,0x00,0x00,0x09,0x00,0x48,0x12,0x00,0x00,0x00,0x00, - 0x90,0x88,0x84,0x8f,0x33,0x33,0x06,0x3c,0x00,0x00,0x07,0x8e, - 0x10,0x00,0xb0,0xaf,0x33,0x33,0xc6,0x34,0x29,0x2a,0x00,0x0c, - 0x03,0x00,0x05,0x24,0x04,0x00,0x94,0x36,0x00,0x00,0x13,0xae, - 0x00,0x00,0x09,0x8e,0x00,0x00,0x00,0x00,0x0a,0x00,0x69,0x12, - 0xff,0xff,0x0a,0x24,0x90,0x88,0x84,0x8f,0x77,0x77,0x06,0x3c, - 0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf,0x77,0x77,0xc6,0x34, - 0x29,0x2a,0x00,0x0c,0x04,0x00,0x05,0x24,0x08,0x00,0x94,0x36, - 0xff,0xff,0x0a,0x24,0x00,0x00,0x0a,0xae,0x00,0x00,0x0b,0x8e, - 0xff,0xff,0x01,0x24,0x09,0x00,0x61,0x11,0xff,0x00,0x0c,0x32, - 0x90,0x88,0x84,0x8f,0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf, - 0x05,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c,0xff,0xff,0x06,0x24, - 0x10,0x00,0x94,0x36,0xff,0x00,0x0c,0x32,0x03,0x00,0x80,0x15, - 0x00,0x00,0x00,0x00,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02,0xb9,0xff,0x20,0x10, - 0x2b,0x08,0xb6,0x02,0xee,0x01,0x20,0x14,0x21,0x80,0xa0,0x02, - 0x00,0x00,0x0d,0x8e,0xff,0xff,0x01,0x24,0x08,0x00,0xa1,0x11, - 0x00,0x00,0x00,0x00,0x90,0x88,0x84,0x8f,0x00,0x00,0x07,0x8e, - 0x10,0x00,0xb0,0xaf,0x06,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c, - 0xff,0xff,0x06,0x24,0x20,0x00,0x94,0x36,0x00,0x00,0x13,0xae, - 0x00,0x00,0x0e,0x8e,0x00,0x00,0x00,0x00,0x09,0x00,0x6e,0x12, - 0x00,0x00,0x00,0x00,0x90,0x88,0x84,0x8f,0x77,0x77,0x06,0x3c, - 0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf,0x77,0x77,0xc6,0x34, - 0x29,0x2a,0x00,0x0c,0x07,0x00,0x05,0x24,0x40,0x00,0x94,0x36, - 0x00,0x00,0x12,0xae,0x00,0x00,0x0f,0x8e,0x00,0x00,0x00,0x00, - 0x09,0x00,0x4f,0x12,0x00,0x00,0x00,0x00,0x90,0x88,0x84,0x8f, - 0x33,0x33,0x06,0x3c,0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf, - 0x33,0x33,0xc6,0x34,0x29,0x2a,0x00,0x0c,0x08,0x00,0x05,0x24, - 0x80,0x00,0x94,0x36,0x00,0x00,0x11,0xae,0x00,0x00,0x18,0x8e, - 0x00,0x00,0x00,0x00,0x09,0x00,0x38,0x12,0x00,0x00,0x00,0x00, - 0x90,0x88,0x84,0x8f,0x11,0x11,0x06,0x3c,0x00,0x00,0x07,0x8e, - 0x10,0x00,0xb0,0xaf,0x11,0x11,0xc6,0x34,0x29,0x2a,0x00,0x0c, - 0x09,0x00,0x05,0x24,0x00,0x01,0x94,0x36,0x00,0x00,0x00,0xae, - 0x00,0x00,0x19,0x8e,0x00,0x00,0x00,0x00,0x09,0x00,0x20,0x13, - 0xff,0x00,0x08,0x32,0x90,0x88,0x84,0x8f,0x00,0x00,0x07,0x8e, - 0x10,0x00,0xb0,0xaf,0x0a,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0x00,0x00,0x00,0x02,0x94,0x36,0xff,0x00,0x08,0x32, - 0x03,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0xd2,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0xfc,0xff,0x10,0x26,0x2b,0x08,0x16,0x02, - 0xba,0xff,0x20,0x10,0x00,0x00,0x00,0x00,0xa5,0x01,0x00,0x10, - 0x00,0x00,0x00,0x00,0x2b,0x08,0xb6,0x02,0x37,0x00,0x20,0x14, - 0x21,0x98,0xc0,0x02,0x01,0x00,0x12,0x24,0x21,0x88,0x00,0x00, - 0x00,0x00,0x69,0x92,0x00,0x00,0x00,0x00,0x09,0x00,0x29,0x12, - 0x25,0x80,0x32,0x02,0x90,0x88,0x84,0x8f,0x00,0x00,0x67,0x92, - 0x10,0x00,0xb3,0xaf,0x01,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0x20,0x02,0x01,0x00,0x94,0x36,0x25,0x80,0x32,0x02, - 0x00,0x00,0x70,0xa2,0x00,0x00,0x6a,0x92,0x00,0x00,0x00,0x00, - 0x08,0x00,0x0a,0x12,0x00,0x00,0x00,0x00,0x90,0x88,0x84,0x8f, - 0x00,0x00,0x67,0x92,0x10,0x00,0xb3,0xaf,0x02,0x00,0x05,0x24, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0x00,0x02,0x02,0x00,0x94,0x36, - 0x00,0x00,0x71,0xa2,0x00,0x00,0x6b,0x92,0x00,0x00,0x00,0x00, - 0x08,0x00,0x2b,0x12,0x00,0x00,0x00,0x00,0x90,0x88,0x84,0x8f, - 0x00,0x00,0x67,0x92,0x10,0x00,0xb3,0xaf,0x03,0x00,0x05,0x24, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0x20,0x02,0x04,0x00,0x94,0x36, - 0x40,0x90,0x12,0x00,0xff,0x00,0x52,0x32,0xff,0xff,0x51,0x26, - 0x00,0x00,0x70,0xa2,0xd7,0xff,0x40,0x16,0xff,0x00,0x31,0x32, - 0xff,0x00,0x6c,0x32,0x03,0x00,0x80,0x15,0x00,0x00,0x00,0x00, - 0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0x01,0x00,0x73,0x26, - 0x2b,0x08,0xb3,0x02,0xcd,0xff,0x20,0x10,0x01,0x00,0x12,0x24, - 0x21,0x98,0xc0,0x02,0x2b,0x08,0xb6,0x02,0x1f,0x00,0x20,0x14, - 0x2b,0x08,0xb6,0x02,0x01,0x00,0x12,0x24,0xfe,0x00,0x11,0x24, - 0x00,0x00,0x6d,0x92,0x25,0x80,0x32,0x02,0x08,0x00,0x0d,0x12, - 0x00,0x00,0x00,0x00,0x90,0x88,0x84,0x8f,0x00,0x00,0x67,0x92, - 0x10,0x00,0xb3,0xaf,0x04,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0x00,0x02,0x08,0x00,0x94,0x36,0x00,0x00,0x71,0xa2, - 0x40,0x88,0x11,0x00,0x40,0x90,0x12,0x00,0xff,0x00,0x52,0x32, - 0x01,0x00,0x31,0x36,0x00,0x00,0x70,0xa2,0xee,0xff,0x40,0x16, - 0xff,0x00,0x31,0x32,0xff,0x00,0x6e,0x32,0x03,0x00,0xc0,0x15, - 0x00,0x00,0x00,0x00,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x01,0x00,0x73,0x26,0x2b,0x08,0xb3,0x02,0xe3,0xff,0x20,0x10, - 0x2b,0x08,0xb6,0x02,0x20,0x00,0x20,0x14,0x21,0x98,0xa0,0x02, - 0x80,0x00,0x12,0x24,0x7f,0x00,0x11,0x24,0x00,0x00,0x6f,0x92, - 0x25,0x80,0x32,0x02,0x08,0x00,0x0f,0x12,0x00,0x00,0x00,0x00, - 0x90,0x88,0x84,0x8f,0x00,0x00,0x67,0x92,0x10,0x00,0xb3,0xaf, - 0x05,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c,0x21,0x30,0x00,0x02, - 0x10,0x00,0x94,0x36,0x00,0x00,0x71,0xa2,0x00,0x00,0x70,0xa2, - 0x00,0x00,0x71,0xa2,0x42,0x90,0x12,0x00,0xff,0x00,0x52,0x32, - 0x42,0x88,0x11,0x00,0xee,0xff,0x40,0x16,0xff,0x00,0x31,0x32, - 0xff,0x00,0x78,0x32,0x03,0x00,0x00,0x17,0x00,0x00,0x00,0x00, - 0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0xff,0xff,0x73,0x26, - 0x2b,0x08,0x76,0x02,0xe4,0xff,0x20,0x10,0x80,0x00,0x12,0x24, - 0x21,0x98,0xa0,0x02,0x2b,0x08,0xb6,0x02,0x1b,0x00,0x20,0x14, - 0x00,0x00,0x00,0x00,0x80,0x00,0x12,0x24,0x00,0x00,0x79,0x92, - 0x00,0x00,0x00,0x00,0x08,0x00,0x20,0x13,0x00,0x00,0x00,0x00, - 0x90,0x88,0x84,0x8f,0x00,0x00,0x67,0x92,0x10,0x00,0xb3,0xaf, - 0x06,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c,0x21,0x30,0x00,0x00, - 0x20,0x00,0x94,0x36,0x00,0x00,0x72,0xa2,0x42,0x90,0x12,0x00, - 0xff,0x00,0x52,0x32,0xf1,0xff,0x40,0x16,0x00,0x00,0x60,0xa2, - 0xff,0x00,0x68,0x32,0x03,0x00,0x00,0x15,0x00,0x00,0x00,0x00, - 0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0xff,0xff,0x73,0x26, - 0x2b,0x08,0x76,0x02,0xe8,0xff,0x20,0x10,0x80,0x00,0x12,0x24, - 0x00,0x44,0x13,0x3c,0x00,0x11,0x73,0x36,0x0f,0x00,0x12,0x24, - 0x01,0x00,0x49,0x32,0x21,0x88,0x00,0x00,0x02,0x00,0x20,0x11, - 0x21,0x80,0xc0,0x02,0x21,0x88,0x60,0x02,0x02,0x00,0x4a,0x32, - 0x03,0x00,0x40,0x11,0x00,0x11,0x01,0x3c,0x00,0x44,0x21,0x34, - 0x25,0x88,0x21,0x02,0x04,0x00,0x4b,0x32,0x03,0x00,0x60,0x11, - 0x88,0x00,0x01,0x3c,0x22,0x00,0x21,0x34,0x25,0x88,0x21,0x02, - 0x08,0x00,0x4c,0x32,0x03,0x00,0x80,0x11,0x22,0x00,0x01,0x3c, - 0x88,0x00,0x21,0x34,0x25,0x88,0x21,0x02,0x2b,0x08,0xb6,0x02, - 0x06,0x00,0x20,0x14,0x00,0x00,0x00,0x00,0x04,0x00,0x10,0x26, - 0x2b,0x08,0xb0,0x02,0xfd,0xff,0x20,0x10,0xfc,0xff,0x11,0xae, - 0x21,0x80,0xc0,0x02,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x2b,0x08,0xb6,0x02,0x17,0x00,0x20,0x14,0x55,0xaa,0x01,0x3c, - 0x00,0x00,0x0d,0x8e,0x00,0x00,0x00,0x00,0x09,0x00,0x2d,0x12, - 0xff,0x00,0x0e,0x32,0x90,0x88,0x84,0x8f,0x00,0x00,0x07,0x8e, - 0x10,0x00,0xb0,0xaf,0x07,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0x20,0x02,0x40,0x00,0x94,0x36,0xff,0x00,0x0e,0x32, - 0x03,0x00,0xc0,0x15,0x00,0x00,0x00,0x00,0xd2,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02, - 0xed,0xff,0x20,0x10,0x00,0x00,0x00,0x00,0x21,0x80,0xc0,0x02, - 0x55,0xaa,0x01,0x3c,0x55,0xaa,0x21,0x34,0x25,0x88,0x21,0x02, - 0x2b,0x08,0xb6,0x02,0x06,0x00,0x20,0x14,0x00,0x00,0x00,0x00, - 0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02,0xfd,0xff,0x20,0x10, - 0xfc,0xff,0x11,0xae,0x21,0x80,0xc0,0x02,0xd2,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x2b,0x08,0xb6,0x02,0x17,0x00,0x20,0x14, - 0xaa,0x55,0x01,0x3c,0x00,0x00,0x0f,0x8e,0x00,0x00,0x00,0x00, - 0x09,0x00,0x2f,0x12,0xff,0x00,0x18,0x32,0x90,0x88,0x84,0x8f, - 0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf,0x08,0x00,0x05,0x24, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0x20,0x02,0x80,0x00,0x94,0x36, - 0xff,0x00,0x18,0x32,0x03,0x00,0x00,0x17,0x00,0x00,0x00,0x00, - 0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0x04,0x00,0x10,0x26, - 0x2b,0x08,0xb0,0x02,0xed,0xff,0x20,0x10,0x00,0x00,0x00,0x00, - 0x21,0x80,0xc0,0x02,0xaa,0x55,0x01,0x3c,0xaa,0x55,0x21,0x34, - 0x24,0x88,0x21,0x02,0x2b,0x08,0xb6,0x02,0x06,0x00,0x20,0x14, - 0x00,0x00,0x00,0x00,0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02, - 0xfd,0xff,0x20,0x10,0xfc,0xff,0x11,0xae,0x21,0x80,0xc0,0x02, - 0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0x2b,0x08,0xb6,0x02, - 0x15,0x00,0x20,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x8e, - 0x00,0x00,0x00,0x00,0x09,0x00,0x39,0x12,0xff,0x00,0x08,0x32, - 0x90,0x88,0x84,0x8f,0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf, - 0x09,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c,0x21,0x30,0x20,0x02, - 0x00,0x01,0x94,0x36,0xff,0x00,0x08,0x32,0x03,0x00,0x00,0x15, - 0x00,0x00,0x00,0x00,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02,0xed,0xff,0x20,0x10, - 0x00,0x00,0x00,0x00,0xff,0xff,0x52,0x26,0xff,0xff,0x01,0x24, - 0x7f,0xff,0x41,0x16,0x01,0x00,0x49,0x32,0x00,0x88,0x13,0x3c, - 0x00,0x22,0x73,0x36,0x0f,0x00,0x12,0x24,0x01,0x00,0x49,0x32, - 0x21,0x88,0x00,0x00,0x02,0x00,0x20,0x11,0x21,0x80,0xc0,0x02, - 0x21,0x88,0x60,0x02,0x02,0x00,0x4a,0x32,0x03,0x00,0x40,0x11, - 0x00,0x22,0x01,0x3c,0x00,0x88,0x21,0x34,0x25,0x88,0x21,0x02, - 0x04,0x00,0x4b,0x32,0x03,0x00,0x60,0x11,0x44,0x00,0x01,0x3c, - 0x11,0x00,0x21,0x34,0x25,0x88,0x21,0x02,0x08,0x00,0x4c,0x32, - 0x03,0x00,0x80,0x11,0x11,0x00,0x01,0x3c,0x44,0x00,0x21,0x34, - 0x25,0x88,0x21,0x02,0x2b,0x08,0xb6,0x02,0x06,0x00,0x20,0x14, - 0x00,0x00,0x00,0x00,0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02, - 0xfd,0xff,0x20,0x10,0xfc,0xff,0x11,0xae,0x21,0x80,0xc0,0x02, - 0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0x2b,0x08,0xb6,0x02, - 0x17,0x00,0x20,0x14,0xaa,0x55,0x01,0x3c,0x00,0x00,0x0d,0x8e, - 0x00,0x00,0x00,0x00,0x09,0x00,0x2d,0x12,0xff,0x00,0x0e,0x32, - 0x90,0x88,0x84,0x8f,0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf, - 0x0a,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c,0x21,0x30,0x20,0x02, - 0x00,0x02,0x94,0x36,0xff,0x00,0x0e,0x32,0x03,0x00,0xc0,0x15, - 0x00,0x00,0x00,0x00,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02,0xed,0xff,0x20,0x10, - 0x00,0x00,0x00,0x00,0x21,0x80,0xc0,0x02,0xaa,0x55,0x01,0x3c, - 0xaa,0x55,0x21,0x34,0x25,0x88,0x21,0x02,0x2b,0x08,0xb6,0x02, - 0x06,0x00,0x20,0x14,0x00,0x00,0x00,0x00,0x04,0x00,0x10,0x26, - 0x2b,0x08,0xb0,0x02,0xfd,0xff,0x20,0x10,0xfc,0xff,0x11,0xae, - 0x21,0x80,0xc0,0x02,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x2b,0x08,0xb6,0x02,0x17,0x00,0x20,0x14,0x55,0xaa,0x01,0x3c, - 0x00,0x00,0x0f,0x8e,0x00,0x00,0x00,0x00,0x09,0x00,0x2f,0x12, - 0xff,0x00,0x18,0x32,0x90,0x88,0x84,0x8f,0x00,0x00,0x07,0x8e, - 0x10,0x00,0xb0,0xaf,0x0b,0x00,0x05,0x24,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0x20,0x02,0x00,0x02,0x94,0x36,0xff,0x00,0x18,0x32, - 0x03,0x00,0x00,0x17,0x00,0x00,0x00,0x00,0xd2,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02, - 0xed,0xff,0x20,0x10,0x00,0x00,0x00,0x00,0x21,0x80,0xc0,0x02, - 0x55,0xaa,0x01,0x3c,0x55,0xaa,0x21,0x34,0x24,0x88,0x21,0x02, - 0x2b,0x08,0xb6,0x02,0x06,0x00,0x20,0x14,0x00,0x00,0x00,0x00, - 0x04,0x00,0x10,0x26,0x2b,0x08,0xb0,0x02,0xfd,0xff,0x20,0x10, - 0xfc,0xff,0x11,0xae,0x21,0x80,0xc0,0x02,0xd2,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x2b,0x08,0xb6,0x02,0x15,0x00,0x20,0x14, - 0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x8e,0x00,0x00,0x00,0x00, - 0x09,0x00,0x39,0x12,0xff,0x00,0x08,0x32,0x90,0x88,0x84,0x8f, - 0x00,0x00,0x07,0x8e,0x10,0x00,0xb0,0xaf,0x0c,0x00,0x05,0x24, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0x20,0x02,0x00,0x02,0x94,0x36, - 0xff,0x00,0x08,0x32,0x03,0x00,0x00,0x15,0x00,0x00,0x00,0x00, - 0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0x04,0x00,0x10,0x26, - 0x2b,0x08,0xb0,0x02,0xed,0xff,0x20,0x10,0x00,0x00,0x00,0x00, - 0xff,0xff,0x52,0x26,0xff,0xff,0x01,0x24,0x7f,0xff,0x41,0x16, - 0x01,0x00,0x49,0x32,0x08,0x00,0x80,0x16,0x44,0x00,0xbf,0x8f, - 0x50,0x00,0xa9,0x8f,0x00,0x00,0x00,0x00,0x04,0x00,0x20,0x11, - 0x44,0x00,0xbf,0x8f,0x65,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x44,0x00,0xbf,0x8f,0x21,0x10,0x80,0x02,0x38,0x00,0xb4,0x8f, - 0x28,0x00,0xb0,0x8f,0x2c,0x00,0xb1,0x8f,0x30,0x00,0xb2,0x8f, - 0x34,0x00,0xb3,0x8f,0x3c,0x00,0xb5,0x8f,0x40,0x00,0xb6,0x8f, - 0x08,0x00,0xe0,0x03,0x48,0x00,0xbd,0x27,0xf8,0xff,0xbd,0x27, - 0x10,0x27,0x0e,0x24,0x04,0x00,0xae,0xaf,0x04,0x00,0xa2,0x8f, - 0x04,0x00,0xaf,0x8f,0x00,0x00,0x00,0x00,0xff,0xff,0xf8,0x25, - 0x0f,0x00,0x40,0x10,0x04,0x00,0xb8,0xaf,0x2c,0x00,0x99,0x90, - 0x00,0x00,0x00,0x00,0x0b,0x00,0x20,0x13,0x00,0x00,0x00,0x00, - 0x04,0x00,0xa2,0x8f,0x04,0x00,0xa8,0x8f,0x00,0x00,0x00,0x00, - 0xff,0xff,0x09,0x25,0x05,0x00,0x40,0x10,0x04,0x00,0xa9,0xaf, - 0x2c,0x00,0x8a,0x90,0x00,0x00,0x00,0x00,0xf7,0xff,0x40,0x15, - 0x00,0x00,0x00,0x00,0x08,0x00,0xe0,0x03,0x08,0x00,0xbd,0x27, - 0x28,0xff,0xbd,0x27,0xd8,0x00,0xa4,0xaf,0xd8,0x00,0xae,0x8f, - 0x01,0xa1,0x01,0x3c,0x80,0x7b,0x0e,0x00,0x21,0xc0,0xe1,0x01, - 0x44,0x00,0xb6,0xaf,0x01,0xa1,0x01,0x3c,0x4c,0x00,0xbf,0xaf, - 0x48,0x00,0xb7,0xaf,0x40,0x00,0xb3,0xaf,0x3c,0x00,0xb0,0xaf, - 0xdc,0x00,0xa5,0xaf,0xe0,0x00,0xa6,0xaf,0x21,0x08,0x2f,0x00, - 0x88,0x00,0xb8,0xaf,0x8c,0x00,0xaf,0xaf,0xff,0x00,0x19,0x24, - 0x00,0x00,0x39,0xa0,0x21,0xb0,0x00,0x00,0xf4,0x01,0x02,0x24, - 0x04,0x00,0xd6,0x26,0xff,0xff,0xc2,0x16,0x04,0x00,0xd6,0x26, - 0x88,0x00,0xa9,0x8f,0xd8,0x00,0xaa,0x8f,0x00,0x00,0x33,0x91, - 0x06,0x00,0x40,0x11,0x1c,0x00,0x01,0x24,0x03,0x00,0x61,0x12, - 0x20,0x00,0x01,0x24,0x03,0x00,0x61,0x16,0xd8,0x00,0xab,0x8f, - 0xff,0x00,0x13,0x24,0xd8,0x00,0xab,0x8f,0x00,0xa3,0x01,0x3c, - 0x21,0x08,0x2b,0x00,0xac,0x01,0x33,0xa0,0x00,0xa3,0x01,0x3c, - 0xb0,0x01,0x21,0x34,0x21,0x60,0x61,0x01,0x00,0xa3,0x01,0x3c, - 0x84,0x00,0xac,0xaf,0x21,0x08,0x2b,0x00,0xb0,0x01,0x20,0xa0, - 0x00,0xa3,0x01,0x3c,0xb4,0x01,0x21,0x34,0x21,0x68,0x61,0x01, - 0x00,0xa3,0x01,0x3c,0x80,0x00,0xad,0xaf,0x21,0x08,0x2b,0x00, - 0xb4,0x01,0x20,0xa0,0x00,0xa3,0x01,0x3c,0xb8,0x01,0x21,0x34, - 0x80,0x70,0x0b,0x00,0x21,0xc0,0xc1,0x01,0x00,0xa3,0x01,0x3c, - 0x21,0x08,0x2e,0x00,0x7c,0x00,0xb8,0xaf,0xb8,0x01,0x20,0xac, - 0x83,0xb8,0x13,0x00,0x10,0x00,0x19,0x24,0x3f,0x00,0xf7,0x32, - 0x04,0x00,0x01,0x24,0xbc,0x00,0xa0,0xaf,0xa0,0x00,0xb9,0xaf, - 0x08,0x00,0xe1,0x12,0x9c,0x00,0xa0,0xaf,0x06,0x00,0x01,0x24, - 0x05,0x00,0xe1,0x12,0x0c,0x00,0x01,0x24,0x03,0x00,0xe1,0x12, - 0x0e,0x00,0x01,0x24,0x04,0x00,0xe1,0x16,0x04,0x00,0x01,0x24, - 0x08,0x00,0x0f,0x24,0xa0,0x00,0xaf,0xaf,0x04,0x00,0x01,0x24, - 0x03,0x00,0xe1,0x12,0x0c,0x00,0x01,0x24,0x04,0x00,0xe1,0x16, - 0x07,0x00,0x04,0x24,0x01,0x00,0x09,0x24,0x9c,0x00,0xa9,0xaf, - 0x07,0x00,0x04,0x24,0x04,0x00,0xe4,0x16,0x08,0x00,0x03,0x24, - 0x04,0x00,0x0a,0x24,0xa0,0x00,0xaa,0xaf,0x08,0x00,0x03,0x24, - 0x03,0x00,0xe3,0x16,0x01,0x00,0x0c,0x24,0xa0,0x00,0xa3,0xaf, - 0x01,0x00,0x0c,0x24,0x94,0x00,0xac,0xaf,0xde,0x07,0x00,0x10, - 0x21,0x10,0xe0,0x02,0xdc,0x00,0xad,0x8f,0x60,0x00,0xb4,0xaf, - 0x5c,0x00,0xb5,0xaf,0x04,0x00,0xa0,0x11,0x58,0x00,0xbe,0xaf, - 0xf7,0xff,0x01,0x24,0xfa,0x00,0xa1,0x15,0xdc,0x00,0xac,0x8f, - 0xd8,0x00,0xa5,0x8f,0x08,0x89,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0x60,0x02,0x8c,0x00,0xbe,0x8f,0x01,0xa1,0x01,0x3c, - 0x00,0x08,0x21,0x34,0x21,0xf0,0xc1,0x03,0x7b,0x2e,0x00,0x0c, - 0x21,0x20,0xc0,0x03,0x81,0x00,0x14,0x24,0x2c,0x00,0xd4,0xa3, - 0x3c,0x00,0xcb,0x93,0x00,0x00,0x00,0x00,0x0e,0x00,0x60,0x15, - 0xf0,0x01,0x10,0x24,0x0f,0x00,0x02,0x3c,0x40,0x42,0x42,0x34, - 0x0f,0x00,0x16,0x3c,0x08,0x00,0x40,0x10,0x3f,0x42,0xd6,0x36, - 0x3c,0x00,0xd8,0x93,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x17, - 0xf0,0x01,0x10,0x24,0x21,0x10,0xc0,0x02,0xfa,0xff,0x40,0x14, - 0xff,0xff,0xd6,0x26,0xf0,0x01,0x10,0x24,0xfc,0xff,0x10,0x26, - 0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26,0xed,0x00,0x0e,0x24, - 0x10,0x00,0xce,0xa3,0x10,0x00,0xd9,0x93,0xed,0x00,0x01,0x24, - 0xc2,0x00,0x21,0x17,0x21,0xa8,0x00,0x00,0x80,0x00,0xaf,0x8f, - 0x54,0x00,0xb1,0xaf,0x50,0x00,0xb2,0xaf,0x00,0x00,0xe9,0x91, - 0xff,0x00,0x0c,0x24,0x01,0x00,0x2a,0x25,0x00,0x00,0xea,0xa1, - 0x10,0x00,0xc0,0xa3,0x10,0x00,0xd2,0x93,0x10,0x00,0xcc,0xa3, - 0x10,0x00,0xd0,0x93,0x03,0x00,0x40,0x16,0xff,0x00,0x01,0x24, - 0x07,0x00,0x01,0x12,0x00,0x00,0x00,0x00,0xd8,0x00,0xa5,0x8f, - 0x00,0x02,0x15,0x24,0x24,0x89,0x84,0x27,0x21,0x30,0x40,0x02, - 0x29,0x2a,0x00,0x0c,0x21,0x38,0x00,0x02,0x28,0x00,0xc0,0xa3, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03,0x80,0x00,0x0d,0x24, - 0x2c,0x00,0xcd,0xa3,0xf0,0x01,0x10,0x24,0xfc,0xff,0x10,0x26, - 0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26,0x7b,0x2e,0x00,0x0c, - 0x21,0x20,0xc0,0x03,0x42,0x00,0x0b,0x24,0x2c,0x00,0xcb,0xa3, - 0xf0,0x01,0x10,0x24,0xfc,0xff,0x10,0x26,0xff,0xff,0x00,0x16, - 0xfc,0xff,0x10,0x26,0x48,0x00,0xc0,0x93,0x21,0xb0,0x00,0x00, - 0x80,0x00,0x10,0x24,0x48,0x00,0xd6,0xa3,0x01,0x00,0xd8,0x26, - 0x02,0x00,0xce,0x26,0x48,0x00,0xd8,0xa3,0x03,0x00,0xd9,0x26, - 0x04,0x00,0xd6,0x26,0x48,0x00,0xce,0xa3,0xf8,0xff,0xd0,0x16, - 0x48,0x00,0xd9,0xa3,0x21,0xb0,0x00,0x00,0x60,0x89,0x91,0x27, - 0x48,0x00,0xd2,0x93,0x00,0x00,0x00,0x00,0x07,0x00,0x56,0x12, - 0x00,0x00,0x00,0x00,0xd8,0x00,0xa5,0x8f,0x10,0x00,0xb5,0x36, - 0x21,0x20,0x20,0x02,0x21,0x30,0xc0,0x02,0x29,0x2a,0x00,0x0c, - 0x21,0x38,0x40,0x02,0x01,0x00,0xd6,0x26,0xf4,0xff,0xd0,0x16, - 0x00,0x00,0x00,0x00,0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03, - 0x42,0x00,0x09,0x24,0x2c,0x00,0xc9,0xa3,0xf0,0x01,0x10,0x24, - 0xfc,0xff,0x10,0x26,0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03,0x43,0x00,0x0a,0x24, - 0x2c,0x00,0xca,0xa3,0xe1,0x21,0x00,0x0c,0x21,0x20,0x00,0x00, - 0x01,0x00,0x0f,0x24,0x00,0xa3,0x0c,0x3c,0x80,0x01,0x8f,0xad, - 0xd8,0x00,0xad,0x8f,0xdc,0x88,0x98,0x27,0x80,0x58,0x0d,0x00, - 0x21,0x70,0x78,0x01,0x70,0x00,0xae,0xaf,0x00,0x00,0xc4,0x8d, - 0xe1,0x21,0x00,0x0c,0x01,0x00,0x84,0x24,0x84,0x13,0x10,0x24, - 0xfc,0xff,0x10,0x26,0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26, - 0x00,0xa3,0x19,0x3c,0x80,0x01,0x29,0x8f,0x01,0x00,0x01,0x24, - 0x06,0x00,0x21,0x11,0x88,0x00,0xb1,0x8f,0xd8,0x00,0xa5,0x8f, - 0x40,0x00,0xb5,0x36,0x29,0x2a,0x00,0x0c,0x94,0x89,0x84,0x27, - 0x88,0x00,0xb1,0x8f,0x00,0x00,0x00,0x00,0x08,0x00,0x2a,0x92, - 0x08,0x00,0x31,0x26,0x01,0x00,0x4f,0x31,0x06,0x00,0xe0,0x11, - 0x05,0x00,0x02,0x24,0xd8,0x00,0xa5,0x8f,0x40,0x00,0xb5,0x36, - 0x29,0x2a,0x00,0x0c,0xc0,0x89,0x84,0x27,0x05,0x00,0x02,0x24, - 0x00,0x00,0xc0,0xa3,0x10,0x00,0xc2,0xa3,0x14,0x00,0xc2,0xa3, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03,0x18,0x00,0x0c,0x24, - 0x2c,0x00,0xcc,0xa3,0x04,0x00,0xd4,0xa3,0x0c,0x27,0x10,0x24, - 0xfc,0xff,0x10,0x26,0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26, - 0x00,0x00,0x2d,0x92,0x00,0x00,0x00,0x00,0x01,0x00,0xab,0x31, - 0x05,0x00,0x60,0x15,0x00,0x00,0x00,0x00,0xd8,0x00,0xa5,0x8f, - 0x40,0x00,0xb5,0x36,0x29,0x2a,0x00,0x0c,0xfc,0x89,0x84,0x27, - 0x40,0x00,0xc0,0xa3,0x30,0x00,0xc0,0xa3,0x10,0x00,0xc0,0xa3, - 0x14,0x00,0xc0,0xa3,0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03, - 0x10,0x00,0x18,0x24,0x2c,0x00,0xd8,0xa3,0x00,0x00,0xc0,0xa3, - 0x04,0x00,0xc0,0xa3,0x00,0xa3,0x0e,0x3c,0x80,0x01,0xd9,0x8d, - 0x00,0x00,0x00,0x00,0x05,0x00,0x20,0x13,0x00,0x00,0x00,0x00, - 0xd8,0x00,0xa5,0x8f,0x80,0x00,0xb5,0x36,0x29,0x2a,0x00,0x0c, - 0x38,0x8a,0x84,0x27,0xe1,0x21,0x00,0x0c,0x21,0x20,0x00,0x00, - 0x01,0x00,0x09,0x24,0x00,0xa3,0x0a,0x3c,0x80,0x01,0x49,0xad, - 0x70,0x00,0xaf,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0xe4,0x8d, - 0xe1,0x21,0x00,0x0c,0x01,0x00,0x84,0x24,0x0c,0x27,0x10,0x24, - 0xfc,0xff,0x10,0x26,0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26, - 0x00,0xa3,0x0c,0x3c,0x80,0x01,0x8d,0x8d,0x01,0x00,0x01,0x24, - 0x05,0x00,0xa1,0x11,0x00,0x00,0x00,0x00,0xd8,0x00,0xa5,0x8f, - 0x00,0x01,0xb5,0x36,0x29,0x2a,0x00,0x0c,0x6c,0x8a,0x84,0x27, - 0x00,0x00,0x2b,0x92,0x00,0x00,0x00,0x00,0x01,0x00,0x78,0x31, - 0x05,0x00,0x00,0x13,0x00,0x00,0x00,0x00,0xd8,0x00,0xa5,0x8f, - 0x40,0x00,0xb5,0x36,0x29,0x2a,0x00,0x0c,0xa0,0x8a,0x84,0x27, - 0xe1,0x21,0x00,0x0c,0x21,0x20,0x00,0x00,0x54,0x00,0xb1,0x8f, - 0x50,0x00,0xb2,0x8f,0x05,0x00,0x00,0x10,0x00,0x00,0x00,0x00, - 0xd8,0x00,0xa5,0x8f,0x00,0x02,0x15,0x24,0x29,0x2a,0x00,0x0c, - 0xdc,0x8a,0x84,0x27,0x08,0x00,0xa0,0x12,0x00,0x00,0x00,0x00, - 0x7c,0x00,0xae,0x8f,0x01,0x00,0x0a,0x24,0x00,0x00,0xd9,0x8d, - 0x00,0x00,0x00,0x00,0x00,0x02,0x29,0x37,0x00,0x00,0xc9,0xad, - 0xbc,0x00,0xaa,0xaf,0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03, - 0x42,0x00,0x0f,0x24,0x2c,0x00,0xcf,0xa3,0xdc,0x00,0xac,0x8f, - 0xf7,0xff,0x01,0x24,0x07,0x00,0x81,0x15,0x60,0x00,0xb4,0x8f, - 0x60,0x00,0xb4,0x8f,0x5c,0x00,0xb5,0x8f,0x58,0x00,0xbe,0x8f, - 0x13,0x07,0x00,0x10,0x00,0x00,0x00,0x00,0x60,0x00,0xb4,0x8f, - 0x5c,0x00,0xb5,0x8f,0x58,0x00,0xbe,0x8f,0x02,0x00,0x10,0x24, - 0xe8,0x00,0xad,0x8f,0x00,0x00,0x00,0x00,0x04,0x00,0xa0,0x11, - 0xdc,0x00,0xab,0x8f,0xad,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00, - 0xdc,0x00,0xab,0x8f,0x00,0x00,0x00,0x00,0x0c,0x00,0x70,0x15, - 0xd8,0x00,0xa5,0x8f,0xd8,0x00,0xa5,0x8f,0x29,0x2a,0x00,0x0c, - 0x04,0x8b,0x84,0x27,0xd8,0x00,0xb8,0x8f,0x00,0x00,0x00,0x00, - 0x09,0x00,0x00,0x17,0xdc,0x00,0xa3,0x8f,0xff,0x00,0x19,0x24, - 0x05,0x00,0x00,0x10,0xec,0x88,0x99,0xaf,0xd8,0x00,0xa5,0x8f, - 0x1c,0x8b,0x84,0x27,0x29,0x2a,0x00,0x0c,0x21,0x30,0x60,0x02, - 0xdc,0x00,0xa3,0x8f,0x00,0x00,0x00,0x00,0x12,0x02,0x60,0x14, - 0x00,0x00,0x00,0x00,0xd8,0x00,0xa9,0x8f,0xa0,0x00,0xaa,0x8f, - 0x01,0x00,0x2e,0x2d,0x6c,0x00,0xae,0xaf,0xdd,0x01,0x40,0x19, - 0x21,0xb0,0x00,0x00,0x58,0x00,0xbe,0xaf,0x7c,0x8b,0x9e,0x27, - 0x54,0x00,0xb1,0xaf,0x50,0x00,0xb2,0xaf,0x60,0x00,0xb4,0xaf, - 0x5c,0x00,0xb5,0xaf,0x68,0x00,0xa0,0xaf,0xed,0x00,0x02,0x24, - 0x10,0x00,0x13,0x24,0x88,0x00,0xaf,0x8f,0x68,0x00,0xac,0x8f, - 0x21,0xa8,0x00,0x00,0x21,0x88,0xec,0x01,0x1c,0x01,0x22,0xa2, - 0x1c,0x01,0x2d,0x92,0x00,0x00,0x00,0x00,0xad,0x01,0x4d,0x14, - 0x7c,0x00,0xac,0x8f,0xd8,0x00,0xab,0x8f,0x00,0x00,0x00,0x00, - 0x07,0x00,0x60,0x15,0x80,0x00,0xa3,0x8f,0x00,0xa3,0x19,0x3c, - 0xa8,0x01,0x29,0x97,0x01,0x00,0xd8,0x26,0xa4,0x01,0x09,0x13, - 0x7c,0x00,0xac,0x8f,0x80,0x00,0xa3,0x8f,0x00,0x01,0x34,0x26, - 0x00,0x00,0x6e,0x90,0xff,0x00,0x02,0x24,0x01,0x00,0xca,0x25, - 0x00,0x00,0x6a,0xa0,0x1c,0x00,0x80,0xa2,0x0c,0x00,0x82,0xa2, - 0x1c,0x00,0x92,0x92,0x1c,0x00,0x82,0xa2,0x0c,0x00,0x80,0xa2, - 0xd8,0x00,0xaf,0x8f,0xdc,0x88,0x8d,0x27,0x80,0x60,0x0f,0x00, - 0x1c,0x00,0x90,0x92,0x21,0x58,0x8d,0x01,0x04,0x00,0x40,0x16, - 0x70,0x00,0xab,0xaf,0xff,0x00,0x01,0x24,0x09,0x00,0x01,0x12, - 0x00,0x00,0x00,0x00,0x94,0x00,0xb9,0x8f,0xd8,0x00,0xa5,0x8f, - 0x00,0x02,0x15,0x24,0x38,0x8b,0x84,0x27,0x21,0x38,0x40,0x02, - 0x10,0x00,0xb0,0xaf,0x29,0x2a,0x00,0x0c,0x21,0x30,0xd9,0x02, - 0x1c,0x00,0x80,0xa2,0x07,0x00,0x18,0x24,0x01,0x00,0x02,0x24, - 0x08,0x00,0x98,0xa2,0x08,0x00,0x82,0xa2,0x8f,0x00,0x09,0x24, - 0x0c,0x00,0x89,0xa2,0x04,0x00,0x0e,0x24,0x00,0x00,0x8e,0xa2, - 0x04,0x00,0x80,0xa2,0x0f,0x00,0x0a,0x24,0x0c,0x00,0x8a,0xa2, - 0x04,0x00,0x82,0xa2,0x1b,0x00,0x0f,0x24,0x10,0x00,0x8f,0xa2, - 0x3f,0x00,0x12,0x24,0x00,0x00,0x80,0x92,0x21,0x10,0x40,0x02, - 0xfd,0xff,0x40,0x14,0xff,0xff,0x52,0x26,0xc1,0x2a,0x00,0x0c, - 0xc4,0x09,0x04,0x24,0x21,0x90,0x00,0x00,0x05,0x00,0x01,0x24, - 0x07,0x00,0xe1,0x12,0x7f,0x00,0x01,0x24,0x05,0x00,0xe1,0x12, - 0x0c,0x00,0x01,0x24,0x03,0x00,0xe1,0x12,0x0e,0x00,0x01,0x24, - 0x0f,0x00,0xe1,0x16,0x00,0x00,0x00,0x00,0x14,0x00,0x8c,0x92, - 0x00,0x00,0x00,0x00,0x01,0x00,0x8d,0x31,0x0a,0x00,0xa0,0x11, - 0x00,0x00,0x00,0x00,0x94,0x00,0xab,0x8f,0xd8,0x00,0xa5,0x8f, - 0x01,0x00,0xb5,0x36,0x21,0x20,0xc0,0x03,0x21,0x90,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcb,0x02,0x98,0x00,0x00,0x10, - 0x0c,0x00,0x4d,0x32,0x14,0x00,0x99,0x92,0x00,0x00,0x00,0x00, - 0x20,0x00,0x38,0x33,0x0a,0x00,0x00,0x17,0x00,0x00,0x00,0x00, - 0x94,0x00,0xa9,0x8f,0xd8,0x00,0xa5,0x8f,0x02,0x00,0xb5,0x36, - 0xa4,0x8b,0x84,0x27,0x21,0x90,0x00,0x00,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0xc9,0x02,0x8a,0x00,0x00,0x10,0x0c,0x00,0x4d,0x32, - 0x00,0x00,0x80,0x92,0x00,0x00,0x92,0xa2,0x14,0x00,0x8e,0x92, - 0x00,0x00,0x00,0x00,0x40,0x00,0xca,0x31,0x0d,0x00,0x40,0x11, - 0xc3,0x09,0x10,0x24,0x94,0x00,0xaf,0x8f,0xd8,0x00,0xa5,0x8f, - 0x04,0x00,0xb5,0x36,0xc8,0x8b,0x84,0x27,0x21,0x90,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcf,0x02,0xc1,0x2a,0x00,0x0c, - 0xc4,0x09,0x04,0x24,0x78,0x00,0x00,0x10,0x0c,0x00,0x4d,0x32, - 0xc3,0x09,0x10,0x24,0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x08,0x00,0x8c,0x92,0x00,0x00,0x00,0x00,0x01,0x00,0x8d,0x31, - 0x04,0x00,0xa0,0x11,0x00,0x00,0x00,0x00,0x21,0x10,0x00,0x02, - 0xf7,0xff,0x40,0x14,0xff,0xff,0x10,0x26,0x0a,0x00,0x01,0x06, - 0x00,0x00,0x00,0x00,0x94,0x00,0xab,0x8f,0xd8,0x00,0xa5,0x8f, - 0x00,0x04,0xb5,0x36,0xfc,0x8b,0x84,0x27,0x21,0x90,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcb,0x02,0x62,0x00,0x00,0x10, - 0x0c,0x00,0x4d,0x32,0x14,0x00,0x99,0x92,0x00,0x00,0x00,0x00, - 0x0e,0x00,0x38,0x33,0x1f,0x00,0x00,0x13,0x05,0x00,0x01,0x24, - 0x94,0x00,0xa9,0x8f,0xd8,0x00,0xa5,0x8f,0x08,0x00,0xb5,0x36, - 0x24,0x8c,0x84,0x27,0x29,0x2a,0x00,0x0c,0x21,0x30,0xc9,0x02, - 0x14,0x00,0x8e,0x92,0x00,0x00,0x00,0x00,0x02,0x00,0xca,0x31, - 0x03,0x00,0x40,0x11,0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c, - 0x38,0x8c,0x84,0x27,0x14,0x00,0x8f,0x92,0x00,0x00,0x00,0x00, - 0x04,0x00,0xec,0x31,0x03,0x00,0x80,0x11,0x00,0x00,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x48,0x8c,0x84,0x27,0x14,0x00,0x8d,0x92, - 0x00,0x00,0x00,0x00,0x08,0x00,0xab,0x31,0x03,0x00,0x60,0x11, - 0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c,0x58,0x8c,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x68,0x8c,0x84,0x27,0x05,0x00,0x01,0x24, - 0x07,0x00,0xe1,0x12,0x7f,0x00,0x01,0x24,0x05,0x00,0xe1,0x12, - 0x0c,0x00,0x01,0x24,0x03,0x00,0xe1,0x12,0x0e,0x00,0x01,0x24, - 0x0f,0x00,0xe1,0x16,0x00,0x00,0x00,0x00,0x14,0x00,0x99,0x92, - 0x00,0x00,0x00,0x00,0x01,0x00,0x38,0x33,0x0a,0x00,0x00,0x17, - 0x00,0x00,0x00,0x00,0x94,0x00,0xa9,0x8f,0xd8,0x00,0xa5,0x8f, - 0x01,0x00,0xb5,0x36,0x6c,0x8c,0x84,0x27,0x21,0x90,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xc9,0x02,0x29,0x00,0x00,0x10, - 0x0c,0x00,0x4d,0x32,0x00,0x00,0x90,0x92,0x05,0x00,0x01,0x24, - 0x07,0x00,0xe1,0x12,0x7f,0x00,0x01,0x24,0x05,0x00,0xe1,0x12, - 0x0c,0x00,0x01,0x24,0x03,0x00,0xe1,0x12,0x0e,0x00,0x01,0x24, - 0x0f,0x00,0xe1,0x16,0x00,0x00,0x00,0x00,0x14,0x00,0x8e,0x92, - 0x00,0x00,0x00,0x00,0x01,0x00,0xca,0x31,0x0a,0x00,0x40,0x11, - 0x00,0x00,0x00,0x00,0x94,0x00,0xaf,0x8f,0xd8,0x00,0xa5,0x8f, - 0x01,0x00,0xb5,0x36,0x94,0x8c,0x84,0x27,0x21,0x90,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcf,0x02,0x11,0x00,0x00,0x10, - 0x0c,0x00,0x4d,0x32,0x09,0x00,0x12,0x12,0x00,0x00,0x00,0x00, - 0x94,0x00,0xac,0x8f,0xd8,0x00,0xa5,0x8f,0x10,0x00,0xb5,0x36, - 0xc0,0x8c,0x84,0x27,0x21,0x38,0x40,0x02,0x10,0x00,0xb0,0xaf, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcc,0x02,0x01,0x00,0x52,0x26, - 0x00,0x01,0x41,0x2a,0x56,0xff,0x20,0x14,0x05,0x00,0x01,0x24, - 0x21,0x90,0x00,0x00,0x0c,0x00,0x4d,0x32,0x01,0x00,0x59,0x32, - 0x40,0xc0,0x19,0x00,0x10,0x00,0xab,0x35,0x02,0x00,0x4e,0x32, - 0x43,0x50,0x0e,0x00,0x25,0x48,0x78,0x01,0x25,0x78,0x2a,0x01, - 0x10,0x00,0x8f,0xa2,0xc1,0x2a,0x00,0x0c,0xfa,0x00,0x04,0x24, - 0x18,0x00,0x90,0x92,0x00,0x00,0x00,0x00,0x02,0x81,0x10,0x00, - 0x0f,0x00,0x10,0x32,0x20,0x00,0x12,0x12,0x00,0x00,0x00,0x00, - 0x94,0x00,0xac,0x8f,0xd8,0x00,0xa5,0x8f,0x20,0x00,0xb5,0x36, - 0xec,0x8c,0x84,0x27,0x21,0x38,0x40,0x02,0x10,0x00,0xb0,0xaf, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcc,0x02,0x26,0x88,0x12,0x02, - 0x01,0x00,0x2d,0x32,0x04,0x00,0xa0,0x11,0x02,0x00,0x39,0x32, - 0x29,0x2a,0x00,0x0c,0x20,0x8d,0x84,0x27,0x02,0x00,0x39,0x32, - 0x04,0x00,0x20,0x13,0x04,0x00,0x2b,0x32,0x29,0x2a,0x00,0x0c, - 0x2c,0x8d,0x84,0x27,0x04,0x00,0x2b,0x32,0x04,0x00,0x60,0x11, - 0x08,0x00,0x38,0x32,0x29,0x2a,0x00,0x0c,0x38,0x8d,0x84,0x27, - 0x08,0x00,0x38,0x32,0x03,0x00,0x00,0x13,0x00,0x00,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x44,0x8d,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x50,0x8d,0x84,0x27,0x01,0x00,0x52,0x26,0xcf,0xff,0x53,0x16, - 0x0c,0x00,0x4d,0x32,0x1b,0x00,0x0e,0x24,0x10,0x00,0x8e,0xa2, - 0xe1,0x21,0x00,0x0c,0x21,0x20,0x00,0x00,0x01,0x00,0x09,0x24, - 0x00,0xa3,0x0a,0x3c,0x80,0x01,0x49,0xad,0x70,0x00,0xaf,0x8f, - 0x00,0x00,0x00,0x00,0x00,0x00,0xe4,0x8d,0xe1,0x21,0x00,0x0c, - 0x01,0x00,0x84,0x24,0x01,0x00,0x0c,0x24,0x04,0x00,0x8c,0xa2, - 0x00,0x00,0x80,0x92,0x08,0x00,0x80,0x92,0xc0,0x09,0x10,0x24, - 0xfc,0xff,0x10,0x26,0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26, - 0x00,0xa3,0x0d,0x3c,0x80,0x01,0xb9,0x8d,0x01,0x00,0x01,0x24, - 0x08,0x00,0x21,0x13,0x08,0x00,0xce,0x32,0x94,0x00,0xab,0x8f, - 0xd8,0x00,0xa5,0x8f,0x40,0x00,0xb5,0x36,0x54,0x8d,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcb,0x02,0x08,0x00,0xce,0x32, - 0x88,0x00,0xb8,0x8f,0x08,0x00,0xc9,0x25,0x43,0x50,0x09,0x00, - 0x21,0x88,0x0a,0x03,0x00,0x00,0x2d,0x92,0x07,0x00,0xcf,0x32, - 0x01,0x00,0x0c,0x24,0x04,0x90,0xec,0x01,0x24,0xc8,0xb2,0x01, - 0x08,0x00,0x20,0x13,0x2a,0x00,0x0e,0x24,0x94,0x00,0xab,0x8f, - 0xd8,0x00,0xa5,0x8f,0x40,0x00,0xb5,0x36,0x74,0x8d,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcb,0x02,0x2a,0x00,0x0e,0x24, - 0x00,0x00,0x8e,0xa2,0xc3,0x09,0x10,0x24,0x00,0xa3,0x09,0x3c, - 0x80,0x01,0x38,0x8d,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x13, - 0x00,0x00,0x00,0x00,0xff,0xff,0x10,0x26,0xfa,0xff,0x00,0x16, - 0x00,0xa3,0x09,0x3c,0xc0,0x09,0x10,0x24,0xfc,0xff,0x10,0x26, - 0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26,0x00,0x00,0x2a,0x92, - 0x00,0x00,0x00,0x00,0x24,0x60,0x52,0x01,0x07,0x00,0x80,0x15, - 0x00,0x00,0x00,0x00,0x94,0x00,0xaf,0x8f,0xd8,0x00,0xa5,0x8f, - 0x40,0x00,0xb5,0x36,0xa4,0x8d,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0xcf,0x02,0x00,0x00,0x80,0x92,0x08,0x00,0x80,0x92, - 0x00,0xa3,0x0d,0x3c,0x80,0x01,0xb9,0x8d,0x00,0x00,0x00,0x00, - 0x07,0x00,0x20,0x13,0x00,0x00,0x00,0x00,0x94,0x00,0xab,0x8f, - 0xd8,0x00,0xa5,0x8f,0x80,0x00,0xb5,0x36,0xd4,0x8d,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcb,0x02,0xe1,0x21,0x00,0x0c, - 0x21,0x20,0x00,0x00,0x01,0x00,0x0e,0x24,0x00,0xa3,0x09,0x3c, - 0x80,0x01,0x2e,0xad,0x70,0x00,0xb8,0x8f,0x00,0x00,0x00,0x00, - 0x00,0x00,0x04,0x8f,0xe1,0x21,0x00,0x0c,0x01,0x00,0x84,0x24, - 0xc0,0x09,0x10,0x24,0xfc,0xff,0x10,0x26,0xff,0xff,0x00,0x16, - 0xfc,0xff,0x10,0x26,0x00,0xa3,0x0a,0x3c,0x80,0x01,0x4c,0x8d, - 0x01,0x00,0x01,0x24,0x07,0x00,0x81,0x11,0x00,0x00,0x00,0x00, - 0x94,0x00,0xaf,0x8f,0xd8,0x00,0xa5,0x8f,0x00,0x01,0xb5,0x36, - 0xfc,0x8d,0x84,0x27,0x29,0x2a,0x00,0x0c,0x21,0x30,0xcf,0x02, - 0x00,0x00,0x2d,0x92,0x00,0x00,0x00,0x00,0x24,0xc8,0xb2,0x01, - 0x07,0x00,0x20,0x13,0x00,0x00,0x00,0x00,0x94,0x00,0xab,0x8f, - 0xd8,0x00,0xa5,0x8f,0x40,0x00,0xb5,0x36,0x24,0x8e,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcb,0x02,0xe1,0x21,0x00,0x0c, - 0x21,0x20,0x00,0x00,0x07,0x00,0x02,0x24,0x04,0x00,0x80,0xa2, - 0x08,0x00,0x82,0xa2,0x01,0x00,0x0e,0x24,0x08,0x00,0x8e,0xa2, - 0x87,0x00,0x09,0x24,0x0c,0x00,0x89,0xa2,0x30,0x00,0x18,0x24, - 0x00,0x00,0x98,0xa2,0x04,0x00,0x80,0xa2,0x0c,0x00,0x82,0xa2, - 0x08,0x00,0x0a,0x24,0x10,0x00,0x8a,0xa2,0x00,0x00,0x80,0x92, - 0x07,0x00,0x00,0x10,0xed,0x00,0x02,0x24,0x7c,0x00,0xac,0x8f, - 0x01,0x00,0x0d,0x24,0x00,0x00,0x8f,0x8d,0x04,0xc8,0xcd,0x02, - 0x25,0x58,0xf9,0x01,0x00,0x00,0x8b,0xad,0x0c,0x00,0xa0,0x12, - 0x68,0x00,0xab,0x8f,0x7c,0x00,0xae,0x8f,0x01,0x00,0x18,0x24, - 0x00,0x00,0xc9,0x8d,0x04,0x50,0xd8,0x02,0x25,0x68,0x2a,0x01, - 0x00,0x00,0xcd,0xad,0xbc,0x00,0xaf,0x8f,0x00,0x00,0x00,0x00, - 0x01,0x00,0xf9,0x35,0xbc,0x00,0xb9,0xaf,0x68,0x00,0xab,0x8f, - 0xa0,0x00,0xb8,0x8f,0x01,0x00,0xd6,0x26,0x20,0x00,0x6c,0x25, - 0x2a,0x08,0xd8,0x02,0x34,0xfe,0x20,0x14,0x68,0x00,0xac,0xaf, - 0x54,0x00,0xb1,0x8f,0x50,0x00,0xb2,0x8f,0x60,0x00,0xb4,0x8f, - 0x5c,0x00,0xb5,0x8f,0x58,0x00,0xbe,0x8f,0x00,0x00,0x00,0x00, - 0x6c,0x00,0xa9,0x8f,0x00,0x00,0x00,0x00,0x05,0x00,0x20,0x11, - 0x21,0x10,0x20,0x01,0x00,0xa3,0x0a,0x3c,0xa8,0x01,0x42,0x95, - 0x00,0x00,0x00,0x00,0x2b,0x10,0x02,0x00,0x80,0x00,0xae,0x8f, - 0x9c,0x00,0xa3,0x8f,0xa0,0x00,0xa7,0x8f,0x00,0x00,0xcf,0x91, - 0x21,0x68,0xe3,0x00,0x21,0xc8,0xe2,0x01,0x0a,0x00,0xb9,0x11, - 0xbc,0x00,0xb8,0x8f,0xbc,0x00,0xab,0x8f,0xd8,0x00,0xa5,0x8f, - 0x02,0x00,0x6c,0x35,0xbc,0x00,0xac,0xaf,0x00,0x00,0xc6,0x91, - 0x10,0x00,0xa3,0xaf,0x29,0x2a,0x00,0x0c,0x54,0x8e,0x84,0x27, - 0xbc,0x00,0xb8,0x8f,0x00,0x00,0x00,0x00,0x11,0x00,0x00,0x17, - 0x84,0x00,0xad,0x8f,0x80,0x00,0xa9,0x8f,0x00,0x00,0x00,0x00, - 0x00,0x00,0x2a,0x91,0x00,0x00,0x00,0x00,0x08,0x00,0x40,0x11, - 0x00,0x00,0x00,0x00,0x00,0x00,0x25,0x91,0x29,0x2a,0x00,0x0c, - 0x80,0x8e,0x84,0x27,0x65,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x04,0x00,0x00,0x10,0x84,0x00,0xad,0x8f,0x29,0x2a,0x00,0x0c, - 0x8c,0x8e,0x84,0x27,0x84,0x00,0xad,0x8f,0x01,0x00,0x0f,0x24, - 0xe2,0x04,0x00,0x10,0x00,0x00,0xaf,0xa1,0x07,0x00,0x61,0x04, - 0xa0,0x00,0xab,0x8f,0x23,0x10,0x03,0x00,0xff,0xff,0x59,0x24, - 0xac,0x00,0xb9,0xaf,0x04,0x00,0x00,0x10,0xa8,0x00,0xa2,0xaf, - 0xa0,0x00,0xab,0x8f,0xac,0x00,0xa0,0xaf,0xa8,0x00,0xab,0xaf, - 0xac,0x00,0xac,0x8f,0xa8,0x00,0xae,0x8f,0x21,0xb0,0x80,0x01, - 0x2a,0x08,0x8e,0x01,0x2b,0x00,0x20,0x10,0x00,0x00,0x00,0x00, - 0x60,0x00,0xb4,0xaf,0xd8,0x00,0xb8,0x8f,0x00,0x00,0x00,0x00, - 0x07,0x00,0x00,0x17,0x88,0x00,0xad,0x8f,0x00,0xa3,0x09,0x3c, - 0xa8,0x01,0x2f,0x95,0x01,0x00,0xca,0x26,0x14,0x00,0x4f,0x11, - 0x00,0x00,0x00,0x00,0x88,0x00,0xad,0x8f,0x40,0xc9,0x16,0x00, - 0x21,0xa0,0xb9,0x01,0x07,0x00,0x0b,0x24,0x08,0x01,0x8b,0xa2, - 0x01,0x00,0x0c,0x24,0x08,0x01,0x8c,0xa2,0x8f,0x00,0x0e,0x24, - 0x0c,0x01,0x8e,0xa2,0x04,0x00,0x18,0x24,0x00,0x01,0x98,0xa2, - 0x04,0x01,0x80,0xa2,0x0f,0x00,0x09,0x24,0x0c,0x01,0x89,0xa2, - 0x01,0x00,0x0a,0x24,0x04,0x01,0x8a,0xa2,0x08,0x00,0x0f,0x24, - 0x00,0x01,0x94,0x26,0x10,0x00,0x8f,0xa2,0xc1,0x2a,0x00,0x0c, - 0xc4,0x09,0x04,0x24,0xa8,0x00,0xad,0x8f,0x01,0x00,0xd6,0x26, - 0x2a,0x08,0xcd,0x02,0x05,0x00,0x20,0x10,0x60,0x00,0xb4,0x8f, - 0xdc,0x00,0xa3,0x8f,0xdc,0xff,0x00,0x10,0xd8,0x00,0xb8,0x8f, - 0x60,0x00,0xb4,0x8f,0xdc,0x00,0xa3,0x8f,0x00,0x00,0x00,0x00, - 0x9c,0x01,0x70,0x14,0x00,0x00,0x00,0x00,0xd8,0x00,0xa3,0x8f, - 0xe0,0x00,0xab,0x8f,0x40,0x61,0x03,0x00,0x54,0x00,0xb1,0xaf, - 0x01,0x00,0x79,0x2c,0x21,0xb8,0x6c,0x01,0x50,0x00,0xb2,0xaf, - 0x21,0x88,0xe0,0x02,0x6c,0x00,0xb9,0xaf,0x21,0xb0,0x00,0x00, - 0xff,0xff,0x02,0x24,0x10,0x00,0x13,0x24,0x04,0x00,0xd6,0x26, - 0x00,0x00,0x22,0xa6,0x02,0x00,0x22,0xa6,0x04,0x00,0x22,0xa6, - 0x06,0x00,0x22,0xa6,0xfa,0xff,0xd3,0x16,0x08,0x00,0x31,0x26, - 0x9c,0x00,0xae,0x8f,0x01,0x00,0x01,0x24,0x7b,0x00,0xc1,0x15, - 0x00,0x00,0x00,0x00,0xec,0x88,0x98,0x8f,0xff,0x00,0x01,0x24, - 0x10,0x00,0x01,0x17,0x00,0x00,0x00,0x00,0x58,0x00,0xbe,0xaf, - 0x8c,0x00,0xbe,0x8f,0x01,0xa1,0x01,0x3c,0x00,0x08,0x21,0x34, - 0x80,0x00,0x69,0x24,0x21,0xf0,0xc1,0x03,0xec,0x88,0x89,0xaf, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03,0x42,0x00,0x0a,0x24, - 0x2c,0x00,0xca,0xa3,0xd8,0x00,0xa3,0x8f,0x58,0x00,0xbe,0x8f, - 0x68,0x00,0x00,0x10,0xff,0xff,0x02,0x24,0xec,0x88,0x8f,0x8f, - 0x00,0x00,0x00,0x00,0x80,0x00,0xed,0x31,0x63,0x00,0xa0,0x11, - 0x00,0x00,0x00,0x00,0x80,0x00,0x72,0x24,0x60,0x00,0xf2,0x11, - 0x00,0x00,0x00,0x00,0x58,0x00,0xbe,0xaf,0x8c,0x00,0xbe,0x8f, - 0x01,0xa1,0x01,0x3c,0x00,0x08,0x21,0x34,0x60,0x00,0xb4,0xaf, - 0x03,0x00,0x19,0x24,0x21,0xf0,0xc1,0x03,0x28,0x00,0xd9,0xa3, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03,0x80,0x00,0x0b,0x24, - 0x2c,0x00,0xcb,0xa3,0x08,0x00,0x0c,0x24,0x78,0x00,0xcc,0xa3, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03,0x42,0x00,0x0e,0x24, - 0x2c,0x00,0xce,0xa3,0x04,0x00,0x18,0x24,0x08,0x00,0xd8,0xa3, - 0x04,0x00,0x09,0x24,0x0c,0x00,0xc9,0xa3,0xec,0x88,0x90,0x8f, - 0x01,0xa1,0x01,0x3c,0x7f,0x00,0x10,0x32,0x80,0x83,0x10,0x00, - 0x00,0x08,0x21,0x34,0x21,0x80,0x01,0x02,0x21,0xa0,0x00,0x02, - 0x28,0x00,0x00,0xa2,0x7b,0x2e,0x00,0x0c,0x21,0x20,0x00,0x02, - 0x80,0x00,0x0a,0x24,0x2c,0x00,0x0a,0xa2,0x09,0x00,0x0d,0x24, - 0x78,0x00,0x0d,0xa2,0x7b,0x2e,0x00,0x0c,0x21,0x20,0x00,0x02, - 0x42,0x00,0x0f,0x24,0x2c,0x00,0x0f,0xa2,0x04,0x00,0x19,0x24, - 0x08,0x00,0x19,0xa2,0x04,0x00,0x0b,0x24,0x0c,0x00,0x0b,0xa2, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0x00,0x02,0x43,0x00,0x0c,0x24, - 0x2c,0x00,0x0c,0xa2,0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03, - 0x43,0x00,0x0e,0x24,0x2c,0x00,0xce,0xa3,0xd8,0x00,0xb1,0x8f, - 0x0f,0x27,0x16,0x24,0x50,0x00,0x31,0x26,0x48,0x00,0x11,0xa2, - 0xd2,0x27,0x00,0x0c,0x00,0x00,0x00,0x00,0x38,0x00,0xd8,0x93, - 0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x17,0x00,0x00,0x00,0x00, - 0x21,0x10,0xc0,0x02,0xf8,0xff,0x40,0x14,0xff,0xff,0xd6,0x26, - 0x48,0x00,0xc9,0x93,0x00,0x00,0x00,0x00,0x0d,0x00,0x29,0x16, - 0x00,0x00,0x00,0x00,0xa0,0x00,0xad,0x8f,0xec,0x88,0x8a,0x8f, - 0x40,0x78,0x0d,0x00,0x21,0xc8,0xef,0x02,0x00,0x00,0x2a,0xa7, - 0xe0,0x00,0xab,0x8f,0x7f,0x00,0x4c,0x31,0x40,0x71,0x0c,0x00, - 0x40,0x48,0x0d,0x00,0x21,0xc0,0x6e,0x01,0x21,0x78,0x09,0x03, - 0x00,0x00,0xf2,0xa5,0x7b,0x2e,0x00,0x0c,0x21,0x20,0x80,0x02, - 0x42,0x00,0x19,0x24,0x2c,0x00,0x99,0xa2,0x7b,0x2e,0x00,0x0c, - 0x21,0x20,0xc0,0x03,0x42,0x00,0x0a,0x24,0x2c,0x00,0xca,0xa3, - 0xff,0x00,0x0c,0x24,0xd8,0x00,0xa3,0x8f,0x58,0x00,0xbe,0x8f, - 0x60,0x00,0xb4,0x8f,0xec,0x88,0x8c,0xaf,0xff,0xff,0x02,0x24, - 0xa0,0x00,0xa5,0x8f,0x21,0xb0,0x00,0x00,0x06,0x00,0xa0,0x1c, - 0x00,0xa3,0x07,0x3c,0x00,0xa3,0x07,0x3c,0x88,0x00,0xa6,0x8f, - 0x12,0x00,0x00,0x10,0xa8,0x01,0xe7,0x34,0x00,0xa3,0x07,0x3c, - 0x88,0x00,0xa6,0x8f,0xa8,0x01,0xe7,0x34,0x06,0x00,0x60,0x14, - 0x40,0x69,0x16,0x00,0x00,0x00,0xee,0x94,0x01,0x00,0xcb,0x26, - 0x04,0x00,0x6e,0x11,0x00,0x00,0x00,0x00,0x40,0x69,0x16,0x00, - 0x21,0xc0,0xcd,0x00,0x00,0x01,0x16,0xa3,0x01,0x00,0xd6,0x26, - 0x2a,0x08,0xc5,0x02,0xf4,0xff,0x20,0x14,0x00,0x00,0x00,0x00, - 0x21,0xb0,0x00,0x00,0xc1,0x2a,0x00,0x0c,0x10,0x27,0x04,0x24, - 0xa0,0x00,0xa2,0x8f,0x00,0x00,0x00,0x00,0x05,0x00,0x40,0x1c, - 0x00,0x00,0x00,0x00,0x00,0xa3,0x08,0x3c,0xd8,0x00,0xa7,0x8f, - 0x5c,0x00,0x00,0x10,0xa8,0x01,0x08,0x35,0x5c,0x00,0xb5,0xaf, - 0x00,0xa3,0x08,0x3c,0xd8,0x00,0xa7,0x8f,0xa8,0x01,0x08,0x35, - 0xd4,0x8e,0x95,0x27,0x60,0x00,0xb4,0xaf,0x9c,0x8e,0x93,0x27, - 0x06,0x00,0xe0,0x14,0x88,0x00,0xb9,0x8f,0x00,0x00,0x0f,0x95, - 0x01,0x00,0xc9,0x26,0x48,0x00,0x2f,0x11,0x00,0x00,0x00,0x00, - 0x88,0x00,0xb9,0x8f,0x40,0x51,0x16,0x00,0x21,0xa0,0x2a,0x03, - 0x14,0x01,0x8c,0x92,0x00,0x01,0x94,0x26,0x01,0x00,0x8b,0x31, - 0x05,0x00,0x60,0x11,0xff,0x00,0x12,0x24,0x00,0x00,0x92,0x92, - 0x02,0x00,0x00,0x10,0x7f,0x00,0x52,0x32,0xff,0x00,0x12,0x24, - 0xff,0x00,0x01,0x24,0x39,0x00,0x41,0x12,0x00,0x00,0x00,0x00, - 0x40,0x70,0x16,0x00,0x2a,0x00,0x40,0x06,0x21,0x88,0xee,0x02, - 0x2a,0x08,0x42,0x02,0x28,0x00,0x20,0x10,0x94,0x00,0xa2,0x8f, - 0x05,0x00,0xe0,0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x95, - 0x01,0x00,0x4d,0x26,0x22,0x00,0xb8,0x11,0x94,0x00,0xa2,0x8f, - 0x00,0x00,0x23,0x86,0xff,0xff,0x01,0x24,0x04,0x00,0x61,0x10, - 0x40,0x48,0x12,0x00,0x0a,0x00,0x43,0x16,0x40,0x78,0x12,0x00, - 0x40,0x48,0x12,0x00,0x21,0x80,0xe9,0x02,0x00,0x00,0x02,0x86, - 0xff,0xff,0x01,0x24,0x12,0x00,0x41,0x10,0x00,0x00,0x00,0x00, - 0x10,0x00,0xc2,0x12,0x00,0x00,0x00,0x00,0x40,0x78,0x12,0x00, - 0x94,0x00,0xa2,0x8f,0x21,0x80,0xef,0x02,0x00,0x00,0x06,0x86, - 0x21,0xc8,0x42,0x02,0x10,0x00,0xb9,0xaf,0x21,0x20,0x60,0x02, - 0x01,0x00,0x65,0x24,0x21,0x38,0xc2,0x02,0x29,0x2a,0x00,0x0c, - 0x01,0x00,0xc6,0x24,0xff,0xff,0x02,0x24,0x00,0x00,0x22,0xa6, - 0x0c,0x00,0x00,0x10,0x00,0x00,0x02,0xa6,0x00,0x00,0x32,0xa6, - 0x09,0x00,0x00,0x10,0x00,0x00,0x16,0xa6,0x94,0x00,0xa2,0x8f, - 0x00,0x00,0x2a,0x86,0x21,0x20,0xa0,0x02,0x21,0x30,0x42,0x02, - 0x29,0x2a,0x00,0x0c,0x21,0x28,0x42,0x01,0xff,0xff,0x0c,0x24, - 0x00,0x00,0x2c,0xa6,0x00,0xa3,0x08,0x3c,0xa0,0x00,0xa2,0x8f, - 0xd8,0x00,0xa7,0x8f,0xa8,0x01,0x08,0x35,0x01,0x00,0xd6,0x26, - 0x2a,0x08,0xc2,0x02,0xb0,0xff,0x20,0x14,0x00,0x00,0x00,0x00, - 0x60,0x00,0xb4,0x8f,0x5c,0x00,0xb5,0x8f,0x21,0xb0,0x00,0x00, - 0x35,0x00,0x40,0x18,0x21,0x90,0x00,0x00,0x60,0x00,0xb4,0xaf, - 0x04,0x8f,0x94,0x27,0x21,0x88,0xe0,0x02,0xfc,0x8e,0x90,0x27, - 0x00,0x8f,0x93,0x27,0x00,0x00,0x23,0x86,0xff,0xff,0x01,0x24, - 0x13,0x00,0x61,0x10,0x2a,0x08,0x76,0x00,0x0f,0x00,0x20,0x14, - 0x00,0x00,0x00,0x00,0x21,0x20,0x00,0x02,0x29,0x2a,0x00,0x0c, - 0x01,0x00,0xc5,0x26,0x00,0x00,0x23,0x86,0x00,0x00,0x00,0x00, - 0x05,0x00,0xc3,0x12,0x00,0x00,0x00,0x00,0x21,0x20,0x60,0x02, - 0x29,0x2a,0x00,0x0c,0x01,0x00,0x65,0x24,0x01,0x00,0x52,0x26, - 0x5c,0x28,0x00,0x0c,0x20,0x00,0x04,0x24,0x01,0x00,0x52,0x26, - 0x0c,0x00,0x00,0x10,0x01,0x00,0xc2,0x26,0xd8,0x00,0xab,0x8f, - 0x00,0x00,0x00,0x00,0x05,0x00,0x60,0x15,0x00,0x00,0x00,0x00, - 0x00,0x00,0x0d,0x95,0x01,0x00,0xce,0x26,0x04,0x00,0xcd,0x11, - 0x01,0x00,0xc2,0x26,0x29,0x2a,0x00,0x0c,0x21,0x20,0x80,0x02, - 0x01,0x00,0xc2,0x26,0xa0,0x00,0xb8,0x8f,0x21,0xb0,0x40,0x00, - 0x2a,0x08,0xd8,0x02,0x05,0x00,0x20,0x10,0x02,0x00,0x31,0x26, - 0x00,0xa3,0x08,0x3c,0xa8,0x01,0x08,0x35,0xd7,0xff,0x00,0x10, - 0x21,0x10,0x00,0x03,0x00,0xa3,0x08,0x3c,0x60,0x00,0xb4,0x8f, - 0xa0,0x00,0xa2,0x8f,0xd8,0x00,0xa7,0x8f,0xa8,0x01,0x08,0x35, - 0x9c,0x00,0xa9,0x8f,0x01,0x00,0x01,0x24,0x13,0x00,0x21,0x15, - 0x6c,0x00,0xac,0x8f,0xa0,0x00,0xaf,0x8f,0xff,0xff,0x01,0x24, - 0x40,0xc8,0x0f,0x00,0x21,0x50,0xf9,0x02,0x00,0x00,0x42,0x85, - 0x00,0x00,0x00,0x00,0x03,0x00,0x41,0x14,0x00,0x00,0x00,0x00, - 0x08,0x00,0x00,0x10,0x21,0x10,0xe0,0x01,0x08,0x8f,0x84,0x27, - 0x7f,0x00,0x45,0x30,0x29,0x2a,0x00,0x0c,0x21,0x30,0xe0,0x00, - 0x00,0xa3,0x08,0x3c,0xa0,0x00,0xa2,0x8f,0xa8,0x01,0x08,0x35, - 0x6c,0x00,0xac,0x8f,0x00,0x00,0x00,0x00,0x0c,0x00,0x80,0x11, - 0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x95,0x00,0x00,0x00,0x00, - 0x08,0x00,0x60,0x11,0x00,0x00,0x00,0x00,0x00,0xa3,0x0e,0x3c, - 0xa8,0x01,0xc5,0x95,0x29,0x2a,0x00,0x0c,0x14,0x8f,0x84,0x27, - 0x00,0xa3,0x08,0x3c,0xa0,0x00,0xa2,0x8f,0xa8,0x01,0x08,0x35, - 0x0a,0x00,0x40,0x16,0x6c,0x00,0xa9,0x8f,0x29,0x2a,0x00,0x0c, - 0x20,0x8f,0x84,0x27,0xbc,0x00,0xad,0x8f,0x00,0xa3,0x08,0x3c, - 0x00,0x80,0xb8,0x35,0xa0,0x00,0xa2,0x8f,0xbc,0x00,0xb8,0xaf, - 0xa8,0x01,0x08,0x35,0x6c,0x00,0xa9,0x8f,0x00,0x00,0x00,0x00, - 0x06,0x00,0x20,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x19,0x95, - 0x00,0x00,0x00,0x00,0x02,0x00,0x20,0x13,0x00,0x00,0x00,0x00, - 0x01,0x00,0x52,0x26,0x29,0x2a,0x00,0x0c,0x44,0x8f,0x84,0x27, - 0xa0,0x00,0xaa,0x8f,0x00,0x00,0x00,0x00,0x2a,0x08,0x4a,0x02, - 0x04,0x00,0x20,0x10,0x9c,0x00,0xaf,0x8f,0x29,0x2a,0x00,0x0c, - 0x48,0x8f,0x84,0x27,0x9c,0x00,0xaf,0x8f,0x01,0x00,0x01,0x24, - 0x10,0x00,0xe1,0x15,0x54,0x00,0xb1,0x8f,0xa0,0x00,0xac,0x8f, - 0xff,0xff,0x01,0x24,0x40,0x58,0x0c,0x00,0x21,0x70,0xeb,0x02, - 0x00,0x00,0xcd,0x85,0x00,0x00,0x00,0x00,0x08,0x00,0xa1,0x15, - 0x54,0x00,0xb1,0x8f,0xec,0x88,0x98,0x8f,0xff,0x00,0x01,0x24, - 0x04,0x00,0x01,0x17,0x54,0x00,0xb1,0x8f,0x29,0x2a,0x00,0x0c, - 0x78,0x8f,0x84,0x27,0x54,0x00,0xb1,0x8f,0x50,0x00,0xb2,0x8f, - 0x0b,0x03,0x00,0x10,0x00,0x00,0x00,0x00,0x5c,0x00,0xb5,0xaf, - 0x21,0xa8,0x00,0x00,0x04,0x00,0x61,0x04,0xec,0x88,0x80,0xaf, - 0xe0,0x00,0xa6,0x8f,0xa3,0x00,0x00,0x10,0xac,0x00,0xad,0x8f, - 0x9c,0x00,0xa9,0x8f,0x01,0x00,0x01,0x24,0x05,0x00,0x21,0x11, - 0xe0,0x00,0xa6,0x8f,0xe0,0x00,0xa6,0x8f,0x9c,0x00,0x00,0x10, - 0xac,0x00,0xad,0x8f,0xe0,0x00,0xa6,0x8f,0x00,0x00,0x00,0x00, - 0x98,0x00,0xc0,0x10,0xac,0x00,0xad,0x8f,0xd8,0x00,0xb9,0x8f, - 0xa0,0x00,0xac,0x8f,0x40,0x51,0x19,0x00,0x21,0x78,0xca,0x00, - 0x40,0x58,0x0c,0x00,0x21,0x10,0xeb,0x01,0x00,0x00,0x4e,0x84, - 0xff,0xff,0x01,0x24,0x8e,0x00,0xc1,0x11,0xac,0x00,0xad,0x8f, - 0x58,0x00,0xbe,0xaf,0x8c,0x00,0xbe,0x8f,0x01,0xa1,0x01,0x3c, - 0x00,0x08,0x21,0x34,0x54,0x00,0xb1,0xaf,0x50,0x00,0xb2,0xaf, - 0x60,0x00,0xb4,0xaf,0x03,0x00,0x0d,0x24,0x21,0xf0,0xc1,0x03, - 0x28,0x00,0xcd,0xa3,0x84,0x00,0xa2,0xaf,0x7b,0x2e,0x00,0x0c, - 0x21,0x20,0xc0,0x03,0x80,0x00,0x18,0x24,0x2c,0x00,0xd8,0xa3, - 0x08,0x00,0x09,0x24,0x78,0x00,0xc9,0xa3,0x7b,0x2e,0x00,0x0c, - 0x21,0x20,0xc0,0x03,0x42,0x00,0x19,0x24,0x2c,0x00,0xd9,0xa3, - 0x04,0x00,0x0a,0x24,0x08,0x00,0xca,0xa3,0x04,0x00,0x0c,0x24, - 0x0c,0x00,0xcc,0xa3,0x84,0x00,0xaf,0x8f,0x01,0xa1,0x01,0x3c, - 0x00,0x00,0xf4,0x85,0x00,0x08,0x21,0x34,0x7f,0x00,0x94,0x32, - 0x80,0xa3,0x14,0x00,0x21,0xa0,0x81,0x02,0x28,0x00,0x80,0xa2, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0x80,0x02,0x80,0x00,0x0b,0x24, - 0x2c,0x00,0x8b,0xa2,0x09,0x00,0x0e,0x24,0x78,0x00,0x8e,0xa2, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0x80,0x02,0x42,0x00,0x0d,0x24, - 0x2c,0x00,0x8d,0xa2,0x04,0x00,0x18,0x24,0x08,0x00,0x98,0xa2, - 0x04,0x00,0x09,0x24,0x0c,0x00,0x89,0xa2,0x7b,0x2e,0x00,0x0c, - 0x21,0x20,0xc0,0x03,0x43,0x00,0x19,0x24,0x2c,0x00,0xd9,0xa3, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0x80,0x02,0x43,0x00,0x0a,0x24, - 0x2c,0x00,0x8a,0xa2,0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0x80,0x02,0xf0,0x88,0x8c,0x93, - 0x01,0xa0,0x02,0x3c,0x48,0x00,0x8c,0xa2,0xf1,0x88,0x8f,0x93, - 0x96,0xe6,0x42,0x24,0x02,0x00,0x16,0x24,0xf2,0x88,0x90,0x27, - 0x48,0x00,0x8f,0xa2,0x00,0x00,0x0b,0x92,0x04,0x00,0x10,0x26, - 0x48,0x00,0x8b,0xa2,0xfd,0xff,0x0e,0x92,0x00,0x00,0x00,0x00, - 0x48,0x00,0x8e,0xa2,0xfe,0xff,0x0d,0x92,0x00,0x00,0x00,0x00, - 0x48,0x00,0x8d,0xa2,0xff,0xff,0x18,0x92,0xf5,0xff,0x02,0x16, - 0x48,0x00,0x98,0xa2,0x0f,0x27,0x16,0x24,0xd2,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x38,0x00,0xc9,0x93,0x00,0x00,0x00,0x00, - 0x16,0x00,0x21,0x2d,0x04,0x00,0x20,0x10,0x00,0x00,0x00,0x00, - 0x21,0x10,0xc0,0x02,0xf7,0xff,0x40,0x14,0xff,0xff,0xd6,0x26, - 0x38,0x00,0xd9,0x93,0x16,0x00,0x01,0x24,0x0b,0x00,0x21,0x13, - 0x00,0x00,0x00,0x00,0x84,0x00,0xaa,0x8f,0x38,0x00,0xcc,0x93, - 0x00,0x00,0x45,0x85,0xd8,0x00,0xa7,0x8f,0xa4,0x8f,0x84,0x27, - 0x16,0x00,0x06,0x24,0x10,0x00,0xac,0xaf,0x29,0x2a,0x00,0x0c, - 0x7f,0x00,0xa5,0x30,0x00,0x04,0x15,0x24,0x01,0xa0,0x13,0x3c, - 0x96,0xe6,0x73,0x26,0x21,0xb0,0x00,0x00,0xf0,0x88,0x90,0x27, - 0xf0,0x8f,0x91,0x27,0x48,0x00,0xd2,0x93,0x00,0x00,0x06,0x92, - 0x00,0x00,0x00,0x00,0x09,0x00,0x46,0x12,0x00,0x00,0x00,0x00, - 0x84,0x00,0xaf,0x8f,0xd8,0x00,0xa7,0x8f,0x00,0x00,0xe5,0x85, - 0x10,0x00,0xb2,0xaf,0x21,0x20,0x20,0x02,0x29,0x2a,0x00,0x0c, - 0x7f,0x00,0xa5,0x30,0x10,0x00,0xb5,0x36,0x01,0x00,0x10,0x26, - 0xf1,0xff,0x13,0x16,0x00,0x00,0x00,0x00,0x7b,0x2e,0x00,0x0c, - 0x21,0x20,0x80,0x02,0x42,0x00,0x0b,0x24,0x2c,0x00,0x8b,0xa2, - 0x7b,0x2e,0x00,0x0c,0x21,0x20,0xc0,0x03,0x42,0x00,0x0e,0x24, - 0x2c,0x00,0xce,0xa3,0xe0,0x00,0xa6,0x8f,0xdc,0x00,0xa3,0x8f, - 0x58,0x00,0xbe,0x8f,0x60,0x00,0xb4,0x8f,0x50,0x00,0xb2,0x8f, - 0x54,0x00,0xb1,0x8f,0x00,0x00,0x00,0x00,0xac,0x00,0xad,0x8f, - 0xa8,0x00,0xb8,0x8f,0x21,0xb0,0xa0,0x01,0x2a,0x08,0xb8,0x01, - 0xc4,0x01,0x20,0x10,0xbc,0x00,0xad,0x8f,0x54,0x00,0xb1,0xaf, - 0x50,0x00,0xb2,0xaf,0x60,0x00,0xb4,0xaf,0x58,0x00,0xbe,0xaf, - 0x04,0x00,0x10,0x24,0x0c,0x00,0x61,0x04,0xd8,0x00,0xab,0x8f, - 0xd8,0x00,0xa9,0x8f,0xdc,0x88,0x8a,0x27,0x80,0xc8,0x09,0x00, - 0x21,0x60,0x2a,0x03,0x40,0x79,0x16,0x00,0x21,0xf0,0xc0,0x02, - 0x68,0x00,0xaf,0xaf,0x70,0x00,0xac,0xaf,0x3b,0x00,0x00,0x10, - 0x21,0x90,0x00,0x00,0xd8,0x00,0xab,0x8f,0x40,0xc0,0x16,0x00, - 0x40,0x71,0x0b,0x00,0x21,0x68,0xce,0x00,0x21,0x48,0xb8,0x01, - 0x00,0x00,0x3e,0x85,0xff,0xff,0x01,0x24,0x2b,0x00,0xc1,0x17, - 0xd8,0x00,0xad,0x8f,0x00,0xa3,0x0a,0x3c,0xa8,0x01,0x4c,0x95, - 0x01,0x00,0xd9,0x26,0x04,0x00,0x2c,0x17,0x88,0x00,0xaf,0x8f, - 0x98,0x01,0x00,0x10,0x04,0x00,0x10,0x24,0x88,0x00,0xaf,0x8f, - 0x40,0x59,0x16,0x00,0x21,0x88,0xeb,0x01,0x14,0x01,0x2e,0x92, - 0x21,0x90,0x00,0x00,0x20,0x00,0xcd,0x31,0x08,0x00,0xa0,0x15, - 0x00,0x01,0x34,0x26,0x94,0x00,0xb8,0x8f,0xd8,0x00,0xa5,0x8f, - 0x02,0x00,0xb5,0x36,0x34,0x90,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0xd8,0x02,0x00,0x01,0x34,0x26,0x55,0x00,0x09,0x24, - 0x00,0x00,0x89,0xa2,0x04,0x00,0x10,0x24,0x01,0x00,0x4a,0x32, - 0x40,0xc8,0x0a,0x00,0x02,0x00,0x4f,0x32,0x43,0x58,0x0f,0x00, - 0x08,0x00,0x2c,0x37,0x25,0x70,0x8b,0x01,0x10,0x00,0x8e,0xa2, - 0xc1,0x2a,0x00,0x0c,0xfa,0x00,0x04,0x24,0x01,0x00,0x52,0x26, - 0xf6,0xff,0x50,0x16,0x01,0x00,0x4a,0x32,0xdc,0x00,0xa3,0x8f, - 0xe0,0x00,0xa6,0x8f,0x77,0x01,0x00,0x10,0xa8,0x00,0xae,0x8f, - 0xd8,0x00,0xad,0x8f,0xdc,0x88,0x89,0x27,0x80,0xc0,0x0d,0x00, - 0x21,0x50,0x09,0x03,0x40,0xc9,0x16,0x00,0x68,0x00,0xb9,0xaf, - 0x70,0x00,0xaa,0xaf,0x21,0x90,0x00,0x00,0x88,0x00,0xa2,0x8f, - 0x68,0x00,0xaf,0x8f,0x40,0x61,0x1e,0x00,0x21,0x98,0x4c,0x00, - 0x21,0xa0,0x4f,0x00,0x00,0x01,0x94,0x26,0x00,0x01,0x73,0x26, - 0x05,0x00,0x01,0x24,0x07,0x00,0xe1,0x12,0x7f,0x00,0x01,0x24, - 0x05,0x00,0xe1,0x12,0x0c,0x00,0x01,0x24,0x03,0x00,0xe1,0x12, - 0x0e,0x00,0x01,0x24,0x0f,0x00,0xe1,0x16,0x00,0x00,0x00,0x00, - 0x14,0x00,0x6b,0x92,0x00,0x00,0x00,0x00,0x01,0x00,0x6e,0x31, - 0x0a,0x00,0xc0,0x11,0x00,0x00,0x00,0x00,0x94,0x00,0xad,0x8f, - 0xd8,0x00,0xa5,0x8f,0x01,0x00,0xb5,0x36,0x58,0x90,0x84,0x27, - 0x21,0x90,0x00,0x00,0x29,0x2a,0x00,0x0c,0x21,0x30,0xcd,0x03, - 0x98,0x00,0x00,0x10,0x01,0x00,0x4e,0x32,0x14,0x00,0x98,0x92, - 0x00,0x00,0x00,0x00,0x20,0x00,0x09,0x33,0x0a,0x00,0x20,0x15, - 0x00,0x00,0x00,0x00,0x94,0x00,0xaa,0x8f,0xd8,0x00,0xa5,0x8f, - 0x02,0x00,0xb5,0x36,0x80,0x90,0x84,0x27,0x21,0x90,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xca,0x02,0x8a,0x00,0x00,0x10, - 0x01,0x00,0x4e,0x32,0x00,0x00,0x60,0x92,0x00,0x00,0x92,0xa2, - 0x14,0x00,0x99,0x92,0x00,0x00,0x00,0x00,0x40,0x00,0x2f,0x33, - 0x0d,0x00,0xe0,0x11,0xc3,0x09,0x10,0x24,0x94,0x00,0xac,0x8f, - 0xd8,0x00,0xa5,0x8f,0x04,0x00,0xb5,0x36,0xa4,0x90,0x84,0x27, - 0x21,0x90,0x00,0x00,0x29,0x2a,0x00,0x0c,0x21,0x30,0xcc,0x02, - 0xc1,0x2a,0x00,0x0c,0xc4,0x09,0x04,0x24,0x78,0x00,0x00,0x10, - 0x01,0x00,0x4e,0x32,0xc3,0x09,0x10,0x24,0xd2,0x27,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x08,0x00,0x6b,0x92,0x00,0x00,0x00,0x00, - 0x01,0x00,0x6e,0x31,0x04,0x00,0xc0,0x11,0x00,0x00,0x00,0x00, - 0x21,0x10,0x00,0x02,0xf7,0xff,0x40,0x14,0xff,0xff,0x10,0x26, - 0x0a,0x00,0x01,0x06,0x00,0x00,0x00,0x00,0x94,0x00,0xad,0x8f, - 0xd8,0x00,0xa5,0x8f,0x00,0x04,0xb5,0x36,0xd8,0x90,0x84,0x27, - 0x21,0x90,0x00,0x00,0x29,0x2a,0x00,0x0c,0x21,0x30,0xcd,0x02, - 0x62,0x00,0x00,0x10,0x01,0x00,0x4e,0x32,0x14,0x00,0x78,0x92, - 0x00,0x00,0x00,0x00,0x0e,0x00,0x09,0x33,0x1f,0x00,0x20,0x11, - 0x05,0x00,0x01,0x24,0x94,0x00,0xaa,0x8f,0xd8,0x00,0xa5,0x8f, - 0x08,0x00,0xb5,0x36,0x00,0x91,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0xca,0x03,0x14,0x00,0x79,0x92,0x00,0x00,0x00,0x00, - 0x02,0x00,0x2f,0x33,0x03,0x00,0xe0,0x11,0x00,0x00,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x14,0x91,0x84,0x27,0x14,0x00,0x6c,0x92, - 0x00,0x00,0x00,0x00,0x04,0x00,0x8b,0x31,0x03,0x00,0x60,0x11, - 0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c,0x24,0x91,0x84,0x27, - 0x14,0x00,0x6e,0x92,0x00,0x00,0x00,0x00,0x08,0x00,0xcd,0x31, - 0x03,0x00,0xa0,0x11,0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c, - 0x34,0x91,0x84,0x27,0x29,0x2a,0x00,0x0c,0x44,0x91,0x84,0x27, - 0x05,0x00,0x01,0x24,0x07,0x00,0xe1,0x12,0x7f,0x00,0x01,0x24, - 0x05,0x00,0xe1,0x12,0x0c,0x00,0x01,0x24,0x03,0x00,0xe1,0x12, - 0x0e,0x00,0x01,0x24,0x0f,0x00,0xe1,0x16,0x00,0x00,0x00,0x00, - 0x14,0x00,0x78,0x92,0x00,0x00,0x00,0x00,0x01,0x00,0x09,0x33, - 0x0a,0x00,0x20,0x15,0x00,0x00,0x00,0x00,0x94,0x00,0xaa,0x8f, - 0xd8,0x00,0xa5,0x8f,0x01,0x00,0xb5,0x36,0x48,0x91,0x84,0x27, - 0x21,0x90,0x00,0x00,0x29,0x2a,0x00,0x0c,0x21,0x30,0xca,0x02, - 0x29,0x00,0x00,0x10,0x01,0x00,0x4e,0x32,0x00,0x00,0x70,0x92, - 0x05,0x00,0x01,0x24,0x07,0x00,0xe1,0x12,0x7f,0x00,0x01,0x24, - 0x05,0x00,0xe1,0x12,0x0c,0x00,0x01,0x24,0x03,0x00,0xe1,0x12, - 0x0e,0x00,0x01,0x24,0x0f,0x00,0xe1,0x16,0x00,0x00,0x00,0x00, - 0x14,0x00,0x79,0x92,0x00,0x00,0x00,0x00,0x01,0x00,0x2f,0x33, - 0x0a,0x00,0xe0,0x11,0x00,0x00,0x00,0x00,0x94,0x00,0xac,0x8f, - 0xd8,0x00,0xa5,0x8f,0x01,0x00,0xb5,0x36,0x70,0x91,0x84,0x27, - 0x21,0x90,0x00,0x00,0x29,0x2a,0x00,0x0c,0x21,0x30,0xcc,0x02, - 0x11,0x00,0x00,0x10,0x01,0x00,0x4e,0x32,0x09,0x00,0x12,0x12, - 0x00,0x00,0x00,0x00,0x94,0x00,0xab,0x8f,0xd8,0x00,0xa5,0x8f, - 0x10,0x00,0xb5,0x36,0x9c,0x91,0x84,0x27,0x21,0x38,0x40,0x02, - 0x10,0x00,0xb0,0xaf,0x29,0x2a,0x00,0x0c,0x21,0x30,0xcb,0x03, - 0x01,0x00,0x52,0x26,0x00,0x01,0x41,0x2a,0x56,0xff,0x20,0x14, - 0x05,0x00,0x01,0x24,0x21,0x90,0x00,0x00,0x01,0x00,0x4e,0x32, - 0x40,0x68,0x0e,0x00,0x02,0x00,0x49,0x32,0x43,0x50,0x09,0x00, - 0x08,0x00,0xb8,0x35,0x25,0xc8,0x0a,0x03,0x10,0x00,0x99,0xa2, - 0xc1,0x2a,0x00,0x0c,0xfa,0x00,0x04,0x24,0x18,0x00,0x60,0x92, - 0x18,0x00,0x60,0x92,0x18,0x00,0x70,0x92,0x02,0x01,0x00,0x00, - 0x02,0x81,0x10,0x00,0x03,0x00,0x10,0x32,0x03,0x00,0x00,0x30, - 0x02,0x01,0x00,0x00,0x15,0x00,0x12,0x12,0x03,0x00,0x00,0x30, - 0x94,0x00,0xaf,0x8f,0xd8,0x00,0xa5,0x8f,0x20,0x00,0xb5,0x36, - 0xc8,0x91,0x84,0x27,0x10,0x00,0xb2,0xaf,0x14,0x00,0xb0,0xaf, - 0x21,0x30,0xcf,0x02,0x29,0x2a,0x00,0x0c,0x21,0x38,0xcf,0x03, - 0x26,0x88,0x12,0x02,0x01,0x00,0x2c,0x32,0x04,0x00,0x80,0x11, - 0x02,0x00,0x2b,0x32,0x29,0x2a,0x00,0x0c,0x04,0x92,0x84,0x27, - 0x02,0x00,0x2b,0x32,0x03,0x00,0x60,0x11,0x00,0x00,0x00,0x00, - 0x29,0x2a,0x00,0x0c,0x10,0x92,0x84,0x27,0x01,0x00,0x52,0x26, - 0x04,0x00,0x01,0x24,0xd7,0xff,0x41,0x16,0x01,0x00,0x4e,0x32, - 0x08,0x00,0x0e,0x24,0x10,0x00,0x8e,0xa2,0xe1,0x21,0x00,0x0c, - 0x21,0x20,0x00,0x00,0x01,0x00,0x0d,0x24,0x00,0xa3,0x09,0x3c, - 0x80,0x01,0x2d,0xad,0x70,0x00,0xb8,0x8f,0x00,0x00,0x00,0x00, - 0x00,0x00,0x04,0x8f,0xe1,0x21,0x00,0x0c,0x01,0x00,0x84,0x24, - 0xa0,0x00,0xa7,0x8f,0x01,0x00,0x0a,0x24,0x04,0x00,0x6a,0xa2, - 0x0d,0x00,0xe0,0x18,0x21,0x90,0x00,0x00,0x88,0x00,0xa5,0x8f, - 0x21,0x18,0x00,0x00,0x40,0x21,0x07,0x00,0x21,0x10,0xa3,0x00, - 0x00,0x01,0x40,0x90,0x00,0x01,0x40,0x90,0x00,0x01,0x40,0x90, - 0x20,0x00,0x63,0x24,0x08,0x01,0x40,0x90,0x2a,0x08,0x64,0x00, - 0xf9,0xff,0x20,0x14,0x21,0x10,0xa3,0x00,0xc0,0x09,0x10,0x24, - 0xfc,0xff,0x10,0x26,0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26, - 0x00,0xa3,0x19,0x3c,0x80,0x01,0x2f,0x8f,0x01,0x00,0x01,0x24, - 0x08,0x00,0xe1,0x11,0x08,0x00,0xce,0x33,0x94,0x00,0xac,0x8f, - 0xd8,0x00,0xa5,0x8f,0x40,0x00,0xb5,0x36,0x1c,0x92,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcc,0x03,0x08,0x00,0xce,0x33, - 0x88,0x00,0xab,0x8f,0x08,0x00,0xcd,0x25,0x43,0x48,0x0d,0x00, - 0x21,0x88,0x69,0x01,0x00,0x00,0x39,0x92,0x07,0x00,0xd8,0x33, - 0x01,0x00,0x0a,0x24,0x04,0x90,0x0a,0x03,0x24,0x78,0x32,0x03, - 0x08,0x00,0xe0,0x11,0x2a,0x00,0x0e,0x24,0x94,0x00,0xac,0x8f, - 0xd8,0x00,0xa5,0x8f,0x40,0x00,0xb5,0x36,0x3c,0x92,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcc,0x03,0x2a,0x00,0x0e,0x24, - 0x00,0x00,0x8e,0xa2,0xc3,0x09,0x10,0x24,0x00,0xa3,0x0d,0x3c, - 0x80,0x01,0xab,0x8d,0x00,0x00,0x00,0x00,0x04,0x00,0x60,0x11, - 0x00,0x00,0x00,0x00,0xff,0xff,0x10,0x26,0xfa,0xff,0x00,0x16, - 0x00,0xa3,0x0d,0x3c,0xc0,0x09,0x10,0x24,0xfc,0xff,0x10,0x26, - 0xff,0xff,0x00,0x16,0xfc,0xff,0x10,0x26,0x00,0x00,0x29,0x92, - 0x00,0x00,0x00,0x00,0x24,0x50,0x32,0x01,0x07,0x00,0x40,0x15, - 0x00,0x00,0x00,0x00,0x94,0x00,0xb8,0x8f,0xd8,0x00,0xa5,0x8f, - 0x40,0x00,0xb5,0x36,0x6c,0x92,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x30,0xd8,0x03,0x00,0x00,0x60,0x92,0x08,0x00,0x60,0x92, - 0x00,0xa3,0x19,0x3c,0x80,0x01,0x2f,0x8f,0x00,0x00,0x00,0x00, - 0x07,0x00,0xe0,0x11,0x00,0x00,0x00,0x00,0x94,0x00,0xac,0x8f, - 0xd8,0x00,0xa5,0x8f,0x80,0x00,0xb5,0x36,0x9c,0x92,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcc,0x03,0xe1,0x21,0x00,0x0c, - 0x21,0x20,0x00,0x00,0x01,0x00,0x0e,0x24,0x00,0xa3,0x0d,0x3c, - 0x80,0x01,0xae,0xad,0x70,0x00,0xab,0x8f,0x00,0x00,0x00,0x00, - 0x00,0x00,0x64,0x8d,0xe1,0x21,0x00,0x0c,0x01,0x00,0x84,0x24, - 0xc0,0x09,0x10,0x24,0xfc,0xff,0x10,0x26,0xff,0xff,0x00,0x16, - 0xfc,0xff,0x10,0x26,0x00,0xa3,0x09,0x3c,0x80,0x01,0x2a,0x8d, - 0x01,0x00,0x01,0x24,0x07,0x00,0x41,0x11,0x00,0x00,0x00,0x00, - 0x94,0x00,0xb8,0x8f,0xd8,0x00,0xa5,0x8f,0x00,0x01,0xb5,0x36, - 0xc4,0x92,0x84,0x27,0x29,0x2a,0x00,0x0c,0x21,0x30,0xd8,0x03, - 0x00,0x00,0x39,0x92,0x00,0x00,0x00,0x00,0x24,0x78,0x32,0x03, - 0x07,0x00,0xe0,0x11,0x00,0x00,0x00,0x00,0x94,0x00,0xac,0x8f, - 0xd8,0x00,0xa5,0x8f,0x40,0x00,0xb5,0x36,0xec,0x92,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0xcc,0x03,0xe1,0x21,0x00,0x0c, - 0x21,0x20,0x00,0x00,0xdc,0x00,0xa3,0x8f,0xe0,0x00,0xa6,0x8f, - 0x04,0x00,0x10,0x24,0xa8,0x00,0xae,0x8f,0x01,0x00,0xd6,0x26, - 0x2a,0x08,0xce,0x02,0x49,0xfe,0x20,0x14,0x00,0x00,0x00,0x00, - 0x54,0x00,0xb1,0x8f,0x50,0x00,0xb2,0x8f,0x60,0x00,0xb4,0x8f, - 0x58,0x00,0xbe,0x8f,0x00,0x00,0x00,0x00,0xbc,0x00,0xad,0x8f, - 0x00,0x00,0x00,0x00,0x25,0x58,0xb5,0x01,0x3a,0x00,0x60,0x15, - 0xbc,0x00,0xab,0xaf,0x03,0x00,0x61,0x04,0x50,0x00,0xb2,0xaf, - 0x19,0x00,0x00,0x10,0x01,0x00,0x12,0x24,0xac,0x00,0xa9,0x8f, - 0xa8,0x00,0xaa,0x8f,0x21,0x90,0x00,0x00,0x2a,0x08,0x2a,0x01, - 0x13,0x00,0x20,0x10,0x21,0xb0,0x20,0x01,0xd8,0x00,0xb8,0x8f, - 0x54,0x00,0xb1,0xaf,0x40,0xc9,0x18,0x00,0x21,0x78,0xd9,0x00, - 0x40,0x60,0x16,0x00,0x21,0x88,0xec,0x01,0x00,0x00,0x2e,0x86, - 0xff,0xff,0x01,0x24,0x03,0x00,0xc1,0x11,0xa8,0x00,0xad,0x8f, - 0x01,0x00,0x52,0x26,0xa8,0x00,0xad,0x8f,0x01,0x00,0xd6,0x26, - 0x2a,0x08,0xcd,0x02,0xf7,0xff,0x20,0x14,0x02,0x00,0x31,0x26, - 0x54,0x00,0xb1,0x8f,0x00,0x00,0x00,0x00,0x1a,0x00,0x40,0x12, - 0x00,0x00,0x00,0x00,0x1c,0x93,0x84,0x27,0x29,0x2a,0x00,0x0c, - 0x21,0x28,0x40,0x02,0x9c,0x00,0xab,0x8f,0x01,0x00,0x01,0x24, - 0x11,0x00,0x61,0x15,0x00,0x00,0x00,0x00,0xe0,0x00,0xa9,0x8f, - 0x00,0x00,0x00,0x00,0x0d,0x00,0x20,0x11,0x00,0x00,0x00,0x00, - 0xd8,0x00,0xaa,0x8f,0xa0,0x00,0xaf,0x8f,0x40,0xc1,0x0a,0x00, - 0x21,0xc8,0x38,0x01,0x40,0x60,0x0f,0x00,0x21,0x70,0x2c,0x03, - 0x00,0x00,0xcd,0x85,0xff,0xff,0x01,0x24,0x03,0x00,0xa1,0x11, - 0x00,0x00,0x00,0x00,0x29,0x2a,0x00,0x0c,0x28,0x93,0x84,0x27, - 0x65,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00,0x50,0x00,0xb2,0x8f, - 0x00,0x00,0x00,0x00,0x5c,0x00,0xb5,0x8f,0x5a,0x00,0x00,0x10, - 0x00,0x00,0x00,0x00,0x58,0x00,0xe0,0x14,0x00,0x00,0x00,0x00, - 0xe8,0x00,0xab,0x8f,0x00,0x00,0x00,0x00,0x03,0x00,0x60,0x11, - 0x00,0x00,0x00,0x00,0xad,0x2a,0x00,0x0c,0x00,0x00,0x00,0x00, - 0xd8,0x00,0xa5,0x8f,0x29,0x2a,0x00,0x0c,0x34,0x93,0x84,0x27, - 0x4d,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x4b,0x00,0xe0,0x14, - 0x00,0x00,0x00,0x00,0xe8,0x00,0xaa,0x8f,0x00,0x00,0x00,0x00, - 0x03,0x00,0x40,0x11,0x00,0x00,0x00,0x00,0xad,0x2a,0x00,0x0c, - 0x00,0x00,0x00,0x00,0xd8,0x00,0xa5,0x8f,0x50,0x93,0x84,0x27, - 0x29,0x2a,0x00,0x0c,0x21,0x30,0x60,0x02,0x3f,0x00,0x00,0x10, - 0x00,0x00,0x00,0x00,0x04,0x00,0x43,0x14,0x09,0x00,0x41,0x28, - 0x2d,0xf9,0x00,0x10,0x02,0x00,0x10,0x24,0x09,0x00,0x41,0x28, - 0x23,0x00,0x20,0x10,0x04,0x00,0x01,0x24,0x1b,0xf8,0x41,0x10, - 0x05,0x00,0x41,0x28,0x10,0x00,0x20,0x10,0x06,0x00,0x01,0x24, - 0x02,0x00,0x10,0x24,0x23,0xf9,0x50,0x10,0x03,0x00,0x41,0x28, - 0x05,0x00,0x20,0x10,0x01,0x00,0x01,0x24,0x20,0xf9,0x41,0x10, - 0xe8,0x00,0xad,0x8f,0xdf,0xff,0x00,0x10,0x00,0x00,0x00,0x00, - 0x03,0x00,0x01,0x24,0x1b,0xf9,0x41,0x10,0xe8,0x00,0xad,0x8f, - 0xda,0xff,0x00,0x10,0x00,0x00,0x00,0x00,0x06,0x00,0x01,0x24, - 0x04,0x00,0x41,0x14,0x07,0x00,0x41,0x28,0x13,0xf9,0x00,0x10, - 0x02,0x00,0x10,0x24,0x07,0x00,0x41,0x28,0x05,0x00,0x20,0x10, - 0x05,0x00,0x01,0x24,0xd0,0xff,0x41,0x14,0x00,0x00,0x00,0x00, - 0x0c,0xf9,0x00,0x10,0x02,0x00,0x10,0x24,0xcc,0xff,0x44,0x14, - 0x00,0x00,0x00,0x00,0x08,0xf9,0x00,0x10,0x02,0x00,0x10,0x24, - 0x3f,0x00,0x01,0x24,0xba,0xff,0x41,0x10,0x40,0x00,0x41,0x28, - 0x0c,0x00,0x20,0x10,0x0e,0x00,0x01,0x24,0x04,0x00,0x41,0x14, - 0x0f,0x00,0x41,0x28,0xff,0xf8,0x00,0x10,0x02,0x00,0x10,0x24, - 0x0f,0x00,0x41,0x28,0xbe,0xff,0x20,0x10,0x0c,0x00,0x01,0x24, - 0xee,0xf7,0x41,0x10,0xdc,0x00,0xad,0x8f,0xba,0xff,0x00,0x10, - 0x00,0x00,0x00,0x00,0x7f,0x00,0x01,0x24,0xb7,0xff,0x41,0x14, - 0x00,0x00,0x00,0x00,0xf3,0xf8,0x00,0x10,0x02,0x00,0x10,0x24, - 0xe1,0x21,0x00,0x0c,0x01,0x04,0x04,0x24,0x4c,0x00,0xbf,0x8f, - 0xbc,0x00,0xa2,0x8f,0x3c,0x00,0xb0,0x8f,0x40,0x00,0xb3,0x8f, - 0x44,0x00,0xb6,0x8f,0x48,0x00,0xb7,0x8f,0x08,0x00,0xe0,0x03, - 0xd8,0x00,0xbd,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xc8,0xff,0xbd,0x27,0x30,0x00,0xb6,0xaf,0x28,0x00,0xb4,0xaf, - 0x2c,0x00,0xb5,0xaf,0x24,0x00,0xb3,0xaf,0x18,0x00,0xb0,0xaf, - 0x1c,0x00,0xb1,0xaf,0x34,0x00,0xbf,0xaf,0x20,0x00,0xb2,0xaf, - 0x04,0x00,0x11,0x24,0x00,0xa1,0x10,0x3c,0x90,0x93,0x93,0x27, - 0x21,0xa8,0x00,0x00,0xcc,0x93,0x94,0x27,0x0f,0x00,0x16,0x24, - 0x21,0x90,0x00,0x00,0xcc,0x97,0x80,0xaf,0x21,0x18,0x00,0x00, - 0x21,0x10,0x60,0x02,0x00,0x00,0x4f,0x94,0x02,0x00,0x4e,0x94, - 0x21,0xc0,0xf0,0x01,0x00,0x00,0x0e,0xa3,0xcc,0x97,0x80,0xaf, - 0x04,0x00,0x48,0x94,0x06,0x00,0x59,0x94,0x21,0x48,0x10,0x01, - 0x00,0x00,0x39,0xa1,0xcc,0x97,0x80,0xaf,0x08,0x00,0x4b,0x94, - 0x0a,0x00,0x4a,0x94,0x21,0x60,0x70,0x01,0x00,0x00,0x8a,0xa1, - 0xcc,0x97,0x80,0xaf,0x0c,0x00,0x4f,0x94,0x0e,0x00,0x4d,0x94, - 0x04,0x00,0x42,0x24,0x04,0x00,0x42,0x24,0x21,0x70,0xf0,0x01, - 0x04,0x00,0x42,0x24,0x04,0x00,0x63,0x24,0x00,0x00,0xcd,0xa1, - 0xcc,0x97,0x80,0xaf,0xe7,0xff,0x71,0x14,0x04,0x00,0x42,0x24, - 0x00,0x00,0x58,0x94,0x00,0x00,0x00,0x00,0x21,0x40,0x18,0x02, - 0x00,0x00,0x19,0x91,0x00,0x00,0x00,0x00,0x40,0x00,0x29,0x33, - 0x08,0x00,0x20,0x11,0x64,0x00,0x41,0x2a,0x04,0x00,0x20,0x14, - 0x00,0x00,0x00,0x00,0x21,0x20,0x80,0x02,0x35,0x20,0x00,0x0c, - 0x47,0x00,0x05,0x24,0xd5,0xff,0x00,0x10,0x01,0x00,0x52,0x26, - 0x05,0x00,0xb5,0x26,0xd1,0xff,0xb6,0x16,0x14,0x00,0x73,0x26, - 0x34,0x00,0xbf,0x8f,0x18,0x00,0xb0,0x8f,0x1c,0x00,0xb1,0x8f, - 0x20,0x00,0xb2,0x8f,0x24,0x00,0xb3,0x8f,0x28,0x00,0xb4,0x8f, - 0x2c,0x00,0xb5,0x8f,0x30,0x00,0xb6,0x8f,0x08,0x00,0xe0,0x03, - 0x38,0x00,0xbd,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x42,0x54,0x34,0x30,0x42,0x54,0x34,0x31, - 0x42,0x54,0x34,0x32,0x42,0x54,0x34,0x33,0x0a,0x0d,0x44,0x69, - 0x67,0x69,0x42,0x6f,0x61,0x72,0x64,0x20,0x53,0x6d,0x61,0x72, - 0x74,0x43,0x6f,0x6d,0x6d,0x20,0x42,0x49,0x4f,0x53,0x00,0x00, - 0x0a,0x0d,0x52,0x41,0x4d,0x20,0x73,0x69,0x7a,0x65,0x3a,0x20, - 0x25,0x30,0x38,0x78,0x00,0x00,0x00,0x00,0x0a,0x0d,0x43,0x50, - 0x55,0x20,0x74,0x65,0x73,0x74,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e, - 0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x00,0x00,0x0a,0x0d,0x63,0x6f, - 0x64,0x65,0x20,0x63,0x68,0x65,0x63,0x6b,0x73,0x75,0x6d,0x20, - 0x74,0x65,0x73,0x74,0x2e,0x2e,0x00,0x00,0x25,0x45,0x20,0x62, - 0x61,0x64,0x20,0x63,0x6f,0x64,0x65,0x20,0x63,0x68,0x65,0x63, - 0x6b,0x73,0x75,0x6d,0x3a,0x20,0x25,0x30,0x38,0x78,0x00,0x00, - 0x0d,0x0a,0x00,0x00,0x53,0x69,0x6d,0x70,0x6c,0x65,0x0a,0x0d, - 0x00,0x00,0x00,0x00,0x48,0x69,0x67,0x68,0x0a,0x0d,0x00,0x00, - 0x43,0x6f,0x6d,0x70,0x6c,0x65,0x78,0x0a,0x0d,0x00,0x00,0x00, - 0x25,0x45,0x20,0x47,0x61,0x70,0x20,0x69,0x6e,0x20,0x45,0x42, - 0x49,0x20,0x73,0x65,0x71,0x75,0x65,0x6e,0x63,0x65,0x0a,0x0d, - 0x00,0x00,0x00,0x00,0x2e,0x2e,0x2f,0x73,0x6d,0x61,0x72,0x74, - 0x62,0x69,0x6f,0x73,0x2e,0x63,0x00,0x00,0x2e,0x2e,0x2f,0x73, - 0x6d,0x61,0x72,0x74,0x62,0x69,0x6f,0x73,0x2e,0x63,0x00,0x00, - 0x90,0xde,0x00,0xa0,0x0d,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x50,0x61,0x73,0x73,0x20,0x25,0x64,0x20, - 0x20,0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x2d,0x2d,0x2d,0x20, - 0x53,0x6d,0x61,0x72,0x74,0x43,0x6f,0x6d,0x6d,0x20,0x44,0x69, - 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x73,0x20,0x2d,0x2d, - 0x2d,0x0a,0x0d,0x00,0x41,0x20,0x3d,0x20,0x41,0x6c,0x6c,0x20, - 0x74,0x65,0x73,0x74,0x73,0x0a,0x0d,0x00,0x45,0x20,0x3d,0x20, - 0x41,0x6c,0x6c,0x20,0x45,0x42,0x49,0x20,0x74,0x65,0x73,0x74, - 0x73,0x0a,0x0d,0x00,0x31,0x20,0x3d,0x20,0x54,0x69,0x6d,0x65, - 0x72,0x20,0x74,0x65,0x73,0x74,0x0a,0x0d,0x00,0x00,0x00,0x00, - 0x32,0x20,0x3d,0x20,0x52,0x41,0x4d,0x20,0x74,0x65,0x73,0x74, - 0x0a,0x0d,0x00,0x00,0x33,0x20,0x3d,0x20,0x45,0x42,0x49,0x20, - 0x69,0x6e,0x74,0x65,0x72,0x6e,0x61,0x6c,0x20,0x6c,0x6f,0x6f, - 0x70,0x62,0x61,0x63,0x6b,0x20,0x74,0x65,0x73,0x74,0x0a,0x0d, - 0x00,0x00,0x00,0x00,0x34,0x20,0x3d,0x20,0x45,0x42,0x49,0x20, - 0x65,0x78,0x74,0x65,0x72,0x6e,0x61,0x6c,0x20,0x6c,0x6f,0x6f, - 0x70,0x62,0x61,0x63,0x6b,0x20,0x74,0x65,0x73,0x74,0x0a,0x0d, - 0x00,0x00,0x00,0x00,0x24,0x20,0x3d,0x20,0x45,0x42,0x49,0x20, - 0x73,0x69,0x6e,0x67,0x6c,0x65,0x20,0x65,0x78,0x74,0x65,0x72, - 0x6e,0x61,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20,0x74,0x65,0x73, - 0x74,0x0a,0x0d,0x00,0x35,0x20,0x3d,0x20,0x53,0x70,0x65,0x63, - 0x69,0x61,0x6c,0x20,0x50,0x41,0x4c,0x20,0x74,0x65,0x73,0x74, - 0x0a,0x0d,0x00,0x00,0x74,0x2f,0x5e,0x54,0x2f,0x54,0x20,0x3d, - 0x20,0x48,0x6f,0x73,0x74,0x20,0x73,0x69,0x64,0x65,0x20,0x20, - 0x38,0x2f,0x31,0x36,0x2f,0x33,0x32,0x2d,0x62,0x69,0x74,0x20, - 0x52,0x41,0x4d,0x20,0x74,0x65,0x73,0x74,0x20,0x73,0x74,0x61, - 0x72,0x74,0x2f,0x73,0x74,0x6f,0x70,0x0a,0x0d,0x00,0x00,0x00, - 0x69,0x20,0x3d,0x20,0x63,0x61,0x72,0x64,0x2d,0x74,0x6f,0x2d, - 0x68,0x6f,0x73,0x74,0x20,0x69,0x6e,0x74,0x65,0x72,0x72,0x75, - 0x70,0x74,0x20,0x74,0x65,0x73,0x74,0x0a,0x0d,0x00,0x00,0x00, - 0x64,0x5e,0x44,0x44,0x29,0x75,0x6d,0x70,0x2c,0x20,0x72,0x5e, - 0x52,0x52,0x29,0x65,0x61,0x64,0x2c,0x20,0x77,0x5e,0x57,0x57, - 0x29,0x72,0x69,0x74,0x65,0x2c,0x20,0x66,0x5e,0x46,0x46,0x29, - 0x69,0x6c,0x6c,0x20,0x52,0x41,0x4d,0x0a,0x0d,0x00,0x00,0x00, - 0x0d,0x0a,0x4e,0x75,0x6d,0x62,0x65,0x72,0x20,0x6f,0x66,0x20, - 0x74,0x69,0x6d,0x65,0x73,0x20,0x74,0x6f,0x20,0x64,0x6f,0x20, - 0x61,0x6c,0x6c,0x20,0x74,0x65,0x73,0x74,0x73,0x3a,0x20,0x00, - 0x0a,0x00,0x00,0x00,0x0a,0x0d,0x20,0x20,0x54,0x65,0x73,0x74, - 0x73,0x20,0x73,0x74,0x6f,0x70,0x70,0x65,0x64,0x0a,0x0d,0x00, - 0x54,0x6f,0x74,0x61,0x6c,0x20,0x70,0x61,0x73,0x73,0x65,0x73, - 0x3a,0x20,0x25,0x64,0x0a,0x0d,0x00,0x00,0x20,0x20,0x54,0x65, - 0x73,0x74,0x20,0x25,0x64,0x3a,0x20,0x25,0x64,0x20,0x70,0x61, - 0x73,0x73,0x20,0x25,0x64,0x20,0x66,0x61,0x69,0x6c,0x75,0x72, - 0x65,0x73,0x0a,0x0d,0x00,0x00,0x00,0x00,0x20,0x20,0x28,0x70, - 0x72,0x65,0x73,0x73,0x20,0x61,0x6e,0x79,0x20,0x6b,0x65,0x79, - 0x20,0x74,0x6f,0x20,0x73,0x74,0x6f,0x70,0x29,0x0a,0x00,0x00, - 0x0a,0x0d,0x20,0x20,0x54,0x69,0x6d,0x65,0x72,0x20,0x74,0x65, - 0x73,0x74,0x20,0x73,0x74,0x6f,0x70,0x70,0x65,0x64,0x0a,0x0d, - 0x00,0x00,0x00,0x00,0x54,0x6f,0x74,0x61,0x6c,0x20,0x70,0x61, - 0x73,0x73,0x65,0x73,0x3a,0x20,0x25,0x64,0x0a,0x0d,0x00,0x00, - 0x20,0x20,0x54,0x65,0x73,0x74,0x20,0x31,0x3a,0x20,0x25,0x64, - 0x20,0x70,0x61,0x73,0x73,0x20,0x25,0x64,0x20,0x66,0x61,0x69, - 0x6c,0x75,0x72,0x65,0x73,0x0a,0x0d,0x00,0x53,0x74,0x61,0x72, - 0x74,0x20,0x41,0x64,0x64,0x72,0x65,0x73,0x73,0x3a,0x20,0x00, - 0x0a,0x0d,0x45,0x6e,0x64,0x20,0x41,0x64,0x64,0x72,0x65,0x73, - 0x73,0x3a,0x20,0x00,0x0a,0x0d,0x00,0x00,0x20,0x20,0x28,0x70, - 0x72,0x65,0x73,0x73,0x20,0x61,0x6e,0x79,0x20,0x6b,0x65,0x79, - 0x20,0x74,0x6f,0x20,0x73,0x74,0x6f,0x70,0x29,0x0a,0x00,0x00, - 0x0a,0x0d,0x20,0x20,0x52,0x41,0x4d,0x20,0x74,0x65,0x73,0x74, - 0x20,0x73,0x74,0x6f,0x70,0x70,0x65,0x64,0x0a,0x0d,0x00,0x00, - 0x54,0x6f,0x74,0x61,0x6c,0x20,0x70,0x61,0x73,0x73,0x65,0x73, - 0x3a,0x20,0x25,0x64,0x0a,0x0d,0x00,0x00,0x20,0x20,0x54,0x65, - 0x73,0x74,0x20,0x32,0x3a,0x20,0x25,0x64,0x20,0x70,0x61,0x73, - 0x73,0x20,0x25,0x64,0x20,0x66,0x61,0x69,0x6c,0x75,0x72,0x65, - 0x73,0x0a,0x0d,0x00,0x20,0x20,0x45,0x42,0x49,0x20,0x73,0x69, - 0x6e,0x67,0x6c,0x65,0x20,0x65,0x78,0x74,0x65,0x72,0x6e,0x61, - 0x6c,0x20,0x6c,0x6f,0x6f,0x70,0x62,0x61,0x63,0x6b,0x20,0x74, - 0x65,0x73,0x74,0x0a,0x0d,0x00,0x00,0x00,0x20,0x20,0x45,0x6e, - 0x74,0x65,0x72,0x20,0x45,0x42,0x49,0x20,0x6e,0x75,0x6d,0x62, - 0x65,0x72,0x20,0x74,0x6f,0x20,0x74,0x65,0x73,0x74,0x20,0x28, - 0x30,0x2d,0x33,0x29,0x20,0x00,0x00,0x00,0x0a,0x0d,0x00,0x00, - 0x20,0x20,0x45,0x6e,0x74,0x65,0x72,0x20,0x70,0x6f,0x72,0x74, - 0x20,0x74,0x6f,0x20,0x74,0x65,0x73,0x74,0x20,0x28,0x31,0x2d, - 0x31,0x36,0x29,0x20,0x00,0x00,0x00,0x00,0x0a,0x0d,0x20,0x20, - 0x28,0x70,0x72,0x65,0x73,0x73,0x20,0x61,0x6e,0x79,0x20,0x6b, - 0x65,0x79,0x20,0x74,0x6f,0x20,0x73,0x74,0x6f,0x70,0x29,0x0a, - 0x00,0x00,0x00,0x00,0x0a,0x0d,0x20,0x20,0x45,0x42,0x49,0x20, - 0x74,0x65,0x73,0x74,0x20,0x73,0x74,0x6f,0x70,0x70,0x65,0x64, - 0x0a,0x0d,0x00,0x00,0x54,0x6f,0x74,0x61,0x6c,0x20,0x70,0x61, - 0x73,0x73,0x65,0x73,0x3a,0x20,0x25,0x64,0x0a,0x0d,0x00,0x00, - 0x20,0x20,0x54,0x65,0x73,0x74,0x20,0x25,0x63,0x3a,0x20,0x25, - 0x64,0x20,0x70,0x61,0x73,0x73,0x20,0x25,0x64,0x20,0x66,0x61, - 0x69,0x6c,0x75,0x72,0x65,0x73,0x0a,0x0d,0x00,0x00,0x00,0x00, - 0x20,0x20,0x45,0x42,0x49,0x20,0x00,0x00,0x65,0x78,0x00,0x00, - 0x69,0x6e,0x00,0x00,0x74,0x65,0x72,0x6e,0x61,0x6c,0x20,0x6c, - 0x6f,0x6f,0x70,0x62,0x61,0x63,0x6b,0x20,0x74,0x65,0x73,0x74, - 0x0a,0x0d,0x00,0x00,0x20,0x20,0x45,0x6e,0x74,0x65,0x72,0x20, - 0x45,0x42,0x49,0x20,0x6e,0x75,0x6d,0x62,0x65,0x72,0x20,0x74, - 0x6f,0x20,0x74,0x65,0x73,0x74,0x20,0x28,0x30,0x2d,0x33,0x29, - 0x20,0x6f,0x72,0x20,0x27,0x41,0x27,0x20,0x66,0x6f,0x72,0x20, - 0x61,0x6c,0x6c,0x0a,0x0d,0x00,0x00,0x00,0x20,0x20,0x28,0x70, - 0x72,0x65,0x73,0x73,0x20,0x61,0x6e,0x79,0x20,0x6b,0x65,0x79, - 0x20,0x74,0x6f,0x20,0x73,0x74,0x6f,0x70,0x29,0x0a,0x00,0x00, - 0x0a,0x0d,0x20,0x20,0x45,0x42,0x49,0x20,0x74,0x65,0x73,0x74, - 0x20,0x73,0x74,0x6f,0x70,0x70,0x65,0x64,0x0a,0x0d,0x00,0x00, - 0x54,0x6f,0x74,0x61,0x6c,0x20,0x70,0x61,0x73,0x73,0x65,0x73, - 0x3a,0x20,0x25,0x64,0x0a,0x0d,0x00,0x00,0x20,0x20,0x54,0x65, - 0x73,0x74,0x20,0x25,0x63,0x3a,0x20,0x25,0x64,0x20,0x70,0x61, - 0x73,0x73,0x20,0x25,0x64,0x20,0x66,0x61,0x69,0x6c,0x75,0x72, - 0x65,0x73,0x0a,0x0d,0x00,0x00,0x00,0x00,0x20,0x20,0x28,0x70, - 0x72,0x65,0x73,0x73,0x20,0x61,0x6e,0x79,0x20,0x6b,0x65,0x79, - 0x20,0x74,0x6f,0x20,0x73,0x74,0x6f,0x70,0x29,0x0a,0x00,0x00, - 0x0d,0x50,0x41,0x4c,0x20,0x74,0x65,0x73,0x74,0x2e,0x2e,0x2e, - 0x2e,0x2e,0x00,0x00,0x0a,0x0d,0x46,0x41,0x49,0x4c,0x45,0x44, - 0x20,0x2d,0x20,0x74,0x65,0x6c,0x6c,0x20,0x54,0x4a,0x20,0x43, - 0x61,0x72,0x74,0x65,0x72,0x20,0x61,0x74,0x20,0x39,0x34,0x33, - 0x2d,0x35,0x33,0x36,0x31,0x0a,0x0d,0x00,0x0a,0x0d,0x20,0x20, - 0x50,0x41,0x4c,0x20,0x74,0x65,0x73,0x74,0x20,0x73,0x74,0x6f, - 0x70,0x70,0x65,0x64,0x0a,0x0d,0x00,0x00,0x54,0x6f,0x74,0x61, - 0x6c,0x20,0x70,0x61,0x73,0x73,0x65,0x73,0x3a,0x20,0x25,0x64, - 0x0a,0x0d,0x00,0x00,0x20,0x20,0x54,0x65,0x73,0x74,0x20,0x35, - 0x3a,0x20,0x25,0x64,0x20,0x70,0x61,0x73,0x73,0x20,0x25,0x64, - 0x20,0x66,0x61,0x69,0x6c,0x75,0x72,0x65,0x73,0x0a,0x0d,0x00, - 0x43,0x61,0x72,0x64,0x2d,0x74,0x6f,0x2d,0x68,0x6f,0x73,0x74, - 0x20,0x69,0x6e,0x74,0x65,0x72,0x72,0x75,0x70,0x74,0x20,0x74, - 0x65,0x73,0x74,0x2e,0x2e,0x2e,0x00,0x00,0x48,0x65,0x78,0x20, - 0x41,0x64,0x64,0x72,0x65,0x73,0x73,0x3a,0x20,0x00,0x00,0x00, - 0x0a,0x0d,0x00,0x00,0x25,0x30,0x38,0x78,0x3a,0x20,0x00,0x00, - 0x0a,0x0d,0x00,0x00,0x25,0x30,0x32,0x78,0x0a,0x0d,0x00,0x00, - 0x25,0x30,0x34,0x78,0x0a,0x0d,0x00,0x00,0x25,0x30,0x38,0x78, - 0x0a,0x0d,0x00,0x00,0x38,0x00,0x00,0x00,0x31,0x36,0x00,0x00, - 0x33,0x32,0x00,0x00,0x2d,0x62,0x69,0x74,0x20,0x48,0x65,0x78, - 0x20,0x56,0x61,0x6c,0x75,0x65,0x3a,0x20,0x00,0x00,0x00,0x00, - 0x0a,0x0d,0x00,0x00,0x48,0x65,0x78,0x20,0x4c,0x65,0x6e,0x67, - 0x74,0x68,0x3a,0x20,0x00,0x00,0x00,0x00,0x0a,0x0d,0x00,0x00, - 0x50,0x72,0x65,0x73,0x73,0x20,0x27,0x3f,0x27,0x20,0x66,0x6f, - 0x72,0x20,0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63, - 0x73,0x20,0x6d,0x65,0x6e,0x75,0x0a,0x0d,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0xe8,0x03,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x41,0x42, - 0x43,0x44,0x45,0x46,0x00,0x00,0x00,0x00,0x0a,0x0d,0x45,0x52, - 0x52,0x4f,0x52,0x20,0x2d,0x00,0x00,0x00,0x30,0x78,0x00,0x00, - 0x70,0x61,0x73,0x73,0x65,0x64,0x00,0x00,0x25,0x30,0x32,0x58, - 0x20,0x00,0x00,0x00,0x0d,0x54,0x69,0x6d,0x65,0x72,0x20,0x74, - 0x65,0x73,0x74,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e, - 0x2e,0x00,0x00,0x00,0x25,0x45,0x20,0x63,0x61,0x6e,0x27,0x74, - 0x20,0x73,0x65,0x74,0x20,0x75,0x70,0x20,0x74,0x69,0x6d,0x65, - 0x72,0x20,0x30,0x0a,0x0d,0x00,0x00,0x00,0x25,0x45,0x20,0x63, - 0x61,0x6e,0x27,0x74,0x20,0x73,0x65,0x74,0x20,0x75,0x70,0x20, - 0x74,0x69,0x6d,0x65,0x72,0x20,0x32,0x0a,0x0d,0x00,0x00,0x00, - 0x25,0x45,0x20,0x74,0x69,0x6d,0x65,0x72,0x20,0x32,0x20,0x62, - 0x61,0x64,0x20,0x63,0x6f,0x75,0x6e,0x74,0x0a,0x0d,0x00,0x00, - 0x25,0x45,0x20,0x74,0x69,0x6d,0x65,0x72,0x20,0x30,0x20,0x49, - 0x4e,0x54,0x20,0x73,0x74,0x75,0x63,0x6b,0x20,0x6f,0x6e,0x0a, - 0x0d,0x00,0x00,0x00,0x25,0x45,0x20,0x74,0x69,0x6d,0x65,0x72, - 0x20,0x30,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x69,0x6e,0x74,0x65,0x72,0x72,0x75,0x70,0x74,0x0a,0x0d,0x00, - 0x25,0x45,0x20,0x63,0x61,0x6e,0x27,0x74,0x20,0x73,0x65,0x74, - 0x20,0x75,0x70,0x20,0x74,0x69,0x6d,0x65,0x72,0x20,0x30,0x0a, - 0x0d,0x00,0x00,0x00,0x25,0x45,0x20,0x74,0x69,0x6d,0x65,0x72, - 0x20,0x30,0x20,0x49,0x4e,0x54,0x20,0x77,0x6f,0x6e,0x27,0x74, - 0x20,0x67,0x6f,0x20,0x61,0x77,0x61,0x79,0x0a,0x0d,0x00,0x00, - 0x25,0x45,0x20,0x63,0x61,0x6e,0x27,0x74,0x20,0x73,0x65,0x74, - 0x20,0x75,0x70,0x20,0x74,0x69,0x6d,0x65,0x72,0x20,0x30,0x0a, - 0x0d,0x00,0x00,0x00,0x25,0x45,0x20,0x63,0x61,0x6e,0x27,0x74, - 0x20,0x73,0x65,0x74,0x20,0x75,0x70,0x20,0x74,0x69,0x6d,0x65, - 0x72,0x20,0x32,0x0a,0x0d,0x00,0x00,0x00,0x24,0xe6,0x00,0xa0, - 0x25,0x45,0x20,0x54,0x25,0x64,0x20,0x77,0x72,0x6f,0x74,0x65, - 0x20,0x25,0x30,0x38,0x78,0x20,0x72,0x65,0x61,0x64,0x20,0x25, - 0x30,0x38,0x78,0x20,0x61,0x74,0x20,0x25,0x30,0x38,0x78,0x0a, - 0x0d,0x00,0x00,0x00,0x0d,0x52,0x41,0x4d,0x20,0x74,0x65,0x73, - 0x74,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e, - 0x2e,0x25,0x30,0x38,0x78,0x2d,0x25,0x30,0x38,0x78,0x20,0x00, - 0x00,0x10,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x40,0x00,0x00, - 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x01,0x02, - 0x04,0x08,0x10,0x20,0x40,0x80,0x7f,0xbf,0xdf,0xef,0xf7,0xfb, - 0xfd,0xfe,0x55,0xaa,0xf0,0x0f,0x00,0x00,0x0d,0x54,0x65,0x73, - 0x74,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x50,0x41,0x52, - 0x41,0x2d,0x25,0x30,0x32,0x58,0x2e,0x2e,0x00,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61, - 0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20, - 0x54,0x50,0x52,0x20,0x77,0x72,0x6f,0x74,0x65,0x20,0x30,0x78, - 0x30,0x30,0x20,0x30,0x78,0x46,0x46,0x20,0x72,0x65,0x61,0x64, - 0x20,0x25,0x30,0x32,0x78,0x20,0x25,0x30,0x32,0x78,0x0a,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61, - 0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20, - 0x73,0x65,0x6e,0x64,0x20,0x25,0x30,0x32,0x78,0x20,0x72,0x65, - 0x63,0x65,0x69,0x76,0x65,0x64,0x20,0x25,0x30,0x32,0x78,0x0a, - 0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x61,0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x70, - 0x6f,0x72,0x74,0x20,0x69,0x6e,0x74,0x65,0x72,0x72,0x75,0x70, - 0x74,0x20,0x73,0x74,0x75,0x63,0x6b,0x20,0x6f,0x6e,0x0a,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61, - 0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20, - 0x69,0x6e,0x74,0x65,0x72,0x72,0x75,0x70,0x74,0x20,0x6d,0x61, - 0x73,0x6b,0x20,0x6f,0x6e,0x20,0x77,0x2f,0x6f,0x20,0x69,0x6e, - 0x74,0x65,0x72,0x72,0x75,0x70,0x74,0x0a,0x00,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61, - 0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20, - 0x69,0x6e,0x74,0x65,0x72,0x72,0x75,0x70,0x74,0x20,0x6d,0x61, - 0x73,0x6b,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x73,0x65,0x74,0x20,0x62,0x69,0x74,0x0a,0x00,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61, - 0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20, - 0x69,0x6e,0x74,0x65,0x72,0x72,0x75,0x70,0x74,0x20,0x64,0x6f, - 0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x77,0x6f,0x72,0x6b,0x0a, - 0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x61,0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x70, - 0x6f,0x72,0x74,0x20,0x69,0x6e,0x74,0x65,0x72,0x72,0x75,0x70, - 0x74,0x20,0x77,0x6f,0x6e,0x27,0x74,0x20,0x67,0x6f,0x20,0x61, - 0x77,0x61,0x79,0x0a,0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61,0x72,0x61,0x6c,0x6c, - 0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20,0x69,0x6e,0x74,0x65, - 0x72,0x72,0x75,0x70,0x74,0x20,0x6d,0x61,0x73,0x6b,0x20,0x64, - 0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x72,0x65,0x73,0x65, - 0x74,0x20,0x62,0x69,0x74,0x0a,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61,0x72,0x61,0x6c,0x6c, - 0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20,0x54,0x50,0x52,0x20, - 0x6e,0x6f,0x74,0x20,0x66,0x6f,0x75,0x6e,0x64,0x0a,0x00,0x00, - 0x0d,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x65,0x78,0x74,0x2e, - 0x20,0x6c,0x6f,0x6f,0x70,0x62,0x61,0x63,0x6b,0x3a,0x20,0x00, - 0x0d,0x54,0x65,0x73,0x74,0x20,0x45,0x42,0x49,0x20,0x25,0x64, - 0x20,0x55,0x41,0x52,0x54,0x2d,0x25,0x30,0x32,0x58,0x2e,0x2e, - 0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x73,0x63, - 0x72,0x61,0x74,0x63,0x68,0x20,0x72,0x65,0x67,0x69,0x73,0x74, - 0x65,0x72,0x20,0x77,0x72,0x6f,0x74,0x65,0x20,0x30,0x78,0x30, - 0x30,0x20,0x30,0x78,0x46,0x46,0x20,0x72,0x65,0x61,0x64,0x20, - 0x25,0x30,0x32,0x78,0x20,0x25,0x30,0x32,0x78,0x0a,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x27,0x64,0x61,0x74,0x61,0x20, - 0x72,0x65,0x61,0x64,0x79,0x20,0x73,0x74,0x75,0x63,0x6b,0x20, - 0x6f,0x6e,0x0a,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x54,0x48, - 0x52,0x45,0x20,0x6e,0x65,0x76,0x65,0x72,0x20,0x72,0x65,0x61, - 0x64,0x79,0x0a,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x6e,0x6f, - 0x6e,0x65,0x6d,0x70,0x74,0x79,0x20,0x74,0x72,0x61,0x6e,0x73, - 0x6d,0x69,0x74,0x74,0x65,0x72,0x20,0x6c,0x6f,0x6f,0x6b,0x73, - 0x20,0x65,0x6d,0x70,0x74,0x79,0x0a,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25, - 0x64,0x20,0x64,0x61,0x74,0x61,0x20,0x6e,0x65,0x76,0x65,0x72, - 0x20,0x61,0x72,0x72,0x69,0x76,0x65,0x64,0x0a,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x00,0x00,0x00,0x20,0x6f,0x76,0x65, - 0x72,0x72,0x75,0x6e,0x20,0x65,0x72,0x72,0x6f,0x72,0x00,0x00, - 0x20,0x70,0x61,0x72,0x69,0x74,0x79,0x20,0x65,0x72,0x72,0x6f, - 0x72,0x00,0x00,0x00,0x20,0x66,0x72,0x61,0x6d,0x69,0x6e,0x67, - 0x20,0x65,0x72,0x72,0x6f,0x72,0x00,0x00,0x0a,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x27,0x64,0x61,0x74,0x61,0x20, - 0x72,0x65,0x61,0x64,0x79,0x27,0x20,0x6e,0x6f,0x74,0x20,0x73, - 0x65,0x74,0x0a,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x27,0x64, - 0x61,0x74,0x61,0x20,0x72,0x65,0x61,0x64,0x79,0x27,0x20,0x73, - 0x74,0x69,0x6c,0x6c,0x20,0x73,0x65,0x74,0x0a,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x73,0x65,0x6e,0x64,0x20,0x25, - 0x30,0x32,0x78,0x20,0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x64, - 0x20,0x25,0x30,0x32,0x78,0x0a,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25, - 0x64,0x20,0x6d,0x6f,0x64,0x65,0x6d,0x20,0x73,0x74,0x61,0x74, - 0x75,0x73,0x20,0x6f,0x75,0x74,0x20,0x25,0x30,0x32,0x78,0x20, - 0x69,0x6e,0x20,0x25,0x30,0x32,0x78,0x0a,0x0d,0x00,0x00,0x00, - 0x20,0x43,0x54,0x53,0x2f,0x52,0x54,0x53,0x00,0x00,0x00,0x00, - 0x20,0x44,0x53,0x52,0x2f,0x44,0x54,0x52,0x00,0x00,0x00,0x00, - 0x20,0x52,0x49,0x2f,0x4f,0x55,0x54,0x31,0x00,0x00,0x00,0x00, - 0x20,0x44,0x43,0x44,0x2f,0x4f,0x55,0x54,0x32,0x00,0x00,0x00, - 0x0a,0x00,0x00,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e, - 0x54,0x20,0x73,0x74,0x75,0x63,0x6b,0x20,0x6f,0x6e,0x0a,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e,0x54,0x20,0x6d,0x61, - 0x73,0x6b,0x20,0x6f,0x6e,0x20,0x77,0x2f,0x6f,0x20,0x69,0x6e, - 0x74,0x65,0x72,0x72,0x75,0x70,0x74,0x0a,0x00,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e,0x54,0x20,0x6d,0x61, - 0x73,0x6b,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x73,0x65,0x74,0x20,0x62,0x69,0x74,0x0a,0x00,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e,0x54,0x20,0x64,0x6f, - 0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x77,0x6f,0x72,0x6b,0x0a, - 0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e, - 0x54,0x20,0x77,0x6f,0x6e,0x27,0x74,0x20,0x67,0x6f,0x20,0x61, - 0x77,0x61,0x79,0x0a,0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25, - 0x64,0x20,0x49,0x4e,0x54,0x20,0x6d,0x61,0x73,0x6b,0x20,0x64, - 0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x72,0x65,0x73,0x65, - 0x74,0x20,0x62,0x69,0x74,0x0a,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x68,0x61,0x73,0x20,0x25,0x64, - 0x20,0x70,0x6f,0x72,0x74,0x73,0x2c,0x20,0x73,0x68,0x6f,0x75, - 0x6c,0x64,0x20,0x62,0x65,0x20,0x25,0x64,0x73,0x20,0x25,0x64, - 0x70,0x0a,0x00,0x00,0x25,0x64,0x20,0x64,0x65,0x76,0x69,0x63, - 0x65,0x73,0x20,0x00,0x6e,0x6f,0x74,0x20,0x70,0x6f,0x70,0x75, - 0x6c,0x61,0x74,0x65,0x64,0x00,0x00,0x00,0x25,0x45,0x20,0x6c, - 0x6f,0x6f,0x70,0x62,0x61,0x63,0x6b,0x20,0x70,0x6f,0x72,0x74, - 0x20,0x6d,0x69,0x73,0x6d,0x61,0x74,0x63,0x68,0x3a,0x20,0x70, - 0x6f,0x72,0x74,0x20,0x25,0x64,0x3d,0x25,0x64,0x2c,0x20,0x61, - 0x6e,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x3d,0x25, - 0x64,0x0a,0x00,0x00,0x25,0x45,0x20,0x6c,0x6f,0x6f,0x70,0x62, - 0x61,0x63,0x6b,0x20,0x70,0x6f,0x72,0x74,0x20,0x6d,0x69,0x73, - 0x6d,0x61,0x74,0x63,0x68,0x3a,0x20,0x70,0x6f,0x72,0x74,0x20, - 0x25,0x64,0x3d,0x25,0x64,0x3f,0x0a,0x00,0x25,0x64,0x00,0x00, - 0x3d,0x25,0x64,0x00,0x3f,0x20,0x00,0x00,0x50,0x25,0x64,0x3d, - 0x50,0x25,0x64,0x20,0x00,0x00,0x00,0x00,0x25,0x64,0x3d,0x64, - 0x65,0x62,0x75,0x67,0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x4e, - 0x6f,0x20,0x65,0x78,0x74,0x65,0x72,0x6e,0x61,0x6c,0x20,0x63, - 0x6f,0x6e,0x6e,0x65,0x63,0x74,0x69,0x6f,0x6e,0x73,0x20,0x66, - 0x6f,0x75,0x6e,0x64,0x00,0x00,0x00,0x00,0x0a,0x0d,0x00,0x00, - 0x57,0x41,0x52,0x4e,0x49,0x4e,0x47,0x20,0x2d,0x20,0x4e,0x6f, - 0x74,0x20,0x61,0x6c,0x6c,0x20,0x55,0x41,0x52,0x54,0x53,0x20, - 0x64,0x65,0x74,0x65,0x63,0x74,0x65,0x64,0x20,0x69,0x6e,0x20, - 0x6c,0x6f,0x6f,0x70,0x62,0x61,0x63,0x6b,0x0a,0x0d,0x00,0x00, - 0x57,0x41,0x52,0x4e,0x49,0x4e,0x47,0x20,0x2d,0x20,0x50,0x61, - 0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x73, - 0x20,0x6e,0x6f,0x74,0x20,0x6c,0x6f,0x6f,0x70,0x65,0x64,0x20, - 0x62,0x61,0x63,0x6b,0x0a,0x0d,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61,0x72,0x61,0x6c,0x6c, - 0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20,0x73,0x65,0x6e,0x74, - 0x20,0x25,0x64,0x20,0x62,0x79,0x74,0x65,0x73,0x2c,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61,0x72,0x61,0x6c,0x6c, - 0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20,0x67,0x6f,0x74,0x20, - 0x25,0x64,0x20,0x62,0x79,0x74,0x65,0x73,0x0a,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61, - 0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20, - 0x77,0x72,0x6f,0x74,0x65,0x20,0x25,0x30,0x32,0x78,0x2c,0x20, - 0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x61,0x72,0x61,0x6c, - 0x6c,0x65,0x6c,0x20,0x70,0x6f,0x72,0x74,0x20,0x72,0x65,0x61, - 0x64,0x20,0x25,0x30,0x32,0x78,0x0a,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25, - 0x64,0x20,0x54,0x48,0x52,0x45,0x20,0x6e,0x65,0x76,0x65,0x72, - 0x20,0x72,0x65,0x61,0x64,0x79,0x0a,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25, - 0x64,0x20,0x27,0x64,0x61,0x74,0x61,0x20,0x72,0x65,0x61,0x64, - 0x79,0x20,0x73,0x74,0x75,0x63,0x6b,0x20,0x6f,0x6e,0x0a,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x54,0x48,0x52,0x45,0x20,0x6e, - 0x65,0x76,0x65,0x72,0x20,0x72,0x65,0x61,0x64,0x79,0x0a,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x6e,0x6f,0x6e,0x65,0x6d,0x70, - 0x74,0x79,0x20,0x74,0x72,0x61,0x6e,0x73,0x6d,0x69,0x74,0x74, - 0x65,0x72,0x20,0x6c,0x6f,0x6f,0x6b,0x73,0x20,0x65,0x6d,0x70, - 0x74,0x79,0x0a,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x64,0x61, - 0x74,0x61,0x20,0x6e,0x65,0x76,0x65,0x72,0x20,0x61,0x72,0x72, - 0x69,0x76,0x65,0x64,0x0a,0x00,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25, - 0x64,0x00,0x00,0x00,0x20,0x6f,0x76,0x65,0x72,0x72,0x75,0x6e, - 0x20,0x65,0x72,0x72,0x6f,0x72,0x00,0x00,0x20,0x70,0x61,0x72, - 0x69,0x74,0x79,0x20,0x65,0x72,0x72,0x6f,0x72,0x00,0x00,0x00, - 0x20,0x66,0x72,0x61,0x6d,0x69,0x6e,0x67,0x20,0x65,0x72,0x72, - 0x6f,0x72,0x00,0x00,0x0a,0x00,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25, - 0x64,0x20,0x27,0x64,0x61,0x74,0x61,0x20,0x72,0x65,0x61,0x64, - 0x79,0x27,0x20,0x6e,0x6f,0x74,0x20,0x73,0x65,0x74,0x0a,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x27,0x64,0x61,0x74,0x61,0x20, - 0x72,0x65,0x61,0x64,0x79,0x27,0x20,0x73,0x74,0x69,0x6c,0x6c, - 0x20,0x73,0x65,0x74,0x0a,0x00,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25, - 0x64,0x20,0x73,0x65,0x6e,0x64,0x20,0x25,0x30,0x32,0x78,0x20, - 0x72,0x65,0x63,0x65,0x69,0x76,0x65,0x64,0x20,0x25,0x30,0x32, - 0x78,0x0a,0x00,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x26,0x20, - 0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x6d,0x6f,0x64,0x65, - 0x6d,0x20,0x73,0x74,0x61,0x74,0x75,0x73,0x20,0x6f,0x75,0x74, - 0x20,0x25,0x30,0x32,0x78,0x20,0x69,0x6e,0x20,0x25,0x30,0x32, - 0x78,0x0a,0x0d,0x00,0x20,0x43,0x54,0x53,0x2f,0x52,0x54,0x53, - 0x00,0x00,0x00,0x00,0x20,0x44,0x53,0x52,0x2f,0x44,0x54,0x52, - 0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e, - 0x54,0x20,0x73,0x74,0x75,0x63,0x6b,0x20,0x6f,0x6e,0x0a,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e,0x54,0x20,0x6d,0x61, - 0x73,0x6b,0x20,0x6f,0x6e,0x20,0x77,0x2f,0x6f,0x20,0x69,0x6e, - 0x74,0x65,0x72,0x72,0x75,0x70,0x74,0x0a,0x00,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e,0x54,0x20,0x6d,0x61, - 0x73,0x6b,0x20,0x64,0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20, - 0x73,0x65,0x74,0x20,0x62,0x69,0x74,0x0a,0x00,0x00,0x00,0x00, - 0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f, - 0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e,0x54,0x20,0x64,0x6f, - 0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x77,0x6f,0x72,0x6b,0x0a, - 0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x45,0x42,0x49,0x20,0x25, - 0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25,0x64,0x20,0x49,0x4e, - 0x54,0x20,0x77,0x6f,0x6e,0x27,0x74,0x20,0x67,0x6f,0x20,0x61, - 0x77,0x61,0x79,0x0a,0x00,0x00,0x00,0x00,0x25,0x45,0x20,0x45, - 0x42,0x49,0x20,0x25,0x64,0x20,0x70,0x6f,0x72,0x74,0x20,0x25, - 0x64,0x20,0x49,0x4e,0x54,0x20,0x6d,0x61,0x73,0x6b,0x20,0x64, - 0x6f,0x65,0x73,0x20,0x6e,0x6f,0x74,0x20,0x72,0x65,0x73,0x65, - 0x74,0x20,0x62,0x69,0x74,0x0a,0x00,0x00,0x25,0x64,0x20,0x55, - 0x41,0x52,0x54,0x73,0x20,0x00,0x00,0x00,0x31,0x20,0x70,0x61, - 0x72,0x61,0x6c,0x6c,0x65,0x6c,0x20,0x00,0x0d,0x45,0x42,0x49, - 0x20,0x25,0x64,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e, - 0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x6e,0x6f,0x6e,0x65,0x00,0x00, - 0x0d,0x45,0x42,0x49,0x20,0x25,0x64,0x2e,0x2e,0x2e,0x2e,0x2e, - 0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x2e,0x75,0x6e, - 0x6b,0x6e,0x6f,0x77,0x6e,0x20,0x45,0x42,0x49,0x20,0x74,0x79, - 0x70,0x65,0x20,0x25,0x30,0x32,0x78,0x2c,0x20,0x6e,0x6f,0x74, - 0x20,0x74,0x65,0x73,0x74,0x65,0x64,0x0d,0x0a,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x0c,0x00,0x34,0x00,0x00,0x00,0x41,0x0b, - 0x00,0x00,0x0b,0x00,0x0c,0x00,0xe2,0x00,0x00,0x00,0x40,0x00, - 0x0c,0x00,0x74,0x00,0x04,0x00,0x6e,0x00,0x04,0x00,0x00,0x00, - 0x0c,0x00,0xe4,0x00,0x04,0x00,0x40,0x00,0x0c,0x00,0xb4,0x00, - 0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x0c,0x00,0xe8,0x00, - 0x08,0x00,0x40,0x00,0x2e,0x2e,0x2f,0x74,0x69,0x6d,0x65,0x72, - 0x2e,0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x40,0x28,0x23,0x29,0x62,0x69,0x6f,0x73,0x69,0x6e,0x69,0x74, - 0x2e,0x73,0x20,0x20,0x20,0x20,0x33,0x2e,0x36,0x2e,0x31,0x20, - 0x20,0x37,0x2f,0x31,0x2f,0x39,0x34,0x00,0x40,0x28,0x23,0x29, - 0x62,0x69,0x6f,0x73,0x69,0x6e,0x69,0x74,0x2e,0x73,0x20,0x20, - 0x20,0x20,0x33,0x2e,0x36,0x20,0x20,0x37,0x2f,0x31,0x2f,0x39, - 0x34,0x00,0x40,0x28,0x23,0x29,0x63,0x68,0x65,0x63,0x6b,0x72, - 0x61,0x6e,0x67,0x65,0x2e,0x63,0x20,0x20,0x31,0x2e,0x31,0x20, - 0x20,0x35,0x2f,0x31,0x38,0x2f,0x39,0x32,0x00,0x40,0x28,0x23, - 0x29,0x63,0x6f,0x6d,0x6d,0x6f,0x6e,0x2e,0x6d,0x6b,0x20,0x20, - 0x20,0x20,0x20,0x33,0x2e,0x31,0x30,0x20,0x20,0x31,0x2f,0x36, - 0x2f,0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x64,0x65,0x66,0x73, - 0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e, - 0x32,0x20,0x20,0x34,0x2f,0x36,0x2f,0x39,0x34,0x00,0x40,0x28, - 0x23,0x29,0x64,0x65,0x76,0x69,0x63,0x65,0x2e,0x68,0x20,0x20, - 0x20,0x20,0x20,0x20,0x33,0x2e,0x38,0x20,0x20,0x34,0x2f,0x31, - 0x34,0x2f,0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x68,0x6f,0x73, - 0x74,0x63,0x6f,0x6d,0x6d,0x2e,0x68,0x20,0x20,0x20,0x20,0x33, - 0x2e,0x33,0x20,0x20,0x33,0x2f,0x32,0x32,0x2f,0x39,0x33,0x00, - 0x40,0x28,0x23,0x29,0x6d,0x69,0x64,0x2e,0x68,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x33,0x20,0x20,0x34, - 0x2f,0x36,0x2f,0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x6d,0x6f, - 0x64,0x75,0x6c,0x65,0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20, - 0x33,0x2e,0x31,0x20,0x20,0x38,0x2f,0x32,0x30,0x2f,0x39,0x33, - 0x00,0x40,0x28,0x23,0x29,0x70,0x61,0x72,0x61,0x2e,0x68,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x31,0x2e,0x31,0x20,0x20, - 0x37,0x2f,0x37,0x2f,0x39,0x33,0x00,0x40,0x28,0x23,0x29,0x70, - 0x62,0x75,0x73,0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x33,0x2e,0x32,0x20,0x20,0x34,0x2f,0x36,0x2f,0x39,0x34, - 0x00,0x40,0x28,0x23,0x29,0x72,0x65,0x67,0x2e,0x68,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x32,0x20,0x20, - 0x38,0x2f,0x32,0x35,0x2f,0x39,0x33,0x00,0x40,0x28,0x23,0x29, - 0x72,0x65,0x6c,0x65,0x61,0x73,0x65,0x2e,0x68,0x20,0x20,0x20, - 0x20,0x20,0x33,0x2e,0x39,0x20,0x20,0x38,0x2f,0x31,0x37,0x2f, - 0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x72,0x77,0x2e,0x63,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x31, - 0x20,0x20,0x31,0x31,0x2f,0x35,0x2f,0x39,0x32,0x00,0x40,0x28, - 0x23,0x29,0x72,0x77,0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x32,0x2e,0x31,0x20,0x20,0x33,0x2f,0x31, - 0x2f,0x39,0x32,0x00,0x40,0x28,0x23,0x29,0x73,0x63,0x61,0x2e, - 0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e, - 0x34,0x20,0x20,0x34,0x2f,0x31,0x39,0x2f,0x39,0x33,0x00,0x40, - 0x28,0x23,0x29,0x73,0x6d,0x61,0x72,0x74,0x62,0x69,0x6f,0x73, - 0x2e,0x63,0x20,0x20,0x20,0x33,0x2e,0x31,0x31,0x20,0x20,0x37, - 0x2f,0x31,0x2f,0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x73,0x6d, - 0x61,0x72,0x74,0x62,0x69,0x6f,0x73,0x2e,0x68,0x20,0x20,0x20, - 0x33,0x2e,0x31,0x20,0x20,0x38,0x2f,0x32,0x30,0x2f,0x39,0x33, - 0x00,0x40,0x28,0x23,0x29,0x73,0x78,0x62,0x69,0x6f,0x73,0x2e, - 0x6d,0x6b,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x33,0x20,0x20, - 0x37,0x2f,0x31,0x2f,0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x74, - 0x65,0x73,0x74,0x73,0x2e,0x63,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x33,0x2e,0x32,0x33,0x20,0x20,0x37,0x2f,0x32,0x31,0x2f, - 0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x74,0x69,0x6d,0x65,0x72, - 0x2e,0x63,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x33, - 0x20,0x20,0x37,0x2f,0x37,0x2f,0x39,0x33,0x00,0x40,0x28,0x23, - 0x29,0x74,0x69,0x6d,0x65,0x72,0x2e,0x68,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x33,0x2e,0x33,0x20,0x20,0x34,0x2f,0x36,0x2f, - 0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x75,0x61,0x72,0x74,0x2e, - 0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x31, - 0x20,0x20,0x34,0x2f,0x36,0x2f,0x39,0x34,0x00,0x40,0x28,0x23, - 0x29,0x75,0x74,0x69,0x6c,0x2e,0x73,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x33,0x2e,0x33,0x20,0x20,0x37,0x2f,0x31,0x2f, - 0x39,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -static unsigned pcem_nbios = sizeof(pcem_bios); - diff --git a/sys/dev/serial/dgb/dgmfep.h b/sys/dev/serial/dgb/dgmfep.h deleted file mode 100644 index 462cbbc925..0000000000 --- a/sys/dev/serial/dgb/dgmfep.h +++ /dev/null @@ -1,1955 +0,0 @@ -/* - * $FreeBSD: src/sys/dev/dgb/dgmfep.h,v 1.4.2.1 2001/09/23 19:54:54 brian Exp $ - * $DragonFly: src/sys/dev/serial/dgb/dgmfep.h,v 1.2 2003/06/17 04:28:23 dillon Exp $ - * - * This file is an ascii copy of the file sxbios.bin included in the - * Digiboard PC/Xem driver for Linux. It is copyright 1992, DIGI - * International. All Rights Reserved. - */ - -static unsigned char pcem_cook[] = { - 0x4f,0x53,0x5b,0x12,0x65,0x00,0x00,0x10,0xc5,0x00,0x1e,0x24, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x4b,0x3d,0xb2,0x87,0x00,0x00,0x00,0x00,0x40,0x28,0x23,0x29, - 0x73,0x78,0x66,0x65,0x70,0x2e,0x62,0x69,0x6e,0x20,0x20,0x20, - 0x20,0x20,0x32,0x2e,0x31,0x20,0x30,0x38,0x2f,0x31,0x37,0x2f, - 0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x43,0x6f,0x70,0x79,0x72, - 0x69,0x67,0x68,0x74,0x20,0x28,0x43,0x29,0x20,0x31,0x39,0x39, - 0x32,0x2c,0x20,0x44,0x49,0x47,0x49,0x20,0x49,0x6e,0x74,0x65, - 0x72,0x6e,0x61,0x74,0x69,0x6f,0x6e,0x61,0x6c,0x2e,0x20,0x41, - 0x6c,0x6c,0x20,0x52,0x69,0x67,0x68,0x74,0x73,0x20,0x52,0x65, - 0x73,0x65,0x72,0x76,0x65,0x64,0x2e,0x00,0x00,0xa3,0x01,0x3c, - 0x28,0x02,0x22,0xac,0x00,0xa3,0x02,0x3c,0x20,0x02,0x42,0x24, - 0x0c,0x00,0x43,0xac,0x00,0x60,0x03,0x40,0x00,0x60,0x80,0x40, - 0x00,0x00,0x43,0xac,0x00,0x68,0x03,0x40,0x00,0x00,0x00,0x00, - 0x24,0x00,0x49,0xac,0x20,0x00,0x48,0xac,0x00,0xa3,0x09,0x3c, - 0x04,0x00,0x43,0xac,0x10,0x00,0x44,0xac,0x14,0x00,0x45,0xac, - 0x18,0x00,0x46,0xac,0x1c,0x00,0x47,0xac,0x28,0x00,0x4a,0xac, - 0x2c,0x00,0x4b,0xac,0x30,0x00,0x4c,0xac,0x34,0x00,0x4d,0xac, - 0x38,0x00,0x4e,0xac,0x3c,0x00,0x4f,0xac,0x40,0x00,0x50,0xac, - 0x44,0x00,0x51,0xac,0x48,0x00,0x52,0xac,0x4c,0x00,0x53,0xac, - 0x50,0x00,0x54,0xac,0x54,0x00,0x55,0xac,0x58,0x00,0x56,0xac, - 0x5c,0x00,0x57,0xac,0x60,0x00,0x58,0xac,0x64,0x00,0x59,0xac, - 0x68,0x00,0x5a,0xac,0x6c,0x00,0x5b,0xac,0x70,0x00,0x5c,0xac, - 0x74,0x00,0x5d,0xac,0x78,0x00,0x5e,0xac,0x7c,0x00,0x5f,0xac, - 0x10,0x00,0x08,0x24,0x00,0x02,0x29,0x25,0x00,0x00,0x8a,0x80, - 0x00,0x00,0x00,0x00,0x02,0x00,0x40,0x11,0x00,0x00,0x2a,0xa1, - 0x01,0x00,0x84,0x24,0xff,0xff,0x08,0x25,0xf9,0xff,0x00,0x1d, - 0x01,0x00,0x29,0x25,0x00,0xa3,0x01,0x3c,0x10,0x02,0x25,0xac, - 0x00,0xa3,0x01,0x3c,0x14,0x02,0x3f,0xac,0x00,0xa3,0x01,0x3c, - 0x18,0x02,0x3d,0xac,0x02,0x00,0x08,0x24,0x00,0xa3,0x01,0x3c, - 0x00,0xa3,0x1d,0x3c,0x10,0x0c,0x28,0xac,0x00,0x04,0xbd,0x27, - 0x64,0x17,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0xa3,0x08,0x3c, - 0x10,0x0c,0x08,0x8d,0x01,0x00,0x01,0x24,0x23,0x00,0x01,0x11, - 0x00,0x00,0x00,0x00,0xf8,0xff,0x00,0x10,0x00,0x00,0x00,0x00, - 0xc5,0x00,0x1e,0x24,0x00,0x83,0x01,0x3c,0x10,0x00,0x3e,0xac, - 0x00,0x00,0x1e,0x24,0x00,0x10,0x08,0x3c,0x00,0x60,0x88,0x40, - 0xce,0x00,0x1e,0x24,0x00,0x83,0x01,0x3c,0x01,0x80,0x1c,0x3c, - 0x10,0x00,0x3e,0xac,0xb0,0xfb,0x9c,0x27,0x00,0x00,0x1e,0x24, - 0x01,0x00,0x11,0x04,0x00,0x00,0x00,0x00,0x00,0x80,0x04,0x3c, - 0xe9,0x00,0x1e,0x24,0x00,0x83,0x01,0x3c,0x01,0x80,0x06,0x3c, - 0xd0,0x31,0x84,0x24,0x10,0x00,0x3e,0xac,0x00,0x80,0x05,0x3c, - 0x50,0x86,0xc6,0x24,0x23,0x20,0xe4,0x03,0x00,0x00,0x1e,0x24, - 0x00,0x30,0xa5,0x24,0x21,0x20,0x86,0x00,0xfc,0xff,0x88,0x8c, - 0xfc,0xff,0xc6,0x24,0x2b,0x08,0xa6,0x00,0xfc,0xff,0x84,0x24, - 0xfb,0xff,0x20,0x14,0x00,0x00,0xc8,0xac,0x00,0x60,0x08,0x40, - 0x00,0x00,0x00,0x00,0xff,0xff,0x01,0x3c,0xfe,0x00,0x21,0x34, - 0x24,0x40,0x01,0x01,0x00,0x60,0x88,0x40,0x09,0x01,0x1e,0x24, - 0x00,0x83,0x01,0x3c,0x10,0x00,0x3e,0xac,0x00,0x80,0x04,0x3c, - 0x90,0x44,0x84,0x24,0x00,0xa0,0x01,0x3c,0x00,0x80,0x1f,0x3c, - 0x25,0x20,0x81,0x00,0x00,0x00,0x1e,0x24,0x08,0x00,0x80,0x00, - 0x5c,0x32,0xff,0x27,0x13,0x01,0x1e,0x24,0x00,0x83,0x01,0x3c, - 0x10,0x00,0x3e,0xac,0x00,0xa3,0x01,0x3c,0x00,0x00,0x1e,0x24, - 0x80,0x92,0x9d,0x27,0x9e,0x15,0x00,0x0c,0x10,0x0c,0x20,0xac, - 0x66,0x0c,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x94,0xff,0xbd,0x27, - 0x10,0x00,0xa1,0xaf,0x14,0x00,0xa2,0xaf,0x18,0x00,0xa3,0xaf, - 0x1c,0x00,0xa4,0xaf,0x20,0x00,0xa5,0xaf,0x24,0x00,0xa6,0xaf, - 0x28,0x00,0xa7,0xaf,0x2c,0x00,0xa8,0xaf,0x30,0x00,0xa9,0xaf, - 0x34,0x00,0xaa,0xaf,0x38,0x00,0xab,0xaf,0x3c,0x00,0xac,0xaf, - 0x40,0x00,0xad,0xaf,0x44,0x00,0xae,0xaf,0x48,0x00,0xaf,0xaf, - 0x4c,0x00,0xb8,0xaf,0x50,0x00,0xb9,0xaf,0x58,0x00,0xbe,0xaf, - 0x5c,0x00,0xbf,0xaf,0x00,0x70,0x08,0x40,0x12,0x48,0x00,0x00, - 0x10,0x50,0x00,0x00,0x54,0x00,0xa8,0xaf,0x60,0x00,0xa9,0xaf, - 0x64,0x00,0xaa,0xaf,0x00,0x68,0x05,0x40,0x00,0x60,0x06,0x40, - 0x7c,0x00,0xa4,0x30,0x55,0x00,0x80,0x14,0x00,0x00,0x00,0x00, - 0x24,0x10,0xa6,0x00,0x68,0x00,0xa6,0xaf,0x00,0xff,0x42,0x30, - 0x00,0x08,0x44,0x30,0x44,0x00,0x80,0x14,0x00,0x00,0x00,0x00, - 0x00,0x04,0x48,0x30,0x37,0x00,0x00,0x15,0x00,0x00,0x00,0x00, - 0x2a,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x68,0x00,0xa6,0x8f, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x86,0x40, - 0x00,0x68,0x05,0x40,0x00,0x00,0x00,0x00,0x24,0x10,0xa6,0x00, - 0x00,0xff,0x42,0x30,0xf0,0xff,0x40,0x14,0x00,0x08,0x44,0x30, - 0x68,0x00,0xa8,0x8f,0x60,0x00,0xa9,0x8f,0x64,0x00,0xaa,0x8f, - 0x00,0x00,0x00,0x00,0x00,0x60,0x88,0x40,0x13,0x00,0x20,0x01, - 0x11,0x00,0x40,0x01,0x14,0x00,0xa2,0x8f,0x18,0x00,0xa3,0x8f, - 0x1c,0x00,0xa4,0x8f,0x20,0x00,0xa5,0x8f,0x24,0x00,0xa6,0x8f, - 0x28,0x00,0xa7,0x8f,0x2c,0x00,0xa8,0x8f,0x30,0x00,0xa9,0x8f, - 0x34,0x00,0xaa,0x8f,0x38,0x00,0xab,0x8f,0x3c,0x00,0xac,0x8f, - 0x40,0x00,0xad,0x8f,0x44,0x00,0xae,0x8f,0x48,0x00,0xaf,0x8f, - 0x4c,0x00,0xb8,0x8f,0x50,0x00,0xb9,0x8f,0x58,0x00,0xbe,0x8f, - 0x5c,0x00,0xbf,0x8f,0x00,0x00,0x00,0x00,0x54,0x00,0xba,0x8f, - 0x10,0x00,0xa1,0x8f,0x6c,0x00,0xbd,0x27,0x08,0x00,0x40,0x03, - 0x10,0x00,0x00,0x42,0x84,0x92,0x88,0x8f,0x00,0x00,0x09,0x24, - 0x26,0x40,0x06,0x01,0x01,0xff,0x08,0x31,0x26,0x30,0xc8,0x00, - 0x00,0x68,0x89,0x40,0x00,0x60,0x86,0x40,0x8c,0x15,0x00,0x0c, - 0x00,0x00,0x00,0x00,0xce,0xff,0x00,0x10,0x68,0x00,0xa6,0x8f, - 0x80,0x92,0x88,0x8f,0x00,0x00,0x00,0x00,0x26,0x40,0x06,0x01, - 0x01,0xff,0x08,0x31,0x26,0x30,0xc8,0x00,0x00,0x60,0x86,0x40, - 0x44,0x19,0x00,0x0c,0x00,0x00,0x00,0x00,0xc4,0xff,0x00,0x10, - 0x68,0x00,0xa6,0x8f,0x01,0x80,0x08,0x3c,0x48,0x8e,0x08,0x8d, - 0x00,0x00,0x00,0x00,0x26,0x40,0x06,0x01,0x01,0xff,0x08,0x31, - 0x26,0x30,0xc8,0x00,0x00,0x60,0x86,0x40,0x95,0x15,0x00,0x0c, - 0x00,0x00,0x00,0x00,0xb9,0xff,0x00,0x10,0x68,0x00,0xa6,0x8f, - 0x00,0x80,0x04,0x3c,0xd0,0x7a,0x84,0x24,0x20,0x0c,0x00,0x0c, - 0x74,0x01,0x05,0x24,0xbd,0xff,0x00,0x10,0x68,0x00,0xa8,0x8f, - 0xec,0xff,0xbd,0x27,0x08,0x00,0xa1,0xaf,0x00,0x70,0x1a,0x40, - 0x00,0x00,0x00,0x00,0x0c,0x00,0xba,0xaf,0x10,0x00,0xbf,0xaf, - 0x00,0x80,0x04,0x3c,0xd0,0x7a,0x84,0x24,0x20,0x0c,0x00,0x0c, - 0x96,0x01,0x05,0x24,0x10,0x00,0xbf,0x8f,0x0c,0x00,0xba,0x8f, - 0x08,0x00,0xa1,0x8f,0x0c,0x00,0xbd,0x27,0x08,0x00,0x40,0x03, - 0x10,0x00,0x00,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0xdc,0xff,0xbd,0x27,0xa0,0x92,0x84,0x8f, - 0x00,0x00,0xb0,0xaf,0x04,0x00,0xb1,0xaf,0x08,0x00,0xb2,0xaf, - 0x0c,0x00,0xb3,0xaf,0x10,0x00,0xb4,0xaf,0x14,0x00,0xb5,0xaf, - 0x18,0x00,0xb6,0xaf,0x1c,0x00,0xb7,0xaf,0x20,0x00,0xbf,0xaf, - 0x04,0x00,0x88,0x8c,0x01,0x80,0x10,0x3c,0xcc,0x85,0x10,0x8e, - 0x08,0x00,0x00,0x01,0x00,0x20,0x11,0x3c,0x00,0x93,0x88,0x8f, - 0x21,0x80,0x10,0x02,0x04,0x00,0x08,0x31,0x21,0x08,0x1c,0x01, - 0xa4,0x92,0x24,0x8c,0x00,0x00,0x00,0x00,0x04,0x00,0x8a,0x8c, - 0x00,0x00,0x00,0x00,0x08,0x00,0x40,0x01,0x00,0x00,0x00,0x00, - 0x00,0x93,0x88,0x8f,0x21,0x80,0x10,0x02,0x21,0x08,0x1c,0x01, - 0xac,0x92,0x24,0x8c,0x04,0x00,0x0a,0x25,0x04,0x00,0x89,0x8c, - 0x0c,0x00,0x4a,0x31,0x08,0x00,0x20,0x01,0x00,0x93,0x8a,0xaf, - 0xbc,0x92,0x84,0x8f,0x9c,0x92,0x90,0x8f,0x00,0x00,0x00,0x00, - 0x34,0x00,0x88,0x8c,0xff,0xff,0x10,0x26,0x09,0xf8,0x00,0x01, - 0x00,0x00,0x00,0x00,0x30,0x00,0x84,0x8c,0xfa,0xff,0x00,0x16, - 0x00,0x00,0x00,0x00,0x20,0x00,0xbf,0x8f,0x00,0x00,0xb0,0x8f, - 0x04,0x00,0xb1,0x8f,0x08,0x00,0xb2,0x8f,0x0c,0x00,0xb3,0x8f, - 0x10,0x00,0xb4,0x8f,0x14,0x00,0xb5,0x8f,0x18,0x00,0xb6,0x8f, - 0x1c,0x00,0xb7,0x8f,0xbc,0x92,0x84,0xaf,0x08,0x00,0xe0,0x03, - 0x24,0x00,0xbd,0x27,0x50,0x00,0x87,0x94,0x24,0x00,0x86,0x8c, - 0x82,0x48,0x07,0x00,0x0c,0x00,0x29,0x31,0x21,0x08,0x3c,0x01, - 0x10,0x80,0x29,0x8c,0x25,0x28,0x91,0x00,0x08,0x00,0x20,0x01, - 0x00,0x00,0x00,0x00,0x08,0x00,0xc2,0x90,0x00,0x00,0x00,0x00, - 0xc0,0x47,0x02,0x00,0xab,0x00,0x11,0x05,0x00,0x00,0x00,0x00, - 0x44,0x00,0x92,0x8c,0x02,0x49,0x07,0x00,0x23,0x90,0x50,0x02, - 0x9e,0x00,0x41,0x06,0x7c,0x00,0x29,0x31,0x21,0x08,0x3c,0x01, - 0x30,0x80,0x29,0x8c,0x40,0x00,0x93,0x8c,0x08,0x00,0x20,0x01, - 0x00,0x00,0x00,0x00,0x2c,0x00,0x89,0x94,0x00,0x00,0x00,0x00, - 0x00,0x08,0x29,0x31,0x0d,0x01,0x20,0x15,0x00,0x00,0x00,0x00, - 0x02,0x49,0x07,0x00,0x0c,0x00,0x29,0x31,0x21,0x08,0x3c,0x01, - 0x20,0x80,0x29,0x8c,0x00,0x00,0x00,0x00,0x08,0x00,0x20,0x01, - 0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x8c,0x00,0x00,0x00,0x00, - 0x04,0x00,0x89,0x8c,0x00,0x00,0x00,0x00,0x08,0x00,0x20,0x01, - 0x00,0x00,0x00,0x00,0x02,0x41,0x07,0x00,0x7c,0x00,0x08,0x31, - 0x21,0x08,0x1c,0x01,0x30,0x80,0x28,0x8c,0x00,0x00,0x00,0x00, - 0x08,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x54,0x00,0xa9,0x90, - 0x58,0x00,0xaa,0x90,0x01,0x00,0xe8,0x30,0x09,0x00,0x00,0x11, - 0x00,0x00,0x00,0x00,0x28,0x00,0x8c,0x94,0x00,0x00,0x00,0x00, - 0x00,0x10,0x88,0x31,0x04,0x00,0x00,0x11,0x00,0x00,0x00,0x00, - 0x5d,0x00,0x83,0x90,0x03,0x00,0x00,0x10,0x08,0x00,0x2b,0x35, - 0x5c,0x00,0x83,0x90,0xf7,0xff,0x2b,0x31,0x26,0x48,0x2b,0x01, - 0x25,0x50,0x49,0x01,0x54,0x00,0xab,0xa0,0x58,0x00,0xaa,0xa0, - 0xff,0xfd,0xe7,0x30,0x50,0x00,0x87,0xa4,0x21,0x90,0x53,0x02, - 0xe2,0xff,0x40,0x06,0x00,0x00,0xc3,0xa0,0x67,0x00,0x00,0x10, - 0x00,0x00,0x88,0x8c,0x02,0x00,0x08,0x24,0x21,0x48,0x12,0x02, - 0x5c,0x00,0x20,0x15,0x67,0x00,0x88,0xa0,0x0c,0x00,0xca,0x90, - 0x00,0x04,0xe7,0x34,0x40,0x00,0x4a,0x35,0x0c,0x00,0xca,0xa0, - 0x56,0x00,0x00,0x10,0x50,0x00,0x87,0xa4,0x6c,0x00,0x89,0x8c, - 0x02,0x00,0x08,0x24,0xff,0xff,0x01,0x24,0x0b,0x00,0x21,0x11, - 0x67,0x00,0x88,0xa0,0x23,0x48,0x30,0x01,0x07,0x00,0x20,0x1d, - 0x00,0x00,0x00,0x00,0x0c,0x00,0xca,0x90,0xff,0xfa,0xe7,0x30, - 0xbf,0xff,0x4a,0x31,0x0c,0x00,0xca,0xa0,0x00,0x00,0x09,0x24, - 0x50,0x00,0x87,0xa4,0x6c,0x00,0x89,0xac,0x46,0x00,0x00,0x10, - 0x00,0x00,0x88,0x8c,0x24,0x00,0x86,0x8c,0x25,0x28,0x91,0x00, - 0x08,0x00,0xc2,0x90,0x00,0x00,0x00,0x00,0xc0,0x47,0x02,0x00, - 0x4a,0x00,0x11,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x84,0x8c, - 0x00,0x00,0x00,0x00,0x04,0x00,0x89,0x8c,0x00,0x00,0x00,0x00, - 0x08,0x00,0x20,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x0a,0x3c, - 0x88,0x37,0x4a,0x25,0x49,0x00,0x88,0x90,0x4a,0x00,0x89,0x90, - 0x0e,0x00,0x00,0x10,0x04,0x00,0x8a,0xac,0x24,0x00,0x86,0x8c, - 0x50,0x00,0x87,0x94,0x08,0x00,0xc2,0x90,0x25,0x28,0x91,0x00, - 0xc0,0x47,0x02,0x00,0x3a,0x00,0x11,0x05,0x42,0x42,0x07,0x00, - 0x44,0x00,0x92,0x8c,0x49,0x00,0x88,0x90,0x4a,0x00,0x89,0x90, - 0x23,0x90,0x50,0x02,0x2b,0x00,0x41,0x06,0x00,0x00,0x00,0x00, - 0x0a,0x00,0xb5,0x94,0x0c,0x00,0xb6,0x94,0x18,0x00,0xca,0x90, - 0x17,0x00,0xb6,0x12,0x00,0x00,0x00,0x00,0x24,0x40,0x0a,0x01, - 0x1d,0x00,0x09,0x15,0x00,0x00,0x00,0x00,0x3c,0x00,0x94,0x8c, - 0x40,0x00,0x93,0x8c,0x0e,0x00,0x97,0x94,0x21,0x40,0x96,0x02, - 0x00,0x00,0x03,0x91,0x01,0x00,0xd6,0x26,0x00,0x00,0xc3,0xa0, - 0x21,0x90,0x53,0x02,0x04,0x00,0x41,0x06,0x24,0xb0,0xd7,0x02, - 0xf9,0xff,0xb6,0x16,0x21,0x40,0x96,0x02,0x00,0x00,0x12,0x24, - 0x00,0x00,0x88,0x8c,0x0c,0x00,0xb6,0xa4,0x04,0x00,0x09,0x8d, - 0x44,0x00,0x92,0xac,0x08,0x00,0x20,0x01,0x21,0x20,0x00,0x01, - 0x21,0x40,0x12,0x02,0x07,0x00,0x00,0x15,0x00,0x00,0x00,0x00, - 0x00,0x80,0x08,0x3c,0xbf,0xff,0xe7,0x30,0x3c,0x37,0x08,0x25, - 0x4b,0x00,0x80,0xa0,0x50,0x00,0x87,0xa4,0x04,0x00,0x88,0xac, - 0x00,0x00,0x88,0x8c,0x00,0x00,0x00,0x00,0x04,0x00,0x09,0x8d, - 0x44,0x00,0x80,0xac,0x08,0x00,0x20,0x01,0x21,0x20,0x00,0x01, - 0x00,0x00,0x88,0x8c,0x44,0x00,0x92,0xac,0x04,0x00,0x09,0x8d, - 0x21,0x20,0x00,0x01,0x08,0x00,0x20,0x01,0x00,0x00,0x00,0x00, - 0x50,0x00,0x87,0x8c,0x00,0x00,0x00,0x00,0x42,0x42,0x07,0x00, - 0x7c,0x00,0x08,0x31,0x21,0x08,0x1c,0x01,0x6a,0x00,0x92,0x94, - 0xb0,0x88,0x33,0x8c,0x38,0x00,0x94,0x8c,0x12,0x00,0xb5,0x94, - 0x14,0x00,0xb6,0x94,0x16,0x00,0x97,0x94,0x28,0x00,0x8c,0x94, - 0x5c,0x00,0x8e,0x90,0x5d,0x00,0x8f,0x90,0x00,0x00,0x00,0x00, - 0x14,0x00,0xc2,0x90,0x00,0x00,0xc3,0x90,0x00,0x42,0x02,0x00, - 0x25,0x18,0x68,0x00,0x08,0x00,0x60,0x02,0x24,0x18,0x72,0x00, - 0xff,0xf9,0x68,0x30,0x65,0x02,0x0e,0x11,0x21,0x48,0x95,0x02, - 0x74,0x02,0x0f,0x11,0xff,0x00,0x61,0x2c,0x11,0x00,0x20,0x10, - 0x00,0x00,0x23,0xa1,0x01,0x00,0xb5,0x26,0x24,0xa8,0xb7,0x02, - 0x1e,0x00,0xb6,0x16,0x00,0x00,0x00,0x00,0xc4,0x02,0x00,0x10, - 0xff,0xff,0xb5,0x26,0x21,0x48,0x95,0x02,0xff,0x00,0x61,0x2c, - 0x07,0x00,0x20,0x10,0x00,0x00,0x23,0xa1,0x01,0x00,0xb5,0x26, - 0x24,0xa8,0xb7,0x02,0x14,0x00,0xb6,0x16,0x00,0x00,0x00,0x00, - 0xba,0x02,0x00,0x10,0xff,0xff,0xb5,0x26,0x00,0xff,0x68,0x30, - 0x71,0x02,0x00,0x15,0xc2,0x51,0x03,0x00,0x01,0x00,0xb5,0x26, - 0x24,0xa8,0xb7,0x02,0xb2,0x02,0xb6,0x12,0x00,0x00,0x00,0x00, - 0x08,0x00,0x8a,0x31,0x08,0x00,0x40,0x11,0x00,0x00,0x00,0x00, - 0x21,0x48,0x95,0x02,0x01,0x00,0xb5,0x26,0x24,0xa8,0xb7,0x02, - 0x03,0x00,0xb6,0x16,0x00,0x00,0x23,0xa1,0xa7,0x02,0x00,0x10, - 0xff,0xff,0xb5,0x26,0x08,0x00,0xc2,0x90,0x00,0x00,0x00,0x00, - 0x01,0x00,0x48,0x30,0xce,0xff,0x00,0x11,0x00,0x00,0x00,0x00, - 0x1c,0x00,0x88,0x94,0x23,0x48,0xb6,0x02,0x24,0x48,0x37,0x01, - 0x2b,0x08,0x28,0x01,0x1a,0x00,0x20,0x14,0x12,0x00,0xb5,0xa4, - 0x01,0x00,0xea,0x30,0x17,0x00,0x40,0x15,0x00,0x00,0x00,0x00, - 0x00,0x10,0x88,0x31,0x06,0x00,0x00,0x11,0x01,0x00,0xe7,0x34, - 0x00,0x80,0x13,0x3c,0x00,0x80,0x1f,0x3c,0x00,0x02,0xe7,0x38, - 0xa4,0x35,0x73,0x26,0xdc,0x35,0xff,0x27,0x5f,0x00,0x88,0x90, - 0x54,0x00,0xa9,0x90,0x03,0x00,0x08,0x31,0x26,0x48,0x28,0x01, - 0x54,0x00,0xa9,0xa0,0x56,0x00,0xa9,0x90,0x58,0x00,0xaa,0x90, - 0x24,0x48,0x28,0x01,0x25,0x50,0x49,0x01,0x58,0x00,0xaa,0xa0, - 0x68,0x00,0x8b,0x90,0x27,0x40,0x00,0x01,0x24,0x58,0x68,0x01, - 0x10,0x00,0xcb,0xa0,0x12,0x00,0xb5,0xa4,0x08,0x00,0xe0,0x03, - 0x50,0x00,0x87,0xa4,0x24,0x00,0x86,0x8c,0x25,0x28,0x91,0x00, - 0x54,0x00,0xa9,0x90,0x18,0x00,0xc8,0x90,0x58,0x00,0xaa,0x90, - 0x26,0x40,0x09,0x01,0xf0,0x00,0x08,0x31,0x26,0x48,0x28,0x01, - 0x54,0x00,0xa9,0xa0,0x56,0x00,0xa9,0x90,0x00,0x00,0x00,0x00, - 0x24,0x48,0x28,0x01,0x25,0x50,0x49,0x01,0x08,0x00,0xe0,0x03, - 0x58,0x00,0xaa,0xa0,0x00,0x80,0x0a,0x3c,0x58,0x3a,0x4a,0x25, - 0x04,0x00,0x00,0x10,0x04,0x00,0x8a,0xac,0x24,0x00,0x86,0x8c, - 0x50,0x00,0x87,0x94,0x25,0x28,0x91,0x00,0x38,0x00,0xc9,0x90, - 0x00,0x00,0x00,0x00,0x14,0x00,0x20,0x11,0x00,0x00,0x00,0x00, - 0x12,0x00,0xb5,0x94,0x38,0x00,0x94,0x8c,0x14,0x00,0xb6,0x94, - 0x16,0x00,0x97,0x94,0x21,0x40,0x95,0x02,0x01,0x00,0xb5,0x26, - 0x24,0xa8,0xb7,0x02,0x08,0x00,0xb6,0x12,0x00,0x00,0x00,0x00, - 0x48,0x00,0xc3,0x90,0xff,0xff,0x29,0x25,0x00,0x00,0x03,0xa1, - 0xf8,0xff,0x20,0x15,0x21,0x40,0x95,0x02,0x04,0x00,0x00,0x10, - 0x12,0x00,0xb5,0xa4,0xff,0xff,0xb5,0x26,0x24,0xa8,0xb7,0x02, - 0x12,0x00,0xb5,0xa4,0x00,0x00,0x88,0x8c,0x00,0x00,0x00,0x00, - 0x04,0x00,0x09,0x8d,0x21,0x20,0x00,0x01,0x08,0x00,0x20,0x01, - 0x00,0x00,0x00,0x00,0x00,0x80,0x0a,0x3c,0xe8,0x3a,0x4a,0x25, - 0x04,0x00,0x00,0x10,0x04,0x00,0x8a,0xac,0x24,0x00,0x86,0x8c, - 0x50,0x00,0x87,0x94,0x25,0x28,0x91,0x00,0x0a,0x00,0xb5,0x94, - 0x0c,0x00,0xb6,0x94,0x00,0x00,0x00,0x00,0x72,0x00,0xb6,0x12, - 0x00,0x00,0x00,0x00,0x38,0x00,0xc9,0x90,0x3c,0x00,0x94,0x8c, - 0x80,0xff,0x29,0x21,0x0e,0x00,0x97,0x94,0x22,0x48,0x09,0x00, - 0x21,0x40,0x96,0x02,0x08,0x00,0x20,0x19,0x00,0x00,0x00,0x00, - 0xff,0xff,0x29,0x25,0x00,0x00,0x03,0x91,0x01,0x00,0xd6,0x26, - 0x48,0x00,0xc3,0xa0,0x24,0xb0,0xd7,0x02,0xf8,0xff,0xb6,0x16, - 0x21,0x40,0x96,0x02,0x00,0x00,0x88,0x8c,0x0c,0x00,0xb6,0xa4, - 0x04,0x00,0x09,0x8d,0x21,0x20,0x00,0x01,0x08,0x00,0x20,0x01, - 0x00,0x00,0x00,0x00,0x00,0x80,0x0a,0x3c,0x6c,0x3b,0x4a,0x25, - 0x04,0x00,0x00,0x10,0x04,0x00,0x8a,0xac,0x24,0x00,0x86,0x8c, - 0x50,0x00,0x87,0x94,0x25,0x28,0x91,0x00,0x0a,0x00,0xb5,0x94, - 0x0c,0x00,0xb6,0x94,0x00,0x00,0x00,0x00,0x51,0x00,0xb6,0x12, - 0x00,0x00,0x00,0x00,0x38,0x00,0xc9,0x90,0x3c,0x00,0x94,0x8c, - 0x80,0xff,0x29,0x25,0x0e,0x00,0x97,0x94,0x2a,0x00,0x8c,0x94, - 0x63,0x00,0x8e,0x90,0x22,0x48,0x09,0x00,0x14,0x00,0x20,0x19, - 0x21,0x40,0x96,0x02,0x00,0x00,0x08,0x91,0xff,0xff,0x29,0x25, - 0x21,0x18,0x00,0x01,0x80,0x40,0x08,0x00,0x21,0x08,0x1c,0x01, - 0xb0,0x84,0x28,0x8c,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x01, - 0x00,0x00,0x00,0x00,0x02,0x00,0x88,0x31,0x02,0x00,0x00,0x11, - 0x00,0x00,0x00,0x00,0xe0,0xff,0x63,0x24,0x01,0x00,0xce,0x25, - 0x48,0x00,0xc3,0xa0,0x01,0x00,0xd6,0x26,0x24,0xb0,0xd7,0x02, - 0xec,0xff,0xb6,0x16,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0x8c, - 0x63,0x00,0x8e,0xa0,0x0c,0x00,0xb6,0xa4,0x04,0x00,0x09,0x8d, - 0x21,0x20,0x00,0x01,0x08,0x00,0x20,0x01,0x00,0x00,0x00,0x00, - 0xf3,0xff,0xc0,0x11,0x00,0x00,0x00,0x00,0xf1,0xff,0x00,0x10, - 0xff,0xff,0xce,0x25,0x20,0x00,0x8a,0x31,0x03,0x00,0x40,0x11, - 0x04,0x00,0x8a,0x31,0x00,0x00,0x0e,0x24,0x04,0x00,0x8a,0x31, - 0xea,0xff,0x40,0x11,0x00,0x00,0x00,0x00,0xed,0xff,0x20,0x11, - 0x00,0x00,0x0e,0x24,0x0d,0x00,0x0a,0x24,0xff,0xff,0x29,0x25, - 0xe4,0xff,0x00,0x10,0x48,0x00,0xca,0xa0,0x21,0x40,0xc0,0x01, - 0x08,0x00,0x8a,0x31,0x08,0x00,0x40,0x15,0x00,0x00,0x0e,0x24, - 0x10,0x00,0x8a,0x31,0xdd,0xff,0x40,0x11,0x00,0x00,0x00,0x00, - 0xdc,0xff,0x00,0x11,0x00,0x00,0x00,0x00,0xda,0xff,0x00,0x10, - 0x48,0x00,0xc3,0xa0,0xd7,0xff,0x00,0x10,0x0a,0x00,0x03,0x24, - 0x21,0x40,0xc0,0x01,0x07,0x00,0x08,0x31,0x07,0x00,0x08,0x39, - 0x2b,0x08,0x28,0x01,0xd6,0xff,0x20,0x14,0x00,0x00,0x00,0x00, - 0x08,0x00,0xce,0x25,0x23,0x48,0x28,0x01,0xf8,0xff,0xce,0x31, - 0x20,0x00,0x03,0x24,0xff,0xff,0x08,0x25,0xfe,0xff,0x01,0x05, - 0x48,0x00,0xc3,0xa0,0xca,0xff,0x00,0x10,0x01,0x00,0xd6,0x26, - 0x00,0x80,0x08,0x3c,0xbf,0xff,0xe7,0x30,0x34,0x36,0x08,0x25, - 0x4b,0x00,0x80,0xa0,0x50,0x00,0x87,0xa4,0x13,0x0e,0x00,0x08, - 0x04,0x00,0x88,0xac,0x00,0x00,0x88,0x8c,0x74,0x00,0x9f,0xac, - 0x63,0x00,0x8e,0xa0,0x0c,0x00,0xb6,0xa4,0x04,0x00,0x09,0x8d, - 0x44,0x00,0x92,0xac,0x08,0x00,0x20,0x01,0x21,0x20,0x00,0x01, - 0x00,0x80,0x0a,0x3c,0x20,0x3d,0x4a,0x25,0x49,0x00,0x88,0x90, - 0x4a,0x00,0x89,0x90,0x0e,0x00,0x00,0x10,0x04,0x00,0x8a,0xac, - 0x24,0x00,0x86,0x8c,0x50,0x00,0x87,0x94,0x08,0x00,0xc2,0x90, - 0x25,0x28,0x91,0x00,0xc0,0x47,0x02,0x00,0xd4,0xfe,0x11,0x05, - 0x42,0x42,0x07,0x00,0x44,0x00,0x92,0x8c,0x49,0x00,0x88,0x90, - 0x4a,0x00,0x89,0x90,0x23,0x90,0x50,0x02,0xc5,0xfe,0x41,0x06, - 0x00,0x00,0x00,0x00,0x18,0x00,0xca,0x90,0x0a,0x00,0xb5,0x94, - 0x0c,0x00,0xb6,0x94,0x24,0x40,0x0a,0x01,0xb9,0xfe,0x09,0x15, - 0x00,0x00,0x00,0x00,0x74,0x00,0x88,0x8c,0x40,0x00,0x93,0x8c, - 0x3c,0x00,0x94,0x8c,0x0e,0x00,0x97,0x94,0x2a,0x00,0x8c,0x94, - 0x62,0x00,0x8d,0x90,0x63,0x00,0x8e,0x90,0x09,0xf8,0x00,0x01, - 0x00,0x00,0x00,0x00,0xa5,0xfe,0xb6,0x12,0x21,0x40,0x96,0x02, - 0x00,0x00,0x03,0x91,0x01,0x00,0xd6,0x26,0x24,0x40,0x6d,0x00, - 0x80,0x40,0x08,0x00,0x21,0x08,0x1c,0x01,0xb0,0x80,0x28,0x8c, - 0x24,0xb0,0xd7,0x02,0x08,0x00,0x00,0x01,0x00,0x00,0x00,0x00, - 0x01,0x00,0xce,0x25,0x21,0x90,0x53,0x02,0xc8,0xff,0x41,0x06, - 0x00,0x00,0xc3,0xa0,0xc6,0xff,0xb6,0x12,0x21,0x40,0x96,0x02, - 0x00,0x00,0x03,0x91,0x01,0x00,0xd6,0x26,0x24,0x40,0x6d,0x00, - 0x80,0x40,0x08,0x00,0x21,0x08,0x1c,0x01,0xb0,0x80,0x28,0x8c, - 0x24,0xb0,0xd7,0x02,0x08,0x00,0x00,0x01,0x00,0x00,0x00,0x00, - 0x01,0x00,0x88,0x31,0xef,0xff,0x00,0x11,0x00,0x00,0x00,0x00, - 0x18,0x00,0x00,0x10,0x27,0x00,0x03,0x24,0x01,0x00,0x88,0x31, - 0xea,0xff,0x00,0x11,0x00,0x00,0x00,0x00,0x13,0x00,0x00,0x10, - 0x28,0x00,0x03,0x24,0x01,0x00,0x88,0x31,0xe5,0xff,0x00,0x11, - 0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x10,0x21,0x00,0x03,0x24, - 0x01,0x00,0x88,0x31,0xe0,0xff,0x00,0x11,0x00,0x00,0x00,0x00, - 0x09,0x00,0x00,0x10,0x29,0x00,0x03,0x24,0x01,0x00,0x88,0x31, - 0xdb,0xff,0x00,0x11,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x10, - 0x5e,0x00,0x03,0x24,0x01,0x00,0x88,0x31,0xd6,0xff,0x00,0x11, - 0x00,0x00,0x00,0x00,0x5c,0x00,0x08,0x24,0x21,0x90,0x53,0x02, - 0x00,0x00,0xc8,0xa0,0xd2,0xff,0x40,0x06,0x02,0x00,0xce,0x25, - 0x3a,0x0f,0x00,0x0c,0x61,0x00,0x83,0xa0,0x61,0x00,0x83,0x90, - 0xce,0xff,0x00,0x10,0x21,0x90,0x53,0x02,0x02,0x00,0x88,0x31, - 0xc9,0xff,0x00,0x11,0x00,0x00,0x00,0x00,0xc7,0xff,0x00,0x10, - 0xe0,0xff,0x63,0x24,0x02,0x00,0xc0,0x11,0x00,0x20,0x89,0x31, - 0xff,0xff,0xce,0x25,0xc3,0xff,0x20,0x11,0x02,0x00,0x08,0x24, - 0x53,0x00,0x00,0x10,0x21,0x90,0x53,0x02,0x42,0x4a,0x0c,0x00, - 0x0c,0x00,0x29,0x31,0x21,0x08,0x3c,0x01,0x30,0x89,0x29,0x8c, - 0x21,0x40,0xc0,0x01,0x08,0x00,0xce,0x25,0x08,0x00,0x20,0x01, - 0xf8,0xff,0xce,0x31,0x23,0x40,0xc8,0x01,0x05,0x00,0x01,0x29, - 0xb5,0xff,0x20,0x14,0x00,0x00,0x00,0x00,0x45,0x00,0x00,0x10, - 0x21,0x90,0x53,0x02,0x42,0x00,0x00,0x10,0x02,0x00,0x08,0x24, - 0x23,0x40,0xc8,0x01,0xff,0xff,0x08,0x25,0xad,0xff,0x00,0x19, - 0x20,0x00,0x03,0x24,0x21,0x90,0x53,0x02,0xfb,0xff,0x40,0x06, - 0x00,0x00,0xc3,0xa0,0x3a,0x0f,0x00,0x0c,0x61,0x00,0x88,0xa0, - 0x61,0x00,0x88,0x90,0xf7,0xff,0x00,0x10,0xff,0xff,0x08,0x25, - 0x00,0x40,0x89,0x31,0xa2,0xff,0x20,0x11,0x00,0x00,0x00,0x00, - 0x31,0x00,0x00,0x10,0x7f,0x00,0x08,0x24,0x00,0x80,0x89,0x31, - 0x9d,0xff,0x20,0x11,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x10, - 0x7f,0x00,0x08,0x24,0x20,0x00,0x8a,0x31,0x21,0x40,0xc0,0x01, - 0x18,0x00,0x40,0x15,0x04,0x00,0x89,0x31,0x08,0x00,0x20,0x11, - 0x0d,0x00,0x0a,0x24,0x21,0x90,0x53,0x02,0x00,0x00,0x0e,0x24, - 0x04,0x00,0x40,0x06,0x00,0x00,0xca,0xa0,0x3a,0x0f,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x0a,0x00,0x03,0x24,0x00,0x01,0x88,0x31, - 0x8b,0xff,0x00,0x11,0x00,0x00,0x00,0x00,0x1a,0x00,0x00,0x10, - 0x05,0x00,0x08,0x24,0x21,0x40,0xc0,0x01,0x08,0x00,0x89,0x31, - 0x0d,0x00,0x20,0x15,0x00,0x00,0x0e,0x24,0x10,0x00,0x8a,0x31, - 0x03,0x00,0x40,0x11,0x00,0x00,0x00,0x00,0x83,0xff,0x00,0x11, - 0x00,0x00,0x00,0x00,0xc2,0x49,0x0c,0x00,0x0c,0x00,0x29,0x31, - 0x21,0x08,0x3c,0x01,0x40,0x89,0x29,0x8c,0x00,0x00,0x0e,0x24, - 0x08,0x00,0x20,0x01,0x00,0x00,0x00,0x00,0xea,0xff,0x00,0x10, - 0x0a,0x00,0x03,0x24,0x02,0x41,0x08,0x00,0x05,0x00,0x00,0x10, - 0x03,0x00,0x08,0x25,0x03,0x00,0x00,0x10,0x05,0x00,0x08,0x24, - 0x01,0x00,0x00,0x10,0x09,0x00,0x08,0x24,0x21,0x90,0x53,0x02, - 0x05,0x00,0x40,0x06,0x00,0x00,0xc3,0xa0,0x3a,0x0f,0x00,0x0c, - 0x61,0x00,0x88,0xa0,0x61,0x00,0x88,0x90,0x00,0x00,0x00,0x00, - 0x40,0x00,0x89,0x31,0x0f,0x00,0x20,0x11,0x20,0x00,0x01,0x29, - 0x0d,0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x60,0x00,0x83,0x90, - 0x04,0x00,0x01,0x29,0x60,0xff,0x20,0x14,0x00,0x00,0x00,0x00, - 0x21,0x90,0x53,0x02,0x5d,0xff,0x40,0x06,0x00,0x00,0xc3,0xa0, - 0x3a,0x0f,0x00,0x0c,0x00,0x00,0x00,0x00,0x60,0x00,0x83,0x90, - 0x59,0xff,0x00,0x10,0x21,0x90,0x53,0x02,0x06,0x00,0x08,0x25, - 0x00,0x1e,0x09,0x24,0x19,0x00,0x09,0x01,0x12,0x40,0x00,0x00, - 0x21,0x90,0x48,0x02,0x1c,0xff,0x00,0x10,0x00,0x00,0x88,0x8c, - 0xff,0xe7,0xe7,0x30,0x42,0x42,0x07,0x00,0x7c,0x00,0x08,0x31, - 0x21,0x08,0x1c,0x01,0xb0,0x88,0x33,0x8c,0x01,0x00,0x00,0x8c, - 0x08,0x00,0x60,0x02,0x00,0x00,0x00,0x00,0x00,0x80,0x13,0x3c, - 0x5a,0x00,0xb8,0x90,0x5b,0x00,0xb9,0x90,0x5e,0x00,0x8d,0x90, - 0xb4,0x40,0x73,0x26,0xff,0xfd,0x68,0x30,0x0a,0x00,0x0d,0x15, - 0xff,0xf9,0x68,0x30,0x00,0x80,0x13,0x3c,0x30,0x42,0x73,0x26, - 0x0e,0xfe,0x00,0x10,0x00,0x08,0xe7,0x34,0x00,0x80,0x13,0x3c, - 0x5a,0x00,0xb8,0x90,0x5b,0x00,0xb9,0x90,0xe0,0x40,0x73,0x26, - 0xff,0xf9,0x68,0x30,0x05,0x00,0x18,0x11,0x00,0x00,0x00,0x00, - 0xf9,0xfd,0x19,0x15,0x00,0x00,0x00,0x00,0x13,0x00,0x00,0x10, - 0x4a,0x00,0x88,0x90,0x4a,0x00,0x88,0x90,0x00,0x00,0x00,0x00, - 0x08,0x00,0x09,0x31,0x0b,0x00,0x20,0x11,0x00,0x00,0x00,0x00, - 0xf7,0xff,0x08,0x31,0x4a,0x00,0x88,0xa0,0x54,0x00,0xa9,0x90, - 0x58,0x00,0xaa,0x90,0xfb,0xff,0x2b,0x31,0x26,0x48,0x2b,0x01, - 0x25,0x50,0x49,0x01,0x54,0x00,0xab,0xa0,0x0f,0xfe,0x00,0x10, - 0x58,0x00,0xaa,0xa0,0x0d,0xfe,0x19,0x17,0x00,0x00,0x00,0x00, - 0x4a,0x00,0x88,0x90,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x35, - 0x4a,0x00,0x88,0xa0,0x54,0x00,0xa9,0x90,0x58,0x00,0xaa,0x90, - 0x04,0x00,0x2b,0x35,0x26,0x48,0x2b,0x01,0x25,0x50,0x49,0x01, - 0x00,0x08,0x89,0x31,0x54,0x00,0xab,0xa0,0x00,0xfe,0x20,0x11, - 0x58,0x00,0xaa,0xa0,0x00,0x80,0x13,0x3c,0x00,0x10,0xe7,0x34, - 0xfc,0xfd,0x00,0x10,0x84,0x41,0x73,0x26,0x4a,0x00,0x88,0x90, - 0xff,0xef,0xe7,0x30,0xf3,0xff,0x08,0x31,0x4a,0x00,0x88,0xa0, - 0x54,0x00,0xa9,0x90,0x58,0x00,0xaa,0x90,0xfb,0xff,0x2b,0x31, - 0x26,0x48,0x2b,0x01,0x25,0x50,0x49,0x01,0x42,0x4a,0x07,0x00, - 0x7c,0x00,0x29,0x31,0x54,0x00,0xab,0xa0,0x58,0x00,0xaa,0xa0, - 0x21,0x08,0x3c,0x01,0xb0,0x88,0x33,0x8c,0x40,0x00,0x88,0x31, - 0xea,0xfd,0x00,0x15,0x00,0x00,0x00,0x00,0xff,0xfd,0x68,0x30, - 0xe7,0xfd,0x0e,0x11,0x00,0x00,0x00,0x00,0xe5,0xfd,0x0f,0x11, - 0x00,0x00,0x00,0x00,0x00,0x20,0x89,0x31,0x07,0x00,0x20,0x11, - 0x00,0x00,0x00,0x00,0x5a,0x00,0xaa,0x90,0x5b,0x00,0xab,0x90, - 0xde,0xfd,0x0a,0x11,0x00,0x00,0x00,0x00,0xdc,0xfd,0x0b,0x11, - 0x00,0x00,0x00,0x00,0x00,0x20,0x89,0x31,0xbf,0xfd,0x20,0x11, - 0x21,0x48,0x95,0x02,0x5e,0x00,0x8d,0x90,0x00,0x00,0x00,0x00, - 0xbb,0xfd,0x0d,0x15,0x21,0x48,0x95,0x02,0x00,0x80,0x13,0x3c, - 0x00,0x08,0xe7,0x34,0xb6,0xfd,0x00,0x10,0x30,0x42,0x73,0x26, - 0xff,0xf7,0xe7,0x30,0x42,0x4a,0x07,0x00,0x7c,0x00,0x29,0x31, - 0x21,0x08,0x3c,0x01,0xb0,0x88,0x33,0x8c,0xb0,0xfd,0x00,0x10, - 0x21,0x48,0x95,0x02,0x5e,0x00,0x8d,0x90,0xff,0xfd,0x68,0x30, - 0x9f,0xfd,0x0d,0x15,0x00,0x00,0x00,0x00,0x00,0x80,0x13,0x3c, - 0x00,0x08,0xe7,0x34,0xa7,0xfd,0x00,0x10,0x30,0x42,0x73,0x26, - 0x4a,0x00,0x88,0x90,0x00,0x00,0x00,0x00,0x04,0x00,0x09,0x31, - 0x0b,0x00,0x20,0x11,0x00,0x00,0x00,0x00,0xfb,0xff,0x08,0x31, - 0x4a,0x00,0x88,0xa0,0x54,0x00,0xa9,0x90,0x58,0x00,0xaa,0x90, - 0xfb,0xff,0x2b,0x31,0x26,0x48,0x2b,0x01,0x25,0x50,0x49,0x01, - 0x54,0x00,0xab,0xa0,0xb3,0xfd,0x00,0x10,0x58,0x00,0xaa,0xa0, - 0xb1,0xfd,0xcf,0x15,0x00,0x00,0x00,0x00,0x4a,0x00,0x88,0x90, - 0x00,0x00,0x00,0x00,0x04,0x00,0x08,0x35,0x4a,0x00,0x88,0xa0, - 0x54,0x00,0xa9,0x90,0x58,0x00,0xaa,0x90,0x04,0x00,0x2b,0x35, - 0x26,0x48,0x2b,0x01,0x25,0x50,0x49,0x01,0x00,0x08,0x89,0x31, - 0x54,0x00,0xab,0xa0,0xa4,0xfd,0x20,0x11,0x58,0x00,0xaa,0xa0, - 0x00,0x80,0x13,0x3c,0x00,0x10,0xe7,0x34,0xa0,0xfd,0x00,0x10, - 0x84,0x41,0x73,0x26,0xc2,0x51,0x03,0x00,0x3c,0x00,0x4a,0x31, - 0x21,0x08,0x5c,0x01,0xc0,0x92,0x28,0x8c,0x21,0x08,0x5c,0x01, - 0x00,0x10,0x6a,0x30,0x01,0x00,0x08,0x25,0x0e,0x00,0x40,0x11, - 0xc0,0x92,0x28,0xac,0x01,0x00,0x8b,0x31,0x94,0xfd,0x60,0x15, - 0x00,0x00,0x00,0x00,0x02,0x00,0x8a,0x31,0x03,0x00,0x40,0x15, - 0x00,0x00,0x00,0x00,0x15,0x00,0x00,0x10,0x00,0x10,0x03,0x24, - 0x4f,0x00,0xa8,0x90,0x00,0x00,0x00,0x00,0x01,0x00,0x08,0x35, - 0x8a,0xfd,0x00,0x10,0x4f,0x00,0xa8,0xa0,0x04,0x00,0x88,0x31, - 0x87,0xfd,0x00,0x15,0x00,0x00,0x00,0x00,0x00,0x02,0x6a,0x30, - 0x0b,0x00,0x40,0x11,0x08,0x00,0x88,0x31,0x4f,0x00,0xa8,0x90, - 0xff,0xfd,0x63,0x30,0xff,0x00,0x0b,0x24,0x2a,0x08,0x6b,0x00, - 0x80,0x00,0x08,0x35,0x66,0xfd,0x20,0x14,0x4f,0x00,0xa8,0xa0, - 0x6d,0xfd,0x6b,0x10,0x00,0x00,0x00,0x00,0x08,0x00,0x88,0x31, - 0x07,0x00,0x00,0x15,0x00,0x00,0x00,0x00,0x01,0x00,0xb5,0x26, - 0x24,0xa8,0xb7,0x02,0x74,0xfd,0xb6,0x16,0x00,0x00,0x20,0xa1, - 0x1a,0x00,0x00,0x10,0xff,0xff,0xb5,0x26,0x01,0x00,0xb5,0x26, - 0xff,0x00,0x08,0x24,0x24,0xa8,0xb7,0x02,0x14,0x00,0xb6,0x12, - 0x00,0x00,0x28,0xa1,0x00,0x80,0x89,0x31,0x02,0x00,0x20,0x11, - 0x00,0x00,0x08,0x24,0x02,0x42,0x03,0x00,0x21,0x48,0x95,0x02, - 0x01,0x00,0xb5,0x26,0x24,0xa8,0xb7,0x02,0x09,0x00,0xb6,0x12, - 0x00,0x00,0x28,0xa1,0x21,0x48,0x95,0x02,0x01,0x00,0xb5,0x26, - 0x24,0xa8,0xb7,0x02,0x5f,0xfd,0xb6,0x16,0x00,0x00,0x23,0xa1, - 0x02,0x00,0x00,0x10,0xff,0xff,0xb5,0x26,0xff,0xff,0xb5,0x26, - 0xff,0xff,0xb5,0x26,0x24,0xb0,0xb7,0x02,0xff,0xff,0xb5,0x26, - 0x4f,0x00,0xa8,0x90,0x24,0xa8,0xb7,0x02,0x40,0x00,0x08,0x35, - 0x4f,0x00,0xa8,0xa0,0x24,0x00,0x86,0x8c,0x25,0x28,0x91,0x00, - 0x78,0x00,0xc8,0x90,0x58,0x00,0xaa,0x90,0x21,0x48,0x00,0x01, - 0x20,0x00,0x29,0x31,0x80,0x48,0x09,0x00,0x50,0x00,0x08,0x31, - 0x25,0x40,0x09,0x01,0x70,0x00,0xc9,0x90,0x00,0x00,0x00,0x00, - 0x42,0x48,0x09,0x00,0x20,0x00,0x29,0x31,0x20,0x00,0x29,0x39, - 0x25,0x40,0x09,0x01,0x54,0x00,0xa9,0x90,0x00,0x00,0x00,0x00, - 0x26,0x40,0x09,0x01,0xf0,0x00,0x08,0x31,0x26,0x48,0x28,0x01, - 0x54,0x00,0xa9,0xa0,0x56,0x00,0xa9,0x90,0x00,0x00,0x00,0x00, - 0x24,0x48,0x28,0x01,0x25,0x50,0x49,0x01,0x08,0x00,0xe0,0x03, - 0x58,0x00,0xaa,0xa0,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x3c, - 0xa8,0x44,0x08,0x25,0x00,0xa0,0x01,0x3c,0x25,0x40,0x01,0x01, - 0x08,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x60,0x04,0x40, - 0x00,0x00,0x00,0x00,0x01,0x00,0x05,0x3c,0x00,0x60,0x85,0x40, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x09,0x3c, - 0x01,0x00,0x01,0x3c,0x23,0x40,0x21,0x01,0x03,0x00,0x00,0xa1, - 0x04,0x00,0x08,0x25,0xfd,0xff,0x09,0x15,0x00,0x00,0x00,0x00, - 0x03,0x00,0x05,0x3c,0x00,0x60,0x85,0x40,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xa0,0x09,0x3c,0x01,0x00,0x01,0x3c, - 0x23,0x40,0x21,0x01,0x03,0x00,0x00,0xa1,0x04,0x00,0x08,0x25, - 0xfd,0xff,0x09,0x15,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x60,0x84,0x40,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0x04,0x40,0xff,0xff,0x08,0x3c, - 0xff,0x3f,0x08,0x35,0x24,0x20,0x88,0x00,0x00,0x10,0x84,0x40, - 0x01,0x80,0x08,0x3c,0xfc,0xff,0x01,0x24,0x01,0x80,0x09,0x3c, - 0x50,0x86,0x08,0x25,0x80,0x95,0x29,0x25,0x24,0x40,0x01,0x01, - 0x24,0x48,0x21,0x01,0x04,0x00,0x08,0x25,0xfe,0xff,0x09,0x15, - 0xfc,0xff,0x00,0xad,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0x00,0x60,0x02,0x40,0xff,0xff,0x01,0x3c,0xfe,0x00,0x21,0x34, - 0x25,0x20,0x81,0x00,0x24,0x40,0x44,0x00,0x00,0x60,0x88,0x40, - 0x08,0x00,0xe0,0x03,0x01,0xff,0x42,0x30,0x00,0x60,0x02,0x40, - 0x00,0x00,0x00,0x00,0x26,0x40,0x44,0x00,0x01,0xff,0x08,0x31, - 0x26,0x40,0x02,0x01,0x00,0x60,0x88,0x40,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0x00,0x60,0x08,0x40,0x00,0x00,0x00,0x00, - 0xfe,0xff,0x01,0x24,0x24,0x48,0x01,0x01,0x00,0x60,0x89,0x40, - 0x00,0x68,0x02,0x40,0x00,0x03,0x84,0x30,0x25,0x18,0x44,0x00, - 0x00,0x68,0x83,0x40,0x00,0x60,0x88,0x40,0x08,0x00,0xe0,0x03, - 0x24,0x10,0x44,0x00,0x00,0x60,0x08,0x40,0x00,0x03,0x84,0x30, - 0xfe,0xff,0x01,0x24,0x24,0x48,0x01,0x01,0x00,0x60,0x89,0x40, - 0x00,0x68,0x02,0x40,0x27,0x18,0x80,0x00,0x24,0x18,0x62,0x00, - 0x00,0x68,0x83,0x40,0x00,0x60,0x88,0x40,0x08,0x00,0xe0,0x03, - 0x24,0x10,0x44,0x00,0x40,0x10,0x08,0x3c,0x00,0x60,0x88,0x40, - 0xc0,0xbf,0x08,0x3c,0x08,0x00,0x00,0x01,0x00,0x00,0x00,0x00, - 0x00,0x60,0x08,0x40,0x00,0x00,0x00,0x00,0xff,0xff,0x09,0x3c, - 0xfe,0x00,0x29,0x35,0x00,0x00,0x00,0x00,0x24,0x40,0x09,0x01, - 0x00,0x00,0x00,0x00,0x25,0x40,0x04,0x01,0x00,0x00,0x00,0x00, - 0x00,0x60,0x88,0x40,0x00,0x00,0x00,0x00,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x21,0x18,0xa0,0x00,0xe0,0xff,0xbd,0x27,0x17,0x00,0x61,0x2c, - 0x14,0x00,0xbf,0xaf,0xb1,0x00,0x20,0x10,0x21,0x38,0x80,0x00, - 0x80,0x70,0x03,0x00,0x00,0x80,0x01,0x3c,0x21,0x08,0x2e,0x00, - 0xe0,0x7a,0x2e,0x8c,0x00,0x00,0x00,0x00,0x08,0x00,0xc0,0x01, - 0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x3c,0x1a,0x00,0xe6,0xa4, - 0x25,0x18,0xe1,0x00,0x12,0x00,0x6f,0x94,0x14,0x00,0x78,0x94, - 0x16,0x00,0xe8,0x94,0x23,0xc8,0xf8,0x01,0x24,0x48,0x28,0x03, - 0x2b,0x08,0x26,0x01,0xa2,0x00,0x20,0x10,0x01,0x00,0x02,0x24, - 0x6c,0x1a,0x00,0x0c,0x21,0x20,0xe0,0x00,0x9e,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x00,0x20,0x01,0x3c,0x1c,0x00,0xe6,0xa4, - 0x25,0x18,0xe1,0x00,0x12,0x00,0x6a,0x94,0x14,0x00,0x6b,0x94, - 0x16,0x00,0xed,0x94,0x23,0x60,0x4b,0x01,0x24,0x70,0x8d,0x01, - 0x2b,0x08,0xce,0x00,0x93,0x00,0x20,0x10,0x01,0x00,0x02,0x24, - 0x36,0x1a,0x00,0x0c,0x21,0x20,0xe0,0x00,0x8f,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x80,0x92,0x84,0x8f,0x58,0x11,0x00,0x0c, - 0x20,0x00,0xa7,0xaf,0x20,0x00,0xa7,0x8f,0x00,0x20,0x01,0x3c, - 0x25,0x18,0xe1,0x00,0x0a,0x00,0x6f,0x94,0x21,0x20,0x40,0x00, - 0x60,0x11,0x00,0x0c,0x0c,0x00,0x6f,0xa4,0x83,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x80,0x92,0x84,0x8f,0x58,0x11,0x00,0x0c, - 0x20,0x00,0xa7,0xaf,0x20,0x00,0xa7,0x8f,0x21,0x20,0x40,0x00, - 0x4a,0x00,0xf8,0x90,0x00,0x00,0x00,0x00,0x04,0x00,0x19,0x37, - 0x60,0x11,0x00,0x0c,0x4a,0x00,0xf9,0xa0,0x77,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x80,0x92,0x84,0x8f,0x58,0x11,0x00,0x0c, - 0x20,0x00,0xa7,0xaf,0x20,0x00,0xa7,0x8f,0x21,0x20,0x40,0x00, - 0x4a,0x00,0xe8,0x90,0x00,0x00,0x00,0x00,0xf3,0x00,0x09,0x31, - 0x60,0x11,0x00,0x0c,0x4a,0x00,0xe9,0xa0,0x6b,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x00,0x20,0x01,0x3c,0x25,0x18,0xe1,0x00, - 0x5a,0x00,0x66,0xa0,0x02,0x52,0x06,0x00,0x64,0x00,0x00,0x10, - 0x5b,0x00,0x6a,0xa0,0x04,0x00,0xc0,0x10,0x19,0x00,0x03,0x24, - 0x02,0x00,0x00,0x10,0x21,0x18,0xc0,0x00,0x19,0x00,0x03,0x24, - 0x21,0x20,0xe0,0x00,0x66,0x1b,0x00,0x0c,0x21,0x28,0x60,0x00, - 0x5b,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x68,0x00,0xeb,0x90, - 0x02,0x62,0x06,0x00,0x27,0x68,0x80,0x01,0xff,0x00,0xcf,0x30, - 0x24,0x70,0x6d,0x01,0x25,0x30,0xcf,0x01,0x21,0x28,0xc0,0x00, - 0x93,0x1b,0x00,0x0c,0x21,0x20,0xe0,0x00,0x50,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x21,0x20,0xe0,0x00,0xfe,0x1a,0x00,0x0c, - 0x21,0x28,0xc0,0x00,0x4b,0x00,0x00,0x10,0x01,0x00,0x02,0x24, - 0x02,0xc2,0x06,0x00,0x5c,0x00,0xe6,0xa0,0x46,0x00,0x00,0x10, - 0x5d,0x00,0xf8,0xa0,0x44,0x00,0x00,0x10,0x18,0x00,0xe6,0xa4, - 0x36,0x1a,0x00,0x0c,0x21,0x20,0xe0,0x00,0x41,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x6c,0x1a,0x00,0x0c,0x21,0x20,0xe0,0x00, - 0x3d,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x80,0x92,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x20,0x00,0xa7,0xaf,0x20,0x00,0xa7,0x8f, - 0x21,0x18,0x40,0x00,0x1c,0x00,0xa3,0xaf,0x01,0x1c,0x00,0x0c, - 0x21,0x20,0xe0,0x00,0x1c,0x00,0xa3,0x8f,0x60,0x11,0x00,0x0c, - 0x21,0x20,0x60,0x00,0x30,0x00,0x00,0x10,0x01,0x00,0x02,0x24, - 0x21,0x20,0xe0,0x00,0x3c,0x1b,0x00,0x0c,0x21,0x28,0xc0,0x00, - 0x2b,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x5f,0x00,0xf9,0x90, - 0x02,0x42,0x06,0x00,0x27,0x48,0x00,0x01,0xff,0x00,0xcc,0x30, - 0x24,0x50,0x29,0x03,0x25,0x30,0x4c,0x01,0x21,0x28,0xc0,0x00, - 0xca,0x1b,0x00,0x0c,0x21,0x20,0xe0,0x00,0x20,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x21,0x20,0xe0,0x00,0xa1,0x1a,0x00,0x0c, - 0x21,0x28,0xc0,0x00,0x1b,0x00,0x00,0x10,0x01,0x00,0x02,0x24, - 0x80,0x92,0x84,0x8f,0x28,0x00,0xa6,0xaf,0x58,0x11,0x00,0x0c, - 0x20,0x00,0xa7,0xaf,0x28,0x00,0xa6,0x8f,0x20,0x00,0xa7,0x8f, - 0xff,0x00,0xcb,0x30,0x21,0x18,0x40,0x00,0x06,0x00,0x60,0x11, - 0x5e,0x00,0xe6,0xa0,0x50,0x00,0xed,0x94,0x00,0x00,0x00,0x00, - 0x00,0x20,0xae,0x35,0x05,0x00,0x00,0x10,0x50,0x00,0xee,0xa4, - 0x50,0x00,0xef,0x94,0x00,0x00,0x00,0x00,0xff,0xd7,0xf8,0x31, - 0x50,0x00,0xf8,0xa4,0x60,0x11,0x00,0x0c,0x21,0x20,0x60,0x00, - 0x04,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x02,0x00,0x00,0x10, - 0x21,0x10,0x00,0x00,0x01,0x00,0x02,0x24,0x14,0x00,0xbf,0x8f, - 0x20,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xe0,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf,0x21,0x38,0x80,0x00, - 0x48,0x00,0xe2,0x90,0x21,0x18,0xa0,0x00,0x08,0x00,0x41,0x2c, - 0x07,0x00,0x20,0x10,0x08,0x00,0x01,0x24,0x21,0x20,0xe0,0x00, - 0x94,0x11,0x00,0x0c,0x21,0x28,0x60,0x00,0xc9,0x00,0x00,0x10, - 0x14,0x00,0xbf,0x8f,0x08,0x00,0x01,0x24,0x0d,0x00,0x41,0x14, - 0x00,0x00,0x00,0x00,0x65,0x00,0xee,0x90,0x00,0x00,0x00,0x00, - 0x80,0x78,0x0e,0x00,0x23,0x78,0xee,0x01,0x80,0x78,0x0f,0x00, - 0x23,0x78,0xee,0x01,0x80,0x78,0x0f,0x00,0x21,0x08,0xfc,0x01, - 0x38,0x94,0x38,0x8c,0x04,0x00,0x01,0x24,0x04,0x00,0x01,0x13, - 0x21,0x28,0x60,0x00,0xb7,0x00,0x00,0x10,0x01,0x00,0x02,0x24, - 0x21,0x28,0x60,0x00,0x17,0x00,0xa1,0x2c,0xb0,0x00,0x20,0x10, - 0x00,0x00,0x00,0x00,0x80,0xc8,0x05,0x00,0x00,0x80,0x01,0x3c, - 0x21,0x08,0x39,0x00,0x3c,0x7b,0x39,0x8c,0x00,0x00,0x00,0x00, - 0x08,0x00,0x20,0x03,0x00,0x00,0x00,0x00,0x00,0x20,0x01,0x3c, - 0x1a,0x00,0xe6,0xa4,0x25,0x18,0xe1,0x00,0x12,0x00,0x68,0x94, - 0x14,0x00,0x69,0x94,0x16,0x00,0xeb,0x94,0x23,0x50,0x09,0x01, - 0x24,0x60,0x4b,0x01,0x2b,0x08,0x86,0x01,0xa1,0x00,0x20,0x10, - 0x01,0x00,0x02,0x24,0xb3,0x1c,0x00,0x0c,0x21,0x20,0xe0,0x00, - 0x9d,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x00,0x20,0x01,0x3c, - 0x1c,0x00,0xe6,0xa4,0x25,0x18,0xe1,0x00,0x12,0x00,0x6d,0x94, - 0x14,0x00,0x6e,0x94,0x16,0x00,0xf8,0x94,0x23,0x78,0xae,0x01, - 0x24,0xc8,0xf8,0x01,0x2b,0x08,0xd9,0x00,0x92,0x00,0x20,0x10, - 0x01,0x00,0x02,0x24,0x8a,0x1c,0x00,0x0c,0x21,0x20,0xe0,0x00, - 0x8e,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x80,0x92,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x20,0x00,0xa7,0xaf,0x20,0x00,0xa7,0x8f, - 0x00,0x20,0x01,0x3c,0x25,0x18,0xe1,0x00,0x0a,0x00,0x68,0x94, - 0x21,0x20,0x40,0x00,0x60,0x11,0x00,0x0c,0x0c,0x00,0x68,0xa4, - 0x82,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x80,0x92,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x20,0x00,0xa7,0xaf,0x20,0x00,0xa7,0x8f, - 0x21,0x20,0x40,0x00,0x4a,0x00,0xe9,0x90,0x00,0x00,0x00,0x00, - 0x04,0x00,0x2a,0x35,0x60,0x11,0x00,0x0c,0x4a,0x00,0xea,0xa0, - 0x76,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x80,0x92,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x20,0x00,0xa7,0xaf,0x20,0x00,0xa7,0x8f, - 0x21,0x20,0x40,0x00,0x4a,0x00,0xeb,0x90,0x00,0x00,0x00,0x00, - 0xf3,0x00,0x6c,0x31,0x60,0x11,0x00,0x0c,0x4a,0x00,0xec,0xa0, - 0x6a,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x00,0x20,0x01,0x3c, - 0x25,0x18,0xe1,0x00,0x5a,0x00,0x66,0xa0,0x02,0x6a,0x06,0x00, - 0x63,0x00,0x00,0x10,0x5b,0x00,0x6d,0xa0,0x04,0x00,0xc0,0x10, - 0x19,0x00,0x05,0x24,0x02,0x00,0x00,0x10,0x21,0x28,0xc0,0x00, - 0x19,0x00,0x05,0x24,0x88,0x1c,0x00,0x0c,0x21,0x20,0xe0,0x00, - 0x5b,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x68,0x00,0xee,0x90, - 0x02,0x7a,0x06,0x00,0x27,0xc0,0xe0,0x01,0xff,0x00,0xc8,0x30, - 0x24,0xc8,0xd8,0x01,0x25,0x30,0x28,0x03,0x21,0x28,0xc0,0x00, - 0xcc,0x1d,0x00,0x0c,0x21,0x20,0xe0,0x00,0x50,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x21,0x20,0xe0,0x00,0x63,0x1d,0x00,0x0c, - 0x21,0x28,0xc0,0x00,0x4b,0x00,0x00,0x10,0x01,0x00,0x02,0x24, - 0x02,0x4a,0x06,0x00,0x5c,0x00,0xe6,0xa0,0x46,0x00,0x00,0x10, - 0x5d,0x00,0xe9,0xa0,0x44,0x00,0x00,0x10,0x18,0x00,0xe6,0xa4, - 0x8a,0x1c,0x00,0x0c,0x21,0x20,0xe0,0x00,0x41,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0xb3,0x1c,0x00,0x0c,0x21,0x20,0xe0,0x00, - 0x3d,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x80,0x92,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x20,0x00,0xa7,0xaf,0x20,0x00,0xa7,0x8f, - 0x21,0x18,0x40,0x00,0x1c,0x00,0xa3,0xaf,0xdb,0x1d,0x00,0x0c, - 0x21,0x20,0xe0,0x00,0x1c,0x00,0xa3,0x8f,0x60,0x11,0x00,0x0c, - 0x21,0x20,0x60,0x00,0x30,0x00,0x00,0x10,0x01,0x00,0x02,0x24, - 0x21,0x20,0xe0,0x00,0x98,0x1d,0x00,0x0c,0x21,0x28,0xc0,0x00, - 0x2b,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x5f,0x00,0xea,0x90, - 0x02,0x5a,0x06,0x00,0x27,0x60,0x60,0x01,0xff,0x00,0xcf,0x30, - 0x24,0x68,0x4c,0x01,0x25,0x30,0xaf,0x01,0x21,0x28,0xc0,0x00, - 0xdb,0x1c,0x00,0x0c,0x21,0x20,0xe0,0x00,0x20,0x00,0x00,0x10, - 0x01,0x00,0x02,0x24,0x21,0x20,0xe0,0x00,0x72,0x1d,0x00,0x0c, - 0x21,0x28,0xc0,0x00,0x1b,0x00,0x00,0x10,0x01,0x00,0x02,0x24, - 0x80,0x92,0x84,0x8f,0x28,0x00,0xa6,0xaf,0x58,0x11,0x00,0x0c, - 0x20,0x00,0xa7,0xaf,0x28,0x00,0xa6,0x8f,0x20,0x00,0xa7,0x8f, - 0xff,0x00,0xce,0x30,0x21,0x18,0x40,0x00,0x06,0x00,0xc0,0x11, - 0x5e,0x00,0xe6,0xa0,0x50,0x00,0xf8,0x94,0x00,0x00,0x00,0x00, - 0x00,0x20,0x19,0x37,0x05,0x00,0x00,0x10,0x50,0x00,0xf9,0xa4, - 0x50,0x00,0xe8,0x94,0x00,0x00,0x00,0x00,0xff,0xd7,0x09,0x31, - 0x50,0x00,0xe9,0xa4,0x60,0x11,0x00,0x0c,0x21,0x20,0x60,0x00, - 0x04,0x00,0x00,0x10,0x01,0x00,0x02,0x24,0x02,0x00,0x00,0x10, - 0x21,0x10,0x00,0x00,0x01,0x00,0x02,0x24,0x14,0x00,0xbf,0x8f, - 0x20,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xa0,0xff,0xbd,0x27,0x1c,0x00,0xbf,0xaf,0x18,0x00,0xb1,0xaf, - 0x00,0xa3,0x0e,0x3c,0x10,0x0d,0xc7,0x95,0x00,0xa3,0x0f,0x3c, - 0x12,0x0d,0xf1,0x95,0xfc,0x03,0xe7,0x30,0xfc,0x03,0x31,0x32, - 0x51,0x00,0xf1,0x10,0x1c,0x00,0xbf,0x8f,0x3c,0x00,0xb2,0xaf, - 0x34,0x00,0xb4,0xaf,0x30,0x00,0xb5,0xaf,0x28,0x00,0xb7,0xaf, - 0x24,0x00,0xbe,0xaf,0x00,0xa3,0x1e,0x3c,0x00,0xa3,0x17,0x3c, - 0x00,0x83,0x15,0x3c,0x00,0xa3,0x14,0x3c,0x00,0xa3,0x12,0x3c, - 0x38,0x00,0xb3,0xaf,0x2c,0x00,0xb6,0xaf,0x10,0x94,0x96,0x27, - 0x54,0x00,0xb3,0x27,0x18,0x0d,0x52,0x36,0x00,0x04,0x94,0x36, - 0x00,0x10,0xb5,0x36,0x1a,0x0d,0xf7,0x36,0x00,0x08,0xde,0x37, - 0x40,0x00,0xb0,0xaf,0x83,0xc0,0x11,0x00,0x80,0xc8,0x18,0x00, - 0x21,0x80,0x99,0x02,0x03,0x00,0x01,0x8a,0x00,0x00,0x01,0x9a, - 0x00,0x00,0x00,0x00,0x03,0x00,0x61,0xaa,0x00,0x00,0x61,0xba, - 0x55,0x00,0xa9,0x93,0x08,0x94,0x8b,0x8f,0xc0,0x51,0x09,0x00, - 0x2b,0x08,0x2b,0x01,0x11,0x00,0x20,0x10,0x21,0x20,0xaa,0x02, - 0x5c,0x00,0xa7,0xaf,0x65,0x00,0x8c,0x90,0x54,0x00,0xa5,0x93, - 0x80,0x68,0x0c,0x00,0x23,0x68,0xac,0x01,0x80,0x68,0x0d,0x00, - 0x23,0x68,0xac,0x01,0x80,0x68,0x0d,0x00,0x21,0x70,0xcd,0x02, - 0x10,0x00,0xcf,0x8d,0x56,0x00,0xa6,0x97,0x09,0xf8,0xe0,0x01, - 0x1f,0x00,0xa5,0x30,0x5c,0x00,0xa7,0x8f,0x10,0x00,0x40,0x14, - 0x00,0x00,0x00,0x00,0x00,0x00,0x42,0x96,0x03,0x00,0x01,0x8a, - 0xfc,0x03,0x42,0x30,0x83,0xc0,0x02,0x00,0x00,0x00,0xe3,0x96, - 0x00,0x00,0x01,0x9a,0x80,0xc8,0x18,0x00,0x21,0x40,0xd9,0x03, - 0x04,0x00,0x42,0x24,0xfc,0x03,0x42,0x30,0xfc,0x03,0x63,0x30, - 0x03,0x00,0x01,0xa9,0x02,0x00,0x43,0x10,0x00,0x00,0x01,0xb9, - 0x00,0x00,0x42,0xa6,0x04,0x00,0x31,0x26,0xfc,0x03,0x31,0x32, - 0x00,0xa3,0x09,0x3c,0xcf,0xff,0xf1,0x14,0x12,0x0d,0x31,0xa5, - 0x40,0x00,0xb0,0x8f,0x3c,0x00,0xb2,0x8f,0x38,0x00,0xb3,0x8f, - 0x34,0x00,0xb4,0x8f,0x30,0x00,0xb5,0x8f,0x2c,0x00,0xb6,0x8f, - 0x28,0x00,0xb7,0x8f,0x24,0x00,0xbe,0x8f,0x00,0x00,0x00,0x00, - 0x1c,0x00,0xbf,0x8f,0x18,0x00,0xb1,0x8f,0x08,0x00,0xe0,0x03, - 0x60,0x00,0xbd,0x27,0x78,0xff,0xbd,0x27,0x2c,0x00,0xbf,0xaf, - 0xc0,0x94,0x84,0x8f,0x28,0x00,0xb7,0xaf,0x24,0x00,0xb5,0xaf, - 0x60,0x11,0x00,0x0c,0x20,0x00,0xb0,0xaf,0x00,0xa3,0x0e,0x3c, - 0x30,0x0c,0xcf,0x91,0x00,0x00,0x00,0x00,0x08,0x00,0xe0,0x11, - 0x00,0x00,0x00,0x00,0x00,0xa3,0x18,0x3c,0x32,0x0c,0x19,0x93, - 0x00,0x00,0x00,0x00,0x03,0x00,0x20,0x17,0x00,0x00,0x00,0x00, - 0x64,0x17,0x00,0x0c,0x00,0x00,0x00,0x00,0x90,0x92,0x88,0x8f, - 0x08,0x94,0x8a,0x8f,0x00,0xa3,0x09,0x3c,0x6c,0x00,0xa8,0xaf, - 0x12,0x0d,0x35,0x95,0x00,0x83,0x17,0x3c,0x00,0x10,0xf7,0x36, - 0xd7,0x00,0x40,0x19,0x78,0x00,0xa0,0xaf,0x34,0x00,0xbe,0xaf, - 0x00,0xa3,0x1e,0x3c,0xe8,0x94,0x8b,0x27,0x4c,0x00,0xab,0xaf, - 0x10,0x0d,0xde,0x37,0x48,0x00,0xb1,0xaf,0x44,0x00,0xb2,0xaf, - 0x40,0x00,0xb3,0xaf,0x3c,0x00,0xb4,0xaf,0x38,0x00,0xb6,0xaf, - 0x00,0x20,0x01,0x3c,0x25,0x90,0xe1,0x02,0x0a,0x00,0x53,0x96, - 0x0c,0x00,0x54,0x96,0x4f,0x00,0x4c,0x92,0x70,0x00,0x4d,0x96, - 0x78,0x00,0xaf,0x8f,0x54,0x89,0x98,0x8f,0x2f,0x00,0xae,0x35, - 0x2a,0x08,0xf8,0x01,0x0a,0x00,0x20,0x10,0x24,0xb0,0x8e,0x01, - 0x50,0x89,0x99,0x8f,0x00,0x00,0x00,0x00,0x2a,0x08,0xf9,0x01, - 0x05,0x00,0x20,0x14,0x00,0x00,0x00,0x00,0x0e,0x00,0xe9,0x96, - 0xff,0xff,0x88,0x26,0x24,0x98,0x09,0x01,0x0a,0x00,0x53,0xa6, - 0x12,0x00,0x74,0x12,0x00,0x00,0x00,0x00,0x50,0x00,0xea,0x96, - 0x00,0x00,0x00,0x00,0x40,0x00,0x4b,0x31,0x0d,0x00,0x60,0x15, - 0x00,0x00,0x00,0x00,0x80,0x92,0x84,0x8f,0x00,0x80,0x10,0x3c, - 0x58,0x11,0x00,0x0c,0xa4,0x35,0x10,0x26,0x50,0x00,0xec,0x96, - 0x01,0x00,0x0d,0x24,0x40,0x00,0x8e,0x35,0x4b,0x00,0xed,0xa2, - 0x50,0x00,0xee,0xa6,0x04,0x00,0xf0,0xae,0x60,0x11,0x00,0x0c, - 0x21,0x20,0x40,0x00,0x4c,0x00,0x58,0x92,0x00,0x00,0x00,0x00, - 0x05,0x00,0x00,0x13,0x00,0x00,0x00,0x00,0x03,0x00,0x74,0x16, - 0x00,0x00,0x00,0x00,0x04,0x00,0xd6,0x36,0x4c,0x00,0x40,0xa2, - 0x4d,0x00,0x4f,0x92,0x00,0x00,0x00,0x00,0x0a,0x00,0xe0,0x11, - 0x00,0x00,0x00,0x00,0x0e,0x00,0xe8,0x96,0x18,0x00,0xea,0x96, - 0x23,0xc8,0x74,0x02,0x24,0x48,0x28,0x03,0x2b,0x08,0x49,0x01, - 0x03,0x00,0x20,0x14,0x00,0x00,0x00,0x00,0x02,0x00,0xd6,0x36, - 0x4d,0x00,0x40,0xa2,0x50,0x00,0xeb,0x96,0x12,0x00,0x53,0x96, - 0x14,0x00,0x54,0x96,0x01,0x00,0x6d,0x31,0x0a,0x00,0xa0,0x11, - 0x00,0x00,0x00,0x00,0x16,0x00,0xee,0x96,0x1a,0x00,0xef,0x96, - 0x23,0x60,0x74,0x02,0x24,0xc0,0x8e,0x01,0x2b,0x08,0x0f,0x03, - 0x03,0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x6c,0x1a,0x00,0x0c, - 0x21,0x20,0xe0,0x02,0x4e,0x00,0x59,0x92,0x00,0x00,0x00,0x00, - 0x1d,0x00,0x20,0x13,0x4c,0x00,0xa9,0x8f,0x1b,0x00,0x74,0x12, - 0x4c,0x00,0xa9,0x8f,0x16,0x00,0xe2,0x96,0x23,0x40,0x74,0x02, - 0x24,0x48,0x02,0x01,0x42,0x50,0x02,0x00,0x2b,0x08,0x49,0x01, - 0x0f,0x00,0x20,0x14,0x00,0x00,0x00,0x00,0x6c,0x00,0xab,0x8f, - 0x20,0x00,0x4d,0x96,0x22,0x00,0x58,0x96,0x23,0x60,0x6d,0x01, - 0xff,0xff,0x8e,0x31,0x2b,0x08,0xd8,0x01,0x07,0x00,0x20,0x10, - 0x00,0x00,0x00,0x00,0x4c,0x00,0xaf,0x8f,0x00,0x00,0x00,0x00, - 0x00,0x00,0xf9,0x95,0x00,0x00,0x00,0x00,0x06,0x00,0x79,0x16, - 0x4c,0x00,0xa9,0x8f,0x4e,0x00,0x40,0xa2,0x6c,0x00,0xa8,0x8f, - 0x08,0x00,0xd6,0x36,0x20,0x00,0x48,0xa6,0x4c,0x00,0xa9,0x8f, - 0x00,0x00,0x00,0x00,0x00,0x00,0x33,0xa5,0x54,0x00,0x4a,0x92, - 0x57,0x00,0x4b,0x92,0x56,0x00,0x4c,0x92,0x58,0x00,0x58,0x92, - 0x26,0x68,0x4b,0x01,0x24,0x70,0xac,0x01,0x25,0x78,0xd8,0x01, - 0x02,0x00,0xe0,0x11,0x00,0x00,0x00,0x00,0x20,0x00,0xd6,0x36, - 0x33,0x00,0xc0,0x12,0x00,0x00,0x00,0x00,0x00,0xa3,0x19,0x3c, - 0x18,0x0d,0x33,0x97,0x00,0xa3,0x08,0x3c,0xfc,0x03,0x73,0x32, - 0x1a,0x0d,0x14,0x95,0x83,0x88,0x13,0x00,0x00,0xa3,0x01,0x3c, - 0x04,0x00,0x73,0x26,0x00,0x08,0x21,0x34,0x80,0x88,0x11,0x00, - 0xfc,0x03,0x73,0x32,0xfc,0x03,0x94,0x32,0x0c,0x00,0x74,0x16, - 0x21,0x88,0x21,0x02,0x80,0x92,0x84,0x8f,0x58,0x11,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x4f,0x00,0x49,0x92,0xff,0x00,0xca,0x32, - 0x25,0x58,0x2a,0x01,0x4f,0x00,0x4b,0xa2,0x60,0x11,0x00,0x0c, - 0x21,0x20,0x40,0x00,0x1e,0x00,0x00,0x10,0x00,0x00,0xc9,0x97, - 0x78,0x00,0xad,0x8f,0x00,0x00,0x00,0x00,0x00,0x00,0x2d,0xa2, - 0x01,0x00,0x36,0xa2,0x57,0x00,0x50,0x92,0x00,0x00,0x00,0x00, - 0x03,0x00,0x30,0xa2,0x80,0x92,0x84,0x8f,0x58,0x11,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x54,0x00,0x4c,0x92,0x58,0x00,0x58,0x92, - 0x26,0x70,0x90,0x01,0x58,0x00,0x40,0xa2,0x25,0x78,0xd8,0x01, - 0x26,0x80,0x0f,0x02,0x4f,0x00,0x40,0xa2,0x60,0x11,0x00,0x0c, - 0x21,0x20,0x40,0x00,0xff,0x00,0x02,0x32,0x02,0x00,0x22,0xa2, - 0x57,0x00,0x42,0xa2,0x00,0xa3,0x19,0x3c,0x04,0x00,0x00,0x10, - 0x18,0x0d,0x33,0xa7,0x54,0x00,0x48,0x92,0x00,0x00,0x00,0x00, - 0x57,0x00,0x48,0xa2,0x00,0x00,0xc9,0x97,0x00,0x00,0x00,0x00, - 0x0a,0x00,0xa9,0x12,0x78,0x00,0xad,0x8f,0x29,0x13,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x00,0xa3,0x0a,0x3c,0x12,0x0d,0x55,0x95, - 0x00,0x00,0xcb,0x97,0x00,0x00,0x00,0x00,0xf9,0xff,0xab,0x16, - 0x00,0x00,0x00,0x00,0x78,0x00,0xad,0x8f,0x4c,0x00,0xae,0x8f, - 0x08,0x94,0x8f,0x8f,0x01,0x00,0xac,0x25,0x02,0x00,0xd8,0x25, - 0x2a,0x08,0x8f,0x01,0x4c,0x00,0xb8,0xaf,0x78,0x00,0xac,0xaf, - 0x3c,0xff,0x20,0x14,0x80,0x00,0xf7,0x26,0x48,0x00,0xb1,0x8f, - 0x44,0x00,0xb2,0x8f,0x40,0x00,0xb3,0x8f,0x3c,0x00,0xb4,0x8f, - 0x38,0x00,0xb6,0x8f,0x34,0x00,0xbe,0x8f,0x00,0x00,0x00,0x00, - 0x00,0xa3,0x10,0x3c,0x04,0x0e,0x10,0x36,0x00,0x00,0x19,0x96, - 0x00,0x00,0x00,0x00,0x22,0x00,0x20,0x13,0x00,0x00,0x00,0x00, - 0xc8,0x94,0x82,0x8f,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0x24, - 0x1d,0x00,0x40,0x1c,0xc8,0x94,0x82,0xaf,0x00,0xa3,0x08,0x3c, - 0x1a,0x0d,0x09,0x95,0x00,0xa3,0x0a,0x3c,0x18,0x0d,0x4b,0x95, - 0x00,0x00,0x00,0x00,0x13,0x00,0x2b,0x11,0x00,0x00,0x00,0x00, - 0x80,0x92,0x84,0x8f,0x58,0x11,0x00,0x0c,0x00,0x00,0x00,0x00, - 0xc4,0x94,0x82,0x8f,0x00,0xa1,0x03,0x3c,0x00,0x80,0x63,0x34, - 0x00,0xa3,0x05,0x3c,0x01,0x00,0x4d,0x34,0x06,0x0e,0xa5,0x34, - 0x00,0x00,0x6d,0xa4,0x00,0x00,0xae,0x94,0x00,0x00,0x00,0x00, - 0x01,0x00,0xd8,0x25,0x00,0x00,0xb8,0xa4,0x00,0x00,0x62,0xa4, - 0xc0,0x94,0x84,0x8f,0x60,0x11,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x00,0x00,0x02,0x96,0x00,0x00,0x00,0x00,0xc8,0x94,0x82,0xaf, - 0x33,0x18,0x00,0x0c,0x0a,0x00,0x04,0x24,0x2c,0x00,0xbf,0x8f, - 0x20,0x00,0xb0,0x8f,0x24,0x00,0xb5,0x8f,0x28,0x00,0xb7,0x8f, - 0x08,0x00,0xe0,0x03,0x88,0x00,0xbd,0x27,0xc0,0xff,0xbd,0x27, - 0x18,0x00,0xb0,0xaf,0x00,0x83,0x10,0x3c,0x00,0x10,0x10,0x36, - 0x3c,0x00,0xbf,0xaf,0x00,0x83,0x05,0x3c,0x38,0x00,0xbe,0xaf, - 0x30,0x00,0xb6,0xaf,0x34,0x00,0xb7,0xaf,0x28,0x00,0xb4,0xaf, - 0x2c,0x00,0xb5,0xaf,0x20,0x00,0xb2,0xaf,0x24,0x00,0xb3,0xaf, - 0x1c,0x00,0xb1,0xaf,0x00,0x30,0xa5,0x34,0xe8,0x15,0x00,0x0c, - 0x21,0x20,0x00,0x02,0x21,0xa0,0x00,0x02,0x10,0x94,0x92,0x27, - 0x21,0xa8,0x00,0x00,0x01,0xa1,0x16,0x3c,0x07,0x00,0x17,0x24, - 0x04,0x00,0x1e,0x24,0x21,0x98,0xc0,0x02,0xff,0x00,0x0e,0x24, - 0x00,0x00,0x6e,0xa2,0xf3,0x01,0x02,0x24,0x21,0x18,0x40,0x00, - 0xfe,0xff,0x60,0x14,0xff,0xff,0x42,0x24,0x00,0x00,0x70,0x92, - 0x00,0x00,0x00,0x00,0x82,0x80,0x10,0x00,0x21,0x18,0x00,0x02, - 0xff,0xff,0x6f,0x24,0x08,0x00,0xe1,0x2d,0x6c,0x00,0x20,0x10, - 0x00,0x00,0x00,0x00,0x80,0x78,0x0f,0x00,0x00,0x80,0x01,0x3c, - 0x21,0x08,0x2f,0x00,0x98,0x7b,0x2f,0x8c,0x00,0x00,0x00,0x00, - 0x08,0x00,0xe0,0x01,0x00,0x00,0x00,0x00,0x00,0x80,0x02,0x3c, - 0x50,0x5c,0x42,0x24,0x00,0x80,0x19,0x3c,0x00,0x80,0x08,0x3c, - 0x00,0x80,0x09,0x3c,0x10,0x00,0x18,0x24,0x50,0x46,0x39,0x27, - 0x04,0x70,0x08,0x25,0x90,0x71,0x29,0x25,0x00,0x00,0x54,0xae, - 0x24,0x00,0x58,0xae,0x04,0x00,0x53,0xae,0x08,0x00,0x42,0xae, - 0x0c,0x00,0x42,0xae,0x10,0x00,0x59,0xae,0x14,0x00,0x42,0xae, - 0x18,0x00,0x48,0xae,0x1c,0x00,0x49,0xae,0x28,0x00,0x50,0xae, - 0x02,0x00,0x0a,0x24,0x0c,0x00,0x6a,0xa2,0x31,0x00,0x00,0x10, - 0x21,0x88,0x00,0x00,0x80,0x58,0x15,0x00,0x23,0x58,0x75,0x01, - 0xc0,0x58,0x0b,0x00,0xa8,0x93,0x8c,0x27,0x00,0x80,0x06,0x3c, - 0x00,0x77,0xc6,0x24,0x21,0x20,0x6c,0x01,0x01,0x00,0x05,0x24, - 0xd3,0x17,0x00,0x0c,0x00,0x04,0x87,0x26,0x08,0x00,0x01,0x24, - 0x03,0x00,0x01,0x12,0x00,0x00,0x00,0x00,0x03,0x00,0x17,0x16, - 0x00,0x00,0x00,0x00,0x3d,0x00,0xa0,0x1e,0x00,0x00,0x00,0x00, - 0x00,0x80,0x02,0x3c,0x00,0x80,0x04,0x3c,0x00,0x80,0x05,0x3c, - 0x00,0x80,0x06,0x3c,0x00,0x00,0x54,0xae,0xd8,0x79,0xc6,0x24, - 0x6c,0x77,0xa5,0x24,0x44,0x49,0x84,0x24,0x50,0x5c,0x42,0x24, - 0x04,0x00,0x1e,0x16,0x21,0x88,0x00,0x00,0x09,0x00,0x0d,0x24, - 0x07,0x00,0x00,0x10,0x24,0x00,0x4d,0xae,0x04,0x00,0x17,0x16, - 0x08,0x00,0x03,0x24,0x02,0x00,0x00,0x10,0x21,0x18,0xc0,0x03, - 0x08,0x00,0x03,0x24,0x24,0x00,0x43,0xae,0x04,0x00,0x53,0xae, - 0x08,0x00,0x42,0xae,0x0c,0x00,0x42,0xae,0x10,0x00,0x44,0xae, - 0x14,0x00,0x42,0xae,0x18,0x00,0x45,0xae,0x1c,0x00,0x46,0xae, - 0x28,0x00,0x50,0xae,0x02,0x00,0x0e,0x24,0x01,0x00,0x00,0x10, - 0x0c,0x00,0x6e,0xa2,0x24,0x00,0x42,0x8e,0x08,0x94,0x98,0x8f, - 0xc0,0x79,0x02,0x00,0x21,0xc8,0x02,0x03,0x41,0x00,0x21,0x2b, - 0x21,0xa0,0x8f,0x02,0x04,0x00,0x20,0x14,0x08,0x94,0x99,0xaf, - 0x58,0x89,0x84,0x27,0x20,0x0c,0x00,0x0c,0x3b,0x03,0x05,0x24, - 0x24,0x00,0x48,0x8e,0x00,0x00,0x50,0x8e,0x0b,0x00,0x00,0x11, - 0x00,0x00,0x00,0x00,0x1c,0x00,0x49,0x8e,0x21,0x20,0x00,0x02, - 0x21,0x28,0x40,0x02,0x09,0xf8,0x20,0x01,0x21,0x30,0x20,0x02, - 0x24,0x00,0x4a,0x8e,0x01,0x00,0x31,0x26,0x2b,0x08,0x2a,0x02, - 0xf7,0xff,0x20,0x14,0x80,0x00,0x10,0x26,0x0c,0x94,0x8b,0x8f, - 0x2c,0x00,0x52,0x26,0x01,0x00,0x6c,0x25,0x0c,0x94,0x8c,0xaf, - 0x01,0x00,0xb5,0x26,0x84,0xff,0xbe,0x16,0x00,0x40,0xd6,0x26, - 0x08,0x94,0x8d,0x8f,0x00,0xa3,0x12,0x3c,0x1f,0x00,0xae,0x25, - 0x42,0x79,0x0e,0x00,0x90,0x01,0x52,0x36,0x9c,0x92,0x8f,0xaf, - 0x00,0x00,0x45,0x8e,0x01,0x80,0x04,0x3c,0x00,0xa0,0x01,0x3c, - 0x80,0x95,0x84,0x24,0xf1,0x15,0x00,0x0c,0x21,0x28,0xa1,0x00, - 0xd0,0x94,0x90,0x27,0x00,0x80,0x06,0x3c,0x21,0x88,0x40,0x00, - 0x1c,0x4e,0xc6,0x24,0x21,0x20,0x00,0x02,0x01,0x00,0x05,0x24, - 0xd3,0x17,0x00,0x0c,0x21,0x38,0x00,0x00,0xed,0x17,0x00,0x0c, - 0x21,0x20,0x00,0x02,0x08,0x94,0x98,0x8f,0x00,0xa3,0x19,0x3c, - 0x00,0xa3,0x08,0x3c,0x02,0x0c,0x38,0xa7,0x04,0x0c,0x00,0xa5, - 0x00,0xa3,0x09,0x3c,0x06,0x0c,0x31,0xa5,0x00,0x00,0x4a,0x8e, - 0x00,0xa3,0x0c,0x3c,0x82,0x5a,0x0a,0x00,0x08,0x0c,0x8b,0xa5, - 0x00,0xa3,0x0d,0x3c,0x10,0x0d,0xa0,0xa5,0x00,0xa3,0x0e,0x3c, - 0x12,0x0d,0xc0,0xa5,0x00,0xa3,0x18,0x3c,0x00,0x04,0x0f,0x24, - 0xfc,0x03,0x02,0x24,0x14,0x0d,0x0f,0xa7,0x00,0xa3,0x19,0x3c, - 0x16,0x0d,0x22,0xa7,0x00,0xa3,0x08,0x3c,0x18,0x0d,0x00,0xa5, - 0x00,0xa3,0x09,0x3c,0x1a,0x0d,0x20,0xa5,0x00,0xa3,0x0b,0x3c, - 0x00,0x08,0x0a,0x24,0x1c,0x0d,0x6a,0xa5,0x00,0xa3,0x0c,0x3c, - 0x1e,0x0d,0x82,0xa5,0x3c,0x00,0xbf,0x8f,0x38,0x00,0xbe,0x8f, - 0x34,0x00,0xb7,0x8f,0x30,0x00,0xb6,0x8f,0x2c,0x00,0xb5,0x8f, - 0x28,0x00,0xb4,0x8f,0x24,0x00,0xb3,0x8f,0x20,0x00,0xb2,0x8f, - 0x1c,0x00,0xb1,0x8f,0x18,0x00,0xb0,0x8f,0x08,0x00,0xe0,0x03, - 0x40,0x00,0xbd,0x27,0x70,0x95,0x82,0x8f,0x6c,0x95,0x98,0x8f, - 0x01,0x08,0x42,0x34,0x00,0x04,0x43,0x34,0x25,0x20,0x78,0x00, - 0x01,0x00,0x0e,0x24,0x01,0x08,0x0f,0x24,0x00,0x03,0x99,0x34, - 0x98,0x92,0x8e,0xaf,0x8c,0x92,0x8f,0xaf,0xc0,0x94,0x99,0xaf, - 0x68,0x95,0x84,0xaf,0x84,0x92,0x84,0xaf,0x88,0x92,0x83,0xaf, - 0x08,0x00,0xe0,0x03,0x80,0x92,0x82,0xaf,0xe8,0xff,0xbd,0x27, - 0x14,0x00,0xbf,0xaf,0x70,0x89,0x84,0x27,0x20,0x0c,0x00,0x0c, - 0x4d,0x00,0x05,0x24,0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xe8,0xff,0xbd,0x27, - 0x14,0x00,0xbf,0xaf,0x80,0x89,0x84,0x27,0x20,0x0c,0x00,0x0c, - 0x58,0x00,0x05,0x24,0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x80,0x0e,0x3c, - 0xff,0x03,0x02,0x3c,0x74,0x34,0xce,0x25,0xff,0xff,0x42,0x34, - 0x82,0x78,0x0e,0x00,0x00,0x80,0x0a,0x3c,0xe8,0xff,0xbd,0x27, - 0x00,0x08,0x03,0x3c,0x24,0xc0,0xe2,0x01,0x90,0x32,0x4a,0x25, - 0x14,0x00,0xbf,0xaf,0x25,0xc8,0x03,0x03,0x00,0x80,0x08,0x3c, - 0x82,0x58,0x0a,0x00,0x00,0x00,0x19,0xad,0x00,0x80,0x09,0x3c, - 0x24,0x60,0x62,0x01,0x04,0x00,0x20,0xad,0x25,0x68,0x83,0x01, - 0x00,0x80,0x0e,0x3c,0x80,0x00,0xcd,0xad,0x00,0x80,0x0f,0x3c, - 0xf8,0x18,0x00,0x0c,0x84,0x00,0xe0,0xad,0x00,0xa1,0x05,0x3c, - 0x00,0x80,0xa5,0x34,0x80,0x00,0x18,0x24,0x00,0x00,0xb8,0xa4, - 0x21,0x10,0x00,0x00,0x64,0x00,0x03,0x24,0x04,0x00,0x42,0x24, - 0xff,0xff,0x43,0x14,0x04,0x00,0x42,0x24,0x82,0x00,0x19,0x24, - 0xc4,0x94,0x99,0xaf,0x82,0x00,0x08,0x24,0x00,0x00,0xa8,0xa4, - 0x00,0xa3,0x09,0x3c,0x30,0x0c,0x20,0xa1,0x74,0x11,0x00,0x0c, - 0x00,0x03,0x04,0x24,0x7c,0x15,0x00,0x0c,0x00,0x00,0x00,0x00, - 0xac,0x17,0x00,0x0c,0x00,0x00,0x00,0x00,0x4b,0x17,0x00,0x0c, - 0x00,0x00,0x00,0x00,0xa8,0x14,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x7c,0x15,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x80,0x06,0x3c, - 0xc8,0x5b,0xc6,0x24,0x78,0x95,0x84,0x27,0x21,0x28,0x00,0x00, - 0xd3,0x17,0x00,0x0c,0x21,0x38,0x00,0x00,0xed,0x17,0x00,0x0c, - 0x78,0x95,0x84,0x27,0x4f,0x00,0x02,0x24,0x00,0xa3,0x0a,0x3c, - 0x20,0x0d,0x42,0xa1,0x00,0xa3,0x0b,0x3c,0x53,0x00,0x03,0x24, - 0x00,0x0c,0x62,0xa1,0x00,0xa3,0x0c,0x3c,0x21,0x0d,0x83,0xa1, - 0x00,0xa3,0x0d,0x3c,0x61,0x18,0x00,0x0c,0x01,0x0c,0xa3,0xa1, - 0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x21,0x10,0x00,0x00,0x2b,0x08,0x85,0x00,0x05,0x00,0x20,0x10, - 0x00,0x00,0x00,0x00,0x04,0x00,0x84,0x24,0x2b,0x08,0x85,0x00, - 0xfd,0xff,0x20,0x14,0xfc,0xff,0x80,0xac,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xa8,0xff,0xbd,0x27,0x40,0x00,0xbe,0xaf, - 0xff,0x1f,0x02,0x3c,0x00,0xff,0x42,0x34,0x21,0xf0,0x80,0x00, - 0x3c,0x00,0xb7,0xaf,0x21,0xb8,0xa0,0x00,0x00,0xa0,0x03,0x3c, - 0xff,0x00,0xce,0x27,0x24,0x78,0xc2,0x01,0x24,0xc0,0xe2,0x02, - 0x44,0x00,0xbf,0xaf,0x25,0xf0,0xe3,0x01,0x25,0xb8,0x03,0x03, - 0x38,0x00,0xb6,0xaf,0x30,0x00,0xb4,0xaf,0x34,0x00,0xb5,0xaf, - 0x28,0x00,0xb2,0xaf,0x2c,0x00,0xb3,0xaf,0x20,0x00,0xb0,0xaf, - 0x24,0x00,0xb1,0xaf,0x21,0x28,0xe0,0x02,0xe8,0x15,0x00,0x0c, - 0x21,0x20,0xc0,0x03,0x01,0x80,0x16,0x3c,0x01,0x80,0x07,0x3c, - 0x48,0x00,0xa0,0xaf,0x4c,0x00,0xa0,0xaf,0x70,0x90,0xe7,0x24, - 0xc0,0x8f,0xd6,0x26,0x04,0x00,0x06,0x24,0x28,0x00,0xc2,0x8e, - 0x08,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x48,0x00,0xb9,0x8f, - 0x4c,0x00,0xa9,0x8f,0x01,0x00,0x28,0x27,0x08,0x00,0x2a,0x25, - 0x48,0x00,0xa8,0xaf,0x08,0x00,0x00,0x10,0x4c,0x00,0xaa,0xaf, - 0xf9,0xff,0x46,0x10,0x48,0x00,0xb9,0x8f,0x4c,0x00,0xab,0x8f, - 0x24,0x00,0xcc,0x8e,0x00,0x00,0x00,0x00,0x21,0x68,0x6c,0x01, - 0x4c,0x00,0xad,0xaf,0x2c,0x00,0xd6,0x26,0xed,0xff,0xc7,0x16, - 0x00,0x00,0x00,0x00,0x10,0x00,0x15,0x24,0x48,0x00,0xae,0x8f, - 0x00,0x00,0x00,0x00,0x05,0x00,0xc0,0x19,0x00,0x10,0xa1,0x2a, - 0x03,0x00,0x20,0x10,0x00,0xe0,0x01,0x24,0x05,0x00,0x00,0x10, - 0x24,0x88,0xe1,0x02,0x21,0x78,0xb5,0x02,0xff,0xff,0xf8,0x25, - 0x27,0xc8,0x00,0x03,0x24,0x88,0xf9,0x02,0x00,0x10,0xa1,0x2a, - 0x04,0x00,0x20,0x10,0x21,0x90,0xa0,0x02,0x02,0x00,0x00,0x10, - 0x00,0x10,0x12,0x24,0x21,0x90,0xa0,0x02,0x4c,0x00,0xa9,0x8f, - 0x40,0x18,0x15,0x00,0x19,0x00,0x69,0x00,0x48,0x00,0xac,0x8f, - 0x23,0x40,0x3e,0x02,0x12,0x50,0x00,0x00,0x23,0x58,0x0a,0x01, - 0x00,0x00,0x00,0x00,0x19,0x00,0x4c,0x02,0x12,0x68,0x00,0x00, - 0x23,0x10,0x6d,0x01,0x2a,0x08,0x55,0x00,0x09,0x00,0x20,0x10, - 0x21,0x98,0x40,0x00,0x22,0x00,0x61,0x28,0x9e,0x00,0x20,0x10, - 0x23,0x10,0xfe,0x02,0x90,0x89,0x84,0x27,0x20,0x0c,0x00,0x0c, - 0xb2,0x00,0x05,0x24,0x99,0x00,0x00,0x10,0x23,0x10,0xfe,0x02, - 0x01,0x80,0x16,0x3c,0xc0,0x8f,0xd6,0x26,0x28,0x00,0xce,0x8e, - 0x00,0x00,0x00,0x00,0x27,0x00,0xce,0x14,0x00,0x00,0x00,0x00, - 0x00,0x00,0xd0,0x8e,0xff,0xff,0x4f,0x26,0x2a,0x08,0x72,0x02, - 0x00,0x04,0x10,0x26,0x06,0x00,0x20,0x14,0x0e,0x00,0x0f,0xa6, - 0x0e,0x00,0x18,0x96,0xff,0xff,0x59,0x32,0x21,0x48,0x19,0x03, - 0x0e,0x00,0x09,0xa6,0x23,0x98,0x72,0x02,0x0e,0x00,0x02,0x96, - 0x00,0x00,0x00,0x00,0x23,0x88,0x22,0x02,0xff,0xff,0x31,0x26, - 0x02,0x41,0x11,0x00,0x2b,0x08,0x3e,0x02,0x08,0x00,0x08,0xa6, - 0x07,0x00,0x20,0x14,0x3c,0x00,0x11,0xae,0x3c,0x00,0x03,0x8e, - 0x00,0x00,0x00,0x00,0x21,0x50,0x62,0x00,0x2b,0x08,0x57,0x01, - 0x09,0x00,0x20,0x14,0x00,0x00,0x00,0x00,0x9c,0x89,0x84,0x27, - 0x20,0x0c,0x00,0x0c,0xce,0x00,0x05,0x24,0x01,0x80,0x07,0x3c, - 0x0e,0x00,0x02,0x96,0x3c,0x00,0x03,0x8e,0x70,0x90,0xe7,0x24, - 0x04,0x00,0x06,0x24,0x08,0x00,0x0c,0x96,0x16,0x00,0x02,0xa6, - 0x38,0x00,0x03,0xae,0x10,0x00,0x0c,0xa6,0x2c,0x00,0xd6,0x26, - 0xd4,0xff,0xc7,0x16,0x00,0x00,0x00,0x00,0x01,0x80,0x16,0x3c, - 0xc0,0x8f,0xd6,0x26,0x28,0x00,0xc2,0x8e,0x03,0x00,0x00,0x10, - 0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x10,0x08,0x00,0x12,0x24, - 0xfd,0xff,0x46,0x10,0x00,0x00,0x00,0x00,0x24,0x00,0xd2,0x8e, - 0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x8e,0x22,0x00,0x40,0x12, - 0x00,0x00,0x00,0x00,0xff,0xff,0xb4,0x26,0x2a,0x08,0x75,0x02, - 0x06,0x00,0x20,0x14,0x16,0x00,0x14,0xa6,0x16,0x00,0x0b,0x96, - 0xff,0xff,0xad,0x32,0x21,0x70,0x6d,0x01,0x16,0x00,0x0e,0xa6, - 0x23,0x98,0x75,0x02,0x16,0x00,0x02,0x96,0x00,0x00,0x00,0x00, - 0x23,0x88,0x22,0x02,0xff,0xff,0x31,0x26,0x02,0x79,0x11,0x00, - 0x2b,0x08,0x3e,0x02,0x38,0x00,0x11,0xae,0x07,0x00,0x20,0x14, - 0x10,0x00,0x0f,0xa6,0x38,0x00,0x18,0x8e,0x00,0x00,0x00,0x00, - 0x21,0xc8,0x02,0x03,0x2b,0x08,0x37,0x03,0x04,0x00,0x20,0x14, - 0x00,0x00,0x00,0x00,0xa8,0x89,0x84,0x27,0x20,0x0c,0x00,0x0c, - 0x00,0x01,0x05,0x24,0xff,0xff,0x52,0x26,0xe4,0xff,0x40,0x16, - 0x80,0x00,0x10,0x26,0x01,0x80,0x07,0x3c,0x70,0x90,0xe7,0x24, - 0x04,0x00,0x06,0x24,0x2c,0x00,0xd6,0x26,0xd1,0xff,0xc7,0x16, - 0x00,0x00,0x00,0x00,0x01,0x80,0x16,0x3c,0xc0,0x8f,0xd6,0x26, - 0x28,0x00,0xc2,0x8e,0x03,0x00,0x00,0x10,0x00,0x00,0x00,0x00, - 0x05,0x00,0x00,0x10,0x08,0x00,0x12,0x24,0xfd,0xff,0x46,0x10, - 0x00,0x00,0x00,0x00,0x24,0x00,0xd2,0x8e,0x00,0x00,0x00,0x00, - 0x00,0x00,0xd0,0x8e,0x22,0x00,0x40,0x12,0x00,0x00,0x00,0x00, - 0xff,0xff,0xb4,0x26,0x2a,0x08,0x75,0x02,0x06,0x00,0x20,0x14, - 0x0e,0x00,0x14,0xa6,0x0e,0x00,0x09,0x96,0xff,0xff,0xa8,0x32, - 0x21,0x50,0x28,0x01,0x0e,0x00,0x0a,0xa6,0x23,0x98,0x75,0x02, - 0x0e,0x00,0x02,0x96,0x00,0x00,0x00,0x00,0x23,0x88,0x22,0x02, - 0xff,0xff,0x31,0x26,0x02,0x61,0x11,0x00,0x2b,0x08,0x3e,0x02, - 0x08,0x00,0x0c,0xa6,0x07,0x00,0x20,0x14,0x3c,0x00,0x11,0xae, - 0x3c,0x00,0x0b,0x8e,0x00,0x00,0x00,0x00,0x21,0x68,0x62,0x01, - 0x2b,0x08,0xb7,0x01,0x04,0x00,0x20,0x14,0x00,0x00,0x00,0x00, - 0xb4,0x89,0x84,0x27,0x20,0x0c,0x00,0x0c,0x27,0x01,0x05,0x24, - 0xff,0xff,0x52,0x26,0xe4,0xff,0x40,0x16,0x80,0x00,0x10,0x26, - 0x01,0x80,0x07,0x3c,0x70,0x90,0xe7,0x24,0x04,0x00,0x06,0x24, - 0x2c,0x00,0xd6,0x26,0xd1,0xff,0xc7,0x16,0x00,0x00,0x00,0x00, - 0x40,0xa8,0x15,0x00,0x01,0x40,0xa1,0x2a,0x43,0xff,0x20,0x14, - 0x48,0x00,0xae,0x8f,0x23,0x10,0xfe,0x02,0x44,0x00,0xbf,0x8f, - 0x40,0x00,0xbe,0x8f,0x3c,0x00,0xb7,0x8f,0x20,0x00,0xb0,0x8f, - 0x24,0x00,0xb1,0x8f,0x28,0x00,0xb2,0x8f,0x2c,0x00,0xb3,0x8f, - 0x30,0x00,0xb4,0x8f,0x34,0x00,0xb5,0x8f,0x38,0x00,0xb6,0x8f, - 0x58,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x82,0x12,0x02,0x00, - 0xe8,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf,0xc0,0x94,0x84,0x8f, - 0x60,0x11,0x00,0x0c,0x00,0x00,0x00,0x00,0x33,0x18,0x00,0x0c, - 0x32,0x00,0x04,0x24,0x90,0x95,0x82,0x8f,0x94,0x95,0x83,0x8f, - 0x98,0x95,0x82,0xaf,0x2b,0x08,0x62,0x00,0x03,0x00,0x20,0x10, - 0x82,0x70,0x02,0x00,0x21,0x18,0x40,0x00,0x82,0x70,0x02,0x00, - 0x23,0x10,0x4e,0x00,0x03,0x00,0x60,0x14,0x90,0x95,0x82,0xaf, - 0x0b,0x00,0x00,0x10,0x94,0x95,0x83,0xaf,0x98,0x95,0x8f,0x8f, - 0x00,0xa3,0x08,0x3c,0x00,0xc3,0x0f,0x00,0x1b,0x00,0x03,0x03, - 0x12,0xc8,0x00,0x00,0x08,0x00,0x19,0xa5,0x94,0x95,0x83,0xaf, - 0x02,0x00,0x60,0x14,0x00,0x00,0x00,0x00,0x0d,0x00,0x07,0x00, - 0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0x08,0x00,0xe0,0x03,0x21,0x10,0x00,0x00, - 0x00,0x83,0x08,0x3c,0x21,0x38,0x80,0x00,0x00,0x10,0x08,0x35, - 0x21,0x10,0x00,0x00,0xa0,0x92,0x86,0x27,0x00,0x00,0xc4,0x8c, - 0x21,0x18,0xc0,0x00,0x2b,0x08,0x88,0x00,0x0b,0x00,0x20,0x14, - 0x2b,0x08,0x87,0x00,0x09,0x00,0x20,0x10,0x00,0x00,0x00,0x00, - 0x21,0x18,0x80,0x00,0x00,0x00,0x84,0x8c,0x00,0x00,0x00,0x00, - 0x2b,0x08,0x88,0x00,0x03,0x00,0x20,0x14,0x2b,0x08,0x87,0x00, - 0xf9,0xff,0x20,0x14,0x00,0x00,0x00,0x00,0x06,0x00,0x87,0x14, - 0x00,0x00,0x00,0x00,0x1c,0x00,0xa2,0x10,0x00,0x00,0x00,0x00, - 0x00,0x00,0xee,0x8c,0x05,0x00,0x00,0x10,0x00,0x00,0x6e,0xac, - 0x01,0x00,0x42,0x24,0x07,0x00,0x41,0x28,0xe7,0xff,0x20,0x14, - 0x04,0x00,0xc6,0x24,0x80,0x78,0x05,0x00,0xa0,0x92,0x98,0x27, - 0x21,0x10,0xf8,0x01,0x00,0x00,0x44,0x8c,0x21,0x18,0x40,0x00, - 0x2b,0x08,0x88,0x00,0x0b,0x00,0x20,0x14,0x2b,0x08,0x87,0x00, - 0x09,0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x21,0x18,0x80,0x00, - 0x00,0x00,0x84,0x8c,0x00,0x00,0x00,0x00,0x2b,0x08,0x88,0x00, - 0x03,0x00,0x20,0x14,0x2b,0x08,0x87,0x00,0xf9,0xff,0x20,0x14, - 0x00,0x00,0x00,0x00,0x00,0x00,0xe4,0xac,0x00,0x00,0x67,0xac, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xb0,0x95,0x83,0x27, - 0x00,0x80,0x0e,0x3c,0x00,0x80,0x0f,0x3c,0x00,0x80,0x18,0x3c, - 0xa8,0x95,0x82,0x27,0x00,0x35,0xce,0x25,0x28,0x35,0xef,0x25, - 0x4c,0x35,0x18,0x27,0xa0,0x95,0x99,0x27,0xa0,0x95,0x80,0xaf, - 0xa4,0x95,0x8e,0xaf,0xa8,0x95,0x80,0xaf,0xac,0x95,0x8f,0xaf, - 0xb0,0x95,0x80,0xaf,0xb4,0x95,0x98,0xaf,0xa0,0x92,0x99,0xaf, - 0xa8,0x92,0x82,0xaf,0xa4,0x92,0x82,0xaf,0xb8,0x92,0x83,0xaf, - 0xb4,0x92,0x83,0xaf,0xb0,0x92,0x83,0xaf,0x08,0x00,0xe0,0x03, - 0xac,0x92,0x83,0xaf,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xe8,0xff,0xbd,0x27,0x00,0xa3,0x07,0x3c,0x30,0x0c,0xe7,0x34, - 0x14,0x00,0xbf,0xaf,0x00,0x00,0xee,0x90,0x00,0x00,0x00,0x00, - 0x3c,0x00,0xc0,0x11,0x14,0x00,0xbf,0x8f,0x00,0xa3,0x0f,0x3c, - 0x32,0x0c,0xf8,0x91,0x00,0x00,0x00,0x00,0x37,0x00,0x00,0x17, - 0x14,0x00,0xbf,0x8f,0x00,0xa3,0x03,0x3c,0x34,0x0c,0x63,0x34, - 0x00,0x00,0x65,0x8c,0xff,0x3f,0x01,0x3c,0x00,0xa3,0x06,0x3c, - 0xff,0xff,0x21,0x34,0x38,0x0c,0xc6,0x34,0x24,0x28,0xa1,0x00, - 0x00,0x00,0xd9,0x94,0x00,0x80,0x01,0x3c,0x25,0x28,0xa1,0x00, - 0x81,0x00,0x21,0x2f,0x03,0x00,0x20,0x14,0x00,0x00,0x00,0x00, - 0x80,0x00,0x08,0x24,0x00,0x00,0xc8,0xa4,0x00,0x00,0xe2,0x90, - 0x1d,0x00,0x00,0x10,0x01,0x00,0x01,0x24,0x00,0xa3,0x04,0x3c, - 0x00,0x00,0xc2,0x94,0x21,0x18,0xa0,0x00,0x05,0x00,0x00,0x10, - 0x3a,0x0c,0x84,0x34,0x00,0xa3,0x03,0x3c,0x00,0x00,0xc2,0x94, - 0x3a,0x0c,0x63,0x34,0x21,0x20,0xa0,0x00,0xff,0xff,0x42,0x24, - 0x07,0x00,0x40,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x69,0x90, - 0xff,0xff,0x42,0x24,0x01,0x00,0x63,0x24,0x01,0x00,0x84,0x24, - 0xfb,0xff,0x41,0x04,0xff,0xff,0x89,0xa0,0x0f,0x00,0x00,0x10, - 0x00,0x00,0xe0,0xa0,0x00,0x00,0xe0,0xa0,0x00,0x00,0x6a,0x8c, - 0x00,0x00,0x00,0x00,0x09,0xf8,0x40,0x01,0x00,0x00,0x00,0x00, - 0x09,0x00,0x00,0x10,0x14,0x00,0xbf,0x8f,0x01,0x00,0x01,0x24, - 0xe3,0xff,0x41,0x10,0x02,0x00,0x01,0x24,0xe6,0xff,0x41,0x10, - 0x03,0x00,0x01,0x24,0xf3,0xff,0x41,0x10,0x00,0x00,0x00,0x00, - 0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x90,0x92,0x8e,0x8f,0x21,0x10,0x00,0x00,0xff,0xff,0xcf,0x25, - 0xbc,0x95,0x8f,0xaf,0x88,0x93,0x83,0x27,0x04,0x00,0x04,0x24, - 0x00,0x00,0x63,0xac,0x04,0x00,0x63,0xac,0x08,0x00,0x63,0x24, - 0x00,0x00,0x63,0xac,0x04,0x00,0x63,0xac,0x08,0x00,0x63,0x24, - 0x00,0x00,0x63,0xac,0x04,0x00,0x63,0xac,0x08,0x00,0x63,0x24, - 0x00,0x00,0x63,0xac,0x04,0x00,0x63,0xac,0x04,0x00,0x42,0x24, - 0xf3,0xff,0x44,0x14,0x08,0x00,0x63,0x24,0x21,0x10,0x00,0x00, - 0x08,0x93,0x83,0x27,0x10,0x00,0x04,0x24,0x00,0x00,0x63,0xac, - 0x04,0x00,0x63,0xac,0x08,0x00,0x63,0x24,0x00,0x00,0x63,0xac, - 0x04,0x00,0x63,0xac,0x08,0x00,0x63,0x24,0x00,0x00,0x63,0xac, - 0x04,0x00,0x63,0xac,0x08,0x00,0x63,0x24,0x00,0x00,0x63,0xac, - 0x04,0x00,0x63,0xac,0x04,0x00,0x42,0x24,0xf3,0xff,0x44,0x14, - 0x08,0x00,0x63,0x24,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xd8,0xff,0xbd,0x27,0x21,0x18,0x80,0x00,0x24,0x00,0xbf,0xaf, - 0x68,0x95,0x84,0x8f,0x2c,0x00,0xa5,0xaf,0x30,0x00,0xa6,0xaf, - 0x34,0x00,0xa7,0xaf,0x58,0x11,0x00,0x0c,0x28,0x00,0xa3,0xaf, - 0x28,0x00,0xa3,0x8f,0x21,0x20,0x40,0x00,0x00,0x00,0x63,0xac, - 0x04,0x00,0x63,0xac,0x2c,0x00,0xae,0x8f,0x00,0x00,0x00,0x00, - 0x10,0x00,0x6e,0xac,0x30,0x00,0xaf,0x8f,0x00,0x00,0x00,0x00, - 0x08,0x00,0x6f,0xac,0x34,0x00,0xb8,0x8f,0x60,0x11,0x00,0x0c, - 0x0c,0x00,0x78,0xac,0x24,0x00,0xbf,0x8f,0x28,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xe8,0xff,0xbd,0x27, - 0x21,0x18,0x80,0x00,0x14,0x00,0xbf,0xaf,0x68,0x95,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x18,0x00,0xa3,0xaf,0x18,0x00,0xa3,0x8f, - 0x90,0x92,0x8e,0x8f,0x04,0x00,0x66,0x8c,0x00,0x00,0x67,0x8c, - 0x14,0x00,0x6e,0xac,0x00,0x00,0xc7,0xac,0x04,0x00,0xe6,0xac, - 0x10,0x00,0x6f,0x8c,0x88,0x93,0x99,0x27,0xc0,0xc0,0x0f,0x00, - 0x21,0x28,0x19,0x03,0x04,0x00,0xa8,0x8c,0x21,0x20,0x40,0x00, - 0x00,0x00,0x03,0xad,0x00,0x00,0x65,0xac,0x04,0x00,0x68,0xac, - 0x60,0x11,0x00,0x0c,0x04,0x00,0xa3,0xac,0x14,0x00,0xbf,0x8f, - 0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xe8,0xff,0xbd,0x27,0x21,0x30,0x80,0x00,0x14,0x00,0xbf,0xaf, - 0x68,0x95,0x84,0x8f,0x18,0x00,0xa6,0xaf,0x58,0x11,0x00,0x0c, - 0x1c,0x00,0xa5,0xaf,0x18,0x00,0xa6,0x8f,0x1c,0x00,0xa5,0x8f, - 0x04,0x00,0xc3,0x8c,0x00,0x00,0xc4,0x8c,0x00,0x40,0x01,0x3c, - 0x00,0x00,0x64,0xac,0x04,0x00,0x83,0xac,0x90,0x92,0x8e,0x8f, - 0x21,0x38,0x40,0x00,0x23,0x78,0xc5,0x01,0x2b,0x08,0xe1,0x01, - 0x08,0x00,0x20,0x10,0x0f,0x00,0xa9,0x30,0x10,0x00,0xd8,0x8c, - 0x88,0x93,0x88,0x27,0xc0,0xc8,0x18,0x00,0x14,0x00,0xce,0xac, - 0x06,0x00,0x00,0x10,0x21,0x18,0x28,0x03,0x0f,0x00,0xa9,0x30, - 0xc0,0x50,0x09,0x00,0x08,0x93,0x8b,0x27,0x14,0x00,0xc5,0xac, - 0x21,0x18,0x4b,0x01,0x04,0x00,0x62,0x8c,0x21,0x20,0xe0,0x00, - 0x00,0x00,0x46,0xac,0x00,0x00,0xc3,0xac,0x04,0x00,0xc2,0xac, - 0x60,0x11,0x00,0x0c,0x04,0x00,0x66,0xac,0x14,0x00,0xbf,0x8f, - 0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xb8,0x95,0x8e,0x8f,0xe0,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf, - 0x14,0x00,0xcf,0x8d,0x21,0x18,0x80,0x00,0x21,0xc0,0xe3,0x01, - 0x14,0x00,0xd8,0xad,0x68,0x95,0x84,0x8f,0x21,0x28,0xc0,0x01, - 0x58,0x11,0x00,0x0c,0x1c,0x00,0xa5,0xaf,0x1c,0x00,0xa5,0x8f, - 0x00,0x40,0x01,0x3c,0x04,0x00,0xa3,0x8c,0x00,0x00,0xa4,0x8c, - 0x21,0x38,0x40,0x00,0x00,0x00,0x64,0xac,0x04,0x00,0x83,0xac, - 0x90,0x92,0x99,0x8f,0x14,0x00,0xa6,0x8c,0x00,0x00,0x00,0x00, - 0x23,0x40,0x26,0x03,0x2b,0x08,0x01,0x01,0x08,0x00,0x20,0x10, - 0x0f,0x00,0xcc,0x30,0x10,0x00,0xa9,0x8c,0x88,0x93,0x8b,0x27, - 0xc0,0x50,0x09,0x00,0x14,0x00,0xb9,0xac,0x05,0x00,0x00,0x10, - 0x21,0x18,0x4b,0x01,0x0f,0x00,0xcc,0x30,0xc0,0x68,0x0c,0x00, - 0x08,0x93,0x8f,0x27,0x21,0x18,0xaf,0x01,0x04,0x00,0x62,0x8c, - 0x21,0x20,0xe0,0x00,0x00,0x00,0x45,0xac,0x00,0x00,0xa3,0xac, - 0x04,0x00,0xa2,0xac,0x60,0x11,0x00,0x0c,0x04,0x00,0x65,0xac, - 0x14,0x00,0xbf,0x8f,0x20,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xa8,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf, - 0xc0,0x94,0x84,0x8f,0x60,0x11,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x28,0x00,0xb3,0xaf,0x24,0x00,0xb4,0xaf,0x00,0xa3,0x14,0x3c, - 0x00,0xa3,0x13,0x3c,0x34,0x00,0xb0,0xaf,0x30,0x00,0xb1,0xaf, - 0x20,0x00,0xb5,0xaf,0x1c,0x00,0xb6,0xaf,0x18,0x00,0xb7,0xaf, - 0xc0,0x95,0x97,0x27,0x90,0x93,0x96,0x27,0x08,0x93,0x95,0x27, - 0x00,0x80,0x11,0x3c,0x88,0x93,0x90,0x27,0x12,0x0d,0x73,0x36, - 0x10,0x0d,0x94,0x36,0x2c,0x00,0xb2,0xaf,0x00,0x00,0x6e,0x96, - 0x00,0x00,0x8f,0x96,0x00,0x00,0x00,0x00,0x08,0x00,0xcf,0x11, - 0x00,0x00,0x00,0x00,0x29,0x13,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x00,0x00,0x78,0x96,0x00,0x00,0x99,0x96,0x00,0x00,0x00,0x00, - 0xfa,0xff,0x19,0x17,0x00,0x00,0x00,0x00,0x68,0x95,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x00,0x00,0x00,0x00,0xbc,0x95,0x88,0x8f, - 0x90,0x92,0x89,0x8f,0x00,0x00,0x00,0x00,0x2d,0x00,0x09,0x11, - 0x00,0x00,0x00,0x00,0xbc,0x95,0x8a,0x8f,0x00,0x00,0x00,0x00, - 0x01,0x00,0x4b,0x25,0x0f,0x00,0x6c,0x31,0xc0,0x68,0x0c,0x00, - 0xbc,0x95,0x8b,0xaf,0x21,0x10,0xad,0x02,0x00,0x00,0x45,0x8c, - 0x21,0x38,0x40,0x00,0x1d,0x00,0xa2,0x10,0x21,0x20,0x40,0x00, - 0x21,0x18,0xa0,0x00,0x14,0x00,0x6f,0x8c,0xbc,0x95,0x8e,0x8f, - 0x00,0x00,0x00,0x00,0x23,0xc0,0xcf,0x01,0x2b,0x08,0x11,0x03, - 0x10,0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0xa2,0x8c, - 0x00,0x00,0x00,0x00,0x00,0x00,0x82,0xac,0x04,0x00,0x44,0xac, - 0x10,0x00,0x79,0x8c,0x00,0x00,0x00,0x00,0xc0,0x40,0x19,0x00, - 0x21,0x30,0x08,0x02,0x04,0x00,0xc2,0x8c,0x00,0x00,0x00,0x00, - 0x00,0x00,0x45,0xac,0x00,0x00,0xa6,0xac,0x04,0x00,0xa2,0xac, - 0x02,0x00,0x00,0x10,0x04,0x00,0xc5,0xac,0x21,0x20,0xa0,0x00, - 0x00,0x00,0x85,0x8c,0x00,0x00,0x00,0x00,0xe6,0xff,0xa7,0x14, - 0x21,0x18,0xa0,0x00,0xbc,0x95,0x89,0x8f,0x90,0x92,0x8a,0x8f, - 0x00,0x00,0x00,0x00,0xd5,0xff,0x2a,0x15,0x00,0x00,0x00,0x00, - 0x88,0x93,0x8b,0x8f,0x21,0x30,0x00,0x02,0x16,0x00,0x0b,0x16, - 0x00,0x00,0x00,0x00,0x21,0x30,0xc0,0x02,0x00,0x00,0xcc,0x8c, - 0x00,0x00,0x00,0x00,0x11,0x00,0xcc,0x14,0x00,0x00,0x00,0x00, - 0x08,0x00,0xcd,0x8c,0x08,0x00,0xc6,0x24,0x0d,0x00,0xcd,0x14, - 0x00,0x00,0x00,0x00,0x08,0x00,0xce,0x8c,0x08,0x00,0xc6,0x24, - 0x09,0x00,0xce,0x14,0x00,0x00,0x00,0x00,0xc0,0x94,0x84,0x8f, - 0x60,0x11,0x00,0x0c,0x00,0x00,0x00,0x00,0x90,0x95,0x8f,0x8f, - 0x00,0x00,0x00,0x00,0x01,0x00,0xf8,0x25,0xa8,0xff,0x00,0x10, - 0x90,0x95,0x98,0xaf,0x00,0x00,0xc5,0x8c,0x00,0x00,0x00,0x00, - 0x00,0x00,0xa2,0x8c,0x00,0x00,0x00,0x00,0x00,0x00,0xc2,0xac, - 0x04,0x00,0x46,0xac,0x00,0x00,0xa5,0xac,0x04,0x00,0xa5,0xac, - 0xb8,0x95,0x85,0xaf,0xb8,0x95,0x99,0x8f,0x90,0x92,0x92,0x8f, - 0x08,0x00,0x28,0x8f,0x0c,0x00,0x24,0x8f,0x09,0xf8,0x00,0x01, - 0x00,0x00,0x00,0x00,0xc0,0x94,0x84,0x8f,0x60,0x11,0x00,0x0c, - 0x00,0x00,0x00,0x00,0x90,0x92,0x89,0x8f,0xb8,0x95,0x80,0xaf, - 0x23,0x90,0x32,0x01,0x32,0x00,0x41,0x2e,0x04,0x00,0x20,0x10, - 0x31,0x00,0x03,0x24,0x02,0x00,0x00,0x10,0x21,0x18,0x40,0x02, - 0x31,0x00,0x03,0x24,0x80,0x50,0x03,0x00,0x21,0x10,0xea,0x02, - 0x00,0x00,0x4b,0x8c,0x00,0x00,0x00,0x00,0x01,0x00,0x6c,0x25, - 0x86,0xff,0x00,0x10,0x00,0x00,0x4c,0xac,0x14,0x00,0xbf,0x8f, - 0x58,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc8,0xff,0xbd,0x27, - 0x30,0x00,0xb6,0xaf,0x28,0x00,0xb4,0xaf,0x2c,0x00,0xb5,0xaf, - 0x24,0x00,0xb3,0xaf,0x18,0x00,0xb0,0xaf,0x1c,0x00,0xb1,0xaf, - 0x34,0x00,0xbf,0xaf,0x20,0x00,0xb2,0xaf,0x04,0x00,0x11,0x24, - 0x00,0xa1,0x10,0x3c,0xc0,0x89,0x93,0x27,0x21,0xa8,0x00,0x00, - 0xfc,0x89,0x94,0x27,0x0f,0x00,0x16,0x24,0x21,0x90,0x00,0x00, - 0x88,0x96,0x80,0xaf,0x21,0x18,0x00,0x00,0x21,0x10,0x60,0x02, - 0x00,0x00,0x4f,0x94,0x02,0x00,0x4e,0x94,0x21,0xc0,0xf0,0x01, - 0x00,0x00,0x0e,0xa3,0x88,0x96,0x80,0xaf,0x04,0x00,0x48,0x94, - 0x06,0x00,0x59,0x94,0x21,0x48,0x10,0x01,0x00,0x00,0x39,0xa1, - 0x88,0x96,0x80,0xaf,0x08,0x00,0x4b,0x94,0x0a,0x00,0x4a,0x94, - 0x21,0x60,0x70,0x01,0x00,0x00,0x8a,0xa1,0x88,0x96,0x80,0xaf, - 0x0c,0x00,0x4f,0x94,0x0e,0x00,0x4d,0x94,0x04,0x00,0x42,0x24, - 0x04,0x00,0x42,0x24,0x21,0x70,0xf0,0x01,0x04,0x00,0x42,0x24, - 0x04,0x00,0x63,0x24,0x00,0x00,0xcd,0xa1,0x88,0x96,0x80,0xaf, - 0xe7,0xff,0x71,0x14,0x04,0x00,0x42,0x24,0x00,0x00,0x58,0x94, - 0x00,0x00,0x00,0x00,0x21,0x40,0x18,0x02,0x00,0x00,0x19,0x91, - 0x00,0x00,0x00,0x00,0x40,0x00,0x29,0x33,0x08,0x00,0x20,0x11, - 0x64,0x00,0x41,0x2a,0x04,0x00,0x20,0x14,0x00,0x00,0x00,0x00, - 0x21,0x20,0x80,0x02,0x20,0x0c,0x00,0x0c,0x47,0x00,0x05,0x24, - 0xd5,0xff,0x00,0x10,0x01,0x00,0x52,0x26,0x05,0x00,0xb5,0x26, - 0xd1,0xff,0xb6,0x16,0x14,0x00,0x73,0x26,0x34,0x00,0xbf,0x8f, - 0x18,0x00,0xb0,0x8f,0x1c,0x00,0xb1,0x8f,0x20,0x00,0xb2,0x8f, - 0x24,0x00,0xb3,0x8f,0x28,0x00,0xb4,0x8f,0x2c,0x00,0xb5,0x8f, - 0x30,0x00,0xb6,0x8f,0x08,0x00,0xe0,0x03,0x38,0x00,0xbd,0x27, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xd0,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf,0x00,0xa1,0x0e,0x3c, - 0x00,0x40,0xc0,0xa5,0x9c,0x96,0x98,0x8f,0xa0,0x96,0x8f,0x8f, - 0x40,0xc9,0x18,0x00,0x23,0xc8,0x38,0x03,0x80,0xc8,0x19,0x00, - 0x21,0xc8,0x38,0x03,0x70,0x00,0x04,0x3c,0xc0,0xc8,0x19,0x00, - 0x00,0x80,0x84,0x34,0x21,0x30,0xf9,0x01,0x2b,0x08,0xc4,0x00, - 0x0a,0x00,0x20,0x14,0x00,0xa0,0x02,0x3c,0x8f,0xff,0x03,0x3c, - 0x90,0x92,0x82,0x8f,0x00,0x80,0x63,0x34,0x21,0x30,0xc3,0x00, - 0x2b,0x08,0xc4,0x00,0xfd,0xff,0x20,0x10,0x01,0x00,0x42,0x24, - 0x90,0x92,0x82,0xaf,0x00,0xa0,0x02,0x3c,0x14,0x00,0x42,0x34, - 0xa0,0x96,0x86,0xaf,0x00,0xa1,0x03,0x3c,0x80,0x00,0x05,0x24, - 0x0c,0x00,0x65,0xa0,0x88,0x96,0x80,0xaf,0x08,0x00,0x67,0x90, - 0x08,0x00,0x6b,0x90,0x88,0x96,0x80,0xaf,0x0c,0x00,0x65,0xa0, - 0x88,0x96,0x80,0xaf,0x08,0x00,0x66,0x90,0x08,0x00,0x6d,0x90, - 0x00,0x62,0x0b,0x00,0x00,0x72,0x0d,0x00,0x25,0x38,0xec,0x00, - 0x25,0x30,0xce,0x00,0x23,0x30,0xe6,0x00,0xff,0xff,0xc6,0x30, - 0x80,0x00,0xc1,0x2c,0x07,0x00,0x20,0x14,0x42,0xc8,0x06,0x00, - 0x00,0x00,0x58,0x8c,0x00,0x00,0x00,0x00,0x01,0x00,0x0f,0x27, - 0xea,0xff,0x00,0x10,0x00,0x00,0x4f,0xac,0x42,0xc8,0x06,0x00, - 0x21,0x38,0xf9,0x00,0x30,0x0d,0x00,0x0c,0x24,0x00,0xa7,0xaf, - 0x00,0xa0,0x04,0x3c,0x24,0x00,0xa7,0x8f,0x18,0x00,0x84,0x34, - 0x00,0xa1,0x03,0x3c,0x80,0x00,0x05,0x24,0x0c,0x00,0x65,0xa0, - 0x88,0x96,0x80,0xaf,0x08,0x00,0x62,0x90,0x08,0x00,0x6b,0x90, - 0x88,0x96,0x80,0xaf,0x0c,0x00,0x65,0xa0,0x88,0x96,0x80,0xaf, - 0x08,0x00,0x66,0x90,0x08,0x00,0x6d,0x90,0x00,0x62,0x0b,0x00, - 0x00,0x72,0x0d,0x00,0x25,0x10,0x4c,0x00,0x25,0x30,0xce,0x00, - 0x23,0x30,0x46,0x00,0xff,0xff,0xc6,0x30,0x80,0x00,0xc1,0x2c, - 0x07,0x00,0x20,0x14,0x42,0xc8,0x06,0x00,0x00,0x00,0x98,0x8c, - 0x00,0x00,0x00,0x00,0x01,0x00,0x0f,0x27,0xea,0xff,0x00,0x10, - 0x00,0x00,0x8f,0xac,0x42,0xc8,0x06,0x00,0x21,0x10,0x59,0x00, - 0x8c,0x96,0x88,0x8f,0x23,0x50,0xe2,0x00,0x90,0x96,0x89,0x8f, - 0xff,0xff,0x4a,0x31,0x10,0x8a,0x8c,0x8f,0x21,0x58,0x0a,0x01, - 0x23,0x40,0x69,0x01,0x19,0x00,0x88,0x01,0x14,0x8a,0x8d,0x8f, - 0x1c,0x8a,0x85,0x8f,0x18,0x8a,0x8f,0x8f,0x00,0x29,0x05,0x00, - 0x01,0x00,0xa5,0x24,0x8c,0x96,0x88,0xaf,0x12,0x48,0x00,0x00, - 0x82,0x49,0x09,0x00,0x90,0x96,0x89,0xaf,0x19,0x00,0xa9,0x01, - 0x12,0x70,0x00,0x00,0x02,0xc1,0x0e,0x00,0x21,0x20,0x0f,0x03, - 0x2b,0x08,0x85,0x00,0x21,0x30,0x80,0x00,0x02,0x00,0x20,0x10, - 0x94,0x96,0x84,0xaf,0x21,0x30,0xa0,0x00,0x9c,0x96,0x99,0x8f, - 0x00,0x00,0x00,0x00,0x05,0x00,0x26,0x13,0x00,0x00,0x00,0x00, - 0x00,0x00,0x66,0xa0,0x9c,0x96,0x86,0xaf,0x02,0x5a,0x06,0x00, - 0x00,0x00,0x6b,0xa0,0x20,0x8a,0x8c,0x8f,0x00,0x00,0x00,0x00, - 0x4b,0x00,0x80,0x11,0x00,0xa3,0x18,0x3c,0x98,0x96,0x84,0x8f, - 0x00,0x00,0x00,0x00,0x30,0x00,0x80,0x10,0x80,0x10,0x0a,0x00, - 0x38,0x98,0x83,0x8f,0x23,0x10,0x87,0x00,0x01,0x00,0x63,0x24, - 0xff,0xff,0x42,0x30,0xe8,0x03,0x61,0x28,0x21,0x30,0x40,0x00, - 0x11,0x00,0x20,0x14,0x38,0x98,0x83,0xaf,0x24,0x8a,0x8d,0x8f, - 0x00,0x00,0x00,0x00,0x2b,0x08,0xa2,0x01,0x0d,0x00,0x20,0x10, - 0x21,0x08,0xc0,0x00,0x28,0x8a,0x84,0x27,0x40,0x01,0x05,0x24, - 0x28,0x00,0xa6,0xaf,0x24,0x00,0xa7,0xaf,0x20,0x0c,0x00,0x0c, - 0x18,0x00,0xaa,0xaf,0x21,0x18,0x00,0x00,0x28,0x00,0xa6,0x8f, - 0x24,0x00,0xa7,0x8f,0x18,0x00,0xaa,0x8f,0x38,0x98,0x83,0xaf, - 0x21,0x08,0xc0,0x00,0x80,0x30,0x01,0x00,0x23,0x30,0xc1,0x00, - 0x80,0x30,0x06,0x00,0x23,0x30,0xc1,0x00,0xc0,0x30,0x06,0x00, - 0x21,0x30,0xc1,0x00,0xc0,0x30,0x06,0x00,0x23,0x30,0xc1,0x00, - 0xc0,0x30,0x06,0x00,0x02,0x35,0x06,0x00,0x64,0x00,0xc1,0x2c, - 0x03,0x00,0x20,0x14,0x80,0x70,0x06,0x00,0x63,0x00,0x06,0x24, - 0x80,0x70,0x06,0x00,0xa8,0x96,0x98,0x27,0x21,0x10,0xd8,0x01, - 0x00,0x00,0x4f,0x8c,0x00,0x00,0x00,0x00,0x01,0x00,0xf9,0x25, - 0x00,0x00,0x59,0xac,0x80,0x10,0x0a,0x00,0x23,0x10,0x4a,0x00, - 0x80,0x10,0x02,0x00,0x23,0x10,0x4a,0x00,0xc0,0x10,0x02,0x00, - 0x21,0x10,0x4a,0x00,0xc0,0x10,0x02,0x00,0x23,0x10,0x4a,0x00, - 0xc0,0x10,0x02,0x00,0x02,0x15,0x02,0x00,0x21,0x20,0xe0,0x00, - 0x64,0x00,0x41,0x2c,0x21,0x30,0x40,0x00,0x02,0x00,0x20,0x14, - 0x98,0x96,0x84,0xaf,0x63,0x00,0x06,0x24,0x80,0x58,0x06,0x00, - 0x40,0x98,0x8c,0x27,0x21,0x10,0x6c,0x01,0x00,0x00,0x4d,0x8c, - 0x00,0x00,0x00,0x00,0x01,0x00,0xae,0x25,0x00,0x00,0x4e,0xac, - 0x00,0xa3,0x18,0x3c,0x10,0x0c,0x02,0x97,0x00,0x00,0x00,0x00, - 0x0c,0x00,0x40,0x10,0x01,0x00,0x01,0x24,0x05,0x00,0x41,0x14, - 0x00,0x00,0x00,0x00,0x86,0x0c,0x00,0x0c,0x00,0x00,0x00,0x00, - 0x07,0x00,0x00,0x10,0x14,0x00,0xbf,0x8f,0x38,0x8a,0x84,0x27, - 0x20,0x0c,0x00,0x0c,0xbf,0x01,0x05,0x24,0x00,0xa3,0x0f,0x3c, - 0x10,0x0c,0xe0,0xa5,0x14,0x00,0xbf,0x8f,0x30,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x40,0x00,0x82,0x8c,0x00,0x00,0x00,0x00, - 0x1e,0x00,0x41,0x28,0x04,0x00,0x20,0x10,0x3c,0x00,0x41,0x28, - 0x0e,0x00,0x00,0x10,0x21,0x18,0x00,0x00,0x3c,0x00,0x41,0x28, - 0x06,0x00,0x20,0x10,0x00,0x00,0x00,0x00,0x48,0x00,0x82,0x90, - 0x00,0x00,0x00,0x00,0x01,0x00,0x42,0x30,0x05,0x00,0x00,0x10, - 0x01,0x00,0x42,0x24,0x48,0x00,0x82,0x90,0x00,0x00,0x00,0x00, - 0x03,0x00,0x42,0x30,0x03,0x00,0x42,0x24,0x21,0x18,0x40,0x00, - 0x08,0x00,0xe0,0x03,0x21,0x10,0x60,0x00,0xd8,0xff,0xbd,0x27, - 0x1c,0x00,0xbf,0xaf,0x21,0x28,0x80,0x00,0x24,0x00,0xae,0x8c, - 0x80,0x92,0x84,0x8f,0x28,0x00,0xa5,0xaf,0x58,0x11,0x00,0x0c, - 0x24,0x00,0xae,0xaf,0x28,0x00,0xa5,0x8f,0x21,0x30,0x40,0x00, - 0x50,0x00,0xa3,0x94,0x00,0x00,0x00,0x00,0x01,0x00,0x6f,0x30, - 0x22,0x00,0xe0,0x15,0x00,0x00,0x00,0x00,0x28,0x00,0xb9,0x94, - 0x01,0x00,0x78,0x34,0x00,0x10,0x28,0x33,0x07,0x00,0x00,0x11, - 0x50,0x00,0xb8,0xa4,0x50,0x00,0xa9,0x94,0x00,0x80,0x0b,0x3c, - 0xa4,0x35,0x6b,0x25,0x00,0x02,0x2a,0x39,0x50,0x00,0xaa,0xa4, - 0x04,0x00,0xab,0xac,0x5f,0x00,0xad,0x90,0x68,0x00,0xac,0x90, - 0x03,0x00,0xae,0x31,0x24,0x00,0xb8,0x8f,0x27,0x78,0xc0,0x01, - 0x00,0x20,0x01,0x3c,0x24,0x18,0x8f,0x01,0x25,0x10,0xa1,0x00, - 0x10,0x00,0x03,0xa3,0x54,0x00,0x59,0x90,0x54,0x00,0x48,0x90, - 0x26,0x20,0x23,0x03,0x03,0x00,0x84,0x30,0xff,0x00,0x89,0x30, - 0x26,0x50,0x09,0x01,0x54,0x00,0x4a,0xa0,0x58,0x00,0x4b,0x90, - 0x56,0x00,0x4d,0x90,0x00,0x00,0x00,0x00,0x24,0x70,0x8d,0x00, - 0x25,0x60,0x6e,0x01,0x58,0x00,0x4c,0xa0,0x60,0x11,0x00,0x0c, - 0x21,0x20,0xc0,0x00,0x1c,0x00,0xbf,0x8f,0x28,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xd8,0xff,0xbd,0x27, - 0x1c,0x00,0xbf,0xaf,0x21,0x28,0x80,0x00,0x24,0x00,0xae,0x8c, - 0x80,0x92,0x84,0x8f,0x28,0x00,0xa5,0xaf,0x58,0x11,0x00,0x0c, - 0x24,0x00,0xae,0xaf,0x28,0x00,0xa5,0x8f,0x21,0x30,0x40,0x00, - 0x50,0x00,0xa3,0x94,0x00,0x00,0x00,0x00,0x01,0x00,0x6f,0x30, - 0x21,0x00,0xe0,0x11,0x00,0x00,0x00,0x00,0x28,0x00,0xb9,0x94, - 0xfe,0xff,0x78,0x30,0x00,0x10,0x28,0x33,0x07,0x00,0x00,0x11, - 0x50,0x00,0xb8,0xa4,0x50,0x00,0xa9,0x94,0x00,0x80,0x0b,0x3c, - 0xa4,0x35,0x6b,0x25,0x00,0x02,0x2a,0x39,0x50,0x00,0xaa,0xa4, - 0x04,0x00,0xab,0xac,0x5f,0x00,0xad,0x90,0x68,0x00,0xac,0x90, - 0x24,0x00,0xaf,0x8f,0x03,0x00,0xae,0x31,0x00,0x20,0x01,0x3c, - 0x25,0x18,0x8e,0x01,0x25,0x10,0xa1,0x00,0x10,0x00,0xe3,0xa1, - 0x54,0x00,0x58,0x90,0x54,0x00,0x59,0x90,0x26,0x20,0x03,0x03, - 0x03,0x00,0x84,0x30,0xff,0x00,0x88,0x30,0x26,0x48,0x28,0x03, - 0x54,0x00,0x49,0xa0,0x58,0x00,0x4a,0x90,0x56,0x00,0x4b,0x90, - 0x00,0x00,0x00,0x00,0x24,0x68,0x8b,0x00,0x25,0x60,0x4d,0x01, - 0x58,0x00,0x4c,0xa0,0x60,0x11,0x00,0x0c,0x21,0x20,0xc0,0x00, - 0x1c,0x00,0xbf,0x8f,0x28,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xd8,0xff,0xbd,0x27,0x18,0x00,0xb0,0xaf, - 0x21,0x80,0x80,0x00,0x1c,0x00,0xbf,0xaf,0x24,0x00,0x06,0x8e, - 0x21,0x38,0xa0,0x00,0x80,0x92,0x84,0x8f,0x2c,0x00,0xa7,0xaf, - 0x58,0x11,0x00,0x0c,0x24,0x00,0xa6,0xaf,0x2c,0x00,0xa7,0x8f, - 0x28,0x00,0x0f,0x96,0x30,0x00,0xe9,0x30,0x02,0x49,0x09,0x00, - 0x05,0x00,0x29,0x25,0x01,0x00,0x0e,0x24,0x04,0x18,0x2e,0x01, - 0x24,0x00,0xa6,0x8f,0xff,0xff,0x63,0x24,0x20,0x00,0xf8,0x31, - 0x21,0x50,0x40,0x00,0x02,0x00,0x08,0x24,0x21,0x20,0x60,0x00, - 0x02,0x00,0x00,0x13,0x62,0x00,0x03,0xa2,0x7f,0x00,0x64,0x30, - 0x6a,0x00,0x19,0x96,0x00,0x01,0xed,0x30,0x00,0xff,0x2b,0x33, - 0x25,0x60,0x64,0x01,0x6a,0x00,0x0c,0xa6,0x06,0x00,0xa0,0x11, - 0xfb,0xff,0x25,0x25,0x00,0x02,0xee,0x30,0x02,0x00,0xc0,0x15, - 0x08,0x00,0xa5,0x34,0x10,0x00,0xa5,0x34,0x03,0x00,0x08,0x24, - 0x40,0x00,0xef,0x30,0x04,0x00,0xe0,0x11,0x00,0x04,0xf8,0x30, - 0x04,0x00,0xa5,0x34,0x01,0x00,0x08,0x25,0x00,0x04,0xf8,0x30, - 0x0f,0x00,0x00,0x13,0x00,0x00,0x00,0x00,0x65,0x00,0x19,0x92, - 0x00,0x00,0x00,0x00,0x80,0x58,0x19,0x00,0x23,0x58,0x79,0x01, - 0x80,0x58,0x0b,0x00,0x23,0x58,0x79,0x01,0x80,0x58,0x0b,0x00, - 0x21,0x08,0x7c,0x01,0x38,0x94,0x2c,0x8c,0x03,0x00,0x01,0x24, - 0x03,0x00,0x81,0x11,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x10, - 0x70,0x8a,0x83,0x27,0x50,0x8a,0x83,0x27,0x0f,0x00,0xed,0x30, - 0x0c,0x00,0xd8,0x90,0x40,0x70,0x0d,0x00,0x21,0x78,0x6e,0x00, - 0x00,0x00,0xe2,0x95,0x80,0x00,0x19,0x37,0x21,0xc0,0x28,0x01, - 0x19,0x00,0x58,0x00,0x0c,0x00,0xd9,0xa0,0x7f,0x00,0x0b,0x24, - 0x04,0x00,0xcb,0xa0,0x00,0x00,0xc2,0xa0,0x03,0x62,0x02,0x00, - 0x04,0x00,0xcc,0xa0,0x0c,0x00,0xcd,0x90,0x21,0x20,0x40,0x01, - 0x40,0x00,0xae,0x31,0x21,0x78,0xc5,0x01,0x0c,0x00,0xcf,0xa0, - 0x12,0xc8,0x00,0x00,0x40,0x00,0x19,0xae,0x60,0x11,0x00,0x0c, - 0x2c,0x00,0x07,0xa6,0x20,0x1a,0x00,0x0c,0x21,0x20,0x00,0x02, - 0x21,0x20,0x00,0x02,0x16,0x17,0x00,0x0c,0x21,0x28,0x40,0x00, - 0x1c,0x00,0xbf,0x8f,0x18,0x00,0xb0,0x8f,0x08,0x00,0xe0,0x03, - 0x28,0x00,0xbd,0x27,0xe8,0xff,0xbd,0x27,0x21,0x30,0x80,0x00, - 0x14,0x00,0xbf,0xaf,0x80,0x92,0x84,0x8f,0x18,0x00,0xa6,0xaf, - 0x58,0x11,0x00,0x0c,0x1c,0x00,0xa5,0xaf,0x18,0x00,0xa6,0x8f, - 0x1c,0x00,0xa5,0x8f,0x28,0x00,0xce,0x94,0x21,0x20,0x40,0x00, - 0x26,0x78,0xae,0x00,0x00,0x10,0xf8,0x31,0x0b,0x00,0x00,0x13, - 0x00,0x00,0x00,0x00,0x50,0x00,0xc3,0x94,0x00,0x00,0x00,0x00, - 0x01,0x00,0x79,0x30,0x06,0x00,0x20,0x13,0x00,0x00,0x00,0x00, - 0x00,0x80,0x09,0x3c,0x00,0x02,0x68,0x34,0xa4,0x35,0x29,0x25, - 0x50,0x00,0xc8,0xa4,0x04,0x00,0xc9,0xac,0x62,0x00,0xc2,0x90, - 0x50,0x00,0xc3,0x94,0x20,0x00,0xaa,0x30,0x03,0x00,0x40,0x11, - 0x10,0x00,0xab,0x30,0x7f,0x00,0x42,0x30,0x10,0x00,0xab,0x30, - 0x02,0x00,0x60,0x11,0x00,0x1a,0x42,0x34,0x00,0x04,0x42,0x34, - 0xff,0xff,0x01,0x3c,0x6a,0x00,0xc2,0xa4,0xfb,0x3f,0x21,0x34, - 0x00,0x04,0xac,0x30,0x0d,0x00,0x80,0x11,0x24,0x10,0x61,0x00, - 0x00,0x20,0xad,0x30,0x02,0x00,0xa0,0x11,0x00,0x80,0x42,0x34, - 0x00,0x40,0x42,0x34,0x00,0x08,0xae,0x30,0x04,0x00,0xc0,0x11, - 0xff,0xef,0x01,0x24,0x06,0x00,0x00,0x10,0x04,0x00,0x42,0x34, - 0xff,0xef,0x01,0x24,0x03,0x00,0x00,0x10,0x24,0x10,0x41,0x00, - 0xff,0xe7,0x01,0x24,0x24,0x10,0x41,0x00,0x50,0x00,0xc2,0xa4, - 0x60,0x11,0x00,0x0c,0x28,0x00,0xc5,0xa4,0x14,0x00,0xbf,0x8f, - 0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xe8,0xff,0xbd,0x27,0x21,0x18,0x80,0x00,0x14,0x00,0xbf,0xaf, - 0x80,0x92,0x84,0x8f,0x18,0x00,0xa3,0xaf,0x58,0x11,0x00,0x0c, - 0x1c,0x00,0xa5,0xaf,0x1c,0x00,0xa5,0x8f,0x7f,0xff,0x01,0x24, - 0x18,0x00,0xa3,0x8f,0x24,0x70,0xa1,0x00,0x0b,0x00,0xc0,0x11, - 0x21,0x20,0x40,0x00,0x50,0x00,0x62,0x94,0x00,0x00,0x00,0x00, - 0x80,0x00,0x4f,0x30,0x04,0x00,0xe0,0x15,0x80,0x00,0x58,0x34, - 0x50,0x00,0x62,0x94,0x63,0x00,0x60,0xa0,0x80,0x00,0x58,0x34, - 0x05,0x00,0x00,0x10,0x50,0x00,0x78,0xa4,0x50,0x00,0x79,0x94, - 0x00,0x00,0x00,0x00,0x7f,0xff,0x28,0x33,0x50,0x00,0x68,0xa4, - 0x00,0x80,0x09,0x3c,0xa4,0x35,0x29,0x25,0x80,0x00,0xaa,0x30, - 0x04,0x00,0x40,0x11,0x04,0x00,0x69,0xac,0x7f,0x00,0x0b,0x24, - 0x02,0x00,0x00,0x10,0x60,0x00,0x6b,0xa0,0x60,0x00,0x60,0xa0, - 0x60,0x11,0x00,0x0c,0x2a,0x00,0x65,0xa4,0x14,0x00,0xbf,0x8f, - 0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xe8,0xff,0xbd,0x27,0x21,0x18,0x80,0x00,0x14,0x00,0xbf,0xaf, - 0x80,0x92,0x84,0x8f,0x18,0x00,0xa3,0xaf,0x58,0x11,0x00,0x0c, - 0x1c,0x00,0xa5,0xaf,0x18,0x00,0xa3,0x8f,0x1c,0x00,0xa5,0x8f, - 0x6c,0x00,0x6e,0x8c,0xff,0xff,0x06,0x24,0x09,0x00,0xce,0x14, - 0x21,0x20,0x40,0x00,0xff,0xff,0x01,0x34,0x06,0x00,0xa1,0x10, - 0x00,0x00,0x00,0x00,0x50,0x00,0x6f,0x94,0x6c,0x00,0x60,0xac, - 0xff,0xfe,0xf8,0x31,0x13,0x00,0x00,0x10,0x50,0x00,0x78,0xa4, - 0x50,0x00,0x68,0x94,0x00,0x80,0x0a,0x3c,0x01,0x00,0x19,0x24, - 0xa4,0x35,0x4a,0x25,0xff,0xff,0x01,0x34,0x00,0x01,0x09,0x35, - 0x4b,0x00,0x79,0xa0,0x50,0x00,0x69,0xa4,0x03,0x00,0xa1,0x14, - 0x04,0x00,0x6a,0xac,0x07,0x00,0x00,0x10,0x6c,0x00,0x66,0xac, - 0xc0,0x60,0x05,0x00,0x6c,0x00,0x6b,0x8c,0x21,0x60,0x85,0x01, - 0x40,0x62,0x0c,0x00,0x21,0x10,0x6c,0x01,0x6c,0x00,0x62,0xac, - 0x60,0x11,0x00,0x0c,0x00,0x00,0x00,0x00,0x14,0x00,0xbf,0x8f, - 0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xe0,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf,0x21,0x30,0x80,0x00, - 0x24,0x00,0xc7,0x8c,0x10,0x00,0xae,0x30,0x03,0x00,0xc0,0x11, - 0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x10,0x1f,0x00,0xa5,0x30, - 0x03,0x00,0xa5,0x30,0x08,0x00,0xa5,0x34,0x80,0x92,0x84,0x8f, - 0x24,0x00,0xa5,0xaf,0x20,0x00,0xa6,0xaf,0x58,0x11,0x00,0x0c, - 0x1c,0x00,0xa7,0xaf,0x20,0x00,0xa6,0x8f,0x24,0x00,0xa5,0x8f, - 0x50,0x00,0xcf,0x94,0x1c,0x00,0xa7,0x8f,0x01,0x00,0xf8,0x31, - 0x21,0x20,0x40,0x00,0x07,0x00,0x00,0x13,0x68,0x00,0xc5,0xa0, - 0x5f,0x00,0xd9,0x90,0x00,0x00,0x00,0x00,0x03,0x00,0x28,0x33, - 0x27,0x48,0x00,0x01,0x05,0x00,0x00,0x10,0x24,0x28,0xa9,0x00, - 0x5f,0x00,0xca,0x90,0x00,0x00,0x00,0x00,0x03,0x00,0x4b,0x31, - 0x25,0x28,0xab,0x00,0x00,0x20,0x01,0x3c,0x10,0x00,0xe5,0xa0, - 0x25,0x10,0xc1,0x00,0x54,0x00,0x4c,0x90,0x54,0x00,0x4d,0x90, - 0x26,0x18,0x85,0x01,0x03,0x00,0x63,0x30,0xff,0x00,0x6e,0x30, - 0x26,0x78,0xae,0x01,0x54,0x00,0x4f,0xa0,0x58,0x00,0x58,0x90, - 0x56,0x00,0x59,0x90,0x00,0x00,0x00,0x00,0x24,0x40,0x79,0x00, - 0x25,0x48,0x08,0x03,0x60,0x11,0x00,0x0c,0x58,0x00,0x49,0xa0, - 0x14,0x00,0xbf,0x8f,0x20,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xd8,0xff,0xbd,0x27,0x1c,0x00,0xbf,0xaf, - 0x21,0x30,0x80,0x00,0x24,0x00,0xce,0x8c,0xf3,0x00,0xa5,0x30, - 0x80,0x92,0x84,0x8f,0x2c,0x00,0xa5,0xaf,0x28,0x00,0xa6,0xaf, - 0x58,0x11,0x00,0x0c,0x24,0x00,0xae,0xaf,0x28,0x00,0xa6,0x8f, - 0x2c,0x00,0xa5,0x8f,0x4a,0x00,0xd8,0x90,0xf0,0x00,0xaf,0x30, - 0x49,0x00,0xcf,0xa0,0x49,0x00,0xc8,0x90,0x50,0x00,0xca,0x94, - 0x0f,0xff,0x01,0x24,0x24,0xc8,0x01,0x03,0x5f,0x00,0xc5,0xa0, - 0x25,0x48,0x28,0x03,0x01,0x00,0x4b,0x31,0x21,0x20,0x40,0x00, - 0x4a,0x00,0xc9,0xa0,0x05,0x00,0x60,0x11,0x03,0x00,0xa5,0x30, - 0x68,0x00,0xcd,0x90,0x27,0x60,0xa0,0x00,0x04,0x00,0x00,0x10, - 0x24,0x28,0x8d,0x01,0x68,0x00,0xce,0x90,0x00,0x00,0x00,0x00, - 0x25,0x28,0xae,0x00,0x24,0x00,0xaf,0x8f,0x00,0x20,0x01,0x3c, - 0x25,0x10,0xc1,0x00,0x10,0x00,0xe5,0xa1,0x54,0x00,0x58,0x90, - 0x54,0x00,0x59,0x90,0x26,0x18,0x05,0x03,0x03,0x00,0x63,0x30, - 0xff,0x00,0x68,0x30,0x26,0x48,0x28,0x03,0x54,0x00,0x49,0xa0, - 0x58,0x00,0x4a,0x90,0x56,0x00,0x4b,0x90,0x00,0x00,0x00,0x00, - 0x24,0x60,0x6b,0x00,0x25,0x68,0x4c,0x01,0x60,0x11,0x00,0x0c, - 0x58,0x00,0x4d,0xa0,0x1c,0x00,0xbf,0x8f,0x28,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xd8,0xff,0xbd,0x27, - 0x18,0x00,0xb0,0xaf,0x21,0x80,0x80,0x00,0x1c,0x00,0xbf,0xaf, - 0x24,0x00,0x05,0x8e,0x80,0x92,0x84,0x8f,0x58,0x11,0x00,0x0c, - 0x20,0x00,0xa5,0xaf,0x20,0x00,0xa5,0x8f,0x00,0x20,0x01,0x3c, - 0x25,0x18,0x01,0x02,0x0a,0x00,0x60,0xa4,0x0c,0x00,0x60,0xa4, - 0x12,0x00,0x60,0xa4,0x14,0x00,0x60,0xa4,0xff,0xff,0x0e,0x34, - 0x3f,0x00,0x0f,0x24,0x78,0x00,0x18,0x24,0x01,0x00,0x06,0x24, - 0x18,0x00,0x00,0xa6,0x1a,0x00,0x00,0xa6,0x1c,0x00,0x0e,0xa6, - 0x28,0x00,0x00,0xa6,0x2a,0x00,0x00,0xa6,0x2c,0x00,0x0f,0xa6, - 0x40,0x00,0x18,0xae,0x44,0x00,0x00,0xae,0x4b,0x00,0x00,0xa2, - 0x4c,0x00,0x66,0xa0,0x4d,0x00,0x66,0xa0,0x4e,0x00,0x66,0xa0, - 0xff,0x00,0x07,0x24,0x4f,0x00,0x60,0xa0,0x56,0x00,0x67,0xa0, - 0x10,0x00,0x19,0x24,0x50,0x00,0x19,0xa6,0x49,0x00,0x00,0xa2, - 0x4a,0x00,0x00,0xa2,0x54,0x00,0x60,0xa0,0x57,0x00,0x60,0xa0, - 0x58,0x00,0x60,0xa0,0x59,0x00,0x60,0xa0,0x5a,0x00,0x60,0xa0, - 0x5b,0x00,0x60,0xa0,0x00,0x80,0x0b,0x3c,0x00,0x80,0x0c,0x3c, - 0x00,0x80,0x0d,0x3c,0x11,0x00,0x08,0x24,0x13,0x00,0x09,0x24, - 0xff,0x0a,0x0a,0x24,0xa4,0x35,0x6b,0x25,0x90,0x3d,0x8c,0x25, - 0x0c,0x3a,0xad,0x25,0x5c,0x00,0x08,0xa2,0x5d,0x00,0x09,0xa2, - 0x5e,0x00,0x00,0xa2,0x5f,0x00,0x00,0xa2,0x60,0x00,0x00,0xa2, - 0x61,0x00,0x00,0xa2,0x62,0x00,0x07,0xa2,0x63,0x00,0x00,0xa2, - 0x64,0x00,0x00,0xa2,0x66,0x00,0x00,0xa2,0x67,0x00,0x00,0xa2, - 0x68,0x00,0x00,0xa2,0x69,0x00,0x00,0xa2,0x6a,0x00,0x0a,0xa6, - 0x6c,0x00,0x00,0xae,0x04,0x00,0x0b,0xae,0x74,0x00,0x0c,0xae, - 0x34,0x00,0x0d,0xae,0x80,0x00,0x0e,0x24,0x0c,0x00,0x0f,0x24, - 0x0c,0x00,0xae,0xa0,0x00,0x00,0xaf,0xa0,0x03,0x00,0x18,0x24, - 0x04,0x00,0xa0,0xa0,0x0c,0x00,0xb8,0xa0,0x0f,0x00,0x19,0x24, - 0x08,0x00,0xa6,0xa0,0x08,0x00,0xb9,0xa0,0x08,0x00,0x08,0x24, - 0x04,0x00,0xa6,0xa0,0x10,0x00,0xa8,0xa0,0x08,0x00,0xa0,0x90, - 0x00,0x00,0xa0,0x90,0x14,0x00,0xa0,0x90,0x18,0x00,0xa0,0x90, - 0x60,0x11,0x00,0x0c,0x21,0x20,0x40,0x00,0x20,0x1a,0x00,0x0c, - 0x21,0x20,0x00,0x02,0x21,0x20,0x00,0x02,0x16,0x17,0x00,0x0c, - 0x21,0x28,0x40,0x00,0x1c,0x00,0xbf,0x8f,0x18,0x00,0xb0,0x8f, - 0x08,0x00,0xe0,0x03,0x28,0x00,0xbd,0x27,0x10,0x94,0x8e,0x27, - 0x23,0x78,0xae,0x00,0x2c,0x00,0x01,0x24,0x1a,0x00,0xe1,0x01, - 0xe8,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf,0x48,0x00,0x86,0xa0, - 0x40,0x41,0x06,0x00,0x12,0xc0,0x00,0x00,0x65,0x00,0x98,0xa0, - 0x04,0x00,0xb9,0x8c,0x00,0x00,0x00,0x00,0x21,0x48,0x28,0x03, - 0x00,0x01,0x2a,0x25,0x24,0x00,0x8a,0xac,0x01,0x1c,0x00,0x0c, - 0x18,0x00,0xa4,0xaf,0xbc,0x92,0x8b,0x8f,0x18,0x00,0xa4,0x8f, - 0x03,0x00,0x60,0x15,0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x10, - 0x30,0x00,0x84,0xac,0xbc,0x92,0x8c,0x8f,0x00,0x00,0x00,0x00, - 0x30,0x00,0x8d,0x8d,0x00,0x00,0x00,0x00,0x30,0x00,0x8d,0xac, - 0xbc,0x92,0x8e,0x8f,0x00,0x00,0x00,0x00,0x30,0x00,0xc4,0xad, - 0x14,0x00,0xbf,0x8f,0xbc,0x92,0x84,0xaf,0x08,0x00,0xe0,0x03, - 0x18,0x00,0xbd,0x27,0x00,0x00,0x00,0x00,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xe8,0xff,0xbd,0x27,0x21,0x28,0x80,0x00, - 0x14,0x00,0xbf,0xaf,0x80,0x92,0x84,0x8f,0x58,0x11,0x00,0x0c, - 0x18,0x00,0xa5,0xaf,0x18,0x00,0xa5,0x8f,0x21,0x38,0x40,0x00, - 0x50,0x00,0xa6,0x94,0x00,0x00,0x00,0x00,0x01,0x00,0xce,0x30, - 0x17,0x00,0xc0,0x15,0x00,0x00,0x00,0x00,0x5f,0x00,0xb9,0x90, - 0x01,0x00,0xcf,0x34,0x00,0x20,0x01,0x3c,0x68,0x00,0xb8,0x90, - 0x50,0x00,0xaf,0xa4,0x25,0x10,0xa1,0x00,0x03,0x00,0x28,0x33, - 0x54,0x00,0x4a,0x90,0x27,0x48,0x00,0x01,0x24,0x20,0x09,0x03, - 0x26,0x18,0x44,0x01,0x54,0x00,0x4b,0x90,0x03,0x00,0x63,0x30, - 0xff,0x00,0x6c,0x30,0x26,0x68,0x6c,0x01,0x54,0x00,0x4d,0xa0, - 0x58,0x00,0x4e,0x90,0x56,0x00,0x4f,0x90,0x00,0x00,0x00,0x00, - 0x24,0xc8,0x6f,0x00,0x25,0x40,0xd9,0x01,0x58,0x00,0x48,0xa0, - 0x60,0x11,0x00,0x0c,0x21,0x20,0xe0,0x00,0x14,0x00,0xbf,0x8f, - 0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00, - 0xe8,0xff,0xbd,0x27,0x21,0x28,0x80,0x00,0x14,0x00,0xbf,0xaf, - 0x80,0x92,0x84,0x8f,0x58,0x11,0x00,0x0c,0x18,0x00,0xa5,0xaf, - 0x18,0x00,0xa5,0x8f,0x21,0x38,0x40,0x00,0x50,0x00,0xa6,0x94, - 0x00,0x00,0x00,0x00,0x01,0x00,0xce,0x30,0x16,0x00,0xc0,0x11, - 0x00,0x00,0x00,0x00,0x5f,0x00,0xb9,0x90,0xfe,0xff,0xcf,0x30, - 0x00,0x20,0x01,0x3c,0x68,0x00,0xb8,0x90,0x50,0x00,0xaf,0xa4, - 0x25,0x10,0xa1,0x00,0x54,0x00,0x49,0x90,0x03,0x00,0x28,0x33, - 0x25,0x20,0x08,0x03,0x26,0x18,0x24,0x01,0x54,0x00,0x4a,0x90, - 0x03,0x00,0x63,0x30,0xff,0x00,0x6b,0x30,0x26,0x60,0x4b,0x01, - 0x54,0x00,0x4c,0xa0,0x58,0x00,0x4d,0x90,0x56,0x00,0x4e,0x90, - 0x00,0x00,0x00,0x00,0x24,0x78,0x6e,0x00,0x25,0xc8,0xaf,0x01, - 0x58,0x00,0x59,0xa0,0x60,0x11,0x00,0x0c,0x21,0x20,0xe0,0x00, - 0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xd0,0xff,0xbd,0x27,0x14,0x00,0xbf,0xaf, - 0x21,0x38,0x80,0x00,0x24,0x00,0xe6,0x8c,0xf3,0x00,0xa5,0x30, - 0x80,0x92,0x84,0x8f,0x34,0x00,0xa5,0xaf,0x30,0x00,0xa7,0xaf, - 0x58,0x11,0x00,0x0c,0x2c,0x00,0xa6,0xaf,0x30,0x00,0xa7,0x8f, - 0x34,0x00,0xa5,0x8f,0x2c,0x00,0xa6,0x8f,0xf0,0x00,0xae,0x30, - 0x4a,0x00,0xef,0x90,0x49,0x00,0xee,0xa0,0x49,0x00,0xf9,0x90, - 0x50,0x00,0xe9,0x94,0x0f,0xff,0x01,0x24,0x24,0xc0,0xe1,0x01, - 0x5f,0x00,0xe5,0xa0,0x25,0x40,0x19,0x03,0x01,0x00,0x2a,0x31, - 0x21,0x20,0x40,0x00,0x4a,0x00,0xe8,0xa0,0x05,0x00,0x40,0x11, - 0x03,0x00,0xa5,0x30,0x68,0x00,0xec,0x90,0x27,0x58,0xa0,0x00, - 0x04,0x00,0x00,0x10,0x24,0x28,0x6c,0x01,0x68,0x00,0xed,0x90, - 0x00,0x00,0x00,0x00,0x25,0x28,0xad,0x00,0x4a,0x00,0xe3,0x90, - 0x00,0x00,0x00,0x00,0x20,0x00,0x63,0x30,0x04,0x00,0x60,0x10, - 0x21,0x10,0x00,0x00,0x02,0x00,0x00,0x10,0x04,0x00,0x02,0x24, - 0x21,0x10,0x00,0x00,0x28,0x00,0xce,0x90,0x00,0x00,0x00,0x00, - 0x04,0x00,0xcf,0x31,0x47,0x00,0x4f,0x10,0x00,0x20,0x01,0x3c, - 0x04,0x00,0x60,0x10,0x00,0x00,0x00,0x00,0x04,0x00,0x18,0x24, - 0x02,0x00,0x00,0x10,0x28,0x00,0xd8,0xa0,0x28,0x00,0xc0,0xa0, - 0x10,0x27,0x19,0x24,0x1c,0x00,0xb9,0xaf,0x1c,0x00,0xa2,0x8f, - 0x1c,0x00,0xa8,0x8f,0x00,0x00,0x00,0x00,0xff,0xff,0x09,0x25, - 0x0f,0x00,0x40,0x10,0x1c,0x00,0xa9,0xaf,0x2c,0x00,0xca,0x90, - 0x00,0x00,0x00,0x00,0x0c,0x00,0x40,0x11,0x80,0x00,0x0e,0x24, - 0x1c,0x00,0xa2,0x8f,0x1c,0x00,0xab,0x8f,0x00,0x00,0x00,0x00, - 0xff,0xff,0x6c,0x25,0x05,0x00,0x40,0x10,0x1c,0x00,0xac,0xaf, - 0x2c,0x00,0xcd,0x90,0x00,0x00,0x00,0x00,0xf8,0xff,0xa0,0x15, - 0x1c,0x00,0xa2,0x8f,0x80,0x00,0x0e,0x24,0x2c,0x00,0xce,0xa0, - 0x10,0x27,0x0f,0x24,0x18,0x00,0xaf,0xaf,0x18,0x00,0xa2,0x8f, - 0x18,0x00,0xb8,0x8f,0x00,0x00,0x00,0x00,0xff,0xff,0x19,0x27, - 0x0f,0x00,0x40,0x10,0x18,0x00,0xb9,0xaf,0x2c,0x00,0xc8,0x90, - 0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x11,0x41,0x00,0x0c,0x24, - 0x18,0x00,0xa2,0x8f,0x18,0x00,0xa9,0x8f,0x00,0x00,0x00,0x00, - 0xff,0xff,0x2a,0x25,0x05,0x00,0x40,0x10,0x18,0x00,0xaa,0xaf, - 0x2c,0x00,0xcb,0x90,0x00,0x00,0x00,0x00,0xf8,0xff,0x60,0x15, - 0x18,0x00,0xa2,0x8f,0x41,0x00,0x0c,0x24,0x2c,0x00,0xcc,0xa0, - 0x2c,0x00,0xe2,0x94,0x00,0x00,0x00,0x00,0x0f,0x00,0x43,0x30, - 0x04,0x00,0x61,0x28,0x06,0x00,0x20,0x10,0x21,0x08,0x7c,0x00, - 0x00,0x04,0x4d,0x30,0x03,0x00,0xa0,0x11,0x21,0x08,0x7c,0x00, - 0x21,0x18,0x00,0x00,0x21,0x08,0x7c,0x00,0x90,0x8a,0x22,0x90, - 0x00,0x00,0x00,0x00,0x08,0x00,0xc2,0xa0,0x0c,0x00,0xc2,0xa0, - 0x00,0x20,0x01,0x3c,0x25,0x10,0xe1,0x00,0x54,0x00,0x4e,0x90, - 0x54,0x00,0x4f,0x90,0x26,0x18,0xc5,0x01,0x03,0x00,0x63,0x30, - 0xff,0x00,0x78,0x30,0x26,0xc8,0xf8,0x01,0x54,0x00,0x59,0xa0, - 0x58,0x00,0x48,0x90,0x56,0x00,0x49,0x90,0x00,0x00,0x00,0x00, - 0x24,0x50,0x69,0x00,0x25,0x58,0x0a,0x01,0x60,0x11,0x00,0x0c, - 0x58,0x00,0x4b,0xa0,0x14,0x00,0xbf,0x8f,0x30,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xe0,0xff,0xbd,0x27, - 0x20,0x00,0xa4,0xaf,0x1c,0x00,0xbf,0xaf,0x80,0x92,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x24,0x00,0xa5,0xaf,0x24,0x00,0xae,0x8f, - 0x20,0x00,0xaf,0x8f,0x21,0x20,0x40,0x00,0x60,0x11,0x00,0x0c, - 0x28,0x00,0xee,0xa5,0x1c,0x00,0xbf,0x8f,0x20,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xe0,0xff,0xbd,0x27, - 0x14,0x00,0xbf,0xaf,0x21,0x30,0x80,0x00,0x24,0x00,0xc7,0x8c, - 0x80,0x92,0x84,0x8f,0x20,0x00,0xa6,0xaf,0x24,0x00,0xa5,0xaf, - 0x58,0x11,0x00,0x0c,0x1c,0x00,0xa7,0xaf,0x24,0x00,0xa5,0x8f, - 0x20,0x00,0xa6,0x8f,0x1c,0x00,0xa7,0x8f,0x2c,0x00,0xc5,0xa4, - 0x2c,0x00,0xc3,0x94,0x21,0x20,0x40,0x00,0x0f,0x00,0x65,0x30, - 0x04,0x00,0xa1,0x2c,0x06,0x00,0x20,0x10,0x21,0x08,0xbc,0x00, - 0x00,0x04,0x6e,0x30,0x03,0x00,0xc0,0x11,0x21,0x08,0xbc,0x00, - 0x21,0x28,0x00,0x00,0x21,0x08,0xbc,0x00,0x90,0x8a,0x22,0x90, - 0x00,0x00,0x00,0x00,0x08,0x00,0xe2,0xa0,0x0c,0x00,0xe2,0xa0, - 0x60,0x11,0x00,0x0c,0x20,0x00,0xa6,0xaf,0x20,0x00,0xa6,0x8f, - 0x21,0x28,0x00,0x00,0x16,0x17,0x00,0x0c,0x21,0x20,0xc0,0x00, - 0x14,0x00,0xbf,0x8f,0x20,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0xe8,0xff,0xbd,0x27,0x21,0x18,0x80,0x00, - 0x14,0x00,0xbf,0xaf,0x80,0x92,0x84,0x8f,0x1c,0x00,0xa5,0xaf, - 0x58,0x11,0x00,0x0c,0x18,0x00,0xa3,0xaf,0x1c,0x00,0xa5,0x8f, - 0x7f,0xff,0x01,0x24,0x18,0x00,0xa3,0x8f,0x24,0x70,0xa1,0x00, - 0x0b,0x00,0xc0,0x11,0x21,0x20,0x40,0x00,0x50,0x00,0x62,0x94, - 0x00,0x00,0x00,0x00,0x80,0x00,0x4f,0x30,0x04,0x00,0xe0,0x15, - 0x80,0x00,0x58,0x34,0x50,0x00,0x62,0x94,0x63,0x00,0x60,0xa0, - 0x80,0x00,0x58,0x34,0x05,0x00,0x00,0x10,0x50,0x00,0x78,0xa4, - 0x50,0x00,0x79,0x94,0x00,0x00,0x00,0x00,0x7f,0xff,0x28,0x33, - 0x50,0x00,0x68,0xa4,0x00,0x80,0x09,0x3c,0x00,0x80,0x0a,0x3c, - 0xa4,0x35,0x29,0x25,0x20,0x44,0x4a,0x25,0x04,0x00,0x69,0xac, - 0x74,0x00,0x60,0xac,0x34,0x00,0x6a,0xac,0x60,0x11,0x00,0x0c, - 0x2a,0x00,0x65,0xa4,0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xe8,0xff,0xbd,0x27, - 0x18,0x00,0xa4,0xaf,0x14,0x00,0xbf,0xaf,0x80,0x92,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x00,0x00,0x00,0x00,0x60,0x11,0x00,0x0c, - 0x21,0x20,0x40,0x00,0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xe0,0xff,0xbd,0x27, - 0x20,0x00,0xa4,0xaf,0x1c,0x00,0xbf,0xaf,0x80,0x92,0x84,0x8f, - 0x58,0x11,0x00,0x0c,0x24,0x00,0xa5,0xaf,0x24,0x00,0xae,0x8f, - 0x20,0x00,0xaf,0x8f,0x21,0x20,0x40,0x00,0x60,0x11,0x00,0x0c, - 0x68,0x00,0xee,0xa1,0x1c,0x00,0xbf,0x8f,0x20,0x00,0xbd,0x27, - 0x08,0x00,0xe0,0x03,0x00,0x00,0x00,0x00,0xd0,0xff,0xbd,0x27, - 0x14,0x00,0xbf,0xaf,0x21,0x30,0x80,0x00,0x48,0x00,0xc2,0x90, - 0x00,0x00,0x00,0x00,0x08,0x00,0x41,0x2c,0x06,0x00,0x20,0x10, - 0x08,0x00,0x01,0x24,0x01,0x1c,0x00,0x0c,0x21,0x20,0xc0,0x00, - 0x8d,0x00,0x00,0x10,0x14,0x00,0xbf,0x8f,0x08,0x00,0x01,0x24, - 0x8a,0x00,0x41,0x14,0x14,0x00,0xbf,0x8f,0x65,0x00,0xce,0x90, - 0x00,0x00,0x00,0x00,0x80,0x78,0x0e,0x00,0x23,0x78,0xee,0x01, - 0x80,0x78,0x0f,0x00,0x23,0x78,0xee,0x01,0x80,0x78,0x0f,0x00, - 0x21,0x08,0xfc,0x01,0x38,0x94,0x38,0x8c,0x06,0x00,0x01,0x24, - 0x7e,0x00,0x01,0x13,0x14,0x00,0xbf,0x8f,0x24,0x00,0xc5,0x8c, - 0x80,0x92,0x84,0x8f,0x30,0x00,0xa6,0xaf,0x58,0x11,0x00,0x0c, - 0x28,0x00,0xa5,0xaf,0x30,0x00,0xa6,0x8f,0x28,0x00,0xa5,0x8f, - 0x00,0x20,0x01,0x3c,0x25,0x18,0xc1,0x00,0x0a,0x00,0x60,0xa4, - 0x0c,0x00,0x60,0xa4,0x12,0x00,0x60,0xa4,0x14,0x00,0x60,0xa4, - 0xff,0xff,0x19,0x34,0x01,0x00,0x04,0x24,0x18,0x00,0xc0,0xa4, - 0x1a,0x00,0xc0,0xa4,0x1c,0x00,0xd9,0xa4,0x28,0x00,0xc0,0xa4, - 0x2a,0x00,0xc0,0xa4,0x2c,0x00,0xc0,0xa4,0x40,0x00,0xc0,0xac, - 0x44,0x00,0xc0,0xac,0x4b,0x00,0xc0,0xa0,0x4c,0x00,0x64,0xa0, - 0x4d,0x00,0x64,0xa0,0x4e,0x00,0x64,0xa0,0x4f,0x00,0x60,0xa0, - 0x56,0x00,0x60,0xa0,0x20,0x00,0x08,0x24,0x50,0x00,0xc8,0xa4, - 0x49,0x00,0xc0,0xa0,0x4a,0x00,0xc0,0xa0,0x54,0x00,0x60,0xa0, - 0x57,0x00,0x60,0xa0,0x58,0x00,0x60,0xa0,0x59,0x00,0x60,0xa0, - 0x5a,0x00,0x60,0xa0,0x5b,0x00,0x60,0xa0,0x00,0x80,0x09,0x3c, - 0x00,0x80,0x0a,0x3c,0xa4,0x35,0x29,0x25,0x20,0x44,0x4a,0x25, - 0x5c,0x00,0xc0,0xa0,0x5d,0x00,0xc0,0xa0,0x5e,0x00,0xc0,0xa0, - 0x5f,0x00,0xc0,0xa0,0x60,0x00,0xc0,0xa0,0x61,0x00,0xc0,0xa0, - 0x62,0x00,0xc0,0xa0,0x63,0x00,0xc0,0xa0,0x64,0x00,0xc0,0xa0, - 0x66,0x00,0xc0,0xa0,0x67,0x00,0xc0,0xa0,0x68,0x00,0xc0,0xa0, - 0x69,0x00,0xc0,0xa0,0x6a,0x00,0xc0,0xa4,0x6c,0x00,0xc0,0xac, - 0x04,0x00,0xc9,0xac,0x74,0x00,0xc0,0xac,0x34,0x00,0xca,0xac, - 0x10,0x27,0x0b,0x24,0x28,0x00,0xa0,0xa0,0x21,0x38,0x40,0x00, - 0x20,0x00,0xab,0xaf,0x20,0x00,0xa2,0x8f,0x20,0x00,0xac,0x8f, - 0x00,0x00,0x00,0x00,0xff,0xff,0x8d,0x25,0x0f,0x00,0x40,0x10, - 0x20,0x00,0xad,0xaf,0x2c,0x00,0xae,0x90,0x00,0x00,0x00,0x00, - 0x0c,0x00,0xc0,0x11,0x80,0x00,0x08,0x24,0x20,0x00,0xa2,0x8f, - 0x20,0x00,0xaf,0x8f,0x00,0x00,0x00,0x00,0xff,0xff,0xf8,0x25, - 0x05,0x00,0x40,0x10,0x20,0x00,0xb8,0xaf,0x2c,0x00,0xb9,0x90, - 0x00,0x00,0x00,0x00,0xf8,0xff,0x20,0x17,0x20,0x00,0xa2,0x8f, - 0x80,0x00,0x08,0x24,0x2c,0x00,0xa8,0xa0,0x10,0x27,0x09,0x24, - 0x18,0x00,0xa9,0xaf,0x18,0x00,0xa2,0x8f,0x18,0x00,0xaa,0x8f, - 0x00,0x00,0x00,0x00,0xff,0xff,0x4b,0x25,0x0f,0x00,0x40,0x10, - 0x18,0x00,0xab,0xaf,0x2c,0x00,0xac,0x90,0x00,0x00,0x00,0x00, - 0x0c,0x00,0x80,0x11,0x41,0x00,0x18,0x24,0x18,0x00,0xa2,0x8f, - 0x18,0x00,0xad,0x8f,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x25, - 0x05,0x00,0x40,0x10,0x18,0x00,0xae,0xaf,0x2c,0x00,0xaf,0x90, - 0x00,0x00,0x00,0x00,0xf8,0xff,0xe0,0x15,0x18,0x00,0xa2,0x8f, - 0x41,0x00,0x18,0x24,0x2c,0x00,0xb8,0xa0,0x09,0x00,0x19,0x24, - 0x78,0x00,0xb9,0xa0,0x90,0x8a,0x88,0x93,0x21,0x20,0xe0,0x00, - 0x21,0x10,0x00,0x01,0x08,0x00,0xa8,0xa0,0x0c,0x00,0xa2,0xa0, - 0x60,0x11,0x00,0x0c,0x30,0x00,0xa6,0xaf,0x30,0x00,0xa6,0x8f, - 0x21,0x28,0x00,0x00,0x16,0x17,0x00,0x0c,0x21,0x20,0xc0,0x00, - 0x14,0x00,0xbf,0x8f,0x30,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0x10,0x94,0x8e,0x27,0x23,0x78,0xae,0x00, - 0x2c,0x00,0x01,0x24,0x1a,0x00,0xe1,0x01,0xe8,0xff,0xbd,0x27, - 0x14,0x00,0xbf,0xaf,0x08,0x00,0xc1,0x28,0x48,0x00,0x86,0xa0, - 0x12,0xc0,0x00,0x00,0x65,0x00,0x98,0xa0,0x08,0x00,0x20,0x10, - 0x08,0x00,0x01,0x24,0x04,0x00,0xb9,0x8c,0x40,0x41,0x06,0x00, - 0x21,0x48,0x28,0x03,0x00,0x01,0x2a,0x25,0x0c,0x00,0x00,0x10, - 0x24,0x00,0x8a,0xac,0x08,0x00,0x01,0x24,0x25,0x00,0xc1,0x14, - 0x14,0x00,0xbf,0x8f,0x28,0x00,0xab,0x8c,0x06,0x00,0x01,0x24, - 0x21,0x00,0x61,0x11,0x14,0x00,0xbf,0x8f,0x04,0x00,0xac,0x8c, - 0x00,0x00,0x00,0x00,0x00,0x08,0x8d,0x25,0x24,0x00,0x8d,0xac, - 0x08,0x00,0xc1,0x28,0x06,0x00,0x20,0x10,0x00,0x00,0x00,0x00, - 0x01,0x1c,0x00,0x0c,0x18,0x00,0xa4,0xaf,0x18,0x00,0xa4,0x8f, - 0x05,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0xdb,0x1d,0x00,0x0c, - 0x18,0x00,0xa4,0xaf,0x18,0x00,0xa4,0x8f,0x00,0x00,0x00,0x00, - 0xbc,0x92,0x8e,0x8f,0x00,0x00,0x00,0x00,0x03,0x00,0xc0,0x15, - 0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x10,0x30,0x00,0x84,0xac, - 0xbc,0x92,0x8f,0x8f,0x00,0x00,0x00,0x00,0x30,0x00,0xf8,0x8d, - 0x00,0x00,0x00,0x00,0x30,0x00,0x98,0xac,0xbc,0x92,0x99,0x8f, - 0x00,0x00,0x00,0x00,0x30,0x00,0x24,0xaf,0xbc,0x92,0x84,0xaf, - 0x14,0x00,0xbf,0x8f,0x18,0x00,0xbd,0x27,0x08,0x00,0xe0,0x03, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x2e,0x2e,0x2f,0x65,0x78,0x63,0x65,0x70,0x74,0x69,0x6f,0x6e, - 0x2e,0x73,0x00,0x00,0x84,0x46,0x00,0x80,0xc0,0x46,0x00,0x80, - 0xfc,0x46,0x00,0x80,0x2c,0x47,0x00,0x80,0x5c,0x47,0x00,0x80, - 0x28,0x49,0x00,0x80,0x8c,0x47,0x00,0x80,0x28,0x49,0x00,0x80, - 0xa4,0x47,0x00,0x80,0xcc,0x47,0x00,0x80,0xf8,0x47,0x00,0x80, - 0x0c,0x48,0x00,0x80,0x1c,0x48,0x00,0x80,0x28,0x49,0x00,0x80, - 0x24,0x48,0x00,0x80,0x34,0x48,0x00,0x80,0x44,0x48,0x00,0x80, - 0x28,0x49,0x00,0x80,0x28,0x49,0x00,0x80,0x78,0x48,0x00,0x80, - 0x8c,0x48,0x00,0x80,0xb8,0x48,0x00,0x80,0xcc,0x48,0x00,0x80, - 0xe8,0x49,0x00,0x80,0x24,0x4a,0x00,0x80,0x60,0x4a,0x00,0x80, - 0x90,0x4a,0x00,0x80,0xc0,0x4a,0x00,0x80,0x88,0x4c,0x00,0x80, - 0xf0,0x4a,0x00,0x80,0x88,0x4c,0x00,0x80,0x08,0x4b,0x00,0x80, - 0x2c,0x4b,0x00,0x80,0x58,0x4b,0x00,0x80,0x6c,0x4b,0x00,0x80, - 0x7c,0x4b,0x00,0x80,0x88,0x4c,0x00,0x80,0x84,0x4b,0x00,0x80, - 0x94,0x4b,0x00,0x80,0xa4,0x4b,0x00,0x80,0x88,0x4c,0x00,0x80, - 0x88,0x4c,0x00,0x80,0xd8,0x4b,0x00,0x80,0xec,0x4b,0x00,0x80, - 0x18,0x4c,0x00,0x80,0x2c,0x4c,0x00,0x80,0x54,0x53,0x00,0x80, - 0xe4,0x54,0x00,0x80,0x54,0x53,0x00,0x80,0xb0,0x53,0x00,0x80, - 0xe4,0x54,0x00,0x80,0xd8,0x53,0x00,0x80,0xd8,0x53,0x00,0x80, - 0xd8,0x53,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x34,0x36,0x00,0x80,0xc8,0x35,0x00,0x80,0x04,0x36,0x00,0x80, - 0x34,0x36,0x00,0x80,0xcc,0x3c,0x00,0x80,0xd8,0x3a,0x00,0x80, - 0xcc,0x3c,0x00,0x80,0x5c,0x3b,0x00,0x80,0x28,0x38,0x00,0x80, - 0x70,0x37,0x00,0x80,0x28,0x38,0x00,0x80,0x08,0x3d,0x00,0x80, - 0xd0,0x36,0x00,0x80,0xd0,0x36,0x00,0x80,0xd0,0x36,0x00,0x80, - 0xd0,0x36,0x00,0x80,0x68,0x36,0x00,0x80,0x68,0x36,0x00,0x80, - 0x68,0x36,0x00,0x80,0x68,0x36,0x00,0x80,0x68,0x36,0x00,0x80, - 0x68,0x36,0x00,0x80,0x68,0x36,0x00,0x80,0x68,0x36,0x00,0x80, - 0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80, - 0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80, - 0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80, - 0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80, - 0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80,0xf8,0x36,0x00,0x80, - 0xf8,0x36,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xa4,0x3e,0x00,0x80,0xc0,0x3e,0x00,0x80,0x58,0x3f,0x00,0x80, - 0x30,0x3f,0x00,0x80,0x44,0x3f,0x00,0x80,0xa0,0x3f,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80, - 0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80, - 0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80, - 0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80, - 0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80, - 0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80, - 0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80, - 0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80, - 0x5c,0x3e,0x00,0x80,0x5c,0x3e,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xf8,0x3d,0x00,0x80,0x90,0x3e,0x00,0x80, - 0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80, - 0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80, - 0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80, - 0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80, - 0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80, - 0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80, - 0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80, - 0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80,0x90,0x3e,0x00,0x80, - 0x90,0x3e,0x00,0x80,0x0c,0x3e,0x00,0x80,0x20,0x3e,0x00,0x80, - 0x34,0x3e,0x00,0x80,0x48,0x3e,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xc0,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80, - 0xbc,0x3d,0x00,0x80,0xbc,0x3d,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0x18,0x3c,0x00,0x80,0x90,0x3c,0x00,0x80, - 0x28,0x3c,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0x5c,0x3c,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80, - 0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80, - 0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80, - 0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80, - 0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80, - 0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80, - 0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80, - 0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80, - 0xd4,0x3b,0x00,0x80,0xd4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80,0xe8,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80,0xe4,0x3b,0x00,0x80, - 0x04,0x39,0x00,0x80,0x30,0x42,0x00,0x80,0x84,0x41,0x00,0x80, - 0x84,0x41,0x00,0x80,0x04,0x39,0x00,0x80,0x30,0x42,0x00,0x80, - 0x84,0x41,0x00,0x80,0x84,0x41,0x00,0x80,0x04,0x39,0x00,0x80, - 0x30,0x42,0x00,0x80,0x84,0x41,0x00,0x80,0x84,0x41,0x00,0x80, - 0x04,0x39,0x00,0x80,0x30,0x42,0x00,0x80,0x84,0x41,0x00,0x80, - 0x84,0x41,0x00,0x80,0xd0,0x38,0x00,0x80,0x30,0x42,0x00,0x80, - 0x84,0x41,0x00,0x80,0x84,0x41,0x00,0x80,0x4c,0x42,0x00,0x80, - 0x30,0x42,0x00,0x80,0x84,0x41,0x00,0x80,0x84,0x41,0x00,0x80, - 0xd0,0x40,0x00,0x80,0x30,0x42,0x00,0x80,0x84,0x41,0x00,0x80, - 0x84,0x41,0x00,0x80,0xa0,0x40,0x00,0x80,0x30,0x42,0x00,0x80, - 0x84,0x41,0x00,0x80,0x84,0x41,0x00,0x80,0xc0,0x3d,0x00,0x80, - 0xe0,0x3e,0x00,0x80,0xf8,0x3e,0x00,0x80,0x00,0x3f,0x00,0x80, - 0xc0,0x3d,0x00,0x80,0xe8,0x3f,0x00,0x80,0xf4,0x3f,0x00,0x80, - 0xfc,0x3f,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x2e,0x2e,0x2f,0x73,0x6d,0x61,0x72,0x74,0x66,0x65,0x70,0x2e, - 0x63,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x2e,0x2e,0x2f,0x73,0x6d,0x61,0x72,0x74,0x6d,0x61,0x69,0x6e, - 0x2e,0x63,0x00,0x00,0x2e,0x2e,0x2f,0x73,0x6d,0x61,0x72,0x74, - 0x6d,0x61,0x69,0x6e,0x2e,0x63,0x00,0x00,0x2e,0x2e,0x2f,0x63, - 0x6f,0x6d,0x6d,0x6f,0x6e,0x2e,0x63,0x00,0x2e,0x2e,0x2f,0x63, - 0x6f,0x6d,0x6d,0x6f,0x6e,0x2e,0x63,0x00,0x2e,0x2e,0x2f,0x63, - 0x6f,0x6d,0x6d,0x6f,0x6e,0x2e,0x63,0x00,0x2e,0x2e,0x2f,0x63, - 0x6f,0x6d,0x6d,0x6f,0x6e,0x2e,0x63,0x00,0x0c,0x00,0x34,0x00, - 0x00,0x00,0x41,0x0b,0x00,0x00,0x0b,0x00,0x0c,0x00,0xe2,0x00, - 0x00,0x00,0x40,0x00,0x0c,0x00,0x74,0x00,0x04,0x00,0x6e,0x00, - 0x04,0x00,0x00,0x00,0x0c,0x00,0xe4,0x00,0x04,0x00,0x40,0x00, - 0x0c,0x00,0xb4,0x00,0x08,0x00,0x00,0x00,0x08,0x00,0x00,0x00, - 0x0c,0x00,0xe8,0x00,0x08,0x00,0x40,0x00,0x2e,0x2e,0x2f,0x74, - 0x69,0x6d,0x65,0x72,0x2e,0x63,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x12,0x00,0x00,0x00, - 0x93,0x00,0x00,0x00,0xb4,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x01,0x00,0x2e,0x2e,0x2f,0x74,0x69,0x6d,0x65,0x72, - 0x69,0x6e,0x74,0x2e,0x63,0x00,0x00,0x00,0x2e,0x2e,0x2f,0x74, - 0x69,0x6d,0x65,0x72,0x69,0x6e,0x74,0x2e,0x63,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x24, - 0x00,0x18,0x5d,0x10,0x6f,0x0d,0x00,0x0c,0x00,0x09,0x00,0x06, - 0x00,0x03,0x80,0x01,0x00,0x01,0xc0,0x00,0x60,0x00,0x30,0x00, - 0x18,0x00,0x0c,0x00,0x30,0x00,0x08,0x00,0x06,0x00,0x04,0x00, - 0x20,0x00,0x08,0x00,0x02,0x00,0x06,0x00,0x04,0x00,0x02,0x00, - 0x10,0x00,0xc0,0x00,0x60,0x00,0x30,0x00,0x18,0x00,0x0c,0x00, - 0x04,0xfa,0xc8,0x96,0x64,0x32,0x19,0x14,0x0f,0x0a,0x08,0x06, - 0x05,0x04,0x04,0x04,0x40,0x28,0x23,0x29,0x63,0x68,0x61,0x6e, - 0x6e,0x65,0x6c,0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x33,0x2e, - 0x37,0x20,0x20,0x39,0x2f,0x32,0x30,0x2f,0x39,0x33,0x00,0x40, - 0x28,0x23,0x29,0x63,0x6f,0x6d,0x6d,0x6f,0x6e,0x2e,0x63,0x20, - 0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x38,0x20,0x20,0x34,0x2f, - 0x31,0x38,0x2f,0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x63,0x6f, - 0x6d,0x6d,0x6f,0x6e,0x2e,0x6d,0x6b,0x20,0x20,0x20,0x20,0x20, - 0x33,0x2e,0x31,0x30,0x20,0x20,0x31,0x2f,0x36,0x2f,0x39,0x34, - 0x00,0x40,0x28,0x23,0x29,0x63,0x6f,0x6e,0x63,0x62,0x69,0x6f, - 0x73,0x2e,0x68,0x20,0x20,0x20,0x20,0x32,0x2e,0x38,0x20,0x20, - 0x36,0x2f,0x33,0x30,0x2f,0x39,0x32,0x00,0x40,0x28,0x23,0x29, - 0x64,0x65,0x66,0x73,0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x33,0x2e,0x32,0x20,0x20,0x34,0x2f,0x36,0x2f,0x39, - 0x34,0x00,0x40,0x28,0x23,0x29,0x64,0x65,0x76,0x69,0x63,0x65, - 0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x38,0x20, - 0x20,0x34,0x2f,0x31,0x34,0x2f,0x39,0x34,0x00,0x40,0x28,0x23, - 0x29,0x65,0x78,0x63,0x65,0x70,0x74,0x69,0x6f,0x6e,0x2e,0x73, - 0x20,0x20,0x20,0x33,0x2e,0x32,0x20,0x20,0x38,0x2f,0x32,0x30, - 0x2f,0x39,0x33,0x00,0x40,0x28,0x23,0x29,0x68,0x6f,0x73,0x74, - 0x63,0x6f,0x6d,0x6d,0x2e,0x68,0x20,0x20,0x20,0x20,0x33,0x2e, - 0x33,0x20,0x20,0x33,0x2f,0x32,0x32,0x2f,0x39,0x33,0x00,0x40, - 0x28,0x23,0x29,0x68,0x6f,0x73,0x74,0x69,0x6e,0x69,0x74,0x2e, - 0x73,0x20,0x20,0x20,0x20,0x33,0x2e,0x33,0x20,0x20,0x38,0x2f, - 0x32,0x30,0x2f,0x39,0x33,0x00,0x40,0x28,0x23,0x29,0x6d,0x69, - 0x64,0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x33,0x2e,0x33,0x20,0x20,0x34,0x2f,0x36,0x2f,0x39,0x34,0x00, - 0x40,0x28,0x23,0x29,0x6d,0x6f,0x64,0x75,0x6c,0x65,0x2e,0x63, - 0x20,0x20,0x20,0x20,0x20,0x20,0x32,0x2e,0x31,0x20,0x20,0x33, - 0x2f,0x31,0x2f,0x39,0x32,0x00,0x40,0x28,0x23,0x29,0x6d,0x6f, - 0x64,0x75,0x6c,0x65,0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20, - 0x33,0x2e,0x31,0x20,0x20,0x38,0x2f,0x32,0x30,0x2f,0x39,0x33, - 0x00,0x40,0x28,0x23,0x29,0x70,0x61,0x72,0x61,0x6c,0x6c,0x65, - 0x6c,0x2e,0x63,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x31,0x2e,0x38,0x20,0x20,0x34,0x2f,0x31,0x38,0x2f,0x39,0x34, - 0x00,0x40,0x28,0x23,0x29,0x70,0x61,0x72,0x61,0x2e,0x68,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x31,0x2e,0x31,0x20,0x20, - 0x37,0x2f,0x37,0x2f,0x39,0x33,0x00,0x40,0x28,0x23,0x29,0x70, - 0x62,0x75,0x73,0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x33,0x2e,0x32,0x20,0x20,0x34,0x2f,0x36,0x2f,0x39,0x34, - 0x00,0x40,0x28,0x23,0x29,0x70,0x6f,0x6c,0x6c,0x2e,0x73,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x31,0x33,0x20, - 0x20,0x35,0x2f,0x32,0x34,0x2f,0x39,0x34,0x00,0x40,0x28,0x23, - 0x29,0x70,0x72,0x6f,0x74,0x6f,0x63,0x6f,0x6c,0x2e,0x68,0x20, - 0x20,0x20,0x20,0x33,0x2e,0x31,0x20,0x20,0x34,0x2f,0x31,0x39, - 0x2f,0x39,0x33,0x00,0x40,0x28,0x23,0x29,0x72,0x65,0x67,0x2e, - 0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e, - 0x32,0x20,0x20,0x38,0x2f,0x32,0x35,0x2f,0x39,0x33,0x00,0x40, - 0x28,0x23,0x29,0x72,0x65,0x6c,0x65,0x61,0x73,0x65,0x2e,0x68, - 0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x39,0x20,0x20,0x38,0x2f, - 0x31,0x37,0x2f,0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x72,0x77, - 0x2e,0x63,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x33,0x2e,0x31,0x20,0x20,0x31,0x31,0x2f,0x35,0x2f,0x39,0x32, - 0x00,0x40,0x28,0x23,0x29,0x72,0x77,0x2e,0x68,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x32,0x2e,0x31,0x20,0x20, - 0x33,0x2f,0x31,0x2f,0x39,0x32,0x00,0x40,0x28,0x23,0x29,0x73, - 0x63,0x68,0x65,0x64,0x2e,0x63,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x33,0x2e,0x32,0x20,0x20,0x38,0x2f,0x32,0x30,0x2f,0x39, - 0x33,0x00,0x40,0x28,0x23,0x29,0x73,0x63,0x68,0x65,0x64,0x2e, - 0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x31,0x20, - 0x20,0x38,0x2f,0x32,0x30,0x2f,0x39,0x33,0x00,0x40,0x28,0x23, - 0x29,0x73,0x6d,0x61,0x72,0x74,0x62,0x69,0x6f,0x73,0x2e,0x68, - 0x20,0x20,0x20,0x33,0x2e,0x31,0x20,0x20,0x38,0x2f,0x32,0x30, - 0x2f,0x39,0x33,0x00,0x40,0x28,0x23,0x29,0x73,0x6d,0x61,0x72, - 0x74,0x66,0x65,0x70,0x2e,0x63,0x20,0x20,0x20,0x20,0x33,0x2e, - 0x31,0x31,0x20,0x20,0x34,0x2f,0x31,0x38,0x2f,0x39,0x34,0x00, - 0x40,0x28,0x23,0x29,0x73,0x6d,0x61,0x72,0x74,0x6d,0x61,0x69, - 0x6e,0x2e,0x63,0x20,0x20,0x20,0x33,0x2e,0x31,0x20,0x20,0x38, - 0x2f,0x32,0x30,0x2f,0x39,0x33,0x00,0x40,0x28,0x23,0x29,0x73, - 0x78,0x66,0x65,0x70,0x2e,0x6d,0x6b,0x20,0x20,0x20,0x20,0x20, - 0x20,0x33,0x2e,0x32,0x20,0x20,0x38,0x2f,0x32,0x30,0x2f,0x39, - 0x33,0x00,0x40,0x28,0x23,0x29,0x74,0x69,0x6d,0x65,0x72,0x2e, - 0x63,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e,0x33,0x20, - 0x20,0x37,0x2f,0x37,0x2f,0x39,0x33,0x00,0x40,0x28,0x23,0x29, - 0x74,0x69,0x6d,0x65,0x72,0x2e,0x68,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x33,0x2e,0x33,0x20,0x20,0x34,0x2f,0x36,0x2f,0x39, - 0x34,0x00,0x40,0x28,0x23,0x29,0x74,0x69,0x6d,0x65,0x72,0x69, - 0x6e,0x74,0x2e,0x63,0x20,0x20,0x20,0x20,0x33,0x2e,0x31,0x20, - 0x20,0x38,0x2f,0x32,0x30,0x2f,0x39,0x33,0x00,0x40,0x28,0x23, - 0x29,0x75,0x61,0x72,0x74,0x2e,0x63,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x33,0x2e,0x38,0x20,0x20,0x35,0x2f,0x32,0x34, - 0x2f,0x39,0x34,0x00,0x40,0x28,0x23,0x29,0x75,0x61,0x72,0x74, - 0x2e,0x68,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x2e, - 0x31,0x20,0x20,0x34,0x2f,0x36,0x2f,0x39,0x34,0x00,0x40,0x28, - 0x23,0x29,0x75,0x74,0x69,0x6c,0x2e,0x73,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x33,0x2e,0x33,0x20,0x20,0x37,0x2f,0x31, - 0x2f,0x39,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00 -}; - -static unsigned pcem_ncook=sizeof(pcem_cook); diff --git a/sys/dev/serial/dgb/dgmreg.h b/sys/dev/serial/dgb/dgmreg.h deleted file mode 100644 index aa18d24134..0000000000 --- a/sys/dev/serial/dgb/dgmreg.h +++ /dev/null @@ -1,443 +0,0 @@ -/*- - * $FreeBSD: src/sys/dev/dgb/dgmreg.h,v 1.4.2.1 2001/09/23 19:54:54 brian Exp $ - * $DragonFly: src/sys/dev/serial/dgb/dgmreg.h,v 1.3 2006/12/22 23:26:24 swildner Exp $ - * - * Digiboard driver. - * - * Stage 1. "Better than nothing". - * Stage 2. "Gee, it works!". - * - * 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, - * without modification, immediately at the beginning of the file. - * 2. Redistributions of binary code must retain the above copyright - * notice, this list of conditions, and the following disclaimer, - * without modification, in the accompanying documentation. - * 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - * Written by Sergey Babkin, - * Joint Stock Commercial Bank "Chelindbank" - * (Chelyabinsk, Russia) - * babkin@freebsd.org - */ - -#define MAX_DGM_PORTS 64 - -/* digi.h */ -/* Definitions for DigiBoard ditty(1) command. */ - -#if !defined(TIOCMODG) -#define TIOCMODG ('d'<<8) | 250 /* get modem ctrl state */ -#define TIOCMODS ('d'<<8) | 251 /* set modem ctrl state */ -#endif - -#if !defined(TIOCMSET) -#define TIOCMSET ('d'<<8) | 252 /* set modem ctrl state */ -#define TIOCMGET ('d'<<8) | 253 /* set modem ctrl state */ -#endif - -#if !defined(TIOCMBIC) -#define TIOCMBIC ('d'<<8) | 254 /* set modem ctrl state */ -#define TIOCMBIS ('d'<<8) | 255 /* set modem ctrl state */ -#endif - -#if !defined(TIOCSDTR) -#define TIOCSDTR ('e'<<8) | 0 /* set DTR */ -#define TIOCCDTR ('e'<<8) | 1 /* clear DTR */ -#endif - -/************************************************************************ - * Ioctl command arguments for DIGI parameters. - ************************************************************************/ -#define DIGI_GETA ('e'<<8) | 94 /* Read params */ - -#define DIGI_SETA ('e'<<8) | 95 /* Set params */ -#define DIGI_SETAW ('e'<<8) | 96 /* Drain & set params */ -#define DIGI_SETAF ('e'<<8) | 97 /* Drain, flush & set params */ - -#define DIGI_GETFLOW ('e'<<8) | 99 /* Get startc/stopc flow */ - /* control characters */ -#define DIGI_SETFLOW ('e'<<8) | 100 /* Set startc/stopc flow */ - /* control characters */ -#define DIGI_GETAFLOW ('e'<<8) | 101 /* Get Aux. startc/stopc */ - /* flow control chars */ -#define DIGI_SETAFLOW ('e'<<8) | 102 /* Set Aux. startc/stopc */ - /* flow control chars */ - -struct digiflow_struct { - unsigned char startc; /* flow cntl start char */ - unsigned char stopc; /* flow cntl stop char */ -}; - -typedef struct digiflow_struct digiflow_t; - - -/************************************************************************ - * Values for digi_flags - ************************************************************************/ -#define DIGI_IXON 0x0001 /* Handle IXON in the FEP */ -#define DIGI_FAST 0x0002 /* Fast baud rates */ -#define RTSPACE 0x0004 /* RTS input flow control */ -#define CTSPACE 0x0008 /* CTS output flow control */ -#define DSRPACE 0x0010 /* DSR output flow control */ -#define DCDPACE 0x0020 /* DCD output flow control */ -#define DTRPACE 0x0040 /* DTR input flow control */ -#define DIGI_FORCEDCD 0x0100 /* Force carrier */ -#define DIGI_ALTPIN 0x0200 /* Alternate RJ-45 pin config */ -#define DIGI_AIXON 0x0400 /* Aux flow control in fep */ - - -/************************************************************************ - * Structure used with ioctl commands for DIGI parameters. - ************************************************************************/ -struct digi_struct { - unsigned short digi_flags; /* Flags (see above) */ -}; - -typedef struct digi_struct digi_t; - -/* fep.h */ - -#define FEP_CSTART 0x400L -#define FEP_CMAX 0x800L -#define FEP_ISTART 0x800L -#define FEP_IMAX 0xC00L -#define FEP_CIN 0xD10L -#define FEP_GLOBAL 0xD10L -#define FEP_EIN 0xD18L -#define FEPSTAT 0xD20L -#define CHANSTRUCT 0x1000L -#define RXTXBUF 0x4000L - - -struct global_data { - volatile ushort cin; - volatile ushort cout; - volatile ushort cstart; - volatile ushort cmax; - volatile ushort ein; - volatile ushort eout; - volatile ushort istart; - volatile ushort imax; -}; - - -struct board_chan { - int filler1; - int filler2; - volatile ushort tseg; - volatile ushort tin; - volatile ushort tout; - volatile ushort tmax; - - volatile ushort rseg; - volatile ushort rin; - volatile ushort rout; - volatile ushort rmax; - - volatile ushort tlow; - volatile ushort rlow; - volatile ushort rhigh; - volatile ushort incr; - - volatile ushort etime; - volatile ushort edelay; - volatile u_char *dev; - - volatile ushort iflag; - volatile ushort oflag; - volatile ushort cflag; - volatile ushort gmask; - - volatile ushort col; - volatile ushort delay; - volatile ushort imask; - volatile ushort tflush; - - int filler3; - int filler4; - int filler5; - int filler6; - - volatile u_char num; - volatile u_char ract; - volatile u_char bstat; - volatile u_char tbusy; - volatile u_char iempty; - volatile u_char ilow; - volatile u_char idata; - volatile u_char eflag; - - volatile u_char tflag; - volatile u_char rflag; - volatile u_char xmask; - volatile u_char xval; - volatile u_char mstat; - volatile u_char mchange; - volatile u_char mint; - volatile u_char lstat; - - volatile u_char mtran; - volatile u_char orun; - volatile u_char startca; - volatile u_char stopca; - volatile u_char startc; - volatile u_char stopc; - volatile u_char vnext; - volatile u_char hflow; - - volatile u_char fillc; - volatile u_char ochar; - volatile u_char omask; - - u_char filler7; - u_char filler8[28]; -}; - - -#define SRXLWATER 0xE0 -#define SRXHWATER 0xE1 -#define STOUT 0xE2 -#define PAUSETX 0xE3 -#define RESUMETX 0xE4 -#define SAUXONOFFC 0xE6 -#define SENDBREAK 0xE8 -#define SETMODEM 0xE9 -#define SETIFLAGS 0xEA -#define SONOFFC 0xEB -#define STXLWATER 0xEC -#define PAUSERX 0xEE -#define RESUMERX 0xEF -#define SETBUFFER 0xF2 -#define SETCOOKED 0xF3 -#define SETHFLOW 0xF4 -#define SETCTRLFLAGS 0xF5 -#define SETVNEXT 0xF6 - - - -#define BREAK_IND 0x01 -#define LOWTX_IND 0x02 -#define EMPTYTX_IND 0x04 -#define DATA_IND 0x08 -#define MODEMCHG_IND 0x20 - -#define ALL_IND (BREAK_IND|LOWTX_IND|EMPTYTX_IND|DATA_IND|MODEMCHG_IND) - -#define CD 0x80 -#define DSR 0x20 -#define CTS 0x10 -#define DTR 0x01 -#define RTS 0x02 -#define RI 0x40 - -#define FEPCODESEG 0x0200L -#define FEPCODE 0x2000L -#define BIOSCODE 0xf800L -#define BIOSOFFSET 0x1000L - -#define MISCGLOBAL 0x0C00L -#define NPORT 0x0C02L -#define MBOX 0x0C40L -#define BOTWIN 0x100L -#define TOPWIN 0xFF00L - -#define FEPCLR 0x00 -#define FEPMEM 0x02 -#define FEPRST 0x04 -#define FEPINT 0x08 -#define FEPMASK 0x0e -#define FEPWIN 0x80 - -#define PCXI 0 -#define PCXE 1 -#define PCXEVE 2 -#define PCXEM 3 - -static char * const board_desc[] = { - "PC/Xi (64K)", - "PC/Xe (64K)", - "PC/Xe (8K) ", - "PC/Xem ", -}; - -#define STARTC 021 -#define STOPC 023 -#define IAIXON 0x2000 - - -struct board_info { - u_char status; - u_char type; - u_char altpin; - ushort numports; - ushort port; - u_long membase; -}; - - -#define TXSTOPPED 0x1 -#define LOWWAIT 0x2 -#define EMPTYWAIT 0x4 - -#define DISABLED 0 -#define ENABLED 1 -#define OFF 0 -#define ON 1 - -#define FEPTIMEOUT 200000 -#define SERIAL_TYPE_NORMAL 1 -#define SERIAL_TYPE_CALLOUT 2 -#define PCXE_EVENT_HANGUP 1 - -struct channel { - u_char unit; /* board unit number */ - u_char omodem; /* FEP output modem status */ - u_char imodem; /* FEP input modem status */ - u_char modemfake; /* Modem values to be forced */ - u_char modem; /* Force values */ - u_char hflow; - u_char dsr; - u_char dcd; - u_char stopc; - u_char startc; - u_char stopca; - u_char startca; - u_char fepstopc; - u_char fepstartc; - u_char fepstopca; - u_char fepstartca; - u_char txwin; - u_char rxwin; - ushort fepiflag; - ushort fepcflag; - ushort fepoflag; - ushort txbufhead; - ushort txbufsize; - ushort rxbufhead; - ushort rxbufsize; - int close_delay; - int count; - int blocked_open; - int event; - int asyncflags; - uint dev; - long session; - long pgrp; - u_long statusflags; - u_long c_iflag; - u_long c_cflag; - u_long c_lflag; - u_long c_oflag; - u_char *txptr; - u_char *rxptr; - struct board_info *board; - struct board_chan *brdchan; - struct digi_struct digiext; - struct tty *tty; - struct termios normal_termios; - struct termios callout_termios; - volatile struct global_data *mailbox; -}; - -/* flags for configuring */ - -#define DGBFLAG_ALTPIN 0x0001 /* chande DCD and DCD */ -#define DGBFLAG_NOWIN 0x0002 /* use windowed PC/Xe as non-windowed */ - -#define DB_RD 0x0001 -#define DB_WR 0x0002 -#define DB_WIN 0x0004 -#define DB_INFO 0x0008 -#define DB_EXCEPT 0x0010 -#define DB_OPEN 0x0100 -#define DB_CLOSE 0x0200 -#define DB_DATA 0x0400 -#define DB_RXDATA 0x0401 -#define DB_TXDATA 0x0402 -#define DB_EVENT 0x0800 -#define DB_MODEM 0x1000 -#define DB_BREAK 0x2000 -#define DB_PARAM 0x4000 -#define DB_FEP 0x8000 - -/* debugging printout */ - -#ifdef DEBUG -#define DPRINT1(l,a1) (dgmdebug&l ? kprintf(a1) : 0) -#define DPRINT2(l,a1,a2) (dgmdebug&l ? kprintf(a1,a2) : 0) -#define DPRINT3(l,a1,a2,a3) (dgmdebug&l ? kprintf(a1,a2,a3) : 0) -#define DPRINT4(l,a1,a2,a3,a4) (dgmdebug&l ? kprintf(a1,a2,a3,a4) : 0) -#define DPRINT5(l,a1,a2,a3,a4,a5) (dgmdebug&l ? kprintf(a1,a2,a3,a4,a5) : 0) -#define DPRINT6(l,a1,a2,a3,a4,a5,a6) (dgmdebug&l ? kprintf(a1,a2,a3,a4,a5,a6) : 0) -#define DPRINT7(l,a1,a2,a3,a4,a5,a6,a7) (dgmdebug&l ? kprintf(a1,a2,a3,a4,a5,a6,a7) : 0) -#else -#define DPRINT1(l,a1) -#define DPRINT2(l,a1,a2) -#define DPRINT3(l,a1,a2,a3) -#define DPRINT4(l,a1,a2,a3,a4) -#define DPRINT5(l,a1,a2,a3,a4,a5) -#define DPRINT6(l,a1,a2,a3,a4,a5,a6) -#define DPRINT7(l,a1,a2,a3,a4,a5,a6,a7) -#endif - - - /* These are termios bits as the FEP understands them */ - -/* c_cflag bits */ -#define FEP_CBAUD 0x00000f -#define FEP_B0 0x000000 /* hang up */ -#define FEP_B50 0x000001 -#define FEP_B75 0x000002 -#define FEP_B110 0x000003 -#define FEP_B134 0x000004 -#define FEP_B150 0x000005 -#define FEP_B200 0x000006 -#define FEP_B300 0x000007 -#define FEP_B600 0x000008 -#define FEP_B1200 0x000009 -#define FEP_B1800 0x00000a -#define FEP_B2400 0x00000b -#define FEP_B4800 0x00000c -#define FEP_B9600 0x00000d -#define FEP_B19200 0x00000e -#define FEP_B38400 0x00000f -#define FEP_EXTA FEP_B19200 -#define FEP_EXTB FEP_B38400 -#define FEP_CSIZE 0x000030 -#define FEP_CS5 0x000000 -#define FEP_CS6 0x000010 -#define FEP_CS7 0x000020 -#define FEP_CS8 0x000030 -#define FEP_CSTOPB 0x000040 -#define FEP_CREAD 0x000080 -#define FEP_PARENB 0x000100 -#define FEP_PARODD 0x000200 -#define FEP_CLOCAL 0x000800 -#define FEP_FASTBAUD 0x000400 -/* c_iflag bits */ -#define FEP_IGNBRK 0000001 -#define FEP_BRKINT 0000002 -#define FEP_IGNPAR 0000004 -#define FEP_PARMRK 0000010 -#define FEP_INPCK 0000020 -#define FEP_ISTRIP 0000040 -#define FEP_IXON 0002000 -#define FEP_IXANY 0004000 -#define FEP_IXOFF 0010000 diff --git a/sys/dev/serial/rc/rc.c b/sys/dev/serial/rc/rc.c deleted file mode 100644 index 5538d94122..0000000000 --- a/sys/dev/serial/rc/rc.c +++ /dev/null @@ -1,1499 +0,0 @@ -/* - * (MPSAFE) - * - * Copyright (C) 1995 by Pavel Antonov, Moscow, Russia. - * Copyright (C) 1995 by Andrey A. Chernov, Moscow, Russia. - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 REGENTS OR CONTRIBUTORS 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: src/sys/i386/isa/rc.c,v 1.53.2.1 2001/02/26 04:23:10 jlemon Exp $ - * - */ - -/* - * SDL Communications Riscom/8 (based on Cirrus Logic CL-CD180) driver - * - */ - -#include "use_rc.h" - -/*#define RCDEBUG*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include "rcreg.h" - -/* Prototypes */ -static int rcprobe (struct isa_device *); -static int rcattach (struct isa_device *); - -#define rcin(port) RC_IN (nec, port) -#define rcout(port,v) RC_OUT (nec, port, v) - -#define WAITFORCCR(u,c) rc_wait0(nec, (u), (c), __LINE__) -#define CCRCMD(u,c,cmd) WAITFORCCR((u), (c)); rcout(CD180_CCR, (cmd)) - -#define RC_IBUFSIZE 256 -#define RB_I_HIGH_WATER (TTYHOG - 2 * RC_IBUFSIZE) -#define RC_OBUFSIZE 512 -#define RC_IHIGHWATER (3 * RC_IBUFSIZE / 4) -#define INPUT_FLAGS_SHIFT (2 * RC_IBUFSIZE) -#define LOTS_OF_EVENTS 64 - -#define RC_FAKEID 0x10 - -#define RC_PROBED 1 -#define RC_ATTACHED 2 - -#define GET_UNIT(dev) (minor(dev) & 0x3F) -#define CALLOUT(dev) (minor(dev) & 0x80) - -/* For isa routines */ -struct isa_driver rcdriver = { - rcprobe, rcattach, "rc" -}; - -static d_open_t rcopen; -static d_close_t rcclose; -static d_ioctl_t rcioctl; - -static struct dev_ops rc_ops = { - { "rc", 0, D_TTY }, - .d_open = rcopen, - .d_close = rcclose, - .d_read = ttyread, - .d_write = ttywrite, - .d_ioctl = rcioctl, - .d_kqfilter = ttykqfilter, - .d_revoke = ttyrevoke -}; - -/* Per-board structure */ -static struct rc_softc { - u_int rcb_probed; /* 1 - probed, 2 - attached */ - u_int rcb_addr; /* Base I/O addr */ - u_int rcb_unit; /* unit # */ - u_char rcb_dtr; /* DTR status */ - struct rc_chans *rcb_baserc; /* base rc ptr */ -} rc_softc[NRC]; - -/* Per-channel structure */ -static struct rc_chans { - struct rc_softc *rc_rcb; /* back ptr */ - u_short rc_flags; /* Misc. flags */ - int rc_chan; /* Channel # */ - u_char rc_ier; /* intr. enable reg */ - u_char rc_msvr; /* modem sig. status */ - u_char rc_cor2; /* options reg */ - u_char rc_pendcmd; /* special cmd pending */ - u_int rc_dtrwait; /* dtr timeout */ - u_int rc_dcdwaits; /* how many waits DCD in open */ - u_char rc_hotchar; /* end packed optimize */ - struct tty *rc_tp; /* tty struct */ - u_char *rc_iptr; /* Chars input buffer */ - u_char *rc_hiwat; /* hi-water mark */ - u_char *rc_bufend; /* end of buffer */ - u_char *rc_optr; /* ptr in output buf */ - u_char *rc_obufend; /* end of output buf */ - struct callout rc_dtr_ch; - u_char rc_ibuf[4 * RC_IBUFSIZE]; /* input buffer */ - u_char rc_obuf[RC_OBUFSIZE]; /* output buffer */ -} rc_chans[NRC * CD180_NCHAN]; - -static int rc_scheduled_event = 0; -static struct callout rc_wakeup_ch; - -/* for pstat -t */ -static struct tty rc_tty[NRC * CD180_NCHAN]; -static const int nrc_tty = NRC * CD180_NCHAN; - -/* Flags */ -#define RC_DTR_OFF 0x0001 /* DTR wait, for close/open */ -#define RC_ACTOUT 0x0002 /* Dial-out port active */ -#define RC_RTSFLOW 0x0004 /* RTS flow ctl enabled */ -#define RC_CTSFLOW 0x0008 /* CTS flow ctl enabled */ -#define RC_DORXFER 0x0010 /* RXFER event planned */ -#define RC_DOXXFER 0x0020 /* XXFER event planned */ -#define RC_MODCHG 0x0040 /* Modem status changed */ -#define RC_OSUSP 0x0080 /* Output suspended */ -#define RC_OSBUSY 0x0100 /* start() routine in progress */ -#define RC_WAS_BUFOVFL 0x0200 /* low-level buffer ovferflow */ -#define RC_WAS_SILOVFL 0x0400 /* silo buffer overflow */ -#define RC_SEND_RDY 0x0800 /* ready to send */ - -/* Table for translation of RCSR status bits to internal form */ -static int rc_rcsrt[16] = { - 0, TTY_OE, TTY_FE, - TTY_FE|TTY_OE, TTY_PE, TTY_PE|TTY_OE, - TTY_PE|TTY_FE, TTY_PE|TTY_FE|TTY_OE, TTY_BI, - TTY_BI|TTY_OE, TTY_BI|TTY_FE, TTY_BI|TTY_FE|TTY_OE, - TTY_BI|TTY_PE, TTY_BI|TTY_PE|TTY_OE, TTY_BI|TTY_PE|TTY_FE, - TTY_BI|TTY_PE|TTY_FE|TTY_OE -}; - -/* Static prototypes */ -static inthand2_t rcintr; -static void rc_hwreset (int, int, unsigned int); -static int rc_test (int, int); -static void rc_discard_output (struct rc_chans *); -static void rc_hardclose (struct rc_chans *); -static int rc_modctl (struct rc_chans *, int, int); -static void rc_start (struct tty *); -static void rc_stop (struct tty *, int rw); -static int rc_param (struct tty *, struct termios *); -static inthand2_t rcpoll; -static void rc_reinit (struct rc_softc *); -#ifdef RCDEBUG -static void printrcflags(); -#endif -static timeout_t rc_dtrwakeup; -static timeout_t rc_wakeup; -static void disc_optim (struct tty *tp, struct termios *t, struct rc_chans *); -static void rc_wait0 (int nec, int unit, int chan, int line); - -/**********************************************/ - -/* Quick device probing */ -static int -rcprobe(struct isa_device *dvp) -{ - int irq = ffs(dvp->id_irq) - 1; - int nec = dvp->id_iobase; - - if (dvp->id_unit > NRC) - return 0; - if (!RC_VALIDADDR(nec)) { - kprintf("rc%d: illegal base address %x\n", dvp->id_unit, nec); - return 0; - } - if (!RC_VALIDIRQ(irq)) { - kprintf("rc%d: illegal IRQ value %d\n", dvp->id_unit, irq); - return 0; - } - lwkt_gettoken(&tty_token); - rcout(CD180_PPRL, 0x22); /* Random values to Prescale reg. */ - rcout(CD180_PPRH, 0x11); - if (rcin(CD180_PPRL) != 0x22 || rcin(CD180_PPRH) != 0x11) { - lwkt_reltoken(&tty_token); - return 0; - } - /* Now, test the board more thoroughly, with diagnostic */ - if (rc_test(nec, dvp->id_unit)) { - lwkt_reltoken(&tty_token); - return 0; - } - rc_softc[dvp->id_unit].rcb_probed = RC_PROBED; - lwkt_reltoken(&tty_token); - return 0xF; -} - -static int -rcattach(struct isa_device *dvp) -{ - int chan, nec = dvp->id_iobase; - struct rc_softc *rcb = &rc_softc[dvp->id_unit]; - struct rc_chans *rc = &rc_chans[dvp->id_unit * CD180_NCHAN]; - static int rc_started = 0; - struct tty *tp; - - lwkt_gettoken(&tty_token); - dvp->id_intr = rcintr; - - /* Thorooughly test the device */ - if (rcb->rcb_probed != RC_PROBED) { - lwkt_reltoken(&tty_token); - return 0; - } - rcb->rcb_addr = nec; - rcb->rcb_dtr = 0; - rcb->rcb_baserc = rc; - rcb->rcb_unit = dvp->id_unit; - /*rcb->rcb_chipid = 0x10 + dvp->id_unit;*/ - kprintf("rc%d: %d chans, firmware rev. %c\n", rcb->rcb_unit, - CD180_NCHAN, (rcin(CD180_GFRCR) & 0xF) + 'A'); - - for (chan = 0; chan < CD180_NCHAN; chan++, rc++) { - callout_init_mp(&rc->rc_dtr_ch); - rc->rc_rcb = rcb; - rc->rc_chan = chan; - rc->rc_iptr = rc->rc_ibuf; - rc->rc_bufend = &rc->rc_ibuf[RC_IBUFSIZE]; - rc->rc_hiwat = &rc->rc_ibuf[RC_IHIGHWATER]; - rc->rc_flags = rc->rc_ier = rc->rc_msvr = 0; - rc->rc_cor2 = rc->rc_pendcmd = 0; - rc->rc_optr = rc->rc_obufend = rc->rc_obuf; - rc->rc_dtrwait = 3 * hz; - rc->rc_dcdwaits= 0; - rc->rc_hotchar = 0; - tp = rc->rc_tp = &rc_tty[chan + (dvp->id_unit * CD180_NCHAN)]; - ttychars(tp); - tp->t_lflag = tp->t_iflag = tp->t_oflag = 0; - tp->t_cflag = TTYDEF_CFLAG; - tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED; - } - rcb->rcb_probed = RC_ATTACHED; - if (!rc_started) { - register_swi_mp(SWI_TTY, rcpoll, NULL, "rcpoll", NULL); - callout_init_mp(&rc_wakeup_ch); - rc_wakeup(NULL); - rc_started = 1; - } - lwkt_reltoken(&tty_token); - return 1; -} - -/* RC interrupt handling */ -static void -rcintr(void *arg, void *frame) -{ - int unit = (int)arg; - struct rc_softc *rcb = &rc_softc[unit]; - struct rc_chans *rc; - int nec, resid; - u_char val, iack, bsr, ucnt, *optr; - int good_data, t_state; - - lwkt_gettoken(&tty_token); - if (rcb->rcb_probed != RC_ATTACHED) { - kprintf("rc%d: bogus interrupt\n", unit); - lwkt_reltoken(&tty_token); - return; - } - nec = rcb->rcb_addr; - - bsr = ~(rcin(RC_BSR)); - - if (!(bsr & (RC_BSR_TOUT|RC_BSR_RXINT|RC_BSR_TXINT|RC_BSR_MOINT))) { - kprintf("rc%d: extra interrupt\n", unit); - rcout(CD180_EOIR, 0); - lwkt_reltoken(&tty_token); - return; - } - - while (bsr & (RC_BSR_TOUT|RC_BSR_RXINT|RC_BSR_TXINT|RC_BSR_MOINT)) { -#ifdef RCDEBUG_DETAILED - kprintf("rc%d: intr (%02x) %s%s%s%s\n", unit, bsr, - (bsr & RC_BSR_TOUT)?"TOUT ":"", - (bsr & RC_BSR_RXINT)?"RXINT ":"", - (bsr & RC_BSR_TXINT)?"TXINT ":"", - (bsr & RC_BSR_MOINT)?"MOINT":""); -#endif - if (bsr & RC_BSR_TOUT) { - kprintf("rc%d: hardware failure, reset board\n", unit); - rcout(RC_CTOUT, 0); - rc_reinit(rcb); - lwkt_reltoken(&tty_token); - return; - } - if (bsr & RC_BSR_RXINT) { - iack = rcin(RC_PILR_RX); - good_data = (iack == (GIVR_IT_RGDI | RC_FAKEID)); - if (!good_data && iack != (GIVR_IT_REI | RC_FAKEID)) { - kprintf("rc%d: fake rxint: %02x\n", unit, iack); - goto more_intrs; - } - rc = rcb->rcb_baserc + ((rcin(CD180_GICR) & GICR_CHAN) >> GICR_LSH); - t_state = rc->rc_tp->t_state; - /* Do RTS flow control stuff */ - if ( (rc->rc_flags & RC_RTSFLOW) - || !(t_state & TS_ISOPEN) - ) { - if ( ( !(t_state & TS_ISOPEN) - || (t_state & TS_TBLOCK) - ) - && (rc->rc_msvr & MSVR_RTS) - ) - rcout(CD180_MSVR, - rc->rc_msvr &= ~MSVR_RTS); - else if (!(rc->rc_msvr & MSVR_RTS)) - rcout(CD180_MSVR, - rc->rc_msvr |= MSVR_RTS); - } - ucnt = rcin(CD180_RDCR) & 0xF; - resid = 0; - - if (t_state & TS_ISOPEN) { - /* check for input buffer overflow */ - if ((rc->rc_iptr + ucnt) >= rc->rc_bufend) { - resid = ucnt; - ucnt = rc->rc_bufend - rc->rc_iptr; - resid -= ucnt; - if (!(rc->rc_flags & RC_WAS_BUFOVFL)) { - rc->rc_flags |= RC_WAS_BUFOVFL; - rc_scheduled_event++; - } - } - optr = rc->rc_iptr; - /* check foor good data */ - if (good_data) { - while (ucnt-- > 0) { - val = rcin(CD180_RDR); - optr[0] = val; - optr[INPUT_FLAGS_SHIFT] = 0; - optr++; - rc_scheduled_event++; - if (val != 0 && val == rc->rc_hotchar) - setsofttty(); - } - } else { - /* Store also status data */ - while (ucnt-- > 0) { - iack = rcin(CD180_RCSR); - if (iack & RCSR_Timeout) - break; - if ( (iack & RCSR_OE) - && !(rc->rc_flags & RC_WAS_SILOVFL)) { - rc->rc_flags |= RC_WAS_SILOVFL; - rc_scheduled_event++; - } - val = rcin(CD180_RDR); - /* - Don't store PE if IGNPAR and BREAK if IGNBRK, - this hack allows "raw" tty optimization - works even if IGN* is set. - */ - if ( !(iack & (RCSR_PE|RCSR_FE|RCSR_Break)) - || ((!(iack & (RCSR_PE|RCSR_FE)) - || !(rc->rc_tp->t_iflag & IGNPAR)) - && (!(iack & RCSR_Break) - || !(rc->rc_tp->t_iflag & IGNBRK)))) { - if ( (iack & (RCSR_PE|RCSR_FE)) - && (t_state & TS_CAN_BYPASS_L_RINT) - && ((iack & RCSR_FE) - || ((iack & RCSR_PE) - && (rc->rc_tp->t_iflag & INPCK)))) - val = 0; - else if (val != 0 && val == rc->rc_hotchar) - setsofttty(); - optr[0] = val; - optr[INPUT_FLAGS_SHIFT] = iack; - optr++; - rc_scheduled_event++; - } - } - } - rc->rc_iptr = optr; - rc->rc_flags |= RC_DORXFER; - } else - resid = ucnt; - /* Clear FIFO if necessary */ - while (resid-- > 0) { - if (!good_data) - iack = rcin(CD180_RCSR); - else - iack = 0; - if (iack & RCSR_Timeout) - break; - (void) rcin(CD180_RDR); - } - goto more_intrs; - } - if (bsr & RC_BSR_MOINT) { - iack = rcin(RC_PILR_MODEM); - if (iack != (GIVR_IT_MSCI | RC_FAKEID)) { - kprintf("rc%d: fake moint: %02x\n", unit, iack); - goto more_intrs; - } - rc = rcb->rcb_baserc + ((rcin(CD180_GICR) & GICR_CHAN) >> GICR_LSH); - iack = rcin(CD180_MCR); - rc->rc_msvr = rcin(CD180_MSVR); - rcout(CD180_MCR, 0); -#ifdef RCDEBUG - printrcflags(rc, "moint"); -#endif - if (rc->rc_flags & RC_CTSFLOW) { - if (rc->rc_msvr & MSVR_CTS) - rc->rc_flags |= RC_SEND_RDY; - else - rc->rc_flags &= ~RC_SEND_RDY; - } else - rc->rc_flags |= RC_SEND_RDY; - if ((iack & MCR_CDchg) && !(rc->rc_flags & RC_MODCHG)) { - rc_scheduled_event += LOTS_OF_EVENTS; - rc->rc_flags |= RC_MODCHG; - setsofttty(); - } - goto more_intrs; - } - if (bsr & RC_BSR_TXINT) { - iack = rcin(RC_PILR_TX); - if (iack != (GIVR_IT_TDI | RC_FAKEID)) { - kprintf("rc%d: fake txint: %02x\n", unit, iack); - goto more_intrs; - } - rc = rcb->rcb_baserc + ((rcin(CD180_GICR) & GICR_CHAN) >> GICR_LSH); - if ( (rc->rc_flags & RC_OSUSP) - || !(rc->rc_flags & RC_SEND_RDY) - ) - goto more_intrs; - /* Handle breaks and other stuff */ - if (rc->rc_pendcmd) { - rcout(CD180_COR2, rc->rc_cor2 |= COR2_ETC); - rcout(CD180_TDR, CD180_C_ESC); - rcout(CD180_TDR, rc->rc_pendcmd); - rcout(CD180_COR2, rc->rc_cor2 &= ~COR2_ETC); - rc->rc_pendcmd = 0; - goto more_intrs; - } - optr = rc->rc_optr; - resid = rc->rc_obufend - optr; - if (resid > CD180_NFIFO) - resid = CD180_NFIFO; - while (resid-- > 0) - rcout(CD180_TDR, *optr++); - rc->rc_optr = optr; - - /* output completed? */ - if (optr >= rc->rc_obufend) { - rcout(CD180_IER, rc->rc_ier &= ~IER_TxRdy); -#ifdef RCDEBUG - kprintf("rc%d/%d: output completed\n", unit, rc->rc_chan); -#endif - if (!(rc->rc_flags & RC_DOXXFER)) { - rc_scheduled_event += LOTS_OF_EVENTS; - rc->rc_flags |= RC_DOXXFER; - setsofttty(); - } - } - } - more_intrs: - rcout(CD180_EOIR, 0); /* end of interrupt */ - rcout(RC_CTOUT, 0); - bsr = ~(rcin(RC_BSR)); - } - lwkt_reltoken(&tty_token); -} - -/* Feed characters to output buffer */ -static void -rc_start(struct tty *tp) -{ - struct rc_chans *rc = &rc_chans[GET_UNIT(tp->t_dev)]; - int nec = rc->rc_rcb->rcb_addr; - - lwkt_gettoken(&tty_token); - if (rc->rc_flags & RC_OSBUSY) { - lwkt_reltoken(&tty_token); - return; - } - crit_enter(); - rc->rc_flags |= RC_OSBUSY; - cpu_disable_intr(); - if (tp->t_state & TS_TTSTOP) - rc->rc_flags |= RC_OSUSP; - else - rc->rc_flags &= ~RC_OSUSP; - /* Do RTS flow control stuff */ - if ( (rc->rc_flags & RC_RTSFLOW) - && (tp->t_state & TS_TBLOCK) - && (rc->rc_msvr & MSVR_RTS) - ) { - rcout(CD180_CAR, rc->rc_chan); - rcout(CD180_MSVR, rc->rc_msvr &= ~MSVR_RTS); - } else if (!(rc->rc_msvr & MSVR_RTS)) { - rcout(CD180_CAR, rc->rc_chan); - rcout(CD180_MSVR, rc->rc_msvr |= MSVR_RTS); - } - cpu_enable_intr(); - if (tp->t_state & (TS_TIMEOUT|TS_TTSTOP)) - goto out; -#ifdef RCDEBUG - printrcflags(rc, "rcstart"); -#endif - ttwwakeup(tp); -#ifdef RCDEBUG - kprintf("rcstart: outq = %d obuf = %d\n", - tp->t_outq.c_cc, rc->rc_obufend - rc->rc_optr); -#endif - if (tp->t_state & TS_BUSY) - goto out; /* output still in progress ... */ - - if (tp->t_outq.c_cc > 0) { - u_int ocnt; - - tp->t_state |= TS_BUSY; - ocnt = q_to_b(&tp->t_outq, rc->rc_obuf, sizeof rc->rc_obuf); - cpu_disable_intr(); - rc->rc_optr = rc->rc_obuf; - rc->rc_obufend = rc->rc_optr + ocnt; - cpu_enable_intr(); - if (!(rc->rc_ier & IER_TxRdy)) { -#ifdef RCDEBUG - kprintf("rc%d/%d: rcstart enable txint\n", rc->rc_rcb->rcb_unit, rc->rc_chan); -#endif - rcout(CD180_CAR, rc->rc_chan); - rcout(CD180_IER, rc->rc_ier |= IER_TxRdy); - } - } -out: - rc->rc_flags &= ~RC_OSBUSY; - crit_exit(); - lwkt_reltoken(&tty_token); -} - -/* Handle delayed events. */ -void -rcpoll(void *dummy, void *frame) -{ - struct rc_chans *rc; - struct rc_softc *rcb; - u_char *tptr, *eptr; - struct tty *tp; - int chan, icnt, nec, unit; - - lwkt_gettoken(&tty_token); - if (rc_scheduled_event == 0) { - lwkt_reltoken(&tty_token); - return; - } -repeat: - for (unit = 0; unit < NRC; unit++) { - rcb = &rc_softc[unit]; - rc = rcb->rcb_baserc; - nec = rc->rc_rcb->rcb_addr; - for (chan = 0; chan < CD180_NCHAN; rc++, chan++) { - tp = rc->rc_tp; -#ifdef RCDEBUG - if (rc->rc_flags & (RC_DORXFER|RC_DOXXFER|RC_MODCHG| - RC_WAS_BUFOVFL|RC_WAS_SILOVFL)) - printrcflags(rc, "rcevent"); -#endif - if (rc->rc_flags & RC_WAS_BUFOVFL) { - cpu_disable_intr(); - rc->rc_flags &= ~RC_WAS_BUFOVFL; - rc_scheduled_event--; - cpu_enable_intr(); - kprintf("rc%d/%d: interrupt-level buffer overflow\n", - unit, chan); - } - if (rc->rc_flags & RC_WAS_SILOVFL) { - cpu_disable_intr(); - rc->rc_flags &= ~RC_WAS_SILOVFL; - rc_scheduled_event--; - cpu_enable_intr(); - kprintf("rc%d/%d: silo overflow\n", - unit, chan); - } - if (rc->rc_flags & RC_MODCHG) { - cpu_disable_intr(); - rc->rc_flags &= ~RC_MODCHG; - rc_scheduled_event -= LOTS_OF_EVENTS; - cpu_enable_intr(); - (*linesw[tp->t_line].l_modem)(tp, !!(rc->rc_msvr & MSVR_CD)); - } - if (rc->rc_flags & RC_DORXFER) { - cpu_disable_intr(); - rc->rc_flags &= ~RC_DORXFER; - eptr = rc->rc_iptr; - if (rc->rc_bufend == &rc->rc_ibuf[2 * RC_IBUFSIZE]) - tptr = &rc->rc_ibuf[RC_IBUFSIZE]; - else - tptr = rc->rc_ibuf; - icnt = eptr - tptr; - if (icnt > 0) { - if (rc->rc_bufend == &rc->rc_ibuf[2 * RC_IBUFSIZE]) { - rc->rc_iptr = rc->rc_ibuf; - rc->rc_bufend = &rc->rc_ibuf[RC_IBUFSIZE]; - rc->rc_hiwat = &rc->rc_ibuf[RC_IHIGHWATER]; - } else { - rc->rc_iptr = &rc->rc_ibuf[RC_IBUFSIZE]; - rc->rc_bufend = &rc->rc_ibuf[2 * RC_IBUFSIZE]; - rc->rc_hiwat = - &rc->rc_ibuf[RC_IBUFSIZE + RC_IHIGHWATER]; - } - if ( (rc->rc_flags & RC_RTSFLOW) - && (tp->t_state & TS_ISOPEN) - && !(tp->t_state & TS_TBLOCK) - && !(rc->rc_msvr & MSVR_RTS) - ) { - rcout(CD180_CAR, chan); - rcout(CD180_MSVR, - rc->rc_msvr |= MSVR_RTS); - } - rc_scheduled_event -= icnt; - } - cpu_enable_intr(); - - if (icnt <= 0 || !(tp->t_state & TS_ISOPEN)) - goto done1; - - if ( (tp->t_state & TS_CAN_BYPASS_L_RINT) - && !(tp->t_state & TS_LOCAL)) { - if ((tp->t_rawq.c_cc + icnt) >= RB_I_HIGH_WATER - && ((rc->rc_flags & RC_RTSFLOW) || (tp->t_iflag & IXOFF)) - && !(tp->t_state & TS_TBLOCK)) - ttyblock(tp); - tk_nin += icnt; - tk_rawcc += icnt; - tp->t_rawcc += icnt; - if (b_to_q(tptr, icnt, &tp->t_rawq)) - kprintf("rc%d/%d: tty-level buffer overflow\n", - unit, chan); - ttwakeup(tp); - if ((tp->t_state & TS_TTSTOP) && ((tp->t_iflag & IXANY) - || (tp->t_cc[VSTART] == tp->t_cc[VSTOP]))) { - tp->t_state &= ~TS_TTSTOP; - tp->t_lflag &= ~FLUSHO; - rc_start(tp); - } - } else { - for (; tptr < eptr; tptr++) - (*linesw[tp->t_line].l_rint) - (tptr[0] | - rc_rcsrt[tptr[INPUT_FLAGS_SHIFT] & 0xF], tp); - } -done1: ; - } - if (rc->rc_flags & RC_DOXXFER) { - cpu_disable_intr(); - rc_scheduled_event -= LOTS_OF_EVENTS; - rc->rc_flags &= ~RC_DOXXFER; - rc->rc_tp->t_state &= ~TS_BUSY; - cpu_enable_intr(); - (*linesw[tp->t_line].l_start)(tp); - } - } - if (rc_scheduled_event == 0) - break; - } - if (rc_scheduled_event >= LOTS_OF_EVENTS) - goto repeat; - lwkt_reltoken(&tty_token); -} - -static void -rc_stop(struct tty *tp, int rw) -{ - struct rc_chans *rc = &rc_chans[GET_UNIT(tp->t_dev)]; - u_char *tptr, *eptr; - - lwkt_gettoken(&tty_token); -#ifdef RCDEBUG - kprintf("rc%d/%d: rc_stop %s%s\n", rc->rc_rcb->rcb_unit, rc->rc_chan, - (rw & FWRITE)?"FWRITE ":"", (rw & FREAD)?"FREAD":""); -#endif - if (rw & FWRITE) - rc_discard_output(rc); - cpu_disable_intr(); - if (rw & FREAD) { - rc->rc_flags &= ~RC_DORXFER; - eptr = rc->rc_iptr; - if (rc->rc_bufend == &rc->rc_ibuf[2 * RC_IBUFSIZE]) { - tptr = &rc->rc_ibuf[RC_IBUFSIZE]; - rc->rc_iptr = &rc->rc_ibuf[RC_IBUFSIZE]; - } else { - tptr = rc->rc_ibuf; - rc->rc_iptr = rc->rc_ibuf; - } - rc_scheduled_event -= eptr - tptr; - } - if (tp->t_state & TS_TTSTOP) - rc->rc_flags |= RC_OSUSP; - else - rc->rc_flags &= ~RC_OSUSP; - cpu_enable_intr(); - lwkt_reltoken(&tty_token); -} - -static int -rcopen(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct rc_chans *rc; - struct tty *tp; - int unit, nec, error = 0; - - lwkt_gettoken(&tty_token); - unit = GET_UNIT(dev); - if (unit >= NRC * CD180_NCHAN) { - lwkt_reltoken(&tty_token); - return ENXIO; - } - if (rc_softc[unit / CD180_NCHAN].rcb_probed != RC_ATTACHED) { - lwkt_reltoken(&tty_token); - return ENXIO; - } - rc = &rc_chans[unit]; - tp = rc->rc_tp; - dev->si_tty = tp; - nec = rc->rc_rcb->rcb_addr; -#ifdef RCDEBUG - kprintf("rc%d/%d: rcopen: dev %x\n", rc->rc_rcb->rcb_unit, unit, dev); -#endif - crit_enter(); - -again: - while (rc->rc_flags & RC_DTR_OFF) { - error = tsleep(&(rc->rc_dtrwait), PCATCH, "rcdtr", 0); - if (error != 0) - goto out; - } - if (tp->t_state & TS_ISOPEN) { - if (CALLOUT(dev)) { - if (!(rc->rc_flags & RC_ACTOUT)) { - error = EBUSY; - goto out; - } - } else { - if (rc->rc_flags & RC_ACTOUT) { - if (ap->a_oflags & O_NONBLOCK) { - error = EBUSY; - goto out; - } - error = tsleep(&rc->rc_rcb, PCATCH, "rcbi", 0); - if (error) - goto out; - goto again; - } - } - if (tp->t_state & TS_XCLUDE && - priv_check_cred(ap->a_cred, PRIV_ROOT, 0)) { - error = EBUSY; - goto out; - } - } else { - tp->t_oproc = rc_start; - tp->t_param = rc_param; - tp->t_stop = rc_stop; - tp->t_dev = dev; - - if (CALLOUT(dev)) - tp->t_cflag |= CLOCAL; - else - tp->t_cflag &= ~CLOCAL; - - error = rc_param(tp, &tp->t_termios); - if (error) - goto out; - (void) rc_modctl(rc, TIOCM_RTS|TIOCM_DTR, DMSET); - - if ((rc->rc_msvr & MSVR_CD) || CALLOUT(dev)) - (*linesw[tp->t_line].l_modem)(tp, 1); - } - if (!(tp->t_state & TS_CARR_ON) && !CALLOUT(dev) - && !(tp->t_cflag & CLOCAL) && !(ap->a_oflags & O_NONBLOCK)) { - rc->rc_dcdwaits++; - error = tsleep(TSA_CARR_ON(tp), PCATCH, "rcdcd", 0); - rc->rc_dcdwaits--; - if (error != 0) - goto out; - goto again; - } - error = (*linesw[tp->t_line].l_open)(dev, tp); - disc_optim(tp, &tp->t_termios, rc); - if ((tp->t_state & TS_ISOPEN) && CALLOUT(dev)) - rc->rc_flags |= RC_ACTOUT; -out: - crit_exit(); - - if(rc->rc_dcdwaits == 0 && !(tp->t_state & TS_ISOPEN)) - rc_hardclose(rc); - - lwkt_reltoken(&tty_token); - return error; -} - -static int -rcclose(struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct rc_chans *rc; - struct tty *tp; - int unit = GET_UNIT(dev); - - lwkt_gettoken(&tty_token); - if (unit >= NRC * CD180_NCHAN) { - lwkt_reltoken(&tty_token); - return ENXIO; - } - rc = &rc_chans[unit]; - tp = rc->rc_tp; -#ifdef RCDEBUG - kprintf("rc%d/%d: rcclose dev %x\n", rc->rc_rcb->rcb_unit, unit, dev); -#endif - crit_enter(); - (*linesw[tp->t_line].l_close)(tp, ap->a_fflag); - disc_optim(tp, &tp->t_termios, rc); - rc_stop(tp, FREAD | FWRITE); - rc_hardclose(rc); - ttyclose(tp); - crit_exit(); - lwkt_reltoken(&tty_token); - return 0; -} - -/* - * NOTE: Must be called with tty_token held - */ -static void -rc_hardclose(struct rc_chans *rc) -{ - int nec = rc->rc_rcb->rcb_addr; - struct tty *tp = rc->rc_tp; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - crit_enter(); - rcout(CD180_CAR, rc->rc_chan); - - /* Disable rx/tx intrs */ - rcout(CD180_IER, rc->rc_ier = 0); - if ( (tp->t_cflag & HUPCL) - || (!(rc->rc_flags & RC_ACTOUT) - && !(rc->rc_msvr & MSVR_CD) - && !(tp->t_cflag & CLOCAL)) - || !(tp->t_state & TS_ISOPEN) - ) { - CCRCMD(rc->rc_rcb->rcb_unit, rc->rc_chan, CCR_ResetChan); - WAITFORCCR(rc->rc_rcb->rcb_unit, rc->rc_chan); - (void) rc_modctl(rc, TIOCM_RTS, DMSET); - if (rc->rc_dtrwait) { - callout_reset(&rc->rc_dtr_ch, rc->rc_dtrwait, - rc_dtrwakeup, rc); - rc->rc_flags |= RC_DTR_OFF; - } - } - rc->rc_flags &= ~RC_ACTOUT; - wakeup((caddr_t) &rc->rc_rcb); /* wake bi */ - wakeup(TSA_CARR_ON(tp)); - crit_exit(); -} - -/* Reset the bastard */ -/* - * NOTE: Must be called with tty_token held - */ -static void -rc_hwreset(int unit, int nec, unsigned int chipid) -{ - ASSERT_LWKT_TOKEN_HELD(&tty_token); - CCRCMD(unit, -1, CCR_HWRESET); /* Hardware reset */ - DELAY(20000); - WAITFORCCR(unit, -1); - - rcout(RC_CTOUT, 0); /* Clear timeout */ - rcout(CD180_GIVR, chipid); - rcout(CD180_GICR, 0); - - /* Set Prescaler Registers (1 msec) */ - rcout(CD180_PPRL, ((RC_OSCFREQ + 999) / 1000) & 0xFF); - rcout(CD180_PPRH, ((RC_OSCFREQ + 999) / 1000) >> 8); - - /* Initialize Priority Interrupt Level Registers */ - rcout(CD180_PILR1, RC_PILR_MODEM); - rcout(CD180_PILR2, RC_PILR_TX); - rcout(CD180_PILR3, RC_PILR_RX); - - /* Reset DTR */ - rcout(RC_DTREG, ~0); -} - -/* Set channel parameters */ -static int -rc_param(struct tty *tp, struct termios *ts) -{ - struct rc_chans *rc = &rc_chans[GET_UNIT(tp->t_dev)]; - int nec = rc->rc_rcb->rcb_addr; - int idivs, odivs, val, cflag, iflag, lflag, inpflow; - - lwkt_gettoken(&tty_token); - - if ( ts->c_ospeed < 0 || ts->c_ospeed > 76800 - || ts->c_ispeed < 0 || ts->c_ispeed > 76800 - ) { - lwkt_reltoken(&tty_token); - return (EINVAL); - } - if (ts->c_ispeed == 0) - ts->c_ispeed = ts->c_ospeed; - odivs = RC_BRD(ts->c_ospeed); - idivs = RC_BRD(ts->c_ispeed); - - crit_enter(); - - /* Select channel */ - rcout(CD180_CAR, rc->rc_chan); - - /* If speed == 0, hangup line */ - if (ts->c_ospeed == 0) { - CCRCMD(rc->rc_rcb->rcb_unit, rc->rc_chan, CCR_ResetChan); - WAITFORCCR(rc->rc_rcb->rcb_unit, rc->rc_chan); - (void) rc_modctl(rc, TIOCM_DTR, DMBIC); - } - - tp->t_state &= ~TS_CAN_BYPASS_L_RINT; - cflag = ts->c_cflag; - iflag = ts->c_iflag; - lflag = ts->c_lflag; - - if (idivs > 0) { - rcout(CD180_RBPRL, idivs & 0xFF); - rcout(CD180_RBPRH, idivs >> 8); - } - if (odivs > 0) { - rcout(CD180_TBPRL, odivs & 0xFF); - rcout(CD180_TBPRH, odivs >> 8); - } - - /* set timeout value */ - if (ts->c_ispeed > 0) { - int itm = ts->c_ispeed > 2400 ? 5 : 10000 / ts->c_ispeed + 1; - - if ( !(lflag & ICANON) - && ts->c_cc[VMIN] != 0 && ts->c_cc[VTIME] != 0 - && ts->c_cc[VTIME] * 10 > itm) - itm = ts->c_cc[VTIME] * 10; - - rcout(CD180_RTPR, itm <= 255 ? itm : 255); - } - - switch (cflag & CSIZE) { - case CS5: val = COR1_5BITS; break; - case CS6: val = COR1_6BITS; break; - case CS7: val = COR1_7BITS; break; - default: - case CS8: val = COR1_8BITS; break; - } - if (cflag & PARENB) { - val |= COR1_NORMPAR; - if (cflag & PARODD) - val |= COR1_ODDP; - if (!(cflag & INPCK)) - val |= COR1_Ignore; - } else - val |= COR1_Ignore; - if (cflag & CSTOPB) - val |= COR1_2SB; - rcout(CD180_COR1, val); - - /* Set FIFO threshold */ - val = ts->c_ospeed <= 4800 ? 1 : CD180_NFIFO / 2; - inpflow = 0; - if ( (iflag & IXOFF) - && ( ts->c_cc[VSTOP] != _POSIX_VDISABLE - && ( ts->c_cc[VSTART] != _POSIX_VDISABLE - || (iflag & IXANY) - ) - ) - ) { - inpflow = 1; - val |= COR3_SCDE|COR3_FCT; - } - rcout(CD180_COR3, val); - - /* Initialize on-chip automatic flow control */ - val = 0; - rc->rc_flags &= ~(RC_CTSFLOW|RC_SEND_RDY); - if (cflag & CCTS_OFLOW) { - rc->rc_flags |= RC_CTSFLOW; - val |= COR2_CtsAE; - } else - rc->rc_flags |= RC_SEND_RDY; - if (tp->t_state & TS_TTSTOP) - rc->rc_flags |= RC_OSUSP; - else - rc->rc_flags &= ~RC_OSUSP; - if (cflag & CRTS_IFLOW) - rc->rc_flags |= RC_RTSFLOW; - else - rc->rc_flags &= ~RC_RTSFLOW; - - if (inpflow) { - if (ts->c_cc[VSTART] != _POSIX_VDISABLE) - rcout(CD180_SCHR1, ts->c_cc[VSTART]); - rcout(CD180_SCHR2, ts->c_cc[VSTOP]); - val |= COR2_TxIBE; - if (iflag & IXANY) - val |= COR2_IXM; - } - - rcout(CD180_COR2, rc->rc_cor2 = val); - - CCRCMD(rc->rc_rcb->rcb_unit, rc->rc_chan, - CCR_CORCHG1 | CCR_CORCHG2 | CCR_CORCHG3); - - disc_optim(tp, ts, rc); - - /* modem ctl */ - val = cflag & CLOCAL ? 0 : MCOR1_CDzd; - if (cflag & CCTS_OFLOW) - val |= MCOR1_CTSzd; - rcout(CD180_MCOR1, val); - - val = cflag & CLOCAL ? 0 : MCOR2_CDod; - if (cflag & CCTS_OFLOW) - val |= MCOR2_CTSod; - rcout(CD180_MCOR2, val); - - /* enable i/o and interrupts */ - CCRCMD(rc->rc_rcb->rcb_unit, rc->rc_chan, - CCR_XMTREN | ((cflag & CREAD) ? CCR_RCVREN : CCR_RCVRDIS)); - WAITFORCCR(rc->rc_rcb->rcb_unit, rc->rc_chan); - - rc->rc_ier = cflag & CLOCAL ? 0 : IER_CD; - if (cflag & CCTS_OFLOW) - rc->rc_ier |= IER_CTS; - if (cflag & CREAD) - rc->rc_ier |= IER_RxData; - if (tp->t_state & TS_BUSY) - rc->rc_ier |= IER_TxRdy; - if (ts->c_ospeed != 0) - rc_modctl(rc, TIOCM_DTR, DMBIS); - if ((cflag & CCTS_OFLOW) && (rc->rc_msvr & MSVR_CTS)) - rc->rc_flags |= RC_SEND_RDY; - rcout(CD180_IER, rc->rc_ier); - crit_exit(); - lwkt_reltoken(&tty_token); - return 0; -} - -/* Re-initialize board after bogus interrupts */ -/* - * NOTE: Must be called with tty_token held - */ -static void -rc_reinit(struct rc_softc *rcb) -{ - struct rc_chans *rc, *rce; - int nec; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - nec = rcb->rcb_addr; - rc_hwreset(rcb->rcb_unit, nec, RC_FAKEID); - rc = &rc_chans[rcb->rcb_unit * CD180_NCHAN]; - rce = rc + CD180_NCHAN; - for (; rc < rce; rc++) - (void) rc_param(rc->rc_tp, &rc->rc_tp->t_termios); -} - -static int -rcioctl(struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct rc_chans *rc = &rc_chans[GET_UNIT(dev)]; - int error; - struct tty *tp = rc->rc_tp; - - lwkt_gettoken(&tty_token); - error = (*linesw[tp->t_line].l_ioctl)(tp, ap->a_cmd, ap->a_data, - ap->a_fflag, ap->a_cred); - if (error != ENOIOCTL) { - lwkt_reltoken(&tty_token); - return (error); - } - error = ttioctl(tp, ap->a_cmd, ap->a_data, ap->a_fflag); - disc_optim(tp, &tp->t_termios, rc); - if (error != ENOIOCTL) { - lwkt_reltoken(&tty_token); - return (error); - } - crit_enter(); - - switch (ap->a_cmd) { - case TIOCSBRK: - rc->rc_pendcmd = CD180_C_SBRK; - break; - - case TIOCCBRK: - rc->rc_pendcmd = CD180_C_EBRK; - break; - - case TIOCSDTR: - (void) rc_modctl(rc, TIOCM_DTR, DMBIS); - break; - - case TIOCCDTR: - (void) rc_modctl(rc, TIOCM_DTR, DMBIC); - break; - - case TIOCMGET: - *(int *) ap->a_data = rc_modctl(rc, 0, DMGET); - break; - - case TIOCMSET: - (void) rc_modctl(rc, *(int *) ap->a_data, DMSET); - break; - - case TIOCMBIC: - (void) rc_modctl(rc, *(int *) ap->a_data, DMBIC); - break; - - case TIOCMBIS: - (void) rc_modctl(rc, *(int *) ap->a_data, DMBIS); - break; - - case TIOCMSDTRWAIT: - error = priv_check_cred(ap->a_cred, PRIV_ROOT, 0); - if (error != 0) { - crit_exit(); - lwkt_reltoken(&tty_token); - return (error); - } - rc->rc_dtrwait = *(int *)ap->a_data * hz / 100; - break; - - case TIOCMGDTRWAIT: - *(int *)ap->a_data = rc->rc_dtrwait * 100 / hz; - break; - - default: - crit_exit(); - lwkt_reltoken(&tty_token); - return ENOTTY; - } - crit_exit(); - lwkt_reltoken(&tty_token); - return 0; -} - - -/* Modem control routines */ -/* - * NOTE: Must be called with tty_token held - */ -static int -rc_modctl(struct rc_chans *rc, int bits, int cmd) -{ - int nec = rc->rc_rcb->rcb_addr; - u_char *dtr = &rc->rc_rcb->rcb_dtr, msvr; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - rcout(CD180_CAR, rc->rc_chan); - - switch (cmd) { - case DMSET: - rcout(RC_DTREG, (bits & TIOCM_DTR) ? - ~(*dtr |= 1 << rc->rc_chan) : - ~(*dtr &= ~(1 << rc->rc_chan))); - msvr = rcin(CD180_MSVR); - if (bits & TIOCM_RTS) - msvr |= MSVR_RTS; - else - msvr &= ~MSVR_RTS; - if (bits & TIOCM_DTR) - msvr |= MSVR_DTR; - else - msvr &= ~MSVR_DTR; - rcout(CD180_MSVR, msvr); - break; - - case DMBIS: - if (bits & TIOCM_DTR) - rcout(RC_DTREG, ~(*dtr |= 1 << rc->rc_chan)); - msvr = rcin(CD180_MSVR); - if (bits & TIOCM_RTS) - msvr |= MSVR_RTS; - if (bits & TIOCM_DTR) - msvr |= MSVR_DTR; - rcout(CD180_MSVR, msvr); - break; - - case DMGET: - bits = TIOCM_LE; - msvr = rc->rc_msvr = rcin(CD180_MSVR); - - if (msvr & MSVR_RTS) - bits |= TIOCM_RTS; - if (msvr & MSVR_CTS) - bits |= TIOCM_CTS; - if (msvr & MSVR_DSR) - bits |= TIOCM_DSR; - if (msvr & MSVR_DTR) - bits |= TIOCM_DTR; - if (msvr & MSVR_CD) - bits |= TIOCM_CD; - if (~rcin(RC_RIREG) & (1 << rc->rc_chan)) - bits |= TIOCM_RI; - return bits; - - case DMBIC: - if (bits & TIOCM_DTR) - rcout(RC_DTREG, ~(*dtr &= ~(1 << rc->rc_chan))); - msvr = rcin(CD180_MSVR); - if (bits & TIOCM_RTS) - msvr &= ~MSVR_RTS; - if (bits & TIOCM_DTR) - msvr &= ~MSVR_DTR; - rcout(CD180_MSVR, msvr); - break; - } - rc->rc_msvr = rcin(CD180_MSVR); - return 0; -} - -/* Test the board. */ -int -rc_test(int nec, int unit) -{ - int chan = 0; - int i = 0, rcnt; - unsigned int iack, chipid; - unsigned short divs; - static u_char ctest[] = "\377\125\252\045\244\0\377"; -#define CTLEN 8 -#define ERR(s) { \ - kprintf("rc%d: ", unit); kprintf s ; kprintf("\n"); \ - crit_exit(); return 1; } - - struct rtest { - u_char txbuf[CD180_NFIFO]; /* TX buffer */ - u_char rxbuf[CD180_NFIFO]; /* RX buffer */ - int rxptr; /* RX pointer */ - int txptr; /* TX pointer */ - } tchans[CD180_NCHAN]; - - lwkt_gettoken(&tty_token); - crit_enter(); - - chipid = RC_FAKEID; - - /* First, reset board to inital state */ - rc_hwreset(unit, nec, chipid); - - divs = RC_BRD(19200); - - /* Initialize channels */ - for (chan = 0; chan < CD180_NCHAN; chan++) { - - /* Select and reset channel */ - rcout(CD180_CAR, chan); - CCRCMD(unit, chan, CCR_ResetChan); - WAITFORCCR(unit, chan); - - /* Set speed */ - rcout(CD180_RBPRL, divs & 0xFF); - rcout(CD180_RBPRH, divs >> 8); - rcout(CD180_TBPRL, divs & 0xFF); - rcout(CD180_TBPRH, divs >> 8); - - /* set timeout value */ - rcout(CD180_RTPR, 0); - - /* Establish local loopback */ - rcout(CD180_COR1, COR1_NOPAR | COR1_8BITS | COR1_1SB); - rcout(CD180_COR2, COR2_LLM); - rcout(CD180_COR3, CD180_NFIFO); - CCRCMD(unit, chan, CCR_CORCHG1 | CCR_CORCHG2 | CCR_CORCHG3); - CCRCMD(unit, chan, CCR_RCVREN | CCR_XMTREN); - WAITFORCCR(unit, chan); - rcout(CD180_MSVR, MSVR_RTS); - - /* Fill TXBUF with test data */ - for (i = 0; i < CD180_NFIFO; i++) { - tchans[chan].txbuf[i] = ctest[i]; - tchans[chan].rxbuf[i] = 0; - } - tchans[chan].txptr = tchans[chan].rxptr = 0; - - /* Now, start transmit */ - rcout(CD180_IER, IER_TxMpty|IER_RxData); - } - /* Pseudo-interrupt poll stuff */ - for (rcnt = 10000; rcnt-- > 0; rcnt--) { - i = ~(rcin(RC_BSR)); - if (i & RC_BSR_TOUT) - ERR(("BSR timeout bit set\n")) - else if (i & RC_BSR_TXINT) { - iack = rcin(RC_PILR_TX); - if (iack != (GIVR_IT_TDI | chipid)) - ERR(("Bad TX intr ack (%02x != %02x)\n", - iack, GIVR_IT_TDI | chipid)); - chan = (rcin(CD180_GICR) & GICR_CHAN) >> GICR_LSH; - /* If no more data to transmit, disable TX intr */ - if (tchans[chan].txptr >= CD180_NFIFO) { - iack = rcin(CD180_IER); - rcout(CD180_IER, iack & ~IER_TxMpty); - } else { - for (iack = tchans[chan].txptr; - iack < CD180_NFIFO; iack++) - rcout(CD180_TDR, - tchans[chan].txbuf[iack]); - tchans[chan].txptr = iack; - } - rcout(CD180_EOIR, 0); - } else if (i & RC_BSR_RXINT) { - u_char ucnt; - - iack = rcin(RC_PILR_RX); - if (iack != (GIVR_IT_RGDI | chipid) && - iack != (GIVR_IT_REI | chipid)) - ERR(("Bad RX intr ack (%02x != %02x)\n", - iack, GIVR_IT_RGDI | chipid)) - chan = (rcin(CD180_GICR) & GICR_CHAN) >> GICR_LSH; - ucnt = rcin(CD180_RDCR) & 0xF; - while (ucnt-- > 0) { - iack = rcin(CD180_RCSR); - if (iack & RCSR_Timeout) - break; - if (iack & 0xF) - ERR(("Bad char chan %d (RCSR = %02X)\n", - chan, iack)) - if (tchans[chan].rxptr > CD180_NFIFO) - ERR(("Got extra chars chan %d\n", - chan)) - tchans[chan].rxbuf[tchans[chan].rxptr++] = - rcin(CD180_RDR); - } - rcout(CD180_EOIR, 0); - } - rcout(RC_CTOUT, 0); - for (iack = chan = 0; chan < CD180_NCHAN; chan++) - if (tchans[chan].rxptr >= CD180_NFIFO) - iack++; - if (iack == CD180_NCHAN) - break; - } - for (chan = 0; chan < CD180_NCHAN; chan++) { - /* Select and reset channel */ - rcout(CD180_CAR, chan); - CCRCMD(unit, chan, CCR_ResetChan); - } - - if (!rcnt) - ERR(("looses characters during local loopback\n")) - /* Now, check data */ - for (chan = 0; chan < CD180_NCHAN; chan++) - for (i = 0; i < CD180_NFIFO; i++) - if (ctest[i] != tchans[chan].rxbuf[i]) - ERR(("data mismatch chan %d ptr %d (%d != %d)\n", - chan, i, ctest[i], tchans[chan].rxbuf[i])) - crit_exit(); - lwkt_reltoken(&tty_token); - return 0; -} - -#ifdef RCDEBUG -static void -printrcflags(struct rc_chans *rc, char *comment) -{ - u_short f = rc->rc_flags; - int nec = rc->rc_rcb->rcb_addr; - - kprintf("rc%d/%d: %s flags: %s%s%s%s%s%s%s%s%s%s%s%s\n", - rc->rc_rcb->rcb_unit, rc->rc_chan, comment, - (f & RC_DTR_OFF)?"DTR_OFF " :"", - (f & RC_ACTOUT) ?"ACTOUT " :"", - (f & RC_RTSFLOW)?"RTSFLOW " :"", - (f & RC_CTSFLOW)?"CTSFLOW " :"", - (f & RC_DORXFER)?"DORXFER " :"", - (f & RC_DOXXFER)?"DOXXFER " :"", - (f & RC_MODCHG) ?"MODCHG " :"", - (f & RC_OSUSP) ?"OSUSP " :"", - (f & RC_OSBUSY) ?"OSBUSY " :"", - (f & RC_WAS_BUFOVFL) ?"BUFOVFL " :"", - (f & RC_WAS_SILOVFL) ?"SILOVFL " :"", - (f & RC_SEND_RDY) ?"SEND_RDY":""); - - rcout(CD180_CAR, rc->rc_chan); - - kprintf("rc%d/%d: msvr %02x ier %02x ccsr %02x\n", - rc->rc_rcb->rcb_unit, rc->rc_chan, - rcin(CD180_MSVR), - rcin(CD180_IER), - rcin(CD180_CCSR)); -} -#endif /* RCDEBUG */ - -static void -rc_dtrwakeup(void *chan) -{ - struct rc_chans *rc; - - lwkt_gettoken(&tty_token); - rc = (struct rc_chans *)chan; - rc->rc_flags &= ~RC_DTR_OFF; - wakeup(&rc->rc_dtrwait); - lwkt_reltoken(&tty_token); -} - -static void -rc_discard_output(struct rc_chans *rc) -{ - lwkt_gettoken(&tty_token); - cpu_disable_intr(); - if (rc->rc_flags & RC_DOXXFER) { - rc_scheduled_event -= LOTS_OF_EVENTS; - rc->rc_flags &= ~RC_DOXXFER; - } - rc->rc_optr = rc->rc_obufend; - rc->rc_tp->t_state &= ~TS_BUSY; - cpu_enable_intr(); - ttwwakeup(rc->rc_tp); - lwkt_reltoken(&tty_token); -} - -static void -rc_wakeup(void *chan) -{ - lwkt_gettoken(&tty_token); - if (rc_scheduled_event != 0) { - crit_enter(); - rcpoll(NULL, NULL); - crit_exit(); - } - callout_reset(&rc_wakeup_ch, 1, rc_wakeup, NULL); - lwkt_reltoken(&tty_token); -} - -static void -disc_optim(struct tty *tp, struct termios *t, struct rc_chans *rc) -{ - - lwkt_gettoken(&tty_token); - if (!(t->c_iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP | IXON)) - && (!(t->c_iflag & BRKINT) || (t->c_iflag & IGNBRK)) - && (!(t->c_iflag & PARMRK) - || (t->c_iflag & (IGNPAR | IGNBRK)) == (IGNPAR | IGNBRK)) - && !(t->c_lflag & (ECHO | ICANON | IEXTEN | ISIG | PENDIN)) - && linesw[tp->t_line].l_rint == ttyinput) - tp->t_state |= TS_CAN_BYPASS_L_RINT; - else - tp->t_state &= ~TS_CAN_BYPASS_L_RINT; - rc->rc_hotchar = linesw[tp->t_line].l_hotchar; - lwkt_reltoken(&tty_token); -} - -static void -rc_wait0(int nec, int unit, int chan, int line) -{ - int rcnt; - - for (rcnt = 50; rcnt && rcin(CD180_CCR); rcnt--) - DELAY(30); - if (rcnt == 0) - kprintf("rc%d/%d: channel command timeout, rc.c line: %d\n", - unit, chan, line); -} diff --git a/sys/dev/serial/rc/rcreg.h b/sys/dev/serial/rc/rcreg.h deleted file mode 100644 index 0e2e299ec5..0000000000 --- a/sys/dev/serial/rc/rcreg.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 1995 by Pavel Antonov, Moscow, Russia. - * Copyright (C) 1995 by Andrey A. Chernov, Moscow, Russia. - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 REGENTS OR CONTRIBUTORS 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: src/sys/i386/isa/rcreg.h,v 1.3.12.1 2000/08/03 01:01:20 peter Exp $ - * $DragonFly: src/sys/dev/serial/rc/rcreg.h,v 1.2 2003/06/17 04:28:37 dillon Exp $ - */ - -/* - * Cirrus Logic CD180 -based RISCom/8 board definitions - */ - -/* Oscillator frequency - 19660.08Mhz / 2 */ -#define RC_OSCFREQ 9830400 - -#define RC_BRD(s) ((s) == 0 ? 0 : \ - (((RC_OSCFREQ + (s) / 2) / (s)) + CD180_CTICKS/2) / CD180_CTICKS) - -#define RC_VALIDADDR(a) ( (a) == 0x220 || (a) == 0x240 || (a) == 0x250 \ - || (a) == 0x260 || (a) == 0x2A0 || (a) == 0x2B0 \ - || (a) == 0x300 || (a) == 0x320) - -#define RC_VALIDIRQ(i) ((i) < 16 && \ - "\0\0\0\1\1\1\0\1\0\0\1\1\1\0\0\1"[(i) & 0xF]) - -/* Riscom/8 board ISA I/O mapping */ -#define RC_IOMAP(r) ((((r) & 07) << 1) | (((r) & ~07) << 7)) - -/* I/O commands */ -#define RC_OUT(p,i,d) outb(RC_IOMAP(i) + (p), (d)) -#define RC_IN(p,i) inb (RC_IOMAP(i) + (p)) - -/* Riscom on-board registers (mapping assumed) */ -#define RC_RIREG 0x100 /* Ring Indicator Register (read-only) */ -#define RC_DTREG 0x100 /* DTR Register (write-only) */ -#define RC_BSR 0x101 /* Board Status Register (read-only) */ -#define RC_CTOUT 0x101 /* Clear Timeout (write-only) */ - -/* Board Status Register */ -#define RC_BSR_TOUT 0x08 /* Timeout */ -#define RC_BSR_RXINT 0x04 /* Receiver Interrupt */ -#define RC_BSR_TXINT 0x02 /* Transmitter Interrupt */ -#define RC_BSR_MOINT 0x01 /* Modem Control Interrupt */ - -/* Interrupt groups */ -#define RC_MODEMGRP 0x01 /* Modem interrupt group */ -#define RC_RXGRP 0x02 /* Receiver interrupt group */ -#define RC_TXGRP 0x04 /* Transmitter interrupt group */ - -/* Priority Interrupt Level definitions */ -#define RC_PILR_MODEM (0x80 | RC_MODEMGRP) -#define RC_PILR_RX (0x80 | RC_RXGRP ) -#define RC_PILR_TX (0x80 | RC_TXGRP ) diff --git a/sys/dev/video/ctx/ctx.c b/sys/dev/video/ctx/ctx.c deleted file mode 100644 index 6b3b655a31..0000000000 --- a/sys/dev/video/ctx/ctx.c +++ /dev/null @@ -1,448 +0,0 @@ -/* - * CORTEX-I Frame Grabber driver V1.0 - * - * Copyright (C) 1994, Paul S. LaFollette, Jr. This software may be used, - * modified, copied, distributed, and sold, in both source and binary form - * provided that the above copyright and these terms are retained. Under - * no circumstances is the author responsible for the proper functioning - * of this software, nor does the author assume any responsibility - * for damages incurred with its use. - * - * $FreeBSD: src/sys/i386/isa/ctx.c,v 1.36 2000/01/29 16:17:31 peter Exp $ - */ - -/* - * - * - * - * Device Driver for CORTEX-I Frame Grabber - * Made by ImageNation Corporation - * 1200 N.E. Keyues Road - * Vancouver, WA 98684 (206) 944-9131 - * (I have no ties to this company, just thought you might want - * to know how to get in touch with them.) - * - * In order to understand this device, you really need to consult the - * manual which ImageNation provides when you buy the board. (And - * what a pleasure it is to buy something for a PC and actually get - * programming information along with it.) I will limit myself here to - * a few comments which are specific to this driver. See also the file - * ctxreg.h for definitions of registers and control bits. - * - * 1. Although the hardware supports low resolution (256 x 256) - * acqusition and display, I have not implemented access to - * these modes in this driver. There are some fairly quirky - * aspects to the way this board works in low resolution mode, - * and I don't want to deal with them. Maybe later. - * - * 2. Choosing the base address for the video memory: This is set - * using a combination of hardware and software, using the left - * most dip switch on the board, and the AB_SELECT bit of control - * port 1, according to the chart below: - * - * Left DIP switch || DOWN | UP | - * ================================================= - * AB_SELECT = 0 || 0xA0000 | 0xB0000 | - * ------------------------------------------------- - * AB_SELECT = 1 || 0xD0000 | 0xE0000 | - * ------------------------------------------------ - * - * When the RAM_ENABLE bit of control port 1 is clear (0), the - * video ram is disconnected from the computer bus. This makes - * it possible, in principle, to share memory space with other - * devices (such as VGA) which can also disconnect themselves - * from the bus. It also means that multiple CORTEX-I boards - * can share the same video memory space. Disconnecting from the - * bus does not affect the video display of the video ram contents, - * so that one needs only set the RAM_ENABLE bit when actually - * reading or writing to memory. The cost of this is low, - * the benefits to me are great (I need more than one board - * in my machine, and 0xE0000 is the only address choice that - * doesn't conflict with anything) so I adopt this strategy here. - * - * XXX-Note... this driver has only been tested for the - * XXX base = 0xE0000 case! - * - * 3) There is a deficiency in the documentation from ImageNation, I - * think. In order to successfully load the lookup table, it is - * necessary to clear SEE_STORED_VIDEO in control port 0 as well as - * setting LUT_LOAD_ENABLE in control port 1. - * - * 4) This driver accesses video memory through read or write operations. - * Other functionality is provided through ioctl's, manifest - * constants for which are defined in ioctl_ctx.h. The ioctl's - * include: - * CTX_LIVE Display live video - * CTX_GRAB Grab a frame of video data - * CTX_H_ORGANIZE Set things up so that sequential read - * operations access horizontal lines of - * pixels. - * CTX_V_ORGANIZE Set things up so that sequential read - * operations access vertical lines of - * pixels. - * CTX_SET_LUT Set the lookup table from an array - * of 256 unsigned chars passed as the - * third parameter to ioctl. - * CTX_GET_LUT Return the current lookup table to - * the application as an array of 256 - * unsigned chars. Again the third - * parameter to the ioctl call. - * - * Thus, - * ioctl(fi, CTX_H_ORGANIZE, 0); - * lseek(fi, y*512, SEEK_SET); - * read(fi, buffer, 512); - * - * will fill buffer with 512 pixels (unsigned chars) which represent - * the y-th horizontal line of the image. - * Similarly, - * ioctl(fi, CTX_V_ORGANIZE, 0: - * lseek(fi, x*512+y, SEEK_SET); - * read(fi, buffer, 10); - * - * will read 10 a vertical line of 10 pixels starting at (x,y). - * - * Obviously, this sort of ugliness needs to be hidden away from - * the casual user, with an appropriate set of higher level - * functions. - * - */ - -#include "use_ctx.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include "ctxreg.h" -#include -#include - -static int waitvb(int port); - -/* state flags */ -#define OPEN (0x01) /* device is open */ - -#define UNIT(x) ((x) & 0x07) - -static int ctxprobe (struct isa_device *devp); -static int ctxattach (struct isa_device *devp); -struct isa_driver ctxdriver = {ctxprobe, ctxattach, "ctx"}; - -static d_open_t ctxopen; -static d_close_t ctxclose; -static d_read_t ctxread; -static d_write_t ctxwrite; -static d_ioctl_t ctxioctl; - -static struct dev_ops ctx_ops = { - { "ctx", 0, 0 }, - .d_open = ctxopen, - .d_close = ctxclose, - .d_read = ctxread, - .d_write = ctxwrite, - .d_ioctl = ctxioctl, -}; - - -#define LUTSIZE 256 /* buffer size for Look Up Table (LUT) */ -#define PAGESIZE 65536 /* size of one video page, 1/4 of the screen */ - -/* - * Per unit shadow registers (because the dumb hardware is RO) -*/ - -static struct ctx_soft_registers { - u_char *lutp; - u_char cp0; - u_char cp1; - u_char flag; - int iobase; - caddr_t maddr; - int msize; -} ctx_sr[NCTX]; - - -static int -ctxprobe(struct isa_device * devp) -{ - int status; - - if (inb(devp->id_iobase) == 0xff) /* 0xff only if board absent */ - status = 0; - else - status = 1; /*XXX uses only one port? */ - return (status); -} - -static int -ctxattach(struct isa_device * devp) -{ - struct ctx_soft_registers *sr; - - sr = &(ctx_sr[devp->id_unit]); - sr->cp0 = 0; /* zero out the shadow registers */ - sr->cp1 = 0; /* and the open flag. wait for */ - sr->flag = 0; /* open to malloc the LUT space */ - sr->iobase = devp->id_iobase; - sr->maddr = devp->id_maddr; - sr->msize = devp->id_msize; - make_dev(&ctx_ops, devp->id_unit, 0, 0, 0600, - "ctx%d", devp->id_unit); - return (1); -} - -static int -ctxopen(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct ctx_soft_registers *sr; - u_char unit; - int i; - - unit = UNIT(minor(dev)); - - /* minor number out of range? */ - - if (unit >= NCTX) - return (ENXIO); - sr = &(ctx_sr[unit]); - - if (sr->flag != 0) /* someone has already opened us */ - return (EBUSY); - - /* get space for the LUT buffer */ - - sr->lutp = kmalloc(LUTSIZE, M_DEVBUF, M_WAITOK); - - sr->flag = OPEN; - -/* - Set up the shadow registers. We don't actually write these - values to the control ports until after we finish loading the - lookup table. -*/ - sr->cp0 |= SEE_STORED_VIDEO; - if ((kvtop(sr->maddr) == 0xB0000) || (kvtop(sr->maddr) == 0xE0000)) - sr->cp1 |= AB_SELECT; /* map to B or E if necessary */ - /* but don't enable RAM */ -/* - Set up the lookup table initially so that it is transparent. -*/ - - outb(sr->iobase + ctx_cp0, (u_char) 0); - outb(sr->iobase + ctx_cp1, (u_char) (LUT_LOAD_ENABLE | BLANK_DISPLAY)); - for (i = 0; i < LUTSIZE; i++) { - outb(sr->iobase + ctx_lutaddr, (u_char) i); - sr->lutp[i] = (u_char) i; - outb(sr->iobase + ctx_lutdata, (u_char) sr->lutp[i]); - } -/* - Disable LUT loading, and push the data in the shadow - registers into the control ports. -*/ - outb(sr->iobase + ctx_cp0, sr->cp0); - outb(sr->iobase + ctx_cp1, sr->cp1); - return (0); /* successful open. All ready to go. */ -} - -static int -ctxclose(struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - int unit; - - unit = UNIT(minor(dev)); - ctx_sr[unit].flag = 0; - kfree(ctx_sr[unit].lutp, M_DEVBUF); - ctx_sr[unit].lutp = NULL; - return (0); -} - -static int -ctxwrite(struct dev_write_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct uio *uio = ap->a_uio; - int unit, status = 0; - int page, count, offset; - struct ctx_soft_registers *sr; - u_long ef; - - unit = UNIT(minor(dev)); - sr = &(ctx_sr[unit]); - - if (uio->uio_offset < 0) - return (EINVAL); - if (uio->uio_offset >= 4 * PAGESIZE) - page = 4; /* EOF */ - else - page = (u_int)uio->uio_offset / PAGESIZE; - offset = (u_int)uio->uio_offset % PAGESIZE; - count = (int)szmin(uio->uio_resid, PAGESIZE - offset); - while ((page >= 0) && (page <= 3) && (count > 0)) { - sr->cp0 &= ~3; - sr->cp0 |= page; - outb(sr->iobase + ctx_cp0, sr->cp0); - -/* - Before doing the uiomove, we need to "connect" the frame buffer - ram to the machine bus. This is done here so that we can have - several different boards installed, all sharing the same memory - space... each board is only "connected" to the bus when its memory - is actually being read or written. All my instincts tell me that - I should disable interrupts here, so I have done so. -*/ - - ef = read_eflags(); - cpu_disable_intr(); - sr->cp1 |= RAM_ENABLE; - outb(sr->iobase + ctx_cp1, sr->cp1); - status = uiomove(sr->maddr + offset, count, uio); - sr->cp1 &= ~RAM_ENABLE; - outb(sr->iobase + ctx_cp1, sr->cp1); - write_eflags(ef); - - page = (u_int)uio->uio_offset / PAGESIZE; - offset = (u_int)uio->uio_offset % PAGESIZE; - count = (int)szmin(uio->uio_resid, PAGESIZE - offset); - } - if (uio->uio_resid > 0) - return (ENOSPC); - else - return (status); -} - -static int -ctxread(struct dev_read_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct uio *uio = ap->a_uio; - int unit, status = 0; - int page, count, offset; - struct ctx_soft_registers *sr; - u_long ef; - - unit = UNIT(minor(dev)); - sr = &(ctx_sr[unit]); - - if (uio->uio_offset < 0) - return (EINVAL); - if (uio->uio_offset >= 4 * PAGESIZE) - page = 4; /* EOF */ - else - page = (u_int)uio->uio_offset / PAGESIZE; - offset = (u_int)uio->uio_offset % PAGESIZE; - count = (int)szmin(uio->uio_resid, PAGESIZE - offset); - while ((page >= 0) && (page <= 3) && (count > 0)) { - sr->cp0 &= ~3; - sr->cp0 |= page; - outb(sr->iobase + ctx_cp0, sr->cp0); -/* - Before doing the uiomove, we need to "connect" the frame buffer - ram to the machine bus. This is done here so that we can have - several different boards installed, all sharing the same memory - space... each board is only "connected" to the bus when its memory - is actually being read or written. All my instincts tell me that - I should disable interrupts here, so I have done so. -*/ - ef = read_eflags(); - cpu_disable_intr(); - sr->cp1 |= RAM_ENABLE; - outb(sr->iobase + ctx_cp1, sr->cp1); - status = uiomove(sr->maddr + offset, count, uio); - sr->cp1 &= ~RAM_ENABLE; - outb(sr->iobase + ctx_cp1, sr->cp1); - write_eflags(ef); - - page = (u_int)uio->uio_offset / PAGESIZE; - offset = (u_int)uio->uio_offset % PAGESIZE; - count = (int)szmin(uio->uio_resid, PAGESIZE - offset); - } - if (uio->uio_resid > 0) - return (ENOSPC); - else - return (status); -} - -static int -ctxioctl(struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - int error; - int unit, i; - struct ctx_soft_registers *sr; - - error = 0; - unit = UNIT(minor(dev)); - sr = &(ctx_sr[unit]); - - switch (ap->a_cmd) { - case CTX_LIVE: - sr->cp0 &= ~SEE_STORED_VIDEO; - outb(sr->iobase + ctx_cp0, sr->cp0); - break; - case CTX_GRAB: - sr->cp0 &= ~SEE_STORED_VIDEO; - outb(sr->iobase + ctx_cp0, sr->cp0); - sr->cp0 |= ACQUIRE; - if (waitvb(sr->iobase)) /* wait for vert blank to start - * acquire */ - error = ENODEV; - outb(sr->iobase + ctx_cp0, sr->cp0); - if (waitvb(sr->iobase)) /* wait for two more to finish acquire */ - error = ENODEV; - if (waitvb(sr->iobase)) - error = ENODEV; - sr->cp0 &= ~ACQUIRE; /* turn off acquire and turn on - * display */ - sr->cp0 |= SEE_STORED_VIDEO; - outb(sr->iobase + ctx_cp0, sr->cp0); - break; - case CTX_H_ORGANIZE: - sr->cp0 &= ~PAGE_ROTATE; - outb(sr->iobase + ctx_cp0, sr->cp0); - break; - case CTX_V_ORGANIZE: - sr->cp0 |= PAGE_ROTATE; - outb(sr->iobase + ctx_cp0, sr->cp0); - break; - case CTX_SET_LUT: - bcopy((u_char *) ap->a_data, sr->lutp, LUTSIZE); - outb(sr->iobase + ctx_cp0, (u_char) 0); - outb(sr->iobase + ctx_cp1, (u_char) (LUT_LOAD_ENABLE | BLANK_DISPLAY)); - for (i = 0; i < LUTSIZE; i++) { - outb(sr->iobase + ctx_lutaddr, i); - outb(sr->iobase + ctx_lutdata, sr->lutp[i]); - } - outb(sr->iobase + ctx_cp0, sr->cp0); /* restore control - * registers */ - outb(sr->iobase + ctx_cp1, sr->cp1); - break; - case CTX_GET_LUT: - bcopy(sr->lutp, (u_char *) ap->a_data, LUTSIZE); - break; - default: - error = ENODEV; - } - - return (error); -} - -static int -waitvb(int port) -{ /* wait for a vertical blank, */ - if (inb(port) == 0xff) /* 0xff means no board present */ - return (1); - - while ((inb(port) & VERTICAL_BLANK) != 0) { - } - while ((inb(port) & VERTICAL_BLANK) == 0) { - } - - return (0); -} diff --git a/sys/dev/video/ctx/ctxreg.h b/sys/dev/video/ctx/ctxreg.h deleted file mode 100644 index 6bf01b3bd7..0000000000 --- a/sys/dev/video/ctx/ctxreg.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * - * Copyright (C) 1994, Paul S. LaFollette, Jr. This software may be used, - * modified, copied, distributed, and sold, in both source and binary form - * provided that the above copyright and these terms are retained. Under - * no circumstances is the author responsible for the proper functioning - * of this software, nor does the author assume any responsibility - * for damages incurred with its use - * - * $FreeBSD: src/sys/i386/isa/ctxreg.h,v 1.5 1999/08/28 00:44:39 peter Exp $ - * $DragonFly: src/sys/dev/video/ctx/ctxreg.h,v 1.3 2006/10/23 21:50:32 dillon Exp $ - */ - -/* - * Register and bit definitions for CORTEX-I frame grabber - */ - -#ifndef _DEV_VIDEO_CTX_CTXREG_H_ -#define _DEV_VIDEO_CTX_CTXREG_H_ - - /* Control Ports (all are write-only) */ - -#define ctx_cp0 0 /* offset to control port 0 */ -#define ctx_cp1 1 /* offset to control port 1 */ -#define ctx_lutaddr 2 /* offset to lut address port */ -#define ctx_lutdata 3 /* offset to lut data port */ - - /* Status port (read-only but same address as control port 0) */ - -#define ctx_status 0 /* offset to status port */ - - /* Bit assignments for control port 0 */ - -#define PAGE_SELECT0 1 /* These two bits choose which 1/4 of the */ -#define PAGE_SELECT1 2 /* video memory is accessible to us. */ -#define PAGE_ROTATE 4 /* 0 => horizontal access. 1 => vertical */ -#define ACQUIRE 8 /* set to start frame grab */ -#define SEE_STORED_VIDEO 16 /* set to allow stored frame to be seen */ -#define LOW_RESOLUTION 32 /* set to enable 256 x 256 mode */ - - /* Bit assignments for control port 1 */ - -#define INTERRUPT_ENABLE 1 /* Allow interrupts (we avoid this bit) */ -#define TRIGGER_ENABLE 2 /* Enable external trigger for frame grab */ -#define LUT_LOAD_ENABLE 4 /* Allow loading of lookup table */ -#define BLANK_DISPLAY 8 /* Turn off display */ -#define AB_SELECT 16 /* Along with HW switch, choose base memory */ -#define RAM_ENABLE 32 /* Connect video RAM to computer bus */ - - /* Bit assignments for status port */ - -#define INTERRUPT_STATUS 1 /* Ignored by us */ -#define ADC_OVERFLOW 2 /* Set if any pixes from camera "too bright"*/ -#define FIELD 4 /* 0 or 1 shows which interlace field are in*/ -#define VERTICAL_BLANK 8 /* 1 if in vertical blanking interval */ -#define TRIGGERED 16 /* 1 if HW trigger contacts closed */ -#define ACQUIRING_ACK 32 /* 1 if currently grabbing a frame */ - - -#endif /* ifndef _DEV_VIDEO_CTX_CTXREG_H_ */ diff --git a/sys/dev/video/gsc/gsc.c b/sys/dev/video/gsc/gsc.c deleted file mode 100644 index 786c925a06..0000000000 --- a/sys/dev/video/gsc/gsc.c +++ /dev/null @@ -1,823 +0,0 @@ -/* gsc.c - device driver for handy scanners - * - * Current version supports: - * - * - Genius GS-4500 - * - * Copyright (c) 1995 Gunther Schadow. 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 Gunther Schadow. - * 4. 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 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: src/sys/i386/isa/gsc.c,v 1.35.2.1 2000/08/08 19:49:53 peter Exp $ - * - */ - -#include "use_gsc.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include "gscreg.h" - -/*********************************************************************** - * - * CONSTANTS & DEFINES - * - ***********************************************************************/ - -#define PROBE_FAIL 0 -#define PROBE_SUCCESS IO_GSCSIZE -#define ATTACH_FAIL 0 -#define ATTACH_SUCCESS 1 -#define SUCCESS 0 -#define FAIL -1 -#define INVALID FAIL - -#define DMA1_READY 0x08 - -#ifdef GSCDEBUG -#define lprintf(args) \ - do { \ - if (scu->flags & FLAG_DEBUG) \ - kprintf args; \ - } while (0) -#else -#define lprintf(args) -#endif - -#define TIMEOUT (hz*15) /* timeout while reading a buffer - default value */ -#define LONG (hz/60) /* timesteps while reading a buffer */ - -/*********************************************************************** - * - * LAYOUT OF THE MINOR NUMBER - * - ***********************************************************************/ - -#define UNIT_MASK 0xc0 /* unit gsc0 .. gsc3 */ -#define UNIT(x) (x >> 6) -#define DBUG_MASK 0x20 -#define FRMT_MASK 0x18 /* output format */ -#define FRMT_RAW 0x00 /* output bits as read from scanner */ -#define FRMT_GRAY 0x10 /* output graymap (not implemented yet) */ -#define FRMT_PBM 0x08 /* output pbm format */ -#define FRMT_PGM 0x18 - -/*********************************************************************** - * - * THE GEMOMETRY TABLE - * - ***********************************************************************/ - -#define GEOMTAB_SIZE 7 - -static const struct gsc_geom { - int dpi; /* dots per inch */ - int dpl; /* dots per line */ - int g_res; /* get resolution value (status flag) */ - int s_res; /* set resolution value (control register) */ -} geomtab[GEOMTAB_SIZE] = { - { 100, 424, GSC_RES_100, GSC_CNT_424}, - { 200, 840, GSC_RES_200, GSC_CNT_840}, - { 300, 1264, GSC_RES_300, GSC_CNT_1264}, - { 400, 1648, GSC_RES_400, GSC_CNT_1648}, - { -1, 1696, -1, GSC_CNT_1696}, - { -2, 2644, -2, GSC_CNT_2544}, - { -3, 3648, -3, GSC_CNT_3648}, -}; - -#define NEW_GEOM { INVALID, INVALID, INVALID, INVALID } - -/*********************************************************************** - * - * THE TABLE OF UNITS - * - ***********************************************************************/ - -struct _sbuf { - size_t size; - size_t poi; - char *base; -}; - -struct gsc_unit { - int channel; /* DMA channel */ - int data; /* - video port */ - int stat; /* - status port */ - int ctrl; /* - control port */ - int clrp; /* - clear port */ - int flags; -#define ATTACHED 0x01 -#define OPEN 0x02 -#define READING 0x04 -#define EOF 0x08 -#define FLAG_DEBUG 0x10 -#define PBM_MODE 0x20 - int geometry; /* resolution as geomtab index */ - int blen; /* length of buffer in lines */ - int btime; /* timeout of buffer in seconds/hz */ - struct _sbuf sbuf; - char ctrl_byte; /* the byte actually written to ctrl port */ - int height; /* height, for pnm modes */ - size_t bcount; /* bytes to read, for pnm modes */ - struct _sbuf hbuf; /* buffer for pnm header data */ -}; - -static struct gsc_unit unittab[NGSC]; - -/* I could not find a reasonable buffer size limit other than by - * experiments. MAXPHYS is obviously too much, while DEV_BSIZE and - * PAGE_SIZE are really too small. There must be something wrong - * with isa_dmastart/isa_dmarangecheck HELP!!! - */ -#define MAX_BUFSIZE 0x3000 -#define DEFAULT_BLEN 59 - -/*********************************************************************** - * - * THE PER-DRIVER RECORD FOR ISA.C - * - ***********************************************************************/ - -static int gscprobe (struct isa_device *isdp); -static int gscattach(struct isa_device *isdp); - -struct isa_driver gscdriver = { gscprobe, gscattach, "gsc" }; - -static d_open_t gscopen; -static d_close_t gscclose; -static d_read_t gscread; -static d_ioctl_t gscioctl; - -static struct dev_ops gsc_ops = { - { "gsc", 0, 0 }, - .d_open = gscopen, - .d_close = gscclose, - .d_read = gscread, - .d_ioctl = gscioctl, -}; - - -/*********************************************************************** - * - * LOCALLY USED SUBROUTINES - * - ***********************************************************************/ - -/*********************************************************************** - * - * lookup_geometry -- lookup a record in the geometry table by pattern - * - * The caller supplies a geometry record pattern, where INVALID - * matches anything. Returns the index in the table or INVALID if - * lookup fails. - */ - -static int -lookup_geometry(struct gsc_geom geom, const struct gsc_unit *scu) -{ - struct gsc_geom tab; - int i; - - for(i=0; istat)); - - if ( ( geom.g_res = inb(scu->stat) ) == FAIL ) - return INVALID; - - geom.g_res &= GSC_RES_MASK; - - return lookup_geometry(geom, scu); -} - -/*********************************************************************** - * - * buffer_allocate -- allocate/reallocate a buffer - * Now just checks that the preallocated buffer is large enough. - */ - -static int -buffer_allocate(struct gsc_unit *scu) -{ - size_t size; - - size = scu->blen * geomtab[scu->geometry].dpl / 8; - - lprintf(("gsc.buffer_allocate: need 0x%x bytes\n", size)); - - if ( size > MAX_BUFSIZE ) - { - lprintf(("gsc.buffer_allocate: 0x%x bytes are too much\n", size)); - return ENOMEM; - } - - scu->sbuf.size = size; - scu->sbuf.poi = size; - - lprintf(("gsc.buffer_allocate: ok\n")); - - return SUCCESS; -} - -/*********************************************************************** - * - * buffer_read -- scan a buffer - */ - -static int -buffer_read(struct gsc_unit *scu) -{ - int stb; - int res = SUCCESS; - int chan_bit; - char *p; - int delay; - - lprintf(("gsc.buffer_read: begin\n")); - - if (scu->ctrl_byte == INVALID) - { - lprintf(("gsc.buffer_read: invalid ctrl_byte\n")); - return EIO; - } - - crit_enter(); - - outb( scu->ctrl, scu->ctrl_byte | GSC_POWER_ON ); - outb( scu->clrp, 0 ); - stb = inb( scu->stat ); - - isa_dmastart(BUF_CMD_READ, scu->sbuf.base, scu->sbuf.size, scu->channel); - - chan_bit = 0x01 << scu->channel; - - for(delay=0; !(inb(DMA1_READY) & 0x01 << scu->channel); delay += LONG) - { - if(delay >= scu->btime) - { - crit_exit(); - lprintf(("gsc.buffer_read: timeout\n")); - res = EWOULDBLOCK; - break; - } - res = tsleep((caddr_t)scu, PCATCH, "gscread", LONG); - if ( ( res == 0 ) || ( res == EWOULDBLOCK ) ) - res = SUCCESS; - else - break; - } - crit_exit(); - isa_dmadone(BUF_CMD_READ, scu->sbuf.base, scu->sbuf.size, scu->channel); - outb( scu->clrp, 0 ); - - if(res != SUCCESS) - { - lprintf(("gsc.buffer_read: aborted with %d\n", res)); - return res; - } - - lprintf(("gsc.buffer_read: invert buffer\n")); - for(p = scu->sbuf.base + scu->sbuf.size - 1; p >= scu->sbuf.base; p--) - *p = ~*p; - - scu->sbuf.poi = 0; - lprintf(("gsc.buffer_read: ok\n")); - return SUCCESS; -} - -/*********************************************************************** - * - * the main functions - * - ***********************************************************************/ - -/*********************************************************************** - * - * gscprobe - * - * read status port and check for proper configuration: - * - if address group matches (status byte has reasonable value) - * - if DMA channel matches (status byte has correct value) - */ - -static int -gscprobe (struct isa_device *isdp) -{ - int unit = isdp->id_unit; - struct gsc_unit *scu = unittab + unit; - int stb; - struct gsc_geom geom = NEW_GEOM; - - scu->flags = FLAG_DEBUG; - - lprintf(("gsc%d.probe " - "on iobase 0x%03x, irq %d, drq %d, addr %p, size %d\n", - unit, - isdp->id_iobase, - isdp->id_irq, - isdp->id_drq, - isdp->id_maddr, - isdp->id_msize)); - - if ( isdp->id_iobase < 0 ) - { - lprintf(("gsc%d.probe: no iobase given\n", unit)); - return PROBE_FAIL; - } - - stb = inb( GSC_STAT(isdp->id_iobase) ); - if (stb == FAIL) - { - lprintf(("gsc%d.probe: get status byte failed\n", unit)); - return PROBE_FAIL; - } - - scu->data = GSC_DATA(isdp->id_iobase); - scu->stat = GSC_STAT(isdp->id_iobase); - scu->ctrl = GSC_CTRL(isdp->id_iobase); - scu->clrp = GSC_CLRP(isdp->id_iobase); - - outb(scu->clrp,stb); - stb = inb(scu->stat); - - switch(stb & GSC_CNF_MASK) { - case GSC_CNF_DMA1: - lprintf(("gsc%d.probe: DMA 1\n", unit)); - scu->channel = 1; - break; - - case GSC_CNF_DMA3: - lprintf(("gsc%d.probe: DMA 3\n", unit)); - scu->channel = 3; - break; - - case GSC_CNF_IRQ3: - lprintf(("gsc%d.probe: IRQ 3\n", unit)); - goto probe_noirq; - case GSC_CNF_IRQ5: - lprintf(("gsc%d.probe: IRQ 5\n", unit)); - probe_noirq: - lprintf(("gsc%d.probe: sorry, can't use IRQ yet\n", unit)); - return PROBE_FAIL; - default: - lprintf(("gsc%d.probe: invalid status byte 0x%02x\n", unit, (u_char) stb)); - return PROBE_FAIL; - } - - if (isdp->id_drq < 0) - isdp->id_drq = scu->channel; - if (scu->channel != isdp->id_drq) - { - lprintf(("gsc%d.probe: drq mismatch: config: %d; hardware: %d\n", - unit, isdp->id_drq, scu->channel)); - return PROBE_FAIL; - } - - geom.g_res = stb & GSC_RES_MASK; - scu->geometry = lookup_geometry(geom, scu); - if (scu->geometry == INVALID) - { - lprintf(("gsc%d.probe: geometry lookup failed\n", unit)); - return PROBE_FAIL; - } - else - { - scu->ctrl_byte = geomtab[scu->geometry].s_res; - outb(scu->ctrl, scu->ctrl_byte | GSC_POWER_ON); - - lprintf(("gsc%d.probe: status 0x%02x, %ddpi\n", - unit, stb, geomtab[scu->geometry].dpi)); - - outb(scu->ctrl, scu->ctrl_byte & ~GSC_POWER_ON); - } - - lprintf(("gsc%d.probe: ok\n", unit)); - - scu->flags &= ~FLAG_DEBUG; - - return PROBE_SUCCESS; -} - -/*********************************************************************** - * - * gscattach - * - * finish initialization of unit structure - * get geometry value - */ - -static int -gscattach(struct isa_device *isdp) -{ - int unit = isdp->id_unit; - struct gsc_unit *scu = unittab + unit; - - scu->flags |= FLAG_DEBUG; - - lprintf(("gsc%d.attach: " - "iobase 0x%03x, irq %d, drq %d, addr %p, size %d\n", - unit, - isdp->id_iobase, - isdp->id_irq, - isdp->id_drq, - isdp->id_maddr, - isdp->id_msize)); - - kprintf("gsc%d: GeniScan GS-4500 at %ddpi\n", - unit, geomtab[scu->geometry].dpi); - - /* - * Initialize buffer structure. - * XXX this must be done early to give a good chance of getting a - * contiguous buffer. This wastes memory. - */ - scu->sbuf.base = contigmalloc((unsigned long)MAX_BUFSIZE, M_DEVBUF, M_NOWAIT, - 0ul, 0xfffffful, 1ul, 0x10000ul); - if ( scu->sbuf.base == NULL ) - { - lprintf(("gsc%d.attach: buffer allocation failed\n", unit)); - return ATTACH_FAIL; /* XXX attach must not fail */ - } - scu->sbuf.size = INVALID; - scu->sbuf.poi = INVALID; - - scu->blen = DEFAULT_BLEN; - scu->btime = TIMEOUT; - - scu->flags |= ATTACHED; - lprintf(("gsc%d.attach: ok\n", unit)); - scu->flags &= ~FLAG_DEBUG; - -#define GSC_UID 0 -#define GSC_GID 13 - make_dev(&gsc_ops, unit<<6, GSC_UID, GSC_GID, 0666, "gsc%d", unit); - make_dev(&gsc_ops, ((unit<<6) + FRMT_PBM), - GSC_UID, GSC_GID, 0666, "gsc%dp", unit); - make_dev(&gsc_ops, ((unit<<6) + DBUG_MASK), - GSC_UID, GSC_GID, 0666, "gsc%dd", unit); - make_dev(&gsc_ops, ((unit<<6) + DBUG_MASK+FRMT_PBM), - GSC_UID, GSC_GID, 0666, "gsc%dpd", unit); - - return ATTACH_SUCCESS; -} - -/*********************************************************************** - * - * gscopen - * - * set open flag - * set modes according to minor number - * don't switch scanner on, wait until first read ioctls go before - */ - -static int -gscopen (struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct gsc_unit *scu; - int unit; - - unit = UNIT(minor(dev)) & UNIT_MASK; - if ( unit >= NGSC ) - { -#ifdef GSCDEBUG - /* XXX lprintf isn't valid here since there is no scu. */ - kprintf("gsc%d.open: unconfigured unit number (max %d)\n", unit, NGSC); -#endif - return ENXIO; - } - scu = unittab + unit; - if ( !( scu->flags & ATTACHED ) ) - { - lprintf(("gsc%d.open: unit was not attached successfully 0x%04x\n", - unit, scu->flags)); - return ENXIO; - } - - if ( minor(dev) & DBUG_MASK ) - scu->flags |= FLAG_DEBUG; - else - scu->flags &= ~FLAG_DEBUG; - - switch(minor(dev) & FRMT_MASK) { - case FRMT_PBM: - scu->flags |= PBM_MODE; - lprintf(("gsc%d.open: pbm mode\n", unit)); - break; - case FRMT_RAW: - lprintf(("gsc%d.open: raw mode\n", unit)); - scu->flags &= ~PBM_MODE; - break; - default: - lprintf(("gsc%d.open: gray maps are not yet supported", unit)); - return ENXIO; - } - - lprintf(("gsc%d.open: minor %d\n", - unit, minor(dev))); - - if ( scu->flags & OPEN ) - { - lprintf(("gsc%d.open: already open", unit)); - return EBUSY; - } - - if (isa_dma_acquire(scu->channel)) - return(EBUSY); - - scu->flags |= OPEN; - - return SUCCESS; -} - -/*********************************************************************** - * - * gscclose - * - * turn off scanner - * release the buffer - */ - -static int -gscclose (struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - int unit = UNIT(minor(dev)); - struct gsc_unit *scu = unittab + unit; - - lprintf(("gsc%d.close: minor %d\n", - unit, minor(dev))); - - if ( unit >= NGSC || !( scu->flags & ATTACHED ) ) - { - lprintf(("gsc%d.read: unit was not attached successfully 0x%04x\n", - unit, scu->flags)); - return ENXIO; - } - - outb(scu->ctrl, scu->ctrl_byte & ~GSC_POWER_ON); - - scu->sbuf.size = INVALID; - scu->sbuf.poi = INVALID; - - isa_dma_release(scu->channel); - - scu->flags &= ~(FLAG_DEBUG | OPEN | READING); - - return SUCCESS; -} - -/*********************************************************************** - * - * gscread - */ - -static int -gscread (struct dev_read_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct uio *uio = ap->a_uio; - int unit = UNIT(minor(dev)); - struct gsc_unit *scu = unittab + unit; - size_t nbytes; - int res; - - lprintf(("gsc%d.read: minor %d\n", unit, minor(dev))); - - if ( unit >= NGSC || !( scu->flags & ATTACHED ) ) - { - lprintf(("gsc%d.read: unit was not attached successfully 0x%04x\n", - unit, scu->flags)); - return ENXIO; - } - - if ( !(scu->flags & READING) ) - { - res = buffer_allocate(scu); - if ( res == SUCCESS ) - scu->flags |= READING; - else - return res; - - scu->ctrl_byte = geomtab[scu->geometry].s_res; - - /* initialize for pbm mode */ - if ( scu->flags & PBM_MODE ) - { - char *p; - int width = geomtab[scu->geometry].dpl; - - ksprintf(scu->sbuf.base,"P4 %d %d\n", width, scu->height); - scu->bcount = scu->height * width / 8; - - lprintf(("gsc%d.read: initializing pbm mode: `%s', bcount: 0x%x\n", - unit, scu->sbuf.base, scu->bcount)); - - /* move header to end of sbuf */ - for(p=scu->sbuf.base; *p; p++); - while(--p >= scu->sbuf.base) - { - *(char *)(scu->sbuf.base + --scu->sbuf.poi) = *p; - scu->bcount++; - } - } - } - - lprintf(("gsc%d.read(before buffer_read): " - "size 0x%x, pointer 0x%x, bcount 0x%x, ok\n", - unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount)); - - if ( scu->sbuf.poi == scu->sbuf.size ) - if ( (res = buffer_read(scu)) != SUCCESS ) - return res; - - lprintf(("gsc%d.read(after buffer_read): " - "size 0x%x, pointer 0x%x, bcount 0x%x, ok\n", - unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount)); - - nbytes = MIN( uio->uio_resid, scu->sbuf.size - scu->sbuf.poi ); - - if ( (scu->flags & PBM_MODE) ) - nbytes = MIN( nbytes, scu->bcount ); - - lprintf(("gsc%d.read: transferring 0x%x bytes", unit, nbytes)); - - res = uiomove(scu->sbuf.base + scu->sbuf.poi, nbytes, uio); - if ( res != SUCCESS ) - { - lprintf(("gsc%d.read: uiomove failed %d", unit, res)); - return res; - } - - scu->sbuf.poi += nbytes; - if ( scu->flags & PBM_MODE ) scu->bcount -= nbytes; - - lprintf(("gsc%d.read: size 0x%x, pointer 0x%x, bcount 0x%x, ok\n", - unit, scu->sbuf.size, scu->sbuf.poi, scu->bcount)); - - return SUCCESS; -} - -/*********************************************************************** - * - * gscioctl - * - */ - -static int -gscioctl (struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - caddr_t data = ap->a_data; - int unit = UNIT(minor(dev)); - struct gsc_unit *scu = unittab + unit; - - lprintf(("gsc%d.ioctl: minor %d\n", - unit, minor(dev))); - - if ( unit >= NGSC || !( scu->flags & ATTACHED ) ) - { - lprintf(("gsc%d.ioctl: unit was not attached successfully 0x%04x\n", - unit, scu->flags)); - return ENXIO; - } - - switch(ap->a_cmd) { - case GSC_SRESSW: - lprintf(("gsc%d.ioctl:GSC_SRESSW\n", unit)); - if ( scu->flags & READING ) - { - lprintf(("gsc%d:ioctl on already reading unit\n", unit)); - return EBUSY; - } - scu->geometry = get_geometry(scu); - return SUCCESS; - case GSC_GRES: - *(int *)data=geomtab[scu->geometry].dpi; - lprintf(("gsc%d.ioctl:GSC_GRES %ddpi\n", unit, *(int *)data)); - return SUCCESS; - case GSC_GWIDTH: - *(int *)data=geomtab[scu->geometry].dpl; - lprintf(("gsc%d.ioctl:GSC_GWIDTH %d\n", unit, *(int *)data)); - return SUCCESS; - case GSC_SRES: - case GSC_SWIDTH: - lprintf(("gsc%d.ioctl:GSC_SRES or GSC_SWIDTH %d\n", - unit, *(int *)data)); - { int g; - struct gsc_geom geom = NEW_GEOM; - if ( ap->a_cmd == GSC_SRES ) - geom.dpi = *(int *)data; - else - geom.dpl = *(int *)data; - if ( ( g = lookup_geometry(geom, scu) ) == INVALID ) - return EINVAL; - scu->geometry = g; - return SUCCESS; - } - case GSC_GHEIGHT: - *(int *)data=scu->height; - lprintf(("gsc%d.ioctl:GSC_GHEIGHT %d\n", unit, *(int *)data)); - return SUCCESS; - case GSC_SHEIGHT: - lprintf(("gsc%d.ioctl:GSC_SHEIGHT %d\n", unit, *(int *)data)); - if ( scu->flags & READING ) - { - lprintf(("gsc%d:ioctl on already reading unit\n", unit)); - return EBUSY; - } - scu->height=*(int *)data; - return SUCCESS; - case GSC_GBLEN: - *(int *)data=scu->blen; - lprintf(("gsc%d.ioctl:GSC_GBLEN %d\n", unit, *(int *)data)); - return SUCCESS; - case GSC_SBLEN: - lprintf(("gsc%d.ioctl:GSC_SBLEN %d\n", unit, *(int *)data)); - if (*(int *)data * geomtab[scu->geometry].dpl / 8 > MAX_BUFSIZE) - { - lprintf(("gsc%d:ioctl buffer size too high\n", unit)); - return ENOMEM; - } - scu->blen=*(int *)data; - return SUCCESS; - case GSC_GBTIME: - *(int *)data = scu->btime / hz; - lprintf(("gsc%d.ioctl:GSC_GBTIME %d\n", unit, *(int *)data)); - return SUCCESS; - case GSC_SBTIME: - scu->btime = *(int *)data * hz; - lprintf(("gsc%d.ioctl:GSC_SBTIME %d\n", unit, *(int *)data)); - return SUCCESS; - default: return ENOTTY; - } -} diff --git a/sys/dev/video/gsc/gscreg.h b/sys/dev/video/gsc/gscreg.h deleted file mode 100644 index d71a7d18f7..0000000000 --- a/sys/dev/video/gsc/gscreg.h +++ /dev/null @@ -1,90 +0,0 @@ -/* gscreg.h - port and bit definitions for the Genius GS-4500 interface - * - * - * Copyright (c) 1995 Gunther Schadow. 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 Gunther Schadow. - * 4. 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 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: src/sys/i386/isa/gscreg.h,v 1.2.16.1 2000/08/03 01:01:20 peter Exp $ - * $DragonFly: src/sys/dev/video/gsc/gscreg.h,v 1.2 2003/06/17 04:28:37 dillon Exp $ - */ - -/* - * status register (r) - */ - -/* the DMA/IRQ jumper configuration */ - -#define GSC_CNF_MASK 0x5a - -#define GSC_CNF_DMA1 (~0x02 & GSC_CNF_MASK) -#define GSC_CNF_DMA3 (~0x08 & GSC_CNF_MASK) -#define GSC_CNF_IRQ3 (~0x10 & GSC_CNF_MASK) -#define GSC_CNF_IRQ5 (~0x40 & GSC_CNF_MASK) - -/* the resolution switch setting */ - -#define GSC_RES_MASK 0x24 - -#define GSC_RES_400 0x00 -#define GSC_RES_300 0x04 -#define GSC_RES_200 0x20 -#define GSC_RES_100 0x24 - -/* other flags */ - -#define GSC_RDY_FLAG 0x80 - -#define GSC_IRQ_FLAG 0x01 - -/* - * control register (w) - */ - -/* power on */ - -#define GSC_POWER_ON 0x01 - -/* pixel per line count */ - -#define GSC_CNT_MASK 0xf0 - -#define GSC_CNT_3648 0x30 -#define GSC_CNT_2544 0x90 -#define GSC_CNT_1696 0xb0 -#define GSC_CNT_1648 0xe0 -#define GSC_CNT_1264 0x80 -#define GSC_CNT_840 0xa0 -#define GSC_CNT_424 0xf0 - -/* - * port addresses - */ - -#define GSC_DATA(iob) (iob + (iob == 0x270 ? 0x02 : 0x01)) -#define GSC_STAT(iob) (iob + (iob == 0x270 ? 0x03 : 0x02)) -#define GSC_CTRL(iob) (iob + (iob == 0x270 ? 0x0a : 0x03)) -#define GSC_CLRP(iob) (iob + (iob == 0x270 ? 0x0b : 0x04)) diff --git a/sys/kern/Make.tags.inc b/sys/kern/Make.tags.inc index 8e72dee2ff..441a35abc4 100644 --- a/sys/kern/Make.tags.inc +++ b/sys/kern/Make.tags.inc @@ -1,5 +1,4 @@ # $FreeBSD: src/sys/kern/Make.tags.inc,v 1.6.2.2 2003/02/10 12:21:08 des Exp $ -# $DragonFly: src/sys/kern/Make.tags.inc,v 1.8 2006/05/14 18:07:29 swildner Exp $ # @(#)Make.tags.inc 8.1 (Berkeley) 6/11/93 SYS?= /sys @@ -13,7 +12,6 @@ SYS?= /sys COMM= ${SYS}/conf/*.[ch] \ ${SYS}/dev/disk/advansys/*.[ch] \ - ${SYS}/dev/disk/aha/*.[ch] \ ${SYS}/dev/disk/aic7xxx/*.[ch] \ ${SYS}/dev/disk/buslogic/*.[ch] \ ${SYS}/dev/disk/ccd/*.[ch] \ @@ -66,7 +64,6 @@ COMMDIR1= ${SYS}/conf \ ${SYS}/sys COMMDIR2= ${SYS}/dev/disk/advansys \ - ${SYS}/dev/disk/aha \ ${SYS}/dev/disk/aic7xxx \ ${SYS}/dev/disk/buslogic \ ${SYS}/dev/disk/ccd \ diff --git a/sys/net/if.h b/sys/net/if.h index a422f2adb5..6f500f71b7 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -32,7 +32,6 @@ * * @(#)if.h 8.1 (Berkeley) 6/10/93 * $FreeBSD: src/sys/net/if.h,v 1.58.2.9 2002/08/30 14:23:38 sobomax Exp $ - * $DragonFly: src/sys/net/if.h,v 1.21 2008/08/30 16:07:59 hasso Exp $ */ #ifndef _NET_IF_H_ @@ -368,7 +367,7 @@ struct if_laddrreq { #ifndef _KERNEL struct if_nameindex { u_int if_index; /* 1, 2, ... */ - char *if_name; /* null terminated name: "le0", ... */ + char *if_name; /* null terminated name: "lnc0", ... */ }; __BEGIN_DECLS diff --git a/sys/platform/pc32/conf/files b/sys/platform/pc32/conf/files index 44e1c92749..d631fdcc56 100644 --- a/sys/platform/pc32/conf/files +++ b/sys/platform/pc32/conf/files @@ -77,7 +77,6 @@ crypto/des/des_setkey.c optional crypto dev/disk/advansys/adv_isa.c optional adv isa dev/disk/aic/aic_isa.c optional aic isa dev/netif/ar/if_ar_isa.c optional ar isa -dev/serial/dgb/dgm.c optional dgm ${OSACPI_MD_DIR}/OsdEnvironment.c optional acpi ${OSACPI_MD_DIR}/acpi_machdep.c optional acpi @@ -156,7 +155,6 @@ vfs/smbfs/smbfs_smb.c optional smbfs vfs/smbfs/smbfs_subr.c optional smbfs vfs/smbfs/smbfs_vfsops.c optional smbfs vfs/smbfs/smbfs_vnops.c optional smbfs -platform/pc32/gnu/isa/dgb.c optional dgb platform/pc32/apm/apm.c optional apm cpu/i386/misc/atomic.c standard \ compile-with "${CC} -c ${CFLAGS} ${WERROR} ${DEFINED_PROF:S/^$/-fomit-frame-pointer/} ${.IMPSRC}" @@ -230,28 +228,17 @@ platform/pc32/i386/cpufreq_machdep.c standard platform/pc32/acpica5/acpi_sdt.c standard platform/pc32/acpica5/acpi_fadt.c standard platform/pc32/acpica5/acpi_madt.c standard -platform/pc32/isa/asc.c optional asc platform/pc32/isa/clock.c standard nowerror -dev/video/ctx/ctx.c optional ctx dev/serial/cy/cy.c optional cy dev/serial/cy/cy_pci.c optional cy pci dev/netif/elink_layer/elink.c optional ep -dev/netif/elink_layer/elink.c optional ie dev/disk/fd/fd.c optional fd dev/disk/fd/fd_pccard.c optional fd pccard -dev/misc/gpib/gpib.c optional gp -dev/video/gsc/gsc.c optional gsc -dev/netif/el/if_el.c optional el -dev/netif/le/if_le.c optional le -dev/netif/rdp/if_rdp.c optional nowerror rdp -dev/netif/wl/if_wl.c optional wl platform/pc32/isa/isa_intr.c standard bus/isa/i386/isa.c optional isa bus/isa/i386/isa_compat.c optional nowerror isa compat_oldisa bus/isa/i386/isa_dma.c optional isa dev/serial/stli/istallion.c optional nowerror stli -dev/misc/labpc/labpc.c optional labpc -dev/misc/mse/mse.c optional mse platform/pc32/isa/npx.c mandatory npx bus/pci/i386/legacy.c optional pci bus/pci/i386/pci_bus.c optional pci @@ -261,13 +248,9 @@ bus/pci/i386/mptable_pci.c optional pci platform/pc32/isa/pmtimer.c optional pmtimer acpi # XXX drhodus platform/pc32/isa/prof_machdep.c optional profiling-routine -dev/serial/rc/rc.c optional nowerror rc dev/misc/spic/spic.c optional nowerror spic -dev/misc/spigot/spigot.c optional spigot dev/serial/stl/stallion.c optional stl -dev/misc/tw/tw.c optional tw dev/video/i386/vesa/vesa.c optional vga vesa -dev/disk/wt/wt.c optional nowerror wt emulation/linux/i386/imgact_linux.c optional compat_linux emulation/linux/i386/linux_dummy.c optional compat_linux emulation/linux/i386/linux_locore.s optional compat_linux \ diff --git a/sys/platform/pc32/conf/options b/sys/platform/pc32/conf/options index c0cdf2a6ec..4697d6855e 100644 --- a/sys/platform/pc32/conf/options +++ b/sys/platform/pc32/conf/options @@ -13,8 +13,6 @@ AUTO_EOI_1 opt_auto_eoi.h AUTO_EOI_2 opt_auto_eoi.h CONSPEED opt_comconsole.h I586_PMC_GUPROF opt_i586_guprof.h -WLCACHE opt_wavelan.h -WLDEBUG opt_wavelan.h BROKEN_KEYBOARD_RESET opt_reset.h APIC_IO opt_apic.h COMPAT_OLDISA opt_compat_oldisa.h @@ -118,9 +116,6 @@ INTRO_USERCONFIG opt_userconfig.h FE_8BIT_SUPPORT opt_fe.h -# Video spigot -SPIGOT_UNSECURE opt_spigot.h - # ------------------------------- # isdn4bsd: passive ISA cards # ------------------------------- @@ -161,10 +156,6 @@ I4B_SMP_WORKAROUND opt_i4b.h IPR_VJ opt_i4b.h IPR_LOG opt_i4b.h -# Total number of ports controlled by the dgb(4) driver. -# Defaults to NDGB*16. -NDGBPORTS opt_dgb.h - # ------------------------------- # EOF # ------------------------------- diff --git a/sys/platform/pc32/gnu/isa/dgb.c b/sys/platform/pc32/gnu/isa/dgb.c deleted file mode 100644 index 9298e5f638..0000000000 --- a/sys/platform/pc32/gnu/isa/dgb.c +++ /dev/null @@ -1,2273 +0,0 @@ -/*- - * (MPSAFE) - * - * dgb.c $FreeBSD: src/sys/gnu/i386/isa/dgb.c,v 1.56.2.1 2001/02/26 04:23:09 jlemon Exp $ - * dgb.c $DragonFly: src/sys/platform/pc32/gnu/isa/dgb.c,v 1.20 2008/08/02 01:14:43 dillon Exp $ - * - * Digiboard driver. - * - * Stage 1. "Better than nothing". - * Stage 2. "Gee, it works!". - * - * Based on sio driver by Bruce Evans and on Linux driver by Troy - * De Jongh or - * which is under GNU General Public License version 2 so this driver - * is forced to be under GPL 2 too. - * - * Written by Serge Babkin, - * Joint Stock Commercial Bank "Chelindbank" - * (Chelyabinsk, Russia) - * babkin@hq.icb.chel.su - * - * Assorted hacks to make it more functional and working under 3.0-current. - * Fixed broken routines to prevent processes hanging on closed (thanks - * to Bruce for his patience and assistance). Thanks also to Maxim Bolotin - * for his patches which did most of the work to get this - * running under 2.2/3.0-current. - * Implemented ioctls: TIOCMSDTRWAIT, TIOCMGDTRWAIT, TIOCTIMESTAMP & - * TIOCDCDTIMESTAMP. - * Sysctl debug flag is now a bitflag, to filter noise during debugging. - * David L. Nugent - */ - -#include "opt_compat.h" -#include "opt_dgb.h" -#include "opt_deprecated.h" -#ifndef I_WANT_DEPRECATED_STUFF -#error "Add options I_WANT_DEPRECATED_STUFF to your kernel config and send a mail to kernel@" -#endif - -#include "use_dgb.h" - -/* Helg: i.e.25 times per sec board will be polled */ -#define POLLSPERSEC 25 -/* How many charactes can we write to input tty rawq */ -#define DGB_IBUFSIZE (TTYHOG-100) - -/* the overall number of ports controlled by this driver */ - -#ifndef NDGBPORTS -# define NDGBPORTS (NDGB*16) -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#include - -#include "dgbios.h" -#include "dgfep.h" - -#define DGB_DEBUG /* Enable debugging info via sysctl */ -#include "dgreg.h" - -#define CALLOUT_MASK 0x80 -#define CONTROL_MASK 0x60 -#define CONTROL_INIT_STATE 0x20 -#define CONTROL_LOCK_STATE 0x40 -#define UNIT_MASK 0x30000 -#define PORT_MASK 0x1F -#define DEV_TO_UNIT(dev) (MINOR_TO_UNIT(minor(dev))) -#define MINOR_MAGIC_MASK (CALLOUT_MASK | CONTROL_MASK) -#define MINOR_TO_UNIT(mynor) (((mynor) & UNIT_MASK)>>16) -#define MINOR_TO_PORT(mynor) ((mynor) & PORT_MASK) - -/* types. XXX - should be elsewhere */ -typedef u_char bool_t; /* boolean */ - -/* digiboard port structure */ -struct dgb_p { - bool_t status; - - u_char unit; /* board unit number */ - u_char pnum; /* port number */ - u_char omodem; /* FEP output modem status */ - u_char imodem; /* FEP input modem status */ - u_char modemfake; /* Modem values to be forced */ - u_char modem; /* Force values */ - u_char hflow; - u_char dsr; - u_char dcd; - u_char stopc; - u_char startc; - u_char stopca; - u_char startca; - u_char fepstopc; - u_char fepstartc; - u_char fepstopca; - u_char fepstartca; - u_char txwin; - u_char rxwin; - ushort fepiflag; - ushort fepcflag; - ushort fepoflag; - ushort txbufhead; - ushort txbufsize; - ushort rxbufhead; - ushort rxbufsize; - int close_delay; - int count; - int blocked_open; - int event; - int asyncflags; - u_long statusflags; - volatile u_char *txptr; - volatile u_char *rxptr; - volatile struct board_chan *brdchan; - struct tty *tty; - - bool_t active_out; /* nonzero if the callout device is open */ - u_int wopeners; /* # processes waiting for DCD in open() */ - - /* Initial state. */ - struct termios it_in; /* should be in struct tty */ - struct termios it_out; - - /* Lock state. */ - struct termios lt_in; /* should be in struct tty */ - struct termios lt_out; - - bool_t do_timestamp; - bool_t do_dcd_timestamp; - struct timeval timestamp; - struct timeval dcd_timestamp; - - /* flags of state, are used in sleep() too */ - u_char closing; /* port is being closed now */ - u_char draining; /* port is being drained now */ - u_char used; /* port is being used now */ - u_char mustdrain; /* data must be waited to drain in dgbparam() */ -}; - -/* Digiboard per-board structure */ -struct dgb_softc { - /* struct board_info */ - u_char status; /* status: DISABLED/ENABLED */ - u_char unit; /* unit number */ - u_char type; /* type of card: PCXE, PCXI, PCXEVE */ - u_char altpin; /* do we need alternate pin setting ? */ - int numports; /* number of ports on card */ - int port; /* I/O port */ - u_char *vmem; /* virtual memory address */ - long pmem; /* physical memory address */ - int mem_seg; /* internal memory segment */ - struct dgb_p *ports; /* pointer to array of port descriptors */ - struct tty *ttys; /* pointer to array of TTY structures */ - volatile struct global_data *mailbox; - struct callout dgb_pause; - struct callout dgbpoll; - struct callout wakeflush; - }; - - -static struct dgb_softc dgb_softc[NDGB]; -static struct dgb_p dgb_ports[NDGBPORTS]; -static struct tty dgb_tty[NDGBPORTS]; - -/* - * The public functions in the com module ought to be declared in a com-driver - * system header. - */ - -/* Interrupt handling entry points. */ -static void dgbpoll (void *unit_c); - -/* Device switch entry points. */ -#define dgbreset noreset -#define dgbmmap nommap -#define dgbstrategy nostrategy - -static int dgbattach (struct isa_device *dev); -static int dgbprobe (struct isa_device *dev); - -static void fepcmd(struct dgb_p *port, unsigned cmd, unsigned op1, unsigned op2, - unsigned ncmds, unsigned bytecmd); - -static void dgbstart (struct tty *tp); -static void dgbstop (struct tty *tp, int rw); -static int dgbparam (struct tty *tp, struct termios *t); -static void dgbhardclose (struct dgb_p *port); -static void dgb_drain_or_flush (struct dgb_p *port); -static int dgbdrain (struct dgb_p *port); -static void dgb_pause (void *chan); -static void wakeflush (void *p); -static void disc_optim (struct tty *tp, struct termios *t); - - -struct isa_driver dgbdriver = { - dgbprobe, dgbattach, "dgb",0 -}; - -static d_open_t dgbopen; -static d_close_t dgbclose; -static d_ioctl_t dgbioctl; - -#define CDEV_MAJOR 58 -static struct cdevsw dgb_cdevsw = { - /* name */ "dgb", - /* maj */ CDEV_MAJOR, - /* flags */ D_TTY, - /* port */ NULL, - /* clone */ NULL, - - /* open */ dgbopen, - /* close */ dgbclose, - /* read */ ttyread, - /* write */ ttywrite, - /* ioctl */ dgbioctl, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* dump */ nodump, - /* psize */ nopsize, - /* kqfilter */ ttykqfilter -}; - -static speed_t dgbdefaultrate = TTYDEF_SPEED; - -static struct speedtab dgbspeedtab[] = { - { 0, FEP_B0 }, /* old (sysV-like) Bx codes */ - { 50, FEP_B50 }, - { 75, FEP_B75 }, - { 110, FEP_B110 }, - { 134, FEP_B134 }, - { 150, FEP_B150 }, - { 200, FEP_B200 }, - { 300, FEP_B300 }, - { 600, FEP_B600 }, - { 1200, FEP_B1200 }, - { 1800, FEP_B1800 }, - { 2400, FEP_B2400 }, - { 4800, FEP_B4800 }, - { 9600, FEP_B9600 }, - { 19200, FEP_B19200 }, - { 38400, FEP_B38400 }, - { 57600, (FEP_FASTBAUD|FEP_B50) }, /* B50 & fast baud table */ - { 115200, (FEP_FASTBAUD|FEP_B110) }, /* B100 & fast baud table */ - { -1, -1 } -}; - -static struct dbgflagtbl -{ - tcflag_t in_mask; - tcflag_t in_val; - tcflag_t out_val; -} dgb_cflags[] = -{ - { PARODD, PARODD, FEP_PARODD }, - { PARENB, PARENB, FEP_PARENB }, - { CSTOPB, CSTOPB, FEP_CSTOPB }, - { CSIZE, CS5, FEP_CS6 }, - { CSIZE, CS6, FEP_CS6 }, - { CSIZE, CS7, FEP_CS7 }, - { CSIZE, CS8, FEP_CS8 }, - { CLOCAL, CLOCAL, FEP_CLOCAL }, - { (tcflag_t)-1 } -}, dgb_iflags[] = -{ - { IGNBRK, IGNBRK, FEP_IGNBRK }, - { BRKINT, BRKINT, FEP_BRKINT }, - { IGNPAR, IGNPAR, FEP_IGNPAR }, - { PARMRK, PARMRK, FEP_PARMRK }, - { INPCK, INPCK, FEP_INPCK }, - { ISTRIP, ISTRIP, FEP_ISTRIP }, - { IXON, IXON, FEP_IXON }, - { IXOFF, IXOFF, FEP_IXOFF }, - { IXANY, IXANY, FEP_IXANY }, - { (tcflag_t)-1 } -}, dgb_flow[] = -{ - { CRTSCTS, CRTSCTS, CTS|RTS }, - { CRTSCTS, CCTS_OFLOW, CTS }, - { CRTSCTS, CRTS_IFLOW, RTS }, - { (tcflag_t)-1 } -}; - -/* xlat bsd termios flags to dgb sys-v style */ -static tcflag_t -dgbflags(struct dbgflagtbl *tbl, tcflag_t input) -{ - tcflag_t output = 0; - int i; - - for (i=0; tbl[i].in_mask != (tcflag_t)-1; i++) - { - if ((input & tbl[i].in_mask) == tbl[i].in_val) - output |= tbl[i].out_val; - } - return output; -} - -#ifdef DGB_DEBUG -static int dgbdebug=0; -SYSCTL_INT(_debug, OID_AUTO, dgb_debug, CTLFLAG_RW, &dgbdebug, 0, ""); -#endif - -static __inline int setwin (struct dgb_softc *sc, unsigned addr); -static __inline int setinitwin (struct dgb_softc *sc, unsigned addr); -static __inline void hidewin (struct dgb_softc *sc); -static __inline void towin (struct dgb_softc *sc, int win); - -/*Helg: to allow recursive dgb...() calls */ -typedef struct - { /* If we were called and don't want to disturb we need: */ - int port; /* write to this port */ - u_char data; /* this data on exit */ - /* or DATA_WINOFF to close memory window on entry */ - } BoardMemWinState; /* so several channels and even boards can coexist */ -#define DATA_WINOFF 0 -static BoardMemWinState bmws; - -/* return current memory window state and close window */ -static BoardMemWinState -bmws_get(void) -{ - BoardMemWinState bmwsRet=bmws; - if(bmws.data!=DATA_WINOFF) - outb(bmws.port, bmws.data=DATA_WINOFF); - return bmwsRet; -} - -/* restore memory window state */ -static void -bmws_set(BoardMemWinState ws) -{ - if(ws.data != bmws.data || ws.port!=bmws.port ) { - if(bmws.data!=DATA_WINOFF) - outb(bmws.port,DATA_WINOFF); - if(ws.data!=DATA_WINOFF) - outb(ws.port, ws.data); - bmws=ws; - } -} - -static __inline int -setwin(sc,addr) - struct dgb_softc *sc; - unsigned int addr; -{ - if(sc->type==PCXEVE) { - outb(bmws.port=sc->port+1, bmws.data=FEPWIN|(addr>>13)); - DPRINT3(DB_WIN,"dgb%d: switched to window 0x%x\n",sc->unit,addr>>13); - return (addr & 0x1FFF); - } else { - outb(bmws.port=sc->port,bmws.data=FEPMEM); - return addr; - } -} - -static __inline int -setinitwin(sc,addr) - struct dgb_softc *sc; - unsigned int addr; -{ - if(sc->type==PCXEVE) { - outb(bmws.port=sc->port+1, bmws.data=FEPWIN|(addr>>13)); - DPRINT3(DB_WIN,"dgb%d: switched to window 0x%x\n",sc->unit,addr>>13); - return (addr & 0x1FFF); - } else { - outb(bmws.port=sc->port,bmws.data=inb(sc->port)|FEPMEM); - return addr; - } -} - -static __inline void -hidewin(sc) - struct dgb_softc *sc; -{ - bmws.data=0; - if(sc->type==PCXEVE) - outb(bmws.port=sc->port+1, bmws.data); - else - outb(bmws.port=sc->port, bmws.data); -} - -static __inline void -towin(sc,win) - struct dgb_softc *sc; - int win; -{ - if(sc->type==PCXEVE) { - outb(bmws.port=sc->port+1, bmws.data=win); - } else { - outb(bmws.port=sc->port,bmws.data=FEPMEM); - } -} - -static int -dgbprobe(dev) - struct isa_device *dev; -{ - struct dgb_softc *sc= &dgb_softc[dev->id_unit]; - int i, v; - u_long win_size; /* size of vizible memory window */ - int unit=dev->id_unit; - - lwkt_gettoken(&tty_token); - sc->unit=dev->id_unit; - sc->port=dev->id_iobase; - - if(dev->id_flags & DGBFLAG_ALTPIN) - sc->altpin=1; - else - sc->altpin=0; - - /* left 24 bits only (ISA address) */ - sc->pmem=((intptr_t)(void *)dev->id_maddr & 0xFFFFFF); - - DPRINT4(DB_INFO,"dgb%d: port 0x%x mem 0x%lx\n",unit,sc->port,sc->pmem); - - outb(sc->port, FEPRST); - sc->status=DISABLED; - - for(i=0; i< 1000; i++) { - DELAY(1); - if( (inb(sc->port) & FEPMASK) == FEPRST ) { - sc->status=ENABLED; - DPRINT3(DB_EXCEPT,"dgb%d: got reset after %d us\n",unit,i); - break; - } - } - - if(sc->status!=ENABLED) { - DPRINT2(DB_EXCEPT,"dgb%d: failed to respond\n",dev->id_unit); - lwkt_reltoken(&tty_token); - return 0; - } - - /* check type of card and get internal memory characteristics */ - - v=inb(sc->port); - - if( v & 0x1 ) { - switch( v&0x30 ) { - case 0: - sc->mem_seg=0xF000; - win_size=0x10000; - kprintf("dgb%d: PC/Xi 64K\n",dev->id_unit); - break; - case 0x10: - sc->mem_seg=0xE000; - win_size=0x20000; - kprintf("dgb%d: PC/Xi 128K\n",dev->id_unit); - break; - case 0x20: - sc->mem_seg=0xC000; - win_size=0x40000; - kprintf("dgb%d: PC/Xi 256K\n",dev->id_unit); - break; - default: /* case 0x30: */ - sc->mem_seg=0x8000; - win_size=0x80000; - kprintf("dgb%d: PC/Xi 512K\n",dev->id_unit); - break; - } - sc->type=PCXI; - } else { - outb(sc->port, 1); - v=inb(sc->port); - - if( v & 0x1 ) { - kprintf("dgb%d: PC/Xm isn't supported\n",dev->id_unit); - sc->status=DISABLED; - lwkt_reltoken(&tty_token); - return 0; - } - - sc->mem_seg=0xF000; - - if(dev->id_flags==DGBFLAG_NOWIN || ( v&0xC0 )==0) { - win_size=0x10000; - kprintf("dgb%d: PC/Xe 64K\n",dev->id_unit); - sc->type=PCXE; - } else { - win_size=0x2000; - kprintf("dgb%d: PC/Xe 64/8K (windowed)\n",dev->id_unit); - sc->type=PCXEVE; - if((u_long)sc->pmem & ~0xFFE000) { - kprintf("dgb%d: warning: address 0x%lx truncated to 0x%lx\n", - dev->id_unit, sc->pmem, - sc->pmem & 0xFFE000); - - dev->id_maddr= (u_char *)(void *)(intptr_t)( sc->pmem & 0xFFE000 ); - } - } - } - - /* save size of vizible memory segment */ - dev->id_msize=win_size; - - /* map memory */ - dev->id_maddr=sc->vmem=pmap_mapdev(sc->pmem,dev->id_msize); - - outb(sc->port, FEPCLR); /* drop RESET */ - hidewin(sc); /* Helg: to set initial bmws state */ - - lwkt_reltoken(&tty_token); - return 4; /* we need I/O space of 4 ports */ -} - -static int -dgbattach(dev) - struct isa_device *dev; -{ - int unit=dev->id_unit; - struct dgb_softc *sc= &dgb_softc[dev->id_unit]; - int i, t; - u_char volatile *mem; - u_char volatile *ptr; - int addr; - struct dgb_p *port; - volatile struct board_chan *bc; - int shrinkmem; - int nfails; - const volatile ushort *pstat; - int lowwater; - static int nports=0; - char suffix; - - lwkt_gettoken(&tty_token); - if(sc->status!=ENABLED) { - DPRINT2(DB_EXCEPT,"dbg%d: try to attach a disabled card\n",unit); - lwkt_reltoken(&tty_token); - return 0; - } - - callout_init_mp(&sc->dgb_pause); - callout_init_mp(&sc->dgbpoll); - callout_init_mp(&sc->wakeflush); - - mem=sc->vmem; - - DPRINT3(DB_INFO,"dgb%d: internal memory segment 0x%x\n",unit,sc->mem_seg); - - outb(sc->port, FEPRST); DELAY(1); - - for(i=0; (inb(sc->port) & FEPMASK) != FEPRST ; i++) { - if(i>10000) { - kprintf("dgb%d: 1st reset failed\n",dev->id_unit); - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - DELAY(1); - } - - DPRINT3(DB_INFO,"dgb%d: got reset after %d us\n",unit,i); - - /* for PCXEVE set up interrupt and base address */ - - if(sc->type==PCXEVE) { - t=(((u_long)sc->pmem>>8) & 0xFFE0) | 0x10 /* enable windowing */; - /* IRQ isn't used */ - outb(sc->port+2,t & 0xFF); - outb(sc->port+3,t>>8); - } else if(sc->type==PCXE) { - t=(((u_long)sc->pmem>>8) & 0xFFE0) /* disable windowing */; - outb(sc->port+2,t & 0xFF); - outb(sc->port+3,t>>8); - } - - - if(sc->type==PCXI || sc->type==PCXE) { - outb(sc->port, FEPRST|FEPMEM); DELAY(1); - - for(i=0; (inb(sc->port) & FEPMASK) != (FEPRST|FEPMEM) ; i++) { - if(i>10000) { - kprintf("dgb%d: 2nd reset failed\n",dev->id_unit); - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - DELAY(1); - } - - DPRINT3(DB_INFO,"dgb%d: got memory after %d us\n",unit,i); - } - - mem=sc->vmem; - - /* very short memory test */ - - addr=setinitwin(sc,BOTWIN); - *(u_long volatile *)(mem+addr) = 0xA55A3CC3; - if(*(u_long volatile *)(mem+addr)!=0xA55A3CC3) { - kprintf("dgb%d: 1st memory test failed\n",dev->id_unit); - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - - addr=setinitwin(sc,TOPWIN); - *(u_long volatile *)(mem+addr) = 0x5AA5C33C; - if(*(u_long volatile *)(mem+addr)!=0x5AA5C33C) { - kprintf("dgb%d: 2nd memory test failed\n",dev->id_unit); - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - - addr=setinitwin(sc,BIOSCODE+((0xF000-sc->mem_seg)<<4)); - *(u_long volatile *)(mem+addr) = 0x5AA5C33C; - if(*(u_long volatile *)(mem+addr)!=0x5AA5C33C) { - kprintf("dgb%d: 3rd (BIOS) memory test failed\n",dev->id_unit); - } - - addr=setinitwin(sc,MISCGLOBAL); - for(i=0; i<16; i++) { - mem[addr+i]=0; - } - - if(sc->type==PCXI || sc->type==PCXE) { - - addr=BIOSCODE+((0xF000-sc->mem_seg)<<4); - - DPRINT3(DB_INFO,"dgb%d: BIOS local address=0x%x\n",unit,addr); - - ptr= mem+addr; - - for(i=0; i=5) { - kprintf("dgb%d: 4th memory test (BIOS load) fails\n",unit); - break; - } - } - - outb(sc->port,FEPMEM); - - for(i=0; (inb(sc->port) & FEPMASK) != FEPMEM ; i++) { - if(i>10000) { - kprintf("dgb%d: BIOS start failed\n",dev->id_unit); - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - DELAY(1); - } - - DPRINT3(DB_INFO,"dgb%d: reset dropped after %d us\n",unit,i); - - for(i=0; i<200000; i++) { - if( *((ushort volatile *)(mem+MISCGLOBAL)) == *((ushort *)"GD") ) - goto load_fep; - DELAY(1); - } - kprintf("dgb%d: BIOS download failed\n",dev->id_unit); - DPRINT4(DB_EXCEPT,"dgb%d: code=0x%x must be 0x%x\n", - dev->id_unit, - *((ushort volatile *)(mem+MISCGLOBAL)), - *((ushort *)"GD")); - - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - - if(sc->type==PCXEVE) { - /* set window 7 */ - outb(sc->port+1,0xFF); - - ptr= mem+(BIOSCODE & 0x1FFF); - - for(i=0; i=5) { - kprintf("dgb%d: 4th memory test (BIOS load) fails\n",unit); - break; - } - } - - outb(sc->port,FEPCLR); - - setwin(sc,0); - - for(i=0; (inb(sc->port) & FEPMASK) != FEPCLR ; i++) { - if(i>10000) { - kprintf("dgb%d: BIOS start failed\n",dev->id_unit); - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - DELAY(1); - } - - DPRINT3(DB_INFO,"dgb%d: reset dropped after %d us\n",unit,i); - - addr=setwin(sc,MISCGLOBAL); - - for(i=0; i<200000; i++) { - if(*(ushort volatile *)(mem+addr)== *(ushort *)"GD") - goto load_fep; - DELAY(1); - } - kprintf("dgb%d: BIOS download failed\n",dev->id_unit); - DPRINT5(DB_EXCEPT,"dgb%d: Error#(0x%x,0x%x) code=0x%x\n", - dev->id_unit, - *(ushort volatile *)(mem+0xC12), - *(ushort volatile *)(mem+0xC14), - *(ushort volatile *)(mem+MISCGLOBAL)); - - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - -load_fep: - DPRINT2(DB_INFO,"dgb%d: BIOS loaded\n",dev->id_unit); - - addr=setwin(sc,FEPCODE); - - ptr= mem+addr; - - for(i=0; imem_seg+FEPCODESEG; - *(ushort volatile *)(mem+addr+ 4)=0; - *(ushort volatile *)(mem+addr+ 6)=FEPCODESEG; - *(ushort volatile *)(mem+addr+ 8)=0; - *(ushort volatile *)(mem+addr+10)=pcxx_ncook; - - outb(sc->port,FEPMEM|FEPINT); /* send interrupt to BIOS */ - outb(sc->port,FEPMEM); - - for(i=0; *(ushort volatile *)(mem+addr)!=0; i++) { - if(i>200000) { - kprintf("dgb%d: FEP code download failed\n",unit); - DPRINT3(DB_EXCEPT,"dgb%d: code=0x%x must be 0\n", unit, - *(ushort volatile *)(mem+addr)); - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - } - - DPRINT2(DB_INFO,"dgb%d: FEP code loaded\n",unit); - - *(ushort volatile *)(mem+setwin(sc,FEPSTAT))=0; - addr=setwin(sc,MBOX); - *(ushort volatile *)(mem+addr+0)=1; - *(ushort volatile *)(mem+addr+2)=FEPCODESEG; - *(ushort volatile *)(mem+addr+4)=0x4; - - outb(sc->port,FEPINT); /* send interrupt to BIOS */ - outb(sc->port,FEPCLR); - - addr=setwin(sc,FEPSTAT); - for(i=0; *(ushort volatile *)(mem+addr)!= *(ushort *)"OS"; i++) { - if(i>200000) { - kprintf("dgb%d: FEP/OS start failed\n",dev->id_unit); - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - } - - DPRINT2(DB_INFO,"dgb%d: FEP/OS started\n",dev->id_unit); - - sc->numports= *(ushort volatile *)(mem+setwin(sc,NPORT)); - - kprintf("dgb%d: %d ports\n",unit,sc->numports); - - if(sc->numports > MAX_DGB_PORTS) { - kprintf("dgb%d: too many ports\n",unit); - sc->status=DISABLED; - hidewin(sc); - lwkt_reltoken(&tty_token); - return 0; - } - - if(nports+sc->numports>NDGBPORTS) { - kprintf("dgb%d: only %d ports are usable\n", unit, NDGBPORTS-nports); - sc->numports=NDGBPORTS-nports; - } - - /* allocate port and tty structures */ - sc->ports=&dgb_ports[nports]; - sc->ttys=&dgb_tty[nports]; - nports+=sc->numports; - - addr=setwin(sc,PORTBASE); - pstat=(const ushort volatile *)(mem+addr); - - for(i=0; inumports && pstat[i]; i++) - if(pstat[i]) - sc->ports[i].status=ENABLED; - else { - sc->ports[i].status=DISABLED; - kprintf("dgb%d: port%d is broken\n", unit, i); - } - - /* We should now init per-port structures */ - bc=(volatile struct board_chan *)(mem + CHANSTRUCT); - sc->mailbox=(volatile struct global_data *)(mem + FEP_GLOBAL); - - if(sc->numports<3) - shrinkmem=1; - else - shrinkmem=0; - - for(i=0; inumports; i++, bc++) { - port= &sc->ports[i]; - - port->tty=&sc->ttys[i]; - port->unit=unit; - - port->brdchan=bc; - - if(sc->altpin) { - port->dsr=CD; - port->dcd=DSR; - } else { - port->dcd=CD; - port->dsr=DSR; - } - - port->pnum=i; - - if(shrinkmem) { - DPRINT2(DB_INFO,"dgb%d: shrinking memory\n",unit); - fepcmd(port, SETBUFFER, 32, 0, 0, 0); - shrinkmem=0; - } - - if(sc->type!=PCXEVE) { - port->txptr=mem+((bc->tseg-sc->mem_seg)<<4); - port->rxptr=mem+((bc->rseg-sc->mem_seg)<<4); - port->txwin=port->rxwin=0; - } else { - port->txptr=mem+( ((bc->tseg-sc->mem_seg)<<4) & 0x1FFF ); - port->rxptr=mem+( ((bc->rseg-sc->mem_seg)<<4) & 0x1FFF ); - port->txwin=FEPWIN | ((bc->tseg-sc->mem_seg)>>9); - port->rxwin=FEPWIN | ((bc->rseg-sc->mem_seg)>>9); - } - - port->txbufhead=0; - port->rxbufhead=0; - port->txbufsize=bc->tmax+1; - port->rxbufsize=bc->rmax+1; - - lowwater= (port->txbufsize>=2000) ? 1024 : (port->txbufsize/2); - setwin(sc,0); - fepcmd(port, STXLWATER, lowwater, 0, 10, 0); - fepcmd(port, SRXLWATER, port->rxbufsize/4, 0, 10, 0); - fepcmd(port, SRXHWATER, 3*port->rxbufsize/4, 0, 10, 0); - - bc->edelay=100; - bc->idata=1; - - port->startc=bc->startc; - port->startca=bc->startca; - port->stopc=bc->stopc; - port->stopca=bc->stopca; - - /*port->close_delay=50;*/ - port->close_delay=3 * hz; - port->do_timestamp=0; - port->do_dcd_timestamp=0; - - /* - * We don't use all the flags from since they - * are only relevant for logins. It's important to have echo off - * initially so that the line doesn't start blathering before the - * echo flag can be turned off. - */ - port->it_in.c_iflag = TTYDEF_IFLAG; - port->it_in.c_oflag = TTYDEF_OFLAG; - port->it_in.c_cflag = TTYDEF_CFLAG; - port->it_in.c_lflag = TTYDEF_LFLAG; - termioschars(&port->it_in); - port->it_in.c_ispeed = port->it_in.c_ospeed = dgbdefaultrate; - port->it_out = port->it_in; - /* MAX_DGB_PORTS is 32 => [0-9a-v] */ - suffix = i < 10 ? '0' + i : 'a' + i - 10; - cdevsw_add(&dgb_cdevsw, 0xffff0000, unit << 16); - make_dev(&dgb_cdevsw, (unit<<16)+i, - UID_ROOT, GID_WHEEL, 0600, "ttyD%d%c", unit, suffix); - - make_dev(&dgb_cdevsw, (unit<<16)+i+32, - UID_ROOT, GID_WHEEL, 0600, "ttyiD%d%c", unit, suffix); - - make_dev(&dgb_cdevsw, (unit<<16)+i+64, - UID_ROOT, GID_WHEEL, 0600, "ttylD%d%c", unit, suffix); - - make_dev(&dgb_cdevsw, (unit<<16)+i+128, - UID_UUCP, GID_DIALER, 0660, "cuaD%d%c", unit, suffix); - - make_dev(&dgb_cdevsw, (unit<<16)+i+160, - UID_UUCP, GID_DIALER, 0660, "cuaiD%d%c", unit, suffix); - - make_dev(&dgb_cdevsw, (unit<<16)+i+192, - UID_UUCP, GID_DIALER, 0660, "cualD%d%c", unit, suffix); - } - - hidewin(sc); - - /* register the polling function */ - callout_reset(&sc->dgbpoll, hz / POLLSPERSEC, dgbpoll, (void *)unit); - - lwkt_reltoken(&tty_token); - return 1; -} - -/* ARGSUSED */ -static int -dgbopen(cdev_t dev, int flag, int mode, struct thread *td) -{ - struct dgb_softc *sc; - struct tty *tp; - int unit; - int mynor; - int pnum; - struct dgb_p *port; - int error; - volatile struct board_chan *bc; - - error=0; - - lwkt_gettoken(&tty_token); - mynor=minor(dev); - unit=MINOR_TO_UNIT(mynor); - pnum=MINOR_TO_PORT(mynor); - - if(unit >= NDGB) { - DPRINT2(DB_EXCEPT,"dgb%d: try to open a nonexisting card\n",unit); - lwkt_reltoken(&tty_token); - return ENXIO; - } - - sc=&dgb_softc[unit]; - - if(sc->status!=ENABLED) { - DPRINT2(DB_EXCEPT,"dgb%d: try to open a disabled card\n",unit); - lwkt_reltoken(&tty_token); - return ENXIO; - } - - if(pnum>=sc->numports) { - DPRINT3(DB_EXCEPT,"dgb%d: try to open non-existing port %d\n",unit,pnum); - lwkt_reltoken(&tty_token); - return ENXIO; - } - - if(mynor & CONTROL_MASK) { - lwkt_reltoken(&tty_token); - return 0; - } - - tp=&sc->ttys[pnum]; - dev->si_tty = tp; - port=&sc->ports[pnum]; - bc=port->brdchan; - -open_top: - - crit_enter(); - - while(port->closing) { - error=tsleep(&port->closing, PCATCH, "dgocl", 0); - - if(error) { - DPRINT4(DB_OPEN,"dgb%d: port%d: tsleep(dgocl) error=%d\n",unit,pnum,error); - goto out; - } - } - - if (tp->t_state & TS_ISOPEN) { - /* - * The device is open, so everything has been initialized. - * Handle conflicts. - */ - if (mynor & CALLOUT_MASK) { - if (!port->active_out) { - error = EBUSY; - DPRINT4(DB_OPEN,"dgb%d: port%d: BUSY error=%d\n",unit,pnum,error); - goto out; - } - } else { - if (port->active_out) { - if (flag & O_NONBLOCK) { - error = EBUSY; - DPRINT4(DB_OPEN,"dgb%d: port%d: BUSY error=%d\n",unit,pnum,error); - goto out; - } - error = tsleep(&port->active_out, - PCATCH, "dgbi", 0); - if (error != 0) { - DPRINT4(DB_OPEN,"dgb%d: port%d: tsleep(dgbi) error=%d\n", - unit,pnum,error); - goto out; - } - crit_exit(); - goto open_top; - } - } - if (tp->t_state & TS_XCLUDE && priv_check(td, PRIV_ROOT)) { - error = EBUSY; - goto out; - } - } else { - /* - * The device isn't open, so there are no conflicts. - * Initialize it. Initialization is done twice in many - * cases: to preempt sleeping callin opens if we are - * callout, and to complete a callin open after DCD rises. - */ - tp->t_oproc=dgbstart; - tp->t_param=dgbparam; - tp->t_stop=dgbstop; - tp->t_dev=dev; - tp->t_termios= (mynor & CALLOUT_MASK) ? - port->it_out : - port->it_in; - - crit_enter(); - setwin(sc,0); - port->imodem=bc->mstat; - bc->rout=bc->rin; /* clear input queue */ - bc->idata=1; -#ifdef PRINT_BUFSIZE - kprintf("dgb buffers tx=%x:%x rx=%x:%x\n",bc->tseg,bc->tmax,bc->rseg,bc->rmax); -#endif - - hidewin(sc); - crit_exit(); - - port->wopeners++; - error=dgbparam(tp, &tp->t_termios); - port->wopeners--; - - if(error!=0) { - DPRINT4(DB_OPEN,"dgb%d: port%d: dgbparam error=%d\n",unit,pnum,error); - goto out; - } - - /* handle fake DCD for callout devices */ - /* and initial DCD */ - - if( (port->imodem & port->dcd) || mynor & CALLOUT_MASK ) - linesw[tp->t_line].l_modem(tp,1); - - } - - /* - * Wait for DCD if necessary. - */ - if (!(tp->t_state & TS_CARR_ON) && !(mynor & CALLOUT_MASK) - && !(tp->t_cflag & CLOCAL) && !(flag & O_NONBLOCK)) { - ++port->wopeners; - error = tsleep(TSA_CARR_ON(tp), PCATCH, "dgdcd", 0); - --port->wopeners; - if (error != 0) { - DPRINT4(DB_OPEN,"dgb%d: port%d: tsleep(dgdcd) error=%d\n",unit,pnum,error); - goto out; - } - crit_exit(); - goto open_top; - } - error = linesw[tp->t_line].l_open(dev, tp); - disc_optim(tp,&tp->t_termios); - DPRINT4(DB_OPEN,"dgb%d: port%d: l_open error=%d\n",unit,pnum,error); - - if (tp->t_state & TS_ISOPEN && mynor & CALLOUT_MASK) - port->active_out = TRUE; - - port->used=1; - - /* If any port is open (i.e. the open() call is completed for it) - * the device is busy - */ - -out: - disc_optim(tp,&tp->t_termios); - crit_exit(); - - if( !(tp->t_state & TS_ISOPEN) && port->wopeners==0 ) - dgbhardclose(port); - - DPRINT4(DB_OPEN,"dgb%d: port%d: open() returns %d\n",unit,pnum,error); - - lwkt_reltoken(&tty_token); - return error; -} - -/*ARGSUSED*/ -static int -dgbclose(cdev_t dev, int flag, int mode, struct thread *td) -{ - struct tty *tp; - int unit, pnum; - struct dgb_softc *sc; - struct dgb_p *port; - int mynor; - int i; - - mynor=minor(dev); - if(mynor & CONTROL_MASK) - return 0; - lwkt_gettoken(&tty_token); - unit=MINOR_TO_UNIT(mynor); - pnum=MINOR_TO_PORT(mynor); - - sc=&dgb_softc[unit]; - tp=&sc->ttys[pnum]; - port=sc->ports+pnum; - - DPRINT3(DB_CLOSE,"dgb%d: port%d: closing\n",unit,pnum); - - DPRINT3(DB_CLOSE,"dgb%d: port%d: draining port\n",unit,pnum); - dgb_drain_or_flush(port); - - crit_enter(); - - port->closing=1; - DPRINT3(DB_CLOSE,"dgb%d: port%d: closing line disc\n",unit,pnum); - linesw[tp->t_line].l_close(tp,flag); - disc_optim(tp,&tp->t_termios); - - DPRINT3(DB_CLOSE,"dgb%d: port%d: hard closing\n",unit,pnum); - dgbhardclose(port); - DPRINT3(DB_CLOSE,"dgb%d: port%d: closing tty\n",unit,pnum); - ttyclose(tp); - port->closing=0; - wakeup(&port->closing); - port->used=0; - - /* mark the card idle when all ports are closed */ - - for(i=0; inumports; i++) - if(sc->ports[i].used) - break; - - crit_exit(); - - DPRINT3(DB_CLOSE,"dgb%d: port%d: closed\n",unit,pnum); - - wakeup(TSA_CARR_ON(tp)); - wakeup(&port->active_out); - port->active_out=0; - - DPRINT3(DB_CLOSE,"dgb%d: port%d: close exit\n",unit,pnum); - - lwkt_reltoken(&tty_token); - return 0; -} - -/* - * NOTE: Must be called with tty_token held - */ -static void -dgbhardclose(port) - struct dgb_p *port; -{ - struct dgb_softc *sc=&dgb_softc[port->unit]; - volatile struct board_chan *bc=port->brdchan; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - - crit_enter(); - port->do_timestamp = 0; - setwin(sc,0); - - bc->idata=0; bc->iempty=0; bc->ilow=0; - if(port->tty->t_cflag & HUPCL) { - port->omodem &= ~(RTS|DTR); - fepcmd(port, SETMODEM, 0, DTR|RTS, 0, 1); - } - - hidewin(sc); - crit_exit(); - - callout_reset(&sc->dgb_pause, hz / 2, dgb_pause, &port->brdchan); - tsleep(&port->brdchan, PCATCH, "dgclo", 0); -} - -static void -dgb_pause(chan) - void *chan; -{ - lwkt_gettoken(&tty_token); - wakeup((caddr_t)chan); - lwkt_reltoken(&tty_token); -} - -static void -dgbpoll(unit_c) - void *unit_c; -{ - int unit=(int)unit_c; - int pnum; - struct dgb_p *port; - struct dgb_softc *sc=&dgb_softc[unit]; - int head, tail; - u_char *eventbuf; - int event, mstat, lstat; - volatile struct board_chan *bc; - struct tty *tp; - int rhead, rtail; - int whead, wtail; - int size; - u_char *ptr; - int ocount; - int ibuf_full,obuf_full; - - lwkt_gettoken(&tty_token); - BoardMemWinState ws=bmws_get(); - - if(sc->status==DISABLED) { - kprintf("dgb%d: polling of disabled board stopped\n",unit); - lwkt_reltoken(&tty_token); - return; - } - - setwin(sc,0); - - head=sc->mailbox->ein; - tail=sc->mailbox->eout; - - while(head!=tail) { - if(head >= FEP_IMAX-FEP_ISTART - || tail >= FEP_IMAX-FEP_ISTART - || (head|tail) & 03 ) { - kprintf("dgb%d: event queue's head or tail is wrong! hd=%d,tl=%d\n", unit,head,tail); - break; - } - - eventbuf=sc->vmem+tail+FEP_ISTART; - pnum=eventbuf[0]; - event=eventbuf[1]; - mstat=eventbuf[2]; - lstat=eventbuf[3]; - - port=&sc->ports[pnum]; - bc=port->brdchan; - tp=&sc->ttys[pnum]; - - if(pnum>=sc->numports || port->status==DISABLED) { - kprintf("dgb%d: port%d: got event on nonexisting port\n",unit,pnum); - } else if(port->used || port->wopeners>0 ) { - - int wrapmask=port->rxbufsize-1; - - if( !(event & ALL_IND) ) - kprintf("dgb%d: port%d: ? event 0x%x mstat 0x%x lstat 0x%x\n", - unit, pnum, event, mstat, lstat); - - if(event & DATA_IND) { - DPRINT3(DB_DATA,"dgb%d: port%d: DATA_IND\n",unit,pnum); - - rhead=bc->rin & wrapmask; - rtail=bc->rout & wrapmask; - - if( !(tp->t_cflag & CREAD) || !port->used ) { - bc->rout=rhead; - goto end_of_data; - } - - if(bc->orun) { - kprintf("dgb%d: port%d: overrun\n", unit, pnum); - bc->orun=0; - } - - if(!(tp->t_state & TS_ISOPEN)) - goto end_of_data; - - for(ibuf_full=FALSE;rhead!=rtail && !ibuf_full;) { - DPRINT5(DB_RXDATA,"dgb%d: port%d: p rx head=%d tail=%d\n", - unit,pnum,rhead,rtail); - - if(rhead>rtail) - size=rhead-rtail; - else - size=port->rxbufsize-rtail; - - ptr=__DEVOLATILE(u_char *, port->rxptr+rtail); - -/* Helg: */ - if( tp->t_rawq.c_cc + size > DGB_IBUFSIZE ) { - size=DGB_IBUFSIZE-tp->t_rawq.c_cc; - DPRINT1(DB_RXDATA,"*"); - ibuf_full=TRUE; - } - - if(size) { - if (tp->t_state & TS_CAN_BYPASS_L_RINT) { - DPRINT1(DB_RXDATA,"!"); - towin(sc,port->rxwin); - tk_nin += size; - tk_rawcc += size; - tp->t_rawcc += size; - b_to_q(ptr,size,&tp->t_rawq); - setwin(sc,0); - } else { - int i=size; - unsigned char chr; - do { - towin(sc,port->rxwin); - chr= *ptr++; - hidewin(sc); - (*linesw[tp->t_line].l_rint)(chr, tp); - } while (--i > 0 ); - setwin(sc,0); - } - } - rtail= (rtail + size) & wrapmask; - bc->rout=rtail; - rhead=bc->rin & wrapmask; - hidewin(sc); - ttwakeup(tp); - setwin(sc,0); - } - end_of_data: ; - } - - if(event & MODEMCHG_IND) { - DPRINT3(DB_MODEM,"dgb%d: port%d: MODEMCHG_IND\n",unit,pnum); - port->imodem=mstat; - if(mstat & port->dcd) { - hidewin(sc); - linesw[tp->t_line].l_modem(tp,1); - setwin(sc,0); - wakeup(TSA_CARR_ON(tp)); - } else { - hidewin(sc); - linesw[tp->t_line].l_modem(tp,0); - setwin(sc,0); - if( port->draining) { - port->draining=0; - wakeup(&port->draining); - } - } - } - - if(event & BREAK_IND) { - if((tp->t_state & TS_ISOPEN) && (tp->t_iflag & IGNBRK)) { - DPRINT3(DB_BREAK,"dgb%d: port%d: BREAK_IND\n",unit,pnum); - hidewin(sc); - linesw[tp->t_line].l_rint(TTY_BI, tp); - setwin(sc,0); - } - } - -/* Helg: with output flow control */ - - if(event & (LOWTX_IND | EMPTYTX_IND) ) { - DPRINT3(DB_TXDATA,"dgb%d: port%d: LOWTX_IND or EMPTYTX_IND\n",unit,pnum); - - if( (event & EMPTYTX_IND ) && tp->t_outq.c_cc==0 - && port->draining) { - port->draining=0; - wakeup(&port->draining); - bc->ilow=0; bc->iempty=0; - } else { - - int wrapmask=port->txbufsize-1; - - for(obuf_full=FALSE; tp->t_outq.c_cc!=0 && !obuf_full; ) { - /* add "last-minute" data to write buffer */ - if(!(tp->t_state & TS_BUSY)) { - hidewin(sc); -#ifndef TS_ASLEEP /* post 2.0.5 FreeBSD */ - ttwwakeup(tp); -#else - if(tp->t_outq.c_cc <= tp->t_lowat) { - if(tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup(TSA_OLOWAT(tp)); - } - /* selwakeup(&tp->t_wsel); */ - } -#endif - setwin(sc,0); - } - crit_enter(); - - whead=bc->tin & wrapmask; - wtail=bc->tout & wrapmask; - - if(wheadtxbufsize-whead; - if(wtail==0) - size--; - } - - if(size==0) { - DPRINT5(DB_WR,"dgb: head=%d tail=%d size=%d full=%d\n", - whead,wtail,size,obuf_full); - bc->iempty=1; bc->ilow=1; - obuf_full=TRUE; - crit_exit(); - break; - } - - towin(sc,port->txwin); - - ocount=q_to_b(&tp->t_outq, __DEVOLATILE(u_char *, port->txptr+whead), size); - whead+=ocount; - - setwin(sc,0); - bc->tin=whead; - bc->tin=whead & wrapmask; - crit_exit(); - } - - if(obuf_full) { - DPRINT1(DB_WR," +BUSY\n"); - tp->t_state|=TS_BUSY; - } else { - DPRINT1(DB_WR," -BUSY\n"); - hidewin(sc); -#ifndef TS_ASLEEP /* post 2.0.5 FreeBSD */ - /* should clear TS_BUSY before ttwwakeup */ - if(tp->t_state & TS_BUSY) { - tp->t_state &= ~TS_BUSY; - linesw[tp->t_line].l_start(tp); - ttwwakeup(tp); - } -#else - if(tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup(TSA_OLOWAT(tp)); - } - tp->t_state &= ~TS_BUSY; -#endif - setwin(sc,0); - } - } - } - bc->idata=1; /* require event on incoming data */ - - } else { - bc=port->brdchan; - DPRINT4(DB_EXCEPT,"dgb%d: port%d: got event 0x%x on closed port\n", - unit,pnum,event); - bc->rout=bc->rin; - bc->idata=bc->iempty=bc->ilow=0; - } - - tail= (tail+4) & (FEP_IMAX-FEP_ISTART-4); - } - - sc->mailbox->eout=tail; - bmws_set(ws); - - callout_reset(&sc->dgbpoll, hz / POLLSPERSEC, dgbpoll, unit_c); - lwkt_reltoken(&tty_token); -} - -static int -dgbioctl(cdev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) -{ - struct dgb_softc *sc; - int unit, pnum; - struct dgb_p *port; - int mynor; - struct tty *tp; - volatile struct board_chan *bc; - int error; - int tiocm_xxx; - - lwkt_gettoken(&tty_token); -#if defined(COMPAT_43) || defined(COMPAT_SUNOS) - u_long oldcmd; - struct termios term; -#endif - - BoardMemWinState ws=bmws_get(); - - mynor=minor(dev); - unit=MINOR_TO_UNIT(mynor); - pnum=MINOR_TO_PORT(mynor); - - sc=&dgb_softc[unit]; - port=&sc->ports[pnum]; - tp=&sc->ttys[pnum]; - bc=port->brdchan; - - if (mynor & CONTROL_MASK) { - struct termios *ct; - - switch (mynor & CONTROL_MASK) { - case CONTROL_INIT_STATE: - ct = mynor & CALLOUT_MASK ? &port->it_out : &port->it_in; - break; - case CONTROL_LOCK_STATE: - ct = mynor & CALLOUT_MASK ? &port->lt_out : &port->lt_in; - break; - default: - lwkt_reltoken(&tty_token); - return (ENODEV); /* /dev/nodev */ - } - switch (cmd) { - case TIOCSETA: - error = priv_check(td, PRIV_ROOT); - if (error != 0) { - lwkt_reltoken(&tty_token); - return (error); - } - *ct = *(struct termios *)data; - lwkt_reltoken(&tty_token); - return (0); - case TIOCGETA: - *(struct termios *)data = *ct; - lwkt_reltoken(&tty_token); - return (0); - case TIOCGETD: - *(int *)data = TTYDISC; - lwkt_reltoken(&tty_token); - return (0); - case TIOCGWINSZ: - bzero(data, sizeof(struct winsize)); - lwkt_reltoken(&tty_token); - return (0); - default: - lwkt_reltoken(&tty_token); - return (ENOTTY); - } - } - -#if defined(COMPAT_43) || defined(COMPAT_SUNOS) - term = tp->t_termios; - if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { - DPRINT6(DB_PARAM,"dgb%d: port%d: dgbioctl-ISNOW c=0x%x i=0x%x l=0x%x\n",unit,pnum,term.c_cflag,term.c_iflag,term.c_lflag); - } - oldcmd = cmd; - error = ttsetcompat(tp, &cmd, data, &term); - if (error != 0) { - lwkt_reltoken(&tty_token); - return (error); - } - if (cmd != oldcmd) - data = (caddr_t)&term; -#endif - - if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { - int cc; - struct termios *dt = (struct termios *)data; - struct termios *lt = mynor & CALLOUT_MASK - ? &port->lt_out : &port->lt_in; - - DPRINT6(DB_PARAM,"dgb%d: port%d: dgbioctl-TOSET c=0x%x i=0x%x l=0x%x\n",unit,pnum,dt->c_cflag,dt->c_iflag,dt->c_lflag); - dt->c_iflag = (tp->t_iflag & lt->c_iflag) - | (dt->c_iflag & ~lt->c_iflag); - dt->c_oflag = (tp->t_oflag & lt->c_oflag) - | (dt->c_oflag & ~lt->c_oflag); - dt->c_cflag = (tp->t_cflag & lt->c_cflag) - | (dt->c_cflag & ~lt->c_cflag); - dt->c_lflag = (tp->t_lflag & lt->c_lflag) - | (dt->c_lflag & ~lt->c_lflag); - for (cc = 0; cc < NCCS; ++cc) - if (lt->c_cc[cc] != 0) - dt->c_cc[cc] = tp->t_cc[cc]; - if (lt->c_ispeed != 0) - dt->c_ispeed = tp->t_ispeed; - if (lt->c_ospeed != 0) - dt->c_ospeed = tp->t_ospeed; - } - - if(cmd==TIOCSTOP) { - crit_enter(); - setwin(sc,0); - fepcmd(port, PAUSETX, 0, 0, 0, 0); - bmws_set(ws); - crit_exit(); - lwkt_reltoken(&tty_token); - return 0; - } else if(cmd==TIOCSTART) { - crit_enter(); - setwin(sc,0); - fepcmd(port, RESUMETX, 0, 0, 0, 0); - bmws_set(ws); - crit_exit(); - lwkt_reltoken(&tty_token); - return 0; - } - - if(cmd==TIOCSETAW || cmd==TIOCSETAF) - port->mustdrain=1; - - error = linesw[tp->t_line].l_ioctl(tp, cmd, data, flag, td); - if (error != ENOIOCTL) { - lwkt_reltoken(&tty_token); - return error; - } - crit_enter(); - error = ttioctl(tp, cmd, data, flag); - disc_optim(tp,&tp->t_termios); - port->mustdrain=0; - if (error != ENOIOCTL) { - crit_exit(); - if (cmd == TIOCSETA || cmd == TIOCSETAW || cmd == TIOCSETAF) { - DPRINT6(DB_PARAM,"dgb%d: port%d: dgbioctl-RES c=0x%x i=0x%x l=0x%x\n",unit,pnum,tp->t_cflag,tp->t_iflag,tp->t_lflag); - } - lwkt_reltoken(&tty_token); - return error; - } - - switch (cmd) { - case TIOCSBRK: -/* Helg: commented */ -/* error=dgbdrain(port);*/ - - if(error!=0) { - crit_exit(); - lwkt_reltoken(&tty_token); - return error; - } - - crit_enter(); - setwin(sc,0); - - /* now it sends 250 millisecond break because I don't know */ - /* how to send an infinite break */ - - fepcmd(port, SENDBREAK, 250, 0, 10, 0); - hidewin(sc); - crit_exit(); - break; - case TIOCCBRK: - /* now it's empty */ - break; - case TIOCSDTR: - DPRINT3(DB_MODEM,"dgb%d: port%d: set DTR\n",unit,pnum); - port->omodem |= DTR; - crit_enter(); - setwin(sc,0); - fepcmd(port, SETMODEM, port->omodem, RTS, 0, 1); - - if( !(bc->mstat & DTR) ) { - DPRINT3(DB_MODEM,"dgb%d: port%d: DTR is off\n",unit,pnum); - } - - hidewin(sc); - crit_exit(); - break; - case TIOCCDTR: - DPRINT3(DB_MODEM,"dgb%d: port%d: reset DTR\n",unit,pnum); - port->omodem &= ~DTR; - crit_enter(); - setwin(sc,0); - fepcmd(port, SETMODEM, port->omodem, RTS|DTR, 0, 1); - - if( bc->mstat & DTR ) { - DPRINT3(DB_MODEM,"dgb%d: port%d: DTR is on\n",unit,pnum); - } - - hidewin(sc); - crit_exit(); - break; - case TIOCMSET: - if(*(int *)data & TIOCM_DTR) - port->omodem |=DTR; - else - port->omodem &=~DTR; - - if(*(int *)data & TIOCM_RTS) - port->omodem |=RTS; - else - port->omodem &=~RTS; - - crit_enter(); - setwin(sc,0); - fepcmd(port, SETMODEM, port->omodem, RTS|DTR, 0, 1); - hidewin(sc); - crit_exit(); - break; - case TIOCMBIS: - if(*(int *)data & TIOCM_DTR) - port->omodem |=DTR; - - if(*(int *)data & TIOCM_RTS) - port->omodem |=RTS; - - crit_enter(); - setwin(sc,0); - fepcmd(port, SETMODEM, port->omodem, RTS|DTR, 0, 1); - hidewin(sc); - crit_exit(); - break; - case TIOCMBIC: - if(*(int *)data & TIOCM_DTR) - port->omodem &=~DTR; - - if(*(int *)data & TIOCM_RTS) - port->omodem &=~RTS; - - crit_enter(); - setwin(sc,0); - fepcmd(port, SETMODEM, port->omodem, RTS|DTR, 0, 1); - hidewin(sc); - crit_exit(); - break; - case TIOCMGET: - setwin(sc,0); - port->imodem=bc->mstat; - hidewin(sc); - - tiocm_xxx = TIOCM_LE; /* XXX - always enabled while open */ - - DPRINT3(DB_MODEM,"dgb%d: port%d: modem stat -- ",unit,pnum); - - if (port->imodem & DTR) { - DPRINT1(DB_MODEM,"DTR "); - tiocm_xxx |= TIOCM_DTR; - } - if (port->imodem & RTS) { - DPRINT1(DB_MODEM,"RTS "); - tiocm_xxx |= TIOCM_RTS; - } - if (port->imodem & CTS) { - DPRINT1(DB_MODEM,"CTS "); - tiocm_xxx |= TIOCM_CTS; - } - if (port->imodem & port->dcd) { - DPRINT1(DB_MODEM,"DCD "); - tiocm_xxx |= TIOCM_CD; - } - if (port->imodem & port->dsr) { - DPRINT1(DB_MODEM,"DSR "); - tiocm_xxx |= TIOCM_DSR; - } - if (port->imodem & RI) { - DPRINT1(DB_MODEM,"RI "); - tiocm_xxx |= TIOCM_RI; - } - *(int *)data = tiocm_xxx; - DPRINT1(DB_MODEM,"--\n"); - break; - case TIOCMSDTRWAIT: - /* must be root since the wait applies to following logins */ - error = priv_check(td, PRIV_ROOT); - if (error != 0) { - crit_exit(); - lwkt_reltoken(&tty_token); - return (error); - } - port->close_delay = *(int *)data * hz / 100; - break; - case TIOCMGDTRWAIT: - *(int *)data = port->close_delay * 100 / hz; - break; - case TIOCTIMESTAMP: - port->do_timestamp = TRUE; - *(struct timeval *)data = port->timestamp; - break; - case TIOCDCDTIMESTAMP: - port->do_dcd_timestamp = TRUE; - *(struct timeval *)data = port->dcd_timestamp; - break; - default: - bmws_set(ws); - crit_exit(); - lwkt_reltoken(&tty_token); - return ENOTTY; - } - bmws_set(ws); - crit_exit(); - - lwkt_reltoken(&tty_token); - return 0; -} - -static void -wakeflush(p) - void *p; -{ - struct dgb_p *port=p; - - lwkt_gettoken(&tty_token); - wakeup(&port->draining); - lwkt_reltoken(&tty_token); -} - -/* wait for the output to drain */ -/* - * NOTE: Must be called with tty_token held - */ -static int -dgbdrain(port) - struct dgb_p *port; -{ - struct dgb_softc *sc=&dgb_softc[port->unit]; - volatile struct board_chan *bc=port->brdchan; - int error; - int head, tail; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - BoardMemWinState ws=bmws_get(); - - setwin(sc,0); - - bc->iempty=1; - tail=bc->tout; - head=bc->tin; - - while(tail!=head) { - DPRINT5(DB_WR,"dgb%d: port%d: drain: head=%d tail=%d\n", - port->unit, port->pnum, head, tail); - - hidewin(sc); - port->draining=1; - callout_reset(&sc->wakeflush, hz, wakeflush,port); - error=tsleep(&port->draining, PCATCH, "dgdrn", 0); - port->draining=0; - setwin(sc,0); - - if (error != 0) { - DPRINT4(DB_WR,"dgb%d: port%d: tsleep(dgdrn) error=%d\n", - port->unit,port->pnum,error); - - bc->iempty=0; - bmws_set(ws); - return error; - } - - tail=bc->tout; - head=bc->tin; - } - DPRINT5(DB_WR,"dgb%d: port%d: drain: head=%d tail=%d\n", - port->unit, port->pnum, head, tail); - bmws_set(ws); - return 0; -} - -/* wait for the output to drain */ -/* or simply clear the buffer it it's stopped */ -/* - * NOTE: Must be called with tty_token held - */ -static void -dgb_drain_or_flush(port) - struct dgb_p *port; -{ - struct tty *tp=port->tty; - struct dgb_softc *sc=&dgb_softc[port->unit]; - volatile struct board_chan *bc=port->brdchan; - int error; - int lasttail; - int head, tail; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - setwin(sc,0); - - lasttail=-1; - bc->iempty=1; - tail=bc->tout; - head=bc->tin; - - while(tail!=head /* && tail!=lasttail */ ) { - DPRINT5(DB_WR,"dgb%d: port%d: flush: head=%d tail=%d\n", - port->unit, port->pnum, head, tail); - - /* if there is no carrier simply clean the buffer */ - if( !(tp->t_state & TS_CARR_ON) ) { - bc->tout=bc->tin=0; - bc->iempty=0; - hidewin(sc); - return; - } - - hidewin(sc); - port->draining=1; - callout_reset(&sc->wakeflush, hz, wakeflush, port); - error=tsleep(&port->draining, PCATCH, "dgfls", 0); - port->draining=0; - setwin(sc,0); - - if (error != 0) { - DPRINT4(DB_WR,"dgb%d: port%d: tsleep(dgfls) error=%d\n", - port->unit,port->pnum,error); - - /* silently clean the buffer */ - - bc->tout=bc->tin=0; - bc->iempty=0; - hidewin(sc); - return; - } - - lasttail=tail; - tail=bc->tout; - head=bc->tin; - } - hidewin(sc); - DPRINT5(DB_WR,"dgb%d: port%d: flush: head=%d tail=%d\n", - port->unit, port->pnum, head, tail); -} - -static int -dgbparam(tp, t) - struct tty *tp; - struct termios *t; -{ - int unit=MINOR_TO_UNIT(minor(tp->t_dev)); - int pnum=MINOR_TO_PORT(minor(tp->t_dev)); - struct dgb_softc *sc=&dgb_softc[unit]; - struct dgb_p *port=&sc->ports[pnum]; - volatile struct board_chan *bc=port->brdchan; - int cflag; - int head; - int mval; - int iflag; - int hflow; - - lwkt_gettoken(&tty_token); - BoardMemWinState ws=bmws_get(); - - DPRINT6(DB_PARAM,"dgb%d: port%d: dgbparm c=0x%x i=0x%x l=0x%x\n",unit,pnum,t->c_cflag,t->c_iflag,t->c_lflag); - - if(port->mustdrain) { - DPRINT3(DB_PARAM,"dgb%d: port%d: must call dgbdrain()\n",unit,pnum); - dgbdrain(port); - } - - cflag=ttspeedtab(t->c_ospeed, dgbspeedtab); - - if (t->c_ispeed == 0) - t->c_ispeed = t->c_ospeed; - - if (cflag < 0 /* || cflag > 0 && t->c_ispeed != t->c_ospeed */) { - DPRINT4(DB_PARAM,"dgb%d: port%d: invalid cflag=0%o\n",unit,pnum,cflag); - lwkt_reltoken(&tty_token); - return (EINVAL); - } - - crit_enter(); - setwin(sc,0); - - if(cflag==0) { /* hangup */ - DPRINT3(DB_PARAM,"dgb%d: port%d: hangup\n",unit,pnum); - head=bc->rin; - bc->rout=head; - head=bc->tin; - fepcmd(port, STOUT, (unsigned)head, 0, 0, 0); - mval= port->omodem & ~(DTR|RTS); - } else { - cflag |= dgbflags(dgb_cflags, t->c_cflag); - - if(cflag!=port->fepcflag) { - port->fepcflag=cflag; - DPRINT5(DB_PARAM,"dgb%d: port%d: set cflag=0x%x c=0x%x\n", - unit,pnum,cflag,t->c_cflag&~CRTSCTS); - fepcmd(port, SETCTRLFLAGS, (unsigned)cflag, 0, 0, 0); - } - mval= port->omodem | (DTR|RTS); - } - - iflag=dgbflags(dgb_iflags, t->c_iflag); - if(iflag!=port->fepiflag) { - port->fepiflag=iflag; - DPRINT5(DB_PARAM,"dgb%d: port%d: set iflag=0x%x c=0x%x\n",unit,pnum,iflag,t->c_iflag); - fepcmd(port, SETIFLAGS, (unsigned)iflag, 0, 0, 0); - } - - bc->mint=port->dcd; - - hflow=dgbflags(dgb_flow, t->c_cflag); - if(hflow!=port->hflow) { - port->hflow=hflow; - DPRINT5(DB_PARAM,"dgb%d: port%d: set hflow=0x%x f=0x%x\n",unit,pnum,hflow,t->c_cflag&CRTSCTS); - fepcmd(port, SETHFLOW, (unsigned)hflow, 0xff, 0, 1); - } - - if(port->omodem != mval) { - DPRINT5(DB_PARAM,"dgb%d: port%d: setting modem parameters 0x%x was 0x%x\n", - unit,pnum,mval,port->omodem); - port->omodem=mval; - fepcmd(port, SETMODEM, (unsigned)mval, RTS|DTR, 0, 1); - } - - if(port->fepstartc!=t->c_cc[VSTART] || port->fepstopc!=t->c_cc[VSTOP]) { - DPRINT5(DB_PARAM,"dgb%d: port%d: set startc=%d, stopc=%d\n",unit,pnum,t->c_cc[VSTART],t->c_cc[VSTOP]); - port->fepstartc=t->c_cc[VSTART]; - port->fepstopc=t->c_cc[VSTOP]; - fepcmd(port, SONOFFC, port->fepstartc, port->fepstopc, 0, 1); - } - - bmws_set(ws); - crit_exit(); - - lwkt_reltoken(&tty_token); - return 0; - -} - -static void -dgbstart(tp) - struct tty *tp; -{ - int unit; - int pnum; - struct dgb_p *port; - struct dgb_softc *sc; - volatile struct board_chan *bc; - int head, tail; - int size, ocount; - int wmask; - - lwkt_gettoken(&tty_token); - BoardMemWinState ws=bmws_get(); - - unit=MINOR_TO_UNIT(minor(tp->t_dev)); - pnum=MINOR_TO_PORT(minor(tp->t_dev)); - sc=&dgb_softc[unit]; - port=&sc->ports[pnum]; - bc=port->brdchan; - - wmask=port->txbufsize-1; - - crit_enter(); - - while( tp->t_outq.c_cc!=0 ) { - int cs; -#ifndef TS_ASLEEP /* post 2.0.5 FreeBSD */ - ttwwakeup(tp); -#else - if(tp->t_outq.c_cc <= tp->t_lowat) { - if(tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup(TSA_OLOWAT(tp)); - } - /*selwakeup(&tp->t_wsel);*/ - } -#endif - crit_exit(); - setwin(sc,0); - - head=bc->tin & wmask; - - do { tail=bc->tout; } while (tail != bc->tout); - tail=bc->tout & wmask; - - DPRINT5(DB_WR,"dgb%d: port%d: s tx head=%d tail=%d\n",unit,pnum,head,tail); - -#ifdef LEAVE_FREE_CHARS - if(tail>head) { - size=tail-head-LEAVE_FREE_CHARS; - if (size <0) - size=0; - } else { - size=port->txbufsize-head; - if(tail+port->txbufsize < head) - size=0; - } - } -#else - if(tail>head) - size=tail-head-1; - else { - size=port->txbufsize-head/*-1*/; - if(tail==0) - size--; - } -#endif - - if(size==0) { - bc->iempty=1; bc->ilow=1; - crit_exit(); - bmws_set(ws); - tp->t_state|=TS_BUSY; - crit_exit(); - lwkt_reltoken(&tty_token); - return; - } - - towin(sc,port->txwin); - - ocount=q_to_b(&tp->t_outq, __DEVOLATILE(u_char *, port->txptr+head), size); - head+=ocount; - if(head>=port->txbufsize) - head-=port->txbufsize; - - setwin(sc,0); - bc->tin=head; - - DPRINT5(DB_WR,"dgb%d: port%d: tx avail=%d count=%d\n",unit,pnum,size,ocount); - hidewin(sc); - crit_exit(); - } - - bmws_set(ws); - crit_exit(); - -#ifndef TS_ASLEEP /* post 2.0.5 FreeBSD */ - if(tp->t_state & TS_BUSY) { - tp->t_state&=~TS_BUSY; - linesw[tp->t_line].l_start(tp); - ttwwakeup(tp); - } -#else - if(tp->t_state & TS_ASLEEP) { - tp->t_state &= ~TS_ASLEEP; - wakeup(TSA_OLOWAT(tp)); - } - tp->t_state&=~TS_BUSY; -#endif - lwkt_reltoken(&tty_token); -} - -void -dgbstop(tp, rw) - struct tty *tp; - int rw; -{ - int unit; - int pnum; - struct dgb_p *port; - struct dgb_softc *sc; - volatile struct board_chan *bc; - - lwkt_gettoken(&tty_token); - BoardMemWinState ws=bmws_get(); - - unit=MINOR_TO_UNIT(minor(tp->t_dev)); - pnum=MINOR_TO_PORT(minor(tp->t_dev)); - - sc=&dgb_softc[unit]; - port=&sc->ports[pnum]; - bc=port->brdchan; - - DPRINT3(DB_WR,"dgb%d: port%d: stop\n",port->unit, port->pnum); - - crit_enter(); - setwin(sc,0); - - if (rw & FWRITE) { - /* clear output queue */ - bc->tout=bc->tin=0; - bc->ilow=0;bc->iempty=0; - } - if (rw & FREAD) { - /* clear input queue */ - bc->rout=bc->rin; - bc->idata=1; - } - hidewin(sc); - bmws_set(ws); - crit_exit(); - dgbstart(tp); - lwkt_reltoken(&tty_token); -} - -/* - * NOTE: Must be called with tty_token held - */ -static void -fepcmd(port, cmd, op1, op2, ncmds, bytecmd) - struct dgb_p *port; - unsigned cmd, op1, op2, ncmds, bytecmd; -{ - struct dgb_softc *sc=&dgb_softc[port->unit]; - u_char *mem=sc->vmem; - unsigned tail, head; - int count, n; - - ASSERT_LWKT_TOKEN_HELD(&tty_token); - - if(port->status==DISABLED) { - kprintf("dgb%d: port%d: FEP command on disabled port\n", - port->unit, port->pnum); - return; - } - - /* setwin(sc,0); Require this to be set by caller */ - head=sc->mailbox->cin; - - if(head>=(FEP_CMAX-FEP_CSTART) || (head & 3)) { - kprintf("dgb%d: port%d: wrong pointer head of command queue : 0x%x\n", - port->unit, port->pnum, head); - return; - } - - mem[head+FEP_CSTART+0]=cmd; - mem[head+FEP_CSTART+1]=port->pnum; - if(bytecmd) { - mem[head+FEP_CSTART+2]=op1; - mem[head+FEP_CSTART+3]=op2; - } else { - mem[head+FEP_CSTART+2]=op1&0xff; - mem[head+FEP_CSTART+3]=(op1>>8)&0xff; - } - - DPRINT7(DB_FEP,"dgb%d: port%d: %s cmd=0x%x op1=0x%x op2=0x%x\n", port->unit, port->pnum, - (bytecmd)?"byte":"word", cmd, mem[head+FEP_CSTART+2], mem[head+FEP_CSTART+3]); - - head=(head+4) & (FEP_CMAX-FEP_CSTART-4); - sc->mailbox->cin=head; - - count=FEPTIMEOUT; - - while (count-- != 0) { - head=sc->mailbox->cin; - tail=sc->mailbox->cout; - - n = (head-tail) & (FEP_CMAX-FEP_CSTART-4); - if(n <= ncmds * (sizeof(ushort)*4)) - return; - } - kprintf("dgb%d(%d): timeout on FEP cmd=0x%x\n", port->unit, port->pnum, cmd); -} - -static void -disc_optim(tp, t) - struct tty *tp; - struct termios *t; -{ - lwkt_gettoken(&tty_token); - if (!(t->c_iflag & (ICRNL | IGNCR | IMAXBEL | INLCR | ISTRIP | IXON)) - && (!(t->c_iflag & BRKINT) || (t->c_iflag & IGNBRK)) - && (!(t->c_iflag & PARMRK) - || (t->c_iflag & (IGNPAR | IGNBRK)) == (IGNPAR | IGNBRK)) - && !(t->c_lflag & (ECHO | ICANON | IEXTEN | ISIG | PENDIN)) - && linesw[tp->t_line].l_rint == ttyinput) - tp->t_state |= TS_CAN_BYPASS_L_RINT; - else - tp->t_state &= ~TS_CAN_BYPASS_L_RINT; - lwkt_reltoken(&tty_token); -} diff --git a/sys/platform/pc32/gnu/isa/dgbios.h b/sys/platform/pc32/gnu/isa/dgbios.h deleted file mode 100644 index 02dd6bb94d..0000000000 --- a/sys/platform/pc32/gnu/isa/dgbios.h +++ /dev/null @@ -1,175 +0,0 @@ -static unsigned char pcxx_bios[] = { - 0x28,0x43,0x29,0x20,0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68, - 0x74,0x20,0x31,0x39,0x39,0x34,0x2c,0x20,0x44,0x69,0x67,0x69, - 0x42,0x6f,0x61,0x72,0x64,0x20,0x49,0x6e,0x63,0x2e,0x00,0x00, - 0x8a,0xf8,0x8a,0xf8,0x15,0xf9,0x8a,0xf8,0x8a,0xf8,0x8a,0xf8, - 0x8a,0xf8,0x8a,0xf8,0xbc,0xf8,0x8a,0xf8,0x96,0xf8,0x96,0xf8, - 0x96,0xf8,0x96,0xf8,0x96,0xf8,0x96,0xf8,0x8a,0xf8,0x8a,0xf8, - 0x96,0xf8,0x96,0xf8,0x8a,0xf8,0xad,0xf8,0xb0,0xf8,0x8a,0xf8, - 0x8a,0xf8,0x8a,0xf8,0x8a,0xf8,0x8a,0xf8,0x8a,0xf8,0x8a,0xf8, - 0x8a,0xf8,0x8a,0xf8,0x8a,0xf8,0x04,0x02,0x00,0x02,0x14,0x02, - 0x10,0x02,0x24,0x02,0x20,0x02,0x34,0x02,0x30,0x02,0x44,0x02, - 0x40,0x02,0x54,0x02,0x50,0x02,0x64,0x02,0x60,0x02,0x74,0x02, - 0x70,0x02,0x04,0x01,0x00,0x01,0x1e,0x2e,0x8e,0x1e,0x22,0xf8, - 0xfe,0x06,0x70,0x00,0x1f,0xcf,0x1e,0x50,0x52,0x2e,0x8e,0x1e, - 0x22,0xf8,0xfe,0x06,0x71,0x00,0xb8,0x00,0x80,0xba,0x22,0xff, - 0xef,0x5a,0x58,0x1f,0xcf,0xb4,0x80,0xcf,0x1e,0x2e,0x8e,0x1e, - 0x22,0xf8,0xfe,0x06,0x2b,0x00,0x1f,0xcf,0x1e,0x52,0x50,0x2e, - 0x8e,0x1e,0x22,0xf8,0xcd,0x16,0xfe,0x06,0x2a,0x00,0x80,0x3e, - 0x2a,0x00,0x12,0x72,0x39,0xc6,0x06,0x2a,0x00,0x00,0xfe,0x06, - 0x29,0x00,0x80,0x3e,0x29,0x00,0x3c,0x72,0x29,0xc6,0x06,0x29, - 0x00,0x00,0xfe,0x06,0x28,0x00,0x80,0x3e,0x28,0x00,0x3c,0x72, - 0x19,0xc6,0x06,0x28,0x00,0x00,0xfe,0x06,0x27,0x00,0x80,0x3e, - 0x27,0x00,0x18,0x72,0x09,0xc6,0x06,0x27,0x00,0x00,0xff,0x06, - 0x25,0x00,0xba,0x22,0xff,0xb8,0x00,0x80,0xef,0x58,0x5a,0x1f, - 0xcf,0x60,0x1e,0x06,0xfc,0x2e,0x8e,0x06,0x22,0xf8,0x2e,0x8e, - 0x1e,0x22,0xf8,0x8d,0x36,0x40,0x00,0xad,0x3c,0x3f,0x7f,0x22, - 0x3c,0x1f,0x7f,0x22,0x32,0xe4,0xd1,0xe0,0x3d,0x16,0x00,0x90, - 0x73,0x14,0xbb,0x56,0xf9,0x03,0xd8,0x2e,0xff,0x17,0x8d,0x36, - 0x40,0x00,0xb0,0x00,0x89,0x04,0x07,0x1f,0x61,0xcf,0xb4,0x80, - 0xeb,0xf0,0xcd,0x15,0xeb,0xec,0x6c,0xf9,0x79,0xf9,0xb9,0xf9, - 0xd3,0xf9,0xd8,0xf9,0xe1,0xf9,0xe9,0xf9,0xf2,0xf9,0xfa,0xf9, - 0xfd,0xf9,0x2a,0xfa,0xe4,0x00,0x24,0xf7,0xe6,0x00,0x0c,0x08, - 0xe6,0x00,0xb4,0x00,0xc3,0x1e,0xad,0x8b,0xd8,0xad,0x8e,0xdb, - 0x8b,0xf0,0x33,0xdb,0x8b,0x07,0x3d,0x4f,0x53,0x75,0x2a,0x8a, - 0x47,0x02,0x32,0xe4,0x86,0xc4,0x8b,0xc8,0x32,0xc0,0x02,0x07, - 0x43,0xe2,0xfb,0x0a,0xc0,0x75,0x16,0x8c,0xd9,0x1f,0x89,0x0e, - 0x2e,0x00,0x89,0x36,0x2c,0x00,0x8d,0x1e,0x02,0x00,0xc7,0x07, - 0x45,0x4d,0x32,0xe4,0xc3,0x1f,0xb4,0x80,0xc3,0xad,0x8b,0xd8, - 0xad,0x8b,0xd0,0xad,0x8e,0xc0,0xad,0x8b,0xf8,0xad,0x8b,0xc8, - 0x8b,0xf2,0x1e,0x8e,0xdb,0xf3,0xa4,0x1f,0x32,0xe4,0xc3,0xea, - 0xf0,0xff,0x00,0xf0,0xad,0x8b,0xd0,0xec,0x88,0x04,0x32,0xe4, - 0xc3,0xad,0x8b,0xd0,0xac,0xee,0x32,0xe4,0xc3,0xad,0x8b,0xd0, - 0xed,0x89,0x04,0x32,0xe4,0xc3,0xad,0x8b,0xd0,0xad,0xef,0x32, - 0xe4,0xc3,0xb4,0x80,0xc3,0xac,0x3c,0x12,0x7f,0x25,0xfe,0xc8, - 0x32,0xe4,0xd1,0xe0,0x8d,0x1e,0x66,0xf8,0x03,0xd8,0x2e,0x8b, - 0x17,0xec,0xac,0x3c,0x0f,0x7f,0x10,0x3c,0x00,0x74,0x03,0xee, - 0x90,0x90,0xec,0x8b,0xfe,0x1e,0x07,0xaa,0x32,0xe4,0xc3,0xb4, - 0x80,0xc3,0xac,0x3c,0x12,0x7f,0x1f,0xfe,0xc8,0x32,0xe4,0xd1, - 0xe0,0x8d,0x1e,0x66,0xf8,0x03,0xd8,0x2e,0x8b,0x17,0xec,0xac, - 0x3c,0x0f,0x7f,0x0a,0x3c,0x00,0x74,0x01,0xee,0xac,0xee,0x32, - 0xe4,0xc3,0xb4,0x80,0xc3,0xfc,0x8e,0xc0,0xb8,0xff,0xff,0x8b, - 0xcb,0x33,0xff,0xf3,0xab,0x8b,0xcb,0x33,0xff,0xf3,0xaf,0xe3, - 0x01,0xc3,0x8b,0xcb,0xbf,0x00,0x00,0x26,0x89,0x3d,0x83,0xc7, - 0x02,0xe2,0xf8,0xbe,0x00,0x00,0x8b,0xcb,0x26,0x8b,0x3c,0x3b, - 0xfe,0x74,0x01,0xc3,0x83,0xc6,0x02,0x83,0xc7,0x02,0xe2,0xf0, - 0x33,0xc0,0x8b,0xcb,0x33,0xff,0xf3,0xab,0x8b,0xcb,0x33,0xff, - 0xf3,0xaf,0xc3,0x32,0xc0,0x26,0x80,0x3e,0x23,0x00,0x00,0x74, - 0x02,0x0c,0x01,0x26,0xf7,0x06,0x20,0x00,0x0f,0x00,0x74,0x02, - 0x0c,0x02,0x26,0xf7,0x06,0x20,0x00,0xf0,0x00,0x74,0x02,0x0c, - 0x04,0x26,0xf7,0x06,0x20,0x00,0x00,0xff,0x74,0x02,0x0c,0x08, - 0x26,0xa2,0x24,0x00,0xb8,0x00,0x40,0xba,0x5e,0xff,0xef,0xba, - 0x66,0xff,0xef,0xba,0x52,0xff,0xb8,0x63,0x0e,0xef,0xba,0x56, - 0xff,0xb8,0x05,0xe0,0xef,0xba,0x28,0xff,0xb8,0xfc,0x00,0xef, - 0xb8,0x00,0x02,0x26,0xa3,0x2e,0x00,0xb8,0x04,0x00,0x26,0xa3, - 0x2c,0x00,0xb0,0xc3,0xe6,0x08,0x8a,0xd8,0xe4,0x08,0x3a,0xc3, - 0x75,0x06,0x26,0xc6,0x06,0xb4,0x00,0x01,0xb0,0x00,0xe6,0x00, - 0xfc,0x8d,0x3e,0x00,0x00,0xb8,0x47,0x44,0xab,0xb8,0xff,0xff, - 0xab,0xab,0xab,0xb8,0x42,0x49,0xab,0xb8,0x4f,0x53,0xab,0xb8, - 0x58,0x69,0x26,0x80,0x3e,0x10,0x00,0x04,0x74,0x0e,0xb8,0x58, - 0x65,0x26,0x80,0x3e,0x10,0x00,0x03,0x74,0x03,0xb8,0x58,0x74, - 0xab,0x8d,0x36,0xfe,0xff,0x8a,0x04,0x8d,0x36,0xff,0xff,0x8a, - 0x24,0xab,0xfb,0x26,0x81,0x0e,0x12,0x00,0x00,0x08,0x06,0x1f, - 0xa1,0x00,0x00,0x8b,0x1e,0x02,0x00,0x3d,0x44,0x47,0x75,0x0b, - 0x26,0x81,0x0e,0x12,0x00,0x00,0x10,0xff,0x2e,0x2c,0x00,0x81, - 0xfb,0x45,0x4d,0x75,0xe3,0x26,0x81,0x0e,0x12,0x00,0x00,0x20, - 0xff,0x2e,0x2c,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff,0xfa,0xba,0xa8,0xff,0xb8,0xba,0x81,0xef, - 0xba,0xa4,0xff,0xb8,0x3a,0x00,0xef,0x90,0xe4,0x00,0xa8,0x60, - 0x75,0x0c,0x24,0x06,0x74,0x14,0x3c,0x02,0x74,0x1c,0x3c,0x04, - 0x74,0x24,0xbb,0x38,0xc0,0xbe,0xf8,0x81,0xbf,0xba,0xa0,0xeb, - 0x22,0x90,0xbb,0x38,0xf0,0xbe,0xf8,0x41,0xbf,0xba,0x81,0xeb, - 0x16,0x90,0xbb,0x38,0xf0,0xbe,0xf8,0xe1,0xbf,0xba,0x88,0xeb, - 0x0a,0x90,0xbb,0x38,0xc0,0xbe,0xf8,0x41,0xbf,0xba,0x81,0xba, - 0xa0,0xff,0x8b,0xc3,0xef,0xba,0xa2,0xff,0xb8,0xf8,0x0f,0xef, - 0xba,0xa6,0xff,0x8b,0xc6,0xef,0xba,0xa8,0xff,0x8b,0xc7,0xef, - 0x8c,0xc8,0x8e,0xd8,0xe4,0x00,0x24,0x06,0x74,0x17,0xbb,0x00, - 0x80,0xbd,0xc0,0xe0,0x3c,0x02,0x74,0x5a,0xbd,0xc0,0xc0,0x3c, - 0x04,0x74,0x53,0xbd,0xc0,0x80,0xeb,0x4e,0x90,0xb9,0x08,0x00, - 0xb8,0x00,0x80,0x8e,0xc0,0x26,0xa3,0x00,0x00,0x05,0x00,0x10, - 0xe2,0xf5,0xbd,0xc0,0xf0,0xbb,0x00,0x7c,0xb8,0x00,0xe0,0x8e, - 0xc0,0x26,0x8b,0x0e,0x00,0x00,0x3b,0xc8,0x75,0x28,0xbb,0x00, - 0x80,0xbd,0xc0,0xe0,0xb8,0x00,0xc0,0x8e,0xc0,0x26,0x8b,0x0e, - 0x00,0x00,0x3b,0xc8,0x75,0x14,0xbd,0xc0,0xc0,0xb8,0x00,0x80, - 0x8e,0xc0,0x26,0x8b,0x0e,0x00,0x00,0x3b,0xc8,0x75,0x03,0xbd, - 0xc0,0x80,0x8c,0xc8,0x8e,0xd0,0xbc,0xed,0xfc,0x8b,0xc5,0x25, - 0x00,0xf0,0xe9,0x6c,0xfd,0xb4,0x00,0x74,0x06,0xb4,0xff,0xeb, - 0x02,0xe5,0xfc,0x8e,0xc5,0x2e,0x89,0x2e,0x22,0xf8,0xe4,0x00, - 0x24,0x16,0x26,0xa2,0x11,0x00,0x26,0x83,0x0e,0x12,0x00,0x01, - 0x80,0xfc,0x00,0x74,0x06,0x26,0x83,0x0e,0x14,0x00,0x01,0x26, - 0xc7,0x06,0x18,0x00,0x40,0x00,0x26,0xc6,0x06,0x10,0x00,0x03, - 0xa8,0x10,0x74,0x06,0x26,0xc6,0x06,0x10,0x00,0x04,0xb8,0x00, - 0x00,0x8e,0xc0,0xb8,0xaa,0x55,0x26,0xa3,0x00,0x00,0x26,0xc7, - 0x06,0x02,0x00,0x00,0x00,0x26,0xc7,0x06,0x04,0x00,0x00,0x00, - 0x8b,0xcd,0x81,0xe1,0x00,0xf0,0x8e,0xc1,0x26,0x8b,0x1e,0x00, - 0x00,0x3b,0xc3,0x75,0x13,0x8e,0xc5,0x26,0xc6,0x06,0x10,0x00, - 0x05,0xb8,0x40,0x00,0x8e,0xd0,0xbc,0x00,0x04,0xe9,0x99,0x00, - 0x8c,0xc8,0x8e,0xd0,0xbc,0x7c,0xfd,0xb8,0x00,0x00,0xbb,0x00, - 0x20,0xe9,0xdd,0xfc,0xb4,0x00,0x74,0x06,0xb4,0xff,0xeb,0x02, - 0x74,0xfd,0x8e,0xc5,0x80,0xfc,0x00,0x74,0x08,0x26,0x83,0x0e, - 0x14,0x00,0x02,0xeb,0x0d,0x26,0xc7,0x06,0x16,0x00,0x10,0x00, - 0x26,0x83,0x0e,0x12,0x00,0x02,0xb8,0x40,0x00,0x8e,0xd0,0xbc, - 0x00,0x04,0xe4,0x00,0xa8,0x60,0x75,0x07,0xba,0xa2,0xff,0xb8, - 0xfc,0x0f,0xef,0xb8,0x00,0x04,0x8e,0xc0,0xb8,0xaa,0x55,0x26, - 0xa3,0x00,0x00,0x26,0xc7,0x06,0x02,0x00,0x00,0x00,0x26,0xc7, - 0x06,0x04,0x00,0x00,0x00,0xb9,0x00,0x00,0x8e,0xc1,0x26,0x8b, - 0x1e,0x00,0x00,0x3b,0xc3,0x75,0x02,0xeb,0x24,0x8e,0xc5,0x26, - 0x83,0x0e,0x12,0x00,0x04,0xb8,0x00,0x04,0xbb,0x00,0x60,0x06, - 0xe8,0x66,0xfc,0x07,0x75,0x09,0x26,0xc7,0x06,0x16,0x00,0x40, - 0x00,0xeb,0x06,0x26,0x83,0x0e,0x14,0x00,0x04,0x8e,0xc5,0x8c, - 0xc0,0x3d,0xc0,0xf0,0x75,0x03,0xe9,0x9f,0x00,0x3d,0xc0,0x80, - 0x74,0x62,0x3d,0xc0,0xc0,0x74,0x23,0x26,0x83,0x0e,0x12,0x00, - 0x08,0xb8,0x00,0xf0,0xbb,0x00,0x7c,0x06,0xe8,0x2e,0xfc,0x07, - 0x75,0x08,0x26,0x83,0x06,0x18,0x00,0x40,0xeb,0x06,0x26,0x83, - 0x0e,0x14,0x00,0x08,0xeb,0x72,0xb9,0x03,0x00,0xb8,0x00,0xd0, - 0xba,0x08,0x00,0xbb,0x00,0x80,0x3d,0x00,0xf0,0x75,0x03,0xbb, - 0x00,0x7c,0x26,0x09,0x16,0x12,0x00,0x06,0x50,0x51,0xe8,0xfc, - 0xfb,0x59,0x58,0x07,0x75,0x0f,0x26,0x83,0x06,0x18,0x00,0x40, - 0xd1,0xe2,0x05,0x00,0x10,0xe2,0xd8,0xeb,0x05,0x26,0x09,0x16, - 0x14,0x00,0xeb,0x38,0xb9,0x07,0x00,0xb8,0x00,0x90,0xba,0x08, - 0x00,0xbb,0x00,0x80,0x3d,0x00,0xf0,0x75,0x03,0xbb,0x00,0x7c, - 0x26,0x09,0x16,0x12,0x00,0x06,0x50,0x51,0xe8,0xc2,0xfb,0x59, - 0x58,0x07,0x75,0x0f,0x26,0x83,0x06,0x18,0x00,0x40,0xd1,0xe2, - 0x05,0x00,0x10,0xe2,0xd8,0xeb,0x05,0x26,0x09,0x16,0x14,0x00, - 0x26,0xa1,0x18,0x00,0x2d,0x10,0x00,0x26,0xa3,0x1a,0x00,0x06, - 0xfc,0x33,0xff,0x8e,0xc7,0xb9,0x00,0x02,0xb8,0x00,0xf0,0xf3, - 0xab,0x33,0xff,0xbe,0x24,0xf8,0xb9,0x20,0x00,0xa5,0x47,0x47, - 0xe2,0xfb,0xbe,0x64,0xf8,0xb9,0xe0,0x00,0x8b,0x1c,0x26,0x89, - 0x1d,0x83,0xc7,0x04,0xe2,0xf8,0x07,0xba,0x28,0xff,0xb8,0xfd, - 0x00,0xef,0xba,0x32,0xff,0xb8,0x0d,0x00,0xef,0xba,0x34,0xff, - 0xb8,0x0f,0x00,0xef,0xba,0x36,0xff,0xb8,0x0e,0x00,0xef,0xba, - 0x38,0xff,0xb8,0x19,0x00,0xef,0xba,0x3a,0xff,0xb8,0x18,0x00, - 0xef,0xba,0x3c,0xff,0xb8,0x0b,0x00,0xef,0xba,0x3e,0xff,0xb8, - 0x1a,0x00,0xef,0x8d,0x3e,0x90,0x00,0x8d,0x36,0x66,0xf8,0xb9, - 0x10,0x00,0xf3,0xa5,0x8d,0x3e,0xb0,0x00,0x8d,0x36,0x86,0xf8, - 0xb9,0x02,0x00,0xf3,0xa5,0xb9,0x10,0x00,0x8d,0x36,0x90,0x00, - 0x83,0xc6,0x1e,0x26,0x8b,0x14,0xb3,0x10,0x32,0xc0,0xec,0xb0, - 0x0c,0xee,0x8a,0xc3,0x8a,0xc3,0xee,0x83,0xee,0x02,0x26,0x8b, - 0x14,0xfe,0xcb,0xe2,0xeb,0xb9,0x10,0x00,0x8d,0x36,0x90,0x00, - 0x26,0x8b,0x14,0xb3,0x01,0xbf,0x00,0x80,0xb0,0x0c,0xee,0xf6, - 0xe8,0xec,0x3a,0xc3,0x75,0x0e,0xd1,0xc7,0x26,0x09,0x3e,0x20, - 0x00,0x26,0xfe,0x06,0x22,0x00,0xeb,0x07,0x33,0xc0,0x26,0x89, - 0x04,0xd1,0xc7,0x83,0xc6,0x02,0x26,0x8b,0x14,0xfe,0xc3,0xe2, - 0xd7,0x26,0xc6,0x06,0x23,0x00,0x01,0x8d,0x36,0xb0,0x00,0x26, - 0x8b,0x14,0x32,0xc0,0xee,0xb0,0x0c,0xee,0xb0,0x5a,0xee,0xb0, - 0x0c,0xee,0xf6,0xe8,0xec,0x3c,0x5a,0x74,0x14,0x26,0xc7,0x06, - 0xb0,0x00,0x00,0x00,0x26,0xc7,0x06,0xb2,0x00,0x00,0x00,0x26, - 0xc6,0x06,0x23,0x00,0x00,0xe9,0xd3,0xfa,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0xea,0x00,0xfc,0x00,0xf0,0x4d,0x2f,0x50, - 0x43,0x2f,0x58,0x2a,0x39,0x34,0x34,0x31 -}; - -static unsigned pcxx_nbios=sizeof(pcxx_bios); diff --git a/sys/platform/pc32/gnu/isa/dgfep.h b/sys/platform/pc32/gnu/isa/dgfep.h deleted file mode 100644 index 9ed4f7d218..0000000000 --- a/sys/platform/pc32/gnu/isa/dgfep.h +++ /dev/null @@ -1,516 +0,0 @@ -static unsigned char pcxx_cook[] = { - 0x4f,0x53,0x18,0x80,0xe9,0xbf,0x15,0x00,0x40,0x28,0x23,0x29, - 0x46,0x45,0x50,0x4f,0x53,0x20,0x37,0x2e,0x30,0x38,0x20,0x34, - 0x2f,0x32,0x30,0x2f,0x39,0x35,0x00,0x40,0x28,0x23,0x29,0x28, - 0x43,0x29,0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20, - 0x31,0x39,0x38,0x39,0x2d,0x31,0x39,0x39,0x35,0x20,0x44,0x69, - 0x67,0x69,0x42,0x6f,0x61,0x72,0x64,0x20,0x49,0x6e,0x63,0x2e, - 0x00,0xcb,0x0c,0xcb,0x0c,0xe2,0x0c,0xcb,0x0c,0xcb,0x0c,0xcb, - 0x0c,0xcb,0x0c,0xcb,0x0c,0x57,0x0c,0xcb,0x0c,0xcb,0x0c,0xcb, - 0x0c,0x53,0x0b,0xcb,0x0c,0xcb,0x0c,0x42,0x0b,0xcb,0x0c,0xcb, - 0x0c,0x12,0x0d,0xcb,0x0c,0xcb,0x0c,0xcb,0x0c,0xcb,0x0c,0xcb, - 0x0c,0xcb,0x0c,0xcb,0x0c,0xcb,0x0c,0xcb,0x0c,0xcb,0x0c,0xcb, - 0x0c,0xcb,0x0c,0xcb,0x0c,0x00,0x10,0x80,0x10,0x00,0x11,0x80, - 0x11,0x00,0x12,0x80,0x12,0x00,0x13,0x80,0x13,0x00,0x14,0x80, - 0x14,0x00,0x15,0x80,0x15,0x00,0x16,0x80,0x16,0x00,0x17,0x80, - 0x17,0x78,0x0b,0xb9,0x0b,0x50,0x0c,0xb9,0x0b,0x8d,0x0b,0x8d, - 0x0b,0x8d,0x0b,0x8d,0x0b,0xc0,0x0b,0xc0,0x0b,0xc0,0x0b,0xc0, - 0x0b,0x8d,0x0b,0x8d,0x0b,0x8d,0x0b,0x8d,0x0b,0x50,0x0c,0xb9, - 0x0b,0x50,0x0c,0xb9,0x0b,0x8d,0x0b,0x8d,0x0b,0x8d,0x0b,0x8d, - 0x0b,0xc0,0x0b,0xc0,0x0b,0xc0,0x0b,0xc0,0x0b,0x8d,0x0b,0x8d, - 0x0b,0x8d,0x0b,0x8d,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94, - 0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94, - 0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94, - 0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94, - 0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94, - 0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x94,0x0b,0x16,0x00,0xfe, - 0x11,0xfe,0x0b,0x2c,0x08,0xb5,0x06,0xfe,0x05,0x7e,0x04,0xfe, - 0x02,0x7e,0x01,0xbe,0x00,0x7e,0x00,0x5e,0x00,0x2e,0x00,0x16, - 0x00,0x0a,0x00,0x04,0x00,0x16,0x00,0x02,0x00,0x01,0x00,0x00, - 0x00,0x0e,0x00,0x06,0x00,0x7e,0x04,0xfe,0x02,0x7e,0x01,0xbe, - 0x00,0x7e,0x00,0x5e,0x00,0x2e,0x00,0x16,0x00,0x0a,0x00,0x04, - 0x00,0x18,0x00,0x86,0x13,0x03,0x0d,0xdf,0x08,0x41,0x07,0x81, - 0x06,0xe0,0x04,0x3f,0x03,0x9f,0x01,0xce,0x00,0x89,0x00,0x66, - 0x00,0x32,0x00,0x18,0x00,0x0b,0x00,0x0b,0x00,0x18,0x00,0x0b, - 0x00,0x0b,0x00,0x0b,0x00,0x41,0x07,0x81,0x06,0xe0,0x04,0x3f, - 0x03,0x9f,0x01,0xce,0x00,0x89,0x00,0x66,0x00,0x32,0x00,0x18, - 0x00,0x0b,0x00,0x0b,0x00,0x00,0x80,0x40,0xc0,0x1f,0x3f,0x7f, - 0xff,0x00,0x04,0x02,0x06,0x08,0x0c,0x0a,0x0e,0x00,0x04,0x02, - 0x06,0x08,0x0c,0x0a,0x0e,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0, - 0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0x1e,0x06,0x3e, - 0x06,0xef,0x06,0xf8,0x05,0x0e,0x06,0x55,0x07,0xa0,0x08,0xa0, - 0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0, - 0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0, - 0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1, - 0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1, - 0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1, - 0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0xa1, - 0x05,0xa1,0x05,0xa1,0x05,0xa1,0x05,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x5b,0x05,0xea,0x05,0xea,0x05,0xea, - 0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea, - 0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea, - 0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea, - 0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea,0x05,0xea,0x05,0x69, - 0x05,0x77,0x05,0x85,0x05,0x93,0x05,0xa0,0x08,0xa0,0x08,0xa0, - 0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0, - 0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0, - 0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0, - 0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0, - 0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0,0x08,0xa0, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d,0x08,0x9d, - 0x08,0x00,0x00,0xfa,0x8a,0x5c,0x50,0xf6,0xc3,0x0e,0x75,0x3c, - 0xf6,0xc3,0x40,0x75,0x16,0xf6,0xc3,0x10,0x74,0x26,0xf6,0xc3, - 0x01,0x75,0x13,0xf6,0xc3,0x20,0x75,0x15,0xc7,0x04,0xb6,0x04, - 0xe9,0xcf,0x00,0x8b,0x44,0x02,0x89,0x04,0xff,0xe0,0xc7,0x04, - 0x03,0x05,0xe9,0x0e,0x01,0xc7,0x04,0x66,0x08,0xe9,0x6a,0x04, - 0xf6,0xc3,0x20,0x74,0x1a,0xc7,0x04,0xb3,0x08,0xe9,0xab,0x04, - 0x8b,0x54,0x20,0xec,0x8a,0xc8,0xf6,0xc3,0x02,0x75,0x42,0xf6, - 0xc3,0x08,0x75,0x0e,0xeb,0x69,0x90,0xc7,0x04,0x20,0x04,0xfb, - 0x81,0xc6,0x80,0x00,0xff,0x24,0xf6,0xc1,0x04,0x74,0x27,0x80, - 0x64,0x50,0xf7,0xf6,0x44,0x51,0x02,0x74,0x13,0xf6,0x44,0x29, - 0x10,0x74,0x0d,0x8a,0x44,0x5d,0x83,0xc2,0x02,0xee,0x83,0xea, - 0x02,0xe9,0x49,0x04,0x8a,0x44,0x5c,0x83,0xc2,0x02,0xee,0x83, - 0xea,0x02,0xe9,0x3c,0x04,0xf6,0x44,0x50,0x04,0x75,0x28,0x83, - 0x7c,0x24,0xff,0x74,0x1f,0xa1,0x00,0x0e,0x2b,0x44,0x26,0x3d, - 0x64,0x00,0x77,0x14,0xb0,0x05,0xee,0x8a,0x44,0x75,0x24,0xef, - 0x88,0x44,0x75,0xee,0x80,0x64,0x50,0xfd,0x80,0x64,0x4b,0xfd, - 0xe9,0x0e,0x04,0xb0,0x01,0xee,0x90,0x90,0x90,0xec,0xa8,0x01, - 0x74,0x25,0xb0,0x05,0xee,0x8a,0x44,0x75,0x0c,0x10,0x88,0x44, - 0x75,0xee,0xa1,0x00,0x0e,0x03,0x44,0x24,0x89,0x44,0x26,0x80, - 0x64,0x50,0xfb,0x80,0x64,0x4b,0xfb,0x80,0x4c,0x50,0x02,0x80, - 0x4c,0x4b,0x02,0xe9,0xdb,0x03,0xfa,0x8b,0x54,0x20,0xec,0x8a, - 0xc8,0x22,0x44,0x52,0x3a,0x44,0x53,0x75,0x19,0x8b,0x7c,0x0c, - 0x3b,0x7c,0x0a,0x74,0x18,0x8e,0x44,0x08,0x26,0x8a,0x05,0x47, - 0x23,0x7c,0x0e,0x89,0x7c,0x0c,0x83,0xc2,0x02,0xee,0xfb,0x81, - 0xc6,0x80,0x00,0xff,0x24,0xb0,0x01,0xee,0x90,0x90,0x90,0xec, - 0xa8,0x01,0x74,0x0c,0x80,0x64,0x50,0xef,0x80,0x64,0x4b,0xef, - 0xc7,0x04,0xc3,0x03,0xfb,0x81,0xc6,0x80,0x00,0xff,0x24,0xfa, - 0x8b,0x54,0x20,0xec,0x8a,0xc8,0x22,0x44,0x52,0x3a,0x44,0x53, - 0x75,0x3a,0x8b,0x7c,0x0c,0x3b,0x7c,0x0a,0x74,0x1b,0x8e,0x44, - 0x08,0x26,0x8a,0x05,0x47,0x23,0x7c,0x0e,0x89,0x7c,0x0c,0x8a, - 0xd8,0x22,0x5c,0x62,0x32,0xff,0x03,0xdb,0x2e,0xff,0xa7,0xc1, - 0x01,0xb0,0x01,0xee,0x90,0x90,0x90,0xec,0xa8,0x01,0x74,0x0c, - 0x80,0x64,0x50,0xef,0x80,0x64,0x4b,0xef,0xc7,0x04,0xc3,0x03, - 0xf6,0xc1,0x01,0x75,0x07,0xfb,0x81,0xc6,0x80,0x00,0xff,0x24, - 0xe9,0x61,0x03,0xf6,0x44,0x2a,0x01,0x75,0x03,0xe9,0x39,0x03, - 0xb0,0x27,0xeb,0x42,0x90,0xf6,0x44,0x2a,0x01,0x75,0x03,0xe9, - 0x2b,0x03,0xb0,0x28,0xeb,0x34,0x90,0xf6,0x44,0x2a,0x01,0x75, - 0x03,0xe9,0x1d,0x03,0xb0,0x21,0xeb,0x26,0x90,0xf6,0x44,0x2a, - 0x01,0x75,0x03,0xe9,0x0f,0x03,0xb0,0x29,0xeb,0x18,0x90,0xf6, - 0x44,0x2a,0x01,0x75,0x03,0xe9,0x01,0x03,0xb0,0x5e,0xeb,0x0a, - 0x90,0xf6,0x44,0x2a,0x01,0x75,0x03,0xe9,0xf3,0x02,0x88,0x44, - 0x61,0xb0,0x5c,0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0x80,0x4c, - 0x50,0x40,0xc7,0x04,0xc6,0x05,0xc7,0x44,0x02,0xc6,0x05,0xe9, - 0xcb,0x02,0xfa,0x8b,0x54,0x20,0xec,0x8a,0xc8,0x22,0x44,0x52, - 0x3a,0x44,0x53,0x75,0x12,0x80,0x64,0x50,0xbf,0xc7,0x04,0x03, - 0x05,0x83,0x44,0x30,0x02,0x8a,0x44,0x61,0xe9,0xb9,0x02,0xe9, - 0xa7,0x02,0xf6,0x44,0x2a,0x02,0x75,0x03,0xe9,0xaa,0x02,0x2c, - 0x20,0xe9,0xa5,0x02,0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0xf6, - 0x44,0x2b,0x40,0x75,0x03,0xe9,0x89,0x02,0xb8,0x7f,0x00,0xe9, - 0x9b,0x01,0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0xf6,0x44,0x2b, - 0x80,0x75,0xed,0xe9,0x73,0x02,0x83,0xc2,0x02,0xee,0x83,0xea, - 0x02,0xf7,0x44,0x30,0xff,0xff,0x74,0x03,0xff,0x4c,0x30,0xf6, - 0x44,0x2b,0x20,0x75,0x03,0xe9,0x59,0x02,0xb8,0x02,0x00,0xe9, - 0x6b,0x01,0xb3,0x18,0x22,0x5c,0x2b,0x75,0x16,0x83,0xc2,0x02, - 0xee,0x83,0xea,0x02,0x8b,0x44,0x30,0x05,0x08,0x00,0x25,0xf8, - 0xff,0x89,0x44,0x30,0xe9,0x36,0x02,0x80,0xfb,0x18,0x75,0x57, - 0xb0,0x20,0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0x8b,0x44,0x30, - 0x8b,0xd8,0x05,0x08,0x00,0x25,0xf8,0xff,0x89,0x44,0x30,0x2b, - 0xc3,0x48,0x74,0x38,0x89,0x44,0x32,0x80,0x4c,0x50,0x40,0xc7, - 0x44,0x02,0x8f,0x06,0xc7,0x04,0x8f,0x06,0xe9,0x02,0x02,0xfa, - 0x8b,0x54,0x20,0xec,0x8a,0xc8,0x22,0x44,0x52,0x3a,0x44,0x53, - 0x75,0x16,0xb0,0x20,0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0xff, - 0x4c,0x32,0x75,0x08,0x80,0x64,0x50,0xbf,0xc7,0x04,0x03,0x05, - 0xe9,0xda,0x01,0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0x80,0xfb, - 0x08,0x75,0x18,0x8b,0x44,0x30,0x8b,0xd8,0x05,0x08,0x00,0x25, - 0xf8,0xff,0x89,0x44,0x30,0x2b,0xc3,0x3d,0x05,0x00,0x7c,0xdc, - 0xe9,0xce,0x00,0x8b,0x44,0x30,0x8b,0xd8,0x05,0x08,0x00,0x25, - 0xf8,0xff,0x89,0x44,0x30,0xb8,0x02,0x00,0xe9,0xba,0x00,0xf6, - 0x44,0x2a,0x20,0x75,0x43,0xf6,0x44,0x2a,0x04,0x74,0x42,0xf6, - 0x44,0x2a,0x10,0x74,0x07,0xf7,0x44,0x30,0xff,0xff,0x74,0x30, - 0xb0,0x0d,0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0x80,0x4c,0x50, - 0x40,0xc7,0x04,0x21,0x07,0xc7,0x44,0x02,0x21,0x07,0xe9,0x70, - 0x01,0xfa,0x8b,0x54,0x20,0xec,0x8a,0xc8,0x22,0x44,0x52,0x3a, - 0x44,0x53,0x75,0x1c,0x80,0x64,0x50,0xbf,0xc7,0x04,0x03,0x05, - 0xb0,0x0a,0xeb,0x2b,0x90,0xb0,0x0a,0x83,0xc2,0x02,0xee,0x83, - 0xea,0x02,0xf6,0x44,0x2b,0x01,0x75,0x03,0xe9,0x42,0x01,0xb8, - 0x05,0x00,0xeb,0x55,0x90,0xf6,0x44,0x2a,0x08,0x75,0xe2,0xf6, - 0x44,0x2a,0x10,0x74,0x06,0x83,0x7c,0x30,0x00,0x74,0x13,0x83, - 0xc2,0x02,0xee,0x83,0xea,0x02,0xb3,0x06,0x22,0x5c,0x2b,0x75, - 0x08,0xc7,0x44,0x30,0x00,0x00,0xe9,0x14,0x01,0x80,0xfb,0x02, - 0x75,0x14,0x8b,0x44,0x30,0xc1,0xe8,0x04,0x05,0x03,0x00,0x3d, - 0x06,0x00,0x72,0x14,0xb8,0x06,0x00,0xeb,0x0f,0x90,0x80,0xfb, - 0x04,0x75,0x06,0xb8,0x05,0x00,0xeb,0x04,0x90,0xb8,0x09,0x00, - 0xc7,0x44,0x30,0x00,0x00,0xf6,0x44,0x2a,0x40,0x74,0x45,0x3d, - 0x20,0x00,0x77,0x40,0xbb,0x01,0x00,0x3d,0x03,0x00,0x7e,0x03, - 0xbb,0x02,0x00,0x89,0x5c,0x32,0x80,0x4c,0x50,0x40,0xc7,0x44, - 0x02,0xd2,0x07,0xc7,0x04,0xd2,0x07,0xe9,0xbf,0x00,0xfa,0x8b, - 0x54,0x20,0xec,0x8a,0xc8,0x22,0x44,0x52,0x3a,0x44,0x53,0x75, - 0x10,0x8a,0x44,0x60,0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0x83, - 0x6c,0x32,0x01,0x7e,0x50,0xe9,0x9d,0x00,0x05,0x06,0x00,0x03, - 0xc0,0x89,0x44,0x32,0x80,0x4c,0x50,0x40,0xc7,0x44,0x02,0x0c, - 0x08,0xc7,0x04,0x0c,0x08,0xe9,0x85,0x00,0xfa,0x8b,0x54,0x20, - 0xec,0x8a,0xc8,0xb0,0x01,0xee,0x90,0x90,0x90,0xec,0xa8,0x01, - 0x74,0x0f,0xa1,0x00,0x0e,0x01,0x44,0x32,0xc7,0x44,0x02,0x30, - 0x08,0xc7,0x04,0x30,0x08,0xeb,0x62,0x90,0x8b,0x54,0x20,0xec, - 0x8a,0xc8,0xa1,0x00,0x0e,0x2b,0x44,0x32,0x3d,0xe8,0x03,0x77, - 0xec,0x80,0x64,0x50,0xbf,0xc7,0x04,0x03,0x05,0xeb,0x46,0x90, - 0xb0,0x01,0xee,0x90,0x90,0x90,0xec,0xa8,0x01,0x74,0x3a,0x80, - 0x64,0x50,0xef,0x80,0x64,0x4b,0xef,0xc7,0x04,0xb3,0x08,0xeb, - 0x2c,0x90,0xfa,0x8b,0x54,0x20,0xec,0x8a,0xc8,0x22,0x44,0x52, - 0x3a,0x44,0x53,0x75,0x1c,0x8b,0x7c,0x0c,0x3b,0x7c,0x0a,0x74, - 0xcf,0x8e,0x44,0x08,0x26,0x8a,0x05,0x47,0x23,0x7c,0x0e,0x89, - 0x7c,0x0c,0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0xf6,0xc1,0x01, - 0x75,0x26,0xfb,0x81,0xc6,0x80,0x00,0xff,0x24,0xff,0x44,0x30, - 0x83,0xc2,0x02,0xee,0x83,0xea,0x02,0xf6,0xc1,0x01,0x75,0x10, - 0xfb,0x81,0xc6,0x80,0x00,0xff,0x24,0xfa,0x8b,0x54,0x20,0xec, - 0xa8,0x01,0x74,0xda,0xc6,0x44,0x49,0x02,0x8b,0x7c,0x12,0x8e, - 0x44,0x10,0xb0,0x01,0xee,0x90,0x90,0x90,0xec,0x8a,0xe0,0x90, - 0xb0,0x30,0xee,0x83,0xc2,0x02,0x90,0xec,0x83,0xea,0x02,0x23, - 0x44,0x34,0xff,0x64,0x06,0xb3,0x1c,0x22,0x5c,0x51,0x75,0x1a, - 0xf6,0x44,0x29,0x04,0x74,0x21,0xf6,0x44,0x29,0x20,0x75,0x2b, - 0x80,0x7c,0x5e,0x00,0x75,0x1d,0xc7,0x44,0x06,0x58,0x0a,0xe9, - 0x56,0x01,0xf6,0xc3,0x10,0x75,0x2e,0xf6,0xc3,0x04,0x75,0x74, - 0xeb,0x6b,0x90,0xc7,0x44,0x06,0x62,0x0a,0xe9,0x4b,0x01,0xc7, - 0x44,0x06,0x53,0x0a,0xe9,0x34,0x01,0x80,0x7c,0x5e,0x00,0x75, - 0x08,0xc7,0x44,0x06,0xca,0x09,0xe9,0x9d,0x00,0xc7,0x44,0x06, - 0xc5,0x09,0xe9,0x90,0x00,0x0a,0xc0,0x74,0x2a,0xfe,0x4c,0x63, - 0x74,0x1a,0x80,0xe3,0xef,0x75,0xc4,0xf6,0x44,0x29,0x04,0x74, - 0x21,0xf6,0x44,0x29,0x20,0x75,0x21,0x80,0x7c,0x5e,0x00,0x75, - 0x18,0xe9,0x00,0x01,0x80,0x64,0x51,0xef,0x80,0xe3,0xef,0x75, - 0xa6,0xeb,0x85,0x80,0x64,0x51,0xef,0xe9,0x06,0x01,0xe9,0xf5, - 0x00,0xe9,0xe3,0x00,0x80,0x7c,0x5e,0x00,0x75,0x4f,0xeb,0x52, - 0x90,0x80,0x64,0x51,0xf7,0xe9,0xe2,0x00,0x80,0x64,0x53,0x3f, - 0x80,0x64,0x54,0xfe,0x80,0x4c,0x58,0x01,0x80,0x64,0x51,0xfb, - 0xf6,0x44,0x29,0x40,0x75,0x2c,0x3a,0x44,0x5d,0x74,0x27,0x3a, - 0x44,0x5c,0x74,0x22,0xf6,0x44,0x29,0x20,0x74,0x0a,0x3a,0x44, - 0x5a,0x74,0x17,0x3a,0x44,0x5b,0x74,0x12,0xf6,0x44,0x5e,0xff, - 0x74,0x09,0x3a,0x44,0x5e,0x75,0x04,0x80,0x4c,0x51,0x08,0xe9, - 0xa0,0x00,0xe9,0xab,0x00,0x3a,0x44,0x5e,0x74,0x7d,0x3a,0x44, - 0x5c,0x74,0x3d,0x3a,0x44,0x5d,0x74,0x55,0x3a,0x44,0x5a,0x74, - 0x08,0x3a,0x44,0x5b,0x74,0x18,0xe9,0x81,0x00,0xf6,0x44,0x53, - 0x40,0x74,0x07,0x80,0x64,0x53,0xbf,0xe9,0x82,0x00,0x3a,0x44, - 0x5b,0x74,0x03,0xeb,0x7b,0x90,0x80,0x4c,0x53,0x40,0xf6,0x44, - 0x29,0x08,0x74,0x70,0x80,0x4c,0x51,0x04,0xc7,0x44,0x06,0xe1, - 0x08,0xeb,0x65,0x90,0xf6,0x44,0x53,0x80,0x74,0x0f,0x80,0x64, - 0x53,0x7f,0x80,0x64,0x54,0xfe,0x80,0x4c,0x58,0x01,0xeb,0x50, - 0x90,0x3a,0x44,0x5d,0x74,0x03,0xeb,0x48,0x90,0x80,0x4c,0x53, - 0x80,0x80,0x4c,0x54,0x01,0x80,0x4c,0x58,0x01,0xf6,0x44,0x29, - 0x08,0x74,0x35,0x80,0x4c,0x51,0x04,0xc7,0x44,0x06,0xe1,0x08, - 0xeb,0x2a,0x90,0x80,0x4c,0x51,0x08,0xc7,0x44,0x06,0xe1,0x08, - 0xeb,0x10,0x90,0x3a,0x44,0x5e,0x74,0xef,0x3a,0x44,0x5c,0x74, - 0xaf,0x3a,0x44,0x5d,0x74,0xc7,0x3d,0xff,0x00,0x73,0x26,0xaa, - 0x23,0x7c,0x16,0x3b,0x7c,0x14,0x74,0x4f,0xec,0xa8,0x01,0x74, - 0x03,0xe9,0x4e,0xfe,0x89,0x7c,0x12,0x2b,0x7c,0x14,0x23,0x7c, - 0x16,0x3b,0x7c,0x1c,0x73,0x46,0xfb,0x81,0xc6,0x80,0x00,0xff, - 0x24,0x0a,0xe4,0x75,0x1e,0xb3,0x0c,0x22,0x5c,0x28,0x80,0xfb, - 0x08,0x75,0xcc,0xaa,0x23,0x7c,0x16,0x3b,0x7c,0x14,0x74,0x1b, - 0xaa,0x23,0x7c,0x16,0x3b,0x7c,0x14,0x74,0x12,0xeb,0xc1,0xf6, - 0x44,0x28,0x04,0x75,0xbb,0xf6,0x44,0x28,0x08,0x75,0x50,0x32, - 0xc0,0xeb,0xa8,0x4f,0x23,0x7c,0x16,0x89,0x7c,0x12,0xc6,0x44, - 0x59,0x01,0xeb,0xa4,0xf6,0x44,0x51,0x02,0x74,0x07,0xfb,0x81, - 0xc6,0x80,0x00,0xff,0x24,0x80,0x4c,0x51,0x02,0xb0,0x05,0xee, - 0xb0,0x82,0x22,0x44,0x5f,0xf6,0xd0,0x22,0x44,0x75,0x88,0x44, - 0x75,0xee,0xf6,0x44,0x29,0x10,0x74,0x10,0x80,0x4c,0x54,0x04, - 0x80,0x4c,0x58,0x04,0x80,0x74,0x50,0x08,0xc7,0x04,0xc3,0x03, - 0xfb,0x81,0xc6,0x80,0x00,0xff,0x24,0x26,0xc6,0x05,0xff,0x47, - 0x23,0x7c,0x16,0x3b,0x7c,0x14,0x74,0xa7,0x32,0xff,0xf6,0x44, - 0x29,0x80,0x74,0x0a,0x8a,0xdc,0xc0,0xeb,0x04,0x2e,0x8a,0xbf, - 0xb1,0x01,0x26,0x88,0x3d,0x47,0x23,0x7c,0x16,0x3b,0x7c,0x14, - 0x74,0x89,0xaa,0x23,0x7c,0x16,0x3b,0x7c,0x14,0x74,0x80,0xe9, - 0x2e,0xff,0x1e,0x2e,0x8e,0x1e,0xc1,0x03,0xff,0x06,0x1c,0x0e, - 0x60,0xbe,0x00,0x14,0xeb,0x0f,0x90,0x1e,0x2e,0x8e,0x1e,0xc1, - 0x03,0xff,0x06,0x1a,0x0e,0x60,0xbe,0x00,0x10,0xb9,0x08,0x00, - 0x8b,0x54,0x20,0xb0,0x03,0xee,0x90,0x90,0x32,0xff,0xec,0x8a, - 0xd8,0x02,0xd8,0x2e,0xff,0xa7,0xa9,0x00,0x81,0xc6,0x00,0x01, - 0x8b,0x54,0x20,0x0b,0xd2,0xe0,0xe4,0xb8,0x00,0x80,0xba,0x22, - 0xff,0xef,0x61,0x1f,0xcf,0x81,0xce,0x80,0x00,0x8b,0x54,0x20, - 0xff,0x06,0x20,0x0e,0xb0,0x01,0xee,0x8a,0x44,0x71,0x24,0xe7, - 0x88,0x44,0x71,0xee,0xc6,0x44,0x49,0x02,0x80,0x4c,0x50,0x20, - 0xc7,0x04,0xc3,0x03,0x81,0xe6,0x7f,0xff,0x8b,0x54,0x20,0xeb, - 0xae,0x81,0xce,0x80,0x00,0x8b,0x54,0x20,0xff,0x06,0x22,0x0e, - 0xec,0x0a,0xc0,0x79,0x7a,0x80,0x4c,0x51,0x10,0xc7,0x44,0x06, - 0xe1,0x08,0xc6,0x44,0x63,0x04,0xf6,0x44,0x51,0x04,0x74,0x08, - 0x80,0x64,0x51,0xfb,0x80,0x64,0x53,0x3f,0xf6,0x44,0x28,0x01, - 0x75,0x59,0xf6,0x44,0x28,0x02,0x75,0x4f,0x8b,0x7c,0x12,0x8c, - 0xc3,0x8e,0x44,0x10,0xf6,0x44,0x28,0x08,0x74,0x1e,0xb0,0xff, - 0xaa,0x23,0x7c,0x16,0x3b,0x7c,0x14,0x74,0x26,0x32,0xc0,0xf6, - 0x44,0x29,0x80,0x74,0x02,0xb0,0x10,0xaa,0x23,0x7c,0x16,0x3b, - 0x7c,0x14,0x74,0x13,0x32,0xc0,0xaa,0x23,0x7c,0x16,0x3b,0x7c, - 0x14,0x74,0x08,0x8e,0xc3,0x89,0x7c,0x12,0xeb,0x15,0x90,0x8e, - 0xc3,0x4f,0x23,0x7c,0x16,0x89,0x7c,0x12,0xc6,0x44,0x59,0x01, - 0xeb,0x05,0x90,0x80,0x4c,0x4f,0x01,0xb0,0x10,0xee,0x81,0xe6, - 0x7f,0xff,0x8b,0x54,0x20,0xe9,0x17,0xff,0xff,0x06,0x1e,0x0e, - 0xe9,0x10,0xff,0x1e,0x2e,0x8e,0x1e,0xc1,0x03,0x50,0x52,0x55, - 0x8b,0xec,0x8b,0x46,0x08,0xa3,0x12,0x0e,0x32,0xe4,0xa0,0x22, - 0x0c,0xa3,0x10,0x0e,0xff,0x06,0x00,0x0e,0x83,0x06,0x0e,0x0e, - 0x0a,0x83,0x3e,0x04,0x0e,0x00,0x74,0x31,0x8b,0x16,0x00,0x0e, - 0x2b,0x16,0x02,0x0e,0x3b,0x16,0x04,0x0e,0x72,0x23,0x8b,0x16, - 0x00,0x0e,0x89,0x16,0x02,0x0e,0x8b,0x16,0x18,0x0d,0x3b,0x16, - 0x1a,0x0d,0x74,0x11,0x80,0x3e,0x10,0x0c,0x01,0x74,0x16,0xb0, - 0x00,0x90,0xe6,0x00,0x0c,0x08,0x90,0xe6,0x00,0xb8,0x00,0x80, - 0xba,0x22,0xff,0xef,0x5d,0x5a,0x58,0x1f,0xcf,0xb0,0x80,0xe6, - 0x00,0xa0,0x11,0x0c,0x0c,0x10,0xa2,0x11,0x0c,0xeb,0xe6,0x1e, - 0x2e,0x8e,0x1e,0xc1,0x03,0xff,0x06,0x28,0x0e,0x55,0x8b,0xec, - 0x8b,0x6e,0x02,0x89,0x2e,0x16,0x0e,0x5d,0x1f,0xcf,0x1e,0x2e, - 0x8e,0x1e,0xc1,0x03,0xff,0x06,0x24,0x0e,0x55,0x8b,0xec,0x8b, - 0x6e,0x02,0x89,0x2e,0x14,0x0e,0x5d,0x80,0x3e,0x10,0x0c,0x01, - 0x75,0x12,0x50,0xa0,0x11,0x0c,0x0c,0x01,0xa2,0x11,0x0c,0xe4, - 0x00,0x90,0x90,0x24,0x7f,0xe6,0x00,0x58,0x1f,0xcf,0x1e,0x06, - 0x60,0xb8,0x00,0x80,0xba,0x22,0xff,0xef,0x2e,0x8e,0x1e,0xc1, - 0x03,0x2e,0x8e,0x06,0xc1,0x03,0x2e,0xff,0x06,0x30,0x0d,0xfc, - 0xff,0x26,0x2e,0x0e,0x00,0x00,0xfb,0x40,0x43,0x41,0x42,0x46, - 0x47,0x45,0xeb,0xf6,0xc3,0x00,0x00,0x8f,0x06,0x2e,0x0e,0x2e, - 0xff,0x06,0x3d,0x0d,0xb8,0x00,0x00,0xba,0x58,0xff,0xef,0xb8, - 0x00,0xe0,0xba,0x5e,0xff,0xef,0x61,0x07,0x1f,0xcf,0xc2,0xfe, - 0xff,0x8b,0x7c,0x0a,0x2b,0x7c,0x0c,0x23,0x7c,0x0e,0x3b,0x7c, - 0x18,0x77,0x2e,0xc6,0x44,0x4d,0x00,0x80,0x4c,0x4f,0x02,0xeb, - 0x5a,0x90,0x8b,0x7c,0x0a,0x3b,0x7c,0x0c,0x75,0x1b,0x8b,0x3e, - 0x10,0x0d,0x3b,0x3e,0x12,0x0d,0x75,0x53,0xf6,0x44,0x4b,0xff, - 0x75,0x4d,0xc6,0x44,0x4c,0x00,0x80,0x4c,0x4f,0x04,0xeb,0x43, - 0x90,0xf6,0x44,0x50,0x10,0x75,0x3c,0xeb,0x09,0x90,0x8b,0x7c, - 0x0a,0x2b,0x7c,0x0c,0x74,0x31,0x80,0x4c,0x50,0x10,0x80,0x4c, - 0x4b,0x10,0xc7,0x04,0xc3,0x03,0xeb,0x23,0x90,0xfa,0x8b,0x36, - 0x08,0x0e,0x8b,0x54,0x20,0xec,0x8a,0xf8,0x8a,0x5c,0x54,0x32, - 0xfb,0xf6,0x44,0x4d,0xff,0x75,0x8e,0xf6,0x44,0x4c,0xff,0x75, - 0xa1,0xf6,0x44,0x50,0x10,0x74,0xc7,0xec,0x32,0xc3,0x22,0xf8, - 0x83,0x2e,0x10,0x0e,0x01,0x78,0x05,0xd0,0x6c,0x49,0x72,0x45, - 0x8b,0x7c,0x12,0x2b,0x7c,0x14,0x74,0x22,0x80,0x7c,0x4e,0x00, - 0x74,0x1c,0x23,0x7c,0x16,0x03,0xff,0x3b,0x7c,0x16,0x73,0x43, - 0x8b,0x0e,0x0e,0x0e,0x2b,0x4c,0x6e,0x3b,0x4c,0x22,0x73,0x37, - 0x80,0x7c,0x49,0x00,0x74,0x31,0xf6,0x44,0x51,0x02,0x75,0x3c, - 0xec,0x32,0xc3,0x22,0xf8,0x80,0xe7,0x38,0xfb,0x89,0x1e,0x30, - 0x0e,0xbe,0x00,0x10,0xff,0x14,0xeb,0x61,0x90,0xb0,0x01,0xee, - 0x8a,0x44,0x71,0x0c,0x10,0x88,0x44,0x71,0xee,0x80,0x64,0x50, - 0xdf,0xc7,0x04,0xc3,0x03,0xeb,0xa5,0xc6,0x44,0x4e,0x00,0x8b, - 0x0e,0x0e,0x0e,0x89,0x4c,0x6e,0x80,0x4c,0x4f,0x08,0xeb,0xbe, - 0x8b,0x7c,0x12,0x2b,0x7c,0x14,0x23,0x7c,0x16,0x3b,0x7c,0x1a, - 0x73,0xb6,0x80,0x64,0x51,0xfd,0xf6,0x44,0x29,0x10,0x74,0x10, - 0x80,0x64,0x54,0xfb,0x80,0x4c,0x58,0x04,0x80,0x74,0x50,0x08, - 0xc7,0x04,0xc3,0x03,0xb0,0x05,0xee,0xb0,0x82,0x22,0x44,0x5f, - 0x0a,0x44,0x75,0x88,0x44,0x75,0xee,0xeb,0x8b,0xfa,0x8b,0x36, - 0x08,0x0e,0x8b,0x1e,0x30,0x0e,0x8a,0xcb,0xe5,0x80,0x23,0x44, - 0x2e,0x74,0x02,0xf6,0xd1,0x80,0xe1,0x40,0x0a,0xf9,0x8a,0xdf, - 0x22,0x5c,0x55,0x30,0x5c,0x54,0x32,0xfb,0x88,0x7c,0x55,0x0a, - 0x5c,0x58,0x88,0x5c,0x58,0x22,0x5c,0x56,0x75,0x24,0x80,0x7c, - 0x4f,0x00,0x75,0x22,0xfb,0x03,0x74,0x1e,0x89,0x36,0x08,0x0e, - 0xff,0x06,0x26,0x0e,0x8b,0x3e,0x12,0x0d,0x3b,0x3e,0x10,0x0d, - 0x75,0x46,0xbe,0x00,0x10,0xff,0x14,0xe9,0xd3,0xfe,0x80,0x4c, - 0x4f,0x20,0x8b,0x3e,0x18,0x0d,0x8a,0x44,0x48,0x8a,0x64,0x4f, - 0x89,0x85,0x00,0x08,0x8a,0x44,0x54,0x8a,0x64,0x57,0x89,0x85, - 0x02,0x08,0x83,0xc7,0x04,0x81,0xe7,0xfc,0x03,0x3b,0x3e,0x1a, - 0x0d,0x74,0x13,0x88,0x44,0x57,0xc6,0x44,0x4f,0x00,0x8a,0x44, - 0x56,0xf6,0xd0,0x20,0x44,0x58,0x89,0x3e,0x18,0x0d,0xeb,0xa4, - 0xff,0x06,0x2c,0x0e,0xbe,0x00,0x10,0xff,0x14,0xfa,0x8b,0x3e, - 0x12,0x0d,0x81,0xc7,0x00,0x04,0x8a,0x5d,0x01,0x83,0xe3,0x0f, - 0x03,0xdb,0x2e,0x8b,0xb7,0x89,0x00,0x8b,0x54,0x20,0x0b,0xd2, - 0x74,0x0d,0x8a,0x1d,0x83,0xe3,0x1f,0x03,0xdb,0xfa,0x2e,0xff, - 0xa7,0x9c,0x0f,0xff,0x06,0x2a,0x0e,0x8b,0x3e,0x12,0x0d,0x8b, - 0x36,0x18,0x0d,0x8b,0x9d,0x00,0x04,0x89,0x9c,0x00,0x08,0x8b, - 0x9d,0x02,0x04,0x89,0x9c,0x02,0x08,0x83,0xc6,0x04,0x81,0xe6, - 0xfc,0x03,0x3b,0x36,0x1a,0x0d,0x74,0x04,0x89,0x36,0x18,0x0d, - 0xfb,0x8b,0x3e,0x12,0x0d,0x83,0xc7,0x04,0x81,0xe7,0xfc,0x03, - 0x89,0x3e,0x12,0x0d,0xbe,0x00,0x10,0xff,0x14,0xe9,0x1d,0xfe, - 0xdc,0x0f,0xe4,0x0f,0xec,0x0f,0x0d,0x10,0x1c,0x10,0x57,0x0f, - 0x2f,0x10,0x57,0x0f,0x3b,0x10,0x54,0x10,0x83,0x10,0xcf,0x10, - 0xdb,0x10,0xe4,0x10,0xeb,0x10,0x35,0x11,0x7d,0x11,0x83,0x11, - 0xa1,0x11,0xb9,0x11,0xf2,0x11,0x38,0x12,0x03,0x13,0x0c,0x13, - 0x57,0x0f,0x57,0x0f,0x57,0x0f,0x57,0x0f,0x57,0x0f,0x57,0x0f, - 0x57,0x0f,0x57,0x0f,0x8b,0x45,0x02,0x89,0x44,0x1a,0xeb,0xa0, - 0x8b,0x45,0x02,0x89,0x44,0x1c,0xeb,0x98,0x8b,0x45,0x02,0x8b, - 0x5c,0x0a,0x2b,0x5c,0x0c,0x23,0x5c,0x0e,0x8b,0x4c,0x0a,0x2b, - 0xc8,0x23,0x4c,0x0e,0x3b,0xd9,0x76,0x06,0x23,0x44,0x0e,0x89, - 0x44,0x0c,0xe9,0x77,0xff,0x80,0x4c,0x53,0x80,0x80,0x4c,0x54, - 0x01,0x80,0x4c,0x58,0x01,0xe9,0x68,0xff,0x80,0x64,0x53,0x3f, - 0x80,0x64,0x54,0xfe,0x80,0x4c,0x58,0x01,0x80,0x64,0x51,0xfb, - 0xe9,0x55,0xff,0x8b,0x45,0x02,0x88,0x44,0x5a,0x88,0x64,0x5b, - 0xe9,0x49,0xff,0x8b,0x45,0x02,0x0b,0xc0,0x74,0x03,0x89,0x44, - 0x24,0x80,0x4c,0x50,0x04,0x80,0x4c,0x4b,0x04,0xc7,0x04,0xc3, - 0x03,0xe9,0x30,0xff,0x8b,0x5d,0x02,0xf6,0xd7,0x22,0x7c,0x54, - 0x0a,0xdf,0x8a,0x44,0x54,0x32,0xc3,0x24,0x82,0x30,0x44,0x54, - 0xb0,0x05,0xee,0x8a,0x44,0x75,0x32,0xd8,0x8a,0x7c,0x5f,0xf6, - 0xd7,0x22,0xdf,0x80,0xe3,0x82,0x32,0xc3,0x88,0x44,0x75,0xee, - 0xe9,0x01,0xff,0x8b,0x5d,0x02,0xf6,0xc7,0x04,0x75,0x08,0x80, - 0x64,0x53,0x3f,0x80,0x64,0x51,0xfb,0x8a,0x44,0x29,0x32,0xc7, - 0xa8,0x10,0x74,0x0e,0xf6,0x44,0x51,0x02,0x74,0x08,0x80,0x74, - 0x50,0x08,0xc7,0x04,0xc3,0x03,0x88,0x5c,0x28,0x88,0x7c,0x29, - 0xb4,0x60,0xf6,0xc3,0x10,0x74,0x03,0x80,0xcc,0x10,0x8a,0x44, - 0x62,0xf6,0xc3,0x20,0x74,0x02,0x24,0x7f,0x89,0x44,0x34,0xc7, - 0x44,0x06,0xe1,0x08,0xe9,0xb5,0xfe,0x8b,0x45,0x02,0x88,0x44, - 0x5c,0x88,0x64,0x5d,0xe9,0xa9,0xfe,0x8b,0x45,0x02,0x89,0x44, - 0x18,0xe9,0xa0,0xfe,0xff,0x1e,0x24,0x0d,0xe9,0x99,0xfe,0xf6, - 0x44,0x51,0x02,0x75,0x41,0x8b,0x44,0x12,0x2b,0x44,0x14,0x23, - 0x44,0x16,0x3b,0x44,0x1a,0x72,0x33,0x80,0x4c,0x51,0x02,0xf6, - 0x44,0x29,0x10,0x74,0x10,0x80,0x4c,0x54,0x04,0x80,0x4c,0x58, - 0x04,0x80,0x74,0x50,0x08,0xc7,0x04,0xc3,0x03,0xf6,0x44,0x5f, - 0x82,0x74,0x13,0xb0,0x05,0xee,0x8a,0x44,0x75,0xb4,0x82,0x22, - 0x64,0x5f,0xf6,0xd4,0x22,0xc4,0x88,0x44,0x75,0xee,0xe9,0x4f, - 0xfe,0xf6,0x44,0x51,0x02,0x74,0x3f,0x8b,0x44,0x12,0x2b,0x44, - 0x14,0x23,0x44,0x16,0x3b,0x44,0x1c,0x73,0xe9,0x80,0x64,0x51, - 0xfd,0xf6,0x44,0x29,0x10,0x74,0x10,0x80,0x64,0x54,0xfb,0x80, - 0x4c,0x58,0x04,0x80,0x74,0x50,0x08,0xc7,0x04,0xc3,0x03,0xf6, - 0x44,0x5f,0x02,0x74,0x11,0xb0,0x05,0xee,0x8a,0x44,0x75,0xb4, - 0x82,0x22,0x64,0x5f,0x0a,0xc4,0x88,0x44,0x75,0xee,0xe9,0x07, - 0xfe,0xe8,0x8a,0x02,0xe9,0x01,0xfe,0x8b,0x45,0x02,0xbb,0x10, - 0x27,0xf7,0xe3,0xbb,0x0f,0x00,0xf7,0xf3,0xa3,0x06,0x0e,0xba, - 0x52,0xff,0xef,0xba,0x50,0xff,0xb8,0x00,0x00,0xef,0xe9,0xe3, - 0xfd,0x8b,0x45,0x02,0x3a,0x06,0x22,0x0c,0x72,0x0c,0x3b,0x06, - 0x1a,0x0c,0x77,0x06,0xe8,0xab,0x01,0xe9,0xce,0xfd,0xe9,0x9e, - 0xfd,0x8b,0x45,0x02,0x88,0x44,0x2a,0x88,0x64,0x2b,0x0b,0xc0, - 0x75,0x07,0x80,0x64,0x50,0xfe,0xeb,0x10,0x90,0xf6,0x44,0x50, - 0x01,0x75,0x09,0x80,0x4c,0x50,0x01,0xc7,0x44,0x30,0x00,0x00, - 0xa8,0x80,0x75,0x07,0xc6,0x44,0x60,0x00,0xeb,0x05,0x90,0xc6, - 0x44,0x60,0x7f,0xc7,0x04,0xc3,0x03,0xe9,0x92,0xfd,0x8b,0x5d, - 0x02,0xf6,0xd7,0x22,0x7c,0x5f,0x0a,0xdf,0x8a,0xfb,0x88,0x5c, - 0x5f,0x8a,0x44,0x52,0x8a,0x64,0x53,0x8b,0xcb,0x33,0xc8,0x81, - 0xe1,0x38,0x38,0x33,0xc1,0x88,0x44,0x52,0x88,0x64,0x53,0xb0, - 0x05,0xee,0xf6,0xd3,0x22,0x5c,0x54,0xf6,0x44,0x51,0x02,0x75, - 0x02,0x0a,0xdf,0x8a,0x44,0x75,0x32,0xd8,0x80,0xe3,0x82,0x32, - 0xc3,0x88,0x44,0x75,0xee,0xe9,0x4c,0xfd,0x8b,0x5d,0x02,0x88, - 0x5c,0x2c,0x88,0x7c,0x2d,0x8b,0xcb,0x83,0xe3,0x0f,0x03,0xdb, - 0x80,0x3e,0x10,0x0c,0x01,0x75,0x1f,0xa1,0x0e,0x0c,0x86,0xe0, - 0x3d,0x32,0x31,0x73,0x15,0xf6,0xc5,0x04,0x75,0x08,0x2e,0x8b, - 0x9f,0x69,0x01,0xeb,0x1b,0x90,0x2e,0x8b,0x9f,0x89,0x01,0xeb, - 0x13,0x90,0xf6,0xc5,0x04,0x75,0x08,0x2e,0x8b,0x9f,0x29,0x01, - 0xeb,0x06,0x90,0x2e,0x8b,0x9f,0x49,0x01,0xb0,0x0c,0xee,0x8a, - 0xc3,0x88,0x44,0x7c,0xee,0xb0,0x0d,0x90,0x90,0xee,0x8a,0xc7, - 0x88,0x44,0x7d,0xee,0xb0,0x04,0xee,0xb0,0x44,0xf6,0xc1,0x40, - 0x74,0x0c,0xf6,0xc1,0x80,0x74,0x05,0x04,0x04,0xeb,0x03,0x90, - 0x0c,0x08,0xf6,0xc5,0x01,0x74,0x09,0x0c,0x01,0xf6,0xc5,0x02, - 0x75,0x02,0x0c,0x02,0x88,0x44,0x74,0xee,0xb0,0x03,0x90,0x90, - 0xee,0x8a,0xd9,0x80,0xe3,0x30,0xc0,0xeb,0x04,0x32,0xff,0x2e, - 0x8a,0xa7,0xa9,0x01,0x8a,0x44,0x73,0x24,0x3f,0x0a,0xc4,0x88, - 0x44,0x73,0xee,0x90,0x90,0xb0,0x05,0xee,0xd0,0xec,0x8a,0x44, - 0x75,0x24,0x9f,0x0a,0xc4,0x88,0x44,0x75,0xee,0x2e,0x8a,0x87, - 0xad,0x01,0x88,0x44,0x62,0xf6,0x44,0x28,0x20,0x74,0x02,0x24, - 0x7f,0x88,0x44,0x34,0xe9,0x81,0xfc,0x8a,0x45,0x02,0x88,0x44, - 0x5e,0xe9,0x78,0xfc,0x8b,0x45,0x02,0xba,0x5a,0xff,0xef,0x9c, - 0xff,0x36,0x26,0x0d,0xff,0x36,0x24,0x0d,0x1e,0x06,0x60,0x8b, - 0x36,0x0a,0x0e,0xc7,0x04,0x3f,0x0d,0xe9,0x5a,0xfc,0xb8,0x00, - 0x00,0x8e,0xc0,0x8b,0xf0,0x8b,0xf8,0x2e,0x8b,0x9c,0x49,0x00, - 0x83,0xc6,0x02,0x26,0x89,0x1d,0x26,0x8c,0x4d,0x02,0x83,0xc7, - 0x04,0x81,0xff,0x80,0x00,0x72,0xe8,0x26,0xc7,0x05,0xcb,0x0c, - 0x26,0x8c,0x4d,0x02,0x83,0xc7,0x04,0x81,0xff,0x00,0x04,0x72, - 0xee,0xc3,0xc1,0xe0,0x06,0x8b,0xd8,0x8c,0xda,0x81,0xc2,0x00, - 0x04,0x8b,0xfa,0x8a,0x0e,0x22,0x0c,0xb5,0x00,0xbe,0x00,0x10, - 0x33,0xc0,0x89,0x44,0x0a,0x89,0x44,0x0c,0x89,0x44,0x12,0x89, - 0x44,0x14,0x81,0xc6,0x80,0x00,0xe2,0xee,0x89,0x36,0x0a,0x0e, - 0xb8,0x01,0x00,0x8b,0xd0,0xb3,0x00,0x8a,0x0e,0x22,0x0c,0xb5, - 0x00,0xbe,0x00,0x10,0x2b,0xda,0x72,0x29,0x89,0x44,0x16,0x81, - 0xc6,0x80,0x00,0xe2,0xf3,0x8a,0x0e,0x22,0x0c,0xb5,0x00,0xbe, - 0x00,0x10,0x2b,0xda,0x72,0x13,0x89,0x44,0x0e,0x81,0xc6,0x80, - 0x00,0xe2,0xf3,0x8b,0xd0,0x03,0xc0,0x81,0xfa,0x00,0x02,0x72, - 0xca,0x8a,0x0e,0x22,0x0c,0xb5,0x00,0xbe,0x00,0x10,0x89,0x7c, - 0x10,0x8b,0x44,0x16,0x03,0xf8,0x8b,0xd7,0xc1,0xe0,0x04,0x48, - 0x89,0x44,0x16,0x81,0xc6,0x80,0x00,0xe2,0xe9,0x8a,0x0e,0x22, - 0x0c,0xb5,0x00,0xbe,0x00,0x10,0x89,0x7c,0x08,0x8b,0x44,0x0e, - 0x03,0xf8,0x8b,0xd7,0xc1,0xe0,0x04,0x48,0x89,0x44,0x0e,0x81, - 0xc6,0x80,0x00,0xe2,0xe9,0xc3,0xc7,0x04,0x20,0x04,0xc7,0x44, - 0x06,0xe1,0x08,0x8b,0xc6,0x2d,0x00,0x10,0xb1,0x80,0xf6,0xf1, - 0x88,0x44,0x48,0xc7,0x44,0x0a,0x00,0x00,0xc7,0x44,0x0c,0x00, - 0x00,0xc7,0x44,0x12,0x00,0x00,0xc7,0x44,0x14,0x00,0x00,0xc7, - 0x44,0x18,0x00,0x00,0xc7,0x44,0x1a,0x00,0x00,0xc7,0x44,0x1c, - 0xff,0xff,0x8a,0x5c,0x48,0x83,0xe3,0x0f,0x03,0xdb,0x8b,0x97, - 0x90,0x0c,0x89,0x54,0x20,0xb8,0x01,0x00,0x8a,0x4c,0x48,0xd3, - 0xe0,0x89,0x44,0x2e,0xc7,0x44,0x24,0x19,0x00,0xc7,0x44,0x26, - 0x00,0x00,0xc6,0x44,0x4a,0x00,0xc7,0x44,0x30,0x00,0x00,0xc7, - 0x44,0x32,0x00,0x00,0xc6,0x44,0x4c,0x00,0xc6,0x44,0x4d,0x00, - 0xc6,0x44,0x4e,0x00,0xc6,0x44,0x4f,0x00,0xc6,0x44,0x50,0x00, - 0xc6,0x44,0x4b,0x00,0xc6,0x44,0x51,0x00,0xc6,0x44,0x28,0x00, - 0xc6,0x44,0x29,0x00,0xc6,0x44,0x2a,0x00,0xc6,0x44,0x2b,0x00, - 0xc6,0x44,0x54,0x00,0xc6,0x44,0x57,0x00,0xc6,0x44,0x55,0x00, - 0xc6,0x44,0x56,0x00,0xc6,0x44,0x58,0x00,0xc6,0x44,0x52,0x04, - 0xc6,0x44,0x53,0x04,0xc6,0x44,0x5f,0x00,0xc6,0x44,0x2c,0x3d, - 0xc6,0x44,0x2d,0x00,0xc7,0x44,0x34,0xff,0x60,0xc6,0x44,0x62, - 0xff,0xc6,0x44,0x5d,0x13,0xc6,0x44,0x5c,0x11,0xc6,0x44,0x5e, - 0x00,0xc6,0x44,0x60,0x23,0xc6,0x44,0x61,0x23,0x0b,0xd2,0x75, - 0x03,0xe9,0xd9,0x00,0xb0,0x09,0xee,0x8a,0x4c,0x48,0xb0,0x80, - 0xd2,0xe8,0xee,0xc6,0x44,0x70,0x00,0xb0,0x01,0xee,0xb0,0x11, - 0x88,0x44,0x71,0xee,0xb0,0x02,0x90,0x90,0xee,0x8a,0x44,0x48, - 0xc0,0xe0,0x03,0x24,0xf0,0x88,0x44,0x72,0xee,0xb0,0x03,0x90, - 0x90,0xee,0xb0,0xc0,0x88,0x44,0x73,0xee,0xb0,0x04,0x90,0x90, - 0xee,0xb0,0x44,0x88,0x44,0x74,0xee,0xb0,0x05,0x90,0xee,0xb0, - 0x60,0x88,0x44,0x75,0xee,0xc6,0x44,0x76,0x00,0xc6,0x44,0x77, - 0x00,0xc6,0x44,0x78,0x00,0xb0,0x09,0xee,0xb0,0x09,0x88,0x44, - 0x79,0xee,0xc6,0x44,0x7a,0x00,0xb0,0x0b,0xee,0xb0,0x52,0x88, - 0x44,0x7b,0xee,0x80,0x3e,0x10,0x0c,0x01,0x75,0x21,0xa1,0x0e, - 0x0c,0x86,0xe0,0x3d,0x32,0x31,0x73,0x17,0xb0,0x0c,0xee,0xb0, - 0x18,0x88,0x44,0x7c,0xee,0xb0,0x0d,0x90,0x90,0xee,0xb0,0x00, - 0x88,0x44,0x7d,0xee,0xeb,0x15,0x90,0xb0,0x0c,0xee,0xb0,0x16, - 0x88,0x44,0x7c,0xee,0xb0,0x0d,0x90,0x90,0xee,0xb0,0x00,0x88, - 0x44,0x7d,0xee,0xb0,0x0e,0x90,0x90,0xee,0xb0,0x03,0x88,0x44, - 0x7e,0xee,0xb0,0x0f,0x90,0x90,0xee,0xb0,0x80,0x88,0x44,0x7f, - 0xee,0xb0,0x03,0x90,0x90,0xee,0x8a,0x44,0x73,0x0c,0x01,0x88, - 0x44,0x73,0xee,0x90,0x90,0xb0,0x05,0xee,0x8a,0x44,0x75,0x0c, - 0x08,0x88,0x44,0x75,0xee,0xc3,0xfa,0x8c,0xd8,0x25,0x00,0xf0, - 0x8e,0xd0,0xbc,0xfe,0x1f,0x8c,0xd8,0x25,0x00,0xf0,0x8e,0xd8, - 0x80,0x3e,0x40,0x0d,0x01,0x75,0x51,0xa1,0x0e,0x0c,0x86,0xe0, - 0x3d,0x30,0x32,0x73,0x47,0x8b,0x1e,0x20,0x0c,0x8a,0x16,0x23, - 0x0c,0xc6,0x06,0x23,0x0c,0x00,0x83,0xfb,0x00,0x74,0x07,0xfe, - 0xca,0xc6,0x06,0x23,0x0c,0x01,0x88,0x16,0x22,0x0c,0xbe,0x10, - 0x0c,0xbf,0x90,0x0c,0xb9,0x08,0x00,0x1e,0x07,0xfc,0xf3,0xa5, - 0xbf,0xa0,0x0c,0xb8,0x00,0x00,0xb9,0x08,0x00,0xf3,0xab,0xc7, - 0x06,0x1a,0x0c,0x70,0x00,0xa0,0x40,0x0d,0xa2,0x10,0x0c,0xc6, - 0x06,0x11,0x0c,0x00,0x2e,0x8c,0x1e,0xc1,0x03,0xc7,0x06,0x18, - 0x0e,0x02,0x00,0xe8,0xec,0xfc,0xc7,0x06,0x24,0x0d,0x5a,0x0d, - 0x8c,0x0e,0x26,0x0d,0xc7,0x06,0x18,0x0e,0x06,0x00,0xa1,0x1a, - 0x0c,0xe8,0x0a,0xfd,0xc7,0x06,0x18,0x0e,0x0a,0x00,0xbe,0x00, - 0x10,0xc7,0x44,0x1e,0x80,0x00,0xe8,0xa5,0xfd,0x81,0xc6,0x80, - 0x00,0x81,0xfe,0x00,0x18,0x72,0xee,0xa0,0x22,0x0c,0xb4,0x80, - 0xf6,0xe4,0xbe,0x00,0x10,0x03,0xf0,0x89,0x36,0x0a,0x0e,0x29, - 0x44,0x9e,0xc7,0x06,0x00,0x0e,0x00,0x00,0xc7,0x06,0x02,0x0e, - 0x00,0x00,0xc7,0x06,0x04,0x0e,0x00,0x00,0xc7,0x06,0x06,0x0e, - 0x9a,0x02,0xba,0x52,0xff,0xa1,0x06,0x0e,0xef,0xba,0x50,0xff, - 0xb8,0x00,0x00,0xef,0xba,0x56,0xff,0xb8,0x05,0xe0,0xef,0xba, - 0x5e,0xff,0xb8,0x00,0x40,0xef,0xba,0x66,0xff,0xb8,0x00,0x40, - 0xef,0xc7,0x06,0x10,0x0d,0x00,0x00,0xc7,0x06,0x12,0x0d,0x00, - 0x00,0xc7,0x06,0x14,0x0d,0x00,0x04,0xc7,0x06,0x16,0x0d,0xfc, - 0x03,0xc7,0x06,0x18,0x0d,0x00,0x00,0xc7,0x06,0x1a,0x0d,0x00, - 0x00,0xc7,0x06,0x1c,0x0d,0x00,0x08,0xc7,0x06,0x1e,0x0d,0xfc, - 0x03,0xb0,0x00,0x90,0xe6,0x00,0xc7,0x06,0x18,0x0e,0x32,0x00, - 0xba,0x38,0xff,0xb8,0x11,0x00,0xef,0xba,0x3a,0xff,0xb8,0x08, - 0x00,0xef,0xba,0x3c,0xff,0xb8,0x08,0x00,0xef,0xba,0x3e,0xff, - 0xb8,0x08,0x00,0x80,0x3e,0x22,0x0c,0x08,0x76,0x03,0xb8,0x12, - 0x00,0xef,0xba,0x32,0xff,0xb8,0x05,0x00,0xef,0xba,0x28,0xff, - 0xb8,0x6c,0x00,0xef,0xba,0x22,0xff,0xb8,0x00,0x80,0xef,0xc7, - 0x06,0x18,0x0e,0x33,0x00,0xc7,0x06,0x20,0x0d,0x4f,0x00,0xc7, - 0x06,0x21,0x0d,0x53,0x00,0x8b,0x36,0x0a,0x0e,0xc7,0x04,0x3c, - 0x0d,0xc7,0x06,0x08,0x0e,0x00,0x10,0xe9,0x63,0xf6,0x40,0x28, - 0x23,0x29,0x20,0x24,0x49,0x64,0x3a,0x20,0x78,0x61,0x63,0x6f, - 0x6f,0x6b,0x2e,0x61,0x73,0x6d,0x2c,0x76,0x20,0x37,0x2e,0x32, - 0x35,0x20,0x31,0x39,0x39,0x35,0x2f,0x30,0x31,0x2f,0x31,0x32, - 0x20,0x32,0x30,0x3a,0x35,0x39,0x3a,0x32,0x31,0x20,0x6d,0x69, - 0x6c,0x74,0x20,0x45,0x78,0x70,0x20,0x24,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 -}; - -static unsigned pcxx_ncook=sizeof(pcxx_cook); diff --git a/sys/platform/pc32/gnu/isa/dgreg.h b/sys/platform/pc32/gnu/isa/dgreg.h deleted file mode 100644 index 8c58c6ca43..0000000000 --- a/sys/platform/pc32/gnu/isa/dgreg.h +++ /dev/null @@ -1,425 +0,0 @@ -/*- - * dgreg.h $FreeBSD: src/sys/gnu/i386/isa/dgreg.h,v 1.9 1999/08/28 00:43:05 peter Exp $ - * dgreg.h $DragonFly: src/sys/platform/pc32/gnu/isa/dgreg.h,v 1.3 2006/12/23 00:27:03 swildner Exp $ - * - * Digiboard driver. - * - * Stage 1. "Better than nothing". - * - * Based on sio driver by Bruce Evans and on Linux driver by Troy - * De Jongh or - * which is under GNU General Public License version 2 so this driver - * is forced to be under GPL 2 too. - * - * Written by Serge Babkin, - * Joint Stock Commercial Bank "Chelindbank" - * (Chelyabinsk, Russia) - * babkin@hq.icb.chel.su - */ - -#define MAX_DGB_PORTS 32 - -/* digi.h */ -/* Definitions for DigiBoard ditty(1) command. */ - -#if !defined(TIOCMODG) -#define TIOCMODG ('d'<<8) | 250 /* get modem ctrl state */ -#define TIOCMODS ('d'<<8) | 251 /* set modem ctrl state */ -#endif - -#if !defined(TIOCMSET) -#define TIOCMSET ('d'<<8) | 252 /* set modem ctrl state */ -#define TIOCMGET ('d'<<8) | 253 /* set modem ctrl state */ -#endif - -#if !defined(TIOCMBIC) -#define TIOCMBIC ('d'<<8) | 254 /* set modem ctrl state */ -#define TIOCMBIS ('d'<<8) | 255 /* set modem ctrl state */ -#endif - -#if !defined(TIOCSDTR) -#define TIOCSDTR ('e'<<8) | 0 /* set DTR */ -#define TIOCCDTR ('e'<<8) | 1 /* clear DTR */ -#endif - -/************************************************************************ - * Ioctl command arguments for DIGI parameters. - ************************************************************************/ -#define DIGI_GETA ('e'<<8) | 94 /* Read params */ - -#define DIGI_SETA ('e'<<8) | 95 /* Set params */ -#define DIGI_SETAW ('e'<<8) | 96 /* Drain & set params */ -#define DIGI_SETAF ('e'<<8) | 97 /* Drain, flush & set params */ - -#define DIGI_GETFLOW ('e'<<8) | 99 /* Get startc/stopc flow */ - /* control characters */ -#define DIGI_SETFLOW ('e'<<8) | 100 /* Set startc/stopc flow */ - /* control characters */ -#define DIGI_GETAFLOW ('e'<<8) | 101 /* Get Aux. startc/stopc */ - /* flow control chars */ -#define DIGI_SETAFLOW ('e'<<8) | 102 /* Set Aux. startc/stopc */ - /* flow control chars */ - -struct digiflow_struct { - unsigned char startc; /* flow cntl start char */ - unsigned char stopc; /* flow cntl stop char */ -}; - -typedef struct digiflow_struct digiflow_t; - - -/************************************************************************ - * Values for digi_flags - ************************************************************************/ -#define DIGI_IXON 0x0001 /* Handle IXON in the FEP */ -#define DIGI_FAST 0x0002 /* Fast baud rates */ -#define RTSPACE 0x0004 /* RTS input flow control */ -#define CTSPACE 0x0008 /* CTS output flow control */ -#define DSRPACE 0x0010 /* DSR output flow control */ -#define DCDPACE 0x0020 /* DCD output flow control */ -#define DTRPACE 0x0040 /* DTR input flow control */ -#define DIGI_FORCEDCD 0x0100 /* Force carrier */ -#define DIGI_ALTPIN 0x0200 /* Alternate RJ-45 pin config */ -#define DIGI_AIXON 0x0400 /* Aux flow control in fep */ - - -/************************************************************************ - * Structure used with ioctl commands for DIGI parameters. - ************************************************************************/ -struct digi_struct { - unsigned short digi_flags; /* Flags (see above) */ -}; - -typedef struct digi_struct digi_t; - -/* fep.h */ - -#define FEP_CSTART 0x400L -#define FEP_CMAX 0x800L -#define FEP_ISTART 0x800L -#define FEP_IMAX 0xC00L -#define FEP_CIN 0xD10L -#define FEP_GLOBAL 0xD10L -#define FEP_EIN 0xD18L -#define FEPSTAT 0xD20L -#define CHANSTRUCT 0x1000L -#define RXTXBUF 0x4000L - - -struct global_data { - volatile ushort cin; - volatile ushort cout; - volatile ushort cstart; - volatile ushort cmax; - volatile ushort ein; - volatile ushort eout; - volatile ushort istart; - volatile ushort imax; -}; - - -struct board_chan { - int filler1; - int filler2; - volatile ushort tseg; - volatile ushort tin; - volatile ushort tout; - volatile ushort tmax; - - volatile ushort rseg; - volatile ushort rin; - volatile ushort rout; - volatile ushort rmax; - - volatile ushort tlow; - volatile ushort rlow; - volatile ushort rhigh; - volatile ushort incr; - - volatile ushort etime; - volatile ushort edelay; - volatile u_char *dev; - - volatile ushort iflag; - volatile ushort oflag; - volatile ushort cflag; - volatile ushort gmask; - - volatile ushort col; - volatile ushort delay; - volatile ushort imask; - volatile ushort tflush; - - int filler3; - int filler4; - int filler5; - int filler6; - - volatile u_char num; - volatile u_char ract; - volatile u_char bstat; - volatile u_char tbusy; - volatile u_char iempty; - volatile u_char ilow; - volatile u_char idata; - volatile u_char eflag; - - volatile u_char tflag; - volatile u_char rflag; - volatile u_char xmask; - volatile u_char xval; - volatile u_char mstat; - volatile u_char mchange; - volatile u_char mint; - volatile u_char lstat; - - volatile u_char mtran; - volatile u_char orun; - volatile u_char startca; - volatile u_char stopca; - volatile u_char startc; - volatile u_char stopc; - volatile u_char vnext; - volatile u_char hflow; - - volatile u_char fillc; - volatile u_char ochar; - volatile u_char omask; - - u_char filler7; - u_char filler8[28]; -}; - - -#define SRXLWATER 0xE0 -#define SRXHWATER 0xE1 -#define STOUT 0xE2 -#define PAUSETX 0xE3 -#define RESUMETX 0xE4 -#define SAUXONOFFC 0xE6 -#define SENDBREAK 0xE8 -#define SETMODEM 0xE9 -#define SETIFLAGS 0xEA -#define SONOFFC 0xEB -#define STXLWATER 0xEC -#define PAUSERX 0xEE -#define RESUMERX 0xEF -#define SETBUFFER 0xF2 -#define SETCOOKED 0xF3 -#define SETHFLOW 0xF4 -#define SETCTRLFLAGS 0xF5 -#define SETVNEXT 0xF6 - - - -#define BREAK_IND 0x01 -#define LOWTX_IND 0x02 -#define EMPTYTX_IND 0x04 -#define DATA_IND 0x08 -#define MODEMCHG_IND 0x20 - -#define ALL_IND (BREAK_IND|LOWTX_IND|EMPTYTX_IND|DATA_IND|MODEMCHG_IND) - - -#define RTS 0x02 -#define CD 0x08 -#define DSR 0x10 -#define CTS 0x20 -#define RI 0x40 -#define DTR 0x80 - -/* pcxx.h */ - -#define FEPCODESEG 0x0200L -#define FEPCODE 0x2000L -#define BIOSCODE 0xf800L - -#define MISCGLOBAL 0x0C00L -#define NPORT 0x0C22L -#define MBOX 0x0C40L -#define PORTBASE 0x0C90L -#define BOTWIN 0x100L -#define TOPWIN 0xFF00L - -#define FEPCLR 0x00 -#define FEPMEM 0x02 -#define FEPRST 0x04 -#define FEPINT 0x08 -#define FEPMASK 0x0e -#define FEPWIN 0x80 - -#define PCXI 0 -#define PCXE 1 -#define PCXEVE 2 - -static char * const board_desc[] = { - "PC/Xi (64K)", - "PC/Xe (64K)", - "PC/Xe (8K) ", -}; - -#define STARTC 021 -#define STOPC 023 -#define IAIXON 0x2000 - - -struct board_info { - u_char status; - u_char type; - u_char altpin; - ushort numports; - ushort port; - u_long membase; -}; - - -#define TXSTOPPED 0x1 -#define LOWWAIT 0x2 -#define EMPTYWAIT 0x4 - -#define DISABLED 0 -#define ENABLED 1 -#define OFF 0 -#define ON 1 - -#define FEPTIMEOUT 200000 -#define SERIAL_TYPE_NORMAL 1 -#define SERIAL_TYPE_CALLOUT 2 -#define PCXE_EVENT_HANGUP 1 - -struct channel { - u_char unit; /* board unit number */ - u_char omodem; /* FEP output modem status */ - u_char imodem; /* FEP input modem status */ - u_char modemfake; /* Modem values to be forced */ - u_char modem; /* Force values */ - u_char hflow; - u_char dsr; - u_char dcd; - u_char stopc; - u_char startc; - u_char stopca; - u_char startca; - u_char fepstopc; - u_char fepstartc; - u_char fepstopca; - u_char fepstartca; - u_char txwin; - u_char rxwin; - ushort fepiflag; - ushort fepcflag; - ushort fepoflag; - ushort txbufhead; - ushort txbufsize; - ushort rxbufhead; - ushort rxbufsize; - int close_delay; - int count; - int blocked_open; - int event; - int asyncflags; - uint dev; - long session; - long pgrp; - u_long statusflags; - u_long c_iflag; - u_long c_cflag; - u_long c_lflag; - u_long c_oflag; - u_char *txptr; - u_char *rxptr; - struct board_info *board; - struct board_chan *brdchan; - struct digi_struct digiext; - struct tty *tty; - struct termios normal_termios; - struct termios callout_termios; - volatile struct global_data *mailbox; -}; - -/* flags for configuring */ - -#define DGBFLAG_ALTPIN 0x0001 /* chande DCD and DCD */ -#define DGBFLAG_NOWIN 0x0002 /* use windowed PC/Xe as non-windowed */ - -#define DB_RD 0x0001 -#define DB_WR 0x0002 -#define DB_WIN 0x0004 -#define DB_INFO 0x0008 -#define DB_EXCEPT 0x0010 -#define DB_OPEN 0x0100 -#define DB_CLOSE 0x0200 -#define DB_DATA 0x0400 -#define DB_RXDATA 0x0401 -#define DB_TXDATA 0x0402 -#define DB_EVENT 0x0800 -#define DB_MODEM 0x1000 -#define DB_BREAK 0x2000 -#define DB_PARAM 0x4000 -#define DB_FEP 0x8000 - -/* debugging printout */ - -#ifdef DGB_DEBUG -#define DPRINT1(l,a1) (dgbdebug&l ? kprintf(a1) : 0) -#define DPRINT2(l,a1,a2) (dgbdebug&l ? kprintf(a1,a2) : 0) -#define DPRINT3(l,a1,a2,a3) (dgbdebug&l ? kprintf(a1,a2,a3) : 0) -#define DPRINT4(l,a1,a2,a3,a4) (dgbdebug&l ? kprintf(a1,a2,a3,a4) : 0) -#define DPRINT5(l,a1,a2,a3,a4,a5) (dgbdebug&l ? kprintf(a1,a2,a3,a4,a5) : 0) -#define DPRINT6(l,a1,a2,a3,a4,a5,a6) (dgbdebug&l ? kprintf(a1,a2,a3,a4,a5,a6) : 0) -#define DPRINT7(l,a1,a2,a3,a4,a5,a6,a7) (dgbdebug&l ? kprintf(a1,a2,a3,a4,a5,a6,a7) : 0) -#else -#define DPRINT1(l,a1) -#define DPRINT2(l,a1,a2) -#define DPRINT3(l,a1,a2,a3) -#define DPRINT4(l,a1,a2,a3,a4) -#define DPRINT5(l,a1,a2,a3,a4,a5) -#define DPRINT6(l,a1,a2,a3,a4,a5,a6) -#define DPRINT7(l,a1,a2,a3,a4,a5,a6,a7) -#endif - - - /* These are termios bits as the FEP understands them */ - -/* c_cflag bits */ -#define FEP_CBAUD 0x00000f -#define FEP_B0 0x000000 /* hang up */ -#define FEP_B50 0x000001 -#define FEP_B75 0x000002 -#define FEP_B110 0x000003 -#define FEP_B134 0x000004 -#define FEP_B150 0x000005 -#define FEP_B200 0x000006 -#define FEP_B300 0x000007 -#define FEP_B600 0x000008 -#define FEP_B1200 0x000009 -#define FEP_B1800 0x00000a -#define FEP_B2400 0x00000b -#define FEP_B4800 0x00000c -#define FEP_B9600 0x00000d -#define FEP_B19200 0x00000e -#define FEP_B38400 0x00000f -#define FEP_EXTA FEP_B19200 -#define FEP_EXTB FEP_B38400 -#define FEP_CSIZE 0x000030 -#define FEP_CS5 0x000000 -#define FEP_CS6 0x000010 -#define FEP_CS7 0x000020 -#define FEP_CS8 0x000030 -#define FEP_CSTOPB 0x000040 -#define FEP_CREAD 0x000080 -#define FEP_PARENB 0x000100 -#define FEP_PARODD 0x000200 -#define FEP_CLOCAL 0x000800 -#define FEP_FASTBAUD 0x000400 -/* c_iflag bits */ -#define FEP_IGNBRK 0000001 -#define FEP_BRKINT 0000002 -#define FEP_IGNPAR 0000004 -#define FEP_PARMRK 0000010 -#define FEP_INPCK 0000020 -#define FEP_ISTRIP 0000040 -#define FEP_IXON 0002000 -#define FEP_IXANY 0004000 -#define FEP_IXOFF 0010000 - diff --git a/sys/platform/pc32/i386/userconfig.c b/sys/platform/pc32/i386/userconfig.c index 4da3210855..05c061a27e 100644 --- a/sys/platform/pc32/i386/userconfig.c +++ b/sys/platform/pc32/i386/userconfig.c @@ -332,7 +332,6 @@ static DEV_INFO device_info[] = { /*---Name----- ---Description---------------------------------------------- */ {"adv", "AdvanSys SCSI narrow controller", 0, CLS_STORAGE}, {"bt", "Buslogic SCSI controller", 0, CLS_STORAGE}, -{"aha", "Adaptec 154x SCSI controller", 0, CLS_STORAGE}, {"aic", "Adaptec 152x SCSI and compatible sound cards", 0, CLS_STORAGE}, {"nca", "ProAudio Spectrum SCSI and compatibles", 0, CLS_STORAGE}, {"sea", "Seagate ST01/ST02 SCSI and compatibles", 0, CLS_STORAGE}, @@ -340,39 +339,30 @@ static DEV_INFO device_info[] = { {"wdc", "IDE/ESDI/MFM disk controller", 0, CLS_STORAGE}, {"ata", "ATA/ATAPI compatible disk controller", 0, CLS_STORAGE}, {"fdc", "Floppy disk controller", FLG_FIXED, CLS_STORAGE}, -{"wt", "Wangtek/Archive QIC-02 Tape drive", 0, CLS_STORAGE}, {"wd", "IDE or ST506 compatible storage device", FLG_INVISIBLE, CLS_STORAGE}, {"ad", "ATA/ATAPI compatible storage device", FLG_INVISIBLE, CLS_STORAGE}, {"fd", "Floppy disk device", FLG_INVISIBLE, CLS_STORAGE}, {"cs", "IBM EtherJet, CS89x0-based Ethernet adapters",0, CLS_NETWORK}, {"ed", "NE1000,NE2000,3C503,WD/SMC80xx Ethernet adapters",0, CLS_NETWORK}, -{"el", "3C501 Ethernet adapter", 0, CLS_NETWORK}, {"ep", "3C509 Ethernet adapter", 0, CLS_NETWORK}, {"ex", "Intel EtherExpress Pro/10 Ethernet adapter", 0, CLS_NETWORK}, {"fe", "Fujitsu MB86960A/MB86965A Ethernet adapters", 0, CLS_NETWORK}, -{"ie", "AT&T Starlan 10 and EN100, 3C507, NI5210 Ethernet adapters",0,CLS_NETWORK}, -{"le", "DEC Etherworks 2 and 3 Ethernet adapters", 0, CLS_NETWORK}, {"lnc", "Isolan, Novell NE2100/NE32-VL Ethernet adapters", 0,CLS_NETWORK}, {"sn", "SMC/Megahertz Ethernet adapters", 0,CLS_NETWORK}, {"xe", "Xircom PC Card Ethernet adapter", 0, CLS_NETWORK}, -{"rdp", "RealTek RTL8002 Pocket Ethernet", 0, CLS_NETWORK}, {"sbni", "Granch SBNI12-xx adapters", 0, CLS_NETWORK}, {"sio", "8250/16450/16550 Serial port", 0, CLS_COMMS}, {"cx", "Cronyx/Sigma multiport sync/async adapter",0, CLS_COMMS}, -{"rc", "RISCom/8 multiport async adapter", 0, CLS_COMMS}, {"cy", "Cyclades multiport async adapter", 0, CLS_COMMS}, -{"dgb", "Digiboard PC/Xe, PC/Xi async adapter", 0, CLS_COMMS}, {"si", "Specialix SI/XIO/SX async adapter", 0, CLS_COMMS}, {"stl", "Stallion EasyIO/Easy Connection 8/32 async adapter",0, CLS_COMMS}, {"stli", "Stallion intelligent async adapter" ,0, CLS_COMMS}, {"ppc", "Parallel Port chipset", 0, CLS_COMMS}, -{"gp", "National Instruments AT-GPIB/TNT driver", 0, CLS_COMMS}, {"atkbdc", "Keyboard controller", FLG_INVISIBLE, CLS_INPUT}, {"atkbd", "Keyboard", FLG_FIXED, CLS_INPUT}, -{"mse", "Microsoft Bus Mouse", 0, CLS_INPUT}, {"psm", "PS/2 Mouse", FLG_FIXED, CLS_INPUT}, {"joy", "Joystick", FLG_FIXED, CLS_INPUT}, {"sc", "Syscons console driver", FLG_IMMUTABLE, CLS_INPUT}, @@ -394,14 +384,9 @@ static DEV_INFO device_info[] = { {"sscape_mss", "VOXWARE Ensoniq Soundscape PCM", 0, CLS_MMEDIA}, {"uart", "VOXWARE 6850 MIDI UART", 0, CLS_MMEDIA}, {"pca", "PC speaker PCM audio driver", FLG_FIXED, CLS_MMEDIA}, -{"ctx", "Coretex-I frame grabber", 0, CLS_MMEDIA}, -{"spigot", "Creative Labs Video Spigot video capture", 0, CLS_MMEDIA}, {"scc", "IBM Smart Capture Card", 0, CLS_MMEDIA}, -{"gsc", "Genius GS-4500 hand scanner", 0, CLS_MMEDIA}, -{"asc", "AmiScan scanner", 0, CLS_MMEDIA}, {"apm", "Advanced Power Management", FLG_FIXED, CLS_MISC}, -{"labpc", "National Instruments Lab-PC/Lab-PC+", 0, CLS_MISC}, {"pcic", "PC-card controller", 0, CLS_MISC}, {"npx", "Math coprocessor", FLG_IMMUTABLE, CLS_MISC}, {"vga", "Catchall PCI VGA driver", FLG_INVISIBLE, CLS_MISC}, diff --git a/sys/platform/pc32/include/asc_ioctl.h b/sys/platform/pc32/include/asc_ioctl.h deleted file mode 100644 index 914433b4f1..0000000000 --- a/sys/platform/pc32/include/asc_ioctl.h +++ /dev/null @@ -1,54 +0,0 @@ -/* asc.h - programming interface to the scanner device driver `asc' - * - * - * Copyright (c) 1995 Gunther Schadow. 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 Gunther Schadow. - * 4. 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 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: src/sys/i386/include/asc_ioctl.h,v 1.2.10.1 2000/08/03 01:01:19 peter Exp $ - * $DragonFly: src/sys/platform/pc32/include/asc_ioctl.h,v 1.2 2003/06/17 04:28:35 dillon Exp $ - */ - -#ifndef _MACHINE_ASC_IOCTL_H_ -#define _MACHINE_ASC_IOCTL_H_ - -#include - -#define ASC_GRES _IOR('S', 1, int) /* get resolution / dpi */ -#define ASC_SRES _IOW('S', 2, int) /* set resolution / dpi */ -#define ASC_GWIDTH _IOR('S', 3, int) /* get width / pixels */ -#define ASC_SWIDTH _IOW('S', 4, int) /* set width / pixels */ -#define ASC_GHEIGHT _IOR('S', 5, int) /* get height / pixels */ -#define ASC_SHEIGHT _IOW('S', 6, int) /* set height / pixels */ - -#define ASC_GBLEN _IOR('S', 7, int) /* get buffer length / lines */ -#define ASC_SBLEN _IOW('S', 8, int) /* set buffer length / lines */ -#define ASC_GBTIME _IOR('S', 9, int) /* get buffer timeout / s */ -#define ASC_SBTIME _IOW('S', 10, int) /* set buffer timeout / s */ - -#define ASC_SRESSW _IO('S', 11) /* set resolution by switch */ - -#endif /* !_MACHINE_ASC_IOCTL_H_ */ diff --git a/sys/platform/pc32/include/gsc.h b/sys/platform/pc32/include/gsc.h deleted file mode 100644 index f00bbfa7b8..0000000000 --- a/sys/platform/pc32/include/gsc.h +++ /dev/null @@ -1,54 +0,0 @@ -/* gsc.h - programming interface to the scanner device driver `gsc' - * - * - * Copyright (c) 1995 Gunther Schadow. 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 Gunther Schadow. - * 4. 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 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: src/sys/i386/include/gsc.h,v 1.2.10.1 2000/08/03 01:01:19 peter Exp $ - * $DragonFly: src/sys/platform/pc32/include/gsc.h,v 1.2 2003/06/17 04:28:35 dillon Exp $ - */ - -#ifndef _MACHINE_GSC_H_ -#define _MACHINE_GSC_H_ - -#include - -#define GSC_GRES _IOR('S', 1, int) /* get resolution / dpi */ -#define GSC_SRES _IOW('S', 2, int) /* set resolution / dpi */ -#define GSC_GWIDTH _IOR('S', 3, int) /* get width / pixels */ -#define GSC_SWIDTH _IOW('S', 4, int) /* set width / pixels */ -#define GSC_GHEIGHT _IOR('S', 5, int) /* get height / pixels */ -#define GSC_SHEIGHT _IOW('S', 6, int) /* set height / pixels */ - -#define GSC_GBLEN _IOR('S', 7, int) /* get buffer length / lines */ -#define GSC_SBLEN _IOW('S', 8, int) /* set buffer length / lines */ -#define GSC_GBTIME _IOR('S', 9, int) /* get buffer timeout / s */ -#define GSC_SBTIME _IOW('S', 10, int) /* set buffer timeout / s */ - -#define GSC_SRESSW _IO('S', 11) /* set resolution by switch */ - -#endif /* !_MACHINE_GSC_H_ */ diff --git a/sys/platform/pc32/include/spigot.h b/sys/platform/pc32/include/spigot.h deleted file mode 100644 index 5612ac1f23..0000000000 --- a/sys/platform/pc32/include/spigot.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Video spigot capture driver. - * - * Copyright (c) 1995, Jim Lowe. 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - * Version 1.2, Aug 30, 1995. - * $FreeBSD: src/sys/i386/include/spigot.h,v 1.5 1999/12/29 04:33:08 peter Exp $ - * $DragonFly: src/sys/platform/pc32/include/spigot.h,v 1.2 2003/06/17 04:28:36 dillon Exp $ - */ - -#ifndef _MACHINE_SPIGOT_H_ -#define _MACHINE_SPIGOT_H_ - -#include - -struct spigot_info { - unsigned long maddr; - unsigned short irq; -}; - -/* - * Get memory address. - */ -#define SPIGOT_GET_INFO _IOR('s', 4, struct spigot_info) -/* - * Set up a user interrupt. - */ -#define SPIGOT_SETINT _IOW('s', 5, int) -/* - * Allow/disallow access to the I/O Page. - */ -#define SPIGOT_IOPL_ON _IO ('s', 6) -#define SPIGOT_IOPL_OFF _IO ('s', 7) - -#ifndef _KERNEL -/* - * Defines for spigot library. - */ -unsigned short * spigot_open(char *dev); -void spigot_close(void); -void spigot_set_capture_size(int width, int vtof); -unsigned char spigot_start_xfer(int num_frames); -void spigot_stop_xfer(void); -unsigned char spigot_status(void); - -/* - * Define the status bits. - */ -#define SPIGOT_COLOR 0x01 /* Color present (No color) */ -#define SPIGOT_60HZ 0x02 /* 60 hz input signal (50hz) */ -#define SPIGOT_NO_HORIZONTAL_LOCK 0x04 /* Horizontal lock present */ -#define SPIGOT_HPLL_LOCKED 0x08 /* HPLL locked (HPLL unlocked)*/ -#define SPIGOT_VCR_MODE 0x10 /* VCR mode (TV mode) */ -#define SPIGOT_VSYNC_PRESENT 0x20 /* Vsync present */ - -/* - * spigot_open() returns a data address pointing to the spigot data. - * Each read from this address returns the next word. The ``dev'' passed - * is usually "/dev/spigot". Data is described in the phillips desktop - * video data handbook under the 7191 chip. Formats may be either - * YUV 4:2:2 or YUV 4:1:1. A sample device driver for ``nv'' is included - * with this code. - * - * spigot_close() cleans up and closes the device. - * - * spigot_set_capture_size() will set the capture window size. Width should be - * one of: 80, 160, 240, 320, or 640 for NTSC or - * 96, 192, 288, 384 for PAL. - * vtof is the Vertical top of frame offset and must be between 0 and 15 lines. - * - * spigot_start_xfer() will start a transfer from the 7191 to the data fifo. - * spigot_stop_xfer() will clear the data fifo and abort any transfers. - * - * spigot_status() will return the above status bits. - */ -#endif /* !_KERNEL */ - -#endif /* !_MACHINE_SPIGOT_H_ */ diff --git a/sys/platform/pc32/isa/README.le b/sys/platform/pc32/isa/README.le deleted file mode 100644 index 4a32fc5498..0000000000 --- a/sys/platform/pc32/isa/README.le +++ /dev/null @@ -1,69 +0,0 @@ -$FreeBSD: src/sys/i386/isa/README.le,v 1.6 1999/08/28 00:44:35 peter Exp $ -$DragonFly: src/sys/platform/pc32/isa/README.le,v 1.2 2003/06/17 04:28:36 dillon Exp $ - ----------------- - -This driver is in no way supported by Digital Equipment. See the -disclaimers in the sources for more. - -This driver supports all the DEC EtherWORKS III NICs (DE203, DE204, -and DE205) and the later DEC EtherWORKS II NICs (DE200, DE201, DE202, -DE422). DEPCA-style boards prior to the DE200 have not been tested -and may not work. - -This driver is not EISA aware. If you are using a DE422 or have -configured the EtherWORKS III in EISA mode, make sure you specify -the I/O port properly as this driver will *not* probe for it. -(The I/O port should be 0xNc00 where N is the EISA slot number). - -This driver does not yet use the full 128KB allowed by the DE422. -Someday, it might. For EtherWORKS III NICs, the driver will override -the EEPROM setting of MemoryMode and *always* use the 2K for best -results. - -The driver includes full support for both BPF and IP Multicast. - -[All paths are relative to the top of sys source area, usually -/usr/src/sys.] - -The following files need to be moved into their respective -directories: - - if_le.c --> i386/isa - am7990.h --> i386/isa/ic - lemac.h --> i386/isa/ic - -You will need to apply the patch provided in pat.files.i386 to -i386/conf/files.i386 file. - -After that is done you will need to edit your config file (in -i386/conf) and a line similar to: - -device le0 at isa? port 0x300 net irq 5 iomem 0xd0000 - -[The above line assumes the board is still at the factory defaults.] -Change the port, irq, and iomem value if needed to your configuration. - -Now you are ready to rebuild your kernel, reboot, and see if the -driver can configure your board. When the system boots, you will -hopefully something close to: - - EtherWORKS II: - - le0 at 0x300-0x30f irq 5 maddr 0xd0000 msize 65536 on isa - le0: DE202 ethernet address 08:00:2b:2d:c8:45 - bpf: le0 attached - - EtherWORKS III: - - le0 at 0x320-0x33f irq 5 maddr 0xd0000 msize 2048 on isa - le0: DE205-AB ethernet address 08:00:2b:bb:23:e0 - le0 attached - -in the startup log. If so, the board configured properly and -should be ready to use. - --- -Mail: thomas@lkg.dec.com -URL: http://ftp.digital.com/~thomas/ - diff --git a/sys/platform/pc32/isa/asc.c b/sys/platform/pc32/isa/asc.c deleted file mode 100644 index 3ff04f3ec4..0000000000 --- a/sys/platform/pc32/isa/asc.c +++ /dev/null @@ -1,898 +0,0 @@ -/* asc.c - device driver for hand scanners - * - * Current version supports: - * - * - AmiScan (Mustek) Color and BW hand scanners (GI1904 chipset) - * - * Copyright (c) 1995 Gunther Schadow. All rights reserved. - * Copyright (c) 1995,1996,1997 Luigi Rizzo. 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 Gunther Schadow - * and Luigi Rizzo. - * 4. 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 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: src/sys/i386/isa/asc.c,v 1.42.2.2 2001/03/01 03:22:39 jlemon Exp $ - */ - -#include "use_asc.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include "ascreg.h" - -/*** - *** CONSTANTS & DEFINES - *** - ***/ - -#define PROBE_FAIL 0 -#define PROBE_SUCCESS IO_ASCSIZE -#define ATTACH_FAIL 0 -#define ATTACH_SUCCESS 1 -#define SUCCESS 0 -#define FAIL -1 -#define INVALID FAIL - -#define DMA1_READY 0x08 -#define ASCDEBUG -#ifdef ASCDEBUG -# define lprintf if(scu->flags & FLAG_DEBUG) kprintf -#else -# define lprintf (void) -#endif - -#define TIMEOUT (hz*15) /* timeout while reading a buffer - default value */ - -/*** - *** LAYOUT OF THE MINOR NUMBER - ***/ - -#define UNIT_MASK 0xc0 /* unit asc0 .. asc3 */ -#define UNIT(x) (x >> 6) -#define DBUG_MASK 0x20 -#define FRMT_MASK 0x18 /* output format */ -#define FRMT_RAW 0x00 /* output bits as read from scanner */ -#define FRMT_GRAY 0x1 /* output gray mode for color scanner */ -#define FRMT_PBM 0x08 /* output pbm format */ -#define FRMT_PGM 0x18 - -/*** - *** THE GEMOMETRY TABLE - ***/ - -#define GREY_LINE 826 /* 825, or 826 , or 550 ??? */ -static const struct asc_geom { - int dpi; /* dots per inch */ - int dpl; /* dots per line */ - int bpl; /* bytes per line */ - int g_res; /* get resolution value (ASC_STAT) */ -} geomtab[] = { - { 800, 3312, 414, ASC_RES_800}, - { 700, 2896, 362, ASC_RES_700}, - { 600, 2480, 310, ASC_RES_600}, - { 500, 1656, 258, ASC_RES_500}, - { 400, 1656, 207, ASC_RES_400}, - { 300, 1240, 155, ASC_RES_300}, - { 200, 832, 104, ASC_RES_200}, - { 100, 416, 52, ASC_RES_100}, - { 200, 3*GREY_LINE, 3*GREY_LINE, 0 /* returned by color scanner */}, - { 200, GREY_LINE, GREY_LINE, 0 /* color scanner, grey mode */}, - { INVALID, 416, 52, INVALID } /* terminator */ -}; - -/*** - *** THE TABLE OF UNITS - ***/ - -struct _sbuf { - size_t size; - size_t rptr; - size_t wptr; /* only changed in ascintr */ - size_t count; - char *base; -}; - -struct asc_unit { - long thedev; /* XXX */ - int base; /* base address */ - int dma_num; /* dma number */ - char dma_byte; /* mask of byte for setting DMA value */ - char int_byte; /* mask of byte for setting int value */ - char cfg_byte; /* mirror of byte written to config reg (ASC_CFG). */ - char cmd_byte; /* mirror of byte written to cmd port (ASC_CMD)*/ - char portf_byte; - int flags; -#define ATTACHED 0x01 -#define OPEN 0x02 -#define READING 0x04 -#define DMA_ACTIVE 0x08 -#define SLEEPING 0x10 -#define SEL_COLL 0x20 -#define PBM_MODE 0x40 -#define FLAG_DEBUG 0x80 - int geometry; /* resolution as geomtab index */ - int linesize; /* length of one scan line (from geom.table) */ - int blen; /* length of buffer in lines */ - int btime; /* timeout of buffer in seconds/hz */ - struct _sbuf sbuf; - long icnt; /* interrupt count XXX for debugging */ - struct kqinfo kqp; - int height; /* height, for pnm modes */ - size_t bcount; /* bytes to read, for pnm modes */ -}; - -static struct asc_unit unittab[NASC]; - -/*** I could not find a reasonable buffer size limit other than by - *** experiments. MAXPHYS is obviously too much, while DEV_BSIZE and - *** PAGE_SIZE are really too small. There must be something wrong - *** with isa_dmastart/isa_dmarangecheck HELP!!! - *** - *** Note, must be DEFAULT_BLEN * samples_per_line <= MAX_BUFSIZE - ***/ -#define MAX_BUFSIZE 0xb000 /* XXX was 0x3000 */ -#define DEFAULT_BLEN 16 - -/*** - *** THE PER-DRIVER RECORD FOR ISA.C - ***/ -static int ascprobe (struct isa_device *isdp); -static int ascattach(struct isa_device *isdp); -struct isa_driver ascdriver = { ascprobe, ascattach, "asc" }; - -static void ascintr(void *); - -static d_open_t ascopen; -static d_close_t ascclose; -static d_read_t ascread; -static d_ioctl_t ascioctl; -static d_kqfilter_t asckqfilter; - -static void ascfilter_detach(struct knote *kn); -static int ascfilter(struct knote *kn, long hint); - -static struct dev_ops asc_ops = { - { "asc", 0, 0 }, - .d_open = ascopen, - .d_close = ascclose, - .d_read = ascread, - .d_ioctl = ascioctl, - .d_kqfilter = asckqfilter -}; - -#define STATIC static - -/*** - *** LOCALLY USED SUBROUTINES - *** - ***/ - -/*** - *** get_resolution - *** read resolution from the scanner - ***/ -static void -get_resolution(struct asc_unit *scu) -{ - int res, i, delay; - - res=0; - scu->cmd_byte = ASC_STANDBY; - outb(ASC_CMD, scu->cmd_byte); - tsleep((caddr_t)scu, PCATCH, "ascres", hz/10); - for(delay= 100; (res=inb(ASC_STAT)) & ASC_RDY_FLAG; delay--) - { - i = tsleep((caddr_t)scu, PCATCH, "ascres0", 1); - if ( ( i == 0 ) || ( i == EWOULDBLOCK ) ) - i = SUCCESS; - else - break; - } - if (delay==0) { - lprintf("asc.get_resolution: timeout completing command\n"); - return /* -1 */; - } - /* ... actual read resolution... */ - res &= ASC_RES_MASK; - for (i=0; geomtab[i].dpi != INVALID; i++) { - if (geomtab[i].g_res == res) break; - } - if (geomtab[i].dpi==INVALID) { - scu->geometry= i; /* INVALID; */ - lprintf("asc.get_resolution: wrong resolution\n"); - } else { - lprintf("asc.get_resolution: %d dpi\n",geomtab[i].dpi); - scu->geometry = i; - } - scu->portf_byte=0; /* default */ - if (geomtab[scu->geometry].g_res==0 && !(scu->thedev&FRMT_GRAY)) { - /* color scanner seems to require this */ - scu->portf_byte=2; - /* scu->geometry++; */ - } - scu->linesize = geomtab[scu->geometry].bpl; - scu->height = geomtab[scu->geometry].dpl; /* default... */ -} - -/*** - *** buffer_allocate - *** allocate/reallocate a buffer - *** Now just checks that the preallocated buffer is large enough. - ***/ - -static int -buffer_allocate(struct asc_unit *scu) -{ - size_t size, size1; - - size = scu->blen * scu->linesize; - - lprintf("asc.buffer_allocate: need 0x%x bytes\n", size); - - if ( size > MAX_BUFSIZE ) { - size1=size; - size= ( (MAX_BUFSIZE+scu->linesize-1) / scu->linesize)*scu->linesize; - lprintf("asc.buffer_allocate: 0x%x bytes are too much, try 0x%x\n", - size1, size); - return ENOMEM; - } - - scu->sbuf.size = size; - scu->sbuf.rptr = 0; - scu->sbuf.wptr = 0; - scu->sbuf.count = 0; /* available data for reading */ - - lprintf("asc.buffer_allocate: ok\n"); - - return SUCCESS; -} - -/*** dma_restart - *** invoked locally to start dma. Must run in a critical section - ***/ -static void -dma_restart(struct asc_unit *scu) -{ - unsigned char al=scu->cmd_byte; - - if (geomtab[scu->geometry].g_res==0) {/* color */ - isa_dmastart(BUF_CMD_READ, scu->sbuf.base+scu->sbuf.wptr, - scu->linesize + 90 /* XXX */ , scu->dma_num); - /* - * looks like we have to set and then clear this - * bit to enable the scanner to send interrupts - */ - outb( ASC_CMD, al |= 4 ); /* seems to disable interrupts */ -#if 0 - outb( ASC_CMD, al |= 8 ); /* ??? seems useless */ -#endif - outb( ASC_CMD, al &= 0xfb ); - scu->cmd_byte = al; - } else { /* normal */ - isa_dmastart(BUF_CMD_READ, scu->sbuf.base+scu->sbuf.wptr, - scu->linesize, scu->dma_num); - /*** this is done in sub_20, after dmastart ? ***/ -#if 0 - outb( ASC_CMD, al |= 4 ); - outb( ASC_CMD, al |= 8 ); /* ??? seems useless */ - outb( ASC_CMD, al &= 0xfb ); - scu->cmd_byte = al; -#else - outb( ASC_CMD, ASC_OPERATE); -#endif - } - scu->flags |= DMA_ACTIVE; -} - -/*** - *** the main functions - ***/ - -/*** asc_reset - *** resets the scanner and the config bytes... - ***/ -static void -asc_reset(struct asc_unit *scu) -{ - scu->cfg_byte = 0 ; /* clear... */ - scu->cmd_byte = 0 ; /* clear... */ - - outb(ASC_CFG,scu->cfg_byte); /* for safety, do this here */ - outb(ASC_CMD,scu->cmd_byte); /* probably not needed */ - tsleep((caddr_t)scu, PCATCH, "ascres", hz/10); /* sleep .1 sec */ - - scu->blen = DEFAULT_BLEN; - scu->btime = TIMEOUT; - scu->height = 0 ; /* don't know better... */ -} -/************************************************************************** - *** - *** ascprobe - *** read status port and check for proper configuration: - *** - if address group matches (status byte has reasonable value) - *** cannot check interrupt/dma, only clear the config byte. - ***/ -static int -ascprobe (struct isa_device *isdp) -{ - int unit = isdp->id_unit; - struct asc_unit *scu = unittab + unit; - int stb; - - scu->base = isdp->id_iobase; /*** needed by the following macros ***/ - scu->flags = FLAG_DEBUG; - - if ( isdp->id_iobase < 0 ) { - lprintf("asc%d.probe: no iobase given\n", unit); - return PROBE_FAIL; - } - - if ((stb=inb(ASC_PROBE)) != ASC_PROBE_VALUE) { - lprintf("asc%d.probe: failed, got 0x%02x instead of 0x%02x\n", - unit, stb, ASC_PROBE_VALUE); - return PROBE_FAIL; - } - -/* - * NOTE NOTE NOTE - * the new AmiScan Color board uses int 10,11,12 instead of 3,5,10 - * respectively. This means that the driver must act accordingly. - * Unfortunately there is no easy way of telling which board one has, - * other than trying to get an interrupt and noticing that it is - * missing. use "option ASC_NEW_BOARD" if you have a new board. - * - */ - -#if ASC_NEW_BOARD -#define ASC_IRQ_A 10 -#define ASC_IRQ_B 11 -#define ASC_IRQ_C 12 -#else -#define ASC_IRQ_A 3 -#define ASC_IRQ_B 5 -#define ASC_IRQ_C 10 -#endif - - switch(ffs(isdp->id_irq) - 1) { - case ASC_IRQ_A : - scu->int_byte = ASC_CNF_IRQ3; - break; - case ASC_IRQ_B : - scu->int_byte = ASC_CNF_IRQ5; - break; - case ASC_IRQ_C : - scu->int_byte = ASC_CNF_IRQ10; - break; -#if 0 - case -1: - scu->int_byte = 0; - lprintf("asc%d.probe: warning - going interruptless\n", unit); - break; -#endif - default: - lprintf("asc%d.probe: unsupported INT %d (only 3, 5, 10)\n", - unit, ffs(isdp->id_irq) - 1 ); - return PROBE_FAIL; - } - scu->dma_num = isdp->id_drq; - switch(scu->dma_num) { - case 1: - scu->dma_byte = ASC_CNF_DMA1; - break; - case 3: - scu->dma_byte = ASC_CNF_DMA3; - break; - default: - lprintf("asc%d.probe: unsupported DMA %d (only 1 or 3)\n", - unit, scu->dma_num); - return PROBE_FAIL; - } - asc_reset(scu); -/* lprintf("asc%d.probe: ok\n", unit); */ - - scu->flags &= ~FLAG_DEBUG; - scu->icnt = 0; - return PROBE_SUCCESS; -} - -/************************************************************************** - *** - *** ascattach - *** finish initialization of unit structure, get geometry value (?) - ***/ - -static int -ascattach(struct isa_device *isdp) -{ - int unit = isdp->id_unit; - struct asc_unit *scu = unittab + unit; - - isdp->id_intr = (inthand2_t *)ascintr; - scu->flags |= FLAG_DEBUG; - kprintf("asc%d: [GI1904/Trust Ami-Scan Grey/Color]\n", unit); - - /* - * Initialize buffer structure. - * XXX this must be done early to give a good chance of getting a - * contiguous buffer. This wastes memory. - */ - scu->sbuf.base = contigmalloc((unsigned long)MAX_BUFSIZE, M_DEVBUF, M_NOWAIT, - 0ul, 0xfffffful, 1ul, 0x10000ul); - if ( scu->sbuf.base == NULL ) - { - lprintf("asc%d.attach: buffer allocation failed\n", unit); - return ATTACH_FAIL; /* XXX attach must not fail */ - } - scu->sbuf.size = INVALID; - scu->sbuf.rptr = INVALID; - - scu->flags |= ATTACHED; -/* lprintf("asc%d.attach: ok\n", unit); */ - scu->flags &= ~FLAG_DEBUG; - -#define ASC_UID 0 -#define ASC_GID 13 - make_dev(&asc_ops, unit<<6, ASC_UID, ASC_GID, 0666, "asc%d", unit); - make_dev(&asc_ops, ((unit<<6) + FRMT_PBM), - ASC_UID, ASC_GID, 0666, "asc%dp", unit); - make_dev(&asc_ops, ((unit<<6) + DBUG_MASK), - ASC_UID, ASC_GID, 0666, "asc%dd", unit); - make_dev(&asc_ops, ((unit<<6) + DBUG_MASK+FRMT_PBM), - ASC_UID, ASC_GID, 0666, "asc%dpd", unit); - return ATTACH_SUCCESS; -} - -/************************************************************************** - *** - *** ascintr - *** the interrupt routine, at the end of DMA... - ***/ -static void -ascintr(void *arg) -{ - int unit = (int)arg; - struct asc_unit *scu = unittab + unit; - int chan_bit = 0x01 << scu->dma_num; - - scu->icnt++; - /* ignore stray interrupts... */ - if ((scu->flags & (OPEN |READING)) != (OPEN | READING) ) { - /* must be after closing... */ - scu->flags &= ~(OPEN | READING | DMA_ACTIVE | SLEEPING | SEL_COLL); - return; - } - if ( (scu->flags & DMA_ACTIVE) && (inb(DMA1_READY) & chan_bit) != 0) { - outb( ASC_CMD, ASC_STANDBY); - scu->flags &= ~DMA_ACTIVE; - /* bounce buffers... */ - isa_dmadone(BUF_CMD_READ, scu->sbuf.base+scu->sbuf.wptr, - scu->linesize, scu->dma_num); - scu->sbuf.wptr += scu->linesize; - if (scu->sbuf.wptr >= scu->sbuf.size) scu->sbuf.wptr=0; - scu->sbuf.count += scu->linesize; - if (scu->flags & SLEEPING) { - scu->flags &= ~SLEEPING; - wakeup((caddr_t)scu); - } - if (scu->sbuf.size - scu->sbuf.count >= scu->linesize) { - dma_restart(scu); - } - KNOTE(&scu->kqp.ki_note, 0); - } -} - -/************************************************************************** - *** - *** ascopen - *** set open flag, set modes according to minor number - *** FOR RELEASE: - *** don't switch scanner on, wait until first read or ioctls go before - ***/ - -STATIC int -ascopen(struct dev_open_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct asc_unit *scu; - int unit; - - unit = UNIT(minor(dev)) & UNIT_MASK; - if ( unit >= NASC ) - { -#ifdef ASCDEBUG - /* XXX lprintf isn't valid here since there is no scu. */ - kprintf("asc%d.open: unconfigured unit number (max %d)\n", unit, NASC); -#endif - return ENXIO; - } - scu = unittab + unit; - if ( !( scu->flags & ATTACHED ) ) - { - lprintf("asc%d.open: unit was not attached successfully 0x%04x\n", - unit, scu->flags); - return ENXIO; - } - - if ( minor(dev) & DBUG_MASK ) - scu->flags |= FLAG_DEBUG; - else - scu->flags &= ~FLAG_DEBUG; - - switch(minor(dev) & FRMT_MASK) { - case FRMT_PBM: - scu->flags |= PBM_MODE; - lprintf("asc%d.open: pbm mode\n", unit); - break; - case FRMT_RAW: - lprintf("asc%d.open: raw mode\n", unit); - scu->flags &= ~PBM_MODE; - break; - default: - lprintf("asc%d.open: gray maps are not yet supported", unit); - return ENXIO; - } - - lprintf("asc%d.open: minor %d icnt %ld\n", unit, minor(dev), scu->icnt); - - if ( scu->flags & OPEN ) { - lprintf("asc%d.open: already open", unit); - return EBUSY; - } - if (isa_dma_acquire(scu->dma_num)) - return(EBUSY); - - scu->flags = ATTACHED | OPEN; - - asc_reset(scu); - get_resolution(scu); - return SUCCESS; -} - -static int -asc_startread(struct asc_unit *scu) -{ - /*** from here on, things can be delayed to the first read/ioctl ***/ - /*** this was done in sub_12... ***/ - scu->cfg_byte= scu->cmd_byte=0; /* init scanner */ - outb(ASC_CMD, scu->cmd_byte); - /*** this was done in sub_16, set scan len... ***/ - outb(ASC_BOH, scu->portf_byte ); - if (geomtab[scu->geometry].g_res==0) { /* color */ - scu->cmd_byte = 0x00 ; - } else { - scu->cmd_byte = 0x90 ; - } - outb(ASC_CMD, scu->cmd_byte); - outb(ASC_LEN_L, scu->linesize & 0xff /* len_low */); - outb(ASC_LEN_H, (scu->linesize >>8) & 0xff /* len_high */); - /*** this was done in sub_21, config DMA ... ***/ - scu->cfg_byte |= scu->dma_byte; - outb(ASC_CFG, scu->cfg_byte); - /*** sub_22: enable int on the scanner ***/ - scu->cfg_byte |= scu->int_byte; - outb(ASC_CFG, scu->cfg_byte); - /*** sub_28: light on etc...***/ - scu->cmd_byte = ASC_STANDBY; - outb(ASC_CMD, scu->cmd_byte); - tsleep((caddr_t)scu, PCATCH, "ascstrd", hz/10); /* sleep .1 sec */ - return SUCCESS; -} - -/************************************************************************** - *** - *** ascclose - *** turn off scanner, release the buffer - *** should probably terminate dma ops, release int and dma. lr 12mar95 - ***/ - -STATIC int -ascclose(struct dev_close_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - int unit = UNIT(minor(dev)); - struct asc_unit *scu = unittab + unit; - - lprintf("asc%d.close: minor %d\n", - unit, minor(dev)); - - if ( unit >= NASC || !( scu->flags & ATTACHED ) ) { - lprintf("asc%d.close: unit was not attached successfully 0x%04x\n", - unit, scu->flags); - return ENXIO; - } - /* all this is in sub_29... */ - /* cli(); */ - outb(ASC_CFG, 0 ); /* don't save in CFG byte!!! */ - scu->cmd_byte &= ~ASC_LIGHT_ON; - outb(ASC_CMD, scu->cmd_byte);/* light off */ - tsleep((caddr_t)scu, PCATCH, "ascclo", hz/2); /* sleep 1/2 sec */ - scu->cfg_byte &= ~ scu->dma_byte ; /* disable scanner dma */ - scu->cfg_byte &= ~ scu->int_byte ; /* disable scanner int */ - outb(ASC_CFG, scu->cfg_byte); - /* --- disable dma controller ? --- */ - isa_dma_release(scu->dma_num); - /* --- disable interrupts on the controller (sub_24) --- */ - - scu->sbuf.size = INVALID; - scu->sbuf.rptr = INVALID; - - scu->flags &= ~(FLAG_DEBUG | OPEN | READING); - - return SUCCESS; -} - -static void -pbm_init(struct asc_unit *scu) -{ - int width = geomtab[scu->geometry].dpl; - int l= ksprintf(scu->sbuf.base,"P4 %d %d\n", width, scu->height); - char *p; - - scu->bcount = scu->height * width / 8 + l; - - /* move header to end of sbuf */ - scu->sbuf.rptr=scu->sbuf.size-l; - bcopy(scu->sbuf.base, scu->sbuf.base+scu->sbuf.rptr,l); - scu->sbuf.count = l; - if (geomtab[scu->geometry].g_res!=0) { /* BW scanner */ - for(p = scu->sbuf.base + scu->sbuf.rptr; l; p++, l--) - *p = ~*p; -} -} -/************************************************************************** - *** - *** ascread - ***/ - -STATIC int -ascread(struct dev_read_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - struct uio *uio = ap->a_uio; - int unit = UNIT(minor(dev)); - struct asc_unit *scu = unittab + unit; - size_t nbytes; - int res; - unsigned char *p; - - lprintf("asc%d.read: minor %d icnt %ld\n", unit, minor(dev), scu->icnt); - - if ( unit >= NASC || !( scu->flags & ATTACHED ) ) { - lprintf("asc%d.read: unit was not attached successfully 0x%04x\n", - unit, scu->flags); - return ENXIO; - } - - if ( !(scu->flags & READING) ) { /*** first read... ***/ - /* allocate a buffer for reading data and init things */ - if ( (res = buffer_allocate(scu)) == SUCCESS ) scu->flags |= READING; - else return res; - asc_startread(scu); - if ( scu->flags & PBM_MODE ) { /* initialize for pbm mode */ - pbm_init(scu); - } - } - - lprintf("asc%d.read(before): " - "sz 0x%x, rptr 0x%x, wptr 0x%x, cnt 0x%x bcnt 0x%x flags 0x%x icnt %ld\n", - unit, scu->sbuf.size, scu->sbuf.rptr, - scu->sbuf.wptr, scu->sbuf.count, scu->bcount,scu->flags, - scu->icnt); - - crit_enter(); - if ( scu->sbuf.count == 0 ) { /* no data avail., must wait */ - if (!(scu->flags & DMA_ACTIVE)) dma_restart(scu); - scu->flags |= SLEEPING; - res = tsleep((caddr_t)scu, PCATCH, "ascread", 0); - scu->flags &= ~SLEEPING; - if ( res == 0 ) res = SUCCESS; - } - crit_exit(); - if (scu->flags & FLAG_DEBUG) - tsleep((caddr_t)scu, PCATCH, "ascdly",hz); - lprintf("asc%d.read(after): " - "sz 0x%x, rptr 0x%x, wptr 0x%x, cnt 0x%x bcnt 0x%x flags 0x%x icnt %ld\n", - unit, scu->sbuf.size, scu->sbuf.rptr, - scu->sbuf.wptr, scu->sbuf.count, scu->bcount,scu->flags,scu->icnt); - - /* first, not more than available... */ - nbytes = szmin(uio->uio_resid, scu->sbuf.count); - /* second, contiguous data... */ - nbytes = szmin( nbytes, (scu->sbuf.size - scu->sbuf.rptr) ); - /* third, one line (will remove this later, XXX) */ - nbytes = szmin( nbytes, scu->linesize ); - if ( (scu->flags & PBM_MODE) ) - nbytes = szmin( nbytes, scu->bcount ); - lprintf("asc%d.read: transferring 0x%x bytes\n", unit, nbytes); - if (geomtab[scu->geometry].g_res!=0) { /* BW scanner */ - lprintf("asc%d.read: invert buffer\n",unit); - for(p = scu->sbuf.base + scu->sbuf.rptr, res=nbytes; res; p++, res--) - *p = ~*p; - } - res = uiomove(scu->sbuf.base + scu->sbuf.rptr, nbytes, uio); - if ( res != SUCCESS ) { - lprintf("asc%d.read: uiomove failed %d", unit, res); - return res; - } - - crit_enter(); - scu->sbuf.rptr += nbytes; - if (scu->sbuf.rptr >= scu->sbuf.size) scu->sbuf.rptr=0; - scu->sbuf.count -= nbytes; - /* having moved some data, can read mode */ - if (!(scu->flags & DMA_ACTIVE)) dma_restart(scu); - crit_exit(); - if ( scu->flags & PBM_MODE ) scu->bcount -= nbytes; - - lprintf("asc%d.read: size 0x%x, pointer 0x%x, bcount 0x%x, ok\n", - unit, scu->sbuf.size, scu->sbuf.rptr, scu->bcount); - - return SUCCESS; -} - -/************************************************************************** - *** - *** ascioctl - ***/ - -STATIC int -ascioctl(struct dev_ioctl_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - caddr_t data = ap->a_data; - int unit = UNIT(minor(dev)); - struct asc_unit *scu = unittab + unit; - - lprintf("asc%d.ioctl: minor %d\n", - unit, minor(dev)); - - if ( unit >= NASC || !( scu->flags & ATTACHED ) ) { - lprintf("asc%d.ioctl: unit was not attached successfully 0x%04x\n", - unit, scu->flags); - return ENXIO; - } - switch(ap->a_cmd) { - case ASC_GRES: - asc_reset(scu); - get_resolution(scu); - *(int *)data=geomtab[scu->geometry].dpi; - lprintf("asc%d.ioctl:ASC_GRES %ddpi\n", unit, *(int *)data); - return SUCCESS; - case ASC_GWIDTH: - *(int *)data=geomtab[scu->geometry].dpl; - lprintf("asc%d.ioctl:ASC_GWIDTH %d\n", unit, *(int *)data); - return SUCCESS; - case ASC_GHEIGHT: - *(int *)data=scu->height; - lprintf("asc%d.ioctl:ASC_GHEIGHT %d\n", unit, *(int *)data); - return SUCCESS; - case ASC_SHEIGHT: - lprintf("asc%d.ioctl:ASC_SHEIGHT %d\n", unit, *(int *)data); - if ( scu->flags & READING ) { - lprintf("asc%d:ioctl on already reading unit\n", unit); - return EBUSY; - } - scu->height=*(int *)data; - return SUCCESS; -#if 0 - case ASC_GBLEN: - *(int *)data=scu->blen; - lprintf("asc%d.ioctl:ASC_GBLEN %d\n", unit, *(int *)data); - return SUCCESS; - case ASC_SBLEN: - lprintf("asc%d.ioctl:ASC_SBLEN %d\n", unit, *(int *)data); - if (*(int *)data * geomtab[scu->geometry].dpl / 8 > MAX_BUFSIZE) - { - lprintf("asc%d:ioctl buffer size too high\n", unit); - return ENOMEM; - } - scu->blen=*(int *)data; - return SUCCESS; - case ASC_GBTIME: - *(int *)data = scu->btime / hz; - lprintf("asc%d.ioctl:ASC_GBTIME %d\n", unit, *(int *)data); - return SUCCESS; - case ASC_SBTIME: - scu->btime = *(int *)data * hz; - lprintf("asc%d.ioctl:ASC_SBTIME %d\n", unit, *(int *)data); - return SUCCESS; -#endif - default: return ENOTTY; - } - return SUCCESS; -} - -static struct filterops ascfiltops = - { FILTEROP_ISFD, NULL, ascfilter_detach, ascfilter }; - -STATIC int -asckqfilter(struct dev_kqfilter_args *ap) -{ - cdev_t dev = ap->a_head.a_dev; - int unit = UNIT(minor(dev)); - struct asc_unit *scu = unittab + unit; - struct knote *kn = ap->a_kn; - struct klist *klist; - - ap->a_result = 0; - - switch (kn->kn_filter) { - case EVFILT_READ: - kn->kn_fop = &ascfiltops; - kn->kn_hook = (caddr_t)scu; - break; - default: - ap->a_result = EOPNOTSUPP; - return (0); - } - - klist = &scu->kqp.ki_note; - knote_insert(klist, kn); - - return (0); -} - -STATIC void -ascfilter_detach(struct knote *kn) -{ - struct asc_unit *scu = (struct asc_unit *)kn->kn_hook; - struct klist *klist; - - klist = &scu->kqp.ki_note; - knote_remove(klist, kn); -} - -STATIC int -ascfilter(struct knote *kn, long hint) -{ - struct asc_unit *scu = (struct asc_unit *)kn->kn_hook; - int ready = 0; - - crit_enter(); - if (scu->sbuf.count >0) - ready = 1; - else { - if (!(scu->flags & DMA_ACTIVE)) - dma_restart(scu); - } - crit_exit(); - - return (ready); -} diff --git a/sys/platform/pc32/isa/ascreg.h b/sys/platform/pc32/isa/ascreg.h deleted file mode 100644 index 8fb314d1d4..0000000000 --- a/sys/platform/pc32/isa/ascreg.h +++ /dev/null @@ -1,97 +0,0 @@ -/* ascreg.h - port and bit definitions for the GI-1904 interface - * - * Copyright (c) 1995 Gunther Schadow. All rights reserved. - * Copyright (c) 1995 Luigi Rizzo. 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 Gunther Schadow. - * and Luigi Rizzo - * 4. 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 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: src/sys/i386/isa/ascreg.h,v 1.5 1999/08/28 00:44:37 peter Exp $ - * $DragonFly: src/sys/platform/pc32/isa/ascreg.h,v 1.2 2003/06/17 04:28:36 dillon Exp $ - */ - - /*** Registers (base=3EB): ************/ -#define ASC_CFG (scu->base) - /*** ASC_CFG 3EB: configuration register. Write only, mirror in RAM - *** 7 6 5 4 3 2 1 0 - *** - - I_5 I_3 I10 D_3 - D_1 - ***/ - /*** #define ASC_CNF_MASK 0x3D */ /* was 0x5a */ -#define ASC_CNF_DMA1 0x01 /* was (~0x02 & ASC_CNF_MASK) */ -#define ASC_CNF_DMA3 0x04 /* was (~0x08 & ASC_CNF_MASK) */ -#define ASC_CNF_IRQ3 0x10 /* was (~0x10 & ASC_CNF_MASK) */ -#define ASC_CNF_IRQ5 0x20 /* was (~0x40 & ASC_CNF_MASK) */ -#define ASC_CNF_IRQ10 0x08 /* was (~0x40 & ASC_CNF_MASK) */ - - /*** ASC_STAT 3EC: command/status; rw, mirror in ram - *** 7 6 5 4 3 2 1 0 - *** BSY - - - - - - - - *** [<-- Resolution -->] 13h,10h,0eh,0ch,09h, 07h, 04h, 02h - ***/ -#define ASC_STAT (scu->base + 1) - -#define ASC_RDY_FLAG 0x80 -#define ASC_RES_MASK 0x3f -#define ASC_RES_800 0x13 -#define ASC_RES_700 0x10 -#define ASC_RES_600 0x0e -#define ASC_RES_500 0x0c -#define ASC_RES_400 0x09 /* 0x00 */ -#define ASC_RES_300 0x07 /* 0x04 */ -#define ASC_RES_200 0x04 /* 0x20 */ -#define ASC_RES_100 0x02 /* 0x24 */ - - /*** ASC_CMD 3EC: command/status; rw, mirror in ram - *** W: 7 6 5 4 3 2 1 0 - *** . - - . . . . . - *** b0: 1: light on & get resolution, 0: light off - *** b1: 0: load scan len (sub_16, with b4=1, b7=1) - *** b2: 1/0 : dma stuff - *** b3: 0/1 : dma stuff - *** b4: 1 : load scan len (sub_16, with b1=0, b7=1) - *** b5: ? - *** b6: ? - *** b7: ? : set at beginning of sub_16 - ***/ -#define ASC_CMD (scu->base + 1) - -#define ASC_LIGHT_ON 0x01 -#define ASC_SET_B2 0x04 -#define ASC_OPERATE 0x91 /* from linux driver... */ -#define ASC_STANDBY 0x05 /* from linux driver... */ - - /*** ASC_LEN_L, ASC_LEN_H 3ED, 3EE: transfer length, lsb first ***/ -#define ASC_LEN_L ((scu->base)+2) -#define ASC_LEN_H ((scu->base)+3) - - /*** 3EE ASC_PROBE (must read ASC_PROBE_VALUE) ***/ -#define ASC_PROBE ((scu->base)+3) -#define ASC_PROBE_VALUE 0xA5 - - /*** ASC_BOH 3EF: always write 0 at the moment, read some values ? ***/ -#define ASC_BOH ((scu->base)+4) diff --git a/sys/platform/pc64/conf/files b/sys/platform/pc64/conf/files index 9297f5458a..fb74cf16ea 100644 --- a/sys/platform/pc64/conf/files +++ b/sys/platform/pc64/conf/files @@ -222,4 +222,3 @@ platform/pc64/isa/clock.c standard platform/pc64/isa/isa_intr.c standard platform/pc64/x86_64/spinlock.s standard dev/netif/elink_layer/elink.c optional ep -dev/netif/elink_layer/elink.c optional ie diff --git a/usr.bin/Makefile b/usr.bin/Makefile index db221d26d4..a14e5e187c 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -262,7 +262,6 @@ SUBDIR+=doscmd \ gprof4 \ ncplist \ ncplogin \ - sasc \ smbutil .endif diff --git a/usr.bin/mt/mt.1 b/usr.bin/mt/mt.1 index 62b1962f68..6cd798d57d 100644 --- a/usr.bin/mt/mt.1 +++ b/usr.bin/mt/mt.1 @@ -32,7 +32,6 @@ .\" .\" @(#)mt.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD: src/usr.bin/mt/mt.1,v 1.19.2.8 2002/11/08 11:35:57 joerg Exp $ -.\" $DragonFly: src/usr.bin/mt/mt.1,v 1.2 2003/06/17 04:29:29 dillon Exp $ .\" .Dd June 6, 1993 .Dt MT 1 @@ -331,8 +330,6 @@ is not given. .El .Sh FILES .Bl -tag -width /dev/*rst[0-9]*xx -compact -.It Pa /dev/*rwt* -QIC-02/QIC-36 magnetic tape interface .It Pa /dev/*rsa[0-9]* SCSI magnetic tape interface .El @@ -341,7 +338,6 @@ SCSI magnetic tape interface .Xr ioctl 2 , .Xr mtio 4 , .Xr sa 4 , -.Xr wt 4 , .Xr environ 7 .Sh HISTORY The diff --git a/usr.bin/sasc/Makefile b/usr.bin/sasc/Makefile deleted file mode 100644 index c87c48db89..0000000000 --- a/usr.bin/sasc/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# @(#)Makefile 8.1 (Berkeley) 6/6/93 -# $DragonFly: src/usr.bin/sasc/Makefile,v 1.3 2007/08/27 16:50:58 pavalos Exp $ - -PROG= sasc - -.include diff --git a/usr.bin/sasc/README b/usr.bin/sasc/README deleted file mode 100644 index 5436bd2717..0000000000 --- a/usr.bin/sasc/README +++ /dev/null @@ -1,9 +0,0 @@ -ASC - A device driver for a handy scanner - -This is a device driver for GI1904-based hand scanners, e.g. the Trust -Amiscan Grey and possibly others. The driver is based on the "gsc" -driver and, partly, on a Linux driver. - -The driver has a working select(). - --Luigi Rizzo (luigi@iet.unipi.it) diff --git a/usr.bin/sasc/sasc.1 b/usr.bin/sasc/sasc.1 deleted file mode 100644 index 9edd882937..0000000000 --- a/usr.bin/sasc/sasc.1 +++ /dev/null @@ -1,106 +0,0 @@ -.\" sasc(1) - manual page for the `asc' scanner device driver utility -.\" -.\" -.\" Copyright (c) 1995 Gunther Schadow. 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 Gunther Schadow. -.\" 4. 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 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: src/usr.bin/sasc/sasc.1,v 1.9.2.2 2000/12/19 16:22:26 ru Exp $ -.\" $DragonFly: src/usr.bin/sasc/sasc.1,v 1.4 2005/08/01 01:49:18 swildner Exp $ -.\" -.Dd January 6, 1995 -.Dt SASC 1 -.Os -.Sh NAME -.Nm sasc -.Nd set the options of the asc scanner device -.Sh SYNOPSIS -.Nm -.Op Fl sq -.Op Fl b Ar len -.Op Fl f Ar file -.Op Fl h Ar height -.Op Fl r Ar resolution -.Op Fl t Ar timeout -.Op Fl w Ar width -.Sh DESCRIPTION -The -.Nm -utility provides shell level access to the ioctl -requests served by the handy scanner device driver asc. -Please see -.Xr asc 4 -for the exact meaning of the requests. Generally they modify -the output and behavior of the asc scanner device. -When -.Nm -is called with no option only the current settings are reported. -.Pp -The following options are available: -.Bl -tag -width indent -.It Fl s Bq Dv ASC_SRESSW -Set the scanner with the values of the resolution selector switch. -.It Fl q -Operate in quiet mode, i.e. do not report any of the current settings. -Normally the parameters are shown after the modifications have been -performed. -.It Fl f Ar file -Operate on a different scanner device node given by filename. -Note -that even though there may exist more than one node of scanner device -several of them will refer the same device unit. -The modifications are -performed od the unit regardless of the device node by which it is -accessed. -.It Fl r Ar resolution Bq Dv ASC_SRES -Set the resolution in dpi. -.It Fl w Ar width Bq Dv ASC_SWIDTH -Set the width of the bitmap in pixels. -.It Fl h Ar height Bq Dv ASC_SHEIGHT -Set the height of the bitmap in lines of pixels. -.It Fl b Ar len Bq Dv ASC_SBLEN -Set the internal dma buffer to be -.Ar len -lines in size. -.It Fl t Ar timeout Bq Dv ASC_SBTIME -Set the timeout time for reading one dma buffer. -.El -.Sh FILES -.Bl -tag -width /var/rwho/whod.* -compact -.It Pa /dev/asc0 -device node for -.Em raw -output. -.It Pa /dev/asc0p -device node for output in -.Em pbm -file format. -.El -.Sh SEE ALSO -.Xr asc 4 -.Sh AUTHORS -.An Gunther Schadow Aq gusw@fub46.zedat.fu-berlin.de -.An Liam J. Foy Aq liamfoy@sepulcrum.org diff --git a/usr.bin/sasc/sasc.c b/usr.bin/sasc/sasc.c deleted file mode 100644 index 2bf3e42c21..0000000000 --- a/usr.bin/sasc/sasc.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * sasc(1) - utility for the `asc' scanner device driver - * - * Copyright (c) 1995 Gunther Schadow. All rights reserved. - * Copyright (c) 2004 Liam J. Foy. 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 Gunther Schadow. - * 4. 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 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: src/usr.bin/sasc/sasc.c,v 1.7.2.1 2000/06/30 09:47:52 ps Exp $ - * $DragonFly: src/usr.bin/sasc/sasc.c,v 1.6 2007/01/21 10:40:39 swildner Exp $ - * - */ - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -#define DEFAULT_FILE "/dev/asc0" - -static int getnum(const char *); -static int asc_get(int, u_long); -static void asc_set(int, u_long, int, const char *); -static void usage(void); - -static void -usage(void) -{ - fprintf(stderr, - "usage: sasc [-sq] [-f file] [-r dpi] [-w width] [-h height]" - "[-b len] [-t time]\n"); - exit(1); -} - -/* Check given numerical arguments */ -static int -getnum(const char *str) -{ - long val; - char *ep; - - errno = 0; - val = strtol(str, &ep, 10); - if (errno) - err(1, "strtol failed: %s", str); - - if (str == ep || *ep != '\0') - errx(1, "invalid value: %s", str); - - if (val > INT_MAX || val < INT_MIN) { - errno = ERANGE; - errc(1, errno, "getnum failed:"); - } - - return((int)val); -} - -static void -asc_set(int fd, u_long asc_setting, int asc_value, const char *asc_type) -{ - if (ioctl(fd, asc_setting, &asc_value) < 0) - err(1, "ioctl failed setting %s(%d)", asc_type, asc_value); - - printf("Successfully set\n"); -} - -static int -asc_get(int fd, u_long asc_setting) -{ - int asc_value; - - if (ioctl(fd, asc_setting, &asc_value) < 0) - err(1, "ioctl failed"); - - return(asc_value); -} - -int -main(int argc, char **argv) -{ - const char *file = DEFAULT_FILE; - int c, fd; - int show_dpi, show_width, show_height; - int show_blen, show_btime, show_all; - int set_blen, set_dpi, set_width; - int set_height, set_btime, set_switch; - - show_dpi = show_width = show_height = 0; - show_blen = show_btime = show_all = 0; - - set_blen = set_dpi = set_width = 0; - set_height = set_btime = set_switch = 0; - - while ((c = getopt(argc, argv, "sqf:b:r:w:h:t:")) != -1) { - switch (c) { - case 'f': - file = optarg; - break; - case 'r': - set_dpi = getnum(optarg); - break; - case 'w': - set_width = getnum(optarg); - break; - case 'h': - set_height = getnum(optarg); - break; - case 'b': - set_blen = getnum(optarg); - break; - case 't': - set_btime = getnum(optarg); - break; - case 's': - set_switch = 1; - break; - case 'q': - show_all = 1; - break; - default: - usage(); - } - } - - if (argc == 1) - show_all = 1; - - if ((fd = open(file, O_RDWR)) == -1) - err(1, "Unable to open: %s", file); - - if (set_switch) { - if (ioctl(fd, ASC_SRESSW) < 0) - err(1, "ioctl: ASC_SRESSW failed"); - } - - if (set_dpi) - asc_set(fd, ASC_SRES, set_dpi, "ASC_SRES"); - - if (set_width) - asc_set(fd, ASC_SWIDTH, set_width, "ASC_SWIDTH"); - - if (set_height) - asc_set(fd, ASC_SHEIGHT, set_height, "ASC_SHEIGHT"); - - if (set_blen) - asc_set(fd, ASC_SBLEN, set_blen, "ASC_SBLEN"); - - if (set_btime) - asc_set(fd, ASC_SBTIME, set_btime, "ASC_SBTIME"); - - if (show_all) { - show_dpi = asc_get(fd, ASC_GRES); - show_width = asc_get(fd, ASC_GWIDTH); - show_height = asc_get(fd, ASC_GHEIGHT); - show_blen = asc_get(fd, ASC_GBLEN); - show_btime = asc_get(fd, ASC_GBTIME); - - printf("Device: %s\n", file); - printf("Resolution: %d dpi\n", show_dpi); - printf("Width: %d\n", show_width); - printf("Height: %d\n", show_height); - printf("Buffer length: %d\n", show_blen); - printf("Buffer timeout: %d\n", show_btime); - } - return 0; -} diff --git a/usr.bin/stat/stat.1 b/usr.bin/stat/stat.1 index 13189a300a..ca1eb2bff0 100644 --- a/usr.bin/stat/stat.1 +++ b/usr.bin/stat/stat.1 @@ -1,5 +1,4 @@ .\" $NetBSD: stat.1,v 1.11 2003/05/08 13:07:10 wiz Exp $ -.\" $DragonFly: src/usr.bin/stat/stat.1,v 1.6 2007/11/04 16:33:19 swildner Exp $ .\" Copyright (c) 2002 The NetBSD Foundation, Inc. .\" All rights reserved. .\" @@ -471,10 +470,10 @@ following format: .Bd -literal -offset indent stat -f "Name: %N%n%tType: %HT%n%tMajor: %Hr%n%tMinor: %Lr%n%n" /dev/* [...] -Name: /dev/wt8 - Type: Block Device - Major: 3 - Minor: 8 +Name: /dev/xpt0 + Type: Character Device + Major: 28 + Minor: 0 Name: /dev/zero Type: Character Device diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 135151a7ec..cbd446bcca 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -175,10 +175,7 @@ SUBDIR+=apm \ .endif .if ${MACHINE_ARCH} == "i386" -SUBDIR+=sgsc \ - stallion \ - wlconfig \ - xten +SUBDIR+=stallion .if !defined(NO_I4B) SUBDIR+=i4b diff --git a/usr.sbin/moused/moused.8 b/usr.sbin/moused/moused.8 index c44e9456ea..8225f3fcd3 100644 --- a/usr.sbin/moused/moused.8 +++ b/usr.sbin/moused/moused.8 @@ -29,7 +29,6 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/usr.sbin/moused/moused.8,v 1.47 2004/10/11 07:57:08 philip Exp $ -.\" $DragonFly: src/usr.sbin/moused/moused.8,v 1.9 2008/02/08 10:17:40 matthias Exp $ .\" .Dd February 8, 2008 .Dt MOUSED 8 @@ -189,8 +188,7 @@ information are: .Bl -tag -compact -width modelxxx .It Ar port Port (device file) name, i.e.\& -.Pa /dev/cuaa0 , -.Pa /dev/mse0 +.Pa /dev/cuaa0 and .Pa /dev/psm0 . .It Ar if @@ -443,10 +441,8 @@ what matters. The USB mouse has a flat rectangular connector. .Pp The next thing to decide is a port to use for the given interface. -For the bus, InPort and PS/2 mice, there is little choice: -the bus and InPort mice always use -.Pa /dev/mse0 , -and the PS/2 mouse is always at +For the PS/2 mouse, there is little choice: +it is always at .Pa /dev/psm0 . There may be more than one serial port to which the serial mouse can be attached. @@ -587,8 +583,6 @@ the mice is combined all together. .Bl -tag -width /dev/consolectl -compact .It Pa /dev/consolectl device to control the console -.It Pa /dev/mse%d -bus and InPort mouse driver .It Pa /dev/psm%d PS/2 mouse driver .It Pa /dev/sysmouse @@ -675,7 +669,6 @@ option to assign the physical right button to the logical middle button: .Xr kill 1 , .Xr vidcontrol 1 , .Xr keyboard 4 , -.Xr mse 4 , .Xr psm 4 , .Xr screen 4 , .Xr sysmouse 4 , diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index 1b6894d1a6..7047b051e8 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -46,7 +46,6 @@ /* * $FreeBSD: src/usr.sbin/moused/moused.c,v 1.69 2005/01/06 08:38:29 philip Exp $ - * $DragonFly: src/usr.sbin/moused/moused.c,v 1.7 2008/11/12 21:44:59 swildner Exp $ */ #include #include @@ -759,15 +758,6 @@ main(int argc, char *argv[]) /* the default port name */ switch(rodent.rtype) { - case MOUSE_PROTO_INPORT: - /* INPORT and BUS are the same... */ - rodent.rtype = MOUSE_PROTO_BUS; - /* FALLTHROUGH */ - case MOUSE_PROTO_BUS: - if (!rodent.portname) - rodent.portname = "/dev/mse0"; - break; - case MOUSE_PROTO_PS2: if (!rodent.portname) rodent.portname = "/dev/psm0"; diff --git a/usr.sbin/mrouted/mrouted.8 b/usr.sbin/mrouted/mrouted.8 index acc9e4227c..f85fc3a598 100644 --- a/usr.sbin/mrouted/mrouted.8 +++ b/usr.sbin/mrouted/mrouted.8 @@ -1,7 +1,6 @@ .\"COPYRIGHT 1989 by The Board of Trustees of Leland Stanford Junior University. .\" .\" $FreeBSD: src/usr.sbin/mrouted/mrouted.8,v 1.16.2.8 2003/03/11 22:31:29 trhodes Exp $ -.\" $DragonFly: src/usr.sbin/mrouted/mrouted.8,v 1.6 2008/05/02 02:05:08 swildner Exp $ .\" .Dd May 8, 1995 .Dt MROUTED 8 @@ -408,11 +407,11 @@ school. name LOCAL 239.255.0.0/16 name EE 239.254.0.0/16 # -# le1 is our gateway to compsci, don't forward our +# lnc1 is our gateway to compsci, don't forward our # local groups to them -phyint le1 boundary EE +phyint lnc1 boundary EE # -# le2 is our interface on the classroom net, it has four +# lnc2 is our interface on the classroom net, it has four # different length subnets on it. # note that you can use either an ip address or an # interface name diff --git a/usr.sbin/mrouted/mrouted.conf b/usr.sbin/mrouted/mrouted.conf index 73061e20f4..43ce054a5b 100644 --- a/usr.sbin/mrouted/mrouted.conf +++ b/usr.sbin/mrouted/mrouted.conf @@ -1,5 +1,4 @@ # $FreeBSD: src/usr.sbin/mrouted/mrouted.conf,v 1.9 1999/08/28 01:17:06 peter Exp $ -# $DragonFly: src/usr.sbin/mrouted/mrouted.conf,v 1.2 2003/06/17 04:29:57 dillon Exp $ # mrouted.conf,v 3.8 1995/11/29 22:40:47 fenner Rel # # This is the configuration file for "mrouted", an IP multicast router. @@ -27,7 +26,7 @@ #name EE 239.254.0.0/16 # i.e. the EE dept wants local groups # # Example of use of named boundary -#phyint le1 boundary EE # le1 is our interface to comp sci, +#phyint lnc1 boundary EE # lnc1 is our interface to comp sci, # # keep them away from our local groups # # diff --git a/usr.sbin/sgsc/Makefile b/usr.sbin/sgsc/Makefile deleted file mode 100644 index 5fdc4909f6..0000000000 --- a/usr.sbin/sgsc/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -# $FreeBSD: src/usr.sbin/sgsc/Makefile,v 1.4 1999/08/28 01:19:56 peter Exp $ -# $DragonFly: src/usr.sbin/sgsc/Makefile,v 1.2 2003/06/17 04:30:03 dillon Exp $ - -PROG= sgsc - -.include diff --git a/usr.sbin/sgsc/sgsc.1 b/usr.sbin/sgsc/sgsc.1 deleted file mode 100644 index 29733c05eb..0000000000 --- a/usr.sbin/sgsc/sgsc.1 +++ /dev/null @@ -1,105 +0,0 @@ -.\" sgsc(1) - manual page for the `gsc' scanner device driver utility -.\" -.\" -.\" Copyright (c) 1995 Gunther Schadow. 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 Gunther Schadow. -.\" 4. 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 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 -.\" -.\" $FreeBSD: src/usr.sbin/sgsc/sgsc.1,v 1.8.2.2 2001/03/06 14:21:43 ru Exp $ -.\" $DragonFly: src/usr.sbin/sgsc/sgsc.1,v 1.3 2007/11/23 23:03:57 swildner Exp $ -.\" -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -.Dd January 6, 1995 -.Dt SGSC 1 -.Os -.Sh NAME -.Nm sgsc -.Nd set the options of the gsc scanner device -.Sh SYNOPSIS -.Nm -.Op Fl sq -.Op Fl b Ar len -.Op Fl f Ar file -.Op Fl h Ar height -.Op Fl r Ar resolution -.Op Fl t Ar timeout -.Op Fl w Ar width -.Sh DESCRIPTION -The -.Nm -utility provides shell level access to the ioctl -requests served by the handy scanner device driver gsc. -Please see -.Xr gsc 4 -for the exact meaning of the requests. Generally they modify -the output and behaviour of the gsc scanner device. -When -.Nm -is called with no option only the current settings are reported. -.Pp -The following options are available: -.Bl -tag -width indent -.It Fl s Bq Dv GSC_SRESSW -Set the scanner with the values of the resolution selector switch. -.It Fl q -Operate in quiet mode, i.e. do not report any of the current settings. -Normally the parameters are shown after the modifications have been -performed. -.It Fl f Ar file -Operate on a different scanner device node given by filename. -Note -that even though there may exist more than one node of scanner device -several of them will refer the same device unit. -The modifications are -performed od the unit regardless of the device node by which it is -accessed. -.It Fl r Ar resolution Bq Dv GSC_SRES -Set the resolution in dpi. -.It Fl w Ar width Bq Dv GSC_SWIDTH -Set the width of the bitmap in pixels. -.It Fl h Ar height Bq Dv GSC_SHEIGHT -Set the height of the bitmap in lines of pixels. -.It Fl b Ar len Bq Dv GSC_SBLEN -Set the internal dma buffer to be -.Ar len -lines in size. -.It Fl t Ar timeout Bq Dv GSC_SBTIME -Set the timeout time for reading one dma buffer. -.El -.Sh FILES -.Bl -tag -width /dev/gsc0p -compact -.It Pa /dev/gsc0 -device node for -.Em raw -output -.It Pa /dev/gsc0p -device node for output in -.Em pbm -file format -.El -.Sh SEE ALSO -.Xr gsc 4 -.Sh AUTHORS -.An Gunther Schadow Aq gusw@fub46.zedat.fu-berlin.de diff --git a/usr.sbin/sgsc/sgsc.c b/usr.sbin/sgsc/sgsc.c deleted file mode 100644 index fce1aee085..0000000000 --- a/usr.sbin/sgsc/sgsc.c +++ /dev/null @@ -1,161 +0,0 @@ -/* sgsc(1) - utility for the `gsc' scanner device driver - * - * - * Copyright (c) 1995 Gunther Schadow. 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 Gunther Schadow. - * 4. 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 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: src/usr.sbin/sgsc/sgsc.c,v 1.5 1999/08/28 01:19:57 peter Exp $ - * $DragonFly: src/usr.sbin/sgsc/sgsc.c,v 1.3 2005/12/05 02:40:28 swildner Exp $ - */ - -#include -#include -#include -#include -#include -#include -#include - -#ifndef DEFAULT_FILE -#define DEFAULT_FILE "/dev/gsc0" -#endif -#ifdef FAIL -#undef FAIL -#endif -#define FAIL -1 - -static void -usage(void) -{ - fprintf(stderr, "%s\n%s\n", - "usage: sgsc [-sq] [-f file] [-r dpi] [-w width] [-h height]", - " [-b len] [-t time]"); - exit(1); -} - -int -main(int argc, char **argv) -{ - char c; - int fd; - - const char *file = DEFAULT_FILE; - - int show_dpi = 0; - int show_width = 0; - int show_height = 0; - int show_blen = 0; - int show_btime = 0; - int show_all = 1; - - int set_blen = 0; - int set_dpi = 0; - int set_width = 0; - int set_height = 0; - int set_btime = 0; - int set_switch = 0; - - if (argc == 0) usage(); - - while( (c = getopt(argc, argv, "sqf:b:r:w:h:t:")) != FAIL) - { - switch(c) { - case 'f': file = optarg; break; - case 'r': set_dpi = atoi(optarg); break; - case 'w': set_width = atoi(optarg); break; - case 'h': set_height = atoi(optarg); break; - case 'b': set_blen = atoi(optarg); break; - case 't': set_btime = atoi(optarg); break; - case 's': set_switch = 1; break; - case 'q': show_all = 0; break; - default: usage(); - } - } - - fd = open(file, O_RDONLY); - if ( fd == FAIL ) - err(1, "%s", file); - - if (set_switch != 0) - { - if(ioctl(fd, GSC_SRESSW) == FAIL) - err(1, "GSC_SRESSW"); - } - - if (set_dpi != 0) - { - if(ioctl(fd, GSC_SRES, &set_dpi) == FAIL) - err(1, "GSC_SRES"); - } - - if (set_width != 0) - { - if(ioctl(fd, GSC_SWIDTH, &set_width) == FAIL) - err(1, "GSC_SWIDTH"); - } - - if (set_height != 0) - { - if(ioctl(fd, GSC_SHEIGHT, &set_height) == FAIL) - err(1, "GSC_SHEIGHT"); - } - - if (set_blen != 0) - { - if(ioctl(fd, GSC_SBLEN, &set_blen) == FAIL) - err(1, "GSC_SBLEN"); - } - - if (set_btime != 0) - { - if(ioctl(fd, GSC_SBTIME, &set_btime) == FAIL) - err(1, "GSC_SBTIME"); - } - - if (show_all != 0) - { - if(ioctl(fd, GSC_GRES, &show_dpi) == FAIL) - err(1, "GSC_GRES"); - if(ioctl(fd, GSC_GWIDTH, &show_width) == FAIL) - err(1, "GSC_GWIDTH"); - if(ioctl(fd, GSC_GHEIGHT, &show_height) == FAIL) - err(1, "GSC_GHEIGHT"); - if(ioctl(fd, GSC_GBLEN, &show_blen) == FAIL) - err(1, "GSC_GBLEN"); - if(ioctl(fd, GSC_GBTIME, &show_btime) == FAIL) - err(1, "GSC_GBTIME"); - - printf("%s:\n", file); - printf("resolution\t %d dpi\n", show_dpi); - printf("width\t\t %d\n", show_width); - printf("height\t\t %d\n",show_height); - printf("buffer length\t %d\n", show_blen); - printf("buffer timeout\t %d\n", show_btime); - } - - return 0; -} diff --git a/usr.sbin/wlconfig/Makefile b/usr.sbin/wlconfig/Makefile deleted file mode 100644 index 3637bf62ad..0000000000 --- a/usr.sbin/wlconfig/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD: src/usr.sbin/wlconfig/Makefile,v 1.3.2.1 2001/04/25 12:11:12 ru Exp $ -# $DragonFly: src/usr.sbin/wlconfig/Makefile,v 1.3 2008/10/29 18:18:05 swildner Exp $ -PROG= wlconfig -MAN= wlconfig.8 -WARNS?= 2 - -.include diff --git a/usr.sbin/wlconfig/wlconfig.8 b/usr.sbin/wlconfig/wlconfig.8 deleted file mode 100644 index 308488fa39..0000000000 --- a/usr.sbin/wlconfig/wlconfig.8 +++ /dev/null @@ -1,138 +0,0 @@ -.\" $FreeBSD: src/usr.sbin/wlconfig/wlconfig.8,v 1.7.2.10 2003/03/11 22:31:35 trhodes Exp $ -.\" -.Dd December 26, 1996 -.Dt WLCONFIG 8 -.Os -.Sh NAME -.Nm wlconfig -.Nd read/write wavelan config parameters -.Sh SYNOPSIS -.Nm -.Ar ifname -.Op Ar param value ... -.Sh DESCRIPTION -The -.Nm -utility can be used to read and set parameters for the NCR/AT&T Wavelan -radio LAN card. Various parameters stored in the non-volatile Parameter -Storage Area (PSA) on the card can be modified with this program, replacing -the DOS-based -.Nm instconf.exe -program. It can also be used to interrogate the optional signal -strength cache which may have been compiled into the driver. -.Pp -The -.Ar ifname -parameter specifies the wavelan interface name (eg. -.Pa wl0 ) . -If no other arguments are supplied, the current contents of the PSA -are interpreted and displayed. -.Pp -The -.Ar param -and -.Ar value -arguments can be used to change the value of several parameters. -Any number of -.Ar param value -pairs may be supplied. -.Bl -tag -width 15n -offset indent -.It Va param -.Va value -.It irq -IRQ value (used at next reset), may be one of 3,4,5,6,10,11,12,15. -.It mac -Local MAC value (ethernet address). -.It macsel -.Sq soft -(as set by the -.Sq mac -parameter) or -.Sq default -(as set at the factory). -.It nwid -The NWID is a 2-byte parameter passed to the card's radio modem. -NWIDs allow multiple logically discrete networks to operate -independently whilst occupying the same airspace. -Packets with a different NWID are simply ignored by the modem. -In the hardware, NWIDs are stored long-term in non-volatile memory -(called the PSA or programmable storage area), and are loaded by -software into the radio modem when the driver is -initialized. This sets the default NWID loaded at startup. -.It currnwid -This sets the current operating NWID (but does not save it to the -PSA). -.It cache -The driver may maintain a per interface fixed size cache of signal strength, -silence, and quality levels, which are indexed by sender MAC addresses. -Input packets are stored in the cache, and when received, the values -stored in the radio modem are interrogated and stored. -There are also two sysctl values (iponly and multicast only) which -can be used for filtering out some input packets. By default, the -cache mechanism stores only non-unicast IP packets, but this can -be changed with -.Xr sysctl 8 . -Each non-filtered -input packet causes a cache update, hence one can monitor -the antennae signal strength to a remote system. -There are three commands that can be given as values: -.Sq raw , -which prints out the raw signal strength data as found in the radio -modem hardware value, -.Sq scale , -which scales the raw hardware values to 0..100%, and -.Sq zero -which clears out the cache in case you want to store new samples. -.El -.Pp -Note that if the IRQ on the Wavelan card is incorrect, the interface -will be configured, but will not function. The -.Nm -utility should then be used to reconfigure the card to a sensible -value. -.Sh EXAMPLES -Set the NWID to 0x1234: -.Bd -literal -offset -# wlconfig wl0 nwid 0x1234 -.Ed -.Pp -Show the current settings: -.Bd -literal -offset -# wlconfig wl0 -Board type : ISA -Base address options : 0x300, 0x390, 0x3c0, 0x3e0 -Waitstates : 0 -Bus mode : ISA -IRQ : 10 -Default MAC address : 08:00:0e:20:3d:4b -Soft MAC address : 00:00:00:00:00:00 -Current MAC address : Default -Adapter compatibility : PC-AT 2.4GHz -Threshold preset : 1 -Call code required : NO -Subband : 2425MHz -Quality threshold : 3 -Hardware version : 0 (Rel1/Rel2) -Network ID enable : YES -NWID : 0xdead -Datalink security : NO -Databus width : 16 (variable) -Configuration state : unconfigured -CRC-16 : 0x3c26 -CRC status : OK -.Ed -.Pp -Print a scaled version of the signal strength cache: -.Bd -literal -offset -# wlconfig wl0 cache scale -.Ed -.Sh SEE ALSO -.Xr wl 4 , -.Xr sysctl 8 -.Sh HISTORY -This implementation of the -.Nm -utility is completely new, written for Hilink Internet by -.An Michael Smith , -and updated by -.An Jim Binkley &c . diff --git a/usr.sbin/wlconfig/wlconfig.c b/usr.sbin/wlconfig/wlconfig.c deleted file mode 100644 index c3ed3660b4..0000000000 --- a/usr.sbin/wlconfig/wlconfig.c +++ /dev/null @@ -1,415 +0,0 @@ -/* - * Copyright (C) 1996 - * Michael Smith. 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. - * - * THIS SOFTWARE IS PROVIDED BY Michael Smith AND CONTRIBUTORS ``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 Michael Smith OR CONTRIBUTORS 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: src/usr.sbin/wlconfig/wlconfig.c,v 1.8.2.2 2001/07/19 05:24:10 kris Exp $ - * $DragonFly: src/usr.sbin/wlconfig/wlconfig.c,v 1.3 2005/12/05 01:23:23 swildner Exp $ - */ - -/* - * wlconfig.c - * - * utility to read out and change various WAVELAN parameters. - * Currently supports NWID and IRQ values. - * - * The NWID is used by 2 or more wavelan controllers to determine - * if packets should be received or not. It is a filter that - * is roughly analogous to the "channel" setting with a garage - * door controller. Two companies side by side with wavelan devices - * that could actually hear each other can use different NWIDs - * and ignore packets. In truth however, the air space is shared, - * and the NWID is a virtual filter. - * - * In the current set of wavelan drivers, ioctls changed only - * the runtime radio modem registers which act in a manner analogous - * to an ethernet transceiver. The ioctls do not change the - * stored nvram PSA (or parameter storage area). At boot, the PSA - * values are stored in the radio modem. Thus when the - * system reboots it will restore the wavelan NWID to the value - * stored in the PSA. The NCR/ATT dos utilities must be used to - * change the initial NWID values in the PSA. The wlconfig utility - * may be used to set a different NWID at runtime; this is only - * permitted while the interface is up and running. - * - * By contrast, the IRQ value can only be changed while the - * Wavelan card is down and unconfigured, and it will remain - * disabled after an IRQ change until reboot. - * - */ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -/* translate IRQ bit to number */ -/* array for maping irq numbers to values for the irq parameter register */ -static int irqvals[16] = { - 0, 0, 0, 0x01, 0x02, 0x04, 0, 0x08, 0, 0, 0x10, 0x20, 0x40, 0, 0, 0x80 -}; - -/* cache */ -static int w_sigitems; /* count of valid items */ -static struct w_sigcache wsc[MAXCACHEITEMS]; - -int -wlirq(int irqval) -{ - int irq; - - for(irq = 0; irq < 16; irq++) - if(irqvals[irq] == irqval) - return(irq); - return 0; -} - -char *compat_type[] = { - "PC-AT 915MHz", - "PC-MC 915MHz", - "PC-AT 2.4GHz", - "PC-MC 2.4GHz", - "PCCARD or 1/2 size AT, 915MHz or 2.4GHz" -}; - -char *subband[] = { - "915MHz/see WaveModem", - "2425MHz", - "2460MHz", - "2484MHz", - "2430.5MHz" -}; - - -/* -** print_psa -** -** Given a pointer to a PSA structure, print it out -*/ -void -print_psa(u_char *psa, int currnwid) -{ - int nwid; - - /* - ** Work out what sort of board we have - */ - if (psa[0] == 0x14) { - printf("Board type : Microchannel\n"); - } else { - if (psa[1] == 0) { - printf("Board type : PCCARD\n"); - } else { - printf("Board type : ISA"); - if ((psa[4] == 0) && - (psa[5] == 0) && - (psa[6] == 0)) - printf(" (DEC OEM)"); - printf("\n"); - printf("Base address options : 0x300, 0x%02x0, 0x%02x0, 0x%02x0\n", - (int)psa[1], (int)psa[2], (int)psa[3]); - printf("Waitstates : %d\n",psa[7] & 0xf); - printf("Bus mode : %s\n",(psa[7] & 0x10) ? "EISA" : "ISA"); - printf("IRQ : %d\n",wlirq(psa[8])); - } - } - printf("Default MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n", - psa[0x10],psa[0x11],psa[0x12],psa[0x13],psa[0x14],psa[0x15]); - printf("Soft MAC address : %02x:%02x:%02x:%02x:%02x:%02x\n", - psa[0x16],psa[0x17],psa[0x18],psa[0x19],psa[0x1a],psa[0x1b]); - printf("Current MAC address : %s\n",(psa[0x1c] & 0x1) ? "Soft" : "Default"); - printf("Adapter compatibility : "); - if (psa[0x1d] < 5) { - printf("%s\n",compat_type[psa[0x1d]]); - } else { - printf("unknown\n"); - } - printf("Threshold preset : %d\n",psa[0x1e]); - printf("Call code required : %s\n",(psa[0x1f] & 0x1) ? "YES" : "NO"); - if (psa[0x1f] & 0x1) - printf("Call code : 0x%02x%02x%02x%02x%02x%02x%02x%02x\n", - psa[0x30],psa[0x31],psa[0x32],psa[0x33],psa[0x34],psa[0x35],psa[0x36],psa[0x37]); - printf("Subband : %s\n",subband[psa[0x20] & 0xf]); - printf("Quality threshold : %d\n",psa[0x21]); - printf("Hardware version : %d (%s)\n",psa[0x22],psa[0x22] ? "Rel3" : "Rel1/Rel2"); - printf("Network ID enable : %s\n",(psa[0x25] & 0x1) ? "YES" : "NO"); - if (psa[0x25] & 0x1) { - nwid = (psa[0x23] << 8) + psa[0x24]; - printf("NWID : 0x%04x\n",nwid); - if (nwid != currnwid) { - printf("Current NWID : 0x%04x\n",currnwid); - } - } - printf("Datalink security : %s\n",(psa[0x26] & 0x1) ? "YES" : "NO"); - if (psa[0x26] & 0x1) { - printf("Encryption key : "); - if (psa[0x27] == 0) { - printf("DENIED\n"); - } else { - printf("0x%02x%02x%02x%02x%02x%02x%02x%02x\n", - psa[0x27],psa[0x28],psa[0x29],psa[0x2a],psa[0x2b],psa[0x2c],psa[0x2d],psa[0x2e]); - } - } - printf("Databus width : %d (%s)\n", - (psa[0x2f] & 0x1) ? 16 : 8, (psa[0x2f] & 0x80) ? "fixed" : "variable"); - printf("Configuration state : %sconfigured\n",(psa[0x38] & 0x1) ? "" : "un"); - printf("CRC-16 : 0x%02x%02x\n",psa[0x3e],psa[0x3d]); - printf("CRC status : "); - switch(psa[0x3f]) { - case 0xaa: - printf("OK\n"); - break; - case 0x55: - printf("BAD\n"); - break; - default: - printf("Error\n"); - break; - } -} - - -static void -usage(void) -{ - fprintf(stderr,"usage: wlconfig ifname [param value ...]\n"); - exit(1); -} - - -void -get_cache(int sd, struct ifreq *ifr) -{ - /* get the cache count */ - if (ioctl(sd, SIOCGWLCITEM, (caddr_t)ifr)) - err(1, "SIOCGWLCITEM - get cache count"); - w_sigitems = (int) ifr->ifr_data; - - ifr->ifr_data = (caddr_t) &wsc; - /* get the cache */ - if (ioctl(sd, SIOCGWLCACHE, (caddr_t)ifr)) - err(1, "SIOCGWLCACHE - get cache count"); -} - -static int -scale_value(int value, int max) -{ - double dmax = (double) max; - if (value > max) - return(100); - return((value/dmax) * 100); -} - -static void -dump_cache(int rawFlag) -{ - int i; - int signal, silence, quality; - - if (rawFlag) - printf("signal range 0..63: silence 0..63: quality 0..15\n"); - else - printf("signal range 0..100: silence 0..100: quality 0..100\n"); - - /* after you read it, loop through structure,i.e. wsc - * print each item: - */ - for(i = 0; i < w_sigitems; i++) { - printf("[%d:%d]>\n", i+1, w_sigitems); - printf("\tip: %d.%d.%d.%d,",((wsc[i].ipsrc >> 0) & 0xff), - ((wsc[i].ipsrc >> 8) & 0xff), - ((wsc[i].ipsrc >> 16) & 0xff), - ((wsc[i].ipsrc >> 24) & 0xff)); - printf(" mac: %02x:%02x:%02x:%02x:%02x:%02x\n", - wsc[i].macsrc[0]&0xff, - wsc[i].macsrc[1]&0xff, - wsc[i].macsrc[2]&0xff, - wsc[i].macsrc[3]&0xff, - wsc[i].macsrc[4]&0xff, - wsc[i].macsrc[5]&0xff); - if (rawFlag) { - signal = wsc[i].signal; - silence = wsc[i].silence; - quality = wsc[i].quality; - } - else { - signal = scale_value(wsc[i].signal, 63); - silence = scale_value(wsc[i].silence, 63); - quality = scale_value(wsc[i].quality, 15); - } - printf("\tsignal: %d, silence: %d, quality: %d, ", - signal, - silence, - quality); - printf("snr: %d\n", signal - silence); - } -} - -#define raw_cache() dump_cache(1) -#define scale_cache() dump_cache(0) - -int -main(int argc, char *argv[]) -{ - int sd; - struct ifreq ifr; - u_char psabuf[0x40]; - int val, argind, i; - char *cp, *param, *value; - struct ether_addr *ea; - int work = 0; - int currnwid; - - if ((argc < 2) || (argc % 2)) - usage(); - - /* get a socket */ - sd = socket(AF_INET, SOCK_DGRAM, 0); - if (sd < 0) - err(1,"socket"); - strncpy(ifr.ifr_name, argv[1], sizeof(ifr.ifr_name)); - ifr.ifr_addr.sa_family = AF_INET; - - /* get the PSA */ - ifr.ifr_data = (caddr_t)psabuf; - if (ioctl(sd, SIOCGWLPSA, (caddr_t)&ifr)) - err(1,"get PSA"); - - /* get the current NWID */ - if (ioctl(sd, SIOCGWLCNWID, (caddr_t)&ifr)) - err(1,"get NWID"); - currnwid = (int)ifr.ifr_data; - - /* just dump and exit? */ - if (argc == 2) { - print_psa(psabuf, currnwid); - exit(0); - } - - /* loop reading arg pairs */ - for (argind = 2; argind < argc; argind += 2) { - - param = argv[argind]; - value = argv[argind+1]; - - /* What to do? */ - - if (!strcasecmp(param,"currnwid")) { /* set current NWID */ - val = strtol(value,&cp,0); - if ((val < 0) || (val > 0xffff) || (cp == value)) - errx(1,"bad NWID '%s'",value); - - ifr.ifr_data = (caddr_t)val; - if (ioctl(sd, SIOCSWLCNWID, (caddr_t)&ifr)) - err(1,"set NWID (interface not up?)"); - continue ; - } - - if (!strcasecmp(param,"irq")) { - val = strtol(value,&cp,0); - val = irqvals[val]; - if ((val == 0) || (cp == value)) - errx(1,"bad IRQ '%s'",value); - psabuf[WLPSA_IRQNO] = (u_char)val; - work = 1; - continue; - } - - if (!strcasecmp(param,"mac")) { - if ((ea = ether_aton(value)) == NULL) - errx(1,"bad ethernet address '%s'",value); - for (i = 0; i < 6; i++) - psabuf[WLPSA_LOCALMAC + i] = ea->octet[i]; - work = 1; - continue; - } - - if (!strcasecmp(param,"macsel")) { - if (!strcasecmp(value,"local")) { - psabuf[WLPSA_MACSEL] |= 0x1; - work = 1; - continue; - } - if (!strcasecmp(value,"universal")) { - psabuf[WLPSA_MACSEL] &= ~0x1; - work = 1; - continue; - } - errx(1,"bad macsel value '%s'",value); - } - - if (!strcasecmp(param,"nwid")) { - val = strtol(value,&cp,0); - if ((val < 0) || (val > 0xffff) || (cp == value)) - errx(1,"bad NWID '%s'",value); - psabuf[WLPSA_NWID] = (val >> 8) & 0xff; - psabuf[WLPSA_NWID+1] = val & 0xff; - work = 1; - continue; - } - if (!strcasecmp(param,"cache")) { - - /* raw cache dump - */ - if (!strcasecmp(value,"raw")) { - get_cache(sd, &ifr); - raw_cache(); - continue; - } - /* scaled cache dump - */ - else if (!strcasecmp(value,"scale")) { - get_cache(sd, &ifr); - scale_cache(); - continue; - } - /* zero out cache - */ - else if (!strcasecmp(value,"zero")) { - if (ioctl(sd, SIOCDWLCACHE, (caddr_t)&ifr)) - err(1,"zero cache"); - continue; - } - errx(1,"unknown value '%s'", value); - } - errx(1,"unknown parameter '%s'",param); - } - if (work) { - ifr.ifr_data = (caddr_t)psabuf; - if (ioctl(sd, SIOCSWLPSA, (caddr_t)&ifr)) - err(1,"set PSA"); - } - return(0); -} diff --git a/usr.sbin/xten/Makefile b/usr.sbin/xten/Makefile deleted file mode 100644 index a35f5db59c..0000000000 --- a/usr.sbin/xten/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# Makefile for xten (Stark) 10/30/93 -# $FreeBSD: src/usr.sbin/xten/Makefile,v 1.8 1999/08/28 01:21:01 peter Exp $ -# $DragonFly: src/usr.sbin/xten/Makefile,v 1.2 2003/06/17 04:30:04 dillon Exp $ - -PROG= xten -CFLAGS+= -I${.CURDIR}/../../libexec/xtend -WARNS?= 2 - -.include diff --git a/usr.sbin/xten/README b/usr.sbin/xten/README deleted file mode 100644 index f5a3af9616..0000000000 --- a/usr.sbin/xten/README +++ /dev/null @@ -1,363 +0,0 @@ -Installation Notes for X-10 software -Eugene W. Stark (stark@cs.sunysb.edu) -October 30, 1993 -(latest update May 29, 1997) - -The TW523 is a carrier-current modem for home control/automation purposes. -It is made by: - - X-10 Inc. - 185A LeGrand Ave. - Northvale, NJ 07647 - USA - (201) 784-9700 or 1-800-526-0027 - - X-10 Home Controls Inc. - 1200 Aerowood Drive, Unit 20 - Mississauga, Ontario - (416) 624-4446 or 1-800-387-3346 - -The TW523 is designed for communications using the X-10 protocol, -which is compatible with a number of home control systems, including -Radio Shack "Plug 'n Power(tm)" and Stanley "Lightmaker(tm)." -I bought my TW523 from: - - Home Control Concepts - 9353-C Activity Road - San Diego, CA 92126 - (619) 693-8887 - -They supplied me with the TW523 (which has an RJ-11 four-wire modular -telephone connector), a modular cable, an RJ-11 to DB-25 connector with -internal wiring, documentation from X-10 on the TW523 (very good), -an instruction manual by Home Control Concepts (not very informative), -and a floppy disk containing binary object code of some demonstration/test -programs and of a C function library suitable for controlling the TW523 -by an IBM PC under MS-DOS (not useful to me other than to verify that -the unit worked). I suggest saving money and buying the bare TW523 -rather than the TW523 development kit (what I bought), because if you -are running FreeBSD you don't really care about the DOS binaries. -For details on the X-10 protocol itself, refer to the documentation from -X-10 Inc. - -The interface to the TW-523 consists of four wires on the RJ-11 connector, -which are jumpered to somewhat more wires on the DB-25 connector, which -in turn is intended to plug into the PC parallel printer port. I dismantled -the DB-25 connector to find out what they had done: - - Signal RJ-11 pin DB-25 pin(s) Parallel Port - Transmit TX 4 (Y) 2, 4, 6, 8 Data out - Receive RX 3 (G) 10, 14 -ACK, -AutoFeed - Common 2 (R) 25 Common - Zero crossing 1 (B) 17 or 12 -Select or +PaperEnd - -NOTE: In the original cable I have (which I am still using, May, 1997) -the Zero crossing signal goes to pin 17 (-Select) on the parallel port. -In retrospect, this doesn't make a whole lot of sense, given that the --Select signal propagates the other direction. Indeed, some people have -reported problems with this, and have had success using pin 12 (+PaperEnd) -instead. This driver searches for the zero crossing signal on either -pin 17 or pin 12, so it should work with either cable configuration. -My suggestion would be to start by making the cable so that the zero -crossing signal goes to pin 12 on the parallel port. - -I use the TW-523 and this software in the USA with 120V/60Hz power. -Phil Sampson (vk2jnt@gw.vk2jnt.ampr.org OR sampson@gidday.enet.dec.com) -in Australia has reported success in using a TW-7223 (a local version -of the TW-523) and Tandy modules with this software under 240V/50Hz power. -For reasons explained in the comments in the driver, it will probably not -work if you have three-phase power, but this is usually not the case for -normal residences and offices. - - -1. Installing the TW523 Device Driver - -I assume that you are running FreeBSD. If you are running some other -system, you are more or less on your own, though I can try to help if you -have problems. - -Check the configuration parameters at the beginning of the file - - /sys/i386/isa/tw.c - -Probably the only thing you might need to change is to change the -definition of HALFCYCLE from 8333 to 10000 if you are using 50Hz power. -The driver assumes that the TW523 device is connected to a parallel port. -See the comments near the beginning of the file to find out where to -get a TW523 if you don't have one, and how to make a cable for it to -connect to your parallel port. - -Add a line like the following - - device tw0 at isa? port 0x278 tty irq 5 - -to /sys/i386/conf/YOURSYSTEM, but make sure to change the I/O port and -interrupt to match your hardware configuration. - -Cd to /sys/i386/conf and do "config YOURSYSTEM". -Cd to /sys/compile/YOURSYSTEM and do "make depend", then "make". -(If you have any troubles, I suggest starting fresh by doing a full -"make clean; make depend; make".) Assuming the make works correctly, do - - make install - -(Take the usual precautions by saving a known working kernel until you -verify that the new kernel actually boots.) - -Reboot the system. You should see a line indicating that the TW523 has -been configured as the system comes up. If you see this line, then probably -everything is going to work OK, because the TW523 will only get configured -if the driver is able to sync to the power line. If the TW523 is not plugged -in, or the driver is not getting sync for some reason, then you won't see -any message on bootup. - -NOTE: I have received a report that some multi IDE/SIO/PARALLEL cards -"cheat" and use TTL outputs rather than pullup open collector outputs, -and this can mess up the scheme by which sync gets to the driver. -If you are having trouble getting the driver to work, you might want to -look into this possibility. - - -2. Installing the X-10 Daemon - -The X-10 daemon "xtend" is integrated in to the FreeBSD "/etc/sysconfig" -system configuration file. To enable the daemon, simply edit that file, -find the "xtend" line, change it to read as below. - - # Set to YES if you want to run the X-10 power controller daemon - xtend=YES - -This will cause the X-10 daemon to be invoked automatically when you boot -the system. To test the installation, you can either reboot now, or -you can just run "xtend" by hand. The daemon should start up, and it should -create files in /var/spool/xten. Check the file /var/spool/xten/Log to -make sure that the daemon started up without any errors. - -Now you are ready to start trying X-10 commands. Try doing - - xten A 1 Off - xten A 1 On 1 Dim:10 - -etc. The "xten" program expects a house code as its first argument, then -a series of key codes, which are either unit names ("1" through "16") or -else are command names. You can find the list of command names by looking -at the table in the file "xten.c". Each key code can optionally be followed -by a colon : then a number specifying the number of times that command is -to be transmitted without gaps between packets. The default is 2, and this -is the normal case, but some commands like Bright and Dim are designed to -be transmitted with counts other than 2. See the X-10 documentation for -more detail. - -The "xten" program works by connecting to "xtend" through a socket, and -asking that the X-10 codes be transmitted over the TW523. All activity -on the TW523 is logged by the daemon in /var/spool/xten/Log. The daemon -also attempts to track the state of all devices. (Of course, most X-10 -devices do not transmit when they are operated manually, so if somebody -operates a device manually there is no way the X-10 daemon will know -about it.) - -3. Low-level Programming of the TW523 Driver - -Normally, you would never operate the TW523 directly, rather you would -use the shell command "xten" or you would connect to "xtend" through its -socket. However, if you don't want to run "xtend", you can manipulate -the TW523 directly through the device /dev/tw0. Have a look at the -xtend code for a programming example. - -The driver supports read(), write(), and select() system calls. -The driver allows multiple processes to read and write simultaneously, -but there is probably not much sense in having more than one reader or more -than one writer at a time, and in fact there may currently be a race -condition in the driver if two processes try to transmit simultaneously -(due to unsynchronized access to the sc_pkt structure in tw_sc). - -Transmission is done by calling write() to send three byte packets of data. -The first byte contains a four bit house code (0=A to 15=P). The second byte -contains five bit unit/key code (0=unit 1 to 15=unit 16, 16=All Units Off -to 31 = Status Request). The third byte specifies the number of times the -packet is to be transmitted without any gaps between successive transmissions. -Normally this is 2, as per the X-10 documentation, but sometimes (e.g. for -bright and dim codes) it can be another value. Each call to write can specify -an arbitrary number of data bytes, but at most one packet will actually be -processed in any call. Any incomplete packet is buffered until a subsequent -call to write() provides data to complete it. Successive calls to write() -leave a three-cycle gap between transmissions, per the X-10 documentation. -The driver transmits each bit only once per half cycle, not three times as -the X-10 documentation states, because the TW523 only provides sync on -each power line zero crossing. So, the driver will probably not work -properly if you have three-phase service. Most residences use a two-wire -system, for which the driver does work. - -Reception is done using read(). The driver produces a series of three -character packets. In each packet, the first character consists of flags, -the second character is a four bit house code (0-15), and the third character -is a five bit key/function code (0-31). The flags are the following: - -#define TW_RCV_LOCAL 1 /* The packet arrived during a local transmission */ -#define TW_RCV_ERROR 2 /* An invalid/corrupted packet was received */ - -The select() system call can be used in the usual way to determine if there -is data ready for reading. - - - Happy Controlling! - Gene Stark - stark@cs.sunysb.edu - - -Appendix. Miscellaneous Additional Information - -The following excerpts from my E-mail correspondence may be relevant -to some situations: - - -From: Steve Passe -Subject: Re: tw woes -Date: Sat, 09 Dec 1995 20:57:15 -0700 - -Hi, - -I have just verified that /dev/tw works on 2.1.0-RELEASE. I can -send and receive x10 commands via my x10 daemon and X11 based tools. - -I used a "cross-over" cable between tw523 and db-25 connector: - - |||||-----------||||| - \ / - -NOTE: I am NOT using the RadioShack brand of hood: - -looking at INSIDE of hood: - ----------- -| | -| | -| B G B | < Black, Green, Blue -| W R Y | < White, Red, Yellow -| |||||| | -| |||||| | -| |||||| | -| | -| | -| | ----------- - -OUTSIDE: - - Hood TW523 ----------- ------------------ -| | | | -| | | | -| ------ | | +------+ | -| |||||| | | | |||| | | -| |||||| | | | |||| | | -| -- -- | | +-- --+ | -| | | | | | | | -| -- | | -- | -| | | | -| | | 1 2 3 4 | ----------- ------------------ - Y G R B B R G Y - | | | | | | | | - | | | |--------------------| | | | - | | |------------------------| | | - | |----------------------------| | - |--------------------------------| - -Be sure that the tw523 is NOWHERE NEAR a surge protector. I have seen -x-10 devices fail to work when plugged in NEXT to a surge protector! - - -I placed the tw option before the lpt entries in my config file: - -device tw0 at isa? port 0x378 tty irq 7 -device lpt0 at isa? port? tty irq 7 - -from dmesg I get: - -Dec 9 19:11:59 ilsa /kernel: tw0 at 0x378-0x37f irq 7 on isa -Dec 9 19:11:59 ilsa /kernel: lpt0 not probed due to I/O address conflict with -tw0 at 0x378 - -Once I have opened /dev/tw with my daemon I get messages - (pressing UNIT J, key 16): - -Dec 9 20:18:26 ilsa /kernel: TWRCV: valid packet: (22, 1f8) J 16 -Dec 9 20:18:26 ilsa /kernel: TWRCV: valid packet: (22, 1f8) J 16 - -These messages from the driver should be dis-abled once you get it working, -you'll fill up the var partition with a lot of useless garbage otherwise! - - - -From: Steve Passe -Subject: Re: tw woes -Date: Sat, 16 Dec 1995 11:56:59 -0700 - -Hi, - -I now more or less understand the set of problems concerning cabling -for using /dev/tw and a tw523. Summary: - - - 1: modular cables come in 2 flavors: - -|||||----------||||| <- "phone" cable - \ / - - \ -|||||----------||||| <- "data" cable - \ - - we need to be able to clearly differentiate the two. I suggest we - standardize on using "phone" cables only. - - - 2: modular db25 connectors ARE NOT CONSISTANT in their color code - scheme, EVEN within the same BRAND! - - we can't describe the connection in terms of cable/connector wire color. - we must clearly explain the consequences of mis-connection: - POSSIBLE damage to (but NOT limited to) the parallel port and/or tw523. - - - 3: not all parallel ports have pullups on their status inputs. I found - 2 different port boards in my junk box without pullups on paper-out. - As is, these boards failed to work, ie the probe routine failed. - By adding 10K pullup resistors (to +5v) to both ACK and paper-out - (pins 10 & 12) I was able to make these boards work: probe succeeds, - transmit and receive work reliably. - - we must describe a test to determine if a parallel port will work as is. - perhaps something like: - --------------------------------------------------------------------------- -Not a parallel ports will work with the connector described in this paper. -To test your port for usability you should take the following measurements -with a voltmeter. The computer must be powered-up, and preferably in -a safe state for tinkering, such as halted in a startup menu. Nothing -should be attached to the parallel ports, except perhaps an extension -cable for testing convenience. - - 1: measure the voltage between pins 10 & 25 (GND) of the parallel port. - - 2: measure the voltage between pins 12 & 25 (GND) of the parallel port. - -If both of these measurements have a value of >= 4.0 volts your port -should work as is. If either is below 4.0 volts (typically less than -1.0 volt) your port will NOT WORK RELIABLY as is. It can be made to -work by adding 10k ohm pull-up resistors to either line that is below -the minimum 4.0 volts. This is an ADVANCED TECHNIQUE that should NOT -be attempted by anyone without some hardware construction experience. - -Assuming that you do feel competant to make these modifications it is -easiest to tack 10k resistors on the bottom side of the port board -from each of pins 10 & 12 of the parallel port connector to a source -of +5 volts. This will probably be the power pin of one of the ICs. -CAUTION: there may also be +-12 volts on a port board supplying some -of the ICs. If your port is on your motherboard it would probably be -best to obtain an external port card, and disable/re-address the 1st -parallel port. --------------------------------------------------------------------------- - - diff --git a/usr.sbin/xten/xten.1 b/usr.sbin/xten/xten.1 deleted file mode 100644 index e207b8fcbd..0000000000 --- a/usr.sbin/xten/xten.1 +++ /dev/null @@ -1,116 +0,0 @@ -.\" Copyright (c) 1992, 1993 Eugene W. Stark -.\" 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 Eugene W. Stark. -.\" 4. 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 EUGENE W. STARK (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: src/usr.sbin/xten/xten.1,v 1.9.2.3 2002/06/21 16:42:43 charnier Exp $ -.\" $DragonFly: src/usr.sbin/xten/xten.1,v 1.3 2006/02/17 19:40:30 swildner Exp $ -.\" -.Dd October 30, 1993 -.Dt XTEN 1 -.Os -.Sh NAME -.Nm xten -.Nd transmit X-10 commands -.Sh SYNOPSIS -.Nm -.Op Fl "" -.Ar house -.Ar key Ns Op : Ns Ar cnt -.Oo -.Op Ar house -.Ar key Ns Op : Ns Ar cnt -.Ar ... -.Oc -.Sh DESCRIPTION -The -.Nm -utility is a command-line interface to the X-10 daemon. -When invoked with a one-letter house code (A-P) and a series of key/unit -codes as arguments, it requests the X-10 daemon to transmit a corresponding -series of X-10 packets. The X-10 daemon makes its best effort to ensure -that the packets are all transmitted correctly, though in general it is -not possible to tell whether the commands were actually received and -executed by the remote X-10 devices. -.Pp -When invoked with the single argument -.Fl "" , -.Nm -enters an interactive mode in which a line is repeatedly read from the -standard input, sent to the X-10 daemon, and the one-line response from -the daemon printed on the standard output. -.Sh OPTIONS -The -.Ar house -argument is a one-letter house code in the range A-P. -All the X-10 requests generated will refer to this house code. -Each -.Ar key -is either a numeric unit code in the range 1-16, or else -is a string that specifies an X-10 function. The possible -function code strings are: -.Bl -diag -.It AllUnitsOff -.It AllLightsOn -.It On -.It Off -.It Dim -.It Bright -.It AllLightsOff -.It ExtendedCode -.It HailRequest -.It HailAcknowledge -.It PreSetDim0 -.It PreSetDim1 -.It ExtendedData -.It StatusOn -.It StatusOff -.It StatusRequest -.El -.Pp -Each -.Ar key -may be followed by an optional numeric -.Ar cnt , -which specifies the number of packets that are to be sent with that -key code without gaps. If this argument is omitted, two packets -are transmitted. The ability to specify numbers of packets other than -two is used by the X-10 -.Em Dim -and -.Em Bright -commands. -.Sh FILES -.Bl -tag -width /var/spool/xten/Status -compact -.It Pa /dev/tw0 -the TW523 special file -.El -.Sh SEE ALSO -.Xr tw 4 , -.Xr xtend 8 -.Sh AUTHORS -.An Eugene W. Stark Aq stark@cs.sunysb.edu diff --git a/usr.sbin/xten/xten.c b/usr.sbin/xten/xten.c deleted file mode 100644 index bbeef5614c..0000000000 --- a/usr.sbin/xten/xten.c +++ /dev/null @@ -1,172 +0,0 @@ -/*- - * Copyright (c) 1992, 1993 Eugene W. Stark - * 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 Eugene W. Stark. - * 4. 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 EUGENE W. STARK (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: src/usr.sbin/xten/xten.c,v 1.4 1999/08/28 01:21:02 peter Exp $ - * $DragonFly: src/usr.sbin/xten/xten.c,v 1.4 2005/12/05 01:23:23 swildner Exp $ - */ - -/* - * Xten - user command interface to X-10 daemon - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "xtend.h" -#include "xten.h" -#include "paths.h" - -#define RETRIES 10 -#define CMDLEN 512 - -char *X10housenames[] = { - "A", "B", "C", "D", "E", "F", "G", "H", - "I", "J", "K", "L", "M", "N", "O", "P", - NULL -}; - -char *X10cmdnames[] = { - "1", "2", "3", "4", "5", "6", "7", "8", - "9", "10", "11", "12", "13", "14", "15", "16", - "AllUnitsOff", "AllLightsOn", "On", "Off", "Dim", "Bright", "AllLightsOff", - "ExtendedCode", "HailRequest", "HailAcknowledge", "PreSetDim0", "PreSetDim1", - "ExtendedData", "StatusOn", "StatusOff", "StatusRequest", - NULL -}; - -int find(char *, char *[]); -static void usage(void); - -int -main(int argc, char *argv[]) -{ - int c, tmp, h, k, sock, error; - FILE *daemon; - struct sockaddr_un sa; - char *sockpath = SOCKPATH; - char reply[CMDLEN], cmd[CMDLEN], *cp; - int interactive = 0; - - if(argc == 2 && !strcmp(argv[1], "-")) interactive++; - else if(argc < 3) - usage(); - if((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) - errx(1, "can't create socket"); - strcpy(sa.sun_path, sockpath); - sa.sun_family = AF_UNIX; - if(connect(sock, (struct sockaddr *)(&sa), strlen(sa.sun_path) + 2) < 0) - errx(1, "can't connect to X-10 daemon"); - if((daemon = fdopen(sock, "w+")) == NULL) - errx(1, "can't attach stream to socket"); - /* - * If interactive, copy standard input to daemon and report results - * on standard output. - */ - if(interactive) { - while(!feof(stdin)) { - if(fgets(cmd, CMDLEN, stdin) != NULL) { - fprintf(daemon, "%s", cmd); - fflush(daemon); - if(fgets(reply, CMDLEN, daemon) != NULL) { - fprintf(stdout, "%s", reply); - fflush(stdout); - } - } - } - exit(0); - } - /* - * Otherwise, interpret arguments and issue commands to daemon, - * handling retries in case of errors. - */ - if((h = find(argv[1], X10housenames)) < 0) - errx(1, "invalid house code: %s", argv[1]); - argv++; - argv++; - while(argc >= 3) { - cp = argv[0]; - if((tmp = find(cp, X10housenames)) >= 0) { - h = tmp; - argv++; - argc--; - continue; - } - while(*cp != '\0' && *cp != ':') cp++; - if(*cp == ':') c = atoi(cp+1); - else c = 2; - *cp = '\0'; - if((k = find(argv[0], X10cmdnames)) < 0) { - warnx("invalid key/unit code: %s", argv[0]); - error++; - } - error = 0; - while(error < RETRIES) { - fprintf(daemon, "send %s %s %d\n", X10housenames[h], X10cmdnames[k], c); - fflush(daemon); - fgets(reply, CMDLEN, daemon); - if(strncmp(reply, "ERROR", 5)) break; - error++; - usleep(200000); - } - if(error == RETRIES) { - warnx("command failed: send %s %s %d", - X10housenames[h], X10cmdnames[k], c); - } - argc--; - argv++; - } - fprintf(daemon, "done\n"); - fgets(reply, CMDLEN, daemon); - exit(0); -} - -static void -usage(void) -{ - fprintf(stderr, - "usage: xten house key[:cnt] [[house] key[:cnt] ...]\n"); - exit(1); -} - -int -find(char *s, char *tab[]) -{ - int i; - - for(i = 0; tab[i] != NULL; i++) { - if(strcasecmp(s, tab[i]) == 0) return(i); - } - return(-1); -}