]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/dev/if_ndis/if_ndisvar.h
This commit was generated by cvs2svn to compensate for changes in r147462,
[FreeBSD/FreeBSD.git] / sys / dev / if_ndis / if_ndisvar.h
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$
33  */
34
35 #define NDIS_DEFAULT_NODENAME   "FreeBSD NDIS node"
36 #define NDIS_NODENAME_LEN       32
37
38 struct ndis_pci_type {
39         uint16_t                ndis_vid;
40         uint16_t                ndis_did;
41         uint32_t                ndis_subsys;
42         char                    *ndis_name;
43 };
44
45 struct ndis_pccard_type {
46         const char              *ndis_vid;
47         const char              *ndis_did;
48         char                    *ndis_name;
49 };
50
51 struct ndis_shmem {
52         bus_dma_tag_t           ndis_stag;
53         bus_dmamap_t            ndis_smap;
54         void                    *ndis_saddr;
55         ndis_physaddr           ndis_paddr;
56         struct ndis_shmem       *ndis_next;
57 };
58
59 struct ndis_cfglist {
60         ndis_cfg                ndis_cfg;
61         TAILQ_ENTRY(ndis_cfglist)       link;
62 };
63
64 TAILQ_HEAD(nch, ndis_cfglist);
65
66 #define NDIS_INITIALIZED(sc)    (sc->ndis_block->nmb_miniportadapterctx != NULL)
67
68 #define NDIS_INC(x)             \
69         (x)->ndis_txidx = ((x)->ndis_txidx + 1) % (x)->ndis_maxpkts 
70
71 struct ndis_softc {
72         struct ifnet            *ifp;
73         struct ieee80211com     ic;             /* interface info */
74         struct ifmedia          ifmedia;        /* media info */
75         u_long                  ndis_hwassist;
76         uint32_t                ndis_v4tx;
77         uint32_t                ndis_v4rx;
78         bus_space_handle_t      ndis_bhandle;
79         bus_space_tag_t         ndis_btag;
80         void                    *ndis_intrhand;
81         struct resource         *ndis_irq;
82         struct resource         *ndis_res;
83         struct resource         *ndis_res_io;
84         int                     ndis_io_rid;
85         struct resource         *ndis_res_mem;
86         int                     ndis_mem_rid;
87         struct resource         *ndis_res_altmem;
88         int                     ndis_altmem_rid;
89         struct resource         *ndis_res_am;   /* attribute mem (pccard) */
90         int                     ndis_am_rid;
91         struct resource         *ndis_res_cm;   /* common mem (pccard) */
92         struct resource_list    ndis_rl;
93         int                     ndis_rescnt;
94         struct mtx              ndis_mtx;
95         device_t                ndis_dev;
96         int                     ndis_unit;
97         ndis_miniport_block     *ndis_block;
98         ndis_miniport_characteristics   *ndis_chars;
99         interface_type          ndis_type;
100         struct callout_handle   ndis_stat_ch;
101         int                     ndis_maxpkts;
102         ndis_oid                *ndis_oids;
103         int                     ndis_oidcnt;
104         int                     ndis_txidx;
105         int                     ndis_txpending;
106         ndis_packet             **ndis_txarray;
107         ndis_handle             ndis_txpool;
108         int                     ndis_sc;
109         ndis_cfg                *ndis_regvals;
110         struct nch              ndis_cfglist_head;
111         int                     ndis_80211;
112         int                     ndis_link;
113         uint32_t                ndis_filter;
114         int                     ndis_if_flags;
115         int                     ndis_skip;
116
117 #if __FreeBSD_version < 502113
118         struct sysctl_ctx_list  ndis_ctx;
119         struct sysctl_oid       *ndis_tree;
120 #endif
121         int                     ndis_devidx;
122         interface_type          ndis_iftype;
123         driver_object           *ndis_dobj;
124         ndis_work_item          ndis_tickitem;
125         ndis_work_item          ndis_startitem;
126         ndis_work_item          ndis_resetitem;
127         kdpc                    ndis_rxdpc;
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;
134         int                     ndis_mmapcnt;
135 };
136
137 #define NDIS_LOCK(_sc)          mtx_lock(&(_sc)->ndis_mtx)
138 #define NDIS_UNLOCK(_sc)        mtx_unlock(&(_sc)->ndis_mtx)