diff options
Diffstat (limited to 'sys')
38 files changed, 1 insertions, 4582 deletions
diff --git a/sys/alpha/linux/syscalls.conf b/sys/alpha/linux/syscalls.conf deleted file mode 100644 index 01e258801231..000000000000 --- a/sys/alpha/linux/syscalls.conf +++ /dev/null @@ -1,12 +0,0 @@ -# $FreeBSD$ -sysnames="/dev/null" -sysproto="linux_proto.h" -sysproto_h=_LINUX_SYSPROTO_H_ -syshdr="linux_syscall.h" -syssw="linux_sysent.c" -sysmk="/dev/null" -syshide="/dev/null" -syscallprefix="LINUX_SYS_" -switchname="linux_sysent" -namesname="linux_syscallnames" -sysvec="\n" diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh index e6379b29dc8a..54d8d5bb1d8c 100644 --- a/sys/conf/newvers.sh +++ b/sys/conf/newvers.sh @@ -36,7 +36,7 @@ TYPE="FreeBSD" REVISION="4.1" -BRANCH="STABLE" +BRANCH="RELEASE" RELEASE="${REVISION}-${BRANCH}" SNAPDATE="" if [ "X${SNAPDATE}" != "X" ]; then diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c deleted file mode 100644 index 47d0e5ea0de3..000000000000 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ /dev/null @@ -1,452 +0,0 @@ -/* - * Copyright (C) 1997-2000 by Darren Reed. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and due credit is given - * to the original author and the contributors. - */ -#if !defined(lint) -/*static const char rcsid[] = "@(#)$Id: ip_proxy.c,v 2.2.2.1 1999/09/19 12:18:19 darrenr Exp $";*/ -static const char rcsid[] = "@(#)$FreeBSD$"; -#endif - -#if defined(__FreeBSD__) && defined(KERNEL) && !defined(_KERNEL) -# define _KERNEL -#endif - -#include <sys/errno.h> -#include <sys/types.h> -#include <sys/param.h> -#include <sys/time.h> -#include <sys/file.h> -#if !defined(__FreeBSD_version) -# include <sys/ioctl.h> -#endif -#include <sys/fcntl.h> -#include <sys/uio.h> -#if !defined(_KERNEL) && !defined(KERNEL) -# include <stdio.h> -# include <string.h> -# include <stdlib.h> -#endif -#ifndef linux -# include <sys/protosw.h> -#endif -#include <sys/socket.h> -#if defined(_KERNEL) -# if !defined(linux) -# include <sys/systm.h> -# else -# include <linux/string.h> -# endif -#endif -#if !defined(__SVR4) && !defined(__svr4__) -# ifndef linux -# include <sys/mbuf.h> -# endif -#else -# include <sys/byteorder.h> -# ifdef _KERNEL -# include <sys/dditypes.h> -# endif -# include <sys/stream.h> -# include <sys/kmem.h> -#endif -#if __FreeBSD__ > 2 -# include <sys/queue.h> -#endif -#include <net/if.h> -#ifdef sun -# include <net/af.h> -#endif -#include <net/route.h> -#include <netinet/in.h> -#include <netinet/in_systm.h> -#include <netinet/ip.h> -#ifndef linux -# include <netinet/ip_var.h> -#endif -#include <netinet/tcp.h> -#include <netinet/udp.h> -#include <netinet/ip_icmp.h> -#include "netinet/ip_compat.h" -#include <netinet/tcpip.h> -#include "netinet/ip_fil.h" -#include "netinet/ip_proxy.h" -#include "netinet/ip_nat.h" -#include "netinet/ip_state.h" -#if (__FreeBSD_version >= 300000) -# include <sys/malloc.h> -#endif - - -#ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) -#endif - -static ap_session_t *appr_new_session __P((aproxy_t *, ip_t *, - fr_info_t *, nat_t *)); -static int appr_fixseqack __P((fr_info_t *, ip_t *, ap_session_t *, int )); - - -#define AP_SESS_SIZE 53 - -#if defined(_KERNEL) && !defined(linux) -#include "netinet/ip_ftp_pxy.c" -#include "netinet/ip_rcmd_pxy.c" -#include "netinet/ip_raudio_pxy.c" -#endif - -ap_session_t *ap_sess_tab[AP_SESS_SIZE]; -ap_session_t *ap_sess_list = NULL; -aproxy_t *ap_proxylist = NULL; -aproxy_t ap_proxies[] = { -#ifdef IPF_FTP_PROXY - { NULL, "ftp", (char)IPPROTO_TCP, 0, 0, ippr_ftp_init, NULL, - ippr_ftp_new, ippr_ftp_in, ippr_ftp_out }, -#endif -#ifdef IPF_RCMD_PROXY - { NULL, "rcmd", (char)IPPROTO_TCP, 0, 0, ippr_rcmd_init, NULL, - ippr_rcmd_new, NULL, ippr_rcmd_out }, -#endif -#ifdef IPF_RAUDIO_PROXY - { NULL, "raudio", (char)IPPROTO_TCP, 0, 0, ippr_raudio_init, NULL, - ippr_raudio_new, ippr_raudio_in, ippr_raudio_out }, -#endif - { NULL, "", '\0', 0, 0, NULL, NULL } -}; - - -int appr_add(ap) -aproxy_t *ap; -{ - aproxy_t *a; - - for (a = ap_proxies; a->apr_p; a++) - if ((a->apr_p == ap->apr_p) && - !strncmp(a->apr_label, ap->apr_label, - sizeof(ap->apr_label))) - return -1; - - for (a = ap_proxylist; a->apr_p; a = a->apr_next) - if ((a->apr_p == ap->apr_p) && - !strncmp(a->apr_label, ap->apr_label, - sizeof(ap->apr_label))) - return -1; - ap->apr_next = ap_proxylist; - ap_proxylist = ap; - return (*ap->apr_init)(); -} - - -int appr_del(ap) -aproxy_t *ap; -{ - aproxy_t *a, **app; - - for (app = &ap_proxylist; (a = *app); app = &a->apr_next) - if (a == ap) { - if (ap->apr_ref != 0) - return 1; - *app = a->apr_next; - return 0; - } - return -1; -} - - -int appr_ok(ip, tcp, nat) -ip_t *ip; -tcphdr_t *tcp; -ipnat_t *nat; -{ - aproxy_t *apr = nat->in_apr; - u_short dport = nat->in_dport; - - if (!apr || (apr->apr_flags & APR_DELETE) || - (ip->ip_p != apr->apr_p)) - return 0; - if ((tcp && (tcp->th_dport != dport)) || (!tcp && dport)) - return 0; - return 1; -} - - -/* - * Allocate a new application proxy structure and fill it in with the - * relevant details. call the init function once complete, prior to - * returning. - */ -static ap_session_t *appr_new_session(apr, ip, fin, nat) -aproxy_t *apr; -ip_t *ip; -fr_info_t *fin; -nat_t *nat; -{ - register ap_session_t *aps; - - if (!apr || (apr->apr_flags & APR_DELETE) || (ip->ip_p != apr->apr_p)) - return NULL; - - KMALLOC(aps, ap_session_t *); - if (!aps) - return NULL; - bzero((char *)aps, sizeof(*aps)); - aps->aps_p = ip->ip_p; - aps->aps_data = NULL; - aps->aps_apr = apr; - aps->aps_psiz = 0; - if (apr->apr_new != NULL) - if ((*apr->apr_new)(fin, ip, aps, nat) == -1) { - KFREE(aps); - return NULL; - } - aps->aps_nat = nat; - aps->aps_next = ap_sess_list; - ap_sess_list = aps; - return aps; -} - - -/* - * check to see if a packet should be passed through an active proxy routine - * if one has been setup for it. - */ -int appr_check(ip, fin, nat) -ip_t *ip; -fr_info_t *fin; -nat_t *nat; -{ - ap_session_t *aps; - aproxy_t *apr; - tcphdr_t *tcp = NULL; - u_32_t sum; - short rv; - int err; - - if (nat->nat_aps == NULL) - nat->nat_aps = appr_new_session(nat->nat_ptr->in_apr, ip, - fin, nat); - aps = nat->nat_aps; - if ((aps != NULL) && (aps->aps_p == ip->ip_p)) { - if (ip->ip_p == IPPROTO_TCP) { - tcp = (tcphdr_t *)fin->fin_dp; - /* - * verify that the checksum is correct. If not, then - * don't do anything with this packet. - */ -#if SOLARIS && defined(_KERNEL) - sum = fr_tcpsum(fin->fin_qfm, ip, tcp); -#else - sum = fr_tcpsum(*(mb_t **)fin->fin_mp, ip, tcp); -#endif - if (sum != tcp->th_sum) { - frstats[fin->fin_out].fr_tcpbad++; - return -1; - } - } - - apr = aps->aps_apr; - err = 0; - if (fin->fin_out != 0) { - if (apr->apr_outpkt != NULL) - err = (*apr->apr_outpkt)(fin, ip, aps, nat); - } else { - if (apr->apr_inpkt != NULL) - err = (*apr->apr_inpkt)(fin, ip, aps, nat); - } - - rv = APR_EXIT(err); - if (rv == -1) - return rv; - - if (tcp != NULL) { - err = appr_fixseqack(fin, ip, aps, APR_INC(err)); -#if SOLARIS && defined(_KERNEL) - tcp->th_sum = fr_tcpsum(fin->fin_qfm, ip, tcp); -#else - tcp->th_sum = fr_tcpsum(*(mb_t **)fin->fin_mp, ip, tcp); -#endif - } - aps->aps_bytes += ip->ip_len; - aps->aps_pkts++; - return 1; - } - return 0; -} - - -aproxy_t *appr_match(pr, name) -u_int pr; -char *name; -{ - aproxy_t *ap; - - for (ap = ap_proxies; ap->apr_p; ap++) - if ((ap->apr_p == pr) && - !strncmp(name, ap->apr_label, sizeof(ap->apr_label))) { - ap->apr_ref++; - return ap; - } - - for (ap = ap_proxylist; ap; ap = ap->apr_next) - if ((ap->apr_p == pr) && - !strncmp(name, ap->apr_label, sizeof(ap->apr_label))) { - ap->apr_ref++; - return ap; - } - return NULL; -} - - -void appr_free(ap) -aproxy_t *ap; -{ - ap->apr_ref--; -} - - -void aps_free(aps) -ap_session_t *aps; -{ - ap_session_t *a, **ap; - - if (!aps) - return; - - for (ap = &ap_sess_list; (a = *ap); ap = &a->aps_next) - if (a == aps) { - *ap = a->aps_next; - break; - } - - if ((aps->aps_data != NULL) && (aps->aps_psiz != 0)) - KFREES(aps->aps_data, aps->aps_psiz); - KFREE(aps); -} - - -static int appr_fixseqack(fin, ip, aps, inc) -fr_info_t *fin; -ip_t *ip; -ap_session_t *aps; -int inc; -{ - int sel, ch = 0, out, nlen; - u_32_t seq1, seq2; - tcphdr_t *tcp; - - tcp = (tcphdr_t *)fin->fin_dp; - out = fin->fin_out; - nlen = ip->ip_len; - nlen -= (ip->ip_hl << 2) + (tcp->th_off << 2); - - if (out != 0) { - seq1 = (u_32_t)ntohl(tcp->th_seq); - sel = aps->aps_sel[out]; - - /* switch to other set ? */ - if ((aps->aps_seqmin[!sel] > aps->aps_seqmin[sel]) && - (seq1 > aps->aps_seqmin[!sel])) - sel = aps->aps_sel[out] = !sel; - - if (aps->aps_seqoff[sel]) { - seq2 = aps->aps_seqmin[sel] - aps->aps_seqoff[sel]; - if (seq1 > seq2) { - seq2 = aps->aps_seqoff[sel]; - seq1 += seq2; - tcp->th_seq = htonl(seq1); - ch = 1; - } - } - - if (inc && (seq1 > aps->aps_seqmin[!sel])) { - aps->aps_seqmin[!sel] = seq1 + nlen - 1; - aps->aps_seqoff[!sel] = aps->aps_seqoff[sel] + inc; - } - - /***/ - - seq1 = ntohl(tcp->th_ack); - sel = aps->aps_sel[1 - out]; - - /* switch to other set ? */ - if ((aps->aps_ackmin[!sel] > aps->aps_ackmin[sel]) && - (seq1 > aps->aps_ackmin[!sel])) - sel = aps->aps_sel[1 - out] = !sel; - - if (aps->aps_ackoff[sel] && (seq1 > aps->aps_ackmin[sel])) { - seq2 = aps->aps_ackoff[sel]; - tcp->th_ack = htonl(seq1 - seq2); - ch = 1; - } - } else { - seq1 = ntohl(tcp->th_seq); - sel = aps->aps_sel[out]; - - /* switch to other set ? */ - if ((aps->aps_ackmin[!sel] > aps->aps_ackmin[sel]) && - (seq1 > aps->aps_ackmin[!sel])) - sel = aps->aps_sel[out] = !sel; - - if (aps->aps_ackoff[sel]) { - seq2 = aps->aps_ackmin[sel] - - aps->aps_ackoff[sel]; - if (seq1 > seq2) { - seq2 = aps->aps_ackoff[sel]; - seq1 += seq2; - tcp->th_seq = htonl(seq1); - ch = 1; - } - } - - if (inc && (seq1 > aps->aps_ackmin[!sel])) { - aps->aps_ackmin[!sel] = seq1 + nlen - 1; - aps->aps_ackoff[!sel] = aps->aps_ackoff[sel] + inc; - } - - /***/ - - seq1 = ntohl(tcp->th_ack); - sel = aps->aps_sel[1 - out]; - - /* switch to other set ? */ - if ((aps->aps_seqmin[!sel] > aps->aps_seqmin[sel]) && - (seq1 > aps->aps_seqmin[!sel])) - sel = aps->aps_sel[1 - out] = !sel; - - if (aps->aps_seqoff[sel] && (seq1 > aps->aps_seqmin[sel])) { - seq2 = aps->aps_seqoff[sel]; - tcp->th_ack = htonl(seq1 - seq2); - ch = 1; - } - } - return ch ? 2 : 0; -} - - -int appr_init() -{ - aproxy_t *ap; - int err = 0; - - for (ap = ap_proxies; ap->apr_p; ap++) { - err = (*ap->apr_init)(); - if (err != 0) - break; - } - return err; -} - - -void appr_unload() -{ - aproxy_t *ap; - - for (ap = ap_proxies; ap->apr_p; ap++) - if (ap->apr_fini) - (*ap->apr_fini)(); - for (ap = ap_proxylist; ap; ap = ap->apr_next) - if (ap->apr_fini) - (*ap->apr_fini)(); -} diff --git a/sys/dev/awi/README b/sys/dev/awi/README deleted file mode 100644 index 38aaec59de92..000000000000 --- a/sys/dev/awi/README +++ /dev/null @@ -1,60 +0,0 @@ -# $Id: README,v 1.19 2000/03/24 08:13:24 onoe Exp $ -# $FreeBSD$ - -===== Configuration - ifconfig awi0 link0 - changes to encapsulation from 802.2 LLC/SNAP (default) to - ether encapsulation. MELCO access point and PAO's ux driver - use this. - -===== Supported Cards - Any IEEE 802.11 cards use AMD Am79C930 and Harris (Intersil) Chipset - with PCnetMobile firmware by AMD. - BayStack 650 1Mbps Frequency Hopping PCCARD adapter - BayStack 660 2Mbps Direct Sequence PCCARD adapter - Icom SL-200 2Mbps Direct Sequence PCCARD adapter - Melco WLI-PCM 2Mbps Direct Sequence PCCARD adapter - NEL SSMagic 2Mbps Direct Sequence PCCARD adapter - Netwave AirSurfer Plus - 1Mbps Frequency Hopping PCCARD adapter - Netwave AirSurfer Pro - 2Mbps Direct Sequence PCCARD adapter - -===== Known Problems - WEP is not supported. - Does not create IBSS itself. - - Cannot configure at all on FreeBSD: - selection of infrastructure/adhoc mode - ESSID - ... - -===== How to add - -*** NetBSD current - already merged into current source tree. - - pcmcia: update the awi driver, which now supports AMD 79c930-based - 802.11DS cards as well as 802.11FH cards, and can operate - in infrastructure mode, adhoc mode, and wi(4) compatible - adhoc mode. [onoe 20000322] - -*** FreeBSD-current - make directory /sys/dev/awi and put all files there. - move if_ieee80211.h to /sys/net - add following lines to /sys/conf/files - dev/awi/am79c930.c optional awi - dev/awi/awi.c optional awi - dev/awi/if_awi_pccard.c optional awi card - add following line to config file - device awi0 - config and make kernel - - add description of your card to /etc/pccard.conf - ex. - card "AMD" "Am79C930" - config 0x1 "awi0" ? - card "Icom" "SL-200" - config 0x1 "awi0" ? - card "Bay Networks" "BayStack 650 Wireless LAN" - config 0x1 "awi0" ? diff --git a/sys/dev/awi/am79c930.c b/sys/dev/awi/am79c930.c deleted file mode 100644 index aa9c97f5a538..000000000000 --- a/sys/dev/awi/am79c930.c +++ /dev/null @@ -1,450 +0,0 @@ -/* $NetBSD: am79c930.c,v 1.5 2000/03/23 13:57:58 onoe Exp $ */ -/* $FreeBSD$ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Bill Sommerfeld - * - * 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 NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. - */ - -/* - * Am79c930 chip driver. - * - * This is used by the awi driver to use the shared - * memory attached to the 79c930 to communicate with the firmware running - * in the 930's on-board 80188 core. - * - * The 79c930 can be mapped into just I/O space, or also have a - * memory mapping; the mapping must be set up by the bus front-end - * before am79c930_init is called. - */ - -/* - * operations: - * - * read_8, read_16, read_32, read_64, read_bytes - * write_8, write_16, write_32, write_64, write_bytes - * (two versions, depending on whether memory-space or i/o space is in use). - * - * interrupt E.C. - * start isr - * end isr - */ - -#include <sys/param.h> -#include <sys/systm.h> -#ifndef __FreeBSD__ -#include <sys/device.h> -#endif - -#include <machine/cpu.h> -#ifdef __FreeBSD__ -#include <machine/bus_pio.h> -#include <machine/bus_memio.h> -#endif -#include <machine/bus.h> -#ifdef __NetBSD__ -#include <machine/intr.h> -#endif - -#ifdef __NetBSD__ -#include <dev/ic/am79c930reg.h> -#include <dev/ic/am79c930var.h> -#endif -#ifdef __FreeBSD__ -#include <dev/awi/am79c930reg.h> -#include <dev/awi/am79c930var.h> -#endif - -#define AM930_DELAY(x) /*nothing*/ - -void am79c930_regdump __P((struct am79c930_softc *sc)); - -static void io_write_1 __P((struct am79c930_softc *, u_int32_t, u_int8_t)); -static void io_write_2 __P((struct am79c930_softc *, u_int32_t, u_int16_t)); -static void io_write_4 __P((struct am79c930_softc *, u_int32_t, u_int32_t)); -static void io_write_bytes __P((struct am79c930_softc *, u_int32_t, u_int8_t *, size_t)); - -static u_int8_t io_read_1 __P((struct am79c930_softc *, u_int32_t)); -static u_int16_t io_read_2 __P((struct am79c930_softc *, u_int32_t)); -static u_int32_t io_read_4 __P((struct am79c930_softc *, u_int32_t)); -static void io_read_bytes __P((struct am79c930_softc *, u_int32_t, u_int8_t *, size_t)); - -static void mem_write_1 __P((struct am79c930_softc *, u_int32_t, u_int8_t)); -static void mem_write_2 __P((struct am79c930_softc *, u_int32_t, u_int16_t)); -static void mem_write_4 __P((struct am79c930_softc *, u_int32_t, u_int32_t)); -static void mem_write_bytes __P((struct am79c930_softc *, u_int32_t, u_int8_t *, size_t)); - -static u_int8_t mem_read_1 __P((struct am79c930_softc *, u_int32_t)); -static u_int16_t mem_read_2 __P((struct am79c930_softc *, u_int32_t)); -static u_int32_t mem_read_4 __P((struct am79c930_softc *, u_int32_t)); -static void mem_read_bytes __P((struct am79c930_softc *, u_int32_t, u_int8_t *, size_t)); - -static struct am79c930_ops iospace_ops = { - io_write_1, - io_write_2, - io_write_4, - io_write_bytes, - io_read_1, - io_read_2, - io_read_4, - io_read_bytes -}; - -struct am79c930_ops memspace_ops = { - mem_write_1, - mem_write_2, - mem_write_4, - mem_write_bytes, - mem_read_1, - mem_read_2, - mem_read_4, - mem_read_bytes -}; - -static void io_write_1 (sc, off, val) - struct am79c930_softc *sc; - u_int32_t off; - u_int8_t val; -{ - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_HI, - ((off>>8)& 0x7f)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_LO, (off&0xff)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_IODPA, val); - AM930_DELAY(1); -} - -static void io_write_2 (sc, off, val) - struct am79c930_softc *sc; - u_int32_t off; - u_int16_t val; -{ - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_HI, - ((off>>8)& 0x7f)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_LMA_LO, (off&0xff)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_IODPA, val & 0xff); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_IODPA, (val>>8)&0xff); - AM930_DELAY(1); -} - -static void io_write_4 (sc, off, val) - struct am79c930_softc *sc; - u_int32_t off; - u_int32_t val; -{ - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_HI, - ((off>>8)& 0x7f)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_LMA_LO, (off&0xff)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_IODPA,val & 0xff); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_IODPA,(val>>8)&0xff); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_IODPA,(val>>16)&0xff); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_IODPA,(val>>24)&0xff); - AM930_DELAY(1); -} - -static void io_write_bytes (sc, off, ptr, len) - struct am79c930_softc *sc; - u_int32_t off; - u_int8_t *ptr; - size_t len; -{ - int i; - - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_HI, - ((off>>8)& 0x7f)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_LMA_LO, (off&0xff)); - AM930_DELAY(1); - for (i=0; i<len; i++) - bus_space_write_1(sc->sc_iot,sc->sc_ioh,AM79C930_IODPA,ptr[i]); -} - -static u_int8_t io_read_1 (sc, off) - struct am79c930_softc *sc; - u_int32_t off; -{ - u_int8_t val; - - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_HI, - ((off>>8)& 0x7f)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_LO, (off&0xff)); - AM930_DELAY(1); - val = bus_space_read_1(sc->sc_iot, sc->sc_ioh, AM79C930_IODPA); - AM930_DELAY(1); - return val; -} - -static u_int16_t io_read_2 (sc, off) - struct am79c930_softc *sc; - u_int32_t off; -{ - u_int16_t val; - - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_HI, - ((off>>8)& 0x7f)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_LO, (off&0xff)); - AM930_DELAY(1); - val = bus_space_read_1(sc->sc_iot, sc->sc_ioh, AM79C930_IODPA); - AM930_DELAY(1); - val |= bus_space_read_1(sc->sc_iot, sc->sc_ioh, AM79C930_IODPA) << 8; - AM930_DELAY(1); - return val; -} - -static u_int32_t io_read_4 (sc, off) - struct am79c930_softc *sc; - u_int32_t off; -{ - u_int32_t val; - - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_HI, - ((off>>8)& 0x7f)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_LO, (off&0xff)); - AM930_DELAY(1); - val = bus_space_read_1(sc->sc_iot, sc->sc_ioh, AM79C930_IODPA); - AM930_DELAY(1); - val |= bus_space_read_1(sc->sc_iot, sc->sc_ioh, AM79C930_IODPA) << 8; - AM930_DELAY(1); - val |= bus_space_read_1(sc->sc_iot, sc->sc_ioh, AM79C930_IODPA) << 16; - AM930_DELAY(1); - val |= bus_space_read_1(sc->sc_iot, sc->sc_ioh, AM79C930_IODPA) << 24; - AM930_DELAY(1); - return val; -} - -static void io_read_bytes (sc, off, ptr, len) - struct am79c930_softc *sc; - u_int32_t off; - u_int8_t *ptr; - size_t len; -{ - int i; - - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_HI, - ((off>>8)& 0x7f)); - AM930_DELAY(1); - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_LMA_LO, (off&0xff)); - AM930_DELAY(1); - for (i=0; i<len; i++) - ptr[i] = bus_space_read_1(sc->sc_iot, sc->sc_ioh, - AM79C930_IODPA); -} - -static void mem_write_1 (sc, off, val) - struct am79c930_softc *sc; - u_int32_t off; - u_int8_t val; -{ - bus_space_write_1(sc->sc_memt, sc->sc_memh, off, val); -} - -static void mem_write_2 (sc, off, val) - struct am79c930_softc *sc; - u_int32_t off; - u_int16_t val; -{ - bus_space_tag_t t = sc->sc_memt; - bus_space_handle_t h = sc->sc_memh; - - /* could be unaligned */ - if ((off & 0x1) == 0) - bus_space_write_2(t, h, off, val); - else { - bus_space_write_1(t, h, off, val & 0xff); - bus_space_write_1(t, h, off+1, (val >> 8) & 0xff); - } -} - -static void mem_write_4 (sc, off, val) - struct am79c930_softc *sc; - u_int32_t off; - u_int32_t val; -{ - bus_space_tag_t t = sc->sc_memt; - bus_space_handle_t h = sc->sc_memh; - - /* could be unaligned */ - if ((off & 0x3) == 0) - bus_space_write_4(t, h, off, val); - else { - bus_space_write_1(t, h, off, val & 0xff); - bus_space_write_1(t, h, off+1, (val >> 8) & 0xff); - bus_space_write_1(t, h, off+2, (val >> 16) & 0xff); - bus_space_write_1(t, h, off+3, (val >> 24) & 0xff); - } -} - -static void mem_write_bytes (sc, off, ptr, len) - struct am79c930_softc *sc; - u_int32_t off; - u_int8_t *ptr; - size_t len; -{ - bus_space_write_region_1 (sc->sc_memt, sc->sc_memh, off, ptr, len); -} - - -static u_int8_t mem_read_1 (sc, off) - struct am79c930_softc *sc; - u_int32_t off; -{ - return bus_space_read_1(sc->sc_memt, sc->sc_memh, off); -} - -static u_int16_t mem_read_2 (sc, off) - struct am79c930_softc *sc; - u_int32_t off; -{ - /* could be unaligned */ - if ((off & 0x1) == 0) - return bus_space_read_2(sc->sc_memt, sc->sc_memh, off); - else - return - bus_space_read_1(sc->sc_memt, sc->sc_memh, off ) | - (bus_space_read_1(sc->sc_memt, sc->sc_memh, off+1) << 8); -} - -static u_int32_t mem_read_4 (sc, off) - struct am79c930_softc *sc; - u_int32_t off; -{ - /* could be unaligned */ - if ((off & 0x3) == 0) - return bus_space_read_4(sc->sc_memt, sc->sc_memh, off); - else - return - bus_space_read_1(sc->sc_memt, sc->sc_memh, off ) | - (bus_space_read_1(sc->sc_memt, sc->sc_memh, off+1) << 8) | - (bus_space_read_1(sc->sc_memt, sc->sc_memh, off+2) <<16) | - (bus_space_read_1(sc->sc_memt, sc->sc_memh, off+3) <<24); -} - - - -static void mem_read_bytes (sc, off, ptr, len) - struct am79c930_softc *sc; - u_int32_t off; - u_int8_t *ptr; - size_t len; -{ - bus_space_read_region_1 (sc->sc_memt, sc->sc_memh, off, ptr, len); -} - - - - -/* - * Set bits in GCR. - */ - -void am79c930_gcr_setbits (sc, bits) - struct am79c930_softc *sc; - u_int8_t bits; -{ - u_int8_t gcr = bus_space_read_1 (sc->sc_iot, sc->sc_ioh, AM79C930_GCR); - - gcr |= bits; - - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_GCR, gcr); -} - -/* - * Clear bits in GCR. - */ - -void am79c930_gcr_clearbits (sc, bits) - struct am79c930_softc *sc; - u_int8_t bits; -{ - u_int8_t gcr = bus_space_read_1 (sc->sc_iot, sc->sc_ioh, AM79C930_GCR); - - gcr &= ~bits; - - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_GCR, gcr); -} - -u_int8_t am79c930_gcr_read (sc) - struct am79c930_softc *sc; -{ - return bus_space_read_1 (sc->sc_iot, sc->sc_ioh, AM79C930_GCR); -} - -#if 0 -void am79c930_regdump (sc) - struct am79c930_softc *sc; -{ - u_int8_t buf[8]; - int i; - - AM930_DELAY(5); - for (i=0; i<8; i++) { - buf[i] = bus_space_read_1 (sc->sc_iot, sc->sc_ioh, i); - AM930_DELAY(5); - } - printf("am79c930: regdump:"); - for (i=0; i<8; i++) { - printf(" %02x", buf[i]); - } - printf("\n"); -} -#endif - -void am79c930_chip_init (sc, how) - struct am79c930_softc *sc; -{ - /* zero the bank select register, and leave it that way.. */ - bus_space_write_1(sc->sc_iot, sc->sc_ioh, AM79C930_BSS, 0); - if (how) - sc->sc_ops = &memspace_ops; - else - sc->sc_ops = &iospace_ops; -} - - diff --git a/sys/dev/awi/am79c930reg.h b/sys/dev/awi/am79c930reg.h deleted file mode 100644 index 64b3e239fab1..000000000000 --- a/sys/dev/awi/am79c930reg.h +++ /dev/null @@ -1,126 +0,0 @@ -/* $NetBSD: am79c930reg.h,v 1.3 2000/03/22 11:22:22 onoe Exp $ */ -/* $FreeBSD$ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Bill Sommerfeld - * - * 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 NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. - */ - -/* - * Device register definitions gleaned from from the AMD "Am79C930 - * PCnet(tm)-Mobile Single Chip Wireless LAN Media Access Controller" - * data sheet, AMD Pub #20183, Rev B, amendment/0, issue date August 1997. - * - * As of 1999/10/23, this was available from AMD's web site in PDF - * form. - */ - - -/* - * The 79c930 contains a bus interface unit, a media access - * controller, and a tranceiver attachment interface. - * The MAC contains an 80188 CPU core. - * typical devices built around this chip typically add 32k or 64k of - * memory for buffers. - * - * The 80188 runs firmware which handles most of the 802.11 gorp, and - * communicates with the host using shared data structures in this - * memory; the specifics of the shared memory layout are not covered - * in this source file; see <dev/ic/am80211fw.h> for details of that layer. - */ - -/* - * Device Registers - */ - -#define AM79C930_IO_BASE 0 -#define AM79C930_IO_SIZE 16 -#define AM79C930_IO_SIZE_BIG 40 -#define AM79C930_IO_ALIGN 0x40 /* am79c930 decodes lower 6bits */ - - -#define AM79C930_GCR 0 /* General Config Register */ - -#define AM79C930_GCR_SWRESET 0x80 /* software reset */ -#define AM79C930_GCR_CORESET 0x40 /* core reset */ -#define AM79C930_GCR_DISPWDN 0x20 /* disable powerdown */ -#define AM79C930_GCR_ECWAIT 0x10 /* embedded controller wait */ -#define AM79C930_GCR_ECINT 0x08 /* interrupt from embedded ctrlr */ -#define AM79C930_GCR_INT2EC 0x04 /* interrupt to embedded ctrlr */ -#define AM79C930_GCR_ENECINT 0x02 /* enable interrupts from e.c. */ -#define AM79C930_GCR_DAM 0x01 /* direct access mode (read only) */ - -#define AM79C930_GCR_BITS "\020\1DAM\2ENECINT\3INT2EC\4ECINT\5ECWAIT\6DISPWDN\7CORESET\010SWRESET" - -#define AM79C930_BSS 1 /* Bank Switching Select register */ - -#define AM79C930_BSS_ECATR 0x80 /* E.C. ALE test read */ -#define AM79C930_BSS_FS 0x20 /* Flash Select */ -#define AM79C930_BSS_MBS 0x18 /* Memory Bank Select */ -#define AM79C930_BSS_EIOW 0x04 /* Expand I/O Window */ -#define AM79C930_BSS_TBS 0x03 /* TAI Bank Select */ - -#define AM79C930_LMA_LO 2 /* Local Memory Address register (low byte) */ - -#define AM79C930_LMA_HI 3 /* Local Memory Address register (high byte) */ - - /* set this bit to turn off ISAPnP version */ -#define AM79C930_LMA_HI_ISAPWRDWN 0x80 - -/* - * mmm, inconsistancy in chip documentation: - * According to page 79--80, all four of the following are equivalent - * and address the single byte pointed at by BSS_{FS,MBS} | LMA_{HI,LO} - * According to tables on p63 and p67, they're the LSB through MSB - * of a 32-bit word. - */ - -#define AM79C930_IODPA 4 /* I/O Data port A */ -#define AM79C930_IODPB 5 /* I/O Data port B */ -#define AM79C930_IODPC 6 /* I/O Data port C */ -#define AM79C930_IODPD 7 /* I/O Data port D */ - - -/* - * Tranceiver Attachment Interface Registers (TIR space) - * (omitted for now, since host access to them is for diagnostic - * purposes only). - */ - -/* - * memory space goo. - */ - -#define AM79C930_MEM_SIZE 0x8000 /* 32k */ -#define AM79C930_MEM_BASE 0x0 /* starting at 0 */ diff --git a/sys/dev/awi/am79c930var.h b/sys/dev/awi/am79c930var.h deleted file mode 100644 index 1e45c6817a9d..000000000000 --- a/sys/dev/awi/am79c930var.h +++ /dev/null @@ -1,79 +0,0 @@ -/* $NetBSD$ */ -/* $FreeBSD$ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Bill Sommerfeld - * - * 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 NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. - */ - -#define AM79C930_BUS_PCMCIA 1 -#define AM79C930_BUS_ISAPNP 2 /* not implemented */ - -struct am79c930_softc -{ - bus_space_tag_t sc_iot; - bus_space_handle_t sc_ioh; - - bus_space_tag_t sc_memt; - bus_space_handle_t sc_memh; - - struct am79c930_ops *sc_ops; - - int sc_bustype; -}; - -struct am79c930_ops -{ - void (*write_1) __P((struct am79c930_softc *, u_int32_t, u_int8_t)); - void (*write_2) __P((struct am79c930_softc *, u_int32_t, u_int16_t)); - void (*write_4) __P((struct am79c930_softc *, u_int32_t, u_int32_t)); - void (*write_bytes) __P((struct am79c930_softc *, u_int32_t, u_int8_t *, size_t)); - - u_int8_t (*read_1) __P((struct am79c930_softc *, u_int32_t)); - u_int16_t (*read_2) __P((struct am79c930_softc *, u_int32_t)); - u_int32_t (*read_4) __P((struct am79c930_softc *, u_int32_t)); - void (*read_bytes) __P((struct am79c930_softc *, u_int32_t, u_int8_t *, size_t)); -}; - -void am79c930_chip_init __P((struct am79c930_softc *sc, int)); - -void am79c930_gcr_setbits __P((struct am79c930_softc *sc, u_int8_t bits)); -void am79c930_gcr_clearbits __P((struct am79c930_softc *sc, u_int8_t bits)); - -u_int8_t am79c930_gcr_read __P((struct am79c930_softc *sc)); - -#define am79c930_hard_reset(sc) am79c930_gcr_setbits(sc, AM79C930_GCR_CORESET) -#define am79c930_hard_reset_off(sc) am79c930_gcr_clearbits(sc, AM79C930_GCR_CORESET) - - diff --git a/sys/dev/awi/awireg.h b/sys/dev/awi/awireg.h deleted file mode 100644 index dc936eb730ec..000000000000 --- a/sys/dev/awi/awireg.h +++ /dev/null @@ -1,460 +0,0 @@ -/* $NetBSD: awireg.h,v 1.3 2000/03/22 11:22:22 onoe Exp $ */ -/* $FreeBSD$ */ - -/*- - * Copyright (c) 1999 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Bill Sommerfeld - * - * 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 NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. - */ - -/* - * The firmware typically loaded onto Am79C930-based 802.11 interfaces - * uses a 32k or larger shared memory buffer to communicate with the - * host. - * - * Depending on the exact configuration of the device, this buffer may - * either be mapped into PCMCIA memory space, or accessible a byte at - * a type through PCMCIA I/O space. - * - * This header defines offsets into this shared memory. - */ - - -/* - * LAST_TXD block. 5 32-bit words. - * - * There are five different output queues; this defines pointers to - * the last completed descriptor for each one. - */ -#define AWI_LAST_TXD 0x3ec /* last completed Tx Descr */ - -#define AWI_LAST_BCAST_TXD AWI_LAST_TXD+0 -#define AWI_LAST_MGT_TXD AWI_LAST_TXD+4 -#define AWI_LAST_DATA_TXD AWI_LAST_TXD+8 -#define AWI_LAST_PS_POLL_TXD AWI_LAST_TXD+12 -#define AWI_LAST_CF_POLL_TXD AWI_LAST_TXD+16 - -/* - * Banner block; null-terminated string. - * - * The doc says it contains - * "PCnetMobile:v2.00 mmddyy APIx.x\0" - */ - -#define AWI_BANNER 0x480 /* Version string */ -#define AWI_BANNER_LEN 0x20 - -/* - * Command block protocol: - * write command byte to a zero value. - * write command status to a zero value. - * write arguments to AWI_COMMAND_PARAMS - * write command byte to a non-zero value. - * wait for command status to be non-zero. - * write command byte to a zero value. - * write command status to a zero value. - */ - -#define AWI_CMD 0x4a0 /* Command opcode byte */ - -#define AWI_CMD_IDLE 0x0 -#define AWI_CMD_NOP 0x1 - -#define AWI_CMD_SET_MIB 0x2 -#define AWI_CMD_GET_MIB 0x9 - -#define AWI_CA_MIB_TYPE 0x0 -#define AWI_CA_MIB_SIZE 0x1 -#define AWI_CA_MIB_INDEX 0x2 -#define AWI_CA_MIB_DATA 0x4 - -#define AWI_MIB_LOCAL 0x0 -#define AWI_MIB_ADDR 0x2 -#define AWI_MIB_MAC 0x3 -#define AWI_MIB_STAT 0x4 -#define AWI_MIB_MGT 0x5 -#define AWI_MIB_DRVR 0x6 -#define AWI_MIB_PHY 0x7 - - -#define AWI_CMD_INIT_TX 0x3 - -#define AWI_CA_TX_LEN 0x14 -#define AWI_CA_TX_DATA 0x0 -#define AWI_CA_TX_MGT 0x4 -#define AWI_CA_TX_BCAST 0x8 -#define AWI_CA_TX_PS 0xc -#define AWI_CA_TX_CF 0x10 - -#define AWI_CMD_FLUSH_TX 0x4 - -#define AWI_CA_FTX_LEN 0x5 -#define AWI_CA_FTX_DATA 0x0 -#define AWI_CA_FTX_MGT 0x1 -#define AWI_CA_FTX_BCAST 0x2 -#define AWI_CA_FTX_PS 0x3 -#define AWI_CA_FTX_CF 0x4 - -#define AWI_CMD_INIT_RX 0x5 -#define AWI_CA_IRX_LEN 0x8 -#define AWI_CA_IRX_DATA_DESC 0x0 /* return */ -#define AWI_CA_IRX_PS_DESC 0x4 /* return */ - -#define AWI_CMD_KILL_RX 0x6 - -#define AWI_CMD_SLEEP 0x7 -#define AWI_CA_SLEEP_LEN 0x8 -#define AWI_CA_WAKEUP 0x0 /* uint64 */ - -#define AWI_CMD_WAKE 0x8 - -#define AWI_CMD_SCAN 0xa -#define AWI_CA_SCAN_LEN 0x6 -#define AWI_CA_SCAN_DURATION 0x0 -#define AWI_CA_SCAN_SET 0x2 -#define AWI_CA_SCAN_PATTERN 0x3 -#define AWI_CA_SCAN_IDX 0x4 -#define AWI_CA_SCAN_SUSP 0x5 - -#define AWI_CMD_SYNC 0xb -#define AWI_CA_SYNC_LEN 0x14 -#define AWI_CA_SYNC_SET 0x0 -#define AWI_CA_SYNC_PATTERN 0x1 -#define AWI_CA_SYNC_IDX 0x2 -#define AWI_CA_SYNC_STARTBSS 0x3 -#define AWI_CA_SYNC_DWELL 0x4 -#define AWI_CA_SYNC_MBZ 0x6 -#define AWI_CA_SYNC_TIMESTAMP 0x8 -#define AWI_CA_SYNC_REFTIME 0x10 - -#define AWI_CMD_RESUME 0xc - -#define AWI_CMD_STATUS 0x4a1 /* Command status */ - -#define AWI_STAT_IDLE 0x0 -#define AWI_STAT_OK 0x1 -#define AWI_STAT_BADCMD 0x2 -#define AWI_STAT_BADPARM 0x3 -#define AWI_STAT_NOTIMP 0x4 -#define AWI_STAT_BADRES 0x5 -#define AWI_STAT_BADMODE 0x6 - -#define AWI_ERROR_OFFSET 0x4a2 /* Offset to erroneous parameter */ -#define AWI_CMD_PARAMS 0x4a4 /* Command parameters */ - -#define AWI_CSB 0x4f0 /* Control/Status block */ - -#define AWI_SELFTEST 0x4f0 - -#define AWI_SELFTEST_INIT 0x00 /* initial */ -#define AWI_SELFTEST_FIRMCKSUM 0x01 /* firmware cksum running */ -#define AWI_SELFTEST_HARDWARE 0x02 /* hardware tests running */ -#define AWI_SELFTEST_MIB 0x03 /* mib initializing */ - -#define AWI_SELFTEST_MIB_FAIL 0xfa -#define AWI_SELFTEST_RADIO_FAIL 0xfb -#define AWI_SELFTEST_MAC_FAIL 0xfc -#define AWI_SELFTEST_FLASH_FAIL 0xfd -#define AWI_SELFTEST_RAM_FAIL 0xfe -#define AWI_SELFTEST_PASSED 0xff - -#define AWI_STA_STATE 0x4f1 - -#define AWI_STA_AP 0x20 /* acting as AP */ -#define AWI_STA_NOPSP 0x10 /* Power Saving disabled */ -#define AWI_STA_DOZE 0x08 /* about to go to sleep */ -#define AWI_STA_PSP 0x04 /* enable PSP */ -#define AWI_STA_RXEN 0x02 /* enable RX */ -#define AWI_STA_TXEN 0x01 /* enable TX */ - -#define AWI_INTSTAT 0x4f3 -#define AWI_INTMASK 0x4f4 - -/* Bits in AWI_INTSTAT/AWI_INTMASK */ - -#define AWI_INT_GROGGY 0x80 /* about to wake up */ -#define AWI_INT_CFP_ENDING 0x40 /* cont. free period ending */ -#define AWI_INT_DTIM 0x20 /* beacon outgoing */ -#define AWI_INT_CFP_START 0x10 /* cont. free period starting */ -#define AWI_INT_SCAN_CMPLT 0x08 /* scan complete */ -#define AWI_INT_TX 0x04 /* tx done */ -#define AWI_INT_RX 0x02 /* rx done */ -#define AWI_INT_CMD 0x01 /* cmd done */ - -/* - * The following are used to implement a locking protocol between host - * and MAC to protect the interrupt status and mask fields. - * - * driver: read lockout_host byte; if zero, set lockout_mac to non-zero, - * then reread lockout_host byte; if still zero, host has lock. - * if non-zero, clear lockout_mac, loop. - */ - -#define AWI_LOCKOUT_MAC 0x4f5 -#define AWI_LOCKOUT_HOST 0x4f6 - - -#define AWI_INTSTAT2 0x4f7 -#define AWI_INTMASK2 0x4fd - -/* Bits in AWI_INTSTAT2/INTMASK2 */ -#define AWI_INT2_RXMGT 0x80 /* mgt/ps recieved */ -#define AWI_INT2_RXDATA 0x40 /* data received */ -#define AWI_INT2_TXMGT 0x10 /* mgt tx done */ -#define AWI_INT2_TXCF 0x08 /* CF tx done */ -#define AWI_INT2_TXPS 0x04 /* PS tx done */ -#define AWI_INT2_TXBCAST 0x02 /* Broadcast tx done */ -#define AWI_INT2_TXDATA 0x01 /* data tx done */ - -#define AWI_DIS_PWRDN 0x4fc /* disable powerdown if set */ - -#define AWI_DRIVERSTATE 0x4fe /* driver state */ - -#define AWI_DRV_STATEMASK 0x0f - -#define AWI_DRV_RESET 0x0 -#define AWI_DRV_INFSY 0x1 /* inf synced */ -#define AWI_DRV_ADHSC 0x2 /* adhoc scan */ -#define AWI_DRV_ADHSY 0x3 /* adhoc synced */ -#define AWI_DRV_INFSC 0x4 /* inf scanning */ -#define AWI_DRV_INFAUTH 0x5 /* inf authed */ -#define AWI_DRV_INFASSOC 0x6 /* inf associated */ -#define AWI_DRV_INFTOSS 0x7 /* inf handoff */ -#define AWI_DRV_APNONE 0x8 /* AP activity: no assoc */ -#define AWI_DRV_APQUIET 0xc /* AP: >=one assoc, no traffic */ -#define AWI_DRV_APLO 0xd /* AP: >=one assoc, light tfc */ -#define AWI_DRV_APMED 0xe /* AP: >=one assoc, mod tfc */ -#define AWI_DRV_APHIGH 0xf /* AP: >=one assoc, heavy tfc */ - -#define AWI_DRV_AUTORXLED 0x10 -#define AWI_DRV_AUTOTXLED 0x20 -#define AWI_DRV_RXLED 0x40 -#define AWI_DRV_TXLED 0x80 - -#define AWI_VBM 0x500 /* Virtual Bit Map */ - -#define AWI_BUFFERS 0x600 /* Buffers */ -#define AWI_BUFFERS_END 0x6000 - -/* - * Receive descriptors; there are a linked list of these chained - * through the "NEXT" fields, starting from XXX - */ - -#define AWI_RXD_SIZE 0x18 - -#define AWI_RXD_NEXT 0x4 -#define AWI_RXD_NEXT_LAST 0x80000000 - - -#define AWI_RXD_HOST_DESC_STATE 0x9 - -#define AWI_RXD_ST_OWN 0x80 /* host owns this */ -#define AWI_RXD_ST_CONSUMED 0x40 /* host is done */ -#define AWI_RXD_ST_LF 0x20 /* last frag */ -#define AWI_RXD_ST_CRC 0x08 /* CRC error */ -#define AWI_RXD_ST_OFLO 0x02 /* possible buffer overrun */ -#define AWI_RXD_ST_RXERROR 0x01 /* this frame is borked; discard me */ - -#define AWI_RXD_RSSI 0xa /* 1 byte: radio strength indicator */ -#define AWI_RXD_INDEX 0xb /* 1 byte: FH hop index or DS channel */ -#define AWI_RXD_LOCALTIME 0xc /* 4 bytes: local time of RX */ -#define AWI_RXD_START_FRAME 0x10 /* 4 bytes: ptr to first received byte */ -#define AWI_RXD_LEN 0x14 /* 2 bytes: rx len in bytes */ -#define AWI_RXD_RATE 0x16 /* 1 byte: rx rate in 1e5 bps */ - -/* - * Transmit descriptors. - */ - -#define AWI_TXD_SIZE 0x18 - -#define AWI_TXD_START 0x00 /* pointer to start of frame */ -#define AWI_TXD_NEXT 0x04 /* pointer to next TXD */ -#define AWI_TXD_LENGTH 0x08 /* length of frame */ -#define AWI_TXD_STATE 0x0a /* state */ - -#define AWI_TXD_ST_OWN 0x80 /* MAC owns this */ -#define AWI_TXD_ST_DONE 0x40 /* MAC is done */ -#define AWI_TXD_ST_REJ 0x20 /* MAC doesn't like */ -#define AWI_TXD_ST_MSDU 0x10 /* MSDU timeout */ -#define AWI_TXD_ST_ABRT 0x08 /* TX aborted */ -#define AWI_TXD_ST_RETURNED 0x04 /* TX returned */ -#define AWI_TXD_ST_RETRY 0x02 /* TX retries exceeded */ -#define AWI_TXD_ST_ERROR 0x01 /* TX error */ - -#define AWI_TXD_RATE 0x0b /* rate */ - -#define AWI_RATE_1MBIT 10 -#define AWI_RATE_2MBIT 20 - -#define AWI_TXD_NDA 0x0c /* num DIFS attempts */ -#define AWI_TXD_NDF 0x0d /* num DIFS failures */ -#define AWI_TXD_NSA 0x0e /* num SIFS attempts */ -#define AWI_TXD_NSF 0x0f /* num SIFS failures */ - -#define AWI_TXD_NRA 0x14 /* num RTS attempts */ -#define AWI_TXD_NDTA 0x15 /* num data attempts */ -#define AWI_TXD_CTL 0x16 /* control */ - -#define AWI_TXD_CTL_PSN 0x80 /* preserve sequence in MAC frame */ -#define AWI_TXD_CTL_BURST 0x02 /* host is doing 802.11 fragmt. */ -#define AWI_TXD_CTL_FRAGS 0x01 /* override normal fragmentation */ - -/* - * MIB structures. - */ - -#define AWI_ESS_ID_SIZE (IEEE80211_NWID_LEN+2) -struct awi_mib_local { - u_int8_t Fragmentation_Dis; - u_int8_t Add_PLCP_Dis; - u_int8_t MAC_Hdr_Prsv; - u_int8_t Rx_Mgmt_Que_En; - u_int8_t Re_Assembly_Dis; - u_int8_t Strip_PLCP_Dis; - u_int8_t Rx_Error_Dis; - u_int8_t Power_Saving_Mode_Dis; - u_int8_t Accept_All_Multicast_Dis; - u_int8_t Check_Seq_Cntl_Dis; - u_int8_t Flush_CFP_Queue_On_CF_End; - u_int8_t Network_Mode; - u_int8_t PWD_Lvl; - u_int8_t CFP_Mode; - u_int8_t Tx_Buffer_Offset[4]; - u_int8_t Tx_Buffer_Size[4]; - u_int8_t Rx_Buffer_Offset[4]; - u_int8_t Rx_Buffer_Size[4]; - u_int8_t Acting_as_AP; - u_int8_t Fill_CFP; -}; - -struct awi_mib_mac { - u_int8_t _Reserved1[2]; - u_int8_t _Reserved2[2]; - u_int8_t aRTS_Threshold[2]; - u_int8_t aCW_max[2]; - u_int8_t aCW_min[2]; - u_int8_t aPromiscuous_Enable; - u_int8_t _Reserved3; - u_int8_t _Reserved4[4]; - u_int8_t aShort_Retry_Limit; - u_int8_t aLong_Retry_Limit; - u_int8_t aMax_Frame_Length[2]; - u_int8_t aFragmentation_Threshold[2]; - u_int8_t aProbe_Delay[2]; - u_int8_t aMin_Probe_Response_Time[2]; - u_int8_t aMax_Probe_Response_Time[2]; - u_int8_t aMax_Transmit_MSDU_Lifetime[4]; - u_int8_t aMax_Receive_MSDU_Lifetime[4]; - u_int8_t aStation_Basic_Rate[2]; - u_int8_t aDesired_ESS_ID[AWI_ESS_ID_SIZE]; -}; - -struct awi_mib_stat { - u_int8_t aTransmitted_MPDU_Count[4]; - u_int8_t aTransmitted_MSDU_Count[4]; - u_int8_t aOctets_Transmitted_Cnt[4]; - u_int8_t aMulticast_Transmitted_Frame_Count[2]; - u_int8_t aBroadcast_Transmitted_Frame_Count[2]; - u_int8_t aFailed_Count[4]; - u_int8_t aRetry_Count[4]; - u_int8_t aMultiple_Retry_Count[4]; - u_int8_t aFrame_Duplicate_Count[4]; - u_int8_t aRTS_Success_Count[4]; - u_int8_t aRTS_Failure_Count[4]; - u_int8_t aACK_Failure_Count[4]; - u_int8_t aReceived_Frame_Count [4]; - u_int8_t aOctets_Received_Count[4]; - u_int8_t aMulticast_Received_Count[2]; - u_int8_t aBroadcast_Received_Count[2]; - u_int8_t aFCS_Error_Count[4]; - u_int8_t aError_Count[4]; - u_int8_t aWEP_Undecryptable_Count[4]; -}; - -struct awi_mib_mgt { - u_int8_t aPower_Mgt_Mode; - u_int8_t aScan_Mode; -#define AWI_SCAN_PASSIVE 0x00 -#define AWI_SCAN_ACTIVE 0x01 -#define AWI_SCAN_BACKGROUND 0x02 - u_int8_t aScan_State; - u_int8_t aDTIM_Period; - u_int8_t aATIM_Window[2]; - u_int8_t Wep_Required; - u_int8_t _Reserved1; - u_int8_t aBeacon_Period[2]; - u_int8_t aPassive_Scan_Duration[2]; - u_int8_t aListen_Interval[2]; - u_int8_t aMedium_Occupancy_Limit[2]; - u_int8_t aMax_MPDU_Time[2]; - u_int8_t aCFP_Max_Duration[2]; - u_int8_t aCFP_Rate; - u_int8_t Do_Not_Receive_DTIMs; - u_int8_t aStation_ID[2]; - u_int8_t aCurrent_BSS_ID[ETHER_ADDR_LEN]; - u_int8_t aCurrent_ESS_ID[AWI_ESS_ID_SIZE]; -}; - -#define AWI_GROUP_ADDR_SIZE 4 -struct awi_mib_addr { - u_int8_t aMAC_Address[ETHER_ADDR_LEN]; - u_int8_t aGroup_Addresses[AWI_GROUP_ADDR_SIZE][ETHER_ADDR_LEN]; - u_int8_t aTransmit_Enable_Status; - u_int8_t _Reserved1; -}; - -#define AWI_PWR_LEVEL_SIZE 4 -struct awi_mib_phy { - u_int8_t aSlot_Time[2]; - u_int8_t aSIFS[2]; - u_int8_t aMPDU_Maximum[2]; - u_int8_t aHop_Time[2]; - u_int8_t aSuprt_Data_Rates[4]; - u_int8_t aCurrent_Reg_Domain; -#define AWI_REG_DOMAIN_US 0x10 -#define AWI_REG_DOMAIN_CA 0x20 -#define AWI_REG_DOMAIN_EU 0x30 -#define AWI_REG_DOMAIN_ES 0x31 -#define AWI_REG_DOMAIN_FR 0x32 -#define AWI_REG_DOMAIN_JP 0x40 - u_int8_t aPreamble_Lngth; - u_int8_t aPLCP_Hdr_Lngth; - u_int8_t Pwr_Up_Time[AWI_PWR_LEVEL_SIZE][2]; - u_int8_t IEEE_PHY_Type; -#define AWI_PHY_TYPE_FH 1 -#define AWI_PHY_TYPE_DS 2 -#define AWI_PHY_TYPE_IR 3 - u_int8_t RCR_33A_Bits[8]; -}; diff --git a/sys/dev/cs/if_csreg.h b/sys/dev/cs/if_csreg.h deleted file mode 100644 index e771156fe1f3..000000000000 --- a/sys/dev/cs/if_csreg.h +++ /dev/null @@ -1,544 +0,0 @@ -/* - * Copyright (c) 1997,1998 Maxim Bolotin and Oleg Sharoiko. - * 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$ - */ - -#define CS_89x0_IO_PORTS 0x0020 - -#define PP_ChipID 0x0000 /* offset 0h -> Corp -ID */ - /* offset 2h -> Model/Product Number */ - /* offset 3h -> Chip Revision Number */ - -#define PP_ISAIOB 0x0020 /* IO base address */ -#define PP_CS8900_ISAINT 0x0022 /* ISA interrupt select */ -#define PP_CS8900_ISADMA 0x0024 /* ISA Rec DMA channel */ -#define PP_CS8920_ISAINT 0x0370 /* ISA interrupt select */ -#define PP_CS8920_ISADMA 0x0374 /* ISA Rec DMA channel */ -#define PP_ISASOF 0x0026 /* ISA DMA offset */ -#define PP_DmaFrameCnt 0x0028 /* ISA DMA Frame count */ -#define PP_DmaByteCnt 0x002A /* ISA DMA Byte count */ -#define PP_CS8920_ISAMemB 0x0348 /* Memory base */ - -/* EEPROM data and command registers */ -#define PP_EECMD 0x0040 /* NVR Interface Command register */ -#define PP_EEData 0x0042 /* NVR Interface Data Register */ -#define PP_DebugReg 0x0044 /* Debug Register */ - -#define PP_RxCFG 0x0102 /* Rx Bus config */ -#define PP_RxCTL 0x0104 /* Receive Control Register */ -#define PP_TxCFG 0x0106 /* Transmit Config Register */ -#define PP_TxCMD 0x0108 /* Transmit Command Register */ -#define PP_BufCFG 0x010A /* Bus configuration Register */ -#define PP_LineCTL 0x0112 /* Line Config Register */ -#define PP_SelfCTL 0x0114 /* Self Command Register */ -#define PP_BusCTL 0x0116 /* ISA bus control Register */ -#define PP_TestCTL 0x0118 /* Test Register */ -#define PP_AutoNegCTL 0x011C /* Auto Negotiation Ctrl */ - -#define PP_ISQ 0x0120 /* Interrupt Status */ -#define PP_RxEvent 0x0124 /* Rx Event Register */ -#define PP_TxEvent 0x0128 /* Tx Event Register */ -#define PP_BufEvent 0x012C /* Bus Event Register */ -#define PP_RxMiss 0x0130 /* Receive Miss Count */ -#define PP_TxCol 0x0132 /* Transmit Collision Count */ -#define PP_LineST 0x0134 /* Line State Register */ -#define PP_SelfST 0x0136 /* Self State register */ -#define PP_BusST 0x0138 /* Bus Status */ -#define PP_TDR 0x013C /* Time Domain Reflectometry */ -#define PP_AutoNegST 0x013E /* Auto Neg Status */ -#define PP_TxCommand 0x0144 /* Tx Command */ -#define PP_TxLength 0x0146 /* Tx Length */ -#define PP_LAF 0x0150 /* Hash Table */ -#define PP_IA 0x0158 /* Physical Address Register */ - -#define PP_RxStatus 0x0400 /* Receive start of frame */ -#define PP_RxLength 0x0402 /* Receive Length of frame */ -#define PP_RxFrame 0x0404 /* Receive frame pointer */ -#define PP_TxFrame 0x0A00 /* Transmit frame pointer */ - -/* - * Primary I/O Base Address. If no I/O base is supplied by the user, then this - * can be used as the default I/O base to access the PacketPage Area. - */ -#define DEFAULTIOBASE 0x0300 -#define FIRST_IO 0x020C /* First I/O port to check */ -#define LAST_IO 0x037C /* Last I/O port to check (+10h) */ -#define ADD_MASK 0x3000 /* Mask it use of the ADD_PORT register */ -#define ADD_SIG 0x3000 /* Expected ID signature */ - -#define CHIP_EISA_ID_SIG 0x630E /* Product ID Code for Crystal Chip (CS8900 spec 4.3) */ - -#define PRODUCT_ID_ADD 0x0002 /* Address of product ID */ - -/* Mask to find out the types of registers */ -#define REG_TYPE_MASK 0x001F - -/* Eeprom Commands */ -#define ERSE_WR_ENBL 0x00F0 -#define ERSE_WR_DISABLE 0x0000 - -/* Defines Control/Config register quintuplet numbers */ -#define RX_BUF_CFG 0x0003 -#define RX_CONTROL 0x0005 -#define TX_CFG 0x0007 -#define TX_COMMAND 0x0009 -#define BUF_CFG 0x000B -#define LINE_CONTROL 0x0013 -#define SELF_CONTROL 0x0015 -#define BUS_CONTROL 0x0017 -#define TEST_CONTROL 0x0019 - -/* Defines Status/Count registers quintuplet numbers */ -#define RX_EVENT 0x0004 -#define TX_EVENT 0x0008 -#define BUF_EVENT 0x000C -#define RX_MISS_COUNT 0x0010 -#define TX_COL_COUNT 0x0012 -#define LINE_STATUS 0x0014 -#define SELF_STATUS 0x0016 -#define BUS_STATUS 0x0018 -#define TDR 0x001C - -/* - * PP_RxCFG - Receive Configuration and Interrupt Mask - * bit definition - Read/write - */ -#define SKIP_1 0x0040 -#define RX_STREAM_ENBL 0x0080 -#define RX_OK_ENBL 0x0100 -#define RX_DMA_ONLY 0x0200 -#define AUTO_RX_DMA 0x0400 -#define BUFFER_CRC 0x0800 -#define RX_CRC_ERROR_ENBL 0x1000 -#define RX_RUNT_ENBL 0x2000 -#define RX_EXTRA_DATA_ENBL 0x4000 - -/* PP_RxCTL - Receive Control bit definition - Read/write */ -#define RX_IA_HASH_ACCEPT 0x0040 -#define RX_PROM_ACCEPT 0x0080 -#define RX_OK_ACCEPT 0x0100 -#define RX_MULTCAST_ACCEPT 0x0200 -#define RX_IA_ACCEPT 0x0400 -#define RX_BROADCAST_ACCEPT 0x0800 -#define RX_BAD_CRC_ACCEPT 0x1000 -#define RX_RUNT_ACCEPT 0x2000 -#define RX_EXTRA_DATA_ACCEPT 0x4000 -#define RX_ALL_ACCEPT (RX_PROM_ACCEPT | RX_BAD_CRC_ACCEPT | \ - RX_RUNT_ACCEPT | RX_EXTRA_DATA_ACCEPT) -/* - * Default receive mode - individually addressed, broadcast, and error free - */ -#define RX_DEF_ACCEPT (RX_IA_ACCEPT | RX_BROADCAST_ACCEPT | RX_OK_ACCEPT) - -/* - * PP_TxCFG - Transmit Configuration Interrupt Mask - * bit definition - Read/write - */ -#define TX_LOST_CRS_ENBL 0x0040 -#define TX_SQE_ERROR_ENBL 0x0080 -#define TX_OK_ENBL 0x0100 -#define TX_LATE_COL_ENBL 0x0200 -#define TX_JBR_ENBL 0x0400 -#define TX_ANY_COL_ENBL 0x0800 -#define TX_16_COL_ENBL 0x8000 - -/* - * PP_TxCMD - Transmit Command bit definition - Read-only - */ -#define TX_START_4_BYTES 0x0000 -#define TX_START_64_BYTES 0x0040 -#define TX_START_128_BYTES 0x0080 -#define TX_START_ALL_BYTES 0x00C0 -#define TX_FORCE 0x0100 -#define TX_ONE_COL 0x0200 -#define TX_TWO_PART_DEFF_DISABLE 0x0400 -#define TX_NO_CRC 0x1000 -#define TX_RUNT 0x2000 - -/* - * PP_BufCFG - Buffer Configuration Interrupt Mask - * bit definition - Read/write - */ -#define GENERATE_SW_INTERRUPT 0x0040 -#define RX_DMA_ENBL 0x0080 -#define READY_FOR_TX_ENBL 0x0100 -#define TX_UNDERRUN_ENBL 0x0200 -#define RX_MISS_ENBL 0x0400 -#define RX_128_BYTE_ENBL 0x0800 -#define TX_COL_COUNT_OVRFLOW_ENBL 0x1000 -#define RX_MISS_COUNT_OVRFLOW_ENBL 0x2000 -#define RX_DEST_MATCH_ENBL 0x8000 - -/* - * PP_LineCTL - Line Control bit definition - Read/write - */ -#define SERIAL_RX_ON 0x0040 -#define SERIAL_TX_ON 0x0080 -#define AUI_ONLY 0x0100 -#define AUTO_AUI_10BASET 0x0200 -#define MODIFIED_BACKOFF 0x0800 -#define NO_AUTO_POLARITY 0x1000 -#define TWO_PART_DEFDIS 0x2000 -#define LOW_RX_SQUELCH 0x4000 - -/* - * PP_SelfCTL - Software Self Control bit definition - Read/write - */ -#define POWER_ON_RESET 0x0040 -#define SW_STOP 0x0100 -#define SLEEP_ON 0x0200 -#define AUTO_WAKEUP 0x0400 -#define HCB0_ENBL 0x1000 -#define HCB1_ENBL 0x2000 -#define HCB0 0x4000 -#define HCB1 0x8000 - -/* - * PP_BusCTL - ISA Bus Control bit definition - Read/write - */ -#define RESET_RX_DMA 0x0040 -#define MEMORY_ON 0x0400 -#define DMA_BURST_MODE 0x0800 -#define IO_CHANNEL_READY_ON 0x1000 -#define RX_DMA_SIZE_64Ks 0x2000 -#define ENABLE_IRQ 0x8000 - -/* - * PP_TestCTL - Test Control bit definition - Read/write - */ -#define LINK_OFF 0x0080 -#define ENDEC_LOOPBACK 0x0200 -#define AUI_LOOPBACK 0x0400 -#define BACKOFF_OFF 0x0800 -#define FAST_TEST 0x8000 - -/* - * PP_RxEvent - Receive Event Bit definition - Read-only - */ -#define RX_IA_HASHED 0x0040 -#define RX_DRIBBLE 0x0080 -#define RX_OK 0x0100 -#define RX_HASHED 0x0200 -#define RX_IA 0x0400 -#define RX_BROADCAST 0x0800 -#define RX_CRC_ERROR 0x1000 -#define RX_RUNT 0x2000 -#define RX_EXTRA_DATA 0x4000 - -#define HASH_INDEX_MASK 0x0FC00 - -/* - * PP_TxEvent - Transmit Event Bit definition - Read-only - */ -#define TX_LOST_CRS 0x0040 -#define TX_SQE_ERROR 0x0080 -#define TX_OK 0x0100 -#define TX_LATE_COL 0x0200 -#define TX_JBR 0x0400 -#define TX_16_COL 0x8000 -#define TX_SEND_OK_BITS (TX_OK | TX_LOST_CRS) -#define TX_COL_COUNT_MASK 0x7800 - -/* - * PP_BufEvent - Buffer Event Bit definition - Read-only - */ -#define SW_INTERRUPT 0x0040 -#define RX_DMA 0x0080 -#define READY_FOR_TX 0x0100 -#define TX_UNDERRUN 0x0200 -#define RX_MISS 0x0400 -#define RX_128_BYTE 0x0800 -#define TX_COL_OVRFLW 0x1000 -#define RX_MISS_OVRFLW 0x2000 -#define RX_DEST_MATCH 0x8000 - -/* - * PP_LineST - Ethernet Line Status bit definition - Read-only - */ -#define LINK_OK 0x0080 -#define AUI_ON 0x0100 -#define TENBASET_ON 0x0200 -#define POLARITY_OK 0x1000 -#define CRS_OK 0x4000 - -/* - * PP_SelfST - Chip Software Status bit definition - */ -#define ACTIVE_33V 0x0040 -#define INIT_DONE 0x0080 -#define SI_BUSY 0x0100 -#define EEPROM_PRESENT 0x0200 -#define EEPROM_OK 0x0400 -#define EL_PRESENT 0x0800 -#define EE_SIZE_64 0x1000 - -/* - * PP_BusST - ISA Bus Status bit definition - */ -#define TX_BID_ERROR 0x0080 -#define READY_FOR_TX_NOW 0x0100 - -/* - * PP_AutoNegCTL - Auto Negotiation Control bit definition - */ -#define RE_NEG_NOW 0x0040 -#define ALLOW_FDX 0x0080 -#define AUTO_NEG_ENABLE 0x0100 -#define NLP_ENABLE 0x0200 -#define FORCE_FDX 0x8000 -#define AUTO_NEG_BITS (FORCE_FDX | NLP_ENABLE | AUTO_NEG_ENABLE) -#define AUTO_NEG_MASK (FORCE_FDX | NLP_ENABLE | AUTO_NEG_ENABLE | \ - ALLOW_FDX | RE_NEG_NOW) - -/* - * PP_AutoNegST - Auto Negotiation Status bit definition - */ -#define AUTO_NEG_BUSY 0x0080 -#define FLP_LINK 0x0100 -#define FLP_LINK_GOOD 0x0800 -#define LINK_FAULT 0x1000 -#define HDX_ACTIVE 0x4000 -#define FDX_ACTIVE 0x8000 - -/* - * The following block defines the ISQ event types - */ -#define ISQ_RECEIVER_EVENT 0x04 -#define ISQ_TRANSMITTER_EVENT 0x08 -#define ISQ_BUFFER_EVENT 0x0c -#define ISQ_RX_MISS_EVENT 0x10 -#define ISQ_TX_COL_EVENT 0x12 - -#define ISQ_EVENT_MASK 0x003F /* ISQ mask to find out type of event */ -#define ISQ_HIST 16 /* small history buffer */ -#define AUTOINCREMENT 0x8000 /* Bit mask to set bit-15 for autoincrement */ - -#define TXRXBUFSIZE 0x0600 -#define RXDMABUFSIZE 0x8000 -#define RXDMASIZE 0x4000 -#define TXRX_LENGTH_MASK 0x07FF - -/* rx options bits */ -#define RCV_WITH_RXON 1 /* Set SerRx ON */ -#define RCV_COUNTS 2 /* Use Framecnt1 */ -#define RCV_PONG 4 /* Pong respondent */ -#define RCV_DONG 8 /* Dong operation */ -#define RCV_POLLING 0x10 /* Poll RxEvent */ -#define RCV_ISQ 0x20 /* Use ISQ, int */ -#define RCV_AUTO_DMA 0x100 /* Set AutoRxDMAE */ -#define RCV_DMA 0x200 /* Set RxDMA only */ -#define RCV_DMA_ALL 0x400 /* Copy all DMA'ed */ -#define RCV_FIXED_DATA 0x800 /* Every frame same */ -#define RCV_IO 0x1000 /* Use ISA IO only */ -#define RCV_MEMORY 0x2000 /* Use ISA Memory */ - -#define RAM_SIZE 0x1000 /* The card has 4k bytes or RAM */ -#define PKT_START PP_TxFrame /* Start of packet RAM */ - -#define RX_FRAME_PORT 0x0000 -#define TX_FRAME_PORT RX_FRAME_PORT -#define TX_CMD_PORT 0x0004 -#define TX_CS8900_NOW 0x0000 /* Tx packet after 5 bytes copied */ -#define TX_CS8900_AFTER_381 0x0020 /* Tx packet after 381 bytes copied */ -#define TX_CS8900_AFTER_ALL 0x0060 /* Tx packet after all bytes copied */ -#define TX_CS8920_NOW 0x0000 /* Tx packet after 5 bytes copied */ -#define TX_CS8920_AFTER_381 0x0040 /* Tx packet after 381 bytes copied */ -#define TX_CS8920_AFTER_1021 0x0080 /* Tx packet after1021 bytes copied */ -#define TX_CS8920_AFTER_ALL 0x00C0 /* Tx packet after all bytes copied */ -#define TX_LEN_PORT 0x0006 -#define ISQ_PORT 0x0008 -#define ADD_PORT 0x000A -#define DATA_PORT 0x000C - -#define EEPROM_WRITE_EN 0x00F0 -#define EEPROM_WRITE_DIS 0x0000 -#define EEPROM_WRITE_CMD 0x0100 -#define EEPROM_READ_CMD 0x0200 - -/* Receive Header - * Description of header of each packet in receive area of memory - */ -#define RBUF_EVENT_LOW 0 /* Low byte of RxEvent - status of received frame */ -#define RBUF_EVENT_HIGH 1 /* High byte of RxEvent - status of received frame */ -#define RBUF_LEN_LOW 2 /* Length of received data - low byte */ -#define RBUF_LEN_HI 3 /* Length of received data - high byte */ -#define RBUF_HEAD_LEN 4 /* Length of this header */ - -#define CHIP_READ 0x1 /* Used to mark state of the repins code (chip or dma) */ -#define DMA_READ 0x2 /* Used to mark state of the repins code (chip or dma) */ - -/* for bios scan */ -/* */ -#ifdef CSDEBUG -/* use these values for debugging bios scan */ -#define BIOS_START_SEG 0x00000 -#define BIOS_OFFSET_INC 0x0010 -#else -#define BIOS_START_SEG 0x0c000 -#define BIOS_OFFSET_INC 0x0200 -#endif - -#define BIOS_LAST_OFFSET 0x0fc00 - -/* - * Byte offsets into the EEPROM configuration buffer - */ -#define ISA_CNF_OFFSET 0x6 -#define TX_CTL_OFFSET (ISA_CNF_OFFSET + 8) /* 8900 eeprom */ -#define AUTO_NEG_CNF_OFFSET (ISA_CNF_OFFSET + 8) /* 8920 eeprom */ - -/* - * the assumption here is that the bits in the eeprom are generally - * in the same position as those in the autonegctl register. - * Of course the IMM bit is not in that register so it must be - * masked out - */ -#define EE_FORCE_FDX 0x8000 -#define EE_NLP_ENABLE 0x0200 -#define EE_AUTO_NEG_ENABLE 0x0100 -#define EE_ALLOW_FDX 0x0080 -#define EE_AUTO_NEG_CNF_MASK (EE_FORCE_FDX | EE_NLP_ENABLE | \ - EE_AUTO_NEG_ENABLE | EE_ALLOW_FDX) - -#define IMM_BIT 0x0040 /* ignore missing media */ - -#define ADAPTER_CNF_OFFSET (AUTO_NEG_CNF_OFFSET + 2) -#define A_CNF_MEDIA 0x0007 -#define A_CNF_10B_T 0x0001 -#define A_CNF_AUI 0x0002 -#define A_CNF_10B_2 0x0004 -#define A_CNF_MEDIA_TYPE 0x0060 -#define A_CNF_MEDIA_AUTO 0x0000 -#define A_CNF_MEDIA_10B_T 0x0020 -#define A_CNF_MEDIA_AUI 0x0040 -#define A_CNF_MEDIA_10B_2 0x0060 -#define A_CNF_DC_DC_POLARITY 0x0080 -#define A_CNF_NO_AUTO_POLARITY 0x2000 -#define A_CNF_LOW_RX_SQUELCH 0x4000 -#define A_CNF_EXTND_10B_2 0x8000 - -#define PACKET_PAGE_OFFSET 0x8 - -/* - * Bit definitions for the ISA configuration word from the EEPROM - */ -#define INT_NO_MASK 0x000F -#define DMA_NO_MASK 0x0070 -#define ISA_DMA_SIZE 0x0200 -#define ISA_AUTO_RxDMA 0x0400 -#define ISA_RxDMA 0x0800 -#define DMA_BURST 0x1000 -#define STREAM_TRANSFER 0x2000 -#define ANY_ISA_DMA (ISA_AUTO_RxDMA | ISA_RxDMA) - -/* DMA controller registers */ -#define DMA_BASE 0x00 /* DMA controller base */ -#define DMA_BASE_2 0x0C0 /* DMA controller base */ - -#define DMA_STAT 0x0D0 /* DMA controller status register */ -#define DMA_MASK 0x0D4 /* DMA controller mask register */ -#define DMA_MODE 0x0D6 /* DMA controller mode register */ -#define DMA_RESETFF 0x0D8 /* DMA controller first/last flip flop */ - -/* DMA data */ -#define DMA_DISABLE 0x04 /* Disable channel n */ -#define DMA_ENABLE 0x00 /* Enable channel n */ -/* Demand transfers, incr. address, auto init, writes, ch. n */ -#define DMA_RX_MODE 0x14 -/* Demand transfers, incr. address, auto init, reads, ch. n */ -#define DMA_TX_MODE 0x18 - -#define DMA_SIZE (16*1024) /* Size of dma buffer - 16k */ - -#define CS8900 0x0000 -#define CS8920 0x4000 -#define CS8920M 0x6000 -#define REVISON_BITS 0x1F00 -#define EEVER_NUMBER 0x12 -#define CHKSUM_LEN 0x14 -#define CHKSUM_VAL 0x0000 -#define START_EEPROM_DATA 0x001c /* Offset into eeprom for start of data */ -#define IRQ_MAP_EEPROM_DATA 0x0046 /* Offset into eeprom for the IRQ map */ -#define IRQ_MAP_LEN 0x0004 /* No of bytes to read for the IRQ map */ -#define PNP_IRQ_FRMT 0x0022 /* PNP small item IRQ format */ -#define CS8900_IRQ_MAP 0x1c20 /* This IRQ map is fixed */ - -#define CS8920_NO_INTS 0x0F /* Max CS8920 interrupt select # */ - -#define PNP_ADD_PORT 0x0279 -#define PNP_WRITE_PORT 0x0A79 - -#define GET_PNP_ISA_STRUCT 0x40 -#define PNP_ISA_STRUCT_LEN 0x06 -#define PNP_CSN_CNT_OFF 0x01 -#define PNP_RD_PORT_OFF 0x02 -#define PNP_FUNCTION_OK 0x00 -#define PNP_WAKE 0x03 -#define PNP_RSRC_DATA 0x04 -#define PNP_RSRC_READY 0x01 -#define PNP_STATUS 0x05 -#define PNP_ACTIVATE 0x30 -#define PNP_CNF_IO_H 0x60 -#define PNP_CNF_IO_L 0x61 -#define PNP_CNF_INT 0x70 -#define PNP_CNF_DMA 0x74 -#define PNP_CNF_MEM 0x48 - -#define BIT0 1 -#define BIT15 0x8000 - -#define CS_DUPLEX_AUTO 0 -#define CS_DUPLEX_FULL 1 -#define CS_DUPLEX_HALF 2 - -/* Device name */ -#define CS_NAME "cs" - -#define cs_readreg(iobase, portno) \ - (outw((iobase) + ADD_PORT, (portno)), \ - inw((iobase) + DATA_PORT)) -#define cs_writereg(iobase, portno, value) \ - (outw((iobase) + ADD_PORT, (portno)), \ - outw((iobase) + DATA_PORT, (value))) -#define cs_readword(iobase, portno) \ - (inw((iobase) + (portno))) -#define cs_writeword(iobase, portno, value) \ - (outw((iobase) + (portno), (value))) - -#define reset_chip(nic_addr) \ - cs_writereg(nic_addr, PP_SelfCTL, cs_readreg(ioaddr, PP_SelfCTL) | POWER_ON_RESET), \ - DELAY(30000) - -#define cs_duplex_full(sc) \ - (cs_writereg(sc->nic_addr, PP_AutoNegCTL, FORCE_FDX)) - -#define cs_duplex_half(sc) \ - (cs_writereg(sc->nic_addr, PP_AutoNegCTL, NLP_ENABLE)) - diff --git a/sys/dev/dpt/dpt_isa.c b/sys/dev/dpt/dpt_isa.c deleted file mode 100644 index bb34534b7d6b..000000000000 --- a/sys/dev/dpt/dpt_isa.c +++ /dev/null @@ -1,186 +0,0 @@ -/*- - * Copyright (c) 2000 Matthew N. Dodd <winter@jurai.net> - * 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$ - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#include <sys/module.h> -#include <sys/bus.h> - -#include <machine/bus_pio.h> -#include <machine/bus.h> -#include <machine/resource.h> -#include <sys/rman.h> - -#include <isa/isavar.h> - -#include <cam/scsi/scsi_all.h> - -#include <dev/dpt/dpt.h> - -static int dpt_isa_probe (device_t); -static int dpt_isa_attach (device_t); - -static int -dpt_isa_probe (device_t dev) -{ - dpt_conf_t * conf; - u_int32_t io_base; - - /* No pnp support */ - if (isa_get_vendorid(dev)) - return (ENXIO); - - if ((io_base = bus_get_resource_start(dev, SYS_RES_IOPORT, 0)) == 0) - return (ENXIO); - - conf = dpt_pio_get_conf(io_base); - if (!conf) { - printf("dpt: dpt_pio_get_conf() failed.\n"); - return (ENXIO); - } - - device_set_desc(dev, "ISA DPT SCSI controller"); - bus_set_resource(dev, SYS_RES_IRQ, 0, conf->IRQ, 1); - bus_set_resource(dev, SYS_RES_DRQ, 0, ((8 - conf->DMA_channel) & 7), 1); - - return 0; -} - -static int -dpt_isa_attach (device_t dev) -{ - dpt_softc_t * dpt = NULL; - struct resource *io = 0; - struct resource *irq = 0; - struct resource *drq = 0; - int s; - int rid; - void * ih; - int error = 0; - - rid = 0; - io = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE); - if (!io) { - device_printf(dev, "No I/O space?!\n"); - error = ENOMEM; - goto bad; - } - - rid = 0; - irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1, RF_ACTIVE); - if (!irq) { - device_printf(dev, "No IRQ!\n"); - error = ENOMEM; - goto bad; - } - - rid = 0; - drq = bus_alloc_resource(dev, SYS_RES_DRQ, &rid, 0, ~0, 1, RF_ACTIVE); - if (!drq) { - device_printf(dev, "No DRQ?!\n"); - error = ENOMEM; - goto bad; - } - - dpt = dpt_alloc(dev, rman_get_bustag(io), rman_get_bushandle(io)); - if (dpt == NULL) { - error = ENXIO; - goto bad; - } - - isa_dmacascade(rman_get_start(drq)); - - /* Allocate a dmatag representing the capabilities of this attachment */ - if (bus_dma_tag_create( /* parent */ NULL, - /* alignemnt */ 1, - /* boundary */ 0, - /* lowaddr */ BUS_SPACE_MAXADDR_24BIT, - /* highaddr */ BUS_SPACE_MAXADDR, - /* filter */ NULL, - /* filterarg */ NULL, - /* maxsize */ BUS_SPACE_MAXSIZE_32BIT, - /* nsegments */ BUS_SPACE_UNRESTRICTED, - /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, - /* flags */ 0, - &dpt->parent_dmat) != 0) { - error = ENXIO; - goto bad; - } - - s = splcam(); - - if (dpt_init(dpt) != 0) { - splx(s); - error = ENXIO; - goto bad; - } - - /* Register with the XPT */ - dpt_attach(dpt); - - splx(s); - - if (bus_setup_intr(dev, irq, INTR_TYPE_CAM, dpt_intr, dpt, &ih)) { - device_printf(dev, "Unable to register interrupt handler\n"); - error = ENXIO; - goto bad; - } - - return (error); - - bad: - if (dpt) - dpt_free(dpt); - if (io) - bus_release_resource(dev, SYS_RES_IOPORT, 0, io); - if (irq) - bus_release_resource(dev, SYS_RES_IRQ, 0, irq); - if (drq) - bus_release_resource(dev, SYS_RES_DRQ, 0, drq); - - return (error); -} - -static device_method_t dpt_isa_methods[] = { - /* Device interface */ - DEVMETHOD(device_probe, dpt_isa_probe), - DEVMETHOD(device_attach, dpt_isa_attach), - - { 0, 0 } -}; - -static driver_t dpt_isa_driver = { - "dpt", - dpt_isa_methods, - sizeof(dpt_softc_t), -}; - -static devclass_t dpt_devclass; - -DRIVER_MODULE(dpt, isa, dpt_isa_driver, dpt_devclass, 0, 0); diff --git a/sys/dev/ic/hd64570.h b/sys/dev/ic/hd64570.h deleted file mode 100644 index b676e25a9cd5..000000000000 --- a/sys/dev/ic/hd64570.h +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (c) 1995 John Hay. 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 [your name] - * and [any other names deserving credit ] - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY [your name] 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. - * - * $FreeBSD$ - */ -#ifndef _HD64570_H_ -#define _HD64570_H_ - -typedef struct msci_channel - { - union - { - unsigned short us_trb; /* rw */ - struct - { - unsigned char uc_trbl; - unsigned char uc_trbh; - }uc_trb; - }u_trb; - unsigned char st0; /* ro */ - unsigned char st1; /* rw */ - unsigned char st2; /* rw */ - unsigned char st3; /* ro */ - unsigned char fst; /* rw */ - unsigned char unused0; - unsigned char ie0; /* rw */ - unsigned char ie1; /* rw */ - unsigned char ie2; /* rw */ - unsigned char fie; /* rw */ - unsigned char cmd; /* wo */ - unsigned char unused1; - unsigned char md0; /* rw */ - unsigned char md1; /* rw */ - unsigned char md2; /* rw */ - unsigned char ctl; /* rw */ - unsigned char sa0; /* rw */ - unsigned char sa1; /* rw */ - unsigned char idl; /* rw */ - unsigned char tmc; /* rw */ - unsigned char rxs; /* rw */ - unsigned char txs; /* rw */ - unsigned char trc0; /* rw */ - unsigned char trc1; /* rw */ - unsigned char rrc; /* rw */ - unsigned char unused2; - unsigned char cst0; /* rw */ - unsigned char cst1; /* rw */ - unsigned char unused3[2]; - }msci_channel; - -#define trb u_trb.us_trb -#define trbl u_trb.uc_trb.uc_trbl -#define trbh u_trb.uc_trb.uc_trbh - -typedef struct timer_channel - { - unsigned short tcnt; /* rw */ - unsigned short tconr; /* wo */ - unsigned char tcsr; /* rw */ - unsigned char tepr; /* rw */ - unsigned char unused[2]; - }timer_channel; - -typedef struct dmac_channel - { - unsigned short dar; /* rw */ - unsigned char darb; /* rw */ - unsigned char unused0; - unsigned short sar; /* rw On odd numbered dmacs (tx) only */ - unsigned char sarb; /* rw */ -#define cpb sarb - unsigned char unused1; - unsigned short cda; /* rw */ - unsigned short eda; /* rw */ - unsigned short bfl; /* rw On even numbered dmacs (rx) only */ - unsigned short bcr; /* rw */ - unsigned char dsr; /* rw */ - unsigned char dmr; /* rw */ - unsigned char unused2; - unsigned char fct; /* rw */ - unsigned char dir; /* rw */ - unsigned char dcr; /* rw */ - unsigned char unused3[10]; - }dmac_channel; - -/* x is the channel number. rx channels are even numbered and tx, odd. */ -#define DMAC_RXCH(x) ((x*2) + 0) -#define DMAC_TXCH(x) ((x*2) + 1) - -typedef struct sca_regs - { - unsigned char lpr; /* rw */ - unsigned char unused0; /* -- */ - /* Wait system */ - unsigned char pabr0; /* rw */ - unsigned char pabr1; /* rw */ - unsigned char wcrl; /* rw */ - unsigned char wcrm; /* rw */ - unsigned char wcrh; /* rw */ - unsigned char unused1; - /* DMAC */ - unsigned char pcr; /* rw */ - unsigned char dmer; /* rw */ - unsigned char unused2[6]; - /* Interrupt */ - unsigned char isr0; /* ro */ - unsigned char isr1; /* ro */ - unsigned char isr2; /* ro */ - unsigned char unused3; - unsigned char ier0; /* rw */ - unsigned char ier1; /* rw */ - unsigned char ier2; /* rw */ - unsigned char unused4; - unsigned char itcr; /* rw */ - unsigned char unused5; - unsigned char ivr; /* rw */ - unsigned char unused6; - unsigned char imvr; /* rw */ - unsigned char unused7[3]; - /* MSCI Channel 0 */ - msci_channel msci[2]; - timer_channel timer[4]; - dmac_channel dmac[4]; - }sca_regs; - -#define SCA_CMD_TXRESET 0x01 -#define SCA_CMD_TXENABLE 0x02 -#define SCA_CMD_TXDISABLE 0x03 -#define SCA_CMD_TXCRCINIT 0x04 -#define SCA_CMD_TXCRCEXCL 0x05 -#define SCA_CMS_TXEOM 0x06 -#define SCA_CMD_TXABORT 0x07 -#define SCA_CMD_MPON 0x08 -#define SCA_CMD_TXBCLEAR 0x09 - -#define SCA_CMD_RXRESET 0x11 -#define SCA_CMD_RXENABLE 0x12 -#define SCA_CMD_RXDISABLE 0x13 -#define SCA_CMD_RXCRCINIT 0x14 -#define SCA_CMD_RXMSGREJ 0x15 -#define SCA_CMD_MPSEARCH 0x16 -#define SCA_CMD_RXCRCEXCL 0x17 -#define SCA_CMD_RXCRCCALC 0x18 - -#define SCA_CMD_NOP 0x00 -#define SCA_CMD_RESET 0x21 -#define SCA_CMD_SEARCH 0x31 - -#define SCA_MD0_CRC_1 0x01 -#define SCA_MD0_CRC_CCITT 0x02 -#define SCA_MD0_CRC_ENABLE 0x04 -#define SCA_MD0_AUTO_ENABLE 0x10 -#define SCA_MD0_MODE_ASYNC 0x00 -#define SCA_MD0_MODE_BYTESYNC1 0x20 -#define SCA_MD0_MODE_BISYNC 0x40 -#define SCA_MD0_MODE_BYTESYNC2 0x60 -#define SCA_MD0_MODE_HDLC 0x80 - -#define SCA_MD1_NOADDRCHK 0x00 -#define SCA_MD1_SNGLADDR1 0x40 -#define SCA_MD1_SNGLADDR2 0x80 -#define SCA_MD1_DUALADDR 0xC0 - -#define SCA_MD2_DUPLEX 0x00 -#define SCA_MD2_ECHO 0x01 -#define SCA_MD2_LOOPBACK 0x03 -#define SCA_MD2_ADPLLx8 0x00 -#define SCA_MD2_ADPLLx16 0x08 -#define SCA_MD2_ADPLLx32 0x10 -#define SCA_MD2_NRZ 0x00 -#define SCA_MD2_NRZI 0x20 -#define SCA_MD2_MANCHESTER 0x80 -#define SCA_MD2_FM0 0xC0 -#define SCA_MD2_FM1 0xA0 - -#define SCA_CTL_RTS 0x01 -#define SCA_CTL_IDLPAT 0x10 -#define SCA_CTL_UDRNC 0x20 - -#define SCA_RXS_DIV_MASK 0x0F -#define SCA_RXS_DIV1 0x00 -#define SCA_RXS_DIV2 0x01 -#define SCA_RXS_DIV4 0x02 -#define SCA_RXS_DIV8 0x03 -#define SCA_RXS_DIV16 0x04 -#define SCA_RXS_DIV32 0x05 -#define SCA_RXS_DIV64 0x06 -#define SCA_RXS_DIV128 0x07 -#define SCA_RXS_DIV256 0x08 -#define SCA_RXS_DIV512 0x09 -#define SCA_RXS_CLK_RXC0 0x00 -#define SCA_RXS_CLK_RXC1 0x20 -#define SCA_RXS_CLK_INT 0x40 -#define SCA_RXS_CLK_ADPLL_OUT 0x60 -#define SCA_RXS_CLK_ADPLL_IN 0x70 - -#define SCA_TXS_DIV_MASK 0x0F -#define SCA_TXS_DIV1 0x00 -#define SCA_TXS_DIV2 0x01 -#define SCA_TXS_DIV4 0x02 -#define SCA_TXS_DIV8 0x03 -#define SCA_TXS_DIV16 0x04 -#define SCA_TXS_DIV32 0x05 -#define SCA_TXS_DIV64 0x06 -#define SCA_TXS_DIV128 0x07 -#define SCA_TXS_DIV256 0x08 -#define SCA_TXS_DIV512 0x09 -#define SCA_TXS_CLK_TXC 0x00 -#define SCA_TXS_CLK_INT 0x40 -#define SCA_TXS_CLK_RX 0x60 - -#define SCA_ST0_RXRDY 0x01 -#define SCA_ST0_TXRDY 0x02 -#define SCA_ST0_RXINT 0x40 -#define SCA_ST0_TXINT 0x80 - -#define SCA_ST1_IDLST 0x01 -#define SCA_ST1_ABTST 0x02 -#define SCA_ST1_DCDCHG 0x04 -#define SCA_ST1_CTSCHG 0x08 -#define SCA_ST1_FLAG 0x10 -#define SCA_ST1_TXIDL 0x40 -#define SCA_ST1_UDRN 0x80 - -/* ST2 and FST look the same */ -#define SCA_FST_CRCERR 0x04 -#define SCA_FST_OVRN 0x08 -#define SCA_FST_RESFRM 0x10 -#define SCA_FST_ABRT 0x20 -#define SCA_FST_SHRT 0x40 -#define SCA_FST_EOM 0x80 - -#define SCA_ST3_RXENA 0x01 -#define SCA_ST3_TXENA 0x02 -#define SCA_ST3_DCD 0x04 -#define SCA_ST3_CTS 0x08 -#define SCA_ST3_ADPLLSRCH 0x10 -#define SCA_ST3_TXDATA 0x20 - -#define SCA_FIE_EOMFE 0x80 - -#define SCA_IE0_RXRDY 0x01 -#define SCA_IE0_TXRDY 0x02 -#define SCA_IE0_RXINT 0x40 -#define SCA_IE0_TXINT 0x80 - -#define SCA_IE1_IDLDE 0x01 -#define SCA_IE1_ABTDE 0x02 -#define SCA_IE1_DCD 0x04 -#define SCA_IE1_CTS 0x08 -#define SCA_IE1_FLAG 0x10 -#define SCA_IE1_IDL 0x40 -#define SCA_IE1_UDRN 0x80 - -#define SCA_IE2_CRCERR 0x04 -#define SCA_IE2_OVRN 0x08 -#define SCA_IE2_RESFRM 0x10 -#define SCA_IE2_ABRT 0x20 -#define SCA_IE2_SHRT 0x40 -#define SCA_IE2_EOM 0x80 - -/* This is for RRC, TRC0 and TRC1. */ -#define SCA_RCR_MASK 0x1F - -#define SCA_IE1_ - -#define SCA_IV_CHAN0 0x00 -#define SCA_IV_CHAN1 0x20 - -#define SCA_IV_RXRDY 0x04 -#define SCA_IV_TXRDY 0x06 -#define SCA_IV_RXINT 0x08 -#define SCA_IV_TXINT 0x0A - -#define SCA_IV_DMACH0 0x00 -#define SCA_IV_DMACH1 0x08 -#define SCA_IV_DMACH2 0x20 -#define SCA_IV_DMACH3 0x28 - -#define SCA_IV_DMIA 0x14 -#define SCA_IV_DMIB 0x16 - -#define SCA_IV_TIMER0 0x1C -#define SCA_IV_TIMER1 0x1E -#define SCA_IV_TIMER2 0x3C -#define SCA_IV_TIMER3 0x3E - -/* - * DMA registers - */ -#define SCA_DSR_EOT 0x80 -#define SCA_DSR_EOM 0x40 -#define SCA_DSR_BOF 0x20 -#define SCA_DSR_COF 0x10 -#define SCA_DSR_DE 0x02 -#define SCA_DSR_DWE 0x01 - -#define SCA_DMR_TMOD 0x10 -#define SCA_DMR_NF 0x04 -#define SCA_DMR_CNTE 0x02 - -#define SCA_DMER_EN 0x80 - -#define SCA_DCR_ABRT 0x01 -#define SCA_DCR_FCCLR 0x02 /* Clear frame end intr counter */ - -#define SCA_DIR_EOT 0x80 -#define SCA_DIR_EOM 0x40 -#define SCA_DIR_BOF 0x20 -#define SCA_DIR_COF 0x10 - -#define SCA_PCR_BRC 0x10 -#define SCA_PCR_CCC 0x08 -#define SCA_PCR_PR2 0x04 -#define SCA_PCR_PR1 0x02 -#define SCA_PCR_PR0 0x01 - -typedef struct sca_descriptor - { - unsigned short cp; - unsigned short bp; - unsigned char bpb; - unsigned char unused0; - unsigned short len; - unsigned char stat; - unsigned char unused1; - }sca_descriptor; - -#define SCA_DESC_EOT 0x01 -#define SCA_DESC_CRC 0x04 -#define SCA_DESC_OVRN 0x08 -#define SCA_DESC_RESD 0x10 -#define SCA_DESC_ABORT 0x20 -#define SCA_DESC_SHRTFRM 0x40 -#define SCA_DESC_EOM 0x80 -#define SCA_DESC_ERRORS 0x7C - -/* -*************************************************************************** -** END -*************************************************************************** -**/ -#endif /* _HD64570_H_ */ - diff --git a/sys/dev/rp/rpreg.h b/sys/dev/rp/rpreg.h deleted file mode 100644 index a7cde1b03a25..000000000000 --- a/sys/dev/rp/rpreg.h +++ /dev/null @@ -1,1015 +0,0 @@ -/* - * Copyright (c) Comtrol Corporation <support@comtrol.com> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted prodived that the follwoing conditions - * are met. - * 1. Redistributions of source code must retain the above copyright - * notive, this list of conditions and the following disclainer. - * 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 prodided 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 Comtrol Corporation. - * 4. The name of Comtrol Corporation may not be used to endorse or - * promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY COMTROL CORPORATION ``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 COMTROL CORPORATION 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, LIFE 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$ - */ - -/* - * Begin OS-specific defines - rpreg.h - for RocketPort FreeBSD - */ - -typedef unsigned char Byte_t; -typedef unsigned int ByteIO_t; - -typedef unsigned int Word_t; -typedef unsigned int WordIO_t; - -typedef unsigned long DWord_t; -typedef unsigned int DWordIO_t; - -#define rp_readio(size, ctlp, rid, offset) \ - (bus_space_read_##size(rman_get_bustag(ctlp->io[rid]), rman_get_bushandle(ctlp->io[rid]), offset)) -#define rp_readmultiio(size, ctlp, rid, offset, addr, count) \ - (bus_space_read_multi_##size(rman_get_bustag(ctlp->io[rid]), rman_get_bushandle(ctlp->io[rid]), offset, addr, count)) -#define rp_writeio(size, ctlp, rid, offset, data) \ - (bus_space_write_##size(rman_get_bustag(ctlp->io[rid]), rman_get_bushandle(ctlp->io[rid]), offset, data)) -#define rp_writemultiio(size, ctlp, rid, offset, addr, count) \ - (bus_space_write_multi_##size(rman_get_bustag(ctlp->io[rid]), rman_get_bushandle(ctlp->io[rid]), offset, addr, count)) - -#define rp_readio1(ctlp, rid, offset) rp_readio(1, ctlp, rid, offset) -#define rp_readio2(ctlp, rid, offset) rp_readio(2, ctlp, rid, offset) -#define rp_readio4(ctlp, rid, offset) rp_readio(4, ctlp, rid, offset) -#define rp_writeio1(ctlp, rid, offset, data) rp_writeio(1, ctlp, rid, offset, data) -#define rp_writeio2(ctlp, rid, offset, data) rp_writeio(2, ctlp, rid, offset, data) -#define rp_writeio4(ctlp, rid, offset, data) rp_writeio(4, ctlp, rid, offset, data) -#define rp_readmultiio1(ctlp, rid, offset, addr, count) rp_readmultiio(1, ctlp, rid, offset, addr, count) -#define rp_readmultiio2(ctlp, rid, offset, addr, count) rp_readmultiio(2, ctlp, rid, offset, addr, count) -#define rp_readmultiio4(ctlp, rid, offset, addr, count) rp_readmultiio(4, ctlp, rid, offset, addr, count) -#define rp_writemultiio1(ctlp, rid, offset, addr, count) rp_writemultiio(1, ctlp, rid, offset, addr, count) -#define rp_writemultiio2(ctlp, rid, offset, addr, count) rp_writemultiio(2, ctlp, rid, offset, addr, count) -#define rp_writemultiio4(ctlp, rid, offset, addr, count) rp_writemultiio(4, ctlp, rid, offset, addr, count) - -#define rp_readaiop1(ctlp, aiop, offset) \ - (rp_readio1((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset))) -#define rp_readaiop2(ctlp, aiop, offset) \ - (rp_readio2((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset))) -#define rp_readaiop4(ctlp, aiop, offset) \ - (rp_readio4((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset))) -#define rp_readmultiaiop1(ctlp, aiop, offset, addr, count) \ - (rp_readmultiio1((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset), addr, count)) -#define rp_readmultiaiop2(ctlp, aiop, offset, addr, count) \ - (rp_readmultiio2((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset), addr, count)) -#define rp_readmultiaiop4(ctlp, aiop, offset, addr, count) \ - (rp_readmultiio4((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset), addr, count)) -#define rp_writeaiop1(ctlp, aiop, offset, data) \ - (rp_writeio1((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset), data)) -#define rp_writeaiop2(ctlp, aiop, offset, data) \ - (rp_writeio2((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset), data)) -#define rp_writeaiop4(ctlp, aiop, offset, data) \ - (rp_writeio4((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset), data)) -#define rp_writemultiaiop1(ctlp, aiop, offset, addr, count) \ - (rp_writemultiio1((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset), addr, count)) -#define rp_writemultiaiop2(ctlp, aiop, offset, addr, count) \ - (rp_writemultiio2((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset), addr, count)) -#define rp_writemultiaiop4(ctlp, aiop, offset, addr, count) \ - (rp_writemultiio4((ctlp), (ctlp)->aiop2rid(aiop, offset), (ctlp)->aiop2off(aiop, offset), addr, count)) - -#define rp_readch1(chp, offset) \ - (rp_readaiop1((chp)->CtlP, (chp)->AiopNum, offset)) -#define rp_readch2(chp, offset) \ - (rp_readaiop2((chp)->CtlP, (chp)->AiopNum, offset)) -#define rp_readch4(chp, offset) \ - (rp_readaiop4((chp)->CtlP, (chp)->AiopNum, offset)) -#define rp_readmultich1(chp, offset, addr, count) \ - (rp_readmultiaiop1((chp)->CtlP, (chp)->AiopNum, offset, addr, count)) -#define rp_readmultich2(chp, offset, addr, count) \ - (rp_readmultiaiop2((chp)->CtlP, (chp)->AiopNum, offset, addr, count)) -#define rp_readmultich4(chp, offset, addr, count) \ - (rp_readmultiaiop4((chp)->CtlP, (chp)->AiopNum, offset, addr, count)) -#define rp_writech1(chp, offset, data) \ - (rp_writeaiop1((chp)->CtlP, (chp)->AiopNum, offset, data)) -#define rp_writech2(chp, offset, data) \ - (rp_writeaiop2((chp)->CtlP, (chp)->AiopNum, offset, data)) -#define rp_writech4(chp, offset, data) \ - (rp_writeaiop4((chp)->CtlP, (chp)->AiopNum, offset, data)) -#define rp_writemultich1(chp, offset, addr, count) \ - (rp_writemultiaiop1((chp)->CtlP, (chp)->AiopNum, offset, addr, count)) -#define rp_writemultich2(chp, offset, addr, count) \ - (rp_writemultiaiop2((chp)->CtlP, (chp)->AiopNum, offset, addr, count)) -#define rp_writemultich4(chp, offset, addr, count) \ - (rp_writemultiaiop4((chp)->CtlP, (chp)->AiopNum, offset, addr, count)) - -/* - * End of OS-specific defines - */ - -#define ROCKET_H - -#define CTL_SIZE 4 -#define AIOP_CTL_SIZE 4 -#define CHAN_AIOP_SIZE 8 -#define MAX_PORTS_PER_AIOP 8 -#define MAX_AIOPS_PER_BOARD 4 -#define MAX_PORTS_PER_BOARD 32 - -/* Controller ID numbers */ -#define CTLID_NULL -1 /* no controller exists */ -#define CTLID_0001 0x0001 /* controller release 1 */ - -/* AIOP ID numbers, identifies AIOP type implementing channel */ -#define AIOPID_NULL -1 /* no AIOP or channel exists */ -#define AIOPID_0001 0x0001 /* AIOP release 1 */ - -#define NULLDEV -1 /* identifies non-existant device */ -#define NULLCTL -1 /* identifies non-existant controller */ -#define NULLCTLPTR (CONTROLLER_T *)0 /* identifies non-existant controller */ -#define NULLAIOP -1 /* identifies non-existant AIOP */ -#define NULLCHAN -1 /* identifies non-existant channel */ - -/************************************************************************ - Global Register Offsets - Direct Access - Fixed values -************************************************************************/ - -#define _CMD_REG 0x38 /* Command Register 8 Write */ -#define _INT_CHAN 0x39 /* Interrupt Channel Register 8 Read */ -#define _INT_MASK 0x3A /* Interrupt Mask Register 8 Read / Write */ -#define _UNUSED 0x3B /* Unused 8 */ -#define _INDX_ADDR 0x3C /* Index Register Address 16 Write */ -#define _INDX_DATA 0x3E /* Index Register Data 8/16 Read / Write */ - -/************************************************************************ - Channel Register Offsets for 1st channel in AIOP - Direct Access -************************************************************************/ -#define _TD0 0x00 /* Transmit Data 16 Write */ -#define _RD0 0x00 /* Receive Data 16 Read */ -#define _CHN_STAT0 0x20 /* Channel Status 8/16 Read / Write */ -#define _FIFO_CNT0 0x10 /* Transmit/Receive FIFO Count 16 Read */ -#define _INT_ID0 0x30 /* Interrupt Identification 8 Read */ - -/************************************************************************ - Tx Control Register Offsets - Indexed - External - Fixed -************************************************************************/ -#define _TX_ENBLS 0x980 /* Tx Processor Enables Register 8 Read / Write */ -#define _TXCMP1 0x988 /* Transmit Compare Value #1 8 Read / Write */ -#define _TXCMP2 0x989 /* Transmit Compare Value #2 8 Read / Write */ -#define _TXREP1B1 0x98A /* Tx Replace Value #1 - Byte 1 8 Read / Write */ -#define _TXREP1B2 0x98B /* Tx Replace Value #1 - Byte 2 8 Read / Write */ -#define _TXREP2 0x98C /* Transmit Replace Value #2 8 Read / Write */ - -/************************************************************************ - Receive FIFO -************************************************************************/ -#define RXFIFO_DATA 0x5f -#define RXFIFO_OUT 0x5c -#define RXFIFO_EN 0x08 -#define RXFIFO_DIS 0xa7 - -/************************************************************************ -Memory Controller Register Offsets - Indexed - External - Fixed -************************************************************************/ -#define _RX_FIFO 0x000 /* Rx FIFO */ -#define _TX_FIFO 0x800 /* Tx FIFO */ -#define _RXF_OUTP 0x990 /* Rx FIFO OUT pointer 16 Read / Write */ -#define _RXF_INP 0x992 /* Rx FIFO IN pointer 16 Read / Write */ -#define _TXF_OUTP 0x994 /* Tx FIFO OUT pointer 8 Read / Write */ -#define _TXF_INP 0x995 /* Tx FIFO IN pointer 8 Read / Write */ -#define _TXP_CNT 0x996 /* Tx Priority Count 8 Read / Write */ -#define _TXP_PNTR 0x997 /* Tx Priority Pointer 8 Read / Write */ - -#define PRI_PEND 0x80 /* Priority data pending (bit7, Tx pri cnt) */ -#define TXFIFO_SIZE 255 /* size of Tx FIFO */ -#define RXFIFO_SIZE 1023 /* size of Rx FIFO */ - -/************************************************************************ -Tx Priority Buffer - Indexed - External - Fixed -************************************************************************/ -#define _TXP_BUF 0x9C0 /* Tx Priority Buffer 32 Bytes Read / Write */ -#define TXP_SIZE 0x20 /* 32 bytes */ - -/************************************************************************ -Channel Register Offsets - Indexed - Internal - Fixed -************************************************************************/ - -#define _TX_CTRL 0xFF0 /* Transmit Control 16 Write */ -#define _RX_CTRL 0xFF2 /* Receive Control 8 Write */ -#define _BAUD 0xFF4 /* Baud Rate 16 Write */ -#define _CLK_PRE 0xFF6 /* Clock Prescaler 8 Write */ - -#define CLOCK_PRESC 0x19 /* mod 9 (divide by 10) prescale */ - -#define BRD50 4607 -#define BRD75 3071 -#define BRD110 2094 -#define BRD134 1712 -#define BRD150 1535 -#define BRD200 1151 -#define BRD300 767 -#define BRD600 383 -#define BRD1200 191 -#define BRD1800 127 -#define BRD2000 114 -#define BRD2400 95 -#define BRD3600 64 -#define BRD4800 47 -#define BRD7200 31 -#define BRD9600 23 -#define BRD14400 15 -#define BRD19200 11 -#define BRD38400 5 -#define BRD57600 3 -#define BRD76800 2 -#define BRD115200 1 -#define BRD230400 0 - -#define STMBREAK 0x08 /* BREAK */ -#define STMFRAME 0x04 /* framing error */ -#define STMRCVROVR 0x02 /* receiver over run error */ -#define STMPARITY 0x01 /* parity error */ -#define STMERROR (STMBREAK | STMFRAME | STMPARITY) -#define STMBREAKH 0x800 /* BREAK */ -#define STMFRAMEH 0x400 /* framing error */ -#define STMRCVROVRH 0x200 /* receiver over run error */ -#define STMPARITYH 0x100 /* parity error */ -#define STMERRORH (STMBREAKH | STMFRAMEH | STMPARITYH) - -#define CTS_ACT 0x20 /* CTS input asserted */ -#define DSR_ACT 0x10 /* DSR input asserted */ -#define CD_ACT 0x08 /* CD input asserted */ -#define TXFIFOMT 0x04 /* Tx FIFO is empty */ -#define TXSHRMT 0x02 /* Tx shift register is empty */ -#define RDA 0x01 /* Rx data available */ -#define DRAINED (TXFIFOMT | TXSHRMT) /* indicates Tx is drained */ - -#define STATMODE 0x8000 /* status mode enable bit */ -#define RXFOVERFL 0x2000 /* receive FIFO overflow */ -#define RX2MATCH 0x1000 /* receive compare byte 2 match */ -#define RX1MATCH 0x0800 /* receive compare byte 1 match */ -#define RXBREAK 0x0400 /* received BREAK */ -#define RXFRAME 0x0200 /* received framing error */ -#define RXPARITY 0x0100 /* received parity error */ -#define STATERROR (RXBREAK | RXFRAME | RXPARITY) - -#define CTSFC_EN 0x80 /* CTS flow control enable bit */ -#define RTSTOG_EN 0x40 /* RTS toggle enable bit */ -#define TXINT_EN 0x10 /* transmit interrupt enable */ -#define STOP2 0x08 /* enable 2 stop bits (0 = 1 stop) */ -#define PARITY_EN 0x04 /* enable parity (0 = no parity) */ -#define EVEN_PAR 0x02 /* even parity (0 = odd parity) */ -#define DATA8BIT 0x01 /* 8 bit data (0 = 7 bit data) */ - -#define SETBREAK 0x10 /* send break condition (must clear) */ -#define LOCALLOOP 0x08 /* local loopback set for test */ -#define SET_DTR 0x04 /* assert DTR */ -#define SET_RTS 0x02 /* assert RTS */ -#define TX_ENABLE 0x01 /* enable transmitter */ - -#define RTSFC_EN 0x40 /* RTS flow control enable */ -#define RXPROC_EN 0x20 /* receive processor enable */ -#define TRIG_NO 0x00 /* Rx FIFO trigger level 0 (no trigger) */ -#define TRIG_1 0x08 /* trigger level 1 char */ -#define TRIG_1_2 0x10 /* trigger level 1/2 */ -#define TRIG_7_8 0x18 /* trigger level 7/8 */ -#define TRIG_MASK 0x18 /* trigger level mask */ -#define SRCINT_EN 0x04 /* special Rx condition interrupt enable */ -#define RXINT_EN 0x02 /* Rx interrupt enable */ -#define MCINT_EN 0x01 /* modem change interrupt enable */ - -#define RXF_TRIG 0x20 /* Rx FIFO trigger level interrupt */ -#define TXFIFO_MT 0x10 /* Tx FIFO empty interrupt */ -#define SRC_INT 0x08 /* special receive condition interrupt */ -#define DELTA_CD 0x04 /* CD change interrupt */ -#define DELTA_CTS 0x02 /* CTS change interrupt */ -#define DELTA_DSR 0x01 /* DSR change interrupt */ - -#define REP1W2_EN 0x10 /* replace byte 1 with 2 bytes enable */ -#define IGN2_EN 0x08 /* ignore byte 2 enable */ -#define IGN1_EN 0x04 /* ignore byte 1 enable */ -#define COMP2_EN 0x02 /* compare byte 2 enable */ -#define COMP1_EN 0x01 /* compare byte 1 enable */ - -#define RESET_ALL 0x80 /* reset AIOP (all channels) */ -#define TXOVERIDE 0x40 /* Transmit software off override */ -#define RESETUART 0x20 /* reset channel's UART */ -#define RESTXFCNT 0x10 /* reset channel's Tx FIFO count register */ -#define RESRXFCNT 0x08 /* reset channel's Rx FIFO count register */ - -#define INTSTAT0 0x01 /* AIOP 0 interrupt status */ -#define INTSTAT1 0x02 /* AIOP 1 interrupt status */ -#define INTSTAT2 0x04 /* AIOP 2 interrupt status */ -#define INTSTAT3 0x08 /* AIOP 3 interrupt status */ - -#define INTR_EN 0x08 /* allow interrupts to host */ -#define INT_STROB 0x04 /* strobe and clear interrupt line (EOI) */ - -#define CHAN3_EN 0x08 /* enable AIOP 3 */ -#define CHAN2_EN 0x04 /* enable AIOP 2 */ -#define CHAN1_EN 0x02 /* enable AIOP 1 */ -#define CHAN0_EN 0x01 /* enable AIOP 0 */ -#define FREQ_DIS 0x00 -#define FREQ_274HZ 0x60 -#define FREQ_137HZ 0x50 -#define FREQ_69HZ 0x40 -#define FREQ_34HZ 0x30 -#define FREQ_17HZ 0x20 -#define FREQ_9HZ 0x10 -#define PERIODIC_ONLY 0x80 /* only PERIODIC interrupt */ - -#define CHANINT_EN 0x0100 /* flags to enable/disable channel ints */ - -#define RDATASIZE 72 -#define RREGDATASIZE 52 - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -struct CONTROLLER_str; -struct CHANNEL_str; - -/* The types of bus-specific methods */ -typedef int rp_aiop2rid_t(int, int); -typedef int rp_aiop2off_t(int, int); -typedef unsigned char rp_ctlmask_t(struct CONTROLLER_str *); - -/* Controller level information structure */ -struct CONTROLLER_str -{ - int CtlID; - int NumAiop; - int AiopID[AIOP_CTL_SIZE]; - int AiopNumChan[AIOP_CTL_SIZE]; - - /* Device and resource management */ - device_t dev; /* device */ - int io_num; /* Number of IO resources */ - int *io_rid; /* IO resource IDs */ - struct resource **io; /* IO resources */ - - struct rp_port *rp; /* port */ - struct tty *tty; /* tty */ - - /* Device nodes */ - dev_t *dev_nodes; - - /* Bus-specific properties */ - void *bus_ctlp; - - /* Bus-specific methods */ - rp_aiop2rid_t *aiop2rid; /* (aiop, offset) -> rid */ - rp_aiop2off_t *aiop2off; /* (aiop, offset) -> off */ - rp_ctlmask_t *ctlmask; /* Int status */ -}; -typedef struct CONTROLLER_str CONTROLLER_T; -typedef CONTROLLER_T CONTROLLER_t; - -/* Channel level information structure */ -struct CHANNEL_str -{ - CONTROLLER_t *CtlP; - int AiopNum; - int ChanID; - int ChanNum; - - Word_t TxFIFO; - Word_t TxFIFOPtrs; - Word_t RxFIFO; - Word_t RxFIFOPtrs; - Word_t TxPrioCnt; - Word_t TxPrioPtr; - Word_t TxPrioBuf; - - Byte_t R[RREGDATASIZE]; - - Byte_t BaudDiv[4]; - Byte_t TxControl[4]; - Byte_t RxControl[4]; - Byte_t TxEnables[4]; - Byte_t TxCompare[4]; - Byte_t TxReplace1[4]; - Byte_t TxReplace2[4]; -}; - -typedef struct CHANNEL_str CHANNEL_T; -typedef CHANNEL_T CHANNEL_t; -typedef CHANNEL_T * CHANPTR_T; - -#define CHNOFF_TXRXDATA(chp) ((chp)->ChanNum * 2 + _TD0) -#define CHNOFF_CHANSTAT(chp) ((chp)->ChanNum * 2 + _CHN_STAT0) -#define CHNOFF_TXRXCOUNT(chp) ((chp)->ChanNum * 2 + _FIFO_CNT0) -#define CHNOFF_INTID(chp) ((chp)->ChanNum + _INT_ID0) - -/*************************************************************************** -Function: sClrBreak -Purpose: Stop sending a transmit BREAK signal -Call: sClrBreak(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sClrBreak(ChP) \ -{ \ - (ChP)->TxControl[3] &= ~SETBREAK; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sClrDTR -Purpose: Clr the DTR output -Call: sClrDTR(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sClrDTR(ChP) \ -{ \ - (ChP)->TxControl[3] &= ~SET_DTR; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sClrRTS -Purpose: Clr the RTS output -Call: sClrRTS(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sClrRTS(ChP) \ -{ \ - (ChP)->TxControl[3] &= ~SET_RTS; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sClrTxXOFF -Purpose: Clear any existing transmit software flow control off condition -Call: sClrTxXOFF(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sClrTxXOFF(ChP) \ -{ \ - rp_writech1(ChP,_CMD_REG,TXOVERIDE | (Byte_t)(ChP)->ChanNum); \ - rp_writech1(ChP,_CMD_REG,(Byte_t)(ChP)->ChanNum); \ -} - -/*************************************************************************** -Function: sDisCTSFlowCtl -Purpose: Disable output flow control using CTS -Call: sDisCTSFlowCtl(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sDisCTSFlowCtl(ChP) \ -{ \ - (ChP)->TxControl[2] &= ~CTSFC_EN; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: DisParity -Purpose: Disable parity -Call: sDisParity(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Comments: Function sSetParity() can be used in place of functions sEnParity(), - sDisParity(), sSetOddParity(), and sSetEvenParity(). -*/ -#define sDisParity(ChP) \ -{ \ - (ChP)->TxControl[2] &= ~PARITY_EN; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sDisRxFIFO -Purpose: Disable Rx FIFO -Call: sDisRxFIFO(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sDisRxFIFO(ChP) \ -{ \ - (ChP)->R[0x32] = 0x0a; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->R[0x30]); \ -} - -/*************************************************************************** -Function: sDisRxStatusMode -Purpose: Disable the Rx status mode -Call: sDisRxStatusMode(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Comments: This takes the channel out of the receive status mode. All - subsequent reads of receive data using sReadRxWord() will return - two data bytes. -*/ -#define sDisRxStatusMode(ChP) rp_writech2(ChP,CHNOFF_CHANSTAT(ChP),0) - -/*************************************************************************** -Function: sDisTransmit -Purpose: Disable transmit -Call: sDisTransmit(ChP) - CHANNEL_T *ChP; Ptr to channel structure - This disables movement of Tx data from the Tx FIFO into the 1 byte - Tx buffer. Therefore there could be up to a 2 byte latency - between the time sDisTransmit() is called and the transmit buffer - and transmit shift register going completely empty. -*/ -#define sDisTransmit(ChP) \ -{ \ - (ChP)->TxControl[3] &= ~TX_ENABLE; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sDisTxSoftFlowCtl -Purpose: Disable Tx Software Flow Control -Call: sDisTxSoftFlowCtl(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sDisTxSoftFlowCtl(ChP) \ -{ \ - (ChP)->R[0x06] = 0x8a; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->R[0x04]); \ -} - -/*************************************************************************** -Function: sEnCTSFlowCtl -Purpose: Enable output flow control using CTS -Call: sEnCTSFlowCtl(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sEnCTSFlowCtl(ChP) \ -{ \ - (ChP)->TxControl[2] |= CTSFC_EN; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: EnParity -Purpose: Enable parity -Call: sEnParity(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Comments: Function sSetParity() can be used in place of functions sEnParity(), - sDisParity(), sSetOddParity(), and sSetEvenParity(). - -Warnings: Before enabling parity odd or even parity should be chosen using - functions sSetOddParity() or sSetEvenParity(). -*/ -#define sEnParity(ChP) \ -{ \ - (ChP)->TxControl[2] |= PARITY_EN; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sEnRTSFlowCtl -Return: void -*/ -#define sEnRTSFlowCtl(ChP) \ -{ \ - (ChP)->TxControl[2] &= ~RTSTOG_EN; \ - (ChP)->TxControl[3] &= ~SET_RTS; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ - (ChP)->RxControl[2] |= RTSFC_EN; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->RxControl[0]); \ -} - -/*************************************************************************** -Function: sDisRTSFlowCtl -Return: void -*/ -#define sDisRTSFlowCtl(ChP) \ -{ \ - (ChP)->RxControl[2] &= ~RTSFC_EN; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->RxControl[0]); \ -} - -/*************************************************************************** -Function: sEnRxFIFO -Purpose: Enable Rx FIFO -Call: sEnRxFIFO(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sEnRxFIFO(ChP) \ -{ \ - (ChP)->R[0x32] = 0x08; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->R[0x30]); \ -} - -/*************************************************************************** -Function: sEnRxProcessor -Purpose: Enable the receive processor -Call: sEnRxProcessor(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Comments: This function is used to start the receive processor. When - the channel is in the reset state the receive processor is not - running. This is done to prevent the receive processor from - executing invalid microcode instructions prior to the - downloading of the microcode. - -Warnings: This function must be called after valid microcode has been - downloaded to the AIOP, and it must not be called before the - microcode has been downloaded. -*/ -#define sEnRxProcessor(ChP) \ -{ \ - (ChP)->RxControl[2] |= RXPROC_EN; \ - rp_writech2(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->RxControl[0]); \ -} - -/*************************************************************************** -Function: sEnRxStatusMode -Purpose: Enable the Rx status mode -Call: sEnRxStatusMode(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Comments: This places the channel in the receive status mode. All subsequent - reads of receive data using sReadRxWord() will return a data byte - in the low word and a status byte in the high word. - -*/ -#define sEnRxStatusMode(ChP) rp_writech2(ChP,CHNOFF_CHANSTAT(ChP),STATMODE) - -/*************************************************************************** -Function: sEnTransmit -Purpose: Enable transmit -Call: sEnTransmit(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sEnTransmit(ChP) \ -{ \ - (ChP)->TxControl[3] |= TX_ENABLE; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sGetAiopIntStatus -Purpose: Get the AIOP interrupt status -Call: sGetAiopIntStatus(CtlP,AiopNum) - CONTROLLER_T *CtlP; Ptr to controller structure - int AiopNum; AIOP number -Return: Byte_t: The AIOP interrupt status. Bits 0 through 7 - represent channels 0 through 7 respectively. If a - bit is set that channel is interrupting. -*/ -#define sGetAiopIntStatus(CtlP,AIOPNUM) rp_readaiop1(CtlP,AIOPNUM,_INT_CHAN) - -/*************************************************************************** -Function: sGetAiopNumChan -Purpose: Get the number of channels supported by an AIOP -Call: sGetAiopNumChan(CtlP,AiopNum) - CONTROLLER_T *CtlP; Ptr to controller structure - int AiopNum; AIOP number -Return: int: The number of channels supported by the AIOP -*/ -#define sGetAiopNumChan(CtlP,AIOPNUM) CtlP->AiopNumChan[AIOPNUM] - -/*************************************************************************** -Function: sGetChanIntID -Purpose: Get a channel's interrupt identification byte -Call: sGetChanIntID(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Return: Byte_t: The channel interrupt ID. Can be any - combination of the following flags: - RXF_TRIG: Rx FIFO trigger level interrupt - TXFIFO_MT: Tx FIFO empty interrupt - SRC_INT: Special receive condition interrupt - DELTA_CD: CD change interrupt - DELTA_CTS: CTS change interrupt - DELTA_DSR: DSR change interrupt -*/ -#define sGetChanIntID(ChP) (rp_readch1(ChP,(ChP)->ChanNum+_INT_ID0) & (RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR)) - -/*************************************************************************** -Function: sGetChanNum -Purpose: Get the number of a channel within an AIOP -Call: sGetChanNum(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Return: int: Channel number within AIOP, or NULLCHAN if channel does - not exist. -*/ -#define sGetChanNum(ChP) (ChP)->ChanNum - -/*************************************************************************** -Function: sGetChanStatus -Purpose: Get the channel status -Call: sGetChanStatus(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Return: Word_t: The channel status. Can be any combination of - the following flags: - LOW BYTE FLAGS - CTS_ACT: CTS input asserted - DSR_ACT: DSR input asserted - CD_ACT: CD input asserted - TXFIFOMT: Tx FIFO is empty - TXSHRMT: Tx shift register is empty - RDA: Rx data available - - HIGH BYTE FLAGS - STATMODE: status mode enable bit - RXFOVERFL: receive FIFO overflow - RX2MATCH: receive compare byte 2 match - RX1MATCH: receive compare byte 1 match - RXBREAK: received BREAK - RXFRAME: received framing error - RXPARITY: received parity error -Warnings: This function will clear the high byte flags in the Channel - Status Register. -*/ -#define sGetChanStatus(ChP) rp_readch2(ChP,CHNOFF_CHANSTAT(ChP)) - -/*************************************************************************** -Function: sGetChanStatusLo -Purpose: Get the low byte only of the channel status -Call: sGetChanStatusLo(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Return: Byte_t: The channel status low byte. Can be any combination - of the following flags: - CTS_ACT: CTS input asserted - DSR_ACT: DSR input asserted - CD_ACT: CD input asserted - TXFIFOMT: Tx FIFO is empty - TXSHRMT: Tx shift register is empty - RDA: Rx data available -*/ -#define sGetChanStatusLo(ChP) rp_readch1(ChP,CHNOFF_CHANSTAT(ChP)) - -/*************************************************************************** -Function: sGetRxCnt -Purpose: Get the number of data bytes in the Rx FIFO -Call: sGetRxCnt(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Return: int: The number of data bytes in the Rx FIFO. -Comments: Byte read of count register is required to obtain Rx count. - -*/ -#define sGetRxCnt(ChP) rp_readch2(ChP,CHNOFF_TXRXCOUNT(ChP)) - -/*************************************************************************** -Function: sGetTxCnt -Purpose: Get the number of data bytes in the Tx FIFO -Call: sGetTxCnt(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Return: Byte_t: The number of data bytes in the Tx FIFO. -Comments: Byte read of count register is required to obtain Tx count. - -*/ -#define sGetTxCnt(ChP) rp_readch1(ChP,CHNOFF_TXRXCOUNT(ChP)) - -/***************************************************************************** -Function: sGetTxRxDataIO -Purpose: Get the offset of a channel's TxRx Data register -Call: sGetTxRxDataIO(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Return: WordIO_t: offset of a channel's TxRx Data register -*/ -#define sGetTxRxDataIO(ChP) CHNOFF_TXRXDATA(ChP) - -/*************************************************************************** -Function: sInitChanDefaults -Purpose: Initialize a channel structure to its default state. -Call: sInitChanDefaults(ChP) - CHANNEL_T *ChP; Ptr to the channel structure -Comments: This function must be called once for every channel structure - that exists before any other SSCI calls can be made. - -*/ -#define sInitChanDefaults(ChP) \ -{ \ - (ChP)->CtlP = NULLCTLPTR; \ - (ChP)->AiopNum = NULLAIOP; \ - (ChP)->ChanID = AIOPID_NULL; \ - (ChP)->ChanNum = NULLCHAN; \ -} - -/*************************************************************************** -Function: sResetAiopByNum -Purpose: Reset the AIOP by number -Call: sResetAiopByNum(CTLP,AIOPNUM) - CONTROLLER_T CTLP; Ptr to controller structure - AIOPNUM; AIOP index -*/ -#define sResetAiopByNum(CTLP,AIOPNUM) \ -{ \ - rp_writeaiop1(CTLP,AIOPNUM,_CMD_REG,RESET_ALL); \ - rp_writeaiop1(CTLP,AIOPNUM,_CMD_REG,0x0); \ -} - -/*************************************************************************** -Function: sSendBreak -Purpose: Send a transmit BREAK signal -Call: sSendBreak(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sSendBreak(ChP) \ -{ \ - (ChP)->TxControl[3] |= SETBREAK; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sSetBaud -Purpose: Set baud rate -Call: sSetBaud(ChP,Divisor) - CHANNEL_T *ChP; Ptr to channel structure - Word_t Divisor; 16 bit baud rate divisor for channel -*/ -#define sSetBaud(ChP,DIVISOR) \ -{ \ - (ChP)->BaudDiv[2] = (Byte_t)(DIVISOR); \ - (ChP)->BaudDiv[3] = (Byte_t)((DIVISOR) >> 8); \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->BaudDiv[0]); \ -} - -/*************************************************************************** -Function: sSetData7 -Purpose: Set data bits to 7 -Call: sSetData7(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sSetData7(ChP) \ -{ \ - (ChP)->TxControl[2] &= ~DATA8BIT; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sSetData8 -Purpose: Set data bits to 8 -Call: sSetData8(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sSetData8(ChP) \ -{ \ - (ChP)->TxControl[2] |= DATA8BIT; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sSetDTR -Purpose: Set the DTR output -Call: sSetDTR(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sSetDTR(ChP) \ -{ \ - (ChP)->TxControl[3] |= SET_DTR; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sSetEvenParity -Purpose: Set even parity -Call: sSetEvenParity(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Comments: Function sSetParity() can be used in place of functions sEnParity(), - sDisParity(), sSetOddParity(), and sSetEvenParity(). - -Warnings: This function has no effect unless parity is enabled with function - sEnParity(). -*/ -#define sSetEvenParity(ChP) \ -{ \ - (ChP)->TxControl[2] |= EVEN_PAR; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sSetOddParity -Purpose: Set odd parity -Call: sSetOddParity(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Comments: Function sSetParity() can be used in place of functions sEnParity(), - sDisParity(), sSetOddParity(), and sSetEvenParity(). - -Warnings: This function has no effect unless parity is enabled with function - sEnParity(). -*/ -#define sSetOddParity(ChP) \ -{ \ - (ChP)->TxControl[2] &= ~EVEN_PAR; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sSetRTS -Purpose: Set the RTS output -Call: sSetRTS(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sSetRTS(ChP) \ -{ \ - (ChP)->TxControl[3] |= SET_RTS; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sSetRxTrigger -Purpose: Set the Rx FIFO trigger level -Call: sSetRxProcessor(ChP,Level) - CHANNEL_T *ChP; Ptr to channel structure - Byte_t Level; Number of characters in Rx FIFO at which the - interrupt will be generated. Can be any of the following flags: - - TRIG_NO: no trigger - TRIG_1: 1 character in FIFO - TRIG_1_2: FIFO 1/2 full - TRIG_7_8: FIFO 7/8 full -Comments: An interrupt will be generated when the trigger level is reached - only if function sEnInterrupt() has been called with flag - RXINT_EN set. The RXF_TRIG flag in the Interrupt Idenfification - register will be set whenever the trigger level is reached - regardless of the setting of RXINT_EN. - -*/ -#define sSetRxTrigger(ChP,LEVEL) \ -{ \ - (ChP)->RxControl[2] &= ~TRIG_MASK; \ - (ChP)->RxControl[2] |= LEVEL; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->RxControl[0]); \ -} - -/*************************************************************************** -Function: sSetStop1 -Purpose: Set stop bits to 1 -Call: sSetStop1(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sSetStop1(ChP) \ -{ \ - (ChP)->TxControl[2] &= ~STOP2; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sSetStop2 -Purpose: Set stop bits to 2 -Call: sSetStop2(ChP) - CHANNEL_T *ChP; Ptr to channel structure -*/ -#define sSetStop2(ChP) \ -{ \ - (ChP)->TxControl[2] |= STOP2; \ - rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->TxControl[0]); \ -} - -/*************************************************************************** -Function: sStartRxProcessor -Purpose: Start a channel's receive processor -Call: sStartRxProcessor(ChP) - CHANNEL_T *ChP; Ptr to channel structure -Comments: This function is used to start a Rx processor after it was - stopped with sStopRxProcessor() or sStopSWInFlowCtl(). It - will restart both the Rx processor and software input flow control. - -*/ -#define sStartRxProcessor(ChP) rp_writech4(ChP,_INDX_ADDR,*(DWord_t *)&(ChP)->R[0]) - -/*************************************************************************** -Function: sWriteTxByte -Purpose: Write a transmit data byte to a channel. - CHANNEL_T *ChP; Ptr to channel structure - ByteIO_t io: Channel transmit register I/O address. This can - be obtained with sGetTxRxDataIO(). - Byte_t Data; The transmit data byte. -Warnings: This function writes the data byte without checking to see if - sMaxTxSize is exceeded in the Tx FIFO. -*/ -#define sWriteTxByte(ChP,IO,DATA) rp_writech1(ChP,IO,DATA) - -int sReadAiopID(CONTROLLER_T *CtlP, int aiop); -int sReadAiopNumChan(CONTROLLER_T *CtlP, int aiop); -int sInitChan( CONTROLLER_T *CtlP, - CHANNEL_T *ChP, - int AiopNum, - int ChanNum); -Byte_t sGetRxErrStatus(CHANNEL_T *ChP); -void sStopRxProcessor(CHANNEL_T *ChP); -void sStopSWInFlowCtl(CHANNEL_T *ChP); -void sFlushRxFIFO(CHANNEL_T *ChP); -void sFlushTxFIFO(CHANNEL_T *ChP); -int sWriteTxPrioByte(CHANNEL_T *ChP, Byte_t Data); -void sEnInterrupts(CHANNEL_T *ChP,Word_t Flags); -void sDisInterrupts(CHANNEL_T *ChP,Word_t Flags); -int rp_attachcommon(CONTROLLER_T *ctlp, int num_aiops, int num_ports); -void rp_releaseresource(CONTROLLER_t *ctlp); - -#ifndef ROCKET_C -extern Byte_t R[RDATASIZE]; -extern CONTROLLER_T sController[CTL_SIZE]; -extern Byte_t sIRQMap[16]; -#endif -extern Byte_t rp_sBitMapClrTbl[8]; -extern Byte_t rp_sBitMapSetTbl[8]; diff --git a/sys/dev/usb/rio500_usb.h b/sys/dev/usb/rio500_usb.h deleted file mode 100644 index c2da72e91b11..000000000000 --- a/sys/dev/usb/rio500_usb.h +++ /dev/null @@ -1,58 +0,0 @@ -/* ---------------------------------------------------------------------- - - Copyright (C) 2000 Cesar Miquel (miquel@df.uba.ar) - - Redistribution and use in source and binary forms, with or without - modification, are permitted under any licence of your choise which - meets the open source licence definiton - http://www.opensource.org/opd.html such as the GNU licence or the - BSD licence. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License or the BSD license for more details. - - ---------------------------------------------------------------------- - - Modified for FreeBSD by Iwasa Kazmi <kzmi@ca2.so-net.ne.jp> - - ---------------------------------------------------------------------- */ - -/* $FreeBSD$ */ - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -#include <sys/ioccom.h> -#ifndef USB_VENDOR_DIAMOND -#define USB_VENDOR_DIAMOND 0x841 -#endif -#ifndef USB_PRODUCT_DIAMOND_RIO500USB -#define USB_PRODUCT_DIAMOND_RIO500USB 0x1 -#endif -#endif - -struct RioCommand -{ -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) - u_int16_t length; -#else - short length; -#endif - int request; - int requesttype; - int value; - int index; - void *buffer; - int timeout; -}; - -#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -#define RIO_SEND_COMMAND _IOWR('U', 200, struct RioCommand) -#define RIO_RECV_COMMAND _IOWR('U', 201, struct RioCommand) -#else -#define RIO_SEND_COMMAND 0x1 -#define RIO_RECV_COMMAND 0x2 -#endif - -#define RIO_DIR_OUT 0x0 -#define RIO_DIR_IN 0x1 diff --git a/sys/kern/kern_accf.c b/sys/kern/kern_accf.c deleted file mode 100644 index e6b7d612cc92..000000000000 --- a/sys/kern/kern_accf.c +++ /dev/null @@ -1,142 +0,0 @@ -/*- - * Copyright (c) 2000 Alfred Perlstein <alfred@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 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$ - */ - -#define ACCEPT_FILTER_MOD - -#include "opt_param.h" -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/domain.h> -#include <sys/kernel.h> -#include <sys/proc.h> -#include <sys/malloc.h> -#include <sys/mbuf.h> -#include <sys/protosw.h> -#include <sys/socket.h> -#include <sys/socketvar.h> -#include <sys/queue.h> - -static SLIST_HEAD(, accept_filter) accept_filtlsthd = - SLIST_HEAD_INITIALIZER(&accept_filtlsthd); - -MALLOC_DEFINE(M_ACCF, "accf", "accept filter data"); - -/* - * must be passed a malloc'd structure so we don't explode if the kld - * is unloaded, we leak the struct on deallocation to deal with this, - * but if a filter is loaded with the same name as a leaked one we re-use - * the entry. - */ -int -accept_filt_add(struct accept_filter *filt) -{ - struct accept_filter *p; - - SLIST_FOREACH(p, &accept_filtlsthd, accf_next) - if (strcmp(p->accf_name, filt->accf_name) == 0) { - if (p->accf_callback != NULL) { - return (EEXIST); - } else { - p->accf_callback = filt->accf_callback; - FREE(filt, M_ACCF); - return (0); - } - } - - if (p == NULL) - SLIST_INSERT_HEAD(&accept_filtlsthd, filt, accf_next); - return (0); -} - -int -accept_filt_del(char *name) -{ - struct accept_filter *p; - - p = accept_filt_get(name); - if (p == NULL) - return (ENOENT); - - p->accf_callback = NULL; - return (0); -} - -struct accept_filter * -accept_filt_get(char *name) -{ - struct accept_filter *p; - - SLIST_FOREACH(p, &accept_filtlsthd, accf_next) - if (strcmp(p->accf_name, name) == 0) - return (p); - - return (NULL); -} - -int -accept_filt_generic_mod_event(module_t mod, int event, void *data) -{ - struct accept_filter *p; - struct accept_filter *accfp = (struct accept_filter *) data; - int s, error; - - switch (event) { - case MOD_LOAD: - MALLOC(p, struct accept_filter *, sizeof(*p), M_ACCF, M_WAITOK); - bcopy(accfp, p, sizeof(*p)); - s = splnet(); - error = accept_filt_add(p); - splx(s); - break; - - case MOD_UNLOAD: - /* - * Do not support unloading yet. we don't keep track of refcounts - * and unloading an accept filter callback and then having it called - * is a bad thing. A simple fix would be to track the refcount - * in the struct accept_filter. - */ -#if 0 - s = splnet(); - error = accept_filt_del(accfp->accf_name); - splx(s); -#endif - error = EOPNOTSUPP; - break; - - case MOD_SHUTDOWN: - error = 0; - break; - - default: - error = EOPNOTSUPP; - break; - } - - return (error); -} diff --git a/sys/kern/uipc_accf.c b/sys/kern/uipc_accf.c deleted file mode 100644 index e6b7d612cc92..000000000000 --- a/sys/kern/uipc_accf.c +++ /dev/null @@ -1,142 +0,0 @@ -/*- - * Copyright (c) 2000 Alfred Perlstein <alfred@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 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$ - */ - -#define ACCEPT_FILTER_MOD - -#include "opt_param.h" -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/domain.h> -#include <sys/kernel.h> -#include <sys/proc.h> -#include <sys/malloc.h> -#include <sys/mbuf.h> -#include <sys/protosw.h> -#include <sys/socket.h> -#include <sys/socketvar.h> -#include <sys/queue.h> - -static SLIST_HEAD(, accept_filter) accept_filtlsthd = - SLIST_HEAD_INITIALIZER(&accept_filtlsthd); - -MALLOC_DEFINE(M_ACCF, "accf", "accept filter data"); - -/* - * must be passed a malloc'd structure so we don't explode if the kld - * is unloaded, we leak the struct on deallocation to deal with this, - * but if a filter is loaded with the same name as a leaked one we re-use - * the entry. - */ -int -accept_filt_add(struct accept_filter *filt) -{ - struct accept_filter *p; - - SLIST_FOREACH(p, &accept_filtlsthd, accf_next) - if (strcmp(p->accf_name, filt->accf_name) == 0) { - if (p->accf_callback != NULL) { - return (EEXIST); - } else { - p->accf_callback = filt->accf_callback; - FREE(filt, M_ACCF); - return (0); - } - } - - if (p == NULL) - SLIST_INSERT_HEAD(&accept_filtlsthd, filt, accf_next); - return (0); -} - -int -accept_filt_del(char *name) -{ - struct accept_filter *p; - - p = accept_filt_get(name); - if (p == NULL) - return (ENOENT); - - p->accf_callback = NULL; - return (0); -} - -struct accept_filter * -accept_filt_get(char *name) -{ - struct accept_filter *p; - - SLIST_FOREACH(p, &accept_filtlsthd, accf_next) - if (strcmp(p->accf_name, name) == 0) - return (p); - - return (NULL); -} - -int -accept_filt_generic_mod_event(module_t mod, int event, void *data) -{ - struct accept_filter *p; - struct accept_filter *accfp = (struct accept_filter *) data; - int s, error; - - switch (event) { - case MOD_LOAD: - MALLOC(p, struct accept_filter *, sizeof(*p), M_ACCF, M_WAITOK); - bcopy(accfp, p, sizeof(*p)); - s = splnet(); - error = accept_filt_add(p); - splx(s); - break; - - case MOD_UNLOAD: - /* - * Do not support unloading yet. we don't keep track of refcounts - * and unloading an accept filter callback and then having it called - * is a bad thing. A simple fix would be to track the refcount - * in the struct accept_filter. - */ -#if 0 - s = splnet(); - error = accept_filt_del(accfp->accf_name); - splx(s); -#endif - error = EOPNOTSUPP; - break; - - case MOD_SHUTDOWN: - error = 0; - break; - - default: - error = EOPNOTSUPP; - break; - } - - return (error); -} diff --git a/sys/modules/accf_data/Makefile b/sys/modules/accf_data/Makefile deleted file mode 100644 index 9f3a64ef5213..000000000000 --- a/sys/modules/accf_data/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../netinet -KMOD = accf_data -SRCS = accf_data.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/accf_http/Makefile b/sys/modules/accf_http/Makefile deleted file mode 100644 index 2b76ac6478ae..000000000000 --- a/sys/modules/accf_http/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../netinet -KMOD = accf_http -SRCS = accf_http.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/Makefile b/sys/modules/sound/Makefile deleted file mode 100644 index 41ea856b17e7..000000000000 --- a/sys/modules/sound/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# $FreeBSD$ - -SUBDIR = -SUBDIR += pcm -SUBDIR += driver - -.include <bsd.subdir.mk> diff --git a/sys/modules/sound/Makefile.inc b/sys/modules/sound/Makefile.inc deleted file mode 100644 index 265f86d1ed55..000000000000 --- a/sys/modules/sound/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -.include "../Makefile.inc" diff --git a/sys/modules/sound/driver/Makefile.inc b/sys/modules/sound/driver/Makefile.inc deleted file mode 100644 index 265f86d1ed55..000000000000 --- a/sys/modules/sound/driver/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -# $FreeBSD$ - -.include "../Makefile.inc" diff --git a/sys/modules/sound/driver/ad1816/Makefile b/sys/modules/sound/driver/ad1816/Makefile deleted file mode 100644 index a506c30edf6a..000000000000 --- a/sys/modules/sound/driver/ad1816/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/isa -KMOD = snd_ad1816 -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += ad1816.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/csa/Makefile b/sys/modules/sound/driver/csa/Makefile deleted file mode 100644 index 2f6ffe173d17..000000000000 --- a/sys/modules/sound/driver/csa/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/pci -KMOD = snd_csa -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += csa.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/csapcm/Makefile b/sys/modules/sound/driver/csapcm/Makefile deleted file mode 100644 index 42f12c7aad8c..000000000000 --- a/sys/modules/sound/driver/csapcm/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/pci -KMOD = snd_csapcm -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += csapcm.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/ds1/Makefile b/sys/modules/sound/driver/ds1/Makefile deleted file mode 100644 index a703e1ce8138..000000000000 --- a/sys/modules/sound/driver/ds1/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/pci -KMOD = snd_ds1 -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += ds1.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/emu10k1/Makefile b/sys/modules/sound/driver/emu10k1/Makefile deleted file mode 100644 index 73c6ff3a36f5..000000000000 --- a/sys/modules/sound/driver/emu10k1/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/pci -KMOD = snd_emu10k1 -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += emu10k1.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/es137x/Makefile b/sys/modules/sound/driver/es137x/Makefile deleted file mode 100644 index b1f7abdf95a2..000000000000 --- a/sys/modules/sound/driver/es137x/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/pci -KMOD = snd_es137x -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += es137x.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/es1888/Makefile b/sys/modules/sound/driver/es1888/Makefile deleted file mode 100644 index 2a6fc3be1ed3..000000000000 --- a/sys/modules/sound/driver/es1888/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/isa -KMOD = snd_es1888 -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += es1888.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/ess/Makefile b/sys/modules/sound/driver/ess/Makefile deleted file mode 100644 index 3dc1032d1528..000000000000 --- a/sys/modules/sound/driver/ess/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/isa -KMOD = snd_ess -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += ess.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/gusc/Makefile b/sys/modules/sound/driver/gusc/Makefile deleted file mode 100644 index facf8acec9f2..000000000000 --- a/sys/modules/sound/driver/gusc/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/isa -KMOD = snd_gusc -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += gusc.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/mss/Makefile b/sys/modules/sound/driver/mss/Makefile deleted file mode 100644 index 46703688df6d..000000000000 --- a/sys/modules/sound/driver/mss/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/isa -KMOD = snd_mss -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += mss.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/neomagic/Makefile b/sys/modules/sound/driver/neomagic/Makefile deleted file mode 100644 index be8016c2ce18..000000000000 --- a/sys/modules/sound/driver/neomagic/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/pci -KMOD = snd_neomagic -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += neomagic.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/sb/Makefile b/sys/modules/sound/driver/sb/Makefile deleted file mode 100644 index 47373c8feab0..000000000000 --- a/sys/modules/sound/driver/sb/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/isa -KMOD = snd_sb -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += sb.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/sbc/Makefile b/sys/modules/sound/driver/sbc/Makefile deleted file mode 100644 index 3974b5a82db7..000000000000 --- a/sys/modules/sound/driver/sbc/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/isa -KMOD = snd_sbc -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += sbc.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/sound/driver/t4dwave/Makefile b/sys/modules/sound/driver/t4dwave/Makefile deleted file mode 100644 index 6c0bb3fa1dc5..000000000000 --- a/sys/modules/sound/driver/t4dwave/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../../../dev/sound/pci -KMOD = snd_t4dwave -SRCS = device_if.h bus_if.h isa_if.h pci_if.h -SRCS += t4dwave.c - -.include <bsd.kmod.mk> diff --git a/sys/modules/tx/Makefile b/sys/modules/tx/Makefile deleted file mode 100644 index ab06042cbf39..000000000000 --- a/sys/modules/tx/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# $FreeBSD$ - -.PATH: ${.CURDIR}/../../pci -KMOD = if_tx -SRCS = if_tx.c opt_bdg.h device_if.h bus_if.h pci_if.h -SRCS += miibus_if.h - -.include <bsd.kmod.mk> diff --git a/sys/net/if_tap.h b/sys/net/if_tap.h deleted file mode 100644 index 30f742129191..000000000000 --- a/sys/net/if_tap.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 1999-2000 by Maksim Yevmenkin <m_evmenkin@yahoo.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. 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. - * - * BASED ON: - * ------------------------------------------------------------------------- - * - * Copyright (c) 1988, Julian Onions <jpo@cs.nott.ac.uk> - * Nottingham University 1987. - */ - -/* - * $FreeBSD$ - * $Id: if_tap.h,v 0.7 2000/07/12 04:12:51 max Exp $ - */ - -#ifndef _NET_IF_TAP_H_ -#define _NET_IF_TAP_H_ - -/* refer to if_tapvar.h for the softc stuff */ - -/* maximum receive packet size (hard limit) */ -#define TAPMRU 16384 - -struct tapinfo { - int baudrate; /* linespeed */ - short mtu; /* maximum transmission unit */ - u_char type; /* ethernet, tokenring, etc. */ - u_char dummy; /* place holder */ -}; - -/* ioctl's for get/set debug */ -#define TAPSDEBUG _IOW('t', 90, int) -#define TAPGDEBUG _IOR('t', 89, int) -#define TAPSIFINFO _IOW('t', 91, struct tapinfo) -#define TAPGIFINFO _IOR('t', 92, struct tapinfo) - -/* VMware ioctl's */ -#define VMIO_SIOCSIFFLAGS _IO('V', 0) -#define VMIO_SIOCSKEEP _IO('V', 1) -#define VMIO_SIOCSIFBR _IO('V', 2) -#define VMIO_SIOCSLADRF _IO('V', 3) - -/* XXX -- unimplemented */ -#define VMIO_SIOCSETMACADDR _IO('V', 4) - -/* XXX -- not used? */ -#define VMIO_SIOCPORT _IO('V', 5) -#define VMIO_SIOCBRIDGE _IO('V', 6) -#define VMIO_SIOCNETIF _IO('V', 7) - -#endif /* !_NET_IF_TAP_H_ */ diff --git a/sys/netinet/accf_data.c b/sys/netinet/accf_data.c deleted file mode 100644 index 776047ce2dce..000000000000 --- a/sys/netinet/accf_data.c +++ /dev/null @@ -1,80 +0,0 @@ -/*- - * Copyright (c) 2000 Alfred Perlstein <alfred@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 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$ - */ - -#define ACCEPT_FILTER_MOD - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/sysproto.h> -#include <sys/kernel.h> -#include <sys/proc.h> -#include <sys/malloc.h> -#include <sys/unistd.h> -#include <sys/file.h> -#include <sys/fcntl.h> -#include <sys/protosw.h> -#include <sys/socket.h> -#include <sys/socketvar.h> -#include <sys/stat.h> -#include <sys/mbuf.h> -#include <sys/resource.h> -#include <sys/sysent.h> -#include <sys/resourcevar.h> - -/* accept filter that holds a socket until data arrives */ - -static void sohasdata(struct socket *so, void *arg, int waitflag); - -static struct accept_filter accf_data_filter = { - "dataready", - sohasdata, - NULL, - NULL -}; - -static moduledata_t accf_data_mod = { - "accf_data", - accept_filt_generic_mod_event, - &accf_data_filter -}; - -DECLARE_MODULE(accf_data, accf_data_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); - -static void -sohasdata(struct socket *so, void *arg, int waitflag) -{ - - if (!soreadable(so)) { - return; - } - - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; -} diff --git a/sys/netinet/accf_http.c b/sys/netinet/accf_http.c deleted file mode 100644 index 09a4e9fd6172..000000000000 --- a/sys/netinet/accf_http.c +++ /dev/null @@ -1,183 +0,0 @@ -/*- - * Copyright (c) 2000 Alfred Perlstein <alfred@FreeBSD.org> - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 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$ - */ - -#define ACCEPT_FILTER_MOD - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/sysproto.h> -#include <sys/kernel.h> -#include <sys/proc.h> -#include <sys/malloc.h> -#include <sys/unistd.h> -#include <sys/file.h> -#include <sys/fcntl.h> -#include <sys/protosw.h> -#include <sys/socket.h> -#include <sys/socketvar.h> -#include <sys/stat.h> -#include <sys/mbuf.h> -#include <sys/resource.h> -#include <sys/sysent.h> -#include <sys/resourcevar.h> - -/* - * XXX: doesn't work with 0.9 requests, make a seperate filter - * based on this one if you want to decode those. - */ - -/* check for GET */ -static void sohashttpget(struct socket *so, void *arg, int waitflag); -/* check for end of HTTP request */ -static void soishttpconnected(struct socket *so, void *arg, int waitflag); -static char sbindex(struct mbuf **mp, int *begin, int end); - -static struct accept_filter accf_http_filter = { - "httpready", - sohashttpget, - NULL, - NULL -}; - -static moduledata_t accf_http_mod = { - "accf_http", - accept_filt_generic_mod_event, - &accf_http_filter -}; - -DECLARE_MODULE(accf_http, accf_http_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); - - -static char -sbindex(struct mbuf **mp, int *begin, int end) -{ - struct mbuf *m = *mp; - int diff = end - *begin + 1; - - while (m->m_len < diff) { - *begin += m->m_len; - diff -= m->m_len; - if (m->m_next) { - m = m->m_next; - } else if (m->m_nextpkt) { - m = m->m_nextpkt; - } else { - /* only happens if end > data in socket buffer */ - panic("sbindex: not enough data"); - } - } - *mp = m; - return *(mtod(m, char *) + diff - 1); -} - -static void -sohashttpget(struct socket *so, void *arg, int waitflag) -{ - - if ((so->so_state & SS_CANTRCVMORE) == 0) { - struct mbuf *m; - - if (so->so_rcv.sb_cc < 6) - return; - m = so->so_rcv.sb_mb; - if (bcmp(mtod(m, char *), "GET ", 4) == 0) { - soishttpconnected(so, arg, waitflag); - return; - } - } - - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; -} - -static void -soishttpconnected(struct socket *so, void *arg, int waitflag) -{ - char a, b, c; - struct mbuf *y, *z; - - if ((so->so_state & SS_CANTRCVMORE) == 0) { - /* seek to end and keep track of next to last mbuf */ - y = so->so_rcv.sb_mb; - while (y->m_nextpkt) - y = y->m_nextpkt; - z = y; - while (y->m_next) { - z = y; - y = y->m_next; - } - - if (z->m_len + y->m_len > 2) { - int index = y->m_len - 1; - - c = *(mtod(y, char *) + index--); - switch (index) { - case -1: - y = z; - index = y->m_len - 1; - b = *(mtod(y, char *) + index--); - break; - case 0: - b = *(mtod(y, char *) + index--); - y = z; - index = y->m_len - 1; - break; - default: - b = *(mtod(y, char *) + index--); - break; - } - a = *(mtod(y, char *) + index--); - } else { - int begin = 0; - int end = so->so_rcv.sb_cc - 3; - - y = so->so_rcv.sb_mb; - a = sbindex(&y, &begin, end++); - b = sbindex(&y, &begin, end++); - c = sbindex(&y, &begin, end++); - } - - if (c == '\n' && (b == '\n' || (b == '\r' && a == '\n'))) { - /* we have all request headers */ - goto done; - } else { - /* still need more data */ - so->so_upcall = soishttpconnected; - so->so_rcv.sb_flags |= SB_UPCALL; - return; - } - } - -done: - so->so_upcall = NULL; - so->so_rcv.sb_flags &= ~SB_UPCALL; - soisconnected(so); - return; -} |