If you are trying to get a device working with ndiswrapper, please help ndiswrapper project wiki by contributing your findings. See HowToContribute

Using Ndiswrapper

From NDISWrapper
Jump to: navigation, search

Note: wlan0 is used in examples below. Replace it with whatever interface ndiswrapper configures.

  • Suspend/resume. When suspending either suspend-to-ram or suspend-to-disk, nothing needs to be done. After resuming, if the wireless setup hasn’t changed, just set the essid. If the wireless setup has changed, bring the network interface down, set the new wireless parameters key, mode then essid and then configure the interface.
  • Some notebooks have buttons controlling the radio on/off. Some use hardware which should generally work with ndiswrapper, others are software based and has a special program to turn the radio on. See http://rfswitch.sourceforge.net if there is support for your notebook to enable radio.
  • Make sure essid is set properly before bringing up the interface - iwconfig for the wireless interface should show essid and access point MAC address. Without this, it is not possible to communicate with the access point. You may need to set the operating mode of the card; this should be Managed mode in most cases.
  • You can conserve power to save battery life as below:
    • You can turn off the txpower: iwconfig wlan0 txpower off. Note that this also disassociates from the current AP. You can then reassociate by turning on the essid: iwconfig wlan0 essid on
    • You can turn on power saving mode: iwconfig wlan0 min period 0 or iwconfig wlan0 max period 0. The actual timeout values don’t matter, as NDIS doesn’t care about them. Not all drivers support both min and max power saving modes. To disable either of the power saving modes, turn it off with: iwconfig wlan0 power off
    • You can also set the power profile mode as in Windows with iwpriv wlan0 power_profile [0|1], where 0 means Battery profile and 1 means AC profile. How the NDIS driver interprets it and how much power is saved depends on the driver.
  • If the card is not responding for any reason, you can try resetting it with: iwpriv wlan0 ndis_reset. Note that this won’t help with association when setting essid, it doesn’t get set.
  • You can change the MAC address used by the card by changing the setting ‘NetworkAddress’ in .conf files in /etc/ndiswrapper/driver. You can either edit all .conf files there or edit the file used by your card which is printed when the driver is loaded. If the .conf file(s) don’t already have ‘NetworkAddress’ setting, add one. For example, if you want MAC address to be, say, 00:16:E5:BA:FE:82, add/change the line NetworkAddress|0016E5BAFE82 and reload the module (NOTE: there are no ‘:’s in the setting). This will change the MAC address for every use. If you want to change the MAC address temporarily, run ‘ifconfig wlan0 hw ether 00:16:E5:BA:FE:82’.
  • If your card supports more than one 802.11 mode a, b, or g, you can set the specific mode before associating with iwpriv wlan0 network_type b to set to 802.11b mode, iwpriv wlan0 network_type g to set to 802.11g mode, iwpriv wlan0 network_type a to set to 802.11a mode and iwpriv wlan0 network_type x to set to auto mode default.
  • After loading the module or NDIS driver, if you notice keyboard or mouse lock up or if capslock is flashing, most likely the kernel has crashed. This happens for various reasons:
    • You may have used a driver/card that is not supported. Make sure that you are using the driver corresponding to the chipset listed on the Supported Chipsets page.
    • Make sure the card is not powered off either by BIOS or by Windows. You should check if the card is in ‘Always enabled’ mode or something similar in BIOS. You may also be able to enable the card by pressing Fn-F2 or some other key designed to enable the card.
  • ndiswrapper module takes following parameters
    • if_name Specifies the full interface name or the template for the interface name that ndiswrapper will configure. If it is full interface name e.g., wlan0,eth1,ndis0, then that is exactly what ndiswrapper will try to configure. Note that if that interface is already being used or if there is a problem configuring that interface for some other reason, then ndiswrapper will fail. Instead of the full interface name, you can also give a template for if_name. A template is a basename followed by %d. e.g., eth%d,wlan%d,ndis%d. With the template, ndiswrapper will configure the interface with the next available number with the given basename the kernel decides what the number will be. If, e.g., wlan%d is given and wlan0 is already configured, then ndiswrapper will most likely configure wlan1. If you want to use ndiswrapper with multiple interfaces, you should use template instead of full interface name for if_name. The default value of if_name is wlan%d.
    • proc_uid: Specifies the user id of the files in proc file system. Normally files in proc file system are owned by root and some of them can be read only by root. However, it is tedious to login as root to access these files. Since ndiswrapper is used mostly on laptops, it is expected that only one user uses it. To avoid having to login as root, ndiswraper can create the files in proc file system with a different user id e.g., the user that is using the laptop. Then that user has full access permissions to those files. e.g., if your user id is 1000, then specify proc_uid=1000. The default value of proc_uid is 0 user id of root.
    • proc_gid: Specifies the group id of the files in proc file system. Analogous to proc_uid. The default value is 0.