1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter 5. Frame filtering</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The 802.11 subsystems – for kernel developers"><link rel="up" href="bk02pt01.html" title="Part I. The basic mac80211 driver interface"><link rel="prev" href="API-ieee80211-queue-stopped.html" title="ieee80211_queue_stopped"><link rel="next" href="API-enum-ieee80211-filter-flags.html" title="enum ieee80211_filter_flags"></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 5. Frame filtering</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-ieee80211-queue-stopped.html">Prev</a> </td><th width="60%" align="center">Part I. The basic mac80211 driver interface</th><td width="20%" align="right"> <a accesskey="n" href="API-enum-ieee80211-filter-flags.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="filters"></a>Chapter 5. Frame filtering</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="refentrytitle"><a href="API-enum-ieee80211-filter-flags.html"><span class="phrase">enum ieee80211_filter_flags</span></a></span><span class="refpurpose"> — 2 hardware filter flags 3 </span></dt></dl></div><p> 4 </p><p> 5 mac80211 requires to see many management frames for proper 6 operation, and users may want to see many more frames when 7 in monitor mode. However, for best CPU usage and power consumption, 8 having as few frames as possible percolate through the stack is 9 desirable. Hence, the hardware should filter as much as possible. 10 </p><p> 11 To achieve this, mac80211 uses filter flags (see below) to tell 12 the driver's <code class="function">configure_filter</code> function which frames should be 13 passed to mac80211 and which should be filtered out. 14 </p><p> 15 Before <code class="function">configure_filter</code> is invoked, the <code class="function">prepare_multicast</code> 16 callback is invoked with the parameters <em class="parameter"><code>mc_count</code></em> and <em class="parameter"><code>mc_list</code></em> 17 for the combined multicast address list of all virtual interfaces. 18 It's use is optional, and it returns a u64 that is passed to 19 <code class="function">configure_filter</code>. Additionally, <code class="function">configure_filter</code> has the 20 arguments <em class="parameter"><code>changed_flags</code></em> telling which flags were changed and 21 <em class="parameter"><code>total_flags</code></em> with the new flag states. 22 </p><p> 23 If your device has no multicast address filters your driver will 24 need to check both the <code class="constant">FIF_ALLMULTI</code> flag and the <em class="parameter"><code>mc_count</code></em> 25 parameter to see whether multicast frames should be accepted 26 or dropped. 27 </p><p> 28 All unsupported flags in <em class="parameter"><code>total_flags</code></em> must be cleared. 29 Hardware does not support a flag if it is incapable of _passing_ 30 the frame to the stack. Otherwise the driver must ignore 31 the flag, but not clear it. 32 You must _only_ clear the flag (announce no support for the 33 flag to mac80211) if you are not able to pass the packet type 34 to the stack (so the hardware always filters it). 35 So for example, you should clear <em class="parameter"><code>FIF_CONTROL</code></em>, if your hardware 36 always filters control frames. If your hardware always passes 37 control frames to the kernel and is incapable of filtering them, 38 you do _not_ clear the <em class="parameter"><code>FIF_CONTROL</code></em> flag. 39 This rule applies to all other FIF flags as well. 40</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-ieee80211-queue-stopped.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk02pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-enum-ieee80211-filter-flags.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">ieee80211_queue_stopped</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">enum ieee80211_filter_flags</span></td></tr></table></div></body></html> 41