2 .\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org>
3 .\" Copyright (c) 2004 Darron Broad <darron@kewl.org>
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
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.
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
28 .\" $DragonFly: src/share/man/man9/ieee80211_node.9,v 1.5 2007/05/17 08:19:02 swildner Exp $
29 .\" $Id: ieee80211_node.9,v 1.3 2004/07/07 12:59:39 ru Exp $
35 .\" .Nm ieee80211_node_attach ,
36 .\" .Nm ieee80211_node_lateattach ,
37 .\" .Nm ieee80211_node_detach ,
38 .Nm ieee80211_begin_scan ,
39 .Nm ieee80211_create_ibss ,
40 .Nm ieee80211_next_scan ,
41 .Nm ieee80211_end_scan ,
42 .\" .Nm ieee80211_alloc_node ,
43 .\" .Nm ieee80211_dup_bss ,
44 .Nm ieee80211_find_txnode ,
45 .Nm ieee80211_find_rxnode ,
46 .Nm ieee80211_find_node ,
47 .Nm ieee80211_free_node ,
48 .\" .Nm ieee80211_free_allnodes ,
49 .Nm ieee80211_iterate_nodes
50 .Nd software 802.11 stack node management functions
52 .In netproto/802_11/ieee80211_var.h
53 .In netproto/802_11/ieee80211_proto.h
54 .In netproto/802_11/ieee80211_node.h
56 .\" .Fn ieee80211_node_attach "struct ieee80211com *ic"
58 .\" .Fn ieee80211_node_lateattach "struct ieee80211com *ic"
60 .\" .Fn ieee80211_node_detach "struct ieee80211com *ic"
62 .Fn ieee80211_begin_scan "struct ieee80211com *ic" "int reset"
64 .Fo ieee80211_create_ibss
65 .Fa "struct ieee80211com *ic" "struct ieee80211_channel *chan"
68 .Fn ieee80211_next_scan "struct ieee80211com *ic"
70 .Fn ieee80211_end_scan "struct ieee80211com *ic"
71 .\" .Ft struct ieee80211_node *
72 .\" .Fo ieee80211_alloc_node
73 .\" .Fa "struct ieee80211_node_table *nt" "const uint8_t *macaddr"
75 .\" .Ft struct ieee80211_node *
76 .\" .Fo ieee80211_dup_bss
77 .\" .Fa "struct ieee80211_node_table *nt" "const uint8_t *macaddr"
79 .Ft struct ieee80211_node *
80 .Fn ieee80211_find_txnode "struct ieee80211com *ic" "const uint8_t *macaddr"
81 .Ft struct ieee80211_node *
82 .Fo ieee80211_find_rxnode
83 .Fa "struct ieee80211com *ic" "const struct ieee80211_frame_min *wh"
85 .Ft struct ieee80211_node *
86 .Fo ieee80211_find_node
87 .Fa "struct ieee80211_node_table *nt" "const uint8_t *macaddr"
90 .Fn ieee80211_free_node "struct ieee80211_node *ni"
92 .\" .Fn ieee80211_free_allnodes "struct ieee80211_node_table *nt"
94 .Fo ieee80211_iterate_nodes
95 .Fa "struct ieee80211_node_table *nt" "ieee80211_iter_func *f" "void *arg"
98 These functions are used to manage node lists within the software
100 These lists are typically used for implementing host-mode AP functionality,
101 implementing transmission rate control algorithms,
102 or providing signal quality information about neighbouring nodes.
106 .\" .Fn ieee80211_node_attach
107 .\" function is called from
108 .\" .Xr ieee80211_ifattach 9
109 .\" to initialize node databases management callbacks and control variables
110 .\" for the interface
112 .\" (specifically for memory allocation,
114 .\" node signal inspection, and station inactivity timer).
118 .\" .Fn ieee80211_node_lateattach
119 .\" function initialises the
121 .\" crypto and authentication settings of
123 .\" associated with the interface
126 .\" .Xr ieee80211_media_init 9 .
130 .\" .Fn ieee80211_node_detach
131 .\" function destroys all node databases associated with the interface
136 .Fn ieee80211_begin_scan
137 function initialises the node databases in preparation of an active
138 scan for an access point on the interface
140 The scan begins on the next radio channel by calling
141 .Fn ieee80211_next_scan
145 is non-zero, the interface
149 which holds previously detected access points,
151 The actual scanning for an access point is not automated;
152 the device driver itself only handles setting the radio frequency
153 of the card and stepping through the channels.
157 .Fn ieee80211_create_ibss
158 function sets up the net80211-specific portion of an interface's softc
160 for use in IBSS mode or HOSTAP mode.
164 .Fn ieee80211_next_scan
165 function is used to inform the
167 layer that the interface
169 is now scanning for an access point on the next radio channel.
170 .\" XXX should call ieee80211_new_state(ic, IEEE80211_S_SCAN)
171 .\" XXX we may need a manpage to describe ieee80211_new_state()
172 .\" A device driver is expected to first call
173 .\" .Fn ieee80211_begin_scan ,
174 .\" to initialize the node database,
175 .\" then set the radio channel on the device;
176 .\" then, after a certain time has elapsed (200ms for example), call
177 .\" .Fn ieee80211_next_scan
178 .\" to move to the next channel.
179 .\" Typically, a callout is used to automate this process; see
180 .\" .Xr callout_init 9
181 .\" for more information on how to use callouts.
185 .Fn ieee80211_end_scan
186 function is called by
187 .Fn ieee80211_next_scan
188 when the state machine has performed a full cycle of scanning on
189 all available radio channels.
191 .Fn ieee80211_end_scan
192 will inspect the node table
196 for suitable access points found during scanning, and associate with one,
197 should the parameters of the node match those of the configuration
198 requested from userland.
202 .\" .Fn ieee80211_alloc_node
203 .\" function allocates an instance of
204 .\" .Vt "struct ieee80211_node"
205 .\" for a node having the MAC address
207 .\" and associates it with the node table
209 .\" If the allocation is successful, the node structure is initialised by
210 .\" .Fn ieee80211_setup_node ;
217 .\" .Fn ieee80211_dup_bss
218 .\" function is similar to
219 .\" .Fn ieee80211_alloc_node ,
220 .\" but is instead used to create a node database entry for the BSSID
222 .\" associated with the node table
224 .\" If the allocation is successful, the node structure is initialised by
225 .\" .Fn ieee80211_setup_node ;
232 .Fn ieee80211_find_txnode
233 function will locate a suitable node entry for a frame to be delivered to
235 through the interface
240 .Fn ieee80211_find_rxnode
241 function will find the node entry which represents the sender of
243 which is received on the interface
248 .Fn ieee80211_find_node
249 function will iterate through the node table
251 searching for a node entry which matches
256 .Fn ieee80211_find_txnode ,
257 .Fn ieee80211_find_rxnode ,
259 .Fn ieee80211_find_node ,
260 returns a non-NULL node entry,
261 the node entry's reference count is incremented,
262 so the caller of these functions is responsible to call
263 .Fn ieee80211_free_node .
267 .Fn ieee80211_free_node
268 function will decrement the reference count of the node
270 If either the reference count drops to zero or
271 the last reference left is from
275 will be removed from the node table where it resides,
276 and any memory associated with the node will be freed.
280 .\" .Fn ieee80211_free_allnodes
281 .\" function will iterate through the node table
284 .\" .Fn ieee80211_free_node
285 .\" for all nodes that reside in
287 .\" or just remove them from
292 .Fn ieee80211_iterate_nodes
293 function will call the user-defined callback function
295 for all nodes in the node table
297 The callback is invoked with the user-supplied value
299 and a pointer to the current node.
303 .Fn ieee80211_next_scan
305 if a full cycle of scanning on all available radio channels is done.
306 Otherwise, 1 is returned.
310 .Fn ieee80211_find_txnode
311 returns a node entry that is suitable to be used to send a frame to
313 If there is no suitable node found,
319 .Fn ieee80211_find_rxnode
320 returns a node entry that represents the sender of
322 If no suitable node entry can be found,
328 .Fn ieee80211_find_node
329 returns a pointer to the node entry which matches
331 If no match is found,
341 series of functions first appeared in
343 and were later ported to
347 This man page was written by
348 .An Bruce M. Simpson Aq bms@FreeBSD.org
350 .An Darron Broad Aq darron@kewl.org .