Welcome to the new location of Alien's Wiki, sharing a single dokuwiki install with the SlackDocs Wiki.

Welcome to Eric Hameleers (Alien BOB)'s Wiki pages.

If you want to support my work, please consider a small donation:

no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Previous revision
Last revision
slackware:ndiswrapper [2008/09/11 11:33] – Be more specific about how to configure wpa with ndiswrapper. alien
Line 1: Line 1:
 +====== Using ndiswrapper for unsupported wireless cards ======
  
 +Wireless card support in linux is pretty good nowadays, as more and more vendors realize there is not per definition evil in using and releasing Open Source Software, or in co-operation with Open Source developers. For the old-style 11Mbit PCMCIA cards, drivers have existed for some time now (hostap, linux-wlan) and a few 54 Mbit card drivers have even made it into the kernel (prism54 and ipw2200/ipw2200). Drivers like [[http://madwifi.org/|madwifi]] (for Atheros chipsets) and [[http://rt2x00.serialmonkey.com/|rt2x00]] (for RaLink chipsets) receive vendor support and are covering a significant part of currently sold wireless cards, while [[http://bcm43xx.berlios.de|bcm43xx]] (for Broadcom 43xx chips) and [[http://acx100.sourceforge.net/|acx100/111]] (for Texas Instruments chipsets) are reverse-engineered drivers due to lack of support from the manufacturers, who refuse to publish specifications of their hardware.
 +
 +Still, there are many other wireless cards for which no driver exists at all. An Open Source project, [[http://ndiswrapper.sourceforge.net/|ndiswrapper]], was created to fill this gap. Ndiswrapper implements the needed Windows kernel API calls and NDIS (Network Driver Interface Specification) API calls as a Linux kernel module. This allows ndiswrapper to load a Windows driver for any wireless network card and let this driver run natively. Nearly all wireless cards with a Windows driver can be made functional in Linux this way, although this approach puts an extra load on your CPU because of the extra software layer.\\ 
 +Also, ndiswrapper-driven cards tend to crash the kernel in high-load situations and even though you should run a Linux kernel with at least 8K stack size (which is the default in Slackware), some NDIS drivers seem to need stack sizes as high as 32K to properly function.\\ 
 +The 32K stack size is not something you can configure in an unpatched kernel, and since I have only read about these large kernel stack sizes in non-Slackware mailing lists, I'd say: stick to the default stack size of 8K you find in Slackware kernel, unless you experience strange kernel crashes that you can trace back to the ndiswrapper module...
 +
 +For now, rest assured that you probably will not need to change anything to your running kernel to get ndiswrapper support for your wireless card. The rest of the page will concern itself with detailing how to obtain the ndiswrapper source code, how to build and install the software, how to install a Windows driver, and how to configure your card. WPA encryption is discussed in the final paragraph.
 +
 +===== Obtaining the source =====
 +
 +Ndiswrapper releases can be downloaded from [[http://sourceforge.net/project/showfiles.php?group_id=93482|SourceForge]]. For Slackware 10.2 and earlier, you should stick to release 1.15 or earlier (see the [[#building_and_installing_ndiswrapper|next paragraph]]). For 2.4 kernels, 1.14 is the last one that compiles. Note that you will have to be running a supported kernel, which means at least 2.6.6 or 2.4.26.
 +
 +===== Building and installing ndiswrapper =====
 +
 +Note that at some point, the developers seem to have dropped support for the older GCC 3.3 compiler. I can not build the 1.16 release on Slackware 10.2 for instance.
 +You can either compile the downloaded source package yourself, by running <code>
 +tar -zxvf ndiswrapper-<release>.tar.gz
 +cd ndiswrapper-<release>
 +make distclean
 +make install
 +</code> or get a Slackware package for your specific kernel if present, [[http://www.slackware.com/~alien/slackbuilds/ndiswrapper|from my repository]]. If a package for your kernel is not found, you can still use my SlackBuild script to create yourself a Slackware package from source. Run the followinf commands to download the necessary sources and build the package. You'll find the result in the /tmp directory. Read the log output from the build carefully to see if everything went OK! <code>
 +mkdir ndiswrapper
 +cd ndiswrapper
 +lftp -c "open http://www.slackware.com/~alien/slackbuilds/ndiswrapper; mirror build"
 +cd build
 +./ndiswrapper.SlackBuild
 +</code> Finally, install the package using the command <code>
 +installpkg /tmp/ndiswrapper-<release>_<kernelversion>-*.tgz</code> where you supply the release and your kernelversion - for instance //installpkg /tmp/ndiswrapper-1.15_2.6.13-i486-1.tgz//.
 +
 +===== Installing a Windows driver =====
 +
 +You can use the Windows driver that came with your card, and I have not had problems doing so yet, but the ndiswrapper Wiki states that it is better to look up your card's PCI-ID in the [[http://ndiswrapper.sourceforge.net/mediawiki/index.php/List|supported cards list]].
 +
 +  * Look up the PCI ID for your card by first running the command <code>lspci</code> and check the line of output for your card. Mine for instance looks like <file>02:07.0 Network controller: RaLink RT2500 802.11g Cardbus/mini-PCI (rev 01)</file>
 +
 +  * Next, look up the starting numbers of that line in the output of the command <code>lspci -n</code> For me, that would be <file>02:07.0 Class 0280: 1814:0201 (rev 01)</file> The PCI-ID is ''1814:0201'' shown in bold here: "//02:07.0 Class 0280: **1814:0201** (rev 01)//". The abovementioned List Page will have one or more links to the required Windows .INF and .SYS files you need for the next step.
 +
 +  * If the download is a Windows installer, you might need a tool like [[http://www.slackware.com/~alien/slackbuilds/cabextract/|cabextract]] or [[http://www.slackware.com/~alien/slackbuilds/unshield/|unshield]] to be able to extract the driver files.
 +
 +  * Once you finally have the extracted Windows NDIS driver in the form of two .INF and .SYS files and possibly .BIN or other files containing firmware, all together in your current directory, proceed with installing them so they can be used by ndiswrapper. Run the ndiswrapper helper application like this: <code>
 +ndiswrapper -i filename.INF
 +</code> This will install the drivers to the directory ''/etc/ndiswrapper'' and write a configuration file.
 +
 + * You can check if this was done correctly by running <code>
 +ndiswrapper -l</code> which should list the installed drivers and detected hardware. In my case, the output is <file>
 +Installed drivers:
 +rt2500          driver installed, hardware present
 +</file> which means the driver that was installed can be used to drive the hardware.
 +
 +
 +===== Activating the card on boot =====
 +
 +The ndiswrapper kernel module will not load automatically. You can add the following line to the file ''/etc/rc.d/rc.modules'' to make it load on every boot: <code>
 +/sbin/modprobe ndiswrapper</code>
 +
 +If you want to have the network interface be known as //wlan0// then you can either run <code>ndiswrapper -m</code> which adds a line <code>alias wlan0 ndiswrapper</code> to /etc/modprobe.d/ndiswrapper (2.6.15 kernels and onward) or you can write that line yourself, in ''/etc/modules.conf'' (for 2.4 kernels) or ''/etc/modprobe.conf'' (older 2.6 kernels).
 +
 +
 +===== Network configuration =====
 +
 +Your card will be loaded with the name **wlan0**. Detailed information about how to configure your wlan0 interface can be found in my [[:slackware:madwifi#network_configuration|madwifi page]], if you change the string **ath0** to **wlan0**.
 +
 +
 +
 +
 +===== WPA encryption for your wireless network =====
 +
 +For more information about how to configure WPA using [[http://hostap.epitest.fi/wpa_supplicant/|wpa_supplicant]], read my [[:slackware:network#wpa_encryption|WPA chapter]] in the //[[:slackware:network|Slackware network configuration]]// page.
 +
 +<note>With ndiswrapper version 1.12 and later, you should use wpa_supplicant's **//wext//** driver instead of the //ndiswrapper// driver: the argument to wpa_supplicant would become '''-Dwext''' instead of '''-Dndiswrapper'''\\ A typical configuration line in ''rc.inet1.conf'' would then become (adjust my example index [**1**] to the value you use for your card): <code>
 +WLAN_WPADRIVER[1]="wext"</code></note>
 Using ndiswrapper for unsupported wireless cards ()
SlackDocs