net-wireless/compat-drivers: initial commit, v3.7_rc1_p6 based on compat-wireless-3.6.6-r1

This commit is contained in:
Wuodan0 2013-01-02 03:38:52 +00:00
parent 0f24498dd4
commit 288746f7b7
11 changed files with 8875 additions and 0 deletions

View file

@ -0,0 +1,11 @@
AUX 4002_mac80211-2.6.29-fix-tx-ctl-no-ack-retry-count.patch 559 SHA256 2c9222e0c6aaafabac091766c7e0a71442f0e9521ec1c65fc7024fbca60a3354 SHA512 9bf0b852a4ffc66afc12fc60c3fc683d689a45ff5e18470db68f25f001e14fc09c813aa01fec2b4583af1c19141e748a10c7dfd6022d727cb8cf245f6c33a2ff WHIRLPOOL 2efd4c3f2d58a833be803df6034e01d3601cb1891921fe2031c50a241a3f5e8a9e8d54aa0b29566fcc6b2bac71d48e504a3f88585a1049884e0a5986724048a1
AUX 4004_zd1211rw-2.6.28.patch 1412 SHA256 6696295acb2a8d12a33208525cba9ce8bd2971c9c0adaabb31debfa9ec15c7be SHA512 2aa73fa8e87cb06220b589f528ba25fcec818a14a98a8d5f1173b12c287ee85e48981a48bbce772aa7fc24a33a833df2eb5bc7af0d569ea8c839090c481566ec WHIRLPOOL 4245c75995d7579b9fcc0aa1412b4f9bc4a3a924076aca24b466658740a99b0592c293420c39a616a6241ec4dce213496bf4317b73fd4b94ab1dcefbe5130382
AUX ath_regd_optional.patch 906 SHA256 ebf117d071363e854505c18aef8c9af2652fd4a7b9cc5efe961cf5efb410dbd7 SHA512 dddc5e428f7d2a372ac17cce913c397ac408e20eb17af55633ea8984d6e69e8f7fe134436a4176606740d64fd66579c6a30a358cac393cb22f9a09d10f66e9d3 WHIRLPOOL b46164a1444d74f22d0e4f1e02ed556b52f87d5132871698ab93abd2076656e4ecadb7dc914d571df15a9bd18169ebaef67d4539a7919f1e2ffdd3df3b60cd90
AUX compat-drivers-3.7_rc1_p6-grsec-warnings.patch 1261 SHA256 d960b976fe4e82beb2ceba3cc3eccdd064f54d9cc269f2b08d351c5a7fb528f7 SHA512 044020bacf79790f5ce10c0373f05568dfca2456f0087b3a04e5162b7602fb97371923acc6987d8732a64373ad77a4df65dae90f55e2bd7b20757f0b32d6af8c WHIRLPOOL d4b61222a97d496516575ff1bee4b9bec0d86fe9115a4ea4789b994fb1890444c568f866b4289f2ecaf9a399aec7453588aa6a842e7c48bce61320d48cd2eb86
AUX compat-drivers-3.7_rc1_p6-grsec.patch 356575 SHA256 aefac7264cd36791af4194a4c9ed5a5a90a68d51c3ef1ba1af280c263ad394e2 SHA512 6aa48f042efac4c9a94ca7592f548e6dc5b8796c56a1827239b9d2e357ba23d14373b986e4cd789aedf07ce0a02eca2bdd3304a0bef751b8914367c9dc1b7fff WHIRLPOOL 986b202f601b4efb894ed8b0ab39f099af14b61deb687f670c83c3a587947e83b1180910d79bb701a6c5c92607ab529f6be229f840844cb08efaef165a83123f
AUX ipw2200-inject.3.4.6.patch 4173 SHA256 0b649bd7b6d2bf22667edc96949b5ab92cc7fb5c543b4385c17c5e0f47fe4109 SHA512 ebee3efda7b94898ea18a89f57c515d5237ef3c2a1eaf0bd13949ec4663a600eadede4655178355ac3f5b8ddc2eccc2cceb88eba0281ed3f614ada186a041463 WHIRLPOOL 15d94b3176719d006363f4d42a11c505643fdead8d521ccfb149cf5eee8851488aa006d4f8c750ffb5e81b23ff03d275e5fde781505e508467ff76303e612570
AUX leds-disable-strict-3.6.6.patch 799 SHA256 e1b5947608d9c53263efd76aed404eb7e4107d81669faeb484f5d680e4cfb570 SHA512 6373efc6697b4589c15c3cd2cfd8f3faa06fe90eeeb4fa9acaf187ecc682fac394444949dd26c2dde71c0f45aedb1198374764b580b824ddc6bc1e937273b5f1 WHIRLPOOL 40bdef714aa0ff4069bb50abf434dff88610d97f570b80f36622d29a43301bf013a90e90cb7f3f8044c2bf53a09154b1033a6f53b1edf186513452fdb681d55f
AUX leds-disable-strict-3.7_rc1_p6.patch 799 SHA256 e1b5947608d9c53263efd76aed404eb7e4107d81669faeb484f5d680e4cfb570 SHA512 6373efc6697b4589c15c3cd2cfd8f3faa06fe90eeeb4fa9acaf187ecc682fac394444949dd26c2dde71c0f45aedb1198374764b580b824ddc6bc1e937273b5f1 WHIRLPOOL 40bdef714aa0ff4069bb50abf434dff88610d97f570b80f36622d29a43301bf013a90e90cb7f3f8044c2bf53a09154b1033a6f53b1edf186513452fdb681d55f
DIST compat-drivers-3.7-rc1-6.tar.gz 7877572 SHA256 688406f3d9a84246dc0d57b93b5335c9b0f276cc216e3dc7032ad6152bfff873 SHA512 1a6a747a325b19f03cfb28036232ee9186010a0cb78e753d2358d8932d81322516878df97c13e56cec6472515d30c5b99816f44c6331fc58a261cae4ab33ad43 WHIRLPOOL c33025583834726f1f2988d8eaab8c716b117d74b427b035000ae5d5b35310be486ac76fcdb0589effae6036b5a3058ae0859384e4e6c9466b659f9848036ac1
EBUILD compat-drivers-3.7_rc1_p6.ebuild 7445 SHA256 a2f3395e385dd913bbd95c28998c978896e15da72cc1a9d6642f3d483aef3246 SHA512 53944a5912d3389f8052ad118696f947f88fbaa0baccbb6a2d0aa332ac24eff548dafbfc7d3a9c5aa9e34b26749f4c10246d5c7456390131a09755514f8e2248 WHIRLPOOL 5c192cf011a867dcae274e349b46b332f197dd04ff9f371339e76fa65bec5fca612ac59495c9de9334d837c8a28591b48c6e3b09c5f1c817081cafff5f6d0dad
MISC metadata.xml 228 SHA256 8715828d1bff71d5d96b991ba600bae9376c1c80c96f0f102260fc335ca22487 SHA512 006b031017fe79d0da68ed1c2684d2b87f75976111d8abdb18d126ffe142df8ded67805f14fe4adfe17e93287080126b7f4af64dac0ebaa1d9fe4c97e5f9573a WHIRLPOOL e711ede3bf7bcf0dc9d3ecd2706e4120270d4942718ee901f8d42c1c86055c8b153bdb24d6682a56d14f5b14d4ff220c115f14714b3f039bdc3deeece3d1fd02

View file

@ -0,0 +1,185 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
inherit linux-mod linux-info versionator eutils
# upstream versioning, ex.: 3.7-rc1-6
UPSTREAM_PVR="${PV//_/-}" && UPSTREAM_PVR="${UPSTREAM_PVR/-p/-}"
# ex.: 3.7-rc1
UPSTREAM_PV=${UPSTREAM_PVR%-*}
DESCRIPTION="Stable kernel pre-release wifi subsystem backport"
HOMEPAGE="http://backports.wiki.kernel.org"
# SRC_URI="http://www.kernel.org/pub/linux/kernel/projects/backports/stable/v${UPSTREAM_PV}/${PN}-${UPSTREAM_PVR}.tar.gz"
SRC_URI="mirror://kernel/linux/kernel/projects/backports/stable/v${UPSTREAM_PV}/${PN}-${UPSTREAM_PVR}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="+alx +ath9k_htc atheros_obey_crda bluetooth b43 b44 debugfs debug-driver full-debug injection livecd loadmodules noleds pax_kernel"
DEPEND="!net-wireless/compat-wireless-builder
net-wireless/compat-wireless"
RDEPEND="${DEPEND}
>=sys-kernel/linux-firmware-20110219
virtual/udev"
S="${WORKDIR}/${PN}-${UPSTREAM_PVR}"
RESTRICT="strip"
CONFIG_CHECK="!DYNAMIC_FTRACE"
pkg_setup() {
CONFIG_CHECK="~NET_SCHED"
CONFIG_CHECK="~IPW2200_PROMISCUOUS"
linux-mod_pkg_setup
kernel_is -lt 2 6 27 && die "kernel 2.6.27 or higher is required for compat wireless to be installed"
kernel_is -gt $(get_version_component_range 1) $(get_version_component_range 2) $(get_version_component_range 3) && die "The version of compat-wireless you are trying to install contains older modules than your kernel. Failing before downgrading your system."
#these things are not optional
linux_chkconfig_module MAC80211 || die "CONFIG_MAC80211 must be built as a _module_ !"
linux_chkconfig_module CFG80211 || die "CONFIG_CFG80211 must be built as a _module_ !"
linux_chkconfig_module LIBIPW || ewarn "CONFIG_LIBIPW really should be set or there will be no WEXT compat"
if use b43; then
linux_chkconfig_module SSB || die "You need to enable CONFIG_SSB or USE=-b43"
fi
if use b44; then
linux_chkconfig_module SSB || die "You need to enable CONFIG_SSB or USE=-b44"
fi
}
src_prepare() {
use pax_kernel && epatch "${FILESDIR}"/${P}-grsec.patch
use pax_kernel && epatch "${FILESDIR}"/${P}-grsec-warnings.patch
#mcgrof said prep for inclusion in compat-wireless.git but this causes issues
#find "${S}" -name Makefile | xargs sed -i -e 's/export CONFIG_/export CONFIG_COMPAT_/' -e 's/COMPAT_COMPAT_/COMPAT_/' -e 's/CONFIG_COMPAT_CHECK/CONFIG_CHECK/'
#sed -i -e 's/export CONFIG_/export CONFIG_COMPAT_/' -e 's/COMPAT_COMPAT_/COMPAT_/' "${S}"/config.mk
# CONFIG_CFG80211_REG_DEBUG=y
sed -i '/CFG80211_REG_DEBUG/s/^# *//' "${S}"/config.mk
#this patch ignores the regulatory settings of an atheros card and uses what CRDA thinks is right
if use atheros_obey_crda; then
ewarn "You have enabled atheros_obey_crda which doesn't do what you think."
ewarn "This use flag will cause the eeprom of the card to be ignored and force"
ewarn "world roaming on the device until crda provides a valid regdomain."
ewarn "Short version, this is not a way to break the law, this will automatically"
ewarn "make your card less functional unless you set a proper regdomain with iw/crda."
epatch "${FILESDIR}"/ath_regd_optional.patch
fi
if use injection; then
epatch "${FILESDIR}"/4002_mac80211-2.6.29-fix-tx-ctl-no-ack-retry-count.patch
epatch "${FILESDIR}"/4004_zd1211rw-2.6.28.patch
# epatch "${FILESDIR}"/mac80211.compat08082009.wl_frag+ack_v1.patch
# epatch "${FILESDIR}"/4013-runtime-enable-disable-of-mac80211-packet-injection.patch
epatch "${FILESDIR}"/ipw2200-inject.3.4.6.patch
fi
if use noleds; then
sed -ir 's/^\(export CONFIG_.*_LEDS=\)y$/\1n/' config.mk
epatch "${FILESDIR}/leds-disable-strict-${PV}.patch"
fi
use debug-driver && sed -i '/DEBUG=y/s/^# *//' "${S}"/config.mk
use debugfs && sed -i '/DEBUGFS/s/^# *//' "${S}"/config.mk
if use full-debug; then
if use debug-driver ; then
sed -i '/CONFIG=/s/^# *//' "${S}"/config.mk
else
ewarn "Enabling full-debug includes debug-driver."
sed -i '/DEBUG=/s/^# *//' "${S}"/config.mk
fi
fi
# Disable B44 ethernet driver
if ! use b44; then
sed -i '/B44=/s/ */#/' "${S}"/config.mk || die "unable to disable B44 driver"
sed -i '/B44_PCI=/s/ */#/' "${S}"/config.mk || die "unable to disable B44 driver"
fi
# Disable B43 driver
if ! use b43; then
sed -i '/B43=/s/ */#/' "${S}"/config.mk || die "unable to disable B43 driver"
sed -i '/B43_PCI_AUTOSELECT=/s/ */#/' "${S}"/config.mk || die "unable to disable B43 driver"
#CONFIG_B43LEGACY=
fi
# fixme: there are more bluethooth settings in the config.mk
if ! use bluetooth; then
sed -i '/COMPAT_BLUETOOTH=/s/ */#/' "${S}"/config.mk || die "unable to disable bluetooth driver"
sed -i '/COMPAT_BLUETOOTH_MODULES=/s/ */#/' "${S}"/config.mk || die "unable to bluetooth B44 driver"
fi
#enable alx atheros ethernet driver
if use alx; then
sed -i 's/ALX=n/ALX=m/' "${S}"/config.mk || die "Failed to enable Atheros ALX driver"
else
sed -i 's/ALX=m/ALX=n/' "${S}"/config.mk || die "Failed to disable Atheros ALX driver"
fi
if use ath9k_htc; then
sed -i 's/ATH9K_HTC=n/ATH9K_HTC=m/' "${S}"/config.mk || die "Failed to enable Atheros 9k htc driver"
else
sed -i 's/ATH9K_HTC=m/ATH9K_HTC=n/' "${S}"/config.mk || die "Failed to disable Atheros 9k htc driver"
fi
#avoid annoying ACCESS DENIED sandbox errors
sed -i "s/\${MAKE} -C \${KLIB_BUILD} kernelversion/echo ${KV_FULL}/g" compat/scripts/gen-compat-config.sh || die "sed failed"
sed -i "s/shell \$(MAKE) -C \$(KLIB_BUILD) kernelversion/echo ${KV_FULL}/g" config.mk || die "sed failed"
sed -i "s/make -C \$KLIB_BUILD kernelversion/echo ${KV_FULL}/g" scripts/gen-compat-autoconf.sh || die "sed failed"
}
src_compile() {
addpredict "${KERNEL_DIR}"
set_arch_to_kernel
emake KLIB_BUILD="${DESTDIR}"/lib/modules/"${KV_FULL}"/build || die "emake failed"
}
src_install() {
for file in $(find -name \*.ko); do
insinto "/lib/modules/${KV_FULL}/updates/$(dirname ${file})"
doins "${file}"
done
dosbin scripts/athenable scripts/b43load scripts/iwl-enable \
scripts/madwifi-unload scripts/athload scripts/iwl-load \
scripts/b43enable scripts/unload.sh
dodir /usr/lib/compat-wireless
exeinto /usr/lib/compat-wireless
doexe scripts/modlib.sh
dodoc README.md
dodir /$(get_libdir)/udev/rules.d/
insinto /$(get_libdir)/udev/rules.d/
doins udev/50-compat_firmware.rules
exeinto /$(get_libdir)/udev/
doexe udev/compat_firmware.sh
}
pkg_postinst() {
update_depmod
update_moduledb
if use !livecd; then
if use loadmodules; then
einfo "Attempting to unload modules..."
/usr/sbin/unload.sh 2>&1 | grep -E FATAL && ewarn "Unable to remove running modules, system may be unhappy, reboot HIGHLY recommended!"
einfo "Triggering automatic reload of needed modules..."
/sbin/udevadm trigger
einfo "We have attempted to load your new modules for you, this may fail horribly, or may just cause a network hiccup."
einfo "If you experience any issues reboot is the simplest course of action."
fi
fi
if use !loadmodules; then
einfo "You didn't USE=loadmodules but you can still attempt to switch to the new drivers without reboot."
einfo "Run 'unload.sh' then 'udevadm trigger' to cause udev to load the needed drivers."
einfo "If unload.sh fails for some reason you should be able to simply reboot to fix everything and load the new modules."
fi
}
pkg_postrm() {
remove_moduledb
}

View file

@ -0,0 +1,17 @@
tx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index b47435d..751934b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -539,7 +539,8 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
if (tx->sta)
tx->sta->last_tx_rate = txrc.reported_rate;
- if (unlikely(!info->control.rates[0].count))
+ if (unlikely(!info->control.rates[0].count) ||
+ info->flags & IEEE80211_TX_CTL_NO_ACK)
info->control.rates[0].count = 1;
if (is_multicast_ether_addr(hdr->addr1)) {

View file

@ -0,0 +1,37 @@
diff -Naur linux-2.6.28-pentoo-r1-orig/drivers/net/wireless/zd1211rw/zd_mac.c linux-2.6.28-pentoo-r1-improved/drivers/net/wireless/zd1211rw/zd_mac.c
--- linux-2.6.28-pentoo-r1-orig/drivers/net/wireless/zd1211rw/zd_mac.c 2009-01-18 17:49:00.000000000 -0500
+++ linux-2.6.28-pentoo-r1-improved/drivers/net/wireless/zd1211rw/zd_mac.c 2009-01-18 18:46:44.000000000 -0500
@@ -191,14 +191,19 @@
static int set_rx_filter(struct zd_mac *mac)
{
unsigned long flags;
- u32 filter = STA_RX_FILTER;
+ struct zd_ioreq32 ioreqs[] = {
+ {CR_RX_FILTER, STA_RX_FILTER},
+ { CR_SNIFFER_ON, 0U },
+ };
spin_lock_irqsave(&mac->lock, flags);
- if (mac->pass_ctrl)
- filter |= RX_FILTER_CTRL;
+ if (mac->pass_ctrl) {
+ ioreqs[0].value |= 0xFFFFFFFF;
+ ioreqs[1].value = 0x1;
+ }
spin_unlock_irqrestore(&mac->lock, flags);
- return zd_iowrite32(&mac->chip, CR_RX_FILTER, filter);
+ return zd_iowrite32a(&mac->chip, ioreqs, ARRAY_SIZE(ioreqs));
}
static int set_mc_hash(struct zd_mac *mac)
@@ -657,7 +662,8 @@
/* Caller has to ensure that length >= sizeof(struct rx_status). */
status = (struct rx_status *)
(buffer + (length - sizeof(struct rx_status)));
- if (status->frame_status & ZD_RX_ERROR) {
+ if ((status->frame_status & ZD_RX_ERROR) ||
+ (status->frame_status & ~0x21)) {
if (mac->pass_failed_fcs &&
(status->frame_status & ZD_RX_CRC32_ERROR)) {
stats.flag |= RX_FLAG_FAILED_FCS_CRC;

View file

@ -0,0 +1,39 @@
diff -Naur compat-wireless-3.0-rc4-1-orig/drivers/net/wireless/ath/regd.c compat-wireless-3.0-rc4-1/drivers/net/wireless/ath/regd.c
--- compat-wireless-3.0-rc4-1-orig/drivers/net/wireless/ath/regd.c 2011-06-23 19:02:22.000000000 -0400
+++ compat-wireless-3.0-rc4-1/drivers/net/wireless/ath/regd.c 2011-06-26 01:52:35.000000000 -0400
@@ -193,6 +193,8 @@
u32 bandwidth = 0;
int r;
+ return;
+
for (band = 0; band < IEEE80211_NUM_BANDS; band++) {
if (!wiphy->bands[band])
@@ -252,6 +254,8 @@
u32 bandwidth = 0;
int r;
+ return;
+
sband = wiphy->bands[IEEE80211_BAND_2GHZ];
/*
@@ -299,6 +303,8 @@
struct ieee80211_channel *ch;
unsigned int i;
+ return;
+
if (!wiphy->bands[IEEE80211_BAND_5GHZ])
return;
@@ -466,6 +472,8 @@
{
const struct ieee80211_regdomain *regd;
+ return 0;
+
wiphy->reg_notifier = reg_notifier;
wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY;

View file

@ -0,0 +1,34 @@
Fixes for:
drivers/net/wireless/ath/ath6kl/sdio.c: In function ath6kl_sdio_alloc_prep_scat_req:
drivers/net/wireless/ath/ath6kl/sdio.c:1478:1: warning: find_arg_number: cannot find the buf_sz argument in ath6kl_sdio_alloc_prep_scat_req [enabled by default]
drivers/net/wireless/ath/ath6kl/sdio.c:1478:1: warning: find_arg_number: cannot find the sg_sz argument in ath6kl_sdio_alloc_prep_scat_req [enabled by default]
--- drivers/net/wireless/ath/ath6kl/sdio.c
+++ drivers/net/wireless/ath/ath6kl/sdio.c
@@ -341,11 +341,14 @@
scat_list_sz = (n_scat_entry - 1) * sizeof(struct hif_scatter_item);
scat_req_sz = sizeof(*s_req) + scat_list_sz;
- if (!virt_scat)
+ if (!virt_scat) {
sg_sz = sizeof(struct scatterlist) * n_scat_entry;
- else
+ buf_sz = 0;
+ } else {
+ sg_sz = 0;
buf_sz = 2 * L1_CACHE_BYTES +
ATH6KL_MAX_TRANSFER_SIZE_PER_SCATTER;
+ }
for (i = 0; i < n_scat_req; i++) {
/* allocate the scatter request */
--- drivers/gpu/drm/i915/intel_display.c
+++ drivers/gpu/drm/i915/intel_display.c
@@ -6216,7 +6216,7 @@
obj = work->old_fb_obj;
atomic_clear_mask(1 << intel_crtc->plane,
- &obj->pending_flip.counter);
+ &obj->pending_flip);
wake_up(&dev_priv->pending_flip_queue);
schedule_work(&work->work);

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,120 @@
diff -urN linux-2.6.36-gentoo.orig/drivers/net/wireless/ipw2x00/ipw2200.c linux-2.6.36-gentoo/drivers/net/wireless/ipw2x00/ipw2200.c
--- linux-2.6.36-gentoo.orig/drivers/net/wireless/ipw2x00/ipw2200.c 2010-10-21 04:30:22.000000000 +0800
+++ linux-2.6.36-gentoo/drivers/net/wireless/ipw2x00/ipw2200.c 2010-12-08 22:22:41.937999976 +0800
@@ -216,6 +216,7 @@
static int ipw_queue_tx_hcmd(struct ipw_priv *priv, int hcmd, void *buf,
int len, int sync);
+static int ipw_tx_skb(struct ipw_priv *priv, struct libipw_txb *txb, int pri);
static void ipw_tx_queue_free(struct ipw_priv *);
static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *);
@@ -1911,6 +1912,63 @@
static DEVICE_ATTR(net_stats, S_IWUSR | S_IRUGO,
show_net_stats, store_net_stats);
+/* SYSFS INJECT */
+static ssize_t store_inject(struct device *d,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct ipw_priv *priv = dev_get_drvdata(d);
+ struct libipw_device *ieee = priv->ieee;
+ struct libipw_txb *txb;
+ struct sk_buff *skb_frag;
+ unsigned char *newbuf;
+ unsigned long flags;
+
+ // should test (ieee->is_queue_full)
+
+ // Fw only accepts data, so avoid accidental fw errors.
+ if ( (buf[0]&0x0c) != '\x08') {
+ //printk("ipw2200: inject: discarding non-data frame (type=%02X)\n",(int)(unsigned char)buf[0]);
+ return count;
+ }
+
+ if (count>1500) {
+ count=1500;
+ printk("ipw2200: inject: cutting down frame to 1500 bytes\n");
+ }
+
+ spin_lock_irqsave(&priv->lock, flags);
+
+ // Create a txb with one skb
+ txb = kmalloc(sizeof(struct libipw_txb) + sizeof(u8 *), GFP_ATOMIC);
+ if (!txb)
+ goto nosepuede;
+ txb->nr_frags=1;
+ txb->frag_size = ieee->tx_headroom;
+ txb->fragments[0]=__dev_alloc_skb(count + ieee->tx_headroom, GFP_ATOMIC);
+ if (!txb->fragments[0]) {
+ kfree(txb);
+ goto nosepuede;
+ }
+ skb_reserve(txb->fragments[0], ieee->tx_headroom);
+ txb->encrypted=0;
+ txb->payload_size=count;
+ skb_frag = txb->fragments[0];
+ newbuf=skb_put(skb_frag, count);
+
+ // copy data into txb->skb and send it
+ memcpy(newbuf, buf, count);
+
+ ipw_tx_skb(priv, txb, 0);
+
+nosepuede:
+ spin_unlock_irqrestore(&priv->lock, flags);
+ return count;
+}
+
+
+static DEVICE_ATTR(inject, S_IWUSR, NULL, store_inject);
+
static ssize_t show_channels(struct device *d,
struct device_attribute *attr,
char *buf)
@@ -10214,7 +10272,6 @@
modify to send one tfd per fragment instead of using chunking. otherwise
we need to heavily modify the libipw_skb_to_txb.
*/
-
static int ipw_tx_skb(struct ipw_priv *priv, struct libipw_txb *txb,
int pri)
{
@@ -10544,6 +10601,12 @@
mutex_lock(&priv->mutex);
priv->config |= CFG_CUSTOM_MAC;
memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN);
+
+#ifdef CONFIG_IPW2200_PROMISCUOUS
+ if (rtap_iface)
+ memcpy(priv->prom_net_dev->dev_addr, addr->sa_data, ETH_ALEN);
+#endif
+
printk(KERN_INFO "%s: Setting MAC to %pM\n",
priv->net_dev->name, priv->mac_addr);
schedule_work(&priv->adapter_restart);
@@ -11597,6 +11660,7 @@
#ifdef CONFIG_IPW2200_PROMISCUOUS
&dev_attr_rtap_iface.attr,
&dev_attr_rtap_filter.attr,
+ &dev_attr_inject.attr,
#endif
NULL
};
diff -urN linux-2.6.36-gentoo.orig/drivers/net/wireless/ipw2x00/ipw2200.h linux-2.6.36-gentoo/drivers/net/wireless/ipw2x00/ipw2200.h
--- linux-2.6.36-gentoo.orig/drivers/net/wireless/ipw2x00/ipw2200.h 2010-10-21 04:30:22.000000000 +0800
+++ linux-2.6.36-gentoo/drivers/net/wireless/ipw2x00/ipw2200.h 2010-12-08 22:20:01.561000000 +0800
@@ -2014,4 +2014,12 @@
#define IPW_MAX_CONFIG_RETRIES 10
+/*
+ * Hhack to get code compiling on new kernels, the define below
+ * seem to be removed from the linux headers.
+ */
+#ifndef MAC_ARG
+#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
+#endif
+
#endif /* __ipw2200_h__ */

View file

@ -0,0 +1,30 @@
--- drivers/net/wireless/rt2x00/rt2x00leds.c
+++ drivers/net/wireless/rt2x00/rt2x00leds.c
@@ -29,6 +29,7 @@
#include "rt2x00.h"
#include "rt2x00lib.h"
+#ifdef CONFIG_RT2X00_LIB_LEDS
void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi)
{
struct rt2x00_led *led = &rt2x00dev->led_qual;
@@ -244,3 +245,4 @@
if (rt2x00dev->led_qual.flags & LED_REGISTERED)
rt2x00leds_resume_led(&rt2x00dev->led_qual);
}
+#endif /* CONFIG_RT2X00_LIB_LEDS */
--- net/mac80211/led.c
+++ net/mac80211/led.c
@@ -12,6 +12,7 @@
#include <linux/export.h>
#include "led.h"
+#ifdef CONFIG_MAC80211_LEDS
void ieee80211_led_rx(struct ieee80211_local *local)
{
if (unlikely(!local->rx_led))
@@ -307,3 +308,4 @@
else
ieee80211_start_tpt_led_trig(local);
}
+#endif /* CONFIG_MAC80211_LEDS */

View file

@ -0,0 +1,30 @@
--- drivers/net/wireless/rt2x00/rt2x00leds.c
+++ drivers/net/wireless/rt2x00/rt2x00leds.c
@@ -29,6 +29,7 @@
#include "rt2x00.h"
#include "rt2x00lib.h"
+#ifdef CONFIG_RT2X00_LIB_LEDS
void rt2x00leds_led_quality(struct rt2x00_dev *rt2x00dev, int rssi)
{
struct rt2x00_led *led = &rt2x00dev->led_qual;
@@ -244,3 +245,4 @@
if (rt2x00dev->led_qual.flags & LED_REGISTERED)
rt2x00leds_resume_led(&rt2x00dev->led_qual);
}
+#endif /* CONFIG_RT2X00_LIB_LEDS */
--- net/mac80211/led.c
+++ net/mac80211/led.c
@@ -12,6 +12,7 @@
#include <linux/export.h>
#include "led.h"
+#ifdef CONFIG_MAC80211_LEDS
void ieee80211_led_rx(struct ieee80211_local *local)
{
if (unlikely(!local->rx_led))
@@ -307,3 +308,4 @@
else
ieee80211_start_tpt_led_trig(local);
}
+#endif /* CONFIG_MAC80211_LEDS */

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<use>
<flag name="injection">Add patches for better wifi injection support</flag>
</use>
</pkgmetadata>