if_ndisvar.h revision 126706
1/*
2 * Copyright (c) 2003
3 *	Bill Paul <wpaul@windriver.com>.  All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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.
19 *
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.
31 *
32 * $FreeBSD: head/sys/dev/if_ndis/if_ndisvar.h 126706 2004-03-07 02:49:06Z wpaul $
33 */
34
35struct ndis_pci_type {
36	uint16_t		ndis_vid;
37	uint16_t		ndis_did;
38	uint32_t		ndis_subsys;
39	char			*ndis_name;
40};
41
42struct ndis_pccard_type {
43	const char		*ndis_vid;
44	const char		*ndis_did;
45	char			*ndis_name;
46};
47
48struct ndis_shmem {
49	bus_dma_tag_t		ndis_stag;
50	bus_dmamap_t		ndis_smap;
51	void			*ndis_saddr;
52	struct ndis_shmem	*ndis_next;
53};
54
55struct ndis_cfglist {
56	ndis_cfg		ndis_cfg;
57        TAILQ_ENTRY(ndis_cfglist)	link;
58};
59
60TAILQ_HEAD(nch, ndis_cfglist);
61
62#define NDIS_INC(x)		\
63	(x)->ndis_txidx = ((x)->ndis_txidx + 1) % (x)->ndis_maxpkts
64
65#define arpcom ic.ic_ac
66
67struct ndis_softc {
68	struct ieee80211com	ic;		/* interface info */
69#ifdef notdef
70	struct ieee80211com	arpcom;		/* interface info */
71#endif
72	struct ifmedia		ifmedia;	/* media info */
73	u_long			ndis_hwassist;
74	uint32_t		ndis_v4tx;
75	uint32_t		ndis_v4rx;
76	bus_space_handle_t	ndis_bhandle;
77	bus_space_tag_t		ndis_btag;
78	void			*ndis_intrhand;
79	struct resource		*ndis_irq;
80	struct resource		*ndis_res;
81	struct resource		*ndis_res_io;
82	int			ndis_io_rid;
83	struct resource		*ndis_res_mem;
84	int			ndis_mem_rid;
85	struct resource		*ndis_res_altmem;
86	int			ndis_altmem_rid;
87	struct resource		*ndis_res_am;	/* attribute mem (pccard) */
88	struct resource		*ndis_res_cm;	/* common mem (pccard) */
89	int			ndis_rescnt;
90	struct mtx		*ndis_mtx;
91	struct mtx		*ndis_intrmtx;
92	device_t		ndis_dev;
93	int			ndis_unit;
94	ndis_miniport_block	ndis_block;
95	ndis_miniport_characteristics	ndis_chars;
96	interface_type		ndis_type;
97	struct callout_handle	ndis_stat_ch;
98	int			ndis_maxpkts;
99	ndis_oid		*ndis_oids;
100	int			ndis_oidcnt;
101	int			ndis_txidx;
102	int			ndis_txpending;
103	ndis_packet		**ndis_txarray;
104	int			ndis_sc;
105	ndis_cfg		*ndis_regvals;
106	struct nch		ndis_cfglist_head;
107	int			ndis_80211;
108	int			ndis_link;
109	uint32_t		ndis_filter;
110	int			ndis_if_flags;
111	int			ndis_skip;
112
113	struct sysctl_ctx_list	ndis_ctx;
114	struct sysctl_oid	*ndis_tree;
115	int			ndis_devidx;
116	interface_type		ndis_iftype;
117
118	bus_dma_tag_t		ndis_parent_tag;
119	struct ndis_shmem	*ndis_shlist;
120	bus_dma_tag_t		ndis_mtag;
121	bus_dma_tag_t		ndis_ttag;
122	bus_dmamap_t		*ndis_mmaps;
123	bus_dmamap_t		*ndis_tmaps;
124	int			ndis_mmapcnt;
125};
126
127#define NDIS_LOCK(_sc)		mtx_pool_lock(ndis_mtxpool, (_sc)->ndis_mtx)
128#define NDIS_UNLOCK(_sc)	mtx_pool_unlock(ndis_mtxpool, (_sc)->ndis_mtx)
129
130