Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev Pull up revisions 1.1-1.2 (new, requested by he):



details:   https://anonhg.NetBSD.org/src/rev/8527fc6b674f
branches:  netbsd-1-5
changeset: 490288:8527fc6b674f
user:      he <he%NetBSD.org@localhost>
date:      Tue Dec 12 21:26:34 2000 +0000

description:
Pull up revisions 1.1-1.2 (new, requested by he):
  Add a driver for an(4), Aironet and Cisco wireless pcmcia cards.

diffstat:

 sys/dev/ic/anreg.h            |  889 ++++++++++++++++++++++++++++++++++++++++++
 sys/dev/pcmcia/if_an_pcmcia.c |  372 +++++++++++++++++
 2 files changed, 1261 insertions(+), 0 deletions(-)

diffs (truncated from 1269 to 300 lines):

diff -r 93ba0216d64b -r 8527fc6b674f sys/dev/ic/anreg.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/ic/anreg.h        Tue Dec 12 21:26:34 2000 +0000
@@ -0,0 +1,889 @@
+/*     $NetBSD: anreg.h,v 1.3.2.2 2000/12/12 21:26:34 he Exp $ */
+/*
+ * Copyright (c) 1997, 1998, 1999
+ *     Bill Paul <wpaul%ctr.columbia.edu@localhost>.  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 Bill Paul.
+ * 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 Bill Paul 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 Bill Paul OR THE VOICES IN HIS HEAD
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/sys/dev/an/if_anreg.h,v 1.3 2000/11/13 23:04:12 wpaul Exp $
+ */
+
+#define AN_TIMEOUT     65536
+
+/* Default network name: ANY */
+#define AN_DEFAULT_NETNAME     ""
+
+/* The nodename must be less than 16 bytes */
+#define AN_DEFAULT_NODENAME    "NetBSD"
+
+#define AN_DEFAULT_IBSS                "NetBSD IBSS"
+
+/*
+ * register space access macros
+ */
+#define CSR_WRITE_2(sc, reg, val)      \
+       bus_space_write_2(sc->an_btag, sc->an_bhandle, reg, val)
+
+#define CSR_READ_2(sc, reg)            \
+       bus_space_read_2(sc->an_btag, sc->an_bhandle, reg)
+
+#define CSR_WRITE_1(sc, reg, val)      \
+       bus_space_write_1(sc->an_btag, sc->an_bhandle, reg, val)
+
+#define CSR_READ_1(sc, reg)            \
+       bus_space_read_1(sc->an_btag, sc->an_bhandle, reg)
+
+/*
+ * Size of Aironet I/O space.
+ */
+#define AN_IOSIZ               0x40
+
+/*
+ * Hermes register definitions and what little I know about them.
+ */
+
+/* Hermes command/status registers. */
+#define AN_COMMAND             0x00
+#define AN_PARAM0              0x02
+#define AN_PARAM1              0x04
+#define AN_PARAM2              0x06
+#define AN_STATUS              0x08
+#define AN_RESP0               0x0A
+#define AN_RESP1               0x0C
+#define AN_RESP2               0x0E
+#define AN_LINKSTAT            0x10
+
+/* Command register */
+#define AN_CMD_BUSY            0x8000 /* busy bit */
+#define AN_CMD_NO_ACK          0x0080 /* don't acknowledge command */
+#define AN_CMD_CODE_MASK       0x003F
+#define AN_CMD_QUAL_MASK       0x7F00
+
+/* Command codes */
+#define AN_CMD_NOOP            0x0000 /* no-op */
+#define AN_CMD_ENABLE          0x0001 /* enable */
+#define AN_CMD_DISABLE         0x0002 /* disable */
+#define AN_CMD_FORCE_SYNCLOSS  0x0003 /* force loss of sync */
+#define AN_CMD_FW_RESTART      0x0004 /* firmware resrart */
+#define AN_CMD_HOST_SLEEP      0x0005
+#define AN_CMD_MAGIC_PKT       0x0006
+#define AN_CMD_READCFG         0x0008
+#define AN_CMD_ALLOC_MEM       0x000A /* allocate NIC memory */
+#define AN_CMD_TX              0x000B /* transmit */
+#define AN_CMD_DEALLOC_MEM     0x000C
+#define AN_CMD_NOOP2           0x0010
+#define AN_CMD_ACCESS          0x0021
+#define AN_CMD_ALLOC_BUF       0x0028
+#define AN_CMD_PSP_NODES       0x0030
+#define AN_CMD_SET_PHYREG      0x003E
+#define AN_CMD_TX_TEST         0x003F
+#define AN_CMD_SLEEP           0x0085
+#define AN_CMD_SAVECFG         0x0108
+
+/*
+ * Reclaim qualifier bit, applicable to the
+ * TX command.
+ */
+#define AN_RECLAIM             0x0100 /* reclaim NIC memory */
+
+/*
+ * ACCESS command qualifier bits.
+ */
+#define AN_ACCESS_READ         0x0000
+#define AN_ACCESS_WRITE                0x0100
+
+/*
+ * PROGRAM command qualifier bits.
+ */
+#define AN_PROGRAM_DISABLE     0x0000
+#define AN_PROGRAM_ENABLE_RAM  0x0100
+#define AN_PROGRAM_ENABLE_NVRAM        0x0200
+#define AN_PROGRAM_NVRAM       0x0300
+
+/* Status register values */
+#define AN_STAT_CMD_CODE       0x003F
+#define AN_STAT_CMD_RESULT     0x7F00
+
+/* Linkstat register */
+#define AN_LINKSTAT_ASSOCIATED         0x0400
+#define AN_LINKSTAT_AUTHFAIL           0x0300
+#define AN_LINKSTAT_ASSOC_FAIL         0x8400
+#define AN_LINKSTAT_DISASSOC           0x8200
+#define AN_LINKSTAT_DEAUTH             0x8100
+#define AN_LINKSTAT_SYNCLOST_TSF       0x8004
+#define AN_LINKSTAT_SYNCLOST_HOSTREQ   0x8003
+#define AN_LINKSTAT_SYNCLOST_AVGRETRY  0x8002
+#define AN_LINKSTAT_SYNCLOST_MAXRETRY  0x8001
+#define AN_LINKSTAT_SYNCLOST_MISSBEACON        0x8000
+
+/* memory handle management registers */
+#define AN_RX_FID              0x20
+#define AN_ALLOC_FID           0x22
+#define AN_TX_CMP_FID          0x24
+
+/*
+ * Buffer Access Path (BAP) registers.
+ * These are I/O channels. I believe you can use each one for
+ * any desired purpose independently of the other. In general
+ * though, we use BAP1 for reading and writing LTV records and
+ * reading received data frames, and BAP0 for writing transmit
+ * frames. This is a convention though, not a rule.
+ */
+#define AN_SEL0                        0x18
+#define AN_SEL1                        0x1A
+#define AN_OFF0                        0x1C
+#define AN_OFF1                        0x1E
+#define AN_DATA0               0x36
+#define AN_DATA1               0x38
+#define AN_BAP0                        AN_DATA0
+#define AN_BAP1                        AN_DATA1
+
+#define AN_OFF_BUSY            0x8000
+#define AN_OFF_ERR             0x4000
+#define AN_OFF_DONE            0x2000
+#define AN_OFF_DATAOFF         0x0FFF
+
+/* Event registers */
+#define AN_EVENT_STAT          0x30    /* Event status */
+#define AN_INT_EN              0x32    /* Interrupt enable/disable */
+#define AN_EVENT_ACK           0x34    /* Ack event */
+
+/* Events */
+#define AN_EV_CLR_STUCK_BUSY   0x4000  /* clear stuck busy bit */
+#define AN_EV_WAKEREQUEST      0x2000  /* awaken from PSP mode */
+#define AN_EV_AWAKE            0x0100  /* station woke up from PSP mode*/
+#define AN_EV_LINKSTAT         0x0080  /* link status available */
+#define AN_EV_CMD              0x0010  /* command completed */
+#define AN_EV_ALLOC            0x0008  /* async alloc/reclaim completed */
+#define AN_EV_TX_EXC           0x0004  /* async xmit completed with failure */
+#define AN_EV_TX               0x0002  /* async xmit completed succesfully */
+#define AN_EV_RX               0x0001  /* async rx completed */
+
+#define AN_INTRS       \
+       (AN_EV_RX|AN_EV_TX|AN_EV_TX_EXC|AN_EV_ALLOC|AN_EV_LINKSTAT)
+
+/* Host software registers */
+#define AN_SW0                 0x28
+#define AN_SW1                 0x2A
+#define AN_SW2                 0x2C
+#define AN_SW3                 0x2E
+
+#define AN_CNTL                        0x14
+
+#define AN_CNTL_AUX_ENA                0xC000
+#define AN_CNTL_AUX_ENA_STAT   0xC000
+#define AN_CNTL_AUX_DIS_STAT   0x0000
+#define AN_CNTL_AUX_ENA_CNTL   0x8000
+#define AN_CNTL_AUX_DIS_CNTL   0x4000
+
+#define AN_AUX_PAGE            0x3A
+#define AN_AUX_OFFSET          0x3C
+#define AN_AUX_DATA            0x3E
+
+/*
+ * Length, Type, Value (LTV) record definitions and RID values.
+ */
+struct an_ltv_gen {
+       u_int16_t               an_len;
+       u_int16_t               an_type;
+       u_int16_t               an_val;
+};
+
+/*
+ * General configuration information.
+ */
+#define AN_RID_GENCONFIG       0xFF10
+struct an_ltv_genconfig {
+       /* General configuration. */
+       u_int16_t               an_len;                 /* 0x00 */
+       u_int16_t               an_type;                /* XXXX */
+       u_int16_t               an_opmode;              /* 0x02 */
+       u_int16_t               an_rxmode;              /* 0x04 */
+       u_int16_t               an_fragthresh;          /* 0x06 */
+       u_int16_t               an_rtsthresh;           /* 0x08 */
+       u_int8_t                an_macaddr[6];          /* 0x0A */
+       u_int8_t                an_rates[8];            /* 0x10 */
+       u_int16_t               an_shortretry_limit;    /* 0x18 */
+       u_int16_t               an_longretry_limit;     /* 0x1A */
+       u_int16_t               an_tx_msdu_lifetime;    /* 0x1C */
+       u_int16_t               an_rx_msdu_lifetime;    /* 0x1E */
+       u_int16_t               an_stationary;          /* 0x20 */
+       u_int16_t               an_ordering;            /* 0x22 */
+       u_int16_t               an_devtype;             /* 0x24 */
+       u_int16_t               an_rsvd0[5];            /* 0x26 */
+       /* Scanning associating. */
+       u_int16_t               an_scanmode;            /* 0x30 */
+       u_int16_t               an_probedelay;          /* 0x32 */
+       u_int16_t               an_probe_energy_timeout;/* 0x34 */
+       u_int16_t               an_probe_response_timeout;/*0x36 */
+       u_int16_t               an_beacon_listen_timeout;/*0x38 */
+       u_int16_t               an_ibss_join_net_timeout;/*0x3A */
+       u_int16_t               an_auth_timeout;        /* 0x3C */
+       u_int16_t               an_authtype;            /* 0x3E */
+       u_int16_t               an_assoc_timeout;       /* 0x40 */
+       u_int16_t               an_specified_ap_timeout;/* 0x42 */
+       u_int16_t               an_offline_scan_interval;/*0x44 */
+       u_int16_t               an_offline_scan_duration;/*0x46 */
+       u_int16_t               an_link_loss_delay;     /* 0x48 */
+       u_int16_t               an_max_beacon_lost_time;/* 0x4A */
+       u_int16_t               an_refresh_interval;    /* 0x4C */
+       u_int16_t               an_rsvd1;               /* 0x4E */
+       /* Power save operation */
+       u_int16_t               an_psave_mode;          /* 0x50 */
+       u_int16_t               an_sleep_for_dtims;     /* 0x52 */
+       u_int16_t               an_listen_interval;     /* 0x54 */
+       u_int16_t               an_fast_listen_interval;/* 0x56 */
+       u_int16_t               an_listen_decay;        /* 0x58 */
+       u_int16_t               an_fast_listen_decay;   /* 0x5A */
+       u_int16_t               an_rsvd2[2];            /* 0x5C */
+       /* Ad-hoc (or AP) operation. */
+       u_int16_t               an_beacon_period;       /* 0x60 */
+       u_int16_t               an_atim_duration;       /* 0x62 */
+       u_int16_t               an_rsvd3;               /* 0x64 */
+       u_int16_t               an_ds_channel;          /* 0x66 */
+       u_int16_t               an_rsvd4;               /* 0x68 */
+       u_int16_t               an_dtim_period;         /* 0x6A */
+       u_int16_t               an_rsvd5[2];            /* 0x6C */
+       /* Radio operation. */
+       u_int16_t               an_radiotype;           /* 0x70 */
+       u_int16_t               an_diversity;           /* 0x72 */
+       u_int16_t               an_tx_power;            /* 0x74 */
+       u_int16_t               an_rss_thresh;          /* 0x76 */
+       u_int16_t               an_modulation_type;     /* 0x78 */
+       u_int16_t               an_short_preamble;      /* 0x7A */
+       u_int16_t               an_home_product;        /* 0x7C */
+       u_int16_t               an_rsvd6;               /* 0x7E */
+       /* Aironet extensions. */
+       u_int8_t                an_nodename[16];        /* 0x80 */
+       u_int16_t               an_arl_thresh;          /* 0x90 */
+       u_int16_t               an_arl_decay;           /* 0x92 */
+       u_int16_t               an_arl_delay;           /* 0x94 */
+       u_int8_t                an_rsvd7;               /* 0x96 */
+       u_int8_t                an_rsvd8;               /* 0x97 */
+       u_int8_t                an_magic_packet_action; /* 0x98 */
+       u_int8_t                an_magic_packet_ctl;    /* 0x99 */
+       u_int16_t               an_rsvd9;
+};
+
+#define AN_OPMODE_IBSS_ADHOC                   0x0000
+#define AN_OPMODE_INFRASTRUCTURE_STATION       0x0001
+#define AN_OPMODE_AP                           0x0002
+#define AN_OPMODE_AP_REPEATER                  0x0003



Home | Main Index | Thread Index | Old Index