sleep.9: Really write PINTERLOCKED in the example.
[dragonfly.git] / share / man / man9 / ieee80211_input.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: src/share/man/man9/ieee80211_input.9,v 1.5 2009/09/18 00:33:47 brueffer Exp $
28 .\"
29 .Dd April 28, 2010
30 .Dt IEEE80211_INPUT 9
31 .Os
32 .Sh NAME
33 .Nm ieee80211_input
34 .Nd software 802.11 stack input functions
35 .Sh SYNOPSIS
36 .In net/if.h
37 .In net/if_media.h
38 .In netproto/802_11/ieee80211_var.h
39 .Ft void
40 .Fo ieee80211_input
41 .Fa "struct ieee80211_node *"
42 .Fa "struct mbuf *"
43 .Fa "int rssi"
44 .Fa "int noise"
45 .Fc
46 .Ft void
47 .Fo ieee80211_input_all
48 .Fa "struct ieee80211com *"
49 .Fa "struct mbuf *"
50 .Fa "int rssi"
51 .Fa "int noise"
52 .Fc
53 .Sh DESCRIPTION
54 The
55 .Nm net80211
56 layer that supports 802.11 device drivers requires that
57 receive processing be single-threaded.
58 Typically this is done using a dedicated driver
59 .Xr taskqueue 9
60 thread.
61 .Fn ieee80211_input
62 and
63 .Fn ieee80211_input_all
64 process received 802.11 frames and are designed
65 for use in that context; e.g. no driver locks may be held.
66 .Pp
67 The frame passed up in the
68 .Vt mbuf
69 must have the 802.11 protocol header at the front; all device-specific
70 information and/or PLCP must be removed.
71 Any CRC must be stripped from the end of the frame.
72 The 802.11 protocol header should be 32-bit aligned for
73 optimal performance but receive processing does not require it.
74 If the frame holds a payload and that is not aligned to a 32-bit
75 boundary then the payload will be re-aligned so that it is suitable
76 for processing by protocols such as
77 .Xr ip 4 .
78 .Pp
79 If a device (such as
80 .Xr ath 4 )
81 inserts padding after the 802.11 header to align
82 the payload to a 32-bit boundary the
83 .Dv IEEE80211_C_DATAPAD
84 capability must be set.
85 Otherwise header and payload are assumed contiguous in the mbuf chain.
86 .Pp
87 If a received frame must pass
88 through the A-MPDU receive reorder buffer then the mbuf
89 must be marked with the
90 .Dv M_AMPDU
91 flag.
92 Note that for the moment this is required of all frames received from
93 a station and TID where a Block ACK stream is active, not just A-MPDU
94 aggregates.
95 It is sufficient to check for
96 .Dv IEEE80211_NODE_HT
97 in the
98 .Vt ni_flags
99 of the station's node table entry, any frames that do not require reorder
100 processing will be dispatched with only minimal overhead.
101 .Pp
102 The
103 .Vt rssi
104 parameter is the Receive Signal Strength Indication of the frame
105 measured in 0.5dBm units relative to the noise floor.
106 The
107 .Vt noise
108 parameter is the best approximation of the noise floor in
109 dBm units at the time the frame was received.
110 RSSI and noise are used by the
111 .Nm net80211
112 layer to make scanning and roaming decisions in station mode
113 and to do auto channel selection for hostap and similar modes.
114 Otherwise the values are made available to user applications
115 (with the rssi presented as a filtered average over the last ten values
116 and the noise floor the last reported value).
117 .Sh SEE ALSO
118 .Xr ieee80211 9