From 55b75f9fcc4bc9be10e5f2ff28f24bad5cd5f5ed Mon Sep 17 00:00:00 2001 From: lxnay Date: Mon, 9 Apr 2007 09:06:20 +0000 Subject: [PATCH] huge cleanup git-svn-id: http://svn.sabayonlinux.org/overlay@1161 d7aec97c-591d-0410-af39-a8856400b30a --- app-docs/sl-docs-3.3.ebuild | 29 - dev-python/pykde/Manifest | 8 - dev-python/pykde/files/digest-pykde-3.16.0 | 3 - dev-python/pykde/pykde-3.16.0.ebuild | 52 - dev-python/python-musicbrainz2/Manifest | 23 - .../files/digest-python-musicbrainz2-0.3.1 | 3 - .../files/digest-python-musicbrainz2-0.4.0 | 3 - .../files/digest-python-musicbrainz2-9999 | 1 - .../python-musicbrainz2-0.3.1.ebuild | 32 - .../python-musicbrainz2-0.4.0.ebuild | 32 - .../python-musicbrainz2-9999.ebuild | 32 - dev-python/rhpl/Manifest | 12 - .../0.188-use-raw-strings-for-gettext.diff | 28 - dev-python/rhpl/files/digest-rhpl-0.188 | 3 - dev-python/rhpl/rhpl-0.188.ebuild | 50 - gnome-extra/evolution-data-server/Manifest | 44 - .../evolution-data-server-1.8.2.ebuild | 142 - .../files/digest-evolution-data-server-1.8.2 | 3 - ...ata-server-1.2.0-gentoo_etc_services.patch | 24 - .../evolution-data-server-1.2.3-gcc4.patch | 13 - ...ta-server-1.4.2.1-calandar-crash-fix.patch | 12 - ...n-data-server-1.7.3-exchange-storage.patch | 30 - .../evolution-data-server-1.7.3-libdb.patch | 13 - ...ution-data-server-1.7.4-move-subdirs.patch | 14 - ...ution-data-server-1.8.0-camel-rewind.patch | 11 - ...tion-data-server-1.8.1-inbox-folders.patch | 21 - ...olution-data-server-no_lazy_bindings.patch | 12 - kde-base/kdebase-kioslaves/Manifest | 17 - .../files/digest-kdebase-kioslaves-3.5.5-r1 | 6 - .../kdebase-kioslaves-3.5.5-floppy.patch | 56 - .../files/kdebase-kioslaves-3.5.5-fstab.patch | 73 - .../kdebase-kioslaves-3.5.5-r1.ebuild | 52 - kde-base/kopete/Manifest | 53 - .../files/configure-fix-kdenetwork-gadu.patch | 89 - .../files/configure-fix-kdenetwork-xmms.patch | 38 - kde-base/kopete/files/digest-kopete-3.5.5-r3 | 6 - kde-base/kopete/files/disable-meanwhile.diff | 11 - .../kopete/files/gnomemeeting-ekiga.patch | 36 - ...denetwork-3.5.5-linux-headers-2.6.18.patch | 24 - .../kopete/files/kopete-0.12.1-icqfix3.patch | 13 - .../kopete-0.12_alpha1-xscreensaver.patch | 25 - .../kopete/files/kopete-3.5.3-icqfix.patch | 24 - .../kopete/files/kopete-3.5.5-icqfix.patch | 12 - .../kopete-3.5.5-status-visibility.patch | 19 - .../files/kopete-3.5.x-oscarcontacts.patch | 132 - kde-base/kopete/kopete-3.5.5-r3.ebuild | 129 - kde-misc/guidance/Manifest | 12 - kde-misc/guidance/files/digest-guidance-0.7.0 | 3 - .../files/guidance-0.7.0-fix-setup.py.patch | 47 - kde-misc/guidance/guidance-0.7.0.ebuild | 118 - kde-misc/kerry/Manifest | 8 - kde-misc/kerry/files/digest-kerry-0.2 | 3 - kde-misc/kerry/kerry-0.2.ebuild | 22 - kde-misc/pykdeextensions/Manifest | 12 - .../files/digest-pykdeextensions-0.4.0 | 3 - .../files/pykdeextensions-gentoo.patch | 43 - .../pykdeextensions-0.4.0.ebuild | 27 - media-libs/alsa-lib/Manifest | 8 - .../alsa-lib/alsa-lib-1.0.14_rc3.ebuild | 70 - .../alsa-lib/files/digest-alsa-lib-1.0.14_rc3 | 3 - media-plugins/alsa-plugins/ChangeLog | 66 - media-plugins/alsa-plugins/Manifest | 46 - .../alsa-plugins/alsa-plugins-1.0.11.ebuild | 55 - .../alsa-plugins/alsa-plugins-1.0.12.ebuild | 67 - .../files/alsa-plugins-1.0.11-automagic.patch | 52 - .../files/alsa-plugins-1.0.12-automagic.patch | 52 - .../alsa-plugins-1.0.12_rc1-automagic.patch | 52 - .../files/digest-alsa-plugins-1.0.11 | 3 - .../files/digest-alsa-plugins-1.0.12 | 3 - media-plugins/alsa-plugins/metadata.xml | 5 - media-sound/alsa-firmware/Manifest | 12 - .../alsa-firmware-1.0.14_rc3.ebuild | 31 - .../alsa-firmware/files/52-usx2yaudio.rules | 7 - .../files/digest-alsa-firmware-1.0.14_rc3 | 3 - media-sound/alsa-headers/Manifest | 12 - .../alsa-headers-1.0.14_rc3.ebuild | 44 - .../files/alsa-headers-1.0.6a-user.patch | 14 - .../files/digest-alsa-headers-1.0.14_rc3 | 3 - media-sound/alsa-tools/Manifest | 12 - .../alsa-tools/alsa-tools-1.0.14_rc3.ebuild | 106 - .../files/alsa-tools-1.0.11-asneeded.patch | 36 - .../files/digest-alsa-tools-1.0.14_rc3 | 3 - net-dialup/bewan-adsl/Manifest | 13 - .../bewan-adsl/bewan-adsl-0.9.3-r3.ebuild | 107 - .../bewan-adsl/files/bewan-adsl-2.6.19.patch | 78 - .../files/digest-bewan-adsl-0.9.3-r3 | 6 - net-dialup/ltmodem/Manifest | 29 - net-dialup/ltmodem/files/2.6.18-devfs.patch | 13 - .../ltmodem/files/2.6.19-config.h.patch | 18 - .../files/digest-ltmodem-8.31_alpha10-r5 | 6 - .../ltmodem-2.6-alk-8-module_param.patch | 21 - net-dialup/ltmodem/files/ltmodem_devfs | 5 - net-dialup/ltmodem/files/ltmodem_udev | 5 - .../ltmodem/ltmodem-8.31_alpha10-r5.ebuild | 146 - net-misc/r1000/Manifest | 8 - net-misc/r1000/files/digest-r1000-1.04 | 3 - net-misc/r1000/r1000-1.04.ebuild | 75 - sci-biology/copasi/Manifest | 12 - sci-biology/copasi/copasi-4.0.18.ebuild | 42 - sci-biology/copasi/files/digest-copasi-4.0.18 | 3 - sci-biology/xppaut/Manifest | 12 - sci-biology/xppaut/files/digest-xppaut-5.96 | 3 - sci-biology/xppaut/xppaut-5.96.ebuild | 33 - sci-misc/emboss-kaptain/Manifest | 8 - .../emboss-kaptain-0.97-r2.ebuild | 84 - .../files/digest-emboss-kaptain-0.97-r2 | 3 - sys-apps/baselayout/Manifest | 8 - sys-apps/baselayout/baselayout-1.12.6.ebuild | 616 - .../baselayout/files/digest-baselayout-1.12.6 | 3 - sys-apps/einit/Manifest | 38 - sys-apps/einit/einit-0.14.0.500-r1.ebuild | 63 - sys-apps/einit/einit-0.14.0.500.ebuild | 60 - sys-apps/einit/einit-0.15.2.ebuild | 63 - sys-apps/einit/einit-0.16.0.ebuild | 63 - sys-apps/einit/einit-9999.ebuild | 47 - sys-apps/einit/files/digest-einit-0.14.0.500 | 3 - .../einit/files/digest-einit-0.14.0.500-r1 | 3 - sys-apps/einit/files/digest-einit-0.15.2 | 3 - sys-apps/einit/files/digest-einit-0.16 | 1 - sys-apps/einit/files/digest-einit-0.16.0 | 3 - sys-apps/einit/files/digest-einit-9999 | 1 - sys-fs/cryptsetup-luks/Manifest | 32 - .../cryptsetup-luks-1.0.4-r2.ebuild | 93 - .../cryptsetup-luks/files/1.0.3-cryptfs.confd | 88 - .../files/1.0.3-dm-crypt-start.sh | 236 - .../files/1.0.3-dm-crypt-stop.sh | 40 - sys-fs/cryptsetup-luks/files/cryptfs.confd | 42 - .../files/digest-cryptsetup-luks-1.0.4-r2 | 3 - .../cryptsetup-luks/files/dm-crypt-start.sh | 152 - sys-fs/cryptsetup-luks/files/dm-crypt-stop.sh | 51 - sys-fs/ntfs-policy/Manifest | 11 - sys-fs/ntfs-policy/files/99-ntfs-policy.fdi | 19 - .../ntfs-policy/files/digest-ntfs-policy-1.1 | 1 - sys-fs/ntfs-policy/ntfs-policy-1.1.ebuild | 41 - sys-fs/udftool/Manifest | 23 - sys-fs/udftool/files/digest-udftool-0.1 | 3 - sys-fs/udftool/files/digest-udftool-1.0 | 3 - sys-fs/udftool/udftool-0.1.ebuild | 34 - sys-fs/udftool/udftool-1.0.ebuild | 35 - sys-fs/unionfs/Manifest | 8 - .../files/digest-unionfs-1.5_pre20061211 | 3 - sys-fs/unionfs/unionfs-1.5_pre20061211.ebuild | 81 - sys-kernel/gentoo-sources/Manifest | 166 - ...on-libata-driver-for-jmicron-devices.patch | 321 - .../files/2.6.18-am2-nvidia-ati.patch | 280 - .../files/2.6.18-am2-nvidia-fix.patch | 67 - .../files/2.6.19-ata-piix-updates.patch | 501 - ....19-bcm43xx-forcedeth-atiixp-support.patch | 413 - .../files/2.6.19-bmdma-fixes.patch | 78 - .../files/2.6.19-kvm-2.6.20_rc4-updates.patch | 3601 --- .../2.6.19-kvm-experimental-support.patch | 11406 -------- .../2.6.19-libata-pata_ali-updates.patch | 207 - .../gentoo-sources/files/2.6.19-mactel.patch | 2334 -- .../files/2.6.19-sis-ide-sata-updates.patch | 94 - .../gentoo-sources/files/2.6.20-mactel.patch | 1162 - .../gentoo-sources/files/ata-early-irq.patch | 48 - .../files/digest-gentoo-sources-2.6.18-r3 | 9 - .../files/digest-gentoo-sources-2.6.18-r4 | 9 - .../files/digest-gentoo-sources-2.6.18-r5 | 9 - .../files/digest-gentoo-sources-2.6.19-r1 | 15 - .../files/digest-gentoo-sources-2.6.19-r2 | 15 - .../files/digest-gentoo-sources-2.6.19-r3 | 15 - .../files/digest-gentoo-sources-2.6.19-r4 | 15 - .../files/digest-gentoo-sources-2.6.19-r5 | 15 - .../files/digest-gentoo-sources-2.6.20_rc5-r2 | 18 - .../files/digest-gentoo-sources-2.6.20_rc6 | 18 - .../gentoo-sources/files/fuse-2.6.1.patch | 710 - ...o-sources-2.6.20_rc5-kvm-compile-fix.patch | 20 - .../files/ipw3945-1.1.3_pre2-2.6.18.patch | 21620 ---------------- .../gentoo-sources/files/patch-2.6.18.2-3 | 834 - .../gentoo-sources/files/patch-2.6.18.3-4 | 22 - ...ta_promise-2037x-pata-2.6.19-support.patch | 128 - .../files/toshiba-bluetooth.patch | 238 - .../gentoo-sources-2.6.18-r3.ebuild | 52 - .../gentoo-sources-2.6.18-r4.ebuild | 55 - .../gentoo-sources-2.6.18-r5.ebuild | 60 - .../gentoo-sources-2.6.19-r1.ebuild | 32 - .../gentoo-sources-2.6.19-r2.ebuild | 32 - .../gentoo-sources-2.6.19-r3.ebuild | 35 - .../gentoo-sources-2.6.19-r4.ebuild | 47 - .../gentoo-sources-2.6.19-r5.ebuild | 49 - .../gentoo-sources-2.6.20_rc5-r2.ebuild | 39 - .../gentoo-sources-2.6.20_rc6.ebuild | 39 - x11-libs/qt/Manifest | 96 - x11-libs/qt/files/0001-dnd_optimization.patch | 187 - .../qt/files/0002-dnd_active_window_fix.patch | 189 - .../qt/files/0037-dnd-timestamp-fix.patch | 56 - .../0038-dragobject-dont-prefer-unknown.patch | 57 - .../0044-qscrollview-windowactivate-fix.diff | 38 - x11-libs/qt/files/0047-fix-kmenu-widget.diff | 25 - .../qt/files/0048-qclipboard_hack_80072.patch | 48 - x11-libs/qt/files/digest-qt-3.3.6-r1 | 9 - x11-libs/qt/files/digest-qt-3.3.6-r3 | 9 - x11-libs/qt/files/digest-qt-3.3.6-r4 | 9 - x11-libs/qt/files/digest-qt-3.3.6-r5 | 9 - x11-libs/qt/files/qt-3.3.5-macos.patch | 450 - x11-libs/qt/files/qt-3.3.5-pertty.patch | 399 - x11-libs/qt/files/qt-3.3.5-uic-fix.patch | 18 - .../qt/files/qt-3.3.6-CVE-2006-4811-bis.patch | 140 - .../qt/files/qt-3.3.6-CVE-2006-4811.patch | 27 - .../qt/files/qt-3.3.6-seli-xinerama.patch | 49 - x11-libs/qt/files/qt-3.3.6-uic-fix.patch | 18 - x11-libs/qt/files/qt-3.3.6-visibility.patch | 159 - x11-libs/qt/files/qt-ulibc.patch | 13 - x11-libs/qt/files/qt-visibility.patch | 159 - x11-libs/qt/files/qt-visibility2.patch | 172 - x11-libs/qt/qt-3.3.6-r3.ebuild | 383 - x11-libs/qt/qt-3.3.6-r4.ebuild | 385 - x11-libs/qt/qt-3.3.6-r5.ebuild | 393 - x11-misc/avant-window-navigator/Manifest | 8 - .../avant-window-navigator-0.1.1-r2.ebuild | 43 - .../digest-avant-window-navigator-0.1.1-r2 | 3 - x11-misc/beryl-manager/Manifest | 48 - .../beryl-manager-0.1.3-r1.ebuild | 28 - .../beryl-manager/beryl-manager-0.1.4.ebuild | 49 - .../beryl-manager-0.1.99.2.ebuild | 49 - .../beryl-manager-0.1.9999.1.ebuild | 49 - .../beryl-manager-0.1.9999.2.ebuild | 49 - .../beryl-manager/beryl-manager-0.2.0.ebuild | 50 - .../files/digest-beryl-manager-0.1.3-r1 | 3 - .../files/digest-beryl-manager-0.1.4 | 3 - .../files/digest-beryl-manager-0.1.99.2 | 3 - .../files/digest-beryl-manager-0.1.9999.1 | 3 - .../files/digest-beryl-manager-0.1.9999.2 | 3 - .../files/digest-beryl-manager-0.2.0 | 3 - x11-misc/beryl-settings-bindings/Manifest | 32 - .../beryl-settings-bindings-0.1.99.2.ebuild | 24 - .../beryl-settings-bindings-0.1.9999.1.ebuild | 24 - .../beryl-settings-bindings-0.1.9999.2.ebuild | 24 - .../beryl-settings-bindings-0.2.0.ebuild | 25 - .../digest-beryl-settings-bindings-0.1.99.2 | 3 - .../digest-beryl-settings-bindings-0.1.9999.1 | 3 - .../digest-beryl-settings-bindings-0.1.9999.2 | 3 - .../digest-beryl-settings-bindings-0.2.0 | 3 - x11-misc/beryl-settings-simple/Manifest | 16 - .../beryl-settings-simple-0.1.9999.2.ebuild | 30 - .../beryl-settings-simple-0.2.0.ebuild | 32 - .../digest-beryl-settings-simple-0.1.9999.2 | 3 - .../files/digest-beryl-settings-simple-0.2.0 | 3 - x11-misc/beryl-settings/Manifest | 48 - .../beryl-settings-0.1.3-r1.ebuild | 25 - .../beryl-settings-0.1.4.ebuild | 55 - .../beryl-settings-0.1.99.2.ebuild | 57 - .../beryl-settings-0.1.9999.1.ebuild | 57 - .../beryl-settings-0.1.9999.2.ebuild | 58 - .../beryl-settings-0.2.0.ebuild | 59 - .../files/digest-beryl-settings-0.1.3-r1 | 3 - .../files/digest-beryl-settings-0.1.4 | 3 - .../files/digest-beryl-settings-0.1.99.2 | 3 - .../files/digest-beryl-settings-0.1.9999.1 | 3 - .../files/digest-beryl-settings-0.1.9999.2 | 3 - .../files/digest-beryl-settings-0.2.0 | 3 - x11-misc/hwdb-client/Manifest | 23 - .../hwdb-client/files/digest-hwdb-client-0.6 | 3 - .../hwdb-client/files/digest-hwdb-client-9999 | 0 x11-misc/hwdb-client/files/sabayon-install.py | 43 - x11-misc/hwdb-client/hwdb-client-0.6.ebuild | 55 - x11-misc/hwdb-client/hwdb-client-9999.ebuild | 61 - x11-misc/pyXgl/Manifest | 12 - x11-misc/pyXgl/files/digest-pyXgl-0.1-r1 | 3 - x11-misc/pyXgl/pyXgl-0.1-r1.ebuild | 49 - x11-misc/wxXgl/Manifest | 12 - x11-misc/wxXgl/files/digest-wxXgl-0.1-r1 | 3 - x11-misc/wxXgl/wxXgl-0.1-r1.ebuild | 50 - x11-misc/xglswitch/Manifest | 24 - x11-misc/xglswitch/files/digest-xglswitch-1.0 | 3 - x11-misc/xglswitch/files/digest-xglswitch-1.1 | 3 - x11-misc/xglswitch/xglswitch-1.0.ebuild | 44 - x11-misc/xglswitch/xglswitch-1.1.ebuild | 44 - .../beryl-plugins-unsupported/Manifest | 24 - ...eryl-plugins-unsupported-0.1.9999.1.ebuild | 39 - ...eryl-plugins-unsupported-0.1.9999.2.ebuild | 35 - .../beryl-plugins-unsupported-0.2.0.ebuild | 35 - ...igest-beryl-plugins-unsupported-0.1.9999.1 | 3 - ...igest-beryl-plugins-unsupported-0.1.9999.2 | 3 - .../digest-beryl-plugins-unsupported-0.2.0 | 3 - x11-plugins/beryl-plugins-vidcap/Manifest | 16 - .../beryl-plugins-vidcap-0.1.9999.1.ebuild | 16 - .../beryl-plugins-vidcap-0.1.9999.2.ebuild | 37 - .../digest-beryl-plugins-vidcap-0.1.9999.1 | 3 - .../digest-beryl-plugins-vidcap-0.1.9999.2 | 3 - x11-plugins/beryl-plugins/Manifest | 55 - .../beryl-plugins-0.1.3-r1.ebuild | 32 - .../beryl-plugins/beryl-plugins-0.1.4.ebuild | 50 - .../beryl-plugins-0.1.99.2.ebuild | 48 - .../beryl-plugins-0.1.9999.1-r1.ebuild | 48 - .../beryl-plugins-0.1.9999.1.ebuild | 48 - .../beryl-plugins-0.1.9999.2.ebuild | 48 - .../beryl-plugins/beryl-plugins-0.2.0.ebuild | 49 - .../files/digest-beryl-plugins-0.1.3-r1 | 3 - .../files/digest-beryl-plugins-0.1.4 | 3 - .../files/digest-beryl-plugins-0.1.99.2 | 3 - .../files/digest-beryl-plugins-0.1.9999.1 | 3 - .../files/digest-beryl-plugins-0.1.9999.1-r1 | 3 - .../files/digest-beryl-plugins-0.1.9999.2 | 3 - .../files/digest-beryl-plugins-0.2.0 | 3 - x11-themes/emerald-themes/Manifest | 48 - .../emerald-themes-0.1.3.ebuild | 25 - .../emerald-themes-0.1.4.ebuild | 25 - .../emerald-themes-0.1.99.2.ebuild | 25 - .../emerald-themes-0.1.9999.1.ebuild | 25 - .../emerald-themes-0.1.9999.2.ebuild | 31 - .../emerald-themes-0.2.0.ebuild | 31 - .../files/digest-emerald-themes-0.1.3 | 3 - .../files/digest-emerald-themes-0.1.4 | 3 - .../files/digest-emerald-themes-0.1.99.2 | 3 - .../files/digest-emerald-themes-0.1.9999.1 | 3 - .../files/digest-emerald-themes-0.1.9999.2 | 3 - .../files/digest-emerald-themes-0.2.0 | 3 - x11-wm/aquamarine/Manifest | 40 - x11-wm/aquamarine/aquamarine-0.1.4.ebuild | 19 - x11-wm/aquamarine/aquamarine-0.1.99.2.ebuild | 19 - .../aquamarine/aquamarine-0.1.9999.1.ebuild | 19 - .../aquamarine/aquamarine-0.1.9999.2.ebuild | 19 - x11-wm/aquamarine/aquamarine-0.2.0.ebuild | 19 - .../aquamarine/files/digest-aquamarine-0.1.4 | 3 - .../files/digest-aquamarine-0.1.99.2 | 3 - .../files/digest-aquamarine-0.1.9999.1 | 3 - .../files/digest-aquamarine-0.1.9999.2 | 3 - .../aquamarine/files/digest-aquamarine-0.2.0 | 3 - x11-wm/beryl-core/Manifest | 55 - x11-wm/beryl-core/beryl-core-0.1.3-r1.ebuild | 40 - x11-wm/beryl-core/beryl-core-0.1.4.ebuild | 57 - x11-wm/beryl-core/beryl-core-0.1.99.2.ebuild | 57 - .../beryl-core/beryl-core-0.1.9999.1.ebuild | 57 - .../beryl-core/beryl-core-0.1.9999.2.ebuild | 59 - x11-wm/beryl-core/beryl-core-0.2.0.ebuild | 60 - .../beryl-core/files/beryl-core-gconf.patch | 48 - .../files/digest-beryl-core-0.1.3-r1 | 6 - .../beryl-core/files/digest-beryl-core-0.1.4 | 6 - .../files/digest-beryl-core-0.1.99.2 | 6 - .../files/digest-beryl-core-0.1.9999.1 | 6 - .../files/digest-beryl-core-0.1.9999.2 | 6 - .../beryl-core/files/digest-beryl-core-0.2.0 | 6 - x11-wm/beryl/Manifest | 49 - x11-wm/beryl/beryl-0.1.3-r1.ebuild | 26 - x11-wm/beryl/beryl-0.1.4.ebuild | 33 - x11-wm/beryl/beryl-0.1.99.2.ebuild | 33 - x11-wm/beryl/beryl-0.1.9999.1.ebuild | 32 - x11-wm/beryl/beryl-0.1.9999.2.ebuild | 32 - x11-wm/beryl/beryl-0.2.0-r1.ebuild | 33 - x11-wm/beryl/beryl-0.2.0.ebuild | 32 - x11-wm/beryl/files/digest-beryl-0.1.3-r1 | 0 x11-wm/beryl/files/digest-beryl-0.1.4 | 0 x11-wm/beryl/files/digest-beryl-0.1.99.2 | 0 x11-wm/beryl/files/digest-beryl-0.1.9999.1 | 0 x11-wm/beryl/files/digest-beryl-0.1.9999.2 | 0 x11-wm/beryl/files/digest-beryl-0.2.0 | 0 x11-wm/beryl/files/digest-beryl-0.2.0-r1 | 0 x11-wm/emerald/Manifest | 48 - x11-wm/emerald/emerald-0.1.3-r1.ebuild | 25 - x11-wm/emerald/emerald-0.1.4.ebuild | 46 - x11-wm/emerald/emerald-0.1.99.2.ebuild | 46 - x11-wm/emerald/emerald-0.1.9999.1.ebuild | 46 - x11-wm/emerald/emerald-0.1.9999.2.ebuild | 46 - x11-wm/emerald/emerald-0.2.0.ebuild | 47 - x11-wm/emerald/files/digest-emerald-0.1.3-r1 | 3 - x11-wm/emerald/files/digest-emerald-0.1.4 | 3 - x11-wm/emerald/files/digest-emerald-0.1.99.2 | 3 - .../emerald/files/digest-emerald-0.1.9999.1 | 3 - .../emerald/files/digest-emerald-0.1.9999.2 | 3 - x11-wm/emerald/files/digest-emerald-0.2.0 | 3 - x11-wm/heliodor/Manifest | 40 - x11-wm/heliodor/files/digest-heliodor-0.1.4 | 3 - .../heliodor/files/digest-heliodor-0.1.99.2 | 3 - .../heliodor/files/digest-heliodor-0.1.9999.1 | 3 - .../heliodor/files/digest-heliodor-0.1.9999.2 | 3 - x11-wm/heliodor/files/digest-heliodor-0.2.0 | 3 - x11-wm/heliodor/heliodor-0.1.4.ebuild | 31 - x11-wm/heliodor/heliodor-0.1.99.2.ebuild | 31 - x11-wm/heliodor/heliodor-0.1.9999.1.ebuild | 31 - x11-wm/heliodor/heliodor-0.1.9999.2.ebuild | 31 - x11-wm/heliodor/heliodor-0.2.0.ebuild | 32 - 373 files changed, 57254 deletions(-) delete mode 100644 app-docs/sl-docs-3.3.ebuild delete mode 100644 dev-python/pykde/Manifest delete mode 100644 dev-python/pykde/files/digest-pykde-3.16.0 delete mode 100644 dev-python/pykde/pykde-3.16.0.ebuild delete mode 100644 dev-python/python-musicbrainz2/Manifest delete mode 100644 dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-0.3.1 delete mode 100644 dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-0.4.0 delete mode 100644 dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-9999 delete mode 100644 dev-python/python-musicbrainz2/python-musicbrainz2-0.3.1.ebuild delete mode 100644 dev-python/python-musicbrainz2/python-musicbrainz2-0.4.0.ebuild delete mode 100644 dev-python/python-musicbrainz2/python-musicbrainz2-9999.ebuild delete mode 100644 dev-python/rhpl/Manifest delete mode 100644 dev-python/rhpl/files/0.188-use-raw-strings-for-gettext.diff delete mode 100644 dev-python/rhpl/files/digest-rhpl-0.188 delete mode 100644 dev-python/rhpl/rhpl-0.188.ebuild delete mode 100644 gnome-extra/evolution-data-server/Manifest delete mode 100644 gnome-extra/evolution-data-server/evolution-data-server-1.8.2.ebuild delete mode 100644 gnome-extra/evolution-data-server/files/digest-evolution-data-server-1.8.2 delete mode 100644 gnome-extra/evolution-data-server/files/evolution-data-server-1.2.0-gentoo_etc_services.patch delete mode 100644 gnome-extra/evolution-data-server/files/evolution-data-server-1.2.3-gcc4.patch delete mode 100644 gnome-extra/evolution-data-server/files/evolution-data-server-1.4.2.1-calandar-crash-fix.patch delete mode 100644 gnome-extra/evolution-data-server/files/evolution-data-server-1.7.3-exchange-storage.patch delete mode 100644 gnome-extra/evolution-data-server/files/evolution-data-server-1.7.3-libdb.patch delete mode 100644 gnome-extra/evolution-data-server/files/evolution-data-server-1.7.4-move-subdirs.patch delete mode 100644 gnome-extra/evolution-data-server/files/evolution-data-server-1.8.0-camel-rewind.patch delete mode 100644 gnome-extra/evolution-data-server/files/evolution-data-server-1.8.1-inbox-folders.patch delete mode 100644 gnome-extra/evolution-data-server/files/evolution-data-server-no_lazy_bindings.patch delete mode 100644 kde-base/kdebase-kioslaves/Manifest delete mode 100644 kde-base/kdebase-kioslaves/files/digest-kdebase-kioslaves-3.5.5-r1 delete mode 100644 kde-base/kdebase-kioslaves/files/kdebase-kioslaves-3.5.5-floppy.patch delete mode 100644 kde-base/kdebase-kioslaves/files/kdebase-kioslaves-3.5.5-fstab.patch delete mode 100644 kde-base/kdebase-kioslaves/kdebase-kioslaves-3.5.5-r1.ebuild delete mode 100644 kde-base/kopete/Manifest delete mode 100644 kde-base/kopete/files/configure-fix-kdenetwork-gadu.patch delete mode 100644 kde-base/kopete/files/configure-fix-kdenetwork-xmms.patch delete mode 100644 kde-base/kopete/files/digest-kopete-3.5.5-r3 delete mode 100644 kde-base/kopete/files/disable-meanwhile.diff delete mode 100644 kde-base/kopete/files/gnomemeeting-ekiga.patch delete mode 100644 kde-base/kopete/files/kdenetwork-3.5.5-linux-headers-2.6.18.patch delete mode 100644 kde-base/kopete/files/kopete-0.12.1-icqfix3.patch delete mode 100644 kde-base/kopete/files/kopete-0.12_alpha1-xscreensaver.patch delete mode 100644 kde-base/kopete/files/kopete-3.5.3-icqfix.patch delete mode 100644 kde-base/kopete/files/kopete-3.5.5-icqfix.patch delete mode 100644 kde-base/kopete/files/kopete-3.5.5-status-visibility.patch delete mode 100644 kde-base/kopete/files/kopete-3.5.x-oscarcontacts.patch delete mode 100644 kde-base/kopete/kopete-3.5.5-r3.ebuild delete mode 100644 kde-misc/guidance/Manifest delete mode 100644 kde-misc/guidance/files/digest-guidance-0.7.0 delete mode 100644 kde-misc/guidance/files/guidance-0.7.0-fix-setup.py.patch delete mode 100644 kde-misc/guidance/guidance-0.7.0.ebuild delete mode 100644 kde-misc/kerry/Manifest delete mode 100644 kde-misc/kerry/files/digest-kerry-0.2 delete mode 100644 kde-misc/kerry/kerry-0.2.ebuild delete mode 100644 kde-misc/pykdeextensions/Manifest delete mode 100644 kde-misc/pykdeextensions/files/digest-pykdeextensions-0.4.0 delete mode 100644 kde-misc/pykdeextensions/files/pykdeextensions-gentoo.patch delete mode 100644 kde-misc/pykdeextensions/pykdeextensions-0.4.0.ebuild delete mode 100644 media-libs/alsa-lib/Manifest delete mode 100644 media-libs/alsa-lib/alsa-lib-1.0.14_rc3.ebuild delete mode 100644 media-libs/alsa-lib/files/digest-alsa-lib-1.0.14_rc3 delete mode 100644 media-plugins/alsa-plugins/ChangeLog delete mode 100644 media-plugins/alsa-plugins/Manifest delete mode 100644 media-plugins/alsa-plugins/alsa-plugins-1.0.11.ebuild delete mode 100644 media-plugins/alsa-plugins/alsa-plugins-1.0.12.ebuild delete mode 100644 media-plugins/alsa-plugins/files/alsa-plugins-1.0.11-automagic.patch delete mode 100644 media-plugins/alsa-plugins/files/alsa-plugins-1.0.12-automagic.patch delete mode 100644 media-plugins/alsa-plugins/files/alsa-plugins-1.0.12_rc1-automagic.patch delete mode 100644 media-plugins/alsa-plugins/files/digest-alsa-plugins-1.0.11 delete mode 100644 media-plugins/alsa-plugins/files/digest-alsa-plugins-1.0.12 delete mode 100644 media-plugins/alsa-plugins/metadata.xml delete mode 100644 media-sound/alsa-firmware/Manifest delete mode 100644 media-sound/alsa-firmware/alsa-firmware-1.0.14_rc3.ebuild delete mode 100644 media-sound/alsa-firmware/files/52-usx2yaudio.rules delete mode 100644 media-sound/alsa-firmware/files/digest-alsa-firmware-1.0.14_rc3 delete mode 100644 media-sound/alsa-headers/Manifest delete mode 100644 media-sound/alsa-headers/alsa-headers-1.0.14_rc3.ebuild delete mode 100644 media-sound/alsa-headers/files/alsa-headers-1.0.6a-user.patch delete mode 100644 media-sound/alsa-headers/files/digest-alsa-headers-1.0.14_rc3 delete mode 100644 media-sound/alsa-tools/Manifest delete mode 100644 media-sound/alsa-tools/alsa-tools-1.0.14_rc3.ebuild delete mode 100644 media-sound/alsa-tools/files/alsa-tools-1.0.11-asneeded.patch delete mode 100644 media-sound/alsa-tools/files/digest-alsa-tools-1.0.14_rc3 delete mode 100644 net-dialup/bewan-adsl/Manifest delete mode 100644 net-dialup/bewan-adsl/bewan-adsl-0.9.3-r3.ebuild delete mode 100644 net-dialup/bewan-adsl/files/bewan-adsl-2.6.19.patch delete mode 100644 net-dialup/bewan-adsl/files/digest-bewan-adsl-0.9.3-r3 delete mode 100644 net-dialup/ltmodem/Manifest delete mode 100644 net-dialup/ltmodem/files/2.6.18-devfs.patch delete mode 100644 net-dialup/ltmodem/files/2.6.19-config.h.patch delete mode 100644 net-dialup/ltmodem/files/digest-ltmodem-8.31_alpha10-r5 delete mode 100644 net-dialup/ltmodem/files/ltmodem-2.6-alk-8-module_param.patch delete mode 100644 net-dialup/ltmodem/files/ltmodem_devfs delete mode 100644 net-dialup/ltmodem/files/ltmodem_udev delete mode 100644 net-dialup/ltmodem/ltmodem-8.31_alpha10-r5.ebuild delete mode 100644 net-misc/r1000/Manifest delete mode 100644 net-misc/r1000/files/digest-r1000-1.04 delete mode 100644 net-misc/r1000/r1000-1.04.ebuild delete mode 100644 sci-biology/copasi/Manifest delete mode 100644 sci-biology/copasi/copasi-4.0.18.ebuild delete mode 100644 sci-biology/copasi/files/digest-copasi-4.0.18 delete mode 100644 sci-biology/xppaut/Manifest delete mode 100644 sci-biology/xppaut/files/digest-xppaut-5.96 delete mode 100644 sci-biology/xppaut/xppaut-5.96.ebuild delete mode 100644 sci-misc/emboss-kaptain/Manifest delete mode 100644 sci-misc/emboss-kaptain/emboss-kaptain-0.97-r2.ebuild delete mode 100644 sci-misc/emboss-kaptain/files/digest-emboss-kaptain-0.97-r2 delete mode 100644 sys-apps/baselayout/Manifest delete mode 100644 sys-apps/baselayout/baselayout-1.12.6.ebuild delete mode 100644 sys-apps/baselayout/files/digest-baselayout-1.12.6 delete mode 100644 sys-apps/einit/Manifest delete mode 100644 sys-apps/einit/einit-0.14.0.500-r1.ebuild delete mode 100644 sys-apps/einit/einit-0.14.0.500.ebuild delete mode 100644 sys-apps/einit/einit-0.15.2.ebuild delete mode 100644 sys-apps/einit/einit-0.16.0.ebuild delete mode 100644 sys-apps/einit/einit-9999.ebuild delete mode 100644 sys-apps/einit/files/digest-einit-0.14.0.500 delete mode 100644 sys-apps/einit/files/digest-einit-0.14.0.500-r1 delete mode 100644 sys-apps/einit/files/digest-einit-0.15.2 delete mode 100644 sys-apps/einit/files/digest-einit-0.16 delete mode 100644 sys-apps/einit/files/digest-einit-0.16.0 delete mode 100644 sys-apps/einit/files/digest-einit-9999 delete mode 100644 sys-fs/cryptsetup-luks/Manifest delete mode 100644 sys-fs/cryptsetup-luks/cryptsetup-luks-1.0.4-r2.ebuild delete mode 100644 sys-fs/cryptsetup-luks/files/1.0.3-cryptfs.confd delete mode 100644 sys-fs/cryptsetup-luks/files/1.0.3-dm-crypt-start.sh delete mode 100644 sys-fs/cryptsetup-luks/files/1.0.3-dm-crypt-stop.sh delete mode 100644 sys-fs/cryptsetup-luks/files/cryptfs.confd delete mode 100644 sys-fs/cryptsetup-luks/files/digest-cryptsetup-luks-1.0.4-r2 delete mode 100644 sys-fs/cryptsetup-luks/files/dm-crypt-start.sh delete mode 100644 sys-fs/cryptsetup-luks/files/dm-crypt-stop.sh delete mode 100644 sys-fs/ntfs-policy/Manifest delete mode 100644 sys-fs/ntfs-policy/files/99-ntfs-policy.fdi delete mode 100644 sys-fs/ntfs-policy/files/digest-ntfs-policy-1.1 delete mode 100644 sys-fs/ntfs-policy/ntfs-policy-1.1.ebuild delete mode 100644 sys-fs/udftool/Manifest delete mode 100644 sys-fs/udftool/files/digest-udftool-0.1 delete mode 100644 sys-fs/udftool/files/digest-udftool-1.0 delete mode 100644 sys-fs/udftool/udftool-0.1.ebuild delete mode 100644 sys-fs/udftool/udftool-1.0.ebuild delete mode 100644 sys-fs/unionfs/Manifest delete mode 100644 sys-fs/unionfs/files/digest-unionfs-1.5_pre20061211 delete mode 100644 sys-fs/unionfs/unionfs-1.5_pre20061211.ebuild delete mode 100644 sys-kernel/gentoo-sources/Manifest delete mode 100644 sys-kernel/gentoo-sources/files/09-non-libata-driver-for-jmicron-devices.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.18-am2-nvidia-ati.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.18-am2-nvidia-fix.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.19-ata-piix-updates.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.19-bcm43xx-forcedeth-atiixp-support.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.19-bmdma-fixes.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.19-kvm-2.6.20_rc4-updates.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.19-kvm-experimental-support.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.19-libata-pata_ali-updates.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.19-mactel.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.19-sis-ide-sata-updates.patch delete mode 100644 sys-kernel/gentoo-sources/files/2.6.20-mactel.patch delete mode 100644 sys-kernel/gentoo-sources/files/ata-early-irq.patch delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r3 delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r4 delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r5 delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r1 delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r2 delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r3 delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r4 delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r5 delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.20_rc5-r2 delete mode 100644 sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.20_rc6 delete mode 100644 sys-kernel/gentoo-sources/files/fuse-2.6.1.patch delete mode 100644 sys-kernel/gentoo-sources/files/gentoo-sources-2.6.20_rc5-kvm-compile-fix.patch delete mode 100644 sys-kernel/gentoo-sources/files/ipw3945-1.1.3_pre2-2.6.18.patch delete mode 100644 sys-kernel/gentoo-sources/files/patch-2.6.18.2-3 delete mode 100644 sys-kernel/gentoo-sources/files/patch-2.6.18.3-4 delete mode 100644 sys-kernel/gentoo-sources/files/sata_promise-2037x-pata-2.6.19-support.patch delete mode 100644 sys-kernel/gentoo-sources/files/toshiba-bluetooth.patch delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r3.ebuild delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r4.ebuild delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r5.ebuild delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r1.ebuild delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r2.ebuild delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r3.ebuild delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r4.ebuild delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r5.ebuild delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.20_rc5-r2.ebuild delete mode 100644 sys-kernel/gentoo-sources/gentoo-sources-2.6.20_rc6.ebuild delete mode 100644 x11-libs/qt/Manifest delete mode 100644 x11-libs/qt/files/0001-dnd_optimization.patch delete mode 100644 x11-libs/qt/files/0002-dnd_active_window_fix.patch delete mode 100644 x11-libs/qt/files/0037-dnd-timestamp-fix.patch delete mode 100644 x11-libs/qt/files/0038-dragobject-dont-prefer-unknown.patch delete mode 100644 x11-libs/qt/files/0044-qscrollview-windowactivate-fix.diff delete mode 100644 x11-libs/qt/files/0047-fix-kmenu-widget.diff delete mode 100644 x11-libs/qt/files/0048-qclipboard_hack_80072.patch delete mode 100644 x11-libs/qt/files/digest-qt-3.3.6-r1 delete mode 100644 x11-libs/qt/files/digest-qt-3.3.6-r3 delete mode 100644 x11-libs/qt/files/digest-qt-3.3.6-r4 delete mode 100644 x11-libs/qt/files/digest-qt-3.3.6-r5 delete mode 100644 x11-libs/qt/files/qt-3.3.5-macos.patch delete mode 100644 x11-libs/qt/files/qt-3.3.5-pertty.patch delete mode 100644 x11-libs/qt/files/qt-3.3.5-uic-fix.patch delete mode 100644 x11-libs/qt/files/qt-3.3.6-CVE-2006-4811-bis.patch delete mode 100644 x11-libs/qt/files/qt-3.3.6-CVE-2006-4811.patch delete mode 100644 x11-libs/qt/files/qt-3.3.6-seli-xinerama.patch delete mode 100644 x11-libs/qt/files/qt-3.3.6-uic-fix.patch delete mode 100644 x11-libs/qt/files/qt-3.3.6-visibility.patch delete mode 100644 x11-libs/qt/files/qt-ulibc.patch delete mode 100644 x11-libs/qt/files/qt-visibility.patch delete mode 100644 x11-libs/qt/files/qt-visibility2.patch delete mode 100644 x11-libs/qt/qt-3.3.6-r3.ebuild delete mode 100644 x11-libs/qt/qt-3.3.6-r4.ebuild delete mode 100644 x11-libs/qt/qt-3.3.6-r5.ebuild delete mode 100644 x11-misc/avant-window-navigator/Manifest delete mode 100644 x11-misc/avant-window-navigator/avant-window-navigator-0.1.1-r2.ebuild delete mode 100644 x11-misc/avant-window-navigator/files/digest-avant-window-navigator-0.1.1-r2 delete mode 100644 x11-misc/beryl-manager/Manifest delete mode 100644 x11-misc/beryl-manager/beryl-manager-0.1.3-r1.ebuild delete mode 100644 x11-misc/beryl-manager/beryl-manager-0.1.4.ebuild delete mode 100644 x11-misc/beryl-manager/beryl-manager-0.1.99.2.ebuild delete mode 100644 x11-misc/beryl-manager/beryl-manager-0.1.9999.1.ebuild delete mode 100644 x11-misc/beryl-manager/beryl-manager-0.1.9999.2.ebuild delete mode 100644 x11-misc/beryl-manager/beryl-manager-0.2.0.ebuild delete mode 100644 x11-misc/beryl-manager/files/digest-beryl-manager-0.1.3-r1 delete mode 100644 x11-misc/beryl-manager/files/digest-beryl-manager-0.1.4 delete mode 100644 x11-misc/beryl-manager/files/digest-beryl-manager-0.1.99.2 delete mode 100644 x11-misc/beryl-manager/files/digest-beryl-manager-0.1.9999.1 delete mode 100644 x11-misc/beryl-manager/files/digest-beryl-manager-0.1.9999.2 delete mode 100644 x11-misc/beryl-manager/files/digest-beryl-manager-0.2.0 delete mode 100644 x11-misc/beryl-settings-bindings/Manifest delete mode 100644 x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.99.2.ebuild delete mode 100644 x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.9999.1.ebuild delete mode 100644 x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.9999.2.ebuild delete mode 100644 x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.2.0.ebuild delete mode 100644 x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.99.2 delete mode 100644 x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.9999.1 delete mode 100644 x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.9999.2 delete mode 100644 x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.2.0 delete mode 100644 x11-misc/beryl-settings-simple/Manifest delete mode 100644 x11-misc/beryl-settings-simple/beryl-settings-simple-0.1.9999.2.ebuild delete mode 100644 x11-misc/beryl-settings-simple/beryl-settings-simple-0.2.0.ebuild delete mode 100644 x11-misc/beryl-settings-simple/files/digest-beryl-settings-simple-0.1.9999.2 delete mode 100644 x11-misc/beryl-settings-simple/files/digest-beryl-settings-simple-0.2.0 delete mode 100644 x11-misc/beryl-settings/Manifest delete mode 100644 x11-misc/beryl-settings/beryl-settings-0.1.3-r1.ebuild delete mode 100644 x11-misc/beryl-settings/beryl-settings-0.1.4.ebuild delete mode 100644 x11-misc/beryl-settings/beryl-settings-0.1.99.2.ebuild delete mode 100644 x11-misc/beryl-settings/beryl-settings-0.1.9999.1.ebuild delete mode 100644 x11-misc/beryl-settings/beryl-settings-0.1.9999.2.ebuild delete mode 100644 x11-misc/beryl-settings/beryl-settings-0.2.0.ebuild delete mode 100644 x11-misc/beryl-settings/files/digest-beryl-settings-0.1.3-r1 delete mode 100644 x11-misc/beryl-settings/files/digest-beryl-settings-0.1.4 delete mode 100644 x11-misc/beryl-settings/files/digest-beryl-settings-0.1.99.2 delete mode 100644 x11-misc/beryl-settings/files/digest-beryl-settings-0.1.9999.1 delete mode 100644 x11-misc/beryl-settings/files/digest-beryl-settings-0.1.9999.2 delete mode 100644 x11-misc/beryl-settings/files/digest-beryl-settings-0.2.0 delete mode 100644 x11-misc/hwdb-client/Manifest delete mode 100644 x11-misc/hwdb-client/files/digest-hwdb-client-0.6 delete mode 100644 x11-misc/hwdb-client/files/digest-hwdb-client-9999 delete mode 100644 x11-misc/hwdb-client/files/sabayon-install.py delete mode 100644 x11-misc/hwdb-client/hwdb-client-0.6.ebuild delete mode 100644 x11-misc/hwdb-client/hwdb-client-9999.ebuild delete mode 100644 x11-misc/pyXgl/Manifest delete mode 100644 x11-misc/pyXgl/files/digest-pyXgl-0.1-r1 delete mode 100644 x11-misc/pyXgl/pyXgl-0.1-r1.ebuild delete mode 100644 x11-misc/wxXgl/Manifest delete mode 100644 x11-misc/wxXgl/files/digest-wxXgl-0.1-r1 delete mode 100644 x11-misc/wxXgl/wxXgl-0.1-r1.ebuild delete mode 100644 x11-misc/xglswitch/Manifest delete mode 100644 x11-misc/xglswitch/files/digest-xglswitch-1.0 delete mode 100644 x11-misc/xglswitch/files/digest-xglswitch-1.1 delete mode 100644 x11-misc/xglswitch/xglswitch-1.0.ebuild delete mode 100644 x11-misc/xglswitch/xglswitch-1.1.ebuild delete mode 100644 x11-plugins/beryl-plugins-unsupported/Manifest delete mode 100644 x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.1.9999.1.ebuild delete mode 100644 x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.1.9999.2.ebuild delete mode 100644 x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.2.0.ebuild delete mode 100644 x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.1.9999.1 delete mode 100644 x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.1.9999.2 delete mode 100644 x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.2.0 delete mode 100644 x11-plugins/beryl-plugins-vidcap/Manifest delete mode 100644 x11-plugins/beryl-plugins-vidcap/beryl-plugins-vidcap-0.1.9999.1.ebuild delete mode 100644 x11-plugins/beryl-plugins-vidcap/beryl-plugins-vidcap-0.1.9999.2.ebuild delete mode 100644 x11-plugins/beryl-plugins-vidcap/files/digest-beryl-plugins-vidcap-0.1.9999.1 delete mode 100644 x11-plugins/beryl-plugins-vidcap/files/digest-beryl-plugins-vidcap-0.1.9999.2 delete mode 100644 x11-plugins/beryl-plugins/Manifest delete mode 100644 x11-plugins/beryl-plugins/beryl-plugins-0.1.3-r1.ebuild delete mode 100644 x11-plugins/beryl-plugins/beryl-plugins-0.1.4.ebuild delete mode 100644 x11-plugins/beryl-plugins/beryl-plugins-0.1.99.2.ebuild delete mode 100644 x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.1-r1.ebuild delete mode 100644 x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.1.ebuild delete mode 100644 x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.2.ebuild delete mode 100644 x11-plugins/beryl-plugins/beryl-plugins-0.2.0.ebuild delete mode 100644 x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.3-r1 delete mode 100644 x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.4 delete mode 100644 x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.99.2 delete mode 100644 x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.1 delete mode 100644 x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.1-r1 delete mode 100644 x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.2 delete mode 100644 x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.2.0 delete mode 100644 x11-themes/emerald-themes/Manifest delete mode 100644 x11-themes/emerald-themes/emerald-themes-0.1.3.ebuild delete mode 100644 x11-themes/emerald-themes/emerald-themes-0.1.4.ebuild delete mode 100644 x11-themes/emerald-themes/emerald-themes-0.1.99.2.ebuild delete mode 100644 x11-themes/emerald-themes/emerald-themes-0.1.9999.1.ebuild delete mode 100644 x11-themes/emerald-themes/emerald-themes-0.1.9999.2.ebuild delete mode 100644 x11-themes/emerald-themes/emerald-themes-0.2.0.ebuild delete mode 100644 x11-themes/emerald-themes/files/digest-emerald-themes-0.1.3 delete mode 100644 x11-themes/emerald-themes/files/digest-emerald-themes-0.1.4 delete mode 100644 x11-themes/emerald-themes/files/digest-emerald-themes-0.1.99.2 delete mode 100644 x11-themes/emerald-themes/files/digest-emerald-themes-0.1.9999.1 delete mode 100644 x11-themes/emerald-themes/files/digest-emerald-themes-0.1.9999.2 delete mode 100644 x11-themes/emerald-themes/files/digest-emerald-themes-0.2.0 delete mode 100644 x11-wm/aquamarine/Manifest delete mode 100644 x11-wm/aquamarine/aquamarine-0.1.4.ebuild delete mode 100644 x11-wm/aquamarine/aquamarine-0.1.99.2.ebuild delete mode 100644 x11-wm/aquamarine/aquamarine-0.1.9999.1.ebuild delete mode 100644 x11-wm/aquamarine/aquamarine-0.1.9999.2.ebuild delete mode 100644 x11-wm/aquamarine/aquamarine-0.2.0.ebuild delete mode 100644 x11-wm/aquamarine/files/digest-aquamarine-0.1.4 delete mode 100644 x11-wm/aquamarine/files/digest-aquamarine-0.1.99.2 delete mode 100644 x11-wm/aquamarine/files/digest-aquamarine-0.1.9999.1 delete mode 100644 x11-wm/aquamarine/files/digest-aquamarine-0.1.9999.2 delete mode 100644 x11-wm/aquamarine/files/digest-aquamarine-0.2.0 delete mode 100644 x11-wm/beryl-core/Manifest delete mode 100644 x11-wm/beryl-core/beryl-core-0.1.3-r1.ebuild delete mode 100644 x11-wm/beryl-core/beryl-core-0.1.4.ebuild delete mode 100644 x11-wm/beryl-core/beryl-core-0.1.99.2.ebuild delete mode 100644 x11-wm/beryl-core/beryl-core-0.1.9999.1.ebuild delete mode 100644 x11-wm/beryl-core/beryl-core-0.1.9999.2.ebuild delete mode 100644 x11-wm/beryl-core/beryl-core-0.2.0.ebuild delete mode 100644 x11-wm/beryl-core/files/beryl-core-gconf.patch delete mode 100644 x11-wm/beryl-core/files/digest-beryl-core-0.1.3-r1 delete mode 100644 x11-wm/beryl-core/files/digest-beryl-core-0.1.4 delete mode 100644 x11-wm/beryl-core/files/digest-beryl-core-0.1.99.2 delete mode 100644 x11-wm/beryl-core/files/digest-beryl-core-0.1.9999.1 delete mode 100644 x11-wm/beryl-core/files/digest-beryl-core-0.1.9999.2 delete mode 100644 x11-wm/beryl-core/files/digest-beryl-core-0.2.0 delete mode 100644 x11-wm/beryl/Manifest delete mode 100644 x11-wm/beryl/beryl-0.1.3-r1.ebuild delete mode 100644 x11-wm/beryl/beryl-0.1.4.ebuild delete mode 100644 x11-wm/beryl/beryl-0.1.99.2.ebuild delete mode 100644 x11-wm/beryl/beryl-0.1.9999.1.ebuild delete mode 100644 x11-wm/beryl/beryl-0.1.9999.2.ebuild delete mode 100644 x11-wm/beryl/beryl-0.2.0-r1.ebuild delete mode 100644 x11-wm/beryl/beryl-0.2.0.ebuild delete mode 100644 x11-wm/beryl/files/digest-beryl-0.1.3-r1 delete mode 100644 x11-wm/beryl/files/digest-beryl-0.1.4 delete mode 100644 x11-wm/beryl/files/digest-beryl-0.1.99.2 delete mode 100644 x11-wm/beryl/files/digest-beryl-0.1.9999.1 delete mode 100644 x11-wm/beryl/files/digest-beryl-0.1.9999.2 delete mode 100644 x11-wm/beryl/files/digest-beryl-0.2.0 delete mode 100644 x11-wm/beryl/files/digest-beryl-0.2.0-r1 delete mode 100644 x11-wm/emerald/Manifest delete mode 100644 x11-wm/emerald/emerald-0.1.3-r1.ebuild delete mode 100644 x11-wm/emerald/emerald-0.1.4.ebuild delete mode 100644 x11-wm/emerald/emerald-0.1.99.2.ebuild delete mode 100644 x11-wm/emerald/emerald-0.1.9999.1.ebuild delete mode 100644 x11-wm/emerald/emerald-0.1.9999.2.ebuild delete mode 100644 x11-wm/emerald/emerald-0.2.0.ebuild delete mode 100644 x11-wm/emerald/files/digest-emerald-0.1.3-r1 delete mode 100644 x11-wm/emerald/files/digest-emerald-0.1.4 delete mode 100644 x11-wm/emerald/files/digest-emerald-0.1.99.2 delete mode 100644 x11-wm/emerald/files/digest-emerald-0.1.9999.1 delete mode 100644 x11-wm/emerald/files/digest-emerald-0.1.9999.2 delete mode 100644 x11-wm/emerald/files/digest-emerald-0.2.0 delete mode 100644 x11-wm/heliodor/Manifest delete mode 100644 x11-wm/heliodor/files/digest-heliodor-0.1.4 delete mode 100644 x11-wm/heliodor/files/digest-heliodor-0.1.99.2 delete mode 100644 x11-wm/heliodor/files/digest-heliodor-0.1.9999.1 delete mode 100644 x11-wm/heliodor/files/digest-heliodor-0.1.9999.2 delete mode 100644 x11-wm/heliodor/files/digest-heliodor-0.2.0 delete mode 100644 x11-wm/heliodor/heliodor-0.1.4.ebuild delete mode 100644 x11-wm/heliodor/heliodor-0.1.99.2.ebuild delete mode 100644 x11-wm/heliodor/heliodor-0.1.9999.1.ebuild delete mode 100644 x11-wm/heliodor/heliodor-0.1.9999.2.ebuild delete mode 100644 x11-wm/heliodor/heliodor-0.2.0.ebuild diff --git a/app-docs/sl-docs-3.3.ebuild b/app-docs/sl-docs-3.3.ebuild deleted file mode 100644 index a27b70df3..000000000 --- a/app-docs/sl-docs-3.3.ebuild +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit autotools - -DESCRIPTION="Doc files stripped from SabayonLinux DVD/CD" -HOMEPAGE="http://sabayonlinux.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc" -IUSE="" - -src_unpack() { - einfo "This may take awhile" -} - -src_compile() { - einfo "Nothing to compile, just moving packages" -} - -src_install() { - einfo "Moving files .... may take awhile again" - doinsinto /usr/share/man - doins ${S}/* /usr/share/man - einfo "Done installing man and doc pages" -} \ No newline at end of file diff --git a/dev-python/pykde/Manifest b/dev-python/pykde/Manifest deleted file mode 100644 index 30e16f1ee..000000000 --- a/dev-python/pykde/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -DIST PyKDE-3.16.0.tar.gz 1618988 RMD160 ecc7d55f92a8b5360e0f2e2616a2b7a6ba5f4819 SHA1 d4b6969e254f05e05ec7d8f3095a712afaac8189 SHA256 a2206d3e98a2c97bf7352f4e125f6369aedbaac2d8d8278a24ccb1b0e4e772a0 -EBUILD pykde-3.16.0.ebuild 1451 RMD160 334ef12182716b30e6428c6b2a644f7380877d39 SHA1 0633c734db9a54015ae30bd90f3eca8cb88a7327 SHA256 9ae6b43bc4f3911f777c1730daf9493a9c497d77b8ce66d05cd315e12f88571e -MD5 3c60b3292ea36c20233ab65657ac78ce pykde-3.16.0.ebuild 1451 -RMD160 334ef12182716b30e6428c6b2a644f7380877d39 pykde-3.16.0.ebuild 1451 -SHA256 9ae6b43bc4f3911f777c1730daf9493a9c497d77b8ce66d05cd315e12f88571e pykde-3.16.0.ebuild 1451 -MD5 144a26f79b26c575843b3b65d4ec49d7 files/digest-pykde-3.16.0 241 -RMD160 17a879734e747ffc36e76e71e67ae3fce76dbd7f files/digest-pykde-3.16.0 241 -SHA256 9ca83845fa040c965346cf2cb0c93823a4297abdaf465255464d4cc73de8dd07 files/digest-pykde-3.16.0 241 diff --git a/dev-python/pykde/files/digest-pykde-3.16.0 b/dev-python/pykde/files/digest-pykde-3.16.0 deleted file mode 100644 index 329f7517c..000000000 --- a/dev-python/pykde/files/digest-pykde-3.16.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 92fa0f7d6063dc2aad97d5302975ca76 PyKDE-3.16.0.tar.gz 1618988 -RMD160 ecc7d55f92a8b5360e0f2e2616a2b7a6ba5f4819 PyKDE-3.16.0.tar.gz 1618988 -SHA256 a2206d3e98a2c97bf7352f4e125f6369aedbaac2d8d8278a24ccb1b0e4e772a0 PyKDE-3.16.0.tar.gz 1618988 diff --git a/dev-python/pykde/pykde-3.16.0.ebuild b/dev-python/pykde/pykde-3.16.0.ebuild deleted file mode 100644 index 7bde2c5a4..000000000 --- a/dev-python/pykde/pykde-3.16.0.ebuild +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pykde/pykde-3.16.0.ebuild,v 1.1 2006/10/22 15:40:05 carlo Exp $ - -inherit eutils distutils - -MY_P="PyKDE-${PV/*_pre/snapshot}" -MY_P=${MY_P/_/} -S=${WORKDIR}/${MY_P} - -DESCRIPTION="PyKDE is a set of Python bindings for kdelibs." -HOMEPAGE="http://www.riverbankcomputing.co.uk/pykde/" -SRC_URI="mirror://gentoo/${MY_P}.tar.gz" -#SRC_URI="http://www.riverbankcomputing.com/Downloads/PyKDE3/${MY_P}.tar.gz" - -SLOT="0" -LICENSE="GPL-2" -KEYWORDS="~x86 ~ppc ~amd64" -IUSE="debug doc examples" - -RDEPEND=">=dev-python/sip-4.4.5 - >=dev-python/PyQt-3.16.0 - kde-base/kdelibs - !kde-base/pykde" - -src_compile() { - distutils_python_version - - local myconf="-d ${ROOT}/usr/$(get_libdir)/python${PYVER}/site-packages \ - -v ${ROOT}/usr/share/sip \ - -k $(kde-config --prefix) - -L $(get_libdir)" - - use debug && myconf="${myconf} -u" - - python configure.py ${myconf} - emake || die -} - -src_install() { - dodir /usr/kde/3.5/lib/ - sed -i -e 's:/usr/kde/3.5/lib/libkonsolepart.so:$(DESTDIR)/usr/kde/3.5/lib/libkonsolepart.so:' Makefile - make DESTDIR=${D} install || die -# find ${D}/usr/share/sip -not -type d -not -iname *.sip -exec rm '{}' \; - - dodoc AUTHORS ChangeLog NEWS README THANKS - use doc && dohtml -r doc/* - if use examples ; then - cp -r examples ${D}/usr/share/doc/${PF} - cp -r templates ${D}/usr/share/doc/${PF} - fi -} diff --git a/dev-python/python-musicbrainz2/Manifest b/dev-python/python-musicbrainz2/Manifest deleted file mode 100644 index 4bb254d3e..000000000 --- a/dev-python/python-musicbrainz2/Manifest +++ /dev/null @@ -1,23 +0,0 @@ -DIST python-musicbrainz2-0.3.1.tar.gz 54354 RMD160 c45f9d176e75442ba7104c87539cd0bec12c08d8 SHA1 1165dbc1ca86df5939b418206e6e9e17fcf1dc72 SHA256 02942c7fc753dbf47ad120a53fc188c6b59729dd69485fcf1cdc85b78957817e -DIST python-musicbrainz2-0.4.0.tar.gz 56557 RMD160 f27d83f8be98c38eff5ce8aa8d069fac960c1b78 SHA1 19c5c68190a0b3923788cdafbd18f7296f053d13 SHA256 b69228e9ac6de36a047fcaa8118815cda01fd7c03be24aa251d41a94ce16a8ee -EBUILD python-musicbrainz2-0.3.1.ebuild 695 RMD160 ce4ad6492877cd5eebd1a22e88954042e37cdf06 SHA1 f2fc7411abac744f70e9e84292e6e04498bb3ed1 SHA256 d7a156b9ae871a8e5f564c1d7e7e34b90bac8fcceb11135affe5ebe337e1d4ef -MD5 2abd544f89ed40316fc328936100f32e python-musicbrainz2-0.3.1.ebuild 695 -RMD160 ce4ad6492877cd5eebd1a22e88954042e37cdf06 python-musicbrainz2-0.3.1.ebuild 695 -SHA256 d7a156b9ae871a8e5f564c1d7e7e34b90bac8fcceb11135affe5ebe337e1d4ef python-musicbrainz2-0.3.1.ebuild 695 -EBUILD python-musicbrainz2-0.4.0.ebuild 696 RMD160 cda361fe5ecd29fe0a470d66951ff4fe1944cfa7 SHA1 db7cae62ae1849937dfb9fd293cd2d81798c1662 SHA256 14950ad02a19c39c0c275f6ae8c69cc17cdd6f78da44eac3eada7db7b572c5a7 -MD5 1eb4d1286eabfdb12717f99ea5c423d6 python-musicbrainz2-0.4.0.ebuild 696 -RMD160 cda361fe5ecd29fe0a470d66951ff4fe1944cfa7 python-musicbrainz2-0.4.0.ebuild 696 -SHA256 14950ad02a19c39c0c275f6ae8c69cc17cdd6f78da44eac3eada7db7b572c5a7 python-musicbrainz2-0.4.0.ebuild 696 -EBUILD python-musicbrainz2-9999.ebuild 692 RMD160 5a34f1ac13f924d02e081d2e4a1f78a53c270f31 SHA1 01ede2edad7ebf361681b06afea2cf79b92f7519 SHA256 bfa5269550f6df01c1cd48ae0fbc2fa4e6d86697da13d90e88bcafe4117db524 -MD5 30df0fa07ee1ceaf62815149c429472f python-musicbrainz2-9999.ebuild 692 -RMD160 5a34f1ac13f924d02e081d2e4a1f78a53c270f31 python-musicbrainz2-9999.ebuild 692 -SHA256 bfa5269550f6df01c1cd48ae0fbc2fa4e6d86697da13d90e88bcafe4117db524 python-musicbrainz2-9999.ebuild 692 -MD5 43beeca251ef49233d77f9bc41b19a22 files/digest-python-musicbrainz2-0.3.1 274 -RMD160 78ad92d070164730ec8b777629c2c3cdbdaa302f files/digest-python-musicbrainz2-0.3.1 274 -SHA256 6bada7e6298e68d58276a402a5dcf54d64a316847fb99534248b4fc33b586a58 files/digest-python-musicbrainz2-0.3.1 274 -MD5 94347b6e978f5659cdfc810ae21e4805 files/digest-python-musicbrainz2-0.4.0 274 -RMD160 751e5efedab4b4efe916f78678c826590c30d88e files/digest-python-musicbrainz2-0.4.0 274 -SHA256 cc13d36b0077d30af1a24e20142060b19f5f1221d65ee6c0c077cb6ce392141e files/digest-python-musicbrainz2-0.4.0 274 -MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-python-musicbrainz2-9999 1 -RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-python-musicbrainz2-9999 1 -SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-python-musicbrainz2-9999 1 diff --git a/dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-0.3.1 b/dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-0.3.1 deleted file mode 100644 index b9a355ed4..000000000 --- a/dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-0.3.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 2ff59193f357c84e9e7b2f89356c0939 python-musicbrainz2-0.3.1.tar.gz 54354 -RMD160 c45f9d176e75442ba7104c87539cd0bec12c08d8 python-musicbrainz2-0.3.1.tar.gz 54354 -SHA256 02942c7fc753dbf47ad120a53fc188c6b59729dd69485fcf1cdc85b78957817e python-musicbrainz2-0.3.1.tar.gz 54354 diff --git a/dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-0.4.0 b/dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-0.4.0 deleted file mode 100644 index 1cef8bb77..000000000 --- a/dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-0.4.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 7d2cf926dfd3c1f785cd2128a82e8c6e python-musicbrainz2-0.4.0.tar.gz 56557 -RMD160 f27d83f8be98c38eff5ce8aa8d069fac960c1b78 python-musicbrainz2-0.4.0.tar.gz 56557 -SHA256 b69228e9ac6de36a047fcaa8118815cda01fd7c03be24aa251d41a94ce16a8ee python-musicbrainz2-0.4.0.tar.gz 56557 diff --git a/dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-9999 b/dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-9999 deleted file mode 100644 index 8b1378917..000000000 --- a/dev-python/python-musicbrainz2/files/digest-python-musicbrainz2-9999 +++ /dev/null @@ -1 +0,0 @@ - diff --git a/dev-python/python-musicbrainz2/python-musicbrainz2-0.3.1.ebuild b/dev-python/python-musicbrainz2/python-musicbrainz2-0.3.1.ebuild deleted file mode 100644 index 41742c9e8..000000000 --- a/dev-python/python-musicbrainz2/python-musicbrainz2-0.3.1.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit distutils - -DESCRIPTION="Python bindings for musicbrainz client library" -HOMEPAGE="http://musicbrainz.org/" -SRC_URI="http://ftp.musicbrainz.org/pub/musicbrainz/python-musicbrainz2/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -IUSE="doc" -DEPEND=">=media-libs/musicbrainz-2.1.1 - >=dev-python/ctypes-0.9.6 - >=dev-lang/python-2.3 - doc? ( dev-python/epydoc )" - -DOCS="AUTHORS.txt CHANGES.txt COPYING.txt" - -src_install() { - distutils_src_install - docinto examples - dodoc examples/* - if use doc; then - python setup.py docs - docinto html - dodoc html/* - fi -} diff --git a/dev-python/python-musicbrainz2/python-musicbrainz2-0.4.0.ebuild b/dev-python/python-musicbrainz2/python-musicbrainz2-0.4.0.ebuild deleted file mode 100644 index bbe17966b..000000000 --- a/dev-python/python-musicbrainz2/python-musicbrainz2-0.4.0.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit distutils - -DESCRIPTION="Python bindings for musicbrainz client library" -HOMEPAGE="http://musicbrainz.org/" -SRC_URI="http://ftp.musicbrainz.org/pub/musicbrainz/python-musicbrainz2/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -IUSE="doc" -DEPEND=">=media-libs/musicbrainz-2.1.1 - >=dev-python/ctypes-0.9.6 - >=dev-lang/python-2.3 - doc? ( dev-python/epydoc )" - -DOCS="AUTHORS.txt CHANGES.txt COPYING.txt" - -src_install() { - distutils_src_install - docinto examples - dodoc examples/* - if use doc; then - python setup.py docs - docinto html - dohtml html/* - fi -} diff --git a/dev-python/python-musicbrainz2/python-musicbrainz2-9999.ebuild b/dev-python/python-musicbrainz2/python-musicbrainz2-9999.ebuild deleted file mode 100644 index f48a1d171..000000000 --- a/dev-python/python-musicbrainz2/python-musicbrainz2-9999.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit distutils subversion - -DESCRIPTION="Python bindings for musicbrainz client library" -HOMEPAGE="http://musicbrainz.org/" -ESVN_REPO_URI="http://svn.musicbrainz.org/python-musicbrainz2/trunk/" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -IUSE="doc" -DEPEND=">=media-libs/musicbrainz-2.1.1 - >=dev-python/ctypes-0.9.6 - >=dev-lang/python-2.3 - doc? ( dev-python/epydoc )" - -DOCS="AUTHORS.txt CHANGES.txt COPYING.txt" - -src_install() { - distutils_src_install - docinto examples - dodoc examples/* - if use doc; then - python setup.py docs - docinto html - dohtml html/* - fi -} diff --git a/dev-python/rhpl/Manifest b/dev-python/rhpl/Manifest deleted file mode 100644 index 0b3cf00a9..000000000 --- a/dev-python/rhpl/Manifest +++ /dev/null @@ -1,12 +0,0 @@ -AUX 0.188-use-raw-strings-for-gettext.diff 1104 RMD160 1c6c7ac9fd93d83a8d4dc23bf02f22de3f46da54 SHA1 077adb46c0deceb0c74c8a4ff9675c1ca5b54a2f SHA256 f1e9c647b19f5bb3d570b3900607df66474939c2e9618b63ced0eed476042be8 -MD5 6d40b11098fae8adab17a48d650a57cf files/0.188-use-raw-strings-for-gettext.diff 1104 -RMD160 1c6c7ac9fd93d83a8d4dc23bf02f22de3f46da54 files/0.188-use-raw-strings-for-gettext.diff 1104 -SHA256 f1e9c647b19f5bb3d570b3900607df66474939c2e9618b63ced0eed476042be8 files/0.188-use-raw-strings-for-gettext.diff 1104 -DIST rhpl-0.188-2.src.rpm 299535 RMD160 a5ab8e57f10c25547877d528599ca4d3b2a3fdc8 SHA1 a14b83ccc0720bf0a556b6fed57389294ee1bf5e SHA256 87db85b3dd8ded08fe8fde548cedc28cd59a51c7dd5ec4b84d6881a332c014fd -EBUILD rhpl-0.188.ebuild 1247 RMD160 02455aca0c5748826f88b05d444cf1848eb7ab6b SHA1 db29bb4b3c42668f8ccdfacd7a99d244ebd32960 SHA256 0d18918c9551b7cac956462d571685e94a0bb471c7a820a7df4373f8127b89ab -MD5 b3381e2dfa13098cf663ed9c2245481a rhpl-0.188.ebuild 1247 -RMD160 02455aca0c5748826f88b05d444cf1848eb7ab6b rhpl-0.188.ebuild 1247 -SHA256 0d18918c9551b7cac956462d571685e94a0bb471c7a820a7df4373f8127b89ab rhpl-0.188.ebuild 1247 -MD5 cec94e56b1d67d1c5b725a53b4128215 files/digest-rhpl-0.188 241 -RMD160 a9cf3e1ad57a8a4b9a0638cd5533eba1eb862127 files/digest-rhpl-0.188 241 -SHA256 b954bd502e1c5d3e191e445969462db0da5c63500891bec1c325152a8b19ce27 files/digest-rhpl-0.188 241 diff --git a/dev-python/rhpl/files/0.188-use-raw-strings-for-gettext.diff b/dev-python/rhpl/files/0.188-use-raw-strings-for-gettext.diff deleted file mode 100644 index c388c52ff..000000000 --- a/dev-python/rhpl/files/0.188-use-raw-strings-for-gettext.diff +++ /dev/null @@ -1,28 +0,0 @@ -diff -ur -x '*.po' rhpl-0.188.orig/src/gzread.py rhpl-0.188/src/gzread.py ---- rhpl-0.188.orig/src/gzread.py 2002-05-22 15:07:45.000000000 -0700 -+++ rhpl-0.188/src/gzread.py 2006-09-01 16:20:01.000000000 -0700 -@@ -57,7 +57,7 @@ - - def _read_gzip_header(self): - magic = self.fileobj.read(2) -- if magic != '\037\213': -+ if magic != r'\037\213': - self._unread(magic) - self.compressed = 0 - return -Only in rhpl-0.188/src/iconvmodule: build -Only in rhpl-0.188/src/iconvmodule: iconv.so -Only in rhpl-0.188/src: _translate.o -diff -ur -x '*.po' rhpl-0.188.orig/src/translate.py rhpl-0.188/src/translate.py ---- rhpl-0.188.orig/src/translate.py 2005-07-06 11:40:10.000000000 -0700 -+++ rhpl-0.188/src/translate.py 2006-09-01 16:20:24.000000000 -0700 -@@ -125,7 +125,7 @@ - buf = f.read(2) - f.close() - -- if buf == "\037\213": -+ if buf == r"\037\213": - mofile = gzip.open(file_path) - else: - mofile = open(file_path) -Only in rhpl-0.188/src: _translate.so diff --git a/dev-python/rhpl/files/digest-rhpl-0.188 b/dev-python/rhpl/files/digest-rhpl-0.188 deleted file mode 100644 index 916ee5b29..000000000 --- a/dev-python/rhpl/files/digest-rhpl-0.188 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 5a74ee9e43760ea63669a27d171b7ec7 rhpl-0.188-2.src.rpm 299535 -RMD160 a5ab8e57f10c25547877d528599ca4d3b2a3fdc8 rhpl-0.188-2.src.rpm 299535 -SHA256 87db85b3dd8ded08fe8fde548cedc28cd59a51c7dd5ec4b84d6881a332c014fd rhpl-0.188-2.src.rpm 299535 diff --git a/dev-python/rhpl/rhpl-0.188.ebuild b/dev-python/rhpl/rhpl-0.188.ebuild deleted file mode 100644 index c54357718..000000000 --- a/dev-python/rhpl/rhpl-0.188.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/rhpl/rhpl-0.188.ebuild,v 1.1 2006/09/05 20:59:07 dberkholz Exp $ - -inherit eutils multilib python rpm toolchain-funcs - -# Revision of the RPM. Shouldn't affect us, as we're just grabbing the source -# tarball out of it -RPMREV="2" - -DESCRIPTION="Library of python code used by Red Hat Linux programs" -HOMEPAGE="http://fedora.redhat.com/projects/config-tools/" -SRC_URI="mirror://fedora/development/source/SRPMS/${P}-${RPMREV}.src.rpm" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~ppc ~x86 ~amd64" -IUSE="" -RDEPEND="dev-lang/python - dev-python/pyxf86config - ! server.deps/Makefile.am - - # remove groupwise folder from Makefile's since they are in a diff location - sed -i -e 's: groupwise::' addressbook/backends/Makefile.am camel/providers/Makefile.am calendar/backends/Makefile.am - - # fix configure.in location of the Makefile's - sed -i -e 's:addressbook/backends/groupwise:server.deps/addressbook:' configure.in - sed -i -e 's:camel/providers/groupwise:server.deps/camel:' configure.in - # tack on the server.deps Makefile on our last edit - sed -i -e 's:calendar/backends/groupwise:server.deps/calendar/Makefile\nserver.deps:' configure.in - - # fix file includes - sed -i -e 's::"server.deps/addressbook/e-book-backend-groupwise.h":' addressbook/libedata-book/e-data-book-factory.c - -#---------------Upstream GNOME stop here--------------- - eautoreconf -} - -src_compile() { - # Use NSS/NSPR only if 'ssl' is enabled. - if use ssl ; then - NSS_LIB=/usr/$(get_libdir)/nss - NSS_INC=/usr/include/nss - NSPR_LIB=/usr/$(get_libdir)/nspr - NSPR_INC=/usr/include/nspr - - G2CONF="${G2CONF} \ - --with-nspr-includes=${NSPR_INC} \ - --with-nspr-libs=${NSPR_LIB} \ - --with-nss-includes=${NSS_INC} \ - --with-nss-libs=${NSS_LIB}" - else - G2CONF="${G2CONF} --without-nspr-libs --without-nspr-includes \ - --without-nss-libs --without-nss-includes" - fi - - cd "${S}" - gnome2_src_compile -} diff --git a/gnome-extra/evolution-data-server/files/digest-evolution-data-server-1.8.2 b/gnome-extra/evolution-data-server/files/digest-evolution-data-server-1.8.2 deleted file mode 100644 index 7dabc9ec7..000000000 --- a/gnome-extra/evolution-data-server/files/digest-evolution-data-server-1.8.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 fe7545411f7417bd246e15ae07ae9f54 evolution-data-server-1.8.2.tar.bz2 6963774 -RMD160 b3ae6d2dafa0abbbaf5ffe2fbdc39b6b20fe762d evolution-data-server-1.8.2.tar.bz2 6963774 -SHA256 63a765c237504ed34344f7ef505c495d9a40c6022b7d69ca6ded32016508fecd evolution-data-server-1.8.2.tar.bz2 6963774 diff --git a/gnome-extra/evolution-data-server/files/evolution-data-server-1.2.0-gentoo_etc_services.patch b/gnome-extra/evolution-data-server/files/evolution-data-server-1.2.0-gentoo_etc_services.patch deleted file mode 100644 index ad9044e9f..000000000 --- a/gnome-extra/evolution-data-server/files/evolution-data-server-1.2.0-gentoo_etc_services.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -u camel.orig/providers/imap/camel-imap-store.c camel/providers/imap/camel-imap-store.c ---- camel.orig/providers/imap/camel-imap-store.c 2005-03-03 10:30:32.785549256 -0600 -+++ camel/providers/imap/camel-imap-store.c 2005-03-03 10:33:18.970285336 -0600 -@@ -924,7 +924,7 @@ - port = ssl_options[i].port; - } else { - mode = MODE_CLEAR; -- serv = "imap"; -+ serv = "imap2"; - port = IMAP_PORT; - } - -diff -u camel.orig/providers/pop3/camel-pop3-store.c camel/providers/pop3/camel-pop3-store.c ---- camel.orig/providers/pop3/camel-pop3-store.c 2005-03-03 10:30:32.779550168 -0600 -+++ camel/providers/pop3/camel-pop3-store.c 2005-03-03 10:34:40.812843376 -0600 -@@ -308,7 +308,7 @@ - port = ssl_options[i].port; - } else { - mode = MODE_CLEAR; -- serv = "pop3"; -+ serv = "pop-3"; - port = POP3S_PORT; - } - diff --git a/gnome-extra/evolution-data-server/files/evolution-data-server-1.2.3-gcc4.patch b/gnome-extra/evolution-data-server/files/evolution-data-server-1.2.3-gcc4.patch deleted file mode 100644 index 49a4ddeb6..000000000 --- a/gnome-extra/evolution-data-server/files/evolution-data-server-1.2.3-gcc4.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ur evolution-data-server-1.2.3-orig/calendar/libecal/e-cal.c evolution-data-server-1.2.3/calendar/libecal/e-cal.c ---- evolution-data-server-1.2.3-orig/calendar/libecal/e-cal.c 2005-06-09 20:00:28.000000000 -0400 -+++ evolution-data-server-1.2.3/calendar/libecal/e-cal.c 2005-06-09 20:02:10.000000000 -0400 -@@ -40,7 +40,8 @@ - #include "e-cal-view-listener.h" - #include "e-cal.h" - -- -+static gboolean -+open_calendar (ECal *ecal, gboolean only_if_exists, GError **error, ECalendarStatus *status, gboolean needs_auth); - - typedef struct { - GMutex *mutex; diff --git a/gnome-extra/evolution-data-server/files/evolution-data-server-1.4.2.1-calandar-crash-fix.patch b/gnome-extra/evolution-data-server/files/evolution-data-server-1.4.2.1-calandar-crash-fix.patch deleted file mode 100644 index 077168b24..000000000 --- a/gnome-extra/evolution-data-server/files/evolution-data-server-1.4.2.1-calandar-crash-fix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --exclude-from=/home/dang/.diffrc -u -ruN evolution-data-server-1.4.2.1.orig/calendar/libecal/e-cal-recur.c evolution-data-server-1.4.2.1/calendar/libecal/e-cal-recur.c ---- evolution-data-server-1.4.2.1.orig/calendar/libecal/e-cal-recur.c 2005-09-02 10:37:43.000000000 -0400 -+++ evolution-data-server-1.4.2.1/calendar/libecal/e-cal-recur.c 2006-01-08 16:31:12.000000000 -0500 -@@ -683,7 +683,7 @@ - gpointer tz_cb_data, - icaltimezone *default_timezone) - { -- ECalComponentDateTime dtstart, dtend; -+ ECalComponentDateTime dtstart = {0}, dtend = {0}; - time_t dtstart_time, dtend_time; - GSList *rrules = NULL, *rdates = NULL, elem; - GSList *exrules = NULL, *exdates = NULL; diff --git a/gnome-extra/evolution-data-server/files/evolution-data-server-1.7.3-exchange-storage.patch b/gnome-extra/evolution-data-server/files/evolution-data-server-1.7.3-exchange-storage.patch deleted file mode 100644 index bf0fe7a56..000000000 --- a/gnome-extra/evolution-data-server/files/evolution-data-server-1.7.3-exchange-storage.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --exclude-from=/home/dang/.diffrc -u -ruN evolution-data-server-1.7.3.orig/configure.in evolution-data-server-1.7.3/configure.in ---- evolution-data-server-1.7.3.orig/configure.in 2006-06-12 10:27:29.000000000 -0400 -+++ evolution-data-server-1.7.3/configure.in 2006-07-07 10:22:49.000000000 -0400 -@@ -950,19 +950,23 @@ - msg_krb5="no" - if test "x${with_krb5}" != "xno"; then - LDFLAGS_save="$LDFLAGS" -+ SAVE_LIBS="$LIBS" - - mitlibs="-lkrb5 -lk5crypto -lcom_err -lgssapi_krb5" - heimlibs="-lkrb5 -lcrypto -lasn1 -lcom_err -lroken -lgssapi" - AC_CACHE_CHECK([for Kerberos 5], ac_cv_lib_kerberos5, - [ -- LDFLAGS="$LDFLAGS -L$with_krb5_libs $mitlibs" -+ LDFLAGS="$LDFLAGS -L$with_krb5_libs" -+ LIBS="$SAVE_LIBS $mitlibs" - AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$mitlibs", - [ -- LDFLAGS="$LDFLAGS_save -L$with_krb5_libs $heimlibs" -+ LDFLAGS="$LDFLAGS_save -L$with_krb5_libs" -+ LIBS="$SAVE_LIBS $heimlibs" - AC_TRY_LINK_FUNC(krb5_init_context, ac_cv_lib_kerberos5="$heimlibs", ac_cv_lib_kerberos5="no") - ]) -- LDFLAGS="$LDFLAGS_save" - ]) -+ LDFLAGS="$LDFLAGS_save" -+ LIBS="$SAVE_LIBS" - if test "$ac_cv_lib_kerberos5" != "no"; then - AC_DEFINE(HAVE_KRB5,1,[Define if you have Krb5]) - if test "$ac_cv_lib_kerberos5" = "$mitlibs"; then diff --git a/gnome-extra/evolution-data-server/files/evolution-data-server-1.7.3-libdb.patch b/gnome-extra/evolution-data-server/files/evolution-data-server-1.7.3-libdb.patch deleted file mode 100644 index 22ce75d2f..000000000 --- a/gnome-extra/evolution-data-server/files/evolution-data-server-1.7.3-libdb.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --exclude-from=/home/dang/.diffrc -u -ruN evolution-data-server-1.7.3.orig/configure.in evolution-data-server-1.7.3/configure.in ---- evolution-data-server-1.7.3.orig/configure.in 2006-06-12 10:27:29.000000000 -0400 -+++ evolution-data-server-1.7.3/configure.in 2006-07-06 23:43:43.000000000 -0400 -@@ -1389,9 +1393,6 @@ - export privincludedir - export privdatadir - AC_CONFIG_SUBDIRS(calendar/libical) --if test $dynamic_libdb = no; then -- AC_CONFIG_SUBDIRS(libdb/dist) --fi - AC_OUTPUT([ - Makefile - evolution-data-server-zip diff --git a/gnome-extra/evolution-data-server/files/evolution-data-server-1.7.4-move-subdirs.patch b/gnome-extra/evolution-data-server/files/evolution-data-server-1.7.4-move-subdirs.patch deleted file mode 100644 index 13fc81a19..000000000 --- a/gnome-extra/evolution-data-server/files/evolution-data-server-1.7.4-move-subdirs.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --exclude-from=/home/dang/.diffrc -u -ruN evolution-data-server-1.7.4.orig/Makefile.am evolution-data-server-1.7.4/Makefile.am ---- evolution-data-server-1.7.4.orig/Makefile.am 2006-04-24 06:39:59.000000000 -0400 -+++ evolution-data-server-1.7.4/Makefile.am 2006-07-20 18:15:50.000000000 -0400 -@@ -5,8 +5,8 @@ - LIBDB = libdb - endif - --SUBDIRS = $(LIBDB) win32 libedataserver servers camel addressbook calendar libedataserverui src docs art po --DIST_SUBDIRS= win32 libedataserver servers camel addressbook calendar libedataserverui src docs art po -+SUBDIRS = $(LIBDB) win32 libedataserver camel addressbook calendar libedataserverui servers server.deps src docs art po -+DIST_SUBDIRS= win32 libedataserver camel addressbook calendar libedataserverui servers server.deps src docs art po - - changelogs = \ - ChangeLog diff --git a/gnome-extra/evolution-data-server/files/evolution-data-server-1.8.0-camel-rewind.patch b/gnome-extra/evolution-data-server/files/evolution-data-server-1.8.0-camel-rewind.patch deleted file mode 100644 index c420759a8..000000000 --- a/gnome-extra/evolution-data-server/files/evolution-data-server-1.8.0-camel-rewind.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --exclude-from=/home/dang/.diffrc -u -ruN evolution-data-server-1.7.90.1.orig/camel/camel-disco-diary.c evolution-data-server-1.7.90.1/camel/camel-disco-diary.c ---- evolution-data-server-1.7.90.1.orig/camel/camel-disco-diary.c 2006-02-16 04:36:28.000000000 -0500 -+++ evolution-data-server-1.7.90.1/camel/camel-disco-diary.c 2006-08-01 22:55:43.000000000 -0400 -@@ -404,6 +404,7 @@ - - /* Truncate the log */ - ftruncate (fileno (diary->file), 0); -+ rewind (diary->file); - } - - CamelDiscoDiary * diff --git a/gnome-extra/evolution-data-server/files/evolution-data-server-1.8.1-inbox-folders.patch b/gnome-extra/evolution-data-server/files/evolution-data-server-1.8.1-inbox-folders.patch deleted file mode 100644 index c8b12b972..000000000 --- a/gnome-extra/evolution-data-server/files/evolution-data-server-1.8.1-inbox-folders.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- servers/exchange/storage/exchange-account.c.orig 2006-10-13 08:07:21.000000000 -0500 -+++ servers/exchange/storage/exchange-account.c 2006-10-13 08:07:57.000000000 -0500 -@@ -1244,8 +1244,7 @@ - account->priv->identity_name, - account->priv->identity_email, - account->priv->source_uri, -- account->priv->offline_sync); -- d(g_print ("exchange-account.c:setup_account_hierarchies:offline_sync=%d\n", account->priv->offline_sync)); -+ TRUE); - - setup_hierarchy (account, hier); - g_free (phys_uri_prefix); -@@ -1277,7 +1276,7 @@ - account->priv->identity_name, - account->priv->identity_email, - account->priv->source_uri, -- account->priv->offline_sync); -+ TRUE); - setup_hierarchy (account, hier); - g_free (phys_uri_prefix); - diff --git a/gnome-extra/evolution-data-server/files/evolution-data-server-no_lazy_bindings.patch b/gnome-extra/evolution-data-server/files/evolution-data-server-no_lazy_bindings.patch deleted file mode 100644 index a094433c8..000000000 --- a/gnome-extra/evolution-data-server/files/evolution-data-server-no_lazy_bindings.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -NurdB evolution-data-server-1.3.7/camel/Makefile.am evolution-data-server-1.3.7-patched/camel/Makefile.am ---- evolution-data-server-1.3.7/camel/Makefile.am 2005-07-08 11:57:02.000000000 -0500 -+++ evolution-data-server-1.3.7-patched/camel/Makefile.am 2005-08-17 15:40:24.000000000 -0500 -@@ -271,6 +271,8 @@ - camel-lock-helper.c \ - camel-lock-helper.h - -+camel_lock_helper_1_2_LDFLAGS = -Wl,-z,now -+ - # NOTE: This needs to be cleaned up, it shouldn't link with all this crap, - # because it might be setuid. - camel_lock_helper_1_2_LDADD = \ diff --git a/kde-base/kdebase-kioslaves/Manifest b/kde-base/kdebase-kioslaves/Manifest deleted file mode 100644 index 89e415700..000000000 --- a/kde-base/kdebase-kioslaves/Manifest +++ /dev/null @@ -1,17 +0,0 @@ -AUX kdebase-kioslaves-3.5.5-floppy.patch 2286 RMD160 748c32477457cb8f69a4b360fee8989b256379a4 SHA1 12539feb5445f05d62c1168a3f6442a357ab2109 SHA256 6c2f54f125c8ee62b20c60b701b1582319b504a6fc9d7a3359ac6497979403b7 -MD5 fb0dabd8101969c83d3f49469196956e files/kdebase-kioslaves-3.5.5-floppy.patch 2286 -RMD160 748c32477457cb8f69a4b360fee8989b256379a4 files/kdebase-kioslaves-3.5.5-floppy.patch 2286 -SHA256 6c2f54f125c8ee62b20c60b701b1582319b504a6fc9d7a3359ac6497979403b7 files/kdebase-kioslaves-3.5.5-floppy.patch 2286 -AUX kdebase-kioslaves-3.5.5-fstab.patch 3103 RMD160 53a4f0ded4d368f93eb29650d12d266735d7bf9e SHA1 1ffe0d67e77970774a5a2420f79b0579716dc8a7 SHA256 6a17470a3245a59c6e84a0142e64633e74b2bb12649e9c46c0903dd8fa4edb29 -MD5 76bc9dcbf83bccc0cbb0aaaf8560772e files/kdebase-kioslaves-3.5.5-fstab.patch 3103 -RMD160 53a4f0ded4d368f93eb29650d12d266735d7bf9e files/kdebase-kioslaves-3.5.5-fstab.patch 3103 -SHA256 6a17470a3245a59c6e84a0142e64633e74b2bb12649e9c46c0903dd8fa4edb29 files/kdebase-kioslaves-3.5.5-fstab.patch 3103 -DIST kdebase-3.5-patchset-03.tar.bz2 21409 RMD160 941b919097d03347b10bccb51db2fa5e89d7ba16 SHA1 9ac59cdfc4cd8d43b6d0e6dbebc5b28d7a33e35f SHA256 59c691754627f78daf7693e82496d808cf1cc31e2d6f32af829ec4ccfd776574 -DIST kdebase-3.5.5.tar.bz2 23851886 RMD160 6cf804de0487347a3e1d4ea6e5ba5114d23d9806 SHA1 f9f1907ce71fd2f934cf7404f1db1d350c2b9544 SHA256 f77632e44214648e2d0adfe1a79dd61a6a738c21fe5abb0baff16b72432baaa0 -EBUILD kdebase-kioslaves-3.5.5-r1.ebuild 1811 RMD160 b8f74bce56fd9cc8ff71e3d63ad8148cfcec8333 SHA1 136baf36f4fd801a3b0d1d223224df1fa061a8a7 SHA256 03e0698e861ce31828d548317111525da09445eb9bdceb4fa28bbc79c1418798 -MD5 67a70857ff7eac38df188003575ba1eb kdebase-kioslaves-3.5.5-r1.ebuild 1811 -RMD160 b8f74bce56fd9cc8ff71e3d63ad8148cfcec8333 kdebase-kioslaves-3.5.5-r1.ebuild 1811 -SHA256 03e0698e861ce31828d548317111525da09445eb9bdceb4fa28bbc79c1418798 kdebase-kioslaves-3.5.5-r1.ebuild 1811 -MD5 4413bb62e0a3313d499ee48fb91adfaf files/digest-kdebase-kioslaves-3.5.5-r1 521 -RMD160 4631b6a312d8f0a17d62d4a7f98bb92ab09fa8d1 files/digest-kdebase-kioslaves-3.5.5-r1 521 -SHA256 f8d736f629130da8e0d90a8ebd0a550634334af2739900a17d0e04c688b248e2 files/digest-kdebase-kioslaves-3.5.5-r1 521 diff --git a/kde-base/kdebase-kioslaves/files/digest-kdebase-kioslaves-3.5.5-r1 b/kde-base/kdebase-kioslaves/files/digest-kdebase-kioslaves-3.5.5-r1 deleted file mode 100644 index f51965cf1..000000000 --- a/kde-base/kdebase-kioslaves/files/digest-kdebase-kioslaves-3.5.5-r1 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 420445e2dbddfd83ebc25e85a9b9cdda kdebase-3.5-patchset-03.tar.bz2 21409 -RMD160 941b919097d03347b10bccb51db2fa5e89d7ba16 kdebase-3.5-patchset-03.tar.bz2 21409 -SHA256 59c691754627f78daf7693e82496d808cf1cc31e2d6f32af829ec4ccfd776574 kdebase-3.5-patchset-03.tar.bz2 21409 -MD5 0c685af1cbca75f9c77b3ed231ba0468 kdebase-3.5.5.tar.bz2 23851886 -RMD160 6cf804de0487347a3e1d4ea6e5ba5114d23d9806 kdebase-3.5.5.tar.bz2 23851886 -SHA256 f77632e44214648e2d0adfe1a79dd61a6a738c21fe5abb0baff16b72432baaa0 kdebase-3.5.5.tar.bz2 23851886 diff --git a/kde-base/kdebase-kioslaves/files/kdebase-kioslaves-3.5.5-floppy.patch b/kde-base/kdebase-kioslaves/files/kdebase-kioslaves-3.5.5-floppy.patch deleted file mode 100644 index 36b477d9c..000000000 --- a/kde-base/kdebase-kioslaves/files/kdebase-kioslaves-3.5.5-floppy.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff -Nur kdebase-3.5.5-orgin/kioslave/media/mediamanager/halbackend.cpp kdebase-3.5.5-new/kioslave/media/mediamanager/halbackend.cpp ---- kdebase-3.5.5-orgin/kioslave/media/mediamanager/halbackend.cpp 2006-11-16 11:26:25.000000000 +0800 -+++ kdebase-3.5.5-new/kioslave/media/mediamanager/halbackend.cpp 2006-11-16 11:33:07.000000000 +0800 -@@ -705,7 +705,7 @@ - { - // HAL hates floppies - so we have to do it twice ;( - medium->mountableState(libhal_drive_get_device_file(halDrive), QString::null, QString::null, false); -- setFstabProperties( medium ); -+ setFloppyMountState( medium ); - } - - if (libhal_device_get_property_QString(m_halContext, udi, "storage.drive_type") == "floppy") -@@ -740,6 +740,30 @@ - libhal_volume_free(halVolume); - } - -+void HALBackend::setFloppyMountState( Medium *medium ) -+{ -+ if ( !medium->id().startsWith( "/org/kde" ) ) -+ { -+ KMountPoint::List mtab = KMountPoint::currentMountPoints(); -+ KMountPoint::List::iterator it = mtab.begin(); -+ KMountPoint::List::iterator end = mtab.end(); -+ -+ QString fstype; -+ QString mountpoint; -+ for (; it!=end; ++it) -+ { -+ if ((*it)->mountedFrom() == medium->deviceNode() ) -+ { -+ fstype = (*it)->mountType().isNull() ? (*it)->mountType() : "auto"; -+ mountpoint = (*it)->mountPoint(); -+ medium->mountableState( medium->deviceNode(), mountpoint, fstype, true ); -+ return; -+ } -+ } -+ } -+} -+ -+ - void HALBackend::setCameraProperties(Medium* medium) - { - kdDebug(1219) << "HALBackend::setCameraProperties for " << medium->id() << endl; -diff -Nur kdebase-3.5.5-orgin/kioslave/media/mediamanager/halbackend.h kdebase-3.5.5-new/kioslave/media/mediamanager/halbackend.h ---- kdebase-3.5.5-orgin/kioslave/media/mediamanager/halbackend.h 2006-11-16 11:26:17.000000000 +0800 -+++ kdebase-3.5.5-new/kioslave/media/mediamanager/halbackend.h 2006-11-16 11:33:40.000000000 +0800 -@@ -168,6 +168,8 @@ - void setCameraProperties(Medium* medium); - QString generateName(const QString &devNode); - static QString isInFstab(const Medium *medium); -+ -+ void setFloppyMountState(Medium* medium); - - private slots: - void slotResult(KIO::Job *job); - diff --git a/kde-base/kdebase-kioslaves/files/kdebase-kioslaves-3.5.5-fstab.patch b/kde-base/kdebase-kioslaves/files/kdebase-kioslaves-3.5.5-fstab.patch deleted file mode 100644 index 3f0721e75..000000000 --- a/kde-base/kdebase-kioslaves/files/kdebase-kioslaves-3.5.5-fstab.patch +++ /dev/null @@ -1,73 +0,0 @@ -From: Stephan Kulow -To: kde-commits@kde.org -Subject: branches/KDE/3.5/kdebase/kioslave/media/mediamanager -Date: Mon, 09 Oct 2006 09:32:17 +0000 -Message-Id: <1160386337.725673.25740.nullmailer@svn.kde.org> -Cc: kde-packager@kde.org -Content-Type: text/plain; - charset="us-ascii" -Content-Transfer-Encoding: 7bit -X-Length: 6245 - -SVN commit 593835 by coolo: - -devices that are in fstab should show up no matter what HAL thinks -CCMAIL: kde-packager@kde.org - - - M +16 -7 halbackend.cpp - - ---- branches/KDE/3.5/kdebase/kioslave/media/mediamanager/halbackend.cpp #593834:593835 -@@ -215,11 +215,6 @@ - !libhal_device_get_property_bool(m_halContext, udi, "volume.disc.is_blank", NULL) ) - return; - -- if ( ( libhal_device_get_property_QString(m_halContext, udi, "volume.fsusage") == "filesystem" && -- !libhal_device_get_property_bool(m_halContext, udi, "volume.is_mounted", NULL ) ) && -- ( libhal_device_get_property_bool(m_halContext, udi, "volume.ignore", NULL ) ) ) -- return; -- - /* Query drive udi */ - QString driveUdi = libhal_device_get_property_QString(m_halContext, udi, "block.storage_device"); - /* We don't list floppy volumes because we list floppy drives */ -@@ -240,7 +235,19 @@ - - /* Create medium */ - Medium* medium = new Medium(udi, ""); -+ setVolumeProperties(medium); - -+ if ( isInFstab( medium ).isNull() ) -+ { -+ // if it's not mountable by user and not by HAL, don't show it at all -+ if ( ( libhal_device_get_property_QString(m_halContext, udi, "volume.fsusage") == "filesystem" && -+ !libhal_device_get_property_bool(m_halContext, udi, "volume.is_mounted", NULL ) ) && -+ ( libhal_device_get_property_bool(m_halContext, udi, "volume.ignore", NULL ) ) ) -+ { -+ delete medium; -+ return; -+ } -+ } - QMap options = MediaManagerUtils::splitOptions(mountoptions(udi)); - kdDebug() << "automount " << options["automount"] << endl; - if (options["automount"] == "true" && allowNotification ) { -@@ -248,7 +255,6 @@ - if (!error.isEmpty()) - kdDebug() << "error " << error << endl; - } -- setVolumeProperties(medium); - m_mediaList.addMedium(medium, allowNotification); - - return; -@@ -992,7 +998,10 @@ - - for (; it!=end; ++it) - { -- kdDebug() << "isInFstab -" << medium->deviceNode() << "- -" << (*it)->realDeviceName() << "- -" << (*it)->mountedFrom() << endl; -+ QString reald = (*it)->realDeviceName(); -+ if ( reald.endsWith( "/" ) ) -+ reald = reald.left( reald.length() - 1 ); -+ kdDebug() << "isInFstab -" << medium->deviceNode() << "- -" << reald << "- -" << (*it)->mountedFrom() << "-" << endl; - if ((*it)->mountedFrom() == medium->deviceNode() || ( !medium->deviceNode().isEmpty() && (*it)->realDeviceName() == medium->deviceNode() ) ) - { - QStringList opts = (*it)->mountOptions(); diff --git a/kde-base/kdebase-kioslaves/kdebase-kioslaves-3.5.5-r1.ebuild b/kde-base/kdebase-kioslaves/kdebase-kioslaves-3.5.5-r1.ebuild deleted file mode 100644 index 92439dcba..000000000 --- a/kde-base/kdebase-kioslaves/kdebase-kioslaves-3.5.5-r1.ebuild +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdebase-kioslaves/kdebase-kioslaves-3.5.5-r1.ebuild,v 1.1 2006/10/16 21:58:07 flameeyes Exp $ - -KMNAME=kdebase -KMMODULE=kioslave -MAXKDEVER=$PV -KM_DEPRANGE="$PV $MAXKDEVER" -inherit kde-meta eutils - -SRC_URI="${SRC_URI} - mirror://gentoo/kdebase-3.5-patchset-03.tar.bz2" - -DESCRIPTION="kioslave: the kde VFS framework - kioslave plugins present a filesystem-like view of arbitrary data" -KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" -IUSE="hal ldap samba openexr" -DEPEND="ldap? ( net-nds/openldap ) - samba? ( >=net-fs/samba-3.0.1 ) - >=dev-libs/cyrus-sasl-2 - hal? ( || ( dev-libs/dbus-qt3-old >=sys-apps/dbus-0.33 ) - =sys-apps/hal-0.5* - sys-apps/pmount ) - openexr? ( >=media-libs/openexr-1.2.2-r2 )" -RDEPEND="${DEPEND} - $(deprange $PV $MAXKDEVER kde-base/kdialog)" # for the kdeeject script used by the devices/mounthelper ioslave - -PATCHES=" - ${FILESDIR}/${P}-fstab.patch - ${FILESDIR}/${P}-floppy.patch - " - -pkg_setup() { - kde_pkg_setup - if use hal && has_version '@])], -+ [], with_external_libgadu=check) -+ - AC_ARG_WITH(libgadu-includes, - AC_HELP_STRING([--with-libgadu-includes=DIR], [where the libgadu includes are.]), - [ ac_libgadu_includes="$withval" ]) -@@ -26,12 +31,12 @@ - LIBGG_LIBS="-L$ac_libgadu_libs" - fi - -- --ac_save_LIBS="$LIBS" --ac_save_CFLAGS="$CFLAGS" --LIBS="$LIBGG_LIBS -lgadu $LIBPTHREAD" --CFLAGS="$CFLAGS $LIBGG_INCLUDES" --AC_MSG_CHECKING([libgadu version 1.5(rcX) with pthread support]) -+if test "x$with_external_libgadu" != xno; then -+ ac_save_LIBS="$LIBS" -+ ac_save_CFLAGS="$CFLAGS" -+ LIBS="$LIBGG_LIBS -lgadu $LIBPTHREAD" -+ CFLAGS="$CFLAGS $LIBGG_INCLUDES" -+ AC_MSG_CHECKING([libgadu version 1.5(rcX) with pthread support]) - AC_TRY_RUN( - [ - -@@ -61,29 +66,38 @@ - ], [ - LIBGG_LIBS="$LIBGG_LIBS -lgadu $LIBPTHREAD" - AC_MSG_RESULT([yes]) -- AC_SUBST(LIBGG_INCLUDES) -- AC_SUBST(LIBGG_LIBS) - COMPILE_GADU=true -- AC_SUBST(COMPILE_GADU) - use_libgadu_copy= - ], [ -- if test "$kde_use_threading" = "yes" ; then -- AC_MSG_RESULT([no, falling back on supplied libgadu-copy]) -- use_libgadu_copy=yes -- COMPILE_GADU=true -+ AC_MSG_RESULT([no]) -+ ]) -+ LIBS="$ac_save_LIBS" -+ CFLAGS="$ac_save_CFLAGS" -+ -+ if test "x$with_external_libgadu" != xcheck && test -z "$COMPILE_GADU"; then -+ AC_MSG_FAILURE([--with-external-libgadu was given, but test for libgadu failed]) -+ fi -+fi -+ -+if test -z "$COMPILE_GADU"; then -+ AC_MSG_CHECKING([if supplied libgadu-copy can be used]) -+ if test "$kde_use_threading" = "yes"; then -+ AC_MSG_RESULT([yes]) -+ use_libgadu_copy=yes -+ COMPILE_GADU=true - else -- use_libgadu_copy= -- AC_MSG_RESULT([no, cannot fall back on libgadu-copy (no pthread)]) -- COMPILE_GADU= -+ AC_MSG_RESULT([no (no pthread), support for Gadu-Gadu will be disabled]) -+ use_libgadu_copy= -+ COMPILE_GADU= - fi -- AC_SUBST(COMPILE_GADU) -- ]) -+fi -+ -+AC_SUBST(LIBGG_INCLUDES) -+AC_SUBST(LIBGG_LIBS) -+AC_SUBST(COMPILE_GADU) - AM_CONDITIONAL(include_gadu, test -n "$COMPILE_GADU") - AM_CONDITIONAL(include_libggcopy, test -n "$use_libgadu_copy") --LIBS="$ac_save_LIBS" --CFLAGS="$ac_save_CFLAGS" - -- - if test "$use_libgadu_copy" = "yes"; then - cp ${srcdir}/kopete/protocols/gadu/libgadu/libgadu-config.h.in \ - ${srcdir}/kopete/protocols/gadu/libgadu/libgadu-config.h diff --git a/kde-base/kopete/files/configure-fix-kdenetwork-xmms.patch b/kde-base/kopete/files/configure-fix-kdenetwork-xmms.patch deleted file mode 100644 index b9e9773a7..000000000 --- a/kde-base/kopete/files/configure-fix-kdenetwork-xmms.patch +++ /dev/null @@ -1,38 +0,0 @@ -Index: kopete/plugins/nowlistening/configure.in.in -=================================================================== ---- kopete/plugins/nowlistening/configure.in.in (revision 433553) -+++ kopete/plugins/nowlistening/configure.in.in (working copy) -@@ -41,7 +41,19 @@ - fi - ]) - --AC_CHECK_XMMS -+AC_ARG_WITH(xmms, -+ [AS_HELP_STRING(--with-xmms, -+ [enable support for XMMS @<:@default=check@:>@])], -+ [], with_xmms=check) -+ -+if test "x$with_xmms" != xno; then -+ AC_CHECK_XMMS -+ -+ if test "x$with_xmms" != xcheck && test "x$ac_cv_have_xmms" = xno; then -+ AC_MSG_FAILURE([--with-xmms was given, but test for XMMS failed]) -+ fi -+fi -+ - AC_SUBST(XMMS_LIBS) - AC_SUBST(XMMS_LDFLAGS) - AC_SUBST(XMMS_INCLUDES) -Index: configure.in.bot -=================================================================== ---- configure.in.bot (revision 433553) -+++ configure.in.bot (working copy) -@@ -63,7 +63,7 @@ - all_tests=bad - fi - --if test -z "$XMMS_LIBS"; then -+if test "x$with_xmms" = xcheck && test -z "$XMMS_LIBS"; then - echo "" - echo "You're missing the XMMS libraries, or the libxmms development package." - echo "Without libxmms Kopete's NowListening plugin won't be able to talk to" diff --git a/kde-base/kopete/files/digest-kopete-3.5.5-r3 b/kde-base/kopete/files/digest-kopete-3.5.5-r3 deleted file mode 100644 index e01357520..000000000 --- a/kde-base/kopete/files/digest-kopete-3.5.5-r3 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 07d313f91154d3c2f4620b921277fdc8 kdenetwork-3.5-patchset-01.tar.bz2 2986 -RMD160 288113734e7767a7526f4b9311c1985ac8aa91bf kdenetwork-3.5-patchset-01.tar.bz2 2986 -SHA256 0bbde1adaa4e8fff02c1f1fd6ceb66ec9af14dd19ff64567ab0fd03926d7d05b kdenetwork-3.5-patchset-01.tar.bz2 2986 -MD5 a6e642c070cbd50d4a817f6588bf8e46 kdenetwork-3.5.5.tar.bz2 9235564 -RMD160 3e757d10ee5bf24b2ccf131e693fb614b9fdb9f4 kdenetwork-3.5.5.tar.bz2 9235564 -SHA256 c3f36e69bbd23902f2bdd9a1a8cda93b0436338ada422bb8ac6bc3d2bcd8e38f kdenetwork-3.5.5.tar.bz2 9235564 diff --git a/kde-base/kopete/files/disable-meanwhile.diff b/kde-base/kopete/files/disable-meanwhile.diff deleted file mode 100644 index 7ecb0e6df..000000000 --- a/kde-base/kopete/files/disable-meanwhile.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- kopete/protocols/configure.in.in 2005-05-23 15:07:47.000000000 +0300 -+++ kopete/protocols/configure.in.in 2005-06-30 21:51:09.000000000 +0300 -@@ -196,7 +196,7 @@ - AC_MSG_RESULT([yes]) - AC_SUBST(MEANWHILE_INCLUDES) - AC_SUBST(MEANWHILE_LIBS) -- COMPILE_MEANWHILE=true -+ COMPILE_MEANWHILE= - AC_SUBST(COMPILE_MEANWHILE) - ], [ - AC_MSG_RESULT([no]) diff --git a/kde-base/kopete/files/gnomemeeting-ekiga.patch b/kde-base/kopete/files/gnomemeeting-ekiga.patch deleted file mode 100644 index 7ff568b15..000000000 --- a/kde-base/kopete/files/gnomemeeting-ekiga.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -ur kopete-0.12.1/kopete/plugins/netmeeting.orig/netmeetinginvitation.cpp netmeeting/netmeetinginvitation.cpp ---- kopete-0.12.1/kopete/plugins/netmeeting.orig/netmeetinginvitation.cpp 2006-07-18 16:30:54.000000000 +0200 -+++ kopete-0.12.1/kopete/plugins/netmeeting/netmeetinginvitation.cpp 2006-07-18 16:04:51.000000000 +0200 -@@ -162,7 +162,7 @@ - - KConfig *config=KGlobal::config(); - config->setGroup("Netmeeting Plugin"); -- QString app=config->readEntry("NetmeetingApplication","gnomemeeting -c callto://%1").arg(ip_address); -+ QString app=config->readEntry("NetmeetingApplication","ekiga -c callto://%1").arg(ip_address); - - kdDebug() << k_funcinfo << app << endl ; - -diff -ur kopete-0.12.1/kopete/plugins/netmeeting.orig/netmeetingpreferences.cpp netmeeting/netmeetingpreferences.cpp ---- kopete-0.12.1/kopete/plugins/netmeeting.orig/netmeetingpreferences.cpp 2006-07-18 16:30:54.000000000 +0200 -+++ kopete-0.12.1/kopete/plugins/netmeeting/netmeetingpreferences.cpp 2006-07-18 16:04:51.000000000 +0200 -@@ -58,7 +58,7 @@ - { - KConfig *config=KGlobal::config(); - config->setGroup("Netmeeting Plugin"); -- preferencesDialog->m_app->setCurrentText(config->readEntry("NetmeetingApplication","gnomemeeting -c callto://%1")); -+ preferencesDialog->m_app->setCurrentText(config->readEntry("NetmeetingApplication","ekiga -c callto://%1")); - emit KCModule::changed(false); - } - -diff -ur kopete-0.12.1/kopete/plugins/netmeeting.orig/netmeetingprefs_ui.ui netmeeting/netmeetingprefs_ui.ui ---- kopete-0.12.1/kopete/plugins/netmeeting.orig/netmeetingprefs_ui.ui 2006-07-18 16:30:54.000000000 +0200 -+++ kopete-0.12.1/kopete/plugins/netmeeting/netmeetingprefs_ui.ui 2006-07-18 16:04:51.000000000 +0200 -@@ -63,7 +63,7 @@ - - - -- gnomemeeting -c callto://%1 -+ ekiga -c callto://%1 - - - diff --git a/kde-base/kopete/files/kdenetwork-3.5.5-linux-headers-2.6.18.patch b/kde-base/kopete/files/kdenetwork-3.5.5-linux-headers-2.6.18.patch deleted file mode 100644 index 30f2ee727..000000000 --- a/kde-base/kopete/files/kdenetwork-3.5.5-linux-headers-2.6.18.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- kopete/libkopete/avdevice/videodevice.h.orig 2006-10-17 14:34:13.000000000 +0200 -+++ kopete/libkopete/avdevice/videodevice.h 2006-10-17 14:37:00.000000000 +0200 -@@ -35,8 +35,8 @@ - - #if defined(__linux__) && defined(ENABLE_AV) - --#include - #undef __STRICT_ANSI__ -+#include - #ifndef __u64 //required by videodev.h - #define __u64 unsigned long long - #endif // __u64 ---- kopete/libkopete/avdevice/videoinput.h.orig 2006-10-17 14:38:43.000000000 +0200 -+++ kopete/libkopete/avdevice/videoinput.h 2006-10-17 14:39:50.000000000 +0200 -@@ -21,8 +21,8 @@ - #define KOPETE_AVVIDEOINPUT_H - - #ifdef __linux__ --#include - #undef __STRICT_ANSI__ -+#include - #endif // __linux__ - #ifndef __u64 //required by videodev.h - #define __u64 unsigned long long diff --git a/kde-base/kopete/files/kopete-0.12.1-icqfix3.patch b/kde-base/kopete/files/kopete-0.12.1-icqfix3.patch deleted file mode 100644 index ac786297e..000000000 --- a/kde-base/kopete/files/kopete-0.12.1-icqfix3.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: kopete/protocols/oscar/liboscar/oscartypes.h -=================================================================== ---- kopete/protocols/oscar/liboscar/oscartypes.h (revision 568242) -+++ kopete/protocols/oscar/liboscar/oscartypes.h (revision 568243) -@@ -239,7 +239,7 @@ - const WORD ICQ_MAJOR = 0x0014; - const WORD ICQ_MINOR = 0x0034; - const WORD ICQ_POINT = 0x0000; -- const WORD ICQ_BUILD = 0x0A0F; -+ const WORD ICQ_BUILD = 0x0BB8; - const char ICQ_OTHER[] = { 0x00, 0x00, 0x04, 0x3d }; - const char ICQ_COUNTRY[] = "us"; - const char ICQ_LANG[] = "en"; diff --git a/kde-base/kopete/files/kopete-0.12_alpha1-xscreensaver.patch b/kde-base/kopete/files/kopete-0.12_alpha1-xscreensaver.patch deleted file mode 100644 index 2052d30cb..000000000 --- a/kde-base/kopete/files/kopete-0.12_alpha1-xscreensaver.patch +++ /dev/null @@ -1,25 +0,0 @@ -Index: kopete-0.12-alpha1/kopete/libkopete/configure.in.in -=================================================================== ---- kopete-0.12-alpha1.orig/kopete/libkopete/configure.in.in -+++ kopete-0.12-alpha1/kopete/libkopete/configure.in.in -@@ -4,7 +4,11 @@ LDFLAGS="$X_LDFLAGS" - - LIB_XSS= - --KDE_CHECK_HEADER(X11/extensions/scrnsaver.h, -+AC_ARG_WITH([xscreensaver], -+ AC_HELP_STRING([--without-xscreensaver], [Disable XScreenSaver support (default: check)]) ) -+ -+if test "x$with_xscreensaver" != "xno"; then -+ KDE_CHECK_HEADER(X11/extensions/scrnsaver.h, - [ - AC_CHECK_LIB(Xext,XScreenSaverQueryInfo, - [ -@@ -27,6 +31,7 @@ KDE_CHECK_HEADER(X11/extensions/scrnsave - [ - #include - ] ) -+fi - - AC_SUBST(LIB_XSS) - LDFLAGS="$xss_save_ldflags" diff --git a/kde-base/kopete/files/kopete-3.5.3-icqfix.patch b/kde-base/kopete/files/kopete-3.5.3-icqfix.patch deleted file mode 100644 index 6370565cf..000000000 --- a/kde-base/kopete/files/kopete-3.5.3-icqfix.patch +++ /dev/null @@ -1,24 +0,0 @@ -Index: kopete/protocols/oscar/liboscar/oscartypes.h -=================================================================== ---- kopete/protocols/oscar/liboscar/oscartypes.h (revision 561015) -+++ kopete/protocols/oscar/liboscar/oscartypes.h (revision 561016) -@@ -232,13 +232,13 @@ - - /* ICQ Version Characteristics */ - const unsigned char ICQ_TCP_VERSION = 0x0008; -- const char ICQ_CLIENTSTRING[] = "ICQ Inc. - Product of ICQ (TM).2003a.5.45.1.3777.85"; -+ const char ICQ_CLIENTSTRING[] = "ICQBasic"; - const WORD ICQ_CLIENTID = 0x010A; -- const WORD ICQ_MAJOR = 0x0005; -- const WORD ICQ_MINOR = 0x002D; -- const WORD ICQ_POINT = 0x0001; -- const WORD ICQ_BUILD = 0x0EC1; -- const char ICQ_OTHER[] = { 0x00, 0x00, 0x00, 0x55 }; -+ const WORD ICQ_MAJOR = 0x0014; -+ const WORD ICQ_MINOR = 0x0034; -+ const WORD ICQ_POINT = 0x0000; -+ const WORD ICQ_BUILD = 0x0A0F; -+ const char ICQ_OTHER[] = { 0x00, 0x00, 0x04, 0x3d }; - const char ICQ_COUNTRY[] = "us"; - const char ICQ_LANG[] = "en"; - diff --git a/kde-base/kopete/files/kopete-3.5.5-icqfix.patch b/kde-base/kopete/files/kopete-3.5.5-icqfix.patch deleted file mode 100644 index 4aa3f2759..000000000 --- a/kde-base/kopete/files/kopete-3.5.5-icqfix.patch +++ /dev/null @@ -1,12 +0,0 @@ -Index: kdenetwork-3.5.5/kopete/protocols/oscar/liboscar/client.cpp -=================================================================== ---- kdenetwork-3.5.5.orig/kopete/protocols/oscar/liboscar/client.cpp -+++ kdenetwork-3.5.5/kopete/protocols/oscar/liboscar/client.cpp -@@ -340,6 +340,7 @@ void Client::lt_loginFinished() - //we've finished logging in. start the services setup - kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "stage two done. setting up services" << endl; - initializeStaticTasks(); -+ d->ownStatusTask->go(); - ServiceSetupTask* ssTask = new ServiceSetupTask( d->connections.defaultConnection()->rootTask() ); - connect( ssTask, SIGNAL( finished() ), this, SLOT( serviceSetupFinished() ) ); - ssTask->go( true ); //fire and forget diff --git a/kde-base/kopete/files/kopete-3.5.5-status-visibility.patch b/kde-base/kopete/files/kopete-3.5.5-status-visibility.patch deleted file mode 100644 index e3c09008a..000000000 --- a/kde-base/kopete/files/kopete-3.5.5-status-visibility.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- kopete-3.5.5/kopete/libkopete/kopeteonlinestatusmanager.h.orig 2006-12-15 23:33:46.000000000 -0800 -+++ kopete-3.5.5/kopete/libkopete/kopeteonlinestatusmanager.h 2006-12-15 23:34:33.000000000 -0800 -@@ -21,6 +21,7 @@ - #include - #include "kopeteonlinestatus.h" - #include "kaction.h" -+#include "kopete_export.h" - - class QString; - class QPixmap; -@@ -38,7 +39,7 @@ - * - * @author Olivier Goffart - */ --class OnlineStatusManager : public QObject -+class KOPETE_EXPORT OnlineStatusManager : public QObject - { - Q_OBJECT - public: diff --git a/kde-base/kopete/files/kopete-3.5.x-oscarcontacts.patch b/kde-base/kopete/files/kopete-3.5.x-oscarcontacts.patch deleted file mode 100644 index 7ea35079f..000000000 --- a/kde-base/kopete/files/kopete-3.5.x-oscarcontacts.patch +++ /dev/null @@ -1,132 +0,0 @@ -http://bugs.gentoo.org/show_bug.cgi?id=141675 -http://bugs.kde.org/show_bug.cgi?id=104243 - -Index: kopete/protocols/oscar/liboscar/ssimanager.cpp -=================================================================== ---- kopete/protocols/oscar/liboscar/ssimanager.cpp (revision 565951) -+++ kopete/protocols/oscar/liboscar/ssimanager.cpp (working copy) -@@ -71,18 +71,65 @@ - while ( it != d->SSIList.end() && d->SSIList.count() > 0 ) - it = d->SSIList.remove( it ); - }; -+ -+ d->nextContactId = 0; -+ d->nextGroupId = 0; - } - - WORD SSIManager::nextContactId() - { -- d->nextContactId++; -- return d->nextContactId; -+ if ( d->nextContactId == 0 ) -+ d->nextContactId++; -+ -+ QValueList::const_iterator it, listEnd; -+ -+ for ( ; d->nextContactId < 0x8000; d->nextContactId++ ) -+ { -+ bool freeId = true; -+ listEnd = d->SSIList.end(); -+ for ( it = d->SSIList.begin(); it != listEnd; ++it ) -+ { -+ if ( ( *it ).bid() == d->nextContactId ) -+ { -+ freeId = false; -+ break; -+ } -+ } -+ -+ if ( freeId ) -+ return d->nextContactId; -+ } -+ -+ kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "No free id!" << endl; -+ return 0xFFFF; - } - - WORD SSIManager::nextGroupId() - { -- d->nextGroupId++; -- return d->nextGroupId; -+ if ( d->nextGroupId == 0 ) -+ d->nextGroupId++; -+ -+ QValueList::const_iterator it, listEnd; -+ -+ for ( ; d->nextGroupId < 0x8000; d->nextGroupId++ ) -+ { -+ bool freeId = true; -+ listEnd = d->SSIList.end(); -+ for ( it = d->SSIList.begin(); it != listEnd; ++it ) -+ { -+ if ( ( *it ).type() == ROSTER_GROUP && ( *it ).gid() == d->nextGroupId ) -+ { -+ freeId = false; -+ break; -+ } -+ } -+ -+ if ( freeId ) -+ return d->nextGroupId; -+ } -+ -+ kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "No free group id!" << endl; -+ return 0xFFFF; - } - - WORD SSIManager::numberOfItems() const -@@ -379,8 +426,6 @@ - if ( !group.name().isEmpty() ) //avoid the group with gid 0 and bid 0 - { // the group is really new - kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "Adding group '" << group.name() << "' to SSI list" << endl; -- if ( group.gid() > d->nextGroupId ) -- d->nextGroupId = group.gid(); - - d->SSIList.append( group ); - emit groupAdded( group ); -@@ -394,6 +439,10 @@ - QString groupName = group.name(); - kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Removing group " << group.name() << endl; - int remcount = d->SSIList.remove( group ); -+ -+ if ( d->nextGroupId > group.gid() ) -+ d->nextGroupId = group.gid(); -+ - if ( remcount == 0 ) - { - kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "No groups removed" << endl; -@@ -420,13 +469,6 @@ - - bool SSIManager::newContact( const Oscar::SSI& contact ) - { -- //what to validate? -- if ( contact.bid() > d->nextContactId ) -- { -- kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "Setting next contact ID to " << contact.bid() << endl; -- d->nextContactId = contact.bid(); -- } -- - if ( d->SSIList.findIndex( contact ) == -1 ) - { - kdDebug( OSCAR_RAW_DEBUG ) << k_funcinfo << "Adding contact '" << contact.name() << "' to SSI list" << endl; -@@ -443,6 +485,9 @@ - QString contactName = contact.name(); - int remcount = d->SSIList.remove( contact ); - -+ if ( d->nextContactId > contact.bid() ) -+ d->nextContactId = contact.bid(); -+ - if ( remcount == 0 ) - { - kdDebug(OSCAR_RAW_DEBUG) << k_funcinfo << "No contacts were removed." << endl; -@@ -476,6 +521,10 @@ - bool SSIManager::removeItem( const Oscar::SSI& item ) - { - d->SSIList.remove( item ); -+ -+ if ( d->nextContactId > item.bid() ) -+ d->nextContactId = item.bid(); -+ - return true; - } - diff --git a/kde-base/kopete/kopete-3.5.5-r3.ebuild b/kde-base/kopete/kopete-3.5.5-r3.ebuild deleted file mode 100644 index 44e4f4dc8..000000000 --- a/kde-base/kopete/kopete-3.5.5-r3.ebuild +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kopete/kopete-3.5.5-r2.ebuild,v 1.13 2006/12/29 19:30:58 flameeyes Exp $ - -KMNAME=kdenetwork -MAXKDEVER=$PV -KM_DEPRANGE="3.5.0 $MAXKDEVER" -inherit kde-meta eutils - -SRC_URI="${SRC_URI} - mirror://gentoo/kdenetwork-3.5-patchset-01.tar.bz2" - -DESCRIPTION="KDE multi-protocol IM client" -HOMEPAGE="http://kopete.kde.org/" - -KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~x86-fbsd" -IUSE="jingle sametime ssl xscreensaver slp kernel_linux latex crypt - winpopup sms irc yahoo gadu groupwise netmeeting statistics autoreplace - connectionstatus contactnotes translator webpresence texteffect highlight - alias autoreplace history nowlistening addbookmarks kdehiddenvisibility" - -# The kernel_linux? ( ) conditional dependencies are for webcams, not supported -# on other kernels AFAIK -BOTH_DEPEND="dev-libs/libxslt - dev-libs/libxml2 - net-dns/libidn - >=dev-libs/glib-2 - app-crypt/qca - sametime? ( =net-libs/meanwhile-1.0* ) - jingle? ( - >=media-libs/speex-1.1.6 - dev-libs/expat - ~net-libs/ortp-0.7.1 ) - || ( ( - x11-libs/libX11 - x11-libs/libXext - x11-libs/libXrender - xscreensaver? ( x11-libs/libXScrnSaver ) - ) - alsa-plugins-1.0.12.ebuild: - Remove pkg_postinst as it's not needed anymore. - -*alsa-plugins-1.0.12 (31 Aug 2006) - - 31 Aug 2006; Diego Pettenò - +files/alsa-plugins-1.0.12-automagic.patch, - -alsa-plugins-1.0.12_rc1.ebuild, -alsa-plugins-1.0.12_rc1-r1.ebuild, - +alsa-plugins-1.0.12.ebuild: - Version bump to latest version, and remove release candidate. - - 11 Aug 2006; Markus Rothe - alsa-plugins-1.0.12_rc1-r1.ebuild: - Added ~ppc64; bug #141727 - - 26 Jul 2006; Diego Pettenò - alsa-plugins-1.0.12_rc1.ebuild, alsa-plugins-1.0.12_rc1-r1.ebuild: - Require 1.0.12 alsa-lib, although upstream didn't change the requirements in - the configure file, it fails to build otherwise. - - 22 Jul 2006; Zaheer Abbas Merali - alsa-plugins-1.0.12_rc1-r1.ebuild: - mark ~x86 - -*alsa-plugins-1.0.12_rc1-r1 (17 Jul 2006) - - 17 Jul 2006; Diego Pettenò - +alsa-plugins-1.0.12_rc1-r1.ebuild: - Add support for PulseAudio plugin (by using polyp plugin as the new renamed - plugin isn't released yet), and debug useflag to disable asserts and other - debugging code. - -*alsa-plugins-1.0.12_rc1 (23 Jun 2006) - - 23 Jun 2006; Diego Pettenò - +files/alsa-plugins-1.0.12_rc1-automagic.patch, - +alsa-plugins-1.0.12_rc1.ebuild: - Version bump to 1.0.12_rc1 version. - - 01 May 2006; Joseph Jezak alsa-plugins-1.0.11.ebuild: - Marked ~ppc for bug #131082. - - 30 Apr 2006; Mark Loeser alsa-plugins-1.0.11.ebuild: - Marked ~x86; bug #131082 - - 26 Apr 2006; Gustavo Zacarias - alsa-plugins-1.0.11.ebuild: - ~sparc'ed wrt #131082 - - 24 Apr 2006; Markus Rothe alsa-plugins-1.0.11.ebuild: - Added ~ppc64; bug #131082 - -*alsa-plugins-1.0.11 (24 Apr 2006) - - 24 Apr 2006; Diego Pettenò - +files/alsa-plugins-1.0.11-automagic.patch, +metadata.xml, - +alsa-plugins-1.0.11.ebuild: - New package alsa-plugins, built from upstream's alsa-plugins tarball. - Features jack, resampling, a52 and other plugins. Supersedes - media-plugins/alsa-jack. - diff --git a/media-plugins/alsa-plugins/Manifest b/media-plugins/alsa-plugins/Manifest deleted file mode 100644 index 7c08e1abb..000000000 --- a/media-plugins/alsa-plugins/Manifest +++ /dev/null @@ -1,46 +0,0 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - -AUX alsa-plugins-1.0.11-automagic.patch 2387 RMD160 7ba1283bd2ac8c94b690db18ed80f2154df4e755 SHA1 fd6242d06959e20ecf4f69dabefd0f29e2fe192c SHA256 ce8a8a7de749167dce31008283045548077fc8a29704ab7742071e7deff87d39 -MD5 11501a02f6428eb443cb507593790efd files/alsa-plugins-1.0.11-automagic.patch 2387 -RMD160 7ba1283bd2ac8c94b690db18ed80f2154df4e755 files/alsa-plugins-1.0.11-automagic.patch 2387 -SHA256 ce8a8a7de749167dce31008283045548077fc8a29704ab7742071e7deff87d39 files/alsa-plugins-1.0.11-automagic.patch 2387 -AUX alsa-plugins-1.0.12-automagic.patch 2414 RMD160 bef06a60e3a97d3a672df70314113e7d35a159fc SHA1 93a44aa404869de2f6966a18b0b9f614e56dfdd1 SHA256 95d0bf84d68d2c8452b926d9dba4bf7a0c35c107b850d05dc78df6e9d7de29e0 -MD5 de22c1807fab5042d487c2c8c23d8198 files/alsa-plugins-1.0.12-automagic.patch 2414 -RMD160 bef06a60e3a97d3a672df70314113e7d35a159fc files/alsa-plugins-1.0.12-automagic.patch 2414 -SHA256 95d0bf84d68d2c8452b926d9dba4bf7a0c35c107b850d05dc78df6e9d7de29e0 files/alsa-plugins-1.0.12-automagic.patch 2414 -AUX alsa-plugins-1.0.12_rc1-automagic.patch 2414 RMD160 75c1c36c5d5165b020cd48ea17b0542ce24868a3 SHA1 5618f950e52d560e3be7c9cc2618553cc279cc65 SHA256 ccdd300d969676df8950543d74daf936f6de9abcf6cab816d67bb16d36b084f5 -MD5 446adb89a1a3a503fe7686afe7d1c05f files/alsa-plugins-1.0.12_rc1-automagic.patch 2414 -RMD160 75c1c36c5d5165b020cd48ea17b0542ce24868a3 files/alsa-plugins-1.0.12_rc1-automagic.patch 2414 -SHA256 ccdd300d969676df8950543d74daf936f6de9abcf6cab816d67bb16d36b084f5 files/alsa-plugins-1.0.12_rc1-automagic.patch 2414 -DIST alsa-plugins-1.0.11.tar.bz2 236440 RMD160 24a80f68467c9a3dae9ab8c27f8e826ac1dc7ab3 SHA1 1456255d25a848e433438a79bed7e82259fb5f29 SHA256 9aef5b1e7649c279ef69b41c556d65d0c74364f015f93ac99e33eb2a7db9b3fd -DIST alsa-plugins-1.0.12.tar.bz2 230159 RMD160 5d5c37c720f3399c185c503c4ba3ceb056796069 SHA1 477877f667f8add265038f8be01d6f3e732c59bb SHA256 ad78b94bdbff363a376ee94670f699174e4699432b45509faf8b68f65b2dfbf1 -EBUILD alsa-plugins-1.0.11.ebuild 1341 RMD160 25c81488cd3d86ba141b55aba71511ffad928067 SHA1 a62b4d84b1a190043f9c91be826584024d013fb9 SHA256 5d9119fa0a0f591d39a2eb47ab7dffc67aa98b87504cb48e978e85fadbde1525 -MD5 5dec3b375ceeb6926710e4b0850c5427 alsa-plugins-1.0.11.ebuild 1341 -RMD160 25c81488cd3d86ba141b55aba71511ffad928067 alsa-plugins-1.0.11.ebuild 1341 -SHA256 5d9119fa0a0f591d39a2eb47ab7dffc67aa98b87504cb48e978e85fadbde1525 alsa-plugins-1.0.11.ebuild 1341 -EBUILD alsa-plugins-1.0.12.ebuild 1746 RMD160 fba4a922f117927580d9e5b691d3ed2ccbbb5662 SHA1 22300b157e3d1768b603bbb2ce6107bec6a75f2a SHA256 2873535d55928f885c7d605c424f9083e75b621e9fdfa463dc4ecd8dc00ba952 -MD5 a42408ca2ebf4c23bc1552899c836667 alsa-plugins-1.0.12.ebuild 1746 -RMD160 fba4a922f117927580d9e5b691d3ed2ccbbb5662 alsa-plugins-1.0.12.ebuild 1746 -SHA256 2873535d55928f885c7d605c424f9083e75b621e9fdfa463dc4ecd8dc00ba952 alsa-plugins-1.0.12.ebuild 1746 -MISC ChangeLog 2435 RMD160 601629ddd38a36ff8237ed5b491eb42e74c01dec SHA1 a2574e9aac2ac8df1cacf4f24b368f30c127587f SHA256 6c9eb0b0a51d9f240471f44182eda25b9ca1a63e322bd5b9e79fc562d1c44a63 -MD5 beee9c48f39699a5ea6d6f4f66571eb4 ChangeLog 2435 -RMD160 601629ddd38a36ff8237ed5b491eb42e74c01dec ChangeLog 2435 -SHA256 6c9eb0b0a51d9f240471f44182eda25b9ca1a63e322bd5b9e79fc562d1c44a63 ChangeLog 2435 -MISC metadata.xml 158 RMD160 6842e2189a50bd8a98e84802c38180ac1421c00e SHA1 703cea5a2109d41f7c87993c1f01d418a4c85174 SHA256 dfb5b47e6836db39fb187301dfcff1c2605e91d13d21db160806a563d8c75f9b -MD5 a1eaeb2ae801daeb712c90c060e922dc metadata.xml 158 -RMD160 6842e2189a50bd8a98e84802c38180ac1421c00e metadata.xml 158 -SHA256 dfb5b47e6836db39fb187301dfcff1c2605e91d13d21db160806a563d8c75f9b metadata.xml 158 -MD5 ded80bafcfd920d07f2d1aa8d4ecb641 files/digest-alsa-plugins-1.0.11 262 -RMD160 58b18ae79b53b9c3885678e5e55a10ecf2e10df6 files/digest-alsa-plugins-1.0.11 262 -SHA256 aa28b3c600c7b16d100e915875efb9d411f4ac44b3fe767f56bc93c21ee730c6 files/digest-alsa-plugins-1.0.11 262 -MD5 cd2445ca485b7a410acb1dc6bbc40b97 files/digest-alsa-plugins-1.0.12 262 -RMD160 9bff3b78defd87bc28d5ca1f9187fa6a32fcaa8e files/digest-alsa-plugins-1.0.12 262 -SHA256 ebcb5d36fd2e755142645b20f3ecdfae5e2b558db19e591c78243c6f20efcab5 files/digest-alsa-plugins-1.0.12 262 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.5 (GNU/Linux) - -iD8DBQFE9qobAiZjviIA2XgRAlIGAJ9imTiyGKQEQFmebXmE3rtxp2/OgACg2Kll -DmE/BEUjOYtxB/iNI73wQaE= -=9Rev ------END PGP SIGNATURE----- diff --git a/media-plugins/alsa-plugins/alsa-plugins-1.0.11.ebuild b/media-plugins/alsa-plugins/alsa-plugins-1.0.11.ebuild deleted file mode 100644 index 5ca096336..000000000 --- a/media-plugins/alsa-plugins/alsa-plugins-1.0.11.ebuild +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-plugins/alsa-plugins/alsa-plugins-1.0.11.ebuild,v 1.6 2006/07/03 01:28:25 vapier Exp $ - -inherit libtool autotools eutils - -DESCRIPTION="ALSA extra plugins" -HOMEPAGE="http://www.alsa-project.org/" -SRC_URI="mirror://alsaproject/plugins/${P}.tar.bz2" - -LICENSE="GPL-2 LGPL-2.1" -SLOT="0" -KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~sh ~sparc ~x86" -IUSE="jack ffmpeg libsamplerate" - -# It could support polypaudio if it was in portage -RDEPEND=">=media-libs/alsa-lib-1.0.11 - jack? ( >=media-sound/jack-audio-connection-kit-0.98 ) - ffmpeg? ( media-video/ffmpeg ) - libsamplerate? ( media-libs/libsamplerate ) - !media-plugins/alsa-jack" - -DEPEND="${RDEPEND} - dev-util/pkgconfig" - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}/${P}-automagic.patch" - eautoreconf - - elibtoolize -} - -src_compile() { - econf \ - $(use_enable jack) \ - $(use_enable libsamplerate samplerate) \ - $(use_enable ffmpeg avcodec) \ - --disable-polypaudio \ - --disable-dependency-tracking \ - || die "econf failed" - emake || die "emake failed" -} - -src_install() { - make DESTDIR="${D}" install - - cd "${S}/doc" - dodoc upmix.txt vdownmix.txt README-pcm-oss - use jack && dodoc README-jack - use libsamplerate && dodoc samplerate.txt -} - diff --git a/media-plugins/alsa-plugins/alsa-plugins-1.0.12.ebuild b/media-plugins/alsa-plugins/alsa-plugins-1.0.12.ebuild deleted file mode 100644 index f130b4de7..000000000 --- a/media-plugins/alsa-plugins/alsa-plugins-1.0.12.ebuild +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-plugins/alsa-plugins/alsa-plugins-1.0.12.ebuild,v 1.2 2006/08/31 09:21:22 flameeyes Exp $ - -inherit libtool autotools eutils flag-o-matic - -MY_P="${P/_/}" - -DESCRIPTION="ALSA extra plugins" -HOMEPAGE="http://www.alsa-project.org/" -SRC_URI="mirror://alsaproject/plugins/${MY_P}.tar.bz2" - -LICENSE="GPL-2 LGPL-2.1" -SLOT="0" -KEYWORDS="~amd64 ~ppc64 ~x86" -IUSE="jack ffmpeg libsamplerate pulseaudio debug" - -RDEPEND=">=media-libs/alsa-lib-1.0.12_rc1 - jack? ( >=media-sound/jack-audio-connection-kit-0.98 ) - ffmpeg? ( media-video/ffmpeg ) - libsamplerate? ( media-libs/libsamplerate ) - pulseaudio? ( media-sound/pulseaudio ) - !media-plugins/alsa-jack" - -DEPEND="${RDEPEND} - dev-util/pkgconfig" - -S="${WORKDIR}/${MY_P}" - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}/${P}-automagic.patch" - - # For some reasons the polyp/pulse plugin does fail with alsaplayer with a - # failed assert. As the code works just fine with asserts disabled, for now - # disable them waiting for a better solution. - sed -i -e '/AM_CFLAGS/s:-Wall:-DNDEBUG -Wall:' \ - "${S}/pulse/Makefile.am" - - eautoreconf - - elibtoolize -} - -src_compile() { - use debug || append-flags -DNDEBUG - econf \ - $(use_enable jack) \ - $(use_enable libsamplerate samplerate) \ - $(use_enable ffmpeg avcodec) \ - $(use_enable pulseaudio) \ - --disable-dependency-tracking \ - || die "econf failed" - emake || die "emake failed" -} - -src_install() { - emake DESTDIR="${D}" install - - cd "${S}/doc" - dodoc upmix.txt vdownmix.txt README-pcm-oss - use jack && dodoc README-jack - use libsamplerate && dodoc samplerate.txt - use pulseaudio && dodoc README-pulse -} diff --git a/media-plugins/alsa-plugins/files/alsa-plugins-1.0.11-automagic.patch b/media-plugins/alsa-plugins/files/alsa-plugins-1.0.11-automagic.patch deleted file mode 100644 index 30d540a54..000000000 --- a/media-plugins/alsa-plugins/files/alsa-plugins-1.0.11-automagic.patch +++ /dev/null @@ -1,52 +0,0 @@ -Index: alsa-plugins-1.0.11/configure.in -=================================================================== ---- alsa-plugins-1.0.11.orig/configure.in -+++ alsa-plugins-1.0.11/configure.in -@@ -13,15 +13,29 @@ PKG_CHECK_MODULES(ALSA, alsa >= 1.0.11) - AC_CHECK_LIB(asound, snd_pcm_ioplug_create,, - AC_ERROR([*** libasound has no external plugin SDK]), -ldl) - --PKG_CHECK_MODULES(JACK, jack >= 0.98, [HAVE_JACK=yes], [HAVE_JACK=no]) -+AC_ARG_ENABLE([jack], -+ AC_HELP_STRING([--disable-jack], [Disable building of JACK plugin])) -+if test "x$enable_jack" != "xno"; then -+ PKG_CHECK_MODULES(JACK, jack >= 0.98, [HAVE_JACK=yes], [HAVE_JACK=no]) -+fi - AM_CONDITIONAL(HAVE_JACK, test x$HAVE_JACK = xyes) - --PKG_CHECK_MODULES(polypaudio, [polyplib], [HAVE_POLYP=yes], [HAVE_POLYP=no]) -+AC_ARG_ENABLE([polypaudio], -+ AC_HELP_STRING([--disable-polypaudio], [Disable building of polypaudio plugin])) -+if test "x$enable_polypaudio" != "xno"; then -+ PKG_CHECK_MODULES(polypaudio, [polyplib], [HAVE_POLYP=yes], [HAVE_POLYP=no]) -+fi - AM_CONDITIONAL(HAVE_POLYP, test x$HAVE_POLYP = xyes) - --PKG_CHECK_MODULES(samplerate, [samplerate], [HAVE_SAMPLERATE=yes], [HAVE_SAMPLERATE=no]) -+AC_ARG_ENABLE([samplerate], -+ AC_HELP_STRING([--disable-samplerate], [Disable building of samplerate plugin])) -+if test "x$enable_samplerate" != "xno"; then -+ PKG_CHECK_MODULES(samplerate, [samplerate], [HAVE_SAMPLERATE=yes], [HAVE_SAMPLERATE=no]) -+fi - AM_CONDITIONAL(HAVE_SAMPLERATE, test x$HAVE_SAMPLERATE = xyes) - -+AC_ARG_ENABLE([avcodec], -+ AC_HELP_STRING([--disable-avcodec], [Disable building of avcodec code (a52 plugin)])) - AC_ARG_WITH([avcodec-includedir], - [--with-avcodec-includedir=dir AVcodec include directory], - [AVCODEC_CFLAGS="-I$withval"], [AVCODEC_CFLAGS=""]) -@@ -35,9 +49,11 @@ LDFLAGS="$LDFLAGS $AVCODEC_LIBS" - AC_SUBST(AVCODEC_CFLAGS) - AVCODEC_LIBS="$AVCODEC_LIBS -lavcodec" - AC_SUBST(AVCODEC_LIBS) --AC_CHECK_LIB([avcodec], [avcodec_open], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no]) --if test x$HAVE_AVCODEC = xyes; then -- AC_CHECK_HEADER([ffmpeg/avcodec.h], [], [HAVE_AVCODEC=no]) -+if test "x$enable_avcodec" != "xno"; then -+ AC_CHECK_LIB([avcodec], [avcodec_open], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no]) -+ if test x$HAVE_AVCODEC = xyes; then -+ AC_CHECK_HEADER([ffmpeg/avcodec.h], [], [HAVE_AVCODEC=no]) -+ fi - fi - AM_CONDITIONAL(HAVE_AVCODEC, test x$HAVE_AVCODEC = xyes) - CFLAGS="$CFLAGS_saved" diff --git a/media-plugins/alsa-plugins/files/alsa-plugins-1.0.12-automagic.patch b/media-plugins/alsa-plugins/files/alsa-plugins-1.0.12-automagic.patch deleted file mode 100644 index d1b380cba..000000000 --- a/media-plugins/alsa-plugins/files/alsa-plugins-1.0.12-automagic.patch +++ /dev/null @@ -1,52 +0,0 @@ -Index: alsa-plugins-1.0.12rc1/configure.in -=================================================================== ---- alsa-plugins-1.0.12rc1.orig/configure.in -+++ alsa-plugins-1.0.12rc1/configure.in -@@ -13,15 +13,29 @@ PKG_CHECK_MODULES(ALSA, alsa >= 1.0.11) - AC_CHECK_LIB(asound, snd_pcm_ioplug_create,, - AC_ERROR([*** libasound has no external plugin SDK]), -ldl) - --PKG_CHECK_MODULES(JACK, jack >= 0.98, [HAVE_JACK=yes], [HAVE_JACK=no]) -+AC_ARG_ENABLE([jack], -+ AC_HELP_STRING([--disable-jack], [Disable building of JACK plugin])) -+if test "x$enable_jack" != "xno"; then -+ PKG_CHECK_MODULES(JACK, jack >= 0.98, [HAVE_JACK=yes], [HAVE_JACK=no]) -+fi - AM_CONDITIONAL(HAVE_JACK, test x$HAVE_JACK = xyes) - --PKG_CHECK_MODULES(pulseaudio, [libpulse >= 0.9.2], [HAVE_PULSE=yes], [HAVE_PULSE=no]) -+AC_ARG_ENABLE([pulseaudio], -+ AC_HELP_STRING([--disable-pulseaudio], [Disable building of pulseaudio plugin])) -+if test "x$enable_pulseaudio" != "xno"; then -+ PKG_CHECK_MODULES(pulseaudio, [libpulse >= 0.9.2], [HAVE_PULSE=yes], [HAVE_PULSE=no]) -+fi - AM_CONDITIONAL(HAVE_PULSE, test x$HAVE_PULSE = xyes) - --PKG_CHECK_MODULES(samplerate, [samplerate], [HAVE_SAMPLERATE=yes], [HAVE_SAMPLERATE=no]) -+AC_ARG_ENABLE([samplerate], -+ AC_HELP_STRING([--disable-samplerate], [Disable building of samplerate plugin])) -+if test "x$enable_samplerate" != "xno"; then -+ PKG_CHECK_MODULES(samplerate, [samplerate], [HAVE_SAMPLERATE=yes], [HAVE_SAMPLERATE=no]) -+fi - AM_CONDITIONAL(HAVE_SAMPLERATE, test x$HAVE_SAMPLERATE = xyes) - -+AC_ARG_ENABLE([avcodec], -+ AC_HELP_STRING([--disable-avcodec], [Disable building of avcodec code (a52 plugin)])) - AC_ARG_WITH([avcodec-includedir], - [--with-avcodec-includedir=dir AVcodec include directory], - [AVCODEC_CFLAGS="-I$withval"], [AVCODEC_CFLAGS=""]) -@@ -35,9 +49,11 @@ LDFLAGS="$LDFLAGS $AVCODEC_LIBS" - AC_SUBST(AVCODEC_CFLAGS) - AVCODEC_LIBS="$AVCODEC_LIBS -lavcodec" - AC_SUBST(AVCODEC_LIBS) --AC_CHECK_LIB([avcodec], [avcodec_open], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no]) --if test x$HAVE_AVCODEC = xyes; then -- AC_CHECK_HEADER([ffmpeg/avcodec.h], [], [HAVE_AVCODEC=no]) -+if test "x$enable_avcodec" != "xno"; then -+ AC_CHECK_LIB([avcodec], [avcodec_open], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no]) -+ if test x$HAVE_AVCODEC = xyes; then -+ AC_CHECK_HEADER([ffmpeg/avcodec.h], [], [HAVE_AVCODEC=no]) -+ fi - fi - AM_CONDITIONAL(HAVE_AVCODEC, test x$HAVE_AVCODEC = xyes) - CFLAGS="$CFLAGS_saved" diff --git a/media-plugins/alsa-plugins/files/alsa-plugins-1.0.12_rc1-automagic.patch b/media-plugins/alsa-plugins/files/alsa-plugins-1.0.12_rc1-automagic.patch deleted file mode 100644 index daad8f054..000000000 --- a/media-plugins/alsa-plugins/files/alsa-plugins-1.0.12_rc1-automagic.patch +++ /dev/null @@ -1,52 +0,0 @@ -Index: alsa-plugins-1.0.12rc1/configure.in -=================================================================== ---- alsa-plugins-1.0.12rc1.orig/configure.in -+++ alsa-plugins-1.0.12rc1/configure.in -@@ -13,15 +13,29 @@ PKG_CHECK_MODULES(ALSA, alsa >= 1.0.11) - AC_CHECK_LIB(asound, snd_pcm_ioplug_create,, - AC_ERROR([*** libasound has no external plugin SDK]), -ldl) - --PKG_CHECK_MODULES(JACK, jack >= 0.98, [HAVE_JACK=yes], [HAVE_JACK=no]) -+AC_ARG_ENABLE([jack], -+ AC_HELP_STRING([--disable-jack], [Disable building of JACK plugin])) -+if test "x$enable_jack" != "xno"; then -+ PKG_CHECK_MODULES(JACK, jack >= 0.98, [HAVE_JACK=yes], [HAVE_JACK=no]) -+fi - AM_CONDITIONAL(HAVE_JACK, test x$HAVE_JACK = xyes) - --PKG_CHECK_MODULES(polypaudio, [polyplib >= 0.9.0], [HAVE_POLYP=yes], [HAVE_POLYP=no]) -+AC_ARG_ENABLE([polypaudio], -+ AC_HELP_STRING([--disable-polypaudio], [Disable building of polypaudio plugin])) -+if test "x$enable_polypaudio" != "xno"; then -+ PKG_CHECK_MODULES(polypaudio, [polyplib >= 0.9.0], [HAVE_POLYP=yes], [HAVE_POLYP=no]) -+fi - AM_CONDITIONAL(HAVE_POLYP, test x$HAVE_POLYP = xyes) - --PKG_CHECK_MODULES(samplerate, [samplerate], [HAVE_SAMPLERATE=yes], [HAVE_SAMPLERATE=no]) -+AC_ARG_ENABLE([samplerate], -+ AC_HELP_STRING([--disable-samplerate], [Disable building of samplerate plugin])) -+if test "x$enable_samplerate" != "xno"; then -+ PKG_CHECK_MODULES(samplerate, [samplerate], [HAVE_SAMPLERATE=yes], [HAVE_SAMPLERATE=no]) -+fi - AM_CONDITIONAL(HAVE_SAMPLERATE, test x$HAVE_SAMPLERATE = xyes) - -+AC_ARG_ENABLE([avcodec], -+ AC_HELP_STRING([--disable-avcodec], [Disable building of avcodec code (a52 plugin)])) - AC_ARG_WITH([avcodec-includedir], - [--with-avcodec-includedir=dir AVcodec include directory], - [AVCODEC_CFLAGS="-I$withval"], [AVCODEC_CFLAGS=""]) -@@ -35,9 +49,11 @@ LDFLAGS="$LDFLAGS $AVCODEC_LIBS" - AC_SUBST(AVCODEC_CFLAGS) - AVCODEC_LIBS="$AVCODEC_LIBS -lavcodec" - AC_SUBST(AVCODEC_LIBS) --AC_CHECK_LIB([avcodec], [avcodec_open], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no]) --if test x$HAVE_AVCODEC = xyes; then -- AC_CHECK_HEADER([ffmpeg/avcodec.h], [], [HAVE_AVCODEC=no]) -+if test "x$enable_avcodec" != "xno"; then -+ AC_CHECK_LIB([avcodec], [avcodec_open], [HAVE_AVCODEC=yes], [HAVE_AVCODEC=no]) -+ if test x$HAVE_AVCODEC = xyes; then -+ AC_CHECK_HEADER([ffmpeg/avcodec.h], [], [HAVE_AVCODEC=no]) -+ fi - fi - AM_CONDITIONAL(HAVE_AVCODEC, test x$HAVE_AVCODEC = xyes) - CFLAGS="$CFLAGS_saved" diff --git a/media-plugins/alsa-plugins/files/digest-alsa-plugins-1.0.11 b/media-plugins/alsa-plugins/files/digest-alsa-plugins-1.0.11 deleted file mode 100644 index 773e9e7d6..000000000 --- a/media-plugins/alsa-plugins/files/digest-alsa-plugins-1.0.11 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 4ca9ebb9f59b6d9bd85c904134a78305 alsa-plugins-1.0.11.tar.bz2 236440 -RMD160 24a80f68467c9a3dae9ab8c27f8e826ac1dc7ab3 alsa-plugins-1.0.11.tar.bz2 236440 -SHA256 9aef5b1e7649c279ef69b41c556d65d0c74364f015f93ac99e33eb2a7db9b3fd alsa-plugins-1.0.11.tar.bz2 236440 diff --git a/media-plugins/alsa-plugins/files/digest-alsa-plugins-1.0.12 b/media-plugins/alsa-plugins/files/digest-alsa-plugins-1.0.12 deleted file mode 100644 index 908265d64..000000000 --- a/media-plugins/alsa-plugins/files/digest-alsa-plugins-1.0.12 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 f64f0321292a240408bd7ea3e11871a3 alsa-plugins-1.0.12.tar.bz2 230159 -RMD160 5d5c37c720f3399c185c503c4ba3ceb056796069 alsa-plugins-1.0.12.tar.bz2 230159 -SHA256 ad78b94bdbff363a376ee94670f699174e4699432b45509faf8b68f65b2dfbf1 alsa-plugins-1.0.12.tar.bz2 230159 diff --git a/media-plugins/alsa-plugins/metadata.xml b/media-plugins/alsa-plugins/metadata.xml deleted file mode 100644 index e1774e3d9..000000000 --- a/media-plugins/alsa-plugins/metadata.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - -sound - diff --git a/media-sound/alsa-firmware/Manifest b/media-sound/alsa-firmware/Manifest deleted file mode 100644 index 82b57f5d9..000000000 --- a/media-sound/alsa-firmware/Manifest +++ /dev/null @@ -1,12 +0,0 @@ -AUX 52-usx2yaudio.rules 971 RMD160 c51a34d4134980b7a467e75b15ef397a8f802d67 SHA1 9f5d17a14ec139b4162f0f2be170242431569eab SHA256 8be6ac4630c1c31339b572333dc797b347b9f56a0d151f7055c5e7aff648d8d1 -MD5 f4ee4b0cd68883a84b087685193d354b files/52-usx2yaudio.rules 971 -RMD160 c51a34d4134980b7a467e75b15ef397a8f802d67 files/52-usx2yaudio.rules 971 -SHA256 8be6ac4630c1c31339b572333dc797b347b9f56a0d151f7055c5e7aff648d8d1 files/52-usx2yaudio.rules 971 -DIST alsa-firmware-1.0.14rc3.tar.bz2 3084751 RMD160 95215d31513b32e3827f7a31e7d9b299198892c8 SHA1 2bf80e10c7676f7d7eaeff6c37bb8829ca0809e9 SHA256 fb06386f2af507511f0ae20a2cc37b726d53c61c423de2ec3714386699cff7aa -EBUILD alsa-firmware-1.0.14_rc3.ebuild 748 RMD160 a89d358065a26aaa398217748c3a92b7d632cc02 SHA1 4f8d12a4f4b361ae0a42cf2749705b19738a14b6 SHA256 091fd842820bde96aa0d50e86c991f7b4488d6352d0ea69a03620017596f8c5d -MD5 856e93b24f8bafdd735d58a636c90a03 alsa-firmware-1.0.14_rc3.ebuild 748 -RMD160 a89d358065a26aaa398217748c3a92b7d632cc02 alsa-firmware-1.0.14_rc3.ebuild 748 -SHA256 091fd842820bde96aa0d50e86c991f7b4488d6352d0ea69a03620017596f8c5d alsa-firmware-1.0.14_rc3.ebuild 748 -MD5 872c8b89f2c481e4e05352434914c4fe files/digest-alsa-firmware-1.0.14_rc3 277 -RMD160 a890f62e64d0ae2bf9f44642caf6a0602f76458a files/digest-alsa-firmware-1.0.14_rc3 277 -SHA256 a4b76cc0e38604ba5b71d7a9afab14c918bd0ae7620a8cb4d3a181ab86674ef1 files/digest-alsa-firmware-1.0.14_rc3 277 diff --git a/media-sound/alsa-firmware/alsa-firmware-1.0.14_rc3.ebuild b/media-sound/alsa-firmware/alsa-firmware-1.0.14_rc3.ebuild deleted file mode 100644 index 97847aca7..000000000 --- a/media-sound/alsa-firmware/alsa-firmware-1.0.14_rc3.ebuild +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-firmware/alsa-firmware-1.0.14_rc2.ebuild,v 1.1 2007/01/16 22:55:20 flameeyes Exp $ - -MY_P="${P/_rc/rc}" - -DESCRIPTION="Advanced Linux Sound Architecture firmware" -HOMEPAGE="http://www.alsa-project.org/" -SRC_URI="mirror://alsaproject/firmware/${MY_P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" -IUSE="" - -S="${WORKDIR}/${MY_P}" - -DEPEND="" - -src_compile() { - econf \ - --with-hotplug-dir=/lib/firmware \ - || die "configure failed" - - emake || die "make failed" -} - -src_install () { - emake DESTDIR="${D}" install || die "make install failed" - dodoc README -} diff --git a/media-sound/alsa-firmware/files/52-usx2yaudio.rules b/media-sound/alsa-firmware/files/52-usx2yaudio.rules deleted file mode 100644 index 8765a02bb..000000000 --- a/media-sound/alsa-firmware/files/52-usx2yaudio.rules +++ /dev/null @@ -1,7 +0,0 @@ -# Load firmware via fxload - -SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="1604", SYSFS{idProduct}=="800[157]", RUN+="/usr/bin/usx2yloader" -SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="1604", SYSFS{idProduct}=="800[15]", RUN+="/sbin/startproc /usr/bin/us428control" -SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="1604", SYSFS{idProduct}=="8000", RUN+="/sbin/fxload -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us428fw.ihx -D %N" -SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="1604", SYSFS{idProduct}=="8004", RUN+="/sbin/fxload -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us224fw.ihx -D %N" -SUBSYSTEM=="usb_device", ACTION=="add", SYSFS{idVendor}=="1604", SYSFS{idProduct}=="8006", RUN+="/sbin/fxload -s /usr/share/alsa/firmware/usx2yloader/tascam_loader.ihx -I /usr/share/alsa/firmware/usx2yloader/us122fw.ihx -D %N" diff --git a/media-sound/alsa-firmware/files/digest-alsa-firmware-1.0.14_rc3 b/media-sound/alsa-firmware/files/digest-alsa-firmware-1.0.14_rc3 deleted file mode 100644 index e3b536e08..000000000 --- a/media-sound/alsa-firmware/files/digest-alsa-firmware-1.0.14_rc3 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 3afce47b4277e64c224411fa29ea150c alsa-firmware-1.0.14rc3.tar.bz2 3084751 -RMD160 95215d31513b32e3827f7a31e7d9b299198892c8 alsa-firmware-1.0.14rc3.tar.bz2 3084751 -SHA256 fb06386f2af507511f0ae20a2cc37b726d53c61c423de2ec3714386699cff7aa alsa-firmware-1.0.14rc3.tar.bz2 3084751 diff --git a/media-sound/alsa-headers/Manifest b/media-sound/alsa-headers/Manifest deleted file mode 100644 index ae4f5b828..000000000 --- a/media-sound/alsa-headers/Manifest +++ /dev/null @@ -1,12 +0,0 @@ -AUX alsa-headers-1.0.6a-user.patch 419 RMD160 a778185703b19cfe07b7c4578a10196fd9f9d5c0 SHA1 9f76087732817fc1d4a01ebf87e418269028b1ef SHA256 fbe9dfbbdfdf83b2c895a5d401cec13c16a490a03617419be701f167c38cab09 -MD5 6985658411b4e459ef8b03a25f480404 files/alsa-headers-1.0.6a-user.patch 419 -RMD160 a778185703b19cfe07b7c4578a10196fd9f9d5c0 files/alsa-headers-1.0.6a-user.patch 419 -SHA256 fbe9dfbbdfdf83b2c895a5d401cec13c16a490a03617419be701f167c38cab09 files/alsa-headers-1.0.6a-user.patch 419 -DIST alsa-driver-1.0.14rc3.tar.bz2 2528674 RMD160 10c8d191079e9d7bfb37c71cbc8a2c509fd6423b SHA1 71836d8b08083028d48ae6f4d6792f78cce69fb4 SHA256 b7b99936bb118c0b808a386795625946e04841d24758e4c61370165e50999fc1 -EBUILD alsa-headers-1.0.14_rc3.ebuild 1033 RMD160 da0135e4df1adcebd8a760096abaa09036dd7d90 SHA1 83df16ebb1ae52fb02217ef33cba9cd1862d8ed5 SHA256 bad2483a88742a7737b6dd9332e129bce33c17f1b7a4de4d8f8326e810e96942 -MD5 53d4b17121b31524e2b711847651ddc1 alsa-headers-1.0.14_rc3.ebuild 1033 -RMD160 da0135e4df1adcebd8a760096abaa09036dd7d90 alsa-headers-1.0.14_rc3.ebuild 1033 -SHA256 bad2483a88742a7737b6dd9332e129bce33c17f1b7a4de4d8f8326e810e96942 alsa-headers-1.0.14_rc3.ebuild 1033 -MD5 22d569e5fc052ab62ea76cfc4076f386 files/digest-alsa-headers-1.0.14_rc3 271 -RMD160 733a3c1dde2e1351ce5ea0eee3d463cdb5721196 files/digest-alsa-headers-1.0.14_rc3 271 -SHA256 4d00b45f4a13e2dd77d80cee737cb995f60d7870d98ac8e6cb845be2eb183ced files/digest-alsa-headers-1.0.14_rc3 271 diff --git a/media-sound/alsa-headers/alsa-headers-1.0.14_rc3.ebuild b/media-sound/alsa-headers/alsa-headers-1.0.14_rc3.ebuild deleted file mode 100644 index 7f02a73ba..000000000 --- a/media-sound/alsa-headers/alsa-headers-1.0.14_rc3.ebuild +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-headers/alsa-headers-1.0.14_rc2.ebuild,v 1.1 2007/01/16 22:55:12 flameeyes Exp $ - -inherit eutils - -MY_PN=${PN/headers/driver} -MY_P="${MY_PN}-${PV/_rc/rc}" -S=${WORKDIR}/${MY_P} - -DESCRIPTION="Header files for Advanced Linux Sound Architecture kernel modules" -HOMEPAGE="http://www.alsa-project.org/" -SRC_URI="mirror://alsaproject/driver/${MY_P}.tar.bz2" - -LICENSE="GPL-2 LGPL-2.1" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86" -IUSE="" - -DEPEND="" - -RESTRICT="binchecks strip" - -# Remove the sound symlink workaround... -pkg_setup() { - if [[ -L "${ROOT}/usr/include/sound" ]]; then - rm "${ROOT}/usr/include/sound" - fi -} - -src_unpack() { - unpack ${A} - - cd "${S}" - epatch "${FILESDIR}/${PN}-1.0.6a-user.patch" -} - -src_compile() { :; } - -src_install() { - cd "${S}/alsa-kernel/include" - insinto /usr/include/sound - doins *.h || die "include failed" -} diff --git a/media-sound/alsa-headers/files/alsa-headers-1.0.6a-user.patch b/media-sound/alsa-headers/files/alsa-headers-1.0.6a-user.patch deleted file mode 100644 index c1a4cf239..000000000 --- a/media-sound/alsa-headers/files/alsa-headers-1.0.6a-user.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -Naur alsa-driver-1.0.6a.orig/alsa-kernel/include/asound.h alsa-driver-1.0.6a/alsa-kernel/include/asound.h ---- alsa-driver-1.0.6a.orig/alsa-kernel/include/asound.h 2004-08-03 11:55:55.000000000 -0700 -+++ alsa-driver-1.0.6a/alsa-kernel/include/asound.h 2004-08-25 11:05:21.445603678 -0700 -@@ -63,6 +63,10 @@ - #include - #endif - -+#ifndef __user -+#define __user -+#endif -+ - /* - * protocol version - */ diff --git a/media-sound/alsa-headers/files/digest-alsa-headers-1.0.14_rc3 b/media-sound/alsa-headers/files/digest-alsa-headers-1.0.14_rc3 deleted file mode 100644 index b88500dd9..000000000 --- a/media-sound/alsa-headers/files/digest-alsa-headers-1.0.14_rc3 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 1f036274fd6cfc71202331460384f4ad alsa-driver-1.0.14rc3.tar.bz2 2528674 -RMD160 10c8d191079e9d7bfb37c71cbc8a2c509fd6423b alsa-driver-1.0.14rc3.tar.bz2 2528674 -SHA256 b7b99936bb118c0b808a386795625946e04841d24758e4c61370165e50999fc1 alsa-driver-1.0.14rc3.tar.bz2 2528674 diff --git a/media-sound/alsa-tools/Manifest b/media-sound/alsa-tools/Manifest deleted file mode 100644 index 7821ca400..000000000 --- a/media-sound/alsa-tools/Manifest +++ /dev/null @@ -1,12 +0,0 @@ -AUX alsa-tools-1.0.11-asneeded.patch 1845 RMD160 f1b3fa1fca50da0827beff8f87f514814d938833 SHA1 63a368a5d0e435f085e8d84ff7968bb1ac6e78f3 SHA256 95d69d5b9400818243806b643450f8b75e9411efa2acb8ad02e5063fea0de33c -MD5 f49f91697e8927971c5b0c65338eac5c files/alsa-tools-1.0.11-asneeded.patch 1845 -RMD160 f1b3fa1fca50da0827beff8f87f514814d938833 files/alsa-tools-1.0.11-asneeded.patch 1845 -SHA256 95d69d5b9400818243806b643450f8b75e9411efa2acb8ad02e5063fea0de33c files/alsa-tools-1.0.11-asneeded.patch 1845 -DIST alsa-tools-1.0.14rc3.tar.bz2 1468172 RMD160 f347d9caef402de79851129b8246b0dfe26e36b3 SHA1 60e4413a10f7445daf9da2eb5b5a8832f017d35d SHA256 b3bca8c0053c1b4225ea62e0ef88f2e93fe05914a4dcbed7578260f9edbb231f -EBUILD alsa-tools-1.0.14_rc3.ebuild 2555 RMD160 d56a39c292603a35f99deb9e05e45d9e4268c10c SHA1 4315c365ab343c95feda2c104cc2d7c196a4c704 SHA256 49fb940036f707963ff6b60718f7489e6f170c2eb28ac3a0aafe211abff9eb01 -MD5 a5bd1febf7a6b2f3e73d139d773edb30 alsa-tools-1.0.14_rc3.ebuild 2555 -RMD160 d56a39c292603a35f99deb9e05e45d9e4268c10c alsa-tools-1.0.14_rc3.ebuild 2555 -SHA256 49fb940036f707963ff6b60718f7489e6f170c2eb28ac3a0aafe211abff9eb01 alsa-tools-1.0.14_rc3.ebuild 2555 -MD5 b35fb46a316db3026d1c4ad3d92d9bf3 files/digest-alsa-tools-1.0.14_rc3 268 -RMD160 40dcd0e2627433753cdfcce6f23686fe037be76d files/digest-alsa-tools-1.0.14_rc3 268 -SHA256 9d048641dd0fcdd4f7f9851eaa34fdb93495723171ead64b9419084ad879bd24 files/digest-alsa-tools-1.0.14_rc3 268 diff --git a/media-sound/alsa-tools/alsa-tools-1.0.14_rc3.ebuild b/media-sound/alsa-tools/alsa-tools-1.0.14_rc3.ebuild deleted file mode 100644 index c82dca9de..000000000 --- a/media-sound/alsa-tools/alsa-tools-1.0.14_rc3.ebuild +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-tools/alsa-tools-1.0.14_rc1.ebuild,v 1.10 2007/02/11 23:34:58 blubb Exp $ - -WANT_AUTOMAKE="1.9" -WANT_AUTOCONF="2.5" - -inherit eutils flag-o-matic autotools - -MY_P="${P/_rc/rc}" - -DESCRIPTION="Advanced Linux Sound Architecture tools" -HOMEPAGE="http://www.alsa-project.org" -SRC_URI="mirror://alsaproject/tools/${MY_P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0.9" -KEYWORDS="amd64 ~ia64 ~mips ppc ppc64 sparc x86" -IUSE="fltk gtk midi" - -RDEPEND=">=media-libs/alsa-lib-1.0.0 - fltk? ( =x11-libs/fltk-1.1* ) - gtk? ( =x11-libs/gtk+-2* )" -DEPEND="${RDEPEND}" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - if use midi && ! built_with_use --missing true media-libs/alsa-lib midi; then - eerror "" - eerror "To be able to build ${CATEGORY}/${PN} with midi support you" - eerror "need to have built media-libs/alsa-lib with midi USE flag." - die "Missing midi USE flag on media-libs/alsa-lib" - fi - - ALSA_TOOLS="ac3dec as10k1 hdsploader mixartloader - sscape_ctl usx2yloader vxloader" - - use midi && ALSA_TOOLS="${ALSA_TOOLS} seq/sbiload us428control" - - use fltk && ALSA_TOOLS="${ALSA_TOOLS} hdspconf hdspmixer" - - use gtk && ALSA_TOOLS="${ALSA_TOOLS} echomixer rmedigicontrol" - use gtk && use midi && ALSA_TOOLS="${ALSA_TOOLS} envy24control" - - # sb16_csp won't build on ppc64 _AND_ ppc (and is not needed) - if use !ppc64 && use !ppc; then - ALSA_TOOLS="${ALSA_TOOLS} sb16_csp" - fi -} - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}/${PN}-1.0.11-asneeded.patch" - - for dir in echomixer envy24control rmedigicontrol; do - pushd ${dir} &> /dev/null - sed -i -e '/AM_PATH_GTK/d' configure.in - eautomake - popd &> /dev/null - done - - elibtoolize -} - -src_compile() { - if use fltk; then - # hdspmixer requires fltk - append-ldflags "-L/usr/$(get_libdir)/fltk-1.1" - append-flags "-I/usr/include/fltk-1.1" - fi - - # hdspmixer is missing depconf - copy from the hdsploader directory - cp ${S}/hdsploader/depcomp ${S}/hdspmixer/ - - local f - for f in ${ALSA_TOOLS} - do - cd "${S}/${f}" - econf --with-gtk2 || die "econf ${f} failed" - emake || die "emake ${f} failed" - done -} - -src_install() { - local f - for f in ${ALSA_TOOLS} - do - # Install the main stuff - cd "${S}/${f}" - emake DESTDIR="${D}" install || die - - # Install the text documentation - local doc - for doc in README TODO ChangeLog AUTHORS - do - if [ -f "${doc}" ] - then - mv "${doc}" "${doc}.`basename ${f}`" - dodoc "${doc}.`basename ${f}`" - fi - done - done -} diff --git a/media-sound/alsa-tools/files/alsa-tools-1.0.11-asneeded.patch b/media-sound/alsa-tools/files/alsa-tools-1.0.11-asneeded.patch deleted file mode 100644 index 60f34c543..000000000 --- a/media-sound/alsa-tools/files/alsa-tools-1.0.11-asneeded.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -ru alsa-tools-1.0.11-orig/echomixer/Makefile.am alsa-tools-1.0.11/echomixer/Makefile.am ---- alsa-tools-1.0.11-orig/echomixer/Makefile.am 2006-04-24 14:39:38.000000000 +0200 -+++ alsa-tools-1.0.11/echomixer/Makefile.am 2006-04-24 14:38:00.000000000 +0200 -@@ -2,7 +2,7 @@ - bin_PROGRAMS = echomixer - man_MANS = - echomixer_SOURCES = echomixer.c --echomixer_LDFLAGS = @ECHOMIXER_LIBS@ -+echomixer_LDADD = @ECHOMIXER_LIBS@ - EXTRA_DIST = configure.in-gtk1 configure.in-gtk2 - AUTOMAKE_OPTIONS = foreign - -diff -ru alsa-tools-1.0.11-orig/envy24control/Makefile.am alsa-tools-1.0.11/envy24control/Makefile.am ---- alsa-tools-1.0.11-orig/envy24control/Makefile.am 2006-04-24 14:39:14.000000000 +0200 -+++ alsa-tools-1.0.11/envy24control/Makefile.am 2006-04-24 14:43:16.000000000 +0200 -@@ -4,7 +4,7 @@ - envy24control_SOURCES = envy24control.c envy24control.h levelmeters.c midi.c \ - mixer.c patchbay.c hardware.c driverevents.c volume.c \ - profiles.c profiles.h midi.h config.c config.h --envy24control_LDFLAGS = @ENVY24CONTROL_LIBS@ -+envy24control_LDADD = @ENVY24CONTROL_LIBS@ - EXTRA_DIST = envy24control.1 depcomp configure.in-gtk1 configure.in-gtk2 \ - strstr_icase_blank.c new_process.c README.profiles - AUTOMAKE_OPTIONS = foreign -diff -ru alsa-tools-1.0.11-orig/rmedigicontrol/Makefile.am alsa-tools-1.0.11/rmedigicontrol/Makefile.am ---- alsa-tools-1.0.11-orig/rmedigicontrol/Makefile.am 2006-04-24 14:39:14.000000000 +0200 -+++ alsa-tools-1.0.11/rmedigicontrol/Makefile.am 2006-04-24 14:45:40.000000000 +0200 -@@ -2,7 +2,7 @@ - bin_PROGRAMS = rmedigicontrol - rmedigicontrol_SOURCES = rmedigicontrol.c rmedigicontrol.h level.c loopback.c - --rmedigicontrol_LDFLAGS = @RMEDIGICONTROL_LIBS@ -+rmedigicontrol_LDADD = @RMEDIGICONTROL_LIBS@ - - EXTRA_DIST = depcomp configure.in-gtk1 configure.in-gtk2 - AUTOMAKE_OPTIONS = foreign \ No newline at end of file diff --git a/media-sound/alsa-tools/files/digest-alsa-tools-1.0.14_rc3 b/media-sound/alsa-tools/files/digest-alsa-tools-1.0.14_rc3 deleted file mode 100644 index 64c0b7336..000000000 --- a/media-sound/alsa-tools/files/digest-alsa-tools-1.0.14_rc3 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 298e242a5f62cde05a4dc043af2035d4 alsa-tools-1.0.14rc3.tar.bz2 1468172 -RMD160 f347d9caef402de79851129b8246b0dfe26e36b3 alsa-tools-1.0.14rc3.tar.bz2 1468172 -SHA256 b3bca8c0053c1b4225ea62e0ef88f2e93fe05914a4dcbed7578260f9edbb231f alsa-tools-1.0.14rc3.tar.bz2 1468172 diff --git a/net-dialup/bewan-adsl/Manifest b/net-dialup/bewan-adsl/Manifest deleted file mode 100644 index 775f201ea..000000000 --- a/net-dialup/bewan-adsl/Manifest +++ /dev/null @@ -1,13 +0,0 @@ -AUX bewan-adsl-2.6.19.patch 3156 RMD160 d78a035b5ce2ab9379243002acba97b4eb2b84f5 SHA1 ad41820a3ec7cf72bfff5b97833827d9f3d7157b SHA256 559ddd28a75bff0a6df4301f038cee46e4f4cce0f0aaf504b20bae586e14c586 -MD5 6973477c3ab56ed62c63ab99e3740423 files/bewan-adsl-2.6.19.patch 3156 -RMD160 d78a035b5ce2ab9379243002acba97b4eb2b84f5 files/bewan-adsl-2.6.19.patch 3156 -SHA256 559ddd28a75bff0a6df4301f038cee46e4f4cce0f0aaf504b20bae586e14c586 files/bewan-adsl-2.6.19.patch 3156 -DIST A1012-A1006-A904-A888-A983-0.9.3.tgz 1176291 RMD160 50cd3201b05e931e541bd9a2dc4711c1ac044ec8 SHA1 977172f517e850f19029e3c6a0da07a7ca1e8269 SHA256 48a789f7ef026248a4a666ff5da952ef458d1a1ae7a7bc162a6d01e0ac38a954 -DIST bewan-adsl-0.9.3-patches-20061220.tar.gz 5098 RMD160 9f2f5b23439e544fa38b7e262a6ee75fc4353734 SHA1 a59292fc6d4c671a8c265033070b6f8f1e3ac243 SHA256 3b635749422c144234f7799b8c1398e344c8c1580b1fc061be7f27bb9cb843b2 -EBUILD bewan-adsl-0.9.3-r3.ebuild 3077 RMD160 b799ed1c312fddda95abdf243a5cfdef4fb0e605 SHA1 db4c23b55a07a8dc9423b880de9f96641971eca9 SHA256 d6c150c028f411064005c7746cb4c0207b9051c0c29823454a2e165e7a896dde -MD5 96aaf004cd9e5ee0f089a395370675fd bewan-adsl-0.9.3-r3.ebuild 3077 -RMD160 b799ed1c312fddda95abdf243a5cfdef4fb0e605 bewan-adsl-0.9.3-r3.ebuild 3077 -SHA256 d6c150c028f411064005c7746cb4c0207b9051c0c29823454a2e165e7a896dde bewan-adsl-0.9.3-r3.ebuild 3077 -MD5 f42af220d27842e90d0ca6c04e78fba6 files/digest-bewan-adsl-0.9.3-r3 587 -RMD160 8d70a438be48957e4e1ff3aef6c7a8fb4db3105c files/digest-bewan-adsl-0.9.3-r3 587 -SHA256 a9aa2ba82e3a1cfa157d114bd26ed41dcdf36a32b2d4fd6ecce93b9ac5921c1b files/digest-bewan-adsl-0.9.3-r3 587 diff --git a/net-dialup/bewan-adsl/bewan-adsl-0.9.3-r3.ebuild b/net-dialup/bewan-adsl/bewan-adsl-0.9.3-r3.ebuild deleted file mode 100644 index b7c377145..000000000 --- a/net-dialup/bewan-adsl/bewan-adsl-0.9.3-r3.ebuild +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/bewan-adsl/bewan-adsl-0.9.3-r2.ebuild,v 1.4 2006/12/20 19:33:17 mrness Exp $ - -inherit eutils linux-mod - -DESCRIPTION="Bewan ADSL PCI&USB st driver" -SRC_URI="http://www.bewan.com/bewan/drivers/A1012-A1006-A904-A888-A983-${PV}.tgz - mirror://gentoo/${P}-patches-20061220.tar.gz" -HOMEPAGE="http://www.bewan.com/" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86" -IUSE="usb pcitimer slowpcibridge kt400" - -DEPEND="virtual/linux-sources" -RDEPEND="" - -S="${WORKDIR}/unicorn" - -PCI_S="${S}/unicorn_pci" -USB_S="${S}/unicorn_usb" -BUILD_PARAMS="KERNEL_SOURCES=${KV_DIR} KVERS=${KV_FULL}" -BUILD_TARGETS="modules" -CONFIG_CHECK="ATM" -ATM_ERROR="This driver requires you to build your kernel with support for Asynchronous Transfer Mode (ATM)" - -pkg_setup() { - MODULE_NAMES="unicorn_pci_atm(extra:${PCI_S}) unicorn_pci_eth(extra:${PCI_S})" - use usb && MODULE_NAMES="${MODULE_NAMES} unicorn_usb_atm(extra:${USB_S}) unicorn_usb_eth(extra:${USB_S})" - - linux-mod_pkg_setup -} - -src_unpack() { - unpack ${A} - - cd "${S}" - # Fix "unresolved symbol set_cpus_allowed" on SMP kernels (#122103) - # Upstream consider actual version to be thread safe - epatch "${WORKDIR}/patches/${P}-smp.patch" - - local f - for f in msw/*.cpp amu/*.cpp ; do - mv ${f} ${f%pp} - done - epatch "${WORKDIR}/patches/${P}-kernel-changes.patch" - epatch "${WORKDIR}/patches/${P}-no-strip.patch" - - # 2.6.19 support - epatch ${FILESDIR}/${PN}-2.6.19.patch - - # Declare desired COPTIONS in the Makefile for the PCI module - use kt400 && sed -i 's/^\(COPTIONS *= *\)/\1 -DKT400/g' "${PCI_S}/Makefile" - use pcitimer && sed -i 's/^\(COPTIONS *= *\)/\1 -DUSE_HW_TIMER/g' "${PCI_S}/Makefile" - use slowpcibridge && sed -i 's/^\(COPTIONS *= *\)/\1 -DPCI_BRIDGE_WORKAROUND/g' "${PCI_S}/Makefile" - - # Fix up broken Makefiles - convert_to_m "${PCI_S}/Makefile" - use usb && convert_to_m "${USB_S}/Makefile" -} - -src_compile() { - einfo "Build common library" - cd "${S}/libm" - emake CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" || die - - einfo "Building tools" - cd "${S}/tools" - emake CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" - cd "${S}/unicorntest" - emake CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" - - linux-mod_src_compile -} - -src_install() { - linux-mod_src_install - - cd "${S}" - #Install tools - dodir /usr/bin - cd "${S}/tools" && einstall DESTDIR="${D}" prefix=/usr || \ - die "Cannot install tools" - cd "${S}/unicorntest" && einstall DESTDIR="${D}" prefix=/usr || \ - die "Cannot install unicorntest" - doman "${S}/Documentation/unicorntest.8" - - #Install documantation - cd "${S}" - dodoc README - docinto RFCs - dodoc RFCs/* - docinto scripts - dodoc scripts/* -} - -pkg_postinst() { - einfo "To load the driver do 'modprobe unicorn_atm' and 'modprobe unicorn_pci' " - einfo "and then do what you want with it (configure your pppd)" - einfo "OR" - einfo "it's time to look at the README file, the scripts directory gives you" - einfo "two comprehensive ways to load the driver, configure pppd and launch it." - - linux-mod_pkg_postinst -} diff --git a/net-dialup/bewan-adsl/files/bewan-adsl-2.6.19.patch b/net-dialup/bewan-adsl/files/bewan-adsl-2.6.19.patch deleted file mode 100644 index 849507c41..000000000 --- a/net-dialup/bewan-adsl/files/bewan-adsl-2.6.19.patch +++ /dev/null @@ -1,78 +0,0 @@ -diff -Nurp unicorn.orig/msw/fp_stubs.c unicorn/msw/fp_stubs.c ---- unicorn.orig/msw/fp_stubs.c 2006-12-25 19:29:05.000000000 +0100 -+++ unicorn/msw/fp_stubs.c 2006-12-25 19:33:27.000000000 +0100 -@@ -1,6 +1,8 @@ - #include - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) - # include -+#else -+# include - #endif - #if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS) - #define MODVERSIONS -diff -Nurp unicorn.orig/msw/linrapi.c unicorn/msw/linrapi.c ---- unicorn.orig/msw/linrapi.c 2006-12-25 19:29:05.000000000 +0100 -+++ unicorn/msw/linrapi.c 2006-12-25 19:32:56.000000000 +0100 -@@ -8,6 +8,8 @@ - #include - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) - # include -+#else -+# include - #endif - #if defined(CONFIG_MODVERSIONS) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) - #include -diff -Nurp unicorn.orig/unicorn_atm/unicorn_atmdrv.c unicorn/unicorn_atm/unicorn_atmdrv.c ---- unicorn.orig/unicorn_atm/unicorn_atmdrv.c 2006-12-25 19:29:05.000000000 +0100 -+++ unicorn/unicorn_atm/unicorn_atmdrv.c 2006-12-25 19:37:04.000000000 +0100 -@@ -7,6 +7,8 @@ - #include - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) - # include -+#else -+# include - #endif - #if defined(CONFIG_MODVERSIONS) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) - #include -diff -Nurp unicorn.orig/unicorn_eth/unicorn_ethdrv.c unicorn/unicorn_eth/unicorn_ethdrv.c ---- unicorn.orig/unicorn_eth/unicorn_ethdrv.c 2006-12-25 19:29:05.000000000 +0100 -+++ unicorn/unicorn_eth/unicorn_ethdrv.c 2006-12-25 19:37:23.000000000 +0100 -@@ -6,7 +6,9 @@ - */ - #include - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) --# include -+# include -+#else -+# include - #endif - #if defined(CONFIG_MODVERSIONS) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) - #include -diff -Nurp unicorn.orig/unicorn_pci/unicorn_pcidrv.c unicorn/unicorn_pci/unicorn_pcidrv.c ---- unicorn.orig/unicorn_pci/unicorn_pcidrv.c 2006-12-25 19:29:05.000000000 +0100 -+++ unicorn/unicorn_pci/unicorn_pcidrv.c 2006-12-25 19:37:37.000000000 +0100 -@@ -6,7 +6,9 @@ - */ - #include - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) --# include -+# include -+#else -+# include - #endif - #if defined(CONFIG_MODVERSIONS) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) - #include -diff -Nurp unicorn.orig/unicorn_usb/unicorn_usbdrv.c unicorn/unicorn_usb/unicorn_usbdrv.c ---- unicorn.orig/unicorn_usb/unicorn_usbdrv.c 2006-12-25 19:29:05.000000000 +0100 -+++ unicorn/unicorn_usb/unicorn_usbdrv.c 2006-12-25 19:37:48.000000000 +0100 -@@ -6,7 +6,9 @@ - */ - #include - #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) --# include -+# include -+#else -+# include - #endif - #if defined(CONFIG_MODVERSIONS) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)) - #include diff --git a/net-dialup/bewan-adsl/files/digest-bewan-adsl-0.9.3-r3 b/net-dialup/bewan-adsl/files/digest-bewan-adsl-0.9.3-r3 deleted file mode 100644 index fc52068c4..000000000 --- a/net-dialup/bewan-adsl/files/digest-bewan-adsl-0.9.3-r3 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 ff9829f03168279a079d05aea780ee99 A1012-A1006-A904-A888-A983-0.9.3.tgz 1176291 -RMD160 50cd3201b05e931e541bd9a2dc4711c1ac044ec8 A1012-A1006-A904-A888-A983-0.9.3.tgz 1176291 -SHA256 48a789f7ef026248a4a666ff5da952ef458d1a1ae7a7bc162a6d01e0ac38a954 A1012-A1006-A904-A888-A983-0.9.3.tgz 1176291 -MD5 9cc8152574e5493c0528bbff8c4ed7a4 bewan-adsl-0.9.3-patches-20061220.tar.gz 5098 -RMD160 9f2f5b23439e544fa38b7e262a6ee75fc4353734 bewan-adsl-0.9.3-patches-20061220.tar.gz 5098 -SHA256 3b635749422c144234f7799b8c1398e344c8c1580b1fc061be7f27bb9cb843b2 bewan-adsl-0.9.3-patches-20061220.tar.gz 5098 diff --git a/net-dialup/ltmodem/Manifest b/net-dialup/ltmodem/Manifest deleted file mode 100644 index b1eb3c904..000000000 --- a/net-dialup/ltmodem/Manifest +++ /dev/null @@ -1,29 +0,0 @@ -AUX 2.6.18-devfs.patch 337 RMD160 fd7dbd1a6732f77af5b6a1e8a02bd3db100bdf1b SHA1 de05e247243e522bd001a1acbf8a183ccc5d0f92 SHA256 9035e8c06341aa925e972853e553a4959b3a1e803dd667b8744663e2919320fb -MD5 213ebc51d987100433b820145b0d449a files/2.6.18-devfs.patch 337 -RMD160 fd7dbd1a6732f77af5b6a1e8a02bd3db100bdf1b files/2.6.18-devfs.patch 337 -SHA256 9035e8c06341aa925e972853e553a4959b3a1e803dd667b8744663e2919320fb files/2.6.18-devfs.patch 337 -AUX 2.6.19-config.h.patch 508 RMD160 06095047f60aa8c537b8e3b243ed6c808482a6f2 SHA1 f87d6a61617ed6e69017518d115de0bf714d775e SHA256 82360d97f5f1a89e19fd43d7b27c0bc228641a634fd8d5a6417a61f8fcfd46cb -MD5 056bd30ac4a6adaadab8659248599952 files/2.6.19-config.h.patch 508 -RMD160 06095047f60aa8c537b8e3b243ed6c808482a6f2 files/2.6.19-config.h.patch 508 -SHA256 82360d97f5f1a89e19fd43d7b27c0bc228641a634fd8d5a6417a61f8fcfd46cb files/2.6.19-config.h.patch 508 -AUX ltmodem-2.6-alk-8-module_param.patch 836 RMD160 a7a330f991dfb052561128608a19506846a65f2e SHA1 460721cc532945e61e050abf977e7464a4bd367c SHA256 6fa9d399f5532bd0d536662469a9123b70152d9f5d9cabafb525aef5cbd274ad -MD5 56e9b5e79f20ba5f7a02d87a0932da53 files/ltmodem-2.6-alk-8-module_param.patch 836 -RMD160 a7a330f991dfb052561128608a19506846a65f2e files/ltmodem-2.6-alk-8-module_param.patch 836 -SHA256 6fa9d399f5532bd0d536662469a9123b70152d9f5d9cabafb525aef5cbd274ad files/ltmodem-2.6-alk-8-module_param.patch 836 -AUX ltmodem_devfs 198 RMD160 7ee64ee62bb18124a4facd21bd76055fd4d8020d SHA1 d704f9fac0dbbcc9b5e6d0d9d430a59de8a02e41 SHA256 0ffed3039c0fa35e9f7b5a1c31c8dbf91d6ac3190c9df24aa2cd483ee001e0a1 -MD5 b990e7d5303c86f37ea21cf471d22e03 files/ltmodem_devfs 198 -RMD160 7ee64ee62bb18124a4facd21bd76055fd4d8020d files/ltmodem_devfs 198 -SHA256 0ffed3039c0fa35e9f7b5a1c31c8dbf91d6ac3190c9df24aa2cd483ee001e0a1 files/ltmodem_devfs 198 -AUX ltmodem_udev 183 RMD160 77fcc7ad359f1a80c63b8d3dbdd2a65c7375fb2b SHA1 6426b537c272e00aeb81616d278429e6f952dfbf SHA256 af14018c5c6e9fc6dcb87ef1abf737296354b8fb5cd59d773d723e3d46b9963c -MD5 a85667de05cc4032275068b1f636633a files/ltmodem_udev 183 -RMD160 77fcc7ad359f1a80c63b8d3dbdd2a65c7375fb2b files/ltmodem_udev 183 -SHA256 af14018c5c6e9fc6dcb87ef1abf737296354b8fb5cd59d773d723e3d46b9963c files/ltmodem_udev 183 -DIST ltmodem-2.6-alk-8.tar.bz2 436392 RMD160 20a1c41ea5cf836895ae6e2e43acacf45716e0aa SHA1 f150e3065584bf5b2aa913c433dc7efcd0a9dd2e SHA256 262c407471ccaafb7a6b0e7a3df41e37b1d1e6cdf34bd0e1567aac102cf277b6 -DIST ltmodem-8.31a10.tar.gz 580518 RMD160 0dfc43b700a3d806ed0d29e2d3470cc4679a2bb4 SHA1 c93437879f603b9922e882b309f365f3863f746b SHA256 877c10fb668e92d86cdc4eaf0d675047edbfb0654d74b092189a936212f62b10 -EBUILD ltmodem-8.31_alpha10-r5.ebuild 4062 RMD160 f61443e18ed101607d6f93eb4c15efe1bd1ece40 SHA1 00e4cff0d544b6a93b981679e7e96083d8438d22 SHA256 127215e35f78288bdedb7bda9f335403e5362b260e30df886b088f80ea694f74 -MD5 2c6989550d5073e2a1a91c3aca2640f5 ltmodem-8.31_alpha10-r5.ebuild 4062 -RMD160 f61443e18ed101607d6f93eb4c15efe1bd1ece40 ltmodem-8.31_alpha10-r5.ebuild 4062 -SHA256 127215e35f78288bdedb7bda9f335403e5362b260e30df886b088f80ea694f74 ltmodem-8.31_alpha10-r5.ebuild 4062 -MD5 953aea535f384008e6f92495cb13459d files/digest-ltmodem-8.31_alpha10-r5 503 -RMD160 5d46418bd85de3e040a27b24137321834499df54 files/digest-ltmodem-8.31_alpha10-r5 503 -SHA256 0047612953a721ec98fdafbbdcc15e4ddc34fe0e84085f001430219b0da705a6 files/digest-ltmodem-8.31_alpha10-r5 503 diff --git a/net-dialup/ltmodem/files/2.6.18-devfs.patch b/net-dialup/ltmodem/files/2.6.18-devfs.patch deleted file mode 100644 index 5a4066379..000000000 --- a/net-dialup/ltmodem/files/2.6.18-devfs.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- serial.c~ 2005-12-12 02:07:17.000000000 +0100 -+++ serial.c 2006-07-07 11:52:49.000000000 +0200 -@@ -729,10 +729,8 @@ - .owner = THIS_MODULE, - .driver_name = "ltserial", - #ifdef LT_USE_OLD_NAMES -- .devfs_name = "tts/LT", - .dev_name = "ttyLT", - #else -- .devfs_name = "tts/LTM", - .dev_name = "ttyLTM", - #endif - .major = 62, diff --git a/net-dialup/ltmodem/files/2.6.19-config.h.patch b/net-dialup/ltmodem/files/2.6.19-config.h.patch deleted file mode 100644 index 758b0ae84..000000000 --- a/net-dialup/ltmodem/files/2.6.19-config.h.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -Nurp ltmodem-2.6-alk-8.orig/serial.c ltmodem-2.6-alk-8/serial.c ---- ltmodem-2.6-alk-8.orig/serial.c 2006-12-25 02:13:23.000000000 +0100 -+++ ltmodem-2.6-alk-8/serial.c 2006-12-25 02:17:08.000000000 +0100 -@@ -99,7 +99,13 @@ MRS changes - */ - - #include --#include -+ -+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) -+ #include -+#else -+ #include -+#endif -+ - #include - #include - #include diff --git a/net-dialup/ltmodem/files/digest-ltmodem-8.31_alpha10-r5 b/net-dialup/ltmodem/files/digest-ltmodem-8.31_alpha10-r5 deleted file mode 100644 index b1eb38730..000000000 --- a/net-dialup/ltmodem/files/digest-ltmodem-8.31_alpha10-r5 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 0f7df8d31cf662a4afaa378fa5bf790b ltmodem-2.6-alk-8.tar.bz2 436392 -RMD160 20a1c41ea5cf836895ae6e2e43acacf45716e0aa ltmodem-2.6-alk-8.tar.bz2 436392 -SHA256 262c407471ccaafb7a6b0e7a3df41e37b1d1e6cdf34bd0e1567aac102cf277b6 ltmodem-2.6-alk-8.tar.bz2 436392 -MD5 1ca42e1f5622fbc5664920b5dd2146b7 ltmodem-8.31a10.tar.gz 580518 -RMD160 0dfc43b700a3d806ed0d29e2d3470cc4679a2bb4 ltmodem-8.31a10.tar.gz 580518 -SHA256 877c10fb668e92d86cdc4eaf0d675047edbfb0654d74b092189a936212f62b10 ltmodem-8.31a10.tar.gz 580518 diff --git a/net-dialup/ltmodem/files/ltmodem-2.6-alk-8-module_param.patch b/net-dialup/ltmodem/files/ltmodem-2.6-alk-8-module_param.patch deleted file mode 100644 index aae5f1e63..000000000 --- a/net-dialup/ltmodem/files/ltmodem-2.6-alk-8-module_param.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -Nru ltmodem-2.6-alk-8.orig/lt_modem.c ltmodem-2.6-alk-8/lt_modem.c ---- ltmodem-2.6-alk-8.orig/lt_modem.c 2005-12-12 03:18:55.000000000 +0200 -+++ ltmodem-2.6-alk-8/lt_modem.c 2006-04-19 21:43:32.142640500 +0300 -@@ -120,14 +120,14 @@ - static int vendor_id = 0; - static int device_id = 0; - --MODULE_PARM(vendor_id, "i"); -+module_param(vendor_id, int, 0); - MODULE_PARM_DESC(vendor_id, "Vendor ID of the Lucent Modem e.g. vendor_id=0x11c1"); --MODULE_PARM(device_id, "i"); -+module_param(device_id, int, 0); - MODULE_PARM_DESC(device_id, "Device ID of the Lucent Modem e.g. device_id=0x0440"); - - static int Forced[4] = {-1,-1,-1,0}; - --MODULE_PARM(Forced, "4i"); -+module_param_array(Forced, int, NULL, 0); - MODULE_PARM_DESC(Forced, "Forced Irq,BaseAddress,ComAddress[,NoDetect] of the Lucent Modem e.g. Forced=3,0x130,0x2f8"); - - static diff --git a/net-dialup/ltmodem/files/ltmodem_devfs b/net-dialup/ltmodem/files/ltmodem_devfs deleted file mode 100644 index b07d60a88..000000000 --- a/net-dialup/ltmodem/files/ltmodem_devfs +++ /dev/null @@ -1,5 +0,0 @@ - -# /dev/ttySLT0 and /dev/modem symbolic links to /dev/tts/LT0 -REGISTER ^tts/LT0$ CFUNCTION GLOBAL symlink $devname modem -UNREGISTER ^tts/LT0$ CFUNCTION GLOBAL unlink modem - diff --git a/net-dialup/ltmodem/files/ltmodem_udev b/net-dialup/ltmodem/files/ltmodem_udev deleted file mode 100644 index 7675ecc0c..000000000 --- a/net-dialup/ltmodem/files/ltmodem_udev +++ /dev/null @@ -1,5 +0,0 @@ -# -# UDEV rule for ltmodem -# creates symlink /dev/modem to /dev/ttyLT?, and takes care of permissions - -KERNEL=="ttyLTM[0-9]", NAME="%k", MODE="0660", GROUP="dialout", SYMLINK="modem" diff --git a/net-dialup/ltmodem/ltmodem-8.31_alpha10-r5.ebuild b/net-dialup/ltmodem/ltmodem-8.31_alpha10-r5.ebuild deleted file mode 100644 index 0864ae73a..000000000 --- a/net-dialup/ltmodem/ltmodem-8.31_alpha10-r5.ebuild +++ /dev/null @@ -1,146 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/ltmodem/ltmodem-8.31_alpha10-r3.ebuild,v 1.1 2006/09/09 11:00:31 mrness Exp $ - -inherit linux-mod eutils - -MY_P="${P/_alpha/a}" -MY_ALK_VER="2.6-alk-8" - -DESCRIPTION="Winmodems with Lucent Apollo (ISA) and Mars (PCI) chipsets" -HOMEPAGE="http://www.heby.de/ltmodem/" -SRC_URI="http://www.physcip.uni-stuttgart.de/heby/ltmodem/${MY_P}.tar.gz - http://www.sfu.ca/~cth/ltmodem/${MY_P}.tar.gz - http://linmodems.technion.ac.il/packages/ltmodem/kernel-2.6/ltmodem-${MY_ALK_VER}.tar.bz2" - -LICENSE="GPL-2" -KEYWORDS="x86" -IUSE="" - -RESTRICT="nouserpriv" - -S="${WORKDIR}/${PN}-${MY_ALK_VER}" -S_2_4="${WORKDIR}/${MY_P}" - -DEPEND="sys-apps/util-linux" - -BUILD_TARGETS="module" -BUILD_PARAMS="KERNEL_DIR='${KV_DIR}'" - -pkg_setup() { - if kernel_is 2 4; then - MODULE_NAMES="lt_modem(lt_modem:) lt_serial(lt_modem:)" - MODULESD_LTMODEM_ALIASES=( "char-major-62 lt_serial" - "/dev/tts/LT0 lt_serial" - "/dev/modem lt_serial" ) - CONFIG_CHECK="SERIAL" - SERIAL_8250_ERROR="This driver requires you to compile your kernel with serial core (CONFIG_SERIAL) support." - else - MODULE_NAMES="ltmodem(ltmodem:) ltserial(ltmodem:)" - MODULESD_LTMODEM_ALIASES=( "char-major-62 ltserial" - "/dev/tts/LT0 ltserial" - "/dev/modem ltserial" ) - CONFIG_CHECK="SERIAL_8250" - SERIAL_8250_ERROR="This driver requires you to compile your kernel with serial core (CONFIG_SERIAL_8250) support." - fi - linux-mod_pkg_setup -} - -src_unpack() { - unpack ${A} - epatch "${FILESDIR}/ltmodem-2.6-alk-8-module_param.patch" - convert_to_m "${S}/Makefile" - cd ${WORKDIR}/ltmodem-2.6-alk-8/ - epatch "${FILESDIR}/2.6.18-devfs.patch" - - # 2.6.19 support - cd ${WORKDIR} - epatch ${FILESDIR}/2.6.19-config.h.patch - -} - -src_compile() { - if kernel_is 2 4; then - cd "${S_2_4}" - sed -i -e 's:make -e:make:' -e 's:read -p:echo:' build_module - FAST="1" ./build_module ${KV_FULL} || die "Compilation filed" - else - linux-mod_src_compile - fi -} - -src_install() { - # install docs - cd "${S_2_4}/DOCs" - dohtml *.html - - rm -rf *.html Installers build* Build* gcc3.txt Examples Suse* - rm -rf fixscript* slackware srcprep.man scanmodem.man conf* - - rename .man .1 *.man - doman *.1 - rm -rf *.1 - - dodoc ../1ST-READ * - cd .. - - # install utilities - mv utils/unloading utils/lt_unloading - dosbin utils/lt_* - - # Add configuration for devfs, udev - if [ -e "${ROOT}/dev/.devfsd" ] ; then - insinto /etc/devfs.d/; newins "${FILESDIR}/ltmodem_devfs" ltmodem - elif [ -e "${ROOT}/dev/.udev" ] ; then - insinto /etc/udev/rules.d/; newins "${FILESDIR}/ltmodem_udev" 55-ltmodem.rules - fi - - # install kernel module - if kernel_is 2 4; then - cd source - make install "ROOTDIR=${D}" || die "Cannot install drivers" - else - linux-mod_src_install - fi -} - -pkg_postinst() { - linux-mod_pkg_postinst - - # Make some devices if we aren't using devfs - if [ -e "${ROOT}/dev/.devfsd" ]; then - ebegin "Restarting devfsd to reread devfs rules" - killall -HUP devfsd - eend $? - einfo "modules-update to complete configuration." - - einfo "Use /dev/tts/LT0 or /dev/ttyLT0 to access modem" - elif [ -e "${ROOT}/dev/.udev" ]; then - ebegin "Restarting udev to reread udev rules" - udevstart - eend $? - - einfo "Use /dev/ttyLTM0 to access modem" - else - mknod --mode=0660 /dev/ttyLTM0 c 62 64 && chgrp dialout /dev/ttyLTM0 - - einfo "Use /dev/ttyLTM0 to access modem" - fi - - echo - ewarn "Remember, in order to access the modem," - ewarn "you have to be in the 'dialout' group." - ewarn "Also, if your dialing application use locking mechanism (e.g wvdial)," - ewarn "you should have write access to /var/lock directory." - - if linux_chkconfig_present SMP ; then - echo - ewarn "Please note that Linux support for SMP (symmetric multi processor)" - ewarn "is reported to be incompatible with this driver!" - ewarn "In case it doesn't work, you should try first to disable CONFIG_SMP in your kernel." - fi - - echo - einfo "If you have problems, read this doc:" - einfo "/usr/share/doc/${PF}/html/post-install.html" -} diff --git a/net-misc/r1000/Manifest b/net-misc/r1000/Manifest deleted file mode 100644 index 6a302d9bb..000000000 --- a/net-misc/r1000/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -DIST r1000_v1.04.tgz 16323 RMD160 cd5d044eede8642ed8aa4b1fdf9f451f91c4536d SHA1 7cdcc39668469be706e1504ffcdf68c4d8d37376 SHA256 fbbd3bb268862c70397ecba68fb3e8d45937dad198d9e79b2383aceef8931feb -EBUILD r1000-1.04.ebuild 2179 RMD160 0b43ebb447fcb2e1db4c6263a18903112006342d SHA1 8f5521a86fe925fe3f395542ee348acce566f865 SHA256 e8b825a4bff05f8c3fc7c9055177cc49ebaf1b53a326a0868387fc0f13628330 -MD5 83f955ebab66d9f1ab2bd358e5a03b7e r1000-1.04.ebuild 2179 -RMD160 0b43ebb447fcb2e1db4c6263a18903112006342d r1000-1.04.ebuild 2179 -SHA256 e8b825a4bff05f8c3fc7c9055177cc49ebaf1b53a326a0868387fc0f13628330 r1000-1.04.ebuild 2179 -MD5 9bc3001efea8065ad31fec13ec5b0388 files/digest-r1000-1.04 223 -RMD160 757259b9b93659912527c7576977b1692919ca75 files/digest-r1000-1.04 223 -SHA256 7e2dc724fc180384a01f33ab9ddcda6f3e0ef682c53801e638917a8d1b4acb0b files/digest-r1000-1.04 223 diff --git a/net-misc/r1000/files/digest-r1000-1.04 b/net-misc/r1000/files/digest-r1000-1.04 deleted file mode 100644 index 1b6506788..000000000 --- a/net-misc/r1000/files/digest-r1000-1.04 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 95ffba4436fbb866a7e68809eac3bfb9 r1000_v1.04.tgz 16323 -RMD160 cd5d044eede8642ed8aa4b1fdf9f451f91c4536d r1000_v1.04.tgz 16323 -SHA256 fbbd3bb268862c70397ecba68fb3e8d45937dad198d9e79b2383aceef8931feb r1000_v1.04.tgz 16323 diff --git a/net-misc/r1000/r1000-1.04.ebuild b/net-misc/r1000/r1000-1.04.ebuild deleted file mode 100644 index 74c321fc0..000000000 --- a/net-misc/r1000/r1000-1.04.ebuild +++ /dev/null @@ -1,75 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: -# Ebuild grabbed from http://bugs.gentoo.org/show_bug.cgi?id=129216 - -inherit linux-mod - -DESCRIPTION="Drivers for the realtek 8168 gigabit ethernet chip" -HOMEPAGE="http://www.realtek.com.tw/downloads/downloads1-3.aspx?keyword=8168" -#SRC_URI="http://www.spillkescht.lu/david/linux-${PN}-${PV}.zip" -RESTRICT="mirror" -SRC_URI="ftp://202.65.194.18/cn/nic/${PN}_v${PV}.tgz" -#The 2 other mirrors: -#ftp://152.104.238.194/cn/nic/rtl8111brtl8168b/ -#ftp://210.51.181.211/cn/nic/rtl8111brtl8168b/ - -LICENSE="GPL" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -IUSE="" -# why there isn't any virtual depend atom like virtual/kernel-sources ?!?! -# everyone with other sources has to use --nodeps or rewrite the ebuild -# with a static DEPEND on sources... so disable this DEPEND ;) -# who uses this ebuild knows, that his sources should be <=2.6.16 ;) -#DEPEND="<=sys-kernel/gentoo-sources-2.6.16-r12" -DEPEND="" -RDEPEND="sys-apps/module-init-tools" # ;) - -BUILD_TARGETS="modules" - -S=${WORKDIR}/${PN}_v${PV}/ -MODULE_NAMES="r1000(kernel/net:${S}:${S}/src)" - -pkg_setup() { - linux-mod_pkg_setup - - BUILD_PARAMS="KSRC=${KV_DIR}" -} - -src_unpack() { - unpack ${A} - - # Fix for weird uname -r stuff in the Makefile - cd ${S}/src - echo ${KV_FULL} - sed -i 's/$(shell uname -r)/'${KV_FULL}'/' Makefile - - convert_to_m ${S}/src/Makefile - # FIX compilation bug when using 2.6.17 or newer kernel(sources) - #the MODULE_PARM function(2.4 kernels) is no longer supported - if [ ${KV_MINOR} -gt 5 ]; then - einfo "Change the sources to use module_param_array instead of MODULE_PARM(obsolete from 2.4)" - # unfortunately dosed is only usable in ${D}, not ${S} - local _tmp=${S}/src/r1000_n.c - mv ${_tmp} ${_tmp}.orig - sed -e 's:MODULE_PARM:module_param_array:' \ - -e 's:"1-" __MODULE_STRING(MAX_UNITS) "i":int, NULL, 0444:' \ - ${_tmp}.orig > ${_tmp} - rm ${_tmp}.orig - fi - -} - -src_install() { - linux-mod_src_install - dodoc README -} - -pkg_postinst() { - einfo "The in-kernel r8169 driver will support the hardware" - einfo "supported by r1000 very soon, so watch out when new kernel" - einfo "sources are released." -} - diff --git a/sci-biology/copasi/Manifest b/sci-biology/copasi/Manifest deleted file mode 100644 index d7cbaf486..000000000 --- a/sci-biology/copasi/Manifest +++ /dev/null @@ -1,12 +0,0 @@ -DIST copasi-4.0.18.tar.gz 7312443 RMD160 0a5555b97a20d63ea10c6bbaed6733b3f55a5706 SHA1 3d6ae16e9d86c7b67e67090b6ea07ebd36911047 SHA256 254f2719ee298f10d7304bb6cdc9434c172d8ece018113ea8a6f79eb8a6d35ec -EBUILD copasi-4.0.18.ebuild 987 RMD160 246d59b3fa708af4a2ad008214391085ea65290b SHA1 4e515c05e3a9b63c36e10777ff54acf378c131ea SHA256 94578b524eb0990be0ed11f9c19ac3a3f804d0a35c205e54bc6a666c7ccea8f3 -MD5 c7e3fc587454c3f2427cc096c145f3bd copasi-4.0.18.ebuild 987 -RMD160 246d59b3fa708af4a2ad008214391085ea65290b copasi-4.0.18.ebuild 987 -SHA256 94578b524eb0990be0ed11f9c19ac3a3f804d0a35c205e54bc6a666c7ccea8f3 copasi-4.0.18.ebuild 987 -MISC copasi-4.0.18.ebuild~ 987 RMD160 246d59b3fa708af4a2ad008214391085ea65290b SHA1 4e515c05e3a9b63c36e10777ff54acf378c131ea SHA256 94578b524eb0990be0ed11f9c19ac3a3f804d0a35c205e54bc6a666c7ccea8f3 -MD5 c7e3fc587454c3f2427cc096c145f3bd copasi-4.0.18.ebuild~ 987 -RMD160 246d59b3fa708af4a2ad008214391085ea65290b copasi-4.0.18.ebuild~ 987 -SHA256 94578b524eb0990be0ed11f9c19ac3a3f804d0a35c205e54bc6a666c7ccea8f3 copasi-4.0.18.ebuild~ 987 -MD5 2b111e9131c691eec109a1064696907d files/digest-copasi-4.0.18 244 -RMD160 7863977739063011f68b3fdbc26163371e5c3625 files/digest-copasi-4.0.18 244 -SHA256 30acfecf2026a8100ed86a379eac7b15a1b52457d7db9da2aacdbef526896426 files/digest-copasi-4.0.18 244 diff --git a/sci-biology/copasi/copasi-4.0.18.ebuild b/sci-biology/copasi/copasi-4.0.18.ebuild deleted file mode 100644 index f844ff13f..000000000 --- a/sci-biology/copasi/copasi-4.0.18.ebuild +++ /dev/null @@ -1,42 +0,0 @@ -## Ebuild by cvill64 of SabayonLinux ## - -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ -inherit eutils - -DESCRIPTION="Copasi is a software application for simulation and analysis of biochemical networks." -SRC_URI="http://sabayonlinuxdev.com/distfiles/sci-biology/${PN}-4.0.18.tar.gz" -HOMEPAGE="http://www.copasi.org" -GENTOO_MIRRORS="http://sabayonlinuxdev.com/distfiles/" -SLOT="0" -LICENSE="GPL-2" -KEYWORDS="~x86 ~amd64" -RDEPEND="${DEPEND} - >=glibc-2.3.6 - " -S=${WORKDIR}/${PN} -src_unpack() { - unpack ${A} - } - -src_compile() { - check_license ${S}/LICENSE - } - -src_install() { - - dodir /usr/share/copasi - cp -dPR ${S} ${D}/usr/share/ - dobin ${S}/bin/CopasiUI - dosym /usr/share/copasi /usr/bin/copasi - dodoc ${S}/doc/* - -# install to menu using eutils.eclass - doicon ${S}/icons/* - export COPASI=${D}/usr/share/copasi -} - -pkg_postinst() { - echo - einfo "http://www.copasi.org" - } \ No newline at end of file diff --git a/sci-biology/copasi/files/digest-copasi-4.0.18 b/sci-biology/copasi/files/digest-copasi-4.0.18 deleted file mode 100644 index fe31fe3ba..000000000 --- a/sci-biology/copasi/files/digest-copasi-4.0.18 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 280d021d321aaf6f85a208c5b5008a74 copasi-4.0.18.tar.gz 7312443 -RMD160 0a5555b97a20d63ea10c6bbaed6733b3f55a5706 copasi-4.0.18.tar.gz 7312443 -SHA256 254f2719ee298f10d7304bb6cdc9434c172d8ece018113ea8a6f79eb8a6d35ec copasi-4.0.18.tar.gz 7312443 diff --git a/sci-biology/xppaut/Manifest b/sci-biology/xppaut/Manifest deleted file mode 100644 index 193b42c0b..000000000 --- a/sci-biology/xppaut/Manifest +++ /dev/null @@ -1,12 +0,0 @@ -DIST xppaut-5.96.tar.gz 2838562 RMD160 b2e45e60b3769c47adf51d20b52f9460f45d1d90 SHA1 ff7ac87fc3cbd6685192dddbc96e4256870bd5e5 SHA256 278f05c15ef35fa472f85517d48a1f39a2b1237f2144e03c465d212026545208 -EBUILD xppaut-5.96.ebuild 779 RMD160 d0fc6497ab821bf753a5faf347346b164f645f5f SHA1 7766264c4d30505effdca0d7353a7fce92c486cf SHA256 ec8c1b99769d57c91be3389a9096023e05117b40d4e474230ecb9cc1b955fb02 -MD5 16809fb8232652b232d2c579360772a8 xppaut-5.96.ebuild 779 -RMD160 d0fc6497ab821bf753a5faf347346b164f645f5f xppaut-5.96.ebuild 779 -SHA256 ec8c1b99769d57c91be3389a9096023e05117b40d4e474230ecb9cc1b955fb02 xppaut-5.96.ebuild 779 -MISC xppaut-5.96.ebuild~ 777 RMD160 c5559034ed0f628ffbc54c3353c71b577189d94c SHA1 4dac1ff9e0bf145d93542774edf79cd689deaf7d SHA256 16a5f4342ff20fab46c2261bd67f09b3775f339f441809c895fe01f1e2b6eef0 -MD5 e3fe623bea9c18e47ee4992384a09afd xppaut-5.96.ebuild~ 777 -RMD160 c5559034ed0f628ffbc54c3353c71b577189d94c xppaut-5.96.ebuild~ 777 -SHA256 16a5f4342ff20fab46c2261bd67f09b3775f339f441809c895fe01f1e2b6eef0 xppaut-5.96.ebuild~ 777 -MD5 f4be5e458925bcd75fef7a0017c947ba files/digest-xppaut-5.96 238 -RMD160 b8c103a8b2788b8a2020cf89dbdd24a3efb1940f files/digest-xppaut-5.96 238 -SHA256 35c9a1bceafd0f770867846810fae0ea746f3880317bea7b07f0bb61dba2b0f5 files/digest-xppaut-5.96 238 diff --git a/sci-biology/xppaut/files/digest-xppaut-5.96 b/sci-biology/xppaut/files/digest-xppaut-5.96 deleted file mode 100644 index f927efac0..000000000 --- a/sci-biology/xppaut/files/digest-xppaut-5.96 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 53c865dae9b1fb6bf9d8e87fc9bedb5d xppaut-5.96.tar.gz 2838562 -RMD160 b2e45e60b3769c47adf51d20b52f9460f45d1d90 xppaut-5.96.tar.gz 2838562 -SHA256 278f05c15ef35fa472f85517d48a1f39a2b1237f2144e03c465d212026545208 xppaut-5.96.tar.gz 2838562 diff --git a/sci-biology/xppaut/xppaut-5.96.ebuild b/sci-biology/xppaut/xppaut-5.96.ebuild deleted file mode 100644 index 703c80f9a..000000000 --- a/sci-biology/xppaut/xppaut-5.96.ebuild +++ /dev/null @@ -1,33 +0,0 @@ -## Ebuild by cvill64 of SabayonLinux ## - -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ -inherit eutils - -DESCRIPTION="A GUI for ODE simulation and solving" -SRC_URI="http://sabayonlinuxdev.com/distfiles/sci-biology/xppaut-5.96.tar.gz" -HOMEPAGE="http://www.math.pitt.edu/~bard/xpp/xpp.html" -GENTOO_MIRRORS="http://sabayonlinuxdev.com/distfiles/" -SLOT="0" -LICENSE="GPL-2" -KEYWORDS="~x86 ~amd64" -RDEPEND="${DEPEND} - " -S=/var/tmp/portage/xppaut-5.96/work -D=/usr/bin/xppaut - -src_unpack() { - unpack ${A} - } - -src_compile() { - einfo "Nothing to compile" - } - -src_install() { - - cd ${S} - emake || die "make failed" - emake DESTDIR="${D}" install || die "install failed" - dodoc README xpp_doc.pdf LICENSE install.pdf -} diff --git a/sci-misc/emboss-kaptain/Manifest b/sci-misc/emboss-kaptain/Manifest deleted file mode 100644 index ce2404673..000000000 --- a/sci-misc/emboss-kaptain/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -DIST EMBOSS.kaptns_0.97.tar.gz 149263 RMD160 638c619bcc96bf093089c62d4d121636099711ee SHA1 8bb46bd72f3280ca8d5dbb0d27f06563fb5ade22 SHA256 53f08edfbd2b924657db69d66458b5ae07226e1570864680fc0d4257cd71a656 -EBUILD emboss-kaptain-0.97-r2.ebuild 2993 RMD160 ddb8d5cf62562c6f9ad1ec9a1754465f164e269b SHA1 a633e4fb0d8a4cee7b6680979a308d713a2cae10 SHA256 0a1b4e694293c89e9fd1acc091043cdf6189fe970aead09917b9e24f45bf824b -MD5 5e3896759c00a523986e20217d789a2c emboss-kaptain-0.97-r2.ebuild 2993 -RMD160 ddb8d5cf62562c6f9ad1ec9a1754465f164e269b emboss-kaptain-0.97-r2.ebuild 2993 -SHA256 0a1b4e694293c89e9fd1acc091043cdf6189fe970aead09917b9e24f45bf824b emboss-kaptain-0.97-r2.ebuild 2993 -MD5 a7ea5060193af38556e748d1883ca15a files/digest-emboss-kaptain-0.97-r2 256 -RMD160 e29640dd12c3409271538b69eab8767a5da8c672 files/digest-emboss-kaptain-0.97-r2 256 -SHA256 ce01f40d1566504d883e4612719f9db5dc4af23e0bdc32eaf801dec88a683721 files/digest-emboss-kaptain-0.97-r2 256 diff --git a/sci-misc/emboss-kaptain/emboss-kaptain-0.97-r2.ebuild b/sci-misc/emboss-kaptain/emboss-kaptain-0.97-r2.ebuild deleted file mode 100644 index f37aa4549..000000000 --- a/sci-misc/emboss-kaptain/emboss-kaptain-0.97-r2.ebuild +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-biology/emboss-kaptain/emboss-kaptain-0.97-r2.ebuild,v 1.1 2006/09/12 04:27:53 ribosome Exp $ - -DESCRIPTION="Graphical interfaces for EMBOSS and EMBASSY programs" -HOMEPAGE="http://userpage.fu-berlin.de/~sgmd/" -SRC_URI="http://genetik.fu-berlin.de/sgmd/EMBOSS.kaptns_${PV}.tar.gz" -LICENSE="GPL-1" - -SLOT="0" -KEYWORDS="~x86" -IUSE="" - -S="${WORKDIR}/EMBOSS.kaptns_${PV}" - -DEPEND="kde-misc/kaptain - app-editors/nedit - ~sci-biology/emboss-4.0.0 - ~sci-biology/embassy-phylipnew-3.6b - ~sci-biology/embassy-domainatrix-0.1.0" - -src_compile() { - einfo "Fixing nedit references:" - for i in *.kaptn; do - echo -e "\t${i}" - sed -e 's/nc -noask/neditc -noask/' \ - -e 's/nc -svrname/neditc -svrname/' -i ${i} || \ - die "Failed setting correct nedit executable in ${i}." - done - - einfo "Fixing PHYLIP references:" - for i in clique consense contml contrast dnacomp dnadist dnainvar dnaml dnamlk \ - dnapars dnapenny dollop dolpenny factor fitch gendist kitsch mix \ - neighbor penny protdist protpars restml seqboot ; do - echo -e "\t${i}" - mv e${i}.kaptn f${i}.kaptn || \ - die "Failed to rename PHYLIP grammar rules for ${i}." - sed -e "s/e${i}/f${i}/g" -e "s/E${i}/F${i}/g" -i f${i}.kaptn || \ - die "Failed to patch PHYLIP grammar rules for ${i}." - mv EMBOSS/Phylip/e${i}.desktop EMBOSS/Phylip/f${i}.desktop || \ - die "Failed to rename PHYLIP desktop file for ${i}." - sed -e "s/e${i}/f${i}/g" -e "s/E${i}/F${i}/g" -i EMBOSS/Phylip/f${i}.desktop \ - || die "Failed to patch PHYLIP desktop file for ${i}." - done - - einfo "Fixing drawtree references:" - for i in clique consense contml dnacomp dnaml dnamlk dnapars dnapenny dollop \ - dolpenny fitch kitsch mix neighbor penny protpars restml; do - echo -e "\t${i}" - sed -e "s/drawtree/treeprint/g" -i f${i}.kaptn || \ - die "Failed to fix drawtree refenrece in ${i}." - done - - einfo "Fixing desktop files:" - cd EMBOSS - for i in *; do - if [ -d "${i}" ]; then - echo -e "\t${i}" - cd "${S}"/EMBOSS/"${i}" - for j in *.desktop; do - sed -i -e 's%Exec=%Exec=kaptain /usr/share/emboss-kaptain/%' ${j} || \ - die "Failed setting shared files path in ${i}/${j}." - done - cd "${S}"/EMBOSS - fi - done - echo -e "\tDomainatrix" - cd "${S}"/Domainatrix/Domainatrix - for i in *.desktop; do - sed -i -e 's%Exec=%Exec=kaptain /usr/share/emboss-kaptain/%' ${i} || \ - die "Failed setting shared files path in Domainatrix/${i}." - done -} - -src_install() { - exeinto /usr/share/${PN} - doexe *.kaptn || die "Failed to install grammar rules." - doexe Domainatrix/*.kaptn || die "Failed to install Domainatrix grammar rules." - mkdir -p "${D}"/usr/share/applnk/EMBOSS/Domainatrix - cp -r EMBOSS/* ${D}/usr/share/applnk/EMBOSS || \ - die "Failed to install desktop files." - cp -r Domainatrix/Domainatrix/* ${D}/usr/share/applnk/EMBOSS/Domainatrix || \ - die "Failed to install Domainatrix desktop files." -} diff --git a/sci-misc/emboss-kaptain/files/digest-emboss-kaptain-0.97-r2 b/sci-misc/emboss-kaptain/files/digest-emboss-kaptain-0.97-r2 deleted file mode 100644 index e3c5e185b..000000000 --- a/sci-misc/emboss-kaptain/files/digest-emboss-kaptain-0.97-r2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 ebd469f76629503ced882811e8b4568b EMBOSS.kaptns_0.97.tar.gz 149263 -RMD160 638c619bcc96bf093089c62d4d121636099711ee EMBOSS.kaptns_0.97.tar.gz 149263 -SHA256 53f08edfbd2b924657db69d66458b5ae07226e1570864680fc0d4257cd71a656 EMBOSS.kaptns_0.97.tar.gz 149263 diff --git a/sys-apps/baselayout/Manifest b/sys-apps/baselayout/Manifest deleted file mode 100644 index 987897fba..000000000 --- a/sys-apps/baselayout/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -DIST baselayout-1.12.6.tar.bz2 221279 RMD160 4a9b6a0b3855e36a4b0214615d578e8d17dcabae SHA1 8164fe1923ccdf9d9e38ac0884e2bdd2061681e7 SHA256 c244469fa582c7733d2cf1b51865fac818beb8b2af60ec452ad147cb50eb8862 -EBUILD baselayout-1.12.6.ebuild 19713 RMD160 2a19aa08e7a497843b40d2678ba8695580e6f75f SHA1 c22ce50ef5c1cc3e72d75fae657dfdb9fee6c75c SHA256 c39675983cc1a94ddedb5822490cb3504230d8dad3df60d36f71e8d035b5d57a -MD5 bd19081e2814fc4989fb0648ba5fa709 baselayout-1.12.6.ebuild 19713 -RMD160 2a19aa08e7a497843b40d2678ba8695580e6f75f baselayout-1.12.6.ebuild 19713 -SHA256 c39675983cc1a94ddedb5822490cb3504230d8dad3df60d36f71e8d035b5d57a baselayout-1.12.6.ebuild 19713 -MD5 646df4c5861a383867d4188f27d8b7d0 files/digest-baselayout-1.12.6 256 -RMD160 19fbf407d2819bb6917b330252c1ed71cc0322bb files/digest-baselayout-1.12.6 256 -SHA256 7d0ed81c4a5f1131c77c84febb52dcb9949dcfd9ce3bbc18ad4299780c92c74b files/digest-baselayout-1.12.6 256 diff --git a/sys-apps/baselayout/baselayout-1.12.6.ebuild b/sys-apps/baselayout/baselayout-1.12.6.ebuild deleted file mode 100644 index 14738b7c1..000000000 --- a/sys-apps/baselayout/baselayout-1.12.6.ebuild +++ /dev/null @@ -1,616 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.12.6.ebuild,v 1.1 2006/11/02 10:29:25 uberlord Exp $ - -inherit flag-o-matic eutils toolchain-funcs multilib - -DESCRIPTION="Filesystem baselayout and init scripts" -HOMEPAGE="http://www.gentoo.org/" -SRC_URI="mirror://gentoo/${P}.tar.bz2 - http://dev.gentoo.org/~uberlord/baselayout/${P}.tar.bz2 - http://dev.gentoo.org/~azarah/baselayout/${P}.tar.bz2 - http://dev.gentoo.org/~vapier/dist/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86" -IUSE="bootstrap build static unicode" - -# This version of baselayout needs gawk in /bin, but as we do not have -# a c++ compiler during bootstrap, we cannot depend on it if "bootstrap" -# or "build" are in USE. -# We need to block old dhcpcd versions as they are no longer in system -# but may not be in users world file either. See bug #143885 -RDEPEND=">=sys-apps/sysvinit-2.86-r3 - !build? ( !bootstrap? ( - >=sys-libs/readline-5.0-r1 - >=app-shells/bash-3.1_p7 - >=sys-apps/coreutils-5.2.1 - ) ) - !> "${D}/usr/share/baselayout/mkdirs.sh" </dev/null \\ - || ewarn " can't create ${d}" - touch "\${ROOT}/${d}/.keep" 2>/dev/null \\ - || ewarn " can't create ${d}/.keep" -fi -EOF - else - args=("${args[@]}" "${d}") - fi - done -} - -# Continued from kdir above... This function removes any empty -# directories as a temporary workaround for bug 9849. The directories -# (and .keep files) are re-created in pkg_postinst, which means they -# aren't listed in CONTENTS, unfortunately. -unkdir() { - einfo "Running unkdir to workaround bug 9849" - find "${D}" -depth -type d -exec rmdir {} \; 2>/dev/null - if [[ $? == 127 ]]; then - ewarn "Problem running unkdir: find command not found" - fi -} - -# Same as kdir above, but for symlinks #103618 -ksym() { - echo "[[ ! -e ${ROOT}/$2 ]] && { ln -s '$1' '${ROOT}/$2' &> /dev/null || ewarn ' unable to symlink $2 to $1' ; }" \ - >> "${D}"/usr/share/baselayout/mklinks.sh -} - -src_install() { - local dir libdirs libdirs_env rcscripts_dir - - # This directory is to stash away things that will be used in - # pkg_postinst; it's needed first for kdir to function - dodir /usr/share/baselayout - - # Jeremy Huddleston - # For multilib, we want to make sure that all our multilibdirs exist - # and make lib even if it's not listed as one (like on amd64/ppc64 - # which sometimes has lib32/lib64 instead of lib/lib64). - # lib should NOT be a symlink to one of the other libdirs. - # Old systems with symlinks won't be affected by this change, as the - # symlinks already exist and won't get removed, but new systems will - # be setup properly. - # - # I'll be making a script to convert existing systems from symlink to - # nosymlink and putting it in /usr/portage/scripts. - libdirs=$(get_all_libdirs) - : ${libdirs:=lib} # it isn't that we don't trust multilib.eclass... - - # This should be /lib/rcscripts, but we have to support old profiles too. - if [[ ${SYMLINK_LIB} == "yes" ]]; then - rcscripts_dir="/$(get_abi_LIBDIR ${DEFAULT_ABI})/rcscripts" - else - rcscripts_dir="/lib/rcscripts" - fi - - einfo "Creating directories..." - kdir /usr - kdir /usr/local - kdir /boot - kdir /dev - kdir /dev/pts - kdir /dev/shm - kdir /etc/conf.d - kdir /etc/cron.daily - kdir /etc/cron.hourly - kdir /etc/cron.monthly - kdir /etc/cron.weekly - kdir /etc/env.d - dodir /etc/init.d # .keep file might mess up init.d stuff - kdir /etc/modules.autoload.d - kdir /etc/modules.d - kdir /etc/opt - kdir /home - kdir ${rcscripts_dir} - kdir ${rcscripts_dir}/awk - kdir ${rcscripts_dir}/sh - kdir ${rcscripts_dir}/net - # Only install /mnt stuff at bootstrap time #88835 / #90022 - if use build ; then - kdir /mnt - kdir -m 0700 /mnt/cdrom - kdir -m 0700 /mnt/floppy - fi - kdir /opt - kdir -o root -g uucp -m0775 /var/lock - kdir /proc - kdir -m 0700 /root - kdir /sbin - kdir /sys # for 2.6 kernels - kdir /usr/bin - kdir /usr/include - kdir /usr/include/asm - kdir /usr/include/linux - kdir /usr/local/bin - kdir /usr/local/games - kdir /usr/local/sbin - kdir /usr/local/share - kdir /usr/local/share/doc - kdir /usr/local/share/man - kdir /usr/local/src - kdir ${PORTDIR} - kdir /usr/sbin - kdir /usr/share/doc - kdir /usr/share/info - kdir /usr/share/man - kdir /usr/share/misc - kdir /usr/src - kdir -m 1777 /tmp - kdir /var - dodir /var/db/pkg # .keep file messes up Portage - kdir /var/lib/misc - kdir /var/lock/subsys - kdir /var/log/news - kdir /var/run - kdir /var/spool - kdir /var/state - kdir -m 1777 /var/tmp - - for dir in ${libdirs}; do - libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir} - [[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue - kdir /${dir} - kdir /usr/${dir} - kdir /usr/local/${dir} - done - - # Ugly compatibility with stupid ebuilds and old profiles symlinks - if [[ ${SYMLINK_LIB} == "yes" ]] ; then - rm -r "${D}"/{lib,usr/lib,usr/local/lib} &> /dev/null - ksym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib - ksym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib - ksym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib - fi - - kdir /lib/dev-state - kdir /lib/udev-state - - # FHS compatibility symlinks stuff - ksym /var/tmp /usr/tmp - ksym share/man /usr/local/man - - # - # Setup files in /etc - # - insopts -m0644 - insinto /etc - doins -r "${S}"/etc/* - fperms 0640 /etc/sysctl.conf - - # Install some files to /usr/share/baselayout instead of /etc to keep from - # (1) overwriting the user's settings, (2) screwing things up when - # attempting to merge files, (3) accidentally packaging up personal files - # with quickpkg - fperms 0600 /etc/shadow - mv "${D}"/etc/{passwd,shadow,group,fstab,hosts,issue.devfix} "${D}"/usr/share/baselayout - - # doinitd doesnt respect symlinks - dodir /etc/init.d - cp -P "${S}"/init.d/* "${D}"/etc/init.d/ || die "doinitd" - #doinitd "${S}"/init.d/* || die "doinitd" - doconfd "${S}"/etc/conf.d/* || die "doconfd" - doenvd "${S}"/etc/env.d/* || die "doenvd" - insinto /etc/modules.autoload.d - doins "${S}"/etc/modules.autoload.d/* - insinto /etc/modules.d - doins "${S}"/etc/modules.d/* - - # Special-case uglyness... For people updating from lib32 -> lib amd64 - # profiles, keep lib32 in the search path while it's around - if has_multilib_profile && [ -d /lib32 -o -d /usr/lib32 ] && ! hasq lib32 ${libdirs}; then - libdirs_env="${libdirs_env}:/lib32:/usr/lib32:/usr/local/lib32" - fi - - # List all the multilib libdirs in /etc/env/04multilib (only if they're - # actually different from the normal - if has_multilib_profile || [[ $(get_libdir) != "lib" || -n ${CONF_MULTILIBDIR} ]]; then - echo "LDPATH=\"${libdirs_env}\"" > ${D}/etc/env.d/04multilib - fi - - # As of baselayout-1.10-1-r1, sysvinit is its own package again, and - # provides the inittab itself - rm -f "${D}"/etc/inittab - - # Stash the rc-lists for use during pkg_postinst - cp -r "${S}"/rc-lists "${D}"/usr/share/baselayout - - # rc-scripts version for testing of features that *should* be present - echo "Gentoo Base System version ${PV}" > ${D}/etc/gentoo-release - - # - # Setup files related to /dev - # - into / - dosbin "${S}"/sbin/MAKEDEV - dosym ../../sbin/MAKEDEV /usr/sbin/MAKEDEV - dosym ../sbin/MAKEDEV /dev/MAKEDEV - - # - # Setup files in /bin - # - cd "${S}"/bin - dobin rc-status - - # - # Setup files in /sbin - # - cd "${S}"/sbin - into / - dosbin rc rc-update - # Need this in /sbin, as it could be run before - # /usr is mounted. - dosbin modules-update - # Compat symlinks until I can get things synced. - dosym modules-update /sbin/update-modules - dosym ../../sbin/modules-update /usr/sbin/update-modules - # These moved from /etc/init.d/ to /sbin to help newb systems - # from breaking - dosbin runscript.sh functions.sh - - # Compat symlinks between /etc/init.d and /sbin - # (some stuff have hardcoded paths) - dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh - dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh - dosym ../../sbin/functions.sh /etc/init.d/functions.sh - - # - # Setup files in /lib/rcscripts - # These are support files for other things in baselayout that needn't be - # under CONFIG_PROTECTed /etc - # - cd "${S}"/sbin - exeinto ${rcscripts_dir}/sh - doexe rc-services.sh rc-daemon.sh rc-help.sh - - # We can only install new, fast awk versions of scripts - # if 'build' or 'bootstrap' is not in USE. This will - # change if we have sys-apps/gawk-3.1.1-r1 or later in - # the build image ... - if ! use build; then - # This is for new depscan.sh and env-update.sh - # written in awk - cd "${S}"/sbin - into / - dosbin depscan.sh - dosbin env-update.sh - insinto ${rcscripts_dir}/awk - doins "${S}"/src/awk/*.awk - fi - - # Original design had these in /etc/net.modules.d but that is too - # problematic with CONFIG_PROTECT - dodir ${rcscripts_dir} - cp -pPR "${S}"/lib/rcscripts/net ${D}${rcscripts_dir} - chown -R root:0 ${D}${rcscripts_dir} - - # - # Install baselayout documentation - # - if ! use build ; then - doman "${S}"/man/*.* - docinto / - dodoc ${FILESDIR}/copyright - dodoc "${S}"/ChangeLog - fi - - # - # Install baselayout utilities - # - local libdir="lib" - [[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}") - - cd "${S}"/src - make DESTDIR="${D}" LIBDIR="${libdir}" install || die - - # Hack to fix bug 9849, continued in pkg_postinst - unkdir -} - -# Support function for remapping old wireless dns vars -remap_dns_vars() { - local f="$1" - - if [[ -f ${ROOT}/etc/conf.d/${f} ]]; then - sed -e 's/\ ${IMAGE}/etc/conf.d/${f} - fi -} - -pkg_preinst() { - if [[ -f ${ROOT}/etc/modules.autoload && \ - ! -d ${ROOT}/etc/modules.autoload.d ]]; then - mkdir -p ${ROOT}/etc/modules.autoload.d - mv -f ${ROOT}/etc/modules.autoload \ - ${ROOT}/etc/modules.autoload.d/kernel-2.4 - ln -snf modules.autoload.d/kernel-2.4 ${ROOT}/etc/modules.autoload - fi - - # Change some vars introduced in baselayout-1.11.0 before we go stable - # The new names make more sense and allow nis_domain - # for use in baselayout-1.12.0 - remap_dns_vars net - remap_dns_vars wireless -} - -pkg_postinst() { - local x y - - # Reincarnate dirs from kdir/unkdir (hack for bug 9849) - einfo "Creating directories and .keep files." - einfo "Some of these might fail if they're read-only mounted" - einfo "filesystems, for example /dev or /proc. That's okay!" - source "${ROOT}"/usr/share/baselayout/mkdirs.sh - source "${ROOT}"/usr/share/baselayout/mklinks.sh - echo - - # This could be done in src_install, which would have the benefit of - # (1) devices.tar.bz2 would show up in CONTENTS - # (2) binary installations would be faster... just untar the devices tarball - # instead of needing to run MAKEDEV - # However the most common cases are that people are either updating - # baselayout or installing from scratch. In the installation case, it's no - # different to have here instead of src_install. In the update case, we - # save a couple minutes time by refraining from building the unnecessary - # tarball. - if [[ ! -f "${ROOT}/lib/udev-state/devices.tar.bz2" ]]; then - # Create a directory in which to work - x=$(emktemp -d ${ROOT}/tmp/devnodes.XXXXXXXXX) \ - && cd "${x}" || die 'mktemp failed' - - # Create temp device nodes - echo - einfo "Making device node tarball (this could take a couple minutes)" - PATH=${ROOT}/sbin:${PATH} create_dev_nodes - - # Now create tarball that can also be used for udev. - # Need GNU tar for -j so call it by absolute path. - /bin/tar --one-file-system -cjpf "${ROOT}/lib/udev-state/devices.tar.bz2" * - rm -r * - cd .. - rmdir "${x}" - fi - - # We don't want to create devices if this is not a bootstrap and devfs - # is used, as this was the cause for all the devfs problems we had - if use build || use bootstrap; then - if [[ ! -e "${ROOT}/dev/.devfsd" && ! -e "${ROOT}/dev/.udev" ]]; then - einfo "Populating /dev with device nodes..." - cd ${ROOT}/dev || die - tar xjpf "${ROOT}/lib/udev-state/devices.tar.bz2" || die - fi - fi - - # Create /boot/boot symlink in pkg_postinst because sometimes - # /boot is a FAT filesystem. When that is the case, then the - # symlink will fail. Consequently, if we create it in - # src_install, then merge will fail. AFAIK there is no point to - # this symlink except for misconfigured grubs. See bug 50108 - # (05 May 2004 agriffis) - ln -sn . "${ROOT}"/boot/boot 2>/dev/null - - # Set up default runlevel symlinks - # This used to be done in src_install but required knowledge of ${ROOT}, - # which meant that it was effectively broken for binary installs. - if [[ -z $(/bin/ls "${ROOT}"/etc/runlevels 2>/dev/null) ]]; then - for x in boot default nonetwork single; do - einfo "Creating default runlevel symlinks for ${x}" - mkdir -p "${ROOT}"/etc/runlevels/${x} - for y in $(<"${ROOT}"/usr/share/baselayout/rc-lists/${x}); do - if [[ ! -e ${ROOT}/etc/init.d/${y} ]]; then - ewarn "init.d/${y} not found -- ignoring" - else - ln -sfn /etc/init.d/${y} \ - "${ROOT}"/etc/runlevels/${x}/${y} - fi - done - done - fi - - # Create /etc/hosts in pkg_postinst so we don't overwrite an - # existing file during bootstrap - if [[ ! -e ${ROOT}/etc/hosts ]]; then - cp ${ROOT}/usr/share/baselayout/hosts ${ROOT}/etc - fi - - # Touching /etc/passwd and /etc/shadow after install can be fatal, as many - # new users do not update them properly... see src_install() for why they - # are in /usr/share/baselayout/ - for x in passwd shadow group fstab ; do - if [[ -e ${ROOT}/etc/${x} ]] ; then - touch "${ROOT}/etc/${x}" - else - cp "${ROOT}/usr/share/baselayout/${x}" "${ROOT}/etc/${x}" - fi - done - - # Under what circumstances would mtab be a symlink? It would be - # nice if there were an explanatory comment here - if [[ -L ${ROOT}/etc/mtab ]]; then - rm -f "${ROOT}/etc/mtab" - if [[ ${ROOT} == / ]]; then - cp /proc/mounts "${ROOT}/etc/mtab" - else - touch "${ROOT}/etc/mtab" - fi - fi - - # We should only install empty files if these files don't already exist. - [[ -e ${ROOT}/var/log/lastlog ]] || \ - touch "${ROOT}/var/log/lastlog" - [[ -e ${ROOT}/var/run/utmp ]] || \ - install -m 0664 -g utmp /dev/null "${ROOT}/var/run/utmp" - [[ -e ${ROOT}/var/log/wtmp ]] || \ - install -m 0664 -g utmp /dev/null "${ROOT}/var/log/wtmp" - - # Reload init to fix unmounting problems of / on next reboot. - # This is really needed, as without the new version of init cause init - # not to quit properly on reboot, and causes a fsck of / on next reboot. - if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then - # Regenerate init.d dependency tree - /sbin/depscan.sh --update &>/dev/null - - # Regenerate /etc/modules.conf, else it will fail at next boot - einfo "Updating module dependencies..." - /sbin/modules-update force &>/dev/null - else - rm -f ${ROOT}/etc/modules.conf - fi - - # This is also written in src_install (so it's in CONTENTS), but - # write it here so that the new version is immediately in the file - # (without waiting for the user to do etc-update) - rm -f ${ROOT}/etc/._cfg????_gentoo-release - echo "Gentoo Base System version ${PV}" > ${ROOT}/etc/gentoo-release - - echo - einfo "Please be sure to update all pending '._cfg*' files in /etc," - einfo "else things might break at your next reboot! You can use 'etc-update'" - einfo "to accomplish this:" - einfo - einfo " # etc-update" - echo - - for f in ${ROOT}etc/init.d/net.* ; do - [[ -L ${f} || ${f} == "${ROOT}etc/init.d/net.lo" ]] && continue - echo - einfo "WARNING: You have older net.* files in ${ROOT}etc/init.d/" - einfo "They need to be converted to symlinks to net.lo. If you haven't" - einfo "made personal changes to those files, you can update with the" - einfo "following command:" - einfo - einfo " /bin/ls ${ROOT}etc/init.d/net.* | grep -v '/net.lo$' | xargs -n1 ln -sfvn net.lo" - echo - break - done - - if sed -e 's/#.*//' ${ROOT}/etc/conf.d/{net,wireless} 2>/dev/null \ - | egrep -q '\<(domain|nameservers|searchdomains)_' ; then - echo - ewarn "You have depreciated variables in ${ROOT}/etc/conf.d/net" - ewarn "or ${ROOT}/etc/conf.d/wireless" - ewarn - ewarn "domain_* -> dns_domain_*" - ewarn "nameservers_* -> dns_servers_*" - ewarn "searchdomains_* -> dns_search_domains_*" - ewarn - ewarn "They have been converted for you - ensure that you" - ewarn "update them via 'etc-update'" - echo - fi - - if sed -e 's/#.*//' ${ROOT}/etc/conf.d/net 2>/dev/null \ - | egrep -q '\<(iface_|gateway=|ifconfig_|aliases_|broadcasts_|netmasks_|inet6_|ipaddr_|iproute_)'; then - echo - ewarn "You are using deprecated variables in ${ROOT}/etc/conf.d/net" - ewarn - ewarn "You are advised to review the new configuration variables as" - ewarn "found in ${ROOT}/etc/conf.d/net.example as there is no" - ewarn "guarantee that they will work in future versions." - echo - fi - - # Remove old stuff that may cause problems. - if [[ -e "${ROOT}"/etc/env.d/01hostname ]] ; then - rm -f "${ROOT}"/etc/env.d/01hostname - fi - if [[ -e "${ROOT}"/etc/init.d/domainname ]] ; then - rm -f "${ROOT}"/etc/init.d/domainname - rm -f "${ROOT}"/etc/runlevels/*/domainname - ewarn "The domainname init script has been removed in this version." - ewarn "Consult ${ROOT}/etc/conf.d/net.example for details about how" - ewarn "to apply dns/nis information to the loopback interface." - fi -} diff --git a/sys-apps/baselayout/files/digest-baselayout-1.12.6 b/sys-apps/baselayout/files/digest-baselayout-1.12.6 deleted file mode 100644 index d8d3e5eab..000000000 --- a/sys-apps/baselayout/files/digest-baselayout-1.12.6 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 062ecbba57c9f6839b38034e48dd932d baselayout-1.12.6.tar.bz2 221279 -RMD160 4a9b6a0b3855e36a4b0214615d578e8d17dcabae baselayout-1.12.6.tar.bz2 221279 -SHA256 c244469fa582c7733d2cf1b51865fac818beb8b2af60ec452ad147cb50eb8862 baselayout-1.12.6.tar.bz2 221279 diff --git a/sys-apps/einit/Manifest b/sys-apps/einit/Manifest deleted file mode 100644 index 2c1886b61..000000000 --- a/sys-apps/einit/Manifest +++ /dev/null @@ -1,38 +0,0 @@ -DIST einit-0.14.0.500.tar.bz2 152982 RMD160 7e5ef06ce5cea3d8ffa44275e694f251d96b52e4 SHA1 75fe447a982443859ab70ce183396dfae0f4a999 SHA256 3fd504ae2a6c5a748ed7f5754b11af4dd3a83001b9f35f602defa3d91d62d246 -DIST einit-0.15.2.tar.bz2 226249 RMD160 3c54ecab00804537ee07df83657167562cbf4eab SHA1 815535d9e1738a902873aba5e1999eb7e5095ceb SHA256 81995896e2ffdeb9bd8726b4a44f8c8fa26c6ffde3732d431ec7e5178472e399 -DIST einit-0.16.0.tar.bz2 175555 RMD160 968b6c945609e840a1c25ae2e5b4b4a3364c95dd SHA1 f2616a67b47fd38912b7e40447a100428ba3b47f SHA256 5e101476122543cd8927bf48d9182deca50e280adb2c5117cd495ef2096dcbcb -EBUILD einit-0.14.0.500-r1.ebuild 1474 RMD160 2e4b793bdd0ef4b69ab25765b568cb4b8d2b2d2e SHA1 39bc2bc953a06297e26b8b799d453d19cc298342 SHA256 02fbac879c262938256c4385cf666310e56eb7270c928fd422ae3a1d344734f2 -MD5 3e360ef9f7ad1c876657b900ec21d3b9 einit-0.14.0.500-r1.ebuild 1474 -RMD160 2e4b793bdd0ef4b69ab25765b568cb4b8d2b2d2e einit-0.14.0.500-r1.ebuild 1474 -SHA256 02fbac879c262938256c4385cf666310e56eb7270c928fd422ae3a1d344734f2 einit-0.14.0.500-r1.ebuild 1474 -EBUILD einit-0.14.0.500.ebuild 1358 RMD160 27ed0e64c646d859b5c253cbaf63a7e2b71ed456 SHA1 ccdb9872602543998fae0b88b6f4010121fce5bf SHA256 9094051f71c09f15f80e3a33f430442985ecadde951a938abe8d9b1b60aab04f -MD5 b2b51ad40ee2006e20985efe6001142f einit-0.14.0.500.ebuild 1358 -RMD160 27ed0e64c646d859b5c253cbaf63a7e2b71ed456 einit-0.14.0.500.ebuild 1358 -SHA256 9094051f71c09f15f80e3a33f430442985ecadde951a938abe8d9b1b60aab04f einit-0.14.0.500.ebuild 1358 -EBUILD einit-0.15.2.ebuild 1474 RMD160 2e4b793bdd0ef4b69ab25765b568cb4b8d2b2d2e SHA1 39bc2bc953a06297e26b8b799d453d19cc298342 SHA256 02fbac879c262938256c4385cf666310e56eb7270c928fd422ae3a1d344734f2 -MD5 3e360ef9f7ad1c876657b900ec21d3b9 einit-0.15.2.ebuild 1474 -RMD160 2e4b793bdd0ef4b69ab25765b568cb4b8d2b2d2e einit-0.15.2.ebuild 1474 -SHA256 02fbac879c262938256c4385cf666310e56eb7270c928fd422ae3a1d344734f2 einit-0.15.2.ebuild 1474 -EBUILD einit-0.16.0.ebuild 1474 RMD160 2e4b793bdd0ef4b69ab25765b568cb4b8d2b2d2e SHA1 39bc2bc953a06297e26b8b799d453d19cc298342 SHA256 02fbac879c262938256c4385cf666310e56eb7270c928fd422ae3a1d344734f2 -MD5 3e360ef9f7ad1c876657b900ec21d3b9 einit-0.16.0.ebuild 1474 -RMD160 2e4b793bdd0ef4b69ab25765b568cb4b8d2b2d2e einit-0.16.0.ebuild 1474 -SHA256 02fbac879c262938256c4385cf666310e56eb7270c928fd422ae3a1d344734f2 einit-0.16.0.ebuild 1474 -EBUILD einit-9999.ebuild 1078 RMD160 4f370b5ca475342b53b4c92e0ca253d0d88b8684 SHA1 54315b215104e49461e22194ef0d1fea0704f5a4 SHA256 f35ce40ebdea93fe1eea8cf9f8df9f771e6a8a92492421d44ec8af89b1864096 -MD5 76d0b9a42b12b5ae34f289a8629111ab einit-9999.ebuild 1078 -RMD160 4f370b5ca475342b53b4c92e0ca253d0d88b8684 einit-9999.ebuild 1078 -SHA256 f35ce40ebdea93fe1eea8cf9f8df9f771e6a8a92492421d44ec8af89b1864096 einit-9999.ebuild 1078 -MD5 73a2d03732de5e1e5e7106f8fa1e752d files/digest-einit-0.14.0.500 253 -RMD160 17efdf09a55ac74f0b8d744f785bcffd56b163b6 files/digest-einit-0.14.0.500 253 -SHA256 64f3be2574d9e55576d98da3f64c95b05def3849ac6cd05f6d280228225c032c files/digest-einit-0.14.0.500 253 -MD5 73a2d03732de5e1e5e7106f8fa1e752d files/digest-einit-0.14.0.500-r1 253 -RMD160 17efdf09a55ac74f0b8d744f785bcffd56b163b6 files/digest-einit-0.14.0.500-r1 253 -SHA256 64f3be2574d9e55576d98da3f64c95b05def3849ac6cd05f6d280228225c032c files/digest-einit-0.14.0.500-r1 253 -MD5 707ea271c977d245749c2a090c7512ca files/digest-einit-0.15.2 241 -RMD160 4bf28beddc598e9e068e7b7df310eb6b11918f07 files/digest-einit-0.15.2 241 -SHA256 e94a5501e1c213aadb2dd2c37d681d4ec2de79fa6046223a2730134093cbec13 files/digest-einit-0.15.2 241 -MD5 09f04771ed6145d7808ad0a11eb86e92 files/digest-einit-0.16.0 241 -RMD160 61bff5124c1d42423b8a8e13e9eb610453ba50e9 files/digest-einit-0.16.0 241 -SHA256 9f5fb6e134f3070c962ad10d1169ba9c04ef260dd6a39deababb296b231a62e5 files/digest-einit-0.16.0 241 -MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-einit-9999 1 -RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-einit-9999 1 -SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-einit-9999 1 diff --git a/sys-apps/einit/einit-0.14.0.500-r1.ebuild b/sys-apps/einit/einit-0.14.0.500-r1.ebuild deleted file mode 100644 index 48ee92f8e..000000000 --- a/sys-apps/einit/einit-0.14.0.500-r1.ebuild +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit eutils flag-o-matic toolchain-funcs - -DESCRIPTION="eINIT - an alternate /sbin/init" -HOMEPAGE="http://einit.sourceforge.net/" -SRC_URI="mirror://sourceforge/einit/${P}.tar.bz2" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="doc efl" - -RDEPEND="dev-libs/expat - doc? ( app-text/docbook-sgml app-doc/doxygen ) - efl? ( media-libs/edje x11-libs/evas x11-libs/ecore )" -DEPEND="${RDEPEND}" -PDEPEND="" - -S=${WORKDIR}/einit-${PV} - -src_compile() { - local myconf - myconf="--enable-linux --use-posix-regex --prefix=${ROOT} --ebuild" - - if use efl ; then - myconf="${myconf} --enable-efl" - fi - - econf || die "Configure failed" - emake || die "Make failed" - - if use doc ; then - make documentation || die "Failed to make documentation" - fi -} - -src_install() { - emake -j1 install DESTDIR="${D}" || die "Installation died" - dodoc AUTHORS ChangeLog COPYING - if use doc ; then - dohtml build/documentation/html/* - fi -} - -pkg_postinst() { - - ebeep - einfo - einfo "The main (default) configuration file is" - einfo "/etc/einit/einit.xml, the file you should" - einfo "modify is /etc/einit/local.xml." - einfo "To use and finalize, you must ln -sf einit /sbin/init" - einfo "and you must modify grub or lilo and this" - einfo "takes the place of fstab too." - if use doc ; then - einfo "Please read the documentation provided at /usr/share/doc/einit-${PV}/html/" - fi - einfo - -} diff --git a/sys-apps/einit/einit-0.14.0.500.ebuild b/sys-apps/einit/einit-0.14.0.500.ebuild deleted file mode 100644 index bd946b987..000000000 --- a/sys-apps/einit/einit-0.14.0.500.ebuild +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit eutils flag-o-matic toolchain-funcs - -DESCRIPTION="eINIT - an alternate /sbin/init" -HOMEPAGE="http://einit.sourceforge.net/" -SRC_URI="mirror://sourceforge/einit/${P}.tar.bz2" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="doc efl" - -RDEPEND="dev-libs/expat - doc? ( app-text/docbook-sgml app-doc/doxygen )" -DEPEND="${RDEPEND}" -PDEPEND="" - -S=${WORKDIR}/einit-${PV} - -src_compile() { - local myconf - myconf="--enable-linux --use-posix-regex --prefix=${ROOT} --ebuild" - - if use efl ; then - myconf="${myconf} --enable-efl" - fi - - econf || die "Configure failed" - emake || die "Make failed" - - if use doc ; then - make documentation || die "Failed to make documentation" - fi -} - -src_install() { - emake -j1 install DESTDIR="${D}" || die "Installation died" - dodoc AUTHORS ChangeLog COPYING - if use doc ; then - dohtml build/documentation/html/* - fi -} - -pkg_postinst() { - - ebeep - einfo - einfo "The main (default) configuration file is" - einfo "/etc/einit/default.xml, the file you should" - einfo "modify is /etc/einit/rc.xml." - einfo "To use and finalize, you must ln -sf einit /sbin/init" - einfo "and you must modify grub or lilo and this" - einfo "takes the place of fstab too." - einfo "Please read the documentation provided!!!" - einfo - -} diff --git a/sys-apps/einit/einit-0.15.2.ebuild b/sys-apps/einit/einit-0.15.2.ebuild deleted file mode 100644 index 48ee92f8e..000000000 --- a/sys-apps/einit/einit-0.15.2.ebuild +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit eutils flag-o-matic toolchain-funcs - -DESCRIPTION="eINIT - an alternate /sbin/init" -HOMEPAGE="http://einit.sourceforge.net/" -SRC_URI="mirror://sourceforge/einit/${P}.tar.bz2" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="doc efl" - -RDEPEND="dev-libs/expat - doc? ( app-text/docbook-sgml app-doc/doxygen ) - efl? ( media-libs/edje x11-libs/evas x11-libs/ecore )" -DEPEND="${RDEPEND}" -PDEPEND="" - -S=${WORKDIR}/einit-${PV} - -src_compile() { - local myconf - myconf="--enable-linux --use-posix-regex --prefix=${ROOT} --ebuild" - - if use efl ; then - myconf="${myconf} --enable-efl" - fi - - econf || die "Configure failed" - emake || die "Make failed" - - if use doc ; then - make documentation || die "Failed to make documentation" - fi -} - -src_install() { - emake -j1 install DESTDIR="${D}" || die "Installation died" - dodoc AUTHORS ChangeLog COPYING - if use doc ; then - dohtml build/documentation/html/* - fi -} - -pkg_postinst() { - - ebeep - einfo - einfo "The main (default) configuration file is" - einfo "/etc/einit/einit.xml, the file you should" - einfo "modify is /etc/einit/local.xml." - einfo "To use and finalize, you must ln -sf einit /sbin/init" - einfo "and you must modify grub or lilo and this" - einfo "takes the place of fstab too." - if use doc ; then - einfo "Please read the documentation provided at /usr/share/doc/einit-${PV}/html/" - fi - einfo - -} diff --git a/sys-apps/einit/einit-0.16.0.ebuild b/sys-apps/einit/einit-0.16.0.ebuild deleted file mode 100644 index 48ee92f8e..000000000 --- a/sys-apps/einit/einit-0.16.0.ebuild +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit eutils flag-o-matic toolchain-funcs - -DESCRIPTION="eINIT - an alternate /sbin/init" -HOMEPAGE="http://einit.sourceforge.net/" -SRC_URI="mirror://sourceforge/einit/${P}.tar.bz2" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="doc efl" - -RDEPEND="dev-libs/expat - doc? ( app-text/docbook-sgml app-doc/doxygen ) - efl? ( media-libs/edje x11-libs/evas x11-libs/ecore )" -DEPEND="${RDEPEND}" -PDEPEND="" - -S=${WORKDIR}/einit-${PV} - -src_compile() { - local myconf - myconf="--enable-linux --use-posix-regex --prefix=${ROOT} --ebuild" - - if use efl ; then - myconf="${myconf} --enable-efl" - fi - - econf || die "Configure failed" - emake || die "Make failed" - - if use doc ; then - make documentation || die "Failed to make documentation" - fi -} - -src_install() { - emake -j1 install DESTDIR="${D}" || die "Installation died" - dodoc AUTHORS ChangeLog COPYING - if use doc ; then - dohtml build/documentation/html/* - fi -} - -pkg_postinst() { - - ebeep - einfo - einfo "The main (default) configuration file is" - einfo "/etc/einit/einit.xml, the file you should" - einfo "modify is /etc/einit/local.xml." - einfo "To use and finalize, you must ln -sf einit /sbin/init" - einfo "and you must modify grub or lilo and this" - einfo "takes the place of fstab too." - if use doc ; then - einfo "Please read the documentation provided at /usr/share/doc/einit-${PV}/html/" - fi - einfo - -} diff --git a/sys-apps/einit/einit-9999.ebuild b/sys-apps/einit/einit-9999.ebuild deleted file mode 100644 index 766c823f1..000000000 --- a/sys-apps/einit/einit-9999.ebuild +++ /dev/null @@ -1,47 +0,0 @@ -inherit subversion flag-o-matic eutils toolchain-funcs - -DESCRIPTION="eINIT - an alternate /sbin/init" -HOMEPAGE="http://einit.sourceforge.net/" -ESVN_REPO_URI="http://einit.svn.sourceforge.net/svnroot/einit/trunk/${PN}" -SRC_URI="" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="-*" -IUSE="doc efl" - -RDEPEND="dev-libs/expat - doc? ( app-text/docbook-sgml app-doc/doxygen ) - efl? ( media-libs/edje x11-libs/evas x11-libs/ecore )" -DEPEND="${RDEPEND}" -PDEPEND="" - -S=${WORKDIR}/einit - -src_unpack() { - subversion_src_unpack - cd "${S}" -} - -src_compile() { - local myconf - myconf="--svn --ebuild" - if use efl ; then - myconf="${myconf} --enable-linux --use-posix-regex --prefix=${ROOT} --enable-efl" - else - myconf="${myconf} --enable-linux --use-posix-regex --prefix=${ROOT}" - fi - econf ${myconf} || die "Configuration failed" - emake || die "Make failed" - if use doc ; then - make documentation || die "Documentation faile" - fi -} - -src_install() { - emake -j1 install DESTDIR="${D}" || die "Installation failed" - dodoc AUTHORS ChangeLog COPYING - if use doc ; then - dohtml build/documentation/html/* - fi -} diff --git a/sys-apps/einit/files/digest-einit-0.14.0.500 b/sys-apps/einit/files/digest-einit-0.14.0.500 deleted file mode 100644 index fa4ce2b3a..000000000 --- a/sys-apps/einit/files/digest-einit-0.14.0.500 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 4921196c7adac12b207afa333f6cae3c einit-0.14.0.500.tar.bz2 152982 -RMD160 7e5ef06ce5cea3d8ffa44275e694f251d96b52e4 einit-0.14.0.500.tar.bz2 152982 -SHA256 3fd504ae2a6c5a748ed7f5754b11af4dd3a83001b9f35f602defa3d91d62d246 einit-0.14.0.500.tar.bz2 152982 diff --git a/sys-apps/einit/files/digest-einit-0.14.0.500-r1 b/sys-apps/einit/files/digest-einit-0.14.0.500-r1 deleted file mode 100644 index fa4ce2b3a..000000000 --- a/sys-apps/einit/files/digest-einit-0.14.0.500-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 4921196c7adac12b207afa333f6cae3c einit-0.14.0.500.tar.bz2 152982 -RMD160 7e5ef06ce5cea3d8ffa44275e694f251d96b52e4 einit-0.14.0.500.tar.bz2 152982 -SHA256 3fd504ae2a6c5a748ed7f5754b11af4dd3a83001b9f35f602defa3d91d62d246 einit-0.14.0.500.tar.bz2 152982 diff --git a/sys-apps/einit/files/digest-einit-0.15.2 b/sys-apps/einit/files/digest-einit-0.15.2 deleted file mode 100644 index c87a104e0..000000000 --- a/sys-apps/einit/files/digest-einit-0.15.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 6446fb2ec8336a3b43d06e6ce9a4f00d einit-0.15.2.tar.bz2 226249 -RMD160 3c54ecab00804537ee07df83657167562cbf4eab einit-0.15.2.tar.bz2 226249 -SHA256 81995896e2ffdeb9bd8726b4a44f8c8fa26c6ffde3732d431ec7e5178472e399 einit-0.15.2.tar.bz2 226249 diff --git a/sys-apps/einit/files/digest-einit-0.16 b/sys-apps/einit/files/digest-einit-0.16 deleted file mode 100644 index 8b1378917..000000000 --- a/sys-apps/einit/files/digest-einit-0.16 +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sys-apps/einit/files/digest-einit-0.16.0 b/sys-apps/einit/files/digest-einit-0.16.0 deleted file mode 100644 index 117223a08..000000000 --- a/sys-apps/einit/files/digest-einit-0.16.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 edfb37c569e4e592823ef7a5665452f4 einit-0.16.0.tar.bz2 175555 -RMD160 968b6c945609e840a1c25ae2e5b4b4a3364c95dd einit-0.16.0.tar.bz2 175555 -SHA256 5e101476122543cd8927bf48d9182deca50e280adb2c5117cd495ef2096dcbcb einit-0.16.0.tar.bz2 175555 diff --git a/sys-apps/einit/files/digest-einit-9999 b/sys-apps/einit/files/digest-einit-9999 deleted file mode 100644 index 8b1378917..000000000 --- a/sys-apps/einit/files/digest-einit-9999 +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sys-fs/cryptsetup-luks/Manifest b/sys-fs/cryptsetup-luks/Manifest deleted file mode 100644 index 7ff31db7f..000000000 --- a/sys-fs/cryptsetup-luks/Manifest +++ /dev/null @@ -1,32 +0,0 @@ -AUX 1.0.3-cryptfs.confd 3029 RMD160 c84d92a58923ce88a60ab1e8fcc88910b0689df6 SHA1 b006d7f31773842e7247b2df0fe1735aac87ec59 SHA256 b5ea27a1034dda22b287422097e30e99a0673bd6a3148e38b1c2310bdcc28280 -MD5 63d91d8391aedaf1830d56922f9b5bf8 files/1.0.3-cryptfs.confd 3029 -RMD160 c84d92a58923ce88a60ab1e8fcc88910b0689df6 files/1.0.3-cryptfs.confd 3029 -SHA256 b5ea27a1034dda22b287422097e30e99a0673bd6a3148e38b1c2310bdcc28280 files/1.0.3-cryptfs.confd 3029 -AUX 1.0.3-dm-crypt-start.sh 7242 RMD160 9d47f15d049675f0e86f299751e657eeb7adc370 SHA1 13255f47ee53a0047086aa16562fef2e72be85c0 SHA256 27dc9decef6bc5ff1a3116ba2c06a7c478dff91dc388a795cb3d9191c636164c -MD5 1bad17bc3a8a02771e058a14c9febd2a files/1.0.3-dm-crypt-start.sh 7242 -RMD160 9d47f15d049675f0e86f299751e657eeb7adc370 files/1.0.3-dm-crypt-start.sh 7242 -SHA256 27dc9decef6bc5ff1a3116ba2c06a7c478dff91dc388a795cb3d9191c636164c files/1.0.3-dm-crypt-start.sh 7242 -AUX 1.0.3-dm-crypt-stop.sh 1021 RMD160 4b4537e0cadf447c1efed6ca8a4478b058e99aad SHA1 ed7c563b2ee9ef7c67e48fb9e63af025d4c2a29f SHA256 fd8856130104aa37d6941168b299389a47e6760077a9e6d3f86f3301385a4973 -MD5 341064815588da90206d883ed5dc42df files/1.0.3-dm-crypt-stop.sh 1021 -RMD160 4b4537e0cadf447c1efed6ca8a4478b058e99aad files/1.0.3-dm-crypt-stop.sh 1021 -SHA256 fd8856130104aa37d6941168b299389a47e6760077a9e6d3f86f3301385a4973 files/1.0.3-dm-crypt-stop.sh 1021 -AUX cryptfs.confd 1548 RMD160 a009482d77e0c467fc9b26bbf7cd0a46ed5eb26e SHA1 a51fd66f741436626706f6221be4709f5b6870ad SHA256 7e6d165edb4e3971d949847629e56849c0839c73f43de07822b4c942171dc16a -MD5 6d86b15e07cd0cdf96d8a363b1d778cd files/cryptfs.confd 1548 -RMD160 a009482d77e0c467fc9b26bbf7cd0a46ed5eb26e files/cryptfs.confd 1548 -SHA256 7e6d165edb4e3971d949847629e56849c0839c73f43de07822b4c942171dc16a files/cryptfs.confd 1548 -AUX dm-crypt-start.sh 4306 RMD160 558705676a62acdaacb1362ad5459c1719f5b247 SHA1 07c4aafe6e0a3defc654215796e22165fbad777e SHA256 48669629db92c204f208406cf5ca78acce9088568e0bc03bba511b38a668b0fc -MD5 c653a0b4ace27569ccc659b7cb43b4a9 files/dm-crypt-start.sh 4306 -RMD160 558705676a62acdaacb1362ad5459c1719f5b247 files/dm-crypt-start.sh 4306 -SHA256 48669629db92c204f208406cf5ca78acce9088568e0bc03bba511b38a668b0fc files/dm-crypt-start.sh 4306 -AUX dm-crypt-stop.sh 1297 RMD160 aae23fdb24788b31992f61afd750d0be270a586b SHA1 185ac9098155cc4e070a277baca7b29976d68618 SHA256 c160c65b947af563e5e5ee0b090f3d2a4f4097361b1088be05cba3f3461907b7 -MD5 a3bb6598f67c8922ccb6576ff256ced0 files/dm-crypt-stop.sh 1297 -RMD160 aae23fdb24788b31992f61afd750d0be270a586b files/dm-crypt-stop.sh 1297 -SHA256 c160c65b947af563e5e5ee0b090f3d2a4f4097361b1088be05cba3f3461907b7 files/dm-crypt-stop.sh 1297 -DIST cryptsetup-luks-1.0.4.tar.bz2 306907 RMD160 47737ab9302152a64f0e13b405c219d0166d8217 SHA1 971bbeecbe47d0d5ff006930fd8404d6998a3601 SHA256 5ba6066d79443fce157b8b6081be466b4c04759cf5cd020b51a8f6cfc996e2a6 -EBUILD cryptsetup-luks-1.0.4-r2.ebuild 2605 RMD160 2e37b32c41ee15c9120f154fab0fca5fbc048f91 SHA1 d6e6c9fb1f4bb76156c7213f8da5150676265520 SHA256 20880e9fd0faeadb1ac41678487a74037ae9542de70fb489a2ef44e574c31f18 -MD5 f36c87aa5faa82b33e8e51c9b1773d0b cryptsetup-luks-1.0.4-r2.ebuild 2605 -RMD160 2e37b32c41ee15c9120f154fab0fca5fbc048f91 cryptsetup-luks-1.0.4-r2.ebuild 2605 -SHA256 20880e9fd0faeadb1ac41678487a74037ae9542de70fb489a2ef44e574c31f18 cryptsetup-luks-1.0.4-r2.ebuild 2605 -MD5 99aa86b96620381c73335d1bc21ddf77 files/digest-cryptsetup-luks-1.0.4-r2 268 -RMD160 ba93465625d521cc777c1fbc352c3aec11786eff files/digest-cryptsetup-luks-1.0.4-r2 268 -SHA256 9c5d89e73392ea18152a5a4d7b1804ed6a57bb5309abfe23e4605210737f6ec9 files/digest-cryptsetup-luks-1.0.4-r2 268 diff --git a/sys-fs/cryptsetup-luks/cryptsetup-luks-1.0.4-r2.ebuild b/sys-fs/cryptsetup-luks/cryptsetup-luks-1.0.4-r2.ebuild deleted file mode 100644 index 12fae81a4..000000000 --- a/sys-fs/cryptsetup-luks/cryptsetup-luks-1.0.4-r2.ebuild +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/cryptsetup-luks/cryptsetup-luks-1.0.4-r1.ebuild,v 1.2 2007/01/27 02:18:18 strerror Exp $ - -inherit linux-info eutils flag-o-matic multilib - -DESCRIPTION="Tool to setup encrypted devices with dm-crypt" -HOMEPAGE="http://luks.endorphin.org/" -SRC_URI="http://luks.endorphin.org/source/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="build dynamic nls selinux" -RESTRICT="confcache" - -DEPEND=">=sys-fs/device-mapper-1.00.07-r1 - >=dev-libs/libgcrypt-1.1.42 - >=dev-libs/libgpg-error-1.0-r1 - >=dev-libs/popt-1.7 - selinux? ( sys-libs/libselinux ) - !sys-fs/cryptsetup" - -dm-crypt_check() { - local CONFIG_CHECK="~DM_CRYPT" - local WARNING_DM_CRYPT="CONFIG_DM_CRYPT:\tis not set (required for cryptsetup-luks)" - check_extra_config - echo -} - -crypto_check() { - local CONFIG_CHECK="~CRYPTO" - local WARNING_CRYPTO="CONFIG_CRYPTO:\tis not set (required for cryptsetup-luks)" - check_extra_config - echo -} - -cbc_check() { - local CONFIG_CHECK="~CRYPTO_CBC" - local WARNING_CRYPTO_CBC="CONFIG_CRYPTO_CBC:\tis not set (required for Kernel 2.6.19)" - check_extra_config - echo -} - -pkg_setup() { - # Bug 148390 - if ! use build ; then - linux-info_pkg_setup - dm-crypt_check - crypto_check - cbc_check - fi -} - -src_compile() { - if use dynamic ; then - ewarn "If you need cryptsetup for an initrd or initramfs then you" - ewarn "should NOT use the dynamic USE flag" - epause 5 - fi - - econf \ - --sbindir=/sbin \ - $(use_enable !dynamic static) \ - --libdir=/usr/$(get_libdir) \ - $(use_enable nls) \ - $(use_enable selinux) \ - || die - - emake || die -} - -src_install() { - emake DESTDIR="${D}" install || die "install failed" - rmdir "${D}"/usr/$(get_libdir)/cryptsetup - insinto /lib/rcscripts/addons - dosym /sbin/cryptsetup /bin/cryptsetup - newins "${FILESDIR}"/1.0.3-dm-crypt-start.sh dm-crypt-start.sh || die - newins "${FILESDIR}"/1.0.3-dm-crypt-stop.sh dm-crypt-stop.sh || die - newconfd "${FILESDIR}"/1.0.3-cryptfs.confd cryptfs || die -} - -pkg_postinst() { - ewarn "This ebuild introduces a new set of scripts and configuration" - ewarn "then the previous system. If you are currently using /etc/conf.d/crypfs" - ewarn "then you *MUST* read the new /etc/conf.d/cryptfs for instructions" - ewarn "on how to convert your previous cryptfs to the new syntax or your" - ewarn "encrypted partitions will *NOT* work." - einfo - einfo "Please see the example for configuring a LUKS mountpoint" - einfo "in /etc/conf.d/cryptfs" - einfo -} diff --git a/sys-fs/cryptsetup-luks/files/1.0.3-cryptfs.confd b/sys-fs/cryptsetup-luks/files/1.0.3-cryptfs.confd deleted file mode 100644 index faa61383c..000000000 --- a/sys-fs/cryptsetup-luks/files/1.0.3-cryptfs.confd +++ /dev/null @@ -1,88 +0,0 @@ -# /etc/conf.d/cryptfs - -#-------------------- -# Instructions -#-------------------- - -# Note regarding the syntax of this file. This file is *almost* bash, -# but each line is evaluated separately. Separate swaps/targets can be -# specified. The init-script which reads this file assumes that a -# swap= or target= line starts a new section, similar to lilo or grub -# configuration. - -# Note when using gpg keys and /usr on a separate partition, you will -# have to copy /usr/bin/gpg to /bin/gpg so that it will work properly -# and ensure that gpg has been compiled statically. -# See http://bugs.gentoo.org/90482 for more information. - -# Note that the init-script which reads this file detects whether your -# partition is LUKS or not. No mkfs is run unless you specify a makefs -# option. - -# Arguments: -#----------- -# target= == Mapping name for partition. -# swap= == Mapping name for swap partition. -# source='' == Real device for partition. -# key='[:]' == Fullpath from / or from inside removable media. -# remdev='' == Device that will be assigned to removable media. -# gpg_options='' == Default are --quiet --decrypt -# options='' == cryptsetup, for LUKS you can only use --readonly -# loop_file='' == Loopback file. -# pre_mount='cmds' == commands to execute before mounting partition. -# post_mount='cmds' == commands to execute after mounting partition. -#----------- -# Supported Modes -# gpg == decrypt and pipe key into cryptsetup. -# Note: new-line character must not be part of key. -# Command to erase \n char: 'cat key | tr -d '\n' > cleanKey' - -#-------------------- -# dm-crypt examples -#-------------------- - -## swap -# Swap partitions. These should come first so that no keys make their -# way into unencrypted swap. -# If no options are given, they will default to: -c aes -h sha1 -d /dev/urandom -# If no makefs is given then mkswap will be assumed -#swap=crypt-swap -#source='/dev/hda2' - -## /home with passphrase -#target=crypt-home -#source='/dev/hda5' - -## /home with regular keyfile -#target=crypt-home -#source='/dev/hda5' -#key='/full/path/to/homekey' - -## /home with gpg protected key -#target=crypt-home -#source='/dev/hda5' -#key='/full/path/to/homekey:gpg' - -## /home with regular keyfile on removable media(such as usb-stick) -#target=crypt-home -#source='/dev/hda5' -#key='/full/path/to/homekey' -#remdev='/dev/sda1' - -##/home with gpg protected key on removable media(such as usb-stick) -#target=crypt-home -#source='/dev/hda5' -#key='/full/path/to/homekey:gpg' -#remdev='/dev/sda1' - -##/tmp with regular keyfile -#target=crypt-tmp -#source='/dev/hda6' -#key='/full/path/to/tmpkey' -#pre_mount='/sbin/mkreiserfs -f -f ${dev}' -#post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}' - -## Loopback file example -#mount='crypt-loop-home' -#source='/dev/loop0' -#loop_file='/mnt/crypt/home' diff --git a/sys-fs/cryptsetup-luks/files/1.0.3-dm-crypt-start.sh b/sys-fs/cryptsetup-luks/files/1.0.3-dm-crypt-start.sh deleted file mode 100644 index d3a57a204..000000000 --- a/sys-fs/cryptsetup-luks/files/1.0.3-dm-crypt-start.sh +++ /dev/null @@ -1,236 +0,0 @@ -# /lib/rcscripts/addons/dm-crypt-start.sh - -# For backwards compatability with baselayout < 1.13.0 -dm-crypt-execute-checkfs() { - dm-crypt-execute-volumes -} - -# Setup mappings for an individual target/swap -# Note: This relies on variables localized in the main body below. -dm-crypt-execute-volumes() { - local dev ret mode - # some colors - local red='\x1b[31;01m' green='\x1b[32;01m' off='\x1b[0;0m' - - if [ -n "$target" ]; then - # let user set options, otherwise leave empty - : ${options:=' '} - elif [ -n "$swap" ]; then - target=${swap} - # swap contents do not need to be preserved between boots, luks not required. - # suspend2 users should have initramfs's init handling their swap partition either way. - : ${options:='-c aes -h sha1 -d /dev/urandom'} - : ${pre_mount:='mkswap ${dev}'} - else - return - fi - if [ -z "$source" ] && [ ! -e "$source" ]; then - ewarn "source \"${source}\" for ${target} missing, skipping..." - return - fi - - if [[ -n ${loop_file} ]] ; then - dev="/dev/mapper/${target}" - ebegin " Setting up loop device ${source}" - /sbin/losetup ${source} ${loop_file} - fi - - # cryptsetup: - # luksOpen # is $source - # create # is $target - local arg1="create" arg2="$target" arg3="$source" luks=0 - - cryptsetup isLuks ${source} 2>/dev/null && { arg1="luksOpen"; arg2="$source"; arg3="$target"; luks=1; } - - if /bin/cryptsetup status ${target} | egrep -q '\/dev/null >/dev/null - if mount -n -o ro ${remdev} ${mntrem} 2>/dev/null >/dev/null ; then - sleep 2 - # keyfile exists? - if [ ! -e "${mntrem}${key}" ]; then - umount -n ${mntrem} 2>/dev/null >/dev/null - rmdir ${mntrem} 2>/dev/null >/dev/null - einfo "Cannot find ${key} on removable media." - echo -n -e " ${green}*${off} Abort?(${red}yes${off}/${green}no${off})" >/dev/console - read ans /dev/console - [ "$ans" != "yes" ] && { i=0; c=0; } || return - else - key="${mntrem}${key}" - break - fi - else - [ "$c" -eq 0 ] && einfo "Please insert removable device for ${target}" - c=1 - sleep 2 - # let user abort - if [ "$i" -eq 9 ]; then - rmdir ${mntrem} 2>/dev/null >/dev/null - einfo "Removable device for ${target} not present." - echo -n -e " ${green}*${off} Abort?(${red}yes${off}/${green}no${off})" >/dev/console - read ans /dev/console - [ "$ans" != "yes" ] && { i=0; c=0; } || return - fi - fi - done - else # keyfile ! on removable device - if [ ! -e "$key" ]; then - ewarn "${source} will not be decrypted ..." - einfo "Reason: keyfile ${key} does not exist." - return - fi - fi - ;; - *) - ewarn "${source} will not be decrypted ..." - einfo "Reason: mode ${mode} is invalid." - return - ;; - esac - else - mode=none - fi - splash svc_input_begin ${SVCNAME} - ebegin "dm-crypt map ${target}" - einfo "cryptsetup will be called with : ${options} ${arg1} ${arg2} ${arg3}" - if [ "$mode" == "gpg" ]; then - : ${gpg_options:='-q -d'} - # gpg available ? - if type -p gpg >/dev/null ; then - for (( i = 0 ; i < 3 ; i++ )) - do - # paranoid, don't store key in a variable, pipe it so it stays very little in ram unprotected. - # save stdin stdout stderr "values" - exec 3>&0 4>&1 6>&2 # ABS says fd 5 is reserved - exec &>/dev/console /dev/null | cryptsetup ${options} ${arg1} ${arg2} ${arg3} - ret="$?" - # restore values and close file descriptors - exec 0>&3 1>&4 2>&6 - exec 3>&- 4>&- 6>&- - [ "$ret" -eq 0 ] && break - done - eend "${ret}" "failure running cryptsetup" - else - ewarn "${source} will not be decrypted ..." - einfo "Reason: cannot find gpg application." - einfo "You have to install app-crypt/gnupg first." - einfo "If you have /usr on its own partition, try copying gpg to /bin ." - fi - else - if [ "$mode" == "reg" ]; then - cryptsetup ${options} -d ${key} ${arg1} ${arg2} ${arg3} >/dev/console /dev/console /dev/null >/dev/null - rmdir ${mntrem} 2>/dev/null >/dev/null - fi - splash svc_input_end ${SVCNAME} - - if [[ ${ret} != 0 ]] ; then - cryptfs_status=1 - else - if [[ -n ${pre_mount} ]] ; then - dev="/dev/mapper/${target}" - ebegin " Running pre_mount commands for ${target}" - eval "${pre_mount}" > /dev/null - ewend $? || cryptfs_status=1 - fi - fi -} - -# Run any post_mount commands for an individual mount -# -# Note: This relies on variables localized in the main body below. -dm-crypt-execute-localmount() { - local mount_point - - [ -z "$target" ] && [ -z "$post_mount" ] && return - - if ! /bin/cryptsetup status ${target} | egrep -q '\/dev/null - eend $? || cryptfs_status=1 - fi -} - -local cryptfs_status=0 -local gpg_options key loop_file target targetline options pre_mount post_mount source swap remdev - -if [[ -f /etc/conf.d/cryptfs ]] && [[ -x /bin/cryptsetup ]] ; then - ebegin "Setting up dm-crypt mappings" - - while read targetline ; do - # skip comments and blank lines - [[ ${targetline}\# == \#* ]] && continue - - # check for the start of a new target/swap - case ${targetline} in - target=*|swap=*) - # If we have a target queued up, then execute it - dm-crypt-execute-${SVCNAME} - - # Prepare for the next target/swap by resetting variables - unset gpg_options key loop_file target options pre_mount post_mount source swap remdev - ;; - - gpg_options=*|remdev=*|key=*|loop_file=*|options=*|pre_mount=*|post_mount=*|source=*) - if [[ -z ${target} && -z ${swap} ]] ; then - ewarn "Ignoring setting outside target/swap section: ${targetline}" - continue - fi - ;; - - *) - ewarn "Skipping invalid line in /etc/conf.d/cryptfs: ${targetline}" - ;; - esac - - # Queue this setting for the next call to dm-crypt-execute-${SVCNAME} - eval "${targetline}" - done < /etc/conf.d/cryptfs - - # If we have a target queued up, then execute it - dm-crypt-execute-${SVCNAME} - - ewend ${cryptfs_status} "Failed to setup dm-crypt devices" -fi - -# vim:ts=4 diff --git a/sys-fs/cryptsetup-luks/files/1.0.3-dm-crypt-stop.sh b/sys-fs/cryptsetup-luks/files/1.0.3-dm-crypt-stop.sh deleted file mode 100644 index 9aea8217c..000000000 --- a/sys-fs/cryptsetup-luks/files/1.0.3-dm-crypt-stop.sh +++ /dev/null @@ -1,40 +0,0 @@ -# /lib/rcscripts/addons/dm-crypt-stop.sh - -# Try to remove any dm-crypt mappings -csetup=/bin/cryptsetup -if [ -f /etc/conf.d/cryptfs ] && [ -x "$csetup" ] -then - einfo "Removing dm-crypt mappings" - - /bin/egrep "^(target|swap)" /etc/conf.d/cryptfs | \ - while read targetline - do - target= - swap= - - eval ${targetline} - - [ -n "${swap}" ] && target=${swap} - [ -z "${target}" ] && ewarn "Invalid line in /etc/conf.d/cryptfs: ${targetline}" - - ebegin "Removing dm-crypt mapping for: ${target}" - ${csetup} remove ${target} - eend $? "Failed to remove dm-crypt mapping for: ${target}" - done - - if [[ -n $(/bin/egrep -e "^(source=)./dev/loop*" /etc/conf.d/cryptfs) ]] ; then - einfo "Taking down any dm-crypt loop devices" - /bin/egrep -e "^(source)" /etc/conf.d/cryptfs | while read sourceline - do - source= - eval ${sourceline} - if [[ -n $(echo ${source} | grep /dev/loop) ]] ; then - ebegin " Taking down ${source}" - /sbin/losetup -d ${source} - eend $? " Failed to remove loop" - fi - done - fi -fi - -# vim:ts=4 diff --git a/sys-fs/cryptsetup-luks/files/cryptfs.confd b/sys-fs/cryptsetup-luks/files/cryptfs.confd deleted file mode 100644 index 9ffc159d0..000000000 --- a/sys-fs/cryptsetup-luks/files/cryptfs.confd +++ /dev/null @@ -1,42 +0,0 @@ -# /etc/conf.d/cryptfs -# $Header: /var/cvsroot/gentoo-x86/sys-fs/cryptsetup-luks/files/cryptfs.confd,v 1.3 2005/06/25 14:11:37 swegener Exp $ - -# Note regarding the syntax of this file. This file is *almost* bash, -# but each line is evaluated separately. Separate swaps/mounts can be -# specified. The init-script which reads this file assumes that a -# swap= or mount= line starts a new section, similar to lilo or grub -# configuration. - -# Note when using gpg keys and /usr on a separate partition, you will -# have to copy /usr/bin/gpg to /bin/gpg so that it will work properly. -# See http://bugs.gentoo.org/90482 for more information. - -# Swap partitions. These should come first so that no keys make their -# way into unencrypted swap. -# If no options are given, they will default to: -c aes -h sha1 -d /dev/urandom -# If no makefs is given then mkswap will be assumed -#swap=crypt-swap -#source='/dev/mapper/swap' - -# Mounts -# If no options are given, they will default to: -c aes -h sha1 -# No mkfs is run unless you specify a makefs option -# NOTE: if you are using cryptsetup-luks and want to use its features -# then you must add a type=luks line otherwise it will be treated like -# the original cryptsetup - -# dm-crypt example - -#mount=crypt-tmp -#source='/dev/mapper/tmp' -#type=luks -#options='-d /root/keyfile' -#pre_mount='/sbin/mkreiserfs -f -f ${dev}' -#post_mount='chown root:root ${mount_point}; chmod 1777 ${mount_point}' - -# Loopback file example - -#mount='home-crypt' -#source='/dev/loop0' -#options='-c serpent -s 256' -#loop_file='/mnt/crypt/home' diff --git a/sys-fs/cryptsetup-luks/files/digest-cryptsetup-luks-1.0.4-r2 b/sys-fs/cryptsetup-luks/files/digest-cryptsetup-luks-1.0.4-r2 deleted file mode 100644 index 5941fa96b..000000000 --- a/sys-fs/cryptsetup-luks/files/digest-cryptsetup-luks-1.0.4-r2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 156ae6b618438ee9feeddc6c2bdc4e94 cryptsetup-luks-1.0.4.tar.bz2 306907 -RMD160 47737ab9302152a64f0e13b405c219d0166d8217 cryptsetup-luks-1.0.4.tar.bz2 306907 -SHA256 5ba6066d79443fce157b8b6081be466b4c04759cf5cd020b51a8f6cfc996e2a6 cryptsetup-luks-1.0.4.tar.bz2 306907 diff --git a/sys-fs/cryptsetup-luks/files/dm-crypt-start.sh b/sys-fs/cryptsetup-luks/files/dm-crypt-start.sh deleted file mode 100644 index 3d22c95d0..000000000 --- a/sys-fs/cryptsetup-luks/files/dm-crypt-start.sh +++ /dev/null @@ -1,152 +0,0 @@ -# /lib/rcscripts/addons/dm-crypt-start.sh -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/cryptsetup-luks/files/dm-crypt-start.sh,v 1.2 2005/06/15 09:53:25 strerror Exp $ - -# Setup mappings for an individual mount/swap -# -# Note: This relies on variables localized in the main body below. -dm-crypt-execute-checkfs() { - local dev target ret - - if [[ -n ${loop_file} ]] ; then - dev="/dev/mapper/${target}" - ebegin " Setting up loop device ${source}" - /sbin/losetup ${source} ${loop_file} - fi - - if [[ -n ${mount} ]] ; then - target=${mount} - : ${options:='-c aes -h sha1'} - [[ -n ${key} ]] && : ${gpg_options:='-q -d'} - elif [[ -n ${swap} ]] ; then - target=${swap} - : ${options:='-c aes -h sha1 -d /dev/urandom'} - : ${pre_mount:='mkswap ${dev}'} - else - return - fi - - if /bin/cryptsetup status ${target} | egrep -q '\/dev/console /dev/console /dev/null ; then - ret=1 - while [[ ${ret} -gt 0 ]] ; do - keystring=$(gpg ${gpg_options} ${key} 2>/dev/null /dev/null - ewend $? || cryptfs_status=1 - fi - fi -} - -# Run any post_mount commands for an individual mount -# -# Note: This relies on variables localized in the main body below. -dm-crypt-execute-localmount() { - local mount_point target - - if [[ -n ${mount} && -n ${post_mount} ]] ; then - target=${mount} - else - return - fi - - if ! /bin/cryptsetup status ${target} | egrep -q '\/dev/null - eend $? || cryptfs_status=1 - fi -} - -local cryptfs_status=0 -local gpg_options key loop_file mount mountline options pre_mount post_mount source swap type - -if [[ -f /etc/conf.d/cryptfs ]] && [[ -x /bin/cryptsetup ]] ; then - ebegin "Setting up dm-crypt mappings" - - while read mountline ; do - # skip comments and blank lines - [[ ${mountline}\# == \#* ]] && continue - - # check for the start of a new mount/swap - case ${mountline} in - mount=*|swap=*) - # If we have a mount queued up, then execute it - dm-crypt-execute-${myservice} - - # Prepare for the next mount/swap by resetting variables - unset gpg_options key loop_file mount options pre_mount post_mount source swap type - ;; - - gpg_options=*|key=*|loop_file=*|options=*|pre_mount=*|post_mount=*|source=*|type=*) - if [[ -z ${mount} && -z ${swap} ]] ; then - ewarn "Ignoring setting outside mount/swap section: ${mountline}" - continue - fi - ;; - - *) - ewarn "Skipping invalid line in /etc/conf.d/cryptfs: ${mountline}" - ;; - esac - - # Queue this setting for the next call to dm-crypt-execute-${myservice} - eval "${mountline}" - done < /etc/conf.d/cryptfs - - # If we have a mount queued up, then execute it - dm-crypt-execute-${myservice} - - ewend ${cryptfs_status} "Failed to setup dm-crypt devices" -fi - - -# vim:ts=4 diff --git a/sys-fs/cryptsetup-luks/files/dm-crypt-stop.sh b/sys-fs/cryptsetup-luks/files/dm-crypt-stop.sh deleted file mode 100644 index 8c9f262e0..000000000 --- a/sys-fs/cryptsetup-luks/files/dm-crypt-stop.sh +++ /dev/null @@ -1,51 +0,0 @@ -# /lib/rcscripts/addons/dm-crypt-stop.sh -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/cryptsetup-luks/files/dm-crypt-stop.sh,v 1.1 2005/06/01 23:10:17 strerror Exp $ - -# Try to remove any dm-crypt mappings -if [ -f /etc/conf.d/cryptfs ] && [ -x /bin/cryptsetup ] -then - einfo "Removing dm-crypt mappings" - - /bin/egrep "^(mount|swap)" /etc/conf.d/cryptfs | \ - while read mountline - do - mount= - swap= - target= - - eval ${mountline} - - if [ -n "${mount}" ] - then - target=${mount} - elif [ -n "${swap}" ] - then - target=${swap} - else - ewarn "Invalid line in /etc/conf.d/cryptfs: ${mountline}" - fi - - ebegin "Removing dm-crypt mapping for: ${target}" - /bin/cryptsetup remove ${target} - eend $? "Failed to remove dm-crypt mapping for: ${target}" - done - - if [[ -n $(/bin/egrep -e "^(source=)./dev/loop*" /etc/conf.d/cryptfs) ]] ; then - einfo "Taking down any dm-crypt loop devices" - /bin/egrep -e "^(source)" /etc/conf.d/cryptfs | while read sourceline - do - source= - eval ${sourceline} - if [[ -n $(echo ${source} | grep /dev/loop) ]] ; then - ebegin " Taking down ${source}" - /sbin/losetup -d ${source} - eend $? " Failed to remove loop" - fi - done - fi -fi - - -# vim:ts=4 diff --git a/sys-fs/ntfs-policy/Manifest b/sys-fs/ntfs-policy/Manifest deleted file mode 100644 index 98461ad47..000000000 --- a/sys-fs/ntfs-policy/Manifest +++ /dev/null @@ -1,11 +0,0 @@ -AUX 99-ntfs-policy.fdi 646 RMD160 62f5bb6805e18c389f0c02338fd46edad9e675dc SHA1 765975666af60bdf2b74fda20bff57250fe000aa SHA256 69bb1d8f300529ae51185df875775e96365964fc8da67bd798553c533ebf7d1d -MD5 4d1659482b7def63eea5c15a844b0b8f files/99-ntfs-policy.fdi 646 -RMD160 62f5bb6805e18c389f0c02338fd46edad9e675dc files/99-ntfs-policy.fdi 646 -SHA256 69bb1d8f300529ae51185df875775e96365964fc8da67bd798553c533ebf7d1d files/99-ntfs-policy.fdi 646 -EBUILD ntfs-policy-1.1.ebuild 959 RMD160 317184a7d711db5c64c7eb01f7d30f15cba74bcf SHA1 6bffa4807821756ae7f2c67c037ccaf33814bfee SHA256 e7b450ec84cbf14418321aed52b619b6a28be1f34f81bd438453b2680f25687b -MD5 5d248279f56696347e70dc5a7853ef53 ntfs-policy-1.1.ebuild 959 -RMD160 317184a7d711db5c64c7eb01f7d30f15cba74bcf ntfs-policy-1.1.ebuild 959 -SHA256 e7b450ec84cbf14418321aed52b619b6a28be1f34f81bd438453b2680f25687b ntfs-policy-1.1.ebuild 959 -MD5 68b329da9893e34099c7d8ad5cb9c940 files/digest-ntfs-policy-1.1 1 -RMD160 c0da025038ed83c687ddc430da9846ecb97f3998 files/digest-ntfs-policy-1.1 1 -SHA256 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b files/digest-ntfs-policy-1.1 1 diff --git a/sys-fs/ntfs-policy/files/99-ntfs-policy.fdi b/sys-fs/ntfs-policy/files/99-ntfs-policy.fdi deleted file mode 100644 index 0ac96ccfa..000000000 --- a/sys-fs/ntfs-policy/files/99-ntfs-policy.fdi +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - umask=0222 - - - - - - - diff --git a/sys-fs/ntfs-policy/files/digest-ntfs-policy-1.1 b/sys-fs/ntfs-policy/files/digest-ntfs-policy-1.1 deleted file mode 100644 index 8b1378917..000000000 --- a/sys-fs/ntfs-policy/files/digest-ntfs-policy-1.1 +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sys-fs/ntfs-policy/ntfs-policy-1.1.ebuild b/sys-fs/ntfs-policy/ntfs-policy-1.1.ebuild deleted file mode 100644 index a80ea5f6f..000000000 --- a/sys-fs/ntfs-policy/ntfs-policy-1.1.ebuild +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 - -inherit eutils versionator - -DESCRIPTION="SabayonLinux NTFS HAL Policy files" -HOMEPAGE="http://www.sabayonlinux.org/" -SRC_URI="" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86 amd64" -IUSE="" - -DEPEND=">=sys-apps/hal-0.5.7.1-r1" - - -src_unpack () { - - cd ${WORKDIR} - cp ${FILESDIR}/99-ntfs-policy.fdi . -p - cp /usr/share/hal/scripts/hal-system-storage-mount . -p - -} - -src_install () { - - cd ${WORKDIR} - insinto /usr/share/hal/fdi/policy/10osvendor/ - doins 99-ntfs-policy.fdi - - # Patching hal-system-storage-mount - if [ -z "`cat hal-system-storage-mount | grep '$MOUNTOPTIONS,$HAL_PROP_VOLUME_MOUNT_OPTION'`" ]; then - einfo "Patching hal-system-storage-mount" - sed -i '/# echo "options =/ s/#/MOUNTOPTIONS="$MOUNTOPTIONS,$HAL_PROP_VOLUME_MOUNT_OPTION"\n\n#/' hal-system-storage-mount - fi - - exeinto /usr/share/hal/scripts/ - doexe hal-system-storage-mount - - -} diff --git a/sys-fs/udftool/Manifest b/sys-fs/udftool/Manifest deleted file mode 100644 index c8ae0fadd..000000000 --- a/sys-fs/udftool/Manifest +++ /dev/null @@ -1,23 +0,0 @@ -DIST udftool-1.0.tar.gz 60092 RMD160 55a2916bdd6782bb32bc15fc40805d1ee548b2d7 SHA1 b63198bc8fd90e17aef0ef08493c17a85cb631a6 SHA256 5c325ae7edfa26ee1570838efc56df8a9d548201924692cf85c0fa35301ad03a -EBUILD udftool-0.1.ebuild 841 RMD160 2ea12a33984e31645e8d8859d51a5669ebbf5ea8 SHA1 f68668153170a24ca5fa7b2adb031ff11a3bee60 SHA256 5f1e849c4fd3e3c54cebef8d356eed9c7193627d46bb6173c0bc18899ed3dfe5 -MD5 163c1c5c24d65ddfd1dcb0ad9c0fa901 udftool-0.1.ebuild 841 -RMD160 2ea12a33984e31645e8d8859d51a5669ebbf5ea8 udftool-0.1.ebuild 841 -SHA256 5f1e849c4fd3e3c54cebef8d356eed9c7193627d46bb6173c0bc18899ed3dfe5 udftool-0.1.ebuild 841 -EBUILD udftool-1.0.ebuild 866 RMD160 1ccbdbbdd2cd030aeea42f2ea14f80d616f7cc75 SHA1 965f5af6bbccf5139dda33566bd388ef7d6c48fe SHA256 f4fcdb6ed26e654d6e4709d604dc8629eb3732add9fe5615ced0c4b7a5718ebc -MD5 4df224fb97ac11f29f9ff30cea9302f5 udftool-1.0.ebuild 866 -RMD160 1ccbdbbdd2cd030aeea42f2ea14f80d616f7cc75 udftool-1.0.ebuild 866 -SHA256 f4fcdb6ed26e654d6e4709d604dc8629eb3732add9fe5615ced0c4b7a5718ebc udftool-1.0.ebuild 866 -MISC udftool-0.1.ebuild~ 853 RMD160 7884f2483599f219ee0749a8246a1e2b69a7bb3e SHA1 fa5860e6ba3834e518ae513c0024af3e2549d6a5 SHA256 3e8f27b8013451507d60bb8a9413a044fc589eed4f4e2aafd77d22af2e7df340 -MD5 083d98dbc91e9215fd7292bb9041abee udftool-0.1.ebuild~ 853 -RMD160 7884f2483599f219ee0749a8246a1e2b69a7bb3e udftool-0.1.ebuild~ 853 -SHA256 3e8f27b8013451507d60bb8a9413a044fc589eed4f4e2aafd77d22af2e7df340 udftool-0.1.ebuild~ 853 -MISC udftool-1.0.ebuild~ 851 RMD160 67eb7049f5af92db53ca1c9c102342504509d125 SHA1 5dc83aa8ff8c5600a5a304bd8c853ac2d8173351 SHA256 4f104bbf1f475730cdf2f18e68d263acea0d6be1ba8d041e8dfbb1cac31e097a -MD5 3f12f386de19bc9482fd692f28201a05 udftool-1.0.ebuild~ 851 -RMD160 67eb7049f5af92db53ca1c9c102342504509d125 udftool-1.0.ebuild~ 851 -SHA256 4f104bbf1f475730cdf2f18e68d263acea0d6be1ba8d041e8dfbb1cac31e097a udftool-1.0.ebuild~ 851 -MD5 d02d6973688cb60dc09485b4f35dda05 files/digest-udftool-0.1 232 -RMD160 ac7e8a5c3337e0ea51f7905bb4f164b7bd77c04e files/digest-udftool-0.1 232 -SHA256 58c335efff156d7486199127bbc2971af91690f0ba0c5be75bc5c7c635cbc103 files/digest-udftool-0.1 232 -MD5 d02d6973688cb60dc09485b4f35dda05 files/digest-udftool-1.0 232 -RMD160 ac7e8a5c3337e0ea51f7905bb4f164b7bd77c04e files/digest-udftool-1.0 232 -SHA256 58c335efff156d7486199127bbc2971af91690f0ba0c5be75bc5c7c635cbc103 files/digest-udftool-1.0 232 diff --git a/sys-fs/udftool/files/digest-udftool-0.1 b/sys-fs/udftool/files/digest-udftool-0.1 deleted file mode 100644 index f71cbdcf9..000000000 --- a/sys-fs/udftool/files/digest-udftool-0.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 534b6ad30be9d6b67ee56b97ce108cc6 udftool-1.0.tar.gz 60092 -RMD160 55a2916bdd6782bb32bc15fc40805d1ee548b2d7 udftool-1.0.tar.gz 60092 -SHA256 5c325ae7edfa26ee1570838efc56df8a9d548201924692cf85c0fa35301ad03a udftool-1.0.tar.gz 60092 diff --git a/sys-fs/udftool/files/digest-udftool-1.0 b/sys-fs/udftool/files/digest-udftool-1.0 deleted file mode 100644 index f71cbdcf9..000000000 --- a/sys-fs/udftool/files/digest-udftool-1.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 534b6ad30be9d6b67ee56b97ce108cc6 udftool-1.0.tar.gz 60092 -RMD160 55a2916bdd6782bb32bc15fc40805d1ee548b2d7 udftool-1.0.tar.gz 60092 -SHA256 5c325ae7edfa26ee1570838efc56df8a9d548201924692cf85c0fa35301ad03a udftool-1.0.tar.gz 60092 diff --git a/sys-fs/udftool/udftool-0.1.ebuild b/sys-fs/udftool/udftool-0.1.ebuild deleted file mode 100644 index 60d3086a9..000000000 --- a/sys-fs/udftool/udftool-0.1.ebuild +++ /dev/null @@ -1,34 +0,0 @@ -## Package by jhawk of SabayonLinux ## -## Ebuild by cvill64 of SabayonLinux ## - -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ -inherit eutils - -DESCRIPTION="A GUI configuration tool to easily implement udftools for backups" -SRC_URI="http://sabayonlinuxdev.com/distfiles/sys-fs/${PN}-1.0.tar.gz" -HOMEPAGE="http://svn.sabayonlinuxdev.com/jhawk/udftool" -GENTOO_MIRRORS="http://sabayonlinuxdev.com/distfiles/" -SLOT="0" -LICENSE="GPL-2" -KEYWORDS="~x86 ~amd64" -RDEPEND="${DEPEND} - sys-fs/udftools - dev-lang/python - " -S=${WORKDIR}/${PN} -src_unpack() { - unpack ${A} - } - -src_compile() { - einfo "Nothing to compile" - } - -src_install() { - dodir /usr/share/${PN} - cp -dPR ${S} ${D}/usr/share/ - dosym /usr/share/${PN} /usr/bin/${PN} - dobin ${PN} - doicon cdwriter.png -} diff --git a/sys-fs/udftool/udftool-1.0.ebuild b/sys-fs/udftool/udftool-1.0.ebuild deleted file mode 100644 index 27c54bfb8..000000000 --- a/sys-fs/udftool/udftool-1.0.ebuild +++ /dev/null @@ -1,35 +0,0 @@ -## Package by jhawk of SabayonLinux ## -## Ebuild by cvill64 of SabayonLinux ## - -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ -inherit eutils - -DESCRIPTION="A GUI configuration tool to easily implement udftools for backups" -SRC_URI="http://sabayonlinuxdev.com/distfiles/sys-fs/${PN}-1.0.tar.gz" -HOMEPAGE="http://svn.sabayonlinuxdev.com/jhawk/udftool" -GENTOO_MIRRORS="http://sabayonlinuxdev.com/distfiles/" -SLOT="0" -LICENSE="GPL-2" -KEYWORDS="~x86 ~amd64" -RDEPEND="${DEPEND} - sys-fs/udftools - dev-lang/python - " -S=${WORKDIR}/${PN} -src_unpack() { - unpack ${A} - } - -src_compile() { - einfo "Nothing to compile" - } - -src_install() { - dodir /usr/share/udftool - cp -dPR ${S} ${D}/usr/share/ - dosym /usr/share/udftool /usr/bin/ - dobin udftool - domenu udftool.desktop - doicon cdwriter.png -} diff --git a/sys-fs/unionfs/Manifest b/sys-fs/unionfs/Manifest deleted file mode 100644 index 14e699f66..000000000 --- a/sys-fs/unionfs/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -DIST unionfs-1.5_pre20061211.tar.bz2 115616 RMD160 059a4222c18bb9c88ce9e5679f1b47300b9bd075 SHA1 a1293a6183fd59f6d4b1cb709158ae1426454553 SHA256 8e6c5c653f6620da92ca4c9558d8516d16c563e636e9584ee3a273826efb06ca -EBUILD unionfs-1.5_pre20061211.ebuild 2152 RMD160 25c01074fd88f4a437df0090d9a34c86a8582d2a SHA1 f76fc3c07ca4d99b5cb7eaec436c2f03a081bdf6 SHA256 35281c665280e10bb0a878f83691add1c56cfa2c96c69d680d4d552503bc6f93 -MD5 279c4ae8def71c24f62d439eb7087b7c unionfs-1.5_pre20061211.ebuild 2152 -RMD160 25c01074fd88f4a437df0090d9a34c86a8582d2a unionfs-1.5_pre20061211.ebuild 2152 -SHA256 35281c665280e10bb0a878f83691add1c56cfa2c96c69d680d4d552503bc6f93 unionfs-1.5_pre20061211.ebuild 2152 -MD5 28787b5f52e134f7f7ef663604e0e377 files/digest-unionfs-1.5_pre20061211 274 -RMD160 2fd72bf2f10724618a3c3ff9e69690a66feb16a6 files/digest-unionfs-1.5_pre20061211 274 -SHA256 c1b550ef158dbd4e034fdf03ddcc09cef1e56b4fad2f4c09a6e3159f5d741582 files/digest-unionfs-1.5_pre20061211 274 diff --git a/sys-fs/unionfs/files/digest-unionfs-1.5_pre20061211 b/sys-fs/unionfs/files/digest-unionfs-1.5_pre20061211 deleted file mode 100644 index 96d16d3a5..000000000 --- a/sys-fs/unionfs/files/digest-unionfs-1.5_pre20061211 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 b7dbd9f18d1bb103a9e21883edbe64ba unionfs-1.5_pre20061211.tar.bz2 115616 -RMD160 059a4222c18bb9c88ce9e5679f1b47300b9bd075 unionfs-1.5_pre20061211.tar.bz2 115616 -SHA256 8e6c5c653f6620da92ca4c9558d8516d16c563e636e9584ee3a273826efb06ca unionfs-1.5_pre20061211.tar.bz2 115616 diff --git a/sys-fs/unionfs/unionfs-1.5_pre20061211.ebuild b/sys-fs/unionfs/unionfs-1.5_pre20061211.ebuild deleted file mode 100644 index 1cd9bfec0..000000000 --- a/sys-fs/unionfs/unionfs-1.5_pre20061211.ebuild +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# Copyright 2006 Fabio Erculiani - -inherit eutils linux-mod - -DESCRIPTION="Stackable unification file system, which can appear to merge the contents of several directories" -HOMEPAGE="http://www.fsl.cs.sunysb.edu/project-unionfs.html" -SRC_URI="http://sabayonlinux.org/distfiles/sys-fs/${P}.tar.bz2" -LICENSE="GPL-2" -KEYWORDS="~x86 ~amd64 ~ppc" -IUSE="acl debug nfs" - -S=${WORKDIR}/${P}/ - -local_version_info() { - ewarn - ewarn "you need the proper kernel version!" - ewarn - einfo "kernel: 2.4.x (x>19) Version: 1.0.14" - einfo "kernel: 2.6.x (x<9) Version: Not Supported" - einfo "kernel: 2.6.9 - 2.6.15 Version: 1.1.5" - einfo "kernel: 2.6.16 Version: 1.2" - einfo "kernel: 2.6.17 Version: 1.3" - einfo "kernel: 2.6.18 Version: 1.3.20060916" - einfo "kernel: 2.6.19 Version: +1.5_pre" -} - -pkg_setup() { - # kernel version check - if ! kernel_is eq 2 6 19; then - local_version_info - die - fi - - linux-mod_pkg_setup - - MODULE_NAMES="unionfs(kernel/fs/${PN}:)" - BUILD_TARGETS="all" - BUILD_PARAMS="LINUXSRC=${KV_DIR} KERNELVERSION=${KV_MAJOR}.${KV_MINOR}" -} - -src_unpack() { - local user_Makefile=fistdev.mk EXTRACFLAGS="" - - unpack ${A} - cd ${S} - - if ! use debug; then - echo "UNIONFS_DEBUG_CFLAG=" >> ${user_Makefile} - EXTRACFLAGS="${EXTRACFLAGS} -DUNIONFS_NDEBUG" - fi - - if use acl; then - EXTRACFLAGS="${EXTRACFLAGS} -DUNIONFS_XATTR" # -DFIST_SETXATTR_CONSTVOID" - elif use nfs; then - EXTRACFLAGS="${EXTRACFLAGS} -DNFS_SECURITY_HOLE" - fi - - echo "EXTRACFLAGS=${EXTRACFLAGS}" >> ${user_Makefile} - einfo EXTRACFLAGS: ${EXTRACFLAGS} - - echo "UNIONFS_OPT_CFLAG=${CFLAGS}" >> ${user_Makefile} - - #epatch "${FILESDIR}"/${PV}-64bit_compile_fix.diff -} - -src_install() { - linux-mod_src_install - - dodoc INSTALL NEWS README ChangeLog patch-kernel.sh - - emake \ - PREFIX="${D}" \ - MANDIR="${D}/usr/share/man" \ - install-utils # Makefile is bugged - #doman man/unionfs.4 man/unionctl.8 man/uniondbg.8 man/unionimap.8 - #into / # ${D}/sbin: usr could be unionfs mounted: bug #129960 - #dosbin utils/unionctl utils/uniondbg utils/unionimap -} - diff --git a/sys-kernel/gentoo-sources/Manifest b/sys-kernel/gentoo-sources/Manifest deleted file mode 100644 index ebdb7028e..000000000 --- a/sys-kernel/gentoo-sources/Manifest +++ /dev/null @@ -1,166 +0,0 @@ -AUX 09-non-libata-driver-for-jmicron-devices.patch 8637 RMD160 a087618ce0c786b98428a550e345efeee34f97ea SHA1 cf611b4a0a75707e49e166c9a1affb2f1727aae0 SHA256 a5810f81557da340f07142d001c545f87c24635143f8252b1796a5f01cd47799 -MD5 50f43f20945d51e68d24aa3d64da9f70 files/09-non-libata-driver-for-jmicron-devices.patch 8637 -RMD160 a087618ce0c786b98428a550e345efeee34f97ea files/09-non-libata-driver-for-jmicron-devices.patch 8637 -SHA256 a5810f81557da340f07142d001c545f87c24635143f8252b1796a5f01cd47799 files/09-non-libata-driver-for-jmicron-devices.patch 8637 -AUX 2.6.18-am2-nvidia-ati.patch 7411 RMD160 ff84f9546ffe94a431a0a3fb27bad2f36919ee7b SHA1 41e532bb2c79f5bd11ea496eb76fcecbd9712d98 SHA256 4355cfe64c1ef31ecdd752de779e527e3f6834862e18a96e4195b4f86ca57eb8 -MD5 b02a6f7f28a90bb81240fa69c1221c59 files/2.6.18-am2-nvidia-ati.patch 7411 -RMD160 ff84f9546ffe94a431a0a3fb27bad2f36919ee7b files/2.6.18-am2-nvidia-ati.patch 7411 -SHA256 4355cfe64c1ef31ecdd752de779e527e3f6834862e18a96e4195b4f86ca57eb8 files/2.6.18-am2-nvidia-ati.patch 7411 -AUX 2.6.18-am2-nvidia-fix.patch 2115 RMD160 6bd22550268193488f5e8ec18ff79f4328b5d622 SHA1 2256c3564b07d27dce18a3da95ffbddc098949ff SHA256 a371691b2ee5ec5f76372b3c8b25bf76e0f9da0e9866edbe5b7fd8f386bae6e6 -MD5 d71c10253a8a87884abafb5f5b00fddc files/2.6.18-am2-nvidia-fix.patch 2115 -RMD160 6bd22550268193488f5e8ec18ff79f4328b5d622 files/2.6.18-am2-nvidia-fix.patch 2115 -SHA256 a371691b2ee5ec5f76372b3c8b25bf76e0f9da0e9866edbe5b7fd8f386bae6e6 files/2.6.18-am2-nvidia-fix.patch 2115 -AUX 2.6.19-ata-piix-updates.patch 15777 RMD160 4cb181fff4f4c94b17c0eb411f2d3de89407e498 SHA1 499407345934fa78b41f35114e24900d5da12d02 SHA256 a0b3d5d4f0f69a51195997272fac6d2f82e9eb9a599f6485304b0c3857cfff99 -MD5 a0dd1d6d9a04298de4ed549f6ed35104 files/2.6.19-ata-piix-updates.patch 15777 -RMD160 4cb181fff4f4c94b17c0eb411f2d3de89407e498 files/2.6.19-ata-piix-updates.patch 15777 -SHA256 a0b3d5d4f0f69a51195997272fac6d2f82e9eb9a599f6485304b0c3857cfff99 files/2.6.19-ata-piix-updates.patch 15777 -AUX 2.6.19-bcm43xx-forcedeth-atiixp-support.patch 14720 RMD160 61f585e80001821ac421562bfe3ec39351705b91 SHA1 b1485788f5e4902166464ed98e24db26a09cdbad SHA256 ad052b8128d09cc42375480f9251e29a104710190ee0baaa552d75acae2b6a62 -MD5 e8f5ed68c745755b2aeecfab365063dc files/2.6.19-bcm43xx-forcedeth-atiixp-support.patch 14720 -RMD160 61f585e80001821ac421562bfe3ec39351705b91 files/2.6.19-bcm43xx-forcedeth-atiixp-support.patch 14720 -SHA256 ad052b8128d09cc42375480f9251e29a104710190ee0baaa552d75acae2b6a62 files/2.6.19-bcm43xx-forcedeth-atiixp-support.patch 14720 -AUX 2.6.19-bmdma-fixes.patch 2701 RMD160 6df48e6f235f45a1cf5eb618345f0c2529626388 SHA1 6183cb0a3561a0a60bbe31d44b219f7803047257 SHA256 3b33990b3ce90b4f187a9f1bb807e5c3845d0b1dee2d95fa4187c29c4cef1c8b -MD5 03b717963b62a65ae18c46b1109d85a9 files/2.6.19-bmdma-fixes.patch 2701 -RMD160 6df48e6f235f45a1cf5eb618345f0c2529626388 files/2.6.19-bmdma-fixes.patch 2701 -SHA256 3b33990b3ce90b4f187a9f1bb807e5c3845d0b1dee2d95fa4187c29c4cef1c8b files/2.6.19-bmdma-fixes.patch 2701 -AUX 2.6.19-kvm-2.6.20_rc4-updates.patch 100381 RMD160 ca00fd28efd6a6cf048ec863faa50a61d9bb28f4 SHA1 b3f5e5cb716b57524a69dfc8bc218743e2b15540 SHA256 ee3e5b08c1666d007eff43bca406cea359c679b4913a4c9df63a3caab02df8de -MD5 79fe4a8d97dad1403e75237c3c538c53 files/2.6.19-kvm-2.6.20_rc4-updates.patch 100381 -RMD160 ca00fd28efd6a6cf048ec863faa50a61d9bb28f4 files/2.6.19-kvm-2.6.20_rc4-updates.patch 100381 -SHA256 ee3e5b08c1666d007eff43bca406cea359c679b4913a4c9df63a3caab02df8de files/2.6.19-kvm-2.6.20_rc4-updates.patch 100381 -AUX 2.6.19-kvm-experimental-support.patch 309516 RMD160 9e0c131dc4ab7e8cf13f19fc917641a7b880dcb7 SHA1 fceee2e9e6da0bb320ae00084ef4033a8c48fb5a SHA256 391f88e2c39fc6e7a22204a1b9005e6981fab86fd745a57cdd017caed83b957e -MD5 3817941a68a1d8e9d8c725abf969dfb2 files/2.6.19-kvm-experimental-support.patch 309516 -RMD160 9e0c131dc4ab7e8cf13f19fc917641a7b880dcb7 files/2.6.19-kvm-experimental-support.patch 309516 -SHA256 391f88e2c39fc6e7a22204a1b9005e6981fab86fd745a57cdd017caed83b957e files/2.6.19-kvm-experimental-support.patch 309516 -AUX 2.6.19-libata-pata_ali-updates.patch 6240 RMD160 6759954b2128614da51ae6d924770ad3cb1e1b5e SHA1 874b490c69147c4755ff65ff563a801913449d8b SHA256 304e77167c26392cb4e5f01420aee5a099b201c93ff9ae6f6bb48c62dc937b2f -MD5 046310958552f6ad71ff18a85bbbfd29 files/2.6.19-libata-pata_ali-updates.patch 6240 -RMD160 6759954b2128614da51ae6d924770ad3cb1e1b5e files/2.6.19-libata-pata_ali-updates.patch 6240 -SHA256 304e77167c26392cb4e5f01420aee5a099b201c93ff9ae6f6bb48c62dc937b2f files/2.6.19-libata-pata_ali-updates.patch 6240 -AUX 2.6.19-mactel.patch 67160 RMD160 d6a3fbb2ac3b66ab87678c72ec24b64d1396244c SHA1 3d08a010f34ddff73d48a34879ec71b8a3dc977c SHA256 6c22b8c9e993e35c6363e64ea1b0670d32c02430a29fa418262d0a47f022a4cc -MD5 0f1804e6158e23e6b776f02ba946d14c files/2.6.19-mactel.patch 67160 -RMD160 d6a3fbb2ac3b66ab87678c72ec24b64d1396244c files/2.6.19-mactel.patch 67160 -SHA256 6c22b8c9e993e35c6363e64ea1b0670d32c02430a29fa418262d0a47f022a4cc files/2.6.19-mactel.patch 67160 -AUX 2.6.19-sis-ide-sata-updates.patch 3032 RMD160 ed30853cd0f9cd8b21157f4e01c065f0b6d9f36d SHA1 b6b7e4e8c0c29a35cee871ad2e7fb5a75504bdbd SHA256 91a45eae36364a44ba18782682a2253d42147ef321701a5e56a6c3cd6fa0edd3 -MD5 daf1bbf4d6c0a27ccf431e7787d19ac9 files/2.6.19-sis-ide-sata-updates.patch 3032 -RMD160 ed30853cd0f9cd8b21157f4e01c065f0b6d9f36d files/2.6.19-sis-ide-sata-updates.patch 3032 -SHA256 91a45eae36364a44ba18782682a2253d42147ef321701a5e56a6c3cd6fa0edd3 files/2.6.19-sis-ide-sata-updates.patch 3032 -AUX 2.6.20-mactel.patch 31516 RMD160 eb0f3aa1cedf7efece0e16f403e78101411d2474 SHA1 09609fae7afcbe36d232bcbc4b97c7c14fb1159a SHA256 9a41691f93019361ad4057018b96461eccb340ff861923887a387e20e3f1ba78 -MD5 2aebb1391042ad6349edd5c091f9b40b files/2.6.20-mactel.patch 31516 -RMD160 eb0f3aa1cedf7efece0e16f403e78101411d2474 files/2.6.20-mactel.patch 31516 -SHA256 9a41691f93019361ad4057018b96461eccb340ff861923887a387e20e3f1ba78 files/2.6.20-mactel.patch 31516 -AUX ata-early-irq.patch 1364 RMD160 45e0c76b9de90be3e06d6fa31e6fc98ec43c40d6 SHA1 5d86ea4f520a5d01036ac6ecd77281577c5df79c SHA256 44033d38e8555a9f3b7f064a44d931336695fcdba8413765c90452496382297c -MD5 6f08a5094e84ce47b3afc93ebbad96e0 files/ata-early-irq.patch 1364 -RMD160 45e0c76b9de90be3e06d6fa31e6fc98ec43c40d6 files/ata-early-irq.patch 1364 -SHA256 44033d38e8555a9f3b7f064a44d931336695fcdba8413765c90452496382297c files/ata-early-irq.patch 1364 -AUX fuse-2.6.1.patch 19279 RMD160 4db82bdc4572c30da784c700b6546a64162dea65 SHA1 0d620578760bacc8174e8b2d410de1dc2d9b208c SHA256 2ed0b940981c1392e956c4c530240646a203149e31603c5b7768c5567af817b6 -MD5 b7b07dc6db3196a7d101b9817e450162 files/fuse-2.6.1.patch 19279 -RMD160 4db82bdc4572c30da784c700b6546a64162dea65 files/fuse-2.6.1.patch 19279 -SHA256 2ed0b940981c1392e956c4c530240646a203149e31603c5b7768c5567af817b6 files/fuse-2.6.1.patch 19279 -AUX gentoo-sources-2.6.20_rc5-kvm-compile-fix.patch 569 RMD160 a4ff15bbaa91f34771dacc2cdfc0108ca68d2cef SHA1 dbfe54e98139a2ca93f4adc589d83579df7a1e69 SHA256 4f70300722792313261e641a681098ab5b4503b47af9c6f5425cf2bead12f494 -MD5 28975e3d680e32b3df8cf137199fdc61 files/gentoo-sources-2.6.20_rc5-kvm-compile-fix.patch 569 -RMD160 a4ff15bbaa91f34771dacc2cdfc0108ca68d2cef files/gentoo-sources-2.6.20_rc5-kvm-compile-fix.patch 569 -SHA256 4f70300722792313261e641a681098ab5b4503b47af9c6f5425cf2bead12f494 files/gentoo-sources-2.6.20_rc5-kvm-compile-fix.patch 569 -AUX ipw3945-1.1.3_pre2-2.6.18.patch 637194 RMD160 92519c696c16770b86a96ff7584493e74de1057c SHA1 90e58988f9ffb5d7bdb158b83e62fef3184a4dbb SHA256 7c30d169b990884d34cd50c68189acbea01af083782d464dffa4a00a9867dcda -MD5 d21ab1caffe13287d2a6f216e670cf0e files/ipw3945-1.1.3_pre2-2.6.18.patch 637194 -RMD160 92519c696c16770b86a96ff7584493e74de1057c files/ipw3945-1.1.3_pre2-2.6.18.patch 637194 -SHA256 7c30d169b990884d34cd50c68189acbea01af083782d464dffa4a00a9867dcda files/ipw3945-1.1.3_pre2-2.6.18.patch 637194 -AUX patch-2.6.18.2-3 25690 RMD160 3877326cbf7a7bb671120225d812eb86ac88f2e7 SHA1 471a6f276469441a239eacd440884b957619c155 SHA256 4f2ab075e706b7307ca31976feb31a9f5403a7d23ce29fe43162fe6914de734f -MD5 fca747839ccc8c6717b5a9fc7d3ece89 files/patch-2.6.18.2-3 25690 -RMD160 3877326cbf7a7bb671120225d812eb86ac88f2e7 files/patch-2.6.18.2-3 25690 -SHA256 4f2ab075e706b7307ca31976feb31a9f5403a7d23ce29fe43162fe6914de734f files/patch-2.6.18.2-3 25690 -AUX patch-2.6.18.3-4 615 RMD160 b77de84deb52853e9cc25112deaaea9e4f6e4c3a SHA1 6efeeb5142fb85b0eb000997f6f7a9240da9f170 SHA256 ba7683f9cf5520a2e717cc3849348e66a22b3c01cf583ccfc1e9ba2adae2c1e6 -MD5 0c86607fea135d2934d906e46e3cfe7f files/patch-2.6.18.3-4 615 -RMD160 b77de84deb52853e9cc25112deaaea9e4f6e4c3a files/patch-2.6.18.3-4 615 -SHA256 ba7683f9cf5520a2e717cc3849348e66a22b3c01cf583ccfc1e9ba2adae2c1e6 files/patch-2.6.18.3-4 615 -AUX sata_promise-2037x-pata-2.6.19-support.patch 4005 RMD160 e897ca0a052d8e6a334cdca666d8db43f3f2c996 SHA1 bf62e5cced0f0681d208c6f8fcb777b66ab610be SHA256 d3c50598389af81c7cd4e278ee74ef63fb007241019af6207660882b993e888e -MD5 1ab85c829d2a3f047cb20c0f14315ed6 files/sata_promise-2037x-pata-2.6.19-support.patch 4005 -RMD160 e897ca0a052d8e6a334cdca666d8db43f3f2c996 files/sata_promise-2037x-pata-2.6.19-support.patch 4005 -SHA256 d3c50598389af81c7cd4e278ee74ef63fb007241019af6207660882b993e888e files/sata_promise-2037x-pata-2.6.19-support.patch 4005 -AUX toshiba-bluetooth.patch 6915 RMD160 fe48cef00d8983fbbf684175bc219328973477d7 SHA1 6616101325a2c0300ae4cbc54557b818e14089a4 SHA256 fa964d64836d558b2c3865697004b7047d9525e23181e1ab11cfb6abf6b5f77a -MD5 af783746cf2540717422281d2c89f4b6 files/toshiba-bluetooth.patch 6915 -RMD160 fe48cef00d8983fbbf684175bc219328973477d7 files/toshiba-bluetooth.patch 6915 -SHA256 fa964d64836d558b2c3865697004b7047d9525e23181e1ab11cfb6abf6b5f77a files/toshiba-bluetooth.patch 6915 -DIST fbsplash-0.9.2-r5-2.6.19-rc2.patch 53383 RMD160 d503285b48eb26c40f782e83abe2254a2f61999f SHA1 45beae0cfb66d42e66b130d7b85d5dd1cdd01710 SHA256 a89ed8e338c78be2324a42d13944b8dd265f6801aaaf41db61daa4cf6ba9d13f -DIST genpatches-2.6.18-3.base.tar.bz2 82684 RMD160 52a13662a88511dbd0e75a2342a05bffe7b5300b SHA1 34602ce6db7bf5e7b1c5d1c70e788223af4fb990 SHA256 9b561cf36416d0377eac1ead9194c34c55744f175488a5d80d1c6b3a73572f50 -DIST genpatches-2.6.18-3.extras.tar.bz2 143265 RMD160 b2b158d42d6116d2a807c05dc8a4ef5680debc98 SHA1 cf9e60c7573a29eca204c310ef4b3260aacb1b49 SHA256 9d8e04c285af164324307d25ef52f16631e91d293c82c82f78e6e4375145a5b7 -DIST genpatches-2.6.19-2.base.tar.bz2 2057 RMD160 9abc074d09f53c89a4f6a98a0ac007e7f69463cf SHA1 1db3f586358f3a722576b6f0077cdf347d784d81 SHA256 b8f3e88daadad3808006a5948cebef85976fa3bcea224cf8169b2ac38de725c3 -DIST genpatches-2.6.19-2.extras.tar.bz2 139339 RMD160 3ef2e56db8bd3441db59a4caca4b96b7eb76a66e SHA1 3de4a7df313d29620e850dac42fac88e2a63068b SHA256 3d877d02e90308681d358f8b5dd6e6dde180ffca7e4efeb2a11ffd812da07911 -DIST genpatches-2.6.19-3.base.tar.bz2 15941 RMD160 44db8c27990e978fe9116a49388eda610a473977 SHA1 d42492b304b2d1140ae432de317f01c651363ff4 SHA256 6af4f94b8cea0c86bda44ae9666a23f6e6666f1fc353f7fd0801c6cb5837b762 -DIST genpatches-2.6.19-3.extras.tar.bz2 139459 RMD160 9b3dd25b781854feab0d325cc4327e7035fef60b SHA1 1210eed0c0b4ee825e449349b3c7544d9c96721b SHA256 9900288ef68f9c9f93fab4659a4eb2c50d3a3b0ee64e457d9aafee642cd7be19 -DIST ipw3945-1.1.3-2.6.19.patch 614020 RMD160 300f52ff78dbfff5ee3899b4b9fa9193f73e2814 SHA1 12a43752deed2cffdc773eb66e74d749200736f5 SHA256 57abc7c6779c64765b2bed63f302a4e440b7068ca3c3de2dc52fe19f3d7d3b49 -DIST ipw3945-1.2.0-2.6.20.patch 616174 RMD160 befea8ee02a021566687dddf37ab4ea48f6ce590 SHA1 7ab2b0bd8b329d3aa11ff8774312dcab60c86524 SHA256 502d8b8d9ebaf2da9df5ec212a8677c405732d30a1fecb55ed0eb1933ed9badf -DIST linux-2.6.18.tar.bz2 41863580 RMD160 f92283f956880676bfb1f1d5288325461e4e02e7 SHA1 178f7d5bb3af0978d42b37651b8753323c7129c2 SHA256 c95280ff6c5d2a17788f7cc582d23ae8a9a7ba3f202ec6e4238eaadfce7c163d -DIST linux-2.6.19.tar.bz2 42733268 RMD160 75dc65b15cf9cdb359b1abe7084907982c19088b SHA1 c00d5891e2461bce45be51c1ef7846ee842792dd SHA256 c2fd6bcd2b7c1b3d37d64e4d1825703792a75474830a3db7d2dc603a8d392d58 -DIST patch-2.6.20-rc5.bz2 3667548 RMD160 961f05e298496a9f3ed1a686f22581a8c827753c SHA1 ba769613f03ceccb947a376a9081a8ce5ab4846f SHA256 3d76a82468326761860c273c0cb6899588446aa31d0bf85440b1a9d37af4fd46 -DIST patch-2.6.20-rc6.bz2 3800220 RMD160 00f874acc05e8307f98ad791d3fd27fb767c84a3 SHA1 74a78176273e18dad8bd0c856946546bc5ad436c SHA256 7059f5c7cc4cd08152d3775969bf22992de9dda678e1e2dd4c46248883ca1242 -DIST squashfs-3.2-2.6.20.patch 132210 RMD160 d48bf39a7118b0462867fd43701416e3990227fe SHA1 4ccdbe28611f582aaba01d831196baf5c35c508e SHA256 cfc7060a0387701834a4a3ae2d95f5f247e02d8c7f88cf45b5004c363c1d0c1d -DIST suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 RMD160 7c27f1d1514a30a410b779c61c8ffad7fe231369 SHA1 f1c27074cabb1ebdb068d1af6aaa188f57119807 SHA256 3321c0004016fcb4b1e490fd42f98f6855c475baa8bcb21917481dadc1af638a -DIST suspend2-2.2.9.3-for-2.6.20-rc4.patch.bz2 100601 RMD160 e89addaac321c00965a2747ee49191627f60c73d SHA1 75d1871ba0f8672011cbe930ef19fa895a0683cd SHA256 163e0377bf688b304ae5b8fd736858988fcd2b2acfa6e1921b61a9554855a4d4 -EBUILD gentoo-sources-2.6.18-r3.ebuild 1443 RMD160 423ed64327d0e00d0984e8255a62ade2b8ef7d16 SHA1 74ba50bdc35204e686955c072e92d53d3f17c94f SHA256 f3439cbab68229590aa058e0252b1594f6082e84d7dcd04e1f9540f700b58b2c -MD5 c3b09ddf588b65598062289559e87cdf gentoo-sources-2.6.18-r3.ebuild 1443 -RMD160 423ed64327d0e00d0984e8255a62ade2b8ef7d16 gentoo-sources-2.6.18-r3.ebuild 1443 -SHA256 f3439cbab68229590aa058e0252b1594f6082e84d7dcd04e1f9540f700b58b2c gentoo-sources-2.6.18-r3.ebuild 1443 -EBUILD gentoo-sources-2.6.18-r4.ebuild 1494 RMD160 87bc9d5fef7288ccbb681b4b0f27b8a99e0912c6 SHA1 9af08d7396cb7608093d16420f7b61c7accd1cb2 SHA256 20aabbf9e3a33df8dedbda2d57a11f3d71ebe4eb6425c32dba6cdaf6412ea1d6 -MD5 86dbfe79909bab540250adf0dbee6cc3 gentoo-sources-2.6.18-r4.ebuild 1494 -RMD160 87bc9d5fef7288ccbb681b4b0f27b8a99e0912c6 gentoo-sources-2.6.18-r4.ebuild 1494 -SHA256 20aabbf9e3a33df8dedbda2d57a11f3d71ebe4eb6425c32dba6cdaf6412ea1d6 gentoo-sources-2.6.18-r4.ebuild 1494 -EBUILD gentoo-sources-2.6.18-r5.ebuild 1615 RMD160 b1790168ddd36fcd3d39e3a8bb29dc0c272a4955 SHA1 3543c577e352c02aecac6ebbbeb96c8982fbf78e SHA256 4b412586fd41b19c4d1c51494f2801a053b35dbbf4409a7f381879627745029c -MD5 525e3758a51e1e1b63e7462ba2d49d49 gentoo-sources-2.6.18-r5.ebuild 1615 -RMD160 b1790168ddd36fcd3d39e3a8bb29dc0c272a4955 gentoo-sources-2.6.18-r5.ebuild 1615 -SHA256 4b412586fd41b19c4d1c51494f2801a053b35dbbf4409a7f381879627745029c gentoo-sources-2.6.18-r5.ebuild 1615 -EBUILD gentoo-sources-2.6.19-r1.ebuild 1292 RMD160 3c7727e01a86c113893340556f0dc1bf4c7cf047 SHA1 a1784035e1750bce7c1adf3d43276d4f9c723366 SHA256 c58c8f1829d34ebdccf416843bbc5f47fe4acbd1b92d9a5dcd87967353b729c8 -MD5 386b1fd232c60fca69d753819ffe5f03 gentoo-sources-2.6.19-r1.ebuild 1292 -RMD160 3c7727e01a86c113893340556f0dc1bf4c7cf047 gentoo-sources-2.6.19-r1.ebuild 1292 -SHA256 c58c8f1829d34ebdccf416843bbc5f47fe4acbd1b92d9a5dcd87967353b729c8 gentoo-sources-2.6.19-r1.ebuild 1292 -EBUILD gentoo-sources-2.6.19-r2.ebuild 1292 RMD160 6f5c7ff2670509f0916b632df47b85c65ebec4b8 SHA1 7ddd1e3441115f86647d02c0536f143bd83293d0 SHA256 f0697c5579b6afac4cdbba891b325d01454d3305e64b15f585cbf8e85807af29 -MD5 5ee8cf87a27544e01d57e1a3ddfe6243 gentoo-sources-2.6.19-r2.ebuild 1292 -RMD160 6f5c7ff2670509f0916b632df47b85c65ebec4b8 gentoo-sources-2.6.19-r2.ebuild 1292 -SHA256 f0697c5579b6afac4cdbba891b325d01454d3305e64b15f585cbf8e85807af29 gentoo-sources-2.6.19-r2.ebuild 1292 -EBUILD gentoo-sources-2.6.19-r3.ebuild 1396 RMD160 206c3fc793d6ed02fcab6972d2ed733364dc061d SHA1 a68ba9d63fea5aed95a674ac7fab65bde34bb7c6 SHA256 f1984fe2144b5d3578f36dc596e948feab8f7582efd2791e0a6f4eac24510576 -MD5 e56f4b604071ecc1c155d5fc180de52a gentoo-sources-2.6.19-r3.ebuild 1396 -RMD160 206c3fc793d6ed02fcab6972d2ed733364dc061d gentoo-sources-2.6.19-r3.ebuild 1396 -SHA256 f1984fe2144b5d3578f36dc596e948feab8f7582efd2791e0a6f4eac24510576 gentoo-sources-2.6.19-r3.ebuild 1396 -EBUILD gentoo-sources-2.6.19-r4.ebuild 1971 RMD160 3c3205d9b4a639e9b72ad94322c4740ee226ff33 SHA1 f6abf4b5b7b7422e74faf7da5a9e1e00e6c93d40 SHA256 cc3722b345cb565172b5bf71e4b5041d63a7013ac56987eb8fd85b6b7874e9fd -MD5 fb424b63cfed34a895eb0c8d6e78b9f6 gentoo-sources-2.6.19-r4.ebuild 1971 -RMD160 3c3205d9b4a639e9b72ad94322c4740ee226ff33 gentoo-sources-2.6.19-r4.ebuild 1971 -SHA256 cc3722b345cb565172b5bf71e4b5041d63a7013ac56987eb8fd85b6b7874e9fd gentoo-sources-2.6.19-r4.ebuild 1971 -EBUILD gentoo-sources-2.6.19-r5.ebuild 2087 RMD160 acfda78a351e43489db4ce3c4193caf345b9332d SHA1 e329bb15162b14cdcd7a4b72be3ea00336fccd49 SHA256 1c95f0e4c3c97c645153a50692c06a865582e7b28fb2e1003d80c16a5f54a659 -MD5 1ce750cb2ce69061cb7f3cca7d361545 gentoo-sources-2.6.19-r5.ebuild 2087 -RMD160 acfda78a351e43489db4ce3c4193caf345b9332d gentoo-sources-2.6.19-r5.ebuild 2087 -SHA256 1c95f0e4c3c97c645153a50692c06a865582e7b28fb2e1003d80c16a5f54a659 gentoo-sources-2.6.19-r5.ebuild 2087 -EBUILD gentoo-sources-2.6.20_rc5-r2.ebuild 1489 RMD160 a97ff5debaa0da39df51f3c270ba4e5375556d54 SHA1 7459bceac108e4f72b4151a3d47c433c3629f869 SHA256 df0f45c9d7bec1a361b4672e6ff44f623358488ebc2ed86e624cbdf20a4546f7 -MD5 5dded7cf7efb47ac9b4c975cb8db48bb gentoo-sources-2.6.20_rc5-r2.ebuild 1489 -RMD160 a97ff5debaa0da39df51f3c270ba4e5375556d54 gentoo-sources-2.6.20_rc5-r2.ebuild 1489 -SHA256 df0f45c9d7bec1a361b4672e6ff44f623358488ebc2ed86e624cbdf20a4546f7 gentoo-sources-2.6.20_rc5-r2.ebuild 1489 -EBUILD gentoo-sources-2.6.20_rc6.ebuild 1450 RMD160 223b1f2b72a4ba1e070a8ae292c1a1ab54aacd52 SHA1 d761e9924318aa965f37eb31d7bd0a055b69d2c3 SHA256 07e89a47704bc3fa3c59e545c11da2c69993a8c6a1b763fa4f7fa07860f0dc67 -MD5 cb18796254b15f686d2a0a2e25c7af9c gentoo-sources-2.6.20_rc6.ebuild 1450 -RMD160 223b1f2b72a4ba1e070a8ae292c1a1ab54aacd52 gentoo-sources-2.6.20_rc6.ebuild 1450 -SHA256 07e89a47704bc3fa3c59e545c11da2c69993a8c6a1b763fa4f7fa07860f0dc67 gentoo-sources-2.6.20_rc6.ebuild 1450 -MD5 7917755b2686d4bce76f58ce875b1fcb files/digest-gentoo-sources-2.6.18-r3 804 -RMD160 4105172ae01f4b2affcebd0d48fc49c25fb4ab9a files/digest-gentoo-sources-2.6.18-r3 804 -SHA256 4500b0faa417da83f03ee9d6fc5caf005c1499db631f9d87b87b340be21c646b files/digest-gentoo-sources-2.6.18-r3 804 -MD5 7917755b2686d4bce76f58ce875b1fcb files/digest-gentoo-sources-2.6.18-r4 804 -RMD160 4105172ae01f4b2affcebd0d48fc49c25fb4ab9a files/digest-gentoo-sources-2.6.18-r4 804 -SHA256 4500b0faa417da83f03ee9d6fc5caf005c1499db631f9d87b87b340be21c646b files/digest-gentoo-sources-2.6.18-r4 804 -MD5 7917755b2686d4bce76f58ce875b1fcb files/digest-gentoo-sources-2.6.18-r5 804 -RMD160 4105172ae01f4b2affcebd0d48fc49c25fb4ab9a files/digest-gentoo-sources-2.6.18-r5 804 -SHA256 4500b0faa417da83f03ee9d6fc5caf005c1499db631f9d87b87b340be21c646b files/digest-gentoo-sources-2.6.18-r5 804 -MD5 545343a0e1a2cb17309dc87cc0d33bae files/digest-gentoo-sources-2.6.19-r1 1358 -RMD160 94b23a667cc971a16dfc3131e63c7b0252bf18d9 files/digest-gentoo-sources-2.6.19-r1 1358 -SHA256 02040ab177f8458f11b4336a2e202198e81cd61485cba43b5587b19b6b589f44 files/digest-gentoo-sources-2.6.19-r1 1358 -MD5 e81189f064edb492324a76de15e9c27f files/digest-gentoo-sources-2.6.19-r2 1361 -RMD160 cf41868e5f6fcd316cc355c6d198992d81177ca5 files/digest-gentoo-sources-2.6.19-r2 1361 -SHA256 6b79639420738eb960d38bee6ee1b536592d7c0b12ed5b0a65dfa45e8d044e84 files/digest-gentoo-sources-2.6.19-r2 1361 -MD5 e81189f064edb492324a76de15e9c27f files/digest-gentoo-sources-2.6.19-r3 1361 -RMD160 cf41868e5f6fcd316cc355c6d198992d81177ca5 files/digest-gentoo-sources-2.6.19-r3 1361 -SHA256 6b79639420738eb960d38bee6ee1b536592d7c0b12ed5b0a65dfa45e8d044e84 files/digest-gentoo-sources-2.6.19-r3 1361 -MD5 e81189f064edb492324a76de15e9c27f files/digest-gentoo-sources-2.6.19-r4 1361 -RMD160 cf41868e5f6fcd316cc355c6d198992d81177ca5 files/digest-gentoo-sources-2.6.19-r4 1361 -SHA256 6b79639420738eb960d38bee6ee1b536592d7c0b12ed5b0a65dfa45e8d044e84 files/digest-gentoo-sources-2.6.19-r4 1361 -MD5 e81189f064edb492324a76de15e9c27f files/digest-gentoo-sources-2.6.19-r5 1361 -RMD160 cf41868e5f6fcd316cc355c6d198992d81177ca5 files/digest-gentoo-sources-2.6.19-r5 1361 -SHA256 6b79639420738eb960d38bee6ee1b536592d7c0b12ed5b0a65dfa45e8d044e84 files/digest-gentoo-sources-2.6.19-r5 1361 -MD5 72aa720aecb46080f064c119029c89cf files/digest-gentoo-sources-2.6.20_rc5-r2 1590 -RMD160 1dc0573fd882e69b44732d08609b96aef27beef9 files/digest-gentoo-sources-2.6.20_rc5-r2 1590 -SHA256 998937fc9b8a407f8a0eea7d74a3af3d60ab77c912f9af34b4ef7ff909f69bc7 files/digest-gentoo-sources-2.6.20_rc5-r2 1590 -MD5 f9f876e6426518836f06bce50c5f0764 files/digest-gentoo-sources-2.6.20_rc6 1590 -RMD160 67c0e3257eb9fb08f0cf73ee0a15ef6e26658638 files/digest-gentoo-sources-2.6.20_rc6 1590 -SHA256 29de2d4da5afe67a4e930dfb7dd367f9071cd3106dba5b347c0e647b0f08b174 files/digest-gentoo-sources-2.6.20_rc6 1590 diff --git a/sys-kernel/gentoo-sources/files/09-non-libata-driver-for-jmicron-devices.patch b/sys-kernel/gentoo-sources/files/09-non-libata-driver-for-jmicron-devices.patch deleted file mode 100644 index 4e8e5443f..000000000 --- a/sys-kernel/gentoo-sources/files/09-non-libata-driver-for-jmicron-devices.patch +++ /dev/null @@ -1,321 +0,0 @@ -Less functional than libata this just uses the merged interface provided for - -From: Alan Cox - -dumb legacy OS's. This is basically a bridge for people not yet ready to use -libata for some reason or another. - -Port visibility is entirely dependant on the BIOS setup. - -Signed-off-by: Alan Cox -Signed-off-by: Andrew Morton ---- - - drivers/ide/Kconfig | 6 + - drivers/ide/pci/Makefile | 1 - drivers/ide/pci/jmicron.c | 269 ++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 276 insertions(+) - -Index: linux-2.6.18/drivers/ide/Kconfig -=================================================================== ---- linux-2.6.18.orig/drivers/ide/Kconfig -+++ linux-2.6.18/drivers/ide/Kconfig -@@ -594,6 +594,12 @@ config BLK_DEV_HPT366 - ide-probe at boot. It is reported to support DVD II drives, by the - manufacturer. - -+config BLK_DEV_JMICRON -+ tristate "JMicron JMB36x support" -+ help -+ Basic support for the JMicron ATA controllers. For full support -+ use the libata drivers. -+ - config BLK_DEV_SC1200 - tristate "National SCx200 chipset support" - help -Index: linux-2.6.18/drivers/ide/pci/Makefile -=================================================================== ---- linux-2.6.18.orig/drivers/ide/pci/Makefile -+++ linux-2.6.18/drivers/ide/pci/Makefile -@@ -14,6 +14,7 @@ obj-$(CONFIG_BLK_DEV_HPT366) += hpt366. - #obj-$(CONFIG_BLK_DEV_HPT37X) += hpt37x.o - obj-$(CONFIG_BLK_DEV_IT8172) += it8172.o - obj-$(CONFIG_BLK_DEV_IT821X) += it821x.o -+obj-$(CONFIG_BLK_DEV_JMICRON) += jmicron.o - obj-$(CONFIG_BLK_DEV_NS87415) += ns87415.o - obj-$(CONFIG_BLK_DEV_OPTI621) += opti621.o - obj-$(CONFIG_BLK_DEV_PDC202XX_OLD) += pdc202xx_old.o -Index: linux-2.6.18/drivers/ide/pci/jmicron.c -=================================================================== ---- /dev/null -+++ linux-2.6.18/drivers/ide/pci/jmicron.c -@@ -0,0 +1,269 @@ -+ -+/* -+ * Copyright (C) 2006 Red Hat -+ * -+ * May be copied or modified under the terms of the GNU General Public License -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+typedef enum { -+ PORT_PATA0 = 0, -+ PORT_PATA1 = 1, -+ PORT_SATA = 2, -+} port_type; -+ -+/** -+ * jmicron_ratemask - Compute available modes -+ * @drive: IDE drive -+ * -+ * Compute the available speeds for the devices on the interface. This -+ * is all modes to ATA133 clipped by drive cable setup. -+ */ -+ -+static u8 jmicron_ratemask(ide_drive_t *drive) -+{ -+ u8 mode = 4; -+ if (!eighty_ninty_three(drive)) -+ mode = min(mode, (u8)1); -+ return mode; -+} -+ -+/** -+ * ata66_jmicron - Cable check -+ * @hwif: IDE port -+ * -+ * Return 1 if the cable is 80pin -+ */ -+ -+static int __devinit ata66_jmicron(ide_hwif_t *hwif) -+{ -+ struct pci_dev *pdev = hwif->pci_dev; -+ -+ u32 control; -+ u32 control5; -+ -+ int port = hwif->channel; -+ port_type port_map[2]; -+ -+ pci_read_config_dword(pdev, 0x40, &control); -+ -+ /* There are two basic mappings. One has the two SATA ports merged -+ as master/slave and the secondary as PATA, the other has only the -+ SATA port mapped */ -+ if (control & (1 << 23)) { -+ port_map[0] = PORT_SATA; -+ port_map[1] = PORT_PATA0; -+ } else { -+ port_map[0] = PORT_SATA; -+ port_map[1] = PORT_SATA; -+ } -+ -+ /* The 365/366 may have this bit set to map the second PATA port -+ as the internal primary channel */ -+ pci_read_config_dword(pdev, 0x80, &control5); -+ if (control5 & (1<<24)) -+ port_map[0] = PORT_PATA1; -+ -+ /* The two ports may then be logically swapped by the firmware */ -+ if (control & (1 << 22)) -+ port = port ^ 1; -+ -+ /* -+ * Now we know which physical port we are talking about we can -+ * actually do our cable checking etc. Thankfully we don't need -+ * to do the plumbing for other cases. -+ */ -+ switch (port_map[port]) -+ { -+ case PORT_PATA0: -+ if (control & (1 << 3)) /* 40/80 pin primary */ -+ return 1; -+ return 0; -+ case PORT_PATA1: -+ if (control5 & (1 << 19)) /* 40/80 pin secondary */ -+ return 0; -+ return 1; -+ case PORT_SATA: -+ return 1; -+ } -+} -+ -+static void jmicron_tuneproc (ide_drive_t *drive, byte mode_wanted) -+{ -+ return; -+} -+ -+/** -+ * config_jmicron_chipset_for_pio - set drive timings -+ * @drive: drive to tune -+ * @speed we want -+ * -+ */ -+ -+static void config_jmicron_chipset_for_pio (ide_drive_t *drive, byte set_speed) -+{ -+ u8 speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); -+ if (set_speed) -+ (void) ide_config_drive_speed(drive, speed); -+} -+ -+/** -+ * jmicron_tune_chipset - set controller timings -+ * @drive: Drive to set up -+ * @xferspeed: speed we want to achieve -+ * -+ * As the JMicron snoops for timings all we actually need to do is -+ * make sure we don't set an invalid mode. We do need to honour -+ * the cable detect here. -+ */ -+ -+static int jmicron_tune_chipset (ide_drive_t *drive, byte xferspeed) -+{ -+ -+ u8 speed = ide_rate_filter(jmicron_ratemask(drive), xferspeed); -+ -+ return ide_config_drive_speed(drive, speed); -+} -+ -+/** -+ * config_chipset_for_dma - configure for DMA -+ * @drive: drive to configure -+ * -+ * As the JMicron snoops for timings all we actually need to do is -+ * make sure we don't set an invalid mode. -+ */ -+ -+static int config_chipset_for_dma (ide_drive_t *drive) -+{ -+ u8 speed = ide_dma_speed(drive, jmicron_ratemask(drive)); -+ -+ config_jmicron_chipset_for_pio(drive, !speed); -+ jmicron_tune_chipset(drive, speed); -+ return ide_dma_enable(drive); -+} -+ -+/** -+ * jmicron_configure_drive_for_dma - set up for DMA transfers -+ * @drive: drive we are going to set up -+ * -+ * As the JMicron snoops for timings all we actually need to do is -+ * make sure we don't set an invalid mode. -+ */ -+ -+static int jmicron_config_drive_for_dma (ide_drive_t *drive) -+{ -+ ide_hwif_t *hwif = drive->hwif; -+ -+ if (ide_use_dma(drive)) { -+ if (config_chipset_for_dma(drive)) -+ return hwif->ide_dma_on(drive); -+ } -+ config_jmicron_chipset_for_pio(drive, 1); -+ return hwif->ide_dma_off_quietly(drive); -+} -+ -+/** -+ * init_hwif_jmicron - set up hwif structs -+ * @hwif: interface to set up -+ * -+ * Minimal set up is required for the Jmicron hardware. -+ */ -+ -+static void __devinit init_hwif_jmicron(ide_hwif_t *hwif) -+{ -+ hwif->speedproc = &jmicron_tune_chipset; -+ hwif->tuneproc = &jmicron_tuneproc; -+ -+ hwif->drives[0].autotune = 1; -+ hwif->drives[1].autotune = 1; -+ -+ if (!hwif->dma_base) -+ goto fallback; -+ -+ hwif->atapi_dma = 1; -+ hwif->ultra_mask = 0x7f; -+ hwif->mwdma_mask = 0x07; -+ -+ hwif->ide_dma_check = &jmicron_config_drive_for_dma; -+ if (!(hwif->udma_four)) -+ hwif->udma_four = ata66_jmicron(hwif); -+ -+ hwif->autodma = 1; -+ hwif->drives[0].autodma = hwif->autodma; -+ hwif->drives[1].autodma = hwif->autodma; -+ return; -+fallback: -+ hwif->autodma = 0; -+ return; -+} -+ -+#define DECLARE_JMB_DEV(name_str) \ -+ { \ -+ .name = name_str, \ -+ .init_hwif = init_hwif_jmicron, \ -+ .channels = 2, \ -+ .autodma = AUTODMA, \ -+ .bootable = ON_BOARD, \ -+ .enablebits = { {0x40, 1, 1}, {0x40, 0x10, 0x10} }, \ -+ } -+ -+static ide_pci_device_t jmicron_chipsets[] __devinitdata = { -+ /* 0 */ DECLARE_JMB_DEV("JMB361"), -+ /* 1 */ DECLARE_JMB_DEV("JMB363"), -+ /* 2 */ DECLARE_JMB_DEV("JMB365"), -+ /* 3 */ DECLARE_JMB_DEV("JMB366"), -+ /* 4 */ DECLARE_JMB_DEV("JMB368"), -+}; -+ -+/** -+ * jmicron_init_one - pci layer discovery entry -+ * @dev: PCI device -+ * @id: ident table entry -+ * -+ * Called by the PCI code when it finds a Jmicron controller. -+ * We then use the IDE PCI generic helper to do most of the work. -+ */ -+ -+static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_device_id *id) -+{ -+ ide_setup_pci_device(dev, &jmicron_chipsets[id->driver_data]); -+ return 0; -+} -+ -+static struct pci_device_id jmicron_pci_tbl[] = { -+ { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361), 0}, -+ { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363), 1}, -+ { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365), 2}, -+ { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366), 3}, -+ { PCI_DEVICE(PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368), 4}, -+ { 0, }, -+}; -+ -+MODULE_DEVICE_TABLE(pci, jmicron_pci_tbl); -+ -+static struct pci_driver driver = { -+ .name = "JMicron IDE", -+ .id_table = jmicron_pci_tbl, -+ .probe = jmicron_init_one, -+}; -+ -+static int __init jmicron_ide_init(void) -+{ -+ return ide_pci_register_driver(&driver); -+} -+ -+module_init(jmicron_ide_init); -+ -+MODULE_AUTHOR("Alan Cox"); -+MODULE_DESCRIPTION("PCI driver module for the JMicron in legacy modes"); -+MODULE_LICENSE("GPL"); diff --git a/sys-kernel/gentoo-sources/files/2.6.18-am2-nvidia-ati.patch b/sys-kernel/gentoo-sources/files/2.6.18-am2-nvidia-ati.patch deleted file mode 100644 index 6efae9e9b..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.18-am2-nvidia-ati.patch +++ /dev/null @@ -1,280 +0,0 @@ -From: Andi Kleen -Date: Tue, 26 Sep 2006 08:52:30 +0000 (+0200) -Subject: [PATCH] Move early chipset quirks out to new file -X-Git-Tag: v2.6.19-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=dfa4698c50bf85b7927214b0e4a3dc4bc3b3c4a9 - -[PATCH] Move early chipset quirks out to new file - -They did not really belong into io_apic.c. Move them into a new file -and clean it up a bit. - -Also remove outdated ATI quirk that was obsolete, - -Signed-off-by: Andi Kleen ---- - ---- a/arch/x86_64/kernel/Makefile -+++ b/arch/x86_64/kernel/Makefile -@@ -8,7 +8,7 @@ obj-y := process.o signal.o entry.o trap - ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \ - x8664_ksyms.o i387.o syscall.o vsyscall.o \ - setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \ -- pci-dma.o pci-nommu.o alternative.o -+ pci-dma.o pci-nommu.o alternative.o early-quirks.o - - obj-$(CONFIG_STACKTRACE) += stacktrace.o - obj-$(CONFIG_X86_MCE) += mce.o ---- /dev/null -+++ b/arch/x86_64/kernel/early-quirks.c -@@ -0,0 +1,118 @@ -+/* Various workarounds for chipset bugs. -+ This code runs very early and can't use the regular PCI subsystem -+ The entries are keyed to PCI bridges which usually identify chipsets -+ uniquely. -+ This is only for whole classes of chipsets with specific problems which -+ need early invasive action (e.g. before the timers are initialized). -+ Most PCI device specific workarounds can be done later and should be -+ in standard PCI quirks -+ Mainboard specific bugs should be handled by DMI entries. -+ CPU specific bugs in setup.c */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static void via_bugs(void) -+{ -+#ifdef CONFIG_IOMMU -+ if ((end_pfn > MAX_DMA32_PFN || force_iommu) && -+ !iommu_aperture_allowed) { -+ printk(KERN_INFO -+ "Looks like a VIA chipset. Disabling IOMMU. Override with iommu=allowed\n"); -+ iommu_aperture_disabled = 1; -+ } -+#endif -+} -+ -+#ifdef CONFIG_ACPI -+ -+static int nvidia_hpet_detected __initdata; -+ -+static int __init nvidia_hpet_check(unsigned long phys, unsigned long size) -+{ -+ nvidia_hpet_detected = 1; -+ return 0; -+} -+#endif -+ -+static void nvidia_bugs(void) -+{ -+#ifdef CONFIG_ACPI -+ /* -+ * All timer overrides on Nvidia are -+ * wrong unless HPET is enabled. -+ */ -+ nvidia_hpet_detected = 0; -+ acpi_table_parse(ACPI_HPET, nvidia_hpet_check); -+ if (nvidia_hpet_detected == 0) { -+ acpi_skip_timer_override = 1; -+ printk(KERN_INFO "Nvidia board " -+ "detected. Ignoring ACPI " -+ "timer override.\n"); -+ } -+#endif -+ /* RED-PEN skip them on mptables too? */ -+ -+} -+ -+static void ati_bugs(void) -+{ -+#if 1 /* for testing */ -+ printk("ATI board detected\n"); -+#endif -+ /* No bugs right now */ -+} -+ -+struct chipset { -+ u16 vendor; -+ void (*f)(void); -+}; -+ -+static struct chipset early_qrk[] = { -+ { PCI_VENDOR_ID_NVIDIA, nvidia_bugs }, -+ { PCI_VENDOR_ID_VIA, via_bugs }, -+ { PCI_VENDOR_ID_ATI, ati_bugs }, -+ {} -+}; -+ -+void __init early_quirks(void) -+{ -+ int num, slot, func; -+ /* Poor man's PCI discovery */ -+ for (num = 0; num < 32; num++) { -+ for (slot = 0; slot < 32; slot++) { -+ for (func = 0; func < 8; func++) { -+ u32 class; -+ u32 vendor; -+ u8 type; -+ int i; -+ class = read_pci_config(num,slot,func, -+ PCI_CLASS_REVISION); -+ if (class == 0xffffffff) -+ break; -+ -+ if ((class >> 16) != PCI_CLASS_BRIDGE_PCI) -+ continue; -+ -+ vendor = read_pci_config(num, slot, func, -+ PCI_VENDOR_ID); -+ vendor &= 0xffff; -+ -+ for (i = 0; early_qrk[i].f; i++) -+ if (early_qrk[i].vendor == vendor) { -+ early_qrk[i].f(); -+ return; -+ } -+ -+ type = read_pci_config_byte(num, slot, func, -+ PCI_HEADER_TYPE); -+ if (!(type & 0x80)) -+ break; -+ } -+ } -+ } -+} ---- a/arch/x86_64/kernel/io_apic.c -+++ b/arch/x86_64/kernel/io_apic.c -@@ -280,107 +280,6 @@ static int __init setup_enable_8254_time - __setup("disable_8254_timer", setup_disable_8254_timer); - __setup("enable_8254_timer", setup_enable_8254_timer); - --#include --#include --#include -- -- --#ifdef CONFIG_ACPI -- --static int nvidia_hpet_detected __initdata; -- --static int __init nvidia_hpet_check(unsigned long phys, unsigned long size) --{ -- nvidia_hpet_detected = 1; -- return 0; --} --#endif -- --/* Temporary Hack. Nvidia and VIA boards currently only work with IO-APIC -- off. Check for an Nvidia or VIA PCI bridge and turn it off. -- Use pci direct infrastructure because this runs before the PCI subsystem. -- -- Can be overwritten with "apic" -- -- And another hack to disable the IOMMU on VIA chipsets. -- -- ... and others. Really should move this somewhere else. -- -- Kludge-O-Rama. */ --void __init check_ioapic(void) --{ -- int num,slot,func; -- /* Poor man's PCI discovery */ -- for (num = 0; num < 32; num++) { -- for (slot = 0; slot < 32; slot++) { -- for (func = 0; func < 8; func++) { -- u32 class; -- u32 vendor; -- u8 type; -- class = read_pci_config(num,slot,func, -- PCI_CLASS_REVISION); -- if (class == 0xffffffff) -- break; -- -- if ((class >> 16) != PCI_CLASS_BRIDGE_PCI) -- continue; -- -- vendor = read_pci_config(num, slot, func, -- PCI_VENDOR_ID); -- vendor &= 0xffff; -- switch (vendor) { -- case PCI_VENDOR_ID_VIA: --#ifdef CONFIG_IOMMU -- if ((end_pfn > MAX_DMA32_PFN || -- force_iommu) && -- !iommu_aperture_allowed) { -- printk(KERN_INFO -- "Looks like a VIA chipset. Disabling IOMMU. Override with \"iommu=allowed\"\n"); -- iommu_aperture_disabled = 1; -- } --#endif -- return; -- case PCI_VENDOR_ID_NVIDIA: --#ifdef CONFIG_ACPI -- /* -- * All timer overrides on Nvidia are -- * wrong unless HPET is enabled. -- */ -- nvidia_hpet_detected = 0; -- acpi_table_parse(ACPI_HPET, -- nvidia_hpet_check); -- if (nvidia_hpet_detected == 0) { -- acpi_skip_timer_override = 1; -- printk(KERN_INFO "Nvidia board " -- "detected. Ignoring ACPI " -- "timer override.\n"); -- } --#endif -- /* RED-PEN skip them on mptables too? */ -- return; -- -- /* This should be actually default, but -- for 2.6.16 let's do it for ATI only where -- it's really needed. */ -- case PCI_VENDOR_ID_ATI: -- if (timer_over_8254 == 1) { -- timer_over_8254 = 0; -- printk(KERN_INFO -- "ATI board detected. Disabling timer routing over 8254.\n"); -- } -- return; -- } -- -- -- /* No multi-function device? */ -- type = read_pci_config_byte(num,slot,func, -- PCI_HEADER_TYPE); -- if (!(type & 0x80)) -- break; -- } -- } -- } --} - - /* - * Find the IRQ entry number of a certain pin. ---- a/arch/x86_64/kernel/setup.c -+++ b/arch/x86_64/kernel/setup.c -@@ -653,7 +653,7 @@ void __init setup_arch(char **cmdline_p) - - paging_init(); - -- check_ioapic(); -+ early_quirks(); - - /* - * set this early, so we dont allocate cpu0 ---- a/include/asm-x86_64/proto.h -+++ b/include/asm-x86_64/proto.h -@@ -92,7 +92,7 @@ extern void syscall32_cpu_init(void); - - extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long end); - --extern void check_ioapic(void); -+extern void early_quirks(void); - extern void check_efer(void); - - extern int unhandled_signal(struct task_struct *tsk, int sig); diff --git a/sys-kernel/gentoo-sources/files/2.6.18-am2-nvidia-fix.patch b/sys-kernel/gentoo-sources/files/2.6.18-am2-nvidia-fix.patch deleted file mode 100644 index 0839ad029..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.18-am2-nvidia-fix.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: Andi Kleen -Date: Sat, 21 Oct 2006 16:37:03 +0000 (+0200) -Subject: [PATCH] x86-64: Revert timer routing behaviour back to 2.6.16 state -X-Git-Tag: v2.6.19-rc3 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=e70ea8c09db0e25ab58f84ba7f393e5c9125a8ee - -[PATCH] x86-64: Revert timer routing behaviour back to 2.6.16 state - -By default route the 8254 over the 8259 and only disable -it on ATI boards where this causes double timer interrupts. - -This should unbreak some Nvidia boards where the timer doesn't -seem to tick of it isn't enabled in the 8259. At least one -VIA board also seemed to have a little trouble with the disabled -8259. - -For 2.6.20 we'll try both dynamically without black listing, but I think -for .19 this is the safer approach because it has been already well tested -in earlier kernels. This also makes the x86-64 behaviour the same -as i386. - -Command line options can change all this of course. - -Signed-off-by: Andi Kleen ---- - ---- a/arch/x86_64/kernel/early-quirks.c -+++ b/arch/x86_64/kernel/early-quirks.c -@@ -61,10 +61,11 @@ static void nvidia_bugs(void) - - static void ati_bugs(void) - { --#if 1 /* for testing */ -- printk("ATI board detected\n"); --#endif -- /* No bugs right now */ -+ if (timer_over_8254 == 1) { -+ timer_over_8254 = 0; -+ printk(KERN_INFO -+ "ATI board detected. Disabling timer routing over 8254.\n"); -+ } - } - - struct chipset { ---- a/arch/x86_64/kernel/io_apic.c -+++ b/arch/x86_64/kernel/io_apic.c -@@ -57,7 +57,7 @@ static int no_timer_check; - - static int disable_timer_pin_1 __initdata; - --int timer_over_8254 __initdata = 0; -+int timer_over_8254 __initdata = 1; - - /* Where if anywhere is the i8259 connect in external int mode */ - static struct { int pin, apic; } ioapic_i8259 = { -1, -1 }; ---- a/include/asm-x86_64/proto.h -+++ b/include/asm-x86_64/proto.h -@@ -131,6 +131,9 @@ extern int fix_aperture; - - extern int reboot_force; - extern int notsc_setup(char *); -+ -+extern int timer_over_8254; -+ - extern int setup_additional_cpus(char *); - - extern void smp_local_timer_interrupt(struct pt_regs * regs); diff --git a/sys-kernel/gentoo-sources/files/2.6.19-ata-piix-updates.patch b/sys-kernel/gentoo-sources/files/2.6.19-ata-piix-updates.patch deleted file mode 100644 index 1d1efcf64..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.19-ata-piix-updates.patch +++ /dev/null @@ -1,501 +0,0 @@ ---- drivers/ata/ata_piix.c.old -+++ drivers/ata/ata_piix.c -@@ -40,7 +40,7 @@ - * Documentation - * Publically available from Intel web site. Errata documentation - * is also publically available. As an aide to anyone hacking on this -- * driver the list of errata that are relevant is below.going back to -+ * driver the list of errata that are relevant is below, going back to - * PIIX4. Older device documentation is now a bit tricky to find. - * - * The chipsets all follow very much the same design. The orginal Triton -@@ -93,7 +93,7 @@ - #include - - #define DRV_NAME "ata_piix" --#define DRV_VERSION "2.00ac6" -+#define DRV_VERSION "2.00ac7" - - enum { - PIIX_IOCFG = 0x54, /* IDE I/O configuration register */ -@@ -101,11 +101,13 @@ enum { - ICH5_PCS = 0x92, /* port control and status */ - PIIX_SCC = 0x0A, /* sub-class code register */ - -- PIIX_FLAG_IGNORE_PCS = (1 << 25), /* ignore PCS present bits */ - PIIX_FLAG_SCR = (1 << 26), /* SCR available */ - PIIX_FLAG_AHCI = (1 << 27), /* AHCI possible */ - PIIX_FLAG_CHECKINTR = (1 << 28), /* make sure PCI INTx enabled */ - -+ PIIX_PATA_FLAGS = ATA_FLAG_SLAVE_POSS, -+ PIIX_SATA_FLAGS = ATA_FLAG_SATA | PIIX_FLAG_CHECKINTR, -+ - /* combined mode. if set, PATA is channel 0. - * if clear, PATA is channel 1. - */ -@@ -122,11 +124,10 @@ enum { - ich_pata_100 = 3, /* ICH up to UDMA 100 */ - ich_pata_133 = 4, /* ICH up to UDMA 133 */ - ich5_sata = 5, -- esb_sata = 6, -- ich6_sata = 7, -- ich6_sata_ahci = 8, -- ich6m_sata_ahci = 9, -- ich8_sata_ahci = 10, -+ ich6_sata = 6, -+ ich6_sata_ahci = 7, -+ ich6m_sata_ahci = 8, -+ ich8_sata_ahci = 9, - - /* constants for mapping table */ - P0 = 0, /* port 0 */ -@@ -143,13 +144,11 @@ enum { - struct piix_map_db { - const u32 mask; - const u16 port_enable; -- const int present_shift; - const int map[][4]; - }; - - struct piix_host_priv { - const int *map; -- const struct piix_map_db *map_db; - }; - - static int piix_init_one (struct pci_dev *pdev, -@@ -214,9 +213,9 @@ static const struct pci_device_id piix_p - /* 82801EB (ICH5) */ - { 0x8086, 0x24df, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_sata }, - /* 6300ESB (ICH5 variant with broken PCS present bits) */ -- { 0x8086, 0x25a3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, esb_sata }, -+ { 0x8086, 0x25a3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_sata }, - /* 6300ESB pretending RAID */ -- { 0x8086, 0x25b0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, esb_sata }, -+ { 0x8086, 0x25b0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich5_sata }, - /* 82801FB/FW (ICH6/ICH6W) */ - { 0x8086, 0x2651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata }, - /* 82801FR/FRW (ICH6R/ICH6RW) */ -@@ -227,14 +226,26 @@ static const struct pci_device_id piix_p - { 0x8086, 0x27c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, - /* 2801GBM/GHM (ICH7M, identical to ICH6M) */ - { 0x8086, 0x27c4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6m_sata_ahci }, -- /* Enterprise Southbridge 2 (where's the datasheet?) */ -+ /* Enterprise Southbridge 2 (631xESB/632xESB) */ - { 0x8086, 0x2680, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich6_sata_ahci }, -- /* SATA Controller 1 IDE (ICH8, no datasheet yet) */ -+ /* SATA Controller 1 IDE (ICH8) */ - { 0x8086, 0x2820, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -- /* SATA Controller 2 IDE (ICH8, ditto) */ -+ /* SATA Controller 2 IDE (ICH8) */ - { 0x8086, 0x2825, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -- /* Mobile SATA Controller IDE (ICH8M, ditto) */ -+ /* Mobile SATA Controller IDE (ICH8M) */ - { 0x8086, 0x2828, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -+ /* SATA Controller IDE (ICH9) */ -+ { 0x8086, 0x2920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -+ /* SATA Controller IDE (ICH9) */ -+ { 0x8086, 0x2921, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -+ /* SATA Controller IDE (ICH9) */ -+ { 0x8086, 0x2926, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -+ /* SATA Controller IDE (ICH9M) */ -+ { 0x8086, 0x2928, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -+ /* SATA Controller IDE (ICH9M) */ -+ { 0x8086, 0x292d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, -+ /* SATA Controller IDE (ICH9M) */ -+ { 0x8086, 0x292e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_ahci }, - - { } /* terminate list */ - }; -@@ -331,7 +342,7 @@ static const struct ata_port_operations - - .port_start = ata_port_start, - .port_stop = ata_port_stop, -- .host_stop = ata_host_stop, -+ .host_stop = piix_host_stop, - }; - - static const struct ata_port_operations piix_sata_ops = { -@@ -367,7 +378,6 @@ static const struct ata_port_operations - static const struct piix_map_db ich5_map_db = { - .mask = 0x7, - .port_enable = 0x3, -- .present_shift = 4, - .map = { - /* PM PS SM SS MAP */ - { P0, NA, P1, NA }, /* 000b */ -@@ -384,7 +394,6 @@ static const struct piix_map_db ich5_map - static const struct piix_map_db ich6_map_db = { - .mask = 0x3, - .port_enable = 0xf, -- .present_shift = 4, - .map = { - /* PM PS SM SS MAP */ - { P0, P2, P1, P3 }, /* 00b */ -@@ -397,7 +406,6 @@ static const struct piix_map_db ich6_map - static const struct piix_map_db ich6m_map_db = { - .mask = 0x3, - .port_enable = 0x5, -- .present_shift = 4, - - /* Map 01b isn't specified in the doc but some notebooks use - * it anyway. MAP 01b have been spotted on both ICH6M and -@@ -415,7 +423,6 @@ static const struct piix_map_db ich6m_ma - static const struct piix_map_db ich8_map_db = { - .mask = 0x3, - .port_enable = 0x3, -- .present_shift = 8, - .map = { - /* PM PS SM SS MAP */ - { P0, P2, P1, P3 }, /* 00b (hardwired when in AHCI) */ -@@ -427,7 +434,6 @@ static const struct piix_map_db ich8_map - - static const struct piix_map_db *piix_map_db_table[] = { - [ich5_sata] = &ich5_map_db, -- [esb_sata] = &ich5_map_db, - [ich6_sata] = &ich6_map_db, - [ich6_sata_ahci] = &ich6_map_db, - [ich6m_sata_ahci] = &ich6m_map_db, -@@ -438,7 +444,7 @@ static struct ata_port_info piix_port_in - /* piix_pata_33: 0: PIIX3 or 4 at 33MHz */ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SLAVE_POSS | ATA_FLAG_SRST, -+ .flags = PIIX_PATA_FLAGS, - .pio_mask = 0x1f, /* pio0-4 */ - .mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */ - .udma_mask = ATA_UDMA_MASK_40C, -@@ -448,7 +454,7 @@ static struct ata_port_info piix_port_in - /* ich_pata_33: 1 ICH0 - ICH at 33Mhz*/ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, -+ .flags = PIIX_PATA_FLAGS, - .pio_mask = 0x1f, /* pio 0-4 */ - .mwdma_mask = 0x06, /* Check: maybe 0x07 */ - .udma_mask = ATA_UDMA2, /* UDMA33 */ -@@ -457,7 +463,7 @@ static struct ata_port_info piix_port_in - /* ich_pata_66: 2 ICH controllers up to 66MHz */ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS, -+ .flags = PIIX_PATA_FLAGS, - .pio_mask = 0x1f, /* pio 0-4 */ - .mwdma_mask = 0x06, /* MWDMA0 is broken on chip */ - .udma_mask = ATA_UDMA4, -@@ -467,7 +473,7 @@ static struct ata_port_info piix_port_in - /* ich_pata_100: 3 */ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS | PIIX_FLAG_CHECKINTR, -+ .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR, - .pio_mask = 0x1f, /* pio0-4 */ - .mwdma_mask = 0x06, /* mwdma1-2 */ - .udma_mask = ATA_UDMA5, /* udma0-5 */ -@@ -477,7 +483,7 @@ static struct ata_port_info piix_port_in - /* ich_pata_133: 4 ICH with full UDMA6 */ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SRST | ATA_FLAG_SLAVE_POSS | PIIX_FLAG_CHECKINTR, -+ .flags = PIIX_PATA_FLAGS | PIIX_FLAG_CHECKINTR, - .pio_mask = 0x1f, /* pio 0-4 */ - .mwdma_mask = 0x06, /* Check: maybe 0x07 */ - .udma_mask = ATA_UDMA6, /* UDMA133 */ -@@ -487,41 +493,27 @@ static struct ata_port_info piix_port_in - /* ich5_sata: 5 */ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SATA | PIIX_FLAG_CHECKINTR | -- PIIX_FLAG_IGNORE_PCS, -- .pio_mask = 0x1f, /* pio0-4 */ -- .mwdma_mask = 0x07, /* mwdma0-2 */ -- .udma_mask = 0x7f, /* udma0-6 */ -- .port_ops = &piix_sata_ops, -- }, -- -- /* i6300esb_sata: 6 */ -- { -- .sht = &piix_sht, -- .flags = ATA_FLAG_SATA | -- PIIX_FLAG_CHECKINTR | PIIX_FLAG_IGNORE_PCS, -+ .flags = PIIX_SATA_FLAGS, - .pio_mask = 0x1f, /* pio0-4 */ - .mwdma_mask = 0x07, /* mwdma0-2 */ - .udma_mask = 0x7f, /* udma0-6 */ - .port_ops = &piix_sata_ops, - }, - -- /* ich6_sata: 7 */ -+ /* ich6_sata: 6 */ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SATA | -- PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR, -+ .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR, - .pio_mask = 0x1f, /* pio0-4 */ - .mwdma_mask = 0x07, /* mwdma0-2 */ - .udma_mask = 0x7f, /* udma0-6 */ - .port_ops = &piix_sata_ops, - }, - -- /* ich6_sata_ahci: 8 */ -+ /* ich6_sata_ahci: 7 */ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SATA | -- PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR | -+ .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR | - PIIX_FLAG_AHCI, - .pio_mask = 0x1f, /* pio0-4 */ - .mwdma_mask = 0x07, /* mwdma0-2 */ -@@ -529,11 +521,10 @@ static struct ata_port_info piix_port_in - .port_ops = &piix_sata_ops, - }, - -- /* ich6m_sata_ahci: 9 */ -+ /* ich6m_sata_ahci: 8 */ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SATA | -- PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR | -+ .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR | - PIIX_FLAG_AHCI, - .pio_mask = 0x1f, /* pio0-4 */ - .mwdma_mask = 0x07, /* mwdma0-2 */ -@@ -541,11 +532,10 @@ static struct ata_port_info piix_port_in - .port_ops = &piix_sata_ops, - }, - -- /* ich8_sata_ahci: 10 */ -+ /* ich8_sata_ahci: 9 */ - { - .sht = &piix_sht, -- .flags = ATA_FLAG_SATA | -- PIIX_FLAG_CHECKINTR | PIIX_FLAG_SCR | -+ .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SCR | - PIIX_FLAG_AHCI, - .pio_mask = 0x1f, /* pio0-4 */ - .mwdma_mask = 0x07, /* mwdma0-2 */ -@@ -566,10 +556,22 @@ MODULE_LICENSE("GPL"); - MODULE_DEVICE_TABLE(pci, piix_pci_tbl); - MODULE_VERSION(DRV_VERSION); - --static int force_pcs = 0; --module_param(force_pcs, int, 0444); --MODULE_PARM_DESC(force_pcs, "force honoring or ignoring PCS to work around " -- "device mis-detection (0=default, 1=ignore PCS, 2=honor PCS)"); -+struct ich_laptop { -+ u16 device; -+ u16 subvendor; -+ u16 subdevice; -+}; -+ -+/* -+ * List of laptops that use short cables rather than 80 wire -+ */ -+ -+static const struct ich_laptop ich_laptop[] = { -+ /* devid, subvendor, subdev */ -+ { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ -+ /* end marker */ -+ { 0, } -+}; - - /** - * piix_pata_cbl_detect - Probe host controller cable detect info -@@ -585,12 +587,24 @@ MODULE_PARM_DESC(force_pcs, "force honor - static void ich_pata_cbl_detect(struct ata_port *ap) - { - struct pci_dev *pdev = to_pci_dev(ap->host->dev); -+ const struct ich_laptop *lap = &ich_laptop[0]; - u8 tmp, mask; - - /* no 80c support in host controller? */ - if ((ap->udma_mask & ~ATA_UDMA_MASK_40C) == 0) - goto cbl40; - -+ /* Check for specials - Acer Aspire 5602WLMi */ -+ while (lap->device) { -+ if (lap->device == pdev->device && -+ lap->subvendor == pdev->subsystem_vendor && -+ lap->subdevice == pdev->subsystem_device) { -+ ap->cbl = ATA_CBL_PATA40_SHORT; -+ return; -+ } -+ lap++; -+ } -+ - /* check BIOS cable detect results */ - mask = ap->port_no == 0 ? PIIX_80C_PRI : PIIX_80C_SEC; - pci_read_config_byte(pdev, PIIX_IOCFG, &tmp); -@@ -659,84 +673,9 @@ static void ich_pata_error_handler(struc - ata_std_postreset); - } - --/** -- * piix_sata_present_mask - determine present mask for SATA host controller -- * @ap: Target port -- * -- * Reads SATA PCI device's PCI config register Port Configuration -- * and Status (PCS) to determine port and device availability. -- * -- * LOCKING: -- * None (inherited from caller). -- * -- * RETURNS: -- * determined present_mask -- */ --static unsigned int piix_sata_present_mask(struct ata_port *ap) --{ -- struct pci_dev *pdev = to_pci_dev(ap->host->dev); -- struct piix_host_priv *hpriv = ap->host->private_data; -- const unsigned int *map = hpriv->map; -- int base = 2 * ap->port_no; -- unsigned int present_mask = 0; -- int port, i; -- u16 pcs; -- -- pci_read_config_word(pdev, ICH5_PCS, &pcs); -- DPRINTK("ata%u: ENTER, pcs=0x%x base=%d\n", ap->id, pcs, base); -- -- for (i = 0; i < 2; i++) { -- port = map[base + i]; -- if (port < 0) -- continue; -- if ((ap->flags & PIIX_FLAG_IGNORE_PCS) || -- (pcs & 1 << (hpriv->map_db->present_shift + port))) -- present_mask |= 1 << i; -- } -- -- DPRINTK("ata%u: LEAVE, pcs=0x%x present_mask=0x%x\n", -- ap->id, pcs, present_mask); -- -- return present_mask; --} -- --/** -- * piix_sata_softreset - reset SATA host port via ATA SRST -- * @ap: port to reset -- * @classes: resulting classes of attached devices -- * -- * Reset SATA host port via ATA SRST. On controllers with -- * reliable PCS present bits, the bits are used to determine -- * device presence. -- * -- * LOCKING: -- * Kernel thread context (may sleep) -- * -- * RETURNS: -- * 0 on success, -errno otherwise. -- */ --static int piix_sata_softreset(struct ata_port *ap, unsigned int *classes) --{ -- unsigned int present_mask; -- int i, rc; -- -- present_mask = piix_sata_present_mask(ap); -- -- rc = ata_std_softreset(ap, classes); -- if (rc) -- return rc; -- -- for (i = 0; i < ATA_MAX_DEVICES; i++) { -- if (!(present_mask & (1 << i))) -- classes[i] = ATA_DEV_NONE; -- } -- -- return 0; --} -- - static void piix_sata_error_handler(struct ata_port *ap) - { -- ata_bmdma_drive_eh(ap, ata_std_prereset, piix_sata_softreset, NULL, -+ ata_bmdma_drive_eh(ap, ata_std_prereset, ata_std_softreset, NULL, - ata_std_postreset); - } - -@@ -1051,18 +990,6 @@ static void __devinit piix_init_pcs(stru - pci_write_config_word(pdev, ICH5_PCS, new_pcs); - msleep(150); - } -- -- if (force_pcs == 1) { -- dev_printk(KERN_INFO, &pdev->dev, -- "force ignoring PCS (0x%x)\n", new_pcs); -- pinfo[0].flags |= PIIX_FLAG_IGNORE_PCS; -- pinfo[1].flags |= PIIX_FLAG_IGNORE_PCS; -- } else if (force_pcs == 2) { -- dev_printk(KERN_INFO, &pdev->dev, -- "force honoring PCS (0x%x)\n", new_pcs); -- pinfo[0].flags &= ~PIIX_FLAG_IGNORE_PCS; -- pinfo[1].flags &= ~PIIX_FLAG_IGNORE_PCS; -- } - } - - static void __devinit piix_init_sata_map(struct pci_dev *pdev, -@@ -1112,7 +1039,6 @@ static void __devinit piix_init_sata_map - "invalid MAP value %u\n", map_value); - - hpriv->map = map; -- hpriv->map_db = map_db; - } - - /** ---- drivers/ata/pata_oldpiix.c.old -+++ drivers/ata/pata_oldpiix.c -@@ -224,14 +224,16 @@ static struct scsi_host_template oldpiix - .can_queue = ATA_DEF_QUEUE, - .this_id = ATA_SHT_THIS_ID, - .sg_tablesize = LIBATA_MAX_PRD, -- .max_sectors = ATA_MAX_SECTORS, - .cmd_per_lun = ATA_SHT_CMD_PER_LUN, - .emulated = ATA_SHT_EMULATED, - .use_clustering = ATA_SHT_USE_CLUSTERING, - .proc_name = DRV_NAME, - .dma_boundary = ATA_DMA_BOUNDARY, - .slave_configure = ata_scsi_slave_config, -+ .slave_destroy = ata_scsi_slave_destroy, - .bios_param = ata_std_bios_param, -+ .resume = ata_scsi_device_resume, -+ .suspend = ata_scsi_device_suspend, - }; - - static const struct ata_port_operations oldpiix_pata_ops = { -@@ -313,6 +315,8 @@ static struct pci_driver oldpiix_pci_dri - .id_table = oldpiix_pci_tbl, - .probe = oldpiix_init_one, - .remove = ata_pci_remove_one, -+ .suspend = ata_pci_device_suspend, -+ .resume = ata_pci_device_resume, - }; - - static int __init oldpiix_init(void) ---- include/linux/ata.h.old -+++ include/linux/ata.h -@@ -200,8 +200,9 @@ enum { - ATA_CBL_NONE = 0, - ATA_CBL_PATA40 = 1, - ATA_CBL_PATA80 = 2, -- ATA_CBL_PATA_UNK = 3, -- ATA_CBL_SATA = 4, -+ ATA_CBL_PATA40_SHORT = 3, /* 40 wire cable to high UDMA spec */ -+ ATA_CBL_PATA_UNK = 4, -+ ATA_CBL_SATA = 5, - - /* SATA Status and Control Registers */ - SCR_STATUS = 0, -@@ -342,6 +343,15 @@ static inline int ata_id_is_cfa(const u1 - return 0; - } - -+static inline int ata_drive_40wire(const u16 *dev_id) -+{ -+ if (ata_id_major_version(dev_id) >= 5 && ata_id_is_sata(dev_id)) -+ return 0; /* SATA */ -+ if (dev_id[93] & 0x4000) -+ return 0; /* 80 wire */ -+ return 1; -+} -+ - static inline int atapi_cdb_len(const u16 *dev_id) - { - u16 tmp = dev_id[0] & 0x3; diff --git a/sys-kernel/gentoo-sources/files/2.6.19-bcm43xx-forcedeth-atiixp-support.patch b/sys-kernel/gentoo-sources/files/2.6.19-bcm43xx-forcedeth-atiixp-support.patch deleted file mode 100644 index 851f80dbc..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.19-bcm43xx-forcedeth-atiixp-support.patch +++ /dev/null @@ -1,413 +0,0 @@ -From: Ayaz Abdulla -Date: Mon, 6 Nov 2006 08:43:39 +0000 (-0800) -Subject: [PATCH] forcedeth: add new NVIDIA pci ids -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=52d78d63310d9818458fd9800d24a4d5425aeac7 - -[PATCH] forcedeth: add new NVIDIA pci ids - -Add pci device ids for the NVIDIA MCP67 chip. - -Signed-off-by: Ayaz Abdulla -Signed-off-by: Andrew Morton -Signed-off-by: Jeff Garzik ---- - ---- a/include/linux/pci_ids.h -+++ b/include/linux/pci_ids.h -@@ -1213,6 +1213,10 @@ - #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 - #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 - #define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453 -+#define PCI_DEVICE_ID_NVIDIA_NVENET_24 0x054C -+#define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D -+#define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E -+#define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F - #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 - - #define PCI_VENDOR_ID_IMS 0x10e0 -From: Stefano Brivio -Date: Mon, 16 Oct 2006 04:18:11 +0000 (-0500) -Subject: [PATCH] bcm43xx: add PCI-E code -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f3d1fca3eb05cf6ff3879a385a15d24fbf556c57 - -[PATCH] bcm43xx: add PCI-E code - -The current bcm43xx driver does not contain code to handle PCI-E interfaces -such as the BCM4311 and BCM4312. This patch, originally written by Stefano -Brivio adds the necessary code to enable these interfaces. - -Signed-off-by: Stefano Brivio -Signed-off-by: Larry Finger -Signed-off-by: John W. Linville ---- - ---- a/drivers/net/wireless/bcm43xx/bcm43xx.h -+++ b/drivers/net/wireless/bcm43xx/bcm43xx.h -@@ -159,6 +159,7 @@ - - /* Chipcommon registers. */ - #define BCM43xx_CHIPCOMMON_CAPABILITIES 0x04 -+#define BCM43xx_CHIPCOMMON_CTL 0x28 - #define BCM43xx_CHIPCOMMON_PLLONDELAY 0xB0 - #define BCM43xx_CHIPCOMMON_FREFSELDELAY 0xB4 - #define BCM43xx_CHIPCOMMON_SLOWCLKCTL 0xB8 -@@ -172,6 +173,33 @@ - /* SBTOPCI2 values. */ - #define BCM43xx_SBTOPCI2_PREFETCH 0x4 - #define BCM43xx_SBTOPCI2_BURST 0x8 -+#define BCM43xx_SBTOPCI2_MEMREAD_MULTI 0x20 -+ -+/* PCI-E core registers. */ -+#define BCM43xx_PCIECORE_REG_ADDR 0x0130 -+#define BCM43xx_PCIECORE_REG_DATA 0x0134 -+#define BCM43xx_PCIECORE_MDIO_CTL 0x0128 -+#define BCM43xx_PCIECORE_MDIO_DATA 0x012C -+ -+/* PCI-E registers. */ -+#define BCM43xx_PCIE_TLP_WORKAROUND 0x0004 -+#define BCM43xx_PCIE_DLLP_LINKCTL 0x0100 -+ -+/* PCI-E MDIO bits. */ -+#define BCM43xx_PCIE_MDIO_ST 0x40000000 -+#define BCM43xx_PCIE_MDIO_WT 0x10000000 -+#define BCM43xx_PCIE_MDIO_DEV 22 -+#define BCM43xx_PCIE_MDIO_REG 18 -+#define BCM43xx_PCIE_MDIO_TA 0x00020000 -+#define BCM43xx_PCIE_MDIO_TC 0x0100 -+ -+/* MDIO devices. */ -+#define BCM43xx_MDIO_SERDES_RX 0x1F -+ -+/* SERDES RX registers. */ -+#define BCM43xx_SERDES_RXTIMER 0x2 -+#define BCM43xx_SERDES_CDR 0x6 -+#define BCM43xx_SERDES_CDR_BW 0x7 - - /* Chipcommon capabilities. */ - #define BCM43xx_CAPABILITIES_PCTL 0x00040000 -@@ -221,6 +249,7 @@ - #define BCM43xx_COREID_USB20_HOST 0x819 - #define BCM43xx_COREID_USB20_DEV 0x81a - #define BCM43xx_COREID_SDIO_HOST 0x81b -+#define BCM43xx_COREID_PCIE 0x820 - - /* Core Information Registers */ - #define BCM43xx_CIR_BASE 0xf00 ---- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c -+++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c -@@ -130,6 +130,10 @@ MODULE_PARM_DESC(fwpostfix, "Postfix for - { PCI_VENDOR_ID_BROADCOM, 0x4301, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - /* Broadcom 4307 802.11b */ - { PCI_VENDOR_ID_BROADCOM, 0x4307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, -+ /* Broadcom 4311 802.11(a)/b/g */ -+ { PCI_VENDOR_ID_BROADCOM, 0x4311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, -+ /* Broadcom 4312 802.11a/b/g */ -+ { PCI_VENDOR_ID_BROADCOM, 0x4312, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - /* Broadcom 4318 802.11b/g */ - { PCI_VENDOR_ID_BROADCOM, 0x4318, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, - /* Broadcom 4319 802.11a/b/g */ -@@ -2600,8 +2604,9 @@ static int bcm43xx_probe_cores(struct bc - /* fetch sb_id_hi from core information registers */ - sb_id_hi = bcm43xx_read32(bcm, BCM43xx_CIR_SB_ID_HI); - -- core_id = (sb_id_hi & 0xFFF0) >> 4; -- core_rev = (sb_id_hi & 0xF); -+ core_id = (sb_id_hi & 0x8FF0) >> 4; -+ core_rev = (sb_id_hi & 0x7000) >> 8; -+ core_rev |= (sb_id_hi & 0xF); - core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; - - /* if present, chipcommon is always core 0; read the chipid from it */ -@@ -2711,6 +2716,7 @@ static int bcm43xx_probe_cores(struct bc - core = NULL; - switch (core_id) { - case BCM43xx_COREID_PCI: -+ case BCM43xx_COREID_PCIE: - core = &bcm->core_pci; - if (core->available) { - printk(KERN_WARNING PFX "Multiple PCI cores found.\n"); -@@ -2749,12 +2755,12 @@ static int bcm43xx_probe_cores(struct bc - case 6: - case 7: - case 9: -+ case 10: - break; - default: -- printk(KERN_ERR PFX "Error: Unsupported 80211 core revision %u\n", -+ printk(KERN_WARNING PFX -+ "Unsupported 80211 core revision %u\n", - core_rev); -- err = -ENODEV; -- goto out; - } - bcm->nr_80211_available++; - core->priv = ext_80211; -@@ -2868,16 +2874,11 @@ static int bcm43xx_wireless_core_init(st - u32 sbimconfiglow; - u8 limit; - -- if (bcm->chip_rev < 5) { -+ if (bcm->core_pci.rev <= 5 && bcm->core_pci.id != BCM43xx_COREID_PCIE) { - sbimconfiglow = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); - sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; - sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; -- if (bcm->bustype == BCM43xx_BUSTYPE_PCI) -- sbimconfiglow |= 0x32; -- else if (bcm->bustype == BCM43xx_BUSTYPE_SB) -- sbimconfiglow |= 0x53; -- else -- assert(0); -+ sbimconfiglow |= 0x32; - bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow); - } - -@@ -3004,22 +3005,64 @@ static void bcm43xx_pcicore_broadcast_va - - static int bcm43xx_pcicore_commit_settings(struct bcm43xx_private *bcm) - { -- int err; -- struct bcm43xx_coreinfo *old_core; -+ int err = 0; - -- old_core = bcm->current_core; -- err = bcm43xx_switch_core(bcm, &bcm->core_pci); -- if (err) -- goto out; -+ bcm->irq_savedstate = bcm43xx_interrupt_disable(bcm, BCM43xx_IRQ_ALL); - -- bcm43xx_pcicore_broadcast_value(bcm, 0xfd8, 0x00000000); -+ if (bcm->core_chipcommon.available) { -+ err = bcm43xx_switch_core(bcm, &bcm->core_chipcommon); -+ if (err) -+ goto out; -+ -+ bcm43xx_pcicore_broadcast_value(bcm, 0xfd8, 0x00000000); -+ -+ /* this function is always called when a PCI core is mapped */ -+ err = bcm43xx_switch_core(bcm, &bcm->core_pci); -+ if (err) -+ goto out; -+ } else -+ bcm43xx_pcicore_broadcast_value(bcm, 0xfd8, 0x00000000); -+ -+ bcm43xx_interrupt_enable(bcm, bcm->irq_savedstate); - -- bcm43xx_switch_core(bcm, old_core); -- assert(err == 0); - out: - return err; - } - -+static u32 bcm43xx_pcie_reg_read(struct bcm43xx_private *bcm, u32 address) -+{ -+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_REG_ADDR, address); -+ return bcm43xx_read32(bcm, BCM43xx_PCIECORE_REG_DATA); -+} -+ -+static void bcm43xx_pcie_reg_write(struct bcm43xx_private *bcm, u32 address, -+ u32 data) -+{ -+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_REG_ADDR, address); -+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_REG_DATA, data); -+} -+ -+static void bcm43xx_pcie_mdio_write(struct bcm43xx_private *bcm, u8 dev, u8 reg, -+ u16 data) -+{ -+ int i; -+ -+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_MDIO_CTL, 0x0082); -+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_MDIO_DATA, BCM43xx_PCIE_MDIO_ST | -+ BCM43xx_PCIE_MDIO_WT | (dev << BCM43xx_PCIE_MDIO_DEV) | -+ (reg << BCM43xx_PCIE_MDIO_REG) | BCM43xx_PCIE_MDIO_TA | -+ data); -+ udelay(10); -+ -+ for (i = 0; i < 10; i++) { -+ if (bcm43xx_read32(bcm, BCM43xx_PCIECORE_MDIO_CTL) & -+ BCM43xx_PCIE_MDIO_TC) -+ break; -+ msleep(1); -+ } -+ bcm43xx_write32(bcm, BCM43xx_PCIECORE_MDIO_CTL, 0); -+} -+ - /* Make an I/O Core usable. "core_mask" is the bitmask of the cores to enable. - * To enable core 0, pass a core_mask of 1<<0 - */ -@@ -3039,7 +3082,8 @@ static int bcm43xx_setup_backplane_pci_c - if (err) - goto out; - -- if (bcm->core_pci.rev < 6) { -+ if (bcm->current_core->rev < 6 || -+ bcm->current_core->id == BCM43xx_COREID_PCI) { - value = bcm43xx_read32(bcm, BCM43xx_CIR_SBINTVEC); - value |= (1 << backplane_flag_nr); - bcm43xx_write32(bcm, BCM43xx_CIR_SBINTVEC, value); -@@ -3057,21 +3101,46 @@ static int bcm43xx_setup_backplane_pci_c - } - } - -- value = bcm43xx_read32(bcm, BCM43xx_PCICORE_SBTOPCI2); -- value |= BCM43xx_SBTOPCI2_PREFETCH | BCM43xx_SBTOPCI2_BURST; -- bcm43xx_write32(bcm, BCM43xx_PCICORE_SBTOPCI2, value); -- -- if (bcm->core_pci.rev < 5) { -- value = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); -- value |= (2 << BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_SHIFT) -- & BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; -- value |= (3 << BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_SHIFT) -- & BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; -- bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, value); -- err = bcm43xx_pcicore_commit_settings(bcm); -- assert(err == 0); -+ if (bcm->current_core->id == BCM43xx_COREID_PCI) { -+ value = bcm43xx_read32(bcm, BCM43xx_PCICORE_SBTOPCI2); -+ value |= BCM43xx_SBTOPCI2_PREFETCH | BCM43xx_SBTOPCI2_BURST; -+ bcm43xx_write32(bcm, BCM43xx_PCICORE_SBTOPCI2, value); -+ -+ if (bcm->current_core->rev < 5) { -+ value = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); -+ value |= (2 << BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_SHIFT) -+ & BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; -+ value |= (3 << BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_SHIFT) -+ & BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; -+ bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, value); -+ err = bcm43xx_pcicore_commit_settings(bcm); -+ assert(err == 0); -+ } else if (bcm->current_core->rev >= 11) { -+ value = bcm43xx_read32(bcm, BCM43xx_PCICORE_SBTOPCI2); -+ value |= BCM43xx_SBTOPCI2_MEMREAD_MULTI; -+ bcm43xx_write32(bcm, BCM43xx_PCICORE_SBTOPCI2, value); -+ } -+ } else { -+ if (bcm->current_core->rev == 0 || bcm->current_core->rev == 1) { -+ value = bcm43xx_pcie_reg_read(bcm, BCM43xx_PCIE_TLP_WORKAROUND); -+ value |= 0x8; -+ bcm43xx_pcie_reg_write(bcm, BCM43xx_PCIE_TLP_WORKAROUND, -+ value); -+ } -+ if (bcm->current_core->rev == 0) { -+ bcm43xx_pcie_mdio_write(bcm, BCM43xx_MDIO_SERDES_RX, -+ BCM43xx_SERDES_RXTIMER, 0x8128); -+ bcm43xx_pcie_mdio_write(bcm, BCM43xx_MDIO_SERDES_RX, -+ BCM43xx_SERDES_CDR, 0x0100); -+ bcm43xx_pcie_mdio_write(bcm, BCM43xx_MDIO_SERDES_RX, -+ BCM43xx_SERDES_CDR_BW, 0x1466); -+ } else if (bcm->current_core->rev == 1) { -+ value = bcm43xx_pcie_reg_read(bcm, BCM43xx_PCIE_DLLP_LINKCTL); -+ value |= 0x40; -+ bcm43xx_pcie_reg_write(bcm, BCM43xx_PCIE_DLLP_LINKCTL, -+ value); -+ } - } -- - out_switch_back: - err = bcm43xx_switch_core(bcm, old_core); - out: -@@ -3676,7 +3745,7 @@ static int bcm43xx_read_phyinfo(struct b - bcm->ieee->freq_band = IEEE80211_24GHZ_BAND; - break; - case BCM43xx_PHYTYPE_G: -- if (phy_rev > 7) -+ if (phy_rev > 8) - phy_rev_ok = 0; - bcm->ieee->modulation = IEEE80211_OFDM_MODULATION | - IEEE80211_CCK_MODULATION; ---- a/drivers/net/wireless/bcm43xx/bcm43xx_power.c -+++ b/drivers/net/wireless/bcm43xx/bcm43xx_power.c -@@ -153,8 +153,6 @@ int bcm43xx_pctl_init(struct bcm43xx_pri - int err, maxfreq; - struct bcm43xx_coreinfo *old_core; - -- if (!(bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL)) -- return 0; - old_core = bcm->current_core; - err = bcm43xx_switch_core(bcm, &bcm->core_chipcommon); - if (err == -ENODEV) -@@ -162,11 +160,27 @@ int bcm43xx_pctl_init(struct bcm43xx_pri - if (err) - goto out; - -- maxfreq = bcm43xx_pctl_clockfreqlimit(bcm, 1); -- bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_PLLONDELAY, -- (maxfreq * 150 + 999999) / 1000000); -- bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_FREFSELDELAY, -- (maxfreq * 15 + 999999) / 1000000); -+ if (bcm->chip_id == 0x4321) { -+ if (bcm->chip_rev == 0) -+ bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_CTL, 0x03A4); -+ if (bcm->chip_rev == 1) -+ bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_CTL, 0x00A4); -+ } -+ -+ if (bcm->chipcommon_capabilities & BCM43xx_CAPABILITIES_PCTL) { -+ if (bcm->current_core->rev >= 10) { -+ /* Set Idle Power clock rate to 1Mhz */ -+ bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_SYSCLKCTL, -+ (bcm43xx_read32(bcm, BCM43xx_CHIPCOMMON_SYSCLKCTL) -+ & 0x0000FFFF) | 0x40000); -+ } else { -+ maxfreq = bcm43xx_pctl_clockfreqlimit(bcm, 1); -+ bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_PLLONDELAY, -+ (maxfreq * 150 + 999999) / 1000000); -+ bcm43xx_write32(bcm, BCM43xx_CHIPCOMMON_FREFSELDELAY, -+ (maxfreq * 15 + 999999) / 1000000); -+ } -+ } - - err = bcm43xx_switch_core(bcm, old_core); - assert(err == 0); -From: Conke Hu -Date: Tue, 19 Dec 2006 21:11:37 +0000 (-0800) -Subject: PCI: ATI sb600 sata quirk -X-Git-Tag: v2.6.20-rc2 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ab17443a3df35abe4b7529e83511a591aa7384f3 - -PCI: ATI sb600 sata quirk - -Acked-by: Jeff Garzik -Cc: Alan Cox -Signed-off-by: Andrew Morton -Signed-off-by: Greg Kroah-Hartman ---- - ---- a/drivers/ide/pci/atiixp.c -+++ b/drivers/ide/pci/atiixp.c -@@ -368,7 +368,6 @@ static struct pci_device_id atiixp_pci_t - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP300_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, -- { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, PCI_ANY_ID, PCI_ANY_ID, (PCI_CLASS_STORAGE_IDE<<8)|0x8a, 0xffff05, 1}, - { 0, }, - }; - MODULE_DEVICE_TABLE(pci, atiixp_pci_tbl); ---- a/drivers/pci/quirks.c -+++ b/drivers/pci/quirks.c -@@ -850,6 +850,23 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN - DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, quirk_disable_pxb ); - - -+static void __devinit quirk_sb600_sata(struct pci_dev *pdev) -+{ -+ /* set sb600 sata to ahci mode */ -+ if ((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) { -+ u8 tmp; -+ -+ pci_read_config_byte(pdev, 0x40, &tmp); -+ pci_write_config_byte(pdev, 0x40, tmp|1); -+ pci_write_config_byte(pdev, 0x9, 1); -+ pci_write_config_byte(pdev, 0xa, 6); -+ pci_write_config_byte(pdev, 0x40, tmp); -+ -+ pdev->class = 0x010601; -+ } -+} -+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata); -+ - /* - * Serverworks CSB5 IDE does not fully support native mode - */ diff --git a/sys-kernel/gentoo-sources/files/2.6.19-bmdma-fixes.patch b/sys-kernel/gentoo-sources/files/2.6.19-bmdma-fixes.patch deleted file mode 100644 index 1be2eccc6..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.19-bmdma-fixes.patch +++ /dev/null @@ -1,78 +0,0 @@ -From: Tejun Heo -Date: Fri, 17 Nov 2006 03:06:21 +0000 (+0900) -Subject: [PATCH] libata: move BMDMA host status recording from EH to interrupt handler -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ea54763f8a7c51b9f8fcb14431812ae63fcbaf96 - -[PATCH] libata: move BMDMA host status recording from EH to interrupt handler - -For certain errors, interrupt handler alter BMDMA host status before -entering EH (clears active and intr). Thus altered BMDMA host status -value is recorded by BMDMA EH and reported to user. Move BMDMA host -status recording from EH to interrupt handler. - -Signed-off-by: Tejun Heo ---- - ---- a/drivers/ata/libata-core.c -+++ b/drivers/ata/libata-core.c -@@ -4937,6 +4937,7 @@ unsigned int ata_qc_issue_prot(struct at - inline unsigned int ata_host_intr (struct ata_port *ap, - struct ata_queued_cmd *qc) - { -+ struct ata_eh_info *ehi = &ap->eh_info; - u8 status, host_stat = 0; - - VPRINTK("ata%u: protocol %d task_state %d\n", -@@ -4997,6 +4998,11 @@ inline unsigned int ata_host_intr (struc - ap->ops->irq_clear(ap); - - ata_hsm_move(ap, qc, status, 0); -+ -+ if (unlikely(qc->err_mask) && (qc->tf.protocol == ATA_PROT_DMA || -+ qc->tf.protocol == ATA_PROT_ATAPI_DMA)) -+ ata_ehi_push_desc(ehi, "BMDMA stat 0x%x", host_stat); -+ - return 1; /* irq handled */ - - idle_irq: ---- a/drivers/ata/libata-sff.c -+++ b/drivers/ata/libata-sff.c -@@ -743,7 +743,6 @@ void ata_bmdma_drive_eh(struct ata_port - ata_reset_fn_t softreset, ata_reset_fn_t hardreset, - ata_postreset_fn_t postreset) - { -- struct ata_eh_context *ehc = &ap->eh_context; - struct ata_queued_cmd *qc; - unsigned long flags; - int thaw = 0; -@@ -763,8 +762,6 @@ void ata_bmdma_drive_eh(struct ata_port - - host_stat = ap->ops->bmdma_status(ap); - -- ata_ehi_push_desc(&ehc->i, "BMDMA stat 0x%x", host_stat); -- - /* BMDMA controllers indicate host bus error by - * setting DMA_ERR bit and timing out. As it wasn't - * really a timeout event, adjust error mask and ---- a/drivers/ata/sata_sil.c -+++ b/drivers/ata/sata_sil.c -@@ -356,6 +356,7 @@ static void sil_scr_write (struct ata_po - - static void sil_host_intr(struct ata_port *ap, u32 bmdma2) - { -+ struct ata_eh_info *ehi = &ap->eh_info; - struct ata_queued_cmd *qc = ata_qc_from_tag(ap, ap->active_tag); - u8 status; - -@@ -428,6 +429,10 @@ static void sil_host_intr(struct ata_por - /* kick HSM in the ass */ - ata_hsm_move(ap, qc, status, 0); - -+ if (unlikely(qc->err_mask) && (qc->tf.protocol == ATA_PROT_DMA || -+ qc->tf.protocol == ATA_PROT_ATAPI_DMA)) -+ ata_ehi_push_desc(ehi, "BMDMA2 stat 0x%x", bmdma2); -+ - return; - - err_hsm: diff --git a/sys-kernel/gentoo-sources/files/2.6.19-kvm-2.6.20_rc4-updates.patch b/sys-kernel/gentoo-sources/files/2.6.19-kvm-2.6.20_rc4-updates.patch deleted file mode 100644 index d91428261..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.19-kvm-2.6.20_rc4-updates.patch +++ /dev/null @@ -1,3601 +0,0 @@ -diff -Nurp linux-2.6.19-gentoo-r4/drivers/kvm/kvm.h linux-2.6.20-rc4/drivers/kvm/kvm.h ---- linux-2.6.19-gentoo-r4/drivers/kvm/kvm.h 2007-01-09 23:44:33.000000000 +0100 -+++ linux-2.6.20-rc4/drivers/kvm/kvm.h 2007-01-09 23:53:07.000000000 +0100 -@@ -52,6 +52,8 @@ - #define KVM_MAX_VCPUS 1 - #define KVM_MEMORY_SLOTS 4 - #define KVM_NUM_MMU_PAGES 256 -+#define KVM_MIN_FREE_MMU_PAGES 5 -+#define KVM_REFILL_PAGES 25 - - #define FX_IMAGE_SIZE 512 - #define FX_IMAGE_ALIGN 16 -@@ -89,14 +91,54 @@ typedef unsigned long hva_t; - typedef u64 hpa_t; - typedef unsigned long hfn_t; - -+#define NR_PTE_CHAIN_ENTRIES 5 -+ -+struct kvm_pte_chain { -+ u64 *parent_ptes[NR_PTE_CHAIN_ENTRIES]; -+ struct hlist_node link; -+}; -+ -+/* -+ * kvm_mmu_page_role, below, is defined as: -+ * -+ * bits 0:3 - total guest paging levels (2-4, or zero for real mode) -+ * bits 4:7 - page table level for this shadow (1-4) -+ * bits 8:9 - page table quadrant for 2-level guests -+ * bit 16 - "metaphysical" - gfn is not a real page (huge page/real mode) -+ */ -+union kvm_mmu_page_role { -+ unsigned word; -+ struct { -+ unsigned glevels : 4; -+ unsigned level : 4; -+ unsigned quadrant : 2; -+ unsigned pad_for_nice_hex_output : 6; -+ unsigned metaphysical : 1; -+ }; -+}; -+ - struct kvm_mmu_page { - struct list_head link; -+ struct hlist_node hash_link; -+ -+ /* -+ * The following two entries are used to key the shadow page in the -+ * hash table. -+ */ -+ gfn_t gfn; -+ union kvm_mmu_page_role role; -+ - hpa_t page_hpa; - unsigned long slot_bitmap; /* One bit set per slot which has memory - * in this shadow page. - */ - int global; /* Set if all ptes in this page are global */ -- u64 *parent_pte; -+ int multimapped; /* More than one parent_pte? */ -+ int root_count; /* Currently serving as active root */ -+ union { -+ u64 *parent_pte; /* !multimapped */ -+ struct hlist_head parent_ptes; /* multimapped, kvm_pte_chain */ -+ }; - }; - - struct vmcs { -@@ -117,14 +159,26 @@ struct kvm_vcpu; - struct kvm_mmu { - void (*new_cr3)(struct kvm_vcpu *vcpu); - int (*page_fault)(struct kvm_vcpu *vcpu, gva_t gva, u32 err); -- void (*inval_page)(struct kvm_vcpu *vcpu, gva_t gva); - void (*free)(struct kvm_vcpu *vcpu); - gpa_t (*gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t gva); - hpa_t root_hpa; - int root_level; - int shadow_root_level; -+ -+ u64 *pae_root; -+}; -+ -+#define KVM_NR_MEM_OBJS 20 -+ -+struct kvm_mmu_memory_cache { -+ int nobjs; -+ void *objects[KVM_NR_MEM_OBJS]; - }; - -+/* -+ * We don't want allocation failures within the mmu code, so we preallocate -+ * enough memory for a single page fault in a cache. -+ */ - struct kvm_guest_debug { - int enabled; - unsigned long bp[4]; -@@ -173,6 +227,7 @@ struct kvm_vcpu { - struct mutex mutex; - int cpu; - int launched; -+ int interrupt_window_open; - unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */ - #define NR_IRQ_WORDS KVM_IRQ_BITMAP_SIZE(unsigned long) - unsigned long irq_pending[NR_IRQ_WORDS]; -@@ -184,6 +239,7 @@ struct kvm_vcpu { - unsigned long cr3; - unsigned long cr4; - unsigned long cr8; -+ u64 pdptrs[4]; /* pae */ - u64 shadow_efer; - u64 apic_base; - int nmsrs; -@@ -194,6 +250,12 @@ struct kvm_vcpu { - struct kvm_mmu_page page_header_buf[KVM_NUM_MMU_PAGES]; - struct kvm_mmu mmu; - -+ struct kvm_mmu_memory_cache mmu_pte_chain_cache; -+ struct kvm_mmu_memory_cache mmu_rmap_desc_cache; -+ -+ gfn_t last_pt_write_gfn; -+ int last_pt_write_count; -+ - struct kvm_guest_debug guest_debug; - - char fx_buf[FX_BUF_SIZE]; -@@ -231,10 +293,16 @@ struct kvm { - spinlock_t lock; /* protects everything except vcpus */ - int nmemslots; - struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS]; -+ /* -+ * Hash table of struct kvm_mmu_page. -+ */ - struct list_head active_mmu_pages; -+ int n_free_mmu_pages; -+ struct hlist_head mmu_page_hash[KVM_NUM_MMU_PAGES]; - struct kvm_vcpu vcpus[KVM_MAX_VCPUS]; - int memory_config_version; - int busy; -+ unsigned long rmap_overflow; - }; - - struct kvm_stat { -@@ -247,6 +315,9 @@ struct kvm_stat { - u32 io_exits; - u32 mmio_exits; - u32 signal_exits; -+ u32 irq_window_exits; -+ u32 halt_exits; -+ u32 request_irq_exits; - u32 irq_exits; - }; - -@@ -278,8 +349,8 @@ struct kvm_arch_ops { - struct kvm_segment *var, int seg); - void (*set_segment)(struct kvm_vcpu *vcpu, - struct kvm_segment *var, int seg); -- int (*is_long_mode)(struct kvm_vcpu *vcpu); - void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l); -+ void (*decache_cr0_cr4_guest_bits)(struct kvm_vcpu *vcpu); - void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); - void (*set_cr0_no_modeswitch)(struct kvm_vcpu *vcpu, - unsigned long cr0); -@@ -320,10 +391,11 @@ int kvm_init_arch(struct kvm_arch_ops *o - void kvm_exit_arch(void); - - void kvm_mmu_destroy(struct kvm_vcpu *vcpu); --int kvm_mmu_init(struct kvm_vcpu *vcpu); -+int kvm_mmu_create(struct kvm_vcpu *vcpu); -+int kvm_mmu_setup(struct kvm_vcpu *vcpu); - - int kvm_mmu_reset_context(struct kvm_vcpu *vcpu); --void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot); -+void kvm_mmu_slot_remove_write_access(struct kvm_vcpu *vcpu, int slot); - - hpa_t gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa); - #define HPA_MSB ((sizeof(hpa_t) * 8) - 1) -@@ -375,9 +447,8 @@ void set_cr4(struct kvm_vcpu *vcpu, unsi - void set_cr8(struct kvm_vcpu *vcpu, unsigned long cr0); - void lmsw(struct kvm_vcpu *vcpu, unsigned long msw); - --#ifdef CONFIG_X86_64 --void set_efer(struct kvm_vcpu *vcpu, u64 efer); --#endif -+int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata); -+int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data); - - void fx_init(struct kvm_vcpu *vcpu); - -@@ -397,12 +468,34 @@ int kvm_write_guest(struct kvm_vcpu *vcp - - unsigned long segment_base(u16 selector); - -+void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes); -+void kvm_mmu_post_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes); -+int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva); -+void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu); -+ -+static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, -+ u32 error_code) -+{ -+ if (unlikely(vcpu->kvm->n_free_mmu_pages < KVM_MIN_FREE_MMU_PAGES)) -+ kvm_mmu_free_some_pages(vcpu); -+ return vcpu->mmu.page_fault(vcpu, gva, error_code); -+} -+ - static inline struct page *_gfn_to_page(struct kvm *kvm, gfn_t gfn) - { - struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn); - return (slot) ? slot->phys_mem[gfn - slot->base_gfn] : NULL; - } - -+static inline int is_long_mode(struct kvm_vcpu *vcpu) -+{ -+#ifdef CONFIG_X86_64 -+ return vcpu->shadow_efer & EFER_LME; -+#else -+ return 0; -+#endif -+} -+ - static inline int is_pae(struct kvm_vcpu *vcpu) - { - return vcpu->cr4 & CR4_PAE_MASK; -@@ -533,19 +626,4 @@ static inline u32 get_rdx_init_val(void) - #define TSS_REDIRECTION_SIZE (256 / 8) - #define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1) - --#ifdef CONFIG_X86_64 -- --/* -- * When emulating 32-bit mode, cr3 is only 32 bits even on x86_64. Therefore -- * we need to allocate shadow page tables in the first 4GB of memory, which -- * happens to fit the DMA32 zone. -- */ --#define GFP_KVM_MMU (GFP_KERNEL | __GFP_DMA32) -- --#else -- --#define GFP_KVM_MMU GFP_KERNEL -- --#endif -- - #endif -diff -Nurp linux-2.6.19-gentoo-r4/drivers/kvm/kvm_main.c linux-2.6.20-rc4/drivers/kvm/kvm_main.c ---- linux-2.6.19-gentoo-r4/drivers/kvm/kvm_main.c 2007-01-09 23:44:33.000000000 +0100 -+++ linux-2.6.20-rc4/drivers/kvm/kvm_main.c 2007-01-09 23:53:07.000000000 +0100 -@@ -58,6 +58,9 @@ static struct kvm_stats_debugfs_item { - { "io_exits", &kvm_stat.io_exits }, - { "mmio_exits", &kvm_stat.mmio_exits }, - { "signal_exits", &kvm_stat.signal_exits }, -+ { "irq_window", &kvm_stat.irq_window_exits }, -+ { "halt_exits", &kvm_stat.halt_exits }, -+ { "request_irq", &kvm_stat.request_irq_exits }, - { "irq_exits", &kvm_stat.irq_exits }, - { 0, 0 } - }; -@@ -227,6 +230,7 @@ static int kvm_dev_open(struct inode *in - struct kvm_vcpu *vcpu = &kvm->vcpus[i]; - - mutex_init(&vcpu->mutex); -+ vcpu->kvm = kvm; - vcpu->mmu.root_hpa = INVALID_PAGE; - INIT_LIST_HEAD(&vcpu->free_pages); - } -@@ -245,7 +249,8 @@ static void kvm_free_physmem_slot(struct - if (!dont || free->phys_mem != dont->phys_mem) - if (free->phys_mem) { - for (i = 0; i < free->npages; ++i) -- __free_page(free->phys_mem[i]); -+ if (free->phys_mem[i]) -+ __free_page(free->phys_mem[i]); - vfree(free->phys_mem); - } - -@@ -267,8 +272,8 @@ static void kvm_free_physmem(struct kvm - - static void kvm_free_vcpu(struct kvm_vcpu *vcpu) - { -- kvm_arch_ops->vcpu_free(vcpu); - kvm_mmu_destroy(vcpu); -+ kvm_arch_ops->vcpu_free(vcpu); - } - - static void kvm_free_vcpus(struct kvm *kvm) -@@ -294,14 +299,17 @@ static void inject_gp(struct kvm_vcpu *v - kvm_arch_ops->inject_gp(vcpu, 0); - } - --static int pdptrs_have_reserved_bits_set(struct kvm_vcpu *vcpu, -- unsigned long cr3) -+/* -+ * Load the pae pdptrs. Return true is they are all valid. -+ */ -+static int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3) - { - gfn_t pdpt_gfn = cr3 >> PAGE_SHIFT; -- unsigned offset = (cr3 & (PAGE_SIZE-1)) >> 5; -+ unsigned offset = ((cr3 & (PAGE_SIZE-1)) >> 5) << 2; - int i; - u64 pdpte; - u64 *pdpt; -+ int ret; - struct kvm_memory_slot *memslot; - - spin_lock(&vcpu->kvm->lock); -@@ -309,16 +317,23 @@ static int pdptrs_have_reserved_bits_set - /* FIXME: !memslot - emulate? 0xff? */ - pdpt = kmap_atomic(gfn_to_page(memslot, pdpt_gfn), KM_USER0); - -+ ret = 1; - for (i = 0; i < 4; ++i) { - pdpte = pdpt[offset + i]; -- if ((pdpte & 1) && (pdpte & 0xfffffff0000001e6ull)) -- break; -+ if ((pdpte & 1) && (pdpte & 0xfffffff0000001e6ull)) { -+ ret = 0; -+ goto out; -+ } - } - -+ for (i = 0; i < 4; ++i) -+ vcpu->pdptrs[i] = pdpt[offset + i]; -+ -+out: - kunmap_atomic(pdpt, KM_USER0); - spin_unlock(&vcpu->kvm->lock); - -- return i != 4; -+ return ret; - } - - void set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) -@@ -364,8 +379,7 @@ void set_cr0(struct kvm_vcpu *vcpu, unsi - } - } else - #endif -- if (is_pae(vcpu) && -- pdptrs_have_reserved_bits_set(vcpu, vcpu->cr3)) { -+ if (is_pae(vcpu) && !load_pdptrs(vcpu, vcpu->cr3)) { - printk(KERN_DEBUG "set_cr0: #GP, pdptrs " - "reserved bits\n"); - inject_gp(vcpu); -@@ -386,6 +400,7 @@ EXPORT_SYMBOL_GPL(set_cr0); - - void lmsw(struct kvm_vcpu *vcpu, unsigned long msw) - { -+ kvm_arch_ops->decache_cr0_cr4_guest_bits(vcpu); - set_cr0(vcpu, (vcpu->cr0 & ~0x0ful) | (msw & 0x0f)); - } - EXPORT_SYMBOL_GPL(lmsw); -@@ -398,7 +413,7 @@ void set_cr4(struct kvm_vcpu *vcpu, unsi - return; - } - -- if (kvm_arch_ops->is_long_mode(vcpu)) { -+ if (is_long_mode(vcpu)) { - if (!(cr4 & CR4_PAE_MASK)) { - printk(KERN_DEBUG "set_cr4: #GP, clearing PAE while " - "in long mode\n"); -@@ -406,7 +421,7 @@ void set_cr4(struct kvm_vcpu *vcpu, unsi - return; - } - } else if (is_paging(vcpu) && !is_pae(vcpu) && (cr4 & CR4_PAE_MASK) -- && pdptrs_have_reserved_bits_set(vcpu, vcpu->cr3)) { -+ && !load_pdptrs(vcpu, vcpu->cr3)) { - printk(KERN_DEBUG "set_cr4: #GP, pdptrs reserved bits\n"); - inject_gp(vcpu); - } -@@ -425,7 +440,7 @@ EXPORT_SYMBOL_GPL(set_cr4); - - void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3) - { -- if (kvm_arch_ops->is_long_mode(vcpu)) { -+ if (is_long_mode(vcpu)) { - if ( cr3 & CR3_L_MODE_RESEVED_BITS) { - printk(KERN_DEBUG "set_cr3: #GP, reserved bits\n"); - inject_gp(vcpu); -@@ -438,7 +453,7 @@ void set_cr3(struct kvm_vcpu *vcpu, unsi - return; - } - if (is_paging(vcpu) && is_pae(vcpu) && -- pdptrs_have_reserved_bits_set(vcpu, cr3)) { -+ !load_pdptrs(vcpu, cr3)) { - printk(KERN_DEBUG "set_cr3: #GP, pdptrs " - "reserved bits\n"); - inject_gp(vcpu); -@@ -448,7 +463,19 @@ void set_cr3(struct kvm_vcpu *vcpu, unsi - - vcpu->cr3 = cr3; - spin_lock(&vcpu->kvm->lock); -- vcpu->mmu.new_cr3(vcpu); -+ /* -+ * Does the new cr3 value map to physical memory? (Note, we -+ * catch an invalid cr3 even in real-mode, because it would -+ * cause trouble later on when we turn on paging anyway.) -+ * -+ * A real CPU would silently accept an invalid cr3 and would -+ * attempt to use it - with largely undefined (and often hard -+ * to debug) behavior on the guest side. -+ */ -+ if (unlikely(!gfn_to_memslot(vcpu->kvm, cr3 >> PAGE_SHIFT))) -+ inject_gp(vcpu); -+ else -+ vcpu->mmu.new_cr3(vcpu); - spin_unlock(&vcpu->kvm->lock); - } - EXPORT_SYMBOL_GPL(set_cr3); -@@ -516,17 +543,18 @@ static int kvm_dev_ioctl_create_vcpu(str - vcpu->guest_fx_image = vcpu->host_fx_image + FX_IMAGE_SIZE; - - vcpu->cpu = -1; /* First load will set up TR */ -- vcpu->kvm = kvm; - r = kvm_arch_ops->vcpu_create(vcpu); - if (r < 0) - goto out_free_vcpus; - -- kvm_arch_ops->vcpu_load(vcpu); -+ r = kvm_mmu_create(vcpu); -+ if (r < 0) -+ goto out_free_vcpus; - -- r = kvm_arch_ops->vcpu_setup(vcpu); -+ kvm_arch_ops->vcpu_load(vcpu); -+ r = kvm_mmu_setup(vcpu); - if (r >= 0) -- r = kvm_mmu_init(vcpu); -- -+ r = kvm_arch_ops->vcpu_setup(vcpu); - vcpu_put(vcpu); - - if (r < 0) -@@ -631,6 +659,7 @@ raced: - | __GFP_ZERO); - if (!new.phys_mem[i]) - goto out_free; -+ new.phys_mem[i]->private = 0; - } - } - -@@ -685,6 +714,13 @@ out: - return r; - } - -+static void do_remove_write_access(struct kvm_vcpu *vcpu, int slot) -+{ -+ spin_lock(&vcpu->kvm->lock); -+ kvm_mmu_slot_remove_write_access(vcpu, slot); -+ spin_unlock(&vcpu->kvm->lock); -+} -+ - /* - * Get (and clear) the dirty memory log for a memory slot. - */ -@@ -694,6 +730,7 @@ static int kvm_dev_ioctl_get_dirty_log(s - struct kvm_memory_slot *memslot; - int r, i; - int n; -+ int cleared; - unsigned long any = 0; - - spin_lock(&kvm->lock); -@@ -724,15 +761,17 @@ static int kvm_dev_ioctl_get_dirty_log(s - - - if (any) { -- spin_lock(&kvm->lock); -- kvm_mmu_slot_remove_write_access(kvm, log->slot); -- spin_unlock(&kvm->lock); -- memset(memslot->dirty_bitmap, 0, n); -+ cleared = 0; - for (i = 0; i < KVM_MAX_VCPUS; ++i) { - struct kvm_vcpu *vcpu = vcpu_load(kvm, i); - - if (!vcpu) - continue; -+ if (!cleared) { -+ do_remove_write_access(vcpu, log->slot); -+ memset(memslot->dirty_bitmap, 0, n); -+ cleared = 1; -+ } - kvm_arch_ops->tlb_flush(vcpu); - vcpu_put(vcpu); - } -@@ -860,6 +899,27 @@ static int emulator_read_emulated(unsign - } - } - -+static int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa, -+ unsigned long val, int bytes) -+{ -+ struct kvm_memory_slot *m; -+ struct page *page; -+ void *virt; -+ -+ if (((gpa + bytes - 1) >> PAGE_SHIFT) != (gpa >> PAGE_SHIFT)) -+ return 0; -+ m = gfn_to_memslot(vcpu->kvm, gpa >> PAGE_SHIFT); -+ if (!m) -+ return 0; -+ page = gfn_to_page(m, gpa >> PAGE_SHIFT); -+ kvm_mmu_pre_write(vcpu, gpa, bytes); -+ virt = kmap_atomic(page, KM_USER0); -+ memcpy(virt + offset_in_page(gpa), &val, bytes); -+ kunmap_atomic(virt, KM_USER0); -+ kvm_mmu_post_write(vcpu, gpa, bytes); -+ return 1; -+} -+ - static int emulator_write_emulated(unsigned long addr, - unsigned long val, - unsigned int bytes, -@@ -871,6 +931,9 @@ static int emulator_write_emulated(unsig - if (gpa == UNMAPPED_GVA) - return X86EMUL_PROPAGATE_FAULT; - -+ if (emulator_write_phys(vcpu, gpa, val, bytes)) -+ return X86EMUL_CONTINUE; -+ - vcpu->mmio_needed = 1; - vcpu->mmio_phys_addr = gpa; - vcpu->mmio_size = bytes; -@@ -895,6 +958,30 @@ static int emulator_cmpxchg_emulated(uns - return emulator_write_emulated(addr, new, bytes, ctxt); - } - -+#ifdef CONFIG_X86_32 -+ -+static int emulator_cmpxchg8b_emulated(unsigned long addr, -+ unsigned long old_lo, -+ unsigned long old_hi, -+ unsigned long new_lo, -+ unsigned long new_hi, -+ struct x86_emulate_ctxt *ctxt) -+{ -+ static int reported; -+ int r; -+ -+ if (!reported) { -+ reported = 1; -+ printk(KERN_WARNING "kvm: emulating exchange8b as write\n"); -+ } -+ r = emulator_write_emulated(addr, new_lo, 4, ctxt); -+ if (r != X86EMUL_CONTINUE) -+ return r; -+ return emulator_write_emulated(addr+4, new_hi, 4, ctxt); -+} -+ -+#endif -+ - static unsigned long get_segment_base(struct kvm_vcpu *vcpu, int seg) - { - return kvm_arch_ops->get_segment_base(vcpu, seg); -@@ -902,18 +989,15 @@ static unsigned long get_segment_base(st - - int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address) - { -- spin_lock(&vcpu->kvm->lock); -- vcpu->mmu.inval_page(vcpu, address); -- spin_unlock(&vcpu->kvm->lock); -- kvm_arch_ops->invlpg(vcpu, address); - return X86EMUL_CONTINUE; - } - - int emulate_clts(struct kvm_vcpu *vcpu) - { -- unsigned long cr0 = vcpu->cr0; -+ unsigned long cr0; - -- cr0 &= ~CR0_TS_MASK; -+ kvm_arch_ops->decache_cr0_cr4_guest_bits(vcpu); -+ cr0 = vcpu->cr0 & ~CR0_TS_MASK; - kvm_arch_ops->set_cr0(vcpu, cr0); - return X86EMUL_CONTINUE; - } -@@ -972,6 +1056,9 @@ struct x86_emulate_ops emulate_ops = { - .read_emulated = emulator_read_emulated, - .write_emulated = emulator_write_emulated, - .cmpxchg_emulated = emulator_cmpxchg_emulated, -+#ifdef CONFIG_X86_32 -+ .cmpxchg8b_emulated = emulator_cmpxchg8b_emulated, -+#endif - }; - - int emulate_instruction(struct kvm_vcpu *vcpu, -@@ -1021,6 +1108,8 @@ int emulate_instruction(struct kvm_vcpu - } - - if (r) { -+ if (kvm_mmu_unprotect_page_virt(vcpu, cr2)) -+ return EMULATE_DONE; - if (!vcpu->mmio_needed) { - report_emulation_failure(&emulate_ctxt); - return EMULATE_FAIL; -@@ -1066,6 +1155,7 @@ void realmode_lmsw(struct kvm_vcpu *vcpu - - unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr) - { -+ kvm_arch_ops->decache_cr0_cr4_guest_bits(vcpu); - switch (cr) { - case 0: - return vcpu->cr0; -@@ -1103,6 +1193,51 @@ void realmode_set_cr(struct kvm_vcpu *vc - } - } - -+int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) -+{ -+ u64 data; -+ -+ switch (msr) { -+ case 0xc0010010: /* SYSCFG */ -+ case 0xc0010015: /* HWCR */ -+ case MSR_IA32_PLATFORM_ID: -+ case MSR_IA32_P5_MC_ADDR: -+ case MSR_IA32_P5_MC_TYPE: -+ case MSR_IA32_MC0_CTL: -+ case MSR_IA32_MCG_STATUS: -+ case MSR_IA32_MCG_CAP: -+ case MSR_IA32_MC0_MISC: -+ case MSR_IA32_MC0_MISC+4: -+ case MSR_IA32_MC0_MISC+8: -+ case MSR_IA32_MC0_MISC+12: -+ case MSR_IA32_MC0_MISC+16: -+ case MSR_IA32_UCODE_REV: -+ case MSR_IA32_PERF_STATUS: -+ /* MTRR registers */ -+ case 0xfe: -+ case 0x200 ... 0x2ff: -+ data = 0; -+ break; -+ case 0xcd: /* fsb frequency */ -+ data = 3; -+ break; -+ case MSR_IA32_APICBASE: -+ data = vcpu->apic_base; -+ break; -+#ifdef CONFIG_X86_64 -+ case MSR_EFER: -+ data = vcpu->shadow_efer; -+ break; -+#endif -+ default: -+ printk(KERN_ERR "kvm: unhandled rdmsr: 0x%x\n", msr); -+ return 1; -+ } -+ *pdata = data; -+ return 0; -+} -+EXPORT_SYMBOL_GPL(kvm_get_msr_common); -+ - /* - * Reads an msr value (of 'msr_index') into 'pdata'. - * Returns 0 on success, non-0 otherwise. -@@ -1115,7 +1250,7 @@ static int get_msr(struct kvm_vcpu *vcpu - - #ifdef CONFIG_X86_64 - --void set_efer(struct kvm_vcpu *vcpu, u64 efer) -+static void set_efer(struct kvm_vcpu *vcpu, u64 efer) - { - if (efer & EFER_RESERVED_BITS) { - printk(KERN_DEBUG "set_efer: 0x%llx #GP, reserved bits\n", -@@ -1138,10 +1273,36 @@ void set_efer(struct kvm_vcpu *vcpu, u64 - - vcpu->shadow_efer = efer; - } --EXPORT_SYMBOL_GPL(set_efer); - - #endif - -+int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data) -+{ -+ switch (msr) { -+#ifdef CONFIG_X86_64 -+ case MSR_EFER: -+ set_efer(vcpu, data); -+ break; -+#endif -+ case MSR_IA32_MC0_STATUS: -+ printk(KERN_WARNING "%s: MSR_IA32_MC0_STATUS 0x%llx, nop\n", -+ __FUNCTION__, data); -+ break; -+ case MSR_IA32_UCODE_REV: -+ case MSR_IA32_UCODE_WRITE: -+ case 0x200 ... 0x2ff: /* MTRRs */ -+ break; -+ case MSR_IA32_APICBASE: -+ vcpu->apic_base = data; -+ break; -+ default: -+ printk(KERN_ERR "kvm: unhandled wrmsr: 0x%x\n", msr); -+ return 1; -+ } -+ return 0; -+} -+EXPORT_SYMBOL_GPL(kvm_set_msr_common); -+ - /* - * Writes msr value into into the appropriate "register". - * Returns 0 on success, non-0 otherwise. -@@ -1329,6 +1490,7 @@ static int kvm_dev_ioctl_get_sregs(struc - sregs->gdt.limit = dt.limit; - sregs->gdt.base = dt.base; - -+ kvm_arch_ops->decache_cr0_cr4_guest_bits(vcpu); - sregs->cr0 = vcpu->cr0; - sregs->cr2 = vcpu->cr2; - sregs->cr3 = vcpu->cr3; -@@ -1393,11 +1555,15 @@ static int kvm_dev_ioctl_set_sregs(struc - #endif - vcpu->apic_base = sregs->apic_base; - -+ kvm_arch_ops->decache_cr0_cr4_guest_bits(vcpu); -+ - mmu_reset_needed |= vcpu->cr0 != sregs->cr0; - kvm_arch_ops->set_cr0_no_modeswitch(vcpu, sregs->cr0); - - mmu_reset_needed |= vcpu->cr4 != sregs->cr4; - kvm_arch_ops->set_cr4(vcpu, sregs->cr4); -+ if (!is_long_mode(vcpu) && is_pae(vcpu)) -+ load_pdptrs(vcpu, vcpu->cr3); - - if (mmu_reset_needed) - kvm_mmu_reset_context(vcpu); -@@ -1619,12 +1785,12 @@ static long kvm_dev_ioctl(struct file *f - if (copy_from_user(&kvm_run, (void *)arg, sizeof kvm_run)) - goto out; - r = kvm_dev_ioctl_run(kvm, &kvm_run); -- if (r < 0) -+ if (r < 0 && r != -EINTR) - goto out; -- r = -EFAULT; -- if (copy_to_user((void *)arg, &kvm_run, sizeof kvm_run)) -+ if (copy_to_user((void *)arg, &kvm_run, sizeof kvm_run)) { -+ r = -EFAULT; - goto out; -- r = 0; -+ } - break; - } - case KVM_GET_REGS: { -@@ -1768,6 +1934,7 @@ static long kvm_dev_ioctl(struct file *f - num_msrs_to_save * sizeof(u32))) - goto out; - r = 0; -+ break; - } - default: - ; -@@ -1865,17 +2032,22 @@ int kvm_init_arch(struct kvm_arch_ops *o - { - int r; - -- kvm_arch_ops = ops; -+ if (kvm_arch_ops) { -+ printk(KERN_ERR "kvm: already loaded the other module\n"); -+ return -EEXIST; -+ } - -- if (!kvm_arch_ops->cpu_has_kvm_support()) { -+ if (!ops->cpu_has_kvm_support()) { - printk(KERN_ERR "kvm: no hardware support\n"); - return -EOPNOTSUPP; - } -- if (kvm_arch_ops->disabled_by_bios()) { -+ if (ops->disabled_by_bios()) { - printk(KERN_ERR "kvm: disabled by bios\n"); - return -EOPNOTSUPP; - } - -+ kvm_arch_ops = ops; -+ - r = kvm_arch_ops->hardware_setup(); - if (r < 0) - return r; -@@ -1907,6 +2079,7 @@ void kvm_exit_arch(void) - unregister_reboot_notifier(&kvm_reboot_notifier); - on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); - kvm_arch_ops->hardware_unsetup(); -+ kvm_arch_ops = NULL; - } - - static __init int kvm_init(void) -diff -Nurp linux-2.6.19-gentoo-r4/drivers/kvm/mmu.c linux-2.6.20-rc4/drivers/kvm/mmu.c ---- linux-2.6.19-gentoo-r4/drivers/kvm/mmu.c 2007-01-09 23:44:33.000000000 +0100 -+++ linux-2.6.20-rc4/drivers/kvm/mmu.c 2007-01-09 23:53:07.000000000 +0100 -@@ -26,7 +26,31 @@ - #include "vmx.h" - #include "kvm.h" - -+#undef MMU_DEBUG -+ -+#undef AUDIT -+ -+#ifdef AUDIT -+static void kvm_mmu_audit(struct kvm_vcpu *vcpu, const char *msg); -+#else -+static void kvm_mmu_audit(struct kvm_vcpu *vcpu, const char *msg) {} -+#endif -+ -+#ifdef MMU_DEBUG -+ -+#define pgprintk(x...) do { if (dbg) printk(x); } while (0) -+#define rmap_printk(x...) do { if (dbg) printk(x); } while (0) -+ -+#else -+ - #define pgprintk(x...) do { } while (0) -+#define rmap_printk(x...) do { } while (0) -+ -+#endif -+ -+#if defined(MMU_DEBUG) || defined(AUDIT) -+static int dbg = 1; -+#endif - - #define ASSERT(x) \ - if (!(x)) { \ -@@ -34,8 +58,10 @@ - __FILE__, __LINE__, #x); \ - } - --#define PT64_ENT_PER_PAGE 512 --#define PT32_ENT_PER_PAGE 1024 -+#define PT64_PT_BITS 9 -+#define PT64_ENT_PER_PAGE (1 << PT64_PT_BITS) -+#define PT32_PT_BITS 10 -+#define PT32_ENT_PER_PAGE (1 << PT32_PT_BITS) - - #define PT_WRITABLE_SHIFT 1 - -@@ -125,6 +151,13 @@ - #define PT_DIRECTORY_LEVEL 2 - #define PT_PAGE_TABLE_LEVEL 1 - -+#define RMAP_EXT 4 -+ -+struct kvm_rmap_desc { -+ u64 *shadow_ptes[RMAP_EXT]; -+ struct kvm_rmap_desc *more; -+}; -+ - static int is_write_protection(struct kvm_vcpu *vcpu) - { - return vcpu->cr0 & CR0_WP_MASK; -@@ -150,32 +183,272 @@ static int is_io_pte(unsigned long pte) - return pte & PT_SHADOW_IO_MARK; - } - -+static int is_rmap_pte(u64 pte) -+{ -+ return (pte & (PT_WRITABLE_MASK | PT_PRESENT_MASK)) -+ == (PT_WRITABLE_MASK | PT_PRESENT_MASK); -+} -+ -+static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache, -+ size_t objsize, int min) -+{ -+ void *obj; -+ -+ if (cache->nobjs >= min) -+ return 0; -+ while (cache->nobjs < ARRAY_SIZE(cache->objects)) { -+ obj = kzalloc(objsize, GFP_NOWAIT); -+ if (!obj) -+ return -ENOMEM; -+ cache->objects[cache->nobjs++] = obj; -+ } -+ return 0; -+} -+ -+static void mmu_free_memory_cache(struct kvm_mmu_memory_cache *mc) -+{ -+ while (mc->nobjs) -+ kfree(mc->objects[--mc->nobjs]); -+} -+ -+static int mmu_topup_memory_caches(struct kvm_vcpu *vcpu) -+{ -+ int r; -+ -+ r = mmu_topup_memory_cache(&vcpu->mmu_pte_chain_cache, -+ sizeof(struct kvm_pte_chain), 4); -+ if (r) -+ goto out; -+ r = mmu_topup_memory_cache(&vcpu->mmu_rmap_desc_cache, -+ sizeof(struct kvm_rmap_desc), 1); -+out: -+ return r; -+} -+ -+static void mmu_free_memory_caches(struct kvm_vcpu *vcpu) -+{ -+ mmu_free_memory_cache(&vcpu->mmu_pte_chain_cache); -+ mmu_free_memory_cache(&vcpu->mmu_rmap_desc_cache); -+} -+ -+static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc, -+ size_t size) -+{ -+ void *p; -+ -+ BUG_ON(!mc->nobjs); -+ p = mc->objects[--mc->nobjs]; -+ memset(p, 0, size); -+ return p; -+} -+ -+static void mmu_memory_cache_free(struct kvm_mmu_memory_cache *mc, void *obj) -+{ -+ if (mc->nobjs < KVM_NR_MEM_OBJS) -+ mc->objects[mc->nobjs++] = obj; -+ else -+ kfree(obj); -+} -+ -+static struct kvm_pte_chain *mmu_alloc_pte_chain(struct kvm_vcpu *vcpu) -+{ -+ return mmu_memory_cache_alloc(&vcpu->mmu_pte_chain_cache, -+ sizeof(struct kvm_pte_chain)); -+} -+ -+static void mmu_free_pte_chain(struct kvm_vcpu *vcpu, -+ struct kvm_pte_chain *pc) -+{ -+ mmu_memory_cache_free(&vcpu->mmu_pte_chain_cache, pc); -+} -+ -+static struct kvm_rmap_desc *mmu_alloc_rmap_desc(struct kvm_vcpu *vcpu) -+{ -+ return mmu_memory_cache_alloc(&vcpu->mmu_rmap_desc_cache, -+ sizeof(struct kvm_rmap_desc)); -+} -+ -+static void mmu_free_rmap_desc(struct kvm_vcpu *vcpu, -+ struct kvm_rmap_desc *rd) -+{ -+ mmu_memory_cache_free(&vcpu->mmu_rmap_desc_cache, rd); -+} -+ -+/* -+ * Reverse mapping data structures: -+ * -+ * If page->private bit zero is zero, then page->private points to the -+ * shadow page table entry that points to page_address(page). -+ * -+ * If page->private bit zero is one, (then page->private & ~1) points -+ * to a struct kvm_rmap_desc containing more mappings. -+ */ -+static void rmap_add(struct kvm_vcpu *vcpu, u64 *spte) -+{ -+ struct page *page; -+ struct kvm_rmap_desc *desc; -+ int i; -+ -+ if (!is_rmap_pte(*spte)) -+ return; -+ page = pfn_to_page((*spte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT); -+ if (!page->private) { -+ rmap_printk("rmap_add: %p %llx 0->1\n", spte, *spte); -+ page->private = (unsigned long)spte; -+ } else if (!(page->private & 1)) { -+ rmap_printk("rmap_add: %p %llx 1->many\n", spte, *spte); -+ desc = mmu_alloc_rmap_desc(vcpu); -+ desc->shadow_ptes[0] = (u64 *)page->private; -+ desc->shadow_ptes[1] = spte; -+ page->private = (unsigned long)desc | 1; -+ } else { -+ rmap_printk("rmap_add: %p %llx many->many\n", spte, *spte); -+ desc = (struct kvm_rmap_desc *)(page->private & ~1ul); -+ while (desc->shadow_ptes[RMAP_EXT-1] && desc->more) -+ desc = desc->more; -+ if (desc->shadow_ptes[RMAP_EXT-1]) { -+ desc->more = mmu_alloc_rmap_desc(vcpu); -+ desc = desc->more; -+ } -+ for (i = 0; desc->shadow_ptes[i]; ++i) -+ ; -+ desc->shadow_ptes[i] = spte; -+ } -+} -+ -+static void rmap_desc_remove_entry(struct kvm_vcpu *vcpu, -+ struct page *page, -+ struct kvm_rmap_desc *desc, -+ int i, -+ struct kvm_rmap_desc *prev_desc) -+{ -+ int j; -+ -+ for (j = RMAP_EXT - 1; !desc->shadow_ptes[j] && j > i; --j) -+ ; -+ desc->shadow_ptes[i] = desc->shadow_ptes[j]; -+ desc->shadow_ptes[j] = 0; -+ if (j != 0) -+ return; -+ if (!prev_desc && !desc->more) -+ page->private = (unsigned long)desc->shadow_ptes[0]; -+ else -+ if (prev_desc) -+ prev_desc->more = desc->more; -+ else -+ page->private = (unsigned long)desc->more | 1; -+ mmu_free_rmap_desc(vcpu, desc); -+} -+ -+static void rmap_remove(struct kvm_vcpu *vcpu, u64 *spte) -+{ -+ struct page *page; -+ struct kvm_rmap_desc *desc; -+ struct kvm_rmap_desc *prev_desc; -+ int i; -+ -+ if (!is_rmap_pte(*spte)) -+ return; -+ page = pfn_to_page((*spte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT); -+ if (!page->private) { -+ printk(KERN_ERR "rmap_remove: %p %llx 0->BUG\n", spte, *spte); -+ BUG(); -+ } else if (!(page->private & 1)) { -+ rmap_printk("rmap_remove: %p %llx 1->0\n", spte, *spte); -+ if ((u64 *)page->private != spte) { -+ printk(KERN_ERR "rmap_remove: %p %llx 1->BUG\n", -+ spte, *spte); -+ BUG(); -+ } -+ page->private = 0; -+ } else { -+ rmap_printk("rmap_remove: %p %llx many->many\n", spte, *spte); -+ desc = (struct kvm_rmap_desc *)(page->private & ~1ul); -+ prev_desc = NULL; -+ while (desc) { -+ for (i = 0; i < RMAP_EXT && desc->shadow_ptes[i]; ++i) -+ if (desc->shadow_ptes[i] == spte) { -+ rmap_desc_remove_entry(vcpu, page, -+ desc, i, -+ prev_desc); -+ return; -+ } -+ prev_desc = desc; -+ desc = desc->more; -+ } -+ BUG(); -+ } -+} -+ -+static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn) -+{ -+ struct kvm *kvm = vcpu->kvm; -+ struct page *page; -+ struct kvm_memory_slot *slot; -+ struct kvm_rmap_desc *desc; -+ u64 *spte; -+ -+ slot = gfn_to_memslot(kvm, gfn); -+ BUG_ON(!slot); -+ page = gfn_to_page(slot, gfn); -+ -+ while (page->private) { -+ if (!(page->private & 1)) -+ spte = (u64 *)page->private; -+ else { -+ desc = (struct kvm_rmap_desc *)(page->private & ~1ul); -+ spte = desc->shadow_ptes[0]; -+ } -+ BUG_ON(!spte); -+ BUG_ON((*spte & PT64_BASE_ADDR_MASK) != -+ page_to_pfn(page) << PAGE_SHIFT); -+ BUG_ON(!(*spte & PT_PRESENT_MASK)); -+ BUG_ON(!(*spte & PT_WRITABLE_MASK)); -+ rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte); -+ rmap_remove(vcpu, spte); -+ kvm_arch_ops->tlb_flush(vcpu); -+ *spte &= ~(u64)PT_WRITABLE_MASK; -+ } -+} -+ -+static int is_empty_shadow_page(hpa_t page_hpa) -+{ -+ u64 *pos; -+ u64 *end; -+ -+ for (pos = __va(page_hpa), end = pos + PAGE_SIZE / sizeof(u64); -+ pos != end; pos++) -+ if (*pos != 0) { -+ printk(KERN_ERR "%s: %p %llx\n", __FUNCTION__, -+ pos, *pos); -+ return 0; -+ } -+ return 1; -+} -+ - static void kvm_mmu_free_page(struct kvm_vcpu *vcpu, hpa_t page_hpa) - { - struct kvm_mmu_page *page_head = page_header(page_hpa); - -+ ASSERT(is_empty_shadow_page(page_hpa)); - list_del(&page_head->link); - page_head->page_hpa = page_hpa; - list_add(&page_head->link, &vcpu->free_pages); -+ ++vcpu->kvm->n_free_mmu_pages; - } - --static int is_empty_shadow_page(hpa_t page_hpa) -+static unsigned kvm_page_table_hashfn(gfn_t gfn) - { -- u32 *pos; -- u32 *end; -- for (pos = __va(page_hpa), end = pos + PAGE_SIZE / sizeof(u32); -- pos != end; pos++) -- if (*pos != 0) -- return 0; -- return 1; -+ return gfn; - } - --static hpa_t kvm_mmu_alloc_page(struct kvm_vcpu *vcpu, u64 *parent_pte) -+static struct kvm_mmu_page *kvm_mmu_alloc_page(struct kvm_vcpu *vcpu, -+ u64 *parent_pte) - { - struct kvm_mmu_page *page; - - if (list_empty(&vcpu->free_pages)) -- return INVALID_PAGE; -+ return NULL; - - page = list_entry(vcpu->free_pages.next, struct kvm_mmu_page, link); - list_del(&page->link); -@@ -183,8 +456,239 @@ static hpa_t kvm_mmu_alloc_page(struct k - ASSERT(is_empty_shadow_page(page->page_hpa)); - page->slot_bitmap = 0; - page->global = 1; -+ page->multimapped = 0; - page->parent_pte = parent_pte; -- return page->page_hpa; -+ --vcpu->kvm->n_free_mmu_pages; -+ return page; -+} -+ -+static void mmu_page_add_parent_pte(struct kvm_vcpu *vcpu, -+ struct kvm_mmu_page *page, u64 *parent_pte) -+{ -+ struct kvm_pte_chain *pte_chain; -+ struct hlist_node *node; -+ int i; -+ -+ if (!parent_pte) -+ return; -+ if (!page->multimapped) { -+ u64 *old = page->parent_pte; -+ -+ if (!old) { -+ page->parent_pte = parent_pte; -+ return; -+ } -+ page->multimapped = 1; -+ pte_chain = mmu_alloc_pte_chain(vcpu); -+ INIT_HLIST_HEAD(&page->parent_ptes); -+ hlist_add_head(&pte_chain->link, &page->parent_ptes); -+ pte_chain->parent_ptes[0] = old; -+ } -+ hlist_for_each_entry(pte_chain, node, &page->parent_ptes, link) { -+ if (pte_chain->parent_ptes[NR_PTE_CHAIN_ENTRIES-1]) -+ continue; -+ for (i = 0; i < NR_PTE_CHAIN_ENTRIES; ++i) -+ if (!pte_chain->parent_ptes[i]) { -+ pte_chain->parent_ptes[i] = parent_pte; -+ return; -+ } -+ } -+ pte_chain = mmu_alloc_pte_chain(vcpu); -+ BUG_ON(!pte_chain); -+ hlist_add_head(&pte_chain->link, &page->parent_ptes); -+ pte_chain->parent_ptes[0] = parent_pte; -+} -+ -+static void mmu_page_remove_parent_pte(struct kvm_vcpu *vcpu, -+ struct kvm_mmu_page *page, -+ u64 *parent_pte) -+{ -+ struct kvm_pte_chain *pte_chain; -+ struct hlist_node *node; -+ int i; -+ -+ if (!page->multimapped) { -+ BUG_ON(page->parent_pte != parent_pte); -+ page->parent_pte = NULL; -+ return; -+ } -+ hlist_for_each_entry(pte_chain, node, &page->parent_ptes, link) -+ for (i = 0; i < NR_PTE_CHAIN_ENTRIES; ++i) { -+ if (!pte_chain->parent_ptes[i]) -+ break; -+ if (pte_chain->parent_ptes[i] != parent_pte) -+ continue; -+ while (i + 1 < NR_PTE_CHAIN_ENTRIES -+ && pte_chain->parent_ptes[i + 1]) { -+ pte_chain->parent_ptes[i] -+ = pte_chain->parent_ptes[i + 1]; -+ ++i; -+ } -+ pte_chain->parent_ptes[i] = NULL; -+ if (i == 0) { -+ hlist_del(&pte_chain->link); -+ mmu_free_pte_chain(vcpu, pte_chain); -+ if (hlist_empty(&page->parent_ptes)) { -+ page->multimapped = 0; -+ page->parent_pte = NULL; -+ } -+ } -+ return; -+ } -+ BUG(); -+} -+ -+static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm_vcpu *vcpu, -+ gfn_t gfn) -+{ -+ unsigned index; -+ struct hlist_head *bucket; -+ struct kvm_mmu_page *page; -+ struct hlist_node *node; -+ -+ pgprintk("%s: looking for gfn %lx\n", __FUNCTION__, gfn); -+ index = kvm_page_table_hashfn(gfn) % KVM_NUM_MMU_PAGES; -+ bucket = &vcpu->kvm->mmu_page_hash[index]; -+ hlist_for_each_entry(page, node, bucket, hash_link) -+ if (page->gfn == gfn && !page->role.metaphysical) { -+ pgprintk("%s: found role %x\n", -+ __FUNCTION__, page->role.word); -+ return page; -+ } -+ return NULL; -+} -+ -+static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu, -+ gfn_t gfn, -+ gva_t gaddr, -+ unsigned level, -+ int metaphysical, -+ u64 *parent_pte) -+{ -+ union kvm_mmu_page_role role; -+ unsigned index; -+ unsigned quadrant; -+ struct hlist_head *bucket; -+ struct kvm_mmu_page *page; -+ struct hlist_node *node; -+ -+ role.word = 0; -+ role.glevels = vcpu->mmu.root_level; -+ role.level = level; -+ role.metaphysical = metaphysical; -+ if (vcpu->mmu.root_level <= PT32_ROOT_LEVEL) { -+ quadrant = gaddr >> (PAGE_SHIFT + (PT64_PT_BITS * level)); -+ quadrant &= (1 << ((PT32_PT_BITS - PT64_PT_BITS) * level)) - 1; -+ role.quadrant = quadrant; -+ } -+ pgprintk("%s: looking gfn %lx role %x\n", __FUNCTION__, -+ gfn, role.word); -+ index = kvm_page_table_hashfn(gfn) % KVM_NUM_MMU_PAGES; -+ bucket = &vcpu->kvm->mmu_page_hash[index]; -+ hlist_for_each_entry(page, node, bucket, hash_link) -+ if (page->gfn == gfn && page->role.word == role.word) { -+ mmu_page_add_parent_pte(vcpu, page, parent_pte); -+ pgprintk("%s: found\n", __FUNCTION__); -+ return page; -+ } -+ page = kvm_mmu_alloc_page(vcpu, parent_pte); -+ if (!page) -+ return page; -+ pgprintk("%s: adding gfn %lx role %x\n", __FUNCTION__, gfn, role.word); -+ page->gfn = gfn; -+ page->role = role; -+ hlist_add_head(&page->hash_link, bucket); -+ if (!metaphysical) -+ rmap_write_protect(vcpu, gfn); -+ return page; -+} -+ -+static void kvm_mmu_page_unlink_children(struct kvm_vcpu *vcpu, -+ struct kvm_mmu_page *page) -+{ -+ unsigned i; -+ u64 *pt; -+ u64 ent; -+ -+ pt = __va(page->page_hpa); -+ -+ if (page->role.level == PT_PAGE_TABLE_LEVEL) { -+ for (i = 0; i < PT64_ENT_PER_PAGE; ++i) { -+ if (pt[i] & PT_PRESENT_MASK) -+ rmap_remove(vcpu, &pt[i]); -+ pt[i] = 0; -+ } -+ kvm_arch_ops->tlb_flush(vcpu); -+ return; -+ } -+ -+ for (i = 0; i < PT64_ENT_PER_PAGE; ++i) { -+ ent = pt[i]; -+ -+ pt[i] = 0; -+ if (!(ent & PT_PRESENT_MASK)) -+ continue; -+ ent &= PT64_BASE_ADDR_MASK; -+ mmu_page_remove_parent_pte(vcpu, page_header(ent), &pt[i]); -+ } -+} -+ -+static void kvm_mmu_put_page(struct kvm_vcpu *vcpu, -+ struct kvm_mmu_page *page, -+ u64 *parent_pte) -+{ -+ mmu_page_remove_parent_pte(vcpu, page, parent_pte); -+} -+ -+static void kvm_mmu_zap_page(struct kvm_vcpu *vcpu, -+ struct kvm_mmu_page *page) -+{ -+ u64 *parent_pte; -+ -+ while (page->multimapped || page->parent_pte) { -+ if (!page->multimapped) -+ parent_pte = page->parent_pte; -+ else { -+ struct kvm_pte_chain *chain; -+ -+ chain = container_of(page->parent_ptes.first, -+ struct kvm_pte_chain, link); -+ parent_pte = chain->parent_ptes[0]; -+ } -+ BUG_ON(!parent_pte); -+ kvm_mmu_put_page(vcpu, page, parent_pte); -+ *parent_pte = 0; -+ } -+ kvm_mmu_page_unlink_children(vcpu, page); -+ if (!page->root_count) { -+ hlist_del(&page->hash_link); -+ kvm_mmu_free_page(vcpu, page->page_hpa); -+ } else { -+ list_del(&page->link); -+ list_add(&page->link, &vcpu->kvm->active_mmu_pages); -+ } -+} -+ -+static int kvm_mmu_unprotect_page(struct kvm_vcpu *vcpu, gfn_t gfn) -+{ -+ unsigned index; -+ struct hlist_head *bucket; -+ struct kvm_mmu_page *page; -+ struct hlist_node *node, *n; -+ int r; -+ -+ pgprintk("%s: looking for gfn %lx\n", __FUNCTION__, gfn); -+ r = 0; -+ index = kvm_page_table_hashfn(gfn) % KVM_NUM_MMU_PAGES; -+ bucket = &vcpu->kvm->mmu_page_hash[index]; -+ hlist_for_each_entry_safe(page, node, n, bucket, hash_link) -+ if (page->gfn == gfn && !page->role.metaphysical) { -+ pgprintk("%s: gfn %lx role %x\n", __FUNCTION__, gfn, -+ page->role.word); -+ kvm_mmu_zap_page(vcpu, page); -+ r = 1; -+ } -+ return r; - } - - static void page_header_update_slot(struct kvm *kvm, void *pte, gpa_t gpa) -@@ -225,35 +729,6 @@ hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, - return gpa_to_hpa(vcpu, gpa); - } - -- --static void release_pt_page_64(struct kvm_vcpu *vcpu, hpa_t page_hpa, -- int level) --{ -- ASSERT(vcpu); -- ASSERT(VALID_PAGE(page_hpa)); -- ASSERT(level <= PT64_ROOT_LEVEL && level > 0); -- -- if (level == 1) -- memset(__va(page_hpa), 0, PAGE_SIZE); -- else { -- u64 *pos; -- u64 *end; -- -- for (pos = __va(page_hpa), end = pos + PT64_ENT_PER_PAGE; -- pos != end; pos++) { -- u64 current_ent = *pos; -- -- *pos = 0; -- if (is_present_pte(current_ent)) -- release_pt_page_64(vcpu, -- current_ent & -- PT64_BASE_ADDR_MASK, -- level - 1); -- } -- } -- kvm_mmu_free_page(vcpu, page_hpa); --} -- - static void nonpaging_new_cr3(struct kvm_vcpu *vcpu) - { - } -@@ -266,52 +741,109 @@ static int nonpaging_map(struct kvm_vcpu - for (; ; level--) { - u32 index = PT64_INDEX(v, level); - u64 *table; -+ u64 pte; - - ASSERT(VALID_PAGE(table_addr)); - table = __va(table_addr); - - if (level == 1) { -+ pte = table[index]; -+ if (is_present_pte(pte) && is_writeble_pte(pte)) -+ return 0; - mark_page_dirty(vcpu->kvm, v >> PAGE_SHIFT); - page_header_update_slot(vcpu->kvm, table, v); - table[index] = p | PT_PRESENT_MASK | PT_WRITABLE_MASK | - PT_USER_MASK; -+ rmap_add(vcpu, &table[index]); - return 0; - } - - if (table[index] == 0) { -- hpa_t new_table = kvm_mmu_alloc_page(vcpu, -- &table[index]); -+ struct kvm_mmu_page *new_table; -+ gfn_t pseudo_gfn; - -- if (!VALID_PAGE(new_table)) { -+ pseudo_gfn = (v & PT64_DIR_BASE_ADDR_MASK) -+ >> PAGE_SHIFT; -+ new_table = kvm_mmu_get_page(vcpu, pseudo_gfn, -+ v, level - 1, -+ 1, &table[index]); -+ if (!new_table) { - pgprintk("nonpaging_map: ENOMEM\n"); - return -ENOMEM; - } - -- if (level == PT32E_ROOT_LEVEL) -- table[index] = new_table | PT_PRESENT_MASK; -- else -- table[index] = new_table | PT_PRESENT_MASK | -- PT_WRITABLE_MASK | PT_USER_MASK; -+ table[index] = new_table->page_hpa | PT_PRESENT_MASK -+ | PT_WRITABLE_MASK | PT_USER_MASK; - } - table_addr = table[index] & PT64_BASE_ADDR_MASK; - } - } - --static void nonpaging_flush(struct kvm_vcpu *vcpu) -+static void mmu_free_roots(struct kvm_vcpu *vcpu) - { -- hpa_t root = vcpu->mmu.root_hpa; -+ int i; -+ struct kvm_mmu_page *page; - -- ++kvm_stat.tlb_flush; -- pgprintk("nonpaging_flush\n"); -- ASSERT(VALID_PAGE(root)); -- release_pt_page_64(vcpu, root, vcpu->mmu.shadow_root_level); -- root = kvm_mmu_alloc_page(vcpu, NULL); -- ASSERT(VALID_PAGE(root)); -- vcpu->mmu.root_hpa = root; -- if (is_paging(vcpu)) -- root |= (vcpu->cr3 & (CR3_PCD_MASK | CR3_WPT_MASK)); -- kvm_arch_ops->set_cr3(vcpu, root); -- kvm_arch_ops->tlb_flush(vcpu); -+#ifdef CONFIG_X86_64 -+ if (vcpu->mmu.shadow_root_level == PT64_ROOT_LEVEL) { -+ hpa_t root = vcpu->mmu.root_hpa; -+ -+ ASSERT(VALID_PAGE(root)); -+ page = page_header(root); -+ --page->root_count; -+ vcpu->mmu.root_hpa = INVALID_PAGE; -+ return; -+ } -+#endif -+ for (i = 0; i < 4; ++i) { -+ hpa_t root = vcpu->mmu.pae_root[i]; -+ -+ ASSERT(VALID_PAGE(root)); -+ root &= PT64_BASE_ADDR_MASK; -+ page = page_header(root); -+ --page->root_count; -+ vcpu->mmu.pae_root[i] = INVALID_PAGE; -+ } -+ vcpu->mmu.root_hpa = INVALID_PAGE; -+} -+ -+static void mmu_alloc_roots(struct kvm_vcpu *vcpu) -+{ -+ int i; -+ gfn_t root_gfn; -+ struct kvm_mmu_page *page; -+ -+ root_gfn = vcpu->cr3 >> PAGE_SHIFT; -+ -+#ifdef CONFIG_X86_64 -+ if (vcpu->mmu.shadow_root_level == PT64_ROOT_LEVEL) { -+ hpa_t root = vcpu->mmu.root_hpa; -+ -+ ASSERT(!VALID_PAGE(root)); -+ page = kvm_mmu_get_page(vcpu, root_gfn, 0, -+ PT64_ROOT_LEVEL, 0, NULL); -+ root = page->page_hpa; -+ ++page->root_count; -+ vcpu->mmu.root_hpa = root; -+ return; -+ } -+#endif -+ for (i = 0; i < 4; ++i) { -+ hpa_t root = vcpu->mmu.pae_root[i]; -+ -+ ASSERT(!VALID_PAGE(root)); -+ if (vcpu->mmu.root_level == PT32E_ROOT_LEVEL) -+ root_gfn = vcpu->pdptrs[i] >> PAGE_SHIFT; -+ else if (vcpu->mmu.root_level == 0) -+ root_gfn = 0; -+ page = kvm_mmu_get_page(vcpu, root_gfn, i << 30, -+ PT32_ROOT_LEVEL, !is_paging(vcpu), -+ NULL); -+ root = page->page_hpa; -+ ++page->root_count; -+ vcpu->mmu.pae_root[i] = root | PT_PRESENT_MASK; -+ } -+ vcpu->mmu.root_hpa = __pa(vcpu->mmu.pae_root); - } - - static gpa_t nonpaging_gva_to_gpa(struct kvm_vcpu *vcpu, gva_t vaddr) -@@ -322,43 +854,29 @@ static gpa_t nonpaging_gva_to_gpa(struct - static int nonpaging_page_fault(struct kvm_vcpu *vcpu, gva_t gva, - u32 error_code) - { -- int ret; - gpa_t addr = gva; -+ hpa_t paddr; -+ int r; -+ -+ r = mmu_topup_memory_caches(vcpu); -+ if (r) -+ return r; - - ASSERT(vcpu); - ASSERT(VALID_PAGE(vcpu->mmu.root_hpa)); - -- for (;;) { -- hpa_t paddr; - -- paddr = gpa_to_hpa(vcpu , addr & PT64_BASE_ADDR_MASK); -+ paddr = gpa_to_hpa(vcpu , addr & PT64_BASE_ADDR_MASK); - -- if (is_error_hpa(paddr)) -- return 1; -- -- ret = nonpaging_map(vcpu, addr & PAGE_MASK, paddr); -- if (ret) { -- nonpaging_flush(vcpu); -- continue; -- } -- break; -- } -- return ret; --} -+ if (is_error_hpa(paddr)) -+ return 1; - --static void nonpaging_inval_page(struct kvm_vcpu *vcpu, gva_t addr) --{ -+ return nonpaging_map(vcpu, addr & PAGE_MASK, paddr); - } - - static void nonpaging_free(struct kvm_vcpu *vcpu) - { -- hpa_t root; -- -- ASSERT(vcpu); -- root = vcpu->mmu.root_hpa; -- if (VALID_PAGE(root)) -- release_pt_page_64(vcpu, root, vcpu->mmu.shadow_root_level); -- vcpu->mmu.root_hpa = INVALID_PAGE; -+ mmu_free_roots(vcpu); - } - - static int nonpaging_init_context(struct kvm_vcpu *vcpu) -@@ -367,40 +885,31 @@ static int nonpaging_init_context(struct - - context->new_cr3 = nonpaging_new_cr3; - context->page_fault = nonpaging_page_fault; -- context->inval_page = nonpaging_inval_page; - context->gva_to_gpa = nonpaging_gva_to_gpa; - context->free = nonpaging_free; -- context->root_level = PT32E_ROOT_LEVEL; -+ context->root_level = 0; - context->shadow_root_level = PT32E_ROOT_LEVEL; -- context->root_hpa = kvm_mmu_alloc_page(vcpu, NULL); -+ mmu_alloc_roots(vcpu); - ASSERT(VALID_PAGE(context->root_hpa)); - kvm_arch_ops->set_cr3(vcpu, context->root_hpa); - return 0; - } - -- - static void kvm_mmu_flush_tlb(struct kvm_vcpu *vcpu) - { -- struct kvm_mmu_page *page, *npage; -- -- list_for_each_entry_safe(page, npage, &vcpu->kvm->active_mmu_pages, -- link) { -- if (page->global) -- continue; -- -- if (!page->parent_pte) -- continue; -- -- *page->parent_pte = 0; -- release_pt_page_64(vcpu, page->page_hpa, 1); -- } - ++kvm_stat.tlb_flush; - kvm_arch_ops->tlb_flush(vcpu); - } - - static void paging_new_cr3(struct kvm_vcpu *vcpu) - { -+ pgprintk("%s: cr3 %lx\n", __FUNCTION__, vcpu->cr3); -+ mmu_free_roots(vcpu); -+ if (unlikely(vcpu->kvm->n_free_mmu_pages < KVM_MIN_FREE_MMU_PAGES)) -+ kvm_mmu_free_some_pages(vcpu); -+ mmu_alloc_roots(vcpu); - kvm_mmu_flush_tlb(vcpu); -+ kvm_arch_ops->set_cr3(vcpu, vcpu->mmu.root_hpa); - } - - static void mark_pagetable_nonglobal(void *shadow_pte) -@@ -412,7 +921,8 @@ static inline void set_pte_common(struct - u64 *shadow_pte, - gpa_t gaddr, - int dirty, -- u64 access_bits) -+ u64 access_bits, -+ gfn_t gfn) - { - hpa_t paddr; - -@@ -420,13 +930,10 @@ static inline void set_pte_common(struct - if (!dirty) - access_bits &= ~PT_WRITABLE_MASK; - -- if (access_bits & PT_WRITABLE_MASK) -- mark_page_dirty(vcpu->kvm, gaddr >> PAGE_SHIFT); -+ paddr = gpa_to_hpa(vcpu, gaddr & PT64_BASE_ADDR_MASK); - - *shadow_pte |= access_bits; - -- paddr = gpa_to_hpa(vcpu, gaddr & PT64_BASE_ADDR_MASK); -- - if (!(*shadow_pte & PT_GLOBAL_MASK)) - mark_pagetable_nonglobal(shadow_pte); - -@@ -434,10 +941,31 @@ static inline void set_pte_common(struct - *shadow_pte |= gaddr; - *shadow_pte |= PT_SHADOW_IO_MARK; - *shadow_pte &= ~PT_PRESENT_MASK; -- } else { -- *shadow_pte |= paddr; -- page_header_update_slot(vcpu->kvm, shadow_pte, gaddr); -+ return; -+ } -+ -+ *shadow_pte |= paddr; -+ -+ if (access_bits & PT_WRITABLE_MASK) { -+ struct kvm_mmu_page *shadow; -+ -+ shadow = kvm_mmu_lookup_page(vcpu, gfn); -+ if (shadow) { -+ pgprintk("%s: found shadow page for %lx, marking ro\n", -+ __FUNCTION__, gfn); -+ access_bits &= ~PT_WRITABLE_MASK; -+ if (is_writeble_pte(*shadow_pte)) { -+ *shadow_pte &= ~PT_WRITABLE_MASK; -+ kvm_arch_ops->tlb_flush(vcpu); -+ } -+ } - } -+ -+ if (access_bits & PT_WRITABLE_MASK) -+ mark_page_dirty(vcpu->kvm, gaddr >> PAGE_SHIFT); -+ -+ page_header_update_slot(vcpu->kvm, shadow_pte, gaddr); -+ rmap_add(vcpu, shadow_pte); - } - - static void inject_page_fault(struct kvm_vcpu *vcpu, -@@ -474,41 +1002,6 @@ static int may_access(u64 pte, int write - return 1; - } - --/* -- * Remove a shadow pte. -- */ --static void paging_inval_page(struct kvm_vcpu *vcpu, gva_t addr) --{ -- hpa_t page_addr = vcpu->mmu.root_hpa; -- int level = vcpu->mmu.shadow_root_level; -- -- ++kvm_stat.invlpg; -- -- for (; ; level--) { -- u32 index = PT64_INDEX(addr, level); -- u64 *table = __va(page_addr); -- -- if (level == PT_PAGE_TABLE_LEVEL ) { -- table[index] = 0; -- return; -- } -- -- if (!is_present_pte(table[index])) -- return; -- -- page_addr = table[index] & PT64_BASE_ADDR_MASK; -- -- if (level == PT_DIRECTORY_LEVEL && -- (table[index] & PT_SHADOW_PS_MARK)) { -- table[index] = 0; -- release_pt_page_64(vcpu, page_addr, PT_PAGE_TABLE_LEVEL); -- -- kvm_arch_ops->tlb_flush(vcpu); -- return; -- } -- } --} -- - static void paging_free(struct kvm_vcpu *vcpu) - { - nonpaging_free(vcpu); -@@ -522,37 +1015,40 @@ static void paging_free(struct kvm_vcpu - #include "paging_tmpl.h" - #undef PTTYPE - --static int paging64_init_context(struct kvm_vcpu *vcpu) -+static int paging64_init_context_common(struct kvm_vcpu *vcpu, int level) - { - struct kvm_mmu *context = &vcpu->mmu; - - ASSERT(is_pae(vcpu)); - context->new_cr3 = paging_new_cr3; - context->page_fault = paging64_page_fault; -- context->inval_page = paging_inval_page; - context->gva_to_gpa = paging64_gva_to_gpa; - context->free = paging_free; -- context->root_level = PT64_ROOT_LEVEL; -- context->shadow_root_level = PT64_ROOT_LEVEL; -- context->root_hpa = kvm_mmu_alloc_page(vcpu, NULL); -+ context->root_level = level; -+ context->shadow_root_level = level; -+ mmu_alloc_roots(vcpu); - ASSERT(VALID_PAGE(context->root_hpa)); - kvm_arch_ops->set_cr3(vcpu, context->root_hpa | - (vcpu->cr3 & (CR3_PCD_MASK | CR3_WPT_MASK))); - return 0; - } - -+static int paging64_init_context(struct kvm_vcpu *vcpu) -+{ -+ return paging64_init_context_common(vcpu, PT64_ROOT_LEVEL); -+} -+ - static int paging32_init_context(struct kvm_vcpu *vcpu) - { - struct kvm_mmu *context = &vcpu->mmu; - - context->new_cr3 = paging_new_cr3; - context->page_fault = paging32_page_fault; -- context->inval_page = paging_inval_page; - context->gva_to_gpa = paging32_gva_to_gpa; - context->free = paging_free; - context->root_level = PT32_ROOT_LEVEL; - context->shadow_root_level = PT32E_ROOT_LEVEL; -- context->root_hpa = kvm_mmu_alloc_page(vcpu, NULL); -+ mmu_alloc_roots(vcpu); - ASSERT(VALID_PAGE(context->root_hpa)); - kvm_arch_ops->set_cr3(vcpu, context->root_hpa | - (vcpu->cr3 & (CR3_PCD_MASK | CR3_WPT_MASK))); -@@ -561,14 +1057,7 @@ static int paging32_init_context(struct - - static int paging32E_init_context(struct kvm_vcpu *vcpu) - { -- int ret; -- -- if ((ret = paging64_init_context(vcpu))) -- return ret; -- -- vcpu->mmu.root_level = PT32E_ROOT_LEVEL; -- vcpu->mmu.shadow_root_level = PT32E_ROOT_LEVEL; -- return 0; -+ return paging64_init_context_common(vcpu, PT32E_ROOT_LEVEL); - } - - static int init_kvm_mmu(struct kvm_vcpu *vcpu) -@@ -578,7 +1067,7 @@ static int init_kvm_mmu(struct kvm_vcpu - - if (!is_paging(vcpu)) - return nonpaging_init_context(vcpu); -- else if (kvm_arch_ops->is_long_mode(vcpu)) -+ else if (is_long_mode(vcpu)) - return paging64_init_context(vcpu); - else if (is_pae(vcpu)) - return paging32E_init_context(vcpu); -@@ -597,41 +1086,161 @@ static void destroy_kvm_mmu(struct kvm_v - - int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) - { -+ int r; -+ - destroy_kvm_mmu(vcpu); -- return init_kvm_mmu(vcpu); -+ r = init_kvm_mmu(vcpu); -+ if (r < 0) -+ goto out; -+ r = mmu_topup_memory_caches(vcpu); -+out: -+ return r; - } - --static void free_mmu_pages(struct kvm_vcpu *vcpu) -+void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) - { -- while (!list_empty(&vcpu->free_pages)) { -+ gfn_t gfn = gpa >> PAGE_SHIFT; -+ struct kvm_mmu_page *page; -+ struct kvm_mmu_page *child; -+ struct hlist_node *node, *n; -+ struct hlist_head *bucket; -+ unsigned index; -+ u64 *spte; -+ u64 pte; -+ unsigned offset = offset_in_page(gpa); -+ unsigned pte_size; -+ unsigned page_offset; -+ unsigned misaligned; -+ int level; -+ int flooded = 0; -+ -+ pgprintk("%s: gpa %llx bytes %d\n", __FUNCTION__, gpa, bytes); -+ if (gfn == vcpu->last_pt_write_gfn) { -+ ++vcpu->last_pt_write_count; -+ if (vcpu->last_pt_write_count >= 3) -+ flooded = 1; -+ } else { -+ vcpu->last_pt_write_gfn = gfn; -+ vcpu->last_pt_write_count = 1; -+ } -+ index = kvm_page_table_hashfn(gfn) % KVM_NUM_MMU_PAGES; -+ bucket = &vcpu->kvm->mmu_page_hash[index]; -+ hlist_for_each_entry_safe(page, node, n, bucket, hash_link) { -+ if (page->gfn != gfn || page->role.metaphysical) -+ continue; -+ pte_size = page->role.glevels == PT32_ROOT_LEVEL ? 4 : 8; -+ misaligned = (offset ^ (offset + bytes - 1)) & ~(pte_size - 1); -+ if (misaligned || flooded) { -+ /* -+ * Misaligned accesses are too much trouble to fix -+ * up; also, they usually indicate a page is not used -+ * as a page table. -+ * -+ * If we're seeing too many writes to a page, -+ * it may no longer be a page table, or we may be -+ * forking, in which case it is better to unmap the -+ * page. -+ */ -+ pgprintk("misaligned: gpa %llx bytes %d role %x\n", -+ gpa, bytes, page->role.word); -+ kvm_mmu_zap_page(vcpu, page); -+ continue; -+ } -+ page_offset = offset; -+ level = page->role.level; -+ if (page->role.glevels == PT32_ROOT_LEVEL) { -+ page_offset <<= 1; /* 32->64 */ -+ page_offset &= ~PAGE_MASK; -+ } -+ spte = __va(page->page_hpa); -+ spte += page_offset / sizeof(*spte); -+ pte = *spte; -+ if (is_present_pte(pte)) { -+ if (level == PT_PAGE_TABLE_LEVEL) -+ rmap_remove(vcpu, spte); -+ else { -+ child = page_header(pte & PT64_BASE_ADDR_MASK); -+ mmu_page_remove_parent_pte(vcpu, child, spte); -+ } -+ } -+ *spte = 0; -+ } -+} -+ -+void kvm_mmu_post_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) -+{ -+} -+ -+int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva) -+{ -+ gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, gva); -+ -+ return kvm_mmu_unprotect_page(vcpu, gpa >> PAGE_SHIFT); -+} -+ -+void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu) -+{ -+ while (vcpu->kvm->n_free_mmu_pages < KVM_REFILL_PAGES) { - struct kvm_mmu_page *page; - -+ page = container_of(vcpu->kvm->active_mmu_pages.prev, -+ struct kvm_mmu_page, link); -+ kvm_mmu_zap_page(vcpu, page); -+ } -+} -+EXPORT_SYMBOL_GPL(kvm_mmu_free_some_pages); -+ -+static void free_mmu_pages(struct kvm_vcpu *vcpu) -+{ -+ struct kvm_mmu_page *page; -+ -+ while (!list_empty(&vcpu->kvm->active_mmu_pages)) { -+ page = container_of(vcpu->kvm->active_mmu_pages.next, -+ struct kvm_mmu_page, link); -+ kvm_mmu_zap_page(vcpu, page); -+ } -+ while (!list_empty(&vcpu->free_pages)) { - page = list_entry(vcpu->free_pages.next, - struct kvm_mmu_page, link); - list_del(&page->link); - __free_page(pfn_to_page(page->page_hpa >> PAGE_SHIFT)); - page->page_hpa = INVALID_PAGE; - } -+ free_page((unsigned long)vcpu->mmu.pae_root); - } - - static int alloc_mmu_pages(struct kvm_vcpu *vcpu) - { -+ struct page *page; - int i; - - ASSERT(vcpu); - - for (i = 0; i < KVM_NUM_MMU_PAGES; i++) { -- struct page *page; - struct kvm_mmu_page *page_header = &vcpu->page_header_buf[i]; - - INIT_LIST_HEAD(&page_header->link); -- if ((page = alloc_page(GFP_KVM_MMU)) == NULL) -+ if ((page = alloc_page(GFP_KERNEL)) == NULL) - goto error_1; - page->private = (unsigned long)page_header; - page_header->page_hpa = (hpa_t)page_to_pfn(page) << PAGE_SHIFT; - memset(__va(page_header->page_hpa), 0, PAGE_SIZE); - list_add(&page_header->link, &vcpu->free_pages); -+ ++vcpu->kvm->n_free_mmu_pages; - } -+ -+ /* -+ * When emulating 32-bit mode, cr3 is only 32 bits even on x86_64. -+ * Therefore we need to allocate shadow page tables in the first -+ * 4GB of memory, which happens to fit the DMA32 zone. -+ */ -+ page = alloc_page(GFP_KERNEL | __GFP_DMA32); -+ if (!page) -+ goto error_1; -+ vcpu->mmu.pae_root = page_address(page); -+ for (i = 0; i < 4; ++i) -+ vcpu->mmu.pae_root[i] = INVALID_PAGE; -+ - return 0; - - error_1: -@@ -639,28 +1248,22 @@ error_1: - return -ENOMEM; - } - --int kvm_mmu_init(struct kvm_vcpu *vcpu) -+int kvm_mmu_create(struct kvm_vcpu *vcpu) - { -- int r; -- - ASSERT(vcpu); - ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa)); - ASSERT(list_empty(&vcpu->free_pages)); - -- r = alloc_mmu_pages(vcpu); -- if (r) -- goto out; -- -- r = init_kvm_mmu(vcpu); -- if (r) -- goto out_free_pages; -+ return alloc_mmu_pages(vcpu); -+} - -- return 0; -+int kvm_mmu_setup(struct kvm_vcpu *vcpu) -+{ -+ ASSERT(vcpu); -+ ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa)); -+ ASSERT(!list_empty(&vcpu->free_pages)); - --out_free_pages: -- free_mmu_pages(vcpu); --out: -- return r; -+ return init_kvm_mmu(vcpu); - } - - void kvm_mmu_destroy(struct kvm_vcpu *vcpu) -@@ -669,10 +1272,12 @@ void kvm_mmu_destroy(struct kvm_vcpu *vc - - destroy_kvm_mmu(vcpu); - free_mmu_pages(vcpu); -+ mmu_free_memory_caches(vcpu); - } - --void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot) -+void kvm_mmu_slot_remove_write_access(struct kvm_vcpu *vcpu, int slot) - { -+ struct kvm *kvm = vcpu->kvm; - struct kvm_mmu_page *page; - - list_for_each_entry(page, &kvm->active_mmu_pages, link) { -@@ -685,8 +1290,169 @@ void kvm_mmu_slot_remove_write_access(st - pt = __va(page->page_hpa); - for (i = 0; i < PT64_ENT_PER_PAGE; ++i) - /* avoid RMW */ -- if (pt[i] & PT_WRITABLE_MASK) -+ if (pt[i] & PT_WRITABLE_MASK) { -+ rmap_remove(vcpu, &pt[i]); - pt[i] &= ~PT_WRITABLE_MASK; -+ } -+ } -+} -+ -+#ifdef AUDIT -+ -+static const char *audit_msg; -+ -+static gva_t canonicalize(gva_t gva) -+{ -+#ifdef CONFIG_X86_64 -+ gva = (long long)(gva << 16) >> 16; -+#endif -+ return gva; -+} -+ -+static void audit_mappings_page(struct kvm_vcpu *vcpu, u64 page_pte, -+ gva_t va, int level) -+{ -+ u64 *pt = __va(page_pte & PT64_BASE_ADDR_MASK); -+ int i; -+ gva_t va_delta = 1ul << (PAGE_SHIFT + 9 * (level - 1)); -+ -+ for (i = 0; i < PT64_ENT_PER_PAGE; ++i, va += va_delta) { -+ u64 ent = pt[i]; -+ -+ if (!ent & PT_PRESENT_MASK) -+ continue; - -+ va = canonicalize(va); -+ if (level > 1) -+ audit_mappings_page(vcpu, ent, va, level - 1); -+ else { -+ gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, va); -+ hpa_t hpa = gpa_to_hpa(vcpu, gpa); -+ -+ if ((ent & PT_PRESENT_MASK) -+ && (ent & PT64_BASE_ADDR_MASK) != hpa) -+ printk(KERN_ERR "audit error: (%s) levels %d" -+ " gva %lx gpa %llx hpa %llx ent %llx\n", -+ audit_msg, vcpu->mmu.root_level, -+ va, gpa, hpa, ent); -+ } - } - } -+ -+static void audit_mappings(struct kvm_vcpu *vcpu) -+{ -+ int i; -+ -+ if (vcpu->mmu.root_level == 4) -+ audit_mappings_page(vcpu, vcpu->mmu.root_hpa, 0, 4); -+ else -+ for (i = 0; i < 4; ++i) -+ if (vcpu->mmu.pae_root[i] & PT_PRESENT_MASK) -+ audit_mappings_page(vcpu, -+ vcpu->mmu.pae_root[i], -+ i << 30, -+ 2); -+} -+ -+static int count_rmaps(struct kvm_vcpu *vcpu) -+{ -+ int nmaps = 0; -+ int i, j, k; -+ -+ for (i = 0; i < KVM_MEMORY_SLOTS; ++i) { -+ struct kvm_memory_slot *m = &vcpu->kvm->memslots[i]; -+ struct kvm_rmap_desc *d; -+ -+ for (j = 0; j < m->npages; ++j) { -+ struct page *page = m->phys_mem[j]; -+ -+ if (!page->private) -+ continue; -+ if (!(page->private & 1)) { -+ ++nmaps; -+ continue; -+ } -+ d = (struct kvm_rmap_desc *)(page->private & ~1ul); -+ while (d) { -+ for (k = 0; k < RMAP_EXT; ++k) -+ if (d->shadow_ptes[k]) -+ ++nmaps; -+ else -+ break; -+ d = d->more; -+ } -+ } -+ } -+ return nmaps; -+} -+ -+static int count_writable_mappings(struct kvm_vcpu *vcpu) -+{ -+ int nmaps = 0; -+ struct kvm_mmu_page *page; -+ int i; -+ -+ list_for_each_entry(page, &vcpu->kvm->active_mmu_pages, link) { -+ u64 *pt = __va(page->page_hpa); -+ -+ if (page->role.level != PT_PAGE_TABLE_LEVEL) -+ continue; -+ -+ for (i = 0; i < PT64_ENT_PER_PAGE; ++i) { -+ u64 ent = pt[i]; -+ -+ if (!(ent & PT_PRESENT_MASK)) -+ continue; -+ if (!(ent & PT_WRITABLE_MASK)) -+ continue; -+ ++nmaps; -+ } -+ } -+ return nmaps; -+} -+ -+static void audit_rmap(struct kvm_vcpu *vcpu) -+{ -+ int n_rmap = count_rmaps(vcpu); -+ int n_actual = count_writable_mappings(vcpu); -+ -+ if (n_rmap != n_actual) -+ printk(KERN_ERR "%s: (%s) rmap %d actual %d\n", -+ __FUNCTION__, audit_msg, n_rmap, n_actual); -+} -+ -+static void audit_write_protection(struct kvm_vcpu *vcpu) -+{ -+ struct kvm_mmu_page *page; -+ -+ list_for_each_entry(page, &vcpu->kvm->active_mmu_pages, link) { -+ hfn_t hfn; -+ struct page *pg; -+ -+ if (page->role.metaphysical) -+ continue; -+ -+ hfn = gpa_to_hpa(vcpu, (gpa_t)page->gfn << PAGE_SHIFT) -+ >> PAGE_SHIFT; -+ pg = pfn_to_page(hfn); -+ if (pg->private) -+ printk(KERN_ERR "%s: (%s) shadow page has writable" -+ " mappings: gfn %lx role %x\n", -+ __FUNCTION__, audit_msg, page->gfn, -+ page->role.word); -+ } -+} -+ -+static void kvm_mmu_audit(struct kvm_vcpu *vcpu, const char *msg) -+{ -+ int olddbg = dbg; -+ -+ dbg = 0; -+ audit_msg = msg; -+ audit_rmap(vcpu); -+ audit_write_protection(vcpu); -+ audit_mappings(vcpu); -+ dbg = olddbg; -+} -+ -+#endif -diff -Nurp linux-2.6.19-gentoo-r4/drivers/kvm/paging_tmpl.h linux-2.6.20-rc4/drivers/kvm/paging_tmpl.h ---- linux-2.6.19-gentoo-r4/drivers/kvm/paging_tmpl.h 2007-01-09 23:44:33.000000000 +0100 -+++ linux-2.6.20-rc4/drivers/kvm/paging_tmpl.h 2007-01-09 23:53:07.000000000 +0100 -@@ -32,6 +32,11 @@ - #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) - #define PT_LEVEL_MASK(level) PT64_LEVEL_MASK(level) - #define PT_PTE_COPY_MASK PT64_PTE_COPY_MASK -+ #ifdef CONFIG_X86_64 -+ #define PT_MAX_FULL_LEVELS 4 -+ #else -+ #define PT_MAX_FULL_LEVELS 2 -+ #endif - #elif PTTYPE == 32 - #define pt_element_t u32 - #define guest_walker guest_walker32 -@@ -42,6 +47,7 @@ - #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) - #define PT_LEVEL_MASK(level) PT32_LEVEL_MASK(level) - #define PT_PTE_COPY_MASK PT32_PTE_COPY_MASK -+ #define PT_MAX_FULL_LEVELS 2 - #else - #error Invalid PTTYPE value - #endif -@@ -52,93 +58,126 @@ - */ - struct guest_walker { - int level; -+ gfn_t table_gfn[PT_MAX_FULL_LEVELS]; - pt_element_t *table; -+ pt_element_t *ptep; - pt_element_t inherited_ar; -+ gfn_t gfn; - }; - --static void FNAME(init_walker)(struct guest_walker *walker, -- struct kvm_vcpu *vcpu) -+/* -+ * Fetch a guest pte for a guest virtual address -+ */ -+static void FNAME(walk_addr)(struct guest_walker *walker, -+ struct kvm_vcpu *vcpu, gva_t addr) - { - hpa_t hpa; - struct kvm_memory_slot *slot; -+ pt_element_t *ptep; -+ pt_element_t root; -+ gfn_t table_gfn; - -+ pgprintk("%s: addr %lx\n", __FUNCTION__, addr); - walker->level = vcpu->mmu.root_level; -- slot = gfn_to_memslot(vcpu->kvm, -- (vcpu->cr3 & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT); -- hpa = safe_gpa_to_hpa(vcpu, vcpu->cr3 & PT64_BASE_ADDR_MASK); -+ walker->table = NULL; -+ root = vcpu->cr3; -+#if PTTYPE == 64 -+ if (!is_long_mode(vcpu)) { -+ walker->ptep = &vcpu->pdptrs[(addr >> 30) & 3]; -+ root = *walker->ptep; -+ if (!(root & PT_PRESENT_MASK)) -+ return; -+ --walker->level; -+ } -+#endif -+ table_gfn = (root & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT; -+ walker->table_gfn[walker->level - 1] = table_gfn; -+ pgprintk("%s: table_gfn[%d] %lx\n", __FUNCTION__, -+ walker->level - 1, table_gfn); -+ slot = gfn_to_memslot(vcpu->kvm, table_gfn); -+ hpa = safe_gpa_to_hpa(vcpu, root & PT64_BASE_ADDR_MASK); - walker->table = kmap_atomic(pfn_to_page(hpa >> PAGE_SHIFT), KM_USER0); - -- ASSERT((!kvm_arch_ops->is_long_mode(vcpu) && is_pae(vcpu)) || -+ ASSERT((!is_long_mode(vcpu) && is_pae(vcpu)) || - (vcpu->cr3 & ~(PAGE_MASK | CR3_FLAGS_MASK)) == 0); - -- walker->table = (pt_element_t *)( (unsigned long)walker->table | -- (unsigned long)(vcpu->cr3 & ~(PAGE_MASK | CR3_FLAGS_MASK)) ); - walker->inherited_ar = PT_USER_MASK | PT_WRITABLE_MASK; -+ -+ for (;;) { -+ int index = PT_INDEX(addr, walker->level); -+ hpa_t paddr; -+ -+ ptep = &walker->table[index]; -+ ASSERT(((unsigned long)walker->table & PAGE_MASK) == -+ ((unsigned long)ptep & PAGE_MASK)); -+ -+ if (is_present_pte(*ptep) && !(*ptep & PT_ACCESSED_MASK)) -+ *ptep |= PT_ACCESSED_MASK; -+ -+ if (!is_present_pte(*ptep)) -+ break; -+ -+ if (walker->level == PT_PAGE_TABLE_LEVEL) { -+ walker->gfn = (*ptep & PT_BASE_ADDR_MASK) -+ >> PAGE_SHIFT; -+ break; -+ } -+ -+ if (walker->level == PT_DIRECTORY_LEVEL -+ && (*ptep & PT_PAGE_SIZE_MASK) -+ && (PTTYPE == 64 || is_pse(vcpu))) { -+ walker->gfn = (*ptep & PT_DIR_BASE_ADDR_MASK) -+ >> PAGE_SHIFT; -+ walker->gfn += PT_INDEX(addr, PT_PAGE_TABLE_LEVEL); -+ break; -+ } -+ -+ if (walker->level != 3 || is_long_mode(vcpu)) -+ walker->inherited_ar &= walker->table[index]; -+ table_gfn = (*ptep & PT_BASE_ADDR_MASK) >> PAGE_SHIFT; -+ paddr = safe_gpa_to_hpa(vcpu, *ptep & PT_BASE_ADDR_MASK); -+ kunmap_atomic(walker->table, KM_USER0); -+ walker->table = kmap_atomic(pfn_to_page(paddr >> PAGE_SHIFT), -+ KM_USER0); -+ --walker->level; -+ walker->table_gfn[walker->level - 1 ] = table_gfn; -+ pgprintk("%s: table_gfn[%d] %lx\n", __FUNCTION__, -+ walker->level - 1, table_gfn); -+ } -+ walker->ptep = ptep; -+ pgprintk("%s: pte %llx\n", __FUNCTION__, (u64)*ptep); - } - - static void FNAME(release_walker)(struct guest_walker *walker) - { -- kunmap_atomic(walker->table, KM_USER0); -+ if (walker->table) -+ kunmap_atomic(walker->table, KM_USER0); - } - - static void FNAME(set_pte)(struct kvm_vcpu *vcpu, u64 guest_pte, -- u64 *shadow_pte, u64 access_bits) -+ u64 *shadow_pte, u64 access_bits, gfn_t gfn) - { - ASSERT(*shadow_pte == 0); - access_bits &= guest_pte; - *shadow_pte = (guest_pte & PT_PTE_COPY_MASK); - set_pte_common(vcpu, shadow_pte, guest_pte & PT_BASE_ADDR_MASK, -- guest_pte & PT_DIRTY_MASK, access_bits); -+ guest_pte & PT_DIRTY_MASK, access_bits, gfn); - } - - static void FNAME(set_pde)(struct kvm_vcpu *vcpu, u64 guest_pde, -- u64 *shadow_pte, u64 access_bits, -- int index) -+ u64 *shadow_pte, u64 access_bits, gfn_t gfn) - { - gpa_t gaddr; - - ASSERT(*shadow_pte == 0); - access_bits &= guest_pde; -- gaddr = (guest_pde & PT_DIR_BASE_ADDR_MASK) + PAGE_SIZE * index; -+ gaddr = (gpa_t)gfn << PAGE_SHIFT; - if (PTTYPE == 32 && is_cpuid_PSE36()) - gaddr |= (guest_pde & PT32_DIR_PSE36_MASK) << - (32 - PT32_DIR_PSE36_SHIFT); - *shadow_pte = guest_pde & PT_PTE_COPY_MASK; - set_pte_common(vcpu, shadow_pte, gaddr, -- guest_pde & PT_DIRTY_MASK, access_bits); --} -- --/* -- * Fetch a guest pte from a specific level in the paging hierarchy. -- */ --static pt_element_t *FNAME(fetch_guest)(struct kvm_vcpu *vcpu, -- struct guest_walker *walker, -- int level, -- gva_t addr) --{ -- -- ASSERT(level > 0 && level <= walker->level); -- -- for (;;) { -- int index = PT_INDEX(addr, walker->level); -- hpa_t paddr; -- -- ASSERT(((unsigned long)walker->table & PAGE_MASK) == -- ((unsigned long)&walker->table[index] & PAGE_MASK)); -- if (level == walker->level || -- !is_present_pte(walker->table[index]) || -- (walker->level == PT_DIRECTORY_LEVEL && -- (walker->table[index] & PT_PAGE_SIZE_MASK) && -- (PTTYPE == 64 || is_pse(vcpu)))) -- return &walker->table[index]; -- if (walker->level != 3 || kvm_arch_ops->is_long_mode(vcpu)) -- walker->inherited_ar &= walker->table[index]; -- paddr = safe_gpa_to_hpa(vcpu, walker->table[index] & PT_BASE_ADDR_MASK); -- kunmap_atomic(walker->table, KM_USER0); -- walker->table = kmap_atomic(pfn_to_page(paddr >> PAGE_SHIFT), -- KM_USER0); -- --walker->level; -- } -+ guest_pde & PT_DIRTY_MASK, access_bits, gfn); - } - - /* -@@ -150,15 +189,26 @@ static u64 *FNAME(fetch)(struct kvm_vcpu - hpa_t shadow_addr; - int level; - u64 *prev_shadow_ent = NULL; -+ pt_element_t *guest_ent = walker->ptep; -+ -+ if (!is_present_pte(*guest_ent)) -+ return NULL; - - shadow_addr = vcpu->mmu.root_hpa; - level = vcpu->mmu.shadow_root_level; -+ if (level == PT32E_ROOT_LEVEL) { -+ shadow_addr = vcpu->mmu.pae_root[(addr >> 30) & 3]; -+ shadow_addr &= PT64_BASE_ADDR_MASK; -+ --level; -+ } - - for (; ; level--) { - u32 index = SHADOW_PT_INDEX(addr, level); - u64 *shadow_ent = ((u64 *)__va(shadow_addr)) + index; -- pt_element_t *guest_ent; -+ struct kvm_mmu_page *shadow_page; - u64 shadow_pte; -+ int metaphysical; -+ gfn_t table_gfn; - - if (is_present_pte(*shadow_ent) || is_io_pte(*shadow_ent)) { - if (level == PT_PAGE_TABLE_LEVEL) -@@ -168,21 +218,6 @@ static u64 *FNAME(fetch)(struct kvm_vcpu - continue; - } - -- if (PTTYPE == 32 && level > PT32_ROOT_LEVEL) { -- ASSERT(level == PT32E_ROOT_LEVEL); -- guest_ent = FNAME(fetch_guest)(vcpu, walker, -- PT32_ROOT_LEVEL, addr); -- } else -- guest_ent = FNAME(fetch_guest)(vcpu, walker, -- level, addr); -- -- if (!is_present_pte(*guest_ent)) -- return NULL; -- -- /* Don't set accessed bit on PAE PDPTRs */ -- if (vcpu->mmu.root_level != 3 || walker->level != 3) -- *guest_ent |= PT_ACCESSED_MASK; -- - if (level == PT_PAGE_TABLE_LEVEL) { - - if (walker->level == PT_DIRECTORY_LEVEL) { -@@ -190,21 +225,30 @@ static u64 *FNAME(fetch)(struct kvm_vcpu - *prev_shadow_ent |= PT_SHADOW_PS_MARK; - FNAME(set_pde)(vcpu, *guest_ent, shadow_ent, - walker->inherited_ar, -- PT_INDEX(addr, PT_PAGE_TABLE_LEVEL)); -+ walker->gfn); - } else { - ASSERT(walker->level == PT_PAGE_TABLE_LEVEL); -- FNAME(set_pte)(vcpu, *guest_ent, shadow_ent, walker->inherited_ar); -+ FNAME(set_pte)(vcpu, *guest_ent, shadow_ent, -+ walker->inherited_ar, -+ walker->gfn); - } - return shadow_ent; - } - -- shadow_addr = kvm_mmu_alloc_page(vcpu, shadow_ent); -- if (!VALID_PAGE(shadow_addr)) -- return ERR_PTR(-ENOMEM); -- shadow_pte = shadow_addr | PT_PRESENT_MASK; -- if (vcpu->mmu.root_level > 3 || level != 3) -- shadow_pte |= PT_ACCESSED_MASK -- | PT_WRITABLE_MASK | PT_USER_MASK; -+ if (level - 1 == PT_PAGE_TABLE_LEVEL -+ && walker->level == PT_DIRECTORY_LEVEL) { -+ metaphysical = 1; -+ table_gfn = (*guest_ent & PT_BASE_ADDR_MASK) -+ >> PAGE_SHIFT; -+ } else { -+ metaphysical = 0; -+ table_gfn = walker->table_gfn[level - 2]; -+ } -+ shadow_page = kvm_mmu_get_page(vcpu, table_gfn, addr, level-1, -+ metaphysical, shadow_ent); -+ shadow_addr = shadow_page->page_hpa; -+ shadow_pte = shadow_addr | PT_PRESENT_MASK | PT_ACCESSED_MASK -+ | PT_WRITABLE_MASK | PT_USER_MASK; - *shadow_ent = shadow_pte; - prev_shadow_ent = shadow_ent; - } -@@ -221,11 +265,13 @@ static int FNAME(fix_write_pf)(struct kv - u64 *shadow_ent, - struct guest_walker *walker, - gva_t addr, -- int user) -+ int user, -+ int *write_pt) - { - pt_element_t *guest_ent; - int writable_shadow; - gfn_t gfn; -+ struct kvm_mmu_page *page; - - if (is_writeble_pte(*shadow_ent)) - return 0; -@@ -250,17 +296,35 @@ static int FNAME(fix_write_pf)(struct kv - *shadow_ent &= ~PT_USER_MASK; - } - -- guest_ent = FNAME(fetch_guest)(vcpu, walker, PT_PAGE_TABLE_LEVEL, addr); -+ guest_ent = walker->ptep; - - if (!is_present_pte(*guest_ent)) { - *shadow_ent = 0; - return 0; - } - -- gfn = (*guest_ent & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT; -+ gfn = walker->gfn; -+ -+ if (user) { -+ /* -+ * Usermode page faults won't be for page table updates. -+ */ -+ while ((page = kvm_mmu_lookup_page(vcpu, gfn)) != NULL) { -+ pgprintk("%s: zap %lx %x\n", -+ __FUNCTION__, gfn, page->role.word); -+ kvm_mmu_zap_page(vcpu, page); -+ } -+ } else if (kvm_mmu_lookup_page(vcpu, gfn)) { -+ pgprintk("%s: found shadow page for %lx, marking ro\n", -+ __FUNCTION__, gfn); -+ *guest_ent |= PT_DIRTY_MASK; -+ *write_pt = 1; -+ return 0; -+ } - mark_page_dirty(vcpu->kvm, gfn); - *shadow_ent |= PT_WRITABLE_MASK; - *guest_ent |= PT_DIRTY_MASK; -+ rmap_add(vcpu, shadow_ent); - - return 1; - } -@@ -276,7 +340,8 @@ static int FNAME(fix_write_pf)(struct kv - * - normal guest page fault due to the guest pte marked not present, not - * writable, or not executable - * -- * Returns: 1 if we need to emulate the instruction, 0 otherwise -+ * Returns: 1 if we need to emulate the instruction, 0 otherwise, or -+ * a negative value on error. - */ - static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, - u32 error_code) -@@ -287,39 +352,47 @@ static int FNAME(page_fault)(struct kvm_ - struct guest_walker walker; - u64 *shadow_pte; - int fixed; -+ int write_pt = 0; -+ int r; -+ -+ pgprintk("%s: addr %lx err %x\n", __FUNCTION__, addr, error_code); -+ kvm_mmu_audit(vcpu, "pre page fault"); -+ -+ r = mmu_topup_memory_caches(vcpu); -+ if (r) -+ return r; - - /* - * Look up the shadow pte for the faulting address. - */ -- for (;;) { -- FNAME(init_walker)(&walker, vcpu); -- shadow_pte = FNAME(fetch)(vcpu, addr, &walker); -- if (IS_ERR(shadow_pte)) { /* must be -ENOMEM */ -- nonpaging_flush(vcpu); -- FNAME(release_walker)(&walker); -- continue; -- } -- break; -- } -+ FNAME(walk_addr)(&walker, vcpu, addr); -+ shadow_pte = FNAME(fetch)(vcpu, addr, &walker); - - /* - * The page is not mapped by the guest. Let the guest handle it. - */ - if (!shadow_pte) { -+ pgprintk("%s: not mapped\n", __FUNCTION__); - inject_page_fault(vcpu, addr, error_code); - FNAME(release_walker)(&walker); - return 0; - } - -+ pgprintk("%s: shadow pte %p %llx\n", __FUNCTION__, -+ shadow_pte, *shadow_pte); -+ - /* - * Update the shadow pte. - */ - if (write_fault) - fixed = FNAME(fix_write_pf)(vcpu, shadow_pte, &walker, addr, -- user_fault); -+ user_fault, &write_pt); - else - fixed = fix_read_pf(shadow_pte); - -+ pgprintk("%s: updated shadow pte %p %llx\n", __FUNCTION__, -+ shadow_pte, *shadow_pte); -+ - FNAME(release_walker)(&walker); - - /* -@@ -331,20 +404,23 @@ static int FNAME(page_fault)(struct kvm_ - pgprintk("%s: io work, no access\n", __FUNCTION__); - inject_page_fault(vcpu, addr, - error_code | PFERR_PRESENT_MASK); -+ kvm_mmu_audit(vcpu, "post page fault (io)"); - return 0; - } - - /* - * pte not present, guest page fault. - */ -- if (pte_present && !fixed) { -+ if (pte_present && !fixed && !write_pt) { - inject_page_fault(vcpu, addr, error_code); -+ kvm_mmu_audit(vcpu, "post page fault (guest)"); - return 0; - } - - ++kvm_stat.pf_fixed; -+ kvm_mmu_audit(vcpu, "post page fault (fixed)"); - -- return 0; -+ return write_pt; - } - - static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr) -@@ -353,9 +429,8 @@ static gpa_t FNAME(gva_to_gpa)(struct kv - pt_element_t guest_pte; - gpa_t gpa; - -- FNAME(init_walker)(&walker, vcpu); -- guest_pte = *FNAME(fetch_guest)(vcpu, &walker, PT_PAGE_TABLE_LEVEL, -- vaddr); -+ FNAME(walk_addr)(&walker, vcpu, vaddr); -+ guest_pte = *walker.ptep; - FNAME(release_walker)(&walker); - - if (!is_present_pte(guest_pte)) -@@ -389,3 +464,4 @@ static gpa_t FNAME(gva_to_gpa)(struct kv - #undef PT_PTE_COPY_MASK - #undef PT_NON_PTE_COPY_MASK - #undef PT_DIR_BASE_ADDR_MASK -+#undef PT_MAX_FULL_LEVELS -diff -Nurp linux-2.6.19-gentoo-r4/drivers/kvm/svm.c linux-2.6.20-rc4/drivers/kvm/svm.c ---- linux-2.6.19-gentoo-r4/drivers/kvm/svm.c 2007-01-09 23:44:33.000000000 +0100 -+++ linux-2.6.20-rc4/drivers/kvm/svm.c 2007-01-09 23:53:07.000000000 +0100 -@@ -166,11 +166,6 @@ static inline void write_dr7(unsigned lo - asm volatile ("mov %0, %%dr7" :: "r" (val)); - } - --static inline int svm_is_long_mode(struct kvm_vcpu *vcpu) --{ -- return vcpu->svm->vmcb->save.efer & KVM_EFER_LMA; --} -- - static inline void force_new_asid(struct kvm_vcpu *vcpu) - { - vcpu->svm->asid_generation--; -@@ -240,13 +235,15 @@ static void skip_emulated_instruction(st - - vcpu->rip = vcpu->svm->vmcb->save.rip = vcpu->svm->next_rip; - vcpu->svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; -+ -+ vcpu->interrupt_window_open = 1; - } - - static int has_svm(void) - { - uint32_t eax, ebx, ecx, edx; - -- if (current_cpu_data.x86_vendor != X86_VENDOR_AMD) { -+ if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) { - printk(KERN_INFO "has_svm: not amd\n"); - return 0; - } -@@ -500,7 +497,6 @@ static void init_vmcb(struct vmcb *vmcb) - /* (1ULL << INTERCEPT_SELECTIVE_CR0) | */ - (1ULL << INTERCEPT_CPUID) | - (1ULL << INTERCEPT_HLT) | -- (1ULL << INTERCEPT_INVLPG) | - (1ULL << INTERCEPT_INVLPGA) | - (1ULL << INTERCEPT_IOIO_PROT) | - (1ULL << INTERCEPT_MSR_PROT) | -@@ -705,6 +701,10 @@ static void svm_set_gdt(struct kvm_vcpu - vcpu->svm->vmcb->save.gdtr.base = dt->base ; - } - -+static void svm_decache_cr0_cr4_guest_bits(struct kvm_vcpu *vcpu) -+{ -+} -+ - static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) - { - #ifdef CONFIG_X86_64 -@@ -852,6 +852,7 @@ static int pf_interception(struct kvm_vc - u64 fault_address; - u32 error_code; - enum emulation_result er; -+ int r; - - if (is_external_interrupt(exit_int_info)) - push_irq(vcpu, exit_int_info & SVM_EVTINJ_VEC_MASK); -@@ -860,7 +861,12 @@ static int pf_interception(struct kvm_vc - - fault_address = vcpu->svm->vmcb->control.exit_info_2; - error_code = vcpu->svm->vmcb->control.exit_info_1; -- if (!vcpu->mmu.page_fault(vcpu, fault_address, error_code)) { -+ r = kvm_mmu_page_fault(vcpu, fault_address, error_code); -+ if (r < 0) { -+ spin_unlock(&vcpu->kvm->lock); -+ return r; -+ } -+ if (!r) { - spin_unlock(&vcpu->kvm->lock); - return 1; - } -@@ -1036,10 +1042,11 @@ static int halt_interception(struct kvm_ - { - vcpu->svm->next_rip = vcpu->svm->vmcb->save.rip + 1; - skip_emulated_instruction(vcpu); -- if (vcpu->irq_summary && (vcpu->svm->vmcb->save.rflags & X86_EFLAGS_IF)) -+ if (vcpu->irq_summary) - return 1; - - kvm_run->exit_reason = KVM_EXIT_HLT; -+ ++kvm_stat.halt_exits; - return 0; - } - -@@ -1073,22 +1080,6 @@ static int emulate_on_interception(struc - static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) - { - switch (ecx) { -- case MSR_IA32_P5_MC_ADDR: -- case MSR_IA32_P5_MC_TYPE: -- case MSR_IA32_MC0_CTL: -- case MSR_IA32_MCG_STATUS: -- case MSR_IA32_MCG_CAP: -- case MSR_IA32_MC0_MISC: -- case MSR_IA32_MC0_MISC+4: -- case MSR_IA32_MC0_MISC+8: -- case MSR_IA32_MC0_MISC+12: -- case MSR_IA32_MC0_MISC+16: -- case MSR_IA32_UCODE_REV: -- /* MTRR registers */ -- case 0xfe: -- case 0x200 ... 0x2ff: -- *data = 0; -- break; - case MSR_IA32_TIME_STAMP_COUNTER: { - u64 tsc; - -@@ -1096,12 +1087,6 @@ static int svm_get_msr(struct kvm_vcpu * - *data = vcpu->svm->vmcb->control.tsc_offset + tsc; - break; - } -- case MSR_EFER: -- *data = vcpu->shadow_efer; -- break; -- case MSR_IA32_APICBASE: -- *data = vcpu->apic_base; -- break; - case MSR_K6_STAR: - *data = vcpu->svm->vmcb->save.star; - break; -@@ -1129,8 +1114,7 @@ static int svm_get_msr(struct kvm_vcpu * - *data = vcpu->svm->vmcb->save.sysenter_esp; - break; - default: -- printk(KERN_ERR "kvm: unhandled rdmsr: 0x%x\n", ecx); -- return 1; -+ return kvm_get_msr_common(vcpu, ecx, data); - } - return 0; - } -@@ -1154,15 +1138,6 @@ static int rdmsr_interception(struct kvm - static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) - { - switch (ecx) { --#ifdef CONFIG_X86_64 -- case MSR_EFER: -- set_efer(vcpu, data); -- break; --#endif -- case MSR_IA32_MC0_STATUS: -- printk(KERN_WARNING "%s: MSR_IA32_MC0_STATUS 0x%llx, nop\n" -- , __FUNCTION__, data); -- break; - case MSR_IA32_TIME_STAMP_COUNTER: { - u64 tsc; - -@@ -1170,13 +1145,6 @@ static int svm_set_msr(struct kvm_vcpu * - vcpu->svm->vmcb->control.tsc_offset = data - tsc; - break; - } -- case MSR_IA32_UCODE_REV: -- case MSR_IA32_UCODE_WRITE: -- case 0x200 ... 0x2ff: /* MTRRs */ -- break; -- case MSR_IA32_APICBASE: -- vcpu->apic_base = data; -- break; - case MSR_K6_STAR: - vcpu->svm->vmcb->save.star = data; - break; -@@ -1204,8 +1172,7 @@ static int svm_set_msr(struct kvm_vcpu * - vcpu->svm->vmcb->save.sysenter_esp = data; - break; - default: -- printk(KERN_ERR "kvm: unhandled wrmsr: %x\n", ecx); -- return 1; -+ return kvm_set_msr_common(vcpu, ecx, data); - } - return 0; - } -@@ -1231,6 +1198,23 @@ static int msr_interception(struct kvm_v - return rdmsr_interception(vcpu, kvm_run); - } - -+static int interrupt_window_interception(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) -+{ -+ /* -+ * If the user space waits to inject interrupts, exit as soon as -+ * possible -+ */ -+ if (kvm_run->request_interrupt_window && -+ !vcpu->irq_summary) { -+ ++kvm_stat.irq_window_exits; -+ kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; -+ return 0; -+ } -+ -+ return 1; -+} -+ - static int (*svm_exit_handlers[])(struct kvm_vcpu *vcpu, - struct kvm_run *kvm_run) = { - [SVM_EXIT_READ_CR0] = emulate_on_interception, -@@ -1255,6 +1239,7 @@ static int (*svm_exit_handlers[])(struct - [SVM_EXIT_NMI] = nop_on_interception, - [SVM_EXIT_SMI] = nop_on_interception, - [SVM_EXIT_INIT] = nop_on_interception, -+ [SVM_EXIT_VINTR] = interrupt_window_interception, - /* [SVM_EXIT_CR0_SEL_WRITE] = emulate_on_interception, */ - [SVM_EXIT_CPUID] = cpuid_interception, - [SVM_EXIT_HLT] = halt_interception, -@@ -1323,15 +1308,11 @@ static void pre_svm_run(struct kvm_vcpu - } - - --static inline void kvm_try_inject_irq(struct kvm_vcpu *vcpu) -+static inline void kvm_do_inject_irq(struct kvm_vcpu *vcpu) - { - struct vmcb_control_area *control; - -- if (!vcpu->irq_summary) -- return; -- - control = &vcpu->svm->vmcb->control; -- - control->int_vector = pop_irq(vcpu); - control->int_ctl &= ~V_INTR_PRIO_MASK; - control->int_ctl |= V_IRQ_MASK | -@@ -1346,6 +1327,59 @@ static void kvm_reput_irq(struct kvm_vcp - control->int_ctl &= ~V_IRQ_MASK; - push_irq(vcpu, control->int_vector); - } -+ -+ vcpu->interrupt_window_open = -+ !(control->int_state & SVM_INTERRUPT_SHADOW_MASK); -+} -+ -+static void do_interrupt_requests(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) -+{ -+ struct vmcb_control_area *control = &vcpu->svm->vmcb->control; -+ -+ vcpu->interrupt_window_open = -+ (!(control->int_state & SVM_INTERRUPT_SHADOW_MASK) && -+ (vcpu->svm->vmcb->save.rflags & X86_EFLAGS_IF)); -+ -+ if (vcpu->interrupt_window_open && vcpu->irq_summary) -+ /* -+ * If interrupts enabled, and not blocked by sti or mov ss. Good. -+ */ -+ kvm_do_inject_irq(vcpu); -+ -+ /* -+ * Interrupts blocked. Wait for unblock. -+ */ -+ if (!vcpu->interrupt_window_open && -+ (vcpu->irq_summary || kvm_run->request_interrupt_window)) { -+ control->intercept |= 1ULL << INTERCEPT_VINTR; -+ } else -+ control->intercept &= ~(1ULL << INTERCEPT_VINTR); -+} -+ -+static void post_kvm_run_save(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) -+{ -+ kvm_run->ready_for_interrupt_injection = (vcpu->interrupt_window_open && -+ vcpu->irq_summary == 0); -+ kvm_run->if_flag = (vcpu->svm->vmcb->save.rflags & X86_EFLAGS_IF) != 0; -+ kvm_run->cr8 = vcpu->cr8; -+ kvm_run->apic_base = vcpu->apic_base; -+} -+ -+/* -+ * Check if userspace requested an interrupt window, and that the -+ * interrupt window is open. -+ * -+ * No need to exit to userspace if we already have an interrupt queued. -+ */ -+static int dm_request_for_irq_injection(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) -+{ -+ return (!vcpu->irq_summary && -+ kvm_run->request_interrupt_window && -+ vcpu->interrupt_window_open && -+ (vcpu->svm->vmcb->save.rflags & X86_EFLAGS_IF)); - } - - static void save_db_regs(unsigned long *db_regs) -@@ -1369,9 +1403,10 @@ static int svm_vcpu_run(struct kvm_vcpu - u16 fs_selector; - u16 gs_selector; - u16 ldt_selector; -+ int r; - - again: -- kvm_try_inject_irq(vcpu); -+ do_interrupt_requests(vcpu, kvm_run); - - clgi(); - -@@ -1532,18 +1567,28 @@ again: - if (vcpu->svm->vmcb->control.exit_code == SVM_EXIT_ERR) { - kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY; - kvm_run->exit_reason = vcpu->svm->vmcb->control.exit_code; -+ post_kvm_run_save(vcpu, kvm_run); - return 0; - } - -- if (handle_exit(vcpu, kvm_run)) { -+ r = handle_exit(vcpu, kvm_run); -+ if (r > 0) { - if (signal_pending(current)) { - ++kvm_stat.signal_exits; -+ post_kvm_run_save(vcpu, kvm_run); -+ return -EINTR; -+ } -+ -+ if (dm_request_for_irq_injection(vcpu, kvm_run)) { -+ ++kvm_stat.request_irq_exits; -+ post_kvm_run_save(vcpu, kvm_run); - return -EINTR; - } - kvm_resched(vcpu); - goto again; - } -- return 0; -+ post_kvm_run_save(vcpu, kvm_run); -+ return r; - } - - static void svm_flush_tlb(struct kvm_vcpu *vcpu) -@@ -1609,8 +1654,8 @@ static struct kvm_arch_ops svm_arch_ops - .get_segment_base = svm_get_segment_base, - .get_segment = svm_get_segment, - .set_segment = svm_set_segment, -- .is_long_mode = svm_is_long_mode, - .get_cs_db_l_bits = svm_get_cs_db_l_bits, -+ .decache_cr0_cr4_guest_bits = svm_decache_cr0_cr4_guest_bits, - .set_cr0 = svm_set_cr0, - .set_cr0_no_modeswitch = svm_set_cr0, - .set_cr3 = svm_set_cr3, -diff -Nurp linux-2.6.19-gentoo-r4/drivers/kvm/vmx.c linux-2.6.20-rc4/drivers/kvm/vmx.c ---- linux-2.6.19-gentoo-r4/drivers/kvm/vmx.c 2007-01-09 23:44:33.000000000 +0100 -+++ linux-2.6.20-rc4/drivers/kvm/vmx.c 2007-01-09 23:53:07.000000000 +0100 -@@ -26,7 +26,6 @@ - - #include "segment_descriptor.h" - --#define MSR_IA32_FEATURE_CONTROL 0x03a - - MODULE_AUTHOR("Qumranet"); - MODULE_LICENSE("GPL"); -@@ -117,7 +116,7 @@ static void vmcs_clear(struct vmcs *vmcs - static void __vcpu_clear(void *arg) - { - struct kvm_vcpu *vcpu = arg; -- int cpu = smp_processor_id(); -+ int cpu = raw_smp_processor_id(); - - if (vcpu->cpu == cpu) - vmcs_clear(vcpu->vmcs); -@@ -153,15 +152,21 @@ static u64 vmcs_read64(unsigned long fie - #endif - } - -+static noinline void vmwrite_error(unsigned long field, unsigned long value) -+{ -+ printk(KERN_ERR "vmwrite error: reg %lx value %lx (err %d)\n", -+ field, value, vmcs_read32(VM_INSTRUCTION_ERROR)); -+ dump_stack(); -+} -+ - static void vmcs_writel(unsigned long field, unsigned long value) - { - u8 error; - - asm volatile (ASM_VMX_VMWRITE_RAX_RDX "; setna %0" - : "=q"(error) : "a"(value), "d"(field) : "cc" ); -- if (error) -- printk(KERN_ERR "vmwrite error: reg %lx value %lx (err %d)\n", -- field, value, vmcs_read32(VM_INSTRUCTION_ERROR)); -+ if (unlikely(error)) -+ vmwrite_error(field, value); - } - - static void vmcs_write16(unsigned long field, u16 value) -@@ -264,6 +269,7 @@ static void skip_emulated_instruction(st - if (interruptibility & 3) - vmcs_write32(GUEST_INTERRUPTIBILITY_INFO, - interruptibility & ~3); -+ vcpu->interrupt_window_open = 1; - } - - static void vmx_inject_gp(struct kvm_vcpu *vcpu, unsigned error_code) -@@ -344,8 +350,7 @@ static int vmx_get_msr(struct kvm_vcpu * - data = vmcs_readl(GUEST_GS_BASE); - break; - case MSR_EFER: -- data = vcpu->shadow_efer; -- break; -+ return kvm_get_msr_common(vcpu, msr_index, pdata); - #endif - case MSR_IA32_TIME_STAMP_COUNTER: - data = guest_read_tsc(); -@@ -359,33 +364,13 @@ static int vmx_get_msr(struct kvm_vcpu * - case MSR_IA32_SYSENTER_ESP: - data = vmcs_read32(GUEST_SYSENTER_ESP); - break; -- case MSR_IA32_P5_MC_ADDR: -- case MSR_IA32_P5_MC_TYPE: -- case MSR_IA32_MC0_CTL: -- case MSR_IA32_MCG_STATUS: -- case MSR_IA32_MCG_CAP: -- case MSR_IA32_MC0_MISC: -- case MSR_IA32_MC0_MISC+4: -- case MSR_IA32_MC0_MISC+8: -- case MSR_IA32_MC0_MISC+12: -- case MSR_IA32_MC0_MISC+16: -- case MSR_IA32_UCODE_REV: -- /* MTRR registers */ -- case 0xfe: -- case 0x200 ... 0x2ff: -- data = 0; -- break; -- case MSR_IA32_APICBASE: -- data = vcpu->apic_base; -- break; - default: - msr = find_msr_entry(vcpu, msr_index); -- if (!msr) { -- printk(KERN_ERR "kvm: unhandled rdmsr: %x\n", msr_index); -- return 1; -+ if (msr) { -+ data = msr->data; -+ break; - } -- data = msr->data; -- break; -+ return kvm_get_msr_common(vcpu, msr_index, pdata); - } - - *pdata = data; -@@ -402,6 +387,8 @@ static int vmx_set_msr(struct kvm_vcpu * - struct vmx_msr_entry *msr; - switch (msr_index) { - #ifdef CONFIG_X86_64 -+ case MSR_EFER: -+ return kvm_set_msr_common(vcpu, msr_index, data); - case MSR_FS_BASE: - vmcs_writel(GUEST_FS_BASE, data); - break; -@@ -418,32 +405,17 @@ static int vmx_set_msr(struct kvm_vcpu * - case MSR_IA32_SYSENTER_ESP: - vmcs_write32(GUEST_SYSENTER_ESP, data); - break; --#ifdef __x86_64 -- case MSR_EFER: -- set_efer(vcpu, data); -- break; -- case MSR_IA32_MC0_STATUS: -- printk(KERN_WARNING "%s: MSR_IA32_MC0_STATUS 0x%llx, nop\n" -- , __FUNCTION__, data); -- break; --#endif - case MSR_IA32_TIME_STAMP_COUNTER: { - guest_write_tsc(data); - break; - } -- case MSR_IA32_UCODE_REV: -- case MSR_IA32_UCODE_WRITE: -- case 0x200 ... 0x2ff: /* MTRRs */ -- break; -- case MSR_IA32_APICBASE: -- vcpu->apic_base = data; -- break; - default: - msr = find_msr_entry(vcpu, msr_index); -- if (!msr) { -- printk(KERN_ERR "kvm: unhandled wrmsr: 0x%x\n", msr_index); -- return 1; -+ if (msr) { -+ msr->data = data; -+ break; - } -+ return kvm_set_msr_common(vcpu, msr_index, data); - msr->data = data; - break; - } -@@ -553,11 +525,11 @@ static __init void setup_vmcs_descriptor - { - u32 vmx_msr_low, vmx_msr_high; - -- rdmsr(MSR_IA32_VMX_BASIC_MSR, vmx_msr_low, vmx_msr_high); -+ rdmsr(MSR_IA32_VMX_BASIC, vmx_msr_low, vmx_msr_high); - vmcs_descriptor.size = vmx_msr_high & 0x1fff; - vmcs_descriptor.order = get_order(vmcs_descriptor.size); - vmcs_descriptor.revision_id = vmx_msr_low; --}; -+} - - static struct vmcs *alloc_vmcs_cpu(int cpu) - { -@@ -576,7 +548,7 @@ static struct vmcs *alloc_vmcs_cpu(int c - - static struct vmcs *alloc_vmcs(void) - { -- return alloc_vmcs_cpu(smp_processor_id()); -+ return alloc_vmcs_cpu(raw_smp_processor_id()); - } - - static void free_vmcs(struct vmcs *vmcs) -@@ -771,6 +743,15 @@ static void exit_lmode(struct kvm_vcpu * - - #endif - -+static void vmx_decache_cr0_cr4_guest_bits(struct kvm_vcpu *vcpu) -+{ -+ vcpu->cr0 &= KVM_GUEST_CR0_MASK; -+ vcpu->cr0 |= vmcs_readl(GUEST_CR0) & ~KVM_GUEST_CR0_MASK; -+ -+ vcpu->cr4 &= KVM_GUEST_CR4_MASK; -+ vcpu->cr4 |= vmcs_readl(GUEST_CR4) & ~KVM_GUEST_CR4_MASK; -+} -+ - static void vmx_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) - { - if (vcpu->rmode.active && (cr0 & CR0_PE_MASK)) -@@ -900,11 +881,6 @@ static void vmx_set_segment(struct kvm_v - vmcs_write32(sf->ar_bytes, ar); - } - --static int vmx_is_long_mode(struct kvm_vcpu *vcpu) --{ -- return vmcs_read32(VM_ENTRY_CONTROLS) & VM_ENTRY_CONTROLS_IA32E_MASK; --} -- - static void vmx_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l) - { - u32 ar = vmcs_read32(GUEST_CS_AR_BYTES); -@@ -1051,8 +1027,6 @@ static int vmx_vcpu_setup(struct kvm_vcp - vmcs_writel(GUEST_RIP, 0xfff0); - vmcs_writel(GUEST_RSP, 0); - -- vmcs_writel(GUEST_CR3, 0); -- - //todo: dr0 = dr1 = dr2 = dr3 = 0; dr6 = 0xffff0ff0 - vmcs_writel(GUEST_DR7, 0x400); - -@@ -1078,18 +1052,17 @@ static int vmx_vcpu_setup(struct kvm_vcp - vmcs_write64(GUEST_IA32_DEBUGCTL, 0); - - /* Control */ -- vmcs_write32_fixedbits(MSR_IA32_VMX_PINBASED_CTLS_MSR, -+ vmcs_write32_fixedbits(MSR_IA32_VMX_PINBASED_CTLS, - PIN_BASED_VM_EXEC_CONTROL, - PIN_BASED_EXT_INTR_MASK /* 20.6.1 */ - | PIN_BASED_NMI_EXITING /* 20.6.1 */ - ); -- vmcs_write32_fixedbits(MSR_IA32_VMX_PROCBASED_CTLS_MSR, -+ vmcs_write32_fixedbits(MSR_IA32_VMX_PROCBASED_CTLS, - CPU_BASED_VM_EXEC_CONTROL, - CPU_BASED_HLT_EXITING /* 20.6.2 */ - | CPU_BASED_CR8_LOAD_EXITING /* 20.6.2 */ - | CPU_BASED_CR8_STORE_EXITING /* 20.6.2 */ - | CPU_BASED_UNCOND_IO_EXITING /* 20.6.2 */ -- | CPU_BASED_INVDPG_EXITING - | CPU_BASED_MOV_DR_EXITING - | CPU_BASED_USE_TSC_OFFSETING /* 21.3 */ - ); -@@ -1134,14 +1107,6 @@ static int vmx_vcpu_setup(struct kvm_vcp - rdmsrl(MSR_IA32_SYSENTER_EIP, a); - vmcs_writel(HOST_IA32_SYSENTER_EIP, a); /* 22.2.3 */ - -- ret = -ENOMEM; -- vcpu->guest_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); -- if (!vcpu->guest_msrs) -- goto out; -- vcpu->host_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); -- if (!vcpu->host_msrs) -- goto out_free_guest_msrs; -- - for (i = 0; i < NR_VMX_MSR; ++i) { - u32 index = vmx_msr_index[i]; - u32 data_low, data_high; -@@ -1166,7 +1131,7 @@ static int vmx_vcpu_setup(struct kvm_vcp - virt_to_phys(vcpu->guest_msrs + NR_BAD_MSRS)); - vmcs_writel(VM_EXIT_MSR_LOAD_ADDR, - virt_to_phys(vcpu->host_msrs + NR_BAD_MSRS)); -- vmcs_write32_fixedbits(MSR_IA32_VMX_EXIT_CTLS_MSR, VM_EXIT_CONTROLS, -+ vmcs_write32_fixedbits(MSR_IA32_VMX_EXIT_CTLS, VM_EXIT_CONTROLS, - (HOST_IS_64 << 9)); /* 22.2,1, 20.7.1 */ - vmcs_write32(VM_EXIT_MSR_STORE_COUNT, nr_good_msrs); /* 22.2.2 */ - vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, nr_good_msrs); /* 22.2.2 */ -@@ -1174,7 +1139,7 @@ static int vmx_vcpu_setup(struct kvm_vcp - - - /* 22.2.1, 20.8.1 */ -- vmcs_write32_fixedbits(MSR_IA32_VMX_ENTRY_CTLS_MSR, -+ vmcs_write32_fixedbits(MSR_IA32_VMX_ENTRY_CTLS, - VM_ENTRY_CONTROLS, 0); - vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0); /* 22.2.1 */ - -@@ -1195,8 +1160,6 @@ static int vmx_vcpu_setup(struct kvm_vcp - - return 0; - --out_free_guest_msrs: -- kfree(vcpu->guest_msrs); - out: - return ret; - } -@@ -1264,21 +1227,34 @@ static void kvm_do_inject_irq(struct kvm - irq | INTR_TYPE_EXT_INTR | INTR_INFO_VALID_MASK); - } - --static void kvm_try_inject_irq(struct kvm_vcpu *vcpu) -+ -+static void do_interrupt_requests(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) - { -- if ((vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) -- && (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & 3) == 0) -+ u32 cpu_based_vm_exec_control; -+ -+ vcpu->interrupt_window_open = -+ ((vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) && -+ (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & 3) == 0); -+ -+ if (vcpu->interrupt_window_open && -+ vcpu->irq_summary && -+ !(vmcs_read32(VM_ENTRY_INTR_INFO_FIELD) & INTR_INFO_VALID_MASK)) - /* -- * Interrupts enabled, and not blocked by sti or mov ss. Good. -+ * If interrupts enabled, and not blocked by sti or mov ss. Good. - */ - kvm_do_inject_irq(vcpu); -- else -+ -+ cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); -+ if (!vcpu->interrupt_window_open && -+ (vcpu->irq_summary || kvm_run->request_interrupt_window)) - /* - * Interrupts blocked. Wait for unblock. - */ -- vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, -- vmcs_read32(CPU_BASED_VM_EXEC_CONTROL) -- | CPU_BASED_VIRTUAL_INTR_PENDING); -+ cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_INTR_PENDING; -+ else -+ cpu_based_vm_exec_control &= ~CPU_BASED_VIRTUAL_INTR_PENDING; -+ vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control); - } - - static void kvm_guest_debug_pre(struct kvm_vcpu *vcpu) -@@ -1317,6 +1293,7 @@ static int handle_exception(struct kvm_v - unsigned long cr2, rip; - u32 vect_info; - enum emulation_result er; -+ int r; - - vect_info = vmcs_read32(IDT_VECTORING_INFO_FIELD); - intr_info = vmcs_read32(VM_EXIT_INTR_INFO); -@@ -1345,7 +1322,12 @@ static int handle_exception(struct kvm_v - cr2 = vmcs_readl(EXIT_QUALIFICATION); - - spin_lock(&vcpu->kvm->lock); -- if (!vcpu->mmu.page_fault(vcpu, cr2, error_code)) { -+ r = kvm_mmu_page_fault(vcpu, cr2, error_code); -+ if (r < 0) { -+ spin_unlock(&vcpu->kvm->lock); -+ return r; -+ } -+ if (!r) { - spin_unlock(&vcpu->kvm->lock); - return 1; - } -@@ -1465,17 +1447,6 @@ static int handle_io(struct kvm_vcpu *vc - return 0; - } - --static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) --{ -- u64 address = vmcs_read64(EXIT_QUALIFICATION); -- int instruction_length = vmcs_read32(VM_EXIT_INSTRUCTION_LEN); -- spin_lock(&vcpu->kvm->lock); -- vcpu->mmu.inval_page(vcpu, address); -- spin_unlock(&vcpu->kvm->lock); -- vmcs_writel(GUEST_RIP, vmcs_readl(GUEST_RIP) + instruction_length); -- return 1; --} -- - static int handle_cr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) - { - u64 exit_qualification; -@@ -1615,23 +1586,40 @@ static int handle_wrmsr(struct kvm_vcpu - return 1; - } - -+static void post_kvm_run_save(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) -+{ -+ kvm_run->if_flag = (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) != 0; -+ kvm_run->cr8 = vcpu->cr8; -+ kvm_run->apic_base = vcpu->apic_base; -+ kvm_run->ready_for_interrupt_injection = (vcpu->interrupt_window_open && -+ vcpu->irq_summary == 0); -+} -+ - static int handle_interrupt_window(struct kvm_vcpu *vcpu, - struct kvm_run *kvm_run) - { -- /* Turn off interrupt window reporting. */ -- vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, -- vmcs_read32(CPU_BASED_VM_EXEC_CONTROL) -- & ~CPU_BASED_VIRTUAL_INTR_PENDING); -+ /* -+ * If the user space waits to inject interrupts, exit as soon as -+ * possible -+ */ -+ if (kvm_run->request_interrupt_window && -+ !vcpu->irq_summary) { -+ kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; -+ ++kvm_stat.irq_window_exits; -+ return 0; -+ } - return 1; - } - - static int handle_halt(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) - { - skip_emulated_instruction(vcpu); -- if (vcpu->irq_summary && (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF)) -+ if (vcpu->irq_summary) - return 1; - - kvm_run->exit_reason = KVM_EXIT_HLT; -+ ++kvm_stat.halt_exits; - return 0; - } - -@@ -1645,7 +1633,6 @@ static int (*kvm_vmx_exit_handlers[])(st - [EXIT_REASON_EXCEPTION_NMI] = handle_exception, - [EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt, - [EXIT_REASON_IO_INSTRUCTION] = handle_io, -- [EXIT_REASON_INVLPG] = handle_invlpg, - [EXIT_REASON_CR_ACCESS] = handle_cr, - [EXIT_REASON_DR_ACCESS] = handle_dr, - [EXIT_REASON_CPUID] = handle_cpuid, -@@ -1682,11 +1669,27 @@ static int kvm_handle_exit(struct kvm_ru - return 0; - } - -+/* -+ * Check if userspace requested an interrupt window, and that the -+ * interrupt window is open. -+ * -+ * No need to exit to userspace if we already have an interrupt queued. -+ */ -+static int dm_request_for_irq_injection(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) -+{ -+ return (!vcpu->irq_summary && -+ kvm_run->request_interrupt_window && -+ vcpu->interrupt_window_open && -+ (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF)); -+} -+ - static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) - { - u8 fail; - u16 fs_sel, gs_sel, ldt_sel; - int fs_gs_ldt_reload_needed; -+ int r; - - again: - /* -@@ -1713,9 +1716,7 @@ again: - vmcs_writel(HOST_GS_BASE, segment_base(gs_sel)); - #endif - -- if (vcpu->irq_summary && -- !(vmcs_read32(VM_ENTRY_INTR_INFO_FIELD) & INTR_INFO_VALID_MASK)) -- kvm_try_inject_irq(vcpu); -+ do_interrupt_requests(vcpu, kvm_run); - - if (vcpu->guest_debug.enabled) - kvm_guest_debug_pre(vcpu); -@@ -1852,6 +1853,7 @@ again: - - fx_save(vcpu->guest_fx_image); - fx_restore(vcpu->host_fx_image); -+ vcpu->interrupt_window_open = (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & 3) == 0; - - #ifndef CONFIG_X86_64 - asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); -@@ -1861,6 +1863,7 @@ again: - if (fail) { - kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY; - kvm_run->exit_reason = vmcs_read32(VM_INSTRUCTION_ERROR); -+ r = 0; - } else { - if (fs_gs_ldt_reload_needed) { - load_ldt(ldt_sel); -@@ -1880,17 +1883,28 @@ again: - } - vcpu->launched = 1; - kvm_run->exit_type = KVM_EXIT_TYPE_VM_EXIT; -- if (kvm_handle_exit(kvm_run, vcpu)) { -+ r = kvm_handle_exit(kvm_run, vcpu); -+ if (r > 0) { - /* Give scheduler a change to reschedule. */ - if (signal_pending(current)) { - ++kvm_stat.signal_exits; -+ post_kvm_run_save(vcpu, kvm_run); - return -EINTR; - } -+ -+ if (dm_request_for_irq_injection(vcpu, kvm_run)) { -+ ++kvm_stat.request_irq_exits; -+ post_kvm_run_save(vcpu, kvm_run); -+ return -EINTR; -+ } -+ - kvm_resched(vcpu); - goto again; - } - } -- return 0; -+ -+ post_kvm_run_save(vcpu, kvm_run); -+ return r; - } - - static void vmx_flush_tlb(struct kvm_vcpu *vcpu) -@@ -1946,13 +1960,33 @@ static int vmx_create_vcpu(struct kvm_vc - { - struct vmcs *vmcs; - -+ vcpu->guest_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); -+ if (!vcpu->guest_msrs) -+ return -ENOMEM; -+ -+ vcpu->host_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); -+ if (!vcpu->host_msrs) -+ goto out_free_guest_msrs; -+ - vmcs = alloc_vmcs(); - if (!vmcs) -- return -ENOMEM; -+ goto out_free_msrs; -+ - vmcs_clear(vmcs); - vcpu->vmcs = vmcs; - vcpu->launched = 0; -+ - return 0; -+ -+out_free_msrs: -+ kfree(vcpu->host_msrs); -+ vcpu->host_msrs = NULL; -+ -+out_free_guest_msrs: -+ kfree(vcpu->guest_msrs); -+ vcpu->guest_msrs = NULL; -+ -+ return -ENOMEM; - } - - static struct kvm_arch_ops vmx_arch_ops = { -@@ -1975,8 +2009,8 @@ static struct kvm_arch_ops vmx_arch_ops - .get_segment_base = vmx_get_segment_base, - .get_segment = vmx_get_segment, - .set_segment = vmx_set_segment, -- .is_long_mode = vmx_is_long_mode, - .get_cs_db_l_bits = vmx_get_cs_db_l_bits, -+ .decache_cr0_cr4_guest_bits = vmx_decache_cr0_cr4_guest_bits, - .set_cr0 = vmx_set_cr0, - .set_cr0_no_modeswitch = vmx_set_cr0_no_modeswitch, - .set_cr3 = vmx_set_cr3, -diff -Nurp linux-2.6.19-gentoo-r4/drivers/kvm/vmx.h linux-2.6.20-rc4/drivers/kvm/vmx.h ---- linux-2.6.19-gentoo-r4/drivers/kvm/vmx.h 2007-01-09 23:44:33.000000000 +0100 -+++ linux-2.6.20-rc4/drivers/kvm/vmx.h 2007-01-09 23:53:07.000000000 +0100 -@@ -286,11 +286,11 @@ enum vmcs_field { - - #define CR4_VMXE 0x2000 - --#define MSR_IA32_VMX_BASIC_MSR 0x480 -+#define MSR_IA32_VMX_BASIC 0x480 - #define MSR_IA32_FEATURE_CONTROL 0x03a --#define MSR_IA32_VMX_PINBASED_CTLS_MSR 0x481 --#define MSR_IA32_VMX_PROCBASED_CTLS_MSR 0x482 --#define MSR_IA32_VMX_EXIT_CTLS_MSR 0x483 --#define MSR_IA32_VMX_ENTRY_CTLS_MSR 0x484 -+#define MSR_IA32_VMX_PINBASED_CTLS 0x481 -+#define MSR_IA32_VMX_PROCBASED_CTLS 0x482 -+#define MSR_IA32_VMX_EXIT_CTLS 0x483 -+#define MSR_IA32_VMX_ENTRY_CTLS 0x484 - - #endif -diff -Nurp linux-2.6.19-gentoo-r4/drivers/kvm/x86_emulate.c linux-2.6.20-rc4/drivers/kvm/x86_emulate.c ---- linux-2.6.19-gentoo-r4/drivers/kvm/x86_emulate.c 2007-01-09 23:44:33.000000000 +0100 -+++ linux-2.6.20-rc4/drivers/kvm/x86_emulate.c 2007-01-09 23:53:07.000000000 +0100 -@@ -1323,7 +1323,7 @@ twobyte_special_insn: - ctxt)) != 0)) - goto done; - if ((old_lo != _regs[VCPU_REGS_RAX]) -- || (old_hi != _regs[VCPU_REGS_RDI])) { -+ || (old_hi != _regs[VCPU_REGS_RDX])) { - _regs[VCPU_REGS_RAX] = old_lo; - _regs[VCPU_REGS_RDX] = old_hi; - _eflags &= ~EFLG_ZF; ---- linux-2.6.19-gentoo-r5/include/linux/kvm.h 2007-01-10 00:07:21.000000000 +0100 -+++ linux-2.6.20-rc4/include/linux/kvm.h 2007-01-09 23:53:07.000000000 +0100 -@@ -11,7 +11,7 @@ - #include - #include - --#define KVM_API_VERSION 1 -+#define KVM_API_VERSION 2 - - /* - * Architectural interrupt line count, and the size of the bitmap needed -@@ -45,6 +45,7 @@ enum kvm_exit_reason { - KVM_EXIT_DEBUG = 4, - KVM_EXIT_HLT = 5, - KVM_EXIT_MMIO = 6, -+ KVM_EXIT_IRQ_WINDOW_OPEN = 7, - }; - - /* for KVM_RUN */ -@@ -53,11 +54,19 @@ struct kvm_run { - __u32 vcpu; - __u32 emulated; /* skip current instruction */ - __u32 mmio_completed; /* mmio request completed */ -+ __u8 request_interrupt_window; -+ __u8 padding1[3]; - - /* out */ - __u32 exit_type; - __u32 exit_reason; - __u32 instruction_length; -+ __u8 ready_for_interrupt_injection; -+ __u8 if_flag; -+ __u16 padding2; -+ __u64 cr8; -+ __u64 apic_base; -+ - union { - /* KVM_EXIT_UNKNOWN */ - struct { diff --git a/sys-kernel/gentoo-sources/files/2.6.19-kvm-experimental-support.patch b/sys-kernel/gentoo-sources/files/2.6.19-kvm-experimental-support.patch deleted file mode 100644 index 3c2b77421..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.19-kvm-experimental-support.patch +++ /dev/null @@ -1,11406 +0,0 @@ -From: Avi Kivity -Date: Sun, 10 Dec 2006 10:21:36 +0000 (-0800) -Subject: [PATCH] kvm: userspace interface -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=6aa8b732ca01c3d7a54e93f4d701b8aabbe60fb7 - -[PATCH] kvm: userspace interface - -web site: http://kvm.sourceforge.net - -mailing list: kvm-devel@lists.sourceforge.net - (http://lists.sourceforge.net/lists/listinfo/kvm-devel) - -The following patchset adds a driver for Intel's hardware virtualization -extensions to the x86 architecture. The driver adds a character device -(/dev/kvm) that exposes the virtualization capabilities to userspace. Using -this driver, a process can run a virtual machine (a "guest") in a fully -virtualized PC containing its own virtual hard disks, network adapters, and -display. - -Using this driver, one can start multiple virtual machines on a host. - -Each virtual machine is a process on the host; a virtual cpu is a thread in -that process. kill(1), nice(1), top(1) work as expected. In effect, the -driver adds a third execution mode to the existing two: we now have kernel -mode, user mode, and guest mode. Guest mode has its own address space mapping -guest physical memory (which is accessible to user mode by mmap()ing -/dev/kvm). Guest mode has no access to any I/O devices; any such access is -intercepted and directed to user mode for emulation. - -The driver supports i386 and x86_64 hosts and guests. All combinations are -allowed except x86_64 guest on i386 host. For i386 guests and hosts, both pae -and non-pae paging modes are supported. - -SMP hosts and UP guests are supported. At the moment only Intel -hardware is supported, but AMD virtualization support is being worked on. - -Performance currently is non-stellar due to the naive implementation of the -mmu virtualization, which throws away most of the shadow page table entries -every context switch. We plan to address this in two ways: - -- cache shadow page tables across tlb flushes -- wait until AMD and Intel release processors with nested page tables - -Currently a virtual desktop is responsive but consumes a lot of CPU. Under -Windows I tried playing pinball and watching a few flash movies; with a recent -CPU one can hardly feel the virtualization. Linux/X is slower, probably due -to X being in a separate process. - -In addition to the driver, you need a slightly modified qemu to provide I/O -device emulation and the BIOS. - -Caveats (akpm: might no longer be true): - -- The Windows install currently bluescreens due to a problem with the - virtual APIC. We are working on a fix. A temporary workaround is to - use an existing image or install through qemu -- Windows 64-bit does not work. That's also true for qemu, so it's - probably a problem with the device model. - -[bero@arklinux.org: build fix] -[simon.kagstrom@bth.se: build fix, other fixes] -[uril@qumranet.com: KVM: Expose interrupt bitmap] -[akpm@osdl.org: i386 build fix] -[mingo@elte.hu: i386 fixes] -[rdreier@cisco.com: add log levels to all printks] -[randy.dunlap@oracle.com: Fix sparse NULL and C99 struct init warnings] -[anthony@codemonkey.ws: KVM: AMD SVM: 32-bit host support] -Signed-off-by: Yaniv Kamay -Signed-off-by: Avi Kivity -Cc: Simon Kagstrom -Cc: Bernhard Rosenkraenzer -Signed-off-by: Uri Lublin -Cc: Ingo Molnar -Cc: Roland Dreier -Signed-off-by: Randy Dunlap -Signed-off-by: Anthony Liguori -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/Kconfig -+++ b/drivers/Kconfig -@@ -80,4 +80,6 @@ source "drivers/rtc/Kconfig" - - source "drivers/dma/Kconfig" - -+source "drivers/kvm/Kconfig" -+ - endmenu ---- a/drivers/Makefile -+++ b/drivers/Makefile -@@ -43,6 +43,7 @@ obj-$(CONFIG_SPI) += spi/ - obj-$(CONFIG_PCCARD) += pcmcia/ - obj-$(CONFIG_DIO) += dio/ - obj-$(CONFIG_SBUS) += sbus/ -+obj-$(CONFIG_KVM) += kvm/ - obj-$(CONFIG_ZORRO) += zorro/ - obj-$(CONFIG_MAC) += macintosh/ - obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/ ---- /dev/null -+++ b/drivers/kvm/Kconfig -@@ -0,0 +1,33 @@ -+# -+# KVM configuration -+# -+config KVM -+ tristate "Kernel-based Virtual Machine (KVM) support" -+ depends on X86 && EXPERIMENTAL -+ ---help--- -+ Support hosting fully virtualized guest machines using hardware -+ virtualization extensions. You will need a fairly recent -+ processor equipped with virtualization extensions. You will also -+ need to select one or more of the processor modules below. -+ -+ This module provides access to the hardware capabilities through -+ a character device node named /dev/kvm. -+ -+ To compile this as a module, choose M here: the module -+ will be called kvm. -+ -+ If unsure, say N. -+ -+config KVM_INTEL -+ tristate "KVM for Intel processors support" -+ depends on KVM -+ ---help--- -+ Provides support for KVM on Intel processors equipped with the VT -+ extensions. -+ -+config KVM_AMD -+ tristate "KVM for AMD processors support" -+ depends on KVM -+ ---help--- -+ Provides support for KVM on AMD processors equipped with the AMD-V -+ (SVM) extensions. ---- /dev/null -+++ b/drivers/kvm/Makefile -@@ -0,0 +1,10 @@ -+# -+# Makefile for Kernel-based Virtual Machine module -+# -+ -+kvm-objs := kvm_main.o mmu.o x86_emulate.o -+obj-$(CONFIG_KVM) += kvm.o -+kvm-intel-objs = vmx.o -+obj-$(CONFIG_KVM_INTEL) += kvm-intel.o -+kvm-amd-objs = svm.o -+obj-$(CONFIG_KVM_AMD) += kvm-amd.o ---- /dev/null -+++ b/drivers/kvm/kvm.h -@@ -0,0 +1,551 @@ -+#ifndef __KVM_H -+#define __KVM_H -+ -+/* -+ * This work is licensed under the terms of the GNU GPL, version 2. See -+ * the COPYING file in the top-level directory. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "vmx.h" -+#include -+ -+#define CR0_PE_MASK (1ULL << 0) -+#define CR0_TS_MASK (1ULL << 3) -+#define CR0_NE_MASK (1ULL << 5) -+#define CR0_WP_MASK (1ULL << 16) -+#define CR0_NW_MASK (1ULL << 29) -+#define CR0_CD_MASK (1ULL << 30) -+#define CR0_PG_MASK (1ULL << 31) -+ -+#define CR3_WPT_MASK (1ULL << 3) -+#define CR3_PCD_MASK (1ULL << 4) -+ -+#define CR3_RESEVED_BITS 0x07ULL -+#define CR3_L_MODE_RESEVED_BITS (~((1ULL << 40) - 1) | 0x0fe7ULL) -+#define CR3_FLAGS_MASK ((1ULL << 5) - 1) -+ -+#define CR4_VME_MASK (1ULL << 0) -+#define CR4_PSE_MASK (1ULL << 4) -+#define CR4_PAE_MASK (1ULL << 5) -+#define CR4_PGE_MASK (1ULL << 7) -+#define CR4_VMXE_MASK (1ULL << 13) -+ -+#define KVM_GUEST_CR0_MASK \ -+ (CR0_PG_MASK | CR0_PE_MASK | CR0_WP_MASK | CR0_NE_MASK \ -+ | CR0_NW_MASK | CR0_CD_MASK) -+#define KVM_VM_CR0_ALWAYS_ON \ -+ (CR0_PG_MASK | CR0_PE_MASK | CR0_WP_MASK | CR0_NE_MASK) -+#define KVM_GUEST_CR4_MASK \ -+ (CR4_PSE_MASK | CR4_PAE_MASK | CR4_PGE_MASK | CR4_VMXE_MASK | CR4_VME_MASK) -+#define KVM_PMODE_VM_CR4_ALWAYS_ON (CR4_VMXE_MASK | CR4_PAE_MASK) -+#define KVM_RMODE_VM_CR4_ALWAYS_ON (CR4_VMXE_MASK | CR4_PAE_MASK | CR4_VME_MASK) -+ -+#define INVALID_PAGE (~(hpa_t)0) -+#define UNMAPPED_GVA (~(gpa_t)0) -+ -+#define KVM_MAX_VCPUS 1 -+#define KVM_MEMORY_SLOTS 4 -+#define KVM_NUM_MMU_PAGES 256 -+ -+#define FX_IMAGE_SIZE 512 -+#define FX_IMAGE_ALIGN 16 -+#define FX_BUF_SIZE (2 * FX_IMAGE_SIZE + FX_IMAGE_ALIGN) -+ -+#define DE_VECTOR 0 -+#define DF_VECTOR 8 -+#define TS_VECTOR 10 -+#define NP_VECTOR 11 -+#define SS_VECTOR 12 -+#define GP_VECTOR 13 -+#define PF_VECTOR 14 -+ -+#define SELECTOR_TI_MASK (1 << 2) -+#define SELECTOR_RPL_MASK 0x03 -+ -+#define IOPL_SHIFT 12 -+ -+/* -+ * Address types: -+ * -+ * gva - guest virtual address -+ * gpa - guest physical address -+ * gfn - guest frame number -+ * hva - host virtual address -+ * hpa - host physical address -+ * hfn - host frame number -+ */ -+ -+typedef unsigned long gva_t; -+typedef u64 gpa_t; -+typedef unsigned long gfn_t; -+ -+typedef unsigned long hva_t; -+typedef u64 hpa_t; -+typedef unsigned long hfn_t; -+ -+struct kvm_mmu_page { -+ struct list_head link; -+ hpa_t page_hpa; -+ unsigned long slot_bitmap; /* One bit set per slot which has memory -+ * in this shadow page. -+ */ -+ int global; /* Set if all ptes in this page are global */ -+ u64 *parent_pte; -+}; -+ -+struct vmcs { -+ u32 revision_id; -+ u32 abort; -+ char data[0]; -+}; -+ -+#define vmx_msr_entry kvm_msr_entry -+ -+struct kvm_vcpu; -+ -+/* -+ * x86 supports 3 paging modes (4-level 64-bit, 3-level 64-bit, and 2-level -+ * 32-bit). The kvm_mmu structure abstracts the details of the current mmu -+ * mode. -+ */ -+struct kvm_mmu { -+ void (*new_cr3)(struct kvm_vcpu *vcpu); -+ int (*page_fault)(struct kvm_vcpu *vcpu, gva_t gva, u32 err); -+ void (*inval_page)(struct kvm_vcpu *vcpu, gva_t gva); -+ void (*free)(struct kvm_vcpu *vcpu); -+ gpa_t (*gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t gva); -+ hpa_t root_hpa; -+ int root_level; -+ int shadow_root_level; -+}; -+ -+struct kvm_guest_debug { -+ int enabled; -+ unsigned long bp[4]; -+ int singlestep; -+}; -+ -+enum { -+ VCPU_REGS_RAX = 0, -+ VCPU_REGS_RCX = 1, -+ VCPU_REGS_RDX = 2, -+ VCPU_REGS_RBX = 3, -+ VCPU_REGS_RSP = 4, -+ VCPU_REGS_RBP = 5, -+ VCPU_REGS_RSI = 6, -+ VCPU_REGS_RDI = 7, -+#ifdef __x86_64__ -+ VCPU_REGS_R8 = 8, -+ VCPU_REGS_R9 = 9, -+ VCPU_REGS_R10 = 10, -+ VCPU_REGS_R11 = 11, -+ VCPU_REGS_R12 = 12, -+ VCPU_REGS_R13 = 13, -+ VCPU_REGS_R14 = 14, -+ VCPU_REGS_R15 = 15, -+#endif -+ NR_VCPU_REGS -+}; -+ -+enum { -+ VCPU_SREG_CS, -+ VCPU_SREG_DS, -+ VCPU_SREG_ES, -+ VCPU_SREG_FS, -+ VCPU_SREG_GS, -+ VCPU_SREG_SS, -+ VCPU_SREG_TR, -+ VCPU_SREG_LDTR, -+}; -+ -+struct kvm_vcpu { -+ struct kvm *kvm; -+ union { -+ struct vmcs *vmcs; -+ struct vcpu_svm *svm; -+ }; -+ struct mutex mutex; -+ int cpu; -+ int launched; -+ unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */ -+#define NR_IRQ_WORDS KVM_IRQ_BITMAP_SIZE(unsigned long) -+ unsigned long irq_pending[NR_IRQ_WORDS]; -+ unsigned long regs[NR_VCPU_REGS]; /* for rsp: vcpu_load_rsp_rip() */ -+ unsigned long rip; /* needs vcpu_load_rsp_rip() */ -+ -+ unsigned long cr0; -+ unsigned long cr2; -+ unsigned long cr3; -+ unsigned long cr4; -+ unsigned long cr8; -+ u64 shadow_efer; -+ u64 apic_base; -+ int nmsrs; -+ struct vmx_msr_entry *guest_msrs; -+ struct vmx_msr_entry *host_msrs; -+ -+ struct list_head free_pages; -+ struct kvm_mmu_page page_header_buf[KVM_NUM_MMU_PAGES]; -+ struct kvm_mmu mmu; -+ -+ struct kvm_guest_debug guest_debug; -+ -+ char fx_buf[FX_BUF_SIZE]; -+ char *host_fx_image; -+ char *guest_fx_image; -+ -+ int mmio_needed; -+ int mmio_read_completed; -+ int mmio_is_write; -+ int mmio_size; -+ unsigned char mmio_data[8]; -+ gpa_t mmio_phys_addr; -+ -+ struct { -+ int active; -+ u8 save_iopl; -+ struct kvm_save_segment { -+ u16 selector; -+ unsigned long base; -+ u32 limit; -+ u32 ar; -+ } tr, es, ds, fs, gs; -+ } rmode; -+}; -+ -+struct kvm_memory_slot { -+ gfn_t base_gfn; -+ unsigned long npages; -+ unsigned long flags; -+ struct page **phys_mem; -+ unsigned long *dirty_bitmap; -+}; -+ -+struct kvm { -+ spinlock_t lock; /* protects everything except vcpus */ -+ int nmemslots; -+ struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS]; -+ struct list_head active_mmu_pages; -+ struct kvm_vcpu vcpus[KVM_MAX_VCPUS]; -+ int memory_config_version; -+ int busy; -+}; -+ -+struct kvm_stat { -+ u32 pf_fixed; -+ u32 pf_guest; -+ u32 tlb_flush; -+ u32 invlpg; -+ -+ u32 exits; -+ u32 io_exits; -+ u32 mmio_exits; -+ u32 signal_exits; -+ u32 irq_exits; -+}; -+ -+struct descriptor_table { -+ u16 limit; -+ unsigned long base; -+} __attribute__((packed)); -+ -+struct kvm_arch_ops { -+ int (*cpu_has_kvm_support)(void); /* __init */ -+ int (*disabled_by_bios)(void); /* __init */ -+ void (*hardware_enable)(void *dummy); /* __init */ -+ void (*hardware_disable)(void *dummy); -+ int (*hardware_setup)(void); /* __init */ -+ void (*hardware_unsetup)(void); /* __exit */ -+ -+ int (*vcpu_create)(struct kvm_vcpu *vcpu); -+ void (*vcpu_free)(struct kvm_vcpu *vcpu); -+ -+ struct kvm_vcpu *(*vcpu_load)(struct kvm_vcpu *vcpu); -+ void (*vcpu_put)(struct kvm_vcpu *vcpu); -+ -+ int (*set_guest_debug)(struct kvm_vcpu *vcpu, -+ struct kvm_debug_guest *dbg); -+ int (*get_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata); -+ int (*set_msr)(struct kvm_vcpu *vcpu, u32 msr_index, u64 data); -+ u64 (*get_segment_base)(struct kvm_vcpu *vcpu, int seg); -+ void (*get_segment)(struct kvm_vcpu *vcpu, -+ struct kvm_segment *var, int seg); -+ void (*set_segment)(struct kvm_vcpu *vcpu, -+ struct kvm_segment *var, int seg); -+ int (*is_long_mode)(struct kvm_vcpu *vcpu); -+ void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l); -+ void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); -+ void (*set_cr0_no_modeswitch)(struct kvm_vcpu *vcpu, -+ unsigned long cr0); -+ void (*set_cr3)(struct kvm_vcpu *vcpu, unsigned long cr3); -+ void (*set_cr4)(struct kvm_vcpu *vcpu, unsigned long cr4); -+ void (*set_efer)(struct kvm_vcpu *vcpu, u64 efer); -+ void (*get_idt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); -+ void (*set_idt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); -+ void (*get_gdt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); -+ void (*set_gdt)(struct kvm_vcpu *vcpu, struct descriptor_table *dt); -+ unsigned long (*get_dr)(struct kvm_vcpu *vcpu, int dr); -+ void (*set_dr)(struct kvm_vcpu *vcpu, int dr, unsigned long value, -+ int *exception); -+ void (*cache_regs)(struct kvm_vcpu *vcpu); -+ void (*decache_regs)(struct kvm_vcpu *vcpu); -+ unsigned long (*get_rflags)(struct kvm_vcpu *vcpu); -+ void (*set_rflags)(struct kvm_vcpu *vcpu, unsigned long rflags); -+ -+ void (*invlpg)(struct kvm_vcpu *vcpu, gva_t addr); -+ void (*tlb_flush)(struct kvm_vcpu *vcpu); -+ void (*inject_page_fault)(struct kvm_vcpu *vcpu, -+ unsigned long addr, u32 err_code); -+ -+ void (*inject_gp)(struct kvm_vcpu *vcpu, unsigned err_code); -+ -+ int (*run)(struct kvm_vcpu *vcpu, struct kvm_run *run); -+ int (*vcpu_setup)(struct kvm_vcpu *vcpu); -+ void (*skip_emulated_instruction)(struct kvm_vcpu *vcpu); -+}; -+ -+extern struct kvm_stat kvm_stat; -+extern struct kvm_arch_ops *kvm_arch_ops; -+ -+#define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) -+#define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) -+ -+int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module); -+void kvm_exit_arch(void); -+ -+void kvm_mmu_destroy(struct kvm_vcpu *vcpu); -+int kvm_mmu_init(struct kvm_vcpu *vcpu); -+ -+int kvm_mmu_reset_context(struct kvm_vcpu *vcpu); -+void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot); -+ -+hpa_t gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa); -+#define HPA_MSB ((sizeof(hpa_t) * 8) - 1) -+#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) -+static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } -+hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, gva_t gva); -+ -+void kvm_emulator_want_group7_invlpg(void); -+ -+extern hpa_t bad_page_address; -+ -+static inline struct page *gfn_to_page(struct kvm_memory_slot *slot, gfn_t gfn) -+{ -+ return slot->phys_mem[gfn - slot->base_gfn]; -+} -+ -+struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); -+void mark_page_dirty(struct kvm *kvm, gfn_t gfn); -+ -+enum emulation_result { -+ EMULATE_DONE, /* no further processing */ -+ EMULATE_DO_MMIO, /* kvm_run filled with mmio request */ -+ EMULATE_FAIL, /* can't emulate this instruction */ -+}; -+ -+int emulate_instruction(struct kvm_vcpu *vcpu, struct kvm_run *run, -+ unsigned long cr2, u16 error_code); -+void realmode_lgdt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); -+void realmode_lidt(struct kvm_vcpu *vcpu, u16 size, unsigned long address); -+void realmode_lmsw(struct kvm_vcpu *vcpu, unsigned long msw, -+ unsigned long *rflags); -+ -+unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr); -+void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long value, -+ unsigned long *rflags); -+ -+struct x86_emulate_ctxt; -+ -+int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address); -+int emulate_clts(struct kvm_vcpu *vcpu); -+int emulator_get_dr(struct x86_emulate_ctxt* ctxt, int dr, -+ unsigned long *dest); -+int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr, -+ unsigned long value); -+ -+void set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0); -+void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr0); -+void set_cr4(struct kvm_vcpu *vcpu, unsigned long cr0); -+void set_cr8(struct kvm_vcpu *vcpu, unsigned long cr0); -+void lmsw(struct kvm_vcpu *vcpu, unsigned long msw); -+ -+#ifdef __x86_64__ -+void set_efer(struct kvm_vcpu *vcpu, u64 efer); -+#endif -+ -+void fx_init(struct kvm_vcpu *vcpu); -+ -+void load_msrs(struct vmx_msr_entry *e, int n); -+void save_msrs(struct vmx_msr_entry *e, int n); -+void kvm_resched(struct kvm_vcpu *vcpu); -+ -+int kvm_read_guest(struct kvm_vcpu *vcpu, -+ gva_t addr, -+ unsigned long size, -+ void *dest); -+ -+int kvm_write_guest(struct kvm_vcpu *vcpu, -+ gva_t addr, -+ unsigned long size, -+ void *data); -+ -+unsigned long segment_base(u16 selector); -+ -+static inline struct page *_gfn_to_page(struct kvm *kvm, gfn_t gfn) -+{ -+ struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn); -+ return (slot) ? slot->phys_mem[gfn - slot->base_gfn] : NULL; -+} -+ -+static inline int is_pae(struct kvm_vcpu *vcpu) -+{ -+ return vcpu->cr4 & CR4_PAE_MASK; -+} -+ -+static inline int is_pse(struct kvm_vcpu *vcpu) -+{ -+ return vcpu->cr4 & CR4_PSE_MASK; -+} -+ -+static inline int is_paging(struct kvm_vcpu *vcpu) -+{ -+ return vcpu->cr0 & CR0_PG_MASK; -+} -+ -+static inline int memslot_id(struct kvm *kvm, struct kvm_memory_slot *slot) -+{ -+ return slot - kvm->memslots; -+} -+ -+static inline struct kvm_mmu_page *page_header(hpa_t shadow_page) -+{ -+ struct page *page = pfn_to_page(shadow_page >> PAGE_SHIFT); -+ -+ return (struct kvm_mmu_page *)page->private; -+} -+ -+static inline u16 read_fs(void) -+{ -+ u16 seg; -+ asm ("mov %%fs, %0" : "=g"(seg)); -+ return seg; -+} -+ -+static inline u16 read_gs(void) -+{ -+ u16 seg; -+ asm ("mov %%gs, %0" : "=g"(seg)); -+ return seg; -+} -+ -+static inline u16 read_ldt(void) -+{ -+ u16 ldt; -+ asm ("sldt %0" : "=g"(ldt)); -+ return ldt; -+} -+ -+static inline void load_fs(u16 sel) -+{ -+ asm ("mov %0, %%fs" : : "rm"(sel)); -+} -+ -+static inline void load_gs(u16 sel) -+{ -+ asm ("mov %0, %%gs" : : "rm"(sel)); -+} -+ -+#ifndef load_ldt -+static inline void load_ldt(u16 sel) -+{ -+ asm ("lldt %0" : : "g"(sel)); -+} -+#endif -+ -+static inline void get_idt(struct descriptor_table *table) -+{ -+ asm ("sidt %0" : "=m"(*table)); -+} -+ -+static inline void get_gdt(struct descriptor_table *table) -+{ -+ asm ("sgdt %0" : "=m"(*table)); -+} -+ -+static inline unsigned long read_tr_base(void) -+{ -+ u16 tr; -+ asm ("str %0" : "=g"(tr)); -+ return segment_base(tr); -+} -+ -+#ifdef __x86_64__ -+static inline unsigned long read_msr(unsigned long msr) -+{ -+ u64 value; -+ -+ rdmsrl(msr, value); -+ return value; -+} -+#endif -+ -+static inline void fx_save(void *image) -+{ -+ asm ("fxsave (%0)":: "r" (image)); -+} -+ -+static inline void fx_restore(void *image) -+{ -+ asm ("fxrstor (%0)":: "r" (image)); -+} -+ -+static inline void fpu_init(void) -+{ -+ asm ("finit"); -+} -+ -+static inline u32 get_rdx_init_val(void) -+{ -+ return 0x600; /* P6 family */ -+} -+ -+#define ASM_VMX_VMCLEAR_RAX ".byte 0x66, 0x0f, 0xc7, 0x30" -+#define ASM_VMX_VMLAUNCH ".byte 0x0f, 0x01, 0xc2" -+#define ASM_VMX_VMRESUME ".byte 0x0f, 0x01, 0xc3" -+#define ASM_VMX_VMPTRLD_RAX ".byte 0x0f, 0xc7, 0x30" -+#define ASM_VMX_VMREAD_RDX_RAX ".byte 0x0f, 0x78, 0xd0" -+#define ASM_VMX_VMWRITE_RAX_RDX ".byte 0x0f, 0x79, 0xd0" -+#define ASM_VMX_VMWRITE_RSP_RDX ".byte 0x0f, 0x79, 0xd4" -+#define ASM_VMX_VMXOFF ".byte 0x0f, 0x01, 0xc4" -+#define ASM_VMX_VMXON_RAX ".byte 0xf3, 0x0f, 0xc7, 0x30" -+ -+#define MSR_IA32_TIME_STAMP_COUNTER 0x010 -+ -+#define TSS_IOPB_BASE_OFFSET 0x66 -+#define TSS_BASE_SIZE 0x68 -+#define TSS_IOPB_SIZE (65536 / 8) -+#define TSS_REDIRECTION_SIZE (256 / 8) -+#define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1) -+ -+#ifdef __x86_64__ -+ -+/* -+ * When emulating 32-bit mode, cr3 is only 32 bits even on x86_64. Therefore -+ * we need to allocate shadow page tables in the first 4GB of memory, which -+ * happens to fit the DMA32 zone. -+ */ -+#define GFP_KVM_MMU (GFP_KERNEL | __GFP_DMA32) -+ -+#else -+ -+#define GFP_KVM_MMU GFP_KERNEL -+ -+#endif -+ -+#endif ---- /dev/null -+++ b/drivers/kvm/kvm_main.c -@@ -0,0 +1,1935 @@ -+/* -+ * Kernel-based Virtual Machine driver for Linux -+ * -+ * This module enables machines with Intel VT-x extensions to run virtual -+ * machines without emulation or binary translation. -+ * -+ * Copyright (C) 2006 Qumranet, Inc. -+ * -+ * Authors: -+ * Avi Kivity -+ * Yaniv Kamay -+ * -+ * This work is licensed under the terms of the GNU GPL, version 2. See -+ * the COPYING file in the top-level directory. -+ * -+ */ -+ -+#include "kvm.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "x86_emulate.h" -+#include "segment_descriptor.h" -+ -+MODULE_AUTHOR("Qumranet"); -+MODULE_LICENSE("GPL"); -+ -+struct kvm_arch_ops *kvm_arch_ops; -+struct kvm_stat kvm_stat; -+EXPORT_SYMBOL_GPL(kvm_stat); -+ -+static struct kvm_stats_debugfs_item { -+ const char *name; -+ u32 *data; -+ struct dentry *dentry; -+} debugfs_entries[] = { -+ { "pf_fixed", &kvm_stat.pf_fixed }, -+ { "pf_guest", &kvm_stat.pf_guest }, -+ { "tlb_flush", &kvm_stat.tlb_flush }, -+ { "invlpg", &kvm_stat.invlpg }, -+ { "exits", &kvm_stat.exits }, -+ { "io_exits", &kvm_stat.io_exits }, -+ { "mmio_exits", &kvm_stat.mmio_exits }, -+ { "signal_exits", &kvm_stat.signal_exits }, -+ { "irq_exits", &kvm_stat.irq_exits }, -+ { 0, 0 } -+}; -+ -+static struct dentry *debugfs_dir; -+ -+#define MAX_IO_MSRS 256 -+ -+#define CR0_RESEVED_BITS 0xffffffff1ffaffc0ULL -+#define LMSW_GUEST_MASK 0x0eULL -+#define CR4_RESEVED_BITS (~((1ULL << 11) - 1)) -+#define CR8_RESEVED_BITS (~0x0fULL) -+#define EFER_RESERVED_BITS 0xfffffffffffff2fe -+ -+struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr) -+{ -+ int i; -+ -+ for (i = 0; i < vcpu->nmsrs; ++i) -+ if (vcpu->guest_msrs[i].index == msr) -+ return &vcpu->guest_msrs[i]; -+ return 0; -+} -+EXPORT_SYMBOL_GPL(find_msr_entry); -+ -+#ifdef __x86_64__ -+// LDT or TSS descriptor in the GDT. 16 bytes. -+struct segment_descriptor_64 { -+ struct segment_descriptor s; -+ u32 base_higher; -+ u32 pad_zero; -+}; -+ -+#endif -+ -+unsigned long segment_base(u16 selector) -+{ -+ struct descriptor_table gdt; -+ struct segment_descriptor *d; -+ unsigned long table_base; -+ typedef unsigned long ul; -+ unsigned long v; -+ -+ if (selector == 0) -+ return 0; -+ -+ asm ("sgdt %0" : "=m"(gdt)); -+ table_base = gdt.base; -+ -+ if (selector & 4) { /* from ldt */ -+ u16 ldt_selector; -+ -+ asm ("sldt %0" : "=g"(ldt_selector)); -+ table_base = segment_base(ldt_selector); -+ } -+ d = (struct segment_descriptor *)(table_base + (selector & ~7)); -+ v = d->base_low | ((ul)d->base_mid << 16) | ((ul)d->base_high << 24); -+#ifdef __x86_64__ -+ if (d->system == 0 -+ && (d->type == 2 || d->type == 9 || d->type == 11)) -+ v |= ((ul)((struct segment_descriptor_64 *)d)->base_higher) << 32; -+#endif -+ return v; -+} -+EXPORT_SYMBOL_GPL(segment_base); -+ -+int kvm_read_guest(struct kvm_vcpu *vcpu, -+ gva_t addr, -+ unsigned long size, -+ void *dest) -+{ -+ unsigned char *host_buf = dest; -+ unsigned long req_size = size; -+ -+ while (size) { -+ hpa_t paddr; -+ unsigned now; -+ unsigned offset; -+ hva_t guest_buf; -+ -+ paddr = gva_to_hpa(vcpu, addr); -+ -+ if (is_error_hpa(paddr)) -+ break; -+ -+ guest_buf = (hva_t)kmap_atomic( -+ pfn_to_page(paddr >> PAGE_SHIFT), -+ KM_USER0); -+ offset = addr & ~PAGE_MASK; -+ guest_buf |= offset; -+ now = min(size, PAGE_SIZE - offset); -+ memcpy(host_buf, (void*)guest_buf, now); -+ host_buf += now; -+ addr += now; -+ size -= now; -+ kunmap_atomic((void *)(guest_buf & PAGE_MASK), KM_USER0); -+ } -+ return req_size - size; -+} -+EXPORT_SYMBOL_GPL(kvm_read_guest); -+ -+int kvm_write_guest(struct kvm_vcpu *vcpu, -+ gva_t addr, -+ unsigned long size, -+ void *data) -+{ -+ unsigned char *host_buf = data; -+ unsigned long req_size = size; -+ -+ while (size) { -+ hpa_t paddr; -+ unsigned now; -+ unsigned offset; -+ hva_t guest_buf; -+ -+ paddr = gva_to_hpa(vcpu, addr); -+ -+ if (is_error_hpa(paddr)) -+ break; -+ -+ guest_buf = (hva_t)kmap_atomic( -+ pfn_to_page(paddr >> PAGE_SHIFT), KM_USER0); -+ offset = addr & ~PAGE_MASK; -+ guest_buf |= offset; -+ now = min(size, PAGE_SIZE - offset); -+ memcpy((void*)guest_buf, host_buf, now); -+ host_buf += now; -+ addr += now; -+ size -= now; -+ kunmap_atomic((void *)(guest_buf & PAGE_MASK), KM_USER0); -+ } -+ return req_size - size; -+} -+EXPORT_SYMBOL_GPL(kvm_write_guest); -+ -+static int vcpu_slot(struct kvm_vcpu *vcpu) -+{ -+ return vcpu - vcpu->kvm->vcpus; -+} -+ -+/* -+ * Switches to specified vcpu, until a matching vcpu_put() -+ */ -+static struct kvm_vcpu *vcpu_load(struct kvm *kvm, int vcpu_slot) -+{ -+ struct kvm_vcpu *vcpu = &kvm->vcpus[vcpu_slot]; -+ -+ mutex_lock(&vcpu->mutex); -+ if (unlikely(!vcpu->vmcs)) { -+ mutex_unlock(&vcpu->mutex); -+ return 0; -+ } -+ return kvm_arch_ops->vcpu_load(vcpu); -+} -+ -+static void vcpu_put(struct kvm_vcpu *vcpu) -+{ -+ kvm_arch_ops->vcpu_put(vcpu); -+ put_cpu(); -+ mutex_unlock(&vcpu->mutex); -+} -+ -+static int kvm_dev_open(struct inode *inode, struct file *filp) -+{ -+ struct kvm *kvm = kzalloc(sizeof(struct kvm), GFP_KERNEL); -+ int i; -+ -+ if (!kvm) -+ return -ENOMEM; -+ -+ spin_lock_init(&kvm->lock); -+ INIT_LIST_HEAD(&kvm->active_mmu_pages); -+ for (i = 0; i < KVM_MAX_VCPUS; ++i) { -+ struct kvm_vcpu *vcpu = &kvm->vcpus[i]; -+ -+ mutex_init(&vcpu->mutex); -+ vcpu->mmu.root_hpa = INVALID_PAGE; -+ INIT_LIST_HEAD(&vcpu->free_pages); -+ } -+ filp->private_data = kvm; -+ return 0; -+} -+ -+/* -+ * Free any memory in @free but not in @dont. -+ */ -+static void kvm_free_physmem_slot(struct kvm_memory_slot *free, -+ struct kvm_memory_slot *dont) -+{ -+ int i; -+ -+ if (!dont || free->phys_mem != dont->phys_mem) -+ if (free->phys_mem) { -+ for (i = 0; i < free->npages; ++i) -+ __free_page(free->phys_mem[i]); -+ vfree(free->phys_mem); -+ } -+ -+ if (!dont || free->dirty_bitmap != dont->dirty_bitmap) -+ vfree(free->dirty_bitmap); -+ -+ free->phys_mem = 0; -+ free->npages = 0; -+ free->dirty_bitmap = 0; -+} -+ -+static void kvm_free_physmem(struct kvm *kvm) -+{ -+ int i; -+ -+ for (i = 0; i < kvm->nmemslots; ++i) -+ kvm_free_physmem_slot(&kvm->memslots[i], 0); -+} -+ -+static void kvm_free_vcpu(struct kvm_vcpu *vcpu) -+{ -+ kvm_arch_ops->vcpu_free(vcpu); -+ kvm_mmu_destroy(vcpu); -+} -+ -+static void kvm_free_vcpus(struct kvm *kvm) -+{ -+ unsigned int i; -+ -+ for (i = 0; i < KVM_MAX_VCPUS; ++i) -+ kvm_free_vcpu(&kvm->vcpus[i]); -+} -+ -+static int kvm_dev_release(struct inode *inode, struct file *filp) -+{ -+ struct kvm *kvm = filp->private_data; -+ -+ kvm_free_vcpus(kvm); -+ kvm_free_physmem(kvm); -+ kfree(kvm); -+ return 0; -+} -+ -+static void inject_gp(struct kvm_vcpu *vcpu) -+{ -+ kvm_arch_ops->inject_gp(vcpu, 0); -+} -+ -+static int pdptrs_have_reserved_bits_set(struct kvm_vcpu *vcpu, -+ unsigned long cr3) -+{ -+ gfn_t pdpt_gfn = cr3 >> PAGE_SHIFT; -+ unsigned offset = (cr3 & (PAGE_SIZE-1)) >> 5; -+ int i; -+ u64 pdpte; -+ u64 *pdpt; -+ struct kvm_memory_slot *memslot; -+ -+ spin_lock(&vcpu->kvm->lock); -+ memslot = gfn_to_memslot(vcpu->kvm, pdpt_gfn); -+ /* FIXME: !memslot - emulate? 0xff? */ -+ pdpt = kmap_atomic(gfn_to_page(memslot, pdpt_gfn), KM_USER0); -+ -+ for (i = 0; i < 4; ++i) { -+ pdpte = pdpt[offset + i]; -+ if ((pdpte & 1) && (pdpte & 0xfffffff0000001e6ull)) -+ break; -+ } -+ -+ kunmap_atomic(pdpt, KM_USER0); -+ spin_unlock(&vcpu->kvm->lock); -+ -+ return i != 4; -+} -+ -+void set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) -+{ -+ if (cr0 & CR0_RESEVED_BITS) { -+ printk(KERN_DEBUG "set_cr0: 0x%lx #GP, reserved bits 0x%lx\n", -+ cr0, vcpu->cr0); -+ inject_gp(vcpu); -+ return; -+ } -+ -+ if ((cr0 & CR0_NW_MASK) && !(cr0 & CR0_CD_MASK)) { -+ printk(KERN_DEBUG "set_cr0: #GP, CD == 0 && NW == 1\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ -+ if ((cr0 & CR0_PG_MASK) && !(cr0 & CR0_PE_MASK)) { -+ printk(KERN_DEBUG "set_cr0: #GP, set PG flag " -+ "and a clear PE flag\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ -+ if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) { -+#ifdef __x86_64__ -+ if ((vcpu->shadow_efer & EFER_LME)) { -+ int cs_db, cs_l; -+ -+ if (!is_pae(vcpu)) { -+ printk(KERN_DEBUG "set_cr0: #GP, start paging " -+ "in long mode while PAE is disabled\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ kvm_arch_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l); -+ if (cs_l) { -+ printk(KERN_DEBUG "set_cr0: #GP, start paging " -+ "in long mode while CS.L == 1\n"); -+ inject_gp(vcpu); -+ return; -+ -+ } -+ } else -+#endif -+ if (is_pae(vcpu) && -+ pdptrs_have_reserved_bits_set(vcpu, vcpu->cr3)) { -+ printk(KERN_DEBUG "set_cr0: #GP, pdptrs " -+ "reserved bits\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ -+ } -+ -+ kvm_arch_ops->set_cr0(vcpu, cr0); -+ vcpu->cr0 = cr0; -+ -+ spin_lock(&vcpu->kvm->lock); -+ kvm_mmu_reset_context(vcpu); -+ spin_unlock(&vcpu->kvm->lock); -+ return; -+} -+EXPORT_SYMBOL_GPL(set_cr0); -+ -+void lmsw(struct kvm_vcpu *vcpu, unsigned long msw) -+{ -+ set_cr0(vcpu, (vcpu->cr0 & ~0x0ful) | (msw & 0x0f)); -+} -+EXPORT_SYMBOL_GPL(lmsw); -+ -+void set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) -+{ -+ if (cr4 & CR4_RESEVED_BITS) { -+ printk(KERN_DEBUG "set_cr4: #GP, reserved bits\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ -+ if (kvm_arch_ops->is_long_mode(vcpu)) { -+ if (!(cr4 & CR4_PAE_MASK)) { -+ printk(KERN_DEBUG "set_cr4: #GP, clearing PAE while " -+ "in long mode\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ } else if (is_paging(vcpu) && !is_pae(vcpu) && (cr4 & CR4_PAE_MASK) -+ && pdptrs_have_reserved_bits_set(vcpu, vcpu->cr3)) { -+ printk(KERN_DEBUG "set_cr4: #GP, pdptrs reserved bits\n"); -+ inject_gp(vcpu); -+ } -+ -+ if (cr4 & CR4_VMXE_MASK) { -+ printk(KERN_DEBUG "set_cr4: #GP, setting VMXE\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ kvm_arch_ops->set_cr4(vcpu, cr4); -+ spin_lock(&vcpu->kvm->lock); -+ kvm_mmu_reset_context(vcpu); -+ spin_unlock(&vcpu->kvm->lock); -+} -+EXPORT_SYMBOL_GPL(set_cr4); -+ -+void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3) -+{ -+ if (kvm_arch_ops->is_long_mode(vcpu)) { -+ if ( cr3 & CR3_L_MODE_RESEVED_BITS) { -+ printk(KERN_DEBUG "set_cr3: #GP, reserved bits\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ } else { -+ if (cr3 & CR3_RESEVED_BITS) { -+ printk(KERN_DEBUG "set_cr3: #GP, reserved bits\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ if (is_paging(vcpu) && is_pae(vcpu) && -+ pdptrs_have_reserved_bits_set(vcpu, cr3)) { -+ printk(KERN_DEBUG "set_cr3: #GP, pdptrs " -+ "reserved bits\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ } -+ -+ vcpu->cr3 = cr3; -+ spin_lock(&vcpu->kvm->lock); -+ vcpu->mmu.new_cr3(vcpu); -+ spin_unlock(&vcpu->kvm->lock); -+} -+EXPORT_SYMBOL_GPL(set_cr3); -+ -+void set_cr8(struct kvm_vcpu *vcpu, unsigned long cr8) -+{ -+ if ( cr8 & CR8_RESEVED_BITS) { -+ printk(KERN_DEBUG "set_cr8: #GP, reserved bits 0x%lx\n", cr8); -+ inject_gp(vcpu); -+ return; -+ } -+ vcpu->cr8 = cr8; -+} -+EXPORT_SYMBOL_GPL(set_cr8); -+ -+void fx_init(struct kvm_vcpu *vcpu) -+{ -+ struct __attribute__ ((__packed__)) fx_image_s { -+ u16 control; //fcw -+ u16 status; //fsw -+ u16 tag; // ftw -+ u16 opcode; //fop -+ u64 ip; // fpu ip -+ u64 operand;// fpu dp -+ u32 mxcsr; -+ u32 mxcsr_mask; -+ -+ } *fx_image; -+ -+ fx_save(vcpu->host_fx_image); -+ fpu_init(); -+ fx_save(vcpu->guest_fx_image); -+ fx_restore(vcpu->host_fx_image); -+ -+ fx_image = (struct fx_image_s *)vcpu->guest_fx_image; -+ fx_image->mxcsr = 0x1f80; -+ memset(vcpu->guest_fx_image + sizeof(struct fx_image_s), -+ 0, FX_IMAGE_SIZE - sizeof(struct fx_image_s)); -+} -+EXPORT_SYMBOL_GPL(fx_init); -+ -+/* -+ * Creates some virtual cpus. Good luck creating more than one. -+ */ -+static int kvm_dev_ioctl_create_vcpu(struct kvm *kvm, int n) -+{ -+ int r; -+ struct kvm_vcpu *vcpu; -+ -+ r = -EINVAL; -+ if (n < 0 || n >= KVM_MAX_VCPUS) -+ goto out; -+ -+ vcpu = &kvm->vcpus[n]; -+ -+ mutex_lock(&vcpu->mutex); -+ -+ if (vcpu->vmcs) { -+ mutex_unlock(&vcpu->mutex); -+ return -EEXIST; -+ } -+ -+ vcpu->host_fx_image = (char*)ALIGN((hva_t)vcpu->fx_buf, -+ FX_IMAGE_ALIGN); -+ vcpu->guest_fx_image = vcpu->host_fx_image + FX_IMAGE_SIZE; -+ -+ vcpu->cpu = -1; /* First load will set up TR */ -+ vcpu->kvm = kvm; -+ r = kvm_arch_ops->vcpu_create(vcpu); -+ if (r < 0) -+ goto out_free_vcpus; -+ -+ kvm_arch_ops->vcpu_load(vcpu); -+ -+ r = kvm_arch_ops->vcpu_setup(vcpu); -+ if (r >= 0) -+ r = kvm_mmu_init(vcpu); -+ -+ vcpu_put(vcpu); -+ -+ if (r < 0) -+ goto out_free_vcpus; -+ -+ return 0; -+ -+out_free_vcpus: -+ kvm_free_vcpu(vcpu); -+ mutex_unlock(&vcpu->mutex); -+out: -+ return r; -+} -+ -+/* -+ * Allocate some memory and give it an address in the guest physical address -+ * space. -+ * -+ * Discontiguous memory is allowed, mostly for framebuffers. -+ */ -+static int kvm_dev_ioctl_set_memory_region(struct kvm *kvm, -+ struct kvm_memory_region *mem) -+{ -+ int r; -+ gfn_t base_gfn; -+ unsigned long npages; -+ unsigned long i; -+ struct kvm_memory_slot *memslot; -+ struct kvm_memory_slot old, new; -+ int memory_config_version; -+ -+ r = -EINVAL; -+ /* General sanity checks */ -+ if (mem->memory_size & (PAGE_SIZE - 1)) -+ goto out; -+ if (mem->guest_phys_addr & (PAGE_SIZE - 1)) -+ goto out; -+ if (mem->slot >= KVM_MEMORY_SLOTS) -+ goto out; -+ if (mem->guest_phys_addr + mem->memory_size < mem->guest_phys_addr) -+ goto out; -+ -+ memslot = &kvm->memslots[mem->slot]; -+ base_gfn = mem->guest_phys_addr >> PAGE_SHIFT; -+ npages = mem->memory_size >> PAGE_SHIFT; -+ -+ if (!npages) -+ mem->flags &= ~KVM_MEM_LOG_DIRTY_PAGES; -+ -+raced: -+ spin_lock(&kvm->lock); -+ -+ memory_config_version = kvm->memory_config_version; -+ new = old = *memslot; -+ -+ new.base_gfn = base_gfn; -+ new.npages = npages; -+ new.flags = mem->flags; -+ -+ /* Disallow changing a memory slot's size. */ -+ r = -EINVAL; -+ if (npages && old.npages && npages != old.npages) -+ goto out_unlock; -+ -+ /* Check for overlaps */ -+ r = -EEXIST; -+ for (i = 0; i < KVM_MEMORY_SLOTS; ++i) { -+ struct kvm_memory_slot *s = &kvm->memslots[i]; -+ -+ if (s == memslot) -+ continue; -+ if (!((base_gfn + npages <= s->base_gfn) || -+ (base_gfn >= s->base_gfn + s->npages))) -+ goto out_unlock; -+ } -+ /* -+ * Do memory allocations outside lock. memory_config_version will -+ * detect any races. -+ */ -+ spin_unlock(&kvm->lock); -+ -+ /* Deallocate if slot is being removed */ -+ if (!npages) -+ new.phys_mem = 0; -+ -+ /* Free page dirty bitmap if unneeded */ -+ if (!(new.flags & KVM_MEM_LOG_DIRTY_PAGES)) -+ new.dirty_bitmap = 0; -+ -+ r = -ENOMEM; -+ -+ /* Allocate if a slot is being created */ -+ if (npages && !new.phys_mem) { -+ new.phys_mem = vmalloc(npages * sizeof(struct page *)); -+ -+ if (!new.phys_mem) -+ goto out_free; -+ -+ memset(new.phys_mem, 0, npages * sizeof(struct page *)); -+ for (i = 0; i < npages; ++i) { -+ new.phys_mem[i] = alloc_page(GFP_HIGHUSER -+ | __GFP_ZERO); -+ if (!new.phys_mem[i]) -+ goto out_free; -+ } -+ } -+ -+ /* Allocate page dirty bitmap if needed */ -+ if ((new.flags & KVM_MEM_LOG_DIRTY_PAGES) && !new.dirty_bitmap) { -+ unsigned dirty_bytes = ALIGN(npages, BITS_PER_LONG) / 8; -+ -+ new.dirty_bitmap = vmalloc(dirty_bytes); -+ if (!new.dirty_bitmap) -+ goto out_free; -+ memset(new.dirty_bitmap, 0, dirty_bytes); -+ } -+ -+ spin_lock(&kvm->lock); -+ -+ if (memory_config_version != kvm->memory_config_version) { -+ spin_unlock(&kvm->lock); -+ kvm_free_physmem_slot(&new, &old); -+ goto raced; -+ } -+ -+ r = -EAGAIN; -+ if (kvm->busy) -+ goto out_unlock; -+ -+ if (mem->slot >= kvm->nmemslots) -+ kvm->nmemslots = mem->slot + 1; -+ -+ *memslot = new; -+ ++kvm->memory_config_version; -+ -+ spin_unlock(&kvm->lock); -+ -+ for (i = 0; i < KVM_MAX_VCPUS; ++i) { -+ struct kvm_vcpu *vcpu; -+ -+ vcpu = vcpu_load(kvm, i); -+ if (!vcpu) -+ continue; -+ kvm_mmu_reset_context(vcpu); -+ vcpu_put(vcpu); -+ } -+ -+ kvm_free_physmem_slot(&old, &new); -+ return 0; -+ -+out_unlock: -+ spin_unlock(&kvm->lock); -+out_free: -+ kvm_free_physmem_slot(&new, &old); -+out: -+ return r; -+} -+ -+/* -+ * Get (and clear) the dirty memory log for a memory slot. -+ */ -+static int kvm_dev_ioctl_get_dirty_log(struct kvm *kvm, -+ struct kvm_dirty_log *log) -+{ -+ struct kvm_memory_slot *memslot; -+ int r, i; -+ int n; -+ unsigned long any = 0; -+ -+ spin_lock(&kvm->lock); -+ -+ /* -+ * Prevent changes to guest memory configuration even while the lock -+ * is not taken. -+ */ -+ ++kvm->busy; -+ spin_unlock(&kvm->lock); -+ r = -EINVAL; -+ if (log->slot >= KVM_MEMORY_SLOTS) -+ goto out; -+ -+ memslot = &kvm->memslots[log->slot]; -+ r = -ENOENT; -+ if (!memslot->dirty_bitmap) -+ goto out; -+ -+ n = ALIGN(memslot->npages, 8) / 8; -+ -+ for (i = 0; !any && i < n; ++i) -+ any = memslot->dirty_bitmap[i]; -+ -+ r = -EFAULT; -+ if (copy_to_user(log->dirty_bitmap, memslot->dirty_bitmap, n)) -+ goto out; -+ -+ -+ if (any) { -+ spin_lock(&kvm->lock); -+ kvm_mmu_slot_remove_write_access(kvm, log->slot); -+ spin_unlock(&kvm->lock); -+ memset(memslot->dirty_bitmap, 0, n); -+ for (i = 0; i < KVM_MAX_VCPUS; ++i) { -+ struct kvm_vcpu *vcpu = vcpu_load(kvm, i); -+ -+ if (!vcpu) -+ continue; -+ kvm_arch_ops->tlb_flush(vcpu); -+ vcpu_put(vcpu); -+ } -+ } -+ -+ r = 0; -+ -+out: -+ spin_lock(&kvm->lock); -+ --kvm->busy; -+ spin_unlock(&kvm->lock); -+ return r; -+} -+ -+struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn) -+{ -+ int i; -+ -+ for (i = 0; i < kvm->nmemslots; ++i) { -+ struct kvm_memory_slot *memslot = &kvm->memslots[i]; -+ -+ if (gfn >= memslot->base_gfn -+ && gfn < memslot->base_gfn + memslot->npages) -+ return memslot; -+ } -+ return 0; -+} -+EXPORT_SYMBOL_GPL(gfn_to_memslot); -+ -+void mark_page_dirty(struct kvm *kvm, gfn_t gfn) -+{ -+ int i; -+ struct kvm_memory_slot *memslot = 0; -+ unsigned long rel_gfn; -+ -+ for (i = 0; i < kvm->nmemslots; ++i) { -+ memslot = &kvm->memslots[i]; -+ -+ if (gfn >= memslot->base_gfn -+ && gfn < memslot->base_gfn + memslot->npages) { -+ -+ if (!memslot || !memslot->dirty_bitmap) -+ return; -+ -+ rel_gfn = gfn - memslot->base_gfn; -+ -+ /* avoid RMW */ -+ if (!test_bit(rel_gfn, memslot->dirty_bitmap)) -+ set_bit(rel_gfn, memslot->dirty_bitmap); -+ return; -+ } -+ } -+} -+ -+static int emulator_read_std(unsigned long addr, -+ unsigned long *val, -+ unsigned int bytes, -+ struct x86_emulate_ctxt *ctxt) -+{ -+ struct kvm_vcpu *vcpu = ctxt->vcpu; -+ void *data = val; -+ -+ while (bytes) { -+ gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, addr); -+ unsigned offset = addr & (PAGE_SIZE-1); -+ unsigned tocopy = min(bytes, (unsigned)PAGE_SIZE - offset); -+ unsigned long pfn; -+ struct kvm_memory_slot *memslot; -+ void *page; -+ -+ if (gpa == UNMAPPED_GVA) -+ return X86EMUL_PROPAGATE_FAULT; -+ pfn = gpa >> PAGE_SHIFT; -+ memslot = gfn_to_memslot(vcpu->kvm, pfn); -+ if (!memslot) -+ return X86EMUL_UNHANDLEABLE; -+ page = kmap_atomic(gfn_to_page(memslot, pfn), KM_USER0); -+ -+ memcpy(data, page + offset, tocopy); -+ -+ kunmap_atomic(page, KM_USER0); -+ -+ bytes -= tocopy; -+ data += tocopy; -+ addr += tocopy; -+ } -+ -+ return X86EMUL_CONTINUE; -+} -+ -+static int emulator_write_std(unsigned long addr, -+ unsigned long val, -+ unsigned int bytes, -+ struct x86_emulate_ctxt *ctxt) -+{ -+ printk(KERN_ERR "emulator_write_std: addr %lx n %d\n", -+ addr, bytes); -+ return X86EMUL_UNHANDLEABLE; -+} -+ -+static int emulator_read_emulated(unsigned long addr, -+ unsigned long *val, -+ unsigned int bytes, -+ struct x86_emulate_ctxt *ctxt) -+{ -+ struct kvm_vcpu *vcpu = ctxt->vcpu; -+ -+ if (vcpu->mmio_read_completed) { -+ memcpy(val, vcpu->mmio_data, bytes); -+ vcpu->mmio_read_completed = 0; -+ return X86EMUL_CONTINUE; -+ } else if (emulator_read_std(addr, val, bytes, ctxt) -+ == X86EMUL_CONTINUE) -+ return X86EMUL_CONTINUE; -+ else { -+ gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, addr); -+ if (gpa == UNMAPPED_GVA) -+ return vcpu_printf(vcpu, "not present\n"), X86EMUL_PROPAGATE_FAULT; -+ vcpu->mmio_needed = 1; -+ vcpu->mmio_phys_addr = gpa; -+ vcpu->mmio_size = bytes; -+ vcpu->mmio_is_write = 0; -+ -+ return X86EMUL_UNHANDLEABLE; -+ } -+} -+ -+static int emulator_write_emulated(unsigned long addr, -+ unsigned long val, -+ unsigned int bytes, -+ struct x86_emulate_ctxt *ctxt) -+{ -+ struct kvm_vcpu *vcpu = ctxt->vcpu; -+ gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, addr); -+ -+ if (gpa == UNMAPPED_GVA) -+ return X86EMUL_PROPAGATE_FAULT; -+ -+ vcpu->mmio_needed = 1; -+ vcpu->mmio_phys_addr = gpa; -+ vcpu->mmio_size = bytes; -+ vcpu->mmio_is_write = 1; -+ memcpy(vcpu->mmio_data, &val, bytes); -+ -+ return X86EMUL_CONTINUE; -+} -+ -+static int emulator_cmpxchg_emulated(unsigned long addr, -+ unsigned long old, -+ unsigned long new, -+ unsigned int bytes, -+ struct x86_emulate_ctxt *ctxt) -+{ -+ static int reported; -+ -+ if (!reported) { -+ reported = 1; -+ printk(KERN_WARNING "kvm: emulating exchange as write\n"); -+ } -+ return emulator_write_emulated(addr, new, bytes, ctxt); -+} -+ -+static unsigned long get_segment_base(struct kvm_vcpu *vcpu, int seg) -+{ -+ return kvm_arch_ops->get_segment_base(vcpu, seg); -+} -+ -+int emulate_invlpg(struct kvm_vcpu *vcpu, gva_t address) -+{ -+ spin_lock(&vcpu->kvm->lock); -+ vcpu->mmu.inval_page(vcpu, address); -+ spin_unlock(&vcpu->kvm->lock); -+ kvm_arch_ops->invlpg(vcpu, address); -+ return X86EMUL_CONTINUE; -+} -+ -+int emulate_clts(struct kvm_vcpu *vcpu) -+{ -+ unsigned long cr0 = vcpu->cr0; -+ -+ cr0 &= ~CR0_TS_MASK; -+ kvm_arch_ops->set_cr0(vcpu, cr0); -+ return X86EMUL_CONTINUE; -+} -+ -+int emulator_get_dr(struct x86_emulate_ctxt* ctxt, int dr, unsigned long *dest) -+{ -+ struct kvm_vcpu *vcpu = ctxt->vcpu; -+ -+ switch (dr) { -+ case 0 ... 3: -+ *dest = kvm_arch_ops->get_dr(vcpu, dr); -+ return X86EMUL_CONTINUE; -+ default: -+ printk(KERN_DEBUG "%s: unexpected dr %u\n", -+ __FUNCTION__, dr); -+ return X86EMUL_UNHANDLEABLE; -+ } -+} -+ -+int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr, unsigned long value) -+{ -+ unsigned long mask = (ctxt->mode == X86EMUL_MODE_PROT64) ? ~0ULL : ~0U; -+ int exception; -+ -+ kvm_arch_ops->set_dr(ctxt->vcpu, dr, value & mask, &exception); -+ if (exception) { -+ /* FIXME: better handling */ -+ return X86EMUL_UNHANDLEABLE; -+ } -+ return X86EMUL_CONTINUE; -+} -+ -+static void report_emulation_failure(struct x86_emulate_ctxt *ctxt) -+{ -+ static int reported; -+ u8 opcodes[4]; -+ unsigned long rip = ctxt->vcpu->rip; -+ unsigned long rip_linear; -+ -+ rip_linear = rip + get_segment_base(ctxt->vcpu, VCPU_SREG_CS); -+ -+ if (reported) -+ return; -+ -+ emulator_read_std(rip_linear, (void *)opcodes, 4, ctxt); -+ -+ printk(KERN_ERR "emulation failed but !mmio_needed?" -+ " rip %lx %02x %02x %02x %02x\n", -+ rip, opcodes[0], opcodes[1], opcodes[2], opcodes[3]); -+ reported = 1; -+} -+ -+struct x86_emulate_ops emulate_ops = { -+ .read_std = emulator_read_std, -+ .write_std = emulator_write_std, -+ .read_emulated = emulator_read_emulated, -+ .write_emulated = emulator_write_emulated, -+ .cmpxchg_emulated = emulator_cmpxchg_emulated, -+}; -+ -+int emulate_instruction(struct kvm_vcpu *vcpu, -+ struct kvm_run *run, -+ unsigned long cr2, -+ u16 error_code) -+{ -+ struct x86_emulate_ctxt emulate_ctxt; -+ int r; -+ int cs_db, cs_l; -+ -+ kvm_arch_ops->cache_regs(vcpu); -+ -+ kvm_arch_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l); -+ -+ emulate_ctxt.vcpu = vcpu; -+ emulate_ctxt.eflags = kvm_arch_ops->get_rflags(vcpu); -+ emulate_ctxt.cr2 = cr2; -+ emulate_ctxt.mode = (emulate_ctxt.eflags & X86_EFLAGS_VM) -+ ? X86EMUL_MODE_REAL : cs_l -+ ? X86EMUL_MODE_PROT64 : cs_db -+ ? X86EMUL_MODE_PROT32 : X86EMUL_MODE_PROT16; -+ -+ if (emulate_ctxt.mode == X86EMUL_MODE_PROT64) { -+ emulate_ctxt.cs_base = 0; -+ emulate_ctxt.ds_base = 0; -+ emulate_ctxt.es_base = 0; -+ emulate_ctxt.ss_base = 0; -+ } else { -+ emulate_ctxt.cs_base = get_segment_base(vcpu, VCPU_SREG_CS); -+ emulate_ctxt.ds_base = get_segment_base(vcpu, VCPU_SREG_DS); -+ emulate_ctxt.es_base = get_segment_base(vcpu, VCPU_SREG_ES); -+ emulate_ctxt.ss_base = get_segment_base(vcpu, VCPU_SREG_SS); -+ } -+ -+ emulate_ctxt.gs_base = get_segment_base(vcpu, VCPU_SREG_GS); -+ emulate_ctxt.fs_base = get_segment_base(vcpu, VCPU_SREG_FS); -+ -+ vcpu->mmio_is_write = 0; -+ r = x86_emulate_memop(&emulate_ctxt, &emulate_ops); -+ -+ if ((r || vcpu->mmio_is_write) && run) { -+ run->mmio.phys_addr = vcpu->mmio_phys_addr; -+ memcpy(run->mmio.data, vcpu->mmio_data, 8); -+ run->mmio.len = vcpu->mmio_size; -+ run->mmio.is_write = vcpu->mmio_is_write; -+ } -+ -+ if (r) { -+ if (!vcpu->mmio_needed) { -+ report_emulation_failure(&emulate_ctxt); -+ return EMULATE_FAIL; -+ } -+ return EMULATE_DO_MMIO; -+ } -+ -+ kvm_arch_ops->decache_regs(vcpu); -+ kvm_arch_ops->set_rflags(vcpu, emulate_ctxt.eflags); -+ -+ if (vcpu->mmio_is_write) -+ return EMULATE_DO_MMIO; -+ -+ return EMULATE_DONE; -+} -+EXPORT_SYMBOL_GPL(emulate_instruction); -+ -+static u64 mk_cr_64(u64 curr_cr, u32 new_val) -+{ -+ return (curr_cr & ~((1ULL << 32) - 1)) | new_val; -+} -+ -+void realmode_lgdt(struct kvm_vcpu *vcpu, u16 limit, unsigned long base) -+{ -+ struct descriptor_table dt = { limit, base }; -+ -+ kvm_arch_ops->set_gdt(vcpu, &dt); -+} -+ -+void realmode_lidt(struct kvm_vcpu *vcpu, u16 limit, unsigned long base) -+{ -+ struct descriptor_table dt = { limit, base }; -+ -+ kvm_arch_ops->set_idt(vcpu, &dt); -+} -+ -+void realmode_lmsw(struct kvm_vcpu *vcpu, unsigned long msw, -+ unsigned long *rflags) -+{ -+ lmsw(vcpu, msw); -+ *rflags = kvm_arch_ops->get_rflags(vcpu); -+} -+ -+unsigned long realmode_get_cr(struct kvm_vcpu *vcpu, int cr) -+{ -+ switch (cr) { -+ case 0: -+ return vcpu->cr0; -+ case 2: -+ return vcpu->cr2; -+ case 3: -+ return vcpu->cr3; -+ case 4: -+ return vcpu->cr4; -+ default: -+ vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr); -+ return 0; -+ } -+} -+ -+void realmode_set_cr(struct kvm_vcpu *vcpu, int cr, unsigned long val, -+ unsigned long *rflags) -+{ -+ switch (cr) { -+ case 0: -+ set_cr0(vcpu, mk_cr_64(vcpu->cr0, val)); -+ *rflags = kvm_arch_ops->get_rflags(vcpu); -+ break; -+ case 2: -+ vcpu->cr2 = val; -+ break; -+ case 3: -+ set_cr3(vcpu, val); -+ break; -+ case 4: -+ set_cr4(vcpu, mk_cr_64(vcpu->cr4, val)); -+ break; -+ default: -+ vcpu_printf(vcpu, "%s: unexpected cr %u\n", __FUNCTION__, cr); -+ } -+} -+ -+/* -+ * Reads an msr value (of 'msr_index') into 'pdata'. -+ * Returns 0 on success, non-0 otherwise. -+ * Assumes vcpu_load() was already called. -+ */ -+static int get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) -+{ -+ return kvm_arch_ops->get_msr(vcpu, msr_index, pdata); -+} -+ -+#ifdef __x86_64__ -+ -+void set_efer(struct kvm_vcpu *vcpu, u64 efer) -+{ -+ struct vmx_msr_entry *msr; -+ -+ if (efer & EFER_RESERVED_BITS) { -+ printk(KERN_DEBUG "set_efer: 0x%llx #GP, reserved bits\n", -+ efer); -+ inject_gp(vcpu); -+ return; -+ } -+ -+ if (is_paging(vcpu) -+ && (vcpu->shadow_efer & EFER_LME) != (efer & EFER_LME)) { -+ printk(KERN_DEBUG "set_efer: #GP, change LME while paging\n"); -+ inject_gp(vcpu); -+ return; -+ } -+ -+ efer &= ~EFER_LMA; -+ efer |= vcpu->shadow_efer & EFER_LMA; -+ -+ vcpu->shadow_efer = efer; -+ -+ msr = find_msr_entry(vcpu, MSR_EFER); -+ -+ if (!(efer & EFER_LMA)) -+ efer &= ~EFER_LME; -+ msr->data = efer; -+} -+EXPORT_SYMBOL_GPL(set_efer); -+ -+#endif -+ -+/* -+ * Writes msr value into into the appropriate "register". -+ * Returns 0 on success, non-0 otherwise. -+ * Assumes vcpu_load() was already called. -+ */ -+static int set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) -+{ -+ return kvm_arch_ops->set_msr(vcpu, msr_index, data); -+} -+ -+void kvm_resched(struct kvm_vcpu *vcpu) -+{ -+ vcpu_put(vcpu); -+ cond_resched(); -+ /* Cannot fail - no vcpu unplug yet. */ -+ vcpu_load(vcpu->kvm, vcpu_slot(vcpu)); -+} -+EXPORT_SYMBOL_GPL(kvm_resched); -+ -+void load_msrs(struct vmx_msr_entry *e, int n) -+{ -+ int i; -+ -+ for (i = 0; i < n; ++i) -+ wrmsrl(e[i].index, e[i].data); -+} -+EXPORT_SYMBOL_GPL(load_msrs); -+ -+void save_msrs(struct vmx_msr_entry *e, int n) -+{ -+ int i; -+ -+ for (i = 0; i < n; ++i) -+ rdmsrl(e[i].index, e[i].data); -+} -+EXPORT_SYMBOL_GPL(save_msrs); -+ -+static int kvm_dev_ioctl_run(struct kvm *kvm, struct kvm_run *kvm_run) -+{ -+ struct kvm_vcpu *vcpu; -+ int r; -+ -+ if (kvm_run->vcpu < 0 || kvm_run->vcpu >= KVM_MAX_VCPUS) -+ return -EINVAL; -+ -+ vcpu = vcpu_load(kvm, kvm_run->vcpu); -+ if (!vcpu) -+ return -ENOENT; -+ -+ if (kvm_run->emulated) { -+ kvm_arch_ops->skip_emulated_instruction(vcpu); -+ kvm_run->emulated = 0; -+ } -+ -+ if (kvm_run->mmio_completed) { -+ memcpy(vcpu->mmio_data, kvm_run->mmio.data, 8); -+ vcpu->mmio_read_completed = 1; -+ } -+ -+ vcpu->mmio_needed = 0; -+ -+ r = kvm_arch_ops->run(vcpu, kvm_run); -+ -+ vcpu_put(vcpu); -+ return r; -+} -+ -+static int kvm_dev_ioctl_get_regs(struct kvm *kvm, struct kvm_regs *regs) -+{ -+ struct kvm_vcpu *vcpu; -+ -+ if (regs->vcpu < 0 || regs->vcpu >= KVM_MAX_VCPUS) -+ return -EINVAL; -+ -+ vcpu = vcpu_load(kvm, regs->vcpu); -+ if (!vcpu) -+ return -ENOENT; -+ -+ kvm_arch_ops->cache_regs(vcpu); -+ -+ regs->rax = vcpu->regs[VCPU_REGS_RAX]; -+ regs->rbx = vcpu->regs[VCPU_REGS_RBX]; -+ regs->rcx = vcpu->regs[VCPU_REGS_RCX]; -+ regs->rdx = vcpu->regs[VCPU_REGS_RDX]; -+ regs->rsi = vcpu->regs[VCPU_REGS_RSI]; -+ regs->rdi = vcpu->regs[VCPU_REGS_RDI]; -+ regs->rsp = vcpu->regs[VCPU_REGS_RSP]; -+ regs->rbp = vcpu->regs[VCPU_REGS_RBP]; -+#ifdef __x86_64__ -+ regs->r8 = vcpu->regs[VCPU_REGS_R8]; -+ regs->r9 = vcpu->regs[VCPU_REGS_R9]; -+ regs->r10 = vcpu->regs[VCPU_REGS_R10]; -+ regs->r11 = vcpu->regs[VCPU_REGS_R11]; -+ regs->r12 = vcpu->regs[VCPU_REGS_R12]; -+ regs->r13 = vcpu->regs[VCPU_REGS_R13]; -+ regs->r14 = vcpu->regs[VCPU_REGS_R14]; -+ regs->r15 = vcpu->regs[VCPU_REGS_R15]; -+#endif -+ -+ regs->rip = vcpu->rip; -+ regs->rflags = kvm_arch_ops->get_rflags(vcpu); -+ -+ /* -+ * Don't leak debug flags in case they were set for guest debugging -+ */ -+ if (vcpu->guest_debug.enabled && vcpu->guest_debug.singlestep) -+ regs->rflags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF); -+ -+ vcpu_put(vcpu); -+ -+ return 0; -+} -+ -+static int kvm_dev_ioctl_set_regs(struct kvm *kvm, struct kvm_regs *regs) -+{ -+ struct kvm_vcpu *vcpu; -+ -+ if (regs->vcpu < 0 || regs->vcpu >= KVM_MAX_VCPUS) -+ return -EINVAL; -+ -+ vcpu = vcpu_load(kvm, regs->vcpu); -+ if (!vcpu) -+ return -ENOENT; -+ -+ vcpu->regs[VCPU_REGS_RAX] = regs->rax; -+ vcpu->regs[VCPU_REGS_RBX] = regs->rbx; -+ vcpu->regs[VCPU_REGS_RCX] = regs->rcx; -+ vcpu->regs[VCPU_REGS_RDX] = regs->rdx; -+ vcpu->regs[VCPU_REGS_RSI] = regs->rsi; -+ vcpu->regs[VCPU_REGS_RDI] = regs->rdi; -+ vcpu->regs[VCPU_REGS_RSP] = regs->rsp; -+ vcpu->regs[VCPU_REGS_RBP] = regs->rbp; -+#ifdef __x86_64__ -+ vcpu->regs[VCPU_REGS_R8] = regs->r8; -+ vcpu->regs[VCPU_REGS_R9] = regs->r9; -+ vcpu->regs[VCPU_REGS_R10] = regs->r10; -+ vcpu->regs[VCPU_REGS_R11] = regs->r11; -+ vcpu->regs[VCPU_REGS_R12] = regs->r12; -+ vcpu->regs[VCPU_REGS_R13] = regs->r13; -+ vcpu->regs[VCPU_REGS_R14] = regs->r14; -+ vcpu->regs[VCPU_REGS_R15] = regs->r15; -+#endif -+ -+ vcpu->rip = regs->rip; -+ kvm_arch_ops->set_rflags(vcpu, regs->rflags); -+ -+ kvm_arch_ops->decache_regs(vcpu); -+ -+ vcpu_put(vcpu); -+ -+ return 0; -+} -+ -+static void get_segment(struct kvm_vcpu *vcpu, -+ struct kvm_segment *var, int seg) -+{ -+ return kvm_arch_ops->get_segment(vcpu, var, seg); -+} -+ -+static int kvm_dev_ioctl_get_sregs(struct kvm *kvm, struct kvm_sregs *sregs) -+{ -+ struct kvm_vcpu *vcpu; -+ struct descriptor_table dt; -+ -+ if (sregs->vcpu < 0 || sregs->vcpu >= KVM_MAX_VCPUS) -+ return -EINVAL; -+ vcpu = vcpu_load(kvm, sregs->vcpu); -+ if (!vcpu) -+ return -ENOENT; -+ -+ get_segment(vcpu, &sregs->cs, VCPU_SREG_CS); -+ get_segment(vcpu, &sregs->ds, VCPU_SREG_DS); -+ get_segment(vcpu, &sregs->es, VCPU_SREG_ES); -+ get_segment(vcpu, &sregs->fs, VCPU_SREG_FS); -+ get_segment(vcpu, &sregs->gs, VCPU_SREG_GS); -+ get_segment(vcpu, &sregs->ss, VCPU_SREG_SS); -+ -+ get_segment(vcpu, &sregs->tr, VCPU_SREG_TR); -+ get_segment(vcpu, &sregs->ldt, VCPU_SREG_LDTR); -+ -+ kvm_arch_ops->get_idt(vcpu, &dt); -+ sregs->idt.limit = dt.limit; -+ sregs->idt.base = dt.base; -+ kvm_arch_ops->get_gdt(vcpu, &dt); -+ sregs->gdt.limit = dt.limit; -+ sregs->gdt.base = dt.base; -+ -+ sregs->cr0 = vcpu->cr0; -+ sregs->cr2 = vcpu->cr2; -+ sregs->cr3 = vcpu->cr3; -+ sregs->cr4 = vcpu->cr4; -+ sregs->cr8 = vcpu->cr8; -+ sregs->efer = vcpu->shadow_efer; -+ sregs->apic_base = vcpu->apic_base; -+ -+ memcpy(sregs->interrupt_bitmap, vcpu->irq_pending, -+ sizeof sregs->interrupt_bitmap); -+ -+ vcpu_put(vcpu); -+ -+ return 0; -+} -+ -+static void set_segment(struct kvm_vcpu *vcpu, -+ struct kvm_segment *var, int seg) -+{ -+ return kvm_arch_ops->set_segment(vcpu, var, seg); -+} -+ -+static int kvm_dev_ioctl_set_sregs(struct kvm *kvm, struct kvm_sregs *sregs) -+{ -+ struct kvm_vcpu *vcpu; -+ int mmu_reset_needed = 0; -+ int i; -+ struct descriptor_table dt; -+ -+ if (sregs->vcpu < 0 || sregs->vcpu >= KVM_MAX_VCPUS) -+ return -EINVAL; -+ vcpu = vcpu_load(kvm, sregs->vcpu); -+ if (!vcpu) -+ return -ENOENT; -+ -+ set_segment(vcpu, &sregs->cs, VCPU_SREG_CS); -+ set_segment(vcpu, &sregs->ds, VCPU_SREG_DS); -+ set_segment(vcpu, &sregs->es, VCPU_SREG_ES); -+ set_segment(vcpu, &sregs->fs, VCPU_SREG_FS); -+ set_segment(vcpu, &sregs->gs, VCPU_SREG_GS); -+ set_segment(vcpu, &sregs->ss, VCPU_SREG_SS); -+ -+ set_segment(vcpu, &sregs->tr, VCPU_SREG_TR); -+ set_segment(vcpu, &sregs->ldt, VCPU_SREG_LDTR); -+ -+ dt.limit = sregs->idt.limit; -+ dt.base = sregs->idt.base; -+ kvm_arch_ops->set_idt(vcpu, &dt); -+ dt.limit = sregs->gdt.limit; -+ dt.base = sregs->gdt.base; -+ kvm_arch_ops->set_gdt(vcpu, &dt); -+ -+ vcpu->cr2 = sregs->cr2; -+ mmu_reset_needed |= vcpu->cr3 != sregs->cr3; -+ vcpu->cr3 = sregs->cr3; -+ -+ vcpu->cr8 = sregs->cr8; -+ -+ mmu_reset_needed |= vcpu->shadow_efer != sregs->efer; -+#ifdef __x86_64__ -+ kvm_arch_ops->set_efer(vcpu, sregs->efer); -+#endif -+ vcpu->apic_base = sregs->apic_base; -+ -+ mmu_reset_needed |= vcpu->cr0 != sregs->cr0; -+ kvm_arch_ops->set_cr0_no_modeswitch(vcpu, sregs->cr0); -+ -+ mmu_reset_needed |= vcpu->cr4 != sregs->cr4; -+ kvm_arch_ops->set_cr4(vcpu, sregs->cr4); -+ -+ if (mmu_reset_needed) -+ kvm_mmu_reset_context(vcpu); -+ -+ memcpy(vcpu->irq_pending, sregs->interrupt_bitmap, -+ sizeof vcpu->irq_pending); -+ vcpu->irq_summary = 0; -+ for (i = 0; i < NR_IRQ_WORDS; ++i) -+ if (vcpu->irq_pending[i]) -+ __set_bit(i, &vcpu->irq_summary); -+ -+ vcpu_put(vcpu); -+ -+ return 0; -+} -+ -+/* -+ * List of msr numbers which we expose to userspace through KVM_GET_MSRS -+ * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST. -+ */ -+static u32 msrs_to_save[] = { -+ MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, -+ MSR_K6_STAR, -+#ifdef __x86_64__ -+ MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, -+#endif -+ MSR_IA32_TIME_STAMP_COUNTER, -+}; -+ -+ -+/* -+ * Adapt set_msr() to msr_io()'s calling convention -+ */ -+static int do_set_msr(struct kvm_vcpu *vcpu, unsigned index, u64 *data) -+{ -+ return set_msr(vcpu, index, *data); -+} -+ -+/* -+ * Read or write a bunch of msrs. All parameters are kernel addresses. -+ * -+ * @return number of msrs set successfully. -+ */ -+static int __msr_io(struct kvm *kvm, struct kvm_msrs *msrs, -+ struct kvm_msr_entry *entries, -+ int (*do_msr)(struct kvm_vcpu *vcpu, -+ unsigned index, u64 *data)) -+{ -+ struct kvm_vcpu *vcpu; -+ int i; -+ -+ if (msrs->vcpu < 0 || msrs->vcpu >= KVM_MAX_VCPUS) -+ return -EINVAL; -+ -+ vcpu = vcpu_load(kvm, msrs->vcpu); -+ if (!vcpu) -+ return -ENOENT; -+ -+ for (i = 0; i < msrs->nmsrs; ++i) -+ if (do_msr(vcpu, entries[i].index, &entries[i].data)) -+ break; -+ -+ vcpu_put(vcpu); -+ -+ return i; -+} -+ -+/* -+ * Read or write a bunch of msrs. Parameters are user addresses. -+ * -+ * @return number of msrs set successfully. -+ */ -+static int msr_io(struct kvm *kvm, struct kvm_msrs __user *user_msrs, -+ int (*do_msr)(struct kvm_vcpu *vcpu, -+ unsigned index, u64 *data), -+ int writeback) -+{ -+ struct kvm_msrs msrs; -+ struct kvm_msr_entry *entries; -+ int r, n; -+ unsigned size; -+ -+ r = -EFAULT; -+ if (copy_from_user(&msrs, user_msrs, sizeof msrs)) -+ goto out; -+ -+ r = -E2BIG; -+ if (msrs.nmsrs >= MAX_IO_MSRS) -+ goto out; -+ -+ r = -ENOMEM; -+ size = sizeof(struct kvm_msr_entry) * msrs.nmsrs; -+ entries = vmalloc(size); -+ if (!entries) -+ goto out; -+ -+ r = -EFAULT; -+ if (copy_from_user(entries, user_msrs->entries, size)) -+ goto out_free; -+ -+ r = n = __msr_io(kvm, &msrs, entries, do_msr); -+ if (r < 0) -+ goto out_free; -+ -+ r = -EFAULT; -+ if (writeback && copy_to_user(user_msrs->entries, entries, size)) -+ goto out_free; -+ -+ r = n; -+ -+out_free: -+ vfree(entries); -+out: -+ return r; -+} -+ -+/* -+ * Translate a guest virtual address to a guest physical address. -+ */ -+static int kvm_dev_ioctl_translate(struct kvm *kvm, struct kvm_translation *tr) -+{ -+ unsigned long vaddr = tr->linear_address; -+ struct kvm_vcpu *vcpu; -+ gpa_t gpa; -+ -+ vcpu = vcpu_load(kvm, tr->vcpu); -+ if (!vcpu) -+ return -ENOENT; -+ spin_lock(&kvm->lock); -+ gpa = vcpu->mmu.gva_to_gpa(vcpu, vaddr); -+ tr->physical_address = gpa; -+ tr->valid = gpa != UNMAPPED_GVA; -+ tr->writeable = 1; -+ tr->usermode = 0; -+ spin_unlock(&kvm->lock); -+ vcpu_put(vcpu); -+ -+ return 0; -+} -+ -+static int kvm_dev_ioctl_interrupt(struct kvm *kvm, struct kvm_interrupt *irq) -+{ -+ struct kvm_vcpu *vcpu; -+ -+ if (irq->vcpu < 0 || irq->vcpu >= KVM_MAX_VCPUS) -+ return -EINVAL; -+ if (irq->irq < 0 || irq->irq >= 256) -+ return -EINVAL; -+ vcpu = vcpu_load(kvm, irq->vcpu); -+ if (!vcpu) -+ return -ENOENT; -+ -+ set_bit(irq->irq, vcpu->irq_pending); -+ set_bit(irq->irq / BITS_PER_LONG, &vcpu->irq_summary); -+ -+ vcpu_put(vcpu); -+ -+ return 0; -+} -+ -+static int kvm_dev_ioctl_debug_guest(struct kvm *kvm, -+ struct kvm_debug_guest *dbg) -+{ -+ struct kvm_vcpu *vcpu; -+ int r; -+ -+ if (dbg->vcpu < 0 || dbg->vcpu >= KVM_MAX_VCPUS) -+ return -EINVAL; -+ vcpu = vcpu_load(kvm, dbg->vcpu); -+ if (!vcpu) -+ return -ENOENT; -+ -+ r = kvm_arch_ops->set_guest_debug(vcpu, dbg); -+ -+ vcpu_put(vcpu); -+ -+ return r; -+} -+ -+static long kvm_dev_ioctl(struct file *filp, -+ unsigned int ioctl, unsigned long arg) -+{ -+ struct kvm *kvm = filp->private_data; -+ int r = -EINVAL; -+ -+ switch (ioctl) { -+ case KVM_CREATE_VCPU: { -+ r = kvm_dev_ioctl_create_vcpu(kvm, arg); -+ if (r) -+ goto out; -+ break; -+ } -+ case KVM_RUN: { -+ struct kvm_run kvm_run; -+ -+ r = -EFAULT; -+ if (copy_from_user(&kvm_run, (void *)arg, sizeof kvm_run)) -+ goto out; -+ r = kvm_dev_ioctl_run(kvm, &kvm_run); -+ if (r < 0) -+ goto out; -+ r = -EFAULT; -+ if (copy_to_user((void *)arg, &kvm_run, sizeof kvm_run)) -+ goto out; -+ r = 0; -+ break; -+ } -+ case KVM_GET_REGS: { -+ struct kvm_regs kvm_regs; -+ -+ r = -EFAULT; -+ if (copy_from_user(&kvm_regs, (void *)arg, sizeof kvm_regs)) -+ goto out; -+ r = kvm_dev_ioctl_get_regs(kvm, &kvm_regs); -+ if (r) -+ goto out; -+ r = -EFAULT; -+ if (copy_to_user((void *)arg, &kvm_regs, sizeof kvm_regs)) -+ goto out; -+ r = 0; -+ break; -+ } -+ case KVM_SET_REGS: { -+ struct kvm_regs kvm_regs; -+ -+ r = -EFAULT; -+ if (copy_from_user(&kvm_regs, (void *)arg, sizeof kvm_regs)) -+ goto out; -+ r = kvm_dev_ioctl_set_regs(kvm, &kvm_regs); -+ if (r) -+ goto out; -+ r = 0; -+ break; -+ } -+ case KVM_GET_SREGS: { -+ struct kvm_sregs kvm_sregs; -+ -+ r = -EFAULT; -+ if (copy_from_user(&kvm_sregs, (void *)arg, sizeof kvm_sregs)) -+ goto out; -+ r = kvm_dev_ioctl_get_sregs(kvm, &kvm_sregs); -+ if (r) -+ goto out; -+ r = -EFAULT; -+ if (copy_to_user((void *)arg, &kvm_sregs, sizeof kvm_sregs)) -+ goto out; -+ r = 0; -+ break; -+ } -+ case KVM_SET_SREGS: { -+ struct kvm_sregs kvm_sregs; -+ -+ r = -EFAULT; -+ if (copy_from_user(&kvm_sregs, (void *)arg, sizeof kvm_sregs)) -+ goto out; -+ r = kvm_dev_ioctl_set_sregs(kvm, &kvm_sregs); -+ if (r) -+ goto out; -+ r = 0; -+ break; -+ } -+ case KVM_TRANSLATE: { -+ struct kvm_translation tr; -+ -+ r = -EFAULT; -+ if (copy_from_user(&tr, (void *)arg, sizeof tr)) -+ goto out; -+ r = kvm_dev_ioctl_translate(kvm, &tr); -+ if (r) -+ goto out; -+ r = -EFAULT; -+ if (copy_to_user((void *)arg, &tr, sizeof tr)) -+ goto out; -+ r = 0; -+ break; -+ } -+ case KVM_INTERRUPT: { -+ struct kvm_interrupt irq; -+ -+ r = -EFAULT; -+ if (copy_from_user(&irq, (void *)arg, sizeof irq)) -+ goto out; -+ r = kvm_dev_ioctl_interrupt(kvm, &irq); -+ if (r) -+ goto out; -+ r = 0; -+ break; -+ } -+ case KVM_DEBUG_GUEST: { -+ struct kvm_debug_guest dbg; -+ -+ r = -EFAULT; -+ if (copy_from_user(&dbg, (void *)arg, sizeof dbg)) -+ goto out; -+ r = kvm_dev_ioctl_debug_guest(kvm, &dbg); -+ if (r) -+ goto out; -+ r = 0; -+ break; -+ } -+ case KVM_SET_MEMORY_REGION: { -+ struct kvm_memory_region kvm_mem; -+ -+ r = -EFAULT; -+ if (copy_from_user(&kvm_mem, (void *)arg, sizeof kvm_mem)) -+ goto out; -+ r = kvm_dev_ioctl_set_memory_region(kvm, &kvm_mem); -+ if (r) -+ goto out; -+ break; -+ } -+ case KVM_GET_DIRTY_LOG: { -+ struct kvm_dirty_log log; -+ -+ r = -EFAULT; -+ if (copy_from_user(&log, (void *)arg, sizeof log)) -+ goto out; -+ r = kvm_dev_ioctl_get_dirty_log(kvm, &log); -+ if (r) -+ goto out; -+ break; -+ } -+ case KVM_GET_MSRS: -+ r = msr_io(kvm, (void __user *)arg, get_msr, 1); -+ break; -+ case KVM_SET_MSRS: -+ r = msr_io(kvm, (void __user *)arg, do_set_msr, 0); -+ break; -+ case KVM_GET_MSR_INDEX_LIST: { -+ struct kvm_msr_list __user *user_msr_list = (void __user *)arg; -+ struct kvm_msr_list msr_list; -+ unsigned n; -+ -+ r = -EFAULT; -+ if (copy_from_user(&msr_list, user_msr_list, sizeof msr_list)) -+ goto out; -+ n = msr_list.nmsrs; -+ msr_list.nmsrs = ARRAY_SIZE(msrs_to_save); -+ if (copy_to_user(user_msr_list, &msr_list, sizeof msr_list)) -+ goto out; -+ r = -E2BIG; -+ if (n < ARRAY_SIZE(msrs_to_save)) -+ goto out; -+ r = -EFAULT; -+ if (copy_to_user(user_msr_list->indices, &msrs_to_save, -+ sizeof msrs_to_save)) -+ goto out; -+ r = 0; -+ } -+ default: -+ ; -+ } -+out: -+ return r; -+} -+ -+static struct page *kvm_dev_nopage(struct vm_area_struct *vma, -+ unsigned long address, -+ int *type) -+{ -+ struct kvm *kvm = vma->vm_file->private_data; -+ unsigned long pgoff; -+ struct kvm_memory_slot *slot; -+ struct page *page; -+ -+ *type = VM_FAULT_MINOR; -+ pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; -+ slot = gfn_to_memslot(kvm, pgoff); -+ if (!slot) -+ return NOPAGE_SIGBUS; -+ page = gfn_to_page(slot, pgoff); -+ if (!page) -+ return NOPAGE_SIGBUS; -+ get_page(page); -+ return page; -+} -+ -+static struct vm_operations_struct kvm_dev_vm_ops = { -+ .nopage = kvm_dev_nopage, -+}; -+ -+static int kvm_dev_mmap(struct file *file, struct vm_area_struct *vma) -+{ -+ vma->vm_ops = &kvm_dev_vm_ops; -+ return 0; -+} -+ -+static struct file_operations kvm_chardev_ops = { -+ .open = kvm_dev_open, -+ .release = kvm_dev_release, -+ .unlocked_ioctl = kvm_dev_ioctl, -+ .compat_ioctl = kvm_dev_ioctl, -+ .mmap = kvm_dev_mmap, -+}; -+ -+static struct miscdevice kvm_dev = { -+ MISC_DYNAMIC_MINOR, -+ "kvm", -+ &kvm_chardev_ops, -+}; -+ -+static int kvm_reboot(struct notifier_block *notifier, unsigned long val, -+ void *v) -+{ -+ if (val == SYS_RESTART) { -+ /* -+ * Some (well, at least mine) BIOSes hang on reboot if -+ * in vmx root mode. -+ */ -+ printk(KERN_INFO "kvm: exiting hardware virtualization\n"); -+ on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); -+ } -+ return NOTIFY_OK; -+} -+ -+static struct notifier_block kvm_reboot_notifier = { -+ .notifier_call = kvm_reboot, -+ .priority = 0, -+}; -+ -+static __init void kvm_init_debug(void) -+{ -+ struct kvm_stats_debugfs_item *p; -+ -+ debugfs_dir = debugfs_create_dir("kvm", 0); -+ for (p = debugfs_entries; p->name; ++p) -+ p->dentry = debugfs_create_u32(p->name, 0444, debugfs_dir, -+ p->data); -+} -+ -+static void kvm_exit_debug(void) -+{ -+ struct kvm_stats_debugfs_item *p; -+ -+ for (p = debugfs_entries; p->name; ++p) -+ debugfs_remove(p->dentry); -+ debugfs_remove(debugfs_dir); -+} -+ -+hpa_t bad_page_address; -+ -+int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module) -+{ -+ int r; -+ -+ kvm_arch_ops = ops; -+ -+ if (!kvm_arch_ops->cpu_has_kvm_support()) { -+ printk(KERN_ERR "kvm: no hardware support\n"); -+ return -EOPNOTSUPP; -+ } -+ if (kvm_arch_ops->disabled_by_bios()) { -+ printk(KERN_ERR "kvm: disabled by bios\n"); -+ return -EOPNOTSUPP; -+ } -+ -+ r = kvm_arch_ops->hardware_setup(); -+ if (r < 0) -+ return r; -+ -+ on_each_cpu(kvm_arch_ops->hardware_enable, 0, 0, 1); -+ register_reboot_notifier(&kvm_reboot_notifier); -+ -+ kvm_chardev_ops.owner = module; -+ -+ r = misc_register(&kvm_dev); -+ if (r) { -+ printk (KERN_ERR "kvm: misc device register failed\n"); -+ goto out_free; -+ } -+ -+ return r; -+ -+out_free: -+ unregister_reboot_notifier(&kvm_reboot_notifier); -+ on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); -+ kvm_arch_ops->hardware_unsetup(); -+ return r; -+} -+ -+void kvm_exit_arch(void) -+{ -+ misc_deregister(&kvm_dev); -+ -+ unregister_reboot_notifier(&kvm_reboot_notifier); -+ on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1); -+ kvm_arch_ops->hardware_unsetup(); -+} -+ -+static __init int kvm_init(void) -+{ -+ static struct page *bad_page; -+ int r = 0; -+ -+ kvm_init_debug(); -+ -+ if ((bad_page = alloc_page(GFP_KERNEL)) == NULL) { -+ r = -ENOMEM; -+ goto out; -+ } -+ -+ bad_page_address = page_to_pfn(bad_page) << PAGE_SHIFT; -+ memset(__va(bad_page_address), 0, PAGE_SIZE); -+ -+ return r; -+ -+out: -+ kvm_exit_debug(); -+ return r; -+} -+ -+static __exit void kvm_exit(void) -+{ -+ kvm_exit_debug(); -+ __free_page(pfn_to_page(bad_page_address >> PAGE_SHIFT)); -+} -+ -+module_init(kvm_init) -+module_exit(kvm_exit) -+ -+EXPORT_SYMBOL_GPL(kvm_init_arch); -+EXPORT_SYMBOL_GPL(kvm_exit_arch); ---- /dev/null -+++ b/drivers/kvm/kvm_svm.h -@@ -0,0 +1,44 @@ -+#ifndef __KVM_SVM_H -+#define __KVM_SVM_H -+ -+#include -+#include -+#include -+ -+#include "svm.h" -+#include "kvm.h" -+ -+static const u32 host_save_msrs[] = { -+#ifdef __x86_64__ -+ MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE, -+ MSR_FS_BASE, MSR_GS_BASE, -+#endif -+ MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, -+ MSR_IA32_DEBUGCTLMSR, /*MSR_IA32_LASTBRANCHFROMIP, -+ MSR_IA32_LASTBRANCHTOIP, MSR_IA32_LASTINTFROMIP,MSR_IA32_LASTINTTOIP,*/ -+}; -+ -+#define NR_HOST_SAVE_MSRS (sizeof(host_save_msrs) / sizeof(*host_save_msrs)) -+#define NUM_DB_REGS 4 -+ -+struct vcpu_svm { -+ struct vmcb *vmcb; -+ unsigned long vmcb_pa; -+ struct svm_cpu_data *svm_data; -+ uint64_t asid_generation; -+ -+ unsigned long cr0; -+ unsigned long cr4; -+ unsigned long db_regs[NUM_DB_REGS]; -+ -+ u64 next_rip; -+ -+ u64 host_msrs[NR_HOST_SAVE_MSRS]; -+ unsigned long host_cr2; -+ unsigned long host_db_regs[NUM_DB_REGS]; -+ unsigned long host_dr6; -+ unsigned long host_dr7; -+}; -+ -+#endif -+ ---- /dev/null -+++ b/drivers/kvm/kvm_vmx.h -@@ -0,0 +1,14 @@ -+#ifndef __KVM_VMX_H -+#define __KVM_VMX_H -+ -+#ifdef __x86_64__ -+/* -+ * avoid save/load MSR_SYSCALL_MASK and MSR_LSTAR by std vt -+ * mechanism (cpu bug AA24) -+ */ -+#define NR_BAD_MSRS 2 -+#else -+#define NR_BAD_MSRS 0 -+#endif -+ -+#endif ---- /dev/null -+++ b/drivers/kvm/mmu.c -@@ -0,0 +1,699 @@ -+/* -+ * Kernel-based Virtual Machine driver for Linux -+ * -+ * This module enables machines with Intel VT-x extensions to run virtual -+ * machines without emulation or binary translation. -+ * -+ * MMU support -+ * -+ * Copyright (C) 2006 Qumranet, Inc. -+ * -+ * Authors: -+ * Yaniv Kamay -+ * Avi Kivity -+ * -+ * This work is licensed under the terms of the GNU GPL, version 2. See -+ * the COPYING file in the top-level directory. -+ * -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "vmx.h" -+#include "kvm.h" -+ -+#define pgprintk(x...) do { } while (0) -+ -+#define ASSERT(x) \ -+ if (!(x)) { \ -+ printk(KERN_WARNING "assertion failed %s:%d: %s\n", \ -+ __FILE__, __LINE__, #x); \ -+ } -+ -+#define PT64_ENT_PER_PAGE 512 -+#define PT32_ENT_PER_PAGE 1024 -+ -+#define PT_WRITABLE_SHIFT 1 -+ -+#define PT_PRESENT_MASK (1ULL << 0) -+#define PT_WRITABLE_MASK (1ULL << PT_WRITABLE_SHIFT) -+#define PT_USER_MASK (1ULL << 2) -+#define PT_PWT_MASK (1ULL << 3) -+#define PT_PCD_MASK (1ULL << 4) -+#define PT_ACCESSED_MASK (1ULL << 5) -+#define PT_DIRTY_MASK (1ULL << 6) -+#define PT_PAGE_SIZE_MASK (1ULL << 7) -+#define PT_PAT_MASK (1ULL << 7) -+#define PT_GLOBAL_MASK (1ULL << 8) -+#define PT64_NX_MASK (1ULL << 63) -+ -+#define PT_PAT_SHIFT 7 -+#define PT_DIR_PAT_SHIFT 12 -+#define PT_DIR_PAT_MASK (1ULL << PT_DIR_PAT_SHIFT) -+ -+#define PT32_DIR_PSE36_SIZE 4 -+#define PT32_DIR_PSE36_SHIFT 13 -+#define PT32_DIR_PSE36_MASK (((1ULL << PT32_DIR_PSE36_SIZE) - 1) << PT32_DIR_PSE36_SHIFT) -+ -+ -+#define PT32_PTE_COPY_MASK \ -+ (PT_PRESENT_MASK | PT_PWT_MASK | PT_PCD_MASK | \ -+ PT_ACCESSED_MASK | PT_DIRTY_MASK | PT_PAT_MASK | \ -+ PT_GLOBAL_MASK ) -+ -+#define PT32_NON_PTE_COPY_MASK \ -+ (PT_PRESENT_MASK | PT_PWT_MASK | PT_PCD_MASK | \ -+ PT_ACCESSED_MASK | PT_DIRTY_MASK) -+ -+ -+#define PT64_PTE_COPY_MASK \ -+ (PT64_NX_MASK | PT32_PTE_COPY_MASK) -+ -+#define PT64_NON_PTE_COPY_MASK \ -+ (PT64_NX_MASK | PT32_NON_PTE_COPY_MASK) -+ -+ -+ -+#define PT_FIRST_AVAIL_BITS_SHIFT 9 -+#define PT64_SECOND_AVAIL_BITS_SHIFT 52 -+ -+#define PT_SHADOW_PS_MARK (1ULL << PT_FIRST_AVAIL_BITS_SHIFT) -+#define PT_SHADOW_IO_MARK (1ULL << PT_FIRST_AVAIL_BITS_SHIFT) -+ -+#define PT_SHADOW_WRITABLE_SHIFT (PT_FIRST_AVAIL_BITS_SHIFT + 1) -+#define PT_SHADOW_WRITABLE_MASK (1ULL << PT_SHADOW_WRITABLE_SHIFT) -+ -+#define PT_SHADOW_USER_SHIFT (PT_SHADOW_WRITABLE_SHIFT + 1) -+#define PT_SHADOW_USER_MASK (1ULL << (PT_SHADOW_USER_SHIFT)) -+ -+#define PT_SHADOW_BITS_OFFSET (PT_SHADOW_WRITABLE_SHIFT - PT_WRITABLE_SHIFT) -+ -+#define VALID_PAGE(x) ((x) != INVALID_PAGE) -+ -+#define PT64_LEVEL_BITS 9 -+ -+#define PT64_LEVEL_SHIFT(level) \ -+ ( PAGE_SHIFT + (level - 1) * PT64_LEVEL_BITS ) -+ -+#define PT64_LEVEL_MASK(level) \ -+ (((1ULL << PT64_LEVEL_BITS) - 1) << PT64_LEVEL_SHIFT(level)) -+ -+#define PT64_INDEX(address, level)\ -+ (((address) >> PT64_LEVEL_SHIFT(level)) & ((1 << PT64_LEVEL_BITS) - 1)) -+ -+ -+#define PT32_LEVEL_BITS 10 -+ -+#define PT32_LEVEL_SHIFT(level) \ -+ ( PAGE_SHIFT + (level - 1) * PT32_LEVEL_BITS ) -+ -+#define PT32_LEVEL_MASK(level) \ -+ (((1ULL << PT32_LEVEL_BITS) - 1) << PT32_LEVEL_SHIFT(level)) -+ -+#define PT32_INDEX(address, level)\ -+ (((address) >> PT32_LEVEL_SHIFT(level)) & ((1 << PT32_LEVEL_BITS) - 1)) -+ -+ -+#define PT64_BASE_ADDR_MASK (((1ULL << 52) - 1) & PAGE_MASK) -+#define PT64_DIR_BASE_ADDR_MASK \ -+ (PT64_BASE_ADDR_MASK & ~((1ULL << (PAGE_SHIFT + PT64_LEVEL_BITS)) - 1)) -+ -+#define PT32_BASE_ADDR_MASK PAGE_MASK -+#define PT32_DIR_BASE_ADDR_MASK \ -+ (PAGE_MASK & ~((1ULL << (PAGE_SHIFT + PT32_LEVEL_BITS)) - 1)) -+ -+ -+#define PFERR_PRESENT_MASK (1U << 0) -+#define PFERR_WRITE_MASK (1U << 1) -+#define PFERR_USER_MASK (1U << 2) -+ -+#define PT64_ROOT_LEVEL 4 -+#define PT32_ROOT_LEVEL 2 -+#define PT32E_ROOT_LEVEL 3 -+ -+#define PT_DIRECTORY_LEVEL 2 -+#define PT_PAGE_TABLE_LEVEL 1 -+ -+static int is_write_protection(struct kvm_vcpu *vcpu) -+{ -+ return vcpu->cr0 & CR0_WP_MASK; -+} -+ -+static int is_cpuid_PSE36(void) -+{ -+ return 1; -+} -+ -+static int is_present_pte(unsigned long pte) -+{ -+ return pte & PT_PRESENT_MASK; -+} -+ -+static int is_writeble_pte(unsigned long pte) -+{ -+ return pte & PT_WRITABLE_MASK; -+} -+ -+static int is_io_pte(unsigned long pte) -+{ -+ return pte & PT_SHADOW_IO_MARK; -+} -+ -+static void kvm_mmu_free_page(struct kvm_vcpu *vcpu, hpa_t page_hpa) -+{ -+ struct kvm_mmu_page *page_head = page_header(page_hpa); -+ -+ list_del(&page_head->link); -+ page_head->page_hpa = page_hpa; -+ list_add(&page_head->link, &vcpu->free_pages); -+} -+ -+static int is_empty_shadow_page(hpa_t page_hpa) -+{ -+ u32 *pos; -+ u32 *end; -+ for (pos = __va(page_hpa), end = pos + PAGE_SIZE / sizeof(u32); -+ pos != end; pos++) -+ if (*pos != 0) -+ return 0; -+ return 1; -+} -+ -+static hpa_t kvm_mmu_alloc_page(struct kvm_vcpu *vcpu, u64 *parent_pte) -+{ -+ struct kvm_mmu_page *page; -+ -+ if (list_empty(&vcpu->free_pages)) -+ return INVALID_PAGE; -+ -+ page = list_entry(vcpu->free_pages.next, struct kvm_mmu_page, link); -+ list_del(&page->link); -+ list_add(&page->link, &vcpu->kvm->active_mmu_pages); -+ ASSERT(is_empty_shadow_page(page->page_hpa)); -+ page->slot_bitmap = 0; -+ page->global = 1; -+ page->parent_pte = parent_pte; -+ return page->page_hpa; -+} -+ -+static void page_header_update_slot(struct kvm *kvm, void *pte, gpa_t gpa) -+{ -+ int slot = memslot_id(kvm, gfn_to_memslot(kvm, gpa >> PAGE_SHIFT)); -+ struct kvm_mmu_page *page_head = page_header(__pa(pte)); -+ -+ __set_bit(slot, &page_head->slot_bitmap); -+} -+ -+hpa_t safe_gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa) -+{ -+ hpa_t hpa = gpa_to_hpa(vcpu, gpa); -+ -+ return is_error_hpa(hpa) ? bad_page_address | (gpa & ~PAGE_MASK): hpa; -+} -+ -+hpa_t gpa_to_hpa(struct kvm_vcpu *vcpu, gpa_t gpa) -+{ -+ struct kvm_memory_slot *slot; -+ struct page *page; -+ -+ ASSERT((gpa & HPA_ERR_MASK) == 0); -+ slot = gfn_to_memslot(vcpu->kvm, gpa >> PAGE_SHIFT); -+ if (!slot) -+ return gpa | HPA_ERR_MASK; -+ page = gfn_to_page(slot, gpa >> PAGE_SHIFT); -+ return ((hpa_t)page_to_pfn(page) << PAGE_SHIFT) -+ | (gpa & (PAGE_SIZE-1)); -+} -+ -+hpa_t gva_to_hpa(struct kvm_vcpu *vcpu, gva_t gva) -+{ -+ gpa_t gpa = vcpu->mmu.gva_to_gpa(vcpu, gva); -+ -+ if (gpa == UNMAPPED_GVA) -+ return UNMAPPED_GVA; -+ return gpa_to_hpa(vcpu, gpa); -+} -+ -+ -+static void release_pt_page_64(struct kvm_vcpu *vcpu, hpa_t page_hpa, -+ int level) -+{ -+ ASSERT(vcpu); -+ ASSERT(VALID_PAGE(page_hpa)); -+ ASSERT(level <= PT64_ROOT_LEVEL && level > 0); -+ -+ if (level == 1) -+ memset(__va(page_hpa), 0, PAGE_SIZE); -+ else { -+ u64 *pos; -+ u64 *end; -+ -+ for (pos = __va(page_hpa), end = pos + PT64_ENT_PER_PAGE; -+ pos != end; pos++) { -+ u64 current_ent = *pos; -+ -+ *pos = 0; -+ if (is_present_pte(current_ent)) -+ release_pt_page_64(vcpu, -+ current_ent & -+ PT64_BASE_ADDR_MASK, -+ level - 1); -+ } -+ } -+ kvm_mmu_free_page(vcpu, page_hpa); -+} -+ -+static void nonpaging_new_cr3(struct kvm_vcpu *vcpu) -+{ -+} -+ -+static int nonpaging_map(struct kvm_vcpu *vcpu, gva_t v, hpa_t p) -+{ -+ int level = PT32E_ROOT_LEVEL; -+ hpa_t table_addr = vcpu->mmu.root_hpa; -+ -+ for (; ; level--) { -+ u32 index = PT64_INDEX(v, level); -+ u64 *table; -+ -+ ASSERT(VALID_PAGE(table_addr)); -+ table = __va(table_addr); -+ -+ if (level == 1) { -+ mark_page_dirty(vcpu->kvm, v >> PAGE_SHIFT); -+ page_header_update_slot(vcpu->kvm, table, v); -+ table[index] = p | PT_PRESENT_MASK | PT_WRITABLE_MASK | -+ PT_USER_MASK; -+ return 0; -+ } -+ -+ if (table[index] == 0) { -+ hpa_t new_table = kvm_mmu_alloc_page(vcpu, -+ &table[index]); -+ -+ if (!VALID_PAGE(new_table)) { -+ pgprintk("nonpaging_map: ENOMEM\n"); -+ return -ENOMEM; -+ } -+ -+ if (level == PT32E_ROOT_LEVEL) -+ table[index] = new_table | PT_PRESENT_MASK; -+ else -+ table[index] = new_table | PT_PRESENT_MASK | -+ PT_WRITABLE_MASK | PT_USER_MASK; -+ } -+ table_addr = table[index] & PT64_BASE_ADDR_MASK; -+ } -+} -+ -+static void nonpaging_flush(struct kvm_vcpu *vcpu) -+{ -+ hpa_t root = vcpu->mmu.root_hpa; -+ -+ ++kvm_stat.tlb_flush; -+ pgprintk("nonpaging_flush\n"); -+ ASSERT(VALID_PAGE(root)); -+ release_pt_page_64(vcpu, root, vcpu->mmu.shadow_root_level); -+ root = kvm_mmu_alloc_page(vcpu, NULL); -+ ASSERT(VALID_PAGE(root)); -+ vcpu->mmu.root_hpa = root; -+ if (is_paging(vcpu)) -+ root |= (vcpu->cr3 & (CR3_PCD_MASK | CR3_WPT_MASK)); -+ kvm_arch_ops->set_cr3(vcpu, root); -+ kvm_arch_ops->tlb_flush(vcpu); -+} -+ -+static gpa_t nonpaging_gva_to_gpa(struct kvm_vcpu *vcpu, gva_t vaddr) -+{ -+ return vaddr; -+} -+ -+static int nonpaging_page_fault(struct kvm_vcpu *vcpu, gva_t gva, -+ u32 error_code) -+{ -+ int ret; -+ gpa_t addr = gva; -+ -+ ASSERT(vcpu); -+ ASSERT(VALID_PAGE(vcpu->mmu.root_hpa)); -+ -+ for (;;) { -+ hpa_t paddr; -+ -+ paddr = gpa_to_hpa(vcpu , addr & PT64_BASE_ADDR_MASK); -+ -+ if (is_error_hpa(paddr)) -+ return 1; -+ -+ ret = nonpaging_map(vcpu, addr & PAGE_MASK, paddr); -+ if (ret) { -+ nonpaging_flush(vcpu); -+ continue; -+ } -+ break; -+ } -+ return ret; -+} -+ -+static void nonpaging_inval_page(struct kvm_vcpu *vcpu, gva_t addr) -+{ -+} -+ -+static void nonpaging_free(struct kvm_vcpu *vcpu) -+{ -+ hpa_t root; -+ -+ ASSERT(vcpu); -+ root = vcpu->mmu.root_hpa; -+ if (VALID_PAGE(root)) -+ release_pt_page_64(vcpu, root, vcpu->mmu.shadow_root_level); -+ vcpu->mmu.root_hpa = INVALID_PAGE; -+} -+ -+static int nonpaging_init_context(struct kvm_vcpu *vcpu) -+{ -+ struct kvm_mmu *context = &vcpu->mmu; -+ -+ context->new_cr3 = nonpaging_new_cr3; -+ context->page_fault = nonpaging_page_fault; -+ context->inval_page = nonpaging_inval_page; -+ context->gva_to_gpa = nonpaging_gva_to_gpa; -+ context->free = nonpaging_free; -+ context->root_level = PT32E_ROOT_LEVEL; -+ context->shadow_root_level = PT32E_ROOT_LEVEL; -+ context->root_hpa = kvm_mmu_alloc_page(vcpu, NULL); -+ ASSERT(VALID_PAGE(context->root_hpa)); -+ kvm_arch_ops->set_cr3(vcpu, context->root_hpa); -+ return 0; -+} -+ -+ -+static void kvm_mmu_flush_tlb(struct kvm_vcpu *vcpu) -+{ -+ struct kvm_mmu_page *page, *npage; -+ -+ list_for_each_entry_safe(page, npage, &vcpu->kvm->active_mmu_pages, -+ link) { -+ if (page->global) -+ continue; -+ -+ if (!page->parent_pte) -+ continue; -+ -+ *page->parent_pte = 0; -+ release_pt_page_64(vcpu, page->page_hpa, 1); -+ } -+ ++kvm_stat.tlb_flush; -+ kvm_arch_ops->tlb_flush(vcpu); -+} -+ -+static void paging_new_cr3(struct kvm_vcpu *vcpu) -+{ -+ kvm_mmu_flush_tlb(vcpu); -+} -+ -+static void mark_pagetable_nonglobal(void *shadow_pte) -+{ -+ page_header(__pa(shadow_pte))->global = 0; -+} -+ -+static inline void set_pte_common(struct kvm_vcpu *vcpu, -+ u64 *shadow_pte, -+ gpa_t gaddr, -+ int dirty, -+ u64 access_bits) -+{ -+ hpa_t paddr; -+ -+ *shadow_pte |= access_bits << PT_SHADOW_BITS_OFFSET; -+ if (!dirty) -+ access_bits &= ~PT_WRITABLE_MASK; -+ -+ if (access_bits & PT_WRITABLE_MASK) -+ mark_page_dirty(vcpu->kvm, gaddr >> PAGE_SHIFT); -+ -+ *shadow_pte |= access_bits; -+ -+ paddr = gpa_to_hpa(vcpu, gaddr & PT64_BASE_ADDR_MASK); -+ -+ if (!(*shadow_pte & PT_GLOBAL_MASK)) -+ mark_pagetable_nonglobal(shadow_pte); -+ -+ if (is_error_hpa(paddr)) { -+ *shadow_pte |= gaddr; -+ *shadow_pte |= PT_SHADOW_IO_MARK; -+ *shadow_pte &= ~PT_PRESENT_MASK; -+ } else { -+ *shadow_pte |= paddr; -+ page_header_update_slot(vcpu->kvm, shadow_pte, gaddr); -+ } -+} -+ -+static void inject_page_fault(struct kvm_vcpu *vcpu, -+ u64 addr, -+ u32 err_code) -+{ -+ kvm_arch_ops->inject_page_fault(vcpu, addr, err_code); -+} -+ -+static inline int fix_read_pf(u64 *shadow_ent) -+{ -+ if ((*shadow_ent & PT_SHADOW_USER_MASK) && -+ !(*shadow_ent & PT_USER_MASK)) { -+ /* -+ * If supervisor write protect is disabled, we shadow kernel -+ * pages as user pages so we can trap the write access. -+ */ -+ *shadow_ent |= PT_USER_MASK; -+ *shadow_ent &= ~PT_WRITABLE_MASK; -+ -+ return 1; -+ -+ } -+ return 0; -+} -+ -+static int may_access(u64 pte, int write, int user) -+{ -+ -+ if (user && !(pte & PT_USER_MASK)) -+ return 0; -+ if (write && !(pte & PT_WRITABLE_MASK)) -+ return 0; -+ return 1; -+} -+ -+/* -+ * Remove a shadow pte. -+ */ -+static void paging_inval_page(struct kvm_vcpu *vcpu, gva_t addr) -+{ -+ hpa_t page_addr = vcpu->mmu.root_hpa; -+ int level = vcpu->mmu.shadow_root_level; -+ -+ ++kvm_stat.invlpg; -+ -+ for (; ; level--) { -+ u32 index = PT64_INDEX(addr, level); -+ u64 *table = __va(page_addr); -+ -+ if (level == PT_PAGE_TABLE_LEVEL ) { -+ table[index] = 0; -+ return; -+ } -+ -+ if (!is_present_pte(table[index])) -+ return; -+ -+ page_addr = table[index] & PT64_BASE_ADDR_MASK; -+ -+ if (level == PT_DIRECTORY_LEVEL && -+ (table[index] & PT_SHADOW_PS_MARK)) { -+ table[index] = 0; -+ release_pt_page_64(vcpu, page_addr, PT_PAGE_TABLE_LEVEL); -+ -+ kvm_arch_ops->tlb_flush(vcpu); -+ return; -+ } -+ } -+} -+ -+static void paging_free(struct kvm_vcpu *vcpu) -+{ -+ nonpaging_free(vcpu); -+} -+ -+#define PTTYPE 64 -+#include "paging_tmpl.h" -+#undef PTTYPE -+ -+#define PTTYPE 32 -+#include "paging_tmpl.h" -+#undef PTTYPE -+ -+static int paging64_init_context(struct kvm_vcpu *vcpu) -+{ -+ struct kvm_mmu *context = &vcpu->mmu; -+ -+ ASSERT(is_pae(vcpu)); -+ context->new_cr3 = paging_new_cr3; -+ context->page_fault = paging64_page_fault; -+ context->inval_page = paging_inval_page; -+ context->gva_to_gpa = paging64_gva_to_gpa; -+ context->free = paging_free; -+ context->root_level = PT64_ROOT_LEVEL; -+ context->shadow_root_level = PT64_ROOT_LEVEL; -+ context->root_hpa = kvm_mmu_alloc_page(vcpu, NULL); -+ ASSERT(VALID_PAGE(context->root_hpa)); -+ kvm_arch_ops->set_cr3(vcpu, context->root_hpa | -+ (vcpu->cr3 & (CR3_PCD_MASK | CR3_WPT_MASK))); -+ return 0; -+} -+ -+static int paging32_init_context(struct kvm_vcpu *vcpu) -+{ -+ struct kvm_mmu *context = &vcpu->mmu; -+ -+ context->new_cr3 = paging_new_cr3; -+ context->page_fault = paging32_page_fault; -+ context->inval_page = paging_inval_page; -+ context->gva_to_gpa = paging32_gva_to_gpa; -+ context->free = paging_free; -+ context->root_level = PT32_ROOT_LEVEL; -+ context->shadow_root_level = PT32E_ROOT_LEVEL; -+ context->root_hpa = kvm_mmu_alloc_page(vcpu, NULL); -+ ASSERT(VALID_PAGE(context->root_hpa)); -+ kvm_arch_ops->set_cr3(vcpu, context->root_hpa | -+ (vcpu->cr3 & (CR3_PCD_MASK | CR3_WPT_MASK))); -+ return 0; -+} -+ -+static int paging32E_init_context(struct kvm_vcpu *vcpu) -+{ -+ int ret; -+ -+ if ((ret = paging64_init_context(vcpu))) -+ return ret; -+ -+ vcpu->mmu.root_level = PT32E_ROOT_LEVEL; -+ vcpu->mmu.shadow_root_level = PT32E_ROOT_LEVEL; -+ return 0; -+} -+ -+static int init_kvm_mmu(struct kvm_vcpu *vcpu) -+{ -+ ASSERT(vcpu); -+ ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa)); -+ -+ if (!is_paging(vcpu)) -+ return nonpaging_init_context(vcpu); -+ else if (kvm_arch_ops->is_long_mode(vcpu)) -+ return paging64_init_context(vcpu); -+ else if (is_pae(vcpu)) -+ return paging32E_init_context(vcpu); -+ else -+ return paging32_init_context(vcpu); -+} -+ -+static void destroy_kvm_mmu(struct kvm_vcpu *vcpu) -+{ -+ ASSERT(vcpu); -+ if (VALID_PAGE(vcpu->mmu.root_hpa)) { -+ vcpu->mmu.free(vcpu); -+ vcpu->mmu.root_hpa = INVALID_PAGE; -+ } -+} -+ -+int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) -+{ -+ destroy_kvm_mmu(vcpu); -+ return init_kvm_mmu(vcpu); -+} -+ -+static void free_mmu_pages(struct kvm_vcpu *vcpu) -+{ -+ while (!list_empty(&vcpu->free_pages)) { -+ struct kvm_mmu_page *page; -+ -+ page = list_entry(vcpu->free_pages.next, -+ struct kvm_mmu_page, link); -+ list_del(&page->link); -+ __free_page(pfn_to_page(page->page_hpa >> PAGE_SHIFT)); -+ page->page_hpa = INVALID_PAGE; -+ } -+} -+ -+static int alloc_mmu_pages(struct kvm_vcpu *vcpu) -+{ -+ int i; -+ -+ ASSERT(vcpu); -+ -+ for (i = 0; i < KVM_NUM_MMU_PAGES; i++) { -+ struct page *page; -+ struct kvm_mmu_page *page_header = &vcpu->page_header_buf[i]; -+ -+ INIT_LIST_HEAD(&page_header->link); -+ if ((page = alloc_page(GFP_KVM_MMU)) == NULL) -+ goto error_1; -+ page->private = (unsigned long)page_header; -+ page_header->page_hpa = (hpa_t)page_to_pfn(page) << PAGE_SHIFT; -+ memset(__va(page_header->page_hpa), 0, PAGE_SIZE); -+ list_add(&page_header->link, &vcpu->free_pages); -+ } -+ return 0; -+ -+error_1: -+ free_mmu_pages(vcpu); -+ return -ENOMEM; -+} -+ -+int kvm_mmu_init(struct kvm_vcpu *vcpu) -+{ -+ int r; -+ -+ ASSERT(vcpu); -+ ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa)); -+ ASSERT(list_empty(&vcpu->free_pages)); -+ -+ if ((r = alloc_mmu_pages(vcpu))) -+ return r; -+ -+ if ((r = init_kvm_mmu(vcpu))) { -+ free_mmu_pages(vcpu); -+ return r; -+ } -+ return 0; -+} -+ -+void kvm_mmu_destroy(struct kvm_vcpu *vcpu) -+{ -+ ASSERT(vcpu); -+ -+ destroy_kvm_mmu(vcpu); -+ free_mmu_pages(vcpu); -+} -+ -+void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot) -+{ -+ struct kvm_mmu_page *page; -+ -+ list_for_each_entry(page, &kvm->active_mmu_pages, link) { -+ int i; -+ u64 *pt; -+ -+ if (!test_bit(slot, &page->slot_bitmap)) -+ continue; -+ -+ pt = __va(page->page_hpa); -+ for (i = 0; i < PT64_ENT_PER_PAGE; ++i) -+ /* avoid RMW */ -+ if (pt[i] & PT_WRITABLE_MASK) -+ pt[i] &= ~PT_WRITABLE_MASK; -+ -+ } -+} ---- /dev/null -+++ b/drivers/kvm/paging_tmpl.h -@@ -0,0 +1,397 @@ -+/* -+ * Kernel-based Virtual Machine driver for Linux -+ * -+ * This module enables machines with Intel VT-x extensions to run virtual -+ * machines without emulation or binary translation. -+ * -+ * MMU support -+ * -+ * Copyright (C) 2006 Qumranet, Inc. -+ * -+ * Authors: -+ * Yaniv Kamay -+ * Avi Kivity -+ * -+ * This work is licensed under the terms of the GNU GPL, version 2. See -+ * the COPYING file in the top-level directory. -+ * -+ */ -+ -+/* -+ * We need the mmu code to access both 32-bit and 64-bit guest ptes, -+ * so the code in this file is compiled twice, once per pte size. -+ */ -+ -+#if PTTYPE == 64 -+ #define pt_element_t u64 -+ #define guest_walker guest_walker64 -+ #define FNAME(name) paging##64_##name -+ #define PT_BASE_ADDR_MASK PT64_BASE_ADDR_MASK -+ #define PT_DIR_BASE_ADDR_MASK PT64_DIR_BASE_ADDR_MASK -+ #define PT_INDEX(addr, level) PT64_INDEX(addr, level) -+ #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) -+ #define PT_LEVEL_MASK(level) PT64_LEVEL_MASK(level) -+ #define PT_PTE_COPY_MASK PT64_PTE_COPY_MASK -+ #define PT_NON_PTE_COPY_MASK PT64_NON_PTE_COPY_MASK -+#elif PTTYPE == 32 -+ #define pt_element_t u32 -+ #define guest_walker guest_walker32 -+ #define FNAME(name) paging##32_##name -+ #define PT_BASE_ADDR_MASK PT32_BASE_ADDR_MASK -+ #define PT_DIR_BASE_ADDR_MASK PT32_DIR_BASE_ADDR_MASK -+ #define PT_INDEX(addr, level) PT32_INDEX(addr, level) -+ #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) -+ #define PT_LEVEL_MASK(level) PT32_LEVEL_MASK(level) -+ #define PT_PTE_COPY_MASK PT32_PTE_COPY_MASK -+ #define PT_NON_PTE_COPY_MASK PT32_NON_PTE_COPY_MASK -+#else -+ #error Invalid PTTYPE value -+#endif -+ -+/* -+ * The guest_walker structure emulates the behavior of the hardware page -+ * table walker. -+ */ -+struct guest_walker { -+ int level; -+ pt_element_t *table; -+ pt_element_t inherited_ar; -+}; -+ -+static void FNAME(init_walker)(struct guest_walker *walker, -+ struct kvm_vcpu *vcpu) -+{ -+ hpa_t hpa; -+ struct kvm_memory_slot *slot; -+ -+ walker->level = vcpu->mmu.root_level; -+ slot = gfn_to_memslot(vcpu->kvm, -+ (vcpu->cr3 & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT); -+ hpa = safe_gpa_to_hpa(vcpu, vcpu->cr3 & PT64_BASE_ADDR_MASK); -+ walker->table = kmap_atomic(pfn_to_page(hpa >> PAGE_SHIFT), KM_USER0); -+ -+ ASSERT((!kvm_arch_ops->is_long_mode(vcpu) && is_pae(vcpu)) || -+ (vcpu->cr3 & ~(PAGE_MASK | CR3_FLAGS_MASK)) == 0); -+ -+ walker->table = (pt_element_t *)( (unsigned long)walker->table | -+ (unsigned long)(vcpu->cr3 & ~(PAGE_MASK | CR3_FLAGS_MASK)) ); -+ walker->inherited_ar = PT_USER_MASK | PT_WRITABLE_MASK; -+} -+ -+static void FNAME(release_walker)(struct guest_walker *walker) -+{ -+ kunmap_atomic(walker->table, KM_USER0); -+} -+ -+static void FNAME(set_pte)(struct kvm_vcpu *vcpu, u64 guest_pte, -+ u64 *shadow_pte, u64 access_bits) -+{ -+ ASSERT(*shadow_pte == 0); -+ access_bits &= guest_pte; -+ *shadow_pte = (guest_pte & PT_PTE_COPY_MASK); -+ set_pte_common(vcpu, shadow_pte, guest_pte & PT_BASE_ADDR_MASK, -+ guest_pte & PT_DIRTY_MASK, access_bits); -+} -+ -+static void FNAME(set_pde)(struct kvm_vcpu *vcpu, u64 guest_pde, -+ u64 *shadow_pte, u64 access_bits, -+ int index) -+{ -+ gpa_t gaddr; -+ -+ ASSERT(*shadow_pte == 0); -+ access_bits &= guest_pde; -+ gaddr = (guest_pde & PT_DIR_BASE_ADDR_MASK) + PAGE_SIZE * index; -+ if (PTTYPE == 32 && is_cpuid_PSE36()) -+ gaddr |= (guest_pde & PT32_DIR_PSE36_MASK) << -+ (32 - PT32_DIR_PSE36_SHIFT); -+ *shadow_pte = (guest_pde & (PT_NON_PTE_COPY_MASK | PT_GLOBAL_MASK)) | -+ ((guest_pde & PT_DIR_PAT_MASK) >> -+ (PT_DIR_PAT_SHIFT - PT_PAT_SHIFT)); -+ set_pte_common(vcpu, shadow_pte, gaddr, -+ guest_pde & PT_DIRTY_MASK, access_bits); -+} -+ -+/* -+ * Fetch a guest pte from a specific level in the paging hierarchy. -+ */ -+static pt_element_t *FNAME(fetch_guest)(struct kvm_vcpu *vcpu, -+ struct guest_walker *walker, -+ int level, -+ gva_t addr) -+{ -+ -+ ASSERT(level > 0 && level <= walker->level); -+ -+ for (;;) { -+ int index = PT_INDEX(addr, walker->level); -+ hpa_t paddr; -+ -+ ASSERT(((unsigned long)walker->table & PAGE_MASK) == -+ ((unsigned long)&walker->table[index] & PAGE_MASK)); -+ if (level == walker->level || -+ !is_present_pte(walker->table[index]) || -+ (walker->level == PT_DIRECTORY_LEVEL && -+ (walker->table[index] & PT_PAGE_SIZE_MASK) && -+ (PTTYPE == 64 || is_pse(vcpu)))) -+ return &walker->table[index]; -+ if (walker->level != 3 || kvm_arch_ops->is_long_mode(vcpu)) -+ walker->inherited_ar &= walker->table[index]; -+ paddr = safe_gpa_to_hpa(vcpu, walker->table[index] & PT_BASE_ADDR_MASK); -+ kunmap_atomic(walker->table, KM_USER0); -+ walker->table = kmap_atomic(pfn_to_page(paddr >> PAGE_SHIFT), -+ KM_USER0); -+ --walker->level; -+ } -+} -+ -+/* -+ * Fetch a shadow pte for a specific level in the paging hierarchy. -+ */ -+static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, -+ struct guest_walker *walker) -+{ -+ hpa_t shadow_addr; -+ int level; -+ u64 *prev_shadow_ent = NULL; -+ -+ shadow_addr = vcpu->mmu.root_hpa; -+ level = vcpu->mmu.shadow_root_level; -+ -+ for (; ; level--) { -+ u32 index = SHADOW_PT_INDEX(addr, level); -+ u64 *shadow_ent = ((u64 *)__va(shadow_addr)) + index; -+ pt_element_t *guest_ent; -+ -+ if (is_present_pte(*shadow_ent) || is_io_pte(*shadow_ent)) { -+ if (level == PT_PAGE_TABLE_LEVEL) -+ return shadow_ent; -+ shadow_addr = *shadow_ent & PT64_BASE_ADDR_MASK; -+ prev_shadow_ent = shadow_ent; -+ continue; -+ } -+ -+ if (PTTYPE == 32 && level > PT32_ROOT_LEVEL) { -+ ASSERT(level == PT32E_ROOT_LEVEL); -+ guest_ent = FNAME(fetch_guest)(vcpu, walker, -+ PT32_ROOT_LEVEL, addr); -+ } else -+ guest_ent = FNAME(fetch_guest)(vcpu, walker, -+ level, addr); -+ -+ if (!is_present_pte(*guest_ent)) -+ return NULL; -+ -+ /* Don't set accessed bit on PAE PDPTRs */ -+ if (vcpu->mmu.root_level != 3 || walker->level != 3) -+ *guest_ent |= PT_ACCESSED_MASK; -+ -+ if (level == PT_PAGE_TABLE_LEVEL) { -+ -+ if (walker->level == PT_DIRECTORY_LEVEL) { -+ if (prev_shadow_ent) -+ *prev_shadow_ent |= PT_SHADOW_PS_MARK; -+ FNAME(set_pde)(vcpu, *guest_ent, shadow_ent, -+ walker->inherited_ar, -+ PT_INDEX(addr, PT_PAGE_TABLE_LEVEL)); -+ } else { -+ ASSERT(walker->level == PT_PAGE_TABLE_LEVEL); -+ FNAME(set_pte)(vcpu, *guest_ent, shadow_ent, walker->inherited_ar); -+ } -+ return shadow_ent; -+ } -+ -+ shadow_addr = kvm_mmu_alloc_page(vcpu, shadow_ent); -+ if (!VALID_PAGE(shadow_addr)) -+ return ERR_PTR(-ENOMEM); -+ if (!kvm_arch_ops->is_long_mode(vcpu) && level == 3) -+ *shadow_ent = shadow_addr | -+ (*guest_ent & (PT_PRESENT_MASK | PT_PWT_MASK | PT_PCD_MASK)); -+ else { -+ *shadow_ent = shadow_addr | -+ (*guest_ent & PT_NON_PTE_COPY_MASK); -+ *shadow_ent |= (PT_WRITABLE_MASK | PT_USER_MASK); -+ } -+ prev_shadow_ent = shadow_ent; -+ } -+} -+ -+/* -+ * The guest faulted for write. We need to -+ * -+ * - check write permissions -+ * - update the guest pte dirty bit -+ * - update our own dirty page tracking structures -+ */ -+static int FNAME(fix_write_pf)(struct kvm_vcpu *vcpu, -+ u64 *shadow_ent, -+ struct guest_walker *walker, -+ gva_t addr, -+ int user) -+{ -+ pt_element_t *guest_ent; -+ int writable_shadow; -+ gfn_t gfn; -+ -+ if (is_writeble_pte(*shadow_ent)) -+ return 0; -+ -+ writable_shadow = *shadow_ent & PT_SHADOW_WRITABLE_MASK; -+ if (user) { -+ /* -+ * User mode access. Fail if it's a kernel page or a read-only -+ * page. -+ */ -+ if (!(*shadow_ent & PT_SHADOW_USER_MASK) || !writable_shadow) -+ return 0; -+ ASSERT(*shadow_ent & PT_USER_MASK); -+ } else -+ /* -+ * Kernel mode access. Fail if it's a read-only page and -+ * supervisor write protection is enabled. -+ */ -+ if (!writable_shadow) { -+ if (is_write_protection(vcpu)) -+ return 0; -+ *shadow_ent &= ~PT_USER_MASK; -+ } -+ -+ guest_ent = FNAME(fetch_guest)(vcpu, walker, PT_PAGE_TABLE_LEVEL, addr); -+ -+ if (!is_present_pte(*guest_ent)) { -+ *shadow_ent = 0; -+ return 0; -+ } -+ -+ gfn = (*guest_ent & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT; -+ mark_page_dirty(vcpu->kvm, gfn); -+ *shadow_ent |= PT_WRITABLE_MASK; -+ *guest_ent |= PT_DIRTY_MASK; -+ -+ return 1; -+} -+ -+/* -+ * Page fault handler. There are several causes for a page fault: -+ * - there is no shadow pte for the guest pte -+ * - write access through a shadow pte marked read only so that we can set -+ * the dirty bit -+ * - write access to a shadow pte marked read only so we can update the page -+ * dirty bitmap, when userspace requests it -+ * - mmio access; in this case we will never install a present shadow pte -+ * - normal guest page fault due to the guest pte marked not present, not -+ * writable, or not executable -+ * -+ * Returns: 1 if we need to emulate the instruction, 0 otherwise -+ */ -+static int FNAME(page_fault)(struct kvm_vcpu *vcpu, gva_t addr, -+ u32 error_code) -+{ -+ int write_fault = error_code & PFERR_WRITE_MASK; -+ int pte_present = error_code & PFERR_PRESENT_MASK; -+ int user_fault = error_code & PFERR_USER_MASK; -+ struct guest_walker walker; -+ u64 *shadow_pte; -+ int fixed; -+ -+ /* -+ * Look up the shadow pte for the faulting address. -+ */ -+ for (;;) { -+ FNAME(init_walker)(&walker, vcpu); -+ shadow_pte = FNAME(fetch)(vcpu, addr, &walker); -+ if (IS_ERR(shadow_pte)) { /* must be -ENOMEM */ -+ nonpaging_flush(vcpu); -+ FNAME(release_walker)(&walker); -+ continue; -+ } -+ break; -+ } -+ -+ /* -+ * The page is not mapped by the guest. Let the guest handle it. -+ */ -+ if (!shadow_pte) { -+ inject_page_fault(vcpu, addr, error_code); -+ FNAME(release_walker)(&walker); -+ return 0; -+ } -+ -+ /* -+ * Update the shadow pte. -+ */ -+ if (write_fault) -+ fixed = FNAME(fix_write_pf)(vcpu, shadow_pte, &walker, addr, -+ user_fault); -+ else -+ fixed = fix_read_pf(shadow_pte); -+ -+ FNAME(release_walker)(&walker); -+ -+ /* -+ * mmio: emulate if accessible, otherwise its a guest fault. -+ */ -+ if (is_io_pte(*shadow_pte)) { -+ if (may_access(*shadow_pte, write_fault, user_fault)) -+ return 1; -+ pgprintk("%s: io work, no access\n", __FUNCTION__); -+ inject_page_fault(vcpu, addr, -+ error_code | PFERR_PRESENT_MASK); -+ return 0; -+ } -+ -+ /* -+ * pte not present, guest page fault. -+ */ -+ if (pte_present && !fixed) { -+ inject_page_fault(vcpu, addr, error_code); -+ return 0; -+ } -+ -+ ++kvm_stat.pf_fixed; -+ -+ return 0; -+} -+ -+static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr) -+{ -+ struct guest_walker walker; -+ pt_element_t guest_pte; -+ gpa_t gpa; -+ -+ FNAME(init_walker)(&walker, vcpu); -+ guest_pte = *FNAME(fetch_guest)(vcpu, &walker, PT_PAGE_TABLE_LEVEL, -+ vaddr); -+ FNAME(release_walker)(&walker); -+ -+ if (!is_present_pte(guest_pte)) -+ return UNMAPPED_GVA; -+ -+ if (walker.level == PT_DIRECTORY_LEVEL) { -+ ASSERT((guest_pte & PT_PAGE_SIZE_MASK)); -+ ASSERT(PTTYPE == 64 || is_pse(vcpu)); -+ -+ gpa = (guest_pte & PT_DIR_BASE_ADDR_MASK) | (vaddr & -+ (PT_LEVEL_MASK(PT_PAGE_TABLE_LEVEL) | ~PAGE_MASK)); -+ -+ if (PTTYPE == 32 && is_cpuid_PSE36()) -+ gpa |= (guest_pte & PT32_DIR_PSE36_MASK) << -+ (32 - PT32_DIR_PSE36_SHIFT); -+ } else { -+ gpa = (guest_pte & PT_BASE_ADDR_MASK); -+ gpa |= (vaddr & ~PAGE_MASK); -+ } -+ -+ return gpa; -+} -+ -+#undef pt_element_t -+#undef guest_walker -+#undef FNAME -+#undef PT_BASE_ADDR_MASK -+#undef PT_INDEX -+#undef SHADOW_PT_INDEX -+#undef PT_LEVEL_MASK -+#undef PT_PTE_COPY_MASK -+#undef PT_NON_PTE_COPY_MASK -+#undef PT_DIR_BASE_ADDR_MASK ---- /dev/null -+++ b/drivers/kvm/segment_descriptor.h -@@ -0,0 +1,17 @@ -+struct segment_descriptor { -+ u16 limit_low; -+ u16 base_low; -+ u8 base_mid; -+ u8 type : 4; -+ u8 system : 1; -+ u8 dpl : 2; -+ u8 present : 1; -+ u8 limit_high : 4; -+ u8 avl : 1; -+ u8 long_mode : 1; -+ u8 default_op : 1; -+ u8 granularity : 1; -+ u8 base_high; -+} __attribute__((packed)); -+ -+ ---- /dev/null -+++ b/drivers/kvm/svm.c -@@ -0,0 +1,1677 @@ -+/* -+ * Kernel-based Virtual Machine driver for Linux -+ * -+ * AMD SVM support -+ * -+ * Copyright (C) 2006 Qumranet, Inc. -+ * -+ * Authors: -+ * Yaniv Kamay -+ * Avi Kivity -+ * -+ * This work is licensed under the terms of the GNU GPL, version 2. See -+ * the COPYING file in the top-level directory. -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include "kvm_svm.h" -+#include "x86_emulate.h" -+ -+MODULE_AUTHOR("Qumranet"); -+MODULE_LICENSE("GPL"); -+ -+#define IOPM_ALLOC_ORDER 2 -+#define MSRPM_ALLOC_ORDER 1 -+ -+#define DB_VECTOR 1 -+#define UD_VECTOR 6 -+#define GP_VECTOR 13 -+ -+#define DR7_GD_MASK (1 << 13) -+#define DR6_BD_MASK (1 << 13) -+#define CR4_DE_MASK (1UL << 3) -+ -+#define SEG_TYPE_LDT 2 -+#define SEG_TYPE_BUSY_TSS16 3 -+ -+#define KVM_EFER_LMA (1 << 10) -+#define KVM_EFER_LME (1 << 8) -+ -+unsigned long iopm_base; -+unsigned long msrpm_base; -+ -+struct kvm_ldttss_desc { -+ u16 limit0; -+ u16 base0; -+ unsigned base1 : 8, type : 5, dpl : 2, p : 1; -+ unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8; -+ u32 base3; -+ u32 zero1; -+} __attribute__((packed)); -+ -+struct svm_cpu_data { -+ int cpu; -+ -+ uint64_t asid_generation; -+ uint32_t max_asid; -+ uint32_t next_asid; -+ struct kvm_ldttss_desc *tss_desc; -+ -+ struct page *save_area; -+}; -+ -+static DEFINE_PER_CPU(struct svm_cpu_data *, svm_data); -+ -+struct svm_init_data { -+ int cpu; -+ int r; -+}; -+ -+static u32 msrpm_ranges[] = {0, 0xc0000000, 0xc0010000}; -+ -+#define NUM_MSR_MAPS (sizeof(msrpm_ranges) / sizeof(*msrpm_ranges)) -+#define MSRS_RANGE_SIZE 2048 -+#define MSRS_IN_RANGE (MSRS_RANGE_SIZE * 8 / 2) -+ -+#define MAX_INST_SIZE 15 -+ -+static unsigned get_addr_size(struct kvm_vcpu *vcpu) -+{ -+ struct vmcb_save_area *sa = &vcpu->svm->vmcb->save; -+ u16 cs_attrib; -+ -+ if (!(sa->cr0 & CR0_PE_MASK) || (sa->rflags & X86_EFLAGS_VM)) -+ return 2; -+ -+ cs_attrib = sa->cs.attrib; -+ -+ return (cs_attrib & SVM_SELECTOR_L_MASK) ? 8 : -+ (cs_attrib & SVM_SELECTOR_DB_MASK) ? 4 : 2; -+} -+ -+static inline u8 pop_irq(struct kvm_vcpu *vcpu) -+{ -+ int word_index = __ffs(vcpu->irq_summary); -+ int bit_index = __ffs(vcpu->irq_pending[word_index]); -+ int irq = word_index * BITS_PER_LONG + bit_index; -+ -+ clear_bit(bit_index, &vcpu->irq_pending[word_index]); -+ if (!vcpu->irq_pending[word_index]) -+ clear_bit(word_index, &vcpu->irq_summary); -+ return irq; -+} -+ -+static inline void push_irq(struct kvm_vcpu *vcpu, u8 irq) -+{ -+ set_bit(irq, vcpu->irq_pending); -+ set_bit(irq / BITS_PER_LONG, &vcpu->irq_summary); -+} -+ -+static inline void clgi(void) -+{ -+ asm volatile (SVM_CLGI); -+} -+ -+static inline void stgi(void) -+{ -+ asm volatile (SVM_STGI); -+} -+ -+static inline void invlpga(unsigned long addr, u32 asid) -+{ -+ asm volatile (SVM_INVLPGA :: "a"(addr), "c"(asid)); -+} -+ -+static inline unsigned long kvm_read_cr2(void) -+{ -+ unsigned long cr2; -+ -+ asm volatile ("mov %%cr2, %0" : "=r" (cr2)); -+ return cr2; -+} -+ -+static inline void kvm_write_cr2(unsigned long val) -+{ -+ asm volatile ("mov %0, %%cr2" :: "r" (val)); -+} -+ -+static inline unsigned long read_dr6(void) -+{ -+ unsigned long dr6; -+ -+ asm volatile ("mov %%dr6, %0" : "=r" (dr6)); -+ return dr6; -+} -+ -+static inline void write_dr6(unsigned long val) -+{ -+ asm volatile ("mov %0, %%dr6" :: "r" (val)); -+} -+ -+static inline unsigned long read_dr7(void) -+{ -+ unsigned long dr7; -+ -+ asm volatile ("mov %%dr7, %0" : "=r" (dr7)); -+ return dr7; -+} -+ -+static inline void write_dr7(unsigned long val) -+{ -+ asm volatile ("mov %0, %%dr7" :: "r" (val)); -+} -+ -+static inline int svm_is_long_mode(struct kvm_vcpu *vcpu) -+{ -+ return vcpu->svm->vmcb->save.efer & KVM_EFER_LMA; -+} -+ -+static inline void force_new_asid(struct kvm_vcpu *vcpu) -+{ -+ vcpu->svm->asid_generation--; -+} -+ -+static inline void flush_guest_tlb(struct kvm_vcpu *vcpu) -+{ -+ force_new_asid(vcpu); -+} -+ -+static void svm_set_efer(struct kvm_vcpu *vcpu, u64 efer) -+{ -+ if (!(efer & KVM_EFER_LMA)) -+ efer &= ~KVM_EFER_LME; -+ -+ vcpu->svm->vmcb->save.efer = efer | MSR_EFER_SVME_MASK; -+ vcpu->shadow_efer = efer; -+} -+ -+static void svm_inject_gp(struct kvm_vcpu *vcpu, unsigned error_code) -+{ -+ vcpu->svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | -+ SVM_EVTINJ_VALID_ERR | -+ SVM_EVTINJ_TYPE_EXEPT | -+ GP_VECTOR; -+ vcpu->svm->vmcb->control.event_inj_err = error_code; -+} -+ -+static void inject_ud(struct kvm_vcpu *vcpu) -+{ -+ vcpu->svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | -+ SVM_EVTINJ_TYPE_EXEPT | -+ UD_VECTOR; -+} -+ -+static void inject_db(struct kvm_vcpu *vcpu) -+{ -+ vcpu->svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | -+ SVM_EVTINJ_TYPE_EXEPT | -+ DB_VECTOR; -+} -+ -+static int is_page_fault(uint32_t info) -+{ -+ info &= SVM_EVTINJ_VEC_MASK | SVM_EVTINJ_TYPE_MASK | SVM_EVTINJ_VALID; -+ return info == (PF_VECTOR | SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_EXEPT); -+} -+ -+static int is_external_interrupt(u32 info) -+{ -+ info &= SVM_EVTINJ_TYPE_MASK | SVM_EVTINJ_VALID; -+ return info == (SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_INTR); -+} -+ -+static void skip_emulated_instruction(struct kvm_vcpu *vcpu) -+{ -+ if (!vcpu->svm->next_rip) { -+ printk(KERN_DEBUG "%s: NOP\n", __FUNCTION__); -+ return; -+ } -+ if (vcpu->svm->next_rip - vcpu->svm->vmcb->save.rip > 15) { -+ printk(KERN_ERR "%s: ip 0x%llx next 0x%llx\n", -+ __FUNCTION__, -+ vcpu->svm->vmcb->save.rip, -+ vcpu->svm->next_rip); -+ } -+ -+ vcpu->rip = vcpu->svm->vmcb->save.rip = vcpu->svm->next_rip; -+ vcpu->svm->vmcb->control.int_state &= ~SVM_INTERRUPT_SHADOW_MASK; -+} -+ -+static int has_svm(void) -+{ -+ uint32_t eax, ebx, ecx, edx; -+ -+ if (current_cpu_data.x86_vendor != X86_VENDOR_AMD) { -+ printk(KERN_INFO "has_svm: not amd\n"); -+ return 0; -+ } -+ -+ cpuid(0x80000000, &eax, &ebx, &ecx, &edx); -+ if (eax < SVM_CPUID_FUNC) { -+ printk(KERN_INFO "has_svm: can't execute cpuid_8000000a\n"); -+ return 0; -+ } -+ -+ cpuid(0x80000001, &eax, &ebx, &ecx, &edx); -+ if (!(ecx & (1 << SVM_CPUID_FEATURE_SHIFT))) { -+ printk(KERN_DEBUG "has_svm: svm not available\n"); -+ return 0; -+ } -+ return 1; -+} -+ -+static void svm_hardware_disable(void *garbage) -+{ -+ struct svm_cpu_data *svm_data -+ = per_cpu(svm_data, raw_smp_processor_id()); -+ -+ if (svm_data) { -+ uint64_t efer; -+ -+ wrmsrl(MSR_VM_HSAVE_PA, 0); -+ rdmsrl(MSR_EFER, efer); -+ wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK); -+ per_cpu(svm_data, raw_smp_processor_id()) = 0; -+ __free_page(svm_data->save_area); -+ kfree(svm_data); -+ } -+} -+ -+static void svm_hardware_enable(void *garbage) -+{ -+ -+ struct svm_cpu_data *svm_data; -+ uint64_t efer; -+#ifdef __x86_64__ -+ struct desc_ptr gdt_descr; -+#else -+ struct Xgt_desc_struct gdt_descr; -+#endif -+ struct desc_struct *gdt; -+ int me = raw_smp_processor_id(); -+ -+ if (!has_svm()) { -+ printk(KERN_ERR "svm_cpu_init: err EOPNOTSUPP on %d\n", me); -+ return; -+ } -+ svm_data = per_cpu(svm_data, me); -+ -+ if (!svm_data) { -+ printk(KERN_ERR "svm_cpu_init: svm_data is NULL on %d\n", -+ me); -+ return; -+ } -+ -+ svm_data->asid_generation = 1; -+ svm_data->max_asid = cpuid_ebx(SVM_CPUID_FUNC) - 1; -+ svm_data->next_asid = svm_data->max_asid + 1; -+ -+ asm volatile ( "sgdt %0" : "=m"(gdt_descr) ); -+ gdt = (struct desc_struct *)gdt_descr.address; -+ svm_data->tss_desc = (struct kvm_ldttss_desc *)(gdt + GDT_ENTRY_TSS); -+ -+ rdmsrl(MSR_EFER, efer); -+ wrmsrl(MSR_EFER, efer | MSR_EFER_SVME_MASK); -+ -+ wrmsrl(MSR_VM_HSAVE_PA, -+ page_to_pfn(svm_data->save_area) << PAGE_SHIFT); -+} -+ -+static int svm_cpu_init(int cpu) -+{ -+ struct svm_cpu_data *svm_data; -+ int r; -+ -+ svm_data = kzalloc(sizeof(struct svm_cpu_data), GFP_KERNEL); -+ if (!svm_data) -+ return -ENOMEM; -+ svm_data->cpu = cpu; -+ svm_data->save_area = alloc_page(GFP_KERNEL); -+ r = -ENOMEM; -+ if (!svm_data->save_area) -+ goto err_1; -+ -+ per_cpu(svm_data, cpu) = svm_data; -+ -+ return 0; -+ -+err_1: -+ kfree(svm_data); -+ return r; -+ -+} -+ -+static int set_msr_interception(u32 *msrpm, unsigned msr, -+ int read, int write) -+{ -+ int i; -+ -+ for (i = 0; i < NUM_MSR_MAPS; i++) { -+ if (msr >= msrpm_ranges[i] && -+ msr < msrpm_ranges[i] + MSRS_IN_RANGE) { -+ u32 msr_offset = (i * MSRS_IN_RANGE + msr - -+ msrpm_ranges[i]) * 2; -+ -+ u32 *base = msrpm + (msr_offset / 32); -+ u32 msr_shift = msr_offset % 32; -+ u32 mask = ((write) ? 0 : 2) | ((read) ? 0 : 1); -+ *base = (*base & ~(0x3 << msr_shift)) | -+ (mask << msr_shift); -+ return 1; -+ } -+ } -+ printk(KERN_DEBUG "%s: not found 0x%x\n", __FUNCTION__, msr); -+ return 0; -+} -+ -+static __init int svm_hardware_setup(void) -+{ -+ int cpu; -+ struct page *iopm_pages; -+ struct page *msrpm_pages; -+ void *msrpm_va; -+ int r; -+ -+ -+ iopm_pages = alloc_pages(GFP_KERNEL, IOPM_ALLOC_ORDER); -+ -+ if (!iopm_pages) -+ return -ENOMEM; -+ memset(page_address(iopm_pages), 0xff, -+ PAGE_SIZE * (1 << IOPM_ALLOC_ORDER)); -+ iopm_base = page_to_pfn(iopm_pages) << PAGE_SHIFT; -+ -+ -+ msrpm_pages = alloc_pages(GFP_KERNEL, MSRPM_ALLOC_ORDER); -+ -+ r = -ENOMEM; -+ if (!msrpm_pages) -+ goto err_1; -+ -+ msrpm_va = page_address(msrpm_pages); -+ memset(msrpm_va, 0xff, PAGE_SIZE * (1 << MSRPM_ALLOC_ORDER)); -+ msrpm_base = page_to_pfn(msrpm_pages) << PAGE_SHIFT; -+ -+#ifdef __x86_64__ -+ set_msr_interception(msrpm_va, MSR_GS_BASE, 1, 1); -+ set_msr_interception(msrpm_va, MSR_FS_BASE, 1, 1); -+ set_msr_interception(msrpm_va, MSR_KERNEL_GS_BASE, 1, 1); -+ set_msr_interception(msrpm_va, MSR_STAR, 1, 1); -+ set_msr_interception(msrpm_va, MSR_LSTAR, 1, 1); -+ set_msr_interception(msrpm_va, MSR_CSTAR, 1, 1); -+ set_msr_interception(msrpm_va, MSR_SYSCALL_MASK, 1, 1); -+#endif -+ set_msr_interception(msrpm_va, MSR_IA32_SYSENTER_CS, 1, 1); -+ set_msr_interception(msrpm_va, MSR_IA32_SYSENTER_ESP, 1, 1); -+ set_msr_interception(msrpm_va, MSR_IA32_SYSENTER_EIP, 1, 1); -+ -+ for_each_online_cpu(cpu) { -+ r = svm_cpu_init(cpu); -+ if (r) -+ goto err_2; -+ } -+ return 0; -+ -+err_2: -+ __free_pages(msrpm_pages, MSRPM_ALLOC_ORDER); -+ msrpm_base = 0; -+err_1: -+ __free_pages(iopm_pages, IOPM_ALLOC_ORDER); -+ iopm_base = 0; -+ return r; -+} -+ -+static __exit void svm_hardware_unsetup(void) -+{ -+ __free_pages(pfn_to_page(msrpm_base >> PAGE_SHIFT), MSRPM_ALLOC_ORDER); -+ __free_pages(pfn_to_page(iopm_base >> PAGE_SHIFT), IOPM_ALLOC_ORDER); -+ iopm_base = msrpm_base = 0; -+} -+ -+static void init_seg(struct vmcb_seg *seg) -+{ -+ seg->selector = 0; -+ seg->attrib = SVM_SELECTOR_P_MASK | SVM_SELECTOR_S_MASK | -+ SVM_SELECTOR_WRITE_MASK; /* Read/Write Data Segment */ -+ seg->limit = 0xffff; -+ seg->base = 0; -+} -+ -+static void init_sys_seg(struct vmcb_seg *seg, uint32_t type) -+{ -+ seg->selector = 0; -+ seg->attrib = SVM_SELECTOR_P_MASK | type; -+ seg->limit = 0xffff; -+ seg->base = 0; -+} -+ -+static int svm_vcpu_setup(struct kvm_vcpu *vcpu) -+{ -+ return 0; -+} -+ -+static void init_vmcb(struct vmcb *vmcb) -+{ -+ struct vmcb_control_area *control = &vmcb->control; -+ struct vmcb_save_area *save = &vmcb->save; -+ u64 tsc; -+ -+ control->intercept_cr_read = INTERCEPT_CR0_MASK | -+ INTERCEPT_CR3_MASK | -+ INTERCEPT_CR4_MASK; -+ -+ control->intercept_cr_write = INTERCEPT_CR0_MASK | -+ INTERCEPT_CR3_MASK | -+ INTERCEPT_CR4_MASK; -+ -+ control->intercept_dr_read = INTERCEPT_DR0_MASK | -+ INTERCEPT_DR1_MASK | -+ INTERCEPT_DR2_MASK | -+ INTERCEPT_DR3_MASK; -+ -+ control->intercept_dr_write = INTERCEPT_DR0_MASK | -+ INTERCEPT_DR1_MASK | -+ INTERCEPT_DR2_MASK | -+ INTERCEPT_DR3_MASK | -+ INTERCEPT_DR5_MASK | -+ INTERCEPT_DR7_MASK; -+ -+ control->intercept_exceptions = 1 << PF_VECTOR; -+ -+ -+ control->intercept = (1ULL << INTERCEPT_INTR) | -+ (1ULL << INTERCEPT_NMI) | -+ /* -+ * selective cr0 intercept bug? -+ * 0: 0f 22 d8 mov %eax,%cr3 -+ * 3: 0f 20 c0 mov %cr0,%eax -+ * 6: 0d 00 00 00 80 or $0x80000000,%eax -+ * b: 0f 22 c0 mov %eax,%cr0 -+ * set cr3 ->interception -+ * get cr0 ->interception -+ * set cr0 -> no interception -+ */ -+ /* (1ULL << INTERCEPT_SELECTIVE_CR0) | */ -+ (1ULL << INTERCEPT_CPUID) | -+ (1ULL << INTERCEPT_HLT) | -+ (1ULL << INTERCEPT_INVLPG) | -+ (1ULL << INTERCEPT_INVLPGA) | -+ (1ULL << INTERCEPT_IOIO_PROT) | -+ (1ULL << INTERCEPT_MSR_PROT) | -+ (1ULL << INTERCEPT_TASK_SWITCH) | -+ (1ULL << INTERCEPT_VMRUN) | -+ (1ULL << INTERCEPT_VMMCALL) | -+ (1ULL << INTERCEPT_VMLOAD) | -+ (1ULL << INTERCEPT_VMSAVE) | -+ (1ULL << INTERCEPT_STGI) | -+ (1ULL << INTERCEPT_CLGI) | -+ (1ULL << INTERCEPT_SKINIT); -+ -+ control->iopm_base_pa = iopm_base; -+ control->msrpm_base_pa = msrpm_base; -+ rdtscll(tsc); -+ control->tsc_offset = -tsc; -+ control->int_ctl = V_INTR_MASKING_MASK; -+ -+ init_seg(&save->es); -+ init_seg(&save->ss); -+ init_seg(&save->ds); -+ init_seg(&save->fs); -+ init_seg(&save->gs); -+ -+ save->cs.selector = 0xf000; -+ /* Executable/Readable Code Segment */ -+ save->cs.attrib = SVM_SELECTOR_READ_MASK | SVM_SELECTOR_P_MASK | -+ SVM_SELECTOR_S_MASK | SVM_SELECTOR_CODE_MASK; -+ save->cs.limit = 0xffff; -+ save->cs.base = 0xffff0000; -+ -+ save->gdtr.limit = 0xffff; -+ save->idtr.limit = 0xffff; -+ -+ init_sys_seg(&save->ldtr, SEG_TYPE_LDT); -+ init_sys_seg(&save->tr, SEG_TYPE_BUSY_TSS16); -+ -+ save->efer = MSR_EFER_SVME_MASK; -+ -+ save->dr6 = 0xffff0ff0; -+ save->dr7 = 0x400; -+ save->rflags = 2; -+ save->rip = 0x0000fff0; -+ -+ /* -+ * cr0 val on cpu init should be 0x60000010, we enable cpu -+ * cache by default. the orderly way is to enable cache in bios. -+ */ -+ save->cr0 = 0x00000010 | CR0_PG_MASK; -+ save->cr4 = CR4_PAE_MASK; -+ /* rdx = ?? */ -+} -+ -+static int svm_create_vcpu(struct kvm_vcpu *vcpu) -+{ -+ struct page *page; -+ int r; -+ -+ r = -ENOMEM; -+ vcpu->svm = kzalloc(sizeof *vcpu->svm, GFP_KERNEL); -+ if (!vcpu->svm) -+ goto out1; -+ page = alloc_page(GFP_KERNEL); -+ if (!page) -+ goto out2; -+ -+ vcpu->svm->vmcb = page_address(page); -+ memset(vcpu->svm->vmcb, 0, PAGE_SIZE); -+ vcpu->svm->vmcb_pa = page_to_pfn(page) << PAGE_SHIFT; -+ vcpu->svm->cr0 = 0x00000010; -+ vcpu->svm->asid_generation = 0; -+ memset(vcpu->svm->db_regs, 0, sizeof(vcpu->svm->db_regs)); -+ init_vmcb(vcpu->svm->vmcb); -+ -+ return 0; -+ -+out2: -+ kfree(vcpu->svm); -+out1: -+ return r; -+} -+ -+static void svm_free_vcpu(struct kvm_vcpu *vcpu) -+{ -+ if (!vcpu->svm) -+ return; -+ if (vcpu->svm->vmcb) -+ __free_page(pfn_to_page(vcpu->svm->vmcb_pa >> PAGE_SHIFT)); -+ kfree(vcpu->svm); -+} -+ -+static struct kvm_vcpu *svm_vcpu_load(struct kvm_vcpu *vcpu) -+{ -+ get_cpu(); -+ return vcpu; -+} -+ -+static void svm_vcpu_put(struct kvm_vcpu *vcpu) -+{ -+ put_cpu(); -+} -+ -+static void svm_cache_regs(struct kvm_vcpu *vcpu) -+{ -+ vcpu->regs[VCPU_REGS_RAX] = vcpu->svm->vmcb->save.rax; -+ vcpu->regs[VCPU_REGS_RSP] = vcpu->svm->vmcb->save.rsp; -+ vcpu->rip = vcpu->svm->vmcb->save.rip; -+} -+ -+static void svm_decache_regs(struct kvm_vcpu *vcpu) -+{ -+ vcpu->svm->vmcb->save.rax = vcpu->regs[VCPU_REGS_RAX]; -+ vcpu->svm->vmcb->save.rsp = vcpu->regs[VCPU_REGS_RSP]; -+ vcpu->svm->vmcb->save.rip = vcpu->rip; -+} -+ -+static unsigned long svm_get_rflags(struct kvm_vcpu *vcpu) -+{ -+ return vcpu->svm->vmcb->save.rflags; -+} -+ -+static void svm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags) -+{ -+ vcpu->svm->vmcb->save.rflags = rflags; -+} -+ -+static struct vmcb_seg *svm_seg(struct kvm_vcpu *vcpu, int seg) -+{ -+ struct vmcb_save_area *save = &vcpu->svm->vmcb->save; -+ -+ switch (seg) { -+ case VCPU_SREG_CS: return &save->cs; -+ case VCPU_SREG_DS: return &save->ds; -+ case VCPU_SREG_ES: return &save->es; -+ case VCPU_SREG_FS: return &save->fs; -+ case VCPU_SREG_GS: return &save->gs; -+ case VCPU_SREG_SS: return &save->ss; -+ case VCPU_SREG_TR: return &save->tr; -+ case VCPU_SREG_LDTR: return &save->ldtr; -+ } -+ BUG(); -+ return 0; -+} -+ -+static u64 svm_get_segment_base(struct kvm_vcpu *vcpu, int seg) -+{ -+ struct vmcb_seg *s = svm_seg(vcpu, seg); -+ -+ return s->base; -+} -+ -+static void svm_get_segment(struct kvm_vcpu *vcpu, -+ struct kvm_segment *var, int seg) -+{ -+ struct vmcb_seg *s = svm_seg(vcpu, seg); -+ -+ var->base = s->base; -+ var->limit = s->limit; -+ var->selector = s->selector; -+ var->type = s->attrib & SVM_SELECTOR_TYPE_MASK; -+ var->s = (s->attrib >> SVM_SELECTOR_S_SHIFT) & 1; -+ var->dpl = (s->attrib >> SVM_SELECTOR_DPL_SHIFT) & 3; -+ var->present = (s->attrib >> SVM_SELECTOR_P_SHIFT) & 1; -+ var->avl = (s->attrib >> SVM_SELECTOR_AVL_SHIFT) & 1; -+ var->l = (s->attrib >> SVM_SELECTOR_L_SHIFT) & 1; -+ var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1; -+ var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1; -+ var->unusable = !var->present; -+} -+ -+static void svm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l) -+{ -+ struct vmcb_seg *s = svm_seg(vcpu, VCPU_SREG_CS); -+ -+ *db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1; -+ *l = (s->attrib >> SVM_SELECTOR_L_SHIFT) & 1; -+} -+ -+static void svm_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) -+{ -+ dt->limit = vcpu->svm->vmcb->save.ldtr.limit; -+ dt->base = vcpu->svm->vmcb->save.ldtr.base; -+} -+ -+static void svm_set_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) -+{ -+ vcpu->svm->vmcb->save.ldtr.limit = dt->limit; -+ vcpu->svm->vmcb->save.ldtr.base = dt->base ; -+} -+ -+static void svm_get_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) -+{ -+ dt->limit = vcpu->svm->vmcb->save.gdtr.limit; -+ dt->base = vcpu->svm->vmcb->save.gdtr.base; -+} -+ -+static void svm_set_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) -+{ -+ vcpu->svm->vmcb->save.gdtr.limit = dt->limit; -+ vcpu->svm->vmcb->save.gdtr.base = dt->base ; -+} -+ -+static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) -+{ -+#ifdef __x86_64__ -+ if (vcpu->shadow_efer & KVM_EFER_LME) { -+ if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) { -+ vcpu->shadow_efer |= KVM_EFER_LMA; -+ vcpu->svm->vmcb->save.efer |= KVM_EFER_LMA | KVM_EFER_LME; -+ } -+ -+ if (is_paging(vcpu) && !(cr0 & CR0_PG_MASK) ) { -+ vcpu->shadow_efer &= ~KVM_EFER_LMA; -+ vcpu->svm->vmcb->save.efer &= ~(KVM_EFER_LMA | KVM_EFER_LME); -+ } -+ } -+#endif -+ vcpu->svm->cr0 = cr0; -+ vcpu->svm->vmcb->save.cr0 = cr0 | CR0_PG_MASK; -+ vcpu->cr0 = cr0; -+} -+ -+static void svm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) -+{ -+ vcpu->cr4 = cr4; -+ vcpu->svm->vmcb->save.cr4 = cr4 | CR4_PAE_MASK; -+} -+ -+static void svm_set_segment(struct kvm_vcpu *vcpu, -+ struct kvm_segment *var, int seg) -+{ -+ struct vmcb_seg *s = svm_seg(vcpu, seg); -+ -+ s->base = var->base; -+ s->limit = var->limit; -+ s->selector = var->selector; -+ if (var->unusable) -+ s->attrib = 0; -+ else { -+ s->attrib = (var->type & SVM_SELECTOR_TYPE_MASK); -+ s->attrib |= (var->s & 1) << SVM_SELECTOR_S_SHIFT; -+ s->attrib |= (var->dpl & 3) << SVM_SELECTOR_DPL_SHIFT; -+ s->attrib |= (var->present & 1) << SVM_SELECTOR_P_SHIFT; -+ s->attrib |= (var->avl & 1) << SVM_SELECTOR_AVL_SHIFT; -+ s->attrib |= (var->l & 1) << SVM_SELECTOR_L_SHIFT; -+ s->attrib |= (var->db & 1) << SVM_SELECTOR_DB_SHIFT; -+ s->attrib |= (var->g & 1) << SVM_SELECTOR_G_SHIFT; -+ } -+ if (seg == VCPU_SREG_CS) -+ vcpu->svm->vmcb->save.cpl -+ = (vcpu->svm->vmcb->save.cs.attrib -+ >> SVM_SELECTOR_DPL_SHIFT) & 3; -+ -+} -+ -+/* FIXME: -+ -+ vcpu->svm->vmcb->control.int_ctl &= ~V_TPR_MASK; -+ vcpu->svm->vmcb->control.int_ctl |= (sregs->cr8 & V_TPR_MASK); -+ -+*/ -+ -+static int svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_debug_guest *dbg) -+{ -+ return -EOPNOTSUPP; -+} -+ -+static void load_host_msrs(struct kvm_vcpu *vcpu) -+{ -+ int i; -+ -+ for ( i = 0; i < NR_HOST_SAVE_MSRS; i++) -+ wrmsrl(host_save_msrs[i], vcpu->svm->host_msrs[i]); -+} -+ -+static void save_host_msrs(struct kvm_vcpu *vcpu) -+{ -+ int i; -+ -+ for ( i = 0; i < NR_HOST_SAVE_MSRS; i++) -+ rdmsrl(host_save_msrs[i], vcpu->svm->host_msrs[i]); -+} -+ -+static void new_asid(struct kvm_vcpu *vcpu, struct svm_cpu_data *svm_data) -+{ -+ if (svm_data->next_asid > svm_data->max_asid) { -+ ++svm_data->asid_generation; -+ svm_data->next_asid = 1; -+ vcpu->svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ALL_ASID; -+ } -+ -+ vcpu->cpu = svm_data->cpu; -+ vcpu->svm->asid_generation = svm_data->asid_generation; -+ vcpu->svm->vmcb->control.asid = svm_data->next_asid++; -+} -+ -+static void svm_invlpg(struct kvm_vcpu *vcpu, gva_t address) -+{ -+ invlpga(address, vcpu->svm->vmcb->control.asid); // is needed? -+} -+ -+static unsigned long svm_get_dr(struct kvm_vcpu *vcpu, int dr) -+{ -+ return vcpu->svm->db_regs[dr]; -+} -+ -+static void svm_set_dr(struct kvm_vcpu *vcpu, int dr, unsigned long value, -+ int *exception) -+{ -+ *exception = 0; -+ -+ if (vcpu->svm->vmcb->save.dr7 & DR7_GD_MASK) { -+ vcpu->svm->vmcb->save.dr7 &= ~DR7_GD_MASK; -+ vcpu->svm->vmcb->save.dr6 |= DR6_BD_MASK; -+ *exception = DB_VECTOR; -+ return; -+ } -+ -+ switch (dr) { -+ case 0 ... 3: -+ vcpu->svm->db_regs[dr] = value; -+ return; -+ case 4 ... 5: -+ if (vcpu->cr4 & CR4_DE_MASK) { -+ *exception = UD_VECTOR; -+ return; -+ } -+ case 7: { -+ if (value & ~((1ULL << 32) - 1)) { -+ *exception = GP_VECTOR; -+ return; -+ } -+ vcpu->svm->vmcb->save.dr7 = value; -+ return; -+ } -+ default: -+ printk(KERN_DEBUG "%s: unexpected dr %u\n", -+ __FUNCTION__, dr); -+ *exception = UD_VECTOR; -+ return; -+ } -+} -+ -+static int pf_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u32 exit_int_info = vcpu->svm->vmcb->control.exit_int_info; -+ u64 fault_address; -+ u32 error_code; -+ enum emulation_result er; -+ -+ if (is_external_interrupt(exit_int_info)) -+ push_irq(vcpu, exit_int_info & SVM_EVTINJ_VEC_MASK); -+ -+ spin_lock(&vcpu->kvm->lock); -+ -+ fault_address = vcpu->svm->vmcb->control.exit_info_2; -+ error_code = vcpu->svm->vmcb->control.exit_info_1; -+ if (!vcpu->mmu.page_fault(vcpu, fault_address, error_code)) { -+ spin_unlock(&vcpu->kvm->lock); -+ return 1; -+ } -+ er = emulate_instruction(vcpu, kvm_run, fault_address, error_code); -+ spin_unlock(&vcpu->kvm->lock); -+ -+ switch (er) { -+ case EMULATE_DONE: -+ return 1; -+ case EMULATE_DO_MMIO: -+ ++kvm_stat.mmio_exits; -+ kvm_run->exit_reason = KVM_EXIT_MMIO; -+ return 0; -+ case EMULATE_FAIL: -+ vcpu_printf(vcpu, "%s: emulate fail\n", __FUNCTION__); -+ break; -+ default: -+ BUG(); -+ } -+ -+ kvm_run->exit_reason = KVM_EXIT_UNKNOWN; -+ return 0; -+} -+ -+static int io_get_override(struct kvm_vcpu *vcpu, -+ struct vmcb_seg **seg, -+ int *addr_override) -+{ -+ u8 inst[MAX_INST_SIZE]; -+ unsigned ins_length; -+ gva_t rip; -+ int i; -+ -+ rip = vcpu->svm->vmcb->save.rip; -+ ins_length = vcpu->svm->next_rip - rip; -+ rip += vcpu->svm->vmcb->save.cs.base; -+ -+ if (ins_length > MAX_INST_SIZE) -+ printk(KERN_DEBUG -+ "%s: inst length err, cs base 0x%llx rip 0x%llx " -+ "next rip 0x%llx ins_length %u\n", -+ __FUNCTION__, -+ vcpu->svm->vmcb->save.cs.base, -+ vcpu->svm->vmcb->save.rip, -+ vcpu->svm->vmcb->control.exit_info_2, -+ ins_length); -+ -+ if (kvm_read_guest(vcpu, rip, ins_length, inst) != ins_length) -+ /* #PF */ -+ return 0; -+ -+ *addr_override = 0; -+ *seg = 0; -+ for (i = 0; i < ins_length; i++) -+ switch (inst[i]) { -+ case 0xf0: -+ case 0xf2: -+ case 0xf3: -+ case 0x66: -+ continue; -+ case 0x67: -+ *addr_override = 1; -+ continue; -+ case 0x2e: -+ *seg = &vcpu->svm->vmcb->save.cs; -+ continue; -+ case 0x36: -+ *seg = &vcpu->svm->vmcb->save.ss; -+ continue; -+ case 0x3e: -+ *seg = &vcpu->svm->vmcb->save.ds; -+ continue; -+ case 0x26: -+ *seg = &vcpu->svm->vmcb->save.es; -+ continue; -+ case 0x64: -+ *seg = &vcpu->svm->vmcb->save.fs; -+ continue; -+ case 0x65: -+ *seg = &vcpu->svm->vmcb->save.gs; -+ continue; -+ default: -+ return 1; -+ } -+ printk(KERN_DEBUG "%s: unexpected\n", __FUNCTION__); -+ return 0; -+} -+ -+static unsigned long io_adress(struct kvm_vcpu *vcpu, int ins, u64 *address) -+{ -+ unsigned long addr_mask; -+ unsigned long *reg; -+ struct vmcb_seg *seg; -+ int addr_override; -+ struct vmcb_save_area *save_area = &vcpu->svm->vmcb->save; -+ u16 cs_attrib = save_area->cs.attrib; -+ unsigned addr_size = get_addr_size(vcpu); -+ -+ if (!io_get_override(vcpu, &seg, &addr_override)) -+ return 0; -+ -+ if (addr_override) -+ addr_size = (addr_size == 2) ? 4: (addr_size >> 1); -+ -+ if (ins) { -+ reg = &vcpu->regs[VCPU_REGS_RDI]; -+ seg = &vcpu->svm->vmcb->save.es; -+ } else { -+ reg = &vcpu->regs[VCPU_REGS_RSI]; -+ seg = (seg) ? seg : &vcpu->svm->vmcb->save.ds; -+ } -+ -+ addr_mask = ~0ULL >> (64 - (addr_size * 8)); -+ -+ if ((cs_attrib & SVM_SELECTOR_L_MASK) && -+ !(vcpu->svm->vmcb->save.rflags & X86_EFLAGS_VM)) { -+ *address = (*reg & addr_mask); -+ return addr_mask; -+ } -+ -+ if (!(seg->attrib & SVM_SELECTOR_P_SHIFT)) { -+ svm_inject_gp(vcpu, 0); -+ return 0; -+ } -+ -+ *address = (*reg & addr_mask) + seg->base; -+ return addr_mask; -+} -+ -+static int io_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u32 io_info = vcpu->svm->vmcb->control.exit_info_1; //address size bug? -+ int _in = io_info & SVM_IOIO_TYPE_MASK; -+ -+ ++kvm_stat.io_exits; -+ -+ vcpu->svm->next_rip = vcpu->svm->vmcb->control.exit_info_2; -+ -+ kvm_run->exit_reason = KVM_EXIT_IO; -+ kvm_run->io.port = io_info >> 16; -+ kvm_run->io.direction = (_in) ? KVM_EXIT_IO_IN : KVM_EXIT_IO_OUT; -+ kvm_run->io.size = ((io_info & SVM_IOIO_SIZE_MASK) >> SVM_IOIO_SIZE_SHIFT); -+ kvm_run->io.string = (io_info & SVM_IOIO_STR_MASK) != 0; -+ kvm_run->io.rep = (io_info & SVM_IOIO_REP_MASK) != 0; -+ -+ if (kvm_run->io.string) { -+ unsigned addr_mask; -+ -+ addr_mask = io_adress(vcpu, _in, &kvm_run->io.address); -+ if (!addr_mask) { -+ printk(KERN_DEBUG "%s: get io address failed\n", __FUNCTION__); -+ return 1; -+ } -+ -+ if (kvm_run->io.rep) { -+ kvm_run->io.count = vcpu->regs[VCPU_REGS_RCX] & addr_mask; -+ kvm_run->io.string_down = (vcpu->svm->vmcb->save.rflags -+ & X86_EFLAGS_DF) != 0; -+ } -+ } else { -+ kvm_run->io.value = vcpu->svm->vmcb->save.rax; -+ } -+ return 0; -+} -+ -+ -+static int nop_on_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ return 1; -+} -+ -+static int halt_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ vcpu->svm->next_rip = vcpu->svm->vmcb->save.rip + 1; -+ skip_emulated_instruction(vcpu); -+ if (vcpu->irq_summary && (vcpu->svm->vmcb->save.rflags & X86_EFLAGS_IF)) -+ return 1; -+ -+ kvm_run->exit_reason = KVM_EXIT_HLT; -+ return 0; -+} -+ -+static int invalid_op_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ inject_ud(vcpu); -+ return 1; -+} -+ -+static int task_switch_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ printk(KERN_DEBUG "%s: task swiche is unsupported\n", __FUNCTION__); -+ kvm_run->exit_reason = KVM_EXIT_UNKNOWN; -+ return 0; -+} -+ -+static int cpuid_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ vcpu->svm->next_rip = vcpu->svm->vmcb->save.rip + 2; -+ kvm_run->exit_reason = KVM_EXIT_CPUID; -+ return 0; -+} -+ -+static int emulate_on_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ if (emulate_instruction(vcpu, 0, 0, 0) != EMULATE_DONE) -+ printk(KERN_ERR "%s: failed\n", __FUNCTION__); -+ return 1; -+} -+ -+static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) -+{ -+ switch (ecx) { -+ case MSR_IA32_MC0_CTL: -+ case MSR_IA32_MCG_STATUS: -+ case MSR_IA32_MCG_CAP: -+ case MSR_IA32_MC0_MISC: -+ case MSR_IA32_MC0_MISC+4: -+ case MSR_IA32_MC0_MISC+8: -+ case MSR_IA32_MC0_MISC+12: -+ case MSR_IA32_MC0_MISC+16: -+ case MSR_IA32_UCODE_REV: -+ /* MTRR registers */ -+ case 0xfe: -+ case 0x200 ... 0x2ff: -+ *data = 0; -+ break; -+ case MSR_IA32_TIME_STAMP_COUNTER: { -+ u64 tsc; -+ -+ rdtscll(tsc); -+ *data = vcpu->svm->vmcb->control.tsc_offset + tsc; -+ break; -+ } -+ case MSR_EFER: -+ *data = vcpu->shadow_efer; -+ break; -+ case MSR_IA32_APICBASE: -+ *data = vcpu->apic_base; -+ break; -+#ifdef __x86_64__ -+ case MSR_STAR: -+ *data = vcpu->svm->vmcb->save.star; -+ break; -+ case MSR_LSTAR: -+ *data = vcpu->svm->vmcb->save.lstar; -+ break; -+ case MSR_CSTAR: -+ *data = vcpu->svm->vmcb->save.cstar; -+ break; -+ case MSR_KERNEL_GS_BASE: -+ *data = vcpu->svm->vmcb->save.kernel_gs_base; -+ break; -+ case MSR_SYSCALL_MASK: -+ *data = vcpu->svm->vmcb->save.sfmask; -+ break; -+#endif -+ case MSR_IA32_SYSENTER_CS: -+ *data = vcpu->svm->vmcb->save.sysenter_cs; -+ break; -+ case MSR_IA32_SYSENTER_EIP: -+ *data = vcpu->svm->vmcb->save.sysenter_eip; -+ break; -+ case MSR_IA32_SYSENTER_ESP: -+ *data = vcpu->svm->vmcb->save.sysenter_esp; -+ break; -+ default: -+ printk(KERN_ERR "kvm: unhandled rdmsr: 0x%x\n", ecx); -+ return 1; -+ } -+ return 0; -+} -+ -+static int rdmsr_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u32 ecx = vcpu->regs[VCPU_REGS_RCX]; -+ u64 data; -+ -+ if (svm_get_msr(vcpu, ecx, &data)) -+ svm_inject_gp(vcpu, 0); -+ else { -+ vcpu->svm->vmcb->save.rax = data & 0xffffffff; -+ vcpu->regs[VCPU_REGS_RDX] = data >> 32; -+ vcpu->svm->next_rip = vcpu->svm->vmcb->save.rip + 2; -+ skip_emulated_instruction(vcpu); -+ } -+ return 1; -+} -+ -+static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) -+{ -+ switch (ecx) { -+#ifdef __x86_64__ -+ case MSR_EFER: -+ set_efer(vcpu, data); -+ break; -+#endif -+ case MSR_IA32_MC0_STATUS: -+ printk(KERN_WARNING "%s: MSR_IA32_MC0_STATUS 0x%llx, nop\n" -+ , __FUNCTION__, data); -+ break; -+ case MSR_IA32_TIME_STAMP_COUNTER: { -+ u64 tsc; -+ -+ rdtscll(tsc); -+ vcpu->svm->vmcb->control.tsc_offset = data - tsc; -+ break; -+ } -+ case MSR_IA32_UCODE_REV: -+ case MSR_IA32_UCODE_WRITE: -+ case 0x200 ... 0x2ff: /* MTRRs */ -+ break; -+ case MSR_IA32_APICBASE: -+ vcpu->apic_base = data; -+ break; -+#ifdef __x86_64___ -+ case MSR_STAR: -+ vcpu->svm->vmcb->save.star = data; -+ break; -+ case MSR_LSTAR: -+ vcpu->svm->vmcb->save.lstar = data; -+ break; -+ case MSR_CSTAR: -+ vcpu->svm->vmcb->save.cstar = data; -+ break; -+ case MSR_KERNEL_GS_BASE: -+ vcpu->svm->vmcb->save.kernel_gs_base = data; -+ break; -+ case MSR_SYSCALL_MASK: -+ vcpu->svm->vmcb->save.sfmask = data; -+ break; -+#endif -+ case MSR_IA32_SYSENTER_CS: -+ vcpu->svm->vmcb->save.sysenter_cs = data; -+ break; -+ case MSR_IA32_SYSENTER_EIP: -+ vcpu->svm->vmcb->save.sysenter_eip = data; -+ break; -+ case MSR_IA32_SYSENTER_ESP: -+ vcpu->svm->vmcb->save.sysenter_esp = data; -+ break; -+ default: -+ printk(KERN_ERR "kvm: unhandled wrmsr: %x\n", ecx); -+ return 1; -+ } -+ return 0; -+} -+ -+static int wrmsr_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u32 ecx = vcpu->regs[VCPU_REGS_RCX]; -+ u64 data = (vcpu->svm->vmcb->save.rax & -1u) -+ | ((u64)(vcpu->regs[VCPU_REGS_RDX] & -1u) << 32); -+ vcpu->svm->next_rip = vcpu->svm->vmcb->save.rip + 2; -+ if (svm_set_msr(vcpu, ecx, data)) -+ svm_inject_gp(vcpu, 0); -+ else -+ skip_emulated_instruction(vcpu); -+ return 1; -+} -+ -+static int msr_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ if (vcpu->svm->vmcb->control.exit_info_1) -+ return wrmsr_interception(vcpu, kvm_run); -+ else -+ return rdmsr_interception(vcpu, kvm_run); -+} -+ -+static int (*svm_exit_handlers[])(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) = { -+ [SVM_EXIT_READ_CR0] = emulate_on_interception, -+ [SVM_EXIT_READ_CR3] = emulate_on_interception, -+ [SVM_EXIT_READ_CR4] = emulate_on_interception, -+ /* for now: */ -+ [SVM_EXIT_WRITE_CR0] = emulate_on_interception, -+ [SVM_EXIT_WRITE_CR3] = emulate_on_interception, -+ [SVM_EXIT_WRITE_CR4] = emulate_on_interception, -+ [SVM_EXIT_READ_DR0] = emulate_on_interception, -+ [SVM_EXIT_READ_DR1] = emulate_on_interception, -+ [SVM_EXIT_READ_DR2] = emulate_on_interception, -+ [SVM_EXIT_READ_DR3] = emulate_on_interception, -+ [SVM_EXIT_WRITE_DR0] = emulate_on_interception, -+ [SVM_EXIT_WRITE_DR1] = emulate_on_interception, -+ [SVM_EXIT_WRITE_DR2] = emulate_on_interception, -+ [SVM_EXIT_WRITE_DR3] = emulate_on_interception, -+ [SVM_EXIT_WRITE_DR5] = emulate_on_interception, -+ [SVM_EXIT_WRITE_DR7] = emulate_on_interception, -+ [SVM_EXIT_EXCP_BASE + PF_VECTOR] = pf_interception, -+ [SVM_EXIT_INTR] = nop_on_interception, -+ [SVM_EXIT_NMI] = nop_on_interception, -+ [SVM_EXIT_SMI] = nop_on_interception, -+ [SVM_EXIT_INIT] = nop_on_interception, -+ /* [SVM_EXIT_CR0_SEL_WRITE] = emulate_on_interception, */ -+ [SVM_EXIT_CPUID] = cpuid_interception, -+ [SVM_EXIT_HLT] = halt_interception, -+ [SVM_EXIT_INVLPG] = emulate_on_interception, -+ [SVM_EXIT_INVLPGA] = invalid_op_interception, -+ [SVM_EXIT_IOIO] = io_interception, -+ [SVM_EXIT_MSR] = msr_interception, -+ [SVM_EXIT_TASK_SWITCH] = task_switch_interception, -+ [SVM_EXIT_VMRUN] = invalid_op_interception, -+ [SVM_EXIT_VMMCALL] = invalid_op_interception, -+ [SVM_EXIT_VMLOAD] = invalid_op_interception, -+ [SVM_EXIT_VMSAVE] = invalid_op_interception, -+ [SVM_EXIT_STGI] = invalid_op_interception, -+ [SVM_EXIT_CLGI] = invalid_op_interception, -+ [SVM_EXIT_SKINIT] = invalid_op_interception, -+}; -+ -+ -+static int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u32 exit_code = vcpu->svm->vmcb->control.exit_code; -+ -+ kvm_run->exit_type = KVM_EXIT_TYPE_VM_EXIT; -+ -+ if (is_external_interrupt(vcpu->svm->vmcb->control.exit_int_info) && -+ exit_code != SVM_EXIT_EXCP_BASE + PF_VECTOR) -+ printk(KERN_ERR "%s: unexpected exit_ini_info 0x%x " -+ "exit_code 0x%x\n", -+ __FUNCTION__, vcpu->svm->vmcb->control.exit_int_info, -+ exit_code); -+ -+ if (exit_code >= sizeof(svm_exit_handlers) / sizeof(*svm_exit_handlers) -+ || svm_exit_handlers[exit_code] == 0) { -+ kvm_run->exit_reason = KVM_EXIT_UNKNOWN; -+ printk(KERN_ERR "%s: 0x%x @ 0x%llx cr0 0x%lx rflags 0x%llx\n", -+ __FUNCTION__, -+ exit_code, -+ vcpu->svm->vmcb->save.rip, -+ vcpu->cr0, -+ vcpu->svm->vmcb->save.rflags); -+ return 0; -+ } -+ -+ return svm_exit_handlers[exit_code](vcpu, kvm_run); -+} -+ -+static void reload_tss(struct kvm_vcpu *vcpu) -+{ -+ int cpu = raw_smp_processor_id(); -+ -+ struct svm_cpu_data *svm_data = per_cpu(svm_data, cpu); -+ svm_data->tss_desc->type = 9; //available 32/64-bit TSS -+ load_TR_desc(); -+} -+ -+static void pre_svm_run(struct kvm_vcpu *vcpu) -+{ -+ int cpu = raw_smp_processor_id(); -+ -+ struct svm_cpu_data *svm_data = per_cpu(svm_data, cpu); -+ -+ vcpu->svm->vmcb->control.tlb_ctl = TLB_CONTROL_DO_NOTHING; -+ if (vcpu->cpu != cpu || -+ vcpu->svm->asid_generation != svm_data->asid_generation) -+ new_asid(vcpu, svm_data); -+} -+ -+ -+static inline void kvm_try_inject_irq(struct kvm_vcpu *vcpu) -+{ -+ struct vmcb_control_area *control; -+ -+ if (!vcpu->irq_summary) -+ return; -+ -+ control = &vcpu->svm->vmcb->control; -+ -+ control->int_vector = pop_irq(vcpu); -+ control->int_ctl &= ~V_INTR_PRIO_MASK; -+ control->int_ctl |= V_IRQ_MASK | -+ ((/*control->int_vector >> 4*/ 0xf) << V_INTR_PRIO_SHIFT); -+} -+ -+static void kvm_reput_irq(struct kvm_vcpu *vcpu) -+{ -+ struct vmcb_control_area *control = &vcpu->svm->vmcb->control; -+ -+ if (control->int_ctl & V_IRQ_MASK) { -+ control->int_ctl &= ~V_IRQ_MASK; -+ push_irq(vcpu, control->int_vector); -+ } -+} -+ -+static void save_db_regs(unsigned long *db_regs) -+{ -+#ifdef __x86_64__ -+ asm ("mov %%dr0, %%rax \n\t" -+ "mov %%rax, %[dr0] \n\t" -+ "mov %%dr1, %%rax \n\t" -+ "mov %%rax, %[dr1] \n\t" -+ "mov %%dr2, %%rax \n\t" -+ "mov %%rax, %[dr2] \n\t" -+ "mov %%dr3, %%rax \n\t" -+ "mov %%rax, %[dr3] \n\t" -+ : [dr0] "=m"(db_regs[0]), -+ [dr1] "=m"(db_regs[1]), -+ [dr2] "=m"(db_regs[2]), -+ [dr3] "=m"(db_regs[3]) -+ : : "rax"); -+#else -+ asm ("mov %%dr0, %%eax \n\t" -+ "mov %%eax, %[dr0] \n\t" -+ "mov %%dr1, %%eax \n\t" -+ "mov %%eax, %[dr1] \n\t" -+ "mov %%dr2, %%eax \n\t" -+ "mov %%eax, %[dr2] \n\t" -+ "mov %%dr3, %%eax \n\t" -+ "mov %%eax, %[dr3] \n\t" -+ : [dr0] "=m"(db_regs[0]), -+ [dr1] "=m"(db_regs[1]), -+ [dr2] "=m"(db_regs[2]), -+ [dr3] "=m"(db_regs[3]) -+ : : "eax"); -+#endif -+} -+ -+static void load_db_regs(unsigned long *db_regs) -+{ -+ asm volatile ("mov %[dr0], %%dr0 \n\t" -+ "mov %[dr1], %%dr1 \n\t" -+ "mov %[dr2], %%dr2 \n\t" -+ "mov %[dr3], %%dr3 \n\t" -+ : -+ : [dr0] "r"(db_regs[0]), -+ [dr1] "r"(db_regs[1]), -+ [dr2] "r"(db_regs[2]), -+ [dr3] "r"(db_regs[3]) -+#ifdef __x86_64__ -+ : "rax"); -+#else -+ : "eax"); -+#endif -+} -+ -+static int svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u16 fs_selector; -+ u16 gs_selector; -+ u16 ldt_selector; -+ -+again: -+ kvm_try_inject_irq(vcpu); -+ -+ clgi(); -+ -+ pre_svm_run(vcpu); -+ -+ save_host_msrs(vcpu); -+ fs_selector = read_fs(); -+ gs_selector = read_gs(); -+ ldt_selector = read_ldt(); -+ vcpu->svm->host_cr2 = kvm_read_cr2(); -+ vcpu->svm->host_dr6 = read_dr6(); -+ vcpu->svm->host_dr7 = read_dr7(); -+ vcpu->svm->vmcb->save.cr2 = vcpu->cr2; -+ -+ if (vcpu->svm->vmcb->save.dr7 & 0xff) { -+ write_dr7(0); -+ save_db_regs(vcpu->svm->host_db_regs); -+ load_db_regs(vcpu->svm->db_regs); -+ } -+ asm volatile ( -+#ifdef __x86_64__ -+ "push %%rbx; push %%rcx; push %%rdx;" -+ "push %%rsi; push %%rdi; push %%rbp;" -+ "push %%r8; push %%r9; push %%r10; push %%r11;" -+ "push %%r12; push %%r13; push %%r14; push %%r15;" -+#else -+ "push %%ebx; push %%ecx; push %%edx;" -+ "push %%esi; push %%edi; push %%ebp;" -+#endif -+ -+#ifdef __x86_64__ -+ "mov %c[rbx](%[vcpu]), %%rbx \n\t" -+ "mov %c[rcx](%[vcpu]), %%rcx \n\t" -+ "mov %c[rdx](%[vcpu]), %%rdx \n\t" -+ "mov %c[rsi](%[vcpu]), %%rsi \n\t" -+ "mov %c[rdi](%[vcpu]), %%rdi \n\t" -+ "mov %c[rbp](%[vcpu]), %%rbp \n\t" -+ "mov %c[r8](%[vcpu]), %%r8 \n\t" -+ "mov %c[r9](%[vcpu]), %%r9 \n\t" -+ "mov %c[r10](%[vcpu]), %%r10 \n\t" -+ "mov %c[r11](%[vcpu]), %%r11 \n\t" -+ "mov %c[r12](%[vcpu]), %%r12 \n\t" -+ "mov %c[r13](%[vcpu]), %%r13 \n\t" -+ "mov %c[r14](%[vcpu]), %%r14 \n\t" -+ "mov %c[r15](%[vcpu]), %%r15 \n\t" -+#else -+ "mov %c[rbx](%[vcpu]), %%ebx \n\t" -+ "mov %c[rcx](%[vcpu]), %%ecx \n\t" -+ "mov %c[rdx](%[vcpu]), %%edx \n\t" -+ "mov %c[rsi](%[vcpu]), %%esi \n\t" -+ "mov %c[rdi](%[vcpu]), %%edi \n\t" -+ "mov %c[rbp](%[vcpu]), %%ebp \n\t" -+#endif -+ -+#ifdef __x86_64__ -+ /* Enter guest mode */ -+ "push %%rax \n\t" -+ "mov %c[svm](%[vcpu]), %%rax \n\t" -+ "mov %c[vmcb](%%rax), %%rax \n\t" -+ SVM_VMLOAD "\n\t" -+ SVM_VMRUN "\n\t" -+ SVM_VMSAVE "\n\t" -+ "pop %%rax \n\t" -+#else -+ /* Enter guest mode */ -+ "push %%eax \n\t" -+ "mov %c[svm](%[vcpu]), %%eax \n\t" -+ "mov %c[vmcb](%%eax), %%eax \n\t" -+ SVM_VMLOAD "\n\t" -+ SVM_VMRUN "\n\t" -+ SVM_VMSAVE "\n\t" -+ "pop %%eax \n\t" -+#endif -+ -+ /* Save guest registers, load host registers */ -+#ifdef __x86_64__ -+ "mov %%rbx, %c[rbx](%[vcpu]) \n\t" -+ "mov %%rcx, %c[rcx](%[vcpu]) \n\t" -+ "mov %%rdx, %c[rdx](%[vcpu]) \n\t" -+ "mov %%rsi, %c[rsi](%[vcpu]) \n\t" -+ "mov %%rdi, %c[rdi](%[vcpu]) \n\t" -+ "mov %%rbp, %c[rbp](%[vcpu]) \n\t" -+ "mov %%r8, %c[r8](%[vcpu]) \n\t" -+ "mov %%r9, %c[r9](%[vcpu]) \n\t" -+ "mov %%r10, %c[r10](%[vcpu]) \n\t" -+ "mov %%r11, %c[r11](%[vcpu]) \n\t" -+ "mov %%r12, %c[r12](%[vcpu]) \n\t" -+ "mov %%r13, %c[r13](%[vcpu]) \n\t" -+ "mov %%r14, %c[r14](%[vcpu]) \n\t" -+ "mov %%r15, %c[r15](%[vcpu]) \n\t" -+ -+ "pop %%r15; pop %%r14; pop %%r13; pop %%r12;" -+ "pop %%r11; pop %%r10; pop %%r9; pop %%r8;" -+ "pop %%rbp; pop %%rdi; pop %%rsi;" -+ "pop %%rdx; pop %%rcx; pop %%rbx; \n\t" -+#else -+ "mov %%ebx, %c[rbx](%[vcpu]) \n\t" -+ "mov %%ecx, %c[rcx](%[vcpu]) \n\t" -+ "mov %%edx, %c[rdx](%[vcpu]) \n\t" -+ "mov %%esi, %c[rsi](%[vcpu]) \n\t" -+ "mov %%edi, %c[rdi](%[vcpu]) \n\t" -+ "mov %%ebp, %c[rbp](%[vcpu]) \n\t" -+ -+ "pop %%ebp; pop %%edi; pop %%esi;" -+ "pop %%edx; pop %%ecx; pop %%ebx; \n\t" -+#endif -+ : -+ : [vcpu]"a"(vcpu), -+ [svm]"i"(offsetof(struct kvm_vcpu, svm)), -+ [vmcb]"i"(offsetof(struct vcpu_svm, vmcb_pa)), -+ [rbx]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RBX])), -+ [rcx]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RCX])), -+ [rdx]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RDX])), -+ [rsi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RSI])), -+ [rdi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RDI])), -+ [rbp]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RBP])) -+#ifdef __x86_64__ -+ ,[r8 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R8 ])), -+ [r9 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R9 ])), -+ [r10]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R10])), -+ [r11]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R11])), -+ [r12]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R12])), -+ [r13]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R13])), -+ [r14]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R14])), -+ [r15]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R15])) -+#endif -+ : "cc", "memory" ); -+ -+ if ((vcpu->svm->vmcb->save.dr7 & 0xff)) -+ load_db_regs(vcpu->svm->host_db_regs); -+ -+ vcpu->cr2 = vcpu->svm->vmcb->save.cr2; -+ -+ write_dr6(vcpu->svm->host_dr6); -+ write_dr7(vcpu->svm->host_dr7); -+ kvm_write_cr2(vcpu->svm->host_cr2); -+ -+ load_fs(fs_selector); -+ load_gs(gs_selector); -+ load_ldt(ldt_selector); -+ load_host_msrs(vcpu); -+ -+ reload_tss(vcpu); -+ -+ stgi(); -+ -+ kvm_reput_irq(vcpu); -+ -+ vcpu->svm->next_rip = 0; -+ -+ if (vcpu->svm->vmcb->control.exit_code == SVM_EXIT_ERR) { -+ kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY; -+ kvm_run->exit_reason = vcpu->svm->vmcb->control.exit_code; -+ return 0; -+ } -+ -+ if (handle_exit(vcpu, kvm_run)) { -+ if (signal_pending(current)) { -+ ++kvm_stat.signal_exits; -+ return -EINTR; -+ } -+ kvm_resched(vcpu); -+ goto again; -+ } -+ return 0; -+} -+ -+static void svm_flush_tlb(struct kvm_vcpu *vcpu) -+{ -+ force_new_asid(vcpu); -+} -+ -+static void svm_set_cr3(struct kvm_vcpu *vcpu, unsigned long root) -+{ -+ vcpu->svm->vmcb->save.cr3 = root; -+ force_new_asid(vcpu); -+} -+ -+static void svm_inject_page_fault(struct kvm_vcpu *vcpu, -+ unsigned long addr, -+ uint32_t err_code) -+{ -+ uint32_t exit_int_info = vcpu->svm->vmcb->control.exit_int_info; -+ -+ ++kvm_stat.pf_guest; -+ -+ if (is_page_fault(exit_int_info)) { -+ -+ vcpu->svm->vmcb->control.event_inj_err = 0; -+ vcpu->svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | -+ SVM_EVTINJ_VALID_ERR | -+ SVM_EVTINJ_TYPE_EXEPT | -+ DF_VECTOR; -+ return; -+ } -+ vcpu->cr2 = addr; -+ vcpu->svm->vmcb->save.cr2 = addr; -+ vcpu->svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | -+ SVM_EVTINJ_VALID_ERR | -+ SVM_EVTINJ_TYPE_EXEPT | -+ PF_VECTOR; -+ vcpu->svm->vmcb->control.event_inj_err = err_code; -+} -+ -+ -+static int is_disabled(void) -+{ -+ return 0; -+} -+ -+static struct kvm_arch_ops svm_arch_ops = { -+ .cpu_has_kvm_support = has_svm, -+ .disabled_by_bios = is_disabled, -+ .hardware_setup = svm_hardware_setup, -+ .hardware_unsetup = svm_hardware_unsetup, -+ .hardware_enable = svm_hardware_enable, -+ .hardware_disable = svm_hardware_disable, -+ -+ .vcpu_create = svm_create_vcpu, -+ .vcpu_free = svm_free_vcpu, -+ -+ .vcpu_load = svm_vcpu_load, -+ .vcpu_put = svm_vcpu_put, -+ -+ .set_guest_debug = svm_guest_debug, -+ .get_msr = svm_get_msr, -+ .set_msr = svm_set_msr, -+ .get_segment_base = svm_get_segment_base, -+ .get_segment = svm_get_segment, -+ .set_segment = svm_set_segment, -+ .is_long_mode = svm_is_long_mode, -+ .get_cs_db_l_bits = svm_get_cs_db_l_bits, -+ .set_cr0 = svm_set_cr0, -+ .set_cr0_no_modeswitch = svm_set_cr0, -+ .set_cr3 = svm_set_cr3, -+ .set_cr4 = svm_set_cr4, -+ .set_efer = svm_set_efer, -+ .get_idt = svm_get_idt, -+ .set_idt = svm_set_idt, -+ .get_gdt = svm_get_gdt, -+ .set_gdt = svm_set_gdt, -+ .get_dr = svm_get_dr, -+ .set_dr = svm_set_dr, -+ .cache_regs = svm_cache_regs, -+ .decache_regs = svm_decache_regs, -+ .get_rflags = svm_get_rflags, -+ .set_rflags = svm_set_rflags, -+ -+ .invlpg = svm_invlpg, -+ .tlb_flush = svm_flush_tlb, -+ .inject_page_fault = svm_inject_page_fault, -+ -+ .inject_gp = svm_inject_gp, -+ -+ .run = svm_vcpu_run, -+ .skip_emulated_instruction = skip_emulated_instruction, -+ .vcpu_setup = svm_vcpu_setup, -+}; -+ -+static int __init svm_init(void) -+{ -+ kvm_emulator_want_group7_invlpg(); -+ kvm_init_arch(&svm_arch_ops, THIS_MODULE); -+ return 0; -+} -+ -+static void __exit svm_exit(void) -+{ -+ kvm_exit_arch(); -+} -+ -+module_init(svm_init) -+module_exit(svm_exit) ---- /dev/null -+++ b/drivers/kvm/svm.h -@@ -0,0 +1,315 @@ -+#ifndef __SVM_H -+#define __SVM_H -+ -+enum { -+ INTERCEPT_INTR, -+ INTERCEPT_NMI, -+ INTERCEPT_SMI, -+ INTERCEPT_INIT, -+ INTERCEPT_VINTR, -+ INTERCEPT_SELECTIVE_CR0, -+ INTERCEPT_STORE_IDTR, -+ INTERCEPT_STORE_GDTR, -+ INTERCEPT_STORE_LDTR, -+ INTERCEPT_STORE_TR, -+ INTERCEPT_LOAD_IDTR, -+ INTERCEPT_LOAD_GDTR, -+ INTERCEPT_LOAD_LDTR, -+ INTERCEPT_LOAD_TR, -+ INTERCEPT_RDTSC, -+ INTERCEPT_RDPMC, -+ INTERCEPT_PUSHF, -+ INTERCEPT_POPF, -+ INTERCEPT_CPUID, -+ INTERCEPT_RSM, -+ INTERCEPT_IRET, -+ INTERCEPT_INTn, -+ INTERCEPT_INVD, -+ INTERCEPT_PAUSE, -+ INTERCEPT_HLT, -+ INTERCEPT_INVLPG, -+ INTERCEPT_INVLPGA, -+ INTERCEPT_IOIO_PROT, -+ INTERCEPT_MSR_PROT, -+ INTERCEPT_TASK_SWITCH, -+ INTERCEPT_FERR_FREEZE, -+ INTERCEPT_SHUTDOWN, -+ INTERCEPT_VMRUN, -+ INTERCEPT_VMMCALL, -+ INTERCEPT_VMLOAD, -+ INTERCEPT_VMSAVE, -+ INTERCEPT_STGI, -+ INTERCEPT_CLGI, -+ INTERCEPT_SKINIT, -+ INTERCEPT_RDTSCP, -+ INTERCEPT_ICEBP, -+ INTERCEPT_WBINVD, -+}; -+ -+ -+struct __attribute__ ((__packed__)) vmcb_control_area { -+ u16 intercept_cr_read; -+ u16 intercept_cr_write; -+ u16 intercept_dr_read; -+ u16 intercept_dr_write; -+ u32 intercept_exceptions; -+ u64 intercept; -+ u8 reserved_1[44]; -+ u64 iopm_base_pa; -+ u64 msrpm_base_pa; -+ u64 tsc_offset; -+ u32 asid; -+ u8 tlb_ctl; -+ u8 reserved_2[3]; -+ u32 int_ctl; -+ u32 int_vector; -+ u32 int_state; -+ u8 reserved_3[4]; -+ u32 exit_code; -+ u32 exit_code_hi; -+ u64 exit_info_1; -+ u64 exit_info_2; -+ u32 exit_int_info; -+ u32 exit_int_info_err; -+ u64 nested_ctl; -+ u8 reserved_4[16]; -+ u32 event_inj; -+ u32 event_inj_err; -+ u64 nested_cr3; -+ u64 lbr_ctl; -+ u8 reserved_5[832]; -+}; -+ -+ -+#define TLB_CONTROL_DO_NOTHING 0 -+#define TLB_CONTROL_FLUSH_ALL_ASID 1 -+ -+#define V_TPR_MASK 0x0f -+ -+#define V_IRQ_SHIFT 8 -+#define V_IRQ_MASK (1 << V_IRQ_SHIFT) -+ -+#define V_INTR_PRIO_SHIFT 16 -+#define V_INTR_PRIO_MASK (0x0f << V_INTR_PRIO_SHIFT) -+ -+#define V_IGN_TPR_SHIFT 20 -+#define V_IGN_TPR_MASK (1 << V_IGN_TPR_SHIFT) -+ -+#define V_INTR_MASKING_SHIFT 24 -+#define V_INTR_MASKING_MASK (1 << V_INTR_MASKING_SHIFT) -+ -+#define SVM_INTERRUPT_SHADOW_MASK 1 -+ -+#define SVM_IOIO_STR_SHIFT 2 -+#define SVM_IOIO_REP_SHIFT 3 -+#define SVM_IOIO_SIZE_SHIFT 4 -+#define SVM_IOIO_ASIZE_SHIFT 7 -+ -+#define SVM_IOIO_TYPE_MASK 1 -+#define SVM_IOIO_STR_MASK (1 << SVM_IOIO_STR_SHIFT) -+#define SVM_IOIO_REP_MASK (1 << SVM_IOIO_REP_SHIFT) -+#define SVM_IOIO_SIZE_MASK (7 << SVM_IOIO_SIZE_SHIFT) -+#define SVM_IOIO_ASIZE_MASK (7 << SVM_IOIO_ASIZE_SHIFT) -+ -+struct __attribute__ ((__packed__)) vmcb_seg { -+ u16 selector; -+ u16 attrib; -+ u32 limit; -+ u64 base; -+}; -+ -+struct __attribute__ ((__packed__)) vmcb_save_area { -+ struct vmcb_seg es; -+ struct vmcb_seg cs; -+ struct vmcb_seg ss; -+ struct vmcb_seg ds; -+ struct vmcb_seg fs; -+ struct vmcb_seg gs; -+ struct vmcb_seg gdtr; -+ struct vmcb_seg ldtr; -+ struct vmcb_seg idtr; -+ struct vmcb_seg tr; -+ u8 reserved_1[43]; -+ u8 cpl; -+ u8 reserved_2[4]; -+ u64 efer; -+ u8 reserved_3[112]; -+ u64 cr4; -+ u64 cr3; -+ u64 cr0; -+ u64 dr7; -+ u64 dr6; -+ u64 rflags; -+ u64 rip; -+ u8 reserved_4[88]; -+ u64 rsp; -+ u8 reserved_5[24]; -+ u64 rax; -+ u64 star; -+ u64 lstar; -+ u64 cstar; -+ u64 sfmask; -+ u64 kernel_gs_base; -+ u64 sysenter_cs; -+ u64 sysenter_esp; -+ u64 sysenter_eip; -+ u64 cr2; -+ u8 reserved_6[32]; -+ u64 g_pat; -+ u64 dbgctl; -+ u64 br_from; -+ u64 br_to; -+ u64 last_excp_from; -+ u64 last_excp_to; -+}; -+ -+struct __attribute__ ((__packed__)) vmcb { -+ struct vmcb_control_area control; -+ struct vmcb_save_area save; -+}; -+ -+#define SVM_CPUID_FEATURE_SHIFT 2 -+#define SVM_CPUID_FUNC 0x8000000a -+ -+#define MSR_EFER_SVME_MASK (1ULL << 12) -+#define MSR_VM_HSAVE_PA 0xc0010117ULL -+ -+#define SVM_SELECTOR_S_SHIFT 4 -+#define SVM_SELECTOR_DPL_SHIFT 5 -+#define SVM_SELECTOR_P_SHIFT 7 -+#define SVM_SELECTOR_AVL_SHIFT 8 -+#define SVM_SELECTOR_L_SHIFT 9 -+#define SVM_SELECTOR_DB_SHIFT 10 -+#define SVM_SELECTOR_G_SHIFT 11 -+ -+#define SVM_SELECTOR_TYPE_MASK (0xf) -+#define SVM_SELECTOR_S_MASK (1 << SVM_SELECTOR_S_SHIFT) -+#define SVM_SELECTOR_DPL_MASK (3 << SVM_SELECTOR_DPL_SHIFT) -+#define SVM_SELECTOR_P_MASK (1 << SVM_SELECTOR_P_SHIFT) -+#define SVM_SELECTOR_AVL_MASK (1 << SVM_SELECTOR_AVL_SHIFT) -+#define SVM_SELECTOR_L_MASK (1 << SVM_SELECTOR_L_SHIFT) -+#define SVM_SELECTOR_DB_MASK (1 << SVM_SELECTOR_DB_SHIFT) -+#define SVM_SELECTOR_G_MASK (1 << SVM_SELECTOR_G_SHIFT) -+ -+#define SVM_SELECTOR_WRITE_MASK (1 << 1) -+#define SVM_SELECTOR_READ_MASK SVM_SELECTOR_WRITE_MASK -+#define SVM_SELECTOR_CODE_MASK (1 << 3) -+ -+#define INTERCEPT_CR0_MASK 1 -+#define INTERCEPT_CR3_MASK (1 << 3) -+#define INTERCEPT_CR4_MASK (1 << 4) -+ -+#define INTERCEPT_DR0_MASK 1 -+#define INTERCEPT_DR1_MASK (1 << 1) -+#define INTERCEPT_DR2_MASK (1 << 2) -+#define INTERCEPT_DR3_MASK (1 << 3) -+#define INTERCEPT_DR4_MASK (1 << 4) -+#define INTERCEPT_DR5_MASK (1 << 5) -+#define INTERCEPT_DR6_MASK (1 << 6) -+#define INTERCEPT_DR7_MASK (1 << 7) -+ -+#define SVM_EVTINJ_VEC_MASK 0xff -+ -+#define SVM_EVTINJ_TYPE_SHIFT 8 -+#define SVM_EVTINJ_TYPE_MASK (7 << SVM_EVTINJ_TYPE_SHIFT) -+ -+#define SVM_EVTINJ_TYPE_INTR (0 << SVM_EVTINJ_TYPE_SHIFT) -+#define SVM_EVTINJ_TYPE_NMI (2 << SVM_EVTINJ_TYPE_SHIFT) -+#define SVM_EVTINJ_TYPE_EXEPT (3 << SVM_EVTINJ_TYPE_SHIFT) -+#define SVM_EVTINJ_TYPE_SOFT (4 << SVM_EVTINJ_TYPE_SHIFT) -+ -+#define SVM_EVTINJ_VALID (1 << 31) -+#define SVM_EVTINJ_VALID_ERR (1 << 11) -+ -+#define SVM_EXITINTINFO_VEC_MASK SVM_EVTINJ_VEC_MASK -+ -+#define SVM_EXITINTINFO_TYPE_INTR SVM_EVTINJ_TYPE_INTR -+#define SVM_EXITINTINFO_TYPE_NMI SVM_EVTINJ_TYPE_NMI -+#define SVM_EXITINTINFO_TYPE_EXEPT SVM_EVTINJ_TYPE_EXEPT -+#define SVM_EXITINTINFO_TYPE_SOFT SVM_EVTINJ_TYPE_SOFT -+ -+#define SVM_EXITINTINFO_VALID SVM_EVTINJ_VALID -+#define SVM_EXITINTINFO_VALID_ERR SVM_EVTINJ_VALID_ERR -+ -+#define SVM_EXIT_READ_CR0 0x000 -+#define SVM_EXIT_READ_CR3 0x003 -+#define SVM_EXIT_READ_CR4 0x004 -+#define SVM_EXIT_READ_CR8 0x008 -+#define SVM_EXIT_WRITE_CR0 0x010 -+#define SVM_EXIT_WRITE_CR3 0x013 -+#define SVM_EXIT_WRITE_CR4 0x014 -+#define SVM_EXIT_WRITE_CR8 0x018 -+#define SVM_EXIT_READ_DR0 0x020 -+#define SVM_EXIT_READ_DR1 0x021 -+#define SVM_EXIT_READ_DR2 0x022 -+#define SVM_EXIT_READ_DR3 0x023 -+#define SVM_EXIT_READ_DR4 0x024 -+#define SVM_EXIT_READ_DR5 0x025 -+#define SVM_EXIT_READ_DR6 0x026 -+#define SVM_EXIT_READ_DR7 0x027 -+#define SVM_EXIT_WRITE_DR0 0x030 -+#define SVM_EXIT_WRITE_DR1 0x031 -+#define SVM_EXIT_WRITE_DR2 0x032 -+#define SVM_EXIT_WRITE_DR3 0x033 -+#define SVM_EXIT_WRITE_DR4 0x034 -+#define SVM_EXIT_WRITE_DR5 0x035 -+#define SVM_EXIT_WRITE_DR6 0x036 -+#define SVM_EXIT_WRITE_DR7 0x037 -+#define SVM_EXIT_EXCP_BASE 0x040 -+#define SVM_EXIT_INTR 0x060 -+#define SVM_EXIT_NMI 0x061 -+#define SVM_EXIT_SMI 0x062 -+#define SVM_EXIT_INIT 0x063 -+#define SVM_EXIT_VINTR 0x064 -+#define SVM_EXIT_CR0_SEL_WRITE 0x065 -+#define SVM_EXIT_IDTR_READ 0x066 -+#define SVM_EXIT_GDTR_READ 0x067 -+#define SVM_EXIT_LDTR_READ 0x068 -+#define SVM_EXIT_TR_READ 0x069 -+#define SVM_EXIT_IDTR_WRITE 0x06a -+#define SVM_EXIT_GDTR_WRITE 0x06b -+#define SVM_EXIT_LDTR_WRITE 0x06c -+#define SVM_EXIT_TR_WRITE 0x06d -+#define SVM_EXIT_RDTSC 0x06e -+#define SVM_EXIT_RDPMC 0x06f -+#define SVM_EXIT_PUSHF 0x070 -+#define SVM_EXIT_POPF 0x071 -+#define SVM_EXIT_CPUID 0x072 -+#define SVM_EXIT_RSM 0x073 -+#define SVM_EXIT_IRET 0x074 -+#define SVM_EXIT_SWINT 0x075 -+#define SVM_EXIT_INVD 0x076 -+#define SVM_EXIT_PAUSE 0x077 -+#define SVM_EXIT_HLT 0x078 -+#define SVM_EXIT_INVLPG 0x079 -+#define SVM_EXIT_INVLPGA 0x07a -+#define SVM_EXIT_IOIO 0x07b -+#define SVM_EXIT_MSR 0x07c -+#define SVM_EXIT_TASK_SWITCH 0x07d -+#define SVM_EXIT_FERR_FREEZE 0x07e -+#define SVM_EXIT_SHUTDOWN 0x07f -+#define SVM_EXIT_VMRUN 0x080 -+#define SVM_EXIT_VMMCALL 0x081 -+#define SVM_EXIT_VMLOAD 0x082 -+#define SVM_EXIT_VMSAVE 0x083 -+#define SVM_EXIT_STGI 0x084 -+#define SVM_EXIT_CLGI 0x085 -+#define SVM_EXIT_SKINIT 0x086 -+#define SVM_EXIT_RDTSCP 0x087 -+#define SVM_EXIT_ICEBP 0x088 -+#define SVM_EXIT_WBINVD 0x089 -+#define SVM_EXIT_NPF 0x400 -+ -+#define SVM_EXIT_ERR -1 -+ -+#define SVM_CR0_SELECTIVE_MASK (1 << 3 | 1) // TS and MP -+ -+#define SVM_VMLOAD ".byte 0x0f, 0x01, 0xda" -+#define SVM_VMRUN ".byte 0x0f, 0x01, 0xd8" -+#define SVM_VMSAVE ".byte 0x0f, 0x01, 0xdb" -+#define SVM_CLGI ".byte 0x0f, 0x01, 0xdd" -+#define SVM_STGI ".byte 0x0f, 0x01, 0xdc" -+#define SVM_INVLPGA ".byte 0x0f, 0x01, 0xdf" -+ -+#endif -+ ---- /dev/null -+++ b/drivers/kvm/vmx.c -@@ -0,0 +1,2002 @@ -+/* -+ * Kernel-based Virtual Machine driver for Linux -+ * -+ * This module enables machines with Intel VT-x extensions to run virtual -+ * machines without emulation or binary translation. -+ * -+ * Copyright (C) 2006 Qumranet, Inc. -+ * -+ * Authors: -+ * Avi Kivity -+ * Yaniv Kamay -+ * -+ * This work is licensed under the terms of the GNU GPL, version 2. See -+ * the COPYING file in the top-level directory. -+ * -+ */ -+ -+#include "kvm.h" -+#include "vmx.h" -+#include "kvm_vmx.h" -+#include -+#include -+#include -+#include -+ -+#include "segment_descriptor.h" -+ -+#define MSR_IA32_FEATURE_CONTROL 0x03a -+ -+MODULE_AUTHOR("Qumranet"); -+MODULE_LICENSE("GPL"); -+ -+static DEFINE_PER_CPU(struct vmcs *, vmxarea); -+static DEFINE_PER_CPU(struct vmcs *, current_vmcs); -+ -+#ifdef __x86_64__ -+#define HOST_IS_64 1 -+#else -+#define HOST_IS_64 0 -+#endif -+ -+static struct vmcs_descriptor { -+ int size; -+ int order; -+ u32 revision_id; -+} vmcs_descriptor; -+ -+#define VMX_SEGMENT_FIELD(seg) \ -+ [VCPU_SREG_##seg] = { \ -+ .selector = GUEST_##seg##_SELECTOR, \ -+ .base = GUEST_##seg##_BASE, \ -+ .limit = GUEST_##seg##_LIMIT, \ -+ .ar_bytes = GUEST_##seg##_AR_BYTES, \ -+ } -+ -+static struct kvm_vmx_segment_field { -+ unsigned selector; -+ unsigned base; -+ unsigned limit; -+ unsigned ar_bytes; -+} kvm_vmx_segment_fields[] = { -+ VMX_SEGMENT_FIELD(CS), -+ VMX_SEGMENT_FIELD(DS), -+ VMX_SEGMENT_FIELD(ES), -+ VMX_SEGMENT_FIELD(FS), -+ VMX_SEGMENT_FIELD(GS), -+ VMX_SEGMENT_FIELD(SS), -+ VMX_SEGMENT_FIELD(TR), -+ VMX_SEGMENT_FIELD(LDTR), -+}; -+ -+static const u32 vmx_msr_index[] = { -+#ifdef __x86_64__ -+ MSR_SYSCALL_MASK, MSR_LSTAR, MSR_CSTAR, MSR_KERNEL_GS_BASE, -+#endif -+ MSR_EFER, MSR_K6_STAR, -+}; -+#define NR_VMX_MSR (sizeof(vmx_msr_index) / sizeof(*vmx_msr_index)) -+ -+struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr); -+ -+static inline int is_page_fault(u32 intr_info) -+{ -+ return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK | -+ INTR_INFO_VALID_MASK)) == -+ (INTR_TYPE_EXCEPTION | PF_VECTOR | INTR_INFO_VALID_MASK); -+} -+ -+static inline int is_external_interrupt(u32 intr_info) -+{ -+ return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VALID_MASK)) -+ == (INTR_TYPE_EXT_INTR | INTR_INFO_VALID_MASK); -+} -+ -+static void vmcs_clear(struct vmcs *vmcs) -+{ -+ u64 phys_addr = __pa(vmcs); -+ u8 error; -+ -+ asm volatile (ASM_VMX_VMCLEAR_RAX "; setna %0" -+ : "=g"(error) : "a"(&phys_addr), "m"(phys_addr) -+ : "cc", "memory"); -+ if (error) -+ printk(KERN_ERR "kvm: vmclear fail: %p/%llx\n", -+ vmcs, phys_addr); -+} -+ -+static void __vcpu_clear(void *arg) -+{ -+ struct kvm_vcpu *vcpu = arg; -+ int cpu = smp_processor_id(); -+ -+ if (vcpu->cpu == cpu) -+ vmcs_clear(vcpu->vmcs); -+ if (per_cpu(current_vmcs, cpu) == vcpu->vmcs) -+ per_cpu(current_vmcs, cpu) = NULL; -+} -+ -+static unsigned long vmcs_readl(unsigned long field) -+{ -+ unsigned long value; -+ -+ asm volatile (ASM_VMX_VMREAD_RDX_RAX -+ : "=a"(value) : "d"(field) : "cc"); -+ return value; -+} -+ -+static u16 vmcs_read16(unsigned long field) -+{ -+ return vmcs_readl(field); -+} -+ -+static u32 vmcs_read32(unsigned long field) -+{ -+ return vmcs_readl(field); -+} -+ -+static u64 vmcs_read64(unsigned long field) -+{ -+#ifdef __x86_64__ -+ return vmcs_readl(field); -+#else -+ return vmcs_readl(field) | ((u64)vmcs_readl(field+1) << 32); -+#endif -+} -+ -+static void vmcs_writel(unsigned long field, unsigned long value) -+{ -+ u8 error; -+ -+ asm volatile (ASM_VMX_VMWRITE_RAX_RDX "; setna %0" -+ : "=q"(error) : "a"(value), "d"(field) : "cc" ); -+ if (error) -+ printk(KERN_ERR "vmwrite error: reg %lx value %lx (err %d)\n", -+ field, value, vmcs_read32(VM_INSTRUCTION_ERROR)); -+} -+ -+static void vmcs_write16(unsigned long field, u16 value) -+{ -+ vmcs_writel(field, value); -+} -+ -+static void vmcs_write32(unsigned long field, u32 value) -+{ -+ vmcs_writel(field, value); -+} -+ -+static void vmcs_write64(unsigned long field, u64 value) -+{ -+#ifdef __x86_64__ -+ vmcs_writel(field, value); -+#else -+ vmcs_writel(field, value); -+ asm volatile (""); -+ vmcs_writel(field+1, value >> 32); -+#endif -+} -+ -+/* -+ * Switches to specified vcpu, until a matching vcpu_put(), but assumes -+ * vcpu mutex is already taken. -+ */ -+static struct kvm_vcpu *vmx_vcpu_load(struct kvm_vcpu *vcpu) -+{ -+ u64 phys_addr = __pa(vcpu->vmcs); -+ int cpu; -+ -+ cpu = get_cpu(); -+ -+ if (vcpu->cpu != cpu) { -+ smp_call_function(__vcpu_clear, vcpu, 0, 1); -+ vcpu->launched = 0; -+ } -+ -+ if (per_cpu(current_vmcs, cpu) != vcpu->vmcs) { -+ u8 error; -+ -+ per_cpu(current_vmcs, cpu) = vcpu->vmcs; -+ asm volatile (ASM_VMX_VMPTRLD_RAX "; setna %0" -+ : "=g"(error) : "a"(&phys_addr), "m"(phys_addr) -+ : "cc"); -+ if (error) -+ printk(KERN_ERR "kvm: vmptrld %p/%llx fail\n", -+ vcpu->vmcs, phys_addr); -+ } -+ -+ if (vcpu->cpu != cpu) { -+ struct descriptor_table dt; -+ unsigned long sysenter_esp; -+ -+ vcpu->cpu = cpu; -+ /* -+ * Linux uses per-cpu TSS and GDT, so set these when switching -+ * processors. -+ */ -+ vmcs_writel(HOST_TR_BASE, read_tr_base()); /* 22.2.4 */ -+ get_gdt(&dt); -+ vmcs_writel(HOST_GDTR_BASE, dt.base); /* 22.2.4 */ -+ -+ rdmsrl(MSR_IA32_SYSENTER_ESP, sysenter_esp); -+ vmcs_writel(HOST_IA32_SYSENTER_ESP, sysenter_esp); /* 22.2.3 */ -+ } -+ return vcpu; -+} -+ -+static void vmx_vcpu_put(struct kvm_vcpu *vcpu) -+{ -+ put_cpu(); -+} -+ -+static unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu) -+{ -+ return vmcs_readl(GUEST_RFLAGS); -+} -+ -+static void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags) -+{ -+ vmcs_writel(GUEST_RFLAGS, rflags); -+} -+ -+static void skip_emulated_instruction(struct kvm_vcpu *vcpu) -+{ -+ unsigned long rip; -+ u32 interruptibility; -+ -+ rip = vmcs_readl(GUEST_RIP); -+ rip += vmcs_read32(VM_EXIT_INSTRUCTION_LEN); -+ vmcs_writel(GUEST_RIP, rip); -+ -+ /* -+ * We emulated an instruction, so temporary interrupt blocking -+ * should be removed, if set. -+ */ -+ interruptibility = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO); -+ if (interruptibility & 3) -+ vmcs_write32(GUEST_INTERRUPTIBILITY_INFO, -+ interruptibility & ~3); -+} -+ -+static void vmx_inject_gp(struct kvm_vcpu *vcpu, unsigned error_code) -+{ -+ printk(KERN_DEBUG "inject_general_protection: rip 0x%lx\n", -+ vmcs_readl(GUEST_RIP)); -+ vmcs_write32(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code); -+ vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, -+ GP_VECTOR | -+ INTR_TYPE_EXCEPTION | -+ INTR_INFO_DELIEVER_CODE_MASK | -+ INTR_INFO_VALID_MASK); -+} -+ -+/* -+ * reads and returns guest's timestamp counter "register" -+ * guest_tsc = host_tsc + tsc_offset -- 21.3 -+ */ -+static u64 guest_read_tsc(void) -+{ -+ u64 host_tsc, tsc_offset; -+ -+ rdtscll(host_tsc); -+ tsc_offset = vmcs_read64(TSC_OFFSET); -+ return host_tsc + tsc_offset; -+} -+ -+/* -+ * writes 'guest_tsc' into guest's timestamp counter "register" -+ * guest_tsc = host_tsc + tsc_offset ==> tsc_offset = guest_tsc - host_tsc -+ */ -+static void guest_write_tsc(u64 guest_tsc) -+{ -+ u64 host_tsc; -+ -+ rdtscll(host_tsc); -+ vmcs_write64(TSC_OFFSET, guest_tsc - host_tsc); -+} -+ -+static void reload_tss(void) -+{ -+#ifndef __x86_64__ -+ -+ /* -+ * VT restores TR but not its size. Useless. -+ */ -+ struct descriptor_table gdt; -+ struct segment_descriptor *descs; -+ -+ get_gdt(&gdt); -+ descs = (void *)gdt.base; -+ descs[GDT_ENTRY_TSS].type = 9; /* available TSS */ -+ load_TR_desc(); -+#endif -+} -+ -+/* -+ * Reads an msr value (of 'msr_index') into 'pdata'. -+ * Returns 0 on success, non-0 otherwise. -+ * Assumes vcpu_load() was already called. -+ */ -+static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) -+{ -+ u64 data; -+ struct vmx_msr_entry *msr; -+ -+ if (!pdata) { -+ printk(KERN_ERR "BUG: get_msr called with NULL pdata\n"); -+ return -EINVAL; -+ } -+ -+ switch (msr_index) { -+#ifdef __x86_64__ -+ case MSR_FS_BASE: -+ data = vmcs_readl(GUEST_FS_BASE); -+ break; -+ case MSR_GS_BASE: -+ data = vmcs_readl(GUEST_GS_BASE); -+ break; -+ case MSR_EFER: -+ data = vcpu->shadow_efer; -+ break; -+#endif -+ case MSR_IA32_TIME_STAMP_COUNTER: -+ data = guest_read_tsc(); -+ break; -+ case MSR_IA32_SYSENTER_CS: -+ data = vmcs_read32(GUEST_SYSENTER_CS); -+ break; -+ case MSR_IA32_SYSENTER_EIP: -+ data = vmcs_read32(GUEST_SYSENTER_EIP); -+ break; -+ case MSR_IA32_SYSENTER_ESP: -+ data = vmcs_read32(GUEST_SYSENTER_ESP); -+ break; -+ case MSR_IA32_MC0_CTL: -+ case MSR_IA32_MCG_STATUS: -+ case MSR_IA32_MCG_CAP: -+ case MSR_IA32_MC0_MISC: -+ case MSR_IA32_MC0_MISC+4: -+ case MSR_IA32_MC0_MISC+8: -+ case MSR_IA32_MC0_MISC+12: -+ case MSR_IA32_MC0_MISC+16: -+ case MSR_IA32_UCODE_REV: -+ /* MTRR registers */ -+ case 0xfe: -+ case 0x200 ... 0x2ff: -+ data = 0; -+ break; -+ case MSR_IA32_APICBASE: -+ data = vcpu->apic_base; -+ break; -+ default: -+ msr = find_msr_entry(vcpu, msr_index); -+ if (!msr) { -+ printk(KERN_ERR "kvm: unhandled rdmsr: %x\n", msr_index); -+ return 1; -+ } -+ data = msr->data; -+ break; -+ } -+ -+ *pdata = data; -+ return 0; -+} -+ -+/* -+ * Writes msr value into into the appropriate "register". -+ * Returns 0 on success, non-0 otherwise. -+ * Assumes vcpu_load() was already called. -+ */ -+static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) -+{ -+ struct vmx_msr_entry *msr; -+ switch (msr_index) { -+#ifdef __x86_64__ -+ case MSR_FS_BASE: -+ vmcs_writel(GUEST_FS_BASE, data); -+ break; -+ case MSR_GS_BASE: -+ vmcs_writel(GUEST_GS_BASE, data); -+ break; -+#endif -+ case MSR_IA32_SYSENTER_CS: -+ vmcs_write32(GUEST_SYSENTER_CS, data); -+ break; -+ case MSR_IA32_SYSENTER_EIP: -+ vmcs_write32(GUEST_SYSENTER_EIP, data); -+ break; -+ case MSR_IA32_SYSENTER_ESP: -+ vmcs_write32(GUEST_SYSENTER_ESP, data); -+ break; -+#ifdef __x86_64 -+ case MSR_EFER: -+ set_efer(vcpu, data); -+ break; -+ case MSR_IA32_MC0_STATUS: -+ printk(KERN_WARNING "%s: MSR_IA32_MC0_STATUS 0x%llx, nop\n" -+ , __FUNCTION__, data); -+ break; -+#endif -+ case MSR_IA32_TIME_STAMP_COUNTER: { -+ guest_write_tsc(data); -+ break; -+ } -+ case MSR_IA32_UCODE_REV: -+ case MSR_IA32_UCODE_WRITE: -+ case 0x200 ... 0x2ff: /* MTRRs */ -+ break; -+ case MSR_IA32_APICBASE: -+ vcpu->apic_base = data; -+ break; -+ default: -+ msr = find_msr_entry(vcpu, msr_index); -+ if (!msr) { -+ printk(KERN_ERR "kvm: unhandled wrmsr: 0x%x\n", msr_index); -+ return 1; -+ } -+ msr->data = data; -+ break; -+ } -+ -+ return 0; -+} -+ -+/* -+ * Sync the rsp and rip registers into the vcpu structure. This allows -+ * registers to be accessed by indexing vcpu->regs. -+ */ -+static void vcpu_load_rsp_rip(struct kvm_vcpu *vcpu) -+{ -+ vcpu->regs[VCPU_REGS_RSP] = vmcs_readl(GUEST_RSP); -+ vcpu->rip = vmcs_readl(GUEST_RIP); -+} -+ -+/* -+ * Syncs rsp and rip back into the vmcs. Should be called after possible -+ * modification. -+ */ -+static void vcpu_put_rsp_rip(struct kvm_vcpu *vcpu) -+{ -+ vmcs_writel(GUEST_RSP, vcpu->regs[VCPU_REGS_RSP]); -+ vmcs_writel(GUEST_RIP, vcpu->rip); -+} -+ -+static int set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_debug_guest *dbg) -+{ -+ unsigned long dr7 = 0x400; -+ u32 exception_bitmap; -+ int old_singlestep; -+ -+ exception_bitmap = vmcs_read32(EXCEPTION_BITMAP); -+ old_singlestep = vcpu->guest_debug.singlestep; -+ -+ vcpu->guest_debug.enabled = dbg->enabled; -+ if (vcpu->guest_debug.enabled) { -+ int i; -+ -+ dr7 |= 0x200; /* exact */ -+ for (i = 0; i < 4; ++i) { -+ if (!dbg->breakpoints[i].enabled) -+ continue; -+ vcpu->guest_debug.bp[i] = dbg->breakpoints[i].address; -+ dr7 |= 2 << (i*2); /* global enable */ -+ dr7 |= 0 << (i*4+16); /* execution breakpoint */ -+ } -+ -+ exception_bitmap |= (1u << 1); /* Trap debug exceptions */ -+ -+ vcpu->guest_debug.singlestep = dbg->singlestep; -+ } else { -+ exception_bitmap &= ~(1u << 1); /* Ignore debug exceptions */ -+ vcpu->guest_debug.singlestep = 0; -+ } -+ -+ if (old_singlestep && !vcpu->guest_debug.singlestep) { -+ unsigned long flags; -+ -+ flags = vmcs_readl(GUEST_RFLAGS); -+ flags &= ~(X86_EFLAGS_TF | X86_EFLAGS_RF); -+ vmcs_writel(GUEST_RFLAGS, flags); -+ } -+ -+ vmcs_write32(EXCEPTION_BITMAP, exception_bitmap); -+ vmcs_writel(GUEST_DR7, dr7); -+ -+ return 0; -+} -+ -+static __init int cpu_has_kvm_support(void) -+{ -+ unsigned long ecx = cpuid_ecx(1); -+ return test_bit(5, &ecx); /* CPUID.1:ECX.VMX[bit 5] -> VT */ -+} -+ -+static __init int vmx_disabled_by_bios(void) -+{ -+ u64 msr; -+ -+ rdmsrl(MSR_IA32_FEATURE_CONTROL, msr); -+ return (msr & 5) == 1; /* locked but not enabled */ -+} -+ -+static __init void hardware_enable(void *garbage) -+{ -+ int cpu = raw_smp_processor_id(); -+ u64 phys_addr = __pa(per_cpu(vmxarea, cpu)); -+ u64 old; -+ -+ rdmsrl(MSR_IA32_FEATURE_CONTROL, old); -+ if ((old & 5) == 0) -+ /* enable and lock */ -+ wrmsrl(MSR_IA32_FEATURE_CONTROL, old | 5); -+ write_cr4(read_cr4() | CR4_VMXE); /* FIXME: not cpu hotplug safe */ -+ asm volatile (ASM_VMX_VMXON_RAX : : "a"(&phys_addr), "m"(phys_addr) -+ : "memory", "cc"); -+} -+ -+static void hardware_disable(void *garbage) -+{ -+ asm volatile (ASM_VMX_VMXOFF : : : "cc"); -+} -+ -+static __init void setup_vmcs_descriptor(void) -+{ -+ u32 vmx_msr_low, vmx_msr_high; -+ -+ rdmsr(MSR_IA32_VMX_BASIC_MSR, vmx_msr_low, vmx_msr_high); -+ vmcs_descriptor.size = vmx_msr_high & 0x1fff; -+ vmcs_descriptor.order = get_order(vmcs_descriptor.size); -+ vmcs_descriptor.revision_id = vmx_msr_low; -+}; -+ -+static struct vmcs *alloc_vmcs_cpu(int cpu) -+{ -+ int node = cpu_to_node(cpu); -+ struct page *pages; -+ struct vmcs *vmcs; -+ -+ pages = alloc_pages_node(node, GFP_KERNEL, vmcs_descriptor.order); -+ if (!pages) -+ return NULL; -+ vmcs = page_address(pages); -+ memset(vmcs, 0, vmcs_descriptor.size); -+ vmcs->revision_id = vmcs_descriptor.revision_id; /* vmcs revision id */ -+ return vmcs; -+} -+ -+static struct vmcs *alloc_vmcs(void) -+{ -+ return alloc_vmcs_cpu(smp_processor_id()); -+} -+ -+static void free_vmcs(struct vmcs *vmcs) -+{ -+ free_pages((unsigned long)vmcs, vmcs_descriptor.order); -+} -+ -+static __exit void free_kvm_area(void) -+{ -+ int cpu; -+ -+ for_each_online_cpu(cpu) -+ free_vmcs(per_cpu(vmxarea, cpu)); -+} -+ -+extern struct vmcs *alloc_vmcs_cpu(int cpu); -+ -+static __init int alloc_kvm_area(void) -+{ -+ int cpu; -+ -+ for_each_online_cpu(cpu) { -+ struct vmcs *vmcs; -+ -+ vmcs = alloc_vmcs_cpu(cpu); -+ if (!vmcs) { -+ free_kvm_area(); -+ return -ENOMEM; -+ } -+ -+ per_cpu(vmxarea, cpu) = vmcs; -+ } -+ return 0; -+} -+ -+static __init int hardware_setup(void) -+{ -+ setup_vmcs_descriptor(); -+ return alloc_kvm_area(); -+} -+ -+static __exit void hardware_unsetup(void) -+{ -+ free_kvm_area(); -+} -+ -+static void update_exception_bitmap(struct kvm_vcpu *vcpu) -+{ -+ if (vcpu->rmode.active) -+ vmcs_write32(EXCEPTION_BITMAP, ~0); -+ else -+ vmcs_write32(EXCEPTION_BITMAP, 1 << PF_VECTOR); -+} -+ -+static void fix_pmode_dataseg(int seg, struct kvm_save_segment *save) -+{ -+ struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; -+ -+ if (vmcs_readl(sf->base) == save->base) { -+ vmcs_write16(sf->selector, save->selector); -+ vmcs_writel(sf->base, save->base); -+ vmcs_write32(sf->limit, save->limit); -+ vmcs_write32(sf->ar_bytes, save->ar); -+ } else { -+ u32 dpl = (vmcs_read16(sf->selector) & SELECTOR_RPL_MASK) -+ << AR_DPL_SHIFT; -+ vmcs_write32(sf->ar_bytes, 0x93 | dpl); -+ } -+} -+ -+static void enter_pmode(struct kvm_vcpu *vcpu) -+{ -+ unsigned long flags; -+ -+ vcpu->rmode.active = 0; -+ -+ vmcs_writel(GUEST_TR_BASE, vcpu->rmode.tr.base); -+ vmcs_write32(GUEST_TR_LIMIT, vcpu->rmode.tr.limit); -+ vmcs_write32(GUEST_TR_AR_BYTES, vcpu->rmode.tr.ar); -+ -+ flags = vmcs_readl(GUEST_RFLAGS); -+ flags &= ~(IOPL_MASK | X86_EFLAGS_VM); -+ flags |= (vcpu->rmode.save_iopl << IOPL_SHIFT); -+ vmcs_writel(GUEST_RFLAGS, flags); -+ -+ vmcs_writel(GUEST_CR4, (vmcs_readl(GUEST_CR4) & ~CR4_VME_MASK) | -+ (vmcs_readl(CR4_READ_SHADOW) & CR4_VME_MASK)); -+ -+ update_exception_bitmap(vcpu); -+ -+ fix_pmode_dataseg(VCPU_SREG_ES, &vcpu->rmode.es); -+ fix_pmode_dataseg(VCPU_SREG_DS, &vcpu->rmode.ds); -+ fix_pmode_dataseg(VCPU_SREG_GS, &vcpu->rmode.gs); -+ fix_pmode_dataseg(VCPU_SREG_FS, &vcpu->rmode.fs); -+ -+ vmcs_write16(GUEST_SS_SELECTOR, 0); -+ vmcs_write32(GUEST_SS_AR_BYTES, 0x93); -+ -+ vmcs_write16(GUEST_CS_SELECTOR, -+ vmcs_read16(GUEST_CS_SELECTOR) & ~SELECTOR_RPL_MASK); -+ vmcs_write32(GUEST_CS_AR_BYTES, 0x9b); -+} -+ -+static int rmode_tss_base(struct kvm* kvm) -+{ -+ gfn_t base_gfn = kvm->memslots[0].base_gfn + kvm->memslots[0].npages - 3; -+ return base_gfn << PAGE_SHIFT; -+} -+ -+static void fix_rmode_seg(int seg, struct kvm_save_segment *save) -+{ -+ struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; -+ -+ save->selector = vmcs_read16(sf->selector); -+ save->base = vmcs_readl(sf->base); -+ save->limit = vmcs_read32(sf->limit); -+ save->ar = vmcs_read32(sf->ar_bytes); -+ vmcs_write16(sf->selector, vmcs_readl(sf->base) >> 4); -+ vmcs_write32(sf->limit, 0xffff); -+ vmcs_write32(sf->ar_bytes, 0xf3); -+} -+ -+static void enter_rmode(struct kvm_vcpu *vcpu) -+{ -+ unsigned long flags; -+ -+ vcpu->rmode.active = 1; -+ -+ vcpu->rmode.tr.base = vmcs_readl(GUEST_TR_BASE); -+ vmcs_writel(GUEST_TR_BASE, rmode_tss_base(vcpu->kvm)); -+ -+ vcpu->rmode.tr.limit = vmcs_read32(GUEST_TR_LIMIT); -+ vmcs_write32(GUEST_TR_LIMIT, RMODE_TSS_SIZE - 1); -+ -+ vcpu->rmode.tr.ar = vmcs_read32(GUEST_TR_AR_BYTES); -+ vmcs_write32(GUEST_TR_AR_BYTES, 0x008b); -+ -+ flags = vmcs_readl(GUEST_RFLAGS); -+ vcpu->rmode.save_iopl = (flags & IOPL_MASK) >> IOPL_SHIFT; -+ -+ flags |= IOPL_MASK | X86_EFLAGS_VM; -+ -+ vmcs_writel(GUEST_RFLAGS, flags); -+ vmcs_writel(GUEST_CR4, vmcs_readl(GUEST_CR4) | CR4_VME_MASK); -+ update_exception_bitmap(vcpu); -+ -+ vmcs_write16(GUEST_SS_SELECTOR, vmcs_readl(GUEST_SS_BASE) >> 4); -+ vmcs_write32(GUEST_SS_LIMIT, 0xffff); -+ vmcs_write32(GUEST_SS_AR_BYTES, 0xf3); -+ -+ vmcs_write32(GUEST_CS_AR_BYTES, 0xf3); -+ vmcs_write16(GUEST_CS_SELECTOR, vmcs_readl(GUEST_CS_BASE) >> 4); -+ -+ fix_rmode_seg(VCPU_SREG_ES, &vcpu->rmode.es); -+ fix_rmode_seg(VCPU_SREG_DS, &vcpu->rmode.ds); -+ fix_rmode_seg(VCPU_SREG_GS, &vcpu->rmode.gs); -+ fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs); -+} -+ -+#ifdef __x86_64__ -+ -+static void enter_lmode(struct kvm_vcpu *vcpu) -+{ -+ u32 guest_tr_ar; -+ -+ guest_tr_ar = vmcs_read32(GUEST_TR_AR_BYTES); -+ if ((guest_tr_ar & AR_TYPE_MASK) != AR_TYPE_BUSY_64_TSS) { -+ printk(KERN_DEBUG "%s: tss fixup for long mode. \n", -+ __FUNCTION__); -+ vmcs_write32(GUEST_TR_AR_BYTES, -+ (guest_tr_ar & ~AR_TYPE_MASK) -+ | AR_TYPE_BUSY_64_TSS); -+ } -+ -+ vcpu->shadow_efer |= EFER_LMA; -+ -+ find_msr_entry(vcpu, MSR_EFER)->data |= EFER_LMA | EFER_LME; -+ vmcs_write32(VM_ENTRY_CONTROLS, -+ vmcs_read32(VM_ENTRY_CONTROLS) -+ | VM_ENTRY_CONTROLS_IA32E_MASK); -+} -+ -+static void exit_lmode(struct kvm_vcpu *vcpu) -+{ -+ vcpu->shadow_efer &= ~EFER_LMA; -+ -+ vmcs_write32(VM_ENTRY_CONTROLS, -+ vmcs_read32(VM_ENTRY_CONTROLS) -+ & ~VM_ENTRY_CONTROLS_IA32E_MASK); -+} -+ -+#endif -+ -+static void vmx_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) -+{ -+ if (vcpu->rmode.active && (cr0 & CR0_PE_MASK)) -+ enter_pmode(vcpu); -+ -+ if (!vcpu->rmode.active && !(cr0 & CR0_PE_MASK)) -+ enter_rmode(vcpu); -+ -+#ifdef __x86_64__ -+ if (vcpu->shadow_efer & EFER_LME) { -+ if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) -+ enter_lmode(vcpu); -+ if (is_paging(vcpu) && !(cr0 & CR0_PG_MASK)) -+ exit_lmode(vcpu); -+ } -+#endif -+ -+ vmcs_writel(CR0_READ_SHADOW, cr0); -+ vmcs_writel(GUEST_CR0, -+ (cr0 & ~KVM_GUEST_CR0_MASK) | KVM_VM_CR0_ALWAYS_ON); -+ vcpu->cr0 = cr0; -+} -+ -+/* -+ * Used when restoring the VM to avoid corrupting segment registers -+ */ -+static void vmx_set_cr0_no_modeswitch(struct kvm_vcpu *vcpu, unsigned long cr0) -+{ -+ vcpu->rmode.active = ((cr0 & CR0_PE_MASK) == 0); -+ update_exception_bitmap(vcpu); -+ vmcs_writel(CR0_READ_SHADOW, cr0); -+ vmcs_writel(GUEST_CR0, -+ (cr0 & ~KVM_GUEST_CR0_MASK) | KVM_VM_CR0_ALWAYS_ON); -+ vcpu->cr0 = cr0; -+} -+ -+static void vmx_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3) -+{ -+ vmcs_writel(GUEST_CR3, cr3); -+} -+ -+static void vmx_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) -+{ -+ vmcs_writel(CR4_READ_SHADOW, cr4); -+ vmcs_writel(GUEST_CR4, cr4 | (vcpu->rmode.active ? -+ KVM_RMODE_VM_CR4_ALWAYS_ON : KVM_PMODE_VM_CR4_ALWAYS_ON)); -+ vcpu->cr4 = cr4; -+} -+ -+#ifdef __x86_64__ -+ -+static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer) -+{ -+ struct vmx_msr_entry *msr = find_msr_entry(vcpu, MSR_EFER); -+ -+ vcpu->shadow_efer = efer; -+ if (efer & EFER_LMA) { -+ vmcs_write32(VM_ENTRY_CONTROLS, -+ vmcs_read32(VM_ENTRY_CONTROLS) | -+ VM_ENTRY_CONTROLS_IA32E_MASK); -+ msr->data = efer; -+ -+ } else { -+ vmcs_write32(VM_ENTRY_CONTROLS, -+ vmcs_read32(VM_ENTRY_CONTROLS) & -+ ~VM_ENTRY_CONTROLS_IA32E_MASK); -+ -+ msr->data = efer & ~EFER_LME; -+ } -+} -+ -+#endif -+ -+static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg) -+{ -+ struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; -+ -+ return vmcs_readl(sf->base); -+} -+ -+static void vmx_get_segment(struct kvm_vcpu *vcpu, -+ struct kvm_segment *var, int seg) -+{ -+ struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; -+ u32 ar; -+ -+ var->base = vmcs_readl(sf->base); -+ var->limit = vmcs_read32(sf->limit); -+ var->selector = vmcs_read16(sf->selector); -+ ar = vmcs_read32(sf->ar_bytes); -+ if (ar & AR_UNUSABLE_MASK) -+ ar = 0; -+ var->type = ar & 15; -+ var->s = (ar >> 4) & 1; -+ var->dpl = (ar >> 5) & 3; -+ var->present = (ar >> 7) & 1; -+ var->avl = (ar >> 12) & 1; -+ var->l = (ar >> 13) & 1; -+ var->db = (ar >> 14) & 1; -+ var->g = (ar >> 15) & 1; -+ var->unusable = (ar >> 16) & 1; -+} -+ -+static void vmx_set_segment(struct kvm_vcpu *vcpu, -+ struct kvm_segment *var, int seg) -+{ -+ struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; -+ u32 ar; -+ -+ vmcs_writel(sf->base, var->base); -+ vmcs_write32(sf->limit, var->limit); -+ vmcs_write16(sf->selector, var->selector); -+ if (var->unusable) -+ ar = 1 << 16; -+ else { -+ ar = var->type & 15; -+ ar |= (var->s & 1) << 4; -+ ar |= (var->dpl & 3) << 5; -+ ar |= (var->present & 1) << 7; -+ ar |= (var->avl & 1) << 12; -+ ar |= (var->l & 1) << 13; -+ ar |= (var->db & 1) << 14; -+ ar |= (var->g & 1) << 15; -+ } -+ vmcs_write32(sf->ar_bytes, ar); -+} -+ -+static int vmx_is_long_mode(struct kvm_vcpu *vcpu) -+{ -+ return vmcs_read32(VM_ENTRY_CONTROLS) & VM_ENTRY_CONTROLS_IA32E_MASK; -+} -+ -+static void vmx_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l) -+{ -+ u32 ar = vmcs_read32(GUEST_CS_AR_BYTES); -+ -+ *db = (ar >> 14) & 1; -+ *l = (ar >> 13) & 1; -+} -+ -+static void vmx_get_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) -+{ -+ dt->limit = vmcs_read32(GUEST_IDTR_LIMIT); -+ dt->base = vmcs_readl(GUEST_IDTR_BASE); -+} -+ -+static void vmx_set_idt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) -+{ -+ vmcs_write32(GUEST_IDTR_LIMIT, dt->limit); -+ vmcs_writel(GUEST_IDTR_BASE, dt->base); -+} -+ -+static void vmx_get_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) -+{ -+ dt->limit = vmcs_read32(GUEST_GDTR_LIMIT); -+ dt->base = vmcs_readl(GUEST_GDTR_BASE); -+} -+ -+static void vmx_set_gdt(struct kvm_vcpu *vcpu, struct descriptor_table *dt) -+{ -+ vmcs_write32(GUEST_GDTR_LIMIT, dt->limit); -+ vmcs_writel(GUEST_GDTR_BASE, dt->base); -+} -+ -+static int init_rmode_tss(struct kvm* kvm) -+{ -+ struct page *p1, *p2, *p3; -+ gfn_t fn = rmode_tss_base(kvm) >> PAGE_SHIFT; -+ char *page; -+ -+ p1 = _gfn_to_page(kvm, fn++); -+ p2 = _gfn_to_page(kvm, fn++); -+ p3 = _gfn_to_page(kvm, fn); -+ -+ if (!p1 || !p2 || !p3) { -+ kvm_printf(kvm,"%s: gfn_to_page failed\n", __FUNCTION__); -+ return 0; -+ } -+ -+ page = kmap_atomic(p1, KM_USER0); -+ memset(page, 0, PAGE_SIZE); -+ *(u16*)(page + 0x66) = TSS_BASE_SIZE + TSS_REDIRECTION_SIZE; -+ kunmap_atomic(page, KM_USER0); -+ -+ page = kmap_atomic(p2, KM_USER0); -+ memset(page, 0, PAGE_SIZE); -+ kunmap_atomic(page, KM_USER0); -+ -+ page = kmap_atomic(p3, KM_USER0); -+ memset(page, 0, PAGE_SIZE); -+ *(page + RMODE_TSS_SIZE - 2 * PAGE_SIZE - 1) = ~0; -+ kunmap_atomic(page, KM_USER0); -+ -+ return 1; -+} -+ -+static void vmcs_write32_fixedbits(u32 msr, u32 vmcs_field, u32 val) -+{ -+ u32 msr_high, msr_low; -+ -+ rdmsr(msr, msr_low, msr_high); -+ -+ val &= msr_high; -+ val |= msr_low; -+ vmcs_write32(vmcs_field, val); -+} -+ -+static void seg_setup(int seg) -+{ -+ struct kvm_vmx_segment_field *sf = &kvm_vmx_segment_fields[seg]; -+ -+ vmcs_write16(sf->selector, 0); -+ vmcs_writel(sf->base, 0); -+ vmcs_write32(sf->limit, 0xffff); -+ vmcs_write32(sf->ar_bytes, 0x93); -+} -+ -+/* -+ * Sets up the vmcs for emulated real mode. -+ */ -+static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) -+{ -+ u32 host_sysenter_cs; -+ u32 junk; -+ unsigned long a; -+ struct descriptor_table dt; -+ int i; -+ int ret = 0; -+ int nr_good_msrs; -+ extern asmlinkage void kvm_vmx_return(void); -+ -+ if (!init_rmode_tss(vcpu->kvm)) { -+ ret = -ENOMEM; -+ goto out; -+ } -+ -+ memset(vcpu->regs, 0, sizeof(vcpu->regs)); -+ vcpu->regs[VCPU_REGS_RDX] = get_rdx_init_val(); -+ vcpu->cr8 = 0; -+ vcpu->apic_base = 0xfee00000 | -+ /*for vcpu 0*/ MSR_IA32_APICBASE_BSP | -+ MSR_IA32_APICBASE_ENABLE; -+ -+ fx_init(vcpu); -+ -+ /* -+ * GUEST_CS_BASE should really be 0xffff0000, but VT vm86 mode -+ * insists on having GUEST_CS_BASE == GUEST_CS_SELECTOR << 4. Sigh. -+ */ -+ vmcs_write16(GUEST_CS_SELECTOR, 0xf000); -+ vmcs_writel(GUEST_CS_BASE, 0x000f0000); -+ vmcs_write32(GUEST_CS_LIMIT, 0xffff); -+ vmcs_write32(GUEST_CS_AR_BYTES, 0x9b); -+ -+ seg_setup(VCPU_SREG_DS); -+ seg_setup(VCPU_SREG_ES); -+ seg_setup(VCPU_SREG_FS); -+ seg_setup(VCPU_SREG_GS); -+ seg_setup(VCPU_SREG_SS); -+ -+ vmcs_write16(GUEST_TR_SELECTOR, 0); -+ vmcs_writel(GUEST_TR_BASE, 0); -+ vmcs_write32(GUEST_TR_LIMIT, 0xffff); -+ vmcs_write32(GUEST_TR_AR_BYTES, 0x008b); -+ -+ vmcs_write16(GUEST_LDTR_SELECTOR, 0); -+ vmcs_writel(GUEST_LDTR_BASE, 0); -+ vmcs_write32(GUEST_LDTR_LIMIT, 0xffff); -+ vmcs_write32(GUEST_LDTR_AR_BYTES, 0x00082); -+ -+ vmcs_write32(GUEST_SYSENTER_CS, 0); -+ vmcs_writel(GUEST_SYSENTER_ESP, 0); -+ vmcs_writel(GUEST_SYSENTER_EIP, 0); -+ -+ vmcs_writel(GUEST_RFLAGS, 0x02); -+ vmcs_writel(GUEST_RIP, 0xfff0); -+ vmcs_writel(GUEST_RSP, 0); -+ -+ vmcs_writel(GUEST_CR3, 0); -+ -+ //todo: dr0 = dr1 = dr2 = dr3 = 0; dr6 = 0xffff0ff0 -+ vmcs_writel(GUEST_DR7, 0x400); -+ -+ vmcs_writel(GUEST_GDTR_BASE, 0); -+ vmcs_write32(GUEST_GDTR_LIMIT, 0xffff); -+ -+ vmcs_writel(GUEST_IDTR_BASE, 0); -+ vmcs_write32(GUEST_IDTR_LIMIT, 0xffff); -+ -+ vmcs_write32(GUEST_ACTIVITY_STATE, 0); -+ vmcs_write32(GUEST_INTERRUPTIBILITY_INFO, 0); -+ vmcs_write32(GUEST_PENDING_DBG_EXCEPTIONS, 0); -+ -+ /* I/O */ -+ vmcs_write64(IO_BITMAP_A, 0); -+ vmcs_write64(IO_BITMAP_B, 0); -+ -+ guest_write_tsc(0); -+ -+ vmcs_write64(VMCS_LINK_POINTER, -1ull); /* 22.3.1.5 */ -+ -+ /* Special registers */ -+ vmcs_write64(GUEST_IA32_DEBUGCTL, 0); -+ -+ /* Control */ -+ vmcs_write32_fixedbits(MSR_IA32_VMX_PINBASED_CTLS_MSR, -+ PIN_BASED_VM_EXEC_CONTROL, -+ PIN_BASED_EXT_INTR_MASK /* 20.6.1 */ -+ | PIN_BASED_NMI_EXITING /* 20.6.1 */ -+ ); -+ vmcs_write32_fixedbits(MSR_IA32_VMX_PROCBASED_CTLS_MSR, -+ CPU_BASED_VM_EXEC_CONTROL, -+ CPU_BASED_HLT_EXITING /* 20.6.2 */ -+ | CPU_BASED_CR8_LOAD_EXITING /* 20.6.2 */ -+ | CPU_BASED_CR8_STORE_EXITING /* 20.6.2 */ -+ | CPU_BASED_UNCOND_IO_EXITING /* 20.6.2 */ -+ | CPU_BASED_INVDPG_EXITING -+ | CPU_BASED_MOV_DR_EXITING -+ | CPU_BASED_USE_TSC_OFFSETING /* 21.3 */ -+ ); -+ -+ vmcs_write32(EXCEPTION_BITMAP, 1 << PF_VECTOR); -+ vmcs_write32(PAGE_FAULT_ERROR_CODE_MASK, 0); -+ vmcs_write32(PAGE_FAULT_ERROR_CODE_MATCH, 0); -+ vmcs_write32(CR3_TARGET_COUNT, 0); /* 22.2.1 */ -+ -+ vmcs_writel(HOST_CR0, read_cr0()); /* 22.2.3 */ -+ vmcs_writel(HOST_CR4, read_cr4()); /* 22.2.3, 22.2.5 */ -+ vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */ -+ -+ vmcs_write16(HOST_CS_SELECTOR, __KERNEL_CS); /* 22.2.4 */ -+ vmcs_write16(HOST_DS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ -+ vmcs_write16(HOST_ES_SELECTOR, __KERNEL_DS); /* 22.2.4 */ -+ vmcs_write16(HOST_FS_SELECTOR, read_fs()); /* 22.2.4 */ -+ vmcs_write16(HOST_GS_SELECTOR, read_gs()); /* 22.2.4 */ -+ vmcs_write16(HOST_SS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ -+#ifdef __x86_64__ -+ rdmsrl(MSR_FS_BASE, a); -+ vmcs_writel(HOST_FS_BASE, a); /* 22.2.4 */ -+ rdmsrl(MSR_GS_BASE, a); -+ vmcs_writel(HOST_GS_BASE, a); /* 22.2.4 */ -+#else -+ vmcs_writel(HOST_FS_BASE, 0); /* 22.2.4 */ -+ vmcs_writel(HOST_GS_BASE, 0); /* 22.2.4 */ -+#endif -+ -+ vmcs_write16(HOST_TR_SELECTOR, GDT_ENTRY_TSS*8); /* 22.2.4 */ -+ -+ get_idt(&dt); -+ vmcs_writel(HOST_IDTR_BASE, dt.base); /* 22.2.4 */ -+ -+ -+ vmcs_writel(HOST_RIP, (unsigned long)kvm_vmx_return); /* 22.2.5 */ -+ -+ rdmsr(MSR_IA32_SYSENTER_CS, host_sysenter_cs, junk); -+ vmcs_write32(HOST_IA32_SYSENTER_CS, host_sysenter_cs); -+ rdmsrl(MSR_IA32_SYSENTER_ESP, a); -+ vmcs_writel(HOST_IA32_SYSENTER_ESP, a); /* 22.2.3 */ -+ rdmsrl(MSR_IA32_SYSENTER_EIP, a); -+ vmcs_writel(HOST_IA32_SYSENTER_EIP, a); /* 22.2.3 */ -+ -+ ret = -ENOMEM; -+ vcpu->guest_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); -+ if (!vcpu->guest_msrs) -+ goto out; -+ vcpu->host_msrs = kmalloc(PAGE_SIZE, GFP_KERNEL); -+ if (!vcpu->host_msrs) -+ goto out_free_guest_msrs; -+ -+ for (i = 0; i < NR_VMX_MSR; ++i) { -+ u32 index = vmx_msr_index[i]; -+ u32 data_low, data_high; -+ u64 data; -+ int j = vcpu->nmsrs; -+ -+ if (rdmsr_safe(index, &data_low, &data_high) < 0) -+ continue; -+ data = data_low | ((u64)data_high << 32); -+ vcpu->host_msrs[j].index = index; -+ vcpu->host_msrs[j].reserved = 0; -+ vcpu->host_msrs[j].data = data; -+ vcpu->guest_msrs[j] = vcpu->host_msrs[j]; -+ ++vcpu->nmsrs; -+ } -+ printk(KERN_DEBUG "kvm: msrs: %d\n", vcpu->nmsrs); -+ -+ nr_good_msrs = vcpu->nmsrs - NR_BAD_MSRS; -+ vmcs_writel(VM_ENTRY_MSR_LOAD_ADDR, -+ virt_to_phys(vcpu->guest_msrs + NR_BAD_MSRS)); -+ vmcs_writel(VM_EXIT_MSR_STORE_ADDR, -+ virt_to_phys(vcpu->guest_msrs + NR_BAD_MSRS)); -+ vmcs_writel(VM_EXIT_MSR_LOAD_ADDR, -+ virt_to_phys(vcpu->host_msrs + NR_BAD_MSRS)); -+ vmcs_write32_fixedbits(MSR_IA32_VMX_EXIT_CTLS_MSR, VM_EXIT_CONTROLS, -+ (HOST_IS_64 << 9)); /* 22.2,1, 20.7.1 */ -+ vmcs_write32(VM_EXIT_MSR_STORE_COUNT, nr_good_msrs); /* 22.2.2 */ -+ vmcs_write32(VM_EXIT_MSR_LOAD_COUNT, nr_good_msrs); /* 22.2.2 */ -+ vmcs_write32(VM_ENTRY_MSR_LOAD_COUNT, nr_good_msrs); /* 22.2.2 */ -+ -+ -+ /* 22.2.1, 20.8.1 */ -+ vmcs_write32_fixedbits(MSR_IA32_VMX_ENTRY_CTLS_MSR, -+ VM_ENTRY_CONTROLS, 0); -+ vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0); /* 22.2.1 */ -+ -+ vmcs_writel(VIRTUAL_APIC_PAGE_ADDR, 0); -+ vmcs_writel(TPR_THRESHOLD, 0); -+ -+ vmcs_writel(CR0_GUEST_HOST_MASK, KVM_GUEST_CR0_MASK); -+ vmcs_writel(CR4_GUEST_HOST_MASK, KVM_GUEST_CR4_MASK); -+ -+ vcpu->cr0 = 0x60000010; -+ vmx_set_cr0(vcpu, vcpu->cr0); // enter rmode -+ vmx_set_cr4(vcpu, 0); -+#ifdef __x86_64__ -+ vmx_set_efer(vcpu, 0); -+#endif -+ -+ return 0; -+ -+out_free_guest_msrs: -+ kfree(vcpu->guest_msrs); -+out: -+ return ret; -+} -+ -+static void inject_rmode_irq(struct kvm_vcpu *vcpu, int irq) -+{ -+ u16 ent[2]; -+ u16 cs; -+ u16 ip; -+ unsigned long flags; -+ unsigned long ss_base = vmcs_readl(GUEST_SS_BASE); -+ u16 sp = vmcs_readl(GUEST_RSP); -+ u32 ss_limit = vmcs_read32(GUEST_SS_LIMIT); -+ -+ if (sp > ss_limit || sp - 6 > sp) { -+ vcpu_printf(vcpu, "%s: #SS, rsp 0x%lx ss 0x%lx limit 0x%x\n", -+ __FUNCTION__, -+ vmcs_readl(GUEST_RSP), -+ vmcs_readl(GUEST_SS_BASE), -+ vmcs_read32(GUEST_SS_LIMIT)); -+ return; -+ } -+ -+ if (kvm_read_guest(vcpu, irq * sizeof(ent), sizeof(ent), &ent) != -+ sizeof(ent)) { -+ vcpu_printf(vcpu, "%s: read guest err\n", __FUNCTION__); -+ return; -+ } -+ -+ flags = vmcs_readl(GUEST_RFLAGS); -+ cs = vmcs_readl(GUEST_CS_BASE) >> 4; -+ ip = vmcs_readl(GUEST_RIP); -+ -+ -+ if (kvm_write_guest(vcpu, ss_base + sp - 2, 2, &flags) != 2 || -+ kvm_write_guest(vcpu, ss_base + sp - 4, 2, &cs) != 2 || -+ kvm_write_guest(vcpu, ss_base + sp - 6, 2, &ip) != 2) { -+ vcpu_printf(vcpu, "%s: write guest err\n", __FUNCTION__); -+ return; -+ } -+ -+ vmcs_writel(GUEST_RFLAGS, flags & -+ ~( X86_EFLAGS_IF | X86_EFLAGS_AC | X86_EFLAGS_TF)); -+ vmcs_write16(GUEST_CS_SELECTOR, ent[1]) ; -+ vmcs_writel(GUEST_CS_BASE, ent[1] << 4); -+ vmcs_writel(GUEST_RIP, ent[0]); -+ vmcs_writel(GUEST_RSP, (vmcs_readl(GUEST_RSP) & ~0xffff) | (sp - 6)); -+} -+ -+static void kvm_do_inject_irq(struct kvm_vcpu *vcpu) -+{ -+ int word_index = __ffs(vcpu->irq_summary); -+ int bit_index = __ffs(vcpu->irq_pending[word_index]); -+ int irq = word_index * BITS_PER_LONG + bit_index; -+ -+ clear_bit(bit_index, &vcpu->irq_pending[word_index]); -+ if (!vcpu->irq_pending[word_index]) -+ clear_bit(word_index, &vcpu->irq_summary); -+ -+ if (vcpu->rmode.active) { -+ inject_rmode_irq(vcpu, irq); -+ return; -+ } -+ vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, -+ irq | INTR_TYPE_EXT_INTR | INTR_INFO_VALID_MASK); -+} -+ -+static void kvm_try_inject_irq(struct kvm_vcpu *vcpu) -+{ -+ if ((vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) -+ && (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & 3) == 0) -+ /* -+ * Interrupts enabled, and not blocked by sti or mov ss. Good. -+ */ -+ kvm_do_inject_irq(vcpu); -+ else -+ /* -+ * Interrupts blocked. Wait for unblock. -+ */ -+ vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, -+ vmcs_read32(CPU_BASED_VM_EXEC_CONTROL) -+ | CPU_BASED_VIRTUAL_INTR_PENDING); -+} -+ -+static void kvm_guest_debug_pre(struct kvm_vcpu *vcpu) -+{ -+ struct kvm_guest_debug *dbg = &vcpu->guest_debug; -+ -+ set_debugreg(dbg->bp[0], 0); -+ set_debugreg(dbg->bp[1], 1); -+ set_debugreg(dbg->bp[2], 2); -+ set_debugreg(dbg->bp[3], 3); -+ -+ if (dbg->singlestep) { -+ unsigned long flags; -+ -+ flags = vmcs_readl(GUEST_RFLAGS); -+ flags |= X86_EFLAGS_TF | X86_EFLAGS_RF; -+ vmcs_writel(GUEST_RFLAGS, flags); -+ } -+} -+ -+static int handle_rmode_exception(struct kvm_vcpu *vcpu, -+ int vec, u32 err_code) -+{ -+ if (!vcpu->rmode.active) -+ return 0; -+ -+ if (vec == GP_VECTOR && err_code == 0) -+ if (emulate_instruction(vcpu, NULL, 0, 0) == EMULATE_DONE) -+ return 1; -+ return 0; -+} -+ -+static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u32 intr_info, error_code; -+ unsigned long cr2, rip; -+ u32 vect_info; -+ enum emulation_result er; -+ -+ vect_info = vmcs_read32(IDT_VECTORING_INFO_FIELD); -+ intr_info = vmcs_read32(VM_EXIT_INTR_INFO); -+ -+ if ((vect_info & VECTORING_INFO_VALID_MASK) && -+ !is_page_fault(intr_info)) { -+ printk(KERN_ERR "%s: unexpected, vectoring info 0x%x " -+ "intr info 0x%x\n", __FUNCTION__, vect_info, intr_info); -+ } -+ -+ if (is_external_interrupt(vect_info)) { -+ int irq = vect_info & VECTORING_INFO_VECTOR_MASK; -+ set_bit(irq, vcpu->irq_pending); -+ set_bit(irq / BITS_PER_LONG, &vcpu->irq_summary); -+ } -+ -+ if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == 0x200) { /* nmi */ -+ asm ("int $2"); -+ return 1; -+ } -+ error_code = 0; -+ rip = vmcs_readl(GUEST_RIP); -+ if (intr_info & INTR_INFO_DELIEVER_CODE_MASK) -+ error_code = vmcs_read32(VM_EXIT_INTR_ERROR_CODE); -+ if (is_page_fault(intr_info)) { -+ cr2 = vmcs_readl(EXIT_QUALIFICATION); -+ -+ spin_lock(&vcpu->kvm->lock); -+ if (!vcpu->mmu.page_fault(vcpu, cr2, error_code)) { -+ spin_unlock(&vcpu->kvm->lock); -+ return 1; -+ } -+ -+ er = emulate_instruction(vcpu, kvm_run, cr2, error_code); -+ spin_unlock(&vcpu->kvm->lock); -+ -+ switch (er) { -+ case EMULATE_DONE: -+ return 1; -+ case EMULATE_DO_MMIO: -+ ++kvm_stat.mmio_exits; -+ kvm_run->exit_reason = KVM_EXIT_MMIO; -+ return 0; -+ case EMULATE_FAIL: -+ vcpu_printf(vcpu, "%s: emulate fail\n", __FUNCTION__); -+ break; -+ default: -+ BUG(); -+ } -+ } -+ -+ if (vcpu->rmode.active && -+ handle_rmode_exception(vcpu, intr_info & INTR_INFO_VECTOR_MASK, -+ error_code)) -+ return 1; -+ -+ if ((intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK)) == (INTR_TYPE_EXCEPTION | 1)) { -+ kvm_run->exit_reason = KVM_EXIT_DEBUG; -+ return 0; -+ } -+ kvm_run->exit_reason = KVM_EXIT_EXCEPTION; -+ kvm_run->ex.exception = intr_info & INTR_INFO_VECTOR_MASK; -+ kvm_run->ex.error_code = error_code; -+ return 0; -+} -+ -+static int handle_external_interrupt(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) -+{ -+ ++kvm_stat.irq_exits; -+ return 1; -+} -+ -+ -+static int get_io_count(struct kvm_vcpu *vcpu, u64 *count) -+{ -+ u64 inst; -+ gva_t rip; -+ int countr_size; -+ int i, n; -+ -+ if ((vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_VM)) { -+ countr_size = 2; -+ } else { -+ u32 cs_ar = vmcs_read32(GUEST_CS_AR_BYTES); -+ -+ countr_size = (cs_ar & AR_L_MASK) ? 8: -+ (cs_ar & AR_DB_MASK) ? 4: 2; -+ } -+ -+ rip = vmcs_readl(GUEST_RIP); -+ if (countr_size != 8) -+ rip += vmcs_readl(GUEST_CS_BASE); -+ -+ n = kvm_read_guest(vcpu, rip, sizeof(inst), &inst); -+ -+ for (i = 0; i < n; i++) { -+ switch (((u8*)&inst)[i]) { -+ case 0xf0: -+ case 0xf2: -+ case 0xf3: -+ case 0x2e: -+ case 0x36: -+ case 0x3e: -+ case 0x26: -+ case 0x64: -+ case 0x65: -+ case 0x66: -+ break; -+ case 0x67: -+ countr_size = (countr_size == 2) ? 4: (countr_size >> 1); -+ default: -+ goto done; -+ } -+ } -+ return 0; -+done: -+ countr_size *= 8; -+ *count = vcpu->regs[VCPU_REGS_RCX] & (~0ULL >> (64 - countr_size)); -+ return 1; -+} -+ -+static int handle_io(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u64 exit_qualification; -+ -+ ++kvm_stat.io_exits; -+ exit_qualification = vmcs_read64(EXIT_QUALIFICATION); -+ kvm_run->exit_reason = KVM_EXIT_IO; -+ if (exit_qualification & 8) -+ kvm_run->io.direction = KVM_EXIT_IO_IN; -+ else -+ kvm_run->io.direction = KVM_EXIT_IO_OUT; -+ kvm_run->io.size = (exit_qualification & 7) + 1; -+ kvm_run->io.string = (exit_qualification & 16) != 0; -+ kvm_run->io.string_down -+ = (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_DF) != 0; -+ kvm_run->io.rep = (exit_qualification & 32) != 0; -+ kvm_run->io.port = exit_qualification >> 16; -+ if (kvm_run->io.string) { -+ if (!get_io_count(vcpu, &kvm_run->io.count)) -+ return 1; -+ kvm_run->io.address = vmcs_readl(GUEST_LINEAR_ADDRESS); -+ } else -+ kvm_run->io.value = vcpu->regs[VCPU_REGS_RAX]; /* rax */ -+ return 0; -+} -+ -+static int handle_invlpg(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u64 address = vmcs_read64(EXIT_QUALIFICATION); -+ int instruction_length = vmcs_read32(VM_EXIT_INSTRUCTION_LEN); -+ spin_lock(&vcpu->kvm->lock); -+ vcpu->mmu.inval_page(vcpu, address); -+ spin_unlock(&vcpu->kvm->lock); -+ vmcs_writel(GUEST_RIP, vmcs_readl(GUEST_RIP) + instruction_length); -+ return 1; -+} -+ -+static int handle_cr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u64 exit_qualification; -+ int cr; -+ int reg; -+ -+ exit_qualification = vmcs_read64(EXIT_QUALIFICATION); -+ cr = exit_qualification & 15; -+ reg = (exit_qualification >> 8) & 15; -+ switch ((exit_qualification >> 4) & 3) { -+ case 0: /* mov to cr */ -+ switch (cr) { -+ case 0: -+ vcpu_load_rsp_rip(vcpu); -+ set_cr0(vcpu, vcpu->regs[reg]); -+ skip_emulated_instruction(vcpu); -+ return 1; -+ case 3: -+ vcpu_load_rsp_rip(vcpu); -+ set_cr3(vcpu, vcpu->regs[reg]); -+ skip_emulated_instruction(vcpu); -+ return 1; -+ case 4: -+ vcpu_load_rsp_rip(vcpu); -+ set_cr4(vcpu, vcpu->regs[reg]); -+ skip_emulated_instruction(vcpu); -+ return 1; -+ case 8: -+ vcpu_load_rsp_rip(vcpu); -+ set_cr8(vcpu, vcpu->regs[reg]); -+ skip_emulated_instruction(vcpu); -+ return 1; -+ }; -+ break; -+ case 1: /*mov from cr*/ -+ switch (cr) { -+ case 3: -+ vcpu_load_rsp_rip(vcpu); -+ vcpu->regs[reg] = vcpu->cr3; -+ vcpu_put_rsp_rip(vcpu); -+ skip_emulated_instruction(vcpu); -+ return 1; -+ case 8: -+ printk(KERN_DEBUG "handle_cr: read CR8 " -+ "cpu erratum AA15\n"); -+ vcpu_load_rsp_rip(vcpu); -+ vcpu->regs[reg] = vcpu->cr8; -+ vcpu_put_rsp_rip(vcpu); -+ skip_emulated_instruction(vcpu); -+ return 1; -+ } -+ break; -+ case 3: /* lmsw */ -+ lmsw(vcpu, (exit_qualification >> LMSW_SOURCE_DATA_SHIFT) & 0x0f); -+ -+ skip_emulated_instruction(vcpu); -+ return 1; -+ default: -+ break; -+ } -+ kvm_run->exit_reason = 0; -+ printk(KERN_ERR "kvm: unhandled control register: op %d cr %d\n", -+ (int)(exit_qualification >> 4) & 3, cr); -+ return 0; -+} -+ -+static int handle_dr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u64 exit_qualification; -+ unsigned long val; -+ int dr, reg; -+ -+ /* -+ * FIXME: this code assumes the host is debugging the guest. -+ * need to deal with guest debugging itself too. -+ */ -+ exit_qualification = vmcs_read64(EXIT_QUALIFICATION); -+ dr = exit_qualification & 7; -+ reg = (exit_qualification >> 8) & 15; -+ vcpu_load_rsp_rip(vcpu); -+ if (exit_qualification & 16) { -+ /* mov from dr */ -+ switch (dr) { -+ case 6: -+ val = 0xffff0ff0; -+ break; -+ case 7: -+ val = 0x400; -+ break; -+ default: -+ val = 0; -+ } -+ vcpu->regs[reg] = val; -+ } else { -+ /* mov to dr */ -+ } -+ vcpu_put_rsp_rip(vcpu); -+ skip_emulated_instruction(vcpu); -+ return 1; -+} -+ -+static int handle_cpuid(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ kvm_run->exit_reason = KVM_EXIT_CPUID; -+ return 0; -+} -+ -+static int handle_rdmsr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u32 ecx = vcpu->regs[VCPU_REGS_RCX]; -+ u64 data; -+ -+ if (vmx_get_msr(vcpu, ecx, &data)) { -+ vmx_inject_gp(vcpu, 0); -+ return 1; -+ } -+ -+ /* FIXME: handling of bits 32:63 of rax, rdx */ -+ vcpu->regs[VCPU_REGS_RAX] = data & -1u; -+ vcpu->regs[VCPU_REGS_RDX] = (data >> 32) & -1u; -+ skip_emulated_instruction(vcpu); -+ return 1; -+} -+ -+static int handle_wrmsr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u32 ecx = vcpu->regs[VCPU_REGS_RCX]; -+ u64 data = (vcpu->regs[VCPU_REGS_RAX] & -1u) -+ | ((u64)(vcpu->regs[VCPU_REGS_RDX] & -1u) << 32); -+ -+ if (vmx_set_msr(vcpu, ecx, data) != 0) { -+ vmx_inject_gp(vcpu, 0); -+ return 1; -+ } -+ -+ skip_emulated_instruction(vcpu); -+ return 1; -+} -+ -+static int handle_interrupt_window(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) -+{ -+ /* Turn off interrupt window reporting. */ -+ vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, -+ vmcs_read32(CPU_BASED_VM_EXEC_CONTROL) -+ & ~CPU_BASED_VIRTUAL_INTR_PENDING); -+ return 1; -+} -+ -+static int handle_halt(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ skip_emulated_instruction(vcpu); -+ if (vcpu->irq_summary && (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF)) -+ return 1; -+ -+ kvm_run->exit_reason = KVM_EXIT_HLT; -+ return 0; -+} -+ -+/* -+ * The exit handlers return 1 if the exit was handled fully and guest execution -+ * may resume. Otherwise they set the kvm_run parameter to indicate what needs -+ * to be done to userspace and return 0. -+ */ -+static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu, -+ struct kvm_run *kvm_run) = { -+ [EXIT_REASON_EXCEPTION_NMI] = handle_exception, -+ [EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt, -+ [EXIT_REASON_IO_INSTRUCTION] = handle_io, -+ [EXIT_REASON_INVLPG] = handle_invlpg, -+ [EXIT_REASON_CR_ACCESS] = handle_cr, -+ [EXIT_REASON_DR_ACCESS] = handle_dr, -+ [EXIT_REASON_CPUID] = handle_cpuid, -+ [EXIT_REASON_MSR_READ] = handle_rdmsr, -+ [EXIT_REASON_MSR_WRITE] = handle_wrmsr, -+ [EXIT_REASON_PENDING_INTERRUPT] = handle_interrupt_window, -+ [EXIT_REASON_HLT] = handle_halt, -+}; -+ -+static const int kvm_vmx_max_exit_handlers = -+ sizeof(kvm_vmx_exit_handlers) / sizeof(*kvm_vmx_exit_handlers); -+ -+/* -+ * The guest has exited. See if we can fix it or if we need userspace -+ * assistance. -+ */ -+static int kvm_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) -+{ -+ u32 vectoring_info = vmcs_read32(IDT_VECTORING_INFO_FIELD); -+ u32 exit_reason = vmcs_read32(VM_EXIT_REASON); -+ -+ if ( (vectoring_info & VECTORING_INFO_VALID_MASK) && -+ exit_reason != EXIT_REASON_EXCEPTION_NMI ) -+ printk(KERN_WARNING "%s: unexpected, valid vectoring info and " -+ "exit reason is 0x%x\n", __FUNCTION__, exit_reason); -+ kvm_run->instruction_length = vmcs_read32(VM_EXIT_INSTRUCTION_LEN); -+ if (exit_reason < kvm_vmx_max_exit_handlers -+ && kvm_vmx_exit_handlers[exit_reason]) -+ return kvm_vmx_exit_handlers[exit_reason](vcpu, kvm_run); -+ else { -+ kvm_run->exit_reason = KVM_EXIT_UNKNOWN; -+ kvm_run->hw.hardware_exit_reason = exit_reason; -+ } -+ return 0; -+} -+ -+static int vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -+{ -+ u8 fail; -+ u16 fs_sel, gs_sel, ldt_sel; -+ int fs_gs_ldt_reload_needed; -+ -+again: -+ /* -+ * Set host fs and gs selectors. Unfortunately, 22.2.3 does not -+ * allow segment selectors with cpl > 0 or ti == 1. -+ */ -+ fs_sel = read_fs(); -+ gs_sel = read_gs(); -+ ldt_sel = read_ldt(); -+ fs_gs_ldt_reload_needed = (fs_sel & 7) | (gs_sel & 7) | ldt_sel; -+ if (!fs_gs_ldt_reload_needed) { -+ vmcs_write16(HOST_FS_SELECTOR, fs_sel); -+ vmcs_write16(HOST_GS_SELECTOR, gs_sel); -+ } else { -+ vmcs_write16(HOST_FS_SELECTOR, 0); -+ vmcs_write16(HOST_GS_SELECTOR, 0); -+ } -+ -+#ifdef __x86_64__ -+ vmcs_writel(HOST_FS_BASE, read_msr(MSR_FS_BASE)); -+ vmcs_writel(HOST_GS_BASE, read_msr(MSR_GS_BASE)); -+#else -+ vmcs_writel(HOST_FS_BASE, segment_base(fs_sel)); -+ vmcs_writel(HOST_GS_BASE, segment_base(gs_sel)); -+#endif -+ -+ if (vcpu->irq_summary && -+ !(vmcs_read32(VM_ENTRY_INTR_INFO_FIELD) & INTR_INFO_VALID_MASK)) -+ kvm_try_inject_irq(vcpu); -+ -+ if (vcpu->guest_debug.enabled) -+ kvm_guest_debug_pre(vcpu); -+ -+ fx_save(vcpu->host_fx_image); -+ fx_restore(vcpu->guest_fx_image); -+ -+ save_msrs(vcpu->host_msrs, vcpu->nmsrs); -+ load_msrs(vcpu->guest_msrs, NR_BAD_MSRS); -+ -+ asm ( -+ /* Store host registers */ -+ "pushf \n\t" -+#ifdef __x86_64__ -+ "push %%rax; push %%rbx; push %%rdx;" -+ "push %%rsi; push %%rdi; push %%rbp;" -+ "push %%r8; push %%r9; push %%r10; push %%r11;" -+ "push %%r12; push %%r13; push %%r14; push %%r15;" -+ "push %%rcx \n\t" -+ ASM_VMX_VMWRITE_RSP_RDX "\n\t" -+#else -+ "pusha; push %%ecx \n\t" -+ ASM_VMX_VMWRITE_RSP_RDX "\n\t" -+#endif -+ /* Check if vmlaunch of vmresume is needed */ -+ "cmp $0, %1 \n\t" -+ /* Load guest registers. Don't clobber flags. */ -+#ifdef __x86_64__ -+ "mov %c[cr2](%3), %%rax \n\t" -+ "mov %%rax, %%cr2 \n\t" -+ "mov %c[rax](%3), %%rax \n\t" -+ "mov %c[rbx](%3), %%rbx \n\t" -+ "mov %c[rdx](%3), %%rdx \n\t" -+ "mov %c[rsi](%3), %%rsi \n\t" -+ "mov %c[rdi](%3), %%rdi \n\t" -+ "mov %c[rbp](%3), %%rbp \n\t" -+ "mov %c[r8](%3), %%r8 \n\t" -+ "mov %c[r9](%3), %%r9 \n\t" -+ "mov %c[r10](%3), %%r10 \n\t" -+ "mov %c[r11](%3), %%r11 \n\t" -+ "mov %c[r12](%3), %%r12 \n\t" -+ "mov %c[r13](%3), %%r13 \n\t" -+ "mov %c[r14](%3), %%r14 \n\t" -+ "mov %c[r15](%3), %%r15 \n\t" -+ "mov %c[rcx](%3), %%rcx \n\t" /* kills %3 (rcx) */ -+#else -+ "mov %c[cr2](%3), %%eax \n\t" -+ "mov %%eax, %%cr2 \n\t" -+ "mov %c[rax](%3), %%eax \n\t" -+ "mov %c[rbx](%3), %%ebx \n\t" -+ "mov %c[rdx](%3), %%edx \n\t" -+ "mov %c[rsi](%3), %%esi \n\t" -+ "mov %c[rdi](%3), %%edi \n\t" -+ "mov %c[rbp](%3), %%ebp \n\t" -+ "mov %c[rcx](%3), %%ecx \n\t" /* kills %3 (ecx) */ -+#endif -+ /* Enter guest mode */ -+ "jne launched \n\t" -+ ASM_VMX_VMLAUNCH "\n\t" -+ "jmp kvm_vmx_return \n\t" -+ "launched: " ASM_VMX_VMRESUME "\n\t" -+ ".globl kvm_vmx_return \n\t" -+ "kvm_vmx_return: " -+ /* Save guest registers, load host registers, keep flags */ -+#ifdef __x86_64__ -+ "xchg %3, 0(%%rsp) \n\t" -+ "mov %%rax, %c[rax](%3) \n\t" -+ "mov %%rbx, %c[rbx](%3) \n\t" -+ "pushq 0(%%rsp); popq %c[rcx](%3) \n\t" -+ "mov %%rdx, %c[rdx](%3) \n\t" -+ "mov %%rsi, %c[rsi](%3) \n\t" -+ "mov %%rdi, %c[rdi](%3) \n\t" -+ "mov %%rbp, %c[rbp](%3) \n\t" -+ "mov %%r8, %c[r8](%3) \n\t" -+ "mov %%r9, %c[r9](%3) \n\t" -+ "mov %%r10, %c[r10](%3) \n\t" -+ "mov %%r11, %c[r11](%3) \n\t" -+ "mov %%r12, %c[r12](%3) \n\t" -+ "mov %%r13, %c[r13](%3) \n\t" -+ "mov %%r14, %c[r14](%3) \n\t" -+ "mov %%r15, %c[r15](%3) \n\t" -+ "mov %%cr2, %%rax \n\t" -+ "mov %%rax, %c[cr2](%3) \n\t" -+ "mov 0(%%rsp), %3 \n\t" -+ -+ "pop %%rcx; pop %%r15; pop %%r14; pop %%r13; pop %%r12;" -+ "pop %%r11; pop %%r10; pop %%r9; pop %%r8;" -+ "pop %%rbp; pop %%rdi; pop %%rsi;" -+ "pop %%rdx; pop %%rbx; pop %%rax \n\t" -+#else -+ "xchg %3, 0(%%esp) \n\t" -+ "mov %%eax, %c[rax](%3) \n\t" -+ "mov %%ebx, %c[rbx](%3) \n\t" -+ "pushl 0(%%esp); popl %c[rcx](%3) \n\t" -+ "mov %%edx, %c[rdx](%3) \n\t" -+ "mov %%esi, %c[rsi](%3) \n\t" -+ "mov %%edi, %c[rdi](%3) \n\t" -+ "mov %%ebp, %c[rbp](%3) \n\t" -+ "mov %%cr2, %%eax \n\t" -+ "mov %%eax, %c[cr2](%3) \n\t" -+ "mov 0(%%esp), %3 \n\t" -+ -+ "pop %%ecx; popa \n\t" -+#endif -+ "setbe %0 \n\t" -+ "popf \n\t" -+ : "=g" (fail) -+ : "r"(vcpu->launched), "d"((unsigned long)HOST_RSP), -+ "c"(vcpu), -+ [rax]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RAX])), -+ [rbx]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RBX])), -+ [rcx]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RCX])), -+ [rdx]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RDX])), -+ [rsi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RSI])), -+ [rdi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RDI])), -+ [rbp]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RBP])), -+#ifdef __x86_64__ -+ [r8 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R8 ])), -+ [r9 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R9 ])), -+ [r10]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R10])), -+ [r11]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R11])), -+ [r12]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R12])), -+ [r13]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R13])), -+ [r14]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R14])), -+ [r15]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R15])), -+#endif -+ [cr2]"i"(offsetof(struct kvm_vcpu, cr2)) -+ : "cc", "memory" ); -+ -+ ++kvm_stat.exits; -+ -+ save_msrs(vcpu->guest_msrs, NR_BAD_MSRS); -+ load_msrs(vcpu->host_msrs, NR_BAD_MSRS); -+ -+ fx_save(vcpu->guest_fx_image); -+ fx_restore(vcpu->host_fx_image); -+ -+#ifndef __x86_64__ -+ asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); -+#endif -+ -+ kvm_run->exit_type = 0; -+ if (fail) { -+ kvm_run->exit_type = KVM_EXIT_TYPE_FAIL_ENTRY; -+ kvm_run->exit_reason = vmcs_read32(VM_INSTRUCTION_ERROR); -+ } else { -+ if (fs_gs_ldt_reload_needed) { -+ load_ldt(ldt_sel); -+ load_fs(fs_sel); -+ /* -+ * If we have to reload gs, we must take care to -+ * preserve our gs base. -+ */ -+ local_irq_disable(); -+ load_gs(gs_sel); -+#ifdef __x86_64__ -+ wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE)); -+#endif -+ local_irq_enable(); -+ -+ reload_tss(); -+ } -+ vcpu->launched = 1; -+ kvm_run->exit_type = KVM_EXIT_TYPE_VM_EXIT; -+ if (kvm_handle_exit(kvm_run, vcpu)) { -+ /* Give scheduler a change to reschedule. */ -+ if (signal_pending(current)) { -+ ++kvm_stat.signal_exits; -+ return -EINTR; -+ } -+ kvm_resched(vcpu); -+ goto again; -+ } -+ } -+ return 0; -+} -+ -+static void vmx_flush_tlb(struct kvm_vcpu *vcpu) -+{ -+ vmcs_writel(GUEST_CR3, vmcs_readl(GUEST_CR3)); -+} -+ -+static void vmx_inject_page_fault(struct kvm_vcpu *vcpu, -+ unsigned long addr, -+ u32 err_code) -+{ -+ u32 vect_info = vmcs_read32(IDT_VECTORING_INFO_FIELD); -+ -+ ++kvm_stat.pf_guest; -+ -+ if (is_page_fault(vect_info)) { -+ printk(KERN_DEBUG "inject_page_fault: " -+ "double fault 0x%lx @ 0x%lx\n", -+ addr, vmcs_readl(GUEST_RIP)); -+ vmcs_write32(VM_ENTRY_EXCEPTION_ERROR_CODE, 0); -+ vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, -+ DF_VECTOR | -+ INTR_TYPE_EXCEPTION | -+ INTR_INFO_DELIEVER_CODE_MASK | -+ INTR_INFO_VALID_MASK); -+ return; -+ } -+ vcpu->cr2 = addr; -+ vmcs_write32(VM_ENTRY_EXCEPTION_ERROR_CODE, err_code); -+ vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, -+ PF_VECTOR | -+ INTR_TYPE_EXCEPTION | -+ INTR_INFO_DELIEVER_CODE_MASK | -+ INTR_INFO_VALID_MASK); -+ -+} -+ -+static void vmx_free_vmcs(struct kvm_vcpu *vcpu) -+{ -+ if (vcpu->vmcs) { -+ on_each_cpu(__vcpu_clear, vcpu, 0, 1); -+ free_vmcs(vcpu->vmcs); -+ vcpu->vmcs = NULL; -+ } -+} -+ -+static void vmx_free_vcpu(struct kvm_vcpu *vcpu) -+{ -+ vmx_free_vmcs(vcpu); -+} -+ -+static int vmx_create_vcpu(struct kvm_vcpu *vcpu) -+{ -+ struct vmcs *vmcs; -+ -+ vmcs = alloc_vmcs(); -+ if (!vmcs) -+ return -ENOMEM; -+ vmcs_clear(vmcs); -+ vcpu->vmcs = vmcs; -+ vcpu->launched = 0; -+ return 0; -+} -+ -+static struct kvm_arch_ops vmx_arch_ops = { -+ .cpu_has_kvm_support = cpu_has_kvm_support, -+ .disabled_by_bios = vmx_disabled_by_bios, -+ .hardware_setup = hardware_setup, -+ .hardware_unsetup = hardware_unsetup, -+ .hardware_enable = hardware_enable, -+ .hardware_disable = hardware_disable, -+ -+ .vcpu_create = vmx_create_vcpu, -+ .vcpu_free = vmx_free_vcpu, -+ -+ .vcpu_load = vmx_vcpu_load, -+ .vcpu_put = vmx_vcpu_put, -+ -+ .set_guest_debug = set_guest_debug, -+ .get_msr = vmx_get_msr, -+ .set_msr = vmx_set_msr, -+ .get_segment_base = vmx_get_segment_base, -+ .get_segment = vmx_get_segment, -+ .set_segment = vmx_set_segment, -+ .is_long_mode = vmx_is_long_mode, -+ .get_cs_db_l_bits = vmx_get_cs_db_l_bits, -+ .set_cr0 = vmx_set_cr0, -+ .set_cr0_no_modeswitch = vmx_set_cr0_no_modeswitch, -+ .set_cr3 = vmx_set_cr3, -+ .set_cr4 = vmx_set_cr4, -+#ifdef __x86_64__ -+ .set_efer = vmx_set_efer, -+#endif -+ .get_idt = vmx_get_idt, -+ .set_idt = vmx_set_idt, -+ .get_gdt = vmx_get_gdt, -+ .set_gdt = vmx_set_gdt, -+ .cache_regs = vcpu_load_rsp_rip, -+ .decache_regs = vcpu_put_rsp_rip, -+ .get_rflags = vmx_get_rflags, -+ .set_rflags = vmx_set_rflags, -+ -+ .tlb_flush = vmx_flush_tlb, -+ .inject_page_fault = vmx_inject_page_fault, -+ -+ .inject_gp = vmx_inject_gp, -+ -+ .run = vmx_vcpu_run, -+ .skip_emulated_instruction = skip_emulated_instruction, -+ .vcpu_setup = vmx_vcpu_setup, -+}; -+ -+static int __init vmx_init(void) -+{ -+ kvm_init_arch(&vmx_arch_ops, THIS_MODULE); -+ return 0; -+} -+ -+static void __exit vmx_exit(void) -+{ -+ kvm_exit_arch(); -+} -+ -+module_init(vmx_init) -+module_exit(vmx_exit) ---- /dev/null -+++ b/drivers/kvm/vmx.h -@@ -0,0 +1,296 @@ -+#ifndef VMX_H -+#define VMX_H -+ -+/* -+ * vmx.h: VMX Architecture related definitions -+ * Copyright (c) 2004, Intel Corporation. -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms and conditions of the GNU General Public License, -+ * version 2, as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -+ * more details. -+ * -+ * You should have received a copy of the GNU General Public License along with -+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple -+ * Place - Suite 330, Boston, MA 02111-1307 USA. -+ * -+ * A few random additions are: -+ * Copyright (C) 2006 Qumranet -+ * Avi Kivity -+ * Yaniv Kamay -+ * -+ */ -+ -+#define CPU_BASED_VIRTUAL_INTR_PENDING 0x00000004 -+#define CPU_BASED_USE_TSC_OFFSETING 0x00000008 -+#define CPU_BASED_HLT_EXITING 0x00000080 -+#define CPU_BASED_INVDPG_EXITING 0x00000200 -+#define CPU_BASED_MWAIT_EXITING 0x00000400 -+#define CPU_BASED_RDPMC_EXITING 0x00000800 -+#define CPU_BASED_RDTSC_EXITING 0x00001000 -+#define CPU_BASED_CR8_LOAD_EXITING 0x00080000 -+#define CPU_BASED_CR8_STORE_EXITING 0x00100000 -+#define CPU_BASED_TPR_SHADOW 0x00200000 -+#define CPU_BASED_MOV_DR_EXITING 0x00800000 -+#define CPU_BASED_UNCOND_IO_EXITING 0x01000000 -+#define CPU_BASED_ACTIVATE_IO_BITMAP 0x02000000 -+#define CPU_BASED_MSR_BITMAPS 0x10000000 -+#define CPU_BASED_MONITOR_EXITING 0x20000000 -+#define CPU_BASED_PAUSE_EXITING 0x40000000 -+ -+#define PIN_BASED_EXT_INTR_MASK 0x1 -+#define PIN_BASED_NMI_EXITING 0x8 -+ -+#define VM_EXIT_ACK_INTR_ON_EXIT 0x00008000 -+#define VM_EXIT_HOST_ADD_SPACE_SIZE 0x00000200 -+ -+ -+/* VMCS Encodings */ -+enum vmcs_field { -+ GUEST_ES_SELECTOR = 0x00000800, -+ GUEST_CS_SELECTOR = 0x00000802, -+ GUEST_SS_SELECTOR = 0x00000804, -+ GUEST_DS_SELECTOR = 0x00000806, -+ GUEST_FS_SELECTOR = 0x00000808, -+ GUEST_GS_SELECTOR = 0x0000080a, -+ GUEST_LDTR_SELECTOR = 0x0000080c, -+ GUEST_TR_SELECTOR = 0x0000080e, -+ HOST_ES_SELECTOR = 0x00000c00, -+ HOST_CS_SELECTOR = 0x00000c02, -+ HOST_SS_SELECTOR = 0x00000c04, -+ HOST_DS_SELECTOR = 0x00000c06, -+ HOST_FS_SELECTOR = 0x00000c08, -+ HOST_GS_SELECTOR = 0x00000c0a, -+ HOST_TR_SELECTOR = 0x00000c0c, -+ IO_BITMAP_A = 0x00002000, -+ IO_BITMAP_A_HIGH = 0x00002001, -+ IO_BITMAP_B = 0x00002002, -+ IO_BITMAP_B_HIGH = 0x00002003, -+ MSR_BITMAP = 0x00002004, -+ MSR_BITMAP_HIGH = 0x00002005, -+ VM_EXIT_MSR_STORE_ADDR = 0x00002006, -+ VM_EXIT_MSR_STORE_ADDR_HIGH = 0x00002007, -+ VM_EXIT_MSR_LOAD_ADDR = 0x00002008, -+ VM_EXIT_MSR_LOAD_ADDR_HIGH = 0x00002009, -+ VM_ENTRY_MSR_LOAD_ADDR = 0x0000200a, -+ VM_ENTRY_MSR_LOAD_ADDR_HIGH = 0x0000200b, -+ TSC_OFFSET = 0x00002010, -+ TSC_OFFSET_HIGH = 0x00002011, -+ VIRTUAL_APIC_PAGE_ADDR = 0x00002012, -+ VIRTUAL_APIC_PAGE_ADDR_HIGH = 0x00002013, -+ VMCS_LINK_POINTER = 0x00002800, -+ VMCS_LINK_POINTER_HIGH = 0x00002801, -+ GUEST_IA32_DEBUGCTL = 0x00002802, -+ GUEST_IA32_DEBUGCTL_HIGH = 0x00002803, -+ PIN_BASED_VM_EXEC_CONTROL = 0x00004000, -+ CPU_BASED_VM_EXEC_CONTROL = 0x00004002, -+ EXCEPTION_BITMAP = 0x00004004, -+ PAGE_FAULT_ERROR_CODE_MASK = 0x00004006, -+ PAGE_FAULT_ERROR_CODE_MATCH = 0x00004008, -+ CR3_TARGET_COUNT = 0x0000400a, -+ VM_EXIT_CONTROLS = 0x0000400c, -+ VM_EXIT_MSR_STORE_COUNT = 0x0000400e, -+ VM_EXIT_MSR_LOAD_COUNT = 0x00004010, -+ VM_ENTRY_CONTROLS = 0x00004012, -+ VM_ENTRY_MSR_LOAD_COUNT = 0x00004014, -+ VM_ENTRY_INTR_INFO_FIELD = 0x00004016, -+ VM_ENTRY_EXCEPTION_ERROR_CODE = 0x00004018, -+ VM_ENTRY_INSTRUCTION_LEN = 0x0000401a, -+ TPR_THRESHOLD = 0x0000401c, -+ SECONDARY_VM_EXEC_CONTROL = 0x0000401e, -+ VM_INSTRUCTION_ERROR = 0x00004400, -+ VM_EXIT_REASON = 0x00004402, -+ VM_EXIT_INTR_INFO = 0x00004404, -+ VM_EXIT_INTR_ERROR_CODE = 0x00004406, -+ IDT_VECTORING_INFO_FIELD = 0x00004408, -+ IDT_VECTORING_ERROR_CODE = 0x0000440a, -+ VM_EXIT_INSTRUCTION_LEN = 0x0000440c, -+ VMX_INSTRUCTION_INFO = 0x0000440e, -+ GUEST_ES_LIMIT = 0x00004800, -+ GUEST_CS_LIMIT = 0x00004802, -+ GUEST_SS_LIMIT = 0x00004804, -+ GUEST_DS_LIMIT = 0x00004806, -+ GUEST_FS_LIMIT = 0x00004808, -+ GUEST_GS_LIMIT = 0x0000480a, -+ GUEST_LDTR_LIMIT = 0x0000480c, -+ GUEST_TR_LIMIT = 0x0000480e, -+ GUEST_GDTR_LIMIT = 0x00004810, -+ GUEST_IDTR_LIMIT = 0x00004812, -+ GUEST_ES_AR_BYTES = 0x00004814, -+ GUEST_CS_AR_BYTES = 0x00004816, -+ GUEST_SS_AR_BYTES = 0x00004818, -+ GUEST_DS_AR_BYTES = 0x0000481a, -+ GUEST_FS_AR_BYTES = 0x0000481c, -+ GUEST_GS_AR_BYTES = 0x0000481e, -+ GUEST_LDTR_AR_BYTES = 0x00004820, -+ GUEST_TR_AR_BYTES = 0x00004822, -+ GUEST_INTERRUPTIBILITY_INFO = 0x00004824, -+ GUEST_ACTIVITY_STATE = 0X00004826, -+ GUEST_SYSENTER_CS = 0x0000482A, -+ HOST_IA32_SYSENTER_CS = 0x00004c00, -+ CR0_GUEST_HOST_MASK = 0x00006000, -+ CR4_GUEST_HOST_MASK = 0x00006002, -+ CR0_READ_SHADOW = 0x00006004, -+ CR4_READ_SHADOW = 0x00006006, -+ CR3_TARGET_VALUE0 = 0x00006008, -+ CR3_TARGET_VALUE1 = 0x0000600a, -+ CR3_TARGET_VALUE2 = 0x0000600c, -+ CR3_TARGET_VALUE3 = 0x0000600e, -+ EXIT_QUALIFICATION = 0x00006400, -+ GUEST_LINEAR_ADDRESS = 0x0000640a, -+ GUEST_CR0 = 0x00006800, -+ GUEST_CR3 = 0x00006802, -+ GUEST_CR4 = 0x00006804, -+ GUEST_ES_BASE = 0x00006806, -+ GUEST_CS_BASE = 0x00006808, -+ GUEST_SS_BASE = 0x0000680a, -+ GUEST_DS_BASE = 0x0000680c, -+ GUEST_FS_BASE = 0x0000680e, -+ GUEST_GS_BASE = 0x00006810, -+ GUEST_LDTR_BASE = 0x00006812, -+ GUEST_TR_BASE = 0x00006814, -+ GUEST_GDTR_BASE = 0x00006816, -+ GUEST_IDTR_BASE = 0x00006818, -+ GUEST_DR7 = 0x0000681a, -+ GUEST_RSP = 0x0000681c, -+ GUEST_RIP = 0x0000681e, -+ GUEST_RFLAGS = 0x00006820, -+ GUEST_PENDING_DBG_EXCEPTIONS = 0x00006822, -+ GUEST_SYSENTER_ESP = 0x00006824, -+ GUEST_SYSENTER_EIP = 0x00006826, -+ HOST_CR0 = 0x00006c00, -+ HOST_CR3 = 0x00006c02, -+ HOST_CR4 = 0x00006c04, -+ HOST_FS_BASE = 0x00006c06, -+ HOST_GS_BASE = 0x00006c08, -+ HOST_TR_BASE = 0x00006c0a, -+ HOST_GDTR_BASE = 0x00006c0c, -+ HOST_IDTR_BASE = 0x00006c0e, -+ HOST_IA32_SYSENTER_ESP = 0x00006c10, -+ HOST_IA32_SYSENTER_EIP = 0x00006c12, -+ HOST_RSP = 0x00006c14, -+ HOST_RIP = 0x00006c16, -+}; -+ -+#define VMX_EXIT_REASONS_FAILED_VMENTRY 0x80000000 -+ -+#define EXIT_REASON_EXCEPTION_NMI 0 -+#define EXIT_REASON_EXTERNAL_INTERRUPT 1 -+ -+#define EXIT_REASON_PENDING_INTERRUPT 7 -+ -+#define EXIT_REASON_TASK_SWITCH 9 -+#define EXIT_REASON_CPUID 10 -+#define EXIT_REASON_HLT 12 -+#define EXIT_REASON_INVLPG 14 -+#define EXIT_REASON_RDPMC 15 -+#define EXIT_REASON_RDTSC 16 -+#define EXIT_REASON_VMCALL 18 -+#define EXIT_REASON_VMCLEAR 19 -+#define EXIT_REASON_VMLAUNCH 20 -+#define EXIT_REASON_VMPTRLD 21 -+#define EXIT_REASON_VMPTRST 22 -+#define EXIT_REASON_VMREAD 23 -+#define EXIT_REASON_VMRESUME 24 -+#define EXIT_REASON_VMWRITE 25 -+#define EXIT_REASON_VMOFF 26 -+#define EXIT_REASON_VMON 27 -+#define EXIT_REASON_CR_ACCESS 28 -+#define EXIT_REASON_DR_ACCESS 29 -+#define EXIT_REASON_IO_INSTRUCTION 30 -+#define EXIT_REASON_MSR_READ 31 -+#define EXIT_REASON_MSR_WRITE 32 -+#define EXIT_REASON_MWAIT_INSTRUCTION 36 -+ -+/* -+ * Interruption-information format -+ */ -+#define INTR_INFO_VECTOR_MASK 0xff /* 7:0 */ -+#define INTR_INFO_INTR_TYPE_MASK 0x700 /* 10:8 */ -+#define INTR_INFO_DELIEVER_CODE_MASK 0x800 /* 11 */ -+#define INTR_INFO_VALID_MASK 0x80000000 /* 31 */ -+ -+#define VECTORING_INFO_VECTOR_MASK INTR_INFO_VECTOR_MASK -+#define VECTORING_INFO_TYPE_MASK INTR_INFO_INTR_TYPE_MASK -+#define VECTORING_INFO_DELIEVER_CODE_MASK INTR_INFO_DELIEVER_CODE_MASK -+#define VECTORING_INFO_VALID_MASK INTR_INFO_VALID_MASK -+ -+#define INTR_TYPE_EXT_INTR (0 << 8) /* external interrupt */ -+#define INTR_TYPE_EXCEPTION (3 << 8) /* processor exception */ -+ -+/* -+ * Exit Qualifications for MOV for Control Register Access -+ */ -+#define CONTROL_REG_ACCESS_NUM 0x7 /* 2:0, number of control register */ -+#define CONTROL_REG_ACCESS_TYPE 0x30 /* 5:4, access type */ -+#define CONTROL_REG_ACCESS_REG 0xf00 /* 10:8, general purpose register */ -+#define LMSW_SOURCE_DATA_SHIFT 16 -+#define LMSW_SOURCE_DATA (0xFFFF << LMSW_SOURCE_DATA_SHIFT) /* 16:31 lmsw source */ -+#define REG_EAX (0 << 8) -+#define REG_ECX (1 << 8) -+#define REG_EDX (2 << 8) -+#define REG_EBX (3 << 8) -+#define REG_ESP (4 << 8) -+#define REG_EBP (5 << 8) -+#define REG_ESI (6 << 8) -+#define REG_EDI (7 << 8) -+#define REG_R8 (8 << 8) -+#define REG_R9 (9 << 8) -+#define REG_R10 (10 << 8) -+#define REG_R11 (11 << 8) -+#define REG_R12 (12 << 8) -+#define REG_R13 (13 << 8) -+#define REG_R14 (14 << 8) -+#define REG_R15 (15 << 8) -+ -+/* -+ * Exit Qualifications for MOV for Debug Register Access -+ */ -+#define DEBUG_REG_ACCESS_NUM 0x7 /* 2:0, number of debug register */ -+#define DEBUG_REG_ACCESS_TYPE 0x10 /* 4, direction of access */ -+#define TYPE_MOV_TO_DR (0 << 4) -+#define TYPE_MOV_FROM_DR (1 << 4) -+#define DEBUG_REG_ACCESS_REG 0xf00 /* 11:8, general purpose register */ -+ -+ -+/* segment AR */ -+#define SEGMENT_AR_L_MASK (1 << 13) -+ -+/* entry controls */ -+#define VM_ENTRY_CONTROLS_IA32E_MASK (1 << 9) -+ -+#define AR_TYPE_ACCESSES_MASK 1 -+#define AR_TYPE_READABLE_MASK (1 << 1) -+#define AR_TYPE_WRITEABLE_MASK (1 << 2) -+#define AR_TYPE_CODE_MASK (1 << 3) -+#define AR_TYPE_MASK 0x0f -+#define AR_TYPE_BUSY_64_TSS 11 -+#define AR_TYPE_BUSY_32_TSS 11 -+#define AR_TYPE_BUSY_16_TSS 3 -+#define AR_TYPE_LDT 2 -+ -+#define AR_UNUSABLE_MASK (1 << 16) -+#define AR_S_MASK (1 << 4) -+#define AR_P_MASK (1 << 7) -+#define AR_L_MASK (1 << 13) -+#define AR_DB_MASK (1 << 14) -+#define AR_G_MASK (1 << 15) -+#define AR_DPL_SHIFT 5 -+#define AR_DPL(ar) (((ar) >> AR_DPL_SHIFT) & 3) -+ -+#define AR_RESERVD_MASK 0xfffe0f00 -+ -+#define CR4_VMXE 0x2000 -+ -+#define MSR_IA32_VMX_BASIC_MSR 0x480 -+#define MSR_IA32_FEATURE_CONTROL 0x03a -+#define MSR_IA32_VMX_PINBASED_CTLS_MSR 0x481 -+#define MSR_IA32_VMX_PROCBASED_CTLS_MSR 0x482 -+#define MSR_IA32_VMX_EXIT_CTLS_MSR 0x483 -+#define MSR_IA32_VMX_ENTRY_CTLS_MSR 0x484 -+ -+#endif ---- /dev/null -+++ b/drivers/kvm/x86_emulate.c -@@ -0,0 +1,1409 @@ -+/****************************************************************************** -+ * x86_emulate.c -+ * -+ * Generic x86 (32-bit and 64-bit) instruction decoder and emulator. -+ * -+ * Copyright (c) 2005 Keir Fraser -+ * -+ * Linux coding style, mod r/m decoder, segment base fixes, real-mode -+ * privieged instructions: -+ * -+ * Copyright (C) 2006 Qumranet -+ * -+ * Avi Kivity -+ * Yaniv Kamay -+ * -+ * This work is licensed under the terms of the GNU GPL, version 2. See -+ * the COPYING file in the top-level directory. -+ * -+ * From: xen-unstable 10676:af9809f51f81a3c43f276f00c81a52ef558afda4 -+ */ -+ -+#ifndef __KERNEL__ -+#include -+#include -+#include -+#define DPRINTF(_f, _a ...) printf( _f , ## _a ) -+#else -+#include "kvm.h" -+#define DPRINTF(x...) do {} while (0) -+#endif -+#include "x86_emulate.h" -+#include -+ -+/* -+ * Opcode effective-address decode tables. -+ * Note that we only emulate instructions that have at least one memory -+ * operand (excluding implicit stack references). We assume that stack -+ * references and instruction fetches will never occur in special memory -+ * areas that require emulation. So, for example, 'mov ,' need -+ * not be handled. -+ */ -+ -+/* Operand sizes: 8-bit operands or specified/overridden size. */ -+#define ByteOp (1<<0) /* 8-bit operands. */ -+/* Destination operand type. */ -+#define ImplicitOps (1<<1) /* Implicit in opcode. No generic decode. */ -+#define DstReg (2<<1) /* Register operand. */ -+#define DstMem (3<<1) /* Memory operand. */ -+#define DstMask (3<<1) -+/* Source operand type. */ -+#define SrcNone (0<<3) /* No source operand. */ -+#define SrcImplicit (0<<3) /* Source operand is implicit in the opcode. */ -+#define SrcReg (1<<3) /* Register operand. */ -+#define SrcMem (2<<3) /* Memory operand. */ -+#define SrcMem16 (3<<3) /* Memory operand (16-bit). */ -+#define SrcMem32 (4<<3) /* Memory operand (32-bit). */ -+#define SrcImm (5<<3) /* Immediate operand. */ -+#define SrcImmByte (6<<3) /* 8-bit sign-extended immediate operand. */ -+#define SrcMask (7<<3) -+/* Generic ModRM decode. */ -+#define ModRM (1<<6) -+/* Destination is only written; never read. */ -+#define Mov (1<<7) -+ -+static u8 opcode_table[256] = { -+ /* 0x00 - 0x07 */ -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, -+ 0, 0, 0, 0, -+ /* 0x08 - 0x0F */ -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, -+ 0, 0, 0, 0, -+ /* 0x10 - 0x17 */ -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, -+ 0, 0, 0, 0, -+ /* 0x18 - 0x1F */ -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, -+ 0, 0, 0, 0, -+ /* 0x20 - 0x27 */ -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, -+ 0, 0, 0, 0, -+ /* 0x28 - 0x2F */ -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, -+ 0, 0, 0, 0, -+ /* 0x30 - 0x37 */ -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, -+ 0, 0, 0, 0, -+ /* 0x38 - 0x3F */ -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, -+ 0, 0, 0, 0, -+ /* 0x40 - 0x4F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x50 - 0x5F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x60 - 0x6F */ -+ 0, 0, 0, DstReg | SrcMem32 | ModRM | Mov /* movsxd (x86/64) */ , -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x70 - 0x7F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x80 - 0x87 */ -+ ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImm | ModRM, -+ ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImmByte | ModRM, -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, -+ /* 0x88 - 0x8F */ -+ ByteOp | DstMem | SrcReg | ModRM | Mov, DstMem | SrcReg | ModRM | Mov, -+ ByteOp | DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, -+ 0, 0, 0, DstMem | SrcNone | ModRM | Mov, -+ /* 0x90 - 0x9F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0xA0 - 0xA7 */ -+ ByteOp | DstReg | SrcMem | Mov, DstReg | SrcMem | Mov, -+ ByteOp | DstMem | SrcReg | Mov, DstMem | SrcReg | Mov, -+ ByteOp | ImplicitOps | Mov, ImplicitOps | Mov, -+ ByteOp | ImplicitOps, ImplicitOps, -+ /* 0xA8 - 0xAF */ -+ 0, 0, ByteOp | ImplicitOps | Mov, ImplicitOps | Mov, -+ ByteOp | ImplicitOps | Mov, ImplicitOps | Mov, -+ ByteOp | ImplicitOps, ImplicitOps, -+ /* 0xB0 - 0xBF */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0xC0 - 0xC7 */ -+ ByteOp | DstMem | SrcImm | ModRM, DstMem | SrcImmByte | ModRM, 0, 0, -+ 0, 0, ByteOp | DstMem | SrcImm | ModRM | Mov, -+ DstMem | SrcImm | ModRM | Mov, -+ /* 0xC8 - 0xCF */ -+ 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0xD0 - 0xD7 */ -+ ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM, -+ ByteOp | DstMem | SrcImplicit | ModRM, DstMem | SrcImplicit | ModRM, -+ 0, 0, 0, 0, -+ /* 0xD8 - 0xDF */ -+ 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0xE0 - 0xEF */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0xF0 - 0xF7 */ -+ 0, 0, 0, 0, -+ 0, 0, ByteOp | DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM, -+ /* 0xF8 - 0xFF */ -+ 0, 0, 0, 0, -+ 0, 0, ByteOp | DstMem | SrcNone | ModRM, DstMem | SrcNone | ModRM -+}; -+ -+static u8 twobyte_table[256] = { -+ /* 0x00 - 0x0F */ -+ 0, SrcMem | ModRM | DstReg, 0, 0, 0, 0, ImplicitOps, 0, -+ 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, -+ /* 0x10 - 0x1F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x20 - 0x2F */ -+ ModRM | ImplicitOps, ModRM, ModRM | ImplicitOps, ModRM, 0, 0, 0, 0, -+ 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x30 - 0x3F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x40 - 0x47 */ -+ DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, -+ DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, -+ DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, -+ DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, -+ /* 0x48 - 0x4F */ -+ DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, -+ DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, -+ DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, -+ DstReg | SrcMem | ModRM | Mov, DstReg | SrcMem | ModRM | Mov, -+ /* 0x50 - 0x5F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x60 - 0x6F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x70 - 0x7F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x80 - 0x8F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0x90 - 0x9F */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0xA0 - 0xA7 */ -+ 0, 0, 0, DstMem | SrcReg | ModRM, 0, 0, 0, 0, -+ /* 0xA8 - 0xAF */ -+ 0, 0, 0, DstMem | SrcReg | ModRM, 0, 0, 0, 0, -+ /* 0xB0 - 0xB7 */ -+ ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 0, -+ DstMem | SrcReg | ModRM, -+ 0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov, -+ DstReg | SrcMem16 | ModRM | Mov, -+ /* 0xB8 - 0xBF */ -+ 0, 0, DstMem | SrcImmByte | ModRM, DstMem | SrcReg | ModRM, -+ 0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov, -+ DstReg | SrcMem16 | ModRM | Mov, -+ /* 0xC0 - 0xCF */ -+ 0, 0, 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0xD0 - 0xDF */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0xE0 - 0xEF */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -+ /* 0xF0 - 0xFF */ -+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -+}; -+ -+/* -+ * Tell the emulator that of the Group 7 instructions (sgdt, lidt, etc.) we -+ * are interested only in invlpg and not in any of the rest. -+ * -+ * invlpg is a special instruction in that the data it references may not -+ * be mapped. -+ */ -+void kvm_emulator_want_group7_invlpg(void) -+{ -+ twobyte_table[1] &= ~SrcMem; -+} -+EXPORT_SYMBOL_GPL(kvm_emulator_want_group7_invlpg); -+ -+/* Type, address-of, and value of an instruction's operand. */ -+struct operand { -+ enum { OP_REG, OP_MEM, OP_IMM } type; -+ unsigned int bytes; -+ unsigned long val, orig_val, *ptr; -+}; -+ -+/* EFLAGS bit definitions. */ -+#define EFLG_OF (1<<11) -+#define EFLG_DF (1<<10) -+#define EFLG_SF (1<<7) -+#define EFLG_ZF (1<<6) -+#define EFLG_AF (1<<4) -+#define EFLG_PF (1<<2) -+#define EFLG_CF (1<<0) -+ -+/* -+ * Instruction emulation: -+ * Most instructions are emulated directly via a fragment of inline assembly -+ * code. This allows us to save/restore EFLAGS and thus very easily pick up -+ * any modified flags. -+ */ -+ -+#if defined(__x86_64__) -+#define _LO32 "k" /* force 32-bit operand */ -+#define _STK "%%rsp" /* stack pointer */ -+#elif defined(__i386__) -+#define _LO32 "" /* force 32-bit operand */ -+#define _STK "%%esp" /* stack pointer */ -+#endif -+ -+/* -+ * These EFLAGS bits are restored from saved value during emulation, and -+ * any changes are written back to the saved value after emulation. -+ */ -+#define EFLAGS_MASK (EFLG_OF|EFLG_SF|EFLG_ZF|EFLG_AF|EFLG_PF|EFLG_CF) -+ -+/* Before executing instruction: restore necessary bits in EFLAGS. */ -+#define _PRE_EFLAGS(_sav, _msk, _tmp) \ -+ /* EFLAGS = (_sav & _msk) | (EFLAGS & ~_msk); */ \ -+ "push %"_sav"; " \ -+ "movl %"_msk",%"_LO32 _tmp"; " \ -+ "andl %"_LO32 _tmp",("_STK"); " \ -+ "pushf; " \ -+ "notl %"_LO32 _tmp"; " \ -+ "andl %"_LO32 _tmp",("_STK"); " \ -+ "pop %"_tmp"; " \ -+ "orl %"_LO32 _tmp",("_STK"); " \ -+ "popf; " \ -+ /* _sav &= ~msk; */ \ -+ "movl %"_msk",%"_LO32 _tmp"; " \ -+ "notl %"_LO32 _tmp"; " \ -+ "andl %"_LO32 _tmp",%"_sav"; " -+ -+/* After executing instruction: write-back necessary bits in EFLAGS. */ -+#define _POST_EFLAGS(_sav, _msk, _tmp) \ -+ /* _sav |= EFLAGS & _msk; */ \ -+ "pushf; " \ -+ "pop %"_tmp"; " \ -+ "andl %"_msk",%"_LO32 _tmp"; " \ -+ "orl %"_LO32 _tmp",%"_sav"; " -+ -+/* Raw emulation: instruction has two explicit operands. */ -+#define __emulate_2op_nobyte(_op,_src,_dst,_eflags,_wx,_wy,_lx,_ly,_qx,_qy) \ -+ do { \ -+ unsigned long _tmp; \ -+ \ -+ switch ((_dst).bytes) { \ -+ case 2: \ -+ __asm__ __volatile__ ( \ -+ _PRE_EFLAGS("0","4","2") \ -+ _op"w %"_wx"3,%1; " \ -+ _POST_EFLAGS("0","4","2") \ -+ : "=m" (_eflags), "=m" ((_dst).val), \ -+ "=&r" (_tmp) \ -+ : _wy ((_src).val), "i" (EFLAGS_MASK) ); \ -+ break; \ -+ case 4: \ -+ __asm__ __volatile__ ( \ -+ _PRE_EFLAGS("0","4","2") \ -+ _op"l %"_lx"3,%1; " \ -+ _POST_EFLAGS("0","4","2") \ -+ : "=m" (_eflags), "=m" ((_dst).val), \ -+ "=&r" (_tmp) \ -+ : _ly ((_src).val), "i" (EFLAGS_MASK) ); \ -+ break; \ -+ case 8: \ -+ __emulate_2op_8byte(_op, _src, _dst, \ -+ _eflags, _qx, _qy); \ -+ break; \ -+ } \ -+ } while (0) -+ -+#define __emulate_2op(_op,_src,_dst,_eflags,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \ -+ do { \ -+ unsigned long _tmp; \ -+ switch ( (_dst).bytes ) \ -+ { \ -+ case 1: \ -+ __asm__ __volatile__ ( \ -+ _PRE_EFLAGS("0","4","2") \ -+ _op"b %"_bx"3,%1; " \ -+ _POST_EFLAGS("0","4","2") \ -+ : "=m" (_eflags), "=m" ((_dst).val), \ -+ "=&r" (_tmp) \ -+ : _by ((_src).val), "i" (EFLAGS_MASK) ); \ -+ break; \ -+ default: \ -+ __emulate_2op_nobyte(_op, _src, _dst, _eflags, \ -+ _wx, _wy, _lx, _ly, _qx, _qy); \ -+ break; \ -+ } \ -+ } while (0) -+ -+/* Source operand is byte-sized and may be restricted to just %cl. */ -+#define emulate_2op_SrcB(_op, _src, _dst, _eflags) \ -+ __emulate_2op(_op, _src, _dst, _eflags, \ -+ "b", "c", "b", "c", "b", "c", "b", "c") -+ -+/* Source operand is byte, word, long or quad sized. */ -+#define emulate_2op_SrcV(_op, _src, _dst, _eflags) \ -+ __emulate_2op(_op, _src, _dst, _eflags, \ -+ "b", "q", "w", "r", _LO32, "r", "", "r") -+ -+/* Source operand is word, long or quad sized. */ -+#define emulate_2op_SrcV_nobyte(_op, _src, _dst, _eflags) \ -+ __emulate_2op_nobyte(_op, _src, _dst, _eflags, \ -+ "w", "r", _LO32, "r", "", "r") -+ -+/* Instruction has only one explicit operand (no source operand). */ -+#define emulate_1op(_op, _dst, _eflags) \ -+ do { \ -+ unsigned long _tmp; \ -+ \ -+ switch ( (_dst).bytes ) \ -+ { \ -+ case 1: \ -+ __asm__ __volatile__ ( \ -+ _PRE_EFLAGS("0","3","2") \ -+ _op"b %1; " \ -+ _POST_EFLAGS("0","3","2") \ -+ : "=m" (_eflags), "=m" ((_dst).val), \ -+ "=&r" (_tmp) \ -+ : "i" (EFLAGS_MASK) ); \ -+ break; \ -+ case 2: \ -+ __asm__ __volatile__ ( \ -+ _PRE_EFLAGS("0","3","2") \ -+ _op"w %1; " \ -+ _POST_EFLAGS("0","3","2") \ -+ : "=m" (_eflags), "=m" ((_dst).val), \ -+ "=&r" (_tmp) \ -+ : "i" (EFLAGS_MASK) ); \ -+ break; \ -+ case 4: \ -+ __asm__ __volatile__ ( \ -+ _PRE_EFLAGS("0","3","2") \ -+ _op"l %1; " \ -+ _POST_EFLAGS("0","3","2") \ -+ : "=m" (_eflags), "=m" ((_dst).val), \ -+ "=&r" (_tmp) \ -+ : "i" (EFLAGS_MASK) ); \ -+ break; \ -+ case 8: \ -+ __emulate_1op_8byte(_op, _dst, _eflags); \ -+ break; \ -+ } \ -+ } while (0) -+ -+/* Emulate an instruction with quadword operands (x86/64 only). */ -+#if defined(__x86_64__) -+#define __emulate_2op_8byte(_op, _src, _dst, _eflags, _qx, _qy) \ -+ do { \ -+ __asm__ __volatile__ ( \ -+ _PRE_EFLAGS("0","4","2") \ -+ _op"q %"_qx"3,%1; " \ -+ _POST_EFLAGS("0","4","2") \ -+ : "=m" (_eflags), "=m" ((_dst).val), "=&r" (_tmp) \ -+ : _qy ((_src).val), "i" (EFLAGS_MASK) ); \ -+ } while (0) -+ -+#define __emulate_1op_8byte(_op, _dst, _eflags) \ -+ do { \ -+ __asm__ __volatile__ ( \ -+ _PRE_EFLAGS("0","3","2") \ -+ _op"q %1; " \ -+ _POST_EFLAGS("0","3","2") \ -+ : "=m" (_eflags), "=m" ((_dst).val), "=&r" (_tmp) \ -+ : "i" (EFLAGS_MASK) ); \ -+ } while (0) -+ -+#elif defined(__i386__) -+#define __emulate_2op_8byte(_op, _src, _dst, _eflags, _qx, _qy) -+#define __emulate_1op_8byte(_op, _dst, _eflags) -+#endif /* __i386__ */ -+ -+/* Fetch next part of the instruction being emulated. */ -+#define insn_fetch(_type, _size, _eip) \ -+({ unsigned long _x; \ -+ rc = ops->read_std((unsigned long)(_eip) + ctxt->cs_base, &_x, \ -+ (_size), ctxt); \ -+ if ( rc != 0 ) \ -+ goto done; \ -+ (_eip) += (_size); \ -+ (_type)_x; \ -+}) -+ -+/* Access/update address held in a register, based on addressing mode. */ -+#define register_address(base, reg) \ -+ ((base) + ((ad_bytes == sizeof(unsigned long)) ? (reg) : \ -+ ((reg) & ((1UL << (ad_bytes << 3)) - 1)))) -+ -+#define register_address_increment(reg, inc) \ -+ do { \ -+ /* signed type ensures sign extension to long */ \ -+ int _inc = (inc); \ -+ if ( ad_bytes == sizeof(unsigned long) ) \ -+ (reg) += _inc; \ -+ else \ -+ (reg) = ((reg) & ~((1UL << (ad_bytes << 3)) - 1)) | \ -+ (((reg) + _inc) & ((1UL << (ad_bytes << 3)) - 1)); \ -+ } while (0) -+ -+void *decode_register(u8 modrm_reg, unsigned long *regs, -+ int highbyte_regs) -+{ -+ void *p; -+ -+ p = ®s[modrm_reg]; -+ if (highbyte_regs && modrm_reg >= 4 && modrm_reg < 8) -+ p = (unsigned char *)®s[modrm_reg & 3] + 1; -+ return p; -+} -+ -+static int read_descriptor(struct x86_emulate_ctxt *ctxt, -+ struct x86_emulate_ops *ops, -+ void *ptr, -+ u16 *size, unsigned long *address, int op_bytes) -+{ -+ int rc; -+ -+ if (op_bytes == 2) -+ op_bytes = 3; -+ *address = 0; -+ rc = ops->read_std((unsigned long)ptr, (unsigned long *)size, 2, ctxt); -+ if (rc) -+ return rc; -+ rc = ops->read_std((unsigned long)ptr + 2, address, op_bytes, ctxt); -+ return rc; -+} -+ -+int -+x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops) -+{ -+ u8 b, d, sib, twobyte = 0, rex_prefix = 0; -+ u8 modrm, modrm_mod = 0, modrm_reg = 0, modrm_rm = 0; -+ unsigned long *override_base = NULL; -+ unsigned int op_bytes, ad_bytes, lock_prefix = 0, rep_prefix = 0, i; -+ int rc = 0; -+ struct operand src, dst; -+ unsigned long cr2 = ctxt->cr2; -+ int mode = ctxt->mode; -+ unsigned long modrm_ea; -+ int use_modrm_ea, index_reg = 0, base_reg = 0, scale, rip_relative = 0; -+ -+ /* Shadow copy of register state. Committed on successful emulation. */ -+ unsigned long _regs[NR_VCPU_REGS]; -+ unsigned long _eip = ctxt->vcpu->rip, _eflags = ctxt->eflags; -+ unsigned long modrm_val = 0; -+ -+ memcpy(_regs, ctxt->vcpu->regs, sizeof _regs); -+ -+ switch (mode) { -+ case X86EMUL_MODE_REAL: -+ case X86EMUL_MODE_PROT16: -+ op_bytes = ad_bytes = 2; -+ break; -+ case X86EMUL_MODE_PROT32: -+ op_bytes = ad_bytes = 4; -+ break; -+#ifdef __x86_64__ -+ case X86EMUL_MODE_PROT64: -+ op_bytes = 4; -+ ad_bytes = 8; -+ break; -+#endif -+ default: -+ return -1; -+ } -+ -+ /* Legacy prefixes. */ -+ for (i = 0; i < 8; i++) { -+ switch (b = insn_fetch(u8, 1, _eip)) { -+ case 0x66: /* operand-size override */ -+ op_bytes ^= 6; /* switch between 2/4 bytes */ -+ break; -+ case 0x67: /* address-size override */ -+ if (mode == X86EMUL_MODE_PROT64) -+ ad_bytes ^= 12; /* switch between 4/8 bytes */ -+ else -+ ad_bytes ^= 6; /* switch between 2/4 bytes */ -+ break; -+ case 0x2e: /* CS override */ -+ override_base = &ctxt->cs_base; -+ break; -+ case 0x3e: /* DS override */ -+ override_base = &ctxt->ds_base; -+ break; -+ case 0x26: /* ES override */ -+ override_base = &ctxt->es_base; -+ break; -+ case 0x64: /* FS override */ -+ override_base = &ctxt->fs_base; -+ break; -+ case 0x65: /* GS override */ -+ override_base = &ctxt->gs_base; -+ break; -+ case 0x36: /* SS override */ -+ override_base = &ctxt->ss_base; -+ break; -+ case 0xf0: /* LOCK */ -+ lock_prefix = 1; -+ break; -+ case 0xf3: /* REP/REPE/REPZ */ -+ rep_prefix = 1; -+ break; -+ case 0xf2: /* REPNE/REPNZ */ -+ break; -+ default: -+ goto done_prefixes; -+ } -+ } -+ -+done_prefixes: -+ -+ /* REX prefix. */ -+ if ((mode == X86EMUL_MODE_PROT64) && ((b & 0xf0) == 0x40)) { -+ rex_prefix = b; -+ if (b & 8) -+ op_bytes = 8; /* REX.W */ -+ modrm_reg = (b & 4) << 1; /* REX.R */ -+ index_reg = (b & 2) << 2; /* REX.X */ -+ modrm_rm = base_reg = (b & 1) << 3; /* REG.B */ -+ b = insn_fetch(u8, 1, _eip); -+ } -+ -+ /* Opcode byte(s). */ -+ d = opcode_table[b]; -+ if (d == 0) { -+ /* Two-byte opcode? */ -+ if (b == 0x0f) { -+ twobyte = 1; -+ b = insn_fetch(u8, 1, _eip); -+ d = twobyte_table[b]; -+ } -+ -+ /* Unrecognised? */ -+ if (d == 0) -+ goto cannot_emulate; -+ } -+ -+ /* ModRM and SIB bytes. */ -+ if (d & ModRM) { -+ modrm = insn_fetch(u8, 1, _eip); -+ modrm_mod |= (modrm & 0xc0) >> 6; -+ modrm_reg |= (modrm & 0x38) >> 3; -+ modrm_rm |= (modrm & 0x07); -+ modrm_ea = 0; -+ use_modrm_ea = 1; -+ -+ if (modrm_mod == 3) { -+ modrm_val = *(unsigned long *) -+ decode_register(modrm_rm, _regs, d & ByteOp); -+ goto modrm_done; -+ } -+ -+ if (ad_bytes == 2) { -+ unsigned bx = _regs[VCPU_REGS_RBX]; -+ unsigned bp = _regs[VCPU_REGS_RBP]; -+ unsigned si = _regs[VCPU_REGS_RSI]; -+ unsigned di = _regs[VCPU_REGS_RDI]; -+ -+ /* 16-bit ModR/M decode. */ -+ switch (modrm_mod) { -+ case 0: -+ if (modrm_rm == 6) -+ modrm_ea += insn_fetch(u16, 2, _eip); -+ break; -+ case 1: -+ modrm_ea += insn_fetch(s8, 1, _eip); -+ break; -+ case 2: -+ modrm_ea += insn_fetch(u16, 2, _eip); -+ break; -+ } -+ switch (modrm_rm) { -+ case 0: -+ modrm_ea += bx + si; -+ break; -+ case 1: -+ modrm_ea += bx + di; -+ break; -+ case 2: -+ modrm_ea += bp + si; -+ break; -+ case 3: -+ modrm_ea += bp + di; -+ break; -+ case 4: -+ modrm_ea += si; -+ break; -+ case 5: -+ modrm_ea += di; -+ break; -+ case 6: -+ if (modrm_mod != 0) -+ modrm_ea += bp; -+ break; -+ case 7: -+ modrm_ea += bx; -+ break; -+ } -+ if (modrm_rm == 2 || modrm_rm == 3 || -+ (modrm_rm == 6 && modrm_mod != 0)) -+ if (!override_base) -+ override_base = &ctxt->ss_base; -+ modrm_ea = (u16)modrm_ea; -+ } else { -+ /* 32/64-bit ModR/M decode. */ -+ switch (modrm_rm) { -+ case 4: -+ case 12: -+ sib = insn_fetch(u8, 1, _eip); -+ index_reg |= (sib >> 3) & 7; -+ base_reg |= sib & 7; -+ scale = sib >> 6; -+ -+ switch (base_reg) { -+ case 5: -+ if (modrm_mod != 0) -+ modrm_ea += _regs[base_reg]; -+ else -+ modrm_ea += insn_fetch(s32, 4, _eip); -+ break; -+ default: -+ modrm_ea += _regs[base_reg]; -+ } -+ switch (index_reg) { -+ case 4: -+ break; -+ default: -+ modrm_ea += _regs[index_reg] << scale; -+ -+ } -+ break; -+ case 5: -+ if (modrm_mod != 0) -+ modrm_ea += _regs[modrm_rm]; -+ else if (mode == X86EMUL_MODE_PROT64) -+ rip_relative = 1; -+ break; -+ default: -+ modrm_ea += _regs[modrm_rm]; -+ break; -+ } -+ switch (modrm_mod) { -+ case 0: -+ if (modrm_rm == 5) -+ modrm_ea += insn_fetch(s32, 4, _eip); -+ break; -+ case 1: -+ modrm_ea += insn_fetch(s8, 1, _eip); -+ break; -+ case 2: -+ modrm_ea += insn_fetch(s32, 4, _eip); -+ break; -+ } -+ } -+ if (!override_base) -+ override_base = &ctxt->ds_base; -+ if (mode == X86EMUL_MODE_PROT64 && -+ override_base != &ctxt->fs_base && -+ override_base != &ctxt->gs_base) -+ override_base = NULL; -+ -+ if (override_base) -+ modrm_ea += *override_base; -+ -+ if (rip_relative) { -+ modrm_ea += _eip; -+ switch (d & SrcMask) { -+ case SrcImmByte: -+ modrm_ea += 1; -+ break; -+ case SrcImm: -+ if (d & ByteOp) -+ modrm_ea += 1; -+ else -+ if (op_bytes == 8) -+ modrm_ea += 4; -+ else -+ modrm_ea += op_bytes; -+ } -+ } -+ if (ad_bytes != 8) -+ modrm_ea = (u32)modrm_ea; -+ cr2 = modrm_ea; -+ modrm_done: -+ ; -+ } -+ -+ /* Decode and fetch the destination operand: register or memory. */ -+ switch (d & DstMask) { -+ case ImplicitOps: -+ /* Special instructions do their own operand decoding. */ -+ goto special_insn; -+ case DstReg: -+ dst.type = OP_REG; -+ if ((d & ByteOp) -+ && !(twobyte_table && (b == 0xb6 || b == 0xb7))) { -+ dst.ptr = decode_register(modrm_reg, _regs, -+ (rex_prefix == 0)); -+ dst.val = *(u8 *) dst.ptr; -+ dst.bytes = 1; -+ } else { -+ dst.ptr = decode_register(modrm_reg, _regs, 0); -+ switch ((dst.bytes = op_bytes)) { -+ case 2: -+ dst.val = *(u16 *)dst.ptr; -+ break; -+ case 4: -+ dst.val = *(u32 *)dst.ptr; -+ break; -+ case 8: -+ dst.val = *(u64 *)dst.ptr; -+ break; -+ } -+ } -+ break; -+ case DstMem: -+ dst.type = OP_MEM; -+ dst.ptr = (unsigned long *)cr2; -+ dst.bytes = (d & ByteOp) ? 1 : op_bytes; -+ if (!(d & Mov) && /* optimisation - avoid slow emulated read */ -+ ((rc = ops->read_emulated((unsigned long)dst.ptr, -+ &dst.val, dst.bytes, ctxt)) != 0)) -+ goto done; -+ break; -+ } -+ dst.orig_val = dst.val; -+ -+ /* -+ * Decode and fetch the source operand: register, memory -+ * or immediate. -+ */ -+ switch (d & SrcMask) { -+ case SrcNone: -+ break; -+ case SrcReg: -+ src.type = OP_REG; -+ if (d & ByteOp) { -+ src.ptr = decode_register(modrm_reg, _regs, -+ (rex_prefix == 0)); -+ src.val = src.orig_val = *(u8 *) src.ptr; -+ src.bytes = 1; -+ } else { -+ src.ptr = decode_register(modrm_reg, _regs, 0); -+ switch ((src.bytes = op_bytes)) { -+ case 2: -+ src.val = src.orig_val = *(u16 *) src.ptr; -+ break; -+ case 4: -+ src.val = src.orig_val = *(u32 *) src.ptr; -+ break; -+ case 8: -+ src.val = src.orig_val = *(u64 *) src.ptr; -+ break; -+ } -+ } -+ break; -+ case SrcMem16: -+ src.bytes = 2; -+ goto srcmem_common; -+ case SrcMem32: -+ src.bytes = 4; -+ goto srcmem_common; -+ case SrcMem: -+ src.bytes = (d & ByteOp) ? 1 : op_bytes; -+ srcmem_common: -+ src.type = OP_MEM; -+ src.ptr = (unsigned long *)cr2; -+ if ((rc = ops->read_emulated((unsigned long)src.ptr, -+ &src.val, src.bytes, ctxt)) != 0) -+ goto done; -+ src.orig_val = src.val; -+ break; -+ case SrcImm: -+ src.type = OP_IMM; -+ src.ptr = (unsigned long *)_eip; -+ src.bytes = (d & ByteOp) ? 1 : op_bytes; -+ if (src.bytes == 8) -+ src.bytes = 4; -+ /* NB. Immediates are sign-extended as necessary. */ -+ switch (src.bytes) { -+ case 1: -+ src.val = insn_fetch(s8, 1, _eip); -+ break; -+ case 2: -+ src.val = insn_fetch(s16, 2, _eip); -+ break; -+ case 4: -+ src.val = insn_fetch(s32, 4, _eip); -+ break; -+ } -+ break; -+ case SrcImmByte: -+ src.type = OP_IMM; -+ src.ptr = (unsigned long *)_eip; -+ src.bytes = 1; -+ src.val = insn_fetch(s8, 1, _eip); -+ break; -+ } -+ -+ if (twobyte) -+ goto twobyte_insn; -+ -+ switch (b) { -+ case 0x00 ... 0x05: -+ add: /* add */ -+ emulate_2op_SrcV("add", src, dst, _eflags); -+ break; -+ case 0x08 ... 0x0d: -+ or: /* or */ -+ emulate_2op_SrcV("or", src, dst, _eflags); -+ break; -+ case 0x10 ... 0x15: -+ adc: /* adc */ -+ emulate_2op_SrcV("adc", src, dst, _eflags); -+ break; -+ case 0x18 ... 0x1d: -+ sbb: /* sbb */ -+ emulate_2op_SrcV("sbb", src, dst, _eflags); -+ break; -+ case 0x20 ... 0x25: -+ and: /* and */ -+ emulate_2op_SrcV("and", src, dst, _eflags); -+ break; -+ case 0x28 ... 0x2d: -+ sub: /* sub */ -+ emulate_2op_SrcV("sub", src, dst, _eflags); -+ break; -+ case 0x30 ... 0x35: -+ xor: /* xor */ -+ emulate_2op_SrcV("xor", src, dst, _eflags); -+ break; -+ case 0x38 ... 0x3d: -+ cmp: /* cmp */ -+ emulate_2op_SrcV("cmp", src, dst, _eflags); -+ break; -+ case 0x63: /* movsxd */ -+ if (mode != X86EMUL_MODE_PROT64) -+ goto cannot_emulate; -+ dst.val = (s32) src.val; -+ break; -+ case 0x80 ... 0x83: /* Grp1 */ -+ switch (modrm_reg) { -+ case 0: -+ goto add; -+ case 1: -+ goto or; -+ case 2: -+ goto adc; -+ case 3: -+ goto sbb; -+ case 4: -+ goto and; -+ case 5: -+ goto sub; -+ case 6: -+ goto xor; -+ case 7: -+ goto cmp; -+ } -+ break; -+ case 0x84 ... 0x85: -+ test: /* test */ -+ emulate_2op_SrcV("test", src, dst, _eflags); -+ break; -+ case 0x86 ... 0x87: /* xchg */ -+ /* Write back the register source. */ -+ switch (dst.bytes) { -+ case 1: -+ *(u8 *) src.ptr = (u8) dst.val; -+ break; -+ case 2: -+ *(u16 *) src.ptr = (u16) dst.val; -+ break; -+ case 4: -+ *src.ptr = (u32) dst.val; -+ break; /* 64b reg: zero-extend */ -+ case 8: -+ *src.ptr = dst.val; -+ break; -+ } -+ /* -+ * Write back the memory destination with implicit LOCK -+ * prefix. -+ */ -+ dst.val = src.val; -+ lock_prefix = 1; -+ break; -+ case 0xa0 ... 0xa1: /* mov */ -+ dst.ptr = (unsigned long *)&_regs[VCPU_REGS_RAX]; -+ dst.val = src.val; -+ _eip += ad_bytes; /* skip src displacement */ -+ break; -+ case 0xa2 ... 0xa3: /* mov */ -+ dst.val = (unsigned long)_regs[VCPU_REGS_RAX]; -+ _eip += ad_bytes; /* skip dst displacement */ -+ break; -+ case 0x88 ... 0x8b: /* mov */ -+ case 0xc6 ... 0xc7: /* mov (sole member of Grp11) */ -+ dst.val = src.val; -+ break; -+ case 0x8f: /* pop (sole member of Grp1a) */ -+ /* 64-bit mode: POP always pops a 64-bit operand. */ -+ if (mode == X86EMUL_MODE_PROT64) -+ dst.bytes = 8; -+ if ((rc = ops->read_std(register_address(ctxt->ss_base, -+ _regs[VCPU_REGS_RSP]), -+ &dst.val, dst.bytes, ctxt)) != 0) -+ goto done; -+ register_address_increment(_regs[VCPU_REGS_RSP], dst.bytes); -+ break; -+ case 0xc0 ... 0xc1: -+ grp2: /* Grp2 */ -+ switch (modrm_reg) { -+ case 0: /* rol */ -+ emulate_2op_SrcB("rol", src, dst, _eflags); -+ break; -+ case 1: /* ror */ -+ emulate_2op_SrcB("ror", src, dst, _eflags); -+ break; -+ case 2: /* rcl */ -+ emulate_2op_SrcB("rcl", src, dst, _eflags); -+ break; -+ case 3: /* rcr */ -+ emulate_2op_SrcB("rcr", src, dst, _eflags); -+ break; -+ case 4: /* sal/shl */ -+ case 6: /* sal/shl */ -+ emulate_2op_SrcB("sal", src, dst, _eflags); -+ break; -+ case 5: /* shr */ -+ emulate_2op_SrcB("shr", src, dst, _eflags); -+ break; -+ case 7: /* sar */ -+ emulate_2op_SrcB("sar", src, dst, _eflags); -+ break; -+ } -+ break; -+ case 0xd0 ... 0xd1: /* Grp2 */ -+ src.val = 1; -+ goto grp2; -+ case 0xd2 ... 0xd3: /* Grp2 */ -+ src.val = _regs[VCPU_REGS_RCX]; -+ goto grp2; -+ case 0xf6 ... 0xf7: /* Grp3 */ -+ switch (modrm_reg) { -+ case 0 ... 1: /* test */ -+ /* -+ * Special case in Grp3: test has an immediate -+ * source operand. -+ */ -+ src.type = OP_IMM; -+ src.ptr = (unsigned long *)_eip; -+ src.bytes = (d & ByteOp) ? 1 : op_bytes; -+ if (src.bytes == 8) -+ src.bytes = 4; -+ switch (src.bytes) { -+ case 1: -+ src.val = insn_fetch(s8, 1, _eip); -+ break; -+ case 2: -+ src.val = insn_fetch(s16, 2, _eip); -+ break; -+ case 4: -+ src.val = insn_fetch(s32, 4, _eip); -+ break; -+ } -+ goto test; -+ case 2: /* not */ -+ dst.val = ~dst.val; -+ break; -+ case 3: /* neg */ -+ emulate_1op("neg", dst, _eflags); -+ break; -+ default: -+ goto cannot_emulate; -+ } -+ break; -+ case 0xfe ... 0xff: /* Grp4/Grp5 */ -+ switch (modrm_reg) { -+ case 0: /* inc */ -+ emulate_1op("inc", dst, _eflags); -+ break; -+ case 1: /* dec */ -+ emulate_1op("dec", dst, _eflags); -+ break; -+ case 6: /* push */ -+ /* 64-bit mode: PUSH always pushes a 64-bit operand. */ -+ if (mode == X86EMUL_MODE_PROT64) { -+ dst.bytes = 8; -+ if ((rc = ops->read_std((unsigned long)dst.ptr, -+ &dst.val, 8, -+ ctxt)) != 0) -+ goto done; -+ } -+ register_address_increment(_regs[VCPU_REGS_RSP], -+ -dst.bytes); -+ if ((rc = ops->write_std( -+ register_address(ctxt->ss_base, -+ _regs[VCPU_REGS_RSP]), -+ dst.val, dst.bytes, ctxt)) != 0) -+ goto done; -+ dst.val = dst.orig_val; /* skanky: disable writeback */ -+ break; -+ default: -+ goto cannot_emulate; -+ } -+ break; -+ } -+ -+writeback: -+ if ((d & Mov) || (dst.orig_val != dst.val)) { -+ switch (dst.type) { -+ case OP_REG: -+ /* The 4-byte case *is* correct: in 64-bit mode we zero-extend. */ -+ switch (dst.bytes) { -+ case 1: -+ *(u8 *)dst.ptr = (u8)dst.val; -+ break; -+ case 2: -+ *(u16 *)dst.ptr = (u16)dst.val; -+ break; -+ case 4: -+ *dst.ptr = (u32)dst.val; -+ break; /* 64b: zero-ext */ -+ case 8: -+ *dst.ptr = dst.val; -+ break; -+ } -+ break; -+ case OP_MEM: -+ if (lock_prefix) -+ rc = ops->cmpxchg_emulated((unsigned long)dst. -+ ptr, dst.orig_val, -+ dst.val, dst.bytes, -+ ctxt); -+ else -+ rc = ops->write_emulated((unsigned long)dst.ptr, -+ dst.val, dst.bytes, -+ ctxt); -+ if (rc != 0) -+ goto done; -+ default: -+ break; -+ } -+ } -+ -+ /* Commit shadow register state. */ -+ memcpy(ctxt->vcpu->regs, _regs, sizeof _regs); -+ ctxt->eflags = _eflags; -+ ctxt->vcpu->rip = _eip; -+ -+done: -+ return (rc == X86EMUL_UNHANDLEABLE) ? -1 : 0; -+ -+special_insn: -+ if (twobyte) -+ goto twobyte_special_insn; -+ if (rep_prefix) { -+ if (_regs[VCPU_REGS_RCX] == 0) { -+ ctxt->vcpu->rip = _eip; -+ goto done; -+ } -+ _regs[VCPU_REGS_RCX]--; -+ _eip = ctxt->vcpu->rip; -+ } -+ switch (b) { -+ case 0xa4 ... 0xa5: /* movs */ -+ dst.type = OP_MEM; -+ dst.bytes = (d & ByteOp) ? 1 : op_bytes; -+ dst.ptr = (unsigned long *)register_address(ctxt->es_base, -+ _regs[VCPU_REGS_RDI]); -+ if ((rc = ops->read_emulated(register_address( -+ override_base ? *override_base : ctxt->ds_base, -+ _regs[VCPU_REGS_RSI]), &dst.val, dst.bytes, ctxt)) != 0) -+ goto done; -+ register_address_increment(_regs[VCPU_REGS_RSI], -+ (_eflags & EFLG_DF) ? -dst.bytes : dst.bytes); -+ register_address_increment(_regs[VCPU_REGS_RDI], -+ (_eflags & EFLG_DF) ? -dst.bytes : dst.bytes); -+ break; -+ case 0xa6 ... 0xa7: /* cmps */ -+ DPRINTF("Urk! I don't handle CMPS.\n"); -+ goto cannot_emulate; -+ case 0xaa ... 0xab: /* stos */ -+ dst.type = OP_MEM; -+ dst.bytes = (d & ByteOp) ? 1 : op_bytes; -+ dst.ptr = (unsigned long *)cr2; -+ dst.val = _regs[VCPU_REGS_RAX]; -+ register_address_increment(_regs[VCPU_REGS_RDI], -+ (_eflags & EFLG_DF) ? -dst.bytes : dst.bytes); -+ break; -+ case 0xac ... 0xad: /* lods */ -+ dst.type = OP_REG; -+ dst.bytes = (d & ByteOp) ? 1 : op_bytes; -+ dst.ptr = (unsigned long *)&_regs[VCPU_REGS_RAX]; -+ if ((rc = ops->read_emulated(cr2, &dst.val, dst.bytes, ctxt)) != 0) -+ goto done; -+ register_address_increment(_regs[VCPU_REGS_RSI], -+ (_eflags & EFLG_DF) ? -dst.bytes : dst.bytes); -+ break; -+ case 0xae ... 0xaf: /* scas */ -+ DPRINTF("Urk! I don't handle SCAS.\n"); -+ goto cannot_emulate; -+ } -+ goto writeback; -+ -+twobyte_insn: -+ switch (b) { -+ case 0x01: /* lgdt, lidt, lmsw */ -+ switch (modrm_reg) { -+ u16 size; -+ unsigned long address; -+ -+ case 2: /* lgdt */ -+ rc = read_descriptor(ctxt, ops, src.ptr, -+ &size, &address, op_bytes); -+ if (rc) -+ goto done; -+ realmode_lgdt(ctxt->vcpu, size, address); -+ break; -+ case 3: /* lidt */ -+ rc = read_descriptor(ctxt, ops, src.ptr, -+ &size, &address, op_bytes); -+ if (rc) -+ goto done; -+ realmode_lidt(ctxt->vcpu, size, address); -+ break; -+ case 4: /* smsw */ -+ if (modrm_mod != 3) -+ goto cannot_emulate; -+ *(u16 *)&_regs[modrm_rm] -+ = realmode_get_cr(ctxt->vcpu, 0); -+ break; -+ case 6: /* lmsw */ -+ if (modrm_mod != 3) -+ goto cannot_emulate; -+ realmode_lmsw(ctxt->vcpu, (u16)modrm_val, &_eflags); -+ break; -+ case 7: /* invlpg*/ -+ emulate_invlpg(ctxt->vcpu, cr2); -+ break; -+ default: -+ goto cannot_emulate; -+ } -+ break; -+ case 0x21: /* mov from dr to reg */ -+ if (modrm_mod != 3) -+ goto cannot_emulate; -+ rc = emulator_get_dr(ctxt, modrm_reg, &_regs[modrm_rm]); -+ break; -+ case 0x23: /* mov from reg to dr */ -+ if (modrm_mod != 3) -+ goto cannot_emulate; -+ rc = emulator_set_dr(ctxt, modrm_reg, _regs[modrm_rm]); -+ break; -+ case 0x40 ... 0x4f: /* cmov */ -+ dst.val = dst.orig_val = src.val; -+ d &= ~Mov; /* default to no move */ -+ /* -+ * First, assume we're decoding an even cmov opcode -+ * (lsb == 0). -+ */ -+ switch ((b & 15) >> 1) { -+ case 0: /* cmovo */ -+ d |= (_eflags & EFLG_OF) ? Mov : 0; -+ break; -+ case 1: /* cmovb/cmovc/cmovnae */ -+ d |= (_eflags & EFLG_CF) ? Mov : 0; -+ break; -+ case 2: /* cmovz/cmove */ -+ d |= (_eflags & EFLG_ZF) ? Mov : 0; -+ break; -+ case 3: /* cmovbe/cmovna */ -+ d |= (_eflags & (EFLG_CF | EFLG_ZF)) ? Mov : 0; -+ break; -+ case 4: /* cmovs */ -+ d |= (_eflags & EFLG_SF) ? Mov : 0; -+ break; -+ case 5: /* cmovp/cmovpe */ -+ d |= (_eflags & EFLG_PF) ? Mov : 0; -+ break; -+ case 7: /* cmovle/cmovng */ -+ d |= (_eflags & EFLG_ZF) ? Mov : 0; -+ /* fall through */ -+ case 6: /* cmovl/cmovnge */ -+ d |= (!(_eflags & EFLG_SF) != -+ !(_eflags & EFLG_OF)) ? Mov : 0; -+ break; -+ } -+ /* Odd cmov opcodes (lsb == 1) have inverted sense. */ -+ d ^= (b & 1) ? Mov : 0; -+ break; -+ case 0xb0 ... 0xb1: /* cmpxchg */ -+ /* -+ * Save real source value, then compare EAX against -+ * destination. -+ */ -+ src.orig_val = src.val; -+ src.val = _regs[VCPU_REGS_RAX]; -+ emulate_2op_SrcV("cmp", src, dst, _eflags); -+ /* Always write back. The question is: where to? */ -+ d |= Mov; -+ if (_eflags & EFLG_ZF) { -+ /* Success: write back to memory. */ -+ dst.val = src.orig_val; -+ } else { -+ /* Failure: write the value we saw to EAX. */ -+ dst.type = OP_REG; -+ dst.ptr = (unsigned long *)&_regs[VCPU_REGS_RAX]; -+ } -+ break; -+ case 0xa3: -+ bt: /* bt */ -+ src.val &= (dst.bytes << 3) - 1; /* only subword offset */ -+ emulate_2op_SrcV_nobyte("bt", src, dst, _eflags); -+ break; -+ case 0xb3: -+ btr: /* btr */ -+ src.val &= (dst.bytes << 3) - 1; /* only subword offset */ -+ emulate_2op_SrcV_nobyte("btr", src, dst, _eflags); -+ break; -+ case 0xab: -+ bts: /* bts */ -+ src.val &= (dst.bytes << 3) - 1; /* only subword offset */ -+ emulate_2op_SrcV_nobyte("bts", src, dst, _eflags); -+ break; -+ case 0xb6 ... 0xb7: /* movzx */ -+ dst.bytes = op_bytes; -+ dst.val = (d & ByteOp) ? (u8) src.val : (u16) src.val; -+ break; -+ case 0xbb: -+ btc: /* btc */ -+ src.val &= (dst.bytes << 3) - 1; /* only subword offset */ -+ emulate_2op_SrcV_nobyte("btc", src, dst, _eflags); -+ break; -+ case 0xba: /* Grp8 */ -+ switch (modrm_reg & 3) { -+ case 0: -+ goto bt; -+ case 1: -+ goto bts; -+ case 2: -+ goto btr; -+ case 3: -+ goto btc; -+ } -+ break; -+ case 0xbe ... 0xbf: /* movsx */ -+ dst.bytes = op_bytes; -+ dst.val = (d & ByteOp) ? (s8) src.val : (s16) src.val; -+ break; -+ } -+ goto writeback; -+ -+twobyte_special_insn: -+ /* Disable writeback. */ -+ dst.orig_val = dst.val; -+ switch (b) { -+ case 0x0d: /* GrpP (prefetch) */ -+ case 0x18: /* Grp16 (prefetch/nop) */ -+ break; -+ case 0x06: -+ emulate_clts(ctxt->vcpu); -+ break; -+ case 0x20: /* mov cr, reg */ -+ if (modrm_mod != 3) -+ goto cannot_emulate; -+ _regs[modrm_rm] = realmode_get_cr(ctxt->vcpu, modrm_reg); -+ break; -+ case 0x22: /* mov reg, cr */ -+ if (modrm_mod != 3) -+ goto cannot_emulate; -+ realmode_set_cr(ctxt->vcpu, modrm_reg, modrm_val, &_eflags); -+ break; -+ case 0xc7: /* Grp9 (cmpxchg8b) */ -+#if defined(__i386__) -+ { -+ unsigned long old_lo, old_hi; -+ if (((rc = ops->read_emulated(cr2 + 0, &old_lo, 4, -+ ctxt)) != 0) -+ || ((rc = ops->read_emulated(cr2 + 4, &old_hi, 4, -+ ctxt)) != 0)) -+ goto done; -+ if ((old_lo != _regs[VCPU_REGS_RAX]) -+ || (old_hi != _regs[VCPU_REGS_RDI])) { -+ _regs[VCPU_REGS_RAX] = old_lo; -+ _regs[VCPU_REGS_RDX] = old_hi; -+ _eflags &= ~EFLG_ZF; -+ } else if (ops->cmpxchg8b_emulated == NULL) { -+ rc = X86EMUL_UNHANDLEABLE; -+ goto done; -+ } else { -+ if ((rc = ops->cmpxchg8b_emulated(cr2, old_lo, -+ old_hi, -+ _regs[VCPU_REGS_RBX], -+ _regs[VCPU_REGS_RCX], -+ ctxt)) != 0) -+ goto done; -+ _eflags |= EFLG_ZF; -+ } -+ break; -+ } -+#elif defined(__x86_64__) -+ { -+ unsigned long old, new; -+ if ((rc = ops->read_emulated(cr2, &old, 8, ctxt)) != 0) -+ goto done; -+ if (((u32) (old >> 0) != (u32) _regs[VCPU_REGS_RAX]) || -+ ((u32) (old >> 32) != (u32) _regs[VCPU_REGS_RDX])) { -+ _regs[VCPU_REGS_RAX] = (u32) (old >> 0); -+ _regs[VCPU_REGS_RDX] = (u32) (old >> 32); -+ _eflags &= ~EFLG_ZF; -+ } else { -+ new = (_regs[VCPU_REGS_RCX] << 32) | (u32) _regs[VCPU_REGS_RBX]; -+ if ((rc = ops->cmpxchg_emulated(cr2, old, -+ new, 8, ctxt)) != 0) -+ goto done; -+ _eflags |= EFLG_ZF; -+ } -+ break; -+ } -+#endif -+ } -+ goto writeback; -+ -+cannot_emulate: -+ DPRINTF("Cannot emulate %02x\n", b); -+ return -1; -+} -+ -+#ifdef __XEN__ -+ -+#include -+#include -+ -+int -+x86_emulate_read_std(unsigned long addr, -+ unsigned long *val, -+ unsigned int bytes, struct x86_emulate_ctxt *ctxt) -+{ -+ unsigned int rc; -+ -+ *val = 0; -+ -+ if ((rc = copy_from_user((void *)val, (void *)addr, bytes)) != 0) { -+ propagate_page_fault(addr + bytes - rc, 0); /* read fault */ -+ return X86EMUL_PROPAGATE_FAULT; -+ } -+ -+ return X86EMUL_CONTINUE; -+} -+ -+int -+x86_emulate_write_std(unsigned long addr, -+ unsigned long val, -+ unsigned int bytes, struct x86_emulate_ctxt *ctxt) -+{ -+ unsigned int rc; -+ -+ if ((rc = copy_to_user((void *)addr, (void *)&val, bytes)) != 0) { -+ propagate_page_fault(addr + bytes - rc, PGERR_write_access); -+ return X86EMUL_PROPAGATE_FAULT; -+ } -+ -+ return X86EMUL_CONTINUE; -+} -+ -+#endif ---- /dev/null -+++ b/drivers/kvm/x86_emulate.h -@@ -0,0 +1,185 @@ -+/****************************************************************************** -+ * x86_emulate.h -+ * -+ * Generic x86 (32-bit and 64-bit) instruction decoder and emulator. -+ * -+ * Copyright (c) 2005 Keir Fraser -+ * -+ * From: xen-unstable 10676:af9809f51f81a3c43f276f00c81a52ef558afda4 -+ */ -+ -+#ifndef __X86_EMULATE_H__ -+#define __X86_EMULATE_H__ -+ -+struct x86_emulate_ctxt; -+ -+/* -+ * x86_emulate_ops: -+ * -+ * These operations represent the instruction emulator's interface to memory. -+ * There are two categories of operation: those that act on ordinary memory -+ * regions (*_std), and those that act on memory regions known to require -+ * special treatment or emulation (*_emulated). -+ * -+ * The emulator assumes that an instruction accesses only one 'emulated memory' -+ * location, that this location is the given linear faulting address (cr2), and -+ * that this is one of the instruction's data operands. Instruction fetches and -+ * stack operations are assumed never to access emulated memory. The emulator -+ * automatically deduces which operand of a string-move operation is accessing -+ * emulated memory, and assumes that the other operand accesses normal memory. -+ * -+ * NOTES: -+ * 1. The emulator isn't very smart about emulated vs. standard memory. -+ * 'Emulated memory' access addresses should be checked for sanity. -+ * 'Normal memory' accesses may fault, and the caller must arrange to -+ * detect and handle reentrancy into the emulator via recursive faults. -+ * Accesses may be unaligned and may cross page boundaries. -+ * 2. If the access fails (cannot emulate, or a standard access faults) then -+ * it is up to the memop to propagate the fault to the guest VM via -+ * some out-of-band mechanism, unknown to the emulator. The memop signals -+ * failure by returning X86EMUL_PROPAGATE_FAULT to the emulator, which will -+ * then immediately bail. -+ * 3. Valid access sizes are 1, 2, 4 and 8 bytes. On x86/32 systems only -+ * cmpxchg8b_emulated need support 8-byte accesses. -+ * 4. The emulator cannot handle 64-bit mode emulation on an x86/32 system. -+ */ -+/* Access completed successfully: continue emulation as normal. */ -+#define X86EMUL_CONTINUE 0 -+/* Access is unhandleable: bail from emulation and return error to caller. */ -+#define X86EMUL_UNHANDLEABLE 1 -+/* Terminate emulation but return success to the caller. */ -+#define X86EMUL_PROPAGATE_FAULT 2 /* propagate a generated fault to guest */ -+#define X86EMUL_RETRY_INSTR 2 /* retry the instruction for some reason */ -+#define X86EMUL_CMPXCHG_FAILED 2 /* cmpxchg did not see expected value */ -+struct x86_emulate_ops { -+ /* -+ * read_std: Read bytes of standard (non-emulated/special) memory. -+ * Used for instruction fetch, stack operations, and others. -+ * @addr: [IN ] Linear address from which to read. -+ * @val: [OUT] Value read from memory, zero-extended to 'u_long'. -+ * @bytes: [IN ] Number of bytes to read from memory. -+ */ -+ int (*read_std)(unsigned long addr, -+ unsigned long *val, -+ unsigned int bytes, struct x86_emulate_ctxt * ctxt); -+ -+ /* -+ * write_std: Write bytes of standard (non-emulated/special) memory. -+ * Used for stack operations, and others. -+ * @addr: [IN ] Linear address to which to write. -+ * @val: [IN ] Value to write to memory (low-order bytes used as -+ * required). -+ * @bytes: [IN ] Number of bytes to write to memory. -+ */ -+ int (*write_std)(unsigned long addr, -+ unsigned long val, -+ unsigned int bytes, struct x86_emulate_ctxt * ctxt); -+ -+ /* -+ * read_emulated: Read bytes from emulated/special memory area. -+ * @addr: [IN ] Linear address from which to read. -+ * @val: [OUT] Value read from memory, zero-extended to 'u_long'. -+ * @bytes: [IN ] Number of bytes to read from memory. -+ */ -+ int (*read_emulated) (unsigned long addr, -+ unsigned long *val, -+ unsigned int bytes, -+ struct x86_emulate_ctxt * ctxt); -+ -+ /* -+ * write_emulated: Read bytes from emulated/special memory area. -+ * @addr: [IN ] Linear address to which to write. -+ * @val: [IN ] Value to write to memory (low-order bytes used as -+ * required). -+ * @bytes: [IN ] Number of bytes to write to memory. -+ */ -+ int (*write_emulated) (unsigned long addr, -+ unsigned long val, -+ unsigned int bytes, -+ struct x86_emulate_ctxt * ctxt); -+ -+ /* -+ * cmpxchg_emulated: Emulate an atomic (LOCKed) CMPXCHG operation on an -+ * emulated/special memory area. -+ * @addr: [IN ] Linear address to access. -+ * @old: [IN ] Value expected to be current at @addr. -+ * @new: [IN ] Value to write to @addr. -+ * @bytes: [IN ] Number of bytes to access using CMPXCHG. -+ */ -+ int (*cmpxchg_emulated) (unsigned long addr, -+ unsigned long old, -+ unsigned long new, -+ unsigned int bytes, -+ struct x86_emulate_ctxt * ctxt); -+ -+ /* -+ * cmpxchg8b_emulated: Emulate an atomic (LOCKed) CMPXCHG8B operation on an -+ * emulated/special memory area. -+ * @addr: [IN ] Linear address to access. -+ * @old: [IN ] Value expected to be current at @addr. -+ * @new: [IN ] Value to write to @addr. -+ * NOTES: -+ * 1. This function is only ever called when emulating a real CMPXCHG8B. -+ * 2. This function is *never* called on x86/64 systems. -+ * 2. Not defining this function (i.e., specifying NULL) is equivalent -+ * to defining a function that always returns X86EMUL_UNHANDLEABLE. -+ */ -+ int (*cmpxchg8b_emulated) (unsigned long addr, -+ unsigned long old_lo, -+ unsigned long old_hi, -+ unsigned long new_lo, -+ unsigned long new_hi, -+ struct x86_emulate_ctxt * ctxt); -+}; -+ -+struct cpu_user_regs; -+ -+struct x86_emulate_ctxt { -+ /* Register state before/after emulation. */ -+ struct kvm_vcpu *vcpu; -+ -+ /* Linear faulting address (if emulating a page-faulting instruction). */ -+ unsigned long eflags; -+ unsigned long cr2; -+ -+ /* Emulated execution mode, represented by an X86EMUL_MODE value. */ -+ int mode; -+ -+ unsigned long cs_base; -+ unsigned long ds_base; -+ unsigned long es_base; -+ unsigned long ss_base; -+ unsigned long gs_base; -+ unsigned long fs_base; -+}; -+ -+/* Execution mode, passed to the emulator. */ -+#define X86EMUL_MODE_REAL 0 /* Real mode. */ -+#define X86EMUL_MODE_PROT16 2 /* 16-bit protected mode. */ -+#define X86EMUL_MODE_PROT32 4 /* 32-bit protected mode. */ -+#define X86EMUL_MODE_PROT64 8 /* 64-bit (long) mode. */ -+ -+/* Host execution mode. */ -+#if defined(__i386__) -+#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT32 -+#elif defined(__x86_64__) -+#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT64 -+#endif -+ -+/* -+ * x86_emulate_memop: Emulate an instruction that faulted attempting to -+ * read/write a 'special' memory area. -+ * Returns -1 on failure, 0 on success. -+ */ -+int x86_emulate_memop(struct x86_emulate_ctxt *ctxt, -+ struct x86_emulate_ops *ops); -+ -+/* -+ * Given the 'reg' portion of a ModRM byte, and a register block, return a -+ * pointer into the block that addresses the relevant register. -+ * @highbyte_regs specifies whether to decode AH,CH,DH,BH. -+ */ -+void *decode_register(u8 modrm_reg, unsigned long *regs, -+ int highbyte_regs); -+ -+#endif /* __X86_EMULATE_H__ */ ---- /dev/null -+++ b/include/linux/kvm.h -@@ -0,0 +1,227 @@ -+#ifndef __LINUX_KVM_H -+#define __LINUX_KVM_H -+ -+/* -+ * Userspace interface for /dev/kvm - kernel based virtual machine -+ * -+ * Note: this interface is considered experimental and may change without -+ * notice. -+ */ -+ -+#include -+#include -+ -+/* -+ * Architectural interrupt line count, and the size of the bitmap needed -+ * to hold them. -+ */ -+#define KVM_NR_INTERRUPTS 256 -+#define KVM_IRQ_BITMAP_SIZE_BYTES ((KVM_NR_INTERRUPTS + 7) / 8) -+#define KVM_IRQ_BITMAP_SIZE(type) (KVM_IRQ_BITMAP_SIZE_BYTES / sizeof(type)) -+ -+ -+/* for KVM_CREATE_MEMORY_REGION */ -+struct kvm_memory_region { -+ __u32 slot; -+ __u32 flags; -+ __u64 guest_phys_addr; -+ __u64 memory_size; /* bytes */ -+}; -+ -+/* for kvm_memory_region::flags */ -+#define KVM_MEM_LOG_DIRTY_PAGES 1UL -+ -+ -+#define KVM_EXIT_TYPE_FAIL_ENTRY 1 -+#define KVM_EXIT_TYPE_VM_EXIT 2 -+ -+enum kvm_exit_reason { -+ KVM_EXIT_UNKNOWN = 0, -+ KVM_EXIT_EXCEPTION = 1, -+ KVM_EXIT_IO = 2, -+ KVM_EXIT_CPUID = 3, -+ KVM_EXIT_DEBUG = 4, -+ KVM_EXIT_HLT = 5, -+ KVM_EXIT_MMIO = 6, -+}; -+ -+/* for KVM_RUN */ -+struct kvm_run { -+ /* in */ -+ __u32 vcpu; -+ __u32 emulated; /* skip current instruction */ -+ __u32 mmio_completed; /* mmio request completed */ -+ -+ /* out */ -+ __u32 exit_type; -+ __u32 exit_reason; -+ __u32 instruction_length; -+ union { -+ /* KVM_EXIT_UNKNOWN */ -+ struct { -+ __u32 hardware_exit_reason; -+ } hw; -+ /* KVM_EXIT_EXCEPTION */ -+ struct { -+ __u32 exception; -+ __u32 error_code; -+ } ex; -+ /* KVM_EXIT_IO */ -+ struct { -+#define KVM_EXIT_IO_IN 0 -+#define KVM_EXIT_IO_OUT 1 -+ __u8 direction; -+ __u8 size; /* bytes */ -+ __u8 string; -+ __u8 string_down; -+ __u8 rep; -+ __u8 pad; -+ __u16 port; -+ __u64 count; -+ union { -+ __u64 address; -+ __u32 value; -+ }; -+ } io; -+ struct { -+ } debug; -+ /* KVM_EXIT_MMIO */ -+ struct { -+ __u64 phys_addr; -+ __u8 data[8]; -+ __u32 len; -+ __u8 is_write; -+ } mmio; -+ }; -+}; -+ -+/* for KVM_GET_REGS and KVM_SET_REGS */ -+struct kvm_regs { -+ /* in */ -+ __u32 vcpu; -+ __u32 padding; -+ -+ /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */ -+ __u64 rax, rbx, rcx, rdx; -+ __u64 rsi, rdi, rsp, rbp; -+ __u64 r8, r9, r10, r11; -+ __u64 r12, r13, r14, r15; -+ __u64 rip, rflags; -+}; -+ -+struct kvm_segment { -+ __u64 base; -+ __u32 limit; -+ __u16 selector; -+ __u8 type; -+ __u8 present, dpl, db, s, l, g, avl; -+ __u8 unusable; -+ __u8 padding; -+}; -+ -+struct kvm_dtable { -+ __u64 base; -+ __u16 limit; -+ __u16 padding[3]; -+}; -+ -+/* for KVM_GET_SREGS and KVM_SET_SREGS */ -+struct kvm_sregs { -+ /* in */ -+ __u32 vcpu; -+ __u32 padding; -+ -+ /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */ -+ struct kvm_segment cs, ds, es, fs, gs, ss; -+ struct kvm_segment tr, ldt; -+ struct kvm_dtable gdt, idt; -+ __u64 cr0, cr2, cr3, cr4, cr8; -+ __u64 efer; -+ __u64 apic_base; -+ __u64 interrupt_bitmap[KVM_IRQ_BITMAP_SIZE(__u64)]; -+}; -+ -+struct kvm_msr_entry { -+ __u32 index; -+ __u32 reserved; -+ __u64 data; -+}; -+ -+/* for KVM_GET_MSRS and KVM_SET_MSRS */ -+struct kvm_msrs { -+ __u32 vcpu; -+ __u32 nmsrs; /* number of msrs in entries */ -+ -+ struct kvm_msr_entry entries[0]; -+}; -+ -+/* for KVM_GET_MSR_INDEX_LIST */ -+struct kvm_msr_list { -+ __u32 nmsrs; /* number of msrs in entries */ -+ __u32 indices[0]; -+}; -+ -+/* for KVM_TRANSLATE */ -+struct kvm_translation { -+ /* in */ -+ __u64 linear_address; -+ __u32 vcpu; -+ __u32 padding; -+ -+ /* out */ -+ __u64 physical_address; -+ __u8 valid; -+ __u8 writeable; -+ __u8 usermode; -+}; -+ -+/* for KVM_INTERRUPT */ -+struct kvm_interrupt { -+ /* in */ -+ __u32 vcpu; -+ __u32 irq; -+}; -+ -+struct kvm_breakpoint { -+ __u32 enabled; -+ __u32 padding; -+ __u64 address; -+}; -+ -+/* for KVM_DEBUG_GUEST */ -+struct kvm_debug_guest { -+ /* int */ -+ __u32 vcpu; -+ __u32 enabled; -+ struct kvm_breakpoint breakpoints[4]; -+ __u32 singlestep; -+}; -+ -+/* for KVM_GET_DIRTY_LOG */ -+struct kvm_dirty_log { -+ __u32 slot; -+ __u32 padding; -+ union { -+ void __user *dirty_bitmap; /* one bit per page */ -+ __u64 padding; -+ }; -+}; -+ -+#define KVMIO 0xAE -+ -+#define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) -+#define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs) -+#define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) -+#define KVM_GET_SREGS _IOWR(KVMIO, 5, struct kvm_sregs) -+#define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs) -+#define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation) -+#define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt) -+#define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest) -+#define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region) -+#define KVM_CREATE_VCPU _IOW(KVMIO, 11, int /* vcpu_slot */) -+#define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log) -+#define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs) -+#define KVM_SET_MSRS _IOWR(KVMIO, 14, struct kvm_msrs) -+#define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 15, struct kvm_msr_list) -+ -+#endif -From: Anthony Liguori -Date: Wed, 13 Dec 2006 08:33:43 +0000 (-0800) -Subject: [PATCH] KVM: Add missing include -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3b3be0d1cc8a56468e0cb35ab3895f265d8e5cc6 - -[PATCH] KVM: Add missing include - -load_TR_desc() lives in asm/desc.h, so #include that file. - -Signed-off-by: Anthony Liguori -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/vmx.c -+++ b/drivers/kvm/vmx.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - - #include "segment_descriptor.h" - -From: Avi Kivity -Date: Wed, 13 Dec 2006 08:33:44 +0000 (-0800) -Subject: [PATCH] KVM: Put KVM in a new Virtualization menu -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fd24dc4af6387d820159e3affdfb1e9d3bdce1f8 - -[PATCH] KVM: Put KVM in a new Virtualization menu - -Instead of in the main drivers menu. - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/Kconfig -+++ b/drivers/kvm/Kconfig -@@ -1,6 +1,8 @@ - # - # KVM configuration - # -+menu "Virtualization" -+ - config KVM - tristate "Kernel-based Virtual Machine (KVM) support" - depends on X86 && EXPERIMENTAL -@@ -31,3 +33,5 @@ config KVM_AMD - ---help--- - Provides support for KVM on AMD processors equipped with the AMD-V - (SVM) extensions. -+ -+endmenu -From: Avi Kivity -Date: Wed, 13 Dec 2006 08:33:45 +0000 (-0800) -Subject: [PATCH] KVM: Clean up AMD SVM debug registers load and unload -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5aff458e9c90df55d6badabd89a1a063a80d9768 - -[PATCH] KVM: Clean up AMD SVM debug registers load and unload - -By letting gcc choose the temporary register for us, we lose arch dependency -and some ugliness. Conceivably gcc will also generate marginally better code. - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/svm.c -+++ b/drivers/kvm/svm.c -@@ -1345,53 +1345,18 @@ static void kvm_reput_irq(struct kvm_vcp - - static void save_db_regs(unsigned long *db_regs) - { --#ifdef __x86_64__ -- asm ("mov %%dr0, %%rax \n\t" -- "mov %%rax, %[dr0] \n\t" -- "mov %%dr1, %%rax \n\t" -- "mov %%rax, %[dr1] \n\t" -- "mov %%dr2, %%rax \n\t" -- "mov %%rax, %[dr2] \n\t" -- "mov %%dr3, %%rax \n\t" -- "mov %%rax, %[dr3] \n\t" -- : [dr0] "=m"(db_regs[0]), -- [dr1] "=m"(db_regs[1]), -- [dr2] "=m"(db_regs[2]), -- [dr3] "=m"(db_regs[3]) -- : : "rax"); --#else -- asm ("mov %%dr0, %%eax \n\t" -- "mov %%eax, %[dr0] \n\t" -- "mov %%dr1, %%eax \n\t" -- "mov %%eax, %[dr1] \n\t" -- "mov %%dr2, %%eax \n\t" -- "mov %%eax, %[dr2] \n\t" -- "mov %%dr3, %%eax \n\t" -- "mov %%eax, %[dr3] \n\t" -- : [dr0] "=m"(db_regs[0]), -- [dr1] "=m"(db_regs[1]), -- [dr2] "=m"(db_regs[2]), -- [dr3] "=m"(db_regs[3]) -- : : "eax"); --#endif -+ asm volatile ("mov %%dr0, %0" : "=r"(db_regs[0])); -+ asm volatile ("mov %%dr1, %0" : "=r"(db_regs[1])); -+ asm volatile ("mov %%dr2, %0" : "=r"(db_regs[2])); -+ asm volatile ("mov %%dr3, %0" : "=r"(db_regs[3])); - } - - static void load_db_regs(unsigned long *db_regs) - { -- asm volatile ("mov %[dr0], %%dr0 \n\t" -- "mov %[dr1], %%dr1 \n\t" -- "mov %[dr2], %%dr2 \n\t" -- "mov %[dr3], %%dr3 \n\t" -- : -- : [dr0] "r"(db_regs[0]), -- [dr1] "r"(db_regs[1]), -- [dr2] "r"(db_regs[2]), -- [dr3] "r"(db_regs[3]) --#ifdef __x86_64__ -- : "rax"); --#else -- : "eax"); --#endif -+ asm volatile ("mov %0, %%dr0" : : "r"(db_regs[0])); -+ asm volatile ("mov %0, %%dr1" : : "r"(db_regs[1])); -+ asm volatile ("mov %0, %%dr2" : : "r"(db_regs[2])); -+ asm volatile ("mov %0, %%dr3" : : "r"(db_regs[3])); - } - - static int svm_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) -From: Avi Kivity -Date: Wed, 13 Dec 2006 08:33:45 +0000 (-0800) -Subject: [PATCH] KVM: Replace __x86_64__ with CONFIG_X86_64 -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=05b3e0c2c791a70bf0735aaec53cdf6d340eef85 - -[PATCH] KVM: Replace __x86_64__ with CONFIG_X86_64 - -As per akpm's request. - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/kvm.h -+++ b/drivers/kvm/kvm.h -@@ -140,7 +140,7 @@ enum { - VCPU_REGS_RBP = 5, - VCPU_REGS_RSI = 6, - VCPU_REGS_RDI = 7, --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - VCPU_REGS_R8 = 8, - VCPU_REGS_R9 = 9, - VCPU_REGS_R10 = 10, -@@ -375,7 +375,7 @@ void set_cr4(struct kvm_vcpu *vcpu, unsi - void set_cr8(struct kvm_vcpu *vcpu, unsigned long cr0); - void lmsw(struct kvm_vcpu *vcpu, unsigned long msw); - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - void set_efer(struct kvm_vcpu *vcpu, u64 efer); - #endif - -@@ -485,7 +485,7 @@ static inline unsigned long read_tr_base - return segment_base(tr); - } - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - static inline unsigned long read_msr(unsigned long msr) - { - u64 value; -@@ -533,7 +533,7 @@ static inline u32 get_rdx_init_val(void) - #define TSS_REDIRECTION_SIZE (256 / 8) - #define RMODE_TSS_SIZE (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1) - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - - /* - * When emulating 32-bit mode, cr3 is only 32 bits even on x86_64. Therefore ---- a/drivers/kvm/kvm_main.c -+++ b/drivers/kvm/kvm_main.c -@@ -83,7 +83,7 @@ struct vmx_msr_entry *find_msr_entry(str - } - EXPORT_SYMBOL_GPL(find_msr_entry); - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - // LDT or TSS descriptor in the GDT. 16 bytes. - struct segment_descriptor_64 { - struct segment_descriptor s; -@@ -115,7 +115,7 @@ unsigned long segment_base(u16 selector) - } - d = (struct segment_descriptor *)(table_base + (selector & ~7)); - v = d->base_low | ((ul)d->base_mid << 16) | ((ul)d->base_high << 24); --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - if (d->system == 0 - && (d->type == 2 || d->type == 9 || d->type == 11)) - v |= ((ul)((struct segment_descriptor_64 *)d)->base_higher) << 32; -@@ -351,7 +351,7 @@ void set_cr0(struct kvm_vcpu *vcpu, unsi - } - - if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) { --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - if ((vcpu->shadow_efer & EFER_LME)) { - int cs_db, cs_l; - -@@ -1120,7 +1120,7 @@ static int get_msr(struct kvm_vcpu *vcpu - return kvm_arch_ops->get_msr(vcpu, msr_index, pdata); - } - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - - void set_efer(struct kvm_vcpu *vcpu, u64 efer) - { -@@ -1243,7 +1243,7 @@ static int kvm_dev_ioctl_get_regs(struct - regs->rdi = vcpu->regs[VCPU_REGS_RDI]; - regs->rsp = vcpu->regs[VCPU_REGS_RSP]; - regs->rbp = vcpu->regs[VCPU_REGS_RBP]; --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - regs->r8 = vcpu->regs[VCPU_REGS_R8]; - regs->r9 = vcpu->regs[VCPU_REGS_R9]; - regs->r10 = vcpu->regs[VCPU_REGS_R10]; -@@ -1287,7 +1287,7 @@ static int kvm_dev_ioctl_set_regs(struct - vcpu->regs[VCPU_REGS_RDI] = regs->rdi; - vcpu->regs[VCPU_REGS_RSP] = regs->rsp; - vcpu->regs[VCPU_REGS_RBP] = regs->rbp; --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - vcpu->regs[VCPU_REGS_R8] = regs->r8; - vcpu->regs[VCPU_REGS_R9] = regs->r9; - vcpu->regs[VCPU_REGS_R10] = regs->r10; -@@ -1401,7 +1401,7 @@ static int kvm_dev_ioctl_set_sregs(struc - vcpu->cr8 = sregs->cr8; - - mmu_reset_needed |= vcpu->shadow_efer != sregs->efer; --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - kvm_arch_ops->set_efer(vcpu, sregs->efer); - #endif - vcpu->apic_base = sregs->apic_base; -@@ -1434,7 +1434,7 @@ static int kvm_dev_ioctl_set_sregs(struc - static u32 msrs_to_save[] = { - MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, - MSR_K6_STAR, --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, - #endif - MSR_IA32_TIME_STAMP_COUNTER, ---- a/drivers/kvm/kvm_svm.h -+++ b/drivers/kvm/kvm_svm.h -@@ -9,7 +9,7 @@ - #include "kvm.h" - - static const u32 host_save_msrs[] = { --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - MSR_STAR, MSR_LSTAR, MSR_CSTAR, MSR_SYSCALL_MASK, MSR_KERNEL_GS_BASE, - MSR_FS_BASE, MSR_GS_BASE, - #endif ---- a/drivers/kvm/kvm_vmx.h -+++ b/drivers/kvm/kvm_vmx.h -@@ -1,7 +1,7 @@ - #ifndef __KVM_VMX_H - #define __KVM_VMX_H - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - /* - * avoid save/load MSR_SYSCALL_MASK and MSR_LSTAR by std vt - * mechanism (cpu bug AA24) ---- a/drivers/kvm/svm.c -+++ b/drivers/kvm/svm.c -@@ -287,7 +287,7 @@ static void svm_hardware_enable(void *ga - - struct svm_cpu_data *svm_data; - uint64_t efer; --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - struct desc_ptr gdt_descr; - #else - struct Xgt_desc_struct gdt_descr; -@@ -397,7 +397,7 @@ static __init int svm_hardware_setup(voi - memset(msrpm_va, 0xff, PAGE_SIZE * (1 << MSRPM_ALLOC_ORDER)); - msrpm_base = page_to_pfn(msrpm_pages) << PAGE_SHIFT; - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - set_msr_interception(msrpm_va, MSR_GS_BASE, 1, 1); - set_msr_interception(msrpm_va, MSR_FS_BASE, 1, 1); - set_msr_interception(msrpm_va, MSR_KERNEL_GS_BASE, 1, 1); -@@ -704,7 +704,7 @@ static void svm_set_gdt(struct kvm_vcpu - - static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) - { --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - if (vcpu->shadow_efer & KVM_EFER_LME) { - if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) { - vcpu->shadow_efer |= KVM_EFER_LMA; -@@ -1097,7 +1097,7 @@ static int svm_get_msr(struct kvm_vcpu * - case MSR_IA32_APICBASE: - *data = vcpu->apic_base; - break; --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - case MSR_STAR: - *data = vcpu->svm->vmcb->save.star; - break; -@@ -1149,7 +1149,7 @@ static int rdmsr_interception(struct kvm - static int svm_set_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 data) - { - switch (ecx) { --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - case MSR_EFER: - set_efer(vcpu, data); - break; -@@ -1172,7 +1172,7 @@ static int svm_set_msr(struct kvm_vcpu * - case MSR_IA32_APICBASE: - vcpu->apic_base = data; - break; --#ifdef __x86_64___ -+#ifdef CONFIG_X86_64_ - case MSR_STAR: - vcpu->svm->vmcb->save.star = data; - break; -@@ -1387,7 +1387,7 @@ again: - load_db_regs(vcpu->svm->db_regs); - } - asm volatile ( --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - "push %%rbx; push %%rcx; push %%rdx;" - "push %%rsi; push %%rdi; push %%rbp;" - "push %%r8; push %%r9; push %%r10; push %%r11;" -@@ -1397,7 +1397,7 @@ again: - "push %%esi; push %%edi; push %%ebp;" - #endif - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - "mov %c[rbx](%[vcpu]), %%rbx \n\t" - "mov %c[rcx](%[vcpu]), %%rcx \n\t" - "mov %c[rdx](%[vcpu]), %%rdx \n\t" -@@ -1421,7 +1421,7 @@ again: - "mov %c[rbp](%[vcpu]), %%ebp \n\t" - #endif - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - /* Enter guest mode */ - "push %%rax \n\t" - "mov %c[svm](%[vcpu]), %%rax \n\t" -@@ -1442,7 +1442,7 @@ again: - #endif - - /* Save guest registers, load host registers */ --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - "mov %%rbx, %c[rbx](%[vcpu]) \n\t" - "mov %%rcx, %c[rcx](%[vcpu]) \n\t" - "mov %%rdx, %c[rdx](%[vcpu]) \n\t" -@@ -1483,7 +1483,7 @@ again: - [rsi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RSI])), - [rdi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RDI])), - [rbp]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RBP])) --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - ,[r8 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R8 ])), - [r9 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R9 ])), - [r10]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R10])), ---- a/drivers/kvm/vmx.c -+++ b/drivers/kvm/vmx.c -@@ -34,7 +34,7 @@ MODULE_LICENSE("GPL"); - static DEFINE_PER_CPU(struct vmcs *, vmxarea); - static DEFINE_PER_CPU(struct vmcs *, current_vmcs); - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - #define HOST_IS_64 1 - #else - #define HOST_IS_64 0 -@@ -71,7 +71,7 @@ static struct kvm_vmx_segment_field { - }; - - static const u32 vmx_msr_index[] = { --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - MSR_SYSCALL_MASK, MSR_LSTAR, MSR_CSTAR, MSR_KERNEL_GS_BASE, - #endif - MSR_EFER, MSR_K6_STAR, -@@ -138,7 +138,7 @@ static u32 vmcs_read32(unsigned long fie - - static u64 vmcs_read64(unsigned long field) - { --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - return vmcs_readl(field); - #else - return vmcs_readl(field) | ((u64)vmcs_readl(field+1) << 32); -@@ -168,7 +168,7 @@ static void vmcs_write32(unsigned long f - - static void vmcs_write64(unsigned long field, u64 value) - { --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - vmcs_writel(field, value); - #else - vmcs_writel(field, value); -@@ -297,7 +297,7 @@ static void guest_write_tsc(u64 guest_ts - - static void reload_tss(void) - { --#ifndef __x86_64__ -+#ifndef CONFIG_X86_64 - - /* - * VT restores TR but not its size. Useless. -@@ -328,7 +328,7 @@ static int vmx_get_msr(struct kvm_vcpu * - } - - switch (msr_index) { --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - case MSR_FS_BASE: - data = vmcs_readl(GUEST_FS_BASE); - break; -@@ -391,7 +391,7 @@ static int vmx_set_msr(struct kvm_vcpu * - { - struct vmx_msr_entry *msr; - switch (msr_index) { --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - case MSR_FS_BASE: - vmcs_writel(GUEST_FS_BASE, data); - break; -@@ -726,7 +726,7 @@ static void enter_rmode(struct kvm_vcpu - fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs); - } - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - - static void enter_lmode(struct kvm_vcpu *vcpu) - { -@@ -768,7 +768,7 @@ static void vmx_set_cr0(struct kvm_vcpu - if (!vcpu->rmode.active && !(cr0 & CR0_PE_MASK)) - enter_rmode(vcpu); - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - if (vcpu->shadow_efer & EFER_LME) { - if (!is_paging(vcpu) && (cr0 & CR0_PG_MASK)) - enter_lmode(vcpu); -@@ -809,7 +809,7 @@ static void vmx_set_cr4(struct kvm_vcpu - vcpu->cr4 = cr4; - } - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - - static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer) - { -@@ -1096,7 +1096,7 @@ static int vmx_vcpu_setup(struct kvm_vcp - vmcs_write16(HOST_FS_SELECTOR, read_fs()); /* 22.2.4 */ - vmcs_write16(HOST_GS_SELECTOR, read_gs()); /* 22.2.4 */ - vmcs_write16(HOST_SS_SELECTOR, __KERNEL_DS); /* 22.2.4 */ --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - rdmsrl(MSR_FS_BASE, a); - vmcs_writel(HOST_FS_BASE, a); /* 22.2.4 */ - rdmsrl(MSR_GS_BASE, a); -@@ -1174,7 +1174,7 @@ static int vmx_vcpu_setup(struct kvm_vcp - vcpu->cr0 = 0x60000010; - vmx_set_cr0(vcpu, vcpu->cr0); // enter rmode - vmx_set_cr4(vcpu, 0); --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - vmx_set_efer(vcpu, 0); - #endif - -@@ -1690,7 +1690,7 @@ again: - vmcs_write16(HOST_GS_SELECTOR, 0); - } - --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - vmcs_writel(HOST_FS_BASE, read_msr(MSR_FS_BASE)); - vmcs_writel(HOST_GS_BASE, read_msr(MSR_GS_BASE)); - #else -@@ -1714,7 +1714,7 @@ again: - asm ( - /* Store host registers */ - "pushf \n\t" --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - "push %%rax; push %%rbx; push %%rdx;" - "push %%rsi; push %%rdi; push %%rbp;" - "push %%r8; push %%r9; push %%r10; push %%r11;" -@@ -1728,7 +1728,7 @@ again: - /* Check if vmlaunch of vmresume is needed */ - "cmp $0, %1 \n\t" - /* Load guest registers. Don't clobber flags. */ --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - "mov %c[cr2](%3), %%rax \n\t" - "mov %%rax, %%cr2 \n\t" - "mov %c[rax](%3), %%rax \n\t" -@@ -1765,7 +1765,7 @@ again: - ".globl kvm_vmx_return \n\t" - "kvm_vmx_return: " - /* Save guest registers, load host registers, keep flags */ --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - "xchg %3, 0(%%rsp) \n\t" - "mov %%rax, %c[rax](%3) \n\t" - "mov %%rbx, %c[rbx](%3) \n\t" -@@ -1817,7 +1817,7 @@ again: - [rsi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RSI])), - [rdi]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RDI])), - [rbp]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_RBP])), --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - [r8 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R8 ])), - [r9 ]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R9 ])), - [r10]"i"(offsetof(struct kvm_vcpu, regs[VCPU_REGS_R10])), -@@ -1838,7 +1838,7 @@ again: - fx_save(vcpu->guest_fx_image); - fx_restore(vcpu->host_fx_image); - --#ifndef __x86_64__ -+#ifndef CONFIG_X86_64 - asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); - #endif - -@@ -1856,7 +1856,7 @@ again: - */ - local_irq_disable(); - load_gs(gs_sel); --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - wrmsrl(MSR_GS_BASE, vmcs_readl(HOST_GS_BASE)); - #endif - local_irq_enable(); -@@ -1966,7 +1966,7 @@ static struct kvm_arch_ops vmx_arch_ops - .set_cr0_no_modeswitch = vmx_set_cr0_no_modeswitch, - .set_cr3 = vmx_set_cr3, - .set_cr4 = vmx_set_cr4, --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - .set_efer = vmx_set_efer, - #endif - .get_idt = vmx_get_idt, ---- a/drivers/kvm/x86_emulate.c -+++ b/drivers/kvm/x86_emulate.c -@@ -238,7 +238,7 @@ struct operand { - * any modified flags. - */ - --#if defined(__x86_64__) -+#if defined(CONFIG_X86_64) - #define _LO32 "k" /* force 32-bit operand */ - #define _STK "%%rsp" /* stack pointer */ - #elif defined(__i386__) -@@ -385,7 +385,7 @@ struct operand { - } while (0) - - /* Emulate an instruction with quadword operands (x86/64 only). */ --#if defined(__x86_64__) -+#if defined(CONFIG_X86_64) - #define __emulate_2op_8byte(_op, _src, _dst, _eflags, _qx, _qy) \ - do { \ - __asm__ __volatile__ ( \ -@@ -495,7 +495,7 @@ x86_emulate_memop(struct x86_emulate_ctx - case X86EMUL_MODE_PROT32: - op_bytes = ad_bytes = 4; - break; --#ifdef __x86_64__ -+#ifdef CONFIG_X86_64 - case X86EMUL_MODE_PROT64: - op_bytes = 4; - ad_bytes = 8; -@@ -1341,7 +1341,7 @@ twobyte_special_insn: - } - break; - } --#elif defined(__x86_64__) -+#elif defined(CONFIG_X86_64) - { - unsigned long old, new; - if ((rc = ops->read_emulated(cr2, &old, 8, ctxt)) != 0) ---- a/drivers/kvm/x86_emulate.h -+++ b/drivers/kvm/x86_emulate.h -@@ -162,7 +162,7 @@ struct x86_emulate_ctxt { - /* Host execution mode. */ - #if defined(__i386__) - #define X86EMUL_MODE_HOST X86EMUL_MODE_PROT32 --#elif defined(__x86_64__) -+#elif defined(CONFIG_X86_64) - #define X86EMUL_MODE_HOST X86EMUL_MODE_PROT64 - #endif - -From: Uri Lublin -Date: Wed, 13 Dec 2006 08:34:00 +0000 (-0800) -Subject: [PATCH] KVM: Make the GET_SREGS and SET_SREGS ioctls symmetric -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=f7fbf1fdf0d79241f5cc95310b96f0c52452ab39 - -[PATCH] KVM: Make the GET_SREGS and SET_SREGS ioctls symmetric - -This makes the SET_SREGS ioctl behave symmetrically to the GET_SREGS ioctl wrt -the segment access rights flag. - -Signed-off-by: Uri Lublin -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/vmx.c -+++ b/drivers/kvm/vmx.c -@@ -884,6 +884,8 @@ static void vmx_set_segment(struct kvm_v - ar |= (var->db & 1) << 14; - ar |= (var->g & 1) << 15; - } -+ if (ar == 0) /* a 0 value means unusable */ -+ ar = AR_UNUSABLE_MASK; - vmcs_write32(sf->ar_bytes, ar); - } - -From: Avi Kivity -Date: Wed, 13 Dec 2006 08:34:01 +0000 (-0800) -Subject: [PATCH] KVM: Move find_vmx_entry() to vmx.c -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=7725f0badd6682e5bcc06f38eedf0123712a3f60 - -[PATCH] KVM: Move find_vmx_entry() to vmx.c - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/kvm_main.c -+++ b/drivers/kvm/kvm_main.c -@@ -72,17 +72,6 @@ static struct dentry *debugfs_dir; - #define CR8_RESEVED_BITS (~0x0fULL) - #define EFER_RESERVED_BITS 0xfffffffffffff2fe - --struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr) --{ -- int i; -- -- for (i = 0; i < vcpu->nmsrs; ++i) -- if (vcpu->guest_msrs[i].index == msr) -- return &vcpu->guest_msrs[i]; -- return 0; --} --EXPORT_SYMBOL_GPL(find_msr_entry); -- - #ifdef CONFIG_X86_64 - // LDT or TSS descriptor in the GDT. 16 bytes. - struct segment_descriptor_64 { -@@ -1124,8 +1113,6 @@ static int get_msr(struct kvm_vcpu *vcpu - - void set_efer(struct kvm_vcpu *vcpu, u64 efer) - { -- struct vmx_msr_entry *msr; -- - if (efer & EFER_RESERVED_BITS) { - printk(KERN_DEBUG "set_efer: 0x%llx #GP, reserved bits\n", - efer); -@@ -1140,16 +1127,12 @@ void set_efer(struct kvm_vcpu *vcpu, u64 - return; - } - -+ kvm_arch_ops->set_efer(vcpu, efer); -+ - efer &= ~EFER_LMA; - efer |= vcpu->shadow_efer & EFER_LMA; - - vcpu->shadow_efer = efer; -- -- msr = find_msr_entry(vcpu, MSR_EFER); -- -- if (!(efer & EFER_LMA)) -- efer &= ~EFER_LME; -- msr->data = efer; - } - EXPORT_SYMBOL_GPL(set_efer); - ---- a/drivers/kvm/vmx.c -+++ b/drivers/kvm/vmx.c -@@ -78,8 +78,6 @@ static const u32 vmx_msr_index[] = { - }; - #define NR_VMX_MSR (sizeof(vmx_msr_index) / sizeof(*vmx_msr_index)) - --struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr); -- - static inline int is_page_fault(u32 intr_info) - { - return (intr_info & (INTR_INFO_INTR_TYPE_MASK | INTR_INFO_VECTOR_MASK | -@@ -93,6 +91,16 @@ static inline int is_external_interrupt( - == (INTR_TYPE_EXT_INTR | INTR_INFO_VALID_MASK); - } - -+static struct vmx_msr_entry *find_msr_entry(struct kvm_vcpu *vcpu, u32 msr) -+{ -+ int i; -+ -+ for (i = 0; i < vcpu->nmsrs; ++i) -+ if (vcpu->guest_msrs[i].index == msr) -+ return &vcpu->guest_msrs[i]; -+ return 0; -+} -+ - static void vmcs_clear(struct vmcs *vmcs) - { - u64 phys_addr = __pa(vmcs); -From: Avi Kivity -Date: Wed, 13 Dec 2006 08:34:01 +0000 (-0800) -Subject: [PATCH] KVM: Remove extranous put_cpu() from vcpu_put() -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0770b19b94ed8fc97e1fcac91c320ec738919628 - -[PATCH] KVM: Remove extranous put_cpu() from vcpu_put() - -The arch splitting patchset left an extra put_cpu() in core code, where it can -cause trouble for CONFIG_PREEMPT kernels. - -Reported-by: Huihong Luo -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/kvm_main.c -+++ b/drivers/kvm/kvm_main.c -@@ -205,7 +205,6 @@ static struct kvm_vcpu *vcpu_load(struct - static void vcpu_put(struct kvm_vcpu *vcpu) - { - kvm_arch_ops->vcpu_put(vcpu); -- put_cpu(); - mutex_unlock(&vcpu->mutex); - } - -From: Avi Kivity -Date: Wed, 13 Dec 2006 08:34:02 +0000 (-0800) -Subject: [PATCH] KVM: MMU: Ignore pcd, pwt, and pat bits on ptes -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=8c7bb723b4e36dbd4b144176116d126104dc65e0 - -[PATCH] KVM: MMU: Ignore pcd, pwt, and pat bits on ptes - -The pcd, pwt, and pat bits on page table entries affect the cpu cache. Since -the cache is a host resource, the guest should not be able to control it. -Moreover, the meaning of these bits changes depending on whether pat is -enabled or not. - -So, force these bits to zero on shadow page table entries at all times. - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/mmu.c -+++ b/drivers/kvm/mmu.c -@@ -61,22 +61,9 @@ - - - #define PT32_PTE_COPY_MASK \ -- (PT_PRESENT_MASK | PT_PWT_MASK | PT_PCD_MASK | \ -- PT_ACCESSED_MASK | PT_DIRTY_MASK | PT_PAT_MASK | \ -- PT_GLOBAL_MASK ) -- --#define PT32_NON_PTE_COPY_MASK \ -- (PT_PRESENT_MASK | PT_PWT_MASK | PT_PCD_MASK | \ -- PT_ACCESSED_MASK | PT_DIRTY_MASK) -- -- --#define PT64_PTE_COPY_MASK \ -- (PT64_NX_MASK | PT32_PTE_COPY_MASK) -- --#define PT64_NON_PTE_COPY_MASK \ -- (PT64_NX_MASK | PT32_NON_PTE_COPY_MASK) -- -+ (PT_PRESENT_MASK | PT_ACCESSED_MASK | PT_DIRTY_MASK | PT_GLOBAL_MASK) - -+#define PT64_PTE_COPY_MASK (PT64_NX_MASK | PT32_PTE_COPY_MASK) - - #define PT_FIRST_AVAIL_BITS_SHIFT 9 - #define PT64_SECOND_AVAIL_BITS_SHIFT 52 ---- a/drivers/kvm/paging_tmpl.h -+++ b/drivers/kvm/paging_tmpl.h -@@ -32,7 +32,6 @@ - #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) - #define PT_LEVEL_MASK(level) PT64_LEVEL_MASK(level) - #define PT_PTE_COPY_MASK PT64_PTE_COPY_MASK -- #define PT_NON_PTE_COPY_MASK PT64_NON_PTE_COPY_MASK - #elif PTTYPE == 32 - #define pt_element_t u32 - #define guest_walker guest_walker32 -@@ -43,7 +42,6 @@ - #define SHADOW_PT_INDEX(addr, level) PT64_INDEX(addr, level) - #define PT_LEVEL_MASK(level) PT32_LEVEL_MASK(level) - #define PT_PTE_COPY_MASK PT32_PTE_COPY_MASK -- #define PT_NON_PTE_COPY_MASK PT32_NON_PTE_COPY_MASK - #else - #error Invalid PTTYPE value - #endif -@@ -105,9 +103,7 @@ static void FNAME(set_pde)(struct kvm_vc - if (PTTYPE == 32 && is_cpuid_PSE36()) - gaddr |= (guest_pde & PT32_DIR_PSE36_MASK) << - (32 - PT32_DIR_PSE36_SHIFT); -- *shadow_pte = (guest_pde & (PT_NON_PTE_COPY_MASK | PT_GLOBAL_MASK)) | -- ((guest_pde & PT_DIR_PAT_MASK) >> -- (PT_DIR_PAT_SHIFT - PT_PAT_SHIFT)); -+ *shadow_pte = guest_pde & PT_PTE_COPY_MASK; - set_pte_common(vcpu, shadow_pte, gaddr, - guest_pde & PT_DIRTY_MASK, access_bits); - } -@@ -162,6 +158,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu - u32 index = SHADOW_PT_INDEX(addr, level); - u64 *shadow_ent = ((u64 *)__va(shadow_addr)) + index; - pt_element_t *guest_ent; -+ u64 shadow_pte; - - if (is_present_pte(*shadow_ent) || is_io_pte(*shadow_ent)) { - if (level == PT_PAGE_TABLE_LEVEL) -@@ -204,14 +201,11 @@ static u64 *FNAME(fetch)(struct kvm_vcpu - shadow_addr = kvm_mmu_alloc_page(vcpu, shadow_ent); - if (!VALID_PAGE(shadow_addr)) - return ERR_PTR(-ENOMEM); -- if (!kvm_arch_ops->is_long_mode(vcpu) && level == 3) -- *shadow_ent = shadow_addr | -- (*guest_ent & (PT_PRESENT_MASK | PT_PWT_MASK | PT_PCD_MASK)); -- else { -- *shadow_ent = shadow_addr | -- (*guest_ent & PT_NON_PTE_COPY_MASK); -- *shadow_ent |= (PT_WRITABLE_MASK | PT_USER_MASK); -- } -+ shadow_pte = shadow_addr | PT_PRESENT_MASK; -+ if (vcpu->mmu.root_level > 3 || level != 3) -+ shadow_pte |= PT_ACCESSED_MASK -+ | PT_WRITABLE_MASK | PT_USER_MASK; -+ *shadow_ent = shadow_pte; - prev_shadow_ent = shadow_ent; - } - } -From: Avi Kivity -Date: Wed, 13 Dec 2006 08:34:03 +0000 (-0800) -Subject: [PATCH] KVM: Add MAINTAINERS entry -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=426d62e2158c2fd3aa1ed1fd62122afd2ccb89ae - -[PATCH] KVM: Add MAINTAINERS entry - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -1747,6 +1747,13 @@ W: http://nfs.sourceforge.net/ - W: http://www.cse.unsw.edu.au/~neilb/patches/linux-devel/ - S: Maintained - -+KERNEL VIRTUAL MACHINE (KVM) -+P: Avi Kivity -+M: avi@qumranet.com -+L: kvm-devel@lists.sourceforge.net -+W: kvm.sourceforge.net -+S: Supported -+ - KEXEC - P: Eric Biederman - M: ebiederm@xmission.com -From: Avi Kivity -Date: Wed, 13 Dec 2006 08:34:14 +0000 (-0800) -Subject: [PATCH] KVM: Disallow the kvm-amd module on intel hardware, and vice versa -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=873a7c423bf8f12bff48a4b8963b32be568b4fcf - -[PATCH] KVM: Disallow the kvm-amd module on intel hardware, and vice versa - -They're not on speaking terms. - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/svm.c -+++ b/drivers/kvm/svm.c -@@ -377,6 +377,7 @@ static __init int svm_hardware_setup(voi - void *msrpm_va; - int r; - -+ kvm_emulator_want_group7_invlpg(); - - iopm_pages = alloc_pages(GFP_KERNEL, IOPM_ALLOC_ORDER); - -@@ -1628,9 +1629,7 @@ static struct kvm_arch_ops svm_arch_ops - - static int __init svm_init(void) - { -- kvm_emulator_want_group7_invlpg(); -- kvm_init_arch(&svm_arch_ops, THIS_MODULE); -- return 0; -+ return kvm_init_arch(&svm_arch_ops, THIS_MODULE); - } - - static void __exit svm_exit(void) ---- a/drivers/kvm/vmx.c -+++ b/drivers/kvm/vmx.c -@@ -2000,8 +2000,7 @@ static struct kvm_arch_ops vmx_arch_ops - - static int __init vmx_init(void) - { -- kvm_init_arch(&vmx_arch_ops, THIS_MODULE); -- return 0; -+ return kvm_init_arch(&vmx_arch_ops, THIS_MODULE); - } - - static void __exit vmx_exit(void) -From: Michael Riepe -Date: Wed, 13 Dec 2006 08:34:15 +0000 (-0800) -Subject: [PATCH] KVM: Don't touch the virtual apic vt registers on 32-bit -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=3b99ab242145c99ec8781dc267ec100e7f23ef9d - -[PATCH] KVM: Don't touch the virtual apic vt registers on 32-bit - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/vmx.c -+++ b/drivers/kvm/vmx.c -@@ -1175,8 +1175,10 @@ static int vmx_vcpu_setup(struct kvm_vcp - VM_ENTRY_CONTROLS, 0); - vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 0); /* 22.2.1 */ - -+#ifdef CONFIG_X86_64 - vmcs_writel(VIRTUAL_APIC_PAGE_ADDR, 0); - vmcs_writel(TPR_THRESHOLD, 0); -+#endif - - vmcs_writel(CR0_GUEST_HOST_MASK, KVM_GUEST_CR0_MASK); - vmcs_writel(CR4_GUEST_HOST_MASK, KVM_GUEST_CR4_MASK); -From: Avi Kivity -Date: Wed, 13 Dec 2006 08:34:16 +0000 (-0800) -Subject: [PATCH] KVM: Fix vmx hardware_enable() on macbooks -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=bfdc0c280a497575670e87efa89e78a88438483b - -[PATCH] KVM: Fix vmx hardware_enable() on macbooks - -It seems macbooks set bit 2 but not bit 0, which is an "enabled but vmxon will -fault" setting. - -Signed-off-by: Avi Kivity -Tested-by: Alex Larsson (sometimes testing helps) -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/vmx.c -+++ b/drivers/kvm/vmx.c -@@ -534,7 +534,7 @@ static __init void hardware_enable(void - u64 old; - - rdmsrl(MSR_IA32_FEATURE_CONTROL, old); -- if ((old & 5) == 0) -+ if ((old & 5) != 5) - /* enable and lock */ - wrmsrl(MSR_IA32_FEATURE_CONTROL, old | 5); - write_cr4(read_cr4() | CR4_VMXE); /* FIXME: not cpu hotplug safe */ -From: James Morris -Date: Fri, 22 Dec 2006 09:04:55 +0000 (-0800) -Subject: [PATCH] KVM: add valid_vcpu() helper -X-Git-Tag: v2.6.20-rc2 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=5aacf0ca4128fdeadf91c0ac50271841b643d1fd - -[PATCH] KVM: add valid_vcpu() helper - -Consolidate the logic for checking whether a vcpu index is valid. Also, use -likely(), as a valid value should be the overwhelmingly common case. - -Signed-off-by: James Morris -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/kvm_main.c -+++ b/drivers/kvm/kvm_main.c -@@ -113,6 +113,11 @@ unsigned long segment_base(u16 selector) - } - EXPORT_SYMBOL_GPL(segment_base); - -+static inline int valid_vcpu(int n) -+{ -+ return likely(n >= 0 && n < KVM_MAX_VCPUS); -+} -+ - int kvm_read_guest(struct kvm_vcpu *vcpu, - gva_t addr, - unsigned long size, -@@ -494,7 +499,7 @@ static int kvm_dev_ioctl_create_vcpu(str - struct kvm_vcpu *vcpu; - - r = -EINVAL; -- if (n < 0 || n >= KVM_MAX_VCPUS) -+ if (!valid_vcpu(n)) - goto out; - - vcpu = &kvm->vcpus[n]; -@@ -1179,7 +1184,7 @@ static int kvm_dev_ioctl_run(struct kvm - struct kvm_vcpu *vcpu; - int r; - -- if (kvm_run->vcpu < 0 || kvm_run->vcpu >= KVM_MAX_VCPUS) -+ if (!valid_vcpu(kvm_run->vcpu)) - return -EINVAL; - - vcpu = vcpu_load(kvm, kvm_run->vcpu); -@@ -1208,7 +1213,7 @@ static int kvm_dev_ioctl_get_regs(struct - { - struct kvm_vcpu *vcpu; - -- if (regs->vcpu < 0 || regs->vcpu >= KVM_MAX_VCPUS) -+ if (!valid_vcpu(regs->vcpu)) - return -EINVAL; - - vcpu = vcpu_load(kvm, regs->vcpu); -@@ -1254,7 +1259,7 @@ static int kvm_dev_ioctl_set_regs(struct - { - struct kvm_vcpu *vcpu; - -- if (regs->vcpu < 0 || regs->vcpu >= KVM_MAX_VCPUS) -+ if (!valid_vcpu(regs->vcpu)) - return -EINVAL; - - vcpu = vcpu_load(kvm, regs->vcpu); -@@ -1301,7 +1306,7 @@ static int kvm_dev_ioctl_get_sregs(struc - struct kvm_vcpu *vcpu; - struct descriptor_table dt; - -- if (sregs->vcpu < 0 || sregs->vcpu >= KVM_MAX_VCPUS) -+ if (!valid_vcpu(sregs->vcpu)) - return -EINVAL; - vcpu = vcpu_load(kvm, sregs->vcpu); - if (!vcpu) -@@ -1353,7 +1358,7 @@ static int kvm_dev_ioctl_set_sregs(struc - int i; - struct descriptor_table dt; - -- if (sregs->vcpu < 0 || sregs->vcpu >= KVM_MAX_VCPUS) -+ if (!valid_vcpu(sregs->vcpu)) - return -EINVAL; - vcpu = vcpu_load(kvm, sregs->vcpu); - if (!vcpu) -@@ -1444,7 +1449,7 @@ static int __msr_io(struct kvm *kvm, str - struct kvm_vcpu *vcpu; - int i; - -- if (msrs->vcpu < 0 || msrs->vcpu >= KVM_MAX_VCPUS) -+ if (!valid_vcpu(msrs->vcpu)) - return -EINVAL; - - vcpu = vcpu_load(kvm, msrs->vcpu); -@@ -1537,7 +1542,7 @@ static int kvm_dev_ioctl_interrupt(struc - { - struct kvm_vcpu *vcpu; - -- if (irq->vcpu < 0 || irq->vcpu >= KVM_MAX_VCPUS) -+ if (!valid_vcpu(irq->vcpu)) - return -EINVAL; - if (irq->irq < 0 || irq->irq >= 256) - return -EINVAL; -@@ -1559,7 +1564,7 @@ static int kvm_dev_ioctl_debug_guest(str - struct kvm_vcpu *vcpu; - int r; - -- if (dbg->vcpu < 0 || dbg->vcpu >= KVM_MAX_VCPUS) -+ if (!valid_vcpu(dbg->vcpu)) - return -EINVAL; - vcpu = vcpu_load(kvm, dbg->vcpu); - if (!vcpu) -From: Avi Kivity -Date: Fri, 22 Dec 2006 09:05:08 +0000 (-0800) -Subject: [PATCH] KVM: AMD SVM: handle MSR_STAR in 32-bit mode -X-Git-Tag: v2.6.20-rc2 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0e859cacb0b01bdbe34b5200dd2457d4818248fa - -[PATCH] KVM: AMD SVM: handle MSR_STAR in 32-bit mode - -This is necessary for linux guests. - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/svm.c -+++ b/drivers/kvm/svm.c -@@ -402,11 +402,11 @@ static __init int svm_hardware_setup(voi - set_msr_interception(msrpm_va, MSR_GS_BASE, 1, 1); - set_msr_interception(msrpm_va, MSR_FS_BASE, 1, 1); - set_msr_interception(msrpm_va, MSR_KERNEL_GS_BASE, 1, 1); -- set_msr_interception(msrpm_va, MSR_STAR, 1, 1); - set_msr_interception(msrpm_va, MSR_LSTAR, 1, 1); - set_msr_interception(msrpm_va, MSR_CSTAR, 1, 1); - set_msr_interception(msrpm_va, MSR_SYSCALL_MASK, 1, 1); - #endif -+ set_msr_interception(msrpm_va, MSR_K6_STAR, 1, 1); - set_msr_interception(msrpm_va, MSR_IA32_SYSENTER_CS, 1, 1); - set_msr_interception(msrpm_va, MSR_IA32_SYSENTER_ESP, 1, 1); - set_msr_interception(msrpm_va, MSR_IA32_SYSENTER_EIP, 1, 1); -@@ -1098,10 +1098,10 @@ static int svm_get_msr(struct kvm_vcpu * - case MSR_IA32_APICBASE: - *data = vcpu->apic_base; - break; --#ifdef CONFIG_X86_64 -- case MSR_STAR: -+ case MSR_K6_STAR: - *data = vcpu->svm->vmcb->save.star; - break; -+#ifdef CONFIG_X86_64 - case MSR_LSTAR: - *data = vcpu->svm->vmcb->save.lstar; - break; -@@ -1173,10 +1173,10 @@ static int svm_set_msr(struct kvm_vcpu * - case MSR_IA32_APICBASE: - vcpu->apic_base = data; - break; --#ifdef CONFIG_X86_64_ -- case MSR_STAR: -+ case MSR_K6_STAR: - vcpu->svm->vmcb->save.star = data; - break; -+#ifdef CONFIG_X86_64_ - case MSR_LSTAR: - vcpu->svm->vmcb->save.lstar = data; - break; -From: Avi Kivity -Date: Fri, 22 Dec 2006 09:05:20 +0000 (-0800) -Subject: [PATCH] KVM: AMD SVM: Save and restore the floating point unit state -X-Git-Tag: v2.6.20-rc2 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=36241b8c7cbcc83e7fd534d25e1df8339db8244e - -[PATCH] KVM: AMD SVM: Save and restore the floating point unit state - -Fixes sf bug 1614113 (segfaults in nbench). - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/svm.c -+++ b/drivers/kvm/svm.c -@@ -575,6 +575,8 @@ static int svm_create_vcpu(struct kvm_vc - memset(vcpu->svm->db_regs, 0, sizeof(vcpu->svm->db_regs)); - init_vmcb(vcpu->svm->vmcb); - -+ fx_init(vcpu); -+ - return 0; - - out2: -@@ -1387,6 +1389,10 @@ again: - save_db_regs(vcpu->svm->host_db_regs); - load_db_regs(vcpu->svm->db_regs); - } -+ -+ fx_save(vcpu->host_fx_image); -+ fx_restore(vcpu->guest_fx_image); -+ - asm volatile ( - #ifdef CONFIG_X86_64 - "push %%rbx; push %%rcx; push %%rdx;" -@@ -1496,6 +1502,9 @@ again: - #endif - : "cc", "memory" ); - -+ fx_save(vcpu->guest_fx_image); -+ fx_restore(vcpu->host_fx_image); -+ - if ((vcpu->svm->vmcb->save.dr7 & 0xff)) - load_db_regs(vcpu->svm->host_db_regs); - -From: Avi Kivity -Date: Fri, 22 Dec 2006 09:05:28 +0000 (-0800) -Subject: [PATCH] KVM: Use more traditional error handling in kvm_mmu_init() -X-Git-Tag: v2.6.20-rc2 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=2c264957105b7c248a456ba6602df667ae986550 - -[PATCH] KVM: Use more traditional error handling in kvm_mmu_init() - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/mmu.c -+++ b/drivers/kvm/mmu.c -@@ -647,14 +647,20 @@ int kvm_mmu_init(struct kvm_vcpu *vcpu) - ASSERT(!VALID_PAGE(vcpu->mmu.root_hpa)); - ASSERT(list_empty(&vcpu->free_pages)); - -- if ((r = alloc_mmu_pages(vcpu))) -- return r; -+ r = alloc_mmu_pages(vcpu); -+ if (r) -+ goto out; -+ -+ r = init_kvm_mmu(vcpu); -+ if (r) -+ goto out_free_pages; - -- if ((r = init_kvm_mmu(vcpu))) { -- free_mmu_pages(vcpu); -- return r; -- } - return 0; -+ -+out_free_pages: -+ free_mmu_pages(vcpu); -+out: -+ return r; - } - - void kvm_mmu_destroy(struct kvm_vcpu *vcpu) -From: Michael Riepe -Date: Fri, 22 Dec 2006 09:05:36 +0000 (-0800) -Subject: [PATCH] KVM: Do not export unsupported msrs to userspace -X-Git-Tag: v2.6.20-rc2 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=bf591b24d07126143356058966d79423661f491f - -[PATCH] KVM: Do not export unsupported msrs to userspace - -Some msrs, such as MSR_STAR, are not available on all processors. Exporting -them causes qemu to try to fetch them, which will fail. - -So, check all msrs for validity at module load time. - -Signed-off-by: Michael Riepe -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/kvm_main.c -+++ b/drivers/kvm/kvm_main.c -@@ -1417,6 +1417,9 @@ static int kvm_dev_ioctl_set_sregs(struc - /* - * List of msr numbers which we expose to userspace through KVM_GET_MSRS - * and KVM_SET_MSRS, and KVM_GET_MSR_INDEX_LIST. -+ * -+ * This list is modified at module load time to reflect the -+ * capabilities of the host cpu. - */ - static u32 msrs_to_save[] = { - MSR_IA32_SYSENTER_CS, MSR_IA32_SYSENTER_ESP, MSR_IA32_SYSENTER_EIP, -@@ -1427,6 +1430,22 @@ static u32 msrs_to_save[] = { - MSR_IA32_TIME_STAMP_COUNTER, - }; - -+static unsigned num_msrs_to_save; -+ -+static __init void kvm_init_msr_list(void) -+{ -+ u32 dummy[2]; -+ unsigned i, j; -+ -+ for (i = j = 0; i < ARRAY_SIZE(msrs_to_save); i++) { -+ if (rdmsr_safe(msrs_to_save[i], &dummy[0], &dummy[1]) < 0) -+ continue; -+ if (j < i) -+ msrs_to_save[j] = msrs_to_save[i]; -+ j++; -+ } -+ num_msrs_to_save = j; -+} - - /* - * Adapt set_msr() to msr_io()'s calling convention -@@ -1735,15 +1754,15 @@ static long kvm_dev_ioctl(struct file *f - if (copy_from_user(&msr_list, user_msr_list, sizeof msr_list)) - goto out; - n = msr_list.nmsrs; -- msr_list.nmsrs = ARRAY_SIZE(msrs_to_save); -+ msr_list.nmsrs = num_msrs_to_save; - if (copy_to_user(user_msr_list, &msr_list, sizeof msr_list)) - goto out; - r = -E2BIG; -- if (n < ARRAY_SIZE(msrs_to_save)) -+ if (n < num_msrs_to_save) - goto out; - r = -EFAULT; - if (copy_to_user(user_msr_list->indices, &msrs_to_save, -- sizeof msrs_to_save)) -+ num_msrs_to_save * sizeof(u32))) - goto out; - r = 0; - } -@@ -1894,6 +1913,8 @@ static __init int kvm_init(void) - - kvm_init_debug(); - -+ kvm_init_msr_list(); -+ - if ((bad_page = alloc_page(GFP_KERNEL)) == NULL) { - r = -ENOMEM; - goto out; -From: Michael Riepe -Date: Fri, 22 Dec 2006 09:05:45 +0000 (-0800) -Subject: [PATCH] KVM: Force real-mode cs limit to 64K -X-Git-Tag: v2.6.20-rc2 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=abacf8dff911ecc11513dff162d7990aa8ed2da0 - -[PATCH] KVM: Force real-mode cs limit to 64K - -This allows opensolaris to boot on kvm/intel. - -Signed-off-by: Michael Riepe -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/vmx.c -+++ b/drivers/kvm/vmx.c -@@ -726,6 +726,7 @@ static void enter_rmode(struct kvm_vcpu - vmcs_write32(GUEST_SS_AR_BYTES, 0xf3); - - vmcs_write32(GUEST_CS_AR_BYTES, 0xf3); -+ vmcs_write32(GUEST_CS_LIMIT, 0xffff); - vmcs_write16(GUEST_CS_SELECTOR, vmcs_readl(GUEST_CS_BASE) >> 4); - - fix_rmode_seg(VCPU_SREG_ES, &vcpu->rmode.es); -From: Michael Riepe -Date: Fri, 22 Dec 2006 09:05:53 +0000 (-0800) -Subject: [PATCH] KVM: Handle p5 mce msrs -X-Git-Tag: v2.6.20-rc2 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0f8e3d365a30a8788d4c348e2885bac9640bf4d0 - -[PATCH] KVM: Handle p5 mce msrs - -This allows plan9 to get a little further booting. - -Signed-off-by: Michael Riepe -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/svm.c -+++ b/drivers/kvm/svm.c -@@ -1073,6 +1073,8 @@ static int emulate_on_interception(struc - static int svm_get_msr(struct kvm_vcpu *vcpu, unsigned ecx, u64 *data) - { - switch (ecx) { -+ case MSR_IA32_P5_MC_ADDR: -+ case MSR_IA32_P5_MC_TYPE: - case MSR_IA32_MC0_CTL: - case MSR_IA32_MCG_STATUS: - case MSR_IA32_MCG_CAP: ---- a/drivers/kvm/vmx.c -+++ b/drivers/kvm/vmx.c -@@ -359,6 +359,8 @@ static int vmx_get_msr(struct kvm_vcpu * - case MSR_IA32_SYSENTER_ESP: - data = vmcs_read32(GUEST_SYSENTER_ESP); - break; -+ case MSR_IA32_P5_MC_ADDR: -+ case MSR_IA32_P5_MC_TYPE: - case MSR_IA32_MC0_CTL: - case MSR_IA32_MCG_STATUS: - case MSR_IA32_MCG_CAP: -From: Avi Kivity -Date: Fri, 22 Dec 2006 09:06:02 +0000 (-0800) -Subject: [PATCH] KVM: API versioning -X-Git-Tag: v2.6.20-rc2 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0b76e20b27d20f7cb240e6b1b2dbebaa1b7f9b60 - -[PATCH] KVM: API versioning - -Add compile-time and run-time API versioning. - -Signed-off-by: Avi Kivity -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds ---- - ---- a/drivers/kvm/kvm_main.c -+++ b/drivers/kvm/kvm_main.c -@@ -1603,6 +1603,9 @@ static long kvm_dev_ioctl(struct file *f - int r = -EINVAL; - - switch (ioctl) { -+ case KVM_GET_API_VERSION: -+ r = KVM_API_VERSION; -+ break; - case KVM_CREATE_VCPU: { - r = kvm_dev_ioctl_create_vcpu(kvm, arg); - if (r) ---- a/include/linux/kvm.h -+++ b/include/linux/kvm.h -@@ -11,6 +11,8 @@ - #include - #include - -+#define KVM_API_VERSION 1 -+ - /* - * Architectural interrupt line count, and the size of the bitmap needed - * to hold them. -@@ -209,6 +211,7 @@ struct kvm_dirty_log { - - #define KVMIO 0xAE - -+#define KVM_GET_API_VERSION _IO(KVMIO, 1) - #define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) - #define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs) - #define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) diff --git a/sys-kernel/gentoo-sources/files/2.6.19-libata-pata_ali-updates.patch b/sys-kernel/gentoo-sources/files/2.6.19-libata-pata_ali-updates.patch deleted file mode 100644 index 82f71928c..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.19-libata-pata_ali-updates.patch +++ /dev/null @@ -1,207 +0,0 @@ -From: Alan -Date: Wed, 22 Nov 2006 17:26:06 +0000 (+0000) -Subject: [PATCH] pata_ali: suspend/resume support -X-Git-Tag: v2.6.20-rc1 -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=34d8dfb1e6b51dbd6eefcb449b531c7ee773664c - -[PATCH] pata_ali: suspend/resume support - -Various chipset functions must be reprogrammed on a resume from RAM, -without this things like ATAPI DMA stop working on resume with some -chipset variants. Split the chipset programming and init time method selection into two functions. - -Signed-off-by: Alan Cox -Signed-off-by: Jeff Garzik ---- - ---- a/drivers/ata/pata_ali.c -+++ b/drivers/ata/pata_ali.c -@@ -34,7 +34,7 @@ - #include - - #define DRV_NAME "pata_ali" --#define DRV_VERSION "0.6.6" -+#define DRV_VERSION "0.7.1" - - /* - * Cable special cases -@@ -348,6 +348,8 @@ static struct scsi_host_template ali_sht - .slave_configure = ata_scsi_slave_config, - .slave_destroy = ata_scsi_slave_destroy, - .bios_param = ata_std_bios_param, -+ .resume = ata_scsi_device_resume, -+ .suspend = ata_scsi_device_suspend, - }; - - /* -@@ -497,6 +499,69 @@ static struct ata_port_operations ali_c5 - .host_stop = ata_host_stop - }; - -+ -+/** -+ * ali_init_chipset - chip setup function -+ * @pdev: PCI device of ATA controller -+ * -+ * Perform the setup on the device that must be done both at boot -+ * and at resume time. -+ */ -+ -+static void ali_init_chipset(struct pci_dev *pdev) -+{ -+ u8 rev, tmp; -+ struct pci_dev *north, *isa_bridge; -+ -+ pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); -+ -+ /* -+ * The chipset revision selects the driver operations and -+ * mode data. -+ */ -+ -+ if (rev >= 0x20 && rev < 0xC2) { -+ /* 1543-E/F, 1543C-C, 1543C-D, 1543C-E */ -+ pci_read_config_byte(pdev, 0x4B, &tmp); -+ /* Clear CD-ROM DMA write bit */ -+ tmp &= 0x7F; -+ pci_write_config_byte(pdev, 0x4B, tmp); -+ } else if (rev >= 0xC2) { -+ /* Enable cable detection logic */ -+ pci_read_config_byte(pdev, 0x4B, &tmp); -+ pci_write_config_byte(pdev, 0x4B, tmp | 0x08); -+ } -+ north = pci_get_slot(pdev->bus, PCI_DEVFN(0,0)); -+ isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); -+ -+ if (north && north->vendor == PCI_VENDOR_ID_AL && isa_bridge) { -+ /* Configure the ALi bridge logic. For non ALi rely on BIOS. -+ Set the south bridge enable bit */ -+ pci_read_config_byte(isa_bridge, 0x79, &tmp); -+ if (rev == 0xC2) -+ pci_write_config_byte(isa_bridge, 0x79, tmp | 0x04); -+ else if (rev > 0xC2) -+ pci_write_config_byte(isa_bridge, 0x79, tmp | 0x02); -+ } -+ if (rev >= 0x20) { -+ /* -+ * CD_ROM DMA on (0x53 bit 0). Enable this even if we want -+ * to use PIO. 0x53 bit 1 (rev 20 only) - enable FIFO control -+ * via 0x54/55. -+ */ -+ pci_read_config_byte(pdev, 0x53, &tmp); -+ if (rev <= 0x20) -+ tmp &= ~0x02; -+ if (rev >= 0xc7) -+ tmp |= 0x03; -+ else -+ tmp |= 0x01; /* CD_ROM enable for DMA */ -+ pci_write_config_byte(pdev, 0x53, tmp); -+ } -+ pci_dev_put(isa_bridge); -+ pci_dev_put(north); -+ ata_pci_clear_simplex(pdev); -+} - /** - * ali_init_one - discovery callback - * @pdev: PCI device ID -@@ -570,7 +635,7 @@ static int ali_init_one(struct pci_dev * - - static struct ata_port_info *port_info[2]; - u8 rev, tmp; -- struct pci_dev *north, *isa_bridge; -+ struct pci_dev *isa_bridge; - - pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); - -@@ -582,11 +647,6 @@ static int ali_init_one(struct pci_dev * - if (rev < 0x20) { - port_info[0] = port_info[1] = &info_early; - } else if (rev < 0xC2) { -- /* 1543-E/F, 1543C-C, 1543C-D, 1543C-E */ -- pci_read_config_byte(pdev, 0x4B, &tmp); -- /* Clear CD-ROM DMA write bit */ -- tmp &= 0x7F; -- pci_write_config_byte(pdev, 0x4B, tmp); - port_info[0] = port_info[1] = &info_20; - } else if (rev == 0xC2) { - port_info[0] = port_info[1] = &info_c2; -@@ -597,54 +657,25 @@ static int ali_init_one(struct pci_dev * - } else - port_info[0] = port_info[1] = &info_c5; - -- if (rev >= 0xC2) { -- /* Enable cable detection logic */ -- pci_read_config_byte(pdev, 0x4B, &tmp); -- pci_write_config_byte(pdev, 0x4B, tmp | 0x08); -- } -- -- north = pci_get_slot(pdev->bus, PCI_DEVFN(0,0)); -+ ali_init_chipset(pdev); -+ - isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); -- -- if (north && north->vendor == PCI_VENDOR_ID_AL) { -- /* Configure the ALi bridge logic. For non ALi rely on BIOS. -- Set the south bridge enable bit */ -- pci_read_config_byte(isa_bridge, 0x79, &tmp); -- if (rev == 0xC2) -- pci_write_config_byte(isa_bridge, 0x79, tmp | 0x04); -- else if (rev > 0xC2) -- pci_write_config_byte(isa_bridge, 0x79, tmp | 0x02); -+ if (isa_bridge && rev >= 0x20 && rev < 0xC2) { -+ /* Are we paired with a UDMA capable chip */ -+ pci_read_config_byte(isa_bridge, 0x5E, &tmp); -+ if ((tmp & 0x1E) == 0x12) -+ port_info[0] = port_info[1] = &info_20_udma; -+ pci_dev_put(isa_bridge); - } -- -- if (rev >= 0x20) { -- if (rev < 0xC2) { -- /* Are we paired with a UDMA capable chip */ -- pci_read_config_byte(isa_bridge, 0x5E, &tmp); -- if ((tmp & 0x1E) == 0x12) -- port_info[0] = port_info[1] = &info_20_udma; -- } -- /* -- * CD_ROM DMA on (0x53 bit 0). Enable this even if we want -- * to use PIO. 0x53 bit 1 (rev 20 only) - enable FIFO control -- * via 0x54/55. -- */ -- pci_read_config_byte(pdev, 0x53, &tmp); -- if (rev <= 0x20) -- tmp &= ~0x02; -- if (rev >= 0xc7) -- tmp |= 0x03; -- else -- tmp |= 0x01; /* CD_ROM enable for DMA */ -- pci_write_config_byte(pdev, 0x53, tmp); -- } -- -- pci_dev_put(isa_bridge); -- pci_dev_put(north); -- -- ata_pci_clear_simplex(pdev); - return ata_pci_init_one(pdev, port_info, 2); - } - -+static int ali_reinit_one(struct pci_dev *pdev) -+{ -+ ali_init_chipset(pdev); -+ return ata_pci_device_resume(pdev); -+} -+ - static const struct pci_device_id ali[] = { - { PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5228), }, - { PCI_VDEVICE(AL, PCI_DEVICE_ID_AL_M5229), }, -@@ -656,7 +687,9 @@ static struct pci_driver ali_pci_driver - .name = DRV_NAME, - .id_table = ali, - .probe = ali_init_one, -- .remove = ata_pci_remove_one -+ .remove = ata_pci_remove_one, -+ .suspend = ata_pci_device_suspend, -+ .resume = ali_reinit_one, - }; - - static int __init ali_init(void) diff --git a/sys-kernel/gentoo-sources/files/2.6.19-mactel.patch b/sys-kernel/gentoo-sources/files/2.6.19-mactel.patch deleted file mode 100644 index 9a55bea2e..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.19-mactel.patch +++ /dev/null @@ -1,2334 +0,0 @@ ---- a/drivers/acpi/blacklist.c 2006-06-26 08:32:21.000000000 +0200 -+++ a/drivers/acpi/blacklist.c 2006-06-26 08:32:59.000000000 +0200 -@@ -78,6 +78,10 @@ - static int __init blacklist_by_year(void) - { - int year = dmi_get_year(DMI_BIOS_DATE); -+ -+ if (efi_enabled) -+ return 0; -+ - /* Doesn't exist? Likely an old system */ - if (year == -1) - return 1; -diff -pruN linux/drivers/hwmon.vanilla/Kconfig linux/drivers/hwmon/Kconfig ---- linux/drivers/hwmon.vanilla/Kconfig 2006-11-30 21:14:48.000000000 +0800 -+++ linux/drivers/hwmon/Kconfig 2006-11-30 20:52:23.000000000 +0800 -@@ -539,6 +539,28 @@ config SENSORS_HDAPS - Say Y here if you have an applicable laptop and want to experience - the awesome power of hdaps. - -+config SENSORS_APPLESMC -+ tristate "Apple SMC (Motion sensor, light sensor, keyboard backlight)" -+ depends on HWMON && INPUT && X86 -+ select NEW_LEDS -+ select LEDS_CLASS -+ default n -+ help -+ This driver provides support for the Apple System Management -+ Controller, which provides an accelerometer (Apple Sudden Motion -+ Sensor), light sensors, and keyboard backlight control. -+ -+ Only Intel-based Apple's laptops are supported (MacBook Pro, MacBook). -+ -+ The accelerometer and light sensors data is readable via sysfs, and -+ the keyboard backlight is writable. -+ -+ This driver also provides an absolute input class device, allowing -+ the laptop to act as a pinball machine-esque joystick. -+ -+ Say Y here if you have an applicable laptop and want to experience -+ the awesome power of applesmc. -+ - config HWMON_DEBUG_CHIP - bool "Hardware Monitoring Chip debugging messages" - depends on HWMON -diff -pruN linux/drivers/hwmon.vanilla/Makefile linux/drivers/hwmon/Makefile ---- linux/drivers/hwmon.vanilla/Makefile 2006-11-30 21:14:48.000000000 +0800 -+++ linux/drivers/hwmon/Makefile 2006-11-30 20:47:51.000000000 +0800 -@@ -18,6 +18,7 @@ obj-$(CONFIG_SENSORS_ADM1025) += adm1025 - obj-$(CONFIG_SENSORS_ADM1026) += adm1026.o - obj-$(CONFIG_SENSORS_ADM1031) += adm1031.o - obj-$(CONFIG_SENSORS_ADM9240) += adm9240.o -+obj-$(CONFIG_SENSORS_APPLESMC) += applesmc.o - obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o - obj-$(CONFIG_SENSORS_CORETEMP) += coretemp.o - obj-$(CONFIG_SENSORS_DS1621) += ds1621.o -diff -pruN linux/drivers/hwmon.vanilla/applesmc.c linux/drivers/hwmon/applesmc.c ---- linux/drivers/hwmon.vanilla/applesmc.c 1970-01-01 07:30:00.000000000 +0730 -+++ linux/drivers/hwmon/applesmc.c 2006-11-30 20:47:51.000000000 +0800 -@@ -0,0 +1,913 @@ -+/* -+ * drivers/hwmon/applesmc.c - driver for Apple's SMC (various sensors, -+ * fan control) -+ * -+ * Copyright (C) 2006 Nicolas Boichat -+ * -+ * Based on hdaps.c driver: -+ * Copyright (C) 2005 Robert Love -+ * Copyright (C) 2005 Jesper Juhl -+ * -+ * Fan control based on smcFanControl: -+ * Copyright (C) 2006 Hendrik Holtmann -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License v2 as published by the -+ * Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -+ * more details. -+ * -+ * You should have received a copy of the GNU General Public License along with -+ * this program; if not, write to the Free Software Foundation, Inc., -+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* data port used by apple SMC */ -+#define APPLESMC_DATA_PORT 0x300 -+/* command/status port used by apple SMC */ -+#define APPLESMC_CMD_PORT 0x304 -+ -+#define APPLESMC_NR_PORTS 5 /* 0x300-0x304 */ -+ -+#define APPLESMC_STATUS_MASK 0x0f -+#define APPLESMC_READ_CMD 0x10 -+#define APPLESMC_WRITE_CMD 0x11 -+ -+#define LIGHT_SENSOR_LEFT_KEY "ALV0" //r-o length 6 -+#define LIGHT_SENSOR_RIGHT_KEY "ALV1" //r-o length 6 -+#define BACKLIGHT_KEY "LKSB" //w-o -+ -+#define CLAMSHELL_KEY "MSLD" //r-o length 1 (unused) -+ -+#define MOTION_SENSOR_X_KEY "MO_X" //r-o length 2 -+#define MOTION_SENSOR_Y_KEY "MO_Y" //r-o length 2 -+#define MOTION_SENSOR_Z_KEY "MO_Z" //r-o length 2 -+#define MOTION_SENSOR_KEY "MOCN" //r/w length 2 -+ -+#define FANS_COUNT "FNum" //r-o length 1 -+#define FANS_MANUAL "FS! " //r-w length 2 -+#define FAN_ACTUAL_SPEED "F0Ac" //r-o length 2 -+#define FAN_MIN_SPEED "F0Mn" //r-o length 2 -+#define FAN_MAX_SPEED "F0Mx" //r-o length 2 -+#define FAN_SAFE_SPEED "F0Sf" //r-o length 2 -+#define FAN_TARGET_SPEED "F0Tg" //r-w length 2 -+ -+static const char* temperature_sensors_sets[][8] = -+{ -+ { "TB0T", "TC0D", "TC0P", "Th0H", "Ts0P", "Th1H", "Ts1P", NULL }, -+ { "TC0D", "TC0P", NULL } -+}; -+ -+#define INIT_TIMEOUT_MSECS 5000 /* wait up to 5s for device init ... */ -+#define INIT_WAIT_MSECS 50 /* ... in 50ms increments */ -+ -+#define APPLESMC_POLL_PERIOD (HZ/20) /* poll for input every 1/20s */ -+#define APPLESMC_INPUT_FUZZ 4 /* input event threshold */ -+#define APPLESMC_INPUT_FLAT 4 -+ -+#define SENSOR_X 0 -+#define SENSOR_Y 1 -+#define SENSOR_Z 2 -+ -+/* Structure to be passed to DMI_MATCH function */ -+struct dmi_match_data { -+/* Indicate whether this computer has an accelerometer. */ -+ int accelerometer; -+/* Indicate whether this computer has light sensors and keyboard backlight. */ -+ int light; -+/* Indicate which temperature sensors set to use. */ -+ int temperature_set; -+}; -+ -+static int debug = 0; -+static struct platform_device *pdev; -+static s16 rest_x; -+static s16 rest_y; -+static struct timer_list applesmc_timer; -+static struct input_dev *applesmc_idev; -+ -+/* Indicate whether this computer has an accelerometer. */ -+static unsigned int applesmc_accelerometer = 0; -+ -+/* Indicate whether this computer has light sensors and keyboard backlight. */ -+static unsigned int applesmc_light = 0; -+ -+/* Indicate which temperature sensors set to use. */ -+static unsigned int applesmc_temperature_set = 0; -+ -+static DECLARE_MUTEX(applesmc_sem); -+ -+/* -+ * __wait_status - Wait up to 100ms for the status port to get a certain value -+ * (masked with 0x0f), returning zero if the value is obtained. Callers must -+ * hold applesmc_sem. -+ */ -+static int __wait_status(u8 val) -+{ -+ unsigned int i; -+ -+ val = val & APPLESMC_STATUS_MASK; -+ -+ for (i = 0; i < 10000; i++) { -+ if ((inb(APPLESMC_CMD_PORT) & APPLESMC_STATUS_MASK) == val) -+ return 0; -+ udelay(10); -+ } -+ -+ printk(KERN_WARNING "applesmc: wait status failed: %x != %x\n", -+ val, inb(APPLESMC_CMD_PORT)); -+ -+ return -EIO; -+} -+ -+/* -+ * applesmc_read_key - reads len bytes from a given key, and put them in buffer. -+ * Returns zero on success or a negative error on failure. Callers must -+ * hold applesmc_sem. -+ */ -+static int applesmc_read_key(const char* key, u8* buffer, u8 len) -+{ -+ int ret = -EIO; -+ int i; -+ -+ outb(APPLESMC_READ_CMD, APPLESMC_CMD_PORT); -+ if (__wait_status(0x0c)) -+ goto out; -+ -+ for (i = 0; i < 4; i++) { -+ outb(key[i], APPLESMC_DATA_PORT); -+ if (__wait_status(0x04)) -+ goto out; -+ } -+ if (debug) printk(KERN_DEBUG "<%s", key); -+ -+ outb(len, APPLESMC_DATA_PORT); -+ if (debug) printk(KERN_DEBUG ">%x", len); -+ -+ for (i = 0; i < len; i++) { -+ if (__wait_status(0x05)) -+ goto out; -+ buffer[i] = inb(APPLESMC_DATA_PORT); -+ if (debug) printk(KERN_DEBUG "<%x", buffer[i]); -+ } -+ if (debug) printk(KERN_DEBUG "\n"); -+ ret = 0; -+ -+out: -+ return ret; -+} -+ -+/* -+ * applesmc_write_key - writes len bytes from buffer to a given key. -+ * Returns zero on success or a negative error on failure. Callers must -+ * hold applesmc_sem. -+ */ -+static int applesmc_write_key(const char* key, u8* buffer, u8 len) -+{ -+ int ret = -EIO; -+ int i; -+ -+ outb(APPLESMC_WRITE_CMD, APPLESMC_CMD_PORT); -+ if (__wait_status(0x0c)) -+ goto out; -+ -+ for (i = 0; i < 4; i++) { -+ outb(key[i], APPLESMC_DATA_PORT); -+ if (__wait_status(0x04)) -+ goto out; -+ } -+ -+ outb(len, APPLESMC_DATA_PORT); -+ -+ for (i = 0; i < len; i++) { -+ if (__wait_status(0x04)) -+ goto out; -+ outb(buffer[i], APPLESMC_DATA_PORT); -+ } -+ -+ ret = 0; -+out: -+ return ret; -+} -+ -+/* -+ * applesmc_read_motion_sensor - Read motion sensor (X, Y or Z). Callers must -+ * hold applesmc_sem. -+ */ -+static int applesmc_read_motion_sensor(int index, s16* value) { -+ u8 buffer[2]; -+ int ret; -+ -+ switch (index) { -+ case SENSOR_X: -+ ret = applesmc_read_key(MOTION_SENSOR_X_KEY, buffer, 2); -+ break; -+ case SENSOR_Y: -+ ret = applesmc_read_key(MOTION_SENSOR_Y_KEY, buffer, 2); -+ break; -+ case SENSOR_Z: -+ ret = applesmc_read_key(MOTION_SENSOR_Z_KEY, buffer, 2); -+ break; -+ default: -+ ret = -EINVAL; -+ } -+ -+ *value = ((s16)buffer[0] << 8) | buffer[1]; -+ -+ return ret; -+} -+ -+/* -+ * applesmc_device_init - initialize the accelerometer. Returns zero on success -+ * and negative error code on failure. Can sleep. -+ */ -+static int applesmc_device_init(void) -+{ -+ int total, ret = -ENXIO; -+ u8 buffer[2]; -+ -+ if (!applesmc_accelerometer) return 0; -+ -+ down(&applesmc_sem); -+ -+ for (total = INIT_TIMEOUT_MSECS; total > 0; total -= INIT_WAIT_MSECS) { -+ if (debug) printk(KERN_DEBUG "applesmc try %d\n", total); -+ if (!applesmc_read_key(MOTION_SENSOR_KEY, buffer, 2) && -+ (buffer[0] != 0x00 || buffer[1] != 0x00)) { -+ if (total == INIT_TIMEOUT_MSECS) { -+ printk(KERN_DEBUG "applesmc: device has" -+ " already been initialized" -+ " (0x%02x, 0x%02x).\n", -+ buffer[0], buffer[1]); -+ } -+ else { -+ printk(KERN_DEBUG "applesmc: device" -+ " successfully initialized" -+ " (0x%02x, 0x%02x).\n", -+ buffer[0], buffer[1]); -+ } -+ ret = 0; -+ goto out; -+ } -+ buffer[0] = 0xe0; -+ buffer[1] = 0x00; -+ applesmc_write_key(MOTION_SENSOR_KEY, buffer, 2); -+ msleep(INIT_WAIT_MSECS); -+ } -+ -+ printk(KERN_WARNING "applesmc: failed to init the device\n"); -+ -+out: -+ up(&applesmc_sem); -+ return ret; -+} -+ -+/* -+ * applesmc_get_fan_count - get the number of fans. Callers must NOT hold -+ * applesmc_sem. -+ */ -+static int applesmc_get_fan_count(void) -+{ -+ int ret; -+ u8 buffer[1]; -+ -+ down(&applesmc_sem); -+ -+ ret = applesmc_read_key(FANS_COUNT, buffer, 1); -+ -+ up(&applesmc_sem); -+ if (ret) -+ return ret; -+ else -+ return buffer[0]; -+} -+ -+/* Device model stuff */ -+static int applesmc_probe(struct platform_device *dev) -+{ -+ int ret; -+ -+ ret = applesmc_device_init(); -+ if (ret) -+ return ret; -+ -+ printk(KERN_INFO "applesmc: device successfully initialized.\n"); -+ return 0; -+} -+ -+static int applesmc_resume(struct platform_device *dev) -+{ -+ return applesmc_device_init(); -+} -+ -+static struct platform_driver applesmc_driver = { -+ .probe = applesmc_probe, -+ .resume = applesmc_resume, -+ .driver = { -+ .name = "applesmc", -+ .owner = THIS_MODULE, -+ }, -+}; -+ -+/* -+ * applesmc_calibrate - Set our "resting" values. Callers must hold applesmc_sem. -+ */ -+static void applesmc_calibrate(void) -+{ -+ applesmc_read_motion_sensor(SENSOR_X, &rest_x); -+ applesmc_read_motion_sensor(SENSOR_Y, &rest_y); -+} -+ -+static void applesmc_mousedev_poll(unsigned long unused) -+{ -+ s16 x, y; -+ -+ /* Cannot sleep. Try nonblockingly. If we fail, try again later. */ -+ if (down_trylock(&applesmc_sem)) { -+ mod_timer(&applesmc_timer,jiffies + APPLESMC_POLL_PERIOD); -+ return; -+ } -+ -+ if (applesmc_read_motion_sensor(SENSOR_X, &x)) -+ goto out; -+ if (applesmc_read_motion_sensor(SENSOR_Y, &y)) -+ goto out; -+ -+ -+ input_report_abs(applesmc_idev, ABS_X, x - rest_x); -+ input_report_abs(applesmc_idev, ABS_Y, y - rest_y); -+ input_sync(applesmc_idev); -+ -+out: -+ mod_timer(&applesmc_timer, jiffies + APPLESMC_POLL_PERIOD); -+ -+ up(&applesmc_sem); -+} -+ -+/* Sysfs Files */ -+ -+static ssize_t applesmc_position_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ int ret; -+ s16 x, y, z; -+ -+ down(&applesmc_sem); -+ -+ ret = applesmc_read_motion_sensor(SENSOR_X, &x); -+ if (ret) -+ goto out; -+ ret = applesmc_read_motion_sensor(SENSOR_Y, &y); -+ if (ret) -+ goto out; -+ ret = applesmc_read_motion_sensor(SENSOR_Z, &z); -+ if (ret) -+ goto out; -+ -+out: -+ up(&applesmc_sem); -+ if (ret) -+ return ret; -+ else -+ return sprintf(buf, "(%d,%d,%d)\n", x, y, z); -+} -+ -+static ssize_t applesmc_light_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ int ret; -+ u8 left = 0, right = 0; -+ u8 buffer[6]; -+ -+ down(&applesmc_sem); -+ -+ ret = applesmc_read_key(LIGHT_SENSOR_LEFT_KEY, buffer, 6); -+ left = buffer[2]; -+ if (ret) -+ goto out; -+ ret = applesmc_read_key(LIGHT_SENSOR_RIGHT_KEY, buffer, 6); -+ right = buffer[2]; -+ -+out: -+ up(&applesmc_sem); -+ if (ret) -+ return ret; -+ else -+ return sprintf(buf, "(%d,%d)\n", left, right); -+} -+ -+/* Displays °C * 100 */ -+static ssize_t applesmc_show_temperature(struct device *dev, char *buf, const char *key) -+{ -+ int ret; -+ u8 buffer[2]; -+ unsigned int temp; -+ -+ down(&applesmc_sem); -+ -+ ret = applesmc_read_key(key, buffer, 2); -+ temp = buffer[0]*100; -+ temp += (buffer[1] >> 6) * 25; -+ -+ up(&applesmc_sem); -+ -+ if (ret) -+ return ret; -+ else -+ return sprintf(buf, "%u\n", temp); -+} -+ -+static ssize_t applesmc_show_fan_speed(struct device *dev, char *buf, -+ const char* key, int offset) -+{ -+ int ret; -+ unsigned int speed = 0; -+ char newkey[5]; -+ u8 buffer[2]; -+ -+ newkey[0] = key[0]; -+ newkey[1] = '0' + offset; -+ newkey[2] = key[2]; -+ newkey[3] = key[3]; -+ newkey[4] = 0; -+ -+ down(&applesmc_sem); -+ -+ ret = applesmc_read_key(newkey, buffer, 2); -+ speed = ((buffer[0] << 8 | buffer[1]) >> 2); -+ -+ up(&applesmc_sem); -+ if (ret) -+ return ret; -+ else -+ return sprintf(buf, "%u\n", speed); -+} -+ -+static ssize_t applesmc_store_fan_speed(struct device *dev, const char *buf, -+ size_t count, const char* key, int offset) -+{ -+ int ret; -+ u32 speed; -+ char newkey[5]; -+ u8 buffer[2]; -+ -+ speed = simple_strtoul(buf, NULL, 10); -+ -+ if (speed > 0x4000) /* Bigger than a 14-bit value */ -+ return -EINVAL; -+ -+ newkey[0] = key[0]; -+ newkey[1] = '0' + offset; -+ newkey[2] = key[2]; -+ newkey[3] = key[3]; -+ newkey[4] = 0; -+ -+ down(&applesmc_sem); -+ -+ buffer[0] = (speed >> 6) & 0xff; -+ buffer[1] = (speed << 2) & 0xff; -+ ret = applesmc_write_key(newkey, buffer, 2); -+ -+ up(&applesmc_sem); -+ if (ret) -+ return ret; -+ else -+ return count; -+} -+ -+static ssize_t applesmc_show_fan_manual(struct device *dev, char *buf, -+ int offset) -+{ -+ int ret; -+ u16 manual = 0; -+ u8 buffer[2]; -+ -+ down(&applesmc_sem); -+ -+ ret = applesmc_read_key(FANS_MANUAL, buffer, 2); -+ manual = ((buffer[0] << 8 | buffer[1]) >> offset) & 0x01; -+ -+ up(&applesmc_sem); -+ if (ret) -+ return ret; -+ else -+ return sprintf(buf, "%d\n", manual); -+} -+ -+static ssize_t applesmc_store_fan_manual(struct device *dev, const char *buf, -+ size_t count, int offset) -+{ -+ int ret; -+ u8 buffer[2]; -+ u32 input; -+ u16 val; -+ -+ input = simple_strtoul(buf, NULL, 10); -+ -+ down(&applesmc_sem); -+ -+ ret = applesmc_read_key(FANS_MANUAL, buffer, 2); -+ val = (buffer[0] << 8 | buffer[1]); -+ if (ret) -+ goto out; -+ -+ if (input) -+ val = val | (0x01 << offset); -+ else -+ val = val & ~(0x01 << offset); -+ -+ buffer[0] = (val >> 8) & 0xFF; -+ buffer[1] = val & 0xFF; -+ -+ ret = applesmc_write_key(FANS_MANUAL, buffer, 2); -+ -+out: -+ up(&applesmc_sem); -+ if (ret) -+ return ret; -+ else -+ return count; -+} -+ -+static ssize_t applesmc_calibrate_show(struct device *dev, -+ struct device_attribute *attr, char *buf) -+{ -+ return sprintf(buf, "(%d,%d)\n", rest_x, rest_y); -+} -+ -+static ssize_t applesmc_calibrate_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ down(&applesmc_sem); -+ applesmc_calibrate(); -+ up(&applesmc_sem); -+ -+ return count; -+} -+ -+static void applesmc_backlight_set(struct led_classdev *led_cdev, -+ enum led_brightness value) -+{ -+ u8 buffer[2]; -+ -+ down(&applesmc_sem); -+ buffer[0] = value; -+ buffer[1] = 0x00; -+ applesmc_write_key(BACKLIGHT_KEY, buffer, 2); -+ up(&applesmc_sem); -+} -+ -+static struct led_classdev applesmc_backlight = { -+ .name = "smc:kbd_backlight", -+ .default_trigger = "nand-disk", -+ .brightness_set = applesmc_backlight_set, -+}; -+ -+static DEVICE_ATTR(position, 0444, applesmc_position_show, NULL); -+static DEVICE_ATTR(calibrate, 0644, applesmc_calibrate_show,applesmc_calibrate_store); -+ -+static DEVICE_ATTR(light, 0444, applesmc_light_show, NULL); -+ -+#define sysfs_fan_speeds_offset(offset) \ -+static ssize_t show_fan_actual_speed_##offset (struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ -+{ \ -+ return applesmc_show_fan_speed(dev, buf, FAN_ACTUAL_SPEED, offset); \ -+} \ -+static DEVICE_ATTR(fan##offset##_actual_speed, S_IRUGO, \ -+ show_fan_actual_speed_##offset, NULL); \ -+\ -+static ssize_t show_fan_minimum_speed_##offset (struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ -+{ \ -+ return applesmc_show_fan_speed(dev, buf, FAN_MIN_SPEED, offset); \ -+} \ -+static ssize_t store_fan_minimum_speed_##offset (struct device *dev, \ -+ struct device_attribute *attr, const char *buf, size_t count) \ -+{ \ -+ return applesmc_store_fan_speed(dev, buf, count, FAN_MIN_SPEED, offset); \ -+} \ -+static DEVICE_ATTR(fan##offset##_minimum_speed, S_IRUGO | S_IWUSR, \ -+ show_fan_minimum_speed_##offset, store_fan_minimum_speed_##offset); \ -+\ -+static ssize_t show_fan_maximum_speed_##offset (struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ -+{ \ -+ return applesmc_show_fan_speed(dev, buf, FAN_MAX_SPEED, offset); \ -+} \ -+static DEVICE_ATTR(fan##offset##_maximum_speed, S_IRUGO, \ -+ show_fan_maximum_speed_##offset, NULL); \ -+\ -+static ssize_t show_fan_safe_speed_##offset (struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ -+{ \ -+ return applesmc_show_fan_speed(dev, buf, FAN_SAFE_SPEED, offset); \ -+} \ -+static DEVICE_ATTR(fan##offset##_safe_speed, S_IRUGO, \ -+ show_fan_safe_speed_##offset, NULL); \ -+\ -+static ssize_t show_fan_target_speed_##offset (struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ -+{ \ -+ return applesmc_show_fan_speed(dev, buf, FAN_TARGET_SPEED, offset); \ -+} \ -+static ssize_t store_fan_target_speed_##offset (struct device *dev, \ -+ struct device_attribute *attr, const char *buf, size_t count) \ -+{ \ -+ return applesmc_store_fan_speed(dev, buf, count, FAN_TARGET_SPEED, offset); \ -+} \ -+static DEVICE_ATTR(fan##offset##_target_speed, S_IRUGO | S_IWUSR, \ -+ show_fan_target_speed_##offset, store_fan_target_speed_##offset); -+ -+#define sysfs_fan_manual_offset(offset) \ -+static ssize_t show_fan_manual_##offset (struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ -+{ \ -+ return applesmc_show_fan_manual(dev, buf, offset); \ -+} \ -+static ssize_t store_fan_manual_##offset (struct device *dev, \ -+ struct device_attribute *attr, const char *buf, size_t count) \ -+{ \ -+ return applesmc_store_fan_manual(dev, buf, count, offset); \ -+} \ -+static DEVICE_ATTR(fan##offset##_manual, S_IRUGO | S_IWUSR, \ -+ show_fan_manual_##offset, store_fan_manual_##offset); -+ -+ -+sysfs_fan_speeds_offset(0); -+sysfs_fan_manual_offset(0); -+sysfs_fan_speeds_offset(1); -+sysfs_fan_manual_offset(1); -+ -+#define device_create_file_fan(client, offset) \ -+do { \ -+sysfs_create_file(client, &dev_attr_fan##offset##_actual_speed.attr); \ -+sysfs_create_file(client, &dev_attr_fan##offset##_minimum_speed.attr); \ -+sysfs_create_file(client, &dev_attr_fan##offset##_maximum_speed.attr); \ -+sysfs_create_file(client, &dev_attr_fan##offset##_safe_speed.attr); \ -+sysfs_create_file(client, &dev_attr_fan##offset##_target_speed.attr); \ -+sysfs_create_file(client, &dev_attr_fan##offset##_manual.attr); \ -+} while (0) -+ -+#define sysfs_temperature_offset(offset) \ -+static ssize_t show_temperature_##offset (struct device *dev, \ -+ struct device_attribute *attr, char *buf) \ -+{ \ -+ return applesmc_show_temperature(dev, buf, temperature_sensors_sets[applesmc_temperature_set][offset]); \ -+} \ -+static DEVICE_ATTR(temperature_##offset, S_IRUGO, \ -+ show_temperature_##offset, NULL); -+ -+sysfs_temperature_offset(0); -+sysfs_temperature_offset(1); -+sysfs_temperature_offset(2); -+sysfs_temperature_offset(3); -+sysfs_temperature_offset(4); -+sysfs_temperature_offset(5); -+sysfs_temperature_offset(6); -+ -+#define device_create_files_temperature(client, offset) \ -+{ \ -+ sysfs_create_file(client, &dev_attr_temperature_##offset.attr); \ -+} while (0) -+ -+/* Module stuff */ -+ -+/* -+ * applesmc_dmi_match - found a match. return one, short-circuiting -+ * the hunt. -+ */ -+static int applesmc_dmi_match(struct dmi_system_id *id) -+{ -+ int i = 0; -+ struct dmi_match_data* dmi_data = -+ (struct dmi_match_data*)id->driver_data; -+ printk(KERN_INFO "applesmc: %s detected:\n", id->ident); -+ applesmc_accelerometer = dmi_data->accelerometer; -+ printk(KERN_INFO "applesmc: - Model %s accelerometer\n", -+ applesmc_accelerometer ? "with" : "without"); -+ applesmc_light = dmi_data->light; -+ printk(KERN_INFO "applesmc: - Model %s light sensors and backlight\n", -+ applesmc_light ? "with" : "without"); -+ -+ applesmc_temperature_set = dmi_data->temperature_set; -+ while (temperature_sensors_sets[applesmc_temperature_set][i] != NULL) i++; -+ printk(KERN_INFO "applesmc: - Model with %d temperature sensors\n", i); -+ return 1; -+} -+ -+/* Create accelerometer ressources */ -+static int applesmc_create_accelerometer(void) { -+ int ret; -+ -+ ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_position.attr); -+ if (ret) -+ goto out; -+ -+ ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_calibrate.attr); -+ if (ret) -+ goto out; -+ -+ applesmc_idev = input_allocate_device(); -+ if (!applesmc_idev) { -+ ret = -ENOMEM; -+ goto out; -+ } -+ -+ /* initial calibrate for the input device */ -+ applesmc_calibrate(); -+ -+ /* initialize the input class */ -+ applesmc_idev->name = "applesmc"; -+ applesmc_idev->cdev.dev = &pdev->dev; -+ applesmc_idev->evbit[0] = BIT(EV_ABS); -+ input_set_abs_params(applesmc_idev, ABS_X, -+ -256, 256, APPLESMC_INPUT_FUZZ, APPLESMC_INPUT_FLAT); -+ input_set_abs_params(applesmc_idev, ABS_Y, -+ -256, 256, APPLESMC_INPUT_FUZZ, APPLESMC_INPUT_FLAT); -+ -+ input_register_device(applesmc_idev); -+ -+ /* start up our timer for the input device */ -+ init_timer(&applesmc_timer); -+ applesmc_timer.function = applesmc_mousedev_poll; -+ applesmc_timer.expires = jiffies + APPLESMC_POLL_PERIOD; -+ add_timer(&applesmc_timer); -+ -+ return 0; -+ -+out: -+ printk(KERN_WARNING "applesmc: driver init failed (ret=%d)!\n", ret); -+ return ret; -+} -+ -+/* Release all ressources used by the accelerometer */ -+static void applesmc_release_accelerometer(void) { -+ del_timer_sync(&applesmc_timer); -+ input_unregister_device(applesmc_idev); -+} -+ -+static int __init applesmc_init(void) -+{ -+ int ret; -+ -+ struct dmi_match_data applesmc_dmi_data[] = { -+ { .accelerometer = 1, .light = 1, .temperature_set = 0 }, -+ { .accelerometer = 1, .light = 0, .temperature_set = 0 }, -+ { .accelerometer = 0, .light = 0, .temperature_set = 1 } -+ }; -+ -+ /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". -+ * So we need to put APPLESMC_MACBOOKPRO_DMI_MATCH before -+ * APPLESMC_MACBOOK_DMI_MATCH. */ -+ struct dmi_system_id applesmc_whitelist[] = { -+ { applesmc_dmi_match, "Apple MacBook Pro", { -+ DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), -+ DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro") }, -+ (void*)&applesmc_dmi_data[0]}, -+ { applesmc_dmi_match, "Apple MacBook", { -+ DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), -+ DMI_MATCH(DMI_PRODUCT_NAME,"MacBook") }, -+ (void*)&applesmc_dmi_data[1]}, -+ { applesmc_dmi_match, "Apple Macmini", { -+ DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), -+ DMI_MATCH(DMI_PRODUCT_NAME,"Macmini") }, -+ (void*)&applesmc_dmi_data[2]}, -+ { .ident = NULL } -+ }; -+ -+ if (!dmi_check_system(applesmc_whitelist)) { -+ printk(KERN_WARNING "applesmc: supported laptop not found!\n"); -+ ret = -ENODEV; -+ goto out; -+ } -+ -+ if (!request_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS, -+ "applesmc")) { -+ ret = -ENXIO; -+ goto out; -+ } -+ -+ ret = platform_driver_register(&applesmc_driver); -+ if (ret) -+ goto out_region; -+ -+ pdev = platform_device_register_simple("applesmc", -1, NULL, 0); -+ if (IS_ERR(pdev)) { -+ ret = PTR_ERR(pdev); -+ goto out_driver; -+ } -+ -+ /* create fan files */ -+ ret = applesmc_get_fan_count(); -+ if (ret < 0) { -+ printk(KERN_ERR "applesmc: Cannot get the number of fans.\n"); -+ } -+ else { -+ printk(KERN_INFO "applesmc: %d fans found.\n", ret); -+ -+ switch (ret) { -+ default: -+ printk(KERN_WARNING "applesmc: More than 2 fans found," -+ " but at most 2 fans are supported" -+ " by the driver.\n"); -+ case 2: -+ device_create_file_fan(&pdev->dev.kobj, 1); -+ case 1: -+ device_create_file_fan(&pdev->dev.kobj, 0); -+ case 0: -+ ; -+ } -+ } -+ -+ ret = 0; -+ while (temperature_sensors_sets[applesmc_temperature_set][ret] != NULL) ret++; -+ -+ switch (ret) { -+ default: -+ case 7: -+ device_create_files_temperature(&pdev->dev.kobj, 6); -+ case 6: -+ device_create_files_temperature(&pdev->dev.kobj, 5); -+ case 5: -+ device_create_files_temperature(&pdev->dev.kobj, 4); -+ case 4: -+ device_create_files_temperature(&pdev->dev.kobj, 3); -+ case 3: -+ device_create_files_temperature(&pdev->dev.kobj, 2); -+ case 2: -+ device_create_files_temperature(&pdev->dev.kobj, 1); -+ case 1: -+ device_create_files_temperature(&pdev->dev.kobj, 0); -+ case 0: -+ ; -+ } -+ -+ if (applesmc_accelerometer) { -+ ret = applesmc_create_accelerometer(); -+ if (ret) -+ goto out_device; -+ } -+ -+ if (applesmc_light) { -+ /* Add light sensor file */ -+ ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_light.attr); -+ if (ret) -+ goto out_accelerometer; -+ -+ /* register as a led device */ -+ ret = led_classdev_register(&pdev->dev, &applesmc_backlight); -+ if (ret < 0) -+ goto out_accelerometer; -+ } -+ -+ printk(KERN_INFO "applesmc: driver successfully loaded.\n"); -+ return 0; -+ -+out_accelerometer: -+ if (applesmc_accelerometer) -+ applesmc_release_accelerometer(); -+out_device: -+ platform_device_unregister(pdev); -+out_driver: -+ platform_driver_unregister(&applesmc_driver); -+out_region: -+ release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS); -+out: -+ printk(KERN_WARNING "applesmc: driver init failed (ret=%d)!\n", ret); -+ return ret; -+} -+ -+static void __exit applesmc_exit(void) -+{ -+ if (applesmc_light) -+ led_classdev_unregister(&applesmc_backlight); -+ if (applesmc_accelerometer) -+ applesmc_release_accelerometer(); -+ platform_device_unregister(pdev); -+ platform_driver_unregister(&applesmc_driver); -+ release_region(APPLESMC_DATA_PORT, APPLESMC_NR_PORTS); -+ -+ printk(KERN_INFO "applesmc: driver unloaded.\n"); -+} -+ -+module_init(applesmc_init); -+module_exit(applesmc_exit); -+ -+MODULE_AUTHOR("Nicolas Boichat"); -+MODULE_DESCRIPTION("Apple SMC"); -+MODULE_LICENSE("GPL v2"); ---- linux/drivers/usb/input/appletouch.c.orig 2006-11-08 11:28:43.000000000 -0600 -+++ linux/drivers/usb/input/appletouch.c 2006-11-08 10:10:21.000000000 -0600 -@@ -47,6 +47,10 @@ - #define GEYSER3_ISO_PRODUCT_ID 0x0218 - #define GEYSER3_JIS_PRODUCT_ID 0x0219 - -+#define GEYSER4_ANSI_PRODUCT_ID 0x021A -+#define GEYSER4_ISO_PRODUCT_ID 0x021B -+#define GEYSER4_JIS_PRODUCT_ID 0x021C -+ - #define ATP_DEVICE(prod) \ - .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \ - USB_DEVICE_ID_MATCH_INT_CLASS | \ -@@ -72,6 +76,10 @@ - { ATP_DEVICE(GEYSER3_ISO_PRODUCT_ID) }, - { ATP_DEVICE(GEYSER3_JIS_PRODUCT_ID) }, - -+ { ATP_DEVICE(GEYSER4_ANSI_PRODUCT_ID) }, -+ { ATP_DEVICE(GEYSER4_ISO_PRODUCT_ID) }, -+ { ATP_DEVICE(GEYSER4_JIS_PRODUCT_ID) }, -+ - /* Terminating entry */ - { } - }; -@@ -174,7 +182,10 @@ - - return (productId == GEYSER3_ANSI_PRODUCT_ID) || - (productId == GEYSER3_ISO_PRODUCT_ID) || -- (productId == GEYSER3_JIS_PRODUCT_ID); -+ (productId == GEYSER3_JIS_PRODUCT_ID) || -+ (productId == GEYSER4_ANSI_PRODUCT_ID) || -+ (productId == GEYSER4_ISO_PRODUCT_ID) || -+ (productId == GEYSER4_JIS_PRODUCT_ID); - } - - static int atp_calculate_abs(int *xy_sensors, int nb_sensors, int fact, -Index: linux-2.6.19-rc2/arch/i386/kernel/msr.c -=================================================================== ---- linux-2.6.19-rc2.orig/arch/i386/kernel/msr.c 2006-10-17 23:10:39.470361250 +0200 -+++ linux-2.6.19-rc2/arch/i386/kernel/msr.c 2006-10-17 23:15:54.470047500 +0200 -@@ -90,7 +90,7 @@ - cmd->err = rdmsr_eio(cmd->reg, &cmd->data[0], &cmd->data[1]); - } - --static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx) -+int msr_write(int cpu, u32 reg, u32 eax, u32 edx) - { - struct msr_command cmd; - int ret; -@@ -111,7 +111,7 @@ - return ret; - } - --static inline int do_rdmsr(int cpu, u32 reg, u32 * eax, u32 * edx) -+int msr_read(int cpu, u32 reg, u32 * eax, u32 * edx) - { - struct msr_command cmd; - int ret; -@@ -136,19 +136,22 @@ - - #else /* ! CONFIG_SMP */ - --static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx) -+int msr_write(int cpu, u32 reg, u32 eax, u32 edx) - { - return wrmsr_eio(reg, eax, edx); - } - --static inline int do_rdmsr(int cpu, u32 reg, u32 *eax, u32 *edx) -+int msr_read(int cpu, u32 reg, u32 *eax, u32 *edx) - { - return rdmsr_eio(reg, eax, edx); - } - - #endif /* ! CONFIG_SMP */ - --static loff_t msr_seek(struct file *file, loff_t offset, int orig) -+EXPORT_SYMBOL_GPL(msr_write); -+EXPORT_SYMBOL_GPL(msr_read); -+ -+static loff_t msr_fseek(struct file *file, loff_t offset, int orig) - { - loff_t ret = -EINVAL; - -@@ -166,7 +169,7 @@ - return ret; - } - --static ssize_t msr_read(struct file *file, char __user * buf, -+static ssize_t msr_fread(struct file *file, char __user * buf, - size_t count, loff_t * ppos) - { - u32 __user *tmp = (u32 __user *) buf; -@@ -179,7 +182,7 @@ - return -EINVAL; /* Invalid chunk size */ - - for (; count; count -= 8) { -- err = do_rdmsr(cpu, reg, &data[0], &data[1]); -+ err = msr_read(cpu, reg, &data[0], &data[1]); - if (err) - return err; - if (copy_to_user(tmp, &data, 8)) -@@ -190,7 +193,7 @@ - return ((char __user *)tmp) - buf; - } - --static ssize_t msr_write(struct file *file, const char __user *buf, -+static ssize_t msr_fwrite(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) - { - const u32 __user *tmp = (const u32 __user *)buf; -@@ -206,7 +209,7 @@ - for (rv = 0; count; count -= 8) { - if (copy_from_user(&data, tmp, 8)) - return -EFAULT; -- err = do_wrmsr(cpu, reg, data[0], data[1]); -+ err = msr_write(cpu, reg, data[0], data[1]); - if (err) - return err; - tmp += 2; -@@ -215,7 +218,7 @@ - return ((char __user *)tmp) - buf; - } - --static int msr_open(struct inode *inode, struct file *file) -+static int msr_fopen(struct inode *inode, struct file *file) - { - unsigned int cpu = iminor(file->f_dentry->d_inode); - struct cpuinfo_x86 *c = &(cpu_data)[cpu]; -@@ -233,10 +236,10 @@ - */ - static struct file_operations msr_fops = { - .owner = THIS_MODULE, -- .llseek = msr_seek, -- .read = msr_read, -- .write = msr_write, -- .open = msr_open, -+ .llseek = msr_fseek, -+ .read = msr_fread, -+ .write = msr_fwrite, -+ .open = msr_fopen, - }; - - static int msr_class_device_create(int i) -Index: linux-2.6.19-rc2/include/asm-i386/msr.h -=================================================================== ---- linux-2.6.19-rc2.orig/include/asm-i386/msr.h 2006-10-17 23:10:39.446359750 +0200 -+++ linux-2.6.19-rc2/include/asm-i386/msr.h 2006-10-17 23:10:52.211157500 +0200 -@@ -78,6 +78,9 @@ - : "=a" (low), "=d" (high) \ - : "c" (counter)) - -+int msr_write(int cpu, u32 reg, u32 eax, u32 edx); -+int msr_read(int cpu, u32 reg, u32 *eax, u32 *edx); -+ - /* symbolic names for some interesting MSRs */ - /* Intel defined MSRs. */ - #define MSR_IA32_P5_MC_ADDR 0 -Index: linux-2.6.19-rc2/include/asm-x86_64/msr.h -=================================================================== ---- linux-2.6.19-rc2.orig/include/asm-x86_64/msr.h 2006-10-17 23:10:39.382355750 +0200 -+++ linux-2.6.19-rc2/include/asm-x86_64/msr.h 2006-10-17 23:18:29.347726750 +0200 -@@ -160,7 +160,8 @@ - #define MSR_IA32_UCODE_WRITE 0x79 - #define MSR_IA32_UCODE_REV 0x8b - -- -+int msr_write(int cpu, u32 reg, u32 eax, u32 edx); -+int msr_read(int cpu, u32 reg, u32 *eax, u32 *edx); - #endif - - /* AMD/K8 specific MSRs */ -Index: linux-2.6.19-rc2/drivers/hwmon/coretemp.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.19-rc2/drivers/hwmon/coretemp.c 2006-10-17 23:12:39.589868250 +0200 -@@ -0,0 +1,400 @@ -+/* -+ * coretemp.c - Linux kernel module for hardware monitoring -+ * -+ * Copyright (C) 2006 Rudolf Marek -+ * -+ * Inspired from many hwmon drivers -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -+ * 02110-1301 USA. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define DRVNAME "coretemp" -+ -+typedef enum { SHOW_TEMP, SHOW_TJMAX, SHOW_LABEL, SHOW_NAME } SHOW; -+ -+/* -+ * Functions declaration -+ */ -+ -+static struct coretemp_data *coretemp_update_device(struct device *dev); -+ -+struct coretemp_data { -+ struct class_device *class_dev; -+ struct mutex update_lock; -+ const char *name; -+ u32 id; -+ char valid; /* zero until following fields are valid */ -+ unsigned long last_updated; /* in jiffies */ -+ int temp; -+ int tjmax; -+ /* registers values */ -+ u32 therm_status; -+}; -+ -+static struct coretemp_data *coretemp_update_device(struct device *dev); -+ -+/* -+ * Sysfs stuff -+ */ -+ -+ -+static ssize_t show_name(struct device *dev, struct device_attribute -+ *devattr, char *buf) -+{ -+ int ret; -+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -+ struct coretemp_data *data = dev_get_drvdata(dev); -+ -+ if (attr->index == SHOW_NAME) -+ ret = sprintf(buf, "%s\n", data->name); -+ else /* show label */ -+ ret = sprintf(buf, "Core %d\n", data->id); -+ return ret; -+} -+ -+static ssize_t show_alarm(struct device *dev, struct device_attribute -+ *devattr, char *buf) -+{ -+ struct coretemp_data *data = coretemp_update_device(dev); -+ /* read the Out-of-spec log, never clear */ -+ return sprintf(buf, "%d\n", (data->therm_status >> 5) & 1); -+} -+ -+static ssize_t show_temp(struct device *dev, -+ struct device_attribute *devattr, char *buf) -+{ -+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -+ struct coretemp_data *data = coretemp_update_device(dev); -+ return sprintf(buf, "%d\n", -+ attr->index == -+ SHOW_TEMP ? data->temp : data->tjmax); -+} -+ -+static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, -+ SHOW_TEMP); -+static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, show_temp, NULL, -+ SHOW_TJMAX); -+static DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL); -+static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, show_name, NULL, SHOW_LABEL); -+static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, SHOW_NAME); -+ -+static struct attribute *coretemp_attributes[] = { -+ &sensor_dev_attr_name.dev_attr.attr, -+ &sensor_dev_attr_temp1_label.dev_attr.attr, -+ &dev_attr_temp1_crit_alarm.attr, -+ &sensor_dev_attr_temp1_input.dev_attr.attr, -+ &sensor_dev_attr_temp1_crit.dev_attr.attr, -+ NULL -+}; -+ -+static const struct attribute_group coretemp_group = { -+ .attrs = coretemp_attributes, -+}; -+ -+static struct coretemp_data *coretemp_update_device(struct device *dev) -+{ -+ struct coretemp_data *data = dev_get_drvdata(dev); -+ -+ mutex_lock(&data->update_lock); -+ -+ if (!data->valid || time_after(jiffies, data->last_updated + HZ)) { -+ u32 eax, edx; -+ -+ data->valid = 0; -+ msr_read(data->id, MSR_IA32_THERM_STATUS, &eax, &edx); -+ data->therm_status = eax; -+ -+ /* update only if data has been valid */ -+ if (eax & 0x80000000) { -+ data->temp = data->tjmax - (((data->therm_status >> 16) -+ & 0x7f) * 1000); -+ data->valid = 1; -+ } -+ data->last_updated = jiffies; -+ } -+ -+ mutex_unlock(&data->update_lock); -+ return data; -+} -+ -+static int __devinit coretemp_probe(struct platform_device *pdev) -+{ -+ struct coretemp_data *data; -+ struct cpuinfo_x86 *c = &(cpu_data)[pdev->id]; -+ int err; -+ u32 eax, edx; -+ -+ if (!(data = kzalloc(sizeof(struct coretemp_data), GFP_KERNEL))) { -+ err = -ENOMEM; -+ dev_err(&pdev->dev, "Out of memory\n"); -+ goto exit; -+ } -+ -+ data->id = pdev->id; -+ data->name = "coretemp"; -+ mutex_init(&data->update_lock); -+ /* Tjmax default is 100C */ -+ data->tjmax = 100000; -+ -+ /* Some processors have Tjmax 85 following magic should detect it */ -+ /* family is always 0x6 */ -+ -+ if (((c->x86_model == 0xf) && (c->x86_mask > 3 )) || -+ (c->x86_model == 0xe)) { -+ -+ err = msr_read(data->id, 0xee, &eax, &edx); -+ if (err) { -+ dev_warn(&pdev->dev, -+ "Unable to access MSR 0xEE, Tjmax left at %d\n", -+ data->tjmax); -+ } else if (eax & 0x40000000) { -+ data->tjmax = 85000; -+ } -+ } -+ -+ /* test if we can access the THERM_STATUS MSR */ -+ err = msr_read(data->id, MSR_IA32_THERM_STATUS, &eax, &edx); -+ -+ if (err) { -+ dev_err(&pdev->dev, -+ "Unable to access THERM_STATUS MSR, giving up\n"); -+ goto exit_free; -+ } -+ platform_set_drvdata(pdev, data); -+ -+ if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group))) -+ goto exit_free; -+ -+ data->class_dev = hwmon_device_register(&pdev->dev); -+ if (IS_ERR(data->class_dev)) { -+ err = PTR_ERR(data->class_dev); -+ dev_err(&pdev->dev, "Class registration failed (%d)\n", -+ err); -+ goto exit_class; -+ } -+ -+ return 0; -+ -+exit_class: -+ sysfs_remove_group(&pdev->dev.kobj, &coretemp_group); -+exit_free: -+ kfree(data); -+exit: -+ return err; -+} -+ -+static int __devexit coretemp_remove(struct platform_device *pdev) -+{ -+ struct coretemp_data *data = platform_get_drvdata(pdev); -+ -+ hwmon_device_unregister(data->class_dev); -+ sysfs_remove_group(&pdev->dev.kobj, &coretemp_group); -+ platform_set_drvdata(pdev, NULL); -+ kfree(data); -+ return 0; -+} -+ -+static struct platform_driver coretemp_driver = { -+ .driver = { -+ .owner = THIS_MODULE, -+ .name = DRVNAME, -+ }, -+ .probe = coretemp_probe, -+ .remove = __devexit_p(coretemp_remove), -+}; -+ -+struct pdev_entry { -+ struct list_head list; -+ struct platform_device *pdev; -+ unsigned int cpu; -+}; -+ -+static LIST_HEAD(pdev_list); -+static DEFINE_MUTEX(pdev_list_mutex); -+ -+static int __cpuinit coretemp_devices_add(unsigned int cpu) -+{ -+ int err; -+ struct platform_device *pdev; -+ struct pdev_entry *pdev_entry; -+ -+ pdev = platform_device_alloc(DRVNAME, cpu); -+ if (!pdev) { -+ err = -ENOMEM; -+ printk(KERN_ERR DRVNAME ": Device allocation failed\n"); -+ goto exit; -+ -+ } -+ -+ pdev_entry = kzalloc(sizeof(struct pdev_entry), GFP_KERNEL); -+ -+ if (!pdev_entry) { -+ err = -ENOMEM; -+ goto exit_device_put; -+ } -+ -+ err = platform_device_add(pdev); -+ -+ if (err) { -+ printk(KERN_ERR DRVNAME ": Device addition failed (%d)\n", -+ err); -+ goto exit_device_free; -+ } -+ -+ pdev_entry->pdev = pdev; -+ pdev_entry->cpu = cpu; -+ mutex_lock(&pdev_list_mutex); -+ list_add_tail(&pdev_entry->list, &pdev_list); -+ mutex_unlock(&pdev_list_mutex); -+ -+ return 0; -+ -+exit_device_free: -+ kfree(pdev_entry); -+exit_device_put: -+ platform_device_put(pdev); -+exit: -+ return err; -+} -+ -+#ifdef CONFIG_HOTPLUG_CPU -+void coretemp_devices_remove(unsigned int cpu) -+{ -+ struct pdev_entry *p, *n; -+ mutex_lock(&pdev_list_mutex); -+ list_for_each_entry_safe(p, n, &pdev_list, list) { -+ if (p->cpu == cpu) { -+ platform_device_unregister(p->pdev); -+ list_del(&p->list); -+ kfree(p); -+ } -+ } -+ mutex_unlock(&pdev_list_mutex); -+} -+ -+static int coretemp_cpu_callback(struct notifier_block *nfb, -+ unsigned long action, void *hcpu) -+{ -+ unsigned int cpu = (unsigned long) hcpu; -+ -+ switch (action) { -+ case CPU_ONLINE: -+ coretemp_devices_add(cpu); -+ break; -+ case CPU_DEAD: -+ coretemp_devices_remove(cpu); -+ break; -+ } -+ return NOTIFY_OK; -+} -+ -+static struct notifier_block __cpuinitdata coretemp_cpu_notifier = { -+ .notifier_call = coretemp_cpu_callback, -+}; -+#endif /* !CONFIG_HOTPLUG_CPU */ -+ -+static int __init coretemp_init(void) -+{ -+ int i, err = -ENODEV; -+ struct pdev_entry *p, *n; -+ -+ if (current_cpu_data.x86_vendor != X86_VENDOR_INTEL) -+ goto exit; -+ -+ err = platform_driver_register(&coretemp_driver); -+ if (err) -+ goto exit; -+ -+ for_each_online_cpu(i) { -+ struct cpuinfo_x86 *c = &(cpu_data)[i]; -+ -+ /* check if family 6, models e, f */ -+ if ((c->cpuid_level < 0) || (c->x86 != 0x6) || -+ !((c->x86_model == 0xe) || (c->x86_model == 0xf))) { -+ -+ /* supported CPU not found, but report the unknown -+ family 6 CPU */ -+ if ((c->x86 == 0x6) && (c->x86_model > 0xf)) -+ printk(KERN_WARNING DRVNAME ": Unknown CPU, please" -+ " report to the lm-sensors@lm-sensors.org\n"); -+ continue; -+ } -+ -+ err = coretemp_devices_add(i); -+ if (err) -+ goto exit_driver; -+ } -+ if (list_empty(&pdev_list)) { -+ err = -ENODEV; -+ goto exit_driver_unreg; -+ } -+ -+#ifdef CONFIG_HOTPLUG_CPU -+ register_hotcpu_notifier(&coretemp_cpu_notifier); -+#endif -+ return 0; -+ -+exit_driver: -+ mutex_lock(&pdev_list_mutex); -+ list_for_each_entry_safe(p, n, &pdev_list, list) { -+ platform_device_unregister(p->pdev); -+ list_del(&p->list); -+ kfree(p); -+ } -+ mutex_unlock(&pdev_list_mutex); -+exit_driver_unreg: -+ platform_driver_unregister(&coretemp_driver); -+exit: -+ return err; -+} -+ -+static void __exit coretemp_exit(void) -+{ -+ struct pdev_entry *p, *n; -+#ifdef CONFIG_HOTPLUG_CPU -+ unregister_hotcpu_notifier(&coretemp_cpu_notifier); -+#endif -+ mutex_lock(&pdev_list_mutex); -+ list_for_each_entry_safe(p, n, &pdev_list, list) { -+ platform_device_unregister(p->pdev); -+ list_del(&p->list); -+ kfree(p); -+ } -+ mutex_unlock(&pdev_list_mutex); -+ platform_driver_unregister(&coretemp_driver); -+} -+ -+MODULE_AUTHOR("Rudolf Marek "); -+MODULE_DESCRIPTION("Intel Core temperature monitor"); -+MODULE_LICENSE("GPL"); -+ -+module_init(coretemp_init) -+module_exit(coretemp_exit) -Index: linux-2.6.19-rc2/drivers/hwmon/Kconfig -=================================================================== ---- linux-2.6.19-rc2.orig/drivers/hwmon/Kconfig 2006-10-17 23:05:20.178406750 +0200 -+++ linux-2.6.19-rc2/drivers/hwmon/Kconfig 2006-10-17 23:11:36.021895500 +0200 -@@ -131,6 +131,15 @@ - This driver can also be built as a module. If so, the module - will be called atxp1. - -+config SENSORS_CORETEMP -+ tristate "Intel Core (2) Duo/Solo temperature sensor" -+ depends on HWMON && X86 && EXPERIMENTAL -+ select X86_MSR -+ help -+ If you say yes here you get support for the temperature -+ sensor inside your CPU. Supported all are all known variants -+ of Intel Core family. -+ - config SENSORS_DS1621 - tristate "Dallas Semiconductor DS1621 and DS1625" - depends on HWMON && I2C -Index: linux-2.6.19-rc2/drivers/hwmon/Makefile -=================================================================== ---- linux-2.6.19-rc2.orig/drivers/hwmon/Makefile 2006-10-17 23:05:20.138404250 +0200 -+++ linux-2.6.19-rc2/drivers/hwmon/Makefile 2006-10-17 23:11:36.025895750 +0200 -@@ -20,6 +19,7 @@ - obj-$(CONFIG_SENSORS_ADM1031) += adm1031.o - obj-$(CONFIG_SENSORS_ADM9240) += adm9240.o - obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o -+obj-$(CONFIG_SENSORS_CORETEMP) += coretemp.o - obj-$(CONFIG_SENSORS_DS1621) += ds1621.o - obj-$(CONFIG_SENSORS_F71805F) += f71805f.o - obj-$(CONFIG_SENSORS_FSCHER) += fscher.o ---- a/arch/i386/kernel/setup.c 2006-06-19 09:12:09.000000000 +0200 -+++ b/arch/i386/kernel/setup.c 2006-06-19 09:12:24.000000000 +0200 -@@ -862,24 +862,28 @@ - u64 start = s; - u64 end = e; - int i; -- for (i = 0; i < e820.nr_map; i++) { -- struct e820entry *ei = &e820.map[i]; -- if (type && ei->type != type) -- continue; -- /* is the region (part) in overlap with the current region ?*/ -- if (ei->addr >= end || ei->addr + ei->size <= start) -- continue; -- /* if the region is at the beginning of we move -- * start to the end of the region since it's ok until there -- */ -- if (ei->addr <= start) -- start = ei->addr + ei->size; -- /* if start is now at or beyond end, we're done, full -- * coverage */ -- if (start >= end) -- return 1; /* we're done */ -+ if(!efi_enabled) { -+ for (i = 0; i < e820.nr_map; i++) { -+ struct e820entry *ei = &e820.map[i]; -+ if (type && ei->type != type) -+ continue; -+ /* is the region (part) in overlap with the current region ?*/ -+ if (ei->addr >= end || ei->addr + ei->size <= start) -+ continue; -+ /* if the region is at the beginning of we move -+ * start to the end of the region since it's ok until there -+ */ -+ if (ei->addr <= start) -+ start = ei->addr + ei->size; -+ /* if start is now at or beyond end, we're done, full -+ * coverage */ -+ if (start >= end) -+ return 1; /* we're done */ -+ } -+ return 0; -+ } else { -+ return 1; - } -- return 0; - } - - /* ---- linux-2.6.16.1/drivers/usb/input/Makefile 2006-03-28 07:49:02.000000000 +0100 -+++ linux-2.6.16.1-imac-sky2-rtc/drivers/usb/input/Makefile 2006-05-22 13:14:40.000000000 +0100 -@@ -36,6 +36,7 @@ - obj-$(CONFIG_USB_HID) += usbhid.o - obj-$(CONFIG_USB_KBD) += usbkbd.o - obj-$(CONFIG_USB_KBTAB) += kbtab.o -+obj-$(CONFIG_USB_APPLEIR) += appleir.o - obj-$(CONFIG_USB_KEYSPAN_REMOTE) += keyspan_remote.o - obj-$(CONFIG_USB_MOUSE) += usbmouse.o - obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o ---- linux-2.6.16.1/drivers/usb/input/Kconfig 2006-03-28 07:49:02.000000000 +0100 -+++ linux-2.6.16.1-imac-sky2-rtc/drivers/usb/input/Kconfig 2006-05-22 13:15:16.000000000 +0100 -@@ -183,6 +183,10 @@ - To compile this driver as a module, choose M here: the - module will be called acecad. - -+config USB_APPLEIR -+ tristate "Apple Mac Mini USB IR receiver (built in)" -+ depends on USB && INPUT -+ - config USB_KBTAB - tristate "KB Gear JamStudio tablet support" - depends on USB && INPUT ---- linux-2.6.16.1/drivers/usb/input/appleir.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16.1-imac-sky2-rtc/drivers/usb/input/appleir.c 2006-05-29 09:47:40.000000000 +0100 -@@ -0,0 +1,390 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* -+ * Version Information -+ * -+ */ -+ -+#if 0 -+#define DUMP_PACKETS -+#else -+#undef DUMP_PACKETS -+#endif -+ -+#define DRIVER_VERSION "v1.1" -+#define DRIVER_AUTHOR "James McKenzie" -+#define DRIVER_DESC "USB Apple MacMini IR Receiver driver" -+#define DRIVER_LICENSE "GPL" -+ -+MODULE_AUTHOR (DRIVER_AUTHOR); -+MODULE_DESCRIPTION (DRIVER_DESC); -+MODULE_LICENSE (DRIVER_LICENSE); -+ -+#ifndef USB_VENDOR_ID_APPLE -+#define USB_VENDOR_ID_APPLE 0x05ac -+#endif -+#ifndef USB_DEVICE_ID_APPLE_IR -+#define USB_DEVICE_ID_APPLE_IR 0x8240 -+#endif -+ -+#define URB_SIZE 32 -+ -+#define MAX_KEYS 8 -+#define MAX_KEYS_MASK (MAX_KEYS - 1 ) -+ -+struct appleir -+{ -+ struct input_dev *dev; -+ uint8_t *data; -+ dma_addr_t dma_buf; -+ struct usb_device *usbdev; -+ struct urb *urb; -+ int timer_initted; -+ struct timer_list key_up_timer; -+ int current_key; -+ char phys[32]; -+}; -+ -+ -+static struct usb_device_id appleir_ids[] = { -+ {USB_DEVICE (USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IR),.driver_info = 0}, -+ {} -+}; -+ -+MODULE_DEVICE_TABLE (usb, appleir_ids); -+ -+ -+/* I have two devices both of which report the following */ -+/* 25 87 ee 83 0a + */ -+/* 25 87 ee 83 0c - */ -+/* 25 87 ee 83 09 << */ -+/* 25 87 ee 83 06 >> */ -+/* 25 87 ee 83 05 >" */ -+/* 25 87 ee 83 03 menu */ -+/* 26 00 00 00 00 for key repeat*/ -+ -+/* Thomas Glanzmann reports the following responses */ -+/* 25 87 ee ca 0b + */ -+/* 25 87 ee ca 0d - */ -+/* 25 87 ee ca 08 << */ -+/* 25 87 ee ca 07 >> */ -+/* 25 87 ee ca 04 >" */ -+/* 25 87 ee ca 02 menu */ -+/* 26 00 00 00 00 for key repeat*/ -+/* He also observes the following event sometimes */ -+/* sent after a key is release, which I interpret */ -+/* as a flat battery message */ -+/* 25 87 e0 ca 06 flat battery */ -+ -+ -+static int keymap[MAX_KEYS] = { -+ KEY_RESERVED, KEY_MENU, -+ KEY_PLAYPAUSE, KEY_NEXTSONG, -+ KEY_PREVIOUSSONG, KEY_VOLUMEUP, -+ KEY_VOLUMEDOWN, KEY_RESERVED -+}; -+ -+static void -+dump_packet (struct appleir *appleir, char *msg, uint8_t * data, int len) -+{ -+ int i; -+ -+ printk (KERN_ERR "appleir: %s (%d bytes)", msg, len); -+ -+ for (i = 0; i < len; ++i) -+ { -+ printk (" %02x", data[i]); -+ } -+ -+ printk ("\n"); -+} -+ -+ -+static void -+key_up (struct appleir *appleir, int key) -+{ -+ //printk (KERN_ERR "key %d up\n", key); -+ input_report_key (appleir->dev, key, 0); -+ input_sync (appleir->dev); -+} -+ -+static void -+key_down (struct appleir *appleir, int key) -+{ -+ //printk (KERN_ERR "key %d down\n", key); -+ input_report_key (appleir->dev, key, 1); -+ input_sync (appleir->dev); -+} -+ -+static void -+battery_flat (struct appleir *appleir) -+{ -+ printk (KERN_ERR "appleir: possible flat battery?\n"); -+} -+ -+static void -+key_up_tick (unsigned long data) -+{ -+ struct appleir *appleir = (struct appleir *) data; -+ -+ if (appleir->current_key) -+ { -+ key_up (appleir, appleir->current_key); -+ appleir->current_key = 0; -+ } -+} -+ -+static void -+new_data (struct appleir *appleir, uint8_t * data, int len) -+{ -+ static const uint8_t keydown[] = { 0x25, 0x87, 0xee }; -+ static const uint8_t keyrepeat[] = { 0x26, 0x00, 0x00, 0x00, 0x00 }; -+ static const uint8_t flatbattery[] = { 0x25, 0x87, 0xe0 }; -+ -+#ifdef DUMP_PACKETS -+ dump_packet (appleir, "received", data, len); -+#endif -+ -+ if (len != 5) -+ return; -+ -+ if (!memcmp (data, keydown, sizeof (keydown))) -+ { -+ /*If we already have a key down, take it up before marking */ -+ /*this one down */ -+ if (appleir->current_key) -+ key_up (appleir, appleir->current_key); -+ appleir->current_key = keymap[(data[4] >> 1) & MAX_KEYS_MASK]; -+ -+ key_down (appleir, appleir->current_key); -+ /*remote doesn't do key up, either pull them up, in the test */ -+ /*above, or here set a timer which pulls them up after 1/8 s */ -+ mod_timer (&appleir->key_up_timer, jiffies + HZ / 8); -+ -+ return; -+ } -+ -+ if (!memcmp (data, keyrepeat, sizeof (keyrepeat))) -+ { -+ key_down (appleir, appleir->current_key); -+ /*remote doesn't do key up, either pull them up, in the test */ -+ /*above, or here set a timer which pulls them up after 1/8 s */ -+ mod_timer (&appleir->key_up_timer, jiffies + HZ / 8); -+ return; -+ } -+ -+ if (!memcmp (data, flatbattery, sizeof (flatbattery))) -+ { -+ battery_flat (appleir); -+ /*Fall through */ -+ } -+ -+ dump_packet (appleir, "unknown packet", data, len); -+} -+ -+static void -+appleir_urb (struct urb *urb, struct pt_regs *regs) -+{ -+ struct appleir *appleir = urb->context; -+ int retval; -+ -+ switch (urb->status) -+ { -+ case 0: -+ new_data (appleir, urb->transfer_buffer, urb->actual_length); -+ break; -+ case -ECONNRESET: -+ case -ENOENT: -+ case -ESHUTDOWN: -+ /* this urb is terminated, clean up */ -+ dbg ("%s - urb shutting down with status: %d", __FUNCTION__, -+ urb->status); -+ return; -+ default: -+ dbg ("%s - nonzero urb status received: %d", __FUNCTION__, urb->status); -+ } -+ -+ retval = usb_submit_urb (urb, GFP_ATOMIC); -+ if (retval) -+ err ("%s - usb_submit_urb failed with result %d", __FUNCTION__, retval); -+} -+ -+ -+static int -+appleir_open (struct input_dev *dev) -+{ -+ struct appleir *appleir = dev->private; -+ -+ //appleir->urb->dev = appleir->usbdev; -+ -+ if (usb_submit_urb (appleir->urb, GFP_KERNEL)) -+ return -EIO; -+ -+ return 0; -+} -+ -+static void -+appleir_close (struct input_dev *dev) -+{ -+ struct appleir *appleir = dev->private; -+ usb_kill_urb (appleir->urb); -+ del_timer_sync (&appleir->key_up_timer); -+} -+ -+ -+ -+ -+static int -+appleir_probe (struct usb_interface *intf, const struct usb_device_id *id) -+{ -+ struct usb_device *dev = interface_to_usbdev (intf); -+ struct usb_endpoint_descriptor *endpoint; -+ struct appleir *appleir = NULL; -+ struct input_dev *input_dev; -+ int i; -+ -+ appleir = kzalloc (sizeof (struct appleir), GFP_KERNEL); -+ if (!appleir) -+ goto fail; -+ -+ memset (appleir, 0, sizeof (struct appleir)); -+ -+ -+ appleir->data = -+ usb_buffer_alloc (dev, URB_SIZE, GFP_KERNEL, &appleir->dma_buf); -+ if (!appleir->data) -+ goto fail; -+ -+ appleir->urb = usb_alloc_urb (0, GFP_KERNEL); -+ if (!appleir->urb) -+ goto fail; -+ -+ appleir->usbdev = dev; -+ -+ input_dev = input_allocate_device (); -+ if (!input_dev) -+ goto fail; -+ -+ appleir->dev = input_dev; -+ -+ -+ usb_make_path (dev, appleir->phys, sizeof (appleir->phys)); -+ strlcpy (appleir->phys, "/input0", sizeof (appleir->phys)); -+ -+ input_dev->name = "Apple Mac mini infrared remote control driver"; -+ input_dev->phys = appleir->phys; -+ usb_to_input_id (dev, &input_dev->id); -+ input_dev->cdev.dev = &intf->dev; -+ input_dev->private = appleir; -+ -+ input_dev->evbit[0] = BIT (EV_KEY) | BIT (EV_REP); -+ input_dev->ledbit[0] = 0; -+ -+ for (i = 0; i < MAX_KEYS; i++) -+ { -+ set_bit (keymap[i], input_dev->keybit); -+ } -+ -+ clear_bit (0, input_dev->keybit); -+ -+ input_dev->open = appleir_open; -+ input_dev->close = appleir_close; -+ -+ endpoint = &intf->cur_altsetting->endpoint[0].desc; -+ -+ usb_fill_int_urb (appleir->urb, dev, -+ usb_rcvintpipe (dev, endpoint->bEndpointAddress), -+ appleir->data, 8, -+ appleir_urb, appleir, endpoint->bInterval); -+ -+ appleir->urb->transfer_dma = appleir->dma_buf; -+ appleir->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; -+ -+ usb_set_intfdata (intf, appleir); -+ -+ init_timer (&appleir->key_up_timer); -+ -+ appleir->key_up_timer.function = key_up_tick; -+ appleir->key_up_timer.data = (unsigned long) appleir; -+ -+ appleir->timer_initted++; -+ -+ input_register_device (appleir->dev); -+ -+ return 0; -+ -+fail: -+ -+ if (appleir) -+ { -+ -+ -+ if (appleir->data) -+ usb_buffer_free (dev, URB_SIZE, appleir->data, appleir->dma_buf); -+ -+ if (appleir->timer_initted) -+ del_timer_sync (&appleir->key_up_timer); -+ -+ if (appleir->dev) -+ input_free_device (appleir->dev); -+ -+ kfree (appleir); -+ } -+ -+ return -ENOMEM; -+} -+ -+static void -+appleir_disconnect (struct usb_interface *intf) -+{ -+ struct appleir *appleir = usb_get_intfdata (intf); -+ -+ usb_set_intfdata (intf, NULL); -+ if (appleir) -+ { -+ input_unregister_device (appleir->dev); -+ if (appleir->timer_initted) -+ del_timer_sync (&appleir->key_up_timer); -+ usb_kill_urb (appleir->urb); -+ usb_free_urb (appleir->urb); -+ usb_buffer_free (interface_to_usbdev (intf), URB_SIZE, appleir->data, -+ appleir->dma_buf); -+ kfree (appleir); -+ } -+} -+ -+static struct usb_driver appleir_driver = { -+ .name = "appleir", -+ .probe = appleir_probe, -+ .disconnect = appleir_disconnect, -+ .id_table = appleir_ids, -+}; -+ -+static int __init -+appleir_init (void) -+{ -+ int retval; -+ retval = usb_register (&appleir_driver); -+ if (retval) -+ goto out; -+ info (DRIVER_VERSION ":" DRIVER_DESC); -+out: -+ return retval; -+} -+ -+static void __exit -+appleir_exit (void) -+{ -+ usb_deregister (&appleir_driver); -+} -+ -+module_init (appleir_init); -+module_exit (appleir_exit); -diff -uNr linux-2.6.16.1/drivers/Makefile linux-2.6.16.1-imac/drivers/Makefile ---- linux-2.6.16.1/drivers/Makefile 2006-03-20 05:53:29.000000000 +0000 -+++ linux-2.6.16.1-imac/drivers/Makefile 2006-04-01 23:51:38.000000000 +0000 -@@ -30,7 +30,7 @@ - obj-y += base/ block/ misc/ mfd/ net/ media/ - obj-$(CONFIG_NUBUS) += nubus/ - obj-$(CONFIG_ATM) += atm/ --obj-$(CONFIG_PPC_PMAC) += macintosh/ -+obj-y += macintosh/ - obj-$(CONFIG_IDE) += ide/ - obj-$(CONFIG_FC4) += fc4/ - obj-$(CONFIG_SCSI) += scsi/ -diff -uNr linux-2.6.16.1/drivers/macintosh/Kconfig linux-2.6.16.1-imac/drivers/macintosh/Kconfig ---- linux-2.6.16.1/drivers/macintosh/Kconfig 2006-03-20 05:53:29.000000000 +0000 -+++ linux-2.6.16.1-imac/drivers/macintosh/Kconfig 2006-04-01 23:51:38.000000000 +0000 -@@ -1,6 +1,6 @@ - - menu "Macintosh device drivers" -- depends on PPC || MAC -+ depends on PPC || MAC || X86 - - config ADB - bool "Apple Desktop Bus (ADB) support" -@@ -162,7 +162,7 @@ - - config MAC_EMUMOUSEBTN - bool "Support for mouse button 2+3 emulation" -- depends on INPUT_ADBHID -+# depends on INPUT_ADBHID - help - This provides generic support for emulating the 2nd and 3rd mouse - button with keypresses. If you say Y here, the emulation is still ---- linux-2.6.16.1/drivers/ide/ide-io.c 2006-03-28 07:49:02.000000000 +0100 -+++ linux-2.6.16.1-imac-sky2-rtc/drivers/ide/ide-io.c 2006-05-15 03:24:57.000000000 +0100 -@@ -1610,6 +1610,8 @@ - * Whack the status register, just in case - * we have a leftover pending IRQ. - */ -+ /* Ack the interrupt for ich7 - XXX possible race */ -+ hwif->OUTB( (hwif->INB(hwif->dma_status) |4) & ~2, hwif->dma_status); - (void) hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); - #endif /* CONFIG_BLK_DEV_IDEPCI */ - } -@@ -1652,6 +1654,9 @@ - startstop = handler(drive); - spin_lock_irq(&ide_lock); - -+ /* Ack the interrupt for ich7 - XXX possible race */ -+ hwif->OUTB( (hwif->INB(hwif->dma_status) |4) & ~2, hwif->dma_status); -+ - /* - * Note that handler() may have set things up for another - * interrupt to occur soon, but it cannot happen until ---- a/drivers/acpi/sleep/poweroff.c 2006-06-11 05:22:53.000000000 -0700 -+++ b/drivers/acpi/sleep/poweroff.c 2006-06-11 05:06:36.000000000 -0700 -@@ -63,8 +63,15 @@ static int acpi_shutdown(struct sys_devi - } - } - -+static int acpi_resume(struct sys_device *x) -+{ -+ acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK); -+ return 0; -+} -+ - static struct sysdev_class acpi_sysclass = { - set_kset_name("acpi"), -+ .resume = acpi_resume, - .shutdown = acpi_shutdown - }; - - - -From: Ryan Lortie -Date: Sat, 10 Jun 2006 20:22:56 +0000 (-0400) -Subject: [UBUNTU:ich7-sci-en-quirk] poke the SCI_EN bit on Macbook resume -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=d1d9b907570c5c9178e3d66ff208bd483d1dfd61 - -[UBUNTU:ich7-sci-en-quirk] poke the SCI_EN bit on Macbook resume - -The following patch deals with the problem that the SCI_EN bit is -disabled when the Macbook comes back from sleeping. - -It does this by registering a quirk in the exact way that another one is -registered in the same file (for a Toshiba laptop with a similar -problem). - -The quirk matches based on DMI product name of "MacBook1,1" so it should -really only affect the Macbook. - -The actual bit-poking is done immediately on return from -do_suspend_lowlevel(). If I do it in the 'finish' function it is too -late (as at this point IRQs have been enabled again for some time). - -Cheers. - -Signed-off-by: Ben Collins ---- - ---- a/drivers/acpi/sleep/main.c -+++ b/drivers/acpi/sleep/main.c -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - #include "sleep.h" - - u8 sleep_states[ACPI_S_STATE_COUNT]; -@@ -34,6 +35,7 @@ static u32 acpi_suspend_states[] = { - }; - - static int init_8259A_after_S1; -+static int ich7_sci_en_quirk_enabled; - - /** - * acpi_pm_prepare - Do preliminary suspend work. -@@ -92,6 +94,14 @@ static int acpi_pm_enter(suspend_state_t - - case PM_SUSPEND_MEM: - do_suspend_lowlevel(); -+ -+ if (ich7_sci_en_quirk_enabled) -+ { -+ int pm1c = inw(0x404); -+ pm1c |= 0x01; /* SCI_EN */ -+ outw (pm1c, 0x404); -+ } -+ - break; - - case PM_SUSPEND_DISK: -@@ -191,12 +201,36 @@ static int __init init_ints_after_s1(str - return 0; - } - -+/* -+ * Apple Macbook comes back from sleep with the SCI_EN bit disabled -+ * causing a flood of unacknowledged IRQ9s. We need to set SCI_EN -+ * as soon as we come back -+ */ -+static int __init init_ich7_sci_en_quirk(struct dmi_system_id *d) -+{ -+ printk(KERN_WARNING "%s detected (ICH7 SCI_EN quirk enabled)\n", -+ d->ident); -+ ich7_sci_en_quirk_enabled = 1; -+ return 0; -+} -+ -+ - static struct dmi_system_id __initdata acpisleep_dmi_table[] = { - { - .callback = init_ints_after_s1, - .ident = "Toshiba Satellite 4030cdt", - .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),}, - }, -+ { -+ .callback = init_ich7_sci_en_quirk, -+ .ident = "Apple MacBook", -+ .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),}, -+ }, -+ { -+ .callback = init_ich7_sci_en_quirk, -+ .ident = "Apple MacBook", -+ .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"),}, -+ }, - {}, - }; - -diff -pruN linux/sound/pci/hda.vanilla/patch_sigmatel.c linux/sound/pci/hda/patch_sigmatel.c ---- linux/sound/pci/hda.vanilla/patch_sigmatel.c 2006-11-26 11:20:30.000000000 +0800 -+++ linux/sound/pci/hda/patch_sigmatel.c 2006-11-26 12:13:42.000000000 +0800 -@@ -364,11 +364,39 @@ static unsigned int d945gtp5_pin_configs - 0x02a19320, 0x40000100, - }; - -+/* Microphone working, but no front (old Bootcamp, proto2.ini) */ -+/*static unsigned int macmini_pin_configs[10] = { -+ 0x0121E230, 0x90A70120, 0x9017E110, 0x400000FE, -+ 0x400000FD, 0x0181E021, 0x1145E040, 0x400000FA, -+ 0x400000FC, 0x400000FB -+};*/ -+ -+/* Microphone working, but no front (old Bootcamp, proto.ini) */ -+/*static unsigned int macmini_pin_configs[10] = { -+ 0x0121E220, 0x400000FF, 0x9017E110, 0x400000FE, -+ 0x400000FD, 0x0181E040, 0x1145E030, 0x11C5E040, -+ 0x400000FC, 0x400000FB -+};*/ -+ -+/* Jason's working pins */ -+/*static unsigned int macmini_pin_configs[10] = { -+ 0x0321E230, 0x03A1E020, 0x9017E110, 0x400000FD, -+ 0x400000FE, 0x0381E021, 0x1345E240, 0x13C5E22E, -+ 0x400000FC, 0x400000FB, -+};*/ -+ -+/* Nicolas' working pins, map unmapped pins from Jason's pins with the default */ -+static unsigned int macmini_pin_configs[10] = { -+ 0x0321E230, 0x03A1E020, 0x9017E110, 0x01014010, -+ 0x01a19021, 0x0381E021, 0x1345E240, 0x13C5E22E, -+ 0x02a19320, 0x400000FB, -+}; -+ - static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { - [STAC_REF] = ref922x_pin_configs, - [STAC_D945GTP3] = d945gtp3_pin_configs, - [STAC_D945GTP5] = d945gtp5_pin_configs, -- [STAC_MACMINI] = d945gtp5_pin_configs, -+ [STAC_MACMINI] = macmini_pin_configs, - }; - - static struct hda_board_config stac922x_cfg_tbl[] = { -diff -uNr linux-2.6.19/drivers/usb/input/hid-core.c linux-2.6.19-mactel/drivers/usb/input/hid-core.c ---- linux-2.6.19/drivers/usb/input/hid-core.c 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19-mactel/drivers/usb/input/hid-core.c 2006-11-30 09:20:49.000000000 +0100 -@@ -1627,6 +1627,16 @@ - - #define USB_VENDOR_ID_APPLE 0x05ac - #define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304 -+#define USB_DEVICE_ID_APPLE_GEYSER_ANSI 0x0214 -+#define USB_DEVICE_ID_APPLE_GEYSER_ISO 0x0215 -+#define USB_DEVICE_ID_APPLE_GEYSER_JIS 0x0216 -+#define USB_DEVICE_ID_APPLE_GEYSER3_ANSI 0x0217 -+#define USB_DEVICE_ID_APPLE_GEYSER3_ISO 0x0218 -+#define USB_DEVICE_ID_APPLE_GEYSER3_JIS 0x0219 -+#define USB_DEVICE_ID_APPLE_GEYSER4_ANSI 0x021A -+#define USB_DEVICE_ID_APPLE_GEYSER4_ISO 0x021B -+#define USB_DEVICE_ID_APPLE_GEYSER4_JIS 0x021C -+#define USB_DEVICE_ID_APPLE_IR 0x8240 - - #define USB_VENDOR_ID_CHERRY 0x046a - #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 -@@ -1794,17 +1804,21 @@ - - { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_CYMOTION }, - -- { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, -- { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x0217, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, -- { USB_VENDOR_ID_APPLE, 0x0219, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x021B, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, -+ -+ { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IR, HID_QUIRK_IGNORE }, - - { USB_VENDOR_ID_PANJIT, 0x0001, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_PANJIT, 0x0002, HID_QUIRK_IGNORE }, -@@ -1903,6 +1917,10 @@ - if (quirks & HID_QUIRK_IGNORE) - return NULL; - -+ if ((quirks & HID_QUIRK_IGNORE_MOUSE) && -+ (interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE)) -+ return NULL; -+ - if (usb_get_extra_descriptor(interface, HID_DT_HID, &hdesc) && - (!interface->desc.bNumEndpoints || - usb_get_extra_descriptor(&interface->endpoint[0], HID_DT_HID, &hdesc))) { -diff -uNr linux-2.6.19/drivers/usb/input/hid.h linux-2.6.19-mactel/drivers/usb/input/hid.h ---- linux-2.6.19/drivers/usb/input/hid.h 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19-mactel/drivers/usb/input/hid.h 2006-11-30 09:21:18.000000000 +0100 -@@ -261,6 +261,7 @@ - #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 - #define HID_QUIRK_INVERT_HWHEEL 0x00004000 - #define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 -+#define HID_QUIRK_IGNORE_MOUSE 0x00010000 - - /* - * This is the global environment of the parser. This information is diff --git a/sys-kernel/gentoo-sources/files/2.6.19-sis-ide-sata-updates.patch b/sys-kernel/gentoo-sources/files/2.6.19-sis-ide-sata-updates.patch deleted file mode 100644 index 016698ae6..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.19-sis-ide-sata-updates.patch +++ /dev/null @@ -1,94 +0,0 @@ ---- drivers/ata/pata_sis.c.old -+++ drivers/ata/pata_sis.c -@@ -34,7 +34,7 @@ - #include - - #define DRV_NAME "pata_sis" --#define DRV_VERSION "0.4.4" -+#define DRV_VERSION "0.4.5" - - struct sis_chipset { - u16 device; /* PCI host ID */ -@@ -538,14 +538,16 @@ static struct scsi_host_template sis_sht - .can_queue = ATA_DEF_QUEUE, - .this_id = ATA_SHT_THIS_ID, - .sg_tablesize = LIBATA_MAX_PRD, -- .max_sectors = ATA_MAX_SECTORS, - .cmd_per_lun = ATA_SHT_CMD_PER_LUN, - .emulated = ATA_SHT_EMULATED, - .use_clustering = ATA_SHT_USE_CLUSTERING, - .proc_name = DRV_NAME, - .dma_boundary = ATA_DMA_BOUNDARY, - .slave_configure = ata_scsi_slave_config, -+ .slave_destroy = ata_scsi_slave_destroy, - .bios_param = ata_std_bios_param, -+ .resume = ata_scsi_device_resume, -+ .suspend = ata_scsi_device_suspend, - }; - - static const struct ata_port_operations sis_133_ops = { -@@ -999,6 +1001,8 @@ static struct pci_driver sis_pci_driver - .id_table = sis_pci_tbl, - .probe = sis_init_one, - .remove = ata_pci_remove_one, -+ .suspend = ata_pci_device_suspend, -+ .resume = ata_pci_device_resume, - }; - - static int __init sis_init(void) ---- drivers/ata/sata_sis.c.old -+++ drivers/ata/sata_sis.c -@@ -173,7 +173,7 @@ static u32 sis_scr_cfg_read (struct ata_ - if ((pdev->device == 0x182) || (pmr & SIS_PMR_COMBINED)) - pci_read_config_dword(pdev, cfg_addr+0x10, &val2); - -- return val|val2; -+ return (val|val2) & 0xfffffffb; /* avoid problems with powerdowned ports */ - } - - static void sis_scr_cfg_write (struct ata_port *ap, unsigned int scr, u32 val) -@@ -212,7 +212,7 @@ static u32 sis_scr_read (struct ata_port - if ((pdev->device == 0x182) || (pmr & SIS_PMR_COMBINED)) - val2 = inl(ap->ioaddr.scr_addr + (sc_reg * 4) + 0x10); - -- return val | val2; -+ return (val | val2) & 0xfffffffb; - } - - static void sis_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) -@@ -239,7 +239,7 @@ static int sis_init_one (struct pci_dev - static int printed_version; - struct ata_probe_ent *probe_ent = NULL; - int rc; -- u32 genctl; -+ u32 genctl, val; - struct ata_port_info pi = sis_port_info, *ppi[2] = { &pi, &pi }; - int pci_dev_busy = 0; - u8 pmr; -@@ -285,17 +285,24 @@ static int sis_init_one (struct pci_dev - if (ent->device != 0x182) { - if ((pmr & SIS_PMR_COMBINED) == 0) { - dev_printk(KERN_INFO, &pdev->dev, -- "Detected SiS 180/181 chipset in SATA mode\n"); -+ "Detected SiS 180/181/964 chipset in SATA mode\n"); - port2_start = 64; - } - else { - dev_printk(KERN_INFO, &pdev->dev, - "Detected SiS 180/181 chipset in combined mode\n"); - port2_start=0; -+ pi.flags |= ATA_FLAG_SLAVE_POSS; - } - } - else { -- dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 182 chipset\n"); -+ pci_read_config_dword ( pdev, 0x6C, &val); -+ if (val & (1L << 31)) { -+ dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 182/965 chipset\n"); -+ pi.flags |= ATA_FLAG_SLAVE_POSS; -+ } -+ else -+ dev_printk(KERN_INFO, &pdev->dev, "Detected SiS 182/965L chipset\n"); - port2_start = 0x20; - } - diff --git a/sys-kernel/gentoo-sources/files/2.6.20-mactel.patch b/sys-kernel/gentoo-sources/files/2.6.20-mactel.patch deleted file mode 100644 index 9c35d5b3c..000000000 --- a/sys-kernel/gentoo-sources/files/2.6.20-mactel.patch +++ /dev/null @@ -1,1162 +0,0 @@ ---- a/drivers/acpi/blacklist.c 2006-06-26 08:32:21.000000000 +0200 -+++ a/drivers/acpi/blacklist.c 2006-06-26 08:32:59.000000000 +0200 -@@ -78,6 +78,10 @@ - static int __init blacklist_by_year(void) - { - int year = dmi_get_year(DMI_BIOS_DATE); -+ -+ if (efi_enabled) -+ return 0; -+ - /* Doesn't exist? Likely an old system */ - if (year == -1) - return 1; -Index: linux-2.6.19-rc2/arch/i386/kernel/msr.c -=================================================================== ---- linux-2.6.19-rc2.orig/arch/i386/kernel/msr.c 2006-10-17 23:10:39.470361250 +0200 -+++ linux-2.6.19-rc2/arch/i386/kernel/msr.c 2006-10-17 23:15:54.470047500 +0200 -@@ -90,7 +90,7 @@ - cmd->err = rdmsr_eio(cmd->reg, &cmd->data[0], &cmd->data[1]); - } - --static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx) -+int msr_write(int cpu, u32 reg, u32 eax, u32 edx) - { - struct msr_command cmd; - int ret; -@@ -111,7 +111,7 @@ - return ret; - } - --static inline int do_rdmsr(int cpu, u32 reg, u32 * eax, u32 * edx) -+int msr_read(int cpu, u32 reg, u32 * eax, u32 * edx) - { - struct msr_command cmd; - int ret; -@@ -136,19 +136,22 @@ - - #else /* ! CONFIG_SMP */ - --static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx) -+int msr_write(int cpu, u32 reg, u32 eax, u32 edx) - { - return wrmsr_eio(reg, eax, edx); - } - --static inline int do_rdmsr(int cpu, u32 reg, u32 *eax, u32 *edx) -+int msr_read(int cpu, u32 reg, u32 *eax, u32 *edx) - { - return rdmsr_eio(reg, eax, edx); - } - - #endif /* ! CONFIG_SMP */ - --static loff_t msr_seek(struct file *file, loff_t offset, int orig) -+EXPORT_SYMBOL_GPL(msr_write); -+EXPORT_SYMBOL_GPL(msr_read); -+ -+static loff_t msr_fseek(struct file *file, loff_t offset, int orig) - { - loff_t ret = -EINVAL; - -@@ -166,7 +169,7 @@ - return ret; - } - --static ssize_t msr_read(struct file *file, char __user * buf, -+static ssize_t msr_fread(struct file *file, char __user * buf, - size_t count, loff_t * ppos) - { - u32 __user *tmp = (u32 __user *) buf; -@@ -179,7 +182,7 @@ - return -EINVAL; /* Invalid chunk size */ - - for (; count; count -= 8) { -- err = do_rdmsr(cpu, reg, &data[0], &data[1]); -+ err = msr_read(cpu, reg, &data[0], &data[1]); - if (err) - return err; - if (copy_to_user(tmp, &data, 8)) -@@ -190,7 +193,7 @@ - return ((char __user *)tmp) - buf; - } - --static ssize_t msr_write(struct file *file, const char __user *buf, -+static ssize_t msr_fwrite(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) - { - const u32 __user *tmp = (const u32 __user *)buf; -@@ -206,7 +209,7 @@ - for (rv = 0; count; count -= 8) { - if (copy_from_user(&data, tmp, 8)) - return -EFAULT; -- err = do_wrmsr(cpu, reg, data[0], data[1]); -+ err = msr_write(cpu, reg, data[0], data[1]); - if (err) - return err; - tmp += 2; -@@ -215,7 +218,7 @@ - return ((char __user *)tmp) - buf; - } - --static int msr_open(struct inode *inode, struct file *file) -+static int msr_fopen(struct inode *inode, struct file *file) - { - unsigned int cpu = iminor(file->f_dentry->d_inode); - struct cpuinfo_x86 *c = &(cpu_data)[cpu]; -@@ -233,10 +236,10 @@ - */ - static struct file_operations msr_fops = { - .owner = THIS_MODULE, -- .llseek = msr_seek, -- .read = msr_read, -- .write = msr_write, -- .open = msr_open, -+ .llseek = msr_fseek, -+ .read = msr_fread, -+ .write = msr_fwrite, -+ .open = msr_fopen, - }; - - static int msr_class_device_create(int i) -Index: linux-2.6.19-rc2/include/asm-i386/msr.h -=================================================================== ---- linux-2.6.19-rc2.orig/include/asm-i386/msr.h 2006-10-17 23:10:39.446359750 +0200 -+++ linux-2.6.19-rc2/include/asm-i386/msr.h 2006-10-17 23:10:52.211157500 +0200 -@@ -78,6 +78,9 @@ - : "=a" (low), "=d" (high) \ - : "c" (counter)) - -+int msr_write(int cpu, u32 reg, u32 eax, u32 edx); -+int msr_read(int cpu, u32 reg, u32 *eax, u32 *edx); -+ - /* symbolic names for some interesting MSRs */ - /* Intel defined MSRs. */ - #define MSR_IA32_P5_MC_ADDR 0 -Index: linux-2.6.19-rc2/include/asm-x86_64/msr.h -=================================================================== ---- linux-2.6.19-rc2.orig/include/asm-x86_64/msr.h 2006-10-17 23:10:39.382355750 +0200 -+++ linux-2.6.19-rc2/include/asm-x86_64/msr.h 2006-10-17 23:18:29.347726750 +0200 -@@ -160,7 +160,8 @@ - #define MSR_IA32_UCODE_WRITE 0x79 - #define MSR_IA32_UCODE_REV 0x8b - -- -+int msr_write(int cpu, u32 reg, u32 eax, u32 edx); -+int msr_read(int cpu, u32 reg, u32 *eax, u32 *edx); - #endif - - /* AMD/K8 specific MSRs */ -Index: linux-2.6.19-rc2/drivers/hwmon/coretemp.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.19-rc2/drivers/hwmon/coretemp.c 2006-10-17 23:12:39.589868250 +0200 -@@ -0,0 +1,400 @@ -+/* -+ * coretemp.c - Linux kernel module for hardware monitoring -+ * -+ * Copyright (C) 2006 Rudolf Marek -+ * -+ * Inspired from many hwmon drivers -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -+ * 02110-1301 USA. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define DRVNAME "coretemp" -+ -+typedef enum { SHOW_TEMP, SHOW_TJMAX, SHOW_LABEL, SHOW_NAME } SHOW; -+ -+/* -+ * Functions declaration -+ */ -+ -+static struct coretemp_data *coretemp_update_device(struct device *dev); -+ -+struct coretemp_data { -+ struct class_device *class_dev; -+ struct mutex update_lock; -+ const char *name; -+ u32 id; -+ char valid; /* zero until following fields are valid */ -+ unsigned long last_updated; /* in jiffies */ -+ int temp; -+ int tjmax; -+ /* registers values */ -+ u32 therm_status; -+}; -+ -+static struct coretemp_data *coretemp_update_device(struct device *dev); -+ -+/* -+ * Sysfs stuff -+ */ -+ -+ -+static ssize_t show_name(struct device *dev, struct device_attribute -+ *devattr, char *buf) -+{ -+ int ret; -+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -+ struct coretemp_data *data = dev_get_drvdata(dev); -+ -+ if (attr->index == SHOW_NAME) -+ ret = sprintf(buf, "%s\n", data->name); -+ else /* show label */ -+ ret = sprintf(buf, "Core %d\n", data->id); -+ return ret; -+} -+ -+static ssize_t show_alarm(struct device *dev, struct device_attribute -+ *devattr, char *buf) -+{ -+ struct coretemp_data *data = coretemp_update_device(dev); -+ /* read the Out-of-spec log, never clear */ -+ return sprintf(buf, "%d\n", (data->therm_status >> 5) & 1); -+} -+ -+static ssize_t show_temp(struct device *dev, -+ struct device_attribute *devattr, char *buf) -+{ -+ struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); -+ struct coretemp_data *data = coretemp_update_device(dev); -+ return sprintf(buf, "%d\n", -+ attr->index == -+ SHOW_TEMP ? data->temp : data->tjmax); -+} -+ -+static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_temp, NULL, -+ SHOW_TEMP); -+static SENSOR_DEVICE_ATTR(temp1_crit, S_IRUGO, show_temp, NULL, -+ SHOW_TJMAX); -+static DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL); -+static SENSOR_DEVICE_ATTR(temp1_label, S_IRUGO, show_name, NULL, SHOW_LABEL); -+static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, SHOW_NAME); -+ -+static struct attribute *coretemp_attributes[] = { -+ &sensor_dev_attr_name.dev_attr.attr, -+ &sensor_dev_attr_temp1_label.dev_attr.attr, -+ &dev_attr_temp1_crit_alarm.attr, -+ &sensor_dev_attr_temp1_input.dev_attr.attr, -+ &sensor_dev_attr_temp1_crit.dev_attr.attr, -+ NULL -+}; -+ -+static const struct attribute_group coretemp_group = { -+ .attrs = coretemp_attributes, -+}; -+ -+static struct coretemp_data *coretemp_update_device(struct device *dev) -+{ -+ struct coretemp_data *data = dev_get_drvdata(dev); -+ -+ mutex_lock(&data->update_lock); -+ -+ if (!data->valid || time_after(jiffies, data->last_updated + HZ)) { -+ u32 eax, edx; -+ -+ data->valid = 0; -+ msr_read(data->id, MSR_IA32_THERM_STATUS, &eax, &edx); -+ data->therm_status = eax; -+ -+ /* update only if data has been valid */ -+ if (eax & 0x80000000) { -+ data->temp = data->tjmax - (((data->therm_status >> 16) -+ & 0x7f) * 1000); -+ data->valid = 1; -+ } -+ data->last_updated = jiffies; -+ } -+ -+ mutex_unlock(&data->update_lock); -+ return data; -+} -+ -+static int __devinit coretemp_probe(struct platform_device *pdev) -+{ -+ struct coretemp_data *data; -+ struct cpuinfo_x86 *c = &(cpu_data)[pdev->id]; -+ int err; -+ u32 eax, edx; -+ -+ if (!(data = kzalloc(sizeof(struct coretemp_data), GFP_KERNEL))) { -+ err = -ENOMEM; -+ dev_err(&pdev->dev, "Out of memory\n"); -+ goto exit; -+ } -+ -+ data->id = pdev->id; -+ data->name = "coretemp"; -+ mutex_init(&data->update_lock); -+ /* Tjmax default is 100C */ -+ data->tjmax = 100000; -+ -+ /* Some processors have Tjmax 85 following magic should detect it */ -+ /* family is always 0x6 */ -+ -+ if (((c->x86_model == 0xf) && (c->x86_mask > 3 )) || -+ (c->x86_model == 0xe)) { -+ -+ err = msr_read(data->id, 0xee, &eax, &edx); -+ if (err) { -+ dev_warn(&pdev->dev, -+ "Unable to access MSR 0xEE, Tjmax left at %d\n", -+ data->tjmax); -+ } else if (eax & 0x40000000) { -+ data->tjmax = 85000; -+ } -+ } -+ -+ /* test if we can access the THERM_STATUS MSR */ -+ err = msr_read(data->id, MSR_IA32_THERM_STATUS, &eax, &edx); -+ -+ if (err) { -+ dev_err(&pdev->dev, -+ "Unable to access THERM_STATUS MSR, giving up\n"); -+ goto exit_free; -+ } -+ platform_set_drvdata(pdev, data); -+ -+ if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group))) -+ goto exit_free; -+ -+ data->class_dev = hwmon_device_register(&pdev->dev); -+ if (IS_ERR(data->class_dev)) { -+ err = PTR_ERR(data->class_dev); -+ dev_err(&pdev->dev, "Class registration failed (%d)\n", -+ err); -+ goto exit_class; -+ } -+ -+ return 0; -+ -+exit_class: -+ sysfs_remove_group(&pdev->dev.kobj, &coretemp_group); -+exit_free: -+ kfree(data); -+exit: -+ return err; -+} -+ -+static int __devexit coretemp_remove(struct platform_device *pdev) -+{ -+ struct coretemp_data *data = platform_get_drvdata(pdev); -+ -+ hwmon_device_unregister(data->class_dev); -+ sysfs_remove_group(&pdev->dev.kobj, &coretemp_group); -+ platform_set_drvdata(pdev, NULL); -+ kfree(data); -+ return 0; -+} -+ -+static struct platform_driver coretemp_driver = { -+ .driver = { -+ .owner = THIS_MODULE, -+ .name = DRVNAME, -+ }, -+ .probe = coretemp_probe, -+ .remove = __devexit_p(coretemp_remove), -+}; -+ -+struct pdev_entry { -+ struct list_head list; -+ struct platform_device *pdev; -+ unsigned int cpu; -+}; -+ -+static LIST_HEAD(pdev_list); -+static DEFINE_MUTEX(pdev_list_mutex); -+ -+static int __cpuinit coretemp_devices_add(unsigned int cpu) -+{ -+ int err; -+ struct platform_device *pdev; -+ struct pdev_entry *pdev_entry; -+ -+ pdev = platform_device_alloc(DRVNAME, cpu); -+ if (!pdev) { -+ err = -ENOMEM; -+ printk(KERN_ERR DRVNAME ": Device allocation failed\n"); -+ goto exit; -+ -+ } -+ -+ pdev_entry = kzalloc(sizeof(struct pdev_entry), GFP_KERNEL); -+ -+ if (!pdev_entry) { -+ err = -ENOMEM; -+ goto exit_device_put; -+ } -+ -+ err = platform_device_add(pdev); -+ -+ if (err) { -+ printk(KERN_ERR DRVNAME ": Device addition failed (%d)\n", -+ err); -+ goto exit_device_free; -+ } -+ -+ pdev_entry->pdev = pdev; -+ pdev_entry->cpu = cpu; -+ mutex_lock(&pdev_list_mutex); -+ list_add_tail(&pdev_entry->list, &pdev_list); -+ mutex_unlock(&pdev_list_mutex); -+ -+ return 0; -+ -+exit_device_free: -+ kfree(pdev_entry); -+exit_device_put: -+ platform_device_put(pdev); -+exit: -+ return err; -+} -+ -+#ifdef CONFIG_HOTPLUG_CPU -+void coretemp_devices_remove(unsigned int cpu) -+{ -+ struct pdev_entry *p, *n; -+ mutex_lock(&pdev_list_mutex); -+ list_for_each_entry_safe(p, n, &pdev_list, list) { -+ if (p->cpu == cpu) { -+ platform_device_unregister(p->pdev); -+ list_del(&p->list); -+ kfree(p); -+ } -+ } -+ mutex_unlock(&pdev_list_mutex); -+} -+ -+static int coretemp_cpu_callback(struct notifier_block *nfb, -+ unsigned long action, void *hcpu) -+{ -+ unsigned int cpu = (unsigned long) hcpu; -+ -+ switch (action) { -+ case CPU_ONLINE: -+ coretemp_devices_add(cpu); -+ break; -+ case CPU_DEAD: -+ coretemp_devices_remove(cpu); -+ break; -+ } -+ return NOTIFY_OK; -+} -+ -+static struct notifier_block __cpuinitdata coretemp_cpu_notifier = { -+ .notifier_call = coretemp_cpu_callback, -+}; -+#endif /* !CONFIG_HOTPLUG_CPU */ -+ -+static int __init coretemp_init(void) -+{ -+ int i, err = -ENODEV; -+ struct pdev_entry *p, *n; -+ -+ if (current_cpu_data.x86_vendor != X86_VENDOR_INTEL) -+ goto exit; -+ -+ err = platform_driver_register(&coretemp_driver); -+ if (err) -+ goto exit; -+ -+ for_each_online_cpu(i) { -+ struct cpuinfo_x86 *c = &(cpu_data)[i]; -+ -+ /* check if family 6, models e, f */ -+ if ((c->cpuid_level < 0) || (c->x86 != 0x6) || -+ !((c->x86_model == 0xe) || (c->x86_model == 0xf))) { -+ -+ /* supported CPU not found, but report the unknown -+ family 6 CPU */ -+ if ((c->x86 == 0x6) && (c->x86_model > 0xf)) -+ printk(KERN_WARNING DRVNAME ": Unknown CPU, please" -+ " report to the lm-sensors@lm-sensors.org\n"); -+ continue; -+ } -+ -+ err = coretemp_devices_add(i); -+ if (err) -+ goto exit_driver; -+ } -+ if (list_empty(&pdev_list)) { -+ err = -ENODEV; -+ goto exit_driver_unreg; -+ } -+ -+#ifdef CONFIG_HOTPLUG_CPU -+ register_hotcpu_notifier(&coretemp_cpu_notifier); -+#endif -+ return 0; -+ -+exit_driver: -+ mutex_lock(&pdev_list_mutex); -+ list_for_each_entry_safe(p, n, &pdev_list, list) { -+ platform_device_unregister(p->pdev); -+ list_del(&p->list); -+ kfree(p); -+ } -+ mutex_unlock(&pdev_list_mutex); -+exit_driver_unreg: -+ platform_driver_unregister(&coretemp_driver); -+exit: -+ return err; -+} -+ -+static void __exit coretemp_exit(void) -+{ -+ struct pdev_entry *p, *n; -+#ifdef CONFIG_HOTPLUG_CPU -+ unregister_hotcpu_notifier(&coretemp_cpu_notifier); -+#endif -+ mutex_lock(&pdev_list_mutex); -+ list_for_each_entry_safe(p, n, &pdev_list, list) { -+ platform_device_unregister(p->pdev); -+ list_del(&p->list); -+ kfree(p); -+ } -+ mutex_unlock(&pdev_list_mutex); -+ platform_driver_unregister(&coretemp_driver); -+} -+ -+MODULE_AUTHOR("Rudolf Marek "); -+MODULE_DESCRIPTION("Intel Core temperature monitor"); -+MODULE_LICENSE("GPL"); -+ -+module_init(coretemp_init) -+module_exit(coretemp_exit) -Index: linux-2.6.19-rc2/drivers/hwmon/Kconfig -=================================================================== ---- linux-2.6.19-rc2.orig/drivers/hwmon/Kconfig 2006-10-17 23:05:20.178406750 +0200 -+++ linux-2.6.19-rc2/drivers/hwmon/Kconfig 2006-10-17 23:11:36.021895500 +0200 -@@ -131,6 +131,15 @@ - This driver can also be built as a module. If so, the module - will be called atxp1. - -+config SENSORS_CORETEMP -+ tristate "Intel Core (2) Duo/Solo temperature sensor" -+ depends on HWMON && X86 && EXPERIMENTAL -+ select X86_MSR -+ help -+ If you say yes here you get support for the temperature -+ sensor inside your CPU. Supported all are all known variants -+ of Intel Core family. -+ - config SENSORS_DS1621 - tristate "Dallas Semiconductor DS1621 and DS1625" - depends on HWMON && I2C -Index: linux-2.6.19-rc2/drivers/hwmon/Makefile -=================================================================== ---- linux-2.6.19-rc2.orig/drivers/hwmon/Makefile 2006-10-17 23:05:20.138404250 +0200 -+++ linux-2.6.19-rc2/drivers/hwmon/Makefile 2006-10-17 23:11:36.025895750 +0200 -@@ -20,6 +19,7 @@ - obj-$(CONFIG_SENSORS_ADM1031) += adm1031.o - obj-$(CONFIG_SENSORS_ADM9240) += adm9240.o - obj-$(CONFIG_SENSORS_ATXP1) += atxp1.o -+obj-$(CONFIG_SENSORS_CORETEMP) += coretemp.o - obj-$(CONFIG_SENSORS_DS1621) += ds1621.o - obj-$(CONFIG_SENSORS_F71805F) += f71805f.o - obj-$(CONFIG_SENSORS_FSCHER) += fscher.o ---- linux-2.6.16.1/drivers/usb/input/Makefile 2006-03-28 07:49:02.000000000 +0100 -+++ linux-2.6.16.1-imac-sky2-rtc/drivers/usb/input/Makefile 2006-05-22 13:14:40.000000000 +0100 -@@ -36,6 +36,7 @@ - obj-$(CONFIG_USB_HID) += usbhid.o - obj-$(CONFIG_USB_KBD) += usbkbd.o - obj-$(CONFIG_USB_KBTAB) += kbtab.o -+obj-$(CONFIG_USB_APPLEIR) += appleir.o - obj-$(CONFIG_USB_KEYSPAN_REMOTE) += keyspan_remote.o - obj-$(CONFIG_USB_MOUSE) += usbmouse.o - obj-$(CONFIG_USB_MTOUCH) += mtouchusb.o ---- linux-2.6.16.1/drivers/usb/input/Kconfig 2006-03-28 07:49:02.000000000 +0100 -+++ linux-2.6.16.1-imac-sky2-rtc/drivers/usb/input/Kconfig 2006-05-22 13:15:16.000000000 +0100 -@@ -183,6 +183,10 @@ - To compile this driver as a module, choose M here: the - module will be called acecad. - -+config USB_APPLEIR -+ tristate "Apple Mac Mini USB IR receiver (built in)" -+ depends on USB && INPUT -+ - config USB_KBTAB - tristate "KB Gear JamStudio tablet support" - depends on USB && INPUT ---- linux-2.6.16.1/drivers/usb/input/appleir.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.16.1-imac-sky2-rtc/drivers/usb/input/appleir.c 2006-05-29 09:47:40.000000000 +0100 -@@ -0,0 +1,390 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* -+ * Version Information -+ * -+ */ -+ -+#if 0 -+#define DUMP_PACKETS -+#else -+#undef DUMP_PACKETS -+#endif -+ -+#define DRIVER_VERSION "v1.1" -+#define DRIVER_AUTHOR "James McKenzie" -+#define DRIVER_DESC "USB Apple MacMini IR Receiver driver" -+#define DRIVER_LICENSE "GPL" -+ -+MODULE_AUTHOR (DRIVER_AUTHOR); -+MODULE_DESCRIPTION (DRIVER_DESC); -+MODULE_LICENSE (DRIVER_LICENSE); -+ -+#ifndef USB_VENDOR_ID_APPLE -+#define USB_VENDOR_ID_APPLE 0x05ac -+#endif -+#ifndef USB_DEVICE_ID_APPLE_IR -+#define USB_DEVICE_ID_APPLE_IR 0x8240 -+#endif -+ -+#define URB_SIZE 32 -+ -+#define MAX_KEYS 8 -+#define MAX_KEYS_MASK (MAX_KEYS - 1 ) -+ -+struct appleir -+{ -+ struct input_dev *dev; -+ uint8_t *data; -+ dma_addr_t dma_buf; -+ struct usb_device *usbdev; -+ struct urb *urb; -+ int timer_initted; -+ struct timer_list key_up_timer; -+ int current_key; -+ char phys[32]; -+}; -+ -+ -+static struct usb_device_id appleir_ids[] = { -+ {USB_DEVICE (USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IR),.driver_info = 0}, -+ {} -+}; -+ -+MODULE_DEVICE_TABLE (usb, appleir_ids); -+ -+ -+/* I have two devices both of which report the following */ -+/* 25 87 ee 83 0a + */ -+/* 25 87 ee 83 0c - */ -+/* 25 87 ee 83 09 << */ -+/* 25 87 ee 83 06 >> */ -+/* 25 87 ee 83 05 >" */ -+/* 25 87 ee 83 03 menu */ -+/* 26 00 00 00 00 for key repeat*/ -+ -+/* Thomas Glanzmann reports the following responses */ -+/* 25 87 ee ca 0b + */ -+/* 25 87 ee ca 0d - */ -+/* 25 87 ee ca 08 << */ -+/* 25 87 ee ca 07 >> */ -+/* 25 87 ee ca 04 >" */ -+/* 25 87 ee ca 02 menu */ -+/* 26 00 00 00 00 for key repeat*/ -+/* He also observes the following event sometimes */ -+/* sent after a key is release, which I interpret */ -+/* as a flat battery message */ -+/* 25 87 e0 ca 06 flat battery */ -+ -+ -+static int keymap[MAX_KEYS] = { -+ KEY_RESERVED, KEY_MENU, -+ KEY_PLAYPAUSE, KEY_NEXTSONG, -+ KEY_PREVIOUSSONG, KEY_VOLUMEUP, -+ KEY_VOLUMEDOWN, KEY_RESERVED -+}; -+ -+static void -+dump_packet (struct appleir *appleir, char *msg, uint8_t * data, int len) -+{ -+ int i; -+ -+ printk (KERN_ERR "appleir: %s (%d bytes)", msg, len); -+ -+ for (i = 0; i < len; ++i) -+ { -+ printk (" %02x", data[i]); -+ } -+ -+ printk ("\n"); -+} -+ -+ -+static void -+key_up (struct appleir *appleir, int key) -+{ -+ //printk (KERN_ERR "key %d up\n", key); -+ input_report_key (appleir->dev, key, 0); -+ input_sync (appleir->dev); -+} -+ -+static void -+key_down (struct appleir *appleir, int key) -+{ -+ //printk (KERN_ERR "key %d down\n", key); -+ input_report_key (appleir->dev, key, 1); -+ input_sync (appleir->dev); -+} -+ -+static void -+battery_flat (struct appleir *appleir) -+{ -+ printk (KERN_ERR "appleir: possible flat battery?\n"); -+} -+ -+static void -+key_up_tick (unsigned long data) -+{ -+ struct appleir *appleir = (struct appleir *) data; -+ -+ if (appleir->current_key) -+ { -+ key_up (appleir, appleir->current_key); -+ appleir->current_key = 0; -+ } -+} -+ -+static void -+new_data (struct appleir *appleir, uint8_t * data, int len) -+{ -+ static const uint8_t keydown[] = { 0x25, 0x87, 0xee }; -+ static const uint8_t keyrepeat[] = { 0x26, 0x00, 0x00, 0x00, 0x00 }; -+ static const uint8_t flatbattery[] = { 0x25, 0x87, 0xe0 }; -+ -+#ifdef DUMP_PACKETS -+ dump_packet (appleir, "received", data, len); -+#endif -+ -+ if (len != 5) -+ return; -+ -+ if (!memcmp (data, keydown, sizeof (keydown))) -+ { -+ /*If we already have a key down, take it up before marking */ -+ /*this one down */ -+ if (appleir->current_key) -+ key_up (appleir, appleir->current_key); -+ appleir->current_key = keymap[(data[4] >> 1) & MAX_KEYS_MASK]; -+ -+ key_down (appleir, appleir->current_key); -+ /*remote doesn't do key up, either pull them up, in the test */ -+ /*above, or here set a timer which pulls them up after 1/8 s */ -+ mod_timer (&appleir->key_up_timer, jiffies + HZ / 8); -+ -+ return; -+ } -+ -+ if (!memcmp (data, keyrepeat, sizeof (keyrepeat))) -+ { -+ key_down (appleir, appleir->current_key); -+ /*remote doesn't do key up, either pull them up, in the test */ -+ /*above, or here set a timer which pulls them up after 1/8 s */ -+ mod_timer (&appleir->key_up_timer, jiffies + HZ / 8); -+ return; -+ } -+ -+ if (!memcmp (data, flatbattery, sizeof (flatbattery))) -+ { -+ battery_flat (appleir); -+ /*Fall through */ -+ } -+ -+ dump_packet (appleir, "unknown packet", data, len); -+} -+ -+static void -+appleir_urb (struct urb *urb, struct pt_regs *regs) -+{ -+ struct appleir *appleir = urb->context; -+ int retval; -+ -+ switch (urb->status) -+ { -+ case 0: -+ new_data (appleir, urb->transfer_buffer, urb->actual_length); -+ break; -+ case -ECONNRESET: -+ case -ENOENT: -+ case -ESHUTDOWN: -+ /* this urb is terminated, clean up */ -+ dbg ("%s - urb shutting down with status: %d", __FUNCTION__, -+ urb->status); -+ return; -+ default: -+ dbg ("%s - nonzero urb status received: %d", __FUNCTION__, urb->status); -+ } -+ -+ retval = usb_submit_urb (urb, GFP_ATOMIC); -+ if (retval) -+ err ("%s - usb_submit_urb failed with result %d", __FUNCTION__, retval); -+} -+ -+ -+static int -+appleir_open (struct input_dev *dev) -+{ -+ struct appleir *appleir = dev->private; -+ -+ //appleir->urb->dev = appleir->usbdev; -+ -+ if (usb_submit_urb (appleir->urb, GFP_KERNEL)) -+ return -EIO; -+ -+ return 0; -+} -+ -+static void -+appleir_close (struct input_dev *dev) -+{ -+ struct appleir *appleir = dev->private; -+ usb_kill_urb (appleir->urb); -+ del_timer_sync (&appleir->key_up_timer); -+} -+ -+ -+ -+ -+static int -+appleir_probe (struct usb_interface *intf, const struct usb_device_id *id) -+{ -+ struct usb_device *dev = interface_to_usbdev (intf); -+ struct usb_endpoint_descriptor *endpoint; -+ struct appleir *appleir = NULL; -+ struct input_dev *input_dev; -+ int i; -+ -+ appleir = kzalloc (sizeof (struct appleir), GFP_KERNEL); -+ if (!appleir) -+ goto fail; -+ -+ memset (appleir, 0, sizeof (struct appleir)); -+ -+ -+ appleir->data = -+ usb_buffer_alloc (dev, URB_SIZE, GFP_KERNEL, &appleir->dma_buf); -+ if (!appleir->data) -+ goto fail; -+ -+ appleir->urb = usb_alloc_urb (0, GFP_KERNEL); -+ if (!appleir->urb) -+ goto fail; -+ -+ appleir->usbdev = dev; -+ -+ input_dev = input_allocate_device (); -+ if (!input_dev) -+ goto fail; -+ -+ appleir->dev = input_dev; -+ -+ -+ usb_make_path (dev, appleir->phys, sizeof (appleir->phys)); -+ strlcpy (appleir->phys, "/input0", sizeof (appleir->phys)); -+ -+ input_dev->name = "Apple Mac mini infrared remote control driver"; -+ input_dev->phys = appleir->phys; -+ usb_to_input_id (dev, &input_dev->id); -+ input_dev->cdev.dev = &intf->dev; -+ input_dev->private = appleir; -+ -+ input_dev->evbit[0] = BIT (EV_KEY) | BIT (EV_REP); -+ input_dev->ledbit[0] = 0; -+ -+ for (i = 0; i < MAX_KEYS; i++) -+ { -+ set_bit (keymap[i], input_dev->keybit); -+ } -+ -+ clear_bit (0, input_dev->keybit); -+ -+ input_dev->open = appleir_open; -+ input_dev->close = appleir_close; -+ -+ endpoint = &intf->cur_altsetting->endpoint[0].desc; -+ -+ usb_fill_int_urb (appleir->urb, dev, -+ usb_rcvintpipe (dev, endpoint->bEndpointAddress), -+ appleir->data, 8, -+ appleir_urb, appleir, endpoint->bInterval); -+ -+ appleir->urb->transfer_dma = appleir->dma_buf; -+ appleir->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; -+ -+ usb_set_intfdata (intf, appleir); -+ -+ init_timer (&appleir->key_up_timer); -+ -+ appleir->key_up_timer.function = key_up_tick; -+ appleir->key_up_timer.data = (unsigned long) appleir; -+ -+ appleir->timer_initted++; -+ -+ input_register_device (appleir->dev); -+ -+ return 0; -+ -+fail: -+ -+ if (appleir) -+ { -+ -+ -+ if (appleir->data) -+ usb_buffer_free (dev, URB_SIZE, appleir->data, appleir->dma_buf); -+ -+ if (appleir->timer_initted) -+ del_timer_sync (&appleir->key_up_timer); -+ -+ if (appleir->dev) -+ input_free_device (appleir->dev); -+ -+ kfree (appleir); -+ } -+ -+ return -ENOMEM; -+} -+ -+static void -+appleir_disconnect (struct usb_interface *intf) -+{ -+ struct appleir *appleir = usb_get_intfdata (intf); -+ -+ usb_set_intfdata (intf, NULL); -+ if (appleir) -+ { -+ input_unregister_device (appleir->dev); -+ if (appleir->timer_initted) -+ del_timer_sync (&appleir->key_up_timer); -+ usb_kill_urb (appleir->urb); -+ usb_free_urb (appleir->urb); -+ usb_buffer_free (interface_to_usbdev (intf), URB_SIZE, appleir->data, -+ appleir->dma_buf); -+ kfree (appleir); -+ } -+} -+ -+static struct usb_driver appleir_driver = { -+ .name = "appleir", -+ .probe = appleir_probe, -+ .disconnect = appleir_disconnect, -+ .id_table = appleir_ids, -+}; -+ -+static int __init -+appleir_init (void) -+{ -+ int retval; -+ retval = usb_register (&appleir_driver); -+ if (retval) -+ goto out; -+ info (DRIVER_VERSION ":" DRIVER_DESC); -+out: -+ return retval; -+} -+ -+static void __exit -+appleir_exit (void) -+{ -+ usb_deregister (&appleir_driver); -+} -+ -+module_init (appleir_init); -+module_exit (appleir_exit); ---- a/drivers/acpi/sleep/poweroff.c 2006-06-11 05:22:53.000000000 -0700 -+++ b/drivers/acpi/sleep/poweroff.c 2006-06-11 05:06:36.000000000 -0700 -@@ -63,8 +63,15 @@ static int acpi_shutdown(struct sys_devi - } - } - -+static int acpi_resume(struct sys_device *x) -+{ -+ acpi_set_register(ACPI_BITREG_SCI_ENABLE, 1, ACPI_MTX_DO_NOT_LOCK); -+ return 0; -+} -+ - static struct sysdev_class acpi_sysclass = { - set_kset_name("acpi"), -+ .resume = acpi_resume, - .shutdown = acpi_shutdown - }; - - - -From: Ryan Lortie -Date: Sat, 10 Jun 2006 20:22:56 +0000 (-0400) -Subject: [UBUNTU:ich7-sci-en-quirk] poke the SCI_EN bit on Macbook resume -X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=d1d9b907570c5c9178e3d66ff208bd483d1dfd61 - -[UBUNTU:ich7-sci-en-quirk] poke the SCI_EN bit on Macbook resume - -The following patch deals with the problem that the SCI_EN bit is -disabled when the Macbook comes back from sleeping. - -It does this by registering a quirk in the exact way that another one is -registered in the same file (for a Toshiba laptop with a similar -problem). - -The quirk matches based on DMI product name of "MacBook1,1" so it should -really only affect the Macbook. - -The actual bit-poking is done immediately on return from -do_suspend_lowlevel(). If I do it in the 'finish' function it is too -late (as at this point IRQs have been enabled again for some time). - -Cheers. - -Signed-off-by: Ben Collins ---- - ---- a/drivers/acpi/sleep/main.c -+++ b/drivers/acpi/sleep/main.c -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - #include "sleep.h" - - u8 sleep_states[ACPI_S_STATE_COUNT]; -@@ -34,6 +35,7 @@ static u32 acpi_suspend_states[] = { - }; - - static int init_8259A_after_S1; -+static int ich7_sci_en_quirk_enabled; - - /** - * acpi_pm_prepare - Do preliminary suspend work. -@@ -92,6 +94,14 @@ static int acpi_pm_enter(suspend_state_t - - case PM_SUSPEND_MEM: - do_suspend_lowlevel(); -+ -+ if (ich7_sci_en_quirk_enabled) -+ { -+ int pm1c = inw(0x404); -+ pm1c |= 0x01; /* SCI_EN */ -+ outw (pm1c, 0x404); -+ } -+ - break; - - case PM_SUSPEND_DISK: -@@ -191,12 +201,36 @@ static int __init init_ints_after_s1(str - return 0; - } - -+/* -+ * Apple Macbook comes back from sleep with the SCI_EN bit disabled -+ * causing a flood of unacknowledged IRQ9s. We need to set SCI_EN -+ * as soon as we come back -+ */ -+static int __init init_ich7_sci_en_quirk(struct dmi_system_id *d) -+{ -+ printk(KERN_WARNING "%s detected (ICH7 SCI_EN quirk enabled)\n", -+ d->ident); -+ ich7_sci_en_quirk_enabled = 1; -+ return 0; -+} -+ -+ - static struct dmi_system_id __initdata acpisleep_dmi_table[] = { - { - .callback = init_ints_after_s1, - .ident = "Toshiba Satellite 4030cdt", - .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "S4030CDT/4.3"),}, - }, -+ { -+ .callback = init_ich7_sci_en_quirk, -+ .ident = "Apple MacBook", -+ .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),}, -+ }, -+ { -+ .callback = init_ich7_sci_en_quirk, -+ .ident = "Apple MacBook", -+ .matches = {DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"),}, -+ }, - {}, - }; - -diff -pruN linux/sound/pci/hda.vanilla/patch_sigmatel.c linux/sound/pci/hda/patch_sigmatel.c ---- linux/sound/pci/hda.vanilla/patch_sigmatel.c 2006-11-26 11:20:30.000000000 +0800 -+++ linux/sound/pci/hda/patch_sigmatel.c 2006-11-26 12:13:42.000000000 +0800 -@@ -364,11 +364,39 @@ static unsigned int d945gtp5_pin_configs - 0x02a19320, 0x40000100, - }; - -+/* Microphone working, but no front (old Bootcamp, proto2.ini) */ -+/*static unsigned int macmini_pin_configs[10] = { -+ 0x0121E230, 0x90A70120, 0x9017E110, 0x400000FE, -+ 0x400000FD, 0x0181E021, 0x1145E040, 0x400000FA, -+ 0x400000FC, 0x400000FB -+};*/ -+ -+/* Microphone working, but no front (old Bootcamp, proto.ini) */ -+/*static unsigned int macmini_pin_configs[10] = { -+ 0x0121E220, 0x400000FF, 0x9017E110, 0x400000FE, -+ 0x400000FD, 0x0181E040, 0x1145E030, 0x11C5E040, -+ 0x400000FC, 0x400000FB -+};*/ -+ -+/* Jason's working pins */ -+/*static unsigned int macmini_pin_configs[10] = { -+ 0x0321E230, 0x03A1E020, 0x9017E110, 0x400000FD, -+ 0x400000FE, 0x0381E021, 0x1345E240, 0x13C5E22E, -+ 0x400000FC, 0x400000FB, -+};*/ -+ -+/* Nicolas' working pins, map unmapped pins from Jason's pins with the default */ -+static unsigned int macmini_pin_configs[10] = { -+ 0x0321E230, 0x03A1E020, 0x9017E110, 0x01014010, -+ 0x01a19021, 0x0381E021, 0x1345E240, 0x13C5E22E, -+ 0x02a19320, 0x400000FB, -+}; -+ - static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { - [STAC_REF] = ref922x_pin_configs, - [STAC_D945GTP3] = d945gtp3_pin_configs, - [STAC_D945GTP5] = d945gtp5_pin_configs, -- [STAC_MACMINI] = d945gtp5_pin_configs, -+ [STAC_MACMINI] = macmini_pin_configs, - }; - - static struct hda_board_config stac922x_cfg_tbl[] = { diff --git a/sys-kernel/gentoo-sources/files/ata-early-irq.patch b/sys-kernel/gentoo-sources/files/ata-early-irq.patch deleted file mode 100644 index f43c0cb89..000000000 --- a/sys-kernel/gentoo-sources/files/ata-early-irq.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- linux-2.6.19-rc6/include/linux/libata.h 2006-11-28 11:14:52.000000000 +0800 -+++ linux-2.6.19-rc6-early_irq/include/linux/libata.h 2006-11-28 13:31:07.565194648 +0800 -@@ -1039,6 +1039,30 @@ static inline void ata_pause(struct ata_ - ndelay(400); - } - -+/** -+ * ata_busy_wait_alt - Wait for a port alt status register -+ * @ap: Port to wait for. -+ * -+ * Waits up to max microseconds for the selected bits in the port's -+ * alt status register to be cleared. -+ * Returns final value of alt status register. -+ * -+ * LOCKING: -+ * Inherited from caller. -+ */ -+static inline u8 ata_busy_wait_alt(struct ata_port *ap, unsigned int bits, -+ unsigned int max) -+{ -+ u8 status = ata_altstatus(ap); -+ -+ while ((status & bits) && (max > 0)) { -+ udelay(1); -+ status = ata_altstatus(ap); -+ max--; -+ }; -+ -+ return status; -+} - - /** - * ata_busy_wait - Wait for a port status register ---- linux-2.6.19-rc6/drivers/ata/libata-core.c 2006-11-28 11:14:38.000000000 +0800 -+++ linux-2.6.19-rc6-early_irq/drivers/ata/libata-core.c 2006-11-28 13:31:31.275590120 +0800 -@@ -4828,8 +4828,10 @@ inline unsigned int ata_host_intr (struc - goto idle_irq; - } - -- /* check altstatus */ -- status = ata_altstatus(ap); -+ /* check altstatus. -+ * Waits up to 10 microseconds for early irq. -+ */ -+ status = ata_busy_wait_alt(ap, ATA_BUSY, 10); - if (status & ATA_BUSY) - goto idle_irq; - diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r3 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r3 deleted file mode 100644 index 10ff4a5f7..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r3 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 5c033c90cc73850a517df8530c5b5e54 genpatches-2.6.18-3.base.tar.bz2 82684 -RMD160 52a13662a88511dbd0e75a2342a05bffe7b5300b genpatches-2.6.18-3.base.tar.bz2 82684 -SHA256 9b561cf36416d0377eac1ead9194c34c55744f175488a5d80d1c6b3a73572f50 genpatches-2.6.18-3.base.tar.bz2 82684 -MD5 1a5972fa0b76968e12e0312857747696 genpatches-2.6.18-3.extras.tar.bz2 143265 -RMD160 b2b158d42d6116d2a807c05dc8a4ef5680debc98 genpatches-2.6.18-3.extras.tar.bz2 143265 -SHA256 9d8e04c285af164324307d25ef52f16631e91d293c82c82f78e6e4375145a5b7 genpatches-2.6.18-3.extras.tar.bz2 143265 -MD5 296a6d150d260144639c3664d127d174 linux-2.6.18.tar.bz2 41863580 -RMD160 f92283f956880676bfb1f1d5288325461e4e02e7 linux-2.6.18.tar.bz2 41863580 -SHA256 c95280ff6c5d2a17788f7cc582d23ae8a9a7ba3f202ec6e4238eaadfce7c163d linux-2.6.18.tar.bz2 41863580 diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r4 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r4 deleted file mode 100644 index 10ff4a5f7..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r4 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 5c033c90cc73850a517df8530c5b5e54 genpatches-2.6.18-3.base.tar.bz2 82684 -RMD160 52a13662a88511dbd0e75a2342a05bffe7b5300b genpatches-2.6.18-3.base.tar.bz2 82684 -SHA256 9b561cf36416d0377eac1ead9194c34c55744f175488a5d80d1c6b3a73572f50 genpatches-2.6.18-3.base.tar.bz2 82684 -MD5 1a5972fa0b76968e12e0312857747696 genpatches-2.6.18-3.extras.tar.bz2 143265 -RMD160 b2b158d42d6116d2a807c05dc8a4ef5680debc98 genpatches-2.6.18-3.extras.tar.bz2 143265 -SHA256 9d8e04c285af164324307d25ef52f16631e91d293c82c82f78e6e4375145a5b7 genpatches-2.6.18-3.extras.tar.bz2 143265 -MD5 296a6d150d260144639c3664d127d174 linux-2.6.18.tar.bz2 41863580 -RMD160 f92283f956880676bfb1f1d5288325461e4e02e7 linux-2.6.18.tar.bz2 41863580 -SHA256 c95280ff6c5d2a17788f7cc582d23ae8a9a7ba3f202ec6e4238eaadfce7c163d linux-2.6.18.tar.bz2 41863580 diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r5 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r5 deleted file mode 100644 index 10ff4a5f7..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.18-r5 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 5c033c90cc73850a517df8530c5b5e54 genpatches-2.6.18-3.base.tar.bz2 82684 -RMD160 52a13662a88511dbd0e75a2342a05bffe7b5300b genpatches-2.6.18-3.base.tar.bz2 82684 -SHA256 9b561cf36416d0377eac1ead9194c34c55744f175488a5d80d1c6b3a73572f50 genpatches-2.6.18-3.base.tar.bz2 82684 -MD5 1a5972fa0b76968e12e0312857747696 genpatches-2.6.18-3.extras.tar.bz2 143265 -RMD160 b2b158d42d6116d2a807c05dc8a4ef5680debc98 genpatches-2.6.18-3.extras.tar.bz2 143265 -SHA256 9d8e04c285af164324307d25ef52f16631e91d293c82c82f78e6e4375145a5b7 genpatches-2.6.18-3.extras.tar.bz2 143265 -MD5 296a6d150d260144639c3664d127d174 linux-2.6.18.tar.bz2 41863580 -RMD160 f92283f956880676bfb1f1d5288325461e4e02e7 linux-2.6.18.tar.bz2 41863580 -SHA256 c95280ff6c5d2a17788f7cc582d23ae8a9a7ba3f202ec6e4238eaadfce7c163d linux-2.6.18.tar.bz2 41863580 diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r1 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r1 deleted file mode 100644 index 937d57fc3..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r1 +++ /dev/null @@ -1,15 +0,0 @@ -MD5 42b6fd75d5c516ba49c11ac8c31f2205 genpatches-2.6.19-2.base.tar.bz2 2057 -RMD160 9abc074d09f53c89a4f6a98a0ac007e7f69463cf genpatches-2.6.19-2.base.tar.bz2 2057 -SHA256 b8f3e88daadad3808006a5948cebef85976fa3bcea224cf8169b2ac38de725c3 genpatches-2.6.19-2.base.tar.bz2 2057 -MD5 04b322d12a32a0395ab52379b93540be genpatches-2.6.19-2.extras.tar.bz2 139339 -RMD160 3ef2e56db8bd3441db59a4caca4b96b7eb76a66e genpatches-2.6.19-2.extras.tar.bz2 139339 -SHA256 3d877d02e90308681d358f8b5dd6e6dde180ffca7e4efeb2a11ffd812da07911 genpatches-2.6.19-2.extras.tar.bz2 139339 -MD5 68a88e3d41f736b9d5b692a3a1c9f2af ipw3945-1.1.3-2.6.19.patch 614020 -RMD160 300f52ff78dbfff5ee3899b4b9fa9193f73e2814 ipw3945-1.1.3-2.6.19.patch 614020 -SHA256 57abc7c6779c64765b2bed63f302a4e440b7068ca3c3de2dc52fe19f3d7d3b49 ipw3945-1.1.3-2.6.19.patch 614020 -MD5 443c265b57e87eadc0c677c3acc37e20 linux-2.6.19.tar.bz2 42733268 -RMD160 75dc65b15cf9cdb359b1abe7084907982c19088b linux-2.6.19.tar.bz2 42733268 -SHA256 c2fd6bcd2b7c1b3d37d64e4d1825703792a75474830a3db7d2dc603a8d392d58 linux-2.6.19.tar.bz2 42733268 -MD5 ce94df22b93c74f1637d2429c1093ec7 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -RMD160 7c27f1d1514a30a410b779c61c8ffad7fe231369 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -SHA256 3321c0004016fcb4b1e490fd42f98f6855c475baa8bcb21917481dadc1af638a suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r2 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r2 deleted file mode 100644 index 2086b067e..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r2 +++ /dev/null @@ -1,15 +0,0 @@ -MD5 8b778c527e7eb4cffc7cac6106163e63 genpatches-2.6.19-3.base.tar.bz2 15941 -RMD160 44db8c27990e978fe9116a49388eda610a473977 genpatches-2.6.19-3.base.tar.bz2 15941 -SHA256 6af4f94b8cea0c86bda44ae9666a23f6e6666f1fc353f7fd0801c6cb5837b762 genpatches-2.6.19-3.base.tar.bz2 15941 -MD5 a6180931d7b566aa514d532dff0c07f1 genpatches-2.6.19-3.extras.tar.bz2 139459 -RMD160 9b3dd25b781854feab0d325cc4327e7035fef60b genpatches-2.6.19-3.extras.tar.bz2 139459 -SHA256 9900288ef68f9c9f93fab4659a4eb2c50d3a3b0ee64e457d9aafee642cd7be19 genpatches-2.6.19-3.extras.tar.bz2 139459 -MD5 68a88e3d41f736b9d5b692a3a1c9f2af ipw3945-1.1.3-2.6.19.patch 614020 -RMD160 300f52ff78dbfff5ee3899b4b9fa9193f73e2814 ipw3945-1.1.3-2.6.19.patch 614020 -SHA256 57abc7c6779c64765b2bed63f302a4e440b7068ca3c3de2dc52fe19f3d7d3b49 ipw3945-1.1.3-2.6.19.patch 614020 -MD5 443c265b57e87eadc0c677c3acc37e20 linux-2.6.19.tar.bz2 42733268 -RMD160 75dc65b15cf9cdb359b1abe7084907982c19088b linux-2.6.19.tar.bz2 42733268 -SHA256 c2fd6bcd2b7c1b3d37d64e4d1825703792a75474830a3db7d2dc603a8d392d58 linux-2.6.19.tar.bz2 42733268 -MD5 ce94df22b93c74f1637d2429c1093ec7 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -RMD160 7c27f1d1514a30a410b779c61c8ffad7fe231369 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -SHA256 3321c0004016fcb4b1e490fd42f98f6855c475baa8bcb21917481dadc1af638a suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r3 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r3 deleted file mode 100644 index 2086b067e..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r3 +++ /dev/null @@ -1,15 +0,0 @@ -MD5 8b778c527e7eb4cffc7cac6106163e63 genpatches-2.6.19-3.base.tar.bz2 15941 -RMD160 44db8c27990e978fe9116a49388eda610a473977 genpatches-2.6.19-3.base.tar.bz2 15941 -SHA256 6af4f94b8cea0c86bda44ae9666a23f6e6666f1fc353f7fd0801c6cb5837b762 genpatches-2.6.19-3.base.tar.bz2 15941 -MD5 a6180931d7b566aa514d532dff0c07f1 genpatches-2.6.19-3.extras.tar.bz2 139459 -RMD160 9b3dd25b781854feab0d325cc4327e7035fef60b genpatches-2.6.19-3.extras.tar.bz2 139459 -SHA256 9900288ef68f9c9f93fab4659a4eb2c50d3a3b0ee64e457d9aafee642cd7be19 genpatches-2.6.19-3.extras.tar.bz2 139459 -MD5 68a88e3d41f736b9d5b692a3a1c9f2af ipw3945-1.1.3-2.6.19.patch 614020 -RMD160 300f52ff78dbfff5ee3899b4b9fa9193f73e2814 ipw3945-1.1.3-2.6.19.patch 614020 -SHA256 57abc7c6779c64765b2bed63f302a4e440b7068ca3c3de2dc52fe19f3d7d3b49 ipw3945-1.1.3-2.6.19.patch 614020 -MD5 443c265b57e87eadc0c677c3acc37e20 linux-2.6.19.tar.bz2 42733268 -RMD160 75dc65b15cf9cdb359b1abe7084907982c19088b linux-2.6.19.tar.bz2 42733268 -SHA256 c2fd6bcd2b7c1b3d37d64e4d1825703792a75474830a3db7d2dc603a8d392d58 linux-2.6.19.tar.bz2 42733268 -MD5 ce94df22b93c74f1637d2429c1093ec7 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -RMD160 7c27f1d1514a30a410b779c61c8ffad7fe231369 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -SHA256 3321c0004016fcb4b1e490fd42f98f6855c475baa8bcb21917481dadc1af638a suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r4 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r4 deleted file mode 100644 index 2086b067e..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r4 +++ /dev/null @@ -1,15 +0,0 @@ -MD5 8b778c527e7eb4cffc7cac6106163e63 genpatches-2.6.19-3.base.tar.bz2 15941 -RMD160 44db8c27990e978fe9116a49388eda610a473977 genpatches-2.6.19-3.base.tar.bz2 15941 -SHA256 6af4f94b8cea0c86bda44ae9666a23f6e6666f1fc353f7fd0801c6cb5837b762 genpatches-2.6.19-3.base.tar.bz2 15941 -MD5 a6180931d7b566aa514d532dff0c07f1 genpatches-2.6.19-3.extras.tar.bz2 139459 -RMD160 9b3dd25b781854feab0d325cc4327e7035fef60b genpatches-2.6.19-3.extras.tar.bz2 139459 -SHA256 9900288ef68f9c9f93fab4659a4eb2c50d3a3b0ee64e457d9aafee642cd7be19 genpatches-2.6.19-3.extras.tar.bz2 139459 -MD5 68a88e3d41f736b9d5b692a3a1c9f2af ipw3945-1.1.3-2.6.19.patch 614020 -RMD160 300f52ff78dbfff5ee3899b4b9fa9193f73e2814 ipw3945-1.1.3-2.6.19.patch 614020 -SHA256 57abc7c6779c64765b2bed63f302a4e440b7068ca3c3de2dc52fe19f3d7d3b49 ipw3945-1.1.3-2.6.19.patch 614020 -MD5 443c265b57e87eadc0c677c3acc37e20 linux-2.6.19.tar.bz2 42733268 -RMD160 75dc65b15cf9cdb359b1abe7084907982c19088b linux-2.6.19.tar.bz2 42733268 -SHA256 c2fd6bcd2b7c1b3d37d64e4d1825703792a75474830a3db7d2dc603a8d392d58 linux-2.6.19.tar.bz2 42733268 -MD5 ce94df22b93c74f1637d2429c1093ec7 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -RMD160 7c27f1d1514a30a410b779c61c8ffad7fe231369 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -SHA256 3321c0004016fcb4b1e490fd42f98f6855c475baa8bcb21917481dadc1af638a suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r5 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r5 deleted file mode 100644 index 2086b067e..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.19-r5 +++ /dev/null @@ -1,15 +0,0 @@ -MD5 8b778c527e7eb4cffc7cac6106163e63 genpatches-2.6.19-3.base.tar.bz2 15941 -RMD160 44db8c27990e978fe9116a49388eda610a473977 genpatches-2.6.19-3.base.tar.bz2 15941 -SHA256 6af4f94b8cea0c86bda44ae9666a23f6e6666f1fc353f7fd0801c6cb5837b762 genpatches-2.6.19-3.base.tar.bz2 15941 -MD5 a6180931d7b566aa514d532dff0c07f1 genpatches-2.6.19-3.extras.tar.bz2 139459 -RMD160 9b3dd25b781854feab0d325cc4327e7035fef60b genpatches-2.6.19-3.extras.tar.bz2 139459 -SHA256 9900288ef68f9c9f93fab4659a4eb2c50d3a3b0ee64e457d9aafee642cd7be19 genpatches-2.6.19-3.extras.tar.bz2 139459 -MD5 68a88e3d41f736b9d5b692a3a1c9f2af ipw3945-1.1.3-2.6.19.patch 614020 -RMD160 300f52ff78dbfff5ee3899b4b9fa9193f73e2814 ipw3945-1.1.3-2.6.19.patch 614020 -SHA256 57abc7c6779c64765b2bed63f302a4e440b7068ca3c3de2dc52fe19f3d7d3b49 ipw3945-1.1.3-2.6.19.patch 614020 -MD5 443c265b57e87eadc0c677c3acc37e20 linux-2.6.19.tar.bz2 42733268 -RMD160 75dc65b15cf9cdb359b1abe7084907982c19088b linux-2.6.19.tar.bz2 42733268 -SHA256 c2fd6bcd2b7c1b3d37d64e4d1825703792a75474830a3db7d2dc603a8d392d58 linux-2.6.19.tar.bz2 42733268 -MD5 ce94df22b93c74f1637d2429c1093ec7 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -RMD160 7c27f1d1514a30a410b779c61c8ffad7fe231369 suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 -SHA256 3321c0004016fcb4b1e490fd42f98f6855c475baa8bcb21917481dadc1af638a suspend2-2.2.9-for-2.6.19-rc6.patch.bz2 100596 diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.20_rc5-r2 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.20_rc5-r2 deleted file mode 100644 index 5ac46642d..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.20_rc5-r2 +++ /dev/null @@ -1,18 +0,0 @@ -MD5 1f58715f3c5f85bb8b6e14c35b2f4463 fbsplash-0.9.2-r5-2.6.19-rc2.patch 53383 -RMD160 d503285b48eb26c40f782e83abe2254a2f61999f fbsplash-0.9.2-r5-2.6.19-rc2.patch 53383 -SHA256 a89ed8e338c78be2324a42d13944b8dd265f6801aaaf41db61daa4cf6ba9d13f fbsplash-0.9.2-r5-2.6.19-rc2.patch 53383 -MD5 fe41b4be9667240631a13408f0a9a641 ipw3945-1.2.0-2.6.20.patch 616174 -RMD160 befea8ee02a021566687dddf37ab4ea48f6ce590 ipw3945-1.2.0-2.6.20.patch 616174 -SHA256 502d8b8d9ebaf2da9df5ec212a8677c405732d30a1fecb55ed0eb1933ed9badf ipw3945-1.2.0-2.6.20.patch 616174 -MD5 443c265b57e87eadc0c677c3acc37e20 linux-2.6.19.tar.bz2 42733268 -RMD160 75dc65b15cf9cdb359b1abe7084907982c19088b linux-2.6.19.tar.bz2 42733268 -SHA256 c2fd6bcd2b7c1b3d37d64e4d1825703792a75474830a3db7d2dc603a8d392d58 linux-2.6.19.tar.bz2 42733268 -MD5 06468af3de151f7325dca1899e355830 patch-2.6.20-rc5.bz2 3667548 -RMD160 961f05e298496a9f3ed1a686f22581a8c827753c patch-2.6.20-rc5.bz2 3667548 -SHA256 3d76a82468326761860c273c0cb6899588446aa31d0bf85440b1a9d37af4fd46 patch-2.6.20-rc5.bz2 3667548 -MD5 e0644a5273d0a8a2d9ea4731852bb18d squashfs-3.2-2.6.20.patch 132210 -RMD160 d48bf39a7118b0462867fd43701416e3990227fe squashfs-3.2-2.6.20.patch 132210 -SHA256 cfc7060a0387701834a4a3ae2d95f5f247e02d8c7f88cf45b5004c363c1d0c1d squashfs-3.2-2.6.20.patch 132210 -MD5 733f6acd988a88d853c560a8a8ebe887 suspend2-2.2.9.3-for-2.6.20-rc4.patch.bz2 100601 -RMD160 e89addaac321c00965a2747ee49191627f60c73d suspend2-2.2.9.3-for-2.6.20-rc4.patch.bz2 100601 -SHA256 163e0377bf688b304ae5b8fd736858988fcd2b2acfa6e1921b61a9554855a4d4 suspend2-2.2.9.3-for-2.6.20-rc4.patch.bz2 100601 diff --git a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.20_rc6 b/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.20_rc6 deleted file mode 100644 index bab1f7f3d..000000000 --- a/sys-kernel/gentoo-sources/files/digest-gentoo-sources-2.6.20_rc6 +++ /dev/null @@ -1,18 +0,0 @@ -MD5 1f58715f3c5f85bb8b6e14c35b2f4463 fbsplash-0.9.2-r5-2.6.19-rc2.patch 53383 -RMD160 d503285b48eb26c40f782e83abe2254a2f61999f fbsplash-0.9.2-r5-2.6.19-rc2.patch 53383 -SHA256 a89ed8e338c78be2324a42d13944b8dd265f6801aaaf41db61daa4cf6ba9d13f fbsplash-0.9.2-r5-2.6.19-rc2.patch 53383 -MD5 fe41b4be9667240631a13408f0a9a641 ipw3945-1.2.0-2.6.20.patch 616174 -RMD160 befea8ee02a021566687dddf37ab4ea48f6ce590 ipw3945-1.2.0-2.6.20.patch 616174 -SHA256 502d8b8d9ebaf2da9df5ec212a8677c405732d30a1fecb55ed0eb1933ed9badf ipw3945-1.2.0-2.6.20.patch 616174 -MD5 443c265b57e87eadc0c677c3acc37e20 linux-2.6.19.tar.bz2 42733268 -RMD160 75dc65b15cf9cdb359b1abe7084907982c19088b linux-2.6.19.tar.bz2 42733268 -SHA256 c2fd6bcd2b7c1b3d37d64e4d1825703792a75474830a3db7d2dc603a8d392d58 linux-2.6.19.tar.bz2 42733268 -MD5 7c6dca292f886e7f79df72501f7bfac4 patch-2.6.20-rc6.bz2 3800220 -RMD160 00f874acc05e8307f98ad791d3fd27fb767c84a3 patch-2.6.20-rc6.bz2 3800220 -SHA256 7059f5c7cc4cd08152d3775969bf22992de9dda678e1e2dd4c46248883ca1242 patch-2.6.20-rc6.bz2 3800220 -MD5 e0644a5273d0a8a2d9ea4731852bb18d squashfs-3.2-2.6.20.patch 132210 -RMD160 d48bf39a7118b0462867fd43701416e3990227fe squashfs-3.2-2.6.20.patch 132210 -SHA256 cfc7060a0387701834a4a3ae2d95f5f247e02d8c7f88cf45b5004c363c1d0c1d squashfs-3.2-2.6.20.patch 132210 -MD5 733f6acd988a88d853c560a8a8ebe887 suspend2-2.2.9.3-for-2.6.20-rc4.patch.bz2 100601 -RMD160 e89addaac321c00965a2747ee49191627f60c73d suspend2-2.2.9.3-for-2.6.20-rc4.patch.bz2 100601 -SHA256 163e0377bf688b304ae5b8fd736858988fcd2b2acfa6e1921b61a9554855a4d4 suspend2-2.2.9.3-for-2.6.20-rc4.patch.bz2 100601 diff --git a/sys-kernel/gentoo-sources/files/fuse-2.6.1.patch b/sys-kernel/gentoo-sources/files/fuse-2.6.1.patch deleted file mode 100644 index ba0ac8eec..000000000 --- a/sys-kernel/gentoo-sources/files/fuse-2.6.1.patch +++ /dev/null @@ -1,710 +0,0 @@ -diff -Nur linux-2.6.19.orig/fs/fuse/control.c linux-2.6.19/fs/fuse/control.c ---- linux-2.6.19.orig/fs/fuse/control.c 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19/fs/fuse/control.c 2006-12-12 10:44:53.000000000 +0100 -@@ -59,12 +59,12 @@ - return simple_read_from_buffer(buf, len, ppos, tmp, size); - } - --static const struct file_operations fuse_ctl_abort_ops = { -+static struct file_operations fuse_ctl_abort_ops = { - .open = nonseekable_open, - .write = fuse_conn_abort_write, - }; - --static const struct file_operations fuse_ctl_waiting_ops = { -+static struct file_operations fuse_ctl_waiting_ops = { - .open = nonseekable_open, - .read = fuse_conn_waiting_read, - }; -diff -Nur linux-2.6.19.orig/fs/fuse/dev.c linux-2.6.19/fs/fuse/dev.c ---- linux-2.6.19.orig/fs/fuse/dev.c 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19/fs/fuse/dev.c 2006-12-12 10:44:53.000000000 +0100 -@@ -212,7 +212,6 @@ - * Called with fc->lock, unlocks it - */ - static void request_end(struct fuse_conn *fc, struct fuse_req *req) -- __releases(fc->lock) - { - void (*end) (struct fuse_conn *, struct fuse_req *) = req->end; - req->end = NULL; -@@ -641,7 +640,6 @@ - */ - static int fuse_read_interrupt(struct fuse_conn *fc, struct fuse_req *req, - const struct iovec *iov, unsigned long nr_segs) -- __releases(fc->lock) - { - struct fuse_copy_state cs; - struct fuse_in_header ih; -@@ -680,15 +678,14 @@ - * request_end(). Otherwise add it to the processing list, and set - * the 'sent' flag. - */ --static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov, -- unsigned long nr_segs, loff_t pos) -+static ssize_t fuse_dev_readv(struct file *file, const struct iovec *iov, -+ unsigned long nr_segs, loff_t *off) - { - int err; - struct fuse_req *req; - struct fuse_in *in; - struct fuse_copy_state cs; - unsigned reqsize; -- struct file *file = iocb->ki_filp; - struct fuse_conn *fc = fuse_get_conn(file); - if (!fc) - return -EPERM; -@@ -762,6 +759,12 @@ - return err; - } - -+static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov, -+ unsigned long nr_segs, loff_t pos) -+{ -+ return fuse_dev_readv(iocb->ki_filp, iov, nr_segs, &pos); -+} -+ - /* Look up request on processing list by unique ID */ - static struct fuse_req *request_find(struct fuse_conn *fc, u64 unique) - { -@@ -806,15 +809,15 @@ - * it from the list and copy the rest of the buffer to the request. - * The request is finished by calling request_end() - */ --static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov, -- unsigned long nr_segs, loff_t pos) -+static ssize_t fuse_dev_writev(struct file *file, const struct iovec *iov, -+ unsigned long nr_segs, loff_t *off) - { - int err; - unsigned nbytes = iov_length(iov, nr_segs); - struct fuse_req *req; - struct fuse_out_header oh; - struct fuse_copy_state cs; -- struct fuse_conn *fc = fuse_get_conn(iocb->ki_filp); -+ struct fuse_conn *fc = fuse_get_conn(file); - if (!fc) - return -EPERM; - -@@ -890,6 +893,12 @@ - return err; - } - -+static ssize_t fuse_dev_write(struct kiocb *iocb, const struct iovec *iov, -+ unsigned long nr_segs, loff_t pos) -+{ -+ return fuse_dev_writev(iocb->ki_filp, iov, nr_segs, &pos); -+} -+ - static unsigned fuse_dev_poll(struct file *file, poll_table *wait) - { - unsigned mask = POLLOUT | POLLWRNORM; -@@ -1021,7 +1030,7 @@ - return fasync_helper(fd, file, on, &fc->fasync); - } - --const struct file_operations fuse_dev_operations = { -+struct file_operations fuse_dev_operations = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .read = do_sync_read, -diff -Nur linux-2.6.19.orig/fs/fuse/dir.c linux-2.6.19/fs/fuse/dir.c ---- linux-2.6.19.orig/fs/fuse/dir.c 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19/fs/fuse/dir.c 2006-12-12 11:03:13.000000000 +0100 -@@ -141,9 +141,6 @@ - struct fuse_req *forget_req; - struct dentry *parent; - -- /* Doesn't hurt to "reset" the validity timeout */ -- fuse_invalidate_entry_cache(entry); -- - /* For negative dentries, always do a fresh lookup */ - if (!inode) - return 0; -@@ -152,7 +149,7 @@ - req = fuse_get_req(fc); - if (IS_ERR(req)) - return 0; -- -+ - forget_req = fuse_get_req(fc); - if (IS_ERR(forget_req)) { - fuse_put_request(fc, req); -@@ -171,8 +168,7 @@ - if (!err) { - struct fuse_inode *fi = get_fuse_inode(inode); - if (outarg.nodeid != get_node_id(inode)) { -- fuse_send_forget(fc, forget_req, -- outarg.nodeid, 1); -+ fuse_send_forget(fc, forget_req, outarg.nodeid, 1); - return 0; - } - spin_lock(&fc->lock); -@@ -208,18 +204,19 @@ - * Add a directory inode to a dentry, ensuring that no other dentry - * refers to this inode. Called with fc->inst_mutex. - */ --static int fuse_d_add_directory(struct dentry *entry, struct inode *inode) -+static struct dentry *fuse_d_add_directory(struct dentry *entry, -+ struct inode *inode) - { - struct dentry *alias = d_find_alias(inode); -- if (alias) { -+ if (alias && !(alias->d_flags & DCACHE_DISCONNECTED)) { - /* This tries to shrink the subtree below alias */ - fuse_invalidate_entry(alias); - dput(alias); - if (!list_empty(&inode->i_dentry)) -- return -EBUSY; -- } -- d_add(entry, inode); -- return 0; -+ return ERR_PTR(-EBUSY); -+ } else -+ dput(alias); -+ return d_splice_alias(inode, entry); - } - - static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry, -@@ -228,6 +225,7 @@ - int err; - struct fuse_entry_out outarg; - struct inode *inode = NULL; -+ struct dentry *newent; - struct fuse_conn *fc = get_fuse_conn(dir); - struct fuse_req *req; - struct fuse_req *forget_req; -@@ -267,21 +265,22 @@ - - if (inode && S_ISDIR(inode->i_mode)) { - mutex_lock(&fc->inst_mutex); -- err = fuse_d_add_directory(entry, inode); -+ newent = fuse_d_add_directory(entry, inode); - mutex_unlock(&fc->inst_mutex); -- if (err) { -+ if (IS_ERR(newent)) { - iput(inode); -- return ERR_PTR(err); -+ return newent; - } - } else -- d_add(entry, inode); -+ newent = d_splice_alias(inode, entry); - -+ entry = newent ? newent : entry; - entry->d_op = &fuse_dentry_operations; - if (!err) - fuse_change_timeout(entry, &outarg); - else - fuse_invalidate_entry_cache(entry); -- return NULL; -+ return newent; - } - - /* -@@ -1027,6 +1026,8 @@ - if (attr->ia_valid & ATTR_SIZE) { - unsigned long limit; - is_truncate = 1; -+ if (IS_SWAPFILE(inode)) -+ return -ETXTBSY; - limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur; - if (limit != RLIM_INFINITY && attr->ia_size > (loff_t) limit) { - send_sig(SIGXFSZ, current, 0); -@@ -1040,6 +1041,9 @@ - - memset(&inarg, 0, sizeof(inarg)); - iattr_to_fattr(attr, &inarg); -+ /* Defend against future expansion of ATTR_FILE use */ -+ if (S_ISDIR(inode->i_mode)) -+ inarg.valid &= ~FATTR_FH; - req->in.h.opcode = FUSE_SETATTR; - req->in.h.nodeid = get_node_id(inode); - req->in.numargs = 1; -@@ -1074,6 +1078,8 @@ - struct inode *inode = entry->d_inode; - int err = fuse_revalidate(entry); - if (!err) -+ /* FIXME: may want specialized function because of -+ st_blksize on block devices on 2.6.19+ */ - generic_fillattr(inode, stat); - - return err; -@@ -1262,7 +1268,7 @@ - .removexattr = fuse_removexattr, - }; - --static const struct file_operations fuse_dir_operations = { -+static struct file_operations fuse_dir_operations = { - .llseek = generic_file_llseek, - .read = generic_read_dir, - .readdir = fuse_readdir, -diff -Nur linux-2.6.19.orig/fs/fuse/file.c linux-2.6.19/fs/fuse/file.c ---- linux-2.6.19.orig/fs/fuse/file.c 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19/fs/fuse/file.c 2006-12-12 10:44:53.000000000 +0100 -@@ -12,7 +12,7 @@ - #include - #include - --static const struct file_operations fuse_direct_io_file_operations; -+static struct file_operations fuse_direct_io_file_operations; - - static int fuse_send_open(struct inode *inode, struct file *file, int isdir, - struct fuse_open_out *outargp) -@@ -370,21 +370,32 @@ - struct fuse_req *req = data->req; - struct inode *inode = data->inode; - struct fuse_conn *fc = get_fuse_conn(inode); -+ int err; - -- if (req->num_pages && -+ if (req && req->num_pages && - (req->num_pages == FUSE_MAX_PAGES_PER_REQ || - (req->num_pages + 1) * PAGE_CACHE_SIZE > fc->max_read || - req->pages[req->num_pages - 1]->index + 1 != page->index)) { - fuse_send_readpages(req, data->file, inode); -+ req = NULL; -+ } -+ if (!req) { -+ err = -EIO; -+ if (is_bad_inode(inode)) -+ goto out_unlock_page; -+ - data->req = req = fuse_get_req(fc); -- if (IS_ERR(req)) { -- unlock_page(page); -- return PTR_ERR(req); -- } -+ err = PTR_ERR(req); -+ if (IS_ERR(req)) -+ goto out_unlock_page; - } - req->pages[req->num_pages] = page; - req->num_pages ++; - return 0; -+ -+ out_unlock_page: -+ unlock_page(page); -+ return err; - } - - static int fuse_readpages(struct file *file, struct address_space *mapping, -@@ -395,25 +406,17 @@ - struct fuse_readpages_data data; - int err; - -- err = -EIO; -- if (is_bad_inode(inode)) -- goto out; -- - data.file = file; - data.inode = inode; -- data.req = fuse_get_req(fc); -- err = PTR_ERR(data.req); -- if (IS_ERR(data.req)) -- goto out; -+ data.req = NULL; - - err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data); -- if (!err) { -+ if (!err && data.req) { - if (data.req->num_pages) - fuse_send_readpages(data.req, file, inode); - else - fuse_put_request(fc, data.req); - } --out: - return err; - } - -@@ -517,7 +520,8 @@ - - nbytes = min(nbytes, (unsigned) FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT); - npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT; -- npages = min(max(npages, 1), FUSE_MAX_PAGES_PER_REQ); -+ npages = max(npages, 1); -+ npages = min(npages, FUSE_MAX_PAGES_PER_REQ); - down_read(¤t->mm->mmap_sem); - npages = get_user_pages(current, current->mm, user_addr, npages, write, - 0, req->pages, NULL); -@@ -754,7 +758,43 @@ - return err; - } - --static const struct file_operations fuse_file_operations = { -+static sector_t fuse_bmap(struct address_space *mapping, sector_t block) -+{ -+ struct inode *inode = mapping->host; -+ struct fuse_conn *fc = get_fuse_conn(inode); -+ struct fuse_req *req; -+ struct fuse_bmap_in inarg; -+ struct fuse_bmap_out outarg; -+ int err; -+ -+ if (!inode->i_sb->s_bdev || fc->no_bmap) -+ return 0; -+ -+ req = fuse_get_req(fc); -+ if (IS_ERR(req)) -+ return 0; -+ -+ memset(&inarg, 0, sizeof(inarg)); -+ inarg.block = block; -+ inarg.blocksize = inode->i_sb->s_blocksize; -+ req->in.h.opcode = FUSE_BMAP; -+ req->in.h.nodeid = get_node_id(inode); -+ req->in.numargs = 1; -+ req->in.args[0].size = sizeof(inarg); -+ req->in.args[0].value = &inarg; -+ req->out.numargs = 1; -+ req->out.args[0].size = sizeof(outarg); -+ req->out.args[0].value = &outarg; -+ request_send(fc, req); -+ err = req->out.h.error; -+ fuse_put_request(fc, req); -+ if (err == -ENOSYS) -+ fc->no_bmap = 1; -+ -+ return err ? 0 : outarg.block; -+} -+ -+static struct file_operations fuse_file_operations = { - .llseek = generic_file_llseek, - .read = do_sync_read, - .aio_read = generic_file_aio_read, -@@ -769,7 +809,7 @@ - .sendfile = generic_file_sendfile, - }; - --static const struct file_operations fuse_direct_io_file_operations = { -+static struct file_operations fuse_direct_io_file_operations = { - .llseek = generic_file_llseek, - .read = fuse_direct_read, - .write = fuse_direct_write, -@@ -781,12 +821,13 @@ - /* no mmap and sendfile */ - }; - --static const struct address_space_operations fuse_file_aops = { -+static struct address_space_operations fuse_file_aops = { - .readpage = fuse_readpage, - .prepare_write = fuse_prepare_write, - .commit_write = fuse_commit_write, - .readpages = fuse_readpages, - .set_page_dirty = fuse_set_page_dirty, -+ .bmap = fuse_bmap, - }; - - void fuse_init_file_inode(struct inode *inode) -diff -Nur linux-2.6.19.orig/fs/fuse/fuse_i.h linux-2.6.19/fs/fuse/fuse_i.h ---- linux-2.6.19.orig/fs/fuse/fuse_i.h 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19/fs/fuse/fuse_i.h 2006-12-12 10:44:53.000000000 +0100 -@@ -298,6 +298,9 @@ - reply, before any other request, and never cleared */ - unsigned conn_error : 1; - -+ /** Connection successful. Only set in INIT */ -+ unsigned conn_init : 1; -+ - /** Do readpages asynchronously? Only set in INIT */ - unsigned async_read : 1; - -@@ -339,6 +342,9 @@ - /** Is interrupt not implemented by fs? */ - unsigned no_interrupt : 1; - -+ /** Is bmap not implemented by fs? */ -+ unsigned no_bmap : 1; -+ - /** The number of requests waiting for completion */ - atomic_t num_waiting; - -@@ -365,6 +371,9 @@ - - /** Key for lock owner ID scrambling */ - u32 scramble_key[4]; -+ -+ /** Reserved request for the DESTROY message */ -+ struct fuse_req *destroy_req; - }; - - static inline struct fuse_conn *get_fuse_conn_super(struct super_block *sb) -@@ -388,7 +397,7 @@ - } - - /** Device operations */ --extern const struct file_operations fuse_dev_operations; -+extern struct file_operations fuse_dev_operations; - - /** - * Get a filled in inode -diff -Nur linux-2.6.19.orig/fs/fuse/inode.c linux-2.6.19/fs/fuse/inode.c ---- linux-2.6.19.orig/fs/fuse/inode.c 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19/fs/fuse/inode.c 2006-12-12 10:44:53.000000000 +0100 -@@ -39,6 +39,7 @@ - unsigned group_id_present : 1; - unsigned flags; - unsigned max_read; -+ unsigned blksize; - }; - - static struct inode *fuse_alloc_inode(struct super_block *sb) -@@ -205,10 +206,23 @@ - fuse_abort_conn(get_fuse_conn_super(vfsmnt->mnt_sb)); - } - -+static void fuse_send_destroy(struct fuse_conn *fc) -+{ -+ struct fuse_req *req = fc->destroy_req; -+ if (req && fc->conn_init) { -+ fc->destroy_req = NULL; -+ req->in.h.opcode = FUSE_DESTROY; -+ req->force = 1; -+ request_send(fc, req); -+ fuse_put_request(fc, req); -+ } -+} -+ - static void fuse_put_super(struct super_block *sb) - { - struct fuse_conn *fc = get_fuse_conn_super(sb); - -+ fuse_send_destroy(fc); - spin_lock(&fc->lock); - fc->connected = 0; - fc->blocked = 0; -@@ -274,6 +288,7 @@ - OPT_DEFAULT_PERMISSIONS, - OPT_ALLOW_OTHER, - OPT_MAX_READ, -+ OPT_BLKSIZE, - OPT_ERR - }; - -@@ -285,14 +300,16 @@ - {OPT_DEFAULT_PERMISSIONS, "default_permissions"}, - {OPT_ALLOW_OTHER, "allow_other"}, - {OPT_MAX_READ, "max_read=%u"}, -+ {OPT_BLKSIZE, "blksize=%u"}, - {OPT_ERR, NULL} - }; - --static int parse_fuse_opt(char *opt, struct fuse_mount_data *d) -+static int parse_fuse_opt(char *opt, struct fuse_mount_data *d, int is_bdev) - { - char *p; - memset(d, 0, sizeof(struct fuse_mount_data)); - d->max_read = ~0; -+ d->blksize = 512; - - while ((p = strsep(&opt, ",")) != NULL) { - int token; -@@ -345,6 +362,12 @@ - d->max_read = value; - break; - -+ case OPT_BLKSIZE: -+ if (!is_bdev || match_int(&args[0], &value)) -+ return 0; -+ d->blksize = value; -+ break; -+ - default: - return 0; - } -@@ -400,6 +423,8 @@ - void fuse_conn_put(struct fuse_conn *fc) - { - if (atomic_dec_and_test(&fc->count)) { -+ if (fc->destroy_req) -+ fuse_request_free(fc->destroy_req); - mutex_destroy(&fc->inst_mutex); - kfree(fc); - } -@@ -456,6 +481,7 @@ - fc->bdi.ra_pages = min(fc->bdi.ra_pages, ra_pages); - fc->minor = arg->minor; - fc->max_write = arg->minor < 5 ? 4096 : arg->max_write; -+ fc->conn_init = 1; - } - fuse_put_request(fc, req); - fc->blocked = 0; -@@ -500,15 +526,21 @@ - struct dentry *root_dentry; - struct fuse_req *init_req; - int err; -+ int is_bdev = sb->s_bdev != NULL; - - if (sb->s_flags & MS_MANDLOCK) - return -EINVAL; - -- if (!parse_fuse_opt((char *) data, &d)) -+ if (!parse_fuse_opt((char *) data, &d, is_bdev)) - return -EINVAL; - -- sb->s_blocksize = PAGE_CACHE_SIZE; -- sb->s_blocksize_bits = PAGE_CACHE_SHIFT; -+ if (is_bdev) { -+ if (!sb_set_blocksize(sb, d.blksize)) -+ return -EINVAL; -+ } else { -+ sb->s_blocksize = PAGE_CACHE_SIZE; -+ sb->s_blocksize_bits = PAGE_CACHE_SHIFT; -+ } - sb->s_magic = FUSE_SUPER_MAGIC; - sb->s_op = &fuse_super_operations; - sb->s_maxbytes = MAX_LFS_FILESIZE; -@@ -547,6 +579,12 @@ - if (!init_req) - goto err_put_root; - -+ if (is_bdev) { -+ fc->destroy_req = fuse_request_alloc(); -+ if (!fc->destroy_req) -+ goto err_put_root; -+ } -+ - mutex_lock(&fuse_mutex); - err = -EINVAL; - if (file->private_data) -@@ -591,6 +629,14 @@ - return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt); - } - -+static int fuse_get_sb_blk(struct file_system_type *fs_type, -+ int flags, const char *dev_name, -+ void *raw_data, struct vfsmount *mnt) -+{ -+ return get_sb_bdev(fs_type, flags, dev_name, raw_data, fuse_fill_super, -+ mnt); -+} -+ - static struct file_system_type fuse_fs_type = { - .owner = THIS_MODULE, - .name = "fuse", -@@ -598,6 +644,14 @@ - .kill_sb = kill_anon_super, - }; - -+static struct file_system_type fuseblk_fs_type = { -+ .owner = THIS_MODULE, -+ .name = "fuseblk", -+ .get_sb = fuse_get_sb_blk, -+ .kill_sb = kill_block_super, -+ .fs_flags = FS_REQUIRES_DEV, -+}; -+ - static decl_subsys(fuse, NULL, NULL); - static decl_subsys(connections, NULL, NULL); - -@@ -617,24 +671,34 @@ - - err = register_filesystem(&fuse_fs_type); - if (err) -- printk("fuse: failed to register filesystem\n"); -- else { -- fuse_inode_cachep = kmem_cache_create("fuse_inode", -- sizeof(struct fuse_inode), -- 0, SLAB_HWCACHE_ALIGN, -- fuse_inode_init_once, NULL); -- if (!fuse_inode_cachep) { -- unregister_filesystem(&fuse_fs_type); -- err = -ENOMEM; -- } -- } -+ goto out; - -+ err = register_filesystem(&fuseblk_fs_type); -+ if (err) -+ goto out_unreg; -+ -+ fuse_inode_cachep = kmem_cache_create("fuse_inode", -+ sizeof(struct fuse_inode), -+ 0, SLAB_HWCACHE_ALIGN, -+ fuse_inode_init_once, NULL); -+ err = -ENOMEM; -+ if (!fuse_inode_cachep) -+ goto out_unreg2; -+ -+ return 0; -+ -+ out_unreg2: -+ unregister_filesystem(&fuseblk_fs_type); -+ out_unreg: -+ unregister_filesystem(&fuse_fs_type); -+ out: - return err; - } - - static void fuse_fs_cleanup(void) - { - unregister_filesystem(&fuse_fs_type); -+ unregister_filesystem(&fuseblk_fs_type); - kmem_cache_destroy(fuse_inode_cachep); - } - -diff -Nur linux-2.6.19.orig/include/linux/fuse.h linux-2.6.19/include/linux/fuse.h ---- linux-2.6.19.orig/include/linux/fuse.h 2006-11-29 22:57:37.000000000 +0100 -+++ linux-2.6.19/include/linux/fuse.h 2006-12-12 10:44:53.000000000 +0100 -@@ -15,7 +15,7 @@ - #define FUSE_KERNEL_VERSION 7 - - /** Minor version number of this interface */ --#define FUSE_KERNEL_MINOR_VERSION 7 -+#define FUSE_KERNEL_MINOR_VERSION 8 - - /** The node ID of the root inode */ - #define FUSE_ROOT_ID 1 -@@ -92,6 +92,11 @@ - #define FUSE_ASYNC_READ (1 << 0) - #define FUSE_POSIX_LOCKS (1 << 1) - -+/** -+ * Release flags -+ */ -+#define FUSE_RELEASE_FLUSH (1 << 0) -+ - enum fuse_opcode { - FUSE_LOOKUP = 1, - FUSE_FORGET = 2, /* no reply */ -@@ -127,6 +132,8 @@ - FUSE_ACCESS = 34, - FUSE_CREATE = 35, - FUSE_INTERRUPT = 36, -+ FUSE_BMAP = 37, -+ FUSE_DESTROY = 38, - }; - - /* The read buffer is required to be at least 8k, but may be much larger */ -@@ -205,12 +212,13 @@ - struct fuse_release_in { - __u64 fh; - __u32 flags; -- __u32 padding; -+ __u32 release_flags; -+ __u64 lock_owner; - }; - - struct fuse_flush_in { - __u64 fh; -- __u32 flush_flags; -+ __u32 unused; - __u32 padding; - __u64 lock_owner; - }; -@@ -296,6 +304,16 @@ - __u64 unique; - }; - -+struct fuse_bmap_in { -+ __u64 block; -+ __u32 blocksize; -+ __u32 padding; -+}; -+ -+struct fuse_bmap_out { -+ __u64 block; -+}; -+ - struct fuse_in_header { - __u32 len; - __u32 opcode; diff --git a/sys-kernel/gentoo-sources/files/gentoo-sources-2.6.20_rc5-kvm-compile-fix.patch b/sys-kernel/gentoo-sources/files/gentoo-sources-2.6.20_rc5-kvm-compile-fix.patch deleted file mode 100644 index 7e91355ff..000000000 --- a/sys-kernel/gentoo-sources/files/gentoo-sources-2.6.20_rc5-kvm-compile-fix.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -puN kernel/profile.c~kvm-add-vm-exit-profiling-fix kernel/profile.c ---- a/kernel/profile.c~kvm-add-vm-exit-profiling-fix -+++ a/kernel/profile.c -@@ -331,7 +331,6 @@ out: - local_irq_restore(flags); - put_cpu(); - } --EXPORT_SYMBOL_GPL(profile_hits); - - static int __devinit profile_cpu_callback(struct notifier_block *info, - unsigned long action, void *__cpu) -@@ -401,6 +400,8 @@ void profile_hits(int type, void *__pc, - } - #endif /* !CONFIG_SMP */ - -+EXPORT_SYMBOL_GPL(profile_hits); -+ - void profile_tick(int type) - { - struct pt_regs *regs = get_irq_regs(); diff --git a/sys-kernel/gentoo-sources/files/ipw3945-1.1.3_pre2-2.6.18.patch b/sys-kernel/gentoo-sources/files/ipw3945-1.1.3_pre2-2.6.18.patch deleted file mode 100644 index 43203bab0..000000000 --- a/sys-kernel/gentoo-sources/files/ipw3945-1.1.3_pre2-2.6.18.patch +++ /dev/null @@ -1,21620 +0,0 @@ -diff -Nurp linux-2.6.18-gentoo-r4.orig/Documentation/networking/README.ipw3945 linux-2.6.18-gentoo-r4/Documentation/networking/README.ipw3945 ---- linux-2.6.18-gentoo-r4.orig/Documentation/networking/README.ipw3945 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/Documentation/networking/README.ipw3945 2006-11-29 11:19:22.000000000 +0100 -@@ -0,0 +1,998 @@ -+ -+Intel(R) PRO/Wireless 3945ABG Network Connection driver for Linux* in -+support of: -+ -+Intel(R) PRO/Wireless 3945ABG Network Connection Adapter -+Intel(R) PRO/Wireless 3945BG Network Connection Adapter -+ -+Note: The Intel(R) PRO/Wireless 3945ABG Network Connection driver for -+Linux is a unified driver that works on both hardware adapters listed -+above. In this document the Intel(R) PRO/Wireless 3945ABG Network Connection -+driver for Linux will be used to reference the unified driver. -+ -+Copyright (C) 2005 - 2006, Intel Corporation -+ -+README.ipw3945 -+ -+Version: 1.1.3-pre2 -+Date : November 28, 2006 -+ -+ -+Index -+----------------------------------------------- -+0. IMPORTANT INFORMATION BEFORE USING THIS DRIVER -+1. Introduction -+1.1. Overview of Features -+2. Loading the Driver -+3. Feature Details -+3.1. LEDs -+3.2. Association Details -+3.3. Roaming Details -+3.4. Scanning Details -+3.5. Antenna Selection and "Diversity" -+3.6. IEEE 802.11h Details -+3.7. Tx Power -+3.8. Security Details -+3.9. Power Management -+4. Configuring the driver -+4.1. Command Line Parameters -+4.3. Sysfs Helper Files: -+5. Wireless Tools Details -+5.1. iwlist -+5.2. iwpriv -+5.3. iwconfig -+6. Support -+7. License -+ -+ -+=============================================== -+0. IMPORTANT INFORMATION BEFORE USING THIS DRIVER -+=============================================== -+ -+Important Notice FOR ALL USERS OR DISTRIBUTORS!!!! -+ -+Intel wireless LAN adapters are engineered, manufactured, tested, and -+quality checked to ensure that they meet all necessary local and -+governmental regulatory agency requirements for the regions that they -+are designated and/or marked to ship into. Since wireless LANs are -+generally unlicensed devices that share spectrum with radars, -+satellites, and other licensed and unlicensed devices, it is sometimes -+necessary to dynamically detect, avoid, and limit usage to avoid -+interference with these devices. In many instances Intel is required to -+provide test data to prove regional and local compliance to regional and -+governmental regulations before certification or approval to use the -+product is granted. Intel's wireless LAN's EEPROM, firmware, and -+software driver are designed to carefully control parameters that affect -+radio operation and to ensure electromagnetic compliance (EMC). These -+parameters include, without limitation, RF power, spectrum usage, -+channel scanning, and human exposure. -+ -+For these reasons Intel cannot permit any manipulation by third parties -+of the software provided in binary format with the wireless WLAN -+adapters (e.g., the EEPROM and firmware). Furthermore, if you use any -+patches, utilities, or code with the Intel wireless LAN adapters that -+have been manipulated by an unauthorized party (i.e., patches, -+utilities, or code (including open source code modifications) which have -+not been validated by Intel), (i) you will be solely responsible for -+ensuring the regulatory compliance of the products, (ii) Intel will bear -+no liability, under any theory of liability for any issues associated -+with the modified products, including without limitation, claims under -+the warranty and/or issues arising from regulatory non-compliance, and -+(iii) Intel will not provide or be required to assist in providing -+support to any third parties for such modified products. -+ -+Note: Many regulatory agencies consider Wireless LAN adapters to be -+modules, and accordingly, condition system-level regulatory approval -+upon receipt and review of test data documenting that the antennas and -+system configuration do not cause the EMC and radio operation to be -+non-compliant. -+ -+The drivers available for download from SourceForge are provided as a -+part of a development project. Conformance to local regulatory -+requirements is the responsibility of the individual developer. As -+such, if you are interested in deploying or shipping a driver as part of -+solution intended to be used for purposes other than development, please -+obtain a tested driver from Intel Customer Support at: -+ -+http://support.intel.com/support/notebook/sb/CS-006408.htm -+ -+ -+=============================================== -+1. Introduction -+=============================================== -+The following sections attempt to provide a brief introduction to using -+the Intel(R) PRO/Wireless 3945ABG driver for Linux. -+ -+This document is not meant to be a comprehensive manual on -+understanding or using wireless technologies, but should be sufficient -+to get you moving without wires on Linux. -+ -+For information on building and installing the driver, see the INSTALL -+file. -+ -+ -+1.1. Overview of Features -+----------------------------------------------- -+The current release (1.1.3-pre2) supports the following features: -+ -++ BSS mode (Infrastructure, Managed) -++ IBSS mode (Ad-Hoc) -++ WEP (OPEN and SHARED KEY mode) -++ 802.1x EAP via wpa_supplicant and xsupplicant -++ 802.11i (WPA/WPA2) -++ Wireless Extension support -++ Full B and G rate support -++ Full A rate support (ABG only) -++ Transmit power control -++ S state support (ACPI suspend/resume) -+ -+The following features are currently enabled, but not officially -+supported: -+ -++ QoS -++ Monitor mode (aka RFMon) -++ Associated RF promiscuous mode -++ Frame Rx simulation -+ -+The distinction between officially supported and enabled is a reflection -+of the amount of validation and interoperability testing that has been -+performed on a given feature. Note: in addition, the features may not have -+all of the code in the driver to fully enable the feature. -+ -+ -+=============================================== -+2. Loading the Driver -+=============================================== -+ -+See the INSTALL document for information on installing the driver. -+ -+Once installed, a typical method for launching the driver and the -+regulatory daemon is via the load script provided in the source package: -+ -+ # ./load debug=0x43fff <--- You need to be root for this -+ -+NOTE: You will not be able to rmmod the driver so long as the -+ipw3945d daemon is running. -+ -+If you followed the steps of the INSTALL document to set up your -+modprobe.conf, you can load the module by simply running: -+ -+ # modprobe ipw3945 <--- You need to be root for this -+ -+If you did not configure your modprobe.conf to automatically launch the -+regulatory daemon (see INSTALL), you must do so manually after loading -+the module: -+ -+ # /sbin/ipw3945d <--- You need to be root for this* -+ -+* See README.ipw3945d (provided in the regulatory daemon package) for -+ information on how to configure the system to run the regulatory -+ daemon as a non-root user. -+ -+If you want to unload the module (and kill the deamon as well), you can -+simply use the unload script: -+ -+ # ./unload <--- You need to be root for this -+ -+or likewise if you configured modprobe.conf: -+ -+ # modprobe -r ipw3945 <--- You need to be root for this -+ -+If you did not configure modprobe.conf to unload the regulatory daemon -+and are not using the unload script, you need to kill the regulatory -+daemon before you will be able to unload the module: -+ -+ # /sbin/ipw3945d --kill <--- You need to be root for this -+ # modprobe -r ipw3945 -+ -+ -+=============================================== -+3. Feature Details -+=============================================== -+ -+3.1. LEDs -+----------------------------------------------- -+ -+The driver will attempt to control the wireless LED, if one is -+configured in hardware. There are typically two LEDs: -+ -+ Activity -- used to indicate wireless activity -+ Link -- used to indicate wireless link -+ -+The LED blink states can be interpreted as: -+ -+ Link -+ -+ Off -- Radio OFF -+ Long off, long on -- Unassociated -+ Short off, short on -- Scanning -+ Solid on -- Associated -+ Intermittent off -- Attempting to roam -+ -+ Activity -+ -+ Off -- No network activity -+ Blinking -- Speed of blink correlates to speed of -+ Tx/Rx -+ -+NOTE: In configurations where there is only one LED, the states may be -+overlaid -- for example, while no data is being transferred while -+associated, the LED may be solid. When data is being transferred it may -+blink according to the data transfer speed. -+ -+ -+3.2. Association Details -+----------------------------------------------- -+ -+The driver is configured to only attempt association once you have -+specified the ESSID for the network to associate with. You can -+override this behavior by providing the associate=1 module parameter. -+ -+See the section 'Command Line Parameters' for more information. -+ -+ -+3.3. Roaming Details -+----------------------------------------------- -+ -+Roaming criteria is based on missed beacons. Once a given number of -+beacons have been missed, the STA will look for an alternate AP on the -+same network (ESSID and CHANNEL). If one with a stronger signal is -+found, it will attempt a re-association with the new AP. -+ -+ -+3.4. Scanning Details -+----------------------------------------------- -+ -+Active / Passive scanning is controlled by the regulatory daemon. -+The driver can request to invoke active scanning on any channel, -+but only those channels currently allowing active scanning will -+be allowed to actually send probe requests. -+ -+ -+3.5. Antenna Selection and "Diversity" -+----------------------------------------------- -+ -+If you use only one antenna, you should manually select it via the -+"antenna" load parameter, or via /sys/bus/pci/drivers/ipw3945/00*/antenna. -+ -+Modes are: -+0: Diversity ... NIC selects best antenna by itself (this is the default) -+1: Main antenna only -+2: Aux antenna only -+ -+ -+3.6. IEEE 802.11h Details -+----------------------------------------------- -+ -+Only BASIC reporting is supported; CCA and RPI are optional and not -+implemented. The driver currently does not respond with the appropriate -+refusal frame if it receives a request that it will not provide a -+report for. -+ -+ Received TPC Request's will result in a TPC report being transmitted. -+ -+Channel Switch is currently supported; a received channel switch will -+result in the channel switching. -+ -+ The STA will not perform measurements requested by other STAs. -+ -+IBSS is not supported on channels marked passive-only. -+ -+The use of IBSS networks (starting or joining) on channels marked as -+radar spectrum is also not supported. -+ -+The user can manually control the transmit power control via the -+iwconfig txpower command (see below for details on behavior of the -+txpower command with this driver). -+ -+ -+3.7. Tx Power -+----------------------------------------------- -+ -+Through the use of the wireless tools, you can set an upper limit on -+the maximum transmit power to use. When unassociated, the driver -+defaults to reporting the Tx power of the maximum transmit power supported -+by any of the channels. For example, if one channel supports 16dBm and the -+rest support only 14dBm, upon loading the driver the reported Tx power -+level will be set to 'auto' with a level of '16dBm'. Attempts to -+set the Tx power above 16dBm will be clamped by the driver. -+ -+When tuning to a channel, if no user limit has been configured, the driver -+will set the transmit power to the maximum supported by that channel. -+The wireless tools will report 'auto' with that level. -+ -+If you configure a maximum value, the wireless tools will report 'fixed' -+and the value you specified if unassociated. If you are associated, the -+driver will use and report the lesser of either the limit provided or the -+limit configured for that channel in the hardware. -+ -+After setting the transmit power level limit via Tx power both scan probe -+requests and data packets will be clamped to this level. If you attempt -+to provide a value outside of the supported range (-12dBm to the maximum -+supported by your SKU, typically in the range of 14dBm to 17dBm) that -+value will be automatically clamped. -+ -+Scan probe requests have a lower bound of 0dBm. If you set a value -+below 0dBm, that value will be used for other packets, but scan requests -+will be set to 0dBm. -+ -+ -+3.8. Security Details -+----------------------------------------------- -+ -+The driver currently supports WEP (64 and 128) as well as 802.1x, WPA, -+and WPA2 with the use of wpa_supplicant. If you are using a newer -+kernel with Wireless Extensions > 18, then you should use a newer -+version of wpa_supplicant and the -Dext driver. If you are using an -+older kernel, you should use wpa_supplicant and the -Dipw driver. -+ -+Users have reported problems using older (0.3.x) versions of -+wpa_supplicant with various authentication modes (WPA PSK, etc.). -+If you experience problems using wpa_supplicant, please upgrade to the -+latest version of the supplicant (0.4.6 or newer). -+ -+ -+3.9. Power Management -+----------------------------------------------- -+The Intel PRO/Wireless 3945ABG Network Connection driver for Linux -+supports the configuration of the Power Save Protocol through a private -+wireless extension interface. The driver supports the following -+different modes: -+ -+ 0 AC - Always ON -+ 1-5 Different levels of power management. The higher the -+ Number, the greater the power savings, but with an impact to -+ packet latencies. -+ 6 AC - Always ON -+ 7 BATTERY - Default setting for battery mode -+ >7 AC - Always ON -+ -+Power management works by powering down the radio after a certain -+interval of time has passed where no packets are passed through the -+radio. Once powered down, the radio remains in that state for a given -+period of time. For higher power savings, the interval between last -+packet processed to sleep is shorter and the sleep period is longer. -+ -+When the radio is asleep, the access point sending data to the station -+must buffer packets at the AP until the station wakes up and requests -+any buffered packets. If you have an AP that does not correctly support -+the PSP protocol you may experience packet loss or very poor performance -+while power management is enabled. If this is the case, you will need -+to try to find a firmware update for your AP, or disable power -+management (via `iwconfig eth1 power off`) -+ -+To configure the power level on the Intel PRO/Wireless 3945ABG Network -+Connection driver for Linux, you must use the iwpriv set_power command: -+ -+Setting the power management on and off via 'iwconfig power' is not -+currently supported by the driver. -+ -+ iwpriv set_power 1-5 Set the power level as specified. -+ iwpriv set_power 7 Set power level to default BATTERY level. -+ -+Setting the power level to any other value (0, 6, >7) will result in setting -+the device into AC mode with Power Management disabled. -+ -+If you explicitly set AC mode, the radio will always be on, however because -+you have set a specific mode, it will still show as 'Power Management: on' -+via wireless tools. -+ -+You can view the current power level setting via: -+ -+ iwpriv get_power -+ -+It will return the current period or timeout that is configured as a string -+in the form of xxxx/yyyy (z) where xxxx is the timeout interval (amount of -+time after packet processing), yyyy is the period to sleep (amount of time -+to wait before powering the radio and querying the access point for buffered -+packets), and z is the 'power level'. -+ -+If the adapter was configured to a mode outside the range 1-7, the value -+6 (AC) will be displayed followed by the text OFF to indicate a value -+outside of the Power Management range was specified. -+ -+If the adapter is configured to any mode 1-7 then the wireless tool will -+report 'Power Management: on'. If the mode is set to 0 or > 7, the -+wireless tools will report 'Power Management: off'. -+ -+ -+=============================================== -+4. Configuring the driver -+=============================================== -+ -+4.1. Command Line Parameters -+----------------------------------------------- -+ -+Like many modules used in the Linux kernel, the Intel(R) PRO/Wireless -+3945ABG driver for Linux allows configuration options to be provided -+as module parameters. The most common way to specify a module parameter -+is via the command line. -+ -+The general form is: -+ -+% modprobe ipw3945 parameter=value -+ -+ antenna -+ Select antenna to use. If both antennas are used, antenna -+ selection is handled by the driver and microcode. -+ -+ 1 = Main, 2 = Aux. Default is 0 [both] -+ -+ associate -+ Set to 0 to disable the auto scan-and-associate functionality of the -+ driver. If disabled, the driver will not attempt to scan -+ for and associate to a network until it has been configured with -+ one or more properties for the target network, for example -+ configuring the network SSID. -+ -+ 0 = only scan and associate once configured, -+ 1 = auto scan and associate. -+ Default 0 [do nothing until configured] -+ -+ auto_create -+ Set to 0 to disable the auto creation of an ad-hoc network -+ matching the channel and network name parameters provided. -+ -+ 0 = do not attempt to create ad-hoc network -+ 1 = automatically create ad-hoc network once configured -+ -+ Default is 1 [auto create]. -+ -+ channel -+ channel number for association. The normal method for setting -+ the channel would be to use the standard wireless tools -+ (i.e. `iwconfig eth1 channel 10`), but it is useful sometimes -+ to set this while debugging. Channel 0 means 'ANY' -+ -+ For information on which channels are available, see the 'channels' -+ sysfs entry (documented below). -+ -+ Default is 0 [ANY]. -+ -+ debug -+ If using a debug build, this is used to control the amount of debug -+ info is logged. See the 'dvals' and 'load' script for more info on -+ how to use this. -+ -+ The dvals and load scripts are provided in the ipw3945-1.1.3-pre2.tgz -+ development snapshot releases available from the SourceForge -+ project at http://ipw3945.sf.net) -+ -+ NOTE: This entry is only available if CONFIG_IPW3945_DEBUG is -+ enabled. -+ -+ disable -+ Manually disable the radio (software RF kill). This parameter -+ allows you to configure the syfs rf_kill setting to turn on -+ software based RF kill. You must clear out the sysfs entry in -+ order to turn the radio on if this parameter is provided. -+ -+ For additional details on the rf_kill sysfs entry see the section -+ on sysfs below. -+ -+ 0 = Radio ON, 1 = Radio OFF. Default is 0 [Radio ON] -+ -+ led -+ Can be used to turn on LED code. -+ -+ 0 = Off, 1 = On. Default is 1 [LED On]. -+ -+ mode -+ Can be used to set the default mode of the adapter. -+ -+ 0 = Managed, 1 = Ad-Hoc, 2 = Monitor. Default is 0 [Managed] -+ -+ NOTE: Monitor is only available if CONFIG_IPW3945_MONITOR is -+ enabled. -+ -+ If CONFIG_IPW3945_QOS is enabled: -+ -+ qos_enable -+ -+ Enable all Qos functionality. -+ -+ 0 = disable, 1 = enable. Default is 0 [disabled] -+ -+ qos_burst_enable -+ -+ Enable QoS burst mode. -+ -+ 0 = disable, 1 = enable. Default is 0 [disabled] -+ -+ qos_no_ack_mask -+ -+ Mask transmit queue to not ACK. Currently not used. -+ -+ qos_burst_CCK -+ -+ Duration of burst for CCK (802.11B) frames. -+ -+ Default = 0 -+ -+ qos_burst_OFDM -+ -+ Duration of burst for OFDM (802.11A/G) frames. -+ -+ Default = 0. -+ -+ If CONFIG_IPW3945_PROMISCUOUS is enabled: -+ -+ rtap_iface -+ Set to 1 to create a promiscuous radiotap interface. This -+ interface will be set to type ARPHRD_IEEE80211_RADIOTAP and will -+ be passed every frame received over the air by the adapter. -+ -+ Default = 0. -+ -+ -+4.3. Sysfs Helper Files: -+----------------------------------------------- -+ -+The Linux kernel provides a pseudo file system that can be used to -+access various components of the operating system. The Intel(R) -+PRO/Wireless 3945ABG Network Connection driver for Linux exposes -+several configuration parameters through this mechanism. -+ -+An entry in the sysfs can support reading and/or writing. You can -+typically query the contents of a sysfs entry through the use of cat, -+and can set the contents via echo. For example: -+ -+ % cat /sys/bus/pci/drivers/ipw3945/debug_level -+ -+Will report the current debug level of the driver's logging subsystem -+(only available if CONFIG_IPW_DEBUG was configured when the driver was -+built). -+ -+You can set the debug level via: -+ -+ % echo $VALUE > /sys/bus/pci/drivers/ipw3945/debug_level -+ -+Where $VALUE would be a number in the case of this sysfs entry. The -+input to sysfs files does not have to be a number. For example, the -+firmware loader used by hotplug utilizes sysfs entries for transfering -+the firmware image from user space into the driver. -+ -+The Intel(R) PRO/Wireless 3945ABG Network Connection driver for Linux -+exposes sysfs entries at two levels -- driver level, which apply to all -+instances of the driver (in the event that there is more than one device -+installed) and device level, which applies only to the single specific -+instance. -+ -+ -+4.3.1 Driver Level Sysfs Helper Files -+ -+For the driver level files, look in /sys/bus/pci/drivers/ipw3945/ -+ -+ If CONFIG_IPW3945_DEBUG is enabled: -+ -+ debug_level -+ -+ This controls the same global as the 'debug' module parameter -+ -+ -+ -+4.3.2 Device Level Sysfs Helper Files -+ -+For the device level files, look in -+ -+ /sys/bus/pci/drivers/ipw3945/{PCI-ID}/ -+ -+For example: -+ /sys/bus/pci/drivers/ipw3945/0000:02:01.0 -+ -+For the device level files, see /sys/bus/pci/drivers/ipw3945: -+ -+ rf_kill -+ read - -+ 0 = RF kill not enabled (radio on) -+ 1 = SW based RF kill active (radio off) -+ 2 = HW based RF kill active (radio off) -+ 3 = Both HW and SW RF kill active (radio off) -+ -+ write - -+ 0 = If SW based RF kill active, turn the radio back on -+ 1 = If radio is on, activate SW based RF kill -+ -+ NOTE: If you enable the SW based RF kill and then toggle the HW -+ based RF kill from ON -> OFF -> ON, the radio will NOT come back on -+ -+ led -+ read - -+ 0 = LED code disabled -+ 1 = LED code enabled -+ write - -+ 0 = Disable LED code -+ 1 = Enable LED code -+ -+ NOTE: The LED code has been reported to hang some systems when -+ running ifconfig and is therefore disabled by default. -+ -+ scan_age -+ read - -+ Maximum age of a usable network in milliseconds -+ -+ write - -+ Maximum age of a usable network in milliseconds. For example: -+ -+ # echo 15000 > /sys/bus/pci/drivers/ipw3945/*/scan_age -+ -+ will set a maximum age of 15 seconds. The default as of -+ ieee80211-1.1.12 was 15 seconds. Some users find setting this to -+ 60 seconds is more appropriate. -+ -+ channels -+ read - -+ -+ Used to provide details on the channel capabilities enabled -+ by the adapter. -+ -+ Example: -+ -+ % cat /sys/bus/pci/drivers/ipw3945/*/channels -+ -+ Displaying 13 channels in 2.4Ghz band (802.11bg): -+ 1: 17dBm: BSS, IBSS, active/passive. -+ 2: 17dBm: BSS, IBSS, active/passive. -+ ... -+ 11: 17dBm: BSS, IBSS, active/passive. -+ 12: 17dBm: BSS, passive only. -+ 13: 17dBm: BSS, passive only. -+ Displaying 19 channels in 5.2Ghz band (802.11a): -+ 36: 17dBm: BSS, IBSS, active/passive. -+ ... -+ 48: 17dBm: BSS, IBSS, active/passive. -+ 52: 17dBm: BSS (radar spectrum), passive only. -+ ... -+ 136: 17dBm: BSS (radar spectrum), passive only. -+ 140: 17dBm: BSS (radar spectrum), passive only. -+ -+ For channels marked where ad-hoc is not supported (IBSS is not -+ listed), you can neither join or create an IBSS (ad-hoc) network -+ on that channel. -+ -+ If CONFIG_IPW3945_PROMISCUOUS is enabled: -+ -+ rtap_iface -+ Set to 1 to create a promiscuous radiotap interface. This -+ interface will be set to type ARPHRD_IEEE80211_RADIOTAP and will -+ be passed every frame received over the air by the adapter. -+ -+ Set to 0 to remove the created interface. -+ -+ If an interface is configured, reading the entry will provide -+ the name of the interface, for example 'rtap0'. If no interface -+ is created, -1 will be returned. -+ -+ If CONFIG_IPW3945_SIM_RX is enabled: -+ -+ rx -+ This is a write-only entry. The driver expects a binary blob -+ to be passed to this entry in radiotap header format. The -+ driver will parse that format and configure an internal -+ structure as if the frame had been received over the air. It -+ will then be passed to the driver, simulating reception of the -+ frame. -+ -+ For a sample application that writes to this file, see -+ -+ http://ipw3945.sf.net/sim_rx.c -+ -+ -+=============================================== -+5. Wireless Tools Details -+=============================================== -+ -+Due to an issue in handling 64-bit integers in the v28 based versions of -+the wireless tools, we recommend that only wireless tools based on v29 be -+used on 64-bit platforms. -+ -+5.1. iwlist -+----------------------------------------------- -+ -+If a wireless tool command is not described below, please see the -+iwlist man page for details. -+ -+5.1.1. iwlist scan -+ -+The wireless tools default to only waiting 2 seconds between requesting -+a scan and reporting the scan results. In some hardware configurations, -+two seconds is not long enough to rotate through all of the available -+channels looking for valid networks. As such, you may find better -+results by running iwlist scan once, then waiting a few seconds and -+running it again. For example: -+ -+ % iwlist scan 2>&1>/dev/null & sleep 3 ; iwlist scan -+ -+While associated, the scan results can take substantially longer to return -+as the driver is limited on how long it can be away from the currently -+associated channel without impacting packet transmission. As such, -+you may need to run the command several times to see all networks. -+ -+You can also try increasing the maximum age of a network reported by the -+ieee80211 subsystem via the scan_age sysfs entry. -+ -+5.1.2. iwlist freq/channel -+ -+This will list all of the channels that can be used -+with the current hardware card. There are various versions of the -+Intel PRO/Wireless 3945ABG Network Connection for different geographies. -+The results seen on one computer may not match the results seen on another -+computer with a different geography card. -+ -+'iwlist freq' will show you the list of supported channels, but it does -+not provide any indication of what type of spectrum management may be -+enabled for a given channel. -+ -+You can view the regulatory requirements for your adapter by examining -+the contents of the 'channels' sysfs entry as described under -+channels in the Device Level Sysfs Helper Files section of this document. -+ -+5.1.3. iwlist bitrate/rate -+ -+Returns the list of supported Tx data rates sorted by modulation and then -+speed. Modulation is sorted by CCK rates first, then OFDM. -+ -+5.1.4. iwlist power -+ -+See section on Power Management. -+ -+5.1.5. iwlist txpower -+ -+See section on Tx Power. -+ -+5.1.6. iwlist ap/accesspoints/peer -+ -+Deprecated. See iwlist man page. -+ -+5.2. iwpriv -+----------------------------------------------- -+ -+As an interface designed to handle generic hardware, there are certain -+capabilities not exposed through the normal Wireless Tool interface. As -+such, a provision is provided for a driver to declare custom, or -+private, methods. The Intel(R) PRO/Wireless 3945ABG Network Connection -+driver for Linux defines several of these to configure various settings. -+ -+The general form of using the private wireless methods is: -+ -+ % iwpriv $IFNAME method parameters -+ -+Where $IFNAME is the interface name the device is registered with -+(typically eth1, customized via one of the various network interface -+name managers, such as ifrename) -+ -+The supported private methods are: -+ -+ get_mode -+ Can be used to report out which IEEE 802.11 mode the driver is -+ configured to support. Example: -+ -+ % iwpriv eth1 get_mode -+ eth1 get_mode:802.11abg (7) -+ -+ set_mode -+ Can be used to configure which IEEE 802.11 mode the driver will -+ support. -+ -+ Usage: -+ % iwpriv eth1 set_mode {mode} -+ Where {mode} is a number in the range 1-7: -+ 1 802.11a (ABG only) -+ 2 802.11b -+ 3 802.11ab (ABG only) -+ 4 802.11g -+ 5 802.11ag (ABG only) -+ 6 802.11bg -+ 7 802.11abg (ABG only) -+ -+ get_preamble -+ Can be used to report configuration of preamble length. -+ -+ set_preamble -+ Can be used to set the configuration of preamble length: -+ -+ Usage: -+ % iwpriv eth1 set_preamble {mode} -+ Where {mode} is one of: -+ 1 Long preamble only -+ 0 Auto (long or short based on connection) -+ -+ set_power -+ get_power -+ -+ See Power Management section. -+ -+ -+5.3. iwconfig -+----------------------------------------------- -+ -+If a wireless tool command is not described below, please see the -+iwconfig man page for details. -+ -+5.3.1. iwconfig nwid/domain -+ -+Not supported. -+ -+5.3.2. iwconfig freq/channel -+ -+See iwconfig man page for general description. -+ -+Once configured, the adapter will only use the channel or frequency -+specified, if valid for the current hardware configuration. You -+can set the adapter back to use any channel by specifying '0' as the -+channel. -+ -+5.3.3. iwconfig sens -+ -+Not supported. -+ -+5.3.4. iwconfig mode -+ -+See iwconfig man page for general description. -+ -+Current modes supported: Ad-Hoc and Managed (Auto) -+Current modes enabled but untested: Monitor -+Current modes unsupported: Master, Repeater, Secondary. -+ -+If you configure the adapter to be locked to a specific channel or network -+while in one mode, those settings will remain in effect when you switch -+modes. For example: -+ -+ % iwconfig eth1 mode ad-hoc channel 3 essid Flubox -+ % iwconfig eth1 mode managed -+ -+The device will still be configured to only associate with the network -+'Flubox' on channel '3'. You can reset this via: -+ -+ % iwconfig eth1 channel 0 essid any ap any -+ -+5.3.5. iwconfig frag -+ -+See iwconfig man page for general information. -+ -+The 'auto' fragmentaton mode is not supported by the driver. -+You can set an explicit fragmentation threshold or turn fragmentation off. -+Attempts to set the fragmentation threshold to 'auto' will return an error -+from iwconfig. -+ -+5.3.6. iwconfig power -+ -+See Power Management section. -+ -+5.3.7. iwconfig txpower -+ -+See iwconfig man page for general information. -+ -+If you wish to set an upper limit on the transmit power -+used by the adapter in dBm do not postfix a unit of measurement to the -+parameter. For example: -+ -+ % iwconfig eth1 txpower 10 -+ -+will set the upper limit to 10dBm. If you provide the unit 'dBm', the -+wireless tools will erroneously convert the value as if it were provided -+in watts. -+ -+See Tx Power section for more details. -+ -+5.3.8. iwconfig commit -+ -+Not needed/supported. -+ -+5.3.9. iwconfig rts -+ -+Setting the RTS threshold value is configured to match the IEEE 802.11 -+specification. -+ -+Setting the RTS value to: -+ -+ * 0 will use RTS for all unicast data/mgmt packets. -+ * greater than the maximum MSDU (2304) will not use RTS for any -+ unicast data/mgmt packets. -+ * greater than 2347 or less than 0 will return an error. -+ * all other values will result in RTS for unicast data/mgmt -+ frames if the MPDU is greater than the RTS. -+ -+The RTS threshold defaults to 2347 (resulting in no RTS usage). -+ -+6. Support -+----------------------------------------------- -+ -+For general development information and support, go to: -+ -+ http://ipw3945.sf.net/ -+ -+Stable releases can be downloaded from: -+ -+ http://support.intel.com -+ -+For installation support on the Intel PRO/Wireless 3945ABG Network Connection -+driver (stable versions) on Linux kernels 2.6.13 or later, email support is -+available from: -+ -+ http://supportmail.intel.com -+ -+ -+7. License -+----------------------------------------------- -+ -+With the exception of the file ipw3945_daemon.h, all of the files -+in this archive are licensed under the terms of version 2 of the GNU -+General Public License as published by the Free Software Foundation. -+ -+The file ipw3945_daemon.h is provided under a dual BSD/GPLv2 license. -+When using or redistributing this file, you may do so under either -+license. -+ -+GPL LICENSE SUMMARY -+ -+ Copyright(c) 2005 - 2006 Intel Corporation. All rights reserved. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of version 2 of the GNU General Public License as -+ published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, but -+ WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, -+ USA -+ -+ The full GNU General Public License is included in this distribution -+ in the file called LICENSE.GPL. -+ -+ Contact Information: -+ James P. Ketrenos -+ Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 -+ -+BSD LICENSE -+ -+ Copyright(c) 2005 - 2006 Intel Corporation. All rights reserved. -+ All rights reserved. -+ -+ Redistribution and use in source and binary forms, with or without -+ modification, are permitted provided that the following conditions -+ are met: -+ -+ * Redistributions of source code must retain the above copyright -+ notice, this list of conditions and the following disclaimer. -+ * Redistributions in binary form must reproduce the above copyright -+ notice, this list of conditions and the following disclaimer in -+ the documentation and/or other materials provided with the -+ distribution. -+ * Neither the name of Intel Corporation nor the names of its -+ contributors may be used to endorse or promote products derived -+ from this software without specific prior written permission. -+ -+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+ AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ -+------------------------------ -+Copyright (C) 2005 - 2006, Intel Corporation -+ -+INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. -+EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, -+INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR -+IMPLIED WARRANTY RELATING TO SALE AND/OR USE OF INTEL PRODUCTS, INCLUDING -+LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, -+MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT, OR OTHER -+INTELLECTUAL PROPERTY RIGHT. -+ -+This document is subject to change without notice. -+ -+* Other names and brands may be claimed as the property of others. -+ -+ -diff -Nurp linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/ipw3945.c linux-2.6.18-gentoo-r4/drivers/net/wireless/ipw3945.c ---- linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/ipw3945.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/drivers/net/wireless/ipw3945.c 2006-11-29 11:19:22.000000000 +0100 -@@ -0,0 +1,16789 @@ -+/****************************************************************************** -+ -+ Copyright(c) 2003 - 2006 Intel Corporation. All rights reserved. -+ -+ 802.11 status code portion of this file from ethereal-0.10.6: -+ Copyright 2000, Axis Communications AB -+ Ethereal - Network traffic analyzer -+ By Gerald Combs -+ Copyright 1998 Gerald Combs -+ -+ This program is free software; you can redistribute it and/or modify it -+ under the terms of version 2 of the GNU General Public License as -+ published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -+ more details. -+ -+ You should have received a copy of the GNU General Public License along with -+ this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA -+ -+ The full GNU General Public License is included in this distribution in the -+ file called LICENSE. -+ -+ Contact Information: -+ James P. Ketrenos -+ Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 -+ -+******************************************************************************/ -+ -+/* -+ * -+ * About the threading and lock model of the driver... -+ * -+ * There are three paths of execution through the driver. -+ * -+ * 1. ioctl based (wireless extensions, netdev, etc.) -+ * 2. interrupt based -+ * 3. scheduled work queue items -+ * -+ * As soon as an interrupt comes in, it schedules a tasklet. That tasklet, -+ * when run, does any HW checks, pulls any data from the read queue, -+ * and schedules other layers to do the actual work. -+ * -+ * About scanning -+ * -+ * There are several states related to scanning: -+ * !STATUS_SCANNING -- no scan requests, no active scan -+ * -+ * The states can transition as follows: -+ * -+ * !STATUS_SCANNING => (SCANNING_DIRECT | SCANNING_INDIRECT) -+ * SCANNING_DIRECT => (SCANNING_INDIRECT | !STATUS_SCANNING) -+ * SCANNING_INDIRECT => !STATUS_SCANNING -+ * -+ * Each band requires a seperate scan request. This means that in a -+ * configuration where the user has specified an ESSID in an ABG network, -+ * we need to execute 4 scan passes -- one for each band (2.4 or 5.2) and -+ * then again with each band one directed and one indirect. -+ * -+ */ -+#include -+#include -+#include -+ -+#include "ipw3945.h" -+ -+#ifndef IPW3945_COMPAT -+#error Incomplete build system. If you are building as part of your kernel build -+#error process, ensure that you used 'make patch_kernel' to install into your kernel. -+#endif -+ -+#ifdef CONFIG_IPW3945_DEBUG -+#define VD "d" -+#else -+#define VD -+#endif -+ -+#ifdef CONFIG_IPW3945_MONITOR -+#define VM "m" -+#else -+#define VM -+#endif -+ -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+#define VP "p" -+#else -+#define VP -+#endif -+ -+#ifdef CONFIG_IEEE80211_RADIOTAP -+#define VR "r" -+#else -+#define VR -+#endif -+ -+#ifdef CONFIG_IPW3945_QOS -+#define VQ "q" -+#else -+#define VQ -+#endif -+ -+#define IPW3945_VERSION "1.1.3-pre2" VD VM VP VR VQ -+ -+#define DRV_DESCRIPTION "Intel(R) PRO/Wireless 3945 Network Connection driver for Linux" -+#define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation" -+#define DRV_VERSION IPW3945_VERSION -+ -+MODULE_DESCRIPTION(DRV_DESCRIPTION); -+MODULE_VERSION(DRV_VERSION); -+MODULE_AUTHOR(DRV_COPYRIGHT); -+MODULE_LICENSE("GPL"); -+ -+#ifdef CONFIG_IPW3945_DEBUG -+static int debug = 0; -+#endif -+static int channel = 0; -+static int mode = 0; -+ -+static u32 ipw_debug_level; -+static int associate = 0; /* def: don't assoc until user sets assoc parms */ -+static int auto_create = 1; /* def: create new adhoc network if needed */ -+static int led = 1; /* def: use LEDs */ -+static int disable = 0; /* def: enable radio */ -+static int antenna = 0; /* def: 0 = both antennas (use diversity) */ -+static const char ipw_modes[] = { -+ 'a', 'b', 'g', '?' -+}; -+ -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+static int rtap_iface = 0; /* def: 0 -- do not create rtap interface */ -+#endif -+ -+#define LD_TIME_LINK_ON 300 -+ -+static int from_priority_to_tx_queue[] = { -+ IPW_TX_QUEUE_1, IPW_TX_QUEUE_2, IPW_TX_QUEUE_2, -+ IPW_TX_QUEUE_1, -+ IPW_TX_QUEUE_3, IPW_TX_QUEUE_3, IPW_TX_QUEUE_4, IPW_TX_QUEUE_4 -+}; -+ -+static int ipw_rate_scale_init_handle(struct ipw_priv *priv, s32 window_size); -+ -+static int ipw_update_power_cmd(struct ipw_priv *priv, -+ struct ipw_powertable_cmd *cmd, u32 mode); -+static int ipw_power_init_handle(struct ipw_priv *priv); -+ -+static int ipw_queue_tx_hcmd(struct ipw_priv *priv, struct ipw_host_cmd *cmd); -+ -+static int ipw_update_rate_scaling(struct ipw_priv *priv, u8 mode); -+ -+static int ipw_rate_scale_tx_resp_handle(struct ipw_priv *priv, -+ struct ipw_tx_resp *tx_resp); -+ -+static int ipw_rate_scale_rxon_handle(struct ipw_priv *priv, s32 sta_id); -+static u8 ipw_find_station(struct ipw_priv *priv, u8 * bssid); -+static void ipw_clear_stations_table(struct ipw_priv *priv); -+ -+static int ipw_rx_queue_update_write_ptr(struct ipw_priv *priv, -+ struct ipw_rx_queue *q); -+static int ipw_tx_queue_update_write_ptr(struct ipw_priv *priv, -+ struct ipw_tx_queue *txq, int tx_id); -+ -+#define SLP PMC_TCMD_FLAG_DRIVER_ALLOW_SLEEP_MSK -+ -+#define MSEC_TO_USEC 1024 -+ -+/* default power management (not Tx power) table values */ -+static struct ipw_power_vec_entry range_0[IPW_POWER_AC] = { // for tim 0-10 -+ {{0, 0 * MSEC_TO_USEC, 0 * MSEC_TO_USEC, {0, 0, 0, 0, 0}}, 0}, -+ {{SLP, 200 * MSEC_TO_USEC, 500 * MSEC_TO_USEC, -+ {1, 2, 3, 4, 4}}, 0}, -+ {{SLP, 200 * MSEC_TO_USEC, 300 * MSEC_TO_USEC, -+ {2, 4, 6, 7, 7}}, 0}, -+ {{SLP, 50 * MSEC_TO_USEC, 100 * MSEC_TO_USEC, -+ {2, 6, 9, 9, 10}}, 0}, -+ {{SLP, 50 * MSEC_TO_USEC, 25 * MSEC_TO_USEC, -+ {2, 7, 9, 9, 10}}, 1}, -+ {{SLP, 25 * MSEC_TO_USEC, 25 * MSEC_TO_USEC, -+ {4, 7, 10, 10, 10}}, 1} -+}; -+ -+static struct ipw_power_vec_entry range_1[IPW_POWER_AC] = { // fot tim > 10 -+ {{0, 0 * MSEC_TO_USEC, 0 * MSEC_TO_USEC, {0, 0, 0, 0, 0}}, 0}, -+ {{SLP, 200 * MSEC_TO_USEC, 500 * MSEC_TO_USEC, -+ {1, 2, 3, 4, 0xFF}}, 0}, -+ {{SLP, 200 * MSEC_TO_USEC, 300 * MSEC_TO_USEC, -+ {2, 4, 6, 7, 0xFF}}, 0}, -+ {{SLP, 50 * MSEC_TO_USEC, 100 * MSEC_TO_USEC, -+ {2, 6, 9, 9, 0xFF}}, 0}, -+ {{SLP, 50 * MSEC_TO_USEC, 25 * MSEC_TO_USEC, -+ {2, 7, 9, 9, 0xFF}}, 0}, -+ {{SLP, 25 * MSEC_TO_USEC, 25 * MSEC_TO_USEC, -+ {4, 7, 10, 10, 0xFF}}, 0} -+}; -+ -+/************************************************/ -+static void ipw_remove_current_network(struct ipw_priv *priv); -+static void ipw_rx_handle(struct ipw_priv *priv); -+static int ipw_queue_tx_reclaim(struct ipw_priv *priv, int qindex, int index); -+static int ipw_queue_reset(struct ipw_priv *priv); -+ -+static void ipw_tx_queue_free(struct ipw_priv *); -+ -+static int ipw_stop_tx_queue(struct ipw_priv *priv); -+ -+static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *); -+static void ipw_rx_queue_free(struct ipw_priv *, struct ipw_rx_queue *); -+static void ipw_rx_queue_replenish(void *); -+ -+static int ipw_up(struct ipw_priv *); -+static void ipw_bg_up(void *); -+static void ipw_down(struct ipw_priv *); -+static void ipw_bg_down(void *); -+ -+static int ipw_card_show_info(struct ipw_priv *priv); -+static int ipw_query_eeprom(struct ipw_priv *priv, u32 offset, -+ u32 len, u8 * buf); -+ -+static void ipw_bg_alive_start(void *data); -+static int ipw_send_card_state(struct ipw_priv *priv, u32 flags, u8 meta_flag); -+ -+static void ipw_link_down(struct ipw_priv *priv); -+static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid, -+ int is_ap, u8 flags); -+static u8 ipw_remove_station(struct ipw_priv *priv, u8 * bssid, int is_ap); -+static int ipw_card_bss_active_changed_notify(struct ipw_priv *priv, struct ieee80211_network -+ *network); -+ -+static int snprint_line(char *buf, size_t count, -+ const u8 * data, u32 len, u32 ofs) -+{ -+ int out, i, j, l; -+ char c; -+ -+ out = snprintf(buf, count, "%08X", ofs); -+ -+ for (l = 0, i = 0; i < 2; i++) { -+ out += snprintf(buf + out, count - out, " "); -+ for (j = 0; j < 8 && l < len; j++, l++) -+ out += -+ snprintf(buf + out, count - out, "%02X ", -+ data[(i * 8 + j)]); -+ for (; j < 8; j++) -+ out += snprintf(buf + out, count - out, " "); -+ } -+ out += snprintf(buf + out, count - out, " "); -+ for (l = 0, i = 0; i < 2; i++) { -+ out += snprintf(buf + out, count - out, " "); -+ for (j = 0; j < 8 && l < len; j++, l++) { -+ c = data[(i * 8 + j)]; -+ if (!isascii(c) || !isprint(c)) -+ c = '.'; -+ -+ out += snprintf(buf + out, count - out, "%c", c); -+ } -+ -+ for (; j < 8; j++) -+ out += snprintf(buf + out, count - out, " "); -+ } -+ -+ return out; -+} -+ -+#ifdef CONFIG_IPW3945_DEBUG -+static void printk_buf(int level, const u8 * data, u32 len) -+{ -+ char line[81]; -+ u32 ofs = 0; -+ if (!(ipw_debug_level & level)) -+ return; -+ -+ while (len) { -+ snprint_line(line, sizeof(line), &data[ofs], -+ min(len, 16U), ofs); -+ printk(KERN_DEBUG "%s\n", line); -+ ofs += 16; -+ len -= min(len, 16U); -+ } -+} -+#else -+#define printk_buf(x, y, z) do {} while (0) -+#endif -+ -+#define IGNORE_RETURN(x) if (x);else; -+ -+#define IPW_RATE_SCALE_MAX_WINDOW 62 -+#define IPW_INVALID_VALUE -1 -+/* -+ * IO, register, and NIC memory access functions -+ * -+ * NOTE on naming convention and macro usage for these -+ * -+ * A single _ prefix before a an access function means that no state -+ * check or debug information is printed when that function is called. -+ * -+ * A double __ prefix before an access function means that state is checked -+ * (in the case of *restricted calls) and the current line number is printed -+ * in addition to any other debug output. -+ * -+ * The non-prefixed name is the #define that maps the caller into a -+ * #define that provides the caller's __LINE__ to the double prefix version. -+ * -+ * If you wish to call the function without any debug or state checking, -+ * you should use the single _ prefix version (as is used by dependent IO -+ * routines, for example _ipw_read_restricted calls the non-check version of -+ * _ipw_read32. -+ * -+ */ -+ -+#define _ipw_write32(ipw, ofs, val) writel((val), (ipw)->hw_base + (ofs)) -+#define ipw_write32(ipw, ofs, val) \ -+ IPW_DEBUG_IO("%s %d: write_direct32(0x%08X, 0x%08X)\n", __FILE__, __LINE__, (u32)(ofs), (u32)(val)); \ -+ _ipw_write32(ipw, ofs, val) -+ -+#define _ipw_read32(ipw, ofs) readl((ipw)->hw_base + (ofs)) -+static inline u32 __ipw_read32(char *f, u32 l, struct ipw_priv *ipw, u32 ofs) -+{ -+ IPW_DEBUG_IO("%s %d: read_direct32(0x%08X)\n", f, l, (u32) (ofs)); -+ return _ipw_read32(ipw, ofs); -+} -+ -+#define ipw_read32(ipw, ofs) __ipw_read32(__FILE__, __LINE__, ipw, ofs) -+ -+static inline int ipw_poll_bit(struct ipw_priv *priv, u32 addr, -+ u32 bits, u32 mask, int timeout) -+{ -+ int i = 0; -+ -+ do { -+ if ((_ipw_read32(priv, addr) & mask) == (bits & mask)) -+ return i; -+ mdelay(10); -+ i += 10; -+ } while (i < timeout); -+ -+ return -ETIMEDOUT; -+} -+ -+static inline void ipw_set_bit(struct ipw_priv *priv, u32 reg, u32 mask) -+{ -+ _ipw_write32(priv, reg, ipw_read32(priv, reg) | mask); -+} -+ -+static inline void ipw_clear_bit(struct ipw_priv *priv, u32 reg, u32 mask) -+{ -+ _ipw_write32(priv, reg, ipw_read32(priv, reg) & ~mask); -+} -+ -+static inline int _ipw_grab_restricted_access(struct ipw_priv *priv) -+{ -+ int rc; -+ ipw_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); -+ rc = ipw_poll_bit(priv, CSR_GP_CNTRL, -+ CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, -+ (CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | -+ CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 4000); -+ if (rc < 0) { -+ IPW_ERROR("MAC is in deep sleep!\n"); -+// ipw_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_FORCE_NMI); -+ return -EIO; -+ } -+ -+ priv->status |= STATUS_RESTRICTED; -+ -+ return 0; -+} -+ -+static inline int __ipw_grab_restricted_access(u32 line, struct ipw_priv *priv) -+{ -+ if (priv->status & STATUS_RESTRICTED) -+ IPW_ERROR -+ ("Grabbing access while already held at line %d.\n", line); -+ -+ return _ipw_grab_restricted_access(priv); -+} -+ -+#define ipw_grab_restricted_access(priv) \ -+__ipw_grab_restricted_access(__LINE__, priv) -+ -+static inline void _ipw_release_restricted_access(struct ipw_priv -+ *priv) -+{ -+ ipw_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); -+ -+ priv->status &= ~STATUS_RESTRICTED; -+} -+ -+static inline void __ipw_release_restricted_access(u32 line, struct ipw_priv -+ *priv) -+{ -+ if (!(priv->status & STATUS_RESTRICTED)) -+ IPW_ERROR -+ ("Release unheld restricted access at line %d.\n", line); -+ -+ _ipw_release_restricted_access(priv); -+} -+ -+#define ipw_release_restricted_access(priv) \ -+__ipw_release_restricted_access(__LINE__, priv) -+ -+static inline u32 _ipw_read_restricted(struct ipw_priv *priv, u32 reg) -+{ -+ u32 val; -+// _ipw_grab_restricted_access(priv); -+ val = _ipw_read32(priv, reg); -+// _ipw_release_restricted_access(priv); -+ return val; -+} -+ -+static u32 __ipw_read_restricted(u32 line, struct ipw_priv *priv, u32 reg) -+{ -+ u32 value; -+ -+ if (!(priv->status & STATUS_RESTRICTED)) -+ IPW_ERROR("Unrestricted access from line %d\n", line); -+ -+ value = _ipw_read_restricted(priv, reg); -+ -+ IPW_DEBUG_IO(" reg = 0x%4X : value = 0x%4x \n", reg, value); -+ -+ return value; -+} -+ -+#define ipw_read_restricted(a, b) __ipw_read_restricted(__LINE__, a, b) -+ -+static void inline _ipw_write_restricted(struct ipw_priv *priv, -+ u32 reg, u32 value) -+{ -+// _ipw_grab_restricted_access(priv); -+ _ipw_write32(priv, reg, value); -+// _ipw_release_restricted_access(priv); -+} -+static void __ipw_write_restricted(u32 line, -+ struct ipw_priv *priv, u32 reg, u32 value) -+{ -+ if (!(priv->status & STATUS_RESTRICTED)) -+ IPW_ERROR("Unrestricted access from line %d\n", line); -+ _ipw_write_restricted(priv, reg, value); -+} -+ -+#define ipw_write_restricted(priv, reg, value) \ -+__ipw_write_restricted(__LINE__, priv, reg, value) -+ -+static void ipw_write_buffer_restricted(struct ipw_priv *priv, -+ u32 reg, u32 len, u32 * values) -+{ -+ u32 count = sizeof(u32); -+ if ((priv != NULL) && (values != NULL)) { -+ for (; 0 < len; len -= count, reg += count, values++) -+ _ipw_write_restricted(priv, reg, *values); -+ } -+} -+ -+static inline int ipw_poll_restricted_bit(struct ipw_priv *priv, -+ u32 addr, u32 mask, int timeout) -+{ -+ int i = 0; -+ -+ do { -+ if ((_ipw_read_restricted(priv, addr) & mask) == mask) -+ return i; -+ mdelay(10); -+ i += 10; -+ } while (i < timeout); -+ -+ return -ETIMEDOUT; -+} -+ -+static inline u32 _ipw_read_restricted_reg(struct ipw_priv *priv, u32 reg) -+{ -+ _ipw_write_restricted(priv, HBUS_TARG_PRPH_RADDR, reg | (3 << 24)); -+ return _ipw_read_restricted(priv, HBUS_TARG_PRPH_RDAT); -+} -+static inline u32 __ipw_read_restricted_reg(u32 line, -+ struct ipw_priv *priv, u32 reg) -+{ -+ if (!(priv->status & STATUS_RESTRICTED)) -+ IPW_ERROR("Unrestricted access from line %d\n", line); -+ return _ipw_read_restricted_reg(priv, reg); -+} -+ -+#define ipw_read_restricted_reg(priv, reg) \ -+__ipw_read_restricted_reg(__LINE__, priv, reg) -+ -+static inline void _ipw_write_restricted_reg(struct ipw_priv *priv, -+ u32 addr, u32 val) -+{ -+ _ipw_write_restricted(priv, HBUS_TARG_PRPH_WADDR, -+ ((addr & 0x0000FFFF) | (3 << 24))); -+ _ipw_write_restricted(priv, HBUS_TARG_PRPH_WDAT, val); -+} -+static inline void __ipw_write_restricted_reg(u32 line, -+ struct ipw_priv *priv, -+ u32 addr, u32 val) -+{ -+ if (!(priv->status & STATUS_RESTRICTED)) -+ IPW_ERROR("Unrestricted access from line %d\n", line); -+ _ipw_write_restricted_reg(priv, addr, val); -+} -+ -+#define ipw_write_restricted_reg(priv, addr, val) \ -+__ipw_write_restricted_reg(__LINE__, priv, addr, val) -+ -+#define _ipw_set_bits_restricted_reg(priv, reg, mask) \ -+ _ipw_write_restricted_reg(priv, reg, \ -+ (_ipw_read_restricted_reg(priv, reg) | mask)) -+static void inline __ipw_set_bits_restricted_reg(u32 line, struct ipw_priv -+ *priv, u32 reg, u32 mask) -+{ -+ if (!(priv->status & STATUS_RESTRICTED)) -+ IPW_ERROR("Unrestricted access from line %d\n", line); -+ _ipw_set_bits_restricted_reg(priv, reg, mask); -+} -+ -+#define ipw_set_bits_restricted_reg(priv, reg, mask) \ -+__ipw_set_bits_restricted_reg(__LINE__, priv, reg, mask) -+ -+#define _ipw_set_bits_mask_restricted_reg(priv, reg, bits, mask) \ -+ _ipw_write_restricted_reg( \ -+ priv, reg, ((_ipw_read_restricted_reg(priv, reg) & mask) | bits)) -+static void inline __ipw_set_bits_mask_restricted_reg(u32 line, struct ipw_priv -+ *priv, u32 reg, -+ u32 bits, u32 mask) -+{ -+ if (!(priv->status & STATUS_RESTRICTED)) -+ IPW_ERROR("Unrestricted access from line %d\n", line); -+ _ipw_set_bits_mask_restricted_reg(priv, reg, bits, mask); -+} -+ -+#define ipw_set_bits_mask_restricted_reg(priv, reg, bits, mask) \ -+__ipw_set_bits_mask_restricted_reg(__LINE__, priv, reg, bits, mask) -+ -+static inline void ipw_write_restricted_reg_buffer(struct ipw_priv -+ *priv, u32 reg, -+ u32 len, u8 * values) -+{ -+ u32 reg_offset = reg; -+ u32 aligment = reg & 0x3; -+ -+ if (len < sizeof(u32)) { -+ if ((aligment + len) <= sizeof(u32)) { -+ u8 size; -+ u32 value = 0; -+ size = len - 1; -+ memcpy(&value, values, len); -+ reg_offset = (reg_offset & 0x0000FFFF); -+ -+ _ipw_write_restricted(priv, -+ HBUS_TARG_PRPH_WADDR, -+ (reg_offset | (size << 24))); -+ _ipw_write_restricted(priv, HBUS_TARG_PRPH_WDAT, value); -+ } -+ -+ return; -+ } -+ -+ for (; reg_offset < (reg + len); -+ reg_offset += sizeof(u32), values += sizeof(u32)) -+ _ipw_write_restricted_reg(priv, reg_offset, *((u32 *) values)); -+} -+ -+static inline void ipw_clear_bits_restricted_reg(struct ipw_priv -+ *priv, u32 reg, u32 mask) -+{ -+ u32 val = _ipw_read_restricted_reg(priv, reg); -+ _ipw_write_restricted_reg(priv, reg, (val & ~mask)); -+} -+ -+static inline void ipw_enable_interrupts(struct ipw_priv *priv) -+{ -+ if (priv->status & STATUS_INT_ENABLED) -+ return; -+ priv->status |= STATUS_INT_ENABLED; -+ ipw_write32(priv, CSR_INT_MASK, CSR_INI_SET_MASK); -+} -+ -+static inline void ipw_disable_interrupts(struct ipw_priv *priv) -+{ -+ if (!(priv->status & STATUS_INT_ENABLED)) -+ return; -+ priv->status &= ~STATUS_INT_ENABLED; -+ ipw_write32(priv, CSR_INT_MASK, 0x00000000); -+ ipw_write32(priv, CSR_INT, CSR_INI_SET_MASK); -+ ipw_write32(priv, CSR_FH_INT_STATUS, 0xff); -+ ipw_write32(priv, CSR_FH_INT_STATUS, 0x00070000); -+} -+ -+static u32 ipw_read_restricted_mem(struct ipw_priv *priv, u32 addr) -+{ -+ ipw_write_restricted(priv, HBUS_TARG_MEM_RADDR, addr); -+ return ipw_read_restricted(priv, HBUS_TARG_MEM_RDAT); -+} -+ -+/************************* END *******************************/ -+ -+static const char *desc_lookup(int i) -+{ -+ switch (i) { -+ case 1: -+ return "FAIL"; -+ case 2: -+ return "BAD_PARAM"; -+ case 3: -+ return "BAD_CHECKSUM"; -+ case 4: -+ return "NMI_INTERRUPT"; -+ case 5: -+ return "SYSASSERT"; -+ case 6: -+ return "FATAL_ERROR"; -+ } -+ -+ return "UNKNOWN"; -+} -+ -+#define ERROR_START_OFFSET (1 * sizeof(u32)) -+#define ERROR_ELEM_SIZE (7 * sizeof(u32)) -+static void ipw_dump_nic_error_log(struct ipw_priv *priv) -+{ -+ u32 desc, time, blnk, blink2, ilnk, ilink2, idata, i, count, base; -+ int rc; -+ -+ base = priv->card_alive.error_event_table_ptr; -+ -+ if (!VALID_RTC_DATA_ADDR(base)) { -+ IPW_ERROR("Not valid error log pointer 0x%08X\n", base); -+ return; -+ } -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ IPW_WARNING("Can not read from adapter at this time.\n"); -+ return; -+ } -+ -+ count = ipw_read_restricted_mem(priv, base); -+ -+ if (ERROR_START_OFFSET <= count * ERROR_ELEM_SIZE) { -+ IPW_ERROR("Start IPW Error Log Dump:\n"); -+ IPW_ERROR("Status: 0x%08X, Config: %08X count: %d\n", -+ priv->status, priv->config, count); -+ } -+ -+ IPW_ERROR("Desc Time asrtPC const " -+ "ilink1 nmiPC Line\n"); -+ for (i = ERROR_START_OFFSET; -+ i < (count * ERROR_ELEM_SIZE) + ERROR_START_OFFSET; -+ i += ERROR_ELEM_SIZE) { -+ desc = ipw_read_restricted_mem(priv, base + i); -+ time = -+ ipw_read_restricted_mem(priv, base + i + 1 * sizeof(u32)); -+ blnk = -+ ipw_read_restricted_mem(priv, base + i + 2 * sizeof(u32)); -+ blink2 = -+ ipw_read_restricted_mem(priv, base + i + 3 * sizeof(u32)); -+ ilnk = -+ ipw_read_restricted_mem(priv, base + i + 4 * sizeof(u32)); -+ ilink2 = -+ ipw_read_restricted_mem(priv, base + i + 5 * sizeof(u32)); -+ idata = -+ ipw_read_restricted_mem(priv, base + i + 6 * sizeof(u32)); -+ -+ IPW_ERROR -+ ("%-8s (#%d) 0x%08X 0x%08X 0x%08X 0x%08X 0x%08X %u\n", -+ desc_lookup(desc), desc, time, blnk, blink2, -+ ilnk, ilink2, idata); -+ } -+ -+ ipw_release_restricted_access(priv); -+ -+} -+ -+#define EVENT_START_OFFSET (4 * sizeof(u32)) -+static void ipw_dump_nic_event_log(struct ipw_priv *priv) -+{ -+ int rc; -+ u32 ev, time, data = 0, i, count = 0, base; -+ u32 event_size, type; -+ -+ base = priv->card_alive.log_event_table_ptr; -+ if (!VALID_RTC_DATA_ADDR(base)) { -+ IPW_ERROR("Not valid log event pointer 0x%08X\n", base); -+ return; -+ } -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ IPW_WARNING("Can not read from adapter at this time.\n"); -+ return; -+ } -+ -+ count = ipw_read_restricted_mem(priv, base); -+ type = ipw_read_restricted_mem(priv, base + sizeof(u32)); -+ -+ if (type == 0) -+ event_size = 2 * sizeof(u32); -+ else -+ event_size = 3 * sizeof(u32); -+ -+ if (count > 0) -+ IPW_ERROR -+ ("Start IPW Event Log Dump: count %d type 0x%02X\n", -+ count, type); -+ -+ for (i = EVENT_START_OFFSET; -+ i < ((count * event_size) + EVENT_START_OFFSET); i += event_size) { -+ ev = ipw_read_restricted_mem(priv, base + i); -+ time = -+ ipw_read_restricted_mem(priv, base + i + 1 * sizeof(u32)); -+ if ((type == 0) && (ev || time)) { -+ IPW_ERROR("0x%08x\t0x%08x\n", ev, time); -+ } else if (type != 0) { -+ data = -+ ipw_read_restricted_mem(priv, -+ base + i + 2 * sizeof(u32)); -+ if (ev || time || data) -+ IPW_ERROR("0x%08x\t0x%08x\t0x%08x\n", -+ ev, time, data); -+ } -+ } -+ -+ ipw_release_restricted_access(priv); -+} -+ -+static inline int ipw_is_ready(struct ipw_priv *priv) -+{ -+ /* The adapter is 'ready' if READY and GEO_CONFIGURED bits are -+ * set but EXIT_PENDING is not */ -+ return ((priv->status & (STATUS_READY | -+ STATUS_GEO_CONFIGURED | -+ STATUS_EXIT_PENDING)) == -+ (STATUS_READY | STATUS_GEO_CONFIGURED)) ? 1 : 0; -+} -+ -+static inline int ipw_is_alive(struct ipw_priv *priv) -+{ -+ return (priv->status & STATUS_ALIVE) ? 1 : 0; -+} -+ -+static inline int ipw_is_init(struct ipw_priv *priv) -+{ -+ return (priv->status & STATUS_INIT) ? 1 : 0; -+} -+ -+static inline int ipw_is_calibrated(struct ipw_priv *priv) -+{ -+ return (priv->status & STATUS_CALIBRATE) ? 1 : 0; -+} -+ -+#define IPW_RX_HDR(x) ((struct ipw_rx_frame_hdr *)(\ -+ x->u.rx_frame.stats.payload + \ -+ x->u.rx_frame.stats.mib_count)) -+#define IPW_RX_END(x) ((struct ipw_rx_frame_end *)(\ -+ IPW_RX_HDR(x)->payload + \ -+ le16_to_cpu(IPW_RX_HDR(x)->len))) -+#define IPW_RX_STATS(x) (&x->u.rx_frame.stats) -+#define IPW_RX_DATA(x) (IPW_RX_HDR(x)->payload) -+ -+#define IPW_CMD(x) case x : return #x -+#define IPW_CMD3945(x) case REPLY_ ## x : return #x -+ -+static const char *get_cmd_string(u8 cmd) -+{ -+ switch (cmd) { -+ IPW_CMD(SCAN_START_NOTIFICATION); -+ IPW_CMD(SCAN_RESULTS_NOTIFICATION); -+ IPW_CMD(SCAN_COMPLETE_NOTIFICATION); -+ IPW_CMD(STATISTICS_NOTIFICATION); -+ IPW_CMD3945(ALIVE); -+ IPW_CMD3945(ERROR); -+ IPW_CMD3945(RX_ON_ASSOC); -+ IPW_CMD3945(QOS_PARAM); -+ IPW_CMD3945(RX_ON_TIMING); -+ IPW_CMD3945(ADD_STA); -+ IPW_CMD3945(RX); -+ IPW_CMD3945(TX); -+ IPW_CMD3945(BCON); -+ IPW_CMD3945(RATE_SCALE); -+ IPW_CMD3945(LEDS_CMD); -+ IPW_CMD3945(SCAN_ABORT_CMD); -+ IPW_CMD3945(TX_BEACON); -+ IPW_CMD3945(BT_CONFIG); -+ IPW_CMD3945(STATISTICS_CMD); -+ IPW_CMD3945(CARD_STATE_CMD); -+ case POWER_TABLE_CMD: -+ return "POWER_TABLE_CMD"; -+ default: -+ return "DAEMON"; -+ -+ } -+} -+ -+#define HOST_COMPLETE_TIMEOUT (HZ / 2) -+#define DAEMON_COMPLETE_TIMEOUT (HZ / 2) -+ -+static inline int is_cmd_sync(struct ipw_host_cmd *cmd) -+{ -+ return !(cmd->meta.flags & CMD_ASYNC); -+} -+ -+static inline int is_cmd_small(struct ipw_host_cmd *cmd) -+{ -+ return !(cmd->meta.flags & CMD_SIZE_HUGE); -+} -+ -+static inline int cmd_needs_lock(struct ipw_host_cmd *cmd) -+{ -+ return !(cmd->meta.flags & CMD_NO_LOCK); -+} -+ -+static inline int is_daemon_cmd(struct ipw_host_cmd *cmd) -+{ -+ return (cmd->meta.flags & CMD_DAEMON); -+} -+ -+static int ipw_send_daemon_cmd(struct ipw_priv *priv, -+ struct ipw_daemon_cmd_list *element) -+{ -+ unsigned long flags; -+ int rc = 0, want_result = 0; -+ int cmd_id = element->cmd.cmd; -+ -+ if (priv->status & STATUS_EXIT_PENDING) { -+ IPW_DEBUG_INFO -+ ("Not attempting to send daemon command while " -+ "exit pending.\n"); -+ return -EIO; -+ } -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ if ((element->cmd.flags & DAEMON_FLAG_WANT_RESULT) && -+ (priv->status & STATUS_DCMD_ACTIVE)) { -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ IPW_ERROR("Error sending %s: " -+ "Already sending a synchronous daemon command\n", -+ get_cmd_string(element->cmd.cmd)); -+ kfree(element); -+ return -EBUSY; -+ } -+ -+ if (element->cmd.flags & DAEMON_FLAG_WANT_RESULT) { -+ want_result = 1; -+ priv->status |= STATUS_DCMD_ACTIVE; -+ } -+ -+ element->cmd.token = 0; -+ element->skb_resp = NULL; -+ -+ IPW_DEBUG_DAEMON("Queueing cmd %s (#%02X)%s\n", -+ get_cmd_string(cmd_id), cmd_id, -+ want_result ? " [BLOCKING]" : ""); -+ -+ list_add_tail(&element->list, &priv->daemon_out_list); -+ -+ /* At this point, we can no longer reference 'element' as its -+ * ownership (and subsequent deletion) has been passed to the -+ * daemon_out_list */ -+ -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ wake_up_interruptible_all(&priv->wait_daemon_out_queue); -+ -+ if (!want_result) -+ return 0; -+ -+ rc = wait_event_interruptible_timeout(priv-> -+ wait_daemon_cmd_done, -+ !(priv->status & -+ STATUS_DCMD_ACTIVE), -+ DAEMON_COMPLETE_TIMEOUT); -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ if (rc == 0) { -+ if (priv->status & STATUS_DCMD_ACTIVE) { -+ IPW_ERROR -+ ("Error sending cmd #%02X to daemon: " -+ "time out after %dms.\n", cmd_id, -+ jiffies_to_msecs(DAEMON_COMPLETE_TIMEOUT)); -+ priv->status &= ~STATUS_DCMD_ACTIVE; -+ rc = -ETIMEDOUT; -+ } else -+ rc = priv->daemon_cmd_rc; -+ } else { -+ if (priv->status & STATUS_DCMD_ACTIVE) { -+ IPW_WARNING("Daemon command aborted.\n"); -+ priv->status &= ~STATUS_DCMD_ACTIVE; -+ rc = -ECONNABORTED; -+ } else { -+ IPW_DEBUG_DAEMON -+ ("driver requested daemon command " -+ "completed in %dms.\n", -+ jiffies_to_msecs(DAEMON_COMPLETE_TIMEOUT - rc)); -+ rc = priv->daemon_cmd_rc; -+ } -+ } -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ return rc; -+} -+ -+#ifdef CONFIG_IPW3945_DEBUG -+#define DAEMON_STR(x) case DAEMON_SYNC_ ## x : return #x -+static const char *get_daemon_sync_string(u16 state) -+{ -+ switch (state) { -+ DAEMON_STR(INIT); -+ DAEMON_STR(UNINIT); -+ DAEMON_STR(SCAN_COMPLETE); -+ DAEMON_STR(TXPOWER_LIMIT); -+ DAEMON_STR(MEASURE_REPORT); -+ DAEMON_STR(TX_STATUS); -+ DAEMON_STR(SUSPEND); -+ DAEMON_STR(RESUME); -+ -+ default: -+ return "UNKNOWN"; -+ -+ } -+} -+#endif -+ -+static int ipw_send_daemon_sync(struct ipw_priv *priv, u16 state, -+ u16 len, void *data) -+{ -+ struct ipw_daemon_cmd_list *daemon_cmd; -+ struct daemon_sync_cmd *sync; -+ unsigned long flags; -+ -+ daemon_cmd = kmalloc(sizeof(*daemon_cmd) + -+ sizeof(struct daemon_sync_cmd) + len, GFP_ATOMIC); -+ if (!daemon_cmd) -+ return -ENOMEM; -+ -+ daemon_cmd->cmd.cmd = DAEMON_SYNC; -+ daemon_cmd->cmd.data_len = sizeof(struct daemon_sync_cmd) + len; -+ daemon_cmd->cmd.flags = 0; -+ daemon_cmd->cmd.token = 0; -+ daemon_cmd->skb_resp = NULL; -+ sync = (struct daemon_sync_cmd *)daemon_cmd->cmd.data; -+ -+ sync->len = len; -+ sync->state = state; -+ if (len) -+ memcpy(sync->data, data, len); -+ -+ IPW_DEBUG_DAEMON -+ ("queueing driver->daemon DAEMON_SYNC::%s frame.\n", -+ get_daemon_sync_string(state)); -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ list_add_tail(&daemon_cmd->list, &priv->daemon_out_list); -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ wake_up_interruptible_all(&priv->wait_daemon_out_queue); -+ -+ return 0; -+} -+ -+static int ipw_send_daemon_frame(struct ipw_priv *priv, -+ u8 channel, u16 rssi, u64 tsf, -+ u32 beacon_time, u8 * payload, int len) -+{ -+ struct ipw_daemon_cmd_list *daemon_cmd; -+ struct daemon_80211_frame *frame; -+ unsigned long flags; -+ -+ daemon_cmd = kmalloc(sizeof(*daemon_cmd) + -+ sizeof(struct daemon_80211_frame) + -+ len, GFP_ATOMIC); -+ if (!daemon_cmd) -+ return -ENOMEM; -+ -+ daemon_cmd->cmd.cmd = DAEMON_FRAME_RX; -+ daemon_cmd->cmd.data_len = sizeof(struct daemon_80211_frame) + len; -+ daemon_cmd->cmd.flags = 0; -+ daemon_cmd->cmd.token = 0; -+ daemon_cmd->skb_resp = NULL; -+ frame = (struct daemon_80211_frame *)daemon_cmd->cmd.data; -+ frame->channel = channel; -+ frame->rssi = rssi; -+ frame->tsf = tsf; -+ frame->beacon_time = beacon_time; -+ frame->frame_len = len; -+ memcpy(frame->frame, payload, len); -+ -+ IPW_DEBUG_DAEMON("Queueing DAEMON_FRAME_RX.\n"); -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ list_add_tail(&daemon_cmd->list, &priv->daemon_out_list); -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ wake_up_interruptible_all(&priv->wait_daemon_out_queue); -+ -+ return 0; -+} -+ -+/* -+ low level function to send 3945 command. -+ -+ The caller can control if the command is async/sync. -+ sync : 1 do sync call and sleep until notified the command is complese -+ resp : pointer to command response. -+ do_lock : 1 use spin lock, 0 assume the user has lock. -+ we can not have do_lock=0 and sync = 1. -+ is_huge_cmd : used for scan since this command is very large, we use -+ special buffer to copy the command. -+*/ -+static int ipw_send_cmd(struct ipw_priv *priv, struct ipw_host_cmd *cmd) -+ __attribute__ ((warn_unused_result)); -+static int ipw_send_cmd(struct ipw_priv *priv, struct ipw_host_cmd *cmd) -+{ -+ int rc; -+ unsigned long flags = 0; -+ -+ /* If this is an asynchronous command, and we are in a shutdown -+ * process then don't let it start */ -+ if (!is_cmd_sync(cmd) && (priv->status & STATUS_EXIT_PENDING)) -+ return -EBUSY; -+ -+ /* -+ * The following BUG_ONs are meant to catch programming API misuse -+ * and not run-time failures due to timing, resource constraint, etc. -+ */ -+ -+ /* A command can not be asynchronous AND expect an SKB to be set */ -+ BUG_ON((cmd->meta.flags & CMD_ASYNC) -+ && (cmd->meta.flags & CMD_WANT_SKB)); -+ -+ /* The skb/callback union must be NULL if an SKB is requested */ -+ BUG_ON(cmd->meta.u.skb && (cmd->meta.flags & CMD_WANT_SKB)); -+ -+ /* A command can not be synchronous AND have a callback set */ -+ BUG_ON(is_cmd_sync(cmd) && cmd->meta.u.callback); -+ -+ /* An asynchronous command MUST have a callback */ -+ BUG_ON((cmd->meta.flags & CMD_ASYNC) -+ && !cmd->meta.u.callback); -+ -+ /* A command can not be synchronous AND not use locks */ -+ BUG_ON(is_cmd_sync(cmd) && (cmd->meta.flags & CMD_NO_LOCK)); -+ -+ if (cmd_needs_lock(cmd)) -+ spin_lock_irqsave(&priv->lock, flags); -+ -+ if (is_cmd_sync(cmd) && (priv->status & STATUS_HCMD_ACTIVE)) { -+ IPW_ERROR("Error sending %s: " -+ "Already sending a host command\n", -+ get_cmd_string(cmd->id)); -+ if (cmd_needs_lock(cmd)) -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return -EBUSY; -+ } -+ -+ if (is_cmd_sync(cmd)) -+ priv->status |= STATUS_HCMD_ACTIVE; -+ -+ /* When the SKB is provided in the tasklet, it needs -+ * a backpointer to the originating caller so it can -+ * actually copy the skb there */ -+ if (cmd->meta.flags & CMD_WANT_SKB) -+ cmd->meta.u.source = &cmd->meta; -+ -+ cmd->meta.len = cmd->len; -+ -+ rc = ipw_queue_tx_hcmd(priv, cmd); -+ if (rc) { -+ if (is_cmd_sync(cmd)) -+ priv->status &= ~STATUS_HCMD_ACTIVE; -+ if (cmd_needs_lock(cmd)) -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ IPW_ERROR("Error sending %s: " -+ "ipw_queue_tx_hcmd failed: %d\n", -+ get_cmd_string(cmd->id), rc); -+ -+ return -ENOSPC; -+ } -+ if (cmd_needs_lock(cmd)) -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ if (is_cmd_sync(cmd)) { -+ rc = wait_event_interruptible_timeout(priv-> -+ wait_command_queue, -+ !(priv-> -+ status & -+ STATUS_HCMD_ACTIVE), -+ HOST_COMPLETE_TIMEOUT); -+ if (rc == 0) { -+ if (cmd_needs_lock(cmd)) -+ spin_lock_irqsave(&priv->lock, flags); -+ -+ if (priv->status & STATUS_HCMD_ACTIVE) { -+ IPW_ERROR("Error sending %s: " -+ "time out after %dms.\n", -+ get_cmd_string(cmd->id), -+ jiffies_to_msecs -+ (HOST_COMPLETE_TIMEOUT)); -+ priv->status &= ~STATUS_HCMD_ACTIVE; -+ if ((cmd->meta.flags & CMD_WANT_SKB) -+ && cmd->meta.u.skb) { -+ dev_kfree_skb_any(cmd->meta.u.skb); -+ cmd->meta.u.skb = NULL; -+ } -+ -+ if (cmd_needs_lock(cmd)) -+ spin_unlock_irqrestore(&priv-> -+ lock, flags); -+ return -ETIMEDOUT; -+ } -+ -+ if (cmd_needs_lock(cmd)) -+ spin_unlock_irqrestore(&priv->lock, flags); -+ } -+ } -+ -+ if (priv->status & STATUS_RF_KILL_HW) { -+ if ((cmd->meta.flags & CMD_WANT_SKB) -+ && cmd->meta.u.skb) { -+ dev_kfree_skb_any(cmd->meta.u.skb); -+ cmd->meta.u.skb = NULL; -+ } -+ -+ IPW_DEBUG_INFO("Command %s aborted: RF KILL Switch\n", -+ get_cmd_string(cmd->id)); -+ -+ return -ECANCELED; -+ } -+ -+ if (priv->status & STATUS_FW_ERROR) { -+ if ((cmd->meta.flags & CMD_WANT_SKB) -+ && cmd->meta.u.skb) { -+ dev_kfree_skb_any(cmd->meta.u.skb); -+ cmd->meta.u.skb = NULL; -+ } -+ -+ IPW_DEBUG_INFO("Command %s failed: FW Error\n", -+ get_cmd_string(cmd->id)); -+ -+ return -EIO; -+ } -+ -+ if ((cmd->meta.flags & CMD_WANT_SKB) && !cmd->meta.u.skb) { -+ IPW_ERROR("Error: Response NULL in '%s'\n", -+ get_cmd_string(cmd->id)); -+ return -EIO; -+ } -+ -+ return 0; -+} -+ -+static int ipw_send_cmd_pdu(struct ipw_priv *priv, u8 id, u16 len, void *data) -+ __attribute__ ((warn_unused_result)); -+static int ipw_send_cmd_pdu(struct ipw_priv *priv, u8 id, u16 len, void *data) -+{ -+ struct ipw_host_cmd cmd = { -+ .id = id, -+ .len = len, -+ .data = data, -+ }; -+ -+ return ipw_send_cmd(priv, &cmd); -+} -+ -+static int ipw_send_cmd_u32(struct ipw_priv *priv, u8 id, u32 val) -+ __attribute__ ((warn_unused_result)); -+static int ipw_send_cmd_u32(struct ipw_priv *priv, u8 id, u32 val) -+{ -+ struct ipw_host_cmd cmd = { -+ .id = id, -+ .len = sizeof(val), -+ .data = &val, -+ }; -+ -+ return ipw_send_cmd(priv, &cmd); -+} -+ -+static struct ipw_link_blink link_led_table[] = { -+ [IPW_LED_LINK_RADIOOFF] = {1000, 0, 0}, -+ [IPW_LED_LINK_UNASSOCIATED] = {10000, 200, 2}, -+ [IPW_LED_LINK_SCANNING] = {1000, 60, 10}, -+ [IPW_LED_LINK_ASSOCIATED] = {1000, 0, 1}, -+ [IPW_LED_LINK_ROAMING] = {1000, 10, 100}, -+}; -+ -+static void ipw_update_link_led(struct ipw_priv *priv) -+{ -+ int state; -+ struct ipw_led_cmd led_cmd = { -+ .id = IPW_LED_LINK, -+ }; -+ -+ /* If we are in RF KILL then we can't send the LED -+ * command, so cache that the LED is in the -+ * RADIOOFF state so we'll turn it back on when -+ * we come back from RF KILL. */ -+ if (priv->status & STATUS_RF_KILL_MASK) { -+ IPW_DEBUG_LED("Not sending LINK LED off cmd due to RF KILL.\n"); -+ priv->led_state = IPW_LED_LINK_RADIOOFF; -+ return; -+ } -+ -+ if (priv->status & STATUS_IN_SUSPEND) { -+ IPW_DEBUG_LED("Not sending LINK LED off cmd due to SUSPEND.\n"); -+ priv->led_state = IPW_LED_LINK_RADIOOFF; -+ return; -+ } -+ -+ if ((priv->config & CFG_NO_LED) || -+ (priv->status & STATUS_EXIT_PENDING) || -+ !(priv->status & STATUS_READY)) -+ state = IPW_LED_LINK_RADIOOFF; -+ else if (priv->status & STATUS_ROAMING) -+ state = IPW_LED_LINK_ROAMING; -+ else if (priv->status & STATUS_SCANNING) -+ state = IPW_LED_LINK_SCANNING; -+ else if (priv->status & STATUS_ASSOCIATED) -+ state = IPW_LED_LINK_ASSOCIATED; -+ else -+ state = IPW_LED_LINK_UNASSOCIATED; -+ -+ if (state == priv->led_state) -+ return; -+ -+ led_cmd.interval = link_led_table[state].interval; -+ led_cmd.on = link_led_table[state].on; -+ led_cmd.off = link_led_table[state].off; -+ -+ priv->led_state = state; -+ -+#ifdef CONFIG_IPW3945_DEBUG -+ switch (state) { -+ case IPW_LED_LINK_RADIOOFF: -+ IPW_DEBUG_LED("Link state: RADIO OFF\n"); -+ break; -+ case IPW_LED_LINK_ROAMING: -+ IPW_DEBUG_LED("Link state: ROAMING\n"); -+ break; -+ case IPW_LED_LINK_ASSOCIATED: -+ IPW_DEBUG_LED("Link state: ASSOCIATED\n"); -+ break; -+ case IPW_LED_LINK_UNASSOCIATED: -+ IPW_DEBUG_LED("Link state: UNASSOCIATED\n"); -+ break; -+ case IPW_LED_LINK_SCANNING: -+ IPW_DEBUG_LED("Link state: SCANNING\n"); -+ break; -+ default: -+ IPW_DEBUG_LED("Link state: UNKNOWN\n"); -+ break; -+ } -+#endif -+ -+ IPW_DEBUG_LED("On: %d, Off: %d, Interval: %d\n", -+ led_cmd.on, led_cmd.off, led_cmd.interval); -+ -+ IGNORE_RETURN(ipw_send_cmd_pdu(priv, REPLY_LEDS_CMD, -+ sizeof(struct ipw_led_cmd), &led_cmd)); -+} -+ -+static struct ipw_activity_blink activity_led_table[] = { -+ {300, 25, 25}, -+ {200, 40, 40}, -+ {100, 55, 55}, -+ {70, 65, 65}, -+ {50, 75, 75}, -+ {20, 85, 85}, -+ {10, 95, 95}, -+ {5, 110, 110}, -+ {1, 130, 130}, -+ {0, 167, 167}, -+}; -+ -+/* -+ set to correct blink rate. set to solid blink we can not find correct -+ rate value or the blink valus exceed the blink threshold -+*/ -+static void get_led_blink_rate(struct ipw_priv *priv, -+ struct ipw_activity_blink *blink) -+{ -+ /* Adjust to Mbs throughput table */ -+ u32 bit_count = (priv->led_packets * 10) >> 17; -+ u32 index = 0; -+ -+ /* If < 1mbs then just quick blink over long duration to -+ * indicate "some" activity */ -+ if (!bit_count) { -+ blink->on = 10; -+ blink->off = 200; -+ return; -+ } -+ -+ while ((bit_count <= activity_led_table[index].throughput) && -+ index < ARRAY_SIZE(activity_led_table)) -+ index++; -+ -+ if (index == ARRAY_SIZE(activity_led_table)) { -+ blink->on = 1; /* turn on */ -+ blink->off = 0; /* never turn off */ -+ return; -+ } -+ -+ blink->on = activity_led_table[index].on; -+ blink->off = activity_led_table[index].off; -+} -+ -+#define IPW_ACTIVITY_PERIOD msecs_to_jiffies(100) -+ -+static void ipw_update_activity_led(struct ipw_priv *priv) -+{ -+ static struct ipw_activity_blink last_blink = { 0, 0, 0 }; -+ struct ipw_activity_blink blink; -+ struct ipw_led_cmd led_cmd = { -+ .id = IPW_LED_ACTIVITY, -+ .interval = IPW_LED_INTERVAL, -+ }; -+ -+ /* If configured to not use LEDs or LEDs are disabled, -+ * then we don't toggle a activity led */ -+ if (priv->config & CFG_NO_LED || (priv->status & STATUS_EXIT_PENDING)) { -+ blink.on = blink.off = 0; -+ } else { -+ IPW_DEBUG_LED("total Tx/Rx bytes = %lu\n", priv->led_packets); -+ get_led_blink_rate(priv, &blink); -+ priv->led_packets = 0; -+ } -+ -+ if (last_blink.on != blink.on || last_blink.off != blink.off) { -+ last_blink = blink; -+ IPW_DEBUG_LED -+ ("Blink rate is %d On, %d ms Off, at %d interval.\n", -+ blink.on, blink.off, led_cmd.interval); -+ -+ led_cmd.off = blink.off; -+ led_cmd.on = blink.on; -+ -+ IGNORE_RETURN(ipw_send_cmd_pdu(priv, REPLY_LEDS_CMD, -+ sizeof(struct -+ ipw_led_cmd), &led_cmd)); -+ } -+} -+ -+static void ipw_setup_activity_timer(struct ipw_priv *priv) -+{ -+ if (priv->activity_timer_active) -+ return; -+ -+ priv->activity_timer_active = 1; -+ queue_delayed_work(priv->workqueue, &priv->activity_timer, -+ IPW_ACTIVITY_PERIOD); -+} -+ -+static void ipw_bg_activity_timer(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ -+ ipw_update_activity_led(priv); -+ -+ /* If we haven't Tx/Rx any packets, then don't bother -+ * running this timer any more until we do one of those things */ -+ if (!priv->led_packets) -+ priv->activity_timer_active = 0; -+ else -+ queue_delayed_work(priv->workqueue, -+ &priv->activity_timer, IPW_ACTIVITY_PERIOD); -+ -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_update_tech_led(struct ipw_priv *priv) -+{ -+} -+ -+#define IPW_EEPROM_LED_FROM_EEPROM 0x80 -+#define IPW_EEPROM_LED_MODE 0x03 -+#define IPW_EEPROM_LED_SAVE 0x04 -+ -+static int ipw_block_until_driver_ready(struct ipw_priv *priv) -+{ -+ if (!ipw_is_alive(priv)) -+ return -EAGAIN; -+ -+ return 0; -+} -+ -+/* -+ * The following adds a new attribute to the sysfs representation -+ * of this device driver (i.e. a new file in /sys/bus/pci/drivers/ipw/) -+ * used for controling the debug level. -+ * -+ * See the level definitions in ipw for details. -+ */ -+static ssize_t show_debug_level(struct device_driver *d, char *buf) -+{ -+ return sprintf(buf, "0x%08X\n", ipw_debug_level); -+} -+static ssize_t store_debug_level(struct device_driver *d, -+ const char *buf, size_t count) -+{ -+ char *p = (char *)buf; -+ u32 val; -+ -+ if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') { -+ p++; -+ if (p[0] == 'x' || p[0] == 'X') -+ p++; -+ val = simple_strtoul(p, &p, 16); -+ } else -+ val = simple_strtoul(p, &p, 10); -+ if (p == buf) -+ printk(KERN_INFO DRV_NAME -+ ": %s is not in hex or decimal form.\n", buf); -+ else -+ ipw_debug_level = val; -+ -+ return strnlen(buf, count); -+} -+ -+static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, -+ show_debug_level, store_debug_level); -+ -+static int ipw_send_statistics_request(struct ipw_priv *priv) -+{ -+ return ipw_send_cmd_u32(priv, REPLY_STATISTICS_CMD, 0); -+} -+ -+static void ipw_clear_free_frames(struct ipw_priv *priv) -+{ -+ struct list_head *element; -+ -+ IPW_DEBUG_INFO("%d frames on pre-allocated heap on clear.\n", -+ priv->frames_count); -+ -+ while (!list_empty(&priv->free_frames)) { -+ element = priv->free_frames.next; -+ list_del(element); -+ kfree(list_entry(element, struct ipw_frame, list)); -+ priv->frames_count--; -+ } -+ -+ if (priv->frames_count) { -+ IPW_WARNING -+ ("%d frames still in use. Did we lose one?\n", -+ priv->frames_count); -+ priv->frames_count = 0; -+ } -+} -+ -+#define FREE_FRAME_THRESHOLD 5 -+static struct ipw_frame *ipw_get_free_frame(struct ipw_priv *priv) -+{ -+ struct ipw_frame *frame; -+ struct list_head *element; -+ if (list_empty(&priv->free_frames)) { -+ frame = kzalloc(sizeof(*frame), GFP_ATOMIC); -+ if (!frame) { -+ IPW_ERROR("Could not allocate frame!\n"); -+ return 0; -+ } -+ -+ priv->frames_count++; -+ -+ if (priv->frames_count >= FREE_FRAME_THRESHOLD) { -+ IPW_WARNING("%d frames allocated. " -+ "Are we losing them?\n", -+ priv->frames_count); -+ } -+ -+ return frame; -+ } -+ -+ element = priv->free_frames.next; -+ list_del(element); -+ return list_entry(element, struct ipw_frame, list); -+} -+ -+static void ipw_free_frame(struct ipw_priv *priv, struct ipw_frame *frame) -+{ -+ memset(frame, 0, sizeof(*frame)); -+ list_add(&frame->list, &priv->free_frames); -+} -+ -+static void ipw_clear_daemon_lists(struct ipw_priv *priv) -+{ -+ struct list_head *element; -+ struct ipw_daemon_cmd_list *daemon_cmd; -+ -+ /* NOTE: The daemon_lock must be held before calling this -+ * function */ -+ -+ /* Clear out any pending sysfs commands */ -+ while (!list_empty(&priv->daemon_in_list)) { -+ element = priv->daemon_in_list.next; -+ daemon_cmd = list_entry(element, -+ struct ipw_daemon_cmd_list, list); -+ list_del(element); -+ kfree(daemon_cmd); -+ } -+ -+ /* Clear out any pending sysfs responses */ -+ while (!list_empty(&priv->daemon_out_list)) { -+ element = priv->daemon_out_list.next; -+ daemon_cmd = list_entry(element, -+ struct ipw_daemon_cmd_list, list); -+ list_del(element); -+ if (daemon_cmd->skb_resp) -+ dev_kfree_skb_any(daemon_cmd->skb_resp); -+ kfree(daemon_cmd); -+ } -+ -+ /* Clear out any storage buffers in the free list */ -+ while (!list_empty(&priv->daemon_free_list)) { -+ element = priv->daemon_free_list.next; -+ daemon_cmd = list_entry(element, -+ struct ipw_daemon_cmd_list, list); -+ list_del(element); -+ kfree(daemon_cmd); -+ } -+} -+ -+static ssize_t show_temperature(struct device *d, -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) -+ struct device_attribute *attr, -+#endif -+ char *buf) -+{ -+ struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; -+ int rc; -+ -+ rc = ipw_block_until_driver_ready(priv); -+ if (rc) -+ return rc; -+ -+ return sprintf(buf, "%d\n", ipw_read32(priv, CSR_UCODE_DRV_GP2)); -+} -+ -+static DEVICE_ATTR(temperature, S_IRUGO, show_temperature, NULL); -+ -+#ifdef CONFIG_IPW3945_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 (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ 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); -+ -+static ssize_t store_rtap_filter(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); -+ -+ if (!priv->prom_priv) { -+ IPW_ERROR("Attempting to set filter without " -+ "rtap_iface enabled.\n"); -+ return -EPERM; -+ } -+ -+ priv->prom_priv->filter = simple_strtol(buf, NULL, 0); -+ -+ IPW_DEBUG_INFO("Setting rtap filter to " BIT_FMT16 "\n", -+ BIT_ARG16(priv->prom_priv->filter)); -+ -+ return count; -+} -+ -+static ssize_t show_rtap_filter(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); -+ return sprintf(buf, "0x%04X", -+ priv->prom_priv ? priv->prom_priv->filter : 0); -+} -+ -+static DEVICE_ATTR(rtap_filter, S_IWUSR | S_IRUSR, show_rtap_filter, -+ store_rtap_filter); -+#endif -+ -+static ssize_t store_retry_rate(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); -+ -+ priv->retry_rate = simple_strtoul(buf, NULL, 0); -+ if (priv->retry_rate <= 0) -+ priv->retry_rate = 1; -+ -+ return count; -+} -+ -+static ssize_t show_retry_rate(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); -+ return sprintf(buf, "%d", priv->retry_rate); -+} -+ -+static DEVICE_ATTR(retry_rate, S_IWUSR | S_IRUSR, show_retry_rate, -+ store_retry_rate); -+ -+static void ipw_bg_daemon_cmd(void *data); -+static ssize_t store_cmd(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); -+ struct daemon_cmd_hdr *in_cmd = (struct daemon_cmd_hdr *)buf; -+ struct ipw_daemon_cmd_list *daemon_cmd; -+ unsigned long flags; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return -EAGAIN; -+ -+ if (priv->status & STATUS_IN_SUSPEND) -+ return -ERESTARTSYS; -+ -+ if (count < sizeof(*in_cmd)) { -+ IPW_WARNING -+ ("Bad command packet header received (%zd < %zd).\n", -+ count, sizeof(*in_cmd)); -+ return 0; -+ } -+ -+ if (in_cmd->version != IPW_DAEMON_VERSION) { -+ IPW_ERROR -+ ("driver / daemon (ipw3945d) protocol version " -+ "mismatch (v%d vs. v%d).\n", IPW_DAEMON_VERSION, -+ in_cmd->version); -+ IPW_ERROR("You need to upgrade the %s.\n", -+ in_cmd->version > -+ IPW_DAEMON_VERSION ? "driver" : "daemon"); -+ return -EIO; -+ } -+ -+ if (count < sizeof(*in_cmd) + in_cmd->data_len) { -+ IPW_WARNING -+ ("Bad command packet payload received (%zd < %zd).\n", -+ count, sizeof(*in_cmd) + in_cmd->data_len); -+ return 0; -+ } -+ -+ IPW_DEBUG_DAEMON("driver <- daemon #%02X (%d bytes).\n", -+ in_cmd->cmd, in_cmd->data_len); -+ -+ /* Rather than allocate just enough storage for the incoming command, -+ * we allocate enough for the command to be used for any return -+ * as well. */ -+ daemon_cmd = kmalloc(sizeof(*daemon_cmd) + DAEMON_BUF_SIZE, GFP_KERNEL); -+ if (!daemon_cmd) -+ return count; -+ -+ memcpy(&daemon_cmd->cmd, buf, sizeof(*in_cmd) + in_cmd->data_len); -+ daemon_cmd->skb_resp = NULL; -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ list_add_tail(&daemon_cmd->list, &priv->daemon_in_list); -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ queue_work(priv->daemonqueue, &priv->daemon_cmd_work); -+ -+ return sizeof(*in_cmd) + in_cmd->data_len; -+} -+ -+static ssize_t show_cmd(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); -+ struct list_head *element; -+ struct ipw_daemon_cmd_list *daemon_cmd; -+ struct ipw_rx_packet *res; -+ int count; -+ int rc; -+ unsigned long flags; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return -EAGAIN; -+ -+ while (1) { -+ /* The regulatory daemon has to perform periodic calculations -+ * based on various conditions (most notably temperature). -+ * -+ * However, as sysfs does not have a polling capability -+ * and the daemon is single threaded, it blocks on reads -+ * from this sysfs entry. We therefore have to -+ * -+ * The driver, therefore, will return ETIMEDOUT to the daemon -+ * if no commands are received to be sent to the daemon within -+ * DAEMON_POLL_INTERVAL ms. -+ */ -+ rc = wait_event_interruptible_timeout(priv-> -+ wait_daemon_out_queue, -+ !list_empty -+ (&priv-> -+ daemon_out_list), -+ msecs_to_jiffies -+ (DAEMON_POLL_INTERVAL)); -+ -+ if (rc < 0) { -+ if (rc == -ERESTARTSYS) -+ IPW_DEBUG_INFO -+ ("Returning ESYSRESTART to " "daemon.\n"); -+ else -+ IPW_DEBUG_DAEMON -+ ("wait returned failure: " "%d\n", rc); -+ return rc; -+ } -+ -+ if (rc == 0) { -+ struct daemon_cmd_hdr cmd = { -+ .cmd = DAEMON_READ_TIMEOUT, -+ .version = IPW_DAEMON_VERSION, -+ .data_len = 0, -+ }; -+ -+ IPW_DEBUG_DAEMON("DAEMON_POLL_INTERVAL expired.\n"); -+ -+ memcpy(buf, &cmd, sizeof(cmd)); -+ return sizeof(cmd); -+ } -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ if (!list_empty(&priv->daemon_out_list)) -+ break; -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ IPW_DEBUG_INFO("Daemon queue drained on last wait.\n"); -+ -+ continue; -+ } -+ -+ /* daemon_lock still held... while() exited via break */ -+ element = priv->daemon_out_list.next; -+ daemon_cmd = list_entry(element, struct ipw_daemon_cmd_list, list); -+ list_del(element); -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ if (priv->status & STATUS_DCMD_ACTIVE) -+ IPW_DEBUG_DAEMON("Synchronous daemon command pending.\n"); -+ -+ count = 0; -+ -+ /* If token is not 0 then this is a response to a daemon request, -+ * else its a new request to daemon */ -+ if (daemon_cmd->cmd.token != 0) { -+ if (daemon_cmd->skb_resp) { -+ res = (struct ipw_rx_packet *) -+ daemon_cmd->skb_resp->data; -+ -+ daemon_cmd->cmd.data_len = -+ offsetof(struct ipw_rx_packet, hdr) + res->len; -+ memcpy(&buf[sizeof(daemon_cmd->cmd)], res, -+ daemon_cmd->cmd.data_len); -+ count += daemon_cmd->cmd.data_len; -+ -+ IPW_DEBUG_DAEMON -+ ("driver -> daemon skb ACK w/ response " -+ "to #%02X (%d bytes).\n", -+ daemon_cmd->cmd.cmd, res->len); -+ -+ dev_kfree_skb_any(daemon_cmd->skb_resp); -+ } else if (daemon_cmd->cmd.data_len) { -+ memcpy(&buf[sizeof(daemon_cmd->cmd)], -+ daemon_cmd->cmd.data, daemon_cmd->cmd.data_len); -+ count += daemon_cmd->cmd.data_len; -+ IPW_DEBUG_DAEMON -+ ("driver -> daemon ACK w/ response " -+ "to #%02X (%d bytes).\n", -+ daemon_cmd->cmd.cmd, daemon_cmd->cmd.data_len); -+ } else { -+ IPW_DEBUG_DAEMON -+ ("driver -> daemon ACK on #%02X.\n", -+ daemon_cmd->cmd.cmd); -+ /* In the case of an ACK, no data is returned back -+ * to the daemon; just the command packet */ -+ } -+ } else { -+ memcpy(&buf[sizeof(daemon_cmd->cmd)], -+ daemon_cmd->cmd.data, daemon_cmd->cmd.data_len); -+ count += daemon_cmd->cmd.data_len; -+ -+ IPW_DEBUG_DAEMON -+ ("driver -> daemon #%02X (%d bytes).\n", -+ daemon_cmd->cmd.cmd, daemon_cmd->cmd.data_len); -+ } -+ -+ daemon_cmd->cmd.version = IPW_DAEMON_VERSION; -+ memcpy(buf, &daemon_cmd->cmd, sizeof(daemon_cmd->cmd)); -+ count += sizeof(daemon_cmd->cmd); -+ -+ kfree(daemon_cmd); -+ -+ return count; -+} -+ -+static DEVICE_ATTR(cmd, S_IWUSR | S_IRUSR, show_cmd, store_cmd); -+ -+#ifdef CONFIG_IPW3945_SIM_RX -+/* Tx/Rx simulation interface -+ * -+ * This will eventually be moved to being a real network interface -+ * exposed via netlink. For now, however, quickest path to prototype -+ * is through sysfs... */ -+ -+/* sysfs entry rx - -+ * writing used to simulate receipt of a frame. -+ * Format: -+ * RADIOTAP HEADER -+ * 802.11 FRAME -+ */ -+static void ipw_handle_reply_rx(struct ipw_priv *, struct ipw_rx_mem_buffer *); -+static ssize_t store_rx(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); -+ struct ipw_rt_hdr *rt = (void *)buf; -+ struct ipw_rx_packet *pkt; -+ struct ipw_rx_mem_buffer rxb; -+ struct ipw_rx_frame_stats *rx_stats; -+ struct ipw_rx_frame_hdr *rx_hdr; -+ struct ipw_rx_frame_end *rx_end; -+ u16 len; -+ unsigned long flags; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return -EAGAIN; -+ -+ if (priv->status & STATUS_IN_SUSPEND) -+ return -ERESTARTSYS; -+ -+ if (count < sizeof(*rt)) { -+ IPW_WARNING -+ ("Simulated RX frame of wrong size (%zd < %zd).\n", -+ count, sizeof(*rt)); -+ return 0; -+ } -+ -+ /* Check radiotap header... */ -+ if (rt->rt_hdr.it_version != PKTHDR_RADIOTAP_VERSION) { -+ IPW_ERROR("driver / app protocol version " -+ "mismatch (v%d vs. v%d).\n", -+ PKTHDR_RADIOTAP_VERSION, rt->rt_hdr.it_version); -+ return -EIO; -+ } -+ -+ len = count - sizeof(*rt); -+ if (!len) { -+ IPW_WARNING("No 802.11 contents to transmit.\n"); -+ return count; -+ } -+ -+ memset(&rxb, 0, sizeof(rxb)); -+ rxb.skb = dev_alloc_skb(sizeof(struct ipw_rx_frame) + len); -+ if (!rxb.skb) { -+ IPW_ERROR("Coult not allocate storage for simulated Rx.\n"); -+ return -ENOMEM; -+ } -+ pkt = (void *)rxb.skb->data; -+ -+ /* Fill in rx_stats */ -+ rx_stats = IPW_RX_STATS(pkt); -+ rx_stats->mib_count = 0; -+ rx_stats->rssi = rt->rt_dbmsignal + IPW_RSSI_OFFSET; -+ rx_stats->noise_diff = rt->rt_dbmnoise; -+ -+ /* Fill in rx_hdr -+ * NOTE: rx_stats->mib_count is needed before IPW_RX_END can work */ -+ rx_hdr = IPW_RX_HDR(pkt); -+ rx_hdr->len = len; -+ -+ rx_hdr->phy_flags = 0; -+ rx_hdr->phy_flags |= -+ (rt-> -+ rt_chbitmask & IEEE80211_CHAN_2GHZ) ? -+ RX_RES_PHY_FLAGS_BAND_24_MSK : 0; -+ rx_hdr->phy_flags |= -+ (rt-> -+ rt_chbitmask & IEEE80211_CHAN_CCK) ? -+ RX_RES_PHY_FLAGS_MOD_CCK_MSK : 0; -+ rx_hdr->phy_flags |= -+ (rt->rt_antenna << 4) & RX_RES_PHY_FLAGS_ANTENNA_MSK; -+ rx_hdr->phy_flags |= -+ (rt-> -+ rt_flags & IEEE80211_RADIOTAP_F_SHORTPRE) ? -+ RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK : 0; -+ rx_hdr->channel = rt->rt_channel; -+ -+ switch (rt->rt_rate) { -+ case 2: -+ rx_hdr->rate = IPW_TX_RATE_1MB; -+ break; -+ case 4: -+ rx_hdr->rate = IPW_TX_RATE_2MB; -+ break; -+ case 10: -+ rx_hdr->rate = IPW_TX_RATE_5MB; -+ break; -+ case 12: -+ rx_hdr->rate = IPW_TX_RATE_9MB; -+ break; -+ case 18: -+ rx_hdr->rate = IPW_TX_RATE_11MB; -+ break; -+ case 22: -+ rx_hdr->rate = IPW_TX_RATE_12MB; -+ break; -+ case 36: -+ rx_hdr->rate = IPW_TX_RATE_18MB; -+ break; -+ case 48: -+ rx_hdr->rate = IPW_TX_RATE_24MB; -+ break; -+ case 72: -+ rx_hdr->rate = IPW_TX_RATE_36MB; -+ break; -+ case 96: -+ rx_hdr->rate = IPW_TX_RATE_48MB; -+ break; -+ case 108: -+ rx_hdr->rate = IPW_TX_RATE_54MB; -+ break; -+ default: -+ rx_hdr->rate = 0; -+ break; -+ break; -+ } -+ -+ /* Fill in rx_end -+ * NOTE: rx_hdr->len is needed before IPW_RX_END can work */ -+ rx_end = IPW_RX_END(pkt); -+ if (rt->rt_hdr.it_present & (1 << IEEE80211_RADIOTAP_TSFT)) -+ rx_end->beaconTimeStamp = rt->rt_tsf; -+ else { -+ rx_end->beaconTimeStamp = priv->last_beacon_time + -+ jiffies_to_msecs(jiffies) - -+ jiffies_to_msecs(priv->last_rx_jiffies); -+ } -+ rx_end->status = RX_RES_STATUS_NO_RXE_OVERFLOW | -+ RX_RES_STATUS_NO_CRC32_ERROR; -+ rx_end->timestamp = priv->last_tsf; -+ -+ memcpy(IPW_RX_DATA(pkt), rt->payload, len); -+ -+ /* ipw_handle_reply_rx is intended to be called typically from -+ * tasklet context; so we need to lock... */ -+ IPW_DEBUG_INFO -+ ("Simulating Rx of %ud [%zd] bytes @ %08X%08X.\n", len, -+ count, (rx_end->beaconTimeStamp & 0xffffffff) > 32, -+ (rx_end->beaconTimeStamp & 0xffffffff)); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ ipw_handle_reply_rx(priv, &rxb); -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ if (rxb.skb != NULL) -+ dev_kfree_skb_any(rxb.skb); -+ -+ return count; -+} -+ -+static DEVICE_ATTR(rx, S_IWUSR, NULL, store_rx); -+#endif -+ -+static ssize_t show_eeprom(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); -+ memcpy(buf, priv->eeprom, EEPROM_IMAGE_SIZE); -+ return EEPROM_IMAGE_SIZE; -+} -+ -+static DEVICE_ATTR(eeprom, S_IRUSR, show_eeprom, NULL); -+ -+#define GEO_PRINT(b,x) ((geo-> b[i].flags & IEEE80211_CH_##x) ? # x " " : "") -+static ssize_t show_channels(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); -+ const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); -+ int len = 0, i; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ len += -+ sprintf(&buf[len], -+ "Displaying %d channels in 2.4Ghz band " -+ "(802.11bg):\n", geo->bg_channels); -+ -+ for (i = 0; i < geo->bg_channels; i++) { -+ len += sprintf(&buf[len], "%d: %ddBm: BSS%s%s, %s.\n", -+ geo->bg[i].channel, -+ geo->bg[i].max_power, -+ geo->bg[i]. -+ flags & IEEE80211_CH_RADAR_DETECT ? -+ " (radar spectrum)" : "", -+ ((geo->bg[i].flags & IEEE80211_CH_NO_IBSS) -+ || (geo->bg[i]. -+ flags & -+ IEEE80211_CH_RADAR_DETECT)) ? "" : -+ ", IBSS", -+ geo->bg[i]. -+ flags & IEEE80211_CH_PASSIVE_ONLY ? -+ "passive only" : "active/passive"); -+ } -+ -+ len += -+ sprintf(&buf[len], -+ "Displaying %d channels in 5.2Ghz band " -+ "(802.11a):\n", geo->a_channels); -+ for (i = 0; i < geo->a_channels; i++) { -+ len += sprintf(&buf[len], "%d: %ddBm: BSS%s%s, %s.\n", -+ geo->a[i].channel, -+ geo->a[i].max_power, -+ geo->a[i]. -+ flags & IEEE80211_CH_RADAR_DETECT ? -+ " (radar spectrum)" : "", -+ ((geo->a[i].flags & IEEE80211_CH_NO_IBSS) -+ || (geo->a[i]. -+ flags & -+ IEEE80211_CH_RADAR_DETECT)) ? "" : -+ ", IBSS", -+ geo->a[i]. -+ flags & IEEE80211_CH_PASSIVE_ONLY ? -+ "passive only" : "active/passive"); -+ } -+ -+ return len; -+} -+ -+static DEVICE_ATTR(channels, S_IRUSR, show_channels, NULL); -+ -+static ssize_t show_statistics(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); -+ u32 size = sizeof(priv->statistics), len = 0, ofs = 0; -+ u8 *data = (u8 *) & priv->statistics; -+ int rc = 0; -+ -+ if (!ipw_is_alive(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ rc = ipw_send_statistics_request(priv); -+ mutex_unlock(&priv->mutex); -+ -+ if (rc) { -+ len = sprintf(buf, -+ "Error sending statistics request: 0x%08X\n", rc); -+ return len; -+ } -+ -+ while (size && (PAGE_SIZE - len)) { -+ len += -+ snprint_line(&buf[len], PAGE_SIZE - len, -+ &data[ofs], min(size, 16U), ofs); -+ if (PAGE_SIZE - len) -+ buf[len++] = '\n'; -+ -+ ofs += 16; -+ size -= min(size, 16U); -+ } -+ -+ return len; -+} -+ -+static DEVICE_ATTR(statistics, S_IRUGO, show_statistics, NULL); -+ -+static ssize_t show_scan_age(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 (!ipw_is_alive(priv)) -+ return -EAGAIN; -+ -+ return sprintf(buf, "%d\n", priv->ieee->scan_age); -+} -+ -+static ssize_t store_scan_age(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); -+#ifdef CONFIG_IPW3945_DEBUG -+ struct net_device *dev = priv->net_dev; -+#endif -+ char buffer[] = "00000000"; -+ unsigned long len = -+ (sizeof(buffer) - 1) > count ? count : sizeof(buffer) - 1; -+ unsigned long val; -+ char *p = buffer; -+ -+ IPW_DEBUG_INFO("enter\n"); -+ -+ strncpy(buffer, buf, len); -+ buffer[len] = 0; -+ -+ if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') { -+ p++; -+ if (p[0] == 'x' || p[0] == 'X') -+ p++; -+ val = simple_strtoul(p, &p, 16); -+ } else -+ val = simple_strtoul(p, &p, 10); -+ if (p == buffer) { -+ IPW_DEBUG_INFO("%s: user supplied invalid value.\n", dev->name); -+ } else { -+ priv->ieee->scan_age = val; -+ IPW_DEBUG_INFO("set scan_age = %u\n", priv->ieee->scan_age); -+ } -+ -+ IPW_DEBUG_INFO("exit\n"); -+ return len; -+} -+ -+static DEVICE_ATTR(scan_age, S_IWUSR | S_IRUGO, show_scan_age, store_scan_age); -+ -+static ssize_t show_roam(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 (!ipw_is_alive(priv)) -+ return -EAGAIN; -+ -+ return sprintf(buf, "%d\n", (priv->config & CFG_NO_ROAMING) ? 0 : 1); -+} -+ -+static ssize_t store_roam(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); -+ -+ switch (buf[0]) { -+ case '1': -+ priv->config &= ~CFG_NO_ROAMING; -+ break; -+ case '0': -+ priv->config |= CFG_NO_ROAMING; -+ break; -+ } -+ return count; -+} -+ -+static DEVICE_ATTR(roam, S_IWUSR | S_IRUGO, show_roam, store_roam); -+ -+static ssize_t show_antenna(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 (!ipw_is_alive(priv)) -+ return -EAGAIN; -+ -+ return sprintf(buf, "%d\n", priv->antenna); -+} -+ -+static ssize_t store_antenna(struct device *d, -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) -+ struct device_attribute *attr, -+#endif -+ const char *buf, size_t count) -+{ -+ int ant; -+ struct ipw_priv *priv = dev_get_drvdata(d); -+ -+ if (count == 0) -+ return 0; -+ -+ if (sscanf(buf, "%1i", &ant) != 1) { -+ IPW_DEBUG_INFO("not in hex or decimal form.\n"); -+ return count; -+ } -+ -+ if ((ant >= 0) && (ant <= 2)) { -+ IPW_DEBUG_INFO("Setting antenna select to %d.\n", ant); -+ priv->antenna = ant; -+ } else { -+ IPW_DEBUG_INFO("Bad antenna select value %d.\n", ant); -+ } -+ -+ return count; -+} -+ -+static DEVICE_ATTR(antenna, S_IWUSR | S_IRUGO, show_antenna, store_antenna); -+ -+static ssize_t show_led(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 (!ipw_is_alive(priv)) -+ return -EAGAIN; -+ -+ return sprintf(buf, "%d\n", (priv->config & CFG_NO_LED) ? 0 : 1); -+} -+ -+static ssize_t store_led(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); -+ -+ if (count == 0) -+ return 0; -+ -+ if (*buf == '0') { -+ IPW_DEBUG_LED("Disabling LED control.\n"); -+ priv->config |= CFG_NO_LED; -+ } else { -+ IPW_DEBUG_LED("Enabling LED control.\n"); -+ priv->config &= ~CFG_NO_LED; -+ } -+ -+ ipw_update_link_led(priv); -+ ipw_update_activity_led(priv); -+ ipw_update_tech_led(priv); -+ -+ return count; -+} -+ -+static DEVICE_ATTR(led, S_IWUSR | S_IRUGO, show_led, store_led); -+ -+static ssize_t show_status(struct device *d, -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) -+ struct device_attribute *attr, -+#endif -+ char *buf) -+{ -+ struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; -+ if (!ipw_is_alive(priv)) -+ return -EAGAIN; -+ return sprintf(buf, "0x%08x\n", (int)priv->status); -+} -+ -+static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); -+ -+static ssize_t show_cfg(struct device *d, -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) -+ struct device_attribute *attr, -+#endif -+ char *buf) -+{ -+ struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; -+ -+ if (!ipw_is_alive(priv)) -+ return -EAGAIN; -+ -+ return sprintf(buf, "0x%08x\n", (int)priv->config); -+} -+ -+static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); -+ -+static ssize_t dump_error_log(struct device *d, -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) -+ struct device_attribute *attr, -+#endif -+ const char *buf, size_t count) -+{ -+ char *p = (char *)buf; -+ -+ if (p[0] == '1') -+ ipw_dump_nic_error_log((struct ipw_priv *)d->driver_data); -+ -+ return strnlen(buf, count); -+} -+ -+static DEVICE_ATTR(dump_errors, S_IWUSR, NULL, dump_error_log); -+ -+static ssize_t dump_event_log(struct device *d, -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) -+ struct device_attribute *attr, -+#endif -+ const char *buf, size_t count) -+{ -+ char *p = (char *)buf; -+ -+ if (p[0] == '1') -+ ipw_dump_nic_event_log((struct ipw_priv *)d->driver_data); -+ -+ return strnlen(buf, count); -+} -+ -+static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log); -+ -+static ssize_t show_rf_kill(struct device *d, -+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) -+ struct device_attribute *attr, -+#endif -+ char *buf) -+{ -+ /* 0 - RF kill not enabled -+ 1 - SW based RF kill active (sysfs) -+ 2 - HW based RF kill active -+ 3 - Both HW and SW baed RF kill active */ -+ struct ipw_priv *priv = (struct ipw_priv *)d->driver_data; -+ int val = ((priv->status & STATUS_RF_KILL_SW) ? 0x1 : 0x0) | -+ ((priv->status & STATUS_RF_KILL_HW) ? 0x2 : 0x0); -+ -+ if (!ipw_is_alive(priv)) -+ return -EAGAIN; -+ -+ return sprintf(buf, "%i\n", val); -+} -+ -+static int ipw_scan_schedule(struct ipw_priv *priv, unsigned long ms) -+{ -+ if (priv->status & STATUS_SCAN_ABORTING) { -+ IPW_DEBUG_SCAN -+ ("Scan abort in progress. Deferring scan " "request.\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ return 0; -+ } -+ -+ if (ms) -+ queue_delayed_work(priv->workqueue, -+ &priv->request_scan, msecs_to_jiffies(ms)); -+ else -+ queue_work(priv->workqueue, &priv->request_scan); -+ -+ return 0; -+} -+ -+static int ipw_scan_initiate(struct ipw_priv *priv, int bands, unsigned long ms) -+{ -+ if (!ipw_is_calibrated(priv)) { -+ IPW_DEBUG_SCAN("Scan not initiated -- not calibrated.\n"); -+ return -EAGAIN; -+ } -+ -+ if (priv->status & STATUS_SCANNING) { -+ IPW_DEBUG_SCAN("Scan already in progress.\n"); -+ return 0; -+ } -+ -+ if (priv->status & STATUS_EXIT_PENDING) { -+ IPW_DEBUG_SCAN("Aborting scan due to device shutdown\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ return 0; -+ } -+ -+ if (priv->status & STATUS_SCAN_ABORTING) { -+ IPW_DEBUG_HC("Scan request while abort pending. Queuing.\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ return 0; -+ } -+ -+ if (priv->status & STATUS_RF_KILL_MASK) { -+ IPW_DEBUG_HC("Aborting scan due to RF Kill activation\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ return 0; -+ } -+ -+ if (!(priv->status & STATUS_READY)) { -+ IPW_DEBUG_HC("Scan request while uninitialized. Queuing.\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ return 0; -+ } -+ -+ if (priv->status & STATUS_ASSOCIATING) { -+ IPW_DEBUG_HC("Scan request while associating. Queuing.\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ return 0; -+ } -+ -+ priv->scan_bands = bands; -+ priv->scan_bands_remaining = bands; -+ -+ IPW_DEBUG_INFO("Setting scan to on\n"); -+ priv->status |= STATUS_SCANNING; -+ priv->scan_passes = 0; -+ priv->scan_start = jiffies; -+ priv->scan_pass_start = priv->scan_start; -+ -+ return ipw_scan_schedule(priv, ms); -+} -+ -+static int ipw_scan_cancel(struct ipw_priv *priv) -+{ -+ if (priv->status & STATUS_SCAN_PENDING) { -+ IPW_DEBUG_SCAN("Cancelling pending scan request.\n"); -+ priv->status &= ~STATUS_SCAN_PENDING; -+ cancel_delayed_work(&priv->request_scan); -+ } -+ -+ if (priv->status & STATUS_SCANNING) { -+ if (!(priv->status & STATUS_SCAN_ABORTING)) { -+ IPW_DEBUG_SCAN("Queuing scan abort.\n"); -+ priv->status |= STATUS_SCAN_ABORTING; -+ queue_work(priv->workqueue, &priv->abort_scan); -+ } else { -+ IPW_DEBUG_SCAN("Scan abort already in progress.\n"); -+ } -+ } -+ -+ return 0; -+} -+ -+static inline unsigned long elapsed_jiffies(unsigned long start, -+ unsigned long end) -+{ -+ if (end > start) -+ return end - start; -+ -+ return end + (MAX_JIFFY_OFFSET - start); -+} -+ -+static int ipw_scan_completed(struct ipw_priv *priv, int success) -+{ -+ /* The HW is no longer scanning */ -+ priv->status &= ~STATUS_SCAN_HW; -+ -+ /* The scan completion notification came in, so kill that timer... */ -+ cancel_delayed_work(&priv->scan_check); -+ -+ /* Notify the user space daemon that we are out of scan... */ -+ ipw_send_daemon_sync(priv, DAEMON_SYNC_SCAN_COMPLETE, 0, NULL); -+ -+ priv->scan_passes++; -+ IPW_DEBUG_INFO("Scan pass #%d on %sGhz took %dms\n", -+ priv->scan_passes, -+ (priv->scan_flags & DAEMON_SCAN_FLAG_24GHZ) ? -+ "2.4" : "5.2", -+ jiffies_to_msecs(elapsed_jiffies -+ (priv->scan_pass_start, jiffies))); -+ -+ /* Remove this scanned band from the list -+ * of pending bands to scan */ -+ if (priv->scan_flags & DAEMON_SCAN_FLAG_24GHZ) -+ priv->scan_bands_remaining &= ~IEEE80211_24GHZ_BAND; -+ else -+ priv->scan_bands_remaining &= ~IEEE80211_52GHZ_BAND; -+ -+ /* If a request to abort was given, or the scan did not succeed -+ * then we reset the scan state machine and terminate, -+ * re-queuing another scan if one has been requested */ -+ if (priv->status & STATUS_SCAN_ABORTING) { -+ IPW_DEBUG_INFO("Aborted scan completed.\n"); -+ priv->status &= ~STATUS_SCAN_ABORTING; -+ } else { -+ /* If there are more bands on this scan pass reschedule */ -+ if (priv->scan_bands_remaining) -+ goto reschedule; -+ } -+ -+ IPW_DEBUG_INFO("Setting scan to off\n"); -+ -+ priv->one_direct_scan = 0; -+ priv->status &= ~STATUS_SCANNING; -+ priv->ieee->scans++; -+ -+ IPW_DEBUG_INFO("Scan took %dms\n", -+ jiffies_to_msecs(elapsed_jiffies -+ (priv->scan_start, jiffies))); -+ -+ queue_work(priv->workqueue, &priv->update_link_led); -+ -+ if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING | -+ STATUS_ROAMING | STATUS_DISASSOCIATING))) { -+ queue_work(priv->workqueue, &priv->associate); -+ return 0; -+ } -+ -+ if (priv->status & STATUS_ROAMING) { -+ /* If a scan completed and we are in roam mode, then -+ * the scan that completed was the one requested as a -+ * result of entering roam... so, schedule the -+ * roam work */ -+ queue_work(priv->workqueue, &priv->roam); -+ return 0; -+ } -+ -+ if ((priv->config & CFG_BACKGROUND_SCAN) && -+ (priv->status & STATUS_ASSOCIATED)) { -+ ipw_scan_initiate(priv, priv->ieee->freq_band, SCAN_INTERVAL); -+ -+ return 0; -+ } -+ -+ if (priv->status & STATUS_SCAN_PENDING) { -+ ipw_scan_initiate(priv, priv->ieee->freq_band, 0); -+ return 0; -+ } -+ -+ reschedule: -+ priv->scan_pass_start = jiffies; -+ ipw_scan_schedule(priv, 0); -+ -+ return 0; -+} -+ -+static void ipw_radio_kill_sw(struct ipw_priv *priv, int disable_radio) -+{ -+ if ((disable_radio ? 1 : 0) == -+ ((priv->status & STATUS_RF_KILL_SW) ? 1 : 0)) -+ return; -+ -+ IPW_DEBUG_RF_KILL("Manual SW RF KILL set to: RADIO %s\n", -+ disable_radio ? "OFF" : "ON"); -+ -+ if (disable_radio) { -+ ipw_update_link_led(priv); -+ ipw_scan_cancel(priv); -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_SET, -+ CSR_UCODE_SW_BIT_RFKILL); -+ ipw_send_card_state(priv, CARD_STATE_CMD_DISABLE, 0); -+ priv->status |= STATUS_RF_KILL_SW; -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_SET, -+ CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); -+ return; -+ } -+ -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); -+ -+ priv->status &= ~STATUS_RF_KILL_SW; -+ -+ if (priv->status & STATUS_RF_KILL_HW) { -+ IPW_DEBUG_RF_KILL("Can not turn radio back on - " -+ "disabled by HW switch\n"); -+ return; -+ } -+ -+ queue_work(priv->workqueue, &priv->down); -+ -+ return; -+} -+ -+static ssize_t store_rf_kill(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 = (struct ipw_priv *)d->driver_data; -+ -+ mutex_lock(&priv->mutex); -+ ipw_radio_kill_sw(priv, buf[0] == '1'); -+ mutex_unlock(&priv->mutex); -+ -+ return count; -+} -+ -+static DEVICE_ATTR(rf_kill, S_IWUSR | S_IRUGO, show_rf_kill, store_rf_kill); -+ -+static void notify_wx_assoc_event(struct ipw_priv *priv) -+{ -+ union iwreq_data wrqu; -+ wrqu.ap_addr.sa_family = ARPHRD_ETHER; -+ if (priv->status & STATUS_ASSOCIATED) -+ memcpy(wrqu.ap_addr.sa_data, priv->bssid, ETH_ALEN); -+ else -+ memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); -+ wireless_send_event(priv->net_dev, SIOCGIWAP, &wrqu, NULL); -+} -+ -+#ifdef CONFIG_IPW3945_DEBUG -+static void ipw_print_rx_config_cmd(struct daemon_rx_config *rxon) -+{ -+ IPW_DEBUG_RADIO("RX CONFIG:\n"); -+ printk_buf(IPW_DL_RADIO, (u8 *) rxon, sizeof(*rxon)); -+ IPW_DEBUG_RADIO("u16 channel: 0x%x\n", rxon->channel); -+ IPW_DEBUG_RADIO("u32 flags: 0x%08X " BIT_FMT32 "\n", -+ rxon->flags, BIT_ARG32(rxon->flags)); -+ IPW_DEBUG_RADIO("u32 filter_flags: 0x%08x " BIT_FMT32 "\n", -+ rxon->filter_flags, BIT_ARG32(rxon->filter_flags)); -+ IPW_DEBUG_RADIO("u8 dev_type: 0x%x\n", rxon->dev_type); -+ IPW_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x " BIT_FMT8 "\n", -+ rxon->ofdm_basic_rates, -+ BIT_ARG8(rxon->ofdm_basic_rates)); -+ IPW_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x " BIT_FMT8 "\n", -+ rxon->cck_basic_rates, BIT_ARG8(rxon->cck_basic_rates)); -+ IPW_DEBUG_RADIO("u8[6] node_addr: " MAC_FMT "\n", -+ MAC_ARG(rxon->node_addr)); -+ IPW_DEBUG_RADIO("u8[6] bssid_addr: " MAC_FMT "\n", -+ MAC_ARG(rxon->bssid_addr)); -+ IPW_DEBUG_RADIO("u16 assoc_id: 0x%x\n", rxon->assoc_id); -+} -+#endif -+ -+static void ipw_irq_handle_error(struct ipw_priv *priv) -+{ -+ /* Set the FW error flag -- cleared on ipw_down */ -+ priv->status |= STATUS_FW_ERROR; -+ -+ /* Cancel currently queued command. */ -+ priv->status &= ~STATUS_HCMD_ACTIVE; -+ -+#ifdef CONFIG_IPW3945_DEBUG -+ if (ipw_debug_level & IPW_DL_FW_ERRORS) { -+ ipw_dump_nic_error_log(priv); -+ ipw_dump_nic_event_log(priv); -+ ipw_print_rx_config_cmd(&priv->rxon); -+ } -+#endif -+ -+ wake_up_interruptible(&priv->wait_command_queue); -+ -+ /* Keep the restart process from trying to send host -+ * commands by clearing the INIT status bit */ -+ priv->status &= ~STATUS_READY; -+ if (!(priv->status & STATUS_EXIT_PENDING)) { -+ IPW_DEBUG(IPW_DL_INFO | IPW_DL_FW_ERRORS, -+ "Restarting adapter due to uCode error.\n"); -+ queue_work(priv->workqueue, &priv->down); -+ } -+} -+ -+static void ipw_irq_tasklet(struct ipw_priv *priv) -+{ -+ u32 inta, inta_mask, handled = 0; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ -+ inta = ipw_read32(priv, CSR_INT); -+ inta_mask = ipw_read32(priv, CSR_INT_MASK); -+ ipw_write32(priv, CSR_INT, inta); -+ inta &= (CSR_INI_SET_MASK & inta_mask); -+ -+ /* Add any cached INTA values that need to be handled */ -+ inta |= priv->isr_inta; -+ -+ if (inta & BIT_INT_ERR) { -+ IPW_ERROR("Microcode HW error detected. Restarting.\n"); -+ -+ /* tell the device to stop sending interrupts */ -+ ipw_disable_interrupts(priv); -+ -+ ipw_irq_handle_error(priv); -+ -+ handled |= BIT_INT_ERR; -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ return; -+ } -+ -+ if (inta & BIT_INT_SWERROR) { -+ IPW_ERROR("Microcode SW error detected. Restarting.\n"); -+ ipw_irq_handle_error(priv); -+ handled |= BIT_INT_SWERROR; -+ } -+ -+ if (inta & BIT_INT_WAKEUP) { -+ IPW_DEBUG_ISR("Wakeup interrupt\n"); -+ ipw_rx_queue_update_write_ptr(priv, priv->rxq); -+ ipw_tx_queue_update_write_ptr(priv, &priv->txq[0], 0); -+ ipw_tx_queue_update_write_ptr(priv, &priv->txq[1], 1); -+ ipw_tx_queue_update_write_ptr(priv, &priv->txq[2], 2); -+ ipw_tx_queue_update_write_ptr(priv, &priv->txq[3], 3); -+ ipw_tx_queue_update_write_ptr(priv, &priv->txq[4], 4); -+ ipw_tx_queue_update_write_ptr(priv, &priv->txq[5], 5); -+ -+ handled |= BIT_INT_WAKEUP; -+ } -+ -+ if (inta & BIT_INT_ALIVE) { -+ IPW_DEBUG_ISR("Alive interrupt\n"); -+ handled |= BIT_INT_ALIVE; -+ } -+ -+ /* handle all the justifications for the interrupt */ -+ if (inta & BIT_INT_RX) { -+ // IPW_DEBUG_ISR("Rx interrupt\n"); -+ ipw_rx_handle(priv); -+ handled |= BIT_INT_RX; -+ } -+ -+ if (inta & BIT_INT_TX) { -+ IPW_DEBUG_ISR("Command completed.\n"); -+ ipw_write32(priv, CSR_FH_INT_STATUS, (1 << 6)); -+ if (ipw_grab_restricted_access(priv)) { -+ ipw_write_restricted(priv, -+ FH_TCSR_CREDIT -+ (ALM_FH_SRVC_CHNL), 0x0); -+ ipw_release_restricted_access(priv); -+ } -+ -+ handled |= BIT_INT_TX; -+ } -+ -+ if (handled != inta) { -+ IPW_ERROR("Unhandled INTA bits 0x%08x\n", inta & ~handled); -+ } -+ -+ /* enable all interrupts */ -+ ipw_enable_interrupts(priv); -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+} -+ -+/****************** 3945ABG-FUNCTIONS *********************/ -+ -+static int ipw_rf_eeprom_ready(struct ipw_priv *priv) -+{ -+ u8 sku_cap; -+ int rc; -+ -+ rc = ipw_query_eeprom(priv, EEPROM_SKU_CAP, sizeof(u8), -+ (u8 *) & sku_cap); -+ if (rc) { -+ IPW_WARNING("failed to read EEPROM_SKU_CAP\n"); -+ return rc; -+ } -+ -+ if (sku_cap & EEPROM_SKU_CAP_SW_RF_KILL_ENABLE) -+ priv->capability |= CAP_RF_SW_KILL; -+ else -+ priv->capability &= ~CAP_RF_SW_KILL; -+ -+ if (sku_cap & EEPROM_SKU_CAP_HW_RF_KILL_ENABLE) -+ priv->capability |= CAP_RF_HW_KILL; -+ else -+ priv->capability &= ~CAP_RF_HW_KILL; -+ -+ switch (priv->capability & (CAP_RF_HW_KILL | CAP_RF_SW_KILL)) { -+ case CAP_RF_HW_KILL: -+ IPW_DEBUG_RF_KILL("HW RF KILL supported in EEPROM.\n"); -+ break; -+ case CAP_RF_SW_KILL: -+ IPW_DEBUG_RF_KILL("SW RF KILL supported in EEPROM.\n"); -+ break; -+ case (CAP_RF_HW_KILL | CAP_RF_SW_KILL): -+ IPW_DEBUG_RF_KILL("HW & HW RF KILL supported in EEPROM.\n"); -+ break; -+ default: -+ IPW_DEBUG_RF_KILL("NO RF KILL supported in EEPROM.\n"); -+ break; -+ } -+ -+ return 0; -+} -+ -+static int ipw_send_rates_scaling_cmd(struct ipw_priv *priv, struct RateScalingCmdSpecifics -+ *rate) -+{ -+ return ipw_send_cmd_pdu(priv, REPLY_RATE_SCALE, -+ sizeof(struct RateScalingCmdSpecifics), rate); -+} -+ -+static int ipw_send_rx_config(struct ipw_priv *priv) -+{ -+ struct ipw_daemon_cmd_list *element; -+ int rc = 0; -+ -+ element = -+ kmalloc(sizeof(*element) + -+ sizeof(struct daemon_rx_config), GFP_ATOMIC); -+ -+ if (!element) -+ return -ENOMEM; -+ -+ element->cmd.cmd = DAEMON_RX_CONFIG; -+ element->cmd.data_len = sizeof(struct daemon_rx_config); -+ element->cmd.flags = DAEMON_FLAG_WANT_RESULT; -+ memcpy(element->cmd.data, &priv->rxon, sizeof(struct daemon_rx_config)); -+ -+ rc = ipw_send_daemon_cmd(priv, element); -+ -+ IPW_DEBUG_INFO("Returned from ipw_send_daemon_cmd.\n"); -+ -+ return rc; -+} -+ -+static int ipw_rxon_assoc_callback(struct ipw_priv *priv, -+ struct ipw_cmd *cmd, struct sk_buff *skb) -+{ -+ struct ipw_rx_packet *res = NULL; -+ -+ if (!skb) { -+ IPW_ERROR("error: response NULL in REPLY_RX_ON_ASSOC.\n"); -+ return 1; -+ } -+ -+ res = (struct ipw_rx_packet *)skb->data; -+ if (res->hdr.flags & 0x40) { -+ IPW_ERROR("bad return from REPLY_RX_ON_ASSOC.\n"); -+ return 1; -+ } -+ -+ dev_kfree_skb_any(skb); -+ return 0; -+} -+ -+static int ipw_send_rxon_assoc(struct ipw_priv *priv, u8 flags) -+{ -+ int rc = 0; -+ struct ipw_rx_packet *res = NULL; -+ struct ipw_rxon_assoc_cmd rxon_assoc; -+ struct ipw_host_cmd cmd = { -+ .id = REPLY_RX_ON_ASSOC, -+ .len = sizeof(struct ipw_rxon_assoc_cmd), -+ .meta.flags = flags, -+ .data = &rxon_assoc, -+ }; -+ -+ if (flags & CMD_ASYNC) -+ cmd.meta.u.callback = ipw_rxon_assoc_callback; -+ -+ rxon_assoc.flags = priv->rxon.flags; -+ rxon_assoc.filter_flags = priv->rxon.filter_flags; -+ rxon_assoc.ofdm_basic_rates = priv->rxon.ofdm_basic_rates; -+ rxon_assoc.cck_basic_rates = priv->rxon.cck_basic_rates; -+ rxon_assoc.reserved = 0; -+ -+ rc = ipw_send_cmd(priv, &cmd); -+ if (rc || (flags & CMD_ASYNC)) -+ return rc; -+ -+ res = (struct ipw_rx_packet *)cmd.meta.u.skb->data; -+ if (res->hdr.flags & 0x40) { -+ IPW_ERROR("Bad return from REPLY_RX_ON_ASSOC command\n"); -+ rc = -EIO; -+ } -+ -+ dev_kfree_skb_any(cmd.meta.u.skb); -+ -+ return rc; -+} -+ -+static int ipw_rxon_assoc_async(struct ipw_priv *priv) -+{ -+ u8 flags = CMD_ASYNC | CMD_NO_LOCK; -+ return ipw_send_rxon_assoc(priv, flags); -+} -+ -+static int ipw_rxon_assoc_sync(struct ipw_priv *priv) -+{ -+ u8 flags = CMD_WANT_SKB; -+ return ipw_send_rxon_assoc(priv, flags); -+} -+ -+static int ipw_add_sta_sync_callback(struct ipw_priv *priv, -+ struct ipw_cmd *cmd, struct sk_buff *skb) -+{ -+ struct ipw_rx_packet *res = NULL; -+ -+ if (!skb) { -+ IPW_ERROR("Error: Response NULL in " "REPLY_ADD_STA.\n"); -+ return 1; -+ } -+ -+ res = (struct ipw_rx_packet *)skb->data; -+ if (res->hdr.flags & 0x40) { -+ IPW_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n", -+ res->hdr.flags); -+ return 1; -+ } -+ -+ switch (res->u.add_sta.status) { -+ case ADD_STA_SUCCESS_MSK: -+ break; -+ default: -+ break; -+ } -+ -+ return 1; /* We didn't cache the SKB; let the caller free it */ -+} -+ -+static int ipw_send_add_station(struct ipw_priv *priv, -+ struct ipw_addsta_cmd *sta, u8 flags) -+{ -+ struct ipw_rx_packet *res = NULL; -+ int rc = 0; -+ struct ipw_host_cmd cmd = { -+ .id = REPLY_ADD_STA, -+ .len = sizeof(struct ipw_addsta_cmd), -+ .meta.flags = flags, -+ .data = sta, -+ }; -+ -+ if (flags & CMD_ASYNC) -+ cmd.meta.u.callback = ipw_add_sta_sync_callback; -+ else -+ cmd.meta.flags |= CMD_WANT_SKB; -+ -+ rc = ipw_send_cmd(priv, &cmd); -+ -+ if (rc || (flags & CMD_ASYNC)) -+ return rc; -+ -+ res = (struct ipw_rx_packet *)cmd.meta.u.skb->data; -+ if (res->hdr.flags & 0x40) { -+ IPW_ERROR("Bad return from REPLY_ADD_STA (0x%08X)\n", -+ res->hdr.flags); -+ rc = -EIO; -+ } -+ -+ if (rc == 0) { -+ switch (res->u.add_sta.status) { -+ case ADD_STA_SUCCESS_MSK: -+ IPW_DEBUG_INFO("REPLY_ADD_STA PASSED\n"); -+ break; -+ default: -+ rc = -EIO; -+ IPW_WARNING("REPLY_ADD_STA failed\n"); -+ break; -+ } -+ } -+ dev_kfree_skb_any(cmd.meta.u.skb); -+ -+ return rc; -+} -+ -+static int ipw_card_state_sync_callback(struct ipw_priv *priv, -+ struct ipw_cmd *cmd, -+ struct sk_buff *skb) -+{ -+ -+ return 1; -+} -+ -+/* -+ * CARD_STATE_CMD -+ * -+ * Use: Sets the internal card state to enable, disable, or halt -+ * -+ * When in the 'enable' state the card operates as normal. -+ * When in the 'disable' state, the card enters into a low power mode. -+ * When in the 'halt' state, the card is shut down and must be fully -+ * restarted to come back on. -+ */ -+static int ipw_send_card_state(struct ipw_priv *priv, u32 flags, u8 meta_flag) -+{ -+ struct ipw_host_cmd cmd = { -+ .id = REPLY_CARD_STATE_CMD, -+ .len = sizeof(u32), -+ .data = &flags, -+ .meta.flags = meta_flag, -+ }; -+ -+ if (meta_flag & CMD_ASYNC) -+ cmd.meta.u.callback = ipw_card_state_sync_callback; -+ -+ return ipw_send_cmd(priv, &cmd); -+} -+ -+static int ipw_send_rxon_timing(struct ipw_priv *priv, -+ struct ipw_rxon_time_cmd *rxontime) -+{ -+ return ipw_send_cmd_pdu(priv, REPLY_RX_ON_TIMING, -+ sizeof(struct ipw_rxon_time_cmd), rxontime); -+} -+ -+/** -+* rate duration -+**/ -+#define MMAC_SCHED_2_4GHZ_SIFS 10 -+#define MMAC_SCHED_5_2GHZ_SIFS 16 -+#define MMAC_SCHED_CCK_PHY_OVERHEAD_SHORT 96 -+#define MMAC_SCHED_CCK_PHY_OVERHEAD_LONG 192 -+#define MMAC_SCHED_OFDM_SYMBOL_TIME 4 -+#define MMAC_SCHED_OFDM_PHY_OVERHEAD 20 -+#define MMAC_SCHED_UCODE_OVERHEAD 8 -+ -+#define IPW_INVALID_RATE 0xFF -+static struct ipw_rate_info rate_table_info[] = { -+/* CCK rate info */ -+ {10, 2, 8, 0, 112, 160, 112, 1216}, /* 1mbps */ -+ {20, 4, 9, 0, 56, 80, 56, 608}, /* 2mbps */ -+ {55, 11, 10, 0, 21, 29, 21, 222}, /* 5.5mbps */ -+ {110, 22, 11, 0, 11, 15, 11, 111}, /* 11mbps */ -+/* OFDM rate info */ -+ {13, 6 * 2, 0, 24, 44, 52, 44, 228}, /* 6mbps */ -+ {15, 9 * 2, 1, 36, 36, 44, 36, 160}, /* 9mbps */ -+ {5, 12 * 2, 2, 48, 32, 36, 32, 124}, /* 12mbps */ -+ {7, 18 * 2, 3, 72, 28, 32, 28, 92}, /* 18mbps */ -+ {9, 24 * 2, 4, 96, 28, 32, 28, 72}, /* 24mbps */ -+ {11, 36 * 2, 5, 144, 24, 28, 24, 56}, /* 36mbps */ -+ {1, 48 * 2, 6, 192, 24, 24, 24, 48}, /* 48mbps */ -+ {3, 54 * 2, 7, 216, 24, 24, 24, 44}, /* 54mbps */ -+}; -+ -+static inline int ipw_rate_plcp2index(u8 x) -+{ -+ int i; -+ for (i = 0; i < ARRAY_SIZE(rate_table_info); i++) { -+ if (rate_table_info[i].rate_plcp == x) -+ return i; -+ } -+ return -1; -+} -+ -+static inline int ipw_rate_scale2index(int x) -+{ -+ int i; -+ for (i = 0; i < ARRAY_SIZE(rate_table_info); i++) { -+ if (rate_table_info[i].rate_scale_index == x) -+ return i; -+ } -+ return -1; -+} -+ -+static inline u8 ipw_rate_scaling2rate_plcp(int x) -+{ -+ int i; -+ for (i = 0; i < ARRAY_SIZE(rate_table_info); i++) { -+ if (rate_table_info[i].rate_scale_index == x) -+ return rate_table_info[i].rate_plcp; -+ } -+ return IPW_INVALID_RATE; -+} -+ -+static inline int ipw_rate_plcp2rate_scaling(u8 x) -+{ -+ int i; -+ for (i = 0; i < ARRAY_SIZE(rate_table_info); i++) { -+ if (rate_table_info[i].rate_plcp == x) -+ return rate_table_info[i].rate_scale_index; -+ } -+ return -1; -+} -+ -+static int ipw_rate_index2rate_scale(int x) -+{ -+ -+ if (x < ARRAY_SIZE(rate_table_info)) -+ return rate_table_info[x].rate_scale_index; -+ -+ return -1; -+} -+ -+static u8 ipw_rate_index2plcp(int x) -+{ -+ -+ if (x < ARRAY_SIZE(rate_table_info)) -+ return rate_table_info[x].rate_plcp; -+ -+ return IPW_INVALID_RATE; -+} -+ -+static u8 ipw_rate_get_lowest_plcp(int rate_mask) -+{ -+ int start, i; -+ -+ if (rate_mask & 0xF) -+ start = 0; -+ else if (rate_mask & 0xF0) -+ start = 4; -+ else -+ start = 8; -+ -+ for (i = start; i < 12; i++) { -+ if ((rate_mask & (1 << i)) != 0) -+ return rate_table_info[i].rate_plcp; -+ } -+ return IPW_INVALID_RATE; -+} -+ -+/** -+* RXON functions -+**/ -+static u8 BROADCAST_ADDR[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; -+ -+/* -+ validate rxon command before issuing the command to the card. -+*/ -+static int ipw_check_rx_config_cmd(struct daemon_rx_config *rxon) -+{ -+ int error = 0; -+ int counter = 1; -+ -+ if (rxon->flags & RXON_FLG_BAND_24G_MSK) { -+ error |= (rxon->flags & RXON_FLG_TGJ_NARROW_BAND_MSK); -+ error |= (rxon->flags & RXON_FLG_RADAR_DETECT_MSK); -+ if (error) -+ IPW_WARNING("check 24G fields %d | %d\n", -+ counter++, error); -+ } else { -+ error |= ((rxon->flags & RXON_FLG_SHORT_SLOT_MSK) != -+ RXON_FLG_SHORT_SLOT_MSK); -+ if (error) -+ IPW_WARNING("check 52 fields %d | %d\n", -+ counter++, error); -+ error |= (rxon->flags & RXON_FLG_CCK_MSK); -+ if (error) -+ IPW_WARNING("check 52 CCK %d | %d\n", counter++, error); -+ -+ } -+ error |= (rxon->node_addr[0] | rxon->bssid_addr[0]) & 0x1; -+ if (error) -+ IPW_WARNING("check mac addr %d | %d\n", counter++, error); -+ -+ // make sure basic rates 6Mbps and 1Mbps are supported -+ error |= (((rxon->ofdm_basic_rates & R_6M_MSK) == 0) && -+ ((rxon->cck_basic_rates & R_1M_MSK) == 0)); -+ -+ if (error) -+ IPW_WARNING("check basic rate %d | %d\n", counter++, error); -+ error |= (rxon->assoc_id > 2007); -+ if (error) -+ IPW_WARNING("check assoc id %d | %d\n", counter++, error); -+ -+ error |= -+ ((rxon-> -+ flags & (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK)) == -+ (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK)); -+ -+ if (error) -+ IPW_WARNING("check CCK and short slot %d | %d\n", -+ counter++, error); -+ error |= ((rxon->flags & (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK)) -+ == (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK)); -+ -+ if (error) -+ IPW_WARNING("check CCK & auto detect %d | %d\n", -+ counter++, error); -+ error |= -+ ((rxon-> -+ flags & (RXON_FLG_AUTO_DETECT_MSK | -+ RXON_FLG_TGG_PROTECT_MSK)) == RXON_FLG_TGG_PROTECT_MSK); -+ -+ if (error) -+ IPW_WARNING("check TGG %d | %d\n", counter++, error); -+ if (rxon->flags & RXON_FLG_BAND_24G_MSK) -+ error |= ((rxon->channel < MIN_B_CHANNELS) || -+ (rxon->channel > MAX_B_CHANNELS)); -+ else -+ error |= ((rxon->channel < MIN_A_CHANNELS) || -+ (rxon->channel > MAX_A_CHANNELS)); -+ if (error) -+ IPW_WARNING("check channel number %d | %d\n", counter++, error); -+ if ((rxon->flags & RXON_FLG_DIS_DIV_MSK)) -+ error |= -+ ((rxon-> -+ flags & (RXON_FLG_ANT_B_MSK | RXON_FLG_ANT_A_MSK)) == 0); -+ -+ if (error) -+ IPW_WARNING("check antenna %d %d\n", counter++, error); -+ if (error) -+ IPW_WARNING("Tuning to channel %d\n", rxon->channel); -+ if (error) { -+ IPW_ERROR -+ ("Error not a valid ipw_rxon_assoc_cmd field values\n"); -+ return -1; -+ } -+ -+ return 0; -+} -+ -+/* Get antenna flags for RxOn command. */ -+static int ipw_get_antenna_flags(struct ipw_priv *priv) -+{ -+ int rc = 0; -+ u8 invert = 0; -+ -+ /* "diversity", NIC selects best antenna by itself */ -+ if (priv->antenna == 0) { -+ return 0; -+ } -+ -+ rc = ipw_query_eeprom(priv, EEPROM_ANTENNA_SWITCH_TYPE, -+ sizeof(u8), (u8 *) & invert); -+ if (rc) { -+ IPW_WARNING("failed to read EEPROM_ANTENNA_SWITCH_TYPE\n"); -+ } -+ -+ /* force Main antenna */ -+ if (priv->antenna == 1) { -+ if (invert) -+ return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK; -+ else -+ return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK; -+ } -+ /* force Aux antenna */ -+ else if (priv->antenna == 2) { -+ if (invert) -+ return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK; -+ else -+ return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK; -+ } -+ -+ /* bad antenna selector value */ -+ else { -+ IPW_ERROR("Bad antenna selector value (0x%x)\n", priv->antenna); -+ } -+ -+ return 0; /* "diversity" is default if error */ -+} -+ -+/* -+ check rxon command then call the correct rxon command (associated vs. not) -+*/ -+static int ipw_rxon_call(struct ipw_priv *priv, int is_assoc) -+{ -+ int rc = 0; -+ -+ if (!ipw_is_alive(priv)) -+ return -1; -+ -+ if (!is_assoc) { -+ /* always get timestamp with Rx frame */ -+ priv->rxon.flags |= RXON_FLG_TSF2HOST_MSK; -+ -+ /* select antenna */ -+ priv->rxon.flags &= -+ ~(RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_SEL_MSK); -+ priv->rxon.flags |= ipw_get_antenna_flags(priv); -+ } -+ rc = ipw_check_rx_config_cmd(&priv->rxon); -+ if (rc) -+ return rc; -+ -+ /* If we're associated, we use the ipw_rxon_assoc_cmd which -+ * is used to reconfigure filter and other flags for the current -+ * radio configuration. -+ * -+ * If we're not associated, we need to request the regulatory -+ * daemon to tune and configure the radio via ipw_send_rxon. */ -+ if (is_assoc) -+ rc = ipw_rxon_assoc_sync(priv); -+ else -+ rc = ipw_send_rx_config(priv); -+ -+ return rc; -+} -+ -+/* -+ add AP station into station table. there is only one AP -+ station with id=0 -+*/ -+static int ipw_rxon_add_station(struct ipw_priv *priv, u8 * addr, int is_ap) -+{ -+ /* Remove this station if it happens to already exist */ -+ ipw_remove_station(priv, addr, is_ap); -+ -+ return ipw_add_station(priv, addr, is_ap, 0); -+} -+ -+static int ipw_send_bt_config(struct ipw_priv *priv) -+{ -+ struct ipw_bt_cmd bt_cmd = { -+ .flags = 3, -+ .leadTime = 0xAA, -+ .maxKill = 1, -+ .killAckMask = 0, -+ .killCTSMask = 0, -+ }; -+ -+ return ipw_send_cmd_pdu(priv, REPLY_BT_CONFIG, -+ sizeof(struct ipw_bt_cmd), &bt_cmd); -+} -+ -+/* -+ initilize rxon structure with default values fromm eeprom -+*/ -+static void ipw_connection_init_rx_config(struct ipw_priv *priv) -+{ -+ int a_band = 0; -+ memset(&priv->rxon, 0, sizeof(struct daemon_rx_config)); -+ -+ switch (priv->ieee->iw_mode) { -+ case IW_MODE_MASTER: -+ priv->rxon.dev_type = RXON_DEV_TYPE_AP; -+ break; -+ -+ case IW_MODE_INFRA: -+ priv->rxon.dev_type = RXON_DEV_TYPE_ESS; -+ priv->rxon.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK; -+ break; -+ -+ case IW_MODE_ADHOC: -+ priv->rxon.dev_type = RXON_DEV_TYPE_IBSS; -+ priv->rxon.flags = RXON_FLG_SHORT_PREAMBLE_MSK; -+ priv->rxon.filter_flags = 0; -+ break; -+ -+ case IW_MODE_MONITOR: -+ priv->rxon.dev_type = RXON_DEV_TYPE_SNIFFER; -+ priv->rxon.filter_flags = RXON_FILTER_PROMISC_MSK | -+ RXON_FILTER_CTL2HOST_MSK | RXON_FILTER_ACCEPT_GRP_MSK; -+ break; -+ } -+ -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+ if (rtap_iface && netif_running(priv->prom_net_dev)) -+ priv->rxon.filter_flags |= (RXON_FILTER_PROMISC_MSK | -+ RXON_FILTER_CTL2HOST_MSK); -+#endif -+ -+ if (priv->config & CFG_PREAMBLE_LONG) -+ priv->rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK; -+ -+ if (!(priv->config & CFG_STATIC_CHANNEL)) { -+ /* Priority to 802.11bg band */ -+ if (priv->ieee->freq_band & IEEE80211_24GHZ_BAND) -+ a_band = 0; -+ else -+ a_band = 1; -+ } else { -+ if (priv->channel > IEEE80211_24GHZ_MAX_CHANNEL) -+ a_band = 1; -+ else -+ a_band = 0; -+ } -+ -+ if (!a_band) { -+ priv->rxon.flags |= -+ (RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK); -+ priv->rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; -+ if (priv->ieee->freq_band & IEEE80211_52GHZ_BAND) -+ IPW_DEBUG_INFO("Mixed band, choosing 2.4 GHz. \n"); -+ if (priv->ieee->modulation & IEEE80211_OFDM_MODULATION) -+ IPW_DEBUG_INFO("Mixed modulation, choosing OFDM. \n"); -+ if (!(priv->config & CFG_STATIC_CHANNEL)) -+ priv->channel = 9; -+ } else { -+ priv->rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; -+ priv->rxon.flags &= ~(RXON_FLG_BAND_24G_MSK | -+ RXON_FLG_AUTO_DETECT_MSK); -+ if (!(priv->config & CFG_STATIC_CHANNEL)) { -+ IPW_DEBUG_INFO("TODO: Set to the first " -+ "*valid* channel that supports this mode.\n"); -+ priv->channel = 36; -+ } -+ } -+ -+ IPW_DEBUG_INFO("Channel set to %d%s\n", priv->channel, -+ (priv->config & CFG_STATIC_CHANNEL) ? "(static)" : ""); -+ priv->rxon.channel = priv->channel; -+ priv->rxon.ofdm_basic_rates = -+ R_6M_MSK | R_24M_MSK | R_36M_MSK | R_48M_MSK | R_54M_MSK | -+ R_9M_MSK | R_12M_MSK | R_18M_MSK; -+ priv->rxon.cck_basic_rates = -+ R_5_5M_MSK | R_1M_MSK | R_11M_MSK | R_2M_MSK; -+} -+ -+/***************** END ***********************************/ -+ -+#define IPW_SCAN_CHECK_WATCHDOG (7 * HZ) -+ -+static void ipw_bg_scan_check(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ if (priv->status & (STATUS_SCANNING | STATUS_SCAN_ABORTING)) { -+ IPW_DEBUG(IPW_DL_INFO | IPW_DL_SCAN, -+ "Scan completion watchdog resetting " -+ "adapter (%dms).\n", -+ jiffies_to_msecs(IPW_SCAN_CHECK_WATCHDOG)); -+ if (!(priv->status & STATUS_EXIT_PENDING)) -+ ipw_down(priv); -+ } -+ mutex_unlock(&priv->mutex); -+} -+ -+static int ipw_send_scan_abort(struct ipw_priv *priv) -+{ -+ int rc = 0; -+ struct ipw_rx_packet *res; -+ struct ipw_host_cmd cmd = { -+ .id = REPLY_SCAN_ABORT_CMD, -+ .meta.flags = CMD_WANT_SKB, -+ }; -+ -+ /* If there isn't a scan actively going on in the hardware -+ * then we are in between scan bands and not actually -+ * actively scanning, so don't send the abort command */ -+ if (!(priv->status & STATUS_SCAN_HW)) { -+ priv->status &= ~STATUS_SCAN_ABORTING; -+ return 0; -+ } -+ -+ rc = ipw_send_cmd(priv, &cmd); -+ if (rc) { -+ priv->status &= ~STATUS_SCAN_ABORTING; -+ return rc; -+ } -+ -+ res = (struct ipw_rx_packet *)cmd.meta.u.skb->data; -+ if (res->u.status != CAN_ABORT_STATUS) { -+ /* The scan abort will return 1 for success or -+ * 2 for "failure". A failure condition can be -+ * due to simply not being in an active scan which -+ * can occur if we send the scan abort before we -+ * the microcode has notified us that a scan is -+ * completd. */ -+ IPW_DEBUG_INFO("SCAN_ABORT returned %d.\n", res->u.status); -+ priv->status &= ~(STATUS_SCAN_ABORTING | STATUS_SCAN_HW); -+ } -+ -+ dev_kfree_skb_any(cmd.meta.u.skb); -+ -+ return rc; -+} -+ -+#define MAX_UCODE_BEACON_INTERVAL 1024 -+#define INTEL_CONN_LISTEN_INTERVAL 0xA -+ -+static u16 ipw_adjust_beacon_interval(u16 beacon_val) -+{ -+ u16 new_val = 0; -+ u16 beacon_factor = 0; -+ -+ beacon_factor = -+ (beacon_val + -+ MAX_UCODE_BEACON_INTERVAL) / MAX_UCODE_BEACON_INTERVAL; -+ new_val = beacon_val / beacon_factor; -+ -+ return new_val; -+} -+ -+static int ipw_setup_rxon_timing(struct ipw_priv *priv, -+ struct ipw_associate *associate) -+{ -+ int rc = 0; -+ u64 interval_tm_unit; -+ u64 tsf, result; -+ -+ priv->rxon_timing.timestamp.dw[1] = associate->assoc_tsf_msw; -+ priv->rxon_timing.timestamp.dw[0] = associate->assoc_tsf_lsw; -+ -+ priv->rxon_timing.listenInterval = INTEL_CONN_LISTEN_INTERVAL; -+ -+ tsf = associate->assoc_tsf_msw; -+ tsf = tsf << 32 | associate->assoc_tsf_lsw; -+ -+ if (priv->ieee->iw_mode == IW_MODE_INFRA) { -+ if (associate->beacon_interval == 0) { -+ priv->rxon_timing.beaconInterval = 100; -+ priv->rxon_timing.beaconTimerInitVal = 102400; -+ } else { -+ priv->rxon_timing.beaconInterval = -+ associate->beacon_interval; -+ priv->rxon_timing.beaconInterval = -+ ipw_adjust_beacon_interval(priv-> -+ rxon_timing. -+ beaconInterval); -+ -+ } -+ -+ priv->rxon_timing.atimWindow = 0; -+ } else { -+ priv->rxon_timing.beaconInterval = -+ ipw_adjust_beacon_interval(associate->beacon_interval); -+ -+ priv->rxon_timing.atimWindow = associate->atim_window; -+ } -+ -+ interval_tm_unit = (priv->rxon_timing.beaconInterval * 1024); -+ result = do_div(tsf, interval_tm_unit); -+ priv->rxon_timing.beaconTimerInitVal = -+ (u32) ((u64) interval_tm_unit - result); -+ -+ IPW_DEBUG_ASSOC -+ ("beacon interval %d beacon timer %d beacon tim %d\n", -+ priv->rxon_timing.beaconInterval, -+ priv->rxon_timing.beaconTimerInitVal, -+ priv->rxon_timing.atimWindow); -+ return rc; -+} -+ -+#define IEEE80211_MAX_RATES (IEEE80211_NUM_OFDM_RATES + \ -+ IEEE80211_NUM_CCK_RATES) -+#define IEEE80211_CCK_RATE_1MB_INDEX 0 -+#define IEEE80211_CCK_RATE_2MB_INDEX 1 -+#define IEEE80211_CCK_RATE_5MB_INDEX 2 -+#define IEEE80211_CCK_RATE_11MB_INDEX 3 -+#define IEEE80211_OFDM_RATE_6MB_INDEX 4 -+#define IEEE80211_OFDM_RATE_9MB_INDEX 5 -+#define IEEE80211_OFDM_RATE_12MB_INDEX 6 -+#define IEEE80211_OFDM_RATE_18MB_INDEX 7 -+#define IEEE80211_OFDM_RATE_24MB_INDEX 8 -+#define IEEE80211_OFDM_RATE_36MB_INDEX 9 -+#define IEEE80211_OFDM_RATE_48MB_INDEX 10 -+#define IEEE80211_OFDM_RATE_54MB_INDEX 11 -+#define IEEE80211_RATE_ENTRY(mod, rate) \ -+ [IEEE80211_## mod ##_RATE_## rate ##MB_INDEX] = \ -+ IEEE80211_## mod ##_RATE_## rate ##MB -+ -+static u8 ipw_index_to_rate(int i) -+{ -+ u8 rates[IEEE80211_MAX_RATES] = { -+ IEEE80211_RATE_ENTRY(CCK, 1), -+ IEEE80211_RATE_ENTRY(CCK, 2), -+ IEEE80211_RATE_ENTRY(CCK, 5), -+ IEEE80211_RATE_ENTRY(CCK, 11), -+ IEEE80211_RATE_ENTRY(OFDM, 6), -+ IEEE80211_RATE_ENTRY(OFDM, 9), -+ IEEE80211_RATE_ENTRY(OFDM, 12), -+ IEEE80211_RATE_ENTRY(OFDM, 18), -+ IEEE80211_RATE_ENTRY(OFDM, 24), -+ IEEE80211_RATE_ENTRY(OFDM, 36), -+ IEEE80211_RATE_ENTRY(OFDM, 48), -+ IEEE80211_RATE_ENTRY(OFDM, 54), -+ }; -+ -+ if (i >= IPW_MAX_RATES) -+ return 0xff; -+ -+ return rates[i]; -+} -+ -+static void ipw_fill_network_rates(struct ieee80211_network *network, -+ u32 rates_mask) -+{ -+ int i, in_ex = 0; -+ -+ network->rates_len = 0; -+ network->rates_ex_len = 0; -+ -+ for (i = 0; i < IPW_MAX_RATES; i++) { -+ if (!(rates_mask & (1 << i))) -+ continue; -+ -+ if (!in_ex) { -+ network->rates[network->rates_len] = -+ ipw_index_to_rate(i); -+ -+ /* If the rates mask has this rate flagged -+ * as a basic rate then set the basic rate -+ * bit on the rate entry */ -+ if (rates_mask & (1 << (i + 16))) -+ network->rates[network->rates_len] |= -+ IEEE80211_BASIC_RATE_MASK; -+ -+ network->rates_len++; -+ -+ if (network->rates_len == MAX_RATES_LENGTH) -+ in_ex = 1; -+ } else { -+ network->rates_ex[network->rates_ex_len] = -+ ipw_index_to_rate(i); -+ if (rates_mask & (1 << (i + 16))) -+ network->rates_ex[network->rates_ex_len] |= -+ IEEE80211_BASIC_RATE_MASK; -+ network->rates_ex_len++; -+ } -+ } -+} -+ -+/* -+ fill in the supported rate in IE fiels -+ return : set the bit for each supported rate insert in ie -+*/ -+static u16 ipw_supported_rate_to_ie(struct ieee80211_info_element *ie, -+ const u16 rates_mask, -+ const u16 basic_rate, const int max_count) -+{ -+ u16 ret_rates = 0, mask; -+ u8 *rates = ie->data; -+ int i; -+ -+ ie->len = 0; -+ -+ for (i = 0, mask = 1; i < IPW_MAX_RATES; i++, mask <<= 1) { -+ if (rates_mask & mask) { -+ ret_rates |= mask; -+ rates[ie->len++] = ipw_index_to_rate(i) | -+ ((mask & basic_rate) ? 0x80 : 0x00); -+ -+ if (ie->len >= max_count) -+ break; -+ -+ /* todoG for IBSS return only cck rates only in -+ * the first ie */ -+ } -+ } -+ -+ return ret_rates; -+} -+ -+static void *ieee80211_next_info_element(struct ieee80211_info_element -+ *info_element) -+{ -+ return &info_element->data[info_element->len]; -+} -+ -+static int ipw_add_power_capability(struct ipw_priv *priv, struct ieee80211_info_element -+ *info_element, size_t left) -+{ -+ const struct ieee80211_channel *channel = -+ ieee80211_get_channel(priv->ieee, priv->channel); -+ -+ if (left < sizeof(*info_element) + 2) -+ return 0; -+ -+ IPW_DEBUG_11H -+ ("Setting minimum power: %d and maximum power: %d\n", 0, -+ channel->max_power); -+ -+ info_element->id = MFIE_TYPE_POWER_CAPABILITY; -+ info_element->len = 2; -+ info_element->data[0] = 0; /* chan_info->min_power; */ -+ info_element->data[1] = channel->max_power; -+ -+ return sizeof(*info_element) + info_element->len; -+} -+ -+static int ipw_add_supported_channels(struct ipw_priv *priv, struct ieee80211_info_element -+ *info_element, size_t left) -+{ -+ int i = 0; -+ -+ if (!(priv->assoc_network->mode & IEEE_A)) -+ return 0; -+ -+ /* We know we'll have at least one first_channel / count tuple */ -+ left -= sizeof(*info_element); -+ if (left < 0) -+ return 0; -+ -+ /* Per 802.11h 17.3.8.3.3, there are three bands */ -+ if (!(ieee80211_get_channel_flags(priv->ieee, 36) & -+ IEEE80211_CH_INVALID)) { -+ if (left < 2) -+ return 0; -+ left -= 2; -+ info_element->data[i] = 36; -+ info_element->data[i + 1] = 4; -+ i += 2; -+ } -+ -+ if (!(ieee80211_get_channel_flags(priv->ieee, 52) & -+ IEEE80211_CH_INVALID)) { -+ if (left < 2) -+ return 0; -+ left -= 2; -+ info_element->data[i] = 52; -+ info_element->data[i + 1] = 4; -+ i += 2; -+ } -+ -+ if (!(ieee80211_get_channel_flags(priv->ieee, 149) & -+ IEEE80211_CH_INVALID)) { -+ if (left < 2) -+ return 0; -+ left -= 2; -+ info_element->data[i] = 149; -+ info_element->data[i + 1] = 4; -+ i += 2; -+ } -+ -+ /* This band was added in 802.11h */ -+ if (!(ieee80211_get_channel_flags(priv->ieee, 100) & -+ IEEE80211_CH_INVALID)) { -+ if (left < 2) -+ return 0; -+ left -= 2; -+ info_element->data[i] = 100; -+ info_element->data[i + 1] = 11; -+ i += 2; -+ } -+ -+ if (!i) -+ return 0; -+ -+ info_element->id = MFIE_TYPE_SUPP_CHANNELS; -+ info_element->len = i; -+ -+ IPW_DEBUG_11H("Advertised support of %d bands.\n", i / 2); -+ -+ return sizeof(*info_element) + info_element->len; -+} -+ -+static int ipw_fill_association_req(struct ipw_priv *priv, -+ struct ieee80211_hdr *hdr, int left) -+{ -+ struct ieee80211_info_element *info_element; -+ struct ieee80211_assoc_request *frame = -+ (struct ieee80211_assoc_request *)hdr; -+ u16 ret_rates; -+ u16 capability = 0; -+ int len = 0; -+ -+ /* Make sure there is enough space for the association request, -+ * two mandatory IEs and the data */ -+ left -= (sizeof(struct ieee80211_assoc_request) + -+ sizeof(struct ieee80211_info_element) * 2 + -+ priv->essid_len + IPW_SUPPORTED_RATES_IE_LEN); -+ if (left < 0) -+ return 0; -+ -+ frame->header.frame_ctl = IEEE80211_FTYPE_MGMT | -+ IEEE80211_STYPE_ASSOC_REQ; -+ memcpy(frame->header.addr1, priv->ieee->bssid, ETH_ALEN); -+ memcpy(frame->header.addr2, priv->mac_addr, ETH_ALEN); -+ memcpy(frame->header.addr3, priv->ieee->bssid, ETH_ALEN); -+ frame->header.seq_ctl = 0; -+ -+ capability = -+ WLAN_CAPABILITY_ESS | -+ WLAN_CAPABILITY_CF_POLLABLE | -+ WLAN_CAPABILITY_CF_POLL_REQUEST | -+ WLAN_CAPABILITY_PRIVACY | -+ WLAN_CAPABILITY_SHORT_PREAMBLE | -+ WLAN_CAPABILITY_SHORT_SLOT_TIME | -+ WLAN_CAPABILITY_DSSS_OFDM | WLAN_CAPABILITY_SPECTRUM_MGMT; -+ -+#ifdef CONFIG_IPW3945_QOS -+ if (priv->qos_data.qos_enable) -+ capability |= WLAN_CAPABILITY_QOS; -+#endif -+ -+ frame->capability = priv->assoc_request.capability & capability; -+ -+ if (priv->assoc_request.ieee_mode == IPW_G_MODE) -+ frame->capability |= WLAN_CAPABILITY_SHORT_SLOT_TIME; -+ if (priv->assoc_request.ieee_mode != IPW_A_MODE) -+ frame->capability |= WLAN_CAPABILITY_SHORT_PREAMBLE; -+ -+ if (priv->config & CFG_PREAMBLE_LONG) -+ frame->capability &= ~WLAN_CAPABILITY_SHORT_PREAMBLE; -+ -+ frame->listen_interval = 10; -+ -+ info_element = frame->info_element; -+ -+ /* fill in ssid broadcast */ -+ info_element->id = MFIE_TYPE_SSID; -+ info_element->len = priv->essid_len; -+ memcpy(info_element->data, priv->essid, priv->essid_len); -+ -+ /* Advance to next IE... */ -+ info_element = ieee80211_next_info_element(info_element); -+ -+ /* fill in supported rate */ -+ info_element->id = MFIE_TYPE_RATES; -+ info_element->len = 0; -+ IPW_DEBUG_INFO("ASSOC REQ: Rates: %08X %08X\n", priv->active_rate, -+ priv->active_rate_basic); -+ ret_rates = -+ ipw_supported_rate_to_ie(info_element, -+ priv->active_rate & priv->rates_mask, -+ priv->active_rate_basic, -+ IPW_SUPPORTED_RATES_IE_LEN); -+ -+ ret_rates = ~ret_rates & priv->active_rate; -+ IPW_DEBUG_INFO("ASSOC REQ: Rates: %08X %08X\n", priv->active_rate, -+ priv->active_rate_basic); -+ -+ /* Account for the size we know... */ -+ len = sizeof(struct ieee80211_assoc_request) + -+ sizeof(struct ieee80211_info_element) * 2 + -+ priv->essid_len + info_element->len; -+ /* left is set at start of function for to reflect where we are -+ * now */ -+ -+ if (ret_rates) { -+ /* Now see how much space is left.... */ -+ if (left < sizeof(struct ieee80211_info_element) + -+ IPW_SUPPORTED_RATES_IE_LEN) -+ return 0; -+ -+ info_element = ieee80211_next_info_element(info_element); -+ info_element->id = MFIE_TYPE_RATES_EX; -+ info_element->len = 0; -+ ipw_supported_rate_to_ie(info_element, -+ ret_rates, -+ priv->active_rate_basic, -+ IPW_SUPPORTED_RATES_IE_LEN); -+ if (info_element->len > 0) { -+ /* account for this IE */ -+ len += sizeof(struct ieee80211_info_element) + -+ info_element->len; -+ left -= -+ sizeof(struct ieee80211_info_element) + -+ info_element->len; -+ } -+ } -+ -+ if (priv->ieee->wpa_ie_len) { -+ /* Advance to WPA IE... */ -+ info_element = ieee80211_next_info_element(info_element); -+ -+ if (priv->ieee->wpa_ie_len >= 6 && -+ priv->ieee->wpa_ie[2] == 0x00 && -+ priv->ieee->wpa_ie[3] == 0x50 && -+ priv->ieee->wpa_ie[4] == 0xf2 && -+ priv->ieee->wpa_ie[5] == 0x01) -+ info_element->id = MFIE_TYPE_GENERIC; -+ else if (priv->ieee->wpa_ie[0] == MFIE_TYPE_RSN) -+ info_element->id = MFIE_TYPE_RSN; -+ else { -+ IPW_DEBUG_ASSOC("bad wpa/rsn ie\n"); -+ goto fill_end; -+ } -+ -+ info_element->len = priv->ieee->wpa_ie_len - 2; -+ memcpy(info_element->data, priv->ieee->wpa_ie + 2, -+ info_element->len); -+ -+ len += sizeof(struct ieee80211_info_element) + -+ info_element->len; -+ left -= sizeof(struct ieee80211_info_element) + -+ info_element->len; -+ } -+ -+ /* 802.11h */ -+ if (priv->assoc_network->capability & WLAN_CAPABILITY_SPECTRUM_MGMT) { -+ int size; -+ /* If spectrum management required, we must provide the -+ * Power Capability and Suspported Channels */ -+ -+ IPW_DEBUG_11H("Adding spectrum management IEs to " -+ "association (len=%d, ssid len=%d).\n", -+ len, priv->essid_len); -+ -+ info_element = ieee80211_next_info_element(info_element); -+ size = ipw_add_power_capability(priv, info_element, left); -+ left -= size; -+ len += size; -+ -+ info_element = ieee80211_next_info_element(info_element); -+ size = ipw_add_supported_channels(priv, info_element, left); -+ left -= size; -+ len += size; -+ } -+ -+ fill_end: -+ -+ return len; -+} -+ -+/* -+ fill in all required fields and ie for probe request frame -+*/ -+static int ipw_fill_probe_req(struct ipw_priv *priv, -+ struct ieee80211_probe_request *frame, -+ int left, int is_direct) -+{ -+ struct ieee80211_info_element *info_element; -+ u16 ret_rates; -+ int len = 0; -+ -+ /* Make sure there is enough space for the probe request, -+ * two mandatory IEs and the data */ -+ left -= sizeof(struct ieee80211_probe_request); -+ if (left < 0) -+ return 0; -+ len += sizeof(struct ieee80211_probe_request); -+ -+ frame->header.frame_ctl = IEEE80211_FTYPE_MGMT | -+ IEEE80211_STYPE_PROBE_REQ; -+ memcpy(frame->header.addr1, BROADCAST_ADDR, ETH_ALEN); -+ memcpy(frame->header.addr2, priv->mac_addr, ETH_ALEN); -+ memcpy(frame->header.addr3, BROADCAST_ADDR, ETH_ALEN); -+ frame->header.seq_ctl = 0; -+ -+ /* fill in our indirect SSID IE */ -+ /* ...next IE... */ -+ info_element = frame->info_element; -+ left -= sizeof(struct ieee80211_info_element); -+ if (left < 0) -+ return 0; -+ len += sizeof(struct ieee80211_info_element); -+ /* ... fill it in... */ -+ info_element->id = MFIE_TYPE_SSID; -+ info_element->len = 0; -+ -+ /* fill in our direct SSID IE... */ -+ if (is_direct) { -+ /* ...next IE... */ -+ info_element = ieee80211_next_info_element(info_element); -+ left -= -+ (sizeof(struct ieee80211_info_element) + priv->essid_len); -+ if (left < 0) -+ return 0; -+ /* ... fill it in... */ -+ info_element->id = MFIE_TYPE_SSID; -+ info_element->len = priv->essid_len; -+ memcpy(info_element->data, priv->essid, priv->essid_len); -+ len += -+ sizeof(struct ieee80211_info_element) + info_element->len; -+ } -+ -+ /* fill in supported rate */ -+ /* ...next IE... */ -+ info_element = ieee80211_next_info_element(info_element); -+ left -= sizeof(struct ieee80211_info_element); -+ if (left < 0) -+ return 0; -+ /* ... fill it in... */ -+ info_element->id = MFIE_TYPE_RATES; -+ info_element->len = 0; -+ ret_rates = -+ ipw_supported_rate_to_ie(info_element, priv->active_rate, -+ priv->active_rate_basic, left); -+ len += sizeof(struct ieee80211_info_element) + info_element->len; -+ -+ ret_rates = ~ret_rates & priv->active_rate; -+ -+ if (ret_rates == 0) -+ goto fill_end; -+ -+ /* fill in supported extended rate */ -+ /* ...next IE... */ -+ info_element = ieee80211_next_info_element(info_element); -+ left -= sizeof(struct ieee80211_info_element); -+ if (left < 0) -+ return 0; -+ /* ... fill it in... */ -+ info_element->id = MFIE_TYPE_RATES_EX; -+ info_element->len = 0; -+ ipw_supported_rate_to_ie(info_element, -+ ret_rates, priv->active_rate_basic, left); -+ if (info_element->len > 0) -+ /* account for this IE */ -+ len += sizeof(struct ieee80211_info_element) + -+ info_element->len; -+ -+ fill_end: -+ -+ return len; -+} -+ -+#define IEEE80211_ERP_PRESENT (0x01) -+#define IEEE80211_ERP_USE_PROTECTION (0x02) -+#define IEEE80211_ERP_BARKER_PREAMBLE_MODE (0x04) -+ -+static int ipw_fill_beacon_frame(struct ipw_priv *priv, -+ struct ieee80211_hdr *hdr, u8 * dest, int left) -+{ -+ struct ieee80211_probe_response *frame = NULL; -+ struct ieee80211_info_element *info_element = NULL; -+ int len = 0; -+ u16 ret_rates; -+ -+ if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) -+ || (priv->ieee->iw_mode != IW_MODE_ADHOC)) -+ return 0; -+ -+ frame = (struct ieee80211_probe_response *)hdr; -+ frame->header.frame_ctl = IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON; -+ -+ memcpy(frame->header.addr1, dest, ETH_ALEN); -+ memcpy(frame->header.addr2, priv->mac_addr, ETH_ALEN); -+ memcpy(frame->header.addr3, priv->assoc_request.bssid, ETH_ALEN); -+ -+ frame->header.seq_ctl = 0; -+ -+ /* fill the probe fields */ -+ frame->capability = priv->assoc_request.capability; -+ frame->time_stamp[0] = priv->assoc_request.assoc_tsf_lsw; -+ frame->time_stamp[1] = priv->assoc_request.assoc_tsf_msw; -+ -+ frame->beacon_interval = priv->assoc_request.beacon_interval; -+ frame->capability |= WLAN_CAPABILITY_IBSS; -+ if (priv->capability & CAP_PRIVACY_ON) -+ frame->capability |= WLAN_CAPABILITY_PRIVACY; -+ else -+ frame->capability &= ~WLAN_CAPABILITY_PRIVACY; -+ frame->capability &= ~WLAN_CAPABILITY_SHORT_SLOT_TIME; -+ -+ info_element = frame->info_element; -+ -+ /* fill in ssid broadcast */ -+ info_element->id = MFIE_TYPE_SSID; -+ info_element->len = priv->essid_len; -+ memcpy(info_element->data, priv->essid, priv->essid_len); -+ -+ /* Account for the size we know... */ -+ len = sizeof(struct ieee80211_probe_response) + -+ sizeof(struct ieee80211_info_element) + priv->essid_len; -+ -+ /* Advance to next IE... */ -+ info_element = ieee80211_next_info_element(info_element); -+ -+ /* atim window */ -+ info_element->id = MFIE_TYPE_IBSS_SET; -+ info_element->data[0] = (u8) priv->assoc_request.atim_window; -+ info_element->data[1] = 0x0; -+ info_element->len = 2; -+ -+ len += sizeof(struct ieee80211_info_element) + info_element->len; -+ -+ /* Advance to next IE... */ -+ info_element = ieee80211_next_info_element(info_element); -+ -+ info_element->id = MFIE_TYPE_RATES; -+ info_element->len = 0; -+ ret_rates = -+ ipw_supported_rate_to_ie(info_element, priv->active_rate, -+ priv->active_rate_basic, -+ IPW_SUPPORTED_RATES_IE_LEN); -+ -+ ret_rates = ~ret_rates & priv->active_rate; -+ -+ len += sizeof(struct ieee80211_info_element) + info_element->len; -+ -+ if (ret_rates != 0) { -+ -+ /* Now see how much space is left.... */ -+ if (left < sizeof(struct ieee80211_info_element) + -+ IPW_SUPPORTED_RATES_IE_LEN) -+ return 0; -+ -+ info_element = ieee80211_next_info_element(info_element); -+ info_element->id = MFIE_TYPE_RATES_EX; -+ info_element->len = 0; -+ ipw_supported_rate_to_ie(info_element, -+ ret_rates, -+ priv->active_rate_basic, -+ IPW_SUPPORTED_RATES_IE_LEN); -+ if (info_element->len > 0) -+ /* account for this IE */ -+ len += sizeof(struct ieee80211_info_element) + -+ info_element->len; -+ } -+ -+ /* add ERP present IE if not 11a or 11b */ -+ if (priv->assoc_request.ieee_mode == IPW_G_MODE) { -+ info_element = ieee80211_next_info_element(info_element); -+ -+ info_element->id = MFIE_TYPE_ERP_INFO; -+ info_element->len = 1; -+ -+ info_element->data[0] = priv->assoc_request.erp_value; -+ -+ if (info_element->data[0] & IEEE80211_ERP_BARKER_PREAMBLE_MODE) { -+ frame->capability &= ~WLAN_CAPABILITY_SHORT_PREAMBLE; -+ } -+ len += sizeof(struct ieee80211_info_element) + -+ info_element->len; -+ } -+ /* add DS present IE */ -+ if (priv->assoc_request.ieee_mode != IPW_A_MODE) { -+ info_element = ieee80211_next_info_element(info_element); -+ -+ info_element->id = MFIE_TYPE_DS_SET; -+ info_element->len = 1; -+ -+ info_element->data[0] = priv->channel; -+ -+ len += sizeof(struct ieee80211_info_element) + -+ info_element->len; -+ -+ } -+ -+ return len; -+} -+ -+static int ipw_send_beacon_cmd(struct ipw_priv *priv) -+{ -+ struct ipw_frame *frame; -+ struct ipw_tx_beacon_cmd *tx_beacon_cmd; -+ int frame_size, rc; -+ -+ frame = ipw_get_free_frame(priv); -+ -+ if (!frame) { -+ IPW_ERROR -+ ("Coult not obtain free frame buffer for beacon " -+ "command.\n"); -+ return -ENOMEM; -+ } -+ -+ tx_beacon_cmd = (struct ipw_tx_beacon_cmd *)&frame->u; -+ memset(tx_beacon_cmd, 0, sizeof(*tx_beacon_cmd)); -+ -+ tx_beacon_cmd->tx.sta_id = 24; -+ tx_beacon_cmd->tx.u.life_time = 0xFFFFFFFF; -+ -+ frame_size = ipw_fill_beacon_frame(priv, -+ tx_beacon_cmd->frame, -+ BROADCAST_ADDR, -+ sizeof(frame->u) - -+ sizeof(*tx_beacon_cmd)); -+ -+ tx_beacon_cmd->tx.len = frame_size; -+ -+ if (!(priv->rxon.flags & RXON_FLG_BAND_24G_MSK)) { -+ tx_beacon_cmd->tx.rate = -+ ipw_rate_get_lowest_plcp(priv->active_rate_basic & 0xFF0); -+ -+ if (tx_beacon_cmd->tx.rate <= 0) -+ tx_beacon_cmd->tx.rate = R_6M; -+ } else { -+ tx_beacon_cmd->tx.rate = -+ ipw_rate_get_lowest_plcp(priv->active_rate_basic & 0xF); -+ -+ if (tx_beacon_cmd->tx.rate <= 0) -+ tx_beacon_cmd->tx.rate = R_1M; -+ } -+ -+ tx_beacon_cmd->tx.tx_flags = (TX_CMD_FLG_SEQ_CTL_MSK | -+ TX_CMD_FLG_TSF_MSK); -+ -+ tx_beacon_cmd->tx.supp_rates[0] = priv->active_rate >> 4; -+ tx_beacon_cmd->tx.supp_rates[1] = priv->active_rate & 0xF; -+ -+ rc = ipw_send_cmd_pdu(priv, REPLY_TX_BEACON, -+ frame_size + -+ sizeof(struct ipw_tx_beacon_cmd), tx_beacon_cmd); -+ -+ ipw_free_frame(priv, frame); -+ -+ return rc; -+} -+ -+#define BEACON_JIFFIES(x) msecs_to_jiffies(x->assoc_network->beacon_interval) -+ -+static int ipw_post_associate(struct ipw_priv *priv, u16 assoc_id) -+{ -+ struct daemon_rx_config *rxon = &priv->rxon; -+ int rc = 0; -+ -+ if (!(priv->status & STATUS_ASSOCIATING)) { -+ IPW_WARNING("association process canceled\n"); -+ return 0; -+ } -+ -+ memset(&priv->rxon_timing, 0, sizeof(struct ipw_rxon_time_cmd)); -+ ipw_setup_rxon_timing(priv, &priv->assoc_request); -+ ipw_send_rxon_timing(priv, &priv->rxon_timing); -+ -+ rxon->filter_flags |= RXON_FILTER_ASSOC_MSK; -+ rxon->assoc_id = assoc_id; -+ rxon->beacon_interval = priv->assoc_request.beacon_interval; -+ -+ if (priv->assoc_request.capability & WLAN_CAPABILITY_SHORT_PREAMBLE) -+ rxon->flags |= RXON_FLG_SHORT_PREAMBLE_MSK; -+ -+ if ((priv->assoc_request.ieee_mode == IPW_G_MODE) && -+ (priv->assoc_request.capability & WLAN_CAPABILITY_SHORT_SLOT_TIME)) -+ rxon->flags |= RXON_FLG_SHORT_SLOT_MSK; -+ -+/* switch (priv->ieee->sec.level) { -+ case SEC_LEVEL_1: -+ rxon->flags |= */ -+ rc = ipw_rxon_call(priv, 0); -+ if (rc) -+ return rc; -+ -+ switch (priv->ieee->iw_mode) { -+ case IW_MODE_INFRA: -+ ipw_rate_scale_rxon_handle(priv, AP_ID); -+ memcpy(priv->ieee->bssid, priv->bssid, ETH_ALEN); -+ -+ /* Kick off roaming watchdog timer */ -+ if (!(priv->config & CFG_NO_ROAMING)) -+ mod_timer(&priv->roaming_wdt, jiffies + -+ priv->roaming_threshold * -+ BEACON_JIFFIES(priv)); -+ -+ break; -+ -+ case IW_MODE_ADHOC: -+ memcpy(priv->ieee->bssid, priv->bssid, ETH_ALEN); -+ -+ /* clear out the station table */ -+ ipw_clear_stations_table(priv); -+ -+ ipw_rxon_add_station(priv, BROADCAST_ADDR, 0); -+ ipw_rxon_add_station(priv, priv->bssid, 0); -+ ipw_rate_scale_rxon_handle(priv, STA_ID); -+ ipw_send_beacon_cmd(priv); -+ -+ break; -+ } -+ -+ /* Kick off disassociate watchdog timer */ -+ mod_timer(&priv->disassociate_wdt, jiffies + -+ priv->missed_beacon_threshold * BEACON_JIFFIES(priv)); -+ -+ priv->status &= ~STATUS_ASSOCIATING; -+ priv->status |= STATUS_ASSOCIATED; -+ queue_work(priv->workqueue, &priv->link_up); -+ -+ return 0; -+} -+ -+static int ipw_send_associate(struct ipw_priv *priv, -+ struct ipw_associate *associate) -+{ -+ struct ieee80211_auth frame = { -+ .header.frame_ctl = IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH, -+ .transaction = 1, -+ }; -+ int rc = 0; -+ struct daemon_rx_config *rxon = &priv->rxon; -+ -+ frame.algorithm = (associate->auth_type == AUTH_SHARED_KEY) ? -+ WLAN_AUTH_SHARED_KEY : WLAN_AUTH_OPEN; -+ -+ memcpy(frame.header.addr1, priv->bssid, ETH_ALEN); -+ memcpy(frame.header.addr2, priv->mac_addr, ETH_ALEN); -+ memcpy(frame.header.addr3, priv->bssid, ETH_ALEN); -+ -+ if (priv->status & STATUS_ASSOCIATED) { -+ IPW_DEBUG_ASSOC -+ ("Attempting to send associate while already " -+ "associated.\n"); -+ return -EINVAL; -+ } -+ -+ memcpy(priv->ieee->bssid, priv->bssid, ETH_ALEN); -+ memcpy(rxon->bssid_addr, associate->bssid, ETH_ALEN); -+ rxon->channel = associate->channel; -+ -+ rxon->filter_flags = RXON_FILTER_ACCEPT_GRP_MSK; // todoG is this needed -+ -+ switch (priv->ieee->iw_mode) { -+ case IW_MODE_INFRA: -+ rxon->dev_type = RXON_DEV_TYPE_ESS; -+ break; -+ -+ case IW_MODE_ADHOC: -+ rxon->dev_type = RXON_DEV_TYPE_IBSS; -+ rxon->filter_flags |= RXON_FILTER_BCON_AWARE_MSK; -+ break; -+ -+ case IW_MODE_MONITOR: -+ rxon->dev_type = RXON_DEV_TYPE_SNIFFER; -+ rxon->filter_flags |= (RXON_FILTER_PROMISC_MSK | -+ RXON_FILTER_CTL2HOST_MSK | -+ RXON_FILTER_ACCEPT_GRP_MSK); -+ break; -+ -+ default: -+ return -EINVAL; -+ } -+ -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+ if (rtap_iface && netif_running(priv->prom_net_dev)) -+ rxon->filter_flags |= (RXON_FILTER_PROMISC_MSK | -+ RXON_FILTER_CTL2HOST_MSK); -+#endif -+ -+ rxon->flags = -+ (RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK | RXON_FLG_ANT_B_MSK); -+ -+ if (associate->ieee_mode == IPW_A_MODE) { -+ rxon->flags &= -+ ~(RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK -+ | RXON_FLG_CCK_MSK); -+ rxon->flags |= RXON_FLG_SHORT_SLOT_MSK; -+ } else { -+ rxon->flags &= ~RXON_FLG_SHORT_SLOT_MSK; -+ rxon->flags |= RXON_FLG_BAND_24G_MSK; -+ rxon->flags |= RXON_FLG_AUTO_DETECT_MSK; -+ rxon->flags &= ~RXON_FLG_CCK_MSK; -+ } -+ -+ if ((associate->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)) -+ priv->rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; -+ else -+ priv->rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK; -+ -+ if ((rxon->flags & RXON_FLG_BAND_24G_MSK) && -+ (associate->ieee_mode == IPW_G_MODE)) { -+ if (associate->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) -+ rxon->flags |= RXON_FLG_SHORT_SLOT_MSK; -+ else -+ rxon->flags &= ~RXON_FLG_SHORT_SLOT_MSK; -+ -+ if (associate->erp_value & IEEE80211_ERP_USE_PROTECTION) -+ rxon->flags |= RXON_FLG_TGG_PROTECT_MSK; -+ else -+ rxon->flags &= ~RXON_FLG_TGG_PROTECT_MSK; -+ } -+ -+ rxon->cck_basic_rates = ((priv->active_rate_basic & 0xF) | R_1M_MSK); -+ rxon->ofdm_basic_rates = ((priv->active_rate_basic >> 4) | R_6M_MSK); -+ -+ if ((priv->active_rate_basic & 0xF) == 0) -+ rxon->cck_basic_rates = -+ R_1M_MSK | R_2M_MSK | R_5_5M_MSK | R_11M_MSK; -+ if (priv->active_rate_basic >> 4 == 0) -+ rxon->ofdm_basic_rates = R_6M_MSK | R_12M_MSK | R_24M_MSK; -+ -+ rc = ipw_rxon_call(priv, 0); -+ if (rc) -+ return rc; -+ -+ if (rxon->dev_type == RXON_DEV_TYPE_SNIFFER) -+ return 0; -+ -+ if (rxon->dev_type == RXON_DEV_TYPE_IBSS) { -+ rc = ipw_post_associate(priv, 0); -+ priv->status &= ~STATUS_ASSOCIATING; -+ priv->status |= STATUS_ASSOCIATED; -+ -+ return rc; -+ } else { -+ if (ipw_rxon_add_station(priv, priv->bssid, 1) == -+ IPW_INVALID_STATION) { -+ IPW_WARNING("Could not add STA " MAC_FMT "\n", -+ MAC_ARG(priv->bssid)); -+ rc = -EIO; -+ } else { -+ unsigned long flags; -+ spin_lock_irqsave(&priv->lock, flags); -+#if IPW3945_COMPAT >= 2 -+ rc = ieee80211_tx_frame(priv->ieee, -+ (struct ieee80211_hdr -+ *)&frame, 0, sizeof(frame), 0); -+#else -+ rc = ieee80211_tx_frame(priv->ieee, -+ (struct ieee80211_hdr -+ *)&frame, sizeof(frame)); -+#endif -+ spin_unlock_irqrestore(&priv->lock, flags); -+ } -+ } -+ -+ ipw_update_rate_scaling(priv, associate->ieee_mode); -+ if (rc) { -+ priv->status &= ~STATUS_ASSOCIATING; -+ priv->status &= ~STATUS_ASSOCIATED; -+ } -+ -+ return rc; -+} -+ -+/* TODO: Look at scheduling this callback outside of ISR so we can switch -+ * the daemon_lock spin_lock to not have to disable interrutps */ -+static int ipw_daemon_cmd_callback(struct ipw_priv *priv, -+ struct ipw_cmd *cmd, struct sk_buff *skb) -+{ -+ struct list_head *element; -+ struct ipw_daemon_cmd_list *daemon_cmd; -+ unsigned long flags; -+ -+ BUG_ON(!skb); -+ -+ IPW_DEBUG_DAEMON(":: #%02X completed by adapter.\n", cmd->hdr.cmd); -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ -+ if (list_empty(&priv->daemon_free_list)) { -+ IPW_DEBUG_DAEMON("No room on free list...\n"); -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ return 1; /* We didn't cache the SKB */ -+ } -+ -+ element = priv->daemon_free_list.next; -+ list_del(element); -+ -+ daemon_cmd = list_entry(element, struct ipw_daemon_cmd_list, list); -+ -+ daemon_cmd->cmd.cmd = cmd->hdr.cmd; -+ daemon_cmd->cmd.data_len = cmd->meta.len; -+ daemon_cmd->cmd.flags = cmd->meta.flags & CMD_DAEMON_MASK; -+ daemon_cmd->skb_resp = skb; -+ daemon_cmd->cmd.token = cmd->meta.token; -+ list_add_tail(&daemon_cmd->list, &priv->daemon_out_list); -+ -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ wake_up_interruptible_all(&priv->wait_daemon_out_queue); -+ -+ /* We did cache the SKB, so tell caller not to free it */ -+ return 0; -+} -+ -+static int ipw_handle_daemon_request_info(struct ipw_priv *priv, struct daemon_cmd_hdr -+ *daemon_cmd) -+{ -+ struct daemon_request_info *request = (void *)daemon_cmd->data; -+ s32 *temperature = (void *)daemon_cmd->data; -+ -+ switch (request->request) { -+ case DAEMON_REQUEST_TEMPERATURE: -+ *temperature = ipw_read32(priv, CSR_UCODE_DRV_GP2); -+ daemon_cmd->data_len = sizeof(*temperature); -+ break; -+ -+ case DAEMON_REQUEST_EEPROM: -+ memcpy(daemon_cmd->data, priv->eeprom, EEPROM_IMAGE_SIZE); -+ daemon_cmd->data_len = EEPROM_IMAGE_SIZE; -+ break; -+ -+ default: -+ daemon_cmd->data_len = 0; -+ break; -+ } -+ -+ return 0; -+} -+ -+static int ipw_send_power_mode(struct ipw_priv *priv, u32 mode) -+{ -+ u32 final_mode = mode; -+ int rc = 0; -+ unsigned long flags; -+ struct ipw_powertable_cmd cmd; -+ -+ /* If on battery, set to 3, if AC set to CAM, else user -+ * level */ -+ switch (mode) { -+ case IPW_POWER_BATTERY: -+ final_mode = IPW_POWER_INDEX_3; -+ break; -+ case IPW_POWER_AC: -+ final_mode = IPW_POWER_MODE_CAM; -+ break; -+ default: -+ final_mode = mode; -+ break; -+ } -+ -+ ipw_update_power_cmd(priv, &cmd, final_mode); -+ -+ rc = ipw_send_cmd_pdu(priv, POWER_TABLE_CMD, sizeof(cmd), &cmd); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ -+ if (final_mode == IPW_POWER_MODE_CAM) { -+ priv->status &= ~STATUS_POWER_PMI; -+ } else { -+ priv->status |= STATUS_POWER_PMI; -+ } -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+} -+ -+static void ipw_set_supported_rates_mask(struct ipw_priv *priv, int rates_mask) -+{ -+ priv->active_rate = rates_mask & 0xffff; -+ priv->active_rate_basic = (rates_mask >> 16) & 0xffff; -+} -+ -+static void ipw_init_rates_mask(struct ipw_priv *priv) -+{ -+ priv->rates_mask = 0; -+ -+ if (priv->ieee->modulation & IEEE80211_OFDM_MODULATION) { -+ priv->rates_mask |= IEEE80211_OFDM_DEFAULT_RATES_MASK; -+ priv->rates_mask |= IEEE80211_OFDM_BASIC_RATES_MASK << 16; -+ } -+ -+ if (priv->ieee->modulation & IEEE80211_CCK_MODULATION) { -+ priv->rates_mask |= IEEE80211_CCK_DEFAULT_RATES_MASK; -+ priv->rates_mask |= IEEE80211_CCK_BASIC_RATES_MASK << 16; -+ } -+} -+ -+static void ipw_bg_calibrated_work(void *data) -+{ -+ struct ipw_priv *priv = data; -+ int rc = 0; -+ mutex_lock(&priv->mutex); -+ -+ IPW_DEBUG_INFO("CALIBRATED state set by daemon.\n"); -+ priv->status |= STATUS_CALIBRATE; -+ -+ if (!priv->netdev_registered) { -+ mutex_unlock(&priv->mutex); -+ rc = register_netdev(priv->net_dev); -+ if (rc) { -+ IPW_ERROR("Failed to register network " -+ "device (error %d) - Scheduling re-init " -+ "in 5 seconds.\n", rc); -+ queue_delayed_work(priv->workqueue, -+ &priv->down, 5 * HZ); -+ return; -+ } -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+ if (rtap_iface) { -+ rc = ipw_prom_alloc(priv); -+ if (rc) { -+ IPW_ERROR -+ ("Failed to register promiscuous network " -+ "device (error %d) - Scheduling re-init " -+ "in 5 seconds.\n", rc); -+ queue_delayed_work(priv->workqueue, -+ &priv->down, 5 * HZ); -+ unregister_netdev(priv->net_dev); -+ return; -+ } -+ } -+#endif -+ mutex_lock(&priv->mutex); -+ priv->netdev_registered = 1; -+ -+ /* For some reason, this card comes up with IFF_RUNNING set. -+ * If you associate and disassociate, it resets that bit -+ * correctly... so force a netif_carrier_off here to -+ * simulate that behavior. */ -+ netif_carrier_off(priv->net_dev); -+ } -+ -+ ipw_init_rates_mask(priv); -+ ipw_set_supported_rates_mask(priv, priv->rates_mask); -+ -+#ifdef CONFIG_IPW3945_QOS -+ ipw_qos_activate(priv, NULL); -+#endif -+ -+ ipw_send_power_mode(priv, IPW_POWER_LEVEL(priv->power_mode)); -+ -+ IPW_DEBUG_RADIO -+ ("connection mode %0x modulation %0X band %0x \n", -+ priv->ieee->mode, priv->ieee->modulation, priv->ieee->freq_band); -+ -+ /* Initialize our rx_config data */ -+ ipw_connection_init_rx_config(priv); -+ memcpy(priv->rxon.node_addr, priv->net_dev->dev_addr, ETH_ALEN); -+ -+ /* Configure BT coexistence */ -+ ipw_send_bt_config(priv); -+ -+ /* Configure the adapter for unassociated operation */ -+ ipw_rxon_call(priv, 0); -+ -+ /* Add the broadcast address so we can send probe requests */ -+ ipw_rxon_add_station(priv, BROADCAST_ADDR, 0); -+ -+ /* At this point, the NIC is initialized and operational */ -+ priv->notif_missed_beacons = 0; -+ priv->status |= STATUS_READY; -+ -+ ipw_update_link_led(priv); -+ -+ /* If configured to try and auto-associate, or if we've received -+ * sufficient configuration information at this point, then kick -+ * off a scan */ -+ if ((priv->config & (CFG_ASSOCIATE | CFG_STATIC_ESSID | -+ CFG_STATIC_CHANNEL | CFG_STATIC_BSSID)) -+ || (priv->status & STATUS_SCAN_PENDING)) -+ ipw_scan_initiate(priv, priv->ieee->freq_band, 0); -+ -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_handle_daemon_set_state(struct ipw_priv *priv, -+ struct daemon_cmd_hdr *cmd) -+{ -+ struct daemon_set_state *set = (void *)cmd->data; -+ -+ mutex_lock(&priv->mutex); -+ -+ switch (set->state) { -+ case DAEMON_DRIVER_STATE_UNINIT: -+ IPW_DEBUG_INFO("UNINIT state requested by daemon.\n"); -+ queue_work(priv->workqueue, &priv->down); -+ break; -+ -+ case DAEMON_DRIVER_STATE_INIT: -+ IPW_DEBUG_INFO("INIT state requested by daemon.\n"); -+ queue_work(priv->workqueue, &priv->up); -+ break; -+ -+ case DAEMON_DRIVER_STATE_CALIBRATED: -+ IPW_DEBUG_INFO("CALIBRATED state requested by daemon.\n"); -+ queue_work(priv->workqueue, &priv->calibrated_work); -+ break; -+ } -+ -+ mutex_unlock(&priv->mutex); -+} -+ -+/* Initialize 80211's geo/channel info based from daemon */ -+static void ipw_init_geos(struct ipw_priv *priv, -+ struct daemon_regulatory_info *info) -+{ -+ struct daemon_channel_info *ch; -+ struct ieee80211_geo *geo; -+ struct ieee80211_channel *geo_ch; -+ int i = 0, bg, a; -+ -+ geo = kzalloc(sizeof(*geo), GFP_KERNEL); -+ if (!geo) { -+ IPW_ERROR("Insufficient memory to work with channels.\n"); -+ return; -+ } -+ -+ for (i = 0, a = 0, bg = 0; i < info->count; i++) { -+ ch = &info->channel_info[i]; -+ if (ch->flags & DAEMON_A_BAND) { -+ if (ch->channel < IEEE80211_52GHZ_MIN_CHANNEL -+ || ch->channel > IEEE80211_52GHZ_MAX_CHANNEL) { -+ IPW_WARNING -+ ("5.2Ghz channel %d not supported by " -+ "ieee80211 subsystem.\n", ch->channel); -+ continue; -+ } -+ -+ a = geo->a_channels++; -+ geo_ch = &geo->a[a]; -+ } else { -+ if (ch->channel < IEEE80211_24GHZ_MIN_CHANNEL -+ || ch->channel > IEEE80211_24GHZ_MAX_CHANNEL) { -+ IPW_WARNING -+ ("2.4Ghz channel %d not supported by " -+ "ieee80211 subsystem.\n", ch->channel); -+ continue; -+ } -+ -+ bg = geo->bg_channels++; -+ geo_ch = &geo->bg[bg]; -+ } -+ -+ geo_ch->freq = ieee80211chan2mhz(ch->channel); -+ geo_ch->channel = ch->channel; -+ geo_ch->max_power = ch->max_txpower; -+ -+ if (!(ch->flags & DAEMON_IBSS_ALLOWED)) -+ geo_ch->flags |= IEEE80211_CH_NO_IBSS; -+ -+ if (!(ch->flags & DAEMON_ACTIVE_ALLOWED)) -+ geo_ch->flags |= IEEE80211_CH_PASSIVE_ONLY; -+ -+ if (ch->flags & DAEMON_RADAR_DETECT) -+ geo_ch->flags |= IEEE80211_CH_RADAR_DETECT; -+ -+ if (ch->max_txpower > priv->max_channel_txpower_limit) -+ priv->max_channel_txpower_limit = ch->max_txpower; -+ } -+ -+ if ((geo->a_channels == 0) && priv->is_abg) { -+ printk(KERN_INFO DRV_NAME -+ ": Incorrectly detected BG card as ABG. Please send " -+ "your PCI ID 0x%04X:0x%04X to maintainer.\n", -+ priv->pci_dev->device, priv->pci_dev->subsystem_device); -+ priv->ieee->mode &= ~IEEE_A; -+ priv->ieee->freq_band &= ~IEEE80211_52GHZ_BAND; -+ priv->is_abg = 0; -+ } -+ -+ if (priv->is_abg) -+ strncpy(geo->name, "ABG", sizeof(geo->name)); -+ else -+ strncpy(geo->name, "xBG", sizeof(geo->name)); -+ -+ ieee80211_set_geo(priv->ieee, geo); -+ -+ if ((priv->config & CFG_STATIC_CHANNEL) && -+ !ieee80211_is_valid_channel(priv->ieee, priv->channel)) { -+ IPW_WARNING("Invalid channel configured. Resetting to ANY.\n"); -+ priv->channel = 1; -+ priv->config &= ~CFG_STATIC_CHANNEL; -+ } -+ -+ 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, -+ priv->ieee->geo.a_channels); -+ -+ priv->status |= STATUS_GEO_CONFIGURED; -+ -+ kfree(geo); -+} -+ -+static void ipw_bg_daemon_cmd(void *data) -+{ -+ struct ipw_priv *priv = data; -+ struct list_head *element; -+ struct ipw_host_cmd cmd = { -+ .id = 0, -+ }; -+ struct ipw_daemon_cmd_list *daemon_cmd; -+ int rc = 0; -+ unsigned long flags; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ -+ while (!list_empty(&priv->daemon_in_list)) { -+ element = priv->daemon_in_list.next; -+ list_del(element); -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ daemon_cmd = -+ list_entry(element, struct ipw_daemon_cmd_list, list); -+ -+ IPW_DEBUG_DAEMON(":: #%02X.\n", daemon_cmd->cmd.cmd); -+ -+ if (daemon_cmd->cmd.flags & DAEMON_FLAG_NIC_CMD) { -+ IPW_DEBUG_DAEMON -+ ("Queuing daemon requested cmd " -+ "#%02X\n", daemon_cmd->cmd.cmd); -+ cmd.id = daemon_cmd->cmd.cmd; -+ cmd.len = daemon_cmd->cmd.data_len; -+ cmd.meta.token = daemon_cmd->cmd.token; -+ cmd.meta.flags = CMD_INDIRECT | CMD_ASYNC; -+ -+ if (daemon_cmd->cmd.flags & DAEMON_FLAG_HUGE) -+ cmd.meta.flags |= CMD_SIZE_HUGE; -+ -+ cmd.meta.u.callback = &ipw_daemon_cmd_callback; -+ cmd.data = daemon_cmd->cmd.data; -+ printk_buf(IPW_DL_DAEMON, -+ daemon_cmd->cmd.data, -+ daemon_cmd->cmd.data_len); -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ list_add(&daemon_cmd->list, &priv->daemon_free_list); -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ rc = ipw_send_cmd(priv, &cmd); -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ -+ if (rc) { -+ IPW_DEBUG_INFO("Command failed: %d\n", rc); -+ -+ /* Remove this command from the pending -+ * command response list */ -+ list_del(&daemon_cmd->list); -+ -+ daemon_cmd->cmd.data_len = 0; -+ -+ list_add_tail(&daemon_cmd->list, -+ &priv->daemon_out_list); -+ -+ wake_up_interruptible_all(&priv-> -+ wait_daemon_out_queue); -+ } -+ -+ /* If the command succeeded, the daemon_cmd will be -+ * freed in the callback handler. */ -+ -+ continue; -+ } -+ -+ switch (daemon_cmd->cmd.cmd) { -+ case DAEMON_CMD_DONE:{ -+ struct daemon_cmd_done *done = -+ (void *)daemon_cmd->cmd.data; -+ -+ daemon_cmd->cmd.data_len = 0; -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ priv->daemon_cmd_rc = done->return_code; -+ priv->status &= ~STATUS_DCMD_ACTIVE; -+ list_add_tail(&daemon_cmd->list, -+ &priv->daemon_out_list); -+ spin_unlock_irqrestore(&priv-> -+ daemon_lock, flags); -+ -+ wake_up_interruptible_all(&priv-> -+ wait_daemon_cmd_done); -+ -+ wake_up_interruptible_all(&priv-> -+ wait_daemon_out_queue); -+ -+ break; -+ } -+ -+ case DAEMON_ERROR:{ -+#ifdef CONFIG_IPW3945_DEBUG -+ struct daemon_error *error = -+ (struct daemon_error *) -+ daemon_cmd->cmd.data; -+ IPW_DEBUG_INFO -+ ("error received from daemon " -+ "for command %s (#%02X): %d\n", -+ get_cmd_string(error-> -+ cmd_requested), -+ error->cmd_requested, error->return_code); -+#endif -+ daemon_cmd->cmd.data_len = 0; -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ list_add_tail(&daemon_cmd->list, -+ &priv->daemon_out_list); -+ spin_unlock_irqrestore(&priv-> -+ daemon_lock, flags); -+ -+ wake_up_interruptible_all(&priv-> -+ wait_daemon_out_queue); -+ } -+ break; -+ -+ case DAEMON_FRAME_TX: -+#if IPW3945_COMPAT >= 2 -+ ieee80211_tx_frame(priv->ieee, (struct ieee80211_hdr *) -+ daemon_cmd->cmd.data, 0, -+ daemon_cmd->cmd.data_len, 0); -+#else -+ ieee80211_tx_frame(priv->ieee, (struct ieee80211_hdr *) -+ daemon_cmd->cmd.data, -+ daemon_cmd->cmd.data_len); -+#endif -+ daemon_cmd->cmd.data_len = 0; -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ list_add_tail(&daemon_cmd->list, -+ &priv->daemon_out_list); -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ wake_up_interruptible_all(&priv->wait_daemon_out_queue); -+ break; -+ -+ case DAEMON_REGULATORY_INFO:{ -+ struct daemon_regulatory_info *info = -+ (struct daemon_regulatory_info *) -+ daemon_cmd->cmd.data; -+ -+ IPW_DEBUG_DAEMON -+ ("Initializing %d channels.\n", -+ info->count); -+ -+ if (info->count != 1) -+ ipw_init_geos(priv, info); -+ else { -+ if (priv->channel == -+ info->channel_info[0].channel) -+ priv-> -+ actual_txpower_limit -+ = -+ info-> -+ channel_info[0].txpower; -+ } -+ -+ daemon_cmd->cmd.data_len = 0; -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ list_add_tail(&daemon_cmd->list, -+ &priv->daemon_out_list); -+ spin_unlock_irqrestore(&priv-> -+ daemon_lock, flags); -+ -+ wake_up_interruptible_all(&priv-> -+ wait_daemon_out_queue); -+ break; -+ } -+ -+ case DAEMON_REQUEST_INFO:{ -+ if (ipw_handle_daemon_request_info -+ (priv, &daemon_cmd->cmd)) -+ daemon_cmd->cmd.data_len = 0; -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ list_add_tail(&daemon_cmd->list, -+ &priv->daemon_out_list); -+ spin_unlock_irqrestore(&priv-> -+ daemon_lock, flags); -+ wake_up_interruptible_all(&priv-> -+ wait_daemon_out_queue); -+ -+ break; -+ } -+ -+ case DAEMON_SET_STATE:{ -+ ipw_handle_daemon_set_state(priv, -+ &daemon_cmd->cmd); -+ /* No response bytes */ -+ daemon_cmd->cmd.data_len = 0; -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ list_add_tail(&daemon_cmd->list, -+ &priv->daemon_out_list); -+ spin_unlock_irqrestore(&priv-> -+ daemon_lock, flags); -+ wake_up_interruptible_all(&priv-> -+ wait_daemon_out_queue); -+ break; -+ } -+ -+ default: -+ IPW_DEBUG_INFO("Command unhandled: %d\n", -+ daemon_cmd->cmd.cmd); -+ kfree(daemon_cmd); -+ break; -+ } -+ -+ /* lock needs to be held at start of loop */ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ } -+ -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+} -+ -+static void ipw_bg_post_associate(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_post_associate(priv, priv->assoc_request.assoc_id); -+ mutex_unlock(&priv->mutex); -+} -+ -+/* get info from our private copy of the eeprom data */ -+static int ipw_query_eeprom(struct ipw_priv *priv, u32 offset, -+ u32 len, u8 * buf) -+{ -+ if (EEPROM_IMAGE_SIZE < (offset + len)) -+ return -1; -+ -+ memcpy(buf, &(priv->eeprom[offset]), len); -+ -+ return 0; -+} -+ -+static void eeprom_parse_mac(struct ipw_priv *priv, u8 * mac) -+{ -+ ipw_query_eeprom(priv, EEPROM_MAC_ADDRESS, 6, mac); -+} -+ -+/* -+ * Either the device driver (i.e. the host) or the firmware can -+ * load eeprom data into the designated region in SRAM. If neither -+ * happens then the FW will shutdown with a fatal error. -+ * -+ * In order to signal the FW to load the EEPROM, the EEPROM_LOAD_DISABLE -+ * bit needs region of shared SRAM needs to be non-zero. -+ */ -+static int ipw_eeprom_init_sram(struct ipw_priv *priv) -+{ -+ u16 *e = (u16 *) priv->eeprom; -+ u32 r; -+ int to; -+ u32 gp = ipw_read32(priv, CSR_EEPROM_GP); -+ u16 sz = EEPROM_IMAGE_SIZE; -+ int rc; -+ u16 addr; -+ -+ if ((gp & 0x00000007) == 0x00000000) { -+ IPW_ERROR("EEPROM not found, EEPROM_GP=0x%08x", gp); -+ return -ENOENT; -+ } -+ -+ ipw_clear_bit(priv, CSR_EEPROM_GP, 0x00000180); -+ for (addr = 0, r = 0; addr < sz; addr += 2) { -+ ipw_write32(priv, CSR_EEPROM_REG, addr << 1); -+ ipw_clear_bit(priv, CSR_EEPROM_REG, 0x00000002); -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) -+ return rc; -+ -+ for (to = 0; to < 10; to++) { -+ r = ipw_read_restricted(priv, CSR_EEPROM_REG); -+ if (r & 1) -+ break; -+ udelay(5); -+ } -+ -+ ipw_release_restricted_access(priv); -+ -+ if (!(r & 1)) { -+ IPW_ERROR("Time out reading EEPROM[%d]", addr); -+ return -ETIMEDOUT; -+ } -+ -+ e[addr / 2] = r >> 16; -+ } -+ -+ return 0; -+} -+ -+/************************** END ***********************/ -+ -+static void ipw_remove_current_network(struct ipw_priv *priv) -+{ -+ struct list_head *element, *safe; -+ struct ieee80211_network *network = NULL; -+ unsigned long flags; -+ -+ IPW_DEBUG_INFO("remove current station\n"); -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ list_for_each_safe(element, safe, &priv->ieee->network_list) { -+ network = list_entry(element, struct ieee80211_network, list); -+ if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) { -+// ieee80211_reset_network(network); -+ list_del(element); -+ list_add_tail(&network->list, -+ &priv->ieee->network_free_list); -+ } -+ } -+ -+ priv->assoc_network = NULL; -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+} -+ -+/************************** RX-FUNCTIONS ****************************/ -+/* -+ * Rx theory of operation -+ * -+ * The host allocates 32 DMA target addresses and passes the host address -+ * to the firmware at register IPW_RFDS_TABLE_LOWER + N * RFD_SIZE where N is -+ * 0 to 31 -+ * -+ * Rx Queue Indexes -+ * The host/firmware share two index registers for managing the Rx buffers. -+ * -+ * The READ index maps to the first position that the firmware may be writing -+ * to -- the driver can read up to (but not including) this position and get -+ * good data. -+ * The READ index is managed by the firmware once the card is enabled. -+ * -+ * The WRITE index maps to the last position the driver has read from -- the -+ * position preceding WRITE is the last slot the firmware can place a packet. -+ * -+ * The queue is empty (no good data) if WRITE = READ - 1, and is full if -+ * WRITE = READ. -+ * -+ * During initialization the host sets up the READ queue position to the first -+ * INDEX position, and WRITE to the last (READ - 1 wrapped) -+ * -+ * When the firmware places a packet in a buffer it will advance the READ index -+ * and fire the RX interrupt. The driver can then query the READ index and -+ * process as many packets as possible, moving the WRITE index forward as it -+ * resets the Rx queue buffers with new memory. -+ * -+ * The management in the driver is as follows: -+ * + A list of pre-allocated SKBs is stored in ipw->rxq->rx_free. When -+ * ipw->rxq->free_count drops to or below RX_LOW_WATERMARK, work is scheduled -+ * to replensish the ipw->rxq->rx_free. -+ * + In ipw_rx_queue_replenish (scheduled) if 'processed' != 'read' then the -+ * ipw->rxq is replenished and the READ INDEX is updated (updating the -+ * 'processed' and 'read' driver indexes as well) -+ * + A received packet is processed and handed to the kernel network stack, -+ * detached from the ipw->rxq. The driver 'processed' index is updated. -+ * + The Host/Firmware ipw->rxq is replenished at tasklet time from the rx_free -+ * list. If there are no allocated buffers in ipw->rxq->rx_free, the READ -+ * INDEX is not incremented and ipw->status(RX_STALLED) is set. If there -+ * were enough free buffers and RX_STALLED is set it is cleared. -+ * -+ * -+ * Driver sequence: -+ * -+ * ipw_rx_queue_alloc() Allocates rx_free -+ * ipw_rx_queue_replenish() Replenishes rx_free list from rx_used, and calls -+ * ipw_rx_queue_restock -+ * ipw_rx_queue_restock() Moves available buffers from rx_free into Rx -+ * queue, updates firmware pointers, and updates -+ * the WRITE index. If insufficient rx_free buffers -+ * are available, schedules ipw_rx_queue_replenish -+ * -+ * -- enable interrupts -- -+ * ISR - ipw_rx() Detach ipw_rx_mem_buffers from pool up to the -+ * READ INDEX, detaching the SKB from the pool. -+ * Moves the packet buffer from queue to rx_used. -+ * Calls ipw_rx_queue_restock to refill any empty -+ * slots. -+ * ... -+ * -+ */ -+ -+static inline int ipw_rx_queue_space(struct ipw_rx_queue *q) -+{ -+ int s = q->read - q->write; -+ if (s <= 0) -+ s += RX_QUEUE_SIZE; -+ s -= 2; // keep some buffer to not confuse full and empty queue -+ if (s < 0) -+ s = 0; -+ return s; -+} -+ -+static int ipw_rx_queue_update_write_ptr(struct ipw_priv *priv, -+ struct ipw_rx_queue *q) -+{ -+ u32 reg = 0; -+ int rc = 0; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&q->lock, flags); -+ -+ if (q->need_update == 0) -+ goto exit_unlock; -+ -+ if (priv->status & STATUS_POWER_PMI) { -+ reg = ipw_read32(priv, CSR_UCODE_DRV_GP1); -+ -+ if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) { -+ ipw_set_bit(priv, CSR_GP_CNTRL, -+ CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); -+ goto exit_unlock; -+ } -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) -+ goto exit_unlock; -+ -+ ipw_write_restricted(priv, FH_RCSR_WPTR(0), q->write & ~0x7); -+ ipw_release_restricted_access(priv); -+ } else { -+ ipw_write32(priv, FH_RCSR_WPTR(0), q->write & ~0x7); -+ } -+ -+ q->need_update = 0; -+ -+ exit_unlock: -+ spin_unlock_irqrestore(&q->lock, flags); -+ return rc; -+} -+ -+/* -+ * If there are slots in the RX queue that need to be restocked, -+ * and we have free pre-allocated buffers, fill the ranks as much -+ * as we can pulling from rx_free. -+ * -+ * This moves the 'write' index forward to catch up with 'processed', and -+ * also updates the memory address in the firmware to reference the new -+ * target buffer. -+ */ -+static int ipw_rx_queue_restock(struct ipw_priv *priv) -+{ -+ struct ipw_rx_queue *rxq = priv->rxq; -+ struct list_head *element; -+ struct ipw_rx_mem_buffer *rxb; -+ unsigned long flags; -+ int write; -+ int counter = 0; -+ int rc; -+ -+ spin_lock_irqsave(&rxq->lock, flags); -+ write = rxq->write & ~0x7; -+ while ((ipw_rx_queue_space(rxq) > 0) && (rxq->free_count)) { -+ element = rxq->rx_free.next; -+ rxb = list_entry(element, struct ipw_rx_mem_buffer, list); -+ list_del(element); -+ -+ ((u32 *) rxq->bd)[rxq->write] = (u32) rxb->dma_addr; -+ -+ rxq->queue[rxq->write] = rxb; -+ rxq->write = (rxq->write + 1) % RX_QUEUE_SIZE; -+ rxq->free_count--; -+ counter++; -+ } -+ spin_unlock_irqrestore(&rxq->lock, flags); -+ /* If the pre-allocated buffer pool is dropping low, schedule to -+ * refill it */ -+ if (rxq->free_count <= RX_LOW_WATERMARK) { -+ queue_work(priv->workqueue, &priv->rx_replenish); -+ } -+ -+ counter = ipw_rx_queue_space(rxq); -+ /* If we've added more space for the firmware to place data, tell it */ -+ if ((write != (rxq->write & ~0x7)) -+ || (abs(rxq->write - rxq->read) > 7)) { -+ spin_lock_irqsave(&rxq->lock, flags); -+ rxq->need_update = 1; -+ spin_unlock_irqrestore(&rxq->lock, flags); -+ rc = ipw_rx_queue_update_write_ptr(priv, rxq); -+ if (rc) { -+ return rc; -+ } -+ } -+ -+ return 0; -+} -+ -+/* -+ * Move all used packet from rx_used to rx_free, allocating a new SKB for each. -+ * Also restock the Rx queue via ipw_rx_queue_restock. -+ * -+ * This is called as a scheduled work item (except for during intialization) -+ */ -+static void ipw_rx_queue_replenish(void *data) -+{ -+ struct ipw_priv *priv = data; -+ struct ipw_rx_queue *rxq = priv->rxq; -+ struct list_head *element; -+ struct ipw_rx_mem_buffer *rxb; -+ unsigned long flags; -+ spin_lock_irqsave(&rxq->lock, flags); -+ while (!list_empty(&rxq->rx_used)) { -+ element = rxq->rx_used.next; -+ rxb = list_entry(element, struct ipw_rx_mem_buffer, list); -+ rxb->skb = alloc_skb(IPW_RX_BUF_SIZE, GFP_ATOMIC); -+ if (!rxb->skb) { -+ printk(KERN_CRIT -+ "%s: Can not allocate SKB buffers.\n", -+ priv->net_dev->name); -+ /* We don't reschedule replenish work here -- we will -+ * call the restock method and if it still needs -+ * more buffers it will schedule replenish */ -+ break; -+ } -+ list_del(element); -+ rxb->dma_addr = -+ pci_map_single(priv->pci_dev, rxb->skb->data, -+ IPW_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); -+ list_add_tail(&rxb->list, &rxq->rx_free); -+ rxq->free_count++; -+ } -+ spin_unlock_irqrestore(&rxq->lock, flags); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ ipw_rx_queue_restock(priv); -+ spin_unlock_irqrestore(&priv->lock, flags); -+} -+ -+static void ipw_bg_rx_queue_replenish(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_rx_queue_replenish(data); -+ mutex_unlock(&priv->mutex); -+} -+ -+/* Assumes that the skb field of the buffers in 'pool' is kept accurate. -+ * If an SKB has been detached, the POOL needs to have it's SKB set to NULL -+ * This free routine walks the list of POOL entries and if SKB is set to -+ * non NULL it is unmapped and freed -+ */ -+static void ipw_rx_queue_free(struct ipw_priv *priv, struct ipw_rx_queue *rxq) -+{ -+ int i; -+ if (!rxq) -+ return; -+ for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { -+ if (rxq->pool[i].skb != NULL) { -+ pci_unmap_single(priv->pci_dev, -+ rxq->pool[i].dma_addr, -+ IPW_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); -+ dev_kfree_skb(rxq->pool[i].skb); -+ } -+ } -+ -+ pci_free_consistent(priv->pci_dev, 4 * RX_QUEUE_SIZE, rxq->bd, -+ rxq->dma_addr); -+ kfree(rxq); -+} -+ -+static int ipw_rxq_stop(struct ipw_priv *priv) -+{ -+ int rc; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ -+ ipw_write_restricted(priv, FH_RCSR_CONFIG(0), 0); -+ rc = ipw_poll_restricted_bit(priv, FH_RSSR_STATUS, (1 << 24), 1000); -+ if (rc < 0) -+ IPW_ERROR("Can't stop Rx DMA.\n"); -+ -+ ipw_release_restricted_access(priv); -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ return 0; -+} -+ -+static int ipw_rx_init(struct ipw_priv *priv, struct ipw_rx_queue *rxq) -+{ -+ int rc; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ -+ ipw_write_restricted(priv, FH_RCSR_RBD_BASE(0), rxq->dma_addr); -+ ipw_write_restricted(priv, FH_RCSR_RPTR_ADDR(0), -+ priv->shared_phys + -+ offsetof(struct ipw_shared_t, rx_read_ptr[0])); -+ ipw_write_restricted(priv, FH_RCSR_WPTR(0), 0); -+ ipw_write_restricted(priv, FH_RCSR_CONFIG(0), -+ ALM_FH_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE -+ | -+ ALM_FH_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE -+ | -+ ALM_FH_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN -+ | -+ ALM_FH_RCSR_RX_CONFIG_REG_VAL_MAX_FRAG_SIZE_128 -+ | (RX_QUEUE_SIZE_LOG << -+ ALM_FH_RCSR_RX_CONFIG_REG_POS_RBDC_SIZE) -+ | -+ ALM_FH_RCSR_RX_CONFIG_REG_VAL_IRQ_DEST_INT_HOST -+ | (1 << ALM_FH_RCSR_RX_CONFIG_REG_POS_IRQ_RBTH) -+ | ALM_FH_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH); -+ -+ /* fake read to flush all prev I/O */ -+ ipw_read_restricted(priv, FH_RSSR_CTRL); -+ -+ ipw_release_restricted_access(priv); -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ return 0; -+} -+ -+static struct ipw_rx_queue *ipw_rx_queue_alloc(struct ipw_priv *priv) -+{ -+ struct ipw_rx_queue *rxq; -+ struct pci_dev *dev = priv->pci_dev; -+ int i; -+ rxq = (struct ipw_rx_queue *)kmalloc(sizeof(*rxq), GFP_ATOMIC); -+ memset(rxq, 0, sizeof(*rxq)); -+ -+ spin_lock_init(&rxq->lock); -+ INIT_LIST_HEAD(&rxq->rx_free); -+ INIT_LIST_HEAD(&rxq->rx_used); -+ rxq->bd = pci_alloc_consistent(dev, 4 * RX_QUEUE_SIZE, &rxq->dma_addr); -+ /* Fill the rx_used queue with _all_ of the Rx buffers */ -+ for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++) -+ list_add_tail(&rxq->pool[i].list, &rxq->rx_used); -+ /* Set us so that we have processed and used all buffers, but have -+ * not restocked the Rx queue with fresh buffers */ -+ rxq->read = rxq->write = 0; -+ rxq->free_count = 0; -+ rxq->need_update = 0; -+ return rxq; -+} -+ -+static inline void ipw_rx_queue_reset(struct ipw_priv *priv, -+ struct ipw_rx_queue *rxq) -+{ -+ unsigned long flags; -+ int i; -+ spin_lock_irqsave(&rxq->lock, flags); -+ INIT_LIST_HEAD(&rxq->rx_free); -+ INIT_LIST_HEAD(&rxq->rx_used); -+ /* Fill the rx_used queue with _all_ of the Rx buffers */ -+ for (i = 0; i < RX_FREE_BUFFERS + RX_QUEUE_SIZE; i++) { -+ /* In the reset function, these buffers may have been allocated -+ * to an SKB, so we need to unmap and free potential storage */ -+ if (rxq->pool[i].skb != NULL) { -+ pci_unmap_single(priv->pci_dev, -+ rxq->pool[i].dma_addr, -+ IPW_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); -+ dev_kfree_skb(rxq->pool[i].skb); -+ rxq->pool[i].skb = NULL; -+ } -+ list_add_tail(&rxq->pool[i].list, &rxq->rx_used); -+ } -+ -+ /* Set us so that we have processed and used all buffers, but have -+ * not restocked the Rx queue with fresh buffers */ -+ rxq->read = rxq->write = 0; -+ rxq->free_count = 0; -+ spin_unlock_irqrestore(&rxq->lock, flags); -+} -+ -+/************************ NIC-FUNCTIONS *******************/ -+/** -+ * Check that card is still alive. -+ * Reads debug register from domain0. -+ * If card is present, pre-defined value should -+ * be found there. -+ * -+ * @param priv -+ * @return 1 if card is present, 0 otherwise -+ */ -+static inline int ipw_alive(struct ipw_priv *priv) -+{ -+ u32 val = ipw_read32(priv, CSR_RESET); -+ if (val & CSR_RESET_REG_FLAG_NEVO_RESET) -+ return 0; -+ -+ IPW_DEBUG_INFO("Card is alive \n"); -+ return 1; -+} -+ -+/* These functions load the firmware and micro code for the operation of -+ * the ipw hardware. It assumes the buffer has all the bits for the -+ * image and the caller is handling the memory allocation and clean up. -+ */ -+ -+static int ipw_nic_stop_master(struct ipw_priv *priv) -+{ -+ int rc = 0; -+ u32 reg_val; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ -+ /* set stop master bit */ -+ ipw_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER); -+ -+ reg_val = ipw_read32(priv, CSR_GP_CNTRL); -+ -+ if (CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE == -+ (reg_val & CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE)) { -+ IPW_DEBUG_INFO -+ ("Card in power save, master is already stopped\n"); -+ } else { -+ rc = ipw_poll_bit(priv, -+ CSR_RESET, -+ CSR_RESET_REG_FLAG_MASTER_DISABLED, -+ CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); -+ if (rc < 0) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ } -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+ IPW_DEBUG_INFO("stop master\n"); -+ -+ return rc; -+} -+ -+static int ipw_nic_set_pwr_src(struct ipw_priv *priv, int pwr_max) -+{ -+ int rc = 0; -+ unsigned long flags; -+ -+ //return 0; -+ spin_lock_irqsave(&priv->lock, flags); -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ -+ if (!pwr_max) { -+ u32 val; -+ rc = pci_read_config_dword(priv->pci_dev, 0x0C8, &val); -+ if (val & PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT) { -+ ipw_set_bits_mask_restricted_reg(priv, -+ ALM_APMG_PS_CTL, -+ APMG_PS_CTRL_REG_VAL_POWER_SRC_VAUX, -+ ~APMG_PS_CTRL_REG_MSK_POWER_SRC); -+ ipw_release_restricted_access(priv); -+ -+ ipw_poll_bit(priv, CSR_GPIO_IN, CSR_GPIO_IN_VAL_VAUX_PWR_SRC, CSR_GPIO_IN_BIT_AUX_POWER, 5000); //uS -+ } -+ -+ } else { -+ ipw_set_bits_mask_restricted_reg(priv, -+ ALM_APMG_PS_CTL, -+ APMG_PS_CTRL_REG_VAL_POWER_SRC_VMAIN, -+ ~APMG_PS_CTRL_REG_MSK_POWER_SRC); -+ -+ ipw_release_restricted_access(priv); -+ ipw_poll_bit(priv, CSR_GPIO_IN, CSR_GPIO_IN_VAL_VMAIN_PWR_SRC, CSR_GPIO_IN_BIT_AUX_POWER, 5000); //uS -+ } -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ return rc; -+} -+ -+static void ipw_nic_start(struct ipw_priv *priv) -+{ -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ ipw_clear_bit(priv, CSR_RESET, -+ CSR_RESET_REG_FLAG_MASTER_DISABLED | -+ CSR_RESET_REG_FLAG_STOP_MASTER | -+ CSR_RESET_REG_FLAG_NEVO_RESET); -+ spin_unlock_irqrestore(&priv->lock, flags); -+} -+ -+static int ipw_nic_init(struct ipw_priv *priv) -+{ -+ u8 rev_id, sku_cap, card_ver; -+ u16 board_ver = 0; -+ int rc; -+ unsigned long flags; -+ -+ ipw_power_init_handle(priv); -+ ipw_rate_scale_init_handle(priv, IPW_RATE_SCALE_MAX_WINDOW); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ ipw_set_bit(priv, CSR_ANA_PLL_CFG, (1 << 24)); -+ ipw_set_bit(priv, CSR_GIO_CHICKEN_BITS, -+ CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX); -+ -+ ipw_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); -+ rc = ipw_poll_bit(priv, CSR_GP_CNTRL, -+ CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, -+ CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); -+ if (rc < 0) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ IPW_DEBUG_INFO("Failed to init the card\n"); -+ return rc; -+ } -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ ipw_write_restricted_reg(priv, ALM_APMG_CLK_EN, -+ APMG_CLK_REG_VAL_DMA_CLK_RQT | -+ APMG_CLK_REG_VAL_BSM_CLK_RQT); -+ udelay(20); -+ ipw_set_bits_restricted_reg(priv, ALM_APMG_PCIDEV_STT, -+ APMG_DEV_STATE_REG_VAL_L1_ACTIVE_DISABLE); -+ ipw_release_restricted_access(priv); -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ /* Determine HW type */ -+ rc = pci_read_config_byte(priv->pci_dev, PCI_REVISION_ID, &rev_id); -+ if (rc) -+ return rc; -+ IPW_DEBUG_INFO("HW Revision ID = 0x%X\n", rev_id); -+ -+ ipw_nic_set_pwr_src(priv, 1); -+ spin_lock_irqsave(&priv->lock, flags); -+ -+ if (rev_id & PCI_CFG_REV_ID_BIT_RTP) -+ IPW_DEBUG_INFO("RTP type \n"); -+ else if (rev_id & PCI_CFG_REV_ID_BIT_BASIC_SKU) { -+ IPW_DEBUG_INFO("ALM-MB type\n"); -+ ipw_set_bit(priv, CSR_HW_IF_CONFIG_REG, -+ CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB); -+ } else { -+ IPW_DEBUG_INFO("ALM-MM type\n"); -+ ipw_set_bit(priv, CSR_HW_IF_CONFIG_REG, -+ CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM); -+ } -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+ /* Initialize the EEPROM */ -+ rc = ipw_eeprom_init_sram(priv); -+ if (rc) -+ return rc; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ ipw_query_eeprom(priv, EEPROM_SKU_CAP, sizeof(u8), &sku_cap); -+ if (EEPROM_SKU_CAP_OP_MODE_MRC == sku_cap) { -+ IPW_DEBUG_INFO("SKU OP mode is mrc\n"); -+ ipw_set_bit(priv, CSR_HW_IF_CONFIG_REG, -+ CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC); -+ } else { -+ IPW_DEBUG_INFO("SKU OP mode is basic\n"); -+ } -+ -+ ipw_query_eeprom(priv, EEPROM_BOARD_REVISION, sizeof(u16), -+ (u8 *) & board_ver); -+ if ((board_ver & 0xF0) == 0xD0) { -+ IPW_DEBUG_INFO("3945ABG revision is 0x%X\n", board_ver); -+ ipw_set_bit(priv, CSR_HW_IF_CONFIG_REG, -+ CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE); -+ } else { -+ IPW_DEBUG_INFO("3945ABG revision is 0x%X\n", board_ver); -+ ipw_clear_bit(priv, CSR_HW_IF_CONFIG_REG, -+ CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE); -+ } -+ -+ ipw_query_eeprom(priv, EEPROM_ALMGOR_M_VERSION, sizeof(u8), -+ (u8 *) & card_ver); -+ if (card_ver <= 1) { -+ ipw_set_bit(priv, CSR_HW_IF_CONFIG_REG, -+ CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A); -+ IPW_DEBUG_INFO("Card M type A version is 0x%X\n", card_ver); -+ } else { -+ IPW_DEBUG_INFO("Card M type B version is 0x%X\n", card_ver); -+ ipw_set_bit(priv, CSR_HW_IF_CONFIG_REG, -+ CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B); -+ } -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ /* Allocate the RX queue, or reset if it is already allocated */ -+ if (!priv->rxq) -+ priv->rxq = ipw_rx_queue_alloc(priv); -+ else -+ ipw_rx_queue_reset(priv, priv->rxq); -+ -+ if (!priv->rxq) { -+ IPW_ERROR("Unable to initialize Rx queue\n"); -+ return -ENOMEM; -+ } -+ ipw_rx_queue_replenish(priv); -+ -+ ipw_rx_init(priv, priv->rxq); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ ipw_write_restricted(priv, FH_RCSR_WPTR(0), priv->rxq->write & ~7); -+ ipw_release_restricted_access(priv); -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ rc = ipw_queue_reset(priv); -+ if (rc) -+ return rc; -+ -+ rc = ipw_rf_eeprom_ready(priv); -+ if (rc) -+ return rc; -+ -+ priv->status |= STATUS_INIT; -+ -+ return 0; -+} -+ -+/* Call this function from process context, it will sleeps */ -+static int ipw_nic_reset(struct ipw_priv *priv) -+{ -+ int rc = 0; -+ unsigned long flags; -+ -+ ipw_nic_stop_master(priv); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ ipw_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); -+ -+ rc = ipw_poll_bit(priv, CSR_GP_CNTRL, -+ CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, -+ CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ -+ ipw_write_restricted_reg(priv, APMG_CLK_CTRL_REG, -+ APMG_CLK_REG_VAL_BSM_CLK_RQT); -+ -+ udelay(10); -+ -+ ipw_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); -+ -+ ipw_write_restricted_reg(priv, ALM_APMG_LARC_INT_MSK, 0x0); -+ ipw_write_restricted_reg(priv, ALM_APMG_LARC_INT, 0xFFFFFFFF); -+ -+ /* enable DMA */ -+ ipw_write_restricted_reg(priv, ALM_APMG_CLK_EN, -+ APMG_CLK_REG_VAL_DMA_CLK_RQT | -+ APMG_CLK_REG_VAL_BSM_CLK_RQT); -+ udelay(10); -+ -+ ipw_set_bits_restricted_reg(priv, ALM_APMG_PS_CTL, -+ APMG_PS_CTRL_REG_VAL_ALM_R_RESET_REQ); -+ udelay(5); -+ ipw_clear_bits_restricted_reg(priv, ALM_APMG_PS_CTL, -+ APMG_PS_CTRL_REG_VAL_ALM_R_RESET_REQ); -+ ipw_release_restricted_access(priv); -+ -+ /* Clear the 'host command active' bit... */ -+ priv->status &= ~STATUS_HCMD_ACTIVE; -+ -+ wake_up_interruptible(&priv->wait_command_queue); -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ return rc; -+} -+ -+/********************* UCODE-DOWNLOAD-FUNCTIONS ***********************/ -+static int ipw_get_fw(struct ipw_priv *priv, -+ const struct firmware **fw, const char *name) -+{ -+ int rc; -+ -+ /* ask firmware_class module to get the boot firmware off disk */ -+ rc = request_firmware(fw, name, &priv->pci_dev->dev); -+ if (rc < 0) { -+ IPW_ERROR("%s load failed: Reason %d\n", name, rc); -+ return rc; -+ } -+ -+ IPW_DEBUG_INFO("Loading firmware '%s' file (%zd bytes)\n", -+ name, (*fw)->size); -+ return 0; -+} -+ -+static int ipw_download_ucode_base(struct ipw_priv *priv, u8 * image, u32 len) -+{ -+ u32 reg; -+ u32 val; -+ int rc; -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) -+ return rc; -+ -+ ipw_write_restricted_reg_buffer(priv, BSM_SRAM_LOWER_BOUND, len, image); -+ ipw_write_restricted_reg(priv, BSM_WR_MEM_SRC_REG, 0x0); -+ ipw_write_restricted_reg(priv, BSM_WR_MEM_DST_REG, -+ RTC_INST_LOWER_BOUND); -+ ipw_write_restricted_reg(priv, BSM_WR_DWCOUNT_REG, len / sizeof(u32)); -+ ipw_write_restricted_reg(priv, BSM_WR_CTRL_REG, -+ BSM_WR_CTRL_REG_BIT_START_EN); -+ -+ val = ipw_read_restricted_reg(priv, BSM_WR_DWCOUNT_REG); -+ for (reg = BSM_SRAM_LOWER_BOUND; -+ reg < BSM_SRAM_LOWER_BOUND + len; -+ reg += sizeof(u32), image += sizeof(u32)) { -+ val = ipw_read_restricted_reg(priv, reg); -+ if (val != *(u32 *) image) { -+ IPW_ERROR("uCode verification failed at " -+ "addr 0x%08X+%u (of %u)\n", -+ BSM_SRAM_LOWER_BOUND, -+ reg - BSM_SRAM_LOWER_BOUND, len); -+ ipw_release_restricted_access(priv); -+ return -EIO; -+ } -+ } -+ -+ ipw_release_restricted_access(priv); -+ return 0; -+} -+ -+static int attach_buffer_to_tfd_frame(struct tfd_frame *tfd, -+ dma_addr_t addr, u16 len) -+{ -+ int count = 0; -+ u32 pad; -+ -+ count = TFD_CTL_COUNT_GET(tfd->control_flags); -+ pad = TFD_CTL_PAD_GET(tfd->control_flags); -+ -+ if ((count >= NUM_TFD_CHUNKS) || (count < 0)) { -+ IPW_ERROR("Error can not send more than %d chunks\n", -+ NUM_TFD_CHUNKS); -+ return -EINVAL; -+ } -+ -+ tfd->pa[count].addr = (u32) addr; -+ tfd->pa[count].len = len; -+ -+ count++; -+ -+ tfd->control_flags = TFD_CTL_COUNT_SET(count) | TFD_CTL_PAD_SET(pad); -+ -+ return 0; -+} -+ -+static int ipw_verify_ucode(struct ipw_priv *priv) -+{ -+ u32 *image; -+ u32 len, val; -+ int rc; -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) -+ return rc; -+ -+ ipw_write_restricted(priv, HBUS_TARG_MEM_RADDR, RTC_DATA_LOWER_BOUND); -+ -+ for (image = priv->ucode_data.v_addr, len = -+ priv->ucode_data.len; len > 0; len -= sizeof(u32), image++) { -+ val = ipw_read_restricted(priv, HBUS_TARG_MEM_RDAT); -+ if (val != *image) { -+ IPW_ERROR("uCode INST section is invalid at " -+ "offset %u\n", len); -+ rc = -EIO; -+ goto done; -+ } -+ } -+ -+ ipw_write_restricted(priv, HBUS_TARG_MEM_RADDR, RTC_INST_LOWER_BOUND); -+ -+ for (image = priv->ucode_code.v_addr, len = -+ priv->ucode_code.len; len > 0; len -= sizeof(u32), image++) { -+ val = ipw_read_restricted(priv, HBUS_TARG_MEM_RDAT); -+ if (val != *image) { -+ IPW_ERROR("uCode INST section is invalid at " -+ "offset %u\n", len); -+ rc = -EIO; -+ goto done; -+ } -+ } -+ -+ IPW_DEBUG_INFO("ucode image is good\n"); -+ -+ done: -+ ipw_release_restricted_access(priv); -+ return rc; -+} -+ -+static int ipw_download_ucode(struct ipw_priv *priv, -+ struct fw_image_desc *desc, -+ u32 mem_size, dma_addr_t dst_addr) -+{ -+ dma_addr_t phy_addr = 0; -+ u32 len = 0; -+ u32 count = 0; -+ u32 pad; -+ struct tfd_frame tfd; -+ u32 tx_config = 0; -+ int rc; -+ -+ memset(&tfd, 0, sizeof(struct tfd_frame)); -+ -+ phy_addr = desc->p_addr; -+ len = desc->len; -+ -+ if (mem_size < len) { -+ IPW_ERROR("invalid image size, too big %d %d\n", mem_size, len); -+ return -EINVAL; -+ } -+ -+ while (len > 0) { -+ if (ALM_TB_MAX_BYTES_COUNT < len) { -+ attach_buffer_to_tfd_frame(&tfd, phy_addr, -+ ALM_TB_MAX_BYTES_COUNT); -+ len -= ALM_TB_MAX_BYTES_COUNT; -+ phy_addr += ALM_TB_MAX_BYTES_COUNT; -+ } else { -+ attach_buffer_to_tfd_frame(&tfd, phy_addr, len); -+ break; -+ } -+ } -+ -+ pad = U32_PAD(len); -+ count = TFD_CTL_COUNT_GET(tfd.control_flags); -+ tfd.control_flags = TFD_CTL_COUNT_SET(count) | TFD_CTL_PAD_SET(pad); -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) -+ return rc; -+ -+ ipw_write_restricted(priv, FH_TCSR_CONFIG(ALM_FH_SRVC_CHNL), -+ ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE); -+ ipw_write_buffer_restricted(priv, -+ ALM_FH_TFDB_CHNL_BUF_CTRL_REG -+ (ALM_FH_SRVC_CHNL), -+ sizeof(struct tfd_frame), (u32 *) & tfd); -+ ipw_write_restricted(priv, HBUS_TARG_MEM_WADDR, dst_addr); -+ ipw_write_restricted(priv, FH_TCSR_CREDIT(ALM_FH_SRVC_CHNL), -+ 0x000FFFFF); -+ ipw_write_restricted(priv, -+ FH_TCSR_BUFF_STTS(ALM_FH_SRVC_CHNL), -+ ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID -+ | ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_BIT_TFDB_WPTR); -+ -+ tx_config = ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE | -+ ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL | -+ ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_DRIVER; -+ -+ ipw_write_restricted(priv, FH_TCSR_CONFIG(ALM_FH_SRVC_CHNL), tx_config); -+ -+ rc = ipw_poll_restricted_bit(priv, FH_TSSR_TX_STATUS, -+ ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE -+ (ALM_FH_SRVC_CHNL), 1000); -+ if (rc < 0) { -+ IPW_WARNING("3945ABG card ucode DOWNLOAD FAILED \n"); -+ goto done; -+ } -+ -+ rc = 0; -+ -+ IPW_DEBUG_INFO("3945ABG card ucode download is good \n"); -+ -+ ipw_write_restricted(priv, FH_TCSR_CREDIT(ALM_FH_SRVC_CHNL), 0x0); -+ -+ done: -+ ipw_release_restricted_access(priv); -+ return rc; -+} -+ -+static int ipw_copy_ucode_images(struct ipw_priv *priv, -+ u8 * image_code, -+ size_t image_len_code, -+ u8 * image_data, size_t image_len_data) -+{ -+ int rc; -+ -+ if ((image_len_code > priv->ucode_code.actual_len) || -+ (image_len_data > priv->ucode_data.actual_len)) { -+ IPW_DEBUG_INFO("uCode size is too large to fit\n"); -+ return -EINVAL; -+ } -+ -+ memcpy(priv->ucode_code.v_addr, image_code, image_len_code); -+ priv->ucode_code.len = (u32) image_len_code; -+ memcpy(priv->ucode_data.v_addr, image_data, image_len_data); -+ priv->ucode_data.len = (u32) image_len_data; -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) -+ return rc; -+ -+ ipw_write_restricted_reg(priv, BSM_DRAM_INST_PTR_REG, -+ priv->ucode_code.p_addr); -+ ipw_write_restricted_reg(priv, BSM_DRAM_DATA_PTR_REG, -+ priv->ucode_data.p_addr); -+ ipw_write_restricted_reg(priv, BSM_DRAM_INST_BYTECOUNT_REG, -+ priv->ucode_code.len); -+ ipw_write_restricted_reg(priv, BSM_DRAM_DATA_BYTECOUNT_REG, -+ priv->ucode_data.len); -+ ipw_release_restricted_access(priv); -+ -+ return 0; -+} -+ -+struct ipw_ucode { -+ u32 ver; -+ u32 inst_size; -+ u32 data_size; -+ u32 boot_size; -+ u8 data[0]; -+}; -+ -+static int ipw_read_ucode(struct ipw_priv *priv) -+{ -+ struct ipw_ucode *ucode; -+ int rc = 0; -+ -+ if (!priv->ucode_raw) { -+ rc = ipw_get_fw(priv, &priv->ucode_raw, "ipw3945.ucode"); -+ if (rc) -+ goto error; -+ } -+ -+ if (priv->ucode_raw->size < sizeof(*ucode)) { -+ rc = -EINVAL; -+ goto error; -+ } -+ -+ ucode = (void *)priv->ucode_raw->data; -+ -+ if (priv->ucode_raw->size < sizeof(*ucode) + -+ ucode->boot_size + ucode->inst_size + ucode->data_size) { -+ rc = -EINVAL; -+ goto error; -+ } -+ -+ return 0; -+ -+ error: -+ if (priv->ucode_raw) { -+ release_firmware(priv->ucode_raw); -+ priv->ucode_raw = NULL; -+ } -+ -+ return rc; -+} -+ -+static int ipw_load_ucode(struct ipw_priv *priv) -+{ -+ struct ipw_ucode *ucode; -+ int rc = 0; -+ -+ BUG_ON(!priv->ucode_raw); -+ -+ ucode = (void *)priv->ucode_raw->data; -+ -+ rc = ipw_copy_ucode_images(priv, &ucode->data[0], -+ ucode->inst_size, -+ &ucode->data[ucode->inst_size], -+ ucode->data_size); -+ if (rc) -+ goto error; -+ -+ rc = ipw_download_ucode_base(priv, -+ &ucode->data[ucode->inst_size + -+ ucode->data_size], -+ ucode->boot_size); -+ if (rc) -+ goto error; -+ -+ rc = ipw_download_ucode(priv, &(priv->ucode_code), -+ ALM_RTC_INST_SIZE, RTC_INST_LOWER_BOUND); -+ if (rc) -+ goto error; -+ -+ rc = ipw_download_ucode(priv, &(priv->ucode_data), -+ ALM_RTC_DATA_SIZE, RTC_DATA_LOWER_BOUND); -+ if (rc) -+ goto error; -+ -+ return 0; -+ -+ error: -+ return rc; -+} -+ -+/*************** DMA-QUEUE-GENERAL-FUNCTIONS *****/ -+/** -+ * DMA services -+ * -+ * Theory of operation -+ * -+ * A queue is a circular buffers with 'Read' and 'Write' pointers. -+ * 2 empty entries always kept in the buffer to protect from overflow. -+ * -+ * For Tx queue, there are low mark and high mark limits. If, after queuing -+ * the packet for Tx, free space become < low mark, Tx queue stopped. When -+ * reclaiming packets (on 'tx done IRQ), if free space become > high mark, -+ * Tx queue resumed. -+ * -+ * The IPW operates with six queues, one receive queue in the device's -+ * sram, one transmit queue for sending commands to the device firmware, -+ * and four transmit queues for data. -+ * -+ * The four transmit queues allow for performing quality of service (qos) -+ * transmissions as per the 802.11 protocol. Currently Linux does not -+ * provide a mechanism to the user for utilizing prioritized queues, so -+ * we only utilize the first data transmit queue (queue1). -+ */ -+ -+/** -+ * Driver allocates buffers of this size for Rx -+ */ -+ -+static inline int ipw_queue_space(const struct ipw_queue *q) -+{ -+ int s = q->last_used - q->first_empty; -+ if (q->last_used > q->first_empty) -+ s -= q->n_bd; -+ -+ if (s <= 0) -+ s += q->n_window; -+ s -= 2; /* keep some reserve to not confuse empty and full situations */ -+ if (s < 0) -+ s = 0; -+ return s; -+} -+ -+static inline int ipw_queue_inc_wrap(int index, int n_bd) -+{ -+ return (++index == n_bd) ? 0 : index; -+} -+ -+static inline int x2_queue_used(const struct ipw_queue *q, int i) -+{ -+ return q->first_empty > q->last_used ? -+ (i >= q->last_used && i < q->first_empty) : -+ !(i < q->last_used && i >= q->first_empty); -+} -+ -+static inline u8 get_next_cmd_index(struct ipw_queue *q, u32 index, int is_huge) -+{ -+ if (is_huge) -+ return q->n_window; -+ -+ return (u8) (index % q->n_window); -+} -+ -+/***************** END **************************/ -+ -+/********************* TX-QUEUE-FUNCTIONS ******************/ -+static int ipw_stop_tx_queue(struct ipw_priv *priv) -+{ -+ int queueId; -+ int rc; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ -+ /* stop SCD */ -+ ipw_write_restricted_reg(priv, SCD_MODE_REG, 0); -+ -+ /* reset TFD queues */ -+ for (queueId = TFD_QUEUE_MIN; queueId < TFD_QUEUE_MAX; queueId++) { -+ ipw_write_restricted(priv, FH_TCSR_CONFIG(queueId), 0x0); -+ ipw_poll_restricted_bit(priv, FH_TSSR_TX_STATUS, -+ ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE -+ (queueId), 1000); -+ } -+ -+ ipw_release_restricted_access(priv); -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ return 0; -+} -+ -+/** -+ * Initialize common DMA queue structure -+ * -+ * @param q queue to init -+ * @param count Number of BD's to allocate. Should be power of 2 -+ * @param read_register Address for 'read' register -+ * (not offset within BAR, full address) -+ * @param write_restrictedister Address for 'write' register -+ * (not offset within BAR, full address) -+ * @param base_register Address for 'base' register -+ * (not offset within BAR, full address) -+ * @param size Address for 'size' register -+ * (not offset within BAR, full address) -+ */ -+ -+static int ipw_tx_reset(struct ipw_priv *priv) -+{ -+ int rc; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ -+ ipw_write_restricted_reg(priv, SCD_MODE_REG, 0x2); // bypass mode -+ ipw_write_restricted_reg(priv, SCD_ARASTAT_REG, 0x01); // RA 0 is active -+ ipw_write_restricted_reg(priv, SCD_TXFACT_REG, 0x3f); // all 6 fifo are active -+ ipw_write_restricted_reg(priv, SCD_SBYP_MODE_1_REG, 0x010000); -+ ipw_write_restricted_reg(priv, SCD_SBYP_MODE_2_REG, 0x030002); -+ ipw_write_restricted_reg(priv, SCD_TXF4MF_REG, 0x000004); -+ ipw_write_restricted_reg(priv, SCD_TXF5MF_REG, 0x000005); -+ -+ ipw_write_restricted(priv, FH_TSSR_CBB_BASE, priv->shared_phys); -+ -+ ipw_write_restricted(priv, -+ FH_TSSR_MSG_CONFIG, -+ ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON -+ | -+ ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON -+ | -+ ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B -+ | -+ ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON -+ | -+ ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON -+ | -+ ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH -+ | ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH); -+ -+ ipw_release_restricted_access(priv); -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ return 0; -+} -+ -+static int ipw_queue_init(struct ipw_priv *priv, struct ipw_queue *q, -+ int count, int size, u32 id) -+{ -+ int rc; -+ unsigned long flags; -+ -+ q->n_bd = count; -+ q->n_window = size; -+ q->id = id; -+ -+ q->low_mark = q->n_window / 4; -+ if (q->low_mark < 4) -+ q->low_mark = 4; -+ -+ q->high_mark = q->n_window / 8; -+ if (q->high_mark < 2) -+ q->high_mark = 2; -+ -+ q->first_empty = q->last_used = 0; -+ priv->shared_virt->tx_base_ptr[id] = (u32) q->dma_addr; -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) { -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return rc; -+ } -+ ipw_write_restricted(priv, FH_CBCC_CTRL(id), 0); -+ ipw_write_restricted(priv, FH_CBCC_BASE(id), 0); -+ -+ ipw_write_restricted(priv, FH_TCSR_CONFIG(id), -+ ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT -+ | -+ ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF -+ | -+ ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD -+ | -+ ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL -+ | ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE); -+ ipw_release_restricted_access(priv); -+ -+ ipw_read32(priv, FH_TSSR_CBB_BASE); /* fake read to flush all prev. writes */ -+ -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return 0; -+} -+ -+static int ipw_queue_tx_init(struct ipw_priv *priv, -+ struct ipw_tx_queue *q, int count, u32 id) -+{ -+ struct pci_dev *dev = priv->pci_dev; -+ int len; -+ -+ q->txb = kmalloc(sizeof(q->txb[0]) * TFD_QUEUE_SIZE_MAX, GFP_ATOMIC); -+ if (!q->txb) { -+ IPW_ERROR("kmalloc for auxilary BD structures failed\n"); -+ return -ENOMEM; -+ } -+ -+ q->bd = -+ pci_alloc_consistent(dev, -+ sizeof(q->bd[0]) * -+ TFD_QUEUE_SIZE_MAX, &q->q.dma_addr); -+ if (!q->bd) { -+ IPW_ERROR("pci_alloc_consistent(%zd) failed\n", -+ sizeof(q->bd[0]) * count); -+ kfree(q->txb); -+ q->txb = NULL; -+ return -ENOMEM; -+ } -+ -+ /* alocate command space + one big command for scan since scan -+ * command is very huge the system will not have two scan at the -+ * same time */ -+ len = (sizeof(struct ipw_cmd) * count) + DAEMON_MAX_SCAN_SIZE; -+ q->cmd = pci_alloc_consistent(dev, len, &q->dma_addr_cmd); -+ if (!q->cmd) { -+ IPW_ERROR("pci_alloc_consistent(%zd) failed\n", -+ sizeof(q->cmd[0]) * count); -+ kfree(q->txb); -+ q->txb = NULL; -+ -+ pci_free_consistent(dev, -+ sizeof(q->bd[0]) * -+ TFD_QUEUE_SIZE_MAX, q->bd, q->q.dma_addr); -+ -+ return -ENOMEM; -+ } -+ -+ q->need_update = 0; -+ ipw_queue_init(priv, &q->q, TFD_QUEUE_SIZE_MAX, count, id); -+ return 0; -+} -+ -+/** -+ * Free one TFD, those at index [txq->q.last_used]. -+ * Do NOT advance any indexes -+ */ -+static void ipw_queue_tx_free_tfd(struct ipw_priv *priv, -+ struct ipw_tx_queue *txq) -+{ -+ struct tfd_frame *bd = &txq->bd[txq->q.last_used]; -+ struct pci_dev *dev = priv->pci_dev; -+ int i; -+ int counter = 0; -+ /* classify bd */ -+ if (txq->q.id == CMD_QUEUE_NUM) -+ /* nothing to cleanup after for host commands */ -+ return; -+ -+ /* sanity check */ -+ counter = TFD_CTL_COUNT_GET(le32_to_cpu(bd->control_flags)); -+ if (counter > NUM_TFD_CHUNKS) { -+ IPW_ERROR("Too many chunks: %i\n", counter); -+ /** @todo issue fatal error, it is quite serious situation */ -+ return; -+ } -+ -+ /* unmap chunks if any */ -+ -+ for (i = 1; i < counter; i++) { -+ pci_unmap_single(dev, le32_to_cpu(bd->pa[i].addr), -+ le16_to_cpu(bd->pa[i].len), PCI_DMA_TODEVICE); -+ if (txq->txb[txq->q.last_used]) { -+ struct sk_buff *skb = -+ txq->txb[txq->q.last_used]->fragments[0]; -+ struct ieee80211_hdr *hdr = (void *)skb->data; -+ priv->tx_bytes += skb->len - -+ ieee80211_get_hdrlen(hdr->frame_ctl); -+ ieee80211_txb_free(txq->txb[txq->q.last_used]); -+ txq->txb[txq->q.last_used] = NULL; -+ } -+ } -+} -+ -+/** -+ * Deallocate DMA queue. -+ * -+ * Empty queue by removing and destroying all BD's. -+ * Free all buffers. -+ * -+ * @param dev -+ * @param q -+ */ -+static void ipw_queue_tx_free(struct ipw_priv *priv, struct ipw_tx_queue *txq) -+{ -+ struct ipw_queue *q = &txq->q; -+ struct pci_dev *dev = priv->pci_dev; -+ int len; -+ -+ if (q->n_bd == 0) -+ return; -+ /* first, empty all BD's */ -+ for (; q->first_empty != q->last_used; -+ q->last_used = ipw_queue_inc_wrap(q->last_used, q->n_bd)) { -+ ipw_queue_tx_free_tfd(priv, txq); -+ } -+ -+ len = (sizeof(txq->cmd[0]) * q->n_window) + DAEMON_MAX_SCAN_SIZE; -+ pci_free_consistent(dev, len, txq->cmd, txq->dma_addr_cmd); -+ -+ /* free buffers belonging to queue itself */ -+ pci_free_consistent(dev, sizeof(txq->bd[0]) * q->n_bd, -+ txq->bd, q->dma_addr); -+ -+ kfree(txq->txb); -+ -+ /* 0 fill whole structure */ -+ memset(txq, 0, sizeof(*txq)); -+} -+ -+/** -+ * Destroy all DMA queues and structures -+ * -+ * @param priv -+ */ -+static void ipw_tx_queue_free(struct ipw_priv *priv) -+{ -+ -+ /* Tx queues */ -+ ipw_queue_tx_free(priv, &priv->txq[0]); -+ ipw_queue_tx_free(priv, &priv->txq[1]); -+ ipw_queue_tx_free(priv, &priv->txq[2]); -+ ipw_queue_tx_free(priv, &priv->txq[3]); -+ ipw_queue_tx_free(priv, &priv->txq[4]); -+ ipw_queue_tx_free(priv, &priv->txq[5]); -+} -+ -+static int ipw_tx_queue_update_write_ptr(struct ipw_priv *priv, -+ struct ipw_tx_queue *txq, int tx_id) -+{ -+ u32 reg = 0; -+ int rc = 0; -+ -+ if (txq->need_update == 0) -+ return rc; -+ -+ if (priv->status & STATUS_POWER_PMI) { -+ reg = ipw_read32(priv, CSR_UCODE_DRV_GP1); -+ -+ if (reg & CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP) { -+ ipw_set_bit(priv, CSR_GP_CNTRL, -+ CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); -+ return rc; -+ } -+ -+ rc = ipw_grab_restricted_access(priv); -+ if (rc) -+ return rc; -+ ipw_write_restricted(priv, HBUS_TARG_WRPTR, -+ txq->q.first_empty | (tx_id << 8)); -+ ipw_release_restricted_access(priv); -+ } else { -+ ipw_write32(priv, HBUS_TARG_WRPTR, -+ txq->q.first_empty | (tx_id << 8)); -+ } -+ -+ txq->need_update = 0; -+ -+ return rc; -+} -+ -+/** -+ * Destroys all DMA structures and initialise them again -+ * -+ * @param priv -+ * @return error code -+ */ -+static int ipw_queue_reset(struct ipw_priv *priv) -+{ -+ int rc = 0; -+ -+ ipw_tx_queue_free(priv); -+ -+ /* Tx CMD queue */ -+ ipw_tx_reset(priv); -+ -+ /* Tx queue(s) */ -+ rc = ipw_queue_tx_init(priv, &priv->txq[0], TFD_TX_CMD_SLOTS, 0); -+ if (rc) { -+ IPW_ERROR("Tx 0 queue init failed\n"); -+ goto error; -+ } -+ -+ rc = ipw_queue_tx_init(priv, &priv->txq[1], TFD_TX_CMD_SLOTS, 1); -+ if (rc) { -+ IPW_ERROR("Tx 1 queue init failed\n"); -+ goto error; -+ } -+ rc = ipw_queue_tx_init(priv, &priv->txq[2], TFD_TX_CMD_SLOTS, 2); -+ if (rc) { -+ IPW_ERROR("Tx 2 queue init failed\n"); -+ goto error; -+ } -+ rc = ipw_queue_tx_init(priv, &priv->txq[3], TFD_TX_CMD_SLOTS, 3); -+ if (rc) { -+ IPW_ERROR("Tx 3 queue init failed\n"); -+ goto error; -+ } -+ -+ rc = ipw_queue_tx_init(priv, &priv->txq[4], TFD_CMD_SLOTS, -+ CMD_QUEUE_NUM); -+ if (rc) { -+ IPW_ERROR("Tx Cmd queue init failed\n"); -+ goto error; -+ } -+ -+ rc = ipw_queue_tx_init(priv, &priv->txq[5], TFD_TX_CMD_SLOTS, 5); -+ if (rc) { -+ IPW_ERROR("Tx service queue init failed\n"); -+ goto error; -+ } -+ -+ return rc; -+ -+ error: -+ ipw_tx_queue_free(priv); -+ return rc; -+} -+ -+/**************************************************************/ -+ -+static inline void ipw_create_bssid(struct ipw_priv *priv, u8 * bssid) -+{ -+ /* First 3 bytes are manufacturer */ -+ bssid[0] = priv->mac_addr[0]; -+ bssid[1] = priv->mac_addr[1]; -+ bssid[2] = priv->mac_addr[2]; -+ -+ /* Last bytes are random */ -+ get_random_bytes(&bssid[3], ETH_ALEN - 3); -+ -+ bssid[0] &= 0xfe; /* clear multicast bit */ -+ bssid[0] |= 0x02; /* set local assignment bit (IEEE802) */ -+} -+ -+static inline int ipw_is_broadcast_ether_addr(const u8 * addr) -+{ -+ return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & -+ addr[5]) == 0xff; -+} -+ -+static u8 ipw_remove_station(struct ipw_priv *priv, u8 * bssid, int is_ap) -+{ -+ int index = IPW_INVALID_STATION; -+ int i; -+ -+ if (is_ap) { -+ index = AP_ID; -+ if ((priv->stations[index].used)) -+ priv->stations[index].used = 0; -+ } else if (ipw_is_broadcast_ether_addr(bssid)) { -+ index = BROADCAST_ID; -+ if ((priv->stations[index].used)) -+ priv->stations[index].used = 0; -+ } else { -+ for (i = STA_ID; i < (priv->num_stations + STA_ID); i++) { -+ if ((priv->stations[i].used) -+ && -+ (!memcmp -+ (priv->stations[i].sta.sta.MACAddr, -+ bssid, ETH_ALEN))) { -+ index = i; -+ priv->stations[index].used = 0; -+ break; -+ } -+ } -+ } -+ -+ if (index != IPW_INVALID_STATION) { -+ if (priv->num_stations > 0) -+ priv->num_stations--; -+ } -+ -+ return 0; -+} -+ -+static void ipw_delete_stations_table(struct ipw_priv *priv, u8 just_ibss) -+{ -+ -+ priv->num_stations = 0; -+ memset(priv->stations, 0, -+ NUM_OF_STATIONS * sizeof(struct ipw_station_entry)); -+} -+ -+static void ipw_clear_stations_table(struct ipw_priv *priv) -+{ -+ -+ priv->num_stations = 0; -+ memset(priv->stations, 0, -+ NUM_OF_STATIONS * sizeof(struct ipw_station_entry)); -+} -+ -+//todoG port to 3945 card -+static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid, -+ int is_ap, u8 flags) -+{ -+ int i = NUM_OF_STATIONS; -+ int index = IPW_INVALID_STATION; -+ -+ if (is_ap) { -+ index = AP_ID; -+ if ((priv->stations[index].used) && -+ (!memcmp -+ (priv->stations[index].sta.sta.MACAddr, bssid, ETH_ALEN))) -+ return index; -+ } else if (ipw_is_broadcast_ether_addr(bssid)) { -+ index = BROADCAST_ID; -+ if ((priv->stations[index].used) && -+ (!memcmp -+ (priv->stations[index].sta.sta.MACAddr, bssid, ETH_ALEN))) -+ return index; -+ } else -+ for (i = STA_ID; i < (priv->num_stations + STA_ID); i++) { -+ if ((priv->stations[i].used) -+ && -+ (!memcmp -+ (priv->stations[i].sta.sta.MACAddr, -+ bssid, ETH_ALEN))) { -+ /* Another node is active in network */ -+ priv->missed_adhoc_beacons = 0; -+ if (!(priv->config & CFG_STATIC_CHANNEL)) -+ /* when other nodes drop out, we drop out */ -+ priv->config &= ~CFG_ADHOC_PERSIST; -+ -+ return i; -+ } -+ -+ if ((priv->stations[i].used == 0) && -+ (index == IPW_INVALID_STATION)) -+ index = i; -+ } -+ -+ if (index != IPW_INVALID_STATION) -+ i = index; -+ -+ if (i == NUM_OF_STATIONS) -+ return IPW_INVALID_STATION; -+ -+ IPW_DEBUG_ASSOC("Adding STA ID %d: " MAC_FMT "\n", i, MAC_ARG(bssid)); -+ -+ priv->stations[i].used = 1; -+ priv->stations[i].current_rate = R_54M; -+// if (priv-> -+ memset(&priv->stations[i].sta, 0, sizeof(struct ipw_addsta_cmd)); -+ memcpy(priv->stations[i].sta.sta.MACAddr, bssid, ETH_ALEN); -+ priv->stations[i].sta.ctrlAddModify = 0; -+ priv->stations[i].sta.sta.staID = i; -+ priv->stations[i].sta.station_flags = 0; -+ -+ //todoG do we need this -+// priv->stations[i].sta.tid_disable_tx = 0xffff; /* all TID's disabled */ -+ if (priv->rxon.flags & RXON_FLG_BAND_24G_MSK) -+ priv->stations[i].sta.tx_rate = R_1M; -+ else -+ priv->stations[i].sta.tx_rate = R_6M; -+ -+ priv->stations[i].current_rate = priv->stations[i].sta.tx_rate; -+ -+ priv->num_stations++; -+ ipw_send_add_station(priv, &priv->stations[i].sta, flags); -+ return i; -+} -+ -+static u8 ipw_find_station(struct ipw_priv *priv, u8 * bssid) -+{ -+ int i; -+ int start = 0; -+ -+ if (priv->ieee->iw_mode == IW_MODE_ADHOC) -+ start = STA_ID; -+ -+ if (ipw_is_broadcast_ether_addr(bssid)) -+ return BROADCAST_ID; -+ -+ for (i = start; i < (start + priv->num_stations); i++) -+ if ((priv->stations[i].used) && -+ (!memcmp -+ (priv->stations[i].sta.sta.MACAddr, bssid, ETH_ALEN))) -+ return i; -+ -+ IPW_DEBUG_ASSOC("can not find STA " MAC_FMT "total %d\n", -+ MAC_ARG(bssid), priv->num_stations); -+ -+ return IPW_INVALID_STATION; -+} -+ -+static void ipw_remove_all_sta(struct ipw_priv *priv) -+{ -+ int i; -+ for (i = 0; i < NUM_OF_STATIONS; i++) -+ priv->stations[i].used = 0; -+} -+ -+static u8 ipw_sync_station(struct ipw_priv *priv, int sta_id, -+ u8 tx_rate, u8 flags) -+{ -+ -+ if (sta_id != IPW_INVALID_STATION) { -+ priv->stations[sta_id].sta.sta.modify_mask = -+ STA_CONTROL_MODIFY_MSK; -+ priv->stations[sta_id].sta.tx_rate = tx_rate; -+ priv->stations[sta_id].current_rate = tx_rate; -+ priv->stations[sta_id].sta.ctrlAddModify = -+ STA_CONTROL_MODIFY_MSK; -+ ipw_send_add_station(priv, &priv->stations[sta_id].sta, flags); -+ IPW_DEBUG_RATE("SCALE sync station %d to rate %d\n", -+ sta_id, tx_rate); -+ return sta_id; -+ } -+ -+ return IPW_INVALID_STATION; -+} -+ -+static void ipw_send_disassociate(struct ipw_priv *priv, int quiet) -+{ -+ int err; -+ -+ if (!(priv->status & (STATUS_ASSOCIATING | STATUS_ASSOCIATED))) { -+ IPW_DEBUG_ASSOC("Disassociating while not associated.\n"); -+ return; -+ } -+ -+ IPW_DEBUG_ASSOC("Disassociation 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 -+ priv->assoc_request.assoc_type = HC_DISASSOCIATE; -+ -+ priv->rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; -+ -+ priv->rxon.flags &= ~(RXON_FLG_TGG_PROTECT_MSK | -+ RXON_FLG_SHORT_PREAMBLE_MSK); -+ if (priv->rxon.flags & RXON_FLG_BAND_24G_MSK) -+ priv->rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; -+ -+ err = ipw_rxon_call(priv, 0); -+ -+ priv->status &= ~STATUS_DISASSOCIATING; -+ -+ priv->status &= ~(STATUS_DISASSOCIATING | STATUS_ASSOCIATING | -+ STATUS_ASSOCIATED | STATUS_AUTH); -+ -+ if (priv->assoc_request.capability & WLAN_CAPABILITY_IBSS) -+ ipw_remove_current_network(priv); -+ -+ ipw_clear_stations_table(priv); -+ -+ priv->auth_state = CMAS_INIT; -+ if (!(priv->status & STATUS_EXIT_PENDING)) -+ queue_work(priv->workqueue, &priv->link_down); -+ -+ if (err) { -+ IPW_DEBUG_HC("Attempt to send [dis]associate command " -+ "failed.\n"); -+ return; -+ } -+} -+ -+static int ipw_disassociate(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ cancel_delayed_work(&priv->associate_timeout); -+ -+ if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) -+ return 0; -+ -+ priv->auth_state = CMAS_INIT; -+ -+ ipw_send_disassociate(data, 0); -+ -+ if (priv->ieee->wpa_ie_len) { -+ kfree(priv->ieee->wpa_ie); -+ priv->ieee->wpa_ie = NULL; -+ priv->ieee->wpa_ie_len = 0; -+ } -+ -+ if (priv->ieee->iw_mode == IW_MODE_INFRA) -+ del_timer_sync(&priv->roaming_wdt); -+ -+ del_timer_sync(&priv->disassociate_wdt); -+ -+ /* re-add the broadcast STA so we can do active scans successfully */ -+ ipw_rxon_add_station(priv, BROADCAST_ADDR, 0); -+ -+ return 1; -+} -+ -+static void ipw_bg_disassociate(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_disassociate(data); -+ mutex_unlock(&priv->mutex); -+} -+ -+struct ipw_status_code { -+ u16 status; -+ const char *reason; -+}; -+static const struct ipw_status_code ipw_status_codes[] = { -+ { -+ 0x00, "Successful"}, { -+ 0x01, "Unspecified failure"}, { -+ 0x0A, -+ "Cannot support all requested capabilities in the " -+ "Capability information field"}, -+ { -+ 0x0B, -+ "Reassociation denied due to inability to confirm that " -+ "association exists"}, { -+ 0x0C, -+ "Association denied due to reason outside the scope of this " -+ "standard"}, { -+ 0x0D, -+ "Responding station does not support the specified authentication " -+ "algorithm"}, { -+ 0x0E, -+ "Received an Authentication frame with authentication sequence " -+ "transaction sequence number out of expected sequence"}, -+ { -+ 0x0F, -+ "Authentication rejected because of challenge failure"}, { -+ 0x10, -+ "Authentication rejected due to timeout waiting for next " -+ "frame in sequence"}, -+ { -+ 0x11, -+ "Association denied because AP is unable to handle additional " -+ "associated stations"}, { -+ 0x12, -+ "Association denied due to requesting station not supporting all " -+ "of the datarates in the BSSBasicServiceSet Parameter"}, -+ { -+ 0x13, -+ "Association denied due to requesting station not supporting " -+ "short preamble operation"}, { -+ 0x14, -+ "Association denied due to requesting station not supporting " -+ "PBCC encoding"}, { -+ 0x15, -+ "Association denied due to requesting station not supporting " -+ "channel agility"}, -+ { -+ 0x19, -+ "Association denied due to requesting station not supporting " -+ "short slot operation"}, -+ { -+ 0x1A, -+ "Association denied due to requesting station not supporting " -+ "DSSS-OFDM operation"}, { -+ 0x28, -+ "Invalid Information Element"}, { -+ 0x29, -+ "Group Cipher is not valid"}, -+ { -+ 0x2A, "Pairwise Cipher is not valid"}, { -+ 0x2B, -+ "AKMP is not valid"}, -+ { -+ 0x2C, -+ "Unsupported RSN IE version"}, -+ { -+ 0x2D, "Invalid RSN IE Capabilities"}, { -+ 0x2E, -+ "Cipher suite is rejected per security policy"}, -+}; -+ -+#ifdef CONFIG_IPW3945_DEBUG -+static const char *ipw_get_status_code(u16 status) -+{ -+ int i; -+ for (i = 0; i < ARRAY_SIZE(ipw_status_codes); i++) -+ if (ipw_status_codes[i].status == (status & 0xff)) -+ return ipw_status_codes[i].reason; -+ return "Unknown status value."; -+} -+#endif -+ -+static void inline average_init(struct average *avg) -+{ -+ memset(avg, 0, sizeof(*avg)); -+} -+ -+static void inline average_add(struct average *avg, s16 val) -+{ -+ avg->sum -= avg->entries[avg->pos]; -+ avg->sum += val; -+ avg->entries[avg->pos++] = val; -+ if (unlikely(avg->pos == AVG_ENTRIES)) { -+ avg->init = 1; -+ avg->pos = 0; -+ } -+} -+ -+static s16 inline average_value(struct average *avg) -+{ -+ if (!unlikely(avg->init)) { -+ if (avg->pos) -+ return avg->sum / avg->pos; -+ return 0; -+ } -+ -+ return avg->sum / AVG_ENTRIES; -+} -+ -+static void ipw_reset_stats(struct ipw_priv *priv) -+{ -+ priv->quality = 0; -+ average_init(&priv->average_missed_beacons); -+ average_init(&priv->average_rssi); -+ average_init(&priv->average_noise); -+ priv->last_rate = 0; -+ priv->last_missed_beacons = 0; -+ priv->last_rx_packets = 0; -+ priv->last_tx_packets = 0; -+ priv->last_tx_failures = 0; -+ /* Firmware managed, reset only when NIC is restarted, so we have to -+ * normalize on the current value */ -+ -+ /* TODO -- obtain the RX error and TX failure stats from HW */ -+ -+ /* Driver managed, reset with each association */ -+ priv->missed_adhoc_beacons = 0; -+ priv->missed_beacons = 0; -+ priv->tx_packets = 0; -+ priv->rx_packets = 0; -+} -+ -+static inline u32 ipw_get_max_rate(struct ipw_priv *priv) -+{ -+ u32 i = 0x80000000; -+ u32 mask = priv->rates_mask; -+ /* If currently associated in B mode, restrict the maximum -+ * rate match to B rates */ -+ if (priv->assoc_request.ieee_mode == IPW_B_MODE) -+ mask &= IEEE80211_CCK_RATES_MASK; -+ /* TODO: Verify that the rate is supported by the current rates -+ * list. */ -+ while (i && !(mask & i)) -+ i >>= 1; -+ switch (i) { -+ case IEEE80211_CCK_RATE_1MB_MASK: -+ return 1000000; -+ case IEEE80211_CCK_RATE_2MB_MASK: -+ return 2000000; -+ case IEEE80211_CCK_RATE_5MB_MASK: -+ return 5500000; -+ case IEEE80211_OFDM_RATE_6MB_MASK: -+ return 6000000; -+ case IEEE80211_OFDM_RATE_9MB_MASK: -+ return 9000000; -+ case IEEE80211_CCK_RATE_11MB_MASK: -+ return 11000000; -+ case IEEE80211_OFDM_RATE_12MB_MASK: -+ return 12000000; -+ case IEEE80211_OFDM_RATE_18MB_MASK: -+ return 18000000; -+ case IEEE80211_OFDM_RATE_24MB_MASK: -+ return 24000000; -+ case IEEE80211_OFDM_RATE_36MB_MASK: -+ return 36000000; -+ case IEEE80211_OFDM_RATE_48MB_MASK: -+ return 48000000; -+ case IEEE80211_OFDM_RATE_54MB_MASK: -+ return 54000000; -+ } -+ -+ if (priv->ieee->mode == IEEE_B) -+ return 11000000; -+ else -+ return 54000000; -+} -+ -+static u32 ipw_get_current_rate(struct ipw_priv *priv) -+{ -+ u32 rate; -+ -+ if (!(priv->status & STATUS_ASSOCIATED)) -+ return 0; -+ if (priv->ieee->iw_mode == IW_MODE_ADHOC) -+ rate = priv->stations[STA_ID].current_rate; -+ else -+ rate = priv->stations[AP_ID].current_rate; -+ -+ switch (rate) { -+ case IPW_TX_RATE_1MB: -+ return 1000000; -+ case IPW_TX_RATE_2MB: -+ return 2000000; -+ case IPW_TX_RATE_5MB: -+ return 5500000; -+ case IPW_TX_RATE_6MB: -+ return 6000000; -+ case IPW_TX_RATE_9MB: -+ return 9000000; -+ case IPW_TX_RATE_11MB: -+ return 11000000; -+ case IPW_TX_RATE_12MB: -+ return 12000000; -+ case IPW_TX_RATE_18MB: -+ return 18000000; -+ case IPW_TX_RATE_24MB: -+ return 24000000; -+ case IPW_TX_RATE_36MB: -+ return 36000000; -+ case IPW_TX_RATE_48MB: -+ return 48000000; -+ case IPW_TX_RATE_54MB: -+ return 54000000; -+ } -+ -+ return 0; -+} -+ -+#define IPW_STATS_INTERVAL (2 * HZ) -+static void ipw_gather_stats(struct ipw_priv *priv) -+{ -+ u32 rx_err = 0, rx_err_delta, rx_packets_delta; -+ u32 tx_failures = 0, tx_failures_delta, tx_packets_delta; -+ u32 missed_beacons_percent, missed_beacons_delta; -+ u32 quality = 0; -+ s16 rssi; -+ u32 beacon_quality, signal_quality, tx_quality, rx_quality, -+ rate_quality; -+ u32 max_rate; -+ -+ if (!(priv->status & STATUS_ASSOCIATED)) { -+ priv->quality = 0; -+ return; -+ } -+ -+ /* TODO -- gather missed beacon stats */ -+ missed_beacons_delta = priv->missed_beacons - priv->last_missed_beacons; -+ priv->last_missed_beacons = priv->missed_beacons; -+ if (priv->assoc_request.beacon_interval) { -+ missed_beacons_percent = -+ missed_beacons_delta * (HZ * -+ priv->assoc_request. -+ beacon_interval) / -+ (IPW_STATS_INTERVAL * 10); -+ } else { -+ missed_beacons_percent = 0; -+ } -+ average_add(&priv->average_missed_beacons, missed_beacons_percent); -+ -+ /* TODO -- gather RX ERROR stats */ -+ -+ rx_err_delta = rx_err - priv->last_rx_err; -+ priv->last_rx_err = rx_err; -+ -+ /* TODO -- gather TX failure stats */ -+ -+ tx_failures_delta = tx_failures - priv->last_tx_failures; -+ priv->last_tx_failures = tx_failures; -+ rx_packets_delta = priv->rx_packets - priv->last_rx_packets; -+ priv->last_rx_packets = priv->rx_packets; -+ tx_packets_delta = priv->tx_packets - priv->last_tx_packets; -+ priv->last_tx_packets = priv->tx_packets; -+ /* Calculate quality based on the following: -+ * -+ * Missed beacon: 100% = 0, 0% = 70% missed -+ * Rate: 60% = 1Mbs, 100% = Max -+ * Rx and Tx errors represent a straight % of total Rx/Tx -+ * RSSI: 100% = > -50, 0% = < -80 -+ * Rx errors: 100% = 0, 0% = 50% missed -+ * -+ * The lowest computed quality is used. -+ * -+ */ -+#define BEACON_THRESHOLD 5 -+ beacon_quality = 100 - missed_beacons_percent; -+ if (beacon_quality < BEACON_THRESHOLD) -+ beacon_quality = 0; -+ else -+ beacon_quality = -+ (beacon_quality - BEACON_THRESHOLD) * 100 / (100 - -+ BEACON_THRESHOLD); -+ IPW_DEBUG_STATS("Missed beacon: %3d%% (%d%%)\n", -+ beacon_quality, missed_beacons_percent); -+ priv->last_rate = ipw_get_current_rate(priv); -+ max_rate = ipw_get_max_rate(priv); -+ rate_quality = priv->last_rate * 40 / max_rate + 60; -+ IPW_DEBUG_STATS("Rate quality : %3d%% (%dMbs)\n", -+ rate_quality, priv->last_rate / 1000000); -+ if (rx_packets_delta > 100 && rx_packets_delta + rx_err_delta) -+ rx_quality = 100 - (rx_err_delta * 100) / -+ (rx_packets_delta + rx_err_delta); -+ else -+ rx_quality = 100; -+ IPW_DEBUG_STATS -+ ("Rx quality : %3d%% (%u errors, %u packets)\n", -+ rx_quality, rx_err_delta, rx_packets_delta); -+ if (tx_packets_delta > 100 && tx_packets_delta + tx_failures_delta) -+ tx_quality = -+ 100 - -+ (tx_failures_delta * 100) / (tx_packets_delta + -+ tx_failures_delta); -+ else -+ tx_quality = 100; -+ IPW_DEBUG_STATS -+ ("Tx quality : %3d%% (%u errors, %u packets)\n", -+ tx_quality, tx_failures_delta, tx_packets_delta); -+ rssi = average_value(&priv->average_rssi); -+ signal_quality = -+ (100 * -+ (priv->ieee->perfect_rssi - priv->ieee->worst_rssi) * -+ (priv->ieee->perfect_rssi - priv->ieee->worst_rssi) - -+ (priv->ieee->perfect_rssi - rssi) * -+ (15 * -+ (priv->ieee->perfect_rssi - priv->ieee->worst_rssi) + -+ 62 * (priv->ieee->perfect_rssi - -+ rssi))) / ((priv->ieee->perfect_rssi - -+ priv->ieee->worst_rssi) * -+ (priv->ieee->perfect_rssi - -+ priv->ieee->worst_rssi)); -+ if (signal_quality > 100) -+ signal_quality = 100; -+ else if (signal_quality < 1) -+ signal_quality = 0; -+ IPW_DEBUG_STATS("Signal level : %3d%% (%d dBm)\n", -+ signal_quality, rssi); -+ quality = min(beacon_quality, -+ min(rate_quality, -+ min(tx_quality, min(rx_quality, signal_quality)))); -+ if (quality == beacon_quality) -+ IPW_DEBUG_STATS -+ ("Quality (%d%%): Clamped to missed beacons.\n", quality); -+ if (quality == rate_quality) -+ IPW_DEBUG_STATS -+ ("Quality (%d%%): Clamped to rate quality.\n", quality); -+ if (quality == tx_quality) -+ IPW_DEBUG_STATS -+ ("Quality (%d%%): Clamped to Tx quality.\n", quality); -+ if (quality == rx_quality) -+ IPW_DEBUG_STATS -+ ("Quality (%d%%): Clamped to Rx quality.\n", quality); -+ if (quality == signal_quality) -+ IPW_DEBUG_STATS -+ ("Quality (%d%%): Clamped to signal quality.\n", quality); -+ priv->quality = quality; -+ queue_delayed_work(priv->workqueue, &priv->gather_stats, -+ IPW_STATS_INTERVAL); -+} -+ -+static void ipw_bg_gather_stats(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_gather_stats(data); -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_kickoff_roaming(unsigned long data) -+{ -+ struct ipw_priv *priv = (struct ipw_priv *)data; -+ -+ /* If the user changed the roaming enable/disable through -+ * sysfs while the roaming timer was configured, we just -+ * return when roaming disengages */ -+ if (priv->status & CFG_NO_ROAMING) -+ return; -+ -+ if (priv->status & STATUS_ROAMING) { -+ /* If we are currently roaming, then just -+ * print a debug statement... */ -+ IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, "roam in progress\n"); -+ return; -+ } -+ -+ /* If we are not already roaming, set the ROAM -+ * bit in the status and kick off a scan */ -+ IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, "initiate roaming\n"); -+ if (!(priv->status & STATUS_ROAMING)) { -+ priv->status |= STATUS_ROAMING; -+ if (!(priv->status & STATUS_SCANNING)) { -+ /* We only roam on the same band we are currently -+ * on */ -+ ipw_scan_initiate(priv, -+ priv->assoc_network->stats.freq, 0); -+ } -+ } -+ return; -+} -+ -+static void ipw_kickoff_disassociate(unsigned long data) -+{ -+ struct ipw_priv *priv = (struct ipw_priv *)data; -+ -+ if ((priv->ieee->iw_mode == IW_MODE_ADHOC) && -+ (priv->config & CFG_ADHOC_PERSIST)) -+ return; -+ -+ if (priv->status & STATUS_ASSOCIATED) { -+ /* If associated and we've hit the missed -+ * beacon threshold, disassociate, turn -+ * off roaming, and abort any active scans */ -+ IPW_DEBUG(IPW_DL_INFO | IPW_DL_NOTIF | IPW_DL_STATE, -+ "Missed beacon hits disassociate threshold\n"); -+ priv->status &= ~STATUS_ROAMING; -+ if (priv->status & STATUS_SCANNING) { -+ IPW_DEBUG(IPW_DL_INFO | IPW_DL_NOTIF | -+ IPW_DL_STATE, -+ "Aborting scan with missed beacon.\n"); -+ queue_work(priv->workqueue, &priv->abort_scan); -+ } -+ -+ queue_work(priv->workqueue, &priv->disassociate); -+ return; -+ } -+ -+ if (priv->status & STATUS_SCANNING) { -+ /* Stop scan to keep fw from getting -+ * stuck (only if we aren't roaming -- -+ * otherwise we'll never scan more than 2 or 3 -+ * channels..) */ -+ IPW_DEBUG(IPW_DL_INFO | IPW_DL_NOTIF | IPW_DL_STATE, -+ "Aborting scan with missed beacon.\n"); -+ queue_work(priv->workqueue, &priv->abort_scan); -+ } -+ return; -+} -+ -+static int ipw_queue_tx_hcmd(struct ipw_priv *priv, struct ipw_host_cmd *cmd) -+{ -+ struct ipw_tx_queue *txq = &priv->txq[CMD_QUEUE_NUM]; -+ struct ipw_queue *q = &txq->q; -+ struct tfd_frame *tfd; -+ struct ipw_cmd *out_cmd; -+ u32 idx = 0; -+ u16 fix_size = (u16) (cmd->meta.len + sizeof(out_cmd->hdr)); -+ int pad; -+ dma_addr_t phys_addr; -+ u8 fifo = CMD_QUEUE_NUM; -+ u16 count; -+ int rc; -+ -+ /* If any of the command structures end up being larger than -+ * the TFD_MAX_PAYLOAD_SIZE, and it sent as a 'small' command then -+ * we will need to increase the size of the TFD entries */ -+ BUG_ON((fix_size > TFD_MAX_PAYLOAD_SIZE) -+ && is_cmd_small(cmd)); -+ if (ipw_queue_space(q) < (is_cmd_sync(cmd) ? 1 : 2)) { -+ IPW_ERROR("No space for Tx\n"); -+ return -ENOSPC; -+ } -+ -+ tfd = &txq->bd[q->first_empty]; -+ memset(tfd, 0, sizeof(*tfd)); -+ -+ txq->txb[q->first_empty] = NULL; -+ -+ idx = get_next_cmd_index(q, q->first_empty, -+ cmd->meta.flags & CMD_SIZE_HUGE); -+ out_cmd = &txq->cmd[idx]; -+ -+ out_cmd->hdr.cmd = cmd->id; -+ memcpy(&out_cmd->meta, &cmd->meta, sizeof(cmd->meta)); -+ memcpy(&out_cmd->cmd.payload, cmd->data, cmd->meta.len); -+ -+ /* At this point, the out_cmd now has all of the incoming cmd -+ * information */ -+ -+ out_cmd->hdr.flags = 0; -+ out_cmd->hdr.sequence = FIFO_TO_SEQ(fifo) | -+ INDEX_TO_SEQ(q->first_empty); -+ if (out_cmd->meta.flags & CMD_SIZE_HUGE) -+ out_cmd->hdr.sequence |= SEQ_HUGE_FRAME; -+ -+ phys_addr = txq->dma_addr_cmd + sizeof(txq->cmd[0]) * idx + -+ offsetof(struct ipw_cmd, hdr); -+ attach_buffer_to_tfd_frame(tfd, phys_addr, fix_size); -+ -+ pad = U32_PAD(out_cmd->meta.len); -+ count = TFD_CTL_COUNT_GET(tfd->control_flags); -+ tfd->control_flags = TFD_CTL_COUNT_SET(count) | TFD_CTL_PAD_SET(pad); -+ -+/* IPW_DEBUG_TX("TFD %d - %d chunks for %d bytes (%d pad) at 0x%08X:\n", -+ q->first_empty, TFD_CTL_COUNT_GET(tfd->control_flags), -+ tfd->pa[0].len, TFD_CTL_PAD_GET(tfd->control_flags), -+ tfd->pa[0].addr); -+ printk_buf(IPW_DL_TX, (u8 *) tfd, sizeof(*tfd));*/ -+ -+ if (out_cmd->hdr.cmd != 0x23 && -+ out_cmd->hdr.cmd != 0x24 && out_cmd->hdr.cmd != 0x22) { -+ IPW_DEBUG_HC("Sending command %s (#%x), seq: 0x%04X, " -+ "%d bytes%s at %d[%d]:%d\n", -+ get_cmd_string(out_cmd->hdr.cmd), -+ out_cmd->hdr.cmd, out_cmd->hdr.sequence, -+ fix_size, -+ (out_cmd->meta. -+ flags & CMD_INDIRECT) ? "*" : "", -+ q->first_empty, idx, fifo); -+ } -+ -+ q->first_empty = ipw_queue_inc_wrap(q->first_empty, q->n_bd); -+ -+ txq->need_update = 1; -+ rc = ipw_tx_queue_update_write_ptr(priv, txq, CMD_QUEUE_NUM); -+ if (rc) -+ return rc; -+ -+ return 0; -+} -+ -+#define IEEE80211_RATE_INDEX_MASK (0xf) -+#define IEEE80211_RATE_MASKED (1 << 14) -+#define IEEE80211_RATE_INVALID (1 << 13) -+/* Given a modulation (OFDM or CCK), the rate (1,2,5,6,9,11,12,18,24,36,48,54) -+ * and a bit mask, verify that the rate is supported in that bitmask and return -+ * the rate with the IEEE80211_RATE_MASKED bit set or cleared as appropriate */ -+#define IEEE80211_RATE_IN_MASK(mod, rate, mask) \ -+ case IEEE80211_## mod ##_RATE_## rate ##MB: \ -+ return (mask & IEEE80211_## mod ##_RATE_## rate ##MB_MASK) ? \ -+ IEEE80211_## mod ##_RATE_## rate ##MB_INDEX : \ -+ (IEEE80211_RATE_MASKED | \ -+ IEEE80211_## mod ##_RATE_## rate ##MB_INDEX) -+ -+static u16 ipw_is_rate_in_mask(struct ipw_priv *priv, u8 rate, u16 mask) -+{ -+ rate &= ~IEEE80211_BASIC_RATE_MASK; -+ -+ switch (rate) { -+ IEEE80211_RATE_IN_MASK(OFDM, 6, mask); -+ IEEE80211_RATE_IN_MASK(OFDM, 9, mask); -+ IEEE80211_RATE_IN_MASK(OFDM, 12, mask); -+ IEEE80211_RATE_IN_MASK(OFDM, 18, mask); -+ IEEE80211_RATE_IN_MASK(OFDM, 24, mask); -+ IEEE80211_RATE_IN_MASK(OFDM, 36, mask); -+ IEEE80211_RATE_IN_MASK(OFDM, 48, mask); -+ IEEE80211_RATE_IN_MASK(OFDM, 54, mask); -+ IEEE80211_RATE_IN_MASK(CCK, 1, mask); -+ IEEE80211_RATE_IN_MASK(CCK, 2, mask); -+ IEEE80211_RATE_IN_MASK(CCK, 5, mask); -+ IEEE80211_RATE_IN_MASK(CCK, 11, mask); -+ } -+ -+ return IEEE80211_RATE_INVALID; -+} -+ -+static u32 ipw_find_compatible_rates(struct ipw_priv *priv, -+ const struct ieee80211_network *network, -+ u16 rates_mask) -+{ -+ int bit_index, i; -+ u32 rates = 0; -+ -+ /* rates */ -+ for (i = 0; i < network->rates_len; i++) { -+ bit_index = ipw_is_rate_in_mask(priv, network->rates[i], -+ rates_mask); -+ if (bit_index & IEEE80211_RATE_INVALID) { -+ IPW_DEBUG_RATE("Invalid rate requested: " -+ "%02X\n", network->rates[i]); -+ continue; -+ } -+ -+ if (bit_index & IEEE80211_RATE_MASKED) { -+ if (!(network->rates[i] & IEEE80211_BASIC_RATE_MASK)) { -+ IPW_DEBUG_RATE("Rate %02X masked : 0x%08X\n", -+ network->rates[i], rates_mask); -+ -+ continue; -+ } -+ -+ /* Clear out any bits set in the mask that are not -+ * specific rates (INVALID and MASKED bits) */ -+ bit_index &= IEEE80211_RATE_INDEX_MASK; -+ -+ IPW_DEBUG_RATE("Adding masked mandatory " -+ "rate %02X\n", network->rates[i]); -+ } -+ -+ if (network->rates[i] & IEEE80211_BASIC_RATE_MASK) -+ rates |= (1 << (bit_index + 16)); -+ -+ rates |= (1 << bit_index); -+ } -+ -+ /* extended rates */ -+ for (i = 0; i < network->rates_ex_len; i++) { -+ bit_index = ipw_is_rate_in_mask(priv, network->rates_ex[i], -+ rates_mask); -+ if (bit_index & IEEE80211_RATE_INVALID) { -+ IPW_DEBUG_RATE("Invalid rate requested: " -+ "%02X\n", network->rates_ex[i]); -+ continue; -+ } -+ -+ if (bit_index & IEEE80211_RATE_MASKED) { -+ if (!(network->rates_ex[i] & IEEE80211_BASIC_RATE_MASK)) { -+ IPW_DEBUG_RATE("Rate %02X masked : 0x%08X\n", -+ network->rates_ex[i], -+ rates_mask); -+ -+ continue; -+ } -+ -+ bit_index &= ~IEEE80211_RATE_INDEX_MASK; -+ -+ IPW_DEBUG_RATE("Adding masked mandatory " -+ "rate %02X\n", network->rates_ex[i]); -+ } -+ -+ if (network->rates_ex[i] & IEEE80211_BASIC_RATE_MASK) -+ rates |= (1 << (bit_index + 16)); -+ -+ rates |= (1 << bit_index); -+ } -+ -+ return rates; -+} -+ -+#if 0 -+static int ipw_compatible_basic_rates(struct ipw_priv *priv, -+ struct ieee80211_network *network, -+ u32 rates_mask) -+{ -+ int i; -+ -+ for (i = 0; i < network->rates_len; i++) { -+ if (!(network->rates[i] & IEEE80211_BASIC_RATE_MASK)) -+ continue; -+ if (!ipw_is_rate_in_mask(priv, network->rates[i], rates_mask)) -+ return 1; -+ } -+ -+ for (i = 0; i < network->rates_ex_len; i++) { -+ if (!(network->rates_ex[i] & IEEE80211_BASIC_RATE_MASK)) -+ continue; -+ if (!ipw_is_rate_in_mask(priv, network->rates_ex[i], -+ rates_mask)) -+ return 1; -+ } -+ -+ return 0; -+} -+#endif -+ -+struct ipw_network_match { -+ struct ieee80211_network *network; -+ u32 rates_mask; -+}; -+ -+static int ipw_find_adhoc_network(struct ipw_priv *priv, -+ struct ipw_network_match *match, -+ struct ieee80211_network *network, -+ int roaming) -+{ -+ u16 rates_mask; -+ /* Verify that this network's capability is compatible with the -+ * current mode (AdHoc or Infrastructure) */ -+ if ((priv->ieee->iw_mode == IW_MODE_ADHOC && -+ !(network->capability & WLAN_CAPABILITY_IBSS))) { -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT -+ ")' excluded due to " -+ "capability mismatch.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ -+ /* If we do not have an ESSID for this AP, we can not associate with -+ * it */ -+ if (network->flags & NETWORK_EMPTY_ESSID) { -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " -+ "because of hidden ESSID.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ -+ if (unlikely(roaming)) { -+ /* If we are roaming, then ensure check if this is a valid -+ * network to try and roam to */ -+ if ((network->ssid_len != match->network->ssid_len) || -+ memcmp(network->ssid, match->network->ssid, -+ network->ssid_len)) { -+ IPW_DEBUG_MERGE("Netowrk '%s (" MAC_FMT -+ ")' excluded " -+ "because of non-network ESSID.\n", -+ escape_essid(network->ssid, -+ network-> -+ ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ } else { -+ /* If an ESSID has been configured then compare the broadcast -+ * ESSID to ours */ -+ if ((priv->config & CFG_STATIC_ESSID) && -+ ((network->ssid_len != priv->essid_len) || -+ memcmp(network->ssid, priv->essid, -+ min(network->ssid_len, priv->essid_len)))) { -+ char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; -+ strncpy(escaped, -+ escape_essid(network->ssid, -+ network->ssid_len), -+ sizeof(escaped)); -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT -+ ")' excluded " -+ "because of ESSID mismatch: '%s'.\n", -+ escaped, -+ MAC_ARG(network->bssid), -+ escape_essid(priv->essid, -+ priv->essid_len)); -+ return 0; -+ } -+ } -+ -+ /* If the old network rate is better than this one, don't bother -+ * testing everything else. */ -+ -+ if (network->time_stamp[0] < match->network->time_stamp[0]) { -+ IPW_DEBUG_MERGE -+ ("Network '%s excluded because newer than current network.\n", -+ escape_essid(match->network->ssid, -+ match->network->ssid_len)); -+ return 0; -+ } else if (network->time_stamp[1] < match->network->time_stamp[1]) { -+ IPW_DEBUG_MERGE -+ ("Network '%s excluded because newer than current network.\n", -+ escape_essid(match->network->ssid, -+ match->network->ssid_len)); -+ return 0; -+ } -+ -+ /* Now go through and see if the requested network is valid... */ -+ if (priv->ieee->scan_age != 0 && -+ time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " -+ "because of age: %ums (limit=%ums)\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid), -+ jiffies_to_msecs(elapsed_jiffies -+ (network-> -+ last_scanned, -+ jiffies)), -+ jiffies_to_msecs(priv->ieee->scan_age)); -+ return 0; -+ } -+ -+ if ((priv->config & CFG_STATIC_CHANNEL) && -+ (network->channel != priv->channel)) { -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " -+ "because of channel mismatch: %d != %d.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid), -+ network->channel, priv->channel); -+ return 0; -+ } -+ -+ /* Verify privacy compatability */ -+ if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != -+ ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " -+ "because of privacy mismatch: %s != %s.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid), -+ priv-> -+ capability & CAP_PRIVACY_ON ? "on" : -+ "off", -+ network-> -+ capability & WLAN_CAPABILITY_PRIVACY ? -+ "on" : "off"); -+ return 0; -+ } -+ -+ if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) { -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " -+ "because of the same BSSID match: " -+ MAC_FMT ".\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid), MAC_ARG(priv->bssid)); -+ return 0; -+ } -+ -+ /* Filter out any incompatible freq / mode combinations */ -+ if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " -+ "because of invalid frequency/mode " -+ "combination.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+#if 0 -+ /* Ensure that the rates supported by the driver are compatible with -+ * this AP, including verification of basic rates (mandatory) */ -+ if (!ipw_compatible_basic_rates(priv, network, priv->rates_mask)) { -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " -+ "because configured rate mask excludes " -+ "AP mandatory rate.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+#endif -+ -+ rates_mask = ipw_find_compatible_rates(priv, network, priv->rates_mask); -+ if (!rates_mask) { -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT ")' excluded " -+ "because of no compatible rates.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ -+ /* TODO: Perform any further minimal comparititive tests. We do not -+ * want to put too much policy logic here; intelligent scan selection -+ * should occur within a generic IEEE 802.11 user space tool. */ -+ -+ /* Set up 'new' AP to this network */ -+ match->rates_mask = rates_mask; -+ match->network = network; -+ IPW_DEBUG_MERGE("Network '%s (" MAC_FMT -+ ")' is a viable match.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 1; -+} -+ -+static void ipw_merge_adhoc_network(void *data) -+{ -+ struct ipw_priv *priv = data; -+ struct ieee80211_network *network = NULL; -+ struct ipw_network_match match = { -+ .network = priv->assoc_network -+ }; -+ if ((priv->status & STATUS_ASSOCIATED) -+ && (priv->ieee->iw_mode == IW_MODE_ADHOC)) { -+ /* First pass through ROAM process -- look for a better -+ * network */ -+ unsigned long flags; -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ list_for_each_entry(network, &priv->ieee->network_list, list) { -+ if (network != priv->assoc_network) -+ ipw_find_adhoc_network(priv, &match, -+ network, 1); -+ } -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ if (match.network == priv->assoc_network) { -+ IPW_DEBUG_MERGE -+ ("No better ADHOC in this network to " -+ "merge to.\n"); -+ return; -+ } -+ -+ mutex_lock(&priv->mutex); -+ if ((priv->ieee->iw_mode == IW_MODE_ADHOC)) { -+ IPW_DEBUG_MERGE("remove network %s\n", -+ escape_essid(priv->essid, -+ priv->essid_len)); -+ ipw_remove_current_network(priv); -+ } -+ -+ ipw_disassociate(priv); -+ priv->assoc_network = match.network; -+ mutex_unlock(&priv->mutex); -+ return; -+ } -+ -+} -+ -+static int ipw_best_network(struct ipw_priv *priv, -+ struct ipw_network_match *match, -+ struct ieee80211_network *network, int roaming) -+{ -+ u32 rates_mask; -+ -+ /* Verify that this network's capability is compatible with the -+ * current mode (AdHoc or Infrastructure) */ -+ if ((priv->ieee->iw_mode == IW_MODE_INFRA && -+ !(network->capability & WLAN_CAPABILITY_ESS)) || -+ (priv->ieee->iw_mode == IW_MODE_ADHOC && -+ !(network->capability & WLAN_CAPABILITY_IBSS))) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT -+ ")' excluded due to " -+ "capability mismatch.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ -+ if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) { -+ IPW_DEBUG_SCAN("Invalid channel for '%s (" MAC_FMT -+ ")'.\n", escape_essid(network->ssid, -+ network-> -+ ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ -+ if (network->capability & WLAN_CAPABILITY_SPECTRUM_MGMT) { -+ if ((network->capability & WLAN_CAPABILITY_IBSS) && -+ !(network->flags & NETWORK_HAS_IBSS_DFS)) { -+ IPW_DEBUG_SCAN("Network '%s (" MAC_FMT ")' " -+ "is invalid - IBSS DFS mismatch.\n", -+ escape_essid(network->ssid, -+ network-> -+ ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ -+ if (!(network->flags & NETWORK_HAS_POWER_CONSTRAINT)) { -+ IPW_DEBUG_SCAN -+ ("Spectrum managed network '%s (" MAC_FMT -+ ")' " -+ "but is missing Power Constraint.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ } -+ -+ if (!(network->flags & NETWORK_HAS_TPC_REPORT)) { -+ IPW_DEBUG_SCAN -+ ("Spectrum managed network '%s (" MAC_FMT -+ ")' " "but is missing TPC.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ } -+ } -+ -+ /* If we do not have an ESSID for this AP, we can not associate with -+ * it */ -+ if (network->flags & NETWORK_EMPTY_ESSID) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " -+ "because of hidden ESSID.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ -+ if (unlikely(roaming)) { -+ /* If we are roaming, then ensure check if this is a valid -+ * network to try and roam to */ -+ if ((network->ssid_len != match->network->ssid_len) || -+ memcmp(network->ssid, match->network->ssid, -+ network->ssid_len)) { -+ IPW_DEBUG_ASSOC("Netowrk '%s (" MAC_FMT -+ ")' excluded " -+ "because of non-network ESSID.\n", -+ escape_essid(network->ssid, -+ network-> -+ ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ } else { -+ /* If an ESSID has been configured then compare the broadcast -+ * ESSID to ours */ -+ if ((priv->config & CFG_STATIC_ESSID) && -+ ((network->ssid_len != priv->essid_len) || -+ memcmp(network->ssid, priv->essid, -+ min(network->ssid_len, priv->essid_len)))) { -+ char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; -+ strncpy(escaped, -+ escape_essid(network->ssid, -+ network->ssid_len), -+ sizeof(escaped)); -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT -+ ")' excluded " -+ "because of ESSID mismatch: '%s'.\n", -+ escaped, -+ MAC_ARG(network->bssid), -+ escape_essid(priv->essid, -+ priv->essid_len)); -+ return 0; -+ } -+ } -+ -+ /* If the old network rate is better than this one, don't bother -+ * testing everything else. */ -+ if (match->network && match->network->stats.rssi > network->stats.rssi) { -+ char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; -+ strncpy(escaped, -+ escape_essid(network->ssid, -+ network->ssid_len), sizeof(escaped)); -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT -+ ")' excluded because " "'%s (" MAC_FMT -+ ")' has a stronger signal.\n", -+ escaped, MAC_ARG(network->bssid), -+ escape_essid(match->network->ssid, -+ match->network-> -+ ssid_len), -+ MAC_ARG(match->network->bssid)); -+ return 0; -+ } -+ -+ /* If this network has already had an association attempt within the -+ * last 3 seconds, do not try and associate again... */ -+ if (network->last_associate && -+ time_after(network->last_associate + (HZ * 3UL), jiffies)) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " -+ "because of storming (%lu since last " -+ "assoc attempt).\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid), -+ (jiffies - network->last_associate) / HZ); -+ return 0; -+ } -+ -+ /* Now go through and see if the requested network is valid... */ -+ if (priv->ieee->scan_age != 0 && -+ time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " -+ "because of age: %ums (limit=%ums)\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid), -+ jiffies_to_msecs(elapsed_jiffies -+ (network-> -+ last_scanned, -+ jiffies)), -+ jiffies_to_msecs(priv->ieee->scan_age)); -+ return 0; -+ } -+ -+ if ((priv->config & CFG_STATIC_CHANNEL) && -+ (network->channel != priv->channel)) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " -+ "because of channel mismatch: %d != %d.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid), -+ network->channel, priv->channel); -+ return 0; -+ } -+ -+ /* Verify privacy compatability */ -+ if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != -+ ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " -+ "because of privacy mismatch: %s != %s.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid), -+ priv-> -+ capability & CAP_PRIVACY_ON ? "on" : -+ "off", -+ network-> -+ capability & WLAN_CAPABILITY_PRIVACY ? -+ "on" : "off"); -+ return 0; -+ } -+ -+ if ((priv->config & CFG_STATIC_BSSID) && -+ memcmp(network->bssid, priv->bssid, ETH_ALEN)) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " -+ "because of BSSID mismatch: " MAC_FMT -+ ".\n", escape_essid(network->ssid, -+ network-> -+ ssid_len), -+ MAC_ARG(network->bssid), MAC_ARG(priv->bssid)); -+ return 0; -+ } -+ -+ /* Filter out any incompatible freq / mode combinations */ -+ if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " -+ "because of invalid frequency/mode " -+ "combination.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+#if 0 -+ /* Ensure that the rates supported by the driver are compatible with -+ * this AP, including verification of basic rates (mandatory) */ -+ if (!ipw_compatible_basic_rates(priv, network, priv->rates_mask)) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " -+ "because configured rate mask excludes " -+ "AP mandatory rate.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+#endif -+ -+ rates_mask = ipw_find_compatible_rates(priv, network, priv->rates_mask); -+ if (!rates_mask) { -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT ")' excluded " -+ "because of no compatible rates.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 0; -+ } -+ -+ /* TODO: Perform any further minimal comparititive tests. We do not -+ * want to put too much policy logic here; intelligent scan selection -+ * should occur within a generic IEEE 802.11 user space tool. */ -+ -+ /* Set up 'new' AP to this network */ -+ match->rates_mask = rates_mask; -+ match->network = network; -+ IPW_DEBUG_ASSOC("Network '%s (" MAC_FMT -+ ")' is a viable match.\n", -+ escape_essid(network->ssid, -+ network->ssid_len), -+ MAC_ARG(network->bssid)); -+ return 1; -+} -+ -+static u8 ipw_get_first_adhoc_channel(struct ipw_priv *priv, u8 mode) -+{ -+ const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); -+ const struct ieee80211_channel *channels = NULL; -+ int count = 0, i; -+ -+ if (!ipw_is_ready(priv)) -+ return 0; -+ -+ if (mode == IEEE_A) { -+ channels = geo->a; -+ count = geo->a_channels; -+ } else { -+ channels = geo->bg; -+ count = geo->bg_channels; -+ } -+ for (i = 0; i < count; i++) -+ if (!(channels[i].flags & IEEE80211_CH_NO_IBSS)) -+ return channels[i].channel; -+ return 0; -+} -+ -+static int ipw_adhoc_create(struct ipw_priv *priv, -+ struct ieee80211_network *network) -+{ -+ int i; -+ -+ if (!ipw_is_ready(priv)) { -+ IPW_WARNING("adhoc create called when driver not ready.\n"); -+ return -EINVAL; -+ } -+ -+ /* -+ * For the purposes of scanning, we can set our wireless mode -+ * to trigger scans across combinations of bands, but when it -+ * comes to creating a new ad-hoc network, we have tell the FW -+ * exactly which band to use. -+ * -+ * We also have the possibility of an invalid channel for the -+ * chossen band. Attempting to create a new ad-hoc network -+ * with an invalid channel for wireless mode will trigger a -+ * FW fatal error. -+ */ -+ switch (ieee80211_is_valid_channel(priv->ieee, priv->channel)) { -+ case IEEE80211_52GHZ_BAND: -+ network->mode = IEEE_A; -+ i = ieee80211_channel_to_index(priv->ieee, priv->channel); -+ if (i == -1) -+ BUG(); -+ /* -+ if (geo->a[i].passive_only) { -+ IPW_WARNING("Overriding invalid channel\n"); -+ priv->channel = geo->a[0].channel; -+ } -+ */ -+ break; -+ -+ case IEEE80211_24GHZ_BAND: -+ if (priv->ieee->mode & IEEE_G) -+ network->mode = IEEE_G; -+ else -+ network->mode = IEEE_B; -+ break; -+ -+ default: -+ IPW_WARNING("Overriding invalid channel\n"); -+ if (priv->ieee->mode & IEEE_A) -+ network->mode = IEEE_A; -+ else if (priv->ieee->mode & IEEE_G) -+ network->mode = IEEE_G; -+ else -+ network->mode = IEEE_B; -+ -+ priv->channel = ipw_get_first_adhoc_channel(priv, -+ network->mode); -+ -+ if (!priv->channel) { -+ IPW_DEBUG_ASSOC -+ ("ERROR create ad-hoc network with " -+ "invalid channel %d\n", priv->channel); -+ return -EINVAL; -+ } -+ -+ break; -+ } -+ -+ if ((ieee80211_get_channel_flags(priv->ieee, priv->channel) & -+ IEEE80211_CH_NO_IBSS)) { -+ IPW_DEBUG_ASSOC -+ ("ERROR create ad-hoc network with non " -+ "adhoc channel %d\n", priv->channel); -+ return -EINVAL; -+ } -+ -+ network->channel = priv->channel; -+ priv->config |= CFG_ADHOC_PERSIST; -+ ipw_create_bssid(priv, network->bssid); -+ network->ssid_len = priv->essid_len; -+ memcpy(network->ssid, priv->essid, priv->essid_len); -+ memset(&network->stats, 0, sizeof(network->stats)); -+ network->capability = WLAN_CAPABILITY_IBSS; -+ if (!(priv->config & CFG_PREAMBLE_LONG)) -+ network->capability |= WLAN_CAPABILITY_SHORT_PREAMBLE; -+ if (priv->capability & CAP_PRIVACY_ON) -+ network->capability |= WLAN_CAPABILITY_PRIVACY; -+ ipw_fill_network_rates(network, priv->rates_mask); -+ -+ network->last_scanned = 0; -+ network->flags = 0; -+ network->last_associate = 0; -+ network->time_stamp[0] = 0; -+ network->time_stamp[1] = 0; -+ network->beacon_interval = 100; /* Default */ -+ network->listen_interval = 10; /* Default */ -+ network->atim_window = 0; /* Default */ -+ network->wpa_ie_len = 0; -+ network->rsn_ie_len = 0; -+ network->erp_value = 0; -+ network->stats.rssi = -30; -+ -+ return 0; -+} -+ -+#ifdef CONFIG_IPW3945_DEBUG -+static void ipw_debug_config(struct ipw_priv *priv) -+{ -+ IPW_DEBUG_INFO("Scan completed, no valid APs matched " -+ "[CFG 0x%08X]\n", priv->config); -+ if (priv->config & CFG_STATIC_CHANNEL) -+ IPW_DEBUG_INFO("Channel locked to %d\n", priv->channel); -+ else -+ IPW_DEBUG_INFO("Channel unlocked.\n"); -+ if (priv->config & CFG_STATIC_ESSID) -+ IPW_DEBUG_INFO("ESSID locked to '%s'\n", -+ escape_essid(priv->essid, priv->essid_len)); -+ else -+ IPW_DEBUG_INFO("ESSID unlocked.\n"); -+ if (priv->config & CFG_STATIC_BSSID) -+ IPW_DEBUG_INFO("BSSID locked to " MAC_FMT "\n", -+ MAC_ARG(priv->bssid)); -+ else -+ IPW_DEBUG_INFO("BSSID unlocked.\n"); -+ if (priv->capability & CAP_PRIVACY_ON) -+ IPW_DEBUG_INFO("PRIVACY on\n"); -+ else -+ IPW_DEBUG_INFO("PRIVACY off\n"); -+ IPW_DEBUG_INFO("RATE MASK: 0x%08X\n", priv->rates_mask); -+} -+#else -+#define ipw_debug_config(x) do {} while (0); -+#endif -+ -+/* For active scan, listen ACTIVE_DWELL_TIME (msec) on each channel after -+ * sending probe req. This should be set long enough to hear probe responses -+ * from more than one AP. */ -+#define IPW_ACTIVE_DWELL_TIME_24 (20) /* all times in msec */ -+#define IPW_ACTIVE_DWELL_TIME_52 (10) -+ -+/* For faster active scanning, scan will move to the next channel if fewer than -+ * PLCP_QUIET_THRESH packets are heard on this channel within -+ * ACTIVE_QUIET_TIME after sending probe request. This shortens the dwell -+ * time if it's a quiet channel (nothing responded to our probe, and there's -+ * no other traffic). -+ * Disable "quiet" feature by setting PLCP_QUIET_THRESH to 0. */ -+#define IPW_PLCP_QUIET_THRESH (1) /* packets */ -+#define IPW_ACTIVE_QUIET_TIME (5) /* msec */ -+ -+/* For passive scan, listen PASSIVE_DWELL_TIME (msec) on each channel. -+ * Must be set longer than active dwell time. -+ * For the most reliable scan, set > AP beacon interval (typically 100msec). */ -+#define IPW_PASSIVE_DWELL_TIME_24 (20) /* all times in msec */ -+#define IPW_PASSIVE_DWELL_TIME_52 (10) -+#define IPW_PASSIVE_DWELL_BASE (100) -+#define IPW_CHANNEL_TUNE_TIME 5 -+static void ipw_abort_scan(struct ipw_priv *priv) -+{ -+ priv->status &= ~STATUS_SCAN_PENDING; -+ priv->status |= STATUS_SCAN_ABORTING; -+ ipw_send_scan_abort(priv); -+} -+ -+static inline u16 ipw_get_active_dwell_time(struct ipw_priv *priv, u8 band) -+{ -+ if (band == IEEE80211_24GHZ_BAND) -+ return IPW_ACTIVE_DWELL_TIME_24; -+ else -+ return IPW_ACTIVE_DWELL_TIME_52; -+} -+ -+static inline u16 ipw_get_passive_dwell_time(struct ipw_priv *priv, u8 band) -+{ -+ u16 active = ipw_get_active_dwell_time(priv, band); -+ u16 passive = (band == IEEE80211_24GHZ_BAND) ? -+ IPW_PASSIVE_DWELL_BASE + IPW_PASSIVE_DWELL_TIME_24 : -+ IPW_PASSIVE_DWELL_BASE + IPW_PASSIVE_DWELL_TIME_52; -+ -+ if (priv->status & STATUS_ASSOCIATED) { -+ /* If we're associated, we clamp the maximum passive -+ * dwell time to be 98% of the beacon interval (minus -+ * 2 * channel tune time) */ -+ passive = priv->assoc_request.beacon_interval; -+ if (passive > IPW_PASSIVE_DWELL_BASE) -+ passive = IPW_PASSIVE_DWELL_BASE; -+ passive = (passive * 98) / 100 - IPW_CHANNEL_TUNE_TIME * 2; -+ } -+ -+ if (passive <= active) -+ passive = active + 1; -+ -+ return passive; -+} -+ -+static int ipw_get_channels_for_scan(struct ipw_priv *priv, u8 band, -+ u8 is_active, struct daemon_scan_channel -+ *scan_list, int max_count) -+{ -+ const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); -+ u16 passive_dwell = 0; -+ u16 active_dwell = 0; -+ int indx, i; -+ const struct ieee80211_channel *channels = NULL; -+ int count = 0; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ if (band == IEEE80211_52GHZ_BAND) { -+ channels = geo->a; -+ count = geo->a_channels; -+ } else if (band == IEEE80211_24GHZ_BAND) { -+ channels = geo->bg; -+ count = geo->bg_channels; -+ } else { -+ /* Band is a bogus value -- it must be a specific band to -+ * scan, not a full list of supported bands */ -+ BUG(); -+ } -+ -+ active_dwell = ipw_get_active_dwell_time(priv, band); -+ passive_dwell = ipw_get_passive_dwell_time(priv, band); -+ -+ for (i = 0, indx = 0; (indx < max_count) && (i < count); i++) { -+ /* If we're roaming, we only want to grab the current channel -+ * so skip the rest. */ -+ if (priv->status & STATUS_ROAMING) { -+ if (channels[i].channel != priv->channel) -+ continue; -+ } else if (channels[i].channel == priv->channel) { -+ if (priv->status & STATUS_ASSOCIATED) { -+ IPW_DEBUG_SCAN -+ ("Skipping current channel %d\n", -+ priv->channel); -+ continue; -+ } -+ } -+ -+ scan_list[indx].channel = channels[i].channel; -+ /* If this is configured as a passive only channel -+ * then force the flags to passive, otherwise honor the -+ * user request for active / passive */ -+ scan_list[indx].request_active = -+ (channels[i].flags & IEEE80211_CH_PASSIVE_ONLY) ? -+ 0 : is_active; -+ scan_list[indx].active_dwell = active_dwell; -+ scan_list[indx].passive_dwell = passive_dwell; -+ IPW_DEBUG_SCAN("Scanning %d [%s %d]\n", -+ scan_list[indx].channel, -+ scan_list[indx]. -+ request_active ? "ACTIVE" : "PASSIVE", -+ scan_list[indx]. -+ request_active ? active_dwell : -+ scan_list[indx].passive_dwell); -+ -+ indx++; -+ } -+ -+ IPW_DEBUG_SCAN("total channel to scan %d \n", indx); -+ return indx; -+} -+ -+static void ipw_bg_request_scan(void *data) -+{ -+ struct ipw_daemon_cmd_list *element; -+ struct ipw_priv *priv = data; -+ int rc = 0; -+ struct daemon_scan_request *scan; -+ const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); -+ u32 band = 0; -+ -+ if (!ipw_is_ready(priv)) { -+ IPW_WARNING("request scan called when driver not ready.\n"); -+ return; -+ } -+ -+ mutex_lock(&priv->mutex); -+ -+ /* This should never be called or scheduled if there is currently -+ * a scan active in the hardware. */ -+ if (priv->status & STATUS_SCAN_HW) { -+ IPW_DEBUG_INFO -+ ("Multiple concurrent scan requests in parallel. " -+ "Ignoring second request.\n"); -+ rc = -EIO; -+ goto done; -+ } -+ -+ if (priv->status & STATUS_EXIT_PENDING) { -+ IPW_DEBUG_SCAN("Aborting scan due to device shutdown\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ goto done; -+ } -+ -+ if (priv->status & STATUS_SCAN_ABORTING) { -+ IPW_DEBUG_HC("Scan request while abort pending. Queuing.\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ goto done; -+ } -+ -+ if (priv->status & STATUS_RF_KILL_MASK) { -+ IPW_DEBUG_HC("Aborting scan due to RF Kill activation\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ goto done; -+ } -+ -+ if (!(priv->status & STATUS_READY)) { -+ IPW_DEBUG_HC("Scan request while uninitialized. Queuing.\n"); -+ priv->status |= STATUS_SCAN_PENDING; -+ goto done; -+ } -+ -+ if (!priv->scan_bands_remaining) { -+ IPW_DEBUG_HC("Aborting scan due to no requested bands\n"); -+ goto done; -+ } -+ -+ element = kmalloc(sizeof(*element) + DAEMON_MAX_SCAN_SIZE, GFP_ATOMIC); -+ if (!element) { -+ rc = -ENOMEM; -+ goto done; -+ } -+ -+ memset(element, 0, sizeof(struct daemon_scan_request)); -+ element->cmd.cmd = DAEMON_SCAN_REQUEST; -+ -+ scan = (struct daemon_scan_request *)element->cmd.data; -+ -+ scan->quiet_plcp_th = IPW_PLCP_QUIET_THRESH; -+ scan->quiet_time = IPW_ACTIVE_QUIET_TIME; -+ -+ if (priv->status & STATUS_ASSOCIATED) { -+ u16 interval = priv->assoc_request.beacon_interval; -+ u32 extra; -+ -+ IPW_DEBUG_INFO("Scanning while associated...\n"); -+ scan->suspend_time = 100; -+ scan->max_out_time = 600 * 1024; -+ if (interval) { -+ /* -+ * suspend time format: -+ * 0-19: beacon interval in usec (time before exec.) -+ * 20-23: 0 -+ * 24-31: number of beacons (suspend between channels) -+ */ -+ -+ extra = (scan->suspend_time / interval) << 24; -+ scan->suspend_time = 0xFF0FFFFF & (extra | -+ ((scan-> -+ suspend_time -+ % interval) -+ * 1024)); -+ } -+ } -+ -+ /* We should add the ability for user to lock to PASSIVE ONLY */ -+ scan->flags |= DAEMON_SCAN_FLAG_ACTIVE; -+ -+ if (scan->flags & DAEMON_SCAN_FLAG_ACTIVE) { -+#if WIRELESS_EXT > 17 -+ if (priv->one_direct_scan) { -+ IPW_DEBUG_SCAN -+ ("Kicking off one direct scan for '%s'\n", -+ escape_essid(priv->direct_ssid, -+ priv->direct_ssid_len)); -+ scan->flags |= DAEMON_SCAN_FLAG_DIRECT; -+ scan->direct_scan.id = MFIE_TYPE_SSID; -+ scan->direct_scan.len = priv->direct_ssid_len; -+ memcpy(scan->direct_scan.ssid, -+ priv->direct_ssid, priv->direct_ssid_len); -+ } else if ((priv->config & CFG_STATIC_ESSID) && -+#else -+ if ((priv->config & CFG_STATIC_ESSID) && -+#endif -+ !(priv->status & STATUS_ASSOCIATED)) { -+ scan->flags |= DAEMON_SCAN_FLAG_DIRECT; -+ scan->direct_scan.id = MFIE_TYPE_SSID; -+ scan->direct_scan.len = priv->essid_len; -+ memcpy(scan->direct_scan.ssid, -+ priv->essid, priv->essid_len); -+ } -+ -+ scan->probe_request_len = -+ ipw_fill_probe_req(priv, (struct ieee80211_probe_request *) -+ scan->data, -+ DAEMON_MAX_SCAN_SIZE - sizeof(scan), 0); -+ } else -+ scan->probe_request_len = 0; -+ -+ /* flags + rate selection */ -+ -+ if (priv->scan_bands_remaining & IEEE80211_24GHZ_BAND) { -+ band = IEEE80211_24GHZ_BAND; -+ scan->flags |= DAEMON_SCAN_FLAG_24GHZ; -+ scan->rxon_flags = -+ RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK; -+ scan->probe_request_rate = R_1M; -+ -+ } else if (priv->scan_bands_remaining & IEEE80211_52GHZ_BAND) { -+ band = IEEE80211_52GHZ_BAND; -+ scan->flags |= DAEMON_SCAN_FLAG_52GHZ; -+ scan->probe_request_rate = R_6M; -+ } else { -+ printk(KERN_ERR "Invalid scan_bands_remaining bitmask.\n"); -+ BUG(); -+ } -+ -+ scan->rxon_flags |= ipw_get_antenna_flags(priv); -+ -+#ifdef CONFIG_IPW3945_MONITOR -+ if (priv->ieee->iw_mode == IW_MODE_MONITOR) -+ scan->filter_flags = RXON_FILTER_PROMISC_MSK; -+#endif -+ -+ if (scan->flags & DAEMON_SCAN_FLAG_ACTIVE) { -+ if (scan->flags & DAEMON_SCAN_FLAG_DIRECT) -+ IPW_DEBUG_SCAN -+ ("Initiating direct scan for %s.\n", -+ escape_essid(priv->essid, priv->essid_len)); -+ else -+ IPW_DEBUG_SCAN("Initiating indirect scan.\n"); -+ } else -+ IPW_DEBUG_SCAN("Initiating passive scan.\n"); -+ -+ scan->channel_count = ipw_get_channels_for_scan(priv, band, -+ scan-> -+ flags & -+ DAEMON_SCAN_FLAG_ACTIVE, -+ (struct -+ daemon_scan_channel *) -+ &scan-> -+ data[scan-> -+ probe_request_len], -+ geo-> -+ a_channels + -+ geo->bg_channels); -+ -+ element->cmd.data_len = sizeof(*scan) + -+ scan->probe_request_len + -+ scan->channel_count * sizeof(struct daemon_scan_channel); -+ -+ priv->scan_flags = scan->flags; -+ -+ element->cmd.flags |= DAEMON_FLAG_WANT_RESULT; -+ -+ priv->status |= STATUS_SCAN_HW; -+ rc = ipw_send_daemon_cmd(priv, element); -+ if (rc) -+ goto done; -+ -+ queue_delayed_work(priv->workqueue, &priv->scan_check, -+ IPW_SCAN_CHECK_WATCHDOG); -+ -+ priv->status &= ~STATUS_SCAN_PENDING; -+ -+ goto done; -+ -+ done: -+ if (!rc) -+ ipw_update_link_led(priv); -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_bg_abort_scan(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ if (priv->status & STATUS_READY) -+ ipw_abort_scan(data); -+ mutex_unlock(&priv->mutex); -+} -+ -+enum { -+#if WIRELESS_EXT < 18 -+ IPW_IOCTL_WPA_SUPPLICANT = SIOCIWFIRSTPRIV + 30, -+#endif -+ IPW_IOCTL_CMD = SIOCDEVPRIVATE + 1, -+}; -+ -+#if WIRELESS_EXT < 18 -+/* Support for wpa_supplicant. Will be replaced with WEXT once -+ * they get WPA support. */ -+ -+/* following definitions must match definitions in driver_ipw.c */ -+ -+#define IPW_CMD_SET_WPA_PARAM 1 -+#define IPW_CMD_SET_WPA_IE 2 -+#define IPW_CMD_SET_ENCRYPTION 3 -+#define IPW_CMD_MLME 4 -+ -+#define IPW_PARAM_WPA_ENABLED 1 -+#define IPW_PARAM_TKIP_COUNTERMEASURES 2 -+#define IPW_PARAM_DROP_UNENCRYPTED 3 -+#define IPW_PARAM_PRIVACY_INVOKED 4 -+#define IPW_PARAM_AUTH_ALGS 5 -+#define IPW_PARAM_IEEE_802_1X 6 -+ -+#define IPW_MLME_STA_DEAUTH 1 -+#define IPW_MLME_STA_DISASSOC 2 -+ -+#define IPW_CRYPT_ERR_UNKNOWN_ALG 2 -+#define IPW_CRYPT_ERR_UNKNOWN_ADDR 3 -+#define IPW_CRYPT_ERR_CRYPT_INIT_FAILED 4 -+#define IPW_CRYPT_ERR_KEY_SET_FAILED 5 -+#define IPW_CRYPT_ERR_TX_KEY_SET_FAILED 6 -+#define IPW_CRYPT_ERR_CARD_CONF_FAILED 7 -+ -+#define IPW_CRYPT_ALG_NAME_LEN 16 -+ -+struct ipw_param { -+ u32 cmd; -+ u8 sta_addr[ETH_ALEN]; -+ union { -+ struct { -+ u8 name; -+ u32 value; -+ } wpa_param; -+ struct { -+ u32 len; -+ u8 reserved[32]; -+ u8 data[0]; -+ } wpa_ie; -+ struct { -+ int command; -+ int reason; -+ } mlme; -+ struct { -+ u8 alg[IPW_CRYPT_ALG_NAME_LEN]; -+ u8 set_tx; -+ u32 err; -+ u8 idx; -+ u8 seq[8]; /* sequence counter (set: RX, get: TX) */ -+ u16 key_len; -+ u8 key[0]; -+ } crypt; -+ } u; -+}; -+ -+/* end of driver_ipw.c code */ -+#endif -+ -+static int ipw_wpa_enable(struct ipw_priv *priv, int value) -+{ -+ /* This is called when wpa_supplicant loads and closes the driver -+ * interface. */ -+ return 0; -+} -+ -+#if WIRELESS_EXT < 18 -+#define IW_AUTH_ALG_OPEN_SYSTEM 0x1 -+#define IW_AUTH_ALG_SHARED_KEY 0x2 -+#endif -+ -+static int ipw_wpa_set_auth_algs(struct ipw_priv *priv, int value) -+{ -+ struct ieee80211_device *ieee = priv->ieee; -+ struct ieee80211_security sec = { -+ .flags = SEC_AUTH_MODE, -+ }; -+ int ret = 0; -+ if (value & IW_AUTH_ALG_SHARED_KEY) { -+ sec.auth_mode = WLAN_AUTH_SHARED_KEY; -+ ieee->open_wep = 0; -+ } else { -+ sec.auth_mode = WLAN_AUTH_OPEN; -+ ieee->open_wep = 1; -+ } -+ -+ if (ieee->set_security) -+ ieee->set_security(ieee->dev, &sec); -+ else -+ ret = -EOPNOTSUPP; -+ return ret; -+} -+ -+//todoG is this still needed -+static int ipw_set_rsn_capa(struct ipw_priv *priv, -+ char *capabilities, int length) -+{ -+ return 0; -+} -+ -+static void ipw_wpa_assoc_frame(struct ipw_priv *priv, char *wpa_ie, -+ int wpa_ie_len) -+{ -+ /* make sure WPA is enabled */ -+ ipw_wpa_enable(priv, 1); -+ ipw_disassociate(priv); -+} -+ -+#if WIRELESS_EXT < 18 -+static int ipw_wpa_set_param(struct net_device *dev, u8 name, u32 value) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct ieee80211_crypt_data *crypt; -+ unsigned long flags; -+ int ret = 0; -+ -+ switch (name) { -+ case IPW_PARAM_WPA_ENABLED: -+ ret = ipw_wpa_enable(priv, value); -+ break; -+ case IPW_PARAM_TKIP_COUNTERMEASURES: -+ crypt = priv->ieee->crypt[priv->ieee->tx_keyidx]; -+ if (!crypt || !crypt->ops->set_flags || !crypt->ops->get_flags) { -+ IPW_WARNING("Can't set TKIP countermeasures: " -+ "crypt not set!\n"); -+ break; -+ } -+ -+ flags = crypt->ops->get_flags(crypt->priv); -+ -+ if (value) -+ flags |= IEEE80211_CRYPTO_TKIP_COUNTERMEASURES; -+ else -+ flags &= ~IEEE80211_CRYPTO_TKIP_COUNTERMEASURES; -+ -+ crypt->ops->set_flags(flags, crypt->priv); -+ -+ break; -+ case IPW_PARAM_DROP_UNENCRYPTED:{ -+ /* HACK: -+ * -+ * wpa_supplicant calls set_wpa_enabled when the driver -+ * is loaded and unloaded, regardless of if WPA is being -+ * used. No other calls are made which can be used to -+ * determine if encryption will be used or not prior to -+ * association being expected. If encryption is not being -+ * used, drop_unencrypted is set to false, else true -- we -+ * can use this to determine if the CAP_PRIVACY_ON bit should -+ * be set. -+ */ -+ struct ieee80211_security sec = { -+ .flags = -+ SEC_LEVEL | SEC_ENABLED,.enabled = -+ value,.level = -+ value ? SEC_LEVEL_1 : SEC_LEVEL_0, -+ }; -+ priv->ieee->drop_unencrypted = value; -+ if (priv->ieee->set_security) -+ priv->ieee->set_security(priv->ieee->dev, &sec); -+ break; -+ } -+ -+ case IPW_PARAM_PRIVACY_INVOKED: -+ priv->ieee->privacy_invoked = value; -+ break; -+ case IPW_PARAM_AUTH_ALGS: -+ ret = ipw_wpa_set_auth_algs(priv, value); -+ break; -+ case IPW_PARAM_IEEE_802_1X: -+ priv->ieee->ieee802_1x = value; -+ break; -+ default: -+ IPW_ERROR("%s: Unknown WPA param: %d\n", dev->name, name); -+ ret = -EOPNOTSUPP; -+ } -+ -+ return ret; -+} -+ -+static int ipw_wpa_mlme(struct net_device *dev, int command, int reason) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int ret = 0; -+ switch (command) { -+ case IPW_MLME_STA_DEAUTH: -+ ipw_disassociate(priv); -+ break; -+ case IPW_MLME_STA_DISASSOC: -+ ipw_disassociate(priv); -+ break; -+ default: -+ IPW_ERROR("%s: Unknown MLME request: %d\n", dev->name, command); -+ ret = -EOPNOTSUPP; -+ } -+ -+ return ret; -+} -+ -+static int ipw_wpa_set_wpa_ie(struct net_device *dev, -+ struct ipw_param *param, int plen) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct ieee80211_device *ieee = priv->ieee; -+ u8 *buf; -+ if (param->u.wpa_ie.len > MAX_WPA_IE_LEN || -+ (param->u.wpa_ie.len && param->u.wpa_ie.data == NULL)) -+ return -EINVAL; -+ if (param->u.wpa_ie.len) { -+ buf = kmalloc(param->u.wpa_ie.len, GFP_KERNEL); -+ if (buf == NULL) -+ return -ENOMEM; -+ memcpy(buf, param->u.wpa_ie.data, param->u.wpa_ie.len); -+ kfree(ieee->wpa_ie); -+ ieee->wpa_ie = buf; -+ ieee->wpa_ie_len = param->u.wpa_ie.len; -+ } else { -+ kfree(ieee->wpa_ie); -+ ieee->wpa_ie = NULL; -+ ieee->wpa_ie_len = 0; -+ } -+ -+ ipw_wpa_assoc_frame(priv, ieee->wpa_ie, ieee->wpa_ie_len); -+ return 0; -+} -+ -+/* implementation borrowed from hostap driver */ -+ -+static int ipw_wpa_set_encryption(struct net_device *dev, -+ struct ipw_param *param, int param_len) -+{ -+ int ret = 0; -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct ieee80211_device *ieee = priv->ieee; -+ struct ieee80211_crypto_ops *ops; -+ struct ieee80211_crypt_data **crypt; -+ struct ieee80211_security sec = { -+ .flags = 0, -+ }; -+ param->u.crypt.err = 0; -+ param->u.crypt.alg[IPW_CRYPT_ALG_NAME_LEN - 1] = '\0'; -+ if (param_len != -+ (int)((char *)param->u.crypt.key - (char *)param) + -+ param->u.crypt.key_len) { -+ IPW_DEBUG_INFO("Len mismatch %d, %d\n", param_len, -+ param->u.crypt.key_len); -+ return -EINVAL; -+ } -+ if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff -+ && param->sta_addr[2] == 0xff -+ && param->sta_addr[3] == 0xff -+ && param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) { -+ if (param->u.crypt.idx >= WEP_KEYS) -+ return -EINVAL; -+ crypt = &ieee->crypt[param->u.crypt.idx]; -+ } else { -+ return -EINVAL; -+ } -+ -+ sec.flags |= SEC_ENABLED | SEC_ENCRYPT; -+ if (strcmp(param->u.crypt.alg, "none") == 0) { -+ if (crypt) { -+ sec.enabled = 0; -+ sec.level = SEC_LEVEL_0; -+ sec.flags |= SEC_ENABLED | SEC_LEVEL; -+ ieee80211_crypt_delayed_deinit(ieee, crypt); -+ } -+ goto done; -+ } -+ sec.enabled = 1; -+ sec.encrypt = 1; -+ -+ if (strcmp(param->u.crypt.alg, "TKIP") == 0) -+ ieee->host_encrypt_msdu = 1; -+ -+ sec.flags |= SEC_ENABLED; -+ ops = ieee80211_get_crypto_ops(param->u.crypt.alg); -+ if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) { -+ request_module("ieee80211_crypt_wep"); -+ ops = ieee80211_get_crypto_ops(param->u.crypt.alg); -+ } else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) { -+ request_module("ieee80211_crypt_tkip"); -+ ops = ieee80211_get_crypto_ops(param->u.crypt.alg); -+ } else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) { -+ request_module("ieee80211_crypt_ccmp"); -+ ops = ieee80211_get_crypto_ops(param->u.crypt.alg); -+ } -+ if (ops == NULL) { -+ IPW_DEBUG_INFO("%s: unknown crypto alg '%s'\n", -+ dev->name, param->u.crypt.alg); -+ param->u.crypt.err = IPW_CRYPT_ERR_UNKNOWN_ALG; -+ ret = -EINVAL; -+ goto done; -+ } -+ -+ if (*crypt == NULL || (*crypt)->ops != ops) { -+ struct ieee80211_crypt_data *new_crypt; -+ ieee80211_crypt_delayed_deinit(ieee, crypt); -+ new_crypt = (struct ieee80211_crypt_data *) -+ kmalloc(sizeof(*new_crypt), GFP_KERNEL); -+ if (new_crypt == NULL) { -+ ret = -ENOMEM; -+ goto done; -+ } -+ memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); -+ new_crypt->ops = ops; -+ if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) -+ new_crypt->priv = -+ new_crypt->ops->init(param->u.crypt.idx); -+ if (new_crypt->priv == NULL) { -+ kfree(new_crypt); -+ param->u.crypt.err = IPW_CRYPT_ERR_CRYPT_INIT_FAILED; -+ ret = -EINVAL; -+ goto done; -+ } -+ -+ *crypt = new_crypt; -+ } -+ -+ if (param->u.crypt.key_len > 0 && (*crypt)->ops->set_key && -+ (*crypt)->ops->set_key(param->u.crypt.key, -+ param->u.crypt.key_len, -+ param->u.crypt.seq, (*crypt)->priv) < 0) { -+ IPW_DEBUG_INFO("%s: key setting failed\n", dev->name); -+ param->u.crypt.err = IPW_CRYPT_ERR_KEY_SET_FAILED; -+ ret = -EINVAL; -+ goto done; -+ } -+ -+ if (param->u.crypt.set_tx) { -+ ieee->tx_keyidx = param->u.crypt.idx; -+ sec.active_key = param->u.crypt.idx; -+ sec.flags |= SEC_ACTIVE_KEY; -+ } -+ -+ if (ops->name != NULL) { -+ if (strcmp(ops->name, "WEP") == 0) { -+ memcpy(sec.keys[param->u.crypt.idx], -+ param->u.crypt.key, param->u.crypt.key_len); -+ sec.key_sizes[param->u.crypt.idx] = -+ param->u.crypt.key_len; -+ sec.flags |= (1 << param->u.crypt.idx); -+ sec.flags |= SEC_LEVEL; -+ sec.level = SEC_LEVEL_1; -+ } else if (strcmp(ops->name, "TKIP") == 0) { -+ sec.flags |= SEC_LEVEL; -+ sec.level = SEC_LEVEL_2; -+ } else if (strcmp(ops->name, "CCMP") == 0) { -+ sec.flags |= SEC_LEVEL; -+ sec.level = SEC_LEVEL_3; -+ } -+ } -+ done: -+ if (ieee->set_security) -+ ieee->set_security(ieee->dev, &sec); -+ /* Do not reset port if card is in Managed mode since resetting will -+ * generate new IEEE 802.11 authentication which may end up in looping -+ * with IEEE 802.1X. If your hardware requires a reset after WEP -+ * configuration (for example... Prism2), implement the reset_port in -+ * the callbacks structures used to initialize the 802.11 stack. */ -+ if (ieee->reset_on_keychange && -+ ieee->iw_mode != IW_MODE_INFRA && -+ ieee->reset_port && ieee->reset_port(dev)) { -+ IPW_DEBUG_INFO("%s: reset_port failed\n", dev->name); -+ param->u.crypt.err = IPW_CRYPT_ERR_CARD_CONF_FAILED; -+ return -EINVAL; -+ } -+ -+ return ret; -+} -+ -+static int ipw_wpa_supplicant(struct net_device *dev, struct iw_point *p) -+{ -+ struct ipw_param *param; -+ int ret = 0; -+ IPW_DEBUG_INFO("wpa_supplicant: len=%d\n", p->length); -+ if (p->length < sizeof(struct ipw_param) || !p->pointer) -+ return -EINVAL; -+ param = (struct ipw_param *)kmalloc(p->length, GFP_KERNEL); -+ if (param == NULL) -+ return -ENOMEM; -+ if (copy_from_user(param, p->pointer, p->length)) { -+ kfree(param); -+ return -EFAULT; -+ } -+ -+ switch (param->cmd) { -+ -+ case IPW_CMD_SET_WPA_PARAM: -+ ret = -+ ipw_wpa_set_param(dev, param->u.wpa_param.name, -+ param->u.wpa_param.value); -+ break; -+ case IPW_CMD_SET_WPA_IE: -+ ret = ipw_wpa_set_wpa_ie(dev, param, p->length); -+ break; -+ case IPW_CMD_SET_ENCRYPTION: -+ ret = ipw_wpa_set_encryption(dev, param, p->length); -+ break; -+ case IPW_CMD_MLME: -+ ret = -+ ipw_wpa_mlme(dev, param->u.mlme.command, -+ param->u.mlme.reason); -+ break; -+ default: -+ IPW_ERROR("%s: Unknown WPA supplicant request: %d\n", -+ dev->name, param->cmd); -+ ret = -EOPNOTSUPP; -+ } -+ -+ if (ret == 0 && copy_to_user(p->pointer, param, p->length)) -+ ret = -EFAULT; -+ kfree(param); -+ return ret; -+} -+#endif -+ -+/* QoS -- untested and not fully plumbed */ -+//#define CONFIG_IPW3945_QOS -+#ifdef CONFIG_IPW3945_QOS -+ -+/* -+* background support to run QoS activate functionality -+*/ -+static int qos_enable = 0; -+static int qos_burst_enable = 0; -+static int qos_no_ack_mask = 0; -+static int qos_burst_CCK = 0; -+static int qos_burst_OFDM = 0; -+ -+static struct ieee80211_qos_parameters def_qos_parameters_OFDM = { -+ {QOS_TX0_CW_MIN_OFDM, QOS_TX1_CW_MIN_OFDM, -+ QOS_TX2_CW_MIN_OFDM, -+ QOS_TX3_CW_MIN_OFDM}, -+ {QOS_TX0_CW_MAX_OFDM, QOS_TX1_CW_MAX_OFDM, -+ QOS_TX2_CW_MAX_OFDM, -+ QOS_TX3_CW_MAX_OFDM}, -+ {QOS_TX0_AIFS, QOS_TX1_AIFS, QOS_TX2_AIFS, QOS_TX3_AIFS}, -+ {QOS_TX0_ACM, QOS_TX1_ACM, QOS_TX2_ACM, QOS_TX3_ACM}, -+ {QOS_TX0_TXOP_LIMIT_OFDM, QOS_TX1_TXOP_LIMIT_OFDM, -+ QOS_TX2_TXOP_LIMIT_OFDM, QOS_TX3_TXOP_LIMIT_OFDM} -+}; -+ -+static struct ieee80211_qos_parameters def_qos_parameters_CCK = { -+ {QOS_TX0_CW_MIN_CCK, QOS_TX1_CW_MIN_CCK, QOS_TX2_CW_MIN_CCK, -+ QOS_TX3_CW_MIN_CCK}, -+ {QOS_TX0_CW_MAX_CCK, QOS_TX1_CW_MAX_CCK, QOS_TX2_CW_MAX_CCK, -+ QOS_TX3_CW_MAX_CCK}, -+ {QOS_TX0_AIFS, QOS_TX1_AIFS, QOS_TX2_AIFS, QOS_TX3_AIFS}, -+ {QOS_TX0_ACM, QOS_TX1_ACM, QOS_TX2_ACM, QOS_TX3_ACM}, -+ {QOS_TX0_TXOP_LIMIT_CCK, QOS_TX1_TXOP_LIMIT_CCK, -+ QOS_TX2_TXOP_LIMIT_CCK, -+ QOS_TX3_TXOP_LIMIT_CCK} -+}; -+ -+static struct ieee80211_qos_parameters def_parameters_OFDM = { -+ {DEF_TX0_CW_MIN_OFDM, DEF_TX1_CW_MIN_OFDM, -+ DEF_TX2_CW_MIN_OFDM, -+ DEF_TX3_CW_MIN_OFDM}, -+ {DEF_TX0_CW_MAX_OFDM, DEF_TX1_CW_MAX_OFDM, -+ DEF_TX2_CW_MAX_OFDM, -+ DEF_TX3_CW_MAX_OFDM}, -+ {DEF_TX0_AIFS, DEF_TX1_AIFS, DEF_TX2_AIFS, DEF_TX3_AIFS}, -+ {DEF_TX0_ACM, DEF_TX1_ACM, DEF_TX2_ACM, DEF_TX3_ACM}, -+ {DEF_TX0_TXOP_LIMIT_OFDM, DEF_TX1_TXOP_LIMIT_OFDM, -+ DEF_TX2_TXOP_LIMIT_OFDM, DEF_TX3_TXOP_LIMIT_OFDM} -+}; -+ -+static struct ieee80211_qos_parameters def_parameters_CCK = { -+ {DEF_TX0_CW_MIN_CCK, DEF_TX1_CW_MIN_CCK, DEF_TX2_CW_MIN_CCK, -+ DEF_TX3_CW_MIN_CCK}, -+ {DEF_TX0_CW_MAX_CCK, DEF_TX1_CW_MAX_CCK, DEF_TX2_CW_MAX_CCK, -+ DEF_TX3_CW_MAX_CCK}, -+ {DEF_TX0_AIFS, DEF_TX1_AIFS, DEF_TX2_AIFS, DEF_TX3_AIFS}, -+ {DEF_TX0_ACM, DEF_TX1_ACM, DEF_TX2_ACM, DEF_TX3_ACM}, -+ {DEF_TX0_TXOP_LIMIT_CCK, DEF_TX1_TXOP_LIMIT_CCK, -+ DEF_TX2_TXOP_LIMIT_CCK, -+ DEF_TX3_TXOP_LIMIT_CCK} -+}; -+ -+static int ipw_send_qos_params_command(struct ipw_priv *priv, struct ieee80211_qos_parameters -+ *qos_param) -+{ -+ struct ipw_cmd cmd = { -+ .hdr.cmd = REPLY_QOS_PARAM,.meta.len = -+ sizeof(struct ipw_qosparam_cmd), -+ }; -+ int i; -+ for (i = 0; i < IPW_TX_QUEUE_4; i++) { -+ cmd.cmd.qosparam.ac[i].dot11CWmin = -+ qos_param[QOS_PARAM_SET_ACTIVE].cw_min[i]; -+ cmd.cmd.qosparam.ac[i].dot11CWmax = -+ qos_param[QOS_PARAM_SET_ACTIVE].cw_max[i]; -+ cmd.cmd.qosparam.ac[i].dot11AIFSN = -+ qos_param[QOS_PARAM_SET_ACTIVE].aifs[i]; -+ cmd.cmd.qosparam.ac[i].edca_txop = -+ qos_param[QOS_PARAM_SET_ACTIVE].tx_op_limit[i]; -+ IPW_DEBUG_HC -+ ("Qos for Queue %d min %d max %d, aifs %d txop %d\n", -+ i, cmd.cmd.qosparam.ac[i].dot11CWmin, -+ cmd.cmd.qosparam.ac[i].dot11CWmax, -+ cmd.cmd.qosparam.ac[i].dot11AIFSN, -+ cmd.cmd.qosparam.ac[i].edca_txop); -+ } -+ -+ return ipw_send_cmd(priv, &cmd); -+} -+ -+/* -+* This function set up the firmware to support QoS. It sends -+* IPW_CMD_QOS_PARAMETERS and IPW_CMD_WME_INFO -+*/ -+static int ipw_qos_activate(struct ipw_priv *priv, struct ieee80211_qos_data -+ *qos_network_data) -+{ -+ int ret = 0; -+ struct ieee80211_qos_parameters qos_parameters[QOS_QOS_SETS]; -+ struct ieee80211_qos_parameters *active_one = NULL; -+ u32 size = sizeof(struct ieee80211_qos_parameters); -+ u32 burst_duration; -+ int i; -+ u8 type; -+ if ((priv == NULL)) -+ return -1; -+ -+ /* determine modulation type of the current network or -+ * the card current mode */ -+ type = (priv->status & STATUS_ASSOCIATED) ? -+ priv->assoc_request.ieee_mode : priv->ieee->mode; -+ -+ active_one = &(qos_parameters[QOS_PARAM_SET_DEF_CCK]); -+ memcpy(active_one, priv->qos_data.def_qos_parm_CCK, size); -+ active_one = &(qos_parameters[QOS_PARAM_SET_DEF_OFDM]); -+ memcpy(active_one, priv->qos_data.def_qos_parm_OFDM, size); -+ -+ burst_duration = -+ (priv->ieee-> -+ modulation & IEEE80211_OFDM_MODULATION) ? priv->qos_data. -+ burst_duration_OFDM : priv->qos_data.burst_duration_CCK; -+ -+ if (!qos_network_data) { -+ if ((type == IEEE_B) -+ || ((priv->rxon.flags & RXON_FLG_SHORT_SLOT_MSK) -+ == 0)) { -+ IPW_DEBUG_QOS("QoS activate network mode %d\n", type); -+ active_one = &def_parameters_CCK; -+ } else { -+ active_one = &def_parameters_OFDM; -+ } -+ -+ memcpy(&(qos_parameters[QOS_PARAM_SET_ACTIVE]), -+ active_one, size); -+ for (i = 0; i < QOS_QUEUE_NUM; ++i) { -+ qos_parameters[QOS_PARAM_SET_ACTIVE]. -+ tx_op_limit[i] = (u16) burst_duration; -+ } -+ } else if ((priv->ieee->iw_mode != IW_MODE_INFRA)) { -+ if (type == IEEE_B) { -+ IPW_DEBUG_QOS -+ ("QoS activate IBSS nework mode %d\n", type); -+ if (priv->qos_data.qos_enable == 0) -+ active_one = &def_parameters_CCK; -+ else -+ active_one = priv->qos_data.def_qos_parm_CCK; -+ } else { -+ if (priv->qos_data.qos_enable == 0) -+ active_one = &def_parameters_OFDM; -+ else -+ active_one = priv->qos_data.def_qos_parm_OFDM; -+ } -+ memcpy(&(qos_parameters[QOS_PARAM_SET_ACTIVE]), -+ active_one, size); -+ } else { -+ qos_network_data->old_param_count = -+ qos_network_data->param_count; -+ if (priv->qos_data.qos_enable == 0) { -+ if ((type == IEEE_B) || -+ ((priv->rxon. -+ flags & RXON_FLG_SHORT_SLOT_MSK) == 0)) { -+ active_one = &def_parameters_CCK; -+ } else { -+ active_one = &def_parameters_OFDM; -+ } -+ memcpy(& -+ (qos_parameters[QOS_PARAM_SET_ACTIVE]), -+ active_one, size); -+ } else { -+ unsigned long flags; -+ int active; -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ active_one = &(qos_network_data->parameters); -+ qos_network_data->old_param_count = -+ qos_network_data->param_count; -+ memcpy(& -+ (qos_parameters[QOS_PARAM_SET_ACTIVE]), -+ active_one, size); -+ active = qos_network_data->supported; -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ if (active == 0) { -+ for (i = 0; i < QOS_QUEUE_NUM; ++i) { -+ qos_parameters -+ [QOS_PARAM_SET_ACTIVE]. -+ tx_op_limit[i] = -+ (u16) burst_duration; -+ } -+ } -+ } -+ } -+ -+ IPW_DEBUG_QOS("QoS sending IPW_CMD_QOS_PARAMETERS\n"); -+ ret = ipw_send_qos_params_command(priv, -+ (struct ieee80211_qos_parameters *) -+ &(qos_parameters[0])); -+ if (ret) -+ IPW_DEBUG_QOS("QoS IPW_CMD_QOS_PARAMETERS failed: %d\n", ret); -+ -+ return ret; -+} -+ -+static void ipw_bg_qos_activate(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv == NULL) -+ return; -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ if (priv->status & STATUS_ASSOCIATED) { -+ ipw_qos_activate(priv, &(priv->assoc_network->qos_data)); -+ } -+ mutex_unlock(&priv->mutex); -+} -+ -+/* -+* Handle management frame beacon and probe response -+*/ -+static int ipw_qos_handle_probe_response(struct ipw_priv *priv, -+ int active_network, -+ struct ieee80211_network -+ *network) -+{ -+ u32 size = sizeof(struct ieee80211_qos_parameters); -+ if ((network->capability & WLAN_CAPABILITY_IBSS)) -+ network->qos_data.active = network->qos_data.supported; -+ if (network->flags & NETWORK_HAS_QOS_MASK) { -+ if (active_network -+ && (network->flags & NETWORK_HAS_QOS_PARAMETERS)) -+ network->qos_data.active = network->qos_data.supported; -+ if ((network->qos_data.active == 1) -+ && (active_network) -+ && (network->flags & NETWORK_HAS_QOS_PARAMETERS) -+ && (network->qos_data.old_param_count != -+ network->qos_data.param_count)) { -+ network->qos_data.old_param_count = -+ network->qos_data.param_count; -+ queue_work(priv->workqueue, &priv->qos_activate); -+ IPW_DEBUG_QOS -+ ("QoS parameters change call qos_activate\n"); -+ } -+ } else { -+ if ((priv->ieee->mode == IEEE_B) || -+ (network->mode == IEEE_B) || -+ ((priv->rxon.flags & RXON_FLG_SHORT_SLOT_MSK) == 0)) { -+ memcpy(&(network->qos_data.parameters), -+ &def_parameters_CCK, size); -+ } else { -+ memcpy(&(network->qos_data.parameters), -+ &def_parameters_OFDM, size); -+ } -+ if ((network->qos_data.active == 1) -+ && (active_network)) { -+ IPW_DEBUG_QOS("QoS was disabled call qos_activate \n"); -+ queue_work(priv->workqueue, &priv->qos_activate); -+ } -+ -+ network->qos_data.active = 0; -+ network->qos_data.supported = 0; -+ } -+ return 0; -+} -+ -+static int ipw_send_qos_info_command(struct ipw_priv *priv, struct ieee80211_qos_information_element -+ *qos_param) -+{ -+ return 0; -+} -+ -+/* -+* send IPW_CMD_WME_INFO to the firmware -+*/ -+static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 }; -+ -+static int ipw_qos_set_info_element(struct ipw_priv *priv) -+{ -+ int ret = 0; -+ struct ieee80211_qos_information_element qos_info; -+ if (priv == NULL) -+ return -1; -+ qos_info.elementID = QOS_ELEMENT_ID; -+ qos_info.length = sizeof(struct ieee80211_qos_information_element) - 2; -+ qos_info.version = QOS_VERSION_1; -+ qos_info.ac_info = 0; -+ memcpy(qos_info.qui, qos_oui, QOS_OUI_LEN); -+ qos_info.qui_type = QOS_OUI_TYPE; -+ qos_info.qui_subtype = QOS_OUI_INFO_SUB_TYPE; -+ ret = ipw_send_qos_info_command(priv, &qos_info); -+ if (ret != 0) { -+ IPW_DEBUG_QOS("QoS error calling ipw_send_qos_info_command\n"); -+ } -+ return ret; -+} -+ -+/* -+* Set the QoS parameter with the association request structure -+*/ -+static int ipw_qos_association(struct ipw_priv *priv, -+ struct ieee80211_network *network) -+{ -+ int ret = 0; -+ struct ieee80211_qos_data *qos_data = NULL; -+ if ((priv == NULL) || (network == NULL)) -+ return -1; -+ qos_data = &(network->qos_data); -+ if ((priv->ieee->iw_mode != IW_MODE_INFRA)) { -+ struct ieee80211_qos_data ibss_data; -+ network->capability |= WLAN_CAPABILITY_IBSS; -+ qos_data = &ibss_data; -+ qos_data->supported = 1; -+ qos_data->active = 1; -+ } -+ -+ ret = ipw_qos_activate(priv, qos_data); -+ if ((priv->qos_data.qos_enable == 1) -+ && (qos_data->supported == 1)) { -+ IPW_DEBUG_QOS("QoS will be enabled for this association\n"); -+ priv->assoc_request.policy_support |= HC_QOS_SUPPORT_ASSOC; -+ ret = ipw_qos_set_info_element(priv); -+ } else { -+ priv->assoc_request.policy_support &= ~HC_QOS_SUPPORT_ASSOC; -+ } -+ -+ return ret; -+} -+ -+/* -+* handling the beacon responses. if QoS setting of the network is different -+* from the the associated setting, adjust the QoS setting -+*/ -+static int ipw_qos_association_resp(struct ipw_priv *priv, -+ struct ieee80211_network *network) -+{ -+ int ret = 0; -+ unsigned long flags; -+ u32 size = sizeof(struct ieee80211_qos_parameters); -+ int set_qos_param = 0; -+ -+ //todoG add support for QoS -+ return ret; -+ -+ if ((priv == NULL) || (network == NULL) -+ || (priv->assoc_network == NULL)) -+ -+ return ret; -+ if (!(priv->status & STATUS_ASSOCIATED)) -+ return ret; -+ if ((priv->ieee->iw_mode != IW_MODE_INFRA)) { -+ return ret; -+ } -+ -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ if (network->flags & NETWORK_HAS_QOS_PARAMETERS) { -+ memcpy(&(priv->assoc_network->qos_data), -+ &(network->qos_data), sizeof(struct ieee80211_qos_data)); -+ priv->assoc_network->qos_data.active = 1; -+ if ((network->qos_data.old_param_count != -+ network->qos_data.param_count)) { -+ set_qos_param = 1; -+ network->qos_data.old_param_count = -+ network->qos_data.param_count; -+ } -+ -+ } else { -+ if ((network->mode == IEEE_B) -+ || (priv->ieee->mode == IEEE_B) -+ || ((priv->rxon.flags & RXON_FLG_SHORT_SLOT_MSK) -+ == 0)) { -+ memcpy(& -+ (priv->assoc_network->qos_data. -+ parameters), &def_parameters_CCK, size); -+ } else { -+ memcpy(& -+ (priv->assoc_network->qos_data. -+ parameters), &def_parameters_OFDM, size); -+ } -+ priv->assoc_network->qos_data.active = 0; -+ priv->assoc_network->qos_data.supported = 0; -+ set_qos_param = 1; -+ } -+ -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ if (set_qos_param == 1) -+ queue_work(priv->workqueue, &priv->qos_activate); -+ return ret; -+} -+ -+/* -+* Initialize the setting of QoS global -+*/ -+static int ipw_qos_init(struct ipw_priv *priv, int enable, -+ int burst_enable, u32 burst_duration_CCK, -+ u32 burst_duration_OFDM) -+{ -+ int ret = 0; -+ if (priv == NULL) -+ return -1; -+ priv->qos_data.qos_enable = enable; -+ if (priv->qos_data.qos_enable) { -+ priv->qos_data.def_qos_parm_CCK = &def_qos_parameters_CCK; -+ priv->qos_data.def_qos_parm_OFDM = &def_qos_parameters_OFDM; -+ IPW_DEBUG_QOS("QoS is enabled\n"); -+ } else { -+ priv->qos_data.def_qos_parm_CCK = &def_parameters_CCK; -+ priv->qos_data.def_qos_parm_OFDM = &def_parameters_OFDM; -+ IPW_DEBUG_QOS("QoS is not enabled\n"); -+ } -+ -+ priv->qos_data.burst_enable = burst_enable; -+ if (burst_enable) { -+ priv->qos_data.burst_duration_CCK = burst_duration_CCK; -+ priv->qos_data.burst_duration_OFDM = burst_duration_OFDM; -+ } else { -+ priv->qos_data.burst_duration_CCK = 0; -+ priv->qos_data.burst_duration_OFDM = 0; -+ } -+ -+ return ret; -+} -+#endif /* CONFIG_IPW3945_QOS */ -+ -+/* -+* map the packet priority to the right TX Queue -+*/ -+static int ipw_get_tx_queue_number(struct ipw_priv *priv, u16 priority) -+{ -+#ifdef CONFIG_IPW3945_QOS -+ if ((priority > 7) || !priv->qos_data.qos_enable) -+ priority = 0; -+#else -+ if (priority > 7) -+ priority = 0; -+#endif -+ -+ return from_priority_to_tx_queue[priority] - 1; -+} -+ -+#ifdef CONFIG_IPW3945_QOS -+/* -+* add QoS parameter to the TX command -+*/ -+static int ipw_qos_set_tx_queue_command(struct ipw_priv *priv, -+ u16 priority, -+ struct ipw_tx_cmd *tfd, u8 unicast) -+{ -+ int ret = 0; -+ int tx_queue_id = 0; -+ struct ieee80211_qos_data *qos_data = NULL; -+ int active, supported; -+ unsigned long flags; -+ if ((priv == NULL) || (tfd == NULL) -+ || !(priv->status & STATUS_ASSOCIATED)) -+ return 0; -+ if (priv->assoc_network == NULL) -+ return 0; -+ qos_data = &(priv->assoc_network->qos_data); -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ if (priv->ieee->iw_mode != IW_MODE_INFRA) { -+ if (unicast == 0) { -+ qos_data->active = 0; -+ } else { -+ qos_data->active = qos_data->supported; -+ } -+ } -+ -+ active = qos_data->active; -+ supported = qos_data->supported; -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ IPW_DEBUG_QOS -+ ("QoS %d network is QoS active %d supported %d unicast %d\n", -+ priv->qos_data.qos_enable, active, supported, unicast); -+ if ((active == 1) && (priv->qos_data.qos_enable == 1)) { -+ ret = from_priority_to_tx_queue[priority]; -+ tx_queue_id = ret - 1; -+ IPW_DEBUG_QOS("QoS packet priority is %d \n", priority); -+ if ((priority <= 7)) { -+//todoG move to 3945 format -+/* -+ tfd->tx_flags_ext |= DCT_FLAG_EXT_QOS_ENABLED; -+ tfd->tfd.tfd_26.mchdr.qos_ctl = priority; -+ tfd->tfd.tfd_26.mchdr.frame_ctl |= IEEE80211_STYPE_QOS_DATA; -+ -+ if( (priv->qos_data.qos_no_ack_mask & (1UL<tx_flags &= ~DCT_FLAG_ACK_REQD; -+ tfd->tfd.tfd_26.mchdr.qos_ctl |= CTRL_QOS_NO_ACK; -+ -+ } -+*/ -+ } -+ -+ } -+ return ret; -+} -+#endif -+ -+#define STATUS_SUCCESS 0 -+#define STATUS_FAIL 1 -+ -+static void ipw_auth_work(void *data) -+{ -+ struct ipw_priv *priv = data; -+ enum connection_manager_assoc_states *state = &priv->auth_state; -+ struct ieee80211_auth *auth = priv->auth_frame; -+ unsigned long flags; -+ int status; -+ -+ mutex_lock(&priv->mutex); -+ spin_lock_irqsave(&priv->lock, flags); -+ if (*state >= CMAS_INIT && *state <= CMAS_RX_AUTH_SEQ_4) { -+ *state = CMAS_RX_AUTH_SEQ_2; -+ -+ if (auth->algorithm == WLAN_AUTH_OPEN && -+ *state <= CMAS_RX_AUTH_SEQ_2) { -+ BUG_ON(!priv->auth_frame); -+ status = auth->status; -+ kfree(priv->auth_frame); -+ priv->auth_frame = NULL; -+ -+ if (status == STATUS_SUCCESS) { -+ goto fill_assoc; -+ } -+ *state = CMAS_INIT; -+ spin_unlock_irqrestore(&priv->lock, flags); -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_ASSOC("AUTH_OPEN fail\n"); -+ return; -+ } -+ -+ if (auth->algorithm == WLAN_AUTH_SHARED_KEY && -+ *state <= CMAS_RX_AUTH_SEQ_4) { -+ if (auth->transaction == 2) { -+ struct ieee80211_auth *auth2; -+#if IPW3945_COMPAT >= 2 -+ BUG_ON(!priv->auth_frame); -+ auth2 = priv->auth_frame; -+ auth2->header.seq_ctl = 0; -+ -+ memcpy(auth2->header.addr1, priv->bssid, 6); -+ memcpy(auth2->header.addr2, priv->mac_addr, 6); -+ memcpy(auth2->header.addr3, -+ priv->ieee->bssid, 6); -+ auth2->algorithm = WLAN_AUTH_SHARED_KEY; -+ auth2->transaction = 3; -+ auth2->status = 0; -+ -+ ieee80211_tx_frame(priv->ieee, -+ (struct ieee80211_hdr *) -+ priv->auth_frame, -+ IEEE80211_3ADDR_LEN, -+ sizeof(*auth2) + 130, 1); -+#else -+ struct sk_buff *skb_auth = NULL; -+ int tx_key = -+ !(priv->ieee->sec. -+ flags & SEC_ACTIVE_KEY) ? 0 : priv->ieee-> -+ sec.active_key; -+ struct ieee80211_crypt_data *crypt = -+ priv->ieee->crypt[tx_key]; -+ -+ if (!crypt) { -+ IPW_DEBUG_ASSOC("no crypt config " -+ "shared_key auth failed\n"); -+ *state = CMAS_INIT; -+ goto out_fail2; -+ } -+ -+ skb_auth = -+ dev_alloc_skb(sizeof(struct ieee80211_auth) -+ + 138); -+ if (!skb_auth) { -+ IPW_DEBUG_ASSOC("can't alloc skb " -+ "shared_key auth failed\n"); -+ *state = CMAS_INIT; -+ goto out_fail2; -+ } -+ -+ skb_reserve(skb_auth, 4); -+ skb_put(skb_auth, sizeof(*auth) + 130); -+ auth2 = (struct ieee80211_auth *) -+ skb_auth->data; -+ auth2->header.frame_ctl = -+ IEEE80211_FTYPE_MGMT | -+ IEEE80211_STYPE_AUTH | -+ IEEE80211_FCTL_PROTECTED; -+ auth2->header.seq_ctl = 0; -+ BUG_ON(!priv->auth_frame); -+ -+ memcpy(auth2->header.addr1, priv->bssid, 6); -+ memcpy(auth2->header.addr2, priv->mac_addr, 6); -+ memcpy(auth2->header.addr3, -+ priv->ieee->bssid, 6); -+ auth2->algorithm = WLAN_AUTH_SHARED_KEY; -+ auth2->transaction = 3; -+ auth2->status = 0; -+ -+ memcpy(auth2->info_element, -+ priv->auth_frame->info_element, 130); -+ -+ atomic_inc(&crypt->refcnt); -+ if (crypt->ops->encrypt_mpdu) -+ crypt->ops-> -+ encrypt_mpdu(skb_auth, -+ IEEE80211_3ADDR_LEN, -+ crypt->priv); -+ atomic_dec(&crypt->refcnt); -+ -+ memcpy(priv->auth_frame, -+ skb_auth->data, skb_auth->len); -+ -+ ieee80211_tx_frame(priv->ieee, -+ (struct ieee80211_hdr *) -+ priv->auth_frame, -+ skb_auth->len); -+ dev_kfree_skb_any(skb_auth); -+ out_fail2: -+#endif -+ spin_unlock_irqrestore(&priv->lock, flags); -+ mutex_unlock(&priv->mutex); -+ return; -+ } else if (auth->transaction == 4) { -+ BUG_ON(!priv->auth_frame); -+ status = auth->status; -+ kfree(priv->auth_frame); -+ priv->auth_frame = NULL; -+ if (status == STATUS_SUCCESS) { -+ goto fill_assoc; -+ } -+ -+ *state = CMAS_INIT; -+ spin_unlock_irqrestore(&priv->lock, flags); -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_ASSOC("AUTH_SHARED_KEY fail\n"); -+ return; -+ } -+ } -+ } -+ spin_unlock_irqrestore(&priv->lock, flags); -+ mutex_unlock(&priv->mutex); -+ return; -+ -+ fill_assoc: -+ priv->auth_state = CMAS_AUTHENTICATED; -+ spin_unlock_irqrestore(&priv->lock, flags); -+ mutex_unlock(&priv->mutex); -+ if (!(priv->status & STATUS_ASSOCIATED)) { -+ struct ipw_frame *frame = ipw_get_free_frame(priv); -+ int len; -+ -+ if (!frame) { -+ IPW_ERROR("Could not allocate frame for auth work.\n"); -+ return; -+ } -+ -+ len = ipw_fill_association_req(priv, &frame->u.frame, -+ sizeof(frame->u)); -+ if (len) { -+ IPW_DEBUG_11H("Sending %d bytes.\n", len); -+ spin_lock_irqsave(&priv->lock, flags); -+#if IPW3945_COMPAT >= 2 -+ ieee80211_tx_frame(priv->ieee, &frame->u.frame, 0, len, -+ 0); -+#else -+ ieee80211_tx_frame(priv->ieee, &frame->u.frame, len); -+#endif -+ spin_unlock_irqrestore(&priv->lock, flags); -+ } -+ -+ ipw_free_frame(priv, frame); -+ } -+} -+ -+static int ipw_handle_probe_request(struct net_device *dev, struct ieee80211_probe_request -+ *frame, struct ieee80211_rx_stats *stats) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int rc = 0; -+ u16 left; -+ struct ieee80211_info_element *info_element; -+ struct ipw_frame *out_frame; -+ int len; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return 0; -+ -+ if (((priv->status & STATUS_ASSOCIATED) == 0) -+ || (priv->ieee->iw_mode != IW_MODE_ADHOC)) -+ return rc; -+ -+ /* ignore proble recieved during scan period on diff channels */ -+ if (stats->received_channel != priv->channel) -+ return rc; -+ /* if direct scan make sure ssid are the same */ -+ info_element = frame->info_element; -+ left = stats->len - sizeof(*frame); -+ while (left >= sizeof(*info_element)) { -+ if (sizeof(*info_element) + info_element->len > left) { -+ break; -+ } -+ -+ if (info_element->id == MFIE_TYPE_SSID) { -+ if (info_element->len == 0) { -+ break; -+ } -+ -+ if (priv->essid_len != info_element->len) -+ return rc; -+ if (memcmp -+ (priv->essid, info_element->data, -+ info_element->len) != 0) -+ return rc; -+ break; -+ } -+ left -= sizeof(struct ieee80211_info_element) + -+ info_element->len; -+ info_element = (struct ieee80211_info_element *) -+ &info_element->data[info_element->len]; -+ } -+ -+ out_frame = ipw_get_free_frame(priv); -+ -+ if (!out_frame) { -+ IPW_ERROR("Could not allocate frame for auth work.\n"); -+ return -ENOMEM; -+ } -+ -+ len = ipw_fill_beacon_frame(priv, &out_frame->u.frame, -+ frame->header.addr2, sizeof(out_frame->u)); -+ -+ if (len) { -+ IPW_DEBUG_11H("Sending %d bytes.\n", len); -+ out_frame->u.frame.frame_ctl = IEEE80211_FTYPE_MGMT | -+ IEEE80211_STYPE_PROBE_RESP; -+#if IPW3945_COMPAT >= 2 -+ ieee80211_tx_frame(priv->ieee, &out_frame->u.frame, 0, len, 0); -+#else -+ ieee80211_tx_frame(priv->ieee, &out_frame->u.frame, len); -+#endif -+ } -+ -+ ipw_free_frame(priv, out_frame); -+ -+ return 0; -+} -+ -+static int ipw_handle_auth(struct net_device *dev, struct ieee80211_auth *auth) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int size = sizeof(struct ieee80211_auth); -+ -+ IPW_DEBUG_INFO -+ ("auth frame algorithm %d transaction %d status %d \n", -+ auth->algorithm, auth->transaction, auth->status); -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return 0; -+ -+ if (!(priv->status & STATUS_ASSOCIATED) && -+ !(priv->status & STATUS_ASSOCIATING)) -+ return 0; -+ -+ if ((priv->auth_state <= CMAS_INIT) -+ && (priv->auth_frame == NULL)) { -+ priv->auth_frame = kmalloc(size + 138, GFP_ATOMIC); -+ if (priv->auth_frame == NULL) { -+ IPW_DEBUG_ASSOC("can't alloc auth frame\n"); -+ return 0; -+ } -+ } -+ -+ if (priv->auth_state != CMAS_AUTHENTICATED) { -+ BUG_ON(!priv->auth_frame); -+ if (auth->transaction == 2 -+ && auth->algorithm == WLAN_AUTH_SHARED_KEY) -+ size += 138; -+ memcpy(priv->auth_frame, auth, size); -+ -+ queue_work(priv->workqueue, &priv->auth_work); -+ } -+ -+ return 0; -+} -+ -+static int ipw_handle_deauth(struct net_device *dev, -+ struct ieee80211_deauth *deauth) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ IPW_DEBUG_INFO("deauthentication reasoncode %x\n", deauth->reason); -+ queue_work(priv->workqueue, &priv->disassociate); -+ return 0; -+ /* -+ struct ieee80211_auth frame = { -+ .header.frame_ctl = IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH, -+ .transaction = 1, -+ }; -+ -+ if (!(priv->status & STATUS_ASSOCIATED)) -+ return 0; -+ -+ frame.algorithm = (priv->assoc_request.auth_type == AUTH_SHARED_KEY) ? -+ WLAN_AUTH_SHARED_KEY : WLAN_AUTH_OPEN; -+ -+ memcpy(frame.header.addr1, priv->bssid, ETH_ALEN); -+ memcpy(frame.header.addr2, priv->mac_addr, ETH_ALEN); -+ memcpy(frame.header.addr3, priv->ieee->bssid, ETH_ALEN); -+ -+ priv->auth_state = CMAS_INIT; -+ -+ ieee80211_tx_frame(priv->ieee, -+ (struct ieee80211_hdr *)&frame, sizeof(frame)); -+ -+ return 0; -+ */ -+} -+ -+static int ipw_try_merge_network(struct ipw_priv *priv, int active_network, struct ieee80211_network -+ *network) -+{ -+ if ((priv->status & STATUS_ASSOCIATED) && -+ (priv->ieee->iw_mode == IW_MODE_ADHOC) -+ && (!active_network)) { -+ if (memcmp(network->bssid, priv->bssid, ETH_ALEN)) { -+ if ((network->capability & WLAN_CAPABILITY_IBSS) -+ && !(network->flags & NETWORK_EMPTY_ESSID)) { -+ if ((network->ssid_len == -+ priv->assoc_network->ssid_len) -+ && !memcmp(network->ssid, -+ priv->assoc_network-> -+ ssid, network->ssid_len)) { -+ queue_work(priv->workqueue, -+ &priv->merge_networks); -+ } -+ -+ } -+ } -+ } -+ -+ return 0; -+} -+ -+static int ipw_handle_probe_response(struct net_device *dev, struct ieee80211_probe_response -+ *probe, struct ieee80211_network -+ *network) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int active_network = 0; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return 0; -+ -+ if (priv->status & STATUS_ASSOCIATED) { -+ if (!memcmp -+ (network->bssid, priv->assoc_request.bssid, ETH_ALEN)) -+ active_network = 1; -+ } -+#ifdef CONFIG_IPW3945_QOS -+ ipw_qos_handle_probe_response(priv, active_network, network); -+#endif -+ -+ if (active_network) { -+ priv->missed_adhoc_beacons = 0; -+ -+ ipw_card_bss_active_changed_notify(priv, network); -+ -+ if (priv->ieee->iw_mode == IW_MODE_ADHOC) -+ ipw_add_station(priv, probe->header.addr2, 0, -+ CMD_ASYNC | CMD_NO_LOCK); -+ } else -+ ipw_try_merge_network(priv, active_network, network); -+ -+ return 0; -+} -+ -+static inline int is_same_network(struct ieee80211_network *src, -+ struct ieee80211_network *dst) -+{ -+ /* A network is a match only if the channel, BSSID, and ESSID all match. -+ * To support networks (beacons don't contain SSID), -+ * if either of the networks being compared has ssid_length == 0, -+ * we don't bother comparing the ESSID itself. */ -+ if ((src->channel != dst->channel) || -+ memcmp(src->bssid, dst->bssid, ETH_ALEN)) -+ return 0; -+ -+ if ((src->ssid_len == 0) || (dst->ssid_len == 0)) -+ return 1; -+ -+ return ((src->ssid_len == dst->ssid_len) && -+ !memcmp(src->ssid, dst->ssid, src->ssid_len)); -+} -+ -+static int is_network_beacon(struct ieee80211_network *src, -+ struct ieee80211_network *dst) -+{ -+ return ((src->channel == dst->channel) && -+ !memcmp(src->bssid, dst->bssid, ETH_ALEN)); -+} -+ -+static int ipw_handle_beacon(struct net_device *dev, -+ struct ieee80211_beacon *beacon, -+ struct ieee80211_network *network) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return 0; -+ -+ if ((priv->status & STATUS_ASSOCIATED) && -+ is_network_beacon(priv->assoc_network, network)) { -+ -+ priv->missed_adhoc_beacons = 0; -+ -+ ipw_card_bss_active_changed_notify(priv, network); -+ -+ if (priv->ieee->iw_mode == IW_MODE_ADHOC) -+ ipw_add_station(priv, beacon->header.addr2, 0, -+ CMD_ASYNC | CMD_NO_LOCK); -+ else if ((priv->ieee->iw_mode == IW_MODE_INFRA) && -+ !(priv->config & CFG_NO_ROAMING)) -+ /* roaming is only in managed mode */ -+ mod_timer(&priv->roaming_wdt, jiffies + -+ priv->roaming_threshold * -+ BEACON_JIFFIES(priv)); -+ -+ mod_timer(&priv->disassociate_wdt, jiffies + -+ priv->missed_beacon_threshold * BEACON_JIFFIES(priv)); -+ } else -+ ipw_try_merge_network(priv, 0, network); -+ -+ return 0; -+} -+ -+static int ipw_handle_assoc_response(struct net_device *dev, struct ieee80211_assoc_response -+ *resp, struct ieee80211_network -+ *network) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return 0; -+ -+ if (resp->status != 0) { -+ IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC, -+ "association failed: '%s' " MAC_FMT -+ " Reason: %s (%d)\n", -+ escape_essid(priv->essid, priv->essid_len), -+ MAC_ARG(priv->bssid), -+ ipw_get_status_code(resp->status), resp->status); -+ return 0; -+ } -+ -+ if (priv->status & STATUS_ASSOCIATED) { -+ if (is_same_network(priv->assoc_network, network)) -+ IPW_DEBUG_INFO -+ ("Association response received for " -+ "current network ('%s'). Ignoring.\n", -+ escape_essid(network->ssid, network->ssid_len)); -+ else -+ IPW_DEBUG_INFO -+ ("Association response received for " -+ "invalid network ('%s'). Ignoring.\n", -+ escape_essid(network->ssid, network->ssid_len)); -+ return 0; -+ } -+ -+ IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC, -+ "associated: '%s' " MAC_FMT "\n", -+ escape_essid(priv->essid, priv->essid_len), -+ MAC_ARG(priv->bssid)); -+ -+ cancel_delayed_work(&priv->associate_timeout); -+ -+ priv->assoc_request.assoc_id = resp->aid & 0x3fff; -+ priv->assoc_request.capability = network->capability; -+ queue_work(priv->workqueue, &priv->post_associate); -+#ifdef CONFIG_IPW3945_QOS -+ ipw_qos_association_resp(priv, network); -+#endif -+ return 0; -+} -+ -+static void ipw_bg_report_work(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_send_daemon_sync(priv, DAEMON_SYNC_MEASURE_REPORT, -+ sizeof(priv->measure_report), -+ &priv->measure_report); -+ mutex_unlock(&priv->mutex); -+} -+ -+static int ipw_handle_disassoc(struct net_device *dev, -+ struct ieee80211_disassoc *disassoc) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ IPW_DEBUG_INFO("disassociation reasoncode %d: %s\n", -+ disassoc->reason, ipw_get_status_code(disassoc->reason)); -+ queue_work(priv->workqueue, &priv->disassociate); -+ return 0; -+} -+ -+/***************************************************************/ -+ -+static int ipw_associate_network(struct ipw_priv *priv, -+ struct ieee80211_network *network, -+ u32 rates_mask, int roaming) -+{ -+ int err; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ -+ priv->assoc_network = NULL; -+ -+ if (!(priv->config & CFG_STATIC_ESSID)) { -+ priv->essid_len = min(network->ssid_len, -+ (u8) IW_ESSID_MAX_SIZE); -+ memcpy(priv->essid, network->ssid, priv->essid_len); -+ } -+ -+ network->last_associate = jiffies; -+ memset(&priv->assoc_request, 0, sizeof(priv->assoc_request)); -+ priv->assoc_request.channel = network->channel; -+ if ((priv->capability & CAP_PRIVACY_ON) && -+ (priv->capability & CAP_SHARED_KEY)) { -+ priv->assoc_request.auth_type = AUTH_SHARED_KEY; -+ priv->assoc_request.auth_key = priv->ieee->sec.active_key; -+ } else { -+ priv->assoc_request.auth_type = AUTH_OPEN; -+ priv->assoc_request.auth_key = 0; -+ } -+ -+ if (priv->ieee->wpa_ie_len) { -+ priv->assoc_request.policy_support = 0x02; /* RSN active */ -+ ipw_set_rsn_capa(priv, priv->ieee->wpa_ie, -+ priv->ieee->wpa_ie_len); -+ } -+ -+ /* -+ * It is valid for our ieee device to support multiple modes, but -+ * when it comes to associating to a given network we have to choose -+ * just one mode. -+ */ -+ if (network->mode & priv->ieee->mode & IEEE_A) -+ priv->assoc_request.ieee_mode = IPW_A_MODE; -+ else if (network->mode & priv->ieee->mode & IEEE_G) -+ priv->assoc_request.ieee_mode = IPW_G_MODE; -+ else if (network->mode & priv->ieee->mode & IEEE_B) -+ priv->assoc_request.ieee_mode = IPW_B_MODE; -+ -+ priv->assoc_request.capability = network->capability; -+ if ((network->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) -+ && !(priv->config & CFG_PREAMBLE_LONG)) { -+ priv->assoc_request.preamble_length = DCT_FLAG_SHORT_PREAMBLE; -+ } else { -+ priv->assoc_request.preamble_length = DCT_FLAG_LONG_PREAMBLE; -+ /* Clear the short preamble if we won't be supporting it */ -+ priv->assoc_request.capability &= -+ ~WLAN_CAPABILITY_SHORT_PREAMBLE; -+ } -+ -+ IPW_DEBUG_ASSOC -+ ("%sssociation attempt [%s]: '%s', channel %d, " -+ "802.11%c [%08X], %s[:%s], enc=%s%s%s%c%c\n", -+ roaming ? "Rea" : "A", -+ (priv-> -+ capability & WLAN_CAPABILITY_IBSS) ? "IBSS" : "BSS", -+ escape_essid(priv->essid, priv->essid_len), -+ network->channel, -+ ipw_modes[priv->assoc_request.ieee_mode], -+ rates_mask, -+ (priv->assoc_request.preamble_length == -+ DCT_FLAG_LONG_PREAMBLE) ? "long" : "short", -+ network-> -+ capability & WLAN_CAPABILITY_SHORT_PREAMBLE ? "short" : -+ "long", -+ priv->capability & CAP_PRIVACY_ON ? "on " : "off", -+ priv->capability & CAP_PRIVACY_ON ? (priv-> -+ capability & -+ CAP_SHARED_KEY ? -+ "(shared)" : -+ "(open)") : "", -+ priv->capability & CAP_PRIVACY_ON ? " key=" : "", -+ priv->capability & CAP_PRIVACY_ON ? '1' + -+ priv->assoc_request.auth_key : '.', -+ priv->capability & CAP_PRIVACY_ON ? '.' : ' '); -+ priv->assoc_request.beacon_interval = network->beacon_interval; -+ IPW_DEBUG_ASSOC("Beacon interval for the network is %d\n", -+ priv->assoc_request.beacon_interval); -+ -+ if ((priv->ieee->iw_mode == IW_MODE_ADHOC) && -+ (network->time_stamp[0] == 0) -+ && (network->time_stamp[1] == 0)) { -+ priv->assoc_request.assoc_type = HC_IBSS_START; -+ priv->assoc_request.assoc_tsf_msw = 0; -+ priv->assoc_request.assoc_tsf_lsw = 0; -+ } else { -+ if (unlikely(roaming)) -+ priv->assoc_request.assoc_type = HC_REASSOCIATE; -+ else -+ priv->assoc_request.assoc_type = HC_ASSOCIATE; -+ priv->assoc_request.assoc_tsf_msw = network->time_stamp[1]; -+ priv->assoc_request.assoc_tsf_lsw = network->time_stamp[0]; -+ } -+ -+ memcpy(&priv->assoc_request.bssid, network->bssid, ETH_ALEN); -+ if (priv->ieee->iw_mode == IW_MODE_ADHOC) { -+ memset(&priv->assoc_request.dest, 0xFF, ETH_ALEN); -+ priv->assoc_request.atim_window = network->atim_window; -+ } else { -+ memcpy(&priv->assoc_request.dest, network->bssid, ETH_ALEN); -+ priv->assoc_request.atim_window = 0; -+ } -+ -+ priv->assoc_request.listen_interval = network->listen_interval; -+ -+ ipw_set_supported_rates_mask(priv, rates_mask); -+ -+ /* -+ * If preemption is enabled, it is possible for the association -+ * to complete before we return from ipw_send_associate. Therefore -+ * we have to be sure and update our priviate data first. -+ */ -+ priv->channel = network->channel; -+ memcpy(priv->bssid, network->bssid, ETH_ALEN); -+ -+ priv->assoc_request.erp_value = network->erp_value; -+ -+ priv->status |= STATUS_ASSOCIATING; -+ priv->status &= ~STATUS_SECURITY_UPDATED; -+ -+ priv->assoc_network = network; -+ -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ -+#ifdef CONFIG_IPW3945_QOS -+ ipw_qos_association(priv, network); -+#endif -+ -+ err = ipw_send_associate(priv, &priv->assoc_request); -+ if (err) { -+ IPW_DEBUG_HC("Attempt to send associate command failed.\n"); -+ return err; -+ } -+ -+ IPW_DEBUG(IPW_DL_STATE, "associating: '%s' " MAC_FMT " \n", -+ escape_essid(priv->essid, priv->essid_len), -+ MAC_ARG(priv->bssid)); -+ -+ queue_delayed_work(priv->workqueue, &priv->associate_timeout, -+ msecs_to_jiffies(ASSOCIATE_TIMEOUT)); -+ -+ return 0; -+} -+ -+static void ipw_roam(void *data) -+{ -+ struct ipw_priv *priv = data; -+ struct ieee80211_network *network = NULL; -+ struct ipw_network_match match = { -+ .network = priv->assoc_network -+ }; -+ /* The roaming process is as follows: -+ * -+ * 1. Missed beacon threshold triggers the roaming process by -+ * setting the status ROAM bit and requesting a scan. -+ * 2. When the scan completes, it schedules the ROAM work -+ * 3. The ROAM work looks at all of the known networks for one that -+ * is a better network than the currently associated. If none -+ * found, the ROAM process is over (ROAM bit cleared) -+ * 4. If a better network is found, a disassociation request is -+ * sent. -+ * 5. When the disassociation completes, the roam work is again -+ * scheduled. The second time through, the driver is no longer -+ * associated, and the newly selected network is sent an -+ * association request. -+ * 6. At this point ,the roaming process is complete and the ROAM -+ * status bit is cleared. -+ */ -+ /* If we are no longer associated, and the roaming bit is no longer -+ * set, then we are not actively roaming, so just return */ -+ if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ROAMING))) -+ return; -+ if (priv->status & STATUS_ASSOCIATED) { -+ /* First pass through ROAM process -- look for a better -+ * network */ -+ unsigned long flags; -+ u8 rssi = priv->assoc_network->stats.rssi; -+ priv->assoc_network->stats.rssi = -128; -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ list_for_each_entry(network, &priv->ieee->network_list, list) { -+ if (network != priv->assoc_network) -+ ipw_best_network(priv, &match, network, 1); -+ } -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ priv->assoc_network->stats.rssi = rssi; -+ if (match.network == priv->assoc_network) { -+ IPW_DEBUG_ASSOC -+ ("No better APs in this network to " "roam to.\n"); -+ priv->status &= ~STATUS_ROAMING; -+ ipw_debug_config(priv); -+ return; -+ } -+ -+ ipw_send_disassociate(priv, 1); -+ priv->assoc_network = match.network; -+ return; -+ } -+ -+ /* Second pass through ROAM process -- request association */ -+ ipw_find_compatible_rates(priv, priv->assoc_network, match.rates_mask); -+ ipw_associate_network(priv, priv->assoc_network, match.rates_mask, 1); -+ priv->status &= ~STATUS_ROAMING; -+} -+ -+static void ipw_bg_roam(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_roam(data); -+ mutex_unlock(&priv->mutex); -+} -+ -+static int ipw_associate(void *data) -+{ -+ struct ipw_priv *priv = data; -+ struct ieee80211_network *network = NULL; -+ struct ipw_network_match match = { -+ .network = NULL -+ }; -+ u32 rates_mask; -+ struct list_head *element; -+ unsigned long flags; -+ -+ ipw_update_link_led(priv); -+ -+ if (priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) { -+ IPW_DEBUG_ASSOC -+ ("Not attempting association (already in progress)\n"); -+ return 0; -+ } -+ -+ if (!ipw_is_alive(priv)) { -+ IPW_DEBUG_ASSOC("Not attempting association (not " -+ "initialized)\n"); -+ return 0; -+ } -+ -+ if (!ipw_is_calibrated(priv)) { -+ IPW_DEBUG_ASSOC("Not attempting association (not " -+ "calibrated)\n"); -+ return 0; -+ } -+ -+ if (priv->status & STATUS_SCANNING) { -+ IPW_DEBUG_ASSOC("Not attempting association (scanning)\n"); -+ return 0; -+ } -+ -+ if (!(priv->config & CFG_ASSOCIATE) && -+ !(priv->config & (CFG_STATIC_ESSID | -+ CFG_STATIC_CHANNEL | CFG_STATIC_BSSID))) { -+ IPW_DEBUG_ASSOC("Not attempting association (associate=0)\n"); -+ return 0; -+ } -+ -+ if (priv->status & STATUS_EXIT_PENDING) { -+ IPW_DEBUG_ASSOC -+ ("Not attempting association driver unloading\n"); -+ return 0; -+ } -+ -+ ipw_scan_cancel(priv); -+ -+ /* Protect our use of the network_list */ -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ list_for_each_entry(network, &priv->ieee->network_list, list) -+ ipw_best_network(priv, &match, network, 0); -+ network = match.network; -+ rates_mask = match.rates_mask; -+ if (network == NULL && -+ priv->ieee->iw_mode == IW_MODE_ADHOC && -+ priv->config & CFG_ADHOC_CREATE && -+ priv->config & CFG_STATIC_ESSID && -+ priv->config & CFG_STATIC_CHANNEL && -+ !list_empty(&priv->ieee->network_free_list)) { -+ element = priv->ieee->network_free_list.next; -+ network = list_entry(element, struct ieee80211_network, list); -+ if (!ipw_adhoc_create(priv, network)) { -+ rates_mask = priv->rates_mask; -+ list_del(element); -+ list_add_tail(&network->list, -+ &priv->ieee->network_list); -+ } else -+ network = NULL; -+ } -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ -+ /* If we reached the end of the list, then we don't have any valid -+ * matching APs */ -+ if (!network) { -+ ipw_debug_config(priv); -+ ipw_scan_initiate(priv, priv->ieee->freq_band, SCAN_INTERVAL); -+ return 0; -+ } -+ -+ ipw_associate_network(priv, network, rates_mask, 0); -+ return 1; -+} -+ -+static void ipw_bg_daemon_tx_status_sync(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ IPW_DEBUG_DAEMON("Sending daemon sync tx status: 0x%08X\n", -+ priv->daemon_tx_status); -+ ipw_send_daemon_sync(priv, DAEMON_SYNC_TX_STATUS, -+ sizeof(priv->daemon_tx_status), -+ &priv->daemon_tx_status); -+} -+ -+#define IPW_FORCE_TXPOWR_CALIB (180 * HZ) -+ -+static void ipw_bg_associate(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_associate(data); -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_handle_data_packet(struct ipw_priv *priv, -+ struct ipw_rx_mem_buffer *rxb, -+ struct ieee80211_rx_stats *stats) -+{ -+ struct ieee80211_hdr *hdr; -+ struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data; -+ struct ipw_rx_frame_hdr *rx_hdr = IPW_RX_HDR(pkt); -+ -+ /* We received data from the HW, so stop the watchdog */ -+ priv->net_dev->trans_start = jiffies; -+ if (unlikely((le16_to_cpu(rx_hdr->len) + IPW_RX_FRAME_SIZE) > -+ skb_tailroom(rxb->skb))) { -+ priv->ieee->stats.rx_errors++; -+ priv->wstats.discard.misc++; -+ IPW_DEBUG_DROP("Corruption detected! Oh no!\n"); -+ return; -+ } -+ -+ /* We only process data packets if the interface is open */ -+ if (unlikely(!priv->netdev_registered || !netif_running(priv->net_dev))) { -+ priv->ieee->stats.rx_dropped++; -+ priv->wstats.discard.misc++; -+ IPW_DEBUG_DROP("Dropping packet while interface is not up.\n"); -+ return; -+ } -+ -+ skb_reserve(rxb->skb, (void *)rx_hdr->payload - (void *)pkt); -+ /* Set the size of the skb to the size of the frame */ -+ skb_put(rxb->skb, le16_to_cpu(rx_hdr->len)); -+ -+ hdr = (void *)rxb->skb->data; -+ priv->rx_bytes += rxb->skb->len - ieee80211_get_hdrlen(hdr->frame_ctl); -+ priv->rx_packets++; -+ -+ if (!ieee80211_rx(priv->ieee, rxb->skb, stats)) -+ priv->ieee->stats.rx_errors++; -+ else { -+ /* ieee80211_rx succeeded, so it now owns the SKB */ -+ rxb->skb = NULL; -+ priv->led_packets += rx_hdr->len; -+ ipw_setup_activity_timer(priv); -+ } -+} -+ -+#define IPW_PACKET_RETRY_TIME HZ -+ -+static inline int is_duplicate_packet(struct ipw_priv *priv, struct ieee80211_hdr_4addr -+ *header) -+{ -+ u16 sc = le16_to_cpu(header->seq_ctl); -+ u16 seq = WLAN_GET_SEQ_SEQ(sc); -+ u16 frag = WLAN_GET_SEQ_FRAG(sc); -+ u16 *last_seq, *last_frag; -+ unsigned long *last_time; -+ -+ switch (priv->ieee->iw_mode) { -+ case IW_MODE_ADHOC: -+ { -+ struct list_head *p; -+ struct ipw_ibss_seq *entry = NULL; -+ u8 *mac = header->addr2; -+ int index = mac[5] % IPW_IBSS_MAC_HASH_SIZE; -+ -+ __list_for_each(p, &priv->ibss_mac_hash[index]) { -+ entry = -+ list_entry(p, struct ipw_ibss_seq, list); -+ if (!memcmp(entry->mac, mac, ETH_ALEN)) -+ break; -+ } -+ if (p == &priv->ibss_mac_hash[index]) { -+ entry = kmalloc(sizeof(*entry), GFP_ATOMIC); -+ if (!entry) { -+ IPW_ERROR -+ ("Cannot malloc new mac entry\n"); -+ return 0; -+ } -+ memcpy(entry->mac, mac, ETH_ALEN); -+ entry->seq_num = seq; -+ entry->frag_num = frag; -+ entry->packet_time = jiffies; -+ list_add(&entry->list, -+ &priv->ibss_mac_hash[index]); -+ return 0; -+ } -+ last_seq = &entry->seq_num; -+ last_frag = &entry->frag_num; -+ last_time = &entry->packet_time; -+ break; -+ } -+ case IW_MODE_INFRA: -+ last_seq = &priv->last_seq_num; -+ last_frag = &priv->last_frag_num; -+ last_time = &priv->last_packet_time; -+ break; -+ default: -+ return 0; -+ } -+ if ((*last_seq == seq) && -+ time_after(*last_time + IPW_PACKET_RETRY_TIME, jiffies)) { -+ if (*last_frag == frag) -+ goto drop; -+ if (*last_frag + 1 != frag) -+ /* out-of-order fragment */ -+ goto drop; -+ } else -+ *last_seq = seq; -+ -+ *last_frag = frag; -+ *last_time = jiffies; -+ return 0; -+ -+ drop: -+ /* 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; -+} -+ -+#if defined(CONFIG_IEEE80211_RADIOTAP) && defined(CONFIG_IPW3945_MONITOR) -+static void ipw_handle_data_packet_monitor(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_stats *rx_stats = IPW_RX_STATS(pkt); -+ struct ipw_rx_frame_hdr *rx_hdr = IPW_RX_HDR(pkt); -+ struct ipw_rx_frame_end *rx_end = IPW_RX_END(pkt); -+ struct ipw_rt_hdr *ipw_rt; -+ -+ /* First cache any information we need before we overwrite -+ * the information provided in the skb from the hardware */ -+ s8 signal = rx_stats->rssi - IPW_RSSI_OFFSET; -+ s8 noise = rx_stats->noise_diff; -+ u16 phy_flags = rx_hdr->phy_flags; -+ u16 channel = cpu_to_le16(ieee80211chan2mhz(rx_hdr->channel)); -+ u8 rate = rx_hdr->rate; -+ short len = le16_to_cpu(rx_hdr->len); -+ u64 tsf = rx_end->beaconTimeStamp; -+ -+ /* We received data from the HW, so stop the watchdog */ -+ priv->net_dev->trans_start = jiffies; -+ -+ if (unlikely((len + IPW_RX_FRAME_SIZE) > skb_tailroom(rxb->skb))) { -+ priv->ieee->stats.rx_errors++; -+ priv->wstats.discard.misc++; -+ IPW_DEBUG_DROP("Corruption detected! Oh no!\n"); -+ return; -+ } -+ -+ /* We only process data packets if the interface is open */ -+ if (unlikely(!netif_running(priv->net_dev))) { -+ priv->ieee->stats.rx_dropped++; -+ priv->wstats.discard.misc++; -+ 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->ieee->stats.rx_dropped++; -+ priv->wstats.discard.misc++; -+ IPW_DEBUG_DROP("Dropping too large packet in monitor\n"); -+ return; -+ } -+ -+ /* copy the frame data to write after where the radiotap header goes */ -+ ipw_rt = (void *)rxb->skb->data; -+ memmove(ipw_rt->payload, IPW_RX_DATA(pkt), 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(rxb->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_TSFT) | -+ (1 << IEEE80211_RADIOTAP_FLAGS) | -+ (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 = channel; -+ if (!(phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK)) { -+ ipw_rt->rt_chbitmask = -+ cpu_to_le16((IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ)); -+ } else if (phy_flags & RX_RES_PHY_FLAGS_MOD_CCK_MSK) { -+ ipw_rt->rt_chbitmask = -+ cpu_to_le16((IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ)); -+ } else { /* 802.11g */ -+ ipw_rt->rt_chbitmask = -+ cpu_to_le16((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 & RX_RES_PHY_FLAGS_ANTENNA_MSK) >> 4; -+ -+ /* set the preamble flag if we have it */ -+ if (phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK) -+ ipw_rt->rt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; -+ -+ IPW_DEBUG_RX("Rx packet of %d bytes.\n", rxb->skb->len); -+ -+ if (!ieee80211_rx(priv->ieee, rxb->skb, stats)) -+ priv->ieee->stats.rx_errors++; -+ else { /* ieee80211_rx succeeded, so it now owns the SKB */ -+ rxb->skb = NULL; -+ /* no LED during capture */ -+ } -+} -+#endif -+ -+#define ieee80211_is_probe_response(fc) \ -+ ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT && \ -+ (fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP ) -+ -+#define ieee80211_is_management(fc) \ -+ ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) -+ -+#define ieee80211_is_control(fc) \ -+ ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL) -+ -+#define ieee80211_is_data(fc) \ -+ ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) -+ -+#define ieee80211_is_assoc_request(fc) \ -+ ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_ASSOC_REQ) -+ -+#define ieee80211_is_reassoc_request(fc) \ -+ ((fc & IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_REASSOC_REQ) -+ -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+ -+static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, -+ struct ieee80211_txb *txb) -+{ -+ struct ieee80211_rx_stats dummystats; -+ struct ieee80211_hdr *hdr; -+ u8 n; -+ u16 filter = priv->prom_priv->filter; -+ int hdr_only = 0; -+ -+ if (filter & IPW_PROM_NO_TX) -+ return; -+ -+ memset(&dummystats, 0, sizeof(dummystats)); -+ -+ /* Filtering of fragment chains is done agains the first fragment */ -+ hdr = (void *)txb->fragments[0]->data; -+ if (ieee80211_is_management(hdr->frame_ctl)) { -+ if (filter & IPW_PROM_NO_MGMT) -+ return; -+ if (filter & IPW_PROM_MGMT_HEADER_ONLY) -+ hdr_only = 1; -+ } else if (ieee80211_is_control(hdr->frame_ctl)) { -+ if (filter & IPW_PROM_NO_CTL) -+ return; -+ if (filter & IPW_PROM_CTL_HEADER_ONLY) -+ hdr_only = 1; -+ } else if (ieee80211_is_data(hdr->frame_ctl)) { -+ if (filter & IPW_PROM_NO_DATA) -+ return; -+ if (filter & IPW_PROM_DATA_HEADER_ONLY) -+ hdr_only = 1; -+ } -+ -+ for (n = 0; n < txb->nr_frags; ++n) { -+ struct sk_buff *src = txb->fragments[n]; -+ struct sk_buff *dst; -+ struct ieee80211_radiotap_header *rt_hdr; -+ int len; -+ -+ if (hdr_only) { -+ hdr = (void *)src->data; -+ len = ieee80211_get_hdrlen(hdr->frame_ctl); -+ } else -+ len = src->len; -+ -+ dst = alloc_skb(len + IEEE80211_RADIOTAP_HDRLEN, GFP_ATOMIC); -+ if (!dst) -+ continue; -+ -+ rt_hdr = (void *)skb_put(dst, sizeof(*rt_hdr)); -+ -+ rt_hdr->it_version = PKTHDR_RADIOTAP_VERSION; -+ rt_hdr->it_pad = 0; -+ rt_hdr->it_present = 0; /* after all, it's just an idea */ -+ rt_hdr->it_present |= (1 << IEEE80211_RADIOTAP_CHANNEL); -+ -+ *(u16 *) skb_put(dst, sizeof(u16)) = -+ cpu_to_le16(ieee80211chan2mhz(priv->channel)); -+ if (priv->channel > 14) /* 802.11a */ -+ *(u16 *) skb_put(dst, sizeof(u16)) = -+ cpu_to_le16(IEEE80211_CHAN_OFDM | -+ IEEE80211_CHAN_5GHZ); -+ else if (priv->ieee->mode == IEEE_B) /* 802.11b */ -+ *(u16 *) skb_put(dst, sizeof(u16)) = -+ cpu_to_le16(IEEE80211_CHAN_CCK | -+ IEEE80211_CHAN_2GHZ); -+ else /* 802.11g */ -+ *(u16 *) skb_put(dst, sizeof(u16)) = -+ cpu_to_le16(IEEE80211_CHAN_OFDM | -+ IEEE80211_CHAN_2GHZ); -+ -+ rt_hdr->it_len = dst->len; -+ -+ memcpy(skb_put(dst, len), src->data, len); -+ -+ if (!ieee80211_rx(priv->prom_priv->ieee, dst, &dummystats)) -+ dev_kfree_skb_any(dst); -+ } -+} -+ -+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_stats *rx_stats = IPW_RX_STATS(pkt); -+ struct ipw_rx_frame_hdr *rx_hdr = IPW_RX_HDR(pkt); -+ struct ipw_rx_frame_end *rx_end = IPW_RX_END(pkt); -+ struct ipw_rt_hdr *ipw_rt; -+ u16 filter = priv->prom_priv->filter; -+ -+ /* First cache any information we need before we overwrite -+ * the information provided in the skb from the hardware */ -+ struct ieee80211_hdr *hdr; -+ s8 signal = rx_stats->rssi - IPW_RSSI_OFFSET; -+ s8 noise = rx_stats->noise_diff; -+ u16 phy_flags = rx_hdr->phy_flags; -+ u16 channel = cpu_to_le16(ieee80211chan2mhz(rx_hdr->channel)); -+ u8 rate = rx_hdr->rate; -+ short len = le16_to_cpu(rx_hdr->len); -+ u64 tsf = rx_end->beaconTimeStamp; -+ struct sk_buff *skb; -+ int hdr_only = 0; -+ u16 snr = 0; -+ -+ if (rx_stats->noise_diff) -+ snr = rx_stats->sig_avg / rx_stats->noise_diff; -+ -+ noise = signal - snr; -+ -+ /* If the filter is set to not include Rx frames then return */ -+ if (filter & IPW_PROM_NO_RX) -+ return; -+ -+ /* 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; -+ } -+ -+ hdr = (void *)IPW_RX_DATA(pkt); -+ if (ieee80211_is_management(hdr->frame_ctl)) { -+ if (filter & IPW_PROM_NO_MGMT) -+ return; -+ if (filter & IPW_PROM_MGMT_HEADER_ONLY) -+ hdr_only = 1; -+ } else if (ieee80211_is_control(hdr->frame_ctl)) { -+ if (filter & IPW_PROM_NO_CTL) -+ return; -+ if (filter & IPW_PROM_CTL_HEADER_ONLY) -+ hdr_only = 1; -+ } else if (ieee80211_is_data(hdr->frame_ctl)) { -+ if (filter & IPW_PROM_NO_DATA) -+ return; -+ if (filter & IPW_PROM_DATA_HEADER_ONLY) -+ hdr_only = 1; -+ } -+ -+ /* 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; -+ -+ if (hdr_only) -+ len = ieee80211_get_hdrlen(hdr->frame_ctl); -+ -+ memcpy(ipw_rt->payload, IPW_RX_DATA(pkt), 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 = channel; -+ if (!(phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK)) { -+ ipw_rt->rt_chbitmask = -+ cpu_to_le16((IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ)); -+ } else if (phy_flags & RX_RES_PHY_FLAGS_MOD_CCK_MSK) { -+ ipw_rt->rt_chbitmask = -+ cpu_to_le16((IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ)); -+ } else { /* 802.11g */ -+ ipw_rt->rt_chbitmask = -+ cpu_to_le16((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 & RX_RES_PHY_FLAGS_ANTENNA_MSK) >> 4; -+ -+ /* set the preamble flag if we have it */ -+ if (phy_flags & RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK) -+ 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) -+{ -+ /* Filter incoming packets to determine if they are targetted toward -+ * this network, discarding packets coming from ourselves */ -+ switch (priv->ieee->iw_mode) { -+ case IW_MODE_ADHOC: /* Header: Dest. | Source | BSSID */ -+ /* packets from our adapter are dropped (echo) */ -+ if (!memcmp(header->addr2, priv->net_dev->dev_addr, ETH_ALEN)) -+ return 0; -+ /* {broad,multi}cast packets to our IBSS go through */ -+ if (ipw_is_broadcast_ether_addr(header->addr1) || -+ is_multicast_ether_addr(header->addr1)) -+ return !memcmp(header->addr3, priv->bssid, ETH_ALEN); -+ /* packets to our adapter go through */ -+ return !memcmp(header->addr1, priv->net_dev->dev_addr, -+ ETH_ALEN); -+ case IW_MODE_INFRA: /* Header: Dest. | AP{BSSID} | Source */ -+ /* packets from our adapter are dropped (echo) */ -+ if (!memcmp(header->addr3, priv->net_dev->dev_addr, ETH_ALEN)) -+ return 0; -+ /* {broad,multi}cast packets to our BSS go through */ -+ if (ipw_is_broadcast_ether_addr(header->addr1) || -+ is_multicast_ether_addr(header->addr1)) -+ return !memcmp(header->addr2, priv->bssid, ETH_ALEN); -+ /* packets to our adapter go through */ -+ return !memcmp(header->addr1, priv->net_dev->dev_addr, -+ ETH_ALEN); -+ } -+ -+ return 1; -+} -+ -+/* -+ * Reclaim Tx queue entries no more used by NIC. -+ * -+ * When FW adwances 'R' index, all entries between old and -+ * new 'R' index need to be reclaimed. As result, some free space -+ * forms. If there is enough free space (> low mark), wake Tx queue. -+ */ -+static int ipw_queue_tx_reclaim(struct ipw_priv *priv, int fifo, int index) -+{ -+ struct ipw_tx_queue *txq = &priv->txq[fifo]; -+ struct ipw_queue *q = &txq->q; -+ u8 is_next = 0; -+ int used; -+ if ((index >= q->n_bd) || (x2_queue_used(q, index) == 0)) { -+ IPW_ERROR -+ ("Read index for DMA queue (%d) is out of range [0-%d) %d %d\n", -+ index, q->n_bd, q->first_empty, q->last_used); -+ goto done; -+ } -+ index = ipw_queue_inc_wrap(index, q->n_bd); -+ for (; q->last_used != index; -+ q->last_used = ipw_queue_inc_wrap(q->last_used, q->n_bd)) { -+ if (is_next) { -+ IPW_WARNING("XXXL we have skipped command\n"); -+ queue_work(priv->workqueue, &priv->down); -+ } -+ if (fifo != CMD_QUEUE_NUM) { -+ ipw_queue_tx_free_tfd(priv, txq); -+ priv->tx_packets++; -+ } -+ -+ is_next = 1; -+ } -+ done: -+ if (ipw_queue_space(q) > q->low_mark && (fifo >= 0) -+ && (fifo != CMD_QUEUE_NUM) -+ && (priv->status & STATUS_ASSOCIATED) -+ && priv->netdev_registered && netif_running(priv->net_dev)) -+ netif_wake_queue(priv->net_dev); -+ used = q->first_empty - q->last_used; -+ if (used < 0) -+ used += q->n_window; -+ return used; -+} -+ -+static void ipw_tx_complete(struct ipw_priv *priv, -+ struct ipw_rx_mem_buffer *rxb) -+{ -+ struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb->skb->data; -+ int fifo = SEQ_TO_FIFO(pkt->hdr.sequence); -+ int index = SEQ_TO_INDEX(pkt->hdr.sequence); -+ int is_huge = (pkt->hdr.sequence & SEQ_HUGE_FRAME); -+ int cmd_index; -+ struct ipw_cmd *cmd; -+ if (fifo > MAX_REAL_TX_QUEUE_NUM) -+ return; -+ if (fifo != CMD_QUEUE_NUM) { -+ ipw_queue_tx_reclaim(priv, fifo, index); -+ return; -+ } -+ -+ cmd_index = get_next_cmd_index(&priv->txq[CMD_QUEUE_NUM].q, -+ index, is_huge); -+ cmd = &priv->txq[CMD_QUEUE_NUM].cmd[cmd_index]; -+ /* Input error checking is done when commands are added to queue. */ -+ if (cmd->meta.flags & CMD_WANT_SKB) { -+ cmd->meta.u.source->u.skb = rxb->skb; -+ rxb->skb = NULL; -+ } else if (cmd->meta.u.callback && -+ !cmd->meta.u.callback(priv, cmd, rxb->skb)) -+ rxb->skb = NULL; -+ -+ ipw_queue_tx_reclaim(priv, fifo, index); -+ -+ /* is_cmd_sync(cmd) works with ipw_host_cmd... here we only have ipw_cmd */ -+ if (!(cmd->meta.flags & CMD_ASYNC)) { -+ priv->status &= ~STATUS_HCMD_ACTIVE; -+ wake_up_interruptible(&priv->wait_command_queue); -+ } -+} -+ -+#ifdef CONFIG_IPW3945_DEBUG -+ -+/* hack this function to show different aspects of received frames, -+ * including selective frame dumps. -+ * group100 parameter selects whether to show 1 out of 100 good frames. */ -+static void ipw_report_frame(struct ipw_priv *priv, -+ struct ipw_rx_packet *pkt, -+ struct ieee80211_hdr_4addr *header, int group100) -+{ -+ u32 to_us = 0; -+ u32 print_summary = 0; -+ u32 print_dump = 0; /* set to 1 to dumpa ll frames' contents */ -+ u32 hundred = 0; -+ u32 dataframe = 0; -+ -+ /* these are declared without "=" to avoid compiler warnings if we -+ * don't use them in the debug messages below */ -+ u16 frame_ctl; -+ u16 seq_ctl; -+ u16 channel; -+ u16 phy_flags; -+ u8 rate_sym; -+ u16 length; -+ u16 status; -+ u16 bcn_tmr; -+ u32 tsf_low; -+ u64 tsf; -+ u8 rssi; -+ u8 agc; -+ u16 sig_avg; -+ u16 noise_diff; -+ -+ struct ipw_rx_frame_stats *rx_stats = IPW_RX_STATS(pkt); -+ struct ipw_rx_frame_hdr *rx_hdr = IPW_RX_HDR(pkt); -+ struct ipw_rx_frame_end *rx_end = IPW_RX_END(pkt); -+ u8 *data = IPW_RX_DATA(pkt); -+ -+ /* MAC header */ -+ frame_ctl = le16_to_cpu(header->frame_ctl); -+ seq_ctl = le16_to_cpu(header->seq_ctl); -+ -+ /* metadata */ -+ channel = le16_to_cpu(rx_hdr->channel); -+ phy_flags = le16_to_cpu(rx_hdr->phy_flags); -+ rate_sym = rx_hdr->rate; -+ length = le16_to_cpu(rx_hdr->len); -+ -+ /* end-of-frame status and timestamp */ -+ status = le16_to_cpu(rx_end->status); -+ bcn_tmr = le32_to_cpu(rx_end->beaconTimeStamp); -+ tsf_low = (u32) (rx_end->timestamp & 0x0ffffffff); -+ tsf = le64_to_cpu(rx_end->timestamp); -+ -+ /* signal statistics */ -+ rssi = rx_stats->rssi; -+ agc = rx_stats->agc; -+ sig_avg = le16_to_cpu(rx_stats->sig_avg); -+ noise_diff = le16_to_cpu(rx_stats->noise_diff); -+ -+ to_us = !memcmp(header->addr1, priv->net_dev->dev_addr, ETH_ALEN); -+ -+ /* if data frame is to us and all is good, -+ * (optionally) print summary for only 1 out of every 100 */ -+ if (to_us && (frame_ctl & ~0x4000) == 0x0208) { -+ dataframe = 1; -+ if (!group100) { -+ print_summary = 1; /* print each frame */ -+ } else if (priv->framecnt_to_us < 100) { -+ priv->framecnt_to_us++; -+ print_summary = 0; -+ } else { -+ priv->framecnt_to_us = 0; -+ print_summary = 1; -+ hundred = 1; -+ } -+ } else { -+ print_summary = 1; /* print summary for all other frames */ -+ } -+ -+ if (print_summary) { -+ char *title; -+ u32 rate; -+ -+ if (hundred) -+ title = "100Frames"; -+ else if (frame_ctl & 0x0800) -+ title = "Retry"; -+ else if ((frame_ctl & 0x00FF) == 0x10) -+ title = "AscRsp"; -+ else if ((frame_ctl & 0x00FF) == 0x30) -+ title = "RasRsp"; -+ else if ((frame_ctl & 0x00FF) == 0x50) { -+ title = "PrbRsp"; -+ print_dump = 1; /* dump frame contents */ -+ } else if ((frame_ctl & 0x00FF) == 0x80) { -+ title = "Beacon"; -+ print_dump = 1; /* dump frame contents */ -+ } else if ((frame_ctl & 0x00FF) == 0x90) -+ title = "ATIM"; -+ else if ((frame_ctl & 0x00FF) == 0xB0) -+ title = "Auth"; -+ else -+ title = "Frame"; -+ -+ switch (rate_sym) { -+ case IPW_TX_RATE_1MB: -+ rate = 1; -+ break; -+ case IPW_TX_RATE_2MB: -+ rate = 2; -+ break; -+ case IPW_TX_RATE_5MB: -+ rate = 5; -+ break; -+ case IPW_TX_RATE_6MB: -+ rate = 6; -+ break; -+ case IPW_TX_RATE_9MB: -+ rate = 9; -+ break; -+ case IPW_TX_RATE_11MB: -+ rate = 11; -+ break; -+ case IPW_TX_RATE_12MB: -+ rate = 12; -+ break; -+ case IPW_TX_RATE_18MB: -+ rate = 18; -+ break; -+ case IPW_TX_RATE_24MB: -+ rate = 24; -+ break; -+ case IPW_TX_RATE_36MB: -+ rate = 36; -+ break; -+ case IPW_TX_RATE_48MB: -+ rate = 48; -+ break; -+ case IPW_TX_RATE_54MB: -+ rate = 54; -+ break; -+ default: -+ rate = 0; -+ } -+ -+ /* print frame summary. -+ * MAC addresses show just the last byte (for brevity), -+ * but you can hack it to show more, if you'd like to. */ -+ if (dataframe) { -+ IPW_DEBUG_RX -+ ("%s: mhd=0x%04x, dst=0x%02x, len=%u, rssi=%d, chnl=%d, rate=%u, \n", -+ title, frame_ctl, header->addr1[5], -+ length, rssi, channel, rate); -+ } else { -+ /* src/dst addresses assume managed mode */ -+ IPW_DEBUG_RX -+ ("%s: 0x%04x, dst=0x%02x, src=0x%02x, rssi=%u, tim=%lu usec, phy=0x%02x, chnl=%d\n", -+ title, frame_ctl, header->addr1[5], -+ header->addr3[5], rssi, -+ tsf_low - priv->scan_start_tsf, -+ phy_flags, channel); -+ } -+ } -+ if (print_dump) -+ printk_buf(IPW_DL_RX, data, length); -+} -+ -+#endif /* CONFIG_IPW3945_DEBUG */ -+ -+static void ipw_handle_reply_rx(struct ipw_priv *priv, -+ struct ipw_rx_mem_buffer *rxb) -+{ -+ struct ipw_rx_packet *pkt = (void *)rxb->skb->data; -+ struct ipw_rx_frame_stats *rx_stats = IPW_RX_STATS(pkt); -+ struct ipw_rx_frame_hdr *rx_hdr = IPW_RX_HDR(pkt); -+ struct ipw_rx_frame_end *rx_end = IPW_RX_END(pkt); -+ struct ieee80211_hdr_4addr *header; -+ struct ieee80211_rx_stats stats = { -+ .rssi = rx_stats->rssi - IPW_RSSI_OFFSET, -+ .signal = le16_to_cpu(rx_stats->sig_avg), -+ .noise = le16_to_cpu(rx_stats->noise_diff), -+ .mac_time = rx_end->beaconTimeStamp, -+ .rate = rx_hdr->rate, -+ .received_channel = rx_hdr->channel, -+ .len = le16_to_cpu(rx_hdr->len), -+ .freq = -+ (rx_hdr-> -+ phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ? -+ IEEE80211_24GHZ_BAND : IEEE80211_52GHZ_BAND, -+ .tsf = rx_end->timestamp, -+ .beacon_time = rx_end->beaconTimeStamp, -+ }; -+ u8 network_packet; -+ unsigned long flags; -+ u16 snr = 0; -+ -+ if (rx_stats->noise_diff) -+ snr = (rx_stats->sig_avg << 7) / rx_stats->noise_diff; -+ stats.noise = stats.rssi - (snr >> 7); -+ -+ if (unlikely(rx_stats->mib_count > 20)) { -+ IPW_DEBUG_DROP -+ ("dsp size out of range [0,20]: " -+ "%d", rx_stats->mib_count); -+ priv->ieee->stats.rx_errors++; -+ priv->wstats.discard.misc++; -+ return; -+ } -+ -+ if (stats.rssi != 0) -+ stats.mask |= IEEE80211_STATMASK_RSSI; -+ stats.signal = stats.rssi; -+ -+ if (stats.signal != 0) -+ stats.mask |= IEEE80211_STATMASK_SIGNAL; -+ if (stats.noise != 0) -+ stats.mask |= IEEE80211_STATMASK_NOISE; -+ if (stats.rate != 0) -+ stats.mask |= IEEE80211_STATMASK_RATE; -+ -+ if (!(rx_end->status & RX_RES_STATUS_NO_CRC32_ERROR) -+ || !(rx_end->status & RX_RES_STATUS_NO_RXE_OVERFLOW)) { -+ IPW_DEBUG_RX("Bad CRC or FIFO: 0x%08X.\n", rx_end->status); -+ priv->ieee->stats.rx_dropped++; -+ priv->wstats.discard.misc++; -+ return; -+ } -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+ if (rtap_iface && netif_running(priv->prom_net_dev)) -+ ipw_handle_promiscuous_rx(priv, rxb, &stats); -+#endif -+ -+#ifdef CONFIG_IPW3945_MONITOR -+ if (priv->ieee->iw_mode == IW_MODE_MONITOR) { -+#ifdef CONFIG_IEEE80211_RADIOTAP -+ ipw_handle_data_packet_monitor(priv, rxb, &stats); -+#else -+ ipw_handle_data_packet(priv, rxb, &stats); -+#endif -+ return; -+ } -+#endif -+ -+ /* can be covered by ipw_report_frame() in most cases */ -+// IPW_DEBUG_RX("RX status: 0x%08X\n", rx_end->status); -+ -+ header = (struct ieee80211_hdr_4addr *)IPW_RX_DATA(pkt); -+ -+ network_packet = is_network_packet(priv, header); -+ -+ if (ipw_debug_level & IPW_DL_STATS && net_ratelimit()) -+ IPW_DEBUG_STATS -+ ("[%c] %d RSSI: %d Signal: %u, Noise: %u, Rate: %u\n", -+ network_packet ? '*' : ' ', -+ stats.received_channel, stats.rssi, stats.signal, -+ stats.noise, stats.rate); -+ -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ if (network_packet && priv->assoc_network) { -+ if (stats.noise) { -+ average_add(&priv->average_noise, stats.noise); -+ priv->assoc_network->stats.noise = stats.noise; -+ } -+ -+ priv->assoc_network->stats.rssi = stats.rssi; -+ average_add(&priv->average_rssi, stats.rssi); -+ -+ priv->last_rx_rssi = stats.rssi; -+ -+ priv->last_rx_jiffies = jiffies; -+ priv->last_beacon_time = stats.beacon_time; -+ priv->last_tsf = stats.tsf; -+ } -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ -+#ifdef CONFIG_IPW3945_DEBUG -+ if (ipw_debug_level & (IPW_DL_RX)) -+ /* Set "1" to report good data frames in groups of 100 */ -+ ipw_report_frame(priv, pkt, header, 1); -+#endif -+ -+ switch (WLAN_FC_GET_TYPE(le16_to_cpu(header->frame_ctl))) { -+ case IEEE80211_FTYPE_MGMT: -+ switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) { -+ case IEEE80211_STYPE_PROBE_RESP: -+ case IEEE80211_STYPE_BEACON: -+ case IEEE80211_STYPE_ACTION: -+ if (network_packet) -+ ipw_send_daemon_frame(priv, -+ rx_hdr->channel, -+ rx_stats->rssi, -+ rx_end-> -+ timestamp, -+ rx_end-> -+ beaconTimeStamp, -+ (u8 *) header, -+ rx_hdr->len); -+ break; -+ } -+ -+ ieee80211_rx_mgt(priv->ieee, header, &stats); -+ break; -+ -+ case IEEE80211_FTYPE_CTL: -+ break; -+ -+ case IEEE80211_FTYPE_DATA: -+ if (unlikely(!network_packet)) -+ IPW_DEBUG_DROP("Dropping (non network): " -+ MAC_FMT ", " MAC_FMT ", " -+ MAC_FMT "\n", -+ MAC_ARG(header->addr1), -+ MAC_ARG(header->addr2), -+ MAC_ARG(header->addr3)); -+ else if (unlikely(is_duplicate_packet(priv, header))) -+ IPW_DEBUG_DROP("Dropping (dup): " MAC_FMT ", " -+ MAC_FMT ", " MAC_FMT "\n", -+ MAC_ARG(header->addr1), -+ MAC_ARG(header->addr2), -+ MAC_ARG(header->addr3)); -+ else -+ ipw_handle_data_packet(priv, rxb, &stats); -+ break; -+ } -+} -+ -+static void ipw_handle_reply_tx(struct ipw_priv *priv, -+ struct ipw_tx_resp *resp, u16 sequence) -+{ -+ int fifo = SEQ_TO_FIFO(sequence); -+ -+ IPW_DEBUG(IPW_DL_RATE | IPW_DL_TX, -+ "Tx fifo %d Status 0x%08x plcp rate %d retries %d\n", -+ fifo, resp->status, resp->rate, resp->failure_frame); -+ -+ /* We don't do rate scaling or measurements with microcode commands */ -+ if (fifo == CMD_QUEUE_NUM) -+ return; -+ -+ ipw_rate_scale_tx_resp_handle(priv, resp); -+ -+ /* If we're not actively looking for a packet to measure or if this -+ * packet isn't the one we're measuring, then bail... */ -+ if (!(priv->status & STATUS_TX_MEASURE) || -+ (sequence != priv->daemon_tx_sequence)) -+ return; -+ -+ /* We found our packet, so we're not measuring anymore */ -+ priv->status &= ~STATUS_TX_MEASURE; -+ -+ /* Record when we attempted to gather status even if the transmit -+ * failed */ -+ priv->daemon_last_status = jiffies; -+ -+ /* If the packet had any retries or status does not indicate success, -+ * then we don't do anything with this status info. */ -+ if (resp->failure_frame || resp->failure_rts -+ || resp->bt_kill_count || ((resp->status & 0xff) != 1)) -+ return; -+ -+ /* For daemon tx status, upper 24-bits are taken from the Tx reply -+ * status, and the low 8-bits are filled with the rate used for the -+ * packet */ -+ priv->daemon_tx_status = resp->status & ~0xFF; -+ priv->daemon_tx_status |= priv->daemon_tx_rate; -+ queue_work(priv->workqueue, &priv->daemon_tx_status_sync); -+} -+ -+/* Checks if param1 is the same network as param2 but with a different -+ * channel number */ -+static int is_same_network_channel_switch(struct ieee80211_network -+ *src, struct ieee80211_network -+ *dst, u8 channel) -+{ -+ return ((src->ssid_len == dst->ssid_len) && -+ (src->channel == channel) && -+ !compare_ether_addr(src->bssid, dst->bssid) && -+ !memcmp(src->ssid, dst->ssid, src->ssid_len)); -+} -+ -+static struct ieee80211_network *ieee80211_move_network_channel(struct -+ ieee80211_device -+ *ieee, struct -+ ieee80211_network -+ *network, -+ u8 channel) -+{ -+ struct ieee80211_network *target; -+ unsigned long flags; -+ -+ spin_lock_irqsave(&ieee->lock, flags); -+ -+ list_for_each_entry(target, &ieee->network_list, list) { -+ /* Look to see if we have already received a beacon from -+ * the new network and created a new entry */ -+ if (!is_same_network_channel_switch(target, network, channel)) -+ continue; -+ -+ /* If we found the network, then return it so the caller -+ * can switch to it. */ -+ goto exit; -+ } -+ -+ /* If we reach here, then the new network has not appeared yet. -+ * We can simply update the channel information for this network. */ -+ network->channel = channel; -+ target = network; -+ -+ exit: -+ spin_unlock_irqrestore(&ieee->lock, flags); -+ -+ return target; -+} -+ -+//todoG fix this -+/* -+ * Main entry function for recieving a packet with 80211 headers. This -+ * should be called when ever the FW has notified us that there is a new -+ * skb in the recieve queue. -+ */ -+static void ipw_rx_handle(struct ipw_priv *priv) -+{ -+ struct ipw_rx_mem_buffer *rxb; -+ struct ipw_rx_packet *pkt; -+ u32 r, i; -+ int pkt_from_hardware; -+ -+ r = priv->shared_virt->rx_read_ptr[0]; -+ i = priv->rxq->read; -+ while (i != r) { -+ rxb = priv->rxq->queue[i]; -+ BUG_ON(rxb == NULL); -+ priv->rxq->queue[i] = NULL; -+ pci_dma_sync_single_for_cpu(priv->pci_dev, -+ rxb->dma_addr, -+ IPW_RX_BUF_SIZE, -+ PCI_DMA_FROMDEVICE); -+ pkt = (struct ipw_rx_packet *)rxb->skb->data; -+ -+ /* If this frame wasn't received then it is a response from -+ * a host request */ -+ pkt_from_hardware = !(pkt->hdr.sequence & SEQ_RX_FRAME); -+ -+ /* Don't report replies covered by debug messages below ... -+ * switch statement for readability ... compiler may optimize. -+ * Hack at will to see/not-see what you want in logs. */ -+ switch (pkt->hdr.cmd) { -+ case REPLY_DAEMON_1: -+ case REPLY_DAEMON_2: -+ case REPLY_DAEMON_3: -+ case REPLY_DAEMON_4: -+ case SCAN_START_NOTIFICATION: -+ case SCAN_RESULTS_NOTIFICATION: -+ case SCAN_COMPLETE_NOTIFICATION: -+ case REPLY_STATISTICS_CMD: -+ case STATISTICS_NOTIFICATION: -+ case REPLY_RX: -+ case REPLY_ALIVE: -+ case REPLY_ADD_STA: -+ case REPLY_ERROR: -+ break; -+ default: -+ IPW_DEBUG_RX -+ ("Received %s command (#%x), seq:0x%04X, " -+ "flags=0x%02X, len = %d\n", -+ get_cmd_string(pkt->hdr.cmd), -+ pkt->hdr.cmd, pkt->hdr.sequence, -+ pkt->hdr.flags, le16_to_cpu(pkt->len)); -+ } -+ -+ switch (pkt->hdr.cmd) { -+ case REPLY_RX: /* 802.11 frame */ -+ ipw_handle_reply_rx(priv, rxb); -+ break; -+ -+ case REPLY_ALIVE:{ -+ memcpy(&priv->card_alive, -+ &pkt->u.alive_frame, -+ sizeof(struct ipw_alive_resp)); -+ -+ IPW_DEBUG_INFO -+ ("Alive ucode status 0x%08X revision " -+ "0x%01X 0x%01X\n", -+ priv->card_alive.is_valid, -+ priv->card_alive.ver_type, -+ priv->card_alive.ver_subtype); -+ /* We delay the ALIVE response by 5ms to -+ * give the HW RF Kill time to activate... */ -+ if (priv->card_alive.is_valid == UCODE_VALID_OK) -+ queue_delayed_work(priv-> -+ workqueue, -+ &priv-> -+ alive_start, -+ msecs_to_jiffies(5)); -+ else -+ IPW_WARNING -+ ("uCode did not respond OK.\n"); -+ break; -+ } -+ -+ case REPLY_ADD_STA:{ -+ IPW_DEBUG_RX -+ ("Received REPLY_ADD_STA: 0x%02X\n", -+ pkt->u.status); -+ break; -+ } -+ -+ case REPLY_ERROR:{ -+ u32 err_type = pkt->u.err_resp.enumErrorType; -+ u8 cmd_id = pkt->u.err_resp.currentCmdID; -+ u16 seq = pkt->u.err_resp.erroneousCmdSeqNum; -+ u32 ser = pkt->u.err_resp.errorService; -+ IPW_ERROR("Error Reply type 0x%08X " -+ "cmd %s (0x%02X) " -+ "seq 0x%04X ser 0x%08X\n", -+ err_type, -+ get_cmd_string(cmd_id), -+ cmd_id, seq, ser); -+ break; -+ } -+ case REPLY_TX: -+ ipw_handle_reply_tx(priv, &pkt->u.tx_resp, -+ pkt->hdr.sequence); -+ break; -+ -+ case CHANNEL_SWITCH_NOTIFICATION:{ -+ struct ipw_csa_notification *csa = -+ &(pkt->u.csa_notif); -+ IPW_DEBUG_11H -+ ("CSA notif: channel %d, status %d\n", -+ csa->channel, csa->status); -+ priv->channel = csa->channel; -+ priv->assoc_network = -+ ieee80211_move_network_channel -+ (priv->ieee, priv->assoc_network, -+ csa->channel); -+ break; -+ } -+ -+ case SPECTRUM_MEASURE_NOTIFICATION:{ -+ struct ipw_spectrum_notification -+ *report = &(pkt->u.spectrum_notif); -+ -+ if (!report->state) { -+ IPW_DEBUG(IPW_DL_11H | -+ IPW_DL_INFO, -+ "Spectrum Measure Notification: " -+ "Start\n"); -+ break; -+ } -+ -+ memcpy(&priv->measure_report, report, -+ sizeof(*report)); -+ queue_work(priv->workqueue, &priv->report_work); -+ break; -+ } -+ -+ case QUIET_NOTIFICATION: -+ IPW_DEBUG_INFO("UNHANDLED - Quiet Notification.\n"); -+ break; -+ -+ case MEASURE_ABORT_NOTIFICATION: -+ IPW_DEBUG_INFO -+ ("UNHANDLED - Measure Abort Notification.\n"); -+ break; -+ -+ case RADAR_NOTIFICATION: -+ IPW_DEBUG_INFO("UNHANDLED - Radar Notification.\n"); -+ break; -+ -+ case PM_SLEEP_NOTIFICATION:{ -+#ifdef CONFIG_IPW3945_DEBUG -+ struct ipw_sleep_notification *sleep = -+ &(pkt->u.sleep_notif); -+ IPW_DEBUG_RX -+ ("sleep mode: %d, src: %d\n", -+ sleep->pm_sleep_mode, -+ sleep->pm_wakeup_src); -+#endif -+ break; -+ } -+ -+ case PM_DEBUG_STATISTIC_NOTIFIC: -+ IPW_DEBUG_RADIO -+ ("Dumping %d bytes of unhandled " -+ "notification for %s:\n", -+ le16_to_cpu(pkt->len), -+ get_cmd_string(pkt->hdr.cmd)); -+ printk_buf(IPW_DL_RADIO, pkt->u.raw, -+ le16_to_cpu(pkt->len)); -+ break; -+ -+ case BEACON_NOTIFICATION:{ -+#ifdef CONFIG_IPW3945_DEBUG -+ struct BeaconNtfSpecifics *beacon = -+ &(pkt->u.beacon_status); -+ IPW_DEBUG_INFO -+ ("beacon status %x retries %d iss %d " -+ "tsf %d %d rate %d\n", -+ beacon->bconNotifHdr.status, -+ beacon->bconNotifHdr. -+ failure_frame, -+ beacon->ibssMgrStatus, -+ beacon->highTSF, beacon->lowTSF, -+ beacon->bconNotifHdr.rate); -+#endif -+ } -+ break; -+ -+ case REPLY_STATISTICS_CMD: -+ case STATISTICS_NOTIFICATION: -+ IPW_DEBUG_RX -+ ("Statistics notification received (%zd vs %d).\n", -+ sizeof(priv->statistics), pkt->len); -+ memcpy(&priv->statistics, pkt->u.raw, -+ sizeof(priv->statistics)); -+ break; -+ -+ case WHO_IS_AWAKE_NOTIFICATION: -+ IPW_DEBUG_RX("Notification from the card \n"); -+ break; -+ -+ case SCAN_REQUEST_NOTIFICATION:{ -+#ifdef CONFIG_IPW3945_DEBUG -+ struct ipw_scanreq_notification *notif -+ = -+ (struct ipw_scanreq_notification -+ *)pkt->u.raw; -+ IPW_DEBUG_RX -+ ("Scan request status = 0x%x\n", -+ notif->status); -+#endif -+ break; -+ } -+ -+ case SCAN_START_NOTIFICATION:{ -+ struct ipw_scanstart_notification -+ *notif = -+ (struct ipw_scanstart_notification -+ *)pkt->u.raw; -+ priv->scan_start_tsf = notif->tsf_low; -+ IPW_DEBUG_SCAN("Scan start: " -+ "%d [802.11%s] " -+ "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n", -+ notif->channel, -+ notif-> -+ band ? "bg" : "a", -+ notif->tsf_high, -+ notif->tsf_low, -+ notif->status, -+ notif->beacon_timer); -+ break; -+ } -+ -+ case SCAN_RESULTS_NOTIFICATION:{ -+#ifdef CONFIG_IPW3945_DEBUG -+ struct ipw_scanresults_notification -+ *notif = (struct ipw_scanresults_notification *) -+ pkt->u.raw; -+ -+ IPW_DEBUG_SCAN("Scan ch.res: " -+ "%d [802.11%s] " -+ "(TSF: 0x%08X:%08X) - %d " -+ "elapsed=%lu usec (%dms since last)\n", -+ notif->channel, -+ notif-> -+ band ? "bg" : "a", -+ notif->tsf_high, -+ notif->tsf_low, -+ notif->statistics[0], -+ notif->tsf_low - -+ priv->scan_start_tsf, -+ jiffies_to_msecs -+ (elapsed_jiffies -+ (priv-> -+ last_scan_jiffies, jiffies))); -+#endif -+ priv->last_scan_jiffies = jiffies; -+ break; -+ } -+ -+ case SCAN_COMPLETE_NOTIFICATION:{ -+ struct ipw_scancomplete_notification -+ *scan_notif = -+ (struct ipw_scancomplete_notification *) -+ pkt->u.raw; -+ IPW_DEBUG_SCAN -+ ("Scan complete: %d channels " -+ "(TSF 0x%08X:%08X) - %d\n", -+ scan_notif->scanned_channels, -+ scan_notif->tsf_low, -+ scan_notif->tsf_high, scan_notif->status); -+ -+ ipw_scan_completed(priv, -+ scan_notif->status == 1); -+ break; -+ } -+ -+ case CARD_STATE_NOTIFICATION:{ -+ u32 flags = -+ le32_to_cpu(pkt->u.card_state_notif.flags); -+ u32 status = priv->status; -+ IPW_DEBUG_RF_KILL -+ ("Card state received: " -+ "HW:%s SW:%s\n", -+ (flags & HW_CARD_DISABLED) ? -+ "Off" : "On", -+ (flags & SW_CARD_DISABLED) ? "Off" : "On"); -+ -+ if (flags & HW_CARD_DISABLED) { -+ ipw_write32(priv, -+ CSR_UCODE_DRV_GP1_SET, -+ CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); -+ -+ priv->status |= STATUS_RF_KILL_HW; -+ } else -+ priv->status &= ~STATUS_RF_KILL_HW; -+ -+ if (flags & SW_CARD_DISABLED) -+ priv->status |= STATUS_RF_KILL_SW; -+ else -+ priv->status &= ~STATUS_RF_KILL_SW; -+ -+ priv->status &= -+ ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); -+ -+ ipw_scan_cancel(priv); -+ -+ if (((status & STATUS_RF_KILL_HW) != -+ (priv->status & STATUS_RF_KILL_HW)) -+ || ((status & STATUS_RF_KILL_SW) -+ != (priv->status & STATUS_RF_KILL_SW))) { -+ -+ queue_work(priv->workqueue, -+ &priv->rf_kill); -+ } else -+ wake_up_interruptible(&priv-> -+ wait_command_queue); -+ -+ break; -+ } -+ default: -+ break; -+ } -+ -+ if (pkt_from_hardware) { -+ /* Invoke any callbacks, transfer the skb to -+ * caller, and fire off the (possibly) blocking -+ * ipw_send_cmd() via as we reclaim the queue... */ -+ if (rxb && rxb->skb) -+ ipw_tx_complete(priv, rxb); -+ else -+ IPW_WARNING("Claim null rxb?\n"); -+ } -+ -+ /* For now we just don't re-use anything. We can tweak this -+ * later to try and re-use notification packets and SKBs that -+ * fail to Rx correctly */ -+ if (rxb->skb != NULL) { -+ dev_kfree_skb_any(rxb->skb); -+ rxb->skb = NULL; -+ } -+ -+ pci_unmap_single(priv->pci_dev, rxb->dma_addr, -+ IPW_RX_BUF_SIZE, PCI_DMA_FROMDEVICE); -+ list_add_tail(&rxb->list, &priv->rxq->rx_used); -+ i = (i + 1) % RX_QUEUE_SIZE; -+ } -+ -+ /* Backtrack one entry */ -+ priv->rxq->read = i; -+ ipw_rx_queue_restock(priv); -+} -+ -+/* -+ * This file defines the Wireless Extension handlers. It does not -+ * define any methods of hardware manipulation and relies on the -+ * functions defined in ipw_main to provide the HW interaction. -+ * -+ */ -+ -+static int ipw_wx_get_name(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ if (priv->status & STATUS_RF_KILL_MASK) -+ strcpy(wrqu->name, "radio off"); -+ else if (!(priv->status & STATUS_ASSOCIATED)) -+ strcpy(wrqu->name, "unassociated"); -+ else -+ snprintf(wrqu->name, IFNAMSIZ, "IEEE 802.11%c", -+ ipw_modes[priv->assoc_request.ieee_mode]); -+ IPW_DEBUG_WX("Name: %s\n", wrqu->name); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_set_channel(struct ipw_priv *priv, u8 channel) -+{ -+ if (channel == 0) { -+ IPW_DEBUG_INFO("Setting channel to ANY (0)\n"); -+ priv->config &= ~CFG_STATIC_CHANNEL; -+ IPW_DEBUG_ASSOC("Attempting to associate with new " -+ "parameters.\n"); -+ ipw_associate(priv); -+ return 0; -+ } -+ -+ priv->config |= CFG_STATIC_CHANNEL; -+ if (priv->channel == channel) { -+ IPW_DEBUG_INFO -+ ("Request to set channel to current value (%d)\n", channel); -+ return 0; -+ } -+ -+ IPW_DEBUG_INFO("Setting channel to %i\n", (int)channel); -+ priv->channel = channel; -+ -+ if (priv->ieee->iw_mode == IW_MODE_MONITOR) { -+ ipw_connection_init_rx_config(priv); -+ ipw_rxon_call(priv, 0); -+ } else { -+ /* Network configuration changed -- force [re]association */ -+ IPW_DEBUG_ASSOC -+ ("[re]association triggered due to channel " "change.\n"); -+ if (!ipw_disassociate(priv)) -+ ipw_associate(priv); -+ } -+ -+ return 0; -+} -+ -+static int ipw_wx_set_freq(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct iw_freq *fwrq = &wrqu->freq; -+ int ret = 0; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ if (fwrq->m == 0) { -+ IPW_DEBUG_WX("SET Freq/Channel -> any\n"); -+ mutex_lock(&priv->mutex); -+ ret = ipw_set_channel(priv, 0); -+ mutex_unlock(&priv->mutex); -+ return ret; -+ } -+ -+ /* if setting by freq convert to channel */ -+ if (fwrq->e == 1) { -+ channel = ieee80211_freq_to_channel(priv->ieee, fwrq->m); -+ if (channel == 0) -+ return -EINVAL; -+ } else -+ channel = fwrq->m; -+ if (!ieee80211_is_valid_channel(priv->ieee, channel)) -+ return -EINVAL; -+ IPW_DEBUG_WX("SET Freq/Channel -> %d \n", fwrq->m); -+ mutex_lock(&priv->mutex); -+ ret = ipw_set_channel(priv, channel); -+ -+ mutex_unlock(&priv->mutex); -+ return ret; -+} -+ -+static int ipw_wx_get_freq(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int i; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ /* If we are associated, trying to associate, or have a statically -+ * configured CHANNEL then return that; otherwise return ANY */ -+ mutex_lock(&priv->mutex); -+ if (priv->config & CFG_STATIC_CHANNEL || -+ priv->status & (STATUS_ASSOCIATING | STATUS_ASSOCIATED)) -+ switch (ieee80211_is_valid_channel(priv->ieee, priv->channel)) { -+ case IEEE80211_52GHZ_BAND: -+ i = ieee80211_channel_to_index(priv->ieee, -+ priv->channel); -+ if (i == -1) -+ return -EPERM; -+ wrqu->freq.e = 1; -+ wrqu->freq.m = priv->ieee->geo.a[i].freq * 100000; -+ break; -+ -+ case IEEE80211_24GHZ_BAND: -+ i = ieee80211_channel_to_index(priv->ieee, -+ priv->channel); -+ if (i == -1) -+ return -EPERM; -+ wrqu->freq.e = 1; -+ wrqu->freq.m = priv->ieee->geo.bg[i].freq * 100000; -+ break; -+ -+ default: -+ mutex_unlock(&priv->mutex); -+ return -EPERM; -+ } else -+ wrqu->freq.m = 0; -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_WX("GET Freq/Channel -> %d \n", priv->channel); -+ return 0; -+} -+ -+static int ipw_wx_set_mode(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int err = 0; -+ unsigned long now = jiffies; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ IPW_DEBUG_WX("Set MODE: %d\n", wrqu->mode); -+ mutex_lock(&priv->mutex); -+ if (wrqu->mode == priv->ieee->iw_mode) { -+ mutex_unlock(&priv->mutex); -+ return 0; -+ } -+ -+ cancel_delayed_work(&priv->scan_check); -+ cancel_delayed_work(&priv->gather_stats); -+ priv->status &= ~STATUS_SCAN_PENDING; -+ if (priv->status & STATUS_SCANNING) -+ ipw_abort_scan(priv); -+ -+ while (!time_after(jiffies, now + msecs_to_jiffies(100)) && -+ priv->status & STATUS_SCANNING) -+ msleep(1); -+ -+ if (priv->status & STATUS_SCANNING) -+ IPW_DEBUG_SCAN("Scan still in progress after %dms\n", 100); -+ -+ err = ipw_disassociate(priv); -+ -+ switch (wrqu->mode) { -+#ifdef CONFIG_IPW3945_MONITOR -+ case IW_MODE_MONITOR: -+#endif -+ case IW_MODE_ADHOC: -+ case IW_MODE_INFRA: -+ break; -+ case IW_MODE_AUTO: -+ wrqu->mode = IW_MODE_INFRA; -+ break; -+ default: -+ mutex_unlock(&priv->mutex); -+ return -EINVAL; -+ } -+ -+#ifdef CONFIG_IPW3945_MONITOR -+ if (priv->ieee->iw_mode == IW_MODE_MONITOR) -+ priv->net_dev->type = ARPHRD_ETHER; -+ if (wrqu->mode == IW_MODE_MONITOR) -+#ifdef CONFIG_IEEE80211_RADIOTAP -+ priv->net_dev->type = ARPHRD_IEEE80211_RADIOTAP; -+#else -+ priv->net_dev->type = ARPHRD_IEEE80211; -+#endif -+#endif /* CONFIG_IPW3945_MONITOR */ -+ priv->ieee->iw_mode = wrqu->mode; -+ -+ ipw_connection_init_rx_config(priv); -+ -+ memcpy(priv->rxon.node_addr, priv->net_dev->dev_addr, ETH_ALEN); -+ -+ // switching to managed mode, delete all ibss stations -+ if (wrqu->mode == IW_MODE_INFRA) -+ ipw_delete_stations_table(priv, 1); -+ -+ ipw_rxon_call(priv, 0); -+ ipw_rxon_add_station(priv, BROADCAST_ADDR, 0); -+ -+ if (!err && wrqu->mode != IW_MODE_MONITOR) -+ ipw_associate(priv); -+ -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_get_mode(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ wrqu->mode = priv->ieee->iw_mode; -+ IPW_DEBUG_WX("Get MODE -> %d\n", wrqu->mode); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+/* RTS threshold here is total size [2347] minus 4 FCS bytes -+ * Per spec: -+ * a value of 0 means RTS on all data/management packets -+ * a value > max MSDU size means no RTS -+ * else RTS for data/management frames where MPDU is larger -+ * than RTS value. */ -+#define DEFAULT_RTS_THRESHOLD 2347U -+#define MIN_RTS_THRESHOLD 0U -+#define MAX_RTS_THRESHOLD 2347U -+#define MAX_MSDU_SIZE 2304U -+#define MAX_MPDU_SIZE 2346U -+#define DEFAULT_BEACON_INTERVAL 100U -+#define DEFAULT_SHORT_RETRY_LIMIT 7U -+#define DEFAULT_LONG_RETRY_LIMIT 4U -+ -+/* Values are in microsecond */ -+static const s32 timeout_duration[] = { -+ 350000, -+ 250000, -+ 75000, 37000, 25000, -+}; -+static const s32 period_duration[] = { -+ 400000, -+ 700000, -+ 1000000, -+ 1000000, -+ 1000000 -+}; -+static int ipw_wx_get_range(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct iw_range *range = (struct iw_range *)extra; -+ const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); -+ int i = 0, j, mask; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ wrqu->data.length = sizeof(*range); -+ memset(range, 0, sizeof(*range)); -+ /* 54Mbs == ~27 Mb/s real (802.11g) */ -+ range->throughput = 27 * 1000 * 1000; -+ range->max_qual.qual = 100; -+ /* TODO: Find real max RSSI and stick here */ -+ range->max_qual.level = 0; -+ range->max_qual.noise = priv->ieee->worst_rssi + 0x100; -+ range->max_qual.updated = 7; /* Updated all three */ -+ range->avg_qual.qual = 70; -+ /* TODO: Find real 'good' to 'bad' threshol value for RSSI */ -+ range->avg_qual.level = 0; /* FIXME to real average level */ -+ range->avg_qual.noise = 0; -+ range->avg_qual.updated = 7; /* Updated all three */ -+ mutex_lock(&priv->mutex); -+ -+ j = 0; -+ for (i = 0, mask = 1; i < IPW_MAX_RATES; i++, mask <<= 1) { -+ if (!(priv->active_rate & mask)) -+ continue; -+ range->bitrate[i] = ipw_index_to_rate(i) * 500000; -+ j++; -+ } -+ range->num_bitrates = j; -+ -+ range->max_rts = MAX_RTS_THRESHOLD; -+ range->min_frag = MIN_FRAG_THRESHOLD; -+ range->max_frag = MAX_FRAG_THRESHOLD; -+ range->encoding_size[0] = 5; -+ range->encoding_size[1] = 13; -+ range->num_encoding_sizes = 2; -+ range->max_encoding_tokens = WEP_KEYS; -+ /* Set the Wireless Extension versions */ -+ range->we_version_compiled = WIRELESS_EXT; -+ range->we_version_source = 16; -+ i = 0; -+ if (priv->ieee->mode & (IEEE_B | IEEE_G)) { -+ for (j = 0; -+ j < geo->bg_channels && i < IW_MAX_FREQUENCIES; i++, j++) { -+ range->freq[i].i = geo->bg[j].channel; -+ range->freq[i].m = geo->bg[j].freq * 100000; -+ range->freq[i].e = 1; -+ } -+ } -+ -+ if (priv->ieee->mode & IEEE_A) { -+ for (j = 0; -+ j < geo->a_channels && i < IW_MAX_FREQUENCIES; i++, j++) { -+ range->freq[i].i = geo->a[j].channel; -+ range->freq[i].m = geo->a[j].freq * 100000; -+ range->freq[i].e = 1; -+ } -+ } -+ -+ range->num_channels = i; -+ range->num_frequency = i; -+ -+#if WIRELESS_EXT > 16 -+ /* Event capability (kernel + driver) */ -+ range->event_capa[0] = (IW_EVENT_CAPA_K_0 | -+ IW_EVENT_CAPA_MASK(SIOCGIWTHRSPY) | -+ IW_EVENT_CAPA_MASK(SIOCGIWAP)); -+ range->event_capa[1] = IW_EVENT_CAPA_K_1; -+#endif /* WIRELESS_EXT > 16 */ -+ -+#if WIRELESS_EXT >= 18 -+ range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 | -+ IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP; -+#endif -+ -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_WX("GET Range\n"); -+ return 0; -+} -+ -+static int ipw_wx_set_wap(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ static const unsigned char any[] = { -+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff -+ }; -+ static const unsigned char off[] = { -+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -+ }; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) -+ return -EINVAL; -+ -+ mutex_lock(&priv->mutex); -+ if (!memcmp(any, wrqu->ap_addr.sa_data, ETH_ALEN) || -+ !memcmp(off, wrqu->ap_addr.sa_data, ETH_ALEN)) { -+ /* we disable mandatory BSSID association */ -+ IPW_DEBUG_WX("Setting AP BSSID to ANY\n"); -+ priv->config &= ~CFG_STATIC_BSSID; -+ IPW_DEBUG_ASSOC("Attempting to associate with new " -+ "parameters.\n"); -+ ipw_associate(priv); -+ mutex_unlock(&priv->mutex); -+ return 0; -+ } -+ -+ priv->config |= CFG_STATIC_BSSID; -+ if (!memcmp(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN)) { -+ IPW_DEBUG_WX("BSSID set to current BSSID.\n"); -+ mutex_unlock(&priv->mutex); -+ return 0; -+ } -+ -+ IPW_DEBUG_WX("Setting mandatory BSSID to " MAC_FMT "\n", -+ MAC_ARG(wrqu->ap_addr.sa_data)); -+ memcpy(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN); -+ /* Network configuration changed -- force [re]association */ -+ IPW_DEBUG_ASSOC("[re]association triggered due to BSSID change.\n"); -+ if (!ipw_disassociate(priv)) -+ ipw_associate(priv); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_get_wap(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ /* If we are associated, trying to associate, or have a statically -+ * configured BSSID then return that; otherwise return ANY */ -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ if (priv->config & CFG_STATIC_BSSID || -+ priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) { -+ wrqu->ap_addr.sa_family = ARPHRD_ETHER; -+ memcpy(wrqu->ap_addr.sa_data, &priv->bssid, ETH_ALEN); -+ } else -+ memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); -+ IPW_DEBUG_WX("Getting WAP BSSID: " MAC_FMT "\n", -+ MAC_ARG(wrqu->ap_addr.sa_data)); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+#if WIRELESS_EXT > 20 -+#define IW_ESSID_FIX 0 -+#else -+#define IW_ESSID_FIX 1 -+#define IW_RETRY_LONG IW_RETRY_MAX -+#define IW_RETRY_SHORT IW_RETRY_MIN -+#endif -+ -+static int ipw_wx_set_essid(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ char *essid = ""; /* ANY */ -+ int length = 0; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ if (wrqu->essid.flags && wrqu->essid.length) { -+ length = wrqu->essid.length - IW_ESSID_FIX; -+ essid = extra; -+ } -+ -+ if (length == 0) { -+ IPW_DEBUG_WX("Setting ESSID to ANY\n"); -+ priv->config &= ~CFG_STATIC_ESSID; -+ if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) { -+ IPW_DEBUG_ASSOC -+ ("Attempting to associate with new " -+ "parameters.\n"); -+ ipw_associate(priv); -+ } -+ mutex_unlock(&priv->mutex); -+ return 0; -+ } -+ -+ length = min(length, IW_ESSID_MAX_SIZE); -+ priv->config |= CFG_STATIC_ESSID; -+ if (priv->essid_len == length && !memcmp(priv->essid, extra, length)) { -+ IPW_DEBUG_WX("ESSID set to current ESSID.\n"); -+ mutex_unlock(&priv->mutex); -+ return 0; -+ } -+ -+ IPW_DEBUG_WX("Setting ESSID: '%s' (%d)\n", -+ escape_essid(essid, length), length); -+ priv->essid_len = length; -+ memcpy(priv->essid, essid, priv->essid_len); -+ /* Network configuration changed -- force [re]association */ -+ IPW_DEBUG_ASSOC("[re]association triggered due to ESSID change.\n"); -+ if (!ipw_disassociate(priv)) -+ ipw_associate(priv); -+ -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_get_essid(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ /* If we are associated, trying to associate, or have a statically -+ * configured ESSID then return that; otherwise return ANY */ -+ mutex_lock(&priv->mutex); -+ if (priv->config & CFG_STATIC_ESSID || -+ priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) { -+ IPW_DEBUG_WX("Getting essid: '%s'\n", -+ escape_essid(priv->essid, priv->essid_len)); -+ memcpy(extra, priv->essid, priv->essid_len); -+ wrqu->essid.length = priv->essid_len + IW_ESSID_FIX; -+ wrqu->essid.flags = 1; /* active */ -+ } else { -+ IPW_DEBUG_WX("Getting essid: ANY\n"); -+ wrqu->essid.length = 0; -+ wrqu->essid.flags = 0; /* active */ -+ } -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_set_nick(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ IPW_DEBUG_WX("Setting nick to '%s'\n", extra); -+ -+ if (wrqu->data.length > IW_ESSID_MAX_SIZE) -+ return -E2BIG; -+ -+ mutex_lock(&priv->mutex); -+ wrqu->data.length = min((size_t) wrqu->data.length, sizeof(priv->nick)); -+ memset(priv->nick, 0, sizeof(priv->nick)); -+ memcpy(priv->nick, extra, wrqu->data.length); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_get_nick(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ IPW_DEBUG_WX("Getting nick\n"); -+ mutex_lock(&priv->mutex); -+ wrqu->data.length = strlen(priv->nick) + IW_ESSID_FIX; -+ memcpy(extra, priv->nick, wrqu->data.length); -+ wrqu->data.flags = 1; /* active */ -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_set_rate(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ /* TODO: We should use semaphores or locks for access to priv */ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ u32 target_rate = wrqu->bitrate.value; -+ u32 fixed, mask; -+ int rc = -1; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ /* value = -1, fixed = 0 means auto only, so we should use -+ * all rates offered by AP -+ * value = X, fixed = 1 means only rate X -+ * value = X, fixed = 0 means all rates lower equal X */ -+ if (target_rate == -1) { -+ fixed = 0; -+ mask = IEEE80211_DEFAULT_RATES_MASK; -+ /* Now we should reassociate */ -+ goto apply; -+ } -+ -+ mask = 0; -+ fixed = wrqu->bitrate.fixed; -+ if (target_rate == 1000000 || !fixed) -+ mask |= IEEE80211_CCK_RATE_1MB_MASK; -+ if (target_rate == 1000000) -+ goto apply; -+ if (target_rate == 2000000 || !fixed) -+ mask |= IEEE80211_CCK_RATE_2MB_MASK; -+ if (target_rate == 2000000) -+ goto apply; -+ if (target_rate == 5500000 || !fixed) -+ mask |= IEEE80211_CCK_RATE_5MB_MASK; -+ if (target_rate == 5500000) -+ goto apply; -+ if (target_rate == 6000000 || !fixed) -+ mask |= IEEE80211_OFDM_RATE_6MB_MASK; -+ if (target_rate == 6000000) -+ goto apply; -+ if (target_rate == 9000000 || !fixed) -+ mask |= IEEE80211_OFDM_RATE_9MB_MASK; -+ if (target_rate == 9000000) -+ goto apply; -+ if (target_rate == 11000000 || !fixed) -+ mask |= IEEE80211_CCK_RATE_11MB_MASK; -+ if (target_rate == 11000000) -+ goto apply; -+ if (target_rate == 12000000 || !fixed) -+ mask |= IEEE80211_OFDM_RATE_12MB_MASK; -+ if (target_rate == 12000000) -+ goto apply; -+ if (target_rate == 18000000 || !fixed) -+ mask |= IEEE80211_OFDM_RATE_18MB_MASK; -+ if (target_rate == 18000000) -+ goto apply; -+ if (target_rate == 24000000 || !fixed) -+ mask |= IEEE80211_OFDM_RATE_24MB_MASK; -+ if (target_rate == 24000000) -+ goto apply; -+ if (target_rate == 36000000 || !fixed) -+ mask |= IEEE80211_OFDM_RATE_36MB_MASK; -+ if (target_rate == 36000000) -+ goto apply; -+ if (target_rate == 48000000 || !fixed) -+ mask |= IEEE80211_OFDM_RATE_48MB_MASK; -+ if (target_rate == 48000000) -+ goto apply; -+ if (target_rate == 54000000 || !fixed) -+ mask |= IEEE80211_OFDM_RATE_54MB_MASK; -+ if (target_rate == 54000000) -+ goto apply; -+ IPW_DEBUG_WX("invalid rate specified, returning error\n"); -+ return -EINVAL; -+ apply: -+ IPW_DEBUG_WX("Setting rate mask to 0x%08X [%s]\n", -+ mask, fixed ? "fixed" : "sub-rates"); -+ mutex_lock(&priv->mutex); -+ if (mask == IEEE80211_DEFAULT_RATES_MASK) -+ priv->config &= ~CFG_FIXED_RATE; -+ else -+ priv->config |= CFG_FIXED_RATE; -+ if ((priv->rates_mask & 0xffff) == mask) { -+ IPW_DEBUG_WX("Mask set to current mask.\n"); -+ mutex_unlock(&priv->mutex); -+ return 0; -+ } -+ -+ priv->rates_mask = mask; -+ -+ if (priv->status & STATUS_ASSOCIATED) { -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ mask = -+ ipw_find_compatible_rates(priv, priv->assoc_network, -+ priv->rates_mask); -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ } -+ -+ if (mask) { -+ ipw_set_supported_rates_mask(priv, mask); -+ priv->rxon.cck_basic_rates = -+ ((priv->active_rate_basic & 0xF) | R_1M_MSK); -+ priv->rxon.ofdm_basic_rates = -+ ((priv->active_rate_basic >> 4) | R_6M_MSK); -+ -+ if ((priv->active_rate_basic & 0xF) == 0) -+ priv->rxon.cck_basic_rates = -+ R_1M_MSK | R_2M_MSK | R_5_5M_MSK | R_11M_MSK; -+ if (priv->active_rate_basic >> 4 == 0) -+ priv->rxon.ofdm_basic_rates = -+ R_6M_MSK | R_12M_MSK | R_24M_MSK; -+ -+ rc = ipw_rxon_call(priv, priv->status & STATUS_ASSOCIATED); -+ } -+ -+ if (rc) { -+ /* Network configuration changed -- force [re]association */ -+ IPW_DEBUG_ASSOC -+ ("[re]association triggered due to rates change.\n"); -+ if (!ipw_disassociate(priv)) -+ ipw_associate(priv); -+ } -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_get_rate(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ u32 max_rate; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ /* If we are not actively transmitting data then the -+ * priv->last_rate may be set to a data rate higher -+ * than has actually been configured via ipw_wx_set_rate. */ -+ max_rate = ipw_get_max_rate(priv); -+ if (max_rate >= priv->last_rate) -+ wrqu->bitrate.value = priv->last_rate; -+ else -+ wrqu->bitrate.value = max_rate; -+ wrqu->bitrate.fixed = (priv->config & CFG_FIXED_RATE) ? 1 : 0; -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_WX("GET Rate -> %d \n", wrqu->bitrate.value); -+ return 0; -+} -+ -+static int ipw_wx_set_rts(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ int ret = 0; -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ -+ if (wrqu->rts.disabled) -+ priv->rts_threshold = MAX_RTS_THRESHOLD; -+ else { -+ if (wrqu->rts.value > MAX_RTS_THRESHOLD || -+ wrqu->rts.value < MIN_RTS_THRESHOLD) -+ ret = -EINVAL; -+ else -+ priv->rts_threshold = wrqu->rts.value; -+ } -+ -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_WX("SET RTS Threshold -> %d \n", priv->rts_threshold); -+ return ret; -+} -+ -+static int ipw_wx_get_rts(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ wrqu->rts.value = priv->rts_threshold; -+ wrqu->rts.fixed = 0; /* no auto select */ -+ wrqu->rts.disabled = (wrqu->rts.value > MAX_MSDU_SIZE); -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_WX("GET RTS Threshold -> %d \n", wrqu->rts.value); -+ 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); -+ struct daemon_sync_txpower_limit sync_power; -+ int rc = 0; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ ipw_radio_kill_sw(priv, wrqu->txpower.disabled); -+ -+ if (wrqu->txpower.disabled) { -+ IPW_DEBUG_WX("Turning Tx power OFF\n"); -+ goto out; -+ } -+ -+ IPW_DEBUG_WX("Turning Tx power ON\n"); -+ -+ if (wrqu->txpower.flags != IW_TXPOW_DBM) { -+ IPW_DEBUG_WX("Tx Power must be in dBm\n"); -+ rc = -EINVAL; -+ goto out; -+ } -+ -+ if (!wrqu->txpower.fixed) { -+ IPW_DEBUG_WX -+ ("Setting maximum Tx Power to SKU limit: %ddBm\n", -+ priv->max_channel_txpower_limit); -+ wrqu->txpower.value = priv->max_channel_txpower_limit; -+ priv->config &= ~CFG_TXPOWER_LIMIT; -+ } else if (wrqu->txpower.value > priv->max_channel_txpower_limit) { -+ wrqu->txpower.value = priv->max_channel_txpower_limit; -+ priv->config |= CFG_TXPOWER_LIMIT; -+ } else if (wrqu->txpower.value < -12) { -+ IPW_DEBUG_WX("Tx Power out of range (-12 to %d)\n", -+ priv->max_channel_txpower_limit); -+ rc = -EINVAL; -+ goto out; -+ } else -+ priv->config |= CFG_TXPOWER_LIMIT; -+ -+ if (priv->config & CFG_TXPOWER_LIMIT) -+ priv->user_txpower_limit = wrqu->txpower.value; -+ -+ sync_power.channel = priv->channel; -+ sync_power.power = wrqu->txpower.value; -+ -+ IPW_DEBUG_WX("Tx Power set to %ddBm\n", sync_power.power); -+ -+ ipw_send_daemon_sync(priv, DAEMON_SYNC_TXPOWER_LIMIT, -+ sizeof(sync_power), &sync_power); -+ -+ out: -+ mutex_unlock(&priv->mutex); -+ return rc; -+} -+ -+static int ipw_wx_get_txpow(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ if (priv->status & STATUS_ASSOCIATED) -+ wrqu->txpower.value = priv->actual_txpower_limit; -+ else -+ wrqu->txpower.value = priv->max_channel_txpower_limit; -+ -+ /* If the user specified a power level, report the lower of that -+ * value or what was just calculated. */ -+ if (priv->config & CFG_TXPOWER_LIMIT) { -+ wrqu->txpower.fixed = 1; -+ wrqu->txpower.value = -+ min((int)priv->user_txpower_limit, -+ (int)wrqu->txpower.value); -+ } else -+ wrqu->txpower.fixed = 0; -+ -+ wrqu->txpower.flags = IW_TXPOW_DBM; -+ wrqu->txpower.disabled = (priv->status & STATUS_RF_KILL_MASK) ? 1 : 0; -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_WX("GET TX Power -> %s %d \n", -+ wrqu->txpower.disabled ? "OFF" : "ON", wrqu->power.value); -+ return 0; -+} -+ -+//todoG fix it -+static int ipw_wx_set_frag(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ if (wrqu->frag.disabled) -+ priv->ieee->fts = DEFAULT_FTS; -+ else { -+ if (wrqu->frag.value < MIN_FRAG_THRESHOLD || -+ wrqu->frag.value > MAX_FRAG_THRESHOLD) { -+ mutex_unlock(&priv->mutex); -+ return -EINVAL; -+ } -+ -+ priv->ieee->fts = wrqu->frag.value & ~0x1; -+ } -+ -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_WX("SET Frag Threshold -> %d \n", wrqu->frag.value); -+ return 0; -+} -+ -+static int ipw_wx_get_frag(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ wrqu->frag.value = priv->ieee->fts; -+ wrqu->frag.fixed = 0; /* no auto select */ -+ wrqu->frag.disabled = (wrqu->frag.value == DEFAULT_FTS); -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_WX("GET Frag Threshold -> %d \n", wrqu->frag.value); -+ return 0; -+} -+ -+static int ipw_wx_set_retry(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ IPW_DEBUG_WX("0x%p, 0x%p, 0x%p\n", dev, info, wrqu); -+ -+ if (!(wrqu->retry.flags & IW_RETRY_LIMIT)) -+ return 0; -+ -+ if ((wrqu->retry.value < 1) -+ || (wrqu->retry.value > IPW_MAX_TX_RETRY)) -+ return -EINVAL; -+ -+ mutex_lock(&priv->mutex); -+ priv->data_retry_limit = wrqu->retry.value; -+ mutex_unlock(&priv->mutex); -+ -+ return 0; -+} -+ -+static int ipw_wx_get_retry(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ IPW_DEBUG_WX("0x%p, 0x%p, 0x%p\n", dev, info, wrqu); -+ -+ mutex_lock(&priv->mutex); -+ wrqu->retry.disabled = 0; -+ if (priv->data_retry_limit == -1) -+ wrqu->retry.value = IPW_DEFAULT_TX_RETRY; -+ else -+ wrqu->retry.value = priv->data_retry_limit; -+ -+ wrqu->retry.flags = IW_RETRY_LIMIT; -+ -+ mutex_unlock(&priv->mutex); -+ -+ return 0; -+} -+ -+static int ipw_wx_set_scan(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct iw_scan_req *req = NULL; -+ int rc = 0; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ IPW_DEBUG_WX("Start scan\n"); -+ -+ mutex_lock(&priv->mutex); -+ -+ if (priv->status & STATUS_SCANNING) { -+ IPW_DEBUG_SCAN("Scan in progress; ignoring 2nd request.\n"); -+ mutex_unlock(&priv->mutex); -+ return 0; -+ } -+#if WIRELESS_EXT > 17 -+ if (wrqu->data.length && wrqu->data.length == -+ sizeof(struct iw_scan_req)) { -+ req = (struct iw_scan_req *)extra; -+ if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { -+ priv->one_direct_scan = 1; -+ priv->direct_ssid_len = min(req->essid_len, (u8) -+ IW_ESSID_MAX_SIZE); -+ memcpy(priv->direct_ssid, req->essid, -+ priv->direct_ssid_len); -+ } -+ } -+#endif -+ -+ rc = ipw_scan_initiate(priv, priv->ieee->freq_band, 0); -+ -+ mutex_unlock(&priv->mutex); -+ -+ return rc; -+} -+ -+static int ipw_wx_get_scan(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ return ieee80211_wx_get_scan(priv->ieee, info, wrqu, extra); -+} -+ -+static int ipw_wx_set_encode(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *key) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int rc; -+ u32 cap = priv->capability; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ rc = ieee80211_wx_set_encode(priv->ieee, info, wrqu, key); -+ -+ if (cap != priv->capability && -+ priv->ieee->iw_mode == IW_MODE_ADHOC && -+ priv->status & STATUS_ASSOCIATED) { -+ -+ mutex_lock(&priv->mutex); -+ if (priv->config & CFG_ADHOC_CREATE && -+ priv->config & CFG_STATIC_ESSID && -+ priv->config & CFG_STATIC_CHANNEL && -+ priv->status & STATUS_ASSOCIATED) { -+ -+ if ((priv->capability & CAP_PRIVACY_ON) && -+ (priv->capability & CAP_SHARED_KEY)) { -+ priv->assoc_request.auth_type = AUTH_SHARED_KEY; -+ priv->assoc_request.auth_key = -+ priv->ieee->sec.active_key; -+ } else { -+ priv->assoc_request.auth_type = AUTH_OPEN; -+ priv->assoc_request.auth_key = 0; -+ } -+ -+ if (priv->capability & CAP_PRIVACY_ON) -+ priv->assoc_request.capability |= -+ WLAN_CAPABILITY_PRIVACY; -+ else -+ priv->assoc_request.capability &= -+ ~WLAN_CAPABILITY_PRIVACY; -+ -+ ipw_send_beacon_cmd(priv); -+ } else -+ queue_work(priv->workqueue, &priv->disassociate); -+ -+ mutex_unlock(&priv->mutex); -+ } -+ -+ return rc; -+ -+} -+ -+static int ipw_wx_get_encode(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *key) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ return ieee80211_wx_get_encode(priv->ieee, info, wrqu, key); -+} -+ -+static int ipw_wx_set_power(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int err; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ if (wrqu->power.disabled) { -+ priv->power_mode = IPW_POWER_MODE_CAM; -+ err = ipw_send_power_mode(priv, IPW_POWER_MODE_CAM); -+ if (err) { -+ IPW_DEBUG_WX("failed setting power mode.\n"); -+ mutex_unlock(&priv->mutex); -+ return err; -+ } -+ IPW_DEBUG_WX("SET Power Management Mode -> off\n"); -+ mutex_unlock(&priv->mutex); -+ return 0; -+ } -+ -+ if (wrqu->power.flags & IW_POWER_TYPE) { -+ IPW_DEBUG_WX("SET timeout/period value is not supported.\n"); -+ mutex_unlock(&priv->mutex); -+ return -EOPNOTSUPP; -+ } -+ -+ switch (wrqu->power.flags & IW_POWER_MODE) { -+ case IW_POWER_ON: /* If not specified */ -+ case IW_POWER_MODE: /* If set all mask */ -+ case IW_POWER_ALL_R: /* If explicitely state all */ -+ break; -+ default: /* Otherwise we don't support it */ -+ IPW_DEBUG_WX("SET PM Mode: %X not supported.\n", -+ wrqu->power.flags); -+ mutex_unlock(&priv->mutex); -+ return -EOPNOTSUPP; -+ } -+ -+ /* If the user hasn't specified a power management mode yet, default -+ * to BATTERY */ -+ if ((IPW_POWER_LEVEL(priv->power_mode) == IPW_POWER_AC) || -+ (IPW_POWER_LEVEL(priv->power_mode) == IPW_POWER_MODE_CAM)) -+ priv->power_mode = IPW_POWER_MODE_CAM; -+ else -+ priv->power_mode = IPW_POWER_ENABLED | priv->power_mode; -+ err = ipw_send_power_mode(priv, IPW_POWER_LEVEL(priv->power_mode)); -+ if (err) { -+ IPW_DEBUG_WX("failed setting power mode.\n"); -+ mutex_unlock(&priv->mutex); -+ return err; -+ } -+ -+ IPW_DEBUG_WX("SET Power Management Mode -> 0x%02X\n", priv->power_mode); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_get_power(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int level; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ level = IPW_POWER_LEVEL(priv->power_mode); -+ if (!(priv->power_mode & IPW_POWER_ENABLED)) -+ wrqu->power.disabled = 1; -+ else { -+ wrqu->power.disabled = 0; -+ if (level > 0 && level < 6) { -+ wrqu->power.flags |= IW_POWER_TIMEOUT; -+ wrqu->power.value = timeout_duration[level - 1]; -+ } -+ } -+ mutex_unlock(&priv->mutex); -+ IPW_DEBUG_WX("GET Power Management Mode -> %02X\n", priv->power_mode); -+ return 0; -+} -+ -+#if WIRELESS_EXT > 17 -+/* -+ * WE-18 Support -+ */ -+/* SIOCSIWGENIE */ -+static int ipw_wx_set_genie(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct ieee80211_device *ieee = priv->ieee; -+ u8 *buf; -+ int err = 0; -+ struct ieee80211_info_element *info_element; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ if (wrqu->data.length && extra == NULL) -+ return -EINVAL; -+ -+ info_element = (struct ieee80211_info_element *)extra; -+ -+ //mutex_lock(&priv->mutex); -+ -+ //if (!ieee->wpa_enabled) { -+ // err = -EOPNOTSUPP; -+ // goto out; -+ //} -+ -+ if ((info_element->id == MFIE_TYPE_GENERIC && -+ info_element->len >= 4 && -+ info_element->data[0] == 0x00 && -+ info_element->data[1] == 0x50 && -+ info_element->data[2] == 0xf2 && -+ info_element->data[3] == 0x01) || -+ info_element->id == MFIE_TYPE_RSN) { -+ if (wrqu->data.length) { -+ if (wrqu->data.length > MAX_WPA_IE_LEN) -+ return -EINVAL; -+ -+ buf = kmalloc(wrqu->data.length, GFP_KERNEL); -+ if (buf == NULL) { -+ err = -ENOMEM; -+ goto out; -+ } -+ -+ memcpy(buf, extra, wrqu->data.length); -+ kfree(ieee->wpa_ie); -+ ieee->wpa_ie = buf; -+ ieee->wpa_ie_len = wrqu->data.length; -+ } else { -+ kfree(ieee->wpa_ie); -+ ieee->wpa_ie = NULL; -+ ieee->wpa_ie_len = 0; -+ } -+ -+ ipw_wpa_assoc_frame(priv, ieee->wpa_ie, ieee->wpa_ie_len); -+ } -+ out: -+ //mutex_unlock(&priv->mutex); -+ return err; -+} -+ -+/* SIOCGIWGENIE */ -+static int ipw_wx_get_genie(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct ieee80211_device *ieee = priv->ieee; -+ int err = 0; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ //mutex_lock(&priv->mutex); -+ -+ //if (!ieee->wpa_enabled) { -+ // err = -EOPNOTSUPP; -+ // goto out; -+ //} -+ -+ if (ieee->wpa_ie_len == 0 || ieee->wpa_ie == NULL) { -+ wrqu->data.length = 0; -+ goto out; -+ } -+ -+ if (wrqu->data.length < ieee->wpa_ie_len) { -+ err = -E2BIG; -+ goto out; -+ } -+ -+ wrqu->data.length = ieee->wpa_ie_len; -+ memcpy(extra, ieee->wpa_ie, ieee->wpa_ie_len); -+ -+ out: -+ //mutex_unlock(&priv->mutex); -+ return err; -+} -+ -+/* SIOCSIWAUTH */ -+static int ipw_wx_set_auth(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct ieee80211_device *ieee = priv->ieee; -+ struct iw_param *param = &wrqu->param; -+ struct ieee80211_crypt_data *crypt; -+ unsigned long flags; -+ int ret = 0; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ switch (param->flags & IW_AUTH_INDEX) { -+ case IW_AUTH_WPA_VERSION: -+ case IW_AUTH_CIPHER_PAIRWISE: -+ case IW_AUTH_CIPHER_GROUP: -+ case IW_AUTH_KEY_MGMT: -+ /* -+ * ipw2200 does not use these parameters -+ */ -+ break; -+ -+ case IW_AUTH_TKIP_COUNTERMEASURES: -+ crypt = priv->ieee->crypt[priv->ieee->tx_keyidx]; -+ if (!crypt || !crypt->ops->set_flags || !crypt->ops->get_flags) -+ break; -+ -+ flags = crypt->ops->get_flags(crypt->priv); -+ -+ if (param->value) -+ flags |= IEEE80211_CRYPTO_TKIP_COUNTERMEASURES; -+ else -+ flags &= ~IEEE80211_CRYPTO_TKIP_COUNTERMEASURES; -+ -+ crypt->ops->set_flags(flags, crypt->priv); -+ -+ break; -+ -+ case IW_AUTH_DROP_UNENCRYPTED:{ -+ /* HACK: -+ * -+ * wpa_supplicant calls set_wpa_enabled when the driver -+ * is loaded and unloaded, regardless of if WPA is being -+ * used. No other calls are made which can be used to -+ * determine if encryption will be used or not prior to -+ * association being expected. If encryption is not being -+ * used, drop_unencrypted is set to false, else true -- we -+ * can use this to determine if the CAP_PRIVACY_ON bit should -+ * be set. -+ */ -+ struct ieee80211_security sec = { -+ .flags = SEC_ENABLED, -+ .enabled = param->value, -+ }; -+ priv->ieee->drop_unencrypted = param->value; -+ /* We only change SEC_LEVEL for open mode. Others -+ * are set by ipw_wpa_set_encryption. -+ */ -+ if (!param->value) { -+ sec.flags |= SEC_LEVEL; -+ sec.level = SEC_LEVEL_0; -+ } else { -+ sec.flags |= SEC_LEVEL; -+ sec.level = SEC_LEVEL_1; -+ } -+ if (priv->ieee->set_security) -+ priv->ieee->set_security(priv->ieee->dev, &sec); -+ break; -+ } -+ -+ case IW_AUTH_80211_AUTH_ALG: -+ ret = ipw_wpa_set_auth_algs(priv, param->value); -+ break; -+ -+ case IW_AUTH_WPA_ENABLED: -+ ret = ipw_wpa_enable(priv, param->value); -+ break; -+ -+ case IW_AUTH_RX_UNENCRYPTED_EAPOL: -+ ieee->ieee802_1x = param->value; -+ break; -+ -+ //case IW_AUTH_ROAMING_CONTROL: -+ case IW_AUTH_PRIVACY_INVOKED: -+ ieee->privacy_invoked = param->value; -+ break; -+ -+ default: -+ return -EOPNOTSUPP; -+ } -+ return ret; -+} -+ -+/* SIOCGIWAUTH */ -+static int ipw_wx_get_auth(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct ieee80211_device *ieee = priv->ieee; -+ struct iw_param *param = &wrqu->param; -+ struct ieee80211_crypt_data *crypt; -+ unsigned long flags; -+ int ret = 0; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ switch (param->flags & IW_AUTH_INDEX) { -+ case IW_AUTH_WPA_VERSION: -+ case IW_AUTH_CIPHER_PAIRWISE: -+ case IW_AUTH_CIPHER_GROUP: -+ case IW_AUTH_KEY_MGMT: -+ /* -+ * wpa_supplicant will control these internally -+ */ -+ ret = -EOPNOTSUPP; -+ break; -+ -+ case IW_AUTH_TKIP_COUNTERMEASURES: -+ crypt = priv->ieee->crypt[priv->ieee->tx_keyidx]; -+ if (!crypt || !crypt->ops->set_flags || !crypt->ops->get_flags) -+ break; -+ -+ flags = crypt->ops->get_flags(crypt->priv); -+ -+ if (param->value) -+ flags |= IEEE80211_CRYPTO_TKIP_COUNTERMEASURES; -+ else -+ flags &= ~IEEE80211_CRYPTO_TKIP_COUNTERMEASURES; -+ -+ crypt->ops->set_flags(flags, crypt->priv); -+ -+ break; -+ -+ case IW_AUTH_DROP_UNENCRYPTED: -+ param->value = ieee->drop_unencrypted; -+ break; -+ -+ case IW_AUTH_80211_AUTH_ALG: -+ param->value = ieee->sec.auth_mode; -+ break; -+ -+ case IW_AUTH_WPA_ENABLED: -+ param->value = ieee->wpa_enabled; -+ break; -+ -+ case IW_AUTH_RX_UNENCRYPTED_EAPOL: -+ param->value = ieee->ieee802_1x; -+ break; -+ -+ case IW_AUTH_ROAMING_CONTROL: -+ case IW_AUTH_PRIVACY_INVOKED: -+ param->value = ieee->privacy_invoked; -+ break; -+ -+ default: -+ return -EOPNOTSUPP; -+ } -+ return 0; -+} -+ -+/* SIOCSIWENCODEEXT */ -+static int ipw_wx_set_encodeext(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ /* IPW HW can't build TKIP MIC, host decryption still needed */ -+ if (ext->alg == IW_ENCODE_ALG_TKIP) { -+ priv->ieee->host_encrypt = 1; -+ priv->ieee->host_encrypt_msdu = 1; -+ priv->ieee->host_decrypt = 1; -+ } else { -+ priv->ieee->host_encrypt = 1; -+ priv->ieee->host_encrypt_msdu = 0; -+ priv->ieee->host_decrypt = 1; -+ } -+ -+ return ieee80211_wx_set_encodeext(priv->ieee, info, wrqu, extra); -+} -+ -+/* SIOCGIWENCODEEXT */ -+static int ipw_wx_get_encodeext(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ return ieee80211_wx_get_encodeext(priv->ieee, info, wrqu, extra); -+} -+ -+/* SIOCSIWMLME */ -+static int ipw_wx_set_mlme(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct iw_mlme *mlme = (struct iw_mlme *)extra; -+ u16 reason; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ reason = cpu_to_le16(mlme->reason_code); -+ -+ switch (mlme->cmd) { -+ case IW_MLME_DEAUTH: -+ ipw_disassociate(priv); -+ break; -+ -+ case IW_MLME_DISASSOC: -+ ipw_disassociate(priv); -+ break; -+ -+ default: -+ return -EOPNOTSUPP; -+ } -+ return 0; -+} -+#endif /* WIRELESS_EXT > 17 */ -+ -+static int ipw_wx_set_powermode(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int mode = *(int *)extra; -+ int err; -+ int old_power_mode = priv->power_mode; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ if ((mode < 1) || (mode > IPW_POWER_LIMIT) -+ || (mode == IPW_POWER_AC)) { -+ mode = IPW_POWER_AC; -+ priv->power_mode = mode; -+ } else { -+ priv->power_mode = IPW_POWER_ENABLED | mode; -+ } -+ -+ if (old_power_mode != priv->power_mode) { -+ err = ipw_send_power_mode(priv, mode); -+ if (err) { -+ IPW_DEBUG_WX("failed setting power mode.\n"); -+ mutex_unlock(&priv->mutex); -+ return err; -+ } -+ } -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+#define MAX_WX_STRING 80 -+static int ipw_wx_get_powermode(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int level = IPW_POWER_LEVEL(priv->power_mode); -+ char *p = extra; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ p += snprintf(p, MAX_WX_STRING, "Power save level: %d ", level); -+ switch (level) { -+ case IPW_POWER_MODE_CAM: -+ case IPW_POWER_AC: -+ p += snprintf(p, MAX_WX_STRING - (p - extra), "(AC)"); -+ break; -+ case IPW_POWER_BATTERY: -+ p += snprintf(p, MAX_WX_STRING - (p - extra), "(BATTERY)"); -+ break; -+ default: -+ p += snprintf(p, MAX_WX_STRING - (p - extra), -+ "(Timeout %dms, Period %dms)", -+ timeout_duration[level - 1] / 1000, -+ period_duration[level - 1] / 1000); -+ } -+ -+ if (!(priv->power_mode & IPW_POWER_ENABLED)) -+ p += snprintf(p, MAX_WX_STRING - (p - extra), " OFF"); -+ wrqu->data.length = p - extra + 1; -+ return 0; -+} -+ -+static int ipw_wx_set_wireless_mode(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int mode = *(int *)extra; -+ u8 band = 0, modulation = 0; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ if (mode == 0 || mode & ~IEEE_MODE_MASK) { -+ IPW_WARNING("Attempt to set invalid wireless mode: %d\n", mode); -+ return -EINVAL; -+ } -+ -+ if (mode & IEEE_A) { -+ if (!priv->is_abg) { -+ IPW_WARNING("Attempt to set " -+ "Intel PRO/Wireless 3945BG Network " -+ "Connection into A mode.\n"); -+ return -EINVAL; -+ } -+ -+ band |= IEEE80211_52GHZ_BAND; -+ modulation |= IEEE80211_OFDM_MODULATION; -+ } -+ -+ if (mode & IEEE_B) { -+ band |= IEEE80211_24GHZ_BAND; -+ modulation |= IEEE80211_CCK_MODULATION; -+ } -+ -+ if (mode & IEEE_G) { -+ band |= IEEE80211_24GHZ_BAND; -+ modulation |= IEEE80211_OFDM_MODULATION; -+ } -+ -+ mutex_lock(&priv->mutex); -+ -+ priv->ieee->mode = mode; -+ priv->ieee->freq_band = band; -+ priv->ieee->modulation = modulation; -+ -+ ipw_init_rates_mask(priv); -+ ipw_set_supported_rates_mask(priv, priv->rates_mask); -+ -+ IPW_DEBUG_INFO("ASSOC REQ: Rates: %08X %08X %08X\n", -+ priv->rates_mask, -+ priv->active_rate, priv->active_rate_basic); -+ -+ /* Network configuration changed -- force [re]association */ -+ IPW_DEBUG_ASSOC("[re]association triggered due to mode change.\n"); -+ if (!ipw_disassociate(priv)) -+ ipw_associate(priv); -+ -+ IPW_DEBUG_WX("PRIV SET MODE: %c%c%c\n", -+ mode & IEEE_A ? 'a' : '.', -+ mode & IEEE_B ? 'b' : '.', mode & IEEE_G ? 'g' : '.'); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_get_wireless_mode(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return 0; -+ -+ mutex_lock(&priv->mutex); -+ switch (priv->ieee->mode) { -+ case IEEE_A: -+ strncpy(extra, "802.11a (1)", MAX_WX_STRING); -+ break; -+ case IEEE_B: -+ strncpy(extra, "802.11b (2)", MAX_WX_STRING); -+ break; -+ case IEEE_A | IEEE_B: -+ strncpy(extra, "802.11ab (3)", MAX_WX_STRING); -+ break; -+ case IEEE_G: -+ strncpy(extra, "802.11g (4)", MAX_WX_STRING); -+ break; -+ case IEEE_A | IEEE_G: -+ strncpy(extra, "802.11ag (5)", MAX_WX_STRING); -+ break; -+ case IEEE_B | IEEE_G: -+ strncpy(extra, "802.11bg (6)", MAX_WX_STRING); -+ break; -+ case IEEE_A | IEEE_B | IEEE_G: -+ strncpy(extra, "802.11abg (7)", MAX_WX_STRING); -+ break; -+ default: -+ strncpy(extra, "unknown", MAX_WX_STRING); -+ break; -+ } -+ -+ IPW_DEBUG_WX("PRIV GET MODE: %s\n", extra); -+ wrqu->data.length = strlen(extra) + 1; -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_set_preamble(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int mode = *(int *)extra; -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return 0; -+ -+ mutex_lock(&priv->mutex); -+ /* Switching from SHORT -> LONG requires a disassociation */ -+ if (mode == 1) { -+ if (!(priv->config & CFG_PREAMBLE_LONG)) { -+ priv->config |= CFG_PREAMBLE_LONG; -+ /* Network configuration changed -- force [re]association */ -+ IPW_DEBUG_ASSOC -+ ("[re]association triggered due to preamble change.\n"); -+ if (!ipw_disassociate(priv)) -+ ipw_associate(priv); -+ } -+ goto done; -+ } -+ -+ if (mode == 0) { -+ priv->config &= ~CFG_PREAMBLE_LONG; -+ goto done; -+ } -+ mutex_unlock(&priv->mutex); -+ return -EINVAL; -+ done: -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_wx_get_preamble(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ mutex_lock(&priv->mutex); -+ if (priv->config & CFG_PREAMBLE_LONG) -+ snprintf(wrqu->name, IFNAMSIZ, "long (1)"); -+ else -+ snprintf(wrqu->name, IFNAMSIZ, "auto (0)"); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+#ifdef CONFIG_IPW3945_MONITOR -+static int ipw_wx_set_monitor(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int *parms = (int *)extra; -+ int enable = (parms[0] > 0); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return 0; -+ -+ mutex_lock(&priv->mutex); -+ if (enable) { -+ if (priv->ieee->iw_mode != IW_MODE_MONITOR) { -+#ifdef CONFIG_IEEE80211_RADIOTAP -+ priv->net_dev->type = ARPHRD_IEEE80211_RADIOTAP; -+#else -+ priv->net_dev->type = ARPHRD_IEEE80211; -+#endif -+ IPW_DEBUG(IPW_DL_INFO | IPW_DL_WX, -+ "Restarting adapter to MONITOR mode (ch %d).\n", -+ parms[1]); -+ queue_work(priv->workqueue, &priv->down); -+ } -+ -+ ipw_set_channel(priv, parms[1]); -+ } else { -+ if (priv->ieee->iw_mode != IW_MODE_MONITOR) { -+ mutex_unlock(&priv->mutex); -+ return 0; -+ } -+ priv->net_dev->type = ARPHRD_ETHER; -+ IPW_DEBUG(IPW_DL_INFO | IPW_DL_WX, -+ "Restarting adapter to NORMAL mode.\n"); -+ queue_work(priv->workqueue, &priv->down); -+ } -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+#endif // CONFIG_IPW3945_MONITOR -+ -+static int ipw_wx_reset(struct net_device *dev, -+ struct iw_request_info *info, -+ union iwreq_data *wrqu, char *extra) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (!ipw_is_ready(priv)) -+ return -EAGAIN; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return 0; -+ -+ IPW_DEBUG(IPW_DL_INFO | IPW_DL_WX, "Restarting adapter.\n"); -+ queue_work(priv->workqueue, &priv->down); -+ return 0; -+} -+ -+/* Rebase the WE IOCTLs to zero for the handler array */ -+#define IW_IOCTL(x) [(x)-SIOCSIWCOMMIT] -+static iw_handler ipw_wx_handlers[] = { -+ IW_IOCTL(SIOCGIWNAME) = ipw_wx_get_name, -+ IW_IOCTL(SIOCSIWFREQ) = ipw_wx_set_freq, -+ IW_IOCTL(SIOCGIWFREQ) = ipw_wx_get_freq, -+ IW_IOCTL(SIOCSIWMODE) = ipw_wx_set_mode, -+ IW_IOCTL(SIOCGIWMODE) = ipw_wx_get_mode, -+ IW_IOCTL(SIOCGIWRANGE) = ipw_wx_get_range, -+ IW_IOCTL(SIOCSIWAP) = ipw_wx_set_wap, -+ IW_IOCTL(SIOCGIWAP) = ipw_wx_get_wap, -+ IW_IOCTL(SIOCSIWSCAN) = ipw_wx_set_scan, -+ IW_IOCTL(SIOCGIWSCAN) = ipw_wx_get_scan, -+ IW_IOCTL(SIOCSIWESSID) = ipw_wx_set_essid, -+ IW_IOCTL(SIOCGIWESSID) = ipw_wx_get_essid, -+ IW_IOCTL(SIOCSIWNICKN) = ipw_wx_set_nick, -+ IW_IOCTL(SIOCGIWNICKN) = ipw_wx_get_nick, -+ IW_IOCTL(SIOCSIWRATE) = ipw_wx_set_rate, -+ IW_IOCTL(SIOCGIWRATE) = ipw_wx_get_rate, -+ IW_IOCTL(SIOCSIWRTS) = ipw_wx_set_rts, -+ IW_IOCTL(SIOCGIWRTS) = ipw_wx_get_rts, -+ IW_IOCTL(SIOCSIWFRAG) = ipw_wx_set_frag, -+ IW_IOCTL(SIOCGIWFRAG) = ipw_wx_get_frag, -+ IW_IOCTL(SIOCSIWTXPOW) = ipw_wx_set_txpow, -+ IW_IOCTL(SIOCGIWTXPOW) = ipw_wx_get_txpow, -+ IW_IOCTL(SIOCSIWRETRY) = ipw_wx_set_retry, -+ IW_IOCTL(SIOCGIWRETRY) = ipw_wx_get_retry, -+ IW_IOCTL(SIOCSIWENCODE) = ipw_wx_set_encode, -+ IW_IOCTL(SIOCGIWENCODE) = ipw_wx_get_encode, -+ IW_IOCTL(SIOCSIWPOWER) = ipw_wx_set_power, -+ IW_IOCTL(SIOCGIWPOWER) = ipw_wx_get_power, -+ IW_IOCTL(SIOCSIWSPY) = iw_handler_set_spy, -+ IW_IOCTL(SIOCGIWSPY) = iw_handler_get_spy, -+ IW_IOCTL(SIOCSIWTHRSPY) = iw_handler_set_thrspy, -+ IW_IOCTL(SIOCGIWTHRSPY) = iw_handler_get_thrspy, -+#if WIRELESS_EXT > 17 -+ IW_IOCTL(SIOCSIWGENIE) = ipw_wx_set_genie, -+ IW_IOCTL(SIOCGIWGENIE) = ipw_wx_get_genie, -+ IW_IOCTL(SIOCSIWMLME) = ipw_wx_set_mlme, -+ IW_IOCTL(SIOCSIWAUTH) = ipw_wx_set_auth, -+ IW_IOCTL(SIOCGIWAUTH) = ipw_wx_get_auth, -+ IW_IOCTL(SIOCSIWENCODEEXT) = ipw_wx_set_encodeext, -+ IW_IOCTL(SIOCGIWENCODEEXT) = ipw_wx_get_encodeext, -+#endif -+}; -+ -+#define IPW_PRIV_SET_POWER SIOCIWFIRSTPRIV -+#define IPW_PRIV_GET_POWER SIOCIWFIRSTPRIV+1 -+#define IPW_PRIV_SET_MODE SIOCIWFIRSTPRIV+2 -+#define IPW_PRIV_GET_MODE SIOCIWFIRSTPRIV+3 -+#define IPW_PRIV_SET_PREAMBLE SIOCIWFIRSTPRIV+4 -+#define IPW_PRIV_GET_PREAMBLE SIOCIWFIRSTPRIV+5 -+#define IPW_PRIV_SET_MONITOR SIOCIWFIRSTPRIV+6 -+#define IPW_PRIV_RESET SIOCIWFIRSTPRIV+7 -+/* *INDENT-OFF* */ -+static struct iw_priv_args ipw_priv_args[] = { -+ { -+ .cmd = IPW_PRIV_SET_POWER, -+ .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, -+ .name = "set_power" -+ }, { -+ .cmd = IPW_PRIV_GET_POWER, -+ .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING, -+ .name = "get_power" -+ }, { -+ .cmd = IPW_PRIV_SET_MODE, -+ .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, -+ .name = "set_mode" -+ }, { -+ .cmd = IPW_PRIV_GET_MODE, -+ .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING, -+ .name = "get_mode" -+ }, { -+ .cmd = IPW_PRIV_SET_PREAMBLE, -+ .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, -+ .name = "set_preamble" -+ }, { -+ .cmd = IPW_PRIV_GET_PREAMBLE, -+ .get_args = IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | IFNAMSIZ, -+ .name = "get_preamble" -+ }, { -+ .cmd = IPW_PRIV_RESET, -+ .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED, -+ .name = "reset" -+ }, -+#ifdef CONFIG_IPW3945_MONITOR -+ { -+ .cmd = IPW_PRIV_SET_MONITOR, -+ .set_args = IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, -+ .name = "monitor" -+ }, -+#endif /* CONFIG_IPW3945_MONITOR */ -+}; -+/* *INDENT-ON* */ -+static iw_handler ipw_priv_handler[] = { -+ -+ ipw_wx_set_powermode, -+ ipw_wx_get_powermode, -+ ipw_wx_set_wireless_mode, -+ ipw_wx_get_wireless_mode, -+ ipw_wx_set_preamble, -+ ipw_wx_get_preamble, -+ ipw_wx_reset, -+#ifdef CONFIG_IPW3945_MONITOR -+ ipw_wx_set_monitor, -+#endif -+}; -+ -+/* -+ * Get wireless statistics. -+ * Called by /proc/net/wireless -+ * Also called by SIOCGIWSTATS -+ */ -+static struct iw_statistics *ipw_get_wireless_stats(struct net_device -+ *dev) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct iw_statistics *wstats; -+ wstats = &priv->wstats; -+ -+ /* ipw_get_wireless_stats seems to be called before fw is -+ * initialized. STATUS_ASSOCIATED will only be set if the hw is up -+ * and associated; if not associcated, the values are all meaningless -+ * anyway, so set them all to NULL and INVALID */ -+ if (!(priv->status & STATUS_ASSOCIATED)) { -+ wstats->miss.beacon = 0; -+ wstats->discard.retries = 0; -+ wstats->qual.qual = 0; -+ wstats->qual.level = 0; -+ wstats->qual.noise = 0; -+ wstats->qual.updated = 7; -+ wstats->qual.updated |= IW_QUAL_NOISE_INVALID | -+ IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_INVALID; -+ return wstats; -+ } -+ -+ wstats->qual.qual = priv->quality; -+ wstats->qual.level = average_value(&priv->average_rssi); -+ wstats->qual.noise = average_value(&priv->average_noise); -+ wstats->qual.updated = -+ IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | -+ IW_QUAL_NOISE_UPDATED; -+ if (!wstats->qual.level) -+ wstats->qual.updated |= IW_QUAL_LEVEL_INVALID; -+ if (!wstats->qual.qual) -+ wstats->qual.updated |= IW_QUAL_QUAL_INVALID; -+ if (!wstats->qual.noise) -+ wstats->qual.updated |= IW_QUAL_NOISE_INVALID; -+ wstats->miss.beacon = average_value(&priv->average_missed_beacons); -+ wstats->discard.retries = priv->last_tx_failures; -+ wstats->discard.code = priv->ieee->ieee_stats.rx_discards_undecryptable; -+ -+ /* TODO -- get the TX RETRY stats -+ * -+ * wstats->discard.retries += tx_retry; -+ */ -+ return wstats; -+} -+ -+static struct iw_handler_def ipw_wx_handler_def = { -+ .standard = ipw_wx_handlers, -+ .num_standard = ARRAY_SIZE(ipw_wx_handlers), -+ .num_private = ARRAY_SIZE(ipw_priv_handler), -+ .num_private_args = ARRAY_SIZE(ipw_priv_args), -+ .private = ipw_priv_handler, -+ .private_args = ipw_priv_args, -+#if WIRELESS_EXT > 16 -+ .get_wireless_stats = ipw_get_wireless_stats, -+#endif -+}; -+ -+/* net device stuff */ -+ -+static int ipw_net_open(struct net_device *dev) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ IPW_DEBUG_INFO("dev->open\n"); -+ /* we should be verifying the device is ready to be opened */ -+ mutex_lock(&priv->mutex); -+ if (!(priv->status & STATUS_RF_KILL_MASK) && -+ (priv->status & STATUS_ASSOCIATED)) -+ netif_start_queue(dev); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static int ipw_net_stop(struct net_device *dev) -+{ -+ IPW_DEBUG_INFO("dev->close\n"); -+ netif_stop_queue(dev); -+ return 0; -+} -+ -+/*************** RATE-SCALING fumctions ***********************/ -+ -+static s8 ipw_lower_rate_g[NUM_RATES] = { -+ RATE_SCALE_5_5M_INDEX, RATE_SCALE_5_5M_INDEX, -+ RATE_SCALE_11M_INDEX, RATE_SCALE_12M_INDEX, -+ RATE_SCALE_18M_INDEX, RATE_SCALE_24M_INDEX, -+ RATE_SCALE_36M_INDEX, RATE_SCALE_48M_INDEX, -+ 255, RATE_SCALE_1M_INDEX, RATE_SCALE_2M_INDEX, -+ RATE_SCALE_5_5M_INDEX, -+ -+}; -+ -+static s8 ipw_higher_rate_g[NUM_RATES] = { -+ RATE_SCALE_11M_INDEX, RATE_SCALE_11M_INDEX, -+ RATE_SCALE_18M_INDEX, -+ RATE_SCALE_24M_INDEX, RATE_SCALE_36M_INDEX, -+ RATE_SCALE_48M_INDEX, -+ RATE_SCALE_54M_INDEX, 255, RATE_SCALE_2M_INDEX, -+ RATE_SCALE_5_5M_INDEX, RATE_SCALE_11M_INDEX, -+ RATE_SCALE_12M_INDEX -+}; -+ -+static s32 ipw_expected_tpt_g[NUM_RATES] = { -+ 0, 0, 76, 104, 130, 168, 191, 202, 7, 13, 35, 58 -+}; -+ -+static s32 ipw_expected_tpt_g_prot[NUM_RATES] = { -+ 0, 0, 0, 80, 93, 113, 123, 125, 7, 13, 35, 58 -+}; -+ -+static s32 ipw_expected_tpt_a[NUM_RATES] = { -+ 40, 57, 72, 98, 121, 154, 177, 186, 0, 0, 0, 0 -+}; -+ -+static s32 ipw_expected_tpt_b[NUM_RATES] = { -+ 0, 0, 0, 0, 0, 0, 0, 0, 7, 13, 35, 58 -+}; -+ -+static s8 ipw_lower_rate_g_prot[NUM_RATES] = { -+ RATE_SCALE_5_5M_INDEX, RATE_SCALE_5_5M_INDEX, -+ RATE_SCALE_11M_INDEX, -+ RATE_SCALE_11M_INDEX, RATE_SCALE_18M_INDEX, -+ RATE_SCALE_24M_INDEX, -+ RATE_SCALE_36M_INDEX, RATE_SCALE_48M_INDEX, 255, -+ RATE_SCALE_1M_INDEX, RATE_SCALE_2M_INDEX, -+ RATE_SCALE_5_5M_INDEX, -+}; -+ -+static s8 ipw_higher_rate_g_prot[NUM_RATES] = { -+ RATE_SCALE_11M_INDEX, RATE_SCALE_11M_INDEX, -+ RATE_SCALE_18M_INDEX, -+ RATE_SCALE_24M_INDEX, RATE_SCALE_36M_INDEX, -+ RATE_SCALE_48M_INDEX, -+ RATE_SCALE_54M_INDEX, 255, RATE_SCALE_2M_INDEX, -+ RATE_SCALE_5_5M_INDEX, RATE_SCALE_11M_INDEX, -+ RATE_SCALE_18M_INDEX -+}; -+ -+static struct ipw_tpt_entry ipw_tpt_table_a[] = { -+ {-60, 22000, 0, 0, RATE_SCALE_54M_INDEX}, -+ {-64, 20000, 0, 0, RATE_SCALE_48M_INDEX}, -+ {-72, 18000, 0, 0, RATE_SCALE_36M_INDEX}, -+ {-80, 16000, 0, 0, RATE_SCALE_24M_INDEX}, -+ {-84, 12000, 0, 0, RATE_SCALE_18M_INDEX}, -+ {-85, 8000, 0, 0, RATE_SCALE_12M_INDEX}, -+ {-87, 7000, 0, 0, RATE_SCALE_9M_INDEX}, -+ {-89, 5000, 0, 0, RATE_SCALE_6M_INDEX} -+}; -+ -+static struct ipw_tpt_entry ipw_tpt_table_b[] = { -+ {-86, 6000, 0, 0, RATE_SCALE_11M_INDEX}, -+ {-88, 3000, 0, 0, RATE_SCALE_5_5M_INDEX}, -+ {-90, 1000, 0, 0, RATE_SCALE_2M_INDEX}, -+ {-92, 800, 0, 0, RATE_SCALE_1M_INDEX} -+ -+}; -+ -+static struct ipw_tpt_entry ipw_tpt_table_g[] = { -+ {-60, 22000, 12000, 14000, RATE_SCALE_54M_INDEX}, -+ {-64, 20000, 11000, 13000, RATE_SCALE_48M_INDEX}, -+ {-68, 18000, 10000, 14000, RATE_SCALE_36M_INDEX}, -+ {-80, 16000, 9000, 11000, RATE_SCALE_24M_INDEX}, -+ {-84, 12000, 7000, 10000, RATE_SCALE_18M_INDEX}, -+ {-85, 8000, 5000, 8000, RATE_SCALE_12M_INDEX}, -+ {-86, 6000, 6000, 6000, RATE_SCALE_11M_INDEX}, -+ {-88, 3000, 3000, 3000, RATE_SCALE_5_5M_INDEX}, -+ {-90, 1000, 1000, 1000, RATE_SCALE_2M_INDEX}, -+ {-92, 800, 800, 800, RATE_SCALE_1M_INDEX} -+}; -+ -+static struct ipw_tpt_entry *ipw_get_tpt_by_rssi(s32 rssi, u8 mode) -+{ -+ u32 index = 0; -+ u32 table_size = 0; -+ struct ipw_tpt_entry *tpt_table = NULL; -+ -+ if ((rssi < IPW_MIN_RSSI_VAL) || (rssi > IPW_MAX_RSSI_VAL)) -+ rssi = IPW_MIN_RSSI_VAL; -+ -+ switch (mode) { -+ case IPW_G_MODE: -+ tpt_table = ipw_tpt_table_g; -+ table_size = ARRAY_SIZE(ipw_tpt_table_g); -+ break; -+ -+ case IPW_B_MODE: -+ tpt_table = ipw_tpt_table_b; -+ table_size = ARRAY_SIZE(ipw_tpt_table_b); -+ break; -+ -+ case IPW_A_MODE: -+ tpt_table = ipw_tpt_table_a; -+ table_size = ARRAY_SIZE(ipw_tpt_table_a); -+ break; -+ -+ default: -+ BUG(); -+ return NULL; -+ } -+ -+ while ((index < table_size) -+ && (rssi < tpt_table[index].min_rssi)) -+ index++; -+ -+ index = min(index, (table_size - 1)); -+ -+ return &tpt_table[index]; -+} -+ -+static int ipw_update_rate_scaling(struct ipw_priv *priv, u8 mode) -+{ -+ int rc; -+ struct RateScalingCmdSpecifics *cmd; -+ struct rate_scaling_info *table; -+ unsigned long flags; -+ -+ cmd = &priv->rate_scale_mgr.scale_rate_cmd; -+ table = &cmd->rate_scale_table[0]; -+ -+ spin_lock_irqsave(&priv->rate_scale_mgr.lock, flags); -+ -+ priv->rate_scale_mgr.flush_time = IPW_RATE_SCALE_FLUSH; -+ priv->rate_scale_mgr.stamp_last = jiffies; -+ priv->rate_scale_mgr.tx_packets = 0; -+ -+ if (mode == IPW_A_MODE) { -+ IPW_DEBUG_RATE("Select A mode rate scale\n"); -+ -+ table[RATE_SCALE_6M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_6M_INDEX].next_rate_index = -+ RATE_SCALE_6M_INDEX; -+ table[RATE_SCALE_9M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_9M_INDEX].next_rate_index = -+ RATE_SCALE_6M_INDEX; -+ table[RATE_SCALE_12M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_12M_INDEX].next_rate_index = -+ RATE_SCALE_9M_INDEX; -+ table[RATE_SCALE_18M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_18M_INDEX].next_rate_index = -+ RATE_SCALE_12M_INDEX; -+ table[RATE_SCALE_24M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_24M_INDEX].next_rate_index = -+ RATE_SCALE_18M_INDEX; -+ table[RATE_SCALE_36M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_36M_INDEX].next_rate_index = -+ RATE_SCALE_24M_INDEX; -+ table[RATE_SCALE_48M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_48M_INDEX].next_rate_index = -+ RATE_SCALE_36M_INDEX; -+ table[RATE_SCALE_54M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_54M_INDEX].next_rate_index = -+ RATE_SCALE_48M_INDEX; -+ -+ /* If one of the following CCK rates is used, -+ * have it fall back to an above OFDM rate */ -+ table[RATE_SCALE_1M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_1M_INDEX].next_rate_index = -+ RATE_SCALE_6M_INDEX; -+ table[RATE_SCALE_2M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_2M_INDEX].next_rate_index = -+ RATE_SCALE_6M_INDEX; -+ table[RATE_SCALE_5_5M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_5_5M_INDEX].next_rate_index = -+ RATE_SCALE_6M_INDEX; -+ table[RATE_SCALE_11M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_11M_INDEX].next_rate_index = -+ RATE_SCALE_6M_INDEX; -+ } else if (mode == IPW_B_MODE) { -+ IPW_DEBUG_RATE("Select B mode rate scale\n"); -+ -+ /* If one of the following OFDM rates is used, -+ * have it fall back to the CCK rates at the end */ -+ table[RATE_SCALE_6M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_6M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_9M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_9M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_12M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_12M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_18M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_18M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_24M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_24M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_36M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_36M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_48M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_48M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_54M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_54M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ -+ /* CCK rates... */ -+ table[RATE_SCALE_1M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_1M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_2M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_2M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_5_5M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_5_5M_INDEX].next_rate_index = -+ RATE_SCALE_2M_INDEX; -+ table[RATE_SCALE_11M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_11M_INDEX].next_rate_index = -+ RATE_SCALE_5_5M_INDEX; -+ } else { -+ IPW_DEBUG_RATE("Select G mode rate scale\n"); -+ -+ table[RATE_SCALE_6M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_6M_INDEX].next_rate_index = -+ RATE_SCALE_2M_INDEX; -+ table[RATE_SCALE_9M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_9M_INDEX].next_rate_index = -+ RATE_SCALE_6M_INDEX; -+ table[RATE_SCALE_12M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_12M_INDEX].next_rate_index = -+ RATE_SCALE_9M_INDEX; -+ table[RATE_SCALE_18M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_18M_INDEX].next_rate_index = -+ RATE_SCALE_12M_INDEX; -+ table[RATE_SCALE_24M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_24M_INDEX].next_rate_index = -+ RATE_SCALE_18M_INDEX; -+ table[RATE_SCALE_36M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_36M_INDEX].next_rate_index = -+ RATE_SCALE_24M_INDEX; -+ table[RATE_SCALE_48M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_48M_INDEX].next_rate_index = -+ RATE_SCALE_36M_INDEX; -+ table[RATE_SCALE_54M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_54M_INDEX].next_rate_index = -+ RATE_SCALE_48M_INDEX; -+ table[RATE_SCALE_1M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_1M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_2M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_2M_INDEX].next_rate_index = -+ RATE_SCALE_1M_INDEX; -+ table[RATE_SCALE_5_5M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_5_5M_INDEX].next_rate_index = -+ RATE_SCALE_2M_INDEX; -+ table[RATE_SCALE_11M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_11M_INDEX].next_rate_index = -+ RATE_SCALE_5_5M_INDEX; -+ } -+ -+ /* Update the rate scaling for control frame Tx */ -+ cmd->table_id = 0; -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ -+ rc = ipw_send_rates_scaling_cmd(priv, cmd); -+ if (rc) -+ return rc; -+ -+ /* Update the rate scaling for data frame Tx */ -+ cmd->table_id = 1; -+ rc = ipw_send_rates_scaling_cmd(priv, cmd); -+ -+ return rc; -+} -+ -+static int ipw_rate_scale_clear_window(struct ipw_rate_scale_data -+ *window) -+{ -+ -+ window->data = 0; -+ window->success_counter = 0; -+ window->success_ratio = IPW_INVALID_VALUE; -+ window->counter = 0; -+ window->average_tpt = IPW_INVALID_VALUE; -+ window->stamp = 0; -+ return 0; -+} -+ -+static int ipw_rate_scale_flush_old(struct ipw_priv *priv, u32 flush_interval) -+{ -+ int rc = 0; -+ s32 rate_index = 0; -+ unsigned long flags; -+ struct ipw_rate_scale_data *window; -+ -+ for (rate_index = 0; rate_index < NUM_RATES; rate_index++) { -+ window = &priv->rate_scale_mgr.window[rate_index]; -+ -+ spin_lock_irqsave(&priv->rate_scale_mgr.lock, flags); -+ if (window->counter > 0) { -+ if (time_after(jiffies, window->stamp + flush_interval)) { -+ IPW_DEBUG_RATE -+ ("flushed samples of rate index %d\n", -+ rate_index); -+ ipw_rate_scale_clear_window(window); -+ } else -+ rc = 1; -+ -+ } -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ } -+ -+ return rc; -+} -+ -+#define IPW_RATE_SCALE_AVG_PACKETS 300 -+#define IPW_RATE_FLUSH_MAX 5000 // msec -+#define IPW_RATE_FLUSH_MIN 50 // msec -+ -+static void ipw_bg_rate_scale_flush(void *data) -+{ -+ struct ipw_priv *priv = data; -+ int rc = 0; -+ unsigned long flags; -+ u32 tx_ave, duration; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ -+ if (!(priv->status & STATUS_ASSOCIATED)) -+ goto done; -+ -+ rc = ipw_rate_scale_flush_old(priv, IPW_RATE_SCALE_WIN_FLUSH); -+ -+ spin_lock_irqsave(&priv->rate_scale_mgr.lock, flags); -+ -+ tx_ave = (priv->tx_packets - priv->rate_scale_mgr.tx_packets) -+ + 1; -+ -+ priv->rate_scale_mgr.tx_packets = priv->tx_packets + 1; -+ -+ if (rc && !(priv->status & STATUS_EXIT_PENDING)) { -+ cancel_delayed_work(&priv->rate_scale_flush); -+ -+ duration = priv->rate_scale_mgr.flush_time * 1000 / HZ; -+ IPW_DEBUG_RATE("Packets: %d duration: %d msec\n", -+ tx_ave, duration); -+ if (duration == 0) -+ tx_ave = 0; -+ else -+ tx_ave = (tx_ave * 1000) / duration; -+ -+ if (tx_ave == 0) -+ duration = IPW_RATE_FLUSH_MAX; -+ else { -+ duration = (IPW_RATE_SCALE_AVG_PACKETS) / tx_ave; -+ -+ if (duration > IPW_RATE_FLUSH_MAX) -+ duration = IPW_RATE_FLUSH_MAX; -+ else if (duration < IPW_RATE_FLUSH_MIN) -+ duration = IPW_RATE_FLUSH_MIN; -+ } -+ priv->rate_scale_mgr.flush_time = duration * HZ / 1000; -+ -+ IPW_DEBUG_RATE("new flush period: %d msec ave %d\n", -+ duration, tx_ave); -+ -+ queue_delayed_work(priv->workqueue, -+ &priv->rate_scale_flush, -+ priv->rate_scale_mgr.flush_time); -+ priv->rate_scale_mgr.stamp = jiffies; -+ } -+ -+ priv->rate_scale_mgr.stamp_last = jiffies; -+ -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ -+ done: -+ mutex_unlock(&priv->mutex); -+} -+ -+static int ipw_rate_scale_init_handle(struct ipw_priv *priv, s32 window_size) -+{ -+ int rc = 0; -+ int i; -+ unsigned long flags; -+ struct RateScalingCmdSpecifics *cmd; -+ struct rate_scaling_info *table; -+ -+ cmd = &priv->rate_scale_mgr.scale_rate_cmd; -+ memset(cmd, 0, sizeof(cmd)); -+ table = &cmd->rate_scale_table[0]; -+ -+ IPW_DEBUG_RATE("initialize rate scale window to %d\n", window_size); -+ -+ if ((window_size > IPW_RATE_SCALE_MAX_WINDOW) -+ || (window_size < 0)) -+ window_size = IPW_RATE_SCALE_MAX_WINDOW; -+ -+ spin_lock_irqsave(&priv->rate_scale_mgr.lock, flags); -+ -+ priv->rate_scale_mgr.expected_tpt = NULL; -+ priv->rate_scale_mgr.next_higher_rate = NULL; -+ priv->rate_scale_mgr.next_lower_rate = NULL; -+ -+ priv->rate_scale_mgr.stamp = jiffies; -+ priv->rate_scale_mgr.stamp_last = jiffies; -+ priv->rate_scale_mgr.flush_time = IPW_RATE_SCALE_FLUSH; -+ priv->rate_scale_mgr.tx_packets = 0; -+ -+ priv->rate_scale_mgr.max_window_size = window_size; -+ -+ for (i = 0; i < NUM_RATES; i++) -+ ipw_rate_scale_clear_window(&priv->rate_scale_mgr.window[i]); -+ -+ table[RATE_SCALE_6M_INDEX].tx_rate = R_6M; -+ table[RATE_SCALE_6M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_6M_INDEX].next_rate_index = RATE_SCALE_11M_INDEX; -+ -+ table[RATE_SCALE_9M_INDEX].tx_rate = R_9M; -+ table[RATE_SCALE_9M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_9M_INDEX].next_rate_index = RATE_SCALE_6M_INDEX; -+ -+ table[RATE_SCALE_12M_INDEX].tx_rate = R_12M; -+ table[RATE_SCALE_12M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_12M_INDEX].next_rate_index = RATE_SCALE_9M_INDEX; -+ -+ table[RATE_SCALE_18M_INDEX].tx_rate = R_18M; -+ table[RATE_SCALE_18M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_18M_INDEX].next_rate_index = RATE_SCALE_12M_INDEX; -+ -+ table[RATE_SCALE_24M_INDEX].tx_rate = R_24M; -+ table[RATE_SCALE_24M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_24M_INDEX].next_rate_index = RATE_SCALE_18M_INDEX; -+ -+ table[RATE_SCALE_36M_INDEX].tx_rate = R_36M; -+ table[RATE_SCALE_36M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_36M_INDEX].next_rate_index = RATE_SCALE_24M_INDEX; -+ -+ table[RATE_SCALE_48M_INDEX].tx_rate = R_48M; -+ table[RATE_SCALE_48M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_48M_INDEX].next_rate_index = RATE_SCALE_36M_INDEX; -+ -+ table[RATE_SCALE_54M_INDEX].tx_rate = R_54M; -+ table[RATE_SCALE_54M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_54M_INDEX].next_rate_index = RATE_SCALE_48M_INDEX; -+ -+ table[RATE_SCALE_1M_INDEX].tx_rate = R_1M; -+ table[RATE_SCALE_1M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_1M_INDEX].next_rate_index = RATE_SCALE_1M_INDEX; -+ -+ table[RATE_SCALE_2M_INDEX].tx_rate = R_2M; -+ table[RATE_SCALE_2M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_2M_INDEX].next_rate_index = RATE_SCALE_1M_INDEX; -+ -+ table[RATE_SCALE_5_5M_INDEX].tx_rate = R_5_5M; -+ table[RATE_SCALE_5_5M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_5_5M_INDEX].next_rate_index = RATE_SCALE_2M_INDEX; -+ -+ table[RATE_SCALE_11M_INDEX].tx_rate = R_11M; -+ table[RATE_SCALE_11M_INDEX].try_cnt = priv->retry_rate; -+ table[RATE_SCALE_11M_INDEX].next_rate_index = RATE_SCALE_5_5M_INDEX; -+ -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ -+ return rc; -+} -+ -+static int ipw_collect_tx_data(struct ipw_priv *priv, int scale_index, -+ u32 status) -+{ -+ int rc = 0; -+ struct ipw_rate_scale_data *window = NULL; -+ unsigned long flags; -+ u64 old_data; -+ -+ if (scale_index < 0) -+ return -1; -+ -+ if ((priv->rate_scale_mgr.max_window_size < 0) || -+ (priv->rate_scale_mgr.max_window_size > IPW_RATE_SCALE_MAX_WINDOW)) -+ return -1; -+ -+ if (scale_index >= NUM_RATES) -+ return -1; -+ -+ spin_lock_irqsave(&priv->rate_scale_mgr.lock, flags); -+ -+ old_data = window->data; -+ window = &priv->rate_scale_mgr.window[scale_index]; -+ if (window->counter >= priv->rate_scale_mgr.max_window_size) { -+ u64 mask; -+ -+ window->counter = priv->rate_scale_mgr.max_window_size; -+ window->counter--; -+ mask = (1 << (priv->rate_scale_mgr.max_window_size - 1)); -+ if ((window->data & mask) != 0) { -+ window->data &= ~mask; -+ window->success_counter--; -+ } -+ } -+ -+ window->counter++; -+ window->data = window->data << 1; -+ if (status != 0) { -+ window->success_counter++; -+ window->data |= 0x1; -+ } -+ -+ if (window->counter > 0) { -+ window->success_ratio = 128 * (100 * window->success_counter) -+ / window->counter; -+ } else -+ window->success_ratio = IPW_INVALID_VALUE; -+ -+ window->stamp = jiffies; -+ -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ -+ return rc; -+} -+ -+static int ipw_rate_scale_rxon_handle(struct ipw_priv *priv, s32 sta_id) -+{ -+ int rc = 0; -+ int i; -+ s32 rssi; -+ u8 mode; -+ struct ipw_tpt_entry *entry = NULL; -+ unsigned long flags; -+ -+ if ((priv->rxon.filter_flags & RXON_FILTER_ASSOC_MSK) == 0) -+ return rc; -+ -+ spin_lock_irqsave(&priv->rate_scale_mgr.lock, flags); -+ -+ priv->rate_scale_mgr.next_lower_rate = ipw_lower_rate_g; -+ priv->rate_scale_mgr.next_higher_rate = ipw_higher_rate_g; -+ -+ if (priv->rxon.flags & RXON_FLG_BAND_24G_MSK) { -+ -+ if (priv->assoc_request.ieee_mode == IPW_G_MODE) { -+ mode = IPW_G_MODE; -+ if (priv->rxon.flags & RXON_FLG_TGG_PROTECT_MSK) { -+ priv->rate_scale_mgr.expected_tpt = -+ ipw_expected_tpt_g_prot; -+ priv->rate_scale_mgr. -+ next_higher_rate = ipw_higher_rate_g_prot; -+ priv->rate_scale_mgr.next_lower_rate = -+ ipw_lower_rate_g_prot; -+ } else { -+ priv->rate_scale_mgr.expected_tpt = -+ ipw_expected_tpt_g; -+ priv->rate_scale_mgr.next_lower_rate = -+ ipw_lower_rate_g; -+ priv->rate_scale_mgr. -+ next_higher_rate = ipw_higher_rate_g; -+ } -+ } else { -+ mode = IPW_B_MODE; -+ priv->rate_scale_mgr.expected_tpt = ipw_expected_tpt_b; -+ } -+ } else { -+ mode = IPW_A_MODE; -+ priv->rate_scale_mgr.expected_tpt = ipw_expected_tpt_a; -+ } -+ -+ for (i = 0; i < NUM_RATES; i++) -+ ipw_rate_scale_clear_window(&priv->rate_scale_mgr.window[i]); -+ -+ rssi = priv->assoc_network->stats.rssi; -+ -+ if (rssi == 0) -+ rssi = IPW_MIN_RSSI_VAL; -+ -+ IPW_DEBUG_INFO("Network RSSI: %d\n", rssi); -+ -+ entry = ipw_get_tpt_by_rssi(rssi, mode); -+ if (entry != NULL) { -+ i = entry->rate_scale_index; -+ //todoG need to support ibss -+ } else { -+ if (priv->assoc_request.ieee_mode == IPW_A_MODE) -+ i = RATE_SCALE_6M_INDEX; -+ else -+ i = RATE_SCALE_1M_INDEX; -+ } -+ -+ priv->stations[sta_id].current_rate = ipw_rate_scaling2rate_plcp(i); -+ -+ ipw_sync_station(priv, sta_id, -+ priv->stations[sta_id].current_rate, -+ CMD_ASYNC | CMD_NO_LOCK); -+ -+ IPW_DEBUG_RATE -+ ("for rssi %d assign rate scale index %d plcp %d\n", rssi, -+ i, priv->stations[sta_id].sta.tx_rate); -+ -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ -+ return rc; -+} -+ -+static int ipw_rate_scale_tx_resp_handle(struct ipw_priv *priv, -+ struct ipw_tx_resp *tx_resp) -+{ -+ int rc = 0, i; -+ u8 retries, current_count; -+ int scale_rate_index, first_index, last_index; -+ struct rate_scaling_info *table; -+ unsigned long flags; -+ -+ retries = tx_resp->failure_frame; -+ first_index = ipw_rate_plcp2rate_scaling(tx_resp->rate); -+ -+ if ((first_index < 0) || (first_index >= NUM_RATES)) { -+ return -1; -+ } -+ -+ if (!(priv->status & STATUS_ASSOCIATED)) { -+ return -1; -+ } -+ -+ spin_lock_irqsave(&priv->rate_scale_mgr.lock, flags); -+ if (time_after(jiffies, priv->rate_scale_mgr.stamp + -+ priv->rate_scale_mgr.flush_time)) { -+ cancel_delayed_work(&priv->rate_scale_flush); -+ queue_work(priv->workqueue, &priv->rate_scale_flush); -+ priv->rate_scale_mgr.stamp = jiffies; -+ -+ } -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ -+ scale_rate_index = first_index; -+ last_index = first_index; -+ -+ table = &priv->rate_scale_mgr.scale_rate_cmd.rate_scale_table[0]; -+ if (table[scale_rate_index].try_cnt == 0) { -+ scale_rate_index = table[scale_rate_index].next_rate_index; -+ last_index = scale_rate_index; -+ } -+ -+ while (retries > 0) { -+ if (table[scale_rate_index].try_cnt > retries) { -+ current_count = retries; -+ last_index = scale_rate_index; -+ } else { -+ current_count = table[scale_rate_index].try_cnt; -+ last_index = table[scale_rate_index].next_rate_index; -+ } -+ -+ for (i = 0; i < current_count; i++) -+ rc = ipw_collect_tx_data(priv, scale_rate_index, 0); -+ -+ retries -= current_count; -+ -+ scale_rate_index = table[scale_rate_index].next_rate_index; -+ } -+ -+ if ((tx_resp->status & 0xFF) == 0x1) -+ rc = ipw_collect_tx_data(priv, last_index, 1); -+ else -+ rc = ipw_collect_tx_data(priv, last_index, 0); -+ -+ return rc; -+} -+ -+/* -+todo: -+ -+modify to send one tfd per fragment instead of using chunking. otherwise -+we need to heavily modify the ieee80211_skb_to_txb. -+*/ -+//todoG need to support frag -+ -+#define IPW_TX_MEASURE_LEN 100 -+/* -+ * handle build REPLY_TX command notification. it is responsible for -+ * CALIBRATION fields. -+ */ -+static void ipw_build_tx_cmd_calib(struct ipw_priv *priv, -+ struct ipw_tx_cmd *tx_cmd, u16 sequence) -+{ -+ int found_frame = 0; -+ -+ /* If already have a pending Tx measurement or if it has been -+ * less than 3s since the last measurement, then don't try and -+ * start a new measurement. */ -+ if ((priv->status & STATUS_TX_MEASURE) || -+ time_after(priv->daemon_last_status + (HZ * 3UL), jiffies)) -+ return; -+ -+ /* We only want to collect the status for a frame that will actually -+ * have the radio powered up for a long enough time to get a good -+ * value */ -+ -+ switch (tx_cmd->rate) { -+ case R_6M: -+ found_frame = (tx_cmd->len > (IPW_TX_MEASURE_LEN * 6 / 8)); -+ break; -+ case R_9M: -+ found_frame = (tx_cmd->len > (IPW_TX_MEASURE_LEN * 9 / 8)); -+ break; -+ case R_12M: -+ found_frame = (tx_cmd->len > (IPW_TX_MEASURE_LEN * 12 / 8)); -+ break; -+ case R_18M: -+ found_frame = (tx_cmd->len > (IPW_TX_MEASURE_LEN * 18 / 8)); -+ break; -+ case R_24M: -+ found_frame = (tx_cmd->len > (IPW_TX_MEASURE_LEN * 24 / 8)); -+ break; -+ case R_36M: -+ found_frame = (tx_cmd->len > (IPW_TX_MEASURE_LEN * 36 / 8)); -+ break; -+ case R_48M: -+ found_frame = (tx_cmd->len > (IPW_TX_MEASURE_LEN * 48 / 8)); -+ break; -+ case R_54M: -+ found_frame = (tx_cmd->len > (IPW_TX_MEASURE_LEN * 54 / 8)); -+ break; -+ default: -+ break; -+ } -+ -+ if (found_frame) { -+ priv->status |= STATUS_TX_MEASURE; -+ tx_cmd->tx_flags |= (TX_CMD_FLG_CALIB_MSK | -+ TX_CMD_FLG_BT_DIS_MSK); -+ priv->daemon_tx_sequence = sequence; -+ priv->daemon_tx_rate = tx_cmd->rate; -+ } -+} -+ -+/* -+ TX command functions -+*/ -+/* -+ * get the available rate. if management frame or broadcast frame only return -+ * basic available rates. -+ */ -+static void ipw_get_supported_rates(struct ipw_priv *priv, -+ struct ieee80211_hdr_4addr *hdr, -+ u16 * data_rate, u16 * ctrl_rate) -+{ -+ *data_rate = priv->active_rate; -+ *ctrl_rate = priv->active_rate; -+ if ((is_multicast_ether_addr(hdr->addr1) -+ || ipw_is_broadcast_ether_addr(hdr->addr1)) -+ && (priv->active_rate_basic)) { -+ *data_rate = priv->active_rate_basic; -+ *ctrl_rate = priv->active_rate_basic; -+ } else if (priv->config & CFG_FIXED_RATE) { -+ u16 rate_mask = (priv->rates_mask & priv->active_rate); -+ if (rate_mask == 0) -+ rate_mask = priv->active_rate_basic; -+ *data_rate = rate_mask; -+ *ctrl_rate = rate_mask; -+ } -+} -+ -+static int ipw_get_adjuscent_rate(struct ipw_priv *priv, -+ s32 scale_index, u16 rate_mask, -+ s32 * low, s32 * high) -+{ -+ int rc = 0; -+ s32 index, find_index; -+ u16 msk; -+ u8 is_g_mode = 0; -+ -+ if (priv->assoc_request.ieee_mode == IPW_G_MODE) -+ is_g_mode = 1; -+ -+ index = ipw_rate_scale2index(scale_index); -+ -+ *low = IPW_INVALID_RATE; -+ *high = IPW_INVALID_RATE; -+ -+ if (is_g_mode == 0) { -+ find_index = index - 1; -+ while ((find_index >= 0) && (find_index < NUM_RATES)) { -+ msk = (1 << find_index); -+ if (msk & rate_mask) { -+ *low = ipw_rate_index2rate_scale(find_index); -+ break; -+ } -+ find_index--; -+ } -+ -+ find_index = index + 1; -+ while ((find_index >= 0) && (find_index < NUM_RATES)) { -+ msk = (1 << find_index); -+ if (msk & rate_mask) { -+ *high = ipw_rate_index2rate_scale(find_index); -+ break; -+ } -+ find_index++; -+ } -+ return rc; -+ } -+ -+ if (priv->rate_scale_mgr.next_lower_rate != NULL) { -+ *low = scale_index; -+ -+ find_index = ipw_rate_scale2index(scale_index); -+ -+ while (find_index != IPW_INVALID_VALUE) { -+ *low = priv->rate_scale_mgr.next_lower_rate[*low]; -+ -+ if (*low == IPW_INVALID_RATE) -+ break; -+ -+ find_index = ipw_rate_scale2index(*low); -+ -+ msk = (1 << find_index); -+ if (msk & rate_mask) { -+ break; -+ } -+ } -+ } -+ -+ if (priv->rate_scale_mgr.next_higher_rate != NULL) { -+ *high = scale_index; -+ -+ find_index = ipw_rate_scale2index(scale_index); -+ -+ while (find_index != IPW_INVALID_VALUE) { -+ *high = priv->rate_scale_mgr.next_higher_rate[*high]; -+ -+ if (*high == IPW_INVALID_RATE) -+ break; -+ find_index = ipw_rate_scale2index(*high); -+ -+ msk = (1 << find_index); -+ if (msk & rate_mask) { -+ break; -+ } -+ } -+ } -+ -+ return rc; -+} -+ -+/* -+ find the highest availabed rate for REPLY_TX command. -+*/ -+static int ipw_get_tx_rate(struct ipw_priv *priv, u16 rate_mask, -+ u8 rate, int sta_id) -+{ -+ int low = IPW_INVALID_RATE; -+ int high = IPW_INVALID_RATE; -+ int index, rc = 0; -+ int i = ipw_rate_plcp2index(rate); -+ struct ipw_rate_scale_data *window = NULL; -+ int current_tpt = IPW_INVALID_VALUE; -+ int low_tpt = IPW_INVALID_VALUE; -+ int high_tpt = IPW_INVALID_VALUE; -+ u32 fail_count; -+ s8 scale_action; -+ unsigned long flags; -+ -+ if ((i >= 0) && ((1 << i) & rate_mask)) -+ goto done; -+ -+ /* get the lowest availabe rate */ -+ rate = IPW_INVALID_RATE; -+ for (i = 0; i < 12; i++) { -+ if ((1 << i) & rate_mask) { -+ rate = ipw_rate_index2plcp(i); -+ if (rate != IPW_INVALID_RATE) -+ break; -+ } -+ } -+ done: -+ if (rate == IPW_INVALID_RATE) -+ return rate; -+ -+ //todoG for now we do auto scale only to bss and unicast frame -+ if ((sta_id == BROADCAST_ID) || (sta_id == MULTICAST_ID)) { -+ return rate; -+ } -+ -+ if (!(priv->status & STATUS_ASSOCIATED)) { -+ return rate; -+ } -+ -+ spin_lock_irqsave(&priv->rate_scale_mgr.lock, flags); -+ -+ index = ipw_rate_plcp2rate_scaling(rate); -+ -+ window = &priv->rate_scale_mgr.window[index]; -+ -+ fail_count = window->counter - window->success_counter; -+ -+ if (((fail_count <= IPW_RATE_SCALE_MIN_FAILURE_TH) && -+ (window->success_counter < IPW_RATE_SCALE_MIN_SUCCESS_TH)) -+ || (priv->rate_scale_mgr.expected_tpt == NULL)) { -+ -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ window->average_tpt = IPW_INVALID_VALUE; -+ return rate; -+ -+ } else { -+ window->average_tpt = ((window->success_ratio * -+ priv->rate_scale_mgr. -+ expected_tpt[index] + 64) / 128); -+ } -+ -+ rc = ipw_get_adjuscent_rate(priv, index, rate_mask, &low, &high); -+ -+ if (rc) { -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ return rate; -+ -+ } -+ -+ current_tpt = window->average_tpt; -+ -+ if (low != IPW_INVALID_RATE) { -+ low_tpt = priv->rate_scale_mgr.window[low].average_tpt; -+ } -+ -+ if (high != IPW_INVALID_RATE) -+ high_tpt = priv->rate_scale_mgr.window[high].average_tpt; -+ -+ spin_unlock_irqrestore(&priv->rate_scale_mgr.lock, flags); -+ -+ scale_action = 1; -+ -+ if ((window->success_ratio < IPW_RATE_SCALE_DECREASE_TH) || -+ (current_tpt == 0)) { -+ IPW_DEBUG_RATE("decrease rate because of low success_ratio\n"); -+ scale_action = -1; -+ } else if ((low_tpt == IPW_INVALID_VALUE) && -+ (high_tpt == IPW_INVALID_VALUE)) { -+ scale_action = 1; -+ } else if ((low_tpt != IPW_INVALID_VALUE) && -+ (high_tpt != IPW_INVALID_VALUE) && (low_tpt < current_tpt) -+ && (high_tpt < current_tpt)) { -+ -+ scale_action = 0; -+ } else { -+ if (high_tpt != IPW_INVALID_VALUE) { -+ if (high_tpt > current_tpt) -+ scale_action = 1; -+ else { -+ IPW_DEBUG_RATE -+ ("decrease rate because of high tpt\n"); -+ scale_action = -1; -+ } -+ } else if (low_tpt != IPW_INVALID_VALUE) { -+ if (low_tpt > current_tpt) { -+ IPW_DEBUG_RATE -+ ("decrease rate because of low tpt\n"); -+ scale_action = -1; -+ } else -+ scale_action = 1; -+ } -+ } -+ -+ if ((window->success_ratio > IPW_RATE_SCALE_HIGH_TH) || -+ (current_tpt > (128 * window->average_tpt))) { -+ scale_action = 0; -+ } -+ -+ switch (scale_action) { -+ case -1: -+ if (low != IPW_INVALID_RATE) -+ index = low; -+ break; -+ -+ case 1: -+ if (high != IPW_INVALID_RATE) -+ index = high; -+ -+ break; -+ -+ case 0: -+ default: -+ break; -+ } -+ -+ IPW_DEBUG_RATE -+ ("choose rate scale index %d action %d low %d high %d\n", -+ index, scale_action, low, high); -+ rate = ipw_rate_scaling2rate_plcp(index); -+ /* TODO: adjust tx rate according to card values and traffic */ -+ return rate; -+} -+ -+/* -+ handle build REPLY_TX command notification. it is responsible for rates fields. -+*/ -+static int ipw_build_tx_cmd_rate(struct ipw_priv *priv, -+ struct ipw_tx_cmd *tx_cmd, -+ struct ieee80211_hdr_4addr *hdr, -+ int sta_id, int tx_id) -+{ -+ u16 rate_mask, ctrl_rate; -+ -+ ipw_get_supported_rates(priv, hdr, &rate_mask, &ctrl_rate); -+ tx_cmd->rate = ipw_get_tx_rate(priv, rate_mask, -+ priv->stations[sta_id]. -+ current_rate, sta_id); -+ if (tx_cmd->rate == IPW_INVALID_RATE) { -+ IPW_ERROR("ERROR: No TX rate available.\n"); -+ return -1; -+ } -+ -+ IPW_DEBUG_RATE -+ ("Tx sta %d ew plcp rate %d old %d rate mask %x\n", -+ sta_id, tx_cmd->rate, -+ priv->stations[sta_id].current_rate, rate_mask); -+ -+ priv->stations[sta_id].current_rate = tx_cmd->rate; -+ -+ if ((priv->ieee->iw_mode == IW_MODE_ADHOC) && -+ (sta_id != BROADCAST_ID) && (sta_id != MULTICAST_ID)) -+ priv->stations[STA_ID].current_rate = tx_cmd->rate; -+ -+ if (tx_id >= CMD_QUEUE_NUM) -+ tx_cmd->rts_retry_limit = 3; -+ else -+ tx_cmd->rts_retry_limit = 7; -+ -+ if (ieee80211_is_probe_response(hdr->frame_ctl)) { -+ tx_cmd->data_retry_limit = 3; -+ if (tx_cmd->data_retry_limit < tx_cmd->rts_retry_limit) -+ tx_cmd->rts_retry_limit = tx_cmd->data_retry_limit; -+ } else -+ tx_cmd->data_retry_limit = IPW_DEFAULT_TX_RETRY; -+ -+ if (priv->data_retry_limit != -1) -+ tx_cmd->data_retry_limit = priv->data_retry_limit; -+ -+ if ((hdr->frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) { -+ switch (hdr->frame_ctl & IEEE80211_FCTL_STYPE) { -+ case IEEE80211_STYPE_AUTH: -+ case IEEE80211_STYPE_DEAUTH: -+ case IEEE80211_STYPE_ASSOC_REQ: -+ case IEEE80211_STYPE_REASSOC_REQ: -+ if (tx_cmd->tx_flags & TX_CMD_FLG_RTS_MSK) { -+ tx_cmd->tx_flags &= ~TX_CMD_FLG_RTS_MSK; -+ tx_cmd->tx_flags |= TX_CMD_FLG_CTS_MSK; -+ } -+ break; -+ default: -+ break; -+ } -+ } -+ -+ /* OFDM */ -+ tx_cmd->supp_rates[0] = rate_mask >> 4; -+ -+ /* CCK */ -+ tx_cmd->supp_rates[1] = rate_mask & 0xF; -+ -+ tx_cmd->tx_flags &= ~TX_CMD_FLG_ANT_A_MSK; -+ tx_cmd->tx_flags &= ~TX_CMD_FLG_ANT_B_MSK; -+ return 0; -+} -+ -+/* -+ handle build REPLY_TX command notification. -+*/ -+static int ipw_build_tx_cmd_basic(struct ipw_priv *priv, -+ struct ipw_tx_cmd *tx_cmd, -+ struct ieee80211_hdr_4addr *hdr, -+ int is_unicast, u8 std_id, int tx_id) -+{ -+ ulong nominal_length; -+ -+ tx_cmd->u.life_time = 0xFFFFFFFF; -+ if (is_unicast == 1) { -+ tx_cmd->tx_flags |= TX_CMD_FLG_ACK_MSK; -+ if ((hdr->frame_ctl & IEEE80211_FCTL_FTYPE) == -+ IEEE80211_FTYPE_MGMT) { -+ tx_cmd->tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; -+ } -+ if (ieee80211_is_probe_response(hdr->frame_ctl)) { -+ if ((hdr->seq_ctl & 0x000F) == 0) { -+ tx_cmd->tx_flags |= TX_CMD_FLG_TSF_MSK; -+ } -+ } -+ } else { -+ tx_cmd->tx_flags &= (~TX_CMD_FLG_ACK_MSK); -+ tx_cmd->tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; -+ } -+ -+ if (std_id == IPW_INVALID_STATION) -+ return -1; -+ -+ tx_cmd->sta_id = std_id; -+ if (hdr->frame_ctl & IEEE80211_FCTL_MOREFRAGS) -+ tx_cmd->tx_flags |= TX_CMD_FLG_MORE_FRAG_MSK; -+ if (ieee80211_get_hdrlen(hdr->frame_ctl) == 26) { -+ struct ieee80211_hdr_3addrqos *qos_hdr = -+ (struct ieee80211_hdr_3addrqos *)hdr; -+ tx_cmd->tid_tspec = (u8) (qos_hdr->qos_ctl & 0x000F); -+ } else -+ tx_cmd->tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; -+ tx_cmd->next_frame_len = 0; -+ nominal_length = tx_cmd->len; -+ nominal_length += IEEE80211_FCS_LEN; -+ //todoG need to count security over head; -+ /* -+ nominal_length += usMpduSecOverhead + IEEE80211_FCS_LEN; -+ if( (hdr->frame_ctl & IEEE80211_FCTL_MOREFRAGS) == 0) -+ nominal_length += usMsduSecOverhead; -+ */ -+ if (hdr->frame_ctl & IEEE80211_FCTL_PROTECTED) -+ nominal_length += 4; -+ -+ /* When calculatin RTS threshold, we add 4 to account for the -+ * FCS bytes that the uCode will append to the MPDU */ -+ if (((priv->rts_threshold == 0) || /* Always RTS */ -+ (nominal_length + 4) >= priv->rts_threshold) && -+ (priv->rts_threshold <= MAX_MSDU_SIZE)) { -+ tx_cmd->tx_flags |= TX_CMD_FLG_RTS_MSK; -+ tx_cmd->tx_flags &= ~TX_CMD_FLG_CTS_MSK; -+ } -+ -+ if ((tx_cmd->tx_flags & TX_CMD_FLG_RTS_MSK) || -+ (tx_cmd->tx_flags & TX_CMD_FLG_CTS_MSK)) -+ tx_cmd->tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; -+ tx_cmd->tx_flags &= ~(TX_CMD_FLG_ANT_SEL_MSK); -+ if ((hdr->frame_ctl & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) { -+ if (((hdr->frame_ctl & IEEE80211_FCTL_STYPE) == -+ IEEE80211_STYPE_ASSOC_REQ) -+ || ((hdr->frame_ctl & IEEE80211_FCTL_STYPE) == -+ IEEE80211_STYPE_REASSOC_REQ)) { -+ tx_cmd->u2.pm_frame_timeout = 3; -+ } else { -+ tx_cmd->u2.pm_frame_timeout = 2; -+ } -+ } else -+ tx_cmd->u2.pm_frame_timeout = 0; -+ tx_cmd->driver_txop = 0; -+ -+ return 0; -+} -+ -+//todoG need to move this to ieee code -+#define IEEE80211_STYPE_BA_REQ 0x0080 -+ -+#define IS_PLCP_RATE_CCK(rate) (((rate) & 0xf0) || (!((rate) & 0x1))) -+ -+#define IS_PLCP_RATE_OFDM(rate) (((rate) & 0x1) && (!((rate) & 0xf0))) -+ -+static inline void ipw_build_tx_cmd_hwcrypto(struct ipw_priv *priv, struct ipw_tx_cmd -+ *tx_cmd, -+ struct sk_buff *skb_frag, -+ int hdr_len, int last_frag) -+{ -+ struct ieee80211_crypt_data *crypt = priv->ieee->crypt[0]; -+ -+ atomic_inc(&crypt->refcnt); -+ if (crypt->ops->build_iv) -+ crypt->ops->build_iv(skb_frag, hdr_len, -+ tx_cmd->key, 16, crypt->priv); -+ atomic_dec(&crypt->refcnt); -+ -+ switch (priv->ieee->sec.level) { -+ case SEC_LEVEL_3: -+ tx_cmd->sec_ctl = TX_CMD_SEC_CCM; -+ -+ tx_cmd->hdr->frame_ctl |= IEEE80211_FCTL_PROTECTED; -+ /* XXX: ACK flag must be set for CCMP even if it -+ * is a multicast/broadcast packet, because CCMP -+ * group communication encrypted by GTK is -+ * actually done by the AP. */ -+ tx_cmd->tx_flags |= TX_CMD_FLG_ACK_MSK; -+ break; -+ case SEC_LEVEL_2: -+ tx_cmd->sec_ctl = TX_CMD_SEC_TKIP; -+ -+ if (last_frag) -+ memcpy(tx_cmd->tkip_mic.byte, skb_frag->tail - 8, 8); -+ else -+ memset(tx_cmd->tkip_mic.byte, 0, 8); -+ -+ tx_cmd->hdr->frame_ctl |= IEEE80211_FCTL_PROTECTED; -+ /* XXX: ACK flag must be set for CCMP even if it -+ * is a multicast/broadcast packet, because CCMP -+ * group communication encrypted by GTK is -+ * actually done by the AP. */ -+ tx_cmd->tx_flags |= TX_CMD_FLG_ACK_MSK; -+ break; -+ case SEC_LEVEL_1: -+ tx_cmd->sec_ctl = 1 | /* WEP */ -+ (priv->ieee->tx_keyidx & 0x3) << 6; -+ -+ if (priv->ieee->sec.key_sizes[priv->ieee->tx_keyidx] == 13) -+ tx_cmd->sec_ctl |= (1 << 3); /* 128-bit */ -+ -+ memcpy(&tx_cmd->key[3], -+ priv->ieee->sec.keys[priv->ieee->tx_keyidx], -+ priv->ieee->sec.key_sizes[priv->ieee->tx_keyidx]); -+ -+ tx_cmd->hdr->frame_ctl |= IEEE80211_FCTL_PROTECTED; -+ -+ IPW_DEBUG_TX("Configuring packet for WEP encryption " -+ "with key %d\n", priv->ieee->tx_keyidx); -+ break; -+ -+ case SEC_LEVEL_0: -+ IPW_DEBUG_TX("Tx packet in the clear " -+ "(encrypt requested).\n"); -+ break; -+ -+ default: -+ printk(KERN_ERR "Unknow security level %d\n", -+ priv->ieee->sec.level); -+ break; -+ } -+} -+ -+/* -+ start REPLY_TX command process -+*/ -+static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb, int pri) -+{ -+ struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *) -+ txb->fragments[0]->data; -+ int i = 0; -+ struct tfd_frame *tfd; -+ int tx_id = ipw_get_tx_queue_number(priv, pri); -+ struct ipw_tx_queue *txq = &priv->txq[tx_id]; -+ struct ipw_queue *q = &txq->q; -+ dma_addr_t phys_addr; -+ struct ipw_cmd *out_cmd = NULL; -+ u16 len, idx; -+ u8 id, hdr_len, unicast; -+// u16 remaining_bytes; -+ u8 sta_id; -+ u16 seq_number; -+ int rc; -+ -+ if (priv->status & STATUS_RF_KILL_MASK) -+ goto drop; -+ -+ switch (priv->ieee->iw_mode) { -+ case IW_MODE_ADHOC: -+ hdr_len = IEEE80211_3ADDR_LEN; -+ unicast = !ipw_is_broadcast_ether_addr(hdr->addr1) && -+ !is_multicast_ether_addr(hdr->addr1); -+ id = 0; -+ break; -+ case IW_MODE_INFRA: -+ default: -+ unicast = !ipw_is_broadcast_ether_addr(hdr->addr1) && -+ !is_multicast_ether_addr(hdr->addr1); -+ hdr_len = IEEE80211_3ADDR_LEN; -+ id = 0; -+ break; -+ } -+ -+ if (unicast) { -+ if (ieee80211_is_probe_response(hdr->frame_ctl)) -+ sta_id = ipw_find_station(priv, BROADCAST_ADDR); -+ else -+ sta_id = ipw_find_station(priv, hdr->addr1); -+ } else -+ sta_id = ipw_find_station(priv, BROADCAST_ADDR); -+ -+ if (sta_id == IPW_INVALID_STATION) { -+ IPW_DEBUG_DROP("Station " MAC_FMT -+ " not in station map. " -+ "Defaulting to broadcast...\n", -+ MAC_ARG(hdr->addr1)); -+ printk_buf(IPW_DL_DROP, (u8 *) hdr, sizeof(*hdr)); -+ sta_id = ipw_find_station(priv, BROADCAST_ADDR); -+ if (sta_id == IPW_INVALID_STATION) -+ goto drop; -+ } -+ -+ seq_number = priv->stations[sta_id].tid[tx_id].seq_number; -+ priv->stations[sta_id].tid[tx_id].seq_number++; -+ -+ for (i = 0; i < txb->nr_frags; i++) { -+ hdr = (struct ieee80211_hdr_4addr *) -+ txb->fragments[i]->data; -+ -+ tfd = &txq->bd[q->first_empty]; -+ memset(tfd, 0, sizeof(*tfd)); -+ idx = get_next_cmd_index(q, q->first_empty, 0); -+ -+ txq->txb[q->first_empty] = -+ (i == (txb->nr_frags - 1)) ? txb : NULL; -+ -+ hdr->seq_ctl |= i; -+ -+ out_cmd = &txq->cmd[idx]; -+ memset(&out_cmd->hdr, 0, sizeof(out_cmd->hdr)); -+ memset(&out_cmd->cmd.tx, 0, sizeof(out_cmd->cmd.tx)); -+ out_cmd->hdr.cmd = REPLY_TX; -+ out_cmd->hdr.sequence = FIFO_TO_SEQ(tx_id) | -+ INDEX_TO_SEQ(q->first_empty); -+ /* copy frags header */ -+ memcpy(out_cmd->cmd.tx.hdr, hdr, hdr_len); -+ -+ hdr = (struct ieee80211_hdr_4addr *)out_cmd->cmd.tx.hdr; -+ len = sizeof(struct ipw_tx_cmd) + sizeof(struct ipw_cmd_header) -+ + hdr_len; -+ len = (len + 3) & ~3; -+ -+ phys_addr = -+ txq->dma_addr_cmd + sizeof(struct ipw_cmd) * idx + -+ offsetof(struct ipw_cmd, hdr); -+ attach_buffer_to_tfd_frame(tfd, phys_addr, cpu_to_le16(len)); -+ -+ if (txb->encrypted && !priv->ieee->host_encrypt) -+ ipw_build_tx_cmd_hwcrypto(priv, -+ &(out_cmd->cmd.tx), -+ txb->fragments[i], -+ hdr_len, -+ i == (txb->nr_frags - 1)); -+ else { -+ IPW_DEBUG_TX -+ ("Tx packet in the clear, [%c] unicast.\n", -+ unicast ? '*' : ' '); -+ } -+ -+ IPW_DEBUG_FRAG -+ ("Adding fragment %i of %i (%d bytes).\n", i, -+ txb->nr_frags, txb->fragments[i]->len - hdr_len); -+ IPW_DEBUG_TX -+ ("Dumping TX packet frag %i of %i (%d bytes):\n", -+ i, txb->nr_frags, txb->fragments[i]->len - hdr_len); -+ printk_buf(IPW_DL_TX, -+ txb->fragments[i]->data + hdr_len, -+ txb->fragments[i]->len - hdr_len); -+ -+ phys_addr = cpu_to_le32(pci_map_single(priv->pci_dev, -+ txb-> -+ fragments[i]-> -+ data + hdr_len, -+ txb-> -+ fragments[i]-> -+ len - hdr_len, -+ PCI_DMA_TODEVICE)); -+ len = txb->fragments[i]->len - hdr_len; -+ attach_buffer_to_tfd_frame(tfd, phys_addr, cpu_to_le16(len)); -+ out_cmd->cmd.tx.len = txb->fragments[i]->len; -+ -+ tfd->control_flags = TFD_CTL_COUNT_SET(2) | -+ TFD_CTL_PAD_SET(U32_PAD(len)); -+ -+ //todoG need this for burst mode later on -+ if (ipw_build_tx_cmd_basic(priv, &(out_cmd->cmd.tx), -+ hdr, unicast, sta_id, tx_id) != 0) { -+ IPW_ERROR("tx build cmd basic failed.\n"); -+ goto drop; -+ } -+ -+ if (ipw_build_tx_cmd_rate(priv, &(out_cmd->cmd.tx), -+ hdr, sta_id, tx_id)) { -+ IPW_ERROR("tx cmd rate scale failed.\n"); -+ goto drop; -+ -+ } -+ -+ IPW_DEBUG_TX("Tx rate %d (%02X:%02X)\n", -+ out_cmd->cmd.tx.rate, -+ out_cmd->cmd.tx.supp_rates[0], -+ out_cmd->cmd.tx.supp_rates[1]); -+ -+ ipw_build_tx_cmd_calib(priv, &out_cmd->cmd.tx, -+ out_cmd->hdr.sequence); -+ out_cmd->cmd.tx.tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; -+ -+ printk_buf(IPW_DL_TX, out_cmd->cmd.payload, -+ sizeof(out_cmd->cmd.tx)); -+ -+ printk_buf(IPW_DL_TX, (u8 *) out_cmd->cmd.tx.hdr, -+ ieee80211_get_hdrlen(out_cmd->cmd.tx.hdr-> -+ frame_ctl)); -+ -+ IPW_DEBUG_FRAG -+ ("%i fragments being sent as %i chunks.\n", -+ txb->nr_frags, TFD_CTL_COUNT_GET(tfd->control_flags)); -+ -+ q->first_empty = ipw_queue_inc_wrap(q->first_empty, q->n_bd); -+ } -+ /* kick DMA */ -+ -+ txq->need_update = 1; -+ rc = ipw_tx_queue_update_write_ptr(priv, txq, tx_id); -+ -+ if (rc) -+ return rc; -+ if ((ipw_queue_space(q) < q->high_mark) -+ && priv->netdev_registered) -+ netif_stop_queue(priv->net_dev); -+ -+ return 0; -+ -+ drop: -+ IPW_DEBUG_DROP("Silently dropping Tx packet.\n"); -+ ieee80211_txb_free(txb); -+ return 0; -+} -+ -+static int ipw_net_hard_start_xmit(struct ieee80211_txb *txb, -+ struct net_device *dev, int pri) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ unsigned long flags = 0; -+ int is_locked = 0; -+ if (pri < 0) { -+ pri = 0; -+ is_locked = 1; -+ } -+ -+ if (priv->ieee->iw_mode == IW_MODE_MONITOR) -+ return -1; -+ -+ IPW_DEBUG_TX("dev->xmit(%d bytes)\n", txb->payload_size); -+ if (is_locked == 0) -+ spin_lock_irqsave(&priv->lock, flags); -+ if (!(priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING))) { -+ IPW_DEBUG_INFO("Tx attempt while not associated.\n"); -+ priv->ieee->stats.tx_carrier_errors++; -+ goto fail_unlock; -+ } -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+ if (rtap_iface && netif_running(priv->prom_net_dev)) -+ ipw_handle_promiscuous_tx(priv, txb); -+#endif -+ -+ ipw_tx_skb(priv, txb, pri); -+ priv->led_packets += txb->payload_size; -+ ipw_setup_activity_timer(priv); -+ if (is_locked == 0) -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return 0; -+ fail_unlock: -+ if (is_locked == 0) -+ spin_unlock_irqrestore(&priv->lock, flags); -+ return -1; -+} -+ -+static struct net_device_stats *ipw_net_get_stats(struct net_device -+ *dev) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ priv->ieee->stats.tx_packets = priv->tx_packets; -+ priv->ieee->stats.rx_packets = priv->rx_packets; -+ priv->ieee->stats.rx_bytes = priv->rx_bytes; -+ priv->ieee->stats.tx_bytes = priv->tx_bytes; -+ return &priv->ieee->stats; -+} -+ -+static int ipw_net_set_mac_address(struct net_device *dev, void *p) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ struct sockaddr *addr = p; -+ if (!is_valid_ether_addr(addr->sa_data)) -+ return -EADDRNOTAVAIL; -+ mutex_lock(&priv->mutex); -+ priv->config |= CFG_CUSTOM_MAC; -+ memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); -+ printk(KERN_INFO "%s: Setting MAC to " MAC_FMT "\n", -+ priv->net_dev->name, MAC_ARG(priv->mac_addr)); -+ IPW_DEBUG_INFO("Restarting adapter to set new MAC.\n"); -+ queue_work(priv->workqueue, &priv->down); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static void ipw_ethtool_get_drvinfo(struct net_device *dev, -+ struct ethtool_drvinfo *info) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ char ver_string[9]; -+ -+ strcpy(info->driver, DRV_NAME); -+ strcpy(info->version, DRV_VERSION); -+ -+ memcpy(ver_string, priv->card_alive.sw_rev, 8); -+ ver_string[8] = '\0'; -+ -+ snprintf(info->fw_version, sizeof(info->fw_version), -+ "%s%d.%d %d:%d (%s)", -+ priv->card_alive.ucode_major & 0x80 ? "P" : "", -+ priv->card_alive.ucode_major & 0x7f, -+ priv->card_alive.ucode_minor, -+ priv->card_alive.ver_type, -+ priv->card_alive.ver_subtype, ver_string); -+ -+ strcpy(info->bus_info, pci_name(priv->pci_dev)); -+ info->eedump_len = EEPROM_IMAGE_SIZE; -+} -+ -+static u32 ipw_ethtool_get_link(struct net_device *dev) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ return (priv->status & STATUS_ASSOCIATED) != 0; -+} -+ -+static int ipw_ethtool_get_eeprom_len(struct net_device *dev) -+{ -+ return EEPROM_IMAGE_SIZE; -+} -+ -+static int ipw_ethtool_get_eeprom(struct net_device *dev, -+ struct ethtool_eeprom *eeprom, u8 * bytes) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ if (eeprom->offset + eeprom->len > EEPROM_IMAGE_SIZE) -+ return -EINVAL; -+ -+ mutex_lock(&priv->mutex); -+ memcpy(bytes, &((u8 *) priv->eeprom)[eeprom->offset], eeprom->len); -+ mutex_unlock(&priv->mutex); -+ return 0; -+} -+ -+static struct ethtool_ops ipw_ethtool_ops = { -+ .get_link = ipw_ethtool_get_link, -+ .get_drvinfo = ipw_ethtool_get_drvinfo, -+ .get_eeprom_len = ipw_ethtool_get_eeprom_len, -+ .get_eeprom = ipw_ethtool_get_eeprom, -+}; -+ -+#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) ) -+static irqreturn_t ipw_isr(int irq, void *data, struct pt_regs *regs) -+#else -+static irqreturn_t ipw_isr(int irq, void *data) -+#endif -+{ -+ struct ipw_priv *priv = data; -+ u32 inta, inta_mask; -+ if (!priv) -+ return IRQ_NONE; -+ -+ spin_lock(&priv->lock); -+ if (!(priv->status & STATUS_INT_ENABLED)) { -+ /* Shared IRQ */ -+ goto none; -+ } -+ -+ inta = ipw_read32(priv, CSR_INT); -+ inta_mask = ipw_read32(priv, CSR_INT_MASK); -+ if (inta == 0xFFFFFFFF) { -+ /* Hardware disappeared */ -+ IPW_WARNING("IRQ INTA == 0xFFFFFFFF\n"); -+ goto none; -+ } -+ -+ if (!(inta & (CSR_INI_SET_MASK & inta_mask))) { -+ if (inta) -+ ipw_write32(priv, CSR_INT, inta); -+ /* Shared interrupt */ -+ goto none; -+ } -+ -+ /* tell the device to stop sending interrupts */ -+ -+ IPW_DEBUG_ISR -+ ("interrupt recieved 0x%08x masked 0x%08x card mask 0x%08x\n", -+ inta, inta_mask, CSR_INI_SET_MASK); -+ -+ priv->status &= ~STATUS_INT_ENABLED; -+ ipw_write32(priv, CSR_INT_MASK, 0x00000000); -+ /* ack current interrupts */ -+ ipw_write32(priv, CSR_INT, inta); -+ inta &= (CSR_INI_SET_MASK & inta_mask); -+ /* Cache INTA value for our tasklet */ -+ priv->isr_inta = inta; -+ tasklet_schedule(&priv->irq_tasklet); -+ spin_unlock(&priv->lock); -+ -+ return IRQ_HANDLED; -+ -+ none: -+ spin_unlock(&priv->lock); -+ return IRQ_NONE; -+} -+ -+static void ipw_bg_rf_kill(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ wake_up_interruptible(&priv->wait_command_queue); -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ -+ if (!(priv->status & STATUS_RF_KILL_MASK)) { -+ IPW_DEBUG(IPW_DL_INFO | IPW_DL_RF_KILL, -+ "HW RF Kill no longer active, restarting " -+ "device\n"); -+ if (!(priv->status & STATUS_EXIT_PENDING)) -+ ipw_down(priv); -+ } else { -+ priv->led_state = IPW_LED_LINK_RADIOOFF; -+ -+ if (!(priv->status & STATUS_RF_KILL_HW)) -+ IPW_DEBUG_RF_KILL -+ ("Can not turn radio back on - " -+ "disabled by SW switch\n"); -+ else -+ IPW_WARNING -+ ("Radio Frequency Kill Switch is On:\n" -+ "Kill switch must be turned off for " -+ "wireless networking to work.\n"); -+ } -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_link_up(struct ipw_priv *priv) -+{ -+ BUG_ON(!priv->netdev_registered); -+ -+ /* Reset ieee stats */ -+ memset(&priv->ieee->ieee_stats, 0, sizeof(struct ieee80211_stats)); -+ -+ /* We don't reset the net_device_stats (ieee->stats) on -+ * re-association */ -+ -+ priv->last_seq_num = -1; -+ priv->last_frag_num = -1; -+ priv->last_packet_time = 0; -+ -+ netif_carrier_on(priv->net_dev); -+ if (netif_queue_stopped(priv->net_dev)) { -+ IPW_DEBUG_NOTIF("waking queue\n"); -+ netif_wake_queue(priv->net_dev); -+ } else { -+ IPW_DEBUG_NOTIF("starting queue\n"); -+ netif_start_queue(priv->net_dev); -+ } -+ -+ ipw_scan_cancel(priv); -+ ipw_reset_stats(priv); -+ -+ /* Ensure the rate is updated immediately */ -+ priv->last_rate = ipw_get_current_rate(priv); -+ ipw_gather_stats(priv); -+ -+ ipw_update_link_led(priv); -+ -+ notify_wx_assoc_event(priv); -+ if (priv->config & CFG_BACKGROUND_SCAN) -+ ipw_scan_initiate(priv, priv->ieee->freq_band, 1000); -+} -+ -+static void ipw_bg_update_link_led(void *data) -+{ -+ struct ipw_priv *priv = data; -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_update_link_led(priv); -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_bg_link_up(void *data) -+{ -+ struct ipw_priv *priv = data; -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_link_up(priv); -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_link_down(struct ipw_priv *priv) -+{ -+ /* ipw_link_down should never be called if we aren't -+ * registered with netdev. */ -+ BUG_ON(!priv->netdev_registered); -+ -+ priv->led_packets = 0; -+ netif_carrier_off(priv->net_dev); -+ netif_stop_queue(priv->net_dev); -+ notify_wx_assoc_event(priv); -+ /* Cancel any queued work ... */ -+ cancel_delayed_work(&priv->scan_check); -+ cancel_delayed_work(&priv->gather_stats); -+ ipw_scan_cancel(priv); -+ ipw_reset_stats(priv); -+ /* Queue up another scan... */ -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ ipw_scan_initiate(priv, priv->ieee->freq_band, 0); -+} -+ -+static void ipw_bg_link_down(void *data) -+{ -+ struct ipw_priv *priv = data; -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_link_down(priv); -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_bg_resume_work(void *data) -+{ -+ struct ipw_priv *priv = data; -+ unsigned long flags; -+ -+ mutex_lock(&priv->mutex); -+ -+ /* The following it a temporary work around due to the -+ * suspend / resume not fully initializing the NIC correctly. -+ * Without all of the following, resume will not attempt to take -+ * down the NIC (it shouldn't really need to) and will just try -+ * and bring the NIC back up. However that fails during the -+ * ucode verification process. This then causes ipw_down to be -+ * called *after* ipw_nic_init() has succeedded -- which -+ * then lets the next init sequence succeed. So, we've -+ * replicated all of that NIC init code here... */ -+ -+ ipw_write32(priv, CSR_INT, 0xFFFFFFFF); -+ -+ ipw_nic_init(priv); -+ -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_CLR, -+ CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); -+ ipw_write32(priv, CSR_INT, 0xFFFFFFFF); -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); -+ -+ /* tell the device to stop sending interrupts */ -+ ipw_disable_interrupts(priv); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ ipw_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ if (!ipw_grab_restricted_access(priv)) { -+ ipw_write_restricted_reg(priv, ALM_APMG_CLK_DIS, -+ APMG_CLK_REG_VAL_DMA_CLK_RQT); -+ ipw_release_restricted_access(priv); -+ } -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ udelay(5); -+ -+ ipw_nic_reset(priv); -+ -+ /* Bring the device back up */ -+ priv->status &= ~STATUS_IN_SUSPEND; -+ -+ /* Send the RESUME state to the daemon */ -+ ipw_send_daemon_sync(priv, DAEMON_SYNC_RESUME, 0, NULL); -+ -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_associate_timeout(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ mutex_lock(&priv->mutex); -+ if (priv->status & STATUS_ASSOCIATED || -+ !(priv->status & STATUS_ASSOCIATING)) { -+ mutex_unlock(&priv->mutex); -+ return; -+ } -+ -+ IPW_DEBUG_ASSOC("Association attempt timed out.\n"); -+ -+ ipw_send_disassociate(data, 1); -+ mutex_unlock(&priv->mutex); -+} -+ -+static int ipw_setup_deferred_work(struct ipw_priv *priv) -+{ -+ int ret = 0; -+#ifdef CONFIG_SOFTWARE_SUSPEND2_BUILTIN -+ priv->workqueue = create_workqueue(DRV_NAME, 0); -+ priv->daemonqueue = create_workqueue(DRV_NAME, 0); -+#else -+ priv->workqueue = create_workqueue(DRV_NAME); -+ priv->daemonqueue = create_workqueue(DRV_NAME); -+#endif -+ -+ init_waitqueue_head(&priv->wait_daemon_out_queue); -+ init_waitqueue_head(&priv->wait_command_queue); -+ init_waitqueue_head(&priv->wait_daemon_cmd_done); -+ -+ INIT_WORK(&priv->associate, ipw_bg_associate, priv); -+ INIT_WORK(&priv->calibrated_work, ipw_bg_calibrated_work, priv); -+ INIT_WORK(&priv->disassociate, ipw_bg_disassociate, priv); -+ INIT_WORK(&priv->rx_replenish, ipw_bg_rx_queue_replenish, priv); -+ INIT_WORK(&priv->rf_kill, ipw_bg_rf_kill, priv); -+ INIT_WORK(&priv->up, ipw_bg_up, priv); -+ INIT_WORK(&priv->down, ipw_bg_down, priv); -+ INIT_WORK(&priv->request_scan, ipw_bg_request_scan, priv); -+ INIT_WORK(&priv->gather_stats, ipw_bg_gather_stats, priv); -+ INIT_WORK(&priv->abort_scan, ipw_bg_abort_scan, priv); -+ INIT_WORK(&priv->roam, ipw_bg_roam, priv); -+ INIT_WORK(&priv->scan_check, ipw_bg_scan_check, priv); -+ INIT_WORK(&priv->link_up, ipw_bg_link_up, priv); -+ INIT_WORK(&priv->update_link_led, ipw_bg_update_link_led, priv); -+ INIT_WORK(&priv->link_down, ipw_bg_link_down, priv); -+ INIT_WORK(&priv->auth_work, ipw_auth_work, priv); -+ INIT_WORK(&priv->merge_networks, ipw_merge_adhoc_network, priv); -+ INIT_WORK(&priv->associate_timeout, ipw_associate_timeout, priv); -+ -+ INIT_WORK(&priv->alive_start, ipw_bg_alive_start, priv); -+ INIT_WORK(&priv->resume_work, ipw_bg_resume_work, priv); -+ -+#ifdef CONFIG_IPW3945_QOS -+ /* QoS */ -+ INIT_WORK(&priv->qos_activate, ipw_bg_qos_activate, priv); -+#endif -+ -+ /* 802.11h */ -+ INIT_WORK(&priv->report_work, ipw_bg_report_work, priv); -+ -+ INIT_WORK(&priv->post_associate, ipw_bg_post_associate, priv); -+ -+ INIT_WORK(&priv->activity_timer, ipw_bg_activity_timer, priv); -+ -+ INIT_WORK(&priv->daemon_cmd_work, ipw_bg_daemon_cmd, priv); -+ INIT_WORK(&priv->daemon_tx_status_sync, -+ ipw_bg_daemon_tx_status_sync, priv); -+ -+ INIT_WORK(&priv->rate_scale_flush, ipw_bg_rate_scale_flush, priv); -+ -+ tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) -+ ipw_irq_tasklet, (unsigned long)priv); -+ -+ init_timer(&priv->roaming_wdt); -+ init_timer(&priv->disassociate_wdt); -+ priv->roaming_wdt.function = ipw_kickoff_roaming; -+ priv->roaming_wdt.data = (unsigned long)priv; -+ priv->disassociate_wdt.function = ipw_kickoff_disassociate; -+ priv->disassociate_wdt.data = (unsigned long)priv; -+ -+ return ret; -+} -+ -+static void shim__set_security(struct net_device *dev, -+ struct ieee80211_security *sec) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ int i; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ for (i = 0; i < 4; i++) { -+ if (sec->flags & (1 << i)) { -+ priv->ieee->sec.key_sizes[i] = sec->key_sizes[i]; -+ if (sec->key_sizes[i] == 0) { -+ IPW_DEBUG_WEP("Disabling key %d.\n", i); -+ priv->ieee->sec.flags &= ~(1 << i); -+ } else { -+ IPW_DEBUG_WEP("Setting key %d.\n", i); -+ priv->ieee->sec.flags &= ~(1 << i); -+ 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->flags & SEC_ACTIVE_KEY) && -+ priv->ieee->sec.active_key != sec->active_key) { -+ if (sec->active_key <= 3) { -+ IPW_DEBUG_WEP -+ ("Setting active Tx key to %d.\n", sec->active_key); -+ priv->ieee->sec.active_key = sec->active_key; -+ priv->ieee->sec.flags |= SEC_ACTIVE_KEY; -+ } else -+ priv->ieee->sec.flags &= ~SEC_ACTIVE_KEY; -+ priv->status |= STATUS_SECURITY_UPDATED; -+ } -+ -+ if ((sec->flags & SEC_AUTH_MODE) && -+ (priv->ieee->sec.auth_mode != sec->auth_mode)) { -+ priv->ieee->sec.auth_mode = sec->auth_mode; -+ priv->ieee->sec.flags |= SEC_AUTH_MODE; -+ if (sec->auth_mode == WLAN_AUTH_SHARED_KEY) { -+ IPW_DEBUG_WEP("Setting auth mode to SHARED.\n"); -+ priv->capability |= CAP_SHARED_KEY; -+ } else { -+ IPW_DEBUG_WEP("Setting auth mode to OPEN.\n"); -+ priv->capability &= ~CAP_SHARED_KEY; -+ } -+ priv->status |= STATUS_SECURITY_UPDATED; -+ } -+ -+ if (sec->flags & SEC_ENABLED && priv->ieee->sec.enabled != sec->enabled) { -+ priv->ieee->sec.flags |= SEC_ENABLED; -+ priv->ieee->sec.enabled = sec->enabled; -+ priv->status |= STATUS_SECURITY_UPDATED; -+ if (sec->enabled) { -+ IPW_DEBUG_WEP("Enabling security.\n"); -+ priv->capability |= CAP_PRIVACY_ON; -+ } else { -+ IPW_DEBUG_WEP("Disabling security.\n"); -+ priv->capability &= ~CAP_PRIVACY_ON; -+ } -+ } -+ -+ if (sec->flags & SEC_ENCRYPT) -+ priv->ieee->sec.encrypt = sec->encrypt; -+ -+ if (sec->flags & SEC_LEVEL && priv->ieee->sec.level != sec->level) { -+ IPW_DEBUG_WEP("Setting security level to %d.\n", sec->level); -+ priv->ieee->sec.level = sec->level; -+ priv->ieee->sec.flags |= SEC_LEVEL; -+ priv->status |= STATUS_SECURITY_UPDATED; -+ } -+ -+ /* To match current functionality of ipw2100 (which works well w/ -+ * various supplicants, we don't force a disassociate if the -+ * privacy capability changes ... */ -+#if 0 -+ if ((priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) -+ && -+ (((priv->assoc_request. -+ capability & WLAN_CAPABILITY_PRIVACY) && !sec->enabled) -+ || (!(priv->assoc_request.capability & WLAN_CAPABILITY_PRIVACY) -+ && sec->enabled))) { -+ IPW_DEBUG_ASSOC("Disassociating due to capability " -+ "change.\n"); -+ ipw_disassociate(priv); -+ } -+#endif -+ mutex_unlock(&priv->mutex); -+} -+ -+/* -+ Power management (not Tx power!) functions -+*/ -+#define PCI_LINK_CTRL 0x0F0 -+ -+static int ipw_power_init_handle(struct ipw_priv *priv) -+{ -+ int rc = 0, i; -+ struct ipw_power_mgr *pow_data; -+ int size = sizeof(struct ipw_power_vec_entry) * IPW_POWER_AC; -+ u16 pci_pm; -+ -+ IPW_DEBUG_POWER("Intialize power \n"); -+ -+ pow_data = &(priv->power_data); -+ -+ memset(pow_data, 0, sizeof(*pow_data)); -+ -+ pow_data->active_index = IPW_POWER_RANGE_0; -+ pow_data->dtim_val = 0xffff; -+ -+ memcpy(&pow_data->pwr_range_0[0], &range_0[0], size); -+ memcpy(&pow_data->pwr_range_1[0], &range_1[0], size); -+ -+ rc = pci_read_config_word(priv->pci_dev, PCI_LINK_CTRL, &pci_pm); -+ if (rc != 0) -+ return 0; -+ else { -+ struct ipw_powertable_cmd *cmd; -+ -+ IPW_DEBUG_POWER("adjust power command flags\n"); -+ -+ for (i = 0; i < IPW_POWER_AC; i++) { -+ cmd = &pow_data->pwr_range_0[i].cmd; -+ -+ if (pci_pm & 0x1) -+ cmd->flags &= ~0x8; -+ else -+ cmd->flags |= 0x8; -+ } -+ } -+ -+ return rc; -+} -+ -+int ipw_update_power_cmd(struct ipw_priv *priv, -+ struct ipw_powertable_cmd *cmd, u32 mode) -+{ -+ int rc = 0, i; -+ u8 skip = 0; -+ u32 max_sleep = 0; -+ struct ipw_power_vec_entry *range; -+ u8 period = 0; -+ struct ipw_power_mgr *pow_data; -+ -+ if ((mode < IPW_POWER_MODE_CAM) || (mode > IPW_POWER_INDEX_5)) { -+ IPW_DEBUG_POWER("Error invalid power mode \n"); -+ return -1; -+ } -+ pow_data = &(priv->power_data); -+ -+ if (pow_data->active_index == IPW_POWER_RANGE_0) -+ range = &pow_data->pwr_range_0[0]; -+ else -+ range = &pow_data->pwr_range_1[1]; -+ -+ memcpy(cmd, &range[mode].cmd, sizeof(struct ipw_powertable_cmd)); -+ -+ if (priv->assoc_network != NULL) { -+ unsigned long flags; -+ -+ spin_lock_irqsave(&priv->ieee->lock, flags); -+ period = priv->assoc_network->tim.tim_period; -+ spin_unlock_irqrestore(&priv->ieee->lock, flags); -+ } -+ -+ skip = range[mode].no_dtim; -+ -+ if (period == 0) { -+ period = 1; -+ skip = 0; -+ } -+ -+ if (skip == 0) { -+ max_sleep = period; -+ cmd->flags &= ~PMC_TCMD_FLAG_SLEEP_OVER_DTIM_MSK; -+ } else { -+ max_sleep = -+ (cmd-> -+ SleepInterval[PMC_TCMD_SLEEP_INTRVL_TABLE_SIZE - -+ 1] / period) * period; -+ cmd->flags |= PMC_TCMD_FLAG_SLEEP_OVER_DTIM_MSK; -+ } -+ -+ for (i = 0; i < PMC_TCMD_SLEEP_INTRVL_TABLE_SIZE; i++) { -+ if (cmd->SleepInterval[i] > max_sleep) -+ cmd->SleepInterval[i] = max_sleep; -+ } -+ -+ IPW_DEBUG_POWER("Flags value = 0x%08X\n", cmd->flags); -+ IPW_DEBUG_POWER("Tx timeout = %u\n", cmd->TxDataTimeout); -+ IPW_DEBUG_POWER("Rx timeout = %u\n", cmd->RxDataTimeout); -+ IPW_DEBUG_POWER -+ ("Sleep interval vector = { %d , %d , %d , %d , %d }\n", -+ cmd->SleepInterval[0], cmd->SleepInterval[1], -+ cmd->SleepInterval[2], cmd->SleepInterval[3], -+ cmd->SleepInterval[4]); -+ -+ return rc; -+} -+ -+/************* CARD-FUNCTION ************/ -+/* Print card information like version number other eeprom values */ -+int ipw_card_show_info(struct ipw_priv *priv) -+{ -+ u8 strPbaNumber[32] = { -+ 0 -+ }; -+ u16 hwVersion = 0; -+ int rc = 0; -+ u8 val; -+ memset(strPbaNumber, 0, 32); -+ rc = ipw_query_eeprom(priv, EEPROM_BOARD_REVISION, -+ sizeof(u16), (u8 *) & hwVersion); -+ if (rc) { -+ IPW_WARNING("failed to read EEPROM_BOARD_REVISION\n"); -+ return rc; -+ } -+ IPW_DEBUG_INFO("3945ABG HW Version %u.%u.%u\n", -+ ((hwVersion >> 8) & 0x0F), -+ ((hwVersion >> 8) >> 4), (hwVersion & 0x00FF)); -+ rc = ipw_query_eeprom(priv, EEPROM_BOARD_PBA_NUMBER, -+ EEPROM_BOARD_PBA_NUMBER_LENTGH, strPbaNumber); -+ if (rc) { -+ IPW_WARNING("failed to read EEPROM_BOARD_PBA_NUMBER\n"); -+ return rc; -+ } -+ IPW_DEBUG_INFO("3945ABG PBA Number %.16s\n", strPbaNumber); -+ rc = ipw_query_eeprom(priv, 0x94, sizeof(u8), (u8 *) & val); -+ if (rc) { -+ IPW_WARNING("failed to read EEPROM 0x94\n"); -+ return rc; -+ } -+ -+ IPW_DEBUG_INFO("eeprom value at byte 0x94 is 0x%02X\n", val); -+ -+ rc = ipw_query_eeprom(priv, EEPROM_ANTENNA_SWITCH_TYPE, -+ sizeof(u8), (u8 *) & val); -+ if (rc) { -+ IPW_WARNING("failed to read EEPROM_ANTENNA_SWITCH_TYPE\n"); -+ return rc; -+ } -+ IPW_DEBUG_INFO("EEPROM_ANTENNA_SWITCH_TYPE is 0x%02X\n", val); -+ -+ return 0; -+} -+ -+/* -+ Call all registered function for card RXON status -+ this function called after we call REPLY_RXON command. -+*/ -+/* -+ called at ipw_pci_remove to clean the driver data -+*/ -+static int ipw_card_remove_notify(struct ipw_priv *priv) -+{ -+ int rc = 0; -+ return rc; -+} -+ -+/* -+ call registered function about change in current network -+ beacon -+*/ -+static int ipw_card_bss_active_changed_notify(struct ipw_priv *priv, -+ struct ieee80211_network *network) -+{ -+ int rc = 0; -+ u8 period = 0; -+ struct daemon_rx_config rxon; -+ -+ memcpy(&rxon, &priv->rxon, sizeof(rxon)); -+ -+ if (network != NULL) -+ period = network->tim.tim_period; -+ -+ if (priv->power_data.dtim_val != period) { -+ //todoG need to call reg_send_power command -+ priv->power_data.dtim_val = period; -+ if (period <= 10) -+ priv->power_data.active_index = IPW_POWER_RANGE_0; -+ else -+ priv->power_data.active_index = IPW_POWER_RANGE_1; -+ } -+ -+ if (network->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) -+ priv->rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; -+ else -+ priv->rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK; -+ -+ if (priv->assoc_request.ieee_mode == IPW_G_MODE) { -+ if (network->capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) -+ priv->rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; -+ else -+ priv->rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; -+ -+ if (network->erp_value & IEEE80211_ERP_USE_PROTECTION) -+ priv->rxon.flags |= RXON_FLG_TGG_PROTECT_MSK; -+ else -+ priv->rxon.flags &= ~RXON_FLG_TGG_PROTECT_MSK; -+ } -+ -+ if (memcmp(&rxon, &priv->rxon, sizeof(rxon))) { -+ IPW_DEBUG_INFO("rxon changed\n"); -+ ipw_rxon_assoc_async(priv); -+ } -+ -+ return rc; -+} -+ -+/* -+ called at start up to initialize the NIC -+*/ -+ -+/* -+ called after we recieved REPLY_ALIVE notification. -+ this function starts the calibration then start the process -+ of transfering the card to recieving state -+*/ -+static void ipw_alive_start(struct ipw_priv *priv) -+{ -+ int thermal_spin = 0; -+ -+ if (priv->card_alive.is_valid != 1) { -+ /* We had an error bringing up the hardware, so take it -+ * all the way back down so we can try again */ -+ IPW_DEBUG_INFO("Alive failed.\n"); -+ ipw_down(priv); -+ return; -+ } -+ -+ /* After the ALIVE response, we can processed host commands */ -+ priv->status |= STATUS_ALIVE; -+ -+ IPW_DEBUG_INFO("Alive received.\n"); -+ -+ if (!(priv->status & STATUS_RF_KILL_MASK)) { -+ /* if rfkill is not on, then -+ * wait for thermal sensor in adapter to kick in */ -+ while (ipw_read32(priv, CSR_UCODE_DRV_GP2) == 0) { -+ thermal_spin++; -+ udelay(10); -+ } -+ if (thermal_spin) -+ IPW_DEBUG_INFO("Thermal calibration took %dus\n", -+ thermal_spin * 10); -+ } -+ -+ ipw_clear_stations_table(priv); -+ -+ if (!(priv->status & STATUS_RF_KILL_MASK)) -+ ipw_send_daemon_sync(priv, DAEMON_SYNC_INIT, 0, NULL); -+} -+ -+static void ipw_bg_alive_start(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_alive_start(data); -+ mutex_unlock(&priv->mutex); -+} -+ -+#define MAX_HW_RESTARTS 5 -+static int ipw_up(struct ipw_priv *priv) -+{ -+ int rc, i; -+ -+ if (priv->status & STATUS_EXIT_PENDING) { -+ IPW_WARNING("Exit pending will not bring the NIC up\n"); -+ return -EIO; -+ } -+ -+ if (priv->status & STATUS_RF_KILL_SW) { -+ IPW_WARNING("Radio disabled by module parameter.\n"); -+ return 0; -+ } else if (priv->status & STATUS_RF_KILL_HW) -+ return 0; -+ -+ ipw_write32(priv, CSR_INT, 0xFFFFFFFF); -+ -+ rc = ipw_nic_init(priv); -+ if (rc) { -+ IPW_ERROR("Unable to int nic\n"); -+ return rc; -+ } -+ -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_CLR, -+ CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); -+ ipw_write32(priv, CSR_INT, 0xFFFFFFFF); -+ -+ ipw_enable_interrupts(priv); -+ -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); -+ ipw_write32(priv, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); -+ -+ for (i = 0; i < MAX_HW_RESTARTS; i++) { -+ /* Load the microcode, firmware, and eeprom. -+ * Also start the clocks. */ -+ rc = ipw_load_ucode(priv); -+ if (rc) { -+ IPW_ERROR("Unable to load firmware: %d\n", rc); -+ continue; -+ } -+ -+ ipw_clear_stations_table(priv); -+ -+ ipw_verify_ucode(priv); -+ ipw_nic_start(priv); -+ ipw_card_show_info(priv); -+ -+ if (!(priv->config & CFG_CUSTOM_MAC)) { -+ eeprom_parse_mac(priv, priv->mac_addr); -+ IPW_DEBUG_INFO("MAC address: " MAC_FMT "\n", -+ MAC_ARG(priv->mac_addr)); -+ } -+ memcpy(priv->net_dev->dev_addr, priv->mac_addr, ETH_ALEN); -+ return 0; -+ } -+ -+ priv->status |= STATUS_EXIT_PENDING; -+ ipw_down(priv); -+ -+ /* tried to restart and config the device for as long as our -+ * patience could withstand */ -+ IPW_ERROR("Unable to initialize device after %d attempts.\n", i); -+ return -EIO; -+} -+ -+static void ipw_bg_up(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_up(data); -+ mutex_unlock(&priv->mutex); -+} -+ -+static void ipw_down(struct ipw_priv *priv) -+{ -+ unsigned long flags; -+ int exit_pending = priv->status & STATUS_EXIT_PENDING; -+ -+ priv->status |= STATUS_EXIT_PENDING; -+ -+ /* Nuke any running timers */ -+ del_timer_sync(&priv->roaming_wdt); -+ del_timer_sync(&priv->disassociate_wdt); -+ -+ /* If we are coming down due to a microcode error, then -+ * don't bother trying to do anything that resutls in sending -+ * host commands... */ -+ if (!(priv->status & STATUS_FW_ERROR) && ipw_is_alive(priv)) { -+ if ((priv->assoc_request.capability & WLAN_CAPABILITY_IBSS)) -+ ipw_remove_current_network(priv); -+ -+ ipw_update_link_led(priv); -+ ipw_update_activity_led(priv); -+ ipw_update_tech_led(priv); -+ } -+ -+ ipw_remove_all_sta(priv); -+ -+ /* Unblock any waiting calls */ -+ wake_up_interruptible_all(&priv->wait_command_queue); -+ wake_up_interruptible_all(&priv->wait_daemon_out_queue); -+ wake_up_interruptible_all(&priv->wait_daemon_cmd_done); -+ -+ cancel_delayed_work(&priv->resume_work); -+ cancel_delayed_work(&priv->up); -+ cancel_delayed_work(&priv->down); -+ cancel_delayed_work(&priv->daemon_cmd_work); -+ cancel_delayed_work(&priv->activity_timer); -+ cancel_delayed_work(&priv->request_scan); -+ cancel_delayed_work(&priv->gather_stats); -+ cancel_delayed_work(&priv->scan_check); -+ cancel_delayed_work(&priv->associate_timeout); -+ cancel_delayed_work(&priv->rf_kill); -+ cancel_delayed_work(&priv->report_work); -+ cancel_delayed_work(&priv->rate_scale_flush); -+ -+ /* Wipe out the EXIT_PENDING status bit if we are not actually -+ * exiting the module */ -+ if (!exit_pending) -+ priv->status &= ~STATUS_EXIT_PENDING; -+ -+ /* tell the device to stop sending interrupts */ -+ ipw_disable_interrupts(priv); -+ -+ if (priv->netdev_registered) { -+ netif_carrier_off(priv->net_dev); -+ netif_stop_queue(priv->net_dev); -+ } -+ -+ /* If we have not previously called ipw_init() then -+ * clear all bits but the RF Kill and SUSPEND bits and return */ -+ if (!ipw_is_init(priv)) { -+ priv->status &= (STATUS_RF_KILL_MASK | STATUS_IN_SUSPEND); -+ goto exit; -+ } -+ -+ /* ...otherwise clear out all the status bits but the RF Kill and -+ * SUSPEND bits and continue taking the NIC down. */ -+ priv->status &= (STATUS_RF_KILL_MASK | STATUS_IN_SUSPEND); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ ipw_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ ipw_stop_tx_queue(priv); -+ ipw_rxq_stop(priv); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ if (!ipw_grab_restricted_access(priv)) { -+ ipw_write_restricted_reg(priv, ALM_APMG_CLK_DIS, -+ APMG_CLK_REG_VAL_DMA_CLK_RQT); -+ ipw_release_restricted_access(priv); -+ } -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ udelay(5); -+ -+ ipw_nic_stop_master(priv); -+ -+ spin_lock_irqsave(&priv->lock, flags); -+ ipw_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); -+ spin_unlock_irqrestore(&priv->lock, flags); -+ -+ ipw_nic_reset(priv); -+ -+ exit: -+ memset(&priv->card_alive, 0, sizeof(struct ipw_alive_resp)); -+ -+ spin_lock_irqsave(&priv->daemon_lock, flags); -+ ipw_clear_daemon_lists(priv); -+ spin_unlock_irqrestore(&priv->daemon_lock, flags); -+ -+ /* clear out any free frames */ -+ ipw_clear_free_frames(priv); -+ -+ /* If we aren't in a suspend cycle then send the UNIT state to the -+ * daemon */ -+ if (!(priv->status & STATUS_IN_SUSPEND)) -+ ipw_send_daemon_sync(priv, DAEMON_SYNC_UNINIT, 0, NULL); -+} -+ -+static void ipw_bg_down(void *data) -+{ -+ struct ipw_priv *priv = data; -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return; -+ -+ mutex_lock(&priv->mutex); -+ ipw_down(data); -+ mutex_unlock(&priv->mutex); -+} -+ -+static int ipw_ioctl_cmd(struct ipw_priv *priv, struct ifreq *req) -+{ -+ IPW_DEBUG_INFO("Calling ioctl...\n"); -+ return 0; -+} -+ -+static int ipw_ioctl(struct net_device *dev, struct ifreq *req, int cmd) -+{ -+ struct ipw_priv *priv = ieee80211_priv(dev); -+ -+ if (priv->status & STATUS_EXIT_PENDING) -+ return -EOPNOTSUPP; -+ -+ switch (cmd) { -+ case IPW_IOCTL_CMD: -+ return ipw_ioctl_cmd(priv, req); -+ -+#if WIRELESS_EXT < 18 -+ case IPW_IOCTL_WPA_SUPPLICANT: -+ return ipw_wpa_supplicant(dev, &((struct iwreq *)req)->u.data); -+#endif -+ -+ default: -+ return -EOPNOTSUPP; -+ } -+ -+ return -EOPNOTSUPP; -+} -+ -+static struct pci_device_id card_ids[] __devinitdata = { -+ {0x8086, 0x4222, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, -+ {0x8086, 0x4227, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, -+ {0} -+}; -+ -+MODULE_DEVICE_TABLE(pci, card_ids); -+static struct attribute *ipw_sysfs_entries[] = { -+ &dev_attr_rf_kill.attr, -+ &dev_attr_status.attr, -+ &dev_attr_cfg.attr, -+ &dev_attr_dump_errors.attr, -+ &dev_attr_dump_events.attr, -+ &dev_attr_roam.attr, -+ &dev_attr_scan_age.attr, -+ &dev_attr_led.attr, -+ &dev_attr_antenna.attr, -+ &dev_attr_statistics.attr, -+ &dev_attr_cmd.attr, -+ &dev_attr_temperature.attr, -+ &dev_attr_eeprom.attr, -+ &dev_attr_channels.attr, -+ &dev_attr_retry_rate.attr, -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+ &dev_attr_rtap_iface.attr, -+ &dev_attr_rtap_filter.attr, -+#endif -+#ifdef CONFIG_IPW3945_SIM_RX -+ &dev_attr_rx.attr, -+#endif -+ NULL -+}; -+ -+/* -+static struct attribute *ipw_sysfs_entries[] = { -+ NULL -+}; -+*/ -+static struct attribute_group ipw_attribute_group = { -+ .name = NULL, /* put in device directory */ -+ .attrs = ipw_sysfs_entries, -+}; -+ -+#ifdef CONFIG_IPW3945_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->rxon.filter_flags |= (RXON_FILTER_PROMISC_MSK | -+ RXON_FILTER_CTL2HOST_MSK); -+ ipw_rxon_call(priv, priv->status & STATUS_ASSOCIATED); -+ } -+ -+ 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->rxon.filter_flags &= ~(RXON_FILTER_PROMISC_MSK | -+ RXON_FILTER_CTL2HOST_MSK); -+ ipw_rxon_call(priv, priv->status & STATUS_ASSOCIATED); -+ } -+ -+ 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; -+ struct net_device *net_dev; -+ void __iomem *base; -+ u32 length; -+ u32 pci_id; -+ struct ipw_priv *priv; -+ int i; -+ -+ net_dev = alloc_ieee80211(sizeof(struct ipw_priv)); -+ if (net_dev == NULL) { -+ err = -ENOMEM; -+ goto out; -+ } -+ -+ IPW_DEBUG_INFO("*** LOAD DRIVER ***\n"); -+ priv = ieee80211_priv(net_dev); -+ priv->ieee = netdev_priv(net_dev); -+ priv->ieee->host_encrypt = 1; -+ priv->ieee->host_decrypt = 1; -+ priv->ieee->host_build_iv = 1; -+ priv->net_dev = net_dev; -+ -+ priv->pci_dev = pdev; -+ priv->rxq = NULL; -+ priv->antenna = antenna; -+#ifdef CONFIG_IPW3945_DEBUG -+ ipw_debug_level = debug; -+#endif -+ priv->retry_rate = 1; -+ -+ spin_lock_init(&priv->daemon_lock); -+ spin_lock_init(&priv->lock); -+ spin_lock_init(&priv->power_data.lock); -+ spin_lock_init(&priv->rate_scale_mgr.lock); -+ -+ for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) -+ INIT_LIST_HEAD(&priv->ibss_mac_hash[i]); -+ -+ INIT_LIST_HEAD(&priv->free_frames); -+ -+ INIT_LIST_HEAD(&priv->daemon_in_list); -+ INIT_LIST_HEAD(&priv->daemon_out_list); -+ INIT_LIST_HEAD(&priv->daemon_free_list); -+ -+ mutex_init(&priv->mutex); -+ if (pci_enable_device(pdev)) { -+ err = -ENODEV; -+ goto out_free_ieee80211; -+ } -+ -+ pci_set_master(pdev); -+ -+ ipw_clear_stations_table(priv); -+ -+ memset(&(priv->txq[0]), 0, sizeof(struct ipw_tx_queue) * 6); -+ memset(&priv->card_alive, 0, sizeof(struct ipw_alive_resp)); -+ priv->data_retry_limit = -1; -+ priv->auth_state = CMAS_INIT; -+ -+ err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); -+ if (!err) -+ err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); -+ if (err) { -+ printk(KERN_WARNING DRV_NAME ": No suitable DMA available.\n"); -+ goto out_pci_disable_device; -+ } -+ -+ pci_set_drvdata(pdev, priv); -+ err = pci_request_regions(pdev, DRV_NAME); -+ if (err) -+ goto out_pci_disable_device; -+ /* We disable the RETRY_TIMEOUT register (0x41) to keep -+ * PCI Tx retries from interfering with C3 CPU state */ -+ pci_write_config_byte(pdev, 0x41, 0x00); -+ -+ length = pci_resource_len(pdev, 0); -+ priv->hw_len = length; -+ base = ioremap_nocache(pci_resource_start(pdev, 0), length); -+ if (!base) { -+ err = -ENODEV; -+ goto out_pci_release_regions; -+ } -+ -+ priv->hw_base = base; -+ IPW_DEBUG_INFO("pci_resource_len = 0x%08x\n", length); -+ IPW_DEBUG_INFO("pci_resource_base = %p\n", base); -+ err = ipw_setup_deferred_work(priv); -+ if (err) { -+ IPW_ERROR("Unable to setup deferred work\n"); -+ goto out_iounmap; -+ } -+ -+ /* Initialize module parameter values here */ -+ -+ if (!led) -+ priv->config |= CFG_NO_LED; -+ if (associate) -+ priv->config |= CFG_ASSOCIATE; -+ else -+ IPW_DEBUG_INFO("Auto associate disabled.\n"); -+ if (auto_create) -+ priv->config |= CFG_ADHOC_CREATE; -+ else -+ IPW_DEBUG_INFO("Auto adhoc creation disabled.\n"); -+ if (disable) { -+ priv->status |= STATUS_RF_KILL_SW; -+ IPW_DEBUG_INFO("Radio disabled.\n"); -+ } -+#ifdef CONFIG_IPW3945_QOS -+ /* QoS */ -+ ipw_qos_init(priv, qos_enable, qos_burst_enable, -+ qos_burst_CCK, qos_burst_OFDM); -+#endif -+ -+ /*************************************/ -+ switch (mode) { -+ case 1: -+ priv->ieee->iw_mode = IW_MODE_ADHOC; -+ break; -+#ifdef CONFIG_IPW3945_MONITOR -+ case 2: -+ priv->ieee->iw_mode = IW_MODE_MONITOR; -+ break; -+#endif -+ default: -+ case 0: -+ priv->ieee->iw_mode = IW_MODE_INFRA; -+ break; -+ } -+ -+ priv->ieee->mode = IEEE_G | IEEE_B; -+ priv->ieee->freq_band = IEEE80211_24GHZ_BAND; -+ priv->ieee->modulation = IEEE80211_OFDM_MODULATION | -+ IEEE80211_CCK_MODULATION; -+ -+ pci_id = -+ (priv->pci_dev->device << 16) | priv->pci_dev->subsystem_device; -+ -+ switch (pci_id) { -+ case 0x42221005: /* 0x4222 0x8086 0x1005 is BG SKU */ -+ case 0x42221034: /* 0x4222 0x8086 0x1034 is BG SKU */ -+ case 0x42271014: /* 0x4227 0x8086 0x1014 is BG SKU */ -+ case 0x42221044: /* 0x4222 0x8086 0x1044 is BG SKU */ -+ priv->is_abg = 0; -+ break; -+ -+ default: /* Rest are assumed ABG SKU -- if this is not the -+ * case then the card will get the wrong 'Detected' -+ * line in the kernel log however the code that -+ * initializes the GEO table will detect no A-band -+ * channels and remove the is_abg mask. */ -+ priv->ieee->mode |= IEEE_A; -+ priv->ieee->freq_band |= IEEE80211_52GHZ_BAND; -+ priv->is_abg = 1; -+ break; -+ } -+ -+ printk(KERN_INFO DRV_NAME -+ ": Detected Intel PRO/Wireless 3945%s Network Connection\n", -+ priv->is_abg ? "ABG" : "BG"); -+ -+ if (channel != 0) { -+ priv->config |= CFG_STATIC_CHANNEL; -+ priv->channel = channel; -+ IPW_DEBUG_INFO("Bind to static channel %d\n", channel); -+ /* TODO: Validate that provided channel is in range */ -+ } else -+ priv->channel = 1; -+ -+ err = ipw_read_ucode(priv); -+ if (err) { -+ IPW_ERROR("Could not read microcode: %d\n", err); -+ goto out_destroy_workqueue; -+ } -+ -+ priv->rates_mask = IEEE80211_DEFAULT_RATES_MASK | -+ (IEEE80211_OFDM_BASIC_RATES_MASK | -+ IEEE80211_CCK_BASIC_RATES_MASK) << 16; -+ priv->missed_beacon_threshold = IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT; -+ priv->roaming_threshold = IPW_MB_ROAMING_THRESHOLD_DEFAULT; -+ priv->rts_threshold = DEFAULT_RTS_THRESHOLD; -+ /* If power management is turned on, default to AC mode */ -+ priv->power_mode = IPW_POWER_AC; -+ priv->actual_txpower_limit = IPW_DEFAULT_TX_POWER; -+ err = request_irq(pdev->irq, ipw_isr, SA_SHIRQ, DRV_NAME, priv); -+ if (err) { -+ IPW_ERROR("Error allocating IRQ %d\n", pdev->irq); -+ goto out_release_ucode; -+ } -+ -+ SET_MODULE_OWNER(net_dev); -+ SET_NETDEV_DEV(net_dev, &pdev->dev); -+ mutex_lock(&priv->mutex); -+ priv->ieee->hard_start_xmit = ipw_net_hard_start_xmit; -+ priv->ieee->set_security = shim__set_security; -+ /* QoS */ -+ /* Implement the STA callbacks... */ -+ priv->ieee->handle_auth = ipw_handle_auth; -+ priv->ieee->handle_deauth = ipw_handle_deauth; -+ priv->ieee->handle_disassoc = ipw_handle_disassoc; -+ priv->ieee->handle_probe_response = ipw_handle_probe_response; -+ priv->ieee->handle_beacon = ipw_handle_beacon; -+ priv->ieee->handle_assoc_response = ipw_handle_assoc_response; -+ priv->ieee->handle_probe_request = ipw_handle_probe_request; -+ /**************************************************************/ -+ priv->ieee->perfect_rssi = -20; -+ priv->ieee->worst_rssi = -95; -+ net_dev->open = ipw_net_open; -+ net_dev->stop = ipw_net_stop; -+ net_dev->do_ioctl = ipw_ioctl; -+ net_dev->get_stats = ipw_net_get_stats; -+ net_dev->set_mac_address = ipw_net_set_mac_address; -+ -+#if WIRELESS_EXT > 16 -+ priv->wireless_data.spy_data = &priv->ieee->spy_data; -+ net_dev->wireless_data = &priv->wireless_data; -+#else -+ net_dev->get_wireless_stats = ipw_get_wireless_stats; -+#endif -+ -+ net_dev->wireless_handlers = &ipw_wx_handler_def; -+ net_dev->ethtool_ops = &ipw_ethtool_ops; -+ net_dev->irq = pdev->irq; -+ net_dev->base_addr = (unsigned long)priv->hw_base; -+ net_dev->mem_start = pci_resource_start(pdev, 0); -+ net_dev->mem_end = net_dev->mem_start + pci_resource_len(pdev, 0) - 1; -+ -+ err = sysfs_create_group(&pdev->dev.kobj, &ipw_attribute_group); -+ if (err) { -+ IPW_ERROR("failed to create sysfs device attributes\n"); -+ mutex_unlock(&priv->mutex); -+ goto out_release_irq; -+ } -+ // allocate ucode buffers -+ priv->ucode_code.actual_len = ALM_RTC_INST_SIZE; -+ priv->ucode_data.actual_len = ALM_RTC_DATA_SIZE; -+ priv->ucode_code.v_addr = -+ pci_alloc_consistent(priv->pci_dev, -+ priv->ucode_code.actual_len, -+ &(priv->ucode_code.p_addr)); -+ priv->ucode_data.v_addr = -+ pci_alloc_consistent(priv->pci_dev, -+ priv->ucode_data.actual_len, -+ &(priv->ucode_data.p_addr)); -+ if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr) { -+ IPW_ERROR("failed to allocate pci memory\n"); -+ mutex_unlock(&priv->mutex); -+ goto out_remove_sysfs; -+ } -+ -+ priv->shared_virt = -+ pci_alloc_consistent(priv->pci_dev, -+ sizeof(struct ipw_shared_t), -+ &priv->shared_phys); -+ if (!priv->shared_virt) { -+ IPW_ERROR("failed to allocate pci memory\n"); -+ mutex_unlock(&priv->mutex); -+ goto out_pci_alloc; -+ } -+ mutex_unlock(&priv->mutex); -+ -+ /* We don't register with netdev here as the NIC isn't actually to -+ * a point where we can start accepting wireless extension and -+ * network configuration commands. If we simply return EAGAIN -+ * from all of those handlers until the adapter is calibrated, -+ * then we run the risk of user space tools bailing out erroneously -+ * and users not knowing how to make things work. */ -+ IPW_DEBUG_INFO("Waiting for ipw3945d to request INIT.\n"); -+ -+ return 0; -+ -+ out_remove_sysfs: -+ sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); -+ if (priv->workqueue) -+ cancel_delayed_work(&priv->rf_kill); -+ -+ out_pci_alloc: -+ if (priv->ucode_code.v_addr != NULL) -+ pci_free_consistent(priv->pci_dev, -+ priv->ucode_code.actual_len, -+ priv->ucode_code.v_addr, -+ priv->ucode_code.p_addr); -+ if (priv->ucode_data.v_addr != NULL) -+ pci_free_consistent(priv->pci_dev, -+ priv->ucode_data.actual_len, -+ priv->ucode_data.v_addr, -+ priv->ucode_data.p_addr); -+ if (priv->shared_virt != NULL) -+ pci_free_consistent(priv->pci_dev, -+ sizeof(struct ipw_shared_t), -+ priv->shared_virt, priv->shared_phys); -+ priv->ucode_code.v_addr = NULL; -+ priv->ucode_data.v_addr = NULL; -+ priv->shared_virt = NULL; -+ out_release_irq: -+ free_irq(pdev->irq, priv); -+ out_release_ucode: -+ if (priv->ucode_raw) { -+ release_firmware(priv->ucode_raw); -+ priv->ucode_raw = NULL; -+ } -+ out_destroy_workqueue: -+ destroy_workqueue(priv->workqueue); -+ destroy_workqueue(priv->daemonqueue); -+ priv->workqueue = NULL; -+ out_iounmap: -+ iounmap(priv->hw_base); -+ out_pci_release_regions: -+ pci_release_regions(pdev); -+ out_pci_disable_device: -+ pci_disable_device(pdev); -+ pci_set_drvdata(pdev, NULL); -+ out_free_ieee80211: -+ free_ieee80211(priv->net_dev); -+ out: -+ return err; -+} -+ -+static void ipw_pci_remove(struct pci_dev *pdev) -+{ -+ struct ipw_priv *priv = pci_get_drvdata(pdev); -+ struct list_head *p, *q; -+ int i; -+ -+ if (!priv) -+ return; -+ -+ IPW_DEBUG_INFO("*** UNLOAD DRIVER ***\n"); -+ -+ mutex_lock(&priv->mutex); -+ -+ priv->status |= STATUS_EXIT_PENDING; -+ -+ ipw_down(priv); -+ -+ mutex_unlock(&priv->mutex); -+ -+ destroy_workqueue(priv->workqueue); -+ destroy_workqueue(priv->daemonqueue); -+ -+ priv->workqueue = NULL; -+ -+ /* Free MAC hash list for ADHOC */ -+ for (i = 0; i < IPW_IBSS_MAC_HASH_SIZE; i++) { -+ list_for_each_safe(p, q, &priv->ibss_mac_hash[i]) { -+ list_del(p); -+ kfree(list_entry(p, struct ipw_ibss_seq, list)); -+ } -+ } -+ -+ sysfs_remove_group(&pdev->dev.kobj, &ipw_attribute_group); -+ -+ if (priv->ucode_code.v_addr != NULL) -+ pci_free_consistent(priv->pci_dev, -+ priv->ucode_code.actual_len, -+ priv->ucode_code.v_addr, -+ priv->ucode_code.p_addr); -+ if (priv->ucode_data.v_addr != NULL) -+ pci_free_consistent(priv->pci_dev, -+ priv->ucode_data.actual_len, -+ priv->ucode_data.v_addr, -+ priv->ucode_data.p_addr); -+ if (priv->shared_virt != NULL) -+ pci_free_consistent(priv->pci_dev, -+ sizeof(*priv->shared_virt), -+ priv->shared_virt, priv->shared_phys); -+ priv->ucode_code.v_addr = NULL; -+ priv->ucode_data.v_addr = NULL; -+ priv->shared_virt = NULL; -+ if (priv->rxq) -+ ipw_rx_queue_free(priv, priv->rxq); -+ ipw_tx_queue_free(priv); -+ ipw_card_remove_notify(priv); -+ -+ ipw_delete_stations_table(priv, 0); -+ -+ if (priv->ucode_raw) { -+ release_firmware(priv->ucode_raw); -+ priv->ucode_raw = NULL; -+ } -+ -+ if (priv->netdev_registered) { -+ unregister_netdev(priv->net_dev); -+ } -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+ ipw_prom_free(priv); -+#endif -+ -+ free_irq(pdev->irq, priv); -+ iounmap(priv->hw_base); -+ pci_release_regions(pdev); -+ pci_disable_device(pdev); -+ pci_set_drvdata(pdev, NULL); -+ free_ieee80211(priv->net_dev); -+} -+ -+#ifdef CONFIG_PM -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) -+static int ipw_pci_suspend(struct pci_dev *pdev, u32 state) -+#else -+static int ipw_pci_suspend(struct pci_dev *pdev, pm_message_t state) -+#endif -+{ -+ struct ipw_priv *priv = pci_get_drvdata(pdev); -+ struct net_device *dev = priv->net_dev; -+ printk(KERN_INFO "%s: Going into suspend...\n", dev->name); -+ -+ mutex_lock(&priv->mutex); -+ -+ priv->status |= STATUS_IN_SUSPEND; -+ -+ /* Send the RESUME state to the daemon */ -+ ipw_send_daemon_sync(priv, DAEMON_SYNC_SUSPEND, 0, NULL); -+ -+ /* Take down the device; powers it off, etc. */ -+ ipw_down(priv); -+ -+ /* Remove the PRESENT state of the device */ -+ if (priv->netdev_registered) -+ netif_device_detach(dev); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) -+ pci_save_state(pdev, priv->pm_state); -+#else -+ pci_save_state(pdev); -+#endif -+ pci_disable_device(pdev); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) -+ pci_set_power_state(pdev, state); -+#else -+ pci_set_power_state(pdev, PCI_D3hot); -+#endif -+ -+ mutex_unlock(&priv->mutex); -+ -+ return 0; -+} -+ -+static int ipw_pci_resume(struct pci_dev *pdev) -+{ -+ struct ipw_priv *priv = pci_get_drvdata(pdev); -+ struct net_device *dev = priv->net_dev; -+ -+ printk(KERN_INFO "%s: Coming out of suspend...\n", dev->name); -+ -+ mutex_lock(&priv->mutex); -+ -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) -+ pci_set_power_state(pdev, 0); -+#else -+ pci_set_power_state(pdev, PCI_D0); -+#endif -+ if (pci_enable_device(pdev)) -+ return -ENODEV; -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) -+ pci_restore_state(pdev, priv->pm_state); -+#else -+ pci_restore_state(pdev); -+#endif -+ /* -+ * Suspend/Resume resets the PCI configuration space, so we have to -+ * re-disable the RETRY_TIMEOUT register (0x41) to keep PCI Tx retries -+ * from interfering with C3 CPU state. pci_restore_state won't help -+ * here since it only restores the first 64 bytes pci config header. -+ */ -+ pci_write_config_byte(pdev, 0x41, 0x00); -+ -+ /* Set the device back into the PRESENT state; this will also wake -+ * the queue of needed */ -+ if (priv->netdev_registered) -+ netif_device_attach(dev); -+ -+ queue_delayed_work(priv->workqueue, &priv->resume_work, 3 * HZ); -+ -+ mutex_unlock(&priv->mutex); -+ -+ return 0; -+} -+#endif -+ -+/* driver initialization stuff */ -+static struct pci_driver ipw_driver = { -+ .name = DRV_NAME,.id_table = card_ids,.probe = -+ ipw_pci_probe,.remove = __devexit_p(ipw_pci_remove), -+#ifdef CONFIG_PM -+ .suspend = ipw_pci_suspend,.resume = ipw_pci_resume, -+#endif -+}; -+static int __init ipw_init(void) -+{ -+ -+ int ret; -+ printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n"); -+ printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n"); -+ ret = pci_module_init(&ipw_driver); -+ if (ret) { -+ IPW_ERROR("Unable to initialize PCI module\n"); -+ return ret; -+ } -+ -+ ret = driver_create_file(&ipw_driver.driver, &driver_attr_debug_level); -+ if (ret) { -+ IPW_ERROR("Unable to create driver sysfs file\n"); -+ pci_unregister_driver(&ipw_driver); -+ return ret; -+ } -+ -+ return ret; -+} -+ -+static void __exit ipw_exit(void) -+{ -+ driver_remove_file(&ipw_driver.driver, &driver_attr_debug_level); -+ pci_unregister_driver(&ipw_driver); -+} -+ -+module_param(antenna, int, 0444); -+MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])"); -+module_param(disable, int, 0444); -+MODULE_PARM_DESC(disable, "manually disable the radio (default 0 [radio on])"); -+module_param(associate, int, 0444); -+MODULE_PARM_DESC(associate, "auto associate when scanning (default 0 off)"); -+module_param(auto_create, int, 0444); -+MODULE_PARM_DESC(auto_create, "auto create adhoc network (default 1 on)"); -+module_param(led, int, 0444); -+MODULE_PARM_DESC(led, "enable led control (default 1 on)\n"); -+#ifdef CONFIG_IPW3945_DEBUG -+module_param(debug, int, 0444); -+MODULE_PARM_DESC(debug, "debug output mask"); -+#endif -+module_param(channel, int, 0444); -+MODULE_PARM_DESC(channel, "channel to limit associate to (default 0 [ANY])"); -+ -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+module_param(rtap_iface, int, 0444); -+MODULE_PARM_DESC(rtap_iface, -+ "create the rtap interface (1 - create, default 0)"); -+#endif -+ -+#ifdef CONFIG_IPW3945_QOS -+/* QoS */ -+module_param(qos_enable, int, 0444); -+MODULE_PARM_DESC(qos_enable, "enable all QoS functionalitis"); -+module_param(qos_burst_enable, int, 0444); -+MODULE_PARM_DESC(qos_burst_enable, "enable QoS burst mode"); -+module_param(qos_no_ack_mask, int, 0444); -+MODULE_PARM_DESC(qos_no_ack_mask, "mask Tx_Queue to no ack"); -+module_param(qos_burst_CCK, int, 0444); -+MODULE_PARM_DESC(qos_burst_CCK, "set CCK burst value"); -+module_param(qos_burst_OFDM, int, 0444); -+MODULE_PARM_DESC(qos_burst_OFDM, "set OFDM burst value"); -+#endif -+ -+/****************************************/ -+#ifdef CONFIG_IPW3945_MONITOR -+module_param(mode, int, 0444); -+MODULE_PARM_DESC(mode, "network mode (0=BSS,1=IBSS,2=Monitor)"); -+#else -+module_param(mode, int, 0444); -+MODULE_PARM_DESC(mode, "network mode (0=BSS,1=IBSS)"); -+#endif -+module_exit(ipw_exit); -+module_init(ipw_init); -diff -Nurp linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/ipw3945_daemon.h linux-2.6.18-gentoo-r4/drivers/net/wireless/ipw3945_daemon.h ---- linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/ipw3945_daemon.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/drivers/net/wireless/ipw3945_daemon.h 2006-11-29 11:19:22.000000000 +0100 -@@ -0,0 +1,403 @@ -+/* -+ -+ This file is provided under a dual BSD/GPLv2 license. When using or -+ redistributing this file, you may do so under either license. -+ -+ GPL LICENSE SUMMARY -+ -+ Copyright(c) 2005 - 2006 Intel Corporation. All rights reserved. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of version 2 of the GNU Geeral Public License as -+ published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, but -+ WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, -+ USA -+ -+ The full GNU General Public License is included in this distribution -+ in the file called LICENSE.GPL. -+ -+ Contact Information: -+ James P. Ketrenos -+ Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 -+ -+ BSD LICENSE -+ -+ Copyright(c) 2005 - 2006 Intel Corporation. All rights reserved. -+ All rights reserved. -+ -+ Redistribution and use in source and binary forms, with or without -+ modification, are permitted provided that the following conditions -+ are met: -+ -+ * Redistributions of source code must retain the above copyright -+ notice, this list of conditions and the following disclaimer. -+ * Redistributions in binary form must reproduce the above copyright -+ notice, this list of conditions and the following disclaimer in -+ the documentation and/or other materials provided with the -+ distribution. -+ * Neither the name Intel Corporation nor the names of its -+ contributors may be used to endorse or promote products derived -+ from this software without specific prior written permission. -+ -+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ -+*/ -+#ifndef __ipw3945_daemon_h__ -+#define __ipw3945_daemon_h__ -+ -+/* driver <-> daemon command and response structure */ -+ -+#define IPW_DAEMON_VERSION 7 -+ -+/* Protol change history -+ * -+ * Changes in protocol v7 -+ * * Changed REINIT to an explicit UNINIT and INIT sequence -+ * * Added DAEMON_SYNC_{SUSPEND,RESUME} for the driver to -+ * notify the daemon when it is going into suspend/resume. -+ * -+ * Changes in protocol v6 -+ * * Added TEMPERATURE and EEPROM read commands -+ * * Added STATE command for set daemon state -+ * * Changed DAEMON_SYNC_* enumeration -+ * -+ * Changes in protocol v5 -+ * * Added DAEMON_POLL_INTERVAL as the maximum time -+ * in ms for the driver to block in the sysfs show -+ * operation. If no commands are available in that -+ * * Renamed all IPW_ defines to DAEMON_ -+ * time period, it needs to return -ETIMEDOUT. -+ * * Removed DAEMON_SYNC_ASSOCIATE and added beacon_interval -+ * to DAEMON_RX_CONFIG. -+ * -+ * Changes in protocol v4 -+ * * Added DAEMON_SYNC_TX_STATUS for sending Tx measurement -+ * status to the daemon. -+ * -+ * Changes in protocol v3 -+ * * Added synchronous command notification via DAEMON_CMD_DONE -+ * -+ */ -+ -+/* -+ * Driver / Daemon State Machine -+ * -+ * As a result of the requirements that the device must operate within -+ * operating parameters known to be in compliance, the daemon enforces -+ * its view of the hardware state machine. If the daemon does not think -+ * the hardware is calibrated, for example, it won't allow scanning or -+ * rx config to be configured. -+ * -+ * The typical flow of events is as follows: -+ * 1. Driver loads -+ * 2. Daemon loads -+ * 3. Daemon finds driver sysfs entry (exiting if not present) -+ * 4. Daemon requests the driver perform a UNINIT sequence via -+ * DAEMON_SET_STATE with the state DAEMON_DRIVER_STATE_UNINIT -+ * At this point, the daemon's view of the hardware is uninitializing -+ * 5. Driver takes down hardware (if it is configured). -+ * At completion of the takedown, or if not needed, the driver sends the -+ * DAEMON_SYNC:DAEMON_SYNC_UNINIT to the daemon. -+ * 6. Daemon requests the driver perform an INIT sequence via -+ * DAEMON_SET_STATE with the state DAEMON_DRIVER_STATE_INIT -+ * At this point, the daemon's view of the hardware is initializing -+ * 7. Driver brings up the hardware. At completion of the bring up, -+ * the driver sends the DAEMON_SYNC:DAEMON_SYNC_INIT to the daemon. -+ * 8. Driver sends DAEMON_SYNC command with the state set to DAEMON_SYNC_INIT -+ * At this point, the daemon's view of the hardware is initialized, but -+ * not calibrated. -+ * 9. Daemon calibrates the hardware -+ * At this point, the daemon's view of the hardware is calibrated -- all -+ * operations now function (scan, rx_config, etc.) -+ * 10. Daemon sends DAEMON_SET_STATE with DAEMON_DRIVER_STATE_CALIBRATED -+ * -+ * In the event that the driver detects a microcode or hardware error, the -+ * following will occur: -+ * 1. Driver sends DAEMON_SYNC command with the state set to DAEMON_SYNC_UNINIT -+ * 2. Upon receipt of the DAEMON_SYNC_UNINIT command, the state machine -+ * transitions back to step #6 above -+ * -+ * If the regulatory daemon is terminated and restarted, the steps begin above -+ * with step #2. -+ * -+ * Between step #4 and step #9, the daemon will ignore all commands sent from -+ * the driver to the daemon. This allows any pending operations to flush -+ * out of the queues and for the driver and daemon to synchronize back to the -+ * DAEMON_SYNC_INIT state. -+ * -+ */ -+ -+/* command and reponse enumeration */ -+enum { -+ DAEMON_ERROR = 0x01, /* driver <- daemon */ -+ DAEMON_REGULATORY_INFO = 0x02, /* driver <- daemon */ -+ DAEMON_FRAME_TX = 0x03, /* driver <- daemon */ -+ DAEMON_FRAME_RX = 0x04, /* daemon -> daemon */ -+ DAEMON_CMD_DONE = 0x05, /* driver <- daemon */ -+ DAEMON_SYNC = 0x06, /* driver -> daemon */ -+ DAEMON_SCAN_REQUEST = 0x7, /* driver -> daemon */ -+ DAEMON_RX_CONFIG = 0x8, /* driver -> daemon */ -+ DAEMON_READ_TIMEOUT = 0x9, /* driver -> daemon */ -+ DAEMON_REQUEST_INFO = 0x10, /* driver <- daemon */ -+ DAEMON_SET_STATE = 0x11, /* driver <- daemon */ -+}; -+ -+/* command flags */ -+enum { -+ DAEMON_FLAG_WANT_RESULT = (1 << 0), -+ DAEMON_FLAG_HUGE = (1 << 1), -+ DAEMON_FLAG_NIC_CMD = (1 << 2), -+}; -+ -+/* request info type */ -+enum { -+ DAEMON_REQUEST_TEMPERATURE = 1, -+ DAEMON_REQUEST_EEPROM = 2, -+}; -+ -+/* state of driver per daemon request -+ * -+ * NOTE: -+ * The driver needs to transition into these states when the -+ * daemon indicates it is required. */ -+enum { -+ /* When the daemon requests the state to transition to the UNINIT -+ * within the driver, the driver should take down the hardware. -+ * Upon completing the take down process, the driver should -+ * send the DAEMON_SYNC:DAEMON_SYNC_UNINIT command back to the -+ * driver even if the hardware was already down. */ -+ DAEMON_DRIVER_STATE_UNINIT, -+ -+ /* When the daemon requests the state to transition to the INIT -+ * within the driver, the driver should take down the hardware. -+ * Upon completing the take down process, the driver should -+ * send the DAEMON_SYNC:DAEMON_SYNC_INIT command back to the -+ * driver even if the driver was already up. */ -+ DAEMON_DRIVER_STATE_INIT, -+ -+ /* When the daemon indicates CALIBRATED to the driver, -+ * it is an indication that the rx_config command will -+ * be able to proceed. The driver can begin scanning, -+ * etc. */ -+ DAEMON_DRIVER_STATE_CALIBRATED, -+}; -+ -+/* Period in ms for the sysfs read operation to block waiting for -+ * a command to appear. Currently set to 60s. */ -+#define DAEMON_POLL_INTERVAL 60000 -+ -+#define DAEMON_BUF_SIZE 3000 -+ -+struct daemon_cmd_hdr { -+ u8 cmd; -+ u8 flags; -+ u8 token; -+ u8 reserved1; -+ u16 version; -+ u16 data_len; -+ u8 data[0]; -+} __attribute__ ((packed)); -+ -+struct daemon_cmd { -+ struct daemon_cmd_hdr hdr; -+ u8 data[DAEMON_BUF_SIZE]; -+} __attribute__ ((packed)); -+ -+/* driver <- daemon error response */ -+struct daemon_error { -+ u8 cmd_requested; -+ u8 reserved1; -+ u16 reserved2; -+ s32 return_code; -+} __attribute__ ((packed)); -+ -+/* driver <- daemon synchronous command done */ -+struct daemon_cmd_done { -+ u8 cmd_requested; -+ u8 reserved1; -+ u16 reserved2; -+ s32 return_code; -+} __attribute__ ((packed)); -+ -+/* driver <- daemon regulatory information -+ * -+ * The following is sent from the daemon to the driver -+ * to inform the driver of current channel capabilities and -+ * restrictions. -+ * -+ * Immediately after INIT is provided from the driver the -+ * daemon will send the full channel map. -+ * -+ * After a channel has been selected via rx_config, the -+ * daemon will send periodic updates when the channel limits -+ * change for a specific channel. -+ * -+ * NOTE: The txpower field represents the current configured -+ * power as directed by either the user (sent to the daemon -+ * through the DAEMON_SYNC::DAEMON_SYNC_TXPOWER_LIMIT command) -+ * or as specified through the currently associated access -+ * point. The max_txpower is the highest the channel is -+ * allowed to transmit. -+ * -+ */ -+enum { -+ DAEMON_A_BAND = (1 << 0), /* 0 - 2.4Ghz, 1 - 5.2Ghz */ -+ DAEMON_IBSS_ALLOWED = (1 << 1), -+ DAEMON_ACTIVE_ALLOWED = (1 << 2), -+ DAEMON_RADAR_DETECT = (1 << 3), -+}; -+struct daemon_channel_info { -+ u8 channel; -+ u8 flags; -+ s8 txpower; -+ s8 max_txpower; -+}; -+struct daemon_regulatory_info { -+ u16 count; /* Number of channels provided */ -+ struct daemon_channel_info channel_info[0]; -+} __attribute__ ((packed)); -+ -+/* driver <- daemon information request */ -+struct daemon_request_info { -+ u8 request; -+} __attribute__ ((packed)); -+ -+/* driver <- daemon set state */ -+struct daemon_set_state { -+ u8 state; -+} __attribute__ ((packed)); -+ -+/* driver -> daemon scan request */ -+#define DAEMON_MIN_24GHZ_CHANNEL 1 -+#define DAEMON_MAX_24GHZ_CHANNEL 14 -+#define DAEMON_MIN_52GHZ_CHANNEL 34 -+#define DAEMON_MAX_52GHZ_CHANNEL 165 -+ -+#define DAEMON_SCAN_FLAG_24GHZ (1<<0) -+#define DAEMON_SCAN_FLAG_52GHZ (1<<1) -+#define DAEMON_SCAN_FLAG_ACTIVE (1<<2) -+#define DAEMON_SCAN_FLAG_DIRECT (1<<3) -+ -+#define DAEMON_MAX_CMD_SIZE 1024 -+ -+enum { -+ DAEMON_TXRATE_1 = 0xa, -+ DAEMON_TXRATE_2 = 0x14, -+ DAEMON_TXRATE_5_5 = 0x37, -+ DAEMON_TXRATE_6 = 0xd, -+ DAEMON_TXRATE_9 = 0xf, -+ DAEMON_TXRATE_11 = 0x6e, -+ DAEMON_TXRATE_12 = 0x5, -+ DAEMON_TXRATE_18 = 0x7, -+ DAEMON_TXRATE_24 = 0x9, -+ DAEMON_TXRATE_36 = 0xb, -+ DAEMON_TXRATE_48 = 0x1, -+ DAEMON_TXRATE_54 = 0x3, -+}; -+ -+struct daemon_scan_channel { -+ u8 channel; -+ u8 request_active; -+ u16 active_dwell; -+ u16 passive_dwell; -+} __attribute__ ((packed)); -+ -+struct daemon_ssid_ie { -+ u8 id; -+ u8 len; -+ u8 ssid[32]; -+} __attribute__ ((packed)); -+ -+struct daemon_rx_config { -+ u8 dev_type; -+ u16 channel; -+ u32 flags; -+ u32 filter_flags; -+ u8 ofdm_basic_rates; -+ u8 cck_basic_rates; -+ u8 node_addr[6]; -+ u8 bssid_addr[6]; -+ u16 assoc_id; -+ u16 beacon_interval; -+} __attribute__ ((packed)); -+ -+#define DAEMON_MAX_SCAN_SIZE 1024 -+struct daemon_scan_request { -+ u8 flags; /* 0 - 2.4Ghz, 1 - 5.2Ghz */ -+ u8 channel_count; -+ u16 probe_request_len; -+ u16 quiet_time; /* dwell only this long on quiet chnl (active scan) */ -+ u16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */ -+ u32 suspend_time; /* pause scan this long when returning to svc chnl */ -+ u32 max_out_time; /* max msec to be out of associated (service) chnl */ -+ u8 probe_request_rate; /* rate to send probe request */ -+ u32 filter_flags; -+ u32 rxon_flags; -+ struct daemon_ssid_ie direct_scan; -+ u8 data[0]; -+ /* -+ The channels start after the probe request payload and are of type: -+ -+ struct daemon_scan_channel channels[0]; -+ -+ NOTE: Only one band of channels can be scanned per pass. You -+ can not mix 2.4Ghz channels and 5.2Ghz channels and must -+ request a scan multiple times (not concurrently) -+ -+ */ -+} __attribute__ ((packed)); -+ -+/* driver -> daemon 11h frame */ -+struct daemon_80211_frame { -+ u8 channel; -+ u8 reserved1; -+ u16 rssi; -+ u16 reserved2; -+ u64 tsf; -+ u32 beacon_time; -+ u16 frame_len; -+ u8 frame[0]; -+} __attribute__ ((packed)); -+ -+struct daemon_sync_txpower_limit { -+ u8 channel; -+ s8 power; -+} __attribute__ ((packed)); -+ -+enum { -+ DAEMON_SYNC_UNINIT = 0, -+ DAEMON_SYNC_INIT, -+ DAEMON_SYNC_SCAN_COMPLETE, -+ DAEMON_SYNC_TXPOWER_LIMIT, -+ DAEMON_SYNC_MEASURE_REPORT, -+ DAEMON_SYNC_TX_STATUS, -+ DAEMON_SYNC_SUSPEND, -+ DAEMON_SYNC_RESUME, -+}; -+ -+/* driver -> daemon */ -+struct daemon_sync_cmd { -+ u16 state; -+ u16 len; -+ u8 data[0]; -+} __attribute__ ((packed)); -+ -+#endif -diff -Nurp linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/ipw3945.h linux-2.6.18-gentoo-r4/drivers/net/wireless/ipw3945.h ---- linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/ipw3945.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/drivers/net/wireless/ipw3945.h 2006-11-29 11:19:22.000000000 +0100 -@@ -0,0 +1,2551 @@ -+/****************************************************************************** -+ -+ Copyright(c) 2003 - 2006 Intel Corporation. All rights reserved. -+ -+ This program is free software; you can redistribute it and/or modify it -+ under the terms of version 2 of the GNU General Public License as -+ published by the Free Software Foundation. -+ -+ This program is distributed in the hope that it will be useful, but WITHOUT -+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -+ more details. -+ -+ You should have received a copy of the GNU General Public License along with -+ this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA -+ -+ The full GNU General Public License is included in this distribution in the -+ file called LICENSE. -+ -+ Contact Information: -+ James P. Ketrenos -+ Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 -+ -+******************************************************************************/ -+ -+#ifndef __ipw3945_h__ -+#define __ipw3945_h__ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+#define DRV_NAME "ipw3945" -+ -+#include "ipw3945_daemon.h" -+ -+/* Kernel compatibility defines */ -+#ifndef IRQ_NONE -+typedef void irqreturn_t; -+#define IRQ_NONE -+#define IRQ_HANDLED -+#endif -+ -+#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9) ) -+#define __iomem -+#endif -+ -+#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) ) -+#define mutex semaphore -+#define mutex_lock down -+#define mutex_unlock up -+#define mutex_init init_MUTEX -+#else -+#include -+#endif -+ -+#if !defined(CONFIG_SOFTWARE_SUSPEND2_BUILTIN) && \ -+ (defined(CONFIG_SOFTWARE_SUSPEND2) || \ -+ defined(CONFIG_SOFTWARE_SUSPEND2_MODULE)) -+#define CONFIG_SOFTWARE_SUSPEND2_BUILTIN -+#endif -+ -+#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,5) ) -+#define pci_dma_sync_single_for_cpu pci_dma_sync_single -+#endif -+ -+/* Debug and printf string expansion helpers for printing bitfields */ -+#define BIT_FMT8 "%c%c%c%c-%c%c%c%c" -+#define BIT_FMT16 BIT_FMT8 ":" BIT_FMT8 -+#define BIT_FMT32 BIT_FMT16 " " BIT_FMT16 -+ -+#define BITC(x,y) (((x>>y)&1)?'1':'0') -+#define BIT_ARG8(x) \ -+BITC(x,7),BITC(x,6),BITC(x,5),BITC(x,4),\ -+BITC(x,3),BITC(x,2),BITC(x,1),BITC(x,0) -+ -+#define BIT_ARG16(x) \ -+BITC(x,15),BITC(x,14),BITC(x,13),BITC(x,12),\ -+BITC(x,11),BITC(x,10),BITC(x,9),BITC(x,8),\ -+BIT_ARG8(x) -+ -+#define BIT_ARG32(x) \ -+BITC(x,31),BITC(x,30),BITC(x,29),BITC(x,28),\ -+BITC(x,27),BITC(x,26),BITC(x,25),BITC(x,24),\ -+BITC(x,23),BITC(x,22),BITC(x,21),BITC(x,20),\ -+BITC(x,19),BITC(x,18),BITC(x,17),BITC(x,16),\ -+BIT_ARG16(x) -+ -+#ifdef CONFIG_IPW3945_DEBUG -+#define IPW_DEBUG(level, fmt, args...) \ -+do { if (ipw_debug_level & (level)) \ -+ printk(KERN_ERR DRV_NAME": %c %s " fmt, \ -+ in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0) -+#else -+#define IPW_DEBUG(level, fmt, args...) do {} while (0) -+#endif /* CONFIG_IPW3945_DEBUG */ -+ -+/* -+ * To use the debug system; -+ * -+ * If you are defining a new debug classification, simply add it to the #define -+ * list here in the form of: -+ * -+ * #define IPW_DL_xxxx VALUE -+ * -+ * shifting value to the left one bit from the previous entry. xxxx should be -+ * the name of the classification (for example, WEP) -+ * -+ * You then need to either add a IPW_xxxx_DEBUG() macro definition for your -+ * classification, or use IPW_DEBUG(IPW_DL_xxxx, ...) whenever you want -+ * to send output to that classification. -+ * -+ * To add your debug level to the list of levels seen when you perform -+ * -+ * % cat /proc/net/ipw/debug_level -+ * -+ * you simply need to add your entry to the ipw_debug_levels array. -+ * -+ * If you do not see debug_level in /proc/net/ipw then you do not have -+ * CONFIG_IPW3945_DEBUG defined in your kernel configuration -+ * -+ */ -+ -+#define IPW_DL_INFO (1<<2) -+#define IPW_DL_WX (1<<3) -+#define IPW_DL_HOST_COMMAND (1<<5) -+#define IPW_DL_STATE (1<<6) -+ -+#define IPW_DL_RADIO (1<<7) -+#define IPW_DL_POWER (1<<8) -+ -+#define IPW_DL_NOTIF (1<<10) -+#define IPW_DL_SCAN (1<<11) -+#define IPW_DL_ASSOC (1<<12) -+#define IPW_DL_DROP (1<<13) -+ -+#define IPW_DL_DAEMON (1<<15) -+ -+#define IPW_DL_FW (1<<16) -+#define IPW_DL_RF_KILL (1<<17) -+#define IPW_DL_FW_ERRORS (1<<18) -+ -+#define IPW_DL_LED (1<<19) -+ -+#define IPW_DL_RATE (1<<20) -+ -+#define IPW_DL_FRAG (1<<21) -+#define IPW_DL_WEP (1<<22) -+#define IPW_DL_TX (1<<23) -+#define IPW_DL_RX (1<<24) -+#define IPW_DL_ISR (1<<25) -+#define IPW_DL_IO (1<<27) -+#define IPW_DL_11H (1<<28) -+ -+#define IPW_DL_STATS (1<<29) -+#define IPW_DL_MERGE (1<<30) -+#define IPW_DL_QOS (1<<31) -+ -+#define IPW_ERROR(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a) -+#define IPW_WARNING(f, a...) printk(KERN_ERR DRV_NAME ": " f, ## a) -+#define IPW_DEBUG_INFO(f, a...) IPW_DEBUG(IPW_DL_INFO, f, ## a) -+ -+#define IPW_DEBUG_WX(f, a...) IPW_DEBUG(IPW_DL_WX, f, ## a) -+#define IPW_DEBUG_SCAN(f, a...) IPW_DEBUG(IPW_DL_SCAN, f, ## a) -+#define IPW_DEBUG_RX(f, a...) IPW_DEBUG(IPW_DL_RX, f, ## a) -+#define IPW_DEBUG_TX(f, a...) IPW_DEBUG(IPW_DL_TX, f, ## a) -+#define IPW_DEBUG_ISR(f, a...) IPW_DEBUG(IPW_DL_ISR, f, ## a) -+#define IPW_DEBUG_DAEMON(f, a...) IPW_DEBUG(IPW_DL_DAEMON, f, ## a) -+#define IPW_DEBUG_LED(f, a...) IPW_DEBUG(IPW_DL_LED, f, ## a) -+#define IPW_DEBUG_WEP(f, a...) IPW_DEBUG(IPW_DL_WEP, f, ## a) -+#define IPW_DEBUG_HC(f, a...) IPW_DEBUG(IPW_DL_HOST_COMMAND, f, ## a) -+#define IPW_DEBUG_FRAG(f, a...) IPW_DEBUG(IPW_DL_FRAG, f, ## a) -+#define IPW_DEBUG_FW(f, a...) IPW_DEBUG(IPW_DL_FW, f, ## a) -+#define IPW_DEBUG_RF_KILL(f, a...) IPW_DEBUG(IPW_DL_RF_KILL, f, ## a) -+#define IPW_DEBUG_DROP(f, a...) IPW_DEBUG(IPW_DL_DROP, f, ## a) -+#define IPW_DEBUG_IO(f, a...) IPW_DEBUG(IPW_DL_IO, f, ## a) -+#define IPW_DEBUG_RATE(f, a...) IPW_DEBUG(IPW_DL_RATE, f, ## a) -+#define IPW_DEBUG_NOTIF(f, a...) IPW_DEBUG(IPW_DL_NOTIF, f, ## a) -+#define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a) -+#define IPW_DEBUG_STATS(f, a...) IPW_DEBUG(IPW_DL_STATS, f, ## a) -+#define IPW_DEBUG_MERGE(f, a...) IPW_DEBUG(IPW_DL_MERGE, f, ## a) -+#define IPW_DEBUG_QOS(f, a...) IPW_DEBUG(IPW_DL_QOS, f, ## a) -+#define IPW_DEBUG_RADIO(f, a...) IPW_DEBUG(IPW_DL_RADIO, f, ## a) -+#define IPW_DEBUG_POWER(f, a...) IPW_DEBUG(IPW_DL_POWER, f, ## a) -+#define IPW_DEBUG_11H(f, a...) IPW_DEBUG(IPW_DL_11H, f, ## a) -+ -+/* Amount of time after sending an association request before we assume -+ * the request has failed in ms (default 750ms)*/ -+#define ASSOCIATE_TIMEOUT 750 -+ -+/* microcode and hardware interface definitions */ -+ -+/* -+ * Time constants -+ */ -+#define SHORT_SLOT_TIME 9 -+#define LONG_SLOT_TIME 20 -+ -+#define OFDM_SYMBOL_TIME 4 -+ -+/* -+ * Driver API command-id -+ */ -+#define REPLY_ALIVE 0x1 -+#define REPLY_ERROR 0x2 -+ -+/* RXON state commands */ -+#define REPLY_RX_ON_ASSOC 0x11 -+#define REPLY_QOS_PARAM 0x13 -+#define REPLY_RX_ON_TIMING 0x14 -+ -+/* Multi-Station support */ -+#define REPLY_ADD_STA 0x18 -+ -+/* RX, TX */ -+#define REPLY_RX 0x1b -+#define REPLY_TX 0x1c -+ -+/* MISC commands */ -+#define REPLY_DAEMON_1 0x22 -+#define REPLY_DAEMON_2 0x23 -+#define REPLY_DAEMON_3 0x24 -+#define REPLY_DAEMON_4 0x80 -+#define REPLY_RATE_SCALE 0x47 -+#define REPLY_LEDS_CMD 0x48 -+ -+/* timers commands */ -+#define REPLY_BCON 0x27 // off -+ -+/* measurements ****/ -+#define RADAR_NOTIFICATION 0x70 -+#define CHANNEL_SWITCH_NOTIFICATION 0x73 -+ -+#define SPECTRUM_MEASURE_NOTIFICATION 0x75 -+ -+/* Power Management ****/ -+#define POWER_TABLE_CMD 0x77 -+#define PM_SLEEP_NOTIFICATION 0x7A -+#define PM_DEBUG_STATISTIC_NOTIFIC 0x7B -+ -+/* Scan commands and notifications ****/ -+#define REPLY_SCAN_ABORT_CMD 0x81 -+#define SCAN_REQUEST_NOTIFICATION 0x80 -+#define SCAN_START_NOTIFICATION 0x82 -+#define SCAN_RESULTS_NOTIFICATION 0x83 -+#define SCAN_COMPLETE_NOTIFICATION 0x84 -+ -+/* IBSS/AP commands ****/ -+#define BEACON_NOTIFICATION 0x90 -+#define REPLY_TX_BEACON 0x91 -+#define WHO_IS_AWAKE_NOTIFICATION 0x94 -+ -+#define QUIET_NOTIFICATION 0x96 -+#define MEASURE_ABORT_NOTIFICATION 0x99 -+ -+//bt config command -+#define REPLY_BT_CONFIG 0x9b -+#define REPLY_STATISTICS_CMD 0x9c -+#define STATISTICS_NOTIFICATION 0x9d -+/* RF-KILL commands and notifications ****/ -+#define REPLY_CARD_STATE_CMD 0xa0 -+#define CARD_STATE_NOTIFICATION 0xa1 -+ -+/* Missed beacons notification ****/ -+#define MISSED_BEACONS_NOTIFICATION 0xa2 -+#define MISSED_BEACONS_NOTIFICATION_TH_CMD 0xa3 -+ -+union tsf { -+ u8 byte[8]; //7:0 -+ u16 word[4]; //7:6,5:4,3:2,1:0 -+ u32 dw[2]; //7:4,3:0 -+}; -+ -+/* -+ * Alive Command & Response -+ */ -+ -+#define UCODE_VALID_OK (0x1) -+ -+struct ipw_alive_resp { -+ u8 ucode_minor; -+ u8 ucode_major; -+ u16 reserved1; -+ u8 sw_rev[8]; -+ u8 ver_type; -+ u8 ver_subtype; -+ u16 reserved2; -+ u32 log_event_table_ptr; -+ u32 error_event_table_ptr; -+ u32 timestamp; -+ u32 is_valid; -+} __attribute__ ((packed)); -+ -+/* -+ * Error Command & Response -+ */ -+ -+struct ipw_error_resp { -+ u32 enumErrorType; //7:4 -+ u8 currentCmdID; //8 -+ u8 reserved; //9 -+ u16 erroneousCmdSeqNum; //11:10 -+ u32 errorService; //15:12 -+ union tsf timestamp; //all TSF //23:16 -+} __attribute__ ((packed)); -+ -+/* -+ * Rx config defines & structure -+ */ -+/* rx_config device types */ -+enum { -+ RXON_DEV_TYPE_AP = 1, -+ RXON_DEV_TYPE_ESS = 3, -+ RXON_DEV_TYPE_IBSS = 4, -+ RXON_DEV_TYPE_SNIFFER = 6, -+}; -+ -+/* rx_config flags */ -+enum { -+ /* band & modulation selection */ -+ RXON_FLG_BAND_24G_MSK = (1 << 0), -+ RXON_FLG_CCK_MSK = (1 << 1), -+ /* auto detection enable */ -+ RXON_FLG_AUTO_DETECT_MSK = (1 << 2), -+ /* TGg protection when tx */ -+ RXON_FLG_TGG_PROTECT_MSK = (1 << 3), -+ /* cck short slot & preamble */ -+ RXON_FLG_SHORT_SLOT_MSK = (1 << 4), -+ RXON_FLG_SHORT_PREAMBLE_MSK = (1 << 5), -+ /* antenna selection */ -+ RXON_FLG_DIS_DIV_MSK = (1 << 7), -+ RXON_FLG_ANT_SEL_MSK = 0x0f00, -+ RXON_FLG_ANT_A_MSK = (1 << 8), -+ RXON_FLG_ANT_B_MSK = (1 << 9), -+ /* radar detection enable */ -+ RXON_FLG_RADAR_DETECT_MSK = (1 << 12), -+ RXON_FLG_TGJ_NARROW_BAND_MSK = (1 << 13), -+ /* rx response to host with 8-byte TSF -+ * (according to ON_AIR deassertion) */ -+ RXON_FLG_TSF2HOST_MSK = (1 << 15) -+}; -+ -+/* rx_config filter flags */ -+enum { -+ /* accept all data frames */ -+ RXON_FILTER_PROMISC_MSK = (1 << 0), -+ /* pass control & management to host */ -+ RXON_FILTER_CTL2HOST_MSK = (1 << 1), -+ /* accept multi-cast */ -+ RXON_FILTER_ACCEPT_GRP_MSK = (1 << 2), -+ /* don't decrypt uni-cast frames */ -+ RXON_FILTER_DIS_DECRYPT_MSK = (1 << 3), -+ /* don't decrypt multi-cast frames */ -+ RXON_FILTER_DIS_GRP_DECRYPT_MSK = (1 << 4), -+ /* STA is associated */ -+ RXON_FILTER_ASSOC_MSK = (1 << 5), -+ /* transfer to host non bssid beacons in associated state */ -+ RXON_FILTER_BCON_AWARE_MSK = (1 << 6) -+}; -+ -+/* -+ * RXON-ASSOCIATED Command & Response -+ */ -+struct ipw_rxon_assoc_cmd { -+ u32 flags; // 7:4 -+ u32 filter_flags; // 11:8 -+ u8 ofdm_basic_rates; // 12 -+ u8 cck_basic_rates; // 13 -+ u16 reserved; // 15:14 -+} __attribute__ ((packed)); -+ -+/* -+ * RXON-Timings Command & Response -+ */ -+struct ipw_rxon_time_cmd { -+ union tsf timestamp; // all TSF //11:4 -+ u16 beaconInterval; //13:12 -+ u16 atimWindow; //15:14 -+ u32 beaconTimerInitVal; //19:16 -+ u16 listenInterval; //21:20 -+ u16 reserved; //23:22 -+} __attribute__ ((packed)); -+ -+/* -+ * beacon QOS parameters Command & Response -+ */ -+struct ipw_ac_qos { -+ u16 dot11CWmin; // 9+(8*(N-1)):8+(8*(N-1)) -+ u16 dot11CWmax; // 11+(8*(N-1)):10+(8*(N-1)) -+ u8 dot11AIFSN; // 12+(8*(N-1)) -+ u8 reserved1; // 13+(8*(N-1)) -+ u16 edca_txop; // 15+(8*(N-1)):14+(8*(N-1)) -+} __attribute__ ((packed)); -+ -+/* -+ * TXFIFO Queue number defines -+ */ -+/* number of Access catergories (AC) (EDCA), queues 0..3 */ -+#define AC_NUM 4 -+/* total number of queues */ -+#define QUEUE_NUM 7 -+/* command queue number */ -+#define CMD_QUEUE_NUM 4 -+ -+struct ipw_qosparam_cmd { -+ u32 qos_flags; // 7:4 -+ struct ipw_ac_qos ac[AC_NUM]; // 39:8 -+} __attribute__ ((packed)); -+ -+/* -+ * Multi station support -+ */ -+#define NUM_OF_STATIONS 25 -+#define AP_ID 0 -+#define MULTICAST_ID 1 -+#define STA_ID 2 -+#define BROADCAST_ID 24 -+ -+#define STA_CONTROL_MODIFY_MSK 0x01 -+ -+/* -+ * Add/Modify Station Command & Response -+ */ -+struct ipw_keyinfo { -+ u16 key_flags; -+ u8 tkip_rx_tsc_byte2; //byte 2 TSC[2] for key mix ph1 detection -+ u8 reserved1; //byte 3 -+ u16 tkip_rx_ttak[5]; //byte 13:4 10-byte unicast TKIP TTAK -+ u16 reserved2; //byte 15:14 -+ u8 key[16]; //byte 32:16 16-byte unicast decryption key -+} __attribute__ ((packed)); -+ -+struct sta_id_modify { -+ u8 MACAddr[ETH_ALEN]; -+ u16 reserved1; -+ u8 staID; -+ u8 modify_mask; -+ u16 reserved2; -+} __attribute__ ((packed)); -+ -+struct ipw_addsta_cmd { -+ u8 ctrlAddModify; // byte 4 -+ u8 reserved[3]; // bytes 7:5 -+ struct sta_id_modify sta; // bytes 19:8 -+ struct ipw_keyinfo key; //byte 51:20 -+ u32 station_flags; //bytes 55:52 -+ u32 station_flags_msk; //bytes 59:56 -+ u16 tid_disable_tx; //bytes 61:60 -+ u8 tx_rate; //byte 62 -+ u8 reserved_1; //byte 63 -+ u8 add_immediate_ba_tid; //byte 64 -+ u8 remove_immediate_ba_tid; //byte 65 -+ u16 add_immediate_ba_start_seq; //byte 67:66 -+} __attribute__ ((packed)); -+ -+struct ipw_add_sta_resp { -+ u8 status; -+} __attribute__ ((packed)); -+ -+#define ADD_STA_SUCCESS_MSK 0x1 -+ -+/* -+ * WEP/CKIP group key command -+ */ -+struct ipw_key { -+ u8 index; -+ u8 reserved[3]; -+ u32 size; -+ u8 key[16]; -+} __attribute__ ((packed)); -+ -+struct ipw_key_cmd { -+ u8 count; -+ u8 decrypt_type; -+ u8 reserved[2]; -+ struct ipw_key key[4]; -+} __attribute__ ((packed)); -+ -+struct ipw_rx_frame_stats { -+ u8 mib_count; -+ u8 id; -+ u8 rssi; -+ u8 agc; -+ u16 sig_avg; -+ u16 noise_diff; -+ u8 payload[0]; -+} __attribute__ ((packed)); -+ -+struct ipw_rx_frame_hdr { -+ u16 channel; //5:4 -+ u16 phy_flags; //7:6 -+ u8 reserved1; //macHeaderLength; //8 -+ u8 rate; //9 -+ u16 len; //17:16 -+ u8 payload[0]; -+} __attribute__ ((packed)); -+ -+enum { -+ RX_RES_STATUS_NO_CRC32_ERROR = (1 << 0), -+ RX_RES_STATUS_NO_RXE_OVERFLOW = (1 << 1), -+}; -+ -+enum { -+ RX_RES_PHY_FLAGS_BAND_24_MSK = (1 << 0), -+ RX_RES_PHY_FLAGS_MOD_CCK_MSK = (1 << 1), -+ RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK = (1 << 2), -+ RX_RES_PHY_FLAGS_NARROW_BAND_MSK = (1 << 3), -+ RX_RES_PHY_FLAGS_ANTENNA_MSK = 0xf0, -+}; -+ -+struct ipw_rx_frame_end { -+ u32 status; //3+(N+20):0+(N+20) -+ u64 timestamp; //11+(N+20):4+(N+20) -+ u32 beaconTimeStamp; -+} __attribute__ ((packed)); -+ -+/* NOTE: DO NOT dereference from casts to this structure -+ * It is provided only for calculating minimum data set size. -+ * The actual offsets of the hdr and end are dynamic based on -+ * stats.mib_count */ -+struct ipw_rx_frame { -+ struct ipw_rx_frame_stats stats; -+ struct ipw_rx_frame_hdr hdr; -+ struct ipw_rx_frame_end end; -+} __attribute__ ((packed)); -+ -+/* -+ * Tx Command & Response -+ */ -+ -+/* Tx flags */ -+enum { -+ TX_CMD_FLG_RTS_MSK = (1 << 1), -+ TX_CMD_FLG_CTS_MSK = (1 << 2), -+ TX_CMD_FLG_ACK_MSK = (1 << 3), -+ TX_CMD_FLG_FULL_TXOP_PROT_MSK = (1 << 7), -+ TX_CMD_FLG_ANT_SEL_MSK = 0xf00, -+ TX_CMD_FLG_ANT_A_MSK = (1 << 8), -+ TX_CMD_FLG_ANT_B_MSK = (1 << 9), -+ -+ /* ucode ignores BT priority for this frame */ -+ TX_CMD_FLG_BT_DIS_MSK = (1 << 12), -+ -+ /* ucode overides sequence control */ -+ TX_CMD_FLG_SEQ_CTL_MSK = (1 << 13), -+ -+ /* signal that this frame is non-last MPDU */ -+ TX_CMD_FLG_MORE_FRAG_MSK = (1 << 14), -+ -+ /* calculate TSF in outgoing frame */ -+ TX_CMD_FLG_TSF_MSK = (1 << 16), -+ -+ /* activate TX calibration. */ -+ TX_CMD_FLG_CALIB_MSK = (1 << 17), -+ -+ /* HCCA-AP - disable duration overwriting. */ -+ TX_CMD_FLG_DUR_MSK = (1 << 25), -+}; -+ -+/* -+ * TX command security control -+ */ -+#define TX_CMD_SEC_CCM 0x2 -+#define TX_CMD_SEC_TKIP 0x3 -+ -+/* -+ * TX command Frame life time -+ */ -+ -+#define MAX_REAL_TX_QUEUE_NUM 5 -+ -+/* the number of bytes in tx_cmd_s should be 32-bit aligned as to allow -+ * fast block transfer */ -+ -+/* -+ * Tx Command & Response: -+ */ -+ -+struct ipw_tx_cmd { -+ u16 len; //byte 5:411500 -+ u16 next_frame_len; //byte 7:6 -+ u32 tx_flags; //byte 11:8 -+ u8 rate; //byte 12 -+ u8 sta_id; //byte 13 -+ u8 tid_tspec; //byte 14 -+ u8 sec_ctl; -+// u8 key_index:2,reserved:2,key_size:1,key_type:3; -+ u8 key[16]; -+ union { -+ u8 byte[8]; //7:0 -+ u16 word[4]; //7:6,5:4,3:2,1:0 -+ u32 dw[2]; //7:4,3:0 -+ } tkip_mic; /* byte 39:32 */ -+ u32 next_frame_info; //byte 43:40 -+ union { -+ u32 life_time; -+ u32 attemp_stop_time; -+ } u; -+ u8 supp_rates[2]; //byte 49:48 -+ u8 rts_retry_limit; //byte 50 -+ u8 data_retry_limit; //byte 51 -+ union { -+ u16 pm_frame_timeout; -+ u16 attemp_duration; -+ } u2; -+ u16 driver_txop; //byte 55:54 -+ u8 payload[0]; -+ struct ieee80211_hdr hdr[0]; -+} __attribute__ ((packed)); -+ -+/* -+ * TX command response status -+ */ -+struct ipw_tx_resp { -+ u8 failure_rts; -+ u8 failure_frame; -+ u8 bt_kill_count; //6 -+ u8 rate; //7 -+ u32 wireless_media_time; //11:8 -+ u32 status; //15:12 -+} __attribute__ ((packed)); -+ -+/* -+ * Scan Request Commands , Responses & Notifications -+ */ -+ -+/* Can abort will notify by complete notification with abort status. */ -+#define CAN_ABORT_STATUS 0x1 -+ -+struct ipw_scanreq_notification { -+ u32 status; -+} __attribute__ ((packed)); -+ -+struct ipw_scanstart_notification { -+ u32 tsf_low; -+ u32 tsf_high; -+ u32 beacon_timer; -+ u8 channel; -+ u8 band; -+ u8 reserved[2]; -+ u32 status; -+} __attribute__ ((packed)); -+ -+#define SCAN_OWNER_STATUS 0x1; -+#define MEASURE_OWNER_STATUS 0x2; -+ -+#define NUMBER_OF_STATISTICS 1 // first DW is good CRC -+struct ipw_scanresults_notification { -+ u8 channel; -+ u8 band; -+ u8 reserved[2]; -+ u32 tsf_low; -+ u32 tsf_high; -+ u32 statistics[NUMBER_OF_STATISTICS]; //TBD -+} __attribute__ ((packed)); -+ -+struct ipw_scancomplete_notification { -+ u8 scanned_channels; -+ u8 status; -+ u8 reserved; -+ u8 last_channel; -+ u32 tsf_low; -+ u32 tsf_high; -+} __attribute__ ((packed)); -+ -+//complete notification statuses -+#define ABORT_STATUS 0x2 // Abort status for scan finish notification -+ -+// ************************************************** -+// * Rate Scaling Command & Response -+// ************************************************** -+ -+// ***************************************** -+// * ofdm & cck rate codes -+// ***************************************** -+#define R_6M 0xd -+#define R_9M 0xf -+#define R_12M 0x5 -+#define R_18M 0x7 -+#define R_24M 0x9 -+#define R_36M 0xb -+#define R_48M 0x1 -+#define R_54M 0x3 -+ -+#define R_1M 0xa -+#define R_2M 0x14 -+#define R_5_5M 0x37 -+#define R_11M 0x6e -+ -+// OFDM rates mask values -+#define RATE_SCALE_6M_INDEX 0 -+#define RATE_SCALE_9M_INDEX 1 -+#define RATE_SCALE_12M_INDEX 2 -+#define RATE_SCALE_18M_INDEX 3 -+#define RATE_SCALE_24M_INDEX 4 -+#define RATE_SCALE_36M_INDEX 5 -+#define RATE_SCALE_48M_INDEX 6 -+#define RATE_SCALE_54M_INDEX 7 -+ -+// CCK rate mask values -+#define RATE_SCALE_1M_INDEX 8 -+#define RATE_SCALE_2M_INDEX 9 -+#define RATE_SCALE_5_5M_INDEX 10 -+#define RATE_SCALE_11M_INDEX 11 -+ -+/* OFDM rates mask values */ -+enum { -+ R_6M_MSK = (1 << 0), -+ R_9M_MSK = (1 << 1), -+ R_12M_MSK = (1 << 2), -+ R_18M_MSK = (1 << 3), -+ R_24M_MSK = (1 << 4), -+ R_36M_MSK = (1 << 5), -+ R_48M_MSK = (1 << 6), -+ R_54M_MSK = (1 << 7), -+}; -+ -+/* CCK rate mask values */ -+enum { -+ R_1M_MSK = (1 << 0), -+ R_2M_MSK = (1 << 1), -+ R_5_5M_MSK = (1 << 2), -+ R_11M_MSK = (1 << 3), -+}; -+ -+#define CCK_RATES 4 -+#define NUM_RATES 12 -+ -+struct rate_scaling_info { -+ u8 tx_rate; -+ u8 flags; -+ u8 try_cnt; -+ u8 next_rate_index; -+} __attribute__ ((packed)); -+ -+struct RateScalingCmdSpecifics { -+ u8 table_id; -+ u8 reserved[3]; -+ struct rate_scaling_info rate_scale_table[NUM_RATES]; -+} __attribute__ ((packed)); -+ -+/* -+ * LEDs Command & Response -+ */ -+struct ipw_led_cmd { -+ u32 interval; // 4 -+ u8 id; // 8 -+ u8 off; // 9 -+ u8 on; //10 -+ u8 reserved; // 11 -+} __attribute__ ((packed)); -+ -+/* -+ * card_state Command and Notification -+ */ -+ -+#define CARD_STATE_CMD_DISABLE 0x00 -+#define CARD_STATE_CMD_ENABLE 0x01 -+ -+struct ipw_card_state_notif { -+ u32 flags; -+} __attribute__ ((packed)); -+ -+#define HW_CARD_DISABLED 0x01 -+#define SW_CARD_DISABLED 0x02 -+ -+// ************************************************** -+// * TxBeacon Command & Response -+// ************************************************** -+ -+// Command Notification and Response Headers are Covered by the -+ -+// Beacon Notification -+struct BeaconNtfSpecifics { -+ struct ipw_tx_resp bconNotifHdr; //15:4 -+ u32 lowTSF; //19:16 -+ u32 highTSF; //23:20 -+ u32 ibssMgrStatus; //27:24 -+} __attribute__ ((packed)); -+ -+// TxBeacon Command -+struct ipw_tx_beacon_cmd { -+ struct ipw_tx_cmd tx;; //byte 55:4 -+ u16 tim_idx; //byte 57:56 -+ u8 tim_size; //byte 58 -+ u8 reserved1; //byte 59 -+ struct ieee80211_hdr frame[0]; -+ // Beacon Frame -+} __attribute__ ((packed)); -+ -+// TxBeacon response -+ -+/* Passed to regulatory daemon for parsing */ -+struct ipw_spectrum_notification { -+ u16 reserved1; -+ u8 reserved2; -+ u8 state; /* 0 - start, 1 - stop */ -+ u8 reserved3[96]; -+} __attribute__ ((packed)); -+ -+struct ipw_csa_notification { -+ u16 band; -+ u16 channel; -+ u32 status; // 0 - OK, 1 - fail -+} __attribute__ ((packed)); -+ -+/* -+ * Power Table Command & Response -+ * -+ * FLAGS -+ * PM allow: -+ * bit 0 - '0' Driver not allow power management -+ * '1' Driver allow PM (use rest of parameters) -+ * uCode send sleep notifications: -+ * bit 1 - '0' Don't send sleep notification -+ * '1' send sleep notification (SEND_PM_NOTIFICATION) -+ * Sleep over DTIM -+ * bit 2 - '0' PM have to walk up every DTIM -+ * '1' PM could sleep over DTIM till listen Interval. -+ * force sleep Modes -+ * bit 31/30- '00' use both mac/xtal sleeps -+ * '01' force Mac sleep -+ * '10' force xtal sleep -+ * '11' Illegal set -+ * NOTE: if SleepInterval[SLEEP_INTRVL_TABLE_SIZE-1] > DTIM period then -+ * ucode assume sleep over DTIM is allowed and we don't need to wakeup -+ * for every DTIM. -+ */ -+#define PMC_TCMD_SLEEP_INTRVL_TABLE_SIZE 5 -+ -+#define PMC_TCMD_FLAG_DRIVER_ALLOW_SLEEP_MSK 0x1 -+#define PMC_TCMD_FLAG_SLEEP_OVER_DTIM_MSK 0x4 -+ -+struct ipw_powertable_cmd { -+ u32 flags; -+ u32 RxDataTimeout; -+ u32 TxDataTimeout; -+ u32 SleepInterval[PMC_TCMD_SLEEP_INTRVL_TABLE_SIZE]; -+} __attribute__ ((packed)); -+ -+struct ipw_sleep_notification { -+ u8 pm_sleep_mode; -+ u8 pm_wakeup_src; -+ u16 reserved; -+ u32 sleep_time; -+ u32 tsf_low; -+ u32 bcon_timer; -+} __attribute__ ((packed)); -+ -+enum { -+ IPW_PM_NO_SLEEP = 0, -+ IPW_PM_SLP_MAC = 1, -+ IPW_PM_SLP_FULL_MAC_UNASSOCIATE = 2, -+ IPW_PM_SLP_FULL_MAC_CARD_STATE = 3, -+ IPW_PM_SLP_PHY = 4, -+ IPW_PM_SLP_REPENT = 5, -+ IPW_PM_WAKEUP_BY_TIMER = 6, -+ IPW_PM_WAKEUP_BY_DRIVER = 7, -+ IPW_PM_WAKEUP_BY_RFKILL = 8, -+ /* 3 reserved */ -+ IPW_PM_NUM_OF_MODES = 12, -+}; -+ -+struct ipw_bt_cmd { -+ u8 flags; -+ u8 leadTime; -+ u8 maxKill; -+ u8 reserved; -+ u32 killAckMask; -+ u32 killCTSMask; -+} __attribute__ ((packed)); -+ -+struct rx_phy_statistics { -+ u32 ina_cnt; /* number of INA signal assertions (enter RX) */ -+ u32 fina_cnt; /* number of FINA signal assertions -+ * (false_alarm = INA - FINA) */ -+ u32 plcp_err; /* number of bad PLCP header detections -+ * (PLCP_good = FINA - PLCP_bad) */ -+ u32 crc32_err; /* number of CRC32 error detections */ -+ u32 overrun_err; /* number of Overrun detections (this is due -+ * to RXE sync overrun) */ -+ u32 early_overrun_err; /* number of times RX is aborted at the -+ * begining because rxfifo is full behind -+ * threshold */ -+ u32 crc32_good; /* number of frames with good CRC */ -+ u32 false_alarm_cnt; /* number of times false alarm was -+ * detected (i.e. INA w/o FINA) */ -+ u32 fina_sync_err_cnt; /* number of times sync problem between -+ * HW & SW FINA counter was found */ -+ u32 sfd_timeout; /* number of times got SFD timeout -+ * (i.e. got FINA w/o rx_frame) */ -+ u32 fina_timeout; /* number of times got FINA timeout (i.e. got -+ * INA w/o FINA, w/o false alarm) */ -+ u32 unresponded_rts; /* un-responded RTS, due to NAV not zero */ -+ u32 rxe_frame_limit_overrun; /* RXE got frame limit overrun */ -+ u32 sent_ack_cnt; /* ACK TX count */ -+ u32 sent_cts_cnt; /* CTS TX count */ -+} __attribute__ ((packed)); -+ -+struct rx_non_phy_statistics { -+ u32 bogus_cts; /* CTS received when not expecting CTS */ -+ u32 bogus_ack; /* ACK received when not expecting ACK */ -+ u32 non_bssid_frames; /* number of frames with BSSID that doesn't -+ * belong to the STA BSSID */ -+ u32 filtered_frames; /* count frames that were dumped in the -+ * filtering process */ -+} __attribute__ ((packed)); -+ -+struct rx_statistics { -+ struct rx_phy_statistics ofdm; -+ struct rx_phy_statistics cck; -+ struct rx_non_phy_statistics general; -+} __attribute__ ((packed)); -+ -+struct tx_non_phy_statistics { -+ u32 preamble_cnt; /* number of times preamble was asserted */ -+ u32 rx_detected_cnt; /* number of times TX was delayed to RX -+ * detected */ -+ u32 bt_prio_defer_cnt; /* number of times TX was deferred due to -+ * BT priority */ -+ u32 bt_prio_kill_cnt; /* number of times TX was killed due to BT -+ * priority */ -+ u32 few_bytes_cnt; /* number of times TX was delayed due to not -+ * enough bytes in TXFIFO */ -+ u32 cts_timeout; /* timeout when waiting for CTS */ -+ u32 ack_timeout; /* timeout when waiting for ACK */ -+ u32 expected_ack_cnt; /* number of data frames that need ack or -+ * rts that need cts */ -+ u32 actual_ack_cnt; /* number of expected ack or cts that were -+ * actually received */ -+} __attribute__ ((packed)); -+ -+struct tx_statistics { -+ struct tx_non_phy_statistics general; -+} __attribute__ ((packed)); -+ -+struct debug_statistics { -+ u32 cont_burst_chk_cnt; /* number of times continuation or -+ * fragmentation or bursting was checked */ -+ u32 cont_burst_cnt; /* number of times continuation or fragmentation -+ * or bursting was successfull */ -+ u32 reserved[4]; -+} __attribute__ ((packed)); -+ -+struct general_statistics { -+ u32 temperature; -+ struct debug_statistics debug; -+ u32 usec_sleep; /**< usecs NIC was asleep. Running counter. */ -+ u32 slots_out; /**< slots NIC was out of serving channel */ -+ u32 slots_idle; /**< slots NIC was idle */ -+} __attribute__ ((packed)); -+ -+// This struct is used as a reference for the driver. -+// uCode is using global variables that are defined in -+struct statistics { -+ u32 flags; -+ struct rx_statistics rx_statistics; -+ struct tx_statistics tx_statistics; -+ struct general_statistics general_statistics; -+} __attribute__ ((packed)); -+ -+/********************************************************************* -+* These defines are for DRIVER use. -+* The defines specify the none acomulative entries in the statistics -+* If you add a none accomulative statistic entry you shuld add a -+* define and contact the drivers team for updating the parsing. -+*********************************************************************/ -+#ifndef FIELD_OFFSET -+#define FIELD_OFFSET(type, field) ((u32)&(((type *)0)->field)) -+#endif -+ -+/******************************************************************** -+* End of driver use statistics defines. -+********************************************************************/ -+ -+//if ucode consecutively missed beacons above CONSEQUTIVE_MISSED_BCONS_TH -+//then this notification will be sent. -+#define CONSEQUTIVE_MISSED_BCONS_TH 20 -+ -+/* 3945ABG register and values */ -+/* base */ -+#define CSR_BASE (0x0) -+#define HBUS_BASE (0x400) -+#define FH_BASE (0x800) -+ -+/*=== CSR ===*/ -+ -+#define CSR_HW_IF_CONFIG_REG (CSR_BASE+0x000) -+#define CSR_INT (CSR_BASE+0x008) -+#define CSR_INT_MASK (CSR_BASE+0x00c) -+#define CSR_FH_INT_STATUS (CSR_BASE+0x010) -+#define CSR_GPIO_IN (CSR_BASE+0x018) -+#define CSR_RESET (CSR_BASE+0x020) -+#define CSR_GP_CNTRL (CSR_BASE+0x024) -+/* 0x028 - reserved */ -+#define CSR_EEPROM_REG (CSR_BASE+0x02c) -+#define CSR_EEPROM_GP (CSR_BASE+0x030) -+#define CSR_UCODE_DRV_GP1 (CSR_BASE+0x054) -+#define CSR_UCODE_DRV_GP1_SET (CSR_BASE+0x058) -+#define CSR_UCODE_DRV_GP1_CLR (CSR_BASE+0x05c) -+#define CSR_UCODE_DRV_GP2 (CSR_BASE+0x060) -+#define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100) -+#define CSR_ANA_PLL_CFG (CSR_BASE+0x20c) -+ -+/* BSM */ -+#define BSM_BASE (CSR_BASE + 0x3400) -+ -+#define BSM_WR_CTRL_REG (BSM_BASE + 0x000) -+#define BSM_WR_MEM_SRC_REG (BSM_BASE + 0x004) -+#define BSM_WR_MEM_DST_REG (BSM_BASE + 0x008) -+#define BSM_WR_DWCOUNT_REG (BSM_BASE + 0x00C) -+ -+#define BSM_DRAM_INST_PTR_REG (BSM_BASE + 0x090) -+#define BSM_DRAM_INST_BYTECOUNT_REG (BSM_BASE + 0x094) -+#define BSM_DRAM_DATA_PTR_REG (BSM_BASE + 0x098) -+#define BSM_DRAM_DATA_BYTECOUNT_REG (BSM_BASE + 0x09C) -+ -+#define BSM_SRAM_LOWER_BOUND (CSR_BASE + 0x3800) -+ -+/* DBG MON */ -+ -+/* SCD */ -+#define SCD_BASE (CSR_BASE + 0x2E00) -+ -+#define SCD_MODE_REG (SCD_BASE + 0x000) -+#define SCD_ARASTAT_REG (SCD_BASE + 0x004) -+#define SCD_TXFACT_REG (SCD_BASE + 0x010) -+#define SCD_TXF4MF_REG (SCD_BASE + 0x014) -+#define SCD_TXF5MF_REG (SCD_BASE + 0x020) -+#define SCD_SBYP_MODE_1_REG (SCD_BASE + 0x02C) -+#define SCD_SBYP_MODE_2_REG (SCD_BASE + 0x030) -+ -+/*=== HBUS ===*/ -+ -+#define HBUS_TARG_MEM_RADDR (HBUS_BASE+0x00c) -+#define HBUS_TARG_MEM_WADDR (HBUS_BASE+0x010) -+#define HBUS_TARG_MEM_RDAT (HBUS_BASE+0x01c) -+#define HBUS_TARG_PRPH_WADDR (HBUS_BASE+0x044) -+#define HBUS_TARG_PRPH_RADDR (HBUS_BASE+0x048) -+#define HBUS_TARG_PRPH_WDAT (HBUS_BASE+0x04c) -+#define HBUS_TARG_PRPH_RDAT (HBUS_BASE+0x050) -+#define HBUS_TARG_WRPTR (HBUS_BASE+0x060) -+/*=== FH ===*/ -+ -+#define FH_CBCC_TABLE (FH_BASE+0x140) -+#define FH_TFDB_TABLE (FH_BASE+0x180) -+#define FH_RCSR_TABLE (FH_BASE+0x400) -+#define FH_RSSR_TABLE (FH_BASE+0x4c0) -+#define FH_TCSR_TABLE (FH_BASE+0x500) -+#define FH_TSSR_TABLE (FH_BASE+0x680) -+ -+/* TFDB */ -+#define FH_TFDB(_channel,buf) (FH_TFDB_TABLE+((_channel)*2+(buf))*0x28) -+#define ALM_FH_TFDB_CHNL_BUF_CTRL_REG(_channel) (FH_TFDB_TABLE + 0x50 * _channel) -+/* CBCC _channel is [0,2] */ -+#define FH_CBCC(_channel) (FH_CBCC_TABLE+(_channel)*0x8) -+#define FH_CBCC_CTRL(_channel) (FH_CBCC(_channel)+0x00) -+#define FH_CBCC_BASE(_channel) (FH_CBCC(_channel)+0x04) -+ -+/* RCSR _channel is [0,2] */ -+#define FH_RCSR(_channel) (FH_RCSR_TABLE+(_channel)*0x40) -+#define FH_RCSR_CONFIG(_channel) (FH_RCSR(_channel)+0x00) -+#define FH_RCSR_RBD_BASE(_channel) (FH_RCSR(_channel)+0x04) -+#define FH_RCSR_WPTR(_channel) (FH_RCSR(_channel)+0x20) -+#define FH_RCSR_RPTR_ADDR(_channel) (FH_RCSR(_channel)+0x24) -+/* RSSR */ -+#define FH_RSSR_CTRL (FH_RSSR_TABLE+0x000) -+#define FH_RSSR_STATUS (FH_RSSR_TABLE+0x004) -+/* TCSR */ -+#define FH_TCSR(_channel) (FH_TCSR_TABLE+(_channel)*0x20) -+#define FH_TCSR_CONFIG(_channel) (FH_TCSR(_channel)+0x00) -+#define FH_TCSR_CREDIT(_channel) (FH_TCSR(_channel)+0x04) -+#define FH_TCSR_BUFF_STTS(_channel) (FH_TCSR(_channel)+0x08) -+/* TSSR */ -+#define FH_TSSR_CBB_BASE (FH_TSSR_TABLE+0x000) -+#define FH_TSSR_MSG_CONFIG (FH_TSSR_TABLE+0x008) -+#define FH_TSSR_TX_STATUS (FH_TSSR_TABLE+0x010) -+/* 18 - reserved */ -+ -+/* card memory */ -+#define RTC_INST_LOWER_BOUND (0x00000) -+#define ALM_RTC_INST_UPPER_BOUND (0x14000) -+ -+#define RTC_DATA_LOWER_BOUND (0x800000) -+#define ALM_RTC_DATA_UPPER_BOUND (0x808000) -+ -+#define ALM_RTC_INST_SIZE (ALM_RTC_INST_UPPER_BOUND - RTC_INST_LOWER_BOUND) -+#define ALM_RTC_DATA_SIZE (ALM_RTC_DATA_UPPER_BOUND - RTC_DATA_LOWER_BOUND) -+ -+#define VALID_RTC_DATA_ADDR(addr) \ -+ ( ((addr) >= RTC_DATA_LOWER_BOUND) && ((addr) < ALM_RTC_DATA_UPPER_BOUND) ) -+ -+/*=== Periphery ===*/ -+ -+/* HW I/F configuration */ -+#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB (0x00000100) -+#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM (0x00000200) -+#define CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC (0x00000400) -+#define CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE (0x00000800) -+#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A (0x00000000) -+#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B (0x00001000) -+ -+#define CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP (0x00000001) -+#define CSR_UCODE_SW_BIT_RFKILL (0x00000002) -+#define CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED (0x00000004) -+ -+#define CSR_GPIO_IN_BIT_AUX_POWER (0x00000200) -+#define CSR_GPIO_IN_VAL_VAUX_PWR_SRC (0x00000000) -+#define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX (0x00800000) -+#define CSR_GPIO_IN_VAL_VMAIN_PWR_SRC CSR_GPIO_IN_BIT_AUX_POWER -+ -+#define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000) -+/* interrupt flags */ -+#define BIT_INT_RX (1<<31) -+#define BIT_INT_SWERROR (1<<25) -+#define BIT_INT_ERR (1<<29) -+#define BIT_INT_TX (1<<27) -+#define BIT_INT_WAKEUP (1<< 1) -+#define BIT_INT_ALIVE (1<<0) -+ -+#define CSR_INI_SET_MASK ( BIT_INT_RX | \ -+ BIT_INT_SWERROR | \ -+ BIT_INT_ERR | \ -+ BIT_INT_TX | \ -+ BIT_INT_ALIVE | \ -+ BIT_INT_WAKEUP ) -+ -+/* RESET */ -+#define CSR_RESET_REG_FLAG_NEVO_RESET (0x00000001) -+#define CSR_RESET_REG_FLAG_FORCE_NMI (0x00000002) -+#define CSR_RESET_REG_FLAG_SW_RESET (0x00000080) -+#define CSR_RESET_REG_FLAG_MASTER_DISABLED (0x00000100) -+#define CSR_RESET_REG_FLAG_STOP_MASTER (0x00000200) -+ -+/* GP CONTROL */ -+#define CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY (0x00000001) -+#define CSR_GP_CNTRL_REG_FLAG_INIT_DONE (0x00000004) -+#define CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ (0x00000008) -+#define CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP (0x00000010) -+ -+#define CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN (0x00000001) -+ -+#define CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE (0x07000000) -+#define CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE (0x04000000) -+ -+/* APMG constants */ -+#define APMG_CLK_CTRL_REG (0x003000) -+#define ALM_APMG_CLK_EN (0x003004) -+#define ALM_APMG_CLK_DIS (0x003008) -+#define ALM_APMG_PS_CTL (0x00300c) -+#define ALM_APMG_PCIDEV_STT (0x003010) -+#define ALM_APMG_LARC_INT (0x00301c) -+#define ALM_APMG_LARC_INT_MSK (0x003020) -+ -+#define APMG_CLK_REG_VAL_DMA_CLK_RQT (0x00000200) -+#define APMG_CLK_REG_VAL_BSM_CLK_RQT (0x00000800) -+ -+#define APMG_PS_CTRL_REG_VAL_ALM_R_RESET_REQ (0x04000000) -+ -+#define APMG_DEV_STATE_REG_VAL_L1_ACTIVE_DISABLE (0x00000800) -+ -+#define APMG_PS_CTRL_REG_MSK_POWER_SRC (0x03000000) -+#define APMG_PS_CTRL_REG_VAL_POWER_SRC_VMAIN (0x00000000) -+#define APMG_PS_CTRL_REG_VAL_POWER_SRC_VAUX (0x01000000) -+/* BSM */ -+#define BSM_WR_CTRL_REG_BIT_START_EN (0x40000000) -+ -+/* DBM */ -+ -+#define ALM_FH_SRVC_CHNL (6) -+ -+#define ALM_FH_RCSR_RX_CONFIG_REG_POS_RBDC_SIZE (20) -+#define ALM_FH_RCSR_RX_CONFIG_REG_POS_IRQ_RBTH (4) -+ -+#define ALM_FH_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN (0x08000000) -+ -+#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE (0x80000000) -+ -+#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE (0x20000000) -+ -+#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MAX_FRAG_SIZE_128 (0x01000000) -+ -+#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_IRQ_DEST_INT_HOST (0x00001000) -+ -+#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH (0x00000000) -+ -+#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF (0x00000000) -+#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_DRIVER (0x00000001) -+ -+#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL (0x00000000) -+#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL (0x00000008) -+ -+#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD (0x00200000) -+ -+#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT (0x00000000) -+ -+#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE (0x00000000) -+#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE (0x80000000) -+ -+#define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID (0x00004000) -+ -+#define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_BIT_TFDB_WPTR (0x00000001) -+ -+#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON (0xFF000000) -+#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON (0x00FF0000) -+ -+#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B (0x00000400) -+ -+#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON (0x00000100) -+#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON (0x00000080) -+ -+#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH (0x00000020) -+#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH (0x00000005) -+ -+#define ALM_TB_MAX_BYTES_COUNT (0xFFF0) -+ -+#define ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) ((1LU << _channel) << 24) -+#define ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel) ((1LU << _channel) << 16) -+ -+#define ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(_channel) (ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) | \ -+ ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel)) -+#define PCI_CFG_REV_ID_BIT_BASIC_SKU (0x40) /* bit 6 */ -+#define PCI_CFG_REV_ID_BIT_RTP (0x80) /* bit 7 */ -+ -+#define TFD_QUEUE_MIN 0 -+#define TFD_QUEUE_MAX 6 -+#define TFD_QUEUE_SIZE_MAX (256) -+ -+/* Eeprom */ -+ -+#define MSB 1 -+#define LSB 0 -+#define WORD_TO_BYTE(_word) ((_word) * sizeof(u16)) -+ -+#define EEPROM_ADDR(_wordoffset,_byteoffset) \ -+ ( WORD_TO_BYTE(_wordoffset) + (_byteoffset) ) -+ -+/* EEPROM access by BYTE */ -+ -+/* General */ -+#define EEPROM_MAC_ADDRESS (EEPROM_ADDR(0x15,LSB)) /* 6 bytes */ -+ -+#define EEPROM_BOARD_REVISION (EEPROM_ADDR(0x35,LSB)) /* 2 bytes */ -+#define EEPROM_BOARD_PBA_NUMBER (EEPROM_ADDR(0x3B,MSB)) /* 9 bytes */ -+#define EEPROM_SKU_CAP (EEPROM_ADDR(0x45,LSB)) /* 1 bytes */ -+#define EEPROM_LEDS_MODE (EEPROM_ADDR(0x45,MSB)) /* 1 bytes */ -+#define EEPROM_ALMGOR_M_VERSION (EEPROM_ADDR(0x4A,LSB)) /* 1 bytes */ -+#define EEPROM_ANTENNA_SWITCH_TYPE (EEPROM_ADDR(0x4A,MSB)) /* 1 bytes */ -+ -+/* LED definitions */ -+#define EEPROM_LEDS_TIME_INTERVAL (EEPROM_ADDR(0x48,LSB)) /* 2 bytes */ -+#define EEPROM_LEDS_ON_TIME (EEPROM_ADDR(0x49,MSB)) /* 1 bytes */ -+#define EEPROM_LEDS_OFF_TIME (EEPROM_ADDR(0x49,LSB)) /* 1 bytes */ -+ -+/* EEPROM field values */ -+ -+/* EEPROM field lengths */ -+#define EEPROM_BOARD_PBA_NUMBER_LENTGH 11 -+ -+/* SKU Capabilities */ -+#define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE (1 << 0) -+#define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE (1 << 1) -+#define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7) -+ -+/* LEDs mode */ -+ -+#define IPW_DEFAULT_TX_RETRY 15 -+#define IPW_MAX_TX_RETRY 16 -+ -+/*********************************************/ -+ -+/* Authentication and Association States */ -+enum connection_manager_assoc_states { -+ CMAS_INIT = 0, -+ CMAS_TX_AUTH_SEQ_1, -+ CMAS_RX_AUTH_SEQ_2, -+ CMAS_AUTH_SEQ_1_PASS, -+ CMAS_AUTH_SEQ_1_FAIL, -+ CMAS_TX_AUTH_SEQ_3, -+ CMAS_RX_AUTH_SEQ_4, -+ CMAS_AUTH_SEQ_2_PASS, -+ CMAS_AUTH_SEQ_2_FAIL, -+ CMAS_AUTHENTICATED, -+ CMAS_TX_ASSOC, -+ CMAS_RX_ASSOC_RESP, -+ CMAS_ASSOCIATED, -+ CMAS_LAST -+}; -+ -+#define IPW_POWER_MODE_CAM 0x00 //(always on) -+#define IPW_POWER_INDEX_3 0x03 -+#define IPW_POWER_INDEX_5 0x05 -+#define IPW_POWER_AC 0x06 -+#define IPW_POWER_BATTERY 0x07 -+#define IPW_POWER_LIMIT 0x07 -+#define IPW_POWER_MASK 0x0F -+#define IPW_POWER_ENABLED 0x10 -+#define IPW_POWER_LEVEL(x) ((x) & IPW_POWER_MASK) -+ -+#define RFD_SIZE 4 -+#define NUM_TFD_CHUNKS 4 -+ -+#define RX_QUEUE_SIZE 64 -+#define RX_QUEUE_SIZE_LOG 6 -+ -+#define IPW_A_MODE 0 -+#define IPW_B_MODE 1 -+#define IPW_G_MODE 2 -+ -+/* -+ * TX Queue Flag Definitions -+ */ -+ -+/* abort attempt if mgmt frame is rx'd */ -+ -+/* require CTS */ -+ -+/* use short preamble */ -+#define DCT_FLAG_LONG_PREAMBLE 0x00 -+#define DCT_FLAG_SHORT_PREAMBLE 0x04 -+ -+/* RTS/CTS first */ -+ -+/* dont calculate duration field */ -+ -+/* even if MAC WEP set (allows pre-encrypt) */ -+#define IPW_ -+/* overwrite TSF field */ -+ -+/* ACK rx is expected to follow */ -+#define DCT_FLAG_ACK_REQD 0x80 -+ -+#define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT 24 -+#define IPW_MB_ROAMING_THRESHOLD_DEFAULT 8 -+#define IPW_REAL_RATE_RX_PACKET_THRESHOLD 300 -+ -+/* QoS definitions */ -+ -+#define CW_MIN_OFDM 15 -+#define CW_MAX_OFDM 1023 -+#define CW_MIN_CCK 31 -+#define CW_MAX_CCK 1023 -+ -+#define QOS_TX0_CW_MIN_OFDM CW_MIN_OFDM -+#define QOS_TX1_CW_MIN_OFDM CW_MIN_OFDM -+#define QOS_TX2_CW_MIN_OFDM ( (CW_MIN_OFDM + 1) / 2 - 1 ) -+#define QOS_TX3_CW_MIN_OFDM ( (CW_MIN_OFDM + 1) / 4 - 1 ) -+ -+#define QOS_TX0_CW_MIN_CCK CW_MIN_CCK -+#define QOS_TX1_CW_MIN_CCK CW_MIN_CCK -+#define QOS_TX2_CW_MIN_CCK ( (CW_MIN_CCK + 1) / 2 - 1 ) -+#define QOS_TX3_CW_MIN_CCK ( (CW_MIN_CCK + 1) / 4 - 1 ) -+ -+#define QOS_TX0_CW_MAX_OFDM CW_MAX_OFDM -+#define QOS_TX1_CW_MAX_OFDM CW_MAX_OFDM -+#define QOS_TX2_CW_MAX_OFDM CW_MIN_OFDM -+#define QOS_TX3_CW_MAX_OFDM ( (CW_MIN_OFDM + 1) / 2 - 1 ) -+ -+#define QOS_TX0_CW_MAX_CCK CW_MAX_CCK -+#define QOS_TX1_CW_MAX_CCK CW_MAX_CCK -+#define QOS_TX2_CW_MAX_CCK CW_MIN_CCK -+#define QOS_TX3_CW_MAX_CCK ( (CW_MIN_CCK + 1) / 2 - 1 ) -+ -+#define QOS_TX0_AIFS (3) -+#define QOS_TX1_AIFS (7) -+#define QOS_TX2_AIFS (2) -+#define QOS_TX3_AIFS (2) -+ -+#define QOS_TX0_ACM 0 -+#define QOS_TX1_ACM 0 -+#define QOS_TX2_ACM 0 -+#define QOS_TX3_ACM 0 -+ -+#define QOS_TX0_TXOP_LIMIT_CCK 0 -+#define QOS_TX1_TXOP_LIMIT_CCK 0 -+#define QOS_TX2_TXOP_LIMIT_CCK 6016 -+#define QOS_TX3_TXOP_LIMIT_CCK 3264 -+ -+#define QOS_TX0_TXOP_LIMIT_OFDM 0 -+#define QOS_TX1_TXOP_LIMIT_OFDM 0 -+#define QOS_TX2_TXOP_LIMIT_OFDM 3008 -+#define QOS_TX3_TXOP_LIMIT_OFDM 1504 -+ -+#define DEF_TX0_CW_MIN_OFDM CW_MIN_OFDM -+#define DEF_TX1_CW_MIN_OFDM CW_MIN_OFDM -+#define DEF_TX2_CW_MIN_OFDM CW_MIN_OFDM -+#define DEF_TX3_CW_MIN_OFDM CW_MIN_OFDM -+ -+#define DEF_TX0_CW_MIN_CCK CW_MIN_CCK -+#define DEF_TX1_CW_MIN_CCK CW_MIN_CCK -+#define DEF_TX2_CW_MIN_CCK CW_MIN_CCK -+#define DEF_TX3_CW_MIN_CCK CW_MIN_CCK -+ -+#define DEF_TX0_CW_MAX_OFDM CW_MAX_OFDM -+#define DEF_TX1_CW_MAX_OFDM CW_MAX_OFDM -+#define DEF_TX2_CW_MAX_OFDM CW_MAX_OFDM -+#define DEF_TX3_CW_MAX_OFDM CW_MAX_OFDM -+ -+#define DEF_TX0_CW_MAX_CCK CW_MAX_CCK -+#define DEF_TX1_CW_MAX_CCK CW_MAX_CCK -+#define DEF_TX2_CW_MAX_CCK CW_MAX_CCK -+#define DEF_TX3_CW_MAX_CCK CW_MAX_CCK -+ -+#define DEF_TX0_AIFS (2) -+#define DEF_TX1_AIFS (2) -+#define DEF_TX2_AIFS (2) -+#define DEF_TX3_AIFS (2) -+ -+#define DEF_TX0_ACM 0 -+#define DEF_TX1_ACM 0 -+#define DEF_TX2_ACM 0 -+#define DEF_TX3_ACM 0 -+ -+#define DEF_TX0_TXOP_LIMIT_CCK 0 -+#define DEF_TX1_TXOP_LIMIT_CCK 0 -+#define DEF_TX2_TXOP_LIMIT_CCK 0 -+#define DEF_TX3_TXOP_LIMIT_CCK 0 -+ -+#define DEF_TX0_TXOP_LIMIT_OFDM 0 -+#define DEF_TX1_TXOP_LIMIT_OFDM 0 -+#define DEF_TX2_TXOP_LIMIT_OFDM 0 -+#define DEF_TX3_TXOP_LIMIT_OFDM 0 -+ -+#define QOS_QOS_SETS 3 -+#define QOS_PARAM_SET_ACTIVE 0 -+#define QOS_PARAM_SET_DEF_CCK 1 -+#define QOS_PARAM_SET_DEF_OFDM 2 -+ -+#define CTRL_QOS_NO_ACK (0x0020) -+#define DCT_FLAG_EXT_QOS_ENABLED (0x10) -+ -+#define IPW_TX_QUEUE_1 1 -+#define IPW_TX_QUEUE_2 2 -+#define IPW_TX_QUEUE_3 3 -+#define IPW_TX_QUEUE_4 4 -+ -+#define EEPROM_IMAGE_SIZE (0x200 * sizeof(u16)) -+#define U32_PAD(n) ((4-(n%4))%4) -+ -+#define AC_BE_TID_MASK 0x9 //TID 0 and 3 -+#define AC_BK_TID_MASK 0x6 //TID 1 and 2 -+ -+/* QoS sturctures */ -+struct ipw_qos_info { -+ int qos_enable; -+ struct ieee80211_qos_parameters *def_qos_parm_OFDM; -+ struct ieee80211_qos_parameters *def_qos_parm_CCK; -+ u32 burst_duration_CCK; -+ u32 burst_duration_OFDM; -+ u16 qos_no_ack_mask; -+ int burst_enable; -+}; -+ -+/**************************************************************/ -+/** -+ * Generic queue structure -+ * -+ * Contains common data for Rx and Tx queues -+ */ -+struct ipw_queue { -+ int n_bd; /**< number of BDs in this queue */ -+ int first_empty; /**< 1-st empty entry (index) */ -+ int last_used; /**< last used entry (index) */ -+ dma_addr_t dma_addr; /**< physical addr for BD's */ -+ int n_window; -+ u32 id; -+ int low_mark; /**< low watermark, resume queue if free space more than this */ -+ int high_mark; /**< high watermark, stop queue if free space less than this */ -+} __attribute__ ((packed)); -+ -+#define TFD_CTL_COUNT_SET(n) (n<<24) -+#define TFD_CTL_COUNT_GET(ctl) ((ctl>>24) & 7) -+#define TFD_CTL_PAD_SET(n) (n<<28) -+#define TFD_CTL_PAD_GET(ctl) (ctl>>28) -+ -+struct tfd_frame_data { -+ u32 addr; -+ u32 len; -+} __attribute__ ((packed)); -+ -+struct tfd_frame { -+ u32 control_flags; -+ struct tfd_frame_data pa[4]; -+ u8 reserved[28]; -+} __attribute__ ((packed)); -+ -+#define SEQ_TO_FIFO(x) ((x >> 8) & 0xbf) -+#define FIFO_TO_SEQ(x) ((x & 0xbf) << 8) -+#define SEQ_TO_INDEX(x) (x & 0xff) -+#define INDEX_TO_SEQ(x) (x & 0xff) -+#define SEQ_HUGE_FRAME (0x4000) -+#define SEQ_RX_FRAME (0x8000) -+ -+enum { -+ /* CMD_SIZE_NORMAL = 0, */ -+ CMD_SIZE_HUGE = (1 << 0), -+ /* CMD_DIRECT = 0, */ -+ CMD_INDIRECT = (1 << 1), -+ /* CMD_SYNC = 0, */ -+ CMD_ASYNC = (1 << 2), -+ /* CMD_NO_SKB = 0, */ -+ CMD_WANT_SKB = (1 << 3), -+ /* CMD_LOCK = 0, */ -+ CMD_NO_LOCK = (1 << 4), -+ CMD_DAEMON = (1 << 5), -+}; -+#define CMD_DAEMON_MASK (CMD_SIZE_HUGE) -+ -+struct ipw_cmd; -+struct ipw_priv; -+ -+typedef int (*IPW_CALLBACK_FUNC) (struct ipw_priv * priv, -+ struct ipw_cmd * cmd, struct sk_buff * skb); -+#define TFD_TX_CMD_SLOTS 64 -+#define TFD_CMD_SLOTS 32 -+ -+struct ipw_cmd_meta { -+ union { -+ struct ipw_cmd_meta *source; -+ struct sk_buff *skb; -+ IPW_CALLBACK_FUNC callback; -+ } __attribute__ ((packed)) u; -+ -+ u16 len; -+ -+ /* The CMD_SIZE_HUGE flag bit indicates that the command -+ * structure is stored at the end of the shared queue memory. */ -+ u8 flags; -+ -+ u8 token; -+} __attribute__ ((packed)); -+ -+struct ipw_cmd_header { -+ u8 cmd; -+ u8 flags; -+ /* We have 15 LSB to use as we please (MSB indicates -+ * a frame Rx'd from the HW). We encode the following -+ * information into the sequence field: -+ * -+ * 0:7 index in fifo -+ * 8:13 fifo selection -+ * 14:14 bit indicating if this packet references the 'extra' -+ * storage at the end of the memory queue -+ * 15:15 (Rx indication) -+ * -+ */ -+ u16 sequence; -+} __attribute__ ((packed)); -+ -+struct ipw_host_cmd { -+ u8 id; -+ u16 len; -+ struct ipw_cmd_meta meta; -+ void *data; -+}; -+ -+struct ipw_cmd { -+ struct ipw_cmd_meta meta; -+ struct ipw_cmd_header hdr; -+ union { -+ struct ipw_addsta_cmd addsta; -+ struct ipw_led_cmd led; -+ u32 flags; -+ u8 val8; -+ u16 val16; -+ u32 val32; -+ struct ipw_bt_cmd bt; -+ struct ipw_rxon_time_cmd rx_on_time; -+ struct ipw_powertable_cmd powertable; -+ struct ipw_qosparam_cmd qosparam; -+ struct ipw_tx_cmd tx; -+ struct ipw_key_cmd key; -+ struct ipw_tx_beacon_cmd tx_beacon; -+ struct ipw_rxon_assoc_cmd rxon_assoc; -+ struct RateScalingCmdSpecifics rate_scale; -+ u8 *indirect; -+ u8 payload[360]; -+ } __attribute__ ((packed)) cmd; -+} __attribute__ ((packed)); -+ -+#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct ipw_cmd) - \ -+ sizeof(struct ipw_cmd_meta)) -+ -+/** -+ * Tx Queue for DMA. Queue consists of circular buffer of -+ * BD's and required locking structures. -+ */ -+struct ipw_tx_queue { -+ struct ipw_queue q; -+ struct tfd_frame *bd; -+ struct ipw_cmd *cmd; -+ dma_addr_t dma_addr_cmd; -+ struct ieee80211_txb **txb; -+ int need_update; /* flag to indicate we need to update read/write index */ -+}; -+ -+/* -+ * RX related structures and functions -+ */ -+#define RX_FREE_BUFFERS 64 -+#define RX_LOW_WATERMARK 8 -+ -+#define SUP_RATE_11A_MAX_NUM_CHANNELS 8 -+#define SUP_RATE_11B_MAX_NUM_CHANNELS 4 -+#define SUP_RATE_11G_MAX_NUM_CHANNELS 12 -+ -+// Used for passing to driver number of successes and failures per rate -+struct rate_histogram { -+ union { -+ u32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; -+ u32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; -+ u32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; -+ } success; -+ union { -+ u32 a[SUP_RATE_11A_MAX_NUM_CHANNELS]; -+ u32 b[SUP_RATE_11B_MAX_NUM_CHANNELS]; -+ u32 g[SUP_RATE_11G_MAX_NUM_CHANNELS]; -+ } failed; -+} __attribute__ ((packed)); -+ -+/* statistics command response */ -+ -+struct statistics_rx_phy { -+ u32 ina_cnt; -+ u32 fina_cnt; -+ u32 plcp_err; -+ u32 crc32_err; -+ u32 overrun_err; -+ u32 early_overrun_err; -+ u32 crc32_good; -+ u32 false_alarm_cnt; -+ u32 fina_sync_err_cnt; -+ u32 sfd_timeout; -+ u32 fina_timeout; -+ u32 unresponded_rts; -+ u32 rxe_frame_limit_overrun; -+ u32 sent_ack_cnt; -+ u32 sent_cts_cnt; -+} __attribute__ ((packed)); -+ -+struct statistics_rx { -+ struct statistics_rx_phy ofdm; -+ struct statistics_rx_phy cck; -+ u32 bogus_cts; -+ u32 bogus_ack; -+ u32 non_bssid_frames; -+ u32 filtered_frames; -+ u32 non_channel_beacons; -+} __attribute__ ((packed)); -+ -+struct statistics_tx { -+ u32 preamble_cnt; -+ u32 rx_detected_cnt; -+ u32 bt_prio_defer_cnt; -+ u32 bt_prio_kill_cnt; -+ u32 few_bytes_cnt; -+ u32 cts_timeout; -+ u32 ack_timeout; -+ u32 expected_ack_cnt; -+ u32 actual_ack_cnt; -+} __attribute__ ((packed)); -+ -+struct statistics_dbg { -+ u32 burst_check; -+ u32 burst_count; -+ u32 reserved[4]; -+} __attribute__ ((packed)); -+ -+struct statistics_div { -+ u32 tx_on_a; -+ u32 tx_on_b; -+ u32 exec_time; -+ u32 probe_time; -+} __attribute__ ((packed)); -+ -+struct statistics_general { -+ u32 temperature; -+ struct statistics_dbg dbg; -+ u32 sleep_time; -+ u32 slots_out; -+ u32 slots_idle; -+ u32 ttl_timestamp; -+ struct statistics_div div; -+} __attribute__ ((packed)); -+ -+struct ipw_notif_statistics { -+ u32 flag; -+ struct statistics_rx rx; -+ struct statistics_tx tx; -+ struct statistics_general general; -+} __attribute__ ((packed)); -+ -+struct ipw_rx_packet { -+ u32 len; -+ struct ipw_cmd_header hdr; -+ union { -+ struct ipw_alive_resp alive_frame; -+ struct ipw_rx_frame rx_frame; -+ struct ipw_tx_resp tx_resp; -+ struct ipw_spectrum_notification spectrum_notif; -+ struct ipw_csa_notification csa_notif; -+ struct ipw_error_resp err_resp; -+ struct ipw_card_state_notif card_state_notif; -+ struct ipw_notif_statistics stats; -+ struct BeaconNtfSpecifics beacon_status; -+ struct ipw_add_sta_resp add_sta; -+ struct ipw_sleep_notification sleep_notif; -+ u32 status; -+ u8 raw[0]; -+ } u; -+} __attribute__ ((packed)); -+ -+#define IPW_RX_FRAME_SIZE (4 + sizeof(struct ipw_rx_frame)) -+ -+struct ipw_rx_mem_buffer { -+ dma_addr_t dma_addr; -+ struct sk_buff *skb; -+ struct list_head list; -+}; /* Not transferred over network, so not __attribute__ ((packed)) */ -+ -+struct ipw_rx_queue { -+ void *bd; -+ dma_addr_t dma_addr; -+ struct ipw_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; -+ struct ipw_rx_mem_buffer *queue[RX_QUEUE_SIZE]; -+ u32 processed; /* Internal index to last handled Rx packet */ -+ u32 read; /* Shared index to newest available Rx buffer */ -+ u32 write; /* Shared index to oldest written Rx packet */ -+ u32 free_count; /* Number of pre-allocated buffers in rx_free */ -+ /* Each of these lists is used as a FIFO for ipw_rx_mem_buffers */ -+ struct list_head rx_free; /* Own an SKBs */ -+ struct list_head rx_used; /* No SKB allocated */ -+ int need_update; /* flag to indicate we need to update read/write index */ -+ spinlock_t lock; -+}; /* Not transferred over network, so not __attribute__ ((packed)) */ -+ -+struct ipw_multicast_addr { -+ u8 num_of_multicast_addresses; -+ u8 reserved[3]; -+ u8 mac1[6]; -+ u8 mac2[6]; -+ u8 mac3[6]; -+ u8 mac4[6]; -+} __attribute__ ((packed)); -+ -+struct ipw_tgi_tx_key { -+ u8 key_id; -+ u8 security_type; -+ u8 station_index; -+ u8 flags; -+ u8 key[16]; -+ u32 tx_counter[2]; -+} __attribute__ ((packed)); -+ -+struct ipw_associate { -+ u8 channel; -+ u8 auth_type:4, auth_key:4; -+ u8 assoc_type; -+ u8 reserved; -+ u16 policy_support; -+ u8 preamble_length; -+ u8 ieee_mode; -+ u8 bssid[ETH_ALEN]; -+ u32 assoc_tsf_msw; -+ u32 assoc_tsf_lsw; -+ u16 capability; -+ u16 listen_interval; -+ u16 beacon_interval; -+ u8 dest[ETH_ALEN]; -+ u16 atim_window; -+ u8 smr; -+ u8 reserved1; -+ u16 reserved2; -+ u16 assoc_id; -+ u8 erp_value; -+} __attribute__ ((packed)); -+ -+#define IPW_SUPPORTED_RATES_IE_LEN 8 -+#define IPW_MAX_RATES 12 -+ -+struct ipw_supported_rates { -+ u8 ieee_mode; -+ u8 num_rates; -+ u8 purpose; -+ u8 reserved; -+ u8 supported_rates[IPW_MAX_RATES]; -+} __attribute__ ((packed)); -+ -+struct ipw_channel_tx_power { -+ u8 channel_number; -+ s8 tx_power; -+} __attribute__ ((packed)); -+ -+#define SCAN_INTERVAL 100 -+ -+#define MAX_A_CHANNELS 252 -+#define MIN_A_CHANNELS 7 -+ -+#define MAX_B_CHANNELS 14 -+#define MIN_B_CHANNELS 1 -+ -+#define STATUS_HCMD_ACTIVE (1<<0) /**< host command in progress */ -+ -+#define STATUS_INT_ENABLED (1<<1) -+#define STATUS_RF_KILL_HW (1<<2) -+#define STATUS_RF_KILL_SW (1<<3) -+#define STATUS_RF_KILL_MASK (STATUS_RF_KILL_HW | STATUS_RF_KILL_SW) -+ -+#define STATUS_INIT (1<<4) -+#define STATUS_ALIVE (1<<5) -+#define STATUS_READY (1<<6) -+#define STATUS_CALIBRATE (1<<7) -+#define STATUS_GEO_CONFIGURED (1<<8) -+#define STATUS_EXIT_PENDING (1<<9) -+#define STATUS_IN_SUSPEND (1<<10) -+ -+#define STATUS_ASSOCIATING (1<<12) -+#define STATUS_AUTH (1<<13) -+#define STATUS_ASSOCIATED (1<<14) -+#define STATUS_DISASSOCIATING (1<<15) -+ -+#define STATUS_ROAMING (1<<16) -+#define STATUS_SCANNING (1<<17) -+#define STATUS_SCAN_ABORTING (1<<19) -+#define STATUS_SCAN_PENDING (1<<20) -+#define STATUS_SCAN_HW (1<<21) -+ -+#define STATUS_DCMD_ACTIVE (1<<23) /* Sync. daemon cmd active */ -+ -+#define STATUS_POWER_PMI (1<<24) -+#define STATUS_RESTRICTED (1<<26) -+#define STATUS_FW_ERROR (1<<27) -+ -+#define STATUS_TX_MEASURE (1<<28) -+ -+#define STATUS_SECURITY_UPDATED (1<<31) /* Security sync needed */ -+ -+#define CFG_STATIC_CHANNEL (1<<0) /* Restrict assoc. to single channel */ -+#define CFG_STATIC_ESSID (1<<1) /* Restrict assoc. to single SSID */ -+#define CFG_STATIC_BSSID (1<<2) /* Restrict assoc. to single BSSID */ -+#define CFG_CUSTOM_MAC (1<<3) -+#define CFG_PREAMBLE_LONG (1<<4) -+#define CFG_ADHOC_PERSIST (1<<5) -+#define CFG_ASSOCIATE (1<<6) -+#define CFG_FIXED_RATE (1<<7) -+#define CFG_ADHOC_CREATE (1<<8) -+#define CFG_NO_LED (1<<9) -+#define CFG_BACKGROUND_SCAN (1<<10) -+#define CFG_TXPOWER_LIMIT (1<<11) -+#define CFG_NO_ROAMING (1<<12) -+ -+#define CAP_SHARED_KEY (1<<0) /* Off = OPEN */ -+#define CAP_PRIVACY_ON (1<<1) /* Off = No privacy */ -+#define CAP_RF_HW_KILL (1<<2) /* Off = no HW rf kill support */ -+#define CAP_RF_SW_KILL (1<<3) /* Off = no HW rf kill support */ -+ -+//todoG need to support adding adhoc station MAX_STATION should be 25 -+#define IPW_INVALID_STATION (0xff) -+ -+#define MAX_TID_COUNT 6 -+ -+struct ipw_tid_data { -+ u16 seq_number; -+}; -+ -+struct ipw_station_entry { -+ struct ipw_addsta_cmd sta; -+ struct ipw_tid_data tid[MAX_TID_COUNT]; -+ u8 current_rate; -+ u8 used; -+}; -+ -+struct ipw_rate_info { -+ u8 rate_plcp; -+ u8 rate_ieee; -+ s32 rate_scale_index; -+ u32 bps; /* Bits per symbol, only OFDM */ -+ u32 dur_ack; -+ u32 dur_rts; -+ u32 dur_cts; -+ u32 dur_back; -+}; -+ -+#define AVG_ENTRIES 8 -+struct average { -+ long entries[AVG_ENTRIES]; -+ long sum; -+ u8 pos; -+ u8 init; -+}; -+ -+#define IPW_LED_ACTIVITY (1<<0) -+#define IPW_LED_LINK (1<<1) -+ -+struct ipw_led { -+ u8 time_on; /* ON time in interval units - 0 == OFF */ -+ u8 time_off; /* OFF time in interval units - 0 == always ON if -+ * time_on != 0 */ -+}; -+ -+struct ipw_led_info { -+ u32 interval; /* uSec length of "interval" */ -+ struct ipw_led activity; -+ struct ipw_led link; -+ struct ipw_led tech; -+}; -+ -+struct ipw_shared_t { -+ volatile u32 tx_base_ptr[8]; -+ volatile u32 rx_read_ptr[3]; -+}; -+ -+struct fw_image_desc { -+ void *v_addr; -+ dma_addr_t p_addr; -+ u32 len; -+ u32 actual_len; -+}; -+ -+struct ipw_tpt_entry { -+ s32 min_rssi; -+ u32 no_protection_tpt; -+ u32 cts_rts_tpt; -+ u32 cts_to_self_tpt; -+ s32 rate_scale_index; -+}; -+ -+struct ipw_rate_scale_data { -+ u64 data; -+ s32 success_counter; -+ s32 success_ratio; -+ s32 counter; -+ s32 average_tpt; -+ unsigned long stamp; -+}; -+ -+struct ipw_rate_scale_mgr { -+ spinlock_t lock; -+ struct ipw_rate_scale_data window[NUM_RATES]; -+ s32 max_window_size; -+ struct RateScalingCmdSpecifics scale_rate_cmd; -+ s32 *expected_tpt; -+ u8 *next_higher_rate; -+ u8 *next_lower_rate; -+ unsigned long stamp; -+ unsigned long stamp_last; -+ u32 flush_time; -+ u32 tx_packets; -+}; -+ -+/* List of spectrum management request frames */ -+struct ipw_spectrum_list { -+ struct list_head list; -+ struct ieee80211_rx_stats stats; -+ struct ieee80211_action action[0]; -+}; -+ -+#define IPW_IBSS_MAC_HASH_SIZE 31 -+ -+struct ipw_ibss_seq { -+ u8 mac[ETH_ALEN]; -+ u16 seq_num; -+ u16 frag_num; -+ unsigned long packet_time; -+ struct list_head list; -+}; -+ -+struct ipw_daemon_cmd_list { -+ struct list_head list; -+ struct sk_buff *skb_resp; -+ struct daemon_cmd_hdr cmd; /* Must be last */ -+}; -+ -+/* Power management (not Tx power) structures */ -+ -+struct ipw_power_vec_entry { -+ struct ipw_powertable_cmd cmd; -+ u8 no_dtim; -+}; -+#define IPW_POWER_RANGE_0 (0) -+#define IPW_POWER_RANGE_1 (1) -+ -+struct ipw_power_mgr { -+ spinlock_t lock; -+ struct ipw_power_vec_entry pwr_range_0[IPW_POWER_AC]; -+ struct ipw_power_vec_entry pwr_range_1[IPW_POWER_AC]; -+ u8 active_index; -+ u32 dtim_val; -+}; -+ -+/* The LED interval is expressed in uSec and is the time -+ * unit by which all other LED command are represented -+ * -+ * A value of '1000' for makes each unit 1ms. -+ */ -+ -+#define IPW_LED_INTERVAL 1000 -+ -+#define DEFAULT_POWER_SAVE_ON LED_SOLID_ON -+#define DEFAULT_POWER_SAVE_OFF 0 -+#define DEFAULT_POWER_SAVE_INTERVAL 1000 -+ -+struct ipw_activity_blink { -+ u16 throughput; /* threshold in Mbs */ -+ u8 off; /* OFF time in interval units - 0 == always ON if -+ * time_on != 0 */ -+ u8 on; /* ON time in interval units - 0 == OFF */ -+}; -+ -+enum { -+ IPW_LED_LINK_UNINIT = 0, -+ IPW_LED_LINK_RADIOOFF, -+ IPW_LED_LINK_UNASSOCIATED, -+ IPW_LED_LINK_SCANNING, -+ IPW_LED_LINK_ASSOCIATED, -+ IPW_LED_LINK_ROAMING, -+}; -+ -+struct ipw_link_blink { -+ u16 interval; /* Number of interval units per second */ -+ u8 off; /* OFF time in interval units - 0 == always ON if -+ * time_on != 0 */ -+ u8 on; /* ON time in interval units - 0 == OFF */ -+}; -+ -+struct ipw_frame { -+ union { -+ struct ieee80211_hdr frame; -+ u8 raw[IEEE80211_FRAME_LEN]; -+ u8 cmd[360]; -+ } u; -+ struct list_head list; -+}; -+ -+#ifdef CONFIG_IPW3945_PROMISCUOUS -+enum ipw_prom_filter { -+ IPW_PROM_CTL_HEADER_ONLY = (1 << 0), -+ IPW_PROM_MGMT_HEADER_ONLY = (1 << 1), -+ IPW_PROM_DATA_HEADER_ONLY = (1 << 2), -+ IPW_PROM_ALL_HEADER_ONLY = 0xf, /* bits 0..3 */ -+ IPW_PROM_NO_TX = (1 << 4), -+ IPW_PROM_NO_RX = (1 << 5), -+ IPW_PROM_NO_CTL = (1 << 6), -+ IPW_PROM_NO_MGMT = (1 << 7), -+ IPW_PROM_NO_DATA = (1 << 8), -+}; -+ -+struct ipw_priv; -+struct ipw_prom_priv { -+ struct ipw_priv *priv; -+ struct ieee80211_device *ieee; -+ enum ipw_prom_filter filter; -+ int tx_packets; -+ int rx_packets; -+}; -+#endif -+ -+#if defined(CONFIG_IPW3945_PROMISCUOUS) || defined(CONFIG_IEEE80211_RADIOTAP) -+/* 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 -+ * -+ * When sent to us via the simulated Rx interface in sysfs, the entire -+ * structure is provided regardless of any bits unset. -+ */ -+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; -+ -+ struct iw_public_data wireless_data; -+ -+ /* temporary frame storage list */ -+ struct list_head free_frames; -+ int frames_count; -+ -+ /* spectrum measurement report caching */ -+ struct ipw_spectrum_notification measure_report; -+ -+ /* driver <-> daemon command, response, and communication queue */ -+ spinlock_t daemon_lock; -+ wait_queue_head_t wait_daemon_out_queue; -+ struct list_head daemon_in_list; -+ struct list_head daemon_out_list; -+ struct list_head daemon_free_list; -+ /* return code for synchronous driver -> daemon commands */ -+ s32 daemon_cmd_rc; -+ /* daemon driven work queue */ -+ struct work_struct daemon_cmd_work; -+ struct workqueue_struct *daemonqueue; -+ struct work_struct daemon_tx_status_sync; -+ wait_queue_head_t wait_daemon_cmd_done; -+ /* daemon cmd queue flushing indicator */ -+ u16 daemon_tx_sequence; -+ u8 daemon_tx_rate; -+ u32 daemon_tx_status; -+ unsigned long daemon_last_status; -+ int daemon_flushing; -+ -+ /* Scan related variables */ -+ u8 scan_flags; -+ unsigned long last_scan_jiffies; -+ unsigned long scan_start; -+ unsigned long scan_pass_start; -+ unsigned long scan_start_tsf; -+ int scan_passes; -+ int scan_bands_remaining; -+ int scan_bands; -+#if WIRELESS_EXT > 17 -+ int one_direct_scan; -+ u8 direct_ssid_len; -+ u8 direct_ssid[IW_ESSID_MAX_SIZE]; -+#endif -+ -+ /* spinlock */ -+ spinlock_t lock; -+ struct mutex mutex; -+ -+ /* basic pci-network driver stuff */ -+ struct pci_dev *pci_dev; -+ struct net_device *net_dev; -+ -+#ifdef CONFIG_IPW3945_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; -+ -+ struct fw_image_desc ucode_code; -+ struct fw_image_desc ucode_data; -+ struct ipw_shared_t *shared_virt; -+ dma_addr_t shared_phys; -+ struct ipw_rxon_time_cmd rxon_timing; -+ struct daemon_rx_config rxon; -+ struct ipw_alive_resp card_alive; -+ -+ /* LED related variables */ -+ struct ipw_activity_blink activity; -+ unsigned long led_packets; -+ int led_state; -+ -+ u32 rates_mask; -+ u16 active_rate; -+ u16 active_rate_basic; -+ -+ /* Rate scaling data */ -+ struct ipw_rate_scale_mgr rate_scale_mgr; -+ s8 data_retry_limit; -+ u8 retry_rate; -+ -+ wait_queue_head_t wait_command_queue; -+ -+ struct timer_list roaming_wdt; -+ struct timer_list disassociate_wdt; -+ -+ int activity_timer_active; -+ -+ /* Cached microcode data */ -+ const struct firmware *ucode_raw; -+ -+ /* Rx and Tx DMA processing queues */ -+ struct ipw_rx_queue *rxq; -+ struct ipw_tx_queue txq[6]; -+ u32 status; -+ u32 config; -+ u32 capability; -+ -+ u32 port_type; -+ u32 missed_beacon_threshold; -+ u32 roaming_threshold; -+ -+ struct ipw_power_mgr power_data; -+ -+ struct ieee80211_auth *auth_frame; -+ enum connection_manager_assoc_states auth_state; -+ -+ struct ipw_associate assoc_request; -+ struct ieee80211_network *assoc_network; -+ -+ struct ipw_notif_statistics statistics; -+ -+ /* context information */ -+ u8 essid[IW_ESSID_MAX_SIZE]; -+ u8 essid_len; -+ u8 nick[IW_ESSID_MAX_SIZE]; -+ -+ u8 channel; -+ u32 power_mode; -+ u32 antenna; -+ u8 bssid[ETH_ALEN]; -+ u16 rts_threshold; -+ u8 mac_addr[ETH_ALEN]; -+ u8 num_stations; -+ struct ipw_station_entry stations[NUM_OF_STATIONS]; -+ u8 netdev_registered; -+ int is_abg; -+ -+ u32 notif_missed_beacons; -+ -+ /* Wireless statistics */ -+ unsigned long last_rx_jiffies; -+ u32 last_beacon_time; -+ u64 last_tsf; -+ u8 last_rx_rssi; -+ u16 last_noise; -+ struct average average_missed_beacons; -+ struct average average_rssi; -+ struct average average_noise; -+ -+ /* Statistics and counters normalized with each association */ -+ u32 last_missed_beacons; -+ u32 last_tx_packets; -+ u32 last_rx_packets; -+ u32 last_tx_failures; -+ u32 last_rx_err; -+ u32 last_rate; -+ -+ u32 missed_adhoc_beacons; -+ u32 missed_beacons; -+ unsigned long rx_packets; -+ unsigned long tx_packets; -+ unsigned long long rx_bytes; -+ unsigned long long tx_bytes; -+ u32 quality; -+ -+ /* Duplicate packet detection */ -+ u16 last_seq_num; -+ u16 last_frag_num; -+ unsigned long last_packet_time; -+ struct list_head ibss_mac_hash[IPW_IBSS_MAC_HASH_SIZE]; -+ -+ /* eeprom */ -+ u8 eeprom[EEPROM_IMAGE_SIZE]; /* 1024 bytes of eeprom */ -+ -+ struct iw_statistics wstats; -+ -+ /* Driver and iwconfig driven work queue */ -+ struct workqueue_struct *workqueue; -+ -+ struct work_struct up; -+ struct work_struct down; -+ struct work_struct adhoc_check; -+ struct work_struct calibrated_work; -+ struct work_struct associate; -+ struct work_struct disassociate; -+ struct work_struct rx_replenish; -+ struct work_struct request_scan; -+ struct work_struct rf_kill; -+ struct work_struct gather_stats; -+ struct work_struct abort_scan; -+ struct work_struct roam; -+ struct work_struct scan_check; -+ struct work_struct link_up; -+ struct work_struct update_link_led; -+ struct work_struct link_down; -+ struct work_struct associate_timeout; -+ struct work_struct activity_timer; -+ struct work_struct alive_start; -+ struct work_struct resume_work; -+ struct work_struct auth_work; -+ struct work_struct merge_networks; -+ struct work_struct post_associate; -+ struct work_struct rate_scale_flush; -+ -+ /* 802.11h */ -+ struct work_struct report_work; -+ -+ struct tasklet_struct irq_tasklet; -+ -+#define IPW_DEFAULT_TX_POWER 0x0F -+ s8 user_txpower_limit; -+ s8 actual_txpower_limit; -+ s8 max_channel_txpower_limit; -+ -+#ifdef CONFIG_PM -+ u32 pm_state[16]; -+#endif -+ -+ /* Used to pass the current INTA value from ISR to Tasklet */ -+ u32 isr_inta; -+ -+#ifdef CONFIG_IPW3945_QOS -+ /* QoS */ -+ struct ipw_qos_info qos_data; -+ struct work_struct qos_activate; -+ /*********************************/ -+#endif -+ -+ /* debugging info */ -+ u32 framecnt_to_us; -+}; /*ipw_priv */ -+ -+/* debug macros */ -+ -+#include -+ -+/* -+* Register bit definitions -+*/ -+ -+/* NIC type as found in the one byte EEPROM_NIC_TYPE offset*/ -+ -+/* Defines a single bit in a by bit number (0-31) */ -+ -+/* Interrupts masks */ -+#define IPW_RX_BUF_SIZE 3000 -+enum { -+ IPW_FW_ERROR_OK = 0, -+ IPW_FW_ERROR_FAIL, -+ IPW_FW_ERROR_MEMORY_UNDERFLOW, -+ IPW_FW_ERROR_MEMORY_OVERFLOW, -+ IPW_FW_ERROR_BAD_PARAM, -+ IPW_FW_ERROR_BAD_CHECKSUM, -+ IPW_FW_ERROR_NMI_INTERRUPT, -+ IPW_FW_ERROR_BAD_DATABASE, -+ IPW_FW_ERROR_ALLOC_FAIL, -+ IPW_FW_ERROR_DMA_UNDERRUN, -+ IPW_FW_ERROR_DMA_STATUS, -+ IPW_FW_ERROR_DINO_ERROR, -+ IPW_FW_ERROR_EEPROM_ERROR, -+ IPW_FW_ERROR_SYSASSERT, -+ IPW_FW_ERROR_FATAL_ERROR -+}; -+ -+#define AUTH_OPEN 0 -+#define AUTH_SHARED_KEY 1 -+ -+#define HC_ASSOCIATE 0 -+#define HC_REASSOCIATE 1 -+#define HC_DISASSOCIATE 2 -+#define HC_IBSS_START 3 -+#define HC_DISASSOC_QUIET 5 -+ -+#define HC_QOS_SUPPORT_ASSOC 0x01 -+ -+#define IPW_RATE_CAPABILITIES 1 -+#define IPW_RATE_CONNECT 0 -+ -+/* -+ * Rate values and masks -+ */ -+#define IPW_TX_RATE_1MB 0x0A -+#define IPW_TX_RATE_2MB 0x14 -+#define IPW_TX_RATE_5MB 0x37 -+#define IPW_TX_RATE_6MB 0x0D -+#define IPW_TX_RATE_9MB 0x0F -+#define IPW_TX_RATE_11MB 0x6E -+#define IPW_TX_RATE_12MB 0x05 -+#define IPW_TX_RATE_18MB 0x07 -+#define IPW_TX_RATE_24MB 0x09 -+#define IPW_TX_RATE_36MB 0x0B -+#define IPW_TX_RATE_48MB 0x01 -+#define IPW_TX_RATE_54MB 0x03 -+ -+#define IPW_ORD_TABLE_0_MASK 0x0000F000 -+#define IPW_ORD_TABLE_1_MASK 0x0000F100 -+#define IPW_ORD_TABLE_2_MASK 0x0000F200 -+#define IPW_ORD_TABLE_3_MASK 0x0000F300 -+#define IPW_ORD_TABLE_4_MASK 0x0000F400 -+#define IPW_ORD_TABLE_5_MASK 0x0000F500 -+#define IPW_ORD_TABLE_6_MASK 0x0000F600 -+#define IPW_ORD_TABLE_7_MASK 0x0000F700 -+ -+/* -+ * Table 0 Entries (all entries are 32 bits) -+ */ -+enum { -+ IPW_ORD_STAT_TX_CURR_RATE = IPW_ORD_TABLE_0_MASK + 1, -+ IPW_ORD_STAT_FRAG_TRESHOLD, -+ IPW_ORD_STAT_RTS_THRESHOLD, -+ IPW_ORD_STAT_TX_HOST_REQUESTS, -+ IPW_ORD_STAT_TX_HOST_COMPLETE, -+ IPW_ORD_STAT_TX_DIR_DATA, -+ IPW_ORD_STAT_TX_DIR_DATA_B_1, -+ IPW_ORD_STAT_TX_DIR_DATA_B_2, -+ IPW_ORD_STAT_TX_DIR_DATA_B_5_5, -+ IPW_ORD_STAT_TX_DIR_DATA_B_11, -+ /* Hole */ -+ -+ IPW_ORD_STAT_TX_DIR_DATA_G_1 = IPW_ORD_TABLE_0_MASK + 19, -+ IPW_ORD_STAT_TX_DIR_DATA_G_2, -+ IPW_ORD_STAT_TX_DIR_DATA_G_5_5, -+ IPW_ORD_STAT_TX_DIR_DATA_G_6, -+ IPW_ORD_STAT_TX_DIR_DATA_G_9, -+ IPW_ORD_STAT_TX_DIR_DATA_G_11, -+ IPW_ORD_STAT_TX_DIR_DATA_G_12, -+ IPW_ORD_STAT_TX_DIR_DATA_G_18, -+ IPW_ORD_STAT_TX_DIR_DATA_G_24, -+ IPW_ORD_STAT_TX_DIR_DATA_G_36, -+ IPW_ORD_STAT_TX_DIR_DATA_G_48, -+ IPW_ORD_STAT_TX_DIR_DATA_G_54, -+ IPW_ORD_STAT_TX_NON_DIR_DATA, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_B_1, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_B_2, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_B_5_5, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_B_11, -+ /* Hole */ -+ -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_1 = IPW_ORD_TABLE_0_MASK + 44, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_2, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_5_5, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_6, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_9, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_11, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_12, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_18, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_24, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_36, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_48, -+ IPW_ORD_STAT_TX_NON_DIR_DATA_G_54, -+ IPW_ORD_STAT_TX_RETRY, -+ IPW_ORD_STAT_TX_FAILURE, -+ IPW_ORD_STAT_RX_ERR_CRC, -+ IPW_ORD_STAT_RX_ERR_ICV, -+ IPW_ORD_STAT_RX_NO_BUFFER, -+ IPW_ORD_STAT_FULL_SCANS, -+ IPW_ORD_STAT_PARTIAL_SCANS, -+ IPW_ORD_STAT_TGH_ABORTED_SCANS, -+ IPW_ORD_STAT_TX_TOTAL_BYTES, -+ IPW_ORD_STAT_CURR_RSSI_RAW, -+ IPW_ORD_STAT_RX_BEACON, -+ IPW_ORD_STAT_MISSED_BEACONS, -+ IPW_ORD_TABLE_0_LAST -+}; -+ -+/* Table 1 Entries -+ */ -+enum { -+ IPW_ORD_TABLE_1_LAST = IPW_ORD_TABLE_1_MASK | 1, -+}; -+ -+/* -+ * Table 2 Entries -+ * -+ * FW_VERSION: 16 byte string -+ * FW_DATE: 16 byte string (only 14 bytes used) -+ * UCODE_VERSION: 4 byte version code -+ * UCODE_DATE: 5 bytes code code -+ * ADAPTER_MAC: 6 byte MAC address -+ * RTC: 4 byte clock -+ */ -+enum { -+ IPW_ORD_STAT_FW_VERSION = IPW_ORD_TABLE_2_MASK | 1, -+ IPW_ORD_STAT_FW_DATE, -+ IPW_ORD_STAT_UCODE_VERSION, -+ IPW_ORD_STAT_UCODE_DATE, -+ IPW_ORD_STAT_ADAPTER_MAC, -+ IPW_ORD_STAT_RTC, -+ IPW_ORD_TABLE_2_LAST -+}; -+ -+/* Table 3 */ -+enum { -+ IPW_ORD_STAT_TX_PACKET = IPW_ORD_TABLE_3_MASK | 0, -+ IPW_ORD_STAT_TX_PACKET_FAILURE, -+ IPW_ORD_STAT_TX_PACKET_SUCCESS, -+ IPW_ORD_STAT_TX_PACKET_ABORTED, -+ IPW_ORD_TABLE_3_LAST -+}; -+ -+/* Table 4 */ -+enum { -+ IPW_ORD_TABLE_4_LAST = IPW_ORD_TABLE_4_MASK -+}; -+ -+/* Table 5 */ -+enum { -+ IPW_ORD_STAT_AVAILABLE_AP_COUNT = IPW_ORD_TABLE_5_MASK, -+ IPW_ORD_STAT_AP_ASSNS, -+ IPW_ORD_STAT_ROAM, -+ IPW_ORD_STAT_ROAM_CAUSE_MISSED_BEACONS, -+ IPW_ORD_STAT_ROAM_CAUSE_UNASSOC, -+ IPW_ORD_STAT_ROAM_CAUSE_RSSI, -+ IPW_ORD_STAT_ROAM_CAUSE_LINK_QUALITY, -+ IPW_ORD_STAT_ROAM_CAUSE_AP_LOAD_BALANCE, -+ IPW_ORD_STAT_ROAM_CAUSE_AP_NO_TX, -+ IPW_ORD_STAT_LINK_UP, -+ IPW_ORD_STAT_LINK_DOWN, -+ IPW_ORD_ANTENNA_DIVERSITY, -+ IPW_ORD_CURR_FREQ, -+ IPW_ORD_TABLE_5_LAST -+}; -+ -+/* Table 6 */ -+enum { -+ IPW_ORD_COUNTRY_CODE = IPW_ORD_TABLE_6_MASK, -+ IPW_ORD_CURR_BSSID, -+ IPW_ORD_CURR_SSID, -+ IPW_ORD_TABLE_6_LAST -+}; -+ -+/* Table 7 */ -+enum { -+ IPW_ORD_STAT_PERCENT_MISSED_BEACONS = IPW_ORD_TABLE_7_MASK, -+ IPW_ORD_STAT_PERCENT_TX_RETRIES, -+ IPW_ORD_STAT_PERCENT_LINK_QUALITY, -+ IPW_ORD_STAT_CURR_RSSI_DBM, -+ IPW_ORD_TABLE_7_LAST -+}; -+ -+struct ipw_fixed_rate { -+ u16 tx_rates; -+ u16 reserved; -+} __attribute__ ((packed)); -+ -+#define IPW_MIN_RSSI_VAL -100 -+#define IPW_MAX_RSSI_VAL 0 -+#define IPW_RSSI_OFFSET 95 -+#define IPW_RATE_SCALE_FLUSH (3*HZ/10) //300 milli -+#define IPW_RATE_SCALE_WIN_FLUSH (HZ/2) //500 milli -+#define IPW_RATE_SCALE_HIGH_TH 11520 -+#define IPW_RATE_SCALE_MIN_FAILURE_TH 8 -+#define IPW_RATE_SCALE_MIN_SUCCESS_TH 8 -+#define IPW_RATE_SCALE_DECREASE_TH 1920 -+ -+#endif /* __ipw3945_h__ */ -diff -Nurp linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Kconfig linux-2.6.18-gentoo-r4/drivers/net/wireless/Kconfig ---- linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Kconfig 2006-11-29 10:53:44.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/drivers/net/wireless/Kconfig 2006-11-29 11:19:22.000000000 +0100 -@@ -559,5 +559,7 @@ config NET_WIRELESS - depends on NET_RADIO && (ISA || PCI || PPC_PMAC || PCMCIA) - default y - -+source "drivers/net/wireless/Kconfig.ipw3945" -+ - endmenu - -diff -Nurp linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Kconfig.bk linux-2.6.18-gentoo-r4/drivers/net/wireless/Kconfig.bk ---- linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Kconfig.bk 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/drivers/net/wireless/Kconfig.bk 2006-11-29 11:19:22.000000000 +0100 -@@ -0,0 +1,563 @@ -+# -+# Wireless LAN device configuration -+# -+ -+menu "Wireless LAN (non-hamradio)" -+ depends on NETDEVICES -+ -+config NET_RADIO -+ bool "Wireless LAN drivers (non-hamradio) & Wireless Extensions" -+ select WIRELESS_EXT -+ ---help--- -+ Support for wireless LANs and everything having to do with radio, -+ but not with amateur radio or FM broadcasting. -+ -+ Saying Y here also enables the Wireless Extensions (creates -+ /proc/net/wireless and enables iwconfig access). The Wireless -+ Extension is a generic API allowing a driver to expose to the user -+ space configuration and statistics specific to common Wireless LANs. -+ The beauty of it is that a single set of tool can support all the -+ variations of Wireless LANs, regardless of their type (as long as -+ the driver supports Wireless Extension). Another advantage is that -+ these parameters may be changed on the fly without restarting the -+ driver (or Linux). If you wish to use Wireless Extensions with -+ wireless PCMCIA (PC-) cards, you need to say Y here; you can fetch -+ the tools from -+ . -+ -+config NET_WIRELESS_RTNETLINK -+ bool "Wireless Extension API over RtNetlink" -+ depends on NET_RADIO -+ ---help--- -+ Support the Wireless Extension API over the RtNetlink socket -+ in addition to the traditional ioctl interface (selected above). -+ -+ For now, few tools use this facility, but it might grow in the -+ future. The only downside is that it adds 4.5 kB to your kernel. -+ -+# Note : the cards are obsolete (can't buy them anymore), but the drivers -+# are not, as people are still using them... -+comment "Obsolete Wireless cards support (pre-802.11)" -+ depends on NET_RADIO && (INET || ISA || PCMCIA) -+ -+config STRIP -+ tristate "STRIP (Metricom starmode radio IP)" -+ depends on NET_RADIO && INET -+ ---help--- -+ Say Y if you have a Metricom radio and intend to use Starmode Radio -+ IP. STRIP is a radio protocol developed for the MosquitoNet project -+ (on the WWW at ) to send Internet -+ traffic using Metricom radios. Metricom radios are small, battery -+ powered, 100kbit/sec packet radio transceivers, about the size and -+ weight of a cellular telephone. (You may also have heard them called -+ "Metricom modems" but we avoid the term "modem" because it misleads -+ many people into thinking that you can plug a Metricom modem into a -+ phone line and use it as a modem.) -+ -+ You can use STRIP on any Linux machine with a serial port, although -+ it is obviously most useful for people with laptop computers. If you -+ think you might get a Metricom radio in the future, there is no harm -+ in saying Y to STRIP now, except that it makes the kernel a bit -+ bigger. -+ -+ To compile this as a module, choose M here: the module will be -+ called strip. -+ -+config ARLAN -+ tristate "Aironet Arlan 655 & IC2200 DS support" -+ depends on NET_RADIO && ISA && !64BIT -+ ---help--- -+ Aironet makes Arlan, a class of wireless LAN adapters. These use the -+ www.Telxon.com chip, which is also used on several similar cards. -+ This driver is tested on the 655 and IC2200 series cards. Look at -+ for the latest information. -+ -+ The driver is built as two modules, arlan and arlan-proc. The latter -+ is the /proc interface and is not needed most of time. -+ -+ On some computers the card ends up in non-valid state after some -+ time. Use a ping-reset script to clear it. -+ -+config WAVELAN -+ tristate "AT&T/Lucent old WaveLAN & DEC RoamAbout DS ISA support" -+ depends on NET_RADIO && ISA -+ ---help--- -+ The Lucent WaveLAN (formerly NCR and AT&T; or DEC RoamAbout DS) is -+ a Radio LAN (wireless Ethernet-like Local Area Network) using the -+ radio frequencies 900 MHz and 2.4 GHz. -+ -+ This driver support the ISA version of the WaveLAN card. A separate -+ driver for the PCMCIA (PC-card) hardware is available in David -+ Hinds' pcmcia-cs package (see the file -+ for location). -+ -+ If you want to use an ISA WaveLAN card under Linux, say Y and read -+ the Ethernet-HOWTO, available from -+ . Some more specific -+ information is contained in -+ and in the source code -+ . -+ -+ You will also need the wireless tools package available from -+ . -+ Please read the man pages contained therein. -+ -+ To compile this driver as a module, choose M here: the module will be -+ called wavelan. -+ -+config PCMCIA_WAVELAN -+ tristate "AT&T/Lucent old WaveLAN Pcmcia wireless support" -+ depends on NET_RADIO && PCMCIA -+ help -+ Say Y here if you intend to attach an AT&T/Lucent Wavelan PCMCIA -+ (PC-card) wireless Ethernet networking card to your computer. This -+ driver is for the non-IEEE-802.11 Wavelan cards. -+ -+ To compile this driver as a module, choose M here: the module will be -+ called wavelan_cs. If unsure, say N. -+ -+config PCMCIA_NETWAVE -+ tristate "Xircom Netwave AirSurfer Pcmcia wireless support" -+ depends on NET_RADIO && PCMCIA -+ help -+ Say Y here if you intend to attach this type of PCMCIA (PC-card) -+ wireless Ethernet networking card to your computer. -+ -+ To compile this driver as a module, choose M here: the module will be -+ called netwave_cs. If unsure, say N. -+ -+comment "Wireless 802.11 Frequency Hopping cards support" -+ depends on NET_RADIO && PCMCIA -+ -+config PCMCIA_RAYCS -+ tristate "Aviator/Raytheon 2.4MHz wireless support" -+ depends on NET_RADIO && PCMCIA -+ ---help--- -+ Say Y here if you intend to attach an Aviator/Raytheon PCMCIA -+ (PC-card) wireless Ethernet networking card to your computer. -+ Please read the file for -+ details. -+ -+ To compile this driver as a module, choose M here: the module will be -+ called ray_cs. If unsure, say N. -+ -+comment "Wireless 802.11b ISA/PCI cards support" -+ depends on NET_RADIO && (ISA || PCI || PPC_PMAC || PCMCIA) -+ -+config IPW2100 -+ tristate "Intel PRO/Wireless 2100 Network Connection" -+ depends on NET_RADIO && PCI -+ select FW_LOADER -+ select IEEE80211 -+ ---help--- -+ A driver for the Intel PRO/Wireless 2100 Network -+ Connection 802.11b wireless network adapter. -+ -+ See 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 -+ . Once you have the firmware image, you -+ will need to place it in /lib/firmware. -+ -+ You will also very likely need the Wireless Tools in order to -+ configure your card: -+ -+ . -+ -+ If you want to compile the driver as a module ( = code which can be -+ inserted in and removed from the running kernel whenever you want), -+ say M here and read . The module -+ will be called ipw2100.ko. -+ -+config IPW2100_MONITOR -+ bool "Enable promiscuous mode" -+ depends on IPW2100 -+ ---help--- -+ Enables promiscuous/monitor mode support for the ipw2100 driver. -+ With this feature compiled into the driver, you can switch to -+ promiscuous mode via the Wireless Tool's Monitor mode. While in this -+ mode, no packets can be sent. -+ -+config IPW2100_DEBUG -+ bool "Enable full debugging output in IPW2100 module." -+ depends on IPW2100 -+ ---help--- -+ This option will enable debug tracing output for the IPW2100. -+ -+ This will result in the kernel module being ~60k larger. You can -+ control which debug output is sent to the kernel log by setting the -+ value in -+ -+ /sys/bus/pci/drivers/ipw2100/debug_level -+ -+ This entry will only exist if this option is enabled. -+ -+ If you are not trying to debug or develop the IPW2100 driver, you -+ most likely want to say N here. -+ -+config IPW2200 -+ tristate "Intel PRO/Wireless 2200BG and 2915ABG Network Connection" -+ depends on NET_RADIO && PCI -+ select FW_LOADER -+ select IEEE80211 -+ ---help--- -+ A driver for the Intel PRO/Wireless 2200BG and 2915ABG Network -+ Connection adapters. -+ -+ See 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 -+ . See the above referenced README.ipw2200 -+ for information on where to install the firmware images. -+ -+ You will also very likely need the Wireless Tools in order to -+ configure your card: -+ -+ . -+ -+ If you want to compile the driver as a module ( = code which can be -+ inserted in and removed from the running kernel whenever you want), -+ say M here and read . The module -+ will be called ipw2200.ko. -+ -+config IPW2200_MONITOR -+ bool "Enable promiscuous mode" -+ depends on IPW2200 -+ ---help--- -+ Enables promiscuous/monitor mode support for the ipw2200 driver. -+ With this feature compiled into the driver, you can switch to -+ promiscuous mode via the Wireless Tool's Monitor mode. While in this -+ mode, no packets can be sent. -+ -+config IPW2200_RADIOTAP -+ bool "Enable radiotap format 802.11 raw packet support" -+ depends on IPW2200_MONITOR -+ -+config IPW2200_PROMISCUOUS -+ bool "Enable creation of a RF radiotap promiscuous interface" -+ depends on IPW2200_MONITOR -+ select IPW2200_RADIOTAP -+ ---help--- -+ Enables the creation of a second interface prefixed 'rtap'. -+ This second interface will provide every received in radiotap -+ format. -+ -+ 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 -+ -+config IPW2200_QOS -+ bool "Enable QoS support" -+ depends on IPW2200 && EXPERIMENTAL -+ -+config IPW2200_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 AIRO -+ tristate "Cisco/Aironet 34X/35X/4500/4800 ISA and PCI cards" -+ depends on NET_RADIO && ISA_DMA_API && (PCI || BROKEN) -+ select CRYPTO -+ ---help--- -+ This is the standard Linux driver to support Cisco/Aironet ISA and -+ PCI 802.11 wireless cards. -+ It supports the new 802.11b cards from Cisco (Cisco 34X, Cisco 35X -+ - with or without encryption) as well as card before the Cisco -+ acquisition (Aironet 4500, Aironet 4800, Aironet 4800B). -+ -+ This driver support both the standard Linux Wireless Extensions -+ and Cisco proprietary API, so both the Linux Wireless Tools and the -+ Cisco Linux utilities can be used to configure the card. -+ -+ The driver can be compiled as a module and will be named "airo". -+ -+config HERMES -+ tristate "Hermes chipset 802.11b support (Orinoco/Prism2/Symbol)" -+ depends on NET_RADIO && (PPC_PMAC || PCI || PCMCIA) -+ ---help--- -+ A driver for 802.11b wireless cards based based on the "Hermes" or -+ Intersil HFA384x (Prism 2) MAC controller. This includes the vast -+ majority of the PCMCIA 802.11b cards (which are nearly all rebadges) -+ - except for the Cisco/Aironet cards. Cards supported include the -+ Apple Airport (not a PCMCIA card), WavelanIEEE/Orinoco, -+ Cabletron/EnteraSys Roamabout, ELSA AirLancer, MELCO Buffalo, Avaya, -+ IBM High Rate Wireless, Farralon Syyline, Samsung MagicLAN, Netgear -+ MA401, LinkSys WPC-11, D-Link DWL-650, 3Com AirConnect, Intel -+ PRO/Wireless, and Symbol Spectrum24 High Rate amongst others. -+ -+ This option includes the guts of the driver, but in order to -+ actually use a card you will also need to enable support for PCMCIA -+ Hermes cards, PLX9052 based PCI adaptors or the Apple Airport below. -+ -+ You will also very likely also need the Wireless Tools in order to -+ configure your card and that /etc/pcmcia/wireless.opts works : -+ -+ -+config APPLE_AIRPORT -+ tristate "Apple Airport support (built-in)" -+ depends on PPC_PMAC && HERMES -+ help -+ Say Y here to support the Airport 802.11b wireless Ethernet hardware -+ built into the Macintosh iBook and other recent PowerPC-based -+ Macintosh machines. This is essentially a Lucent Orinoco card with -+ a non-standard interface. -+ -+ This driver does not support the Airport Extreme (802.11b/g). Use -+ the BCM43xx driver for Airport Extreme cards. -+ -+config PLX_HERMES -+ tristate "Hermes in PLX9052 based PCI adaptor support (Netgear MA301 etc.)" -+ depends on PCI && HERMES -+ help -+ Enable support for PCMCIA cards supported by the "Hermes" (aka -+ orinoco) driver when used in PLX9052 based PCI adaptors. These -+ adaptors are not a full PCMCIA controller but act as a more limited -+ PCI <-> PCMCIA bridge. Several vendors sell such adaptors so that -+ 802.11b PCMCIA cards can be used in desktop machines. The Netgear -+ MA301 is such an adaptor. -+ -+config TMD_HERMES -+ tristate "Hermes in TMD7160 based PCI adaptor support" -+ depends on PCI && HERMES -+ help -+ Enable support for PCMCIA cards supported by the "Hermes" (aka -+ orinoco) driver when used in TMD7160 based PCI adaptors. These -+ adaptors are not a full PCMCIA controller but act as a more limited -+ PCI <-> PCMCIA bridge. Several vendors sell such adaptors so that -+ 802.11b PCMCIA cards can be used in desktop machines. -+ -+config NORTEL_HERMES -+ tristate "Nortel emobility PCI adaptor support" -+ depends on PCI && HERMES -+ help -+ Enable support for PCMCIA cards supported by the "Hermes" (aka -+ orinoco) driver when used in Nortel emobility PCI adaptors. These -+ adaptors are not full PCMCIA controllers, but act as a more limited -+ PCI <-> PCMCIA bridge. -+ -+config PCI_HERMES -+ tristate "Prism 2.5 PCI 802.11b adaptor support" -+ depends on PCI && HERMES -+ help -+ Enable support for PCI and mini-PCI 802.11b wireless NICs based on -+ the Prism 2.5 chipset. These are true PCI cards, not the 802.11b -+ PCMCIA cards bundled with PCI<->PCMCIA adaptors which are also -+ common. Some of the built-in wireless adaptors in laptops are of -+ this variety. -+ -+config ATMEL -+ tristate "Atmel at76c50x chipset 802.11b support" -+ depends on NET_RADIO && (PCI || PCMCIA) -+ select FW_LOADER -+ select CRC32 -+ ---help--- -+ A driver 802.11b wireless cards based on the Atmel fast-vnet -+ chips. This driver supports standard Linux wireless extensions. -+ -+ Many cards based on this chipset do not have flash memory -+ and need their firmware loaded at start-up. If yours is -+ one of these, you will need to provide a firmware image -+ to be loaded into the card by the driver. The Atmel -+ firmware package can be downloaded from -+ -+ -+config PCI_ATMEL -+ tristate "Atmel at76c506 PCI cards" -+ depends on ATMEL && PCI -+ ---help--- -+ Enable support for PCI and mini-PCI cards containing the -+ Atmel at76c506 chip. -+ -+# If Pcmcia is compiled in, offer Pcmcia cards... -+comment "Wireless 802.11b Pcmcia/Cardbus cards support" -+ depends on NET_RADIO && PCMCIA -+ -+config PCMCIA_HERMES -+ tristate "Hermes PCMCIA card support" -+ depends on NET_RADIO && PCMCIA && HERMES -+ ---help--- -+ A driver for "Hermes" chipset based PCMCIA wireless adaptors, such -+ as the Lucent WavelanIEEE/Orinoco cards and their OEM (Cabletron/ -+ EnteraSys RoamAbout 802.11, ELSA Airlancer, Melco Buffalo and -+ others). It should also be usable on various Prism II based cards -+ such as the Linksys, D-Link and Farallon Skyline. It should also -+ work on Symbol cards such as the 3Com AirConnect and Ericsson WLAN. -+ -+ To use your PC-cards, you will need supporting software from David -+ Hinds' pcmcia-cs package (see the file -+ for location). You also want to check out the PCMCIA-HOWTO, -+ available from . -+ -+ You will also very likely also need the Wireless Tools in order to -+ configure your card and that /etc/pcmcia/wireless.opts works: -+ . -+ -+config PCMCIA_SPECTRUM -+ tristate "Symbol Spectrum24 Trilogy PCMCIA card support" -+ depends on NET_RADIO && PCMCIA && HERMES -+ select FW_LOADER -+ ---help--- -+ -+ This is a driver for 802.11b cards using RAM-loadable Symbol -+ firmware, such as Symbol Wireless Networker LA4100, CompactFlash -+ cards by Socket Communications and Intel PRO/Wireless 2011B. -+ -+ This driver requires firmware download on startup. Utilities -+ for downloading Symbol firmware are available at -+ -+ -+config AIRO_CS -+ tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards" -+ depends on NET_RADIO && PCMCIA && (BROKEN || !M32R) -+ select CRYPTO -+ select CRYPTO_AES -+ ---help--- -+ This is the standard Linux driver to support Cisco/Aironet PCMCIA -+ 802.11 wireless cards. This driver is the same as the Aironet -+ driver part of the Linux Pcmcia package. -+ It supports the new 802.11b cards from Cisco (Cisco 34X, Cisco 35X -+ - with or without encryption) as well as card before the Cisco -+ acquisition (Aironet 4500, Aironet 4800, Aironet 4800B). It also -+ supports OEM of Cisco such as the DELL TrueMobile 4800 and Xircom -+ 802.11b cards. -+ -+ This driver support both the standard Linux Wireless Extensions -+ and Cisco proprietary API, so both the Linux Wireless Tools and the -+ Cisco Linux utilities can be used to configure the card. -+ -+ To use your PC-cards, you will need supporting software from David -+ Hinds' pcmcia-cs package (see the file -+ for location). You also want to check out the PCMCIA-HOWTO, -+ available from . -+ -+config PCMCIA_ATMEL -+ tristate "Atmel at76c502/at76c504 PCMCIA cards" -+ depends on NET_RADIO && ATMEL && PCMCIA -+ select FW_LOADER -+ select CRC32 -+ ---help--- -+ Enable support for PCMCIA cards containing the -+ Atmel at76c502 and at76c504 chips. -+ -+config PCMCIA_WL3501 -+ tristate "Planet WL3501 PCMCIA cards" -+ depends on NET_RADIO && EXPERIMENTAL && PCMCIA -+ ---help--- -+ A driver for WL3501 PCMCIA 802.11 wireless cards made by Planet. -+ It has basic support for Linux wireless extensions and initial -+ micro support for ethtool. -+ -+comment "Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support" -+ depends on NET_RADIO && PCI -+config PRISM54 -+ tristate 'Intersil Prism GT/Duette/Indigo PCI/Cardbus' -+ depends on PCI && NET_RADIO && EXPERIMENTAL -+ select FW_LOADER -+ ---help--- -+ Enable PCI and Cardbus support for the following chipset based cards: -+ -+ ISL3880 - Prism GT 802.11 b/g -+ ISL3877 - Prism Indigo 802.11 a -+ ISL3890 - Prism Duette 802.11 a/b/g -+ -+ For a complete list of supported cards visit . -+ Here is the latest confirmed list of supported cards: -+ -+ 3com OfficeConnect 11g Cardbus Card aka 3CRWE154G72 (version 1) -+ Allnet ALL0271 PCI Card -+ Compex WL54G Cardbus Card -+ Corega CG-WLCB54GT Cardbus Card -+ D-Link Air Plus Xtreme G A1 Cardbus Card aka DWL-g650 -+ I-O Data WN-G54/CB Cardbus Card -+ Kobishi XG-300 aka Z-Com Cardbus Card -+ Netgear WG511 Cardbus Card -+ Ovislink WL-5400PCI PCI Card -+ Peabird WLG-PCI PCI Card -+ Sitecom WL-100i Cardbus Card -+ Sitecom WL-110i PCI Card -+ SMC2802W - EZ Connect g 2.4GHz 54 Mbps Wireless PCI Card -+ SMC2835W - EZ Connect g 2.4GHz 54 Mbps Wireless Cardbus Card -+ SMC2835W-V2 - EZ Connect g 2.4GHz 54 Mbps Wireless Cardbus Card -+ Z-Com XG-900 PCI Card -+ Zyxel G-100 Cardbus Card -+ -+ If you enable this you will need a firmware file as well. -+ You will need to copy this to /usr/lib/hotplug/firmware/isl3890. -+ You can get this non-GPL'd firmware file from the Prism54 project page: -+ -+ You will also need the /etc/hotplug/firmware.agent script from -+ a current hotplug package. -+ -+ Note: You need a motherboard with DMA support to use any of these cards -+ -+ If you want to compile the driver as a module ( = code which can be -+ inserted in and removed from the running kernel whenever you want), -+ say M here and read . The module -+ will be called prism54.ko. -+ -+config USB_ZD1201 -+ tristate "USB ZD1201 based Wireless device support" -+ depends on USB && NET_RADIO -+ select FW_LOADER -+ ---help--- -+ Say Y if you want to use wireless LAN adapters based on the ZyDAS -+ ZD1201 chip. -+ -+ This driver makes the adapter appear as a normal Ethernet interface, -+ typically on wlan0. -+ -+ The zd1201 device requires external firmware to be loaded. -+ This can be found at http://linux-lc100020.sourceforge.net/ -+ -+ To compile this driver as a module, choose M here: the -+ module will be called zd1201. -+ -+source "drivers/net/wireless/hostap/Kconfig" -+source "drivers/net/wireless/bcm43xx/Kconfig" -+source "drivers/net/wireless/zd1211rw/Kconfig" -+ -+# yes, this works even when no drivers are selected -+config NET_WIRELESS -+ bool -+ depends on NET_RADIO && (ISA || PCI || PPC_PMAC || PCMCIA) -+ default y -+ -+endmenu -+ -diff -Nurp linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Kconfig.ipw3945 linux-2.6.18-gentoo-r4/drivers/net/wireless/Kconfig.ipw3945 ---- linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Kconfig.ipw3945 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/drivers/net/wireless/Kconfig.ipw3945 2006-11-29 11:19:22.000000000 +0100 -@@ -0,0 +1,105 @@ -+config IPW3945 -+ tristate "Intel PRO/Wireless 3945ABG Network Connection" -+ depends on IEEE80211 && PCI && NET_RADIO -+ select FW_LOADER -+ ---help--- -+ A driver for the Intel PRO/Wireless 3945ABG Network -+ Connection adapter. -+ -+ See 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 -+ . See the above referenced README.ipw3945 -+ for information on where to install the firmare images. -+ -+ You will also very likely need the Wireless Tools in order to -+ configure your card: -+ -+ . -+ -+ 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 . The module -+ will be called ipw3945.ko. -+ -+config IPW3945_DEBUG -+ bool "Enable full debugging output in IPW3945 module." -+ depends on IPW3945 -+ default n -+ ---help--- -+ This option will enable debug tracing output for the IPW3945. -+ -+ 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/ipw3945/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 0x43fff > /sys/bus/pci/drivers/ipw3945/debug_level -+ -+ You can find the list of debug mask values in -+ drivers/net/wireless/ipw3945.h -+ -+ If you are not trying to debug or develop the IPW3945 driver, you -+ most likely want to say N here. -+ -+config IPW3945_MONITOR -+ bool "Enable RF monitor module." -+ depends on IPW3945 -+ default n -+ ---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 IPW3945_PROMISCUOUS -+ bool "Enable creation of a RF radiotap promiscuous interface." -+ depends on IPW3945 -+ select IEEE80211_RADIOTAP -+ default n -+ ---help--- -+ Enables the creation of a second interface (prefixed 'rtap'). -+ This second interface will provide every 802.11 frame received -+ on the current channel in a radiotap header format. -+ -+ This is useful for performing wireless network analysis while -+ maintaining an active association. -+ -+ Example usage: -+ -+ % modprobe ipw3945 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/ipw3945/*/rtap_iface -+ -+if CONFIG_EXPERIMENTAL -+config IPW3945_SIM_RX -+ bool "Enable simulating reception of 802.11 frames." -+ depends on IPW3945 -+ select IEEE80211_RADIOTAP -+ default n -+ ---help--- -+ Enables simulation of 802.11 frame reception by creating a sysfs -+ entry 'rx'. Writing an 802.11 frame in radiotap format will -+ result in that frame being passed to the driver as if it had -+ been received via the radio. -+ -+ This is useful for testing code paths and simulating capabilities -+ not enabled by your access point. -+ -+ To facilitate the creation of these frames, you can use the sim_rx -+ package available at http://ipw3945.sf.net. -+endif -diff -Nurp linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Makefile linux-2.6.18-gentoo-r4/drivers/net/wireless/Makefile ---- linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Makefile 2006-11-29 10:53:44.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/drivers/net/wireless/Makefile 2006-11-29 11:19:22.000000000 +0100 -@@ -43,3 +43,5 @@ obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o - obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o - - obj-$(CONFIG_USB_ZD1201) += zd1201.o -+obj-$(CONFIG_IPW3945) += ipw3945.o -+EXTRA_CFLAGS += -DIPW3945_COMPAT=2 -diff -Nurp linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Makefile.bk linux-2.6.18-gentoo-r4/drivers/net/wireless/Makefile.bk ---- linux-2.6.18-gentoo-r4.orig/drivers/net/wireless/Makefile.bk 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/drivers/net/wireless/Makefile.bk 2006-11-29 11:19:22.000000000 +0100 -@@ -0,0 +1,45 @@ -+# -+# Makefile for the Linux Wireless network device drivers. -+# -+ -+obj-$(CONFIG_IPW2100) += ipw2100.o -+ -+obj-$(CONFIG_IPW2200) += ipw2200.o -+ -+obj-$(CONFIG_STRIP) += strip.o -+obj-$(CONFIG_ARLAN) += arlan.o -+ -+arlan-objs := arlan-main.o arlan-proc.o -+ -+# Obsolete cards -+obj-$(CONFIG_WAVELAN) += wavelan.o -+obj-$(CONFIG_PCMCIA_NETWAVE) += netwave_cs.o -+obj-$(CONFIG_PCMCIA_WAVELAN) += wavelan_cs.o -+ -+obj-$(CONFIG_HERMES) += orinoco.o hermes.o -+obj-$(CONFIG_PCMCIA_HERMES) += orinoco_cs.o -+obj-$(CONFIG_APPLE_AIRPORT) += airport.o -+obj-$(CONFIG_PLX_HERMES) += orinoco_plx.o -+obj-$(CONFIG_PCI_HERMES) += orinoco_pci.o -+obj-$(CONFIG_TMD_HERMES) += orinoco_tmd.o -+obj-$(CONFIG_NORTEL_HERMES) += orinoco_nortel.o -+obj-$(CONFIG_PCMCIA_SPECTRUM) += spectrum_cs.o -+ -+obj-$(CONFIG_AIRO) += airo.o -+obj-$(CONFIG_AIRO_CS) += airo_cs.o airo.o -+ -+obj-$(CONFIG_ATMEL) += atmel.o -+obj-$(CONFIG_PCI_ATMEL) += atmel_pci.o -+obj-$(CONFIG_PCMCIA_ATMEL) += atmel_cs.o -+ -+obj-$(CONFIG_PRISM54) += prism54/ -+ -+obj-$(CONFIG_HOSTAP) += hostap/ -+obj-$(CONFIG_BCM43XX) += bcm43xx/ -+obj-$(CONFIG_ZD1211RW) += zd1211rw/ -+ -+# 16-bit wireless PCMCIA client drivers -+obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o -+obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o -+ -+obj-$(CONFIG_USB_ZD1201) += zd1201.o -diff -Nurp linux-2.6.18-gentoo-r4.orig/include/linux/autoconf.h linux-2.6.18-gentoo-r4/include/linux/autoconf.h ---- linux-2.6.18-gentoo-r4.orig/include/linux/autoconf.h 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/include/linux/autoconf.h 2006-11-29 11:19:22.000000000 +0100 -@@ -0,0 +1,8 @@ -+#ifndef _LINUX_CONFIG_H -+#define _LINUX_CONFIG_H -+/* This file is no longer in use and kept only for backward compatibility. -+ * autoconf.h is now included via -imacros on the commandline -+ */ -+#include -+ -+#endif -diff -Nurp linux-2.6.18-gentoo-r4.orig/include/linux/autoconf.h.bk linux-2.6.18-gentoo-r4/include/linux/autoconf.h.bk ---- linux-2.6.18-gentoo-r4.orig/include/linux/autoconf.h.bk 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/include/linux/autoconf.h.bk 2006-11-29 11:19:22.000000000 +0100 -@@ -0,0 +1,8 @@ -+#ifndef _LINUX_CONFIG_H -+#define _LINUX_CONFIG_H -+/* This file is no longer in use and kept only for backward compatibility. -+ * autoconf.h is now included via -imacros on the commandline -+ */ -+#include -+ -+#endif -diff -Nurp linux-2.6.18-gentoo-r4.orig/net/ieee80211/Kconfig linux-2.6.18-gentoo-r4/net/ieee80211/Kconfig ---- linux-2.6.18-gentoo-r4.orig/net/ieee80211/Kconfig 2006-11-29 10:53:44.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/net/ieee80211/Kconfig 2006-11-29 11:17:32.000000000 +0100 -@@ -68,3 +68,16 @@ config IEEE80211_CRYPT_TKIP - "ieee80211_crypt_tkip". - - source "net/ieee80211/softmac/Kconfig" -+config IEEE80211_RADIOTAP -+ bool "Enable RAIODTAP headers for capibilities that can support it." -+ depends on IEEE80211 -+ ---help--- -+ This option will enable the use of RADIOTAP headers for any -+ driver functionality that supports it. This is frequently used -+ when exporting raw 802.11 frames to user space, for example in -+ monitor and parasite modes. -+ -+ NOTE: For most user space monitoring tools (ethereal, etc.) -+ you must have a version of libpcap that supports radiotap header -+ formats. -+ -diff -Nurp linux-2.6.18-gentoo-r4.orig/net/ieee80211/Kconfig.bk linux-2.6.18-gentoo-r4/net/ieee80211/Kconfig.bk ---- linux-2.6.18-gentoo-r4.orig/net/ieee80211/Kconfig.bk 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.18-gentoo-r4/net/ieee80211/Kconfig.bk 2006-11-29 11:17:32.000000000 +0100 -@@ -0,0 +1,70 @@ -+config IEEE80211 -+ tristate "Generic IEEE 802.11 Networking Stack" -+ ---help--- -+ This option enables the hardware independent IEEE 802.11 -+ networking stack. -+ -+config IEEE80211_DEBUG -+ bool "Enable full debugging output" -+ depends on IEEE80211 -+ ---help--- -+ This option will enable debug tracing output for the -+ ieee80211 network stack. -+ -+ This will result in the kernel module being ~70k larger. You -+ can control which debug output is sent to the kernel log by -+ setting the value in -+ -+ /proc/net/ieee80211/debug_level -+ -+ For example: -+ -+ % echo 0x00000FFO > /proc/net/ieee80211/debug_level -+ -+ For a list of values you can assign to debug_level, you -+ can look at the bit mask values in -+ -+ If you are not trying to debug or develop the ieee80211 -+ subsystem, you most likely want to say N here. -+ -+config IEEE80211_CRYPT_WEP -+ tristate "IEEE 802.11 WEP encryption (802.1x)" -+ depends on IEEE80211 -+ select CRYPTO -+ select CRYPTO_ARC4 -+ select CRC32 -+ ---help--- -+ Include software based cipher suites in support of IEEE -+ 802.11's WEP. This is needed for WEP as well as 802.1x. -+ -+ This can be compiled as a modules and it will be called -+ "ieee80211_crypt_wep". -+ -+config IEEE80211_CRYPT_CCMP -+ tristate "IEEE 802.11i CCMP support" -+ depends on IEEE80211 -+ select CRYPTO -+ select CRYPTO_AES -+ ---help--- -+ Include software based cipher suites in support of IEEE 802.11i -+ (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with CCMP enabled -+ networks. -+ -+ This can be compiled as a modules and it will be called -+ "ieee80211_crypt_ccmp". -+ -+config IEEE80211_CRYPT_TKIP -+ tristate "IEEE 802.11i TKIP encryption" -+ depends on IEEE80211 && NET_RADIO -+ select CRYPTO -+ select CRYPTO_MICHAEL_MIC -+ select CRC32 -+ ---help--- -+ Include software based cipher suites in support of IEEE 802.11i -+ (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with TKIP enabled -+ networks. -+ -+ This can be compiled as a modules and it will be called -+ "ieee80211_crypt_tkip". -+ -+source "net/ieee80211/softmac/Kconfig" diff --git a/sys-kernel/gentoo-sources/files/patch-2.6.18.2-3 b/sys-kernel/gentoo-sources/files/patch-2.6.18.2-3 deleted file mode 100644 index 1f0bacf84..000000000 --- a/sys-kernel/gentoo-sources/files/patch-2.6.18.2-3 +++ /dev/null @@ -1,834 +0,0 @@ -diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c -index e6ea00e..ec0c5c2 100644 ---- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c -+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c -@@ -560,7 +560,6 @@ static struct cpufreq_driver acpi_cpufre - .name = "acpi-cpufreq", - .owner = THIS_MODULE, - .attr = acpi_cpufreq_attr, -- .flags = CPUFREQ_STICKY, - }; - - -@@ -571,7 +570,7 @@ acpi_cpufreq_init (void) - - acpi_cpufreq_early_init_acpi(); - -- return cpufreq_register_driver(&acpi_cpufreq_driver); -+ return cpufreq_register_driver(&acpi_cpufreq_driver); - } - - -diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c -index 4a8995c..65a2ce8 100644 ---- a/arch/i386/pci/irq.c -+++ b/arch/i386/pci/irq.c -@@ -255,13 +255,13 @@ static int pirq_via_set(struct pci_dev * - */ - static int pirq_via586_get(struct pci_dev *router, struct pci_dev *dev, int pirq) - { -- static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; -+ static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 }; - return read_config_nybble(router, 0x55, pirqmap[pirq-1]); - } - - static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) - { -- static const unsigned int pirqmap[4] = { 3, 2, 5, 1 }; -+ static const unsigned int pirqmap[5] = { 3, 2, 5, 1, 1 }; - write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); - return 1; - } -diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c -index 9b352bd..20780f8 100644 ---- a/arch/powerpc/kernel/traps.c -+++ b/arch/powerpc/kernel/traps.c -@@ -818,7 +818,7 @@ #endif /* CONFIG_MATH_EMULATION */ - - void alignment_exception(struct pt_regs *regs) - { -- int fixed = 0; -+ int sig, code, fixed = 0; - - /* we don't implement logging of alignment exceptions */ - if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS)) -@@ -832,14 +832,16 @@ void alignment_exception(struct pt_regs - - /* Operand address was bad */ - if (fixed == -EFAULT) { -- if (user_mode(regs)) -- _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar); -- else -- /* Search exception table */ -- bad_page_fault(regs, regs->dar, SIGSEGV); -- return; -+ sig = SIGSEGV; -+ code = SEGV_ACCERR; -+ } else { -+ sig = SIGBUS; -+ code = BUS_ADRALN; - } -- _exception(SIGBUS, regs, BUS_ADRALN, regs->dar); -+ if (user_mode(regs)) -+ _exception(sig, regs, code, regs->dar); -+ else -+ bad_page_fault(regs, regs->dar, sig); - } - - void StackOverflow(struct pt_regs *regs) -diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c -index d7a4330..0193cc4 100644 ---- a/arch/ppc/kernel/traps.c -+++ b/arch/ppc/kernel/traps.c -@@ -708,7 +708,7 @@ void single_step_exception(struct pt_reg - - void alignment_exception(struct pt_regs *regs) - { -- int fixed; -+ int sig, code, fixed = 0; - - fixed = fix_alignment(regs); - if (fixed == 1) { -@@ -717,14 +717,16 @@ void alignment_exception(struct pt_regs - return; - } - if (fixed == -EFAULT) { -- /* fixed == -EFAULT means the operand address was bad */ -- if (user_mode(regs)) -- _exception(SIGSEGV, regs, SEGV_ACCERR, regs->dar); -- else -- bad_page_fault(regs, regs->dar, SIGSEGV); -- return; -+ sig = SIGSEGV; -+ code = SEGV_ACCERR; -+ } else { -+ sig = SIGBUS; -+ code = BUS_ADRALN; - } -- _exception(SIGBUS, regs, BUS_ADRALN, regs->dar); -+ if (user_mode(regs)) -+ _exception(sig, regs, code, regs->dar); -+ else -+ bad_page_fault(regs, regs->dar, sig); - } - - void StackOverflow(struct pt_regs *regs) -diff --git a/arch/s390/lib/uaccess.S b/arch/s390/lib/uaccess.S -index 3f5511d..90443e7 100644 ---- a/arch/s390/lib/uaccess.S -+++ b/arch/s390/lib/uaccess.S -@@ -41,15 +41,15 @@ __copy_from_user_asm: - 5: mvcp 0(%r5,%r2),0(%r4),%r0 - slr %r3,%r5 - alr %r2,%r5 --6: lgr %r5,%r3 # copy remaining size -+6: lr %r5,%r3 # copy remaining size - ahi %r5,-1 # subtract 1 for xc loop - bras %r4,8f -- xc 0(1,%2),0(%2) --7: xc 0(256,%2),0(%2) -+ xc 0(1,%r2),0(%r2) -+7: xc 0(256,%r2),0(%r2) - la %r2,256(%r2) --8: ahji %r5,-256 -+8: ahi %r5,-256 - jnm 7b -- ex %r5,0(%r2) -+ ex %r5,0(%r4) - 9: lr %r2,%r3 - br %r14 - .section __ex_table,"a" -diff --git a/arch/s390/lib/uaccess64.S b/arch/s390/lib/uaccess64.S -index 9376df0..2d42c7e 100644 ---- a/arch/s390/lib/uaccess64.S -+++ b/arch/s390/lib/uaccess64.S -@@ -49,7 +49,7 @@ __copy_from_user_asm: - la %r2,256(%r2) - 8: aghi %r5,-256 - jnm 7b -- ex %r5,0(%r2) -+ ex %r5,0(%r4) - 9: lgr %r2,%r3 - br %r14 - .section __ex_table,"a" -diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S -index a4edff4..831f540 100644 ---- a/arch/sparc/kernel/entry.S -+++ b/arch/sparc/kernel/entry.S -@@ -32,13 +32,12 @@ #include - #include - #include - #include -+#include - - #include - - #define curptr g6 - --#define NR_SYSCALLS 300 /* Each OS is different... */ -- - /* These are just handy. */ - #define _SV save %sp, -STACKFRAME_SZ, %sp - #define _RS restore -diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S -index 0aaa35f..6f28bec 100644 ---- a/arch/sparc64/kernel/entry.S -+++ b/arch/sparc64/kernel/entry.S -@@ -22,11 +22,10 @@ #include - #include - #include - #include -+#include - - #define curptr g6 - --#define NR_SYSCALLS 300 /* Each OS is different... */ -- - .text - .align 32 - -diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c -index bb6745d..f127e23 100644 ---- a/arch/x86_64/kernel/process.c -+++ b/arch/x86_64/kernel/process.c -@@ -571,6 +571,9 @@ __switch_to(struct task_struct *prev_p, - prev->gsindex = gsindex; - } - -+ /* Must be after DS reload */ -+ unlazy_fpu(prev_p); -+ - /* - * Switch the PDA and FPU contexts. - */ -@@ -578,10 +581,6 @@ __switch_to(struct task_struct *prev_p, - write_pda(oldrsp, next->userrsp); - write_pda(pcurrent, next_p); - -- /* This must be here to ensure both math_state_restore() and -- kernel_fpu_begin() work consistently. -- And the AMD workaround requires it to be after DS reload. */ -- unlazy_fpu(prev_p); - write_pda(kernelstack, - task_stack_page(next_p) + THREAD_SIZE - PDA_STACKOFFSET); - -diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c -index b33eda2..ed3d3ae 100644 ---- a/block/scsi_ioctl.c -+++ b/block/scsi_ioctl.c -@@ -246,10 +246,10 @@ static int sg_io(struct file *file, requ - switch (hdr->dxfer_direction) { - default: - return -EINVAL; -- case SG_DXFER_TO_FROM_DEV: - case SG_DXFER_TO_DEV: - writing = 1; - break; -+ case SG_DXFER_TO_FROM_DEV: - case SG_DXFER_FROM_DEV: - break; - } -diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c -index 2cd3391..455c318 100644 ---- a/drivers/block/cciss.c -+++ b/drivers/block/cciss.c -@@ -1302,6 +1302,12 @@ static void cciss_softirq_done(struct re - - complete_buffers(rq->bio, rq->errors); - -+ if (blk_fs_request(rq)) { -+ const int rw = rq_data_dir(rq); -+ -+ disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors); -+ } -+ - #ifdef CCISS_DEBUG - printk("Done with %p\n", rq); - #endif /* CCISS_DEBUG */ -diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c -index 78082ed..5ee5f93 100644 ---- a/drivers/block/cpqarray.c -+++ b/drivers/block/cpqarray.c -@@ -1000,6 +1000,7 @@ static inline void complete_buffers(stru - */ - static inline void complete_command(cmdlist_t *cmd, int timeout) - { -+ struct request *rq = cmd->rq; - int ok=1; - int i, ddir; - -@@ -1031,12 +1032,18 @@ static inline void complete_command(cmdl - pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, - cmd->req.sg[i].size, ddir); - -- complete_buffers(cmd->rq->bio, ok); -+ complete_buffers(rq->bio, ok); - -- add_disk_randomness(cmd->rq->rq_disk); -+ if (blk_fs_request(rq)) { -+ const int rw = rq_data_dir(rq); - -- DBGPX(printk("Done with %p\n", cmd->rq);); -- end_that_request_last(cmd->rq, ok ? 1 : -EIO); -+ disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors); -+ } -+ -+ add_disk_randomness(rq->rq_disk); -+ -+ DBGPX(printk("Done with %p\n", rq);); -+ end_that_request_last(rq, ok ? 1 : -EIO); - } - - /* -diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c -index abca98b..5292258 100644 ---- a/drivers/char/ipmi/ipmi_si_intf.c -+++ b/drivers/char/ipmi/ipmi_si_intf.c -@@ -1845,7 +1845,7 @@ #endif - - static struct pci_device_id ipmi_pci_devices[] = { - { PCI_DEVICE(PCI_HP_VENDOR_ID, PCI_MMC_DEVICE_ID) }, -- { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE) } -+ { PCI_DEVICE_CLASS(PCI_ERMC_CLASSCODE, PCI_ERMC_CLASSCODE_MASK) } - }; - MODULE_DEVICE_TABLE(pci, ipmi_pci_devices); - -diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c -index 913be23..d4f6361 100644 ---- a/drivers/char/isicom.c -+++ b/drivers/char/isicom.c -@@ -1062,11 +1062,12 @@ static void isicom_shutdown_port(struct - static void isicom_close(struct tty_struct *tty, struct file *filp) - { - struct isi_port *port = tty->driver_data; -- struct isi_board *card = port->card; -+ struct isi_board *card; - unsigned long flags; - - if (!port) - return; -+ card = port->card; - if (isicom_paranoia_check(port, tty->name, "isicom_close")) - return; - -diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c -index 343afa3..07b0604 100644 ---- a/drivers/input/mouse/psmouse-base.c -+++ b/drivers/input/mouse/psmouse-base.c -@@ -1332,20 +1332,22 @@ ssize_t psmouse_attr_set_helper(struct d - - static ssize_t psmouse_show_int_attr(struct psmouse *psmouse, void *offset, char *buf) - { -- unsigned long *field = (unsigned long *)((char *)psmouse + (size_t)offset); -+ unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset); - -- return sprintf(buf, "%lu\n", *field); -+ return sprintf(buf, "%u\n", *field); - } - - static ssize_t psmouse_set_int_attr(struct psmouse *psmouse, void *offset, const char *buf, size_t count) - { -- unsigned long *field = (unsigned long *)((char *)psmouse + (size_t)offset); -+ unsigned int *field = (unsigned int *)((char *)psmouse + (size_t)offset); - unsigned long value; - char *rest; - - value = simple_strtoul(buf, &rest, 10); - if (*rest) - return -EINVAL; -+ if ((unsigned int)value != value) -+ return -EINVAL; - - *field = value; - -diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c -index 98ef9f8..aefcba7 100644 ---- a/drivers/net/e1000/e1000_main.c -+++ b/drivers/net/e1000/e1000_main.c -@@ -4683,6 +4683,9 @@ #endif - if (adapter->hw.phy_type == e1000_phy_igp_3) - e1000_phy_powerdown_workaround(&adapter->hw); - -+ if (netif_running(netdev)) -+ e1000_free_irq(adapter); -+ - /* Release control of h/w to f/w. If f/w is AMT enabled, this - * would have already happened in close and is redundant. */ - e1000_release_hw_control(adapter); -@@ -4710,6 +4713,10 @@ e1000_resume(struct pci_dev *pdev) - pci_enable_wake(pdev, PCI_D3hot, 0); - pci_enable_wake(pdev, PCI_D3cold, 0); - -+ if (netif_running(netdev) && (ret_val = e1000_request_irq(adapter))) -+ return ret_val; -+ -+ e1000_power_up_phy(adapter); - e1000_reset(adapter); - E1000_WRITE_REG(&adapter->hw, WUS, ~0); - -diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c -index fdefa7d..a9c7d41 100644 ---- a/drivers/pci/pci-sysfs.c -+++ b/drivers/pci/pci-sysfs.c -@@ -571,6 +571,9 @@ int pci_create_sysfs_dev_files (struct p - */ - void pci_remove_sysfs_dev_files(struct pci_dev *pdev) - { -+ if (!sysfs_initialized) -+ return; -+ - if (pdev->cfg_size < 4096) - sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr); - else -diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c -index 48dee4b..acc7cd8 100644 ---- a/drivers/usb/class/usblp.c -+++ b/drivers/usb/class/usblp.c -@@ -701,6 +701,7 @@ static ssize_t usblp_write(struct file * - usblp->wcomplete = 0; - err = usb_submit_urb(usblp->writeurb, GFP_KERNEL); - if (err) { -+ usblp->wcomplete = 1; - if (err != -ENOMEM) - count = -EIO; - else -diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c -index a2c56b2..19aaf56 100644 ---- a/drivers/usb/input/hid-core.c -+++ b/drivers/usb/input/hid-core.c -@@ -1734,10 +1734,10 @@ static const struct hid_blacklist { - { USB_VENDOR_ID_APPLE, 0x020E, HID_QUIRK_POWERBOOK_HAS_FN }, - { USB_VENDOR_ID_APPLE, 0x020F, HID_QUIRK_POWERBOOK_HAS_FN }, - { USB_VENDOR_ID_APPLE, 0x0214, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN }, -+ { USB_VENDOR_ID_APPLE, 0x0215, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, - { USB_VENDOR_ID_APPLE, 0x0216, HID_QUIRK_POWERBOOK_HAS_FN }, - { USB_VENDOR_ID_APPLE, 0x0217, HID_QUIRK_POWERBOOK_HAS_FN }, -- { USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN }, -+ { USB_VENDOR_ID_APPLE, 0x0218, HID_QUIRK_POWERBOOK_HAS_FN | HID_QUIRK_POWERBOOK_ISO_KEYBOARD}, - { USB_VENDOR_ID_APPLE, 0x0219, HID_QUIRK_POWERBOOK_HAS_FN }, - { USB_VENDOR_ID_APPLE, 0x030A, HID_QUIRK_POWERBOOK_HAS_FN }, - { USB_VENDOR_ID_APPLE, 0x030B, HID_QUIRK_POWERBOOK_HAS_FN }, -diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c -index 7208839..2ae4fb9 100644 ---- a/drivers/usb/input/hid-input.c -+++ b/drivers/usb/input/hid-input.c -@@ -123,6 +123,12 @@ static struct hidinput_key_translation p - { } - }; - -+static struct hidinput_key_translation powerbook_iso_keyboard[] = { -+ { KEY_GRAVE, KEY_102ND }, -+ { KEY_102ND, KEY_GRAVE }, -+ { } -+}; -+ - static int usbhid_pb_fnmode = 1; - module_param_named(pb_fnmode, usbhid_pb_fnmode, int, 0644); - MODULE_PARM_DESC(pb_fnmode, -@@ -197,6 +203,14 @@ static int hidinput_pb_event(struct hid_ - } - } - -+ if (hid->quirks & HID_QUIRK_POWERBOOK_ISO_KEYBOARD) { -+ trans = find_translation(powerbook_iso_keyboard, usage->code); -+ if (trans) { -+ input_event(input, usage->type, trans->to, value); -+ return 1; -+ } -+ } -+ - return 0; - } - -@@ -212,6 +226,9 @@ static void hidinput_pb_setup(struct inp - - for (trans = powerbook_numlock_keys; trans->from; trans++) - set_bit(trans->to, input->keybit); -+ -+ for (trans = powerbook_iso_keyboard; trans->from; trans++) -+ set_bit(trans->to, input->keybit); - } - #else - static inline int hidinput_pb_event(struct hid_device *hid, struct input_dev *input, -diff --git a/drivers/usb/input/hid.h b/drivers/usb/input/hid.h -index 778e575..aa85d0b 100644 ---- a/drivers/usb/input/hid.h -+++ b/drivers/usb/input/hid.h -@@ -260,6 +260,7 @@ #define HID_QUIRK_CYMOTION 0x00000800 - #define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 - #define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 - #define HID_QUIRK_INVERT_HWHEEL 0x00004000 -+#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00010000 - - /* - * This is the global environment of the parser. This information is -diff --git a/drivers/usb/input/usbtouchscreen.c b/drivers/usb/input/usbtouchscreen.c -index a338bf4..0f3adc4 100644 ---- a/drivers/usb/input/usbtouchscreen.c -+++ b/drivers/usb/input/usbtouchscreen.c -@@ -522,7 +522,7 @@ static int usbtouch_probe(struct usb_int - type->max_press, 0, 0); - - usb_fill_int_urb(usbtouch->irq, usbtouch->udev, -- usb_rcvintpipe(usbtouch->udev, 0x81), -+ usb_rcvintpipe(usbtouch->udev, endpoint->bEndpointAddress), - usbtouch->data, type->rept_size, - usbtouch_irq, usbtouch, endpoint->bInterval); - -diff --git a/drivers/video/nvidia/nv_hw.c b/drivers/video/nvidia/nv_hw.c -index 9ed640d..ea42611 100644 ---- a/drivers/video/nvidia/nv_hw.c -+++ b/drivers/video/nvidia/nv_hw.c -@@ -145,12 +145,18 @@ static void nvGetClocks(struct nvidia_pa - - if (par->Architecture >= NV_ARCH_40) { - pll = NV_RD32(par->PMC, 0x4020); -- P = (pll >> 16) & 0x03; -+ P = (pll >> 16) & 0x07; - pll = NV_RD32(par->PMC, 0x4024); - M = pll & 0xFF; - N = (pll >> 8) & 0xFF; -- MB = (pll >> 16) & 0xFF; -- NB = (pll >> 24) & 0xFF; -+ if (((par->Chipset & 0xfff0) == 0x0290) || -+ ((par->Chipset & 0xfff0) == 0x0390)) { -+ MB = 1; -+ NB = 1; -+ } else { -+ MB = (pll >> 16) & 0xFF; -+ NB = (pll >> 24) & 0xFF; -+ } - *MClk = ((N * NB * par->CrystalFreqKHz) / (M * MB)) >> P; - - pll = NV_RD32(par->PMC, 0x4000); -diff --git a/drivers/video/nvidia/nv_setup.c b/drivers/video/nvidia/nv_setup.c -index a18a9ae..61dc46f 100644 ---- a/drivers/video/nvidia/nv_setup.c -+++ b/drivers/video/nvidia/nv_setup.c -@@ -359,6 +359,7 @@ int NVCommonSetup(struct fb_info *info) - case 0x0186: - case 0x0187: - case 0x018D: -+ case 0x0228: - case 0x0286: - case 0x028C: - case 0x0316: -@@ -382,6 +383,10 @@ int NVCommonSetup(struct fb_info *info) - case 0x034C: - case 0x0160: - case 0x0166: -+ case 0x0169: -+ case 0x016B: -+ case 0x016C: -+ case 0x016D: - case 0x00C8: - case 0x00CC: - case 0x0144: -@@ -639,12 +644,23 @@ int NVCommonSetup(struct fb_info *info) - par->fpHeight = NV_RD32(par->PRAMDAC, 0x0800) + 1; - par->fpSyncs = NV_RD32(par->PRAMDAC, 0x0848) & 0x30000033; - -- printk("Panel size is %i x %i\n", par->fpWidth, par->fpHeight); -+ printk("nvidiafb: Panel size is %i x %i\n", par->fpWidth, par->fpHeight); - } - - if (monA) - info->monspecs = *monA; - -+ if (!par->FlatPanel || !par->twoHeads) -+ par->FPDither = 0; -+ -+ par->LVDS = 0; -+ if (par->FlatPanel && par->twoHeads) { -+ NV_WR32(par->PRAMDAC0, 0x08B0, 0x00010004); -+ if (par->PRAMDAC0[0x08b4] & 1) -+ par->LVDS = 1; -+ printk("nvidiafb: Panel is %s\n", par->LVDS ? "LVDS" : "TMDS"); -+ } -+ - kfree(edidA); - kfree(edidB); - done: -diff --git a/drivers/video/nvidia/nv_type.h b/drivers/video/nvidia/nv_type.h -index acdc266..86e65de 100644 ---- a/drivers/video/nvidia/nv_type.h -+++ b/drivers/video/nvidia/nv_type.h -@@ -129,6 +129,7 @@ struct nvidia_par { - int fpHeight; - int PanelTweak; - int paneltweak; -+ int LVDS; - int pm_state; - u32 crtcSync_read; - u32 fpSyncs; -diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c -index d4f8501..2a961f8 100644 ---- a/drivers/video/nvidia/nvidia.c -+++ b/drivers/video/nvidia/nvidia.c -@@ -1145,20 +1145,20 @@ static u32 __devinit nvidia_get_arch(str - case 0x0340: /* GeForceFX 5700 */ - arch = NV_ARCH_30; - break; -- case 0x0040: -- case 0x00C0: -- case 0x0120: -+ case 0x0040: /* GeForce 6800 */ -+ case 0x00C0: /* GeForce 6800 */ -+ case 0x0120: /* GeForce 6800 */ - case 0x0130: -- case 0x0140: -- case 0x0160: -- case 0x01D0: -- case 0x0090: -- case 0x0210: -- case 0x0220: -+ case 0x0140: /* GeForce 6600 */ -+ case 0x0160: /* GeForce 6200 */ -+ case 0x01D0: /* GeForce 7200, 7300, 7400 */ -+ case 0x0090: /* GeForce 7800 */ -+ case 0x0210: /* GeForce 6800 */ -+ case 0x0220: /* GeForce 6200 */ - case 0x0230: -- case 0x0240: -- case 0x0290: -- case 0x0390: -+ case 0x0240: /* GeForce 6100 */ -+ case 0x0290: /* GeForce 7900 */ -+ case 0x0390: /* GeForce 7600 */ - arch = NV_ARCH_40; - break; - case 0x0020: /* TNT, TNT2 */ -diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES -index 0feb3bd..77a2fbb 100644 ---- a/fs/cifs/CHANGES -+++ b/fs/cifs/CHANGES -@@ -6,7 +6,11 @@ on requests on other threads. Improve P - (lock cancel now works, and unlock of merged range works even - to Windows servers now). Fix oops on mount to lanman servers - (win9x, os/2 etc.) when null password. Do not send listxattr --(SMB to query all EAs) if nouser_xattr specified. -+(SMB to query all EAs) if nouser_xattr specified. Return error -+in rename 2nd attempt retry (ie report if rename by handle also -+fails, after rename by path fails, we were not reporting whether -+the retry worked or not). -+ - - Version 1.44 - ------------ -diff --git a/fs/cifs/file.c b/fs/cifs/file.c -index e9c5ba9..ddb012a 100644 ---- a/fs/cifs/file.c -+++ b/fs/cifs/file.c -@@ -752,6 +752,7 @@ int cifs_lock(struct file *file, int cmd - int stored_rc = 0; - struct cifsLockInfo *li, *tmp; - -+ rc = 0; - down(&fid->lock_sem); - list_for_each_entry_safe(li, tmp, &fid->llist, llist) { - if (pfLock->fl_start <= li->offset && -@@ -766,7 +767,7 @@ int cifs_lock(struct file *file, int cmd - kfree(li); - } - } -- up(&fid->lock_sem); -+ up(&fid->lock_sem); - } - } - -diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c -index b88147c..c76ac38 100644 ---- a/fs/cifs/inode.c -+++ b/fs/cifs/inode.c -@@ -880,10 +880,14 @@ int cifs_rename(struct inode *source_ino - kmalloc(2 * sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); - if (info_buf_source != NULL) { - info_buf_target = info_buf_source + 1; -- rc = CIFSSMBUnixQPathInfo(xid, pTcon, fromName, -- info_buf_source, cifs_sb_source->local_nls, -- cifs_sb_source->mnt_cifs_flags & -- CIFS_MOUNT_MAP_SPECIAL_CHR); -+ if (pTcon->ses->capabilities & CAP_UNIX) -+ rc = CIFSSMBUnixQPathInfo(xid, pTcon, fromName, -+ info_buf_source, -+ cifs_sb_source->local_nls, -+ cifs_sb_source->mnt_cifs_flags & -+ CIFS_MOUNT_MAP_SPECIAL_CHR); -+ /* else rc is still EEXIST so will fall through to -+ unlink the target and retry rename */ - if (rc == 0) { - rc = CIFSSMBUnixQPathInfo(xid, pTcon, toName, - info_buf_target, -@@ -932,7 +936,7 @@ int cifs_rename(struct inode *source_ino - cifs_sb_source->mnt_cifs_flags & - CIFS_MOUNT_MAP_SPECIAL_CHR); - if (rc==0) { -- CIFSSMBRenameOpenFile(xid, pTcon, netfid, toName, -+ rc = CIFSSMBRenameOpenFile(xid, pTcon, netfid, toName, - cifs_sb_source->local_nls, - cifs_sb_source->mnt_cifs_flags & - CIFS_MOUNT_MAP_SPECIAL_CHR); -diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h -index 2553762..68380ad 100644 ---- a/include/asm-sparc/unistd.h -+++ b/include/asm-sparc/unistd.h -@@ -319,6 +319,8 @@ #define __NR_unshare 299 - #define __NR_set_robust_list 300 - #define __NR_get_robust_list 301 - -+#define NR_SYSCALLS 302 -+ - #ifdef __KERNEL__ - /* WARNING: You MAY NOT add syscall numbers larger than 301, since - * all of the syscall tables in the Sparc kernel are -diff --git a/include/asm-sparc64/futex.h b/include/asm-sparc64/futex.h -index dee4020..7392fc4 100644 ---- a/include/asm-sparc64/futex.h -+++ b/include/asm-sparc64/futex.h -@@ -87,24 +87,22 @@ static inline int - futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) - { - __asm__ __volatile__( -- "\n1: lduwa [%2] %%asi, %0\n" -- "2: casa [%2] %%asi, %0, %1\n" -- "3:\n" -+ "\n1: casa [%3] %%asi, %2, %0\n" -+ "2:\n" - " .section .fixup,#alloc,#execinstr\n" - " .align 4\n" -- "4: ba 3b\n" -- " mov %3, %0\n" -+ "3: ba 2b\n" -+ " mov %4, %0\n" - " .previous\n" - " .section __ex_table,\"a\"\n" - " .align 4\n" -- " .word 1b, 4b\n" -- " .word 2b, 4b\n" -+ " .word 1b, 3b\n" - " .previous\n" -- : "=&r" (oldval) -- : "r" (newval), "r" (uaddr), "i" (-EFAULT) -+ : "=r" (newval) -+ : "0" (newval), "r" (oldval), "r" (uaddr), "i" (-EFAULT) - : "memory"); - -- return oldval; -+ return newval; - } - - #endif /* !(_SPARC64_FUTEX_H) */ -diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h -index badc73f..124dcef 100644 ---- a/include/asm-sparc64/unistd.h -+++ b/include/asm-sparc64/unistd.h -@@ -321,6 +321,8 @@ #define __NR_unshare 299 - #define __NR_set_robust_list 300 - #define __NR_get_robust_list 301 - -+#define NR_SYSCALLS 302 -+ - #ifdef __KERNEL__ - /* WARNING: You MAY NOT add syscall numbers larger than 301, since - * all of the syscall tables in the Sparc kernel are -diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h -index fc62887..aa6832b 100644 ---- a/include/linux/ufs_fs.h -+++ b/include/linux/ufs_fs.h -@@ -900,7 +900,7 @@ struct ufs_super_block_third { - __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ - __fs64 fs_pendingblocks;/* blocks in process of being freed */ - __fs32 fs_pendinginodes;/*inodes in process of being freed */ -- } fs_u2; -+ } __attribute__ ((packed)) fs_u2; - } fs_un1; - union { - struct { -diff --git a/mm/migrate.c b/mm/migrate.c -index 3f1e0c2..fd28046 100644 ---- a/mm/migrate.c -+++ b/mm/migrate.c -@@ -950,7 +950,8 @@ asmlinkage long sys_move_pages(pid_t pid - goto out; - - pm[i].node = node; -- } -+ } else -+ pm[i].node = 0; /* anything to not match MAX_NUMNODES */ - } - /* End marker */ - pm[nr_pages].node = MAX_NUMNODES; -diff --git a/mm/slab.c b/mm/slab.c -index 21ba060..0a94239 100644 ---- a/mm/slab.c -+++ b/mm/slab.c -@@ -867,7 +867,7 @@ static void init_reap_node(int cpu) - if (node == MAX_NUMNODES) - node = first_node(node_online_map); - -- __get_cpu_var(reap_node) = node; -+ per_cpu(reap_node, cpu) = node; - } - - static void next_reap_node(void) -diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index 7de9857..4ae562f 100644 ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -638,6 +638,7 @@ struct sk_buff *pskb_copy(struct sk_buff - n->csum = skb->csum; - n->ip_summed = skb->ip_summed; - -+ n->truesize += skb->data_len; - n->data_len = skb->data_len; - n->len = skb->len; - -diff --git a/net/core/sock.c b/net/core/sock.c -index 51fcfbc..e7ecdf2 100644 ---- a/net/core/sock.c -+++ b/net/core/sock.c -@@ -1164,7 +1164,7 @@ static struct sk_buff *sock_alloc_send_p - goto failure; - - if (atomic_read(&sk->sk_wmem_alloc) < sk->sk_sndbuf) { -- skb = alloc_skb(header_len, sk->sk_allocation); -+ skb = alloc_skb(header_len, gfp_mask); - if (skb) { - int npages; - int i; -diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c -index 934396b..0a4ed27 100644 ---- a/net/ipv4/tcp.c -+++ b/net/ipv4/tcp.c -@@ -2269,7 +2269,7 @@ void __init tcp_init(void) - thash_entries, - (num_physpages >= 128 * 1024) ? - 13 : 15, -- HASH_HIGHMEM, -+ 0, - &tcp_hashinfo.ehash_size, - NULL, - 0); -@@ -2285,7 +2285,7 @@ void __init tcp_init(void) - tcp_hashinfo.ehash_size, - (num_physpages >= 128 * 1024) ? - 13 : 15, -- HASH_HIGHMEM, -+ 0, - &tcp_hashinfo.bhash_size, - NULL, - 64 * 1024); -diff --git a/security/seclvl.c b/security/seclvl.c -index c26dd7d..d5371b8 100644 ---- a/security/seclvl.c -+++ b/security/seclvl.c -@@ -370,6 +370,8 @@ static int seclvl_settime(struct timespe - current->group_leader->pid); - return -EPERM; - } /* if attempt to decrement time */ -+ if (tv->tv_sec > 1924988400) /* disallow dates after 2030) */ -+ return -EPERM; /* CVE-2005-4352 */ - } /* if seclvl > 1 */ - return 0; - } diff --git a/sys-kernel/gentoo-sources/files/patch-2.6.18.3-4 b/sys-kernel/gentoo-sources/files/patch-2.6.18.3-4 deleted file mode 100644 index b8ed04bc8..000000000 --- a/sys-kernel/gentoo-sources/files/patch-2.6.18.3-4 +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c -index 4e4119a..4c61a7e 100644 ---- a/net/bridge/br_ioctl.c -+++ b/net/bridge/br_ioctl.c -@@ -58,12 +58,13 @@ static int get_fdb_entries(struct net_br - { - int num; - void *buf; -- size_t size = maxnum * sizeof(struct __fdb_entry); -+ size_t size; - -- if (size > PAGE_SIZE) { -- size = PAGE_SIZE; -+ /* Clamp size to PAGE_SIZE, test maxnum to avoid overflow */ -+ if (maxnum > PAGE_SIZE/sizeof(struct __fdb_entry)) - maxnum = PAGE_SIZE/sizeof(struct __fdb_entry); -- } -+ -+ size = maxnum * sizeof(struct __fdb_entry); - - buf = kmalloc(size, GFP_USER); - if (!buf) diff --git a/sys-kernel/gentoo-sources/files/sata_promise-2037x-pata-2.6.19-support.patch b/sys-kernel/gentoo-sources/files/sata_promise-2037x-pata-2.6.19-support.patch deleted file mode 100644 index 0af9a9b90..000000000 --- a/sys-kernel/gentoo-sources/files/sata_promise-2037x-pata-2.6.19-support.patch +++ /dev/null @@ -1,128 +0,0 @@ ---- drivers/ata/libata-core.c.old -+++ drivers/ata/libata-core.c -@@ -5304,13 +5304,13 @@ void ata_port_init(struct ata_port *ap, - ap->pio_mask = ent->pinfo2->pio_mask; - ap->mwdma_mask = ent->pinfo2->mwdma_mask; - ap->udma_mask = ent->pinfo2->udma_mask; -- ap->flags |= ent->pinfo2->flags; -+ ap->flags |= ent->pinfo2->flags | ent->_port_flags[port_no]; - ap->ops = ent->pinfo2->port_ops; - } else { - ap->pio_mask = ent->pio_mask; - ap->mwdma_mask = ent->mwdma_mask; - ap->udma_mask = ent->udma_mask; -- ap->flags |= ent->port_flags; -+ ap->flags |= ent->port_flags | ent->_port_flags[port_no]; - ap->ops = ent->port_ops; - } - ap->hw_sata_spd_limit = UINT_MAX; ---- drivers/ata/sata_promise.c.old -+++ drivers/ata/sata_promise.c -@@ -175,7 +175,7 @@ static const struct ata_port_info pdc_po - /* board_2037x */ - { - .sht = &pdc_ata_sht, -- .flags = PDC_COMMON_FLAGS | ATA_FLAG_SATA, -+ .flags = PDC_COMMON_FLAGS /* | ATA_FLAG_SATA */, - .pio_mask = 0x1f, /* pio0-4 */ - .mwdma_mask = 0x07, /* mwdma0-2 */ - .udma_mask = 0x7f, /* udma0-6 ; FIXME */ -@@ -361,17 +361,18 @@ static void pdc_sata_phy_reset(struct at - static void pdc_pata_cbl_detect(struct ata_port *ap) - { - u8 tmp; -- void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; -+ void __iomem *mmio = -+ (void __iomem *) ap->ioaddr.cmd_addr + PDC_CTLSTAT + 0x03; - - tmp = readb(mmio); -- -+ - if (tmp & 0x01) { - ap->cbl = ATA_CBL_PATA40; - ap->udma_mask &= ATA_UDMA_MASK_40C; - } else - ap->cbl = ATA_CBL_PATA80; - } -- -+ - static void pdc_pata_phy_reset(struct ata_port *ap) - { - pdc_pata_cbl_detect(ap); -@@ -382,7 +383,7 @@ static void pdc_pata_phy_reset(struct at - - static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) - { -- if (sc_reg > SCR_CONTROL) -+ if ((sc_reg > SCR_CONTROL) || (ap->flags & ATA_FLAG_SLAVE_POSS)) - return 0xffffffffU; - return readl((void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4)); - } -@@ -391,7 +392,7 @@ static u32 pdc_sata_scr_read (struct ata - static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, - u32 val) - { -- if (sc_reg > SCR_CONTROL) -+ if ((sc_reg > SCR_CONTROL) || (ap->flags & ATA_FLAG_SLAVE_POSS)) - return; - writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4)); - } -@@ -679,6 +680,7 @@ static int pdc_ata_init_one (struct pci_ - unsigned int board_idx = (unsigned int) ent->driver_data; - int pci_dev_busy = 0; - int rc; -+ u8 tmp; - - if (!printed_version++) - dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); -@@ -743,6 +745,9 @@ static int pdc_ata_init_one (struct pci_ - probe_ent->port[0].scr_addr = base + 0x400; - probe_ent->port[1].scr_addr = base + 0x500; - -+ probe_ent->_port_flags[0] = ATA_FLAG_SATA; -+ probe_ent->_port_flags[1] = ATA_FLAG_SATA; -+ - /* notice 4-port boards */ - switch (board_idx) { - case board_40518: -@@ -757,13 +762,29 @@ static int pdc_ata_init_one (struct pci_ - - probe_ent->port[2].scr_addr = base + 0x600; - probe_ent->port[3].scr_addr = base + 0x700; -+ -+ probe_ent->_port_flags[2] = ATA_FLAG_SATA; -+ probe_ent->_port_flags[3] = ATA_FLAG_SATA; - break; - case board_2057x: - /* Override hotplug offset for SATAII150 */ - hp->hotplug_offset = PDC2_SATA_PLUG_CSR; - /* Fall through */ - case board_2037x: -- probe_ent->n_ports = 2; -+ /* Some boards have also PATA port */ -+ tmp = readb(mmio_base + PDC_FLASH_CTL+1); -+ if (!(tmp & 0x80)) -+ { -+ probe_ent->n_ports = 3; -+ -+ pdc_ata_setup_port(&probe_ent->port[2], base + 0x300); -+ -+ probe_ent->_port_flags[2] = ATA_FLAG_SLAVE_POSS; -+ -+ printk(KERN_INFO DRV_NAME " PATA port found\n"); -+ } -+ else -+ probe_ent->n_ports = 2; - break; - case board_20771: - probe_ent->n_ports = 2; ---- include/linux/libata.h.old -+++ include/linux/libata.h -@@ -377,6 +377,7 @@ struct ata_probe_ent { - unsigned int irq_flags; - unsigned long port_flags; - unsigned long _host_flags; -+ unsigned long _port_flags[ATA_MAX_PORTS]; - void __iomem *mmio_base; - void *private_data; - diff --git a/sys-kernel/gentoo-sources/files/toshiba-bluetooth.patch b/sys-kernel/gentoo-sources/files/toshiba-bluetooth.patch deleted file mode 100644 index 48d113a08..000000000 --- a/sys-kernel/gentoo-sources/files/toshiba-bluetooth.patch +++ /dev/null @@ -1,238 +0,0 @@ ---- linux-source-2.6.14.orig/drivers/acpi/toshiba_acpi.c 2005-10-28 02:02:08.000000000 +0200 -+++ linux-source-2.6.14/drivers/acpi/toshiba_acpi.c 2005-11-12 14:14:05.000000000 +0100 -@@ -33,7 +33,7 @@ - * - */ - --#define TOSHIBA_ACPI_VERSION "0.18" -+#define TOSHIBA_ACPI_VERSION "0.18-p1" - #define PROC_INTERFACE_VERSION 1 - - #include -@@ -209,10 +209,36 @@ static acpi_status hci_read1(u32 reg, u3 - return status; - } - -+static acpi_status -+hci_write2(u32 reg, u32 in1, u32 in2, u32* result) -+{ -+ u32 in[HCI_WORDS] = { HCI_SET, reg, in1, in2, 0, 0 }; -+ u32 out[HCI_WORDS]; -+ acpi_status status = hci_raw(in, out); -+ *result = (status == AE_OK) ? out[0] : HCI_FAILURE; -+ return status; -+} -+ -+static acpi_status -+hci_read2(u32 reg, u32* out1, u32* out2, u32* result) -+{ -+ u32 in[HCI_WORDS] = { HCI_GET, reg, *out1, *out2, 0, 0 }; -+ u32 out[HCI_WORDS]; -+ acpi_status status = hci_raw(in, out); -+ *out1 = out[2]; -+ *out2 = out[3]; -+ *result = (status == AE_OK) ? out[0] : HCI_FAILURE; -+ return status; -+} -+ -+ -+ -+ - static struct proc_dir_entry *toshiba_proc_dir /*= 0*/ ; - static int force_fan; - static int last_key_event; - static int key_event_valid; -+static int arbitrary, arbitrary2, arbitrary1; - - typedef struct _ProcItem { - const char *name; -@@ -455,6 +481,171 @@ static unsigned long write_keys(const ch - return count; - } - -+static char* -+read_wk(char* p) -+{ -+ u32 hci_result; -+ u32 value, value2; -+ value = 0; -+ value2 = 0x0001; -+ hci_read2(0x0056, &value, &value2, &hci_result); -+ if (hci_result == HCI_SUCCESS) { -+ p += sprintf(p,"wireless key: %d\n", value ); -+ } else { -+ p += sprintf(p, "ERROR\n"); -+ } -+ -+ return p; -+} -+ -+static char* -+read_bt(char* p) -+{ -+ u32 hci_result; -+ u32 value, value2; -+ value = 0; -+ value2 = 0; -+ hci_read2(0x0056, &value, &value2, &hci_result); -+ if (hci_result == HCI_SUCCESS) { -+/* p += sprintf(p,"present: %d\n", value);*/ -+ p += sprintf(p,"present: %d\n", (value & 0x0f)?1:0); -+ } else { -+ p += sprintf(p, "ERROR\n"); -+ } -+ value = 0; -+ value2 = 0x0001; -+ hci_read2(0x0056, &value, &value2, &hci_result); -+ if (hci_result == HCI_SUCCESS) { -+ p += sprintf(p,"power: %d\n", (value & 128) >> 7); -+ p += sprintf(p,"attach: %d\n", (value & 64) >> 6); -+ p += sprintf(p,"wireless: %d\n", (value & 512) >> 9); -+ } else { -+ p += sprintf(p, "ERROR\n"); -+ } -+ -+ return p; -+} -+ -+static unsigned long -+write_bt(const char* buffer, unsigned long count) -+{ -+ int value, value2; -+ u32 hci_result; -+ value2 = 0x0080; -+ -+ if (sscanf(buffer, " power : %i", &value) == 1 && -+ value >= 0 && value <= 1) { -+ hci_write2(0x0056, value, value2, &hci_result); -+ if (hci_result != HCI_SUCCESS) -+ return -EFAULT; -+ } else -+ if (sscanf(buffer, " attach : %i", &value) == 1 && -+ value >= 0 && value <= 1) { -+ value2 = 0x0040; -+ hci_write2(0x0056, value, value2, &hci_result); -+ if (hci_result != HCI_SUCCESS) -+ return -EFAULT; -+ } else -+ if (sscanf(buffer, " orinoco : %i", &value) == 1 && -+ value >= 0 && value <= 1) { -+ value2 = 0x0200; -+ hci_write2(0x0056, value, value2, &hci_result); -+ if (hci_result != HCI_SUCCESS) -+ return -EFAULT; -+ } else { -+ return -EINVAL; -+ } -+ -+ return count; -+} -+ -+static char* -+read_arb(char* p) -+{ -+ u32 hci_result; -+ u32 value, value2; -+ value = 0; -+ value2 = arbitrary2; -+ p += sprintf(p,"arg1 : %d\n", value ); -+ p += sprintf(p,"arg2 : %d\n", value2 ); -+ hci_read2(arbitrary, &value, &value2, &hci_result); -+ if (hci_result == HCI_SUCCESS) { -+ p += sprintf(p,"arbitrary call: %d\n", arbitrary); -+ -+ p += sprintf(p,"return1: %x\n", value); -+ p += sprintf(p,"return2: %x\n",value2); -+ } else -+ p += sprintf(p, "ERROR\n"); -+ -+ return p; -+} -+ -+static unsigned long -+write_arb(const char* buffer, unsigned long count) -+{ -+ int value, value2, i; -+ u32 hci_result; -+ value2 = 0x0080; -+ -+ sscanf(buffer, " arb : %i", &value) ; -+ arbitrary=value; -+ i=0; -+ while(buffer[i]!=';')i++; -+ if (sscanf(buffer+i+1, " arb2 : %i", &value) == 1 ) -+ arbitrary2=value; -+ else -+ return -EINVAL; -+ -+ return count; -+} -+ -+ -+static char* -+read_arb_c(char* p) -+{ -+ u32 hci_result; -+ u32 value, value2; -+ -+ value = arbitrary1; -+ value2 = arbitrary2; -+ p += sprintf(p,"arg1 : %d\n", value ); -+ p += sprintf(p,"arg2 : %d\n", value2 ); -+ -+ hci_write2(arbitrary, value, value2, &hci_result); -+ if (hci_result == HCI_SUCCESS) { -+ p += sprintf(p,"arbitrary call: %d\n", arbitrary); -+ p += sprintf(p,"return1: %d\n", value); -+ p += sprintf(p,"return2: %d\n",value2); -+ } else -+ p += sprintf(p, "ERROR\n"); -+ -+ return p; -+} -+ -+static unsigned long -+write_arb_c(const char* buffer, unsigned long count) -+{ -+ int value, value2, i; -+ u32 hci_result; -+ value2 = 0x0080; -+ -+ sscanf(buffer, " arb : %i", &value) ; -+ arbitrary=value; -+ i=0; -+ while(buffer[i]!=';')i++; -+ sscanf(buffer+i+1, " arb2 : %i", &value); -+ arbitrary2=value; -+ i++; -+ while(buffer[i]!=';')i++; -+ if (sscanf(buffer+i+1, " arb1 : %i", &value) == 1 ) -+ arbitrary1=value; -+ else -+ return -EINVAL; -+ -+ return count; -+} -+ -+ - static char *read_version(char *p) - { - p += sprintf(p, "driver: %s\n", TOSHIBA_ACPI_VERSION); -@@ -474,6 +665,8 @@ static ProcItem proc_items[] = { - {"fan", read_fan, write_fan}, - {"keys", read_keys, write_keys}, - {"version", read_version, NULL}, -+ { "wireless_key", read_wk , 0 }, -+ { "bluetooth" , read_bt , write_bt }, - {NULL} - }; - -@@ -484,7 +677,7 @@ static acpi_status __init add_device(voi - - for (item = proc_items; item->name; ++item) { - proc = create_proc_read_entry(item->name, -- S_IFREG | S_IRUGO | S_IWUSR, -+ S_IFREG | S_IRUGO | S_IWUGO, - toshiba_proc_dir, - (read_proc_t *) dispatch_read, - item); diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r3.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r3.ebuild deleted file mode 100644 index 726193631..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r3.ebuild +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r2.ebuild,v 1.1 2006/11/08 14:14:43 dsd Exp $ - -ETYPE="sources" -K_WANT_GENPATCHES="base extras" -K_GENPATCHES_VER="3" -IUSE="ultra1" -inherit kernel-2 -detect_version -detect_arch - -KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches" - -DESCRIPTION="Full sources including the gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}" - -pkg_setup() { - if use sparc; then - # hme lockup hack on ultra1 - use ultra1 || UNIPATCH_EXCLUDE="${UNIPATCH_EXCLUDE} 1705_sparc-U1-hme-lockup.patch" - fi - -} - -src_unpack() { - - kernel-2_src_unpack - cd ${S} - epatch ${FILESDIR}/2.6.18-am2-nvidia-ati.patch - epatch ${FILESDIR}/2.6.18-am2-nvidia-fix.patch - epatch ${FILESDIR}/09-non-libata-driver-for-jmicron-devices.patch - -} - -pkg_postinst() { - postinst_sources - - echo - - if [ "${ARCH}" = "sparc" ]; then - if [ x"`cat /proc/openprom/name 2>/dev/null`" \ - = x"'SUNW,Ultra-1'" ]; then - einfo "For users with an Enterprise model Ultra 1 using the HME" - einfo "network interface, please emerge the kernel using the" - einfo "following command: USE=ultra1 emerge ${PN}" - fi - fi - einfo "For more info on this patchset, and how to report problems, see:" - einfo "${HOMEPAGE}" -} diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r4.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r4.ebuild deleted file mode 100644 index 98c270818..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r4.ebuild +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r2.ebuild,v 1.1 2006/11/08 14:14:43 dsd Exp $ - -ETYPE="sources" -K_WANT_GENPATCHES="base extras" -K_GENPATCHES_VER="3" -IUSE="ultra1" -inherit kernel-2 -detect_version -detect_arch - -KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches" - -DESCRIPTION="Full sources including the gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}" - -pkg_setup() { - if use sparc; then - # hme lockup hack on ultra1 - use ultra1 || UNIPATCH_EXCLUDE="${UNIPATCH_EXCLUDE} 1705_sparc-U1-hme-lockup.patch" - fi - -} - -src_unpack() { - - kernel-2_src_unpack - cd ${S} - epatch ${FILESDIR}/2.6.18-am2-nvidia-ati.patch - epatch ${FILESDIR}/2.6.18-am2-nvidia-fix.patch - epatch ${FILESDIR}/09-non-libata-driver-for-jmicron-devices.patch - - # 2.6.18.3 - epatch ${FILESDIR}/patch-2.6.18.2-3 - -} - -pkg_postinst() { - postinst_sources - - echo - - if [ "${ARCH}" = "sparc" ]; then - if [ x"`cat /proc/openprom/name 2>/dev/null`" \ - = x"'SUNW,Ultra-1'" ]; then - einfo "For users with an Enterprise model Ultra 1 using the HME" - einfo "network interface, please emerge the kernel using the" - einfo "following command: USE=ultra1 emerge ${PN}" - fi - fi - einfo "For more info on this patchset, and how to report problems, see:" - einfo "${HOMEPAGE}" -} diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r5.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r5.ebuild deleted file mode 100644 index 2bba8a599..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r5.ebuild +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.18-r2.ebuild,v 1.1 2006/11/08 14:14:43 dsd Exp $ - -ETYPE="sources" -K_WANT_GENPATCHES="base extras" -K_GENPATCHES_VER="3" -IUSE="ultra1" -inherit kernel-2 -detect_version -detect_arch - -KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches" - -DESCRIPTION="Full sources including the gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}" - -pkg_setup() { - if use sparc; then - # hme lockup hack on ultra1 - use ultra1 || UNIPATCH_EXCLUDE="${UNIPATCH_EXCLUDE} 1705_sparc-U1-hme-lockup.patch" - fi - -} - -src_unpack() { - - kernel-2_src_unpack - cd ${S} - epatch ${FILESDIR}/2.6.18-am2-nvidia-ati.patch - epatch ${FILESDIR}/2.6.18-am2-nvidia-fix.patch - epatch ${FILESDIR}/09-non-libata-driver-for-jmicron-devices.patch - - # 2.6.18.3 - epatch ${FILESDIR}/patch-2.6.18.2-3 - # 2.6.18.4 - epatch ${FILESDIR}/patch-2.6.18.3-4 - - # ipw3945 support - epatch ${FILESDIR}/ipw3945-1.1.3_pre2-2.6.18.patch - -} - -pkg_postinst() { - postinst_sources - - echo - - if [ "${ARCH}" = "sparc" ]; then - if [ x"`cat /proc/openprom/name 2>/dev/null`" \ - = x"'SUNW,Ultra-1'" ]; then - einfo "For users with an Enterprise model Ultra 1 using the HME" - einfo "network interface, please emerge the kernel using the" - einfo "following command: USE=ultra1 emerge ${PN}" - fi - fi - einfo "For more info on this patchset, and how to report problems, see:" - einfo "${HOMEPAGE}" -} diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r1.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r1.ebuild deleted file mode 100644 index 0f68871c9..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r1.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r1.ebuild,v 1.2 2006/12/02 09:40:33 corsair Exp $ - -ETYPE="sources" -K_WANT_GENPATCHES="base extras" -K_GENPATCHES_VER="2" -inherit kernel-2 -detect_version -detect_arch - -SL_PATCHES_URI="http://www.sabayonlinux.org/distfiles/sys-kernel/${PN}/ipw3945-1.1.3-2.6.19.patch" - -SUSPEND2_VERSION="2.2.9" -SUSPEND2_TARGET="2.6.19-rc6" -SUSPEND2_SRC="suspend2-${SUSPEND2_VERSION}-for-${SUSPEND2_TARGET}" -SUSPEND2_URI="http://www.suspend2.net/downloads/all/${SUSPEND2_SRC}.patch.bz2" - -UNIPATCH_LIST=" ${DISTDIR}/${SUSPEND2_SRC}.patch.bz2 ${DISTDIR}/ipw3945-1.1.3-2.6.19.patch" -UNIPATCH_STRICTORDER="yes" - -KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches http://www.sabayonlinux.org" - -DESCRIPTION="Full sources including the Gentoo patchset and SabayonLinux ones for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${SUSPEND2_URI} ${SL_PATCHES_URI}" - -pkg_postinst() { - kernel-2_pkg_postinst - einfo "This is a modified version of the Gentoo's gentoo-sources. Please report problems to us first." - einfo "http://bugs.sabayonlinux.org" -} diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r2.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r2.ebuild deleted file mode 100644 index 5f15872d4..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r2.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r1.ebuild,v 1.2 2006/12/02 09:40:33 corsair Exp $ - -ETYPE="sources" -K_WANT_GENPATCHES="base extras" -K_GENPATCHES_VER="3" -inherit kernel-2 -detect_version -detect_arch - -SL_PATCHES_URI="http://www.sabayonlinux.org/distfiles/sys-kernel/${PN}/ipw3945-1.1.3-2.6.19.patch" - -SUSPEND2_VERSION="2.2.9" -SUSPEND2_TARGET="2.6.19-rc6" -SUSPEND2_SRC="suspend2-${SUSPEND2_VERSION}-for-${SUSPEND2_TARGET}" -SUSPEND2_URI="http://www.suspend2.net/downloads/all/${SUSPEND2_SRC}.patch.bz2" - -UNIPATCH_LIST=" ${DISTDIR}/${SUSPEND2_SRC}.patch.bz2 ${DISTDIR}/ipw3945-1.1.3-2.6.19.patch" -UNIPATCH_STRICTORDER="yes" - -KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches http://www.sabayonlinux.org" - -DESCRIPTION="Full sources including the Gentoo patchset and SabayonLinux ones for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${SUSPEND2_URI} ${SL_PATCHES_URI}" - -pkg_postinst() { - kernel-2_pkg_postinst - einfo "This is a modified version of the Gentoo's gentoo-sources. Please report problems to us first." - einfo "http://bugs.sabayonlinux.org" -} diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r3.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r3.ebuild deleted file mode 100644 index c4936fef7..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r3.ebuild +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r1.ebuild,v 1.2 2006/12/02 09:40:33 corsair Exp $ - -ETYPE="sources" -K_WANT_GENPATCHES="base extras" -K_GENPATCHES_VER="3" -inherit kernel-2 -detect_version -detect_arch - -SL_PATCHES_URI="http://www.sabayonlinux.org/distfiles/sys-kernel/${PN}/ipw3945-1.1.3-2.6.19.patch" - -SUSPEND2_VERSION="2.2.9" -SUSPEND2_TARGET="2.6.19-rc6" -SUSPEND2_SRC="suspend2-${SUSPEND2_VERSION}-for-${SUSPEND2_TARGET}" -SUSPEND2_URI="http://www.suspend2.net/downloads/all/${SUSPEND2_SRC}.patch.bz2" - -UNIPATCH_LIST=" - ${DISTDIR}/${SUSPEND2_SRC}.patch.bz2 ${DISTDIR}/ipw3945-1.1.3-2.6.19.patch - ${FILESDIR}/ata-early-irq.patch ${FILESDIR}/fuse-2.6.1.patch ${FILESDIR}/toshiba-bluetooth.patch - " -UNIPATCH_STRICTORDER="yes" - -KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches http://www.sabayonlinux.org" - -DESCRIPTION="Full sources including the Gentoo patchset and SabayonLinux ones for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${SUSPEND2_URI} ${SL_PATCHES_URI}" - -pkg_postinst() { - kernel-2_pkg_postinst - einfo "This is a modified version of the Gentoo's gentoo-sources. Please report problems to us first." - einfo "http://bugs.sabayonlinux.org" -} diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r4.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r4.ebuild deleted file mode 100644 index 83860317b..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r4.ebuild +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r1.ebuild,v 1.2 2006/12/02 09:40:33 corsair Exp $ - -ETYPE="sources" -K_WANT_GENPATCHES="base extras" -K_GENPATCHES_VER="3" -inherit kernel-2 -detect_version -detect_arch - -SL_PATCHES_URI="http://www.sabayonlinux.org/distfiles/sys-kernel/${PN}/ipw3945-1.1.3-2.6.19.patch" - -SUSPEND2_VERSION="2.2.9" -SUSPEND2_TARGET="2.6.19-rc6" -SUSPEND2_SRC="suspend2-${SUSPEND2_VERSION}-for-${SUSPEND2_TARGET}" -SUSPEND2_URI="http://www.suspend2.net/downloads/all/${SUSPEND2_SRC}.patch.bz2" - -UNIPATCH_LIST=" - ${DISTDIR}/${SUSPEND2_SRC}.patch.bz2 ${DISTDIR}/ipw3945-1.1.3-2.6.19.patch - ${FILESDIR}/ata-early-irq.patch ${FILESDIR}/fuse-2.6.1.patch ${FILESDIR}/toshiba-bluetooth.patch - ${FILESDIR}/2.6.19-mactel.patch ${FILESDIR}/2.6.19-libata-pata_ali-updates.patch - ${FILESDIR}/2.6.19-bmdma-fixes.patch ${FILESDIR}/2.6.19-bcm43xx-forcedeth-atiixp-support.patch - ${FILESDIR}/2.6.19-sis-ide-sata-updates.patch ${FILESDIR}/2.6.19-ata-piix-updates.patch - ${FILESDIR}/sata_promise-2037x-pata-2.6.19-support.patch - " - # sata_promise-2037x-pata-2.6.19-support.patch --> check if it will be merged in 2.6.20 -UNIPATCH_STRICTORDER="yes" - -KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches http://www.sabayonlinux.org" - -DESCRIPTION="Full sources including the Gentoo patchset and SabayonLinux ones for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${SUSPEND2_URI} ${SL_PATCHES_URI}" - -pkg_postinst() { - kernel-2_pkg_postinst - einfo "This is a modified version of the Gentoo's gentoo-sources. Please report problems to us first." - einfo "http://bugs.sabayonlinux.org" -} - -src_unpack() { - kernel-2_src_unpack - einfo "Adding KVM patchset..." - cd ${S} - patch -p1 < ${FILESDIR}/2.6.19-kvm-experimental-support.patch > /dev/null -} diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r5.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r5.ebuild deleted file mode 100644 index 5917b6b67..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r5.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/gentoo-sources/gentoo-sources-2.6.19-r1.ebuild,v 1.2 2006/12/02 09:40:33 corsair Exp $ - -ETYPE="sources" -K_WANT_GENPATCHES="base extras" -K_GENPATCHES_VER="3" -inherit kernel-2 -detect_version -detect_arch - -SL_PATCHES_URI="http://www.sabayonlinux.org/distfiles/sys-kernel/${PN}/ipw3945-1.1.3-2.6.19.patch" - -SUSPEND2_VERSION="2.2.9" -SUSPEND2_TARGET="2.6.19-rc6" -SUSPEND2_SRC="suspend2-${SUSPEND2_VERSION}-for-${SUSPEND2_TARGET}" -SUSPEND2_URI="http://www.suspend2.net/downloads/all/${SUSPEND2_SRC}.patch.bz2" - -UNIPATCH_LIST=" - ${DISTDIR}/${SUSPEND2_SRC}.patch.bz2 ${DISTDIR}/ipw3945-1.1.3-2.6.19.patch - ${FILESDIR}/ata-early-irq.patch ${FILESDIR}/fuse-2.6.1.patch ${FILESDIR}/toshiba-bluetooth.patch - ${FILESDIR}/2.6.19-mactel.patch ${FILESDIR}/2.6.19-libata-pata_ali-updates.patch - ${FILESDIR}/2.6.19-bmdma-fixes.patch ${FILESDIR}/2.6.19-bcm43xx-forcedeth-atiixp-support.patch - ${FILESDIR}/2.6.19-sis-ide-sata-updates.patch ${FILESDIR}/2.6.19-ata-piix-updates.patch - ${FILESDIR}/sata_promise-2037x-pata-2.6.19-support.patch - " - # sata_promise-2037x-pata-2.6.19-support.patch --> check if it will be merged in 2.6.20 -UNIPATCH_STRICTORDER="yes" - -KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches http://www.sabayonlinux.org" - -DESCRIPTION="Full sources including the Gentoo patchset and SabayonLinux ones for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${SUSPEND2_URI} ${SL_PATCHES_URI}" - -pkg_postinst() { - kernel-2_pkg_postinst - einfo "This is a modified version of the Gentoo's gentoo-sources. Please report problems to us first." - einfo "http://bugs.sabayonlinux.org" -} - -src_unpack() { - kernel-2_src_unpack - einfo "Adding KVM patchset..." - cd ${S} - patch -p1 < ${FILESDIR}/2.6.19-kvm-experimental-support.patch > /dev/null || die patch failed - patch -p1 < ${FILESDIR}/2.6.19-kvm-2.6.20_rc4-updates.patch > /dev/null || die patch failed - -} diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.20_rc5-r2.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.20_rc5-r2.ebuild deleted file mode 100644 index 45ffe8756..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.20_rc5-r2.ebuild +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2007 Sabayon Linux -# Distributed under the terms of the GNU General Public License v2 - -ETYPE="sources" -K_WANT_GENPATCHES="" -K_GENPATCHES_VER="" -inherit kernel-2 -detect_version -detect_arch - -SL_PATCHES_URI=" - http://www.sabayonlinux.org/distfiles/sys-kernel/${PN}/ipw3945-1.2.0-${PV/_*}.patch - http://www.sabayonlinux.org/distfiles/sys-kernel/${PN}/squashfs-3.2-2.6.20.patch - http://dev.gentoo.org/~spock/projects/gensplash/archive/fbsplash-0.9.2-r5-2.6.19-rc2.patch - " - -SUSPEND2_VERSION="2.2.9.3" -SUSPEND2_TARGET="2.6.20-rc4" -SUSPEND2_SRC="suspend2-${SUSPEND2_VERSION}-for-${SUSPEND2_TARGET}" -SUSPEND2_URI="http://www.suspend2.net/downloads/all/${SUSPEND2_SRC}.patch.bz2" - -UNIPATCH_LIST=" - ${DISTDIR}/${SUSPEND2_SRC}.patch.bz2 ${DISTDIR}/ipw3945-1.2.0-${PV/_*}.patch - ${DISTDIR}/fbsplash-0.9.2-r5-2.6.19-rc2.patch ${DISTDIR}/squashfs-3.2-2.6.20.patch - ${FILESDIR}/2.6.20-mactel.patch ${FILESDIR}/${P}-kvm-compile-fix.patch - " -UNIPATCH_STRICTORDER="yes" - -KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches http://www.sabayonlinux.org" - -DESCRIPTION="Full sources including the Gentoo patchset and SabayonLinux ones for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${SUSPEND2_URI} ${SL_PATCHES_URI}" - -pkg_postinst() { - kernel-2_pkg_postinst - einfo "This is a modified version of the Gentoo's gentoo-sources. Please report problems to us first." - einfo "http://bugs.sabayonlinux.org" -} diff --git a/sys-kernel/gentoo-sources/gentoo-sources-2.6.20_rc6.ebuild b/sys-kernel/gentoo-sources/gentoo-sources-2.6.20_rc6.ebuild deleted file mode 100644 index aed996ab8..000000000 --- a/sys-kernel/gentoo-sources/gentoo-sources-2.6.20_rc6.ebuild +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2007 Sabayon Linux -# Distributed under the terms of the GNU General Public License v2 - -ETYPE="sources" -K_WANT_GENPATCHES="" -K_GENPATCHES_VER="" -inherit kernel-2 -detect_version -detect_arch - -SL_PATCHES_URI=" - http://www.sabayonlinux.org/distfiles/sys-kernel/${PN}/ipw3945-1.2.0-${PV/_*}.patch - http://www.sabayonlinux.org/distfiles/sys-kernel/${PN}/squashfs-3.2-2.6.20.patch - http://dev.gentoo.org/~spock/projects/gensplash/archive/fbsplash-0.9.2-r5-2.6.19-rc2.patch - " - -SUSPEND2_VERSION="2.2.9.3" -SUSPEND2_TARGET="2.6.20-rc4" -SUSPEND2_SRC="suspend2-${SUSPEND2_VERSION}-for-${SUSPEND2_TARGET}" -SUSPEND2_URI="http://www.suspend2.net/downloads/all/${SUSPEND2_SRC}.patch.bz2" - -UNIPATCH_LIST=" - ${DISTDIR}/${SUSPEND2_SRC}.patch.bz2 ${DISTDIR}/ipw3945-1.2.0-${PV/_*}.patch - ${DISTDIR}/fbsplash-0.9.2-r5-2.6.19-rc2.patch ${DISTDIR}/squashfs-3.2-2.6.20.patch - ${FILESDIR}/2.6.20-mactel.patch - " -UNIPATCH_STRICTORDER="yes" - -KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" -HOMEPAGE="http://dev.gentoo.org/~dsd/genpatches http://www.sabayonlinux.org" - -DESCRIPTION="Full sources including the Gentoo patchset and SabayonLinux ones for the ${KV_MAJOR}.${KV_MINOR} kernel tree" -SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI} ${SUSPEND2_URI} ${SL_PATCHES_URI}" - -pkg_postinst() { - kernel-2_pkg_postinst - einfo "This is a modified version of the Gentoo's gentoo-sources. Please report problems to us first." - einfo "http://bugs.sabayonlinux.org" -} diff --git a/x11-libs/qt/Manifest b/x11-libs/qt/Manifest deleted file mode 100644 index 62bae3957..000000000 --- a/x11-libs/qt/Manifest +++ /dev/null @@ -1,96 +0,0 @@ -AUX 0001-dnd_optimization.patch 5623 RMD160 b62b5868086b4d352be66989cc23cd3bb963e283 SHA1 4f3416c3a7e44d52c1088c52256decb384e4b1bc SHA256 8e138a2fdd053ec81522df19ce30f7e4c05838dfd8e0c8069ffb793ba45d7439 -MD5 8ffca1b1b7523339af04fd24b4595ce4 files/0001-dnd_optimization.patch 5623 -RMD160 b62b5868086b4d352be66989cc23cd3bb963e283 files/0001-dnd_optimization.patch 5623 -SHA256 8e138a2fdd053ec81522df19ce30f7e4c05838dfd8e0c8069ffb793ba45d7439 files/0001-dnd_optimization.patch 5623 -AUX 0002-dnd_active_window_fix.patch 7289 RMD160 b355f5fd028d35d88ca15bf9ce8da41bd365f12d SHA1 5b16995f072cbde80f000967aa11d8a88ed34e23 SHA256 e36383b43a53b815f3958608275c60299a0638b6b3201c3a3d9318ee2ead26d1 -MD5 8b3da5dae8babfcbdee3be465579d6c2 files/0002-dnd_active_window_fix.patch 7289 -RMD160 b355f5fd028d35d88ca15bf9ce8da41bd365f12d files/0002-dnd_active_window_fix.patch 7289 -SHA256 e36383b43a53b815f3958608275c60299a0638b6b3201c3a3d9318ee2ead26d1 files/0002-dnd_active_window_fix.patch 7289 -AUX 0037-dnd-timestamp-fix.patch 2138 RMD160 c11fffd7801fb357beb2d489e6e7cc4edefc3030 SHA1 cda25e150541c3a2ba56ec6974e2771b8aaad0de SHA256 490eb5c21dc30e0beac0aac8a4b6159d56a5e3e7fe40daad39f0c0823648917d -MD5 0cc401186f490faf55906cd458280db8 files/0037-dnd-timestamp-fix.patch 2138 -RMD160 c11fffd7801fb357beb2d489e6e7cc4edefc3030 files/0037-dnd-timestamp-fix.patch 2138 -SHA256 490eb5c21dc30e0beac0aac8a4b6159d56a5e3e7fe40daad39f0c0823648917d files/0037-dnd-timestamp-fix.patch 2138 -AUX 0038-dragobject-dont-prefer-unknown.patch 2551 RMD160 0a89aec1a6f9672a927029ca01a1bd8573552745 SHA1 3a2371a520d800904350bb9e6e445d6b3092bb88 SHA256 b5c0d00d1ac84302bc2123ccdfdab473cd0daf12f4ba70d6318084d9f744242c -MD5 eb6eb6b68c8f747b12a3a53efc4b6480 files/0038-dragobject-dont-prefer-unknown.patch 2551 -RMD160 0a89aec1a6f9672a927029ca01a1bd8573552745 files/0038-dragobject-dont-prefer-unknown.patch 2551 -SHA256 b5c0d00d1ac84302bc2123ccdfdab473cd0daf12f4ba70d6318084d9f744242c files/0038-dragobject-dont-prefer-unknown.patch 2551 -AUX 0044-qscrollview-windowactivate-fix.diff 1584 RMD160 978cc6c473b668e1bfd5969cce9307719baecf0a SHA1 657ff8ab47aafbd6469688f489fd3788ccb98907 SHA256 f73798b72251d6fe97ed8e661719ba29983c087587ed952618ec4a97bf1816d5 -MD5 83bc7294b66b53ac1e5a22f15c0bdbf6 files/0044-qscrollview-windowactivate-fix.diff 1584 -RMD160 978cc6c473b668e1bfd5969cce9307719baecf0a files/0044-qscrollview-windowactivate-fix.diff 1584 -SHA256 f73798b72251d6fe97ed8e661719ba29983c087587ed952618ec4a97bf1816d5 files/0044-qscrollview-windowactivate-fix.diff 1584 -AUX 0047-fix-kmenu-widget.diff 992 RMD160 bada5e23043d314b15f3af1eda70c8833112ebce SHA1 d67e34b540c2f19e7e3e3715535a6732f447b22c SHA256 0dadffc3218b04eb327baf51c1f681843046cdf07a52b943f46373cd8384c275 -MD5 4122542a37b787efb9476b0fb1fdafc0 files/0047-fix-kmenu-widget.diff 992 -RMD160 bada5e23043d314b15f3af1eda70c8833112ebce files/0047-fix-kmenu-widget.diff 992 -SHA256 0dadffc3218b04eb327baf51c1f681843046cdf07a52b943f46373cd8384c275 files/0047-fix-kmenu-widget.diff 992 -AUX 0048-qclipboard_hack_80072.patch 1662 RMD160 ebfba0d27c03dcceeac7ad64650d5f6d7039ecdb SHA1 5c174acaf3b148f8d70345f68c7f22352450d582 SHA256 e47a1af0272e952cefacd30d466861b40d9bc969f6e5bc5cb32b878140af1d3c -MD5 3e5e045d0c1448839a8dc1c82aeef21b files/0048-qclipboard_hack_80072.patch 1662 -RMD160 ebfba0d27c03dcceeac7ad64650d5f6d7039ecdb files/0048-qclipboard_hack_80072.patch 1662 -SHA256 e47a1af0272e952cefacd30d466861b40d9bc969f6e5bc5cb32b878140af1d3c files/0048-qclipboard_hack_80072.patch 1662 -AUX qt-3.3.5-macos.patch 18154 RMD160 3e9ffa9baf832ebc6f3e8a292f781b0a9e35740c SHA1 47bac925902b4c7853637fa5766de739989995ac SHA256 0515b66ccf539d2449b44c43873bd89f0ab6ea007488644e5170b50c84d2003e -MD5 dda33293dab89d46ad43994002aae1da files/qt-3.3.5-macos.patch 18154 -RMD160 3e9ffa9baf832ebc6f3e8a292f781b0a9e35740c files/qt-3.3.5-macos.patch 18154 -SHA256 0515b66ccf539d2449b44c43873bd89f0ab6ea007488644e5170b50c84d2003e files/qt-3.3.5-macos.patch 18154 -AUX qt-3.3.5-pertty.patch 13204 RMD160 8f388357cddfb76648d8117e6624eca280604d43 SHA1 4cec30f55d4d3ba77f0993ea6446c672a6d07f9d SHA256 0195860863ed99cdbd7c72973ee7018f4d2b18e4c569682d79ad77a2afc278d9 -MD5 4e298a2093394ffe54a9cbd93fe435e1 files/qt-3.3.5-pertty.patch 13204 -RMD160 8f388357cddfb76648d8117e6624eca280604d43 files/qt-3.3.5-pertty.patch 13204 -SHA256 0195860863ed99cdbd7c72973ee7018f4d2b18e4c569682d79ad77a2afc278d9 files/qt-3.3.5-pertty.patch 13204 -AUX qt-3.3.5-uic-fix.patch 711 RMD160 19964cfc6714e2ad38659e268ef248501db606aa SHA1 38bd5da513a2c28f3d941ba5644024643d835676 SHA256 e6a4e789c6c0da5542cad71057d1817e1976d005a52e1e4ef9bcf9914c37fcf3 -MD5 08ed7e5a6f33e7f88c7e86f13898fca2 files/qt-3.3.5-uic-fix.patch 711 -RMD160 19964cfc6714e2ad38659e268ef248501db606aa files/qt-3.3.5-uic-fix.patch 711 -SHA256 e6a4e789c6c0da5542cad71057d1817e1976d005a52e1e4ef9bcf9914c37fcf3 files/qt-3.3.5-uic-fix.patch 711 -AUX qt-3.3.6-CVE-2006-4811-bis.patch 4944 RMD160 3ec0629247b77fc0ffda9818a4ee2cb50c203168 SHA1 b70374b0457cdba4fd466031a8b7b99f20364ccb SHA256 de6b838047c217b129d9992a44972406eb1dc8c8d6d9a58c8520f95faaf92704 -MD5 684040b974c8837a52c0e6733d4b0c22 files/qt-3.3.6-CVE-2006-4811-bis.patch 4944 -RMD160 3ec0629247b77fc0ffda9818a4ee2cb50c203168 files/qt-3.3.6-CVE-2006-4811-bis.patch 4944 -SHA256 de6b838047c217b129d9992a44972406eb1dc8c8d6d9a58c8520f95faaf92704 files/qt-3.3.6-CVE-2006-4811-bis.patch 4944 -AUX qt-3.3.6-CVE-2006-4811.patch 955 RMD160 5732c149546be0b45b8ba4d21e54827deb21dd5c SHA1 f22855de64f22d88cfac0aa35681d09a76afa2da SHA256 7a14a9930ff6afbd46d4eb573fe3fd4d05608aa83e0c90214bf3adf4aaa1fe93 -MD5 5e242e38c19bbfafce46a047f948f4ce files/qt-3.3.6-CVE-2006-4811.patch 955 -RMD160 5732c149546be0b45b8ba4d21e54827deb21dd5c files/qt-3.3.6-CVE-2006-4811.patch 955 -SHA256 7a14a9930ff6afbd46d4eb573fe3fd4d05608aa83e0c90214bf3adf4aaa1fe93 files/qt-3.3.6-CVE-2006-4811.patch 955 -AUX qt-3.3.6-seli-xinerama.patch 1960 RMD160 ce0163c9a47f5417f957e1d1ad0c574357c01cc7 SHA1 60b9c0a323d598aacca089d677c4b1c9709e70db SHA256 ec72679b69148af1b687a9cf7992e20ee85f4a0f3a33f3c05c8d2174f6f43503 -MD5 5a809da59debd0d8242c25c1f5ae7697 files/qt-3.3.6-seli-xinerama.patch 1960 -RMD160 ce0163c9a47f5417f957e1d1ad0c574357c01cc7 files/qt-3.3.6-seli-xinerama.patch 1960 -SHA256 ec72679b69148af1b687a9cf7992e20ee85f4a0f3a33f3c05c8d2174f6f43503 files/qt-3.3.6-seli-xinerama.patch 1960 -AUX qt-3.3.6-uic-fix.patch 711 RMD160 19964cfc6714e2ad38659e268ef248501db606aa SHA1 38bd5da513a2c28f3d941ba5644024643d835676 SHA256 e6a4e789c6c0da5542cad71057d1817e1976d005a52e1e4ef9bcf9914c37fcf3 -MD5 08ed7e5a6f33e7f88c7e86f13898fca2 files/qt-3.3.6-uic-fix.patch 711 -RMD160 19964cfc6714e2ad38659e268ef248501db606aa files/qt-3.3.6-uic-fix.patch 711 -SHA256 e6a4e789c6c0da5542cad71057d1817e1976d005a52e1e4ef9bcf9914c37fcf3 files/qt-3.3.6-uic-fix.patch 711 -AUX qt-3.3.6-visibility.patch 5554 RMD160 db15a594a913fd1c1837a731e168b1197d19da62 SHA1 692ada218ed717b8b2fc5f5f67cf747bb50f59e4 SHA256 b33b2415f280ef25f070bbe7308659ee3e5a5c1999e2ef419271f11e59160407 -MD5 49aad9f3e7911c03c9e5da8824ed71d5 files/qt-3.3.6-visibility.patch 5554 -RMD160 db15a594a913fd1c1837a731e168b1197d19da62 files/qt-3.3.6-visibility.patch 5554 -SHA256 b33b2415f280ef25f070bbe7308659ee3e5a5c1999e2ef419271f11e59160407 files/qt-3.3.6-visibility.patch 5554 -AUX qt-ulibc.patch 355 RMD160 9a7a01b248b7b646316cef550783569f8bdc89e2 SHA1 2f09deb7e354797ee72aa65a35c882a5ed5fd86c SHA256 6b57b1e25c1e2cebd51b8279fbcadb5e2d9bb77d19b10ea51a4f74c64bd65e2d -MD5 dcd3368171f2b284381e1cbc0de6a5a5 files/qt-ulibc.patch 355 -RMD160 9a7a01b248b7b646316cef550783569f8bdc89e2 files/qt-ulibc.patch 355 -SHA256 6b57b1e25c1e2cebd51b8279fbcadb5e2d9bb77d19b10ea51a4f74c64bd65e2d files/qt-ulibc.patch 355 -AUX qt-visibility.patch 5554 RMD160 db15a594a913fd1c1837a731e168b1197d19da62 SHA1 692ada218ed717b8b2fc5f5f67cf747bb50f59e4 SHA256 b33b2415f280ef25f070bbe7308659ee3e5a5c1999e2ef419271f11e59160407 -MD5 49aad9f3e7911c03c9e5da8824ed71d5 files/qt-visibility.patch 5554 -RMD160 db15a594a913fd1c1837a731e168b1197d19da62 files/qt-visibility.patch 5554 -SHA256 b33b2415f280ef25f070bbe7308659ee3e5a5c1999e2ef419271f11e59160407 files/qt-visibility.patch 5554 -AUX qt-visibility2.patch 6077 RMD160 36b01280a1b8f628453f99cc516659367fd4dbb3 SHA1 cb24add4d441b22d934735471adea245005c8f4d SHA256 d7a11e07a0fd7a80f04684863b0de8be783747924f32783d03aad80574c578ac -MD5 2ba4352a302ee4f9d3e79efedc591766 files/qt-visibility2.patch 6077 -RMD160 36b01280a1b8f628453f99cc516659367fd4dbb3 files/qt-visibility2.patch 6077 -SHA256 d7a11e07a0fd7a80f04684863b0de8be783747924f32783d03aad80574c578ac files/qt-visibility2.patch 6077 -DIST qt-x11-free-3.3.6.tar.bz2 14565843 RMD160 84c0b6bc6dc727d40a5a8df29a81aafc743c0161 SHA1 bbb075054b8a2923a8a7f5afff1c4c7a8bf5a946 SHA256 04f12083f6a6f7a8fd4d34a6c1efd37db76a67580c424f4fb7b7c43c0565e6ae -DIST qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 RMD160 06e97d4b75a3ace380af7ad99b6524811b3b2e9f SHA1 55014f2408831747c51aea3531681a1182adb627 SHA256 3e51cc8fdd93e4526b85af60057aa22107b7a55567046bfd23abbd9de1bd4934 -DIST qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 RMD160 51e480e651261796622a0d824ad549fd5e90089a SHA1 2b82583f1e922d73af7b147f5f03ea7821861a09 SHA256 e67d8720903ded64c1e2eadc91f2fd8cfb5d08e0d71addf17499f21a0891df18 -EBUILD qt-3.3.6-r3.ebuild 10855 RMD160 27a1abfd631f11c569d891da2e7916539f2458f7 SHA1 0f0eb7fdac7ecbc1c48ed623a68c0d5340a56c5c SHA256 dad66d2fdefa7c0f6cfc09711df36908f2121603c2c63f022ecd059011706d88 -MD5 e2b9ac301cd1328d872e71343551082e qt-3.3.6-r3.ebuild 10855 -RMD160 27a1abfd631f11c569d891da2e7916539f2458f7 qt-3.3.6-r3.ebuild 10855 -SHA256 dad66d2fdefa7c0f6cfc09711df36908f2121603c2c63f022ecd059011706d88 qt-3.3.6-r3.ebuild 10855 -EBUILD qt-3.3.6-r4.ebuild 10976 RMD160 e96e6aacb715051ab8fc54271f793e6a75036a27 SHA1 20e9ff77f1f55e769cbf6e7d937715d0c89a2a2f SHA256 349bf7c6bad875838df9c81d91196cc65f0d554791c7964dd3a4dd6469f1c24c -MD5 5dfe41c0b5073c28abfbeea1d22712c0 qt-3.3.6-r4.ebuild 10976 -RMD160 e96e6aacb715051ab8fc54271f793e6a75036a27 qt-3.3.6-r4.ebuild 10976 -SHA256 349bf7c6bad875838df9c81d91196cc65f0d554791c7964dd3a4dd6469f1c24c qt-3.3.6-r4.ebuild 10976 -EBUILD qt-3.3.6-r5.ebuild 11515 RMD160 cacf9c79ce9332d1fd96a9a80be5fb9364b6a69e SHA1 dcdef2e4590fbbf7cd25b8c1da2b4276365d9c57 SHA256 5b7bf251025328c2aedb6031ce751f5386e234a92d9e11d502ca758755993068 -MD5 973d994db472bde0381c696f0b45bf84 qt-3.3.6-r5.ebuild 11515 -RMD160 cacf9c79ce9332d1fd96a9a80be5fb9364b6a69e qt-3.3.6-r5.ebuild 11515 -SHA256 5b7bf251025328c2aedb6031ce751f5386e234a92d9e11d502ca758755993068 qt-3.3.6-r5.ebuild 11515 -MD5 bfddb8831bb526b40e6df455c1e902e3 files/digest-qt-3.3.6-r3 921 -RMD160 569c881b3625047c0f3ece935c432cf5e09c3d6e files/digest-qt-3.3.6-r3 921 -SHA256 2284e7941fa2ac05c79a2a0c7ea5fa40bbb0b7aa39759e1ccbed55255f3617e1 files/digest-qt-3.3.6-r3 921 -MD5 bfddb8831bb526b40e6df455c1e902e3 files/digest-qt-3.3.6-r4 921 -RMD160 569c881b3625047c0f3ece935c432cf5e09c3d6e files/digest-qt-3.3.6-r4 921 -SHA256 2284e7941fa2ac05c79a2a0c7ea5fa40bbb0b7aa39759e1ccbed55255f3617e1 files/digest-qt-3.3.6-r4 921 -MD5 bfddb8831bb526b40e6df455c1e902e3 files/digest-qt-3.3.6-r5 921 -RMD160 569c881b3625047c0f3ece935c432cf5e09c3d6e files/digest-qt-3.3.6-r5 921 -SHA256 2284e7941fa2ac05c79a2a0c7ea5fa40bbb0b7aa39759e1ccbed55255f3617e1 files/digest-qt-3.3.6-r5 921 diff --git a/x11-libs/qt/files/0001-dnd_optimization.patch b/x11-libs/qt/files/0001-dnd_optimization.patch deleted file mode 100644 index d9de28464..000000000 --- a/x11-libs/qt/files/0001-dnd_optimization.patch +++ /dev/null @@ -1,187 +0,0 @@ -qt-bugs@ issue : 16115 -applied: no -author: Lubos Lunak - -See http://lists.kde.org/?t=104388858900001&r=1&w=2 - - ---- src/kernel/qdnd_x11.cpp.sav 2003-02-05 16:09:45.000000000 +0100 -+++ src/kernel/qdnd_x11.cpp 2003-02-07 16:14:49.000000000 +0100 -@@ -49,13 +49,15 @@ - #include "qdragobject.h" - #include "qobjectlist.h" - #include "qcursor.h" -+#include "qbitmap.h" -+#include "qpainter.h" - - #include "qt_x11_p.h" - - // conflict resolution - --// unused, may be used again later: const int XKeyPress = KeyPress; --// unused, may be used again later: const int XKeyRelease = KeyRelease; -+const int XKeyPress = KeyPress; -+const int XKeyRelease = KeyRelease; - #undef KeyPress - #undef KeyRelease - -@@ -249,20 +251,47 @@ class QShapedPixmapWidget : public QWidg - public: - QShapedPixmapWidget(int screen = -1) : - QWidget(QApplication::desktop()->screen( screen ), -- 0, WStyle_Customize | WStyle_Tool | WStyle_NoBorder | WX11BypassWM ) -+ 0, WStyle_Customize | WStyle_Tool | WStyle_NoBorder | WX11BypassWM ), oldpmser( 0 ), oldbmser( 0 ) - { - } - -- void setPixmap(QPixmap pm) -+ void setPixmap(QPixmap pm, QPoint hot) - { -- if ( pm.mask() ) { -+ int bmser = pm.mask() ? pm.mask()->serialNumber() : 0; -+ if( oldpmser == pm.serialNumber() && oldbmser == bmser -+ && oldhot == hot ) -+ return; -+ oldpmser = pm.serialNumber(); -+ oldbmser = bmser; -+ oldhot = hot; -+ bool hotspot_in = !(hot.x() < 0 || hot.y() < 0 || hot.x() >= pm.width() || hot.y() >= pm.height()); -+// if the pixmap has hotspot in its area, make a "hole" in it at that position -+// this will allow XTranslateCoordinates() to find directly the window below the cursor instead -+// of finding this pixmap, and therefore there won't be needed any (slow) search for the window -+// using findRealWindow() -+ if( hotspot_in ) { -+ QBitmap mask = pm.mask() ? *pm.mask() : QBitmap( pm.width(), pm.height()); -+ if( !pm.mask()) -+ mask.fill( Qt::color1 ); -+ QPainter p( &mask ); -+ p.setPen( Qt::color0 ); -+ p.drawPoint( hot.x(), hot.y()); -+ p.end(); -+ pm.setMask( mask ); -+ setMask( mask ); -+ } else if ( pm.mask() ) { - setMask( *pm.mask() ); - } else { - clearMask(); - } - resize(pm.width(),pm.height()); - setErasePixmap(pm); -+ erase(); - } -+private: -+ int oldpmser; -+ int oldbmser; -+ QPoint oldhot; - }; - - QShapedPixmapWidget * qt_xdnd_deco = 0; -@@ -859,6 +888,45 @@ void QDragManager::timerEvent( QTimerEve - move( QCursor::pos() ); - } - -+static bool qt_xdnd_was_move = false; -+static bool qt_xdnd_found = false; -+// check whole incoming X queue for move events -+// checking whole queue is done by always returning False in the predicate -+// if there's another move event in the queue, and there's not a mouse button -+// or keyboard or ClientMessage event before it, the current move event -+// may be safely discarded -+// this helps avoiding being overloaded by being flooded from many events -+// from the XServer -+static -+Bool qt_xdnd_predicate( Display*, XEvent* ev, XPointer ) -+{ -+ if( qt_xdnd_found ) -+ return False; -+ if( ev->type == MotionNotify ) -+ { -+ qt_xdnd_was_move = true; -+ qt_xdnd_found = true; -+ } -+ if( ev->type == ButtonPress || ev->type == ButtonRelease -+ || ev->type == XKeyPress || ev->type == XKeyRelease -+ || ev->type == ClientMessage ) -+ { -+ qt_xdnd_was_move = false; -+ qt_xdnd_found = true; -+ } -+ return False; -+} -+ -+static -+bool qt_xdnd_another_movement() -+{ -+ qt_xdnd_was_move = false; -+ qt_xdnd_found = false; -+ XEvent dummy; -+ XCheckIfEvent( qt_xdisplay(), &dummy, qt_xdnd_predicate, NULL ); -+ return qt_xdnd_was_move; -+} -+ - bool QDragManager::eventFilter( QObject * o, QEvent * e) - { - if ( beingCancelled ) { -@@ -881,8 +949,10 @@ bool QDragManager::eventFilter( QObject - - if ( e->type() == QEvent::MouseMove ) { - QMouseEvent* me = (QMouseEvent *)e; -- updateMode(me->stateAfter()); -- move( me->globalPos() ); -+ if( !qt_xdnd_another_movement()) { -+ updateMode(me->stateAfter()); -+ move( me->globalPos() ); -+ } - return TRUE; - } else if ( e->type() == QEvent::MouseButtonRelease ) { - qApp->removeEventFilter( this ); -@@ -1106,7 +1176,7 @@ void QDragManager::move( const QPoint & - delete qt_xdnd_deco; - qt_xdnd_deco = new QShapedPixmapWidget( screen ); - } -- updatePixmap(); -+ updatePixmap( globalPos ); - - if ( qt_xdnd_source_sameanswer.contains( globalPos ) && - qt_xdnd_source_sameanswer.isValid() ) { -@@ -1679,7 +1749,7 @@ bool QDragManager::drag( QDragObject * o - // qt_xdnd_source_object persists until we get an xdnd_finish message - } - --void QDragManager::updatePixmap() -+void QDragManager::updatePixmap( const QPoint& cursorPos ) - { - if ( qt_xdnd_deco ) { - QPixmap pm; -@@ -1694,9 +1764,8 @@ void QDragManager::updatePixmap() - defaultPm = new QPixmap(default_pm); - pm = *defaultPm; - } -- qt_xdnd_deco->setPixmap(pm); -- qt_xdnd_deco->move(QCursor::pos()-pm_hot); -- qt_xdnd_deco->repaint(FALSE); -+ qt_xdnd_deco->setPixmap(pm, pm_hot); -+ qt_xdnd_deco->move(cursorPos-pm_hot); - //if ( willDrop ) { - qt_xdnd_deco->show(); - //} else { -@@ -1705,4 +1774,9 @@ void QDragManager::updatePixmap() - } - } - -+void QDragManager::updatePixmap() -+{ -+ updatePixmap( QCursor::pos()); -+} -+ - #endif // QT_NO_DRAGANDDROP ---- src/kernel/qdragobject.h.sav 2002-11-01 19:25:07.000000000 +0100 -+++ src/kernel/qdragobject.h 2001-01-01 01:01:00.000000000 +0100 -@@ -245,6 +245,7 @@ private: - void move( const QPoint & ); - void drop(); - void updatePixmap(); -+ void updatePixmap( const QPoint& cursorPos ); - - private: - QDragObject * object; diff --git a/x11-libs/qt/files/0002-dnd_active_window_fix.patch b/x11-libs/qt/files/0002-dnd_active_window_fix.patch deleted file mode 100644 index 4b497d64f..000000000 --- a/x11-libs/qt/files/0002-dnd_active_window_fix.patch +++ /dev/null @@ -1,189 +0,0 @@ -qt-bugs@ issue : 25122 -applied: no -author: Lubos Lunak - - Hello, - - for example: Open Konqueror window, showing some files. Start dragging one - desktop icon. If you press/release Ctrl, there'll be a '+' attached to the - icon, showing the DND operation. Now, while still doing DND, make the - Konqueror window active (Alt+Tab with KDE-3.1.2+, hover over its taskbar - entry, Ctrl+Fn to switch to a different virtual desktop, etc.). As soon as - the app performing DND is not the active application, and the mouse is not - moving, pressing/releasing Ctrl doesn't do anything, the state only updates - when the mouse is moved. - - This is caused by the fact that Qt has only pointer grab when doing DND, but - doesn't have keyboard grab. I actually consider this a good thing, because - the only keys important for DND are modifiers, and they come together with - pointer events, and not having keyboard grab allows using keyboard shortcuts - like Alt+Tab while DND. However, when the mouse is not moved, and only a - modifier key is pressed/released, the app won't get any mouse event, and - won't also get the keyboard event. - - The attached patch changes Qt to explicitly check the modifiers state using - XQueryPointer() if there's wasn't recently any mouse/keyboard event, which - ensures the state is updated even in the situation described above. - ---- src/kernel/qapplication_x11.cpp.sav 2003-06-21 12:31:35.000000000 +0200 -+++ src/kernel/qapplication_x11.cpp 2003-06-21 12:35:44.000000000 +0200 -@@ -4053,7 +4053,7 @@ void QApplication::closePopup( QWidget * - // Keyboard event translation - // - --static int translateButtonState( int s ) -+int qt_x11_translateButtonState( int s ) - { - int bst = 0; - if ( s & Button1Mask ) -@@ -4119,7 +4119,7 @@ bool QETWidget::translateMouseEvent( con - pos.ry() = lastMotion.y; - globalPos.rx() = lastMotion.x_root; - globalPos.ry() = lastMotion.y_root; -- state = translateButtonState( lastMotion.state ); -+ state = qt_x11_translateButtonState( lastMotion.state ); - if ( qt_button_down && (state & (LeftButton | - MidButton | - RightButton ) ) == 0 ) -@@ -4143,7 +4143,7 @@ bool QETWidget::translateMouseEvent( con - pos.ry() = xevent->xcrossing.y; - globalPos.rx() = xevent->xcrossing.x_root; - globalPos.ry() = xevent->xcrossing.y_root; -- state = translateButtonState( xevent->xcrossing.state ); -+ state = qt_x11_translateButtonState( xevent->xcrossing.state ); - if ( qt_button_down && (state & (LeftButton | - MidButton | - RightButton ) ) == 0 ) -@@ -4155,7 +4155,7 @@ bool QETWidget::translateMouseEvent( con - pos.ry() = event->xbutton.y; - globalPos.rx() = event->xbutton.x_root; - globalPos.ry() = event->xbutton.y_root; -- state = translateButtonState( event->xbutton.state ); -+ state = qt_x11_translateButtonState( event->xbutton.state ); - switch ( event->xbutton.button ) { - case Button1: button = LeftButton; break; - case Button2: button = MidButton; break; -@@ -4950,7 +4950,7 @@ bool QETWidget::translateKeyEventInterna - XKeyEvent xkeyevent = event->xkey; - - // save the modifier state, we will use the keystate uint later by passing -- // it to translateButtonState -+ // it to qt_x11_translateButtonState - uint keystate = event->xkey.state; - // remove the modifiers where mode_switch exists... HPUX machines seem - // to have alt *AND* mode_switch both in Mod1Mask, which causes -@@ -5064,7 +5064,7 @@ bool QETWidget::translateKeyEventInterna - } - #endif // !QT_NO_XIM - -- state = translateButtonState( keystate ); -+ state = qt_x11_translateButtonState( keystate ); - - static int directionKeyEvent = 0; - if ( qt_use_rtl_extensions && type == QEvent::KeyRelease ) { ---- src/kernel/qdnd_x11.cpp.sav 2003-06-30 15:26:42.000000000 +0200 -+++ src/kernel/qdnd_x11.cpp 2003-06-30 15:32:23.000000000 +0200 -@@ -114,6 +114,8 @@ Atom qt_xdnd_finished; - Atom qt_xdnd_type_list; - const int qt_xdnd_version = 4; - -+extern int qt_x11_translateButtonState( int s ); -+ - // Actions - // - // The Xdnd spec allows for user-defined actions. This could be implemented -@@ -198,6 +200,8 @@ static Atom qt_xdnd_source_current_time; - static int qt_xdnd_current_screen = -1; - // state of dragging... true if dragging, false if not - bool qt_xdnd_dragging = FALSE; -+// need to check state of keyboard modifiers -+static bool need_modifiers_check = FALSE; - - // dict of payload data, sorted by type atom - static QIntDict * qt_xdnd_target_data = 0; -@@ -879,8 +883,20 @@ void qt_handle_xdnd_finished( QWidget *, - - void QDragManager::timerEvent( QTimerEvent* e ) - { -- if ( e->timerId() == heartbeat && qt_xdnd_source_sameanswer.isNull() ) -- move( QCursor::pos() ); -+ if ( e->timerId() == heartbeat ) { -+ if( need_modifiers_check ) { -+ Window root, child; -+ int root_x, root_y, win_x, win_y; -+ unsigned int mask; -+ XQueryPointer( qt_xdisplay(), qt_xrootwin( qt_xdnd_current_screen ), -+ &root, &child, &root_x, &root_y, &win_x, &win_y, &mask ); -+ if( updateMode( (ButtonState)qt_x11_translateButtonState( mask ))) -+ qt_xdnd_source_sameanswer = QRect(); // force move -+ } -+ need_modifiers_check = TRUE; -+ if( qt_xdnd_source_sameanswer.isNull() ) -+ move( QCursor::pos() ); -+ } - } - - static bool qt_xdnd_was_move = false; -@@ -948,6 +964,7 @@ bool QDragManager::eventFilter( QObject - updateMode(me->stateAfter()); - move( me->globalPos() ); - } -+ need_modifiers_check = FALSE; - return TRUE; - } else if ( e->type() == QEvent::MouseButtonRelease ) { - qApp->removeEventFilter( this ); -@@ -986,9 +1003,11 @@ bool QDragManager::eventFilter( QObject - beingCancelled = FALSE; - qApp->exit_loop(); - } else { -- updateMode(ke->stateAfter()); -- qt_xdnd_source_sameanswer = QRect(); // force move -- move( QCursor::pos() ); -+ if( updateMode(ke->stateAfter())) { -+ qt_xdnd_source_sameanswer = QRect(); // force move -+ move( QCursor::pos() ); -+ } -+ need_modifiers_check = FALSE; - } - return TRUE; // Eat all key events - } -@@ -1014,10 +1033,10 @@ bool QDragManager::eventFilter( QObject - - - static Qt::ButtonState oldstate; --void QDragManager::updateMode( ButtonState newstate ) -+bool QDragManager::updateMode( ButtonState newstate ) - { - if ( newstate == oldstate ) -- return; -+ return false; - const int both = ShiftButton|ControlButton; - if ( (newstate & both) == both ) { - global_requested_action = QDropEvent::Link; -@@ -1041,6 +1060,7 @@ void QDragManager::updateMode( ButtonSta - } - } - oldstate = newstate; -+ return true; - } - - -@@ -1707,6 +1727,7 @@ bool QDragManager::drag( QDragObject * o - qt_xdnd_source_sameanswer = QRect(); - move(QCursor::pos()); - heartbeat = startTimer(200); -+ need_modifiers_check = FALSE; - - #ifndef QT_NO_CURSOR - qApp->setOverrideCursor( arrowCursor ); ---- src/kernel/qdragobject.h.sav 2003-05-19 22:34:43.000000000 +0200 -+++ src/kernel/qdragobject.h 2001-01-01 01:01:00.000000000 +0100 -@@ -248,7 +248,7 @@ private: - - private: - QDragObject * object; -- void updateMode( ButtonState newstate ); -+ bool updateMode( ButtonState newstate ); - void updateCursor(); - - QWidget * dragSource; diff --git a/x11-libs/qt/files/0037-dnd-timestamp-fix.patch b/x11-libs/qt/files/0037-dnd-timestamp-fix.patch deleted file mode 100644 index 234e1b794..000000000 --- a/x11-libs/qt/files/0037-dnd-timestamp-fix.patch +++ /dev/null @@ -1,56 +0,0 @@ -qt-bugs@ issue : 38794 -bugs.kde.org number : 69519 -applied: no -author: Lubos Lunak - - Hello, - -please consider applying the attached patch. It changes XDND handling code to -put the drop timestamp in the right field in the XdndDrop message according -to http://www.newplanetsoftware.com/xdnd/ . I'm not quite sure why the code -has the field moved by one, and puts 1<<24 in the flags, but I see it has a -todo mark next to it. The last snippet of the patch changes it to match the -XDND spec. I tested briefly with Gtk, Mozilla and OOo, and they still work -with the patch. - -The rest of the patch is for fixing part of -http://bugs.kde.org/show_bug.cgi?id=69519, when the user drags some data to -the desktop, and desktop in response popups a dialog asking for filename. -Without the X user timestamp (qt-bugs@ issue 24923) being updated after the -drop, KWin's focus stealing prevention will refuse to activate the dialog. As -the XdndDrop message is kind of an user action too, the timestamp should be -updated. - ---- src/kernel/qdnd_x11.cpp.sav 2004-01-05 19:18:33.000000000 +0100 -+++ src/kernel/qdnd_x11.cpp 2004-01-08 19:08:52.000000000 +0100 -@@ -81,6 +81,7 @@ extern void qt_leave_modal( QWidget *wid - extern Window qt_x11_findClientWindow( Window, Atom, bool ); - extern Atom qt_wm_state; - extern Time qt_x_time; -+extern Time qt_x_user_time; - - // this stuff is copied from qclb_x11.cpp - -@@ -834,6 +835,9 @@ void qt_handle_xdnd_drop( QWidget *, con - // l[0], qt_xdnd_dragsource_xid ); - return; - } -+ -+ if( l[2] != 0 ) -+ qt_x_user_time = l[2]; - if ( qt_xdnd_source_object ) - qt_xdnd_source_object->setTarget( qt_xdnd_current_widget ); - -@@ -1366,9 +1370,9 @@ void QDragManager::drop() - drop.format = 32; - drop.message_type = qt_xdnd_drop; - drop.data.l[0] = object->source()->winId(); -- drop.data.l[1] = 1 << 24; // flags -- drop.data.l[2] = 0; // ### -- drop.data.l[3] = qt_x_time; -+ drop.data.l[1] = 0; // flags -+ drop.data.l[2] = qt_x_time; -+ drop.data.l[3] = 0; - drop.data.l[4] = 0; - - QWidget * w = QWidget::find( qt_xdnd_current_proxy_target ); diff --git a/x11-libs/qt/files/0038-dragobject-dont-prefer-unknown.patch b/x11-libs/qt/files/0038-dragobject-dont-prefer-unknown.patch deleted file mode 100644 index ae4163ae2..000000000 --- a/x11-libs/qt/files/0038-dragobject-dont-prefer-unknown.patch +++ /dev/null @@ -1,57 +0,0 @@ -qt-bugs@ issue : 38642 -bugs.kde.org number : 71084 -applied: no -author: Lubos Lunak - -Hello, - - start Mozilla, go e.g. to http://kde.org, start KWrite (or basically any Qt -app that accepts text drops), select 'Conquer your Desktop!', and try to -drag&drop it onto KWrite. The only text pasted should be 'm'. - - I don't know much the related mimetype and encoding stuff, so I'm unsure -whose fault this actually is. The text drag is provided as a lot of -text/something targets, to list some text/_moz_htmlinfo, text/x-moz-url, -text/unicode and similar. The problem is, Kate uses QTextDrag::decode() with -no subtype specified, probably with the intention that as Kate is a text -editor, it can accept any text pasted. And since the first target provided by -mozilla is text/x-moz-url, (which moreover seems to be encoded as 16bit -unicode), the text dropped is completely wrong. You can easily see all -targets provided by Mozilla with see_mime.patch applied. - - Solution #1: Say that Kate (any pretty much everybody else expecting text) -should say "plain" as the subtype. In such case, I suggest you drop the -QTextDrag::decode() variant with no subtype specified, and stress more the -fact that not specifying a subtype can result in a lot of rubbish. It's -simply too tempting to leave the subtype empty and try to accept anything. - - Solution #2: When trying to accept anything, try to get useful data. Which -means either sorting the subtypes available somehow, checking only the ones -Qt knows. - - To me, #1 seems to be a better choice, or possibly at least something like -the attached QTextDrag patch, which simply always tries first "plain" subtype -if none is specified. With this patch, Mozilla even works (that's irony, of -course, Mozilla still pastes the text/plain text as HTML, but at least now it -pastes something where it's easy to point at the offender). - - ---- src/kernel/qdragobject.cpp.sav 2004-01-06 19:24:35.000000000 +0100 -+++ src/kernel/qdragobject.cpp 2004-01-06 19:47:01.000000000 +0100 -@@ -844,6 +844,16 @@ bool QTextDrag::decode( const QMimeSourc - { - if(!e) - return FALSE; -+ -+ // when subtype is not specified, try text/plain first, otherwise this may read -+ // things like text/x-moz-url even though better targets are available -+ if( subtype.isNull()) { -+ QCString subtmp = "plain"; -+ if( decode( e, str, subtmp )) { -+ subtype = subtmp; -+ return true; -+ } -+ } - - if ( e->cacheType == QMimeSource::Text ) { - str = *e->cache.txt.str; diff --git a/x11-libs/qt/files/0044-qscrollview-windowactivate-fix.diff b/x11-libs/qt/files/0044-qscrollview-windowactivate-fix.diff deleted file mode 100644 index 9a6df32a7..000000000 --- a/x11-libs/qt/files/0044-qscrollview-windowactivate-fix.diff +++ /dev/null @@ -1,38 +0,0 @@ -qt-bugs@ issue : N45716 -applied: no -author: Enrico Ros - -QScrollView unwanted repaint fix. - -This fixes the 'flashing' konqueror window on activation / deactivation by -saving 1 unwanted repaint (when konqueror window has background). -I tracked down to the problem to the internal QViewportWidget of the -QScrollView class. - -When a window is activated the activation event is recursively propagated -to all childs triggering the windowActivationChange() functions in the -widget it passes by. -What happens when the event gets to the Viewport? -At this point the event has already been handled by windowActivationChange() -of the parent widget (a QIconView for example) and has then been propagated -to the Viewport that will handle it with the default -QWidget::windowActivationChange implementation, maybe raising an unwanted -update(); so here we stop the event. -As an addition: if the parent reimplements the windowActivationChange() -function, mainly to block the update, it won't be happy if the child will -trigger the update. If the parent do not reimplement the function il will -inherits the default implementation and there is no need for the viewport's -one. - ---- src/widgets/qscrollview.cpp.orig 2004-03-29 10:17:04.000000000 +0000 -+++ src/widgets/qscrollview.cpp 2004-03-30 16:40:07.599978320 +0000 -@@ -1551,6 +1551,9 @@ - case QEvent::LayoutHint: - d->autoResizeHint(this); - break; -+ case QEvent::WindowActivate: -+ case QEvent::WindowDeactivate: -+ return TRUE; - default: - break; - } diff --git a/x11-libs/qt/files/0047-fix-kmenu-widget.diff b/x11-libs/qt/files/0047-fix-kmenu-widget.diff deleted file mode 100644 index fb0bb1678..000000000 --- a/x11-libs/qt/files/0047-fix-kmenu-widget.diff +++ /dev/null @@ -1,25 +0,0 @@ -qt-bugs@ issue: N46882 -bugs.kde.org number: 77545 -applied: no -author: Stephan Binner - -Fix wrong K menu width for the case of enabled side pixmap and a menu title -(like "Recently Used Applications") being longer than every other entry. - -Solution: Respect PanelKMenu::setMaximumSize() as up to Qt 3.2.3 - -Index: src/widgets/qpopupmenu.cpp -=================================================================== -RCS file: /home/kde/qt-copy/src/widgets/qpopupmenu.cpp,v -retrieving revision 1.60 -diff -u -3 -p -b -r1.60 qpopupmenu.cpp ---- src/widgets/qpopupmenu.cpp 29 Apr 2004 22:31:28 -0000 1.60 -+++ src/widgets/qpopupmenu.cpp 30 Apr 2004 01:11:59 -0000 -@@ -2531,7 +2531,7 @@ QSize QPopupMenu::sizeHint() const - - QPopupMenu* that = (QPopupMenu*) this; - //We do not need a resize here, just the sizeHint.. -- return that->updateSize(FALSE, FALSE).expandedTo( QApplication::globalStrut() ); -+ return that->updateSize(FALSE).expandedTo( QApplication::globalStrut() ); - } - diff --git a/x11-libs/qt/files/0048-qclipboard_hack_80072.patch b/x11-libs/qt/files/0048-qclipboard_hack_80072.patch deleted file mode 100644 index 74c60fb25..000000000 --- a/x11-libs/qt/files/0048-qclipboard_hack_80072.patch +++ /dev/null @@ -1,48 +0,0 @@ -qt-bugs@ issue : none, probably even won't be -bugs.kde.org number : 80072 -applied: no -author: Lubos Lunak - -A crude hack for KDE #80072. No good idea how to fix it properly yet :(. - ---- src/kernel/qclipboard_x11.cpp.sav 2004-04-30 12:00:06.000000000 +0200 -+++ src/kernel/qclipboard_x11.cpp 2004-05-09 21:18:10.269264304 +0200 -@@ -109,6 +109,7 @@ static int pending_timer_id = 0; - static bool pending_clipboard_changed = FALSE; - static bool pending_selection_changed = FALSE; - -+Q_EXPORT bool qt_qclipboard_bailout_hack = false; - - // event capture mechanism for qt_xclb_wait_for_event - static bool waiting_for_data = FALSE; -@@ -453,6 +454,15 @@ static int qt_xclb_event_filter(XEvent * - return 0; - } - -+static bool selection_request_pending = false; -+ -+static Bool check_selection_request_pending( Display*, XEvent* e, XPointer ) -+ { -+ if( e->type == SelectionRequest && e->xselectionrequest.owner == owner->winId()) -+ selection_request_pending = true; -+ return False; -+ } -+ - bool qt_xclb_wait_for_event( Display *dpy, Window win, int type, XEvent *event, - int timeout ) - { -@@ -504,6 +514,14 @@ bool qt_xclb_wait_for_event( Display *dp - do { - if ( XCheckTypedWindowEvent(dpy,win,type,event) ) - return TRUE; -+ if( qt_qclipboard_bailout_hack ) { -+ XEvent dummy; -+ selection_request_pending = false; -+ if ( owner != NULL ) -+ XCheckIfEvent(dpy,&dummy,check_selection_request_pending,NULL); -+ if( selection_request_pending ) -+ return TRUE; -+ } - - now = QTime::currentTime(); - if ( started > now ) // crossed midnight diff --git a/x11-libs/qt/files/digest-qt-3.3.6-r1 b/x11-libs/qt/files/digest-qt-3.3.6-r1 deleted file mode 100644 index 4f40222c3..000000000 --- a/x11-libs/qt/files/digest-qt-3.3.6-r1 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 dc1384c03ac08af21f6fefab32d982cf qt-x11-free-3.3.6.tar.bz2 14565843 -RMD160 84c0b6bc6dc727d40a5a8df29a81aafc743c0161 qt-x11-free-3.3.6.tar.bz2 14565843 -SHA256 04f12083f6a6f7a8fd4d34a6c1efd37db76a67580c424f4fb7b7c43c0565e6ae qt-x11-free-3.3.6.tar.bz2 14565843 -MD5 2a685ae77cb20e98b469597295ce787a qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -RMD160 06e97d4b75a3ace380af7ad99b6524811b3b2e9f qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -SHA256 3e51cc8fdd93e4526b85af60057aa22107b7a55567046bfd23abbd9de1bd4934 qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -MD5 08e49b5372bd44f973d8f2263458a5b6 qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 -RMD160 51e480e651261796622a0d824ad549fd5e90089a qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 -SHA256 e67d8720903ded64c1e2eadc91f2fd8cfb5d08e0d71addf17499f21a0891df18 qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 diff --git a/x11-libs/qt/files/digest-qt-3.3.6-r3 b/x11-libs/qt/files/digest-qt-3.3.6-r3 deleted file mode 100644 index 4f40222c3..000000000 --- a/x11-libs/qt/files/digest-qt-3.3.6-r3 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 dc1384c03ac08af21f6fefab32d982cf qt-x11-free-3.3.6.tar.bz2 14565843 -RMD160 84c0b6bc6dc727d40a5a8df29a81aafc743c0161 qt-x11-free-3.3.6.tar.bz2 14565843 -SHA256 04f12083f6a6f7a8fd4d34a6c1efd37db76a67580c424f4fb7b7c43c0565e6ae qt-x11-free-3.3.6.tar.bz2 14565843 -MD5 2a685ae77cb20e98b469597295ce787a qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -RMD160 06e97d4b75a3ace380af7ad99b6524811b3b2e9f qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -SHA256 3e51cc8fdd93e4526b85af60057aa22107b7a55567046bfd23abbd9de1bd4934 qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -MD5 08e49b5372bd44f973d8f2263458a5b6 qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 -RMD160 51e480e651261796622a0d824ad549fd5e90089a qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 -SHA256 e67d8720903ded64c1e2eadc91f2fd8cfb5d08e0d71addf17499f21a0891df18 qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 diff --git a/x11-libs/qt/files/digest-qt-3.3.6-r4 b/x11-libs/qt/files/digest-qt-3.3.6-r4 deleted file mode 100644 index 4f40222c3..000000000 --- a/x11-libs/qt/files/digest-qt-3.3.6-r4 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 dc1384c03ac08af21f6fefab32d982cf qt-x11-free-3.3.6.tar.bz2 14565843 -RMD160 84c0b6bc6dc727d40a5a8df29a81aafc743c0161 qt-x11-free-3.3.6.tar.bz2 14565843 -SHA256 04f12083f6a6f7a8fd4d34a6c1efd37db76a67580c424f4fb7b7c43c0565e6ae qt-x11-free-3.3.6.tar.bz2 14565843 -MD5 2a685ae77cb20e98b469597295ce787a qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -RMD160 06e97d4b75a3ace380af7ad99b6524811b3b2e9f qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -SHA256 3e51cc8fdd93e4526b85af60057aa22107b7a55567046bfd23abbd9de1bd4934 qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -MD5 08e49b5372bd44f973d8f2263458a5b6 qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 -RMD160 51e480e651261796622a0d824ad549fd5e90089a qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 -SHA256 e67d8720903ded64c1e2eadc91f2fd8cfb5d08e0d71addf17499f21a0891df18 qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 diff --git a/x11-libs/qt/files/digest-qt-3.3.6-r5 b/x11-libs/qt/files/digest-qt-3.3.6-r5 deleted file mode 100644 index 4f40222c3..000000000 --- a/x11-libs/qt/files/digest-qt-3.3.6-r5 +++ /dev/null @@ -1,9 +0,0 @@ -MD5 dc1384c03ac08af21f6fefab32d982cf qt-x11-free-3.3.6.tar.bz2 14565843 -RMD160 84c0b6bc6dc727d40a5a8df29a81aafc743c0161 qt-x11-free-3.3.6.tar.bz2 14565843 -SHA256 04f12083f6a6f7a8fd4d34a6c1efd37db76a67580c424f4fb7b7c43c0565e6ae qt-x11-free-3.3.6.tar.bz2 14565843 -MD5 2a685ae77cb20e98b469597295ce787a qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -RMD160 06e97d4b75a3ace380af7ad99b6524811b3b2e9f qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -SHA256 3e51cc8fdd93e4526b85af60057aa22107b7a55567046bfd23abbd9de1bd4934 qt-x11-free-qt-copy-20060605-3.3.6.patch.bz2 39935 -MD5 08e49b5372bd44f973d8f2263458a5b6 qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 -RMD160 51e480e651261796622a0d824ad549fd5e90089a qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 -SHA256 e67d8720903ded64c1e2eadc91f2fd8cfb5d08e0d71addf17499f21a0891df18 qt-x11-immodule-unified-qt3.3.6-20060317-gentoo.diff.bz2 110200 diff --git a/x11-libs/qt/files/qt-3.3.5-macos.patch b/x11-libs/qt/files/qt-3.3.5-macos.patch deleted file mode 100644 index b0bc430f9..000000000 --- a/x11-libs/qt/files/qt-3.3.5-macos.patch +++ /dev/null @@ -1,450 +0,0 @@ -diff -Naur qt-x11-free-3.3.5.orig/include/qglobal.h qt-x11-free-3.3.5/include/qglobal.h ---- qt-x11-free-3.3.5.orig/include/qglobal.h 2005-09-02 08:42:53.000000000 -0400 -+++ qt-x11-free-3.3.5/include/qglobal.h 2005-10-09 00:33:23.000000000 -0400 -@@ -79,6 +79,10 @@ - UNIX - Any UNIX BSD/SYSV system - */ - -+#ifndef __DARWIN_X11__ -+#define __DARWIN_X11__ -+#endif -+ - #if defined(__DARWIN_X11__) - # define Q_OS_DARWIN - #elif defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__)) -@@ -545,6 +549,8 @@ - - #if defined(Q_OS_MAC9) - # define Q_WS_MAC9 -+#elif defined(__DARWIN_X11__) -+# define Q_WS_X11 - #elif defined(Q_OS_MSDOS) - # define Q_WS_WIN16 - # error "Qt requires Win32 and does not work with Windows 3.x" -diff -Naur qt-x11-free-3.3.5.orig/mkspecs/darwin-g++/qmake.conf qt-x11-free-3.3.5/mkspecs/darwin-g++/qmake.conf ---- qt-x11-free-3.3.5.orig/mkspecs/darwin-g++/qmake.conf 2005-10-09 00:19:04.000000000 -0400 -+++ qt-x11-free-3.3.5/mkspecs/darwin-g++/qmake.conf 2005-10-09 00:33:23.000000000 -0400 -@@ -9,7 +9,7 @@ - MAKEFILE_GENERATOR = UNIX - TEMPLATE = app - CONFIG += qt warn_on release native_precompiled_headers --CONFIG += qt warn_on release link_prl -+CONFIG += qt warn_on release link_prl lib_version_first - DEFINES += __DARWIN_X11__ - - QMAKE_CC = cc -@@ -17,7 +17,7 @@ - QMAKE_LEXFLAGS = - QMAKE_YACC = yacc - QMAKE_YACCFLAGS = -d --QMAKE_CFLAGS = -pipe -+QMAKE_CFLAGS = -pipe -fno-common -fPIC - QMAKE_CFLAGS_DEPS = -M - QMAKE_CFLAGS_WARN_ON = -Wall -W - QMAKE_CFLAGS_WARN_OFF = -w -@@ -40,8 +40,8 @@ - QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC - QMAKE_CXXFLAGS_THREAD = - --QMAKE_INCDIR = /usr/local/include --QMAKE_LIBDIR = -+QMAKE_INCDIR = /usr/include -+QMAKE_LIBDIR = /usr/qt/3/lib - QMAKE_INCDIR_X11 = /usr/X11R6/include - QMAKE_LIBDIR_X11 = /usr/X11R6/lib - QMAKE_INCDIR_QT = $(QTDIR)/include -@@ -55,7 +55,7 @@ - QMAKE_LFLAGS_RELEASE= - QMAKE_LFLAGS_DEBUG = - QMAKE_LFLAGS_APP = -prebind --QMAKE_LFLAGS_SHLIB = -prebind -dynamiclib -single_module -headerpad_max_install_names -+QMAKE_LFLAGS_SHLIB = -prebind -dynamiclib -single_module -headerpad_max_install_names -install_name $$QMAKE_LIBDIR/$(TARGET1) - QMAKE_LFLAGS_PLUGIN = -bundle - QMAKE_LFLAGS_THREAD = - -@@ -64,7 +64,7 @@ - - QMAKE_RPATH = - --QMAKE_LIBS_DYNLOAD = -+QMAKE_LIBS_DYNLOAD = -ldl - QMAKE_LIBS_X11 = -lXext -lX11 -lm - QMAKE_LIBS_X11SM = -lSM -lICE - QMAKE_LIBS_QT = -lqt -@@ -76,7 +76,7 @@ - QMAKE_MOC = $(QTDIR)/bin/moc - QMAKE_UIC = $(QTDIR)/bin/uic - --QMAKE_AR = ar cq -+QMAKE_AR = ar -cq - QMAKE_RANLIB = ranlib -s - - QMAKE_TAR = tar -cf -diff -Naur qt-x11-free-3.3.5.orig/qmake/Makefile.unix qt-x11-free-3.3.5/qmake/Makefile.unix ---- qt-x11-free-3.3.5.orig/qmake/Makefile.unix 2004-09-13 14:24:42.000000000 -0400 -+++ qt-x11-free-3.3.5/qmake/Makefile.unix 2005-10-09 00:33:23.000000000 -0400 -@@ -36,8 +36,8 @@ - -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac \ - -I@BUILD_PATH@/include/qmake -I@BUILD_PATH@/include -I@SOURCE_PATH@/include \ - -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL \ -- -DQT_NO_COMPRESS -I@QMAKESPEC@ -DHAVE_QCONFIG_CPP --LFLAGS=@QMAKE_LFLAGS@ -+ -DQT_NO_COMPRESS -I@QMAKESPEC@ -DHAVE_QCONFIG_CPP -mdynamic-no-pic -+LFLAGS=@QMAKE_LFLAGS@ -mdynamic-no-pic - - qmake: $(OBJS) $(QOBJS) - $(CXX) -o $@ $(OBJS) $(QOBJS) $(LFLAGS) -diff -Naur qt-x11-free-3.3.5.orig/qmake/main.cpp qt-x11-free-3.3.5/qmake/main.cpp ---- qt-x11-free-3.3.5.orig/qmake/main.cpp 2005-09-02 08:43:19.000000000 -0400 -+++ qt-x11-free-3.3.5/qmake/main.cpp 2005-10-09 00:33:23.000000000 -0400 -@@ -49,7 +49,7 @@ - - // for Borland, main is defined to qMain which breaks qmake - #undef main --#ifdef Q_OS_MAC -+#if defined(Q_OS_MAC) || defined(Q_OS_DARWIN) - // for qurl - bool qt_resolve_symlinks = FALSE; - #endif -diff -Naur qt-x11-free-3.3.5.orig/src/kernel/qprocess_unix.cpp qt-x11-free-3.3.5/src/kernel/qprocess_unix.cpp ---- qt-x11-free-3.3.5.orig/src/kernel/qprocess_unix.cpp 2005-09-02 08:43:01.000000000 -0400 -+++ qt-x11-free-3.3.5/src/kernel/qprocess_unix.cpp 2005-10-09 00:33:23.000000000 -0400 -@@ -761,7 +761,7 @@ - #endif - i++; - } --#ifdef Q_OS_MACX -+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) - if(i) { - QCString arg_bundle = arglistQ[0]; - QFileInfo fi(arg_bundle); -@@ -826,7 +826,7 @@ - } else { // start process with environment settins as specified in env - // construct the environment for exec - int numEntries = env->count(); --#if defined(Q_OS_MACX) -+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) - QString ld_library_path("DYLD_LIBRARY_PATH"); - #else - QString ld_library_path("LD_LIBRARY_PATH"); -@@ -858,7 +858,7 @@ - QStringList pathList = QStringList::split( ':', getenv( "PATH" ) ); - for (QStringList::Iterator it = pathList.begin(); it != pathList.end(); ++it ) { - QString dir = *it; --#if defined(Q_OS_MACX) //look in a bundle -+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) //look in a bundle - if(!QFile::exists(dir + "/" + command) && QFile::exists(dir + "/" + command + ".app")) - dir += "/" + command + ".app/Contents/MacOS"; - #endif -@@ -868,7 +868,7 @@ - QFileInfo fileInfo( dir + "/" + command ); - #endif - if ( fileInfo.isExecutable() ) { --#if defined(Q_OS_MACX) -+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) - arglistQ[0] = fileInfo.absFilePath().local8Bit(); - #else - arglistQ[0] = fileInfo.filePath().local8Bit(); -diff -Naur qt-x11-free-3.3.5.orig/src/moc/moc.pro qt-x11-free-3.3.5/src/moc/moc.pro ---- qt-x11-free-3.3.5.orig/src/moc/moc.pro 2003-10-31 09:36:28.000000000 -0500 -+++ qt-x11-free-3.3.5/src/moc/moc.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -48,6 +48,8 @@ - unix:SOURCES += ../tools/qfile_unix.cpp ../tools/qdir_unix.cpp ../tools/qfileinfo_unix.cpp - win32:SOURCES += ../tools/qfile_win.cpp ../tools/qdir_win.cpp ../tools/qfileinfo_win.cpp - macx:LIBS += -framework Carbon -+CFLAGS += -mdynamic-no-pic -+CXXFLAGS += -mdynamic-no-pic - - target.path=$$bins.path - INSTALLS += target -diff -Naur qt-x11-free-3.3.5.orig/src/network/qsocketdevice_unix.cpp qt-x11-free-3.3.5/src/network/qsocketdevice_unix.cpp ---- qt-x11-free-3.3.5.orig/src/network/qsocketdevice_unix.cpp 2005-09-02 08:42:59.000000000 -0400 -+++ qt-x11-free-3.3.5/src/network/qsocketdevice_unix.cpp 2005-10-09 00:33:23.000000000 -0400 -@@ -44,7 +44,7 @@ - - // Tru64 redefines accept -> _accept with _XOPEN_SOURCE_EXTENDED - static inline int qt_socket_accept(int s, struct sockaddr *addr, QT_SOCKLEN_T *addrlen) --{ return ::accept(s, addr, addrlen); } -+{ return ::accept(s, addr, (socklen_t *)addrlen); } - #if defined(accept) - # undef accept - #endif -@@ -140,7 +140,7 @@ - } - } - #else -- if ( !::getsockname(fd, &sa, &sz) ) { -+ if ( !::getsockname(fd, &sa, (socklen_t *)&sz) ) { - switch ( sa.sa_family ) { - case AF_INET: - return IPv4; -@@ -324,7 +324,7 @@ - if ( n != -1 ) { - QT_SOCKOPTLEN_T len; - len = sizeof(v); -- int r = ::getsockopt( fd, SOL_SOCKET, n, (char*)&v, &len ); -+ int r = ::getsockopt( fd, SOL_SOCKET, n, (char*)&v, (socklen_t *)&len ); - if ( r >= 0 ) - return v; - if ( !e ) { -@@ -787,7 +787,7 @@ - QT_SOCKLEN_T sz; - sz = sizeof( aa ); - r = ::recvfrom( fd, data, maxlen, 0, -- (struct sockaddr *)&aa, &sz ); -+ (struct sockaddr *)&aa, (socklen_t *)&sz ); - - qt_socket_getportaddr( (struct sockaddr *)&aa, &pp, &pa); - -@@ -1057,11 +1057,11 @@ - memset( &sa, 0, sizeof(sa) ); - QT_SOCKLEN_T sz; - sz = sizeof( sa ); -- if ( !::getsockname( fd, (struct sockaddr *)(&sa), &sz ) ) -+ if ( !::getsockname( fd, (struct sockaddr *)(&sa), (socklen_t *)&sz ) ) - qt_socket_getportaddr( (struct sockaddr *)&sa, &p, &a ); - - sz = sizeof( sa ); -- if ( !::getpeername( fd, (struct sockaddr *)(&sa), &sz ) ) -+ if ( !::getpeername( fd, (struct sockaddr *)(&sa), (socklen_t *)&sz ) ) - qt_socket_getportaddr( (struct sockaddr *)&sa, &pp, &pa ); - } - -diff -Naur qt-x11-free-3.3.5.orig/src/qt.pro qt-x11-free-3.3.5/src/qt.pro ---- qt-x11-free-3.3.5.orig/src/qt.pro 2005-03-18 10:38:19.000000000 -0500 -+++ qt-x11-free-3.3.5/src/qt.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -191,3 +191,4 @@ - $$CODECS_CPP/qtextcodecplugin.cpp \ - $$WIDGETS_CPP/qwidgetplugin.cpp - } -+QMAKE_LFLAGS_SHLIB += -single_module -diff -Naur qt-x11-free-3.3.5.orig/src/qtmain.pro qt-x11-free-3.3.5/src/qtmain.pro ---- qt-x11-free-3.3.5.orig/src/qtmain.pro 2003-10-31 09:36:28.000000000 -0500 -+++ qt-x11-free-3.3.5/src/qtmain.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -2,6 +2,7 @@ - TEMPLATE = lib - TARGET = qtmain - VERSION = 3.1.0 -+COMPATIBILITY_VERSION = 3.0.0 - DESTDIR = $$QMAKE_LIBDIR_QT - - CONFIG += qt staticlib warn_on release -diff -Naur qt-x11-free-3.3.5.orig/src/tools/qdir_unix.cpp qt-x11-free-3.3.5/src/tools/qdir_unix.cpp ---- qt-x11-free-3.3.5.orig/src/tools/qdir_unix.cpp 2005-09-02 08:42:54.000000000 -0400 -+++ qt-x11-free-3.3.5/src/tools/qdir_unix.cpp 2005-10-09 00:33:23.000000000 -0400 -@@ -88,7 +88,7 @@ - - bool QDir::mkdir( const QString &dirName, bool acceptAbsPath ) const - { --#if defined(Q_OS_MACX) // Mac X doesn't support trailing /'s -+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) // Mac X doesn't support trailing /'s - QString name = dirName; - if (dirName[dirName.length() - 1] == "/") - name = dirName.left( dirName.length() - 1 ); -diff -Naur qt-x11-free-3.3.5.orig/src/tools/qglobal.h qt-x11-free-3.3.5/src/tools/qglobal.h ---- qt-x11-free-3.3.5.orig/src/tools/qglobal.h 2005-09-02 08:42:53.000000000 -0400 -+++ qt-x11-free-3.3.5/src/tools/qglobal.h 2005-10-09 00:33:23.000000000 -0400 -@@ -79,6 +79,10 @@ - UNIX - Any UNIX BSD/SYSV system - */ - -+#ifndef __DARWIN_X11__ -+#define __DARWIN_X11__ -+#endif -+ - #if defined(__DARWIN_X11__) - # define Q_OS_DARWIN - #elif defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__)) -@@ -545,6 +549,8 @@ - - #if defined(Q_OS_MAC9) - # define Q_WS_MAC9 -+#elif defined(__DARWIN_X11__) -+# define Q_WS_X11 - #elif defined(Q_OS_MSDOS) - # define Q_WS_WIN16 - # error "Qt requires Win32 and does not work with Windows 3.x" -diff -Naur qt-x11-free-3.3.5.orig/src/tools/qgpluginmanager.cpp qt-x11-free-3.3.5/src/tools/qgpluginmanager.cpp ---- qt-x11-free-3.3.5.orig/src/tools/qgpluginmanager.cpp 2005-09-02 08:42:53.000000000 -0400 -+++ qt-x11-free-3.3.5/src/tools/qgpluginmanager.cpp 2005-10-09 00:33:23.000000000 -0400 -@@ -316,7 +316,7 @@ - - #if defined(Q_OS_WIN32) - QString filter = "*.dll"; --#elif defined(Q_OS_MACX) -+#elif defined(Q_OS_MACX) || defined(Q_OS_DARWIN) - QString filter = "*.dylib; *.so; *.bundle"; - #elif defined(Q_OS_HPUX) - QString filter = "*.sl"; -diff -Naur qt-x11-free-3.3.5.orig/src/tools/qlibrary.cpp qt-x11-free-3.3.5/src/tools/qlibrary.cpp ---- qt-x11-free-3.3.5.orig/src/tools/qlibrary.cpp 2005-09-02 08:42:53.000000000 -0400 -+++ qt-x11-free-3.3.5/src/tools/qlibrary.cpp 2005-10-09 00:33:23.000000000 -0400 -@@ -400,7 +400,7 @@ - filename += ".dll"; - #else - QStringList filters = ""; --#ifdef Q_OS_MACX -+#if defined(Q_OS_MACX) || defined(Q_OS_DARWIN) - filters << ".so"; - filters << ".bundle"; - filters << ".dylib"; //the last one is also the default one.. -diff -Naur qt-x11-free-3.3.5.orig/src/tools/qmutex_unix.cpp qt-x11-free-3.3.5/src/tools/qmutex_unix.cpp ---- qt-x11-free-3.3.5.orig/src/tools/qmutex_unix.cpp 2005-09-02 08:42:53.000000000 -0400 -+++ qt-x11-free-3.3.5/src/tools/qmutex_unix.cpp 2005-10-09 00:33:23.000000000 -0400 -@@ -44,7 +44,7 @@ - // POSIX threads mutex types - #if ((defined(PTHREAD_MUTEX_RECURSIVE) && defined(PTHREAD_MUTEX_DEFAULT)) || \ - defined(Q_OS_FREEBSD)) && !defined(Q_OS_UNIXWARE) && !defined(Q_OS_SOLARIS) && \ -- !defined(Q_OS_MAC) -+ !defined(Q_OS_MAC) && !defined(Q_OS_DARWIN) - // POSIX 1003.1c-1995 - We love this OS - # define Q_MUTEX_SET_TYPE(a, b) pthread_mutexattr_settype((a), (b)) - # if defined(QT_CHECK_RANGE) -diff -Naur qt-x11-free-3.3.5.orig/src/tools/qstring.cpp qt-x11-free-3.3.5/src/tools/qstring.cpp ---- qt-x11-free-3.3.5.orig/src/tools/qstring.cpp 2005-09-02 08:42:54.000000000 -0400 -+++ qt-x11-free-3.3.5/src/tools/qstring.cpp 2005-10-09 00:33:23.000000000 -0400 -@@ -1362,7 +1362,7 @@ - QStringData* QString::makeSharedNull() - { - QString::shared_null = new QStringData; --#if defined( Q_OS_MAC ) || defined(Q_OS_SOLARIS) || defined(Q_OS_HPUX) || defined(Q_OS_AIX) -+#if defined(Q_OS_MAC) || defined(Q_OS_DARWIN) || defined(Q_OS_SOLARIS) || defined(Q_OS_HPUX) || defined(Q_OS_AIX) - QString *that = const_cast(&QString::null); - that->d = QString::shared_null; - #endif -@@ -2923,7 +2923,7 @@ - if (!l) - return -1; - --#if defined(Q_OS_MACX) && defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020 -+#if defined(Q_OS_MACX) && ((defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020) || defined(Q_OS_DARWIN)) - if ( sl == 1 ) - return find( *str.unicode(), index, cs ); - #endif -@@ -3022,7 +3022,7 @@ - - int QString::findRev( QChar c, int index, bool cs ) const - { --#if defined(Q_OS_MACX) && defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION < 0x1020 -+#if defined(Q_OS_MACX) && ((defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION < 0x1020) || defined(Q_OS_DARWIN)) - return findRev( QString( c ), index, cs ); - #else - const uint l = length(); -@@ -3078,7 +3078,7 @@ - if ( index > delta ) - index = delta; - --#if defined(Q_OS_MACX) && defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020 -+#if defined(Q_OS_MACX) && ((defined(QT_MACOSX_VERSION) && QT_MACOSX_VERSION >= 0x1020) || defined(Q_OS_DARWIN)) - if ( sl == 1 ) - return findRev( *str.unicode(), index, cs ); - #endif -diff -Naur qt-x11-free-3.3.5.orig/tools/assistant/assistant.pro qt-x11-free-3.3.5/tools/assistant/assistant.pro ---- qt-x11-free-3.3.5.orig/tools/assistant/assistant.pro 2003-11-17 07:40:25.000000000 -0500 -+++ qt-x11-free-3.3.5/tools/assistant/assistant.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -32,6 +32,8 @@ - - win32:RC_FILE = assistant.rc - mac:RC_FILE = assistant.icns -+CFLAGS += -mdynamic-no-pic -+CXXFLAGS += -mdynamic-no-pic - - target.path = $$bins.path - INSTALLS += target -diff -Naur qt-x11-free-3.3.5.orig/tools/designer/app/app.pro qt-x11-free-3.3.5/tools/designer/app/app.pro ---- qt-x11-free-3.3.5.orig/tools/designer/app/app.pro 2004-01-16 19:51:08.000000000 -0500 -+++ qt-x11-free-3.3.5/tools/designer/app/app.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -20,6 +20,8 @@ - QMAKE_INFO_PLIST = Info_mac.plist - staticlib:CONFIG -= global_init_link_order #yuck - } -+CFLAGS += -mdynamic-no-pic -+CXXFLAGS += -mdynamic-no-pic - - - target.path=$$bins.path -diff -Naur qt-x11-free-3.3.5.orig/tools/designer/designer/designer.pro qt-x11-free-3.3.5/tools/designer/designer/designer.pro ---- qt-x11-free-3.3.5.orig/tools/designer/designer/designer.pro 2004-07-29 09:09:50.000000000 -0400 -+++ qt-x11-free-3.3.5/tools/designer/designer/designer.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -1,6 +1,6 @@ - TEMPLATE = lib - --CONFIG += qt warn_on staticlib qmake_cache -+CONFIG += qt warn_on qmake_cache - CONFIG -= dll - !force_static:!win32:contains(QT_PRODUCT,qt-internal) { - CONFIG -= staticlib -diff -Naur qt-x11-free-3.3.5.orig/tools/designer/editor/editor.pro qt-x11-free-3.3.5/tools/designer/editor/editor.pro ---- qt-x11-free-3.3.5.orig/tools/designer/editor/editor.pro 2003-10-31 09:36:28.000000000 -0500 -+++ qt-x11-free-3.3.5/tools/designer/editor/editor.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -1,5 +1,5 @@ - TEMPLATE = lib --CONFIG += qt warn_on staticlib -+CONFIG += qt warn_on - CONFIG -= dll - HEADERS = editor.h \ - parenmatcher.h \ -diff -Naur qt-x11-free-3.3.5.orig/tools/linguist/linguist/linguist.pro qt-x11-free-3.3.5/tools/linguist/linguist/linguist.pro ---- qt-x11-free-3.3.5.orig/tools/linguist/linguist/linguist.pro 2003-10-31 09:36:28.000000000 -0500 -+++ qt-x11-free-3.3.5/tools/linguist/linguist/linguist.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -43,6 +43,8 @@ - staticlib:CONFIG -= global_init_link_order #yuck - RC_FILE = linguist.icns - } -+CFLAGS += -mdynamic-no-pic -+CXXFLAGS += -mdynamic-no-pic - - PROJECTNAME = Qt Linguist - -diff -Naur qt-x11-free-3.3.5.orig/tools/linguist/linguist.pro qt-x11-free-3.3.5/tools/linguist/linguist.pro ---- qt-x11-free-3.3.5.orig/tools/linguist/linguist.pro 2004-06-08 04:06:56.000000000 -0400 -+++ qt-x11-free-3.3.5/tools/linguist/linguist.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -1,8 +1,5 @@ - TEMPLATE = subdirs - SUBDIRS = linguist \ -- tutorial/tt1 \ -- tutorial/tt2 \ -- tutorial/tt3 \ - lrelease \ - lupdate \ - qm2ts -diff -Naur qt-x11-free-3.3.5.orig/tools/linguist/lrelease/lrelease.pro qt-x11-free-3.3.5/tools/linguist/lrelease/lrelease.pro ---- qt-x11-free-3.3.5.orig/tools/linguist/lrelease/lrelease.pro 2003-10-31 09:36:28.000000000 -0500 -+++ qt-x11-free-3.3.5/tools/linguist/lrelease/lrelease.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -15,3 +15,6 @@ - - target.path=$$bins.path - INSTALLS += target -+ -+QMAKE_CFLAGS += -mdynamic-no-pic -+QMAKE_CXXFLAGS += -mdynamic-no-pic -diff -Naur qt-x11-free-3.3.5.orig/tools/linguist/lupdate/lupdate.pro qt-x11-free-3.3.5/tools/linguist/lupdate/lupdate.pro ---- qt-x11-free-3.3.5.orig/tools/linguist/lupdate/lupdate.pro 2003-10-31 09:36:28.000000000 -0500 -+++ qt-x11-free-3.3.5/tools/linguist/lupdate/lupdate.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -19,3 +19,6 @@ - - target.path=$$bins.path - INSTALLS += target -+ -+macx: CFLAGS += -mdynamic-no-pic -+macx: CXXFLAGS += -mdynamic-no-pic -diff -Naur qt-x11-free-3.3.5.orig/tools/linguist/qm2ts/qm2ts.pro qt-x11-free-3.3.5/tools/linguist/qm2ts/qm2ts.pro ---- qt-x11-free-3.3.5.orig/tools/linguist/qm2ts/qm2ts.pro 2003-10-31 09:36:28.000000000 -0500 -+++ qt-x11-free-3.3.5/tools/linguist/qm2ts/qm2ts.pro 2005-10-09 00:33:23.000000000 -0400 -@@ -13,3 +13,6 @@ - - target.path=$$bins.path - INSTALLS += target -+ -+CFLAGS += -mdynamic-no-pic -+CXXFLAGS += -mdynamic-no-pic -diff -Naur qt-x11-free-3.3.5.orig/tools/qtconfig/qtconfig.pro qt-x11-free-3.3.5/tools/qtconfig/qtconfig.pro ---- qt-x11-free-3.3.5.orig/tools/qtconfig/qtconfig.pro 2005-07-19 20:59:24.000000000 -0400 -+++ qt-x11-free-3.3.5/tools/qtconfig/qtconfig.pro 2005-10-09 00:41:11.000000000 -0400 -@@ -16,3 +16,6 @@ - INCLUDEPATH += . - DBFILE = qtconfig.db - REQUIRES=full-config nocrosscompiler !win32* -+ -+CFLAGS += -mdynamic-no-pic -+CXXFLAGS += -mdynamic-no-pic diff --git a/x11-libs/qt/files/qt-3.3.5-pertty.patch b/x11-libs/qt/files/qt-3.3.5-pertty.patch deleted file mode 100644 index 7a3fc645c..000000000 --- a/x11-libs/qt/files/qt-3.3.5-pertty.patch +++ /dev/null @@ -1,399 +0,0 @@ -diff -purN qt-x11-free-3.3.4-orig/src/iconview/qiconview.cpp qt-x11-free-3.3.4-pertty/src/iconview/qiconview.cpp ---- qt-x11-free-3.3.4-orig/src/iconview/qiconview.cpp 2005-01-21 11:16:07.000000000 -0600 -+++ qt-x11-free-3.3.4-pertty/src/iconview/qiconview.cpp 2005-03-11 14:56:27.723919000 -0600 -@@ -261,6 +261,7 @@ public: - - QIconViewToolTip *toolTip; - QPixmapCache maskCache; -+ QPixmap *backrubber; - QPtrDict selectedItems; - - struct ItemContainer { -@@ -1974,14 +1975,27 @@ void QIconViewItem::paintItem( QPainter - if ( picture() ) { - QPicture *pic = picture(); - if ( isSelected() ) { -- p->fillRect( pixmapRect( FALSE ), QBrush( cg.highlight(), QBrush::Dense4Pattern) ); -+ p->setBrush( QBrush( cg.highlight(), QBrush::Dense4Pattern ) ); -+ p->setPen( QPen( cg.highlight(), QBrush::Dense4Pattern ) ); -+ p->drawRoundRect( pixmapRect( FALSE ), -+ 1000 / pixmapRect( FALSE ).width(), -+ 1000 / pixmapRect( FALSE ).height() ); - } - p->drawPicture( x()-pic->boundingRect().x(), y()-pic->boundingRect().y(), *pic ); - if ( isSelected() ) { -- p->fillRect( textRect( FALSE ), cg.highlight() ); -+ p->setBrush( QBrush( cg.highlight() ) ); -+ p->setPen( QPen( cg.highlight() ) ); -+ p->drawRoundRect( textRect( FALSE ), -+ 1000 / textRect( FALSE ).width(), -+ 1000 / textRect( FALSE ).height() ); - p->setPen( QPen( cg.highlightedText() ) ); -- } else if ( view->d->itemTextBrush != NoBrush ) -- p->fillRect( textRect( FALSE ), view->d->itemTextBrush ); -+ } else if ( view->d->itemTextBrush != NoBrush ) { -+ p->setBrush( view->d->itemTextBrush ); -+ p->setPen( QPen( view->d->itemTextBrush.color() ) ); -+ p->drawRoundRect( textRect( FALSE ), -+ 1000 / textRect( FALSE ).width(), -+ 1000 / textRect( FALSE ).height() ); -+ } - - int align = view->itemTextPos() == QIconView::Bottom ? AlignHCenter : AlignAuto; - if ( view->d->wordWrapIconText ) -@@ -2039,10 +2053,19 @@ void QIconViewItem::paintItem( QPainter - - p->save(); - if ( isSelected() ) { -- p->fillRect( textRect( FALSE ), cg.highlight() ); -+ p->setBrush( QBrush( cg.highlight() ) ); -+ p->setPen( QPen( cg.highlight() ) ); -+ p->drawRoundRect( textRect( FALSE ), -+ 1000 / textRect( FALSE ).width(), -+ 1000 / textRect( FALSE ).height() ); - p->setPen( QPen( cg.highlightedText() ) ); -- } else if ( view->d->itemTextBrush != NoBrush ) -- p->fillRect( textRect( FALSE ), view->d->itemTextBrush ); -+ } else if ( view->d->itemTextBrush != NoBrush ) { -+ p->setBrush( view->d->itemTextBrush ); -+ p->setPen( QPen( view->d->itemTextBrush.color() ) ); -+ p->drawRoundRect( textRect( FALSE ), -+ 1000 / textRect( FALSE ).width(), -+ 1000 / textRect( FALSE ).height() ); -+ } - - int align = AlignHCenter; - if ( view->d->wordWrapIconText ) -@@ -2058,31 +2081,13 @@ void QIconViewItem::paintItem( QPainter - /*! - Paints the focus rectangle of the item using the painter \a p and - the color group \a cg. -+ -+ The default implementation does nothing; subclasses may -+ reimplement this function. - */ - --void QIconViewItem::paintFocus( QPainter *p, const QColorGroup &cg ) -+void QIconViewItem::paintFocus( QPainter *, const QColorGroup & ) - { -- if ( !view ) -- return; -- -- view->style().drawPrimitive(QStyle::PE_FocusRect, p, -- QRect( textRect( FALSE ).x(), textRect( FALSE ).y(), -- textRect( FALSE ).width(), -- textRect( FALSE ).height() ), cg, -- (isSelected() ? -- QStyle::Style_FocusAtBorder : -- QStyle::Style_Default), -- QStyleOption(isSelected() ? cg.highlight() : cg.base())); -- -- if ( this != view->d->currentItem ) { -- view->style().drawPrimitive(QStyle::PE_FocusRect, p, -- QRect( pixmapRect( FALSE ).x(), -- pixmapRect( FALSE ).y(), -- pixmapRect( FALSE ).width(), -- pixmapRect( FALSE ).height() ), -- cg, QStyle::Style_Default, -- QStyleOption(cg.base())); -- } - } - - /*! -@@ -2780,6 +2785,7 @@ QIconView::QIconView( QWidget *parent, c - d->renamingItem = 0; - d->drawActiveSelection = TRUE; - d->drawDragShapes = FALSE; -+ d->backrubber = 0; - - connect( d->adjustTimer, SIGNAL( timeout() ), - this, SLOT( adjustItems() ) ); -@@ -3264,7 +3270,7 @@ uint QIconView::count() const - - void QIconView::doAutoScroll() - { -- QRect oldRubber = QRect( *d->rubber ); -+ QRect oldRubber = *d->rubber; - - QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); - QPoint pos = viewportToContents( vp ); -@@ -3281,7 +3287,6 @@ void QIconView::doAutoScroll() - bool block = signalsBlocked(); - - QRect rr; -- QRegion region( 0, 0, visibleWidth(), visibleHeight() ); - - blockSignals( TRUE ); - viewport()->setUpdatesEnabled( FALSE ); -@@ -3307,9 +3312,6 @@ void QIconView::doAutoScroll() - item->setSelected( TRUE, TRUE ); - changed = TRUE; - rr = rr.unite( item->rect() ); -- } else { -- region = region.subtract( QRect( contentsToViewport( item->pos() ), -- item->size() ) ); - } - - minx = QMIN( minx, item->x() - 1 ); -@@ -3326,42 +3328,76 @@ void QIconView::doAutoScroll() - viewport()->setUpdatesEnabled( TRUE ); - blockSignals( block ); - -- QRect r = *d->rubber; -- *d->rubber = oldRubber; -- -- QPainter p; -- p.begin( viewport() ); -- p.setRasterOp( NotROP ); -- p.setPen( QPen( color0, 1 ) ); -- p.setBrush( NoBrush ); -- drawRubber( &p ); -- d->dragging = FALSE; -- p.end(); -- -- *d->rubber = r; -- -- if ( changed ) { -- d->drawAllBack = FALSE; -- d->clipRegion = region; -- repaintContents( rr, FALSE ); -- d->drawAllBack = TRUE; -+ // static bool drawAll; -+ if ( d->backrubber == 0 ) { -+ d->backrubber = new QPixmap( viewport()->rect().size() ); -+ d->backrubber->fill( viewport(), viewport()->rect().topLeft() ); -+ // drawAll = true; - } - -+ // int oldX = 0, oldY = 0; -+ // if ( !drawAll && d->scrollTimer ) { -+ // oldX = contentsX(); -+ // oldY = contentsY(); -+ // } - ensureVisible( pos.x(), pos.y() ); -+ // if ( !drawAll && d->scrollTimer && ( oldX != contentsX() || oldY != contentsY() ) ) -+ // drawAll = true; - -- p.begin( viewport() ); -- p.setRasterOp( NotROP ); -- p.setPen( QPen( color0, 1 ) ); -- p.setBrush( NoBrush ); -- drawRubber( &p ); -- d->dragging = TRUE; -+ QRect allRect = oldRubber.normalize(); -+ if ( changed ) -+ allRect |= rr.normalize(); -+ allRect |= d->rubber->normalize(); -+ QPoint point = contentsToViewport( allRect.topLeft() ); -+ allRect = QRect( point.x(), point.y(), allRect.width(), allRect.height() ); -+ allRect &= viewport()->rect(); -+ -+ d->dragging = FALSE; -+ -+ QPainter p( d->backrubber ); -+ p.translate( -contentsX(), -contentsY() ); -+#if 0 -+ if ( !drawAll ) { -+ oldRubber = oldRubber.normalize(); -+ point = contentsToViewport( oldRubber.topLeft() ); -+ oldRubber = QRect( point.x(), point.y(), oldRubber.width(), oldRubber.height() ); -+ oldRubber &= viewport()->rect(); -+ -+ point = contentsToViewport( nr.topLeft() ); -+ nr = QRect( point.x(), point.y(), nr.width(), nr.height() ); -+ nr &= viewport()->rect(); -+ -+ QRegion region; -+ if ( allRect != nr ) -+ region = QRegion(allRect).subtract( QRegion( nr ) ); -+ if ( allRect != oldRubber ) -+ region += QRegion(allRect).subtract( QRegion( oldRubber ) ); -+ -+ QMemArray< QRect > ar = region.rects(); -+ for ( uint i = 0; i < ar.size(); ++i ) { -+ ar[i].addCoords( -2, -2, 4, 4 ); -+ ar[i] = ar[i].normalize(); -+ -+ p.setClipRect( ar[i] ); -+ drawContents( &p, contentsX() + ar[i].left(), contentsY() + ar[i].top(), ar[i].width(), ar[i].height() ); -+ } -+ } -+ else -+#endif -+ { -+ drawContents( &p, -+ contentsX() + allRect.left(), contentsY() + allRect.top(), -+ allRect.width(), allRect.height() ); -+ } - - p.end(); -+ // drawAll = false; -+ d->dragging = TRUE; -+ bitBlt( viewport(), allRect.topLeft(), d->backrubber, allRect ); - - if ( changed ) { -- emit selectionChanged(); -- if ( d->selectionMode == Single ) -- emit selectionChanged( d->currentItem ); -+ if ( d->selectionMode == Single ) -+ emit selectionChanged( d->currentItem ); - } - - if ( !QRect( 50, 50, viewport()->width()-100, viewport()->height()-100 ).contains( vp ) && -@@ -3388,9 +3424,7 @@ void QIconView::doAutoScroll() - - void QIconView::drawContents( QPainter *p, int cx, int cy, int cw, int ch ) - { -- if ( d->dragging && d->rubber ) -- drawRubber( p ); -- -+ p->save(); - QRect r = QRect( cx, cy, cw, ch ); - - QIconViewPrivate::ItemContainer *c = d->firstContainer; -@@ -3464,8 +3498,16 @@ void QIconView::drawContents( QPainter * - d->currentItem->paintFocus( p, colorGroup() ); - } - -- if ( d->dragging && d->rubber ) -- drawRubber( p ); -+ p->restore(); -+ if ( d->rubber ) { -+ p->save(); -+ p->translate( contentsX(), contentsY() ); -+ p->setRasterOp( NotROP ); -+ p->setPen( QPen( color0, 1 ) ); -+ p->setBrush( NoBrush ); -+ drawRubber( p ); -+ p->restore(); -+ } - } - - /*! -@@ -4364,17 +4406,15 @@ void QIconView::contentsMousePressEvent( - void QIconView::contentsMousePressEventEx( QMouseEvent *e ) - { - if ( d->rubber ) { -- QPainter p; -- p.begin( viewport() ); -- p.setRasterOp( NotROP ); -- p.setPen( QPen( color0, 1 ) ); -- p.setBrush( NoBrush ); -+ QRect r( d->rubber->normalize() ); -+ delete d->rubber; -+ d->rubber = 0; -+ -+ repaintContents( r, FALSE ); -+ d->dragging = FALSE; - -- drawRubber( &p ); -- d->dragging = FALSE; -- p.end(); -- delete d->rubber; -- d->rubber = 0; -+ delete d->backrubber; -+ d->backrubber = 0; - - if ( d->scrollTimer ) { - disconnect( d->scrollTimer, SIGNAL( timeout() ), this, SLOT( doAutoScroll() ) ); -@@ -4559,21 +4599,17 @@ void QIconView::contentsMouseReleaseEven - d->startDragItem = 0; - - if ( d->rubber ) { -- QPainter p; -- p.begin( viewport() ); -- p.setRasterOp( NotROP ); -- p.setPen( QPen( color0, 1 ) ); -- p.setBrush( NoBrush ); -- -- drawRubber( &p ); -- d->dragging = FALSE; -- p.end(); -- -+ QRect r(d->rubber->normalize()); -+ - if ( ( d->rubber->topLeft() - d->rubber->bottomRight() ).manhattanLength() > - QApplication::startDragDistance() ) - emitClicked = FALSE; - delete d->rubber; -- d->rubber = 0; -+ d->rubber = 0; -+ repaintContents(r, FALSE); -+ d->dragging = FALSE; -+ delete d->backrubber; -+ d->backrubber = 0; - d->currentItem = d->tmpCurrentItem; - d->tmpCurrentItem = 0; - if ( d->currentItem ) -@@ -5333,9 +5369,9 @@ void QIconView::drawRubber( QPainter *p - QPoint pnt( d->rubber->x(), d->rubber->y() ); - pnt = contentsToViewport( pnt ); - -- style().drawPrimitive(QStyle::PE_RubberBand, p, -- QRect(pnt.x(), pnt.y(), d->rubber->width(), d->rubber->height()), -- colorGroup(), QStyle::Style_Default, QStyleOption(colorGroup().base())); -+ style().drawPrimitive( QStyle::PE_RubberBand, p, -+ QRect( pnt.x(), pnt.y(), d->rubber->width(), d->rubber->height() ).normalize(), -+ colorGroup(), QStyle::Style_Default, QStyleOption(colorGroup().base()) ); - } - - /*! -diff -purN qt-x11-free-3.3.4-orig/src/widgets/qlistbox.cpp qt-x11-free-3.3.4-pertty/src/widgets/qlistbox.cpp ---- qt-x11-free-3.3.4-orig/src/widgets/qlistbox.cpp 2005-01-21 11:16:22.000000000 -0600 -+++ qt-x11-free-3.3.4-pertty/src/widgets/qlistbox.cpp 2005-03-11 14:56:27.727918392 -0600 -@@ -2162,7 +2162,7 @@ void QListBox::mouseReleaseEvent( QMouse - } - - if ( d->rubber ) { -- drawRubber(); -+ repaintContents( d->rubber->normalize(), FALSE ); - delete d->rubber; - d->rubber = 0; - d->current = d->tmpCurrent; -@@ -2240,11 +2240,9 @@ void QListBox::mouseMoveEvent( QMouseEve - } - - if ( d->rubber ) { -- QRect r = d->rubber->normalize(); -- drawRubber(); -+ QRect r = d->rubber->normalize(); - d->rubber->setCoords( d->rubber->x(), d->rubber->y(), e->x(), e->y() ); - doRubberSelection( r, d->rubber->normalize() ); -- drawRubber(); - return; - } - -@@ -4381,6 +4379,7 @@ void QListBox::drawRubber() - return; - if ( !d->rubber->width() && !d->rubber->height() ) - return; -+ - QPainter p( viewport() ); - p.setRasterOp( NotROP ); - style().drawPrimitive( QStyle::PE_RubberBand, &p, d->rubber->normalize(), -@@ -4413,13 +4412,24 @@ void QListBox::doRubberSelection( const - } - } - } -+ -+ QRect allRect = old; -+ if ( changed ) { -+ allRect |= pr; -+ } -+ allRect |= rubber; -+ allRect &= viewport()->rect(); -+ allRect.addCoords( -2, -2, 2, 2 ); -+ -+ repaintContents( QRect( contentsX() + allRect.left(), contentsY() + allRect.top(), allRect.width(), allRect.height() ), FALSE ); -+ drawRubber(); -+ - if ( changed ) { - emit selectionChanged(); - #if defined(QT_ACCESSIBILITY_SUPPORT) - QAccessible::updateAccessibility( viewport(), 0, QAccessible::Selection ); - #endif - } -- viewport()->repaint( pr, TRUE ); - } - - diff --git a/x11-libs/qt/files/qt-3.3.5-uic-fix.patch b/x11-libs/qt/files/qt-3.3.5-uic-fix.patch deleted file mode 100644 index 8e5bd5590..000000000 --- a/x11-libs/qt/files/qt-3.3.5-uic-fix.patch +++ /dev/null @@ -1,18 +0,0 @@ -Index: tools/designer/uic/form.cpp -=================================================================== ---- tools/designer/uic/form.cpp (revision 460038) -+++ tools/designer/uic/form.cpp (working copy) -@@ -731,6 +731,13 @@ - while ( !n2.isNull() ) { - if ( n2.tagName() == "includehint" ) { - QString file = n2.firstChild().toText().data(); -+ int colons = file.find("::"); -+ -+ if (colons != -1) -+ { -+ file = file.right(file.length() - colons - 2); -+ } -+ - localIncludes += file; - } - n2 = n2.nextSibling().toElement(); diff --git a/x11-libs/qt/files/qt-3.3.6-CVE-2006-4811-bis.patch b/x11-libs/qt/files/qt-3.3.6-CVE-2006-4811-bis.patch deleted file mode 100644 index 9a42a34bb..000000000 --- a/x11-libs/qt/files/qt-3.3.6-CVE-2006-4811-bis.patch +++ /dev/null @@ -1,140 +0,0 @@ ---- //depot/qt/3/src/kernel/qfontengine_x11.cpp Thu Oct 19 14:41:41 CEST 2006 -+++ //depot/qt/3/src/kernel/qfontengine_x11.cpp Thu Oct 19 14:41:41 CEST 2006 - -@@ -171,7 +171,8 @@ - - QRect br = xmat.mapRect(QRect(x, y - si->ascent, w, h)); - QRect br2 = br & pdevRect; -- if (br2.width() <= 0 || br2.height() <= 0) -+ if (br2.width() <= 0 || br2.height() <= 0 -+ || br2.width() >= 32768 || br2.height() >= 32768) - return; - QWMatrix mat = QPixmap::trueMatrix( xmat, w, h ); - QBitmap wx_bm = ::transform(dpy, bm, br2.x() - br.x(), br2.y() - br.y(), br2.width(), br2.height(), mat); - ---- //depot/qt/3/src/kernel/qimage.cpp Thu Oct 19 14:41:41 CEST 2006 -+++ //depot/qt/3/src/kernel/qimage.cpp Thu Oct 19 14:41:41 CEST 2006 - -@@ -475,7 +475,12 @@ - Endian bitOrder ) - { - init(); -- if ( w <= 0 || h <= 0 || depth <= 0 || numColors < 0 ) -+ int bpl = ((w*depth+31)/32)*4; // bytes per scanline -+ if ( w <= 0 || h <= 0 || depth <= 0 || numColors < 0 -+ || INT_MAX / sizeof(uchar *) < uint(h) -+ || INT_MAX / uint(depth) < uint(w) -+ || bpl <= 0 -+ || INT_MAX / uint(bpl) < uint(h) ) - return; // invalid parameter(s) - data->w = w; - data->h = h; -@@ -483,7 +488,6 @@ - data->ncols = depth != 32 ? numColors : 0; - if ( !yourdata ) - return; // Image header info can be saved without needing to allocate memory. -- int bpl = ((w*depth+31)/32)*4; // bytes per scanline - data->nbytes = bpl*h; - if ( colortable || !data->ncols ) { - data->ctbl = colortable; -@@ -525,7 +529,10 @@ - Endian bitOrder ) - { - init(); -- if ( !yourdata || w <= 0 || h <= 0 || depth <= 0 || numColors < 0 ) -+ if ( !yourdata || w <= 0 || h <= 0 || depth <= 0 || numColors < 0 -+ || INT_MAX / sizeof(uchar *) < uint(h) -+ || INT_MAX / uint(bpl) < uint(h) -+ ) - return; // invalid parameter(s) - data->w = w; - data->h = h; -@@ -1264,7 +1271,7 @@ - if ( data->ncols != numColors ) // could not alloc color table - return FALSE; - -- if ( INT_MAX / depth < width) { // sanity check for potential overflow -+ if ( INT_MAX / uint(depth) < uint(width) ) { // sanity check for potential overflow - setNumColors( 0 ); - return FALSE; - } -@@ -1277,7 +1284,9 @@ - // #### WWA: shouldn't this be (width*depth+7)/8: - const int pad = bpl - (width*depth)/8; // pad with zeros - #endif -- if (INT_MAX / bpl < height) { // sanity check for potential overflow -+ if ( INT_MAX / uint(bpl) < uint(height) -+ || bpl < 0 -+ || INT_MAX / sizeof(uchar *) < uint(height) ) { // sanity check for potential overflow - setNumColors( 0 ); - return FALSE; - } - ---- //depot/qt/3/src/kernel/qpixmap_x11.cpp Thu Oct 19 14:41:41 CEST 2006 -+++ //depot/qt/3/src/kernel/qpixmap_x11.cpp Thu Oct 19 14:41:41 CEST 2006 - -@@ -953,6 +953,9 @@ - bool force_mono = (dd == 1 || isQBitmap() || - (conversion_flags & ColorMode_Mask)==MonoOnly ); - -+ if ( w >= 32768 || h >= 32768 ) -+ return FALSE; -+ - // get rid of the mask - delete data->mask; - data->mask = 0; -@@ -1678,11 +1681,11 @@ - - QPixmap QPixmap::xForm( const QWMatrix &matrix ) const - { -- int w = 0; -- int h = 0; // size of target pixmap -- int ws, hs; // size of source pixmap -+ uint w = 0; -+ uint h = 0; // size of target pixmap -+ uint ws, hs; // size of source pixmap - uchar *dptr; // data in target pixmap -- int dbpl, dbytes; // bytes per line/bytes total -+ uint dbpl, dbytes; // bytes per line/bytes total - uchar *sptr; // data in original pixmap - int sbpl; // bytes per line in original - int bpp; // bits per pixel -@@ -1697,19 +1700,24 @@ - - QWMatrix mat( matrix.m11(), matrix.m12(), matrix.m21(), matrix.m22(), 0., 0. ); - -+ double scaledWidth; -+ double scaledHeight; -+ - if ( matrix.m12() == 0.0F && matrix.m21() == 0.0F ) { - if ( matrix.m11() == 1.0F && matrix.m22() == 1.0F ) - return *this; // identity matrix -- h = qRound( matrix.m22()*hs ); -- w = qRound( matrix.m11()*ws ); -- h = QABS( h ); -- w = QABS( w ); -+ scaledHeight = matrix.m22()*hs; -+ scaledWidth = matrix.m11()*ws; -+ h = QABS( qRound( scaledHeight ) ); -+ w = QABS( qRound( scaledWidth ) ); - } else { // rotation or shearing - QPointArray a( QRect(0,0,ws+1,hs+1) ); - a = mat.map( a ); - QRect r = a.boundingRect().normalize(); - w = r.width()-1; - h = r.height()-1; -+ scaledWidth = w; -+ scaledHeight = h; - } - - mat = trueMatrix( mat, ws, hs ); // true matrix -@@ -1718,7 +1726,8 @@ - bool invertible; - mat = mat.invert( &invertible ); // invert matrix - -- if ( h == 0 || w == 0 || !invertible ) { // error, return null pixmap -+ if ( h == 0 || w == 0 || !invertible -+ || QABS(scaledWidth) >= 32768 || QABS(scaledHeight) >= 32768 ) { // error, return null pixmap - QPixmap pm; - pm.data->bitmap = data->bitmap; - return pm; diff --git a/x11-libs/qt/files/qt-3.3.6-CVE-2006-4811.patch b/x11-libs/qt/files/qt-3.3.6-CVE-2006-4811.patch deleted file mode 100644 index 19c084023..000000000 --- a/x11-libs/qt/files/qt-3.3.6-CVE-2006-4811.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- src/kernel/qpixmap_x11.cpp.josh 2006-10-13 23:30:27.000000000 -0400 -+++ src/kernel/qpixmap_x11.cpp 2006-10-14 00:31:01.000000000 -0400 -@@ -1758,6 +1758,12 @@ QPixmap QPixmap::xForm( const QWMatrix & - dbpl = ((w*bpp+31)/32)*4; - dbytes = dbpl*h; - -+ if (dbytes != (long long) dbpl*h) { // Integer overflow detection -+ QPixmap pm; -+ pm.data->bitmap = data->bitmap; -+ return pm; -+ } -+ - #if defined(QT_MITSHM) - if ( use_mitshm ) { - dptr = (uchar *)xshmimg->data; -@@ -1867,6 +1873,11 @@ QPixmap QPixmap::xForm( const QWMatrix & - sptr = (uchar *) axi->data; - bpp = axi->bits_per_pixel; - dbytes = dbpl * h; -+ if (dbytes != (long long) dbpl*h) { // Integer overflow detection -+ QPixmap pm; -+ pm.data->bitmap = data->bitmap; -+ return pm; -+ } - dptr = (uchar *) malloc(dbytes); - Q_CHECK_PTR( dptr ); - memset(dptr, 0, dbytes); diff --git a/x11-libs/qt/files/qt-3.3.6-seli-xinerama.patch b/x11-libs/qt/files/qt-3.3.6-seli-xinerama.patch deleted file mode 100644 index 9fdd97a3d..000000000 --- a/x11-libs/qt/files/qt-3.3.6-seli-xinerama.patch +++ /dev/null @@ -1,49 +0,0 @@ ---- src/kernel/qapplication_x11.cpp.sav 2006-06-01 13:31:04.000000000 +0200 -+++ src/kernel/qapplication_x11.cpp 2006-06-01 13:33:07.000000000 +0200 -@@ -271,6 +271,7 @@ Atom qt_net_wm_frame_strut = 0; // KDE - Atom qt_net_wm_state_stays_on_top = 0; // KDE extension - Atom qt_net_wm_pid = 0; - Atom qt_net_wm_user_time = 0; -+Atom qt_net_wm_full_placement = 0; // KDE extension - // Enlightenment support - Atom qt_enlightenment_desktop = 0; - -@@ -1922,6 +1923,7 @@ void qt_init_internal( int *argcptr, cha - &qt_net_wm_state_stays_on_top ); - qt_x11_intern_atom( "_NET_WM_PID", &qt_net_wm_pid ); - qt_x11_intern_atom( "_NET_WM_USER_TIME", &qt_net_wm_user_time ); -+ qt_x11_intern_atom( "_NET_WM_FULL_PLACEMENT", &qt_net_wm_full_placement ); - qt_x11_intern_atom( "ENLIGHTENMENT_DESKTOP", &qt_enlightenment_desktop ); - qt_x11_intern_atom( "_NET_WM_NAME", &qt_net_wm_name ); - qt_x11_intern_atom( "_NET_WM_ICON_NAME", &qt_net_wm_icon_name ); ---- src/dialogs/qdialog.cpp.sav 2006-03-17 14:33:44.000000000 +0100 -+++ src/dialogs/qdialog.cpp 2006-06-01 13:38:00.000000000 +0200 -@@ -670,6 +670,11 @@ bool QDialog::event( QEvent *e ) - - #if defined(Q_WS_X11) - extern "C" { int XSetTransientForHint( Display *, unsigned long, unsigned long ); } -+#include -+#undef FocusIn -+// defined in qapplication_x11.cpp -+extern Atom qt_net_wm_full_placement; -+extern bool qt_net_supports(Atom atom); - #endif // Q_WS_X11 - - /*! -@@ -691,10 +696,12 @@ void QDialog::show() - - if ( !did_resize ) - adjustSize(); -- if ( has_relpos && !did_move ) { -- adjustPositionInternal( parentWidget(), TRUE ); -- } else if ( !did_move ) { -- adjustPositionInternal( parentWidget() ); -+ if( !qt_net_supports( qt_net_wm_full_placement )) { -+ if ( has_relpos && !did_move ) { -+ adjustPositionInternal( parentWidget(), TRUE ); -+ } else if ( !did_move ) { -+ adjustPositionInternal( parentWidget() ); -+ } - } - - if (windowState() != state) diff --git a/x11-libs/qt/files/qt-3.3.6-uic-fix.patch b/x11-libs/qt/files/qt-3.3.6-uic-fix.patch deleted file mode 100644 index 8e5bd5590..000000000 --- a/x11-libs/qt/files/qt-3.3.6-uic-fix.patch +++ /dev/null @@ -1,18 +0,0 @@ -Index: tools/designer/uic/form.cpp -=================================================================== ---- tools/designer/uic/form.cpp (revision 460038) -+++ tools/designer/uic/form.cpp (working copy) -@@ -731,6 +731,13 @@ - while ( !n2.isNull() ) { - if ( n2.tagName() == "includehint" ) { - QString file = n2.firstChild().toText().data(); -+ int colons = file.find("::"); -+ -+ if (colons != -1) -+ { -+ file = file.right(file.length() - colons - 2); -+ } -+ - localIncludes += file; - } - n2 = n2.nextSibling().toElement(); diff --git a/x11-libs/qt/files/qt-3.3.6-visibility.patch b/x11-libs/qt/files/qt-3.3.6-visibility.patch deleted file mode 100644 index a5246b9ff..000000000 --- a/x11-libs/qt/files/qt-3.3.6-visibility.patch +++ /dev/null @@ -1,159 +0,0 @@ -Index: configure -=================================================================== ---- configure (revision 471775) -+++ configure (working copy) -@@ -1053,6 +1053,7 @@ - [ -d $outpath/src/tools ] || mkdir -p $outpath/src/tools - cat > $outpath/src/tools/qconfig.cpp.new <iface(); \ - } - --# ifdef Q_WS_WIN --# ifdef Q_CC_BOR --# define Q_EXPORT_PLUGIN(PLUGIN) \ -- Q_PLUGIN_VERIFICATION_DATA \ -- Q_EXTERN_C __declspec(dllexport) \ -- const char * __stdcall qt_ucm_query_verification_data() \ -- { return qt_ucm_verification_data; } \ -- Q_EXTERN_C __declspec(dllexport) QUnknownInterface* \ -- __stdcall ucm_instantiate() \ -- Q_PLUGIN_INSTANTIATE( PLUGIN ) --# else --# define Q_EXPORT_PLUGIN(PLUGIN) \ -- Q_PLUGIN_VERIFICATION_DATA \ -- Q_EXTERN_C __declspec(dllexport) \ -- const char *qt_ucm_query_verification_data() \ -- { return qt_ucm_verification_data; } \ -- Q_EXTERN_C __declspec(dllexport) QUnknownInterface* ucm_instantiate() \ -- Q_PLUGIN_INSTANTIATE( PLUGIN ) --# endif --# else --# define Q_EXPORT_PLUGIN(PLUGIN) \ -+#if defined(Q_WS_WIN) && defined(Q_CC_BOR) -+# define Q_STDCALL __stdcall -+#else -+# define Q_STDCALL -+#endif -+ -+#define Q_EXPORT_PLUGIN(PLUGIN) \ - Q_PLUGIN_VERIFICATION_DATA \ -- Q_EXTERN_C \ -- const char *qt_ucm_query_verification_data() \ -+ Q_EXTERN_C Q_EXPORT \ -+ const char * Q_STDCALL qt_ucm_query_verification_data() \ - { return qt_ucm_verification_data; } \ -- Q_EXTERN_C QUnknownInterface* ucm_instantiate() \ -+ Q_EXTERN_C Q_EXPORT QUnknownInterface* Q_STDCALL ucm_instantiate() \ - Q_PLUGIN_INSTANTIATE( PLUGIN ) --# endif -- - #endif - - struct QUnknownInterface; -Index: src/kernel/qapplication_x11.cpp -=================================================================== ---- src/kernel/qapplication_x11.cpp (revision 471775) -+++ src/kernel/qapplication_x11.cpp (working copy) -@@ -314,7 +314,7 @@ - - // flags for extensions for special Languages, currently only for RTL languages - static bool qt_use_rtl_extensions = FALSE; --bool qt_hebrew_keyboard_hack = FALSE; -+Q_EXPORT bool qt_hebrew_keyboard_hack = FALSE; - - static Window mouseActWindow = 0; // window where mouse is - static int mouseButtonPressed = 0; // last mouse button pressed -@@ -3800,7 +3800,7 @@ - } - - --bool qt_try_modal( QWidget *widget, XEvent *event ) -+Q_EXPORT bool qt_try_modal( QWidget *widget, XEvent *event ) - { - if (qt_xdnd_dragging) { - // allow mouse events while DnD is active -Index: src/kernel/qtextengine_p.h -=================================================================== ---- src/kernel/qtextengine_p.h (revision 471775) -+++ src/kernel/qtextengine_p.h (working copy) -@@ -280,7 +280,7 @@ - - class QFontPrivate; - --class QTextEngine { -+class Q_EXPORT QTextEngine { - public: - QTextEngine( const QString &str, QFontPrivate *f ); - ~QTextEngine(); -Index: src/tools/qglobal.h -=================================================================== ---- src/tools/qglobal.h (revision 471775) -+++ src/tools/qglobal.h (working copy) -@@ -865,6 +865,10 @@ - # define Q_TEMPLATE_EXTERN - # undef Q_DISABLE_COPY /* avoid unresolved externals */ - # endif -+#elif defined(Q_CC_GNU) && __GNUC__ - 0 >= 4 -+# define Q_EXPORT __attribute__((visibility("default"))) -+# undef QT_MAKEDLL /* ignore these for other platforms */ -+# undef QT_DLL - #else - # undef QT_MAKEDLL /* ignore these for other platforms */ - # undef QT_DLL -Index: tools/designer/uilib/qwidgetfactory.h -=================================================================== ---- tools/designer/uilib/qwidgetfactory.h (revision 471775) -+++ tools/designer/uilib/qwidgetfactory.h (working copy) -@@ -48,7 +48,7 @@ - class QWidgetFactoryPrivate; - class UibStrTable; - --class QWidgetFactory -+class Q_EXPORT QWidgetFactory - { - public: - QWidgetFactory(); -Index: tools/designer/uilib/qwidgetfactory.cpp -=================================================================== ---- tools/designer/uilib/qwidgetfactory.cpp (revision 471775) -+++ tools/designer/uilib/qwidgetfactory.cpp (working copy) -@@ -113,13 +113,13 @@ - static QMap *availableWidgetMap = 0; - static QStringList *availableWidgetList = 0; - --QMap *qwf_forms = 0; -+Q_EXPORT QMap *qwf_forms = 0; - QString *qwf_language = 0; --bool qwf_execute_code = TRUE; -+Q_EXPORT bool qwf_execute_code = TRUE; - bool qwf_stays_on_top = FALSE; - QString qwf_currFileName = ""; - QObject *qwf_form_object = 0; --QString *qwf_plugin_dir = 0; -+Q_EXPORT QString *qwf_plugin_dir = 0; - - static void setupPluginDir() - { -Index: tools/designer/shared/domtool.h -=================================================================== ---- tools/designer/shared/domtool.h (revision 471775) -+++ tools/designer/shared/domtool.h (working copy) -@@ -33,7 +33,7 @@ - class QDomElement; - class QDomDocument; - --class DomTool : public Qt -+class Q_EXPORT DomTool : public Qt - { - public: - static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ); diff --git a/x11-libs/qt/files/qt-ulibc.patch b/x11-libs/qt/files/qt-ulibc.patch deleted file mode 100644 index f188778e4..000000000 --- a/x11-libs/qt/files/qt-ulibc.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- qt-x11-free-3.3.4.orig/src/tools/qlocale.cpp 2005-01-21 17:16:05.000000000 +0000 -+++ qt-x11-free-3.3.4/src/tools/qlocale.cpp 2005-02-18 13:36:59.000000000 +0000 -@@ -55,6 +55,10 @@ - # undef INFINITY - #endif - -+#if defined(Q_OS_LINUX) && defined(__UCLIBC__) -+# undef Q_OS_LINUX -+#endif -+ - #ifdef Q_OS_LINUX - # include - #endif diff --git a/x11-libs/qt/files/qt-visibility.patch b/x11-libs/qt/files/qt-visibility.patch deleted file mode 100644 index a5246b9ff..000000000 --- a/x11-libs/qt/files/qt-visibility.patch +++ /dev/null @@ -1,159 +0,0 @@ -Index: configure -=================================================================== ---- configure (revision 471775) -+++ configure (working copy) -@@ -1053,6 +1053,7 @@ - [ -d $outpath/src/tools ] || mkdir -p $outpath/src/tools - cat > $outpath/src/tools/qconfig.cpp.new <iface(); \ - } - --# ifdef Q_WS_WIN --# ifdef Q_CC_BOR --# define Q_EXPORT_PLUGIN(PLUGIN) \ -- Q_PLUGIN_VERIFICATION_DATA \ -- Q_EXTERN_C __declspec(dllexport) \ -- const char * __stdcall qt_ucm_query_verification_data() \ -- { return qt_ucm_verification_data; } \ -- Q_EXTERN_C __declspec(dllexport) QUnknownInterface* \ -- __stdcall ucm_instantiate() \ -- Q_PLUGIN_INSTANTIATE( PLUGIN ) --# else --# define Q_EXPORT_PLUGIN(PLUGIN) \ -- Q_PLUGIN_VERIFICATION_DATA \ -- Q_EXTERN_C __declspec(dllexport) \ -- const char *qt_ucm_query_verification_data() \ -- { return qt_ucm_verification_data; } \ -- Q_EXTERN_C __declspec(dllexport) QUnknownInterface* ucm_instantiate() \ -- Q_PLUGIN_INSTANTIATE( PLUGIN ) --# endif --# else --# define Q_EXPORT_PLUGIN(PLUGIN) \ -+#if defined(Q_WS_WIN) && defined(Q_CC_BOR) -+# define Q_STDCALL __stdcall -+#else -+# define Q_STDCALL -+#endif -+ -+#define Q_EXPORT_PLUGIN(PLUGIN) \ - Q_PLUGIN_VERIFICATION_DATA \ -- Q_EXTERN_C \ -- const char *qt_ucm_query_verification_data() \ -+ Q_EXTERN_C Q_EXPORT \ -+ const char * Q_STDCALL qt_ucm_query_verification_data() \ - { return qt_ucm_verification_data; } \ -- Q_EXTERN_C QUnknownInterface* ucm_instantiate() \ -+ Q_EXTERN_C Q_EXPORT QUnknownInterface* Q_STDCALL ucm_instantiate() \ - Q_PLUGIN_INSTANTIATE( PLUGIN ) --# endif -- - #endif - - struct QUnknownInterface; -Index: src/kernel/qapplication_x11.cpp -=================================================================== ---- src/kernel/qapplication_x11.cpp (revision 471775) -+++ src/kernel/qapplication_x11.cpp (working copy) -@@ -314,7 +314,7 @@ - - // flags for extensions for special Languages, currently only for RTL languages - static bool qt_use_rtl_extensions = FALSE; --bool qt_hebrew_keyboard_hack = FALSE; -+Q_EXPORT bool qt_hebrew_keyboard_hack = FALSE; - - static Window mouseActWindow = 0; // window where mouse is - static int mouseButtonPressed = 0; // last mouse button pressed -@@ -3800,7 +3800,7 @@ - } - - --bool qt_try_modal( QWidget *widget, XEvent *event ) -+Q_EXPORT bool qt_try_modal( QWidget *widget, XEvent *event ) - { - if (qt_xdnd_dragging) { - // allow mouse events while DnD is active -Index: src/kernel/qtextengine_p.h -=================================================================== ---- src/kernel/qtextengine_p.h (revision 471775) -+++ src/kernel/qtextengine_p.h (working copy) -@@ -280,7 +280,7 @@ - - class QFontPrivate; - --class QTextEngine { -+class Q_EXPORT QTextEngine { - public: - QTextEngine( const QString &str, QFontPrivate *f ); - ~QTextEngine(); -Index: src/tools/qglobal.h -=================================================================== ---- src/tools/qglobal.h (revision 471775) -+++ src/tools/qglobal.h (working copy) -@@ -865,6 +865,10 @@ - # define Q_TEMPLATE_EXTERN - # undef Q_DISABLE_COPY /* avoid unresolved externals */ - # endif -+#elif defined(Q_CC_GNU) && __GNUC__ - 0 >= 4 -+# define Q_EXPORT __attribute__((visibility("default"))) -+# undef QT_MAKEDLL /* ignore these for other platforms */ -+# undef QT_DLL - #else - # undef QT_MAKEDLL /* ignore these for other platforms */ - # undef QT_DLL -Index: tools/designer/uilib/qwidgetfactory.h -=================================================================== ---- tools/designer/uilib/qwidgetfactory.h (revision 471775) -+++ tools/designer/uilib/qwidgetfactory.h (working copy) -@@ -48,7 +48,7 @@ - class QWidgetFactoryPrivate; - class UibStrTable; - --class QWidgetFactory -+class Q_EXPORT QWidgetFactory - { - public: - QWidgetFactory(); -Index: tools/designer/uilib/qwidgetfactory.cpp -=================================================================== ---- tools/designer/uilib/qwidgetfactory.cpp (revision 471775) -+++ tools/designer/uilib/qwidgetfactory.cpp (working copy) -@@ -113,13 +113,13 @@ - static QMap *availableWidgetMap = 0; - static QStringList *availableWidgetList = 0; - --QMap *qwf_forms = 0; -+Q_EXPORT QMap *qwf_forms = 0; - QString *qwf_language = 0; --bool qwf_execute_code = TRUE; -+Q_EXPORT bool qwf_execute_code = TRUE; - bool qwf_stays_on_top = FALSE; - QString qwf_currFileName = ""; - QObject *qwf_form_object = 0; --QString *qwf_plugin_dir = 0; -+Q_EXPORT QString *qwf_plugin_dir = 0; - - static void setupPluginDir() - { -Index: tools/designer/shared/domtool.h -=================================================================== ---- tools/designer/shared/domtool.h (revision 471775) -+++ tools/designer/shared/domtool.h (working copy) -@@ -33,7 +33,7 @@ - class QDomElement; - class QDomDocument; - --class DomTool : public Qt -+class Q_EXPORT DomTool : public Qt - { - public: - static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ); diff --git a/x11-libs/qt/files/qt-visibility2.patch b/x11-libs/qt/files/qt-visibility2.patch deleted file mode 100644 index 49e17dba2..000000000 --- a/x11-libs/qt/files/qt-visibility2.patch +++ /dev/null @@ -1,172 +0,0 @@ -Index: configure -=================================================================== ---- configure (revision 471775) -+++ configure (working copy) -@@ -1053,6 +1053,7 @@ - [ -d $outpath/src/tools ] || mkdir -p $outpath/src/tools - cat > $outpath/src/tools/qconfig.cpp.new <iface(); \ - } - --# ifdef Q_WS_WIN --# ifdef Q_CC_BOR --# define Q_EXPORT_PLUGIN(PLUGIN) \ -- Q_PLUGIN_VERIFICATION_DATA \ -- Q_EXTERN_C __declspec(dllexport) \ -- const char * __stdcall qt_ucm_query_verification_data() \ -- { return qt_ucm_verification_data; } \ -- Q_EXTERN_C __declspec(dllexport) QUnknownInterface* \ -- __stdcall ucm_instantiate() \ -- Q_PLUGIN_INSTANTIATE( PLUGIN ) --# else --# define Q_EXPORT_PLUGIN(PLUGIN) \ -- Q_PLUGIN_VERIFICATION_DATA \ -- Q_EXTERN_C __declspec(dllexport) \ -- const char *qt_ucm_query_verification_data() \ -- { return qt_ucm_verification_data; } \ -- Q_EXTERN_C __declspec(dllexport) QUnknownInterface* ucm_instantiate() \ -- Q_PLUGIN_INSTANTIATE( PLUGIN ) --# endif --# else --# define Q_EXPORT_PLUGIN(PLUGIN) \ -+#if defined(Q_WS_WIN) && defined(Q_CC_BOR) -+# define Q_STDCALL __stdcall -+#else -+# define Q_STDCALL -+#endif -+ -+#define Q_EXPORT_PLUGIN(PLUGIN) \ - Q_PLUGIN_VERIFICATION_DATA \ -- Q_EXTERN_C \ -- const char *qt_ucm_query_verification_data() \ -+ Q_EXTERN_C Q_EXPORT \ -+ const char * Q_STDCALL qt_ucm_query_verification_data() \ - { return qt_ucm_verification_data; } \ -- Q_EXTERN_C QUnknownInterface* ucm_instantiate() \ -+ Q_EXTERN_C Q_EXPORT QUnknownInterface* Q_STDCALL ucm_instantiate() \ - Q_PLUGIN_INSTANTIATE( PLUGIN ) --# endif -- - #endif - - struct QUnknownInterface; -Index: src/kernel/qapplication_x11.cpp -=================================================================== ---- src/kernel/qapplication_x11.cpp (revision 471775) -+++ src/kernel/qapplication_x11.cpp (working copy) -@@ -314,7 +314,7 @@ - - // flags for extensions for special Languages, currently only for RTL languages - static bool qt_use_rtl_extensions = FALSE; --bool qt_hebrew_keyboard_hack = FALSE; -+Q_EXPORT bool qt_hebrew_keyboard_hack = FALSE; - - static Window mouseActWindow = 0; // window where mouse is - static int mouseButtonPressed = 0; // last mouse button pressed -@@ -3800,7 +3800,7 @@ - } - - --bool qt_try_modal( QWidget *widget, XEvent *event ) -+Q_EXPORT bool qt_try_modal( QWidget *widget, XEvent *event ) - { - if (qt_xdnd_dragging) { - // allow mouse events while DnD is active -Index: src/kernel/qtextengine_p.h -=================================================================== ---- src/kernel/qtextengine_p.h (revision 471775) -+++ src/kernel/qtextengine_p.h (working copy) -@@ -280,7 +280,7 @@ - - class QFontPrivate; - --class QTextEngine { -+class Q_EXPORT QTextEngine { - public: - QTextEngine( const QString &str, QFontPrivate *f ); - ~QTextEngine(); -Index: src/tools/qglobal.h -=================================================================== ---- src/tools/qglobal.h (revision 471775) -+++ src/tools/qglobal.h (working copy) -@@ -865,6 +865,10 @@ - # define Q_TEMPLATE_EXTERN - # undef Q_DISABLE_COPY /* avoid unresolved externals */ - # endif -+#elif defined(Q_CC_GNU) && __GNUC__ - 0 >= 4 -+# define Q_EXPORT __attribute__((visibility("default"))) -+# undef QT_MAKEDLL /* ignore these for other platforms */ -+# undef QT_DLL - #else - # undef QT_MAKEDLL /* ignore these for other platforms */ - # undef QT_DLL -Index: tools/designer/uilib/qwidgetfactory.h -=================================================================== ---- tools/designer/uilib/qwidgetfactory.h (revision 471775) -+++ tools/designer/uilib/qwidgetfactory.h (working copy) -@@ -48,7 +48,7 @@ - class QWidgetFactoryPrivate; - class UibStrTable; - --class QWidgetFactory -+class Q_EXPORT QWidgetFactory - { - public: - QWidgetFactory(); -Index: tools/designer/uilib/qwidgetfactory.cpp -=================================================================== ---- tools/designer/uilib/qwidgetfactory.cpp (revision 471775) -+++ tools/designer/uilib/qwidgetfactory.cpp (working copy) -@@ -113,13 +113,13 @@ - static QMap *availableWidgetMap = 0; - static QStringList *availableWidgetList = 0; - --QMap *qwf_forms = 0; -+Q_EXPORT QMap *qwf_forms = 0; - QString *qwf_language = 0; --bool qwf_execute_code = TRUE; -+Q_EXPORT bool qwf_execute_code = TRUE; - bool qwf_stays_on_top = FALSE; - QString qwf_currFileName = ""; - QObject *qwf_form_object = 0; --QString *qwf_plugin_dir = 0; -+Q_EXPORT QString *qwf_plugin_dir = 0; - - static void setupPluginDir() - { -Index: tools/designer/shared/domtool.h -=================================================================== ---- tools/designer/shared/domtool.h (revision 471775) -+++ tools/designer/shared/domtool.h (working copy) -@@ -33,7 +33,7 @@ - class QDomElement; - class QDomDocument; - --class DomTool : public Qt -+class Q_EXPORT DomTool : public Qt - { - public: - static QVariant readProperty( const QDomElement& e, const QString& name, const QVariant& defValue ); -Index: mkspecs/linux-g++/qmake.conf -=================================================================== ---- mkspecs/linux-g++/qmake.conf (revision 471775) -+++ mkspecs/linux-g++/qmake.conf (working copy) -@@ -17,7 +17,7 @@ - QMAKE_YACCFLAGS_MANGLE = -p $base -b $base - QMAKE_YACC_HEADER = $base.tab.h - QMAKE_YACC_SOURCE = $base.tab.c --QMAKE_CFLAGS = -pipe -+QMAKE_CFLAGS = -pipe -fvisibility=hidden -fvisibility-inlines-hidden - QMAKE_CFLAGS_DEPS = -M - QMAKE_CFLAGS_WARN_ON = -Wall -W - QMAKE_CFLAGS_WARN_OFF = -w diff --git a/x11-libs/qt/qt-3.3.6-r3.ebuild b/x11-libs/qt/qt-3.3.6-r3.ebuild deleted file mode 100644 index db17b4510..000000000 --- a/x11-libs/qt/qt-3.3.6-r3.ebuild +++ /dev/null @@ -1,383 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit eutils flag-o-matic toolchain-funcs - -QT_COPY_SNAP="20060605" -SRCTYPE="free" -DESCRIPTION="The Qt toolkit is a comprehensive C++ application development framework." -HOMEPAGE="http://www.trolltech.com/" - -IMMQT_P="qt-x11-immodule-unified-qt3.3.6-20060317-gentoo" - -SRC_URI="ftp://ftp.trolltech.com/qt/source/qt-x11-${SRCTYPE}-${PV}.tar.bz2 - http://snigel.no-ip.com/~nxsty/linux/qt-x11-${SRCTYPE}-qt-copy-${QT_COPY_SNAP}-${PV}.patch.bz2 - immqt? ( mirror://gentoo/${IMMQT_P}.diff.bz2 ) - immqt-bc? ( mirror://gentoo/${IMMQT_P}.diff.bz2 )" -LICENSE="|| ( QPL-1.0 GPL-2 )" - -SLOT="3" -KEYWORDS="alpha amd64 hppa ~ia64 ~mips ppc ~ppc-macos ppc64 sparc x86 ~x86-fbsd" -IUSE="cups debug doc examples firebird gif ipv6 mysql nas nis odbc opengl postgres sqlite xinerama immqt immqt-bc risky pertty" - -DEPEND="|| ( ( x11-libs/libXcursor - x11-libs/libXi - x11-libs/libXrandr - x11-libs/libSM - x11-proto/inputproto - x11-proto/xextproto - xinerama? ( x11-proto/xineramaproto x11-libs/libXinerama ) - - ) - virtual/x11 - ) - virtual/xft - media-libs/libpng - media-libs/jpeg - media-libs/libmng - >=media-libs/freetype-2 - >=sys-devel/gcc-3.4.4 - sys-libs/zlib - nas? ( >=media-libs/nas-1.5 ) - mysql? ( dev-db/mysql ) - firebird? ( dev-db/firebird ) - opengl? ( virtual/opengl virtual/glu ) - postgres? ( dev-db/postgresql ) - cups? ( net-print/cups )" -PDEPEND="odbc? ( ~dev-db/qt-unixODBC-$PV )" - -S=${WORKDIR}/qt-x11-${SRCTYPE}-${PV} - -QTBASE=/usr/qt/3 - -pkg_setup() { - if use immqt && use immqt-bc ; then - ewarn - ewarn "immqt and immqt-bc are exclusive. You cannot set both." - ewarn "Please specify either immqt or immqt-bc." - ewarn - die - elif use immqt ; then - ewarn - ewarn "You are going to compile binary imcompatible immodule for Qt. This means" - ewarn "you have to recompile everything depending on Qt after you install it." - ewarn "Be aware." - ewarn - fi - - export QTDIR=${S} - - CXX=$(tc-getCXX) - if [[ ${CXX/g++/} != ${CXX} ]]; then - PLATCXX="g++" - elif [[ ${CXX/icc/} != ${CXX} ]]; then - PLATCXX="icc" - else - die "Unknown compiler ${CXX}." - fi - - case ${CHOST} in - *-freebsd*|*-dragonfly*) - PLATNAME="freebsd" ;; - *-openbsd*) - PLATNAME="openbsd" ;; - *-netbsd*) - PLATNAME="netbsd" ;; - *-darwin*) - PLATNAME="darwin" ;; - *-linux-*|*-linux) - PLATNAME="linux" ;; - *) - die "Unknown CHOST, no platform choosed." - esac - - # probably this should be '*-64' for 64bit archs - # in a fully multilib environment (no compatibility symlinks) - export PLATFORM="${PLATNAME}-${PLATCXX}" -} - -src_unpack() { - unpack ${A} - cd ${S} - - sed -i -e 's:read acceptance:acceptance=yes:' configure - - # Apply the qt-copy stuff - epatch "${DISTDIR}"/qt-x11-${SRCTYPE}-qt-copy-${QT_COPY_SNAP}-${PV}.patch.bz2 - sh apply_patches - make -f Makefile.cvs || die - - # Do not link with -rpath. See bug #75181. - find ${S}/mkspecs -name qmake.conf | xargs \ - sed -i -e 's:QMAKE_RPATH.*:QMAKE_RPATH =:' - - # Patch for uic includehint errors (aseigo patch) - epatch ${FILESDIR}/${P}-uic-fix.patch - - use pertty && epatch ${FILESDIR}/qt-3.3.5-pertty.patch - - if use risky ; then - epatch ${FILESDIR}/qt-visibility2.patch - else - epatch ${FILESDIR}/qt-visibility.patch - fi - - # ulibc patch (bug #100246) - epatch ${FILESDIR}/qt-ulibc.patch - - ## bug #151838 - #epatch "${FILESDIR}/${P}-CVE-2006-4811.patch" - - if use immqt || use immqt-bc ; then - epatch ../${IMMQT_P}.diff - sh make-symlinks.sh || die "make symlinks failed" - fi - - if use ppc-macos ; then - epatch "${FILESDIR}/${PN}-3.3.5-macos.patch" - fi - - # known working flags wrt #77623 - use sparc && export CFLAGS="-O1" && export CXXFLAGS="${CFLAGS}" - # set c/xxflags and ldflags - strip-flags - append-flags -fno-strict-aliasing - sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ - -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ - -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \ - -e "s:\.*=.*:QMAKE_CC=$(tc-getCC):" \ - -e "s:\.*=.*:QMAKE_CXX=$(tc-getCXX):" \ - -e "s:\.*=.*:QMAKE_LINK=$(tc-getCXX):" \ - -e "s:\.*=.*:QMAKE_LINK_SHLIB=$(tc-getCXX):" \ - ${S}/mkspecs/${PLATFORM}/qmake.conf || die - - if [ $(get_libdir) != "lib" ] ; then - sed -i -e "s:/lib$:/$(get_libdir):" \ - ${S}/mkspecs/${PLATFORM}/qmake.conf || die - fi -} - -src_compile() { - export SYSCONF=${D}${QTBASE}/etc/settings - - # Let's just allow writing to these directories during Qt emerge - # as it makes Qt much happier. - addwrite "${QTBASE}/etc/settings" - addwrite "${HOME}/.qt" - - [ $(get_libdir) != "lib" ] && myconf="${myconf} -L/usr/$(get_libdir)" - - # unixODBC support is now a PDEPEND on dev-db/qt-unixODBC; see bug 14178. - use nas && myconf="${myconf} -system-nas-sound" - use nis && myconf="${myconf} -nis" || myconf="${myconf} -no-nis" - use gif && myconf="${myconf} -qt-gif" || myconf="${myconf} -no-gif" - use mysql && myconf="${myconf} -plugin-sql-mysql -I/usr/include/mysql -L/usr/$(get_libdir)/mysql" || myconf="${myconf} -no-sql-mysql" - use postgres && myconf="${myconf} -plugin-sql-psql -I/usr/include/postgresql/server -I/usr/include/postgresql/pgsql -I/usr/include/postgresql/pgsql/server" || myconf="${myconf} -no-sql-psql" - use firebird && myconf="${myconf} -plugin-sql-ibase" || myconf="${myconf} -no-sql-ibase" - use sqlite && myconf="${myconf} -plugin-sql-sqlite" || myconf="${myconf} -no-sql-sqlite" - use cups && myconf="${myconf} -cups" || myconf="${myconf} -no-cups" - use opengl && myconf="${myconf} -enable-module=opengl" || myconf="${myconf} -disable-opengl" - use debug && myconf="${myconf} -debug" || myconf="${myconf} -release -no-g++-exceptions" - use xinerama && myconf="${myconf} -xinerama" || myconf="${myconf} -no-xinerama" - - myconf="${myconf} -system-zlib" - - use ipv6 && myconf="${myconf} -ipv6" || myconf="${myconf} -no-ipv6" - use immqt-bc && myconf="${myconf} -inputmethod" - use immqt && myconf="${myconf} -inputmethod -inputmethod-ext" - - if use ppc-macos ; then - myconf="${myconf} -no-sql-ibase -no-sql-mysql -no-sql-psql -no-cups -lresolv -shared" - myconf="${myconf} -I/usr/X11R6/include -L/usr/X11R6/lib" - myconf="${myconf} -L${S}/lib -I${S}/include" - sed -i -e "s,#define QT_AOUT_UNDERSCORE,," mkspecs/${PLATFORM}/qplatformdefs.h || die - fi - - export YACC='byacc -d' - tc-export CC CXX - export LINK="$(tc-getCXX)" - - ./configure -sm -thread -stl -system-libjpeg -verbose -largefile \ - -qt-imgfmt-{jpeg,mng,png} -tablet -system-libmng \ - -system-libpng -xft -platform ${PLATFORM} -xplatform \ - ${PLATFORM} -xrender -prefix ${QTBASE} -libdir ${QTBASE}/$(get_libdir) \ - -fast -no-sql-odbc ${myconf} -dlopen-opengl || die - - emake src-qmake src-moc sub-src || die - - export DYLD_LIBRARY_PATH="${S}/lib:/usr/X11R6/lib:${DYLD_LIBRARY_PATH}" - export LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" - - emake sub-tools || die - - if use examples; then - emake sub-tutorial sub-examples || die - fi - - # Make the msg2qm utility (not made by default) - cd ${S}/tools/msg2qm - ../../bin/qmake - emake - - # Make the qembed utility (not made by default) - cd ${S}/tools/qembed - ../../bin/qmake - emake - -} - -src_install() { - # binaries - into ${QTBASE} - dobin bin/* - dobin tools/msg2qm/msg2qm - dobin tools/qembed/qembed - - # libraries - if use ppc-macos; then - # dolib is broken on BSD because of missing readlink(1) - dodir ${QTBASE}/$(get_libdir) - cp -fR lib/*.{dylib,la,a} ${D}/${QTBASE}/$(get_libdir) || die - - cd ${D}/${QTBASE}/$(get_libdir) - for lib in libqt-mt* ; do - ln -s ${lib} ${lib/-mt/} - done - else - dolib.so lib/lib{editor,qassistantclient,designercore}.a - dolib.so lib/libqt-mt.la - dolib.so lib/libqt-mt.so.${PV} lib/libqui.so.1.0.0 - cd ${D}/${QTBASE}/$(get_libdir) - - for x in libqui.so ; do - ln -s $x.1.0.0 $x.1.0 - ln -s $x.1.0 $x.1 - ln -s $x.1 $x - done - - # version symlinks - 3.3.5->3.3->3->.so - ln -s libqt-mt.so.${PV} libqt-mt.so.3.3 - ln -s libqt-mt.so.3.3 libqt-mt.so.3 - ln -s libqt-mt.so.3 libqt-mt.so - - # libqt -> libqt-mt symlinks - ln -s libqt-mt.so.${PV} libqt.so.${PV} - ln -s libqt-mt.so.3.3 libqt.so.3.3 - ln -s libqt-mt.so.3 libqt.so.3 - ln -s libqt-mt.so libqt.so - fi - - # plugins - cd ${S} - local plugins=$(find plugins -name "lib*.so" -print) - for x in ${plugins}; do - exeinto ${QTBASE}/$(dirname ${x}) - doexe ${x} - done - - # Past this point just needs to be done once - is_final_abi || return 0 - - # includes - cd ${S} - dodir ${QTBASE}/include/private - cp include/* ${D}/${QTBASE}/include/ - cp include/private/* ${D}/${QTBASE}/include/private/ - - # prl files - sed -i -e "s:${S}:${QTBASE}:g" ${S}/lib/*.prl - insinto ${QTBASE}/$(get_libdir) - doins ${S}/lib/*.prl - - # pkg-config file - insinto ${QTBASE}/$(get_libdir)/pkgconfig - doins ${S}/lib/*.pc - - # List all the multilib libdirs - local libdirs - for libdir in $(get_all_libdirs); do - libdirs="${libdirs}:${QTBASE}/${libdir}" - done - - # environment variables - if use ppc-macos; then - cat < ${T}/45qt3 -PATH=${QTBASE}/bin -ROOTPATH=${QTBASE}/bin -DYLD_LIBRARY_PATH=${libdirs:1} -QMAKESPEC=${PLATFORM} -MANPATH=${QTBASE}/doc/man -EOF - else - cat < ${T}/45qt3 -PATH=${QTBASE}/bin -ROOTPATH=${QTBASE}/bin -LDPATH=${libdirs:1} -QMAKESPEC=${PLATFORM} -MANPATH=${QTBASE}/doc/man -EOF - fi - cat < ${T}/50qtdir3 -QTDIR=${QTBASE} -EOF - - cat < ${T}/50-qt3-revdep -SEARCH_DIRS="${QTBASE}" -EOF - - insinto /etc/revdep-rebuild - doins ${T}/50-qt3-revdep - - insinto /etc/env.d - doins ${T}/45qt3 ${T}/50qtdir3 - - if [ "${SYMLINK_LIB}" = "yes" ]; then - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) ${QTBASE}/lib - fi - - insinto ${QTBASE}/tools/designer - doins -r tools/designer/templates - - insinto ${QTBASE} - doins -r translations - - keepdir ${QTBASE}/etc/settings - - if use doc; then - insinto ${QTBASE} - doins -r ${S}/doc - fi - - if use examples; then - find ${S}/examples ${S}/tutorial -name Makefile | \ - xargs sed -i -e "s:${S}:${QTBASE}:g" - - cp -r ${S}/examples ${D}${QTBASE}/ - cp -r ${S}/tutorial ${D}${QTBASE}/ - fi - - # misc build reqs - insinto ${QTBASE}/mkspecs - doins -r ${S}/mkspecs/${PLATFORM} - - sed -e "s:${S}:${QTBASE}:g" \ - ${S}/.qmake.cache > ${D}${QTBASE}/.qmake.cache - - dodoc FAQ README README-QT.TXT changes* - if use immqt || use immqt-bc ; then - dodoc ${S}/README.immodule - fi -} - -pkg_postinst() { - echo - einfo "After a rebuild of Qt, it can happen that Qt plugins (such as Qt/KDE styles," - einfo "or widgets for the Qt designer) are no longer recognized. If this situation" - einfo "occurs you should recompile the packages providing these plugins," - einfo "and you should also make sure that Qt and its plugins were compiled with the" - einfo "same version of gcc. Packages that may need to be rebuilt are, for instance," - einfo "kde-base/kdelibs, kde-base/kdeartwork and kde-base/kdeartwork-styles." - einfo "See http://doc.trolltech.com/3.3/plugins-howto.html for more infos." - echo -} diff --git a/x11-libs/qt/qt-3.3.6-r4.ebuild b/x11-libs/qt/qt-3.3.6-r4.ebuild deleted file mode 100644 index 05673720e..000000000 --- a/x11-libs/qt/qt-3.3.6-r4.ebuild +++ /dev/null @@ -1,385 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit eutils flag-o-matic toolchain-funcs - -QT_COPY_SNAP="20060605" -SRCTYPE="free" -DESCRIPTION="The Qt toolkit is a comprehensive C++ application development framework." -HOMEPAGE="http://www.trolltech.com/" - -IMMQT_P="qt-x11-immodule-unified-qt3.3.6-20060317-gentoo" - -SRC_URI="ftp://ftp.trolltech.com/qt/source/qt-x11-${SRCTYPE}-${PV}.tar.bz2 - http://snigel.no-ip.com/~nxsty/linux/qt-x11-${SRCTYPE}-qt-copy-${QT_COPY_SNAP}-${PV}.patch.bz2 - immqt? ( mirror://gentoo/${IMMQT_P}.diff.bz2 ) - immqt-bc? ( mirror://gentoo/${IMMQT_P}.diff.bz2 )" -LICENSE="|| ( QPL-1.0 GPL-2 )" - -SLOT="3" -KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc-macos ~ppc64 ~sparc ~x86 ~x86-fbsd" -IUSE="cups debug doc examples firebird gif ipv6 mysql nas nis odbc opengl postgres sqlite xinerama immqt immqt-bc risky pertty" - -DEPEND="|| ( ( x11-libs/libXcursor - x11-libs/libXi - x11-libs/libXrandr - x11-libs/libSM - x11-proto/inputproto - x11-proto/xextproto - xinerama? ( x11-proto/xineramaproto x11-libs/libXinerama ) - - ) - =media-libs/libmng-1.0.9 - >=media-libs/freetype-2 - >=sys-devel/gcc-3.4.4 - sys-libs/zlib - nas? ( >=media-libs/nas-1.5 ) - mysql? ( dev-db/mysql ) - firebird? ( dev-db/firebird ) - opengl? ( virtual/opengl virtual/glu ) - postgres? ( dev-db/postgresql ) - cups? ( net-print/cups )" -PDEPEND="odbc? ( ~dev-db/qt-unixODBC-$PV )" - -S=${WORKDIR}/qt-x11-${SRCTYPE}-${PV} - -QTBASE=/usr/qt/3 - -pkg_setup() { - if use immqt && use immqt-bc ; then - ewarn - ewarn "immqt and immqt-bc are exclusive. You cannot set both." - ewarn "Please specify either immqt or immqt-bc." - ewarn - die - elif use immqt ; then - ewarn - ewarn "You are going to compile binary imcompatible immodule for Qt. This means" - ewarn "you have to recompile everything depending on Qt after you install it." - ewarn "Be aware." - ewarn - fi - - export QTDIR=${S} - - CXX=$(tc-getCXX) - if [[ ${CXX/g++/} != ${CXX} ]]; then - PLATCXX="g++" - elif [[ ${CXX/icc/} != ${CXX} ]]; then - PLATCXX="icpc" - else - die "Unknown compiler ${CXX}." - fi - - case ${CHOST} in - *-freebsd*|*-dragonfly*) - PLATNAME="freebsd" ;; - *-openbsd*) - PLATNAME="openbsd" ;; - *-netbsd*) - PLATNAME="netbsd" ;; - *-darwin*) - PLATNAME="darwin" ;; - *-linux-*|*-linux) - PLATNAME="linux" ;; - *) - die "Unknown CHOST, no platform choosed." - esac - - # probably this should be '*-64' for 64bit archs - # in a fully multilib environment (no compatibility symlinks) - export PLATFORM="${PLATNAME}-${PLATCXX}" -} - -src_unpack() { - unpack ${A} - cd ${S} - - sed -i -e 's:read acceptance:acceptance=yes:' configure - - # Apply the qt-copy stuff - epatch "${DISTDIR}"/qt-x11-${SRCTYPE}-qt-copy-${QT_COPY_SNAP}-${PV}.patch.bz2 - sh apply_patches - make -f Makefile.cvs || die - - # Do not link with -rpath. See bug #75181. - find ${S}/mkspecs -name qmake.conf | xargs \ - sed -i -e 's:QMAKE_RPATH.*:QMAKE_RPATH =:' - - # Patch for uic includehint errors (aseigo patch) - epatch ${FILESDIR}/${P}-uic-fix.patch - - use pertty && epatch ${FILESDIR}/qt-3.3.5-pertty.patch - - if use risky ; then - epatch ${FILESDIR}/qt-visibility2.patch - else - epatch ${FILESDIR}/qt-visibility.patch - fi - - # ulibc patch (bug #100246) - epatch ${FILESDIR}/qt-ulibc.patch - - # bug #151838 - epatch "${FILESDIR}/${P}-CVE-2006-4811-bis.patch" - - if use immqt || use immqt-bc ; then - epatch ../${IMMQT_P}.diff - sh make-symlinks.sh || die "make symlinks failed" - fi - - if use ppc-macos ; then - epatch "${FILESDIR}/${PN}-3.3.5-macos.patch" - fi - - # known working flags wrt #77623 - use sparc && export CFLAGS="-O1" && export CXXFLAGS="${CFLAGS}" - # set c/xxflags and ldflags - strip-flags - append-flags -fno-strict-aliasing - sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ - -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ - -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \ - -e "s:\.*=.*:QMAKE_CC=$(tc-getCC):" \ - -e "s:\.*=.*:QMAKE_CXX=$(tc-getCXX):" \ - -e "s:\.*=.*:QMAKE_LINK=$(tc-getCXX):" \ - -e "s:\.*=.*:QMAKE_LINK_SHLIB=$(tc-getCXX):" \ - ${S}/mkspecs/${PLATFORM}/qmake.conf || die - - if [ $(get_libdir) != "lib" ] ; then - sed -i -e "s:/lib$:/$(get_libdir):" \ - ${S}/mkspecs/${PLATFORM}/qmake.conf || die - fi -} - -src_compile() { - export SYSCONF=${D}${QTBASE}/etc/settings - - # Let's just allow writing to these directories during Qt emerge - # as it makes Qt much happier. - addwrite "${QTBASE}/etc/settings" - addwrite "${HOME}/.qt" - - [ $(get_libdir) != "lib" ] && myconf="${myconf} -L/usr/$(get_libdir)" - - # unixODBC support is now a PDEPEND on dev-db/qt-unixODBC; see bug 14178. - use nas && myconf="${myconf} -system-nas-sound" - use nis && myconf="${myconf} -nis" || myconf="${myconf} -no-nis" - use gif && myconf="${myconf} -qt-gif" || myconf="${myconf} -no-gif" - use mysql && myconf="${myconf} -plugin-sql-mysql -I/usr/include/mysql -L/usr/$(get_libdir)/mysql" || myconf="${myconf} -no-sql-mysql" - use postgres && myconf="${myconf} -plugin-sql-psql -I/usr/include/postgresql/server -I/usr/include/postgresql/pgsql -I/usr/include/postgresql/pgsql/server" || myconf="${myconf} -no-sql-psql" - use firebird && myconf="${myconf} -plugin-sql-ibase" || myconf="${myconf} -no-sql-ibase" - use sqlite && myconf="${myconf} -plugin-sql-sqlite" || myconf="${myconf} -no-sql-sqlite" - use cups && myconf="${myconf} -cups" || myconf="${myconf} -no-cups" - use opengl && myconf="${myconf} -enable-module=opengl" || myconf="${myconf} -disable-opengl" - use debug && myconf="${myconf} -debug" || myconf="${myconf} -release -no-g++-exceptions" - use xinerama && myconf="${myconf} -xinerama" || myconf="${myconf} -no-xinerama" - - myconf="${myconf} -system-zlib" - - use ipv6 && myconf="${myconf} -ipv6" || myconf="${myconf} -no-ipv6" - use immqt-bc && myconf="${myconf} -inputmethod" - use immqt && myconf="${myconf} -inputmethod -inputmethod-ext" - - if use ppc-macos ; then - myconf="${myconf} -no-sql-ibase -no-sql-mysql -no-sql-psql -no-cups -lresolv -shared" - myconf="${myconf} -I/usr/X11R6/include -L/usr/X11R6/lib" - myconf="${myconf} -L${S}/lib -I${S}/include" - sed -i -e "s,#define QT_AOUT_UNDERSCORE,," mkspecs/${PLATFORM}/qplatformdefs.h || die - fi - - export YACC='byacc -d' - tc-export CC CXX - export LINK="$(tc-getCXX)" - - ./configure -sm -thread -stl -system-libjpeg -verbose -largefile \ - -qt-imgfmt-{jpeg,mng,png} -tablet -system-libmng \ - -system-libpng -xft -platform ${PLATFORM} -xplatform \ - ${PLATFORM} -xrender -prefix ${QTBASE} -libdir ${QTBASE}/$(get_libdir) \ - -fast -no-sql-odbc ${myconf} -dlopen-opengl || die - - emake src-qmake src-moc sub-src || die - - export DYLD_LIBRARY_PATH="${S}/lib:/usr/X11R6/lib:${DYLD_LIBRARY_PATH}" - export LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" - - emake sub-tools || die - - if use examples; then - emake sub-tutorial sub-examples || die - fi - - # Make the msg2qm utility (not made by default) - cd ${S}/tools/msg2qm - ../../bin/qmake - emake - - # Make the qembed utility (not made by default) - cd ${S}/tools/qembed - ../../bin/qmake - emake - -} - -src_install() { - # binaries - into ${QTBASE} - dobin bin/* - dobin tools/msg2qm/msg2qm - dobin tools/qembed/qembed - - # libraries - if use ppc-macos; then - # dolib is broken on BSD because of missing readlink(1) - dodir ${QTBASE}/$(get_libdir) - cp -fR lib/*.{dylib,la,a} ${D}/${QTBASE}/$(get_libdir) || die - - cd ${D}/${QTBASE}/$(get_libdir) - for lib in libqt-mt* ; do - ln -s ${lib} ${lib/-mt/} - done - else - dolib.so lib/lib{editor,qassistantclient,designercore}.a - dolib.so lib/libqt-mt.la - dolib.so lib/libqt-mt.so.${PV} lib/libqui.so.1.0.0 - cd ${D}/${QTBASE}/$(get_libdir) - - for x in libqui.so ; do - ln -s $x.1.0.0 $x.1.0 - ln -s $x.1.0 $x.1 - ln -s $x.1 $x - done - - # version symlinks - 3.3.5->3.3->3->.so - ln -s libqt-mt.so.${PV} libqt-mt.so.3.3 - ln -s libqt-mt.so.3.3 libqt-mt.so.3 - ln -s libqt-mt.so.3 libqt-mt.so - - # libqt -> libqt-mt symlinks - ln -s libqt-mt.so.${PV} libqt.so.${PV} - ln -s libqt-mt.so.3.3 libqt.so.3.3 - ln -s libqt-mt.so.3 libqt.so.3 - ln -s libqt-mt.so libqt.so - fi - - # plugins - cd ${S} - local plugins=$(find plugins -name "lib*.so" -print) - for x in ${plugins}; do - exeinto ${QTBASE}/$(dirname ${x}) - doexe ${x} - done - - # Past this point just needs to be done once - is_final_abi || return 0 - - # includes - cd ${S} - dodir ${QTBASE}/include/private - cp include/* ${D}/${QTBASE}/include/ - cp include/private/* ${D}/${QTBASE}/include/private/ - - # prl files - sed -i -e "s:${S}:${QTBASE}:g" ${S}/lib/*.prl - insinto ${QTBASE}/$(get_libdir) - doins ${S}/lib/*.prl - - # pkg-config file - insinto ${QTBASE}/$(get_libdir)/pkgconfig - doins ${S}/lib/*.pc - - # List all the multilib libdirs - local libdirs - for libdir in $(get_all_libdirs); do - libdirs="${libdirs}:${QTBASE}/${libdir}" - done - - # environment variables - if use ppc-macos; then - cat < ${T}/45qt3 -PATH=${QTBASE}/bin -ROOTPATH=${QTBASE}/bin -DYLD_LIBRARY_PATH=${libdirs:1} -QMAKESPEC=${PLATFORM} -MANPATH=${QTBASE}/doc/man -PKG_CONFIG_PATH=${QTBASE}/$(get_libdir)/pkgconfig -EOF - else - cat < ${T}/45qt3 -PATH=${QTBASE}/bin -ROOTPATH=${QTBASE}/bin -LDPATH=${libdirs:1} -QMAKESPEC=${PLATFORM} -MANPATH=${QTBASE}/doc/man -PKG_CONFIG_PATH=${QTBASE}/$(get_libdir)/pkgconfig -EOF - fi - cat < ${T}/50qtdir3 -QTDIR=${QTBASE} -EOF - - cat < ${T}/50-qt3-revdep -SEARCH_DIRS="${QTBASE}" -EOF - - insinto /etc/revdep-rebuild - doins ${T}/50-qt3-revdep - - insinto /etc/env.d - doins ${T}/45qt3 ${T}/50qtdir3 - - if [ "${SYMLINK_LIB}" = "yes" ]; then - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) ${QTBASE}/lib - fi - - insinto ${QTBASE}/tools/designer - doins -r tools/designer/templates - - insinto ${QTBASE} - doins -r translations - - keepdir ${QTBASE}/etc/settings - - if use doc; then - insinto ${QTBASE} - doins -r ${S}/doc - fi - - if use examples; then - find ${S}/examples ${S}/tutorial -name Makefile | \ - xargs sed -i -e "s:${S}:${QTBASE}:g" - - cp -r ${S}/examples ${D}${QTBASE}/ - cp -r ${S}/tutorial ${D}${QTBASE}/ - fi - - # misc build reqs - insinto ${QTBASE}/mkspecs - doins -r ${S}/mkspecs/${PLATFORM} - - sed -e "s:${S}:${QTBASE}:g" \ - ${S}/.qmake.cache > ${D}${QTBASE}/.qmake.cache - - dodoc FAQ README README-QT.TXT changes* - if use immqt || use immqt-bc ; then - dodoc ${S}/README.immodule - fi -} - -pkg_postinst() { - echo - einfo "After a rebuild of Qt, it can happen that Qt plugins (such as Qt/KDE styles," - einfo "or widgets for the Qt designer) are no longer recognized. If this situation" - einfo "occurs you should recompile the packages providing these plugins," - einfo "and you should also make sure that Qt and its plugins were compiled with the" - einfo "same version of gcc. Packages that may need to be rebuilt are, for instance," - einfo "kde-base/kdelibs, kde-base/kdeartwork and kde-base/kdeartwork-styles." - einfo "See http://doc.trolltech.com/3.3/plugins-howto.html for more infos." - echo -} diff --git a/x11-libs/qt/qt-3.3.6-r5.ebuild b/x11-libs/qt/qt-3.3.6-r5.ebuild deleted file mode 100644 index 1ee5652d8..000000000 --- a/x11-libs/qt/qt-3.3.6-r5.ebuild +++ /dev/null @@ -1,393 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt/qt-3.3.6-r5.ebuild,v 1.2 2006/11/24 15:05:24 flameeyes Exp $ - -inherit eutils flag-o-matic toolchain-funcs - -SRCTYPE="free" -DESCRIPTION="The Qt toolkit is a comprehensive C++ application development framework." -HOMEPAGE="http://www.trolltech.com/" - -QT_COPY_SNAP="20060605" - -IMMQT_P="qt-x11-immodule-unified-qt3.3.6-20060317-gentoo" - -SRC_URI="ftp://ftp.trolltech.com/qt/source/qt-x11-${SRCTYPE}-${PV}.tar.bz2 - http://snigel.no-ip.com/~nxsty/linux/qt-x11-${SRCTYPE}-qt-copy-${QT_COPY_SNAP}-${PV}.patch.bz2 - immqt? ( mirror://gentoo/${IMMQT_P}.diff.bz2 ) - immqt-bc? ( mirror://gentoo/${IMMQT_P}.diff.bz2 )" -LICENSE="|| ( QPL-1.0 GPL-2 )" - -SLOT="3" -KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc-macos ~ppc64 ~sparc ~x86 ~x86-fbsd" -IUSE="cups debug doc examples firebird gif ipv6 mysql nas nis odbc opengl pertty postgres sqlite xinerama immqt immqt-bc" - -DEPEND="|| ( ( x11-libs/libXcursor - x11-libs/libXi - x11-libs/libXrandr - x11-libs/libSM - x11-proto/inputproto - x11-proto/xextproto - xinerama? ( x11-proto/xineramaproto x11-libs/libXinerama ) - - ) - =media-libs/libmng-1.0.9 - >=media-libs/freetype-2 - sys-libs/zlib - nas? ( >=media-libs/nas-1.5 ) - mysql? ( virtual/mysql ) - firebird? ( dev-db/firebird ) - opengl? ( virtual/opengl virtual/glu ) - postgres? ( dev-db/postgresql ) - cups? ( net-print/cups )" -PDEPEND="odbc? ( ~dev-db/qt-unixODBC-$PV )" - -S=${WORKDIR}/qt-x11-${SRCTYPE}-${PV} - -QTBASE=/usr/qt/3 - -pkg_setup() { - if use immqt && use immqt-bc ; then - ewarn - ewarn "immqt and immqt-bc are exclusive. You cannot set both." - ewarn "Please specify either immqt or immqt-bc." - ewarn - die - elif use immqt ; then - ewarn - ewarn "You are going to compile binary imcompatible immodule for Qt. This means" - ewarn "you have to recompile everything depending on Qt after you install it." - ewarn "Be aware." - ewarn - fi - - export QTDIR=${S} - - CXX=$(tc-getCXX) - if [[ ${CXX/g++/} != ${CXX} ]]; then - PLATCXX="g++" - elif [[ ${CXX/icpc/} != ${CXX} ]]; then - PLATCXX="icc" - else - die "Unknown compiler ${CXX}." - fi - - case ${CHOST} in - *-freebsd*|*-dragonfly*) - PLATNAME="freebsd" ;; - *-openbsd*) - PLATNAME="openbsd" ;; - *-netbsd*) - PLATNAME="netbsd" ;; - *-darwin*) - PLATNAME="darwin" ;; - *-linux-*|*-linux) - PLATNAME="linux" ;; - *) - die "Unknown CHOST, no platform choosed." - esac - - # probably this should be '*-64' for 64bit archs - # in a fully multilib environment (no compatibility symlinks) - export PLATFORM="${PLATNAME}-${PLATCXX}" -} - -src_unpack() { - unpack ${A} - cd ${S} - - sed -i -e 's:read acceptance:acceptance=yes:' configure - - # Apply the qt-copy stuff - epatch "${DISTDIR}"/qt-x11-${SRCTYPE}-qt-copy-${QT_COPY_SNAP}-${PV}.patch.bz2 - - # Do not link with -rpath. See bug #75181. - find ${S}/mkspecs -name qmake.conf | xargs \ - sed -i -e 's:QMAKE_RPATH.*:QMAKE_RPATH =:' - - # Patch for uic includehint errors (aseigo patch) - epatch ${FILESDIR}/${P}-uic-fix.patch - - use pertty && epatch ${FILESDIR}/qt-3.3.5-pertty.patch - - # KDE related patches - epatch ${FILESDIR}/0001-dnd_optimization.patch - epatch ${FILESDIR}/0002-dnd_active_window_fix.patch - epatch ${FILESDIR}/0038-dragobject-dont-prefer-unknown.patch - epatch ${FILESDIR}/0044-qscrollview-windowactivate-fix.diff - epatch ${FILESDIR}/0047-fix-kmenu-widget.diff - epatch ${FILESDIR}/0048-qclipboard_hack_80072.patch - - # ulibc patch (bug #100246) - epatch ${FILESDIR}/qt-ulibc.patch - - # bug #151838 - epatch "${FILESDIR}/${P}-CVE-2006-4811-bis.patch" - - # xinerama patch: http://ktown.kde.org/~seli/xinerama/ - epatch "${FILESDIR}/${P}-seli-xinerama.patch" - - # Visibility patch, apply only on GCC 4.1 and later for safety - if [[ $(gcc-major-version)$(gcc-minor-version) -ge 41 ]] ; then - epatch "${FILESDIR}/${P}-visibility.patch" - fi - - if use immqt || use immqt-bc ; then - epatch ../${IMMQT_P}.diff - sh make-symlinks.sh || die "make symlinks failed" - fi - - if use ppc-macos ; then - epatch "${FILESDIR}/${PN}-3.3.5-macos.patch" - fi - - # known working flags wrt #77623 - use sparc && export CFLAGS="-O1" && export CXXFLAGS="${CFLAGS}" - # set c/xxflags and ldflags - strip-flags - append-flags -fno-strict-aliasing - sed -i -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ - -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ - -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \ - -e "s:\.*=.*:QMAKE_CC=$(tc-getCC):" \ - -e "s:\.*=.*:QMAKE_CXX=$(tc-getCXX):" \ - -e "s:\.*=.*:QMAKE_LINK=$(tc-getCXX):" \ - -e "s:\.*=.*:QMAKE_LINK_SHLIB=$(tc-getCXX):" \ - ${S}/mkspecs/${PLATFORM}/qmake.conf || die - - if [ $(get_libdir) != "lib" ] ; then - sed -i -e "s:/lib$:/$(get_libdir):" \ - ${S}/mkspecs/${PLATFORM}/qmake.conf || die - fi -} - -src_compile() { - export SYSCONF=${D}${QTBASE}/etc/settings - - # Let's just allow writing to these directories during Qt emerge - # as it makes Qt much happier. - addwrite "${QTBASE}/etc/settings" - addwrite "${HOME}/.qt" - - [ $(get_libdir) != "lib" ] && myconf="${myconf} -L/usr/$(get_libdir)" - - # unixODBC support is now a PDEPEND on dev-db/qt-unixODBC; see bug 14178. - use nas && myconf="${myconf} -system-nas-sound" - use nis && myconf="${myconf} -nis" || myconf="${myconf} -no-nis" - use gif && myconf="${myconf} -qt-gif" || myconf="${myconf} -no-gif" - use mysql && myconf="${myconf} -plugin-sql-mysql -I/usr/include/mysql -L/usr/$(get_libdir)/mysql" || myconf="${myconf} -no-sql-mysql" - use postgres && myconf="${myconf} -plugin-sql-psql -I/usr/include/postgresql/server -I/usr/include/postgresql/pgsql -I/usr/include/postgresql/pgsql/server" || myconf="${myconf} -no-sql-psql" - use firebird && myconf="${myconf} -plugin-sql-ibase" || myconf="${myconf} -no-sql-ibase" - use sqlite && myconf="${myconf} -plugin-sql-sqlite" || myconf="${myconf} -no-sql-sqlite" - use cups && myconf="${myconf} -cups" || myconf="${myconf} -no-cups" - use opengl && myconf="${myconf} -enable-module=opengl" || myconf="${myconf} -disable-opengl" - use debug && myconf="${myconf} -debug" || myconf="${myconf} -release -no-g++-exceptions" - use xinerama && myconf="${myconf} -xinerama" || myconf="${myconf} -no-xinerama" - - myconf="${myconf} -system-zlib" - - use ipv6 && myconf="${myconf} -ipv6" || myconf="${myconf} -no-ipv6" - use immqt-bc && myconf="${myconf} -inputmethod" - use immqt && myconf="${myconf} -inputmethod -inputmethod-ext" - - if use ppc-macos ; then - myconf="${myconf} -no-sql-ibase -no-sql-mysql -no-sql-psql -no-cups -lresolv -shared" - myconf="${myconf} -I/usr/X11R6/include -L/usr/X11R6/lib" - myconf="${myconf} -L${S}/lib -I${S}/include" - sed -i -e "s,#define QT_AOUT_UNDERSCORE,," mkspecs/${PLATFORM}/qplatformdefs.h || die - fi - - export YACC='byacc -d' - tc-export CC CXX - export LINK="$(tc-getCXX)" - - ./configure -sm -thread -stl -system-libjpeg -verbose -largefile \ - -qt-imgfmt-{jpeg,mng,png} -tablet -system-libmng \ - -system-libpng -xft -platform ${PLATFORM} -xplatform \ - ${PLATFORM} -xrender -prefix ${QTBASE} -libdir ${QTBASE}/$(get_libdir) \ - -fast -no-sql-odbc ${myconf} -dlopen-opengl || die - - emake src-qmake src-moc sub-src || die - - export DYLD_LIBRARY_PATH="${S}/lib:/usr/X11R6/lib:${DYLD_LIBRARY_PATH}" - export LD_LIBRARY_PATH="${S}/lib:${LD_LIBRARY_PATH}" - - emake sub-tools || die - - if use examples; then - emake sub-tutorial sub-examples || die - fi - - # Make the msg2qm utility (not made by default) - cd ${S}/tools/msg2qm - ../../bin/qmake - emake - - # Make the qembed utility (not made by default) - cd ${S}/tools/qembed - ../../bin/qmake - emake - -} - -src_install() { - # binaries - into ${QTBASE} - dobin bin/* - dobin tools/msg2qm/msg2qm - dobin tools/qembed/qembed - - # libraries - if use ppc-macos; then - # dolib is broken on BSD because of missing readlink(1) - dodir ${QTBASE}/$(get_libdir) - cp -fR lib/*.{dylib,la,a} ${D}/${QTBASE}/$(get_libdir) || die - - cd ${D}/${QTBASE}/$(get_libdir) - for lib in libqt-mt* ; do - ln -s ${lib} ${lib/-mt/} - done - else - dolib.so lib/lib{editor,qassistantclient,designercore}.a - dolib.so lib/libqt-mt.la - dolib.so lib/libqt-mt.so.${PV} lib/libqui.so.1.0.0 - cd ${D}/${QTBASE}/$(get_libdir) - - for x in libqui.so ; do - ln -s $x.1.0.0 $x.1.0 - ln -s $x.1.0 $x.1 - ln -s $x.1 $x - done - - # version symlinks - 3.3.5->3.3->3->.so - ln -s libqt-mt.so.${PV} libqt-mt.so.3.3 - ln -s libqt-mt.so.3.3 libqt-mt.so.3 - ln -s libqt-mt.so.3 libqt-mt.so - - # libqt -> libqt-mt symlinks - ln -s libqt-mt.so.${PV} libqt.so.${PV} - ln -s libqt-mt.so.3.3 libqt.so.3.3 - ln -s libqt-mt.so.3 libqt.so.3 - ln -s libqt-mt.so libqt.so - fi - - # plugins - cd ${S} - local plugins=$(find plugins -name "lib*.so" -print) - for x in ${plugins}; do - exeinto ${QTBASE}/$(dirname ${x}) - doexe ${x} - done - - # Past this point just needs to be done once - is_final_abi || return 0 - - # includes - cd ${S} - dodir ${QTBASE}/include/private - cp include/* ${D}/${QTBASE}/include/ - cp include/private/* ${D}/${QTBASE}/include/private/ - - # prl files - sed -i -e "s:${S}:${QTBASE}:g" ${S}/lib/*.prl - insinto ${QTBASE}/$(get_libdir) - doins ${S}/lib/*.prl - - # pkg-config file - insinto ${QTBASE}/$(get_libdir)/pkgconfig - doins ${S}/lib/*.pc - - # List all the multilib libdirs - local libdirs - for libdir in $(get_all_libdirs); do - libdirs="${libdirs}:${QTBASE}/${libdir}" - done - - # environment variables - if use ppc-macos; then - cat < ${T}/45qt3 -PATH=${QTBASE}/bin -ROOTPATH=${QTBASE}/bin -DYLD_LIBRARY_PATH=${libdirs:1} -QMAKESPEC=${PLATFORM} -MANPATH=${QTBASE}/doc/man -PKG_CONFIG_PATH=${QTBASE}/$(get_libdir)/pkgconfig -EOF - else - cat < ${T}/45qt3 -PATH=${QTBASE}/bin -ROOTPATH=${QTBASE}/bin -LDPATH=${libdirs:1} -QMAKESPEC=${PLATFORM} -MANPATH=${QTBASE}/doc/man -PKG_CONFIG_PATH=${QTBASE}/$(get_libdir)/pkgconfig -EOF - fi - cat < ${T}/50qtdir3 -QTDIR=${QTBASE} -EOF - - cat < ${T}/50-qt3-revdep -SEARCH_DIRS="${QTBASE}" -EOF - - insinto /etc/revdep-rebuild - doins ${T}/50-qt3-revdep - - insinto /etc/env.d - doins ${T}/45qt3 ${T}/50qtdir3 - - if [ "${SYMLINK_LIB}" = "yes" ]; then - dosym $(get_abi_LIBDIR ${DEFAULT_ABI}) ${QTBASE}/lib - fi - - insinto ${QTBASE}/tools/designer - doins -r tools/designer/templates - - insinto ${QTBASE} - doins -r translations - - keepdir ${QTBASE}/etc/settings - - if use doc; then - insinto ${QTBASE} - doins -r ${S}/doc - fi - - if use examples; then - find ${S}/examples ${S}/tutorial -name Makefile | \ - xargs sed -i -e "s:${S}:${QTBASE}:g" - - cp -r ${S}/examples ${D}${QTBASE}/ - cp -r ${S}/tutorial ${D}${QTBASE}/ - fi - - # misc build reqs - insinto ${QTBASE}/mkspecs - doins -r ${S}/mkspecs/${PLATFORM} - - sed -e "s:${S}:${QTBASE}:g" \ - ${S}/.qmake.cache > ${D}${QTBASE}/.qmake.cache - - dodoc FAQ README README-QT.TXT changes* - if use immqt || use immqt-bc ; then - dodoc ${S}/README.immodule - fi -} - -pkg_postinst() { - echo - einfo "After a rebuild of Qt, it can happen that Qt plugins (such as Qt/KDE styles," - einfo "or widgets for the Qt designer) are no longer recognized. If this situation" - einfo "occurs you should recompile the packages providing these plugins," - einfo "and you should also make sure that Qt and its plugins were compiled with the" - einfo "same version of gcc. Packages that may need to be rebuilt are, for instance," - einfo "kde-base/kdelibs, kde-base/kdeartwork and kde-base/kdeartwork-styles." - einfo "See http://doc.trolltech.com/3.3/plugins-howto.html for more infos." - echo -} diff --git a/x11-misc/avant-window-navigator/Manifest b/x11-misc/avant-window-navigator/Manifest deleted file mode 100644 index 1b5c8ee49..000000000 --- a/x11-misc/avant-window-navigator/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -DIST avant-window-navigator-0.1.1-2.tar.gz 505015 RMD160 ab95e9fb0f56d09e927c9ddbcc017fdf5b849cd8 SHA1 a17f46d00e7895bc95d2a817efa8ce8bd90aa3e4 SHA256 288f8374860740880796b7472fbeacde82e55f8f0041151e5678aa0336593b14 -EBUILD avant-window-navigator-0.1.1-r2.ebuild 1022 RMD160 4ad8e7e44504db63090cfd0d15d8b1932771e696 SHA1 e69d64d6dcf921121962233d9a52f46c260db9e5 SHA256 fd379de52d6852840fbb73217aa4fb71dd2183c022a3399c39cb17d83be4f2d5 -MD5 1f9e766e814a007e757c0cd837ab014e avant-window-navigator-0.1.1-r2.ebuild 1022 -RMD160 4ad8e7e44504db63090cfd0d15d8b1932771e696 avant-window-navigator-0.1.1-r2.ebuild 1022 -SHA256 fd379de52d6852840fbb73217aa4fb71dd2183c022a3399c39cb17d83be4f2d5 avant-window-navigator-0.1.1-r2.ebuild 1022 -MD5 f97c4972072c0e7ea1357c7be7bb8319 files/digest-avant-window-navigator-0.1.1-r2 292 -RMD160 5730903fc17e536e624f27286a0145e2ccaa371f files/digest-avant-window-navigator-0.1.1-r2 292 -SHA256 08815dc2bf41f4c6e8666333dcb33125df3a266e7ae0cab3521a24f3bbd48eca files/digest-avant-window-navigator-0.1.1-r2 292 diff --git a/x11-misc/avant-window-navigator/avant-window-navigator-0.1.1-r2.ebuild b/x11-misc/avant-window-navigator/avant-window-navigator-0.1.1-r2.ebuild deleted file mode 100644 index ad4ac34ba..000000000 --- a/x11-misc/avant-window-navigator/avant-window-navigator-0.1.1-r2.ebuild +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit autotools gnome2 - -DESCRIPTION="Fully customisable dock-like window navigator for GNOME." -HOMEPAGE="http://code.google.com/p/avant-window-navigator/" -SRC_URI="http://avant-window-navigator.googlecode.com/files/${PN}-0.1.1-2.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="" - -DEPEND=">=x11-libs/libwnck-2.16.2 - gnome-base/gnome-common" - -src_unpack() { - gnome2_src_unpack - intltoolize --force || die "intltool failed" -} - -src_compile() { - eautoreconf - - gnome2_src_compile - - emake -j1 || die "emake fail" -} - -src_install() { - gnome2_src_install -} - -pkg_postinst() { - # This is necessary due to a bug upstream - # http://code.google.com/p/avant-window-navigator/issues/detail?id=5&can=2&q= - # Suggest to remove when fixed - gnome2_pkg_postinst - gconftool-2 --install-schema-file=/etc/gconf/schemas/avant-window-navigator.schemas - einfo "If it still segfaults, gconfd-2 needs to be restarted." -} diff --git a/x11-misc/avant-window-navigator/files/digest-avant-window-navigator-0.1.1-r2 b/x11-misc/avant-window-navigator/files/digest-avant-window-navigator-0.1.1-r2 deleted file mode 100644 index 45494b243..000000000 --- a/x11-misc/avant-window-navigator/files/digest-avant-window-navigator-0.1.1-r2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 8de5ca6b7ea707ae5298526c98799abf avant-window-navigator-0.1.1-2.tar.gz 505015 -RMD160 ab95e9fb0f56d09e927c9ddbcc017fdf5b849cd8 avant-window-navigator-0.1.1-2.tar.gz 505015 -SHA256 288f8374860740880796b7472fbeacde82e55f8f0041151e5678aa0336593b14 avant-window-navigator-0.1.1-2.tar.gz 505015 diff --git a/x11-misc/beryl-manager/Manifest b/x11-misc/beryl-manager/Manifest deleted file mode 100644 index 0405ba0e3..000000000 --- a/x11-misc/beryl-manager/Manifest +++ /dev/null @@ -1,48 +0,0 @@ -DIST beryl-manager-0.1.3.tar.bz2 151869 RMD160 511379076cc36ba8f2de2d72a4b6f5af77dae82f SHA1 fdcec79f8c11dd1a9edd6eaf33213e76d02efcf9 SHA256 acdf5e063c1a32a57927fa6551c7cc81bfb1816447784a9af31d9814b5f70e02 -DIST beryl-manager-0.1.4.tar.bz2 176578 RMD160 bd3d88fb7c409131102096c9c26abfc331327366 SHA1 5d8608915d6924241b8050f5f80a160dc9651642 SHA256 433bfd54ec8cf8b3e5bf9cf6be7771cd1bcd9bb7c46579381155e646c1b65aaf -DIST beryl-manager-0.1.99.2.tar.bz2 175427 RMD160 d79d479dd06ad32b63a39818c5168ffc894e5537 SHA1 a18c1e1b6f115c7d8d860e70939c8ca873a33181 SHA256 2d7c7e578c261c7a9cd1da2de592fbdd99eed82fcbab01d4646e2c8509545efc -DIST beryl-manager-0.1.9999.1.tar.bz2 175916 RMD160 0567143b1b72edabb7387a25d38e92b6f60bef6c SHA1 deb836f73206bfc33665668bc6a044a20dcde99a SHA256 cc74f6023c2c32e9256d866cb6d790d6fef8d9e182945c1c7029d4688585fc66 -DIST beryl-manager-0.1.9999.2.tar.bz2 175901 RMD160 ed2ca330d9f2fccbd1ad40bea5c37b5b5d68b2c1 SHA1 56ee11f6e01289d4f68e1deb68b61c0f5ac10f1f SHA256 19e700a1336836cc8b48936111f1fbcbed8a6198828e8d813031d1b551276b8d -DIST beryl-manager-0.2.0.tar.bz2 177433 RMD160 4db40510a0e42901893d6fda017d8f5aad54b9e3 SHA1 5851c0b020204f1f60855c7866eed40dd85bdd91 SHA256 d4d7c70f90600e5a6dbaff55b73dd9c7a18c016c38e0a86ddb20c3cf136672f9 -EBUILD beryl-manager-0.1.3-r1.ebuild 715 RMD160 a8678c031fd038821e35d833ad0d74cf4624700e SHA1 327c74c8e75fa7807d9eeb2cf8e65ecc816ff4ae SHA256 7e09f51038f96c03aa20524e7ab87d6a10c4f62de89eb7c68903748878b69fa6 -MD5 5b945b3900b66dcfdf3789fc1e92e9c4 beryl-manager-0.1.3-r1.ebuild 715 -RMD160 a8678c031fd038821e35d833ad0d74cf4624700e beryl-manager-0.1.3-r1.ebuild 715 -SHA256 7e09f51038f96c03aa20524e7ab87d6a10c4f62de89eb7c68903748878b69fa6 beryl-manager-0.1.3-r1.ebuild 715 -EBUILD beryl-manager-0.1.4.ebuild 1129 RMD160 d8ced3c5566c3d9ba68fca0be4d5f60893fd233c SHA1 e5768903ad307fe2238d1a0348f01b829e0833ec SHA256 02bb5ee0b2b658e27dbcf758308f9961c955e25cffef4980cc2e8ace807babf9 -MD5 56616c9c1eff3c6139c36a6b3160787f beryl-manager-0.1.4.ebuild 1129 -RMD160 d8ced3c5566c3d9ba68fca0be4d5f60893fd233c beryl-manager-0.1.4.ebuild 1129 -SHA256 02bb5ee0b2b658e27dbcf758308f9961c955e25cffef4980cc2e8ace807babf9 beryl-manager-0.1.4.ebuild 1129 -EBUILD beryl-manager-0.1.99.2.ebuild 1129 RMD160 d8ced3c5566c3d9ba68fca0be4d5f60893fd233c SHA1 e5768903ad307fe2238d1a0348f01b829e0833ec SHA256 02bb5ee0b2b658e27dbcf758308f9961c955e25cffef4980cc2e8ace807babf9 -MD5 56616c9c1eff3c6139c36a6b3160787f beryl-manager-0.1.99.2.ebuild 1129 -RMD160 d8ced3c5566c3d9ba68fca0be4d5f60893fd233c beryl-manager-0.1.99.2.ebuild 1129 -SHA256 02bb5ee0b2b658e27dbcf758308f9961c955e25cffef4980cc2e8ace807babf9 beryl-manager-0.1.99.2.ebuild 1129 -EBUILD beryl-manager-0.1.9999.1.ebuild 1123 RMD160 951bb86ea48807cf92f6967a75508bdefb26389a SHA1 a3a8fdccef2599c1f76de193fa8a938d1be116e2 SHA256 4b9238fa31a566e668748b80bb4675c6492e7d3a064b5c8cab22fb28499c7e71 -MD5 8591c9abc8d675a1c9f52678c92310bf beryl-manager-0.1.9999.1.ebuild 1123 -RMD160 951bb86ea48807cf92f6967a75508bdefb26389a beryl-manager-0.1.9999.1.ebuild 1123 -SHA256 4b9238fa31a566e668748b80bb4675c6492e7d3a064b5c8cab22fb28499c7e71 beryl-manager-0.1.9999.1.ebuild 1123 -EBUILD beryl-manager-0.1.9999.2.ebuild 1141 RMD160 70f2fd77e0046d2b96cf7da12c6cf34254c27836 SHA1 aeb1cee4fc2c5b5f59af1c75ac7add86838f00c0 SHA256 7abbe33bef1bf055b8963f638a4aad20e317edc89270bd86b9d688b6495daec6 -MD5 1f5052b5a8b5ebba845cbb3578cd0ad1 beryl-manager-0.1.9999.2.ebuild 1141 -RMD160 70f2fd77e0046d2b96cf7da12c6cf34254c27836 beryl-manager-0.1.9999.2.ebuild 1141 -SHA256 7abbe33bef1bf055b8963f638a4aad20e317edc89270bd86b9d688b6495daec6 beryl-manager-0.1.9999.2.ebuild 1141 -EBUILD beryl-manager-0.2.0.ebuild 1161 RMD160 753fcebd4dc9d19f8fdda09679a4a856444daf49 SHA1 af633cb875a3ec5754b90d7bccd2d7161881d391 SHA256 332b362dcf09e772d51df26ea78fde61debfcbe74d93bd3ee041d0ff2b011e13 -MD5 4cc520dd007fcc3e5ffc9e51fdf2c158 beryl-manager-0.2.0.ebuild 1161 -RMD160 753fcebd4dc9d19f8fdda09679a4a856444daf49 beryl-manager-0.2.0.ebuild 1161 -SHA256 332b362dcf09e772d51df26ea78fde61debfcbe74d93bd3ee041d0ff2b011e13 beryl-manager-0.2.0.ebuild 1161 -MD5 f8c2f0d55d63d0fc95af95efb3679c11 files/digest-beryl-manager-0.1.3-r1 262 -RMD160 0d57273e9bee482634e4400cf33b6d8631f6838b files/digest-beryl-manager-0.1.3-r1 262 -SHA256 754c670bd9c9b8af09fe128d47018a6de9b65966f79d2865a5d555125896a251 files/digest-beryl-manager-0.1.3-r1 262 -MD5 72c1d7ac6a28173866be96a25c840b4e files/digest-beryl-manager-0.1.4 262 -RMD160 ac3ae83e79bf884d72679784a38dfcc490744eb2 files/digest-beryl-manager-0.1.4 262 -SHA256 87e68f5fb2c66aeb4e139e8d63c173d404bd6995187c01852c6d5c96baff9b9a files/digest-beryl-manager-0.1.4 262 -MD5 0c9e9bcea7ea754f0f4330271b89c2b6 files/digest-beryl-manager-0.1.99.2 271 -RMD160 8141e883f411fa05782b92bcc72e7b67d5e4b740 files/digest-beryl-manager-0.1.99.2 271 -SHA256 6bcb0771c913eb6e7d7cff5fe1c7012d6982359f0942fcd6598d4af46cc73bb6 files/digest-beryl-manager-0.1.99.2 271 -MD5 7393d2c0bc2ac0b17e29009dbbd72f54 files/digest-beryl-manager-0.1.9999.1 277 -RMD160 3fc16c7edc34e6177fe3233fbfba6494b1eef9de files/digest-beryl-manager-0.1.9999.1 277 -SHA256 8dcf3419dc2b1eb3c38813f3c7a202871a9668bd8f67d27396841043926ebc6b files/digest-beryl-manager-0.1.9999.1 277 -MD5 657f9f7322e7974243cca53a68e5abec files/digest-beryl-manager-0.1.9999.2 277 -RMD160 5e698966c0c2384aa9931e6763c28c2bf1b2bee7 files/digest-beryl-manager-0.1.9999.2 277 -SHA256 e63d9fbe1981d5fa329e91de3be768991133de3534dcfa91f7582fcf50308303 files/digest-beryl-manager-0.1.9999.2 277 -MD5 81c3fb600f931ee9e89a1248f5bde757 files/digest-beryl-manager-0.2.0 262 -RMD160 559f923f763cc8a990e4443657dafca5c9b16ce3 files/digest-beryl-manager-0.2.0 262 -SHA256 ba2bc1ce4d8ea01292bb40c2534b58a4fffbdb9add0542604fbad77f96af4023 files/digest-beryl-manager-0.2.0 262 diff --git a/x11-misc/beryl-manager/beryl-manager-0.1.3-r1.ebuild b/x11-misc/beryl-manager/beryl-manager-0.1.3-r1.ebuild deleted file mode 100644 index d9be90237..000000000 --- a/x11-misc/beryl-manager/beryl-manager-0.1.3-r1.ebuild +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-misc/beryl-manager/beryl-manager-0.1.2.ebuild,v 1.1 2006/11/15 03:57:21 tsunam Exp $ - -DESCRIPTION="Beryl Window Decorator Manager" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://distfiles.gentoo-xeffects.org/beryl-releases/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="" -RESTRICT="nomirror" - -DEPEND=">=x11-libs/gtk+-2.8.0" - -RDEPEND="${DEPEND} - x11-apps/xlsclients - x11-apps/xvinfo" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-manager/beryl-manager-0.1.4.ebuild b/x11-misc/beryl-manager/beryl-manager-0.1.4.ebuild deleted file mode 100644 index 6c46dcc9c..000000000 --- a/x11-misc/beryl-manager/beryl-manager-0.1.4.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ar_AR ca_ES de_DE es_AR es_ES fr_FR gl_ES gl_GL hu_HU it_IT ja_JP ko_KR my_MY nb_NO nl_BE nl_NL it_IT pl_PL pt_BR pt_PT ru_RU sk_SK sv_FI sv_SE tr_TR uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator Manager" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0" - -RDEPEND="${DEPEND} - x11-apps/xlsclients - x11-apps/xvinfo" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - # --with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-manager/beryl-manager-0.1.99.2.ebuild b/x11-misc/beryl-manager/beryl-manager-0.1.99.2.ebuild deleted file mode 100644 index 6c46dcc9c..000000000 --- a/x11-misc/beryl-manager/beryl-manager-0.1.99.2.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ar_AR ca_ES de_DE es_AR es_ES fr_FR gl_ES gl_GL hu_HU it_IT ja_JP ko_KR my_MY nb_NO nl_BE nl_NL it_IT pl_PL pt_BR pt_PT ru_RU sk_SK sv_FI sv_SE tr_TR uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator Manager" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0" - -RDEPEND="${DEPEND} - x11-apps/xlsclients - x11-apps/xvinfo" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - # --with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-manager/beryl-manager-0.1.9999.1.ebuild b/x11-misc/beryl-manager/beryl-manager-0.1.9999.1.ebuild deleted file mode 100644 index e65a0cf44..000000000 --- a/x11-misc/beryl-manager/beryl-manager-0.1.9999.1.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ar_AR ca_ES de_DE es_AR es_ES fr_FR gl_ES gl_GL hu_HU it_IT ja_JP ko_KR my_MY nb_NO nl_BE nl_NL it_IT pl_PL pt_BR pt_PT ru_RU sk_SK sv_FI sv_SE tr_TR uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator Manager" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0" - -RDEPEND="${DEPEND} - x11-apps/xlsclients - x11-apps/xvinfo" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - # --with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-manager/beryl-manager-0.1.9999.2.ebuild b/x11-misc/beryl-manager/beryl-manager-0.1.9999.2.ebuild deleted file mode 100644 index e6b275450..000000000 --- a/x11-misc/beryl-manager/beryl-manager-0.1.9999.2.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ar_AR ca_ES de_DE es_AR es_ES fr_FR gl_ES gl_GL hu_HU it_IT ja_JP ko_KR my_MY nb_NO nl_BE nl_NL it_IT pl_PL pt_BR pt_PT ru_RU sk_SK sv_FI sv_SE tr_TR uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator Manager" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" - -DEPEND=">=x11-libs/gtk+-2.8.0" - -RDEPEND="${DEPEND} - x11-apps/xlsclients - x11-apps/xvinfo" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - # --with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-manager/beryl-manager-0.2.0.ebuild b/x11-misc/beryl-manager/beryl-manager-0.2.0.ebuild deleted file mode 100644 index db90b7f00..000000000 --- a/x11-misc/beryl-manager/beryl-manager-0.2.0.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ar_AR ca_ES de_DE es_AR es_ES fr_FR gl_ES gl_GL hu_HU it_IT ja_JP ko_KR my_MY nb_NO nl_BE nl_NL it_IT pl_PL pt_BR pt_PT ru_RU sk_SK sv_FI sv_SE tr_TR uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator Manager" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -RESTRICT="nomirror" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" - -DEPEND=">=x11-libs/gtk+-2.8.0" - -RDEPEND="${DEPEND} - x11-apps/xlsclients - x11-apps/xvinfo" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - # --with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.3-r1 b/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.3-r1 deleted file mode 100644 index d767d0564..000000000 --- a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.3-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 c9559154c20db1bb41d3d480cfdf0299 beryl-manager-0.1.3.tar.bz2 151869 -RMD160 511379076cc36ba8f2de2d72a4b6f5af77dae82f beryl-manager-0.1.3.tar.bz2 151869 -SHA256 acdf5e063c1a32a57927fa6551c7cc81bfb1816447784a9af31d9814b5f70e02 beryl-manager-0.1.3.tar.bz2 151869 diff --git a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.4 b/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.4 deleted file mode 100644 index c4ee31ae8..000000000 --- a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.4 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 777359955c1d57f6da11b5ce67ebb37e beryl-manager-0.1.4.tar.bz2 176578 -RMD160 bd3d88fb7c409131102096c9c26abfc331327366 beryl-manager-0.1.4.tar.bz2 176578 -SHA256 433bfd54ec8cf8b3e5bf9cf6be7771cd1bcd9bb7c46579381155e646c1b65aaf beryl-manager-0.1.4.tar.bz2 176578 diff --git a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.99.2 b/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.99.2 deleted file mode 100644 index 4421719cb..000000000 --- a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.99.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 e685d436599297b6921f88b59d4635c4 beryl-manager-0.1.99.2.tar.bz2 175427 -RMD160 d79d479dd06ad32b63a39818c5168ffc894e5537 beryl-manager-0.1.99.2.tar.bz2 175427 -SHA256 2d7c7e578c261c7a9cd1da2de592fbdd99eed82fcbab01d4646e2c8509545efc beryl-manager-0.1.99.2.tar.bz2 175427 diff --git a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.9999.1 b/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.9999.1 deleted file mode 100644 index 1a8387bdd..000000000 --- a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 805f50dc6c0fb5c3f8fa0d853710807f beryl-manager-0.1.9999.1.tar.bz2 175916 -RMD160 0567143b1b72edabb7387a25d38e92b6f60bef6c beryl-manager-0.1.9999.1.tar.bz2 175916 -SHA256 cc74f6023c2c32e9256d866cb6d790d6fef8d9e182945c1c7029d4688585fc66 beryl-manager-0.1.9999.1.tar.bz2 175916 diff --git a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.9999.2 b/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.9999.2 deleted file mode 100644 index c2d162fae..000000000 --- a/x11-misc/beryl-manager/files/digest-beryl-manager-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 1141372500eca8abf43a7877e724ad67 beryl-manager-0.1.9999.2.tar.bz2 175901 -RMD160 ed2ca330d9f2fccbd1ad40bea5c37b5b5d68b2c1 beryl-manager-0.1.9999.2.tar.bz2 175901 -SHA256 19e700a1336836cc8b48936111f1fbcbed8a6198828e8d813031d1b551276b8d beryl-manager-0.1.9999.2.tar.bz2 175901 diff --git a/x11-misc/beryl-manager/files/digest-beryl-manager-0.2.0 b/x11-misc/beryl-manager/files/digest-beryl-manager-0.2.0 deleted file mode 100644 index 1c57191c2..000000000 --- a/x11-misc/beryl-manager/files/digest-beryl-manager-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 5bd0fb5786b6d79d6ebe87c14ba668c9 beryl-manager-0.2.0.tar.bz2 177433 -RMD160 4db40510a0e42901893d6fda017d8f5aad54b9e3 beryl-manager-0.2.0.tar.bz2 177433 -SHA256 d4d7c70f90600e5a6dbaff55b73dd9c7a18c016c38e0a86ddb20c3cf136672f9 beryl-manager-0.2.0.tar.bz2 177433 diff --git a/x11-misc/beryl-settings-bindings/Manifest b/x11-misc/beryl-settings-bindings/Manifest deleted file mode 100644 index 5f2b9dd0f..000000000 --- a/x11-misc/beryl-settings-bindings/Manifest +++ /dev/null @@ -1,32 +0,0 @@ -DIST beryl-settings-bindings-0.1.99.2.tar.bz2 238788 RMD160 a9463498220d8f8d73d9fdc80c7b2bca1deb3076 SHA1 97d76ea9d149c02328f0a30e38113fc9e8ac66fe SHA256 fe58bd7c60b2f6a450816a0d7878356ae5f155d56a48e26fcbcaf8693e1c87ef -DIST beryl-settings-bindings-0.1.9999.1.tar.bz2 240172 RMD160 0ca73d5481d6e6d068faf6aa222a431ec2dbe043 SHA1 f845dd988ec3a8f495b5a893e00c6ac5808205e0 SHA256 5852ce8804bd3cb530c33f0c9ee223b30df748e5fa4aaa3b83f59747c31f7dcd -DIST beryl-settings-bindings-0.1.9999.2.tar.bz2 240314 RMD160 d2ec5c3d41850eb6aa433a67c9dab8c83713795a SHA1 77d1d31881b06fa72a22496b8eaec69d23068559 SHA256 83bd08a3d94b684006f7aba362d00a6ce06ac2117bceaaeec8c5e1a713d4a06f -DIST beryl-settings-bindings-0.2.0.tar.bz2 258566 RMD160 28155741b43919016857ed0e24f0cf50d0e40c18 SHA1 a0850a27591a3eeee74dd01ec24a8c1f60bd84b3 SHA256 aa516258eef976ff304eacc913c663f0fd7766c106dc8f0f80a7186b7b3f3351 -EBUILD beryl-settings-bindings-0.1.99.2.ebuild 542 RMD160 3d4e3a999cace1c5f67ee88cff2a3b0c215e4272 SHA1 810c310e508b8ab55a13224ef5614db64632fb56 SHA256 238f150b8ef68e797ac5fa1151b48b692228888d16b2f962899e07f8af13d873 -MD5 74b807872d1c9b3b9bd6ec7e2e9692e9 beryl-settings-bindings-0.1.99.2.ebuild 542 -RMD160 3d4e3a999cace1c5f67ee88cff2a3b0c215e4272 beryl-settings-bindings-0.1.99.2.ebuild 542 -SHA256 238f150b8ef68e797ac5fa1151b48b692228888d16b2f962899e07f8af13d873 beryl-settings-bindings-0.1.99.2.ebuild 542 -EBUILD beryl-settings-bindings-0.1.9999.1.ebuild 542 RMD160 3d4e3a999cace1c5f67ee88cff2a3b0c215e4272 SHA1 810c310e508b8ab55a13224ef5614db64632fb56 SHA256 238f150b8ef68e797ac5fa1151b48b692228888d16b2f962899e07f8af13d873 -MD5 74b807872d1c9b3b9bd6ec7e2e9692e9 beryl-settings-bindings-0.1.9999.1.ebuild 542 -RMD160 3d4e3a999cace1c5f67ee88cff2a3b0c215e4272 beryl-settings-bindings-0.1.9999.1.ebuild 542 -SHA256 238f150b8ef68e797ac5fa1151b48b692228888d16b2f962899e07f8af13d873 beryl-settings-bindings-0.1.9999.1.ebuild 542 -EBUILD beryl-settings-bindings-0.1.9999.2.ebuild 560 RMD160 a90c53288ebe28850601f4e40654ca63cc644435 SHA1 ffe5bb9d2514211c773ec665e233a68b6af71e09 SHA256 38b0028dcc1423101b3c619eef125ff66481bf21ba4784ad8a41fbd42ef7c2f2 -MD5 a10f3587e6dc7d4a8701a9f33f5cdade beryl-settings-bindings-0.1.9999.2.ebuild 560 -RMD160 a90c53288ebe28850601f4e40654ca63cc644435 beryl-settings-bindings-0.1.9999.2.ebuild 560 -SHA256 38b0028dcc1423101b3c619eef125ff66481bf21ba4784ad8a41fbd42ef7c2f2 beryl-settings-bindings-0.1.9999.2.ebuild 560 -EBUILD beryl-settings-bindings-0.2.0.ebuild 580 RMD160 ebca2d526368661b9ca54abe73f9a6c3516e90e8 SHA1 a539b7235c7313538ee9b859e3a11c50d06b0f5e SHA256 d84591a2b758ef4b88db10697e3bcec48e88860f06df9e7d152d83bc9a8f6681 -MD5 b120232e64fa7e69ae80b183a0baafcb beryl-settings-bindings-0.2.0.ebuild 580 -RMD160 ebca2d526368661b9ca54abe73f9a6c3516e90e8 beryl-settings-bindings-0.2.0.ebuild 580 -SHA256 d84591a2b758ef4b88db10697e3bcec48e88860f06df9e7d152d83bc9a8f6681 beryl-settings-bindings-0.2.0.ebuild 580 -MD5 3154277b24b8f0aab069fb3d10961214 files/digest-beryl-settings-bindings-0.1.99.2 301 -RMD160 736218a5438bb7904b12fc6546b6d2e137f65d1e files/digest-beryl-settings-bindings-0.1.99.2 301 -SHA256 1cffd56cd0878202d9f3cf1267cce9807b7c11a161464317db4daecdd9ab53f5 files/digest-beryl-settings-bindings-0.1.99.2 301 -MD5 75834221c11ff9e60bc1923596a46044 files/digest-beryl-settings-bindings-0.1.9999.1 307 -RMD160 8863dc91e9d1771a635ca03c67570cfd7f48c05b files/digest-beryl-settings-bindings-0.1.9999.1 307 -SHA256 b1d3afd1829a4014d7c908b7ecda679337b8a5a4fe9922b34f7ab1cfc37c9024 files/digest-beryl-settings-bindings-0.1.9999.1 307 -MD5 cddd0fad8d224d96344610bf24fc1344 files/digest-beryl-settings-bindings-0.1.9999.2 307 -RMD160 ef5ba94a013477b8af60aed7495d4fa27789efc5 files/digest-beryl-settings-bindings-0.1.9999.2 307 -SHA256 467cbaa97cc73af8ccc60f93186c452b0792734047f14509db92cc0057479f43 files/digest-beryl-settings-bindings-0.1.9999.2 307 -MD5 d1c43d5104e3c550c7f8ddce783c270f files/digest-beryl-settings-bindings-0.2.0 292 -RMD160 e8611d203e3316f9b9715e10b655d95622d5ab3b files/digest-beryl-settings-bindings-0.2.0 292 -SHA256 34744f54984cb76272d4b5e31f3c8095a0c440c9c60e000fcc0b3bfe1acd6019 files/digest-beryl-settings-bindings-0.2.0 292 diff --git a/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.99.2.ebuild b/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.99.2.ebuild deleted file mode 100644 index bd43ba337..000000000 --- a/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.99.2.ebuild +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" -IUSE="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -src_compile() { - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.9999.1.ebuild b/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.9999.1.ebuild deleted file mode 100644 index bd43ba337..000000000 --- a/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.9999.1.ebuild +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" -IUSE="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -src_compile() { - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.9999.2.ebuild b/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.9999.2.ebuild deleted file mode 100644 index 2c6e75f78..000000000 --- a/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.1.9999.2.ebuild +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -IUSE="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~amd64 ~ppc" - -src_compile() { - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.2.0.ebuild b/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.2.0.ebuild deleted file mode 100644 index 12d70104a..000000000 --- a/x11-misc/beryl-settings-bindings/beryl-settings-bindings-0.2.0.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -IUSE="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~amd64 ~ppc" -RESTRICT="nomirror" - -src_compile() { - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.99.2 b/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.99.2 deleted file mode 100644 index 302f2c214..000000000 --- a/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.99.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 84a1ad03e0ba5bfed8a80e7e15c00f7d beryl-settings-bindings-0.1.99.2.tar.bz2 238788 -RMD160 a9463498220d8f8d73d9fdc80c7b2bca1deb3076 beryl-settings-bindings-0.1.99.2.tar.bz2 238788 -SHA256 fe58bd7c60b2f6a450816a0d7878356ae5f155d56a48e26fcbcaf8693e1c87ef beryl-settings-bindings-0.1.99.2.tar.bz2 238788 diff --git a/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.9999.1 b/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.9999.1 deleted file mode 100644 index 75f89f3a4..000000000 --- a/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 b5d4b936c8ee43ed61f1125509ebe184 beryl-settings-bindings-0.1.9999.1.tar.bz2 240172 -RMD160 0ca73d5481d6e6d068faf6aa222a431ec2dbe043 beryl-settings-bindings-0.1.9999.1.tar.bz2 240172 -SHA256 5852ce8804bd3cb530c33f0c9ee223b30df748e5fa4aaa3b83f59747c31f7dcd beryl-settings-bindings-0.1.9999.1.tar.bz2 240172 diff --git a/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.9999.2 b/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.9999.2 deleted file mode 100644 index 5e1f6a323..000000000 --- a/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 4548178c662e48e68564ce12dd5bb3b5 beryl-settings-bindings-0.1.9999.2.tar.bz2 240314 -RMD160 d2ec5c3d41850eb6aa433a67c9dab8c83713795a beryl-settings-bindings-0.1.9999.2.tar.bz2 240314 -SHA256 83bd08a3d94b684006f7aba362d00a6ce06ac2117bceaaeec8c5e1a713d4a06f beryl-settings-bindings-0.1.9999.2.tar.bz2 240314 diff --git a/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.2.0 b/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.2.0 deleted file mode 100644 index 7d55de132..000000000 --- a/x11-misc/beryl-settings-bindings/files/digest-beryl-settings-bindings-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 0b7081da3dafa741a8b1ce009a598d14 beryl-settings-bindings-0.2.0.tar.bz2 258566 -RMD160 28155741b43919016857ed0e24f0cf50d0e40c18 beryl-settings-bindings-0.2.0.tar.bz2 258566 -SHA256 aa516258eef976ff304eacc913c663f0fd7766c106dc8f0f80a7186b7b3f3351 beryl-settings-bindings-0.2.0.tar.bz2 258566 diff --git a/x11-misc/beryl-settings-simple/Manifest b/x11-misc/beryl-settings-simple/Manifest deleted file mode 100644 index e17d3e5cf..000000000 --- a/x11-misc/beryl-settings-simple/Manifest +++ /dev/null @@ -1,16 +0,0 @@ -DIST beryl-settings-simple-0.1.9999.2.tar.bz2 152026 RMD160 2c4b82c9c8c53a28e48ac2731631cad605862a24 SHA1 d66631aa12a2d8a2a116c6732936ee10bfac1c41 SHA256 f8b1197b86315aca4da700b98599ed647dfe5d02d32da11d4f4ab541fceb0288 -DIST beryl-settings-simple-0.2.0.tar.bz2 158555 RMD160 f579ff612ac7ebf231db5719f817bcdeb7a4d3a3 SHA1 3025bc9aba8545ca9dcd5649fcbbe1753eea0f86 SHA256 4ba5e1fa0cf987b5aac5ac86db7eb6f1ad79d54a4bab7c441735aba6dfb130ca -EBUILD beryl-settings-simple-0.1.9999.2.ebuild 662 RMD160 2b98cc303e64488b5aad5ff4c70c493430941517 SHA1 a39b0e3c745b5391ecf037449d51eff7a8fde43c SHA256 54bf7d315ade637a4df1d382cefd103734ae56ce87f884856ec7cfb0603a390a -MD5 a05c7f0304a6180bfca06f4a267fa04e beryl-settings-simple-0.1.9999.2.ebuild 662 -RMD160 2b98cc303e64488b5aad5ff4c70c493430941517 beryl-settings-simple-0.1.9999.2.ebuild 662 -SHA256 54bf7d315ade637a4df1d382cefd103734ae56ce87f884856ec7cfb0603a390a beryl-settings-simple-0.1.9999.2.ebuild 662 -EBUILD beryl-settings-simple-0.2.0.ebuild 683 RMD160 37bf6bed7eeede77a3a22cb9ed18b3c837207563 SHA1 c9f56889d744867ad112f25b30ccd55f3fb09e7a SHA256 f63b5399acf0f1a17a4082f16fddd518d71b9d94e7b488c5ce48c6ee9e607bbc -MD5 aa4de4be96a28fa6988c811d073d4693 beryl-settings-simple-0.2.0.ebuild 683 -RMD160 37bf6bed7eeede77a3a22cb9ed18b3c837207563 beryl-settings-simple-0.2.0.ebuild 683 -SHA256 f63b5399acf0f1a17a4082f16fddd518d71b9d94e7b488c5ce48c6ee9e607bbc beryl-settings-simple-0.2.0.ebuild 683 -MD5 4890d3fba766dc7ebf72aa78a0ce9ab2 files/digest-beryl-settings-simple-0.1.9999.2 301 -RMD160 70024106587db00969b359ef9c0326a0879e2486 files/digest-beryl-settings-simple-0.1.9999.2 301 -SHA256 35a97bc89f3e565a615da5f242ee68be46fa92a10cee3c9ba19b4841b24c029c files/digest-beryl-settings-simple-0.1.9999.2 301 -MD5 b0f9b6622fd360da64c527072633d64b files/digest-beryl-settings-simple-0.2.0 286 -RMD160 92673b7731f300bd77014e25766d7d5127cc9d55 files/digest-beryl-settings-simple-0.2.0 286 -SHA256 544fa9dba2ea993335030385d6dd73545a25d6ffa6058be311d0a2b3e41cb3e0 files/digest-beryl-settings-simple-0.2.0 286 diff --git a/x11-misc/beryl-settings-simple/beryl-settings-simple-0.1.9999.2.ebuild b/x11-misc/beryl-settings-simple/beryl-settings-simple-0.1.9999.2.ebuild deleted file mode 100644 index cf506d805..000000000 --- a/x11-misc/beryl-settings-simple/beryl-settings-simple-0.1.9999.2.ebuild +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" - -DESCRIPTION="Beryl Settings Utility (Simple Edition)" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0 - ~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.16.1" - -RDEPEND="~x11-misc/beryl-settings-bindings-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-settings-simple/beryl-settings-simple-0.2.0.ebuild b/x11-misc/beryl-settings-simple/beryl-settings-simple-0.2.0.ebuild deleted file mode 100644 index 140327039..000000000 --- a/x11-misc/beryl-settings-simple/beryl-settings-simple-0.2.0.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" - -DESCRIPTION="Beryl Settings Utility (Simple Edition)" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -RESTRICT="nomirror" - - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0 - ~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.16.1" - -RDEPEND="~x11-misc/beryl-settings-bindings-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-settings-simple/files/digest-beryl-settings-simple-0.1.9999.2 b/x11-misc/beryl-settings-simple/files/digest-beryl-settings-simple-0.1.9999.2 deleted file mode 100644 index 97bddc523..000000000 --- a/x11-misc/beryl-settings-simple/files/digest-beryl-settings-simple-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 3cfad6c9427c86153a06b0adb45ba9b8 beryl-settings-simple-0.1.9999.2.tar.bz2 152026 -RMD160 2c4b82c9c8c53a28e48ac2731631cad605862a24 beryl-settings-simple-0.1.9999.2.tar.bz2 152026 -SHA256 f8b1197b86315aca4da700b98599ed647dfe5d02d32da11d4f4ab541fceb0288 beryl-settings-simple-0.1.9999.2.tar.bz2 152026 diff --git a/x11-misc/beryl-settings-simple/files/digest-beryl-settings-simple-0.2.0 b/x11-misc/beryl-settings-simple/files/digest-beryl-settings-simple-0.2.0 deleted file mode 100644 index 930f93741..000000000 --- a/x11-misc/beryl-settings-simple/files/digest-beryl-settings-simple-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 a557d74b258e30a26efa6c36d56db00d beryl-settings-simple-0.2.0.tar.bz2 158555 -RMD160 f579ff612ac7ebf231db5719f817bcdeb7a4d3a3 beryl-settings-simple-0.2.0.tar.bz2 158555 -SHA256 4ba5e1fa0cf987b5aac5ac86db7eb6f1ad79d54a4bab7c441735aba6dfb130ca beryl-settings-simple-0.2.0.tar.bz2 158555 diff --git a/x11-misc/beryl-settings/Manifest b/x11-misc/beryl-settings/Manifest deleted file mode 100644 index 219c07f2a..000000000 --- a/x11-misc/beryl-settings/Manifest +++ /dev/null @@ -1,48 +0,0 @@ -DIST beryl-settings-0.1.3.tar.bz2 231207 RMD160 bff486b267c44dc32a36430d66bce5493e509f4f SHA1 2ba5e62907e6745dc638c94fa79853e72ef5244c SHA256 8fbc5ae8ac22812319fed1db5ed66db669a5f1cf320661b0611359dc80fbb8a8 -DIST beryl-settings-0.1.4.tar.bz2 232895 RMD160 bd82996e68ca9acdf385106549eb11636051a48b SHA1 abc3d9e0edee491f5a34fec9e5c01b6dc0972b01 SHA256 dd40761ed9fe2b6d1e2d66aeed457cf5de5bee6d574ec369ec8a6766cc90e593 -DIST beryl-settings-0.1.99.2.tar.bz2 205545 RMD160 219538bbc6a4b37a31c9b2759106dc92ceb1fdf8 SHA1 4c3e48d55ae51ac4c56e7e5c9a25bb4de1e5c23a SHA256 58f65a754e060ddc5ebf88bfc89d0228d719ec7e575dee89047106c4dbbe0774 -DIST beryl-settings-0.1.9999.1.tar.bz2 251652 RMD160 3c6a13ee860839afea32958f9ff8fd97ea8c6ae7 SHA1 fbdf9bbb9d5dfdd5062e6bb42b8e6b1cac51f20f SHA256 c8dfb85b73b5b4db92ff753bbf6404965d2a07af21be8b9b74533693f47eb85d -DIST beryl-settings-0.1.9999.2.tar.bz2 251548 RMD160 5f3fd179ff58e1c5cb0af6dabe943c30a9ed3bee SHA1 f36dfb3ff4fcfa53a4e52a2a79ac17b6b81c570c SHA256 a9f0736c64a0f64c13284365e6d6f071b03f9def9d2c3748081af34231cdb22b -DIST beryl-settings-0.2.0.tar.bz2 355456 RMD160 37cd01d8fe3a2576ed859b610630cc920005f29e SHA1 e3e4b0599b783fc3185aa7a109b91b2db5b49288 SHA256 96340ce11159ccfb103997ee5749d59695c47075bc53301f8ac7d6f2a50dfb09 -EBUILD beryl-settings-0.1.3-r1.ebuild 685 RMD160 ef5b37702f4559794b8b06bceb1ed808f0d0c23b SHA1 3ddac71541dee75ab5771755e4506fe3034fe22c SHA256 b8cff6489b5c6f23f8511615b411a6e1473a0065b9764a44bf0fadacbd872f17 -MD5 968f620284efc9ce642fea82f57dfb91 beryl-settings-0.1.3-r1.ebuild 685 -RMD160 ef5b37702f4559794b8b06bceb1ed808f0d0c23b beryl-settings-0.1.3-r1.ebuild 685 -SHA256 b8cff6489b5c6f23f8511615b411a6e1473a0065b9764a44bf0fadacbd872f17 beryl-settings-0.1.3-r1.ebuild 685 -EBUILD beryl-settings-0.1.4.ebuild 1251 RMD160 5e21bc7ffa7e31a12ad3094f4b5d8109108480bc SHA1 eaa742099ef911cc0bc97490ad2175a0733e3447 SHA256 30ffa419351938c2abf20af52bca86fe70ab7b97f8d01e6618b326df0d445c94 -MD5 145f4fd706a4f0613a0f17c0c6f794d1 beryl-settings-0.1.4.ebuild 1251 -RMD160 5e21bc7ffa7e31a12ad3094f4b5d8109108480bc beryl-settings-0.1.4.ebuild 1251 -SHA256 30ffa419351938c2abf20af52bca86fe70ab7b97f8d01e6618b326df0d445c94 beryl-settings-0.1.4.ebuild 1251 -EBUILD beryl-settings-0.1.99.2.ebuild 1312 RMD160 81975822e4ee23ababc0d1e4886159969545da8f SHA1 694bd222324c7c7a0b0a2113c11adb7f0dc47ed5 SHA256 86349842f68f5495538551f549547f25548b2a395036a46d8bd8b9d5fabfd661 -MD5 58a2bd1558d98c1043db3898aecdc586 beryl-settings-0.1.99.2.ebuild 1312 -RMD160 81975822e4ee23ababc0d1e4886159969545da8f beryl-settings-0.1.99.2.ebuild 1312 -SHA256 86349842f68f5495538551f549547f25548b2a395036a46d8bd8b9d5fabfd661 beryl-settings-0.1.99.2.ebuild 1312 -EBUILD beryl-settings-0.1.9999.1.ebuild 1312 RMD160 81975822e4ee23ababc0d1e4886159969545da8f SHA1 694bd222324c7c7a0b0a2113c11adb7f0dc47ed5 SHA256 86349842f68f5495538551f549547f25548b2a395036a46d8bd8b9d5fabfd661 -MD5 58a2bd1558d98c1043db3898aecdc586 beryl-settings-0.1.9999.1.ebuild 1312 -RMD160 81975822e4ee23ababc0d1e4886159969545da8f beryl-settings-0.1.9999.1.ebuild 1312 -SHA256 86349842f68f5495538551f549547f25548b2a395036a46d8bd8b9d5fabfd661 beryl-settings-0.1.9999.1.ebuild 1312 -EBUILD beryl-settings-0.1.9999.2.ebuild 1347 RMD160 f43a90be8f5f5962a834c01d2adbcceeb5166dc5 SHA1 8f43956f3edb445ade6097032c6af57ebb10514a SHA256 0659346d2761ebfc3ba06eefd0d3f8a698c9403955629cbbbd9be245e325bf8f -MD5 5a9998b62be65db8130e3dabf652b63c beryl-settings-0.1.9999.2.ebuild 1347 -RMD160 f43a90be8f5f5962a834c01d2adbcceeb5166dc5 beryl-settings-0.1.9999.2.ebuild 1347 -SHA256 0659346d2761ebfc3ba06eefd0d3f8a698c9403955629cbbbd9be245e325bf8f beryl-settings-0.1.9999.2.ebuild 1347 -EBUILD beryl-settings-0.2.0.ebuild 1367 RMD160 a473eec1bc60d0511859ce4e4bea1999eda20cbb SHA1 ae94123c995ef85bf8021ef36391ab068546353d SHA256 45b6abb6103c766952a2a578160cb789e1a54276497a94f528c8377a340f8375 -MD5 9f2640c394c7fe96bf0fb72edcf56123 beryl-settings-0.2.0.ebuild 1367 -RMD160 a473eec1bc60d0511859ce4e4bea1999eda20cbb beryl-settings-0.2.0.ebuild 1367 -SHA256 45b6abb6103c766952a2a578160cb789e1a54276497a94f528c8377a340f8375 beryl-settings-0.2.0.ebuild 1367 -MD5 a7c4e3ce9012e379c73b58887ebfecc7 files/digest-beryl-settings-0.1.3-r1 265 -RMD160 ee653aafe2dcd5537f21b148d6c6f128be68b22f files/digest-beryl-settings-0.1.3-r1 265 -SHA256 57397e66ebded9f8f44ba9fc868d5b68e22c63f58ad3294bf47e722ca5a0c531 files/digest-beryl-settings-0.1.3-r1 265 -MD5 07a419ecb0e33d3df3af20fbdec9f050 files/digest-beryl-settings-0.1.4 265 -RMD160 6dfb19f35d7aa5095cd44fc05f6d91d43fbbecbe files/digest-beryl-settings-0.1.4 265 -SHA256 d59affb7d50d6b796d7ebf6873a257f6215d938347457bc7f3ba95490e0e5870 files/digest-beryl-settings-0.1.4 265 -MD5 5ec1f3602fbbf4b739deea568871807c files/digest-beryl-settings-0.1.99.2 274 -RMD160 ae71078fd28cabbbf1e4d15881021fac81a8aefe files/digest-beryl-settings-0.1.99.2 274 -SHA256 403b48fe8ff054f6e1ff1a95c2a07b2c88077b53d777826ea54c8b7a23d1f9e0 files/digest-beryl-settings-0.1.99.2 274 -MD5 9a9fca8faf1bd4e5e6b47f75db39f965 files/digest-beryl-settings-0.1.9999.1 280 -RMD160 b20b7e491e01670603b685b2decd9d74e3ecb5e7 files/digest-beryl-settings-0.1.9999.1 280 -SHA256 dad9266373b63e36c8e1797aa556c5bae3d2daf2ad506fad3b3c5c4a4a86e081 files/digest-beryl-settings-0.1.9999.1 280 -MD5 bad16329fa7d82ca2865b851981a0fe4 files/digest-beryl-settings-0.1.9999.2 280 -RMD160 87a9f942a92294ae608caa1ee80d6d8cf3aa152f files/digest-beryl-settings-0.1.9999.2 280 -SHA256 0744d600be663e2f7e3205967b8c8aac683acdc1c5847925e778275eaeb97581 files/digest-beryl-settings-0.1.9999.2 280 -MD5 c92a98d7c11d40f49835689ae32c4a30 files/digest-beryl-settings-0.2.0 265 -RMD160 639b38fa634646e9c484ca5507604d2c4bf02434 files/digest-beryl-settings-0.2.0 265 -SHA256 974d258cb64bba32cfaca9633b65b8c34f70d8c6056bc31edec95d0948250a94 files/digest-beryl-settings-0.2.0 265 diff --git a/x11-misc/beryl-settings/beryl-settings-0.1.3-r1.ebuild b/x11-misc/beryl-settings/beryl-settings-0.1.3-r1.ebuild deleted file mode 100644 index aceaa3c1e..000000000 --- a/x11-misc/beryl-settings/beryl-settings-0.1.3-r1.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-misc/beryl-settings/beryl-settings-0.1.2.ebuild,v 1.1 2006/11/15 04:00:20 tsunam Exp $ - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://distfiles.gentoo-xeffects.org/beryl-releases/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="" -RESTRICT="nomirror" - -DEPEND=">=x11-libs/gtk+-2.8.0 - ~x11-wm/beryl-core-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-misc/beryl-settings/beryl-settings-0.1.4.ebuild b/x11-misc/beryl-settings/beryl-settings-0.1.4.ebuild deleted file mode 100644 index 8f3490d96..000000000 --- a/x11-misc/beryl-settings/beryl-settings-0.1.4.ebuild +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0 - ~x11-wm/beryl-core-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ebeep - einfo - einfo "If you cannot see the beryl splash sreen or snow" - einfo "Please re-enabled png and svg support in beryl-settings" - einfo "Then reload beryl and it will show up" - einfo -} diff --git a/x11-misc/beryl-settings/beryl-settings-0.1.99.2.ebuild b/x11-misc/beryl-settings/beryl-settings-0.1.99.2.ebuild deleted file mode 100644 index b3ce21272..000000000 --- a/x11-misc/beryl-settings/beryl-settings-0.1.99.2.ebuild +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -#LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -#for X in ${LANGS} ; do -# IUSE="${IUSE} linguas_${X}" -#done - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0 - ~x11-wm/beryl-core-${PV}" - -RDEPEND="~x11-misc/beryl-settings-bindings-${PV}" - -#pkg_setup() { -# strip-linguas ${LANGS} -# -# if [ -z "${LINGUAS}" ]; then -# export LINGUAS_BERYL="en_GB" -# ewarn -# ewarn " To get a localized build, set the according LINGUAS variable(s). " -# ewarn -# else -# export LINGUAS_BERYL=`echo ${LINGUAS}` -# fi -#} - -src_compile() { - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ebeep - einfo - einfo "If you cannot see the beryl splash sreen or snow" - einfo "Please re-enabled png and svg support in beryl-settings" - einfo "Then reload beryl and it will show up" - einfo -} diff --git a/x11-misc/beryl-settings/beryl-settings-0.1.9999.1.ebuild b/x11-misc/beryl-settings/beryl-settings-0.1.9999.1.ebuild deleted file mode 100644 index b3ce21272..000000000 --- a/x11-misc/beryl-settings/beryl-settings-0.1.9999.1.ebuild +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -#LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -#for X in ${LANGS} ; do -# IUSE="${IUSE} linguas_${X}" -#done - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0 - ~x11-wm/beryl-core-${PV}" - -RDEPEND="~x11-misc/beryl-settings-bindings-${PV}" - -#pkg_setup() { -# strip-linguas ${LANGS} -# -# if [ -z "${LINGUAS}" ]; then -# export LINGUAS_BERYL="en_GB" -# ewarn -# ewarn " To get a localized build, set the according LINGUAS variable(s). " -# ewarn -# else -# export LINGUAS_BERYL=`echo ${LINGUAS}` -# fi -#} - -src_compile() { - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ebeep - einfo - einfo "If you cannot see the beryl splash sreen or snow" - einfo "Please re-enabled png and svg support in beryl-settings" - einfo "Then reload beryl and it will show up" - einfo -} diff --git a/x11-misc/beryl-settings/beryl-settings-0.1.9999.2.ebuild b/x11-misc/beryl-settings/beryl-settings-0.1.9999.2.ebuild deleted file mode 100644 index 81d520a87..000000000 --- a/x11-misc/beryl-settings/beryl-settings-0.1.9999.2.ebuild +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -#LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -#for X in ${LANGS} ; do -# IUSE="${IUSE} linguas_${X}" -#done - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0 - ~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.16.1" - -RDEPEND="~x11-misc/beryl-settings-bindings-${PV}" - -#pkg_setup() { -# strip-linguas ${LANGS} -# -# if [ -z "${LINGUAS}" ]; then -# export LINGUAS_BERYL="en_GB" -# ewarn -# ewarn " To get a localized build, set the according LINGUAS variable(s). " -# ewarn -# else -# export LINGUAS_BERYL=`echo ${LINGUAS}` -# fi -#} - -src_compile() { - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ebeep - einfo - einfo "If you cannot see the beryl splash sreen or snow" - einfo "Please re-enabled png and svg support in beryl-settings" - einfo "Then reload beryl and it will show up" - einfo -} diff --git a/x11-misc/beryl-settings/beryl-settings-0.2.0.ebuild b/x11-misc/beryl-settings/beryl-settings-0.2.0.ebuild deleted file mode 100644 index 029c58222..000000000 --- a/x11-misc/beryl-settings/beryl-settings-0.2.0.ebuild +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -#LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -#for X in ${LANGS} ; do -# IUSE="${IUSE} linguas_${X}" -#done - -DESCRIPTION="Beryl Window Decorator Settings" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -RESTRICT="nomirror" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-libs/gtk+-2.8.0 - ~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.16.1" - -RDEPEND="~x11-misc/beryl-settings-bindings-${PV}" - -#pkg_setup() { -# strip-linguas ${LANGS} -# -# if [ -z "${LINGUAS}" ]; then -# export LINGUAS_BERYL="en_GB" -# ewarn -# ewarn " To get a localized build, set the according LINGUAS variable(s). " -# ewarn -# else -# export LINGUAS_BERYL=`echo ${LINGUAS}` -# fi -#} - -src_compile() { - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ebeep - einfo - einfo "If you cannot see the beryl splash sreen or snow" - einfo "Please re-enabled png and svg support in beryl-settings" - einfo "Then reload beryl and it will show up" - einfo -} diff --git a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.3-r1 b/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.3-r1 deleted file mode 100644 index 8dfc04a9b..000000000 --- a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.3-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 bd88d56f32b23d42d44c85a92f0654f3 beryl-settings-0.1.3.tar.bz2 231207 -RMD160 bff486b267c44dc32a36430d66bce5493e509f4f beryl-settings-0.1.3.tar.bz2 231207 -SHA256 8fbc5ae8ac22812319fed1db5ed66db669a5f1cf320661b0611359dc80fbb8a8 beryl-settings-0.1.3.tar.bz2 231207 diff --git a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.4 b/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.4 deleted file mode 100644 index 10751920b..000000000 --- a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.4 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 527c6cf2a91d7249b409f123602709f6 beryl-settings-0.1.4.tar.bz2 232895 -RMD160 bd82996e68ca9acdf385106549eb11636051a48b beryl-settings-0.1.4.tar.bz2 232895 -SHA256 dd40761ed9fe2b6d1e2d66aeed457cf5de5bee6d574ec369ec8a6766cc90e593 beryl-settings-0.1.4.tar.bz2 232895 diff --git a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.99.2 b/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.99.2 deleted file mode 100644 index 221dde01e..000000000 --- a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.99.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 268098ad5bb563d0c5abbbc3af81f00f beryl-settings-0.1.99.2.tar.bz2 205545 -RMD160 219538bbc6a4b37a31c9b2759106dc92ceb1fdf8 beryl-settings-0.1.99.2.tar.bz2 205545 -SHA256 58f65a754e060ddc5ebf88bfc89d0228d719ec7e575dee89047106c4dbbe0774 beryl-settings-0.1.99.2.tar.bz2 205545 diff --git a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.9999.1 b/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.9999.1 deleted file mode 100644 index 7f7c6ece5..000000000 --- a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 77d42004275638bbba38dd0abdbb3f95 beryl-settings-0.1.9999.1.tar.bz2 251652 -RMD160 3c6a13ee860839afea32958f9ff8fd97ea8c6ae7 beryl-settings-0.1.9999.1.tar.bz2 251652 -SHA256 c8dfb85b73b5b4db92ff753bbf6404965d2a07af21be8b9b74533693f47eb85d beryl-settings-0.1.9999.1.tar.bz2 251652 diff --git a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.9999.2 b/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.9999.2 deleted file mode 100644 index 00e65cb8e..000000000 --- a/x11-misc/beryl-settings/files/digest-beryl-settings-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 3cbb0d585cc69d2a9a3c37f113b9f9e8 beryl-settings-0.1.9999.2.tar.bz2 251548 -RMD160 5f3fd179ff58e1c5cb0af6dabe943c30a9ed3bee beryl-settings-0.1.9999.2.tar.bz2 251548 -SHA256 a9f0736c64a0f64c13284365e6d6f071b03f9def9d2c3748081af34231cdb22b beryl-settings-0.1.9999.2.tar.bz2 251548 diff --git a/x11-misc/beryl-settings/files/digest-beryl-settings-0.2.0 b/x11-misc/beryl-settings/files/digest-beryl-settings-0.2.0 deleted file mode 100644 index 964ecb86a..000000000 --- a/x11-misc/beryl-settings/files/digest-beryl-settings-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 cc58ac1aae61bb4dae8e6da693c398a2 beryl-settings-0.2.0.tar.bz2 355456 -RMD160 37cd01d8fe3a2576ed859b610630cc920005f29e beryl-settings-0.2.0.tar.bz2 355456 -SHA256 96340ce11159ccfb103997ee5749d59695c47075bc53301f8ac7d6f2a50dfb09 beryl-settings-0.2.0.tar.bz2 355456 diff --git a/x11-misc/hwdb-client/Manifest b/x11-misc/hwdb-client/Manifest deleted file mode 100644 index 4b9d2800e..000000000 --- a/x11-misc/hwdb-client/Manifest +++ /dev/null @@ -1,23 +0,0 @@ -AUX sabayon-install.py 1015 RMD160 80f18fa2763a649aa0834110380a2eb9da912242 SHA1 67b72a1d2b2430762e4318c4ac44dc7829d59b96 SHA256 93fb24596ef919f286ebbb8e13074e0a1fbda04938770c453f38d2ba164f8711 -MD5 49b2469be722fd61a47c4bf0d7eae4f9 files/sabayon-install.py 1015 -RMD160 80f18fa2763a649aa0834110380a2eb9da912242 files/sabayon-install.py 1015 -SHA256 93fb24596ef919f286ebbb8e13074e0a1fbda04938770c453f38d2ba164f8711 files/sabayon-install.py 1015 -DIST hwdb-client_0.6-0ubuntu16.tar.gz 4546888 RMD160 46a0fa2a6d5f52b55a2731a577ddce917c6c93c4 SHA1 cbe9aa749ed4670f2a5d0be62268f1c070e4b70c SHA256 badecc33337c89ebbf9df882374f554cc4e5660dbed5e081d7748bcb9c6f301f -EBUILD hwdb-client-0.6.ebuild 1229 RMD160 e632a450e5839dac043d01d6562d5c5a0b6a6030 SHA1 f8d470602bfc77d39e3a7a70f5531deffc3e2d32 SHA256 67c0395adad93f7b8c2ec338d37af123b0ed11cca64c459772a96ec9b2b6e9fa -MD5 fb8e954ecfc76d58d5d0a9b83038a7a2 hwdb-client-0.6.ebuild 1229 -RMD160 e632a450e5839dac043d01d6562d5c5a0b6a6030 hwdb-client-0.6.ebuild 1229 -SHA256 67c0395adad93f7b8c2ec338d37af123b0ed11cca64c459772a96ec9b2b6e9fa hwdb-client-0.6.ebuild 1229 -EBUILD hwdb-client-9999.ebuild 1294 RMD160 23be85d6adced6b93c7049b8f41d968ce318748c SHA1 ede2b422cbf350d39ce4a9bb0d33542df7a08f39 SHA256 8b2a35053b79df93a82ff17de2eadc8ffaa1fa81f919c85da9175e3cc2700808 -MD5 fb56c94b5811f52d9cc417f1221849e2 hwdb-client-9999.ebuild 1294 -RMD160 23be85d6adced6b93c7049b8f41d968ce318748c hwdb-client-9999.ebuild 1294 -SHA256 8b2a35053b79df93a82ff17de2eadc8ffaa1fa81f919c85da9175e3cc2700808 hwdb-client-9999.ebuild 1294 -MISC hwdb-client-9999.ebuild~ 1284 RMD160 6e61e5fb6337cdee3e781ad6fd288a6acc68963c SHA1 28cf9751ab91b452615475ed73ec4c3018f2b737 SHA256 ffe2609ec492cb7fa2531d404e148e6291d5184d9feb70dc54617eb173600bda -MD5 d8c8d1d02364d032ed85d292ac8c2585 hwdb-client-9999.ebuild~ 1284 -RMD160 6e61e5fb6337cdee3e781ad6fd288a6acc68963c hwdb-client-9999.ebuild~ 1284 -SHA256 ffe2609ec492cb7fa2531d404e148e6291d5184d9feb70dc54617eb173600bda hwdb-client-9999.ebuild~ 1284 -MD5 e84ee1939637ac062097cb8636e33514 files/digest-hwdb-client-0.6 280 -RMD160 f0c72a679cf883e490adcd1789c0316949801e79 files/digest-hwdb-client-0.6 280 -SHA256 d938114e948c4495ce186ed3ff3a5107a8a9e0a7b3f1beb273c770a0fb0a4525 files/digest-hwdb-client-0.6 280 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-hwdb-client-9999 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-hwdb-client-9999 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-hwdb-client-9999 0 diff --git a/x11-misc/hwdb-client/files/digest-hwdb-client-0.6 b/x11-misc/hwdb-client/files/digest-hwdb-client-0.6 deleted file mode 100644 index 450e6a249..000000000 --- a/x11-misc/hwdb-client/files/digest-hwdb-client-0.6 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 adf59dc4802805685dade7f3b7c0a83d hwdb-client_0.6-0ubuntu16.tar.gz 4546888 -RMD160 46a0fa2a6d5f52b55a2731a577ddce917c6c93c4 hwdb-client_0.6-0ubuntu16.tar.gz 4546888 -SHA256 badecc33337c89ebbf9df882374f554cc4e5660dbed5e081d7748bcb9c6f301f hwdb-client_0.6-0ubuntu16.tar.gz 4546888 diff --git a/x11-misc/hwdb-client/files/digest-hwdb-client-9999 b/x11-misc/hwdb-client/files/digest-hwdb-client-9999 deleted file mode 100644 index e69de29bb..000000000 diff --git a/x11-misc/hwdb-client/files/sabayon-install.py b/x11-misc/hwdb-client/files/sabayon-install.py deleted file mode 100644 index ac606fbeb..000000000 --- a/x11-misc/hwdb-client/files/sabayon-install.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/python -# hwdb-client debian installer wrapper -# you need to run this inside the root of the hwdb-client sources - -import os - -# variables -debianDirList = os.listdir("debian") -installerOutput = "install.sh" -outfile = [] - -for file in debianDirList: - if file.endswith(".install"): - f = open("debian/"+file,"r") - content = f.readlines() - f.close() - for line in content: - line = line.strip().split() - if len(line) == 2: - outfile.append("cp -Rp "+line[0]+" ${D}"+line[1]) - f.close() - -# fix /usr/lib/python2.4 path -import re -newoutfile = [] -for line in outfile: - if line.find("python2.4") != -1: - out = re.subn('2.4',"${PYVER}", line) - line = out - if len(line) == 2: - newoutfile.append(line[0]+"\n") - else: - newoutfile.append(line+"\n") - -outfile = newoutfile -del newoutfile - -f = open(installerOutput,"w") -f.write("#!/bin/sh\n") -f.writelines(outfile) -f.flush() -f.close() -os.chmod(installerOutput,0700) diff --git a/x11-misc/hwdb-client/hwdb-client-0.6.ebuild b/x11-misc/hwdb-client/hwdb-client-0.6.ebuild deleted file mode 100644 index e1552e86d..000000000 --- a/x11-misc/hwdb-client/hwdb-client-0.6.ebuild +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2006 Sabayon Linux -# Distributed under the terms of the GNU General Public License v2 - -inherit distutils - -UBUNTU_REV="0ubuntu16" -DESCRIPTION="Hardware Database Client, useful to collect and report hardware information" -HOMEPAGE="http://www.sabayonlinux.org" -SRC_URI="http://www.sabayonlinux.org/distfiles/x11-misc/${PN}_${PV}-${UBUNTU_REV}.tar.gz" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" -IUSE="gtk qt4" - -DEPEND="=dev-lang/python-2.4* - qt4? (dev-python/PyQt4) - net-analyzer/fping" - -RDEPEND="${DEPEND}" - -src_unpack() { - unpack ${A} - # well'add our patches here - cp ${FILESDIR}/sabayon-install.py ${S}/setup.py -} - -src_compile() { - einfo "no compilation needed" - cd ${S} - # run our installer wrapper - python setup.py -} - -src_install() { - distutils_python_version - cd ${S} - - dodir /usr/bin - dodir /usr/share/hwdb-client - dodir /usr/share/locale - dodir /usr/share/applications/kde - dodir /usr/lib/python${PYVER}/site-packages/hwdb_client - dodir /usr/share/apps/hwdb-client-kde/pics - dodir /usr/share/icons/crystalsvg/22x22/apps - dodir /usr/share/gnome/help/hwdb-client/C - - # prepare dirs - ./install.sh - - if ! use qt4; then - rm ${D}/usr/bin/hwdb-kde - rm ${D}/usr/share/apps/hwdb-client-kde -rf - fi - -} diff --git a/x11-misc/hwdb-client/hwdb-client-9999.ebuild b/x11-misc/hwdb-client/hwdb-client-9999.ebuild deleted file mode 100644 index b4e77db76..000000000 --- a/x11-misc/hwdb-client/hwdb-client-9999.ebuild +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2006 Sabayon Linux -# Distributed under the terms of the GNU General Public License v2 - -WANT_AUTOMAKE="latest" -WANT_AUTOCONF="latest" - -inherit subversion distutils - -ESVN_REPO_URI="http://svn.sabayonlinux.org/projects/${PN}/trunk" - -DESCRIPTION="Hardware Database Client, useful to collect and report hardware information" -HOMEPAGE="http://www.sabayonlinux.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="-*" -IUSE="gtk qt4" - -DEPEND="=dev-lang/python-2.4* - qt4? (dev-python/PyQt4) - net-analyzer/fping" - -RDEPEND="${DEPEND}" - -S="${WORKDIR}/trunk" - -src_compile() { - ewarn "This is SVN release!" - einfo "No compilation needed as made with PyQt4" - cd ${S} - # run our installer wrapper - python sabayon-install.py -} - -src_install() { - distutils_python_version - cd ${S} - - dodir /usr/bin - dodir /usr/share/hwdb-client - dodir /usr/share/locale - dodir /usr/share/applications/kde - dodir /usr/lib/python${PYVER}/site-packages/hwdb_client - dodir /usr/share/apps/hwdb-client-kde/pics - dodir /usr/share/icons/crystalsvg/22x22/apps - dodir /usr/share/gnome/help/hwdb-client/C - - # prepare dirs - ./install.sh - - if ! use qt4; then - rm ${D}/usr/bin/hwdb-kde - rm ${D}/usr/share/apps/hwdb-client-kde -rf - fi - -} - -pkg_postinst() { - einfo "Please report all bugs to http://bugs.sabayonlinux.org" -} diff --git a/x11-misc/pyXgl/Manifest b/x11-misc/pyXgl/Manifest deleted file mode 100644 index 1ed0ca101..000000000 --- a/x11-misc/pyXgl/Manifest +++ /dev/null @@ -1,12 +0,0 @@ -DIST pyXgl.tar.gz 1080057 RMD160 32c1d47fce107298fe6c23aef3051b1992853a2d SHA1 c3f44294f16ab93f75f8a08a4fbef6657d365e59 SHA256 c507a499adef11f6b55bc9de0594b80a95587d8872cc9481cae3ba6f13484ea7 -EBUILD pyXgl-0.1-r1.ebuild 1147 RMD160 4c8906370bf3d0b3c2987b29ebd38eb762196c07 SHA1 9e20d0a8ce334f1c0574eb55cdd9430ec90068d1 SHA256 d0ebef61962c9d75048bef5c7feef0da5e00c0465ce73746d955d83a3631d67f -MD5 3c0ffb11349a2e71f2c4b4d121faec80 pyXgl-0.1-r1.ebuild 1147 -RMD160 4c8906370bf3d0b3c2987b29ebd38eb762196c07 pyXgl-0.1-r1.ebuild 1147 -SHA256 d0ebef61962c9d75048bef5c7feef0da5e00c0465ce73746d955d83a3631d67f pyXgl-0.1-r1.ebuild 1147 -MISC pyXgl-0.1-r1.ebuild~ 1324 RMD160 5a86733554014de01a33f8b9c206a8988f1e4e4b SHA1 ebfb50489b6a31652485516e9cdad83c184105aa SHA256 9a66d4042dbeff2f39baec43bade7ef1395c40fb83e9358737af00381ae66245 -MD5 3919a1c0b0ebb7069b5fdd633ea33da7 pyXgl-0.1-r1.ebuild~ 1324 -RMD160 5a86733554014de01a33f8b9c206a8988f1e4e4b pyXgl-0.1-r1.ebuild~ 1324 -SHA256 9a66d4042dbeff2f39baec43bade7ef1395c40fb83e9358737af00381ae66245 pyXgl-0.1-r1.ebuild~ 1324 -MD5 56b914c6a01a1bb3294d1fd3f55bafff files/digest-pyXgl-0.1-r1 220 -RMD160 4f62bcb15a3054b3ad6b441a8c5d57a19e4509a0 files/digest-pyXgl-0.1-r1 220 -SHA256 d659d2f7ae0324cfb52d9484430575a123265061449d0dd4e88e59ca73d828d5 files/digest-pyXgl-0.1-r1 220 diff --git a/x11-misc/pyXgl/files/digest-pyXgl-0.1-r1 b/x11-misc/pyXgl/files/digest-pyXgl-0.1-r1 deleted file mode 100644 index 80ea35f1a..000000000 --- a/x11-misc/pyXgl/files/digest-pyXgl-0.1-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 2a3154a8ed950c77a0c0aa574846c4ab pyXgl.tar.gz 1080057 -RMD160 32c1d47fce107298fe6c23aef3051b1992853a2d pyXgl.tar.gz 1080057 -SHA256 c507a499adef11f6b55bc9de0594b80a95587d8872cc9481cae3ba6f13484ea7 pyXgl.tar.gz 1080057 diff --git a/x11-misc/pyXgl/pyXgl-0.1-r1.ebuild b/x11-misc/pyXgl/pyXgl-0.1-r1.ebuild deleted file mode 100644 index 31570e20c..000000000 --- a/x11-misc/pyXgl/pyXgl-0.1-r1.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -## Package by jhawk of Sabayon Linux ## -## Ebuild by cvill64/rubengonc of Sabayon Linux ## - -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ -inherit eutils - -DESCRIPTION="A GUI configuration tool for XGL under KDE" -SRC_URI=" http://sabayonlinuxdev.com/distfiles/x11-apps/pyXgl.tar.gz " -HOMEPAGE="http://sabayonlinuxdev.com/xglconfig/" -SLOT="0" -LICENSE="GPL-2" -GENTOO_MIRRORS="" -KEYWORDS="~x86 ~amd64" -RDEPEND="${DEPEND} - kde-base/kdelibs - dev-lang/python - x11-base/xgl - dev-python/PyQt - " -S=${WORKDIR}/${PN} -src_unpack() { - unpack ${A} - } - -src_compile() { - einfo "Nothing to compile" - } - -src_install() { - - dodir /usr/share/pyXgl - cp -dPR pyXgl ${D}/usr/share/pyXgl - dosymlink -s /usr/bin/pyXgl - -# install to menu using eutils.eclass - domenu pyXgl.desktop - doicon pyXgl.png -} - -pkg_postinst() { - echo - einfo "The program requires that you are using Xgl." - einfo "For further information about Xgl settings" - einfo "visit http://gentoo-wiki.com/Xgl" - einfo "This version works best in KDE." - einfo "Installed to /usr/share/pyXgl" - } diff --git a/x11-misc/wxXgl/Manifest b/x11-misc/wxXgl/Manifest deleted file mode 100644 index 25adc2650..000000000 --- a/x11-misc/wxXgl/Manifest +++ /dev/null @@ -1,12 +0,0 @@ -DIST wxXgl-0.1.tar.gz 278721 RMD160 6a590695c84e3f2ab635308d0b966de109a3ae0f SHA1 694078915fb50f23c80035287f17870f59e885c4 SHA256 38eb8c177cbb8a220f891564b4adb0092ed89fea6eb2e97e94d444e6793dd7d5 -EBUILD wxXgl-0.1-r1.ebuild 1283 RMD160 f0f8d9de6a61d369542d620478109c2ffed3f678 SHA1 278b8cf7076fc73526beae9d569f389310ef586e SHA256 74f1ec785e0169d1306907427ea4c81be1b60f5579290348536181c49a86cd3a -MD5 850c391577a05388b4e37ef94903c833 wxXgl-0.1-r1.ebuild 1283 -RMD160 f0f8d9de6a61d369542d620478109c2ffed3f678 wxXgl-0.1-r1.ebuild 1283 -SHA256 74f1ec785e0169d1306907427ea4c81be1b60f5579290348536181c49a86cd3a wxXgl-0.1-r1.ebuild 1283 -MISC wxXgl-0.1-r1.ebuild~ 1279 RMD160 47e9c383d23eae68d56a8d12f95eac48d6d50ed0 SHA1 9d3312f2ff569039af170262d5c234c03393ac21 SHA256 ea96698858a44aefff5cde314832501da45cf350c2f8d887aa16bb64f0782798 -MD5 a19fd112f9e1d5ccc2ae2699ee58b33f wxXgl-0.1-r1.ebuild~ 1279 -RMD160 47e9c383d23eae68d56a8d12f95eac48d6d50ed0 wxXgl-0.1-r1.ebuild~ 1279 -SHA256 ea96698858a44aefff5cde314832501da45cf350c2f8d887aa16bb64f0782798 wxXgl-0.1-r1.ebuild~ 1279 -MD5 b28559de70a367a5baf2caa7f8167684 files/digest-wxXgl-0.1-r1 229 -RMD160 b92b4f68d182fd77d42b350aec6876f0408b3589 files/digest-wxXgl-0.1-r1 229 -SHA256 644e5ef1a767ffa1a743e2de5eb3df57114a3051168768ada4b720936f664155 files/digest-wxXgl-0.1-r1 229 diff --git a/x11-misc/wxXgl/files/digest-wxXgl-0.1-r1 b/x11-misc/wxXgl/files/digest-wxXgl-0.1-r1 deleted file mode 100644 index 6b083e759..000000000 --- a/x11-misc/wxXgl/files/digest-wxXgl-0.1-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 20c6839869abe771b5ba48b6c0b73fcc wxXgl-0.1.tar.gz 278721 -RMD160 6a590695c84e3f2ab635308d0b966de109a3ae0f wxXgl-0.1.tar.gz 278721 -SHA256 38eb8c177cbb8a220f891564b4adb0092ed89fea6eb2e97e94d444e6793dd7d5 wxXgl-0.1.tar.gz 278721 diff --git a/x11-misc/wxXgl/wxXgl-0.1-r1.ebuild b/x11-misc/wxXgl/wxXgl-0.1-r1.ebuild deleted file mode 100644 index 08250e525..000000000 --- a/x11-misc/wxXgl/wxXgl-0.1-r1.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -## Package by jhawk of Sabayon Linux ## -## Ebuild by cvill64/rubengonc of Sabayon Linux ## -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ -inherit eutils - -DESCRIPTION="A GUI configuration tool for XGL under gnome" -SRC_URI=" http://sabayonlinuxdev.com/distfiles/x11-apps/wxXgl-0.1.tar.gz " -HOMEPAGE="http://sabayonlinuxdev.com/xglconfig/" -SLOT="0" -LICENSE="GPL-2" -GENTOO_MIRRORS="" -KEYWORDS="~x86 ~amd64" -RDEPEND="${DEPEND} - gnome-base/libgnome - dev-lang/python - dev-python/wxpython - x11-base/xgl - x11-libs/gksu - " - -S=${WORKDIR}/${PN} -src_unpack() { - unpack ${A} - } - -src_compile() { - einfo "Nothing to compile" - } - -src_install() { -# no need to compile, just moving programs to the correct places - dodir /usr/share/wxXgl - cp -dPR wxXgl ${D}/usr/share/wxXgl - dosymlink /usr/bin/wxXgl - -# install to menu using eutils.eclass -domenu wxXgl.desktop -doicon wxXgl.png -} - -pkg_postinst() { - echo - einfo "The program requires that you are using Xgl." - einfo "For further information about Xgl settings" - einfo "visit http://gentoo-wiki.com/Xgl" - einfo "This version works best in gnome." - einfo "Installed to /usr/share/wxXgl" - } \ No newline at end of file diff --git a/x11-misc/xglswitch/Manifest b/x11-misc/xglswitch/Manifest deleted file mode 100644 index 4aa9ba476..000000000 --- a/x11-misc/xglswitch/Manifest +++ /dev/null @@ -1,24 +0,0 @@ -DIST xglswitch-1.0.tar.gz 43719 RMD160 bc23c192c1c28874642f5cb97113ee5e353a1434 SHA1 dde2065097611d9620de016b536316475629a5b8 SHA256 d23c2f8ba0510deddf5dfdd3105f3f251c768bfbf97c546fc0f76da18ffb6f06 -DIST xglswitch-1.1.tar.gz 43855 RMD160 ebbed9dd7c4774ab507611931dc062f48f5d8d4b SHA1 1954358ffb4061764dfc1e43e477854e7341d287 SHA256 9226df722763ad1571ca57e2838194198611cabd9d52d0afc8095905c84ef8f7 -EBUILD xglswitch-1.0.ebuild 1148 RMD160 282d3d7c15d570e0d3c07b6dcad92a12e4dca63f SHA1 a17b108b9fd2e1846990f220897c120ed0214ef3 SHA256 2ba9e4cc0246645caeb34ee307820e178aac790ab2d4c3c666d86abc4c991c39 -MD5 5371279256a16451f02d45c409b99347 xglswitch-1.0.ebuild 1148 -RMD160 282d3d7c15d570e0d3c07b6dcad92a12e4dca63f xglswitch-1.0.ebuild 1148 -SHA256 2ba9e4cc0246645caeb34ee307820e178aac790ab2d4c3c666d86abc4c991c39 xglswitch-1.0.ebuild 1148 -EBUILD xglswitch-1.1.ebuild 1148 RMD160 23bc7b3065b298edff4a2874c87d0e8ff93de8f9 SHA1 2fc434866eb5191f293c994dc297dfa2c438978c SHA256 87e6ec4efd321ab60ea11ce62e3b7f38de2976f4403b1f93a124a7f87619b7db -MD5 e163df5b55c17e9346ec259cb32a2bf2 xglswitch-1.1.ebuild 1148 -RMD160 23bc7b3065b298edff4a2874c87d0e8ff93de8f9 xglswitch-1.1.ebuild 1148 -SHA256 87e6ec4efd321ab60ea11ce62e3b7f38de2976f4403b1f93a124a7f87619b7db xglswitch-1.1.ebuild 1148 -MISC xglswitch-1.0.ebuild~ 1149 RMD160 dcb9ccba0382418a00ac7c5f03c391004d45c0ce SHA1 45cb5198a5d8f2695c9824f49d360c37a1c4ffa3 SHA256 c56cb3cfa22c5e117262a1e71016a598b3e07f15a6a08f55ef8a21240b9f5405 -MD5 9381d7e971398d3a7d0626a79c63bc02 xglswitch-1.0.ebuild~ 1149 -RMD160 dcb9ccba0382418a00ac7c5f03c391004d45c0ce xglswitch-1.0.ebuild~ 1149 -SHA256 c56cb3cfa22c5e117262a1e71016a598b3e07f15a6a08f55ef8a21240b9f5405 xglswitch-1.0.ebuild~ 1149 -MISC xglswitch-1.1.ebuild~ 1148 RMD160 282d3d7c15d570e0d3c07b6dcad92a12e4dca63f SHA1 a17b108b9fd2e1846990f220897c120ed0214ef3 SHA256 2ba9e4cc0246645caeb34ee307820e178aac790ab2d4c3c666d86abc4c991c39 -MD5 5371279256a16451f02d45c409b99347 xglswitch-1.1.ebuild~ 1148 -RMD160 282d3d7c15d570e0d3c07b6dcad92a12e4dca63f xglswitch-1.1.ebuild~ 1148 -SHA256 2ba9e4cc0246645caeb34ee307820e178aac790ab2d4c3c666d86abc4c991c39 xglswitch-1.1.ebuild~ 1148 -MD5 2f8c1cb421c88b1bf3c607fa5788d100 files/digest-xglswitch-1.0 238 -RMD160 817fa6f96f99fbb05bb2f591f44016dcb0be9684 files/digest-xglswitch-1.0 238 -SHA256 fd3ab6161233651ff3a513f2c609b67cfd8c9e27097268772496cbb478593e8d files/digest-xglswitch-1.0 238 -MD5 fbce5e17fd2400e60c41886ca094638e files/digest-xglswitch-1.1 238 -RMD160 de6ebff9ed65509b0c5eeaa4720a2c5a06409068 files/digest-xglswitch-1.1 238 -SHA256 90c0f36554a898f955afb8ce3cb73aa1d51496376bce8b32302d7e1c1574f9ab files/digest-xglswitch-1.1 238 diff --git a/x11-misc/xglswitch/files/digest-xglswitch-1.0 b/x11-misc/xglswitch/files/digest-xglswitch-1.0 deleted file mode 100644 index ac0f3b6e1..000000000 --- a/x11-misc/xglswitch/files/digest-xglswitch-1.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 6f177608ef0d75099db6b8d337449eb4 xglswitch-1.0.tar.gz 43719 -RMD160 bc23c192c1c28874642f5cb97113ee5e353a1434 xglswitch-1.0.tar.gz 43719 -SHA256 d23c2f8ba0510deddf5dfdd3105f3f251c768bfbf97c546fc0f76da18ffb6f06 xglswitch-1.0.tar.gz 43719 diff --git a/x11-misc/xglswitch/files/digest-xglswitch-1.1 b/x11-misc/xglswitch/files/digest-xglswitch-1.1 deleted file mode 100644 index 48f487448..000000000 --- a/x11-misc/xglswitch/files/digest-xglswitch-1.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 20bded2c9458ee8488bf028121879360 xglswitch-1.1.tar.gz 43855 -RMD160 ebbed9dd7c4774ab507611931dc062f48f5d8d4b xglswitch-1.1.tar.gz 43855 -SHA256 9226df722763ad1571ca57e2838194198611cabd9d52d0afc8095905c84ef8f7 xglswitch-1.1.tar.gz 43855 diff --git a/x11-misc/xglswitch/xglswitch-1.0.ebuild b/x11-misc/xglswitch/xglswitch-1.0.ebuild deleted file mode 100644 index e62ca5b1f..000000000 --- a/x11-misc/xglswitch/xglswitch-1.0.ebuild +++ /dev/null @@ -1,44 +0,0 @@ -## Package by jhawk of SabayonLinux ## -## Ebuild by cvill64 of SabayonLinux ## - -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ -inherit eutils - -DESCRIPTION="A GUI configuration tool to switch XGL, logon manager, and opengl settings" -SRC_URI="http://sabayonlinuxdev.com/distfiles/x11-misc/${PN}-1.0.tar.gz" -HOMEPAGE="http://sabayonlinuxdev.com/xglswitch/" -GENTOO_MIRRORS="http://sabayonlinuxdev.com/distfiles/" -SLOT="0" -LICENSE="GPL-2" -KEYWORDS="~x86 ~amd64" -RDEPEND="${DEPEND} - dev-lang/python - x11-base/xgl - " -S=${WORKDIR}/${PN} -src_unpack() { - unpack ${A} - } - -src_compile() { - einfo "Nothing to compile" - } - -src_install() { - - dodir /usr/share/xglswitch - cp -dPR ${S} ${D}/usr/share/ - dosym /usr/share/xglswitch/xglswitch /usr/bin/xglswitch - dodoc README - -# install to menu using eutils.eclass - domenu xglswitch.desktop - doicon compiz.png -} - -pkg_postinst() { - echo - einfo "The program requires that you are using Xgl and it is preconfigured." - einfo "For further information about Xgl settings visit http://gentoo-wiki.com/Xgl." - } \ No newline at end of file diff --git a/x11-misc/xglswitch/xglswitch-1.1.ebuild b/x11-misc/xglswitch/xglswitch-1.1.ebuild deleted file mode 100644 index 987d432f3..000000000 --- a/x11-misc/xglswitch/xglswitch-1.1.ebuild +++ /dev/null @@ -1,44 +0,0 @@ -## Package by jhawk of SabayonLinux ## -## Ebuild by cvill64 of SabayonLinux ## - -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ -inherit eutils - -DESCRIPTION="A GUI configuration tool to switch XGL, logon manager, and opengl settings" -SRC_URI="http://sabayonlinuxdev.com/distfiles/x11-misc/${PN}-1.1.tar.gz" -HOMEPAGE="http://sabayonlinuxdev.com/xglswitch/" -GENTOO_MIRRORS="http://sabayonlinuxdev.com/distfiles/" -SLOT="0" -LICENSE="GPL-2" -KEYWORDS="~x86 ~amd64" -RDEPEND="${DEPEND} - dev-lang/python - x11-base/xgl - " -S=${WORKDIR}/${PN} -src_unpack() { - unpack ${A} - } - -src_compile() { - einfo "Nothing to compile" - } - -src_install() { - - dodir /usr/share/xglswitch - cp -dPR ${S} ${D}/usr/share/ - dosym /usr/share/xglswitch/xglswitch /usr/bin/xglswitch - dodoc README - -# install to menu using eutils.eclass - domenu xglswitch.desktop - doicon compiz.png -} - -pkg_postinst() { - echo - einfo "The program requires that you are using Xgl and it is preconfigured." - einfo "For further information about Xgl settings visit http://gentoo-wiki.com/Xgl." - } \ No newline at end of file diff --git a/x11-plugins/beryl-plugins-unsupported/Manifest b/x11-plugins/beryl-plugins-unsupported/Manifest deleted file mode 100644 index f6afe7e83..000000000 --- a/x11-plugins/beryl-plugins-unsupported/Manifest +++ /dev/null @@ -1,24 +0,0 @@ -DIST beryl-plugins-unsupported-0.1.9999.1.tar.bz2 362211 RMD160 81a8121fae4854f16cfa713ba828e00e971d7131 SHA1 50dc05da0fc5e59cf0d0323481a493f00fe88f1e SHA256 0086d38cdead7e1111f31e978b9786870db89a6a467b195fb0aec2a6a3c9b126 -DIST beryl-plugins-unsupported-0.1.9999.2.tar.bz2 362679 RMD160 3e1bd206f759d983fc8b6e88fc641159a1ee1be8 SHA1 7552df78bdeaee2fd601f2b22f21ec34d778113d SHA256 cde94147a9efbce534908b7849d85b203407a17a35587272ad2607aa175cd8bb -DIST beryl-plugins-unsupported-0.2.0.tar.bz2 396967 RMD160 7b5f3244d1bfe9aaf86d658c7a707a164458005a SHA1 f1d99b0c60673143954276d07020c6b44b60c205 SHA256 d6824013e5ecce4a9b9ba65e4dafcc6fd7a3c63cd843cc981e1e4cb34b967a70 -EBUILD beryl-plugins-unsupported-0.1.9999.1.ebuild 912 RMD160 9885f61da3b29fb96e67f13645c02dfced6a35ae SHA1 bd55f2f32fbe6159e7a7c19afcdfe28eea0b069c SHA256 4d522727d2b193f9192bbc4dde3e4be387fed2f8d9d61c570f226249eb35a0d6 -MD5 8dfac6f85b1644a30854677d50132694 beryl-plugins-unsupported-0.1.9999.1.ebuild 912 -RMD160 9885f61da3b29fb96e67f13645c02dfced6a35ae beryl-plugins-unsupported-0.1.9999.1.ebuild 912 -SHA256 4d522727d2b193f9192bbc4dde3e4be387fed2f8d9d61c570f226249eb35a0d6 beryl-plugins-unsupported-0.1.9999.1.ebuild 912 -EBUILD beryl-plugins-unsupported-0.1.9999.2.ebuild 903 RMD160 d8a2208ca93a66a1f8a681c89eb0a9e499e0fc28 SHA1 83bed657e642f2414cdd423e0c5f4656b44cb41c SHA256 298236e3e60b3cc7b92e46b6911d9da0513324504e67dec4f1197437dee03a97 -MD5 ba97ded7b0b167cc80e52f3fb6dddcfd beryl-plugins-unsupported-0.1.9999.2.ebuild 903 -RMD160 d8a2208ca93a66a1f8a681c89eb0a9e499e0fc28 beryl-plugins-unsupported-0.1.9999.2.ebuild 903 -SHA256 298236e3e60b3cc7b92e46b6911d9da0513324504e67dec4f1197437dee03a97 beryl-plugins-unsupported-0.1.9999.2.ebuild 903 -EBUILD beryl-plugins-unsupported-0.2.0.ebuild 903 RMD160 d8a2208ca93a66a1f8a681c89eb0a9e499e0fc28 SHA1 83bed657e642f2414cdd423e0c5f4656b44cb41c SHA256 298236e3e60b3cc7b92e46b6911d9da0513324504e67dec4f1197437dee03a97 -MD5 ba97ded7b0b167cc80e52f3fb6dddcfd beryl-plugins-unsupported-0.2.0.ebuild 903 -RMD160 d8a2208ca93a66a1f8a681c89eb0a9e499e0fc28 beryl-plugins-unsupported-0.2.0.ebuild 903 -SHA256 298236e3e60b3cc7b92e46b6911d9da0513324504e67dec4f1197437dee03a97 beryl-plugins-unsupported-0.2.0.ebuild 903 -MD5 9ff3f8d7daa4989aed4f61c23f7aa667 files/digest-beryl-plugins-unsupported-0.1.9999.1 313 -RMD160 c4476b7f47a0bf3c8293cc976425a39fffaa4cb0 files/digest-beryl-plugins-unsupported-0.1.9999.1 313 -SHA256 e87694fea228ac2b289e7463bb01cfbb68c31f3df665420359eb40c14eb402dd files/digest-beryl-plugins-unsupported-0.1.9999.1 313 -MD5 33d48f9e732a83b17ab3f3fed8ef80a1 files/digest-beryl-plugins-unsupported-0.1.9999.2 313 -RMD160 395e70b6369a37e261d290aa50f841577a6df1dc files/digest-beryl-plugins-unsupported-0.1.9999.2 313 -SHA256 b24caaa4977021d2e50067fa4d46f6ec410bdd7a946076966267b80d1ee48d31 files/digest-beryl-plugins-unsupported-0.1.9999.2 313 -MD5 2490793c008cca0038c4048a028607ec files/digest-beryl-plugins-unsupported-0.2.0 298 -RMD160 a12278ea363959320245a1879ea604f7ccae8af3 files/digest-beryl-plugins-unsupported-0.2.0 298 -SHA256 9e6528b55ba6197a2319ea699cb13d8daa9528f8dec272e6f6a64dd8244c890b files/digest-beryl-plugins-unsupported-0.2.0 298 diff --git a/x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.1.9999.1.ebuild b/x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.1.9999.1.ebuild deleted file mode 100644 index eef0c3550..000000000 --- a/x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.1.9999.1.ebuild +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2004-2007 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ -inherit autotools eutils - -DESCRIPTION="Beryl Window Decorator Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND="~x11-plugins/beryl-plugins-${PV}" - -#pkg_setup() { -# strip-linguas ${LANGS} -# -# if [ -z "${LINGUAS}" ]; then -# export LINGUAS_BERYL="en_GB" -# ewarn -# ewarn " To get a localized build, set the according LINGUAS variable(s). " -# ewarn -# else -# export LINGUAS_BERYL=`echo ${LINGUAS}` -# fi -#} - -src_compile() { - # filter ldflags to follow upstream -# filter-ldflags -znow -z,now -Wl,-znow -Wl,-z,now - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.1.9999.2.ebuild b/x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.1.9999.2.ebuild deleted file mode 100644 index 8735adf68..000000000 --- a/x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.1.9999.2.ebuild +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2004-2007 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit flag-o-matic - -DESCRIPTION="Beryl Window Decorator Unsupported Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -RESTRICT="nomirror" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" -IUSE="" - -DEPEND="~x11-plugins/beryl-plugins-${PV}" - -src_compile() { - filter-ldflags -znow -z,now - filter-ldflags -Wl,-znow -Wl,-z,now - - econf || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ewarn "DO NOT report bugs to Gentoo's bugzilla" - einfo "Please report all bugs to http://bugs.gentoo-xeffects.org" - einfo "Thank you on behalf of the Gentoo XEffects team" -} diff --git a/x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.2.0.ebuild b/x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.2.0.ebuild deleted file mode 100644 index 8735adf68..000000000 --- a/x11-plugins/beryl-plugins-unsupported/beryl-plugins-unsupported-0.2.0.ebuild +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2004-2007 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit flag-o-matic - -DESCRIPTION="Beryl Window Decorator Unsupported Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -RESTRICT="nomirror" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" -IUSE="" - -DEPEND="~x11-plugins/beryl-plugins-${PV}" - -src_compile() { - filter-ldflags -znow -z,now - filter-ldflags -Wl,-znow -Wl,-z,now - - econf || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ewarn "DO NOT report bugs to Gentoo's bugzilla" - einfo "Please report all bugs to http://bugs.gentoo-xeffects.org" - einfo "Thank you on behalf of the Gentoo XEffects team" -} diff --git a/x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.1.9999.1 b/x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.1.9999.1 deleted file mode 100644 index f3432aca2..000000000 --- a/x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 76fb0088c25c3b8171a54ad16ef702e8 beryl-plugins-unsupported-0.1.9999.1.tar.bz2 362211 -RMD160 81a8121fae4854f16cfa713ba828e00e971d7131 beryl-plugins-unsupported-0.1.9999.1.tar.bz2 362211 -SHA256 0086d38cdead7e1111f31e978b9786870db89a6a467b195fb0aec2a6a3c9b126 beryl-plugins-unsupported-0.1.9999.1.tar.bz2 362211 diff --git a/x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.1.9999.2 b/x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.1.9999.2 deleted file mode 100644 index 299ef153f..000000000 --- a/x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 94cf77e9559e5022ecc88ed718dbcb67 beryl-plugins-unsupported-0.1.9999.2.tar.bz2 362679 -RMD160 3e1bd206f759d983fc8b6e88fc641159a1ee1be8 beryl-plugins-unsupported-0.1.9999.2.tar.bz2 362679 -SHA256 cde94147a9efbce534908b7849d85b203407a17a35587272ad2607aa175cd8bb beryl-plugins-unsupported-0.1.9999.2.tar.bz2 362679 diff --git a/x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.2.0 b/x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.2.0 deleted file mode 100644 index 70b254d89..000000000 --- a/x11-plugins/beryl-plugins-unsupported/files/digest-beryl-plugins-unsupported-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 6408855962c86d79d165e5d14b3ae0d2 beryl-plugins-unsupported-0.2.0.tar.bz2 396967 -RMD160 7b5f3244d1bfe9aaf86d658c7a707a164458005a beryl-plugins-unsupported-0.2.0.tar.bz2 396967 -SHA256 d6824013e5ecce4a9b9ba65e4dafcc6fd7a3c63cd843cc981e1e4cb34b967a70 beryl-plugins-unsupported-0.2.0.tar.bz2 396967 diff --git a/x11-plugins/beryl-plugins-vidcap/Manifest b/x11-plugins/beryl-plugins-vidcap/Manifest deleted file mode 100644 index 52f5b1a5e..000000000 --- a/x11-plugins/beryl-plugins-vidcap/Manifest +++ /dev/null @@ -1,16 +0,0 @@ -DIST beryl-plugins-vidcap-0.1.9999.1.tar.bz2 16940 RMD160 feb662f17d27d8bd9fa8fd9cded6d89f698da83c SHA1 5a8d6535eb8bc0b70efc6b95bbb0c688604fc727 SHA256 8b704ecfc808dde06d97a072854346c88b133c96f956eaa2187b234aa81b4d90 -DIST beryl-plugins-vidcap-0.1.9999.2.tar.bz2 21581 RMD160 d63c973e492a87b1fb32458063722b6c645600f4 SHA1 9971934a3c2da38e647d2f2c29b3ab4e3edcb958 SHA256 1ed476f85a7519e8f95d96e2546c81129fdc768ca7e9007c86eae6d5dc1651f3 -EBUILD beryl-plugins-vidcap-0.1.9999.1.ebuild 395 RMD160 9e77e6b557c36d3bb4d6882d61782679ac67ef70 SHA1 c53da17f46ea70f3f0df7b4129f6a302914c587f SHA256 235b1d36fb668e6cb08698ab10a265bd37aceaf34a7b34dff8b365f6c9d5a7c1 -MD5 098e05b562f3395d025daf1af125a306 beryl-plugins-vidcap-0.1.9999.1.ebuild 395 -RMD160 9e77e6b557c36d3bb4d6882d61782679ac67ef70 beryl-plugins-vidcap-0.1.9999.1.ebuild 395 -SHA256 235b1d36fb668e6cb08698ab10a265bd37aceaf34a7b34dff8b365f6c9d5a7c1 beryl-plugins-vidcap-0.1.9999.1.ebuild 395 -EBUILD beryl-plugins-vidcap-0.1.9999.2.ebuild 1036 RMD160 4c9ddb94df4cd6186dbe1911e267fe5711e6ed6d SHA1 6281a259714501b25c86dcf8e1061fcd286b58d9 SHA256 41634f926db0308527990d46051e3febc4f89e6a5d034cf8e5423060016aa5cb -MD5 a76f5f7d5ea8b84fb37082dae7120f11 beryl-plugins-vidcap-0.1.9999.2.ebuild 1036 -RMD160 4c9ddb94df4cd6186dbe1911e267fe5711e6ed6d beryl-plugins-vidcap-0.1.9999.2.ebuild 1036 -SHA256 41634f926db0308527990d46051e3febc4f89e6a5d034cf8e5423060016aa5cb beryl-plugins-vidcap-0.1.9999.2.ebuild 1036 -MD5 3021f7bbdb53de6b0a5024be6d517e89 files/digest-beryl-plugins-vidcap-0.1.9999.1 295 -RMD160 382468ddd452a83c0742db81cc60860559d5a10e files/digest-beryl-plugins-vidcap-0.1.9999.1 295 -SHA256 de7585fa23d0c3c50a5cfa189a2e53ea8493a386f129bd19610b10d983148664 files/digest-beryl-plugins-vidcap-0.1.9999.1 295 -MD5 a539f718ee1af4db98a011f495e70228 files/digest-beryl-plugins-vidcap-0.1.9999.2 295 -RMD160 fcf4f13ba7777926dbe0f67c18a1caab22d59ed8 files/digest-beryl-plugins-vidcap-0.1.9999.2 295 -SHA256 fddce289bbf46e39a148a19ecbb75c02524138f512a028c0168d4527d54d7f91 files/digest-beryl-plugins-vidcap-0.1.9999.2 295 diff --git a/x11-plugins/beryl-plugins-vidcap/beryl-plugins-vidcap-0.1.9999.1.ebuild b/x11-plugins/beryl-plugins-vidcap/beryl-plugins-vidcap-0.1.9999.1.ebuild deleted file mode 100644 index 3b550287f..000000000 --- a/x11-plugins/beryl-plugins-vidcap/beryl-plugins-vidcap-0.1.9999.1.ebuild +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2004-2007 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit eutils - -DESCRIPTION="Beryl's vidcap plugin for screen capture" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND="~x11-plugins/beryl-plugins-${PV} - =media-video/seom-9999" diff --git a/x11-plugins/beryl-plugins-vidcap/beryl-plugins-vidcap-0.1.9999.2.ebuild b/x11-plugins/beryl-plugins-vidcap/beryl-plugins-vidcap-0.1.9999.2.ebuild deleted file mode 100644 index 45bce66e0..000000000 --- a/x11-plugins/beryl-plugins-vidcap/beryl-plugins-vidcap-0.1.9999.2.ebuild +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2004-2007 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: - -inherit flag-o-matic multilib toolchain-funcs - -DESCRIPTION="Beryl Window Decorator Vidcap Plugin" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -RESTRICT="nomirror" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" -IUSE="" - -DEPEND="~x11-plugins/beryl-plugins-${PV} - x11-libs/seom" - -src_compile() { - filter-ldflags -znow -z,now - filter-ldflags -Wl,-znow -Wl,-z,now - - emake ARCH="$(tc-arch)" CC="$(tc-getCC)" -j1 || die "make failed" -} - -src_install() { - dodir /usr/$(get_libdir)/beryl - make ARCH="$(tc-arch)" CC="$(tc-getCC)" PREFIX="${D}/usr" LIB="$(get_libdir)" install || die "make install failed" -} - -pkg_postinst() { - ewarn "DO NOT report bugs to Gentoo's bugzilla" - einfo "Please report all bugs to http://bugs.gentoo-xeffects.org" - einfo "Thank you on behalf of the Gentoo XEffects team" -} - diff --git a/x11-plugins/beryl-plugins-vidcap/files/digest-beryl-plugins-vidcap-0.1.9999.1 b/x11-plugins/beryl-plugins-vidcap/files/digest-beryl-plugins-vidcap-0.1.9999.1 deleted file mode 100644 index 2dc619ad6..000000000 --- a/x11-plugins/beryl-plugins-vidcap/files/digest-beryl-plugins-vidcap-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 b12fc4c7e8d338e2ae771da937e216e2 beryl-plugins-vidcap-0.1.9999.1.tar.bz2 16940 -RMD160 feb662f17d27d8bd9fa8fd9cded6d89f698da83c beryl-plugins-vidcap-0.1.9999.1.tar.bz2 16940 -SHA256 8b704ecfc808dde06d97a072854346c88b133c96f956eaa2187b234aa81b4d90 beryl-plugins-vidcap-0.1.9999.1.tar.bz2 16940 diff --git a/x11-plugins/beryl-plugins-vidcap/files/digest-beryl-plugins-vidcap-0.1.9999.2 b/x11-plugins/beryl-plugins-vidcap/files/digest-beryl-plugins-vidcap-0.1.9999.2 deleted file mode 100644 index 8dd0cc781..000000000 --- a/x11-plugins/beryl-plugins-vidcap/files/digest-beryl-plugins-vidcap-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 f4aa0c74d86baa61fc372082b0109733 beryl-plugins-vidcap-0.1.9999.2.tar.bz2 21581 -RMD160 d63c973e492a87b1fb32458063722b6c645600f4 beryl-plugins-vidcap-0.1.9999.2.tar.bz2 21581 -SHA256 1ed476f85a7519e8f95d96e2546c81129fdc768ca7e9007c86eae6d5dc1651f3 beryl-plugins-vidcap-0.1.9999.2.tar.bz2 21581 diff --git a/x11-plugins/beryl-plugins/Manifest b/x11-plugins/beryl-plugins/Manifest deleted file mode 100644 index 6b759a970..000000000 --- a/x11-plugins/beryl-plugins/Manifest +++ /dev/null @@ -1,55 +0,0 @@ -DIST beryl-plugins-0.1.3.tar.bz2 2514424 RMD160 b1916d8165500535c0071054d0aee8615363e374 SHA1 2a869ddb2cb28c72e738265169ef4d3267071045 SHA256 ae1238d39610820833e63ff7e8bb4413d979edc91af0396669ccfaead73a138e -DIST beryl-plugins-0.1.4.tar.bz2 2099718 RMD160 65842ff5ee1919a6e4c545e07f5aef50ebfd9b89 SHA1 fe942c3d3316ce61916c3d8c0b5e5c761446ef31 SHA256 09a3e68f723a5145309f76ef8abe4e65d7ed5e778d2ca97aead0836b50c95560 -DIST beryl-plugins-0.1.99.2.tar.bz2 2417884 RMD160 70b0103fa02e493ef71260ed85eaf37cb3275552 SHA1 1a2ccc32d74b3ac39d70b6ac1afb955ecd8aab01 SHA256 88525b42ed27b45fac7dd2ff4292f0a28236d29b04a4a79239874540bb57f65c -DIST beryl-plugins-0.1.9999.1.tar.bz2 2788639 RMD160 1e2f3e8a004456960f86ed8660dedad8f321e254 SHA1 813064bd3c7d034c14e55efeb07af0aa87e8d46c SHA256 e3088bcb1a53948e53be06a26e8c82e8e873fd2e9248a92991200742162672d8 -DIST beryl-plugins-0.1.9999.2.tar.bz2 2791859 RMD160 994cfd3a69150e9efea5ddca2946ecc0c9f28c64 SHA1 010f0515919abe5569bddbdd71f0a88446531b90 SHA256 3fb73a82d3e905224bff6b5e2af785c05dd784b3581e5f245b244a4d4a104852 -DIST beryl-plugins-0.2.0.tar.bz2 2601441 RMD160 b1589dfb8f08da76a538e6a349c832359e531dbf SHA1 9c88aacd36bbda6acc48452564101d5b539d1c0e SHA256 fbd6ec6b78a450c058c9eb511ca52949e67572b81965e3c44e0cd1b028a5907a -EBUILD beryl-plugins-0.1.3-r1.ebuild 860 RMD160 822d0bfea19d47155fc6ca0fa62e308d5b520bcb SHA1 31ca4dc6e491a94b34485a7d329322817d4ec9a9 SHA256 32b9f23b32ae921ef0d941c07b298fbda9ce77506df83ed62a2d4c68b50927df -MD5 ebfdff82001b6d798a6e2bbfc0a122b0 beryl-plugins-0.1.3-r1.ebuild 860 -RMD160 822d0bfea19d47155fc6ca0fa62e308d5b520bcb beryl-plugins-0.1.3-r1.ebuild 860 -SHA256 32b9f23b32ae921ef0d941c07b298fbda9ce77506df83ed62a2d4c68b50927df beryl-plugins-0.1.3-r1.ebuild 860 -EBUILD beryl-plugins-0.1.4.ebuild 1305 RMD160 d03ca342a1e3a466e679b2e607cbfe2f0bf4e1bd SHA1 ce869a7be79ee95e36d97ff7a01c824c725a8383 SHA256 7c92da65d811a8ab10d9657d78a95f9a34dd3c5eaad1937ce47209c380d9098b -MD5 7760b4f9e4d8535a69c120dea1187f4b beryl-plugins-0.1.4.ebuild 1305 -RMD160 d03ca342a1e3a466e679b2e607cbfe2f0bf4e1bd beryl-plugins-0.1.4.ebuild 1305 -SHA256 7c92da65d811a8ab10d9657d78a95f9a34dd3c5eaad1937ce47209c380d9098b beryl-plugins-0.1.4.ebuild 1305 -EBUILD beryl-plugins-0.1.99.2.ebuild 1244 RMD160 712aee24ee0e35cb75a3c5291d1ea3e8c17cfb70 SHA1 b13d3050da4eeeabe5255caedd5eb20c35b53977 SHA256 0b72fd68b7986a4284dfcc877d2a855fd38d60062dfd344f84a35ade3bd5132a -MD5 cac930993b959e5f9d7b7b81d41f2d21 beryl-plugins-0.1.99.2.ebuild 1244 -RMD160 712aee24ee0e35cb75a3c5291d1ea3e8c17cfb70 beryl-plugins-0.1.99.2.ebuild 1244 -SHA256 0b72fd68b7986a4284dfcc877d2a855fd38d60062dfd344f84a35ade3bd5132a beryl-plugins-0.1.99.2.ebuild 1244 -EBUILD beryl-plugins-0.1.9999.1-r1.ebuild 1262 RMD160 0930f901add702c5f263de91a9ad4f1e816de605 SHA1 e0673486249cc4de1a1a853cf5e171e5f86d5258 SHA256 42a55b64559c61fdf486b06d5c09f4981539b4a20b36ce01bd655c0a79cac8f2 -MD5 05ab50addd44fd3567b38d968de7b7ab beryl-plugins-0.1.9999.1-r1.ebuild 1262 -RMD160 0930f901add702c5f263de91a9ad4f1e816de605 beryl-plugins-0.1.9999.1-r1.ebuild 1262 -SHA256 42a55b64559c61fdf486b06d5c09f4981539b4a20b36ce01bd655c0a79cac8f2 beryl-plugins-0.1.9999.1-r1.ebuild 1262 -EBUILD beryl-plugins-0.1.9999.1.ebuild 1244 RMD160 712aee24ee0e35cb75a3c5291d1ea3e8c17cfb70 SHA1 b13d3050da4eeeabe5255caedd5eb20c35b53977 SHA256 0b72fd68b7986a4284dfcc877d2a855fd38d60062dfd344f84a35ade3bd5132a -MD5 cac930993b959e5f9d7b7b81d41f2d21 beryl-plugins-0.1.9999.1.ebuild 1244 -RMD160 712aee24ee0e35cb75a3c5291d1ea3e8c17cfb70 beryl-plugins-0.1.9999.1.ebuild 1244 -SHA256 0b72fd68b7986a4284dfcc877d2a855fd38d60062dfd344f84a35ade3bd5132a beryl-plugins-0.1.9999.1.ebuild 1244 -EBUILD beryl-plugins-0.1.9999.2.ebuild 1390 RMD160 98fec62b8716dd14c7b103c202721920815516a9 SHA1 d182ac16b11e916d8e196cefb1b52202629a9cd6 SHA256 3ac57b0b09ded27d4425db4b618d9094336d70fa25ee286f66f7a78fbdf4f6bf -MD5 0cdac0162dcb70b4bc3f7dafa5fa6e2a beryl-plugins-0.1.9999.2.ebuild 1390 -RMD160 98fec62b8716dd14c7b103c202721920815516a9 beryl-plugins-0.1.9999.2.ebuild 1390 -SHA256 3ac57b0b09ded27d4425db4b618d9094336d70fa25ee286f66f7a78fbdf4f6bf beryl-plugins-0.1.9999.2.ebuild 1390 -EBUILD beryl-plugins-0.2.0.ebuild 1410 RMD160 2b04bc94c354d95e59ae649cffea59a1523e6bf0 SHA1 12dab277f8c7d3412f4cf6dee559ae7fe74d5e5e SHA256 9e1caa7abd467fafc4fb9a0ee344308dd3941c1ccaf50127e03de37d43c20c45 -MD5 2fb83e670321ff10e98812f92f274009 beryl-plugins-0.2.0.ebuild 1410 -RMD160 2b04bc94c354d95e59ae649cffea59a1523e6bf0 beryl-plugins-0.2.0.ebuild 1410 -SHA256 9e1caa7abd467fafc4fb9a0ee344308dd3941c1ccaf50127e03de37d43c20c45 beryl-plugins-0.2.0.ebuild 1410 -MD5 3150d0347909684ef9772d4cc811072d files/digest-beryl-plugins-0.1.3-r1 265 -RMD160 8fd566a00123788a81201fe81c489782f9813181 files/digest-beryl-plugins-0.1.3-r1 265 -SHA256 03e315f27a9b907144d4902a43895e1167ae7c618b605b57a54178484566140a files/digest-beryl-plugins-0.1.3-r1 265 -MD5 dd1075c30ac81610042bd252457fc7b5 files/digest-beryl-plugins-0.1.4 265 -RMD160 20b2f4cc58bb0bf936b63f1135f7a28404541791 files/digest-beryl-plugins-0.1.4 265 -SHA256 07e125a056c5155d9bc295c1a3ef1827af1e1b5200a1e1372af023a3826256a4 files/digest-beryl-plugins-0.1.4 265 -MD5 0bb98ed72b8a494ae576a4bc7b430d55 files/digest-beryl-plugins-0.1.99.2 274 -RMD160 83cf48fc6d3b9d89f34efb343949546fd16cd772 files/digest-beryl-plugins-0.1.99.2 274 -SHA256 43607f53808ce95fad092d5cb3a48d699aa87aca43cd2d3dcb847cb6174f5829 files/digest-beryl-plugins-0.1.99.2 274 -MD5 24dd76152f6b451d8d8845cbe7e34128 files/digest-beryl-plugins-0.1.9999.1 280 -RMD160 d7ae1a7b97652898687e14d1e7f615d1b303ec9c files/digest-beryl-plugins-0.1.9999.1 280 -SHA256 da74b1fbbca6dc869fa1ea01ae1f5a63924dc595e07225f0aea4071cdfbba611 files/digest-beryl-plugins-0.1.9999.1 280 -MD5 24dd76152f6b451d8d8845cbe7e34128 files/digest-beryl-plugins-0.1.9999.1-r1 280 -RMD160 d7ae1a7b97652898687e14d1e7f615d1b303ec9c files/digest-beryl-plugins-0.1.9999.1-r1 280 -SHA256 da74b1fbbca6dc869fa1ea01ae1f5a63924dc595e07225f0aea4071cdfbba611 files/digest-beryl-plugins-0.1.9999.1-r1 280 -MD5 89de8d6df03a6eda2042292420f520b3 files/digest-beryl-plugins-0.1.9999.2 280 -RMD160 c71276643c1b105811418efb5bf51ef8396979fb files/digest-beryl-plugins-0.1.9999.2 280 -SHA256 c1053f5e96f3d18d6f082c6aea3cf75c84b21ba13a5c3a17e23097aeb7a01219 files/digest-beryl-plugins-0.1.9999.2 280 -MD5 969d02d23d3793e5b8ef659584d089bb files/digest-beryl-plugins-0.2.0 265 -RMD160 5d7efadbe24a4a2364ccadc761736a3e7c90008f files/digest-beryl-plugins-0.2.0 265 -SHA256 7ce1897f35ce56a386a74655c3bdf523bd3290021035b97947cddfa560f42630 files/digest-beryl-plugins-0.2.0 265 diff --git a/x11-plugins/beryl-plugins/beryl-plugins-0.1.3-r1.ebuild b/x11-plugins/beryl-plugins/beryl-plugins-0.1.3-r1.ebuild deleted file mode 100644 index 60e271999..000000000 --- a/x11-plugins/beryl-plugins/beryl-plugins-0.1.3-r1.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/beryl-plugins/beryl-plugins-0.1.2.ebuild,v 1.1 2006/11/15 04:03:06 tsunam Exp $ - -inherit flag-o-matic - -DESCRIPTION="Beryl Window Decorator Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://distfiles.gentoo-xeffects.org/beryl-releases/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="dbus" -RESTRICT="nomirror" - -DEPEND="~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.14.0" - -PDEPEND="dbus? ( ~x11-plugins/beryl-dbus-${PV} )" - -src_compile() { - # filter ldflags to follow upstream - filter-ldflags -znow -z,now -Wl,-znow -Wl,-z,now - - econf || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-plugins/beryl-plugins/beryl-plugins-0.1.4.ebuild b/x11-plugins/beryl-plugins/beryl-plugins-0.1.4.ebuild deleted file mode 100644 index dfb84f814..000000000 --- a/x11-plugins/beryl-plugins/beryl-plugins-0.1.4.ebuild +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/beryl-plugins/beryl-plugins-0.1.2.ebuild,v 1.1 2006/11/15 04:03:06 tsunam Exp $ - -inherit flag-o-matic autotools eutils - -IUSE="dbus" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND="~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.14.0" - -PDEPEND="dbus? ( ~x11-plugins/beryl-dbus-${PV} )" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - # filter ldflags to follow upstream - filter-ldflags -znow -z,now -Wl,-znow -Wl,-z,now - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-plugins/beryl-plugins/beryl-plugins-0.1.99.2.ebuild b/x11-plugins/beryl-plugins/beryl-plugins-0.1.99.2.ebuild deleted file mode 100644 index bf6580973..000000000 --- a/x11-plugins/beryl-plugins/beryl-plugins-0.1.99.2.ebuild +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/beryl-plugins/beryl-plugins-0.1.2.ebuild,v 1.1 2006/11/15 04:03:06 tsunam Exp $ - -inherit flag-o-matic autotools eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND="~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.14.0" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - # filter ldflags to follow upstream - filter-ldflags -znow -z,now -Wl,-znow -Wl,-z,now - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.1-r1.ebuild b/x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.1-r1.ebuild deleted file mode 100644 index 3f9acca2f..000000000 --- a/x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.1-r1.ebuild +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/beryl-plugins/beryl-plugins-0.1.2.ebuild,v 1.1 2006/11/15 04:03:06 tsunam Exp $ - -inherit flag-o-matic autotools eutils - -#IUSE="" -#LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" -# -#for X in ${LANGS} ; do -# IUSE="${IUSE} linguas_${X}" -#done - -DESCRIPTION="Beryl Window Decorator Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND="~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.16.1" - -#pkg_setup() { -# strip-linguas ${LANGS} -# -# if [ -z "${LINGUAS}" ]; then -# export LINGUAS_BERYL="en_GB" -# ewarn -# ewarn " To get a localized build, set the according LINGUAS variable(s). " -# ewarn -# else -# export LINGUAS_BERYL=`echo ${LINGUAS}` -# fi -#} - -src_compile() { - # filter ldflags to follow upstream - filter-ldflags -znow -z,now -Wl,-znow -Wl,-z,now - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.1.ebuild b/x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.1.ebuild deleted file mode 100644 index bf6580973..000000000 --- a/x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.1.ebuild +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/beryl-plugins/beryl-plugins-0.1.2.ebuild,v 1.1 2006/11/15 04:03:06 tsunam Exp $ - -inherit flag-o-matic autotools eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND="~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.14.0" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - # filter ldflags to follow upstream - filter-ldflags -znow -z,now -Wl,-znow -Wl,-z,now - #--with-lang="${LINGUAS_BERYL}" - econf || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.2.ebuild b/x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.2.ebuild deleted file mode 100644 index ed46a3b73..000000000 --- a/x11-plugins/beryl-plugins/beryl-plugins-0.1.9999.2.ebuild +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/beryl-plugins/beryl-plugins-0.1.2.ebuild,v 1.1 2006/11/15 04:03:06 tsunam Exp $ - -inherit flag-o-matic - -DESCRIPTION="Beryl Window Decorator Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -IUSE="dbus vidcap" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" - -DEPEND="~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.14.0 - dbus? ( || ( =dev-libs/dbus-glib-0.72 ) ) - " - -PDEPEND="vidcap? ( ~x11-plugins/beryl-plugins-vidcap-${PV} )" - - -pkg_setup() { - if ! built_with_use x11-libs/cairo glitz ; then - einfo "Please rebuild cairo with USE=\"glitz\"" - die "x11-libs/cairo missing glitz support" - fi -} - -src_compile() { - filter-ldflags -znow -z,now - filter-ldflags -Wl,-znow -Wl,-z,now - - econf $(use_enable dbus) || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ewarn "DO NOT report bugs to Gentoo's bugzilla" - einfo "Please report all bugs to http://bugs.gentoo-xeffects.org" - einfo "Thank you on behalf of the Gentoo XEffects team" -} - diff --git a/x11-plugins/beryl-plugins/beryl-plugins-0.2.0.ebuild b/x11-plugins/beryl-plugins/beryl-plugins-0.2.0.ebuild deleted file mode 100644 index b3ceb6182..000000000 --- a/x11-plugins/beryl-plugins/beryl-plugins-0.2.0.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-plugins/beryl-plugins/beryl-plugins-0.1.2.ebuild,v 1.1 2006/11/15 04:03:06 tsunam Exp $ - -inherit flag-o-matic - -DESCRIPTION="Beryl Window Decorator Plugins" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -IUSE="dbus vidcap" -RESTRICT="nomirror" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" - -DEPEND="~x11-wm/beryl-core-${PV} - >=gnome-base/librsvg-2.14.0 - dbus? ( || ( =dev-libs/dbus-glib-0.72 ) ) - " - -PDEPEND="vidcap? ( ~x11-plugins/beryl-plugins-vidcap-${PV} )" - - -pkg_setup() { - if ! built_with_use x11-libs/cairo glitz ; then - einfo "Please rebuild cairo with USE=\"glitz\"" - die "x11-libs/cairo missing glitz support" - fi -} - -src_compile() { - filter-ldflags -znow -z,now - filter-ldflags -Wl,-znow -Wl,-z,now - - econf $(use_enable dbus) || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ewarn "DO NOT report bugs to Gentoo's bugzilla" - einfo "Please report all bugs to http://bugs.gentoo-xeffects.org" - einfo "Thank you on behalf of the Gentoo XEffects team" -} - diff --git a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.3-r1 b/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.3-r1 deleted file mode 100644 index 7e77fdc27..000000000 --- a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.3-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 de5f6089d05c6d92161729c47857b985 beryl-plugins-0.1.3.tar.bz2 2514424 -RMD160 b1916d8165500535c0071054d0aee8615363e374 beryl-plugins-0.1.3.tar.bz2 2514424 -SHA256 ae1238d39610820833e63ff7e8bb4413d979edc91af0396669ccfaead73a138e beryl-plugins-0.1.3.tar.bz2 2514424 diff --git a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.4 b/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.4 deleted file mode 100644 index 8edb2c2d4..000000000 --- a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.4 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 888741e64e1e328056f953d07040398c beryl-plugins-0.1.4.tar.bz2 2099718 -RMD160 65842ff5ee1919a6e4c545e07f5aef50ebfd9b89 beryl-plugins-0.1.4.tar.bz2 2099718 -SHA256 09a3e68f723a5145309f76ef8abe4e65d7ed5e778d2ca97aead0836b50c95560 beryl-plugins-0.1.4.tar.bz2 2099718 diff --git a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.99.2 b/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.99.2 deleted file mode 100644 index b97563dd9..000000000 --- a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.99.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 7b116756dd841afa0c72f5556284714e beryl-plugins-0.1.99.2.tar.bz2 2417884 -RMD160 70b0103fa02e493ef71260ed85eaf37cb3275552 beryl-plugins-0.1.99.2.tar.bz2 2417884 -SHA256 88525b42ed27b45fac7dd2ff4292f0a28236d29b04a4a79239874540bb57f65c beryl-plugins-0.1.99.2.tar.bz2 2417884 diff --git a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.1 b/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.1 deleted file mode 100644 index b90f45f6c..000000000 --- a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 be876763b0bd9f2c11cca764ce348c3d beryl-plugins-0.1.9999.1.tar.bz2 2788639 -RMD160 1e2f3e8a004456960f86ed8660dedad8f321e254 beryl-plugins-0.1.9999.1.tar.bz2 2788639 -SHA256 e3088bcb1a53948e53be06a26e8c82e8e873fd2e9248a92991200742162672d8 beryl-plugins-0.1.9999.1.tar.bz2 2788639 diff --git a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.1-r1 b/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.1-r1 deleted file mode 100644 index b90f45f6c..000000000 --- a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.1-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 be876763b0bd9f2c11cca764ce348c3d beryl-plugins-0.1.9999.1.tar.bz2 2788639 -RMD160 1e2f3e8a004456960f86ed8660dedad8f321e254 beryl-plugins-0.1.9999.1.tar.bz2 2788639 -SHA256 e3088bcb1a53948e53be06a26e8c82e8e873fd2e9248a92991200742162672d8 beryl-plugins-0.1.9999.1.tar.bz2 2788639 diff --git a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.2 b/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.2 deleted file mode 100644 index a9df21963..000000000 --- a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 1dd90be00f7889cf4cef197b4f8ea7c3 beryl-plugins-0.1.9999.2.tar.bz2 2791859 -RMD160 994cfd3a69150e9efea5ddca2946ecc0c9f28c64 beryl-plugins-0.1.9999.2.tar.bz2 2791859 -SHA256 3fb73a82d3e905224bff6b5e2af785c05dd784b3581e5f245b244a4d4a104852 beryl-plugins-0.1.9999.2.tar.bz2 2791859 diff --git a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.2.0 b/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.2.0 deleted file mode 100644 index 7faed23e1..000000000 --- a/x11-plugins/beryl-plugins/files/digest-beryl-plugins-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 15ca97214f2f29fd3c8fc2fe8491c812 beryl-plugins-0.2.0.tar.bz2 2601441 -RMD160 b1589dfb8f08da76a538e6a349c832359e531dbf beryl-plugins-0.2.0.tar.bz2 2601441 -SHA256 fbd6ec6b78a450c058c9eb511ca52949e67572b81965e3c44e0cd1b028a5907a beryl-plugins-0.2.0.tar.bz2 2601441 diff --git a/x11-themes/emerald-themes/Manifest b/x11-themes/emerald-themes/Manifest deleted file mode 100644 index 4ba4a363e..000000000 --- a/x11-themes/emerald-themes/Manifest +++ /dev/null @@ -1,48 +0,0 @@ -DIST emerald-themes-0.1.3.tar.bz2 1367716 RMD160 55fe2ce911d0df46ac9f7f1ed3cc332b8b2ac2e1 SHA1 348b54b6e61abaea0070e8765ac75ffa6291be1a SHA256 8b0c222c62d23cc128bfb67860aa15377c80982389ed41a0e08ae3842f9140d8 -DIST emerald-themes-0.1.4.tar.bz2 1367547 RMD160 72f96249f53d72c50851b048a8d271ec9ee056d3 SHA1 79204fa861b2d9ead73b2f36c34515bb295cf651 SHA256 0cbd1cd78c746e6c87d2a59d8404a5f6025b5f7f95c4eb7dd0b78a92305ef719 -DIST emerald-themes-0.1.99.2.tar.bz2 1367548 RMD160 f528b40e509dead86e3fedb7bda0735b349d9dff SHA1 d3283fb072b0cc5f5dd384af92d0e301e5008a6c SHA256 1c8607b289f079857e1fb69339aef0bc277424b4b8149ec6d0676b5df3584278 -DIST emerald-themes-0.1.9999.1.tar.bz2 1373649 RMD160 f089b87229d53226070183375facb3e7d48af6cd SHA1 88d6115265e5173c91f23ea350690989bbd8b40d SHA256 4bb577a05d5df56dae815e4ab39d22b9ed6e2505b92b253bb976dbe57a8dc607 -DIST emerald-themes-0.1.9999.2.tar.bz2 1373646 RMD160 ff7ff5680699dbd09b500c2b05c8ad958d2fd8e7 SHA1 56722e7843cf039fcb4308a52a0a29f0d050833b SHA256 067d6ae77f3e3880db4a0b1a1a969ad5d0059ffa4457a6b62bcb27bf5fe216a6 -DIST emerald-themes-0.2.0.tar.bz2 1380525 RMD160 672051cb183e19505644c5737b69632bb32e6866 SHA1 07f6a345766ae2f174e2770afddf28e1724ed2d2 SHA256 9b37230cf2e8cc7e891db30339e838d24a7ba70d8ada99160616cbafbbca1407 -EBUILD emerald-themes-0.1.3.ebuild 656 RMD160 440f73119b35b4f78ecde132c41a72d29b1c7610 SHA1 ea0f32c23eefceb6f518a94977061cbb9bc3af07 SHA256 e75e0324aaf91eb16947d6097963961eb548076b122f5e0d969b3bd3fbdde2c0 -MD5 41bae6693cb281821502709b7dd4c9c9 emerald-themes-0.1.3.ebuild 656 -RMD160 440f73119b35b4f78ecde132c41a72d29b1c7610 emerald-themes-0.1.3.ebuild 656 -SHA256 e75e0324aaf91eb16947d6097963961eb548076b122f5e0d969b3bd3fbdde2c0 emerald-themes-0.1.3.ebuild 656 -EBUILD emerald-themes-0.1.4.ebuild 638 RMD160 b5e6df30f6f26fd1c6cd2a49b91cf0818b151fde SHA1 3a0ec3716701f200d188ae0143cdf40cb200b23a SHA256 5718572684edd9823595b40d8e70a30aa52879b3c34084da2c58c85c939ebd45 -MD5 d493c024bcaa7ee017833b79db599aea emerald-themes-0.1.4.ebuild 638 -RMD160 b5e6df30f6f26fd1c6cd2a49b91cf0818b151fde emerald-themes-0.1.4.ebuild 638 -SHA256 5718572684edd9823595b40d8e70a30aa52879b3c34084da2c58c85c939ebd45 emerald-themes-0.1.4.ebuild 638 -EBUILD emerald-themes-0.1.99.2.ebuild 520 RMD160 7777aca9e019a9e2b909b7779ae7f548ca29f197 SHA1 038efbb98d43af2d0f502acd2e1d85da10411dda SHA256 2fb0e9dfc9b946da3469053b3ec1c553273ed52f4157b1759f449e96412fb448 -MD5 9eed7c40ca9f2aec6f8756d887f593d3 emerald-themes-0.1.99.2.ebuild 520 -RMD160 7777aca9e019a9e2b909b7779ae7f548ca29f197 emerald-themes-0.1.99.2.ebuild 520 -SHA256 2fb0e9dfc9b946da3469053b3ec1c553273ed52f4157b1759f449e96412fb448 emerald-themes-0.1.99.2.ebuild 520 -EBUILD emerald-themes-0.1.9999.1.ebuild 520 RMD160 7777aca9e019a9e2b909b7779ae7f548ca29f197 SHA1 038efbb98d43af2d0f502acd2e1d85da10411dda SHA256 2fb0e9dfc9b946da3469053b3ec1c553273ed52f4157b1759f449e96412fb448 -MD5 9eed7c40ca9f2aec6f8756d887f593d3 emerald-themes-0.1.9999.1.ebuild 520 -RMD160 7777aca9e019a9e2b909b7779ae7f548ca29f197 emerald-themes-0.1.9999.1.ebuild 520 -SHA256 2fb0e9dfc9b946da3469053b3ec1c553273ed52f4157b1759f449e96412fb448 emerald-themes-0.1.9999.1.ebuild 520 -EBUILD emerald-themes-0.1.9999.2.ebuild 778 RMD160 1d5fabbb8caf769d18f89f2a47bd1e51e2e09030 SHA1 484cfe2130107b525370f97413d5648a1281936d SHA256 8a1128a2655553d92840eba61b78309a51f49358fff192109a9a362a687c2774 -MD5 1ca1ac5667e156e80ffd9c0468b99429 emerald-themes-0.1.9999.2.ebuild 778 -RMD160 1d5fabbb8caf769d18f89f2a47bd1e51e2e09030 emerald-themes-0.1.9999.2.ebuild 778 -SHA256 8a1128a2655553d92840eba61b78309a51f49358fff192109a9a362a687c2774 emerald-themes-0.1.9999.2.ebuild 778 -EBUILD emerald-themes-0.2.0.ebuild 778 RMD160 1d5fabbb8caf769d18f89f2a47bd1e51e2e09030 SHA1 484cfe2130107b525370f97413d5648a1281936d SHA256 8a1128a2655553d92840eba61b78309a51f49358fff192109a9a362a687c2774 -MD5 1ca1ac5667e156e80ffd9c0468b99429 emerald-themes-0.2.0.ebuild 778 -RMD160 1d5fabbb8caf769d18f89f2a47bd1e51e2e09030 emerald-themes-0.2.0.ebuild 778 -SHA256 8a1128a2655553d92840eba61b78309a51f49358fff192109a9a362a687c2774 emerald-themes-0.2.0.ebuild 778 -MD5 7c0eba4ec555ac4f3a56a4f9ecb9953d files/digest-emerald-themes-0.1.3 268 -RMD160 c520dce13ca895c0dec6f7378ca892ff8ec88751 files/digest-emerald-themes-0.1.3 268 -SHA256 849cb0e52e8d8753a9778ea3feb55b988fd62dd45d33c43a1d46f0cedb60391b files/digest-emerald-themes-0.1.3 268 -MD5 fdcb9468568b6da5dc7eb57a3fa25674 files/digest-emerald-themes-0.1.4 268 -RMD160 1e12aa93a7f69d8625b55b655a15f6ddacd193da files/digest-emerald-themes-0.1.4 268 -SHA256 2b8b07601ada294df636a2cf69e3a80e1d9deb7f442859df718ae946154cc819 files/digest-emerald-themes-0.1.4 268 -MD5 3812023ffc9ed11ef258e307de37abbf files/digest-emerald-themes-0.1.99.2 277 -RMD160 a0748ad724bde5eb19bbd64c66d7bfbdce0b4e41 files/digest-emerald-themes-0.1.99.2 277 -SHA256 d401a1b90e7205ba203d3291198ff8bf8131ff520278b5dc0d9116b9ec5d70a4 files/digest-emerald-themes-0.1.99.2 277 -MD5 6367f403d2b38d01150b4468e820c66f files/digest-emerald-themes-0.1.9999.1 283 -RMD160 e3a29b344d03e5be80a56a5da6bca741f420a3a1 files/digest-emerald-themes-0.1.9999.1 283 -SHA256 f1b14ae528aa71c18b17b2eb6697f8c981ed64f6b6ef6ef46aa9e96e8ed4fc11 files/digest-emerald-themes-0.1.9999.1 283 -MD5 8c0dda5aeba216fa14c7bacff9674d6f files/digest-emerald-themes-0.1.9999.2 283 -RMD160 7c46bd10402f9a8d634d5168f992c9ecf2925ab8 files/digest-emerald-themes-0.1.9999.2 283 -SHA256 83b845545c99a90567eb3bd5d3744399ff225c908557cbe587dd6554825d67a1 files/digest-emerald-themes-0.1.9999.2 283 -MD5 f4accb5922c804af7a7144ff422685a0 files/digest-emerald-themes-0.2.0 268 -RMD160 984693babae36d6a23492ee12fc6202737ff4dd5 files/digest-emerald-themes-0.2.0 268 -SHA256 9af27b5092605b277134e216da47dd9b3ae8d12cda7138451b9f19a4b30326a1 files/digest-emerald-themes-0.2.0 268 diff --git a/x11-themes/emerald-themes/emerald-themes-0.1.3.ebuild b/x11-themes/emerald-themes/emerald-themes-0.1.3.ebuild deleted file mode 100644 index 4b37556c6..000000000 --- a/x11-themes/emerald-themes/emerald-themes-0.1.3.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-misc/emerald-themes/emerald-themes-0.1.2-r1.ebuild,v 1.1 2006/12/07 21:30:38 tsunam Exp $ - -inherit eutils - -DESCRIPTION="Beryl Window Decorator Themes" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://distfiles.gentoo-xeffects.org/beryl-releases/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="" - -DEPEND="~x11-wm/emerald-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-themes/emerald-themes/emerald-themes-0.1.4.ebuild b/x11-themes/emerald-themes/emerald-themes-0.1.4.ebuild deleted file mode 100644 index 151650a6c..000000000 --- a/x11-themes/emerald-themes/emerald-themes-0.1.4.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-misc/emerald-themes/emerald-themes-0.1.2-r1.ebuild,v 1.1 2006/12/07 21:30:38 tsunam Exp $ - -inherit eutils - -DESCRIPTION="Beryl Window Decorator Themes" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="" - -DEPEND="~x11-wm/emerald-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-themes/emerald-themes/emerald-themes-0.1.99.2.ebuild b/x11-themes/emerald-themes/emerald-themes-0.1.99.2.ebuild deleted file mode 100644 index 16e3b5975..000000000 --- a/x11-themes/emerald-themes/emerald-themes-0.1.99.2.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit eutils - -DESCRIPTION="Beryl Window Decorator Themes" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="" - -DEPEND="~x11-wm/emerald-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-themes/emerald-themes/emerald-themes-0.1.9999.1.ebuild b/x11-themes/emerald-themes/emerald-themes-0.1.9999.1.ebuild deleted file mode 100644 index 16e3b5975..000000000 --- a/x11-themes/emerald-themes/emerald-themes-0.1.9999.1.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit eutils - -DESCRIPTION="Beryl Window Decorator Themes" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="" - -DEPEND="~x11-wm/emerald-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-themes/emerald-themes/emerald-themes-0.1.9999.2.ebuild b/x11-themes/emerald-themes/emerald-themes-0.1.9999.2.ebuild deleted file mode 100644 index 87336821e..000000000 --- a/x11-themes/emerald-themes/emerald-themes-0.1.9999.2.ebuild +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -DESCRIPTION="Beryl Window Decorator Themes" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -RESTRICT="nomirror" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" -IUSE="" - -DEPEND="~x11-wm/emerald-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ewarn "DO NOT report bugs to Gentoo's bugzilla" - einfo "Please report all bugs to http://bugs.gentoo-xeffects.org" - einfo "Thank you on behalf of the Gentoo XEffects team" -} - diff --git a/x11-themes/emerald-themes/emerald-themes-0.2.0.ebuild b/x11-themes/emerald-themes/emerald-themes-0.2.0.ebuild deleted file mode 100644 index 87336821e..000000000 --- a/x11-themes/emerald-themes/emerald-themes-0.2.0.ebuild +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -DESCRIPTION="Beryl Window Decorator Themes" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" -RESTRICT="nomirror" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" -IUSE="" - -DEPEND="~x11-wm/emerald-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - -pkg_postinst() { - ewarn "DO NOT report bugs to Gentoo's bugzilla" - einfo "Please report all bugs to http://bugs.gentoo-xeffects.org" - einfo "Thank you on behalf of the Gentoo XEffects team" -} - diff --git a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.3 b/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.3 deleted file mode 100644 index 0352c8f39..000000000 --- a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.3 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 0751a17ebd5768d397466b54886c9724 emerald-themes-0.1.3.tar.bz2 1367716 -RMD160 55fe2ce911d0df46ac9f7f1ed3cc332b8b2ac2e1 emerald-themes-0.1.3.tar.bz2 1367716 -SHA256 8b0c222c62d23cc128bfb67860aa15377c80982389ed41a0e08ae3842f9140d8 emerald-themes-0.1.3.tar.bz2 1367716 diff --git a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.4 b/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.4 deleted file mode 100644 index ad0d245b6..000000000 --- a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.4 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 e2a2727f0667f09e82b60f5cb36ecd58 emerald-themes-0.1.4.tar.bz2 1367547 -RMD160 72f96249f53d72c50851b048a8d271ec9ee056d3 emerald-themes-0.1.4.tar.bz2 1367547 -SHA256 0cbd1cd78c746e6c87d2a59d8404a5f6025b5f7f95c4eb7dd0b78a92305ef719 emerald-themes-0.1.4.tar.bz2 1367547 diff --git a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.99.2 b/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.99.2 deleted file mode 100644 index 94aa71269..000000000 --- a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.99.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 abfe5c942e290ddd22db5e94d217fdb7 emerald-themes-0.1.99.2.tar.bz2 1367548 -RMD160 f528b40e509dead86e3fedb7bda0735b349d9dff emerald-themes-0.1.99.2.tar.bz2 1367548 -SHA256 1c8607b289f079857e1fb69339aef0bc277424b4b8149ec6d0676b5df3584278 emerald-themes-0.1.99.2.tar.bz2 1367548 diff --git a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.9999.1 b/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.9999.1 deleted file mode 100644 index 9fbf5dfc4..000000000 --- a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 6e22d32afa755b53dca15d65b3ac9ee3 emerald-themes-0.1.9999.1.tar.bz2 1373649 -RMD160 f089b87229d53226070183375facb3e7d48af6cd emerald-themes-0.1.9999.1.tar.bz2 1373649 -SHA256 4bb577a05d5df56dae815e4ab39d22b9ed6e2505b92b253bb976dbe57a8dc607 emerald-themes-0.1.9999.1.tar.bz2 1373649 diff --git a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.9999.2 b/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.9999.2 deleted file mode 100644 index fb9023db6..000000000 --- a/x11-themes/emerald-themes/files/digest-emerald-themes-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 a4373c9d815ecadec10ceea86cfe32fd emerald-themes-0.1.9999.2.tar.bz2 1373646 -RMD160 ff7ff5680699dbd09b500c2b05c8ad958d2fd8e7 emerald-themes-0.1.9999.2.tar.bz2 1373646 -SHA256 067d6ae77f3e3880db4a0b1a1a969ad5d0059ffa4457a6b62bcb27bf5fe216a6 emerald-themes-0.1.9999.2.tar.bz2 1373646 diff --git a/x11-themes/emerald-themes/files/digest-emerald-themes-0.2.0 b/x11-themes/emerald-themes/files/digest-emerald-themes-0.2.0 deleted file mode 100644 index dcd25566b..000000000 --- a/x11-themes/emerald-themes/files/digest-emerald-themes-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 1aeda2bf2ebd0fea7ad537cf5c5c40ba emerald-themes-0.2.0.tar.bz2 1380525 -RMD160 672051cb183e19505644c5737b69632bb32e6866 emerald-themes-0.2.0.tar.bz2 1380525 -SHA256 9b37230cf2e8cc7e891db30339e838d24a7ba70d8ada99160616cbafbbca1407 emerald-themes-0.2.0.tar.bz2 1380525 diff --git a/x11-wm/aquamarine/Manifest b/x11-wm/aquamarine/Manifest deleted file mode 100644 index 5df43b466..000000000 --- a/x11-wm/aquamarine/Manifest +++ /dev/null @@ -1,40 +0,0 @@ -DIST aquamarine-0.1.4.tar.bz2 429163 RMD160 24a18f96038a3bf3800cd3a6d87a40c580fa6022 SHA1 c23224b1ef6c37a3837ebfc4039ceaf6942bad4e SHA256 0c9530dc11c4f47cebf1a86e13d428c420b4ab84b7977d56a2bd46df204ad1a8 -DIST aquamarine-0.1.99.2.tar.bz2 428323 RMD160 4c8b075d24a149cf076962fc8747d26a57d1d270 SHA1 c77f08b1b3fc9d6aaa72e908ebc2a7666632d580 SHA256 59c1bb50b0c49801e479098ecd0a94df88b196cab5011c0e63ff90b4be962c41 -DIST aquamarine-0.1.9999.1.tar.bz2 428391 RMD160 d2b10a2cb16575f469f46967994171c13e42b84e SHA1 235e7ab4676225d0d5404bdc33a6ff1302e81489 SHA256 5ae8818cccad8fae6df082314f501bcd971aac2865620e3c0b8f3d5b35ba5e8a -DIST aquamarine-0.1.9999.2.tar.bz2 428754 RMD160 5f9b1fc3f55539676b90d31a3d2f2af098e52b28 SHA1 7ee534a7285a2963f3f7010d651c067a8e8d4281 SHA256 733cab6b87f673ec43f45912545269a3fe9d12f05d6377aec8c4be6d57b90333 -DIST aquamarine-0.2.0.tar.bz2 436132 RMD160 a3e8ded06ab42b415e4b82af38266dbc34236c22 SHA1 6d15dca8310ce25e589aeeade83747e0f10f008b SHA256 cb92921659859e4169db40ddec0c6f07285124851121f28d795bccabac238ce7 -EBUILD aquamarine-0.1.4.ebuild 405 RMD160 887f2429f40b0810203379c6d5b4035a2b2d46d0 SHA1 38234250c8daac3f15c0e05fb11256b7d276dd0b SHA256 483744c56a79685718b5f7b9c9c9c1cd37fbdf80261daddadee3083ccf4694d0 -MD5 4a61e1bcddbc683e9b9e45f2cacc3334 aquamarine-0.1.4.ebuild 405 -RMD160 887f2429f40b0810203379c6d5b4035a2b2d46d0 aquamarine-0.1.4.ebuild 405 -SHA256 483744c56a79685718b5f7b9c9c9c1cd37fbdf80261daddadee3083ccf4694d0 aquamarine-0.1.4.ebuild 405 -EBUILD aquamarine-0.1.99.2.ebuild 399 RMD160 3d2fe51a10476790a5a407f522fdf00ce2abf363 SHA1 3cf660d87e325482c7e0521373c3a56082f2ae6b SHA256 f4a90e2be1b9e1e8432ff1fb1af03d5443328f952c504ed01debb10bbd1716e3 -MD5 7a43a6dd1c6a35aa994d04ce5dfcd4b1 aquamarine-0.1.99.2.ebuild 399 -RMD160 3d2fe51a10476790a5a407f522fdf00ce2abf363 aquamarine-0.1.99.2.ebuild 399 -SHA256 f4a90e2be1b9e1e8432ff1fb1af03d5443328f952c504ed01debb10bbd1716e3 aquamarine-0.1.99.2.ebuild 399 -EBUILD aquamarine-0.1.9999.1.ebuild 399 RMD160 3d2fe51a10476790a5a407f522fdf00ce2abf363 SHA1 3cf660d87e325482c7e0521373c3a56082f2ae6b SHA256 f4a90e2be1b9e1e8432ff1fb1af03d5443328f952c504ed01debb10bbd1716e3 -MD5 7a43a6dd1c6a35aa994d04ce5dfcd4b1 aquamarine-0.1.9999.1.ebuild 399 -RMD160 3d2fe51a10476790a5a407f522fdf00ce2abf363 aquamarine-0.1.9999.1.ebuild 399 -SHA256 f4a90e2be1b9e1e8432ff1fb1af03d5443328f952c504ed01debb10bbd1716e3 aquamarine-0.1.9999.1.ebuild 399 -EBUILD aquamarine-0.1.9999.2.ebuild 412 RMD160 c83c14edae17782e9f848bd76ed5636fce8b1a0f SHA1 755e1997d745bad1d8e91c2097197188f1f1ba3a SHA256 affe644566254c581d0daa73fbb16cc51def9759e899dbb703977bd47b31c50e -MD5 cd08a66f05d2c55918251738b0c79b2e aquamarine-0.1.9999.2.ebuild 412 -RMD160 c83c14edae17782e9f848bd76ed5636fce8b1a0f aquamarine-0.1.9999.2.ebuild 412 -SHA256 affe644566254c581d0daa73fbb16cc51def9759e899dbb703977bd47b31c50e aquamarine-0.1.9999.2.ebuild 412 -EBUILD aquamarine-0.2.0.ebuild 412 RMD160 c83c14edae17782e9f848bd76ed5636fce8b1a0f SHA1 755e1997d745bad1d8e91c2097197188f1f1ba3a SHA256 affe644566254c581d0daa73fbb16cc51def9759e899dbb703977bd47b31c50e -MD5 cd08a66f05d2c55918251738b0c79b2e aquamarine-0.2.0.ebuild 412 -RMD160 c83c14edae17782e9f848bd76ed5636fce8b1a0f aquamarine-0.2.0.ebuild 412 -SHA256 affe644566254c581d0daa73fbb16cc51def9759e899dbb703977bd47b31c50e aquamarine-0.2.0.ebuild 412 -MD5 27be7a739d8d8b8b477351c6da51917e files/digest-aquamarine-0.1.4 253 -RMD160 349b27011177d0beb1494f8c4e3cee37328551cb files/digest-aquamarine-0.1.4 253 -SHA256 d1605a17411fba8a3f2c1e99c4ceb5395348ed2b36a4d73153ecd2aeb1ca416e files/digest-aquamarine-0.1.4 253 -MD5 cab25ba228351a3f2016f81d6731cc2f files/digest-aquamarine-0.1.99.2 262 -RMD160 13b6b178566d88261a919b60761d1327eea975b7 files/digest-aquamarine-0.1.99.2 262 -SHA256 abf4178a9b06b5b25b27e21370cc9b4e842bb761430810a601200a349d511450 files/digest-aquamarine-0.1.99.2 262 -MD5 6965959bea156f8c55c4cbd0c1e07ba0 files/digest-aquamarine-0.1.9999.1 268 -RMD160 c64a3139a554dee1c84084e8bd2e8b0d8b2377ed files/digest-aquamarine-0.1.9999.1 268 -SHA256 b86f728451f56a72299ba2790835fa890e845d34484cdb60c1cff0eb21804aad files/digest-aquamarine-0.1.9999.1 268 -MD5 d49e78c8648fbde1a8646122dc713a35 files/digest-aquamarine-0.1.9999.2 268 -RMD160 72b52f5088035c290856d31f87f1833001f1948d files/digest-aquamarine-0.1.9999.2 268 -SHA256 4769edd76b32b32f75134a36daff3d0380b11d64db5129df2af1ac8a377702ea files/digest-aquamarine-0.1.9999.2 268 -MD5 94048fd49c54de8ec454264a0e9f8a19 files/digest-aquamarine-0.2.0 253 -RMD160 edc8493c2ac4647221ad80a6d906dd6cecc20d43 files/digest-aquamarine-0.2.0 253 -SHA256 3c2488c3036280ceb085a0f7dedc6336928e2dcde07d576a3aa7a0abac2eb7ed files/digest-aquamarine-0.2.0 253 diff --git a/x11-wm/aquamarine/aquamarine-0.1.4.ebuild b/x11-wm/aquamarine/aquamarine-0.1.4.ebuild deleted file mode 100644 index d2bc0f516..000000000 --- a/x11-wm/aquamarine/aquamarine-0.1.4.ebuild +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit kde - -DESCRIPTION="Beryl KDE Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc" -IUSE="" -RESTRICT="nomirror" - -DEPEND="~x11-wm/beryl-core-${PV}" - -need-kde 3.5 diff --git a/x11-wm/aquamarine/aquamarine-0.1.99.2.ebuild b/x11-wm/aquamarine/aquamarine-0.1.99.2.ebuild deleted file mode 100644 index 85b9a33cd..000000000 --- a/x11-wm/aquamarine/aquamarine-0.1.99.2.ebuild +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit kde - -DESCRIPTION="Beryl KDE Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc" -IUSE="" -RESTRICT="nomirror" - -DEPEND="~x11-wm/beryl-core-${PV}" - -need-kde 3.5 diff --git a/x11-wm/aquamarine/aquamarine-0.1.9999.1.ebuild b/x11-wm/aquamarine/aquamarine-0.1.9999.1.ebuild deleted file mode 100644 index 85b9a33cd..000000000 --- a/x11-wm/aquamarine/aquamarine-0.1.9999.1.ebuild +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit kde - -DESCRIPTION="Beryl KDE Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc" -IUSE="" -RESTRICT="nomirror" - -DEPEND="~x11-wm/beryl-core-${PV}" - -need-kde 3.5 diff --git a/x11-wm/aquamarine/aquamarine-0.1.9999.2.ebuild b/x11-wm/aquamarine/aquamarine-0.1.9999.2.ebuild deleted file mode 100644 index 28df2ffb4..000000000 --- a/x11-wm/aquamarine/aquamarine-0.1.9999.2.ebuild +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit kde - -DESCRIPTION="Beryl KDE Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc ~ppc64" -IUSE="" -RESTRICT="nomirror" - -DEPEND="~x11-wm/beryl-core-${PV}" - -need-kde 3.5 diff --git a/x11-wm/aquamarine/aquamarine-0.2.0.ebuild b/x11-wm/aquamarine/aquamarine-0.2.0.ebuild deleted file mode 100644 index 28df2ffb4..000000000 --- a/x11-wm/aquamarine/aquamarine-0.2.0.ebuild +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -inherit kde - -DESCRIPTION="Beryl KDE Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc ~ppc64" -IUSE="" -RESTRICT="nomirror" - -DEPEND="~x11-wm/beryl-core-${PV}" - -need-kde 3.5 diff --git a/x11-wm/aquamarine/files/digest-aquamarine-0.1.4 b/x11-wm/aquamarine/files/digest-aquamarine-0.1.4 deleted file mode 100644 index 307698296..000000000 --- a/x11-wm/aquamarine/files/digest-aquamarine-0.1.4 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 6b0009bb7af2d37654d8001b1aecfdbe aquamarine-0.1.4.tar.bz2 429163 -RMD160 24a18f96038a3bf3800cd3a6d87a40c580fa6022 aquamarine-0.1.4.tar.bz2 429163 -SHA256 0c9530dc11c4f47cebf1a86e13d428c420b4ab84b7977d56a2bd46df204ad1a8 aquamarine-0.1.4.tar.bz2 429163 diff --git a/x11-wm/aquamarine/files/digest-aquamarine-0.1.99.2 b/x11-wm/aquamarine/files/digest-aquamarine-0.1.99.2 deleted file mode 100644 index e5bc06834..000000000 --- a/x11-wm/aquamarine/files/digest-aquamarine-0.1.99.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 ddd1824eff9ef87cf94bad0529478853 aquamarine-0.1.99.2.tar.bz2 428323 -RMD160 4c8b075d24a149cf076962fc8747d26a57d1d270 aquamarine-0.1.99.2.tar.bz2 428323 -SHA256 59c1bb50b0c49801e479098ecd0a94df88b196cab5011c0e63ff90b4be962c41 aquamarine-0.1.99.2.tar.bz2 428323 diff --git a/x11-wm/aquamarine/files/digest-aquamarine-0.1.9999.1 b/x11-wm/aquamarine/files/digest-aquamarine-0.1.9999.1 deleted file mode 100644 index 6868e8447..000000000 --- a/x11-wm/aquamarine/files/digest-aquamarine-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 aeb3fb74c880c7caa3e789b7248174bd aquamarine-0.1.9999.1.tar.bz2 428391 -RMD160 d2b10a2cb16575f469f46967994171c13e42b84e aquamarine-0.1.9999.1.tar.bz2 428391 -SHA256 5ae8818cccad8fae6df082314f501bcd971aac2865620e3c0b8f3d5b35ba5e8a aquamarine-0.1.9999.1.tar.bz2 428391 diff --git a/x11-wm/aquamarine/files/digest-aquamarine-0.1.9999.2 b/x11-wm/aquamarine/files/digest-aquamarine-0.1.9999.2 deleted file mode 100644 index 6e9036034..000000000 --- a/x11-wm/aquamarine/files/digest-aquamarine-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 b864e80205227fdc0d0401d845ed928b aquamarine-0.1.9999.2.tar.bz2 428754 -RMD160 5f9b1fc3f55539676b90d31a3d2f2af098e52b28 aquamarine-0.1.9999.2.tar.bz2 428754 -SHA256 733cab6b87f673ec43f45912545269a3fe9d12f05d6377aec8c4be6d57b90333 aquamarine-0.1.9999.2.tar.bz2 428754 diff --git a/x11-wm/aquamarine/files/digest-aquamarine-0.2.0 b/x11-wm/aquamarine/files/digest-aquamarine-0.2.0 deleted file mode 100644 index 7a2c70c48..000000000 --- a/x11-wm/aquamarine/files/digest-aquamarine-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 9d5341b93c4f223838a37a7adc5e3c19 aquamarine-0.2.0.tar.bz2 436132 -RMD160 a3e8ded06ab42b415e4b82af38266dbc34236c22 aquamarine-0.2.0.tar.bz2 436132 -SHA256 cb92921659859e4169db40ddec0c6f07285124851121f28d795bccabac238ce7 aquamarine-0.2.0.tar.bz2 436132 diff --git a/x11-wm/beryl-core/Manifest b/x11-wm/beryl-core/Manifest deleted file mode 100644 index c3b672bc6..000000000 --- a/x11-wm/beryl-core/Manifest +++ /dev/null @@ -1,55 +0,0 @@ -AUX beryl-core-gconf.patch 1676 RMD160 66c7eed51ad34d9a741e47d9ed6f2dfab3760aa8 SHA1 1c754a436a9b2d5b159ec3397517054e0542700c SHA256 b99af5f07f09859cb769c5fead97b0ad4a7aeff82ad01dd2142ce9be8c8ed79e -MD5 0cd450e7d58c360f9b1885430785b486 files/beryl-core-gconf.patch 1676 -RMD160 66c7eed51ad34d9a741e47d9ed6f2dfab3760aa8 files/beryl-core-gconf.patch 1676 -SHA256 b99af5f07f09859cb769c5fead97b0ad4a7aeff82ad01dd2142ce9be8c8ed79e files/beryl-core-gconf.patch 1676 -DIST beryl-core-0.1.3.tar.bz2 401682 RMD160 a3950ee3b987673da049b7e5e9423a4e5ce492ca SHA1 384f37b8c888aea02aff5b49a2bb19f65a515b94 SHA256 d5a543e41c5fe63410fd8c8e3a8e5c205a61ba29c74c518a6d218562ec012bc7 -DIST beryl-core-0.1.4.tar.bz2 429476 RMD160 aa473c343118f0936f0aa1dbc47acf0007928d59 SHA1 205d39475a9ee1150127142f1b945803f14cf9cb SHA256 89d71e9d3f0d80bc3b8118eb6c6566e0febe2c20bd02fc16703c95cf8ccf6eef -DIST beryl-core-0.1.99.2.tar.bz2 445849 RMD160 35117d510616a350fbca959c9d6866e14671e5a3 SHA1 d0eab1d4c2eaa16f39840b868aba1e85b2aec315 SHA256 815e21c337cddd56fb38462831f6d0492a41fb3571bf05bf6b833d86afe52dbc -DIST beryl-core-0.1.9999.1.tar.bz2 450319 RMD160 af483d44fcd4d4c2fb401500185b86c1782cdb2d SHA1 7352d8190e13b224c5bedf8a6914e894317a09ba SHA256 517e7fa8e87dd5b6523486ad77dc9c2b63bedc983869ff80f6bf637d7fa117ae -DIST beryl-core-0.1.9999.2.tar.bz2 455009 RMD160 cafcc21d92746ed472c7eca1639f317752e10ec4 SHA1 2b218a344324bc7843d13fac9f292d0ef3c39b6e SHA256 4257566eeba5fad9dc737a51f14bee14b7bf97d3c9fa564f9d2b78fa73288371 -DIST beryl-core-0.2.0.tar.bz2 471760 RMD160 d9bd7ad1f7a3494d7dbf8032ce6a090a37fe623c SHA1 34ea30b4d7403f507be376333c87b9d38bab8c6b SHA256 4890b14756114211eb88fa453de02402fc83058ccde560cb3e618bea46c7eee9 -DIST beryl-mesa-0.1.3.tar.bz2 808134 RMD160 146c7411b2c35ba90b146e8b3f1d0cd611b6b4e9 SHA1 e231aa652fbc573c78cce984ed6327f608995fcc SHA256 6b46938423f68dcd4884cc8486c4c6de486bdc660088131072254973676b4b7a -DIST beryl-mesa-0.1.4.tar.bz2 808096 RMD160 df95b37b489867c95b860745bdfb3c196df8a843 SHA1 27559d6151d7a07f9433f263b07aa67399595c66 SHA256 3e99371ff0f24d256dd94c3691d31fd4de02ab313a5dadf6df175c7c7ccea0d0 -DIST beryl-mesa-0.1.99.2.tar.bz2 808238 RMD160 2863885333e8dbb5e618b99eae4c5aa7401b7f9b SHA1 4fbc2bb45263dce497184b46f9350120fc2424d9 SHA256 76a879a07522d7eb2bea525fd318cf81ecd14388d35b1863a622298add939071 -EBUILD beryl-core-0.1.3-r1.ebuild 1074 RMD160 f06347334a40d8a664b4985bc5c268cc7e4af2f3 SHA1 4fd6dd565c0c3e735d680495f24610157d72f83d SHA256 c397021bf5122bd13275c4230f1a5b4403f4b7350483690677e8fc589855d03f -MD5 91c6cf701089dd2f53d7370ea95326c3 beryl-core-0.1.3-r1.ebuild 1074 -RMD160 f06347334a40d8a664b4985bc5c268cc7e4af2f3 beryl-core-0.1.3-r1.ebuild 1074 -SHA256 c397021bf5122bd13275c4230f1a5b4403f4b7350483690677e8fc589855d03f beryl-core-0.1.3-r1.ebuild 1074 -EBUILD beryl-core-0.1.4.ebuild 1368 RMD160 0a841eaf236a892f1ec96fc7a6f5257d5696f937 SHA1 81d2a04a2504c0ebd823f4e0db16d24800635fca SHA256 65ff76e8295bdcb7094e91e04d0f52bbd11a3df82e695607e878b6a733aa2b3e -MD5 45c49722ad66c5dc109d280fc82d1c29 beryl-core-0.1.4.ebuild 1368 -RMD160 0a841eaf236a892f1ec96fc7a6f5257d5696f937 beryl-core-0.1.4.ebuild 1368 -SHA256 65ff76e8295bdcb7094e91e04d0f52bbd11a3df82e695607e878b6a733aa2b3e beryl-core-0.1.4.ebuild 1368 -EBUILD beryl-core-0.1.99.2.ebuild 1349 RMD160 99d105fde547afde1d55a8fe7b865618b2877382 SHA1 9318cd927c3ab662f34675e265ccf10253274ff5 SHA256 fa6d3324b13f701e38b1ac7a210e1004affd249e8ebc82bd45fec457989917f0 -MD5 3c4684fcc21c54e869ef2c1a7e267f90 beryl-core-0.1.99.2.ebuild 1349 -RMD160 99d105fde547afde1d55a8fe7b865618b2877382 beryl-core-0.1.99.2.ebuild 1349 -SHA256 fa6d3324b13f701e38b1ac7a210e1004affd249e8ebc82bd45fec457989917f0 beryl-core-0.1.99.2.ebuild 1349 -EBUILD beryl-core-0.1.9999.1.ebuild 1366 RMD160 00b05a67c26737fe181874337f62ce0f72e924a9 SHA1 963de2cb8c5829ba17cce807dd1a14069613abeb SHA256 47d157776872bf8ade26146624e8a939a804fbee7d192c07ae7648394f7e9b6d -MD5 86f71796ac0613f3b5d910d7c60cb7ae beryl-core-0.1.9999.1.ebuild 1366 -RMD160 00b05a67c26737fe181874337f62ce0f72e924a9 beryl-core-0.1.9999.1.ebuild 1366 -SHA256 47d157776872bf8ade26146624e8a939a804fbee7d192c07ae7648394f7e9b6d beryl-core-0.1.9999.1.ebuild 1366 -EBUILD beryl-core-0.1.9999.2.ebuild 1397 RMD160 665689b16e72ecde888940842d532ad1f48a319f SHA1 2d46219601d8242088157d2db561d15838267cdf SHA256 a6054f2d0101d449c292e1d2b62c34f210b3314b77e58e1b2db55acadffe8658 -MD5 9833e3657f69ac4eaf71eee83a0fa040 beryl-core-0.1.9999.2.ebuild 1397 -RMD160 665689b16e72ecde888940842d532ad1f48a319f beryl-core-0.1.9999.2.ebuild 1397 -SHA256 a6054f2d0101d449c292e1d2b62c34f210b3314b77e58e1b2db55acadffe8658 beryl-core-0.1.9999.2.ebuild 1397 -EBUILD beryl-core-0.2.0.ebuild 1417 RMD160 84e021f4eddc08eabaf2e9809248f86712bf1fb9 SHA1 0b97d4908e85ec72e2ea2ac26f47b571866ff4e5 SHA256 4f3627085b0b5b015500ea6cd7cbe5e7b0c46341711f28037052c743188c72c5 -MD5 713f49fafa62f4c6a24e742be5c06a85 beryl-core-0.2.0.ebuild 1417 -RMD160 84e021f4eddc08eabaf2e9809248f86712bf1fb9 beryl-core-0.2.0.ebuild 1417 -SHA256 4f3627085b0b5b015500ea6cd7cbe5e7b0c46341711f28037052c743188c72c5 beryl-core-0.2.0.ebuild 1417 -MD5 efc154df0b8af37737220d94a697a96b files/digest-beryl-core-0.1.3-r1 506 -RMD160 3197ef95fb1e29178783ed914c062e4fea7deb4f files/digest-beryl-core-0.1.3-r1 506 -SHA256 342e80121631cb90f7ebb93fcac7c5acd1e97d0979a1329e3247d8cc5d6dcb24 files/digest-beryl-core-0.1.3-r1 506 -MD5 de7b4346030ef46c7361bfdcb2a47fa2 files/digest-beryl-core-0.1.4 506 -RMD160 ab61fde04db4721e49f8d27e308e19566eea1a8e files/digest-beryl-core-0.1.4 506 -SHA256 21dd2fec6ed23aa16dff2d6572f2af69207fe72035701b63788a068f2156a44b files/digest-beryl-core-0.1.4 506 -MD5 8d8ae6101764c512e5c82c23c87dc326 files/digest-beryl-core-0.1.99.2 524 -RMD160 c62bac2d8e83fe9351852c9394399125ac372037 files/digest-beryl-core-0.1.99.2 524 -SHA256 d0a0d4daa9b21bc7567cc7fc45390f7ea89cd721ca9be3838568baa28a58e2dc files/digest-beryl-core-0.1.99.2 524 -MD5 3367843c9ea63cc9c0f40a18670c2ebf files/digest-beryl-core-0.1.9999.1 530 -RMD160 110a3b3f7e0b2976776566db45e74dc45e9ed9e5 files/digest-beryl-core-0.1.9999.1 530 -SHA256 fc4bdd9a33a95176d0be5c8d00144c10041cf1b9c7021342c68ec3dea43a8f99 files/digest-beryl-core-0.1.9999.1 530 -MD5 8cd01128d16d644d11bcbcfb15dd903c files/digest-beryl-core-0.1.9999.2 530 -RMD160 c047ab2ad3ba57dd1f95abc13d7e9dc3102465ae files/digest-beryl-core-0.1.9999.2 530 -SHA256 ed311ae6910fb723c2909e9c875801ecc35394bf3fa793b5ea3f6b75df9e701b files/digest-beryl-core-0.1.9999.2 530 -MD5 f4aacaf3f60aaaa8994f0a2fa4930f86 files/digest-beryl-core-0.2.0 515 -RMD160 0689d8d9edaf872da20d58a53d3cb057a200dff2 files/digest-beryl-core-0.2.0 515 -SHA256 6d5b80521981c17bf4083881834cb7b29fff29a1f20fbd69c7b8f88f7ded245b files/digest-beryl-core-0.2.0 515 diff --git a/x11-wm/beryl-core/beryl-core-0.1.3-r1.ebuild b/x11-wm/beryl-core/beryl-core-0.1.3-r1.ebuild deleted file mode 100644 index 57bc3eca0..000000000 --- a/x11-wm/beryl-core/beryl-core-0.1.3-r1.ebuild +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/beryl-core/beryl-core-0.1.2.ebuild,v 1.1 2006/11/15 04:04:47 tsunam Exp $ - -inherit autotools - -DESCRIPTION="Beryl window manager for AIGLX and XGL" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://distfiles.gentoo-xeffects.org/beryl-releases/${PV}/${P}.tar.bz2 - http://distfiles.gentoo-xeffects.org/beryl-releases/${PV}/beryl-mesa-${PV}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="" -RESTRICT="nomirror" - -DEPEND=">=x11-base/xorg-server-1.1.1-r1 - >=x11-libs/gtk+-2.8.0 - x11-libs/libXcomposite - x11-libs/libXdamage - x11-libs/libXrandr - x11-libs/startup-notification" - -RDEPEND="${DEPEND} - x11-apps/xdpyinfo" - -PDEPEND="~x11-plugins/beryl-plugins-${PV}" - -src_compile() { - epatch "${FILESDIR}"/${PN}-gconf.patch - eautoreconf - - econf --with-berylmesadir="${WORKDIR}/beryl-mesa" || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-wm/beryl-core/beryl-core-0.1.4.ebuild b/x11-wm/beryl-core/beryl-core-0.1.4.ebuild deleted file mode 100644 index e110de48c..000000000 --- a/x11-wm/beryl-core/beryl-core-0.1.4.ebuild +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl window manager for AIGLX and XGL" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2 - http://releases.beryl-project.org/${PV}/beryl-mesa-${PV}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-base/xorg-server-1.1.1-r1 - >=x11-libs/gtk+-2.8.0 - x11-libs/libXcomposite - x11-libs/libXdamage - x11-libs/libXrandr - x11-libs/startup-notification" - -RDEPEND="${DEPEND} - x11-apps/xdpyinfo" - -PDEPEND="~x11-plugins/beryl-plugins-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - - #if [ -z "${LINGUAS}" ]; then - # export LINGUAS_BERYL="en_GB" - # ewarn - # ewarn " To get a localized build, set the according LINGUAS variable(s). " - # ewarn - #else - export LINGUAS_BERYL=`echo ${LINGUAS}` - #fi -} - -src_compile() { - eautoreconf - #--with-lang="${LINGUAS_BERYL}" - econf --with-berylmesadir="${WORKDIR}/beryl-mesa" || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-wm/beryl-core/beryl-core-0.1.99.2.ebuild b/x11-wm/beryl-core/beryl-core-0.1.99.2.ebuild deleted file mode 100644 index ede02f0cf..000000000 --- a/x11-wm/beryl-core/beryl-core-0.1.99.2.ebuild +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl window manager for AIGLX and XGL" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2 - http://sabayonlinux.org/distfiles/beryl-mesa-${PV}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-base/xorg-server-1.1.1-r1 - >=x11-libs/gtk+-2.8.0 - x11-libs/libXcomposite - x11-libs/libXdamage - x11-libs/libXrandr - x11-libs/startup-notification" - -RDEPEND="${DEPEND} - x11-apps/xdpyinfo" - -PDEPEND="~x11-plugins/beryl-plugins-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - eautoreconf - #--with-lang="${LINGUAS_BERYL}" - econf --with-berylmesadir="${WORKDIR}/beryl-mesa" || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-wm/beryl-core/beryl-core-0.1.9999.1.ebuild b/x11-wm/beryl-core/beryl-core-0.1.9999.1.ebuild deleted file mode 100644 index 4a669ba6d..000000000 --- a/x11-wm/beryl-core/beryl-core-0.1.9999.1.ebuild +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl window manager for AIGLX and XGL" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2 - http://sabayonlinux.org/distfiles/beryl-mesa-0.1.99.2.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - -DEPEND=">=x11-base/xorg-server-1.1.1-r1 - >=x11-libs/gtk+-2.8.0 - x11-libs/libXcomposite - x11-libs/libXdamage - x11-libs/libXrandr - x11-libs/startup-notification" - -RDEPEND="${DEPEND} - x11-apps/xdpyinfo" - -PDEPEND="~x11-plugins/beryl-plugins-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - eautoreconf - #--with-lang="${LINGUAS_BERYL}" - econf --with-berylmesadir="${WORKDIR}/beryl-mesa" --enable-xgl || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-wm/beryl-core/beryl-core-0.1.9999.2.ebuild b/x11-wm/beryl-core/beryl-core-0.1.9999.2.ebuild deleted file mode 100644 index c00ae9edd..000000000 --- a/x11-wm/beryl-core/beryl-core-0.1.9999.2.ebuild +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl window manager for AIGLX and XGL" -HOMEPAGE="http://beryl-project.org" -SRC_URI=" - http://releases.beryl-project.org/${PV}/${P}.tar.bz2 - http://releases.beryl-project.org/0.1.99.2/beryl-mesa-0.1.99.2.tar.bz2 - " - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" - -DEPEND=">=x11-base/xorg-server-1.1.1-r1 - >=x11-libs/gtk+-2.8.0 - x11-libs/libXcomposite - x11-libs/libXdamage - x11-libs/libXrandr - x11-libs/startup-notification" - -RDEPEND="${DEPEND} - x11-apps/xdpyinfo" - -PDEPEND="~x11-plugins/beryl-plugins-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - eautoreconf - #--with-lang="${LINGUAS_BERYL}" - econf --with-berylmesadir="${WORKDIR}/beryl-mesa" --enable-xgl || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-wm/beryl-core/beryl-core-0.2.0.ebuild b/x11-wm/beryl-core/beryl-core-0.2.0.ebuild deleted file mode 100644 index c03c6a71e..000000000 --- a/x11-wm/beryl-core/beryl-core-0.2.0.ebuild +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2004-2006 SabayonLinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit autotools flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl window manager for AIGLX and XGL" -HOMEPAGE="http://beryl-project.org" -SRC_URI=" - http://releases.beryl-project.org/${PV}/${P}.tar.bz2 - http://releases.beryl-project.org/0.1.99.2/beryl-mesa-0.1.99.2.tar.bz2 - " -RESTRICT="nomirror" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" - -DEPEND=">=x11-base/xorg-server-1.1.1-r1 - >=x11-libs/gtk+-2.8.0 - x11-libs/libXcomposite - x11-libs/libXdamage - x11-libs/libXrandr - x11-libs/startup-notification" - -RDEPEND="${DEPEND} - x11-apps/xdpyinfo" - -PDEPEND="~x11-plugins/beryl-plugins-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - - if [ -z "${LINGUAS}" ]; then - export LINGUAS_BERYL="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_BERYL=`echo ${LINGUAS}` - fi -} - -src_compile() { - eautoreconf - #--with-lang="${LINGUAS_BERYL}" - econf --with-berylmesadir="${WORKDIR}/beryl-mesa" --enable-xgl || die "econf failed" - emake -j1 || die "make failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} diff --git a/x11-wm/beryl-core/files/beryl-core-gconf.patch b/x11-wm/beryl-core/files/beryl-core-gconf.patch deleted file mode 100644 index 6f7ce662a..000000000 --- a/x11-wm/beryl-core/files/beryl-core-gconf.patch +++ /dev/null @@ -1,48 +0,0 @@ -Index: configure.ac -=================================================================== ---- configure.ac (revision 1653) -+++ configure.ac (working copy) -@@ -94,8 +94,20 @@ - PKG_CHECK_MODULES(BERYL, $BERYL_REQUIRES) - AC_SUBST(BERYL_REQUIRES) - PKG_CHECK_MODULES(GLIB, "glib-2.0") --PKG_CHECK_MODULES(GCONF, "gconf-2.0") - -+AC_ARG_ENABLE(gconf, [--enable-gconf Enable GConf backend for libberylsettings], -+ [beryl_gconf=$enableval],[beryl_gconf=no]) -+ -+if test "x$beryl_gconf" = "xyes" -+then -+ PKG_CHECK_MODULES(GCONF, "gconf-2.0") -+fi -+ -+AM_CONDITIONAL(GCONF_BACKEND, test "x$beryl_gconf" = "xyes") -+if test "$beryl_gconf" = yes; then -+ AC_DEFINE(USE_GCONF, 1, [Build gconf backend]) -+fi -+ - AC_ARG_WITH( berylmesadir, - [ --with-berylmesadir Set beryl internal mesa path (needed for static linked beryl-xgl) [default=../beryl-mesa] ], - [ beryl_mesa_dir=${withval}],[ beryl_mesa_dir="../beryl-mesa" ]) - -Index: settings-backends/Makefile.am -=================================================================== ---- settings-backends/Makefile.am (revision 1653) -+++ settings-backends/Makefile.am (working copy) -@@ -7,12 +7,14 @@ - libini_la_LIBADD = @GLIB_LIBS@ @BERYL_LIBS@ ../libberylsettings/libberylsettings.la - libini_la_SOURCES = ini.c - -+if GCONF_BACKEND - libgconf_la_LDFLAGS = -module -avoid-version -no-undefined - libgconf_la_LIBADD = @GCONF_LIBS@ @GLIB_LIBS@ @BERYL_LIBS@ ../libberylsettings/libberylsettings.la - libgconf_la_SOURCES = gconf.c -- -+libgconf_module=libgconf.la -+endif - backenddir = $(plugindir)/backends - - backend_LTLIBRARIES = \ - libini.la \ -- libgconf.la -+ $(libgconf_module) diff --git a/x11-wm/beryl-core/files/digest-beryl-core-0.1.3-r1 b/x11-wm/beryl-core/files/digest-beryl-core-0.1.3-r1 deleted file mode 100644 index 0e32b070c..000000000 --- a/x11-wm/beryl-core/files/digest-beryl-core-0.1.3-r1 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 24caed8a8cb50fd30823a9ee182f85f4 beryl-core-0.1.3.tar.bz2 401682 -RMD160 a3950ee3b987673da049b7e5e9423a4e5ce492ca beryl-core-0.1.3.tar.bz2 401682 -SHA256 d5a543e41c5fe63410fd8c8e3a8e5c205a61ba29c74c518a6d218562ec012bc7 beryl-core-0.1.3.tar.bz2 401682 -MD5 c22765c2637846907ee6154b548151e9 beryl-mesa-0.1.3.tar.bz2 808134 -RMD160 146c7411b2c35ba90b146e8b3f1d0cd611b6b4e9 beryl-mesa-0.1.3.tar.bz2 808134 -SHA256 6b46938423f68dcd4884cc8486c4c6de486bdc660088131072254973676b4b7a beryl-mesa-0.1.3.tar.bz2 808134 diff --git a/x11-wm/beryl-core/files/digest-beryl-core-0.1.4 b/x11-wm/beryl-core/files/digest-beryl-core-0.1.4 deleted file mode 100644 index f224defde..000000000 --- a/x11-wm/beryl-core/files/digest-beryl-core-0.1.4 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 4d4eaa811b107fa099de4120b94d58b1 beryl-core-0.1.4.tar.bz2 429476 -RMD160 aa473c343118f0936f0aa1dbc47acf0007928d59 beryl-core-0.1.4.tar.bz2 429476 -SHA256 89d71e9d3f0d80bc3b8118eb6c6566e0febe2c20bd02fc16703c95cf8ccf6eef beryl-core-0.1.4.tar.bz2 429476 -MD5 d2e4a6237101e5ce87000812001fbce1 beryl-mesa-0.1.4.tar.bz2 808096 -RMD160 df95b37b489867c95b860745bdfb3c196df8a843 beryl-mesa-0.1.4.tar.bz2 808096 -SHA256 3e99371ff0f24d256dd94c3691d31fd4de02ab313a5dadf6df175c7c7ccea0d0 beryl-mesa-0.1.4.tar.bz2 808096 diff --git a/x11-wm/beryl-core/files/digest-beryl-core-0.1.99.2 b/x11-wm/beryl-core/files/digest-beryl-core-0.1.99.2 deleted file mode 100644 index a16deac43..000000000 --- a/x11-wm/beryl-core/files/digest-beryl-core-0.1.99.2 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 e439403ce19130e37f46185a65465c9b beryl-core-0.1.99.2.tar.bz2 445849 -RMD160 35117d510616a350fbca959c9d6866e14671e5a3 beryl-core-0.1.99.2.tar.bz2 445849 -SHA256 815e21c337cddd56fb38462831f6d0492a41fb3571bf05bf6b833d86afe52dbc beryl-core-0.1.99.2.tar.bz2 445849 -MD5 387d068091bc5c6fa28f6d754e1296d1 beryl-mesa-0.1.99.2.tar.bz2 808238 -RMD160 2863885333e8dbb5e618b99eae4c5aa7401b7f9b beryl-mesa-0.1.99.2.tar.bz2 808238 -SHA256 76a879a07522d7eb2bea525fd318cf81ecd14388d35b1863a622298add939071 beryl-mesa-0.1.99.2.tar.bz2 808238 diff --git a/x11-wm/beryl-core/files/digest-beryl-core-0.1.9999.1 b/x11-wm/beryl-core/files/digest-beryl-core-0.1.9999.1 deleted file mode 100644 index f4cdcce25..000000000 --- a/x11-wm/beryl-core/files/digest-beryl-core-0.1.9999.1 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 e7f65f7caf72ed7ec55f46468099f694 beryl-core-0.1.9999.1.tar.bz2 450319 -RMD160 af483d44fcd4d4c2fb401500185b86c1782cdb2d beryl-core-0.1.9999.1.tar.bz2 450319 -SHA256 517e7fa8e87dd5b6523486ad77dc9c2b63bedc983869ff80f6bf637d7fa117ae beryl-core-0.1.9999.1.tar.bz2 450319 -MD5 387d068091bc5c6fa28f6d754e1296d1 beryl-mesa-0.1.99.2.tar.bz2 808238 -RMD160 2863885333e8dbb5e618b99eae4c5aa7401b7f9b beryl-mesa-0.1.99.2.tar.bz2 808238 -SHA256 76a879a07522d7eb2bea525fd318cf81ecd14388d35b1863a622298add939071 beryl-mesa-0.1.99.2.tar.bz2 808238 diff --git a/x11-wm/beryl-core/files/digest-beryl-core-0.1.9999.2 b/x11-wm/beryl-core/files/digest-beryl-core-0.1.9999.2 deleted file mode 100644 index 3daf3a1dc..000000000 --- a/x11-wm/beryl-core/files/digest-beryl-core-0.1.9999.2 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 f62fd180a1d61dbfe4eba2ae966e9c82 beryl-core-0.1.9999.2.tar.bz2 455009 -RMD160 cafcc21d92746ed472c7eca1639f317752e10ec4 beryl-core-0.1.9999.2.tar.bz2 455009 -SHA256 4257566eeba5fad9dc737a51f14bee14b7bf97d3c9fa564f9d2b78fa73288371 beryl-core-0.1.9999.2.tar.bz2 455009 -MD5 387d068091bc5c6fa28f6d754e1296d1 beryl-mesa-0.1.99.2.tar.bz2 808238 -RMD160 2863885333e8dbb5e618b99eae4c5aa7401b7f9b beryl-mesa-0.1.99.2.tar.bz2 808238 -SHA256 76a879a07522d7eb2bea525fd318cf81ecd14388d35b1863a622298add939071 beryl-mesa-0.1.99.2.tar.bz2 808238 diff --git a/x11-wm/beryl-core/files/digest-beryl-core-0.2.0 b/x11-wm/beryl-core/files/digest-beryl-core-0.2.0 deleted file mode 100644 index 36a4bba88..000000000 --- a/x11-wm/beryl-core/files/digest-beryl-core-0.2.0 +++ /dev/null @@ -1,6 +0,0 @@ -MD5 b937a4e6606d931c03d2014d08e9b096 beryl-core-0.2.0.tar.bz2 471760 -RMD160 d9bd7ad1f7a3494d7dbf8032ce6a090a37fe623c beryl-core-0.2.0.tar.bz2 471760 -SHA256 4890b14756114211eb88fa453de02402fc83058ccde560cb3e618bea46c7eee9 beryl-core-0.2.0.tar.bz2 471760 -MD5 387d068091bc5c6fa28f6d754e1296d1 beryl-mesa-0.1.99.2.tar.bz2 808238 -RMD160 2863885333e8dbb5e618b99eae4c5aa7401b7f9b beryl-mesa-0.1.99.2.tar.bz2 808238 -SHA256 76a879a07522d7eb2bea525fd318cf81ecd14388d35b1863a622298add939071 beryl-mesa-0.1.99.2.tar.bz2 808238 diff --git a/x11-wm/beryl/Manifest b/x11-wm/beryl/Manifest deleted file mode 100644 index b61de3026..000000000 --- a/x11-wm/beryl/Manifest +++ /dev/null @@ -1,49 +0,0 @@ -EBUILD beryl-0.1.3-r1.ebuild 788 RMD160 87e087e50b171bdb4295903ffceb3b1f9dc2cad6 SHA1 b0216603d89665ec76cffef6f4d6e8b2de5da76a SHA256 661f2bb44d261bbe2821875cc5bb4063f48a992ac4c4646b03dc2dc42721d9e3 -MD5 81aa5a4bdfe5c7ab36b3b608db8f3e49 beryl-0.1.3-r1.ebuild 788 -RMD160 87e087e50b171bdb4295903ffceb3b1f9dc2cad6 beryl-0.1.3-r1.ebuild 788 -SHA256 661f2bb44d261bbe2821875cc5bb4063f48a992ac4c4646b03dc2dc42721d9e3 beryl-0.1.3-r1.ebuild 788 -EBUILD beryl-0.1.4.ebuild 902 RMD160 295c8a8431d1d7fdfabd510d4f952e57e6b6203e SHA1 1a5e3eea043ea3ef4de127125aa2790a18047fb5 SHA256 0c8a6074a3b2cd91c6164be56c17955a78d593793217d94297bbec38c0b1d146 -MD5 b6091fdc03bdc142aeccc629d2e4fc05 beryl-0.1.4.ebuild 902 -RMD160 295c8a8431d1d7fdfabd510d4f952e57e6b6203e beryl-0.1.4.ebuild 902 -SHA256 0c8a6074a3b2cd91c6164be56c17955a78d593793217d94297bbec38c0b1d146 beryl-0.1.4.ebuild 902 -EBUILD beryl-0.1.99.2.ebuild 813 RMD160 c6886539aafb486d924da95a0f5a17f246a30d0e SHA1 a90738831434bcf0afe3215fd9b6ab522c1f3d10 SHA256 d454edde8852011167009a34ef51be2712b6ffe31bc007f1249076651ed374ad -MD5 9a70c2b363995c45dccf9d904750c7ae beryl-0.1.99.2.ebuild 813 -RMD160 c6886539aafb486d924da95a0f5a17f246a30d0e beryl-0.1.99.2.ebuild 813 -SHA256 d454edde8852011167009a34ef51be2712b6ffe31bc007f1249076651ed374ad beryl-0.1.99.2.ebuild 813 -EBUILD beryl-0.1.9999.1.ebuild 783 RMD160 4ef2d23bef7a67d6e4e7f7855eca15bfd207e259 SHA1 3ed109f3f882107f8635e56fa2c300422dd8152c SHA256 57b973f3f1899439adecfe529ca150f5ad3efd685223029e0d6e9b0882bcf39c -MD5 da979762703650bdf8dd61f0a7ae2101 beryl-0.1.9999.1.ebuild 783 -RMD160 4ef2d23bef7a67d6e4e7f7855eca15bfd207e259 beryl-0.1.9999.1.ebuild 783 -SHA256 57b973f3f1899439adecfe529ca150f5ad3efd685223029e0d6e9b0882bcf39c beryl-0.1.9999.1.ebuild 783 -EBUILD beryl-0.1.9999.2.ebuild 856 RMD160 8b18e518824265708f67d47832b86dce11a68cd2 SHA1 c4d6d170f61cd4188485246cdb746dfad181bd0c SHA256 804bc2f851b14752a52a78eee4dab36e14a5388684accd4d2ebf7b4d3fc3f0a7 -MD5 74866476d2dfcf2c47c27e3df31e6cb2 beryl-0.1.9999.2.ebuild 856 -RMD160 8b18e518824265708f67d47832b86dce11a68cd2 beryl-0.1.9999.2.ebuild 856 -SHA256 804bc2f851b14752a52a78eee4dab36e14a5388684accd4d2ebf7b4d3fc3f0a7 beryl-0.1.9999.2.ebuild 856 -EBUILD beryl-0.2.0-r1.ebuild 881 RMD160 60819f88c428643d94c68bc6a4d42b477b2ba63b SHA1 b6d5ce4daec287a0330d53013237203b1d5b3dd9 SHA256 c02473d918719a083eb1a3f6c3a1e4dd177f14f4e7eeeafb0278b4ca88fb1220 -MD5 41dcdfd61a7cf0115ea13774c42a9621 beryl-0.2.0-r1.ebuild 881 -RMD160 60819f88c428643d94c68bc6a4d42b477b2ba63b beryl-0.2.0-r1.ebuild 881 -SHA256 c02473d918719a083eb1a3f6c3a1e4dd177f14f4e7eeeafb0278b4ca88fb1220 beryl-0.2.0-r1.ebuild 881 -EBUILD beryl-0.2.0.ebuild 856 RMD160 8b18e518824265708f67d47832b86dce11a68cd2 SHA1 c4d6d170f61cd4188485246cdb746dfad181bd0c SHA256 804bc2f851b14752a52a78eee4dab36e14a5388684accd4d2ebf7b4d3fc3f0a7 -MD5 74866476d2dfcf2c47c27e3df31e6cb2 beryl-0.2.0.ebuild 856 -RMD160 8b18e518824265708f67d47832b86dce11a68cd2 beryl-0.2.0.ebuild 856 -SHA256 804bc2f851b14752a52a78eee4dab36e14a5388684accd4d2ebf7b4d3fc3f0a7 beryl-0.2.0.ebuild 856 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-beryl-0.1.3-r1 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-beryl-0.1.3-r1 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-beryl-0.1.3-r1 0 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-beryl-0.1.4 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-beryl-0.1.4 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-beryl-0.1.4 0 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-beryl-0.1.99.2 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-beryl-0.1.99.2 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-beryl-0.1.99.2 0 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-beryl-0.1.9999.1 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-beryl-0.1.9999.1 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-beryl-0.1.9999.1 0 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-beryl-0.1.9999.2 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-beryl-0.1.9999.2 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-beryl-0.1.9999.2 0 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-beryl-0.2.0 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-beryl-0.2.0 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-beryl-0.2.0 0 -MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-beryl-0.2.0-r1 0 -RMD160 9c1185a5c5e9fc54612808977ee8f548b2258d31 files/digest-beryl-0.2.0-r1 0 -SHA256 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 files/digest-beryl-0.2.0-r1 0 diff --git a/x11-wm/beryl/beryl-0.1.3-r1.ebuild b/x11-wm/beryl/beryl-0.1.3-r1.ebuild deleted file mode 100644 index 07cfc5be7..000000000 --- a/x11-wm/beryl/beryl-0.1.3-r1.ebuild +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/beryl/beryl-0.1.2.ebuild,v 1.1 2006/11/15 04:06:51 tsunam Exp $ - -inherit eutils - -DESCRIPTION="Beryl window manager for AIGLX and XGL (meta)" -HOMEPAGE="http://beryl-project.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="" - -RDEPEND="~x11-plugins/beryl-plugins-${PV} - ~x11-wm/emerald-${PV} - ~x11-misc/beryl-settings-${PV} - ~x11-misc/beryl-manager-${PV}" - -pkg_setup() { - if has_version ">=x11-libs/cairo-1.2.2" && ! built_with_use x11-libs/cairo X pdf; then - einfo "Please re-emerge >=x11-libs/cairo-1.2.2 with the X and pdf USE flag set" - die "Please emerge >=x11-libs/cairo-1.2.2 with the X and pdf flag set" - fi -} diff --git a/x11-wm/beryl/beryl-0.1.4.ebuild b/x11-wm/beryl/beryl-0.1.4.ebuild deleted file mode 100644 index 0db9ef578..000000000 --- a/x11-wm/beryl/beryl-0.1.4.ebuild +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/beryl/beryl-0.1.2.ebuild,v 1.1 2006/11/15 04:06:51 tsunam Exp $ - -inherit eutils - -DESCRIPTION="Beryl window manager for AIGLX and XGL (meta)" -HOMEPAGE="http://beryl-project.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="kde gnome" - -RDEPEND="~x11-plugins/beryl-plugins-${PV} - ~x11-wm/emerald-${PV} - kde? ( - ~x11-wm/aquamarine-${PV} - ) - gnome? ( - ~x11-wm/heliodor-${PV} - ) - ~x11-misc/beryl-settings-${PV} - ~x11-misc/beryl-manager-${PV} - >=x11-misc/beryl-wrapper-1.5" - -pkg_setup() { - if has_version ">=x11-libs/cairo-1.2.2" && ! built_with_use x11-libs/cairo X pdf; then - einfo "Please re-emerge >=x11-libs/cairo-1.2.2 with the X and pdf USE flag set" - die "Please emerge >=x11-libs/cairo-1.2.2 with the X and pdf flag set" - fi -} diff --git a/x11-wm/beryl/beryl-0.1.99.2.ebuild b/x11-wm/beryl/beryl-0.1.99.2.ebuild deleted file mode 100644 index a895109b2..000000000 --- a/x11-wm/beryl/beryl-0.1.99.2.ebuild +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit eutils - -DESCRIPTION="Beryl window manager for AIGLX and XGL (meta)" -HOMEPAGE="http://beryl-project.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="kde gnome" - -RDEPEND="~x11-plugins/beryl-plugins-${PV} - ~x11-wm/emerald-${PV} - kde? ( - ~x11-wm/aquamarine-${PV} - ) - gnome? ( - ~x11-wm/heliodor-${PV} - ) - ~x11-misc/beryl-settings-${PV} - ~x11-misc/beryl-manager-${PV} - >=x11-misc/beryl-wrapper-1.5" - -pkg_setup() { - if has_version ">=x11-libs/cairo-1.2.2" && ! built_with_use x11-libs/cairo X pdf; then - einfo "Please re-emerge >=x11-libs/cairo-1.2.2 with the X and pdf USE flag set" - die "Please emerge >=x11-libs/cairo-1.2.2 with the X and pdf flag set" - fi -} diff --git a/x11-wm/beryl/beryl-0.1.9999.1.ebuild b/x11-wm/beryl/beryl-0.1.9999.1.ebuild deleted file mode 100644 index 12d2a639e..000000000 --- a/x11-wm/beryl/beryl-0.1.9999.1.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit eutils - -DESCRIPTION="Beryl window manager for AIGLX and XGL (meta)" -HOMEPAGE="http://beryl-project.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="kde gnome" - -RDEPEND="~x11-plugins/beryl-plugins-${PV} - ~x11-wm/emerald-${PV} - kde? ( - ~x11-wm/aquamarine-${PV} - ) - gnome? ( - ~x11-wm/heliodor-${PV} - ) - ~x11-misc/beryl-settings-${PV} - ~x11-misc/beryl-manager-${PV}" - -pkg_setup() { - if has_version ">=x11-libs/cairo-1.2.2" && ! built_with_use x11-libs/cairo X pdf; then - einfo "Please re-emerge >=x11-libs/cairo-1.2.2 with the X and pdf USE flag set" - die "Please emerge >=x11-libs/cairo-1.2.2 with the X and pdf flag set" - fi -} diff --git a/x11-wm/beryl/beryl-0.1.9999.2.ebuild b/x11-wm/beryl/beryl-0.1.9999.2.ebuild deleted file mode 100644 index fea26f7c6..000000000 --- a/x11-wm/beryl/beryl-0.1.9999.2.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit eutils - -DESCRIPTION="Beryl window manager for AIGLX and XGL (meta)" -HOMEPAGE="http://beryl-project.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" -IUSE="kde gnome" - -RDEPEND=" - ~x11-plugins/beryl-plugins-${PV} - ~x11-wm/emerald-${PV} - kde? ( ~x11-wm/aquamarine-${PV} ) - gnome? ( ~x11-wm/heliodor-${PV} ) - ~x11-misc/beryl-settings-${PV} - ~x11-misc/beryl-settings-simple-${PV} - ~x11-misc/beryl-manager-${PV} - >=x11-libs/cairo-1.2 - " - -pkg_setup() { - if has_version ">=x11-libs/cairo-1.2.2" && ! built_with_use x11-libs/cairo X pdf; then - einfo "Please re-emerge >=x11-libs/cairo-1.2.2 with the X and pdf USE flag set" - die "Please emerge >=x11-libs/cairo-1.2.2 with the X and pdf flag set" - fi -} diff --git a/x11-wm/beryl/beryl-0.2.0-r1.ebuild b/x11-wm/beryl/beryl-0.2.0-r1.ebuild deleted file mode 100644 index 1820e93d7..000000000 --- a/x11-wm/beryl/beryl-0.2.0-r1.ebuild +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit eutils - -DESCRIPTION="Beryl window manager for AIGLX and XGL (meta)" -HOMEPAGE="http://beryl-project.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" -IUSE="kde gnome" - -DEPEND=" - ~x11-wm/beryl-core-${PV} - ~x11-plugins/beryl-plugins-${PV} - ~x11-wm/emerald-${PV} - kde? ( ~x11-wm/aquamarine-${PV} ) - gnome? ( ~x11-wm/heliodor-${PV} ) - ~x11-misc/beryl-settings-${PV} - ~x11-misc/beryl-settings-simple-${PV} - ~x11-misc/beryl-manager-${PV} - >=x11-libs/cairo-1.2 - " - -pkg_setup() { - if has_version ">=x11-libs/cairo-1.2.2" && ! built_with_use x11-libs/cairo X pdf; then - einfo "Please re-emerge >=x11-libs/cairo-1.2.2 with the X and pdf USE flag set" - die "Please emerge >=x11-libs/cairo-1.2.2 with the X and pdf flag set" - fi -} diff --git a/x11-wm/beryl/beryl-0.2.0.ebuild b/x11-wm/beryl/beryl-0.2.0.ebuild deleted file mode 100644 index fea26f7c6..000000000 --- a/x11-wm/beryl/beryl-0.2.0.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit eutils - -DESCRIPTION="Beryl window manager for AIGLX and XGL (meta)" -HOMEPAGE="http://beryl-project.org" -SRC_URI="" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" -IUSE="kde gnome" - -RDEPEND=" - ~x11-plugins/beryl-plugins-${PV} - ~x11-wm/emerald-${PV} - kde? ( ~x11-wm/aquamarine-${PV} ) - gnome? ( ~x11-wm/heliodor-${PV} ) - ~x11-misc/beryl-settings-${PV} - ~x11-misc/beryl-settings-simple-${PV} - ~x11-misc/beryl-manager-${PV} - >=x11-libs/cairo-1.2 - " - -pkg_setup() { - if has_version ">=x11-libs/cairo-1.2.2" && ! built_with_use x11-libs/cairo X pdf; then - einfo "Please re-emerge >=x11-libs/cairo-1.2.2 with the X and pdf USE flag set" - die "Please emerge >=x11-libs/cairo-1.2.2 with the X and pdf flag set" - fi -} diff --git a/x11-wm/beryl/files/digest-beryl-0.1.3-r1 b/x11-wm/beryl/files/digest-beryl-0.1.3-r1 deleted file mode 100644 index e69de29bb..000000000 diff --git a/x11-wm/beryl/files/digest-beryl-0.1.4 b/x11-wm/beryl/files/digest-beryl-0.1.4 deleted file mode 100644 index e69de29bb..000000000 diff --git a/x11-wm/beryl/files/digest-beryl-0.1.99.2 b/x11-wm/beryl/files/digest-beryl-0.1.99.2 deleted file mode 100644 index e69de29bb..000000000 diff --git a/x11-wm/beryl/files/digest-beryl-0.1.9999.1 b/x11-wm/beryl/files/digest-beryl-0.1.9999.1 deleted file mode 100644 index e69de29bb..000000000 diff --git a/x11-wm/beryl/files/digest-beryl-0.1.9999.2 b/x11-wm/beryl/files/digest-beryl-0.1.9999.2 deleted file mode 100644 index e69de29bb..000000000 diff --git a/x11-wm/beryl/files/digest-beryl-0.2.0 b/x11-wm/beryl/files/digest-beryl-0.2.0 deleted file mode 100644 index e69de29bb..000000000 diff --git a/x11-wm/beryl/files/digest-beryl-0.2.0-r1 b/x11-wm/beryl/files/digest-beryl-0.2.0-r1 deleted file mode 100644 index e69de29bb..000000000 diff --git a/x11-wm/emerald/Manifest b/x11-wm/emerald/Manifest deleted file mode 100644 index 1ea599477..000000000 --- a/x11-wm/emerald/Manifest +++ /dev/null @@ -1,48 +0,0 @@ -DIST emerald-0.1.3.tar.bz2 475217 RMD160 a6db714cb63c948bd2fb1f279aa79029def9af85 SHA1 ddd905df0504a4078ad97e0bd5cd8e3935d29ccc SHA256 29e63f4879f2c258dd3490dc981b35bb61efe3363904feac51cce77248c6650e -DIST emerald-0.1.4.tar.bz2 483008 RMD160 8e94dd8545c10d4edec76b5aa88392ad511eb59e SHA1 f5f5f1d31d816355402e0e4b9e394c4bd623e746 SHA256 8a0662e5fa6efeb5f9f25c8b0b8da7d6bab70913bd04aec40a560fcd5e975544 -DIST emerald-0.1.99.2.tar.bz2 479855 RMD160 befec55eb271ca81dc87f0d9d1d63bf0eb8675dc SHA1 331fe5c963b06379fd864f43858bfd29a58ddfa8 SHA256 057e69ec87bed2c071a4a759b55d3905174a69a0e6367cea52e29cf506784901 -DIST emerald-0.1.9999.1.tar.bz2 475765 RMD160 3c65a8518f340d6daac1dd8f59e2e68bdba0457d SHA1 504cf872ee6308b548a3bd607a18f344d2086daa SHA256 c39edee95ef39623ee8a96c6585471266b4de53c3037d4d77c339f407a8049a7 -DIST emerald-0.1.9999.2.tar.bz2 476060 RMD160 058a64e2e02ad92dc9988fbfef1a28091afb897d SHA1 f2208750eafa6cbdf0740581577c884c14cee3fe SHA256 a7d05256b658e5732c218b05431be16be73f82647c689ba79b49fdf94a146912 -DIST emerald-0.2.0.tar.bz2 501995 RMD160 902ecc21b7428bb47078f5a204dd71487fc7aacf SHA1 1463151b5b721b5db3371955d97814370e37e89e SHA256 a2ebf52003ddd3af1e510b72bd012600b3daab135a7593808af6284a4377ff03 -EBUILD emerald-0.1.3-r1.ebuild 656 RMD160 d2e87f73b9d39a1b943451e3d3f1c4b948e0afeb SHA1 452f79b7e0f9ae33b14f0ec91c6d59da86a45591 SHA256 5606dd2bed807eeef37477d160d1b4be91a4dab129b328030034aa18848a45b7 -MD5 334471ebc5c15cba43b661814a9b0dbe emerald-0.1.3-r1.ebuild 656 -RMD160 d2e87f73b9d39a1b943451e3d3f1c4b948e0afeb emerald-0.1.3-r1.ebuild 656 -SHA256 5606dd2bed807eeef37477d160d1b4be91a4dab129b328030034aa18848a45b7 emerald-0.1.3-r1.ebuild 656 -EBUILD emerald-0.1.4.ebuild 1048 RMD160 c2713320ac3900a9b868464ee104c386bf30b3c3 SHA1 72959b2bc032808c7183c3212f172101cc3e2431 SHA256 07058ccb9d1b6265823bf38afa153886874d646597349917a51af235c2e25260 -MD5 fa3c16447b7e5376b839bbcd0547a79f emerald-0.1.4.ebuild 1048 -RMD160 c2713320ac3900a9b868464ee104c386bf30b3c3 emerald-0.1.4.ebuild 1048 -SHA256 07058ccb9d1b6265823bf38afa153886874d646597349917a51af235c2e25260 emerald-0.1.4.ebuild 1048 -EBUILD emerald-0.1.99.2.ebuild 1030 RMD160 1f9544469435c7f743af1da42d8b548ea4349576 SHA1 6dff7a64b4772423797a7a68b3dccdf30f5ec19a SHA256 e4216e333af6767155fd6964a5fb0fd3b2cfbba5c5a6d04ee5e53f6173610655 -MD5 d73d3ac15b57e88ce65db3fe84fec53f emerald-0.1.99.2.ebuild 1030 -RMD160 1f9544469435c7f743af1da42d8b548ea4349576 emerald-0.1.99.2.ebuild 1030 -SHA256 e4216e333af6767155fd6964a5fb0fd3b2cfbba5c5a6d04ee5e53f6173610655 emerald-0.1.99.2.ebuild 1030 -EBUILD emerald-0.1.9999.1.ebuild 1030 RMD160 1f9544469435c7f743af1da42d8b548ea4349576 SHA1 6dff7a64b4772423797a7a68b3dccdf30f5ec19a SHA256 e4216e333af6767155fd6964a5fb0fd3b2cfbba5c5a6d04ee5e53f6173610655 -MD5 d73d3ac15b57e88ce65db3fe84fec53f emerald-0.1.9999.1.ebuild 1030 -RMD160 1f9544469435c7f743af1da42d8b548ea4349576 emerald-0.1.9999.1.ebuild 1030 -SHA256 e4216e333af6767155fd6964a5fb0fd3b2cfbba5c5a6d04ee5e53f6173610655 emerald-0.1.9999.1.ebuild 1030 -EBUILD emerald-0.1.9999.2.ebuild 1053 RMD160 785fdbaba4eb414b8d6714d8f432c7af472a2e7b SHA1 893689d6706d47f355fdb9a96b52ee72280df2c9 SHA256 c4844b4b17aea09b820e7a1770a1caef754f5dbb1eaae7fdccd36ed097b1e672 -MD5 f6d548e606735a7d9a6c7e2f43d6296e emerald-0.1.9999.2.ebuild 1053 -RMD160 785fdbaba4eb414b8d6714d8f432c7af472a2e7b emerald-0.1.9999.2.ebuild 1053 -SHA256 c4844b4b17aea09b820e7a1770a1caef754f5dbb1eaae7fdccd36ed097b1e672 emerald-0.1.9999.2.ebuild 1053 -EBUILD emerald-0.2.0.ebuild 1068 RMD160 f8a594b3944030aa5abc37c208377e1b5a976b8e SHA1 56cd9c2a18e5d8ba305a0a6bbe945c2091356322 SHA256 cc4848a4f2ce9177d1a614361176860dc38fdb0f46769ad7b30419719085f16f -MD5 3d79826d60bca74a099b8f5472da388f emerald-0.2.0.ebuild 1068 -RMD160 f8a594b3944030aa5abc37c208377e1b5a976b8e emerald-0.2.0.ebuild 1068 -SHA256 cc4848a4f2ce9177d1a614361176860dc38fdb0f46769ad7b30419719085f16f emerald-0.2.0.ebuild 1068 -MD5 ed4855156021a8c5e775711fa3f17bbc files/digest-emerald-0.1.3-r1 244 -RMD160 fdfddd690df9bcb3bc33be8be8514fc815647d57 files/digest-emerald-0.1.3-r1 244 -SHA256 9086aee75f5293bd4f6a24669c29aae30b4b4689275218cbc94822113a76a7ff files/digest-emerald-0.1.3-r1 244 -MD5 b3ed81d0e363892f68da81a8682a6eb1 files/digest-emerald-0.1.4 244 -RMD160 100c58f29ef242a7c4626743e0af049b4ad4c873 files/digest-emerald-0.1.4 244 -SHA256 b0a00f933c4c25f09a81375199ce2ba7d2663bf658fd9acf2a373917a9d38dda files/digest-emerald-0.1.4 244 -MD5 ae6663ba54a4137dddb73f0e9a89118f files/digest-emerald-0.1.99.2 253 -RMD160 3776bf151235a5721f2cabb5d91bedc78fe769bc files/digest-emerald-0.1.99.2 253 -SHA256 b2828b800a1f387d9be2ac7c823bf07bfde5c35ab2e0f33bcbb76245a8e3fade files/digest-emerald-0.1.99.2 253 -MD5 6f428ff677304ee1d592815c0dfd77ea files/digest-emerald-0.1.9999.1 259 -RMD160 30cb20f92be66149451439829f26756710c6898e files/digest-emerald-0.1.9999.1 259 -SHA256 bb0057b2f3f365f3f468afd3579464886d48da5f0eda30347d43e61dcfd04ca4 files/digest-emerald-0.1.9999.1 259 -MD5 64cdc8222733370cb6325b614e9ba9c3 files/digest-emerald-0.1.9999.2 259 -RMD160 485251a584b9c8c644ce2f7f3a1c7f36fcaf110a files/digest-emerald-0.1.9999.2 259 -SHA256 a9e677c5d4f8b82f0901ba816dfbcfe858815b4d1e5c44185680a0bc94bf30bb files/digest-emerald-0.1.9999.2 259 -MD5 9ce460b3c9c45c1cd53876ba911b41b9 files/digest-emerald-0.2.0 244 -RMD160 b812549040770a562479dd09d3ec389ca96937fc files/digest-emerald-0.2.0 244 -SHA256 3e1e93c6803239aefdb434053a0bd68655554299d165afd34c7d06694a040df0 files/digest-emerald-0.2.0 244 diff --git a/x11-wm/emerald/emerald-0.1.3-r1.ebuild b/x11-wm/emerald/emerald-0.1.3-r1.ebuild deleted file mode 100644 index 1036990bd..000000000 --- a/x11-wm/emerald/emerald-0.1.3-r1.ebuild +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/emerald/emerald-0.1.2.ebuild,v 1.1 2006/11/15 04:05:42 tsunam Exp $ - -inherit gnome2 - -DESCRIPTION="Beryl Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://distfiles.gentoo-xeffects.org/beryl-releases/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" -IUSE="" -RESTRICT="nomirror" - -PDEPEND="~x11-themes/emerald-themes-${PV}" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - ~x11-wm/beryl-core-${PV}" - -src_compile() { - gnome2_src_compile --disable-mime-update -} diff --git a/x11-wm/emerald/emerald-0.1.4.ebuild b/x11-wm/emerald/emerald-0.1.4.ebuild deleted file mode 100644 index cc26ce8a1..000000000 --- a/x11-wm/emerald/emerald-0.1.4.ebuild +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2004-2006 Sabayonlinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit gnome2 flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - - -PDEPEND="~x11-themes/emerald-themes-${PV}" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - ~x11-wm/beryl-core-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - - #if [ -z "${LINGUAS}" ]; then - # export LINGUAS_EMERALD="en_GB" - # ewarn - # ewarn " To get a localized build, set the according LINGUAS variable(s). " - # ewarn - #else - export LINGUAS_EMERALD=`echo ${LINGUAS}` - #fi -} - -src_compile() { - append-flags -fno-inline - - gnome2_src_compile --disable-mime-update # --with-lang="${LINGUAS_EMERALD}" -} diff --git a/x11-wm/emerald/emerald-0.1.99.2.ebuild b/x11-wm/emerald/emerald-0.1.99.2.ebuild deleted file mode 100644 index 601648346..000000000 --- a/x11-wm/emerald/emerald-0.1.99.2.ebuild +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2004-2006 Sabayonlinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit gnome2 flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - - -PDEPEND="~x11-themes/emerald-themes-${PV}" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - ~x11-wm/beryl-core-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - -if [ -z "${LINGUAS}" ]; then - export LINGUAS_EMERALD="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_EMERALD=`echo ${LINGUAS}` -fi -} - -src_compile() { - append-flags -fno-inline - - gnome2_src_compile --disable-mime-update --with-lang="${LINGUAS_EMERALD}" -} diff --git a/x11-wm/emerald/emerald-0.1.9999.1.ebuild b/x11-wm/emerald/emerald-0.1.9999.1.ebuild deleted file mode 100644 index 601648346..000000000 --- a/x11-wm/emerald/emerald-0.1.9999.1.ebuild +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2004-2006 Sabayonlinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit gnome2 flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64" - - -PDEPEND="~x11-themes/emerald-themes-${PV}" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - ~x11-wm/beryl-core-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - -if [ -z "${LINGUAS}" ]; then - export LINGUAS_EMERALD="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_EMERALD=`echo ${LINGUAS}` -fi -} - -src_compile() { - append-flags -fno-inline - - gnome2_src_compile --disable-mime-update --with-lang="${LINGUAS_EMERALD}" -} diff --git a/x11-wm/emerald/emerald-0.1.9999.2.ebuild b/x11-wm/emerald/emerald-0.1.9999.2.ebuild deleted file mode 100644 index d783ace4b..000000000 --- a/x11-wm/emerald/emerald-0.1.9999.2.ebuild +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2004-2006 Sabayonlinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit gnome2 flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/0.1.9999.2/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" - - -PDEPEND="~x11-themes/emerald-themes-${PV}" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - ~x11-wm/beryl-core-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - -if [ -z "${LINGUAS}" ]; then - export LINGUAS_EMERALD="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_EMERALD=`echo ${LINGUAS}` -fi -} - -src_compile() { - append-flags -fno-inline - - gnome2_src_compile --disable-mime-update --with-lang="${LINGUAS_EMERALD}" -} diff --git a/x11-wm/emerald/emerald-0.2.0.ebuild b/x11-wm/emerald/emerald-0.2.0.ebuild deleted file mode 100644 index a86dc5d53..000000000 --- a/x11-wm/emerald/emerald-0.2.0.ebuild +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2004-2006 Sabayonlinux -# Distributed under the terms of the GNU General Public License v2 -# $Header: Exp $ - -inherit gnome2 flag-o-matic eutils - -IUSE="" -LANGS="ca_ES de_DE en_GB es_AR es_ES fr_FR hu_HU it_IT ja_JP ko_KR ru_RU pl_PL pt_BR pt_PT sv_FI sv_SE uk_UA zh_CN zh_HK zh_TW" - -for X in ${LANGS} ; do - IUSE="${IUSE} linguas_${X}" -done - -DESCRIPTION="Beryl Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~x86 ~amd64 ~ppc ~ppc64" -RESTRICT="nomirror" - - -PDEPEND="~x11-themes/emerald-themes-${PV}" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - ~x11-wm/beryl-core-${PV}" - -pkg_setup() { - strip-linguas ${LANGS} - -if [ -z "${LINGUAS}" ]; then - export LINGUAS_EMERALD="en_GB" - ewarn - ewarn " To get a localized build, set the according LINGUAS variable(s). " - ewarn - else - export LINGUAS_EMERALD=`echo ${LINGUAS}` -fi -} - -src_compile() { - append-flags -fno-inline - - gnome2_src_compile --disable-mime-update --with-lang="${LINGUAS_EMERALD}" -} diff --git a/x11-wm/emerald/files/digest-emerald-0.1.3-r1 b/x11-wm/emerald/files/digest-emerald-0.1.3-r1 deleted file mode 100644 index be160a36e..000000000 --- a/x11-wm/emerald/files/digest-emerald-0.1.3-r1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 27655582912eed701eef07083d445699 emerald-0.1.3.tar.bz2 475217 -RMD160 a6db714cb63c948bd2fb1f279aa79029def9af85 emerald-0.1.3.tar.bz2 475217 -SHA256 29e63f4879f2c258dd3490dc981b35bb61efe3363904feac51cce77248c6650e emerald-0.1.3.tar.bz2 475217 diff --git a/x11-wm/emerald/files/digest-emerald-0.1.4 b/x11-wm/emerald/files/digest-emerald-0.1.4 deleted file mode 100644 index 73e3d4695..000000000 --- a/x11-wm/emerald/files/digest-emerald-0.1.4 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 a0f35a6c0b592d687a5ea7e1e25f8bd0 emerald-0.1.4.tar.bz2 483008 -RMD160 8e94dd8545c10d4edec76b5aa88392ad511eb59e emerald-0.1.4.tar.bz2 483008 -SHA256 8a0662e5fa6efeb5f9f25c8b0b8da7d6bab70913bd04aec40a560fcd5e975544 emerald-0.1.4.tar.bz2 483008 diff --git a/x11-wm/emerald/files/digest-emerald-0.1.99.2 b/x11-wm/emerald/files/digest-emerald-0.1.99.2 deleted file mode 100644 index 7979b450f..000000000 --- a/x11-wm/emerald/files/digest-emerald-0.1.99.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 fdcc88cd8e75e144a07138525e342370 emerald-0.1.99.2.tar.bz2 479855 -RMD160 befec55eb271ca81dc87f0d9d1d63bf0eb8675dc emerald-0.1.99.2.tar.bz2 479855 -SHA256 057e69ec87bed2c071a4a759b55d3905174a69a0e6367cea52e29cf506784901 emerald-0.1.99.2.tar.bz2 479855 diff --git a/x11-wm/emerald/files/digest-emerald-0.1.9999.1 b/x11-wm/emerald/files/digest-emerald-0.1.9999.1 deleted file mode 100644 index 725545753..000000000 --- a/x11-wm/emerald/files/digest-emerald-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 c7d59e008ad031c65b621bbcd8868588 emerald-0.1.9999.1.tar.bz2 475765 -RMD160 3c65a8518f340d6daac1dd8f59e2e68bdba0457d emerald-0.1.9999.1.tar.bz2 475765 -SHA256 c39edee95ef39623ee8a96c6585471266b4de53c3037d4d77c339f407a8049a7 emerald-0.1.9999.1.tar.bz2 475765 diff --git a/x11-wm/emerald/files/digest-emerald-0.1.9999.2 b/x11-wm/emerald/files/digest-emerald-0.1.9999.2 deleted file mode 100644 index c7cc83bce..000000000 --- a/x11-wm/emerald/files/digest-emerald-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 0c4af63653a51cb8e095e517faa493bf emerald-0.1.9999.2.tar.bz2 476060 -RMD160 058a64e2e02ad92dc9988fbfef1a28091afb897d emerald-0.1.9999.2.tar.bz2 476060 -SHA256 a7d05256b658e5732c218b05431be16be73f82647c689ba79b49fdf94a146912 emerald-0.1.9999.2.tar.bz2 476060 diff --git a/x11-wm/emerald/files/digest-emerald-0.2.0 b/x11-wm/emerald/files/digest-emerald-0.2.0 deleted file mode 100644 index be7ccaf3f..000000000 --- a/x11-wm/emerald/files/digest-emerald-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 2439bc2ed32784590bacb143f0f01ea6 emerald-0.2.0.tar.bz2 501995 -RMD160 902ecc21b7428bb47078f5a204dd71487fc7aacf emerald-0.2.0.tar.bz2 501995 -SHA256 a2ebf52003ddd3af1e510b72bd012600b3daab135a7593808af6284a4377ff03 emerald-0.2.0.tar.bz2 501995 diff --git a/x11-wm/heliodor/Manifest b/x11-wm/heliodor/Manifest deleted file mode 100644 index 58363c20d..000000000 --- a/x11-wm/heliodor/Manifest +++ /dev/null @@ -1,40 +0,0 @@ -DIST heliodor-0.1.4.tar.bz2 260551 RMD160 e0bea54137cadd44bfa65d3ba4f53df8214f355c SHA1 f5d96bd560cb17de158c5387dd33f2f27e3a863d SHA256 c2f7de85df581bff6e39d8992ccf1e59fe54b8f08f94963d874f06e3918fe341 -DIST heliodor-0.1.99.2.tar.bz2 234501 RMD160 ef52c0fbedd83d9aaf993abc4ad4b408cda8f5fb SHA1 13fef98a68991659e9048036322658fde6680d7b SHA256 f19f2970d820ac224b9ccaacfe9a5e80e2bce5743fa989c6d3df3924d1ddc0d2 -DIST heliodor-0.1.9999.1.tar.bz2 234627 RMD160 842fb6ee7596aca6635a0602b27bac7897bd79cd SHA1 5ba2e9f3fa83fba3494a782c3dc6f6450b293f17 SHA256 42e5f28b406350c14bd4245cc583eb1f2fe51e3e30fd46ecf47ff9fd7fdf2c63 -DIST heliodor-0.1.9999.2.tar.bz2 245797 RMD160 5ecc0517c147a049efa5db2d8ad7943df30305f8 SHA1 cc1536e4c4c309e68e420a56331f4844c557a45b SHA256 048b150cdfa0b37fb3c70afbdd9295400a43cc6b25341d7b5f44443312075f32 -DIST heliodor-0.2.0.tar.bz2 252785 RMD160 67e3a5cb837a6abd47c4991cbe2096c13941a0a3 SHA1 9c99e12311220d552be7f896067746d56a9fd389 SHA256 2b7abbcc68d535fdd7dfe4d6ecb7cddb6c4e73b83893174afd52987e00f549c5 -EBUILD heliodor-0.1.4.ebuild 763 RMD160 28ffdf46f0e869d120b29d3a757cd08f938c1678 SHA1 14abd643cd20aac58db79ba6346810abcf62f35a SHA256 dd8e77a1ae64ac41c6fb4156ed62e527dafea4d0c0ac22f724d380da38403392 -MD5 9c61a9c002f2aa9d5f59c7cd34223799 heliodor-0.1.4.ebuild 763 -RMD160 28ffdf46f0e869d120b29d3a757cd08f938c1678 heliodor-0.1.4.ebuild 763 -SHA256 dd8e77a1ae64ac41c6fb4156ed62e527dafea4d0c0ac22f724d380da38403392 heliodor-0.1.4.ebuild 763 -EBUILD heliodor-0.1.99.2.ebuild 757 RMD160 ea792cbad7da74ed6ec2892efcc0cc58a42b9a06 SHA1 ee8c12965691ea6e34cb19b650c7b294f7fd3c41 SHA256 87e18161a3e200184f996204fd7221bca815432a8f62082625d2f43a2ea46f6b -MD5 f68c484cf06fac2319fc5e2083eda8f3 heliodor-0.1.99.2.ebuild 757 -RMD160 ea792cbad7da74ed6ec2892efcc0cc58a42b9a06 heliodor-0.1.99.2.ebuild 757 -SHA256 87e18161a3e200184f996204fd7221bca815432a8f62082625d2f43a2ea46f6b heliodor-0.1.99.2.ebuild 757 -EBUILD heliodor-0.1.9999.1.ebuild 757 RMD160 ea792cbad7da74ed6ec2892efcc0cc58a42b9a06 SHA1 ee8c12965691ea6e34cb19b650c7b294f7fd3c41 SHA256 87e18161a3e200184f996204fd7221bca815432a8f62082625d2f43a2ea46f6b -MD5 f68c484cf06fac2319fc5e2083eda8f3 heliodor-0.1.9999.1.ebuild 757 -RMD160 ea792cbad7da74ed6ec2892efcc0cc58a42b9a06 heliodor-0.1.9999.1.ebuild 757 -SHA256 87e18161a3e200184f996204fd7221bca815432a8f62082625d2f43a2ea46f6b heliodor-0.1.9999.1.ebuild 757 -EBUILD heliodor-0.1.9999.2.ebuild 770 RMD160 c1ce3c2086bafb5c140839d4b79c9b35c13d3e63 SHA1 6943151155e997162957a598345c80a943fbc9a9 SHA256 749cd38ae574b5bf0619a7d678ecb3f69975c797c2fa2ed47dfc4525fcf7b54f -MD5 316cd890b3219f1b32f90a7c49bbcbd7 heliodor-0.1.9999.2.ebuild 770 -RMD160 c1ce3c2086bafb5c140839d4b79c9b35c13d3e63 heliodor-0.1.9999.2.ebuild 770 -SHA256 749cd38ae574b5bf0619a7d678ecb3f69975c797c2fa2ed47dfc4525fcf7b54f heliodor-0.1.9999.2.ebuild 770 -EBUILD heliodor-0.2.0.ebuild 790 RMD160 0e6d5f11b397f766d0abff6abfda66b41362609d SHA1 5e7393231d506e7bb25f3e0de05508554b267d27 SHA256 2b63bdac3de39602c3babfac8262f14483458425a7efda92386bfde3cbb90507 -MD5 f3f4caec4571afbf2dd74d055651b23e heliodor-0.2.0.ebuild 790 -RMD160 0e6d5f11b397f766d0abff6abfda66b41362609d heliodor-0.2.0.ebuild 790 -SHA256 2b63bdac3de39602c3babfac8262f14483458425a7efda92386bfde3cbb90507 heliodor-0.2.0.ebuild 790 -MD5 235a4d5effa9254a9baf429338c75a87 files/digest-heliodor-0.1.4 247 -RMD160 09b6fc02cbc5b7b0b7357c747afd83a2ee072882 files/digest-heliodor-0.1.4 247 -SHA256 b4595a8a6f6c32520d3f70fbe87e19d3546013273a22c8ce9455c579955b7857 files/digest-heliodor-0.1.4 247 -MD5 f51d8dde0bf657532d5be96425e430bf files/digest-heliodor-0.1.99.2 256 -RMD160 00014556037ee7c790be300854a0da447714b167 files/digest-heliodor-0.1.99.2 256 -SHA256 b2e48400e08caee3e3b5a654637ea5a189c27e856a12fb37ed7b79c230c79971 files/digest-heliodor-0.1.99.2 256 -MD5 98e29b6de60252d5d4097424f140bf2a files/digest-heliodor-0.1.9999.1 262 -RMD160 9b363bfa5a04023cea765e8f321dbf2a8c3969a8 files/digest-heliodor-0.1.9999.1 262 -SHA256 054b83b364f17f83e091cbf7323939967987c6f4eed9002bb5d3b33000f2b90d files/digest-heliodor-0.1.9999.1 262 -MD5 81355614528c10f38a07e02940077d24 files/digest-heliodor-0.1.9999.2 262 -RMD160 c566367ea643b793e4706806d4d195f1b7f6cf64 files/digest-heliodor-0.1.9999.2 262 -SHA256 5416c60a1350899c46176986d0da10d14d57a06be4e6bce0bb48b1459855d819 files/digest-heliodor-0.1.9999.2 262 -MD5 6f9dd3ded60f29630b1643a932a45469 files/digest-heliodor-0.2.0 247 -RMD160 b1b471506bdf66f5bdf8e1ffea2ad39bdd82d9d1 files/digest-heliodor-0.2.0 247 -SHA256 50e626fe552a32d9141f34c558771259687ca2a73819e5a82f89cfb4a71c47c8 files/digest-heliodor-0.2.0 247 diff --git a/x11-wm/heliodor/files/digest-heliodor-0.1.4 b/x11-wm/heliodor/files/digest-heliodor-0.1.4 deleted file mode 100644 index 2e507e62b..000000000 --- a/x11-wm/heliodor/files/digest-heliodor-0.1.4 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 d483ec9bf8aafdcd035d4195e39647ae heliodor-0.1.4.tar.bz2 260551 -RMD160 e0bea54137cadd44bfa65d3ba4f53df8214f355c heliodor-0.1.4.tar.bz2 260551 -SHA256 c2f7de85df581bff6e39d8992ccf1e59fe54b8f08f94963d874f06e3918fe341 heliodor-0.1.4.tar.bz2 260551 diff --git a/x11-wm/heliodor/files/digest-heliodor-0.1.99.2 b/x11-wm/heliodor/files/digest-heliodor-0.1.99.2 deleted file mode 100644 index 463cd6c1b..000000000 --- a/x11-wm/heliodor/files/digest-heliodor-0.1.99.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 91a18d56cfa3be06dbb551e29b836921 heliodor-0.1.99.2.tar.bz2 234501 -RMD160 ef52c0fbedd83d9aaf993abc4ad4b408cda8f5fb heliodor-0.1.99.2.tar.bz2 234501 -SHA256 f19f2970d820ac224b9ccaacfe9a5e80e2bce5743fa989c6d3df3924d1ddc0d2 heliodor-0.1.99.2.tar.bz2 234501 diff --git a/x11-wm/heliodor/files/digest-heliodor-0.1.9999.1 b/x11-wm/heliodor/files/digest-heliodor-0.1.9999.1 deleted file mode 100644 index 0b4c3513c..000000000 --- a/x11-wm/heliodor/files/digest-heliodor-0.1.9999.1 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 e790e20027b146567a99a758f5cf7c30 heliodor-0.1.9999.1.tar.bz2 234627 -RMD160 842fb6ee7596aca6635a0602b27bac7897bd79cd heliodor-0.1.9999.1.tar.bz2 234627 -SHA256 42e5f28b406350c14bd4245cc583eb1f2fe51e3e30fd46ecf47ff9fd7fdf2c63 heliodor-0.1.9999.1.tar.bz2 234627 diff --git a/x11-wm/heliodor/files/digest-heliodor-0.1.9999.2 b/x11-wm/heliodor/files/digest-heliodor-0.1.9999.2 deleted file mode 100644 index 093f0fdd4..000000000 --- a/x11-wm/heliodor/files/digest-heliodor-0.1.9999.2 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 d40642d79a53367c5f41ab6c6dfdc9f6 heliodor-0.1.9999.2.tar.bz2 245797 -RMD160 5ecc0517c147a049efa5db2d8ad7943df30305f8 heliodor-0.1.9999.2.tar.bz2 245797 -SHA256 048b150cdfa0b37fb3c70afbdd9295400a43cc6b25341d7b5f44443312075f32 heliodor-0.1.9999.2.tar.bz2 245797 diff --git a/x11-wm/heliodor/files/digest-heliodor-0.2.0 b/x11-wm/heliodor/files/digest-heliodor-0.2.0 deleted file mode 100644 index a99622771..000000000 --- a/x11-wm/heliodor/files/digest-heliodor-0.2.0 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 ccbcdab0a90e4d5250cc2d58faeadd17 heliodor-0.2.0.tar.bz2 252785 -RMD160 67e3a5cb837a6abd47c4991cbe2096c13941a0a3 heliodor-0.2.0.tar.bz2 252785 -SHA256 2b7abbcc68d535fdd7dfe4d6ecb7cddb6c4e73b83893174afd52987e00f549c5 heliodor-0.2.0.tar.bz2 252785 diff --git a/x11-wm/heliodor/heliodor-0.1.4.ebuild b/x11-wm/heliodor/heliodor-0.1.4.ebuild deleted file mode 100644 index 573fe5623..000000000 --- a/x11-wm/heliodor/heliodor-0.1.4.ebuild +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/heliodor/heliodor-0.1.3.ebuild,v 1.1 2006/12/19 22:11:34 tsunam Exp $ - -inherit eutils - -DESCRIPTION="Beryl Metacity Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc" -IUSE="" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - >=gnome-base/gconf-2 - >=gnome-base/control-center-2.14 - >=x11-wm/metacity-2.16 - ~x11-wm/beryl-core-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "emake failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - diff --git a/x11-wm/heliodor/heliodor-0.1.99.2.ebuild b/x11-wm/heliodor/heliodor-0.1.99.2.ebuild deleted file mode 100644 index 8466daf92..000000000 --- a/x11-wm/heliodor/heliodor-0.1.99.2.ebuild +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/heliodor/heliodor-0.1.3.ebuild,v 1.1 2006/12/19 22:11:34 tsunam Exp $ - -inherit eutils - -DESCRIPTION="Beryl Metacity Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc" -IUSE="" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - >=gnome-base/gconf-2 - >=gnome-base/control-center-2.14 - >=x11-wm/metacity-2.16 - ~x11-wm/beryl-core-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "emake failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - diff --git a/x11-wm/heliodor/heliodor-0.1.9999.1.ebuild b/x11-wm/heliodor/heliodor-0.1.9999.1.ebuild deleted file mode 100644 index 8466daf92..000000000 --- a/x11-wm/heliodor/heliodor-0.1.9999.1.ebuild +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/heliodor/heliodor-0.1.3.ebuild,v 1.1 2006/12/19 22:11:34 tsunam Exp $ - -inherit eutils - -DESCRIPTION="Beryl Metacity Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://sabayonlinux.org/distfiles/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc" -IUSE="" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - >=gnome-base/gconf-2 - >=gnome-base/control-center-2.14 - >=x11-wm/metacity-2.16 - ~x11-wm/beryl-core-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "emake failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - diff --git a/x11-wm/heliodor/heliodor-0.1.9999.2.ebuild b/x11-wm/heliodor/heliodor-0.1.9999.2.ebuild deleted file mode 100644 index 70c2c68db..000000000 --- a/x11-wm/heliodor/heliodor-0.1.9999.2.ebuild +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/heliodor/heliodor-0.1.3.ebuild,v 1.1 2006/12/19 22:11:34 tsunam Exp $ - -inherit eutils - -DESCRIPTION="Beryl Metacity Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc ~ppc64" -IUSE="" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - >=gnome-base/gconf-2 - >=gnome-base/control-center-2.14 - >=x11-wm/metacity-2.16 - ~x11-wm/beryl-core-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "emake failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} - diff --git a/x11-wm/heliodor/heliodor-0.2.0.ebuild b/x11-wm/heliodor/heliodor-0.2.0.ebuild deleted file mode 100644 index 07fd86368..000000000 --- a/x11-wm/heliodor/heliodor-0.2.0.ebuild +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 1999-2006 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-wm/heliodor/heliodor-0.1.3.ebuild,v 1.1 2006/12/19 22:11:34 tsunam Exp $ - -inherit eutils - -DESCRIPTION="Beryl Metacity Window Decorator" -HOMEPAGE="http://beryl-project.org" -SRC_URI="http://releases.beryl-project.org/${PV}/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~ppc ~ppc64" -IUSE="" -RESTRICT="nomirror" - -DEPEND=">=x11-libs/gtk+-2.8.0 - >=x11-libs/libwnck-2.14.2 - >=gnome-base/gconf-2 - >=gnome-base/control-center-2.14 - >=x11-wm/metacity-2.16 - ~x11-wm/beryl-core-${PV}" - -src_compile() { - econf || die "econf failed" - emake || die "emake failed" -} - -src_install() { - make DESTDIR="${D}" install || die "make install failed" -} -