The system described here is
- Ubuntu 6.0.6 with 2.6.15-29-386 kernel.
- madwifi-ng-r2667-20070825 source
- Ubiquity SuperRange Cardbus
Ubuntu comes with the old madwifi drivers
modinfo ath_pci
filename: /lib/modules/2.6.15-29-386/madwifi/ath_pci.ko author: Errno Consulting, Sam Leffler description: Support for Atheros 802.11 wireless LAN cards. license: Dual BSD/GPL vermagic: 2.6.15-29-386 preempt 486 gcc-4.0 depends: ath_hal,wlan,ath_rate_sample alias: pci:v0000168Cd00000007sv*sd*bc*sc*i* alias: pci:v0000168Cd00000012sv*sd*bc*sc*i* alias: pci:v0000168Cd00000013sv*sd*bc*sc*i* alias: pci:v0000A727d00000013sv*sd*bc*sc*i* alias: pci:v000010B7d00000013sv*sd*bc*sc*i* alias: pci:v0000168Cd00001014sv*sd*bc*sc*i* alias: pci:v0000168Cd00000015sv*sd*bc*sc*i* alias: pci:v0000168Cd00000016sv*sd*bc*sc*i* alias: pci:v0000168Cd00000017sv*sd*bc*sc*i* alias: pci:v0000168Cd00000018sv*sd*bc*sc*i* alias: pci:v0000168Cd00000019sv*sd*bc*sc*i* alias: pci:v0000168Cd0000001Asv*sd*bc*sc*i* srcversion: 532488E7A58A464B250A176 parm: ifname:Interface name prefix (default: ath) (charp) parm: xchanmode:Enable/disable extended channel mode (int) parm: outdoor:Enable/disable outdoor use (int) parm: countrycode:Override default country code (int)
Install the kernel headers and build-essential packages with apt-get.
apt-get install build-essential linux-headers-`uname -r`
Uncompress the release and compile it
tar -xvf madwifi-ng-current.tar.gz cd madwifi-ng-r2667-20070825/ ~/madwifi-ng-r2667-20070825$ make clean ~/madwifi-ng-r2667-20070825$ make
Stop the linux-restricted-modules package from providing the madwifi module ath_hal, via its so called volatile module mechanism. Do so by adding ath_hal to the list of DISABLED_MODULES in /etc/default/linux-restricted-modules-common.
# This file is sourced from the linux-restricted-modules-common init # script and is used to disable the link-on-boot feature, one module # at a time. This can be useful if you want to use hand-compiled # versions of one or more modules, but keep linux-restricted-modules # installed on your system, or just to disable modules you don't use # and speed up your boot process by a second or two. # # Use a space-separated list of modules you wish to not have linked # on boot. The following example shows a (condensed) list of all # modules shipped in the linux-restricted-modules packages: # # DISABLED_MODULES="ath_hal fc fglrx ltm nv" # # Note that disabling "fc" disables all fcdsl drivers, "ltm" disables # ltmodem and ltserial, and "nv" disables both the nvidia drivers. # You can also name each module individually, if you prefer a subset. DISABLED_MODULES="ath_hal"
Now we can install our modules and the restricted modules will not overwrite our changes when the system reboots. Make sure ath_pci is not loaded so you don't get a file acess error. First see if there is a ath interface up
~/madwifi-ng-r2667-20070825$ ifconfig | grep ath ath0 Link encap:Ethernet HWaddr 00:15:6D:54:16:3D
My system autoloaded ath0 with the old drivers via hotplug when the card was inserted. If there is a interface there, take it down first then remove the module
~/madwifi-ng-r2667-20070825$ sudo ifconfig ath0 down ~/madwifi-ng-r2667-20070825$ sudo modprobe -r ath_pci
Now we can install
~/madwifi-ng-r2667-20070825$ sudo make install
modifno will now show that we have the new driver installed
~/madwifi-ng-r2667-20070825$ modinfo ath_pci filename: /lib/modules/2.6.15-29-386/net/ath_pci.ko author: Errno Consulting, Sam Leffler description: Support for Atheros 802.11 wireless LAN cards. version: svn r2667 license: Dual BSD/GPL vermagic: 2.6.15-29-386 preempt 486 gcc-4.0 depends: ath_hal,wlan alias: pci:v0000168Cd00000007sv*sd*bc*sc*i* alias: pci:v0000168Cd00000012sv*sd*bc*sc*i* alias: pci:v0000168Cd00000013sv*sd*bc*sc*i* alias: pci:v0000A727d00000013sv*sd*bc*sc*i* alias: pci:v000010B7d00000013sv*sd*bc*sc*i* alias: pci:v0000168Cd00001014sv*sd*bc*sc*i* alias: pci:v0000168Cd0000101Asv*sd*bc*sc*i* alias: pci:v0000168Cd00000015sv*sd*bc*sc*i* alias: pci:v0000168Cd00000016sv*sd*bc*sc*i* alias: pci:v0000168Cd00000017sv*sd*bc*sc*i* alias: pci:v0000168Cd00000018sv*sd*bc*sc*i* alias: pci:v0000168Cd00000019sv*sd*bc*sc*i* alias: pci:v0000168Cd0000001Asv*sd*bc*sc*i* alias: pci:v0000168Cd0000001Bsv*sd*bc*sc*i* alias: pci:v0000168Cd0000001Csv*sd*bc*sc*i* alias: pci:v0000168Cd0000001Dsv*sd*bc*sc*i* alias: pci:v0000168Cd00000023sv*sd*bc*sc*i* alias: pci:v0000168Cd00000024sv*sd*bc*sc*i* alias: pci:v0000168Cd00009013sv*sd*bc*sc*i* srcversion: 3520C0B36DC5D878F4672E8 parm: ath_debug:Load-time debug output enable (int) parm: ratectl:Rate control algorithm [amrr|minstrel|onoe|sample], defaults to 'sample' (charp) parm: autocreate:Create ath device in [sta|ap|wds|adhoc|ahdemo|monitor] mode. defaults to sta, use 'none' to disable (charp) parm: tpc:Enable/disable per-packet transmit power control (TPC) capability (int) parm: rfkill:Enable/disable RFKILL capability (int) parm: xchanmode:Enable/disable extended channel mode (int) parm: outdoor:Enable/disable outdoor use (int) parm: countrycode:Override default country code (int)
now load the driver
~/madwifi-ng-r2667-20070825$ sudo modprobe -v ath_pci insmod /lib/modules/2.6.15-29-386/madwifi-ng/new_wlan.ko insmod /lib/modules/2.6.15-29-386/net/ath_hal.ko insmod /lib/modules/2.6.15-29-386/net/wlan.ko insmod /lib/modules/2.6.15-29-386/net/ath_pci.ko ~/madwifi-ng-r2667-20070825$ lsmod|grep ath ath_rate_sample 14336 1 ath_pci 117928 0 wlan 216752 4 wlan_scan_sta,ath_rate_sample,ath_pci ath_hal 233056 3 ath_rate_sample,ath_pci
Now what does iwpriv show?
~/madwifi-ng-r2667-20070825$ iwpriv ath0 ath0 Available private ioctls : setoptie (8BEE) : set 256 byte & get 0 getoptie (8BEF) : set 0 & get 256 byte setkey (8BF2) : set 60 byte & get 0 delkey (8BF4) : set 7 byte & get 0 setmlme (8BF0) : set 42 byte & get 0 addmac (8BF6) : set 1 addr & get 0 delmac (8BF8) : set 1 addr & get 0 kickmac (8BFE) : set 1 addr & get 0 wds_add (8BFA) : set 1 addr & get 0 wds_del (8BFC) : set 1 addr & get 0 setchanlist (8BE6) : set 32 byte & get 0 getchanlist (8BE7) : set 0 & get 32 byte getchaninfo (8BED) : set 0 & get 2044 byte mode (8BE2) : set 6 char & get 0 get_mode (8BE3) : set 0 & get 6 char setwmmparams (8BE4) : set 4 int & get 0 getwmmparams (8BE5) : set 3 int & get 1 int cwmin (0001) : set 3 int & get 0 get_cwmin (0001) : set 2 int & get 1 int cwmax (0002) : set 3 int & get 0 get_cwmax (0002) : set 2 int & get 1 int aifs (0003) : set 3 int & get 0 get_aifs (0003) : set 2 int & get 1 int txoplimit (0004) : set 3 int & get 0 get_txoplimit (0004) : set 2 int & get 1 int acm (0005) : set 3 int & get 0 get_acm (0005) : set 2 int & get 1 int noackpolicy (0006) : set 3 int & get 0 get_noackpolicy (0006) : set 2 int & get 1 int setparam (8BE0) : set 2 int & get 0 getparam (8BE1) : set 1 int & get 1 int authmode (0003) : set 1 int & get 0 get_authmode (0003) : set 0 & get 1 int protmode (0004) : set 1 int & get 0 get_protmode (0004) : set 0 & get 1 int mcastcipher (0005) : set 1 int & get 0 get_mcastcipher (0005) : set 0 & get 1 int mcastkeylen (0006) : set 1 int & get 0 get_mcastkeylen (0006) : set 0 & get 1 int ucastciphers (0007) : set 1 int & get 0 get_uciphers (0007) : set 0 & get 1 int ucastcipher (0008) : set 1 int & get 0 get_ucastcipher (0008) : set 0 & get 1 int ucastkeylen (0009) : set 1 int & get 0 get_ucastkeylen (0009) : set 0 & get 1 int keymgtalgs (0015) : set 1 int & get 0 get_keymgtalgs (0015) : set 0 & get 1 int rsncaps (0016) : set 1 int & get 0 get_rsncaps (0016) : set 0 & get 1 int hostroaming (000C) : set 1 int & get 0 get_hostroaming (000C) : set 0 & get 1 int privacy (000D) : set 1 int & get 0 get_privacy (000D) : set 0 & get 1 int countermeasures (000E) : set 1 int & get 0 get_countermeas (000E) : set 0 & get 1 int dropunencrypted (000F) : set 1 int & get 0 get_dropunencry (000F) : set 0 & get 1 int wpa (000A) : set 1 int & get 0 get_wpa (000A) : set 0 & get 1 int driver_caps (0010) : set 1 int & get 0 get_driver_caps (0010) : set 0 & get 1 int maccmd (0011) : set 1 int & get 0 wmm (0012) : set 1 int & get 0 get_wmm (0012) : set 0 & get 1 int hide_ssid (0013) : set 1 int & get 0 get_hide_ssid (0013) : set 0 & get 1 int ap_bridge (0014) : set 1 int & get 0 get_ap_bridge (0014) : set 0 & get 1 int inact (0017) : set 1 int & get 0 get_inact (0017) : set 0 & get 1 int inact_auth (0018) : set 1 int & get 0 get_inact_auth (0018) : set 0 & get 1 int inact_init (0019) : set 1 int & get 0 get_inact_init (0019) : set 0 & get 1 int abolt (001A) : set 1 int & get 0 get_abolt (001A) : set 0 & get 1 int dtim_period (001C) : set 1 int & get 0 get_dtim_period (001C) : set 0 & get 1 int bintval (001D) : set 1 int & get 0 get_bintval (001D) : set 0 & get 1 int doth (001E) : set 1 int & get 0 get_doth (001E) : set 0 & get 1 int doth_pwrtgt (001F) : set 1 int & get 0 get_doth_pwrtgt (001F) : set 0 & get 1 int doth_reassoc (0020) : set 1 int & get 0 compression (0021) : set 1 int & get 0 get_compression (0021) : set 0 & get 1 int ff (0022) : set 1 int & get 0 get_ff (0022) : set 0 & get 1 int turbo (0001) : set 1 int & get 0 get_turbo (0001) : set 0 & get 1 int xr (0023) : set 1 int & get 0 get_xr (0023) : set 0 & get 1 int burst (0024) : set 1 int & get 0 get_burst (0024) : set 0 & get 1 int doth_chanswitch (8BE8) : set 2 int & get 0 pureg (0025) : set 1 int & get 0 get_pureg (0025) : set 0 & get 1 int ar (0026) : set 1 int & get 0 get_ar (0026) : set 0 & get 1 int wds (0027) : set 1 int & get 0 get_wds (0027) : set 0 & get 1 int bgscan (0028) : set 1 int & get 0 get_bgscan (0028) : set 0 & get 1 int bgscanidle (0029) : set 1 int & get 0 get_bgscanidle (0029) : set 0 & get 1 int bgscanintvl (002A) : set 1 int & get 0 get_bgscanintvl (002A) : set 0 & get 1 int mcast_rate (002B) : set 1 int & get 0 get_mcast_rate (002B) : set 0 & get 1 int coverageclass (002C) : set 1 int & get 0 get_coveragecls (002C) : set 0 & get 1 int countryie (002D) : set 1 int & get 0 get_countryie (002D) : set 0 & get 1 int scanvalid (002E) : set 1 int & get 0 get_scanvalid (002E) : set 0 & get 1 int regclass (003B) : set 1 int & get 0 get_regclass (003B) : set 0 & get 1 int dropunenceapol (003C) : set 1 int & get 0 get_dropunencea (003C) : set 0 & get 1 int shpreamble (003D) : set 1 int & get 0 get_shpreamble (003D) : set 0 & get 1 int rssi11a (002F) : set 1 int & get 0 get_rssi11a (002F) : set 0 & get 1 int rssi11b (0030) : set 1 int & get 0 get_rssi11b (0030) : set 0 & get 1 int rssi11g (0031) : set 1 int & get 0 get_rssi11g (0031) : set 0 & get 1 int rate11a (0032) : set 1 int & get 0 get_rate11a (0032) : set 0 & get 1 int rate11b (0033) : set 1 int & get 0 get_rate11b (0033) : set 0 & get 1 int rate11g (0034) : set 1 int & get 0 get_rate11g (0034) : set 0 & get 1 int uapsd (0035) : set 1 int & get 0 get_uapsd (0035) : set 0 & get 1 int sleep (0036) : set 1 int & get 0 get_sleep (0036) : set 0 & get 1 int qosnull (0037) : set 1 int & get 0 pspoll (0038) : set 1 int & get 0 eospdrop (0039) : set 1 int & get 0 get_eospdrop (0039) : set 0 & get 1 int markdfs (003A) : set 1 int & get 0 get_markdfs (003A) : set 0 & get 1 int setiebuf (8BEA) : set 1032 byte & get 0 getiebuf (8BE9) : set 0 & get 1032 byte setfilter (8BEC) : set 4 byte & get 0
iwpriv will show you all the read-only values with the --all parameter.
~/madwifi-ng-r2667-20070825$ iwpriv ath0 --all ath0 Available read-only private ioctl : ath0 getoptie: ath0 getchanlist: ath0 getchaninfo: ath0 get_mode:11g ath0 get_authmode:1 ath0 get_protmode:1 ath0 get_mcastcipher:1 ath0 get_mcastkeylen:16 ath0 get_uciphers:15 ath0 get_ucastcipher:0 ath0 get_ucastkeylen:13 ath0 get_keymgtalgs:3 ath0 get_rsncaps:0 ath0 get_hostroaming:1 ath0 get_privacy:0 ath0 get_countermeas:0 ath0 get_dropunencry:0 ath0 get_wpa:0 ath0 get_driver_caps:2005065743 ath0 get_wmm:1 ath0 get_hide_ssid:0 ath0 get_ap_bridge:1 ath0 get_inact:300 ath0 get_inact_auth:180 ath0 get_inact_init:30 ath0 get_abolt:218 ath0 get_dtim_period:1 ath0 get_bintval:0 ath0 get_doth:1 ath0 get_doth_pwrtgt:27 ath0 get_compression:0 ath0 get_ff:1 ath0 get_turbo:1 ath0 get_xr:1 ath0 get_burst:1 ath0 get_pureg:0 ath0 get_ar:1 ath0 get_wds:0 ath0 get_bgscan:1 ath0 get_bgscanidle:252 ath0 get_bgscanintvl:300 ath0 get_mcast_rate:1000 ath0 get_coveragecls:0 ath0 get_countryie:0 ath0 get_scanvalid:60 ath0 get_regclass:0 ath0 get_dropunencea:0 ath0 get_shpreamble:1 ath0 get_rssi11a:24 ath0 get_rssi11b:24 ath0 get_rssi11g:24 ath0 get_rate11a:48 ath0 get_rate11b:10 ath0 get_rate11g:18 ath0 get_uapsd:0 ath0 get_sleep:0 ath0 get_eospdrop:0 ath0 get_markdfs:1 Interface doesn't accept private ioctl... getiebuf (8BE9): Invalid argument
For my purposes I need to load the driver in ad-hoc mode. So in /etc/modprobe.d/options, I add autocreate=adhoc and counrtrycode=511 to get more channels
# Enable double-buffering so gstreamer et. al. work options quickcam compatible=2 # Default hostap to managed mode options hostap_pci iw_mode=2 options hostap_cs iw_mode=2 options ath_pci autocreate=adhoc countrycode=511
Now I need to reload the driver to get the kernel driver options to take effect.
$ sudo ifconfig ath0 down $ sudo modprobe -r ath_pci $ sudo modprobe -v ath_pci insmod /lib/modules/2.6.15-29-386/madwifi-ng/new_wlan.ko insmod /lib/modules/2.6.15-29-386/net/ath_pci.ko autocreate=adhoc countrycode=511 $ iwconfig ath0 ath0 IEEE 802.11a ESSID:"" Mode:Ad-Hoc Frequency:5.765 GHz Cell: Not-Associated Bit Rate:0 kb/s Tx-Power:5 dBm Sensitivity=1/1 Retry:off RTS thr:off Fragment thr:off Power Management:off Link Quality=0/70 Signal level=-106 dBm Noise level=-106 dBm Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0
Here an enumeration net80211/ieee80211_ioctl.h with comments.
enum { IEEE80211_PARAM_TURBO = 1, /* turbo mode */ IEEE80211_PARAM_MODE = 2, /* phy mode (11a, 11b, etc.) */ IEEE80211_PARAM_AUTHMODE = 3, /* authentication mode */ IEEE80211_PARAM_PROTMODE = 4, /* 802.11g protection */ IEEE80211_PARAM_MCASTCIPHER = 5, /* multicast/default cipher */ IEEE80211_PARAM_MCASTKEYLEN = 6, /* multicast key length */ IEEE80211_PARAM_UCASTCIPHERS = 7, /* unicast cipher suites */ IEEE80211_PARAM_UCASTCIPHER = 8, /* unicast cipher */ IEEE80211_PARAM_UCASTKEYLEN = 9, /* unicast key length */ IEEE80211_PARAM_WPA = 10, /* WPA mode (0,1,2) */ IEEE80211_PARAM_ROAMING = 12, /* roaming mode */ IEEE80211_PARAM_PRIVACY = 13, /* privacy invoked */ IEEE80211_PARAM_COUNTERMEASURES = 14, /* WPA/TKIP countermeasures */ IEEE80211_PARAM_DROPUNENCRYPTED = 15, /* discard unencrypted frames */ IEEE80211_PARAM_DRIVER_CAPS = 16, /* driver capabilities */ IEEE80211_PARAM_MACCMD = 17, /* MAC ACL operation */ IEEE80211_PARAM_WMM = 18, /* WMM mode (on, off) */ IEEE80211_PARAM_HIDESSID = 19, /* hide SSID mode (on, off) */ IEEE80211_PARAM_APBRIDGE = 20, /* AP inter-sta bridging */ IEEE80211_PARAM_KEYMGTALGS = 21, /* key management algorithms */ IEEE80211_PARAM_RSNCAPS = 22, /* RSN capabilities */ IEEE80211_PARAM_INACT = 23, /* station inactivity timeout */ IEEE80211_PARAM_INACT_AUTH = 24, /* station auth inact timeout */ IEEE80211_PARAM_INACT_INIT = 25, /* station init inact timeout */ IEEE80211_PARAM_ABOLT = 26, /* Atheros Adv. Capabilities */ IEEE80211_PARAM_DTIM_PERIOD = 28, /* DTIM period (beacons) */ IEEE80211_PARAM_BEACON_INTERVAL = 29, /* beacon interval (ms) */ IEEE80211_PARAM_DOTH = 30, /* 11.h is on/off */ IEEE80211_PARAM_PWRTARGET = 31, /* Current Channel Pwr Constraint */ IEEE80211_PARAM_GENREASSOC = 32, /* Generate a reassociation request */ IEEE80211_PARAM_COMPRESSION = 33, /* compression */ IEEE80211_PARAM_FF = 34, /* fast frames support */ IEEE80211_PARAM_XR = 35, /* XR support */ IEEE80211_PARAM_BURST = 36, /* burst mode */ IEEE80211_PARAM_PUREG = 37, /* pure 11g (no 11b stations) */ IEEE80211_PARAM_AR = 38, /* AR support */ IEEE80211_PARAM_WDS = 39, /* Enable 4 address processing */ IEEE80211_PARAM_BGSCAN = 40, /* bg scanning (on, off) */ IEEE80211_PARAM_BGSCAN_IDLE = 41, /* bg scan idle threshold */ IEEE80211_PARAM_BGSCAN_INTERVAL = 42, /* bg scan interval */ IEEE80211_PARAM_MCAST_RATE = 43, /* Multicast Tx Rate */ IEEE80211_PARAM_COVERAGE_CLASS = 44, /* coverage class */ IEEE80211_PARAM_COUNTRY_IE = 45, /* enable country IE */ IEEE80211_PARAM_SCANVALID = 46, /* scan cache valid threshold */ IEEE80211_PARAM_ROAM_RSSI_11A = 47, /* rssi threshold in 11a */ IEEE80211_PARAM_ROAM_RSSI_11B = 48, /* rssi threshold in 11b */ IEEE80211_PARAM_ROAM_RSSI_11G = 49, /* rssi threshold in 11g */ IEEE80211_PARAM_ROAM_RATE_11A = 50, /* tx rate threshold in 11a */ IEEE80211_PARAM_ROAM_RATE_11B = 51, /* tx rate threshold in 11b */ IEEE80211_PARAM_ROAM_RATE_11G = 52, /* tx rate threshold in 11g */ IEEE80211_PARAM_UAPSDINFO = 53, /* value for qos info field */ IEEE80211_PARAM_SLEEP = 54, /* force sleep/wake */ IEEE80211_PARAM_QOSNULL = 55, /* force sleep/wake */ IEEE80211_PARAM_PSPOLL = 56, /* force ps-poll generation (sta only) */ IEEE80211_PARAM_EOSPDROP = 57, /* force uapsd EOSP drop (ap only) */ IEEE80211_PARAM_MARKDFS = 58, /* mark a dfs interference channel when found */ IEEE80211_PARAM_REGCLASS = 59, /* enable regclass ids in country IE */ IEEE80211_PARAM_DROPUNENC_EAPOL = 60, /* drop unencrypted eapol frames */ IEEE80211_PARAM_SHPREAMBLE = 61, /* Short Preamble */ IEEE80211_PARAM_DUMPREGS = 62, /* Pretty printed dump of Atheros hardware registers */ };