Home | History | Annotate | Line # | Download | only in ic
wivar.h revision 1.20
      1 /*	$NetBSD: wivar.h,v 1.20 2002/09/30 06:29:30 onoe Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1997, 1998, 1999
      5  *	Bill Paul <wpaul (at) ctr.columbia.edu>.  All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed by Bill Paul.
     18  * 4. Neither the name of the author nor the names of any co-contributors
     19  *    may be used to endorse or promote products derived from this software
     20  *    without specific prior written permission.
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
     23  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
     26  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     32  * THE POSSIBILITY OF SUCH DAMAGE.
     33  */
     34 
     35 /*
     36  * FreeBSD driver ported to NetBSD by Bill Sommerfeld in the back of the
     37  * Oslo IETF plenary meeting.
     38  */
     39 
     40 #include <dev/ic/wi_hostap.h>
     41 
     42 struct wi_softc	{
     43 	struct device		sc_dev;
     44 	struct ethercom		sc_ethercom;
     45 	void			*sc_ih; /* interrupt handler */
     46 	int			(*sc_enable) __P((struct wi_softc *));
     47 	void			(*sc_disable) __P((struct wi_softc *));
     48 
     49 	int sc_attached;
     50 	int sc_enabled;
     51 	int sc_firmware_type;
     52 #define	WI_NOTYPE	0
     53 #define	WI_LUCENT	1
     54 #define	WI_INTERSIL	2
     55 #define	WI_SYMBOL	3
     56 	int sc_pri_firmware_ver;	/* Primary firmware version */
     57 	int sc_sta_firmware_ver;	/* Station firmware version */
     58 	int sc_pci;			/* attach to PCI-Bus */
     59 
     60 	bus_space_tag_t		sc_iot;	/* bus cookie */
     61 	bus_space_handle_t	sc_ioh; /* bus i/o handle */
     62 
     63 	struct callout		wi_inquire_ch;
     64 	struct callout		wi_scan_sh;
     65 
     66 	u_int8_t		sc_macaddr[ETHER_ADDR_LEN];
     67 
     68 	u_int16_t		wi_txbuf[(sizeof(struct wi_frame) + 2312) / 2];
     69 
     70 	struct ifmedia		sc_media;
     71 	int			wi_flags;
     72 	int			wi_tx_data_id;
     73 	int			wi_tx_mgmt_id;
     74 	int			wi_if_flags;
     75 	u_int16_t		wi_ptype;
     76 	u_int16_t		wi_portnum;
     77 	u_int16_t		wi_max_data_len;
     78 	u_int16_t		wi_rts_thresh;
     79 	u_int16_t		wi_ap_density;
     80 	u_int16_t		wi_tx_rate;
     81 	u_int16_t		wi_create_ibss;
     82 	u_int16_t		wi_channels;
     83 	u_int16_t		wi_pm_enabled;
     84 	u_int16_t		wi_mor_enabled;
     85 	u_int16_t		wi_max_sleep;
     86 	u_int16_t		wi_authtype;
     87 	u_int16_t		wi_roaming;
     88 	u_int16_t		wi_supprates;
     89 
     90 	struct ieee80211_nwid	wi_nodeid;
     91 	struct ieee80211_nwid	wi_netid;
     92 	struct ieee80211_nwid	wi_ibssid;
     93 
     94 	int                     wi_use_wep;
     95 	int			wi_do_host_encrypt;
     96 	int                     wi_tx_key;
     97 	struct wi_ltv_keys      wi_keys;
     98 	struct wi_counters	wi_stats;
     99 	u_int16_t		wi_ibss_port;
    100 
    101 	u_int8_t		wi_current_bssid[IEEE80211_ADDR_LEN];
    102 	u_int16_t		wi_current_channel; /* current BSS channel */
    103 
    104 	u_int8_t		wi_join_bssid[IEEE80211_ADDR_LEN];
    105 	u_int16_t		wi_join_channel; /* channel of BSS to join */
    106 
    107 	u_int16_t		wi_create_channel;/* channel of BSS to create */
    108 
    109 	struct wi_apinfo	wi_aps[MAXAPINFO];
    110 	int 			wi_naps;
    111 	int			wi_scanning;	/* scan mode */
    112 
    113 	struct wihap_info	wi_hostap_info;
    114 	u_int32_t		wi_icv;
    115 	int			wi_icv_flag;
    116 
    117 	caddr_t			sc_bpf80211;
    118 	caddr_t			sc_bpf80211plus;
    119 };
    120 
    121 #define	sc_if			sc_ethercom.ec_if
    122 
    123 /* Values for wi_flags. */
    124 #define	WI_FLAGS_ATTACHED		0x0001
    125 #define	WI_FLAGS_INITIALIZED		0x0002
    126 #define	WI_FLAGS_HAS_WEP		0x0004
    127 #define	WI_FLAGS_HAS_IBSS		0x0008
    128 #define	WI_FLAGS_HAS_CREATE_IBSS	0x0010
    129 #define	WI_FLAGS_HAS_MOR		0x0020
    130 #define	WI_FLAGS_HAS_ROAMING		0x0040
    131 #define	WI_FLAGS_HAS_DIVERSITY		0x0080
    132 #define	WI_FLAGS_HAS_HOSTAP		0x0100
    133 #define	WI_FLAGS_CONNECTED		0x0200
    134 #define	WI_FLAGS_AP_IN_RANGE		0x0400
    135 #define	WI_FLAGS_JOINING		0x0800
    136 
    137 struct wi_card_ident {
    138 	u_int16_t	card_id;
    139 	char		*card_name;
    140 	u_int8_t	firm_type;
    141 };
    142 
    143 int	wi_attach __P((struct wi_softc *));
    144 int	wi_detach __P((struct wi_softc *));
    145 int	wi_activate __P((struct device *, enum devact));
    146 int	wi_intr __P((void *arg));
    147 void	wi_power __P((struct wi_softc *, int));
    148 void	wi_shutdown __P((struct wi_softc *));
    149 
    150 int	wi_mgmt_xmit(struct wi_softc *, caddr_t, int);
    151