[Prism54-users] Compiling driver for Fedora Core 1 -- SOLUTION
Daniel Roesen
dr at cluenet.de
Sun Aug 15 21:40:40 UTC 2004
Hi,
as many people know (suffer from), it's impossible to build the prism54
driver for a FC1 (Fedora Core 1) kernel since 2004-03-18. I've finally
was annoyed enough that I sat down and found the two root problems:
- FC1 kernels do have Wireless Extensions 15, but someone removed the
compatibility workarounds in prism54 in CVS on 2004-03-18. This gives
the "spy_data" breakage... WE15 doesn't have the iw_spy
infrastructure.
- FC1 kernels are based on 2.4.22 but DO have stuff of later kernels, so
Margit's prismcompat24.h has a workaround "too much" as it keyes off
"LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)" which breaks in this
special case.
I have attached a patch which fixes both problems -- it rips out the
iw_spy stuff to make prism54 compatible again with WE15, and removes
the redefinitions of free_netdev/pci_name/irqreturn_t of
prismcompat24.h. Driver now builds and works beautiful with "vanilla"
FC1 kernel kernel-2.4.22-1.2199.nptl here. Patch is against
prism54 1.2.
Also, I fetched Dag Wieers' SRPM and updated it to prism54 1.2 and
included the patch. You can find the SRPM and i686 RPMs here:
http://www.cluenet.de/people/dr/RPMS/fc1/kernel-module-prism54-1.2-1_2.4.22_1.2199.nptl.src.rpm
http://www.cluenet.de/people/dr/RPMS/fc1/kernel-module-prism54-1.2-1_2.4.22_1.2199.nptl.i686.rpm
I've submitted the changes to Dag... perhaps he will now re-start
building driver packages again.
Best regards,
Daniel
-------------- next part --------------
diff -urN prism54-1.2.orig/ksrc/isl_ioctl.c prism54-1.2/ksrc/isl_ioctl.c
--- prism54-1.2.orig/ksrc/isl_ioctl.c 2004-05-29 17:06:49.000000000 +0200
+++ prism54-1.2/ksrc/isl_ioctl.c 2004-08-15 16:35:54.000000000 +0200
@@ -2006,31 +2006,6 @@
return (ret ? ret : -EINPROGRESS);
}
-static int
-prism54_set_spy(struct net_device *ndev,
- struct iw_request_info *info,
- union iwreq_data *uwrq, char *extra)
-{
- islpci_private *priv = netdev_priv(ndev);
- u32 u, oid = OID_INL_CONFIG;
-
- down_write(&priv->mib_sem);
- mgt_get(priv, OID_INL_CONFIG, &u);
-
- if ((uwrq->data.length == 0) && (priv->spy_data.spy_number > 0))
- /* disable spy */
- u &= ~INL_CONFIG_RXANNEX;
- else if ((uwrq->data.length > 0) && (priv->spy_data.spy_number == 0))
- /* enable spy */
- u |= INL_CONFIG_RXANNEX;
-
- mgt_set(priv, OID_INL_CONFIG, &u);
- mgt_commit_list(priv, &oid, 1);
- up_write(&priv->mib_sem);
-
- return iw_handler_set_spy(ndev, info, uwrq, extra);
-}
-
static const iw_handler prism54_handler[] = {
(iw_handler) prism54_commit, /* SIOCSIWCOMMIT */
(iw_handler) prism54_get_name, /* SIOCGIWNAME */
@@ -2048,10 +2023,10 @@
(iw_handler) NULL, /* SIOCGIWPRIV */
(iw_handler) NULL, /* SIOCSIWSTATS */
(iw_handler) NULL, /* SIOCGIWSTATS */
- prism54_set_spy, /* SIOCSIWSPY */
- iw_handler_get_spy, /* SIOCGIWSPY */
- iw_handler_set_thrspy, /* SIOCSIWTHRSPY */
- iw_handler_get_thrspy, /* SIOCGIWTHRSPY */
+ (iw_handler) NULL, /* SIOCSIWSPY */
+ (iw_handler) NULL, /* SIOCGIWSPY */
+ (iw_handler) NULL, /* SIOCSIWTHRSPY */
+ (iw_handler) NULL, /* SIOCGIWTHRSPY */
(iw_handler) prism54_set_wap, /* SIOCSIWAP */
(iw_handler) prism54_get_wap, /* SIOCGIWAP */
(iw_handler) NULL, /* -- hole -- */
@@ -2248,7 +2223,6 @@
.standard = (iw_handler *) prism54_handler,
.private = (iw_handler *) prism54_private_handler,
.private_args = (struct iw_priv_args *) prism54_private_args,
- .spy_offset = offsetof(islpci_private, spy_data),
};
/* For ioctls that don't work with the new API */
diff -urN prism54-1.2.orig/ksrc/islpci_dev.h prism54-1.2/ksrc/islpci_dev.h
--- prism54-1.2.orig/ksrc/islpci_dev.h 2004-05-29 17:06:49.000000000 +0200
+++ prism54-1.2/ksrc/islpci_dev.h 2004-08-15 16:35:40.000000000 +0200
@@ -98,8 +98,6 @@
struct iw_statistics local_iwstatistics;
struct iw_statistics iwstatistics;
- struct iw_spy_data spy_data; /* iwspy support */
-
int monitor_type; /* ARPHRD_IEEE80211 or ARPHRD_IEEE80211_PRISM */
struct islpci_acl acl;
diff -urN prism54-1.2.orig/ksrc/islpci_eth.c prism54-1.2/ksrc/islpci_eth.c
--- prism54-1.2.orig/ksrc/islpci_eth.c 2004-05-29 17:06:49.000000000 +0200
+++ prism54-1.2/ksrc/islpci_eth.c 2004-08-15 16:47:21.000000000 +0200
@@ -384,29 +384,8 @@
/* take care of monitor mode and spy monitoring. */
if (unlikely(priv->iw_mode == IW_MODE_MONITOR))
discard = islpci_monitor_rx(priv, &skb);
- else {
- if (unlikely(skb->data[2 * ETH_ALEN] == 0)) {
- /* The packet has a rx_annex. Read it for spy monitoring, Then
- * remove it, while keeping the 2 leading MAC addr.
- */
- struct iw_quality wstats;
- struct rx_annex_header *annex =
- (struct rx_annex_header *) skb->data;
- wstats.level = annex->rfmon.rssi;
- /* The noise value can be a bit outdated if nobody's
- * reading wireless stats... */
- wstats.noise = priv->local_iwstatistics.qual.noise;
- wstats.qual = wstats.level - wstats.noise;
- wstats.updated = 0x07;
- /* Update spy records */
- wireless_spy_update(ndev, annex->addr2, &wstats);
-
- memcpy(skb->data + sizeof (struct rfmon_header),
- skb->data, 2 * ETH_ALEN);
- skb_pull(skb, sizeof (struct rfmon_header));
- }
+ else
skb->protocol = eth_type_trans(skb, ndev);
- }
skb->ip_summed = CHECKSUM_NONE;
priv->statistics.rx_packets++;
priv->statistics.rx_bytes += size;
diff -urN prism54-1.2.orig/ksrc/prismcompat24.h prism54-1.2/ksrc/prismcompat24.h
--- prism54-1.2.orig/ksrc/prismcompat24.h 2004-05-29 17:06:49.000000000 +0200
+++ prism54-1.2/ksrc/prismcompat24.h 2004-08-15 16:24:16.000000000 +0200
@@ -36,15 +36,7 @@
#include <linux/moduleparam.h>
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)
-#define free_netdev(x) kfree(x)
-#define pci_name(x) x->slot_name
-#define irqreturn_t void
-#define IRQ_HANDLED
-#define IRQ_NONE
-#else
#include <linux/interrupt.h>
-#endif
#define work_struct tq_struct
#define INIT_WORK INIT_TQUEUE
More information about the Prism54-users
mailing list