ath_impl.h revision f11a3086bc0b6b242d387296efedd61d43316e8d
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2002-2004 Sam Leffler, Errno Consulting
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
* redistribution must be conditioned upon including a substantially
* similar Disclaimer requirement for further binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
*
*/
/*
* ath_impl.h is a bridge between the HAL and the driver. It
* defines some data structures encapsulating the HAL interface
* and communicating with the IEEE80211 MAC layer and other
* driver components.
*/
#ifndef _ATH_IMPL_H
#define _ATH_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Defintions for the Atheros Wireless LAN controller driver.
*/
#include <sys/net80211.h>
#include "ath_hal.h"
/* Bit map related macros. */
/*
* Bit flags in the ath_dbg_flags
*/
#ifdef DEBUG
{ command; } \
} while (0)
#else
#endif /* DEBUG */
/*
* Node type of wifi device
*/
#ifndef DDI_NT_NET_WIFI
#define DDI_NT_NET_WIFI "ddi_network:wifi"
#endif
#define ATH_NODENAME "ath"
#define ATH_LE_READ_4(p) \
((uint32_t) \
#define ATH_N(a) (sizeof (a) / sizeof (a[0]))
/*
* Sync a DMA area described by a dma_area_t
*/
#define ATH_TXINTR_PERIOD 5
#define ATH_TIMEOUT 1000
/* driver-specific node state */
struct ath_node {
};
struct ath_stats {
};
/*
* Describes one chunk of allocated DMA-able memory
*
* In some cases, this is a single chunk as allocated from the system;
* but we also use this structure to represent slices carved off such
* a chunk. Even when we don't really need all the information, we
* use this structure as a convenient way of correlating the various
* ways of looking at a piece of memory (kernel VA, IO space DVMA,
* handle+offset, etc).
*/
struct dma_area {
/* >= product of above */
}; /* 0x50 (80) bytes */
typedef struct dma_area dma_area_t;
struct ath_buf {
int bf_flags; /* tx descriptor flags */
/* we're in list of asc->asc_txbuf_list or asc->asc_rxbuf_list */
};
/*
* Data transmit queue state. One of these exists for each
* hardware transmit queue. Packets sent to us from above
* are assigned to queues based on their priority. Not all
* devices support a complete set of hardware transmit queues.
* For those devices the array sc_ac2q will map multiple
* priorities to fewer hardware queues (typically all to one
* hardware queue).
*/
struct ath_txq {
};
/*
* asc_isc must be the first element, for convience of
* casting between iee80211com and ath
*/
typedef struct ath {
/* pointer to the first "struct ath_buf" */
struct ath_buf *asc_vbufptr;
/* length of all allocated "struct ath_buf" */
int (*asc_newstate)(ieee80211com_t *,
enum ieee80211_state, int);
} ath_t;
#define ATH_IS_RUNNING(_asc) \
/* Debug and log functions */
#ifdef __cplusplus
}
#endif
#endif /* _ATH_IMPL_H */