if_ndisvar.h revision 123695
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 123695 2003-12-21 00:00:08Z wpaul $ 33123474Swpaul */ 34123474Swpaul 35123474Swpaul#define NDIS_PCI_LOIO 0x10 36123474Swpaul#define NDIS_PCI_LOMEM 0x14 37123474Swpaul 38123474Swpaul 39123474Swpaulstruct ndis_chain_onefrag { 40123474Swpaul void *dummy; 41123474Swpaul}; 42123474Swpaul 43123474Swpaulstruct ndis_chain { 44123474Swpaul void *dummy; 45123474Swpaul}; 46123474Swpaul 47123474Swpaulstruct ndis_type { 48123474Swpaul uint16_t ndis_vid; 49123474Swpaul uint16_t ndis_did; 50123620Swpaul uint32_t ndis_subsys; 51123474Swpaul char *ndis_name; 52123474Swpaul}; 53123474Swpaul 54123474Swpaulstruct ndis_shmem { 55123474Swpaul bus_dma_tag_t ndis_stag; 56123474Swpaul bus_dmamap_t ndis_smap; 57123474Swpaul void *ndis_saddr; 58123474Swpaul struct ndis_shmem *ndis_next; 59123474Swpaul}; 60123474Swpaul 61123474Swpaulstruct ndis_cfglist { 62123474Swpaul ndis_cfg ndis_cfg; 63123474Swpaul TAILQ_ENTRY(ndis_cfglist) link; 64123474Swpaul}; 65123474Swpaul 66123474SwpaulTAILQ_HEAD(nch, ndis_cfglist); 67123474Swpaul 68123474Swpaul#define NDIS_INC(x) \ 69123474Swpaul (x)->ndis_txidx = ((x)->ndis_txidx + 1) % (x)->ndis_maxpkts 70123474Swpaul 71123695Swpaul#define arpcom ic.ic_ac 72123695Swpaul 73123474Swpaulstruct ndis_softc { 74123695Swpaul struct ieee80211com ic; /* interface info */ 75123695Swpaul#ifdef notdef 76123695Swpaul struct ieee80211com arpcom; /* interface info */ 77123695Swpaul#endif 78123474Swpaul struct ifmedia ifmedia; /* media info */ 79123474Swpaul bus_space_handle_t ndis_bhandle; 80123474Swpaul bus_space_tag_t ndis_btag; 81123474Swpaul void *ndis_intrhand; 82123474Swpaul struct resource *ndis_irq; 83123474Swpaul struct resource *ndis_res; 84123474Swpaul struct resource *ndis_res_io; 85123474Swpaul int ndis_io_rid; 86123474Swpaul struct resource *ndis_res_mem; 87123474Swpaul int ndis_mem_rid; 88123474Swpaul struct resource *ndis_res_altmem; 89123474Swpaul int ndis_altmem_rid; 90123474Swpaul struct resource *ndis_res_am; /* attribute mem (pccard) */ 91123474Swpaul struct resource *ndis_res_cm; /* common mem (pccard) */ 92123474Swpaul int ndis_rescnt; 93123474Swpaul struct mtx ndis_mtx; 94123474Swpaul device_t ndis_dev; 95123474Swpaul int ndis_unit; 96123474Swpaul ndis_miniport_block ndis_block; 97123474Swpaul ndis_miniport_characteristics ndis_chars; 98123474Swpaul interface_type ndis_type; 99123474Swpaul struct callout_handle ndis_stat_ch; 100123474Swpaul int ndis_maxpkts; 101123474Swpaul ndis_oid *ndis_oids; 102123474Swpaul int ndis_oidcnt; 103123474Swpaul int ndis_txidx; 104123474Swpaul int ndis_txpending; 105123474Swpaul ndis_packet **ndis_txarray; 106123474Swpaul int ndis_sc; 107123474Swpaul ndis_cfg *ndis_regvals; 108123474Swpaul struct nch ndis_cfglist_head; 109123695Swpaul int ndis_80211; 110123695Swpaul int ndis_link; 111123695Swpaul uint32_t ndis_filter; 112123695Swpaul int ndis_if_flags; 113123474Swpaul 114123474Swpaul struct sysctl_ctx_list ndis_ctx; 115123474Swpaul struct sysctl_oid *ndis_tree; 116123620Swpaul int ndis_devidx; 117123474Swpaul interface_type ndis_iftype; 118123474Swpaul 119123474Swpaul bus_dma_tag_t ndis_parent_tag; 120123474Swpaul struct ndis_shmem *ndis_shlist; 121123474Swpaul bus_dma_tag_t ndis_mtag; 122123474Swpaul bus_dma_tag_t ndis_ttag; 123123474Swpaul bus_dmamap_t *ndis_mmaps; 124123474Swpaul bus_dmamap_t *ndis_tmaps; 125123474Swpaul int ndis_mmapcnt; 126123474Swpaul}; 127123474Swpaul 128123474Swpaul#define NDIS_LOCK(_sc) mtx_lock(&(_sc)->ndis_mtx) 129123474Swpaul#define NDIS_UNLOCK(_sc) mtx_unlock(&(_sc)->ndis_mtx) 130123474Swpaul 131