ieee80211_proto.h revision 119150
1139825Simp/*-
286227Stmm * Copyright (c) 2001 Atsushi Onoe
3128776Stmm * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
4167308Smarius * All rights reserved.
5128776Stmm *
686227Stmm * Redistribution and use in source and binary forms, with or without
786227Stmm * modification, are permitted provided that the following conditions
886227Stmm * are met:
986227Stmm * 1. Redistributions of source code must retain the above copyright
1086227Stmm *    notice, this list of conditions and the following disclaimer.
1186227Stmm * 2. Redistributions in binary form must reproduce the above copyright
1286227Stmm *    notice, this list of conditions and the following disclaimer in the
1386227Stmm *    documentation and/or other materials provided with the distribution.
1486227Stmm * 3. The name of the author may not be used to endorse or promote products
1586227Stmm *    derived from this software without specific prior written permission.
1686227Stmm *
1786227Stmm * Alternatively, this software may be distributed under the terms of the
18128776Stmm * GNU General Public License ("GPL") version 2 as published by the Free
1986227Stmm * Software Foundation.
2086227Stmm *
2186227Stmm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
2286227Stmm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2386227Stmm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2486227Stmm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2586227Stmm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2686227Stmm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2786227Stmm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2886227Stmm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2986227Stmm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
3086227Stmm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3186227Stmm *
3286227Stmm * $FreeBSD: head/sys/net80211/ieee80211_proto.h 119150 2003-08-19 22:17:04Z sam $
3386227Stmm */
3486227Stmm#ifndef _NET80211_IEEE80211_PROTO_H_
35146474Smarius#define _NET80211_IEEE80211_PROTO_H_
36146474Smarius
37146474Smarius/*
3886227Stmm * 802.11 protocol implementation definitions.
3986227Stmm */
4086227Stmm
4186227Stmmenum ieee80211_state {
4286227Stmm	IEEE80211_S_INIT	= 0,	/* default state */
43130068Sphk	IEEE80211_S_SCAN	= 1,	/* scanning */
44204152Smarius	IEEE80211_S_AUTH	= 2,	/* try to authenticate */
4586227Stmm	IEEE80211_S_ASSOC	= 3,	/* try to assoc */
46167308Smarius	IEEE80211_S_RUN		= 4,	/* associated */
47167308Smarius};
4886227Stmm#define	IEEE80211_S_MAX		(IEEE80211_S_RUN+1)
4986227Stmm
5086227Stmm#define	IEEE80211_SEND_MGMT(_ic,_ni,_type,_arg) \
51167308Smarius	((*(_ic)->ic_send_mgmt)(_ic, _ni, _type, _arg))
5286227Stmm
53203844Smariusextern	const char *ieee80211_mgt_subtype_name[];
54167308Smarius
5586227Stmmextern	void ieee80211_proto_attach(struct ifnet *);
56167308Smariusextern	void ieee80211_proto_detach(struct ifnet *);
5786227Stmm
5886227Stmmstruct ieee80211_node;
5986227Stmmextern	void ieee80211_input(struct ifnet *, struct mbuf *,
6086227Stmm		struct ieee80211_node *, int, u_int32_t);
6186227Stmmextern	void ieee80211_recv_mgmt(struct ieee80211com *, struct mbuf *,
62133862Smarius		struct ieee80211_node *, int, int, u_int32_t);
6386227Stmmextern	int ieee80211_send_mgmt(struct ieee80211com *, struct ieee80211_node *,
64128776Stmm		int, int);
6586227Stmmextern	struct mbuf *ieee80211_encap(struct ifnet *, struct mbuf *,
6686227Stmm		struct ieee80211_node **);
6786227Stmmextern	struct mbuf *ieee80211_decap(struct ifnet *, struct mbuf *);
6886227Stmmextern	u_int8_t *ieee80211_add_rates(u_int8_t *frm,
6986227Stmm		const struct ieee80211_rateset *);
70133862Smarius#define	ieee80211_new_state(_ic, _nstate, _arg) \
7186227Stmm	(((_ic)->ic_newstate)((_ic), (_nstate), (_arg)))
7286227Stmmextern	u_int8_t *ieee80211_add_xrates(u_int8_t *frm,
7386227Stmm		const struct ieee80211_rateset *);
74167308Smariusextern	void ieee80211_print_essid(u_int8_t *, int);
75167308Smariusextern	void ieee80211_dump_pkt(u_int8_t *, int, int, int);
7686227Stmm
7786227Stmmextern	const char *ieee80211_state_name[IEEE80211_S_MAX];
7888823Stmm#endif /* _NET80211_IEEE80211_PROTO_H_ */
7988823Stmm