Pull in a number of fixes from FreeBSD to fix at least the worst
[dragonfly.git] / share / man / man9 / ieee80211_output.9
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 .\" $DragonFly: src/share/man/man9/ieee80211_output.9,v 1.2 2005/08/05 22:35:10 swildner Exp $
29 .\" $Id: ieee80211_output.9,v 1.2 2004/07/07 12:59:39 ru Exp $
30 .\"
31 .Dd March 2, 2004
32 .Dt IEEE80211_OUTPUT 9
33 .Os
34 .Sh NAME
35 .Nm ieee80211_encap ,
36 .Nm ieee80211_add_rates ,
37 .Nm ieee80211_add_xrates ,
38 .Nm ieee80211_send_mgmt
39 .Nd software 802.11 stack output functions
40 .Sh SYNOPSIS
41 .In net80211/ieee80211_var.h
42 .In net80211/ieee80211_proto.h
43 .Ft struct mbuf *
44 .Fo ieee80211_encap
45 .Fa "struct ifnet *ifp" "struct mbuf *m" "struct ieee80211_node **pni"
46 .Fc
47 .Ft u_int8_t *
48 .Fn ieee80211_add_rates "u_int8_t *frm" "const struct ieee80211_rateset *rs"
49 .Ft u_int8_t *
50 .Fn ieee80211_add_xrates "u_int8_t *frm" "const struct ieee80211_rateset *rs"
51 .Ft int
52 .Fo ieee80211_send_mgmt
53 .Fa "struct ieee80211com *ic" "struct ieee80211_node *ni" "int type" "int arg"
54 .Fc
55 .Sh DESCRIPTION
56 These functions handle the encapsulation and transmission of 802.11 frames
57 within the software 802.11 stack.
58 .Pp
59 The
60 .Fn ieee80211_encap
61 function encapsulates an outbound data frame contained within the
62 mbuf chain
63 .Fa m
64 from the interface
65 .Fa ifp .
66 The argument
67 .Fa *pni
68 is a reference to the destination node.
69 .Pp
70 If the function is successful, the mbuf chain is updated with the
71 802.11 frame header prepended, and a pointer to the head of the chain
72 is returned.
73 If an error occurs,
74 .Dv NULL
75 will be returned, and
76 .Fa *pni
77 is also set to
78 .Dv NULL .
79 The caller is responsible for freeing the node reference if
80 .Fa *pni
81 is
82 .Pf non- Dv NULL
83 on return.
84 The convention is that
85 .Va ic_bss
86 is not reference counted; the caller is responsible for maintaining this
87 reference count.
88 .Pp
89 .\"
90 The
91 .Fn ieee80211_add_rates
92 utility function is used to add the rate set element
93 .Fa *rs
94 to the frame
95 .Fa frm .
96 A pointer to the location in the buffer after the addition of the rate set
97 is returned.
98 It is typically used when constructing management frames from within the
99 software 802.11 stack.
100 .Pp
101 .\"
102 The
103 .Fn ieee80211_add_xrates
104 utility function is used to add the extended rate set element
105 .Fa *rs
106 to the frame
107 .Fa frm .
108 A pointer to the location in the buffer after the addition of the rate set
109 is returned.
110 It is typically used when constructing management frames from within the
111 software 802.11 stack in 802.11g mode.
112 .Pp
113 .\"
114 The
115 .Fn ieee80211_send_mgmt
116 function transmits a management frame on the interface
117 .Fa ic
118 to the destination node
119 .Fa ni
120 of type
121 .Fa type .
122 .Pp
123 The argument
124 .Fa arg
125 specifies either a sequence number for authentication operations,
126 a status code for [re]association operations,
127 or a reason for deauthentication and deassociation operations.
128 .Pp
129 Nodes other than
130 .Va ic_bss
131 have their reference count incremented to reflect their use for an
132 indeterminate amount of time.
133 This reference is freed when the function returns.
134 .Pp
135 The function returns 0 if successful; if temporary buffer space is not
136 available, the function returns
137 .Er ENOMEM .
138 .\"
139 .Sh SEE ALSO
140 .Xr ieee80211 9 ,
141 .Xr ifnet 9
142 .Sh HISTORY
143 The
144 .Nm ieee80211
145 series of functions first appeared in
146 .Nx 1.5 ,
147 and were later ported to
148 .Fx 4.6 .
149 .Sh AUTHORS
150 .An -nosplit
151 This man page was written by
152 .An Bruce M. Simpson Aq bms@FreeBSD.org
153 and
154 .An Darron Broad Aq darron@kewl.org .