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