Home | History | Annotate | Line # | Download | only in pci
if_ipwvar.h revision 1.2.2.4
      1  1.2.2.4  skrll /*	$NetBSD: if_ipwvar.h,v 1.2.2.4 2004/09/21 13:31:03 skrll Exp $	*/
      2  1.2.2.2  skrll 
      3  1.2.2.2  skrll /*-
      4  1.2.2.2  skrll  * Copyright (c) 2004
      5  1.2.2.2  skrll  *      Damien Bergamini <damien.bergamini (at) free.fr>. All rights reserved.
      6  1.2.2.2  skrll  *
      7  1.2.2.2  skrll  * Redistribution and use in source and binary forms, with or without
      8  1.2.2.2  skrll  * modification, are permitted provided that the following conditions
      9  1.2.2.2  skrll  * are met:
     10  1.2.2.2  skrll  * 1. Redistributions of source code must retain the above copyright
     11  1.2.2.2  skrll  *    notice unmodified, this list of conditions, and the following
     12  1.2.2.2  skrll  *    disclaimer.
     13  1.2.2.2  skrll  * 2. Redistributions in binary form must reproduce the above copyright
     14  1.2.2.2  skrll  *    notice, this list of conditions and the following disclaimer in the
     15  1.2.2.2  skrll  *    documentation and/or other materials provided with the distribution.
     16  1.2.2.2  skrll  *
     17  1.2.2.2  skrll  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     18  1.2.2.2  skrll  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     19  1.2.2.2  skrll  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     20  1.2.2.2  skrll  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     21  1.2.2.2  skrll  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     22  1.2.2.2  skrll  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     23  1.2.2.2  skrll  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     24  1.2.2.2  skrll  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     25  1.2.2.2  skrll  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     26  1.2.2.2  skrll  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     27  1.2.2.2  skrll  * SUCH DAMAGE.
     28  1.2.2.2  skrll  */
     29  1.2.2.2  skrll 
     30  1.2.2.2  skrll struct ipw_soft_bd {
     31  1.2.2.2  skrll 	struct ipw_bd	*bd;
     32  1.2.2.2  skrll 	int		type;
     33  1.2.2.2  skrll #define IPW_SBD_TYPE_NOASSOC	0
     34  1.2.2.2  skrll #define IPW_SBD_TYPE_COMMAND	1
     35  1.2.2.2  skrll #define IPW_SBD_TYPE_HEADER	2
     36  1.2.2.2  skrll #define IPW_SBD_TYPE_DATA	3
     37  1.2.2.2  skrll 	void		*priv;
     38  1.2.2.2  skrll };
     39  1.2.2.2  skrll 
     40  1.2.2.2  skrll struct ipw_soft_hdr {
     41  1.2.2.2  skrll 	struct ipw_hdr			hdr;
     42  1.2.2.2  skrll 	bus_dmamap_t			map;
     43  1.2.2.2  skrll 	TAILQ_ENTRY(ipw_soft_hdr)	next;
     44  1.2.2.2  skrll };
     45  1.2.2.2  skrll 
     46  1.2.2.2  skrll struct ipw_soft_buf {
     47  1.2.2.2  skrll 	struct mbuf			*m;
     48  1.2.2.2  skrll 	struct ieee80211_node		*ni;
     49  1.2.2.2  skrll 	bus_dmamap_t			map;
     50  1.2.2.2  skrll 	TAILQ_ENTRY(ipw_soft_buf)	next;
     51  1.2.2.2  skrll };
     52  1.2.2.2  skrll 
     53  1.2.2.3  skrll struct ipw_rx_radiotap_header {
     54  1.2.2.3  skrll 	struct ieee80211_radiotap_header wr_ihdr;
     55  1.2.2.3  skrll 	u_int8_t	wr_flags;
     56  1.2.2.3  skrll 	u_int16_t	wr_chan_freq;
     57  1.2.2.3  skrll 	u_int16_t	wr_chan_flags;
     58  1.2.2.3  skrll 	u_int8_t	wr_antsignal;
     59  1.2.2.3  skrll };
     60  1.2.2.3  skrll 
     61  1.2.2.3  skrll #define IPW_RX_RADIOTAP_PRESENT						\
     62  1.2.2.3  skrll 	((1 << IEEE80211_RADIOTAP_FLAGS) |				\
     63  1.2.2.3  skrll 	 (1 << IEEE80211_RADIOTAP_CHANNEL) |				\
     64  1.2.2.3  skrll 	 (1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL))
     65  1.2.2.3  skrll 
     66  1.2.2.3  skrll struct ipw_tx_radiotap_header {
     67  1.2.2.3  skrll 	struct ieee80211_radiotap_header wt_ihdr;
     68  1.2.2.3  skrll 	u_int8_t	wt_flags;
     69  1.2.2.3  skrll 	u_int16_t	wt_chan_freq;
     70  1.2.2.3  skrll 	u_int16_t	wt_chan_flags;
     71  1.2.2.3  skrll };
     72  1.2.2.3  skrll 
     73  1.2.2.3  skrll #define IPW_TX_RADIOTAP_PRESENT						\
     74  1.2.2.3  skrll 	((1 << IEEE80211_RADIOTAP_FLAGS) |				\
     75  1.2.2.3  skrll 	 (1 << IEEE80211_RADIOTAP_CHANNEL))
     76  1.2.2.3  skrll 
     77  1.2.2.2  skrll struct ipw_softc {
     78  1.2.2.2  skrll 	struct device			sc_dev;
     79  1.2.2.2  skrll 
     80  1.2.2.3  skrll 	struct ieee80211com		sc_ic;
     81  1.2.2.2  skrll 	int				(*sc_newstate)(struct ieee80211com *,
     82  1.2.2.2  skrll 					    enum ieee80211_state, int);
     83  1.2.2.2  skrll 
     84  1.2.2.2  skrll 	u_int32_t			flags;
     85  1.2.2.2  skrll #define IPW_FLAG_FW_INITED	(1 << 0)
     86  1.2.2.2  skrll 
     87  1.2.2.2  skrll 	struct resource			*irq;
     88  1.2.2.2  skrll 	struct resource			*mem;
     89  1.2.2.2  skrll 	bus_space_tag_t			sc_st;
     90  1.2.2.2  skrll 	bus_space_handle_t		sc_sh;
     91  1.2.2.3  skrll 	void				*sc_ih;
     92  1.2.2.2  skrll 	pci_chipset_tag_t		sc_pct;
     93  1.2.2.2  skrll 	bus_size_t			sc_sz;
     94  1.2.2.2  skrll 
     95  1.2.2.2  skrll 	int				sc_tx_timer;
     96  1.2.2.2  skrll 
     97  1.2.2.2  skrll 	bus_dma_tag_t			sc_dmat;
     98  1.2.2.2  skrll 
     99  1.2.2.2  skrll 	bus_dmamap_t			tbd_map;
    100  1.2.2.2  skrll 	bus_dmamap_t			rbd_map;
    101  1.2.2.2  skrll 	bus_dmamap_t			status_map;
    102  1.2.2.2  skrll 	bus_dmamap_t			cmd_map;
    103  1.2.2.2  skrll 
    104  1.2.2.2  skrll 	bus_dma_segment_t		tbd_seg;
    105  1.2.2.2  skrll 	bus_dma_segment_t		rbd_seg;
    106  1.2.2.2  skrll 	bus_dma_segment_t		status_seg;
    107  1.2.2.2  skrll 	bus_dma_segment_t		cmd_seg;
    108  1.2.2.2  skrll 
    109  1.2.2.2  skrll 	struct ipw_bd			*tbd_list;
    110  1.2.2.2  skrll 	struct ipw_bd			*rbd_list;
    111  1.2.2.2  skrll 	struct ipw_status		*status_list;
    112  1.2.2.2  skrll 
    113  1.2.2.2  skrll 	struct ipw_cmd			*cmd;
    114  1.2.2.2  skrll 	struct ipw_soft_bd		*stbd_list;
    115  1.2.2.2  skrll 	struct ipw_soft_bd		*srbd_list;
    116  1.2.2.2  skrll 	struct ipw_soft_hdr		*shdr_list;
    117  1.2.2.2  skrll 	struct ipw_soft_buf		*tx_sbuf_list;
    118  1.2.2.2  skrll 	struct ipw_soft_buf		*rx_sbuf_list;
    119  1.2.2.2  skrll 
    120  1.2.2.2  skrll 	TAILQ_HEAD(, ipw_soft_hdr)	sc_free_shdr;
    121  1.2.2.2  skrll 	TAILQ_HEAD(, ipw_soft_buf)	sc_free_sbuf;
    122  1.2.2.2  skrll 
    123  1.2.2.2  skrll 	u_int32_t			table1_base;
    124  1.2.2.2  skrll 	u_int32_t			table2_base;
    125  1.2.2.2  skrll 
    126  1.2.2.2  skrll 	u_int32_t			txcur;
    127  1.2.2.2  skrll 	u_int32_t			txold;
    128  1.2.2.2  skrll 	u_int32_t			rxcur;
    129  1.2.2.3  skrll 
    130  1.2.2.3  skrll #if NBPFILTER > 0
    131  1.2.2.3  skrll 	struct bpf_if			*sc_drvbpf;
    132  1.2.2.3  skrll 
    133  1.2.2.3  skrll 	union {
    134  1.2.2.3  skrll 		struct ipw_rx_radiotap_header th;
    135  1.2.2.3  skrll 		u_int8_t	pad[64];
    136  1.2.2.3  skrll 	} sc_rxtapu;
    137  1.2.2.3  skrll #define sc_rxtap	sc_rxtapu.th
    138  1.2.2.3  skrll 	int				sc_rxtap_len;
    139  1.2.2.3  skrll 
    140  1.2.2.3  skrll 	union {
    141  1.2.2.3  skrll 		struct ipw_tx_radiotap_header th;
    142  1.2.2.3  skrll 		u_int8_t	pad[64];
    143  1.2.2.3  skrll 	} sc_txtapu;
    144  1.2.2.3  skrll #define sc_txtap	sc_txtapu.th
    145  1.2.2.3  skrll 	int				sc_txtap_len;
    146  1.2.2.3  skrll #endif
    147  1.2.2.2  skrll };
    148  1.2.2.2  skrll 
    149  1.2.2.2  skrll #define SIOCSLOADFW	 _IOW('i', 137, struct ifreq)
    150  1.2.2.2  skrll #define SIOCSKILLFW	 _IOW('i', 138, struct ifreq)
    151  1.2.2.2  skrll #define SIOCGRADIO	_IOWR('i', 139, struct ifreq)
    152  1.2.2.2  skrll #define SIOCGTABLE1	_IOWR('i', 140, struct ifreq)
    153