xref: /freebsd/share/man/man9/ieee80211_input.9 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
13f3f4cdbSBruce M Simpson.\"
23f3f4cdbSBruce M Simpson.\" Copyright (c) 2004 Bruce M. Simpson <bms@spc.org>
33f3f4cdbSBruce M Simpson.\" Copyright (c) 2004 Darron Broad <darron@kewl.org>
43f3f4cdbSBruce M Simpson.\" All rights reserved.
53f3f4cdbSBruce M Simpson.\"
63f3f4cdbSBruce M Simpson.\" Redistribution and use in source and binary forms, with or without
73f3f4cdbSBruce M Simpson.\" modification, are permitted provided that the following conditions
83f3f4cdbSBruce M Simpson.\" are met:
93f3f4cdbSBruce M Simpson.\" 1. Redistributions of source code must retain the above copyright
103f3f4cdbSBruce M Simpson.\"    notice, this list of conditions and the following disclaimer.
113f3f4cdbSBruce M Simpson.\" 2. Redistributions in binary form must reproduce the above copyright
123f3f4cdbSBruce M Simpson.\"    notice, this list of conditions and the following disclaimer in the
133f3f4cdbSBruce M Simpson.\"    documentation and/or other materials provided with the distribution.
143f3f4cdbSBruce M Simpson.\"
153f3f4cdbSBruce M Simpson.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
163f3f4cdbSBruce M Simpson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
173f3f4cdbSBruce M Simpson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
183f3f4cdbSBruce M Simpson.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
193f3f4cdbSBruce M Simpson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
203f3f4cdbSBruce M Simpson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
213f3f4cdbSBruce M Simpson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
223f3f4cdbSBruce M Simpson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
233f3f4cdbSBruce M Simpson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
243f3f4cdbSBruce M Simpson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
253f3f4cdbSBruce M Simpson.\" SUCH DAMAGE.
263f3f4cdbSBruce M Simpson.\"
27692eebe0SSam Leffler.Dd August 4, 2009
282e777780SRuslan Ermilov.Dt IEEE80211_INPUT 9
293f3f4cdbSBruce M Simpson.Os
303f3f4cdbSBruce M Simpson.Sh NAME
31692eebe0SSam Leffler.Nm ieee80211_input
322e777780SRuslan Ermilov.Nd software 802.11 stack input functions
333f3f4cdbSBruce M Simpson.Sh SYNOPSIS
343f3f4cdbSBruce M Simpson.In net80211/ieee80211_var.h
353f3f4cdbSBruce M Simpson.Ft void
362e777780SRuslan Ermilov.Fo ieee80211_input
37692eebe0SSam Leffler.Fa "struct ieee80211_node *"
38692eebe0SSam Leffler.Fa "struct mbuf *"
39692eebe0SSam Leffler.Fa "int rssi"
40692eebe0SSam Leffler.Fa "int noise"
412e777780SRuslan Ermilov.Fc
423f3f4cdbSBruce M Simpson.Ft void
43692eebe0SSam Leffler.Fo ieee80211_input_all
44692eebe0SSam Leffler.Fa "struct ieee80211com *"
45692eebe0SSam Leffler.Fa "struct mbuf *"
46692eebe0SSam Leffler.Fa "int rssi"
47692eebe0SSam Leffler.Fa "int noise"
482e777780SRuslan Ermilov.Fc
493f3f4cdbSBruce M Simpson.Sh DESCRIPTION
503f3f4cdbSBruce M SimpsonThe
51692eebe0SSam Leffler.Nm net80211
52692eebe0SSam Lefflerlayer that supports 802.11 device drivers requires that
53692eebe0SSam Lefflerreceive processing be single-threaded.
54692eebe0SSam LefflerTypically this is done using a dedicated driver
55692eebe0SSam Leffler.Xr taskqueue 9
56692eebe0SSam Lefflerthread.
573f3f4cdbSBruce M Simpson.Fn ieee80211_input
583f3f4cdbSBruce M Simpsonand
59692eebe0SSam Leffler.Fn ieee80211_input_all
60692eebe0SSam Lefflerprocess received 802.11 frames and are designed
61692eebe0SSam Lefflerfor use in that context; e.g. no driver locks may be held.
623f3f4cdbSBruce M Simpson.Pp
63692eebe0SSam LefflerThe frame passed up in the
64692eebe0SSam Leffler.Vt mbuf
65692eebe0SSam Lefflermust have the 802.11 protocol header at the front; all device-specific
66692eebe0SSam Lefflerinformation and/or PLCP must be removed.
67692eebe0SSam LefflerAny CRC must be stripped from the end of the frame.
68692eebe0SSam LefflerThe 802.11 protocol header should be 32-bit aligned for
69692eebe0SSam Leffleroptimal performance but receive processing does not require it.
70692eebe0SSam LefflerIf the frame holds a payload and that is not aligned to a 32-bit
71692eebe0SSam Lefflerboundary then the payload will be re-aligned so that it is suitable
72692eebe0SSam Lefflerfor processing by protocols such as
73692eebe0SSam Leffler.Xr ip 4 .
743f3f4cdbSBruce M Simpson.Pp
75692eebe0SSam LefflerIf a device (such as
76692eebe0SSam Leffler.Xr ath 4 )
77692eebe0SSam Lefflerinserts padding after the 802.11 header to align
78692eebe0SSam Lefflerthe payload to a 32-bit boundary the
79692eebe0SSam Leffler.Dv IEEE80211_C_DATAPAD
80692eebe0SSam Lefflercapability must be set.
81692eebe0SSam LefflerOtherwise header and payload are assumed contiguous in the mbuf chain.
82692eebe0SSam Leffler.Pp
83692eebe0SSam LefflerIf a received frame must pass
84692eebe0SSam Lefflerthrough the A-MPDU receive reorder buffer then the mbuf
85692eebe0SSam Lefflermust be marked with the
86692eebe0SSam Leffler.Dv M_AMPDU
87692eebe0SSam Lefflerflag.
88692eebe0SSam LefflerNote that for the moment this is required of all frames received from
89692eebe0SSam Lefflera station and TID where a Block ACK stream is active, not just A-MPDU
90692eebe0SSam Leffleraggregates.
91692eebe0SSam LefflerIt is sufficient to check for
92692eebe0SSam Leffler.Dv IEEE80211_NODE_HT
93692eebe0SSam Lefflerin the
94692eebe0SSam Leffler.Vt ni_flags
95692eebe0SSam Lefflerof the station's node table entry, any frames that do not require reorder
96692eebe0SSam Lefflerprocessing will be dispatched with only minimal overhead.
97692eebe0SSam Leffler.Pp
983f3f4cdbSBruce M SimpsonThe
99692eebe0SSam Leffler.Vt rssi
100692eebe0SSam Lefflerparameter is the Receive Signal Strength Indication of the frame
101692eebe0SSam Lefflermeasured in 0.5dBm units relative to the noise floor.
102692eebe0SSam LefflerThe
103692eebe0SSam Leffler.Vt noise
104692eebe0SSam Lefflerparameter is the best approximation of the noise floor in
105692eebe0SSam LefflerdBm units at the time the frame was received.
106692eebe0SSam LefflerRSSI and noise are used by the
107692eebe0SSam Leffler.Nm net80211
108692eebe0SSam Lefflerlayer to make scanning and roaming decisions in station mode
109692eebe0SSam Lefflerand to do auto channel selection for hostap and similar modes.
110692eebe0SSam LefflerOtherwise the values are made available to user applications
111692eebe0SSam Leffler(with the rssi presented as a filtered average over the last ten values
112692eebe0SSam Lefflerand the noise floor the last reported value).
1133f3f4cdbSBruce M Simpson.Sh SEE ALSO
114ace02a6dSChristian Brueffer.Xr ieee80211 9
115