When compiling, it complains about errors (like ticket #2022) but the patch (3748) is incomplete. In this ticket, the discussion is about the kernel of fedora. But, using the kernel source of www.kernel.org, it produces the same error.
/apps/wireless/atheros/madwifi/net80211/ieee80211_wireless.c: In function 'giwscan_cb':
/apps/wireless/atheros/madwifi/net80211/ieee80211_wireless.c:1810: error: passing argument 1 of 'iwe_stream_add_event' from incompatible pointer type
/apps/wireless/atheros/madwifi/net80211/ieee80211_wireless.c:1810: error: passing argument 3 of 'iwe_stream_add_event' from incompatible pointer type
/apps/wireless/atheros/madwifi/net80211/ieee80211_wireless.c:1810: error: passing argument 4 of 'iwe_stream_add_event' makes pointer from integer without a cast
/apps/wireless/atheros/madwifi/net80211/ieee80211_wireless.c:1810: error: too few arguments to function 'iwe_stream_add_event'
So, here is a patch that works with madwifi 0.9.4 & kernel 2.6.28.
regards.