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