blob: 5341954cb9d0891d7512a0e781ed10a672ffe700 [file] [log] [blame]
David Warren5f6ca4f2009-04-30 17:11:58 -07001page.title=Wi-Fi
2pdk.version=1.0
3@jd:body
4
David Warren5c40a482009-06-05 15:11:21 -07005<div id="qv-wrapper">
6<div id="qv">
7<h2>In this document</h2>
David Warren5f6ca4f2009-04-30 17:11:58 -07008<a name="toc"/>
David Warren5c40a482009-06-05 15:11:21 -07009<ul>
10<li><a href="#androidWifiBuildingDriver">Building a Wi-Fi Library</a></li>
11<li><a href="#androidWifiInterface">Interface</a></li>
12</ul>
13</div>
14</div>
David Warren5f6ca4f2009-04-30 17:11:58 -070015
16<p>Android uses wpa_supplicant as the platform interface to the Wi-Fi device. Your Wi-Fi driver must be compatible with the standard wpa_supplicant in addition to extensions added to the supplicant (specifically, the "DRIVER" commands described in <code>wifi.h/wifi_command()</code>).</p>
17
18
David Warren5c40a482009-06-05 15:11:21 -070019<a name="androidWifiBuildingDriver"></a><h3>Building a Wi-Fi Library</h3>
David Warren5f6ca4f2009-04-30 17:11:58 -070020
21<p>To create a Wi-Fi driver for Android:</p>
22<p><ul>
23<li>create a shared library that implements the interface defined in <code>include/hardware/wifi.h</code>, which also defines the Wi-Fi supplicant.</li>
24<li>Follow the instructions posted at <a href="http://hostap.epitest.fi/wpa_supplicant/">http://hostap.epitest.fi/wpa_supplicant/</a>.</li>
25<li>Place your driver in <code>libs/hardware/wifi/</code></li>
26<li>Test your driver using the command line <code>wpa_cli</code> utilities.</li>
27</ul>
28
29<p>You can find the default implementation in <code>libs/hardware/wifi/wifi.c</code>. If you need to make changes, create a new source file similar to <code>wifi.c</code>, for example, <code>wifi_mywifi.c</code>. </p>
30
31<p>Update the default <code>Android.mk</code> file (<code>libs/hardware/wifi/Android.mk</code>) as shown below.</p>
32<pre class="prettify">
33LOCAL_SHARED_LIBRARIES += libnetutils
34
35ifeq ($(TARGET_PRODUCT),acme)
36LOCAL_SRC_FILES += wifi/wifi_mywifi.c
37else
38LOCAL_SRC_FILES += wifi/wifi.c
39endif
40</pre>
41
42
David Warren5c40a482009-06-05 15:11:21 -070043<a name="androidWifiInterface"></a><h3>Interface</h3>
David Warren5f6ca4f2009-04-30 17:11:58 -070044
45
46
47<p class="note"><strong>Note</strong>: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, <a href="wifi.html">click here</a>.</p>
48
49
50<iframe onLoad="resizeDoxFrameHeight();" src="wifi_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe>