diff options
author | Henrik Brix Andersen <brix@gentoo.org> | 2005-09-06 14:58:35 +0000 |
---|---|---|
committer | Henrik Brix Andersen <brix@gentoo.org> | 2005-09-06 14:58:35 +0000 |
commit | d9bf37527e889cb9f1dad19213dfd2d41ea425f1 (patch) | |
tree | c47c5ba6c89ffdeae8db08f599bd8effa9efa58d /net-wireless | |
parent | Version bump. (diff) | |
download | historical-d9bf37527e889cb9f1dad19213dfd2d41ea425f1.tar.gz historical-d9bf37527e889cb9f1dad19213dfd2d41ea425f1.tar.bz2 historical-d9bf37527e889cb9f1dad19213dfd2d41ea425f1.zip |
Apply bugfixes from upstream, bail out if no ieee80211 kernel module is found.
Package-Manager: portage-2.0.51.22-r2
Diffstat (limited to 'net-wireless')
22 files changed, 871 insertions, 6 deletions
diff --git a/net-wireless/ipw2100/ChangeLog b/net-wireless/ipw2100/ChangeLog index 18485dda5023..727f4eb389e5 100644 --- a/net-wireless/ipw2100/ChangeLog +++ b/net-wireless/ipw2100/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-wireless/ipw2100 # Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2100/ChangeLog,v 1.82 2005/08/29 20:05:01 brix Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2100/ChangeLog,v 1.83 2005/09/06 14:56:16 brix Exp $ + +*ipw2100-1.1.2-r3 (06 Sep 2005) + + 06 Sep 2005; Henrik Brix Andersen <brix@gentoo.org> + +files/ipw2100-1.1.2-header_data-fix.patch, + +files/ipw2100-1.1.2-pci_link-fix.patch, + +files/ipw2100-1.1.2-wext-crash.patch, +ipw2100-1.1.2-r3.ebuild: + Apply bugfixes from upstream, bail out if no ieee80211 kernel module is found. *ipw2100-1.1.2-r2 (29 Aug 2005) diff --git a/net-wireless/ipw2100/Manifest b/net-wireless/ipw2100/Manifest index 0124cad1fae2..6dafe3159962 100644 --- a/net-wireless/ipw2100/Manifest +++ b/net-wireless/ipw2100/Manifest @@ -3,11 +3,14 @@ MD5 7d314c34f4c0162303042f8b0cbc7748 ipw2100-1.1.2-r2.ebuild 2231 MD5 a676f6646db638eab14c1a2b811ddefb ipw2100-1.1.2.ebuild 2124 MD5 0863db88acaaa293aeec4d9e4d8f1097 ipw2100-1.1.2-r1.ebuild 2190 MD5 b798c8a8a65771fb6b6bb0414f4f2517 ipw2100-1.1.1.ebuild 2124 -MD5 b5d2b00448946bb6c13542f874be6163 ChangeLog 15470 +MD5 14657fc6ddf9ab254038d6426c1c518a ChangeLog 15795 +MD5 fb957e23e4a720a4d063c3f8dbcb6a9a ipw2100-1.1.2-r3.ebuild 2675 MD5 172db10566470c8f64b5911609a8e5f9 metadata.xml 318 MD5 c32c1e1a4a1d8797a8663db73c4cebe4 ipw2100-1.0.5.ebuild 2296 MD5 5fb2369d48eb758371baed2ff166ce10 files/ipw2100-1.1.0-suspend2.patch 1173 +MD5 e3ac3c935a2afc27702212a21d03c40d files/ipw2100-1.1.2-pci_link-fix.patch 1816 MD5 35e41d40e65c6248a9b9ed4d76d671d2 files/ipw2100-1.0.5-is_multicast_ether_addr.patch 631 +MD5 79fa87fed06e080137f107efa9313208 files/ipw2100-1.1.2-header_data-fix.patch 900 MD5 fa1d9b13fc88f31abe34565753ff0b90 files/digest-ipw2100-1.0.5 62 MD5 8c080b5455def312dc8b8fb2da3ffa12 files/digest-ipw2100-1.1.0 62 MD5 b42adf38a171429000f5d3e54bc190c4 files/digest-ipw2100-1.1.1 61 @@ -17,4 +20,6 @@ MD5 fd4652f3d313404bf302ab38fc73f645 files/ipw2100-1.1.2-suspend2.patch 599 MD5 1d5956b3a796c4efc0ff535405df4e66 files/ipw2100-1.1.2-ieee80211-1.0.3.patch 437 MD5 b99dfc5774c917655aa0b61b35a8e985 files/digest-ipw2100-1.1.2-r1 61 MD5 b99dfc5774c917655aa0b61b35a8e985 files/digest-ipw2100-1.1.2-r2 61 +MD5 b99dfc5774c917655aa0b61b35a8e985 files/digest-ipw2100-1.1.2-r3 61 MD5 963a9937088ce7886c88a7553921d142 files/ipw2100-1.1.0-is_multicast_ether_addr.patch 695 +MD5 7e2f662229c1ed03903fbcc2d7fae3dc files/ipw2100-1.1.2-wext-crash.patch 742 diff --git a/net-wireless/ipw2100/files/digest-ipw2100-1.1.2-r3 b/net-wireless/ipw2100/files/digest-ipw2100-1.1.2-r3 new file mode 100644 index 000000000000..4b331357f2ff --- /dev/null +++ b/net-wireless/ipw2100/files/digest-ipw2100-1.1.2-r3 @@ -0,0 +1 @@ +MD5 604d44b15a0e0653897ca323310253dc ipw2100-1.1.2.tgz 99001 diff --git a/net-wireless/ipw2100/files/ipw2100-1.1.2-header_data-fix.patch b/net-wireless/ipw2100/files/ipw2100-1.1.2-header_data-fix.patch new file mode 100644 index 000000000000..12e21ee2f734 --- /dev/null +++ b/net-wireless/ipw2100/files/ipw2100-1.1.2-header_data-fix.patch @@ -0,0 +1,25 @@ +Fix compile with ieee80211-1.0.3 + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +-- +diff -urp ipw2100-1.1.2/ipw2100.h ipw2100-1.1.2-header_data/ipw2100.h +--- ipw2100-1.1.2/ipw2100.h 2005-07-14 02:59:37.000000000 +0800 ++++ ipw2100-1.1.2-header_data/ipw2100.h 2005-08-08 14:03:57.000000000 +0800 +@@ -786,7 +786,7 @@ struct ipw2100_priv { + + + +-#define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_header_data) ++#define IPW_HEADER_802_11_SIZE sizeof(struct ieee80211_hdr_3addr) + #define IPW_MAX_80211_PAYLOAD_SIZE 2304U + #define IPW_MAX_802_11_PAYLOAD_LENGTH 2312 + #define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536 +@@ -801,7 +801,7 @@ struct ipw2100_priv { + IPW_802_11_FCS_LENGTH) + + #define IPW_802_11_PAYLOAD_OFFSET \ +- (sizeof(struct ieee80211_header_data) + \ ++ (sizeof(struct ieee80211_hdr_3addr) + \ + sizeof(struct ieee80211_snap_hdr)) + + struct ipw2100_rx { diff --git a/net-wireless/ipw2100/files/ipw2100-1.1.2-pci_link-fix.patch b/net-wireless/ipw2100/files/ipw2100-1.1.2-pci_link-fix.patch new file mode 100644 index 000000000000..7e8f88e42d8e --- /dev/null +++ b/net-wireless/ipw2100/files/ipw2100-1.1.2-pci_link-fix.patch @@ -0,0 +1,59 @@ +Free irq in ->suspend and request irq in ->resume to be compliant with +the latest PM request (Documentation/power/pci.txt). + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +-- +diff -urp ipw2100-1.1.2/ipw2100.c ipw2100-1.1.2-pci_link/ipw2100.c +--- ipw2100-1.1.2/ipw2100.c 2005-07-14 02:59:37.000000000 +0800 ++++ ipw2100-1.1.2-pci_link/ipw2100.c 2005-08-09 15:58:41.000000000 +0800 +@@ -6447,6 +6447,7 @@ static int ipw2100_suspend(struct pci_de + /* Take down the device; powers it off, etc. */ + ipw2100_down(priv); + } ++ free_irq(pci_dev->irq, dev); + + /* Remove the PRESENT state of the device */ + netif_device_detach(dev); +@@ -6473,6 +6474,7 @@ static int ipw2100_resume(struct pci_dev + struct ipw2100_priv *priv = pci_get_drvdata(pci_dev); + struct net_device *dev = priv->net_dev; + u32 val; ++ int err = 0; + + if (IPW2100_PM_DISABLED) + return 0; +@@ -6488,6 +6490,7 @@ static int ipw2100_resume(struct pci_dev + pci_set_power_state(pci_dev, PCI_D0); + #endif + pci_enable_device(pci_dev); ++ + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) + pci_restore_state(pci_dev,priv->pm_state); + #else +@@ -6504,6 +6507,14 @@ static int ipw2100_resume(struct pci_dev + if ((val & 0x0000ff00) != 0) + pci_write_config_dword(pci_dev, 0x40, val & 0xffff00ff); + ++ err = request_irq(pci_dev->irq, ++ ipw2100_interrupt, SA_SHIRQ, dev->name, priv); ++ if (err) { ++ printk(KERN_WARNING DRV_NAME ++ "Error calling request_irq: %d.\n", pci_dev->irq); ++ goto exit; ++ } ++ + /* Set the device back into the PRESENT state; this will also wake + * the queue of needed */ + netif_device_attach(dev); +@@ -6512,9 +6523,9 @@ static int ipw2100_resume(struct pci_dev + if (!(priv->status & STATUS_RF_KILL_SW)) + ipw2100_up(priv, 0); + ++exit: + up(&priv->action_sem); +- +- return 0; ++ return err; + } + #endif + diff --git a/net-wireless/ipw2100/files/ipw2100-1.1.2-wext-crash.patch b/net-wireless/ipw2100/files/ipw2100-1.1.2-wext-crash.patch new file mode 100644 index 000000000000..a3b8d439f4d1 --- /dev/null +++ b/net-wireless/ipw2100/files/ipw2100-1.1.2-wext-crash.patch @@ -0,0 +1,21 @@ +Don't set hardware WEP if we are actually using TKIP/AES. + +Signed-off-by: Hong Liu <hong.liu@intel.com> +-- +diff -Nurp ipw2100-1.1.2/ipw2100.c ipw2100-1.1.2-wext-crash/ipw2100.c +--- ipw2100-1.1.2/ipw2100.c 2005-07-14 02:59:37.000000000 +0800 ++++ ipw2100-1.1.2-wext-crash/ipw2100.c 2005-08-03 16:07:06.000000000 +0800 +@@ -5186,8 +5186,11 @@ static void shim__set_security(struct ne + else + memcpy(priv->ieee->sec.keys[i], sec->keys[i], + sec->key_sizes[i]); +- priv->ieee->sec.flags |= (1 << i); +- priv->status |= STATUS_SECURITY_UPDATED; ++ if (sec->level == SEC_LEVEL_1) { ++ priv->ieee->sec.flags |= (1 << i); ++ priv->status |= STATUS_SECURITY_UPDATED; ++ } else ++ priv->ieee->sec.flags &= ~(1 << i); + } + } + diff --git a/net-wireless/ipw2100/ipw2100-1.1.2-r3.ebuild b/net-wireless/ipw2100/ipw2100-1.1.2-r3.ebuild new file mode 100644 index 000000000000..f2f6848534e3 --- /dev/null +++ b/net-wireless/ipw2100/ipw2100-1.1.2-r3.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2100/ipw2100-1.1.2-r3.ebuild,v 1.1 2005/09/06 14:56:16 brix Exp $ + +inherit eutils linux-mod + +# The following works with both pre-releases and releases +MY_P=${P/_/-} +S=${WORKDIR}/${MY_P} + +IEEE80211_VERSION="1.0.3" +FW_VERSION="1.3" + +DESCRIPTION="Driver for the Intel PRO/Wireless 2100 3B miniPCI adapter" +HOMEPAGE="http://ipw2100.sourceforge.net" +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tgz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" + +IUSE="debug" +DEPEND=">=net-wireless/ieee80211-${IEEE80211_VERSION}" +RDEPEND="${DEPEND} + =net-wireless/ipw2100-firmware-${FW_VERSION} + >=net-wireless/wireless-tools-27_pre23" + +BUILD_TARGETS="all" +MODULE_NAMES="ipw2100(net/wireless:)" +MODULESD_IPW2100_DOCS="README.ipw2100" + +CONFIG_CHECK="NET_RADIO FW_LOADER" +ERROR_NET_RADIO="${P} requires support for Wireless LAN drivers (non-hamradio) & Wireless Extensions (CONFIG_NET_RADIO)." +ERROR_FW_LOADER="${P} requires Hotplug firmware loading support (CONFIG_FW_LOADER)." + +pkg_setup() { + linux-mod_pkg_setup + + if kernel_is 2 4; then + die "${P} does not support building against kernel 2.4.x" + fi + + if [[ ! -f /lib/modules/${KV_FULL}/net/ieee80211/ieee80211.${KV_OBJ} ]]; then + eerror + eerror "Looks like you forgot to remerge net-wireless/ieee80211 after" + eerror "upgrading your kernel." + eerror + eerror "Hint: use sys-kernel/module-rebuild for keeping track of which" + eerror "modules needs to be remerged after a kernel upgrade." + eerror + die "/lib/modules/${KV_FULL}/net/ieee80211/ieee80211.${KV_OBJ} not found" + fi + + BUILD_PARAMS="KSRC=${KV_DIR} KSRC_OUTPUT=${KV_OUT_DIR} IEEE80211_INC=/usr/include" +} + +src_unpack() { + local debug="n" + + unpack ${A} + + cd ${S} + epatch ${FILESDIR}/${P}-header_data-fix.patch + epatch ${FILESDIR}/${P}-pci_link-fix.patch + epatch ${FILESDIR}/${P}-wext-crash.patch + + kernel_is gt 2 6 12 && epatch ${FILESDIR}/${P}-suspend2.patch + + use debug && debug="y" + sed -i -e "s:^\(CONFIG_IPW_DEBUG\)=.*:\1=$debug:" ${S}/Makefile +} + +src_compile() { + linux-mod_src_compile + + einfo + einfo "You may safely ignore any errors from above compilation that contain" + einfo "warnings about undefined references to the ieee80211 subsystem." + einfo +} + +src_install() { + linux-mod_src_install + + dodoc CHANGES +} + +pkg_postinst() { + linux-mod_pkg_postinst + + if [ -f /lib/modules/${KV_FULL}/net/${PN}.ko ]; then + einfo + einfo "Modules from an earlier installation detected. You will need to manually" + einfo "remove those modules by running the following commands:" + einfo " # rm -f /lib/modules/${KV_FULL}/net/${PN}.ko" + einfo " # rm -f /lib/modules/${KV_FULL}/net/ieee80211*.ko" + einfo " # depmod -a" + einfo + fi +} diff --git a/net-wireless/ipw2200/ChangeLog b/net-wireless/ipw2200/ChangeLog index a4d0d5ec4787..3768afab02fd 100644 --- a/net-wireless/ipw2200/ChangeLog +++ b/net-wireless/ipw2200/ChangeLog @@ -1,6 +1,20 @@ # ChangeLog for net-wireless/ipw2200 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2200/ChangeLog,v 1.43 2005/09/02 17:34:44 brix Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2200/ChangeLog,v 1.44 2005/09/06 14:58:35 brix Exp $ + +*ipw2200-1.0.6-r3 (06 Sep 2005) + + 06 Sep 2005; Henrik Brix Andersen <brix@gentoo.org> + +files/ipw2200-1.0.6-a_txpow.patch, files/ipw2200-1.0.6-broadcast.patch, + +files/ipw2200-1.0.6-channel_change_fw_err.patch, + +files/ipw2200-1.0.6-dup-without-retry.patch, + +files/ipw2200-1.0.6-ibss-wep.patch, +files/ipw2200-1.0.6-init_scan.patch, + +files/ipw2200-1.0.6-irq_override.patch, + +files/ipw2200-1.0.6-monitor_wep_fix.patch, + +files/ipw2200-1.0.6-open_frag.patch, + +files/ipw2200-1.0.6-pci_link-fix.patch, + +files/ipw2200-1.0.6-reset-mode-fix.patch, +ipw2200-1.0.6-r3.ebuild: + Apply bugfixes from upstream, bail out if no ieee80211 kernel module is found. *ipw2200-1.0.6-r2 (02 Sep 2005) diff --git a/net-wireless/ipw2200/Manifest b/net-wireless/ipw2200/Manifest index 77c17b3c1058..cfce897516cc 100644 --- a/net-wireless/ipw2200/Manifest +++ b/net-wireless/ipw2200/Manifest @@ -1,3 +1,4 @@ +MD5 bbf188972a3aa6a3b0dfcd2e4d1a0b19 ipw2200-1.0.6-r3.ebuild 3106 MD5 03551f14b4409796623fb865ed2abf97 ipw2200-1.0.4.ebuild 2449 MD5 7afca8db2613b9fc32d5f7005b4db15d ipw2200-1.0.6.ebuild 2158 MD5 a1d82c4728a3f608b762fe63c4910f42 ipw2200-1.0.1.ebuild 2488 @@ -5,18 +6,29 @@ MD5 4ce2b88ec5f872d1621a5af9cf1d0da1 ipw2200-1.0.6-r2.ebuild 2304 MD5 b2138b76ba85eeea301d8fa9f72470df ipw2200-1.0.3.ebuild 2488 MD5 8a1b21691e17dc6de38c7238cd4e4522 ipw2200-1.0.5.ebuild 2145 MD5 7453a3247e41a7bf8c6e939cf55c45f0 ipw2200-1.0.6-r1.ebuild 2260 -MD5 37214287af0ae90261ab9bc20ef8d2ca ChangeLog 7383 +MD5 a01be9dd5aabeebe1a93a01e1eda44d9 ChangeLog 8047 MD5 b280eebc74d70d85e664debf1adce2c3 metadata.xml 255 +MD5 57bc9c6eb5f4015c48658642ca771b54 files/ipw2200-1.0.6-ibss-wep.patch 1249 MD5 2dc4d1d726fc4dce22dee416d6028353 files/ipw2200-1.0.4-is_multicast_ether_addr.patch 647 MD5 abdb4f9be556bd09fe711f6a7cd42ee2 files/ipw2200-1.0.6-suspend2.patch 520 +MD5 b0d2d1d8adbf103c40cfff2a0b5a9bd9 files/ipw2200-1.0.6-init_scan.patch 996 MD5 2ba8f54679172b49a799779c1a02127a files/ipw2200-1.0.6-hwcrypt-wpa-fix4.patch 5840 MD5 9e25eeda7c745bca8c5cf72537dd31f5 files/ipw2200-1.0.1-suspend2.patch 448 MD5 af6756863c64cdfc93cd53556f8b397b files/ipw2200-1.0.1-is_multicast_ether_addr.patch 631 +MD5 64c7772c52dad7ac8aceb580288d2eb8 files/ipw2200-1.0.6-dup-without-retry.patch 1124 +MD5 8e45f8fd6f60e9d8b6b343ae2359f456 files/ipw2200-1.0.6-reset-mode-fix.patch 621 +MD5 a09593c7d4c70507961ceb3e9788f282 files/ipw2200-1.0.6-irq_override.patch 1219 MD5 7a64b674dbd99046028827c6417409e1 files/ipw2200-1.0.3-is_multicast_ether_addr.patch 715 -MD5 2833c1b240e20a5b7ecb45f5435cf24f files/ipw2200-1.0.6-broadcast.patch 992 +MD5 b67059711d35db39da22e42fd1a5a7d4 files/ipw2200-1.0.6-open_frag.patch 756 +MD5 2a2177cb34ff1d51ca335f8786a41e92 files/ipw2200-1.0.6-channel_change_fw_err.patch 2830 +MD5 d506e1d6b23fdd00ec0d812db1f3f05a files/ipw2200-1.0.6-broadcast.patch 992 +MD5 3ada2bd4ff1452839bc558b3e5e026f5 files/ipw2200-1.0.6-a_txpow.patch 5085 MD5 ba6c39e9a44ef971292c5f8e6a7c6897 files/ipw2200-1.0.3-suspend2.patch 522 +MD5 d0074a6c01392cb21c47b8f370716a0f files/ipw2200-1.0.6-monitor_wep_fix.patch 714 MD5 aab93fcc37b1a1282d7a02e9b64430a3 files/digest-ipw2200-1.0.6-r1 62 MD5 aab93fcc37b1a1282d7a02e9b64430a3 files/digest-ipw2200-1.0.6-r2 62 +MD5 aab93fcc37b1a1282d7a02e9b64430a3 files/digest-ipw2200-1.0.6-r3 62 +MD5 f20e5c312fa263336e4921aa6e42b56e files/ipw2200-1.0.6-pci_link-fix.patch 1298 MD5 d2a1aca212498ad4de9f4a79ac12026b files/digest-ipw2200-1.0.1 62 MD5 1953868cbb8ae6ee8eee55c5848417ab files/digest-ipw2200-1.0.3 62 MD5 bcf142294729f1a55d7b3fd29c1a8239 files/digest-ipw2200-1.0.4 62 diff --git a/net-wireless/ipw2200/files/digest-ipw2200-1.0.6-r3 b/net-wireless/ipw2200/files/digest-ipw2200-1.0.6-r3 new file mode 100644 index 000000000000..53844e808285 --- /dev/null +++ b/net-wireless/ipw2200/files/digest-ipw2200-1.0.6-r3 @@ -0,0 +1 @@ +MD5 d49f301ce8cffbd1cfbdb51061df3ac8 ipw2200-1.0.6.tgz 112932 diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-a_txpow.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-a_txpow.patch new file mode 100644 index 000000000000..21d100949b59 --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-a_txpow.patch @@ -0,0 +1,183 @@ +Fix firmware error when setting tx_power. + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +-- +diff -urp ipw2200-1.0.6/ipw2200.c ipw2200-1.0.6-a_txpow/ipw2200.c +--- ipw2200-1.0.6/ipw2200.c 2005-07-14 03:00:28.000000000 +0800 ++++ ipw2200-1.0.6-a_txpow/ipw2200.c 2005-08-11 14:35:00.000000000 +0800 +@@ -2179,6 +2179,50 @@ static int ipw_send_tx_power(struct ipw_ + return 0; + } + ++static int ipw_set_tx_power(struct ipw_priv *priv) ++{ ++ const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); ++ struct ipw_tx_power tx_power; ++ s8 max_power; ++ int i; ++ ++ memset(&tx_power, 0, sizeof(tx_power)); ++ ++ /* configure device for 'G' band */ ++ tx_power.ieee_mode = IPW_G_MODE; ++ tx_power.num_channels = geo->bg_channels; ++ for (i = 0; i < geo->bg_channels; i++) { ++ max_power = geo->bg[i].max_power; ++ tx_power.channels_tx_power[i].channel_number = ++ geo->bg[i].channel; ++ tx_power.channels_tx_power[i].tx_power = max_power ? ++ min(max_power, priv->tx_power) : priv->tx_power; ++ } ++ if (ipw_send_tx_power(priv, &tx_power)) ++ return -EIO; ++ ++ /* configure device to also handle 'B' band */ ++ tx_power.ieee_mode = IPW_B_MODE; ++ if (ipw_send_tx_power(priv, &tx_power)) ++ return -EIO; ++ ++ /* configure device to also handle 'A' band */ ++ if (priv->ieee->abg_true) { ++ tx_power.ieee_mode = IPW_A_MODE; ++ tx_power.num_channels = geo->a_channels; ++ for (i = 0; i < tx_power.num_channels; i++) { ++ max_power = geo->a[i].max_power; ++ tx_power.channels_tx_power[i].channel_number = ++ geo->a[i].channel; ++ tx_power.channels_tx_power[i].tx_power = max_power ? ++ min(max_power, priv->tx_power) : priv->tx_power; ++ } ++ if (ipw_send_tx_power(priv, &tx_power)) ++ return -EIO; ++ } ++ return 0; ++} ++ + static int ipw_send_rts_threshold(struct ipw_priv *priv, u16 rts) + { + struct ipw_rts_threshold rts_threshold = { +@@ -8744,83 +8788,38 @@ static int ipw_wx_get_rts(struct net_dev + return 0; + } + +- + static int ipw_wx_set_txpow(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) + { + struct ipw_priv *priv = ieee80211_priv(dev); +- const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); +- struct ipw_tx_power tx_power; +- int i; ++ int err = 0; + + down(&priv->sem); + if (ipw_radio_kill_sw(priv, wrqu->power.disabled)) { +- up(&priv->sem); +- return -EINPROGRESS; ++ err = -EINPROGRESS; ++ goto out; + } + + if (!wrqu->power.fixed) + wrqu->power.value = IPW_TX_POWER_DEFAULT; + + if (wrqu->power.flags != IW_TXPOW_DBM) { +- up(&priv->sem); +- return -EINVAL; ++ err = -EINVAL; ++ goto out; + } + + if ((wrqu->power.value > IPW_TX_POWER_MAX) || + (wrqu->power.value < IPW_TX_POWER_MIN)) { +- up(&priv->sem); +- return -EINVAL; ++ err = -EINVAL; ++ goto out; + } + + priv->tx_power = wrqu->power.value; +- +- memset(&tx_power, 0, sizeof(tx_power)); +- +- /* configure device for 'G' band */ +- tx_power.ieee_mode = IPW_G_MODE; +- tx_power.num_channels = geo->bg_channels; +- for (i = 0; i < geo->bg_channels; i++) { +- int max_power = geo->bg[i].max_power; +- +- tx_power.channels_tx_power[i].channel_number = i + 1; +- if (max_power != 0 && priv->tx_power > max_power) +- tx_power.channels_tx_power[i].tx_power = max_power; +- else +- tx_power.channels_tx_power[i].tx_power = priv->tx_power; +- } +- if (ipw_send_tx_power(priv, &tx_power)) +- goto error; +- +- /* configure device to also handle 'B' band */ +- tx_power.ieee_mode = IPW_B_MODE; +- if (ipw_send_tx_power(priv, &tx_power)) +- goto error; +- +- /* configure device to also handle 'A' band */ +- if (priv->ieee->abg_true) { +- tx_power.ieee_mode = IPW_A_MODE; +- tx_power.num_channels = geo->a_channels; +- for (i = 0; i < geo->a_channels; i++) { +- int max_power = geo->a[i].max_power; +- +- tx_power.channels_tx_power[i].channel_number = i + 1; +- if (max_power != 0 && priv->tx_power > max_power) +- tx_power.channels_tx_power[i].tx_power = max_power; +- else +- tx_power.channels_tx_power[i].tx_power = priv->tx_power; +- } +- if (ipw_send_tx_power(priv, &tx_power)) +- goto error; +- } +- +- up(&priv->sem); +- return 0; +- +- error: ++ err = ipw_set_tx_power(priv); ++out: + up(&priv->sem); +- return -EIO; ++ return err; + } + + +@@ -10302,29 +10301,10 @@ static int init_supported_rates(struct i + + static int ipw_config(struct ipw_priv *priv) + { +- int i; +- struct ipw_tx_power tx_power; +- +- memset(&priv->sys_config, 0, sizeof(priv->sys_config)); +- memset(&tx_power, 0, sizeof(tx_power)); +- + /* This is only called from ipw_up, which resets/reloads the firmware + so, we don't need to first disable the card before we configure + it */ +- +- /* configure device for 'G' band */ +- tx_power.ieee_mode = IPW_G_MODE; +- tx_power.num_channels = 11; +- for (i = 0; i < 11; i++) { +- tx_power.channels_tx_power[i].channel_number = i + 1; +- tx_power.channels_tx_power[i].tx_power = priv->tx_power; +- } +- if (ipw_send_tx_power(priv, &tx_power)) +- goto error; +- +- /* configure device to also handle 'B' band */ +- tx_power.ieee_mode = IPW_B_MODE; +- if (ipw_send_tx_power(priv, &tx_power)) ++ if (ipw_set_tx_power(priv)) + goto error; + + /* initialize adapter address */ diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-broadcast.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-broadcast.patch index 28061f84af28..0c3f8e386bd1 100644 --- a/net-wireless/ipw2200/files/ipw2200-1.0.6-broadcast.patch +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-broadcast.patch @@ -1,6 +1,6 @@ diff -urp ipw2200-1.0.6/ipw2200.c ipw2200-1.0.6-broadcast/ipw2200.c --- ipw2200-1.0.6/ipw2200.c 2005-07-13 21:00:28.000000000 +0200 -+++ ipw2200-1.0.6-broadcast/ipw2200.c 2005-09-02 19:15:03.000000000 +0200 ++++ ipw2200-1.0.6-broadcast/ipw2200.c 2005-09-02 19:39:01.000000000 +0200 @@ -7669,7 +7669,8 @@ static inline int is_network_packet(stru return 0; diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-channel_change_fw_err.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-channel_change_fw_err.patch new file mode 100644 index 000000000000..e270aa936899 --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-channel_change_fw_err.patch @@ -0,0 +1,89 @@ +[Bug 455] Fix frequent channel change generates firmware fatal error. + +Because of the frequent channel change, it is possible that when we are +try to associate with channel 1 (authenticated but not associated). +Another channel change comes at this time, then the driver will issue +disassociate command to the firmware which will cause the fatal error. + +It seems that the association/disassociation procedure should not be +interrupted. + +The patch attached adds test on STATUS_ASSOCIATING | STATUS_DISASSOCIATING +in ipw_send_cmd(), when ensures that commands will not be sent to firmware +when we are in these two status. + +Signed-off-by: Hong Liu <hong.liu@intel.com> +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +-- +diff -Nurp ipw2200-1.0.6-orig/ipw2200.c ipw2200-1.0.6/ipw2200.c +--- ipw2200-1.0.6-orig/ipw2200.c 2005-04-12 17:03:02.000000000 +0800 ++++ ipw2200-1.0.6/ipw2200.c 2005-04-13 13:42:03.496914912 +0800 +@@ -1592,6 +1592,18 @@ static int ipw_send_cmd(struct ipw_priv + return -1; + } + ++ if (priv->status & STATUS_ASSOCIATING) { ++ IPW_DEBUG_HC("abandon a command while associating\n"); ++ spin_unlock_irqrestore(&priv->lock, flags); ++ return -1; ++ } ++ ++ if (priv->status & STATUS_DISASSOCIATING) { ++ IPW_DEBUG_HC("abandon a command while disassociating\n"); ++ spin_unlock_irqrestore(&priv->lock, flags); ++ return -1; ++ } ++ + priv->status |= STATUS_HCMD_ACTIVE; + + IPW_DEBUG_HC("Sending %s command (#%d), %d bytes\n", +@@ -3385,14 +3397,17 @@ static void ipw_send_disassociate(struct + return; + } + ++ if (priv->status & STATUS_ASSOCIATING) { ++ IPW_DEBUG_ASSOC("Disassociating while associating.\n"); ++ queue_work(priv->workqueue, &priv->disassociate); ++ return; ++ } ++ + IPW_DEBUG_ASSOC("Disassocation attempt from " MAC_FMT " " + "on channel %d.\n", + MAC_ARG(priv->assoc_request.bssid), + priv->assoc_request.channel); + +- priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED); +- priv->status |= STATUS_DISASSOCIATING; +- + if (quiet) + priv->assoc_request.assoc_type = HC_DISASSOC_QUIET; + else +@@ -3404,6 +3419,9 @@ static void ipw_send_disassociate(struct + return; + } + ++ priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED); ++ priv->status |= STATUS_DISASSOCIATING; ++ + } + + static int ipw_disassociate(void *data) +@@ -6093,8 +6111,6 @@ static int ipw_associate_network(struct + */ + priv->channel = network->channel; + memcpy(priv->bssid, network->bssid, ETH_ALEN); +- priv->status |= STATUS_ASSOCIATING; +- priv->status &= ~STATUS_SECURITY_UPDATED; + + priv->assoc_network = network; + +@@ -6104,6 +6120,9 @@ static int ipw_associate_network(struct + return err; + } + ++ priv->status |= STATUS_ASSOCIATING; ++ priv->status &= ~STATUS_SECURITY_UPDATED; ++ + IPW_DEBUG(IPW_DL_STATE, "associating: '%s' " MAC_FMT " \n", + escape_essid(priv->essid, priv->essid_len), + MAC_ARG(priv->bssid)); diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-dup-without-retry.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-dup-without-retry.patch new file mode 100644 index 000000000000..7f79ec0fd32d --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-dup-without-retry.patch @@ -0,0 +1,32 @@ +Walkaround kernel BUG_ON panic caused by unexpected duplicate packets. + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +--- + + ipw2200-1.0.6-chuyee/ipw2200.c | 6 ++++-- + 1 files changed, 4 insertions(+), 2 deletions(-) + +diff -puN ipw2200.c~dup-without-retry ipw2200.c +--- ipw2200-1.0.6/ipw2200.c~dup-without-retry 2005-08-03 13:59:11.000000000 +0800 ++++ ipw2200-1.0.6-chuyee/ipw2200.c 2005-08-03 14:51:52.000000000 +0800 +@@ -7698,7 +7698,6 @@ static inline int is_network_packet(stru + static inline int is_duplicate_packet(struct ipw_priv *priv, + struct ieee80211_hdr *header) + { +- u16 fc = le16_to_cpu(header->frame_ctl); + u16 sc = le16_to_cpu(header->seq_ctl); + u16 seq = WLAN_GET_SEQ_SEQ(sc); + u16 frag = WLAN_GET_SEQ_FRAG(sc); +@@ -7759,7 +7758,10 @@ static inline int is_duplicate_packet(st + return 0; + + drop: +- BUG_ON(!(fc & IEEE80211_FCTL_RETRY)); ++ /* Comment this line now since we observed the card receives ++ * duplicate packets but the FCTL_RETRY bit is not set in the ++ * IBSS mode with fragmentation enabled. ++ BUG_ON(!(le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_RETRY)); */ + return 1; + } + +_ diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-ibss-wep.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-ibss-wep.patch new file mode 100644 index 000000000000..00dbf4708221 --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-ibss-wep.patch @@ -0,0 +1,41 @@ +Author: Hong Liu <hong.liu@intel.com> + +This patch fixes the ah-hoc network issue. + +If we configure the wep keys after creating the ibss network, the +beacons of this network will not show correctly (it still shows "key +off" in iwlist scan report). This is because we don't update the +beacon info in firmware. + +Signed-off-by: Hong Liu <hong.liu@intel.com> +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +--- + + ipw2200-1.0.6-chuyee/ipw2200.c | 10 +++++++++- + 1 files changed, 9 insertions(+), 1 deletion(-) + +diff -puN ipw2200.c~ibss-wep ipw2200.c +--- ipw2200-1.0.6/ipw2200.c~ibss-wep 2005-07-15 14:40:29.000000000 +0800 ++++ ipw2200-1.0.6-chuyee/ipw2200.c 2005-07-15 14:46:02.000000000 +0800 +@@ -9053,11 +9053,19 @@ static int ipw_wx_set_encode(struct net_ + { + struct ipw_priv *priv = ieee80211_priv(dev); + int ret; ++ u32 cap = priv->capability; + + down(&priv->sem); + ret = ieee80211_wx_set_encode(priv->ieee, info, wrqu, key); +- up(&priv->sem); + ++ /* In IBSS mode, we need to notify the firmware to update ++ * the beacon info after we changed the capability. */ ++ if (cap != priv->capability && ++ priv->ieee->iw_mode == IW_MODE_ADHOC && ++ priv->status & STATUS_ASSOCIATED) ++ ipw_disassociate(priv); ++ ++ up(&priv->sem); + return ret; + } + +_ diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-init_scan.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-init_scan.patch new file mode 100644 index 000000000000..06210bc9cd97 --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-init_scan.patch @@ -0,0 +1,30 @@ +[Bug 751] Fix driver association requires manual scan. + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +-- +diff -urp ipw2200-1.0.6/ipw2200.c ipw2200-1.0.6-init_scan/ipw2200.c +--- ipw2200-1.0.6/ipw2200.c 2005-07-14 03:00:28.000000000 +0800 ++++ ipw2200-1.0.6-init_scan/ipw2200.c 2005-08-11 12:38:34.000000000 +0800 +@@ -10428,13 +10428,13 @@ static int ipw_up(struct ipw_priv *priv) + return 0; + } + ++ priv->status |= STATUS_INIT; + rc = ipw_config(priv); + if (!rc) { + IPW_DEBUG_INFO("Configured device on count %i\n", i); + ipw_led_init(priv); + ipw_led_radio_on(priv); + priv->notif_missed_beacons = 0; +- priv->status |= STATUS_INIT; + + /* Set hardware WEP key if it is configured. */ + if ((priv->capability & CAP_PRIVACY_ON) && +@@ -10445,6 +10445,7 @@ static int ipw_up(struct ipw_priv *priv) + + return 0; + } ++ priv->status &= ~STATUS_INIT; + + IPW_DEBUG_INFO("Device configuration failed: 0x%08X\n", rc); + IPW_DEBUG_INFO("Failed to config device on retry %d of %d\n", diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-irq_override.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-irq_override.patch new file mode 100644 index 000000000000..b363afe919c9 --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-irq_override.patch @@ -0,0 +1,37 @@ +Add ability to override default irq assigned by the system. This is used +to debug IRQ related problems. + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +-- +diff -urp ipw2200-1.0.6/ipw2200.c ipw2200-1.0.6-irq/ipw2200.c +--- ipw2200-1.0.6/ipw2200.c 2005-08-10 10:29:25.000000000 +0800 ++++ ipw2200-1.0.6-irq/ipw2200.c 2005-08-15 17:24:50.000000000 +0800 +@@ -52,6 +52,7 @@ static int auto_create = 1; + static int led = 0; + static int disable = 0; + static int hwcrypto = 1; ++static int irq = 0; + static const char ipw_modes[] = { + 'a', 'b', 'g', '?' + }; +@@ -10714,6 +10715,11 @@ static int ipw_pci_probe(struct pci_dev + + ipw_sw_reset(priv, 1); + ++ if (irq) { ++ printk(KERN_INFO "Override default irq from %d to %d.\n", ++ pdev->irq, irq); ++ pdev->irq = irq; ++ } + err = request_irq(pdev->irq, ipw_isr, SA_SHIRQ, DRV_NAME, priv); + if (err) { + IPW_ERROR("Error allocating IRQ %d\n", pdev->irq); +@@ -11004,5 +11010,8 @@ MODULE_PARM_DESC(mode, "network mode (0= + module_param(hwcrypto, int, 0444); + MODULE_PARM_DESC(hwcrypto, "enable hardware crypto (default on)"); + ++module_param(irq, int, 0444); ++MODULE_PARM_DESC(irq, "override defualt irq assigned by the system"); ++ + module_exit(ipw_exit); + module_init(ipw_init); diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-monitor_wep_fix.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-monitor_wep_fix.patch new file mode 100644 index 000000000000..51a783e46b05 --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-monitor_wep_fix.patch @@ -0,0 +1,17 @@ +[Bug 760] Fix setting WEP key in monitor mode causes IV lost. + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +-- +diff -urp ipw2200-1.0.6/ipw2200.c ipw2200-1.0.6-monitor_wep/ipw2200.c +--- ipw2200-1.0.6/ipw2200.c 2005-08-25 11:13:57.000000000 +0800 ++++ ipw2200-1.0.6-monitor_wep/ipw2200.c 2005-08-25 11:14:19.000000000 +0800 +@@ -7648,7 +7648,8 @@ static void ipw_handle_data_packet(struc + IPW_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len); + + /* HW decrypt will not clear the WEP bit, MIC, PN, etc. */ +- if (!priv->ieee->host_decrypt) ++ if (!priv->ieee->host_decrypt && ++ priv->ieee->iw_mode != IW_MODE_MONITOR) + ipw_rebuild_decrypted_skb(priv, rxb->skb); + + if (!ieee80211_rx(priv->ieee, rxb->skb, stats)) diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-open_frag.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-open_frag.patch new file mode 100644 index 000000000000..25ec763e3c53 --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-open_frag.patch @@ -0,0 +1,23 @@ +Disable host fragementation in open mode since hardware support it. + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +--- + + ipw2200-1.0.6-chuyee/ipw2200.c | 3 +++ + 1 files changed, 3 insertions(+) + +diff -L ipw2100.c -puN /dev/null /dev/null +diff -puN ipw2200.c~open_frag ipw2200.c +--- ipw2200-1.0.6/ipw2200.c~open_frag 2005-08-03 15:54:41.000000000 +0800 ++++ ipw2200-1.0.6-chuyee/ipw2200.c 2005-08-03 15:56:55.000000000 +0800 +@@ -8050,6 +8050,9 @@ static int ipw_sw_reset(struct ipw_priv + } + IPW_DEBUG_INFO("Hardware crypto [%s]\n", hwcrypto ? "on" : "off"); + ++ /* IPW2200/2915 is abled to do hardware fragmentation. */ ++ priv->ieee->host_open_frag = 0; ++ + if ((priv->pci_dev->device == 0x4223) || + (priv->pci_dev->device == 0x4224)) { + if (init) +_ diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-pci_link-fix.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-pci_link-fix.patch new file mode 100644 index 000000000000..1e111ca8b6ed --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-pci_link-fix.patch @@ -0,0 +1,37 @@ +Free irq in ->suspend and request irq in ->resume to be compliant with +the latest PM request (Documentation/power/pci.txt). + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +-- +diff -urp ipw2200-1.0.6/ipw2200.c ipw2200-1.0.6-pci_link/ipw2200.c +--- ipw2200-1.0.6/ipw2200.c 2005-08-10 10:29:25.000000000 +0800 ++++ ipw2200-1.0.6-pci_link/ipw2200.c 2005-08-10 10:36:06.000000000 +0800 +@@ -10856,6 +10856,7 @@ static int ipw_pci_suspend(struct pci_de + + /* Take down the device; powers it off, etc. */ + ipw_down(priv); ++ free_irq(pdev->irq, priv); + + /* Remove the PRESENT state of the device */ + netif_device_detach(dev); +@@ -10881,6 +10882,7 @@ static int ipw_pci_resume(struct pci_dev + struct ipw_priv *priv = pci_get_drvdata(pdev); + struct net_device *dev = priv->net_dev; + u32 val; ++ int err; + + printk(KERN_INFO "%s: Coming out of suspend...\n", dev->name); + +@@ -10905,6 +10907,12 @@ static int ipw_pci_resume(struct pci_dev + if ((val & 0x0000ff00) != 0) + pci_write_config_dword(pdev, 0x40, val & 0xffff00ff); + ++ err = request_irq(pdev->irq, ipw_isr, SA_SHIRQ, DRV_NAME, priv); ++ if (err) { ++ IPW_ERROR("Error allocating IRQ %d\n", pdev->irq); ++ return err; ++ } ++ + /* Set the device back into the PRESENT state; this will also wake + * the queue of needed */ + netif_device_attach(dev); diff --git a/net-wireless/ipw2200/files/ipw2200-1.0.6-reset-mode-fix.patch b/net-wireless/ipw2200/files/ipw2200-1.0.6-reset-mode-fix.patch new file mode 100644 index 000000000000..9d49f98c9aab --- /dev/null +++ b/net-wireless/ipw2200/files/ipw2200-1.0.6-reset-mode-fix.patch @@ -0,0 +1,21 @@ +[Bug 701] Fix a misuse of ieee->mode with ieee->iw_mode. + +Signed-off-by: Zhu Yi <yi.zhu@intel.com> +--- + + ipw2200-1.0.6-chuyee/ipw2200.c | 2 +- + 1 files changed, 1 insertion(+), 1 deletion(-) + +diff -puN ipw2200.c~reset-mode-fix ipw2200.c +--- ipw2200-1.0.6/ipw2200.c~reset-mode-fix 2005-07-15 14:21:25.000000000 +0800 ++++ ipw2200-1.0.6-chuyee/ipw2200.c 2005-07-15 14:22:34.000000000 +0800 +@@ -8093,7 +8093,7 @@ static int ipw_sw_reset(struct ipw_priv + priv->power_mode = IPW_POWER_AC; + priv->tx_power = IPW_TX_POWER_DEFAULT; + +- return old_mode == priv->ieee->mode; ++ return old_mode == priv->ieee->iw_mode; + } + + +_ diff --git a/net-wireless/ipw2200/ipw2200-1.0.6-r3.ebuild b/net-wireless/ipw2200/ipw2200-1.0.6-r3.ebuild new file mode 100644 index 000000000000..45bae3974d2d --- /dev/null +++ b/net-wireless/ipw2200/ipw2200-1.0.6-r3.ebuild @@ -0,0 +1,109 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-wireless/ipw2200/ipw2200-1.0.6-r3.ebuild,v 1.1 2005/09/06 14:58:35 brix Exp $ + +inherit eutils linux-mod + +# The following works with both pre-releases and releases +MY_P=${P/_/-} +S=${WORKDIR}/${MY_P} + +IEEE80211_VERSION="1.0.3-r1" +FW_VERSION="2.3" + +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" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +IUSE="debug" +DEPEND=">=net-wireless/ieee80211-${IEEE80211_VERSION}" +RDEPEND="${DEPEND} + =net-wireless/ipw2200-firmware-${FW_VERSION} + net-wireless/wireless-tools" + +BUILD_TARGETS="all" +MODULE_NAMES="ipw2200(net/wireless:)" +MODULESD_IPW2200_DOCS="README.ipw2200" + +CONFIG_CHECK="NET_RADIO FW_LOADER" +ERROR_NET_RADIO="${P} requires support for Wireless LAN drivers (non-hamradio) & Wireless Extensions (CONFIG_NET_RADIO)." +ERROR_FW_LOADER="${P} requires Hotplug firmware loading support (CONFIG_FW_LOADER)." + +pkg_setup() { + linux-mod_pkg_setup + + if kernel_is 2 4; then + die "${P} does not support building against kernel 2.4.x" + fi + + if [[ ! -f /lib/modules/${KV_FULL}/net/ieee80211/ieee80211.${KV_OBJ} ]]; then + eerror + eerror "Looks like you forgot to remerge net-wireless/ieee80211 after" + eerror "upgrading your kernel." + eerror + eerror "Hint: use sys-kernel/module-rebuild for keeping track of which" + eerror "modules needs to be remerged after a kernel upgrade." + eerror + die "/lib/modules/${KV_FULL}/net/ieee80211/ieee80211.${KV_OBJ} not found" + fi + + BUILD_PARAMS="KSRC=${KV_DIR} KSRC_OUTPUT=${KV_OUT_DIR} IEEE80211_INC=/usr/include" +} + +src_unpack() { + local debug="n" + + unpack ${A} + + cd ${S} + epatch ${FILESDIR}/${P}-a_txpow.patch + epatch ${FILESDIR}/${P}-channel_change_fw_err.patch + epatch ${FILESDIR}/${P}-dup-without-retry.patch + epatch ${FILESDIR}/${P}-hwcrypt-wpa-fix4.patch + epatch ${FILESDIR}/${P}-ibss-wep.patch + epatch ${FILESDIR}/${P}-init_scan.patch + epatch ${FILESDIR}/${P}-irq_override.patch + epatch ${FILESDIR}/${P}-monitor_wep_fix.patch + epatch ${FILESDIR}/${P}-open_frag.patch + epatch ${FILESDIR}/${P}-pci_link-fix.patch + epatch ${FILESDIR}/${P}-reset-mode-fix.patch + + epatch ${FILESDIR}/${P}-broadcast.patch + kernel_is gt 2 6 12 && epatch ${FILESDIR}/${P}-suspend2.patch + + use debug && debug="y" + sed -i -e "s:^\(CONFIG_IPW_DEBUG\)=.*:\1=${debug}:" ${S}/Makefile +} + +src_compile() { + linux-mod_src_compile + + einfo + einfo "You may safely ignore any errors from above compilation that contain" + einfo "warnings about undefined references to the ieee80211 subsystem." + einfo +} + +src_install() { + linux-mod_src_install + + dodoc CHANGES ISSUES +} + +pkg_postinst() { + linux-mod_pkg_postinst + + if [ -f /lib/modules/${KV_FULL}/net/${PN}.ko ]; then + einfo + einfo "Modules from an earlier installation detected. You will need to manually" + einfo "remove those modules by running the following commands:" + einfo " # rm -f /lib/modules/${KV_FULL}/net/${PN}.ko" + einfo " # rm -f /lib/modules/${KV_FULL}/net/ieee80211*.ko" + einfo " # depmod -a" + einfo + fi +} |