Added atheros injection patches (from aircrack)

svn path=/nixpkgs/trunk/; revision=13127
This commit is contained in:
Michael Raskin 2008-10-28 07:28:16 +00:00
parent 99893c8aec
commit 3cceb8afd8
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,32 @@
diff -Naur madwifi/ath/if_ath.c madwifi_rawtx/ath/if_ath.c
--- madwifi/ath/if_ath.c 2008-06-24 17:20:58.000000000 -0400
+++ madwifi_rawtx/ath/if_ath.c 2008-06-24 17:20:12.000000000 -0400
@@ -2950,6 +2950,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 = &(SKB_CB(skb)->phy);
const HAL_RATE_TABLE *rt;
@@ -2962,7 +2963,8 @@
struct ieee80211_frame *wh;
wh = (struct ieee80211_frame *)skb->data;
- try0 = ph->try[0];
+// try0 = ph->try[0];
+ try0 = (ic->ic_opmode == IEEE80211_M_MONITOR) ? 1 : ph->try[0];
rt = sc->sc_currates;
txrate = dot11_to_ratecode(sc, rt, ph->rate[0]);
power = ph->power > 60 ? 60 : ph->power;
@@ -2986,7 +2988,8 @@
rt = sc->sc_currates;
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;

View File

@ -12,6 +12,7 @@ args : with args;
url = http://people.freebsd.org/~sam/ath_hal-20080528.tgz; url = http://people.freebsd.org/~sam/ath_hal-20080528.tgz;
sha256 = "1a6glkd8n46876hl48ib08p81qwsvrk4153j4b9xrxgid6f8bar9"; sha256 = "1a6glkd8n46876hl48ib08p81qwsvrk4153j4b9xrxgid6f8bar9";
}; };
injectionPatchFile = ./inj.patch;
}; };
in with localDefs; in with localDefs;
let let
@ -27,12 +28,15 @@ postInstall = FullDepEntry (''
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "atheros-"+version; name = "atheros-"+version;
patches = lib.optional
(lib.getAttr ["injectionPatch"] false args)
injectionPatchFile;
builder = writeScript (name + "-builder") builder = writeScript (name + "-builder")
(textClosure localDefs (textClosure localDefs
((lib.optional ((lib.optional
(lib.getAttr ["freshHAL"] false args) (lib.getAttr ["freshHAL"] false args)
preBuild) preBuild)
++ [doMakeInstall postInstall ++ [doPatch doMakeInstall postInstall
doForceShare doPropagate])); doForceShare doPropagate]));
meta = { meta = {
description = " description = "