📄 if_wlp.h
字号:
/* * Copyright (c) 1997 Carnegie Mellon University. * All Rights Reserved. * * Permission to use, copy, modify, and distribute this software and * its documentation is hereby granted (including for commercial or * for-profit use), provided that both the copyright notice and this * permission notice appear in all copies of the software, derivative * works, or modified versions, and any portions thereof, and that * both notices appear in supporting documentation, and that credit * is given to Carnegie Mellon University in all publications reporting * on direct or indirect use of this code or its derivatives. * * THIS IMPLEMENTATION IS EXPERIMENTAL AND MAY HAVE BUGS, SOME OF WHICH * MAY HAVE SERIOUS CONSEQUENCES. CARNEGIE MELLON PROVIDES THIS SOFTWARE * IN ITS "AS IS" CONDITION, 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 CARNEGIE * MELLON UNIVERSITY 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. * * Carnegie Mellon encourages (but does not require) users of this * software to return any improvements or extensions that they make, * and to grant Carnegie Mellon the rights to redistribute these * changes without encumbrance. * * */#ifndef __IF_WLP_H__#define __IF_WLP_H__// #define WLP_DEBUG// #define WLP_STATSstruct wlp_softc;/* ====================================================================== ioctl()'s ====================================================================== */#define SIOCGIFSTATS _IOWR('i', 60, struct ifstats) /* Interface Stats */#define IFTYPE_REDWING 0x01#define IFTYPE_WAVELAN 0x02#ifdef KERNEL/* ====================================================================== Function Prototypes ====================================================================== */intProbeIntel82593(struct isa_device *, int);u_int8_tI82593_wait(struct wlp_softc *, u_int8_t);voidwlpinit (struct wlp_softc*);voidwlpsetrcr(struct wlp_softc*);voidwlptransmit(struct wlp_softc *, struct mbuf *);/* ====================================================================== Defines ====================================================================== */#define WLP_IOSIZE 8 /* 8 8-bit registers */#define WLP_TXBASE 0x2000 /* 8K offset */#define WLP_RXBUFSIZE 0x2000 /* 8K Receive Buffer */#define RXBUF_MAX_ADDR 0x1FFF#ifndef ETHER_ADDR_LEN#define ETHER_ADDR_LEN 6#endif#ifndef ETHER_MIN_LEN#define ETHER_MIN_LEN 64#endif#define ETHER_ADDR_FORMAT(t) (t)[0],(t)[1],(t)[2],(t)[3],(t)[4],(t)[5]/* ====================================================================== Macros ====================================================================== */#define IORead1(p) (inb(sc->sc_iobase + (p)))#define IOWrite1(p,v) outb(sc->sc_iobase + (p), (v))#define IOWrite(p,v,l) outsb(sc->sc_iobase + (p), v, l)#define IORead(p,v,l) insb(sc->sc_iobase + (p), v, l)#define MEMWrite1(to, v) sc->sc_maddr[to] = (u_char) (v)#define MEMRead1(from) ((u_char) sc->sc_maddr[from])#define MEMWrite(from, to, len) bcopy((from), sc->sc_maddr + (to), (len))#define MEMRead(to, from, len) bcopy(sc->sc_maddr + (from), (to), (len))#endif /* KERNEL *//* ====================================================================== Data Structures ====================================================================== */struct ifstats { struct ifreq ifs_ifr; int ifs_iftype; int ifs_unit; int ifs_iobase; int ifs_iosize; int ifs_maddr; int ifs_msize; int ifs_irq; struct I82593_stats ifs_istats; struct wavelan_stats ifs_wstats;};#ifdef KERNEL#ifdef WAVELAN_ROAMING#include <i386/isa/if_wlp_wavelan_roam.h>#endif/* * This structure borrowed from the PAO distribution (machine/wavelan.h) */struct wavelan_psa { u_int8_t umac_address[6]; u_int8_t lmac_address[6]; u_int8_t mac_address_select; u_int8_t compat_number; u_int8_t threshold_preset; u_int8_t feature_select; u_int8_t subband_number; u_int8_t quality_threshold; u_int8_t nwid[2]; u_int8_t nwid_select; u_int8_t security_select; u_int8_t encryption_key[8]; u_int8_t call_code[8]; u_int8_t nwid_prefix[2]; u_int8_t config_status; u_int8_t crc16[2]; u_int8_t crc_status;};struct wlp_softc { struct arpcom sc_ac; int sc_iftype; int (*sc_ifconfig)(struct wlp_softc*); int sc_unit; int sc_iobase; /* Starting I/O base address */ int sc_iosize; caddr_t sc_maddr; int sc_msize; int sc_irq; int sc_rxnext; int sc_gone; u_int8_t sc_nwid[2]; /* shadows radio modem registers */ u_int8_t sc_nwidprom; /* NWID Promiscious Mode */ u_int8_t sc_sigthresh; /* Signal Threshold */ u_int32_t sc_sigstat; /* Last reading from the card */#ifdef WAVELAN_ROAMING struct roam_state sc_rs; /* roaming state */#endif struct wavelan_psa sc_conf; caddr_t sc_attrmem; struct I82593_stats sc_stats;};#endif /* KERNEL */#endif /* __IF_WLP_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -