pcan.h revision 305a15047c0c4be5ad9c852e8de5c2c56cb6134b
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Copyright (c) 1997, 1998, 1999
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Redistribution and use in source and binary forms, with or without
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * modification, are permitted provided that the following conditions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * are met:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 1. Redistributions of source code must retain the above copyright
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * notice, this list of conditions and the following disclaimer.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 2. Redistributions in binary form must reproduce the above copyright
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * notice, this list of conditions and the following disclaimer in the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * documentation and/or other materials provided with the distribution.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 3. All advertising materials mentioning features or use of this software
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * must display the following acknowledgement:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This product includes software developed by Bill Paul.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 4. Neither the name of the author nor the names of any co-contributors
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright * may be used to endorse or promote products derived from this software
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * without specific prior written permission.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
bbf6f00c25b6a2bed23c35eac6d62998ecdb338cJordan Brown * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
cb174861876aea6950a7ab4ce944aff84b1914cdjoyce mcintosh * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * THE POSSIBILITY OF SUCH DAMAGE.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross#pragma ident "%Z%%M% %I% %E% SMI"
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Size of Aironet I/O space.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Hermes register definitions and what little I know about them.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Hermes command/status registers.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_COMMAND(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x00 : 0x00)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_PARAM0(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x04 : 0x02)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_PARAM1(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x08 : 0x04)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_PARAM2(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x0c : 0x06)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_STATUS(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x10 : 0x08)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_RESP0(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x14 : 0x0A)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_RESP1(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x18 : 0x0C)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_RESP2(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x1c : 0x0E)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_LINKSTAT(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x20 : 0x10)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Command register
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_CMD_NO_ACK 0x0080 /* don't acknowledge command */
7b59d02d2a384be9a08087b14defadd214b3c1ddjb * Command codes
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb#define AN_CMD_FORCE_SYNCLOSS 0x0003 /* force loss of sync */
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#define AN_CMD_ALLOC_MEM 0x000A /* allocate NIC memory */
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * Reclaim qualifier bit, applicable to the
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * TX command.
faa1795a28a5c712eed6d0a3f84d98c368a316c6jb * MPI 350 DMA descriptor information
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * dma descriptor definition for miniPci card.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * the miniPci card only works on x86.
8d7e41661dc4633488e93b13363137523ce59977jose borrego#define AN_RX_DESC_OFFSET (AN_HOST_DESC_OFFSET + \
8d7e41661dc4633488e93b13363137523ce59977jose borrego sizeof (struct an_card_rid_desc))
8d7e41661dc4633488e93b13363137523ce59977jose borrego#define AN_TX_DESC_OFFSET (AN_RX_DESC_OFFSET + \
8d7e41661dc4633488e93b13363137523ce59977jose borrego (AN_MAX_RX_DESC * sizeof (struct an_card_rx_desc)))
8d7e41661dc4633488e93b13363137523ce59977jose borrego * ACCESS command qualifier bits.
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * PROGRAM command qualifier bits.
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Status register values
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Linkstat register
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_LINKSTAT_ASSOC_FAIL 0x8400 /* (low byte is reason code) */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_LINKSTAT_DISASSOC 0x8200 /* (low byte is reason code) */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_LINKSTAT_DEAUTH 0x8100 /* (low byte is reason code) */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Link stat low byte reason code
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_LINKSTAT_RC_RESERVED 0 /* Reserved return code */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_LINKSTAT_RC_NOREASON 1 /* Unspecified reason */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_LINKSTAT_RC_AUTHINV 2 /* Prev auth invalid */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_LINKSTAT_RC_DEAUTH 3 /* Deauth due sender leaving */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_LINKSTAT_RC_NOACT 4 /* Disassociated due inactivity */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_LINKSTAT_RC_MAXLOAD 5 /* Disassociated due 2many stations */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Class 2 frame received from non-Authenticated station
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Class 3 frame received from non-Associated station
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Disassociated because sending station is leaving BSS
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Station requesting (Re)Association not Authenticated w/responding station
8d7e41661dc4633488e93b13363137523ce59977jose borrego * memory handle management registers
8d7e41661dc4633488e93b13363137523ce59977jose borrego (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x1a : 0x24)
8d7e41661dc4633488e93b13363137523ce59977jose borrego#define AN_INVALID_FID 0xffff /* invalid fid value */
8d7e41661dc4633488e93b13363137523ce59977jose borrego * Buffer Access Path (BAP) registers.
8d7e41661dc4633488e93b13363137523ce59977jose borrego * These are I/O channels. I believe you can use each one for
8d7e41661dc4633488e93b13363137523ce59977jose borrego * any desired purpose independently of the other. In general
8d7e41661dc4633488e93b13363137523ce59977jose borrego * though, we use BAP1 for reading and writing LTV records and
8d7e41661dc4633488e93b13363137523ce59977jose borrego * reading received data frames, and BAP0 for writing transmit
8d7e41661dc4633488e93b13363137523ce59977jose borrego * frames. This is a convention though, not a rule.
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Event registers
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_EVENT_STAT(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x60 : 0x30)
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_INT_EN(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x64 : 0x32)
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_EVENT_ACK(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x68 : 0x34)
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Events - AN_EVENT_ACK register only
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_EV_CLR_STUCK_BUSY 0x4000 /* clear stuck busy bit */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#define AN_EV_WAKEREQUEST 0x2000 /* awaken from PSP mode */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright /* Events shared by all 3 event regs: */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#define AN_EV_MIC 0x1000 /* Message Integrity Check */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#define AN_EV_AWAKE 0x0100 /* station woke up from PSP mode */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_EV_LINKSTAT 0x0080 /* link status available */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_EV_CMD 0x0010 /* command completed */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright#define AN_EV_ALLOC 0x0008 /* async alloc/reclaim completed */
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_EV_TX_EXC 0x0004 /* async xmit completed with failure */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States#define AN_EV_TX 0x0002 /* async xmit completed succesfully */
9fb67ea305c66b6a297583b9b0db6796b0dfe497afshin salek ardakani - Sun Microsystems - Irvine United States#define AN_EV_RX 0x0001 /* async rx completed */
148c5f43199ca0b43fc8e3b643aab11cd66ea327Alan Wright (AN_EV_RX|AN_EV_TX|AN_EV_TX_EXC|AN_EV_ALLOC|AN_EV_LINKSTAT|AN_EV_MIC \
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego (AN_EV_RX|AN_EV_TX|AN_EV_TX_EXC|AN_EV_ALLOC|AN_EV_LINKSTAT|AN_EV_MIC))
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Host software registers
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_SW0(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x50 : 0x28)
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_SW1(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x54 : 0x2A)
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_SW2(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x58 : 0x2C)
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego#define AN_SW3(p) (p->pcan_device_type == PCAN_DEVICE_PCI ? 0x5c : 0x2E)
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * General configuration information.
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Scanning associating.
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Power save operation
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Ad-hoc (or AP) operation.
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Radio operation.
c8ec8eea9849cac239663c46be8a7f5d2ba7ca00jose borrego * Aironet extensions.
b89a8333f5e1f75ec0c269b22524bd2eccb972banatalie li - Sun Microsystems - Irvine United States#define AN_DEVTYPE_PC4800 0x006D
struct an_ltv_ssidlist {
struct an_ltv_aplist {
struct an_ltv_drvname {
struct an_rid_encap {
struct an_ltv_wepkey {
struct an_ltv_crypt {
struct an_ltv_caps {
struct an_ltv_apinfo {
struct an_ltv_radioinfo {
struct an_ltv_status {
struct an_ltv_stats {
struct an_ltv_scanresult {
} an_fh;
typedef struct an_scan_list {
typedef struct an_rxframe {
} an_rxfrm_t;
typedef struct an_txframe {
} an_txfrm_t;
typedef struct an_frame {
} frm;
} an_frm_t;
#define AN_TXGAP_8023 0
struct an_802_3_hdr {
typedef struct an_snap_hdr {
typedef struct an_tx_ring_data {
int an_tx_prod;
int an_tx_cons;
typedef struct pcan_dma_info {
* See cs_priv.h MAKE_CLIENT_HANDLE.
typedef struct pcan_macinfo {
int pcan_usewep;
int pcan_reset_delay;
int pcan_badrids_len;
} pcan_maci_t;
#define PCAN_READ_LTV 0
static int pcan_start(void *);
static void pcan_stop(void *);
static void pcan_scanlist_timeout(void *);
#define PCAN_READ(p, o, v) { \
v = LE_16(t); \
v = LE_16(t); \
#define PCAN_WRITE(p, o, v) { \
#define PCAN_READ_P(p, o, v, h) { \
*(v) = h ? LE_16(t) : t; \
*(v) = h ? LE_16(t) : t; \
#define PCAN_WRITE_P(p, o, v, h) { \
h ? LE_16(*(v)) : (*(v))); \
#ifdef _BIG_ENDIAN
pcan_swap_len--; \
#define PCAN_AUX_PUT32(p, o, v)\
#define PCAN_AUX_GET32(p, o, v) {\
#define PCAN_SUCCESS 0
#ifdef __cplusplus