diff options
author | Henrik Brix Andersen <brix@gentoo.org> | 2006-03-25 19:17:23 +0000 |
---|---|---|
committer | Henrik Brix Andersen <brix@gentoo.org> | 2006-03-25 19:17:23 +0000 |
commit | 25ee0b8e90d9e802666e51c563d57a79829de858 (patch) | |
tree | bbd51ff4faacca6059239896b0273af81dd10748 /net-wireless/ipw2200 | |
parent | Revision bump to avoid filtering -O2 and replacing it with -O0 during configu... (diff) | |
download | gentoo-2-25ee0b8e90d9e802666e51c563d57a79829de858.tar.gz gentoo-2-25ee0b8e90d9e802666e51c563d57a79829de858.tar.bz2 gentoo-2-25ee0b8e90d9e802666e51c563d57a79829de858.zip |
Move large patch to mirrors, thanks to Halcy0n in bug #123634.
(Portage version: 2.0.54)
Diffstat (limited to 'net-wireless/ipw2200')
-rw-r--r-- | net-wireless/ipw2200/ChangeLog | 6 | ||||
-rw-r--r-- | net-wireless/ipw2200/Manifest | 7 | ||||
-rw-r--r-- | net-wireless/ipw2200/files/digest-ipw2200-1.1.1-r1 | 1 | ||||
-rw-r--r-- | net-wireless/ipw2200/files/ipw2200-1.1.1-rtap_iface.patch | 780 | ||||
-rw-r--r-- | net-wireless/ipw2200/ipw2200-1.1.1-r1.ebuild | 7 |
5 files changed, 13 insertions, 788 deletions
diff --git a/net-wireless/ipw2200/ChangeLog b/net-wireless/ipw2200/ChangeLog index 9c2fe26a7b75..530519946c54 100644 --- a/net-wireless/ipw2200/ChangeLog +++ b/net-wireless/ipw2200/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-wireless/ipw2200 # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2200/ChangeLog,v 1.62 2006/03/24 16:38:33 brix Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2200/ChangeLog,v 1.63 2006/03/25 19:17:23 brix Exp $ + + 25 Mar 2006; Henrik Brix Andersen <brix@gentoo.org> + -files/ipw2200-1.1.1-rtap_iface.patch, ipw2200-1.1.1-r1.ebuild: + Move large patch to mirrors, thanks to Halcy0n in bug #123634. *ipw2200-1.1.1-r1 (24 Mar 2006) diff --git a/net-wireless/ipw2200/Manifest b/net-wireless/ipw2200/Manifest index ca53fa95f4a1..59faacb59578 100644 --- a/net-wireless/ipw2200/Manifest +++ b/net-wireless/ipw2200/Manifest @@ -1,4 +1,4 @@ -MD5 06d05a1b34f9bbbe9ee8a84c80920e11 ChangeLog 11920 +MD5 dc0e35663d00ae2ec7e6617cc73b2d54 ChangeLog 12106 MD5 0366dc766d77664dcfbe0f210a501c6a files/digest-ipw2200-1.0.10 63 MD5 da6616526b85364cf6ef78ee68e00556 files/digest-ipw2200-1.0.11 63 MD5 da6616526b85364cf6ef78ee68e00556 files/digest-ipw2200-1.0.11-r1 63 @@ -8,7 +8,7 @@ MD5 88eeaaf4fc0ffcfd41dd873a1d085cb3 files/digest-ipw2200-1.0.8-r1 62 MD5 a6b695cd887ebc8ee6d37d99971ff62e files/digest-ipw2200-1.0.9 62 MD5 25bb7a22f5d3b003a58fc7a82d6b85d2 files/digest-ipw2200-1.1.0 62 MD5 d65480e8077954294f049d6c4d023b3c files/digest-ipw2200-1.1.1 62 -MD5 d65480e8077954294f049d6c4d023b3c files/digest-ipw2200-1.1.1-r1 62 +MD5 80ae465d8bee456dcdd765d089b758eb files/digest-ipw2200-1.1.1-r1 138 MD5 91e9ccbbcf86cc2b81eff3fc853cb760 files/ipw2200-1.0.11-debug.patch 3496 MD5 a3a2dd68cce2a4d05217369daab108f1 files/ipw2200-1.0.8-broadcast.patch 594 MD5 a2de4d35e783a2aae5708846d8a7637c files/ipw2200-1.0.8-slabcorrupt.patch 522 @@ -16,7 +16,6 @@ MD5 dd96f1bc93f2c8f03a81b87f641a5329 files/ipw2200-1.0.8-txbusy.patch 811 MD5 e994df0999ba085974a28e98e317f702 files/ipw2200-1.0.9-qos.patch 918 MD5 89bdf40b614036a932f84192e4092e9c files/ipw2200-1.1.1-diversity.patch 1165 MD5 646b7e5aba19613998313aeb286f3e40 files/ipw2200-1.1.1-fw_endian.patch 2543 -MD5 a0eeb90732292916bc559e3591d44e94 files/ipw2200-1.1.1-rtap_iface.patch 23653 MD5 fa29197797ebbf5db95a303892a231f1 ipw2200-1.0.10.ebuild 2883 MD5 ed815b8c793ab509c84913c0c16e06e4 ipw2200-1.0.11-r1.ebuild 2946 MD5 b9e8e1f57e42dc0faca0530fb8d34c37 ipw2200-1.0.11.ebuild 2885 @@ -25,6 +24,6 @@ MD5 4d394f10dcd1d2c3ed0654daa3f072fc ipw2200-1.0.13.ebuild 2889 MD5 df20ef6eba3b168c1a8ff98961179b7b ipw2200-1.0.8-r1.ebuild 3017 MD5 d1428344ca6c3b3ece77f85fde18d2f0 ipw2200-1.0.9.ebuild 2935 MD5 7eb15912f846735e9934a3dd461636b2 ipw2200-1.1.0.ebuild 2888 -MD5 500d16edcaa7c227a50e0c0053bda377 ipw2200-1.1.1-r1.ebuild 3103 +MD5 a9151a1d92d9be3af401c793c2fe604b ipw2200-1.1.1-r1.ebuild 3041 MD5 a51b1ea769eb184cdae3610ef0be015b ipw2200-1.1.1.ebuild 2890 MD5 b280eebc74d70d85e664debf1adce2c3 metadata.xml 255 diff --git a/net-wireless/ipw2200/files/digest-ipw2200-1.1.1-r1 b/net-wireless/ipw2200/files/digest-ipw2200-1.1.1-r1 index d715d8c81939..72ddcc05adab 100644 --- a/net-wireless/ipw2200/files/digest-ipw2200-1.1.1-r1 +++ b/net-wireless/ipw2200/files/digest-ipw2200-1.1.1-r1 @@ -1 +1,2 @@ +MD5 0b600742ed75f4132686ddb0a05860be ipw2200-1.1.1-rtap_iface.patch.gz 7171 MD5 1a179639c51a8344830039258a62bccf ipw2200-1.1.1.tgz 127447 diff --git a/net-wireless/ipw2200/files/ipw2200-1.1.1-rtap_iface.patch b/net-wireless/ipw2200/files/ipw2200-1.1.1-rtap_iface.patch deleted file mode 100644 index 0187b71fe2fc..000000000000 --- a/net-wireless/ipw2200/files/ipw2200-1.1.1-rtap_iface.patch +++ /dev/null @@ -1,780 +0,0 @@ -Enable rtap interface for RF promiscuous mode while associated - -With this patch, a new promiscuous mode is enabled. Once applied, -when you load the module with the rtap_iface=1 module parameter, two -interfaces will be created (instead of just one). - -The second interface is prefixed 'rtap' and provides received -802.11 frames on the current channel to user space in a radiotap header -format. - -Example usage: - - % modprobe ipw2200 rtap_iface=1 - % iwconfig eth1 essid MyNetwork - % dhcpcd eth1 - % tcpdump -i rtap0 - -If you do not specify 'rtap_iface=1' then the rtap interface will -not be created and you will need to turn it on via: - - % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface - -Signed-off-by: James Ketrenos <jketreno@linux.intel.com> - -diff -Nupr ipw2200-1.1.1/Makefile ipw2200-1.1.1-rtap/Makefile ---- ipw2200-1.1.1/Makefile 2006-03-08 06:42:54.000000000 -0600 -+++ ipw2200-1.1.1-rtap/Makefile 2006-03-20 22:00:12.000000000 -0600 -@@ -28,7 +28,16 @@ CONFIG_IPW2200_MONITOR=y - - # If you are interested in using radiotap headers in monitor mode, - # simply uncomment: --#CONFIG_IEEE80211_RADIOTAP=y -+# -+# NOTE: To use RADIOTAP you must also enable MONITOR above. -+# CONFIG_IEEE80211_RADIOTAP=y -+ -+# The above monitor mode provides standard monitor mode. The following -+# will create a new interface (named rtap%d) which will be sent all -+# 802.11 frames received on the interface -+# -+# NOTE: To use PROMISCUOUS you must also enable MONITOR above. -+# CONFIG_IPW2200_PROMISCUOUS=y - - endif - -@@ -83,6 +92,9 @@ EXTRA_CFLAGS += -DCONFIG_IPW2200_MONITOR - ifdef CONFIG_IEEE80211_RADIOTAP - EXTRA_CFLAGS += -DCONFIG_IEEE80211_RADIOTAP=$(CONFIG_IEEE80211_RADIOTAP) - endif -+ifdef CONFIG_IPW2200_PROMISCUOUS -+EXTRA_CFLAGS += -DCONFIG_IPW2200_PROMISCUOUS=$(CONFIG_IPW2200_PROMISCUOUS) -+endif - endif - ifdef CONFIG_IPW_QOS - EXTRA_CFLAGS += -DCONFIG_IPW_QOS=$(CONFIG_IPW_QOS) -@@ -184,6 +196,7 @@ patch_kernel: - "obj-\$$(CONFIG_IPW2200) += ipw2200.o" >> \ - ${KSRC}/drivers/net/wireless/Makefile) - @cp README.ipw2200 ${KSRC}/Documentation/networking -+ @cp ipw2200.{c,h} ${KSRC}/drivers/net/wireless - @cp in-tree/Kconfig.ipw2200 ${KSRC}/drivers/net/wireless - @(grep -q "Kconfig\.ipw2200" ${KSRC}/drivers/net/wireless/Kconfig || \ - grep -q "IPW2200" ${KSRC}/drivers/net/wireless/Kconfig || \ -diff -Nupr ipw2200-1.1.1/in-tree/Kconfig.ipw2200 ipw2200-1.1.1-rtap/in-tree/Kconfig.ipw2200 ---- ipw2200-1.1.1/in-tree/Kconfig.ipw2200 1969-12-31 18:00:00.000000000 -0600 -+++ ipw2200-1.1.1-rtap/in-tree/Kconfig.ipw2200 2006-03-20 12:20:08.000000000 -0600 -@@ -0,0 +1,86 @@ -+config IPW2200 -+ tristate "Intel PRO/Wireless 2200BG and 2915ABG Network Connection" -+ depends on IEEE80211 && PCI && NET_RADIO -+ select FW_LOADER -+ ---help--- -+ A driver for the Intel PRO/Wireless 2200BG and 2915ABG Network -+ Connection adapters. -+ -+ See <file:Documentation/networking/README.ipw2200> for -+ information on the capabilities currently enabled in this -+ driver and for tips for debugging issues and problems. -+ -+ In order to use this driver, you will need a firmware image for it. -+ You can obtain the firmware from -+ <http://ipw2200.sf.net/>. See the above referenced README.ipw2200 -+ for information on where to install the firmare images. -+ -+ You will also very likely need the Wireless Tools in order to -+ configure your card: -+ -+ <http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html>. -+ -+ If you want to compile the driver as a module ( = code which can be -+ inserted in and remvoed from the running kernel whenever you want), -+ say M here and read <file:Documentation/modules.txt>. The module -+ will be called ipw2200.ko. -+ -+config IPW_DEBUG -+ bool "Enable full debugging output in IPW2200 module." -+ depends on IPW2200 -+ ---help--- -+ This option will enable debug tracing output for the IPW2200. -+ -+ This will result in the kernel module being ~100k larger. You can -+ control which debug output is sent to the kernel log by setting the -+ value in -+ -+ /sys/bus/pci/drivers/ipw2200/debug_level -+ -+ This entry will only exist if this option is enabled. -+ -+ To set a value, simply echo an 8-byte hex value to the same file: -+ -+ % echo 0x00000FFO > /sys/bus/pci/drivers/ipw2200/debug_level -+ -+ You can find the list of debug mask values in -+ drivers/net/wireless/ipw2200.h -+ -+ If you are not trying to debug or develop the IPW2200 driver, you -+ most likely want to say N here. -+ -+config IPW2200_MONITOR -+ bool "Enable RF monitor mode" -+ depends on IPW2200 -+ ---help--- -+ Enables monitor (aka promiscuous) mode support for the ipw2200 -+ driver. With this feature compiled into the driver, you can -+ switch to monitor mode via the Wireless Tool's mode command. -+ While in monitor mode, no packets can be sent. -+ -+config IPW2200_PROMISCUOUS -+ bool "Enable creation of a RF radiotap promiscuous interface." -+ depends on IPW2200 -+ select IEEE80211_RADIOTAP -+ ---help--- -+ Enables the creation of a second interface is prefixed 'rtap'. -+ This second interface will provide every received in radiotap -+ format. -+ -+ NOTE: This does not provide *all* wireless frames -- only -+ those targetted to this adapter. -+ -+ This is useful for performing wireless network analysis while -+ maintaining an active association. -+ -+ Example usage: -+ -+ % modprobe ipw2200 rtap_iface=1 -+ % ifconfig rtap0 up -+ % tethereal -i rtap0 -+ -+ If you do not specify 'rtap_iface=1' as a module parameter then -+ the rtap interface will not be created and you will need to turn -+ it on via sysfs: -+ -+ % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface -diff -Nupr ipw2200-1.1.1/ipw2200.c ipw2200-1.1.1-rtap/ipw2200.c ---- ipw2200-1.1.1/ipw2200.c 2006-03-08 06:42:55.000000000 -0600 -+++ ipw2200-1.1.1-rtap/ipw2200.c 2006-03-20 22:07:51.000000000 -0600 -@@ -46,7 +46,9 @@ MODULE_AUTHOR(DRV_COPYRIGHT); - MODULE_LICENSE("GPL"); - - static int cmdlog = 0; -+#ifdef CONFIG_IPW2200_DEBUG - static int debug = 0; -+#endif - static int channel = 0; - static int mode = 0; - -@@ -62,6 +64,11 @@ static const char ipw_modes[] = { - 'a', 'b', 'g', '?' - }; - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+static int rtap_iface = 0; /* def: 0 -- do not create rtap interface */ -+#endif -+ -+ - #ifdef CONFIG_IPW_QOS - static int qos_enable = 0; - static int qos_burst_enable = 0; -@@ -1286,6 +1293,76 @@ static ssize_t show_cmd_log(struct devic - - static DEVICE_ATTR(cmd_log, S_IRUGO, show_cmd_log, NULL); - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+static void ipw_prom_free(struct ipw_priv *priv); -+static int ipw_prom_alloc(struct ipw_priv *priv); -+static ssize_t store_rtap_iface(struct device *d, -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) -+ struct device_attribute *attr, -+#endif -+ const char *buf, size_t count) -+{ -+ struct ipw_priv *priv = dev_get_drvdata(d); -+ int rc = 0; -+ -+ if (count < 1) -+ return -EINVAL; -+ -+ switch (buf[0]) { -+ case '0': -+ if (!rtap_iface) -+ return count; -+ -+ if (netif_running(priv->prom_net_dev)) { -+ IPW_WARNING("Interface is up. Cannot unregister.\n"); -+ return count; -+ } -+ -+ ipw_prom_free(priv); -+ rtap_iface = 0; -+ break; -+ -+ case '1': -+ if (rtap_iface) -+ return count; -+ -+ rc = ipw_prom_alloc(priv); -+ if (!rc) -+ rtap_iface = 1; -+ break; -+ -+ default: -+ return -EINVAL; -+ } -+ -+ if (rc) { -+ IPW_ERROR("Failed to register promiscuous network " -+ "device (error %d).\n", rc); -+ } -+ -+ return count; -+} -+ -+static ssize_t show_rtap_iface(struct device *d, -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) -+ struct device_attribute *attr, -+#endif -+ char *buf) -+{ -+ struct ipw_priv *priv = dev_get_drvdata(d); -+ if (rtap_iface) -+ return sprintf(buf, "%s", priv->prom_net_dev->name); -+ else { -+ buf[0] = '-'; -+ buf[1] = '1'; -+ buf[2] = '\0'; -+ return 3; -+ } -+} -+ -+static DEVICE_ATTR(rtap_iface, S_IWUSR | S_IRUSR, show_rtap_iface, store_rtap_iface); -+#endif -+ - static ssize_t show_scan_age(struct device *d, - #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) - struct device_attribute *attr, -@@ -2117,16 +2194,11 @@ static int ipw_send_host_complete(struct - return ipw_send_cmd_simple(priv, IPW_CMD_HOST_COMPLETE); - } - --static int ipw_send_system_config(struct ipw_priv *priv, -- struct ipw_sys_config *config) -+static int ipw_send_system_config(struct ipw_priv *priv) - { -- if (!priv || !config) { -- IPW_ERROR("Invalid args\n"); -- return -1; -- } -- -- return ipw_send_cmd_pdu(priv, IPW_CMD_SYSTEM_CONFIG, sizeof(*config), -- config); -+ return ipw_send_cmd_pdu(priv, IPW_CMD_SYSTEM_CONFIG, -+ sizeof(priv->sys_config), -+ &priv->sys_config); - } - - static int ipw_send_ssid(struct ipw_priv *priv, u8 * ssid, int len) -@@ -3787,7 +3859,17 @@ static void ipw_bg_disassociate(void *da - static void ipw_system_config(void *data) - { - struct ipw_priv *priv = data; -- ipw_send_system_config(priv, &priv->sys_config); -+ -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+ if (priv->prom_net_dev && netif_running(priv->prom_net_dev)) { -+ priv->sys_config.accept_all_data_frames = 1; -+ priv->sys_config.accept_non_directed_frames = 1; -+ priv->sys_config.accept_all_mgmt_bcpr = 1; -+ priv->sys_config.accept_all_mgmt_frames = 1; -+ } -+#endif -+ -+ ipw_send_system_config(priv); - } - - struct ipw_status_code { -@@ -7686,7 +7768,7 @@ static int ipw_associate_network(struct - else - priv->sys_config.answer_broadcast_ssid_probe = 0; - -- err = ipw_send_system_config(priv, &priv->sys_config); -+ err = ipw_send_system_config(priv); - if (err) { - IPW_DEBUG_HC("Attempt to send sys config command failed.\n"); - return err; -@@ -8007,15 +8089,7 @@ static void ipw_handle_data_packet_monit - /* Magic struct that slots into the radiotap header -- no reason - * to build this manually element by element, we can write it much - * more efficiently than we can parse it. ORDER MATTERS HERE */ -- struct ipw_rt_hdr { -- struct ieee80211_radiotap_header rt_hdr; -- u8 rt_flags; /* radiotap packet flags */ -- u8 rt_rate; /* rate in 500kb/s */ -- u16 rt_channel; /* channel in mhz */ -- u16 rt_chbitmask; /* channel bitfield */ -- s8 rt_dbmsignal; /* signal in dbM, kluged to signed */ -- u8 rt_antenna; /* antenna number */ -- } *ipw_rt; -+ struct ipw_rt_hdr *ipw_rt; - - short len = le16_to_cpu(pkt->u.frame.length); - -@@ -8069,9 +8143,11 @@ static void ipw_handle_data_packet_monit - /* Big bitfield of all the fields we provide in radiotap */ - ipw_rt->rt_hdr.it_present = - ((1 << IEEE80211_RADIOTAP_FLAGS) | -+ (1 << IEEE80211_RADIOTAP_TSFT) | - (1 << IEEE80211_RADIOTAP_RATE) | - (1 << IEEE80211_RADIOTAP_CHANNEL) | - (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | -+ (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | - (1 << IEEE80211_RADIOTAP_ANTENNA)); - - /* Zero the flags, we'll add to them as we go */ -@@ -8157,6 +8233,173 @@ static void ipw_handle_data_packet_monit - } - #endif - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+static void ipw_handle_promiscuous_rx(struct ipw_priv *priv, -+ struct ipw_rx_mem_buffer *rxb, -+ struct ieee80211_rx_stats *stats) -+{ -+ struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data; -+ struct ipw_rx_frame *frame = &pkt->u.frame; -+ struct ipw_rt_hdr *ipw_rt; -+ -+ /* First cache any information we need before we overwrite -+ * the information provided in the skb from the hardware */ -+ u16 channel = frame->received_channel; -+ u8 phy_flags = frame->antennaAndPhy; -+ s8 signal = frame->rssi_dbm - IPW_RSSI_TO_DBM; -+ s8 noise = frame->noise; -+ u8 rate = frame->rate; -+ short len = le16_to_cpu(pkt->u.frame.length); -+ u64 tsf = 0; -+ struct sk_buff *skb; -+ -+ if (!noise) -+ noise = priv->last_noise; -+ -+ /* We received data from the HW, so stop the watchdog */ -+ priv->prom_net_dev->trans_start = jiffies; -+ -+ if (unlikely((len + IPW_RX_FRAME_SIZE) > skb_tailroom(rxb->skb))) { -+ priv->prom_priv->ieee->stats.rx_errors++; -+ IPW_DEBUG_DROP("Corruption detected! Oh no!\n"); -+ return; -+ } -+ -+ /* We only process data packets if the interface is open */ -+ if (unlikely(!netif_running(priv->prom_net_dev))) { -+ priv->prom_priv->ieee->stats.rx_dropped++; -+ IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); -+ return; -+ } -+ -+ /* Libpcap 0.9.3+ can handle variable length radiotap, so we'll use -+ * that now */ -+ if (len > IPW_RX_BUF_SIZE - sizeof(struct ipw_rt_hdr)) { -+ /* FIXME: Should alloc bigger skb instead */ -+ priv->prom_priv->ieee->stats.rx_dropped++; -+ IPW_DEBUG_DROP("Dropping too large packet in monitor\n"); -+ return; -+ } -+ -+ /* Copy the SKB since this is for the promiscuous side */ -+ skb = skb_copy(rxb->skb, GFP_ATOMIC); -+ if (skb == NULL) { -+ IPW_ERROR("skb_clone failed for promiscuous copy.\n"); -+ return; -+ } -+ -+ /* copy the frame data to write after where the radiotap header goes */ -+ ipw_rt = (void *)skb->data; -+ memcpy(ipw_rt->payload, -+ rxb->skb->data + IPW_RX_FRAME_SIZE, len); -+ -+ /* Zero the radiotap static buffer ... We only need to zero the bytes -+ * NOT part of our real header, saves a little time. -+ * -+ * No longer necessary since we fill in all our data. Purge before -+ * merging patch officially. -+ * memset(rxb->skb->data + sizeof(struct ipw_rt_hdr), 0, -+ * IEEE80211_RADIOTAP_HDRLEN - sizeof(struct ipw_rt_hdr)); -+ */ -+ -+ ipw_rt->rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION; -+ ipw_rt->rt_hdr.it_pad = 0; /* always good to zero */ -+ ipw_rt->rt_hdr.it_len = sizeof(*ipw_rt); /* total header+data */ -+ -+ /* Set the size of the skb to the size of the frame */ -+ skb_put(skb, ipw_rt->rt_hdr.it_len + len); -+ -+ /* Big bitfield of all the fields we provide in radiotap */ -+ ipw_rt->rt_hdr.it_present = -+ ((1 << IEEE80211_RADIOTAP_FLAGS) | -+ (1 << IEEE80211_RADIOTAP_TSFT) | -+ (1 << IEEE80211_RADIOTAP_RATE) | -+ (1 << IEEE80211_RADIOTAP_CHANNEL) | -+ (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) | -+ (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) | -+ (1 << IEEE80211_RADIOTAP_ANTENNA)); -+ -+ /* Zero the flags, we'll add to them as we go */ -+ ipw_rt->rt_flags = 0; -+ -+ ipw_rt->rt_tsf = tsf; -+ -+ /* Convert to DBM */ -+ ipw_rt->rt_dbmsignal = signal; -+ ipw_rt->rt_dbmnoise = noise; -+ -+ /* Convert the channel data and set the flags */ -+ ipw_rt->rt_channel = cpu_to_le16(ieee80211chan2mhz(channel)); -+ if (channel > 14) { /* 802.11a */ -+ ipw_rt->rt_chbitmask = -+ cpu_to_le16((IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ)); -+ } else if (phy_flags & (1 << 5)) { /* 802.11b */ -+ ipw_rt->rt_chbitmask = -+ cpu_to_le16((IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ)); -+ } else { /* 802.11g */ -+ ipw_rt->rt_chbitmask = -+ (IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ); -+ } -+ -+ /* set the rate in multiples of 500k/s */ -+ switch (rate) { -+ case IPW_TX_RATE_1MB: -+ ipw_rt->rt_rate = 2; -+ break; -+ case IPW_TX_RATE_2MB: -+ ipw_rt->rt_rate = 4; -+ break; -+ case IPW_TX_RATE_5MB: -+ ipw_rt->rt_rate = 10; -+ break; -+ case IPW_TX_RATE_6MB: -+ ipw_rt->rt_rate = 12; -+ break; -+ case IPW_TX_RATE_9MB: -+ ipw_rt->rt_rate = 18; -+ break; -+ case IPW_TX_RATE_11MB: -+ ipw_rt->rt_rate = 22; -+ break; -+ case IPW_TX_RATE_12MB: -+ ipw_rt->rt_rate = 24; -+ break; -+ case IPW_TX_RATE_18MB: -+ ipw_rt->rt_rate = 36; -+ break; -+ case IPW_TX_RATE_24MB: -+ ipw_rt->rt_rate = 48; -+ break; -+ case IPW_TX_RATE_36MB: -+ ipw_rt->rt_rate = 72; -+ break; -+ case IPW_TX_RATE_48MB: -+ ipw_rt->rt_rate = 96; -+ break; -+ case IPW_TX_RATE_54MB: -+ ipw_rt->rt_rate = 108; -+ break; -+ default: -+ ipw_rt->rt_rate = 0; -+ break; -+ } -+ -+ /* antenna number */ -+ ipw_rt->rt_antenna = (phy_flags & 3); -+ -+ /* set the preamble flag if we have it */ -+ if (phy_flags & (1 << 6)) -+ ipw_rt->rt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; -+ -+ IPW_DEBUG_RX("Rx packet of %d bytes.\n", skb->len); -+ -+ if (!ieee80211_rx(priv->prom_priv->ieee, skb, stats)) { -+ priv->prom_priv->ieee->stats.rx_errors++; -+ dev_kfree_skb_any(skb); -+ } -+} -+#endif -+ - static int is_network_packet(struct ipw_priv *priv, - struct ieee80211_hdr_4addr *header) - { -@@ -8383,15 +8626,21 @@ static void ipw_rx(struct ipw_priv *priv - - priv->rx_packets++; - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+ if (priv->prom_net_dev && netif_running(priv->prom_net_dev)) -+ ipw_handle_promiscuous_rx(priv, rxb, &stats); -+#endif -+ - #ifdef CONFIG_IPW2200_MONITOR - if (priv->ieee->iw_mode == IW_MODE_MONITOR) { - #ifdef CONFIG_IEEE80211_RADIOTAP -- ipw_handle_data_packet_monitor(priv, -- rxb, -- &stats); -+ -+ ipw_handle_data_packet_monitor(priv, -+ rxb, -+ &stats); - #else -- ipw_handle_data_packet(priv, rxb, -- &stats); -+ ipw_handle_data_packet(priv, rxb, -+ &stats); - #endif - break; - } -@@ -10912,12 +11161,21 @@ static int ipw_config(struct ipw_priv *p - |= CFG_BT_COEXISTENCE_OOB; - } - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+ if (priv->prom_net_dev && netif_running(priv->prom_net_dev)) { -+ priv->sys_config.accept_all_data_frames = 1; -+ priv->sys_config.accept_non_directed_frames = 1; -+ priv->sys_config.accept_all_mgmt_bcpr = 1; -+ priv->sys_config.accept_all_mgmt_frames = 1; -+ } -+#endif -+ - if (priv->ieee->iw_mode == IW_MODE_ADHOC) - priv->sys_config.answer_broadcast_ssid_probe = 1; - else - priv->sys_config.answer_broadcast_ssid_probe = 0; - -- if (ipw_send_system_config(priv, &priv->sys_config)) -+ if (ipw_send_system_config(priv)) - goto error; - - init_supported_rates(priv, &priv->rates); -@@ -11562,6 +11820,9 @@ static struct attribute *ipw_sysfs_entri - &dev_attr_led.attr, - &dev_attr_speed_scan.attr, - &dev_attr_net_stats.attr, -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+ &dev_attr_rtap_iface.attr, -+#endif - NULL - }; - -@@ -11570,6 +11831,109 @@ static struct attribute_group ipw_attrib - .attrs = ipw_sysfs_entries, - }; - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+static int ipw_prom_open(struct net_device *dev) -+{ -+ struct ipw_prom_priv *prom_priv = ieee80211_priv(dev); -+ struct ipw_priv *priv = prom_priv->priv; -+ -+ IPW_DEBUG_INFO("prom dev->open\n"); -+ netif_carrier_off(dev); -+ netif_stop_queue(dev); -+ -+ if (priv->ieee->iw_mode != IW_MODE_MONITOR) { -+ priv->sys_config.accept_all_data_frames = 1; -+ priv->sys_config.accept_non_directed_frames = 1; -+ priv->sys_config.accept_all_mgmt_bcpr = 1; -+ priv->sys_config.accept_all_mgmt_frames = 1; -+ -+ ipw_send_system_config(priv); -+ } -+ -+ return 0; -+} -+ -+static int ipw_prom_stop(struct net_device *dev) -+{ -+ struct ipw_prom_priv *prom_priv = ieee80211_priv(dev); -+ struct ipw_priv *priv = prom_priv->priv; -+ -+ IPW_DEBUG_INFO("prom dev->stop\n"); -+ -+ if (priv->ieee->iw_mode != IW_MODE_MONITOR) { -+ priv->sys_config.accept_all_data_frames = 0; -+ priv->sys_config.accept_non_directed_frames = 0; -+ priv->sys_config.accept_all_mgmt_bcpr = 0; -+ priv->sys_config.accept_all_mgmt_frames = 0; -+ -+ ipw_send_system_config(priv); -+ } -+ -+ return 0; -+} -+ -+static int ipw_prom_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) -+{ -+ IPW_DEBUG_INFO("prom dev->xmit\n"); -+ netif_stop_queue(dev); -+ return -EOPNOTSUPP; -+} -+ -+static struct net_device_stats *ipw_prom_get_stats(struct net_device *dev) -+{ -+ struct ipw_prom_priv *prom_priv = ieee80211_priv(dev); -+ return &prom_priv->ieee->stats; -+} -+ -+static int ipw_prom_alloc(struct ipw_priv *priv) -+{ -+ int rc = 0; -+ -+ if (priv->prom_net_dev) -+ return -EPERM; -+ -+ priv->prom_net_dev = alloc_ieee80211(sizeof(struct ipw_prom_priv)); -+ if (priv->prom_net_dev == NULL) -+ return -ENOMEM; -+ -+ priv->prom_priv = ieee80211_priv(priv->prom_net_dev); -+ priv->prom_priv->ieee = netdev_priv(priv->prom_net_dev); -+ priv->prom_priv->priv = priv; -+ -+ strcpy(priv->prom_net_dev->name, "rtap%d"); -+ -+ priv->prom_net_dev->type = ARPHRD_IEEE80211_RADIOTAP; -+ priv->prom_net_dev->open = ipw_prom_open; -+ priv->prom_net_dev->stop = ipw_prom_stop; -+ priv->prom_net_dev->get_stats = ipw_prom_get_stats; -+ priv->prom_net_dev->hard_start_xmit = ipw_prom_hard_start_xmit; -+ -+ priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR; -+ -+ rc = register_netdev(priv->prom_net_dev); -+ if (rc) { -+ free_ieee80211(priv->prom_net_dev); -+ priv->prom_net_dev = NULL; -+ return rc; -+ } -+ -+ return 0; -+} -+ -+static void ipw_prom_free(struct ipw_priv *priv) -+{ -+ if (!priv->prom_net_dev) -+ return; -+ -+ unregister_netdev(priv->prom_net_dev); -+ free_ieee80211(priv->prom_net_dev); -+ -+ priv->prom_net_dev = NULL; -+} -+ -+#endif -+ -+ - static int ipw_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) - { - int err = 0; -@@ -11710,6 +12074,18 @@ static int ipw_pci_probe(struct pci_dev - goto out_remove_sysfs; - } - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+ if (rtap_iface) { -+ err = ipw_prom_alloc(priv); -+ if (err) { -+ IPW_ERROR("Failed to register promiscuous network " -+ "device (error %d).\n", err); -+ unregister_netdev(priv->net_dev); -+ goto out_remove_sysfs; -+ } -+ } -+#endif -+ - printk(KERN_INFO DRV_NAME ": Detected geography %s (%d 802.11bg " - "channels, %d 802.11a channels)\n", - priv->ieee->geo.name, priv->ieee->geo.bg_channels, -@@ -11789,6 +12165,10 @@ static void ipw_pci_remove(struct pci_de - priv->error = NULL; - } - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+ ipw_prom_free(priv); -+#endif -+ - free_irq(pdev->irq, priv); - iounmap(priv->hw_base); - pci_release_regions(pdev); -@@ -11934,6 +12314,11 @@ MODULE_PARM_DESC(debug, "debug output ma - module_param(channel, int, 0444); - MODULE_PARM_DESC(channel, "channel to limit associate to (default 0 [ANY])"); - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+module_param(rtap_iface, int, 0444); -+MODULE_PARM_DESC(rtap_iface, "create the rtap interface (1 - create, default 0)"); -+#endif -+ - #ifdef CONFIG_IPW_QOS - module_param(qos_enable, int, 0444); - MODULE_PARM_DESC(qos_enable, "enable all QoS functionalitis"); -diff -Nupr ipw2200-1.1.1/ipw2200.h ipw2200-1.1.1-rtap/ipw2200.h ---- ipw2200-1.1.1/ipw2200.h 2006-03-08 06:42:55.000000000 -0600 -+++ ipw2200-1.1.1-rtap/ipw2200.h 2006-03-20 22:08:13.000000000 -0600 -@@ -797,7 +797,7 @@ struct ipw_sys_config { - u8 bt_coexist_collision_thr; - u8 silence_threshold; - u8 accept_all_mgmt_bcpr; -- u8 accept_all_mgtm_frames; -+ u8 accept_all_mgmt_frames; - u8 pass_noise_stats_to_host; - u8 reserved3; - } __attribute__ ((packed)); -@@ -1130,6 +1130,35 @@ struct ipw_fw_error { - u8 payload[0]; - } __attribute__ ((packed)); - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+struct ipw_priv; -+struct ipw_prom_priv { -+ struct ipw_priv *priv; -+ struct ieee80211_device *ieee; -+ int tx_packets; -+ int rx_packets; -+}; -+#endif -+ -+#if defined(CONFIG_IEEE80211_RADIOTAP) || defined(CONFIG_IPW2200_PROMISCUOUS) -+/* Magic struct that slots into the radiotap header -- no reason -+ * to build this manually element by element, we can write it much -+ * more efficiently than we can parse it. ORDER MATTERS HERE -+ */ -+struct ipw_rt_hdr { -+ struct ieee80211_radiotap_header rt_hdr; -+ u64 rt_tsf; /* TSF */ -+ u8 rt_flags; /* radiotap packet flags */ -+ u8 rt_rate; /* rate in 500kb/s */ -+ u16 rt_channel; /* channel in mhz */ -+ u16 rt_chbitmask; /* channel bitfield */ -+ s8 rt_dbmsignal; /* signal in dbM, kluged to signed */ -+ s8 rt_dbmnoise; -+ u8 rt_antenna; /* antenna number */ -+ u8 payload[0]; /* payload... */ -+} __attribute__ ((packed)); -+#endif -+ - struct ipw_priv { - /* ieee device used by generic ieee processing code */ - struct ieee80211_device *ieee; -@@ -1141,6 +1173,12 @@ struct ipw_priv { - struct pci_dev *pci_dev; - struct net_device *net_dev; - -+#ifdef CONFIG_IPW2200_PROMISCUOUS -+ /* Promiscuous mode */ -+ struct ipw_prom_priv *prom_priv; -+ struct net_device *prom_net_dev; -+#endif -+ - /* pci hardware address support */ - void __iomem *hw_base; - unsigned long hw_len; diff --git a/net-wireless/ipw2200/ipw2200-1.1.1-r1.ebuild b/net-wireless/ipw2200/ipw2200-1.1.1-r1.ebuild index 14c55ee8a212..c34d28e9e4dd 100644 --- a/net-wireless/ipw2200/ipw2200-1.1.1-r1.ebuild +++ b/net-wireless/ipw2200/ipw2200-1.1.1-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2200/ipw2200-1.1.1-r1.ebuild,v 1.1 2006/03/24 16:38:33 brix Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2200/ipw2200-1.1.1-r1.ebuild,v 1.2 2006/03/25 19:17:23 brix Exp $ inherit eutils linux-mod @@ -13,7 +13,8 @@ FW_VERSION="3.0" DESCRIPTION="Driver for the Intel PRO/Wireless 2200BG/2915ABG miniPCI and 2225BG PCI adapters" HOMEPAGE="http://ipw2200.sourceforge.net/" -SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tgz" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tgz + mirror://gentoo/${P}-rtap_iface.patch.gz" LICENSE="GPL-2" SLOT="0" @@ -64,7 +65,7 @@ src_unpack() { cd ${S} epatch ${FILESDIR}/${P}-diversity.patch epatch ${FILESDIR}/${P}-fw_endian.patch - epatch ${FILESDIR}/${P}-rtap_iface.patch + epatch ${WORKDIR}/${P}-rtap_iface.patch use debug && debug="y" sed -i -e "s:^\(CONFIG_IPW2200_DEBUG\)=.*:\1=${debug}:" ${S}/Makefile |