<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><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.75.2" /><link rel="home" href="index.html" title="The mac80211 subsystem for kernel developers" /><link rel="up" href="pt01.html" title="Part I. The basic mac80211 driver interface" /><link rel="prev" href="re32.html" title="ieee80211_stop_queues" /><link rel="next" href="re33.html" title="enum ieee80211_filter_flags" /></head><body><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="re32.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="re33.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 5. Frame filtering"><div class="titlepage"><div><div><h2 class="title"><a id="filters"></a>Chapter 5. Frame filtering</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="refentrytitle"><a href="re33.html"><span>enum ieee80211_filter_flags</span></a></span><span class="refpurpose"> — hardware filter flags </span></dt></dl></div><p> </p><p> mac80211 requires to see many management frames for proper operation, and users may want to see many more frames when in monitor mode. However, for best CPU usage and power consumption, having as few frames as possible percolate through the stack is desirable. Hence, the hardware should filter as much as possible. </p><p> To achieve this, mac80211 uses filter flags (see below) to tell the driver's <code class="function">configure_filter</code> function which frames should be passed to mac80211 and which should be filtered out. </p><p> Before <code class="function">configure_filter</code> is invoked, the <code class="function">prepare_multicast</code> callback is invoked with the parameters <em class="parameter"><code>mc_count</code></em> and <em class="parameter"><code>mc_list</code></em> for the combined multicast address list of all virtual interfaces. It's use is optional, and it returns a u64 that is passed to <code class="function">configure_filter</code>. Additionally, <code class="function">configure_filter</code> has the arguments <em class="parameter"><code>changed_flags</code></em> telling which flags were changed and <em class="parameter"><code>total_flags</code></em> with the new flag states. </p><p> If your device has no multicast address filters your driver will need to check both the <code class="constant">FIF_ALLMULTI</code> flag and the <em class="parameter"><code>mc_count</code></em> parameter to see whether multicast frames should be accepted or dropped. </p><p> All unsupported flags in <em class="parameter"><code>total_flags</code></em> must be cleared. Hardware does not support a flag if it is incapable of _passing_ the frame to the stack. Otherwise the driver must ignore the flag, but not clear it. You must _only_ clear the flag (announce no support for the flag to mac80211) if you are not able to pass the packet type to the stack (so the hardware always filters it). So for example, you should clear <em class="parameter"><code>FIF_CONTROL</code></em>, if your hardware always filters control frames. If your hardware always passes control frames to the kernel and is incapable of filtering them, you do _not_ clear the <em class="parameter"><code>FIF_CONTROL</code></em> flag. This rule applies to all other FIF flags as well. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re32.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="pt01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="re33.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>ieee80211_stop_queues</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span>enum ieee80211_filter_flags</span></td></tr></table></div></body></html>