diff --git a/net-wireless/madwifi-ng-tools/Manifest b/net-wireless/madwifi-ng-tools/Manifest new file mode 100644 index 000000000..6ff0c59b9 --- /dev/null +++ b/net-wireless/madwifi-ng-tools/Manifest @@ -0,0 +1,2 @@ +DIST madwifi-0.9.4-r4176-20111123.tar.gz 3534939 RMD160 5368b7baf31d4dccd957533b64e8e9b4d406beae SHA1 7c1bbe895d3eca8e32173cb80ce8f85b036317cb SHA256 d93df106f31995ec9c3726cf9744cc17cb589e4c45b6af75e5e3989e69ad7bdc +EBUILD madwifi-ng-tools-0.9.4.4176.20111123.ebuild 2055 RMD160 b30b53d2611ea7962f08f42d5c323e2b1c286b4b SHA1 5c54445f71af3855faa38779e174a14e4712eea8 SHA256 8d3057eeade58b7b53f3d95da63e7d58c0fbbe617f7ef80d39019f839591c5df diff --git a/net-wireless/madwifi-ng-tools/madwifi-ng-tools-0.9.4.4176.20111123.ebuild b/net-wireless/madwifi-ng-tools/madwifi-ng-tools-0.9.4.4176.20111123.ebuild new file mode 100644 index 000000000..d78dec494 --- /dev/null +++ b/net-wireless/madwifi-ng-tools/madwifi-ng-tools-0.9.4.4176.20111123.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-wireless/madwifi-ng-tools/madwifi-ng-tools-0.9.4.4165.20110816.ebuild,v 1.2 2011/10/15 23:22:51 maekke Exp $ + +EAPI="2" + +inherit versionator toolchain-funcs + +MY_PN=${PN/-ng-tools/} +MY_PV=$(get_version_component_range 1-3) +MY_REV=$(get_version_component_range 4) +MY_DATE=$(get_version_component_range 5) +MY_P=${MY_PN}-${MY_PV}-r${MY_REV}-${MY_DATE} +S=${WORKDIR}/${MY_P}/tools + +DESCRIPTION="Next Generation tools for configuration of Atheros based IEEE 802.11a/b/g wireless LAN cards" +HOMEPAGE="http://www.madwifi-project.org/" +SRC_URI="http://snapshots.madwifi-project.org/${MY_PN}-${MY_PV}/${MY_P}.tar.gz" + +LICENSE="|| ( BSD GPL-2 )" +SLOT="0" +KEYWORDS="amd64 ~ppc x86" +IUSE="" + +DEPEND="" +RDEPEND="!net-wireless/madwifi-old-tools" + +src_prepare() { + # format string fix from solar + #sed -i \ +# -e 's:err(1, ifr.ifr_name);:err(1, "%s", ifr.ifr_name);:g' \ +# ${S}/tools/athstats.c || die + + sed -i \ + -e "s:CC =.*:CC = $(tc-getCC):" \ + -e "s:CFLAGS=:CFLAGS+=:" \ + -e "s:LDFLAGS=:LDFLAGS+=:" \ + "${S}"/Makefile || die +} + +src_install() { + emake DESTDIR="${D}" BINDIR=/usr/bin MANDIR=/usr/share/man STRIP=echo \ + install || die "emake install failed" + + dodir /sbin + mv "${D}"/usr/bin/wlanconfig "${D}"/sbin + + # install headers for use by + # net-wireless/wpa_supplicant and net-wireless/hostapd + cd "${S}"/.. + insinto /usr/include/madwifi/include/ + doins include/*.h + insinto /usr/include/madwifi/net80211 + doins net80211/*.h +} + +pkg_postinst() { + if [ -e "${ROOT}"/etc/udev/rules.d/65-madwifi.rules ]; then + ewarn + ewarn "The udev rules for creating interfaces (athX) are no longer needed." + ewarn + ewarn "You should manually remove the /etc/udev/rules.d/65-madwifi.rules file" + ewarn "and either run 'udevstart' or reboot for the changes to take effect." + ewarn + fi + einfo + einfo "If you use net-wireless/wpa_supplicant or net-wireless/hostapd with madwifi" + einfo "you should remerge them now." + einfo +} diff --git a/net-wireless/madwifi-ng/Manifest b/net-wireless/madwifi-ng/Manifest new file mode 100644 index 000000000..55b937307 --- /dev/null +++ b/net-wireless/madwifi-ng/Manifest @@ -0,0 +1,8 @@ +AUX madwifi-dfs-ieee80211-skb-update.patch 453 RMD160 856e6931da9bf96bc993a6f568933d6742f81719 SHA1 41928bbfdbb4e1c1fa5c1ed93fb673542c18bbc3 SHA256 25c4d782cdaac53ae4bf36253b93e27c475fec785043e4d080c83e61eb9c809f +AUX madwifi-ng-0.9.3-uudecode-gcda-fix.patch 340 RMD160 2a18fc4f9e66aa131e901e7e46930e08e2ece7ea SHA1 3c84bf4e203ab3c810c734816dd1291ba19b0005 SHA256 be6e7a66acad56044c25ab56d9cbd7d5326c4ba21f5d9ed25caef56a9577bdc8 +AUX madwifi-ng-0.9.4-2.6.27-r3811.patch 6515 RMD160 6d52c90f5afad8c225a2d23d90af593e4f00b666 SHA1 0f49938eb9a9b523ebb8925a446018010454184b SHA256 d98fc130d1588b599119eda5d3d723f6e7b83201a89ca9c1bac8760042308e41 +AUX madwifi-ng-0.9.4-request_module-build.patch 860 RMD160 d34c08fe10e21226e1593098cf23edc98275d907 SHA1 4a3c9894a8272aefe5be4c718753ead8c4277858 SHA256 5a9ade8f6d5c86ef7e80085c55983a6cf7269d367d383f175f3b88974ddd47aa +AUX madwifi-ng-injection-r3925.patch 1171 RMD160 f00fb830c3116b8ef5c6b0277105f8ffb9126b46 SHA1 9eb78206792d0f1c8fc230e3b850849cb86080d9 SHA256 48892221bea5da0a34c51235a80201e0bebb63be22075b04df659ce06a09dfed +AUX madwifi-ng-r1886.patch 965 RMD160 86389659efbd846c12153c7e11043f0fb3c7fd8b SHA1 cda44aff6e99ade85b736cc2f31b13cfee6c3721 SHA256 e068fbfaf9c2f27ac9670b6fc43939ceade0e6c40df88d5e23006be640ca0fbe +DIST madwifi-0.9.4-r4176-20111123.tar.gz 3534939 RMD160 5368b7baf31d4dccd957533b64e8e9b4d406beae SHA1 7c1bbe895d3eca8e32173cb80ce8f85b036317cb SHA256 d93df106f31995ec9c3726cf9744cc17cb589e4c45b6af75e5e3989e69ad7bdc +EBUILD madwifi-ng-0.9.4.4176.20111123.ebuild 3449 RMD160 0f58e96d65018934cb2b48d3c4225797f83686ad SHA1 2453b4aabac2582f00e02db6026eadf9f2889244 SHA256 5a4bc282eeb179471eb234927347bac340d362ecfbfb1c045e137542ce7107f4 diff --git a/net-wireless/madwifi-ng/files/madwifi-dfs-ieee80211-skb-update.patch b/net-wireless/madwifi-ng/files/madwifi-dfs-ieee80211-skb-update.patch new file mode 100644 index 000000000..af14023b8 --- /dev/null +++ b/net-wireless/madwifi-ng/files/madwifi-dfs-ieee80211-skb-update.patch @@ -0,0 +1,12 @@ +--- a/net80211/ieee80211_linux.h 2008-05-09 01:15:01 +0400 ++++ b/net80211/ieee80211_linux.h 2008-05-11 02:26:35 +0400 +@@ -315,6 +315,9 @@ typedef spinlock_t acl_lock_t; + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) + #define __skb_append(a,b,c) __skb_append(a, b) + #endif ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,25) ++#define __skb_append(a,b,c) __skb_queue_after(c,a,b) ++#endif + + /* + * Per-node power-save queue definitions. Beware of control diff --git a/net-wireless/madwifi-ng/files/madwifi-ng-0.9.3-uudecode-gcda-fix.patch b/net-wireless/madwifi-ng/files/madwifi-ng-0.9.3-uudecode-gcda-fix.patch new file mode 100644 index 000000000..686958cc1 --- /dev/null +++ b/net-wireless/madwifi-ng/files/madwifi-ng-0.9.3-uudecode-gcda-fix.patch @@ -0,0 +1,12 @@ +Index: ath_hal/Makefile +=================================================================== +--- ath_hal/Makefile (revision 1648) ++++ ath_hal/Makefile (working copy) +@@ -61,6 +61,7 @@ + ath_hal-objs := ah_osdep.o ${TARGET}.hal.o + + hostprogs-y := uudecode ++uudecode-objs := uudecode.o + + # For older 2.6 kernels + host-progs := $(hostprogs-y) diff --git a/net-wireless/madwifi-ng/files/madwifi-ng-0.9.4-2.6.27-r3811.patch b/net-wireless/madwifi-ng/files/madwifi-ng-0.9.4-2.6.27-r3811.patch new file mode 100644 index 000000000..b02795f5f --- /dev/null +++ b/net-wireless/madwifi-ng/files/madwifi-ng-0.9.4-2.6.27-r3811.patch @@ -0,0 +1,190 @@ +=== modified file 'net80211/ieee80211_wireless.c' +--- net80211/ieee80211_wireless.c 2008-10-22 18:13:35 +0000 ++++ net80211/ieee80211_wireless.c 2008-10-22 18:13:41 +0000 +@@ -1551,11 +1551,19 @@ + + struct iwscanreq { /* XXX: right place for this declaration? */ + struct ieee80211vap *vap; ++ struct iw_request_info *info; + char *current_ev; + char *end_buf; + int mode; + }; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) && !defined(IW_REQUEST_FLAG_COMPAT) ++#define iwe_stream_add_event(a, b, c, d, e) iwe_stream_add_event(b, c, d, e) ++#define iwe_stream_add_point(a, b, c, d, e) iwe_stream_add_point(b, c, d, e) ++#define iwe_stream_add_value(a, b, c, d, e, f) \ ++ iwe_stream_add_value(b, c, d, e, f) ++#define iwe_stream_lcp_len(a) IW_EV_LCP_LEN ++#endif + static int + giwscan_cb(void *arg, const struct ieee80211_scan_entry *se) + { +@@ -1590,7 +1598,8 @@ + IEEE80211_ADDR_COPY(iwe.u.ap_addr.sa_data, se->se_macaddr); + else + IEEE80211_ADDR_COPY(iwe.u.ap_addr.sa_data, se->se_bssid); +- current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_ADDR_LEN); ++ current_ev = iwe_stream_add_event(req->info, current_ev, end_buf, ++ &iwe, IW_EV_ADDR_LEN); + + /* We ran out of space in the buffer. */ + if (last_ev == current_ev) +@@ -1603,11 +1612,11 @@ + if (vap->iv_opmode == IEEE80211_M_HOSTAP) { + iwe.u.data.length = vap->iv_des_nssid > 0 ? + vap->iv_des_ssid[0].len : 0; +- current_ev = iwe_stream_add_point(current_ev, ++ current_ev = iwe_stream_add_point(req->info, current_ev, + end_buf, &iwe, vap->iv_des_ssid[0].ssid); + } else { + iwe.u.data.length = se->se_ssid[1]; +- current_ev = iwe_stream_add_point(current_ev, ++ current_ev = iwe_stream_add_point(req->info, current_ev, + end_buf, &iwe, (char *) se->se_ssid+2); + } + +@@ -1621,8 +1630,8 @@ + iwe.cmd = SIOCGIWMODE; + iwe.u.mode = se->se_capinfo & IEEE80211_CAPINFO_ESS ? + IW_MODE_MASTER : IW_MODE_ADHOC; +- current_ev = iwe_stream_add_event(current_ev, +- end_buf, &iwe, IW_EV_UINT_LEN); ++ current_ev = iwe_stream_add_event(req->info, current_ev, ++ end_buf, &iwe, IW_EV_UINT_LEN); + + /* We ran out of space in the buffer. */ + if (last_ev == current_ev) +@@ -1634,8 +1643,8 @@ + iwe.cmd = SIOCGIWFREQ; + iwe.u.freq.m = se->se_chan->ic_freq * 100000; + iwe.u.freq.e = 1; +- current_ev = iwe_stream_add_event(current_ev, +- end_buf, &iwe, IW_EV_FREQ_LEN); ++ current_ev = iwe_stream_add_event(req->info, current_ev, ++ end_buf, &iwe, IW_EV_FREQ_LEN); + + /* We ran out of space in the buffer. */ + if (last_ev == current_ev) +@@ -1645,8 +1654,8 @@ + last_ev = current_ev; + iwe.cmd = IWEVQUAL; + set_quality(&iwe.u.qual, se->se_rssi, ATH_DEFAULT_NOISE); +- current_ev = iwe_stream_add_event(current_ev, +- end_buf, &iwe, IW_EV_QUAL_LEN); ++ current_ev = iwe_stream_add_event(req->info, current_ev, ++ end_buf, &iwe, IW_EV_QUAL_LEN); + + /* We ran out of space in the buffer */ + if (last_ev == current_ev) +@@ -1660,7 +1669,8 @@ + else + iwe.u.data.flags = IW_ENCODE_DISABLED; + iwe.u.data.length = 0; +- current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, ""); ++ current_ev = iwe_stream_add_point(req->info, current_ev, ++ end_buf, &iwe, ""); + + /* We ran out of space in the buffer. */ + if (last_ev == current_ev) +@@ -1669,28 +1679,28 @@ + memset(&iwe, 0, sizeof(iwe)); + last_ev = current_ev; + iwe.cmd = SIOCGIWRATE; +- current_val = current_ev + IW_EV_LCP_LEN; ++ current_val = current_ev + iwe_stream_lcp_len(req->info); + /* NB: not sorted, does it matter? */ + for (j = 0; j < se->se_rates[1]; j++) { + int r = se->se_rates[2 + j] & IEEE80211_RATE_VAL; + if (r != 0) { + iwe.u.bitrate.value = r * (1000000 / 2); +- current_val = iwe_stream_add_value(current_ev, +- current_val, end_buf, &iwe, +- IW_EV_PARAM_LEN); ++ current_val = iwe_stream_add_value(req->info, ++ current_ev, current_val, end_buf, ++ &iwe, IW_EV_PARAM_LEN); + } + } + for (j = 0; j < se->se_xrates[1]; j++) { + int r = se->se_xrates[2+j] & IEEE80211_RATE_VAL; + if (r != 0) { + iwe.u.bitrate.value = r * (1000000 / 2); +- current_val = iwe_stream_add_value(current_ev, +- current_val, end_buf, &iwe, +- IW_EV_PARAM_LEN); ++ current_val = iwe_stream_add_value(req->info, ++ current_ev, current_val, end_buf, ++ &iwe, IW_EV_PARAM_LEN); + } + } + /* remove fixed header if no rates were added */ +- if ((current_val - current_ev) > IW_EV_LCP_LEN) { ++ if ((current_val - current_ev) > iwe_stream_lcp_len(req->info)) { + current_ev = current_val; + } else { + /* We ran out of space in the buffer. */ +@@ -1704,7 +1714,8 @@ + iwe.cmd = IWEVCUSTOM; + snprintf(buf, sizeof(buf), "bcn_int=%d", se->se_intval); + iwe.u.data.length = strlen(buf); +- current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf); ++ current_ev = iwe_stream_add_point(req->info, current_ev, ++ end_buf, &iwe, buf); + + /* We ran out of space in the buffer. */ + if (last_ev == current_ev) +@@ -1728,8 +1739,8 @@ + rsn_leader, sizeof(rsn_leader) - 1); + #endif + if (iwe.u.data.length != 0) { +- current_ev = iwe_stream_add_point(current_ev, end_buf, +- &iwe, buf); ++ current_ev = iwe_stream_add_point(req->info, ++ current_ev, end_buf, &iwe, buf); + + /* We ran out of space in the buffer */ + if (last_ev == current_ev) +@@ -1754,8 +1765,8 @@ + wpa_leader, sizeof(wpa_leader) - 1); + #endif + if (iwe.u.data.length != 0) { +- current_ev = iwe_stream_add_point(current_ev, end_buf, +- &iwe, buf); ++ current_ev = iwe_stream_add_point(req->info, ++ current_ev, end_buf, &iwe, buf); + + /* We ran out of space in the buffer. */ + if (last_ev == current_ev) +@@ -1773,8 +1784,8 @@ + se->se_wme_ie, se->se_wme_ie[1] + 2, + wme_leader, sizeof(wme_leader) - 1); + if (iwe.u.data.length != 0) { +- current_ev = iwe_stream_add_point(current_ev, end_buf, +- &iwe, buf); ++ current_ev = iwe_stream_add_point(req->info, ++ current_ev, end_buf, &iwe, buf); + + /* We ran out of space in the buffer. */ + if (last_ev == current_ev) +@@ -1791,8 +1802,8 @@ + se->se_ath_ie, se->se_ath_ie[1] + 2, + ath_leader, sizeof(ath_leader) - 1); + if (iwe.u.data.length != 0) { +- current_ev = iwe_stream_add_point(current_ev, end_buf, +- &iwe, buf); ++ current_ev = iwe_stream_add_point(req->info, ++ current_ev, end_buf, &iwe, buf); + + /* We ran out of space in the buffer. */ + if (last_ev == current_ev) +@@ -1815,6 +1826,7 @@ + int res = 0; + + req.vap = vap; ++ req.info = info; + req.current_ev = extra; + if (data->length == 0) { + req.end_buf = extra + IW_SCAN_MAX_DATA; + diff --git a/net-wireless/madwifi-ng/files/madwifi-ng-0.9.4-request_module-build.patch b/net-wireless/madwifi-ng/files/madwifi-ng-0.9.4-request_module-build.patch new file mode 100644 index 000000000..ad338a3b7 --- /dev/null +++ b/net-wireless/madwifi-ng/files/madwifi-ng-0.9.4-request_module-build.patch @@ -0,0 +1,31 @@ +http://bugs.gentoo.org/show_bug.cgi?id=232099 +http://madwifi-project.org/changeset/3880 + +=== modified file 'include/compat.h' +--- include/compat.h 2009-01-31 16:01:16 +0000 ++++ include/compat.h 2009-01-31 16:03:33 +0000 +@@ -175,6 +175,10 @@ + #define DEV_ATH CTL_UNNUMBERED + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) ++#define request_module(_fmt, _modname) request_module(_modname) ++#endif ++ + #endif /* __KERNEL__ */ + + #endif /* _ATH_COMPAT_H_ */ + +=== modified file 'net80211/ieee80211_linux.c' +--- net80211/ieee80211_linux.c 2009-01-31 16:01:16 +0000 ++++ net80211/ieee80211_linux.c 2009-01-31 16:03:09 +0000 +@@ -335,7 +335,7 @@ + { + #ifdef CONFIG_KMOD + int rv; +- rv = request_module(modname); ++ rv = request_module("%s", modname); + if (rv < 0) + printk(KERN_ERR "failed to automatically load module: %s; " \ + "errno: %d\n", modname, rv); + diff --git a/net-wireless/madwifi-ng/files/madwifi-ng-injection-r3925.patch b/net-wireless/madwifi-ng/files/madwifi-ng-injection-r3925.patch new file mode 100644 index 000000000..1999184ec --- /dev/null +++ b/net-wireless/madwifi-ng/files/madwifi-ng-injection-r3925.patch @@ -0,0 +1,32 @@ +=== modified file 'ath/if_ath.c' +--- ath/if_ath.c 2009-06-03 07:46:17 +0000 ++++ ath/if_ath.c 2009-06-03 07:53:24 +0000 +@@ -2359,6 +2359,7 @@ + ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb) + { + struct ath_softc *sc = netdev_priv(dev); ++ struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_phy_params *ph = (struct ieee80211_phy_params *) (skb->cb + sizeof(struct ieee80211_cb)); + const HAL_RATE_TABLE *rt; +@@ -2375,7 +2376,8 @@ + struct ieee80211_frame *wh; + + wh = (struct ieee80211_frame *) skb->data; +- try0 = ph->try0; ++ //try0 = ph->try0; ++ try0 = (ic->ic_opmode == IEEE80211_M_MONITOR) ? 1 : ph->try0; + rt = sc->sc_currates; + txrate = dot11_to_ratecode(sc, rt, ph->rate0); + power = ph->power > 60 ? 60 : ph->power; +@@ -2404,7 +2406,8 @@ + KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); + + +- if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { ++ if (IEEE80211_IS_MULTICAST(wh->i_addr1) || ((ic->ic_opmode == ++ IEEE80211_M_MONITOR) && (skb->data[1]&3) != 0x01) ) { + flags |= HAL_TXDESC_NOACK; /* no ack on broad/multicast */ + sc->sc_stats.ast_tx_noack++; + try0 = 1; + diff --git a/net-wireless/madwifi-ng/files/madwifi-ng-r1886.patch b/net-wireless/madwifi-ng/files/madwifi-ng-r1886.patch new file mode 100644 index 000000000..1ee11bec1 --- /dev/null +++ b/net-wireless/madwifi-ng/files/madwifi-ng-r1886.patch @@ -0,0 +1,26 @@ +allow to inject packets with aircrack-ng + +diff -ur ath/if_ath.c ath/if_ath.c +--- ath/if_ath.c 2007-01-07 21:22:55.312500000 +0100 ++++ ath/if_ath.c 2007-01-07 21:17:09.875000000 +0100 +@@ -2289,6 +2289,7 @@ + ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb) + { + struct ath_softc *sc = dev->priv; ++ struct ieee80211com *ic = &sc->sc_ic; + struct ath_hal *ah = sc->sc_ah; + struct ieee80211_phy_params *ph = (struct ieee80211_phy_params *) (skb->cb + sizeof(struct ieee80211_cb)); + const HAL_RATE_TABLE *rt; +@@ -2305,7 +2306,11 @@ + struct ieee80211_frame *wh; + + wh = (struct ieee80211_frame *) skb->data; +- try0 = ph->try0; ++ try0 = (ic->ic_opmode == IEEE80211_M_MONITOR) ? 1 : ph->try0; ++ /* ++ * The retry value has to be patched to 1 when injecting, ++ * otherwise the sequence number will be overwritten ++ */ + rt = sc->sc_currates; + txrate = dot11_to_ratecode(sc, rt, ph->rate0); + power = ph->power > 60 ? 60 : ph->power; diff --git a/net-wireless/madwifi-ng/madwifi-ng-0.9.4.4176.20111123.ebuild b/net-wireless/madwifi-ng/madwifi-ng-0.9.4.4176.20111123.ebuild new file mode 100644 index 000000000..07388169c --- /dev/null +++ b/net-wireless/madwifi-ng/madwifi-ng-0.9.4.4176.20111123.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-wireless/madwifi-ng/madwifi-ng-0.9.4.4165.20110816.ebuild,v 1.2 2011/10/15 23:23:34 maekke Exp $ + +EAPI="2" + +inherit linux-mod versionator + +MY_PN=${PN/-ng/} +MY_PV=$(get_version_component_range 1-3) +MY_REV=$(get_version_component_range 4) +MY_DATE=$(get_version_component_range 5) +MY_P=${MY_PN}-${MY_PV}-r${MY_REV}-${MY_DATE} +S=${WORKDIR}/${MY_P} + +DESCRIPTION="Next Generation driver for Atheros based IEEE 802.11a/b/g wireless LAN cards" +HOMEPAGE="http://www.madwifi-project.org/" +SRC_URI="http://snapshots.madwifi-project.org/${MY_PN}-${MY_PV}/${MY_P}.tar.gz" + +LICENSE="atheros-hal + || ( BSD GPL-2 )" +SLOT="0" +KEYWORDS="amd64 ~ppc x86" +IUSE="injection" + +RDEPEND="!net-wireless/madwifi-old + net-wireless/wireless-tools + ~net-wireless/madwifi-ng-tools-${PV}" + +pkg_setup() { + CONFIG_CHECK="CRYPTO WIRELESS_EXT SYSCTL" + kernel_is lt 2 6 29 && CONFIG_CHECK="${CONFIG_CHECK} KMOD" + ERROR_CRYPTO="${P} requires Cryptographic API support (CONFIG_CRYPTO)." + ERROR_WIRELESS_EXT="${P} requires CONFIG_WIRELESS_EXT selected by Wireless LAN drivers (non-hamradio) & Wireless Extensions" + kernel_is gt 2 6 33 && \ + ERROR_WIRELESS_EXT="${P} requires CONFIG_WIRELESS_EXT selected by some Wireless LAN drivers (e.g CONFIG_IPW2100)" + ERROR_SYSCTL="${P} requires Sysctl support (CONFIG_SYSCTL)." + ERROR_KMOD="${F} requires CONFIG_KMOD to be set to y or m" + BUILD_TARGETS="all" + MODULESD_ATH_PCI_DOCS="README" + linux-mod_pkg_setup + + MODULE_NAMES='ath_hal(net:"${S}"/ath_hal) + wlan(net:"${S}"/net80211) + wlan_acl(net:"${S}"/net80211) + wlan_ccmp(net:"${S}"/net80211) + wlan_tkip(net:"${S}"/net80211) + wlan_wep(net:"${S}"/net80211) + wlan_xauth(net:"${S}"/net80211) + wlan_scan_sta(net:"${S}"/net80211) + wlan_scan_ap(net:"${S}"/net80211) + ath_rate_amrr(net:"${S}"/ath_rate/amrr) + ath_rate_onoe(net:"${S}"/ath_rate/onoe) + ath_rate_sample(net:"${S}"/ath_rate/sample) + ath_rate_minstrel(net:"${S}"/ath_rate/minstrel) + ath_pci(net:"${S}"/ath)' + + BUILD_PARAMS="KERNELPATH=${KV_OUT_DIR}" +} + +src_prepare() { + use injection && epatch "${FILESDIR}"/${PN}-injection-r3925.patch + for dir in ath ath_hal net80211 ath_rate ath_rate/amrr ath_rate/minstrel ath_rate/onoe ath_rate/sample; do + convert_to_m "${S}/${dir}/Makefile" + done + sed -e 's:-Werror ::' -i Makefile.inc || die "sed -Werror failed" + make svnversion.h || die +} + +src_install() { + linux-mod_src_install + dodoc README THANKS SNAPSHOT || die +} + +pkg_postinst() { + local moddir="${ROOT}/lib/modules/${KV_FULL}/net/" + + linux-mod_pkg_postinst + + einfo + einfo "Interfaces (athX) are now automatically created upon loading the ath_pci" + einfo "module." + einfo + einfo "The type of the created interface can be controlled through the 'autocreate'" + einfo "module parameter." + einfo + einfo "As of net-wireless/madwifi-ng-0.9.3 rate control module selection is done at" + einfo "module load time via the 'ratectl' module parameter." + + elog "Please note: This release is based off of 0.9.3.3 and NOT trunk." + elog "# No AR5007 support in this release;" + elog "experimental support is available for i386 (32bit) in #1679" + elog "# No AR5008 support in this release; support is available in trunk " + elog "No, we will not apply the patch from 1679, if you must, please do so + in an overlay on your system. That is upstreams ticket 1679, not Gentoo's." +}