3 * Bill Paul <wpaul@windriver.com>. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Bill Paul.
16 * 4. Neither the name of the author nor the names of any co-contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
32 * $FreeBSD: src/sys/dev/if_ndis/if_ndisvar.h,v 1.15 2004/07/11 00:19:30 wpaul Exp $
33 * $DragonFly: src/sys/dev/netif/ndis/if_ndisvar.h,v 1.2 2004/09/14 23:57:00 joerg Exp $
36 #define NDIS_DEFAULT_NODENAME "FreeBSD NDIS node"
37 #define NDIS_NODENAME_LEN 32
39 struct ndis_pci_type {
46 struct ndis_pccard_type {
53 bus_dma_tag_t ndis_stag;
54 bus_dmamap_t ndis_smap;
56 struct ndis_shmem *ndis_next;
61 TAILQ_ENTRY(ndis_cfglist) link;
64 TAILQ_HEAD(nch, ndis_cfglist);
66 #define NDIS_INITIALIZED(sc) (sc->ndis_block.nmb_miniportadapterctx != NULL)
69 (x)->ndis_txidx = ((x)->ndis_txidx + 1) % (x)->ndis_maxpkts
71 #define arpcom ic.ic_ac
74 struct ieee80211com ic; /* interface info */
76 struct ieee80211com arpcom; /* interface info */
78 struct ifmedia ifmedia; /* media info */
82 bus_space_handle_t ndis_bhandle;
83 bus_space_tag_t ndis_btag;
85 struct resource *ndis_irq;
86 struct resource *ndis_res;
87 struct resource *ndis_res_io;
89 struct resource *ndis_res_mem;
91 struct resource *ndis_res_altmem;
93 struct resource *ndis_res_am; /* attribute mem (pccard) */
95 struct resource *ndis_res_cm; /* common mem (pccard) */
96 struct resource_list ndis_rl;
98 struct lwkt_token ndis_lock;
99 struct lwkt_token ndis_intrlock;
102 ndis_miniport_block ndis_block;
103 ndis_miniport_characteristics ndis_chars;
104 interface_type ndis_type;
105 struct callout ndis_stat_timer;
111 ndis_packet **ndis_txarray;
113 ndis_cfg *ndis_regvals;
114 struct nch ndis_cfglist_head;
117 uint32_t ndis_filter;
121 #if __FreeBSD_version < 502113
122 struct sysctl_ctx_list ndis_ctx;
123 struct sysctl_oid *ndis_tree;
126 interface_type ndis_iftype;
128 bus_dma_tag_t ndis_parent_tag;
129 struct ndis_shmem *ndis_shlist;
130 bus_dma_tag_t ndis_mtag;
131 bus_dma_tag_t ndis_ttag;
132 bus_dmamap_t *ndis_mmaps;
133 bus_dmamap_t *ndis_tmaps;
137 #define NDIS_LOCK_INFO struct lwkt_tokref tokinfo
138 #define NDIS_LOCK_INIT(tok) lwkt_token_init(tok)
139 #define NDIS_LOCK_DESTROY(tok) lwkt_token_uninit(tok)
140 #define NDIS_LOCK(_sc) lwkt_gettoken(&tokinfo, &(_sc)->ndis_lock)
141 #define NDIS_INTRLOCK(_sc) lwkt_gettoken(&tokinfo, &(_sc)->ndis_intrlock)
142 #define NDIS_UNLOCK(_sc) lwkt_reltoken(&tokinfo)
143 #define NDIS_INTRUNLOCK(_sc) lwkt_reltoken(&tokinfo)