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