1 page.title=Wi-Fi 2 pdk.version=1.0 3 doc.type=porting 4 @jd:body 5 6 <div id="qv-wrapper"> 7 <div id="qv"> 8 <h2>In this document</h2> 9 <a name="toc"/> 10 <ul> 11 <li><a href="#androidWifiBuildingDriver">Building a Wi-Fi Library</a></li> 12 <li><a href="#androidWifiInterface">Interface</a></li> 13 </ul> 14 </div> 15 </div> 16 17 <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> 18 19 20 <a name="androidWifiBuildingDriver"></a><h3>Building a Wi-Fi Library</h3> 21 22 <p>To create a Wi-Fi driver for Android:</p> 23 <p><ul> 24 <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> 25 <li>Follow the instructions posted at <a href="http://hostap.epitest.fi/wpa_supplicant/">http://hostap.epitest.fi/wpa_supplicant/</a>.</li> 26 <li>Place your driver in <code>libs/hardware/wifi/</code></li> 27 <li>Test your driver using the command line <code>wpa_cli</code> utilities.</li> 28 </ul> 29 30 <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> 31 32 <p>Update the default <code>Android.mk</code> file (<code>libs/hardware/wifi/Android.mk</code>) as shown below.</p> 33 <pre class="prettify"> 34 LOCAL_SHARED_LIBRARIES += libnetutils 35 36 ifeq ($(TARGET_PRODUCT),acme) 37 LOCAL_SRC_FILES += wifi/wifi_mywifi.c 38 else 39 LOCAL_SRC_FILES += wifi/wifi.c 40 endif 41 </pre> 42 43 44 <a name="androidWifiInterface"></a><h3>Interface</h3> 45 46 47 48 <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> 49 50 51 <iframe onLoad="resizeDoxFrameHeight();" src="wifi_8h.html" scrolling="no" scroll="no" id="doxygen" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;"></iframe> 52