mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-30 02:30:58 +02:00
updated madwifi builds including karma support, SEXXY
This commit is contained in:
parent
ee5771d48d
commit
d17e5abbe9
5 changed files with 600 additions and 0 deletions
|
|
@ -1,4 +1,6 @@
|
|||
DIST madwifi-hal-0.10.5.6-r3917-20090116.tar.gz 4421921 RMD160 833301ec92cda683737d639b59d29332970097f3 SHA1 22bf3d5980586fc956c8437477ae3f481ccdaa69 SHA256 06d6a65f467f3a8cbc42251e2be53487425db37d55f7e4cbc7aa31edb9c0d81e
|
||||
DIST madwifi-hal-0.10.5.6-r3942-20090205.tar.gz 4421112 RMD160 6c2589d08e64c1ec12611a96c30b460abbedbb1d SHA1 1e14b41f6cb13dbbe8b095bea2bdeff43ad69f82 SHA256 285b7aacaa05ea214277647c0f3ff2ca2ba86b1760dc9328a4ad6f5027b08cf5
|
||||
DIST madwifi-hal-0.10.5.6-r3977-20090408.tar.gz 2183 RMD160 00de4620a746d3df8fd12bfd24ef448c096557bb SHA1 70228f1dc17faa1d2b50419fdd8d23936cef7a17 SHA256 ad47ebd5ca6024af5dc53f68c40efc09caba56a0080196fac3ff63f2101ce2f9
|
||||
EBUILD madwifi-hal-tools-0.10.5.6-r3917.ebuild 2026 RMD160 d2e3044c20a06de29381c9468d103deba2c41ac3 SHA1 3765082ef13a56ac5a37c4820705fa5dd42a3e68 SHA256 d238b41ec47615565647a21bd6375e2e310c8f9370b31e3a2867c13a43276b53
|
||||
EBUILD madwifi-hal-tools-0.10.5.6-r3942.ebuild 2026 RMD160 53fec321825e5011400f411fb43709644aa22d1c SHA1 ce0ffe8010029c96c6c5f471d458218b8eea33ce SHA256 efd0009bb20f6401aa99493f2c93c1e378a4654ff1b906dd775f499327e026c8
|
||||
EBUILD madwifi-hal-tools-0.10.5.6-r3977.ebuild 2026 RMD160 38e30d455ca0f3aed3a1afb919a3c40f9347d4d5 SHA1 f061231d78721c49783bdc58ffc59fbd4af63f03 SHA256 26b9a111d4ac2ce59c1cedf555d12ed4bfa93891a5bb5be5dcf95162c5eed2c7
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
# Copyright 1999-2008 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.ebuild,v 1.5 2008/11/15 16:30:30 pva Exp $
|
||||
|
||||
inherit toolchain-funcs
|
||||
|
||||
MADWIFI_HAL_SNAPSHOT="20090408"
|
||||
MY_P=${P/-tools/}
|
||||
MY_PVR=${MY_P}-${PR}-${MADWIFI_HAL_SNAPSHOT}
|
||||
S="${WORKDIR}/${MY_PVR}/tools"
|
||||
|
||||
DESCRIPTION="Next Generation tools for configuration of Atheros based IEEE 802.11a/b/g wireless LAN cards"
|
||||
HOMEPAGE="http://www.madwifi.org/"
|
||||
SRC_URI="http://snapshots.madwifi-project.org/${MY_P}/${MY_PVR}.tar.gz"
|
||||
|
||||
|
||||
LICENSE="|| ( BSD GPL-2 )"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~ppc ~x86"
|
||||
|
||||
IUSE=""
|
||||
DEPEND="virtual/libc"
|
||||
RDEPEND="!net-wireless/madwifi-old-tools
|
||||
${DEPEND}"
|
||||
|
||||
src_unpack() {
|
||||
unpack ${A}
|
||||
|
||||
# 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
|
||||
|
||||
einfo "S=$S"
|
||||
einfo "PV=$PV"
|
||||
|
||||
sed -i \
|
||||
-e "s:CC =.*:CC = $(tc-getCC):" \
|
||||
-e "s:CFLAGS=:CFLAGS+=:" \
|
||||
-e "s:LDFLAGS=:LDFLAGS+=:" \
|
||||
"${S}"/Makefile || die
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake || die "emake failed"
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
AUX madwifi-hal-digininja-karma.patch 12843 RMD160 ecc2345dba618865270d3e55f6c6b43bc4b6147d SHA1 cc84c9332846268635d5e5767f9b4c9f76f6d2de SHA256 7292a8bc04b0dded223f2609fdaf00d7d362630c0cdf2bf675a2e0973c2a0d18
|
||||
AUX madwifi-hal-injection-r3925.patch 1176 RMD160 8147fbd8919bb6e48f1ea7f327c1bb2eaee76bef SHA1 eff3598129235b30e3841652fc3ec8770a7aa5a4 SHA256 2bb1d618ab01f08cd4b15a66bd4dd6d0dbcebba301edd14c5b0e9095eb23a6cc
|
||||
AUX madwifi-hal-release_header_fix.patch 582 RMD160 9ffcdda76be8d5561adb893fa9fced0064cbf25b SHA1 9038ce45e4a3b7477067843d591ebe45fd3ec84b SHA256 5572ba1214c55d99baf2f613e7a2d2c6432844d40025e335d502e8e6d9954c09
|
||||
DIST madwifi-hal-0.10.5.6-r3917-20090116.tar.gz 4421921 RMD160 833301ec92cda683737d639b59d29332970097f3 SHA1 22bf3d5980586fc956c8437477ae3f481ccdaa69 SHA256 06d6a65f467f3a8cbc42251e2be53487425db37d55f7e4cbc7aa31edb9c0d81e
|
||||
DIST madwifi-hal-0.10.5.6-r3942-20090205.tar.gz 4421112 RMD160 6c2589d08e64c1ec12611a96c30b460abbedbb1d SHA1 1e14b41f6cb13dbbe8b095bea2bdeff43ad69f82 SHA256 285b7aacaa05ea214277647c0f3ff2ca2ba86b1760dc9328a4ad6f5027b08cf5
|
||||
DIST madwifi-hal-0.10.5.6-r3977-20090408.tar.gz 2183 RMD160 00de4620a746d3df8fd12bfd24ef448c096557bb SHA1 70228f1dc17faa1d2b50419fdd8d23936cef7a17 SHA256 ad47ebd5ca6024af5dc53f68c40efc09caba56a0080196fac3ff63f2101ce2f9
|
||||
EBUILD madwifi-hal-0.10.5.6-r3917.ebuild 3146 RMD160 3598b4ff63afa30d575eb170311ecdcd8191b166 SHA1 be0dac90cafbfe44d94bace9658a55e238ed0f2d SHA256 5899e05403204cf1f58f48193e21d0e15db2fabdd222d5017f04fd2eff7c2bb2
|
||||
EBUILD madwifi-hal-0.10.5.6-r3942.ebuild 4784 RMD160 685c14c8a9f557f1e88446772eac50a01479de99 SHA1 d6847432dd7ac7a22453907a9ded82a2d1fe50d9 SHA256 7f20547397fdf45994f742c0b67337aefe69b4603f9379ae9d169647b6da7c1e
|
||||
EBUILD madwifi-hal-0.10.5.6-r3977.ebuild 4864 RMD160 f9a426b9e4155d55c7ccb1313397c57956aec1a7 SHA1 6f2c2fea28dd371465cafa33930a078773d5f561 SHA256 5633cad649d3448d9be6b9bd44196e437f07b97923103b57da94c8ee563cc8e9
|
||||
|
|
|
|||
379
net-wireless/madwifi-hal/files/madwifi-hal-digininja-karma.patch
Normal file
379
net-wireless/madwifi-hal/files/madwifi-hal-digininja-karma.patch
Normal file
|
|
@ -0,0 +1,379 @@
|
|||
diff -Naur ./ath/if_ath.c ../madwifi-karma/ath/if_ath.c
|
||||
--- ./ath/if_ath.c 2008-03-09 11:37:39.000000000 +0000
|
||||
+++ ../madwifi-karma/ath/if_ath.c 2008-03-09 11:09:37.000000000 +0000
|
||||
@@ -10997,6 +10997,7 @@
|
||||
sc->sc_cabq->axq_qnum);
|
||||
IPRINTF(sc, "Use hw queue %u for beacons\n", sc->sc_bhalq);
|
||||
}
|
||||
+ IPRINTF(sc, "Driver has Karma 1.1 patches by Robin Wood <dninja@gmail.com> enabled\n");
|
||||
#undef HAL_MODE_DUALBAND
|
||||
}
|
||||
|
||||
diff -Naur ./net80211/ieee80211.h ../madwifi-karma/net80211/ieee80211.h
|
||||
--- ./net80211/ieee80211.h 2008-03-09 11:37:25.000000000 +0000
|
||||
+++ ../madwifi-karma/net80211/ieee80211.h 2008-03-09 11:07:10.000000000 +0000
|
||||
@@ -996,4 +996,13 @@
|
||||
*/
|
||||
#define IEEE80211_TSF_LEN 8
|
||||
|
||||
+/*
|
||||
+ * KARMA STUFF
|
||||
+ */
|
||||
+typedef struct karma_ssid{
|
||||
+ u_int8_t length;
|
||||
+ u_int8_t ssid[IEEE80211_NWID_LEN];
|
||||
+ struct karma_ssid *next;
|
||||
+} karma_ssid_t;
|
||||
+
|
||||
#endif /* _NET80211_IEEE80211_H_ */
|
||||
diff -Naur ./net80211/ieee80211_input.c ../madwifi-karma/net80211/ieee80211_input.c
|
||||
--- ./net80211/ieee80211_input.c 2008-03-09 11:37:26.000000000 +0000
|
||||
+++ ../madwifi-karma/net80211/ieee80211_input.c 2008-03-09 11:07:10.000000000 +0000
|
||||
@@ -1749,6 +1749,41 @@
|
||||
} while (0)
|
||||
#endif /* !IEEE80211_DEBUG */
|
||||
|
||||
+#define KARMA_VERIFY_SSID(_ssid) do { \
|
||||
+ /* Reject any 0 length ssids */ \
|
||||
+ if (_ssid[1] == 0) { \
|
||||
+ vap->iv_stats.is_rx_ssidmismatch++; \
|
||||
+ return; \
|
||||
+ } \
|
||||
+ \
|
||||
+ traverse = ic->karma_list; \
|
||||
+ \
|
||||
+ karma_match = 0; \
|
||||
+ while (traverse != NULL && !karma_match) { \
|
||||
+ if (((_ssid)[1] == (traverse)->length) && \
|
||||
+ (memcmp (traverse->ssid, (_ssid) + 2, traverse->length) == 0)) { \
|
||||
+ karma_match = 1; \
|
||||
+ } \
|
||||
+ traverse = traverse->next; \
|
||||
+ } \
|
||||
+ \
|
||||
+ if (!karma_match && ic->ic_karma_black_white) { \
|
||||
+ printk ("KARMA: ssid ["); \
|
||||
+ ieee80211_print_essid(_ssid + 2, _ssid[1]); \
|
||||
+ printk ("] not found in whitelist so rejecting\n"); \
|
||||
+ vap->iv_stats.is_rx_ssidmismatch++; \
|
||||
+ return; \
|
||||
+ } \
|
||||
+ if (karma_match && !ic->ic_karma_black_white) { \
|
||||
+ printk ("KARMA: ssid ["); \
|
||||
+ ieee80211_print_essid(_ssid + 2, _ssid[1]); \
|
||||
+ printk ("] found in blacklist so rejecting\n"); \
|
||||
+ vap->iv_stats.is_rx_ssidmismatch++; \
|
||||
+ return; \
|
||||
+ } \
|
||||
+} while (0)
|
||||
+
|
||||
+
|
||||
/* unaligned little endian access */
|
||||
#define LE_READ_2(p) \
|
||||
((u_int16_t) \
|
||||
@@ -3069,6 +3104,12 @@
|
||||
int reassoc, resp, allocbs = 0;
|
||||
u_int8_t qosinfo;
|
||||
|
||||
+ // karma match
|
||||
+ int karma_match = 0;
|
||||
+
|
||||
+ // KARMA
|
||||
+ karma_ssid_t *traverse;
|
||||
+
|
||||
if (ni_or_null == NULL)
|
||||
ni = vap->iv_bss;
|
||||
|
||||
@@ -3527,7 +3568,11 @@
|
||||
return;
|
||||
IEEE80211_VERIFY_ELEMENT(rates, IEEE80211_RATE_MAXSIZE);
|
||||
IEEE80211_VERIFY_ELEMENT(ssid, IEEE80211_NWID_LEN);
|
||||
- IEEE80211_VERIFY_SSID(vap->iv_bss, ssid);
|
||||
+ if (ic->ic_karma == 0) {
|
||||
+ IEEE80211_VERIFY_SSID(vap->iv_bss, ssid);
|
||||
+ } else {
|
||||
+ KARMA_VERIFY_SSID(ssid);
|
||||
+ }
|
||||
if ((vap->iv_flags & IEEE80211_F_HIDESSID) && ssid[1] == 0) {
|
||||
IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
|
||||
wh, ieee80211_mgt_subtype_name[subtype >>
|
||||
@@ -3568,8 +3613,21 @@
|
||||
IEEE80211_FC0_SUBTYPE_SHIFT],
|
||||
"%s", "recv'd rate set invalid");
|
||||
} else {
|
||||
- IEEE80211_SEND_MGMT(ni,
|
||||
- IEEE80211_FC0_SUBTYPE_PROBE_RESP, 0);
|
||||
+ // KARMA: Print the probe response if in adhoc mode
|
||||
+ if ((ic->ic_karma == 0) && (vap->iv_opmode == IEEE80211_M_IBSS)) {
|
||||
+ printk ("KARMA: Probe response for [");
|
||||
+ ieee80211_print_essid(ssid + 2, ssid[1]);
|
||||
+ printk ("]\n");
|
||||
+ }
|
||||
+
|
||||
+ if (ic->ic_karma == 0) {
|
||||
+ IEEE80211_SEND_MGMT(ni,
|
||||
+ IEEE80211_FC0_SUBTYPE_PROBE_RESP, 0);
|
||||
+ } else {
|
||||
+ // KARMA: send the right ssid
|
||||
+ IEEE80211_SEND_MGMT(ni,
|
||||
+ IEEE80211_FC0_SUBTYPE_PROBE_RESP, (int)ssid);
|
||||
+ }
|
||||
}
|
||||
if (allocbs) {
|
||||
/*
|
||||
@@ -3762,7 +3820,12 @@
|
||||
|
||||
IEEE80211_VERIFY_ELEMENT(rates, IEEE80211_RATE_MAXSIZE);
|
||||
IEEE80211_VERIFY_ELEMENT(ssid, IEEE80211_NWID_LEN);
|
||||
- IEEE80211_VERIFY_SSID(vap->iv_bss, ssid);
|
||||
+ // KARMA: Don't verify SSID on Association Requests
|
||||
+ if (ic->ic_karma == 0) {
|
||||
+ IEEE80211_VERIFY_SSID(vap->iv_bss, ssid);
|
||||
+ } else {
|
||||
+ KARMA_VERIFY_SSID(ssid);
|
||||
+ }
|
||||
|
||||
if (ni == vap->iv_bss) {
|
||||
IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_ANY, wh->i_addr2,
|
||||
@@ -3913,6 +3976,17 @@
|
||||
* associated stations. */
|
||||
ieee80211_deliver_l2_rnr(ni);
|
||||
ieee80211_deliver_l2_xid(ni);
|
||||
+
|
||||
+ if (ic->ic_karma > 0) {
|
||||
+ // KARMA: Log SSID that client thinks they are associating to
|
||||
+
|
||||
+ // Maybe
|
||||
+ printk("KARMA: Node [" MAC_FMT "] associating to ssid [",
|
||||
+ MAC_ADDR(wh->i_addr2));
|
||||
+ ieee80211_print_essid(ssid + 2, ssid[1]);
|
||||
+ printk("]\n");
|
||||
+ }
|
||||
+
|
||||
ieee80211_node_join(ni, resp);
|
||||
#ifdef ATH_SUPERG_XR
|
||||
if (ni->ni_prev_vap &&
|
||||
diff -Naur ./net80211/ieee80211_ioctl.h ../madwifi-karma/net80211/ieee80211_ioctl.h
|
||||
--- ./net80211/ieee80211_ioctl.h 2008-03-09 11:37:25.000000000 +0000
|
||||
+++ ../madwifi-karma/net80211/ieee80211_ioctl.h 2008-03-09 11:07:10.000000000 +0000
|
||||
@@ -555,6 +555,7 @@
|
||||
#define IEEE80211_IOCTL_WDSADDMAC (SIOCIWFIRSTPRIV+26)
|
||||
#define IEEE80211_IOCTL_WDSDELMAC (SIOCIWFIRSTPRIV+28)
|
||||
#define IEEE80211_IOCTL_KICKMAC (SIOCIWFIRSTPRIV+30)
|
||||
+#define IEEE80211_IOCTL_KARMA_ADDSSID (SIOCIWFIRSTPRIV+31)
|
||||
|
||||
enum {
|
||||
IEEE80211_WMMPARAMS_CWMIN = 1,
|
||||
@@ -642,6 +643,13 @@
|
||||
IEEE80211_PARAM_BEACON_MISS_THRESH = 73, /* Beacon miss threshold (in beacons) */
|
||||
IEEE80211_PARAM_BEACON_MISS_THRESH_MS = 74, /* Beacon miss threshold (in ms) */
|
||||
IEEE80211_PARAM_RSSI_EWMA = 75,
|
||||
+
|
||||
+ /* special ops */
|
||||
+ IEEE80211_PARAM_KARMA = 101, /* Turn Karma on and off */
|
||||
+ IEEE80211_PARAM_KARMA_BLACK_WHITE = 102, /* Karma black and white listing */
|
||||
+ IEEE80211_PARAM_KARMA_ADD_SSID = 103, /* Add an ssid to the Karma list */
|
||||
+ IEEE80211_PARAM_KARMA_CLEAR_SSID_LIST = 104, /* Clear the Karma ssid list */
|
||||
+
|
||||
};
|
||||
|
||||
#define SIOCG80211STATS (SIOCDEVPRIVATE+2)
|
||||
diff -Naur ./net80211/ieee80211_output.c ../madwifi-karma/net80211/ieee80211_output.c
|
||||
--- ./net80211/ieee80211_output.c 2008-03-09 11:37:26.000000000 +0000
|
||||
+++ ../madwifi-karma/net80211/ieee80211_output.c 2008-03-09 11:07:10.000000000 +0000
|
||||
@@ -1839,9 +1839,17 @@
|
||||
*(__le16 *)frm = htole16(capinfo);
|
||||
frm += 2;
|
||||
|
||||
- /* ssid */
|
||||
- frm = ieee80211_add_ssid(frm, vap->iv_bss->ni_essid,
|
||||
+ // KARMA: If argument is specified, on PROBE_RESP, it is
|
||||
+ // the SSID to use in the response which is the same SSID
|
||||
+ // has the client sent).
|
||||
+ if ((ic->ic_karma > 0) && arg) {
|
||||
+ u_int8_t* ssid = (u_int8_t*)arg;
|
||||
+ frm = ieee80211_add_ssid(frm, ssid + 2, ssid[1]);
|
||||
+ } else {
|
||||
+ /* ssid */
|
||||
+ frm = ieee80211_add_ssid(frm, vap->iv_bss->ni_essid,
|
||||
vap->iv_bss->ni_esslen);
|
||||
+ }
|
||||
|
||||
/* supported rates */
|
||||
frm = ieee80211_add_rates(frm, &ni->ni_rates);
|
||||
diff -Naur ./net80211/ieee80211_var.h ../madwifi-karma/net80211/ieee80211_var.h
|
||||
--- ./net80211/ieee80211_var.h 2008-03-09 11:37:26.000000000 +0000
|
||||
+++ ../madwifi-karma/net80211/ieee80211_var.h 2008-03-09 11:07:10.000000000 +0000
|
||||
@@ -518,6 +518,14 @@
|
||||
unsigned int (*ic_write_register)(struct ieee80211com *, unsigned int, unsigned int);
|
||||
unsigned int (*ic_read_register)(struct ieee80211com *, unsigned int, unsigned int*);
|
||||
#endif /* #ifdef ATH_REVERSE_ENGINEERING */
|
||||
+
|
||||
+ /*
|
||||
+ * KARMA STUFF
|
||||
+ */
|
||||
+ u_int8_t ic_karma; /* enable KARMA */
|
||||
+ u_int8_t ic_karma_black_white; /* KARMA black or white list*/
|
||||
+ karma_ssid_t *karma_list;
|
||||
+
|
||||
};
|
||||
|
||||
#define MAX_PROC_IEEE80211_SIZE 16383
|
||||
diff -Naur ./net80211/ieee80211_wireless.c ../madwifi-karma/net80211/ieee80211_wireless.c
|
||||
--- ./net80211/ieee80211_wireless.c 2008-03-09 11:37:26.000000000 +0000
|
||||
+++ ../madwifi-karma/net80211/ieee80211_wireless.c 2008-03-09 11:07:10.000000000 +0000
|
||||
@@ -2110,6 +2110,57 @@
|
||||
}
|
||||
|
||||
static int
|
||||
+ieee80211_ioctl_karma_addssid(struct net_device *dev, struct iw_request_info *info,
|
||||
+ struct iw_point *wri, char *extra)
|
||||
+{
|
||||
+ struct ieee80211vap *vap = dev->priv;
|
||||
+ struct ieee80211com *ic = vap->iv_ic;
|
||||
+ char s[IEEE80211_NWID_LEN + 1]; // +1 for null terminator
|
||||
+ int length;
|
||||
+ karma_ssid_t *karma_ssid;
|
||||
+
|
||||
+ /*
|
||||
+ * The buffer is a max size of 32 chars so the last char may be
|
||||
+ * the null terminator or may be a character if the string has been truncated
|
||||
+ * by whatever gets the string into here
|
||||
+ */
|
||||
+
|
||||
+ if (wri->length == IEEE80211_NWID_LEN && (wri->pointer + IEEE80211_NWID_LEN) != 0) {
|
||||
+ length = wri->length; // no null terminator as the max buffer size has already done the truncation
|
||||
+ } else {
|
||||
+ if (wri->length > IEEE80211_NWID_LEN) {
|
||||
+ length = IEEE80211_NWID_LEN; // truncate to max length
|
||||
+ } else {
|
||||
+ length = wri->length - 1; // In this case the length will include the null terminator
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (length == 0) {
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ if (copy_from_user(s, wri->pointer, length))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ printk ("KARMA: Adding the following ssid to the list [");
|
||||
+ ieee80211_print_essid(wri->pointer, length);
|
||||
+ printk ("]\n");
|
||||
+
|
||||
+ karma_ssid = kmalloc (sizeof (karma_ssid_t), GFP_KERNEL);
|
||||
+
|
||||
+ if (copy_from_user(karma_ssid->ssid, wri->pointer, length))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ karma_ssid->length = length;
|
||||
+
|
||||
+ // Add to list
|
||||
+ karma_ssid->next = ic->karma_list;
|
||||
+ ic->karma_list = karma_ssid;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
ieee80211_ioctl_setmode(struct net_device *dev, struct iw_request_info *info,
|
||||
struct iw_point *wri, char *extra)
|
||||
{
|
||||
@@ -2271,8 +2322,43 @@
|
||||
int j, caps, bmiss;
|
||||
const struct ieee80211_authenticator *auth;
|
||||
const struct ieee80211_aclator *acl;
|
||||
+
|
||||
+ // KARMA
|
||||
+ karma_ssid_t *karma_ssid;
|
||||
|
||||
switch (param) {
|
||||
+ case IEEE80211_PARAM_KARMA_BLACK_WHITE:
|
||||
+ /*
|
||||
+ * 0 is default so default is blacklist and as there is nothing
|
||||
+ * in the list by default Karma works the same as it used to do
|
||||
+ */
|
||||
+ if (value) {
|
||||
+ printk ("KARMA: Whitelist mode\n");
|
||||
+ } else {
|
||||
+ printk ("KARMA: Blacklist mode\n");
|
||||
+ }
|
||||
+ ic->ic_karma_black_white = value;
|
||||
+ break;
|
||||
+ case IEEE80211_PARAM_KARMA:
|
||||
+ /*
|
||||
+ * Turn karma on and off
|
||||
+ * 0 is default which is off so you can have this version of the module
|
||||
+ * in memory and it will work as normal without Karma running
|
||||
+ */
|
||||
+ ic->ic_karma = value;
|
||||
+ break;
|
||||
+ case IEEE80211_PARAM_KARMA_CLEAR_SSID_LIST:
|
||||
+ printk ("KARMA: Clearing ssid list\n");
|
||||
+
|
||||
+ karma_ssid = ic->karma_list;
|
||||
+
|
||||
+ while (karma_ssid != NULL) {
|
||||
+ ic->karma_list = karma_ssid->next;
|
||||
+ kfree (karma_ssid);
|
||||
+ karma_ssid = ic->karma_list;
|
||||
+ }
|
||||
+
|
||||
+ break;
|
||||
case IEEE80211_PARAM_AUTHMODE:
|
||||
switch (value) {
|
||||
case IEEE80211_AUTH_WPA: /* WPA */
|
||||
@@ -2940,6 +3026,12 @@
|
||||
unsigned int *param = (unsigned int *) extra;
|
||||
|
||||
switch (param[0]) {
|
||||
+ case IEEE80211_PARAM_KARMA_BLACK_WHITE:
|
||||
+ param[0] = ic->ic_karma_black_white;
|
||||
+ break;
|
||||
+ case IEEE80211_PARAM_KARMA:
|
||||
+ param[0] = ic->ic_karma;
|
||||
+ break;
|
||||
case IEEE80211_PARAM_AUTHMODE:
|
||||
if (vap->iv_flags & IEEE80211_F_WPA)
|
||||
param[0] = IEEE80211_AUTH_WPA;
|
||||
@@ -5228,6 +5320,8 @@
|
||||
IW_PRIV_BLOB_TYPE_ENCODING(sizeof(struct ieee80211req_getset_appiebuf) + IEEE80211_APPIE_MAX)
|
||||
#define IW_PRIV_TYPE_FILTER \
|
||||
IW_PRIV_BLOB_TYPE_ENCODING(sizeof(struct ieee80211req_set_filter))
|
||||
+#define IW_PRIV_TYPE_SSID \
|
||||
+ IW_PRIV_TYPE_CHAR | IEEE80211_NWID_LEN
|
||||
|
||||
static const struct iw_priv_args ieee80211_priv_args[] = {
|
||||
/* NB: setoptie & getoptie are !IW_PRIV_SIZE_FIXED */
|
||||
@@ -5617,6 +5711,20 @@
|
||||
{ IEEE80211_IOCTL_FILTERFRAME,
|
||||
IW_PRIV_TYPE_FILTER , 0, "setfilter" },
|
||||
|
||||
+ /* Karma Ops */
|
||||
+ { IEEE80211_PARAM_KARMA_CLEAR_SSID_LIST,
|
||||
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "clrkarmalist" },
|
||||
+ { IEEE80211_IOCTL_KARMA_ADDSSID,
|
||||
+ IW_PRIV_TYPE_SSID , 0, "addkarmassid" },
|
||||
+ { IEEE80211_PARAM_KARMA_BLACK_WHITE,
|
||||
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "karma_bw" },
|
||||
+ { IEEE80211_PARAM_KARMA_BLACK_WHITE,
|
||||
+ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_karma_bw" },
|
||||
+ { IEEE80211_PARAM_KARMA,
|
||||
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "karma" },
|
||||
+ { IEEE80211_PARAM_KARMA,
|
||||
+ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "get_karma" },
|
||||
+
|
||||
{ IEEE80211_PARAM_RSSI_EWMA,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "rssi_ewma" },
|
||||
{ IEEE80211_PARAM_RSSI_EWMA,
|
||||
@@ -5720,6 +5828,9 @@
|
||||
set_priv(IEEE80211_IOCTL_READREG, ieee80211_ioctl_readreg),
|
||||
set_priv(IEEE80211_IOCTL_WRITEREG, ieee80211_ioctl_writereg),
|
||||
#endif /* #ifdef ATH_REVERSE_ENGINEERING */
|
||||
+
|
||||
+ /* KARMA */
|
||||
+ set_priv(IEEE80211_IOCTL_KARMA_ADDSSID, ieee80211_ioctl_karma_addssid),
|
||||
};
|
||||
|
||||
static struct iw_handler_def ieee80211_iw_handler_def = {
|
||||
138
net-wireless/madwifi-hal/madwifi-hal-0.10.5.6-r3977.ebuild
Normal file
138
net-wireless/madwifi-hal/madwifi-hal-0.10.5.6-r3977.ebuild
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
# Copyright 1999-2008 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.ebuild,v 1.4 2008/07/21 19:13:53 steev Exp $
|
||||
|
||||
inherit linux-mod
|
||||
|
||||
MADWIFI_HAL_SNAPSHOT="20090408"
|
||||
MY_PVR=${PF}-${MADWIFI_HAL_SNAPSHOT}
|
||||
S="${WORKDIR}"/${MY_PVR}
|
||||
|
||||
DESCRIPTION="Next Generation driver for Atheros based IEEE 802.11a/b/g wireless LAN cards"
|
||||
HOMEPAGE="http://www.madwifi.org/"
|
||||
SRC_URI="http://snapshots.madwifi.org/${P}/${MY_PVR}.tar.gz"
|
||||
|
||||
LICENSE="atheros-hal
|
||||
|| ( BSD GPL-2 )"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~ppc ~x86"
|
||||
IUSE="+injection default +karma"
|
||||
DEPEND="app-arch/sharutils
|
||||
net-wireless/athload"
|
||||
RDEPEND="!net-wireless/madwifi-old
|
||||
net-wireless/wireless-tools
|
||||
=net-wireless/madwifi-hal-tools-${PVR}
|
||||
net-wireless/athload"
|
||||
|
||||
CONFIG_CHECK="CRYPTO WIRELESS_EXT SYSCTL 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"
|
||||
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"
|
||||
|
||||
pkg_setup() {
|
||||
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_unpack() {
|
||||
if linux_chkconfig_builtin ATH5K; then
|
||||
die "Warning: ATH5k was built into the kernel, if you want to use madwifi \
|
||||
then you must set ath5k to disabled or module in your kernel config."
|
||||
fi
|
||||
|
||||
unpack ${A}
|
||||
|
||||
cd "${S}"
|
||||
epatch "${FILESDIR}"/${PN}-release_header_fix.patch
|
||||
if use injection; then epatch "${FILESDIR}/${PN}-injection-r3925.patch"; fi
|
||||
if use karma; then epatch "${FILESDIR}/${PN}-digininja-karma.patch"; fi
|
||||
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
|
||||
}
|
||||
|
||||
src_install() {
|
||||
linux-mod_src_install
|
||||
|
||||
dodoc README THANKS
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
local moddir="${ROOT}/lib/modules/${KV_FULL}/net/"
|
||||
|
||||
linux-mod_pkg_postinst
|
||||
|
||||
einfo
|
||||
einfo "The type of the created interface can be controlled through the 'autocreate'"
|
||||
einfo "module parameter."
|
||||
|
||||
if linux_chkconfig_module ATH5K; then
|
||||
if use default; then
|
||||
/usr/sbin/athenable madwifi
|
||||
ewarn "Madwifi has been set to default, this is a bad idea, I hope you know what you are doing."
|
||||
ewarn "If you want to use a card that is already inserted you need to modprobe ath_pci."
|
||||
fi
|
||||
if use !default; then
|
||||
/usr/sbin/athenable ath5k
|
||||
ewarn "Ath5k has been set to default, if you know what you are doing and you really do"
|
||||
ewarn "not want this then set the default use flag and rebuild this package. It is strongly"
|
||||
ewarn "recommended that you keep ath5k as default and use 'athload madwifi' if you need to switch"
|
||||
ewarn "If you want to use a card that is already inserted you may need to modprobe ath5k"
|
||||
ewarn "You can switch between madwifi and ath5k using athload <driver>"
|
||||
fi
|
||||
else
|
||||
if use default; then
|
||||
/usr/sbin/athenable madwifi
|
||||
ewarn "Madwifi has been set to default and ath5k isn't installed. It is recommened to"
|
||||
ewarn "use ath5k instead of madwifi, you should enable it as a module in your kernel."
|
||||
ewarn "If you enable ath5k as a module you can switch between madwifi and ath5k"
|
||||
ewarn "using athload <driver>"
|
||||
fi
|
||||
if use !default; then
|
||||
/usr/sbin/athenable ath5k
|
||||
ewarn "Madwifi was not installed as default and you don't have ath5k enabled in the kernel"
|
||||
ewarn "as a module. You need to either enable ath5k in the kernel or rebuild with madwifi"
|
||||
ewarn "and the default use flag or no driver will claim atheros a/b/g cards."
|
||||
ewarn "If you enable ath5k as a module you can switch between madwifi and ath5k"
|
||||
ewarn "using athload <driver>"
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
pkg_postrm()
|
||||
{
|
||||
if linux_chkconfig_present ATH5K; then
|
||||
if use default; then
|
||||
/usr/sbin/athenable ath5k
|
||||
ewarn "Default driver has been switched from madwifi to ath5k"
|
||||
fi
|
||||
if use !default; then
|
||||
/usr/sbin/athenable ath5k
|
||||
ewarn "Default driver for atheros a/b/g cards is ath5k"
|
||||
fi
|
||||
else
|
||||
ewarn "Ath5k is not enabled in the kernel at all, this means you now have no driver to"
|
||||
ewarn "use atheros a/b/g cards. Likely you wish to enable ath5k as a module in the kernel"
|
||||
fi
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue