Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=kernel2630.git;a=commitdiff;h=6a6c9b10946108cd35f9b8a178e8bdb6e12dd359

commit 6a6c9b10946108cd35f9b8a178e8bdb6e12dd359
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Fri Jun 12 22:10:25 2009 +0200

madwifi-0.9.4-25-i686

- add kernel-2.6.30.patch

diff --git a/source/network/madwifi/FrugalBuild 
b/source/network/madwifi/FrugalBuild
index 440d9e6..65f77a2 100644
--- a/source/network/madwifi/FrugalBuild
+++ b/source/network/madwifi/FrugalBuild
@@ -3,7 +3,7 @@

pkgname=madwifi
pkgver=0.9.4
-pkgrel=24
+pkgrel=25
pkgdesc="Madwifi drivers for Atheros wireless chipsets"
Finclude kernel-module
depends=(${depen...@]} 'wireless_tools')
@@ -13,12 +13,13 @@ groups=('network')
archs=('i686' 'x86_64')
Finclude sourceforge
url="http://madwifi.sourceforge.net/";
-source=($source madwifi-0.9.3-cflags.diff kernel-2.6.2{6,7,9}.patch)
+source=($source madwifi-0.9.3-cflags.diff kernel-2.6.2{6,7,9}.patch 
kernel-2.6.30.patch)
sha1sums=('6f289cb2e99d27b23570d15b69bf0f4240e34d1e' \
'26fdc221e5bb0299d8b3c41ad30b6fe6882a8e35' \
'41928bbfdbb4e1c1fa5c1ed93fb673542c18bbc3' \
'd13a31f131b227838046c384e04cb32922b481bf' \
-          '0afa565128984ebcae441580b83eb916a2f3f09c')
+          '0afa565128984ebcae441580b83eb916a2f3f09c' \
+          '8e9aef8b6d7fe815bb0816f107b65cda362d520e')

# If the package needs testing, feel free to poke Benjamin Woods 
<woods...@gmail.com>

diff --git a/source/network/madwifi/kernel-2.6.30.patch 
b/source/network/madwifi/kernel-2.6.30.patch
new file mode 100644
index 0000000..a65124e
--- /dev/null
+++ b/source/network/madwifi/kernel-2.6.30.patch
@@ -0,0 +1,79 @@
+Fix Linux 2.6.30 compatibility
+
+Linux 2.6.30 doesn't define IRQ_NONE as a macro. Assume irqreturn_t,
+IRQ_NONE and IRQ_HANDLED to be present on Linux 2.6.29 and newer.
+http://madwifi-project.org/changeset/3986
+--- a/ath/if_athvar.h
++++ b/ath/if_athvar.h
+@@ -83,11 +83,13 @@ typedef void *TQUEUE_ARG;
+ /*
+  * Guess how the interrupt handler should work.
+  */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+ #if !defined(IRQ_NONE)
+ typedef void irqreturn_t;
+ #define       IRQ_NONE
+ #define       IRQ_HANDLED
+ #endif /* !defined(IRQ_NONE) */
++#endif /* Linux < 2.6.29 */
+
+ #ifndef SET_MODULE_OWNER
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+--- ./net80211/ieee80211_linux.c.orig  2009-06-12 22:05:10.000000000 +0200
++++ ./net80211/ieee80211_linux.c       2009-06-12 22:06:49.000000000 +0200
+@@ -247,9 +247,12 @@
+       static const char *tag = "STA-TRAFFIC-STAT";
+       struct net_device *dev = vap->iv_dev;
+       union iwreq_data wreq;
+-      char buf[1024];
+
+-      snprintf(buf, sizeof(buf), "%s\nmac=%s\nrx_packets=%u\nrx_bytes=%llu\n"
++      char *buf = kmalloc(1024, GFP_KERNEL);
++      if (!buf) {
++              return;
++      }
++      snprintf(buf, 1024, "%s\nmac=%s\nrx_packets=%u\nrx_bytes=%llu\n"
+                       "tx_packets=%u\ntx_bytes=%llu\n", tag,
+                       ether_sprintf(ni->ni_macaddr), ni->ni_stats.ns_rx_data,
+                       ni->ni_stats.ns_rx_bytes, ni->ni_stats.ns_tx_data,
+@@ -257,6 +260,7 @@
+       memset(&wreq, 0, sizeof(wreq));
+       wreq.data.length = strlen(buf);
+       wireless_send_event(dev, IWEVCUSTOM, &wreq, buf);
++      kfree(buf);
+ }
+
+ void
+--- ./net80211/ieee80211_wireless.c.orig       2009-06-12 22:00:11.000000000 
+0200
++++ ./net80211/ieee80211_wireless.c    2009-06-12 22:04:33.000000000 +0200
+@@ -1459,17 +1459,22 @@
+ {
+       struct ieee80211vap *vap = netdev_priv(dev);
+       struct ieee80211com *ic = vap->iv_ic;
+-      struct waplistreq req;          /* XXX off stack */
++      struct waplistreq *req = kmalloc(sizeof (struct waplistreq), 
GFP_KERNEL);
++      if (!req) {
++              return -ENOMEM;
++      }
+
+-      req.vap = vap;
+-      req.i = 0;
+-      ieee80211_scan_iterate(ic, waplist_cb, &req);
++      req->vap = vap;
++      req->i = 0;
++      ieee80211_scan_iterate(ic, waplist_cb, req);
+
+-      data->length = req.i;
+-      memcpy(extra, &req.addr, req.i * sizeof(req.addr[0]));
++      data->length = req->i;
++      memcpy(extra, &req->addr, req->i * sizeof(req->addr[0]));
+       data->flags = 1;                /* signal quality present (sort of) */
+-      memcpy(extra + req.i * sizeof(req.addr[0]), &req.qual,
+-              req.i * sizeof(req.qual[0]));
++      memcpy(extra + req->i * sizeof(req->addr[0]), &req->qual,
++              req->i * sizeof(req->qual[0]));
++
++      kfree (req);
+
+       return 0;
+ }
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to