if_ndisvar.h revision 124821
1123474Swpaul/*
2123474Swpaul * Copyright (c) 2003
3123474Swpaul *	Bill Paul <wpaul@windriver.com>.  All rights reserved.
4123474Swpaul *
5123474Swpaul * Redistribution and use in source and binary forms, with or without
6123474Swpaul * modification, are permitted provided that the following conditions
7123474Swpaul * are met:
8123474Swpaul * 1. Redistributions of source code must retain the above copyright
9123474Swpaul *    notice, this list of conditions and the following disclaimer.
10123474Swpaul * 2. Redistributions in binary form must reproduce the above copyright
11123474Swpaul *    notice, this list of conditions and the following disclaimer in the
12123474Swpaul *    documentation and/or other materials provided with the distribution.
13123474Swpaul * 3. All advertising materials mentioning features or use of this software
14123474Swpaul *    must display the following acknowledgement:
15123474Swpaul *	This product includes software developed by Bill Paul.
16123474Swpaul * 4. Neither the name of the author nor the names of any co-contributors
17123474Swpaul *    may be used to endorse or promote products derived from this software
18123474Swpaul *    without specific prior written permission.
19123474Swpaul *
20123474Swpaul * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
21123474Swpaul * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22123474Swpaul * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23123474Swpaul * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
24123474Swpaul * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25123474Swpaul * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26123474Swpaul * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27123474Swpaul * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28123474Swpaul * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29123474Swpaul * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30123474Swpaul * THE POSSIBILITY OF SUCH DAMAGE.
31123474Swpaul *
32123474Swpaul * $FreeBSD: head/sys/dev/if_ndis/if_ndisvar.h 124821 2004-01-22 02:36:34Z wpaul $
33123474Swpaul */
34123474Swpaul
35123474Swpaulstruct ndis_type {
36123474Swpaul	uint16_t		ndis_vid;
37123474Swpaul	uint16_t		ndis_did;
38123620Swpaul	uint32_t		ndis_subsys;
39123474Swpaul	char			*ndis_name;
40123474Swpaul};
41123474Swpaul
42123474Swpaulstruct ndis_shmem {
43123474Swpaul	bus_dma_tag_t		ndis_stag;
44123474Swpaul	bus_dmamap_t		ndis_smap;
45123474Swpaul	void			*ndis_saddr;
46123474Swpaul	struct ndis_shmem	*ndis_next;
47123474Swpaul};
48123474Swpaul
49123474Swpaulstruct ndis_cfglist {
50123474Swpaul	ndis_cfg		ndis_cfg;
51123474Swpaul        TAILQ_ENTRY(ndis_cfglist)	link;
52123474Swpaul};
53123474Swpaul
54123474SwpaulTAILQ_HEAD(nch, ndis_cfglist);
55123474Swpaul
56123474Swpaul#define NDIS_INC(x)		\
57123474Swpaul	(x)->ndis_txidx = ((x)->ndis_txidx + 1) % (x)->ndis_maxpkts
58123474Swpaul
59123695Swpaul#define arpcom ic.ic_ac
60123695Swpaul
61123474Swpaulstruct ndis_softc {
62123695Swpaul	struct ieee80211com	ic;		/* interface info */
63123695Swpaul#ifdef notdef
64123695Swpaul	struct ieee80211com	arpcom;		/* interface info */
65123695Swpaul#endif
66123474Swpaul	struct ifmedia		ifmedia;	/* media info */
67124821Swpaul	u_long			ndis_hwassist;
68124821Swpaul	uint32_t		ndis_v4tx;
69124821Swpaul	uint32_t		ndis_v4rx;
70123474Swpaul	bus_space_handle_t	ndis_bhandle;
71123474Swpaul	bus_space_tag_t		ndis_btag;
72123474Swpaul	void			*ndis_intrhand;
73123474Swpaul	struct resource		*ndis_irq;
74123474Swpaul	struct resource		*ndis_res;
75123474Swpaul	struct resource		*ndis_res_io;
76123474Swpaul	int			ndis_io_rid;
77123474Swpaul	struct resource		*ndis_res_mem;
78123474Swpaul	int			ndis_mem_rid;
79123474Swpaul	struct resource		*ndis_res_altmem;
80123474Swpaul	int			ndis_altmem_rid;
81123474Swpaul	struct resource		*ndis_res_am;	/* attribute mem (pccard) */
82123474Swpaul	struct resource		*ndis_res_cm;	/* common mem (pccard) */
83123474Swpaul	int			ndis_rescnt;
84124409Swpaul	struct mtx		*ndis_mtx;
85124409Swpaul	struct mtx		*ndis_intrmtx;
86123474Swpaul	device_t		ndis_dev;
87123474Swpaul	int			ndis_unit;
88123474Swpaul	ndis_miniport_block	ndis_block;
89123474Swpaul	ndis_miniport_characteristics	ndis_chars;
90123474Swpaul	interface_type		ndis_type;
91123474Swpaul	struct callout_handle	ndis_stat_ch;
92123474Swpaul	int			ndis_maxpkts;
93123474Swpaul	ndis_oid		*ndis_oids;
94123474Swpaul	int			ndis_oidcnt;
95123474Swpaul	int			ndis_txidx;
96123474Swpaul	int			ndis_txpending;
97123474Swpaul	ndis_packet		**ndis_txarray;
98123474Swpaul	int			ndis_sc;
99123474Swpaul	ndis_cfg		*ndis_regvals;
100123474Swpaul	struct nch		ndis_cfglist_head;
101123695Swpaul	int			ndis_80211;
102123695Swpaul	int			ndis_link;
103123695Swpaul	uint32_t		ndis_filter;
104123695Swpaul	int			ndis_if_flags;
105123474Swpaul
106123474Swpaul	struct sysctl_ctx_list	ndis_ctx;
107123474Swpaul	struct sysctl_oid	*ndis_tree;
108123620Swpaul	int			ndis_devidx;
109123474Swpaul	interface_type		ndis_iftype;
110123474Swpaul
111123474Swpaul	bus_dma_tag_t		ndis_parent_tag;
112123474Swpaul	struct ndis_shmem	*ndis_shlist;
113123474Swpaul	bus_dma_tag_t		ndis_mtag;
114123474Swpaul	bus_dma_tag_t		ndis_ttag;
115123474Swpaul	bus_dmamap_t		*ndis_mmaps;
116123474Swpaul	bus_dmamap_t		*ndis_tmaps;
117123474Swpaul	int			ndis_mmapcnt;
118123474Swpaul};
119123474Swpaul
120124409Swpaul#define NDIS_LOCK(_sc)		mtx_pool_lock(ndis_mtxpool, (_sc)->ndis_mtx)
121124409Swpaul#define NDIS_UNLOCK(_sc)	mtx_pool_unlock(ndis_mtxpool, (_sc)->ndis_mtx)
122123474Swpaul
123