xref: /freebsd/share/man/man9/ieee80211_output.9 (revision d37ea99837e6ad50837fd9fe1771ddf1c3ba6002)
1.\"
2.\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org>
3.\" Copyright (c) 2004 Darron Broad <darron@kewl.org>
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD$
28.\" $Id: ieee80211_output.9,v 1.5 2004/03/04 12:31:18 bruce Exp $
29.\"
30.Dd March 2, 2004
31.Dt ieee80211_output 9
32.Os
33.Sh NAME
34.Nm ieee80211_output
35.Nd software 802.11 stack output functions
36.Sh SYNOPSIS
37.In net80211/ieee80211_var.h
38.In net80211/ieee80211_proto.h
39.Ft struct mbuf *
40.Fn ieee80211_encap "struct ifnet *ifp" "struct mbuf *m" "struct ieee80211_node **pni"
41.Ft u_int8_t *
42.Fn ieee80211_add_rates "u_int8_t *frm" "const struct ieee80211_rateset *rs"
43.Ft u_int8_t *
44.Fn ieee80211_add_xrates "u_int8_t *frm" "const struct ieee80211_rateset *rs"
45.Ft int
46.Fn ieee80211_send_mgmt "struct ieee80211com *ic" "struct ieee80211_node *ni" "int type" "int arg"
47.Sh DESCRIPTION
48The
49.Nm
50series of functions handle the encapsulation and transmission of 802.11 frames
51within the software 802.11 stack.
52.Pp
53The
54.Fn ieee80211_encap
55function encapsulates an outbound data frame contained within the
56mbuf chain
57.Fa m
58from the interface
59.Fa ifp .
60The argument
61.Fa *pni
62is a reference to the destination node.
63.Pp
64If the function is successful, the mbuf chain is updated with the
65802.11 frame header prepended, and a pointer to the head of the chain
66is returned.
67If an error occurs, NULL will be returned, and
68.Fa *pni
69is also set to NULL.
70The caller is responsible for freeing the node reference if
71.Fa *pni
72is non-NULL on return.
73The convention is that
74.Vt ic_bss
75is not reference counted; the caller is responsible for maintaining this
76reference count.
77.Pp
78.\"
79The
80.Fn ieee80211_add_rates
81utility function is used to add the rate set element
82.Fa *rs
83to the frame
84.Fa frm .
85A pointer to the location in the buffer after the addition of the rate set
86is returned.
87It is typically used when constructing management frames from within the
88software 802.11 stack.
89.Pp
90.\"
91The
92.Fn ieee80211_add_xrates
93utility function is used to add the extended rate set element
94.Fa *rs
95to the frame
96.Fa frm .
97A pointer to the location in the buffer after the addition of the rate set
98is returned.
99It is typically used when constructing management frames from within the
100software 802.11 stack in 802.11g mode.
101.Pp
102.\"
103The
104.Fn ieee80211_send_mgmt
105function transmits a management frame on the interface
106.Fa ic
107to the destination node
108.Fa ni
109of type
110.Fa type .
111.Pp
112The argument
113.Fa arg
114specifies either a sequence number for authentication operations,
115a status code for [re]association operations,
116or a reason for deauthentication and deassociation operations.
117.Pp
118Nodes other than
119.Vt ic_bss
120have their reference count incremented to reflect their use for an
121indeterminate amount of time.
122This reference is freed when the function returns.
123.Pp
124The function returns 0 if successful; if temporary buffer space is not
125available, the function returns
126.Er ENOMEM .
127.\"
128.Sh SEE ALSO
129.Xr ieee80211 9 ,
130.Xr ifnet 9
131.Sh HISTORY
132The
133.Nm
134series of functions first appeared in
135.Nx 1.5 ,
136and were later ported to
137.Fx 4.6 .
138.Sh AUTHORS
139This man page was written by
140.An Bruce M. Simpson Aq bms@FreeBSD.org
141and
142.An Darron Broad Aq darron@kewl.org .
143