From 7224c1253228e5c29c78cb3f0f26ce34770f2356 Mon Sep 17 00:00:00 2001 From: BlackNoxis Date: Sat, 15 Feb 2014 23:24:26 +0200 Subject: Added ebuilds for kogaion desktop --- net-wireless/linux-wlan-ng-modules/Manifest | 3 + .../files/digest-linux-wlan-ng-modules-0.2.5 | 3 + .../files/linux-wlan-0.2.3.packet.injection.patch | 303 +++++++++++++++++++++ .../linux-wlan-ng-modules-0.2.5.ebuild | 90 ++++++ 4 files changed, 399 insertions(+) create mode 100644 net-wireless/linux-wlan-ng-modules/Manifest create mode 100644 net-wireless/linux-wlan-ng-modules/files/digest-linux-wlan-ng-modules-0.2.5 create mode 100644 net-wireless/linux-wlan-ng-modules/files/linux-wlan-0.2.3.packet.injection.patch create mode 100644 net-wireless/linux-wlan-ng-modules/linux-wlan-ng-modules-0.2.5.ebuild (limited to 'net-wireless/linux-wlan-ng-modules') diff --git a/net-wireless/linux-wlan-ng-modules/Manifest b/net-wireless/linux-wlan-ng-modules/Manifest new file mode 100644 index 00000000..d9e108a1 --- /dev/null +++ b/net-wireless/linux-wlan-ng-modules/Manifest @@ -0,0 +1,3 @@ +AUX linux-wlan-0.2.3.packet.injection.patch 12854 RMD160 80605f429332acaa974ffe6c77f068709a8aeb75 SHA1 f56a4656a59aee3bf48611958ef0d1ff4d02705a SHA256 75b3b928b5d1ecea8e818f431f780235bcd1cefe592d00dd19b717c0631cb87c +DIST linux-wlan-ng-0.2.5.tar.bz2 457056 RMD160 3bd08380d9bd131ad960a8b3c9dd87972254357a SHA1 6f95e8e63b3271e3d6b88ec0eb267027b8c6d436 SHA256 882f5fe8c3e3a2538f59e96d002866aea1ce3ad33396da0cea7721455f4a42be +EBUILD linux-wlan-ng-modules-0.2.5.ebuild 2344 RMD160 3fd869b8293fa4742436d5c97c2480fe5c34b695 SHA1 cabcf854319046e4a84367053e346c901cf2edbb SHA256 9674c1ad2274fcfee8e935e1870b9f5fa5871125cded304efd42464c90b85854 diff --git a/net-wireless/linux-wlan-ng-modules/files/digest-linux-wlan-ng-modules-0.2.5 b/net-wireless/linux-wlan-ng-modules/files/digest-linux-wlan-ng-modules-0.2.5 new file mode 100644 index 00000000..f91173cb --- /dev/null +++ b/net-wireless/linux-wlan-ng-modules/files/digest-linux-wlan-ng-modules-0.2.5 @@ -0,0 +1,3 @@ +MD5 b4f6eb438533f73cd456e5ee7a3f722a linux-wlan-ng-0.2.5.tar.bz2 457056 +RMD160 3bd08380d9bd131ad960a8b3c9dd87972254357a linux-wlan-ng-0.2.5.tar.bz2 457056 +SHA256 882f5fe8c3e3a2538f59e96d002866aea1ce3ad33396da0cea7721455f4a42be linux-wlan-ng-0.2.5.tar.bz2 457056 diff --git a/net-wireless/linux-wlan-ng-modules/files/linux-wlan-0.2.3.packet.injection.patch b/net-wireless/linux-wlan-ng-modules/files/linux-wlan-0.2.3.packet.injection.patch new file mode 100644 index 00000000..abd0ef72 --- /dev/null +++ b/net-wireless/linux-wlan-ng-modules/files/linux-wlan-0.2.3.packet.injection.patch @@ -0,0 +1,303 @@ +diff -ur linux-wlan-ng-0.2.3/src/p80211/p80211netdev.c linux-wlan-ng-0.2.3-patched/src/p80211/p80211netdev.c +--- linux-wlan-ng-0.2.3/src/p80211/p80211netdev.c 2005-10-31 14:54:59.000000000 -0500 ++++ linux-wlan-ng-0.2.3-patched/src/p80211/p80211netdev.c 2006-03-16 16:33:03.000000000 -0500 +@@ -511,7 +511,7 @@ + * and return success . + * TODO: we need a saner way to handle this + */ +- if(skb->protocol != ETH_P_80211_RAW) { ++ if(skb->protocol != htons(ETH_P_80211_RAW)) { + p80211netdev_start_queue(wlandev); + WLAN_LOG_NOTICE( + "Tx attempt prior to association, frame dropped.\n"); +@@ -523,7 +523,7 @@ + } + + /* Check for raw transmits */ +- if(skb->protocol == ETH_P_80211_RAW) { ++ if(skb->protocol == htons(ETH_P_80211_RAW)) { + if (!capable(CAP_NET_ADMIN)) { + result = 1; + goto failed; +@@ -950,8 +950,9 @@ + dev->set_mac_address = p80211knetdev_set_mac_address; + #endif + #ifdef HAVE_TX_TIMEOUT +- dev->tx_timeout = &p80211knetdev_tx_timeout; +- dev->watchdog_timeo = (wlan_watchdog * HZ) / 1000; ++// korek: still not implemented ++// dev->tx_timeout = &p80211knetdev_tx_timeout; ++// dev->watchdog_timeo = (wlan_watchdog * HZ) / 1000; + #endif + netif_carrier_off(dev); + } +diff -ur linux-wlan-ng-0.2.3/src/prism2/driver/hfa384x.c linux-wlan-ng-0.2.3-patched/src/prism2/driver/hfa384x.c +--- linux-wlan-ng-0.2.3/src/prism2/driver/hfa384x.c 2005-07-20 11:07:16.000000000 -0400 ++++ linux-wlan-ng-0.2.3-patched/src/prism2/driver/hfa384x.c 2006-03-17 11:03:09.000000000 -0500 +@@ -1871,8 +1871,16 @@ + + DBFENTER; + +- cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | +- HFA384x_CMD_AINFO_SET(enable); ++// cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | ++// HFA384x_CMD_AINFO_SET(enable); ++ if (enable == HFA384x_MONITOR_ENABLE) { ++ // KoreK: get into test mode 0x0a ++ cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | ++ HFA384x_CMD_AINFO_SET(0x0a); ++ } else { ++ cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | ++ HFA384x_CMD_AINFO_SET(enable); ++ } + cmd.parm0 = 0; + cmd.parm1 = 0; + cmd.parm2 = 0; +@@ -3112,12 +3120,34 @@ + #endif + + /* if we're using host WEP, increase size by IV+ICV */ +- if (p80211_wep->data) { +- txdesc.data_len = host2hfa384x_16(skb->len+8); +- // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); +- } else { +- txdesc.data_len = host2hfa384x_16(skb->len); +- } ++// if (p80211_wep->data) { ++// txdesc.data_len = host2hfa384x_16(skb->len+8); ++// // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); ++// } else { ++// txdesc.data_len = host2hfa384x_16(skb->len); ++// } ++ ++ if (skb->protocol != htons(ETH_P_80211_RAW)) { ++ /* if we're using host WEP, increase size by IV+ICV */ ++ if (p80211_wep->data) { ++ txdesc.data_len = host2hfa384x_16(skb->len+8); ++ // txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); ++ } else { ++ txdesc.data_len = host2hfa384x_16(skb->len); ++ } ++ } else { ++ /* KoreK: raw injection (monitor mode): pull the rest of ++ the header and ssanity check on txdesc.data_len */ ++ memcpy(&(txdesc.data_len), skb->data, 16); ++ skb_pull(skb,16); ++ if (txdesc.data_len != host2hfa384x_16(skb->len)) { ++ printk(KERN_DEBUG "mismatch frame_len, drop frame\n"); ++ return 0; ++ } ++ ++ txdesc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1); ++ } ++ + + txdesc.tx_control = host2hfa384x_16(txdesc.tx_control); + /* copy the header over to the txdesc */ +@@ -3140,7 +3170,9 @@ + spin_lock(&hw->cmdlock); + + /* Copy descriptor+payload to FID */ +- if (p80211_wep->data) { ++ ++// if (p80211_wep->data) { ++ if (p80211_wep->data && (skb->protocol != htons(ETH_P_80211_RAW))) { + result = hfa384x_copy_to_bap4(hw, HFA384x_BAP_PROC, fid, 0, + &txdesc, sizeof(txdesc), + p80211_wep->iv, sizeof(p80211_wep->iv), +@@ -3586,6 +3618,17 @@ + { + case 0: + ++ /* KoreK: this testmode uses macport 0 */ ++ if ((wlandev->netdev->type == ARPHRD_IEEE80211) || ++ (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) { ++ if ( ! HFA384x_RXSTATUS_ISFCSERR(rxdesc.status) ) { ++ hfa384x_int_rxmonitor( wlandev, rxfid, &rxdesc); ++ } else { ++ WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n"); ++ } ++ goto done; ++ } ++ + fc = ieee2host16(rxdesc.frame_control); + + /* If exclude and we receive an unencrypted, drop it */ +diff -ur linux-wlan-ng-0.2.3/src/prism2/driver/hfa384x_usb.c linux-wlan-ng-0.2.3-patched/src/prism2/driver/hfa384x_usb.c +--- linux-wlan-ng-0.2.3/src/prism2/driver/hfa384x_usb.c 2005-10-31 14:52:36.000000000 -0500 ++++ linux-wlan-ng-0.2.3-patched/src/prism2/driver/hfa384x_usb.c 2006-03-18 15:38:19.000000000 -0500 +@@ -1398,8 +1398,16 @@ + + DBFENTER; + +- cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | +- HFA384x_CMD_AINFO_SET(enable); ++// cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | ++// HFA384x_CMD_AINFO_SET(enable); ++ if (enable == HFA384x_MONITOR_ENABLE) { ++ // KoreK: get into test mode 0x0a ++ cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | ++ HFA384x_CMD_AINFO_SET(0x0a); ++ } else { ++ cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) | ++ HFA384x_CMD_AINFO_SET(enable); ++ } + cmd.parm0 = 0; + cmd.parm1 = 0; + cmd.parm2 = 0; +@@ -3412,37 +3420,71 @@ + HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) | + HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0); + #endif +- hw->txbuff.txfrm.desc.tx_control = +- host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control); +- +- /* copy the header over to the txdesc */ +- memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t)); ++// hw->txbuff.txfrm.desc.tx_control = ++// host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control); + +- /* if we're using host WEP, increase size by IV+ICV */ +- if (p80211_wep->data) { +- hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8); +- // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); +- usbpktlen+=8; +- } else { +- hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len); ++// /* copy the header over to the txdesc */ ++// memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t)); ++ if (skb->protocol != htons(ETH_P_80211_RAW)) { ++ hw->txbuff.txfrm.desc.tx_control = ++ host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control); ++ ++ /* copy the header over to the txdesc */ ++ memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, ++ sizeof(p80211_hdr_t)); ++ ++ /* if we're using host WEP, increase size by IV+ICV */ ++ if (p80211_wep->data) { ++ hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8); ++ // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); ++ usbpktlen+=8; ++ } else { ++ hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len); ++ } ++ } else { ++ /* KoreK: raw injection (monitor mode): pull the rest of ++ the header and ssanity check on txdesc.data_len */ ++ memcpy(&(hw->txbuff.txfrm.desc.data_len), skb->data, 16); ++ skb_pull(skb,16); ++ if (hw->txbuff.txfrm.desc.data_len != host2hfa384x_16(skb->len)) { ++ printk(KERN_DEBUG "mismatch frame_len, drop frame\n"); ++ return 0; ++ } ++// /* if we're using host WEP, increase size by IV+ICV */ ++// if (p80211_wep->data) { ++// hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8); ++// // hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1); ++// usbpktlen+=8; ++// } else { ++// hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len); ++ hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1); ++ hw->txbuff.txfrm.desc.tx_control = ++ host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control); ++ ++ /* copy the header over to the txdesc */ ++ memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, ++ sizeof(p80211_hdr_t)); + } + + usbpktlen += skb->len; + + /* copy over the WEP IV if we are using host WEP */ + ptr = hw->txbuff.txfrm.data; +- if (p80211_wep->data) { ++// if (p80211_wep->data) { ++ if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) { + memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv)); + ptr+= sizeof(p80211_wep->iv); + memcpy(ptr, p80211_wep->data, skb->len); + } else { + memcpy(ptr, skb->data, skb->len); + } ++ + /* copy over the packet data */ + ptr+= skb->len; + + /* copy over the WEP ICV if we are using host WEP */ +- if (p80211_wep->data) { ++// if (p80211_wep->data) { ++ if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) { + memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv)); + } + +@@ -4203,6 +4245,17 @@ + switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status) ) + { + case 0: ++ /* KoreK: this testmode uses macport 0 */ ++ if ((wlandev->netdev->type == ARPHRD_IEEE80211) || ++ (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) { ++ if ( ! HFA384x_RXSTATUS_ISFCSERR(usbin->rxfrm.desc.status) ) { ++ hfa384x_int_rxmonitor(wlandev, &usbin->rxfrm); ++ } else { ++ WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n"); ++ } ++ goto done; ++ } ++ + fc = ieee2host16(usbin->rxfrm.desc.frame_control); + + /* If exclude and we receive an unencrypted, drop it */ +diff -ur linux-wlan-ng-0.2.3/src/prism2/driver/prism2mgmt.c linux-wlan-ng-0.2.3-patched/src/prism2/driver/prism2mgmt.c +--- linux-wlan-ng-0.2.3/src/prism2/driver/prism2mgmt.c 2005-06-22 10:16:55.000000000 -0400 ++++ linux-wlan-ng-0.2.3-patched/src/prism2/driver/prism2mgmt.c 2006-03-18 15:21:03.000000000 -0500 +@@ -2860,9 +2860,12 @@ + } + + /* Now if we're already sniffing, we can skip the rest */ +- if (wlandev->netdev->type != ARPHRD_ETHER) { ++// if (wlandev->netdev->type != ARPHRD_ETHER) { ++ if ((wlandev->netdev->type != ARPHRD_IEEE80211) && ++ (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) { + /* Set the port type to pIbss */ +- word = HFA384x_PORTTYPE_PSUEDOIBSS; ++// word = HFA384x_PORTTYPE_PSUEDOIBSS; ++ word = 5; // HFA384x_PORTTYPE_PSUEDOIBSS; + result = hfa384x_drvr_setconfig16(hw, + HFA384x_RID_CNFPORTTYPE, word); + if ( result ) { +@@ -2874,6 +2877,8 @@ + } + if ((msg->keepwepflags.status == P80211ENUM_msgitem_status_data_ok) && (msg->keepwepflags.data != P80211ENUM_truth_true)) { + /* Set the wepflags for no decryption */ ++ /* doesn't work - done from the CLI */ ++ /* Fix? KoreK */ + word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT | + HFA384x_WEPFLAGS_DISABLE_RXCRYPT; + result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFWEPFLAGS, word); +@@ -2919,7 +2924,9 @@ + goto failed; + } + +- if (wlandev->netdev->type == ARPHRD_ETHER) { ++// if (wlandev->netdev->type == ARPHRD_ETHER) { ++ if ((wlandev->netdev->type != ARPHRD_IEEE80211) && ++ (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) { + WLAN_LOG_INFO("monitor mode enabled\n"); + } + +diff -ur linux-wlan-ng-0.2.3/src/prism2/driver/prism2sta.c linux-wlan-ng-0.2.3-patched/src/prism2/driver/prism2sta.c +--- linux-wlan-ng-0.2.3/src/prism2/driver/prism2sta.c 2005-10-07 17:32:44.000000000 -0400 ++++ linux-wlan-ng-0.2.3-patched/src/prism2/driver/prism2sta.c 2006-03-18 15:15:00.000000000 -0500 +@@ -410,7 +410,9 @@ + DBFENTER; + + /* If necessary, set the 802.11 WEP bit */ +- if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) { ++// if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) { ++ if (((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) ++ && (skb->protocol != htons(ETH_P_80211_RAW))) { + p80211_hdr->a3.fc |= host2ieee16(WLAN_SET_FC_ISWEP(1)); + } + diff --git a/net-wireless/linux-wlan-ng-modules/linux-wlan-ng-modules-0.2.5.ebuild b/net-wireless/linux-wlan-ng-modules/linux-wlan-ng-modules-0.2.5.ebuild new file mode 100644 index 00000000..3193b846 --- /dev/null +++ b/net-wireless/linux-wlan-ng-modules/linux-wlan-ng-modules-0.2.5.ebuild @@ -0,0 +1,90 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-wireless/linux-wlan-ng-modules/linux-wlan-ng-modules-0.2.5.ebuild,v 1.1 2006/10/08 19:09:23 betelgeuse Exp $ + +EAPI="2" + +inherit eutils linux-mod + +MY_PN=${PN/-modules/} +MY_P=${MY_PN}-${PV} + +DESCRIPTION="Kernel modules for Prism2/2.5/3 based 802.11b USB wireless LAN products" +HOMEPAGE="http://linux-wlan.org" +SRC_URI="ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/${MY_P}.tar.bz2" + +LICENSE="|| ( GPL-2 MPL-1.1 )" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" + +IUSE="debug" + +BUILD_TARGETS="default" +BUILD_PARAMS="WLAN_SRC=${S}/src" + +DEPEND="!> ${config} + else + echo "${1}=n" >> ${config} + fi +} + +src_prepare() { + local config="${S}"/default.config + + epatch "${FILESDIR}"/linux-wlan-0.2.3.packet.injection.patch + cp config.in ${config} + + echo "TARGET_ROOT_ON_HOST=${D}" >> ${config} + echo "LINUX_SRC=${KERNEL_DIR}" >> ${config} + echo "FIRMWARE_DIR=/lib/firmware/" >> ${config} + echo "PRISM2_PCI=n" >> ${config} + echo "PRISM2_PLX=n" >> ${config} + echo "PRISM2_PCMCIA=n" >> ${config} + echo "PRISM2_USB=y" >> ${config} + + config_by_usevar WLAN_DEBUG debug + + sed -i -e "s:dep modules:modules:" "${S}"/src/p80211/Makefile +} + +src_compile() { + set_arch_to_kernel + emake default_config || die "emake default_config failed" + set_arch_to_portage + + cd "${S}"/src/mkmeta + emake || die "emake mkmeta failed" + + linux-mod_src_compile +} + +pkg_postinst() { + linux-mod_pkg_postinst + + einfo "Support for pci, plx and pcmcia drivers has been removed in" + einfo "revision. For pci, plx and pcmcia drivers try for example" + einfo "the hostap-driver or orinoco drivers. They both work with the" + einfo "standard wireless tools." + einfo "" + einfo "If they do not work, please report this to betelgeuse@gentoo.org." +} -- cgit v1.2.3