1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter&#160;12.&#160;Access point mode support</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The 802.11 subsystems &#8211; for kernel developers"><link rel="up" href="advanced.html" title="Part&#160;II.&#160;Advanced driver interface"><link rel="prev" href="API-struct-ieee80211-tx-queue-params.html" title="struct ieee80211_tx_queue_params"><link rel="next" href="API-ieee80211-get-buffered-bc.html" title="ieee80211_get_buffered_bc"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&#160;12.&#160;Access point mode support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-ieee80211-tx-queue-params.html">Prev</a>&#160;</td><th width="60%" align="center">Part&#160;II.&#160;Advanced driver interface</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-ieee80211-get-buffered-bc.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="AP"></a>Chapter&#160;12.&#160;Access point mode support</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="section"><a href="AP.html#ps-client">support for powersaving clients</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-ieee80211-get-buffered-bc.html"><span class="phrase">ieee80211_get_buffered_bc</span></a></span><span class="refpurpose"> &#8212; 
2  accessing buffered broadcast and multicast frames
3 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-beacon-get.html"><span class="phrase">ieee80211_beacon_get</span></a></span><span class="refpurpose"> &#8212; 
4  beacon generation function
5 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-eosp.html"><span class="phrase">ieee80211_sta_eosp</span></a></span><span class="refpurpose"> &#8212; 
6  notify mac80211 about end of SP
7 </span></dt><dt><span class="refentrytitle"><a href="API-enum-ieee80211-frame-release-type.html"><span class="phrase">enum ieee80211_frame_release_type</span></a></span><span class="refpurpose"> &#8212; 
8  frame release reason
9 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-ps-transition.html"><span class="phrase">ieee80211_sta_ps_transition</span></a></span><span class="refpurpose"> &#8212; 
10  PS transition for connected sta
11 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-ps-transition-ni.html"><span class="phrase">ieee80211_sta_ps_transition_ni</span></a></span><span class="refpurpose"> &#8212; 
12  PS transition for connected sta (in process context)
13 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-set-buffered.html"><span class="phrase">ieee80211_sta_set_buffered</span></a></span><span class="refpurpose"> &#8212; 
14  inform mac80211 about driver-buffered frames
15 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-block-awake.html"><span class="phrase">ieee80211_sta_block_awake</span></a></span><span class="refpurpose"> &#8212; 
16  block station from waking up
17 </span></dt></dl></dd></dl></div><p>TBD</p><p>Some parts of the if_conf should be discussed here instead</p><p>
18          Insert notes about VLAN interfaces with hw crypto here or
19          in the hw crypto chapter.
20        </p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ps-client"></a>support for powersaving clients</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-ieee80211-get-buffered-bc.html"><span class="phrase">ieee80211_get_buffered_bc</span></a></span><span class="refpurpose"> &#8212; 
21  accessing buffered broadcast and multicast frames
22 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-beacon-get.html"><span class="phrase">ieee80211_beacon_get</span></a></span><span class="refpurpose"> &#8212; 
23  beacon generation function
24 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-eosp.html"><span class="phrase">ieee80211_sta_eosp</span></a></span><span class="refpurpose"> &#8212; 
25  notify mac80211 about end of SP
26 </span></dt><dt><span class="refentrytitle"><a href="API-enum-ieee80211-frame-release-type.html"><span class="phrase">enum ieee80211_frame_release_type</span></a></span><span class="refpurpose"> &#8212; 
27  frame release reason
28 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-ps-transition.html"><span class="phrase">ieee80211_sta_ps_transition</span></a></span><span class="refpurpose"> &#8212; 
29  PS transition for connected sta
30 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-ps-transition-ni.html"><span class="phrase">ieee80211_sta_ps_transition_ni</span></a></span><span class="refpurpose"> &#8212; 
31  PS transition for connected sta (in process context)
32 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-set-buffered.html"><span class="phrase">ieee80211_sta_set_buffered</span></a></span><span class="refpurpose"> &#8212; 
33  inform mac80211 about driver-buffered frames
34 </span></dt><dt><span class="refentrytitle"><a href="API-ieee80211-sta-block-awake.html"><span class="phrase">ieee80211_sta_block_awake</span></a></span><span class="refpurpose"> &#8212; 
35  block station from waking up
36 </span></dt></dl></div><p>
37   </p><p>
38   In order to implement AP and P2P GO modes, mac80211 has support for
39   client powersaving, both <span class="quote">&#8220;<span class="quote">legacy</span>&#8221;</span> PS (PS-Poll/null data) and uAPSD.
40   There currently is no support for sAPSD.
41   </p><p>
42   There is one assumption that mac80211 makes, namely that a client
43   will not poll with PS-Poll and trigger with uAPSD at the same time.
44   Both are supported, and both can be used by the same client, but
45   they can't be used concurrently by the same client. This simplifies
46   the driver code.
47   </p><p>
48   The first thing to keep in mind is that there is a flag for complete
49   driver implementation: <code class="constant">IEEE80211_HW_AP_LINK_PS</code>. If this flag is set,
50   mac80211 expects the driver to handle most of the state machine for
51   powersaving clients and will ignore the PM bit in incoming frames.
52   Drivers then use <code class="function">ieee80211_sta_ps_transition</code> to inform mac80211 of
53   stations' powersave transitions. In this mode, mac80211 also doesn't
54   handle PS-Poll/uAPSD.
55   </p><p>
56   In the mode without <code class="constant">IEEE80211_HW_AP_LINK_PS</code>, mac80211 will check the
57   PM bit in incoming frames for client powersave transitions. When a
58   station goes to sleep, we will stop transmitting to it. There is,
59   however, a race condition: a station might go to sleep while there is
60   data buffered on hardware queues. If the device has support for this
61   it will reject frames, and the driver should give the frames back to
62   mac80211 with the <code class="constant">IEEE80211_TX_STAT_TX_FILTERED</code> flag set which will
63   cause mac80211 to retry the frame when the station wakes up. The
64   driver is also notified of powersave transitions by calling its
65   <em class="parameter"><code>sta_notify</code></em> callback.
66   </p><p>
67   When the station is asleep, it has three choices: it can wake up,
68   it can PS-Poll, or it can possibly start a uAPSD service period.
69   Waking up is implemented by simply transmitting all buffered (and
70   filtered) frames to the station. This is the easiest case. When
71   the station sends a PS-Poll or a uAPSD trigger frame, mac80211
72   will inform the driver of this with the <em class="parameter"><code>allow_buffered_frames</code></em>
73   callback; this callback is optional. mac80211 will then transmit
74   the frames as usual and set the <code class="constant">IEEE80211_TX_CTL_NO_PS_BUFFER</code>
75   on each frame. The last frame in the service period (or the only
76   response to a PS-Poll) also has <code class="constant">IEEE80211_TX_STATUS_EOSP</code> set to
77   indicate that it ends the service period; as this frame must have
78   TX status report it also sets <code class="constant">IEEE80211_TX_CTL_REQ_TX_STATUS</code>.
79   When TX status is reported for this frame, the service period is
80   marked has having ended and a new one can be started by the peer.
81   </p><p>
82   Additionally, non-bufferable MMPDUs can also be transmitted by
83   mac80211 with the <code class="constant">IEEE80211_TX_CTL_NO_PS_BUFFER</code> set in them.
84   </p><p>
85   Another race condition can happen on some devices like iwlwifi
86   when there are frames queued for the station and it wakes up
87   or polls; the frames that are already queued could end up being
88   transmitted first instead, causing reordering and/or wrong
89   processing of the EOSP. The cause is that allowing frames to be
90   transmitted to a certain station is out-of-band communication to
91   the device. To allow this problem to be solved, the driver can
92   call <code class="function">ieee80211_sta_block_awake</code> if frames are buffered when it
93   is notified that the station went to sleep. When all these frames
94   have been filtered (see above), it must call the function again
95   to indicate that the station is no longer blocked.
96   </p><p>
97   If the driver buffers frames in the driver for aggregation in any
98   way, it must use the <code class="function">ieee80211_sta_set_buffered</code> call when it is
99   notified of the station going to sleep to inform mac80211 of any
100   TIDs that have frames buffered. Note that when a station wakes up
101   this information is reset (hence the requirement to call it when
102   informed of the station going to sleep). Then, when a service
103   period starts for any reason, <em class="parameter"><code>release_buffered_frames</code></em> is called
104   with the number of frames to be released and which TIDs they are
105   to come from. In this case, the driver is responsible for setting
106   the EOSP (for uAPSD) and MORE_DATA bits in the released frames,
107   to help the <em class="parameter"><code>more_data</code></em> parameter is passed to tell the driver if
108   there is more data on other TIDs -- the TIDs to release frames
109   from are ignored since mac80211 doesn't know how many frames the
110   buffers for those TIDs contain.
111   </p><p>
112   If the driver also implement GO mode, where absence periods may
113   shorten service periods (or abort PS-Poll responses), it must
114   filter those response frames except in the case of frames that
115   are buffered in the driver -- those must remain buffered to avoid
116   reordering. Because it is possible that no frames are released
117   in this case, the driver must call <code class="function">ieee80211_sta_eosp</code>
118   to indicate to mac80211 that the service period ended anyway.
119   </p><p>
120   Finally, if frames from multiple TIDs are released from mac80211
121   but the driver might reorder them, it must clear &amp; set the flags
122   appropriately (only the last frame may have <code class="constant">IEEE80211_TX_STATUS_EOSP</code>)
123   and also take care of the EOSP and MORE_DATA bits in the frame.
124   The driver may also use <code class="function">ieee80211_sta_eosp</code> in this case.
125   </p><p>
126   Note that if the driver ever buffers frames other than QoS-data
127   frames, it must take care to never send a non-QoS-data frame as
128   the last frame in a service period, adding a QoS-nulldata frame
129   after a non-QoS-data frame if needed.
130</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-ieee80211-tx-queue-params.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="advanced.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-ieee80211-get-buffered-bc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct ieee80211_tx_queue_params</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">ieee80211_get_buffered_bc</span></td></tr></table></div></body></html>
131